@jasonshimmy/custom-elements-runtime 0.2.7 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/custom-elements-runtime.cjs.js +13 -13
- package/dist/custom-elements-runtime.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.es.js +1292 -821
- package/dist/custom-elements-runtime.es.js.map +1 -1
- package/dist/custom-elements-runtime.umd.js +13 -13
- package/dist/custom-elements-runtime.umd.js.map +1 -1
- package/dist/directive-enhancements.d.ts +138 -0
- package/dist/directives.d.ts +5 -0
- package/dist/index.d.ts +1 -0
- package/dist/runtime/logger.d.ts +16 -0
- package/dist/runtime/scheduler.d.ts +27 -0
- package/dist/runtime/template-compiler.d.ts +5 -3
- package/dist/runtime/vdom.d.ts +3 -10
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
function
|
|
2
|
-
return
|
|
1
|
+
function we(e, t) {
|
|
2
|
+
return O(e ? t : [], "when-block");
|
|
3
3
|
}
|
|
4
|
-
function
|
|
4
|
+
function Ot(e, t) {
|
|
5
5
|
return e.map((r, i) => {
|
|
6
6
|
const n = typeof r == "object" ? r?.key ?? r?.id ?? `idx-${i}` : String(r);
|
|
7
|
-
return
|
|
7
|
+
return O(t(r, i), `each-${n}`);
|
|
8
8
|
});
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function Ke() {
|
|
11
11
|
const e = [];
|
|
12
12
|
return {
|
|
13
13
|
when(t, r) {
|
|
@@ -17,18 +17,18 @@ function Pe() {
|
|
|
17
17
|
return e.push([!0, t]), this;
|
|
18
18
|
},
|
|
19
19
|
done() {
|
|
20
|
-
return
|
|
20
|
+
return Je(...e);
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function Je(...e) {
|
|
25
25
|
for (let t = 0; t < e.length; t++) {
|
|
26
26
|
const [r, i] = e[t];
|
|
27
|
-
if (r) return [
|
|
27
|
+
if (r) return [O(i, `whenChain-branch-${t}`)];
|
|
28
28
|
}
|
|
29
|
-
return [
|
|
29
|
+
return [O([], "whenChain-empty")];
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function O(e, t) {
|
|
32
32
|
const r = e ? Array.isArray(e) ? e.filter(Boolean) : [e].filter(Boolean) : [];
|
|
33
33
|
return {
|
|
34
34
|
tag: "#anchor",
|
|
@@ -36,7 +36,131 @@ function fe(e, t) {
|
|
|
36
36
|
children: r
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
function Pt(e, t) {
|
|
40
|
+
return we(!e, t);
|
|
41
|
+
}
|
|
42
|
+
function Mt(e, t) {
|
|
43
|
+
const r = !e || e.length === 0;
|
|
44
|
+
return we(r, t);
|
|
45
|
+
}
|
|
46
|
+
function Bt(e, t) {
|
|
47
|
+
const r = !!(e && e.length > 0);
|
|
48
|
+
return we(r, t);
|
|
49
|
+
}
|
|
50
|
+
function Wt(e, t, r) {
|
|
51
|
+
const i = [];
|
|
52
|
+
return e.forEach((n, s) => {
|
|
53
|
+
t(n, s) && i.push({ item: n, originalIndex: s });
|
|
54
|
+
}), i.map(({ item: n, originalIndex: s }, o) => {
|
|
55
|
+
const a = typeof n == "object" && n != null ? n?.key ?? n?.id ?? `filtered-${s}` : `filtered-${s}`;
|
|
56
|
+
return O(r(n, s, o), `each-where-${a}`);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function It(e, t) {
|
|
60
|
+
const r = e?.length ?? 0;
|
|
61
|
+
return r === 0 && t.empty ? O(t.empty, "switch-length-empty") : r === 1 && t.one ? O(t.one(e[0]), "switch-length-one") : t.exactly?.[r] ? O(t.exactly[r](e), `switch-length-${r}`) : r > 1 && t.many ? O(t.many(e), "switch-length-many") : O([], "switch-length-fallback");
|
|
62
|
+
}
|
|
63
|
+
function qt(e, t, r) {
|
|
64
|
+
const i = /* @__PURE__ */ new Map();
|
|
65
|
+
return e.forEach((n) => {
|
|
66
|
+
const s = t(n);
|
|
67
|
+
i.has(s) || i.set(s, []), i.get(s).push(n);
|
|
68
|
+
}), Array.from(i.entries()).map(([n, s], o) => O(
|
|
69
|
+
r(n, s, o),
|
|
70
|
+
`each-group-${n}`
|
|
71
|
+
));
|
|
72
|
+
}
|
|
73
|
+
function zt(e, t, r, i) {
|
|
74
|
+
const n = r * t, s = Math.min(n + t, e.length);
|
|
75
|
+
return e.slice(n, s).map((a, c) => {
|
|
76
|
+
const u = n + c, m = typeof a == "object" && a != null ? a?.key ?? a?.id ?? `page-${u}` : `page-${u}`;
|
|
77
|
+
return O(i(a, u, c), `each-page-${m}`);
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
function Ht(e, t) {
|
|
81
|
+
return e.loading && t.loading ? O(t.loading, "promise-loading") : e.error && t.error ? O(t.error(e.error), "promise-error") : e.data !== void 0 && t.success ? O(t.success(e.data), "promise-success") : t.idle ? O(t.idle, "promise-idle") : O([], "promise-fallback");
|
|
82
|
+
}
|
|
83
|
+
function q(e, t) {
|
|
84
|
+
const r = typeof window < "u" && window.matchMedia?.(e)?.matches;
|
|
85
|
+
return we(!!r, t);
|
|
86
|
+
}
|
|
87
|
+
const G = {
|
|
88
|
+
// Responsive breakpoints (matching style.ts)
|
|
89
|
+
sm: "(min-width:640px)",
|
|
90
|
+
md: "(min-width:768px)",
|
|
91
|
+
lg: "(min-width:1024px)",
|
|
92
|
+
xl: "(min-width:1280px)",
|
|
93
|
+
"2xl": "(min-width:1536px)",
|
|
94
|
+
// Dark mode (matching style.ts)
|
|
95
|
+
dark: "(prefers-color-scheme: dark)"
|
|
96
|
+
}, ze = ["sm", "md", "lg", "xl", "2xl"], Ve = {
|
|
97
|
+
// Breakpoint-based rendering (matching style.ts exactly)
|
|
98
|
+
sm: (e) => q(G.sm, e),
|
|
99
|
+
md: (e) => q(G.md, e),
|
|
100
|
+
lg: (e) => q(G.lg, e),
|
|
101
|
+
xl: (e) => q(G.xl, e),
|
|
102
|
+
"2xl": (e) => q(G["2xl"], e),
|
|
103
|
+
// Dark mode (matching style.ts)
|
|
104
|
+
dark: (e) => q(G.dark, e),
|
|
105
|
+
light: (e) => q("(prefers-color-scheme: light)", e),
|
|
106
|
+
// Accessibility and interaction preferences
|
|
107
|
+
touch: (e) => q("(hover: none) and (pointer: coarse)", e),
|
|
108
|
+
mouse: (e) => q("(hover: hover) and (pointer: fine)", e),
|
|
109
|
+
reducedMotion: (e) => q("(prefers-reduced-motion: reduce)", e),
|
|
110
|
+
highContrast: (e) => q("(prefers-contrast: high)", e),
|
|
111
|
+
// Orientation
|
|
112
|
+
portrait: (e) => q("(orientation: portrait)", e),
|
|
113
|
+
landscape: (e) => q("(orientation: landscape)", e)
|
|
114
|
+
};
|
|
115
|
+
function Nt(e, t) {
|
|
116
|
+
const r = [];
|
|
117
|
+
e.includes("dark") ? r.push(G.dark) : e.includes("light") && r.push("(prefers-color-scheme: light)");
|
|
118
|
+
const i = e.filter(
|
|
119
|
+
(o) => ze.includes(o)
|
|
120
|
+
), n = i[i.length - 1];
|
|
121
|
+
n && n in G && r.push(G[n]);
|
|
122
|
+
const s = r.length > 0 ? r.join(" and ") : "all";
|
|
123
|
+
return q(s, t);
|
|
124
|
+
}
|
|
125
|
+
function Dt(e) {
|
|
126
|
+
const t = [];
|
|
127
|
+
return e.base && t.push(O(e.base, "responsive-base")), ze.forEach((r) => {
|
|
128
|
+
const i = e[r];
|
|
129
|
+
i && t.push(Ve[r](i));
|
|
130
|
+
}), t;
|
|
131
|
+
}
|
|
132
|
+
function Ut(e) {
|
|
133
|
+
const t = [];
|
|
134
|
+
let r = null;
|
|
135
|
+
return {
|
|
136
|
+
case(i, n) {
|
|
137
|
+
const s = typeof i == "function" ? i : (o) => o === i;
|
|
138
|
+
return t.push({ condition: s, content: n }), this;
|
|
139
|
+
},
|
|
140
|
+
when(i, n) {
|
|
141
|
+
return t.push({ condition: i, content: n }), this;
|
|
142
|
+
},
|
|
143
|
+
otherwise(i) {
|
|
144
|
+
return r = i, this;
|
|
145
|
+
},
|
|
146
|
+
done() {
|
|
147
|
+
for (let i = 0; i < t.length; i++) {
|
|
148
|
+
const { condition: n, content: s } = t[i];
|
|
149
|
+
if (n(e))
|
|
150
|
+
return O(s, `switch-case-${i}`);
|
|
151
|
+
}
|
|
152
|
+
return O(r || [], "switch-otherwise");
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
const He = typeof process < "u" && process.env?.NODE_ENV !== "production";
|
|
157
|
+
function Y(e, ...t) {
|
|
158
|
+
He && console.error(e, ...t);
|
|
159
|
+
}
|
|
160
|
+
function pe(e, ...t) {
|
|
161
|
+
He && console.warn(e, ...t);
|
|
162
|
+
}
|
|
163
|
+
class ne extends EventTarget {
|
|
40
164
|
handlers = {};
|
|
41
165
|
static instance;
|
|
42
166
|
eventCounters = /* @__PURE__ */ new Map();
|
|
@@ -44,7 +168,7 @@ class G extends EventTarget {
|
|
|
44
168
|
* Returns the singleton instance of GlobalEventBus
|
|
45
169
|
*/
|
|
46
170
|
static getInstance() {
|
|
47
|
-
return
|
|
171
|
+
return ne.instance || (ne.instance = new ne()), ne.instance;
|
|
48
172
|
}
|
|
49
173
|
/**
|
|
50
174
|
* Emit a global event with optional data. Includes event storm protection.
|
|
@@ -68,7 +192,7 @@ class G extends EventTarget {
|
|
|
68
192
|
try {
|
|
69
193
|
o(r);
|
|
70
194
|
} catch (a) {
|
|
71
|
-
|
|
195
|
+
Y(`Error in global event handler for "${t}":`, a);
|
|
72
196
|
}
|
|
73
197
|
});
|
|
74
198
|
}
|
|
@@ -157,8 +281,8 @@ class G extends EventTarget {
|
|
|
157
281
|
this.eventCounters.clear();
|
|
158
282
|
}
|
|
159
283
|
}
|
|
160
|
-
const
|
|
161
|
-
function
|
|
284
|
+
const le = ne.getInstance(), Ft = (e, t) => le.emit(e, t), Kt = (e, t) => le.on(e, t), Jt = (e, t) => le.off(e, t), Vt = (e, t) => le.once(e, t), Gt = (e, t, r) => le.listen(e, t, r);
|
|
285
|
+
function Le(e) {
|
|
162
286
|
let t = { ...e };
|
|
163
287
|
const r = [];
|
|
164
288
|
function i(a) {
|
|
@@ -168,18 +292,18 @@ function $e(e) {
|
|
|
168
292
|
return t;
|
|
169
293
|
}
|
|
170
294
|
function s(a) {
|
|
171
|
-
const
|
|
172
|
-
t = { ...t, ...
|
|
295
|
+
const c = typeof a == "function" ? a(t) : a;
|
|
296
|
+
t = { ...t, ...c }, o();
|
|
173
297
|
}
|
|
174
298
|
function o() {
|
|
175
299
|
r.forEach((a) => a(t));
|
|
176
300
|
}
|
|
177
301
|
return { subscribe: i, getState: n, setState: s };
|
|
178
302
|
}
|
|
179
|
-
function
|
|
303
|
+
function Q(e) {
|
|
180
304
|
return e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
181
305
|
}
|
|
182
|
-
function
|
|
306
|
+
function Z(e) {
|
|
183
307
|
return typeof e == "string" ? e.replace(
|
|
184
308
|
/[&<>"']/g,
|
|
185
309
|
(t) => ({
|
|
@@ -191,57 +315,57 @@ function H(e) {
|
|
|
191
315
|
})[t]
|
|
192
316
|
) : e;
|
|
193
317
|
}
|
|
194
|
-
function
|
|
318
|
+
function K(e, t) {
|
|
195
319
|
return typeof t == "string" ? t.split(".").reduce((r, i) => r?.[i], e) : t;
|
|
196
320
|
}
|
|
197
|
-
function
|
|
321
|
+
function he(e, t, r) {
|
|
198
322
|
const i = String(t).split("."), n = i.pop();
|
|
199
323
|
if (!n) return;
|
|
200
324
|
const s = i.reduce((o, a) => (o[a] == null && (o[a] = {}), o[a]), e);
|
|
201
325
|
s[n] = r;
|
|
202
326
|
}
|
|
203
|
-
function
|
|
327
|
+
function Ge(e, t, r) {
|
|
204
328
|
if (r)
|
|
205
329
|
for (const [i, n] of Object.entries(r)) {
|
|
206
330
|
let s, o = {};
|
|
207
331
|
if (Array.isArray(n) ? (s = n[0], o = n[1] || {}) : s = n, t.set(i, {
|
|
208
332
|
callback: s,
|
|
209
333
|
options: o,
|
|
210
|
-
oldValue:
|
|
334
|
+
oldValue: K(e, i)
|
|
211
335
|
}), o.immediate)
|
|
212
336
|
try {
|
|
213
|
-
const a =
|
|
337
|
+
const a = K(e, i);
|
|
214
338
|
s(a, void 0, e);
|
|
215
339
|
} catch (a) {
|
|
216
|
-
|
|
340
|
+
Y(`Error in immediate watcher for "${i}":`, a);
|
|
217
341
|
}
|
|
218
342
|
}
|
|
219
343
|
}
|
|
220
|
-
function
|
|
344
|
+
function Ze(e, t, r, i) {
|
|
221
345
|
const n = (o, a) => {
|
|
222
346
|
if (o === a) return !0;
|
|
223
347
|
if (typeof o != typeof a || typeof o != "object" || o === null || a === null) return !1;
|
|
224
348
|
if (Array.isArray(o) && Array.isArray(a))
|
|
225
|
-
return o.length !== a.length ? !1 : o.every((
|
|
226
|
-
const
|
|
227
|
-
return
|
|
349
|
+
return o.length !== a.length ? !1 : o.every((m, T) => n(m, a[T]));
|
|
350
|
+
const c = Object.keys(o), u = Object.keys(a);
|
|
351
|
+
return c.length !== u.length ? !1 : c.every((m) => n(o[m], a[m]));
|
|
228
352
|
}, s = t.get(r);
|
|
229
353
|
if (s && !n(i, s.oldValue))
|
|
230
354
|
try {
|
|
231
355
|
s.callback(i, s.oldValue, e), s.oldValue = i;
|
|
232
356
|
} catch (o) {
|
|
233
|
-
|
|
357
|
+
Y(`Error in watcher for "${r}":`, o);
|
|
234
358
|
}
|
|
235
359
|
for (const [o, a] of t.entries())
|
|
236
360
|
if (a.options.deep && r.startsWith(o + "."))
|
|
237
361
|
try {
|
|
238
|
-
const
|
|
239
|
-
n(
|
|
240
|
-
} catch (
|
|
241
|
-
|
|
362
|
+
const c = K(e, o);
|
|
363
|
+
n(c, a.oldValue) || (a.callback(c, a.oldValue, e), a.oldValue = c);
|
|
364
|
+
} catch (c) {
|
|
365
|
+
Y(`Error in deep watcher for "${o}":`, c);
|
|
242
366
|
}
|
|
243
367
|
}
|
|
244
|
-
function
|
|
368
|
+
function Ye(e, t, r) {
|
|
245
369
|
if (!t.props) return;
|
|
246
370
|
function i(n, s) {
|
|
247
371
|
return s === Boolean ? n === "true" : s === Number ? Number(n) : n;
|
|
@@ -250,170 +374,270 @@ function We(e, t, r) {
|
|
|
250
374
|
if (s.type === Function && typeof e[n] == "function")
|
|
251
375
|
r[n] = e[n];
|
|
252
376
|
else {
|
|
253
|
-
const o = e.getAttribute(
|
|
254
|
-
|
|
377
|
+
const o = Q(n), a = e.getAttribute(o);
|
|
378
|
+
if (typeof e[n] < "u")
|
|
379
|
+
try {
|
|
380
|
+
const c = e[n];
|
|
381
|
+
s.type === Boolean && typeof c == "boolean" || s.type === Number && typeof c == "number" || s.type === Function && typeof c == "function" ? r[n] = c : r[n] = Z(i(String(c), s.type));
|
|
382
|
+
} catch {
|
|
383
|
+
r[n] = e[n];
|
|
384
|
+
}
|
|
385
|
+
else a !== null ? r[n] = Z(i(a, s.type)) : "default" in s && s.default !== void 0 && (r[n] = Z(s.default));
|
|
255
386
|
}
|
|
256
387
|
});
|
|
257
388
|
}
|
|
258
|
-
function
|
|
389
|
+
function Qe(e, t, r, i) {
|
|
259
390
|
e.onConnected && !r && (e.onConnected(t), i(!0));
|
|
260
391
|
}
|
|
261
|
-
function
|
|
262
|
-
e.onDisconnected && e.onDisconnected(t), r.forEach((
|
|
392
|
+
function Xe(e, t, r, i, n, s, o, a) {
|
|
393
|
+
e.onDisconnected && e.onDisconnected(t), r.forEach((c) => c()), i(), n(), s(!1), o(null), a(!1);
|
|
263
394
|
}
|
|
264
|
-
function
|
|
395
|
+
function et(e, t, r, i, n) {
|
|
265
396
|
e.onAttributeChanged && e.onAttributeChanged(t, r, i, n);
|
|
266
397
|
}
|
|
267
|
-
function
|
|
398
|
+
function te(e, t) {
|
|
268
399
|
if (t && e instanceof HTMLElement) {
|
|
269
400
|
for (const r in t)
|
|
270
401
|
t[r] === e && delete t[r];
|
|
271
402
|
for (const r of Array.from(e.childNodes))
|
|
272
|
-
|
|
403
|
+
te(r, t);
|
|
273
404
|
}
|
|
274
405
|
}
|
|
275
|
-
function
|
|
406
|
+
function tt(e, t, r, i, n, s, o, a) {
|
|
276
407
|
if (!s) return;
|
|
277
|
-
const
|
|
278
|
-
let
|
|
279
|
-
o instanceof HTMLInputElement ?
|
|
280
|
-
const
|
|
281
|
-
if (
|
|
282
|
-
if (Array.isArray(
|
|
283
|
-
r[
|
|
408
|
+
const c = t.includes("lazy"), u = t.includes("trim"), m = t.includes("number"), T = () => K(s._state || s, e), p = T();
|
|
409
|
+
let l = "text";
|
|
410
|
+
o instanceof HTMLInputElement ? l = i?.type || o.type || "text" : o instanceof HTMLSelectElement ? l = "select" : o instanceof HTMLTextAreaElement && (l = "textarea");
|
|
411
|
+
const w = o instanceof HTMLInputElement || o instanceof HTMLTextAreaElement || o instanceof HTMLSelectElement, d = w ? l === "checkbox" || l === "radio" ? "checked" : "value" : a ?? "modelValue";
|
|
412
|
+
if (l === "checkbox")
|
|
413
|
+
if (Array.isArray(p))
|
|
414
|
+
r[d] = p.includes(String(o?.getAttribute("value") ?? i?.value ?? ""));
|
|
284
415
|
else {
|
|
285
416
|
const x = o?.getAttribute("true-value") ?? !0;
|
|
286
|
-
r[
|
|
417
|
+
r[d] = p === x;
|
|
287
418
|
}
|
|
288
|
-
else if (
|
|
289
|
-
r[
|
|
290
|
-
else if (
|
|
419
|
+
else if (l === "radio")
|
|
420
|
+
r[d] = p === (i?.value ?? "");
|
|
421
|
+
else if (l === "select")
|
|
291
422
|
if (o && o.hasAttribute("multiple") && o instanceof HTMLSelectElement) {
|
|
292
|
-
const x = Array.isArray(
|
|
423
|
+
const x = Array.isArray(p) ? p.map(String) : [];
|
|
293
424
|
setTimeout(() => {
|
|
294
|
-
Array.from(o.options).forEach((
|
|
295
|
-
|
|
425
|
+
Array.from(o.options).forEach((f) => {
|
|
426
|
+
f.selected = x.includes(f.value);
|
|
296
427
|
});
|
|
297
|
-
}, 0), r[
|
|
428
|
+
}, 0), r[d] = Array.isArray(p) ? p : [];
|
|
298
429
|
} else
|
|
299
|
-
r[
|
|
430
|
+
r[d] = p;
|
|
300
431
|
else {
|
|
301
|
-
r[
|
|
432
|
+
r[d] = p;
|
|
302
433
|
try {
|
|
303
|
-
const x =
|
|
304
|
-
i && (i[x] =
|
|
434
|
+
const x = Q(d);
|
|
435
|
+
i && (i[x] = p);
|
|
305
436
|
} catch {
|
|
306
437
|
}
|
|
307
438
|
}
|
|
308
|
-
const
|
|
309
|
-
if (x.isComposing || n._isComposing
|
|
310
|
-
const
|
|
311
|
-
if (!
|
|
312
|
-
|
|
313
|
-
if (
|
|
314
|
-
|
|
439
|
+
const g = c || l === "checkbox" || l === "radio" || l === "select" ? "change" : "input", y = (x) => {
|
|
440
|
+
if (x.isComposing || n._isComposing) return;
|
|
441
|
+
const f = typeof globalThis.process < "u" && globalThis.process.env?.NODE_ENV === "test" || typeof window < "u" && window.__vitest__;
|
|
442
|
+
if (x.isTrusted === !1 && !f) return;
|
|
443
|
+
const b = x.target;
|
|
444
|
+
if (!b || b._modelUpdating) return;
|
|
445
|
+
let h = b.value;
|
|
446
|
+
if (l === "checkbox") {
|
|
447
|
+
const E = T();
|
|
315
448
|
if (Array.isArray(E)) {
|
|
316
|
-
const
|
|
317
|
-
if (
|
|
318
|
-
A.includes(
|
|
449
|
+
const C = b.getAttribute("value") ?? "", A = Array.from(E);
|
|
450
|
+
if (b.checked)
|
|
451
|
+
A.includes(C) || A.push(C);
|
|
319
452
|
else {
|
|
320
|
-
const
|
|
321
|
-
|
|
453
|
+
const P = A.indexOf(C);
|
|
454
|
+
P > -1 && A.splice(P, 1);
|
|
322
455
|
}
|
|
323
|
-
|
|
456
|
+
h = A;
|
|
324
457
|
} else {
|
|
325
|
-
const
|
|
326
|
-
|
|
458
|
+
const C = b.getAttribute("true-value") ?? !0, A = b.getAttribute("false-value") ?? !1;
|
|
459
|
+
h = b.checked ? C : A;
|
|
327
460
|
}
|
|
328
|
-
} else if (
|
|
329
|
-
|
|
330
|
-
else if (
|
|
331
|
-
|
|
332
|
-
else if (u && typeof
|
|
333
|
-
const E = Number(
|
|
334
|
-
isNaN(E) || (
|
|
335
|
-
}
|
|
336
|
-
const
|
|
337
|
-
if (Array.isArray(
|
|
338
|
-
|
|
461
|
+
} else if (l === "radio")
|
|
462
|
+
h = b.getAttribute("value") ?? b.value;
|
|
463
|
+
else if (l === "select" && b.multiple)
|
|
464
|
+
h = Array.from(b.selectedOptions).map((E) => E.value);
|
|
465
|
+
else if (u && typeof h == "string" && (h = h.trim()), m) {
|
|
466
|
+
const E = Number(h);
|
|
467
|
+
isNaN(E) || (h = E);
|
|
468
|
+
}
|
|
469
|
+
const _ = s._state || s, $ = K(_, e);
|
|
470
|
+
if (Array.isArray(h) && Array.isArray($) ? JSON.stringify([...h].sort()) !== JSON.stringify([...$].sort()) : h !== $) {
|
|
471
|
+
b._modelUpdating = !0;
|
|
339
472
|
try {
|
|
340
|
-
|
|
473
|
+
if (he(_, e, h), s._requestRender && s._requestRender(), s._triggerWatchers && s._triggerWatchers(e, h), b) {
|
|
474
|
+
const E = `update:${Q(d)}`, C = new CustomEvent(E, {
|
|
475
|
+
detail: h,
|
|
476
|
+
bubbles: !0,
|
|
477
|
+
composed: !0
|
|
478
|
+
});
|
|
479
|
+
b.dispatchEvent(C);
|
|
480
|
+
}
|
|
341
481
|
} finally {
|
|
342
|
-
setTimeout(() =>
|
|
482
|
+
setTimeout(() => b._modelUpdating = !1, 0);
|
|
343
483
|
}
|
|
344
484
|
}
|
|
345
485
|
};
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
486
|
+
if (w) {
|
|
487
|
+
if (n[g]) {
|
|
488
|
+
const x = n[g];
|
|
489
|
+
o && o.removeEventListener(g, x);
|
|
490
|
+
}
|
|
491
|
+
n[g] = y;
|
|
492
|
+
} else {
|
|
493
|
+
const x = `update:${Q(d)}`;
|
|
494
|
+
if (n[x]) {
|
|
495
|
+
const f = n[x];
|
|
496
|
+
o && o.removeEventListener(x, f);
|
|
497
|
+
}
|
|
498
|
+
n[x] = (f) => {
|
|
499
|
+
const b = s._state || s, h = f.detail !== void 0 ? f.detail : f.target?.value, _ = K(b, e);
|
|
500
|
+
if (Array.isArray(h) && Array.isArray(_) ? JSON.stringify([...h].sort()) !== JSON.stringify([..._].sort()) : h !== _) {
|
|
501
|
+
he(b, e, h), s._requestRender && s._requestRender(), s._triggerWatchers && s._triggerWatchers(e, h);
|
|
502
|
+
const S = f.target;
|
|
503
|
+
if (S) {
|
|
504
|
+
S[d] = h;
|
|
505
|
+
try {
|
|
506
|
+
const E = Q(d);
|
|
507
|
+
typeof h == "boolean" ? h ? S.setAttribute(E, "true") : S.setAttribute(E, "false") : S.setAttribute(E, String(h));
|
|
508
|
+
} catch {
|
|
509
|
+
}
|
|
510
|
+
queueMicrotask(() => {
|
|
511
|
+
typeof S._applyProps == "function" && S._applyProps(S._cfg), typeof S._requestRender == "function" && S._requestRender();
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
};
|
|
516
|
+
}
|
|
517
|
+
(l === "text" || l === "textarea") && (n.compositionstart = (() => n._isComposing = !0), n.compositionend = (x) => {
|
|
350
518
|
n._isComposing = !1;
|
|
351
|
-
const
|
|
352
|
-
|
|
353
|
-
const
|
|
354
|
-
let
|
|
355
|
-
if (u && (
|
|
356
|
-
const
|
|
357
|
-
isNaN(
|
|
519
|
+
const f = x.target;
|
|
520
|
+
f && setTimeout(() => {
|
|
521
|
+
const b = f.value, h = s._state || s, _ = K(h, e);
|
|
522
|
+
let $ = b;
|
|
523
|
+
if (u && ($ = $.trim()), m) {
|
|
524
|
+
const E = Number($);
|
|
525
|
+
isNaN(E) || ($ = E);
|
|
358
526
|
}
|
|
359
|
-
if (Array.isArray(
|
|
360
|
-
|
|
527
|
+
if (Array.isArray($) && Array.isArray(_) ? JSON.stringify([...$].sort()) !== JSON.stringify([..._].sort()) : $ !== _) {
|
|
528
|
+
f._modelUpdating = !0;
|
|
361
529
|
try {
|
|
362
|
-
|
|
530
|
+
he(h, e, $), s._requestRender && s._requestRender(), s._triggerWatchers && s._triggerWatchers(e, $);
|
|
363
531
|
} finally {
|
|
364
|
-
setTimeout(() =>
|
|
532
|
+
setTimeout(() => f._modelUpdating = !1, 0);
|
|
365
533
|
}
|
|
366
534
|
}
|
|
367
535
|
}, 0);
|
|
368
536
|
});
|
|
369
537
|
}
|
|
370
|
-
function
|
|
538
|
+
function Ne(e) {
|
|
371
539
|
const t = e.slice(2);
|
|
372
540
|
return t ? t.charAt(0).toLowerCase() + t.slice(1) : "";
|
|
373
541
|
}
|
|
374
|
-
function
|
|
375
|
-
if (
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
} catch {
|
|
388
|
-
const n = z(i, e);
|
|
542
|
+
function rt(e, t, r, i) {
|
|
543
|
+
if (typeof e == "object" && e !== null)
|
|
544
|
+
for (const [n, s] of Object.entries(e))
|
|
545
|
+
n.startsWith("data-") || n.startsWith("aria-") || n === "class" ? r[n] = s : t[n] = s;
|
|
546
|
+
else if (typeof e == "string") {
|
|
547
|
+
if (!i) return;
|
|
548
|
+
try {
|
|
549
|
+
const n = xe(e, i);
|
|
550
|
+
if (typeof n == "object" && n !== null) {
|
|
551
|
+
for (const [s, o] of Object.entries(n))
|
|
552
|
+
s.startsWith("data-") || s.startsWith("aria-") || s === "class" ? r[s] = o : t[s] = o;
|
|
553
|
+
return;
|
|
554
|
+
} else {
|
|
389
555
|
r[e] = n;
|
|
556
|
+
return;
|
|
390
557
|
}
|
|
558
|
+
} catch {
|
|
559
|
+
const n = K(i, e);
|
|
560
|
+
r[e] = n;
|
|
561
|
+
}
|
|
391
562
|
}
|
|
392
563
|
}
|
|
393
|
-
function
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
564
|
+
function nt(e, t, r) {
|
|
565
|
+
let i;
|
|
566
|
+
if (typeof e == "string") {
|
|
567
|
+
if (!r) return;
|
|
568
|
+
i = xe(e, r);
|
|
569
|
+
} else
|
|
570
|
+
i = e;
|
|
571
|
+
const n = t.style || "";
|
|
572
|
+
let s = n;
|
|
573
|
+
if (i) {
|
|
574
|
+
if (n) {
|
|
575
|
+
const o = n.split(";").map((c) => c.trim()).filter(Boolean), a = o.findIndex(
|
|
576
|
+
(c) => c.startsWith("display:")
|
|
577
|
+
);
|
|
578
|
+
a >= 0 && o[a] === "display: none" && (o.splice(a, 1), s = o.length > 0 ? o.join("; ") + ";" : "");
|
|
579
|
+
}
|
|
580
|
+
} else if (n) {
|
|
397
581
|
const o = n.split(";").filter(Boolean), a = o.findIndex(
|
|
398
|
-
(
|
|
582
|
+
(c) => c.trim().startsWith("display:")
|
|
399
583
|
);
|
|
400
|
-
a >= 0 ? o[a] =
|
|
584
|
+
a >= 0 ? o[a] = "display: none" : o.push("display: none"), s = o.join("; ");
|
|
401
585
|
} else
|
|
402
|
-
|
|
586
|
+
s = "display: none";
|
|
587
|
+
s !== n && (s ? t.style = s : delete t.style);
|
|
588
|
+
}
|
|
589
|
+
function xe(e, t) {
|
|
590
|
+
if ([
|
|
591
|
+
/constructor/i,
|
|
592
|
+
/prototype/i,
|
|
593
|
+
/__proto__/i,
|
|
594
|
+
/function/i,
|
|
595
|
+
/eval/i,
|
|
596
|
+
/import/i,
|
|
597
|
+
/require/i,
|
|
598
|
+
/window/i,
|
|
599
|
+
/document/i,
|
|
600
|
+
/global/i,
|
|
601
|
+
/process/i
|
|
602
|
+
].some((i) => i.test(e))) {
|
|
603
|
+
pe("Potentially dangerous expression blocked:", e);
|
|
604
|
+
return;
|
|
605
|
+
}
|
|
606
|
+
if (e.trim().startsWith("{") && e.trim().endsWith("}"))
|
|
607
|
+
try {
|
|
608
|
+
const i = Object.keys(t), n = i.map((a) => t[a]), s = e.replace(/ctx\./g, "");
|
|
609
|
+
if (s.length > 1e3) {
|
|
610
|
+
pe("Expression too long, blocked for security:", e);
|
|
611
|
+
return;
|
|
612
|
+
}
|
|
613
|
+
return new Function(...i, `return ${s}`)(...n);
|
|
614
|
+
} catch (i) {
|
|
615
|
+
pe("Failed to evaluate expression:", e, i);
|
|
616
|
+
return;
|
|
617
|
+
}
|
|
618
|
+
if (e.startsWith("ctx.")) {
|
|
619
|
+
const i = e.slice(4);
|
|
620
|
+
return K(t, i);
|
|
621
|
+
}
|
|
622
|
+
return K(t, e);
|
|
403
623
|
}
|
|
404
|
-
function
|
|
405
|
-
|
|
406
|
-
|
|
624
|
+
function it(e, t, r) {
|
|
625
|
+
let i;
|
|
626
|
+
if (typeof e == "string") {
|
|
627
|
+
if (!r) return;
|
|
628
|
+
i = xe(e, r);
|
|
629
|
+
} else
|
|
630
|
+
i = e;
|
|
407
631
|
let n = [];
|
|
408
|
-
typeof i == "string" ? n = [i] : Array.isArray(i) ? n = i.filter(Boolean) : typeof i == "object" && (n = Object.entries(i).filter(([, a]) => !!a).flatMap(([a]) => a.split(/\s+/).filter(Boolean)));
|
|
632
|
+
typeof i == "string" ? n = [i] : Array.isArray(i) ? n = i.filter(Boolean) : typeof i == "object" && i !== null && (n = Object.entries(i).filter(([, a]) => !!a).flatMap(([a]) => a.split(/\s+/).filter(Boolean)));
|
|
409
633
|
const s = t.class || "", o = s ? `${s} ${n.join(" ")}`.trim() : n.join(" ");
|
|
410
634
|
o && (t.class = o);
|
|
411
635
|
}
|
|
412
|
-
function
|
|
636
|
+
function st(e, t, r) {
|
|
413
637
|
let i;
|
|
414
638
|
if (typeof e == "string") {
|
|
415
639
|
if (!r) return;
|
|
416
|
-
i =
|
|
640
|
+
i = xe(e, r);
|
|
417
641
|
} else
|
|
418
642
|
i = e;
|
|
419
643
|
let n = "";
|
|
@@ -421,12 +645,12 @@ function Ve(e, t, r) {
|
|
|
421
645
|
n = i;
|
|
422
646
|
else if (i && typeof i == "object") {
|
|
423
647
|
const o = [];
|
|
424
|
-
for (const [a,
|
|
425
|
-
if (
|
|
648
|
+
for (const [a, c] of Object.entries(i))
|
|
649
|
+
if (c != null && c !== "") {
|
|
426
650
|
const u = a.replace(
|
|
427
651
|
/[A-Z]/g,
|
|
428
|
-
(
|
|
429
|
-
),
|
|
652
|
+
(p) => `-${p.toLowerCase()}`
|
|
653
|
+
), m = [
|
|
430
654
|
"width",
|
|
431
655
|
"height",
|
|
432
656
|
"top",
|
|
@@ -452,73 +676,83 @@ function Ve(e, t, r) {
|
|
|
452
676
|
"min-height",
|
|
453
677
|
"max-height"
|
|
454
678
|
];
|
|
455
|
-
let
|
|
456
|
-
typeof
|
|
679
|
+
let T = String(c);
|
|
680
|
+
typeof c == "number" && m.includes(u) && (T = `${c}px`), o.push(`${u}: ${T}`);
|
|
457
681
|
}
|
|
458
682
|
n = o.join("; ") + (o.length > 0 ? ";" : "");
|
|
459
683
|
}
|
|
460
684
|
const s = t.style || "";
|
|
461
685
|
t.style = s + (s && !s.endsWith(";") ? "; " : "") + n;
|
|
462
686
|
}
|
|
463
|
-
function
|
|
687
|
+
function De(e, t, r, i) {
|
|
464
688
|
const n = {}, s = { ...i || {} }, o = {};
|
|
465
|
-
for (const [a,
|
|
466
|
-
const { value: u, modifiers:
|
|
689
|
+
for (const [a, c] of Object.entries(e)) {
|
|
690
|
+
const { value: u, modifiers: m, arg: T } = c;
|
|
467
691
|
if (a === "model" || a.startsWith("model:")) {
|
|
468
|
-
const
|
|
469
|
-
|
|
692
|
+
const p = a.split(":"), l = p.length > 1 ? p[1] : T;
|
|
693
|
+
tt(
|
|
470
694
|
typeof u == "string" ? u : String(u),
|
|
471
|
-
|
|
695
|
+
m,
|
|
472
696
|
n,
|
|
473
697
|
s,
|
|
474
698
|
o,
|
|
475
699
|
t,
|
|
476
700
|
r,
|
|
477
|
-
|
|
701
|
+
l
|
|
478
702
|
);
|
|
479
703
|
continue;
|
|
480
704
|
}
|
|
481
705
|
switch (a) {
|
|
482
706
|
case "bind":
|
|
483
|
-
|
|
707
|
+
rt(u, n, s, t);
|
|
484
708
|
break;
|
|
485
709
|
case "show":
|
|
486
|
-
|
|
710
|
+
nt(u, s, t);
|
|
487
711
|
break;
|
|
488
712
|
case "class":
|
|
489
|
-
|
|
713
|
+
it(u, s, t);
|
|
490
714
|
break;
|
|
491
715
|
case "style":
|
|
492
|
-
|
|
716
|
+
st(u, s, t);
|
|
493
717
|
break;
|
|
494
718
|
}
|
|
495
719
|
}
|
|
496
720
|
return { props: n, attrs: s, listeners: o };
|
|
497
721
|
}
|
|
498
|
-
function
|
|
722
|
+
function je(e, t) {
|
|
499
723
|
if (Array.isArray(e)) {
|
|
500
724
|
const s = /* @__PURE__ */ new Set();
|
|
501
725
|
return e.map((o) => {
|
|
502
726
|
if (!o || typeof o != "object") return o;
|
|
503
727
|
let a = o.props?.key ?? o.key;
|
|
504
728
|
if (!a) {
|
|
505
|
-
const
|
|
506
|
-
|
|
729
|
+
const T = o.tag || "node", l = [
|
|
730
|
+
// attrs (kebab-case)
|
|
731
|
+
o.props?.attrs?.id,
|
|
732
|
+
o.props?.attrs?.name,
|
|
733
|
+
o.props?.attrs?.["data-key"],
|
|
734
|
+
// promoted JS props (camelCase or original)
|
|
735
|
+
o.props?.props?.id,
|
|
736
|
+
o.props?.props?.name,
|
|
737
|
+
o.props?.props?.dataKey,
|
|
738
|
+
o.props?.props?.["data-key"]
|
|
739
|
+
].find((w) => w != null) ?? "";
|
|
740
|
+
a = l ? `${t}:${T}:${l}` : `${t}:${T}`;
|
|
507
741
|
}
|
|
508
|
-
let
|
|
509
|
-
for (; s.has(
|
|
510
|
-
|
|
511
|
-
s.add(
|
|
512
|
-
let
|
|
513
|
-
return Array.isArray(
|
|
742
|
+
let c = a, u = 1;
|
|
743
|
+
for (; s.has(c); )
|
|
744
|
+
c = `${a}#${u++}`;
|
|
745
|
+
s.add(c);
|
|
746
|
+
let m = o.children;
|
|
747
|
+
return Array.isArray(m) && (m = je(m, c)), { ...o, key: c, children: m };
|
|
514
748
|
});
|
|
515
749
|
}
|
|
516
750
|
const r = e;
|
|
517
751
|
let i = r.props?.key ?? r.key ?? t, n = r.children;
|
|
518
|
-
return Array.isArray(n) && (n =
|
|
752
|
+
return Array.isArray(n) && (n = je(n, i)), { ...r, key: i, children: n };
|
|
519
753
|
}
|
|
520
|
-
function
|
|
521
|
-
const n = r.directives ?? {}, s =
|
|
754
|
+
function Re(e, t, r, i) {
|
|
755
|
+
const n = r.directives ?? {}, s = De(
|
|
522
756
|
n,
|
|
523
757
|
i,
|
|
524
758
|
e,
|
|
@@ -531,96 +765,203 @@ function Je(e, t, r, i) {
|
|
|
531
765
|
...t.attrs,
|
|
532
766
|
...r.attrs,
|
|
533
767
|
...s.attrs
|
|
534
|
-
},
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
768
|
+
}, c = t.props ?? {}, u = o, m = r?.isCustomElement ?? t?.isCustomElement ?? !1;
|
|
769
|
+
let T = !1;
|
|
770
|
+
for (const w in { ...c, ...u }) {
|
|
771
|
+
const v = c[w], d = u[w];
|
|
772
|
+
if (v !== d)
|
|
773
|
+
if (T = !0, w === "value" && (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement))
|
|
774
|
+
e.value !== d && (e.value = d ?? "");
|
|
775
|
+
else if (w === "checked" && e instanceof HTMLInputElement)
|
|
776
|
+
e.checked = !!d;
|
|
777
|
+
else if (w.startsWith("on") && typeof d == "function") {
|
|
778
|
+
const g = Ne(w);
|
|
779
|
+
typeof v == "function" && e.removeEventListener(g, v), e.addEventListener(g, d);
|
|
780
|
+
} else if (d == null)
|
|
781
|
+
e.removeAttribute(w);
|
|
782
|
+
else if ((r?.isCustomElement ?? t?.isCustomElement ?? !1) || w in e)
|
|
548
783
|
try {
|
|
549
|
-
e[
|
|
784
|
+
e[w] = d;
|
|
550
785
|
} catch {
|
|
551
786
|
}
|
|
552
|
-
|
|
787
|
+
else
|
|
788
|
+
d === !1 && e.removeAttribute(w);
|
|
553
789
|
}
|
|
554
|
-
for (const [
|
|
790
|
+
for (const [w, v] of Object.entries(
|
|
555
791
|
s.listeners || {}
|
|
556
792
|
))
|
|
557
|
-
e.addEventListener(
|
|
558
|
-
const
|
|
559
|
-
for (const
|
|
560
|
-
const
|
|
561
|
-
|
|
793
|
+
e.addEventListener(w, v);
|
|
794
|
+
const p = t.attrs ?? {}, l = a;
|
|
795
|
+
for (const w in { ...p, ...l }) {
|
|
796
|
+
const v = p[w], d = l[w];
|
|
797
|
+
if (v !== d)
|
|
798
|
+
if (T = !0, d == null || d === !1) {
|
|
799
|
+
if (e.removeAttribute(w), w === "value") {
|
|
800
|
+
if (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement)
|
|
801
|
+
try {
|
|
802
|
+
e.value = "";
|
|
803
|
+
} catch {
|
|
804
|
+
}
|
|
805
|
+
else if (e instanceof HTMLSelectElement)
|
|
806
|
+
try {
|
|
807
|
+
e.value = "";
|
|
808
|
+
} catch {
|
|
809
|
+
}
|
|
810
|
+
else if (e instanceof HTMLProgressElement)
|
|
811
|
+
try {
|
|
812
|
+
e.value = 0;
|
|
813
|
+
} catch {
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
if (w === "checked" && e instanceof HTMLInputElement)
|
|
817
|
+
try {
|
|
818
|
+
e.checked = !1;
|
|
819
|
+
} catch {
|
|
820
|
+
}
|
|
821
|
+
if (w === "disabled")
|
|
822
|
+
try {
|
|
823
|
+
e.disabled = !1;
|
|
824
|
+
} catch {
|
|
825
|
+
}
|
|
826
|
+
} else {
|
|
827
|
+
if (w === "value") {
|
|
828
|
+
if (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement) {
|
|
829
|
+
try {
|
|
830
|
+
e.value = d ?? "";
|
|
831
|
+
} catch {
|
|
832
|
+
e.setAttribute(w, String(d));
|
|
833
|
+
}
|
|
834
|
+
continue;
|
|
835
|
+
} else if (e instanceof HTMLSelectElement) {
|
|
836
|
+
try {
|
|
837
|
+
e.value = d ?? "";
|
|
838
|
+
} catch {
|
|
839
|
+
}
|
|
840
|
+
continue;
|
|
841
|
+
} else if (e instanceof HTMLProgressElement) {
|
|
842
|
+
try {
|
|
843
|
+
e.value = Number(d);
|
|
844
|
+
} catch {
|
|
845
|
+
}
|
|
846
|
+
continue;
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
if (w === "checked" && e instanceof HTMLInputElement) {
|
|
850
|
+
try {
|
|
851
|
+
e.checked = !!d;
|
|
852
|
+
} catch {
|
|
853
|
+
}
|
|
854
|
+
continue;
|
|
855
|
+
}
|
|
856
|
+
if (w === "style") {
|
|
857
|
+
e.setAttribute(w, String(d));
|
|
858
|
+
continue;
|
|
859
|
+
}
|
|
860
|
+
if (!(e.namespaceURI === "http://www.w3.org/2000/svg") && w in e)
|
|
861
|
+
try {
|
|
862
|
+
e[w] = d;
|
|
863
|
+
} catch {
|
|
864
|
+
e.setAttribute(w, String(d));
|
|
865
|
+
}
|
|
866
|
+
else
|
|
867
|
+
e.setAttribute(w, String(d));
|
|
868
|
+
}
|
|
562
869
|
}
|
|
870
|
+
if (m && T)
|
|
871
|
+
try {
|
|
872
|
+
if (typeof e._applyProps == "function")
|
|
873
|
+
try {
|
|
874
|
+
e._applyProps(e._cfg);
|
|
875
|
+
} catch {
|
|
876
|
+
}
|
|
877
|
+
typeof e.requestRender == "function" ? e.requestRender() : typeof e._render == "function" && e._render(e._cfg);
|
|
878
|
+
} catch {
|
|
879
|
+
}
|
|
563
880
|
}
|
|
564
|
-
function
|
|
881
|
+
function U(e, t, r) {
|
|
565
882
|
if (typeof e == "string")
|
|
566
883
|
return document.createTextNode(e);
|
|
567
884
|
if (e.tag === "#text") {
|
|
568
|
-
const
|
|
885
|
+
const p = document.createTextNode(
|
|
569
886
|
typeof e.children == "string" ? e.children : ""
|
|
570
887
|
);
|
|
571
|
-
return e.key != null && (
|
|
888
|
+
return e.key != null && (p.key = e.key), p;
|
|
572
889
|
}
|
|
573
890
|
if (e.tag === "#anchor") {
|
|
574
|
-
const
|
|
575
|
-
|
|
576
|
-
const
|
|
577
|
-
|
|
578
|
-
for (const
|
|
579
|
-
const
|
|
580
|
-
|
|
891
|
+
const p = e, l = Array.isArray(p.children) ? p.children : [], w = document.createTextNode(""), v = document.createTextNode("");
|
|
892
|
+
p.key != null && (w.key = `${p.key}:start`, v.key = `${p.key}:end`), p._startNode = w, p._endNode = v;
|
|
893
|
+
const d = document.createDocumentFragment();
|
|
894
|
+
d.appendChild(w);
|
|
895
|
+
for (const g of l) {
|
|
896
|
+
const y = U(g, t);
|
|
897
|
+
d.appendChild(y);
|
|
581
898
|
}
|
|
582
|
-
return
|
|
899
|
+
return d.appendChild(v), d;
|
|
583
900
|
}
|
|
584
901
|
const i = document.createElement(e.tag);
|
|
585
902
|
e.key != null && (i.key = e.key);
|
|
586
|
-
const { props: n = {}, attrs: s = {}, directives: o = {} } = e.props ?? {}, a =
|
|
903
|
+
const { props: n = {}, attrs: s = {}, directives: o = {} } = e.props ?? {}, a = De(o, t, i, s), c = {
|
|
587
904
|
...n,
|
|
588
905
|
...a.props
|
|
589
906
|
}, u = {
|
|
590
907
|
...s,
|
|
591
908
|
...a.attrs
|
|
592
|
-
};
|
|
593
|
-
for (const
|
|
594
|
-
const
|
|
595
|
-
typeof
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
909
|
+
}, m = i.namespaceURI === "http://www.w3.org/2000/svg";
|
|
910
|
+
for (const p in u) {
|
|
911
|
+
const l = u[p];
|
|
912
|
+
if (!(typeof p != "string" || /\[object Object\]/.test(p))) {
|
|
913
|
+
if (typeof l == "boolean")
|
|
914
|
+
l && i.setAttribute(p, "");
|
|
915
|
+
else if (l != null)
|
|
916
|
+
if (!m && p === "value" && (i instanceof HTMLInputElement || i instanceof HTMLTextAreaElement || i instanceof HTMLSelectElement || i instanceof HTMLProgressElement))
|
|
917
|
+
try {
|
|
918
|
+
i instanceof HTMLProgressElement ? i.value = Number(l) : i.value = l ?? "";
|
|
919
|
+
} catch {
|
|
920
|
+
i.setAttribute(p, String(l));
|
|
921
|
+
}
|
|
922
|
+
else if (!m && p === "checked" && i instanceof HTMLInputElement)
|
|
923
|
+
try {
|
|
924
|
+
i.checked = !!l;
|
|
925
|
+
} catch {
|
|
926
|
+
i.setAttribute(p, String(l));
|
|
927
|
+
}
|
|
928
|
+
else if (!m && p in i)
|
|
929
|
+
try {
|
|
930
|
+
i[p] = l;
|
|
931
|
+
} catch {
|
|
932
|
+
i.setAttribute(p, String(l));
|
|
933
|
+
}
|
|
934
|
+
else
|
|
935
|
+
i.setAttribute(p, String(l));
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
for (const p in c) {
|
|
939
|
+
const l = c[p];
|
|
940
|
+
if (!(typeof p != "string" || /\[object Object\]/.test(p)))
|
|
941
|
+
if (p === "value" && (i instanceof HTMLInputElement || i instanceof HTMLTextAreaElement || i instanceof HTMLSelectElement))
|
|
942
|
+
i.value = l ?? "";
|
|
943
|
+
else if (p === "checked" && i instanceof HTMLInputElement)
|
|
944
|
+
i.checked = !!l;
|
|
945
|
+
else if (p.startsWith("on") && typeof l == "function")
|
|
946
|
+
i.addEventListener(Ne(p), l);
|
|
606
947
|
else {
|
|
607
|
-
if (
|
|
948
|
+
if (p.startsWith("on") && l === void 0)
|
|
608
949
|
continue;
|
|
609
|
-
if (
|
|
610
|
-
i.removeAttribute(
|
|
611
|
-
else if ((e.props?.isCustomElement ?? !1) ||
|
|
950
|
+
if (l == null || l === !1)
|
|
951
|
+
i.removeAttribute(p);
|
|
952
|
+
else if ((e.props?.isCustomElement ?? !1) || p in i)
|
|
612
953
|
try {
|
|
613
|
-
i[
|
|
954
|
+
i[p] = l;
|
|
614
955
|
} catch {
|
|
615
956
|
}
|
|
616
957
|
}
|
|
617
958
|
}
|
|
618
|
-
for (const [
|
|
959
|
+
for (const [p, l] of Object.entries(
|
|
619
960
|
a.listeners || {}
|
|
620
961
|
))
|
|
621
|
-
i.addEventListener(
|
|
622
|
-
const
|
|
623
|
-
typeof e != "string" &&
|
|
962
|
+
i.addEventListener(p, l);
|
|
963
|
+
const T = e.props?.ref ?? (e.props?.props && e.props.props.ref);
|
|
964
|
+
typeof e != "string" && T && r && (r[T] = i);
|
|
624
965
|
try {
|
|
625
966
|
if (typeof i._applyProps == "function")
|
|
626
967
|
try {
|
|
@@ -631,118 +972,126 @@ function M(e, t, r) {
|
|
|
631
972
|
} catch {
|
|
632
973
|
}
|
|
633
974
|
if (Array.isArray(e.children))
|
|
634
|
-
for (const
|
|
635
|
-
i.appendChild(
|
|
975
|
+
for (const p of e.children)
|
|
976
|
+
i.appendChild(U(p, t, r));
|
|
636
977
|
else typeof e.children == "string" && (i.textContent = e.children);
|
|
978
|
+
try {
|
|
979
|
+
if (i instanceof HTMLSelectElement && u && u.hasOwnProperty("value"))
|
|
980
|
+
try {
|
|
981
|
+
i.value = u.value ?? "";
|
|
982
|
+
} catch {
|
|
983
|
+
}
|
|
984
|
+
} catch {
|
|
985
|
+
}
|
|
637
986
|
return i;
|
|
638
987
|
}
|
|
639
|
-
function
|
|
988
|
+
function ot(e, t, r, i, n) {
|
|
640
989
|
if (typeof r == "string") {
|
|
641
990
|
e.textContent !== r && (e.textContent = r);
|
|
642
991
|
return;
|
|
643
992
|
}
|
|
644
993
|
if (!Array.isArray(r)) return;
|
|
645
994
|
const s = Array.from(e.childNodes), o = Array.isArray(t) ? t : [], a = /* @__PURE__ */ new Map();
|
|
646
|
-
for (const
|
|
647
|
-
|
|
648
|
-
const
|
|
649
|
-
for (const
|
|
650
|
-
const
|
|
651
|
-
|
|
995
|
+
for (const l of o)
|
|
996
|
+
l && l.key != null && a.set(l.key, l);
|
|
997
|
+
const c = /* @__PURE__ */ new Map();
|
|
998
|
+
for (const l of s) {
|
|
999
|
+
const w = l.key;
|
|
1000
|
+
w != null && c.set(w, l);
|
|
652
1001
|
}
|
|
653
1002
|
const u = /* @__PURE__ */ new Set();
|
|
654
|
-
let
|
|
655
|
-
function
|
|
656
|
-
let
|
|
657
|
-
for (;
|
|
658
|
-
|
|
659
|
-
}
|
|
660
|
-
function
|
|
661
|
-
const
|
|
662
|
-
let
|
|
663
|
-
for (;
|
|
664
|
-
|
|
665
|
-
const x = Array.isArray(
|
|
666
|
-
if (
|
|
667
|
-
const
|
|
668
|
-
for (const
|
|
669
|
-
|
|
670
|
-
for (const
|
|
671
|
-
const
|
|
672
|
-
|
|
1003
|
+
let m = e.firstChild;
|
|
1004
|
+
function T(l, w) {
|
|
1005
|
+
let v = l;
|
|
1006
|
+
for (; v && (u.add(v), v !== w); )
|
|
1007
|
+
v = v.nextSibling;
|
|
1008
|
+
}
|
|
1009
|
+
function p(l, w, v, d) {
|
|
1010
|
+
const g = [];
|
|
1011
|
+
let y = l.nextSibling;
|
|
1012
|
+
for (; y && y !== w; )
|
|
1013
|
+
g.push(y), y = y.nextSibling;
|
|
1014
|
+
const x = Array.isArray(v) ? v : [];
|
|
1015
|
+
if (d.some((b) => b && b.key != null) || x.some((b) => b && b.key != null)) {
|
|
1016
|
+
const b = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map();
|
|
1017
|
+
for (const S of x)
|
|
1018
|
+
S && S.key != null && b.set(S.key, S);
|
|
1019
|
+
for (const S of g) {
|
|
1020
|
+
const E = S.key;
|
|
1021
|
+
E != null && h.set(E, S);
|
|
673
1022
|
}
|
|
674
1023
|
const _ = /* @__PURE__ */ new Set();
|
|
675
|
-
let
|
|
676
|
-
for (const
|
|
677
|
-
let
|
|
678
|
-
if (
|
|
679
|
-
const
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
1024
|
+
let $ = l.nextSibling;
|
|
1025
|
+
for (const S of d) {
|
|
1026
|
+
let E;
|
|
1027
|
+
if (S.key != null && h.has(S.key)) {
|
|
1028
|
+
const C = b.get(S.key);
|
|
1029
|
+
E = ge(
|
|
1030
|
+
h.get(S.key),
|
|
1031
|
+
C,
|
|
1032
|
+
S,
|
|
684
1033
|
i
|
|
685
|
-
), _.add(
|
|
1034
|
+
), _.add(E), E !== $ && e.contains(E) && e.insertBefore(E, $);
|
|
686
1035
|
} else
|
|
687
|
-
|
|
688
|
-
|
|
1036
|
+
E = U(S, i), e.insertBefore(E, $), _.add(E);
|
|
1037
|
+
$ = E.nextSibling;
|
|
689
1038
|
}
|
|
690
|
-
for (const
|
|
691
|
-
!_.has(
|
|
1039
|
+
for (const S of g)
|
|
1040
|
+
!_.has(S) && e.contains(S) && e.removeChild(S);
|
|
692
1041
|
} else {
|
|
693
|
-
const
|
|
1042
|
+
const b = Math.min(
|
|
694
1043
|
x.length,
|
|
695
|
-
|
|
1044
|
+
d.length
|
|
696
1045
|
);
|
|
697
|
-
for (let
|
|
698
|
-
const _ = x[
|
|
699
|
-
|
|
1046
|
+
for (let h = 0; h < b; h++) {
|
|
1047
|
+
const _ = x[h], $ = d[h], S = ge(g[h], _, $, i);
|
|
1048
|
+
S !== g[h] && (e.insertBefore(S, g[h]), e.removeChild(g[h]));
|
|
700
1049
|
}
|
|
701
|
-
for (let
|
|
702
|
-
e.insertBefore(
|
|
703
|
-
for (let
|
|
704
|
-
e.removeChild(
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
for (const
|
|
708
|
-
let
|
|
709
|
-
if (
|
|
710
|
-
const
|
|
711
|
-
let
|
|
712
|
-
const
|
|
713
|
-
if (
|
|
714
|
-
e.insertBefore(
|
|
715
|
-
for (const
|
|
716
|
-
e.insertBefore(
|
|
717
|
-
e.insertBefore(x,
|
|
1050
|
+
for (let h = b; h < d.length; h++)
|
|
1051
|
+
e.insertBefore(U(d[h], i), w);
|
|
1052
|
+
for (let h = b; h < g.length; h++)
|
|
1053
|
+
e.removeChild(g[h]);
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
for (const l of r) {
|
|
1057
|
+
let w;
|
|
1058
|
+
if (l.tag === "#anchor") {
|
|
1059
|
+
const v = l.key, d = `${v}:start`, g = `${v}:end`;
|
|
1060
|
+
let y = c.get(d), x = c.get(g);
|
|
1061
|
+
const f = Array.isArray(l.children) ? l.children : [];
|
|
1062
|
+
if (y || (y = document.createTextNode(""), y.key = d), x || (x = document.createTextNode(""), x.key = g), l._startNode = y, l._endNode = x, !e.contains(y) || !e.contains(x)) {
|
|
1063
|
+
e.insertBefore(y, m);
|
|
1064
|
+
for (const b of f)
|
|
1065
|
+
e.insertBefore(U(b, i), m);
|
|
1066
|
+
e.insertBefore(x, m);
|
|
718
1067
|
} else
|
|
719
|
-
|
|
720
|
-
|
|
1068
|
+
p(
|
|
1069
|
+
y,
|
|
721
1070
|
x,
|
|
722
|
-
a.get(
|
|
723
|
-
|
|
1071
|
+
a.get(v)?.children,
|
|
1072
|
+
f
|
|
724
1073
|
);
|
|
725
|
-
y
|
|
1074
|
+
T(y, x), m = x.nextSibling;
|
|
726
1075
|
continue;
|
|
727
1076
|
}
|
|
728
|
-
if (
|
|
729
|
-
const
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
1077
|
+
if (l.key != null && c.has(l.key)) {
|
|
1078
|
+
const v = a.get(l.key);
|
|
1079
|
+
w = ge(
|
|
1080
|
+
c.get(l.key),
|
|
1081
|
+
v,
|
|
1082
|
+
l,
|
|
734
1083
|
i,
|
|
735
1084
|
n
|
|
736
|
-
), u.add(
|
|
1085
|
+
), u.add(w), w !== m && e.contains(w) && (m && !e.contains(m) && (m = null), e.insertBefore(w, m));
|
|
737
1086
|
} else
|
|
738
|
-
|
|
739
|
-
|
|
1087
|
+
w = U(l, i, n), m && !e.contains(m) && (m = null), e.insertBefore(w, m), u.add(w);
|
|
1088
|
+
m = w.nextSibling;
|
|
740
1089
|
}
|
|
741
|
-
for (const
|
|
742
|
-
!u.has(
|
|
1090
|
+
for (const l of s)
|
|
1091
|
+
!u.has(l) && e.contains(l) && (te(l, n), e.removeChild(l));
|
|
743
1092
|
}
|
|
744
|
-
function
|
|
745
|
-
if (t && typeof t != "string" && t.props?.ref && n &&
|
|
1093
|
+
function ge(e, t, r, i, n) {
|
|
1094
|
+
if (t && typeof t != "string" && t.props?.ref && n && te(e, n), t === r) return e;
|
|
746
1095
|
if (typeof r == "string") {
|
|
747
1096
|
if (e.nodeType === Node.TEXT_NODE)
|
|
748
1097
|
return e.textContent !== r && (e.textContent = r), e;
|
|
@@ -752,91 +1101,97 @@ function ae(e, t, r, i, n) {
|
|
|
752
1101
|
}
|
|
753
1102
|
}
|
|
754
1103
|
if (r && typeof r != "string" && r.tag === "#anchor") {
|
|
755
|
-
const o = r, a = Array.isArray(o.children) ? o.children : [],
|
|
756
|
-
o.key != null && (
|
|
757
|
-
const
|
|
758
|
-
|
|
759
|
-
for (const
|
|
760
|
-
const
|
|
761
|
-
|
|
1104
|
+
const o = r, a = Array.isArray(o.children) ? o.children : [], c = o._startNode ?? document.createTextNode(""), u = o._endNode ?? document.createTextNode("");
|
|
1105
|
+
o.key != null && (c.key = `${o.key}:start`, u.key = `${o.key}:end`), o._startNode = c, o._endNode = u;
|
|
1106
|
+
const m = document.createDocumentFragment();
|
|
1107
|
+
m.appendChild(c);
|
|
1108
|
+
for (const T of a) {
|
|
1109
|
+
const p = U(T, i);
|
|
1110
|
+
m.appendChild(p);
|
|
762
1111
|
}
|
|
763
|
-
return
|
|
1112
|
+
return m.appendChild(u), e.parentNode?.replaceChild(m, e), c;
|
|
764
1113
|
}
|
|
765
1114
|
if (!r) {
|
|
766
|
-
|
|
1115
|
+
te(e, n);
|
|
767
1116
|
const o = document.createComment("removed");
|
|
768
1117
|
return e.parentNode?.replaceChild(o, e), o;
|
|
769
1118
|
}
|
|
770
1119
|
if (!t || typeof t == "string") {
|
|
771
|
-
|
|
772
|
-
const o =
|
|
1120
|
+
te(e, n);
|
|
1121
|
+
const o = U(r, i, n);
|
|
773
1122
|
return typeof r != "string" && r.props?.ref && n && (n[r.props.ref] = o), e.parentNode?.replaceChild(o, e), o;
|
|
774
1123
|
}
|
|
775
1124
|
if (r.tag === "#anchor") {
|
|
776
|
-
const o = Array.isArray(r.children) ? r.children : [], a = r._startNode ?? document.createTextNode(""),
|
|
777
|
-
r.key != null && (a.key = `${r.key}:start`,
|
|
1125
|
+
const o = Array.isArray(r.children) ? r.children : [], a = r._startNode ?? document.createTextNode(""), c = r._endNode ?? document.createTextNode("");
|
|
1126
|
+
r.key != null && (a.key = `${r.key}:start`, c.key = `${r.key}:end`), r._startNode = a, r._endNode = c;
|
|
778
1127
|
const u = document.createDocumentFragment();
|
|
779
1128
|
u.appendChild(a);
|
|
780
|
-
for (const
|
|
781
|
-
u.appendChild(
|
|
782
|
-
return u.appendChild(
|
|
1129
|
+
for (const m of o)
|
|
1130
|
+
u.appendChild(U(m, i));
|
|
1131
|
+
return u.appendChild(c), e.parentNode?.replaceChild(u, e), a;
|
|
783
1132
|
}
|
|
784
1133
|
if (typeof t != "string" && typeof r != "string" && t.tag === r.tag && t.key === r.key) {
|
|
785
1134
|
const o = e;
|
|
786
|
-
return
|
|
1135
|
+
return Re(o, t.props || {}, r.props || {}, i), ot(o, t.children, r.children, i, n), typeof r != "string" && r.props?.ref && n && (n[r.props.ref] = o), o;
|
|
787
1136
|
}
|
|
788
|
-
|
|
789
|
-
|
|
1137
|
+
if (typeof t != "string" && typeof r != "string" && t.tag === r.tag && (t.tag && String(t.tag).includes("-") || r.props && r.props.isCustomElement || t.props && t.props.isCustomElement))
|
|
1138
|
+
try {
|
|
1139
|
+
const a = e;
|
|
1140
|
+
return Re(a, t.props || {}, r.props || {}, i), typeof r != "string" && r.props?.ref && n && (n[r.props.ref] = a), a;
|
|
1141
|
+
} catch {
|
|
1142
|
+
}
|
|
1143
|
+
te(e, n);
|
|
1144
|
+
const s = U(r, i, n);
|
|
790
1145
|
return typeof r != "string" && r.props?.ref && n && (n[r.props.ref] = s), e.parentNode?.replaceChild(s, e), s;
|
|
791
1146
|
}
|
|
792
|
-
function
|
|
1147
|
+
function at(e, t, r, i) {
|
|
793
1148
|
let n;
|
|
794
1149
|
Array.isArray(t) ? t.length === 1 ? (n = t[0], n && typeof n == "object" && n.key == null && (n = { ...n, key: "__root__" })) : n = { tag: "div", key: "__root__", children: t } : (n = t, n && typeof n == "object" && n.key == null && (n = { ...n, key: "__root__" })), n && typeof n == "object" && n.tag === "#anchor" && (n = {
|
|
795
1150
|
tag: "div",
|
|
796
1151
|
key: "__anchor_root__",
|
|
797
1152
|
props: { attrs: { "data-anchor-block-root": "", key: "__anchor_root__" } },
|
|
798
1153
|
children: [n]
|
|
799
|
-
}), n =
|
|
1154
|
+
}), n = je(n, String(n.key ?? "root"));
|
|
800
1155
|
const s = e._prevVNode ?? null, o = e._prevDom ?? e.firstChild ?? null;
|
|
801
1156
|
let a;
|
|
802
|
-
s && o ? typeof s != "string" && typeof n != "string" && s.tag === n.tag && s.key === n.key ? a =
|
|
803
|
-
const
|
|
1157
|
+
s && o ? typeof s != "string" && typeof n != "string" && s.tag === n.tag && s.key === n.key ? a = ge(o, s, n, r, i) : (a = U(n, r, i), e.replaceChild(a, o)) : (a = U(n, r, i), e.firstChild ? e.replaceChild(a, e.firstChild) : e.appendChild(a));
|
|
1158
|
+
const c = [];
|
|
804
1159
|
for (let u = 0; u < e.childNodes.length; u++) {
|
|
805
|
-
const
|
|
806
|
-
|
|
1160
|
+
const m = e.childNodes[u];
|
|
1161
|
+
m !== a && m.nodeName !== "STYLE" && (te(m, i), c.push(m));
|
|
807
1162
|
}
|
|
808
|
-
|
|
1163
|
+
c.forEach((u) => e.removeChild(u)), e._prevVNode = n, e._prevDom = a;
|
|
809
1164
|
}
|
|
810
|
-
function
|
|
811
|
-
if (typeof e == "string") return
|
|
1165
|
+
function ke(e) {
|
|
1166
|
+
if (typeof e == "string") return Z(e);
|
|
812
1167
|
if (e.tag === "#text")
|
|
813
|
-
return typeof e.children == "string" ?
|
|
1168
|
+
return typeof e.children == "string" ? Z(e.children) : "";
|
|
814
1169
|
if (e.tag === "#anchor")
|
|
815
|
-
return (Array.isArray(e.children) ? e.children.filter(Boolean) : []).map(
|
|
1170
|
+
return (Array.isArray(e.children) ? e.children.filter(Boolean) : []).map(ke).join("");
|
|
816
1171
|
let t = "";
|
|
817
|
-
e.props && e.props.attrs && (t = Object.entries(e.props.attrs).map(([n, s]) => ` ${n}="${
|
|
1172
|
+
e.props && e.props.attrs && (t = Object.entries(e.props.attrs).map(([n, s]) => ` ${n}="${Z(String(s))}"`).join(""));
|
|
818
1173
|
let r = "";
|
|
819
|
-
e.props && (r = Object.entries(e.props).filter(([n]) => n !== "attrs" && n !== "directives" && n !== "ref" && n !== "key").map(([n, s]) => ` ${n}="${
|
|
820
|
-
const i = Array.isArray(e.children) ? e.children.filter(Boolean).map(
|
|
1174
|
+
e.props && (r = Object.entries(e.props).filter(([n]) => n !== "attrs" && n !== "directives" && n !== "ref" && n !== "key").map(([n, s]) => ` ${n}="${Z(String(s))}"`).join(""));
|
|
1175
|
+
const i = Array.isArray(e.children) ? e.children.filter(Boolean).map(ke).join("") : typeof e.children == "string" ? Z(e.children) : e.children ? ke(e.children) : "";
|
|
821
1176
|
return `<${e.tag}${t}${r}>${i}</${e.tag}>`;
|
|
822
1177
|
}
|
|
823
|
-
function
|
|
1178
|
+
function Ue(e, ...t) {
|
|
824
1179
|
let r = "";
|
|
825
1180
|
for (let i = 0; i < e.length; i++)
|
|
826
1181
|
r += e[i], i < t.length && (r += t[i]);
|
|
827
1182
|
return r;
|
|
828
1183
|
}
|
|
829
|
-
function
|
|
1184
|
+
function Fe(e) {
|
|
830
1185
|
return e.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\s+/g, " ").replace(/\s*([{}:;,>+~])\s*/g, "$1").replace(/;}/g, "}").trim();
|
|
831
1186
|
}
|
|
832
|
-
let
|
|
833
|
-
function
|
|
834
|
-
return
|
|
1187
|
+
let ue = null;
|
|
1188
|
+
function Oe() {
|
|
1189
|
+
return ue || (ue = new CSSStyleSheet(), ue.replaceSync(Fe(lt))), ue;
|
|
835
1190
|
}
|
|
836
|
-
function
|
|
1191
|
+
function ct(e) {
|
|
837
1192
|
return e.replace(/url\s*\(\s*['"]?javascript:[^)]*\)/gi, "").replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi, "").replace(/expression\s*\([^)]*\)/gi, "");
|
|
838
1193
|
}
|
|
839
|
-
const
|
|
1194
|
+
const lt = Ue`
|
|
840
1195
|
:host, *, ::before, ::after {
|
|
841
1196
|
all: isolate;
|
|
842
1197
|
box-sizing: border-box;
|
|
@@ -894,7 +1249,7 @@ const Qe = Oe`
|
|
|
894
1249
|
sup { top: -.5em }
|
|
895
1250
|
[disabled], [aria-disabled=true] { cursor: not-allowed }
|
|
896
1251
|
[hidden] { display: none }
|
|
897
|
-
`,
|
|
1252
|
+
`, ft = {
|
|
898
1253
|
neutral: {
|
|
899
1254
|
50: "#fafafa",
|
|
900
1255
|
100: "#f4f4f5",
|
|
@@ -990,8 +1345,8 @@ const Qe = Oe`
|
|
|
990
1345
|
black: { DEFAULT: "#000000" },
|
|
991
1346
|
transparent: { DEFAULT: "transparent" },
|
|
992
1347
|
current: { DEFAULT: "currentColor" }
|
|
993
|
-
},
|
|
994
|
-
Object.entries(
|
|
1348
|
+
}, ut = Object.fromEntries(
|
|
1349
|
+
Object.entries(ft).map(([e, t]) => [
|
|
995
1350
|
e,
|
|
996
1351
|
Object.fromEntries(
|
|
997
1352
|
Object.entries(t).map(([r, i]) => [
|
|
@@ -1000,7 +1355,7 @@ const Qe = Oe`
|
|
|
1000
1355
|
])
|
|
1001
1356
|
)
|
|
1002
1357
|
])
|
|
1003
|
-
),
|
|
1358
|
+
), _e = {
|
|
1004
1359
|
/* Display */
|
|
1005
1360
|
block: "display:block;",
|
|
1006
1361
|
inline: "display:inline;",
|
|
@@ -1215,7 +1570,7 @@ const Qe = Oe`
|
|
|
1215
1570
|
"z-30": "z-index:30;",
|
|
1216
1571
|
"z-40": "z-index:40;",
|
|
1217
1572
|
"z-50": "z-index:50;"
|
|
1218
|
-
},
|
|
1573
|
+
}, dt = "0.25rem", Pe = {
|
|
1219
1574
|
m: ["margin"],
|
|
1220
1575
|
mx: ["margin-inline"],
|
|
1221
1576
|
my: ["margin-block"],
|
|
@@ -1247,7 +1602,7 @@ const Qe = Oe`
|
|
|
1247
1602
|
"gap-x": ["column-gap"],
|
|
1248
1603
|
"gap-y": ["row-gap"]
|
|
1249
1604
|
};
|
|
1250
|
-
function
|
|
1605
|
+
function D(e, t) {
|
|
1251
1606
|
let r = 0, i = 0;
|
|
1252
1607
|
for (let n = 0; n < e.length; n++) {
|
|
1253
1608
|
const s = e[n];
|
|
@@ -1260,21 +1615,21 @@ function N(e, t) {
|
|
|
1260
1615
|
}
|
|
1261
1616
|
return e + t;
|
|
1262
1617
|
}
|
|
1263
|
-
const
|
|
1618
|
+
const pt = {
|
|
1264
1619
|
before: (e, t) => `${e}::before{${t}}`,
|
|
1265
1620
|
after: (e, t) => `${e}::after{${t}}`,
|
|
1266
|
-
hover: (e, t) => `${
|
|
1267
|
-
focus: (e, t) => `${
|
|
1268
|
-
active: (e, t) => `${
|
|
1269
|
-
disabled: (e, t) => `${
|
|
1270
|
-
visited: (e, t) => `${
|
|
1271
|
-
checked: (e, t) => `${
|
|
1272
|
-
first: (e, t) => `${
|
|
1273
|
-
last: (e, t) => `${
|
|
1274
|
-
odd: (e, t) => `${
|
|
1275
|
-
even: (e, t) => `${
|
|
1276
|
-
"focus-within": (e, t) => `${
|
|
1277
|
-
"focus-visible": (e, t) => `${
|
|
1621
|
+
hover: (e, t) => `${D(e, ":hover")}{${t}}`,
|
|
1622
|
+
focus: (e, t) => `${D(e, ":focus")}{${t}}`,
|
|
1623
|
+
active: (e, t) => `${D(e, ":active")}{${t}}`,
|
|
1624
|
+
disabled: (e, t) => `${D(e, ":disabled")}{${t}}`,
|
|
1625
|
+
visited: (e, t) => `${D(e, ":visited")}{${t}}`,
|
|
1626
|
+
checked: (e, t) => `${D(e, ":checked")}{${t}}`,
|
|
1627
|
+
first: (e, t) => `${D(e, ":first-child")}{${t}}`,
|
|
1628
|
+
last: (e, t) => `${D(e, ":last-child")}{${t}}`,
|
|
1629
|
+
odd: (e, t) => `${D(e, ":nth-child(odd)")}{${t}}`,
|
|
1630
|
+
even: (e, t) => `${D(e, ":nth-child(even)")}{${t}}`,
|
|
1631
|
+
"focus-within": (e, t) => `${D(e, ":focus-within")}{${t}}`,
|
|
1632
|
+
"focus-visible": (e, t) => `${D(e, ":focus-visible")}{${t}}`,
|
|
1278
1633
|
"group-hover": (e, t) => `.group:hover ${e}{${t}}`,
|
|
1279
1634
|
"group-focus": (e, t) => `.group:focus ${e}{${t}}`,
|
|
1280
1635
|
"group-active": (e, t) => `.group:active ${e}{${t}}`,
|
|
@@ -1283,7 +1638,7 @@ const rt = {
|
|
|
1283
1638
|
"peer-focus": (e, t) => `.peer:focus ~ ${e}{${t}}`,
|
|
1284
1639
|
"peer-checked": (e, t) => `.peer:checked ~ ${e}{${t}}`,
|
|
1285
1640
|
"peer-disabled": (e, t) => `.peer:disabled ~ ${e}{${t}}`
|
|
1286
|
-
},
|
|
1641
|
+
}, Ee = {
|
|
1287
1642
|
// Responsive
|
|
1288
1643
|
sm: "(min-width:640px)",
|
|
1289
1644
|
md: "(min-width:768px)",
|
|
@@ -1292,23 +1647,23 @@ const rt = {
|
|
|
1292
1647
|
"2xl": "(min-width:1536px)",
|
|
1293
1648
|
// Dark mode (now plain string)
|
|
1294
1649
|
dark: "(prefers-color-scheme: dark)"
|
|
1295
|
-
},
|
|
1296
|
-
function
|
|
1650
|
+
}, $e = ["sm", "md", "lg", "xl", "2xl"];
|
|
1651
|
+
function Se(e) {
|
|
1297
1652
|
const t = e.startsWith("-"), i = (t ? e.slice(1) : e).split("-");
|
|
1298
1653
|
if (i.length < 2) return null;
|
|
1299
1654
|
const n = i.slice(0, -1).join("-"), s = i[i.length - 1], o = parseFloat(s);
|
|
1300
|
-
if (Number.isNaN(o) || !
|
|
1655
|
+
if (Number.isNaN(o) || !Pe[n]) return null;
|
|
1301
1656
|
const a = t ? "-" : "";
|
|
1302
|
-
return
|
|
1657
|
+
return Pe[n].map((c) => `${c}:calc(${a}${dt} * ${o});`).join("");
|
|
1303
1658
|
}
|
|
1304
|
-
function
|
|
1659
|
+
function Me(e) {
|
|
1305
1660
|
const t = e.replace("#", ""), r = parseInt(t, 16), i = r >> 16 & 255, n = r >> 8 & 255, s = r & 255;
|
|
1306
1661
|
return `${i} ${n} ${s}`;
|
|
1307
1662
|
}
|
|
1308
|
-
function
|
|
1663
|
+
function ht(e) {
|
|
1309
1664
|
const t = /^(bg|text|border|decoration|shadow|outline|caret|accent|fill|stroke)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);
|
|
1310
1665
|
if (!t) return null;
|
|
1311
|
-
const [, r, i, n = "DEFAULT"] = t, s =
|
|
1666
|
+
const [, r, i, n = "DEFAULT"] = t, s = ut[i]?.[n];
|
|
1312
1667
|
if (!s) return null;
|
|
1313
1668
|
if (r === "shadow") return `--ce-shadow-color:${s};`;
|
|
1314
1669
|
const a = {
|
|
@@ -1324,41 +1679,41 @@ function nt(e) {
|
|
|
1324
1679
|
}[r];
|
|
1325
1680
|
return a ? `${a}:${s};` : null;
|
|
1326
1681
|
}
|
|
1327
|
-
function
|
|
1682
|
+
function gt(e) {
|
|
1328
1683
|
const [t, r] = e.split("/");
|
|
1329
1684
|
if (!r) return { base: t };
|
|
1330
1685
|
const i = parseInt(r, 10);
|
|
1331
1686
|
return isNaN(i) || i < 0 || i > 100 ? { base: t } : { base: t, opacity: i / 100 };
|
|
1332
1687
|
}
|
|
1333
|
-
function
|
|
1334
|
-
const { base: t, opacity: r } =
|
|
1688
|
+
function Ce(e) {
|
|
1689
|
+
const { base: t, opacity: r } = gt(e), i = ht(t);
|
|
1335
1690
|
if (i) {
|
|
1336
1691
|
if (r !== void 0) {
|
|
1337
1692
|
const s = /#([0-9a-f]{6})/i.exec(i);
|
|
1338
1693
|
if (s) {
|
|
1339
|
-
const o =
|
|
1694
|
+
const o = Me(s[0]);
|
|
1340
1695
|
return i.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${r})`);
|
|
1341
1696
|
}
|
|
1342
1697
|
}
|
|
1343
1698
|
return i;
|
|
1344
1699
|
}
|
|
1345
|
-
const n =
|
|
1700
|
+
const n = me(t);
|
|
1346
1701
|
if (n && r !== void 0) {
|
|
1347
1702
|
const s = /#([0-9a-f]{6})/i.exec(n);
|
|
1348
1703
|
if (s) {
|
|
1349
|
-
const o =
|
|
1704
|
+
const o = Me(s[0]);
|
|
1350
1705
|
return n.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${r})`);
|
|
1351
1706
|
}
|
|
1352
1707
|
}
|
|
1353
1708
|
return n;
|
|
1354
1709
|
}
|
|
1355
|
-
function
|
|
1710
|
+
function Ae(e) {
|
|
1356
1711
|
const t = /^opacity-(\d{1,3})$/.exec(e);
|
|
1357
1712
|
if (!t) return null;
|
|
1358
1713
|
const r = parseInt(t[1], 10);
|
|
1359
1714
|
return r < 0 || r > 100 ? null : `opacity:${r / 100};`;
|
|
1360
1715
|
}
|
|
1361
|
-
function
|
|
1716
|
+
function me(e) {
|
|
1362
1717
|
if (e.startsWith("[") && e.endsWith("]") && !e.includes("-[")) {
|
|
1363
1718
|
const n = e.slice(1, -1).trim().match(/^([a-zA-Z][a-zA-Z0-9-]*)\s*:(.*)$/);
|
|
1364
1719
|
if (n) {
|
|
@@ -1422,7 +1777,7 @@ function ce(e) {
|
|
|
1422
1777
|
}
|
|
1423
1778
|
return null;
|
|
1424
1779
|
}
|
|
1425
|
-
function
|
|
1780
|
+
function mt(e) {
|
|
1426
1781
|
if (e.startsWith("[") && e.endsWith("]")) {
|
|
1427
1782
|
const r = e.slice(1, -1);
|
|
1428
1783
|
return r.includes("&") ? r : e;
|
|
@@ -1434,10 +1789,10 @@ function st(e) {
|
|
|
1434
1789
|
}
|
|
1435
1790
|
return null;
|
|
1436
1791
|
}
|
|
1437
|
-
function
|
|
1792
|
+
function yt(e) {
|
|
1438
1793
|
return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, "\\$1");
|
|
1439
1794
|
}
|
|
1440
|
-
function
|
|
1795
|
+
function bt(e) {
|
|
1441
1796
|
const t = /class\s*=\s*(['"])(.*?)\1/g, r = [];
|
|
1442
1797
|
let i;
|
|
1443
1798
|
for (; i = t.exec(e); ) {
|
|
@@ -1446,32 +1801,32 @@ function at(e) {
|
|
|
1446
1801
|
}
|
|
1447
1802
|
return r.filter(Boolean);
|
|
1448
1803
|
}
|
|
1449
|
-
const
|
|
1450
|
-
function
|
|
1451
|
-
const t = Date.now(), r =
|
|
1452
|
-
if (r && t - r.timestamp <
|
|
1453
|
-
const i =
|
|
1454
|
-
function d
|
|
1455
|
-
const
|
|
1456
|
-
if (
|
|
1457
|
-
const x =
|
|
1458
|
-
return u[
|
|
1459
|
-
}
|
|
1460
|
-
function
|
|
1461
|
-
const
|
|
1462
|
-
return
|
|
1463
|
-
}
|
|
1464
|
-
function
|
|
1465
|
-
const
|
|
1466
|
-
let
|
|
1467
|
-
for (let
|
|
1468
|
-
const
|
|
1469
|
-
|
|
1470
|
-
}
|
|
1471
|
-
return
|
|
1472
|
-
}
|
|
1473
|
-
function
|
|
1474
|
-
switch (
|
|
1804
|
+
const Be = /* @__PURE__ */ new Map(), wt = 16;
|
|
1805
|
+
function xt(e) {
|
|
1806
|
+
const t = Date.now(), r = Be.get(e);
|
|
1807
|
+
if (r && t - r.timestamp < wt) return r.css;
|
|
1808
|
+
const i = bt(e), n = new Set(i), s = [], o = [], a = [], c = [], u = {};
|
|
1809
|
+
function m(d, g = !1) {
|
|
1810
|
+
const y = (g ? "dark|" : "") + d;
|
|
1811
|
+
if (y in u) return u[y];
|
|
1812
|
+
const x = w(d, g);
|
|
1813
|
+
return u[y] = x, x;
|
|
1814
|
+
}
|
|
1815
|
+
function T(d) {
|
|
1816
|
+
const g = d.some((x) => $e.includes(x)), y = d.includes("dark");
|
|
1817
|
+
return d.length === 0 ? 1 : !g && !y ? 2 : g && !y ? 3 : 4;
|
|
1818
|
+
}
|
|
1819
|
+
function p(d) {
|
|
1820
|
+
const g = [];
|
|
1821
|
+
let y = "", x = 0, f = 0;
|
|
1822
|
+
for (let b = 0; b < d.length; b++) {
|
|
1823
|
+
const h = d[b];
|
|
1824
|
+
h === "[" ? x++ : h === "]" && x > 0 ? x-- : h === "(" ? f++ : h === ")" && f > 0 && f--, h === ":" && x === 0 && f === 0 ? (g.push(y), y = "") : y += h;
|
|
1825
|
+
}
|
|
1826
|
+
return y && g.push(y), g;
|
|
1827
|
+
}
|
|
1828
|
+
function l(d) {
|
|
1829
|
+
switch (d) {
|
|
1475
1830
|
case "hover":
|
|
1476
1831
|
return ":hover";
|
|
1477
1832
|
case "focus":
|
|
@@ -1500,132 +1855,132 @@ function lt(e) {
|
|
|
1500
1855
|
return null;
|
|
1501
1856
|
}
|
|
1502
1857
|
}
|
|
1503
|
-
function
|
|
1504
|
-
const
|
|
1858
|
+
function w(d, g = !1) {
|
|
1859
|
+
const y = p(d);
|
|
1505
1860
|
let x = !1;
|
|
1506
|
-
const
|
|
1507
|
-
if (!
|
|
1508
|
-
const
|
|
1509
|
-
if (!
|
|
1510
|
-
const _ =
|
|
1511
|
-
let
|
|
1512
|
-
|
|
1513
|
-
const
|
|
1514
|
-
let
|
|
1515
|
-
const
|
|
1516
|
-
for (const
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
const X = [],
|
|
1520
|
-
let
|
|
1521
|
-
for (const
|
|
1522
|
-
if (
|
|
1523
|
-
const
|
|
1524
|
-
if (
|
|
1525
|
-
|
|
1861
|
+
const f = y.find((k) => (k.startsWith("!") && (x = !0, k = k.slice(1)), _e[k] || Se(k) || Ae(k) || Ce(k) || me(k)));
|
|
1862
|
+
if (!f) return null;
|
|
1863
|
+
const b = f.replace(/^!/, ""), h = _e[b] ?? Se(b) ?? Ae(b) ?? Ce(b) ?? me(b);
|
|
1864
|
+
if (!h) return null;
|
|
1865
|
+
const _ = y.indexOf(f);
|
|
1866
|
+
let $ = _ >= 0 ? y.slice(0, _) : [];
|
|
1867
|
+
g && ($ = $.filter((k) => k !== "dark"));
|
|
1868
|
+
const S = `.${yt(d)}`, E = "__SUBJECT__", C = x ? h.replace(/;$/, " !important;") : h;
|
|
1869
|
+
let A = E;
|
|
1870
|
+
const P = [];
|
|
1871
|
+
for (const k of $)
|
|
1872
|
+
k.startsWith("group-") ? (A = `.group:${k.slice(6)} ${A}`, P.push(k)) : k.startsWith("peer-") && (A = A.replace(E, `.peer:${k.slice(5)}~${E}`), P.push(k));
|
|
1873
|
+
$ = $.filter((k) => !P.includes(k));
|
|
1874
|
+
const X = [], ie = [];
|
|
1875
|
+
let M = null;
|
|
1876
|
+
for (const k of $) {
|
|
1877
|
+
if (k === "dark" || $e.includes(k)) continue;
|
|
1878
|
+
const W = mt(k);
|
|
1879
|
+
if (W) {
|
|
1880
|
+
M = W;
|
|
1526
1881
|
continue;
|
|
1527
1882
|
}
|
|
1528
|
-
const
|
|
1529
|
-
if (
|
|
1530
|
-
|
|
1883
|
+
const R = l(k);
|
|
1884
|
+
if (R) {
|
|
1885
|
+
M ? ie.push(R) : X.push(R);
|
|
1531
1886
|
continue;
|
|
1532
1887
|
}
|
|
1533
|
-
const
|
|
1534
|
-
typeof
|
|
1535
|
-
}
|
|
1536
|
-
function
|
|
1537
|
-
if (!
|
|
1538
|
-
let
|
|
1539
|
-
if (
|
|
1540
|
-
let
|
|
1541
|
-
for (;
|
|
1542
|
-
for (;
|
|
1543
|
-
const
|
|
1544
|
-
if (
|
|
1545
|
-
return
|
|
1888
|
+
const B = pt[k];
|
|
1889
|
+
typeof B == "function" && (A = B(A, C).split("{")[0]);
|
|
1890
|
+
}
|
|
1891
|
+
function F(k, W) {
|
|
1892
|
+
if (!W) return k;
|
|
1893
|
+
let R = 0, B = 0;
|
|
1894
|
+
if (k.length && (k[0] === ">" || k[0] === "+" || k[0] === "~" || k[0] === " ")) {
|
|
1895
|
+
let j = 1;
|
|
1896
|
+
for (; j < k.length && k[j] === " "; ) j++;
|
|
1897
|
+
for (; j < k.length; j++) {
|
|
1898
|
+
const L = k[j];
|
|
1899
|
+
if (L === "[" ? R++ : L === "]" && R > 0 ? R-- : L === "(" ? B++ : L === ")" && B > 0 && B--, R === 0 && B === 0 && (k[j] === ">" || k[j] === "+" || k[j] === "~" || k[j] === " "))
|
|
1900
|
+
return k.slice(0, j) + W + k.slice(j);
|
|
1546
1901
|
}
|
|
1547
|
-
return
|
|
1902
|
+
return k + W;
|
|
1548
1903
|
}
|
|
1549
|
-
for (let
|
|
1550
|
-
const
|
|
1551
|
-
if (
|
|
1552
|
-
return
|
|
1904
|
+
for (let j = 0; j < k.length; j++) {
|
|
1905
|
+
const L = k[j];
|
|
1906
|
+
if (L === "[" ? R++ : L === "]" && R > 0 ? R-- : L === "(" ? B++ : L === ")" && B > 0 && B--, R === 0 && B === 0 && (L === ">" || L === "+" || L === "~" || L === " "))
|
|
1907
|
+
return k.slice(0, j) + W + k.slice(j);
|
|
1553
1908
|
}
|
|
1554
|
-
return
|
|
1909
|
+
return k + W;
|
|
1555
1910
|
}
|
|
1556
|
-
const
|
|
1557
|
-
if (
|
|
1558
|
-
if (
|
|
1559
|
-
const
|
|
1911
|
+
const H = X.join(""), N = ie.join("");
|
|
1912
|
+
if (M)
|
|
1913
|
+
if (M.includes("&")) {
|
|
1914
|
+
const k = M.indexOf("&"), W = M.slice(0, k), R = M.slice(k + 1), B = E + H, j = A;
|
|
1560
1915
|
if (X.length === 0)
|
|
1561
|
-
|
|
1916
|
+
A = j.replace(E, W + B + N + R);
|
|
1562
1917
|
else {
|
|
1563
|
-
const
|
|
1564
|
-
|
|
1918
|
+
const L = F(R, N);
|
|
1919
|
+
A = j.replace(E, W + B + L);
|
|
1565
1920
|
}
|
|
1566
1921
|
} else
|
|
1567
|
-
|
|
1922
|
+
A = A.replace(E, `${M}${E + H}`), N && (A = A.replace(E, `${E}${N}`));
|
|
1568
1923
|
else
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
let
|
|
1572
|
-
const
|
|
1573
|
-
return
|
|
1574
|
-
}
|
|
1575
|
-
for (const
|
|
1576
|
-
const
|
|
1577
|
-
(
|
|
1924
|
+
A = E + H + N;
|
|
1925
|
+
A = A.replace(new RegExp(E, "g"), S);
|
|
1926
|
+
let I = `${A}{${C}}`;
|
|
1927
|
+
const z = $.filter((k) => $e.includes(k)), J = z.length ? z[z.length - 1] : null, se = $.includes("dark");
|
|
1928
|
+
return g && J ? I = `@media (prefers-color-scheme: dark) and ${Ee[J]}{${I}}` : g ? I = `@media (prefers-color-scheme: dark){${I}}` : se && J ? I = `@media (prefers-color-scheme: dark) and ${Ee[J]}{${I}}` : se ? I = `@media (prefers-color-scheme: dark){${I}}` : J && (I = `@media ${Ee[J]}{${I}}`), I;
|
|
1929
|
+
}
|
|
1930
|
+
for (const d of n) {
|
|
1931
|
+
const g = p(d), y = g.find(
|
|
1932
|
+
(h) => _e[h] || Se(h) || Ae(h) || Ce(h) || me(h)
|
|
1578
1933
|
);
|
|
1579
|
-
if (!
|
|
1580
|
-
const x =
|
|
1581
|
-
if (
|
|
1582
|
-
const
|
|
1583
|
-
|
|
1934
|
+
if (!y) continue;
|
|
1935
|
+
const x = g.indexOf(y), f = x >= 0 ? g.slice(0, x) : [], b = T(f);
|
|
1936
|
+
if (b === 4) {
|
|
1937
|
+
const h = m(d, !0);
|
|
1938
|
+
h && c.push(h);
|
|
1584
1939
|
} else {
|
|
1585
|
-
const
|
|
1586
|
-
|
|
1940
|
+
const h = m(d);
|
|
1941
|
+
h && (b === 1 ? s.push(h) : b === 2 ? o.push(h) : b === 3 && a.push(h));
|
|
1587
1942
|
}
|
|
1588
1943
|
}
|
|
1589
|
-
const
|
|
1590
|
-
return
|
|
1944
|
+
const v = [...s, ...o, ...a, ...c].join("");
|
|
1945
|
+
return Be.set(e, { css: v, timestamp: t }), v;
|
|
1591
1946
|
}
|
|
1592
|
-
const
|
|
1593
|
-
function
|
|
1947
|
+
const ce = [];
|
|
1948
|
+
function vt(e, t, r, i, n, s, o, a) {
|
|
1594
1949
|
if (e) {
|
|
1595
|
-
|
|
1950
|
+
ce.push(r);
|
|
1596
1951
|
try {
|
|
1597
1952
|
if (t.loadingTemplate && r.isLoading) {
|
|
1598
|
-
|
|
1953
|
+
re(e, t.loadingTemplate(r), r, i, n);
|
|
1599
1954
|
return;
|
|
1600
1955
|
}
|
|
1601
1956
|
if (t.errorTemplate && r.hasError) {
|
|
1602
|
-
r.error instanceof Error &&
|
|
1957
|
+
r.error instanceof Error && re(e, t.errorTemplate(r.error, r), r, i, n);
|
|
1603
1958
|
return;
|
|
1604
1959
|
}
|
|
1605
|
-
const
|
|
1606
|
-
if (
|
|
1607
|
-
s(!0),
|
|
1608
|
-
s(!1), o(null),
|
|
1960
|
+
const c = t.render(r);
|
|
1961
|
+
if (c instanceof Promise) {
|
|
1962
|
+
s(!0), c.then((u) => {
|
|
1963
|
+
s(!1), o(null), re(e, u, r, i, n), a(e.innerHTML);
|
|
1609
1964
|
}).catch((u) => {
|
|
1610
|
-
s(!1), o(u), t.errorTemplate &&
|
|
1611
|
-
}), t.loadingTemplate &&
|
|
1965
|
+
s(!1), o(u), t.errorTemplate && re(e, t.errorTemplate(u, r), r, i, n);
|
|
1966
|
+
}), t.loadingTemplate && re(e, t.loadingTemplate(r), r, i, n);
|
|
1612
1967
|
return;
|
|
1613
1968
|
}
|
|
1614
|
-
|
|
1969
|
+
re(e, c, r, i, n), a(e.innerHTML);
|
|
1615
1970
|
} finally {
|
|
1616
|
-
|
|
1971
|
+
ce.pop();
|
|
1617
1972
|
}
|
|
1618
1973
|
}
|
|
1619
1974
|
}
|
|
1620
|
-
function
|
|
1621
|
-
e && (
|
|
1975
|
+
function re(e, t, r, i, n) {
|
|
1976
|
+
e && (at(
|
|
1622
1977
|
e,
|
|
1623
1978
|
Array.isArray(t) ? t : [t],
|
|
1624
1979
|
r,
|
|
1625
1980
|
i
|
|
1626
1981
|
), n(e.innerHTML));
|
|
1627
1982
|
}
|
|
1628
|
-
function
|
|
1983
|
+
function kt(e, t, r, i, n, s, o) {
|
|
1629
1984
|
if (s !== null && clearTimeout(s), Date.now() - t < 16) {
|
|
1630
1985
|
if (n(r + 1), r > 10) {
|
|
1631
1986
|
o(null);
|
|
@@ -1633,38 +1988,73 @@ function ut(e, t, r, i, n, s, o) {
|
|
|
1633
1988
|
}
|
|
1634
1989
|
} else
|
|
1635
1990
|
n(0);
|
|
1636
|
-
const
|
|
1991
|
+
const c = setTimeout(() => {
|
|
1637
1992
|
i(Date.now()), e(), o(null);
|
|
1638
1993
|
}, 0);
|
|
1639
|
-
o(
|
|
1994
|
+
o(c);
|
|
1640
1995
|
}
|
|
1641
|
-
function
|
|
1996
|
+
function _t(e, t, r, i, n, s) {
|
|
1642
1997
|
if (!e) return;
|
|
1643
|
-
const o =
|
|
1998
|
+
const o = xt(i);
|
|
1644
1999
|
if (!t.style && (!o || o.trim() === "")) {
|
|
1645
|
-
s(null), e.adoptedStyleSheets = [
|
|
2000
|
+
s(null), e.adoptedStyleSheets = [Oe()];
|
|
1646
2001
|
return;
|
|
1647
2002
|
}
|
|
1648
2003
|
let a = "";
|
|
1649
2004
|
t.style && (typeof t.style == "string" ? a = t.style : typeof t.style == "function" && (a = t.style(r)));
|
|
1650
|
-
let
|
|
2005
|
+
let c = ct(`${a}
|
|
1651
2006
|
${o}
|
|
1652
2007
|
`);
|
|
1653
|
-
|
|
2008
|
+
c = Fe(c);
|
|
1654
2009
|
let u = n;
|
|
1655
|
-
u || (u = new CSSStyleSheet()), (u.cssRules.length === 0 || u.toString() !==
|
|
2010
|
+
u || (u = new CSSStyleSheet()), (u.cssRules.length === 0 || u.toString() !== c) && u.replaceSync(c), e.adoptedStyleSheets = [Oe(), u], s(u);
|
|
1656
2011
|
}
|
|
1657
|
-
|
|
2012
|
+
class Et {
|
|
2013
|
+
pendingUpdates = /* @__PURE__ */ new Map();
|
|
2014
|
+
isFlushScheduled = !1;
|
|
2015
|
+
/**
|
|
2016
|
+
* Schedule an update to be executed in the next microtask
|
|
2017
|
+
* Uses component identity to deduplicate multiple render requests for the same component
|
|
2018
|
+
*/
|
|
2019
|
+
schedule(t, r) {
|
|
2020
|
+
const i = r || t.toString();
|
|
2021
|
+
this.pendingUpdates.set(i, t), this.isFlushScheduled || (this.isFlushScheduled = !0, typeof globalThis.process < "u" && globalThis.process.env?.NODE_ENV === "test" || typeof window < "u" && (window.__vitest__ || window.Cypress) ? this.flush() : queueMicrotask(() => this.flush()));
|
|
2022
|
+
}
|
|
2023
|
+
/**
|
|
2024
|
+
* Execute all pending updates
|
|
2025
|
+
*/
|
|
2026
|
+
flush() {
|
|
2027
|
+
const t = Array.from(this.pendingUpdates.values());
|
|
2028
|
+
this.pendingUpdates.clear(), this.isFlushScheduled = !1;
|
|
2029
|
+
for (const r of t)
|
|
2030
|
+
try {
|
|
2031
|
+
r();
|
|
2032
|
+
} catch (i) {
|
|
2033
|
+
typeof console < "u" && console.error && console.error("Error in batched update:", i);
|
|
2034
|
+
}
|
|
2035
|
+
}
|
|
2036
|
+
/**
|
|
2037
|
+
* Get the number of pending updates
|
|
2038
|
+
*/
|
|
2039
|
+
get pendingCount() {
|
|
2040
|
+
return this.pendingUpdates.size;
|
|
2041
|
+
}
|
|
2042
|
+
}
|
|
2043
|
+
const $t = new Et();
|
|
2044
|
+
function oe(e, t) {
|
|
2045
|
+
$t.schedule(e, t);
|
|
2046
|
+
}
|
|
2047
|
+
const be = /* @__PURE__ */ new Map(), We = Symbol.for("cer.registry");
|
|
1658
2048
|
if (typeof window < "u") {
|
|
1659
2049
|
const e = globalThis;
|
|
1660
|
-
e[
|
|
2050
|
+
e[We] || (e[We] = be);
|
|
1661
2051
|
}
|
|
1662
|
-
function
|
|
1663
|
-
let i =
|
|
2052
|
+
function Ie(e, t, r) {
|
|
2053
|
+
let i = Q(e);
|
|
1664
2054
|
i.includes("-") || (i = `cer-${i}`);
|
|
1665
2055
|
let n;
|
|
1666
2056
|
typeof t == "function" ? n = { ...r, render: t } : n = t, typeof n.onError != "function" && (n.onError = (s, o) => {
|
|
1667
|
-
|
|
2057
|
+
Y(`[${i}] Error:`, s, o);
|
|
1668
2058
|
});
|
|
1669
2059
|
try {
|
|
1670
2060
|
const s = /* @__PURE__ */ new Set([
|
|
@@ -1683,15 +2073,15 @@ function je(e, t, r) {
|
|
|
1683
2073
|
s.has(a) && o.push(a);
|
|
1684
2074
|
}), o.length > 0) {
|
|
1685
2075
|
const a = Array.from(new Set(o));
|
|
1686
|
-
|
|
2076
|
+
pe(
|
|
1687
2077
|
`[${i}] Reserved runtime context keys used in component config: ${a.join(", ")}. These names are provided by the runtime (for example: refs, error, emit). Rename your state/prop/computed keys (e.g. 'error' -> 'errorMessage') to avoid collisions and TypeScript type conflicts.`
|
|
1688
2078
|
);
|
|
1689
2079
|
}
|
|
1690
2080
|
} catch {
|
|
1691
2081
|
}
|
|
1692
|
-
if (
|
|
2082
|
+
if (be.set(i, n), typeof window < "u")
|
|
1693
2083
|
if (!customElements.get(i))
|
|
1694
|
-
customElements.define(i,
|
|
2084
|
+
customElements.define(i, St(i, n));
|
|
1695
2085
|
else
|
|
1696
2086
|
try {
|
|
1697
2087
|
document.querySelectorAll(i).forEach((s) => {
|
|
@@ -1703,7 +2093,7 @@ function je(e, t, r) {
|
|
|
1703
2093
|
} catch {
|
|
1704
2094
|
}
|
|
1705
2095
|
}
|
|
1706
|
-
function
|
|
2096
|
+
function St(e, t) {
|
|
1707
2097
|
if (!t.render)
|
|
1708
2098
|
throw new Error(
|
|
1709
2099
|
"Component must have a render function"
|
|
@@ -1721,6 +2111,7 @@ function pt(e, t) {
|
|
|
1721
2111
|
_mounted = !1;
|
|
1722
2112
|
_hasError = !1;
|
|
1723
2113
|
_initializing = !0;
|
|
2114
|
+
_componentId;
|
|
1724
2115
|
_styleSheet = null;
|
|
1725
2116
|
_lastHtmlStringForJitCSS = "";
|
|
1726
2117
|
/**
|
|
@@ -1747,7 +2138,7 @@ function pt(e, t) {
|
|
|
1747
2138
|
_templateLoading = !1;
|
|
1748
2139
|
_templateError = null;
|
|
1749
2140
|
constructor() {
|
|
1750
|
-
super(), this.attachShadow({ mode: "open" }), this._cfg =
|
|
2141
|
+
super(), this.attachShadow({ mode: "open" }), this._cfg = be.get(e) || t, this._componentId = `${e}-${Math.random().toString(36).substr(2, 9)}`;
|
|
1751
2142
|
const r = this._initContext(t);
|
|
1752
2143
|
Object.defineProperty(r, "refs", {
|
|
1753
2144
|
value: this._refs,
|
|
@@ -1759,6 +2150,16 @@ function pt(e, t) {
|
|
|
1759
2150
|
writable: !1,
|
|
1760
2151
|
enumerable: !1,
|
|
1761
2152
|
configurable: !1
|
|
2153
|
+
}), Object.defineProperty(r, "_requestRender", {
|
|
2154
|
+
value: () => this._requestRender(),
|
|
2155
|
+
writable: !1,
|
|
2156
|
+
enumerable: !1,
|
|
2157
|
+
configurable: !1
|
|
2158
|
+
}), Object.defineProperty(r, "_triggerWatchers", {
|
|
2159
|
+
value: (n, s) => this._triggerWatchers(n, s),
|
|
2160
|
+
writable: !1,
|
|
2161
|
+
enumerable: !1,
|
|
2162
|
+
configurable: !1
|
|
1762
2163
|
}), this.context = r, Object.defineProperty(this.context, "emit", {
|
|
1763
2164
|
value: (n, s, o) => {
|
|
1764
2165
|
const a = new CustomEvent(n, {
|
|
@@ -1773,15 +2174,28 @@ function pt(e, t) {
|
|
|
1773
2174
|
enumerable: !1,
|
|
1774
2175
|
configurable: !1
|
|
1775
2176
|
});
|
|
1776
|
-
const i =
|
|
2177
|
+
const i = be.get(e) || t;
|
|
1777
2178
|
Object.keys(i).forEach((n) => {
|
|
1778
2179
|
const s = i[n];
|
|
1779
2180
|
typeof s == "function" && (this.context[n] = (...o) => s(...o, this.context));
|
|
1780
|
-
}), this._applyComputed(i),
|
|
2181
|
+
}), this._applyComputed(i), i.props && Object.keys(i.props).forEach((n) => {
|
|
2182
|
+
let s = this[n];
|
|
2183
|
+
Object.defineProperty(this, n, {
|
|
2184
|
+
get() {
|
|
2185
|
+
return s;
|
|
2186
|
+
},
|
|
2187
|
+
set(o) {
|
|
2188
|
+
const a = s;
|
|
2189
|
+
s = o, this.context[n] = o, this._initializing || (this._applyProps(i), a !== o && this._requestRender());
|
|
2190
|
+
},
|
|
2191
|
+
enumerable: !0,
|
|
2192
|
+
configurable: !0
|
|
2193
|
+
});
|
|
2194
|
+
}), this._initializing = !1, this._initWatchers(i), this._render(i);
|
|
1781
2195
|
}
|
|
1782
2196
|
connectedCallback() {
|
|
1783
2197
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1784
|
-
this._applyProps(t),
|
|
2198
|
+
this._applyProps(t), Qe(
|
|
1785
2199
|
t,
|
|
1786
2200
|
this.context,
|
|
1787
2201
|
this._mounted,
|
|
@@ -1793,7 +2207,7 @@ function pt(e, t) {
|
|
|
1793
2207
|
}
|
|
1794
2208
|
disconnectedCallback() {
|
|
1795
2209
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1796
|
-
|
|
2210
|
+
Xe(
|
|
1797
2211
|
t,
|
|
1798
2212
|
this.context,
|
|
1799
2213
|
this._listeners,
|
|
@@ -1817,7 +2231,7 @@ function pt(e, t) {
|
|
|
1817
2231
|
}
|
|
1818
2232
|
attributeChangedCallback(r, i, n) {
|
|
1819
2233
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1820
|
-
this._applyProps(t),
|
|
2234
|
+
this._applyProps(t), et(
|
|
1821
2235
|
t,
|
|
1822
2236
|
r,
|
|
1823
2237
|
i,
|
|
@@ -1827,7 +2241,7 @@ function pt(e, t) {
|
|
|
1827
2241
|
});
|
|
1828
2242
|
}
|
|
1829
2243
|
static get observedAttributes() {
|
|
1830
|
-
return t.props ? Object.keys(t.props).map(
|
|
2244
|
+
return t.props ? Object.keys(t.props).map(Q) : [];
|
|
1831
2245
|
}
|
|
1832
2246
|
_applyComputed(r) {
|
|
1833
2247
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
@@ -1835,7 +2249,7 @@ function pt(e, t) {
|
|
|
1835
2249
|
Object.defineProperty(this.context, i, {
|
|
1836
2250
|
get: () => {
|
|
1837
2251
|
const s = n(this.context);
|
|
1838
|
-
return
|
|
2252
|
+
return Z(s);
|
|
1839
2253
|
},
|
|
1840
2254
|
enumerable: !0
|
|
1841
2255
|
});
|
|
@@ -1845,7 +2259,7 @@ function pt(e, t) {
|
|
|
1845
2259
|
// --- Render ---
|
|
1846
2260
|
_render(r) {
|
|
1847
2261
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
1848
|
-
|
|
2262
|
+
vt(
|
|
1849
2263
|
this.shadowRoot,
|
|
1850
2264
|
r,
|
|
1851
2265
|
this.context,
|
|
@@ -1868,27 +2282,29 @@ function pt(e, t) {
|
|
|
1868
2282
|
}
|
|
1869
2283
|
_requestRender() {
|
|
1870
2284
|
this._runLogicWithinErrorBoundary(this._cfg, () => {
|
|
1871
|
-
|
|
1872
|
-
(
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
2285
|
+
oe(() => {
|
|
2286
|
+
kt(
|
|
2287
|
+
() => this._render(this._cfg),
|
|
2288
|
+
this._lastRenderTime,
|
|
2289
|
+
this._renderCount,
|
|
2290
|
+
(r) => {
|
|
2291
|
+
this._lastRenderTime = r;
|
|
2292
|
+
},
|
|
2293
|
+
(r) => {
|
|
2294
|
+
this._renderCount = r;
|
|
2295
|
+
},
|
|
2296
|
+
this._renderTimeoutId,
|
|
2297
|
+
(r) => {
|
|
2298
|
+
this._renderTimeoutId = r;
|
|
2299
|
+
}
|
|
2300
|
+
);
|
|
2301
|
+
}, this._componentId);
|
|
1886
2302
|
});
|
|
1887
2303
|
}
|
|
1888
2304
|
// --- Style ---
|
|
1889
2305
|
_applyStyle(r, i) {
|
|
1890
2306
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
1891
|
-
|
|
2307
|
+
_t(
|
|
1892
2308
|
this.shadowRoot,
|
|
1893
2309
|
r,
|
|
1894
2310
|
this.context,
|
|
@@ -1917,9 +2333,9 @@ function pt(e, t) {
|
|
|
1917
2333
|
try {
|
|
1918
2334
|
let i = function(s, o = "") {
|
|
1919
2335
|
return Array.isArray(s) ? new Proxy(s, {
|
|
1920
|
-
get(a,
|
|
1921
|
-
const
|
|
1922
|
-
return typeof
|
|
2336
|
+
get(a, c, u) {
|
|
2337
|
+
const m = Reflect.get(a, c, u);
|
|
2338
|
+
return typeof m == "function" && typeof c == "string" && [
|
|
1923
2339
|
"push",
|
|
1924
2340
|
"pop",
|
|
1925
2341
|
"shift",
|
|
@@ -1927,42 +2343,42 @@ function pt(e, t) {
|
|
|
1927
2343
|
"splice",
|
|
1928
2344
|
"sort",
|
|
1929
2345
|
"reverse"
|
|
1930
|
-
].includes(
|
|
1931
|
-
const
|
|
2346
|
+
].includes(c) ? function(...p) {
|
|
2347
|
+
const l = m.apply(a, p);
|
|
1932
2348
|
if (!n._initializing) {
|
|
1933
|
-
const
|
|
1934
|
-
n._triggerWatchers(
|
|
2349
|
+
const w = o || "root";
|
|
2350
|
+
n._triggerWatchers(w, a), oe(() => n._render(r), n._componentId);
|
|
1935
2351
|
}
|
|
1936
|
-
return
|
|
1937
|
-
} :
|
|
2352
|
+
return l;
|
|
2353
|
+
} : m;
|
|
1938
2354
|
},
|
|
1939
|
-
set(a,
|
|
1940
|
-
if (a[
|
|
1941
|
-
const
|
|
1942
|
-
n._triggerWatchers(
|
|
2355
|
+
set(a, c, u) {
|
|
2356
|
+
if (a[c] = u, !n._initializing) {
|
|
2357
|
+
const m = o ? `${o}.${String(c)}` : String(c);
|
|
2358
|
+
n._triggerWatchers(m, u), oe(() => n._render(r), n._componentId);
|
|
1943
2359
|
}
|
|
1944
2360
|
return !0;
|
|
1945
2361
|
},
|
|
1946
|
-
deleteProperty(a,
|
|
1947
|
-
if (delete a[
|
|
1948
|
-
const u = o ? `${o}.${String(
|
|
1949
|
-
n._triggerWatchers(u, void 0), n._render(r);
|
|
2362
|
+
deleteProperty(a, c) {
|
|
2363
|
+
if (delete a[c], !n._initializing) {
|
|
2364
|
+
const u = o ? `${o}.${String(c)}` : String(c);
|
|
2365
|
+
n._triggerWatchers(u, void 0), oe(() => n._render(r), n._componentId);
|
|
1950
2366
|
}
|
|
1951
2367
|
return !0;
|
|
1952
2368
|
}
|
|
1953
2369
|
}) : s && typeof s == "object" ? (Object.keys(s).forEach((a) => {
|
|
1954
|
-
const
|
|
1955
|
-
s[a] = i(s[a],
|
|
2370
|
+
const c = o ? `${o}.${a}` : a;
|
|
2371
|
+
s[a] = i(s[a], c);
|
|
1956
2372
|
}), new Proxy(s, {
|
|
1957
|
-
set(a,
|
|
1958
|
-
const
|
|
1959
|
-
return a[
|
|
1960
|
-
|
|
1961
|
-
a[
|
|
1962
|
-
), n._render(r)), !0;
|
|
2373
|
+
set(a, c, u) {
|
|
2374
|
+
const m = o ? `${o}.${String(c)}` : String(c);
|
|
2375
|
+
return a[c] = i(u, m), n._initializing || (n._triggerWatchers(
|
|
2376
|
+
m,
|
|
2377
|
+
a[c]
|
|
2378
|
+
), oe(() => n._render(r), n._componentId)), !0;
|
|
1963
2379
|
},
|
|
1964
|
-
get(a,
|
|
1965
|
-
return Reflect.get(a,
|
|
2380
|
+
get(a, c, u) {
|
|
2381
|
+
return Reflect.get(a, c, u);
|
|
1966
2382
|
}
|
|
1967
2383
|
})) : s;
|
|
1968
2384
|
};
|
|
@@ -1974,7 +2390,7 @@ function pt(e, t) {
|
|
|
1974
2390
|
}
|
|
1975
2391
|
_initWatchers(r) {
|
|
1976
2392
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
1977
|
-
|
|
2393
|
+
Ge(
|
|
1978
2394
|
this.context,
|
|
1979
2395
|
this._watchers,
|
|
1980
2396
|
r.watch || {}
|
|
@@ -1982,12 +2398,12 @@ function pt(e, t) {
|
|
|
1982
2398
|
});
|
|
1983
2399
|
}
|
|
1984
2400
|
_triggerWatchers(r, i) {
|
|
1985
|
-
|
|
2401
|
+
Ze(this.context, this._watchers, r, i);
|
|
1986
2402
|
}
|
|
1987
2403
|
_applyProps(r) {
|
|
1988
2404
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
1989
2405
|
try {
|
|
1990
|
-
|
|
2406
|
+
Ye(this, r, this.context);
|
|
1991
2407
|
} catch (i) {
|
|
1992
2408
|
this._hasError = !0, r.onError && r.onError(i, this.context), r.errorFallback && this.shadowRoot && (this.shadowRoot.innerHTML = r.errorFallback(i, this.context));
|
|
1993
2409
|
}
|
|
@@ -1995,103 +2411,109 @@ function pt(e, t) {
|
|
|
1995
2411
|
}
|
|
1996
2412
|
};
|
|
1997
2413
|
}
|
|
1998
|
-
function
|
|
2414
|
+
function ae(e, t = {}, r, i) {
|
|
1999
2415
|
const n = i ?? t.key;
|
|
2000
2416
|
return { tag: e, key: n, props: t, children: r };
|
|
2001
2417
|
}
|
|
2002
|
-
function
|
|
2418
|
+
function ye(e) {
|
|
2003
2419
|
return !!e && typeof e == "object" && (e.type === "AnchorBlock" || e.tag === "#anchor");
|
|
2004
2420
|
}
|
|
2005
|
-
function
|
|
2006
|
-
return typeof e == "object" && e !== null && "tag" in e && !
|
|
2421
|
+
function de(e) {
|
|
2422
|
+
return typeof e == "object" && e !== null && "tag" in e && !ye(e);
|
|
2007
2423
|
}
|
|
2008
|
-
function
|
|
2424
|
+
function Ct(e, t) {
|
|
2009
2425
|
return e.key != null ? e : { ...e, key: t };
|
|
2010
2426
|
}
|
|
2011
|
-
function
|
|
2012
|
-
const i = {}, n = {}, s = {}, o = /([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;
|
|
2013
|
-
let
|
|
2014
|
-
for (;
|
|
2015
|
-
const
|
|
2016
|
-
let
|
|
2017
|
-
|
|
2018
|
-
const
|
|
2019
|
-
if (
|
|
2020
|
-
const [
|
|
2021
|
-
if (
|
|
2022
|
-
const
|
|
2023
|
-
s[
|
|
2024
|
-
value:
|
|
2025
|
-
modifiers:
|
|
2026
|
-
arg:
|
|
2427
|
+
function At(e, t = [], r = {}) {
|
|
2428
|
+
const i = {}, n = {}, s = {}, o = [], a = /([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;
|
|
2429
|
+
let c;
|
|
2430
|
+
for (; c = a.exec(e); ) {
|
|
2431
|
+
const u = c[1], m = c[2], T = (c[4] || c[6]) ?? "", p = T.match(/^{{(\d+)}}$/);
|
|
2432
|
+
let l = p ? t[Number(p[1])] ?? null : T;
|
|
2433
|
+
p || (l === "true" ? l = !0 : l === "false" ? l = !1 : l === "null" ? l = null : isNaN(Number(l)) || (l = Number(l)));
|
|
2434
|
+
const w = ["model", "bind", "show", "class", "style"];
|
|
2435
|
+
if (u === ":") {
|
|
2436
|
+
const [v, d] = m.split(":"), [g, ...y] = v.split(".");
|
|
2437
|
+
if (w.includes(g)) {
|
|
2438
|
+
const x = [...y], f = g === "model" && d ? `model:${d}` : g;
|
|
2439
|
+
s[f] = {
|
|
2440
|
+
value: l,
|
|
2441
|
+
modifiers: x,
|
|
2442
|
+
arg: d
|
|
2027
2443
|
};
|
|
2028
2444
|
} else
|
|
2029
|
-
n[
|
|
2030
|
-
} else if (
|
|
2031
|
-
const
|
|
2032
|
-
|
|
2033
|
-
|
|
2445
|
+
n[m] = l, o.push(m);
|
|
2446
|
+
} else if (u === "@") {
|
|
2447
|
+
const [v, ...d] = m.split("."), g = d, y = typeof l == "function" ? l : typeof r[l] == "function" ? r[l] : void 0;
|
|
2448
|
+
if (y) {
|
|
2449
|
+
const x = (b) => {
|
|
2450
|
+
if (g.includes("prevent") && b.preventDefault(), g.includes("stop") && b.stopPropagation(), !(g.includes("self") && b.target !== b.currentTarget))
|
|
2451
|
+
return g.includes("once") && b.currentTarget?.removeEventListener(v, x), y(b);
|
|
2452
|
+
}, f = "on" + v.charAt(0).toUpperCase() + v.slice(1);
|
|
2453
|
+
i[f] = x;
|
|
2454
|
+
}
|
|
2455
|
+
} else m === "ref" ? i.ref = l : n[m] = l;
|
|
2034
2456
|
}
|
|
2035
|
-
return { props: i, attrs: n, directives: s };
|
|
2457
|
+
return { props: i, attrs: n, directives: s, bound: o };
|
|
2036
2458
|
}
|
|
2037
|
-
function
|
|
2038
|
-
const i =
|
|
2039
|
-
function s(
|
|
2040
|
-
return
|
|
2459
|
+
function Tt(e, t, r) {
|
|
2460
|
+
const i = ce.length > 0 ? ce[ce.length - 1] : void 0, n = r ?? i;
|
|
2461
|
+
function s(f, b) {
|
|
2462
|
+
return ae("#text", {}, f, b);
|
|
2041
2463
|
}
|
|
2042
2464
|
let o = "";
|
|
2043
|
-
for (let
|
|
2044
|
-
o += e[
|
|
2045
|
-
const a =
|
|
2046
|
-
let u,
|
|
2047
|
-
function
|
|
2048
|
-
!
|
|
2049
|
-
if (
|
|
2050
|
-
const
|
|
2465
|
+
for (let f = 0; f < e.length; f++)
|
|
2466
|
+
o += e[f], f < t.length && (o += `{{${f}}}`);
|
|
2467
|
+
const a = /<!--[\s\S]*?-->|<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g, c = [];
|
|
2468
|
+
let u, m = [], T = null, p = {}, l, w = 0, v = [];
|
|
2469
|
+
function d(f) {
|
|
2470
|
+
!f || typeof f != "object" || ye(f) || (f.props || f.attrs ? (f.props && (p.props || (p.props = {}), Object.assign(p.props, f.props)), f.attrs && (p.attrs || (p.attrs = {}), Object.keys(f.attrs).forEach((b) => {
|
|
2471
|
+
if (b === "style" && p.attrs.style) {
|
|
2472
|
+
const h = p.attrs.style.replace(
|
|
2051
2473
|
/;?\s*$/,
|
|
2052
2474
|
""
|
|
2053
|
-
), _ =
|
|
2054
|
-
|
|
2055
|
-
} else if (
|
|
2056
|
-
const
|
|
2057
|
-
.../* @__PURE__ */ new Set([...
|
|
2475
|
+
), _ = f.attrs.style.replace(/^;?\s*/, "");
|
|
2476
|
+
p.attrs.style = h + "; " + _;
|
|
2477
|
+
} else if (b === "class" && p.attrs.class) {
|
|
2478
|
+
const h = p.attrs.class.trim().split(/\s+/).filter(Boolean), _ = f.attrs.class.trim().split(/\s+/).filter(Boolean), $ = [
|
|
2479
|
+
.../* @__PURE__ */ new Set([...h, ..._])
|
|
2058
2480
|
];
|
|
2059
|
-
|
|
2481
|
+
p.attrs.class = $.join(" ");
|
|
2060
2482
|
} else
|
|
2061
|
-
|
|
2062
|
-
}))) : (
|
|
2063
|
-
}
|
|
2064
|
-
function
|
|
2065
|
-
const
|
|
2066
|
-
if (
|
|
2067
|
-
const _ =
|
|
2068
|
-
let
|
|
2069
|
-
|
|
2070
|
-
...
|
|
2483
|
+
p.attrs[b] = f.attrs[b];
|
|
2484
|
+
}))) : (p.props || (p.props = {}), Object.assign(p.props, f)));
|
|
2485
|
+
}
|
|
2486
|
+
function g(f, b) {
|
|
2487
|
+
const h = T ? m : v;
|
|
2488
|
+
if (ye(f)) {
|
|
2489
|
+
const _ = f.key ?? b;
|
|
2490
|
+
let $ = f.children;
|
|
2491
|
+
h.push({
|
|
2492
|
+
...f,
|
|
2071
2493
|
key: _,
|
|
2072
|
-
children:
|
|
2494
|
+
children: $
|
|
2073
2495
|
});
|
|
2074
2496
|
return;
|
|
2075
2497
|
}
|
|
2076
|
-
if (
|
|
2077
|
-
|
|
2498
|
+
if (de(f)) {
|
|
2499
|
+
h.push(Ct(f, void 0));
|
|
2078
2500
|
return;
|
|
2079
2501
|
}
|
|
2080
|
-
if (Array.isArray(
|
|
2081
|
-
if (
|
|
2082
|
-
for (let _ = 0; _ <
|
|
2083
|
-
const
|
|
2084
|
-
|
|
2502
|
+
if (Array.isArray(f)) {
|
|
2503
|
+
if (f.length === 0) return;
|
|
2504
|
+
for (let _ = 0; _ < f.length; _++) {
|
|
2505
|
+
const $ = f[_];
|
|
2506
|
+
ye($) || de($) || Array.isArray($) ? g($, `${b}-${_}`) : $ !== null && typeof $ == "object" ? d($) : h.push(s(String($), `${b}-${_}`));
|
|
2085
2507
|
}
|
|
2086
2508
|
return;
|
|
2087
2509
|
}
|
|
2088
|
-
if (
|
|
2089
|
-
|
|
2510
|
+
if (f !== null && typeof f == "object") {
|
|
2511
|
+
d(f);
|
|
2090
2512
|
return;
|
|
2091
2513
|
}
|
|
2092
|
-
|
|
2514
|
+
h.push(s(String(f), b));
|
|
2093
2515
|
}
|
|
2094
|
-
const
|
|
2516
|
+
const y = /* @__PURE__ */ new Set([
|
|
2095
2517
|
"area",
|
|
2096
2518
|
"base",
|
|
2097
2519
|
"br",
|
|
@@ -2108,245 +2530,278 @@ function mt(e, t, r) {
|
|
|
2108
2530
|
"wbr"
|
|
2109
2531
|
]);
|
|
2110
2532
|
for (; u = a.exec(o); )
|
|
2111
|
-
if (u[
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2533
|
+
if (!(u[0].startsWith("<!--") && u[0].endsWith("-->"))) {
|
|
2534
|
+
if (u[1]) {
|
|
2535
|
+
const f = u[1], b = u[0][1] === "/", h = u[0][u[0].length - 2] === "/" || y.has(f), {
|
|
2536
|
+
props: _,
|
|
2537
|
+
attrs: $,
|
|
2538
|
+
directives: S,
|
|
2539
|
+
bound: E
|
|
2540
|
+
} = At(u[2] || "", t, n), C = { props: {}, attrs: {} };
|
|
2541
|
+
for (const A in _) C.props[A] = _[A];
|
|
2542
|
+
for (const A in $) C.attrs[A] = $[A];
|
|
2543
|
+
if (C.attrs && Object.prototype.hasOwnProperty.call(C.attrs, "key") && !(C.props && Object.prototype.hasOwnProperty.call(C.props, "key")))
|
|
2544
|
+
try {
|
|
2545
|
+
C.props.key = C.attrs.key;
|
|
2546
|
+
} catch {
|
|
2547
|
+
}
|
|
2120
2548
|
try {
|
|
2121
|
-
const A =
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2549
|
+
const A = {
|
|
2550
|
+
input: ["value", "checked", "disabled", "readonly", "required", "placeholder", "maxlength", "minlength"],
|
|
2551
|
+
textarea: ["value", "disabled", "readonly", "required", "placeholder", "maxlength", "minlength"],
|
|
2552
|
+
select: ["value", "disabled", "required", "multiple"],
|
|
2553
|
+
option: ["selected", "disabled", "value"],
|
|
2554
|
+
video: ["muted", "autoplay", "controls", "loop", "playsinline"],
|
|
2555
|
+
audio: ["muted", "autoplay", "controls", "loop"],
|
|
2556
|
+
img: ["src", "alt", "width", "height"],
|
|
2557
|
+
button: ["type", "name", "value", "disabled", "autofocus", "form"]
|
|
2558
|
+
}, P = f.toLowerCase(), X = A[P] ?? [];
|
|
2559
|
+
if (C.attrs)
|
|
2560
|
+
for (const M of X)
|
|
2561
|
+
E && E.includes(M) && M in C.attrs && !(C.props && M in C.props) && (C.props[M] = C.attrs[M], delete C.attrs[M]);
|
|
2562
|
+
if ((f.includes("-") || !!n?.__customElements?.has?.(f)) && E && C.attrs) {
|
|
2563
|
+
const M = /* @__PURE__ */ new Set(["id", "name", "data-key", "key"]);
|
|
2564
|
+
for (const F of E)
|
|
2565
|
+
if (F in C.attrs && !(C.props && F in C.props)) {
|
|
2566
|
+
const H = F.includes("-") ? F.split("-").map((N, I) => I === 0 ? N : N.charAt(0).toUpperCase() + N.slice(1)).join("") : F;
|
|
2567
|
+
C.props[H] = C.attrs[F], M.has(F) || delete C.attrs[F];
|
|
2132
2568
|
}
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
S.props[P] = function(T) {
|
|
2136
|
-
const R = T.detail !== void 0 ? T.detail : T.target ? T.target.value : void 0;
|
|
2137
|
-
if (!v) return;
|
|
2138
|
-
const pe = D(v, typeof L == "string" ? L : String(L));
|
|
2139
|
-
(Array.isArray(R) && Array.isArray(pe) ? JSON.stringify([...R].sort()) !== JSON.stringify([...pe].sort()) : R !== pe) && (ne(v, typeof L == "string" ? L : String(L), R), n?.requestRender ? n.requestRender() : n?._requestRender && n._requestRender());
|
|
2140
|
-
}, delete E[I];
|
|
2141
|
-
}
|
|
2569
|
+
C.isCustomElement = !0;
|
|
2570
|
+
}
|
|
2142
2571
|
} catch {
|
|
2143
2572
|
}
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
}
|
|
2170
|
-
const
|
|
2171
|
-
|
|
2573
|
+
if (S && Object.keys(S).some((A) => A === "model" || A.startsWith("model:")))
|
|
2574
|
+
try {
|
|
2575
|
+
const A = Symbol.for("cer.registry"), P = globalThis[A], X = !!(P && typeof P.has == "function" && P.has(f)), ie = !!(n && (n.__customElements instanceof Set && n.__customElements.has(f) || Array.isArray(n.__isCustomElements) && n.__isCustomElements.includes(f)));
|
|
2576
|
+
if (!!(f.includes("-") || ie || X))
|
|
2577
|
+
for (const H of Object.keys(S)) {
|
|
2578
|
+
if (H !== "model" && !H.startsWith("model:")) continue;
|
|
2579
|
+
const N = S[H], I = N.arg ?? (H.includes(":") ? H.split(":", 2)[1] : void 0), z = N.value, J = I ?? "modelValue", se = K, k = he, W = n ? n._state || n : void 0;
|
|
2580
|
+
let R;
|
|
2581
|
+
typeof z == "string" && n ? R = se(W, z) : R = z, C.props[J] = R;
|
|
2582
|
+
try {
|
|
2583
|
+
const L = Q(J);
|
|
2584
|
+
C.attrs || (C.attrs = {}), R !== void 0 && (C.attrs[L] = R);
|
|
2585
|
+
} catch {
|
|
2586
|
+
}
|
|
2587
|
+
C.isCustomElement = !0;
|
|
2588
|
+
const B = `update:${Q(J)}`, j = "on" + B.charAt(0).toUpperCase() + B.slice(1);
|
|
2589
|
+
C.props[j] = function(L) {
|
|
2590
|
+
const fe = L.detail !== void 0 ? L.detail : L.target ? L.target.value : void 0;
|
|
2591
|
+
if (!W) return;
|
|
2592
|
+
const ve = se(W, typeof z == "string" ? z : String(z));
|
|
2593
|
+
(Array.isArray(fe) && Array.isArray(ve) ? JSON.stringify([...fe].sort()) !== JSON.stringify([...ve].sort()) : fe !== ve) && (k(W, typeof z == "string" ? z : String(z), fe), n?.requestRender ? n.requestRender() : n?._requestRender && n._requestRender());
|
|
2594
|
+
}, delete S[H];
|
|
2595
|
+
}
|
|
2596
|
+
} catch {
|
|
2597
|
+
}
|
|
2598
|
+
if (Object.keys(S).length > 0 && (C.directives = { ...S }), b) {
|
|
2599
|
+
const A = ae(
|
|
2600
|
+
T,
|
|
2601
|
+
p,
|
|
2602
|
+
m.length === 1 && de(m[0]) && m[0].tag === "#text" ? typeof m[0].children == "string" ? m[0].children : "" : m.length ? m : void 0,
|
|
2603
|
+
l
|
|
2604
|
+
), P = c.pop();
|
|
2605
|
+
P ? (T = P.tag, p = P.props, l = P.key, m = P.children, m.push(A)) : (v.push(A), T = null, p = {}, l = void 0, m = []);
|
|
2606
|
+
} else h ? T ? m.push(ae(f, C, void 0, void 0)) : v.push(ae(f, C, void 0, void 0)) : (T && c.push({
|
|
2607
|
+
tag: T,
|
|
2608
|
+
props: p,
|
|
2609
|
+
children: m,
|
|
2610
|
+
key: l
|
|
2611
|
+
}), T = f, p = C, m = []);
|
|
2612
|
+
} else if (typeof u[3] < "u") {
|
|
2613
|
+
const f = Number(u[3]), b = t[f], h = `interp-${f}`;
|
|
2614
|
+
g(b, h);
|
|
2615
|
+
} else if (u[4]) {
|
|
2616
|
+
const f = u[4], b = T ? m : v, h = f.split(/({{\d+}})/);
|
|
2617
|
+
for (const _ of h) {
|
|
2618
|
+
if (!_) continue;
|
|
2619
|
+
const $ = _.match(/^{{(\d+)}}$/);
|
|
2620
|
+
if ($) {
|
|
2621
|
+
const S = Number($[1]), E = t[S], C = `interp-${S}`;
|
|
2622
|
+
g(E, C);
|
|
2623
|
+
} else {
|
|
2624
|
+
const S = `text-${w++}`;
|
|
2625
|
+
b.push(s(_, S));
|
|
2626
|
+
}
|
|
2172
2627
|
}
|
|
2173
2628
|
}
|
|
2174
2629
|
}
|
|
2175
|
-
const x =
|
|
2176
|
-
return x.length === 1 ? x[0] : x.length > 1 ? x :
|
|
2630
|
+
const x = v.filter((f) => de(f) && f.tag === "#text" ? typeof f.children == "string" && f.children.trim() !== "" : !0);
|
|
2631
|
+
return x.length === 1 ? x[0] : x.length > 1 ? x : ae("div", {}, "", "fallback-root");
|
|
2177
2632
|
}
|
|
2178
|
-
function
|
|
2633
|
+
function ee(e, ...t) {
|
|
2179
2634
|
const r = t[t.length - 1], i = typeof r == "object" && r && !Array.isArray(r) ? r : void 0;
|
|
2180
|
-
return
|
|
2635
|
+
return Tt(e, t, i);
|
|
2181
2636
|
}
|
|
2182
|
-
const
|
|
2637
|
+
const qe = (e) => e ? typeof URLSearchParams > "u" ? {} : Object.fromEntries(new URLSearchParams(e)) : {}, V = (e, t) => {
|
|
2183
2638
|
for (const r of e) {
|
|
2184
2639
|
const i = [], n = r.path.replace(/:[^/]+/g, (a) => (i.push(a.slice(1)), "([^/]+)")), s = new RegExp(`^${n}$`), o = t.match(s);
|
|
2185
2640
|
if (o) {
|
|
2186
2641
|
const a = {};
|
|
2187
|
-
return i.forEach((
|
|
2188
|
-
a[
|
|
2642
|
+
return i.forEach((c, u) => {
|
|
2643
|
+
a[c] = o[u + 1];
|
|
2189
2644
|
}), { route: r, params: a };
|
|
2190
2645
|
}
|
|
2191
2646
|
}
|
|
2192
2647
|
return { route: null, params: {} };
|
|
2193
|
-
},
|
|
2194
|
-
async function
|
|
2648
|
+
}, Te = {};
|
|
2649
|
+
async function jt(e) {
|
|
2195
2650
|
if (e.component) return e.component;
|
|
2196
2651
|
if (e.load) {
|
|
2197
|
-
if (
|
|
2652
|
+
if (Te[e.path]) return Te[e.path];
|
|
2198
2653
|
try {
|
|
2199
2654
|
const t = await e.load();
|
|
2200
|
-
return
|
|
2655
|
+
return Te[e.path] = t.default, t.default;
|
|
2201
2656
|
} catch {
|
|
2202
2657
|
throw new Error(`Failed to load component for route: ${e.path}`);
|
|
2203
2658
|
}
|
|
2204
2659
|
}
|
|
2205
2660
|
throw new Error(`No component or loader defined for route: ${e.path}`);
|
|
2206
2661
|
}
|
|
2207
|
-
function
|
|
2662
|
+
function Lt(e) {
|
|
2208
2663
|
const { routes: t, base: r = "", initialUrl: i } = e;
|
|
2209
|
-
let n, s, o, a,
|
|
2210
|
-
const
|
|
2211
|
-
const
|
|
2212
|
-
if (
|
|
2664
|
+
let n, s, o, a, c, u, m;
|
|
2665
|
+
const T = async (v, d) => {
|
|
2666
|
+
const g = t.find((y) => V([y], v.path).route !== null);
|
|
2667
|
+
if (g?.beforeEnter)
|
|
2213
2668
|
try {
|
|
2214
|
-
const
|
|
2215
|
-
return typeof
|
|
2216
|
-
} catch (
|
|
2217
|
-
return
|
|
2669
|
+
const y = await g.beforeEnter(v, d);
|
|
2670
|
+
return typeof y == "string" ? (await w(y, !0), !1) : y !== !1;
|
|
2671
|
+
} catch (y) {
|
|
2672
|
+
return Y("beforeEnter error", y), !1;
|
|
2218
2673
|
}
|
|
2219
2674
|
return !0;
|
|
2220
|
-
},
|
|
2221
|
-
const
|
|
2222
|
-
if (
|
|
2675
|
+
}, p = async (v, d) => {
|
|
2676
|
+
const g = t.find((y) => V([y], v.path).route !== null);
|
|
2677
|
+
if (g?.onEnter)
|
|
2223
2678
|
try {
|
|
2224
|
-
const
|
|
2225
|
-
return typeof
|
|
2226
|
-
} catch (
|
|
2227
|
-
return
|
|
2679
|
+
const y = await g.onEnter(v, d);
|
|
2680
|
+
return typeof y == "string" ? (await w(y, !0), !1) : y !== !1;
|
|
2681
|
+
} catch (y) {
|
|
2682
|
+
return Y("onEnter error", y), !1;
|
|
2228
2683
|
}
|
|
2229
2684
|
return !0;
|
|
2230
|
-
},
|
|
2231
|
-
const
|
|
2232
|
-
if (
|
|
2685
|
+
}, l = (v, d) => {
|
|
2686
|
+
const g = t.find((y) => V([y], v.path).route !== null);
|
|
2687
|
+
if (g?.afterEnter)
|
|
2233
2688
|
try {
|
|
2234
|
-
|
|
2235
|
-
} catch (
|
|
2236
|
-
|
|
2689
|
+
g.afterEnter(v, d);
|
|
2690
|
+
} catch (y) {
|
|
2691
|
+
Y("afterEnter error", y);
|
|
2237
2692
|
}
|
|
2238
|
-
},
|
|
2693
|
+
}, w = async (v, d = !1) => {
|
|
2239
2694
|
try {
|
|
2240
|
-
const
|
|
2241
|
-
path:
|
|
2695
|
+
const g = {
|
|
2696
|
+
path: v.replace(r, "") || "/",
|
|
2242
2697
|
query: {}
|
|
2243
|
-
},
|
|
2244
|
-
if (!
|
|
2245
|
-
const x = o.getState(),
|
|
2246
|
-
path:
|
|
2247
|
-
params:
|
|
2248
|
-
query:
|
|
2698
|
+
}, y = V(t, g.path);
|
|
2699
|
+
if (!y) throw new Error(`No route found for ${g.path}`);
|
|
2700
|
+
const x = o.getState(), f = {
|
|
2701
|
+
path: g.path,
|
|
2702
|
+
params: y.params,
|
|
2703
|
+
query: g.query
|
|
2249
2704
|
};
|
|
2250
|
-
if (!await
|
|
2251
|
-
typeof window < "u" && typeof document < "u" && (
|
|
2252
|
-
} catch (
|
|
2253
|
-
|
|
2705
|
+
if (!await T(f, x) || !await p(f, x)) return;
|
|
2706
|
+
typeof window < "u" && typeof document < "u" && (d ? window.history.replaceState({}, "", r + v) : window.history.pushState({}, "", r + v)), o.setState(f), l(f, x);
|
|
2707
|
+
} catch (g) {
|
|
2708
|
+
Y("Navigation error:", g);
|
|
2254
2709
|
}
|
|
2255
2710
|
};
|
|
2256
2711
|
if (typeof window < "u" && typeof document < "u") {
|
|
2257
2712
|
n = () => {
|
|
2258
|
-
const
|
|
2259
|
-
return { path:
|
|
2713
|
+
const d = new URL(window.location.href), g = d.pathname.replace(r, "") || "/", y = qe(d.search);
|
|
2714
|
+
return { path: g, query: y };
|
|
2260
2715
|
}, s = n();
|
|
2261
|
-
const
|
|
2262
|
-
o =
|
|
2716
|
+
const v = V(t, s.path);
|
|
2717
|
+
o = Le({
|
|
2263
2718
|
path: s.path,
|
|
2264
|
-
params:
|
|
2719
|
+
params: v.params,
|
|
2265
2720
|
query: s.query
|
|
2266
|
-
}), a = async (
|
|
2267
|
-
const
|
|
2268
|
-
await
|
|
2269
|
-
}, window.addEventListener("popstate", () => a(!0)),
|
|
2721
|
+
}), a = async (d = !1) => {
|
|
2722
|
+
const g = n();
|
|
2723
|
+
await w(g.path, d);
|
|
2724
|
+
}, window.addEventListener("popstate", () => a(!0)), c = (d) => w(d, !1), u = (d) => w(d, !0), m = () => window.history.back();
|
|
2270
2725
|
} else {
|
|
2271
2726
|
n = () => {
|
|
2272
|
-
const
|
|
2273
|
-
return { path:
|
|
2727
|
+
const g = new URL(i || "/", "http://localhost"), y = g.pathname.replace(r, "") || "/", x = qe(g.search);
|
|
2728
|
+
return { path: y, query: x };
|
|
2274
2729
|
}, s = n();
|
|
2275
|
-
const
|
|
2276
|
-
o =
|
|
2730
|
+
const v = V(t, s.path);
|
|
2731
|
+
o = Le({
|
|
2277
2732
|
path: s.path,
|
|
2278
|
-
params:
|
|
2733
|
+
params: v.params,
|
|
2279
2734
|
query: s.query
|
|
2280
2735
|
}), a = async () => {
|
|
2281
|
-
const
|
|
2282
|
-
await
|
|
2736
|
+
const g = n();
|
|
2737
|
+
await d(g.path);
|
|
2283
2738
|
};
|
|
2284
|
-
const
|
|
2739
|
+
const d = async (g) => {
|
|
2285
2740
|
try {
|
|
2286
|
-
const
|
|
2287
|
-
path:
|
|
2741
|
+
const y = {
|
|
2742
|
+
path: g.replace(r, "") || "/",
|
|
2288
2743
|
query: {}
|
|
2289
|
-
}, x =
|
|
2290
|
-
if (!x) throw new Error(`No route found for ${
|
|
2291
|
-
const
|
|
2292
|
-
path:
|
|
2744
|
+
}, x = V(t, y.path);
|
|
2745
|
+
if (!x) throw new Error(`No route found for ${y.path}`);
|
|
2746
|
+
const f = o.getState(), b = {
|
|
2747
|
+
path: y.path,
|
|
2293
2748
|
params: x.params,
|
|
2294
|
-
query:
|
|
2295
|
-
},
|
|
2296
|
-
if (
|
|
2749
|
+
query: y.query
|
|
2750
|
+
}, h = t.find((_) => V([_], b.path).route !== null);
|
|
2751
|
+
if (h?.beforeEnter)
|
|
2297
2752
|
try {
|
|
2298
|
-
const _ = await
|
|
2753
|
+
const _ = await h.beforeEnter(b, f);
|
|
2299
2754
|
if (typeof _ == "string") {
|
|
2300
|
-
await
|
|
2755
|
+
await d(_);
|
|
2301
2756
|
return;
|
|
2302
2757
|
}
|
|
2303
2758
|
if (_ === !1) return;
|
|
2304
2759
|
} catch {
|
|
2305
2760
|
return;
|
|
2306
2761
|
}
|
|
2307
|
-
if (
|
|
2762
|
+
if (h?.onEnter)
|
|
2308
2763
|
try {
|
|
2309
|
-
const _ = await
|
|
2764
|
+
const _ = await h.onEnter(b, f);
|
|
2310
2765
|
if (typeof _ == "string") {
|
|
2311
|
-
await
|
|
2766
|
+
await d(_);
|
|
2312
2767
|
return;
|
|
2313
2768
|
}
|
|
2314
2769
|
if (_ === !1) return;
|
|
2315
2770
|
} catch {
|
|
2316
2771
|
return;
|
|
2317
2772
|
}
|
|
2318
|
-
if (o.setState(
|
|
2773
|
+
if (o.setState(b), h?.afterEnter)
|
|
2319
2774
|
try {
|
|
2320
|
-
|
|
2775
|
+
h.afterEnter(b, f);
|
|
2321
2776
|
} catch {
|
|
2322
2777
|
}
|
|
2323
2778
|
} catch {
|
|
2324
2779
|
}
|
|
2325
2780
|
};
|
|
2326
|
-
|
|
2781
|
+
c = async (g) => d(g), u = async (g) => d(g), m = () => {
|
|
2327
2782
|
};
|
|
2328
2783
|
}
|
|
2329
2784
|
return {
|
|
2330
2785
|
store: o,
|
|
2331
|
-
push:
|
|
2786
|
+
push: c,
|
|
2332
2787
|
replace: u,
|
|
2333
|
-
back:
|
|
2788
|
+
back: m,
|
|
2334
2789
|
subscribe: o.subscribe,
|
|
2335
|
-
matchRoute: (
|
|
2790
|
+
matchRoute: (v) => V(t, v),
|
|
2336
2791
|
getCurrent: () => o.getState(),
|
|
2337
|
-
resolveRouteComponent:
|
|
2792
|
+
resolveRouteComponent: jt
|
|
2338
2793
|
};
|
|
2339
2794
|
}
|
|
2340
|
-
function
|
|
2341
|
-
return
|
|
2795
|
+
function Zt(e, t) {
|
|
2796
|
+
return V(e, t);
|
|
2342
2797
|
}
|
|
2343
|
-
function
|
|
2344
|
-
const t =
|
|
2345
|
-
return
|
|
2798
|
+
function Yt(e) {
|
|
2799
|
+
const t = Lt(e);
|
|
2800
|
+
return Ie("router-view", {
|
|
2346
2801
|
async render() {
|
|
2347
|
-
if (!t) return
|
|
2802
|
+
if (!t) return ee`<div>Router not initialized.</div>`;
|
|
2348
2803
|
const r = t.getCurrent(), { path: i } = r, n = t.matchRoute(i);
|
|
2349
|
-
if (!n.route) return
|
|
2804
|
+
if (!n.route) return ee`<div>Not found</div>`;
|
|
2350
2805
|
try {
|
|
2351
2806
|
const s = await t.resolveRouteComponent(n.route);
|
|
2352
2807
|
if (typeof s == "string")
|
|
@@ -2355,9 +2810,9 @@ function At(e) {
|
|
|
2355
2810
|
const o = s(), a = o instanceof Promise ? await o : o;
|
|
2356
2811
|
return typeof a == "string" ? { tag: a, props: {}, children: [] } : a;
|
|
2357
2812
|
}
|
|
2358
|
-
return
|
|
2813
|
+
return ee`<div>Invalid route component</div>`;
|
|
2359
2814
|
} catch {
|
|
2360
|
-
return
|
|
2815
|
+
return ee`<div>Invalid route component</div>`;
|
|
2361
2816
|
}
|
|
2362
2817
|
},
|
|
2363
2818
|
onConnected(r) {
|
|
@@ -2365,7 +2820,7 @@ function At(e) {
|
|
|
2365
2820
|
typeof r.requestRender == "function" && r.requestRender();
|
|
2366
2821
|
});
|
|
2367
2822
|
}
|
|
2368
|
-
}),
|
|
2823
|
+
}), Ie("router-link", {
|
|
2369
2824
|
state: {},
|
|
2370
2825
|
props: {
|
|
2371
2826
|
to: { type: String, default: "" },
|
|
@@ -2378,7 +2833,7 @@ function At(e) {
|
|
|
2378
2833
|
disabled: { type: Boolean, default: !1 },
|
|
2379
2834
|
external: { type: Boolean, default: !1 },
|
|
2380
2835
|
class: { type: String, default: "" },
|
|
2381
|
-
style: { type: String, default:
|
|
2836
|
+
style: { type: String, default: Ue`
|
|
2382
2837
|
[aria-disabled="true"] {
|
|
2383
2838
|
pointer-events: none;
|
|
2384
2839
|
opacity: 0.5;
|
|
@@ -2387,32 +2842,32 @@ function At(e) {
|
|
|
2387
2842
|
},
|
|
2388
2843
|
style: (r) => r.style,
|
|
2389
2844
|
render: (r) => {
|
|
2390
|
-
const i = t.getCurrent(), n = r.to, s = r.exact, o = r.exactActiveClass, a = r.activeClass,
|
|
2391
|
-
for (const
|
|
2392
|
-
const
|
|
2393
|
-
...
|
|
2845
|
+
const i = t.getCurrent(), n = r.to, s = r.exact, o = r.exactActiveClass, a = r.activeClass, c = r.ariaCurrentValue, u = r.tag, m = r.disabled, T = r.external, p = i.path === n, l = s ? p : i && typeof i.path == "string" ? i.path.startsWith(n) : !1, w = p ? `aria-current="${c}"` : "", v = (r.class || "").split(/\s+/).filter(Boolean), d = {};
|
|
2846
|
+
for (const b of v) d[b] = !0;
|
|
2847
|
+
const g = {
|
|
2848
|
+
...d,
|
|
2394
2849
|
// Also include the configurable names (may duplicate the above)
|
|
2395
|
-
[a]:
|
|
2396
|
-
[o]:
|
|
2397
|
-
},
|
|
2398
|
-
return
|
|
2399
|
-
${
|
|
2850
|
+
[a]: l,
|
|
2851
|
+
[o]: p
|
|
2852
|
+
}, y = u === "button", x = m ? y ? 'disabled aria-disabled="true" tabindex="-1"' : 'aria-disabled="true" tabindex="-1"' : "", f = T && (u === "a" || !u) ? 'target="_blank" rel="noopener noreferrer"' : "";
|
|
2853
|
+
return ee`
|
|
2854
|
+
${Ke().when(y, ee`
|
|
2400
2855
|
<button
|
|
2401
2856
|
part="button"
|
|
2402
|
-
:class="${
|
|
2403
|
-
${
|
|
2857
|
+
:class="${g}"
|
|
2858
|
+
${w}
|
|
2404
2859
|
${x}
|
|
2405
|
-
${
|
|
2860
|
+
${f}
|
|
2406
2861
|
@click="navigate"
|
|
2407
2862
|
><slot></slot></button>
|
|
2408
|
-
`).otherwise(
|
|
2863
|
+
`).otherwise(ee`
|
|
2409
2864
|
<a
|
|
2410
2865
|
part="link"
|
|
2411
2866
|
href="${n}"
|
|
2412
|
-
:class="${
|
|
2413
|
-
${
|
|
2867
|
+
:class="${g}"
|
|
2868
|
+
${w}
|
|
2414
2869
|
${x}
|
|
2415
|
-
${
|
|
2870
|
+
${f}
|
|
2416
2871
|
@click="navigate"
|
|
2417
2872
|
><slot></slot></a>
|
|
2418
2873
|
`).done()}
|
|
@@ -2428,26 +2883,42 @@ function At(e) {
|
|
|
2428
2883
|
}), t;
|
|
2429
2884
|
}
|
|
2430
2885
|
export {
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2886
|
+
ne as GlobalEventBus,
|
|
2887
|
+
O as anchorBlock,
|
|
2888
|
+
Ie as component,
|
|
2889
|
+
Le as createStore,
|
|
2890
|
+
Ue as css,
|
|
2891
|
+
Ot as each,
|
|
2892
|
+
qt as eachGroup,
|
|
2893
|
+
zt as eachPage,
|
|
2894
|
+
Wt as eachWhere,
|
|
2895
|
+
Ft as emit,
|
|
2896
|
+
le as eventBus,
|
|
2897
|
+
ee as html,
|
|
2898
|
+
Yt as initRouter,
|
|
2899
|
+
Gt as listen,
|
|
2900
|
+
Ke as match,
|
|
2901
|
+
V as matchRoute,
|
|
2902
|
+
Zt as matchRouteSSR,
|
|
2903
|
+
G as mediaVariants,
|
|
2904
|
+
Jt as off,
|
|
2905
|
+
Kt as on,
|
|
2906
|
+
Vt as once,
|
|
2907
|
+
qe as parseQuery,
|
|
2908
|
+
ke as renderToString,
|
|
2909
|
+
jt as resolveRouteComponent,
|
|
2910
|
+
Ve as responsive,
|
|
2911
|
+
ze as responsiveOrder,
|
|
2912
|
+
Dt as responsiveSwitch,
|
|
2913
|
+
Ut as switchOn,
|
|
2914
|
+
It as switchOnLength,
|
|
2915
|
+
Ht as switchOnPromise,
|
|
2916
|
+
Pt as unless,
|
|
2917
|
+
Lt as useRouter,
|
|
2918
|
+
we as when,
|
|
2919
|
+
Mt as whenEmpty,
|
|
2920
|
+
q as whenMedia,
|
|
2921
|
+
Bt as whenNotEmpty,
|
|
2922
|
+
Nt as whenVariants
|
|
2452
2923
|
};
|
|
2453
2924
|
//# sourceMappingURL=custom-elements-runtime.es.js.map
|