ga-toasts 2.0.0 → 2.1.1
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.
- package/README.md +68 -8
- package/dist/ga-toasts.css +61 -7
- package/dist/ga-toasts.global.js +1 -555
- package/dist/index.cjs +1117 -1389
- package/dist/index.d.cts +118 -45
- package/dist/index.d.ts +118 -45
- package/dist/index.js +1117 -1390
- package/package.json +20 -6
package/dist/ga-toasts.global.js
CHANGED
|
@@ -1,556 +1,2 @@
|
|
|
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);})();
|
|
1
|
+
"use strict";var GaToasts=(()=>{var et=Object.defineProperty;var me=Object.getOwnPropertyDescriptor;var he=Object.getOwnPropertyNames;var be=Object.prototype.hasOwnProperty;var ve=(o,u)=>{for(var h in u)et(o,h,{get:u[h],enumerable:!0})},xe=(o,u,h,p)=>{if(u&&typeof u=="object"||typeof u=="function")for(let b of he(u))!be.call(o,b)&&b!==h&&et(o,b,{get:()=>u[b],enumerable:!(p=me(u,b))||p.enumerable});return o};var Te=o=>xe(et({},"__esModule",{value:!0}),o);var ze={};ve(ze,{default:()=>$e});var St='.ga-toast-container{--gat-width: 380px;--gat-radius: 14px;--gat-gap: 14px;--gat-edge: 22px;--gat-pad-y: 12px;--gat-pad-x: 16px;--gat-font-size: .875rem;--gat-accent-edge: 0px;--gat-font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;--gat-surface: rgba(255, 255, 255, .82);--gat-surface-solid: #ffffff;--gat-border: rgba(15, 23, 42, .07);--gat-ring: rgba(15, 23, 42, .05);--gat-highlight: rgba(255, 255, 255, .75);--gat-text: #0f172a;--gat-text-soft: #475569;--gat-text-muted: #64748b;--gat-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 20px -12px rgba(15, 23, 42, .16);--gat-shadow-hover: 0 2px 4px -2px rgba(15, 23, 42, .12), 0 14px 32px -12px rgba(15, 23, 42, .26);--gat-chip: rgba(15, 23, 42, .05);--gat-success: #16a34a;--gat-error: #e11d48;--gat-warning: #d97706;--gat-info: #2563eb;--gat-primary: #6366f1;--gat-secondary: #64748b;--gat-loading: #2563eb;--gat-ease: cubic-bezier(.22, 1, .36, 1)}[data-ga-theme=dark] .ga-toast-container,.ga-theme-dark .ga-toast-container,.ga-toast-container.ga-theme-dark{--gat-surface: rgba(30, 34, 44, .72);--gat-surface-solid: #22262f;--gat-border: rgba(255, 255, 255, .09);--gat-ring: rgba(255, 255, 255, .06);--gat-highlight: rgba(255, 255, 255, .07);--gat-text: #f8fafc;--gat-text-soft: #cbd5e1;--gat-text-muted: #9aa7ba;--gat-shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 28px -14px rgba(0, 0, 0, .5);--gat-shadow-hover: 0 2px 6px -2px rgba(0, 0, 0, .5), 0 16px 38px -12px rgba(0, 0, 0, .64);--gat-chip: rgba(255, 255, 255, .08)}@media(prefers-color-scheme:dark){:root:not([data-ga-theme]):not(.ga-theme-light):not(.ga-theme-dark) .ga-toast-container{--gat-surface: rgba(24, 27, 34, .82);--gat-surface-solid: #191c22;--gat-border: rgba(255, 255, 255, .09);--gat-ring: rgba(255, 255, 255, .06);--gat-highlight: rgba(255, 255, 255, .07);--gat-text: #f8fafc;--gat-text-soft: #cbd5e1;--gat-text-muted: #9aa7ba;--gat-shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 28px -14px rgba(0, 0, 0, .5);--gat-chip: rgba(255, 255, 255, .08)}}.ga-toast-backdrop{position:fixed;inset:0;z-index:2147482990;background:#0a0c146b;backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px);opacity:0;transition:opacity .22s ease}.ga-toast-backdrop-show{opacity:1}@media(prefers-reduced-transparency:reduce){.ga-toast-backdrop{backdrop-filter:none;-webkit-backdrop-filter:none}}.ga-toast-container{position:fixed;z-index:2147483000;width:var(--gat-width);max-width:calc(100vw - 2 * var(--gat-edge));pointer-events:none;font-family:var(--gat-font)}.ga-toast-container-top-start{inset-block-start:var(--gat-edge);inset-inline-start:var(--gat-edge)}.ga-toast-container-top-end{inset-block-start:var(--gat-edge);inset-inline-end:var(--gat-edge)}.ga-toast-container-top-center{inset-block-start:var(--gat-edge);left:50%;transform:translate(-50%)}.ga-toast-container-bottom-start{inset-block-end:var(--gat-edge);inset-inline-start:var(--gat-edge)}.ga-toast-container-bottom-end{inset-block-end:var(--gat-edge);inset-inline-end:var(--gat-edge)}.ga-toast-container-bottom-center{inset-block-end:var(--gat-edge);left:50%;transform:translate(-50%)}.ga-toast-container-middle-start{top:50%;inset-inline-start:var(--gat-edge)}.ga-toast-container-middle-end{top:50%;inset-inline-end:var(--gat-edge)}.ga-toast-container-middle-center{top:50%;left:50%;transform:translate(-50%)}.ga-toast{position:absolute;inset-inline:0;width:100%;box-sizing:border-box;display:flex;flex-direction:row;align-items:flex-start;gap:11px;padding:var(--gat-pad-y, 12px) var(--gat-pad-x, 16px);color:var(--gat-text);background:var(--gat-surface-solid);border:none;border-radius:var(--gat-radius);box-shadow:var(--gat-shadow),inset 0 1px 0 var(--gat-highlight);pointer-events:auto;opacity:0;transform:translateY(-140%);transition:transform .5s var(--gat-ease),opacity .35s ease,box-shadow .2s ease;will-change:transform,opacity;overflow:hidden;font-size:var(--gat-font-size, .875rem);line-height:1.5;-webkit-font-smoothing:antialiased;text-align:start;touch-action:pan-y;overscroll-behavior:contain}@media(hover:hover){.ga-toast:hover{box-shadow:var(--gat-shadow-hover),inset 0 1px 0 var(--gat-highlight)}}[data-ga-position^=top] .ga-toast,[data-ga-position^=middle] .ga-toast{top:0;transform-origin:top center}[data-ga-position^=bottom] .ga-toast{bottom:0;transform-origin:bottom center}.ga-toast-glass{background:var(--gat-surface);backdrop-filter:blur(16px) saturate(160%);-webkit-backdrop-filter:blur(16px) saturate(160%)}.ga-toast-outline{background:transparent;border:1px solid var(--gat-border);box-shadow:var(--gat-shadow);backdrop-filter:none;-webkit-backdrop-filter:none}.ga-toast:before{content:"";position:absolute;inset-block:0;inset-inline-start:0;width:var(--gat-accent-edge, 0px);background:var(--gat-accent, var(--gat-info));pointer-events:none}.ga-toast-hide{pointer-events:none}.ga-toast-swiping,.ga-toast-swiping *{user-select:none;-webkit-user-select:none;cursor:grabbing}.ga-toast-success{--gat-accent: var(--gat-success)}.ga-toast-error{--gat-accent: var(--gat-error)}.ga-toast-warning{--gat-accent: var(--gat-warning)}.ga-toast-info{--gat-accent: var(--gat-info)}.ga-toast-primary{--gat-accent: var(--gat-primary)}.ga-toast-secondary{--gat-accent: var(--gat-secondary)}.ga-toast-loading{--gat-accent: var(--gat-loading)}.ga-toast-content{display:flex;flex-direction:column;gap:4px;flex:1;min-width:0}.ga-toast-header{display:flex;align-items:center;gap:8px;min-width:0}.ga-toast-icon{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;margin-top:1px;color:var(--gat-accent, var(--gat-info))}.ga-toast-icon svg{width:1.25rem;height:1.25rem;display:block;overflow:visible}.ga-toast-spinner{animation:ga-toast-spin .8s linear infinite}.ga-toast-icon-ring{position:relative;width:2rem;height:2rem;margin-top:0}.ga-toast-icon-ring>svg:not(.ga-toast-ring){width:1.1rem;height:1.1rem}.ga-toast-ring{position:absolute;inset:0;width:100%!important;height:100%!important;transform:rotate(-90deg);overflow:visible}.ga-toast-ring-track{fill:none;stroke:var(--gat-chip);stroke-width:2.4}.ga-toast-ring-bar{fill:none;stroke:var(--gat-accent, var(--gat-info));stroke-width:2.4;stroke-linecap:round}@media(prefers-reduced-motion:no-preference){.ga-toast-icon .ga-ic-ring{stroke-dasharray:64;stroke-dashoffset:64;animation:ga-toast-ic-draw .5s var(--gat-ease) .02s forwards}.ga-toast-icon .ga-ic-draw{stroke-dasharray:28;stroke-dashoffset:28;animation:ga-toast-ic-draw .4s var(--gat-ease) .16s forwards}}@keyframes ga-toast-ic-draw{to{stroke-dashoffset:0}}.ga-toast-avatar{flex-shrink:0;width:34px;height:34px;border-radius:50%;object-fit:cover;border:1px solid var(--gat-border)}.ga-toast-unread-dot{flex-shrink:0;width:8px;height:8px;border-radius:50%;background:var(--gat-accent, var(--gat-info))}.ga-toast-title{font-weight:600;font-size:.9rem;color:var(--gat-text);flex:1;min-width:0;letter-spacing:-.011em}.ga-toast-title-truncate{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ga-toast-status{flex-shrink:0;padding:2px 9px;border-radius:999px;font-size:.6875rem;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--gat-accent, var(--gat-info));color:color-mix(in srgb,var(--gat-accent, var(--gat-info)) 58%,var(--gat-text));background:var(--gat-chip);background:color-mix(in srgb,var(--gat-accent, var(--gat-info)) 18%,transparent)}.ga-toast-close{flex-shrink:0;align-self:flex-start;margin-top:-1px;margin-inline-end:-4px;display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;padding:0;border:none;border-radius:7px;color:var(--gat-text-muted);background:transparent;cursor:pointer;opacity:.9;transition:background .15s ease,color .15s ease,opacity .15s ease}.ga-toast:hover .ga-toast-close,.ga-toast:focus-within .ga-toast-close{opacity:1}.ga-toast-close svg{width:15px;height:15px;display:block}.ga-toast-close:hover{background:var(--gat-chip);color:var(--gat-text)}.ga-toast-close:focus-visible{outline:2px solid currentColor;outline-offset:2px}.ga-toast-body{min-width:0}.ga-toast-meta{font-size:.75rem;color:var(--gat-text-muted);margin-bottom:2px}.ga-toast-message{color:var(--gat-text-soft);font-size:.85rem;word-break:break-word;max-height:40vh;overflow-y:auto;overscroll-behavior:contain}.ga-toast-message a{color:var(--gat-accent, var(--gat-info));font-weight:500;text-decoration:underline}.ga-toast:not([class*=-filled]) .ga-toast-content>.ga-toast-body:only-child .ga-toast-message{color:var(--gat-text)}.ga-toast-actions{display:flex;gap:8px;margin-top:2px}.ga-toast-btn{flex:1;padding:8px 14px;font:inherit;font-size:.8125rem;font-weight:600;border-radius:9px;border:1px solid var(--gat-border);background:var(--gat-chip);color:var(--gat-text);cursor:pointer;transition:filter .15s ease,background .15s ease}.ga-toast-btn:hover{filter:brightness(.97)}.ga-toast-btn:focus-visible{outline:2px solid currentColor;outline-offset:2px}.ga-toast-btn-primary{background:var(--gat-accent, var(--gat-primary));border-color:transparent;color:#fff}.ga-toast-btn-primary:hover{filter:brightness(1.06)}.ga-toast-progress{position:absolute;left:0;bottom:0;height:2px;width:100%;transform:scaleX(1);transform-origin:left center;background:var(--gat-accent, var(--gat-info));opacity:.4}.ga-toast-progress-top{top:0;bottom:auto}.ga-toast-steps{display:flex;gap:4px;margin-top:4px}.ga-toast-step{flex:1;height:3px;border-radius:999px;background:var(--gat-chip)}.ga-toast-step-active{background:var(--gat-accent, var(--gat-info))}.ga-toast[class*=-filled]{background:var(--gat-accent, var(--gat-info));border-color:transparent;color:#fff}.ga-toast-success[class*=-filled]{background:#15803d}.ga-toast-primary[class*=-filled]{background:#4f46e5}.ga-toast[class*=-filled] .ga-toast-title,.ga-toast[class*=-filled] .ga-toast-message,.ga-toast[class*=-filled] .ga-toast-meta,.ga-toast[class*=-filled] .ga-toast-icon,.ga-toast[class*=-filled] .ga-toast-close{color:#fff}.ga-toast[class*=-filled] .ga-toast-close:hover{background:#fff3}.ga-toast[class*=-filled] .ga-toast-progress{background:#fff;opacity:.55}.ga-toast[class*=-filled] .ga-toast-step{background:#ffffff47}.ga-toast[class*=-filled] .ga-toast-step-active{background:#fff}.ga-toast[class*=-filled] .ga-toast-status{color:#fff;background:#ffffff38}.ga-toast[class*=-filled] .ga-toast-message a{color:#fff;text-decoration:underline}.ga-toast-warning[class*=-filled],.ga-toast-warning[class*=-filled] .ga-toast-title,.ga-toast-warning[class*=-filled] .ga-toast-message,.ga-toast-warning[class*=-filled] .ga-toast-meta,.ga-toast-warning[class*=-filled] .ga-toast-icon,.ga-toast-warning[class*=-filled] .ga-toast-close,.ga-toast-warning[class*=-filled] .ga-toast-message a{color:#2e2100}.ga-toast-warning[class*=-filled] .ga-toast-progress{background:#2e2100;opacity:.6}.ga-toast-warning[class*=-filled] .ga-toast-step{background:#0000002e}.ga-toast-warning[class*=-filled] .ga-toast-step-active{background:#2e2100}.ga-toast-warning[class*=-filled] .ga-toast-status{color:#2e2100;background:#00000029}.ga-toast-warning[class*=-filled] .ga-toast-close:hover{background:#00000024}.ga-toast[class*=-light]{background:var(--gat-surface);background-image:linear-gradient(0deg,color-mix(in srgb,var(--gat-accent, var(--gat-info)) 14%,transparent),color-mix(in srgb,var(--gat-accent, var(--gat-info)) 14%,transparent));border-color:color-mix(in srgb,var(--gat-accent, var(--gat-info)) 38%,var(--gat-border))}.ga-toast[class*=-light] .ga-toast-meta{color:var(--gat-text-soft)}.ga-toast[class*=-light] .ga-toast-message a{color:color-mix(in srgb,var(--gat-accent, var(--gat-info)) 55%,var(--gat-text));text-decoration:underline}.ga-toast-xs{padding:10px 13px;font-size:.78rem}.ga-toast-xs .ga-toast-icon svg{width:1.05rem;height:1.05rem}.ga-toast-xs .ga-toast-message{font-size:.78rem}.ga-toast-sm{padding:11px 14px;gap:9px}.ga-toast-lg{padding:18px 20px}.ga-toast-lg .ga-toast-title{font-size:1rem}.ga-toast-lg .ga-toast-message{font-size:.95rem}.ga-toast-lg .ga-toast-icon svg{width:1.4rem;height:1.4rem}.ga-toast-xl{padding:22px 24px}.ga-toast-xl .ga-toast-title{font-size:1.125rem}.ga-toast-xl .ga-toast-message{font-size:1.05rem}.ga-toast-xl .ga-toast-icon svg{width:1.6rem;height:1.6rem}.ga-toast-compact{align-items:center;gap:10px;padding:10px 14px}.ga-toast-compact .ga-toast-content{gap:2px}.ga-toast-compact .ga-toast-icon{margin-top:0}.ga-toast-compact .ga-toast-close{align-self:center;margin-top:0}.ga-toast-compact .ga-toast-steps{display:none}.ga-toast-compact .ga-toast-icon svg{width:1.05rem;height:1.05rem}.ga-toast-live-region{position:fixed;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0}@media(max-width:520px){.ga-toast-container{--gat-width: auto;left:var(--gat-edge);right:var(--gat-edge);transform:none}.ga-toast-container-top-center,.ga-toast-container-bottom-center,.ga-toast-container-middle-center{transform:none}}[dir=rtl] .ga-toast-progress{transform-origin:right center}@media(prefers-reduced-motion:reduce){.ga-toast{transition:opacity .15s ease}.ga-toast-spinner{animation-duration:1.4s}}@media(prefers-reduced-transparency:reduce){.ga-toast-glass{background:var(--gat-surface-solid);backdrop-filter:none;-webkit-backdrop-filter:none}}.ga-toast-custom{min-width:0}.ga-toast-has-custom{padding:0}.ga-toast-has-custom .ga-toast-close{position:absolute;inset-block-start:8px;inset-inline-end:8px;z-index:1}@keyframes ga-toast-spin{to{transform:rotate(360deg)}}';var x=typeof window<"u"&&typeof document<"u",ye="ga-toast",at="ga-toasts-styles",we=450,Ee=140,ke=3,Ce=14,Me=14,Le=.05,H='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">',Se={success:`${H}<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:`${H}<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:`${H}<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:`${H}<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:`${H}<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:`${H}<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>'},He='<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>',Ht=new Set(["error","warning"]),Ae=["top-start","top-center","top-end","middle-start","middle-center","middle-end","bottom-start","bottom-center","bottom-end"],Oe={success:5e3,error:8e3,warning:6e3,info:4e3,primary:5e3,secondary:5e3,loading:0},At={soft:{},solid:{surface:"solid",elevation:"raised"},minimal:{surface:"outline",elevation:"flat",radius:10,accentEdge:0},sharp:{radius:4},material:{surface:"solid",elevation:"floating",radius:12}},Ot={compact:["8px","13px","0.82rem"],comfortable:["12px","16px","0.875rem"],spacious:["16px","20px","0.94rem"]},Nt={flat:"0 1px 2px rgba(15,23,42,0.06)",raised:"0 1px 2px rgba(15,23,42,0.05), 0 8px 20px -12px rgba(15,23,42,0.16)",floating:"0 4px 10px -3px rgba(15,23,42,0.12), 0 20px 44px -14px rgba(15,23,42,0.34)"};function I(o){return typeof o=="number"?`${o}px`:String(o)}function nt(o){if(!o)return{};if(typeof o=="string")return{...At[o]||{}};let{preset:u,...h}=o;return{...u?At[u]||{}:{},...h}}function Pt(o){let u={};if(o.width!=null&&(u["--gat-width"]=I(o.width)),o.radius!=null&&(u["--gat-radius"]=I(o.radius)),o.gap!=null&&(u["--gat-gap"]=I(o.gap)),o.edge!=null&&(u["--gat-edge"]=I(o.edge)),o.font&&(u["--gat-font"]=o.font),o.density&&Ot[o.density]){let[h,p,b]=Ot[o.density];u["--gat-pad-y"]=h,u["--gat-pad-x"]=p,u["--gat-font-size"]=b}if(o.elevation&&Nt[o.elevation]&&(u["--gat-shadow"]=Nt[o.elevation]),o.accentEdge!=null&&(u["--gat-accent-edge"]=I(o.accentEdge)),o.accent&&(u["--gat-primary"]=o.accent),o.colors)for(let h of Object.keys(o.colors))o.colors[h]&&(u[`--gat-${h}`]=o.colors[h]);return o.text&&(u["--gat-text"]=o.text),o.textSoft&&(u["--gat-text-soft"]=o.textSoft),o.textMuted&&(u["--gat-text-muted"]=o.textMuted),o.surfaceColor&&(u["--gat-surface"]=o.surfaceColor,u["--gat-surface-solid"]=o.surfaceColor),o.border&&(u["--gat-border"]=o.border),o.shadow&&(u["--gat-shadow"]=o.shadow),o.chip&&(u["--gat-chip"]=o.chip),o.ease&&(u["--gat-ease"]=o.ease),u}function $t(o){return o.startsWith("bottom")?-1:1}function Ne(){return x?(document.documentElement.getAttribute("dir")||document.body&&document.body.getAttribute("dir"))==="rtl":!1}function It(o){let u="translateX(-115%)",h="translateX(115%)",p=Ne();return o.endsWith("start")?p?h:u:o.endsWith("end")?p?u:h:$t(o)===1?"translateY(-140%)":"translateY(140%)"}function Pe(o){return Math.max(.15,1-Math.abs(o)/220)}function V(o){return o.startsWith("#")?o.slice(1):o}function Rt(){return typeof performance<"u"?performance.now():Date.now()}function Ie(){return x&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}var Re=0;function zt(o={}){let u=Re+=1,h=`ga-toaster-${u}`,p=new Map,b=new Map,_={...o.defaults||{}},R=o.logger||null,k=null,st=!1,rt=!1,it=0,C=null,y=null,Y={...Se},lt=He,$={...Oe},z=ke,ct=Ce,U=Me,dt=Le,M="hover",gt=!1,ut=o.injectStyles!==!1,F=o.styleNonce,ft=o.render||null,D={},B,G="bar",w=null,A=o.root||(x?document.body:null),L=!!o.root&&typeof o.root.host<"u"?o.root:x?document.head:null;function pt(t){if(t)for(let e of Object.keys(t))typeof t[e]=="number"&&($[e]=t[e])}function mt(t){if(t)for(let e of Object.keys(t)){if(e==="close"){t.close&&(lt=t.close);continue}Y[e]=t[e]}}function ht(t){t&&(typeof t.peek=="number"&&(ct=t.peek),typeof t.gap=="number"&&(U=t.gap),typeof t.scaleStep=="number"&&(dt=t.scaleStep),t.expand&&(M=t.expand),typeof t.newestOnTop=="boolean"&&(gt=t.newestOnTop))}pt(o.durations),mt(o.icons),ht(o.stack),typeof o.maxVisible=="number"&&(z=Math.max(1,Math.floor(o.maxVisible)||1));function bt(){it+=1;let t=Math.random().toString(36).slice(2,8);return`${ye}-${it}-${t}`}function S(t,e){if(R)try{R(t,e)}catch{}}function vt(){if(!x||!ut||!L)return;let t=document;if(L.querySelector?.(`#${at}`)||L===t.head&&t.getElementById(at))return;let e=t.createElement("style");e.id=at,F&&e.setAttribute("nonce",F),e.textContent=St,L.appendChild(e)}function W(){if(!x||!L)return;let t=D;B=t.surface,G=t.progress||"bar";let e=`.${h}.ga-toast-container`,a=Pt(t),n=Object.entries(a).map(([l,i])=>`${l}:${i}`).join(";"),c=t.dark?Pt(t.dark):{},d=Object.entries(c).map(([l,i])=>`${l}:${i}`).join(";"),s="";if(n&&(s+=`${e}{${n}}`),d&&(s+=`[data-ga-theme="dark"] ${e},.ga-theme-dark ${e}{${d}}`),!s){w?.remove(),w=null;return}w||(w=document.createElement("style"),w.id=`ga-toasts-theme-${u}`,F&&w.setAttribute("nonce",F),L.appendChild(w)),w.textContent=s}function Dt(){if(!x||!A||k&&k.polite.isConnected&&k.assertive.isConnected)return;let t=e=>{let a=document.createElement("div");return a.className="ga-toast-live-region",a.setAttribute("aria-live",e),a.setAttribute("aria-atomic","true"),a.setAttribute("role",e==="assertive"?"alert":"status"),A.appendChild(a),a};k={polite:t("polite"),assertive:t("assertive")}}function Bt(t,e){if(!t||(Dt(),!k))return;let a=e?k.assertive:k.polite;a.textContent="",window.setTimeout(()=>{a.textContent=t},50)}function jt(t){let e=b.get(t);if(e&&e.isConnected)return e;let a=document.createElement("div");if(a.className=`ga-toast-container ga-toast-container-${t} ${h}`,a.setAttribute("data-ga-position",t),a.setAttribute("role","region"),a.setAttribute("aria-label","Notifications"),M==="always"&&(a.dataset.gaExpanded="true"),M==="hover"){let n=null,c=()=>{n!=null&&(clearTimeout(n),n=null)},d=()=>{c(),xt(a,!0)},s=()=>{c(),n=setTimeout(()=>{n=null,xt(a,!1)},Ee)};a.addEventListener("pointerenter",d),a.addEventListener("pointerleave",s),a.addEventListener("focusin",d),a.addEventListener("focusout",l=>{a.contains(l.relatedTarget)||s()})}return A?.appendChild(a),b.set(t,a),a}function xt(t,e){M==="hover"&&t.dataset.gaExpanded==="true"!==e&&(t.dataset.gaExpanded=e?"true":"false",T(t))}function Xt(t){return Array.from(t.children).map(e=>p.get(e.id)).filter(e=>!!e)}function T(t){let e=Xt(t),a=t.dataset.gaPosition||"top-end",n=$t(a),c=M==="always"||M==="hover"&&t.dataset.gaExpanded==="true",d=Ie(),s=gt?e.slice():e.slice().reverse();t.style.setProperty("--ga-toasts-count",String(s.length));let l=0;s.forEach((i,f)=>{if(i.closing)return;if(!i.el.dataset.gaMounted){l+=i.height+U;return}let r,g,m,E=f>=z;E?O(i,"overflow"):N(i,"overflow"),c||d?(r=n*l,g=1,m=1):(r=n*f*ct,g=Math.max(1-f*dt,.85),m=E?0:1);let Lt=i.swipeX?` translateX(${i.swipeX}px)`:"",pe=a.startsWith("middle")?`calc(-50% + ${r}px)`:`${r}px`;i.el.style.transform=`translateY(${pe})${Lt} scale(${g})`,i.el.style.opacity=i.swipeX?String(Pe(i.swipeX)):String(m),i.el.style.zIndex=String(1e3+s.length-f),i.el.style.pointerEvents=m===0?"none":"auto",i.el.setAttribute("aria-hidden",m===0?"true":"false"),l+=i.height+U})}function Tt(t){let e=t.el.offsetHeight;e>0&&(t.height=e)}function Vt(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,..._,...t};return e.position=e.position||"top-end",Ae.includes(e.position)||(e.position="top-end"),e}function yt(t){return Y[t]??Y.info??null}function K(){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=lt,t}function wt(t,e,a){if(G==="ring"||!e.progress||(e.duration||0)<=0||e.progressPosition==="none")return null;let n=document.createElement("div");return n.className=`ga-toast-progress ga-toast-progress-${a}`+(e.progressPosition==="top"?" ga-toast-progress-top":""),t.appendChild(n),n}function qt(t,e){let a=document.createElement("div");if(a.className="ga-toast-icon",a.innerHTML=t,!(G==="ring"&&e.progress!==!1&&(e.duration||0)>0))return{el:a,ring:null};a.classList.add("ga-toast-icon-ring");let c="http://www.w3.org/2000/svg",d=document.createElementNS(c,"svg");d.setAttribute("class","ga-toast-ring"),d.setAttribute("viewBox","0 0 36 36"),d.setAttribute("aria-hidden","true");let s=document.createElementNS(c,"circle");s.setAttribute("class","ga-toast-ring-track"),s.setAttribute("cx","18"),s.setAttribute("cy","18"),s.setAttribute("r","16");let l=document.createElementNS(c,"circle");return l.setAttribute("class","ga-toast-ring-bar"),l.setAttribute("cx","18"),l.setAttribute("cy","18"),l.setAttribute("r","16"),d.appendChild(s),d.appendChild(l),a.appendChild(d),{el:a,ring:l}}function _t(t,e){let a=t.type||"info",n=document.createElement("div");n.id=e;let c=B==="glass"||B===void 0&&t.glassmorphism;n.className=["ga-toast",`ga-toast-${a}`,t.size?`ga-toast-${t.size}`:"",t.variant?`ga-toast-${a}-${t.variant}`:"",t.animation||"",t.compact?"ga-toast-compact":"",c?"ga-toast-glass":"",B==="outline"?"ga-toast-outline":"",a==="loading"?"ga-toast-loading":"",t.className||""].filter(Boolean).join(" ");let d=t.role||(Ht.has(a)?"alert":"status");if(n.setAttribute("role",d),n.setAttribute("aria-live","off"),n.setAttribute("data-ga-type",a),d==="alertdialog"||d==="dialog"){let r=[t.title,t.message].filter(Boolean).join(". ");r&&n.setAttribute("aria-label",r)}let s=null;if(t.content!=null)s=typeof t.content=="function"?t.content():t.content;else if(ft){let r=ft(t,{id:e,close:()=>v(e)});r&&(s=r)}if(s!=null){n.classList.add("ga-toast-has-custom");let r=document.createElement("div");return r.className="ga-toast-custom",typeof s=="string"?r.innerHTML=s:r.appendChild(s),n.appendChild(r),t.closable&&n.appendChild(K()),{el:n,progressEl:wt(n,t,a),ring:null}}if(t.avatar){let r=document.createElement("img");r.className="ga-toast-avatar",r.src=t.avatar,r.alt=t.avatarAlt||t.title||"Notification",n.appendChild(r)}let l=null;t.icon?l=String(t.icon):t.icon!==!1&&t.autoIcon!==!1&&!t.avatar&&(l=yt(a));let i=null;if(l){let r=qt(l,t);i=r.ring,n.appendChild(r.el)}let f=document.createElement("div");if(f.className="ga-toast-content",t.title||t.showStatus||t.unread){let r=document.createElement("div");if(r.className="ga-toast-header",t.unread){let g=document.createElement("span");g.className="ga-toast-unread-dot",r.appendChild(g)}if(t.title){let g=document.createElement("div");g.className="ga-toast-title"+(t.truncateTitle?" ga-toast-title-truncate":""),g.textContent=t.title,r.appendChild(g)}if(t.showStatus){let g=document.createElement("span");g.className="ga-toast-status";let m=String(t.statusText||a);g.textContent=m.charAt(0).toUpperCase()+m.slice(1),r.appendChild(g)}f.appendChild(r)}if(t.message||t.meta){let r=document.createElement("div");if(r.className="ga-toast-body",t.meta){let g=document.createElement("div");g.className="ga-toast-meta",g.textContent=t.meta,r.appendChild(g)}if(t.message){let g=document.createElement("div");g.className="ga-toast-message",t.html?g.innerHTML=t.message:g.textContent=t.message,r.appendChild(g)}f.appendChild(r)}if(t.actions&&t.actions.length&&!t.compact){let r=document.createElement("div");r.className="ga-toast-actions";for(let g of t.actions){let m=document.createElement("button");m.type="button",m.className=["ga-toast-btn",g.className||g.class||"ga-toast-btn-secondary"].join(" "),m.textContent=g.text,m.setAttribute("data-ga-action",""),r.appendChild(m)}f.appendChild(r)}if(t.steps&&t.steps>1){let r=document.createElement("div");r.className="ga-toast-steps";let g=Math.min(t.steps,Math.max(1,t.currentStep||1));for(let m=1;m<=t.steps;m+=1){let E=document.createElement("div");E.className="ga-toast-step"+(m<=g?" ga-toast-step-active":""),r.appendChild(E)}f.appendChild(r)}return n.appendChild(f),t.closable&&n.appendChild(K()),{el:n,progressEl:wt(n,t,a),ring:i}}let j=2*Math.PI*16;function J(t){let{timer:e}=t;e.duration<=0||e.remaining<=0||e.holds.size>0||(e.startedAt=Rt(),e.handle=setTimeout(()=>v(t.id),e.remaining),Yt(t,e.remaining))}function O(t,e){let{timer:a}=t,n=a.holds.size>0;if(a.holds.add(e),n||a.handle==null)return;clearTimeout(a.handle),a.handle=null;let c=Rt()-a.startedAt;a.remaining=Math.max(0,a.remaining-c),Ut(t)}function N(t,e){let{timer:a}=t;a.holds.delete(e)&&(a.holds.size>0||J(t))}function Yt(t,e){let a=t.timer.duration>0?e/t.timer.duration:0;if(t.ring){let c=t.ring;c.style.transition="none",c.style.strokeDasharray=String(j),c.style.strokeDashoffset=String(j*(1-a)),c.getBoundingClientRect?.(),c.style.transition=`stroke-dashoffset ${e}ms linear`,c.style.strokeDashoffset=String(j);return}let n=t.progressEl;n&&(n.style.transition="none",n.style.transform=`scaleX(${a})`,n.offsetWidth,n.style.transition=`transform ${e}ms linear`,n.style.transform="scaleX(0)")}function Ut(t){let e=t.timer.duration>0?t.timer.remaining/t.timer.duration:0;if(t.ring){t.ring.style.transition="none",t.ring.style.strokeDashoffset=String(j*(1-e));return}let a=t.progressEl;a&&(a.style.transition="none",a.style.transform=`scaleX(${e})`)}function Gt(t,e){let{el:a,controller:n}=t,c=n.signal;a.addEventListener("click",d=>{let s=d.target;if(s.closest("[data-ga-close]")){d.preventDefault(),v(t.id);return}let l=s.closest("[data-ga-action]");if(l&&e.actions){let i=Array.from(l.parentElement?.children||[]).indexOf(l),f=e.actions[i];if(f){let r=f.onClick||f.click;r&&r(d,t.handle),f.closeOnClick!==!1&&v(t.id)}return}e.clickToClose&&!s.closest(".ga-toast-actions")&&v(t.id)},{signal:c}),e.pauseOnHover&&(a.addEventListener("pointerenter",()=>O(t,"hover"),{signal:c}),a.addEventListener("pointerleave",()=>N(t,"hover"),{signal:c}),a.addEventListener("focusin",()=>O(t,"focus"),{signal:c}),a.addEventListener("focusout",()=>N(t,"focus"),{signal:c})),e.swipeToClose&&Wt(t),e.modal&&a.addEventListener("keydown",d=>{if(d.key!=="Tab")return;let s=a.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(!s.length)return;let l=s[0],i=s[s.length-1],f=document.activeElement;d.shiftKey&&f===l?(d.preventDefault(),i.focus()):!d.shiftKey&&f===i&&(d.preventDefault(),l.focus())},{signal:c})}function Wt(t){let{el:e,controller:a}=t,n=a.signal,c=70,d=!1,s=!1,l=0,i=0;e.addEventListener("pointerdown",r=>{if(!(r.pointerType==="mouse"&&r.button!==0)&&!r.target.closest("button, a, input, textarea, select")){d=!0,s=!1,l=r.clientX,i=r.clientY,O(t,"swipe");try{e.setPointerCapture(r.pointerId)}catch{}}},{signal:n}),e.addEventListener("pointermove",r=>{if(!d)return;let g=r.clientX-l,m=r.clientY-i;if(Math.abs(g)<6||Math.abs(g)<Math.abs(m))return;r.preventDefault(),s||(s=!0,e.classList.add("ga-toast-swiping"),(typeof window<"u"&&typeof window.getSelection=="function"?window.getSelection():null)?.removeAllRanges()),t.swipeX=g;let E=e.parentElement;E&&T(E)},{signal:n});let f=r=>{if(!d)return;d=!1,s=!1,e.classList.remove("ga-toast-swiping");let g=r.clientX-l;if(Math.abs(g)>c){let m=g>0?1:-1;t.el.style.transition="transform 0.2s ease, opacity 0.2s ease",t.el.style.transform=`translateX(${m*400}px)`,t.el.style.opacity="0",v(t.id)}else{t.swipeX=0;let m=e.parentElement;m&&T(m),N(t,"swipe")}};e.addEventListener("pointerup",f,{signal:n}),e.addEventListener("pointercancel",f,{signal:n})}function Kt(){st||!x||(st=!0,document.addEventListener("keydown",t=>{if(t.key!=="Escape")return;let e=null;for(let a of p.values())a.closing||a.opts.closeOnEscape===!1||!a.opts.closable||(e=a);e&&v(e.id)}))}function Jt(){rt||!x||typeof document.addEventListener!="function"||(rt=!0,document.addEventListener("visibilitychange",()=>{let t=document.hidden;for(let e of p.values())e.closing||e.opts.pauseOnPageHidden===!1||(t?O(e,"tab"):N(e,"tab"))}))}function Qt(){if(!x||!A)return;y||(y=document.createElement("div"),y.className="ga-toast-backdrop"),y.isConnected||A.appendChild(y);let t=y;requestAnimationFrame(()=>t.classList.add("ga-toast-backdrop-show"))}function Zt(){if(!y)return;let t=y;t.classList.remove("ga-toast-backdrop-show"),setTimeout(()=>{C==null&&t.parentNode&&t.remove()},220)}function Et(t){let e={id:t,el:x?document.createElement("div"):{},update:()=>e,close:()=>{}};return e}function P(t={}){if(!x)return Et(t.id||bt());let e=Vt(t);if(e.id&&p.has(e.id))return Q(e.id,t)||Et(e.id);if(e.modal){if(C&&p.has(C))return p.get(C).handle;e.swipeToClose=!1,e.closeOnEscape=!1,e.moveFocus=!0}vt(),Kt(),Jt();let a=e.id||bt(),{el:n,progressEl:c,ring:d}=_t(e,a),s=new AbortController,l={duration:e.duration||0,remaining:e.duration||0,startedAt:0,handle:null,holds:new Set},i={id:a,el:n,update:g=>(Q(a,g),i),close:()=>v(a)},f={id:a,el:n,handle:i,opts:e,controller:s,progressEl:c,ring:d,timer:l,height:0,closing:!1,swipeX:0,resizeObserver:null,prevFocus:e.moveFocus?document.activeElement:null};p.set(a,f),e.modal&&(C=a,n.setAttribute("aria-modal","true"),Qt());let r=jt(e.position);if(n.style.transform=It(e.position),n.style.opacity="0",r.appendChild(n),Gt(f,e),typeof ResizeObserver<"u"&&(f.resizeObserver=new ResizeObserver(()=>{Tt(f);let g=n.parentElement;g&&T(g)}),f.resizeObserver.observe(n)),requestAnimationFrame(()=>{requestAnimationFrame(()=>{if(p.has(a)&&(Tt(f),n.dataset.gaMounted="true",n.style.opacity="1",T(r),J(f),e.moveFocus)){let g=n.querySelector("[data-ga-action]")||n;g===n&&(n.tabIndex=-1);try{g.focus({preventScroll:!0})}catch{}}})}),!e.modal&&e.role!=="alertdialog"&&Bt([e.title,e.message].filter(Boolean).join(". "),Ht.has(e.type||"info")),e.onShow)try{e.onShow(i)}catch(g){S("toast:onShow:error",g)}return S("toast:show",{id:a,type:e.type}),i}function v(t){if(!t)return;let e=typeof t=="string"?V(t):t.id,a=p.get(e);if(!a||a.closing)return;a.closing=!0,a.timer.handle!=null&&(clearTimeout(a.timer.handle),a.timer.handle=null),a.controller.abort(),a.resizeObserver?.disconnect();let{el:n}=a,c=n.parentElement;a.swipeX||(n.style.transition="",n.classList.add("ga-toast-hide"),n.style.transform=It(a.opts.position),n.style.opacity="0");let d=!1,s=()=>{if(d)return;d=!0,n.removeEventListener("transitionend",l),p.delete(e),n.remove(),C===e&&(C=null,Zt()),c&&T(c);let i=a.prevFocus;if(i&&typeof i.focus=="function"&&document.contains(i))try{i.focus({preventScroll:!0})}catch{}if(a.opts.onClose)try{a.opts.onClose(a.handle)}catch(f){S("toast:onClose:error",f)}S("toast:close",{id:e})},l=i=>{i.target===n&&(i.propertyName==="transform"||i.propertyName==="opacity")&&s()};n.addEventListener("transitionend",l),setTimeout(s,we)}function Q(t,e){let a=typeof t=="string"?V(t):t.id,n=p.get(a);if(!n)return S("toast:update:not-found",a),null;let c=n.opts;if(e.title!==void 0){let s=n.el.querySelector(".ga-toast-title");if(!s&&e.title){let l=n.el.querySelector(".ga-toast-content");if(l){let i=l.querySelector(".ga-toast-header");i||(i=document.createElement("div"),i.className="ga-toast-header",l.insertBefore(i,l.firstChild)),s=document.createElement("div"),s.className="ga-toast-title",i.appendChild(s)}}s&&(s.textContent=e.title),c.title=e.title}if(e.message!==void 0){let s=e.html??c.html,l=n.el.querySelector(".ga-toast-message");if(!l&&e.message){let i=n.el.querySelector(".ga-toast-body");if(!i){i=document.createElement("div"),i.className="ga-toast-body";let f=n.el.querySelector(".ga-toast-content"),r=f?.querySelector(".ga-toast-actions, .ga-toast-steps");r?f.insertBefore(i,r):f?.appendChild(i)}l=document.createElement("div"),l.className="ga-toast-message",i.appendChild(l)}l&&(s?l.innerHTML=e.message:l.textContent=e.message),c.message=e.message}if(e.type&&e.type!==c.type){let s=c.type;n.el.classList.remove(`ga-toast-${s}`,"ga-toast-loading"),n.el.classList.add(`ga-toast-${e.type}`),n.el.setAttribute("data-ga-type",e.type),e.type==="loading"&&n.el.classList.add("ga-toast-loading"),n.progressEl&&(n.progressEl.className=n.progressEl.className.replace(/ga-toast-progress-\w+/,`ga-toast-progress-${e.type}`));let l=n.el.querySelector(".ga-toast-icon");if(l&&c.autoIcon!==!1&&!e.icon){let i=yt(e.type);i!=null&&(l.innerHTML=i)}c.type=e.type}if(e.icon!==void 0){let s=n.el.querySelector(".ga-toast-icon");if(e.icon){if(!s){s=document.createElement("div"),s.className="ga-toast-icon";let l=n.el.querySelector(".ga-toast-content");n.el.insertBefore(s,l)}s.innerHTML=String(e.icon)}else s&&s.remove()}if(e.closable!==void 0){let s=n.el.querySelector(":scope > .ga-toast-close");e.closable&&!s?n.el.insertBefore(K(),n.progressEl||null):!e.closable&&s&&s.remove(),c.closable=e.closable}e.duration!==void 0&&(n.timer.handle!=null&&clearTimeout(n.timer.handle),n.timer.duration=e.duration,n.timer.remaining=e.duration,c.duration=e.duration,e.duration>0&&n.el.dataset.gaMounted&&J(n));let d=n.el.parentElement;return d&&T(d),S("toast:update",{id:a}),n.handle}function Z(){for(let t of Array.from(p.keys()))v(t)}function te(t){if(!t)return Z();for(let e of Array.from(p.values()))e.opts.type===t&&v(e.id)}function ee(t){if(!t)return p.size;let e=0;for(let a of p.values())a.opts.type===t&&(e+=1);return e}function ae(t){return p.has(V(t))}function ne(t){return p.get(V(t))?.el||null}function X(t){return(e,a={})=>P({...a,type:t,message:e,duration:a.duration??$[t]})}let oe=X("success"),se=X("error"),re=X("warning"),kt=X("info");function Ct(t="Loading\u2026",e={}){return P({closable:!1,...e,type:"loading",message:t,duration:0,progress:!1})}function ie(t,e={}){let{confirmText:a,cancelText:n,onConfirm:c,onCancel:d,...s}=e;return P({type:"warning",duration:0,closable:!1,swipeToClose:!1,role:"alertdialog",moveFocus:!0,modal:!0,position:"middle-center",...s,message:t,actions:[{text:n||"Cancel",className:"ga-toast-btn-secondary",onClick:()=>d?.()},{text:a||"Confirm",className:"ga-toast-btn-primary",onClick:()=>c?.()}]})}function le(t,e,a={}){let n=typeof t=="function"?t():t,c=Ct(e.loading,a);return n.then(d=>(c.update({type:"success",message:typeof e.success=="function"?e.success(d):e.success,duration:a.duration??$.success,closable:!0}),d),d=>{throw c.update({type:"error",message:typeof e.error=="function"?e.error(d):e.error,duration:a.duration??$.error,closable:!0}),d})}function ce(t,e={}){return P({...e,content:t})}function Mt(t){_={..._,...t}}function de(t){R=typeof t=="function"?t:null}function ge(t){z=Math.max(1,Math.floor(t)||1),b.forEach(e=>T(e))}function ue(t){return D=nt(t),W(),b.forEach(e=>T(e)),tt}function fe(t){return t.defaults&&Mt(t.defaults),t.logger!==void 0&&(R=t.logger),pt(t.durations),mt(t.icons),ht(t.stack),typeof t.maxVisible=="number"&&(z=Math.max(1,Math.floor(t.maxVisible)||1)),t.injectStyles!==void 0&&(ut=t.injectStyles!==!1),t.theme!==void 0&&(D=nt(t.theme),W()),b.forEach(e=>T(e)),tt}let tt=Object.assign((t,e)=>kt(t,e),{show:P,success:oe,error:se,warning:re,info:kt,loading:Ct,confirm:ie,promise:le,custom:ce,close:v,closeAll:Z,dismiss:v,dismissAll:Z,clear:te,update:Q,get:ne,exists:ae,getCount:ee,setDefaults:Mt,setMaxVisible:ge,setLogger:de,configure:fe,theme:ue,injectStyles:vt});return o.theme!==void 0&&(D=nt(o.theme),W()),tt}function Ft(o={}){return zt(o)}var ot=zt(),q=ot;q.toast=ot;q.createToaster=Ft;var $e=q;return Te(ze);})();
|
|
556
2
|
GaToasts=GaToasts.default;
|