@jasonshimmy/custom-elements-runtime 1.0.1 → 1.0.3
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 +4 -4
- package/dist/custom-elements-runtime.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.es.js +178 -174
- package/dist/custom-elements-runtime.es.js.map +1 -1
- package/dist/custom-elements-runtime.umd.js +1 -1
- package/dist/custom-elements-runtime.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -71,8 +71,8 @@ class ht {
|
|
|
71
71
|
"fill",
|
|
72
72
|
"copyWithin"
|
|
73
73
|
].includes(i) ? function(...u) {
|
|
74
|
-
const
|
|
75
|
-
return t.triggerUpdate(),
|
|
74
|
+
const m = o.apply(r, u);
|
|
75
|
+
return t.triggerUpdate(), m;
|
|
76
76
|
} : o;
|
|
77
77
|
},
|
|
78
78
|
set: (r, i, s) => (r[i] = t.makeReactiveValue(s), t.triggerUpdate(), !0),
|
|
@@ -378,7 +378,7 @@ function se(e, ...t) {
|
|
|
378
378
|
function Oe(e, ...t) {
|
|
379
379
|
st && console.warn(e, ...t);
|
|
380
380
|
}
|
|
381
|
-
function
|
|
381
|
+
function mt(e, t, n) {
|
|
382
382
|
if (n)
|
|
383
383
|
for (const [r, i] of Object.entries(n)) {
|
|
384
384
|
let s, o = {};
|
|
@@ -395,14 +395,14 @@ function yt(e, t, n) {
|
|
|
395
395
|
}
|
|
396
396
|
}
|
|
397
397
|
}
|
|
398
|
-
function
|
|
398
|
+
function yt(e, t, n, r) {
|
|
399
399
|
const i = (o, a) => {
|
|
400
400
|
if (o === a) return !0;
|
|
401
401
|
if (typeof o != typeof a || typeof o != "object" || o === null || a === null) return !1;
|
|
402
402
|
if (Array.isArray(o) && Array.isArray(a))
|
|
403
403
|
return o.length !== a.length ? !1 : o.every((g, b) => i(g, a[b]));
|
|
404
|
-
const u = Object.keys(o),
|
|
405
|
-
return u.length !==
|
|
404
|
+
const u = Object.keys(o), m = Object.keys(a);
|
|
405
|
+
return u.length !== m.length ? !1 : u.every((g) => i(o[g], a[g]));
|
|
406
406
|
}, s = t.get(n);
|
|
407
407
|
if (s && !i(r, s.oldValue))
|
|
408
408
|
try {
|
|
@@ -565,10 +565,10 @@ class Ct {
|
|
|
565
565
|
r = r.replace(new RegExp(b.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), `<<#${l}#>>`);
|
|
566
566
|
}
|
|
567
567
|
const u = /\b([a-zA-Z_][a-zA-Z0-9_]*)\b/g;
|
|
568
|
-
let
|
|
568
|
+
let m;
|
|
569
569
|
const g = /* @__PURE__ */ new Set();
|
|
570
|
-
for (; (
|
|
571
|
-
const b =
|
|
570
|
+
for (; (m = u.exec(r)) !== null; ) {
|
|
571
|
+
const b = m[1];
|
|
572
572
|
if (["true", "false", "null", "undefined"].includes(b) || /^[0-9]+$/.test(b) || b === "ctx" || g.has(b)) continue;
|
|
573
573
|
g.add(b);
|
|
574
574
|
const h = H(n, b);
|
|
@@ -615,21 +615,21 @@ class Ct {
|
|
|
615
615
|
s("?");
|
|
616
616
|
const p = o();
|
|
617
617
|
s(":");
|
|
618
|
-
const
|
|
619
|
-
return c ? p :
|
|
618
|
+
const y = o();
|
|
619
|
+
return c ? p : y;
|
|
620
620
|
}
|
|
621
621
|
return c;
|
|
622
622
|
}
|
|
623
623
|
function u() {
|
|
624
|
-
let c =
|
|
624
|
+
let c = m();
|
|
625
625
|
for (; i() && i().value === "||"; ) {
|
|
626
626
|
s("OP");
|
|
627
|
-
const p =
|
|
627
|
+
const p = m();
|
|
628
628
|
c = c || p;
|
|
629
629
|
}
|
|
630
630
|
return c;
|
|
631
631
|
}
|
|
632
|
-
function
|
|
632
|
+
function m() {
|
|
633
633
|
let c = g();
|
|
634
634
|
for (; i() && i().value === "&&"; ) {
|
|
635
635
|
s("OP");
|
|
@@ -641,19 +641,19 @@ class Ct {
|
|
|
641
641
|
function g() {
|
|
642
642
|
let c = b();
|
|
643
643
|
for (; i() && ["==", "!=", "===", "!=="].includes(i().value); ) {
|
|
644
|
-
const p = s("OP").value,
|
|
644
|
+
const p = s("OP").value, y = b();
|
|
645
645
|
switch (p) {
|
|
646
646
|
case "==":
|
|
647
|
-
c = c ==
|
|
647
|
+
c = c == y;
|
|
648
648
|
break;
|
|
649
649
|
case "!=":
|
|
650
|
-
c = c !=
|
|
650
|
+
c = c != y;
|
|
651
651
|
break;
|
|
652
652
|
case "===":
|
|
653
|
-
c = c ===
|
|
653
|
+
c = c === y;
|
|
654
654
|
break;
|
|
655
655
|
case "!==":
|
|
656
|
-
c = c !==
|
|
656
|
+
c = c !== y;
|
|
657
657
|
break;
|
|
658
658
|
}
|
|
659
659
|
}
|
|
@@ -662,19 +662,19 @@ class Ct {
|
|
|
662
662
|
function b() {
|
|
663
663
|
let c = h();
|
|
664
664
|
for (; i() && [">", "<", ">=", "<="].includes(i().value); ) {
|
|
665
|
-
const p = s("OP").value,
|
|
665
|
+
const p = s("OP").value, y = h();
|
|
666
666
|
switch (p) {
|
|
667
667
|
case ">":
|
|
668
|
-
c = c >
|
|
668
|
+
c = c > y;
|
|
669
669
|
break;
|
|
670
670
|
case "<":
|
|
671
|
-
c = c <
|
|
671
|
+
c = c < y;
|
|
672
672
|
break;
|
|
673
673
|
case ">=":
|
|
674
|
-
c = c >=
|
|
674
|
+
c = c >= y;
|
|
675
675
|
break;
|
|
676
676
|
case "<=":
|
|
677
|
-
c = c <=
|
|
677
|
+
c = c <= y;
|
|
678
678
|
break;
|
|
679
679
|
}
|
|
680
680
|
}
|
|
@@ -683,24 +683,24 @@ class Ct {
|
|
|
683
683
|
function h() {
|
|
684
684
|
let c = l();
|
|
685
685
|
for (; i() && (i().value === "+" || i().value === "-"); ) {
|
|
686
|
-
const p = s("OP").value,
|
|
687
|
-
c = p === "+" ? c +
|
|
686
|
+
const p = s("OP").value, y = l();
|
|
687
|
+
c = p === "+" ? c + y : c - y;
|
|
688
688
|
}
|
|
689
689
|
return c;
|
|
690
690
|
}
|
|
691
691
|
function l() {
|
|
692
692
|
let c = d();
|
|
693
693
|
for (; i() && (i().value === "*" || i().value === "/" || i().value === "%"); ) {
|
|
694
|
-
const p = s("OP").value,
|
|
694
|
+
const p = s("OP").value, y = d();
|
|
695
695
|
switch (p) {
|
|
696
696
|
case "*":
|
|
697
|
-
c = c *
|
|
697
|
+
c = c * y;
|
|
698
698
|
break;
|
|
699
699
|
case "/":
|
|
700
|
-
c = c /
|
|
700
|
+
c = c / y;
|
|
701
701
|
break;
|
|
702
702
|
case "%":
|
|
703
|
-
c = c %
|
|
703
|
+
c = c % y;
|
|
704
704
|
break;
|
|
705
705
|
}
|
|
706
706
|
}
|
|
@@ -851,7 +851,7 @@ function he(e, t, n) {
|
|
|
851
851
|
}
|
|
852
852
|
function _t(e, t, n, r, i, s, o, a) {
|
|
853
853
|
if (!s) return;
|
|
854
|
-
const u = t.includes("lazy"),
|
|
854
|
+
const u = t.includes("lazy"), m = t.includes("trim"), g = t.includes("number"), b = e && typeof e == "object" && "value" in e && typeof e.value < "u", h = () => {
|
|
855
855
|
if (b) {
|
|
856
856
|
const C = e.value;
|
|
857
857
|
return a && typeof C == "object" && C !== null ? C[a] : C;
|
|
@@ -888,7 +888,7 @@ function _t(e, t, n, r, i, s, o, a) {
|
|
|
888
888
|
} catch {
|
|
889
889
|
}
|
|
890
890
|
}
|
|
891
|
-
const p = u || d === "checkbox" || d === "radio" || d === "select" ? "change" : "input",
|
|
891
|
+
const p = u || d === "checkbox" || d === "radio" || d === "select" ? "change" : "input", y = (C) => {
|
|
892
892
|
if (C.isComposing || i._isComposing) return;
|
|
893
893
|
const k = typeof globalThis.process < "u" && globalThis.process.env?.NODE_ENV === "test" || typeof window < "u" && window.__vitest__;
|
|
894
894
|
if (C.isTrusted === !1 && !k) return;
|
|
@@ -914,7 +914,7 @@ function _t(e, t, n, r, i, s, o, a) {
|
|
|
914
914
|
x = f.getAttribute("value") ?? f.value;
|
|
915
915
|
else if (d === "select" && f.multiple)
|
|
916
916
|
x = Array.from(f.selectedOptions).map((T) => T.value);
|
|
917
|
-
else if (
|
|
917
|
+
else if (m && typeof x == "string" && (x = x.trim()), g) {
|
|
918
918
|
const T = Number(x);
|
|
919
919
|
isNaN(T) || (x = T);
|
|
920
920
|
}
|
|
@@ -952,7 +952,7 @@ function _t(e, t, n, r, i, s, o, a) {
|
|
|
952
952
|
const C = i[p];
|
|
953
953
|
o && oe.removeListener(o, p, C);
|
|
954
954
|
}
|
|
955
|
-
i[p] =
|
|
955
|
+
i[p] = y;
|
|
956
956
|
} else {
|
|
957
957
|
const C = `update:${ne(c)}`;
|
|
958
958
|
if (i[C]) {
|
|
@@ -984,7 +984,7 @@ function _t(e, t, n, r, i, s, o, a) {
|
|
|
984
984
|
k && setTimeout(() => {
|
|
985
985
|
const f = k.value, x = s._state || s, A = H(x, e);
|
|
986
986
|
let _ = f;
|
|
987
|
-
if (
|
|
987
|
+
if (m && (_ = _.trim()), g) {
|
|
988
988
|
const T = Number(_);
|
|
989
989
|
isNaN(T) || (_ = T);
|
|
990
990
|
}
|
|
@@ -1010,7 +1010,7 @@ function Et(e, t, n, r) {
|
|
|
1010
1010
|
else if (typeof e == "string") {
|
|
1011
1011
|
if (!r) return;
|
|
1012
1012
|
try {
|
|
1013
|
-
const i =
|
|
1013
|
+
const i = me(e, r);
|
|
1014
1014
|
if (typeof i == "object" && i !== null) {
|
|
1015
1015
|
for (const [s, o] of Object.entries(i))
|
|
1016
1016
|
s.startsWith("data-") || s.startsWith("aria-") || s === "class" ? n[s] = o : t[s] = o;
|
|
@@ -1029,7 +1029,7 @@ function $t(e, t, n) {
|
|
|
1029
1029
|
let r;
|
|
1030
1030
|
if (typeof e == "string") {
|
|
1031
1031
|
if (!n) return;
|
|
1032
|
-
r =
|
|
1032
|
+
r = me(e, n);
|
|
1033
1033
|
} else
|
|
1034
1034
|
r = e;
|
|
1035
1035
|
const i = t.style || "";
|
|
@@ -1050,14 +1050,14 @@ function $t(e, t, n) {
|
|
|
1050
1050
|
s = "display: none";
|
|
1051
1051
|
s !== i && (s ? t.style = s : delete t.style);
|
|
1052
1052
|
}
|
|
1053
|
-
function
|
|
1053
|
+
function me(e, t) {
|
|
1054
1054
|
return Ct.evaluate(e, t);
|
|
1055
1055
|
}
|
|
1056
1056
|
function St(e, t, n) {
|
|
1057
1057
|
let r;
|
|
1058
1058
|
if (typeof e == "string") {
|
|
1059
1059
|
if (!n) return;
|
|
1060
|
-
r =
|
|
1060
|
+
r = me(e, n);
|
|
1061
1061
|
} else
|
|
1062
1062
|
r = e;
|
|
1063
1063
|
let i = [];
|
|
@@ -1069,7 +1069,7 @@ function At(e, t, n) {
|
|
|
1069
1069
|
let r;
|
|
1070
1070
|
if (typeof e == "string") {
|
|
1071
1071
|
if (!n) return;
|
|
1072
|
-
r =
|
|
1072
|
+
r = me(e, n);
|
|
1073
1073
|
} else
|
|
1074
1074
|
r = e;
|
|
1075
1075
|
let i = "";
|
|
@@ -1079,7 +1079,7 @@ function At(e, t, n) {
|
|
|
1079
1079
|
const o = [];
|
|
1080
1080
|
for (const [a, u] of Object.entries(r))
|
|
1081
1081
|
if (u != null && u !== "") {
|
|
1082
|
-
const
|
|
1082
|
+
const m = a.replace(
|
|
1083
1083
|
/[A-Z]/g,
|
|
1084
1084
|
(h) => `-${h.toLowerCase()}`
|
|
1085
1085
|
), g = [
|
|
@@ -1109,7 +1109,7 @@ function At(e, t, n) {
|
|
|
1109
1109
|
"max-height"
|
|
1110
1110
|
];
|
|
1111
1111
|
let b = String(u);
|
|
1112
|
-
typeof u == "number" && g.includes(
|
|
1112
|
+
typeof u == "number" && g.includes(m) && (b = `${u}px`), o.push(`${m}: ${b}`);
|
|
1113
1113
|
}
|
|
1114
1114
|
i = o.join("; ") + (o.length > 0 ? ";" : "");
|
|
1115
1115
|
}
|
|
@@ -1118,16 +1118,16 @@ function At(e, t, n) {
|
|
|
1118
1118
|
}
|
|
1119
1119
|
function Tt(e, t, n) {
|
|
1120
1120
|
let r = e;
|
|
1121
|
-
typeof e == "string" && n && (r =
|
|
1121
|
+
typeof e == "string" && n && (r = me(e, n)), ee(r) ? t.reactiveRef = r : t.ref = r;
|
|
1122
1122
|
}
|
|
1123
1123
|
function at(e, t, n, r) {
|
|
1124
1124
|
const i = {}, s = { ...r || {} }, o = {};
|
|
1125
1125
|
for (const [a, u] of Object.entries(e)) {
|
|
1126
|
-
const { value:
|
|
1126
|
+
const { value: m, modifiers: g, arg: b } = u;
|
|
1127
1127
|
if (a === "model" || a.startsWith("model:")) {
|
|
1128
1128
|
const h = a.split(":"), l = h.length > 1 ? h[1] : b;
|
|
1129
1129
|
_t(
|
|
1130
|
-
|
|
1130
|
+
m,
|
|
1131
1131
|
// Pass the original value (could be string or reactive state object)
|
|
1132
1132
|
g,
|
|
1133
1133
|
i,
|
|
@@ -1141,19 +1141,19 @@ function at(e, t, n, r) {
|
|
|
1141
1141
|
}
|
|
1142
1142
|
switch (a) {
|
|
1143
1143
|
case "bind":
|
|
1144
|
-
Et(
|
|
1144
|
+
Et(m, i, s, t);
|
|
1145
1145
|
break;
|
|
1146
1146
|
case "show":
|
|
1147
|
-
$t(
|
|
1147
|
+
$t(m, s, t);
|
|
1148
1148
|
break;
|
|
1149
1149
|
case "class":
|
|
1150
|
-
St(
|
|
1150
|
+
St(m, s, t);
|
|
1151
1151
|
break;
|
|
1152
1152
|
case "style":
|
|
1153
|
-
At(
|
|
1153
|
+
At(m, s, t);
|
|
1154
1154
|
break;
|
|
1155
1155
|
case "ref":
|
|
1156
|
-
Tt(
|
|
1156
|
+
Tt(m, i, t);
|
|
1157
1157
|
break;
|
|
1158
1158
|
}
|
|
1159
1159
|
}
|
|
@@ -1179,9 +1179,9 @@ function Be(e, t) {
|
|
|
1179
1179
|
].find((d) => d != null) ?? "";
|
|
1180
1180
|
a = l ? `${t}:${b}:${l}` : `${t}:${b}`;
|
|
1181
1181
|
}
|
|
1182
|
-
let u = a,
|
|
1182
|
+
let u = a, m = 1;
|
|
1183
1183
|
for (; s.has(u); )
|
|
1184
|
-
u = `${a}#${
|
|
1184
|
+
u = `${a}#${m++}`;
|
|
1185
1185
|
s.add(u);
|
|
1186
1186
|
let g = o.children;
|
|
1187
1187
|
return Array.isArray(g) && (g = Be(g, u)), { ...o, key: u, children: g };
|
|
@@ -1205,10 +1205,10 @@ function Ve(e, t, n, r) {
|
|
|
1205
1205
|
...t.attrs,
|
|
1206
1206
|
...n.attrs,
|
|
1207
1207
|
...s.attrs
|
|
1208
|
-
}, u = t.props ?? {},
|
|
1208
|
+
}, u = t.props ?? {}, m = o, g = n?.isCustomElement ?? t?.isCustomElement ?? !1;
|
|
1209
1209
|
let b = !1;
|
|
1210
|
-
for (const d in { ...u, ...
|
|
1211
|
-
const v = u[d], w =
|
|
1210
|
+
for (const d in { ...u, ...m }) {
|
|
1211
|
+
const v = u[d], w = m[d];
|
|
1212
1212
|
if (v !== w)
|
|
1213
1213
|
if (b = !0, d === "value" && (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement))
|
|
1214
1214
|
e.value !== w && (e.value = w ?? "");
|
|
@@ -1298,15 +1298,15 @@ function Ve(e, t, n, r) {
|
|
|
1298
1298
|
e.setAttribute(d, String(p));
|
|
1299
1299
|
continue;
|
|
1300
1300
|
}
|
|
1301
|
-
const
|
|
1302
|
-
if (g && !
|
|
1301
|
+
const y = e.namespaceURI === "http://www.w3.org/2000/svg";
|
|
1302
|
+
if (g && !y && d.includes("-")) {
|
|
1303
1303
|
const C = it(d);
|
|
1304
1304
|
try {
|
|
1305
1305
|
e[C] = p;
|
|
1306
1306
|
} catch {
|
|
1307
1307
|
e.setAttribute(d, String(p));
|
|
1308
1308
|
}
|
|
1309
|
-
} else if (!
|
|
1309
|
+
} else if (!y && d in e)
|
|
1310
1310
|
try {
|
|
1311
1311
|
e[d] = p;
|
|
1312
1312
|
} catch {
|
|
@@ -1352,12 +1352,12 @@ function X(e, t, n) {
|
|
|
1352
1352
|
const { props: i = {}, attrs: s = {}, directives: o = {} } = e.props ?? {}, a = at(o, t, r, s), u = {
|
|
1353
1353
|
...i,
|
|
1354
1354
|
...a.props
|
|
1355
|
-
},
|
|
1355
|
+
}, m = {
|
|
1356
1356
|
...s,
|
|
1357
1357
|
...a.attrs
|
|
1358
1358
|
}, g = r.namespaceURI === "http://www.w3.org/2000/svg";
|
|
1359
|
-
for (const h in
|
|
1360
|
-
const l =
|
|
1359
|
+
for (const h in m) {
|
|
1360
|
+
const l = m[h];
|
|
1361
1361
|
if (!(typeof h != "string" || /\[object Object\]/.test(h))) {
|
|
1362
1362
|
if (typeof l == "boolean")
|
|
1363
1363
|
l && r.setAttribute(h, "");
|
|
@@ -1441,9 +1441,9 @@ function X(e, t, n) {
|
|
|
1441
1441
|
r.appendChild(X(h, t, n));
|
|
1442
1442
|
else typeof e.children == "string" && (r.textContent = e.children);
|
|
1443
1443
|
try {
|
|
1444
|
-
if (r instanceof HTMLSelectElement &&
|
|
1444
|
+
if (r instanceof HTMLSelectElement && m && m.hasOwnProperty("value"))
|
|
1445
1445
|
try {
|
|
1446
|
-
r.value =
|
|
1446
|
+
r.value = m.value ?? "";
|
|
1447
1447
|
} catch {
|
|
1448
1448
|
}
|
|
1449
1449
|
} catch {
|
|
@@ -1464,11 +1464,11 @@ function Rt(e, t, n, r, i) {
|
|
|
1464
1464
|
const d = l.key;
|
|
1465
1465
|
d != null && u.set(d, l);
|
|
1466
1466
|
}
|
|
1467
|
-
const
|
|
1467
|
+
const m = /* @__PURE__ */ new Set();
|
|
1468
1468
|
let g = e.firstChild;
|
|
1469
1469
|
function b(l, d) {
|
|
1470
1470
|
let v = l;
|
|
1471
|
-
for (; v && (
|
|
1471
|
+
for (; v && (m.add(v), v !== d); )
|
|
1472
1472
|
v = v.nextSibling;
|
|
1473
1473
|
}
|
|
1474
1474
|
function h(l, d, v, w) {
|
|
@@ -1476,10 +1476,10 @@ function Rt(e, t, n, r, i) {
|
|
|
1476
1476
|
let p = l.nextSibling;
|
|
1477
1477
|
for (; p && p !== d; )
|
|
1478
1478
|
c.push(p), p = p.nextSibling;
|
|
1479
|
-
const
|
|
1480
|
-
if (w.some((k) => k && k.key != null) ||
|
|
1479
|
+
const y = Array.isArray(v) ? v : [];
|
|
1480
|
+
if (w.some((k) => k && k.key != null) || y.some((k) => k && k.key != null)) {
|
|
1481
1481
|
const k = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
|
|
1482
|
-
for (const _ of
|
|
1482
|
+
for (const _ of y)
|
|
1483
1483
|
_ && _.key != null && k.set(_.key, _);
|
|
1484
1484
|
for (const _ of c) {
|
|
1485
1485
|
const $ = _.key;
|
|
@@ -1505,11 +1505,11 @@ function Rt(e, t, n, r, i) {
|
|
|
1505
1505
|
!x.has(_) && e.contains(_) && e.removeChild(_);
|
|
1506
1506
|
} else {
|
|
1507
1507
|
const k = Math.min(
|
|
1508
|
-
|
|
1508
|
+
y.length,
|
|
1509
1509
|
w.length
|
|
1510
1510
|
);
|
|
1511
1511
|
for (let f = 0; f < k; f++) {
|
|
1512
|
-
const x =
|
|
1512
|
+
const x = y[f], A = w[f], _ = $e(c[f], x, A, r);
|
|
1513
1513
|
_ !== c[f] && (e.insertBefore(_, c[f]), e.removeChild(c[f]));
|
|
1514
1514
|
}
|
|
1515
1515
|
for (let f = k; f < w.length; f++)
|
|
@@ -1522,21 +1522,21 @@ function Rt(e, t, n, r, i) {
|
|
|
1522
1522
|
let d;
|
|
1523
1523
|
if (l.tag === "#anchor") {
|
|
1524
1524
|
const v = l.key, w = `${v}:start`, c = `${v}:end`;
|
|
1525
|
-
let p = u.get(w),
|
|
1525
|
+
let p = u.get(w), y = u.get(c);
|
|
1526
1526
|
const C = Array.isArray(l.children) ? l.children : [];
|
|
1527
|
-
if (p || (p = document.createTextNode(""), p.key = w),
|
|
1527
|
+
if (p || (p = document.createTextNode(""), p.key = w), y || (y = document.createTextNode(""), y.key = c), l._startNode = p, l._endNode = y, !e.contains(p) || !e.contains(y)) {
|
|
1528
1528
|
e.insertBefore(p, g);
|
|
1529
1529
|
for (const k of C)
|
|
1530
1530
|
e.insertBefore(X(k, r), g);
|
|
1531
|
-
e.insertBefore(
|
|
1531
|
+
e.insertBefore(y, g);
|
|
1532
1532
|
} else
|
|
1533
1533
|
h(
|
|
1534
1534
|
p,
|
|
1535
|
-
|
|
1535
|
+
y,
|
|
1536
1536
|
a.get(v)?.children,
|
|
1537
1537
|
C
|
|
1538
1538
|
);
|
|
1539
|
-
b(p,
|
|
1539
|
+
b(p, y), g = y.nextSibling;
|
|
1540
1540
|
continue;
|
|
1541
1541
|
}
|
|
1542
1542
|
if (l.key != null && u.has(l.key)) {
|
|
@@ -1547,13 +1547,13 @@ function Rt(e, t, n, r, i) {
|
|
|
1547
1547
|
l,
|
|
1548
1548
|
r,
|
|
1549
1549
|
i
|
|
1550
|
-
),
|
|
1550
|
+
), m.add(d), d !== g && e.contains(d) && (g && !e.contains(g) && (g = null), e.insertBefore(d, g));
|
|
1551
1551
|
} else
|
|
1552
|
-
d = X(l, r, i), g && !e.contains(g) && (g = null), e.insertBefore(d, g),
|
|
1552
|
+
d = X(l, r, i), g && !e.contains(g) && (g = null), e.insertBefore(d, g), m.add(d);
|
|
1553
1553
|
g = d.nextSibling;
|
|
1554
1554
|
}
|
|
1555
1555
|
for (const l of s)
|
|
1556
|
-
!
|
|
1556
|
+
!m.has(l) && e.contains(l) && (ue(l, i), e.removeChild(l));
|
|
1557
1557
|
}
|
|
1558
1558
|
function $e(e, t, n, r, i) {
|
|
1559
1559
|
if (t && typeof t != "string" && t.props?.ref && i && ue(e, i), t === n) return e;
|
|
@@ -1566,15 +1566,15 @@ function $e(e, t, n, r, i) {
|
|
|
1566
1566
|
}
|
|
1567
1567
|
}
|
|
1568
1568
|
if (n && typeof n != "string" && n.tag === "#anchor") {
|
|
1569
|
-
const o = n, a = Array.isArray(o.children) ? o.children : [], u = o._startNode ?? document.createTextNode(""),
|
|
1570
|
-
o.key != null && (u.key = `${o.key}:start`,
|
|
1569
|
+
const o = n, a = Array.isArray(o.children) ? o.children : [], u = o._startNode ?? document.createTextNode(""), m = o._endNode ?? document.createTextNode("");
|
|
1570
|
+
o.key != null && (u.key = `${o.key}:start`, m.key = `${o.key}:end`), o._startNode = u, o._endNode = m;
|
|
1571
1571
|
const g = document.createDocumentFragment();
|
|
1572
1572
|
g.appendChild(u);
|
|
1573
1573
|
for (const b of a) {
|
|
1574
1574
|
const h = X(b, r);
|
|
1575
1575
|
g.appendChild(h);
|
|
1576
1576
|
}
|
|
1577
|
-
return g.appendChild(
|
|
1577
|
+
return g.appendChild(m), e.parentNode?.replaceChild(g, e), u;
|
|
1578
1578
|
}
|
|
1579
1579
|
if (!n) {
|
|
1580
1580
|
ue(e, i);
|
|
@@ -1589,11 +1589,11 @@ function $e(e, t, n, r, i) {
|
|
|
1589
1589
|
if (n.tag === "#anchor") {
|
|
1590
1590
|
const o = Array.isArray(n.children) ? n.children : [], a = n._startNode ?? document.createTextNode(""), u = n._endNode ?? document.createTextNode("");
|
|
1591
1591
|
n.key != null && (a.key = `${n.key}:start`, u.key = `${n.key}:end`), n._startNode = a, n._endNode = u;
|
|
1592
|
-
const
|
|
1593
|
-
|
|
1592
|
+
const m = document.createDocumentFragment();
|
|
1593
|
+
m.appendChild(a);
|
|
1594
1594
|
for (const g of o)
|
|
1595
|
-
|
|
1596
|
-
return
|
|
1595
|
+
m.appendChild(X(g, r));
|
|
1596
|
+
return m.appendChild(u), e.parentNode?.replaceChild(m, e), a;
|
|
1597
1597
|
}
|
|
1598
1598
|
if (typeof t != "string" && typeof n != "string" && t.tag === n.tag && t.key === n.key) {
|
|
1599
1599
|
const o = e;
|
|
@@ -1621,11 +1621,11 @@ function Ot(e, t, n, r) {
|
|
|
1621
1621
|
let a;
|
|
1622
1622
|
s && o ? typeof s != "string" && typeof i != "string" && s.tag === i.tag && s.key === i.key ? a = $e(o, s, i, n, r) : (a = X(i, n, r), e.replaceChild(a, o)) : (a = X(i, n, r), e.firstChild ? e.replaceChild(a, e.firstChild) : e.appendChild(a));
|
|
1623
1623
|
const u = [];
|
|
1624
|
-
for (let
|
|
1625
|
-
const g = e.childNodes[
|
|
1624
|
+
for (let m = 0; m < e.childNodes.length; m++) {
|
|
1625
|
+
const g = e.childNodes[m];
|
|
1626
1626
|
g !== a && g.nodeName !== "STYLE" && (ue(g, r), u.push(g));
|
|
1627
1627
|
}
|
|
1628
|
-
u.forEach((
|
|
1628
|
+
u.forEach((m) => e.removeChild(m)), e._prevVNode = i, e._prevDom = a;
|
|
1629
1629
|
}
|
|
1630
1630
|
function Pe(e) {
|
|
1631
1631
|
if (typeof e == "string") return ie(e);
|
|
@@ -1874,8 +1874,12 @@ const Mt = Pt`
|
|
|
1874
1874
|
"h-screen": "height:100dvw;",
|
|
1875
1875
|
"max-w-full": "max-width:100%;",
|
|
1876
1876
|
"max-h-full": "max-height:100%;",
|
|
1877
|
+
"max-w-screen": "max-width:100dvw;",
|
|
1878
|
+
"max-h-screen": "max-height:100dvh;",
|
|
1877
1879
|
"min-w-0": "min-width:0;",
|
|
1878
1880
|
"min-h-0": "min-height:0;",
|
|
1881
|
+
"min-w-screen": "min-width:100dvw;",
|
|
1882
|
+
"min-h-screen": "min-height:100dvh;",
|
|
1879
1883
|
...zt(),
|
|
1880
1884
|
"m-auto": "margin:auto;",
|
|
1881
1885
|
"mx-auto": "margin-inline:auto;",
|
|
@@ -2264,23 +2268,23 @@ const Xe = /* @__PURE__ */ new Map(), Kt = 16;
|
|
|
2264
2268
|
function Vt(e) {
|
|
2265
2269
|
const t = Date.now(), n = Xe.get(e);
|
|
2266
2270
|
if (n && t - n.timestamp < Kt) return n.css;
|
|
2267
|
-
const r = Ft(e), i = new Set(r), s = [], o = [], a = [], u = [],
|
|
2271
|
+
const r = Ft(e), i = new Set(r), s = [], o = [], a = [], u = [], m = {};
|
|
2268
2272
|
function g(w, c = !1) {
|
|
2269
2273
|
const p = (c ? "dark|" : "") + w;
|
|
2270
|
-
if (p in
|
|
2271
|
-
const
|
|
2272
|
-
return
|
|
2274
|
+
if (p in m) return m[p];
|
|
2275
|
+
const y = d(w, c);
|
|
2276
|
+
return m[p] = y, y;
|
|
2273
2277
|
}
|
|
2274
2278
|
function b(w) {
|
|
2275
|
-
const c = w.some((
|
|
2279
|
+
const c = w.some((y) => je.includes(y)), p = w.includes("dark");
|
|
2276
2280
|
return w.length === 0 ? 1 : !c && !p ? 2 : c && !p ? 3 : 4;
|
|
2277
2281
|
}
|
|
2278
2282
|
function h(w) {
|
|
2279
2283
|
const c = [];
|
|
2280
|
-
let p = "",
|
|
2284
|
+
let p = "", y = 0, C = 0;
|
|
2281
2285
|
for (let k = 0; k < w.length; k++) {
|
|
2282
2286
|
const f = w[k];
|
|
2283
|
-
f === "[" ?
|
|
2287
|
+
f === "[" ? y++ : f === "]" && y > 0 ? y-- : f === "(" ? C++ : f === ")" && C > 0 && C--, f === ":" && y === 0 && C === 0 ? (c.push(p), p = "") : p += f;
|
|
2284
2288
|
}
|
|
2285
2289
|
return p && c.push(p), c;
|
|
2286
2290
|
}
|
|
@@ -2316,15 +2320,15 @@ function Vt(e) {
|
|
|
2316
2320
|
}
|
|
2317
2321
|
function d(w, c = !1) {
|
|
2318
2322
|
const p = h(w);
|
|
2319
|
-
let
|
|
2320
|
-
const C = p.find((E) => (E.startsWith("!") && (
|
|
2323
|
+
let y = !1;
|
|
2324
|
+
const C = p.find((E) => (E.startsWith("!") && (y = !0, E = E.slice(1)), Le[E] || Ne(E) || ze(E) || We(E) || Se(E)));
|
|
2321
2325
|
if (!C) return null;
|
|
2322
2326
|
const k = C.replace(/^!/, ""), f = Le[k] ?? Ne(k) ?? ze(k) ?? We(k) ?? Se(k);
|
|
2323
2327
|
if (!f) return null;
|
|
2324
2328
|
const x = p.indexOf(C);
|
|
2325
2329
|
let A = x >= 0 ? p.slice(0, x) : [];
|
|
2326
2330
|
c && (A = A.filter((E) => E !== "dark"));
|
|
2327
|
-
const _ = `.${qt(w)}`, $ = "__SUBJECT__", T =
|
|
2331
|
+
const _ = `.${qt(w)}`, $ = "__SUBJECT__", T = y ? f.replace(/;$/, " !important;") : f;
|
|
2328
2332
|
let R = $;
|
|
2329
2333
|
const S = [];
|
|
2330
2334
|
for (const E of A)
|
|
@@ -2391,7 +2395,7 @@ function Vt(e) {
|
|
|
2391
2395
|
(f) => Le[f] || Ne(f) || ze(f) || We(f) || Se(f)
|
|
2392
2396
|
);
|
|
2393
2397
|
if (!p) continue;
|
|
2394
|
-
const
|
|
2398
|
+
const y = c.indexOf(p), C = y >= 0 ? c.slice(0, y) : [], k = b(C);
|
|
2395
2399
|
if (k === 4) {
|
|
2396
2400
|
const f = g(w, !0);
|
|
2397
2401
|
f && u.push(f);
|
|
@@ -2410,10 +2414,10 @@ function Jt(e, t, n, r, i, s, o, a) {
|
|
|
2410
2414
|
try {
|
|
2411
2415
|
const u = t.render(n);
|
|
2412
2416
|
if (u instanceof Promise) {
|
|
2413
|
-
s(!0), u.then((
|
|
2414
|
-
s(!1), o(null), Ye(e,
|
|
2415
|
-
}).catch((
|
|
2416
|
-
s(!1), o(
|
|
2417
|
+
s(!0), u.then((m) => {
|
|
2418
|
+
s(!1), o(null), Ye(e, m, n, r, i), a(e.innerHTML);
|
|
2419
|
+
}).catch((m) => {
|
|
2420
|
+
s(!1), o(m);
|
|
2417
2421
|
});
|
|
2418
2422
|
return;
|
|
2419
2423
|
}
|
|
@@ -2453,10 +2457,10 @@ Stopping runaway component render to prevent browser freeze`
|
|
|
2453
2457
|
}
|
|
2454
2458
|
} else
|
|
2455
2459
|
i(0);
|
|
2456
|
-
const
|
|
2460
|
+
const m = setTimeout(() => {
|
|
2457
2461
|
r(Date.now()), e(), o(null);
|
|
2458
2462
|
}, n > 10 ? 100 : 0);
|
|
2459
|
-
o(
|
|
2463
|
+
o(m);
|
|
2460
2464
|
}
|
|
2461
2465
|
function Gt(e, t, n, r, i) {
|
|
2462
2466
|
if (!e) return;
|
|
@@ -2487,7 +2491,7 @@ function hn() {
|
|
|
2487
2491
|
const e = N.emit;
|
|
2488
2492
|
return (t, n) => e(t, n);
|
|
2489
2493
|
}
|
|
2490
|
-
function
|
|
2494
|
+
function ye(e) {
|
|
2491
2495
|
e._hookCallbacks || Object.defineProperty(e, "_hookCallbacks", {
|
|
2492
2496
|
value: {},
|
|
2493
2497
|
writable: !0,
|
|
@@ -2498,27 +2502,27 @@ function me(e) {
|
|
|
2498
2502
|
function gn(e) {
|
|
2499
2503
|
if (!N)
|
|
2500
2504
|
throw new Error("useOnConnected must be called during component render");
|
|
2501
|
-
|
|
2505
|
+
ye(N), N._hookCallbacks.onConnected = e;
|
|
2502
2506
|
}
|
|
2503
|
-
function
|
|
2507
|
+
function mn(e) {
|
|
2504
2508
|
if (!N)
|
|
2505
2509
|
throw new Error("useOnDisconnected must be called during component render");
|
|
2506
|
-
|
|
2510
|
+
ye(N), N._hookCallbacks.onDisconnected = e;
|
|
2507
2511
|
}
|
|
2508
|
-
function
|
|
2512
|
+
function yn(e) {
|
|
2509
2513
|
if (!N)
|
|
2510
2514
|
throw new Error("useOnAttributeChanged must be called during component render");
|
|
2511
|
-
|
|
2515
|
+
ye(N), N._hookCallbacks.onAttributeChanged = e;
|
|
2512
2516
|
}
|
|
2513
2517
|
function bn(e) {
|
|
2514
2518
|
if (!N)
|
|
2515
2519
|
throw new Error("useOnError must be called during component render");
|
|
2516
|
-
|
|
2520
|
+
ye(N), N._hookCallbacks.onError = e;
|
|
2517
2521
|
}
|
|
2518
2522
|
function wn(e) {
|
|
2519
2523
|
if (!N)
|
|
2520
2524
|
throw new Error("useStyle must be called during component render");
|
|
2521
|
-
|
|
2525
|
+
ye(N);
|
|
2522
2526
|
try {
|
|
2523
2527
|
const t = e();
|
|
2524
2528
|
Object.defineProperty(N, "_computedStyle", {
|
|
@@ -2771,8 +2775,8 @@ function Qt(e, t) {
|
|
|
2771
2775
|
try {
|
|
2772
2776
|
let r = function(s, o = "") {
|
|
2773
2777
|
return Array.isArray(s) ? new Proxy(s, {
|
|
2774
|
-
get(a, u,
|
|
2775
|
-
const g = Reflect.get(a, u,
|
|
2778
|
+
get(a, u, m) {
|
|
2779
|
+
const g = Reflect.get(a, u, m);
|
|
2776
2780
|
return typeof g == "function" && typeof u == "string" && [
|
|
2777
2781
|
"push",
|
|
2778
2782
|
"pop",
|
|
@@ -2790,17 +2794,17 @@ function Qt(e, t) {
|
|
|
2790
2794
|
return l;
|
|
2791
2795
|
} : g;
|
|
2792
2796
|
},
|
|
2793
|
-
set(a, u,
|
|
2794
|
-
if (a[u] =
|
|
2797
|
+
set(a, u, m) {
|
|
2798
|
+
if (a[u] = m, !i._initializing) {
|
|
2795
2799
|
const g = o ? `${o}.${String(u)}` : String(u);
|
|
2796
|
-
i._triggerWatchers(g,
|
|
2800
|
+
i._triggerWatchers(g, m), fe(() => i._render(n), i._componentId);
|
|
2797
2801
|
}
|
|
2798
2802
|
return !0;
|
|
2799
2803
|
},
|
|
2800
2804
|
deleteProperty(a, u) {
|
|
2801
2805
|
if (delete a[u], !i._initializing) {
|
|
2802
|
-
const
|
|
2803
|
-
i._triggerWatchers(
|
|
2806
|
+
const m = o ? `${o}.${String(u)}` : String(u);
|
|
2807
|
+
i._triggerWatchers(m, void 0), fe(() => i._render(n), i._componentId);
|
|
2804
2808
|
}
|
|
2805
2809
|
return !0;
|
|
2806
2810
|
}
|
|
@@ -2808,15 +2812,15 @@ function Qt(e, t) {
|
|
|
2808
2812
|
const u = o ? `${o}.${a}` : a;
|
|
2809
2813
|
s[a] = r(s[a], u);
|
|
2810
2814
|
}), new Proxy(s, {
|
|
2811
|
-
set(a, u,
|
|
2815
|
+
set(a, u, m) {
|
|
2812
2816
|
const g = o ? `${o}.${String(u)}` : String(u);
|
|
2813
|
-
return a[u] = r(
|
|
2817
|
+
return a[u] = r(m, g), i._initializing || (i._triggerWatchers(
|
|
2814
2818
|
g,
|
|
2815
2819
|
a[u]
|
|
2816
2820
|
), fe(() => i._render(n), i._componentId)), !0;
|
|
2817
2821
|
},
|
|
2818
|
-
get(a, u,
|
|
2819
|
-
return Reflect.get(a, u,
|
|
2822
|
+
get(a, u, m) {
|
|
2823
|
+
return Reflect.get(a, u, m);
|
|
2820
2824
|
}
|
|
2821
2825
|
})) : s;
|
|
2822
2826
|
};
|
|
@@ -2834,7 +2838,7 @@ function Qt(e, t) {
|
|
|
2834
2838
|
}
|
|
2835
2839
|
_initWatchers(n) {
|
|
2836
2840
|
this._runLogicWithinErrorBoundary(n, () => {
|
|
2837
|
-
|
|
2841
|
+
mt(
|
|
2838
2842
|
this.context,
|
|
2839
2843
|
this._watchers,
|
|
2840
2844
|
{}
|
|
@@ -2843,7 +2847,7 @@ function Qt(e, t) {
|
|
|
2843
2847
|
});
|
|
2844
2848
|
}
|
|
2845
2849
|
_triggerWatchers(n, r) {
|
|
2846
|
-
|
|
2850
|
+
yt(this.context, this._watchers, n, r);
|
|
2847
2851
|
}
|
|
2848
2852
|
_applyProps(n) {
|
|
2849
2853
|
this._runLogicWithinErrorBoundary(n, () => {
|
|
@@ -2864,8 +2868,8 @@ function et(e, t) {
|
|
|
2864
2868
|
try {
|
|
2865
2869
|
const a = t.toString().match(/\(\s*{\s*([^}]+)\s*}/);
|
|
2866
2870
|
if (a) {
|
|
2867
|
-
const
|
|
2868
|
-
for (const g of
|
|
2871
|
+
const m = a[1].split(",").map((g) => g.trim());
|
|
2872
|
+
for (const g of m) {
|
|
2869
2873
|
const b = g.indexOf("=");
|
|
2870
2874
|
if (b !== -1) {
|
|
2871
2875
|
const h = g.substring(0, b).trim(), l = g.substring(b + 1).trim();
|
|
@@ -2895,7 +2899,7 @@ function et(e, t) {
|
|
|
2895
2899
|
onDisconnected: (o) => {
|
|
2896
2900
|
i.onDisconnected && i.onDisconnected();
|
|
2897
2901
|
},
|
|
2898
|
-
onAttributeChanged: (o, a, u,
|
|
2902
|
+
onAttributeChanged: (o, a, u, m) => {
|
|
2899
2903
|
i.onAttributeChanged && i.onAttributeChanged(o, a, u);
|
|
2900
2904
|
},
|
|
2901
2905
|
onError: (o, a) => {
|
|
@@ -2909,19 +2913,19 @@ function et(e, t) {
|
|
|
2909
2913
|
try {
|
|
2910
2914
|
Xt(o);
|
|
2911
2915
|
const u = Object.keys(r).length > 0;
|
|
2912
|
-
let
|
|
2916
|
+
let m;
|
|
2913
2917
|
if (u) {
|
|
2914
2918
|
const g = {};
|
|
2915
2919
|
Object.keys(r).forEach((b) => {
|
|
2916
2920
|
g[b] = o[b] ?? r[b];
|
|
2917
|
-
}),
|
|
2921
|
+
}), m = t(g);
|
|
2918
2922
|
} else
|
|
2919
|
-
|
|
2923
|
+
m = t();
|
|
2920
2924
|
if (o._hookCallbacks) {
|
|
2921
2925
|
const g = o._hookCallbacks;
|
|
2922
2926
|
g.onConnected && (i.onConnected = g.onConnected), g.onDisconnected && (i.onDisconnected = g.onDisconnected), g.onAttributeChanged && (i.onAttributeChanged = g.onAttributeChanged), g.onError && (i.onError = g.onError), g.style && (o._styleCallback = g.style);
|
|
2923
2927
|
}
|
|
2924
|
-
return
|
|
2928
|
+
return m;
|
|
2925
2929
|
} finally {
|
|
2926
2930
|
Yt(), F.clearCurrentComponent();
|
|
2927
2931
|
}
|
|
@@ -2984,33 +2988,33 @@ function rn(e, t = [], n = {}) {
|
|
|
2984
2988
|
const r = {}, i = {}, s = {}, o = [], a = /([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;
|
|
2985
2989
|
let u;
|
|
2986
2990
|
for (; u = a.exec(e); ) {
|
|
2987
|
-
const
|
|
2991
|
+
const m = u[1], g = u[2], b = (u[4] || u[6]) ?? "", h = b.match(/^{{(\d+)}}$/);
|
|
2988
2992
|
let l = h ? t[Number(h[1])] ?? null : b;
|
|
2989
2993
|
h || (l === "true" ? l = !0 : l === "false" ? l = !1 : l === "null" ? l = null : isNaN(Number(l)) || (l = Number(l)));
|
|
2990
2994
|
const d = ["model", "bind", "show", "class", "style", "ref"];
|
|
2991
|
-
if (
|
|
2995
|
+
if (m === ":") {
|
|
2992
2996
|
const [v, w] = g.split(":"), [c, ...p] = v.split(".");
|
|
2993
2997
|
if (d.includes(c)) {
|
|
2994
|
-
const
|
|
2998
|
+
const y = [...p], C = c === "model" && w ? `model:${w}` : c;
|
|
2995
2999
|
s[C] = {
|
|
2996
3000
|
value: l,
|
|
2997
|
-
modifiers:
|
|
3001
|
+
modifiers: y,
|
|
2998
3002
|
arg: w
|
|
2999
3003
|
};
|
|
3000
3004
|
} else {
|
|
3001
|
-
let
|
|
3002
|
-
|
|
3005
|
+
let y = l;
|
|
3006
|
+
y && ee(y) && (y = y.value), i[g] = y, o.push(g);
|
|
3003
3007
|
}
|
|
3004
|
-
} else if (
|
|
3008
|
+
} else if (m === "@") {
|
|
3005
3009
|
const [v, ...w] = g.split("."), c = w;
|
|
3006
3010
|
tn(l, v);
|
|
3007
3011
|
const p = typeof l == "function" ? l : typeof n[l] == "function" ? n[l] : void 0;
|
|
3008
3012
|
if (p) {
|
|
3009
|
-
const
|
|
3013
|
+
const y = (k) => {
|
|
3010
3014
|
if (c.includes("prevent") && k.preventDefault(), c.includes("stop") && k.stopPropagation(), !(c.includes("self") && k.target !== k.currentTarget))
|
|
3011
|
-
return c.includes("once") && k.currentTarget?.removeEventListener(v,
|
|
3015
|
+
return c.includes("once") && k.currentTarget?.removeEventListener(v, y), p(k);
|
|
3012
3016
|
}, C = "on" + v.charAt(0).toUpperCase() + v.slice(1);
|
|
3013
|
-
r[C] =
|
|
3017
|
+
r[C] = y;
|
|
3014
3018
|
}
|
|
3015
3019
|
} else g === "ref" ? r.ref = l : i[g] = l;
|
|
3016
3020
|
}
|
|
@@ -3028,7 +3032,7 @@ function sn(e, t, n) {
|
|
|
3028
3032
|
let u = "";
|
|
3029
3033
|
for (let f = 0; f < e.length; f++)
|
|
3030
3034
|
u += e[f], f < t.length && (u += `{{${f}}}`);
|
|
3031
|
-
const
|
|
3035
|
+
const m = /<!--[\s\S]*?-->|<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g, g = [];
|
|
3032
3036
|
let b, h = [], l = null, d = {}, v, w = 0, c = [];
|
|
3033
3037
|
function p(f) {
|
|
3034
3038
|
!f || typeof f != "object" || Ae(f) || (f.props || f.attrs ? (f.props && (d.props || (d.props = {}), Object.assign(d.props, f.props)), f.attrs && (d.attrs || (d.attrs = {}), Object.keys(f.attrs).forEach((x) => {
|
|
@@ -3047,7 +3051,7 @@ function sn(e, t, n) {
|
|
|
3047
3051
|
d.attrs[x] = f.attrs[x];
|
|
3048
3052
|
}))) : (d.props || (d.props = {}), Object.assign(d.props, f)));
|
|
3049
3053
|
}
|
|
3050
|
-
function
|
|
3054
|
+
function y(f, x) {
|
|
3051
3055
|
const A = l ? h : c;
|
|
3052
3056
|
if (Ae(f)) {
|
|
3053
3057
|
const _ = f.key ?? x;
|
|
@@ -3067,7 +3071,7 @@ function sn(e, t, n) {
|
|
|
3067
3071
|
if (f.length === 0) return;
|
|
3068
3072
|
for (let _ = 0; _ < f.length; _++) {
|
|
3069
3073
|
const $ = f[_];
|
|
3070
|
-
Ae($) || _e($) || Array.isArray($) ?
|
|
3074
|
+
Ae($) || _e($) || Array.isArray($) ? y($, `${x}-${_}`) : $ !== null && typeof $ == "object" ? p($) : A.push(a(String($), `${x}-${_}`));
|
|
3071
3075
|
}
|
|
3072
3076
|
return;
|
|
3073
3077
|
}
|
|
@@ -3093,7 +3097,7 @@ function sn(e, t, n) {
|
|
|
3093
3097
|
"track",
|
|
3094
3098
|
"wbr"
|
|
3095
3099
|
]);
|
|
3096
|
-
for (; b =
|
|
3100
|
+
for (; b = m.exec(u); )
|
|
3097
3101
|
if (!(b[0].startsWith("<!--") && b[0].endsWith("-->"))) {
|
|
3098
3102
|
if (b[1]) {
|
|
3099
3103
|
const f = b[1], x = b[0][1] === "/", A = b[0][b[0].length - 2] === "/" || C.has(f), {
|
|
@@ -3184,7 +3188,7 @@ function sn(e, t, n) {
|
|
|
3184
3188
|
}), l = f, d = S, h = []);
|
|
3185
3189
|
} else if (typeof b[3] < "u") {
|
|
3186
3190
|
const f = Number(b[3]), x = t[f], A = `interp-${f}`;
|
|
3187
|
-
|
|
3191
|
+
y(x, A);
|
|
3188
3192
|
} else if (b[4]) {
|
|
3189
3193
|
const f = b[4], x = l ? h : c, A = f.split(/({{\d+}})/);
|
|
3190
3194
|
for (const _ of A) {
|
|
@@ -3192,7 +3196,7 @@ function sn(e, t, n) {
|
|
|
3192
3196
|
const $ = _.match(/^{{(\d+)}}$/);
|
|
3193
3197
|
if ($) {
|
|
3194
3198
|
const T = Number($[1]), R = t[T], S = `interp-${T}`;
|
|
3195
|
-
|
|
3199
|
+
y(R, S);
|
|
3196
3200
|
} else {
|
|
3197
3201
|
const T = `text-${w++}`;
|
|
3198
3202
|
x.push(a(_, T));
|
|
@@ -3289,8 +3293,8 @@ function $n(e, t, n) {
|
|
|
3289
3293
|
function Sn(e, t, n, r) {
|
|
3290
3294
|
const i = n * t, s = Math.min(i + t, e.length);
|
|
3291
3295
|
return e.slice(i, s).map((a, u) => {
|
|
3292
|
-
const
|
|
3293
|
-
return j(r(a,
|
|
3296
|
+
const m = i + u, g = typeof a == "object" && a != null ? a?.key ?? a?.id ?? `page-${m}` : `page-${m}`;
|
|
3297
|
+
return j(r(a, m, u), `each-page-${g}`);
|
|
3294
3298
|
});
|
|
3295
3299
|
}
|
|
3296
3300
|
function An(e, t) {
|
|
@@ -3514,8 +3518,8 @@ const nt = (e) => e ? typeof URLSearchParams > "u" ? {} : Object.fromEntries(new
|
|
|
3514
3518
|
const r = [], i = n.path.replace(/:[^/]+/g, (a) => (r.push(a.slice(1)), "([^/]+)")), s = new RegExp(`^${i}$`), o = t.match(s);
|
|
3515
3519
|
if (o) {
|
|
3516
3520
|
const a = {};
|
|
3517
|
-
return r.forEach((u,
|
|
3518
|
-
a[u] = o[
|
|
3521
|
+
return r.forEach((u, m) => {
|
|
3522
|
+
a[u] = o[m + 1];
|
|
3519
3523
|
}), { route: n, params: a };
|
|
3520
3524
|
}
|
|
3521
3525
|
}
|
|
@@ -3536,7 +3540,7 @@ async function ln(e) {
|
|
|
3536
3540
|
}
|
|
3537
3541
|
function un(e) {
|
|
3538
3542
|
const { routes: t, base: n = "", initialUrl: r } = e;
|
|
3539
|
-
let i, s, o, a, u,
|
|
3543
|
+
let i, s, o, a, u, m, g;
|
|
3540
3544
|
const b = async (v, w) => {
|
|
3541
3545
|
const c = t.find((p) => Q([p], v.path).route !== null);
|
|
3542
3546
|
if (c?.beforeEnter)
|
|
@@ -3572,13 +3576,13 @@ function un(e) {
|
|
|
3572
3576
|
query: {}
|
|
3573
3577
|
}, p = Q(t, c.path);
|
|
3574
3578
|
if (!p) throw new Error(`No route found for ${c.path}`);
|
|
3575
|
-
const
|
|
3579
|
+
const y = o.getState(), C = {
|
|
3576
3580
|
path: c.path,
|
|
3577
3581
|
params: p.params,
|
|
3578
3582
|
query: c.query
|
|
3579
3583
|
};
|
|
3580
|
-
if (!await b(C,
|
|
3581
|
-
typeof window < "u" && typeof document < "u" && (w ? window.history.replaceState({}, "", n + v) : window.history.pushState({}, "", n + v)), o.setState(C), l(C,
|
|
3584
|
+
if (!await b(C, y) || !await h(C, y)) return;
|
|
3585
|
+
typeof window < "u" && typeof document < "u" && (w ? window.history.replaceState({}, "", n + v) : window.history.pushState({}, "", n + v)), o.setState(C), l(C, y);
|
|
3582
3586
|
} catch (c) {
|
|
3583
3587
|
se("Navigation error:", c);
|
|
3584
3588
|
}
|
|
@@ -3596,11 +3600,11 @@ function un(e) {
|
|
|
3596
3600
|
}), a = async (w = !1) => {
|
|
3597
3601
|
const c = i();
|
|
3598
3602
|
await d(c.path, w);
|
|
3599
|
-
}, window.addEventListener("popstate", () => a(!0)), u = (w) => d(w, !1),
|
|
3603
|
+
}, window.addEventListener("popstate", () => a(!0)), u = (w) => d(w, !1), m = (w) => d(w, !0), g = () => window.history.back();
|
|
3600
3604
|
} else {
|
|
3601
3605
|
i = () => {
|
|
3602
|
-
const c = new URL(r || "/", "http://localhost"), p = c.pathname.replace(n, "") || "/",
|
|
3603
|
-
return { path: p, query:
|
|
3606
|
+
const c = new URL(r || "/", "http://localhost"), p = c.pathname.replace(n, "") || "/", y = nt(c.search);
|
|
3607
|
+
return { path: p, query: y };
|
|
3604
3608
|
}, s = i();
|
|
3605
3609
|
const v = Q(t, s.path);
|
|
3606
3610
|
o = tt({
|
|
@@ -3616,11 +3620,11 @@ function un(e) {
|
|
|
3616
3620
|
const p = {
|
|
3617
3621
|
path: c.replace(n, "") || "/",
|
|
3618
3622
|
query: {}
|
|
3619
|
-
},
|
|
3620
|
-
if (!
|
|
3623
|
+
}, y = Q(t, p.path);
|
|
3624
|
+
if (!y) throw new Error(`No route found for ${p.path}`);
|
|
3621
3625
|
const C = o.getState(), k = {
|
|
3622
3626
|
path: p.path,
|
|
3623
|
-
params:
|
|
3627
|
+
params: y.params,
|
|
3624
3628
|
query: p.query
|
|
3625
3629
|
}, f = t.find((x) => Q([x], k.path).route !== null);
|
|
3626
3630
|
if (f?.beforeEnter)
|
|
@@ -3653,13 +3657,13 @@ function un(e) {
|
|
|
3653
3657
|
} catch {
|
|
3654
3658
|
}
|
|
3655
3659
|
};
|
|
3656
|
-
u = async (c) => w(c),
|
|
3660
|
+
u = async (c) => w(c), m = async (c) => w(c), g = () => {
|
|
3657
3661
|
};
|
|
3658
3662
|
}
|
|
3659
3663
|
return {
|
|
3660
3664
|
store: o,
|
|
3661
3665
|
push: u,
|
|
3662
|
-
replace:
|
|
3666
|
+
replace: m,
|
|
3663
3667
|
back: g,
|
|
3664
3668
|
subscribe: o.subscribe,
|
|
3665
3669
|
matchRoute: (v) => Q(t, v),
|
|
@@ -3683,8 +3687,8 @@ function zn(e) {
|
|
|
3683
3687
|
if (typeof u == "string")
|
|
3684
3688
|
return { tag: u, props: {}, children: [] };
|
|
3685
3689
|
if (typeof u == "function") {
|
|
3686
|
-
const
|
|
3687
|
-
return (
|
|
3690
|
+
const m = u();
|
|
3691
|
+
return (m instanceof Promise ? m : Promise.resolve(m)).then((b) => typeof b == "string" ? { tag: b, props: {}, children: [] } : b);
|
|
3688
3692
|
}
|
|
3689
3693
|
return ce`<div>Invalid route component</div>`;
|
|
3690
3694
|
}).catch(() => ce`<div>Invalid route component</div>`) : ce`<div>Not found</div>`;
|
|
@@ -3695,18 +3699,18 @@ function zn(e) {
|
|
|
3695
3699
|
replace: o = !1,
|
|
3696
3700
|
exact: a = !1,
|
|
3697
3701
|
activeClass: u = "active",
|
|
3698
|
-
exactActiveClass:
|
|
3702
|
+
exactActiveClass: m = "exact-active",
|
|
3699
3703
|
ariaCurrentValue: g = "page",
|
|
3700
3704
|
disabled: b = !1,
|
|
3701
3705
|
external: h = !1,
|
|
3702
3706
|
class: l = ""
|
|
3703
|
-
} = n, d = t.getCurrent(), v = d.path === i, w = a ? v : d && typeof d.path == "string" ? d.path.startsWith(i) : !1, c = v ? `aria-current="${g}"` : "", p = (l || "").split(/\s+/).filter(Boolean),
|
|
3704
|
-
for (const _ of p)
|
|
3707
|
+
} = n, d = t.getCurrent(), v = d.path === i, w = a ? v : d && typeof d.path == "string" ? d.path.startsWith(i) : !1, c = v ? `aria-current="${g}"` : "", p = (l || "").split(/\s+/).filter(Boolean), y = {};
|
|
3708
|
+
for (const _ of p) y[_] = !0;
|
|
3705
3709
|
const C = {
|
|
3706
|
-
...
|
|
3710
|
+
...y,
|
|
3707
3711
|
// Also include the configurable names (may duplicate the above)
|
|
3708
3712
|
[u]: w,
|
|
3709
|
-
[
|
|
3713
|
+
[m]: v
|
|
3710
3714
|
}, k = s === "button", f = b ? k ? 'disabled aria-disabled="true" tabindex="-1"' : 'aria-disabled="true" tabindex="-1"' : "", x = h && (s === "a" || !s) ? 'target="_blank" rel="noopener noreferrer"' : "", A = (_) => {
|
|
3711
3715
|
if (b) {
|
|
3712
3716
|
_.preventDefault();
|
|
@@ -3773,9 +3777,9 @@ export {
|
|
|
3773
3777
|
An as switchOnPromise,
|
|
3774
3778
|
xn as unless,
|
|
3775
3779
|
hn as useEmit,
|
|
3776
|
-
|
|
3780
|
+
yn as useOnAttributeChanged,
|
|
3777
3781
|
gn as useOnConnected,
|
|
3778
|
-
|
|
3782
|
+
mn as useOnDisconnected,
|
|
3779
3783
|
bn as useOnError,
|
|
3780
3784
|
un as useRouter,
|
|
3781
3785
|
wn as useStyle,
|