@jasonshimmy/custom-elements-runtime 0.1.9 → 0.1.10
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/dist/custom-elements-runtime.cjs.js +9 -9
- package/dist/custom-elements-runtime.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.es.js +572 -556
- package/dist/custom-elements-runtime.es.js.map +1 -1
- package/dist/custom-elements-runtime.umd.js +9 -9
- package/dist/custom-elements-runtime.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
function st(e, t) {
|
|
2
|
-
return X(e ? t : [], "when-block");
|
|
3
|
-
}
|
|
4
1
|
function at(e, t) {
|
|
2
|
+
return Y(e ? t : [], "when-block");
|
|
3
|
+
}
|
|
4
|
+
function lt(e, t) {
|
|
5
5
|
return e.map((r, n) => {
|
|
6
6
|
const o = typeof r == "object" ? r?.key ?? r?.id ?? `idx-${n}` : String(r);
|
|
7
|
-
return
|
|
7
|
+
return Y(t(r, n), `each-${o}`);
|
|
8
8
|
});
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function $e() {
|
|
11
11
|
const e = [];
|
|
12
12
|
return {
|
|
13
13
|
when(t, r) {
|
|
@@ -17,18 +17,18 @@ function ke() {
|
|
|
17
17
|
return e.push([!0, t]), this;
|
|
18
18
|
},
|
|
19
19
|
done() {
|
|
20
|
-
return
|
|
20
|
+
return _e(...e);
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function _e(...e) {
|
|
25
25
|
for (let t = 0; t < e.length; t++) {
|
|
26
26
|
const [r, n] = e[t];
|
|
27
|
-
if (r) return [
|
|
27
|
+
if (r) return [Y(n, `whenChain-branch-${t}`)];
|
|
28
28
|
}
|
|
29
|
-
return [
|
|
29
|
+
return [Y([], "whenChain-empty")];
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function Y(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,7 @@ function X(e, t) {
|
|
|
36
36
|
children: r
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
-
class
|
|
39
|
+
class D extends EventTarget {
|
|
40
40
|
handlers = {};
|
|
41
41
|
static instance;
|
|
42
42
|
eventCounters = /* @__PURE__ */ new Map();
|
|
@@ -44,7 +44,7 @@ class W extends EventTarget {
|
|
|
44
44
|
* Returns the singleton instance of GlobalEventBus
|
|
45
45
|
*/
|
|
46
46
|
static getInstance() {
|
|
47
|
-
return
|
|
47
|
+
return D.instance || (D.instance = new D()), D.instance;
|
|
48
48
|
}
|
|
49
49
|
// Enhanced emit method with better typing and event storm protection
|
|
50
50
|
/**
|
|
@@ -160,8 +160,8 @@ class W extends EventTarget {
|
|
|
160
160
|
this.eventCounters.clear();
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
|
-
const
|
|
164
|
-
function
|
|
163
|
+
const K = D.getInstance(), ct = (e, t) => K.emit(e, t), ft = (e, t) => K.on(e, t), ut = (e, t) => K.off(e, t), dt = (e, t) => K.once(e, t), pt = (e, t, r) => K.listen(e, t, r);
|
|
164
|
+
function ce(e) {
|
|
165
165
|
let t = { ...e };
|
|
166
166
|
const r = [];
|
|
167
167
|
function n(a) {
|
|
@@ -171,18 +171,18 @@ function le(e) {
|
|
|
171
171
|
return t;
|
|
172
172
|
}
|
|
173
173
|
function s(a) {
|
|
174
|
-
const
|
|
175
|
-
t = { ...t, ...
|
|
174
|
+
const c = typeof a == "function" ? a(t) : a;
|
|
175
|
+
t = { ...t, ...c }, i();
|
|
176
176
|
}
|
|
177
177
|
function i() {
|
|
178
178
|
r.forEach((a) => a(t));
|
|
179
179
|
}
|
|
180
180
|
return { subscribe: n, getState: o, setState: s };
|
|
181
181
|
}
|
|
182
|
-
function
|
|
182
|
+
function ae(e) {
|
|
183
183
|
return e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
184
184
|
}
|
|
185
|
-
function
|
|
185
|
+
function oe(e) {
|
|
186
186
|
return typeof e == "string" ? e.replace(
|
|
187
187
|
/[&<>"']/g,
|
|
188
188
|
(t) => ({
|
|
@@ -194,34 +194,34 @@ function ne(e) {
|
|
|
194
194
|
})[t]
|
|
195
195
|
) : e;
|
|
196
196
|
}
|
|
197
|
-
function
|
|
197
|
+
function Se(e, t, r) {
|
|
198
198
|
if (r)
|
|
199
199
|
for (const [n, o] of Object.entries(r)) {
|
|
200
200
|
let s, i = {};
|
|
201
201
|
if (Array.isArray(o) ? (s = o[0], i = o[1] || {}) : s = o, t.set(n, {
|
|
202
202
|
callback: s,
|
|
203
203
|
options: i,
|
|
204
|
-
oldValue:
|
|
204
|
+
oldValue: ie(e, n)
|
|
205
205
|
}), i.immediate)
|
|
206
206
|
try {
|
|
207
|
-
const a =
|
|
207
|
+
const a = ie(e, n);
|
|
208
208
|
s(a, void 0, e);
|
|
209
209
|
} catch (a) {
|
|
210
210
|
console.error(`Error in immediate watcher for "${n}":`, a);
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
|
-
function
|
|
214
|
+
function ie(e, t) {
|
|
215
215
|
return t.split(".").reduce((r, n) => r?.[n], e);
|
|
216
216
|
}
|
|
217
|
-
function
|
|
217
|
+
function Ce(e, t, r, n) {
|
|
218
218
|
const o = (i, a) => {
|
|
219
219
|
if (i === a) return !0;
|
|
220
220
|
if (typeof i != typeof a || typeof i != "object" || i === null || a === null) return !1;
|
|
221
221
|
if (Array.isArray(i) && Array.isArray(a))
|
|
222
222
|
return i.length !== a.length ? !1 : i.every((p, g) => o(p, a[g]));
|
|
223
|
-
const
|
|
224
|
-
return
|
|
223
|
+
const c = Object.keys(i), f = Object.keys(a);
|
|
224
|
+
return c.length !== f.length ? !1 : c.every((p) => o(i[p], a[p]));
|
|
225
225
|
}, s = t.get(r);
|
|
226
226
|
if (s && !o(n, s.oldValue))
|
|
227
227
|
try {
|
|
@@ -232,13 +232,13 @@ function Se(e, t, r, n) {
|
|
|
232
232
|
for (const [i, a] of t.entries())
|
|
233
233
|
if (a.options.deep && r.startsWith(i + "."))
|
|
234
234
|
try {
|
|
235
|
-
const
|
|
236
|
-
o(
|
|
237
|
-
} catch (
|
|
238
|
-
console.error(`Error in deep watcher for "${i}":`,
|
|
235
|
+
const c = ie(e, i);
|
|
236
|
+
o(c, a.oldValue) || (a.callback(c, a.oldValue, e), a.oldValue = c);
|
|
237
|
+
} catch (c) {
|
|
238
|
+
console.error(`Error in deep watcher for "${i}":`, c);
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
|
-
function
|
|
241
|
+
function Ae(e, t, r) {
|
|
242
242
|
if (!t.props) return;
|
|
243
243
|
function n(o, s) {
|
|
244
244
|
return s === Boolean ? o === "true" : s === Number ? Number(o) : o;
|
|
@@ -247,46 +247,46 @@ function Ce(e, t, r) {
|
|
|
247
247
|
if (s.type === Function && typeof e[o] == "function")
|
|
248
248
|
r[o] = e[o];
|
|
249
249
|
else {
|
|
250
|
-
const i = e.getAttribute(
|
|
251
|
-
i !== null ? r[o] =
|
|
250
|
+
const i = e.getAttribute(ae(o));
|
|
251
|
+
i !== null ? r[o] = oe(n(i, s.type)) : "default" in s && s.default !== void 0 && (r[o] = oe(s.default));
|
|
252
252
|
}
|
|
253
253
|
});
|
|
254
254
|
}
|
|
255
|
-
function
|
|
255
|
+
function Ee(e, t, r, n) {
|
|
256
256
|
e.onConnected && !r && (e.onConnected(t), n(!0));
|
|
257
257
|
}
|
|
258
|
-
function
|
|
259
|
-
e.onDisconnected && e.onDisconnected(t), r.forEach((
|
|
258
|
+
function Te(e, t, r, n, o, s, i, a) {
|
|
259
|
+
e.onDisconnected && e.onDisconnected(t), r.forEach((c) => c()), n(), o(), s(!1), i(null), a(!1);
|
|
260
260
|
}
|
|
261
|
-
function
|
|
261
|
+
function je(e, t, r, n, o) {
|
|
262
262
|
e.onAttributeChanged && e.onAttributeChanged(t, r, n, o);
|
|
263
263
|
}
|
|
264
|
-
function
|
|
264
|
+
function M(e, t) {
|
|
265
265
|
if (t && e instanceof HTMLElement) {
|
|
266
266
|
for (const r in t)
|
|
267
267
|
t[r] === e && delete t[r];
|
|
268
268
|
for (const r of Array.from(e.childNodes))
|
|
269
|
-
|
|
269
|
+
M(r, t);
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
|
-
function
|
|
272
|
+
function O(e, t) {
|
|
273
273
|
return t.split(".").reduce((r, n) => r?.[n], e);
|
|
274
274
|
}
|
|
275
|
-
function
|
|
275
|
+
function fe(e, t, r) {
|
|
276
276
|
const n = t.split("."), o = n.pop();
|
|
277
277
|
if (!o) return;
|
|
278
278
|
const s = n.reduce((i, a) => (a in i || (i[a] = {}), i[a]), e);
|
|
279
279
|
s[o] = r;
|
|
280
280
|
}
|
|
281
|
-
function
|
|
281
|
+
function Le(e, t, r, n, o, s, i) {
|
|
282
282
|
if (!s) return;
|
|
283
|
-
const a = t.includes("lazy"),
|
|
283
|
+
const a = t.includes("lazy"), c = t.includes("trim"), f = t.includes("number"), p = () => {
|
|
284
284
|
const h = s._state || s;
|
|
285
|
-
return
|
|
285
|
+
return O(h, e);
|
|
286
286
|
}, g = p();
|
|
287
287
|
let l = "text";
|
|
288
|
-
const
|
|
289
|
-
if (i instanceof HTMLInputElement ? l =
|
|
288
|
+
const b = n?.type;
|
|
289
|
+
if (i instanceof HTMLInputElement ? l = b || i.type || "text" : i instanceof HTMLSelectElement ? l = "select" : i instanceof HTMLTextAreaElement && (l = "textarea"), l === "checkbox")
|
|
290
290
|
if (Array.isArray(g)) {
|
|
291
291
|
const h = i?.getAttribute("value") || n?.value || "", d = g.includes(h);
|
|
292
292
|
i && i.checked !== d && (r.checked = d);
|
|
@@ -301,9 +301,9 @@ function je(e, t, r, n, o, s, i) {
|
|
|
301
301
|
if (i && i.hasAttribute("multiple")) {
|
|
302
302
|
const h = i, d = Array.isArray(g) ? g : [];
|
|
303
303
|
setTimeout(() => {
|
|
304
|
-
Array.from(h.options).forEach((
|
|
305
|
-
const
|
|
306
|
-
|
|
304
|
+
Array.from(h.options).forEach((v) => {
|
|
305
|
+
const x = d.includes(v.value);
|
|
306
|
+
v.selected !== x && (v.selected = x);
|
|
307
307
|
});
|
|
308
308
|
}, 0);
|
|
309
309
|
} else
|
|
@@ -318,37 +318,37 @@ function je(e, t, r, n, o, s, i) {
|
|
|
318
318
|
if (h.isComposing || o._isComposing || h.isTrusted === !1) return;
|
|
319
319
|
const d = h.target;
|
|
320
320
|
if (d._modelUpdating) return;
|
|
321
|
-
const
|
|
322
|
-
let
|
|
321
|
+
const v = p();
|
|
322
|
+
let x = d.value;
|
|
323
323
|
if (l === "checkbox")
|
|
324
|
-
if (Array.isArray(
|
|
325
|
-
const _ = d.getAttribute("value") || "",
|
|
324
|
+
if (Array.isArray(v)) {
|
|
325
|
+
const _ = d.getAttribute("value") || "", S = [...v];
|
|
326
326
|
if (d.checked)
|
|
327
|
-
|
|
327
|
+
S.includes(_) || S.push(_);
|
|
328
328
|
else {
|
|
329
|
-
const
|
|
330
|
-
|
|
329
|
+
const C = S.indexOf(_);
|
|
330
|
+
C > -1 && S.splice(C, 1);
|
|
331
331
|
}
|
|
332
|
-
|
|
332
|
+
x = S;
|
|
333
333
|
} else {
|
|
334
|
-
const _ = d.getAttribute("true-value") || !0,
|
|
335
|
-
|
|
334
|
+
const _ = d.getAttribute("true-value") || !0, S = d.getAttribute("false-value") || !1;
|
|
335
|
+
x = d.checked ? _ : S;
|
|
336
336
|
}
|
|
337
337
|
else if (l === "radio")
|
|
338
|
-
|
|
338
|
+
x = d.getAttribute("value") || d.value;
|
|
339
339
|
else if (l === "select" && d.multiple) {
|
|
340
340
|
const _ = d;
|
|
341
|
-
|
|
342
|
-
(
|
|
341
|
+
x = Array.from(_.selectedOptions).map(
|
|
342
|
+
(S) => S.value
|
|
343
343
|
);
|
|
344
|
-
} else if (
|
|
345
|
-
const _ = Number(
|
|
346
|
-
isNaN(_) || (
|
|
344
|
+
} else if (c && (x = x.trim()), f) {
|
|
345
|
+
const _ = Number(x);
|
|
346
|
+
isNaN(_) || (x = _);
|
|
347
347
|
}
|
|
348
|
-
const
|
|
349
|
-
if (Array.isArray(
|
|
348
|
+
const u = s._state || s, $ = O(u, e);
|
|
349
|
+
if (Array.isArray(x) && Array.isArray($) ? JSON.stringify([...x].sort()) !== JSON.stringify([...$].sort()) : x !== $) {
|
|
350
350
|
const _ = h.target;
|
|
351
|
-
_._modelUpdating = !0,
|
|
351
|
+
_._modelUpdating = !0, fe(u, e, x), setTimeout(() => {
|
|
352
352
|
_._modelUpdating = !1;
|
|
353
353
|
}, 0), s._requestRender && s._requestRender();
|
|
354
354
|
}
|
|
@@ -356,27 +356,27 @@ function je(e, t, r, n, o, s, i) {
|
|
|
356
356
|
if (o[y] = m, l === "text" || l === "textarea") {
|
|
357
357
|
const h = () => {
|
|
358
358
|
o._isComposing = !0;
|
|
359
|
-
}, d = (
|
|
359
|
+
}, d = (v) => {
|
|
360
360
|
o._isComposing = !1;
|
|
361
|
-
const
|
|
361
|
+
const x = v.target;
|
|
362
362
|
setTimeout(() => {
|
|
363
|
-
if (
|
|
364
|
-
let
|
|
365
|
-
if (
|
|
366
|
-
const
|
|
367
|
-
isNaN(
|
|
363
|
+
if (x) {
|
|
364
|
+
let u = x.value;
|
|
365
|
+
if (c && (u = u.trim()), f) {
|
|
366
|
+
const S = Number(u);
|
|
367
|
+
isNaN(S) || (u = S);
|
|
368
368
|
}
|
|
369
|
-
const $ = s._state || s, w =
|
|
370
|
-
(Array.isArray(
|
|
371
|
-
|
|
372
|
-
}, 0)),
|
|
369
|
+
const $ = s._state || s, w = O($, e);
|
|
370
|
+
(Array.isArray(u) && Array.isArray(w) ? JSON.stringify([...u].sort()) !== JSON.stringify([...w].sort()) : u !== w) && (x && (x._modelUpdating = !0, setTimeout(() => {
|
|
371
|
+
x._modelUpdating = !1;
|
|
372
|
+
}, 0)), fe($, e, u), s._requestRender && s._requestRender());
|
|
373
373
|
}
|
|
374
374
|
}, 0);
|
|
375
375
|
};
|
|
376
376
|
o.compositionstart = h, o.compositionend = d;
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
|
-
function
|
|
379
|
+
function Be(e, t, r, n) {
|
|
380
380
|
if (n)
|
|
381
381
|
try {
|
|
382
382
|
const o = JSON.parse(e);
|
|
@@ -384,34 +384,34 @@ function Le(e, t, r, n) {
|
|
|
384
384
|
for (const [s, i] of Object.entries(o))
|
|
385
385
|
t[s] = i;
|
|
386
386
|
} catch {
|
|
387
|
-
const o =
|
|
387
|
+
const o = O(n, e);
|
|
388
388
|
r[e] = o;
|
|
389
389
|
}
|
|
390
390
|
}
|
|
391
|
-
function
|
|
391
|
+
function ze(e, t, r) {
|
|
392
392
|
if (!r) return;
|
|
393
|
-
const n =
|
|
393
|
+
const n = O(r, e), o = t.style || "", s = n ? "" : "none";
|
|
394
394
|
if (o) {
|
|
395
395
|
const i = o.split(";").filter(Boolean), a = i.findIndex(
|
|
396
|
-
(
|
|
396
|
+
(c) => c.trim().startsWith("display:")
|
|
397
397
|
);
|
|
398
398
|
a >= 0 ? i[a] = `display: ${s}` : i.push(`display: ${s}`), t.style = i.join("; ");
|
|
399
399
|
} else
|
|
400
400
|
t.style = `display: ${s}`;
|
|
401
401
|
}
|
|
402
|
-
function
|
|
402
|
+
function Re(e, t, r) {
|
|
403
403
|
if (!r) return;
|
|
404
|
-
const n =
|
|
404
|
+
const n = O(r, e);
|
|
405
405
|
let o = [];
|
|
406
406
|
typeof n == "string" ? o = [n] : Array.isArray(n) ? o = n.filter(Boolean) : typeof n == "object" && (o = Object.entries(n).filter(([, a]) => !!a).map(([a]) => a));
|
|
407
407
|
const s = t.class || "", i = s ? `${s} ${o.join(" ")}`.trim() : o.join(" ");
|
|
408
408
|
i && (t.class = i);
|
|
409
409
|
}
|
|
410
|
-
function
|
|
410
|
+
function Ne(e, t, r) {
|
|
411
411
|
let n;
|
|
412
412
|
if (typeof e == "string") {
|
|
413
413
|
if (!r) return;
|
|
414
|
-
n =
|
|
414
|
+
n = O(r, e);
|
|
415
415
|
} else
|
|
416
416
|
n = e;
|
|
417
417
|
let o = "";
|
|
@@ -419,9 +419,9 @@ function Re(e, t, r) {
|
|
|
419
419
|
o = n;
|
|
420
420
|
else if (n && typeof n == "object") {
|
|
421
421
|
const i = [];
|
|
422
|
-
for (const [a,
|
|
423
|
-
if (
|
|
424
|
-
const
|
|
422
|
+
for (const [a, c] of Object.entries(n))
|
|
423
|
+
if (c != null && c !== "") {
|
|
424
|
+
const f = a.replace(
|
|
425
425
|
/[A-Z]/g,
|
|
426
426
|
(l) => `-${l.toLowerCase()}`
|
|
427
427
|
), p = [
|
|
@@ -450,22 +450,22 @@ function Re(e, t, r) {
|
|
|
450
450
|
"min-height",
|
|
451
451
|
"max-height"
|
|
452
452
|
];
|
|
453
|
-
let g = String(
|
|
454
|
-
typeof
|
|
453
|
+
let g = String(c);
|
|
454
|
+
typeof c == "number" && p.includes(f) && (g = `${c}px`), i.push(`${f}: ${g}`);
|
|
455
455
|
}
|
|
456
456
|
o = i.join("; ") + (i.length > 0 ? ";" : "");
|
|
457
457
|
}
|
|
458
458
|
const s = t.style || "";
|
|
459
459
|
t.style = s + (s && !s.endsWith(";") ? "; " : "") + o;
|
|
460
460
|
}
|
|
461
|
-
function
|
|
461
|
+
function be(e, t, r, n) {
|
|
462
462
|
const o = {}, s = { ...n || {} }, i = {};
|
|
463
|
-
for (const [a,
|
|
464
|
-
const { value:
|
|
463
|
+
for (const [a, c] of Object.entries(e)) {
|
|
464
|
+
const { value: f, modifiers: p } = c;
|
|
465
465
|
switch (a) {
|
|
466
466
|
case "model":
|
|
467
|
-
|
|
468
|
-
typeof
|
|
467
|
+
Le(
|
|
468
|
+
typeof f == "string" ? f : String(f),
|
|
469
469
|
p,
|
|
470
470
|
o,
|
|
471
471
|
s,
|
|
@@ -475,22 +475,22 @@ function me(e, t, r, n) {
|
|
|
475
475
|
);
|
|
476
476
|
break;
|
|
477
477
|
case "bind":
|
|
478
|
-
|
|
478
|
+
Be(f, o, s, t);
|
|
479
479
|
break;
|
|
480
480
|
case "show":
|
|
481
|
-
|
|
481
|
+
ze(f, s, t);
|
|
482
482
|
break;
|
|
483
483
|
case "class":
|
|
484
|
-
|
|
484
|
+
Re(f, s, t);
|
|
485
485
|
break;
|
|
486
486
|
case "style":
|
|
487
|
-
|
|
487
|
+
Ne(f, s, t);
|
|
488
488
|
break;
|
|
489
489
|
}
|
|
490
490
|
}
|
|
491
491
|
return { props: o, attrs: s, listeners: i };
|
|
492
492
|
}
|
|
493
|
-
function
|
|
493
|
+
function se(e, t) {
|
|
494
494
|
if (Array.isArray(e)) {
|
|
495
495
|
const s = /* @__PURE__ */ new Set();
|
|
496
496
|
return e.map((i) => {
|
|
@@ -500,20 +500,20 @@ function ie(e, t) {
|
|
|
500
500
|
const g = i.tag || "node", l = i.props?.attrs?.id ?? i.props?.attrs?.name ?? i.props?.attrs?.["data-key"] ?? "";
|
|
501
501
|
a = l ? `${t}:${g}:${l}` : `${t}:${g}`;
|
|
502
502
|
}
|
|
503
|
-
let
|
|
504
|
-
for (; s.has(
|
|
505
|
-
|
|
506
|
-
s.add(
|
|
503
|
+
let c = a, f = 1;
|
|
504
|
+
for (; s.has(c); )
|
|
505
|
+
c = `${a}#${f++}`;
|
|
506
|
+
s.add(c);
|
|
507
507
|
let p = i.children;
|
|
508
|
-
return Array.isArray(p) && (p =
|
|
508
|
+
return Array.isArray(p) && (p = se(p, c)), { ...i, key: c, children: p };
|
|
509
509
|
});
|
|
510
510
|
}
|
|
511
511
|
const r = e;
|
|
512
512
|
let n = r.props?.key ?? r.key ?? t, o = r.children;
|
|
513
|
-
return Array.isArray(o) && (o =
|
|
513
|
+
return Array.isArray(o) && (o = se(o, n)), { ...r, key: n, children: o };
|
|
514
514
|
}
|
|
515
|
-
function
|
|
516
|
-
const o = r.directives ?? {}, s =
|
|
515
|
+
function Me(e, t, r, n) {
|
|
516
|
+
const o = r.directives ?? {}, s = be(
|
|
517
517
|
o,
|
|
518
518
|
n,
|
|
519
519
|
e,
|
|
@@ -526,19 +526,19 @@ function Ne(e, t, r, n) {
|
|
|
526
526
|
...t.attrs,
|
|
527
527
|
...r.attrs,
|
|
528
528
|
...s.attrs
|
|
529
|
-
},
|
|
530
|
-
for (const l in { ...
|
|
531
|
-
const
|
|
532
|
-
|
|
529
|
+
}, c = t.props ?? {}, f = i;
|
|
530
|
+
for (const l in { ...c, ...f }) {
|
|
531
|
+
const b = c[l], y = f[l];
|
|
532
|
+
b !== y && (l === "value" && (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement) ? e.value !== y && (e.value = y ?? "") : l === "checked" && e instanceof HTMLInputElement ? e.checked = !!y : l.startsWith("on") && typeof y == "function" ? (typeof b == "function" && e.removeEventListener(l.slice(2).toLowerCase(), b), e.addEventListener(l.slice(2).toLowerCase(), y)) : y == null || y === !1 ? e.removeAttribute(l) : e.setAttribute(l, String(y)));
|
|
533
533
|
}
|
|
534
|
-
for (const [l,
|
|
534
|
+
for (const [l, b] of Object.entries(
|
|
535
535
|
s.listeners || {}
|
|
536
536
|
))
|
|
537
|
-
e.addEventListener(l,
|
|
537
|
+
e.addEventListener(l, b);
|
|
538
538
|
const p = t.attrs ?? {}, g = a;
|
|
539
539
|
for (const l in { ...p, ...g }) {
|
|
540
|
-
const
|
|
541
|
-
|
|
540
|
+
const b = p[l], y = g[l];
|
|
541
|
+
b !== y && (y == null || y === !1 ? e.removeAttribute(l) : e.setAttribute(l, String(y)));
|
|
542
542
|
}
|
|
543
543
|
}
|
|
544
544
|
function L(e, t, r) {
|
|
@@ -551,10 +551,10 @@ function L(e, t, r) {
|
|
|
551
551
|
return e.key != null && (g.key = e.key), g;
|
|
552
552
|
}
|
|
553
553
|
if (e.tag === "#anchor") {
|
|
554
|
-
const g = e, l = Array.isArray(g.children) ? g.children : [],
|
|
555
|
-
g.key != null && (
|
|
554
|
+
const g = e, l = Array.isArray(g.children) ? g.children : [], b = document.createTextNode(""), y = document.createTextNode("");
|
|
555
|
+
g.key != null && (b.key = `${g.key}:start`, y.key = `${g.key}:end`), g._startNode = b, g._endNode = y;
|
|
556
556
|
const m = document.createDocumentFragment();
|
|
557
|
-
m.appendChild(
|
|
557
|
+
m.appendChild(b);
|
|
558
558
|
for (const h of l) {
|
|
559
559
|
const d = L(h, t);
|
|
560
560
|
m.appendChild(d);
|
|
@@ -563,19 +563,19 @@ function L(e, t, r) {
|
|
|
563
563
|
}
|
|
564
564
|
const n = document.createElement(e.tag);
|
|
565
565
|
e.key != null && (n.key = e.key);
|
|
566
|
-
const { props: o = {}, attrs: s = {}, directives: i = {} } = e.props ?? {}, a =
|
|
566
|
+
const { props: o = {}, attrs: s = {}, directives: i = {} } = e.props ?? {}, a = be(i, t, n, s), c = {
|
|
567
567
|
...o,
|
|
568
568
|
...a.props
|
|
569
|
-
},
|
|
569
|
+
}, f = {
|
|
570
570
|
...s,
|
|
571
571
|
...a.attrs
|
|
572
572
|
};
|
|
573
|
-
for (const g in u) {
|
|
574
|
-
const l = u[g];
|
|
575
|
-
typeof l == "boolean" ? l && n.setAttribute(g, "") : l != null && n.setAttribute(g, String(l));
|
|
576
|
-
}
|
|
577
573
|
for (const g in f) {
|
|
578
574
|
const l = f[g];
|
|
575
|
+
typeof l == "boolean" ? l && n.setAttribute(g, "") : l != null && n.setAttribute(g, String(l));
|
|
576
|
+
}
|
|
577
|
+
for (const g in c) {
|
|
578
|
+
const l = c[g];
|
|
579
579
|
if (g === "value" && (n instanceof HTMLInputElement || n instanceof HTMLTextAreaElement || n instanceof HTMLSelectElement))
|
|
580
580
|
n.value = l ?? "";
|
|
581
581
|
else if (g === "checked" && n instanceof HTMLInputElement)
|
|
@@ -599,67 +599,67 @@ function L(e, t, r) {
|
|
|
599
599
|
else typeof e.children == "string" && (n.textContent = e.children);
|
|
600
600
|
return n;
|
|
601
601
|
}
|
|
602
|
-
function
|
|
602
|
+
function Oe(e, t, r, n, o) {
|
|
603
603
|
if (typeof r == "string") {
|
|
604
604
|
e.textContent !== r && (e.textContent = r);
|
|
605
605
|
return;
|
|
606
606
|
}
|
|
607
607
|
if (!Array.isArray(r)) return;
|
|
608
608
|
const s = Array.from(e.childNodes), i = Array.isArray(t) ? t : [], a = /* @__PURE__ */ new Map();
|
|
609
|
-
for (const
|
|
610
|
-
|
|
611
|
-
const
|
|
612
|
-
for (const
|
|
613
|
-
const y =
|
|
614
|
-
y != null &&
|
|
615
|
-
}
|
|
616
|
-
const
|
|
609
|
+
for (const b of i)
|
|
610
|
+
b && b.key != null && a.set(b.key, b);
|
|
611
|
+
const c = /* @__PURE__ */ new Map();
|
|
612
|
+
for (const b of s) {
|
|
613
|
+
const y = b.key;
|
|
614
|
+
y != null && c.set(y, b);
|
|
615
|
+
}
|
|
616
|
+
const f = /* @__PURE__ */ new Set();
|
|
617
617
|
let p = e.firstChild;
|
|
618
|
-
function g(
|
|
619
|
-
let m =
|
|
620
|
-
for (; m && (
|
|
618
|
+
function g(b, y) {
|
|
619
|
+
let m = b;
|
|
620
|
+
for (; m && (f.add(m), m !== y); )
|
|
621
621
|
m = m.nextSibling;
|
|
622
622
|
}
|
|
623
|
-
function l(
|
|
623
|
+
function l(b, y, m, h) {
|
|
624
624
|
const d = [];
|
|
625
|
-
let
|
|
626
|
-
for (;
|
|
627
|
-
d.push(
|
|
628
|
-
const
|
|
629
|
-
if (h.some(($) => $ && $.key != null) ||
|
|
625
|
+
let v = b.nextSibling;
|
|
626
|
+
for (; v && v !== y; )
|
|
627
|
+
d.push(v), v = v.nextSibling;
|
|
628
|
+
const x = Array.isArray(m) ? m : [];
|
|
629
|
+
if (h.some(($) => $ && $.key != null) || x.some(($) => $ && $.key != null)) {
|
|
630
630
|
const $ = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Map();
|
|
631
|
-
for (const
|
|
632
|
-
|
|
633
|
-
for (const
|
|
634
|
-
const
|
|
635
|
-
|
|
631
|
+
for (const C of x)
|
|
632
|
+
C && C.key != null && $.set(C.key, C);
|
|
633
|
+
for (const C of d) {
|
|
634
|
+
const k = C.key;
|
|
635
|
+
k != null && w.set(k, C);
|
|
636
636
|
}
|
|
637
637
|
const _ = /* @__PURE__ */ new Set();
|
|
638
|
-
let
|
|
639
|
-
for (const
|
|
640
|
-
let
|
|
641
|
-
if (
|
|
642
|
-
const
|
|
643
|
-
|
|
644
|
-
w.get(
|
|
645
|
-
|
|
646
|
-
|
|
638
|
+
let S = b.nextSibling;
|
|
639
|
+
for (const C of h) {
|
|
640
|
+
let k;
|
|
641
|
+
if (C.key != null && w.has(C.key)) {
|
|
642
|
+
const B = $.get(C.key);
|
|
643
|
+
k = Q(
|
|
644
|
+
w.get(C.key),
|
|
645
|
+
B,
|
|
646
|
+
C,
|
|
647
647
|
n
|
|
648
|
-
), _.add(
|
|
648
|
+
), _.add(k), k !== S && e.contains(k) && e.insertBefore(k, S);
|
|
649
649
|
} else
|
|
650
|
-
|
|
651
|
-
|
|
650
|
+
k = L(C, n), e.insertBefore(k, S), _.add(k);
|
|
651
|
+
S = k.nextSibling;
|
|
652
652
|
}
|
|
653
|
-
for (const
|
|
654
|
-
!_.has(
|
|
653
|
+
for (const C of d)
|
|
654
|
+
!_.has(C) && e.contains(C) && e.removeChild(C);
|
|
655
655
|
} else {
|
|
656
656
|
const $ = Math.min(
|
|
657
|
-
|
|
657
|
+
x.length,
|
|
658
658
|
h.length
|
|
659
659
|
);
|
|
660
660
|
for (let w = 0; w < $; w++) {
|
|
661
|
-
const _ =
|
|
662
|
-
|
|
661
|
+
const _ = x[w], S = h[w], C = Q(d[w], _, S, n);
|
|
662
|
+
C !== d[w] && (e.insertBefore(C, d[w]), e.removeChild(d[w]));
|
|
663
663
|
}
|
|
664
664
|
for (let w = $; w < h.length; w++)
|
|
665
665
|
e.insertBefore(L(h[w], n), y);
|
|
@@ -667,45 +667,45 @@ function Me(e, t, r, n, o) {
|
|
|
667
667
|
e.removeChild(d[w]);
|
|
668
668
|
}
|
|
669
669
|
}
|
|
670
|
-
for (const
|
|
670
|
+
for (const b of r) {
|
|
671
671
|
let y;
|
|
672
|
-
if (
|
|
673
|
-
const m =
|
|
674
|
-
let
|
|
675
|
-
const
|
|
676
|
-
if (
|
|
677
|
-
e.insertBefore(
|
|
678
|
-
for (const $ of
|
|
672
|
+
if (b.tag === "#anchor") {
|
|
673
|
+
const m = b.key, h = `${m}:start`, d = `${m}:end`;
|
|
674
|
+
let v = c.get(h), x = c.get(d);
|
|
675
|
+
const u = Array.isArray(b.children) ? b.children : [];
|
|
676
|
+
if (v || (v = document.createTextNode(""), v.key = h), x || (x = document.createTextNode(""), x.key = d), b._startNode = v, b._endNode = x, !e.contains(v) || !e.contains(x)) {
|
|
677
|
+
e.insertBefore(v, p);
|
|
678
|
+
for (const $ of u)
|
|
679
679
|
e.insertBefore(L($, n), p);
|
|
680
|
-
e.insertBefore(
|
|
680
|
+
e.insertBefore(x, p);
|
|
681
681
|
} else
|
|
682
682
|
l(
|
|
683
|
-
|
|
684
|
-
|
|
683
|
+
v,
|
|
684
|
+
x,
|
|
685
685
|
a.get(m)?.children,
|
|
686
|
-
|
|
686
|
+
u
|
|
687
687
|
);
|
|
688
|
-
g(
|
|
688
|
+
g(v, x), p = x.nextSibling;
|
|
689
689
|
continue;
|
|
690
690
|
}
|
|
691
|
-
if (
|
|
692
|
-
const m = a.get(
|
|
693
|
-
y =
|
|
694
|
-
|
|
691
|
+
if (b.key != null && c.has(b.key)) {
|
|
692
|
+
const m = a.get(b.key);
|
|
693
|
+
y = Q(
|
|
694
|
+
c.get(b.key),
|
|
695
695
|
m,
|
|
696
|
-
|
|
696
|
+
b,
|
|
697
697
|
n,
|
|
698
698
|
o
|
|
699
|
-
),
|
|
699
|
+
), f.add(y), y !== p && e.contains(y) && (p && !e.contains(p) && (p = null), e.insertBefore(y, p));
|
|
700
700
|
} else
|
|
701
|
-
y = L(
|
|
701
|
+
y = L(b, n, o), p && !e.contains(p) && (p = null), e.insertBefore(y, p), f.add(y);
|
|
702
702
|
p = y.nextSibling;
|
|
703
703
|
}
|
|
704
|
-
for (const
|
|
705
|
-
!
|
|
704
|
+
for (const b of s)
|
|
705
|
+
!f.has(b) && e.contains(b) && (M(b, o), e.removeChild(b));
|
|
706
706
|
}
|
|
707
|
-
function
|
|
708
|
-
if (t && typeof t != "string" && t.props?.ref && o &&
|
|
707
|
+
function Q(e, t, r, n, o) {
|
|
708
|
+
if (t && typeof t != "string" && t.props?.ref && o && M(e, o), t === r) return e;
|
|
709
709
|
if (typeof r == "string") {
|
|
710
710
|
if (e.nodeType === Node.TEXT_NODE)
|
|
711
711
|
return e.textContent !== r && (e.textContent = r), e;
|
|
@@ -715,78 +715,78 @@ function J(e, t, r, n, o) {
|
|
|
715
715
|
}
|
|
716
716
|
}
|
|
717
717
|
if (r && typeof r != "string" && r.tag === "#anchor") {
|
|
718
|
-
const i = r, a = Array.isArray(i.children) ? i.children : [],
|
|
719
|
-
i.key != null && (
|
|
718
|
+
const i = r, a = Array.isArray(i.children) ? i.children : [], c = i._startNode ?? document.createTextNode(""), f = i._endNode ?? document.createTextNode("");
|
|
719
|
+
i.key != null && (c.key = `${i.key}:start`, f.key = `${i.key}:end`), i._startNode = c, i._endNode = f;
|
|
720
720
|
const p = document.createDocumentFragment();
|
|
721
|
-
p.appendChild(
|
|
721
|
+
p.appendChild(c);
|
|
722
722
|
for (const g of a) {
|
|
723
723
|
const l = L(g, n);
|
|
724
724
|
p.appendChild(l);
|
|
725
725
|
}
|
|
726
|
-
return p.appendChild(
|
|
726
|
+
return p.appendChild(f), e.parentNode?.replaceChild(p, e), c;
|
|
727
727
|
}
|
|
728
728
|
if (!r) {
|
|
729
|
-
|
|
729
|
+
M(e, o);
|
|
730
730
|
const i = document.createComment("removed");
|
|
731
731
|
return e.parentNode?.replaceChild(i, e), i;
|
|
732
732
|
}
|
|
733
733
|
if (!t || typeof t == "string") {
|
|
734
|
-
|
|
734
|
+
M(e, o);
|
|
735
735
|
const i = L(r, n, o);
|
|
736
736
|
return typeof r != "string" && r.props?.ref && o && (o[r.props.ref] = i), e.parentNode?.replaceChild(i, e), i;
|
|
737
737
|
}
|
|
738
738
|
if (r.tag === "#anchor") {
|
|
739
|
-
const i = Array.isArray(r.children) ? r.children : [], a = r._startNode ?? document.createTextNode(""),
|
|
740
|
-
r.key != null && (a.key = `${r.key}:start`,
|
|
741
|
-
const
|
|
742
|
-
|
|
739
|
+
const i = Array.isArray(r.children) ? r.children : [], a = r._startNode ?? document.createTextNode(""), c = r._endNode ?? document.createTextNode("");
|
|
740
|
+
r.key != null && (a.key = `${r.key}:start`, c.key = `${r.key}:end`), r._startNode = a, r._endNode = c;
|
|
741
|
+
const f = document.createDocumentFragment();
|
|
742
|
+
f.appendChild(a);
|
|
743
743
|
for (const p of i)
|
|
744
|
-
|
|
745
|
-
return
|
|
744
|
+
f.appendChild(L(p, n));
|
|
745
|
+
return f.appendChild(c), e.parentNode?.replaceChild(f, e), a;
|
|
746
746
|
}
|
|
747
747
|
if (typeof t != "string" && typeof r != "string" && t.tag === r.tag && t.key === r.key) {
|
|
748
748
|
const i = e;
|
|
749
|
-
return
|
|
749
|
+
return Me(i, t.props || {}, r.props || {}, n), Oe(i, t.children, r.children, n, o), typeof r != "string" && r.props?.ref && o && (o[r.props.ref] = i), i;
|
|
750
750
|
}
|
|
751
|
-
|
|
751
|
+
M(e, o);
|
|
752
752
|
const s = L(r, n, o);
|
|
753
753
|
return typeof r != "string" && r.props?.ref && o && (o[r.props.ref] = s), e.parentNode?.replaceChild(s, e), s;
|
|
754
754
|
}
|
|
755
|
-
function
|
|
755
|
+
function Pe(e, t, r, n) {
|
|
756
756
|
let o;
|
|
757
757
|
Array.isArray(t) ? t.length === 1 ? (o = t[0], o && typeof o == "object" && o.key == null && (o = { ...o, key: "__root__" })) : o = { tag: "div", key: "__root__", children: t } : (o = t, o && typeof o == "object" && o.key == null && (o = { ...o, key: "__root__" })), o && typeof o == "object" && o.tag === "#anchor" && (o = {
|
|
758
758
|
tag: "div",
|
|
759
759
|
key: "__anchor_root__",
|
|
760
760
|
props: { attrs: { "data-anchor-block-root": "", key: "__anchor_root__" } },
|
|
761
761
|
children: [o]
|
|
762
|
-
}), o =
|
|
762
|
+
}), o = se(o, String(o.key ?? "root"));
|
|
763
763
|
const s = e._prevVNode ?? null, i = e._prevDom ?? e.firstChild ?? null;
|
|
764
764
|
let a;
|
|
765
|
-
s && i ? typeof s != "string" && typeof o != "string" && s.tag === o.tag && s.key === o.key ? a =
|
|
766
|
-
const
|
|
767
|
-
for (let
|
|
768
|
-
const p = e.childNodes[
|
|
769
|
-
p !== a && p.nodeName !== "STYLE" && (
|
|
765
|
+
s && i ? typeof s != "string" && typeof o != "string" && s.tag === o.tag && s.key === o.key ? a = Q(i, s, o, r, n) : (a = L(o, r, n), e.replaceChild(a, i)) : (a = L(o, r, n), e.firstChild ? e.replaceChild(a, e.firstChild) : e.appendChild(a));
|
|
766
|
+
const c = [];
|
|
767
|
+
for (let f = 0; f < e.childNodes.length; f++) {
|
|
768
|
+
const p = e.childNodes[f];
|
|
769
|
+
p !== a && p.nodeName !== "STYLE" && (M(p, n), c.push(p));
|
|
770
770
|
}
|
|
771
|
-
|
|
771
|
+
c.forEach((f) => e.removeChild(f)), e._prevVNode = o, e._prevDom = a;
|
|
772
772
|
}
|
|
773
|
-
function
|
|
773
|
+
function ve(e, ...t) {
|
|
774
774
|
let r = "";
|
|
775
775
|
for (let n = 0; n < e.length; n++)
|
|
776
776
|
r += e[n], n < t.length && (r += t[n]);
|
|
777
777
|
return r;
|
|
778
778
|
}
|
|
779
|
-
function
|
|
779
|
+
function xe(e) {
|
|
780
780
|
return e.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\s+/g, " ").replace(/\s*([{}:;,>+~])\s*/g, "$1").replace(/;}/g, "}").trim();
|
|
781
781
|
}
|
|
782
|
-
let
|
|
783
|
-
function
|
|
784
|
-
return
|
|
782
|
+
let U = null;
|
|
783
|
+
function ue() {
|
|
784
|
+
return U || (U = new CSSStyleSheet(), U.replaceSync(xe(De))), U;
|
|
785
785
|
}
|
|
786
|
-
function
|
|
786
|
+
function We(e) {
|
|
787
787
|
return e.replace(/url\s*\(\s*['"]?javascript:[^)]*\)/gi, "").replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi, "").replace(/expression\s*\([^)]*\)/gi, "");
|
|
788
788
|
}
|
|
789
|
-
const
|
|
789
|
+
const De = ve`
|
|
790
790
|
:host, *, ::before, ::after {
|
|
791
791
|
all: isolate;
|
|
792
792
|
box-sizing: border-box;
|
|
@@ -844,7 +844,7 @@ const We = be`
|
|
|
844
844
|
sup { top: -.5em }
|
|
845
845
|
[disabled], [aria-disabled=true] { cursor: not-allowed }
|
|
846
846
|
[hidden] { display: none }
|
|
847
|
-
`,
|
|
847
|
+
`, He = {
|
|
848
848
|
gray: {
|
|
849
849
|
50: "var(--color-gray-50, #f9fafb)",
|
|
850
850
|
100: "var(--color-gray-100, #f3f4f6)",
|
|
@@ -979,7 +979,7 @@ const We = be`
|
|
|
979
979
|
},
|
|
980
980
|
white: { DEFAULT: "var(--color-white, #ffffff)" },
|
|
981
981
|
black: { DEFAULT: "var(--color-black, #000000)" }
|
|
982
|
-
},
|
|
982
|
+
}, G = {
|
|
983
983
|
/* Display */
|
|
984
984
|
block: "display:block;",
|
|
985
985
|
inline: "display:inline;",
|
|
@@ -1153,7 +1153,7 @@ const We = be`
|
|
|
1153
1153
|
"transition-colors": "transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;",
|
|
1154
1154
|
"transition-opacity": "transition-property:opacity;",
|
|
1155
1155
|
"transition-transform": "transition-property:transform;"
|
|
1156
|
-
},
|
|
1156
|
+
}, qe = "0.25rem", de = {
|
|
1157
1157
|
m: ["margin"],
|
|
1158
1158
|
mx: ["margin-inline"],
|
|
1159
1159
|
my: ["margin-block"],
|
|
@@ -1184,7 +1184,7 @@ const We = be`
|
|
|
1184
1184
|
gap: ["gap"],
|
|
1185
1185
|
"gap-x": ["column-gap"],
|
|
1186
1186
|
"gap-y": ["row-gap"]
|
|
1187
|
-
},
|
|
1187
|
+
}, Ie = {
|
|
1188
1188
|
// State variants
|
|
1189
1189
|
before: (e, t) => `${e}::before{${t}}`,
|
|
1190
1190
|
after: (e, t) => `${e}::after{${t}}`,
|
|
@@ -1210,7 +1210,7 @@ const We = be`
|
|
|
1210
1210
|
"peer-focus": (e, t) => `.peer:focus ~ ${e}{${t}}`,
|
|
1211
1211
|
"peer-checked": (e, t) => `.peer:checked ~ ${e}{${t}}`,
|
|
1212
1212
|
"peer-disabled": (e, t) => `.peer:disabled ~ ${e}{${t}}`
|
|
1213
|
-
},
|
|
1213
|
+
}, pe = {
|
|
1214
1214
|
// Responsive
|
|
1215
1215
|
sm: "(min-width:640px)",
|
|
1216
1216
|
md: "(min-width:768px)",
|
|
@@ -1219,23 +1219,23 @@ const We = be`
|
|
|
1219
1219
|
"2xl": "(min-width:1536px)",
|
|
1220
1220
|
// Dark mode (now plain string)
|
|
1221
1221
|
dark: "(prefers-color-scheme: dark)"
|
|
1222
|
-
},
|
|
1223
|
-
function
|
|
1222
|
+
}, ee = ["sm", "md", "lg", "xl", "2xl"];
|
|
1223
|
+
function te(e) {
|
|
1224
1224
|
const t = e.startsWith("-"), n = (t ? e.slice(1) : e).split("-");
|
|
1225
1225
|
if (n.length < 2) return null;
|
|
1226
1226
|
const o = n.slice(0, -1).join("-"), s = n[n.length - 1], i = parseFloat(s);
|
|
1227
|
-
if (Number.isNaN(i) || !
|
|
1227
|
+
if (Number.isNaN(i) || !de[o]) return null;
|
|
1228
1228
|
const a = t ? "-" : "";
|
|
1229
|
-
return
|
|
1229
|
+
return de[o].map((c) => `${c}:calc(${a}${qe} * ${i});`).join("");
|
|
1230
1230
|
}
|
|
1231
|
-
function
|
|
1231
|
+
function he(e) {
|
|
1232
1232
|
const t = e.replace("#", ""), r = parseInt(t, 16), n = r >> 16 & 255, o = r >> 8 & 255, s = r & 255;
|
|
1233
1233
|
return `${n} ${o} ${s}`;
|
|
1234
1234
|
}
|
|
1235
|
-
function
|
|
1235
|
+
function Fe(e) {
|
|
1236
1236
|
const t = /^(bg|text|border|decoration|shadow|outline|caret|accent|fill|stroke)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);
|
|
1237
1237
|
if (!t) return null;
|
|
1238
|
-
const [, r, n, o = "DEFAULT"] = t, s =
|
|
1238
|
+
const [, r, n, o = "DEFAULT"] = t, s = He[n]?.[o];
|
|
1239
1239
|
return s ? `${{
|
|
1240
1240
|
bg: "background-color",
|
|
1241
1241
|
decoration: "text-decoration-color",
|
|
@@ -1250,35 +1250,35 @@ function Ie(e) {
|
|
|
1250
1250
|
stroke: "stroke-color"
|
|
1251
1251
|
}[r]}:${s};` : null;
|
|
1252
1252
|
}
|
|
1253
|
-
function
|
|
1253
|
+
function Ke(e) {
|
|
1254
1254
|
const [t, r] = e.split("/");
|
|
1255
1255
|
if (!r) return { base: t };
|
|
1256
1256
|
const n = parseInt(r, 10);
|
|
1257
1257
|
return isNaN(n) || n < 0 || n > 100 ? { base: t } : { base: t, opacity: n / 100 };
|
|
1258
1258
|
}
|
|
1259
|
-
function
|
|
1260
|
-
const { base: t, opacity: r } =
|
|
1259
|
+
function re(e) {
|
|
1260
|
+
const { base: t, opacity: r } = Ke(e), n = Fe(t);
|
|
1261
1261
|
if (n) {
|
|
1262
1262
|
if (r !== void 0) {
|
|
1263
1263
|
const s = /#([0-9a-f]{6})/i.exec(n);
|
|
1264
1264
|
if (s) {
|
|
1265
|
-
const i =
|
|
1265
|
+
const i = he(s[0]);
|
|
1266
1266
|
return n.replace(/#([0-9a-f]{6})/i, `rgb(${i} / ${r})`);
|
|
1267
1267
|
}
|
|
1268
1268
|
}
|
|
1269
1269
|
return n;
|
|
1270
1270
|
}
|
|
1271
|
-
const o =
|
|
1271
|
+
const o = Z(t);
|
|
1272
1272
|
if (o && r !== void 0) {
|
|
1273
1273
|
const s = /#([0-9a-f]{6})/i.exec(o);
|
|
1274
1274
|
if (s) {
|
|
1275
|
-
const i =
|
|
1275
|
+
const i = he(s[0]);
|
|
1276
1276
|
return o.replace(/#([0-9a-f]{6})/i, `rgb(${i} / ${r})`);
|
|
1277
1277
|
}
|
|
1278
1278
|
}
|
|
1279
1279
|
return o;
|
|
1280
1280
|
}
|
|
1281
|
-
function
|
|
1281
|
+
function Z(e) {
|
|
1282
1282
|
const t = e.indexOf("-["), r = e.endsWith("]");
|
|
1283
1283
|
if (t > 0 && r) {
|
|
1284
1284
|
const n = e.slice(0, t);
|
|
@@ -1328,13 +1328,13 @@ function Q(e) {
|
|
|
1328
1328
|
}
|
|
1329
1329
|
return null;
|
|
1330
1330
|
}
|
|
1331
|
-
function
|
|
1331
|
+
function Ve(e) {
|
|
1332
1332
|
return e.startsWith("[") && e.endsWith("]") ? e : e.indexOf("-[") > 0 && e.endsWith("]") ? e.replace(/_/g, "-") : null;
|
|
1333
1333
|
}
|
|
1334
|
-
function
|
|
1334
|
+
function Ue(e) {
|
|
1335
1335
|
return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, "\\$1");
|
|
1336
1336
|
}
|
|
1337
|
-
function
|
|
1337
|
+
function Je(e) {
|
|
1338
1338
|
const t = /class\s*=\s*["']([^"']+)["']/g, r = [];
|
|
1339
1339
|
let n;
|
|
1340
1340
|
for (; n = t.exec(e); ) {
|
|
@@ -1343,100 +1343,100 @@ function Ue(e) {
|
|
|
1343
1343
|
}
|
|
1344
1344
|
return r.filter(Boolean);
|
|
1345
1345
|
}
|
|
1346
|
-
const
|
|
1347
|
-
function
|
|
1348
|
-
const t = Date.now(), r =
|
|
1349
|
-
if (r && t - r.timestamp <
|
|
1350
|
-
const n =
|
|
1346
|
+
const ge = /* @__PURE__ */ new Map(), Qe = 16;
|
|
1347
|
+
function Ze(e) {
|
|
1348
|
+
const t = Date.now(), r = ge.get(e);
|
|
1349
|
+
if (r && t - r.timestamp < Qe) return r.css;
|
|
1350
|
+
const n = Je(e), o = new Set(n), s = [], i = [], a = [], c = [], f = {};
|
|
1351
1351
|
function p(y, m = !1) {
|
|
1352
1352
|
const h = (m ? "dark|" : "") + y;
|
|
1353
|
-
if (h in
|
|
1353
|
+
if (h in f) return f[h];
|
|
1354
1354
|
const d = l(y, m);
|
|
1355
|
-
return
|
|
1355
|
+
return f[h] = d, d;
|
|
1356
1356
|
}
|
|
1357
1357
|
function g(y) {
|
|
1358
|
-
const m = y.some((d) =>
|
|
1358
|
+
const m = y.some((d) => ee.includes(d)), h = y.includes("dark");
|
|
1359
1359
|
return y.length === 0 ? 1 : !m && !h ? 2 : m && !h ? 3 : 4;
|
|
1360
1360
|
}
|
|
1361
1361
|
function l(y, m = !1) {
|
|
1362
1362
|
const h = y.split(":"), d = h.find(
|
|
1363
|
-
(
|
|
1363
|
+
(k) => G[k] || te(k) || re(k) || Z(k)
|
|
1364
1364
|
);
|
|
1365
1365
|
if (!d) return null;
|
|
1366
|
-
const
|
|
1367
|
-
if (!
|
|
1368
|
-
let
|
|
1366
|
+
const v = G[d] ?? te(d) ?? re(d) ?? Z(d);
|
|
1367
|
+
if (!v) return null;
|
|
1368
|
+
let x = `.${Ue(y)}`, u = v;
|
|
1369
1369
|
const $ = h.indexOf(d);
|
|
1370
1370
|
let w = $ >= 0 ? h.slice(0, $) : [];
|
|
1371
|
-
m && (w = w.filter((
|
|
1372
|
-
const _ = w.filter((
|
|
1373
|
-
for (const
|
|
1374
|
-
const
|
|
1375
|
-
if (
|
|
1376
|
-
|
|
1371
|
+
m && (w = w.filter((k) => k !== "dark"));
|
|
1372
|
+
const _ = w.filter((k) => ee.includes(k)), S = _.length ? _[_.length - 1] : null;
|
|
1373
|
+
for (const k of w) {
|
|
1374
|
+
const B = Ve(k);
|
|
1375
|
+
if (B) {
|
|
1376
|
+
x = `${B}${x}`;
|
|
1377
1377
|
continue;
|
|
1378
1378
|
}
|
|
1379
|
-
if (
|
|
1380
|
-
const
|
|
1381
|
-
typeof
|
|
1379
|
+
if (ee.includes(k)) continue;
|
|
1380
|
+
const A = Ie[k];
|
|
1381
|
+
typeof A == "function" && (x = A(x, u).replace(/\{.*$/, ""));
|
|
1382
1382
|
}
|
|
1383
|
-
let
|
|
1384
|
-
return m &&
|
|
1383
|
+
let C = `${x}{${u}}`;
|
|
1384
|
+
return m && S ? C = `@media (prefers-color-scheme: dark) and ${pe[S]}{${C}}` : m ? C = `@media (prefers-color-scheme: dark){${C}}` : S && (C = `@media ${pe[S]}{${C}}`), C;
|
|
1385
1385
|
}
|
|
1386
1386
|
for (const y of o) {
|
|
1387
1387
|
const m = y.split(":"), h = m.find(
|
|
1388
|
-
(
|
|
1388
|
+
(u) => G[u] || te(u) || re(u) || Z(u)
|
|
1389
1389
|
);
|
|
1390
1390
|
if (!h) continue;
|
|
1391
|
-
const d = m.indexOf(h),
|
|
1392
|
-
if (
|
|
1393
|
-
const
|
|
1394
|
-
|
|
1391
|
+
const d = m.indexOf(h), v = d >= 0 ? m.slice(0, d) : [], x = g(v);
|
|
1392
|
+
if (x === 4) {
|
|
1393
|
+
const u = p(y, !0);
|
|
1394
|
+
u && c.push(u);
|
|
1395
1395
|
} else {
|
|
1396
|
-
const
|
|
1397
|
-
|
|
1396
|
+
const u = p(y);
|
|
1397
|
+
u && (x === 1 ? s.push(u) : x === 2 ? i.push(u) : x === 3 && a.push(u));
|
|
1398
1398
|
}
|
|
1399
1399
|
}
|
|
1400
|
-
const
|
|
1401
|
-
return
|
|
1400
|
+
const b = [...s, ...i, ...a, ...c].join("");
|
|
1401
|
+
return ge.set(e, { css: b, timestamp: t }), b;
|
|
1402
1402
|
}
|
|
1403
|
-
const
|
|
1404
|
-
function
|
|
1403
|
+
const F = [];
|
|
1404
|
+
function Xe(e, t, r, n, o, s, i, a) {
|
|
1405
1405
|
if (e) {
|
|
1406
|
-
|
|
1406
|
+
F.push(r);
|
|
1407
1407
|
try {
|
|
1408
1408
|
if (t.loadingTemplate && r.isLoading) {
|
|
1409
|
-
|
|
1409
|
+
P(e, t.loadingTemplate(r), r, n, o);
|
|
1410
1410
|
return;
|
|
1411
1411
|
}
|
|
1412
1412
|
if (t.errorTemplate && r.hasError) {
|
|
1413
|
-
r.error instanceof Error &&
|
|
1413
|
+
r.error instanceof Error && P(e, t.errorTemplate(r.error, r), r, n, o);
|
|
1414
1414
|
return;
|
|
1415
1415
|
}
|
|
1416
|
-
const
|
|
1417
|
-
if (
|
|
1418
|
-
s(!0),
|
|
1419
|
-
s(!1), i(null),
|
|
1420
|
-
}).catch((
|
|
1421
|
-
s(!1), i(
|
|
1422
|
-
}), t.loadingTemplate &&
|
|
1416
|
+
const c = t.render(r);
|
|
1417
|
+
if (c instanceof Promise) {
|
|
1418
|
+
s(!0), c.then((f) => {
|
|
1419
|
+
s(!1), i(null), P(e, f, r, n, o), a(e.innerHTML);
|
|
1420
|
+
}).catch((f) => {
|
|
1421
|
+
s(!1), i(f), t.errorTemplate && P(e, t.errorTemplate(f, r), r, n, o);
|
|
1422
|
+
}), t.loadingTemplate && P(e, t.loadingTemplate(r), r, n, o);
|
|
1423
1423
|
return;
|
|
1424
1424
|
}
|
|
1425
|
-
|
|
1425
|
+
P(e, c, r, n, o), a(e.innerHTML);
|
|
1426
1426
|
} finally {
|
|
1427
|
-
|
|
1427
|
+
F.pop();
|
|
1428
1428
|
}
|
|
1429
1429
|
}
|
|
1430
1430
|
}
|
|
1431
|
-
function
|
|
1432
|
-
e && (
|
|
1431
|
+
function P(e, t, r, n, o) {
|
|
1432
|
+
e && (Pe(
|
|
1433
1433
|
e,
|
|
1434
1434
|
Array.isArray(t) ? t : [t],
|
|
1435
1435
|
r,
|
|
1436
1436
|
n
|
|
1437
1437
|
), o(e.innerHTML));
|
|
1438
1438
|
}
|
|
1439
|
-
function
|
|
1439
|
+
function Ye(e, t, r, n, o, s, i) {
|
|
1440
1440
|
if (s !== null && clearTimeout(s), Date.now() - t < 16) {
|
|
1441
1441
|
if (o(r + 1), r > 10) {
|
|
1442
1442
|
console.warn("Potential infinite render loop detected. Skipping render."), i(null);
|
|
@@ -1444,37 +1444,37 @@ function Xe(e, t, r, n, o, s, i) {
|
|
|
1444
1444
|
}
|
|
1445
1445
|
} else
|
|
1446
1446
|
o(0);
|
|
1447
|
-
const
|
|
1447
|
+
const c = setTimeout(() => {
|
|
1448
1448
|
n(Date.now()), e(), i(null);
|
|
1449
1449
|
}, 0);
|
|
1450
|
-
i(
|
|
1450
|
+
i(c);
|
|
1451
1451
|
}
|
|
1452
|
-
function
|
|
1452
|
+
function Ge(e, t, r, n, o, s) {
|
|
1453
1453
|
if (!e) return;
|
|
1454
|
-
const i =
|
|
1454
|
+
const i = Ze(n);
|
|
1455
1455
|
if (!t.style && (!i || i.trim() === "")) {
|
|
1456
|
-
s(null), e.adoptedStyleSheets = [
|
|
1456
|
+
s(null), e.adoptedStyleSheets = [ue()];
|
|
1457
1457
|
return;
|
|
1458
1458
|
}
|
|
1459
1459
|
let a = "";
|
|
1460
1460
|
t.style && (typeof t.style == "string" ? a = t.style : typeof t.style == "function" && (a = t.style(r)));
|
|
1461
|
-
let
|
|
1461
|
+
let c = We(`${a}
|
|
1462
1462
|
${i}
|
|
1463
1463
|
`);
|
|
1464
|
-
|
|
1465
|
-
let
|
|
1466
|
-
|
|
1464
|
+
c = xe(c);
|
|
1465
|
+
let f = o;
|
|
1466
|
+
f || (f = new CSSStyleSheet()), (f.cssRules.length === 0 || f.toString() !== c) && f.replaceSync(c), e.adoptedStyleSheets = [ue(), f], s(f);
|
|
1467
1467
|
}
|
|
1468
|
-
const
|
|
1469
|
-
function
|
|
1470
|
-
let n =
|
|
1468
|
+
const et = /* @__PURE__ */ new Map();
|
|
1469
|
+
function ye(e, t, r) {
|
|
1470
|
+
let n = ae(e);
|
|
1471
1471
|
n.includes("-") || (n = `cer-${n}`);
|
|
1472
1472
|
let o;
|
|
1473
1473
|
typeof t == "function" ? o = { ...r, render: t } : o = t, typeof o.onError != "function" && (o.onError = (s, i) => {
|
|
1474
1474
|
console.error(`[${n}] Error:`, s, i);
|
|
1475
|
-
}),
|
|
1475
|
+
}), et.set(n, o), typeof window < "u" && !customElements.get(n) && customElements.define(n, tt(o));
|
|
1476
1476
|
}
|
|
1477
|
-
function
|
|
1477
|
+
function tt(e) {
|
|
1478
1478
|
if (!e.render)
|
|
1479
1479
|
throw new Error(
|
|
1480
1480
|
"Component must have a render function"
|
|
@@ -1540,8 +1540,8 @@ function et(e) {
|
|
|
1540
1540
|
...o || {}
|
|
1541
1541
|
})
|
|
1542
1542
|
);
|
|
1543
|
-
const s = `on${r.charAt(0).toUpperCase()}${r.slice(1)}`, i = typeof this[s] == "function" ? this[s] : void 0, a = typeof this.context[s] == "function" ? this.context[s] : void 0,
|
|
1544
|
-
i && i(n, this.context), a && a !== i && a(n, this.context),
|
|
1543
|
+
const s = `on${r.charAt(0).toUpperCase()}${r.slice(1)}`, i = typeof this[s] == "function" ? this[s] : void 0, a = typeof this.context[s] == "function" ? this.context[s] : void 0, c = typeof e[s] == "function" ? e[s] : void 0;
|
|
1544
|
+
i && i(n, this.context), a && a !== i && a(n, this.context), c && c !== i && c !== a && c(n, this.context);
|
|
1545
1545
|
},
|
|
1546
1546
|
writable: !1,
|
|
1547
1547
|
enumerable: !1,
|
|
@@ -1561,7 +1561,7 @@ function et(e) {
|
|
|
1561
1561
|
}
|
|
1562
1562
|
connectedCallback() {
|
|
1563
1563
|
this._runLogicWithinErrorBoundary(e, () => {
|
|
1564
|
-
|
|
1564
|
+
Ee(
|
|
1565
1565
|
e,
|
|
1566
1566
|
this.context,
|
|
1567
1567
|
this._mounted,
|
|
@@ -1573,7 +1573,7 @@ function et(e) {
|
|
|
1573
1573
|
}
|
|
1574
1574
|
disconnectedCallback() {
|
|
1575
1575
|
this._runLogicWithinErrorBoundary(e, () => {
|
|
1576
|
-
|
|
1576
|
+
Te(
|
|
1577
1577
|
e,
|
|
1578
1578
|
this.context,
|
|
1579
1579
|
this._listeners,
|
|
@@ -1597,7 +1597,7 @@ function et(e) {
|
|
|
1597
1597
|
}
|
|
1598
1598
|
attributeChangedCallback(t, r, n) {
|
|
1599
1599
|
this._runLogicWithinErrorBoundary(e, () => {
|
|
1600
|
-
this._applyProps(e),
|
|
1600
|
+
this._applyProps(e), je(
|
|
1601
1601
|
e,
|
|
1602
1602
|
t,
|
|
1603
1603
|
r,
|
|
@@ -1607,7 +1607,7 @@ function et(e) {
|
|
|
1607
1607
|
});
|
|
1608
1608
|
}
|
|
1609
1609
|
static get observedAttributes() {
|
|
1610
|
-
return e.props ? Object.keys(e.props).map(
|
|
1610
|
+
return e.props ? Object.keys(e.props).map(ae) : [];
|
|
1611
1611
|
}
|
|
1612
1612
|
_applyComputed(t) {
|
|
1613
1613
|
this._runLogicWithinErrorBoundary(e, () => {
|
|
@@ -1615,7 +1615,7 @@ function et(e) {
|
|
|
1615
1615
|
Object.defineProperty(this.context, r, {
|
|
1616
1616
|
get: () => {
|
|
1617
1617
|
const o = n(this.context);
|
|
1618
|
-
return
|
|
1618
|
+
return oe(o);
|
|
1619
1619
|
},
|
|
1620
1620
|
enumerable: !0
|
|
1621
1621
|
});
|
|
@@ -1625,7 +1625,7 @@ function et(e) {
|
|
|
1625
1625
|
// --- Render ---
|
|
1626
1626
|
_render(t) {
|
|
1627
1627
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1628
|
-
|
|
1628
|
+
Xe(
|
|
1629
1629
|
this.shadowRoot,
|
|
1630
1630
|
t,
|
|
1631
1631
|
this.context,
|
|
@@ -1648,7 +1648,7 @@ function et(e) {
|
|
|
1648
1648
|
}
|
|
1649
1649
|
_requestRender() {
|
|
1650
1650
|
this._runLogicWithinErrorBoundary(this._cfg, () => {
|
|
1651
|
-
|
|
1651
|
+
Ye(
|
|
1652
1652
|
() => this._render(this._cfg),
|
|
1653
1653
|
this._lastRenderTime,
|
|
1654
1654
|
this._renderCount,
|
|
@@ -1668,7 +1668,7 @@ function et(e) {
|
|
|
1668
1668
|
// --- Style ---
|
|
1669
1669
|
_applyStyle(t, r) {
|
|
1670
1670
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1671
|
-
|
|
1671
|
+
Ge(
|
|
1672
1672
|
this.shadowRoot,
|
|
1673
1673
|
t,
|
|
1674
1674
|
this.context,
|
|
@@ -1697,9 +1697,9 @@ function et(e) {
|
|
|
1697
1697
|
try {
|
|
1698
1698
|
let r = function(o, s = "") {
|
|
1699
1699
|
return Array.isArray(o) ? new Proxy(o, {
|
|
1700
|
-
get(i, a,
|
|
1701
|
-
const
|
|
1702
|
-
return typeof
|
|
1700
|
+
get(i, a, c) {
|
|
1701
|
+
const f = Reflect.get(i, a, c);
|
|
1702
|
+
return typeof f == "function" && typeof a == "string" && [
|
|
1703
1703
|
"push",
|
|
1704
1704
|
"pop",
|
|
1705
1705
|
"shift",
|
|
@@ -1708,25 +1708,25 @@ function et(e) {
|
|
|
1708
1708
|
"sort",
|
|
1709
1709
|
"reverse"
|
|
1710
1710
|
].includes(a) ? function(...g) {
|
|
1711
|
-
const l =
|
|
1711
|
+
const l = f.apply(i, g);
|
|
1712
1712
|
if (!n._initializing) {
|
|
1713
|
-
const
|
|
1714
|
-
n._triggerWatchers(
|
|
1713
|
+
const b = s || "root";
|
|
1714
|
+
n._triggerWatchers(b, i), n._render(t);
|
|
1715
1715
|
}
|
|
1716
1716
|
return l;
|
|
1717
|
-
} :
|
|
1717
|
+
} : f;
|
|
1718
1718
|
},
|
|
1719
|
-
set(i, a,
|
|
1720
|
-
if (i[a] =
|
|
1721
|
-
const
|
|
1722
|
-
n._triggerWatchers(
|
|
1719
|
+
set(i, a, c) {
|
|
1720
|
+
if (i[a] = c, !n._initializing) {
|
|
1721
|
+
const f = s ? `${s}.${String(a)}` : String(a);
|
|
1722
|
+
n._triggerWatchers(f, c), n._render(t);
|
|
1723
1723
|
}
|
|
1724
1724
|
return !0;
|
|
1725
1725
|
},
|
|
1726
1726
|
deleteProperty(i, a) {
|
|
1727
1727
|
if (delete i[a], !n._initializing) {
|
|
1728
|
-
const
|
|
1729
|
-
n._triggerWatchers(
|
|
1728
|
+
const c = s ? `${s}.${String(a)}` : String(a);
|
|
1729
|
+
n._triggerWatchers(c, void 0), n._render(t);
|
|
1730
1730
|
}
|
|
1731
1731
|
return !0;
|
|
1732
1732
|
}
|
|
@@ -1734,15 +1734,15 @@ function et(e) {
|
|
|
1734
1734
|
const a = s ? `${s}.${i}` : i;
|
|
1735
1735
|
o[i] = r(o[i], a);
|
|
1736
1736
|
}), new Proxy(o, {
|
|
1737
|
-
set(i, a,
|
|
1738
|
-
const
|
|
1739
|
-
return i[a] = r(
|
|
1740
|
-
|
|
1737
|
+
set(i, a, c) {
|
|
1738
|
+
const f = s ? `${s}.${String(a)}` : String(a);
|
|
1739
|
+
return i[a] = r(c, f), n._initializing || (n._triggerWatchers(
|
|
1740
|
+
f,
|
|
1741
1741
|
i[a]
|
|
1742
1742
|
), n._render(t)), !0;
|
|
1743
1743
|
},
|
|
1744
|
-
get(i, a,
|
|
1745
|
-
return Reflect.get(i, a,
|
|
1744
|
+
get(i, a, c) {
|
|
1745
|
+
return Reflect.get(i, a, c);
|
|
1746
1746
|
}
|
|
1747
1747
|
})) : o;
|
|
1748
1748
|
};
|
|
@@ -1754,7 +1754,7 @@ function et(e) {
|
|
|
1754
1754
|
}
|
|
1755
1755
|
_initWatchers(t) {
|
|
1756
1756
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1757
|
-
|
|
1757
|
+
Se(
|
|
1758
1758
|
this.context,
|
|
1759
1759
|
this._watchers,
|
|
1760
1760
|
t.watch || {}
|
|
@@ -1762,12 +1762,12 @@ function et(e) {
|
|
|
1762
1762
|
});
|
|
1763
1763
|
}
|
|
1764
1764
|
_triggerWatchers(t, r) {
|
|
1765
|
-
|
|
1765
|
+
Ce(this.context, this._watchers, t, r);
|
|
1766
1766
|
}
|
|
1767
1767
|
_applyProps(t) {
|
|
1768
1768
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1769
1769
|
try {
|
|
1770
|
-
|
|
1770
|
+
Ae(this, t, this.context);
|
|
1771
1771
|
} catch (r) {
|
|
1772
1772
|
this._hasError = !0, t.onError && t.onError(r, this.context), t.errorFallback && this.shadowRoot && (this.shadowRoot.innerHTML = t.errorFallback(r, this.context));
|
|
1773
1773
|
}
|
|
@@ -1775,159 +1775,175 @@ function et(e) {
|
|
|
1775
1775
|
}
|
|
1776
1776
|
};
|
|
1777
1777
|
}
|
|
1778
|
-
function
|
|
1778
|
+
function I(e, t = {}, r, n) {
|
|
1779
1779
|
const o = n ?? t.key;
|
|
1780
1780
|
return { tag: e, key: o, props: t, children: r };
|
|
1781
1781
|
}
|
|
1782
|
-
function
|
|
1782
|
+
function X(e) {
|
|
1783
1783
|
return !!e && typeof e == "object" && (e.type === "AnchorBlock" || e.tag === "#anchor");
|
|
1784
1784
|
}
|
|
1785
|
-
function
|
|
1786
|
-
return typeof e == "object" && e !== null && "tag" in e && !
|
|
1785
|
+
function J(e) {
|
|
1786
|
+
return typeof e == "object" && e !== null && "tag" in e && !X(e);
|
|
1787
1787
|
}
|
|
1788
|
-
function
|
|
1788
|
+
function rt(e, t) {
|
|
1789
1789
|
return e.key != null ? e : { ...e, key: t };
|
|
1790
1790
|
}
|
|
1791
|
-
function
|
|
1791
|
+
function nt(e, t = [], r = {}) {
|
|
1792
1792
|
const n = {}, o = {}, s = {}, i = /([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;
|
|
1793
1793
|
let a;
|
|
1794
1794
|
for (; a = i.exec(e); ) {
|
|
1795
|
-
const
|
|
1795
|
+
const c = a[1], f = a[2], p = (a[4] || a[6]) ?? "", g = p.match(/^{{(\d+)}}$/);
|
|
1796
1796
|
let l = g ? t[Number(g[1])] ?? null : p;
|
|
1797
|
-
if (g || (l === "true" ? l = !0 : l === "false" ? l = !1 : l === "null" ? l = null : isNaN(Number(l)) || (l = Number(l))),
|
|
1798
|
-
typeof l == "boolean" ? o[
|
|
1799
|
-
else if (
|
|
1800
|
-
const
|
|
1801
|
-
n[
|
|
1802
|
-
} else if (
|
|
1803
|
-
const [
|
|
1797
|
+
if (g || (l === "true" ? l = !0 : l === "false" ? l = !1 : l === "null" ? l = null : isNaN(Number(l)) || (l = Number(l))), c === ":")
|
|
1798
|
+
typeof l == "boolean" ? o[f] = l : l != null && (typeof r[l] < "u" ? n[f] = r[l] : n[f] = l);
|
|
1799
|
+
else if (c === "@") {
|
|
1800
|
+
const b = "on" + f.charAt(0).toUpperCase() + f.slice(1);
|
|
1801
|
+
n[b] = typeof l == "function" ? l : typeof r[l] == "function" ? r[l] : void 0;
|
|
1802
|
+
} else if (c === "#") {
|
|
1803
|
+
const [b, ...y] = f.split("."), m = [...y];
|
|
1804
1804
|
let h = l, d = [...m];
|
|
1805
|
-
if (
|
|
1806
|
-
const
|
|
1807
|
-
let
|
|
1805
|
+
if (b === "model" && typeof h == "string" && h.includes(".")) {
|
|
1806
|
+
const v = ["trim", "number", "lazy"], x = h.split(".");
|
|
1807
|
+
let u = h;
|
|
1808
1808
|
const $ = [];
|
|
1809
|
-
for (let w =
|
|
1810
|
-
$.unshift(
|
|
1811
|
-
h =
|
|
1809
|
+
for (let w = x.length - 1; w > 0 && v.includes(x[w]); w--)
|
|
1810
|
+
$.unshift(x[w]), u = x.slice(0, w).join(".");
|
|
1811
|
+
h = u, d.push(...$);
|
|
1812
1812
|
}
|
|
1813
|
-
s[
|
|
1813
|
+
s[b] = {
|
|
1814
1814
|
value: h,
|
|
1815
1815
|
modifiers: d
|
|
1816
1816
|
};
|
|
1817
|
-
} else
|
|
1817
|
+
} else f === "ref" ? n.ref = l : o[f] = l;
|
|
1818
1818
|
}
|
|
1819
1819
|
return { props: n, attrs: o, directives: s };
|
|
1820
1820
|
}
|
|
1821
|
-
function
|
|
1822
|
-
const n =
|
|
1823
|
-
function s(
|
|
1824
|
-
return
|
|
1821
|
+
function ot(e, t, r) {
|
|
1822
|
+
const n = F.length > 0 ? F[F.length - 1] : void 0, o = r ?? n;
|
|
1823
|
+
function s(u, $) {
|
|
1824
|
+
return I("#text", {}, u, $);
|
|
1825
1825
|
}
|
|
1826
1826
|
let i = "";
|
|
1827
|
-
for (let
|
|
1828
|
-
i += e[
|
|
1829
|
-
const a = /<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g,
|
|
1830
|
-
let
|
|
1831
|
-
function h(
|
|
1832
|
-
!
|
|
1833
|
-
if (
|
|
1834
|
-
const
|
|
1827
|
+
for (let u = 0; u < e.length; u++)
|
|
1828
|
+
i += e[u], u < t.length && (i += `{{${u}}}`);
|
|
1829
|
+
const a = /<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g, c = [];
|
|
1830
|
+
let f, p = [], g = null, l = {}, b, y = 0, m = [];
|
|
1831
|
+
function h(u) {
|
|
1832
|
+
!u || typeof u != "object" || X(u) || (u.props || u.attrs ? (u.props && (l.props || (l.props = {}), Object.assign(l.props, u.props)), u.attrs && (l.attrs || (l.attrs = {}), Object.keys(u.attrs).forEach(($) => {
|
|
1833
|
+
if ($ === "style" && l.attrs.style) {
|
|
1834
|
+
const w = l.attrs.style.replace(
|
|
1835
1835
|
/;?\s*$/,
|
|
1836
1836
|
""
|
|
1837
|
-
),
|
|
1838
|
-
l.attrs.style =
|
|
1839
|
-
} else if (
|
|
1840
|
-
const
|
|
1841
|
-
.../* @__PURE__ */ new Set([
|
|
1837
|
+
), _ = u.attrs.style.replace(/^;?\s*/, "");
|
|
1838
|
+
l.attrs.style = w + "; " + _;
|
|
1839
|
+
} else if ($ === "class" && l.attrs.class) {
|
|
1840
|
+
const w = l.attrs.class.trim().split(/\s+/).filter(Boolean), _ = u.attrs.class.trim().split(/\s+/).filter(Boolean), S = [
|
|
1841
|
+
.../* @__PURE__ */ new Set([...w, ..._])
|
|
1842
1842
|
];
|
|
1843
|
-
l.attrs.class =
|
|
1843
|
+
l.attrs.class = S.join(" ");
|
|
1844
1844
|
} else
|
|
1845
|
-
l.attrs[
|
|
1846
|
-
}))) : (l.props || (l.props = {}), Object.assign(l.props,
|
|
1847
|
-
}
|
|
1848
|
-
function d(
|
|
1849
|
-
const
|
|
1850
|
-
if (
|
|
1851
|
-
const
|
|
1852
|
-
let
|
|
1853
|
-
|
|
1854
|
-
...
|
|
1855
|
-
key:
|
|
1856
|
-
children:
|
|
1845
|
+
l.attrs[$] = u.attrs[$];
|
|
1846
|
+
}))) : (l.props || (l.props = {}), Object.assign(l.props, u)));
|
|
1847
|
+
}
|
|
1848
|
+
function d(u, $) {
|
|
1849
|
+
const w = g ? p : m;
|
|
1850
|
+
if (X(u)) {
|
|
1851
|
+
const _ = u.key ?? $;
|
|
1852
|
+
let S = u.children;
|
|
1853
|
+
w.push({
|
|
1854
|
+
...u,
|
|
1855
|
+
key: _,
|
|
1856
|
+
children: S
|
|
1857
1857
|
});
|
|
1858
1858
|
return;
|
|
1859
1859
|
}
|
|
1860
|
-
if (
|
|
1861
|
-
|
|
1860
|
+
if (J(u)) {
|
|
1861
|
+
w.push(rt(u, void 0));
|
|
1862
1862
|
return;
|
|
1863
1863
|
}
|
|
1864
|
-
if (Array.isArray(
|
|
1865
|
-
if (
|
|
1866
|
-
for (let
|
|
1867
|
-
const
|
|
1868
|
-
|
|
1864
|
+
if (Array.isArray(u)) {
|
|
1865
|
+
if (u.length === 0) return;
|
|
1866
|
+
for (let _ = 0; _ < u.length; _++) {
|
|
1867
|
+
const S = u[_];
|
|
1868
|
+
X(S) || J(S) || Array.isArray(S) ? d(S, `${$}-${_}`) : S !== null && typeof S == "object" ? h(S) : w.push(s(String(S), `${$}-${_}`));
|
|
1869
1869
|
}
|
|
1870
1870
|
return;
|
|
1871
1871
|
}
|
|
1872
|
-
if (
|
|
1873
|
-
h(
|
|
1872
|
+
if (u !== null && typeof u == "object") {
|
|
1873
|
+
h(u);
|
|
1874
1874
|
return;
|
|
1875
1875
|
}
|
|
1876
|
-
|
|
1877
|
-
}
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1876
|
+
w.push(s(String(u), $));
|
|
1877
|
+
}
|
|
1878
|
+
const v = /* @__PURE__ */ new Set([
|
|
1879
|
+
"area",
|
|
1880
|
+
"base",
|
|
1881
|
+
"br",
|
|
1882
|
+
"col",
|
|
1883
|
+
"embed",
|
|
1884
|
+
"hr",
|
|
1885
|
+
"img",
|
|
1886
|
+
"input",
|
|
1887
|
+
"link",
|
|
1888
|
+
"meta",
|
|
1889
|
+
"param",
|
|
1890
|
+
"source",
|
|
1891
|
+
"track",
|
|
1892
|
+
"wbr"
|
|
1893
|
+
]);
|
|
1894
|
+
for (; f = a.exec(i); )
|
|
1895
|
+
if (f[1]) {
|
|
1896
|
+
const u = f[1], $ = f[0][1] === "/", w = f[0][f[0].length - 2] === "/" || v.has(u), {
|
|
1897
|
+
props: _,
|
|
1898
|
+
attrs: S,
|
|
1883
1899
|
directives: C
|
|
1884
|
-
} =
|
|
1885
|
-
for (const A in
|
|
1886
|
-
for (const A in
|
|
1887
|
-
for (const [A,
|
|
1900
|
+
} = nt(f[2] || "", t, o), k = { props: {}, attrs: {} };
|
|
1901
|
+
for (const A in _) k.props[A] = _[A];
|
|
1902
|
+
for (const A in S) k.attrs[A] = S[A];
|
|
1903
|
+
for (const [A, T] of Object.entries(C)) {
|
|
1888
1904
|
if (A === "bind")
|
|
1889
|
-
if (typeof
|
|
1890
|
-
for (const [
|
|
1891
|
-
typeof j == "boolean" ? k.attrs[
|
|
1892
|
-
else
|
|
1893
|
-
if (["show", "class", "style"].includes(A) && (k.directives || (k.directives = {}), k.directives[A] =
|
|
1894
|
-
const
|
|
1895
|
-
k.attrs.style = (k.attrs.style || "") + (
|
|
1905
|
+
if (typeof T.value == "object" && T.value !== null)
|
|
1906
|
+
for (const [E, j] of Object.entries(T.value))
|
|
1907
|
+
typeof j == "boolean" ? k.attrs[E] = j : j != null && (k.attrs[E] = String(j));
|
|
1908
|
+
else T.value != null && (k.attrs[A] = String(T.value));
|
|
1909
|
+
if (["show", "class", "style"].includes(A) && (k.directives || (k.directives = {}), k.directives[A] = T), A === "show") {
|
|
1910
|
+
const E = !!T.value;
|
|
1911
|
+
k.attrs.style = (k.attrs.style || "") + (E ? "" : "; display: none !important");
|
|
1896
1912
|
} else if (A === "class") {
|
|
1897
|
-
const
|
|
1913
|
+
const E = T.value;
|
|
1898
1914
|
let j = [];
|
|
1899
|
-
if (typeof
|
|
1900
|
-
j =
|
|
1901
|
-
else if (Array.isArray(
|
|
1902
|
-
for (const
|
|
1903
|
-
if (typeof
|
|
1904
|
-
j.push(...
|
|
1905
|
-
else if (
|
|
1906
|
-
for (const [
|
|
1907
|
-
|
|
1908
|
-
} else if (
|
|
1909
|
-
for (const [
|
|
1910
|
-
|
|
1911
|
-
const
|
|
1915
|
+
if (typeof E == "string")
|
|
1916
|
+
j = E.split(/\s+/).filter(Boolean);
|
|
1917
|
+
else if (Array.isArray(E)) {
|
|
1918
|
+
for (const z of E)
|
|
1919
|
+
if (typeof z == "string")
|
|
1920
|
+
j.push(...z.split(/\s+/).filter(Boolean));
|
|
1921
|
+
else if (z && typeof z == "object")
|
|
1922
|
+
for (const [R, V] of Object.entries(z))
|
|
1923
|
+
V && j.push(...R.split(/\s+/).filter(Boolean));
|
|
1924
|
+
} else if (E && typeof E == "object")
|
|
1925
|
+
for (const [z, R] of Object.entries(E))
|
|
1926
|
+
R && j.push(...z.split(/\s+/).filter(Boolean));
|
|
1927
|
+
const H = k.attrs.class || "", q = [
|
|
1912
1928
|
.../* @__PURE__ */ new Set([
|
|
1913
|
-
...
|
|
1929
|
+
...H.split(/\s+/).filter(Boolean),
|
|
1914
1930
|
...j
|
|
1915
1931
|
])
|
|
1916
1932
|
];
|
|
1917
|
-
k.attrs.class =
|
|
1933
|
+
k.attrs.class = q.join(" ");
|
|
1918
1934
|
} else if (A === "style") {
|
|
1919
|
-
const
|
|
1935
|
+
const E = T.value;
|
|
1920
1936
|
let j = "";
|
|
1921
|
-
if (typeof
|
|
1922
|
-
j =
|
|
1923
|
-
else if (
|
|
1924
|
-
const
|
|
1925
|
-
for (const [
|
|
1926
|
-
if (
|
|
1927
|
-
const
|
|
1937
|
+
if (typeof E == "string")
|
|
1938
|
+
j = E;
|
|
1939
|
+
else if (E && typeof E == "object") {
|
|
1940
|
+
const q = [];
|
|
1941
|
+
for (const [z, R] of Object.entries(E))
|
|
1942
|
+
if (R != null && R !== "") {
|
|
1943
|
+
const V = z.replace(
|
|
1928
1944
|
/[A-Z]/g,
|
|
1929
|
-
(
|
|
1930
|
-
),
|
|
1945
|
+
(ke) => `-${ke.toLowerCase()}`
|
|
1946
|
+
), we = [
|
|
1931
1947
|
"width",
|
|
1932
1948
|
"height",
|
|
1933
1949
|
"top",
|
|
@@ -1953,194 +1969,194 @@ function nt(e, t, r) {
|
|
|
1953
1969
|
"min-height",
|
|
1954
1970
|
"max-height"
|
|
1955
1971
|
];
|
|
1956
|
-
let
|
|
1957
|
-
typeof
|
|
1972
|
+
let le = String(R);
|
|
1973
|
+
typeof R == "number" && we.includes(V) && (le = `${R}px`), q.push(`${V}: ${le}`);
|
|
1958
1974
|
}
|
|
1959
|
-
j =
|
|
1975
|
+
j = q.join("; ") + (q.length > 0 ? ";" : "");
|
|
1960
1976
|
}
|
|
1961
|
-
const
|
|
1962
|
-
k.attrs.style =
|
|
1977
|
+
const H = k.attrs.style || "";
|
|
1978
|
+
k.attrs.style = H + (H && !H.endsWith(";") ? "; " : "") + j;
|
|
1963
1979
|
}
|
|
1964
1980
|
}
|
|
1965
|
-
const
|
|
1966
|
-
for (const [A,
|
|
1967
|
-
["bind", "show", "class", "style"].includes(A) || (
|
|
1968
|
-
if (Object.keys(
|
|
1969
|
-
const A =
|
|
1981
|
+
const B = {};
|
|
1982
|
+
for (const [A, T] of Object.entries(C))
|
|
1983
|
+
["bind", "show", "class", "style"].includes(A) || (B[A] = T);
|
|
1984
|
+
if (Object.keys(B).length > 0 && (k.directives = B), $) {
|
|
1985
|
+
const A = I(
|
|
1970
1986
|
g,
|
|
1971
1987
|
l,
|
|
1972
|
-
p.length === 1 &&
|
|
1973
|
-
|
|
1974
|
-
),
|
|
1975
|
-
|
|
1976
|
-
} else
|
|
1988
|
+
p.length === 1 && J(p[0]) && p[0].tag === "#text" ? typeof p[0].children == "string" ? p[0].children : "" : p.length ? p : void 0,
|
|
1989
|
+
b
|
|
1990
|
+
), T = c.pop();
|
|
1991
|
+
T ? (g = T.tag, l = T.props, b = T.key, p = T.children, p.push(A)) : (m.push(A), g = null, l = {}, b = void 0, p = []);
|
|
1992
|
+
} else w ? g ? p.push(I(u, k, void 0, void 0)) : m.push(I(u, k, void 0, void 0)) : (g && c.push({
|
|
1977
1993
|
tag: g,
|
|
1978
1994
|
props: l,
|
|
1979
1995
|
children: p,
|
|
1980
|
-
key:
|
|
1981
|
-
}), g =
|
|
1982
|
-
} else if (typeof
|
|
1983
|
-
const
|
|
1984
|
-
d(
|
|
1985
|
-
} else if (
|
|
1986
|
-
const
|
|
1987
|
-
for (const
|
|
1988
|
-
if (!
|
|
1989
|
-
const
|
|
1990
|
-
if (
|
|
1991
|
-
const C = Number(
|
|
1992
|
-
d(k,
|
|
1996
|
+
key: b
|
|
1997
|
+
}), g = u, l = k, p = []);
|
|
1998
|
+
} else if (typeof f[3] < "u") {
|
|
1999
|
+
const u = Number(f[3]), $ = t[u], w = `interp-${u}`;
|
|
2000
|
+
d($, w);
|
|
2001
|
+
} else if (f[4]) {
|
|
2002
|
+
const u = f[4], $ = g ? p : m, w = u.split(/({{\d+}})/);
|
|
2003
|
+
for (const _ of w) {
|
|
2004
|
+
if (!_) continue;
|
|
2005
|
+
const S = _.match(/^{{(\d+)}}$/);
|
|
2006
|
+
if (S) {
|
|
2007
|
+
const C = Number(S[1]), k = t[C], B = `interp-${C}`;
|
|
2008
|
+
d(k, B);
|
|
1993
2009
|
} else {
|
|
1994
2010
|
const C = `text-${y++}`;
|
|
1995
|
-
|
|
2011
|
+
$.push(s(_, C));
|
|
1996
2012
|
}
|
|
1997
2013
|
}
|
|
1998
2014
|
}
|
|
1999
|
-
const
|
|
2000
|
-
return
|
|
2015
|
+
const x = m.filter((u) => J(u) && u.tag === "#text" ? typeof u.children == "string" && u.children.trim() !== "" : !0);
|
|
2016
|
+
return x.length === 1 ? x[0] : x.length > 1 ? x : I("div", {}, "", "fallback-root");
|
|
2001
2017
|
}
|
|
2002
|
-
function
|
|
2018
|
+
function W(e, ...t) {
|
|
2003
2019
|
const r = t[t.length - 1], n = typeof r == "object" && r && !Array.isArray(r) ? r : void 0;
|
|
2004
|
-
return
|
|
2020
|
+
return ot(e, t, n);
|
|
2005
2021
|
}
|
|
2006
|
-
const
|
|
2022
|
+
const me = (e) => e ? typeof URLSearchParams > "u" ? {} : Object.fromEntries(new URLSearchParams(e)) : {}, N = (e, t) => {
|
|
2007
2023
|
for (const r of e) {
|
|
2008
2024
|
const n = [], o = r.path.replace(/:[^/]+/g, (a) => (n.push(a.slice(1)), "([^/]+)")), s = new RegExp(`^${o}$`), i = t.match(s);
|
|
2009
2025
|
if (i) {
|
|
2010
2026
|
const a = {};
|
|
2011
|
-
return n.forEach((
|
|
2012
|
-
a[
|
|
2027
|
+
return n.forEach((c, f) => {
|
|
2028
|
+
a[c] = i[f + 1];
|
|
2013
2029
|
}), { route: r, params: a };
|
|
2014
2030
|
}
|
|
2015
2031
|
}
|
|
2016
2032
|
return { route: null, params: {} };
|
|
2017
|
-
},
|
|
2018
|
-
async function
|
|
2033
|
+
}, ne = {};
|
|
2034
|
+
async function it(e) {
|
|
2019
2035
|
if (e.component) return e.component;
|
|
2020
2036
|
if (e.load) {
|
|
2021
|
-
if (
|
|
2037
|
+
if (ne[e.path]) return ne[e.path];
|
|
2022
2038
|
try {
|
|
2023
2039
|
const t = await e.load();
|
|
2024
|
-
return
|
|
2040
|
+
return ne[e.path] = t.default, t.default;
|
|
2025
2041
|
} catch {
|
|
2026
2042
|
throw new Error(`Failed to load component for route: ${e.path}`);
|
|
2027
2043
|
}
|
|
2028
2044
|
}
|
|
2029
2045
|
throw new Error(`No component or loader defined for route: ${e.path}`);
|
|
2030
2046
|
}
|
|
2031
|
-
function
|
|
2047
|
+
function st(e) {
|
|
2032
2048
|
const { routes: t, base: r = "", initialUrl: n } = e;
|
|
2033
|
-
let o, s, i, a,
|
|
2049
|
+
let o, s, i, a, c, f, p;
|
|
2034
2050
|
const g = async (m, h) => {
|
|
2035
|
-
const d = t.find((
|
|
2051
|
+
const d = t.find((v) => N([v], m.path).route !== null);
|
|
2036
2052
|
if (d?.beforeEnter)
|
|
2037
2053
|
try {
|
|
2038
|
-
const
|
|
2039
|
-
return typeof
|
|
2040
|
-
} catch (
|
|
2041
|
-
return console.error("beforeEnter error",
|
|
2054
|
+
const v = await d.beforeEnter(m, h);
|
|
2055
|
+
return typeof v == "string" ? (await y(v, !0), !1) : v !== !1;
|
|
2056
|
+
} catch (v) {
|
|
2057
|
+
return console.error("beforeEnter error", v), !1;
|
|
2042
2058
|
}
|
|
2043
2059
|
return !0;
|
|
2044
2060
|
}, l = async (m, h) => {
|
|
2045
|
-
const d = t.find((
|
|
2061
|
+
const d = t.find((v) => N([v], m.path).route !== null);
|
|
2046
2062
|
if (d?.onEnter)
|
|
2047
2063
|
try {
|
|
2048
|
-
const
|
|
2049
|
-
return typeof
|
|
2050
|
-
} catch (
|
|
2051
|
-
return console.error("onEnter error",
|
|
2064
|
+
const v = await d.onEnter(m, h);
|
|
2065
|
+
return typeof v == "string" ? (await y(v, !0), !1) : v !== !1;
|
|
2066
|
+
} catch (v) {
|
|
2067
|
+
return console.error("onEnter error", v), !1;
|
|
2052
2068
|
}
|
|
2053
2069
|
return !0;
|
|
2054
|
-
},
|
|
2055
|
-
const d = t.find((
|
|
2070
|
+
}, b = (m, h) => {
|
|
2071
|
+
const d = t.find((v) => N([v], m.path).route !== null);
|
|
2056
2072
|
if (d?.afterEnter)
|
|
2057
2073
|
try {
|
|
2058
2074
|
d.afterEnter(m, h);
|
|
2059
|
-
} catch (
|
|
2060
|
-
console.error("afterEnter error",
|
|
2075
|
+
} catch (v) {
|
|
2076
|
+
console.error("afterEnter error", v);
|
|
2061
2077
|
}
|
|
2062
2078
|
}, y = async (m, h = !1) => {
|
|
2063
2079
|
try {
|
|
2064
2080
|
const d = {
|
|
2065
2081
|
path: m.replace(r, "") || "/",
|
|
2066
2082
|
query: {}
|
|
2067
|
-
},
|
|
2068
|
-
if (!
|
|
2069
|
-
const
|
|
2083
|
+
}, v = N(t, d.path);
|
|
2084
|
+
if (!v) throw new Error(`No route found for ${d.path}`);
|
|
2085
|
+
const x = i.getState(), u = {
|
|
2070
2086
|
path: d.path,
|
|
2071
|
-
params:
|
|
2087
|
+
params: v.params,
|
|
2072
2088
|
query: d.query
|
|
2073
2089
|
};
|
|
2074
|
-
if (!await g(
|
|
2075
|
-
typeof window < "u" && typeof document < "u" && (h ? window.history.replaceState({}, "", r + m) : window.history.pushState({}, "", r + m)), i.setState(
|
|
2090
|
+
if (!await g(u, x) || !await l(u, x)) return;
|
|
2091
|
+
typeof window < "u" && typeof document < "u" && (h ? window.history.replaceState({}, "", r + m) : window.history.pushState({}, "", r + m)), i.setState(u), b(u, x);
|
|
2076
2092
|
} catch (d) {
|
|
2077
2093
|
console.error("Navigation error:", d);
|
|
2078
2094
|
}
|
|
2079
2095
|
};
|
|
2080
2096
|
if (typeof window < "u" && typeof document < "u") {
|
|
2081
2097
|
o = () => {
|
|
2082
|
-
const h = new URL(window.location.href), d = h.pathname.replace(r, "") || "/",
|
|
2083
|
-
return { path: d, query:
|
|
2098
|
+
const h = new URL(window.location.href), d = h.pathname.replace(r, "") || "/", v = me(h.search);
|
|
2099
|
+
return { path: d, query: v };
|
|
2084
2100
|
}, s = o();
|
|
2085
|
-
const m =
|
|
2086
|
-
i =
|
|
2101
|
+
const m = N(t, s.path);
|
|
2102
|
+
i = ce({
|
|
2087
2103
|
path: s.path,
|
|
2088
2104
|
params: m.params,
|
|
2089
2105
|
query: s.query
|
|
2090
2106
|
}), a = async (h = !1) => {
|
|
2091
2107
|
const d = o();
|
|
2092
2108
|
await y(d.path, h);
|
|
2093
|
-
}, window.addEventListener("popstate", () => a(!0)),
|
|
2109
|
+
}, window.addEventListener("popstate", () => a(!0)), c = (h) => y(h, !1), f = (h) => y(h, !0), p = () => window.history.back();
|
|
2094
2110
|
} else {
|
|
2095
2111
|
o = () => {
|
|
2096
|
-
const h = new URL(n || "/", "http://localhost"), d = h.pathname.replace(r, "") || "/",
|
|
2097
|
-
return { path: d, query:
|
|
2112
|
+
const h = new URL(n || "/", "http://localhost"), d = h.pathname.replace(r, "") || "/", v = me(h.search);
|
|
2113
|
+
return { path: d, query: v };
|
|
2098
2114
|
}, s = o();
|
|
2099
|
-
const m =
|
|
2100
|
-
i =
|
|
2115
|
+
const m = N(t, s.path);
|
|
2116
|
+
i = ce({
|
|
2101
2117
|
path: s.path,
|
|
2102
2118
|
params: m.params,
|
|
2103
2119
|
query: s.query
|
|
2104
2120
|
}), a = async () => {
|
|
2121
|
+
}, c = async () => {
|
|
2105
2122
|
}, f = async () => {
|
|
2106
|
-
}, u = async () => {
|
|
2107
2123
|
}, p = () => {
|
|
2108
2124
|
};
|
|
2109
2125
|
}
|
|
2110
2126
|
return {
|
|
2111
2127
|
store: i,
|
|
2112
|
-
push:
|
|
2113
|
-
replace:
|
|
2128
|
+
push: c,
|
|
2129
|
+
replace: f,
|
|
2114
2130
|
back: p,
|
|
2115
2131
|
subscribe: i.subscribe,
|
|
2116
|
-
matchRoute: (m) =>
|
|
2132
|
+
matchRoute: (m) => N(t, m),
|
|
2117
2133
|
getCurrent: () => i.getState(),
|
|
2118
|
-
resolveRouteComponent:
|
|
2134
|
+
resolveRouteComponent: it
|
|
2119
2135
|
};
|
|
2120
2136
|
}
|
|
2121
|
-
function
|
|
2122
|
-
return
|
|
2137
|
+
function ht(e, t) {
|
|
2138
|
+
return N(e, t);
|
|
2123
2139
|
}
|
|
2124
|
-
function
|
|
2125
|
-
const t =
|
|
2126
|
-
return
|
|
2140
|
+
function gt(e) {
|
|
2141
|
+
const t = st(e);
|
|
2142
|
+
return ye("router-view", {
|
|
2127
2143
|
async render() {
|
|
2128
|
-
if (!t) return
|
|
2144
|
+
if (!t) return W`<div>Router not initialized.</div>`;
|
|
2129
2145
|
const r = t.getCurrent(), { path: n } = r, o = t.matchRoute(n);
|
|
2130
|
-
if (!o.route) return
|
|
2146
|
+
if (!o.route) return W`<div>Not found</div>`;
|
|
2131
2147
|
let s = o.route.component;
|
|
2132
2148
|
if (o.route.load) {
|
|
2133
2149
|
const i = await o.route.load();
|
|
2134
2150
|
typeof i.default == "string" && (s = i.default);
|
|
2135
2151
|
}
|
|
2136
|
-
return typeof s == "string" ? { tag: s, props: {}, children: [] } :
|
|
2152
|
+
return typeof s == "string" ? { tag: s, props: {}, children: [] } : W`<div>Invalid route component</div>`;
|
|
2137
2153
|
},
|
|
2138
2154
|
onConnected(r) {
|
|
2139
2155
|
t && typeof t.subscribe == "function" && t.subscribe(() => {
|
|
2140
2156
|
typeof r.requestRender == "function" && r.requestRender();
|
|
2141
2157
|
});
|
|
2142
2158
|
}
|
|
2143
|
-
}),
|
|
2159
|
+
}), ye("router-link", {
|
|
2144
2160
|
state: {},
|
|
2145
2161
|
props: {
|
|
2146
2162
|
to: { type: String, default: "" },
|
|
@@ -2152,7 +2168,7 @@ function ht(e) {
|
|
|
2152
2168
|
ariaCurrentValue: { type: String, default: "page" },
|
|
2153
2169
|
disabled: { type: Boolean, default: !1 },
|
|
2154
2170
|
external: { type: Boolean, default: !1 },
|
|
2155
|
-
style: { type: String, default:
|
|
2171
|
+
style: { type: String, default: ve`
|
|
2156
2172
|
[aria-disabled="true"] {
|
|
2157
2173
|
pointer-events: none;
|
|
2158
2174
|
opacity: 0.5;
|
|
@@ -2161,60 +2177,60 @@ function ht(e) {
|
|
|
2161
2177
|
},
|
|
2162
2178
|
style: (r) => r.style,
|
|
2163
2179
|
render: (r) => {
|
|
2164
|
-
const n = t.getCurrent(), o = r.to, s = r.exact, i = r.exactActiveClass, a = r.activeClass,
|
|
2165
|
-
return
|
|
2166
|
-
${
|
|
2180
|
+
const n = t.getCurrent(), o = r.to, s = r.exact, i = r.exactActiveClass, a = r.activeClass, c = r.ariaCurrentValue, f = r.tag, p = r.disabled, g = r.external, l = n.path === o, b = s ? l : n && typeof n.path == "string" ? n.path.startsWith(o) : !1, y = l ? i : b ? a : "", m = l ? `aria-current="${c}"` : "", h = f === "button", d = p ? h ? 'disabled aria-disabled="true" tabindex="-1"' : 'aria-disabled="true" tabindex="-1"' : "", v = g && (f === "a" || !f) ? 'target="_blank" rel="noopener noreferrer"' : "";
|
|
2181
|
+
return W`
|
|
2182
|
+
${$e().when(h, W`
|
|
2167
2183
|
<button
|
|
2168
2184
|
part="button"
|
|
2169
2185
|
class="${y}"
|
|
2170
2186
|
${m}
|
|
2171
2187
|
${d}
|
|
2172
|
-
${
|
|
2188
|
+
${v}
|
|
2173
2189
|
data-on-click="navigate"
|
|
2174
2190
|
><slot></slot></button>
|
|
2175
|
-
`).otherwise(
|
|
2191
|
+
`).otherwise(W`
|
|
2176
2192
|
<a
|
|
2177
2193
|
part="link"
|
|
2178
2194
|
href="${o}"
|
|
2179
2195
|
class="${y}"
|
|
2180
2196
|
${m}
|
|
2181
2197
|
${d}
|
|
2182
|
-
${
|
|
2198
|
+
${v}
|
|
2183
2199
|
data-on-click="navigate"
|
|
2184
2200
|
><slot></slot></a>
|
|
2185
2201
|
`).done()}
|
|
2186
2202
|
`;
|
|
2187
2203
|
},
|
|
2188
2204
|
navigate: (r, n) => {
|
|
2189
|
-
const { disabled: o, external: s, tag: i, replace: a, to:
|
|
2205
|
+
const { disabled: o, external: s, tag: i, replace: a, to: c } = n.props;
|
|
2190
2206
|
if (o) {
|
|
2191
2207
|
r.preventDefault();
|
|
2192
2208
|
return;
|
|
2193
2209
|
}
|
|
2194
|
-
s && (i === "a" || !i) || (r.preventDefault(), a ? t.replace(
|
|
2210
|
+
s && (i === "a" || !i) || (r.preventDefault(), a ? t.replace(c) : t.push(c));
|
|
2195
2211
|
}
|
|
2196
2212
|
}), t;
|
|
2197
2213
|
}
|
|
2198
2214
|
export {
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2215
|
+
D as GlobalEventBus,
|
|
2216
|
+
ye as component,
|
|
2217
|
+
ce as createStore,
|
|
2218
|
+
ve as css,
|
|
2219
|
+
lt as each,
|
|
2220
|
+
ct as emit,
|
|
2221
|
+
K as eventBus,
|
|
2222
|
+
W as html,
|
|
2223
|
+
gt as initRouter,
|
|
2224
|
+
pt as listen,
|
|
2225
|
+
$e as match,
|
|
2226
|
+
N as matchRoute,
|
|
2227
|
+
ht as matchRouteSSR,
|
|
2228
|
+
ut as off,
|
|
2229
|
+
ft as on,
|
|
2230
|
+
dt as once,
|
|
2231
|
+
me as parseQuery,
|
|
2232
|
+
it as resolveRouteComponent,
|
|
2233
|
+
st as useRouter,
|
|
2234
|
+
at as when
|
|
2219
2235
|
};
|
|
2220
2236
|
//# sourceMappingURL=custom-elements-runtime.es.js.map
|