@soft-toast/vue 1.0.0 → 1.0.2
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 +41 -6
- package/dist/animations/gsapConfig.d.ts.map +1 -1
- package/dist/index.js +1130 -877
- package/dist/plugin.d.ts.map +1 -1
- package/dist/stores/toastStore.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/index.d.ts +3 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/animations/gsapConfig.ts +11 -8
- package/src/components/ToastContainer.vue +2 -1
- package/src/components/ToastItem.vue +258 -63
- package/src/components/ToastRegion.vue +360 -87
- package/src/plugin.ts +8 -6
- package/src/stores/toastStore.ts +43 -13
- package/src/styles/toast.css +36 -6
- package/src/types/index.ts +3 -1
package/dist/index.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { gsap as
|
|
3
|
-
let
|
|
4
|
-
const
|
|
5
|
-
|
|
1
|
+
import { ref as R, computed as z, defineComponent as pe, shallowRef as cn, onMounted as qe, watch as G, onUnmounted as Ve, h as Ge, nextTick as Ie, openBlock as E, createElementBlock as $, createVNode as ot, unref as $t, createElementVNode as Q, normalizeStyle as De, normalizeClass as Fe, renderSlot as ie, withModifiers as $e, createCommentVNode as _, createBlock as K, resolveDynamicComponent as mt, toDisplayString as we, Fragment as Se, createTextVNode as un, renderList as Ee, Teleport as Nt, withDirectives as fn, createSlots as Ht, withCtx as qt, mergeProps as Ke, vShow as dn, createApp as pn } from "vue";
|
|
2
|
+
import { gsap as O } from "gsap";
|
|
3
|
+
let xe = null, Vt = !1;
|
|
4
|
+
const hn = () => {
|
|
5
|
+
Vt = !0;
|
|
6
6
|
};
|
|
7
7
|
typeof window < "u" && ["click", "keydown", "pointerdown", "touchstart"].forEach(
|
|
8
|
-
(e) => window.addEventListener(e,
|
|
8
|
+
(e) => window.addEventListener(e, hn, { once: !0, passive: !0 })
|
|
9
9
|
);
|
|
10
|
-
const
|
|
11
|
-
}),
|
|
12
|
-
const i =
|
|
10
|
+
const mn = () => typeof window > "u" || typeof AudioContext > "u" ? null : (xe || (xe = new AudioContext()), xe.state === "suspended" && xe.resume().catch(() => {
|
|
11
|
+
}), xe), U = (e, t, n, o = "sine", s = 0) => {
|
|
12
|
+
const i = mn();
|
|
13
13
|
if (i)
|
|
14
14
|
try {
|
|
15
15
|
const r = i.createOscillator(), a = i.createGain();
|
|
16
16
|
r.connect(a), a.connect(i.destination), r.type = o, r.frequency.setValueAtTime(e, i.currentTime + s), a.gain.setValueAtTime(0, i.currentTime + s), a.gain.linearRampToValueAtTime(n, i.currentTime + s + 0.01), a.gain.exponentialRampToValueAtTime(1e-3, i.currentTime + s + t), r.start(i.currentTime + s), r.stop(i.currentTime + s + t + 0.02);
|
|
17
17
|
} catch {
|
|
18
18
|
}
|
|
19
|
-
},
|
|
19
|
+
}, gt = {
|
|
20
20
|
success: (e) => {
|
|
21
|
-
|
|
21
|
+
U(523.25, 0.12, e * 0.45, "sine", 0), U(659.25, 0.14, e * 0.5, "sine", 0.08), U(783.99, 0.2, e * 0.55, "sine", 0.16);
|
|
22
22
|
},
|
|
23
23
|
error: (e) => {
|
|
24
|
-
|
|
24
|
+
U(329.63, 0.18, e * 0.6, "triangle", 0), U(277.18, 0.28, e * 0.55, "triangle", 0.12);
|
|
25
25
|
},
|
|
26
26
|
warning: (e) => {
|
|
27
|
-
|
|
27
|
+
U(440, 0.14, e * 0.5, "sine", 0), U(440, 0.18, e * 0.4, "sine", 0.22);
|
|
28
28
|
},
|
|
29
29
|
info: (e) => {
|
|
30
|
-
|
|
30
|
+
U(659.25, 0.12, e * 0.38, "sine", 0), U(880, 0.18, e * 0.42, "sine", 0.1);
|
|
31
31
|
},
|
|
32
32
|
default: (e) => {
|
|
33
|
-
|
|
33
|
+
U(523.25, 0.15, e * 0.35, "sine", 0);
|
|
34
34
|
},
|
|
35
35
|
// promise → same as info while loading
|
|
36
36
|
promise: (e) => {
|
|
37
|
-
|
|
37
|
+
U(523.25, 0.12, e * 0.3, "sine", 0);
|
|
38
38
|
}
|
|
39
|
-
},
|
|
40
|
-
if (!t || typeof window > "u" || !
|
|
39
|
+
}, vt = (e, t, n = 0.5) => {
|
|
40
|
+
if (!t || typeof window > "u" || !Vt) return;
|
|
41
41
|
const o = Math.max(0, Math.min(1, n));
|
|
42
42
|
if (typeof t == "string") {
|
|
43
43
|
try {
|
|
@@ -48,8 +48,8 @@ const Mt = () => typeof window > "u" || typeof AudioContext > "u" ? null : (Z ||
|
|
|
48
48
|
}
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
|
-
(
|
|
52
|
-
},
|
|
51
|
+
(gt[e] ?? gt.default)(o);
|
|
52
|
+
}, gn = () => `toast-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`, oe = {
|
|
53
53
|
type: "default",
|
|
54
54
|
duration: 4e3,
|
|
55
55
|
position: "top-right",
|
|
@@ -58,97 +58,111 @@ const Mt = () => typeof window > "u" || typeof AudioContext > "u" ? null : (Z ||
|
|
|
58
58
|
spring: !0,
|
|
59
59
|
showTimestamp: !1,
|
|
60
60
|
showProgress: !1
|
|
61
|
-
},
|
|
62
|
-
const t = e.id ||
|
|
63
|
-
if (n !== -1 && !
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
...
|
|
61
|
+
}, k = R([]), W = /* @__PURE__ */ new Map(), vn = (e) => z(() => k.value.filter((t) => t.position === e)), yn = z(() => k.value), re = (e) => {
|
|
62
|
+
const t = e.id || gn(), n = k.value.findIndex((a) => a.id === t);
|
|
63
|
+
if (n !== -1 && !k.value[n].isLeaving) {
|
|
64
|
+
const a = k.value[n];
|
|
65
|
+
k.value[n] = {
|
|
66
|
+
...a,
|
|
67
67
|
...e,
|
|
68
68
|
id: t,
|
|
69
69
|
// Reset timer so user has time to read the updated content
|
|
70
|
-
remainingTime: e.duration ??
|
|
71
|
-
isPaused:
|
|
70
|
+
remainingTime: e.duration ?? a.duration,
|
|
71
|
+
isPaused: a.isPaused,
|
|
72
72
|
isLeaving: !1
|
|
73
73
|
};
|
|
74
|
-
const
|
|
75
|
-
return
|
|
74
|
+
const c = e.sound, l = e.soundVolume ?? 0.5;
|
|
75
|
+
return c && vt(e.type ?? a.type, c, l), t;
|
|
76
76
|
}
|
|
77
|
-
const o = {
|
|
78
|
-
...
|
|
77
|
+
const o = e.duration ?? oe.duration, s = {
|
|
78
|
+
...oe,
|
|
79
79
|
...e,
|
|
80
80
|
id: t,
|
|
81
81
|
createdAt: Date.now(),
|
|
82
|
-
remainingTime:
|
|
82
|
+
remainingTime: o,
|
|
83
83
|
isPaused: !1,
|
|
84
84
|
isExpanded: !0,
|
|
85
85
|
isLeaving: !1,
|
|
86
|
-
preset: e.preset ??
|
|
87
|
-
bounce: e.bounce ??
|
|
88
|
-
spring: e.spring ??
|
|
89
|
-
showTimestamp: e.showTimestamp ??
|
|
90
|
-
showProgress: e.showProgress ??
|
|
86
|
+
preset: e.preset ?? oe.preset,
|
|
87
|
+
bounce: e.bounce ?? oe.bounce,
|
|
88
|
+
spring: e.spring ?? oe.spring,
|
|
89
|
+
showTimestamp: e.showTimestamp ?? oe.showTimestamp,
|
|
90
|
+
showProgress: e.showProgress ?? oe.showProgress
|
|
91
91
|
};
|
|
92
|
-
|
|
93
|
-
const
|
|
94
|
-
return
|
|
95
|
-
},
|
|
96
|
-
const n =
|
|
97
|
-
n !== -1 && (
|
|
98
|
-
},
|
|
92
|
+
W.set(t, { remainingTime: o, isPaused: !1 }), k.value.unshift(s), In();
|
|
93
|
+
const i = e.sound, r = e.soundVolume ?? 0.5;
|
|
94
|
+
return i && vt(s.type, i, r), t;
|
|
95
|
+
}, Je = (e, t) => {
|
|
96
|
+
const n = k.value.findIndex((o) => o.id === e);
|
|
97
|
+
n !== -1 && (k.value[n] = { ...k.value[n], ...t });
|
|
98
|
+
}, wn = (e) => {
|
|
99
99
|
var t;
|
|
100
100
|
if (!e) {
|
|
101
|
-
|
|
101
|
+
k.value.forEach((n) => {
|
|
102
102
|
n.isLeaving = !0;
|
|
103
|
-
}), setTimeout(() => {
|
|
104
|
-
|
|
103
|
+
}), W.clear(), setTimeout(() => {
|
|
104
|
+
k.value = [];
|
|
105
105
|
}, 400);
|
|
106
106
|
return;
|
|
107
107
|
}
|
|
108
108
|
if (typeof e == "string") {
|
|
109
|
-
const n =
|
|
110
|
-
n && (n.isLeaving = !0, (t = n.onDismiss) == null || t.call(n, e), setTimeout(() => {
|
|
111
|
-
|
|
109
|
+
const n = k.value.find((o) => o.id === e);
|
|
110
|
+
n && (n.isLeaving = !0, (t = n.onDismiss) == null || t.call(n, e), W.delete(e), setTimeout(() => {
|
|
111
|
+
k.value = k.value.filter((o) => o.id !== e);
|
|
112
112
|
}, 400));
|
|
113
113
|
} else {
|
|
114
114
|
const n = Array.isArray(e.type) ? e.type : [e.type];
|
|
115
|
-
|
|
115
|
+
k.value.forEach((o) => {
|
|
116
116
|
var s;
|
|
117
|
-
n.includes(o.type) && (o.isLeaving = !0, (s = o.onDismiss) == null || s.call(o, o.id));
|
|
117
|
+
n.includes(o.type) && (o.isLeaving = !0, (s = o.onDismiss) == null || s.call(o, o.id), W.delete(o.id));
|
|
118
118
|
}), setTimeout(() => {
|
|
119
|
-
|
|
119
|
+
k.value = k.value.filter((o) => !n.includes(o.type));
|
|
120
120
|
}, 400);
|
|
121
121
|
}
|
|
122
|
-
},
|
|
123
|
-
const t =
|
|
122
|
+
}, xn = (e) => {
|
|
123
|
+
const t = W.get(e);
|
|
124
124
|
t && (t.isPaused = !0);
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
const n = k.value.find((o) => o.id === e);
|
|
126
|
+
n && (n.isPaused = !0);
|
|
127
|
+
}, bn = (e) => {
|
|
128
|
+
const t = W.get(e);
|
|
127
129
|
t && (t.isPaused = !1);
|
|
128
|
-
|
|
129
|
-
|
|
130
|
+
const n = k.value.find((o) => o.id === e);
|
|
131
|
+
n && (n.isPaused = !1);
|
|
132
|
+
}, Tn = (e) => {
|
|
133
|
+
const t = k.value.find((n) => n.id === e);
|
|
130
134
|
t && (t.isExpanded = !0);
|
|
131
|
-
},
|
|
132
|
-
const t =
|
|
135
|
+
}, kn = (e) => {
|
|
136
|
+
const t = k.value.find((n) => n.id === e);
|
|
133
137
|
t && (t.isExpanded = !1);
|
|
134
138
|
};
|
|
135
|
-
let
|
|
136
|
-
const
|
|
137
|
-
if (
|
|
139
|
+
let be = 0, Me = null;
|
|
140
|
+
const In = () => {
|
|
141
|
+
if (Me !== null || typeof window > "u") return;
|
|
138
142
|
const e = (t) => {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
143
|
+
var s;
|
|
144
|
+
be === 0 && (be = t);
|
|
145
|
+
const n = t - be;
|
|
146
|
+
be = t;
|
|
147
|
+
const o = [];
|
|
148
|
+
W.forEach((i, r) => {
|
|
149
|
+
if (i.isPaused) return;
|
|
150
|
+
const a = k.value.find((c) => c.id === r);
|
|
151
|
+
!a || a.isLeaving || a.duration === 1 / 0 || (i.remainingTime -= n, a.showProgress && (a.remainingTime = i.remainingTime), i.remainingTime <= 0 && o.push(r));
|
|
152
|
+
});
|
|
153
|
+
for (const i of o) {
|
|
154
|
+
W.delete(i);
|
|
155
|
+
const r = k.value.find((a) => a.id === i);
|
|
156
|
+
r && !r.isLeaving && (r.isLeaving = !0, (s = r.onAutoClose) == null || s.call(r, i), setTimeout(() => {
|
|
157
|
+
k.value = k.value.filter((a) => a.id !== i);
|
|
158
|
+
}, 400));
|
|
159
|
+
}
|
|
160
|
+
k.value.length > 0 ? Me = requestAnimationFrame(e) : (Me = null, be = 0);
|
|
147
161
|
};
|
|
148
|
-
|
|
149
|
-
},
|
|
162
|
+
Me = requestAnimationFrame(e);
|
|
163
|
+
}, Sn = (e, t) => re({ ...t, type: "success", title: e }), En = (e, t) => re({ ...t, type: "error", title: e }), Pn = (e, t) => re({ ...t, type: "warning", title: e }), Cn = (e, t) => re({ ...t, type: "info", title: e }), An = (e, t) => re({ ...t, type: "promise", title: e, duration: 1 / 0 }), Ln = async (e, t, n) => {
|
|
150
164
|
var s, i, r;
|
|
151
|
-
const o =
|
|
165
|
+
const o = re({
|
|
152
166
|
...n,
|
|
153
167
|
type: "promise",
|
|
154
168
|
title: t.loading,
|
|
@@ -156,14 +170,14 @@ const zt = () => {
|
|
|
156
170
|
});
|
|
157
171
|
try {
|
|
158
172
|
const a = await e;
|
|
159
|
-
return
|
|
173
|
+
return Je(o, {
|
|
160
174
|
type: "success",
|
|
161
175
|
title: t.success,
|
|
162
176
|
description: (s = t.description) == null ? void 0 : s.success,
|
|
163
177
|
duration: 4e3
|
|
164
178
|
}), a;
|
|
165
179
|
} catch (a) {
|
|
166
|
-
throw
|
|
180
|
+
throw Je(o, {
|
|
167
181
|
type: "error",
|
|
168
182
|
title: t.error,
|
|
169
183
|
description: (i = t.description) == null ? void 0 : i.error,
|
|
@@ -171,29 +185,29 @@ const zt = () => {
|
|
|
171
185
|
duration: 6e3
|
|
172
186
|
}), a;
|
|
173
187
|
}
|
|
174
|
-
},
|
|
175
|
-
|
|
176
|
-
},
|
|
177
|
-
|
|
178
|
-
},
|
|
179
|
-
toasts:
|
|
180
|
-
getToastsByPosition:
|
|
181
|
-
add:
|
|
182
|
-
update:
|
|
183
|
-
dismiss:
|
|
184
|
-
pause:
|
|
185
|
-
resume:
|
|
186
|
-
expand:
|
|
187
|
-
collapse:
|
|
188
|
-
success:
|
|
189
|
-
error:
|
|
190
|
-
warning:
|
|
191
|
-
info:
|
|
192
|
-
loading:
|
|
193
|
-
promise:
|
|
194
|
-
clearAll:
|
|
195
|
-
remove:
|
|
196
|
-
},
|
|
188
|
+
}, On = () => {
|
|
189
|
+
W.clear(), k.value = [];
|
|
190
|
+
}, Mn = (e) => {
|
|
191
|
+
W.delete(e), k.value = k.value.filter((t) => t.id !== e);
|
|
192
|
+
}, v = {
|
|
193
|
+
toasts: yn,
|
|
194
|
+
getToastsByPosition: vn,
|
|
195
|
+
add: re,
|
|
196
|
+
update: Je,
|
|
197
|
+
dismiss: wn,
|
|
198
|
+
pause: xn,
|
|
199
|
+
resume: bn,
|
|
200
|
+
expand: Tn,
|
|
201
|
+
collapse: kn,
|
|
202
|
+
success: Sn,
|
|
203
|
+
error: En,
|
|
204
|
+
warning: Pn,
|
|
205
|
+
info: Cn,
|
|
206
|
+
loading: An,
|
|
207
|
+
promise: Ln,
|
|
208
|
+
clearAll: On,
|
|
209
|
+
remove: Mn
|
|
210
|
+
}, Yt = /^[a-z0-9]+(-[a-z0-9]+)*$/, Ye = (e, t, n, o = "") => {
|
|
197
211
|
const s = e.split(":");
|
|
198
212
|
if (e.slice(0, 1) === "@") {
|
|
199
213
|
if (s.length < 2 || s.length > 3) return null;
|
|
@@ -201,12 +215,12 @@ const zt = () => {
|
|
|
201
215
|
}
|
|
202
216
|
if (s.length > 3 || !s.length) return null;
|
|
203
217
|
if (s.length > 1) {
|
|
204
|
-
const a = s.pop(),
|
|
218
|
+
const a = s.pop(), c = s.pop(), l = {
|
|
205
219
|
provider: s.length > 0 ? s[0] : o,
|
|
206
|
-
prefix:
|
|
220
|
+
prefix: c,
|
|
207
221
|
name: a
|
|
208
222
|
};
|
|
209
|
-
return t && !
|
|
223
|
+
return t && !Be(l) ? null : l;
|
|
210
224
|
}
|
|
211
225
|
const i = s[0], r = i.split("-");
|
|
212
226
|
if (r.length > 1) {
|
|
@@ -215,7 +229,7 @@ const zt = () => {
|
|
|
215
229
|
prefix: r.shift(),
|
|
216
230
|
name: r.join("-")
|
|
217
231
|
};
|
|
218
|
-
return t && !
|
|
232
|
+
return t && !Be(a) ? null : a;
|
|
219
233
|
}
|
|
220
234
|
if (n && o === "") {
|
|
221
235
|
const a = {
|
|
@@ -223,100 +237,100 @@ const zt = () => {
|
|
|
223
237
|
prefix: "",
|
|
224
238
|
name: i
|
|
225
239
|
};
|
|
226
|
-
return t && !
|
|
240
|
+
return t && !Be(a, n) ? null : a;
|
|
227
241
|
}
|
|
228
242
|
return null;
|
|
229
|
-
},
|
|
230
|
-
function
|
|
243
|
+
}, Be = (e, t) => e ? !!((t && e.prefix === "" || e.prefix) && e.name) : !1;
|
|
244
|
+
function Dn(e, t) {
|
|
231
245
|
const n = e.icons, o = e.aliases || /* @__PURE__ */ Object.create(null), s = /* @__PURE__ */ Object.create(null);
|
|
232
246
|
function i(r) {
|
|
233
247
|
if (n[r]) return s[r] = [];
|
|
234
248
|
if (!(r in s)) {
|
|
235
249
|
s[r] = null;
|
|
236
|
-
const a = o[r] && o[r].parent,
|
|
237
|
-
|
|
250
|
+
const a = o[r] && o[r].parent, c = a && i(a);
|
|
251
|
+
c && (s[r] = [a].concat(c));
|
|
238
252
|
}
|
|
239
253
|
return s[r];
|
|
240
254
|
}
|
|
241
255
|
return Object.keys(n).concat(Object.keys(o)).forEach(i), s;
|
|
242
256
|
}
|
|
243
|
-
const
|
|
257
|
+
const zt = Object.freeze({
|
|
244
258
|
left: 0,
|
|
245
259
|
top: 0,
|
|
246
260
|
width: 16,
|
|
247
261
|
height: 16
|
|
248
|
-
}),
|
|
262
|
+
}), Ne = Object.freeze({
|
|
249
263
|
rotate: 0,
|
|
250
264
|
vFlip: !1,
|
|
251
265
|
hFlip: !1
|
|
252
|
-
}),
|
|
253
|
-
...
|
|
254
|
-
...
|
|
255
|
-
}),
|
|
256
|
-
...
|
|
266
|
+
}), ze = Object.freeze({
|
|
267
|
+
...zt,
|
|
268
|
+
...Ne
|
|
269
|
+
}), Ze = Object.freeze({
|
|
270
|
+
...ze,
|
|
257
271
|
body: "",
|
|
258
272
|
hidden: !1
|
|
259
273
|
});
|
|
260
|
-
function
|
|
274
|
+
function Fn(e, t) {
|
|
261
275
|
const n = {};
|
|
262
276
|
!e.hFlip != !t.hFlip && (n.hFlip = !0), !e.vFlip != !t.vFlip && (n.vFlip = !0);
|
|
263
277
|
const o = ((e.rotate || 0) + (t.rotate || 0)) % 4;
|
|
264
278
|
return o && (n.rotate = o), n;
|
|
265
279
|
}
|
|
266
|
-
function
|
|
267
|
-
const n =
|
|
268
|
-
for (const o in
|
|
280
|
+
function yt(e, t) {
|
|
281
|
+
const n = Fn(e, t);
|
|
282
|
+
for (const o in Ze) o in Ne ? o in e && !(o in n) && (n[o] = Ne[o]) : o in t ? n[o] = t[o] : o in e && (n[o] = e[o]);
|
|
269
283
|
return n;
|
|
270
284
|
}
|
|
271
|
-
function
|
|
285
|
+
function Bn(e, t, n) {
|
|
272
286
|
const o = e.icons, s = e.aliases || /* @__PURE__ */ Object.create(null);
|
|
273
287
|
let i = {};
|
|
274
288
|
function r(a) {
|
|
275
|
-
i =
|
|
289
|
+
i = yt(o[a] || s[a], i);
|
|
276
290
|
}
|
|
277
|
-
return r(t), n.forEach(r),
|
|
291
|
+
return r(t), n.forEach(r), yt(e, i);
|
|
278
292
|
}
|
|
279
|
-
function
|
|
293
|
+
function Qt(e, t) {
|
|
280
294
|
const n = [];
|
|
281
295
|
if (typeof e != "object" || typeof e.icons != "object") return n;
|
|
282
296
|
e.not_found instanceof Array && e.not_found.forEach((s) => {
|
|
283
297
|
t(s, null), n.push(s);
|
|
284
298
|
});
|
|
285
|
-
const o =
|
|
299
|
+
const o = Dn(e);
|
|
286
300
|
for (const s in o) {
|
|
287
301
|
const i = o[s];
|
|
288
|
-
i && (t(s,
|
|
302
|
+
i && (t(s, Bn(e, s, i)), n.push(s));
|
|
289
303
|
}
|
|
290
304
|
return n;
|
|
291
305
|
}
|
|
292
|
-
const
|
|
306
|
+
const jn = {
|
|
293
307
|
provider: "",
|
|
294
308
|
aliases: {},
|
|
295
309
|
not_found: {},
|
|
296
|
-
...
|
|
310
|
+
...zt
|
|
297
311
|
};
|
|
298
|
-
function
|
|
312
|
+
function Xe(e, t) {
|
|
299
313
|
for (const n in t) if (n in e && typeof e[n] != typeof t[n]) return !1;
|
|
300
314
|
return !0;
|
|
301
315
|
}
|
|
302
|
-
function
|
|
316
|
+
function Ut(e) {
|
|
303
317
|
if (typeof e != "object" || e === null) return null;
|
|
304
318
|
const t = e;
|
|
305
|
-
if (typeof t.prefix != "string" || !e.icons || typeof e.icons != "object" || !
|
|
319
|
+
if (typeof t.prefix != "string" || !e.icons || typeof e.icons != "object" || !Xe(e, jn)) return null;
|
|
306
320
|
const n = t.icons;
|
|
307
321
|
for (const s in n) {
|
|
308
322
|
const i = n[s];
|
|
309
|
-
if (!s || typeof i.body != "string" || !
|
|
323
|
+
if (!s || typeof i.body != "string" || !Xe(i, Ze)) return null;
|
|
310
324
|
}
|
|
311
325
|
const o = t.aliases || /* @__PURE__ */ Object.create(null);
|
|
312
326
|
for (const s in o) {
|
|
313
327
|
const i = o[s], r = i.parent;
|
|
314
|
-
if (!s || typeof r != "string" || !n[r] && !o[r] || !
|
|
328
|
+
if (!s || typeof r != "string" || !n[r] && !o[r] || !Xe(i, Ze)) return null;
|
|
315
329
|
}
|
|
316
330
|
return t;
|
|
317
331
|
}
|
|
318
|
-
const
|
|
319
|
-
function
|
|
332
|
+
const wt = /* @__PURE__ */ Object.create(null);
|
|
333
|
+
function Rn(e, t) {
|
|
320
334
|
return {
|
|
321
335
|
provider: e,
|
|
322
336
|
prefix: t,
|
|
@@ -324,16 +338,16 @@ function nn(e, t) {
|
|
|
324
338
|
missing: /* @__PURE__ */ new Set()
|
|
325
339
|
};
|
|
326
340
|
}
|
|
327
|
-
function
|
|
328
|
-
const n =
|
|
329
|
-
return n[t] || (n[t] =
|
|
341
|
+
function fe(e, t) {
|
|
342
|
+
const n = wt[e] || (wt[e] = /* @__PURE__ */ Object.create(null));
|
|
343
|
+
return n[t] || (n[t] = Rn(e, t));
|
|
330
344
|
}
|
|
331
|
-
function
|
|
332
|
-
return
|
|
345
|
+
function Xt(e, t) {
|
|
346
|
+
return Ut(t) ? Qt(t, (n, o) => {
|
|
333
347
|
o ? e.icons[n] = o : e.missing.add(n);
|
|
334
348
|
}) : [];
|
|
335
349
|
}
|
|
336
|
-
function
|
|
350
|
+
function $n(e, t, n) {
|
|
337
351
|
try {
|
|
338
352
|
if (typeof n.body == "string")
|
|
339
353
|
return e.icons[t] = { ...n }, !0;
|
|
@@ -341,52 +355,52 @@ function on(e, t, n) {
|
|
|
341
355
|
}
|
|
342
356
|
return !1;
|
|
343
357
|
}
|
|
344
|
-
let
|
|
345
|
-
function
|
|
346
|
-
return typeof e == "boolean" && (
|
|
358
|
+
let Pe = !1;
|
|
359
|
+
function Wt(e) {
|
|
360
|
+
return typeof e == "boolean" && (Pe = e), Pe;
|
|
347
361
|
}
|
|
348
|
-
function
|
|
349
|
-
const t = typeof e == "string" ?
|
|
362
|
+
function Nn(e) {
|
|
363
|
+
const t = typeof e == "string" ? Ye(e, !0, Pe) : e;
|
|
350
364
|
if (t) {
|
|
351
|
-
const n =
|
|
365
|
+
const n = fe(t.provider, t.prefix), o = t.name;
|
|
352
366
|
return n.icons[o] || (n.missing.has(o) ? null : void 0);
|
|
353
367
|
}
|
|
354
368
|
}
|
|
355
|
-
function
|
|
356
|
-
const n =
|
|
369
|
+
function se(e, t) {
|
|
370
|
+
const n = Ye(e, !0, Pe);
|
|
357
371
|
if (!n) return !1;
|
|
358
|
-
const o =
|
|
359
|
-
return t ?
|
|
372
|
+
const o = fe(n.provider, n.prefix);
|
|
373
|
+
return t ? $n(o, n.name, t) : (o.missing.add(n.name), !0);
|
|
360
374
|
}
|
|
361
|
-
function
|
|
375
|
+
function Hn(e, t) {
|
|
362
376
|
if (typeof e != "object") return !1;
|
|
363
|
-
if (typeof t != "string" && (t = e.provider || ""),
|
|
377
|
+
if (typeof t != "string" && (t = e.provider || ""), Pe && !t && !e.prefix) {
|
|
364
378
|
let o = !1;
|
|
365
|
-
return
|
|
366
|
-
|
|
379
|
+
return Ut(e) && (e.prefix = "", Qt(e, (s, i) => {
|
|
380
|
+
se(s, i) && (o = !0);
|
|
367
381
|
})), o;
|
|
368
382
|
}
|
|
369
383
|
const n = e.prefix;
|
|
370
|
-
return
|
|
384
|
+
return Be({
|
|
371
385
|
prefix: n,
|
|
372
386
|
name: "a"
|
|
373
|
-
}) ? !!
|
|
387
|
+
}) ? !!Xt(fe(t, n), e) : !1;
|
|
374
388
|
}
|
|
375
|
-
const
|
|
389
|
+
const Gt = Object.freeze({
|
|
376
390
|
width: null,
|
|
377
391
|
height: null
|
|
378
|
-
}),
|
|
379
|
-
...
|
|
380
|
-
...
|
|
381
|
-
}),
|
|
382
|
-
function
|
|
392
|
+
}), Kt = Object.freeze({
|
|
393
|
+
...Gt,
|
|
394
|
+
...Ne
|
|
395
|
+
}), qn = /(-?[0-9.]*[0-9]+[0-9.]*)/g, Vn = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
|
|
396
|
+
function xt(e, t, n) {
|
|
383
397
|
if (t === 1) return e;
|
|
384
398
|
if (n = n || 100, typeof e == "number") return Math.ceil(e * t * n) / n;
|
|
385
399
|
if (typeof e != "string") return e;
|
|
386
|
-
const o = e.split(
|
|
400
|
+
const o = e.split(qn);
|
|
387
401
|
if (o === null || !o.length) return e;
|
|
388
402
|
const s = [];
|
|
389
|
-
let i = o.shift(), r =
|
|
403
|
+
let i = o.shift(), r = Vn.test(i);
|
|
390
404
|
for (; ; ) {
|
|
391
405
|
if (r) {
|
|
392
406
|
const a = parseFloat(i);
|
|
@@ -396,7 +410,7 @@ function ze(e, t, n) {
|
|
|
396
410
|
r = !r;
|
|
397
411
|
}
|
|
398
412
|
}
|
|
399
|
-
function
|
|
413
|
+
function Yn(e, t = "defs") {
|
|
400
414
|
let n = "";
|
|
401
415
|
const o = e.indexOf("<" + t);
|
|
402
416
|
for (; o >= 0; ) {
|
|
@@ -411,20 +425,20 @@ function ln(e, t = "defs") {
|
|
|
411
425
|
content: e
|
|
412
426
|
};
|
|
413
427
|
}
|
|
414
|
-
function
|
|
428
|
+
function zn(e, t) {
|
|
415
429
|
return e ? "<defs>" + e + "</defs>" + t : t;
|
|
416
430
|
}
|
|
417
|
-
function
|
|
418
|
-
const o =
|
|
419
|
-
return
|
|
431
|
+
function Qn(e, t, n) {
|
|
432
|
+
const o = Yn(e);
|
|
433
|
+
return zn(o.defs, t + o.content + n);
|
|
420
434
|
}
|
|
421
|
-
const
|
|
422
|
-
function
|
|
435
|
+
const Un = (e) => e === "unset" || e === "undefined" || e === "none";
|
|
436
|
+
function Xn(e, t) {
|
|
423
437
|
const n = {
|
|
424
|
-
...
|
|
438
|
+
...ze,
|
|
425
439
|
...e
|
|
426
440
|
}, o = {
|
|
427
|
-
...
|
|
441
|
+
...Kt,
|
|
428
442
|
...t
|
|
429
443
|
}, s = {
|
|
430
444
|
left: n.left,
|
|
@@ -434,67 +448,67 @@ function pn(e, t) {
|
|
|
434
448
|
};
|
|
435
449
|
let i = n.body;
|
|
436
450
|
[n, o].forEach((I) => {
|
|
437
|
-
const
|
|
438
|
-
let
|
|
439
|
-
|
|
440
|
-
let
|
|
441
|
-
switch (
|
|
451
|
+
const h = [], F = I.hFlip, D = I.vFlip;
|
|
452
|
+
let b = I.rotate;
|
|
453
|
+
F ? D ? b += 2 : (h.push("translate(" + (s.width + s.left).toString() + " " + (0 - s.top).toString() + ")"), h.push("scale(-1 1)"), s.top = s.left = 0) : D && (h.push("translate(" + (0 - s.left).toString() + " " + (s.height + s.top).toString() + ")"), h.push("scale(1 -1)"), s.top = s.left = 0);
|
|
454
|
+
let T;
|
|
455
|
+
switch (b < 0 && (b -= Math.floor(b / 4) * 4), b = b % 4, b) {
|
|
442
456
|
case 1:
|
|
443
|
-
|
|
457
|
+
T = s.height / 2 + s.top, h.unshift("rotate(90 " + T.toString() + " " + T.toString() + ")");
|
|
444
458
|
break;
|
|
445
459
|
case 2:
|
|
446
|
-
|
|
460
|
+
h.unshift("rotate(180 " + (s.width / 2 + s.left).toString() + " " + (s.height / 2 + s.top).toString() + ")");
|
|
447
461
|
break;
|
|
448
462
|
case 3:
|
|
449
|
-
|
|
463
|
+
T = s.width / 2 + s.left, h.unshift("rotate(-90 " + T.toString() + " " + T.toString() + ")");
|
|
450
464
|
break;
|
|
451
465
|
}
|
|
452
|
-
|
|
466
|
+
b % 2 === 1 && (s.left !== s.top && (T = s.left, s.left = s.top, s.top = T), s.width !== s.height && (T = s.width, s.width = s.height, s.height = T)), h.length && (i = Qn(i, '<g transform="' + h.join(" ") + '">', "</g>"));
|
|
453
467
|
});
|
|
454
|
-
const r = o.width, a = o.height,
|
|
455
|
-
let
|
|
456
|
-
r === null ? (
|
|
457
|
-
const x = {},
|
|
458
|
-
|
|
468
|
+
const r = o.width, a = o.height, c = s.width, l = s.height;
|
|
469
|
+
let d, w;
|
|
470
|
+
r === null ? (w = a === null ? "1em" : a === "auto" ? l : a, d = xt(w, c / l)) : (d = r === "auto" ? c : r, w = a === null ? xt(d, l / c) : a === "auto" ? l : a);
|
|
471
|
+
const x = {}, S = (I, h) => {
|
|
472
|
+
Un(h) || (x[I] = h.toString());
|
|
459
473
|
};
|
|
460
|
-
|
|
461
|
-
const
|
|
474
|
+
S("width", d), S("height", w);
|
|
475
|
+
const y = [
|
|
462
476
|
s.left,
|
|
463
477
|
s.top,
|
|
464
|
-
|
|
465
|
-
|
|
478
|
+
c,
|
|
479
|
+
l
|
|
466
480
|
];
|
|
467
|
-
return x.viewBox =
|
|
481
|
+
return x.viewBox = y.join(" "), {
|
|
468
482
|
attributes: x,
|
|
469
|
-
viewBox:
|
|
483
|
+
viewBox: y,
|
|
470
484
|
body: i
|
|
471
485
|
};
|
|
472
486
|
}
|
|
473
|
-
const
|
|
474
|
-
function
|
|
487
|
+
const Wn = /\sid="(\S+)"/g, bt = /* @__PURE__ */ new Map();
|
|
488
|
+
function Gn(e) {
|
|
475
489
|
e = e.replace(/[0-9]+$/, "") || "a";
|
|
476
|
-
const t =
|
|
477
|
-
return
|
|
490
|
+
const t = bt.get(e) || 0;
|
|
491
|
+
return bt.set(e, t + 1), t ? `${e}${t}` : e;
|
|
478
492
|
}
|
|
479
|
-
function
|
|
493
|
+
function Kn(e) {
|
|
480
494
|
const t = [];
|
|
481
495
|
let n;
|
|
482
|
-
for (; n =
|
|
496
|
+
for (; n = Wn.exec(e); ) t.push(n[1]);
|
|
483
497
|
if (!t.length) return e;
|
|
484
498
|
const o = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16);
|
|
485
499
|
return t.forEach((s) => {
|
|
486
|
-
const i =
|
|
500
|
+
const i = Gn(s), r = s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
487
501
|
e = e.replace(new RegExp('([#;"])(' + r + ')([")]|\\.[a-z])', "g"), "$1" + i + o + "$3");
|
|
488
502
|
}), e = e.replace(new RegExp(o, "g"), ""), e;
|
|
489
503
|
}
|
|
490
|
-
const
|
|
491
|
-
function
|
|
492
|
-
|
|
504
|
+
const _e = /* @__PURE__ */ Object.create(null);
|
|
505
|
+
function Jn(e, t) {
|
|
506
|
+
_e[e] = t;
|
|
493
507
|
}
|
|
494
|
-
function
|
|
495
|
-
return
|
|
508
|
+
function et(e) {
|
|
509
|
+
return _e[e] || _e[""];
|
|
496
510
|
}
|
|
497
|
-
function
|
|
511
|
+
function st(e) {
|
|
498
512
|
let t;
|
|
499
513
|
if (typeof e.resources == "string") t = [e.resources];
|
|
500
514
|
else if (t = e.resources, !(t instanceof Array) || !t.length) return null;
|
|
@@ -509,26 +523,26 @@ function Ce(e) {
|
|
|
509
523
|
dataAfterTimeout: e.dataAfterTimeout !== !1
|
|
510
524
|
};
|
|
511
525
|
}
|
|
512
|
-
const
|
|
513
|
-
for (;
|
|
514
|
-
|
|
515
|
-
function
|
|
516
|
-
const n =
|
|
517
|
-
return n === null ? !1 : (
|
|
526
|
+
const it = /* @__PURE__ */ Object.create(null), Te = ["https://api.simplesvg.com", "https://api.unisvg.com"], je = [];
|
|
527
|
+
for (; Te.length > 0; ) Te.length === 1 || Math.random() > 0.5 ? je.push(Te.shift()) : je.push(Te.pop());
|
|
528
|
+
it[""] = st({ resources: ["https://api.iconify.design"].concat(je) });
|
|
529
|
+
function Zn(e, t) {
|
|
530
|
+
const n = st(t);
|
|
531
|
+
return n === null ? !1 : (it[e] = n, !0);
|
|
518
532
|
}
|
|
519
|
-
function
|
|
520
|
-
return
|
|
533
|
+
function rt(e) {
|
|
534
|
+
return it[e];
|
|
521
535
|
}
|
|
522
|
-
const
|
|
536
|
+
const _n = () => {
|
|
523
537
|
let e;
|
|
524
538
|
try {
|
|
525
539
|
if (e = fetch, typeof e == "function") return e;
|
|
526
540
|
} catch {
|
|
527
541
|
}
|
|
528
542
|
};
|
|
529
|
-
let
|
|
530
|
-
function
|
|
531
|
-
const n =
|
|
543
|
+
let Tt = _n();
|
|
544
|
+
function eo(e, t) {
|
|
545
|
+
const n = rt(e);
|
|
532
546
|
if (!n) return 0;
|
|
533
547
|
let o;
|
|
534
548
|
if (!n.maxURL) o = 0;
|
|
@@ -542,39 +556,39 @@ function xn(e, t) {
|
|
|
542
556
|
}
|
|
543
557
|
return o;
|
|
544
558
|
}
|
|
545
|
-
function
|
|
559
|
+
function to(e) {
|
|
546
560
|
return e === 404;
|
|
547
561
|
}
|
|
548
|
-
const
|
|
549
|
-
const o = [], s =
|
|
562
|
+
const no = (e, t, n) => {
|
|
563
|
+
const o = [], s = eo(e, t), i = "icons";
|
|
550
564
|
let r = {
|
|
551
565
|
type: i,
|
|
552
566
|
provider: e,
|
|
553
567
|
prefix: t,
|
|
554
568
|
icons: []
|
|
555
569
|
}, a = 0;
|
|
556
|
-
return n.forEach((
|
|
557
|
-
a +=
|
|
570
|
+
return n.forEach((c, l) => {
|
|
571
|
+
a += c.length + 1, a >= s && l > 0 && (o.push(r), r = {
|
|
558
572
|
type: i,
|
|
559
573
|
provider: e,
|
|
560
574
|
prefix: t,
|
|
561
575
|
icons: []
|
|
562
|
-
}, a =
|
|
576
|
+
}, a = c.length), r.icons.push(c);
|
|
563
577
|
}), o.push(r), o;
|
|
564
578
|
};
|
|
565
|
-
function
|
|
579
|
+
function oo(e) {
|
|
566
580
|
if (typeof e == "string") {
|
|
567
|
-
const t =
|
|
581
|
+
const t = rt(e);
|
|
568
582
|
if (t) return t.path;
|
|
569
583
|
}
|
|
570
584
|
return "/";
|
|
571
585
|
}
|
|
572
|
-
const
|
|
573
|
-
if (!
|
|
586
|
+
const so = (e, t, n) => {
|
|
587
|
+
if (!Tt) {
|
|
574
588
|
n("abort", 424);
|
|
575
589
|
return;
|
|
576
590
|
}
|
|
577
|
-
let o =
|
|
591
|
+
let o = oo(t.provider);
|
|
578
592
|
switch (t.type) {
|
|
579
593
|
case "icons": {
|
|
580
594
|
const i = t.prefix, r = t.icons.join(","), a = new URLSearchParams({ icons: r });
|
|
@@ -591,11 +605,11 @@ const In = (e, t, n) => {
|
|
|
591
605
|
return;
|
|
592
606
|
}
|
|
593
607
|
let s = 503;
|
|
594
|
-
|
|
608
|
+
Tt(e + o).then((i) => {
|
|
595
609
|
const r = i.status;
|
|
596
610
|
if (r !== 200) {
|
|
597
611
|
setTimeout(() => {
|
|
598
|
-
n(
|
|
612
|
+
n(to(r) ? "abort" : "next", r);
|
|
599
613
|
});
|
|
600
614
|
return;
|
|
601
615
|
}
|
|
@@ -613,17 +627,17 @@ const In = (e, t, n) => {
|
|
|
613
627
|
}).catch(() => {
|
|
614
628
|
n("next", s);
|
|
615
629
|
});
|
|
616
|
-
},
|
|
617
|
-
prepare:
|
|
618
|
-
send:
|
|
630
|
+
}, io = {
|
|
631
|
+
prepare: no,
|
|
632
|
+
send: so
|
|
619
633
|
};
|
|
620
|
-
function
|
|
634
|
+
function Jt(e, t) {
|
|
621
635
|
e.forEach((n) => {
|
|
622
636
|
const o = n.loaderCallbacks;
|
|
623
637
|
o && (n.loaderCallbacks = o.filter((s) => s.id !== t));
|
|
624
638
|
});
|
|
625
639
|
}
|
|
626
|
-
function
|
|
640
|
+
function ro(e) {
|
|
627
641
|
e.pendingCallbacksFlag || (e.pendingCallbacksFlag = !0, setTimeout(() => {
|
|
628
642
|
e.pendingCallbacksFlag = !1;
|
|
629
643
|
const t = e.loaderCallbacks ? e.loaderCallbacks.slice(0) : [];
|
|
@@ -632,29 +646,29 @@ function Pn(e) {
|
|
|
632
646
|
const o = e.provider, s = e.prefix;
|
|
633
647
|
t.forEach((i) => {
|
|
634
648
|
const r = i.icons, a = r.pending.length;
|
|
635
|
-
r.pending = r.pending.filter((
|
|
636
|
-
if (
|
|
637
|
-
const
|
|
638
|
-
if (e.icons[
|
|
649
|
+
r.pending = r.pending.filter((c) => {
|
|
650
|
+
if (c.prefix !== s) return !0;
|
|
651
|
+
const l = c.name;
|
|
652
|
+
if (e.icons[l]) r.loaded.push({
|
|
639
653
|
provider: o,
|
|
640
654
|
prefix: s,
|
|
641
|
-
name:
|
|
655
|
+
name: l
|
|
642
656
|
});
|
|
643
|
-
else if (e.missing.has(
|
|
657
|
+
else if (e.missing.has(l)) r.missing.push({
|
|
644
658
|
provider: o,
|
|
645
659
|
prefix: s,
|
|
646
|
-
name:
|
|
660
|
+
name: l
|
|
647
661
|
});
|
|
648
662
|
else
|
|
649
663
|
return n = !0, !0;
|
|
650
664
|
return !1;
|
|
651
|
-
}), r.pending.length !== a && (n ||
|
|
665
|
+
}), r.pending.length !== a && (n || Jt([e], i.id), i.callback(r.loaded.slice(0), r.missing.slice(0), r.pending.slice(0), i.abort));
|
|
652
666
|
});
|
|
653
667
|
}));
|
|
654
668
|
}
|
|
655
|
-
let
|
|
656
|
-
function
|
|
657
|
-
const o =
|
|
669
|
+
let ao = 0;
|
|
670
|
+
function lo(e, t, n) {
|
|
671
|
+
const o = ao++, s = Jt.bind(null, n, o);
|
|
658
672
|
if (!t.pending.length) return s;
|
|
659
673
|
const i = {
|
|
660
674
|
id: o,
|
|
@@ -666,7 +680,7 @@ function An(e, t, n) {
|
|
|
666
680
|
(r.loaderCallbacks || (r.loaderCallbacks = [])).push(i);
|
|
667
681
|
}), s;
|
|
668
682
|
}
|
|
669
|
-
function
|
|
683
|
+
function co(e) {
|
|
670
684
|
const t = {
|
|
671
685
|
loaded: [],
|
|
672
686
|
missing: [],
|
|
@@ -681,25 +695,25 @@ function Cn(e) {
|
|
|
681
695
|
return e.forEach((s) => {
|
|
682
696
|
if (o.name === s.name && o.prefix === s.prefix && o.provider === s.provider) return;
|
|
683
697
|
o = s;
|
|
684
|
-
const i = s.provider, r = s.prefix, a = s.name,
|
|
685
|
-
let
|
|
686
|
-
a in
|
|
687
|
-
const
|
|
698
|
+
const i = s.provider, r = s.prefix, a = s.name, c = n[i] || (n[i] = /* @__PURE__ */ Object.create(null)), l = c[r] || (c[r] = fe(i, r));
|
|
699
|
+
let d;
|
|
700
|
+
a in l.icons ? d = t.loaded : r === "" || l.missing.has(a) ? d = t.missing : d = t.pending;
|
|
701
|
+
const w = {
|
|
688
702
|
provider: i,
|
|
689
703
|
prefix: r,
|
|
690
704
|
name: a
|
|
691
705
|
};
|
|
692
|
-
|
|
706
|
+
d.push(w);
|
|
693
707
|
}), t;
|
|
694
708
|
}
|
|
695
|
-
function
|
|
709
|
+
function uo(e, t = !0, n = !1) {
|
|
696
710
|
const o = [];
|
|
697
711
|
return e.forEach((s) => {
|
|
698
|
-
const i = typeof s == "string" ?
|
|
712
|
+
const i = typeof s == "string" ? Ye(s, t, n) : s;
|
|
699
713
|
i && o.push(i);
|
|
700
714
|
}), o;
|
|
701
715
|
}
|
|
702
|
-
const
|
|
716
|
+
const fo = {
|
|
703
717
|
resources: [],
|
|
704
718
|
index: 0,
|
|
705
719
|
timeout: 2e3,
|
|
@@ -707,118 +721,118 @@ const Ln = {
|
|
|
707
721
|
random: !1,
|
|
708
722
|
dataAfterTimeout: !1
|
|
709
723
|
};
|
|
710
|
-
function
|
|
724
|
+
function po(e, t, n, o) {
|
|
711
725
|
const s = e.resources.length, i = e.random ? Math.floor(Math.random() * s) : e.index;
|
|
712
726
|
let r;
|
|
713
727
|
if (e.random) {
|
|
714
|
-
let
|
|
715
|
-
for (r = [];
|
|
716
|
-
const
|
|
717
|
-
r.push(
|
|
728
|
+
let g = e.resources.slice(0);
|
|
729
|
+
for (r = []; g.length > 1; ) {
|
|
730
|
+
const B = Math.floor(Math.random() * g.length);
|
|
731
|
+
r.push(g[B]), g = g.slice(0, B).concat(g.slice(B + 1));
|
|
718
732
|
}
|
|
719
|
-
r = r.concat(
|
|
733
|
+
r = r.concat(g);
|
|
720
734
|
} else r = e.resources.slice(i).concat(e.resources.slice(0, i));
|
|
721
735
|
const a = Date.now();
|
|
722
|
-
let
|
|
723
|
-
typeof o == "function" &&
|
|
724
|
-
function
|
|
725
|
-
|
|
736
|
+
let c = "pending", l = 0, d, w = null, x = [], S = [];
|
|
737
|
+
typeof o == "function" && S.push(o);
|
|
738
|
+
function y() {
|
|
739
|
+
w && (clearTimeout(w), w = null);
|
|
726
740
|
}
|
|
727
741
|
function I() {
|
|
728
|
-
|
|
729
|
-
|
|
742
|
+
c === "pending" && (c = "aborted"), y(), x.forEach((g) => {
|
|
743
|
+
g.status === "pending" && (g.status = "aborted");
|
|
730
744
|
}), x = [];
|
|
731
745
|
}
|
|
732
|
-
function
|
|
733
|
-
|
|
746
|
+
function h(g, B) {
|
|
747
|
+
B && (S = []), typeof g == "function" && S.push(g);
|
|
734
748
|
}
|
|
735
|
-
function
|
|
749
|
+
function F() {
|
|
736
750
|
return {
|
|
737
751
|
startTime: a,
|
|
738
752
|
payload: t,
|
|
739
|
-
status:
|
|
740
|
-
queriesSent:
|
|
753
|
+
status: c,
|
|
754
|
+
queriesSent: l,
|
|
741
755
|
queriesPending: x.length,
|
|
742
|
-
subscribe:
|
|
756
|
+
subscribe: h,
|
|
743
757
|
abort: I
|
|
744
758
|
};
|
|
745
759
|
}
|
|
746
|
-
function
|
|
747
|
-
|
|
748
|
-
|
|
760
|
+
function D() {
|
|
761
|
+
c = "failed", S.forEach((g) => {
|
|
762
|
+
g(void 0, d);
|
|
749
763
|
});
|
|
750
764
|
}
|
|
751
|
-
function
|
|
752
|
-
x.forEach((
|
|
753
|
-
|
|
765
|
+
function b() {
|
|
766
|
+
x.forEach((g) => {
|
|
767
|
+
g.status === "pending" && (g.status = "aborted");
|
|
754
768
|
}), x = [];
|
|
755
769
|
}
|
|
756
|
-
function g
|
|
757
|
-
const
|
|
758
|
-
switch (x = x.filter((
|
|
770
|
+
function T(g, B, X) {
|
|
771
|
+
const J = B !== "success";
|
|
772
|
+
switch (x = x.filter((L) => L !== g), c) {
|
|
759
773
|
case "pending":
|
|
760
774
|
break;
|
|
761
775
|
case "failed":
|
|
762
|
-
if (
|
|
776
|
+
if (J || !e.dataAfterTimeout) return;
|
|
763
777
|
break;
|
|
764
778
|
default:
|
|
765
779
|
return;
|
|
766
780
|
}
|
|
767
|
-
if (
|
|
768
|
-
|
|
781
|
+
if (B === "abort") {
|
|
782
|
+
d = X, D();
|
|
769
783
|
return;
|
|
770
784
|
}
|
|
771
|
-
if (
|
|
772
|
-
|
|
785
|
+
if (J) {
|
|
786
|
+
d = X, x.length || (r.length ? q() : D());
|
|
773
787
|
return;
|
|
774
788
|
}
|
|
775
|
-
if (
|
|
776
|
-
const
|
|
777
|
-
|
|
789
|
+
if (y(), b(), !e.random) {
|
|
790
|
+
const L = e.resources.indexOf(g.resource);
|
|
791
|
+
L !== -1 && L !== e.index && (e.index = L);
|
|
778
792
|
}
|
|
779
|
-
|
|
780
|
-
|
|
793
|
+
c = "completed", S.forEach((L) => {
|
|
794
|
+
L(X);
|
|
781
795
|
});
|
|
782
796
|
}
|
|
783
|
-
function
|
|
784
|
-
if (
|
|
785
|
-
|
|
786
|
-
const
|
|
787
|
-
if (
|
|
797
|
+
function q() {
|
|
798
|
+
if (c !== "pending") return;
|
|
799
|
+
y();
|
|
800
|
+
const g = r.shift();
|
|
801
|
+
if (g === void 0) {
|
|
788
802
|
if (x.length) {
|
|
789
|
-
|
|
790
|
-
|
|
803
|
+
w = setTimeout(() => {
|
|
804
|
+
y(), c === "pending" && (b(), D());
|
|
791
805
|
}, e.timeout);
|
|
792
806
|
return;
|
|
793
807
|
}
|
|
794
|
-
|
|
808
|
+
D();
|
|
795
809
|
return;
|
|
796
810
|
}
|
|
797
|
-
const
|
|
811
|
+
const B = {
|
|
798
812
|
status: "pending",
|
|
799
|
-
resource:
|
|
800
|
-
callback: (
|
|
801
|
-
|
|
813
|
+
resource: g,
|
|
814
|
+
callback: (X, J) => {
|
|
815
|
+
T(B, X, J);
|
|
802
816
|
}
|
|
803
817
|
};
|
|
804
|
-
x.push(
|
|
818
|
+
x.push(B), l++, w = setTimeout(q, e.rotate), n(g, t, B.callback);
|
|
805
819
|
}
|
|
806
|
-
return setTimeout(
|
|
820
|
+
return setTimeout(q), F;
|
|
807
821
|
}
|
|
808
|
-
function
|
|
822
|
+
function Zt(e) {
|
|
809
823
|
const t = {
|
|
810
|
-
...
|
|
824
|
+
...fo,
|
|
811
825
|
...e
|
|
812
826
|
};
|
|
813
827
|
let n = [];
|
|
814
828
|
function o() {
|
|
815
829
|
n = n.filter((r) => r().status === "pending");
|
|
816
830
|
}
|
|
817
|
-
function s(r, a,
|
|
818
|
-
const
|
|
819
|
-
o(),
|
|
831
|
+
function s(r, a, c) {
|
|
832
|
+
const l = po(t, r, a, (d, w) => {
|
|
833
|
+
o(), c && c(d, w);
|
|
820
834
|
});
|
|
821
|
-
return n.push(
|
|
835
|
+
return n.push(l), l;
|
|
822
836
|
}
|
|
823
837
|
function i(r) {
|
|
824
838
|
return n.find((a) => r(a)) || null;
|
|
@@ -833,56 +847,56 @@ function kt(e) {
|
|
|
833
847
|
cleanup: o
|
|
834
848
|
};
|
|
835
849
|
}
|
|
836
|
-
function
|
|
850
|
+
function kt() {
|
|
837
851
|
}
|
|
838
|
-
const
|
|
839
|
-
function
|
|
840
|
-
if (!
|
|
841
|
-
const t =
|
|
852
|
+
const We = /* @__PURE__ */ Object.create(null);
|
|
853
|
+
function ho(e) {
|
|
854
|
+
if (!We[e]) {
|
|
855
|
+
const t = rt(e);
|
|
842
856
|
if (!t) return;
|
|
843
|
-
|
|
857
|
+
We[e] = {
|
|
844
858
|
config: t,
|
|
845
|
-
redundancy:
|
|
859
|
+
redundancy: Zt(t)
|
|
846
860
|
};
|
|
847
861
|
}
|
|
848
|
-
return
|
|
862
|
+
return We[e];
|
|
849
863
|
}
|
|
850
|
-
function
|
|
864
|
+
function mo(e, t, n) {
|
|
851
865
|
let o, s;
|
|
852
866
|
if (typeof e == "string") {
|
|
853
|
-
const i =
|
|
867
|
+
const i = et(e);
|
|
854
868
|
if (!i)
|
|
855
|
-
return n(void 0, 424),
|
|
869
|
+
return n(void 0, 424), kt;
|
|
856
870
|
s = i.send;
|
|
857
|
-
const r =
|
|
871
|
+
const r = ho(e);
|
|
858
872
|
r && (o = r.redundancy);
|
|
859
873
|
} else {
|
|
860
|
-
const i =
|
|
874
|
+
const i = st(e);
|
|
861
875
|
if (i) {
|
|
862
|
-
o =
|
|
863
|
-
const r =
|
|
876
|
+
o = Zt(i);
|
|
877
|
+
const r = et(e.resources ? e.resources[0] : "");
|
|
864
878
|
r && (s = r.send);
|
|
865
879
|
}
|
|
866
880
|
}
|
|
867
|
-
return !o || !s ? (n(void 0, 424),
|
|
881
|
+
return !o || !s ? (n(void 0, 424), kt) : o.query(t, s, n)().abort;
|
|
868
882
|
}
|
|
869
|
-
function
|
|
883
|
+
function It() {
|
|
870
884
|
}
|
|
871
|
-
function
|
|
885
|
+
function go(e) {
|
|
872
886
|
e.iconsLoaderFlag || (e.iconsLoaderFlag = !0, setTimeout(() => {
|
|
873
|
-
e.iconsLoaderFlag = !1,
|
|
887
|
+
e.iconsLoaderFlag = !1, ro(e);
|
|
874
888
|
}));
|
|
875
889
|
}
|
|
876
|
-
function
|
|
890
|
+
function vo(e) {
|
|
877
891
|
const t = [], n = [];
|
|
878
892
|
return e.forEach((o) => {
|
|
879
|
-
(o.match(
|
|
893
|
+
(o.match(Yt) ? t : n).push(o);
|
|
880
894
|
}), {
|
|
881
895
|
valid: t,
|
|
882
896
|
invalid: n
|
|
883
897
|
};
|
|
884
898
|
}
|
|
885
|
-
function
|
|
899
|
+
function ke(e, t, n) {
|
|
886
900
|
function o() {
|
|
887
901
|
const s = e.pendingIcons;
|
|
888
902
|
t.forEach((i) => {
|
|
@@ -890,65 +904,65 @@ function te(e, t, n) {
|
|
|
890
904
|
});
|
|
891
905
|
}
|
|
892
906
|
if (n && typeof n == "object") try {
|
|
893
|
-
if (!
|
|
907
|
+
if (!Xt(e, n).length) {
|
|
894
908
|
o();
|
|
895
909
|
return;
|
|
896
910
|
}
|
|
897
911
|
} catch (s) {
|
|
898
912
|
console.error(s);
|
|
899
913
|
}
|
|
900
|
-
o(),
|
|
914
|
+
o(), go(e);
|
|
901
915
|
}
|
|
902
|
-
function
|
|
916
|
+
function St(e, t) {
|
|
903
917
|
e instanceof Promise ? e.then((n) => {
|
|
904
918
|
t(n);
|
|
905
919
|
}).catch(() => {
|
|
906
920
|
t(null);
|
|
907
921
|
}) : t(e);
|
|
908
922
|
}
|
|
909
|
-
function
|
|
923
|
+
function yo(e, t) {
|
|
910
924
|
e.iconsToLoad ? e.iconsToLoad = e.iconsToLoad.concat(t).sort() : e.iconsToLoad = t, e.iconsQueueFlag || (e.iconsQueueFlag = !0, setTimeout(() => {
|
|
911
925
|
e.iconsQueueFlag = !1;
|
|
912
926
|
const { provider: n, prefix: o } = e, s = e.iconsToLoad;
|
|
913
927
|
if (delete e.iconsToLoad, !s || !s.length) return;
|
|
914
928
|
const i = e.loadIcon;
|
|
915
929
|
if (e.loadIcons && (s.length > 1 || !i)) {
|
|
916
|
-
|
|
917
|
-
|
|
930
|
+
St(e.loadIcons(s, o, n), (l) => {
|
|
931
|
+
ke(e, s, l);
|
|
918
932
|
});
|
|
919
933
|
return;
|
|
920
934
|
}
|
|
921
935
|
if (i) {
|
|
922
|
-
s.forEach((
|
|
923
|
-
|
|
924
|
-
|
|
936
|
+
s.forEach((l) => {
|
|
937
|
+
St(i(l, o, n), (d) => {
|
|
938
|
+
ke(e, [l], d ? {
|
|
925
939
|
prefix: o,
|
|
926
|
-
icons: { [
|
|
940
|
+
icons: { [l]: d }
|
|
927
941
|
} : null);
|
|
928
942
|
});
|
|
929
943
|
});
|
|
930
944
|
return;
|
|
931
945
|
}
|
|
932
|
-
const { valid: r, invalid: a } =
|
|
933
|
-
if (a.length &&
|
|
934
|
-
const
|
|
935
|
-
if (!
|
|
936
|
-
|
|
946
|
+
const { valid: r, invalid: a } = vo(s);
|
|
947
|
+
if (a.length && ke(e, a, null), !r.length) return;
|
|
948
|
+
const c = o.match(Yt) ? et(n) : null;
|
|
949
|
+
if (!c) {
|
|
950
|
+
ke(e, r, null);
|
|
937
951
|
return;
|
|
938
952
|
}
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
953
|
+
c.prepare(n, o, r).forEach((l) => {
|
|
954
|
+
mo(n, l, (d) => {
|
|
955
|
+
ke(e, l.icons, d);
|
|
942
956
|
});
|
|
943
957
|
});
|
|
944
958
|
}));
|
|
945
959
|
}
|
|
946
|
-
const
|
|
947
|
-
const n =
|
|
960
|
+
const wo = (e, t) => {
|
|
961
|
+
const n = co(uo(e, !0, Wt()));
|
|
948
962
|
if (!n.pending.length) {
|
|
949
963
|
let a = !0;
|
|
950
964
|
return t && setTimeout(() => {
|
|
951
|
-
a && t(n.loaded, n.missing, n.pending,
|
|
965
|
+
a && t(n.loaded, n.missing, n.pending, It);
|
|
952
966
|
}), () => {
|
|
953
967
|
a = !1;
|
|
954
968
|
};
|
|
@@ -956,30 +970,30 @@ const $n = (e, t) => {
|
|
|
956
970
|
const o = /* @__PURE__ */ Object.create(null), s = [];
|
|
957
971
|
let i, r;
|
|
958
972
|
return n.pending.forEach((a) => {
|
|
959
|
-
const { provider:
|
|
960
|
-
if (
|
|
961
|
-
i =
|
|
962
|
-
const
|
|
963
|
-
|
|
973
|
+
const { provider: c, prefix: l } = a;
|
|
974
|
+
if (l === r && c === i) return;
|
|
975
|
+
i = c, r = l, s.push(fe(c, l));
|
|
976
|
+
const d = o[c] || (o[c] = /* @__PURE__ */ Object.create(null));
|
|
977
|
+
d[l] || (d[l] = []);
|
|
964
978
|
}), n.pending.forEach((a) => {
|
|
965
|
-
const { provider:
|
|
966
|
-
x.has(
|
|
979
|
+
const { provider: c, prefix: l, name: d } = a, w = fe(c, l), x = w.pendingIcons || (w.pendingIcons = /* @__PURE__ */ new Set());
|
|
980
|
+
x.has(d) || (x.add(d), o[c][l].push(d));
|
|
967
981
|
}), s.forEach((a) => {
|
|
968
|
-
const
|
|
969
|
-
|
|
970
|
-
}), t ?
|
|
982
|
+
const c = o[a.provider][a.prefix];
|
|
983
|
+
c.length && yo(a, c);
|
|
984
|
+
}), t ? lo(t, n, s) : It;
|
|
971
985
|
};
|
|
972
|
-
function
|
|
986
|
+
function xo(e, t) {
|
|
973
987
|
const n = { ...e };
|
|
974
988
|
for (const o in t) {
|
|
975
989
|
const s = t[o], i = typeof s;
|
|
976
|
-
o in
|
|
990
|
+
o in Gt ? (s === null || s && (i === "string" || i === "number")) && (n[o] = s) : i === typeof n[o] && (n[o] = o === "rotate" ? s % 4 : s);
|
|
977
991
|
}
|
|
978
992
|
return n;
|
|
979
993
|
}
|
|
980
|
-
const
|
|
981
|
-
function
|
|
982
|
-
t.split(
|
|
994
|
+
const bo = /[\s,]+/;
|
|
995
|
+
function To(e, t) {
|
|
996
|
+
t.split(bo).forEach((n) => {
|
|
983
997
|
switch (n.trim()) {
|
|
984
998
|
case "horizontal":
|
|
985
999
|
e.hFlip = !0;
|
|
@@ -990,7 +1004,7 @@ function qn(e, t) {
|
|
|
990
1004
|
}
|
|
991
1005
|
});
|
|
992
1006
|
}
|
|
993
|
-
function
|
|
1007
|
+
function ko(e, t = 0) {
|
|
994
1008
|
const n = e.replace(/^-?[0-9.]*/, "");
|
|
995
1009
|
function o(s) {
|
|
996
1010
|
for (; s < 0; ) s += 4;
|
|
@@ -1015,61 +1029,61 @@ function Vn(e, t = 0) {
|
|
|
1015
1029
|
}
|
|
1016
1030
|
return t;
|
|
1017
1031
|
}
|
|
1018
|
-
function
|
|
1032
|
+
function Io(e, t) {
|
|
1019
1033
|
let n = e.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
|
|
1020
1034
|
for (const o in t) n += " " + o + '="' + t[o] + '"';
|
|
1021
1035
|
return '<svg xmlns="http://www.w3.org/2000/svg"' + n + ">" + e + "</svg>";
|
|
1022
1036
|
}
|
|
1023
|
-
function
|
|
1037
|
+
function So(e) {
|
|
1024
1038
|
return e.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
|
|
1025
1039
|
}
|
|
1026
|
-
function
|
|
1027
|
-
return "data:image/svg+xml," +
|
|
1040
|
+
function Eo(e) {
|
|
1041
|
+
return "data:image/svg+xml," + So(e);
|
|
1028
1042
|
}
|
|
1029
|
-
function
|
|
1030
|
-
return 'url("' +
|
|
1043
|
+
function Po(e) {
|
|
1044
|
+
return 'url("' + Eo(e) + '")';
|
|
1031
1045
|
}
|
|
1032
|
-
const
|
|
1033
|
-
...
|
|
1046
|
+
const Et = {
|
|
1047
|
+
...Kt,
|
|
1034
1048
|
inline: !1
|
|
1035
|
-
},
|
|
1049
|
+
}, Co = {
|
|
1036
1050
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1037
1051
|
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
1038
1052
|
"aria-hidden": !0,
|
|
1039
1053
|
role: "img"
|
|
1040
|
-
},
|
|
1054
|
+
}, Ao = {
|
|
1041
1055
|
display: "inline-block"
|
|
1042
|
-
},
|
|
1056
|
+
}, tt = {
|
|
1043
1057
|
backgroundColor: "currentColor"
|
|
1044
|
-
},
|
|
1058
|
+
}, _t = {
|
|
1045
1059
|
backgroundColor: "transparent"
|
|
1046
|
-
},
|
|
1060
|
+
}, Pt = {
|
|
1047
1061
|
Image: "var(--svg)",
|
|
1048
1062
|
Repeat: "no-repeat",
|
|
1049
1063
|
Size: "100% 100%"
|
|
1050
|
-
},
|
|
1051
|
-
webkitMask:
|
|
1052
|
-
mask:
|
|
1053
|
-
background:
|
|
1064
|
+
}, Ct = {
|
|
1065
|
+
webkitMask: tt,
|
|
1066
|
+
mask: tt,
|
|
1067
|
+
background: _t
|
|
1054
1068
|
};
|
|
1055
|
-
for (const e in
|
|
1056
|
-
const t =
|
|
1057
|
-
for (const n in
|
|
1058
|
-
t[e + n] =
|
|
1069
|
+
for (const e in Ct) {
|
|
1070
|
+
const t = Ct[e];
|
|
1071
|
+
for (const n in Pt)
|
|
1072
|
+
t[e + n] = Pt[n];
|
|
1059
1073
|
}
|
|
1060
|
-
const
|
|
1074
|
+
const Re = {};
|
|
1061
1075
|
["horizontal", "vertical"].forEach((e) => {
|
|
1062
1076
|
const t = e.slice(0, 1) + "Flip";
|
|
1063
|
-
|
|
1077
|
+
Re[e + "-flip"] = t, Re[e.slice(0, 1) + "-flip"] = t, Re[e + "Flip"] = t;
|
|
1064
1078
|
});
|
|
1065
|
-
function
|
|
1079
|
+
function At(e) {
|
|
1066
1080
|
return e + (e.match(/^[-0-9.]+$/) ? "px" : "");
|
|
1067
1081
|
}
|
|
1068
|
-
const
|
|
1069
|
-
const n =
|
|
1082
|
+
const Lt = (e, t) => {
|
|
1083
|
+
const n = xo(Et, t), o = { ...Co }, s = t.mode || "svg", i = {}, r = t.style, a = typeof r == "object" && !(r instanceof Array) ? r : {};
|
|
1070
1084
|
for (let I in t) {
|
|
1071
|
-
const
|
|
1072
|
-
if (
|
|
1085
|
+
const h = t[I];
|
|
1086
|
+
if (h !== void 0)
|
|
1073
1087
|
switch (I) {
|
|
1074
1088
|
case "icon":
|
|
1075
1089
|
case "style":
|
|
@@ -1081,50 +1095,50 @@ const _e = (e, t) => {
|
|
|
1081
1095
|
case "inline":
|
|
1082
1096
|
case "hFlip":
|
|
1083
1097
|
case "vFlip":
|
|
1084
|
-
n[I] =
|
|
1098
|
+
n[I] = h === !0 || h === "true" || h === 1;
|
|
1085
1099
|
break;
|
|
1086
1100
|
case "flip":
|
|
1087
|
-
typeof
|
|
1101
|
+
typeof h == "string" && To(n, h);
|
|
1088
1102
|
break;
|
|
1089
1103
|
case "color":
|
|
1090
|
-
i.color =
|
|
1104
|
+
i.color = h;
|
|
1091
1105
|
break;
|
|
1092
1106
|
case "rotate":
|
|
1093
|
-
typeof
|
|
1107
|
+
typeof h == "string" ? n[I] = ko(h) : typeof h == "number" && (n[I] = h);
|
|
1094
1108
|
break;
|
|
1095
1109
|
case "ariaHidden":
|
|
1096
1110
|
case "aria-hidden":
|
|
1097
|
-
|
|
1111
|
+
h !== !0 && h !== "true" && delete o["aria-hidden"];
|
|
1098
1112
|
break;
|
|
1099
1113
|
default: {
|
|
1100
|
-
const
|
|
1101
|
-
|
|
1114
|
+
const F = Re[I];
|
|
1115
|
+
F ? (h === !0 || h === "true" || h === 1) && (n[F] = !0) : Et[I] === void 0 && (o[I] = h);
|
|
1102
1116
|
}
|
|
1103
1117
|
}
|
|
1104
1118
|
}
|
|
1105
|
-
const
|
|
1119
|
+
const c = Xn(e, n), l = c.attributes;
|
|
1106
1120
|
if (n.inline && (i.verticalAlign = "-0.125em"), s === "svg")
|
|
1107
1121
|
return o.style = {
|
|
1108
1122
|
...i,
|
|
1109
1123
|
...a
|
|
1110
|
-
}, Object.assign(o,
|
|
1111
|
-
const { body:
|
|
1112
|
-
...
|
|
1113
|
-
width:
|
|
1124
|
+
}, Object.assign(o, l), o.innerHTML = Kn(c.body), Ge("svg", o);
|
|
1125
|
+
const { body: d, width: w, height: x } = e, S = s === "mask" || (s === "bg" ? !1 : d.indexOf("currentColor") !== -1), y = Io(d, {
|
|
1126
|
+
...l,
|
|
1127
|
+
width: w + "",
|
|
1114
1128
|
height: x + ""
|
|
1115
1129
|
});
|
|
1116
1130
|
return o.style = {
|
|
1117
1131
|
...i,
|
|
1118
|
-
"--svg":
|
|
1119
|
-
width:
|
|
1120
|
-
height:
|
|
1121
|
-
...
|
|
1122
|
-
...
|
|
1132
|
+
"--svg": Po(y),
|
|
1133
|
+
width: At(l.width),
|
|
1134
|
+
height: At(l.height),
|
|
1135
|
+
...Ao,
|
|
1136
|
+
...S ? tt : _t,
|
|
1123
1137
|
...a
|
|
1124
|
-
},
|
|
1138
|
+
}, Ge("span", o);
|
|
1125
1139
|
};
|
|
1126
|
-
|
|
1127
|
-
|
|
1140
|
+
Wt(!0);
|
|
1141
|
+
Jn("", io);
|
|
1128
1142
|
if (typeof document < "u" && typeof window < "u") {
|
|
1129
1143
|
const e = window;
|
|
1130
1144
|
if (e.IconifyPreload !== void 0) {
|
|
@@ -1134,7 +1148,7 @@ if (typeof document < "u" && typeof window < "u") {
|
|
|
1134
1148
|
// Check if item is an object and not null/array
|
|
1135
1149
|
(typeof o != "object" || o === null || o instanceof Array || // Check for 'icons' and 'prefix'
|
|
1136
1150
|
typeof o.icons != "object" || typeof o.prefix != "string" || // Add icon set
|
|
1137
|
-
!
|
|
1151
|
+
!Hn(o)) && console.error(n);
|
|
1138
1152
|
} catch {
|
|
1139
1153
|
console.error(n);
|
|
1140
1154
|
}
|
|
@@ -1149,73 +1163,73 @@ if (typeof document < "u" && typeof window < "u") {
|
|
|
1149
1163
|
const s = t[n];
|
|
1150
1164
|
if (typeof s != "object" || !s || s.resources === void 0)
|
|
1151
1165
|
continue;
|
|
1152
|
-
|
|
1166
|
+
Zn(n, s) || console.error(o);
|
|
1153
1167
|
} catch {
|
|
1154
1168
|
console.error(o);
|
|
1155
1169
|
}
|
|
1156
1170
|
}
|
|
1157
1171
|
}
|
|
1158
1172
|
}
|
|
1159
|
-
const
|
|
1160
|
-
...
|
|
1173
|
+
const Lo = {
|
|
1174
|
+
...ze,
|
|
1161
1175
|
body: ""
|
|
1162
|
-
},
|
|
1163
|
-
const n =
|
|
1176
|
+
}, en = pe((e, { emit: t }) => {
|
|
1177
|
+
const n = R(null);
|
|
1164
1178
|
function o() {
|
|
1165
|
-
var
|
|
1166
|
-
n.value && ((
|
|
1179
|
+
var l, d;
|
|
1180
|
+
n.value && ((d = (l = n.value).abort) == null || d.call(l), n.value = null);
|
|
1167
1181
|
}
|
|
1168
|
-
const s =
|
|
1182
|
+
const s = R(!!e.ssr), i = R(""), r = cn(null);
|
|
1169
1183
|
function a() {
|
|
1170
|
-
const
|
|
1171
|
-
if (typeof
|
|
1184
|
+
const l = e.icon;
|
|
1185
|
+
if (typeof l == "object" && l !== null && typeof l.body == "string")
|
|
1172
1186
|
return i.value = "", {
|
|
1173
|
-
data:
|
|
1187
|
+
data: l
|
|
1174
1188
|
};
|
|
1175
|
-
let
|
|
1176
|
-
if (typeof
|
|
1189
|
+
let d;
|
|
1190
|
+
if (typeof l != "string" || (d = Ye(l, !1, !0)) === null)
|
|
1177
1191
|
return null;
|
|
1178
|
-
let
|
|
1179
|
-
if (!
|
|
1180
|
-
const
|
|
1181
|
-
return (!
|
|
1182
|
-
name:
|
|
1192
|
+
let w = Nn(d);
|
|
1193
|
+
if (!w) {
|
|
1194
|
+
const y = n.value;
|
|
1195
|
+
return (!y || y.name !== l) && (w === null ? n.value = {
|
|
1196
|
+
name: l
|
|
1183
1197
|
} : n.value = {
|
|
1184
|
-
name:
|
|
1185
|
-
abort:
|
|
1198
|
+
name: l,
|
|
1199
|
+
abort: wo([d], c)
|
|
1186
1200
|
}), null;
|
|
1187
1201
|
}
|
|
1188
|
-
o(), i.value !==
|
|
1189
|
-
t("load",
|
|
1202
|
+
o(), i.value !== l && (i.value = l, Ie(() => {
|
|
1203
|
+
t("load", l);
|
|
1190
1204
|
}));
|
|
1191
1205
|
const x = e.customise;
|
|
1192
1206
|
if (x) {
|
|
1193
|
-
|
|
1194
|
-
const
|
|
1195
|
-
typeof
|
|
1207
|
+
w = Object.assign({}, w);
|
|
1208
|
+
const y = x(w.body, d.name, d.prefix, d.provider);
|
|
1209
|
+
typeof y == "string" && (w.body = y);
|
|
1196
1210
|
}
|
|
1197
|
-
const
|
|
1198
|
-
return
|
|
1211
|
+
const S = ["iconify"];
|
|
1212
|
+
return d.prefix !== "" && S.push("iconify--" + d.prefix), d.provider !== "" && S.push("iconify--" + d.provider), { data: w, classes: S };
|
|
1199
1213
|
}
|
|
1200
|
-
function
|
|
1201
|
-
var
|
|
1202
|
-
const
|
|
1203
|
-
|
|
1214
|
+
function c() {
|
|
1215
|
+
var d;
|
|
1216
|
+
const l = a();
|
|
1217
|
+
l ? l.data !== ((d = r.value) == null ? void 0 : d.data) && (r.value = l) : r.value = null;
|
|
1204
1218
|
}
|
|
1205
|
-
return s.value ?
|
|
1206
|
-
s.value = !0,
|
|
1207
|
-
}),
|
|
1208
|
-
const
|
|
1209
|
-
if (!
|
|
1210
|
-
return
|
|
1211
|
-
let
|
|
1212
|
-
return
|
|
1219
|
+
return s.value ? c() : qe(() => {
|
|
1220
|
+
s.value = !0, c();
|
|
1221
|
+
}), G(() => e.icon, c), Ve(o), () => {
|
|
1222
|
+
const l = r.value;
|
|
1223
|
+
if (!l)
|
|
1224
|
+
return Lt(Lo, e);
|
|
1225
|
+
let d = e;
|
|
1226
|
+
return l.classes && (d = {
|
|
1213
1227
|
...e,
|
|
1214
|
-
class:
|
|
1215
|
-
}),
|
|
1216
|
-
...
|
|
1217
|
-
...
|
|
1218
|
-
},
|
|
1228
|
+
class: l.classes.join(" ")
|
|
1229
|
+
}), Lt({
|
|
1230
|
+
...ze,
|
|
1231
|
+
...l.data
|
|
1232
|
+
}, d);
|
|
1219
1233
|
};
|
|
1220
1234
|
}, {
|
|
1221
1235
|
props: [
|
|
@@ -1244,38 +1258,38 @@ const Wn = {
|
|
|
1244
1258
|
],
|
|
1245
1259
|
emits: ["load"]
|
|
1246
1260
|
});
|
|
1247
|
-
let
|
|
1248
|
-
const
|
|
1261
|
+
let Ot = !1;
|
|
1262
|
+
const ue = {
|
|
1249
1263
|
width: 24,
|
|
1250
1264
|
height: 24
|
|
1251
|
-
},
|
|
1252
|
-
|
|
1253
|
-
...
|
|
1265
|
+
}, tn = () => {
|
|
1266
|
+
Ot || (Ot = !0, se("lucide:circle-check", {
|
|
1267
|
+
...ue,
|
|
1254
1268
|
body: '<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><circle cx="12" cy="12" r="10"/><path d="m9 12l2 2l4-4"/></g>'
|
|
1255
|
-
}),
|
|
1256
|
-
...
|
|
1269
|
+
}), se("lucide:circle-x", {
|
|
1270
|
+
...ue,
|
|
1257
1271
|
body: '<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><circle cx="12" cy="12" r="10"/><path d="m15 9l-6 6m0-6l6 6"/></g>'
|
|
1258
|
-
}),
|
|
1259
|
-
...
|
|
1272
|
+
}), se("lucide:triangle-alert", {
|
|
1273
|
+
...ue,
|
|
1260
1274
|
body: '<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m21.73 18l-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3M12 9v4m0 4h.01"/>'
|
|
1261
|
-
}),
|
|
1262
|
-
...
|
|
1275
|
+
}), se("lucide:info", {
|
|
1276
|
+
...ue,
|
|
1263
1277
|
body: '<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4m0-4h.01"/></g>'
|
|
1264
|
-
}),
|
|
1265
|
-
...
|
|
1278
|
+
}), se("lucide:bell", {
|
|
1279
|
+
...ue,
|
|
1266
1280
|
body: '<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.268 21a2 2 0 0 0 3.464 0m-10.47-5.674A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326"/>'
|
|
1267
|
-
}),
|
|
1268
|
-
...
|
|
1281
|
+
}), se("lucide:loader-circle", {
|
|
1282
|
+
...ue,
|
|
1269
1283
|
body: '<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 12a9 9 0 1 1-6.219-8.56"/>'
|
|
1270
1284
|
}));
|
|
1271
|
-
},
|
|
1285
|
+
}, Oo = { class: "soft-toast-icon" }, Mt = /* @__PURE__ */ pe({
|
|
1272
1286
|
__name: "ToastIcon",
|
|
1273
1287
|
props: {
|
|
1274
1288
|
type: {},
|
|
1275
1289
|
customIcon: {}
|
|
1276
1290
|
},
|
|
1277
1291
|
setup(e) {
|
|
1278
|
-
|
|
1292
|
+
tn();
|
|
1279
1293
|
const t = e, n = {
|
|
1280
1294
|
success: "lucide:circle-check",
|
|
1281
1295
|
error: "lucide:circle-x",
|
|
@@ -1283,8 +1297,8 @@ const Y = {
|
|
|
1283
1297
|
info: "lucide:info",
|
|
1284
1298
|
default: "lucide:bell"
|
|
1285
1299
|
}, o = () => t.customIcon ? t.customIcon : n[t.type] || n.default;
|
|
1286
|
-
return (s, i) => (
|
|
1287
|
-
|
|
1300
|
+
return (s, i) => (E(), $("span", Oo, [
|
|
1301
|
+
ot($t(en), {
|
|
1288
1302
|
class: "soft-toast-icon-svg",
|
|
1289
1303
|
icon: o(),
|
|
1290
1304
|
width: 18,
|
|
@@ -1292,7 +1306,7 @@ const Y = {
|
|
|
1292
1306
|
}, null, 8, ["icon"])
|
|
1293
1307
|
]));
|
|
1294
1308
|
}
|
|
1295
|
-
}),
|
|
1309
|
+
}), He = {
|
|
1296
1310
|
smooth: {
|
|
1297
1311
|
ease: "power3.out",
|
|
1298
1312
|
elasticEase: "elastic.out(1, 0.5)",
|
|
@@ -1314,32 +1328,32 @@ const Y = {
|
|
|
1314
1328
|
duration: 0.5
|
|
1315
1329
|
}
|
|
1316
1330
|
};
|
|
1317
|
-
|
|
1318
|
-
const
|
|
1331
|
+
O.defaults({ overwrite: "auto" });
|
|
1332
|
+
const Mo = typeof window < "u" && window.matchMedia("(pointer: coarse)").matches, de = (e) => Mo ? e * 0.65 : e, Do = 0.22, nt = "power2.out", Fo = (e) => {
|
|
1319
1333
|
const t = 0.8 + e * 0.8, n = 0.55 - e * 0.15;
|
|
1320
1334
|
return `elastic.out(${t.toFixed(2)}, ${n.toFixed(2)})`;
|
|
1321
|
-
},
|
|
1322
|
-
const n = Number(
|
|
1323
|
-
return s < 0.5 ?
|
|
1335
|
+
}, Bo = (e, t, n) => Math.max(t, Math.min(n, e)), Dt = (e, t) => {
|
|
1336
|
+
const n = Number(O.getProperty(e, "y")) || 0, o = t.y - n, s = Math.abs(o);
|
|
1337
|
+
return s < 0.5 ? O.to(e, {
|
|
1324
1338
|
y: t.y,
|
|
1325
1339
|
scale: t.scale,
|
|
1326
1340
|
opacity: t.opacity,
|
|
1327
1341
|
force3D: !0,
|
|
1328
1342
|
overwrite: !0,
|
|
1329
|
-
duration:
|
|
1330
|
-
ease:
|
|
1331
|
-
}) :
|
|
1343
|
+
duration: Do,
|
|
1344
|
+
ease: nt
|
|
1345
|
+
}) : O.to(e, {
|
|
1332
1346
|
y: t.y,
|
|
1333
1347
|
scale: t.scale,
|
|
1334
1348
|
opacity: t.opacity,
|
|
1335
1349
|
force3D: !0,
|
|
1336
1350
|
overwrite: !0,
|
|
1337
|
-
duration:
|
|
1351
|
+
duration: de(Bo(0.34 + s * 3e-3, 0.36, 0.46)),
|
|
1338
1352
|
ease: "sine.out"
|
|
1339
1353
|
});
|
|
1340
|
-
},
|
|
1341
|
-
const { direction: n = "up", preset: o = "smooth" } = t, s =
|
|
1342
|
-
return
|
|
1354
|
+
}, jo = (e, t = {}) => {
|
|
1355
|
+
const { direction: n = "up", preset: o = "smooth" } = t, s = He[o] || He.smooth, i = n === "down" ? -14 : 14, r = de(Math.min(s.duration, 0.46)), a = o === "bouncy" ? "back.out(1.35)" : nt, c = O.timeline(), l = e.querySelector(".soft-toast-extra");
|
|
1356
|
+
return l && O.set(l, { height: 0, opacity: 0 }), c.fromTo(
|
|
1343
1357
|
e,
|
|
1344
1358
|
{ y: i, opacity: 0, scale: 0.94 },
|
|
1345
1359
|
{
|
|
@@ -1350,36 +1364,36 @@ const Jn = 0.22, pe = "power2.out", Zn = (e) => {
|
|
|
1350
1364
|
ease: a,
|
|
1351
1365
|
transformOrigin: n === "down" ? "top center" : "bottom center"
|
|
1352
1366
|
}
|
|
1353
|
-
),
|
|
1367
|
+
), l && c.to(l, {
|
|
1354
1368
|
height: "auto",
|
|
1355
1369
|
opacity: 1,
|
|
1356
|
-
duration: 0.36,
|
|
1370
|
+
duration: de(0.36),
|
|
1357
1371
|
force3D: !0,
|
|
1358
|
-
ease:
|
|
1372
|
+
ease: nt,
|
|
1359
1373
|
clearProps: "overflow"
|
|
1360
|
-
}, "-=0.32"),
|
|
1361
|
-
},
|
|
1374
|
+
}, "-=0.32"), c;
|
|
1375
|
+
}, Ro = (e) => O.to(e, {
|
|
1362
1376
|
scale: 0.8,
|
|
1363
1377
|
opacity: 0,
|
|
1364
1378
|
force3D: !0,
|
|
1365
1379
|
overwrite: "auto",
|
|
1366
1380
|
duration: 0.25,
|
|
1367
1381
|
ease: "power2.out"
|
|
1368
|
-
}),
|
|
1382
|
+
}), $o = (e, t) => O.to(e, {
|
|
1369
1383
|
x: t,
|
|
1370
1384
|
opacity: 0,
|
|
1371
1385
|
force3D: !0,
|
|
1372
1386
|
overwrite: "auto",
|
|
1373
1387
|
duration: 0.28,
|
|
1374
1388
|
ease: "power3.out"
|
|
1375
|
-
}),
|
|
1389
|
+
}), No = (e) => O.to(e, {
|
|
1376
1390
|
x: 0,
|
|
1377
1391
|
opacity: 1,
|
|
1378
1392
|
force3D: !0,
|
|
1379
1393
|
overwrite: "auto",
|
|
1380
|
-
duration: 0.
|
|
1394
|
+
duration: de(0.45),
|
|
1381
1395
|
ease: "elastic.out(1, 0.55)"
|
|
1382
|
-
}),
|
|
1396
|
+
}), Ho = (e, t) => {
|
|
1383
1397
|
const {
|
|
1384
1398
|
index: n,
|
|
1385
1399
|
expanded: o,
|
|
@@ -1387,49 +1401,49 @@ const Jn = 0.22, pe = "power2.out", Zn = (e) => {
|
|
|
1387
1401
|
bounce: i = 0.4,
|
|
1388
1402
|
spring: r = !0,
|
|
1389
1403
|
direction: a = "up",
|
|
1390
|
-
expandedOffset:
|
|
1391
|
-
liftPx:
|
|
1392
|
-
scaleStep:
|
|
1393
|
-
opacityStep:
|
|
1404
|
+
expandedOffset: c = 0,
|
|
1405
|
+
liftPx: l = 14,
|
|
1406
|
+
scaleStep: d = 0.055,
|
|
1407
|
+
opacityStep: w = 0.2,
|
|
1394
1408
|
maxVisible: x = 3,
|
|
1395
|
-
reposition:
|
|
1396
|
-
} = t,
|
|
1409
|
+
reposition: S = !1
|
|
1410
|
+
} = t, y = He[s] || He.smooth, I = a === "up" ? -1 : 1;
|
|
1397
1411
|
if (o) {
|
|
1398
|
-
const
|
|
1399
|
-
y:
|
|
1412
|
+
const g = {
|
|
1413
|
+
y: c * I,
|
|
1400
1414
|
scale: 1,
|
|
1401
1415
|
opacity: 1
|
|
1402
1416
|
};
|
|
1403
|
-
return
|
|
1404
|
-
...
|
|
1417
|
+
return S && r ? Dt(e, g) : O.to(e, {
|
|
1418
|
+
...g,
|
|
1405
1419
|
force3D: !0,
|
|
1406
1420
|
overwrite: "auto",
|
|
1407
|
-
duration: 0.
|
|
1408
|
-
ease:
|
|
1421
|
+
duration: de(0.12),
|
|
1422
|
+
ease: "power2.out"
|
|
1409
1423
|
});
|
|
1410
1424
|
}
|
|
1411
|
-
const
|
|
1412
|
-
if (
|
|
1413
|
-
return
|
|
1414
|
-
y:
|
|
1415
|
-
scale:
|
|
1416
|
-
opacity:
|
|
1425
|
+
const h = n >= x, F = Math.min(n, x), D = F * l * I, b = 1 - F * d, T = h ? 0 : Math.max(0, 1 - F * w);
|
|
1426
|
+
if (S && r)
|
|
1427
|
+
return Dt(e, {
|
|
1428
|
+
y: D,
|
|
1429
|
+
scale: b,
|
|
1430
|
+
opacity: T
|
|
1417
1431
|
});
|
|
1418
|
-
const
|
|
1419
|
-
return
|
|
1420
|
-
y:
|
|
1421
|
-
scale:
|
|
1422
|
-
opacity:
|
|
1432
|
+
const q = r ? Fo(i) : y.ease;
|
|
1433
|
+
return O.to(e, {
|
|
1434
|
+
y: D,
|
|
1435
|
+
scale: b,
|
|
1436
|
+
opacity: T,
|
|
1423
1437
|
force3D: !0,
|
|
1424
1438
|
overwrite: "auto",
|
|
1425
|
-
duration:
|
|
1426
|
-
ease:
|
|
1439
|
+
duration: de(y.duration * 0.85),
|
|
1440
|
+
ease: q
|
|
1427
1441
|
});
|
|
1428
|
-
},
|
|
1442
|
+
}, qo = (e, t, n) => O.fromTo(
|
|
1429
1443
|
e,
|
|
1430
1444
|
{ scaleX: 1 },
|
|
1431
1445
|
{ scaleX: 0, duration: t / 1e3, ease: "linear", onComplete: n }
|
|
1432
|
-
),
|
|
1446
|
+
), Ft = (e) => e.pause(), Vo = (e) => e.play(), Yo = (e) => O.killTweensOf(e), zo = { class: "soft-toast-progress" }, Qo = /* @__PURE__ */ pe({
|
|
1433
1447
|
__name: "ToastProgress",
|
|
1434
1448
|
props: {
|
|
1435
1449
|
remainingTime: {},
|
|
@@ -1437,19 +1451,19 @@ const Jn = 0.22, pe = "power2.out", Zn = (e) => {
|
|
|
1437
1451
|
isPaused: { type: Boolean }
|
|
1438
1452
|
},
|
|
1439
1453
|
setup(e) {
|
|
1440
|
-
const t = e, n =
|
|
1441
|
-
return
|
|
1442
|
-
n.value && (o.value =
|
|
1454
|
+
const t = e, n = R(null), o = R(null);
|
|
1455
|
+
return qe(() => {
|
|
1456
|
+
n.value && (o.value = qo(
|
|
1443
1457
|
n.value,
|
|
1444
1458
|
t.remainingTime
|
|
1445
|
-
), t.isPaused &&
|
|
1446
|
-
}),
|
|
1447
|
-
o.value && (s ?
|
|
1448
|
-
}),
|
|
1459
|
+
), t.isPaused && Ft(o.value));
|
|
1460
|
+
}), G(() => t.isPaused, (s) => {
|
|
1461
|
+
o.value && (s ? Ft(o.value) : Vo(o.value));
|
|
1462
|
+
}), Ve(() => {
|
|
1449
1463
|
var s;
|
|
1450
1464
|
(s = o.value) == null || s.kill();
|
|
1451
|
-
}), (s, i) => (
|
|
1452
|
-
|
|
1465
|
+
}), (s, i) => (E(), $("div", zo, [
|
|
1466
|
+
Q(
|
|
1453
1467
|
"div",
|
|
1454
1468
|
{
|
|
1455
1469
|
ref_key: "progressRef",
|
|
@@ -1462,32 +1476,32 @@ const Jn = 0.22, pe = "power2.out", Zn = (e) => {
|
|
|
1462
1476
|
)
|
|
1463
1477
|
]));
|
|
1464
1478
|
}
|
|
1465
|
-
}),
|
|
1479
|
+
}), Uo = ["data-type", "data-st-index", "data-toast-id", "data-leaving", "data-interactive"], Xo = ["data-position"], Wo = { class: "soft-toast-content" }, Go = {
|
|
1466
1480
|
key: 0,
|
|
1467
1481
|
class: "soft-toast-icon"
|
|
1468
|
-
},
|
|
1482
|
+
}, Ko = {
|
|
1469
1483
|
key: 2,
|
|
1470
1484
|
class: "soft-toast-icon"
|
|
1471
|
-
},
|
|
1485
|
+
}, Jo = { class: "soft-toast-body" }, Zo = { class: "soft-toast-header-row" }, _o = {
|
|
1472
1486
|
key: 0,
|
|
1473
1487
|
class: "soft-toast-extra",
|
|
1474
1488
|
style: { overflow: "hidden" }
|
|
1475
|
-
},
|
|
1489
|
+
}, es = {
|
|
1476
1490
|
key: 0,
|
|
1477
1491
|
class: "soft-toast-description"
|
|
1478
|
-
},
|
|
1492
|
+
}, ts = {
|
|
1479
1493
|
key: 0,
|
|
1480
1494
|
class: "soft-toast-action"
|
|
1481
|
-
},
|
|
1495
|
+
}, ns = ["onClick"], os = {
|
|
1482
1496
|
key: 1,
|
|
1483
1497
|
class: "soft-toast-action"
|
|
1484
|
-
},
|
|
1498
|
+
}, ss = {
|
|
1485
1499
|
class: "soft-toast-action-button soft-toast-action-success",
|
|
1486
1500
|
style: { opacity: "0.75", cursor: "default" }
|
|
1487
|
-
},
|
|
1501
|
+
}, is = {
|
|
1488
1502
|
key: 1,
|
|
1489
1503
|
class: "soft-toast-timestamp"
|
|
1490
|
-
},
|
|
1504
|
+
}, Bt = /* @__PURE__ */ pe({
|
|
1491
1505
|
__name: "ToastItem",
|
|
1492
1506
|
props: {
|
|
1493
1507
|
toast: {},
|
|
@@ -1498,111 +1512,168 @@ const Jn = 0.22, pe = "power2.out", Zn = (e) => {
|
|
|
1498
1512
|
expanded: { type: Boolean, default: !1 },
|
|
1499
1513
|
expandedOffset: { default: 0 },
|
|
1500
1514
|
stackDirection: { default: "up" },
|
|
1501
|
-
reposition: { type: Boolean, default: !1 }
|
|
1515
|
+
reposition: { type: Boolean, default: !1 },
|
|
1516
|
+
interactive: { type: Boolean, default: !0 }
|
|
1502
1517
|
},
|
|
1503
|
-
setup(e) {
|
|
1504
|
-
|
|
1505
|
-
const
|
|
1506
|
-
let
|
|
1507
|
-
const
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1518
|
+
setup(e, { expose: t }) {
|
|
1519
|
+
tn();
|
|
1520
|
+
const n = e, o = R(null), s = R(!1), i = R("");
|
|
1521
|
+
let r = !1;
|
|
1522
|
+
const a = z(() => new Date(n.toast.createdAt).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" })), c = z(() => n.swipeToDismiss !== !1), l = () => {
|
|
1523
|
+
var N, H;
|
|
1524
|
+
if (r || !o.value) return;
|
|
1525
|
+
const p = n.toast.id, P = n.toast.isLeaving;
|
|
1526
|
+
r = !0, n.toast.isLeaving = !0, P || (H = (N = n.toast).onDismiss) == null || H.call(N, p), g !== null && window.clearTimeout(g), g = window.setTimeout(() => {
|
|
1527
|
+
v.remove(p), g = null;
|
|
1528
|
+
}, 320), Ro(o.value);
|
|
1529
|
+
}, d = async (p) => {
|
|
1530
|
+
if (p)
|
|
1512
1531
|
try {
|
|
1513
|
-
await
|
|
1532
|
+
await p.onClick(), p.successLabel && (s.value = !0, i.value = p.successLabel, setTimeout(l, 1200));
|
|
1514
1533
|
} catch {
|
|
1515
1534
|
}
|
|
1516
|
-
},
|
|
1517
|
-
!
|
|
1518
|
-
index:
|
|
1519
|
-
expanded:
|
|
1520
|
-
preset:
|
|
1521
|
-
bounce:
|
|
1522
|
-
spring:
|
|
1523
|
-
direction:
|
|
1524
|
-
expandedOffset:
|
|
1525
|
-
reposition:
|
|
1535
|
+
}, w = z(() => n.toast.action ? Array.isArray(n.toast.action) ? n.toast.action : [n.toast.action] : []), x = (p = !1, P) => {
|
|
1536
|
+
!o.value || n.toast.isLeaving || h || Ho(o.value, {
|
|
1537
|
+
index: n.index,
|
|
1538
|
+
expanded: n.expanded,
|
|
1539
|
+
preset: n.toast.preset,
|
|
1540
|
+
bounce: n.toast.bounce,
|
|
1541
|
+
spring: n.toast.spring,
|
|
1542
|
+
direction: n.stackDirection,
|
|
1543
|
+
expandedOffset: P ?? n.expandedOffset,
|
|
1544
|
+
reposition: p
|
|
1526
1545
|
});
|
|
1527
1546
|
};
|
|
1528
|
-
let
|
|
1529
|
-
const
|
|
1530
|
-
|
|
1531
|
-
},
|
|
1532
|
-
if (!
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
},
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
+
let S = 0, y = 0, I = 0, h = !1, F = !1, D = 0, b = null, T = null, q = null, g = null;
|
|
1548
|
+
const B = () => {
|
|
1549
|
+
q !== null && (window.clearTimeout(q), q = null);
|
|
1550
|
+
}, X = () => {
|
|
1551
|
+
if (!(b === null || !T))
|
|
1552
|
+
try {
|
|
1553
|
+
T.hasPointerCapture(b) && T.releasePointerCapture(b);
|
|
1554
|
+
} catch {
|
|
1555
|
+
}
|
|
1556
|
+
}, J = () => {
|
|
1557
|
+
window.removeEventListener("pointermove", Ce), window.removeEventListener("pointerup", ge), window.removeEventListener("pointercancel", Z);
|
|
1558
|
+
}, L = () => {
|
|
1559
|
+
h = !1, F = !1, B(), X(), J(), b = null, T = null;
|
|
1560
|
+
}, ae = () => {
|
|
1561
|
+
o.value && (O.set(o.value, { rotate: 0 }), No(o.value), v.resume(n.toast.id));
|
|
1562
|
+
}, he = () => {
|
|
1563
|
+
if (!o.value) return;
|
|
1564
|
+
const p = D, P = Math.max(1, Date.now() - I), N = Math.abs(p) / P * 1e3, H = o.value.offsetWidth, te = H * 0.35;
|
|
1565
|
+
if (L(), Math.abs(p) >= te || N >= 500) {
|
|
1566
|
+
r = !0;
|
|
1567
|
+
const ne = n.toast.id;
|
|
1568
|
+
n.toast.isLeaving = !0, g !== null && window.clearTimeout(g), g = window.setTimeout(() => {
|
|
1569
|
+
v.remove(ne), g = null;
|
|
1570
|
+
}, 320);
|
|
1571
|
+
const ve = p > 0 ? H * 1.6 : -H * 1.6;
|
|
1572
|
+
$o(o.value, ve);
|
|
1547
1573
|
} else
|
|
1548
|
-
|
|
1549
|
-
},
|
|
1550
|
-
|
|
1574
|
+
ae();
|
|
1575
|
+
}, me = (p) => {
|
|
1576
|
+
if (!(!c.value || r || h || p.pointerType === "mouse" && p.button !== 0 || p.target.closest("button, a"))) {
|
|
1577
|
+
S = p.clientX, y = p.clientY, I = Date.now(), h = !0, F = !1, D = 0, b = p.pointerId, T = p.currentTarget, O.killTweensOf(o.value);
|
|
1578
|
+
try {
|
|
1579
|
+
T.setPointerCapture(p.pointerId);
|
|
1580
|
+
} catch {
|
|
1581
|
+
}
|
|
1582
|
+
window.addEventListener("pointermove", Ce), window.addEventListener("pointerup", ge), window.addEventListener("pointercancel", Z), v.pause(n.toast.id);
|
|
1583
|
+
}
|
|
1584
|
+
}, Ce = (p) => {
|
|
1585
|
+
if (!h || !o.value || b !== null && p.pointerId !== b) return;
|
|
1586
|
+
B();
|
|
1587
|
+
const P = p.clientX - S, N = p.clientY - y;
|
|
1588
|
+
if (!F) {
|
|
1589
|
+
if (Math.abs(N) > Math.abs(P) + 4) {
|
|
1590
|
+
L(), ae();
|
|
1591
|
+
return;
|
|
1592
|
+
}
|
|
1593
|
+
if (Math.abs(P) > Math.abs(N) + 4)
|
|
1594
|
+
F = !0;
|
|
1595
|
+
else
|
|
1596
|
+
return;
|
|
1597
|
+
}
|
|
1598
|
+
p.preventDefault(), D = P;
|
|
1599
|
+
const H = o.value.offsetWidth, te = Math.max(0, 1 - Math.abs(P) / (H * 0.7)), ne = P / H * 6;
|
|
1600
|
+
O.set(o.value, { x: P, opacity: te, rotate: ne, overwrite: "auto" });
|
|
1601
|
+
}, ge = (p) => {
|
|
1602
|
+
!h || !o.value || b !== null && p.pointerId !== b || he();
|
|
1603
|
+
}, Z = (p) => {
|
|
1604
|
+
!h || !o.value || p && b !== null && p.pointerId !== b || (L(), ae());
|
|
1605
|
+
}, ee = (p) => {
|
|
1606
|
+
!h || !o.value || b !== null && p.pointerId !== b || (T = null, B(), q = window.setTimeout(() => {
|
|
1607
|
+
h && he();
|
|
1608
|
+
}, 300));
|
|
1609
|
+
}, le = () => {
|
|
1610
|
+
document.hidden && h && (L(), ae());
|
|
1551
1611
|
};
|
|
1552
|
-
return
|
|
1553
|
-
if (!
|
|
1554
|
-
const
|
|
1555
|
-
|
|
1556
|
-
preset:
|
|
1557
|
-
bounce:
|
|
1558
|
-
spring:
|
|
1559
|
-
direction:
|
|
1612
|
+
return qe(() => {
|
|
1613
|
+
if (document.addEventListener("visibilitychange", le), !o.value) return;
|
|
1614
|
+
const p = n.toast.position.includes("bottom");
|
|
1615
|
+
jo(o.value, {
|
|
1616
|
+
preset: n.toast.preset,
|
|
1617
|
+
bounce: n.toast.bounce,
|
|
1618
|
+
spring: n.toast.spring,
|
|
1619
|
+
direction: p ? "up" : "down"
|
|
1560
1620
|
}).eventCallback("onComplete", () => {
|
|
1561
|
-
|
|
1621
|
+
Ie(x);
|
|
1562
1622
|
});
|
|
1563
|
-
}),
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
() =>
|
|
1571
|
-
|
|
1572
|
-
|
|
1623
|
+
}), G(
|
|
1624
|
+
() => n.index,
|
|
1625
|
+
(p, P) => {
|
|
1626
|
+
n.expanded || x(p < P || n.reposition);
|
|
1627
|
+
}
|
|
1628
|
+
), G(
|
|
1629
|
+
() => n.expandedOffset,
|
|
1630
|
+
(p, P) => {
|
|
1631
|
+
n.expanded && x(p !== P);
|
|
1632
|
+
}
|
|
1633
|
+
), G(
|
|
1634
|
+
() => n.expanded,
|
|
1635
|
+
(p) => {
|
|
1636
|
+
p || x(!0);
|
|
1573
1637
|
}
|
|
1574
|
-
),
|
|
1575
|
-
() =>
|
|
1576
|
-
(
|
|
1577
|
-
|
|
1638
|
+
), G(
|
|
1639
|
+
() => n.expanded,
|
|
1640
|
+
(p) => {
|
|
1641
|
+
p ? v.pause(n.toast.id) : v.resume(n.toast.id);
|
|
1578
1642
|
}
|
|
1579
|
-
),
|
|
1580
|
-
|
|
1581
|
-
|
|
1643
|
+
), G(
|
|
1644
|
+
() => n.toast.isLeaving,
|
|
1645
|
+
(p) => {
|
|
1646
|
+
p && l();
|
|
1647
|
+
}
|
|
1648
|
+
), t({ applyStackPosition: x }), Ve(() => {
|
|
1649
|
+
document.removeEventListener("visibilitychange", le), h && (L(), v.resume(n.toast.id)), g !== null && (window.clearTimeout(g), g = null), o.value && Yo(o.value);
|
|
1650
|
+
}), (p, P) => (E(), $("div", {
|
|
1582
1651
|
ref_key: "toastRef",
|
|
1583
|
-
ref:
|
|
1584
|
-
class:
|
|
1652
|
+
ref: o,
|
|
1653
|
+
class: Fe(["soft-toast-item", { "soft-toast-item--swipeable": c.value }]),
|
|
1585
1654
|
"data-type": e.toast.type,
|
|
1586
1655
|
"data-st-index": e.index,
|
|
1656
|
+
"data-toast-id": e.toast.id,
|
|
1587
1657
|
"data-leaving": e.toast.isLeaving,
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1658
|
+
"data-interactive": e.interactive,
|
|
1659
|
+
style: De({ zIndex: 1e3 - e.index }),
|
|
1660
|
+
onPointerdown: me,
|
|
1661
|
+
onPointercancel: Z,
|
|
1662
|
+
onLostpointercapture: ee
|
|
1593
1663
|
}, [
|
|
1594
|
-
|
|
1664
|
+
ie(p.$slots, "close-button", {
|
|
1595
1665
|
toast: e.toast,
|
|
1596
|
-
dismiss:
|
|
1666
|
+
dismiss: l,
|
|
1667
|
+
closeButton: e.closeButton
|
|
1597
1668
|
}, () => [
|
|
1598
|
-
e.closeButton ? (
|
|
1669
|
+
e.closeButton ? (E(), $("button", {
|
|
1599
1670
|
key: 0,
|
|
1600
1671
|
class: "soft-toast-close",
|
|
1601
1672
|
"data-position": typeof e.closeButton == "string" ? e.closeButton : "top-right",
|
|
1602
|
-
onClick:
|
|
1673
|
+
onClick: $e(l, ["stop"]),
|
|
1603
1674
|
"aria-label": "Close"
|
|
1604
|
-
}, [...
|
|
1605
|
-
|
|
1675
|
+
}, [...P[0] || (P[0] = [
|
|
1676
|
+
Q(
|
|
1606
1677
|
"svg",
|
|
1607
1678
|
{
|
|
1608
1679
|
width: "10",
|
|
@@ -1612,14 +1683,14 @@ const Jn = 0.22, pe = "power2.out", Zn = (e) => {
|
|
|
1612
1683
|
class: "st-close-icon"
|
|
1613
1684
|
},
|
|
1614
1685
|
[
|
|
1615
|
-
|
|
1686
|
+
Q("path", {
|
|
1616
1687
|
class: "st-close-line-1",
|
|
1617
1688
|
d: "M1 1L9 9",
|
|
1618
1689
|
stroke: "currentColor",
|
|
1619
1690
|
"stroke-width": "1.6",
|
|
1620
1691
|
"stroke-linecap": "round"
|
|
1621
1692
|
}),
|
|
1622
|
-
|
|
1693
|
+
Q("path", {
|
|
1623
1694
|
class: "st-close-line-2",
|
|
1624
1695
|
d: "M9 1L1 9",
|
|
1625
1696
|
stroke: "currentColor",
|
|
@@ -1630,51 +1701,62 @@ const Jn = 0.22, pe = "power2.out", Zn = (e) => {
|
|
|
1630
1701
|
-1
|
|
1631
1702
|
/* CACHED */
|
|
1632
1703
|
)
|
|
1633
|
-
])], 8,
|
|
1704
|
+
])], 8, Xo)) : _("v-if", !0)
|
|
1634
1705
|
]),
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
e.toast
|
|
1638
|
-
|
|
1706
|
+
Q("div", Wo, [
|
|
1707
|
+
ie(p.$slots, "icon", {
|
|
1708
|
+
toast: e.toast,
|
|
1709
|
+
closeButton: e.closeButton
|
|
1710
|
+
}, () => [
|
|
1711
|
+
e.toast.type === "promise" ? (E(), $("div", Go, [
|
|
1712
|
+
ot($t(en), {
|
|
1639
1713
|
class: "soft-toast-icon-svg",
|
|
1640
1714
|
icon: "lucide:loader-circle",
|
|
1641
1715
|
width: 18,
|
|
1642
1716
|
height: 18
|
|
1643
1717
|
})
|
|
1644
|
-
])) : e.toast.icon && typeof e.toast.icon == "string" ? (
|
|
1718
|
+
])) : e.toast.icon && typeof e.toast.icon == "string" ? (E(), K(Mt, {
|
|
1645
1719
|
key: 1,
|
|
1646
1720
|
type: e.toast.type,
|
|
1647
1721
|
customIcon: e.toast.icon
|
|
1648
|
-
}, null, 8, ["type", "customIcon"])) : e.toast.icon ? (
|
|
1649
|
-
(
|
|
1650
|
-
])) : e.toast.type !== "default" ? (
|
|
1722
|
+
}, null, 8, ["type", "customIcon"])) : e.toast.icon ? (E(), $("div", Ko, [
|
|
1723
|
+
(E(), K(mt(e.toast.icon)))
|
|
1724
|
+
])) : e.toast.type !== "default" ? (E(), K(Mt, {
|
|
1651
1725
|
key: 3,
|
|
1652
1726
|
type: e.toast.type
|
|
1653
|
-
}, null, 8, ["type"])) :
|
|
1727
|
+
}, null, 8, ["type"])) : _("v-if", !0)
|
|
1654
1728
|
]),
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1729
|
+
Q("div", Jo, [
|
|
1730
|
+
Q("div", Zo, [
|
|
1731
|
+
ie(p.$slots, "title", {
|
|
1732
|
+
toast: e.toast,
|
|
1733
|
+
closeButton: e.closeButton
|
|
1734
|
+
}, () => [
|
|
1735
|
+
Q(
|
|
1659
1736
|
"p",
|
|
1660
1737
|
{
|
|
1661
|
-
class:
|
|
1738
|
+
class: Fe(["soft-toast-title", {
|
|
1739
|
+
"soft-toast-title--has-close": e.closeButton === !0 || e.closeButton === "top-right"
|
|
1740
|
+
}])
|
|
1662
1741
|
},
|
|
1663
|
-
|
|
1742
|
+
we(e.toast.title),
|
|
1664
1743
|
3
|
|
1665
1744
|
/* TEXT, CLASS */
|
|
1666
1745
|
)
|
|
1667
1746
|
])
|
|
1668
1747
|
]),
|
|
1669
|
-
e.toast.description || e.toast.action ? (
|
|
1670
|
-
|
|
1671
|
-
e.toast
|
|
1672
|
-
|
|
1673
|
-
|
|
1748
|
+
e.toast.description || e.toast.action ? (E(), $("div", _o, [
|
|
1749
|
+
ie(p.$slots, "description", {
|
|
1750
|
+
toast: e.toast,
|
|
1751
|
+
closeButton: e.closeButton
|
|
1752
|
+
}, () => [
|
|
1753
|
+
e.toast.description ? (E(), $("p", es, [
|
|
1754
|
+
typeof e.toast.description == "object" ? (E(), K(mt(e.toast.description), { key: 0 })) : (E(), $(
|
|
1755
|
+
Se,
|
|
1674
1756
|
{ key: 1 },
|
|
1675
1757
|
[
|
|
1676
|
-
|
|
1677
|
-
|
|
1758
|
+
un(
|
|
1759
|
+
we(e.toast.description),
|
|
1678
1760
|
1
|
|
1679
1761
|
/* TEXT */
|
|
1680
1762
|
)
|
|
@@ -1682,55 +1764,59 @@ const Jn = 0.22, pe = "power2.out", Zn = (e) => {
|
|
|
1682
1764
|
64
|
|
1683
1765
|
/* STABLE_FRAGMENT */
|
|
1684
1766
|
))
|
|
1685
|
-
])) :
|
|
1767
|
+
])) : _("v-if", !0)
|
|
1686
1768
|
]),
|
|
1687
|
-
|
|
1769
|
+
ie(p.$slots, "action", {
|
|
1688
1770
|
toast: e.toast,
|
|
1689
|
-
execute:
|
|
1690
|
-
hasSucceeded:
|
|
1771
|
+
execute: d,
|
|
1772
|
+
hasSucceeded: s.value,
|
|
1773
|
+
closeButton: e.closeButton
|
|
1691
1774
|
}, () => [
|
|
1692
|
-
|
|
1693
|
-
(
|
|
1694
|
-
|
|
1775
|
+
w.value.length > 0 && !s.value ? (E(), $("div", ts, [
|
|
1776
|
+
(E(!0), $(
|
|
1777
|
+
Se,
|
|
1695
1778
|
null,
|
|
1696
|
-
|
|
1697
|
-
key:
|
|
1698
|
-
class:
|
|
1699
|
-
|
|
1700
|
-
|
|
1779
|
+
Ee(w.value, (N, H) => (E(), $("button", {
|
|
1780
|
+
key: H,
|
|
1781
|
+
class: Fe(["soft-toast-action-button", [
|
|
1782
|
+
N.class || "",
|
|
1783
|
+
N.primary ? "soft-toast-action-primary" : ""
|
|
1784
|
+
]]),
|
|
1785
|
+
onClick: $e(() => d(N), ["stop"])
|
|
1786
|
+
}, we(N.label), 11, ns))),
|
|
1701
1787
|
128
|
|
1702
1788
|
/* KEYED_FRAGMENT */
|
|
1703
1789
|
))
|
|
1704
|
-
])) :
|
|
1705
|
-
|
|
1790
|
+
])) : s.value ? (E(), $("div", os, [
|
|
1791
|
+
Q(
|
|
1706
1792
|
"span",
|
|
1707
|
-
|
|
1708
|
-
|
|
1793
|
+
ss,
|
|
1794
|
+
we(i.value),
|
|
1709
1795
|
1
|
|
1710
1796
|
/* TEXT */
|
|
1711
1797
|
)
|
|
1712
|
-
])) :
|
|
1798
|
+
])) : _("v-if", !0)
|
|
1713
1799
|
])
|
|
1714
|
-
])) :
|
|
1715
|
-
|
|
1716
|
-
e.toast.showTimestamp ? (
|
|
1800
|
+
])) : _("v-if", !0),
|
|
1801
|
+
_(" Timestamp lives below all content — never overlaps close button "),
|
|
1802
|
+
e.toast.showTimestamp ? (E(), $(
|
|
1717
1803
|
"span",
|
|
1718
|
-
|
|
1719
|
-
|
|
1804
|
+
is,
|
|
1805
|
+
we(a.value),
|
|
1720
1806
|
1
|
|
1721
1807
|
/* TEXT */
|
|
1722
|
-
)) :
|
|
1808
|
+
)) : _("v-if", !0)
|
|
1723
1809
|
])
|
|
1724
1810
|
]),
|
|
1725
|
-
e.toast.showProgress && e.toast.duration > 0 && e.toast.duration !== 1 / 0 ? (
|
|
1811
|
+
e.toast.showProgress && e.toast.duration > 0 && e.toast.duration !== 1 / 0 ? (E(), K(Qo, {
|
|
1726
1812
|
key: 0,
|
|
1727
1813
|
"remaining-time": e.toast.remainingTime,
|
|
1728
1814
|
"total-duration": e.toast.duration,
|
|
1729
1815
|
"is-paused": e.toast.isPaused
|
|
1730
|
-
}, null, 8, ["remaining-time", "total-duration", "is-paused"])) :
|
|
1731
|
-
], 46,
|
|
1816
|
+
}, null, 8, ["remaining-time", "total-duration", "is-paused"])) : _("v-if", !0)
|
|
1817
|
+
], 46, Uo));
|
|
1732
1818
|
}
|
|
1733
|
-
}),
|
|
1819
|
+
}), rs = ["data-position", "data-soft-toast-theme", "data-soft-toast-dir", "data-expanded"], as = ["data-direction"], ls = 15, cs = /* @__PURE__ */ pe({
|
|
1734
1820
|
__name: "ToastRegion",
|
|
1735
1821
|
props: {
|
|
1736
1822
|
position: { default: "top-right" },
|
|
@@ -1751,137 +1837,301 @@ const Jn = 0.22, pe = "power2.out", Zn = (e) => {
|
|
|
1751
1837
|
maxQueue: { default: 1 / 0 },
|
|
1752
1838
|
queueOverflow: { default: "drop-oldest" },
|
|
1753
1839
|
dir: { default: "ltr" },
|
|
1754
|
-
swipeToDismiss: { type: Boolean, default: !0 }
|
|
1840
|
+
swipeToDismiss: { type: Boolean, default: !0 },
|
|
1841
|
+
slotFilter: {}
|
|
1755
1842
|
},
|
|
1756
1843
|
setup(e) {
|
|
1757
|
-
const t = e, n =
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1844
|
+
const t = e, n = R(null), o = R(null), s = R(null), i = R(
|
|
1845
|
+
/* @__PURE__ */ new Map()
|
|
1846
|
+
), r = (u, f) => {
|
|
1847
|
+
f ? i.value.set(u, f) : i.value.delete(u);
|
|
1848
|
+
}, a = z(() => v.getToastsByPosition(t.position).value), c = (u) => {
|
|
1849
|
+
if (u.key === "Escape" && t.closeOnEscape) {
|
|
1850
|
+
const f = a.value;
|
|
1851
|
+
f.length > 0 && v.dismiss(f[0].id);
|
|
1761
1852
|
}
|
|
1762
|
-
},
|
|
1763
|
-
const
|
|
1764
|
-
document.hidden ?
|
|
1853
|
+
}, l = () => {
|
|
1854
|
+
const u = a.value;
|
|
1855
|
+
document.hidden ? u.forEach((f) => v.pause(f.id)) : u.forEach((f) => v.resume(f.id));
|
|
1765
1856
|
};
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1857
|
+
qe(() => {
|
|
1858
|
+
var u;
|
|
1859
|
+
t.closeOnEscape && document.addEventListener("keydown", c), document.addEventListener("visibilitychange", l), document.addEventListener("touchstart", ft, { passive: !0 }), (u = o.value) == null || u.addEventListener("touchmove", dt, {
|
|
1860
|
+
passive: !1
|
|
1861
|
+
}), typeof ResizeObserver < "u" && (Z = new ResizeObserver(() => g()), ee = new ResizeObserver(() => g()), s.value && Z.observe(s.value)), Ie(() => g());
|
|
1862
|
+
}), Ve(() => {
|
|
1863
|
+
var u;
|
|
1864
|
+
t.closeOnEscape && document.removeEventListener("keydown", c), document.removeEventListener("visibilitychange", l), document.removeEventListener("touchstart", ft), (u = o.value) == null || u.removeEventListener("touchmove", dt), Z && Z.disconnect(), ee && ee.disconnect(), h(), le = /* @__PURE__ */ new WeakSet();
|
|
1865
|
+
}), G(
|
|
1866
|
+
() => a.value.map((u) => `${u.id}:${u.isLeaving}`).join(","),
|
|
1772
1867
|
() => {
|
|
1773
|
-
|
|
1868
|
+
Ie(g);
|
|
1774
1869
|
}
|
|
1775
|
-
),
|
|
1776
|
-
() =>
|
|
1777
|
-
(
|
|
1778
|
-
if (
|
|
1779
|
-
const
|
|
1780
|
-
|
|
1870
|
+
), G(
|
|
1871
|
+
() => v.toasts.value.length,
|
|
1872
|
+
(u, f) => {
|
|
1873
|
+
if (u > f) {
|
|
1874
|
+
const m = v.toasts.value[0];
|
|
1875
|
+
m && (m.duration || (m.duration = t.duration), m.preset || (m.preset = t.preset), m.bounce === void 0 && (m.bounce = t.bounce), m.spring === void 0 && (m.spring = t.spring), m.showProgress === void 0 && (m.showProgress = t.showProgress), m.showTimestamp === void 0 && (m.showTimestamp = t.showTimestamp));
|
|
1781
1876
|
}
|
|
1782
1877
|
}
|
|
1783
1878
|
);
|
|
1784
|
-
const
|
|
1785
|
-
() =>
|
|
1786
|
-
),
|
|
1879
|
+
const d = z(() => `soft-toast-container--${t.position}`), w = z(() => t.position.endsWith("-center")), x = z(
|
|
1880
|
+
() => a.value.filter((u) => !u.isLeaving)
|
|
1881
|
+
), S = (u, f) => u.isLeaving ? f : x.value.findIndex((m) => m.id === u.id), y = R(!1);
|
|
1882
|
+
let I = null;
|
|
1883
|
+
const h = () => {
|
|
1884
|
+
I !== null && (window.clearTimeout(I), I = null);
|
|
1885
|
+
}, F = z(() => {
|
|
1886
|
+
const u = a.value, f = u.slice(0, ls), m = u.filter((C) => C.isLeaving), M = new Set(f.map((C) => C.id));
|
|
1887
|
+
return [...f, ...m.filter((C) => !M.has(C.id))];
|
|
1888
|
+
}), D = R({}), b = R(0), T = R(0);
|
|
1889
|
+
let q = null;
|
|
1890
|
+
const g = () => {
|
|
1891
|
+
q === null && (q = requestAnimationFrame(() => {
|
|
1892
|
+
q = null, X(!1);
|
|
1893
|
+
}));
|
|
1894
|
+
}, B = (u, f, m) => {
|
|
1895
|
+
if (b.value !== f || T.value !== m) return !0;
|
|
1896
|
+
const M = D.value, C = Object.keys(M), j = Object.keys(u);
|
|
1897
|
+
return C.length !== j.length ? !0 : j.some((V) => M[V] !== u[V]);
|
|
1898
|
+
}, X = (u = !1) => {
|
|
1787
1899
|
if (!s.value) return;
|
|
1788
|
-
const
|
|
1900
|
+
const f = Array.from(
|
|
1789
1901
|
s.value.querySelectorAll(".soft-toast-item")
|
|
1790
|
-
)
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1902
|
+
);
|
|
1903
|
+
p(f);
|
|
1904
|
+
const m = t.gap ?? 10, M = [];
|
|
1905
|
+
let C = 0, j = 0;
|
|
1906
|
+
for (let Y = 0; Y < f.length; Y++)
|
|
1907
|
+
if (M.push(C), f[Y].getAttribute("data-leaving") !== "true") {
|
|
1908
|
+
C += f[Y].offsetHeight + m;
|
|
1909
|
+
const Oe = f[Y].dataset.toastId, Ue = a.value.find((ht) => ht.id === Oe);
|
|
1910
|
+
Ue && S(Ue, a.value.indexOf(Ue)) === 0 && (j = f[Y].offsetHeight);
|
|
1797
1911
|
}
|
|
1798
|
-
|
|
1799
|
-
|
|
1912
|
+
const V = {};
|
|
1913
|
+
for (let Y = 0; Y < f.length; Y++) {
|
|
1914
|
+
const Oe = f[Y].dataset.toastId;
|
|
1915
|
+
Oe && (V[Oe] = M[Y]);
|
|
1916
|
+
}
|
|
1917
|
+
const ce = Math.max(0, C - m), Le = B(V, j, ce);
|
|
1918
|
+
if (Le && (D.value = V, b.value = j, T.value = ce), y.value && s.value && Le && me(0), s.value && Le) {
|
|
1919
|
+
const Y = y.value ? T.value : b.value;
|
|
1920
|
+
O.set(s.value, { height: Y });
|
|
1921
|
+
}
|
|
1922
|
+
y.value && (Le || u) && J();
|
|
1923
|
+
}, J = () => {
|
|
1924
|
+
F.value.forEach((u) => {
|
|
1925
|
+
const f = i.value.get(u.id);
|
|
1926
|
+
f && f.applyStackPosition(!1, D.value[u.id] ?? 0);
|
|
1927
|
+
});
|
|
1928
|
+
}, L = R(0), ae = () => {
|
|
1929
|
+
const f = Math.max(
|
|
1930
|
+
0,
|
|
1931
|
+
T.value - window.innerHeight + 120
|
|
1932
|
+
);
|
|
1933
|
+
return Ae.value === "up" ? { min: 0, max: f } : { min: -f, max: 0 };
|
|
1934
|
+
}, he = (u, f = !0, m = 0.18, M = "power2.out") => {
|
|
1800
1935
|
if (!s.value) return;
|
|
1801
|
-
const
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1936
|
+
const { min: C, max: j } = ae();
|
|
1937
|
+
if (L.value = Math.max(C, Math.min(u, j)), !f) {
|
|
1938
|
+
O.set(s.value, {
|
|
1939
|
+
y: L.value,
|
|
1940
|
+
force3D: !0,
|
|
1941
|
+
overwrite: !0
|
|
1942
|
+
});
|
|
1943
|
+
return;
|
|
1944
|
+
}
|
|
1945
|
+
O.to(s.value, {
|
|
1946
|
+
y: L.value,
|
|
1947
|
+
duration: m,
|
|
1948
|
+
ease: M,
|
|
1806
1949
|
overwrite: "auto"
|
|
1807
1950
|
});
|
|
1808
|
-
},
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1951
|
+
}, me = (u, f = !0) => {
|
|
1952
|
+
he(L.value - u, f);
|
|
1953
|
+
}, Ce = (u) => {
|
|
1954
|
+
if (!y.value) return;
|
|
1955
|
+
let f = u.target, m = !1;
|
|
1956
|
+
for (; f && f !== o.value; ) {
|
|
1957
|
+
const j = window.getComputedStyle(f).overflowY;
|
|
1958
|
+
if ((j === "auto" || j === "scroll") && f.scrollHeight > f.clientHeight) {
|
|
1959
|
+
const V = Math.ceil(f.scrollTop + f.clientHeight) < f.scrollHeight, ce = f.scrollTop > 0;
|
|
1960
|
+
if (u.deltaY > 0 && V || u.deltaY < 0 && ce) {
|
|
1961
|
+
m = !0;
|
|
1817
1962
|
break;
|
|
1818
1963
|
}
|
|
1819
1964
|
}
|
|
1820
|
-
|
|
1965
|
+
f = f.parentElement;
|
|
1821
1966
|
}
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1967
|
+
m || Math.max(
|
|
1968
|
+
0,
|
|
1969
|
+
T.value - window.innerHeight + 120
|
|
1970
|
+
) <= 0 || (u.preventDefault(), me(u.deltaY));
|
|
1971
|
+
}, ge = (u) => {
|
|
1972
|
+
if (!s.value) return;
|
|
1973
|
+
const f = u ? T.value : b.value;
|
|
1974
|
+
O.to(s.value, {
|
|
1975
|
+
height: f,
|
|
1976
|
+
duration: u ? 0.14 : 0.16,
|
|
1977
|
+
ease: u ? "power3.out" : "power2.out",
|
|
1978
|
+
overwrite: "auto"
|
|
1979
|
+
});
|
|
1980
|
+
};
|
|
1981
|
+
let Z = null, ee = null, le = /* @__PURE__ */ new WeakSet();
|
|
1982
|
+
const p = (u) => {
|
|
1983
|
+
if (ee)
|
|
1984
|
+
for (const f of u)
|
|
1985
|
+
le.has(f) || (le.add(f), ee.observe(f));
|
|
1986
|
+
}, P = () => {
|
|
1987
|
+
h(), !y.value && (y.value = !0, Ie(() => {
|
|
1988
|
+
X(!0), ge(!0);
|
|
1989
|
+
}));
|
|
1990
|
+
}, N = () => {
|
|
1991
|
+
h(), I = window.setTimeout(() => {
|
|
1992
|
+
I = null, y.value = !1, ge(!1), L.value = 0, s.value && O.to(s.value, {
|
|
1993
|
+
y: 0,
|
|
1994
|
+
duration: 0.2,
|
|
1995
|
+
ease: "power2.out",
|
|
1996
|
+
overwrite: "auto"
|
|
1997
|
+
});
|
|
1998
|
+
}, 80);
|
|
1999
|
+
};
|
|
2000
|
+
let H = 0, te = 0, ne = 0, ve = 0, ye = 0, Qe = !1;
|
|
2001
|
+
const sn = (u) => {
|
|
2002
|
+
H = u.touches[0].clientX, te = u.touches[0].clientY, ne = u.touches[0].clientY, ve = performance.now(), ye = 0, Qe = !1, s.value && O.killTweensOf(s.value);
|
|
2003
|
+
}, rn = (u) => {
|
|
2004
|
+
var M, C;
|
|
2005
|
+
if (a.value.length <= 1) return;
|
|
2006
|
+
const f = Math.abs((((M = u.changedTouches[0]) == null ? void 0 : M.clientX) ?? H) - H), m = Math.abs((((C = u.changedTouches[0]) == null ? void 0 : C.clientY) ?? te) - te);
|
|
2007
|
+
if (f > 8 || m > 8) {
|
|
2008
|
+
if (y.value && Qe && Math.abs(ye) > 0.08) {
|
|
2009
|
+
const j = Math.max(
|
|
2010
|
+
-460,
|
|
2011
|
+
Math.min(ye * 560, 460)
|
|
2012
|
+
), V = Math.max(
|
|
2013
|
+
0.32,
|
|
2014
|
+
Math.min(Math.abs(j) / 780, 0.62)
|
|
2015
|
+
);
|
|
2016
|
+
he(
|
|
2017
|
+
L.value + j,
|
|
2018
|
+
!0,
|
|
2019
|
+
V,
|
|
2020
|
+
"power3.out"
|
|
2021
|
+
);
|
|
2022
|
+
}
|
|
2023
|
+
return;
|
|
2024
|
+
}
|
|
2025
|
+
y.value ? N() : (u.preventDefault(), P());
|
|
2026
|
+
}, ft = (u) => {
|
|
2027
|
+
y.value && n.value && !n.value.contains(u.target) && N();
|
|
2028
|
+
}, dt = (u) => {
|
|
2029
|
+
if (!y.value) return;
|
|
2030
|
+
u.preventDefault();
|
|
2031
|
+
const f = u.touches[0].clientY, m = ne - f, M = performance.now(), C = Math.max(1, M - ve);
|
|
2032
|
+
if (ne = f, ve = M, Math.max(
|
|
2033
|
+
0,
|
|
2034
|
+
T.value - window.innerHeight + 120
|
|
2035
|
+
) <= 0) return;
|
|
2036
|
+
const V = L.value;
|
|
2037
|
+
me(m, !1);
|
|
2038
|
+
const ce = (L.value - V) / C;
|
|
2039
|
+
ye = ye * 0.35 + ce * 0.65, Qe = !0;
|
|
2040
|
+
}, Ae = z(
|
|
1830
2041
|
() => t.position.includes("bottom") ? "up" : "down"
|
|
1831
|
-
)
|
|
1832
|
-
|
|
1833
|
-
|
|
2042
|
+
), an = z(() => ({
|
|
2043
|
+
width: w.value ? "100%" : void 0
|
|
2044
|
+
})), ln = (u) => {
|
|
2045
|
+
var f;
|
|
2046
|
+
return ((f = t.slotFilter) == null ? void 0 : f.call(t, u)) ?? !0;
|
|
2047
|
+
}, pt = z(() => t.swipeToDismiss !== !1);
|
|
2048
|
+
return (u, f) => (E(), K(Nt, { to: "body" }, [
|
|
2049
|
+
fn(Q("div", {
|
|
1834
2050
|
ref_key: "containerRef",
|
|
1835
2051
|
ref: n,
|
|
1836
|
-
class:
|
|
2052
|
+
class: Fe(["soft-toast-container", d.value]),
|
|
1837
2053
|
"data-position": e.position,
|
|
1838
2054
|
"data-soft-toast-theme": e.theme,
|
|
1839
2055
|
"data-soft-toast-dir": e.dir,
|
|
1840
|
-
"data-expanded":
|
|
2056
|
+
"data-expanded": y.value
|
|
1841
2057
|
}, [
|
|
1842
|
-
|
|
2058
|
+
Q("div", {
|
|
1843
2059
|
ref_key: "stackRef",
|
|
1844
2060
|
ref: o,
|
|
1845
2061
|
class: "soft-toast-stack",
|
|
1846
|
-
"data-direction":
|
|
1847
|
-
onMouseenter:
|
|
1848
|
-
onMouseleave:
|
|
1849
|
-
|
|
2062
|
+
"data-direction": Ae.value,
|
|
2063
|
+
onMouseenter: P,
|
|
2064
|
+
onMouseleave: N,
|
|
2065
|
+
onTouchstart: $e(sn, ["stop"]),
|
|
2066
|
+
onTouchend: $e(rn, ["stop"]),
|
|
2067
|
+
onWheel: Ce,
|
|
1850
2068
|
"data-lenis-prevent": "true"
|
|
1851
2069
|
}, [
|
|
1852
|
-
|
|
2070
|
+
Q(
|
|
1853
2071
|
"div",
|
|
1854
2072
|
{
|
|
1855
2073
|
ref_key: "listRef",
|
|
1856
2074
|
ref: s,
|
|
1857
2075
|
class: "soft-toast-list",
|
|
1858
|
-
style:
|
|
2076
|
+
style: De(an.value)
|
|
1859
2077
|
},
|
|
1860
2078
|
[
|
|
1861
|
-
(
|
|
1862
|
-
|
|
2079
|
+
(E(!0), $(
|
|
2080
|
+
Se,
|
|
1863
2081
|
null,
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
2082
|
+
Ee(F.value, (m, M) => (E(), $(
|
|
2083
|
+
Se,
|
|
2084
|
+
{
|
|
2085
|
+
key: m.id
|
|
2086
|
+
},
|
|
2087
|
+
[
|
|
2088
|
+
ln(m) ? (E(), K(Bt, {
|
|
2089
|
+
key: 0,
|
|
2090
|
+
ref_for: !0,
|
|
2091
|
+
ref: (C) => r(m.id, C),
|
|
2092
|
+
toast: m,
|
|
2093
|
+
index: S(m, M),
|
|
2094
|
+
total: x.value.length,
|
|
2095
|
+
expanded: y.value,
|
|
2096
|
+
"expanded-offset": D.value[m.id] ?? 0,
|
|
2097
|
+
"stack-direction": Ae.value,
|
|
2098
|
+
interactive: y.value || S(m, M) === 0,
|
|
2099
|
+
"close-button": m.closeButton ?? e.closeButton,
|
|
2100
|
+
"swipe-to-dismiss": pt.value,
|
|
2101
|
+
style: De(
|
|
2102
|
+
w.value ? { left: "50%", marginLeft: "-50%" } : void 0
|
|
2103
|
+
)
|
|
2104
|
+
}, Ht({
|
|
2105
|
+
_: 2
|
|
2106
|
+
/* DYNAMIC */
|
|
2107
|
+
}, [
|
|
2108
|
+
Ee(u.$slots, (C, j) => ({
|
|
2109
|
+
name: j,
|
|
2110
|
+
fn: qt((V) => [
|
|
2111
|
+
ie(u.$slots, j, Ke({ ref_for: !0 }, V || {}), void 0, !0)
|
|
2112
|
+
])
|
|
2113
|
+
}))
|
|
2114
|
+
]), 1032, ["toast", "index", "total", "expanded", "expanded-offset", "stack-direction", "interactive", "close-button", "swipe-to-dismiss", "style"])) : (E(), K(Bt, {
|
|
2115
|
+
key: 1,
|
|
2116
|
+
ref_for: !0,
|
|
2117
|
+
ref: (C) => r(m.id, C),
|
|
2118
|
+
toast: m,
|
|
2119
|
+
index: S(m, M),
|
|
2120
|
+
total: x.value.length,
|
|
2121
|
+
expanded: y.value,
|
|
2122
|
+
"expanded-offset": D.value[m.id] ?? 0,
|
|
2123
|
+
"stack-direction": Ae.value,
|
|
2124
|
+
interactive: y.value || S(m, M) === 0,
|
|
2125
|
+
"close-button": m.closeButton ?? e.closeButton,
|
|
2126
|
+
"swipe-to-dismiss": pt.value,
|
|
2127
|
+
style: De(
|
|
2128
|
+
w.value ? { left: "50%", marginLeft: "-50%" } : void 0
|
|
2129
|
+
)
|
|
2130
|
+
}, null, 8, ["toast", "index", "total", "expanded", "expanded-offset", "stack-direction", "interactive", "close-button", "swipe-to-dismiss", "style"]))
|
|
2131
|
+
],
|
|
2132
|
+
64
|
|
2133
|
+
/* STABLE_FRAGMENT */
|
|
2134
|
+
))),
|
|
1885
2135
|
128
|
|
1886
2136
|
/* KEYED_FRAGMENT */
|
|
1887
2137
|
))
|
|
@@ -1889,18 +2139,18 @@ const Jn = 0.22, pe = "power2.out", Zn = (e) => {
|
|
|
1889
2139
|
4
|
|
1890
2140
|
/* STYLE */
|
|
1891
2141
|
)
|
|
1892
|
-
], 40,
|
|
1893
|
-
], 10,
|
|
1894
|
-
[
|
|
2142
|
+
], 40, as)
|
|
2143
|
+
], 10, rs), [
|
|
2144
|
+
[dn, a.value.length > 0]
|
|
1895
2145
|
])
|
|
1896
2146
|
]));
|
|
1897
2147
|
}
|
|
1898
|
-
}),
|
|
2148
|
+
}), us = (e, t) => {
|
|
1899
2149
|
const n = e.__vccOpts || e;
|
|
1900
2150
|
for (const [o, s] of t)
|
|
1901
2151
|
n[o] = s;
|
|
1902
2152
|
return n;
|
|
1903
|
-
},
|
|
2153
|
+
}, fs = /* @__PURE__ */ us(cs, [["__scopeId", "data-v-ee86226d"]]), jt = /* @__PURE__ */ pe({
|
|
1904
2154
|
__name: "ToastContainer",
|
|
1905
2155
|
props: {
|
|
1906
2156
|
position: { default: "top-right" },
|
|
@@ -1921,7 +2171,8 @@ const Jn = 0.22, pe = "power2.out", Zn = (e) => {
|
|
|
1921
2171
|
maxQueue: { default: 10 },
|
|
1922
2172
|
queueOverflow: { default: "drop-oldest" },
|
|
1923
2173
|
dir: {},
|
|
1924
|
-
swipeToDismiss: { type: Boolean }
|
|
2174
|
+
swipeToDismiss: { type: Boolean, default: !0 },
|
|
2175
|
+
slotFilter: {}
|
|
1925
2176
|
},
|
|
1926
2177
|
setup(e) {
|
|
1927
2178
|
const t = e, n = [
|
|
@@ -1929,7 +2180,6 @@ const Jn = 0.22, pe = "power2.out", Zn = (e) => {
|
|
|
1929
2180
|
"bottom",
|
|
1930
2181
|
"left",
|
|
1931
2182
|
"right",
|
|
1932
|
-
"center",
|
|
1933
2183
|
"top-left",
|
|
1934
2184
|
"top-center",
|
|
1935
2185
|
"top-right",
|
|
@@ -1937,18 +2187,18 @@ const Jn = 0.22, pe = "power2.out", Zn = (e) => {
|
|
|
1937
2187
|
"bottom-center",
|
|
1938
2188
|
"bottom-right"
|
|
1939
2189
|
];
|
|
1940
|
-
return (o, s) => (
|
|
1941
|
-
(
|
|
1942
|
-
|
|
2190
|
+
return (o, s) => (E(), K(Nt, { to: "body" }, [
|
|
2191
|
+
(E(), $(
|
|
2192
|
+
Se,
|
|
1943
2193
|
null,
|
|
1944
|
-
|
|
2194
|
+
Ee(n, (i) => ot(fs, Ke({ key: i }, { ref_for: !0 }, t, { position: i }), Ht({
|
|
1945
2195
|
_: 2
|
|
1946
2196
|
/* DYNAMIC */
|
|
1947
2197
|
}, [
|
|
1948
|
-
|
|
2198
|
+
Ee(o.$slots, (r, a) => ({
|
|
1949
2199
|
name: a,
|
|
1950
|
-
fn:
|
|
1951
|
-
|
|
2200
|
+
fn: qt((c) => [
|
|
2201
|
+
ie(o.$slots, a, Ke({ ref_for: !0 }, c || {}))
|
|
1952
2202
|
])
|
|
1953
2203
|
}))
|
|
1954
2204
|
]), 1040, ["position"])),
|
|
@@ -1958,7 +2208,7 @@ const Jn = 0.22, pe = "power2.out", Zn = (e) => {
|
|
|
1958
2208
|
]));
|
|
1959
2209
|
}
|
|
1960
2210
|
});
|
|
1961
|
-
let
|
|
2211
|
+
let A = {
|
|
1962
2212
|
position: "top-right",
|
|
1963
2213
|
duration: 4e3,
|
|
1964
2214
|
theme: "light",
|
|
@@ -1973,82 +2223,85 @@ let E = {
|
|
|
1973
2223
|
queueOverflow: "drop-oldest",
|
|
1974
2224
|
dir: "ltr",
|
|
1975
2225
|
swipeToDismiss: !0,
|
|
1976
|
-
teleportTarget: "body"
|
|
1977
|
-
|
|
1978
|
-
|
|
2226
|
+
teleportTarget: "body",
|
|
2227
|
+
autoMount: !0
|
|
2228
|
+
}, Rt = !1;
|
|
2229
|
+
const hs = {
|
|
1979
2230
|
install(e, t = {}) {
|
|
1980
|
-
if (
|
|
2231
|
+
if (A = { ...A, ...t }, e.component("SoftToastContainer", jt), A.autoMount !== !1 && !Rt && typeof window < "u") {
|
|
1981
2232
|
const n = "soft-toast-global-container";
|
|
1982
2233
|
let o = document.getElementById(n);
|
|
1983
|
-
o || (o = document.createElement("div"), o.id = n, document.body.appendChild(o)),
|
|
1984
|
-
render: () =>
|
|
1985
|
-
position:
|
|
1986
|
-
duration:
|
|
1987
|
-
gap:
|
|
1988
|
-
offset:
|
|
1989
|
-
theme:
|
|
1990
|
-
spring:
|
|
1991
|
-
bounce:
|
|
1992
|
-
preset:
|
|
1993
|
-
closeOnEscape:
|
|
1994
|
-
closeButton:
|
|
1995
|
-
showProgress:
|
|
1996
|
-
maxQueue:
|
|
1997
|
-
queueOverflow:
|
|
1998
|
-
dir:
|
|
1999
|
-
swipeToDismiss:
|
|
2234
|
+
o || (o = document.createElement("div"), o.id = n, document.body.appendChild(o)), pn({
|
|
2235
|
+
render: () => Ge(jt, {
|
|
2236
|
+
position: A.position,
|
|
2237
|
+
duration: A.duration,
|
|
2238
|
+
gap: A.gap,
|
|
2239
|
+
offset: A.offset,
|
|
2240
|
+
theme: A.theme,
|
|
2241
|
+
spring: A.spring,
|
|
2242
|
+
bounce: A.bounce,
|
|
2243
|
+
preset: A.preset,
|
|
2244
|
+
closeOnEscape: A.closeOnEscape,
|
|
2245
|
+
closeButton: A.closeButton,
|
|
2246
|
+
showProgress: A.showProgress,
|
|
2247
|
+
maxQueue: A.maxQueue,
|
|
2248
|
+
queueOverflow: A.queueOverflow,
|
|
2249
|
+
dir: A.dir,
|
|
2250
|
+
swipeToDismiss: A.swipeToDismiss,
|
|
2251
|
+
showTimestamp: A.showTimestamp,
|
|
2252
|
+
slotFilter: A.slotFilter
|
|
2000
2253
|
})
|
|
2001
|
-
}).mount(o),
|
|
2254
|
+
}).mount(o), Rt = !0;
|
|
2002
2255
|
}
|
|
2003
|
-
e.provide("softToastOptions",
|
|
2256
|
+
e.provide("softToastOptions", A), typeof document < "u" && (document.body.setAttribute("data-soft-toast-theme", A.theme || "light"), document.body.setAttribute("data-soft-toast-dir", A.dir || "ltr"));
|
|
2004
2257
|
}
|
|
2005
|
-
},
|
|
2258
|
+
}, ms = () => A, nn = "@soft-toast/vue:flash", at = () => {
|
|
2006
2259
|
if (typeof sessionStorage > "u") return [];
|
|
2007
2260
|
try {
|
|
2008
|
-
return JSON.parse(sessionStorage.getItem(
|
|
2261
|
+
return JSON.parse(sessionStorage.getItem(nn) || "[]");
|
|
2009
2262
|
} catch {
|
|
2010
2263
|
return [];
|
|
2011
2264
|
}
|
|
2012
|
-
},
|
|
2265
|
+
}, on = (e) => {
|
|
2013
2266
|
if (!(typeof sessionStorage > "u"))
|
|
2014
2267
|
try {
|
|
2015
|
-
sessionStorage.setItem(
|
|
2268
|
+
sessionStorage.setItem(nn, JSON.stringify(e));
|
|
2016
2269
|
} catch {
|
|
2017
2270
|
}
|
|
2018
|
-
},
|
|
2019
|
-
const n =
|
|
2271
|
+
}, lt = (e, t = {}) => {
|
|
2272
|
+
const n = at().filter(
|
|
2020
2273
|
(o) => Date.now() - o.queuedAt < 3e4
|
|
2021
2274
|
// discard stale flashes
|
|
2022
2275
|
);
|
|
2023
|
-
n.push({ title: e, options: t, queuedAt: Date.now() }),
|
|
2024
|
-
},
|
|
2025
|
-
const e =
|
|
2276
|
+
n.push({ title: e, options: t, queuedAt: Date.now() }), on(n);
|
|
2277
|
+
}, ct = () => {
|
|
2278
|
+
const e = at().filter(
|
|
2026
2279
|
(t) => Date.now() - t.queuedAt < 3e4
|
|
2027
2280
|
);
|
|
2028
|
-
return
|
|
2029
|
-
|
|
2281
|
+
return on([]), e.forEach((t) => {
|
|
2282
|
+
v.add({ title: t.title, type: "default", ...t.options });
|
|
2030
2283
|
}), e.length;
|
|
2031
|
-
},
|
|
2284
|
+
}, ut = () => at().some((e) => Date.now() - e.queuedAt < 3e4), gs = () => ({
|
|
2032
2285
|
/** Queue a toast that will appear on the next page/route */
|
|
2033
|
-
flash:
|
|
2286
|
+
flash: lt,
|
|
2034
2287
|
/** Show all pending flashes now — call in onMounted */
|
|
2035
|
-
showPendingFlashes:
|
|
2288
|
+
showPendingFlashes: ct,
|
|
2036
2289
|
/** True if there are flashes waiting to be shown */
|
|
2037
|
-
hasPending:
|
|
2038
|
-
}),
|
|
2039
|
-
default: (e, t) =>
|
|
2040
|
-
success: (e, t) =>
|
|
2041
|
-
error: (e, t) =>
|
|
2042
|
-
warning: (e, t) =>
|
|
2043
|
-
info: (e, t) =>
|
|
2044
|
-
loading: (e, t) =>
|
|
2045
|
-
promise: (e, t, n) =>
|
|
2046
|
-
custom: (e) =>
|
|
2047
|
-
update: (e, t) =>
|
|
2048
|
-
dismiss: (e) =>
|
|
2049
|
-
dismissAll: () =>
|
|
2050
|
-
pause: (e) =>
|
|
2051
|
-
resume: (e) =>
|
|
2290
|
+
hasPending: ut
|
|
2291
|
+
}), vs = () => ({
|
|
2292
|
+
default: (e, t) => v.add({ ...t, type: "default", title: e }),
|
|
2293
|
+
success: (e, t) => v.add({ ...t, type: "success", title: e }),
|
|
2294
|
+
error: (e, t) => v.add({ ...t, type: "error", title: e }),
|
|
2295
|
+
warning: (e, t) => v.add({ ...t, type: "warning", title: e }),
|
|
2296
|
+
info: (e, t) => v.add({ ...t, type: "info", title: e }),
|
|
2297
|
+
loading: (e, t) => v.loading(e, t),
|
|
2298
|
+
promise: (e, t, n) => v.promise(e, t, n),
|
|
2299
|
+
custom: (e) => v.add(e),
|
|
2300
|
+
update: (e, t) => v.update(e, t),
|
|
2301
|
+
dismiss: (e) => v.dismiss(e),
|
|
2302
|
+
dismissAll: () => v.dismiss(),
|
|
2303
|
+
pause: (e) => v.pause(e),
|
|
2304
|
+
resume: (e) => v.resume(e),
|
|
2052
2305
|
/**
|
|
2053
2306
|
* Queue a toast that will be shown on the next page load / route navigation.
|
|
2054
2307
|
* Perfect for the "submit → redirect → show success" pattern.
|
|
@@ -2059,42 +2312,42 @@ const Do = {
|
|
|
2059
2312
|
* flash('Saved!', { type: 'success' })
|
|
2060
2313
|
* router.push('/dashboard')
|
|
2061
2314
|
*/
|
|
2062
|
-
flash: (e, t = {}) =>
|
|
2315
|
+
flash: (e, t = {}) => lt(e, t),
|
|
2063
2316
|
/**
|
|
2064
2317
|
* Show any toasts that were queued with flash() before a page navigation.
|
|
2065
2318
|
* Call this in onMounted() of your root layout or App.vue.
|
|
2066
2319
|
*/
|
|
2067
|
-
showFlashes: () =>
|
|
2320
|
+
showFlashes: () => ct(),
|
|
2068
2321
|
/** Check if there are pending flash messages without consuming them. */
|
|
2069
|
-
hasFlashes: () =>
|
|
2070
|
-
}),
|
|
2071
|
-
default: (e, t) =>
|
|
2072
|
-
success: (e, t) =>
|
|
2073
|
-
error: (e, t) =>
|
|
2074
|
-
warning: (e, t) =>
|
|
2075
|
-
info: (e, t) =>
|
|
2076
|
-
loading: (e, t) =>
|
|
2077
|
-
promise: (e, t, n) =>
|
|
2078
|
-
custom: (e) =>
|
|
2079
|
-
update: (e, t) =>
|
|
2080
|
-
dismiss: (e) =>
|
|
2081
|
-
dismissAll: () =>
|
|
2082
|
-
pause: (e) =>
|
|
2083
|
-
resume: (e) =>
|
|
2084
|
-
flash: (e, t = {}) =>
|
|
2085
|
-
showFlashes: () =>
|
|
2086
|
-
hasFlashes: () =>
|
|
2322
|
+
hasFlashes: () => ut()
|
|
2323
|
+
}), ys = {
|
|
2324
|
+
default: (e, t) => v.add({ ...t, type: "default", title: e }),
|
|
2325
|
+
success: (e, t) => v.add({ ...t, type: "success", title: e }),
|
|
2326
|
+
error: (e, t) => v.add({ ...t, type: "error", title: e }),
|
|
2327
|
+
warning: (e, t) => v.add({ ...t, type: "warning", title: e }),
|
|
2328
|
+
info: (e, t) => v.add({ ...t, type: "info", title: e }),
|
|
2329
|
+
loading: (e, t) => v.loading(e, t),
|
|
2330
|
+
promise: (e, t, n) => v.promise(e, t, n),
|
|
2331
|
+
custom: (e) => v.add(e),
|
|
2332
|
+
update: (e, t) => v.update(e, t),
|
|
2333
|
+
dismiss: (e) => v.dismiss(e),
|
|
2334
|
+
dismissAll: () => v.dismiss(),
|
|
2335
|
+
pause: (e) => v.pause(e),
|
|
2336
|
+
resume: (e) => v.resume(e),
|
|
2337
|
+
flash: (e, t = {}) => lt(e, t),
|
|
2338
|
+
showFlashes: () => ct(),
|
|
2339
|
+
hasFlashes: () => ut()
|
|
2087
2340
|
};
|
|
2088
2341
|
export {
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2342
|
+
hs as SoftToastPlugin,
|
|
2343
|
+
jt as ToastContainer,
|
|
2344
|
+
Bt as ToastItem,
|
|
2345
|
+
ct as consumeFlashes,
|
|
2346
|
+
ms as getToastOptions,
|
|
2347
|
+
ut as hasPendingFlashes,
|
|
2348
|
+
lt as queueFlash,
|
|
2349
|
+
ys as toast,
|
|
2350
|
+
v as toastStore,
|
|
2351
|
+
gs as useFlash,
|
|
2352
|
+
vs as useToast
|
|
2100
2353
|
};
|