@jasonshimmy/custom-elements-runtime 0.1.11 → 0.1.12
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 +12 -12
- package/dist/custom-elements-runtime.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.es.js +440 -398
- package/dist/custom-elements-runtime.es.js.map +1 -1
- package/dist/custom-elements-runtime.umd.js +12 -12
- package/dist/custom-elements-runtime.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -17,11 +17,11 @@ function $e() {
|
|
|
17
17
|
return e.push([!0, t]), this;
|
|
18
18
|
},
|
|
19
19
|
done() {
|
|
20
|
-
return
|
|
20
|
+
return Se(...e);
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function Se(...e) {
|
|
25
25
|
for (let t = 0; t < e.length; t++) {
|
|
26
26
|
const [r, n] = e[t];
|
|
27
27
|
if (r) return [Y(n, `whenChain-branch-${t}`)];
|
|
@@ -194,7 +194,7 @@ function oe(e) {
|
|
|
194
194
|
})[t]
|
|
195
195
|
) : e;
|
|
196
196
|
}
|
|
197
|
-
function
|
|
197
|
+
function _e(e, t, r) {
|
|
198
198
|
if (r)
|
|
199
199
|
for (const [n, o] of Object.entries(r)) {
|
|
200
200
|
let s, i = {};
|
|
@@ -219,9 +219,9 @@ function Ce(e, t, r, n) {
|
|
|
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
|
-
return i.length !== a.length ? !1 : i.every((
|
|
222
|
+
return i.length !== a.length ? !1 : i.every((h, g) => o(h, a[g]));
|
|
223
223
|
const c = Object.keys(i), f = Object.keys(a);
|
|
224
|
-
return c.length !== f.length ? !1 : c.every((
|
|
224
|
+
return c.length !== f.length ? !1 : c.every((h) => o(i[h], a[h]));
|
|
225
225
|
}, s = t.get(r);
|
|
226
226
|
if (s && !o(n, s.oldValue))
|
|
227
227
|
try {
|
|
@@ -238,7 +238,7 @@ function Ce(e, t, r, n) {
|
|
|
238
238
|
console.error(`Error in deep watcher for "${i}":`, c);
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
|
-
function
|
|
241
|
+
function Ee(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;
|
|
@@ -252,7 +252,7 @@ function Ae(e, t, r) {
|
|
|
252
252
|
}
|
|
253
253
|
});
|
|
254
254
|
}
|
|
255
|
-
function
|
|
255
|
+
function Ae(e, t, r, n) {
|
|
256
256
|
e.onConnected && !r && (e.onConnected(t), n(!0));
|
|
257
257
|
}
|
|
258
258
|
function Te(e, t, r, n, o, s, i, a) {
|
|
@@ -270,7 +270,7 @@ function M(e, t) {
|
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
272
|
function O(e, t) {
|
|
273
|
-
return t.split(".").reduce((r, n) => r?.[n], e);
|
|
273
|
+
return typeof t == "string" ? t.split(".").reduce((r, n) => r?.[n], e) : t;
|
|
274
274
|
}
|
|
275
275
|
function fe(e, t, r) {
|
|
276
276
|
const n = t.split("."), o = n.pop();
|
|
@@ -280,30 +280,30 @@ function fe(e, t, r) {
|
|
|
280
280
|
}
|
|
281
281
|
function Le(e, t, r, n, o, s, i) {
|
|
282
282
|
if (!s) return;
|
|
283
|
-
const a = t.includes("lazy"), c = t.includes("trim"), f = t.includes("number"),
|
|
284
|
-
const
|
|
285
|
-
return O(
|
|
286
|
-
}, g =
|
|
283
|
+
const a = t.includes("lazy"), c = t.includes("trim"), f = t.includes("number"), h = () => {
|
|
284
|
+
const p = s._state || s;
|
|
285
|
+
return O(p, e);
|
|
286
|
+
}, g = h();
|
|
287
287
|
let l = "text";
|
|
288
|
-
const
|
|
289
|
-
if (i instanceof HTMLInputElement ? l =
|
|
288
|
+
const x = n?.type;
|
|
289
|
+
if (i instanceof HTMLInputElement ? l = x || i.type || "text" : i instanceof HTMLSelectElement ? l = "select" : i instanceof HTMLTextAreaElement && (l = "textarea"), l === "checkbox")
|
|
290
290
|
if (Array.isArray(g)) {
|
|
291
|
-
const
|
|
292
|
-
i && i.checked !==
|
|
291
|
+
const p = i?.getAttribute("value") || n?.value || "", u = g.includes(p);
|
|
292
|
+
i && i.checked !== u && (r.checked = u);
|
|
293
293
|
} else {
|
|
294
|
-
const
|
|
295
|
-
i && i.checked !==
|
|
294
|
+
const p = i?.getAttribute("true-value") || !0, u = g === p;
|
|
295
|
+
i && i.checked !== u && (r.checked = u);
|
|
296
296
|
}
|
|
297
297
|
else if (l === "radio") {
|
|
298
|
-
const
|
|
299
|
-
i && i.checked !==
|
|
298
|
+
const p = n?.value || "", u = g === p;
|
|
299
|
+
i && i.checked !== u && (r.checked = u);
|
|
300
300
|
} else if (l === "select")
|
|
301
301
|
if (i && i.hasAttribute("multiple")) {
|
|
302
|
-
const
|
|
302
|
+
const p = i, u = Array.isArray(g) ? g : [];
|
|
303
303
|
setTimeout(() => {
|
|
304
|
-
Array.from(
|
|
305
|
-
const
|
|
306
|
-
|
|
304
|
+
Array.from(p.options).forEach((y) => {
|
|
305
|
+
const b = u.includes(y.value);
|
|
306
|
+
y.selected !== b && (y.selected = b);
|
|
307
307
|
});
|
|
308
308
|
}, 0);
|
|
309
309
|
} else
|
|
@@ -311,69 +311,69 @@ function Le(e, t, r, n, o, s, i) {
|
|
|
311
311
|
i instanceof HTMLSelectElement && i.value !== String(g) && (i.value = String(g));
|
|
312
312
|
}, 0);
|
|
313
313
|
else {
|
|
314
|
-
const
|
|
315
|
-
(!i || i.value !==
|
|
316
|
-
}
|
|
317
|
-
const
|
|
318
|
-
if (
|
|
319
|
-
const
|
|
320
|
-
if (
|
|
321
|
-
const
|
|
322
|
-
let
|
|
314
|
+
const p = String(g ?? "");
|
|
315
|
+
(!i || i.value !== p) && (r.value = g);
|
|
316
|
+
}
|
|
317
|
+
const m = a || l === "checkbox" || l === "radio" || l === "select" ? "change" : "input", v = (p) => {
|
|
318
|
+
if (p.isComposing || o._isComposing || p.isTrusted === !1) return;
|
|
319
|
+
const u = p.target;
|
|
320
|
+
if (u._modelUpdating) return;
|
|
321
|
+
const y = h();
|
|
322
|
+
let b = u.value;
|
|
323
323
|
if (l === "checkbox")
|
|
324
|
-
if (Array.isArray(
|
|
325
|
-
const
|
|
326
|
-
if (
|
|
327
|
-
|
|
324
|
+
if (Array.isArray(y)) {
|
|
325
|
+
const k = u.getAttribute("value") || "", _ = [...y];
|
|
326
|
+
if (u.checked)
|
|
327
|
+
_.includes(k) || _.push(k);
|
|
328
328
|
else {
|
|
329
|
-
const C =
|
|
330
|
-
C > -1 &&
|
|
329
|
+
const C = _.indexOf(k);
|
|
330
|
+
C > -1 && _.splice(C, 1);
|
|
331
331
|
}
|
|
332
|
-
|
|
332
|
+
b = _;
|
|
333
333
|
} else {
|
|
334
|
-
const
|
|
335
|
-
|
|
334
|
+
const k = u.getAttribute("true-value") || !0, _ = u.getAttribute("false-value") || !1;
|
|
335
|
+
b = u.checked ? k : _;
|
|
336
336
|
}
|
|
337
337
|
else if (l === "radio")
|
|
338
|
-
|
|
339
|
-
else if (l === "select" &&
|
|
340
|
-
const
|
|
341
|
-
|
|
342
|
-
(
|
|
338
|
+
b = u.getAttribute("value") || u.value;
|
|
339
|
+
else if (l === "select" && u.multiple) {
|
|
340
|
+
const k = u;
|
|
341
|
+
b = Array.from(k.selectedOptions).map(
|
|
342
|
+
(_) => _.value
|
|
343
343
|
);
|
|
344
|
-
} else if (c && (
|
|
345
|
-
const
|
|
346
|
-
isNaN(
|
|
344
|
+
} else if (c && (b = b.trim()), f) {
|
|
345
|
+
const k = Number(b);
|
|
346
|
+
isNaN(k) || (b = k);
|
|
347
347
|
}
|
|
348
|
-
const
|
|
349
|
-
if (Array.isArray(
|
|
350
|
-
const
|
|
351
|
-
|
|
352
|
-
|
|
348
|
+
const d = s._state || s, $ = O(d, e);
|
|
349
|
+
if (Array.isArray(b) && Array.isArray($) ? JSON.stringify([...b].sort()) !== JSON.stringify([...$].sort()) : b !== $) {
|
|
350
|
+
const k = p.target;
|
|
351
|
+
k._modelUpdating = !0, fe(d, e, b), setTimeout(() => {
|
|
352
|
+
k._modelUpdating = !1;
|
|
353
353
|
}, 0), s._requestRender && s._requestRender();
|
|
354
354
|
}
|
|
355
355
|
};
|
|
356
|
-
if (o[
|
|
357
|
-
const
|
|
356
|
+
if (o[m] = v, l === "text" || l === "textarea") {
|
|
357
|
+
const p = () => {
|
|
358
358
|
o._isComposing = !0;
|
|
359
|
-
},
|
|
359
|
+
}, u = (y) => {
|
|
360
360
|
o._isComposing = !1;
|
|
361
|
-
const
|
|
361
|
+
const b = y.target;
|
|
362
362
|
setTimeout(() => {
|
|
363
|
-
if (
|
|
364
|
-
let
|
|
365
|
-
if (c && (
|
|
366
|
-
const
|
|
367
|
-
isNaN(
|
|
363
|
+
if (b) {
|
|
364
|
+
let d = b.value;
|
|
365
|
+
if (c && (d = d.trim()), f) {
|
|
366
|
+
const _ = Number(d);
|
|
367
|
+
isNaN(_) || (d = _);
|
|
368
368
|
}
|
|
369
369
|
const $ = s._state || s, w = O($, e);
|
|
370
|
-
(Array.isArray(
|
|
371
|
-
|
|
372
|
-
}, 0)), fe($, e,
|
|
370
|
+
(Array.isArray(d) && Array.isArray(w) ? JSON.stringify([...d].sort()) !== JSON.stringify([...w].sort()) : d !== w) && (b && (b._modelUpdating = !0, setTimeout(() => {
|
|
371
|
+
b._modelUpdating = !1;
|
|
372
|
+
}, 0)), fe($, e, d), s._requestRender && s._requestRender());
|
|
373
373
|
}
|
|
374
374
|
}, 0);
|
|
375
375
|
};
|
|
376
|
-
o.compositionstart =
|
|
376
|
+
o.compositionstart = p, o.compositionend = u;
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
379
|
function Be(e, t, r, n) {
|
|
@@ -403,7 +403,7 @@ function Re(e, t, r) {
|
|
|
403
403
|
if (!r) return;
|
|
404
404
|
const n = O(r, e);
|
|
405
405
|
let o = [];
|
|
406
|
-
typeof n == "string" ? o = [n] : Array.isArray(n) ? o = n.filter(Boolean) : typeof n == "object" && (o = Object.entries(n).filter(([, a]) => !!a).
|
|
406
|
+
typeof n == "string" ? o = [n] : Array.isArray(n) ? o = n.filter(Boolean) : typeof n == "object" && (o = Object.entries(n).filter(([, a]) => !!a).flatMap(([a]) => a.split(/\s+/).filter(Boolean)));
|
|
407
407
|
const s = t.class || "", i = s ? `${s} ${o.join(" ")}`.trim() : o.join(" ");
|
|
408
408
|
i && (t.class = i);
|
|
409
409
|
}
|
|
@@ -424,7 +424,7 @@ function Ne(e, t, r) {
|
|
|
424
424
|
const f = a.replace(
|
|
425
425
|
/[A-Z]/g,
|
|
426
426
|
(l) => `-${l.toLowerCase()}`
|
|
427
|
-
),
|
|
427
|
+
), h = [
|
|
428
428
|
"width",
|
|
429
429
|
"height",
|
|
430
430
|
"top",
|
|
@@ -451,7 +451,7 @@ function Ne(e, t, r) {
|
|
|
451
451
|
"max-height"
|
|
452
452
|
];
|
|
453
453
|
let g = String(c);
|
|
454
|
-
typeof c == "number" &&
|
|
454
|
+
typeof c == "number" && h.includes(f) && (g = `${c}px`), i.push(`${f}: ${g}`);
|
|
455
455
|
}
|
|
456
456
|
o = i.join("; ") + (i.length > 0 ? ";" : "");
|
|
457
457
|
}
|
|
@@ -461,12 +461,12 @@ function Ne(e, t, r) {
|
|
|
461
461
|
function be(e, t, r, n) {
|
|
462
462
|
const o = {}, s = { ...n || {} }, i = {};
|
|
463
463
|
for (const [a, c] of Object.entries(e)) {
|
|
464
|
-
const { value: f, modifiers:
|
|
464
|
+
const { value: f, modifiers: h } = c;
|
|
465
465
|
switch (a) {
|
|
466
466
|
case "model":
|
|
467
467
|
Le(
|
|
468
468
|
typeof f == "string" ? f : String(f),
|
|
469
|
-
|
|
469
|
+
h,
|
|
470
470
|
o,
|
|
471
471
|
s,
|
|
472
472
|
i,
|
|
@@ -504,8 +504,8 @@ function se(e, t) {
|
|
|
504
504
|
for (; s.has(c); )
|
|
505
505
|
c = `${a}#${f++}`;
|
|
506
506
|
s.add(c);
|
|
507
|
-
let
|
|
508
|
-
return Array.isArray(
|
|
507
|
+
let h = i.children;
|
|
508
|
+
return Array.isArray(h) && (h = se(h, c)), { ...i, key: c, children: h };
|
|
509
509
|
});
|
|
510
510
|
}
|
|
511
511
|
const r = e;
|
|
@@ -528,17 +528,17 @@ function Me(e, t, r, n) {
|
|
|
528
528
|
...s.attrs
|
|
529
529
|
}, c = t.props ?? {}, f = i;
|
|
530
530
|
for (const l in { ...c, ...f }) {
|
|
531
|
-
const
|
|
532
|
-
|
|
531
|
+
const x = c[l], m = f[l];
|
|
532
|
+
x !== m && (l === "value" && (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement) ? e.value !== m && (e.value = m ?? "") : l === "checked" && e instanceof HTMLInputElement ? e.checked = !!m : l.startsWith("on") && typeof m == "function" ? (typeof x == "function" && e.removeEventListener(l.slice(2).toLowerCase(), x), e.addEventListener(l.slice(2).toLowerCase(), m)) : m == null || m === !1 ? e.removeAttribute(l) : e.setAttribute(l, String(m)));
|
|
533
533
|
}
|
|
534
|
-
for (const [l,
|
|
534
|
+
for (const [l, x] of Object.entries(
|
|
535
535
|
s.listeners || {}
|
|
536
536
|
))
|
|
537
|
-
e.addEventListener(l,
|
|
538
|
-
const
|
|
539
|
-
for (const l in { ...
|
|
540
|
-
const
|
|
541
|
-
|
|
537
|
+
e.addEventListener(l, x);
|
|
538
|
+
const h = t.attrs ?? {}, g = a;
|
|
539
|
+
for (const l in { ...h, ...g }) {
|
|
540
|
+
const x = h[l], m = g[l];
|
|
541
|
+
x !== m && (m == null || m === !1 ? e.removeAttribute(l) : e.setAttribute(l, String(m)));
|
|
542
542
|
}
|
|
543
543
|
}
|
|
544
544
|
function L(e, t, r) {
|
|
@@ -551,15 +551,15 @@ 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 && (
|
|
556
|
-
const
|
|
557
|
-
|
|
558
|
-
for (const
|
|
559
|
-
const
|
|
560
|
-
|
|
554
|
+
const g = e, l = Array.isArray(g.children) ? g.children : [], x = document.createTextNode(""), m = document.createTextNode("");
|
|
555
|
+
g.key != null && (x.key = `${g.key}:start`, m.key = `${g.key}:end`), g._startNode = x, g._endNode = m;
|
|
556
|
+
const v = document.createDocumentFragment();
|
|
557
|
+
v.appendChild(x);
|
|
558
|
+
for (const p of l) {
|
|
559
|
+
const u = L(p, t);
|
|
560
|
+
v.appendChild(u);
|
|
561
561
|
}
|
|
562
|
-
return
|
|
562
|
+
return v.appendChild(m), v;
|
|
563
563
|
}
|
|
564
564
|
const n = document.createElement(e.tag);
|
|
565
565
|
e.key != null && (n.key = e.key);
|
|
@@ -592,8 +592,8 @@ function L(e, t, r) {
|
|
|
592
592
|
a.listeners || {}
|
|
593
593
|
))
|
|
594
594
|
n.addEventListener(g, l);
|
|
595
|
-
const
|
|
596
|
-
if (typeof e != "string" &&
|
|
595
|
+
const h = e.props?.ref ?? (e.props?.props && e.props.props.ref);
|
|
596
|
+
if (typeof e != "string" && h && r && (r[h] = n), Array.isArray(e.children))
|
|
597
597
|
for (const g of e.children)
|
|
598
598
|
n.appendChild(L(g, t, r));
|
|
599
599
|
else typeof e.children == "string" && (n.textContent = e.children);
|
|
@@ -606,103 +606,103 @@ function Oe(e, t, r, n, o) {
|
|
|
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
|
-
|
|
609
|
+
for (const x of i)
|
|
610
|
+
x && x.key != null && a.set(x.key, x);
|
|
611
611
|
const c = /* @__PURE__ */ new Map();
|
|
612
|
-
for (const
|
|
613
|
-
const
|
|
614
|
-
|
|
612
|
+
for (const x of s) {
|
|
613
|
+
const m = x.key;
|
|
614
|
+
m != null && c.set(m, x);
|
|
615
615
|
}
|
|
616
616
|
const f = /* @__PURE__ */ new Set();
|
|
617
|
-
let
|
|
618
|
-
function g(
|
|
619
|
-
let
|
|
620
|
-
for (;
|
|
621
|
-
|
|
622
|
-
}
|
|
623
|
-
function l(
|
|
624
|
-
const
|
|
625
|
-
let
|
|
626
|
-
for (;
|
|
627
|
-
|
|
628
|
-
const
|
|
629
|
-
if (
|
|
617
|
+
let h = e.firstChild;
|
|
618
|
+
function g(x, m) {
|
|
619
|
+
let v = x;
|
|
620
|
+
for (; v && (f.add(v), v !== m); )
|
|
621
|
+
v = v.nextSibling;
|
|
622
|
+
}
|
|
623
|
+
function l(x, m, v, p) {
|
|
624
|
+
const u = [];
|
|
625
|
+
let y = x.nextSibling;
|
|
626
|
+
for (; y && y !== m; )
|
|
627
|
+
u.push(y), y = y.nextSibling;
|
|
628
|
+
const b = Array.isArray(v) ? v : [];
|
|
629
|
+
if (p.some(($) => $ && $.key != null) || b.some(($) => $ && $.key != null)) {
|
|
630
630
|
const $ = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Map();
|
|
631
|
-
for (const C of
|
|
631
|
+
for (const C of b)
|
|
632
632
|
C && C.key != null && $.set(C.key, C);
|
|
633
|
-
for (const C of
|
|
634
|
-
const
|
|
635
|
-
|
|
633
|
+
for (const C of u) {
|
|
634
|
+
const S = C.key;
|
|
635
|
+
S != null && w.set(S, C);
|
|
636
636
|
}
|
|
637
|
-
const
|
|
638
|
-
let
|
|
639
|
-
for (const C of
|
|
640
|
-
let
|
|
637
|
+
const k = /* @__PURE__ */ new Set();
|
|
638
|
+
let _ = x.nextSibling;
|
|
639
|
+
for (const C of p) {
|
|
640
|
+
let S;
|
|
641
641
|
if (C.key != null && w.has(C.key)) {
|
|
642
642
|
const B = $.get(C.key);
|
|
643
|
-
|
|
643
|
+
S = Q(
|
|
644
644
|
w.get(C.key),
|
|
645
645
|
B,
|
|
646
646
|
C,
|
|
647
647
|
n
|
|
648
|
-
),
|
|
648
|
+
), k.add(S), S !== _ && e.contains(S) && e.insertBefore(S, _);
|
|
649
649
|
} else
|
|
650
|
-
|
|
651
|
-
|
|
650
|
+
S = L(C, n), e.insertBefore(S, _), k.add(S);
|
|
651
|
+
_ = S.nextSibling;
|
|
652
652
|
}
|
|
653
|
-
for (const C of
|
|
654
|
-
!
|
|
653
|
+
for (const C of u)
|
|
654
|
+
!k.has(C) && e.contains(C) && e.removeChild(C);
|
|
655
655
|
} else {
|
|
656
656
|
const $ = Math.min(
|
|
657
|
-
|
|
658
|
-
|
|
657
|
+
b.length,
|
|
658
|
+
p.length
|
|
659
659
|
);
|
|
660
660
|
for (let w = 0; w < $; w++) {
|
|
661
|
-
const
|
|
662
|
-
C !==
|
|
661
|
+
const k = b[w], _ = p[w], C = Q(u[w], k, _, n);
|
|
662
|
+
C !== u[w] && (e.insertBefore(C, u[w]), e.removeChild(u[w]));
|
|
663
663
|
}
|
|
664
|
-
for (let w = $; w <
|
|
665
|
-
e.insertBefore(L(
|
|
666
|
-
for (let w = $; w <
|
|
667
|
-
e.removeChild(
|
|
664
|
+
for (let w = $; w < p.length; w++)
|
|
665
|
+
e.insertBefore(L(p[w], n), m);
|
|
666
|
+
for (let w = $; w < u.length; w++)
|
|
667
|
+
e.removeChild(u[w]);
|
|
668
668
|
}
|
|
669
669
|
}
|
|
670
|
-
for (const
|
|
671
|
-
let
|
|
672
|
-
if (
|
|
673
|
-
const
|
|
674
|
-
let
|
|
675
|
-
const
|
|
676
|
-
if (
|
|
677
|
-
e.insertBefore(
|
|
678
|
-
for (const $ of
|
|
679
|
-
e.insertBefore(L($, n),
|
|
680
|
-
e.insertBefore(
|
|
670
|
+
for (const x of r) {
|
|
671
|
+
let m;
|
|
672
|
+
if (x.tag === "#anchor") {
|
|
673
|
+
const v = x.key, p = `${v}:start`, u = `${v}:end`;
|
|
674
|
+
let y = c.get(p), b = c.get(u);
|
|
675
|
+
const d = Array.isArray(x.children) ? x.children : [];
|
|
676
|
+
if (y || (y = document.createTextNode(""), y.key = p), b || (b = document.createTextNode(""), b.key = u), x._startNode = y, x._endNode = b, !e.contains(y) || !e.contains(b)) {
|
|
677
|
+
e.insertBefore(y, h);
|
|
678
|
+
for (const $ of d)
|
|
679
|
+
e.insertBefore(L($, n), h);
|
|
680
|
+
e.insertBefore(b, h);
|
|
681
681
|
} else
|
|
682
682
|
l(
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
a.get(
|
|
686
|
-
|
|
683
|
+
y,
|
|
684
|
+
b,
|
|
685
|
+
a.get(v)?.children,
|
|
686
|
+
d
|
|
687
687
|
);
|
|
688
|
-
g(
|
|
688
|
+
g(y, b), h = b.nextSibling;
|
|
689
689
|
continue;
|
|
690
690
|
}
|
|
691
|
-
if (
|
|
692
|
-
const
|
|
693
|
-
|
|
694
|
-
c.get(
|
|
695
|
-
|
|
696
|
-
|
|
691
|
+
if (x.key != null && c.has(x.key)) {
|
|
692
|
+
const v = a.get(x.key);
|
|
693
|
+
m = Q(
|
|
694
|
+
c.get(x.key),
|
|
695
|
+
v,
|
|
696
|
+
x,
|
|
697
697
|
n,
|
|
698
698
|
o
|
|
699
|
-
), f.add(
|
|
699
|
+
), f.add(m), m !== h && e.contains(m) && (h && !e.contains(h) && (h = null), e.insertBefore(m, h));
|
|
700
700
|
} else
|
|
701
|
-
|
|
702
|
-
|
|
701
|
+
m = L(x, n, o), h && !e.contains(h) && (h = null), e.insertBefore(m, h), f.add(m);
|
|
702
|
+
h = m.nextSibling;
|
|
703
703
|
}
|
|
704
|
-
for (const
|
|
705
|
-
!f.has(
|
|
704
|
+
for (const x of s)
|
|
705
|
+
!f.has(x) && e.contains(x) && (M(x, o), e.removeChild(x));
|
|
706
706
|
}
|
|
707
707
|
function Q(e, t, r, n, o) {
|
|
708
708
|
if (t && typeof t != "string" && t.props?.ref && o && M(e, o), t === r) return e;
|
|
@@ -717,13 +717,13 @@ function Q(e, t, r, n, o) {
|
|
|
717
717
|
if (r && typeof r != "string" && r.tag === "#anchor") {
|
|
718
718
|
const i = r, a = Array.isArray(i.children) ? i.children : [], c = i._startNode ?? document.createTextNode(""), f = i._endNode ?? document.createTextNode("");
|
|
719
719
|
i.key != null && (c.key = `${i.key}:start`, f.key = `${i.key}:end`), i._startNode = c, i._endNode = f;
|
|
720
|
-
const
|
|
721
|
-
|
|
720
|
+
const h = document.createDocumentFragment();
|
|
721
|
+
h.appendChild(c);
|
|
722
722
|
for (const g of a) {
|
|
723
723
|
const l = L(g, n);
|
|
724
|
-
|
|
724
|
+
h.appendChild(l);
|
|
725
725
|
}
|
|
726
|
-
return
|
|
726
|
+
return h.appendChild(f), e.parentNode?.replaceChild(h, e), c;
|
|
727
727
|
}
|
|
728
728
|
if (!r) {
|
|
729
729
|
M(e, o);
|
|
@@ -740,8 +740,8 @@ function Q(e, t, r, n, o) {
|
|
|
740
740
|
r.key != null && (a.key = `${r.key}:start`, c.key = `${r.key}:end`), r._startNode = a, r._endNode = c;
|
|
741
741
|
const f = document.createDocumentFragment();
|
|
742
742
|
f.appendChild(a);
|
|
743
|
-
for (const
|
|
744
|
-
f.appendChild(L(
|
|
743
|
+
for (const h of i)
|
|
744
|
+
f.appendChild(L(h, n));
|
|
745
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) {
|
|
@@ -765,8 +765,8 @@ function Pe(e, t, r, n) {
|
|
|
765
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
766
|
const c = [];
|
|
767
767
|
for (let f = 0; f < e.childNodes.length; f++) {
|
|
768
|
-
const
|
|
769
|
-
|
|
768
|
+
const h = e.childNodes[f];
|
|
769
|
+
h !== a && h.nodeName !== "STYLE" && (M(h, n), c.push(h));
|
|
770
770
|
}
|
|
771
771
|
c.forEach((f) => e.removeChild(f)), e._prevVNode = o, e._prevDom = a;
|
|
772
772
|
}
|
|
@@ -1348,57 +1348,57 @@ function Ze(e) {
|
|
|
1348
1348
|
const t = Date.now(), r = ge.get(e);
|
|
1349
1349
|
if (r && t - r.timestamp < Qe) return r.css;
|
|
1350
1350
|
const n = Je(e), o = new Set(n), s = [], i = [], a = [], c = [], f = {};
|
|
1351
|
-
function
|
|
1352
|
-
const
|
|
1353
|
-
if (
|
|
1354
|
-
const
|
|
1355
|
-
return f[
|
|
1356
|
-
}
|
|
1357
|
-
function g(
|
|
1358
|
-
const
|
|
1359
|
-
return
|
|
1360
|
-
}
|
|
1361
|
-
function l(
|
|
1362
|
-
const
|
|
1363
|
-
(
|
|
1351
|
+
function h(m, v = !1) {
|
|
1352
|
+
const p = (v ? "dark|" : "") + m;
|
|
1353
|
+
if (p in f) return f[p];
|
|
1354
|
+
const u = l(m, v);
|
|
1355
|
+
return f[p] = u, u;
|
|
1356
|
+
}
|
|
1357
|
+
function g(m) {
|
|
1358
|
+
const v = m.some((u) => ee.includes(u)), p = m.includes("dark");
|
|
1359
|
+
return m.length === 0 ? 1 : !v && !p ? 2 : v && !p ? 3 : 4;
|
|
1360
|
+
}
|
|
1361
|
+
function l(m, v = !1) {
|
|
1362
|
+
const p = m.split(":"), u = p.find(
|
|
1363
|
+
(S) => G[S] || te(S) || re(S) || Z(S)
|
|
1364
1364
|
);
|
|
1365
|
-
if (!
|
|
1366
|
-
const
|
|
1367
|
-
if (!
|
|
1368
|
-
let
|
|
1369
|
-
const $ =
|
|
1370
|
-
let w = $ >= 0 ?
|
|
1371
|
-
|
|
1372
|
-
const
|
|
1373
|
-
for (const
|
|
1374
|
-
const B = Ve(
|
|
1365
|
+
if (!u) return null;
|
|
1366
|
+
const y = G[u] ?? te(u) ?? re(u) ?? Z(u);
|
|
1367
|
+
if (!y) return null;
|
|
1368
|
+
let b = `.${Ue(m)}`, d = y;
|
|
1369
|
+
const $ = p.indexOf(u);
|
|
1370
|
+
let w = $ >= 0 ? p.slice(0, $) : [];
|
|
1371
|
+
v && (w = w.filter((S) => S !== "dark"));
|
|
1372
|
+
const k = w.filter((S) => ee.includes(S)), _ = k.length ? k[k.length - 1] : null;
|
|
1373
|
+
for (const S of w) {
|
|
1374
|
+
const B = Ve(S);
|
|
1375
1375
|
if (B) {
|
|
1376
|
-
|
|
1376
|
+
b = `${B}${b}`;
|
|
1377
1377
|
continue;
|
|
1378
1378
|
}
|
|
1379
|
-
if (ee.includes(
|
|
1380
|
-
const
|
|
1381
|
-
typeof
|
|
1379
|
+
if (ee.includes(S)) continue;
|
|
1380
|
+
const E = Ie[S];
|
|
1381
|
+
typeof E == "function" && (b = E(b, d).replace(/\{.*$/, ""));
|
|
1382
1382
|
}
|
|
1383
|
-
let C = `${
|
|
1384
|
-
return
|
|
1383
|
+
let C = `${b}{${d}}`;
|
|
1384
|
+
return v && _ ? C = `@media (prefers-color-scheme: dark) and ${pe[_]}{${C}}` : v ? C = `@media (prefers-color-scheme: dark){${C}}` : _ && (C = `@media ${pe[_]}{${C}}`), C;
|
|
1385
1385
|
}
|
|
1386
|
-
for (const
|
|
1387
|
-
const
|
|
1388
|
-
(
|
|
1386
|
+
for (const m of o) {
|
|
1387
|
+
const v = m.split(":"), p = v.find(
|
|
1388
|
+
(d) => G[d] || te(d) || re(d) || Z(d)
|
|
1389
1389
|
);
|
|
1390
|
-
if (!
|
|
1391
|
-
const
|
|
1392
|
-
if (
|
|
1393
|
-
const
|
|
1394
|
-
|
|
1390
|
+
if (!p) continue;
|
|
1391
|
+
const u = v.indexOf(p), y = u >= 0 ? v.slice(0, u) : [], b = g(y);
|
|
1392
|
+
if (b === 4) {
|
|
1393
|
+
const d = h(m, !0);
|
|
1394
|
+
d && c.push(d);
|
|
1395
1395
|
} else {
|
|
1396
|
-
const
|
|
1397
|
-
|
|
1396
|
+
const d = h(m);
|
|
1397
|
+
d && (b === 1 ? s.push(d) : b === 2 ? i.push(d) : b === 3 && a.push(d));
|
|
1398
1398
|
}
|
|
1399
1399
|
}
|
|
1400
|
-
const
|
|
1401
|
-
return ge.set(e, { css:
|
|
1400
|
+
const x = [...s, ...i, ...a, ...c].join("");
|
|
1401
|
+
return ge.set(e, { css: x, timestamp: t }), x;
|
|
1402
1402
|
}
|
|
1403
1403
|
const F = [];
|
|
1404
1404
|
function Xe(e, t, r, n, o, s, i, a) {
|
|
@@ -1561,7 +1561,7 @@ function tt(e) {
|
|
|
1561
1561
|
}
|
|
1562
1562
|
connectedCallback() {
|
|
1563
1563
|
this._runLogicWithinErrorBoundary(e, () => {
|
|
1564
|
-
|
|
1564
|
+
Ae(
|
|
1565
1565
|
e,
|
|
1566
1566
|
this.context,
|
|
1567
1567
|
this._mounted,
|
|
@@ -1710,8 +1710,8 @@ function tt(e) {
|
|
|
1710
1710
|
].includes(a) ? function(...g) {
|
|
1711
1711
|
const l = f.apply(i, g);
|
|
1712
1712
|
if (!n._initializing) {
|
|
1713
|
-
const
|
|
1714
|
-
n._triggerWatchers(
|
|
1713
|
+
const x = s || "root";
|
|
1714
|
+
n._triggerWatchers(x, i), n._render(t);
|
|
1715
1715
|
}
|
|
1716
1716
|
return l;
|
|
1717
1717
|
} : f;
|
|
@@ -1754,7 +1754,7 @@ function tt(e) {
|
|
|
1754
1754
|
}
|
|
1755
1755
|
_initWatchers(t) {
|
|
1756
1756
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1757
|
-
|
|
1757
|
+
_e(
|
|
1758
1758
|
this.context,
|
|
1759
1759
|
this._watchers,
|
|
1760
1760
|
t.watch || {}
|
|
@@ -1767,7 +1767,7 @@ function tt(e) {
|
|
|
1767
1767
|
_applyProps(t) {
|
|
1768
1768
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1769
1769
|
try {
|
|
1770
|
-
|
|
1770
|
+
Ee(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
|
}
|
|
@@ -1792,90 +1792,90 @@ 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 c = a[1], f = a[2],
|
|
1796
|
-
let l = g ? t[Number(g[1])] ?? null :
|
|
1797
|
-
if (g || (l === "true" ? l = !0 : l === "false" ? l = !1 : l === "null" ? l = null : isNaN(Number(l)) || (l = Number(l))), c === ":")
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
const [b, ...y] = f.split("."), m = [...y];
|
|
1804
|
-
let h = l, d = [...m];
|
|
1805
|
-
if (b === "model" && typeof h == "string" && h.includes(".")) {
|
|
1806
|
-
const v = ["trim", "number", "lazy"], x = h.split(".");
|
|
1807
|
-
let u = h;
|
|
1795
|
+
const c = a[1], f = a[2], h = (a[4] || a[6]) ?? "", g = h.match(/^{{(\d+)}}$/);
|
|
1796
|
+
let l = g ? t[Number(g[1])] ?? null : h;
|
|
1797
|
+
if (g || (l === "true" ? l = !0 : l === "false" ? l = !1 : l === "null" ? l = null : isNaN(Number(l)) || (l = Number(l))), c === ":" && f === "class" || c === "#") {
|
|
1798
|
+
const [x, ...m] = f.split("."), v = [...m];
|
|
1799
|
+
let p = l, u = [...v];
|
|
1800
|
+
if (x === "model" && typeof p == "string" && p.includes(".")) {
|
|
1801
|
+
const y = ["trim", "number", "lazy"], b = p.split(".");
|
|
1802
|
+
let d = p;
|
|
1808
1803
|
const $ = [];
|
|
1809
|
-
for (let w =
|
|
1810
|
-
$.unshift(
|
|
1811
|
-
|
|
1804
|
+
for (let w = b.length - 1; w > 0 && y.includes(b[w]); w--)
|
|
1805
|
+
$.unshift(b[w]), d = b.slice(0, w).join(".");
|
|
1806
|
+
p = d, u.push(...$);
|
|
1812
1807
|
}
|
|
1813
|
-
s[
|
|
1814
|
-
value:
|
|
1815
|
-
modifiers:
|
|
1808
|
+
s[x] = {
|
|
1809
|
+
value: p,
|
|
1810
|
+
modifiers: u
|
|
1816
1811
|
};
|
|
1812
|
+
} else if (c === ":")
|
|
1813
|
+
typeof l == "boolean" ? o[f] = l : l != null && (typeof r[l] < "u" ? n[f] = r[l] : n[f] = l);
|
|
1814
|
+
else if (c === "@") {
|
|
1815
|
+
const x = "on" + f.charAt(0).toUpperCase() + f.slice(1);
|
|
1816
|
+
n[x] = typeof l == "function" ? l : typeof r[l] == "function" ? r[l] : void 0;
|
|
1817
1817
|
} else f === "ref" ? n.ref = l : o[f] = l;
|
|
1818
1818
|
}
|
|
1819
1819
|
return { props: n, attrs: o, directives: s };
|
|
1820
1820
|
}
|
|
1821
1821
|
function ot(e, t, r) {
|
|
1822
1822
|
const n = F.length > 0 ? F[F.length - 1] : void 0, o = r ?? n;
|
|
1823
|
-
function s(
|
|
1824
|
-
return I("#text", {},
|
|
1823
|
+
function s(d, $) {
|
|
1824
|
+
return I("#text", {}, d, $);
|
|
1825
1825
|
}
|
|
1826
1826
|
let i = "";
|
|
1827
|
-
for (let
|
|
1828
|
-
i += e[
|
|
1827
|
+
for (let d = 0; d < e.length; d++)
|
|
1828
|
+
i += e[d], d < t.length && (i += `{{${d}}}`);
|
|
1829
1829
|
const a = /<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g, c = [];
|
|
1830
|
-
let f,
|
|
1831
|
-
function
|
|
1832
|
-
!
|
|
1830
|
+
let f, h = [], g = null, l = {}, x, m = 0, v = [];
|
|
1831
|
+
function p(d) {
|
|
1832
|
+
!d || typeof d != "object" || X(d) || (d.props || d.attrs ? (d.props && (l.props || (l.props = {}), Object.assign(l.props, d.props)), d.attrs && (l.attrs || (l.attrs = {}), Object.keys(d.attrs).forEach(($) => {
|
|
1833
1833
|
if ($ === "style" && l.attrs.style) {
|
|
1834
1834
|
const w = l.attrs.style.replace(
|
|
1835
1835
|
/;?\s*$/,
|
|
1836
1836
|
""
|
|
1837
|
-
),
|
|
1838
|
-
l.attrs.style = w + "; " +
|
|
1837
|
+
), k = d.attrs.style.replace(/^;?\s*/, "");
|
|
1838
|
+
l.attrs.style = w + "; " + k;
|
|
1839
1839
|
} else if ($ === "class" && l.attrs.class) {
|
|
1840
|
-
const w = l.attrs.class.trim().split(/\s+/).filter(Boolean),
|
|
1841
|
-
.../* @__PURE__ */ new Set([...w, ...
|
|
1840
|
+
const w = l.attrs.class.trim().split(/\s+/).filter(Boolean), k = d.attrs.class.trim().split(/\s+/).filter(Boolean), _ = [
|
|
1841
|
+
.../* @__PURE__ */ new Set([...w, ...k])
|
|
1842
1842
|
];
|
|
1843
|
-
l.attrs.class =
|
|
1843
|
+
l.attrs.class = _.join(" ");
|
|
1844
1844
|
} else
|
|
1845
|
-
l.attrs[$] =
|
|
1846
|
-
}))) : (l.props || (l.props = {}), Object.assign(l.props,
|
|
1847
|
-
}
|
|
1848
|
-
function d
|
|
1849
|
-
const w = g ?
|
|
1850
|
-
if (X(
|
|
1851
|
-
const
|
|
1852
|
-
let
|
|
1845
|
+
l.attrs[$] = d.attrs[$];
|
|
1846
|
+
}))) : (l.props || (l.props = {}), Object.assign(l.props, d)));
|
|
1847
|
+
}
|
|
1848
|
+
function u(d, $) {
|
|
1849
|
+
const w = g ? h : v;
|
|
1850
|
+
if (X(d)) {
|
|
1851
|
+
const k = d.key ?? $;
|
|
1852
|
+
let _ = d.children;
|
|
1853
1853
|
w.push({
|
|
1854
|
-
...
|
|
1855
|
-
key:
|
|
1856
|
-
children:
|
|
1854
|
+
...d,
|
|
1855
|
+
key: k,
|
|
1856
|
+
children: _
|
|
1857
1857
|
});
|
|
1858
1858
|
return;
|
|
1859
1859
|
}
|
|
1860
|
-
if (J(
|
|
1861
|
-
w.push(rt(
|
|
1860
|
+
if (J(d)) {
|
|
1861
|
+
w.push(rt(d, void 0));
|
|
1862
1862
|
return;
|
|
1863
1863
|
}
|
|
1864
|
-
if (Array.isArray(
|
|
1865
|
-
if (
|
|
1866
|
-
for (let
|
|
1867
|
-
const
|
|
1868
|
-
X(
|
|
1864
|
+
if (Array.isArray(d)) {
|
|
1865
|
+
if (d.length === 0) return;
|
|
1866
|
+
for (let k = 0; k < d.length; k++) {
|
|
1867
|
+
const _ = d[k];
|
|
1868
|
+
X(_) || J(_) || Array.isArray(_) ? u(_, `${$}-${k}`) : _ !== null && typeof _ == "object" ? p(_) : w.push(s(String(_), `${$}-${k}`));
|
|
1869
1869
|
}
|
|
1870
1870
|
return;
|
|
1871
1871
|
}
|
|
1872
|
-
if (
|
|
1873
|
-
|
|
1872
|
+
if (d !== null && typeof d == "object") {
|
|
1873
|
+
p(d);
|
|
1874
1874
|
return;
|
|
1875
1875
|
}
|
|
1876
|
-
w.push(s(String(
|
|
1876
|
+
w.push(s(String(d), $));
|
|
1877
1877
|
}
|
|
1878
|
-
const
|
|
1878
|
+
const y = /* @__PURE__ */ new Set([
|
|
1879
1879
|
"area",
|
|
1880
1880
|
"base",
|
|
1881
1881
|
"br",
|
|
@@ -1893,54 +1893,54 @@ function ot(e, t, r) {
|
|
|
1893
1893
|
]);
|
|
1894
1894
|
for (; f = a.exec(i); )
|
|
1895
1895
|
if (f[1]) {
|
|
1896
|
-
const
|
|
1897
|
-
props:
|
|
1898
|
-
attrs:
|
|
1896
|
+
const d = f[1], $ = f[0][1] === "/", w = f[0][f[0].length - 2] === "/" || y.has(d), {
|
|
1897
|
+
props: k,
|
|
1898
|
+
attrs: _,
|
|
1899
1899
|
directives: C
|
|
1900
|
-
} = nt(f[2] || "", t, o),
|
|
1901
|
-
for (const
|
|
1902
|
-
for (const
|
|
1903
|
-
for (const [
|
|
1904
|
-
if (
|
|
1900
|
+
} = nt(f[2] || "", t, o), S = { props: {}, attrs: {} };
|
|
1901
|
+
for (const E in k) S.props[E] = k[E];
|
|
1902
|
+
for (const E in _) S.attrs[E] = _[E];
|
|
1903
|
+
for (const [E, T] of Object.entries(C)) {
|
|
1904
|
+
if (E === "bind")
|
|
1905
1905
|
if (typeof T.value == "object" && T.value !== null)
|
|
1906
|
-
for (const [
|
|
1907
|
-
typeof j == "boolean" ?
|
|
1908
|
-
else T.value != null && (
|
|
1909
|
-
if (["show", "class", "style"].includes(
|
|
1910
|
-
const
|
|
1911
|
-
|
|
1912
|
-
} else if (
|
|
1913
|
-
const
|
|
1906
|
+
for (const [A, j] of Object.entries(T.value))
|
|
1907
|
+
typeof j == "boolean" ? S.attrs[A] = j : j != null && (S.attrs[A] = String(j));
|
|
1908
|
+
else T.value != null && (S.attrs[E] = String(T.value));
|
|
1909
|
+
if (["show", "class", "style"].includes(E) && (S.directives || (S.directives = {}), S.directives[E] = T), E === "show") {
|
|
1910
|
+
const A = !!T.value;
|
|
1911
|
+
S.attrs.style = (S.attrs.style || "") + (A ? "" : "; display: none !important");
|
|
1912
|
+
} else if (E === "class") {
|
|
1913
|
+
const A = T.value;
|
|
1914
1914
|
let j = [];
|
|
1915
|
-
if (typeof
|
|
1916
|
-
j =
|
|
1917
|
-
else if (Array.isArray(
|
|
1918
|
-
for (const
|
|
1919
|
-
if (typeof
|
|
1920
|
-
j.push(...
|
|
1921
|
-
else if (
|
|
1922
|
-
for (const [
|
|
1923
|
-
V && j.push(...
|
|
1924
|
-
} else if (
|
|
1925
|
-
for (const [
|
|
1926
|
-
|
|
1927
|
-
const H =
|
|
1915
|
+
if (typeof A == "string")
|
|
1916
|
+
j = A.split(/\s+/).filter(Boolean);
|
|
1917
|
+
else if (Array.isArray(A)) {
|
|
1918
|
+
for (const R of A)
|
|
1919
|
+
if (typeof R == "string")
|
|
1920
|
+
j.push(...R.split(/\s+/).filter(Boolean));
|
|
1921
|
+
else if (R && typeof R == "object")
|
|
1922
|
+
for (const [N, V] of Object.entries(R))
|
|
1923
|
+
V && j.push(...N.split(/\s+/).filter(Boolean));
|
|
1924
|
+
} else if (A && typeof A == "object")
|
|
1925
|
+
for (const [R, N] of Object.entries(A))
|
|
1926
|
+
N && j.push(...R.split(/\s+/).filter(Boolean));
|
|
1927
|
+
const H = S.attrs.class || "", q = [
|
|
1928
1928
|
.../* @__PURE__ */ new Set([
|
|
1929
1929
|
...H.split(/\s+/).filter(Boolean),
|
|
1930
1930
|
...j
|
|
1931
1931
|
])
|
|
1932
1932
|
];
|
|
1933
|
-
|
|
1934
|
-
} else if (
|
|
1935
|
-
const
|
|
1933
|
+
S.attrs.class = q.join(" ");
|
|
1934
|
+
} else if (E === "style") {
|
|
1935
|
+
const A = T.value;
|
|
1936
1936
|
let j = "";
|
|
1937
|
-
if (typeof
|
|
1938
|
-
j =
|
|
1939
|
-
else if (
|
|
1937
|
+
if (typeof A == "string")
|
|
1938
|
+
j = A;
|
|
1939
|
+
else if (A && typeof A == "object") {
|
|
1940
1940
|
const q = [];
|
|
1941
|
-
for (const [
|
|
1942
|
-
if (
|
|
1943
|
-
const V =
|
|
1941
|
+
for (const [R, N] of Object.entries(A))
|
|
1942
|
+
if (N != null && N !== "") {
|
|
1943
|
+
const V = R.replace(
|
|
1944
1944
|
/[A-Z]/g,
|
|
1945
1945
|
(ke) => `-${ke.toLowerCase()}`
|
|
1946
1946
|
), we = [
|
|
@@ -1969,57 +1969,57 @@ function ot(e, t, r) {
|
|
|
1969
1969
|
"min-height",
|
|
1970
1970
|
"max-height"
|
|
1971
1971
|
];
|
|
1972
|
-
let le = String(
|
|
1973
|
-
typeof
|
|
1972
|
+
let le = String(N);
|
|
1973
|
+
typeof N == "number" && we.includes(V) && (le = `${N}px`), q.push(`${V}: ${le}`);
|
|
1974
1974
|
}
|
|
1975
1975
|
j = q.join("; ") + (q.length > 0 ? ";" : "");
|
|
1976
1976
|
}
|
|
1977
|
-
const H =
|
|
1978
|
-
|
|
1977
|
+
const H = S.attrs.style || "";
|
|
1978
|
+
S.attrs.style = H + (H && !H.endsWith(";") ? "; " : "") + j;
|
|
1979
1979
|
}
|
|
1980
1980
|
}
|
|
1981
1981
|
const B = {};
|
|
1982
|
-
for (const [
|
|
1983
|
-
["bind", "show", "class", "style"].includes(
|
|
1984
|
-
if (Object.keys(B).length > 0 && (
|
|
1985
|
-
const
|
|
1982
|
+
for (const [E, T] of Object.entries(C))
|
|
1983
|
+
["bind", "show", "class", "style"].includes(E) || (B[E] = T);
|
|
1984
|
+
if (Object.keys(B).length > 0 && (S.directives = B), $) {
|
|
1985
|
+
const E = I(
|
|
1986
1986
|
g,
|
|
1987
1987
|
l,
|
|
1988
|
-
|
|
1989
|
-
|
|
1988
|
+
h.length === 1 && J(h[0]) && h[0].tag === "#text" ? typeof h[0].children == "string" ? h[0].children : "" : h.length ? h : void 0,
|
|
1989
|
+
x
|
|
1990
1990
|
), T = c.pop();
|
|
1991
|
-
T ? (g = T.tag, l = T.props,
|
|
1992
|
-
} else w ? g ?
|
|
1991
|
+
T ? (g = T.tag, l = T.props, x = T.key, h = T.children, h.push(E)) : (v.push(E), g = null, l = {}, x = void 0, h = []);
|
|
1992
|
+
} else w ? g ? h.push(I(d, S, void 0, void 0)) : v.push(I(d, S, void 0, void 0)) : (g && c.push({
|
|
1993
1993
|
tag: g,
|
|
1994
1994
|
props: l,
|
|
1995
|
-
children:
|
|
1996
|
-
key:
|
|
1997
|
-
}), g =
|
|
1995
|
+
children: h,
|
|
1996
|
+
key: x
|
|
1997
|
+
}), g = d, l = S, h = []);
|
|
1998
1998
|
} else if (typeof f[3] < "u") {
|
|
1999
|
-
const
|
|
2000
|
-
|
|
1999
|
+
const d = Number(f[3]), $ = t[d], w = `interp-${d}`;
|
|
2000
|
+
u($, w);
|
|
2001
2001
|
} else if (f[4]) {
|
|
2002
|
-
const
|
|
2003
|
-
for (const
|
|
2004
|
-
if (!
|
|
2005
|
-
const
|
|
2006
|
-
if (
|
|
2007
|
-
const C = Number(
|
|
2008
|
-
|
|
2002
|
+
const d = f[4], $ = g ? h : v, w = d.split(/({{\d+}})/);
|
|
2003
|
+
for (const k of w) {
|
|
2004
|
+
if (!k) continue;
|
|
2005
|
+
const _ = k.match(/^{{(\d+)}}$/);
|
|
2006
|
+
if (_) {
|
|
2007
|
+
const C = Number(_[1]), S = t[C], B = `interp-${C}`;
|
|
2008
|
+
u(S, B);
|
|
2009
2009
|
} else {
|
|
2010
|
-
const C = `text-${
|
|
2011
|
-
$.push(s(
|
|
2010
|
+
const C = `text-${m++}`;
|
|
2011
|
+
$.push(s(k, C));
|
|
2012
2012
|
}
|
|
2013
2013
|
}
|
|
2014
2014
|
}
|
|
2015
|
-
const
|
|
2016
|
-
return
|
|
2015
|
+
const b = v.filter((d) => J(d) && d.tag === "#text" ? typeof d.children == "string" && d.children.trim() !== "" : !0);
|
|
2016
|
+
return b.length === 1 ? b[0] : b.length > 1 ? b : I("div", {}, "", "fallback-root");
|
|
2017
2017
|
}
|
|
2018
2018
|
function W(e, ...t) {
|
|
2019
2019
|
const r = t[t.length - 1], n = typeof r == "object" && r && !Array.isArray(r) ? r : void 0;
|
|
2020
2020
|
return ot(e, t, n);
|
|
2021
2021
|
}
|
|
2022
|
-
const me = (e) => e ? typeof URLSearchParams > "u" ? {} : Object.fromEntries(new URLSearchParams(e)) : {},
|
|
2022
|
+
const me = (e) => e ? typeof URLSearchParams > "u" ? {} : Object.fromEntries(new URLSearchParams(e)) : {}, z = (e, t) => {
|
|
2023
2023
|
for (const r of e) {
|
|
2024
2024
|
const n = [], o = r.path.replace(/:[^/]+/g, (a) => (n.push(a.slice(1)), "([^/]+)")), s = new RegExp(`^${o}$`), i = t.match(s);
|
|
2025
2025
|
if (i) {
|
|
@@ -2046,96 +2046,139 @@ async function it(e) {
|
|
|
2046
2046
|
}
|
|
2047
2047
|
function st(e) {
|
|
2048
2048
|
const { routes: t, base: r = "", initialUrl: n } = e;
|
|
2049
|
-
let o, s, i, a, c, f,
|
|
2050
|
-
const g = async (
|
|
2051
|
-
const
|
|
2052
|
-
if (
|
|
2049
|
+
let o, s, i, a, c, f, h;
|
|
2050
|
+
const g = async (v, p) => {
|
|
2051
|
+
const u = t.find((y) => z([y], v.path).route !== null);
|
|
2052
|
+
if (u?.beforeEnter)
|
|
2053
2053
|
try {
|
|
2054
|
-
const
|
|
2055
|
-
return typeof
|
|
2056
|
-
} catch (
|
|
2057
|
-
return console.error("beforeEnter error",
|
|
2054
|
+
const y = await u.beforeEnter(v, p);
|
|
2055
|
+
return typeof y == "string" ? (await m(y, !0), !1) : y !== !1;
|
|
2056
|
+
} catch (y) {
|
|
2057
|
+
return console.error("beforeEnter error", y), !1;
|
|
2058
2058
|
}
|
|
2059
2059
|
return !0;
|
|
2060
|
-
}, l = async (
|
|
2061
|
-
const
|
|
2062
|
-
if (
|
|
2060
|
+
}, l = async (v, p) => {
|
|
2061
|
+
const u = t.find((y) => z([y], v.path).route !== null);
|
|
2062
|
+
if (u?.onEnter)
|
|
2063
2063
|
try {
|
|
2064
|
-
const
|
|
2065
|
-
return typeof
|
|
2066
|
-
} catch (
|
|
2067
|
-
return console.error("onEnter error",
|
|
2064
|
+
const y = await u.onEnter(v, p);
|
|
2065
|
+
return typeof y == "string" ? (await m(y, !0), !1) : y !== !1;
|
|
2066
|
+
} catch (y) {
|
|
2067
|
+
return console.error("onEnter error", y), !1;
|
|
2068
2068
|
}
|
|
2069
2069
|
return !0;
|
|
2070
|
-
},
|
|
2071
|
-
const
|
|
2072
|
-
if (
|
|
2070
|
+
}, x = (v, p) => {
|
|
2071
|
+
const u = t.find((y) => z([y], v.path).route !== null);
|
|
2072
|
+
if (u?.afterEnter)
|
|
2073
2073
|
try {
|
|
2074
|
-
|
|
2075
|
-
} catch (
|
|
2076
|
-
console.error("afterEnter error",
|
|
2074
|
+
u.afterEnter(v, p);
|
|
2075
|
+
} catch (y) {
|
|
2076
|
+
console.error("afterEnter error", y);
|
|
2077
2077
|
}
|
|
2078
|
-
},
|
|
2078
|
+
}, m = async (v, p = !1) => {
|
|
2079
2079
|
try {
|
|
2080
|
-
const
|
|
2081
|
-
path:
|
|
2080
|
+
const u = {
|
|
2081
|
+
path: v.replace(r, "") || "/",
|
|
2082
2082
|
query: {}
|
|
2083
|
-
},
|
|
2084
|
-
if (!
|
|
2085
|
-
const
|
|
2086
|
-
path:
|
|
2087
|
-
params:
|
|
2088
|
-
query:
|
|
2083
|
+
}, y = z(t, u.path);
|
|
2084
|
+
if (!y) throw new Error(`No route found for ${u.path}`);
|
|
2085
|
+
const b = i.getState(), d = {
|
|
2086
|
+
path: u.path,
|
|
2087
|
+
params: y.params,
|
|
2088
|
+
query: u.query
|
|
2089
2089
|
};
|
|
2090
|
-
if (!await g(
|
|
2091
|
-
typeof window < "u" && typeof document < "u" && (
|
|
2092
|
-
} catch (
|
|
2093
|
-
console.error("Navigation error:",
|
|
2090
|
+
if (!await g(d, b) || !await l(d, b)) return;
|
|
2091
|
+
typeof window < "u" && typeof document < "u" && (p ? window.history.replaceState({}, "", r + v) : window.history.pushState({}, "", r + v)), i.setState(d), x(d, b);
|
|
2092
|
+
} catch (u) {
|
|
2093
|
+
console.error("Navigation error:", u);
|
|
2094
2094
|
}
|
|
2095
2095
|
};
|
|
2096
2096
|
if (typeof window < "u" && typeof document < "u") {
|
|
2097
2097
|
o = () => {
|
|
2098
|
-
const
|
|
2099
|
-
return { path:
|
|
2098
|
+
const p = new URL(window.location.href), u = p.pathname.replace(r, "") || "/", y = me(p.search);
|
|
2099
|
+
return { path: u, query: y };
|
|
2100
2100
|
}, s = o();
|
|
2101
|
-
const
|
|
2101
|
+
const v = z(t, s.path);
|
|
2102
2102
|
i = ce({
|
|
2103
2103
|
path: s.path,
|
|
2104
|
-
params:
|
|
2104
|
+
params: v.params,
|
|
2105
2105
|
query: s.query
|
|
2106
|
-
}), a = async (
|
|
2107
|
-
const
|
|
2108
|
-
await
|
|
2109
|
-
}, window.addEventListener("popstate", () => a(!0)), c = (
|
|
2106
|
+
}), a = async (p = !1) => {
|
|
2107
|
+
const u = o();
|
|
2108
|
+
await m(u.path, p);
|
|
2109
|
+
}, window.addEventListener("popstate", () => a(!0)), c = (p) => m(p, !1), f = (p) => m(p, !0), h = () => window.history.back();
|
|
2110
2110
|
} else {
|
|
2111
2111
|
o = () => {
|
|
2112
|
-
const
|
|
2113
|
-
return { path:
|
|
2112
|
+
const u = new URL(n || "/", "http://localhost"), y = u.pathname.replace(r, "") || "/", b = me(u.search);
|
|
2113
|
+
return { path: y, query: b };
|
|
2114
2114
|
}, s = o();
|
|
2115
|
-
const
|
|
2115
|
+
const v = z(t, s.path);
|
|
2116
2116
|
i = ce({
|
|
2117
2117
|
path: s.path,
|
|
2118
|
-
params:
|
|
2118
|
+
params: v.params,
|
|
2119
2119
|
query: s.query
|
|
2120
2120
|
}), a = async () => {
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
}
|
|
2121
|
+
const u = o();
|
|
2122
|
+
await p(u.path);
|
|
2123
|
+
};
|
|
2124
|
+
const p = async (u) => {
|
|
2125
|
+
try {
|
|
2126
|
+
const y = {
|
|
2127
|
+
path: u.replace(r, "") || "/",
|
|
2128
|
+
query: {}
|
|
2129
|
+
}, b = z(t, y.path);
|
|
2130
|
+
if (!b) throw new Error(`No route found for ${y.path}`);
|
|
2131
|
+
const d = i.getState(), $ = {
|
|
2132
|
+
path: y.path,
|
|
2133
|
+
params: b.params,
|
|
2134
|
+
query: y.query
|
|
2135
|
+
}, w = t.find((k) => z([k], $.path).route !== null);
|
|
2136
|
+
if (w?.beforeEnter)
|
|
2137
|
+
try {
|
|
2138
|
+
const k = await w.beforeEnter($, d);
|
|
2139
|
+
if (typeof k == "string") {
|
|
2140
|
+
await p(k);
|
|
2141
|
+
return;
|
|
2142
|
+
}
|
|
2143
|
+
if (k === !1) return;
|
|
2144
|
+
} catch {
|
|
2145
|
+
return;
|
|
2146
|
+
}
|
|
2147
|
+
if (w?.onEnter)
|
|
2148
|
+
try {
|
|
2149
|
+
const k = await w.onEnter($, d);
|
|
2150
|
+
if (typeof k == "string") {
|
|
2151
|
+
await p(k);
|
|
2152
|
+
return;
|
|
2153
|
+
}
|
|
2154
|
+
if (k === !1) return;
|
|
2155
|
+
} catch {
|
|
2156
|
+
return;
|
|
2157
|
+
}
|
|
2158
|
+
if (i.setState($), w?.afterEnter)
|
|
2159
|
+
try {
|
|
2160
|
+
w.afterEnter($, d);
|
|
2161
|
+
} catch {
|
|
2162
|
+
}
|
|
2163
|
+
} catch {
|
|
2164
|
+
}
|
|
2165
|
+
};
|
|
2166
|
+
c = async (u) => p(u), f = async (u) => p(u), h = () => {
|
|
2124
2167
|
};
|
|
2125
2168
|
}
|
|
2126
2169
|
return {
|
|
2127
2170
|
store: i,
|
|
2128
2171
|
push: c,
|
|
2129
2172
|
replace: f,
|
|
2130
|
-
back:
|
|
2173
|
+
back: h,
|
|
2131
2174
|
subscribe: i.subscribe,
|
|
2132
|
-
matchRoute: (
|
|
2175
|
+
matchRoute: (v) => z(t, v),
|
|
2133
2176
|
getCurrent: () => i.getState(),
|
|
2134
2177
|
resolveRouteComponent: it
|
|
2135
2178
|
};
|
|
2136
2179
|
}
|
|
2137
2180
|
function ht(e, t) {
|
|
2138
|
-
return
|
|
2181
|
+
return z(e, t);
|
|
2139
2182
|
}
|
|
2140
2183
|
function gt(e) {
|
|
2141
2184
|
const t = st(e);
|
|
@@ -2178,37 +2221,36 @@ function gt(e) {
|
|
|
2178
2221
|
},
|
|
2179
2222
|
style: (r) => r.style,
|
|
2180
2223
|
render: (r) => {
|
|
2181
|
-
const n = t.getCurrent(), o = r.to, s = r.exact, i = r.exactActiveClass, a = r.activeClass, c = r.ariaCurrentValue, f = r.tag,
|
|
2224
|
+
const n = t.getCurrent(), o = r.to, s = r.exact, i = r.exactActiveClass, a = r.activeClass, c = r.ariaCurrentValue, f = r.tag, h = r.disabled, g = r.external, l = n.path === o, x = s ? l : n && typeof n.path == "string" ? n.path.startsWith(o) : !1, m = l ? i : x ? a : "", v = l ? `aria-current="${c}"` : "", p = f === "button", u = h ? p ? 'disabled aria-disabled="true" tabindex="-1"' : 'aria-disabled="true" tabindex="-1"' : "", y = g && (f === "a" || !f) ? 'target="_blank" rel="noopener noreferrer"' : "";
|
|
2182
2225
|
return W`
|
|
2183
|
-
${$e().when(
|
|
2226
|
+
${$e().when(p, W`
|
|
2184
2227
|
<button
|
|
2185
2228
|
part="button"
|
|
2186
|
-
:class="${r.class} ${
|
|
2187
|
-
${m}
|
|
2188
|
-
${d}
|
|
2229
|
+
:class="${r.class} ${m}"
|
|
2189
2230
|
${v}
|
|
2231
|
+
${u}
|
|
2232
|
+
${y}
|
|
2190
2233
|
@click="navigate"
|
|
2191
2234
|
><slot></slot></button>
|
|
2192
2235
|
`).otherwise(W`
|
|
2193
2236
|
<a
|
|
2194
2237
|
part="link"
|
|
2195
2238
|
href="${o}"
|
|
2196
|
-
:class="${r.class} ${
|
|
2197
|
-
${m}
|
|
2198
|
-
${d}
|
|
2239
|
+
:class="${r.class} ${m}"
|
|
2199
2240
|
${v}
|
|
2241
|
+
${u}
|
|
2242
|
+
${y}
|
|
2200
2243
|
@click="navigate"
|
|
2201
2244
|
><slot></slot></a>
|
|
2202
2245
|
`).done()}
|
|
2203
2246
|
`;
|
|
2204
2247
|
},
|
|
2205
2248
|
navigate: (r, n) => {
|
|
2206
|
-
|
|
2207
|
-
if (o) {
|
|
2249
|
+
if (n.disabled) {
|
|
2208
2250
|
r.preventDefault();
|
|
2209
2251
|
return;
|
|
2210
2252
|
}
|
|
2211
|
-
|
|
2253
|
+
n.external && (n.tag === "a" || !n.tag) || (r.preventDefault(), n.replace ? t.replace(n.to) : t.push(n.to));
|
|
2212
2254
|
}
|
|
2213
2255
|
}), t;
|
|
2214
2256
|
}
|
|
@@ -2224,7 +2266,7 @@ export {
|
|
|
2224
2266
|
gt as initRouter,
|
|
2225
2267
|
pt as listen,
|
|
2226
2268
|
$e as match,
|
|
2227
|
-
|
|
2269
|
+
z as matchRoute,
|
|
2228
2270
|
ht as matchRouteSSR,
|
|
2229
2271
|
ut as off,
|
|
2230
2272
|
ft as on,
|