@jasonshimmy/custom-elements-runtime 0.1.5 → 0.1.7
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 +427 -417
- package/dist/custom-elements-runtime.es.js.map +1 -1
- package/dist/custom-elements-runtime.umd.js +11 -11
- package/dist/custom-elements-runtime.umd.js.map +1 -1
- package/dist/router.d.ts +22 -0
- package/dist/runtime/style.d.ts +6 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
function
|
|
1
|
+
function nt(e, t) {
|
|
2
2
|
return J(e ? t : [], "when-block");
|
|
3
3
|
}
|
|
4
|
-
function
|
|
4
|
+
function ot(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
7
|
return J(t(r, n), `each-${o}`);
|
|
@@ -160,7 +160,7 @@ class O extends EventTarget {
|
|
|
160
160
|
this.eventCounters.clear();
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
|
-
const H = O.getInstance(),
|
|
163
|
+
const H = O.getInstance(), it = (e, t) => H.emit(e, t), st = (e, t) => H.on(e, t), at = (e, t) => H.off(e, t), lt = (e, t) => H.once(e, t), ct = (e, t, r) => H.listen(e, t, r);
|
|
164
164
|
function ie(e) {
|
|
165
165
|
let t = { ...e };
|
|
166
166
|
const r = [];
|
|
@@ -219,9 +219,9 @@ function ke(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((d, y) => o(d, a[y]));
|
|
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((d) => o(i[d], a[d]));
|
|
225
225
|
}, s = t.get(r);
|
|
226
226
|
if (s && !o(n, s.oldValue))
|
|
227
227
|
try {
|
|
@@ -252,13 +252,13 @@ function $e(e, t, r) {
|
|
|
252
252
|
}
|
|
253
253
|
});
|
|
254
254
|
}
|
|
255
|
-
function
|
|
255
|
+
function _e(e, t, r, n) {
|
|
256
256
|
e.onConnected && !r && (e.onConnected(t), n(!0));
|
|
257
257
|
}
|
|
258
258
|
function Se(e, t, r, n, o, s, i, a) {
|
|
259
259
|
e.onDisconnected && e.onDisconnected(t), r.forEach((c) => c()), n(), o(), s(!1), i(null), a(!1);
|
|
260
260
|
}
|
|
261
|
-
function
|
|
261
|
+
function Ce(e, t, r, n, o) {
|
|
262
262
|
e.onAttributeChanged && e.onAttributeChanged(t, r, n, o);
|
|
263
263
|
}
|
|
264
264
|
function z(e, t) {
|
|
@@ -280,100 +280,100 @@ function se(e, t, r) {
|
|
|
280
280
|
}
|
|
281
281
|
function Ae(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 R(
|
|
286
|
-
},
|
|
283
|
+
const a = t.includes("lazy"), c = t.includes("trim"), f = t.includes("number"), d = () => {
|
|
284
|
+
const p = s._state || s;
|
|
285
|
+
return R(p, e);
|
|
286
|
+
}, y = d();
|
|
287
287
|
let u = "text";
|
|
288
|
-
const
|
|
289
|
-
if (i instanceof HTMLInputElement ? u =
|
|
290
|
-
if (Array.isArray(
|
|
291
|
-
const
|
|
288
|
+
const b = n?.type;
|
|
289
|
+
if (i instanceof HTMLInputElement ? u = b || i.type || "text" : i instanceof HTMLSelectElement ? u = "select" : i instanceof HTMLTextAreaElement && (u = "textarea"), u === "checkbox")
|
|
290
|
+
if (Array.isArray(y)) {
|
|
291
|
+
const p = i?.getAttribute("value") || n?.value || "", l = y.includes(p);
|
|
292
292
|
i && i.checked !== l && (r.checked = l);
|
|
293
293
|
} else {
|
|
294
|
-
const
|
|
294
|
+
const p = i?.getAttribute("true-value") || !0, l = y === p;
|
|
295
295
|
i && i.checked !== l && (r.checked = l);
|
|
296
296
|
}
|
|
297
297
|
else if (u === "radio") {
|
|
298
|
-
const
|
|
298
|
+
const p = n?.value || "", l = y === p;
|
|
299
299
|
i && i.checked !== l && (r.checked = l);
|
|
300
300
|
} else if (u === "select")
|
|
301
301
|
if (i && i.hasAttribute("multiple")) {
|
|
302
|
-
const
|
|
302
|
+
const p = i, l = Array.isArray(y) ? y : [];
|
|
303
303
|
setTimeout(() => {
|
|
304
|
-
Array.from(
|
|
305
|
-
const
|
|
306
|
-
|
|
304
|
+
Array.from(p.options).forEach((h) => {
|
|
305
|
+
const g = l.includes(h.value);
|
|
306
|
+
h.selected !== g && (h.selected = g);
|
|
307
307
|
});
|
|
308
308
|
}, 0);
|
|
309
309
|
} else
|
|
310
310
|
setTimeout(() => {
|
|
311
|
-
i instanceof HTMLSelectElement && i.value !== String(
|
|
311
|
+
i instanceof HTMLSelectElement && i.value !== String(y) && (i.value = String(y));
|
|
312
312
|
}, 0);
|
|
313
313
|
else {
|
|
314
|
-
const
|
|
315
|
-
(!i || i.value !==
|
|
314
|
+
const p = String(y ?? "");
|
|
315
|
+
(!i || i.value !== p) && (r.value = y);
|
|
316
316
|
}
|
|
317
|
-
const
|
|
318
|
-
if (
|
|
319
|
-
const l =
|
|
317
|
+
const m = a || u === "checkbox" || u === "radio" || u === "select" ? "change" : "input", v = (p) => {
|
|
318
|
+
if (p.isComposing || o._isComposing || p.isTrusted === !1) return;
|
|
319
|
+
const l = p.target;
|
|
320
320
|
if (l._modelUpdating) return;
|
|
321
|
-
const
|
|
322
|
-
let
|
|
321
|
+
const h = d();
|
|
322
|
+
let g = l.value;
|
|
323
323
|
if (u === "checkbox")
|
|
324
|
-
if (Array.isArray(
|
|
325
|
-
const
|
|
324
|
+
if (Array.isArray(h)) {
|
|
325
|
+
const _ = l.getAttribute("value") || "", C = [...h];
|
|
326
326
|
if (l.checked)
|
|
327
|
-
|
|
327
|
+
C.includes(_) || C.push(_);
|
|
328
328
|
else {
|
|
329
|
-
const w =
|
|
330
|
-
w > -1 &&
|
|
329
|
+
const w = C.indexOf(_);
|
|
330
|
+
w > -1 && C.splice(w, 1);
|
|
331
331
|
}
|
|
332
|
-
|
|
332
|
+
g = C;
|
|
333
333
|
} else {
|
|
334
|
-
const
|
|
335
|
-
|
|
334
|
+
const _ = l.getAttribute("true-value") || !0, C = l.getAttribute("false-value") || !1;
|
|
335
|
+
g = l.checked ? _ : C;
|
|
336
336
|
}
|
|
337
337
|
else if (u === "radio")
|
|
338
|
-
|
|
338
|
+
g = l.getAttribute("value") || l.value;
|
|
339
339
|
else if (u === "select" && l.multiple) {
|
|
340
|
-
const
|
|
341
|
-
|
|
342
|
-
(
|
|
340
|
+
const _ = l;
|
|
341
|
+
g = Array.from(_.selectedOptions).map(
|
|
342
|
+
(C) => C.value
|
|
343
343
|
);
|
|
344
|
-
} else if (c && (
|
|
345
|
-
const
|
|
346
|
-
isNaN(
|
|
344
|
+
} else if (c && (g = g.trim()), f) {
|
|
345
|
+
const _ = Number(g);
|
|
346
|
+
isNaN(_) || (g = _);
|
|
347
347
|
}
|
|
348
348
|
const x = s._state || s, k = R(x, e);
|
|
349
|
-
if (Array.isArray(
|
|
350
|
-
const
|
|
351
|
-
|
|
352
|
-
|
|
349
|
+
if (Array.isArray(g) && Array.isArray(k) ? JSON.stringify([...g].sort()) !== JSON.stringify([...k].sort()) : g !== k) {
|
|
350
|
+
const _ = p.target;
|
|
351
|
+
_._modelUpdating = !0, se(x, e, g), setTimeout(() => {
|
|
352
|
+
_._modelUpdating = !1;
|
|
353
353
|
}, 0), s._requestRender && s._requestRender();
|
|
354
354
|
}
|
|
355
355
|
};
|
|
356
|
-
if (o[
|
|
357
|
-
const
|
|
356
|
+
if (o[m] = v, u === "text" || u === "textarea") {
|
|
357
|
+
const p = () => {
|
|
358
358
|
o._isComposing = !0;
|
|
359
|
-
}, l = (
|
|
359
|
+
}, l = (h) => {
|
|
360
360
|
o._isComposing = !1;
|
|
361
|
-
const
|
|
361
|
+
const g = h.target;
|
|
362
362
|
setTimeout(() => {
|
|
363
|
-
if (
|
|
364
|
-
let x =
|
|
363
|
+
if (g) {
|
|
364
|
+
let x = g.value;
|
|
365
365
|
if (c && (x = x.trim()), f) {
|
|
366
|
-
const
|
|
367
|
-
isNaN(
|
|
366
|
+
const C = Number(x);
|
|
367
|
+
isNaN(C) || (x = C);
|
|
368
368
|
}
|
|
369
369
|
const k = s._state || s, $ = R(k, e);
|
|
370
|
-
(Array.isArray(x) && Array.isArray($) ? JSON.stringify([...x].sort()) !== JSON.stringify([...$].sort()) : x !== $) && (
|
|
371
|
-
|
|
370
|
+
(Array.isArray(x) && Array.isArray($) ? JSON.stringify([...x].sort()) !== JSON.stringify([...$].sort()) : x !== $) && (g && (g._modelUpdating = !0, setTimeout(() => {
|
|
371
|
+
g._modelUpdating = !1;
|
|
372
372
|
}, 0)), se(k, e, x), s._requestRender && s._requestRender());
|
|
373
373
|
}
|
|
374
374
|
}, 0);
|
|
375
375
|
};
|
|
376
|
-
o.compositionstart =
|
|
376
|
+
o.compositionstart = p, o.compositionend = l;
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
379
|
function Ee(e, t, r, n) {
|
|
@@ -424,7 +424,7 @@ function Le(e, t, r) {
|
|
|
424
424
|
const f = a.replace(
|
|
425
425
|
/[A-Z]/g,
|
|
426
426
|
(u) => `-${u.toLowerCase()}`
|
|
427
|
-
),
|
|
427
|
+
), d = [
|
|
428
428
|
"width",
|
|
429
429
|
"height",
|
|
430
430
|
"top",
|
|
@@ -450,8 +450,8 @@ function Le(e, t, r) {
|
|
|
450
450
|
"min-height",
|
|
451
451
|
"max-height"
|
|
452
452
|
];
|
|
453
|
-
let
|
|
454
|
-
typeof c == "number" &&
|
|
453
|
+
let y = String(c);
|
|
454
|
+
typeof c == "number" && d.includes(f) && (y = `${c}px`), i.push(`${f}: ${y}`);
|
|
455
455
|
}
|
|
456
456
|
o = i.join("; ") + (i.length > 0 ? ";" : "");
|
|
457
457
|
}
|
|
@@ -461,12 +461,12 @@ function Le(e, t, r) {
|
|
|
461
461
|
function he(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: d } = c;
|
|
465
465
|
switch (a) {
|
|
466
466
|
case "model":
|
|
467
467
|
Ae(
|
|
468
468
|
typeof f == "string" ? f : String(f),
|
|
469
|
-
|
|
469
|
+
d,
|
|
470
470
|
o,
|
|
471
471
|
s,
|
|
472
472
|
i,
|
|
@@ -497,15 +497,15 @@ function re(e, t) {
|
|
|
497
497
|
if (!i || typeof i != "object") return i;
|
|
498
498
|
let a = i.props?.key ?? i.key;
|
|
499
499
|
if (!a) {
|
|
500
|
-
const
|
|
501
|
-
a = u ? `${t}:${
|
|
500
|
+
const y = i.tag || "node", u = i.props?.attrs?.id ?? i.props?.attrs?.name ?? i.props?.attrs?.["data-key"] ?? "";
|
|
501
|
+
a = u ? `${t}:${y}:${u}` : `${t}:${y}`;
|
|
502
502
|
}
|
|
503
503
|
let c = a, f = 1;
|
|
504
504
|
for (; s.has(c); )
|
|
505
505
|
c = `${a}#${f++}`;
|
|
506
506
|
s.add(c);
|
|
507
|
-
let
|
|
508
|
-
return Array.isArray(
|
|
507
|
+
let d = i.children;
|
|
508
|
+
return Array.isArray(d) && (d = re(d, c)), { ...i, key: c, children: d };
|
|
509
509
|
});
|
|
510
510
|
}
|
|
511
511
|
const r = e;
|
|
@@ -528,36 +528,38 @@ function Be(e, t, r, n) {
|
|
|
528
528
|
...s.attrs
|
|
529
529
|
}, c = t.props ?? {}, f = i;
|
|
530
530
|
for (const u in { ...c, ...f }) {
|
|
531
|
-
const
|
|
532
|
-
|
|
531
|
+
const b = c[u], m = f[u];
|
|
532
|
+
b !== m && (u === "value" && (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement) ? e.value !== m && (e.value = m ?? "") : u === "checked" && e instanceof HTMLInputElement ? e.checked = !!m : u.startsWith("on") && typeof m == "function" ? (typeof b == "function" && e.removeEventListener(u.slice(2).toLowerCase(), b), e.addEventListener(u.slice(2).toLowerCase(), m)) : m == null || m === !1 ? e.removeAttribute(u) : e.setAttribute(u, String(m)));
|
|
533
533
|
}
|
|
534
|
-
for (const [u,
|
|
534
|
+
for (const [u, b] of Object.entries(
|
|
535
535
|
s.listeners || {}
|
|
536
536
|
))
|
|
537
|
-
e.addEventListener(u,
|
|
538
|
-
const
|
|
539
|
-
for (const u in { ...
|
|
540
|
-
const
|
|
541
|
-
|
|
537
|
+
e.addEventListener(u, b);
|
|
538
|
+
const d = t.attrs ?? {}, y = a;
|
|
539
|
+
for (const u in { ...d, ...y }) {
|
|
540
|
+
const b = d[u], m = y[u];
|
|
541
|
+
b !== m && (m == null || m === !1 ? e.removeAttribute(u) : e.setAttribute(u, String(m)));
|
|
542
542
|
}
|
|
543
543
|
}
|
|
544
544
|
function T(e, t, r) {
|
|
545
545
|
if (typeof e == "string")
|
|
546
546
|
return document.createTextNode(e);
|
|
547
547
|
if (e.tag === "#text") {
|
|
548
|
-
const
|
|
548
|
+
const y = document.createTextNode(
|
|
549
549
|
typeof e.children == "string" ? e.children : ""
|
|
550
550
|
);
|
|
551
|
-
return e.key != null && (
|
|
551
|
+
return e.key != null && (y.key = e.key), y;
|
|
552
552
|
}
|
|
553
553
|
if (e.tag === "#anchor") {
|
|
554
|
-
const
|
|
555
|
-
|
|
556
|
-
const
|
|
557
|
-
|
|
558
|
-
for (const
|
|
559
|
-
|
|
560
|
-
|
|
554
|
+
const y = e, u = Array.isArray(y.children) ? y.children : [], b = document.createTextNode(""), m = document.createTextNode("");
|
|
555
|
+
y.key != null && (b.key = `${y.key}:start`, m.key = `${y.key}:end`), y._startNode = b, y._endNode = m;
|
|
556
|
+
const v = document.createDocumentFragment();
|
|
557
|
+
v.appendChild(b);
|
|
558
|
+
for (const p of u) {
|
|
559
|
+
const l = T(p, t);
|
|
560
|
+
v.appendChild(l);
|
|
561
|
+
}
|
|
562
|
+
return v.appendChild(m), v;
|
|
561
563
|
}
|
|
562
564
|
const n = document.createElement(e.tag);
|
|
563
565
|
e.key != null && (n.key = e.key);
|
|
@@ -568,32 +570,32 @@ function T(e, t, r) {
|
|
|
568
570
|
...s,
|
|
569
571
|
...a.attrs
|
|
570
572
|
};
|
|
571
|
-
for (const
|
|
572
|
-
const u = f[
|
|
573
|
-
typeof u == "boolean" ? u && n.setAttribute(
|
|
573
|
+
for (const y in f) {
|
|
574
|
+
const u = f[y];
|
|
575
|
+
typeof u == "boolean" ? u && n.setAttribute(y, "") : u != null && n.setAttribute(y, String(u));
|
|
574
576
|
}
|
|
575
|
-
for (const
|
|
576
|
-
const u = c[
|
|
577
|
-
if (
|
|
577
|
+
for (const y in c) {
|
|
578
|
+
const u = c[y];
|
|
579
|
+
if (y === "value" && (n instanceof HTMLInputElement || n instanceof HTMLTextAreaElement || n instanceof HTMLSelectElement))
|
|
578
580
|
n.value = u ?? "";
|
|
579
|
-
else if (
|
|
581
|
+
else if (y === "checked" && n instanceof HTMLInputElement)
|
|
580
582
|
n.checked = !!u;
|
|
581
|
-
else if (
|
|
582
|
-
n.addEventListener(
|
|
583
|
+
else if (y.startsWith("on") && typeof u == "function")
|
|
584
|
+
n.addEventListener(y.slice(2).toLowerCase(), u);
|
|
583
585
|
else {
|
|
584
|
-
if (
|
|
586
|
+
if (y.startsWith("on") && u === void 0)
|
|
585
587
|
continue;
|
|
586
|
-
u == null || u === !1 ? n.removeAttribute(
|
|
588
|
+
u == null || u === !1 ? n.removeAttribute(y) : n.setAttribute(y, String(u));
|
|
587
589
|
}
|
|
588
590
|
}
|
|
589
|
-
for (const [
|
|
591
|
+
for (const [y, u] of Object.entries(
|
|
590
592
|
a.listeners || {}
|
|
591
593
|
))
|
|
592
|
-
n.addEventListener(
|
|
593
|
-
const
|
|
594
|
-
if (typeof e != "string" &&
|
|
595
|
-
for (const
|
|
596
|
-
n.appendChild(T(
|
|
594
|
+
n.addEventListener(y, u);
|
|
595
|
+
const d = e.props?.ref ?? (e.props?.props && e.props.props.ref);
|
|
596
|
+
if (typeof e != "string" && d && r && (r[d] = n), Array.isArray(e.children))
|
|
597
|
+
for (const y of e.children)
|
|
598
|
+
n.appendChild(T(y, t, r));
|
|
597
599
|
else typeof e.children == "string" && (n.textContent = e.children);
|
|
598
600
|
return n;
|
|
599
601
|
}
|
|
@@ -604,103 +606,103 @@ function ze(e, t, r, n, o) {
|
|
|
604
606
|
}
|
|
605
607
|
if (!Array.isArray(r)) return;
|
|
606
608
|
const s = Array.from(e.childNodes), i = Array.isArray(t) ? t : [], a = /* @__PURE__ */ new Map();
|
|
607
|
-
for (const
|
|
608
|
-
|
|
609
|
+
for (const b of i)
|
|
610
|
+
b && b.key != null && a.set(b.key, b);
|
|
609
611
|
const c = /* @__PURE__ */ new Map();
|
|
610
|
-
for (const
|
|
611
|
-
const
|
|
612
|
-
|
|
612
|
+
for (const b of s) {
|
|
613
|
+
const m = b.key;
|
|
614
|
+
m != null && c.set(m, b);
|
|
613
615
|
}
|
|
614
616
|
const f = /* @__PURE__ */ new Set();
|
|
615
|
-
let
|
|
616
|
-
function
|
|
617
|
-
let
|
|
618
|
-
for (;
|
|
619
|
-
|
|
617
|
+
let d = e.firstChild;
|
|
618
|
+
function y(b, m) {
|
|
619
|
+
let v = b;
|
|
620
|
+
for (; v && (f.add(v), v !== m); )
|
|
621
|
+
v = v.nextSibling;
|
|
620
622
|
}
|
|
621
|
-
function u(
|
|
623
|
+
function u(b, m, v, p) {
|
|
622
624
|
const l = [];
|
|
623
|
-
let
|
|
624
|
-
for (;
|
|
625
|
-
l.push(
|
|
626
|
-
const
|
|
627
|
-
if (
|
|
625
|
+
let h = b.nextSibling;
|
|
626
|
+
for (; h && h !== m; )
|
|
627
|
+
l.push(h), h = h.nextSibling;
|
|
628
|
+
const g = Array.isArray(v) ? v : [];
|
|
629
|
+
if (p.some((k) => k && k.key != null) || g.some((k) => k && k.key != null)) {
|
|
628
630
|
const k = /* @__PURE__ */ new Map(), $ = /* @__PURE__ */ new Map();
|
|
629
|
-
for (const w of
|
|
631
|
+
for (const w of g)
|
|
630
632
|
w && w.key != null && k.set(w.key, w);
|
|
631
633
|
for (const w of l) {
|
|
632
|
-
const
|
|
633
|
-
|
|
634
|
+
const S = w.key;
|
|
635
|
+
S != null && $.set(S, w);
|
|
634
636
|
}
|
|
635
|
-
const
|
|
636
|
-
let
|
|
637
|
-
for (const w of
|
|
638
|
-
let
|
|
637
|
+
const _ = /* @__PURE__ */ new Set();
|
|
638
|
+
let C = b.nextSibling;
|
|
639
|
+
for (const w of p) {
|
|
640
|
+
let S;
|
|
639
641
|
if (w.key != null && $.has(w.key)) {
|
|
640
642
|
const A = k.get(w.key);
|
|
641
|
-
|
|
643
|
+
S = K(
|
|
642
644
|
$.get(w.key),
|
|
643
645
|
A,
|
|
644
646
|
w,
|
|
645
647
|
n
|
|
646
|
-
),
|
|
648
|
+
), _.add(S), S !== C && e.contains(S) && e.insertBefore(S, C);
|
|
647
649
|
} else
|
|
648
|
-
|
|
649
|
-
|
|
650
|
+
S = T(w, n), e.insertBefore(S, C), _.add(S);
|
|
651
|
+
C = S.nextSibling;
|
|
650
652
|
}
|
|
651
653
|
for (const w of l)
|
|
652
|
-
!
|
|
654
|
+
!_.has(w) && e.contains(w) && e.removeChild(w);
|
|
653
655
|
} else {
|
|
654
656
|
const k = Math.min(
|
|
655
|
-
|
|
656
|
-
|
|
657
|
+
g.length,
|
|
658
|
+
p.length
|
|
657
659
|
);
|
|
658
660
|
for (let $ = 0; $ < k; $++) {
|
|
659
|
-
const
|
|
661
|
+
const _ = g[$], C = p[$], w = K(l[$], _, C, n);
|
|
660
662
|
w !== l[$] && (e.insertBefore(w, l[$]), e.removeChild(l[$]));
|
|
661
663
|
}
|
|
662
|
-
for (let $ = k; $ <
|
|
663
|
-
e.insertBefore(T(
|
|
664
|
+
for (let $ = k; $ < p.length; $++)
|
|
665
|
+
e.insertBefore(T(p[$], n), m);
|
|
664
666
|
for (let $ = k; $ < l.length; $++)
|
|
665
667
|
e.removeChild(l[$]);
|
|
666
668
|
}
|
|
667
669
|
}
|
|
668
|
-
for (const
|
|
669
|
-
let
|
|
670
|
-
if (
|
|
671
|
-
const
|
|
672
|
-
let
|
|
673
|
-
const x = Array.isArray(
|
|
674
|
-
if (
|
|
675
|
-
e.insertBefore(
|
|
670
|
+
for (const b of r) {
|
|
671
|
+
let m;
|
|
672
|
+
if (b.tag === "#anchor") {
|
|
673
|
+
const v = b.key, p = `${v}:start`, l = `${v}:end`;
|
|
674
|
+
let h = c.get(p), g = c.get(l);
|
|
675
|
+
const x = Array.isArray(b.children) ? b.children : [];
|
|
676
|
+
if (h || (h = document.createTextNode(""), h.key = p), g || (g = document.createTextNode(""), g.key = l), b._startNode = h, b._endNode = g, !e.contains(h) || !e.contains(g)) {
|
|
677
|
+
e.insertBefore(h, d);
|
|
676
678
|
for (const k of x)
|
|
677
|
-
e.insertBefore(T(k, n),
|
|
678
|
-
e.insertBefore(
|
|
679
|
+
e.insertBefore(T(k, n), d);
|
|
680
|
+
e.insertBefore(g, d);
|
|
679
681
|
} else
|
|
680
682
|
u(
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
a.get(
|
|
683
|
+
h,
|
|
684
|
+
g,
|
|
685
|
+
a.get(v)?.children,
|
|
684
686
|
x
|
|
685
687
|
);
|
|
686
|
-
|
|
688
|
+
y(h, g), d = g.nextSibling;
|
|
687
689
|
continue;
|
|
688
690
|
}
|
|
689
|
-
if (
|
|
690
|
-
const
|
|
691
|
-
|
|
692
|
-
c.get(
|
|
693
|
-
b,
|
|
691
|
+
if (b.key != null && c.has(b.key)) {
|
|
692
|
+
const v = a.get(b.key);
|
|
693
|
+
m = K(
|
|
694
|
+
c.get(b.key),
|
|
694
695
|
v,
|
|
696
|
+
b,
|
|
695
697
|
n,
|
|
696
698
|
o
|
|
697
|
-
), f.add(
|
|
699
|
+
), f.add(m), m !== d && e.contains(m) && (d && !e.contains(d) && (d = null), e.insertBefore(m, d));
|
|
698
700
|
} else
|
|
699
|
-
|
|
700
|
-
|
|
701
|
+
m = T(b, n, o), d && !e.contains(d) && (d = null), e.insertBefore(m, d), f.add(m);
|
|
702
|
+
d = m.nextSibling;
|
|
701
703
|
}
|
|
702
|
-
for (const
|
|
703
|
-
!f.has(
|
|
704
|
+
for (const b of s)
|
|
705
|
+
!f.has(b) && e.contains(b) && (z(b, o), e.removeChild(b));
|
|
704
706
|
}
|
|
705
707
|
function K(e, t, r, n, o) {
|
|
706
708
|
if (t && typeof t != "string" && t.props?.ref && o && z(e, o), t === r) return e;
|
|
@@ -715,11 +717,13 @@ function K(e, t, r, n, o) {
|
|
|
715
717
|
if (r && typeof r != "string" && r.tag === "#anchor") {
|
|
716
718
|
const i = r, a = Array.isArray(i.children) ? i.children : [], c = i._startNode ?? document.createTextNode(""), f = i._endNode ?? document.createTextNode("");
|
|
717
719
|
i.key != null && (c.key = `${i.key}:start`, f.key = `${i.key}:end`), i._startNode = c, i._endNode = f;
|
|
718
|
-
const
|
|
719
|
-
|
|
720
|
-
for (const
|
|
721
|
-
|
|
722
|
-
|
|
720
|
+
const d = document.createDocumentFragment();
|
|
721
|
+
d.appendChild(c);
|
|
722
|
+
for (const y of a) {
|
|
723
|
+
const u = T(y, n);
|
|
724
|
+
d.appendChild(u);
|
|
725
|
+
}
|
|
726
|
+
return d.appendChild(f), e.parentNode?.replaceChild(d, e), c;
|
|
723
727
|
}
|
|
724
728
|
if (!r) {
|
|
725
729
|
z(e, o);
|
|
@@ -736,8 +740,8 @@ function K(e, t, r, n, o) {
|
|
|
736
740
|
r.key != null && (a.key = `${r.key}:start`, c.key = `${r.key}:end`), r._startNode = a, r._endNode = c;
|
|
737
741
|
const f = document.createDocumentFragment();
|
|
738
742
|
f.appendChild(a);
|
|
739
|
-
for (const
|
|
740
|
-
f.appendChild(T(
|
|
743
|
+
for (const d of i)
|
|
744
|
+
f.appendChild(T(d, n));
|
|
741
745
|
return f.appendChild(c), e.parentNode?.replaceChild(f, e), a;
|
|
742
746
|
}
|
|
743
747
|
if (typeof t != "string" && typeof r != "string" && t.tag === r.tag && t.key === r.key) {
|
|
@@ -750,14 +754,19 @@ function K(e, t, r, n, o) {
|
|
|
750
754
|
}
|
|
751
755
|
function Re(e, t, r, n) {
|
|
752
756
|
let o;
|
|
753
|
-
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
|
|
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
|
+
tag: "div",
|
|
759
|
+
key: "__anchor_root__",
|
|
760
|
+
props: { attrs: { "data-anchor-block-root": "", key: "__anchor_root__" } },
|
|
761
|
+
children: [o]
|
|
762
|
+
}), o = re(o, String(o.key ?? "root"));
|
|
754
763
|
const s = e._prevVNode ?? null, i = e._prevDom ?? e.firstChild ?? null;
|
|
755
764
|
let a;
|
|
756
765
|
s && i ? typeof s != "string" && typeof o != "string" && s.tag === o.tag && s.key === o.key ? a = K(i, s, o, r, n) : (a = T(o, r, n), e.replaceChild(a, i)) : (a = T(o, r, n), e.firstChild ? e.replaceChild(a, e.firstChild) : e.appendChild(a));
|
|
757
766
|
const c = [];
|
|
758
767
|
for (let f = 0; f < e.childNodes.length; f++) {
|
|
759
|
-
const
|
|
760
|
-
|
|
768
|
+
const d = e.childNodes[f];
|
|
769
|
+
d !== a && d.nodeName !== "STYLE" && (z(d, n), c.push(d));
|
|
761
770
|
}
|
|
762
771
|
c.forEach((f) => e.removeChild(f)), e._prevVNode = o, e._prevDom = a;
|
|
763
772
|
}
|
|
@@ -835,7 +844,7 @@ const Me = ge`
|
|
|
835
844
|
sup { top: -.5em }
|
|
836
845
|
[disabled], [aria-disabled=true] { cursor: not-allowed }
|
|
837
846
|
[hidden] { display: none }
|
|
838
|
-
`,
|
|
847
|
+
`, Oe = {
|
|
839
848
|
gray: {
|
|
840
849
|
50: "var(--color-gray-50, #f9fafb)",
|
|
841
850
|
100: "var(--color-gray-100, #f3f4f6)",
|
|
@@ -1144,7 +1153,7 @@ const Me = ge`
|
|
|
1144
1153
|
"transition-colors": "transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;",
|
|
1145
1154
|
"transition-opacity": "transition-property:opacity;",
|
|
1146
1155
|
"transition-transform": "transition-property:transform;"
|
|
1147
|
-
},
|
|
1156
|
+
}, Pe = "0.25rem", le = {
|
|
1148
1157
|
m: ["margin"],
|
|
1149
1158
|
mx: ["margin-inline"],
|
|
1150
1159
|
my: ["margin-block"],
|
|
@@ -1217,24 +1226,28 @@ function X(e) {
|
|
|
1217
1226
|
const o = n.slice(0, -1).join("-"), s = n[n.length - 1], i = parseFloat(s);
|
|
1218
1227
|
if (Number.isNaN(i) || !le[o]) return null;
|
|
1219
1228
|
const a = t ? "-" : "";
|
|
1220
|
-
return le[o].map((c) => `${c}:calc(${a}${
|
|
1229
|
+
return le[o].map((c) => `${c}:calc(${a}${Pe} * ${i});`).join("");
|
|
1221
1230
|
}
|
|
1222
1231
|
function fe(e) {
|
|
1223
1232
|
const t = e.replace("#", ""), r = parseInt(t, 16), n = r >> 16 & 255, o = r >> 8 & 255, s = r & 255;
|
|
1224
1233
|
return `${n} ${o} ${s}`;
|
|
1225
1234
|
}
|
|
1226
1235
|
function De(e) {
|
|
1227
|
-
const t = /^(bg|text|border|shadow|outline|caret|accent)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);
|
|
1236
|
+
const t = /^(bg|text|border|decoration|shadow|outline|caret|accent|fill|stroke)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);
|
|
1228
1237
|
if (!t) return null;
|
|
1229
|
-
const [, r, n, o = "DEFAULT"] = t, s =
|
|
1238
|
+
const [, r, n, o = "DEFAULT"] = t, s = Oe[n]?.[o];
|
|
1230
1239
|
return s ? `${{
|
|
1231
1240
|
bg: "background-color",
|
|
1241
|
+
decoration: "text-decoration-color",
|
|
1232
1242
|
text: "color",
|
|
1233
1243
|
border: "border-color",
|
|
1234
1244
|
shadow: "box-shadow",
|
|
1235
1245
|
outline: "outline-color",
|
|
1236
1246
|
caret: "caret-color",
|
|
1237
|
-
accent: "accent-color"
|
|
1247
|
+
accent: "accent-color",
|
|
1248
|
+
placeholder: "placeholder-color",
|
|
1249
|
+
fill: "fill-color",
|
|
1250
|
+
stroke: "stroke-color"
|
|
1238
1251
|
}[r]}:${s};` : null;
|
|
1239
1252
|
}
|
|
1240
1253
|
function He(e) {
|
|
@@ -1255,7 +1268,7 @@ function Y(e) {
|
|
|
1255
1268
|
}
|
|
1256
1269
|
return n;
|
|
1257
1270
|
}
|
|
1258
|
-
const o =
|
|
1271
|
+
const o = V(t);
|
|
1259
1272
|
if (o && r !== void 0) {
|
|
1260
1273
|
const s = /#([0-9a-f]{6})/i.exec(o);
|
|
1261
1274
|
if (s) {
|
|
@@ -1265,7 +1278,7 @@ function Y(e) {
|
|
|
1265
1278
|
}
|
|
1266
1279
|
return o;
|
|
1267
1280
|
}
|
|
1268
|
-
function
|
|
1281
|
+
function V(e) {
|
|
1269
1282
|
const t = e.indexOf("-["), r = e.endsWith("]");
|
|
1270
1283
|
if (t > 0 && r) {
|
|
1271
1284
|
const n = e.slice(0, t);
|
|
@@ -1316,70 +1329,76 @@ function U(e) {
|
|
|
1316
1329
|
return null;
|
|
1317
1330
|
}
|
|
1318
1331
|
function qe(e) {
|
|
1319
|
-
return e.
|
|
1332
|
+
return e.startsWith("[") && e.endsWith("]") ? e : e.indexOf("-[") > 0 && e.endsWith("]") ? e.replace(/_/g, "-") : null;
|
|
1320
1333
|
}
|
|
1321
1334
|
function Ie(e) {
|
|
1335
|
+
return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, "\\$1");
|
|
1336
|
+
}
|
|
1337
|
+
function Fe(e) {
|
|
1322
1338
|
const t = /class\s*=\s*["']([^"']+)["']/g, r = [];
|
|
1323
1339
|
let n;
|
|
1324
1340
|
for (; n = t.exec(e); ) {
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
i === "[" && (s = !0), i === "]" && (s = !1), i === " " && !s ? (o && r.push(o), o = "") : o += i;
|
|
1328
|
-
o && r.push(o);
|
|
1341
|
+
const o = n[1].match(/(?:\[[^\]]+\]:[^\s]+|[^\s]+)/g);
|
|
1342
|
+
o && r.push(...o);
|
|
1329
1343
|
}
|
|
1330
1344
|
return r.filter(Boolean);
|
|
1331
1345
|
}
|
|
1332
|
-
const ue = /* @__PURE__ */ new Map(),
|
|
1333
|
-
function
|
|
1346
|
+
const ue = /* @__PURE__ */ new Map(), Ke = 16;
|
|
1347
|
+
function Ve(e) {
|
|
1334
1348
|
const t = Date.now(), r = ue.get(e);
|
|
1335
|
-
if (r && t - r.timestamp <
|
|
1336
|
-
const n =
|
|
1337
|
-
function
|
|
1338
|
-
const
|
|
1339
|
-
if (
|
|
1340
|
-
const l = u(
|
|
1341
|
-
return f[
|
|
1342
|
-
}
|
|
1343
|
-
function
|
|
1344
|
-
const
|
|
1345
|
-
return
|
|
1346
|
-
}
|
|
1347
|
-
function u(
|
|
1348
|
-
const
|
|
1349
|
-
(
|
|
1349
|
+
if (r && t - r.timestamp < Ke) return r.css;
|
|
1350
|
+
const n = Fe(e), o = new Set(n), s = [], i = [], a = [], c = [], f = {};
|
|
1351
|
+
function d(m, v = !1) {
|
|
1352
|
+
const p = (v ? "dark|" : "") + m;
|
|
1353
|
+
if (p in f) return f[p];
|
|
1354
|
+
const l = u(m, v);
|
|
1355
|
+
return f[p] = l, l;
|
|
1356
|
+
}
|
|
1357
|
+
function y(m) {
|
|
1358
|
+
const v = m.some((l) => Z.includes(l)), p = m.includes("dark");
|
|
1359
|
+
return m.length === 0 ? 1 : !v && !p ? 2 : v && !p ? 3 : 4;
|
|
1360
|
+
}
|
|
1361
|
+
function u(m, v = !1) {
|
|
1362
|
+
const p = m.split(":"), l = p.find(
|
|
1363
|
+
(S) => Q[S] || X(S) || Y(S) || V(S)
|
|
1350
1364
|
);
|
|
1351
1365
|
if (!l) return null;
|
|
1352
|
-
const
|
|
1353
|
-
if (!
|
|
1354
|
-
let
|
|
1355
|
-
const k =
|
|
1356
|
-
let $ = k >= 0 ?
|
|
1357
|
-
|
|
1358
|
-
const
|
|
1359
|
-
for (const
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1366
|
+
const h = Q[l] ?? X(l) ?? Y(l) ?? V(l);
|
|
1367
|
+
if (!h) return null;
|
|
1368
|
+
let g = `.${Ie(m)}`, x = h;
|
|
1369
|
+
const k = p.indexOf(l);
|
|
1370
|
+
let $ = k >= 0 ? p.slice(0, k) : [];
|
|
1371
|
+
v && ($ = $.filter((S) => S !== "dark"));
|
|
1372
|
+
const _ = $.filter((S) => Z.includes(S)), C = _.length ? _[_.length - 1] : null;
|
|
1373
|
+
for (const S of $) {
|
|
1374
|
+
const A = qe(S);
|
|
1375
|
+
if (A) {
|
|
1376
|
+
g = `${A}${g}`;
|
|
1377
|
+
continue;
|
|
1378
|
+
}
|
|
1379
|
+
if (Z.includes(S)) continue;
|
|
1380
|
+
const E = We[S];
|
|
1381
|
+
typeof E == "function" && (g = E(g, x).replace(/\{.*$/, ""));
|
|
1363
1382
|
}
|
|
1364
|
-
let w = `${
|
|
1365
|
-
return
|
|
1383
|
+
let w = `${g}{${x}}`;
|
|
1384
|
+
return v && C ? w = `@media (prefers-color-scheme: dark) and ${ce[C]}{${w}}` : v ? w = `@media (prefers-color-scheme: dark){${w}}` : C && (w = `@media ${ce[C]}{${w}}`), w;
|
|
1366
1385
|
}
|
|
1367
|
-
for (const
|
|
1368
|
-
const
|
|
1369
|
-
(x) => Q[x] || X(x) || Y(x) ||
|
|
1386
|
+
for (const m of o) {
|
|
1387
|
+
const v = m.split(":"), p = v.find(
|
|
1388
|
+
(x) => Q[x] || X(x) || Y(x) || V(x)
|
|
1370
1389
|
);
|
|
1371
|
-
if (!
|
|
1372
|
-
const l =
|
|
1373
|
-
if (
|
|
1374
|
-
const x =
|
|
1390
|
+
if (!p) continue;
|
|
1391
|
+
const l = v.indexOf(p), h = l >= 0 ? v.slice(0, l) : [], g = y(h);
|
|
1392
|
+
if (g === 4) {
|
|
1393
|
+
const x = d(m, !0);
|
|
1375
1394
|
x && c.push(x);
|
|
1376
1395
|
} else {
|
|
1377
|
-
const x =
|
|
1378
|
-
x && (
|
|
1396
|
+
const x = d(m);
|
|
1397
|
+
x && (g === 1 ? s.push(x) : g === 2 ? i.push(x) : g === 3 && a.push(x));
|
|
1379
1398
|
}
|
|
1380
1399
|
}
|
|
1381
|
-
const
|
|
1382
|
-
return ue.set(e, { css:
|
|
1400
|
+
const b = [...s, ...i, ...a, ...c].join("");
|
|
1401
|
+
return ue.set(e, { css: b, timestamp: t }), b;
|
|
1383
1402
|
}
|
|
1384
1403
|
function Ue(e, t, r, n, o, s, i, a) {
|
|
1385
1404
|
if (!e) return;
|
|
@@ -1410,7 +1429,7 @@ function N(e, t, r, n, o) {
|
|
|
1410
1429
|
n
|
|
1411
1430
|
), o(e.innerHTML));
|
|
1412
1431
|
}
|
|
1413
|
-
function
|
|
1432
|
+
function Je(e, t, r, n, o, s, i) {
|
|
1414
1433
|
if (s !== null && clearTimeout(s), Date.now() - t < 16) {
|
|
1415
1434
|
if (o(r + 1), r > 10) {
|
|
1416
1435
|
console.warn("Potential infinite render loop detected. Skipping render."), i(null);
|
|
@@ -1423,9 +1442,9 @@ function Ve(e, t, r, n, o, s, i) {
|
|
|
1423
1442
|
}, 0);
|
|
1424
1443
|
i(c);
|
|
1425
1444
|
}
|
|
1426
|
-
function
|
|
1445
|
+
function Qe(e, t, r, n, o, s) {
|
|
1427
1446
|
if (!e) return;
|
|
1428
|
-
const i =
|
|
1447
|
+
const i = Ve(n);
|
|
1429
1448
|
if (!t.style && (!i || i.trim() === "")) {
|
|
1430
1449
|
s(null), e.adoptedStyleSheets = [ae()];
|
|
1431
1450
|
return;
|
|
@@ -1439,16 +1458,16 @@ ${i}
|
|
|
1439
1458
|
let f = o;
|
|
1440
1459
|
f || (f = new CSSStyleSheet()), (f.cssRules.length === 0 || f.toString() !== c) && f.replaceSync(c), e.adoptedStyleSheets = [ae(), f], s(f);
|
|
1441
1460
|
}
|
|
1442
|
-
const
|
|
1461
|
+
const Ze = /* @__PURE__ */ new Map();
|
|
1443
1462
|
function de(e, t, r) {
|
|
1444
1463
|
let n = ne(e);
|
|
1445
1464
|
n.includes("-") || (n = `cer-${n}`);
|
|
1446
1465
|
let o;
|
|
1447
1466
|
typeof t == "function" ? o = { ...r, render: t } : o = t, typeof o.onError != "function" && (o.onError = (s, i) => {
|
|
1448
1467
|
console.error(`[${n}] Error:`, s, i);
|
|
1449
|
-
}),
|
|
1468
|
+
}), Ze.set(n, o), typeof window < "u" && !customElements.get(n) && customElements.define(n, Xe(o));
|
|
1450
1469
|
}
|
|
1451
|
-
function
|
|
1470
|
+
function Xe(e) {
|
|
1452
1471
|
if (!e.render)
|
|
1453
1472
|
throw new Error(
|
|
1454
1473
|
"Component must have a render function"
|
|
@@ -1535,7 +1554,7 @@ function Ze(e) {
|
|
|
1535
1554
|
}
|
|
1536
1555
|
connectedCallback() {
|
|
1537
1556
|
this._runLogicWithinErrorBoundary(e, () => {
|
|
1538
|
-
|
|
1557
|
+
_e(
|
|
1539
1558
|
e,
|
|
1540
1559
|
this.context,
|
|
1541
1560
|
this._mounted,
|
|
@@ -1571,7 +1590,7 @@ function Ze(e) {
|
|
|
1571
1590
|
}
|
|
1572
1591
|
attributeChangedCallback(t, r, n) {
|
|
1573
1592
|
this._runLogicWithinErrorBoundary(e, () => {
|
|
1574
|
-
this._applyProps(e),
|
|
1593
|
+
this._applyProps(e), Ce(
|
|
1575
1594
|
e,
|
|
1576
1595
|
t,
|
|
1577
1596
|
r,
|
|
@@ -1622,7 +1641,7 @@ function Ze(e) {
|
|
|
1622
1641
|
}
|
|
1623
1642
|
_requestRender() {
|
|
1624
1643
|
this._runLogicWithinErrorBoundary(this._cfg, () => {
|
|
1625
|
-
|
|
1644
|
+
Je(
|
|
1626
1645
|
() => this._render(this._cfg),
|
|
1627
1646
|
this._lastRenderTime,
|
|
1628
1647
|
this._renderCount,
|
|
@@ -1642,7 +1661,7 @@ function Ze(e) {
|
|
|
1642
1661
|
// --- Style ---
|
|
1643
1662
|
_applyStyle(t, r) {
|
|
1644
1663
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1645
|
-
|
|
1664
|
+
Qe(
|
|
1646
1665
|
this.shadowRoot,
|
|
1647
1666
|
t,
|
|
1648
1667
|
this.context,
|
|
@@ -1681,11 +1700,11 @@ function Ze(e) {
|
|
|
1681
1700
|
"splice",
|
|
1682
1701
|
"sort",
|
|
1683
1702
|
"reverse"
|
|
1684
|
-
].includes(a) ? function(...
|
|
1685
|
-
const u = f.apply(i,
|
|
1703
|
+
].includes(a) ? function(...y) {
|
|
1704
|
+
const u = f.apply(i, y);
|
|
1686
1705
|
if (!n._initializing) {
|
|
1687
|
-
const
|
|
1688
|
-
n._triggerWatchers(
|
|
1706
|
+
const b = s || "root";
|
|
1707
|
+
n._triggerWatchers(b, i), n._render(t);
|
|
1689
1708
|
}
|
|
1690
1709
|
return u;
|
|
1691
1710
|
} : f;
|
|
@@ -1749,125 +1768,125 @@ function Ze(e) {
|
|
|
1749
1768
|
}
|
|
1750
1769
|
};
|
|
1751
1770
|
}
|
|
1752
|
-
function
|
|
1771
|
+
function D(e, t = {}, r, n) {
|
|
1753
1772
|
const o = n ?? t.key;
|
|
1754
1773
|
return { tag: e, key: o, props: t, children: r };
|
|
1755
1774
|
}
|
|
1756
|
-
function
|
|
1775
|
+
function U(e) {
|
|
1757
1776
|
return !!e && typeof e == "object" && (e.type === "AnchorBlock" || e.tag === "#anchor");
|
|
1758
1777
|
}
|
|
1759
|
-
function
|
|
1760
|
-
return typeof e == "object" && e !== null && "tag" in e && !
|
|
1778
|
+
function F(e) {
|
|
1779
|
+
return typeof e == "object" && e !== null && "tag" in e && !U(e);
|
|
1761
1780
|
}
|
|
1762
|
-
function
|
|
1781
|
+
function Ye(e, t) {
|
|
1763
1782
|
return e.key != null ? e : { ...e, key: t };
|
|
1764
1783
|
}
|
|
1765
|
-
function
|
|
1784
|
+
function Ge(e, t = [], r = {}) {
|
|
1766
1785
|
const n = {}, o = {}, s = {}, i = /([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;
|
|
1767
1786
|
let a;
|
|
1768
1787
|
for (; a = i.exec(e); ) {
|
|
1769
|
-
const c = a[1], f = a[2],
|
|
1770
|
-
let u =
|
|
1771
|
-
if (
|
|
1788
|
+
const c = a[1], f = a[2], d = (a[4] || a[6]) ?? "", y = d.match(/^{{(\d+)}}$/);
|
|
1789
|
+
let u = y ? t[Number(y[1])] ?? null : d;
|
|
1790
|
+
if (y || (u === "true" ? u = !0 : u === "false" ? u = !1 : u === "null" ? u = null : isNaN(Number(u)) || (u = Number(u))), c === ":")
|
|
1772
1791
|
typeof u == "boolean" ? o[f] = u : u != null && (n[f] = u);
|
|
1773
1792
|
else if (c === "@") {
|
|
1774
|
-
const
|
|
1775
|
-
n[
|
|
1793
|
+
const b = "on" + f.charAt(0).toUpperCase() + f.slice(1);
|
|
1794
|
+
n[b] = typeof u == "function" ? u : typeof r[u] == "function" ? r[u] : void 0;
|
|
1776
1795
|
} else if (c === "#") {
|
|
1777
|
-
const [
|
|
1778
|
-
let
|
|
1779
|
-
if (
|
|
1780
|
-
const
|
|
1781
|
-
let x =
|
|
1796
|
+
const [b, ...m] = f.split("."), v = [...m];
|
|
1797
|
+
let p = u, l = [...v];
|
|
1798
|
+
if (b === "model" && typeof p == "string" && p.includes(".")) {
|
|
1799
|
+
const h = ["trim", "number", "lazy"], g = p.split(".");
|
|
1800
|
+
let x = p;
|
|
1782
1801
|
const k = [];
|
|
1783
|
-
for (let $ =
|
|
1784
|
-
k.unshift(
|
|
1785
|
-
|
|
1802
|
+
for (let $ = g.length - 1; $ > 0 && h.includes(g[$]); $--)
|
|
1803
|
+
k.unshift(g[$]), x = g.slice(0, $).join(".");
|
|
1804
|
+
p = x, l.push(...k);
|
|
1786
1805
|
}
|
|
1787
|
-
s[
|
|
1788
|
-
value:
|
|
1806
|
+
s[b] = {
|
|
1807
|
+
value: p,
|
|
1789
1808
|
modifiers: l
|
|
1790
1809
|
};
|
|
1791
1810
|
} else f === "ref" ? n.ref = u : o[f] = u;
|
|
1792
1811
|
}
|
|
1793
1812
|
return { props: n, attrs: o, directives: s };
|
|
1794
1813
|
}
|
|
1795
|
-
function
|
|
1796
|
-
function n(l,
|
|
1797
|
-
return
|
|
1814
|
+
function et(e, t, r) {
|
|
1815
|
+
function n(l, h) {
|
|
1816
|
+
return D("#text", {}, l, h);
|
|
1798
1817
|
}
|
|
1799
1818
|
let o = "";
|
|
1800
1819
|
for (let l = 0; l < e.length; l++)
|
|
1801
1820
|
o += e[l], l < t.length && (o += `{{${l}}}`);
|
|
1802
|
-
const s = /<\/?([a-zA-Z0-9-]+)([
|
|
1803
|
-
let a
|
|
1804
|
-
function
|
|
1805
|
-
!l || typeof l != "object" ||
|
|
1806
|
-
if (
|
|
1807
|
-
const
|
|
1821
|
+
const s = /<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g, i = [];
|
|
1822
|
+
let a, c = [], f = null, d = {}, y, u = 0, b = [];
|
|
1823
|
+
function m(l) {
|
|
1824
|
+
!l || typeof l != "object" || U(l) || (l.props || l.attrs ? (l.props && (d.props || (d.props = {}), Object.assign(d.props, l.props)), l.attrs && (d.attrs || (d.attrs = {}), Object.keys(l.attrs).forEach((h) => {
|
|
1825
|
+
if (h === "style" && d.attrs.style) {
|
|
1826
|
+
const g = d.attrs.style.replace(
|
|
1808
1827
|
/;?\s*$/,
|
|
1809
1828
|
""
|
|
1810
1829
|
), x = l.attrs.style.replace(/^;?\s*/, "");
|
|
1811
|
-
d.attrs.style =
|
|
1812
|
-
} else if (
|
|
1813
|
-
const
|
|
1814
|
-
.../* @__PURE__ */ new Set([...
|
|
1830
|
+
d.attrs.style = g + "; " + x;
|
|
1831
|
+
} else if (h === "class" && d.attrs.class) {
|
|
1832
|
+
const g = d.attrs.class.trim().split(/\s+/).filter(Boolean), x = l.attrs.class.trim().split(/\s+/).filter(Boolean), k = [
|
|
1833
|
+
.../* @__PURE__ */ new Set([...g, ...x])
|
|
1815
1834
|
];
|
|
1816
1835
|
d.attrs.class = k.join(" ");
|
|
1817
1836
|
} else
|
|
1818
|
-
d.attrs[
|
|
1837
|
+
d.attrs[h] = l.attrs[h];
|
|
1819
1838
|
}))) : (d.props || (d.props = {}), Object.assign(d.props, l)));
|
|
1820
1839
|
}
|
|
1821
|
-
function
|
|
1822
|
-
const
|
|
1823
|
-
if (
|
|
1824
|
-
const x = l.key ??
|
|
1840
|
+
function v(l, h) {
|
|
1841
|
+
const g = f ? c : b;
|
|
1842
|
+
if (U(l)) {
|
|
1843
|
+
const x = l.key ?? h;
|
|
1825
1844
|
let k = l.children;
|
|
1826
|
-
|
|
1845
|
+
g.push({
|
|
1827
1846
|
...l,
|
|
1828
1847
|
key: x,
|
|
1829
1848
|
children: k
|
|
1830
1849
|
});
|
|
1831
1850
|
return;
|
|
1832
1851
|
}
|
|
1833
|
-
if (
|
|
1834
|
-
|
|
1852
|
+
if (F(l)) {
|
|
1853
|
+
g.push(Ye(l, void 0));
|
|
1835
1854
|
return;
|
|
1836
1855
|
}
|
|
1837
1856
|
if (Array.isArray(l)) {
|
|
1838
1857
|
if (l.length === 0) return;
|
|
1839
1858
|
for (let x = 0; x < l.length; x++) {
|
|
1840
1859
|
const k = l[x];
|
|
1841
|
-
|
|
1860
|
+
U(k) || F(k) || Array.isArray(k) ? v(k, `${h}-${x}`) : k !== null && typeof k == "object" ? m(k) : g.push(n(String(k), `${h}-${x}`));
|
|
1842
1861
|
}
|
|
1843
1862
|
return;
|
|
1844
1863
|
}
|
|
1845
1864
|
if (l !== null && typeof l == "object") {
|
|
1846
|
-
|
|
1865
|
+
m(l);
|
|
1847
1866
|
return;
|
|
1848
1867
|
}
|
|
1849
|
-
|
|
1868
|
+
g.push(n(String(l), h));
|
|
1850
1869
|
}
|
|
1851
|
-
for (;
|
|
1852
|
-
if (
|
|
1853
|
-
const l =
|
|
1870
|
+
for (; a = s.exec(o); )
|
|
1871
|
+
if (a[1]) {
|
|
1872
|
+
const l = a[1], h = a[0][1] === "/", g = a[0][a[0].length - 2] === "/", {
|
|
1854
1873
|
props: x,
|
|
1855
1874
|
attrs: k,
|
|
1856
1875
|
directives: $
|
|
1857
|
-
} =
|
|
1858
|
-
for (const w in x)
|
|
1859
|
-
for (const w in k)
|
|
1860
|
-
for (const [w,
|
|
1876
|
+
} = Ge(a[2] || "", t, r), _ = { props: {}, attrs: {} };
|
|
1877
|
+
for (const w in x) _.props[w] = x[w];
|
|
1878
|
+
for (const w in k) _.attrs[w] = k[w];
|
|
1879
|
+
for (const [w, S] of Object.entries($)) {
|
|
1861
1880
|
if (w === "bind")
|
|
1862
|
-
if (typeof
|
|
1863
|
-
for (const [A, E] of Object.entries(
|
|
1864
|
-
typeof E == "boolean" ?
|
|
1865
|
-
else
|
|
1866
|
-
|
|
1867
|
-
const A = !!
|
|
1868
|
-
|
|
1881
|
+
if (typeof S.value == "object" && S.value !== null)
|
|
1882
|
+
for (const [A, E] of Object.entries(S.value))
|
|
1883
|
+
typeof E == "boolean" ? _.attrs[A] = E : E != null && (_.attrs[A] = String(E));
|
|
1884
|
+
else S.value != null && (_.attrs[w] = String(S.value));
|
|
1885
|
+
if (["show", "class", "style"].includes(w) && (_.directives || (_.directives = {}), _.directives[w] = S), w === "show") {
|
|
1886
|
+
const A = !!S.value;
|
|
1887
|
+
_.attrs.style = (_.attrs.style || "") + (A ? "" : "; display: none !important");
|
|
1869
1888
|
} else if (w === "class") {
|
|
1870
|
-
const A =
|
|
1889
|
+
const A = S.value;
|
|
1871
1890
|
let E = [];
|
|
1872
1891
|
if (typeof A == "string")
|
|
1873
1892
|
E = A.split(/\s+/).filter(Boolean);
|
|
@@ -1881,20 +1900,20 @@ function Ge(e, t, r) {
|
|
|
1881
1900
|
} else if (A && typeof A == "object")
|
|
1882
1901
|
for (const [j, L] of Object.entries(A))
|
|
1883
1902
|
L && E.push(...j.split(/\s+/).filter(Boolean));
|
|
1884
|
-
const
|
|
1903
|
+
const P = _.attrs.class || "", W = [
|
|
1885
1904
|
.../* @__PURE__ */ new Set([
|
|
1886
|
-
...
|
|
1905
|
+
...P.split(/\s+/).filter(Boolean),
|
|
1887
1906
|
...E
|
|
1888
1907
|
])
|
|
1889
1908
|
];
|
|
1890
|
-
|
|
1909
|
+
_.attrs.class = W.join(" ");
|
|
1891
1910
|
} else if (w === "style") {
|
|
1892
|
-
const A =
|
|
1911
|
+
const A = S.value;
|
|
1893
1912
|
let E = "";
|
|
1894
1913
|
if (typeof A == "string")
|
|
1895
1914
|
E = A;
|
|
1896
1915
|
else if (A && typeof A == "object") {
|
|
1897
|
-
const
|
|
1916
|
+
const W = [];
|
|
1898
1917
|
for (const [j, L] of Object.entries(A))
|
|
1899
1918
|
if (L != null && L !== "") {
|
|
1900
1919
|
const q = j.replace(
|
|
@@ -1927,63 +1946,54 @@ function Ge(e, t, r) {
|
|
|
1927
1946
|
"max-height"
|
|
1928
1947
|
];
|
|
1929
1948
|
let oe = String(L);
|
|
1930
|
-
typeof L == "number" && me.includes(q) && (oe = `${L}px`),
|
|
1949
|
+
typeof L == "number" && me.includes(q) && (oe = `${L}px`), W.push(`${q}: ${oe}`);
|
|
1931
1950
|
}
|
|
1932
|
-
E =
|
|
1951
|
+
E = W.join("; ") + (W.length > 0 ? ";" : "");
|
|
1933
1952
|
}
|
|
1934
|
-
const
|
|
1935
|
-
|
|
1953
|
+
const P = _.attrs.style || "";
|
|
1954
|
+
_.attrs.style = P + (P && !P.endsWith(";") ? "; " : "") + E;
|
|
1936
1955
|
}
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1956
|
+
}
|
|
1957
|
+
const C = {};
|
|
1958
|
+
for (const [w, S] of Object.entries($))
|
|
1959
|
+
["bind", "show", "class", "style"].includes(w) || (C[w] = S);
|
|
1960
|
+
if (Object.keys(C).length > 0 && (_.directives = C), h) {
|
|
1961
|
+
const w = D(
|
|
1962
|
+
f,
|
|
1943
1963
|
d,
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
),
|
|
1947
|
-
|
|
1948
|
-
} else
|
|
1949
|
-
tag:
|
|
1964
|
+
c.length === 1 && F(c[0]) && c[0].tag === "#text" ? typeof c[0].children == "string" ? c[0].children : "" : c.length ? c : void 0,
|
|
1965
|
+
y
|
|
1966
|
+
), S = i.pop();
|
|
1967
|
+
S ? (f = S.tag, d = S.props, y = S.key, c = S.children, c.push(w)) : (b.push(w), f = null, d = {}, y = void 0, c = []);
|
|
1968
|
+
} else g ? f ? c.push(D(l, _, void 0, void 0)) : b.push(D(l, _, void 0, void 0)) : (f && i.push({
|
|
1969
|
+
tag: f,
|
|
1950
1970
|
props: d,
|
|
1951
|
-
children:
|
|
1952
|
-
key:
|
|
1953
|
-
}),
|
|
1954
|
-
} else if (typeof
|
|
1955
|
-
const l = Number(
|
|
1956
|
-
h
|
|
1957
|
-
} else if (
|
|
1958
|
-
const l =
|
|
1959
|
-
for (const x of
|
|
1971
|
+
children: c,
|
|
1972
|
+
key: y
|
|
1973
|
+
}), f = l, d = _, c = []);
|
|
1974
|
+
} else if (typeof a[3] < "u") {
|
|
1975
|
+
const l = Number(a[3]), h = t[l], g = `interp-${l}`;
|
|
1976
|
+
v(h, g);
|
|
1977
|
+
} else if (a[4]) {
|
|
1978
|
+
const l = a[4], h = f ? c : b, g = l.split(/({{\d+}})/);
|
|
1979
|
+
for (const x of g) {
|
|
1960
1980
|
if (!x) continue;
|
|
1961
1981
|
const k = x.match(/^{{(\d+)}}$/);
|
|
1962
1982
|
if (k) {
|
|
1963
|
-
const $ = Number(k[1]),
|
|
1964
|
-
|
|
1983
|
+
const $ = Number(k[1]), _ = t[$], C = `interp-${$}`;
|
|
1984
|
+
v(_, C);
|
|
1965
1985
|
} else {
|
|
1966
|
-
const $ = `text-${
|
|
1967
|
-
|
|
1986
|
+
const $ = `text-${u++}`;
|
|
1987
|
+
h.push(n(x, $));
|
|
1968
1988
|
}
|
|
1969
1989
|
}
|
|
1970
1990
|
}
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
(l) => M(l) ? l.tag !== "#text" || typeof l.children == "string" && l.children.trim() !== "" : !0
|
|
1974
|
-
// keep non-element VNodes (including anchors) as-is
|
|
1975
|
-
)), a;
|
|
1976
|
-
if (y.length > 0) {
|
|
1977
|
-
const l = y.filter(
|
|
1978
|
-
(p) => M(p) ? p.tag !== "#text" || typeof p.children == "string" && p.children.trim() !== "" : !0
|
|
1979
|
-
);
|
|
1980
|
-
return l.length === 1 ? l[0] : l;
|
|
1981
|
-
}
|
|
1982
|
-
return F("div", {}, "", "fallback-root");
|
|
1991
|
+
const p = b.filter((l) => F(l) && l.tag === "#text" ? typeof l.children == "string" && l.children.trim() !== "" : !0);
|
|
1992
|
+
return p.length === 1 ? p[0] : p.length > 1 ? p : D("div", {}, "", "fallback-root");
|
|
1983
1993
|
}
|
|
1984
|
-
function
|
|
1994
|
+
function M(e, ...t) {
|
|
1985
1995
|
const r = t[t.length - 1], n = typeof r == "object" && r && !Array.isArray(r) ? r : void 0;
|
|
1986
|
-
return
|
|
1996
|
+
return et(e, t, n);
|
|
1987
1997
|
}
|
|
1988
1998
|
const pe = (e) => e ? typeof URLSearchParams > "u" ? {} : Object.fromEntries(new URLSearchParams(e)) : {}, B = (e, t) => {
|
|
1989
1999
|
for (const r of e) {
|
|
@@ -1997,7 +2007,7 @@ const pe = (e) => e ? typeof URLSearchParams > "u" ? {} : Object.fromEntries(new
|
|
|
1997
2007
|
}
|
|
1998
2008
|
return { route: null, params: {} };
|
|
1999
2009
|
}, G = {};
|
|
2000
|
-
async function
|
|
2010
|
+
async function tt(e) {
|
|
2001
2011
|
if (e.component) return e.component;
|
|
2002
2012
|
if (e.load) {
|
|
2003
2013
|
if (G[e.path]) return G[e.path];
|
|
@@ -2010,112 +2020,112 @@ async function et(e) {
|
|
|
2010
2020
|
}
|
|
2011
2021
|
throw new Error(`No component or loader defined for route: ${e.path}`);
|
|
2012
2022
|
}
|
|
2013
|
-
function
|
|
2023
|
+
function rt(e) {
|
|
2014
2024
|
const { routes: t, base: r = "", initialUrl: n } = e;
|
|
2015
|
-
let o, s, i, a, c, f,
|
|
2016
|
-
const
|
|
2017
|
-
const l = t.find((
|
|
2025
|
+
let o, s, i, a, c, f, d;
|
|
2026
|
+
const y = async (v, p) => {
|
|
2027
|
+
const l = t.find((h) => B([h], v.path).route !== null);
|
|
2018
2028
|
if (l?.beforeEnter)
|
|
2019
2029
|
try {
|
|
2020
|
-
const
|
|
2021
|
-
return typeof
|
|
2022
|
-
} catch (
|
|
2023
|
-
return console.error("beforeEnter error",
|
|
2030
|
+
const h = await l.beforeEnter(v, p);
|
|
2031
|
+
return typeof h == "string" ? (await m(h, !0), !1) : h !== !1;
|
|
2032
|
+
} catch (h) {
|
|
2033
|
+
return console.error("beforeEnter error", h), !1;
|
|
2024
2034
|
}
|
|
2025
2035
|
return !0;
|
|
2026
|
-
}, u = async (
|
|
2027
|
-
const l = t.find((
|
|
2036
|
+
}, u = async (v, p) => {
|
|
2037
|
+
const l = t.find((h) => B([h], v.path).route !== null);
|
|
2028
2038
|
if (l?.onEnter)
|
|
2029
2039
|
try {
|
|
2030
|
-
const
|
|
2031
|
-
return typeof
|
|
2032
|
-
} catch (
|
|
2033
|
-
return console.error("onEnter error",
|
|
2040
|
+
const h = await l.onEnter(v, p);
|
|
2041
|
+
return typeof h == "string" ? (await m(h, !0), !1) : h !== !1;
|
|
2042
|
+
} catch (h) {
|
|
2043
|
+
return console.error("onEnter error", h), !1;
|
|
2034
2044
|
}
|
|
2035
2045
|
return !0;
|
|
2036
|
-
},
|
|
2037
|
-
const l = t.find((
|
|
2046
|
+
}, b = (v, p) => {
|
|
2047
|
+
const l = t.find((h) => B([h], v.path).route !== null);
|
|
2038
2048
|
if (l?.afterEnter)
|
|
2039
2049
|
try {
|
|
2040
|
-
l.afterEnter(
|
|
2041
|
-
} catch (
|
|
2042
|
-
console.error("afterEnter error",
|
|
2050
|
+
l.afterEnter(v, p);
|
|
2051
|
+
} catch (h) {
|
|
2052
|
+
console.error("afterEnter error", h);
|
|
2043
2053
|
}
|
|
2044
|
-
},
|
|
2054
|
+
}, m = async (v, p = !1) => {
|
|
2045
2055
|
try {
|
|
2046
2056
|
const l = {
|
|
2047
|
-
path:
|
|
2057
|
+
path: v.replace(r, "") || "/",
|
|
2048
2058
|
query: {}
|
|
2049
|
-
},
|
|
2050
|
-
if (!
|
|
2051
|
-
const
|
|
2059
|
+
}, h = B(t, l.path);
|
|
2060
|
+
if (!h) throw new Error(`No route found for ${l.path}`);
|
|
2061
|
+
const g = i.getState(), x = {
|
|
2052
2062
|
path: l.path,
|
|
2053
|
-
params:
|
|
2063
|
+
params: h.params,
|
|
2054
2064
|
query: l.query
|
|
2055
2065
|
};
|
|
2056
|
-
if (!await
|
|
2057
|
-
typeof window < "u" && typeof document < "u" && (
|
|
2066
|
+
if (!await y(x, g) || !await u(x, g)) return;
|
|
2067
|
+
typeof window < "u" && typeof document < "u" && (p ? window.history.replaceState({}, "", r + v) : window.history.pushState({}, "", r + v)), i.setState(x), b(x, g);
|
|
2058
2068
|
} catch (l) {
|
|
2059
2069
|
console.error("Navigation error:", l);
|
|
2060
2070
|
}
|
|
2061
2071
|
};
|
|
2062
2072
|
if (typeof window < "u" && typeof document < "u") {
|
|
2063
2073
|
o = () => {
|
|
2064
|
-
const
|
|
2065
|
-
return { path: l, query:
|
|
2074
|
+
const p = new URL(window.location.href), l = p.pathname.replace(r, "") || "/", h = pe(p.search);
|
|
2075
|
+
return { path: l, query: h };
|
|
2066
2076
|
}, s = o();
|
|
2067
|
-
const
|
|
2077
|
+
const v = B(t, s.path);
|
|
2068
2078
|
i = ie({
|
|
2069
2079
|
path: s.path,
|
|
2070
|
-
params:
|
|
2080
|
+
params: v.params,
|
|
2071
2081
|
query: s.query
|
|
2072
|
-
}), a = async (
|
|
2082
|
+
}), a = async (p = !1) => {
|
|
2073
2083
|
const l = o();
|
|
2074
|
-
await
|
|
2075
|
-
}, window.addEventListener("popstate", () => a(!0)), c = (
|
|
2084
|
+
await m(l.path, p);
|
|
2085
|
+
}, window.addEventListener("popstate", () => a(!0)), c = (p) => m(p, !1), f = (p) => m(p, !0), d = () => window.history.back();
|
|
2076
2086
|
} else {
|
|
2077
2087
|
o = () => {
|
|
2078
|
-
const
|
|
2079
|
-
return { path: l, query:
|
|
2088
|
+
const p = new URL(n || "/", "http://localhost"), l = p.pathname.replace(r, "") || "/", h = pe(p.search);
|
|
2089
|
+
return { path: l, query: h };
|
|
2080
2090
|
}, s = o();
|
|
2081
|
-
const
|
|
2091
|
+
const v = B(t, s.path);
|
|
2082
2092
|
i = ie({
|
|
2083
2093
|
path: s.path,
|
|
2084
|
-
params:
|
|
2094
|
+
params: v.params,
|
|
2085
2095
|
query: s.query
|
|
2086
2096
|
}), a = async () => {
|
|
2087
2097
|
}, c = async () => {
|
|
2088
2098
|
}, f = async () => {
|
|
2089
|
-
},
|
|
2099
|
+
}, d = () => {
|
|
2090
2100
|
};
|
|
2091
2101
|
}
|
|
2092
2102
|
return {
|
|
2093
2103
|
store: i,
|
|
2094
2104
|
push: c,
|
|
2095
2105
|
replace: f,
|
|
2096
|
-
back:
|
|
2106
|
+
back: d,
|
|
2097
2107
|
subscribe: i.subscribe,
|
|
2098
|
-
matchRoute: (
|
|
2108
|
+
matchRoute: (v) => B(t, v),
|
|
2099
2109
|
getCurrent: () => i.getState(),
|
|
2100
|
-
resolveRouteComponent:
|
|
2110
|
+
resolveRouteComponent: tt
|
|
2101
2111
|
};
|
|
2102
2112
|
}
|
|
2103
|
-
function
|
|
2113
|
+
function ft(e, t) {
|
|
2104
2114
|
return B(e, t);
|
|
2105
2115
|
}
|
|
2106
|
-
function
|
|
2107
|
-
const t =
|
|
2116
|
+
function ut(e) {
|
|
2117
|
+
const t = rt(e);
|
|
2108
2118
|
return de("router-view", {
|
|
2109
2119
|
async render() {
|
|
2110
|
-
if (!t) return
|
|
2120
|
+
if (!t) return M`<div>Router not initialized.</div>`;
|
|
2111
2121
|
const r = t.getCurrent(), { path: n } = r, o = t.matchRoute(n);
|
|
2112
|
-
if (!o.route) return
|
|
2122
|
+
if (!o.route) return M`<div>Not found</div>`;
|
|
2113
2123
|
let s = o.route.component;
|
|
2114
2124
|
if (o.route.load) {
|
|
2115
2125
|
const i = await o.route.load();
|
|
2116
2126
|
typeof i.default == "string" && (s = i.default);
|
|
2117
2127
|
}
|
|
2118
|
-
return typeof s == "string" ? { tag: s, props: {}, children: [] } :
|
|
2128
|
+
return typeof s == "string" ? { tag: s, props: {}, children: [] } : M`<div>Invalid route component</div>`;
|
|
2119
2129
|
},
|
|
2120
2130
|
onConnected(r) {
|
|
2121
2131
|
t && typeof t.subscribe == "function" && t.subscribe(() => {
|
|
@@ -2141,27 +2151,27 @@ function ft(e) {
|
|
|
2141
2151
|
}
|
|
2142
2152
|
` }
|
|
2143
2153
|
},
|
|
2144
|
-
style: (r) => r.
|
|
2154
|
+
style: (r) => r.style,
|
|
2145
2155
|
render: (r) => {
|
|
2146
|
-
const n = t.getCurrent(), o = r.
|
|
2147
|
-
return
|
|
2148
|
-
${ve().when(
|
|
2156
|
+
const n = t.getCurrent(), o = r.to, s = r.exact, i = r.exactActiveClass, a = r.activeClass, c = r.ariaCurrentValue, f = r.tag, d = r.disabled, y = r.external, u = n.path === o, b = s ? u : n && typeof n.path == "string" ? n.path.startsWith(o) : !1, m = u ? i : b ? a : "", v = u ? `aria-current="${c}"` : "", p = f === "button", l = d ? p ? 'disabled aria-disabled="true" tabindex="-1"' : 'aria-disabled="true" tabindex="-1"' : "", h = y && (f === "a" || !f) ? 'target="_blank" rel="noopener noreferrer"' : "";
|
|
2157
|
+
return M`
|
|
2158
|
+
${ve().when(p, M`
|
|
2149
2159
|
<button
|
|
2150
2160
|
part="button"
|
|
2151
|
-
class="${
|
|
2152
|
-
${
|
|
2161
|
+
class="${m}"
|
|
2162
|
+
${v}
|
|
2153
2163
|
${l}
|
|
2154
|
-
${
|
|
2164
|
+
${h}
|
|
2155
2165
|
data-on-click="navigate"
|
|
2156
2166
|
><slot></slot></button>
|
|
2157
|
-
`).otherwise(
|
|
2167
|
+
`).otherwise(M`
|
|
2158
2168
|
<a
|
|
2159
2169
|
part="link"
|
|
2160
2170
|
href="${o}"
|
|
2161
|
-
class="${
|
|
2162
|
-
${
|
|
2171
|
+
class="${m}"
|
|
2172
|
+
${v}
|
|
2163
2173
|
${l}
|
|
2164
|
-
${
|
|
2174
|
+
${h}
|
|
2165
2175
|
data-on-click="navigate"
|
|
2166
2176
|
><slot></slot></a>
|
|
2167
2177
|
`).done()}
|
|
@@ -2182,21 +2192,21 @@ export {
|
|
|
2182
2192
|
de as component,
|
|
2183
2193
|
ie as createStore,
|
|
2184
2194
|
ge as css,
|
|
2185
|
-
|
|
2186
|
-
|
|
2195
|
+
ot as each,
|
|
2196
|
+
it as emit,
|
|
2187
2197
|
H as eventBus,
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2198
|
+
M as html,
|
|
2199
|
+
ut as initRouter,
|
|
2200
|
+
ct as listen,
|
|
2191
2201
|
ve as match,
|
|
2192
2202
|
B as matchRoute,
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2203
|
+
ft as matchRouteSSR,
|
|
2204
|
+
at as off,
|
|
2205
|
+
st as on,
|
|
2206
|
+
lt as once,
|
|
2197
2207
|
pe as parseQuery,
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2208
|
+
tt as resolveRouteComponent,
|
|
2209
|
+
rt as useRouter,
|
|
2210
|
+
nt as when
|
|
2201
2211
|
};
|
|
2202
2212
|
//# sourceMappingURL=custom-elements-runtime.es.js.map
|