<?php $attributes ??= new \Illuminate\View\ComponentAttributeBag;

$__newAttributes = [];
$__propNames = \Illuminate\View\ComponentAttributeBag::extractPropNames((['announcements']));

foreach ($attributes->all() as $__key => $__value) {
    if (in_array($__key, $__propNames)) {
        $$__key = $$__key ?? $__value;
    } else {
        $__newAttributes[$__key] = $__value;
    }
}

$attributes = new \Illuminate\View\ComponentAttributeBag($__newAttributes);

unset($__propNames);
unset($__newAttributes);

foreach (array_filter((['announcements']), 'is_string', ARRAY_FILTER_USE_KEY) as $__key => $__value) {
    $$__key = $$__key ?? $__value;
}

$__defined_vars = get_defined_vars();

foreach ($attributes->all() as $__key => $__value) {
    if (array_key_exists($__key, $__defined_vars)) unset($$__key);
}

unset($__defined_vars, $__key, $__value); ?>

<?php if($announcements->isNotEmpty()): ?>
    <div class="mb-4 space-y-2" x-data="{
        key: 'pb.dismissedAnnouncements',
        dismissed: [],
        init() {
            try {
                this.dismissed = JSON.parse(localStorage.getItem(this.key) || '[]');
            } catch (e) { this.dismissed = []; }
        },
        isHidden(id) { return this.dismissed.includes(id); },
        dismiss(id) {
            if (!this.dismissed.includes(id)) this.dismissed.push(id);
            localStorage.setItem(this.key, JSON.stringify(this.dismissed));
        }
    }">
        <?php $__currentLoopData = $announcements; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ann): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <div
                x-show="!isHidden(<?php echo e($ann->id); ?>)"
                x-cloak
                class="rounded-xl border px-4 py-3 text-sm shadow-sm
                    <?php switch($ann->severity):
                        case ('critical'): ?> border-rose-300/80 bg-rose-50 text-rose-950 dark:border-rose-500/40 dark:bg-rose-950/40 dark:text-rose-50 <?php break; ?>
                        <?php case ('warning'): ?> border-amber-300/80 bg-amber-50 text-amber-950 dark:border-amber-500/40 dark:bg-amber-950/35 dark:text-amber-50 <?php break; ?>
                        <?php default: ?> border-indigo-200/80 bg-indigo-50/90 text-slate-900 dark:border-indigo-500/35 dark:bg-indigo-950/40 dark:text-indigo-50
                    <?php endswitch; ?>
                "
                role="status"
            >
                <div class="flex items-start gap-3">
                    <div class="min-w-0 flex-1">
                        <p class="font-bold tracking-tight"><?php echo e($ann->title); ?></p>
                        <p class="mt-1 whitespace-pre-line text-[13px] leading-relaxed opacity-95"><?php echo e($ann->body); ?></p>
                        <?php if($ann->starts_at || $ann->ends_at): ?>
                            <p class="mt-2 text-[11px] font-semibold uppercase tracking-wide opacity-80">
                                <?php if($ann->starts_at): ?>
                                    <span>From <?php echo e($ann->starts_at->timezone(config('app.timezone'))->format('M j, Y g:i A')); ?></span>
                                <?php endif; ?>
                                <?php if($ann->ends_at): ?>
                                    <span class="ml-2">· Until <?php echo e($ann->ends_at->timezone(config('app.timezone'))->format('M j, Y g:i A')); ?></span>
                                <?php endif; ?>
                            </p>
                        <?php endif; ?>
                    </div>
                    <button
                        type="button"
                        class="shrink-0 rounded-lg p-1 opacity-70 hover:opacity-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400"
                        @click="dismiss(<?php echo e($ann->id); ?>)"
                        aria-label="Dismiss announcement"
                    >
                        <svg class="h-4 w-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M18 6 6 18M6 6l12 12"/></svg>
                    </button>
                </div>
            </div>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    </div>
<?php endif; ?>
<?php /**PATH C:\xampp\htdocs\ispbilling\resources\views/components/system-announcements-banner.blade.php ENDPATH**/ ?>