@jasonshimmy/custom-elements-runtime 1.0.6 → 1.0.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.
@@ -327,18 +327,18 @@ function pr(e, t, r = {}) {
327
327
  F.cleanup(n);
328
328
  };
329
329
  }
330
- const xe = /* @__PURE__ */ new Map(), ve = /* @__PURE__ */ new Map(), $e = /* @__PURE__ */ new Map(), Ue = 500;
330
+ const ve = /* @__PURE__ */ new Map(), xe = /* @__PURE__ */ new Map(), $e = /* @__PURE__ */ new Map(), Ue = 500;
331
331
  function re(e) {
332
- if (xe.has(e))
333
- return xe.get(e);
332
+ if (ve.has(e))
333
+ return ve.get(e);
334
334
  const t = e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
335
- return xe.size < Ue && xe.set(e, t), t;
335
+ return ve.size < Ue && ve.set(e, t), t;
336
336
  }
337
337
  function it(e) {
338
- if (ve.has(e))
339
- return ve.get(e);
338
+ if (xe.has(e))
339
+ return xe.get(e);
340
340
  const t = e.replace(/-([a-z])/g, (r, i) => i.toUpperCase());
341
- return ve.size < Ue && ve.set(e, t), t;
341
+ return xe.size < Ue && xe.set(e, t), t;
342
342
  }
343
343
  function ie(e) {
344
344
  if (typeof e == "string") {
@@ -440,10 +440,10 @@ function bt(e, t, r) {
440
440
  function wt(e, t, r) {
441
441
  t.props && bt(e, t.props, r);
442
442
  }
443
- function xt(e, t, r, i) {
443
+ function vt(e, t, r, i) {
444
444
  e.onConnected && !r && (e.onConnected(t), i(!0));
445
445
  }
446
- function vt(e, t, r, i, n, s, o, a) {
446
+ function xt(e, t, r, i, n, s, o, a) {
447
447
  e.onDisconnected && e.onDisconnected(t), r.forEach((u) => u()), i(), n(), s(!1), o(null), a(!1);
448
448
  }
449
449
  function $t(e, t, r, i, n) {
@@ -707,9 +707,9 @@ class kt {
707
707
  return c;
708
708
  }
709
709
  function d() {
710
- return n() && n().value === "!" ? (s("OP"), !d()) : n() && n().value === "-" ? (s("OP"), -d()) : x();
710
+ return n() && n().value === "!" ? (s("OP"), !d()) : n() && n().value === "-" ? (s("OP"), -d()) : v();
711
711
  }
712
- function x() {
712
+ function v() {
713
713
  const c = n();
714
714
  if (c) {
715
715
  if (c.type === "NUMBER")
@@ -860,7 +860,7 @@ function Ct(e, t, r, i, n, s, o, a) {
860
860
  }, l = p();
861
861
  let d = "text";
862
862
  o instanceof HTMLInputElement ? d = i?.type || o.type || "text" : o instanceof HTMLSelectElement ? d = "select" : o instanceof HTMLTextAreaElement && (d = "textarea");
863
- const x = o instanceof HTMLInputElement || o instanceof HTMLTextAreaElement || o instanceof HTMLSelectElement, c = x ? d === "checkbox" || d === "radio" ? "checked" : "value" : a ?? "modelValue";
863
+ const v = o instanceof HTMLInputElement || o instanceof HTMLTextAreaElement || o instanceof HTMLSelectElement, c = v ? d === "checkbox" || d === "radio" ? "checked" : "value" : a ?? "modelValue";
864
864
  if (d === "checkbox")
865
865
  if (Array.isArray(l))
866
866
  r[c] = l.includes(String(o?.getAttribute("value") ?? i?.value ?? ""));
@@ -894,7 +894,7 @@ function Ct(e, t, r, i, n, s, o, a) {
894
894
  if (k.isTrusted === !1 && !$) return;
895
895
  const f = k.target;
896
896
  if (!f || f._modelUpdating) return;
897
- let v = f.value;
897
+ let x = f.value;
898
898
  if (d === "checkbox") {
899
899
  const T = p();
900
900
  if (Array.isArray(T)) {
@@ -905,38 +905,38 @@ function Ct(e, t, r, i, n, s, o, a) {
905
905
  const P = S.indexOf(R);
906
906
  P > -1 && S.splice(P, 1);
907
907
  }
908
- v = S;
908
+ x = S;
909
909
  } else {
910
910
  const R = f.getAttribute("true-value") ?? !0, S = f.getAttribute("false-value") ?? !1;
911
- v = f.checked ? R : S;
911
+ x = f.checked ? R : S;
912
912
  }
913
913
  } else if (d === "radio")
914
- v = f.getAttribute("value") ?? f.value;
914
+ x = f.getAttribute("value") ?? f.value;
915
915
  else if (d === "select" && f.multiple)
916
- v = Array.from(f.selectedOptions).map((T) => T.value);
917
- else if (m && typeof v == "string" && (v = v.trim()), g) {
918
- const T = Number(v);
919
- isNaN(T) || (v = T);
916
+ x = Array.from(f.selectedOptions).map((T) => T.value);
917
+ else if (m && typeof x == "string" && (x = x.trim()), g) {
918
+ const T = Number(x);
919
+ isNaN(T) || (x = T);
920
920
  }
921
921
  const A = s._state || s, C = p();
922
- if (Array.isArray(v) && Array.isArray(C) ? JSON.stringify([...v].sort()) !== JSON.stringify([...C].sort()) : v !== C) {
922
+ if (Array.isArray(x) && Array.isArray(C) ? JSON.stringify([...x].sort()) !== JSON.stringify([...C].sort()) : x !== C) {
923
923
  f._modelUpdating = !0;
924
924
  try {
925
925
  if (b)
926
926
  if (a && typeof e.value == "object" && e.value !== null) {
927
927
  const T = { ...e.value };
928
- T[a] = v, e.value = T;
928
+ T[a] = x, e.value = T;
929
929
  } else
930
- e.value = v;
930
+ e.value = x;
931
931
  else
932
- _e(A, e, v);
932
+ _e(A, e, x);
933
933
  if (s._requestRender && s._requestRender(), s._triggerWatchers) {
934
934
  const T = b ? "reactiveState" : e;
935
- s._triggerWatchers(T, v);
935
+ s._triggerWatchers(T, x);
936
936
  }
937
937
  if (f) {
938
938
  const T = `update:${re(c)}`, R = new CustomEvent(T, {
939
- detail: v,
939
+ detail: x,
940
940
  bubbles: !0,
941
941
  composed: !0
942
942
  });
@@ -947,7 +947,7 @@ function Ct(e, t, r, i, n, s, o, a) {
947
947
  }
948
948
  }
949
949
  };
950
- if (x) {
950
+ if (v) {
951
951
  if (n[h]) {
952
952
  const k = n[h];
953
953
  o && oe.removeListener(o, h, k);
@@ -960,15 +960,15 @@ function Ct(e, t, r, i, n, s, o, a) {
960
960
  o && oe.removeListener(o, k, $);
961
961
  }
962
962
  n[k] = ($) => {
963
- const f = s._state || s, v = $.detail !== void 0 ? $.detail : $.target?.value, A = H(f, e);
964
- if (Array.isArray(v) && Array.isArray(A) ? JSON.stringify([...v].sort()) !== JSON.stringify([...A].sort()) : v !== A) {
965
- _e(f, e, v), s._requestRender && s._requestRender(), s._triggerWatchers && s._triggerWatchers(e, v);
963
+ const f = s._state || s, x = $.detail !== void 0 ? $.detail : $.target?.value, A = H(f, e);
964
+ if (Array.isArray(x) && Array.isArray(A) ? JSON.stringify([...x].sort()) !== JSON.stringify([...A].sort()) : x !== A) {
965
+ _e(f, e, x), s._requestRender && s._requestRender(), s._triggerWatchers && s._triggerWatchers(e, x);
966
966
  const E = $.target;
967
967
  if (E) {
968
- E[c] = v;
968
+ E[c] = x;
969
969
  try {
970
970
  const T = re(c);
971
- typeof v == "boolean" ? v ? E.setAttribute(T, "true") : E.setAttribute(T, "false") : E.setAttribute(T, String(v));
971
+ typeof x == "boolean" ? x ? E.setAttribute(T, "true") : E.setAttribute(T, "false") : E.setAttribute(T, String(x));
972
972
  } catch {
973
973
  }
974
974
  queueMicrotask(() => {
@@ -982,7 +982,7 @@ function Ct(e, t, r, i, n, s, o, a) {
982
982
  n._isComposing = !1;
983
983
  const $ = k.target;
984
984
  $ && setTimeout(() => {
985
- const f = $.value, v = s._state || s, A = H(v, e);
985
+ const f = $.value, x = s._state || s, A = H(x, e);
986
986
  let C = f;
987
987
  if (m && (C = C.trim()), g) {
988
988
  const T = Number(C);
@@ -991,7 +991,7 @@ function Ct(e, t, r, i, n, s, o, a) {
991
991
  if (Array.isArray(C) && Array.isArray(A) ? JSON.stringify([...C].sort()) !== JSON.stringify([...A].sort()) : C !== A) {
992
992
  $._modelUpdating = !0;
993
993
  try {
994
- _e(v, e, C), s._requestRender && s._requestRender(), s._triggerWatchers && s._triggerWatchers(e, C);
994
+ _e(x, e, C), s._requestRender && s._requestRender(), s._triggerWatchers && s._triggerWatchers(e, C);
995
995
  } finally {
996
996
  setTimeout(() => $._modelUpdating = !1, 0);
997
997
  }
@@ -1208,15 +1208,15 @@ function Ve(e, t, r, i) {
1208
1208
  }, u = t.props ?? {}, m = o, g = r?.isCustomElement ?? t?.isCustomElement ?? !1;
1209
1209
  let b = !1;
1210
1210
  for (const d in { ...u, ...m }) {
1211
- const x = u[d], w = m[d];
1212
- if (x !== w)
1211
+ const v = u[d], w = m[d];
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 ?? "");
1215
1215
  else if (d === "checked" && e instanceof HTMLInputElement)
1216
1216
  e.checked = !!w;
1217
1217
  else if (d.startsWith("on") && typeof w == "function") {
1218
1218
  const c = ot(d);
1219
- typeof x == "function" && oe.removeListener(e, c, x), oe.addListener(e, c, w);
1219
+ typeof v == "function" && oe.removeListener(e, c, v), oe.addListener(e, c, w);
1220
1220
  } else if (w == null)
1221
1221
  e.removeAttribute(d);
1222
1222
  else if ((r?.isCustomElement ?? t?.isCustomElement ?? !1) || d in e)
@@ -1227,15 +1227,15 @@ function Ve(e, t, r, i) {
1227
1227
  else
1228
1228
  w === !1 && e.removeAttribute(d);
1229
1229
  }
1230
- for (const [d, x] of Object.entries(
1230
+ for (const [d, v] of Object.entries(
1231
1231
  s.listeners || {}
1232
1232
  ))
1233
- oe.addListener(e, d, x);
1233
+ oe.addListener(e, d, v);
1234
1234
  const p = t.attrs ?? {}, l = a;
1235
1235
  for (const d in { ...p, ...l }) {
1236
- const x = p[d], w = l[d];
1237
- let c = x, h = w;
1238
- if (ee(x) && (c = x.value), ee(w) && (h = w.value), c !== h)
1236
+ const v = p[d], w = l[d];
1237
+ let c = v, h = w;
1238
+ if (ee(v) && (c = v.value), ee(w) && (h = w.value), c !== h)
1239
1239
  if (b = !0, h == null || h === !1) {
1240
1240
  if (e.removeAttribute(d), d === "value") {
1241
1241
  if (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement)
@@ -1337,15 +1337,15 @@ function X(e, t, r) {
1337
1337
  return e.key != null && (p.key = e.key), p;
1338
1338
  }
1339
1339
  if (e.tag === "#anchor") {
1340
- const p = e, l = Array.isArray(p.children) ? p.children : [], d = document.createTextNode(""), x = document.createTextNode("");
1341
- p.key != null && (d.key = `${p.key}:start`, x.key = `${p.key}:end`), p._startNode = d, p._endNode = x;
1340
+ const p = e, l = Array.isArray(p.children) ? p.children : [], d = document.createTextNode(""), v = document.createTextNode("");
1341
+ p.key != null && (d.key = `${p.key}:start`, v.key = `${p.key}:end`), p._startNode = d, p._endNode = v;
1342
1342
  const w = document.createDocumentFragment();
1343
1343
  w.appendChild(d);
1344
1344
  for (const c of l) {
1345
1345
  const h = X(c, t);
1346
1346
  w.appendChild(h);
1347
1347
  }
1348
- return w.appendChild(x), w;
1348
+ return w.appendChild(v), w;
1349
1349
  }
1350
1350
  const i = document.createElement(e.tag);
1351
1351
  e.key != null && (i.key = e.key);
@@ -1381,9 +1381,9 @@ function X(e, t, r) {
1381
1381
  i.setAttribute(p, String(l));
1382
1382
  }
1383
1383
  else if ((e.props?.isCustomElement ?? !1) && !g && p.includes("-")) {
1384
- const x = it(p);
1384
+ const v = it(p);
1385
1385
  try {
1386
- i[x] = l;
1386
+ i[v] = l;
1387
1387
  } catch {
1388
1388
  i.setAttribute(p, String(l));
1389
1389
  }
@@ -1409,8 +1409,8 @@ function X(e, t, r) {
1409
1409
  i.removeAttribute(p);
1410
1410
  else if ((e.props?.isCustomElement ?? !1) || p in i)
1411
1411
  try {
1412
- const x = typeof l == "object" && l !== null && typeof l.value < "u" ? l.value : l;
1413
- i[p] = x;
1412
+ const v = typeof l == "object" && l !== null && typeof l.value < "u" ? l.value : l;
1413
+ i[p] = v;
1414
1414
  } catch {
1415
1415
  }
1416
1416
  }
@@ -1467,16 +1467,16 @@ function Rt(e, t, r, i, n) {
1467
1467
  const m = /* @__PURE__ */ new Set();
1468
1468
  let g = e.firstChild;
1469
1469
  function b(l, d) {
1470
- let x = l;
1471
- for (; x && (m.add(x), x !== d); )
1472
- x = x.nextSibling;
1470
+ let v = l;
1471
+ for (; v && (m.add(v), v !== d); )
1472
+ v = v.nextSibling;
1473
1473
  }
1474
- function p(l, d, x, w) {
1474
+ function p(l, d, v, w) {
1475
1475
  const c = [];
1476
1476
  let h = l.nextSibling;
1477
1477
  for (; h && h !== d; )
1478
1478
  c.push(h), h = h.nextSibling;
1479
- const y = Array.isArray(x) ? x : [];
1479
+ const y = Array.isArray(v) ? v : [];
1480
1480
  if (w.some(($) => $ && $.key != null) || y.some(($) => $ && $.key != null)) {
1481
1481
  const $ = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
1482
1482
  for (const C of y)
@@ -1485,7 +1485,7 @@ function Rt(e, t, r, i, n) {
1485
1485
  const E = C.key;
1486
1486
  E != null && f.set(E, C);
1487
1487
  }
1488
- const v = /* @__PURE__ */ new Set();
1488
+ const x = /* @__PURE__ */ new Set();
1489
1489
  let A = l.nextSibling;
1490
1490
  for (const C of w) {
1491
1491
  let E;
@@ -1496,20 +1496,20 @@ function Rt(e, t, r, i, n) {
1496
1496
  T,
1497
1497
  C,
1498
1498
  i
1499
- ), v.add(E), E !== A && e.contains(E) && e.insertBefore(E, A);
1499
+ ), x.add(E), E !== A && e.contains(E) && e.insertBefore(E, A);
1500
1500
  } else
1501
- E = X(C, i), e.insertBefore(E, A), v.add(E);
1501
+ E = X(C, i), e.insertBefore(E, A), x.add(E);
1502
1502
  A = E.nextSibling;
1503
1503
  }
1504
1504
  for (const C of c)
1505
- !v.has(C) && e.contains(C) && e.removeChild(C);
1505
+ !x.has(C) && e.contains(C) && e.removeChild(C);
1506
1506
  } else {
1507
1507
  const $ = Math.min(
1508
1508
  y.length,
1509
1509
  w.length
1510
1510
  );
1511
1511
  for (let f = 0; f < $; f++) {
1512
- const v = y[f], A = w[f], C = Ee(c[f], v, A, i);
1512
+ const x = y[f], A = w[f], C = Ee(c[f], x, A, i);
1513
1513
  C !== c[f] && (e.insertBefore(C, c[f]), e.removeChild(c[f]));
1514
1514
  }
1515
1515
  for (let f = $; f < w.length; f++)
@@ -1521,7 +1521,7 @@ function Rt(e, t, r, i, n) {
1521
1521
  for (const l of r) {
1522
1522
  let d;
1523
1523
  if (l.tag === "#anchor") {
1524
- const x = l.key, w = `${x}:start`, c = `${x}:end`;
1524
+ const v = l.key, w = `${v}:start`, c = `${v}:end`;
1525
1525
  let h = u.get(w), y = u.get(c);
1526
1526
  const k = Array.isArray(l.children) ? l.children : [];
1527
1527
  if (h || (h = document.createTextNode(""), h.key = w), y || (y = document.createTextNode(""), y.key = c), l._startNode = h, l._endNode = y, !e.contains(h) || !e.contains(y)) {
@@ -1533,17 +1533,17 @@ function Rt(e, t, r, i, n) {
1533
1533
  p(
1534
1534
  h,
1535
1535
  y,
1536
- a.get(x)?.children,
1536
+ a.get(v)?.children,
1537
1537
  k
1538
1538
  );
1539
1539
  b(h, y), g = y.nextSibling;
1540
1540
  continue;
1541
1541
  }
1542
1542
  if (l.key != null && u.has(l.key)) {
1543
- const x = a.get(l.key);
1543
+ const v = a.get(l.key);
1544
1544
  d = Ee(
1545
1545
  u.get(l.key),
1546
- x,
1546
+ v,
1547
1547
  l,
1548
1548
  i,
1549
1549
  n
@@ -1671,7 +1671,7 @@ const Mt = Pt`
1671
1671
  }
1672
1672
  :host {
1673
1673
  display: contents;
1674
- font: 16px/1.5 ui-sans-serif, system-ui, sans-serif;
1674
+ font: 16px/1.5 var(--font-sans, ui-sans-serif, system-ui, sans-serif);
1675
1675
  -webkit-text-size-adjust: 100%;
1676
1676
  text-size-adjust: 100%;
1677
1677
  }
@@ -2019,9 +2019,9 @@ const Mt = Pt`
2019
2019
  "grow-0": "flex-grow:0;",
2020
2020
  "shrink-0": "flex-shrink:0;",
2021
2021
  /* Font Family */
2022
- "font-sans": "font-family:ui-sans-serif,system-ui,sans-serif;",
2023
- "font-serif": "font-family:ui-serif,Georgia,serif;",
2024
- "font-mono": "font-family:ui-monospace,SFMono-Regular,monospace;",
2022
+ "font-sans": "font-family:var(--font-sans, ui-sans-serif,system-ui,sans-serif);",
2023
+ "font-serif": "font-family:var(--font-serif, ui-serif,Georgia,serif);",
2024
+ "font-mono": "font-family:var(--font-mono, ui-monospace,SFMono-Regular,monospace);",
2025
2025
  /* Line Clamp (for webkit) */
2026
2026
  "line-clamp-1": "display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;",
2027
2027
  "line-clamp-2": "display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;",
@@ -2345,8 +2345,8 @@ function Zt(e) {
2345
2345
  if (!k) return null;
2346
2346
  const $ = k.replace(/^!/, ""), f = Le[$] ?? We($) ?? ze($) ?? Ne($) ?? Se($);
2347
2347
  if (!f) return null;
2348
- const v = h.indexOf(k);
2349
- let A = v >= 0 ? h.slice(0, v) : [];
2348
+ const x = h.indexOf(k);
2349
+ let A = x >= 0 ? h.slice(0, x) : [];
2350
2350
  c && (A = A.filter((_) => _ !== "dark"));
2351
2351
  const C = `.${Kt(w)}`, E = "__SUBJECT__", T = y ? f.replace(/;$/, " !important;") : f;
2352
2352
  let R = E;
@@ -2424,8 +2424,8 @@ function Zt(e) {
2424
2424
  f && ($ === 1 ? s.push(f) : $ === 2 ? o.push(f) : $ === 3 && a.push(f));
2425
2425
  }
2426
2426
  }
2427
- const x = [...s, ...o, ...a, ...u].join("");
2428
- return Xe.set(e, { css: x, timestamp: t }), x;
2427
+ const v = [...s, ...o, ...a, ...u].join("");
2428
+ return Xe.set(e, { css: v, timestamp: t }), v;
2429
2429
  }
2430
2430
  const ge = [];
2431
2431
  function Gt(e, t, r, i, n, s, o, a) {
@@ -2539,7 +2539,7 @@ function wr(e) {
2539
2539
  throw new Error("useOnError must be called during component render");
2540
2540
  ye(W), W._hookCallbacks.onError = e;
2541
2541
  }
2542
- function xr(e) {
2542
+ function vr(e) {
2543
2543
  if (!W)
2544
2544
  throw new Error("useStyle must be called during component render");
2545
2545
  ye(W);
@@ -2672,7 +2672,7 @@ function tr(e, t) {
2672
2672
  }
2673
2673
  connectedCallback() {
2674
2674
  this._runLogicWithinErrorBoundary(t, () => {
2675
- this._applyProps(t), this._requestRender(), xt(
2675
+ this._applyProps(t), this._requestRender(), vt(
2676
2676
  t,
2677
2677
  this.context,
2678
2678
  this._mounted,
@@ -2684,7 +2684,7 @@ function tr(e, t) {
2684
2684
  }
2685
2685
  disconnectedCallback() {
2686
2686
  this._runLogicWithinErrorBoundary(t, () => {
2687
- vt(
2687
+ xt(
2688
2688
  t,
2689
2689
  this.context,
2690
2690
  this._listeners,
@@ -3013,7 +3013,7 @@ function sr(e, t = [], r = {}) {
3013
3013
  p || (l === "true" ? l = !0 : l === "false" ? l = !1 : l === "null" ? l = null : isNaN(Number(l)) || (l = Number(l)));
3014
3014
  const d = ["model", "bind", "show", "class", "style", "ref"];
3015
3015
  if (m === ":") {
3016
- const [x, w] = g.split(":"), [c, ...h] = x.split(".");
3016
+ const [v, w] = g.split(":"), [c, ...h] = v.split(".");
3017
3017
  if (d.includes(c)) {
3018
3018
  const y = [...h], k = c === "model" && w ? `model:${w}` : c;
3019
3019
  s[k] = {
@@ -3026,14 +3026,14 @@ function sr(e, t = [], r = {}) {
3026
3026
  y && ee(y) && (y = y.value), n[g] = y, o.push(g);
3027
3027
  }
3028
3028
  } else if (m === "@") {
3029
- const [x, ...w] = g.split("."), c = w;
3030
- nr(l, x);
3029
+ const [v, ...w] = g.split("."), c = w;
3030
+ nr(l, v);
3031
3031
  const h = typeof l == "function" ? l : typeof r[l] == "function" ? r[l] : void 0;
3032
3032
  if (h) {
3033
3033
  const y = ($) => {
3034
3034
  if (c.includes("prevent") && $.preventDefault(), c.includes("stop") && $.stopPropagation(), !(c.includes("self") && $.target !== $.currentTarget))
3035
- return c.includes("once") && $.currentTarget?.removeEventListener(x, y), h($);
3036
- }, k = "on" + x.charAt(0).toUpperCase() + x.slice(1);
3035
+ return c.includes("once") && $.currentTarget?.removeEventListener(v, y), h($);
3036
+ }, k = "on" + v.charAt(0).toUpperCase() + v.slice(1);
3037
3037
  i[k] = y;
3038
3038
  }
3039
3039
  } else g === "ref" ? i.ref = l : n[g] = l;
@@ -3046,35 +3046,35 @@ function or(e, t, r) {
3046
3046
  const f = De.get(o);
3047
3047
  if (f) return f;
3048
3048
  }
3049
- function a(f, v) {
3050
- return he("#text", {}, f, v);
3049
+ function a(f, x) {
3050
+ return he("#text", {}, f, x);
3051
3051
  }
3052
3052
  let u = "";
3053
3053
  for (let f = 0; f < e.length; f++)
3054
3054
  u += e[f], f < t.length && (u += `{{${f}}}`);
3055
3055
  const m = /<!--[\s\S]*?-->|<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g, g = [];
3056
- let b, p = [], l = null, d = {}, x, w = 0, c = [];
3056
+ let b, p = [], l = null, d = {}, v, w = 0, c = [];
3057
3057
  function h(f) {
3058
- !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((v) => {
3059
- if (v === "style" && d.attrs.style) {
3058
+ !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) => {
3059
+ if (x === "style" && d.attrs.style) {
3060
3060
  const A = d.attrs.style.replace(
3061
3061
  /;?\s*$/,
3062
3062
  ""
3063
3063
  ), C = f.attrs.style.replace(/^;?\s*/, "");
3064
3064
  d.attrs.style = A + "; " + C;
3065
- } else if (v === "class" && d.attrs.class) {
3065
+ } else if (x === "class" && d.attrs.class) {
3066
3066
  const A = d.attrs.class.trim().split(/\s+/).filter(Boolean), C = f.attrs.class.trim().split(/\s+/).filter(Boolean), E = [
3067
3067
  .../* @__PURE__ */ new Set([...A, ...C])
3068
3068
  ];
3069
3069
  d.attrs.class = E.join(" ");
3070
3070
  } else
3071
- d.attrs[v] = f.attrs[v];
3071
+ d.attrs[x] = f.attrs[x];
3072
3072
  }))) : (d.props || (d.props = {}), Object.assign(d.props, f)));
3073
3073
  }
3074
- function y(f, v) {
3074
+ function y(f, x) {
3075
3075
  const A = l ? p : c;
3076
3076
  if (Ae(f)) {
3077
- const C = f.key ?? v;
3077
+ const C = f.key ?? x;
3078
3078
  let E = f.children;
3079
3079
  A.push({
3080
3080
  ...f,
@@ -3091,7 +3091,7 @@ function or(e, t, r) {
3091
3091
  if (f.length === 0) return;
3092
3092
  for (let C = 0; C < f.length; C++) {
3093
3093
  const E = f[C];
3094
- Ae(E) || Ce(E) || Array.isArray(E) ? y(E, `${v}-${C}`) : E !== null && typeof E == "object" ? h(E) : A.push(a(String(E), `${v}-${C}`));
3094
+ Ae(E) || Ce(E) || Array.isArray(E) ? y(E, `${x}-${C}`) : E !== null && typeof E == "object" ? h(E) : A.push(a(String(E), `${x}-${C}`));
3095
3095
  }
3096
3096
  return;
3097
3097
  }
@@ -3099,7 +3099,7 @@ function or(e, t, r) {
3099
3099
  h(f);
3100
3100
  return;
3101
3101
  }
3102
- A.push(a(String(f), v));
3102
+ A.push(a(String(f), x));
3103
3103
  }
3104
3104
  const k = /* @__PURE__ */ new Set([
3105
3105
  "area",
@@ -3120,7 +3120,7 @@ function or(e, t, r) {
3120
3120
  for (; b = m.exec(u); )
3121
3121
  if (!(b[0].startsWith("<!--") && b[0].endsWith("-->"))) {
3122
3122
  if (b[1]) {
3123
- const f = b[1], v = b[0][1] === "/", A = b[0][b[0].length - 2] === "/" || k.has(f), {
3123
+ const f = b[1], x = b[0][1] === "/", A = b[0][b[0].length - 2] === "/" || k.has(f), {
3124
3124
  props: C,
3125
3125
  attrs: E,
3126
3126
  directives: T,
@@ -3192,25 +3192,25 @@ function or(e, t, r) {
3192
3192
  }
3193
3193
  } catch {
3194
3194
  }
3195
- if (Object.keys(T).length > 0 && (S.directives = { ...T }), v) {
3195
+ if (Object.keys(T).length > 0 && (S.directives = { ...T }), x) {
3196
3196
  const P = he(
3197
3197
  l,
3198
3198
  d,
3199
3199
  p.length === 1 && Ce(p[0]) && p[0].tag === "#text" ? typeof p[0].children == "string" ? p[0].children : "" : p.length ? p : void 0,
3200
- x
3200
+ v
3201
3201
  ), B = g.pop();
3202
- B ? (l = B.tag, d = B.props, x = B.key, p = B.children, p.push(P)) : (c.push(P), l = null, d = {}, x = void 0, p = []);
3202
+ B ? (l = B.tag, d = B.props, v = B.key, p = B.children, p.push(P)) : (c.push(P), l = null, d = {}, v = void 0, p = []);
3203
3203
  } else A ? l ? p.push(he(f, S, void 0, void 0)) : c.push(he(f, S, void 0, void 0)) : (l && g.push({
3204
3204
  tag: l,
3205
3205
  props: d,
3206
3206
  children: p,
3207
- key: x
3207
+ key: v
3208
3208
  }), l = f, d = S, p = []);
3209
3209
  } else if (typeof b[3] < "u") {
3210
- const f = Number(b[3]), v = t[f], A = `interp-${f}`;
3211
- y(v, A);
3210
+ const f = Number(b[3]), x = t[f], A = `interp-${f}`;
3211
+ y(x, A);
3212
3212
  } else if (b[4]) {
3213
- const f = b[4], v = l ? p : c, A = f.split(/({{\d+}})/);
3213
+ const f = b[4], x = l ? p : c, A = f.split(/({{\d+}})/);
3214
3214
  for (const C of A) {
3215
3215
  if (!C) continue;
3216
3216
  const E = C.match(/^{{(\d+)}}$/);
@@ -3219,7 +3219,7 @@ function or(e, t, r) {
3219
3219
  y(R, S);
3220
3220
  } else {
3221
3221
  const T = `text-${w++}`;
3222
- v.push(a(C, T));
3222
+ x.push(a(C, T));
3223
3223
  }
3224
3224
  }
3225
3225
  }
@@ -3241,7 +3241,7 @@ function ce(e, ...t) {
3241
3241
  function Re(e, t) {
3242
3242
  return j(e ? t : [], "when-block");
3243
3243
  }
3244
- function vr(e, t) {
3244
+ function xr(e, t) {
3245
3245
  return e.map((r, i) => {
3246
3246
  const n = typeof r == "object" ? r?.key ?? r?.id ?? `idx-${i}` : String(r);
3247
3247
  return j(t(r, i), `each-${n}`);
@@ -3561,38 +3561,38 @@ async function ur(e) {
3561
3561
  function fr(e) {
3562
3562
  const { routes: t, base: r = "", initialUrl: i } = e;
3563
3563
  let n, s, o, a, u, m, g;
3564
- const b = async (x, w) => {
3565
- const c = t.find((h) => Q([h], x.path).route !== null);
3564
+ const b = async (v, w) => {
3565
+ const c = t.find((h) => Q([h], v.path).route !== null);
3566
3566
  if (c?.beforeEnter)
3567
3567
  try {
3568
- const h = await c.beforeEnter(x, w);
3568
+ const h = await c.beforeEnter(v, w);
3569
3569
  return typeof h == "string" ? (await d(h, !0), !1) : h !== !1;
3570
3570
  } catch (h) {
3571
3571
  return se("beforeEnter error", h), !1;
3572
3572
  }
3573
3573
  return !0;
3574
- }, p = async (x, w) => {
3575
- const c = t.find((h) => Q([h], x.path).route !== null);
3574
+ }, p = async (v, w) => {
3575
+ const c = t.find((h) => Q([h], v.path).route !== null);
3576
3576
  if (c?.onEnter)
3577
3577
  try {
3578
- const h = await c.onEnter(x, w);
3578
+ const h = await c.onEnter(v, w);
3579
3579
  return typeof h == "string" ? (await d(h, !0), !1) : h !== !1;
3580
3580
  } catch (h) {
3581
3581
  return se("onEnter error", h), !1;
3582
3582
  }
3583
3583
  return !0;
3584
- }, l = (x, w) => {
3585
- const c = t.find((h) => Q([h], x.path).route !== null);
3584
+ }, l = (v, w) => {
3585
+ const c = t.find((h) => Q([h], v.path).route !== null);
3586
3586
  if (c?.afterEnter)
3587
3587
  try {
3588
- c.afterEnter(x, w);
3588
+ c.afterEnter(v, w);
3589
3589
  } catch (h) {
3590
3590
  se("afterEnter error", h);
3591
3591
  }
3592
- }, d = async (x, w = !1) => {
3592
+ }, d = async (v, w = !1) => {
3593
3593
  try {
3594
3594
  const c = {
3595
- path: x.replace(r, "") || "/",
3595
+ path: v.replace(r, "") || "/",
3596
3596
  query: {}
3597
3597
  }, h = Q(t, c.path);
3598
3598
  if (!h) throw new Error(`No route found for ${c.path}`);
@@ -3602,7 +3602,7 @@ function fr(e) {
3602
3602
  query: c.query
3603
3603
  };
3604
3604
  if (!await b(k, y) || !await p(k, y)) return;
3605
- typeof window < "u" && typeof document < "u" && (w ? window.history.replaceState({}, "", r + x) : window.history.pushState({}, "", r + x)), o.setState(k), l(k, y);
3605
+ typeof window < "u" && typeof document < "u" && (w ? window.history.replaceState({}, "", r + v) : window.history.pushState({}, "", r + v)), o.setState(k), l(k, y);
3606
3606
  } catch (c) {
3607
3607
  se("Navigation error:", c);
3608
3608
  }
@@ -3612,10 +3612,10 @@ function fr(e) {
3612
3612
  const w = new URL(window.location.href), c = w.pathname.replace(r, "") || "/", h = rt(w.search);
3613
3613
  return { path: c, query: h };
3614
3614
  }, s = n();
3615
- const x = Q(t, s.path);
3615
+ const v = Q(t, s.path);
3616
3616
  o = tt({
3617
3617
  path: s.path,
3618
- params: x.params,
3618
+ params: v.params,
3619
3619
  query: s.query
3620
3620
  }), a = async (w = !1) => {
3621
3621
  const c = n();
@@ -3626,10 +3626,10 @@ function fr(e) {
3626
3626
  const c = new URL(i || "/", "http://localhost"), h = c.pathname.replace(r, "") || "/", y = rt(c.search);
3627
3627
  return { path: h, query: y };
3628
3628
  }, s = n();
3629
- const x = Q(t, s.path);
3629
+ const v = Q(t, s.path);
3630
3630
  o = tt({
3631
3631
  path: s.path,
3632
- params: x.params,
3632
+ params: v.params,
3633
3633
  query: s.query
3634
3634
  }), a = async () => {
3635
3635
  const c = n();
@@ -3646,26 +3646,26 @@ function fr(e) {
3646
3646
  path: h.path,
3647
3647
  params: y.params,
3648
3648
  query: h.query
3649
- }, f = t.find((v) => Q([v], $.path).route !== null);
3649
+ }, f = t.find((x) => Q([x], $.path).route !== null);
3650
3650
  if (f?.beforeEnter)
3651
3651
  try {
3652
- const v = await f.beforeEnter($, k);
3653
- if (typeof v == "string") {
3654
- await w(v);
3652
+ const x = await f.beforeEnter($, k);
3653
+ if (typeof x == "string") {
3654
+ await w(x);
3655
3655
  return;
3656
3656
  }
3657
- if (v === !1) return;
3657
+ if (x === !1) return;
3658
3658
  } catch {
3659
3659
  return;
3660
3660
  }
3661
3661
  if (f?.onEnter)
3662
3662
  try {
3663
- const v = await f.onEnter($, k);
3664
- if (typeof v == "string") {
3665
- await w(v);
3663
+ const x = await f.onEnter($, k);
3664
+ if (typeof x == "string") {
3665
+ await w(x);
3666
3666
  return;
3667
3667
  }
3668
- if (v === !1) return;
3668
+ if (x === !1) return;
3669
3669
  } catch {
3670
3670
  return;
3671
3671
  }
@@ -3686,7 +3686,7 @@ function fr(e) {
3686
3686
  replace: m,
3687
3687
  back: g,
3688
3688
  subscribe: o.subscribe,
3689
- matchRoute: (x) => Q(t, x),
3689
+ matchRoute: (v) => Q(t, v),
3690
3690
  getCurrent: () => o.getState(),
3691
3691
  resolveRouteComponent: ur
3692
3692
  };
@@ -3724,14 +3724,14 @@ function Dr(e) {
3724
3724
  disabled: b = !1,
3725
3725
  external: p = !1,
3726
3726
  class: l = ""
3727
- } = r, d = t.getCurrent(), x = d.path === n, w = a ? x : d && typeof d.path == "string" ? d.path.startsWith(n) : !1, c = x ? `aria-current="${g}"` : "", h = (l || "").split(/\s+/).filter(Boolean), y = {};
3727
+ } = r, d = t.getCurrent(), v = d.path === n, w = a ? v : d && typeof d.path == "string" ? d.path.startsWith(n) : !1, c = v ? `aria-current="${g}"` : "", h = (l || "").split(/\s+/).filter(Boolean), y = {};
3728
3728
  for (const C of h) y[C] = !0;
3729
3729
  const k = {
3730
3730
  ...y,
3731
3731
  // Also include the configurable names (may duplicate the above)
3732
3732
  [u]: w,
3733
- [m]: x
3734
- }, $ = s === "button", f = b ? $ ? 'disabled aria-disabled="true" tabindex="-1"' : 'aria-disabled="true" tabindex="-1"' : "", v = p && (s === "a" || !s) ? 'target="_blank" rel="noopener noreferrer"' : "", A = (C) => {
3733
+ [m]: v
3734
+ }, $ = s === "button", f = b ? $ ? 'disabled aria-disabled="true" tabindex="-1"' : 'aria-disabled="true" tabindex="-1"' : "", x = p && (s === "a" || !s) ? 'target="_blank" rel="noopener noreferrer"' : "", A = (C) => {
3735
3735
  if (b) {
3736
3736
  C.preventDefault();
3737
3737
  return;
@@ -3745,7 +3745,7 @@ function Dr(e) {
3745
3745
  :class="${k}"
3746
3746
  ${c}
3747
3747
  ${f}
3748
- ${v}
3748
+ ${x}
3749
3749
  @click="${A}"
3750
3750
  ><slot></slot></button>
3751
3751
  `).otherwise(ce`
@@ -3755,7 +3755,7 @@ function Dr(e) {
3755
3755
  :class="${k}"
3756
3756
  ${c}
3757
3757
  ${f}
3758
- ${v}
3758
+ ${x}
3759
3759
  @click="${A}"
3760
3760
  ><slot></slot></a>
3761
3761
  `).done()}
@@ -3769,7 +3769,7 @@ export {
3769
3769
  hr as computed,
3770
3770
  tt as createStore,
3771
3771
  Pt as css,
3772
- vr as each,
3772
+ xr as each,
3773
3773
  Sr as eachGroup,
3774
3774
  Ar as eachPage,
3775
3775
  _r as eachWhere,
@@ -3802,7 +3802,7 @@ export {
3802
3802
  yr as useOnDisconnected,
3803
3803
  wr as useOnError,
3804
3804
  fr as useRouter,
3805
- xr as useStyle,
3805
+ vr as useStyle,
3806
3806
  pr as watch,
3807
3807
  Re as when,
3808
3808
  kr as whenEmpty,