<div>
    <div x-data="{
        show: false,
        type: 'success',
        message: '',
        progress: 100,
        startTimer(newType, newMessage) {
            this.type = newType;
            this.message = newMessage;
            this.show = true;
            this.progress = 100;
            let interval = setInterval(() => {
                this.progress -= 100 / (3000 / 50); // reduce progress every 50ms for 3s
                if (this.progress <= 0) {
                    this.show = false;
                    clearInterval(interval);
                }
            }, 50);
        }
    }" x-cloak x-show="show" x-init="window.addEventListener('showToast', event => { startTimer(event.detail.type, event.detail.message) })" x-transition
        class="fixed top-5 left-5 z-50 px-4 py-3 rounded-md text-sm shadow-lg border-l-4 flex items-center space-x-2"
        :class="{
            'bg-green-100 border-green-500 text-green-700': type === 'success',
            'bg-red-100 border-red-500 text-red-700': type === 'error',
            'bg-yellow-100 border-yellow-500 text-yellow-700': type === 'warning'
        }">
        <!-- Icons -->
        <template x-if="type === 'success'">
            <?php if (isset($component)) { $__componentOriginal99e1287553cbf55f278732425b3f00bd = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal99e1287553cbf55f278732425b3f00bd = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'e60dd9d2c3a62d619c9acb38f20d5aa5::icon.check-circle','data' => ['class' => 'w-5 h-5 shrink-0']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('flux::icon.check-circle'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['class' => 'w-5 h-5 shrink-0']); ?>
<?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::processComponentKey($component); ?>

<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal99e1287553cbf55f278732425b3f00bd)): ?>
<?php $attributes = $__attributesOriginal99e1287553cbf55f278732425b3f00bd; ?>
<?php unset($__attributesOriginal99e1287553cbf55f278732425b3f00bd); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal99e1287553cbf55f278732425b3f00bd)): ?>
<?php $component = $__componentOriginal99e1287553cbf55f278732425b3f00bd; ?>
<?php unset($__componentOriginal99e1287553cbf55f278732425b3f00bd); ?>
<?php endif; ?>
        </template>
        <template x-if="type === 'error'">
            <?php if (isset($component)) { $__componentOriginalc684311ed41ad32bac1c158a93d68bb7 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalc684311ed41ad32bac1c158a93d68bb7 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'e60dd9d2c3a62d619c9acb38f20d5aa5::icon.x-circle','data' => ['class' => 'w-5 h-5 shrink-0']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('flux::icon.x-circle'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['class' => 'w-5 h-5 shrink-0']); ?>
<?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::processComponentKey($component); ?>

<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalc684311ed41ad32bac1c158a93d68bb7)): ?>
<?php $attributes = $__attributesOriginalc684311ed41ad32bac1c158a93d68bb7; ?>
<?php unset($__attributesOriginalc684311ed41ad32bac1c158a93d68bb7); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc684311ed41ad32bac1c158a93d68bb7)): ?>
<?php $component = $__componentOriginalc684311ed41ad32bac1c158a93d68bb7; ?>
<?php unset($__componentOriginalc684311ed41ad32bac1c158a93d68bb7); ?>
<?php endif; ?>
        </template>
        <template x-if="type === 'warning'">
            <?php if (isset($component)) { $__componentOriginalc684311ed41ad32bac1c158a93d68bb7 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalc684311ed41ad32bac1c158a93d68bb7 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'e60dd9d2c3a62d619c9acb38f20d5aa5::icon.x-circle','data' => ['class' => 'w-5 h-5 shrink-0']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('flux::icon.x-circle'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['class' => 'w-5 h-5 shrink-0']); ?>
<?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::processComponentKey($component); ?>

<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalc684311ed41ad32bac1c158a93d68bb7)): ?>
<?php $attributes = $__attributesOriginalc684311ed41ad32bac1c158a93d68bb7; ?>
<?php unset($__attributesOriginalc684311ed41ad32bac1c158a93d68bb7); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc684311ed41ad32bac1c158a93d68bb7)): ?>
<?php $component = $__componentOriginalc684311ed41ad32bac1c158a93d68bb7; ?>
<?php unset($__componentOriginalc684311ed41ad32bac1c158a93d68bb7); ?>
<?php endif; ?>
        </template>

        <div x-text="message"></div>

        <div class="absolute bottom-0 left-0 h-1 bg-current transition-all duration-50" :style="`width: ${progress}%`">
        </div>
    </div>

    <div wire:ignore x-data="{
        open: false,
        type: '',
        amount: '',
        title: '',
        iconClasses: {
            deposit: 'bg-green-100 text-green-600',
            withdrawal: 'bg-red-100 text-red-600',
            transfer: 'bg-blue-100 text-blue-600',
            default: 'bg-gray-100 text-gray-600'
        }
    }"
        x-on:transaction-success.window="
         open = true;
         type = $event.detail.type ?? 'default';
         amount = Number($event.detail.amount ?? 0)
             .toLocaleString('en-US', { style: 'currency', currency: 'USD' });
         title = type.charAt(0).toUpperCase() + type.slice(1) + ' Submitted';
     "
        x-cloak>

        <!-- Overlay -->
        <div x-show="open" x-transition.opacity class="fixed inset-0 bg-black/50 z-40" @click="open = false"></div>

        <!-- Modal Wrapper -->
        <div x-show="open" x-transition class="fixed inset-0 z-50 flex items-center justify-center px-4">
            <div class="bg-white dark:bg-gray-900 rounded-2xl shadow-xl max-w-md w-full p-6" @click.stop>

                <!-- Icon -->
                <div class="flex justify-center mb-4">
                    <div class="h-14 w-14 rounded-full flex items-center justify-center bg-green-600 text-white">
                        <?php if (isset($component)) { $__componentOriginal9c2dfd6cb98f4df18e26d1694500af11 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal9c2dfd6cb98f4df18e26d1694500af11 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'e60dd9d2c3a62d619c9acb38f20d5aa5::icon.check','data' => ['class' => 'w-8 h-8']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('flux::icon.check'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['class' => 'w-8 h-8']); ?>
<?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::processComponentKey($component); ?>

<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal9c2dfd6cb98f4df18e26d1694500af11)): ?>
<?php $attributes = $__attributesOriginal9c2dfd6cb98f4df18e26d1694500af11; ?>
<?php unset($__attributesOriginal9c2dfd6cb98f4df18e26d1694500af11); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal9c2dfd6cb98f4df18e26d1694500af11)): ?>
<?php $component = $__componentOriginal9c2dfd6cb98f4df18e26d1694500af11; ?>
<?php unset($__componentOriginal9c2dfd6cb98f4df18e26d1694500af11); ?>
<?php endif; ?>
                    </div>
                </div>


                <!-- Title -->
                <h2 class="text-lg font-semibold text-center text-gray-900 dark:text-gray-100" x-text="title"></h2>

                <!-- Message -->
                <p class="text-sm text-center text-gray-500 dark:text-gray-400 mt-2">
                    Your <span x-text="type"></span> of
                    <span class="font-semibold" x-text="amount"></span>
                    has been submitted and is pending confirmation.
                </p>

                <!-- Actions -->
                <div class="mt-6 flex justify-center">
                    <button @click="open = false"
                        class="px-6 py-2 rounded-xl bg-indigo-600 text-white hover:bg-indigo-700 transition">
                        Done
                    </button>
                </div>

            </div>
        </div>
    </div>

</div>
<?php /**PATH /Users/macuser/Herd/Novabank/resources/views/components/ui/⚡toast/toast.blade.php ENDPATH**/ ?>