ga-toasts 1.0.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,556 @@
1
+ "use strict";var GaToasts=(()=>{var H=Object.defineProperty;var ot=Object.getOwnPropertyDescriptor;var st=Object.getOwnPropertyNames;var rt=Object.prototype.hasOwnProperty;var it=(t,e)=>{for(var n in e)H(t,n,{get:e[n],enumerable:!0})},lt=(t,e,n,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of st(e))!rt.call(t,l)&&l!==n&&H(t,l,{get:()=>e[l],enumerable:!(a=ot(e,l))||a.enumerable});return t};var ct=t=>lt(H({},"__esModule",{value:!0}),t);var Gt={};it(Gt,{default:()=>Vt});var $=`/**
2
+ * GA Toasts 2.x \u2014 stylesheet.
3
+ *
4
+ * Self-contained: all design tokens are namespaced (--gat-*) and scoped to the
5
+ * toast elements so they never collide with a host app's own variables.
6
+ * Vertical position + stacking is driven by inline transforms from the engine;
7
+ * this file only styles the cards and provides the transition timing.
8
+ */
9
+
10
+ /* ---------------- Design tokens ---------------- */
11
+ .ga-toast-container {
12
+ --gat-width: 380px;
13
+ --gat-radius: 14px;
14
+ --gat-gap: 14px;
15
+ --gat-edge: 22px;
16
+
17
+ --gat-font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
18
+ Roboto, "Helvetica Neue", Arial, sans-serif;
19
+
20
+ --gat-surface: rgba(255, 255, 255, 0.82);
21
+ --gat-surface-solid: #ffffff;
22
+ --gat-border: rgba(15, 23, 42, 0.07);
23
+ --gat-ring: rgba(15, 23, 42, 0.05); /* hairline definition ring */
24
+ --gat-highlight: rgba(255, 255, 255, 0.75); /* inset top edge highlight */
25
+ --gat-text: #0f172a;
26
+ --gat-text-soft: #475569;
27
+ --gat-text-muted: #64748b; /* meets WCAG AA on the surface */
28
+ --gat-shadow: 0 1px 2px rgba(15, 23, 42, 0.05),
29
+ 0 8px 20px -12px rgba(15, 23, 42, 0.16);
30
+ --gat-shadow-hover: 0 2px 4px -2px rgba(15, 23, 42, 0.12),
31
+ 0 14px 32px -12px rgba(15, 23, 42, 0.26);
32
+ --gat-chip: rgba(15, 23, 42, 0.05);
33
+
34
+ --gat-success: #16a34a;
35
+ --gat-error: #e11d48;
36
+ --gat-warning: #d97706;
37
+ --gat-info: #2563eb;
38
+ --gat-primary: #6366f1;
39
+ --gat-secondary: #64748b;
40
+ --gat-loading: #2563eb;
41
+
42
+ --gat-ease: cubic-bezier(0.22, 1, 0.36, 1);
43
+ }
44
+
45
+ /* Dark theme \u2014 via explicit attribute/class or the OS preference. */
46
+ [data-ga-theme="dark"] .ga-toast-container,
47
+ .ga-theme-dark .ga-toast-container,
48
+ .ga-toast-container.ga-theme-dark {
49
+ --gat-surface: rgba(24, 27, 34, 0.82);
50
+ --gat-surface-solid: #191c22;
51
+ --gat-border: rgba(255, 255, 255, 0.09);
52
+ --gat-ring: rgba(255, 255, 255, 0.06);
53
+ --gat-highlight: rgba(255, 255, 255, 0.07);
54
+ --gat-text: #f8fafc;
55
+ --gat-text-soft: #cbd5e1;
56
+ --gat-text-muted: #9aa7ba;
57
+ --gat-shadow: 0 1px 2px rgba(0, 0, 0, 0.35),
58
+ 0 10px 28px -14px rgba(0, 0, 0, 0.5);
59
+ --gat-shadow-hover: 0 2px 6px -2px rgba(0, 0, 0, 0.5),
60
+ 0 16px 38px -12px rgba(0, 0, 0, 0.64);
61
+ --gat-chip: rgba(255, 255, 255, 0.08);
62
+ }
63
+
64
+ /* Auto (OS) dark mode \u2014 applies ONLY when no explicit theme is set on the root,
65
+ so an app that pins data-ga-theme="light" (like the demo) is never overridden. */
66
+ @media (prefers-color-scheme: dark) {
67
+ :root:not([data-ga-theme]):not(.ga-theme-light):not(.ga-theme-dark) .ga-toast-container {
68
+ --gat-surface: rgba(24, 27, 34, 0.82);
69
+ --gat-surface-solid: #191c22;
70
+ --gat-border: rgba(255, 255, 255, 0.09);
71
+ --gat-ring: rgba(255, 255, 255, 0.06);
72
+ --gat-highlight: rgba(255, 255, 255, 0.07);
73
+ --gat-text: #f8fafc;
74
+ --gat-text-soft: #cbd5e1;
75
+ --gat-text-muted: #9aa7ba;
76
+ --gat-shadow: 0 1px 2px rgba(0, 0, 0, 0.35),
77
+ 0 10px 28px -14px rgba(0, 0, 0, 0.5);
78
+ --gat-chip: rgba(255, 255, 255, 0.08);
79
+ }
80
+ }
81
+
82
+ /* ---------------- Modal backdrop (confirm) ---------------- */
83
+ .ga-toast-backdrop {
84
+ position: fixed;
85
+ inset: 0;
86
+ z-index: 2147482990; /* just under the toast containers */
87
+ background: rgba(10, 12, 20, 0.42);
88
+ backdrop-filter: blur(2px);
89
+ -webkit-backdrop-filter: blur(2px);
90
+ opacity: 0;
91
+ transition: opacity 0.22s ease;
92
+ }
93
+ .ga-toast-backdrop-show { opacity: 1; }
94
+ @media (prefers-reduced-transparency: reduce) {
95
+ .ga-toast-backdrop { backdrop-filter: none; -webkit-backdrop-filter: none; }
96
+ }
97
+
98
+ /* ---------------- Container + positioning ---------------- */
99
+ .ga-toast-container {
100
+ position: fixed;
101
+ z-index: 2147483000;
102
+ width: var(--gat-width);
103
+ max-width: calc(100vw - 2 * var(--gat-edge));
104
+ pointer-events: none;
105
+ font-family: var(--gat-font);
106
+ }
107
+
108
+ /* Logical inline positioning so -start/-end mirror automatically under RTL. */
109
+ .ga-toast-container-top-start { inset-block-start: var(--gat-edge); inset-inline-start: var(--gat-edge); }
110
+ .ga-toast-container-top-end { inset-block-start: var(--gat-edge); inset-inline-end: var(--gat-edge); }
111
+ .ga-toast-container-top-center {
112
+ inset-block-start: var(--gat-edge); left: 50%; transform: translateX(-50%);
113
+ }
114
+ .ga-toast-container-bottom-start { inset-block-end: var(--gat-edge); inset-inline-start: var(--gat-edge); }
115
+ .ga-toast-container-bottom-end { inset-block-end: var(--gat-edge); inset-inline-end: var(--gat-edge); }
116
+ .ga-toast-container-bottom-center {
117
+ inset-block-end: var(--gat-edge); left: 50%; transform: translateX(-50%);
118
+ }
119
+ .ga-toast-container-middle-start { top: 50%; inset-inline-start: var(--gat-edge); }
120
+ .ga-toast-container-middle-end { top: 50%; inset-inline-end: var(--gat-edge); }
121
+ .ga-toast-container-middle-center { top: 50%; left: 50%; transform: translateX(-50%); }
122
+
123
+ /* ---------------- Toast card ---------------- */
124
+ .ga-toast {
125
+ position: absolute;
126
+ inset-inline: 0;
127
+ width: 100%;
128
+ box-sizing: border-box;
129
+ display: flex;
130
+ flex-direction: row;
131
+ align-items: flex-start;
132
+ gap: 11px;
133
+ padding: 14px 16px;
134
+ color: var(--gat-text);
135
+ background: var(--gat-surface-solid);
136
+ border: none;
137
+ border-radius: var(--gat-radius);
138
+ box-shadow:
139
+ var(--gat-shadow),
140
+ inset 0 1px 0 var(--gat-highlight);
141
+ pointer-events: auto;
142
+ opacity: 0;
143
+ transform: translateY(-140%);
144
+ transition:
145
+ transform 0.5s var(--gat-ease),
146
+ opacity 0.35s ease,
147
+ box-shadow 0.2s ease;
148
+ will-change: transform, opacity;
149
+ overflow: hidden;
150
+ font-size: 0.875rem;
151
+ line-height: 1.5;
152
+ -webkit-font-smoothing: antialiased;
153
+ text-align: start;
154
+ touch-action: pan-y;
155
+ overscroll-behavior: contain;
156
+ }
157
+
158
+ /* Subtle lift on hover (shadow only \u2014 transforms are owned by the engine, so
159
+ changing them here would fight the stack layout). */
160
+ @media (hover: hover) {
161
+ .ga-toast:hover {
162
+ box-shadow:
163
+ var(--gat-shadow-hover),
164
+ inset 0 1px 0 var(--gat-highlight);
165
+ }
166
+ }
167
+
168
+ [data-ga-position^="top"] .ga-toast,
169
+ [data-ga-position^="middle"] .ga-toast { top: 0; transform-origin: top center; }
170
+ [data-ga-position^="bottom"] .ga-toast { bottom: 0; transform-origin: bottom center; }
171
+
172
+ .ga-toast-glass {
173
+ background: var(--gat-surface);
174
+ backdrop-filter: blur(16px) saturate(160%);
175
+ -webkit-backdrop-filter: blur(16px) saturate(160%);
176
+ }
177
+
178
+ /* No leading accent stripe \u2014 the colored icon carries the type identity, for a
179
+ cleaner, more minimal card (\xE0 la Sonner/Linear). */
180
+
181
+ .ga-toast-hide { pointer-events: none; }
182
+
183
+ /* Per-type accent colors. */
184
+ .ga-toast-success { --gat-accent: var(--gat-success); }
185
+ .ga-toast-error { --gat-accent: var(--gat-error); }
186
+ .ga-toast-warning { --gat-accent: var(--gat-warning); }
187
+ .ga-toast-info { --gat-accent: var(--gat-info); }
188
+ .ga-toast-primary { --gat-accent: var(--gat-primary); }
189
+ .ga-toast-secondary { --gat-accent: var(--gat-secondary); }
190
+ .ga-toast-loading { --gat-accent: var(--gat-loading); }
191
+
192
+ /* ---------------- Content column ---------------- */
193
+ /* The content column sits between the leading icon and the trailing close. */
194
+ .ga-toast-content {
195
+ display: flex;
196
+ flex-direction: column;
197
+ gap: 4px;
198
+ flex: 1;
199
+ min-width: 0;
200
+ }
201
+
202
+ .ga-toast-header {
203
+ display: flex;
204
+ align-items: center;
205
+ gap: 8px;
206
+ min-width: 0;
207
+ }
208
+
209
+ /* Small inline colored glyph \u2014 no chunky chip (Sonner/Linear style). Leads the
210
+ row and aligns with the first line of text, so title-less toasts read well. */
211
+ .ga-toast-icon {
212
+ flex-shrink: 0;
213
+ display: inline-flex;
214
+ align-items: center;
215
+ justify-content: center;
216
+ margin-top: 1px;
217
+ color: var(--gat-accent, var(--gat-info));
218
+ }
219
+ .ga-toast-icon svg { width: 1.25rem; height: 1.25rem; display: block; overflow: visible; }
220
+
221
+ .ga-toast-spinner { animation: ga-toast-spin 0.8s linear infinite; }
222
+
223
+ /* Icons draw themselves in on mount (skipped under reduced motion). */
224
+ @media (prefers-reduced-motion: no-preference) {
225
+ .ga-toast-icon .ga-ic-ring {
226
+ stroke-dasharray: 64;
227
+ stroke-dashoffset: 64;
228
+ animation: ga-toast-ic-draw 0.5s var(--gat-ease) 0.02s forwards;
229
+ }
230
+ .ga-toast-icon .ga-ic-draw {
231
+ stroke-dasharray: 28;
232
+ stroke-dashoffset: 28;
233
+ animation: ga-toast-ic-draw 0.4s var(--gat-ease) 0.16s forwards;
234
+ }
235
+ }
236
+ @keyframes ga-toast-ic-draw {
237
+ to { stroke-dashoffset: 0; }
238
+ }
239
+
240
+ .ga-toast-avatar {
241
+ flex-shrink: 0;
242
+ width: 34px;
243
+ height: 34px;
244
+ border-radius: 50%;
245
+ object-fit: cover;
246
+ border: 1px solid var(--gat-border);
247
+ }
248
+
249
+ .ga-toast-unread-dot {
250
+ flex-shrink: 0;
251
+ width: 8px;
252
+ height: 8px;
253
+ border-radius: 50%;
254
+ background: var(--gat-accent, var(--gat-info));
255
+ }
256
+
257
+ .ga-toast-title {
258
+ font-weight: 600;
259
+ font-size: 0.9rem;
260
+ color: var(--gat-text);
261
+ flex: 1;
262
+ min-width: 0;
263
+ letter-spacing: -0.011em;
264
+ }
265
+ .ga-toast-title-truncate {
266
+ white-space: nowrap;
267
+ overflow: hidden;
268
+ text-overflow: ellipsis;
269
+ }
270
+
271
+ .ga-toast-status {
272
+ flex-shrink: 0;
273
+ padding: 2px 9px;
274
+ border-radius: 999px;
275
+ font-size: 0.6875rem;
276
+ font-weight: 600;
277
+ text-transform: uppercase;
278
+ letter-spacing: 0.04em;
279
+ /* Darkened accent ink on a stronger tint so the small label clears AA. */
280
+ color: var(--gat-accent, var(--gat-info));
281
+ color: color-mix(in srgb, var(--gat-accent, var(--gat-info)) 58%, var(--gat-text));
282
+ background: var(--gat-chip); /* fallback if color-mix is unsupported */
283
+ background: color-mix(in srgb, var(--gat-accent, var(--gat-info)) 18%, transparent);
284
+ }
285
+
286
+ /* ---------------- Close button ---------------- */
287
+ .ga-toast-close {
288
+ flex-shrink: 0;
289
+ align-self: flex-start;
290
+ margin-top: -1px;
291
+ margin-inline-end: -4px; /* pull toward the corner without losing hit area */
292
+ display: inline-flex;
293
+ align-items: center;
294
+ justify-content: center;
295
+ width: 26px;
296
+ height: 26px;
297
+ padding: 0;
298
+ border: none;
299
+ border-radius: 7px;
300
+ color: var(--gat-text-muted);
301
+ background: transparent;
302
+ cursor: pointer;
303
+ opacity: 0.9; /* stays >=3:1 at rest; full on hover/focus */
304
+ transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
305
+ }
306
+ .ga-toast:hover .ga-toast-close,
307
+ .ga-toast:focus-within .ga-toast-close { opacity: 1; }
308
+ .ga-toast-close svg { width: 15px; height: 15px; display: block; }
309
+ .ga-toast-close:hover {
310
+ background: var(--gat-chip);
311
+ color: var(--gat-text);
312
+ }
313
+ /* currentColor is guaranteed to contrast with its own surface (white on filled,
314
+ muted on default, etc.), so the focus ring is never accent-on-accent. */
315
+ .ga-toast-close:focus-visible {
316
+ outline: 2px solid currentColor;
317
+ outline-offset: 2px;
318
+ }
319
+
320
+ /* ---------------- Body ---------------- */
321
+ .ga-toast-body { min-width: 0; }
322
+ .ga-toast-meta {
323
+ font-size: 0.75rem;
324
+ color: var(--gat-text-muted);
325
+ margin-bottom: 2px;
326
+ }
327
+ .ga-toast-message {
328
+ color: var(--gat-text-soft);
329
+ font-size: 0.85rem;
330
+ word-break: break-word;
331
+ /* Clamp very long content so a toast can't fill the viewport. */
332
+ max-height: 40vh;
333
+ overflow-y: auto;
334
+ overscroll-behavior: contain;
335
+ }
336
+ .ga-toast-message a {
337
+ color: var(--gat-accent, var(--gat-info));
338
+ font-weight: 500;
339
+ text-decoration: underline; /* affordance beyond color (WCAG 1.4.1) */
340
+ }
341
+
342
+ /* When there's no header, let the message carry the toast on its own \u2014 but not
343
+ on filled toasts, whose message must stay light (specificity guard). */
344
+ .ga-toast:not([class*="-filled"]) .ga-toast-content > .ga-toast-body:only-child .ga-toast-message {
345
+ color: var(--gat-text);
346
+ }
347
+
348
+ /* ---------------- Actions ---------------- */
349
+ .ga-toast-actions {
350
+ display: flex;
351
+ gap: 8px;
352
+ margin-top: 2px;
353
+ }
354
+ .ga-toast-btn {
355
+ flex: 1;
356
+ padding: 8px 14px;
357
+ font: inherit;
358
+ font-size: 0.8125rem;
359
+ font-weight: 600;
360
+ border-radius: 9px;
361
+ border: 1px solid var(--gat-border);
362
+ background: var(--gat-chip);
363
+ color: var(--gat-text);
364
+ cursor: pointer;
365
+ transition: filter 0.15s ease, background 0.15s ease;
366
+ }
367
+ .ga-toast-btn:hover { filter: brightness(0.97); }
368
+ .ga-toast-btn:focus-visible {
369
+ outline: 2px solid currentColor;
370
+ outline-offset: 2px;
371
+ }
372
+ .ga-toast-btn-primary {
373
+ background: var(--gat-accent, var(--gat-primary));
374
+ border-color: transparent;
375
+ color: #fff;
376
+ }
377
+ .ga-toast-btn-primary:hover { filter: brightness(1.06); }
378
+
379
+ /* ---------------- Progress bar ---------------- */
380
+ .ga-toast-progress {
381
+ position: absolute;
382
+ left: 0;
383
+ bottom: 0;
384
+ height: 2px;
385
+ width: 100%;
386
+ transform: scaleX(1);
387
+ transform-origin: left center;
388
+ background: var(--gat-accent, var(--gat-info));
389
+ opacity: 0.4; /* a quiet hint, not a slab */
390
+ }
391
+ .ga-toast-progress-top { top: 0; bottom: auto; }
392
+
393
+ /* ---------------- Segmented steps ---------------- */
394
+ .ga-toast-steps { display: flex; gap: 4px; margin-top: 4px; }
395
+ .ga-toast-step {
396
+ flex: 1;
397
+ height: 3px;
398
+ border-radius: 999px;
399
+ background: var(--gat-chip);
400
+ }
401
+ .ga-toast-step-active { background: var(--gat-accent, var(--gat-info)); }
402
+
403
+ /* ---------------- Variants ---------------- */
404
+ /* Filled: solid accent, white ink, white stroke glyph directly on the fill.
405
+ Per-type fills are darkened where needed so white body text clears WCAG AA
406
+ (4.5:1); no top sheen (it dragged the top region under AA). */
407
+ .ga-toast[class*="-filled"] {
408
+ background: var(--gat-accent, var(--gat-info));
409
+ border-color: transparent;
410
+ color: #fff;
411
+ }
412
+ .ga-toast-success[class*="-filled"] { background: #15803d; } /* white \u2248 5.0:1 */
413
+ .ga-toast-primary[class*="-filled"] { background: #4f46e5; } /* white \u2248 6.3:1 */
414
+ .ga-toast[class*="-filled"] .ga-toast-title,
415
+ .ga-toast[class*="-filled"] .ga-toast-message,
416
+ .ga-toast[class*="-filled"] .ga-toast-meta,
417
+ .ga-toast[class*="-filled"] .ga-toast-icon,
418
+ .ga-toast[class*="-filled"] .ga-toast-close { color: #fff; }
419
+ .ga-toast[class*="-filled"] .ga-toast-close:hover { background: rgba(255, 255, 255, 0.2); }
420
+ /* Accent-colored bits would vanish on the accent fill \u2014 force them light. */
421
+ .ga-toast[class*="-filled"] .ga-toast-progress { background: #fff; opacity: 0.55; }
422
+ .ga-toast[class*="-filled"] .ga-toast-step { background: rgba(255, 255, 255, 0.28); }
423
+ .ga-toast[class*="-filled"] .ga-toast-step-active { background: #fff; }
424
+ .ga-toast[class*="-filled"] .ga-toast-status {
425
+ color: #fff;
426
+ background: rgba(255, 255, 255, 0.22);
427
+ }
428
+ .ga-toast[class*="-filled"] .ga-toast-message a { color: #fff; text-decoration: underline; }
429
+
430
+ /* Amber is too light for white text \u2014 filled warnings use dark ink throughout. */
431
+ .ga-toast-warning[class*="-filled"],
432
+ .ga-toast-warning[class*="-filled"] .ga-toast-title,
433
+ .ga-toast-warning[class*="-filled"] .ga-toast-message,
434
+ .ga-toast-warning[class*="-filled"] .ga-toast-meta,
435
+ .ga-toast-warning[class*="-filled"] .ga-toast-icon,
436
+ .ga-toast-warning[class*="-filled"] .ga-toast-close,
437
+ .ga-toast-warning[class*="-filled"] .ga-toast-message a {
438
+ color: #2e2100; /* \u2248 5.2:1 on the amber fill */
439
+ }
440
+ .ga-toast-warning[class*="-filled"] .ga-toast-progress { background: #2e2100; opacity: 0.6; }
441
+ .ga-toast-warning[class*="-filled"] .ga-toast-step { background: rgba(0, 0, 0, 0.18); }
442
+ .ga-toast-warning[class*="-filled"] .ga-toast-step-active { background: #2e2100; }
443
+ .ga-toast-warning[class*="-filled"] .ga-toast-status {
444
+ color: #2e2100;
445
+ background: rgba(0, 0, 0, 0.16);
446
+ }
447
+ .ga-toast-warning[class*="-filled"] .ga-toast-close:hover { background: rgba(0, 0, 0, 0.14); }
448
+
449
+ /* Light: a translucent accent wash over the (translucent) surface so glass still
450
+ shows through, plus an accent-tinted border. Secondary text is darkened to
451
+ keep AA over the tint. */
452
+ .ga-toast[class*="-light"] {
453
+ background: var(--gat-surface); /* stays translucent \u2192 glass blur still works */
454
+ background-image: linear-gradient(
455
+ 0deg,
456
+ color-mix(in srgb, var(--gat-accent, var(--gat-info)) 14%, transparent),
457
+ color-mix(in srgb, var(--gat-accent, var(--gat-info)) 14%, transparent)
458
+ );
459
+ border-color: color-mix(in srgb, var(--gat-accent, var(--gat-info)) 38%, var(--gat-border));
460
+ }
461
+ .ga-toast[class*="-light"] .ga-toast-meta { color: var(--gat-text-soft); }
462
+ .ga-toast[class*="-light"] .ga-toast-message a {
463
+ color: color-mix(in srgb, var(--gat-accent, var(--gat-info)) 55%, var(--gat-text));
464
+ text-decoration: underline;
465
+ }
466
+
467
+ /* ---------------- Sizes (density) ---------------- */
468
+ .ga-toast-xs { padding: 10px 13px; font-size: 0.78rem; }
469
+ .ga-toast-xs .ga-toast-icon svg { width: 1.05rem; height: 1.05rem; }
470
+ .ga-toast-xs .ga-toast-message { font-size: 0.78rem; }
471
+ .ga-toast-sm { padding: 12px 15px; }
472
+ .ga-toast-lg { padding: 18px 20px; }
473
+ .ga-toast-lg .ga-toast-title { font-size: 1rem; }
474
+ .ga-toast-lg .ga-toast-message { font-size: 0.95rem; }
475
+ .ga-toast-lg .ga-toast-icon svg { width: 1.4rem; height: 1.4rem; }
476
+ .ga-toast-xl { padding: 22px 24px; }
477
+ .ga-toast-xl .ga-toast-title { font-size: 1.125rem; }
478
+ .ga-toast-xl .ga-toast-message { font-size: 1.05rem; }
479
+ .ga-toast-xl .ga-toast-icon svg { width: 1.6rem; height: 1.6rem; }
480
+
481
+ /* ---------------- Compact ---------------- */
482
+ /* The card is already an icon \xB7 content \xB7 close row, so compact just tightens
483
+ the padding and vertically centres the single line. */
484
+ .ga-toast-compact {
485
+ align-items: center;
486
+ gap: 10px;
487
+ padding: 10px 14px;
488
+ }
489
+ .ga-toast-compact .ga-toast-content { gap: 2px; }
490
+ .ga-toast-compact .ga-toast-icon { margin-top: 0; }
491
+ .ga-toast-compact .ga-toast-close { align-self: center; margin-top: 0; }
492
+ .ga-toast-compact .ga-toast-steps { display: none; }
493
+ .ga-toast-compact .ga-toast-icon svg { width: 1.05rem; height: 1.05rem; }
494
+
495
+ /* ---------------- Live region (screen-reader only) ---------------- */
496
+ .ga-toast-live-region {
497
+ position: fixed;
498
+ width: 1px;
499
+ height: 1px;
500
+ padding: 0;
501
+ margin: -1px;
502
+ overflow: hidden;
503
+ clip: rect(0 0 0 0);
504
+ clip-path: inset(50%);
505
+ white-space: nowrap;
506
+ border: 0;
507
+ }
508
+
509
+ /* ---------------- Responsive ---------------- */
510
+ @media (max-width: 520px) {
511
+ .ga-toast-container {
512
+ --gat-width: auto;
513
+ left: var(--gat-edge);
514
+ right: var(--gat-edge);
515
+ transform: none;
516
+ }
517
+ .ga-toast-container-top-center,
518
+ .ga-toast-container-bottom-center,
519
+ .ga-toast-container-middle-center { transform: none; }
520
+ }
521
+
522
+ /* ---------------- RTL ---------------- */
523
+ [dir="rtl"] .ga-toast-progress { transform-origin: right center; }
524
+
525
+ /* ---------------- Reduced motion ---------------- */
526
+ @media (prefers-reduced-motion: reduce) {
527
+ .ga-toast {
528
+ transition: opacity 0.15s ease;
529
+ }
530
+ .ga-toast-spinner { animation-duration: 1.4s; }
531
+ }
532
+
533
+ /* ---------------- Reduced transparency ---------------- */
534
+ @media (prefers-reduced-transparency: reduce) {
535
+ .ga-toast-glass {
536
+ background: var(--gat-surface-solid);
537
+ backdrop-filter: none;
538
+ -webkit-backdrop-filter: none;
539
+ }
540
+ }
541
+
542
+ /* ---------------- Custom content (toast.custom) ---------------- */
543
+ .ga-toast-custom { min-width: 0; }
544
+ .ga-toast-has-custom { padding: 0; }
545
+ .ga-toast-has-custom .ga-toast-close {
546
+ position: absolute;
547
+ inset-block-start: 8px;
548
+ inset-inline-end: 8px;
549
+ z-index: 1;
550
+ }
551
+
552
+ @keyframes ga-toast-spin {
553
+ to { transform: rotate(360deg); }
554
+ }
555
+ `;var p=typeof window<"u"&&typeof document<"u",dt="ga-toast",X="ga-toasts-styles",gt=14,B=14,ut=3,ft=450,g=new Map,R=new Map,A={},S=null,b=null,F=!1,q=!1,D=0,v=null,h=null,x='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">',E={success:`${x}<circle cx="12" cy="12" r="9" class="ga-ic-ring"/><path d="M7.75 12.5l2.75 2.75L16.5 9" class="ga-ic-draw"/></svg>`,error:`${x}<circle cx="12" cy="12" r="9" class="ga-ic-ring"/><path d="M15 9l-6 6M9 9l6 6" class="ga-ic-draw"/></svg>`,warning:`${x}<path d="M12 3.6 2.4 20.4h19.2L12 3.6z" class="ga-ic-ring"/><path d="M12 10v4" class="ga-ic-draw"/><path d="M12 17.4v.01"/></svg>`,info:`${x}<circle cx="12" cy="12" r="9" class="ga-ic-ring"/><path d="M12 11v5" class="ga-ic-draw"/><path d="M12 7.6v.01"/></svg>`,primary:`${x}<path d="M12 3.5l2.6 5.27 5.82.85-4.21 4.1.99 5.79L12 16.77 6.8 19.5l.99-5.79-4.21-4.1 5.82-.85L12 3.5z" class="ga-ic-draw"/></svg>`,secondary:`${x}<path d="M6 9a6 6 0 0112 0c0 4.5 1.8 5.6 1.8 5.6H4.2S6 13.5 6 9z" class="ga-ic-draw"/><path d="M10 19a2 2 0 004 0"/></svg>`,loading:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" aria-hidden="true" class="ga-toast-spinner"><circle cx="12" cy="12" r="9" opacity="0.25"/><path d="M12 3a9 9 0 019 9"/></svg>'},pt='<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" aria-hidden="true"><path d="M6 6l12 12M18 6 6 18"/></svg>',K=new Set(["error","warning"]);function U(){return typeof performance<"u"?performance.now():Date.now()}function j(){D+=1;let t=Math.random().toString(36).slice(2,8);return`${dt}-${D}-${t}`}function w(t,e){if(S)try{S(t,e)}catch{}}function mt(){return p&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}function J(){if(!p||document.getElementById(X))return;let t=document.createElement("style");t.id=X,t.textContent=$,document.head.appendChild(t)}function ht(){if(!p||b&&b.polite.isConnected&&b.assertive.isConnected)return;let t=e=>{let n=document.createElement("div");return n.className="ga-toast-live-region",n.setAttribute("aria-live",e),n.setAttribute("aria-atomic","true"),n.setAttribute("role",e==="assertive"?"alert":"status"),document.body.appendChild(n),n};b={polite:t("polite"),assertive:t("assertive")}}function bt(t,e){if(!t||(ht(),!b))return;let n=e?b.assertive:b.polite;n.textContent="",window.setTimeout(()=>{n.textContent=t},50)}var vt=["top-start","top-center","top-end","middle-start","middle-center","middle-end","bottom-start","bottom-center","bottom-end"];function Q(t){return t.startsWith("bottom")?-1:1}function yt(){return p?(document.documentElement.getAttribute("dir")||document.body&&document.body.getAttribute("dir"))==="rtl":!1}function Z(t){let e="translateX(-115%)",n="translateX(115%)",a=yt();return t.endsWith("start")?a?n:e:t.endsWith("end")?a?e:n:Q(t)===1?"translateY(-140%)":"translateY(140%)"}function xt(t){let e=R.get(t);if(e&&e.isConnected)return e;let n=document.createElement("div");n.className=`ga-toast-container ga-toast-container-${t}`,n.setAttribute("data-ga-position",t),n.setAttribute("role","region"),n.setAttribute("aria-label","Notifications");let a=()=>Y(n,!0),l=()=>Y(n,!1);return n.addEventListener("pointerenter",a),n.addEventListener("pointerleave",l),n.addEventListener("focusin",a),n.addEventListener("focusout",c=>{n.contains(c.relatedTarget)||l()}),document.body.appendChild(n),R.set(t,n),n}function Y(t,e){t.dataset.gaExpanded==="true"!==e&&(t.dataset.gaExpanded=e?"true":"false",y(t))}function wt(t){return Array.from(t.children).map(e=>g.get(e.id)).filter(e=>!!e)}function y(t){let e=wt(t),n=t.dataset.gaPosition||"top-end",a=Q(n),l=t.dataset.gaExpanded==="true",c=mt(),r=e.slice().reverse();t.style.setProperty("--ga-toasts-count",String(r.length));let s=0;r.forEach((o,i)=>{if(o.closing)return;if(!o.el.dataset.gaMounted){s+=o.height+B;return}let d,u,m;l||c?(d=a*s,u=1,m=1):(d=a*i*gt,u=Math.max(1-i*.05,.85),m=i>=ut?0:1);let nt=o.swipeX?` translateX(${o.swipeX}px)`:"",at=n.startsWith("middle")?`calc(-50% + ${d}px)`:`${d}px`;o.el.style.transform=`translateY(${at})${nt} scale(${u})`,o.el.style.opacity=o.swipeX?String(Tt(o.swipeX)):String(m),o.el.style.zIndex=String(1e3+r.length-i),o.el.style.pointerEvents=m===0?"none":"auto",o.el.setAttribute("aria-hidden",m===0?"true":"false"),s+=o.height+B})}function Tt(t){return Math.max(.15,1-Math.abs(t)/220)}function W(t){let e=t.el.offsetHeight;e>0&&(t.height=e)}function Et(t){let e={type:"info",duration:5e3,closable:!0,position:"top-end",animation:"slide",swipeToClose:!0,closeOnEscape:!0,progress:!0,progressPosition:"bottom",pauseOnHover:!0,pauseOnPageHidden:!0,autoIcon:!0,glassmorphism:!0,html:!1,...A,...t};return e.position=e.position||"top-end",vt.includes(e.position)||(e.position="top-end"),e}function O(){let t=document.createElement("button");return t.type="button",t.className="ga-toast-close",t.setAttribute("aria-label","Close notification"),t.setAttribute("data-ga-close",""),t.innerHTML=pt,t}function V(t,e,n){if(!e.progress||(e.duration||0)<=0||e.progressPosition==="none")return null;let a=document.createElement("div");return a.className=`ga-toast-progress ga-toast-progress-${n}`+(e.progressPosition==="top"?" ga-toast-progress-top":""),t.appendChild(a),a}function kt(t,e){let n=t.type||"info",a=document.createElement("div");a.id=e,a.className=["ga-toast",`ga-toast-${n}`,t.size?`ga-toast-${t.size}`:"",t.variant?`ga-toast-${n}-${t.variant}`:"",t.animation||"",t.compact?"ga-toast-compact":"",t.glassmorphism?"ga-toast-glass":"",n==="loading"?"ga-toast-loading":"",t.className||""].filter(Boolean).join(" ");let l=t.role||(K.has(n)?"alert":"status");if(a.setAttribute("role",l),a.setAttribute("aria-live","off"),a.setAttribute("data-ga-type",n),l==="alertdialog"||l==="dialog"){let s=[t.title,t.message].filter(Boolean).join(". ");s&&a.setAttribute("aria-label",s)}if(t.content!=null){a.classList.add("ga-toast-has-custom");let s=document.createElement("div");s.className="ga-toast-custom";let o=typeof t.content=="function"?t.content():t.content;return typeof o=="string"?s.innerHTML=o:o instanceof HTMLElement&&s.appendChild(o),a.appendChild(s),t.closable&&a.appendChild(O()),{el:a,progressEl:V(a,t,n)}}if(t.avatar){let s=document.createElement("img");s.className="ga-toast-avatar",s.src=t.avatar,s.alt=t.avatarAlt||t.title||"Notification",a.appendChild(s)}let c=null;if(t.icon?c=String(t.icon):t.icon!==!1&&t.autoIcon!==!1&&!t.avatar&&(c=E[n]||E.info),c){let s=document.createElement("div");s.className="ga-toast-icon",s.innerHTML=c,a.appendChild(s)}let r=document.createElement("div");if(r.className="ga-toast-content",t.title||t.showStatus||t.unread){let s=document.createElement("div");if(s.className="ga-toast-header",t.unread){let o=document.createElement("span");o.className="ga-toast-unread-dot",s.appendChild(o)}if(t.title){let o=document.createElement("div");o.className="ga-toast-title"+(t.truncateTitle?" ga-toast-title-truncate":""),o.textContent=t.title,s.appendChild(o)}if(t.showStatus){let o=document.createElement("span");o.className="ga-toast-status";let i=String(t.statusText||n);o.textContent=i.charAt(0).toUpperCase()+i.slice(1),s.appendChild(o)}r.appendChild(s)}if(t.message||t.meta){let s=document.createElement("div");if(s.className="ga-toast-body",t.meta){let o=document.createElement("div");o.className="ga-toast-meta",o.textContent=t.meta,s.appendChild(o)}if(t.message){let o=document.createElement("div");o.className="ga-toast-message",t.html?o.innerHTML=t.message:o.textContent=t.message,s.appendChild(o)}r.appendChild(s)}if(t.actions&&t.actions.length&&!t.compact){let s=document.createElement("div");s.className="ga-toast-actions";for(let o of t.actions){let i=document.createElement("button");i.type="button",i.className=["ga-toast-btn",o.className||o.class||"ga-toast-btn-secondary"].join(" "),i.textContent=o.text,i.setAttribute("data-ga-action",""),s.appendChild(i)}r.appendChild(s)}if(t.steps&&t.steps>1){let s=document.createElement("div");s.className="ga-toast-steps";let o=Math.min(t.steps,Math.max(1,t.currentStep||1));for(let i=1;i<=t.steps;i+=1){let d=document.createElement("div");d.className="ga-toast-step"+(i<=o?" ga-toast-step-active":""),s.appendChild(d)}r.appendChild(s)}return a.appendChild(r),t.closable&&a.appendChild(O()),{el:a,progressEl:V(a,t,n)}}function P(t){let{timer:e}=t;e.duration<=0||e.remaining<=0||(e.paused=!1,e.startedAt=U(),e.handle=setTimeout(()=>f(t.id),e.remaining),Ct(t,e.remaining))}function k(t){let{timer:e}=t;if(e.paused||e.handle==null)return;clearTimeout(e.handle),e.handle=null,e.paused=!0;let n=U()-e.startedAt;e.remaining=Math.max(0,e.remaining-n),Lt(t)}function C(t){t.timer.paused&&P(t)}function Ct(t,e){let n=t.progressEl;if(!n)return;let a=t.timer.duration>0?e/t.timer.duration:0;n.style.transition="none",n.style.transform=`scaleX(${a})`,n.offsetWidth,n.style.transition=`transform ${e}ms linear`,n.style.transform="scaleX(0)"}function Lt(t){let e=t.progressEl;if(!e)return;let n=t.timer.duration>0?t.timer.remaining/t.timer.duration:0;e.style.transition="none",e.style.transform=`scaleX(${n})`}function Mt(t,e){let{el:n,controller:a}=t,l=a.signal;n.addEventListener("click",c=>{let r=c.target;if(r.closest("[data-ga-close]")){c.preventDefault(),f(t.id);return}let s=r.closest("[data-ga-action]");if(s&&e.actions){let o=Array.from(s.parentElement?.children||[]).indexOf(s),i=e.actions[o];if(i){let d=i.onClick||i.click;d&&d(c,t.handle),i.closeOnClick!==!1&&f(t.id)}return}e.clickToClose&&!r.closest(".ga-toast-actions")&&f(t.id)},{signal:l}),e.pauseOnHover&&(n.addEventListener("pointerenter",()=>k(t),{signal:l}),n.addEventListener("pointerleave",()=>C(t),{signal:l}),n.addEventListener("focusin",()=>k(t),{signal:l}),n.addEventListener("focusout",()=>C(t),{signal:l})),e.swipeToClose&&Ht(t),e.modal&&n.addEventListener("keydown",c=>{if(c.key!=="Tab")return;let r=n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(!r.length)return;let s=r[0],o=r[r.length-1],i=document.activeElement;c.shiftKey&&i===s?(c.preventDefault(),o.focus()):!c.shiftKey&&i===o&&(c.preventDefault(),s.focus())},{signal:l})}function Ht(t){let{el:e,controller:n}=t,a=n.signal,l=70,c=!1,r=0,s=0;e.addEventListener("pointerdown",i=>{if(!(i.pointerType==="mouse"&&i.button!==0)&&!i.target.closest("button, a, input, textarea, select")){c=!0,r=i.clientX,s=i.clientY,k(t);try{e.setPointerCapture(i.pointerId)}catch{}}},{signal:a}),e.addEventListener("pointermove",i=>{if(!c)return;let d=i.clientX-r,u=i.clientY-s;if(Math.abs(d)<6||Math.abs(d)<Math.abs(u))return;i.preventDefault(),t.swipeX=d;let m=e.parentElement;m&&y(m)},{signal:a});let o=i=>{if(!c)return;c=!1;let d=i.clientX-r;if(Math.abs(d)>l){let u=d>0?1:-1;t.el.style.transition="transform 0.2s ease, opacity 0.2s ease",t.el.style.transform=`translateX(${u*400}px)`,t.el.style.opacity="0",f(t.id)}else{t.swipeX=0;let u=e.parentElement;u&&y(u),C(t)}};e.addEventListener("pointerup",o,{signal:a}),e.addEventListener("pointercancel",o,{signal:a})}function At(){F||!p||(F=!0,document.addEventListener("keydown",t=>{if(t.key!=="Escape")return;let e=null;for(let n of g.values())n.closing||n.opts.closeOnEscape===!1||!n.opts.closable||(e=n);e&&f(e.id)}))}function St(){q||!p||typeof document.addEventListener!="function"||(q=!0,document.addEventListener("visibilitychange",()=>{let t=document.hidden;for(let e of g.values())e.closing||e.opts.pauseOnPageHidden===!1||(t?k(e):typeof e.el.matches=="function"&&e.el.matches(":hover")||C(e))}))}function Ot(){if(!p)return;h||(h=document.createElement("div"),h.className="ga-toast-backdrop"),h.isConnected||document.body.appendChild(h);let t=h;requestAnimationFrame(()=>t.classList.add("ga-toast-backdrop-show"))}function Nt(){if(!h)return;let t=h;t.classList.remove("ga-toast-backdrop-show"),setTimeout(()=>{v==null&&t.parentNode&&t.remove()},220)}function G(t){let e={id:t,el:p?document.createElement("div"):{},update:()=>e,close:()=>{}};return e}function T(t={}){if(!p)return G(t.id||j());let e=Et(t);if(e.id&&g.has(e.id))return N(e.id,t)||G(e.id);if(e.modal){if(v&&g.has(v))return g.get(v).handle;e.swipeToClose=!1,e.closeOnEscape=!1,e.moveFocus=!0}J(),At(),St();let n=e.id||j(),{el:a,progressEl:l}=kt(e,n),c=new AbortController,r={duration:e.duration||0,remaining:e.duration||0,startedAt:0,handle:null,paused:!1},s={id:n,el:a,update:d=>(N(n,d),s),close:()=>f(n)},o={id:n,el:a,handle:s,opts:e,controller:c,progressEl:l,timer:r,height:0,closing:!1,swipeX:0,resizeObserver:null,prevFocus:e.moveFocus?document.activeElement:null};g.set(n,o),e.modal&&(v=n,a.setAttribute("aria-modal","true"),Ot());let i=xt(e.position);if(a.style.transform=Z(e.position),a.style.opacity="0",i.appendChild(a),Mt(o,e),typeof ResizeObserver<"u"&&(o.resizeObserver=new ResizeObserver(()=>{W(o);let d=a.parentElement;d&&y(d)}),o.resizeObserver.observe(a)),requestAnimationFrame(()=>{requestAnimationFrame(()=>{if(g.has(n)&&(W(o),a.dataset.gaMounted="true",a.style.opacity="1",y(i),P(o),e.moveFocus)){let d=a.querySelector("[data-ga-action]")||a;d===a&&(a.tabIndex=-1);try{d.focus({preventScroll:!0})}catch{}}})}),!e.modal&&e.role!=="alertdialog"&&bt([e.title,e.message].filter(Boolean).join(". "),K.has(e.type||"info")),e.onShow)try{e.onShow(s)}catch(d){w("toast:onShow:error",d)}return w("toast:show",{id:n,type:e.type}),s}function f(t){if(!t)return;let e=typeof t=="string"?L(t):t.id,n=g.get(e);if(!n||n.closing)return;n.closing=!0,n.timer.handle!=null&&(clearTimeout(n.timer.handle),n.timer.handle=null),n.controller.abort(),n.resizeObserver?.disconnect();let{el:a}=n,l=a.parentElement;n.swipeX||(a.style.transition="",a.classList.add("ga-toast-hide"),a.style.transform=Z(n.opts.position),a.style.opacity="0");let c=!1,r=()=>{if(c)return;c=!0,a.removeEventListener("transitionend",s),g.delete(e),a.remove(),v===e&&(v=null,Nt()),l&&y(l);let o=n.prevFocus;if(o&&typeof o.focus=="function"&&document.contains(o))try{o.focus({preventScroll:!0})}catch{}if(n.opts.onClose)try{n.opts.onClose(n.handle)}catch(i){w("toast:onClose:error",i)}w("toast:close",{id:e})},s=o=>{o.target===a&&(o.propertyName==="transform"||o.propertyName==="opacity")&&r()};a.addEventListener("transitionend",s),setTimeout(r,ft)}function L(t){return t.startsWith("#")?t.slice(1):t}function N(t,e){let n=typeof t=="string"?L(t):t.id,a=g.get(n);if(!a)return w("toast:update:not-found",n),null;let l=a.opts;if(e.title!==void 0){let r=a.el.querySelector(".ga-toast-title");if(!r&&e.title){let s=a.el.querySelector(".ga-toast-content");if(s){let o=s.querySelector(".ga-toast-header");o||(o=document.createElement("div"),o.className="ga-toast-header",s.insertBefore(o,s.firstChild)),r=document.createElement("div"),r.className="ga-toast-title",o.appendChild(r)}}r&&(r.textContent=e.title),l.title=e.title}if(e.message!==void 0){let r=e.html??l.html,s=a.el.querySelector(".ga-toast-message");if(!s&&e.message){let o=a.el.querySelector(".ga-toast-body");if(!o){o=document.createElement("div"),o.className="ga-toast-body";let i=a.el.querySelector(".ga-toast-content"),d=i?.querySelector(".ga-toast-actions, .ga-toast-steps");d?i.insertBefore(o,d):i?.appendChild(o)}s=document.createElement("div"),s.className="ga-toast-message",o.appendChild(s)}s&&(r?s.innerHTML=e.message:s.textContent=e.message),l.message=e.message}if(e.type&&e.type!==l.type){let r=l.type;a.el.classList.remove(`ga-toast-${r}`,"ga-toast-loading"),a.el.classList.add(`ga-toast-${e.type}`),a.el.setAttribute("data-ga-type",e.type),e.type==="loading"&&a.el.classList.add("ga-toast-loading"),a.progressEl&&(a.progressEl.className=a.progressEl.className.replace(/ga-toast-progress-\w+/,`ga-toast-progress-${e.type}`));let s=a.el.querySelector(".ga-toast-icon");s&&l.autoIcon!==!1&&!e.icon&&(s.innerHTML=E[e.type]||E.info),l.type=e.type}if(e.icon!==void 0){let r=a.el.querySelector(".ga-toast-icon");if(e.icon){if(!r){r=document.createElement("div"),r.className="ga-toast-icon";let s=a.el.querySelector(".ga-toast-content");a.el.insertBefore(r,s)}r.innerHTML=String(e.icon)}else r&&r.remove()}if(e.closable!==void 0){let r=a.el.querySelector(":scope > .ga-toast-close");e.closable&&!r?a.el.insertBefore(O(),a.progressEl||null):!e.closable&&r&&r.remove(),l.closable=e.closable}e.duration!==void 0&&(a.timer.handle!=null&&clearTimeout(a.timer.handle),a.timer.duration=e.duration,a.timer.remaining=e.duration,l.duration=e.duration,e.duration>0&&Pt(a).dataset.gaMounted&&P(a));let c=a.el.parentElement;return c&&y(c),w("toast:update",{id:n}),a.handle}function Pt(t){return t.el}function tt(){for(let t of Array.from(g.keys()))f(t)}function It(t){if(!t)return tt();for(let e of Array.from(g.values()))e.opts.type===t&&f(e.id)}function zt(t){if(!t)return g.size;let e=0;for(let n of g.values())n.opts.type===t&&(e+=1);return e}function $t(t){return g.has(L(t))}function Xt(t){return g.get(L(t))?.el||null}function M(t,e){return(n,a={})=>T({...a,type:t,message:n,duration:a.duration??e})}var Bt=M("success",5e3),Rt=M("error",8e3),Ft=M("warning",6e3),_=M("info",4e3);function et(t="Loading\u2026",e={}){return T({closable:!1,...e,type:"loading",message:t,duration:0,progress:!1})}function qt(t,e={}){let{confirmText:n,cancelText:a,onConfirm:l,onCancel:c,...r}=e;return T({type:"warning",duration:0,closable:!1,swipeToClose:!1,role:"alertdialog",moveFocus:!0,modal:!0,position:"middle-center",...r,message:t,actions:[{text:a||"Cancel",className:"ga-toast-btn-secondary",onClick:()=>c?.()},{text:n||"Confirm",className:"ga-toast-btn-primary",onClick:()=>l?.()}]})}function Dt(t,e,n={}){let a=typeof t=="function"?t():t,l=et(e.loading,n);return a.then(c=>(l.update({type:"success",message:typeof e.success=="function"?e.success(c):e.success,duration:n.duration??5e3,closable:!0}),c),c=>{throw l.update({type:"error",message:typeof e.error=="function"?e.error(c):e.error,duration:n.duration??8e3,closable:!0}),c})}function jt(t){A={...A,...t}}function Yt(t){S=typeof t=="function"?t:null}function Wt(t,e={}){return T({...e,content:t})}var I=Object.assign((t,e)=>_(t,e),{show:T,success:Bt,error:Rt,warning:Ft,info:_,loading:et,confirm:qt,promise:Dt,custom:Wt,close:f,closeAll:tt,clear:It,update:N,get:Xt,exists:$t,getCount:zt,setDefaults:jt,setLogger:Yt,injectStyles:J}),z=I;z.toast=I;var Vt=z;return ct(Gt);})();
556
+ GaToasts=GaToasts.default;