@jasonshimmy/custom-elements-runtime 0.1.16 → 0.1.18

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.
@@ -1,13 +1,13 @@
1
- function tt(e, t) {
2
- return U(e ? t : [], "when-block");
1
+ function gt(e, t) {
2
+ return te(e ? t : [], "when-block");
3
3
  }
4
- function rt(e, t) {
4
+ function yt(e, t) {
5
5
  return e.map((r, n) => {
6
6
  const o = typeof r == "object" ? r?.key ?? r?.id ?? `idx-${n}` : String(r);
7
- return U(t(r, n), `each-${o}`);
7
+ return te(t(r, n), `each-${o}`);
8
8
  });
9
9
  }
10
- function be() {
10
+ function Le() {
11
11
  const e = [];
12
12
  return {
13
13
  when(t, r) {
@@ -17,18 +17,18 @@ function be() {
17
17
  return e.push([!0, t]), this;
18
18
  },
19
19
  done() {
20
- return ve(...e);
20
+ return ze(...e);
21
21
  }
22
22
  };
23
23
  }
24
- function ve(...e) {
24
+ function ze(...e) {
25
25
  for (let t = 0; t < e.length; t++) {
26
26
  const [r, n] = e[t];
27
- if (r) return [U(n, `whenChain-branch-${t}`)];
27
+ if (r) return [te(n, `whenChain-branch-${t}`)];
28
28
  }
29
- return [U([], "whenChain-empty")];
29
+ return [te([], "whenChain-empty")];
30
30
  }
31
- function U(e, t) {
31
+ function te(e, t) {
32
32
  const r = e ? Array.isArray(e) ? e.filter(Boolean) : [e].filter(Boolean) : [];
33
33
  return {
34
34
  tag: "#anchor",
@@ -36,7 +36,7 @@ function U(e, t) {
36
36
  children: r
37
37
  };
38
38
  }
39
- class O extends EventTarget {
39
+ class F extends EventTarget {
40
40
  handlers = {};
41
41
  static instance;
42
42
  eventCounters = /* @__PURE__ */ new Map();
@@ -44,7 +44,7 @@ class O extends EventTarget {
44
44
  * Returns the singleton instance of GlobalEventBus
45
45
  */
46
46
  static getInstance() {
47
- return O.instance || (O.instance = new O()), O.instance;
47
+ return F.instance || (F.instance = new F()), F.instance;
48
48
  }
49
49
  // Enhanced emit method with better typing and event storm protection
50
50
  /**
@@ -160,8 +160,8 @@ class O extends EventTarget {
160
160
  this.eventCounters.clear();
161
161
  }
162
162
  }
163
- const D = O.getInstance(), nt = (e, t) => D.emit(e, t), ot = (e, t) => D.on(e, t), it = (e, t) => D.off(e, t), st = (e, t) => D.once(e, t), at = (e, t, r) => D.listen(e, t, r);
164
- function se(e) {
163
+ const Z = F.getInstance(), mt = (e, t) => Z.emit(e, t), bt = (e, t) => Z.on(e, t), vt = (e, t) => Z.off(e, t), xt = (e, t) => Z.once(e, t), wt = (e, t, r) => Z.listen(e, t, r);
164
+ function ve(e) {
165
165
  let t = { ...e };
166
166
  const r = [];
167
167
  function n(a) {
@@ -179,10 +179,10 @@ function se(e) {
179
179
  }
180
180
  return { subscribe: n, getState: o, setState: s };
181
181
  }
182
- function ne(e) {
182
+ function ye(e) {
183
183
  return e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
184
184
  }
185
- function ee(e) {
185
+ function pe(e) {
186
186
  return typeof e == "string" ? e.replace(
187
187
  /[&<>"']/g,
188
188
  (t) => ({
@@ -194,32 +194,32 @@ function ee(e) {
194
194
  })[t]
195
195
  ) : e;
196
196
  }
197
- function xe(e, t, r) {
197
+ function Be(e, t, r) {
198
198
  if (r)
199
199
  for (const [n, o] of Object.entries(r)) {
200
200
  let s, i = {};
201
201
  if (Array.isArray(o) ? (s = o[0], i = o[1] || {}) : s = o, t.set(n, {
202
202
  callback: s,
203
203
  options: i,
204
- oldValue: te(e, n)
204
+ oldValue: he(e, n)
205
205
  }), i.immediate)
206
206
  try {
207
- const a = te(e, n);
207
+ const a = he(e, n);
208
208
  s(a, void 0, e);
209
209
  } catch (a) {
210
210
  console.error(`Error in immediate watcher for "${n}":`, a);
211
211
  }
212
212
  }
213
213
  }
214
- function te(e, t) {
214
+ function he(e, t) {
215
215
  return t.split(".").reduce((r, n) => r?.[n], e);
216
216
  }
217
- function we(e, t, r, n) {
217
+ function Re(e, t, r, n) {
218
218
  const o = (i, a) => {
219
219
  if (i === a) return !0;
220
220
  if (typeof i != typeof a || typeof i != "object" || i === null || a === null) return !1;
221
221
  if (Array.isArray(i) && Array.isArray(a))
222
- return i.length !== a.length ? !1 : i.every((y, h) => o(y, a[h]));
222
+ return i.length !== a.length ? !1 : i.every((y, g) => o(y, a[g]));
223
223
  const c = Object.keys(i), f = Object.keys(a);
224
224
  return c.length !== f.length ? !1 : c.every((y) => o(i[y], a[y]));
225
225
  }, s = t.get(r);
@@ -232,13 +232,13 @@ function we(e, t, r, n) {
232
232
  for (const [i, a] of t.entries())
233
233
  if (a.options.deep && r.startsWith(i + "."))
234
234
  try {
235
- const c = te(e, i);
235
+ const c = he(e, i);
236
236
  o(c, a.oldValue) || (a.callback(c, a.oldValue, e), a.oldValue = c);
237
237
  } catch (c) {
238
238
  console.error(`Error in deep watcher for "${i}":`, c);
239
239
  }
240
240
  }
241
- function ke(e, t, r) {
241
+ function Pe(e, t, r) {
242
242
  if (!t.props) return;
243
243
  function n(o, s) {
244
244
  return s === Boolean ? o === "true" : s === Number ? Number(o) : o;
@@ -247,136 +247,136 @@ function ke(e, t, r) {
247
247
  if (s.type === Function && typeof e[o] == "function")
248
248
  r[o] = e[o];
249
249
  else {
250
- const i = e.getAttribute(ne(o));
251
- i !== null ? r[o] = ee(n(i, s.type)) : "default" in s && s.default !== void 0 && (r[o] = ee(s.default));
250
+ const i = e.getAttribute(ye(o));
251
+ i !== null ? r[o] = pe(n(i, s.type)) : "default" in s && s.default !== void 0 && (r[o] = pe(s.default));
252
252
  }
253
253
  });
254
254
  }
255
- function $e(e, t, r, n) {
255
+ function Me(e, t, r, n) {
256
256
  e.onConnected && !r && (e.onConnected(t), n(!0));
257
257
  }
258
- function _e(e, t, r, n, o, s, i, a) {
258
+ function Oe(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 Se(e, t, r, n, o) {
261
+ function We(e, t, r, n, o) {
262
262
  e.onAttributeChanged && e.onAttributeChanged(t, r, n, o);
263
263
  }
264
- function B(e, t) {
264
+ function D(e, t) {
265
265
  if (t && e instanceof HTMLElement) {
266
266
  for (const r in t)
267
267
  t[r] === e && delete t[r];
268
268
  for (const r of Array.from(e.childNodes))
269
- B(r, t);
269
+ D(r, t);
270
270
  }
271
271
  }
272
- function R(e, t) {
272
+ function q(e, t) {
273
273
  return typeof t == "string" ? t.split(".").reduce((r, n) => r?.[n], e) : t;
274
274
  }
275
- function ae(e, t, r) {
275
+ function xe(e, t, r) {
276
276
  const n = t.split("."), o = n.pop();
277
277
  if (!o) return;
278
278
  const s = n.reduce((i, a) => (a in i || (i[a] = {}), i[a]), e);
279
279
  s[o] = r;
280
280
  }
281
- function Ce(e, t, r, n, o, s, i) {
281
+ function Ne(e, t, r, n, o, s, i) {
282
282
  if (!s) return;
283
283
  const a = t.includes("lazy"), c = t.includes("trim"), f = t.includes("number"), y = () => {
284
- const g = s._state || s;
285
- return R(g, e);
286
- }, h = y();
284
+ const p = s._state || s;
285
+ return q(p, e);
286
+ }, g = y();
287
287
  let l = "text";
288
- const v = n?.type;
289
- if (i instanceof HTMLInputElement ? l = v || i.type || "text" : i instanceof HTMLSelectElement ? l = "select" : i instanceof HTMLTextAreaElement && (l = "textarea"), l === "checkbox")
290
- if (Array.isArray(h)) {
291
- const g = i?.getAttribute("value") || n?.value || "", u = h.includes(g);
288
+ const x = n?.type;
289
+ if (i instanceof HTMLInputElement ? l = x || i.type || "text" : i instanceof HTMLSelectElement ? l = "select" : i instanceof HTMLTextAreaElement && (l = "textarea"), l === "checkbox")
290
+ if (Array.isArray(g)) {
291
+ const p = i?.getAttribute("value") || n?.value || "", u = g.includes(p);
292
292
  i && i.checked !== u && (r.checked = u);
293
293
  } else {
294
- const g = i?.getAttribute("true-value") || !0, u = h === g;
294
+ const p = i?.getAttribute("true-value") || !0, u = g === p;
295
295
  i && i.checked !== u && (r.checked = u);
296
296
  }
297
297
  else if (l === "radio") {
298
- const g = n?.value || "", u = h === g;
298
+ const p = n?.value || "", u = g === p;
299
299
  i && i.checked !== u && (r.checked = u);
300
300
  } else if (l === "select")
301
301
  if (i && i.hasAttribute("multiple")) {
302
- const g = i, u = Array.isArray(h) ? h : [];
302
+ const p = i, u = Array.isArray(g) ? g : [];
303
303
  setTimeout(() => {
304
- Array.from(g.options).forEach((p) => {
305
- const w = u.includes(p.value);
306
- p.selected !== w && (p.selected = w);
304
+ Array.from(p.options).forEach((h) => {
305
+ const b = u.includes(h.value);
306
+ h.selected !== b && (h.selected = b);
307
307
  });
308
308
  }, 0);
309
309
  } else
310
310
  setTimeout(() => {
311
- i instanceof HTMLSelectElement && i.value !== String(h) && (i.value = String(h));
311
+ i instanceof HTMLSelectElement && i.value !== String(g) && (i.value = String(g));
312
312
  }, 0);
313
313
  else {
314
- const g = String(h ?? "");
315
- (!i || i.value !== g) && (r.value = h);
314
+ const p = String(g ?? "");
315
+ (!i || i.value !== p) && (r.value = g);
316
316
  }
317
- const x = a || l === "checkbox" || l === "radio" || l === "select" ? "change" : "input", m = (g) => {
318
- if (g.isComposing || o._isComposing || g.isTrusted === !1) return;
319
- const u = g.target;
317
+ const w = a || l === "checkbox" || l === "radio" || l === "select" ? "change" : "input", $ = (p) => {
318
+ if (p.isComposing || o._isComposing || p.isTrusted === !1) return;
319
+ const u = p.target;
320
320
  if (u._modelUpdating) return;
321
- const p = y();
322
- let w = u.value;
321
+ const h = y();
322
+ let b = u.value;
323
323
  if (l === "checkbox")
324
- if (Array.isArray(p)) {
325
- const k = u.getAttribute("value") || "", _ = [...p];
324
+ if (Array.isArray(h)) {
325
+ const k = u.getAttribute("value") || "", _ = [...h];
326
326
  if (u.checked)
327
327
  _.includes(k) || _.push(k);
328
328
  else {
329
- const S = _.indexOf(k);
330
- S > -1 && _.splice(S, 1);
329
+ const C = _.indexOf(k);
330
+ C > -1 && _.splice(C, 1);
331
331
  }
332
- w = _;
332
+ b = _;
333
333
  } else {
334
334
  const k = u.getAttribute("true-value") || !0, _ = u.getAttribute("false-value") || !1;
335
- w = u.checked ? k : _;
335
+ b = u.checked ? k : _;
336
336
  }
337
337
  else if (l === "radio")
338
- w = u.getAttribute("value") || u.value;
338
+ b = u.getAttribute("value") || u.value;
339
339
  else if (l === "select" && u.multiple) {
340
340
  const k = u;
341
- w = Array.from(k.selectedOptions).map(
341
+ b = Array.from(k.selectedOptions).map(
342
342
  (_) => _.value
343
343
  );
344
- } else if (c && (w = w.trim()), f) {
345
- const k = Number(w);
346
- isNaN(k) || (w = k);
344
+ } else if (c && (b = b.trim()), f) {
345
+ const k = Number(b);
346
+ isNaN(k) || (b = k);
347
347
  }
348
- const d = s._state || s, b = R(d, e);
349
- if (Array.isArray(w) && Array.isArray(b) ? JSON.stringify([...w].sort()) !== JSON.stringify([...b].sort()) : w !== b) {
350
- const k = g.target;
351
- k._modelUpdating = !0, ae(d, e, w), setTimeout(() => {
348
+ const d = s._state || s, v = q(d, e);
349
+ if (Array.isArray(b) && Array.isArray(v) ? JSON.stringify([...b].sort()) !== JSON.stringify([...v].sort()) : b !== v) {
350
+ const k = p.target;
351
+ k._modelUpdating = !0, xe(d, e, b), setTimeout(() => {
352
352
  k._modelUpdating = !1;
353
353
  }, 0), s._requestRender && s._requestRender();
354
354
  }
355
355
  };
356
- if (o[x] = m, l === "text" || l === "textarea") {
357
- const g = () => {
356
+ if (o[w] = $, l === "text" || l === "textarea") {
357
+ const p = () => {
358
358
  o._isComposing = !0;
359
- }, u = (p) => {
359
+ }, u = (h) => {
360
360
  o._isComposing = !1;
361
- const w = p.target;
361
+ const b = h.target;
362
362
  setTimeout(() => {
363
- if (w) {
364
- let d = w.value;
363
+ if (b) {
364
+ let d = b.value;
365
365
  if (c && (d = d.trim()), f) {
366
366
  const _ = Number(d);
367
367
  isNaN(_) || (d = _);
368
368
  }
369
- const b = s._state || s, $ = R(b, e);
370
- (Array.isArray(d) && Array.isArray($) ? JSON.stringify([...d].sort()) !== JSON.stringify([...$].sort()) : d !== $) && (w && (w._modelUpdating = !0, setTimeout(() => {
371
- w._modelUpdating = !1;
372
- }, 0)), ae(b, e, d), s._requestRender && s._requestRender());
369
+ const v = s._state || s, m = q(v, e);
370
+ (Array.isArray(d) && Array.isArray(m) ? JSON.stringify([...d].sort()) !== JSON.stringify([...m].sort()) : d !== m) && (b && (b._modelUpdating = !0, setTimeout(() => {
371
+ b._modelUpdating = !1;
372
+ }, 0)), xe(v, e, d), s._requestRender && s._requestRender());
373
373
  }
374
374
  }, 0);
375
375
  };
376
- o.compositionstart = g, o.compositionend = u;
376
+ o.compositionstart = p, o.compositionend = u;
377
377
  }
378
378
  }
379
- function Ee(e, t, r, n) {
379
+ function De(e, t, r, n) {
380
380
  if (n) {
381
381
  if (typeof e == "object" && e !== null)
382
382
  for (const [o, s] of Object.entries(e))
@@ -390,14 +390,14 @@ function Ee(e, t, r, n) {
390
390
  return;
391
391
  }
392
392
  } catch {
393
- const o = R(n, e);
393
+ const o = q(n, e);
394
394
  r[e] = o;
395
395
  }
396
396
  }
397
397
  }
398
- function Ae(e, t, r) {
398
+ function qe(e, t, r) {
399
399
  if (!r) return;
400
- const n = R(r, e), o = t.style || "", s = n ? "" : "none";
400
+ const n = q(r, e), o = t.style || "", s = n ? "" : "none";
401
401
  if (o) {
402
402
  const i = o.split(";").filter(Boolean), a = i.findIndex(
403
403
  (c) => c.trim().startsWith("display:")
@@ -406,19 +406,19 @@ function Ae(e, t, r) {
406
406
  } else
407
407
  t.style = `display: ${s}`;
408
408
  }
409
- function Te(e, t, r) {
409
+ function He(e, t, r) {
410
410
  if (!r) return;
411
- const n = R(r, e);
411
+ const n = q(r, e);
412
412
  let o = [];
413
413
  typeof n == "string" ? o = [n] : Array.isArray(n) ? o = n.filter(Boolean) : typeof n == "object" && (o = Object.entries(n).filter(([, a]) => !!a).flatMap(([a]) => a.split(/\s+/).filter(Boolean)));
414
414
  const s = t.class || "", i = s ? `${s} ${o.join(" ")}`.trim() : o.join(" ");
415
415
  i && (t.class = i);
416
416
  }
417
- function Le(e, t, r) {
417
+ function Ie(e, t, r) {
418
418
  let n;
419
419
  if (typeof e == "string") {
420
420
  if (!r) return;
421
- n = R(r, e);
421
+ n = q(r, e);
422
422
  } else
423
423
  n = e;
424
424
  let o = "";
@@ -457,21 +457,21 @@ function Le(e, t, r) {
457
457
  "min-height",
458
458
  "max-height"
459
459
  ];
460
- let h = String(c);
461
- typeof c == "number" && y.includes(f) && (h = `${c}px`), i.push(`${f}: ${h}`);
460
+ let g = String(c);
461
+ typeof c == "number" && y.includes(f) && (g = `${c}px`), i.push(`${f}: ${g}`);
462
462
  }
463
463
  o = i.join("; ") + (i.length > 0 ? ";" : "");
464
464
  }
465
465
  const s = t.style || "";
466
466
  t.style = s + (s && !s.endsWith(";") ? "; " : "") + o;
467
467
  }
468
- function ge(e, t, r, n) {
468
+ function Ee(e, t, r, n) {
469
469
  const o = {}, s = { ...n || {} }, i = {};
470
470
  for (const [a, c] of Object.entries(e)) {
471
471
  const { value: f, modifiers: y } = c;
472
472
  switch (a) {
473
473
  case "model":
474
- Ce(
474
+ Ne(
475
475
  typeof f == "string" ? f : String(f),
476
476
  y,
477
477
  o,
@@ -482,45 +482,45 @@ function ge(e, t, r, n) {
482
482
  );
483
483
  break;
484
484
  case "bind":
485
- Ee(f, o, s, t);
485
+ De(f, o, s, t);
486
486
  break;
487
487
  case "show":
488
- Ae(f, s, t);
488
+ qe(f, s, t);
489
489
  break;
490
490
  case "class":
491
- Te(f, s, t);
491
+ He(f, s, t);
492
492
  break;
493
493
  case "style":
494
- Le(f, s, t);
494
+ Ie(f, s, t);
495
495
  break;
496
496
  }
497
497
  }
498
498
  return { props: o, attrs: s, listeners: i };
499
499
  }
500
- function re(e, t) {
500
+ function ge(e, t) {
501
501
  if (Array.isArray(e)) {
502
502
  const s = /* @__PURE__ */ new Set();
503
503
  return e.map((i) => {
504
504
  if (!i || typeof i != "object") return i;
505
505
  let a = i.props?.key ?? i.key;
506
506
  if (!a) {
507
- const h = i.tag || "node", l = i.props?.attrs?.id ?? i.props?.attrs?.name ?? i.props?.attrs?.["data-key"] ?? "";
508
- a = l ? `${t}:${h}:${l}` : `${t}:${h}`;
507
+ const g = i.tag || "node", l = i.props?.attrs?.id ?? i.props?.attrs?.name ?? i.props?.attrs?.["data-key"] ?? "";
508
+ a = l ? `${t}:${g}:${l}` : `${t}:${g}`;
509
509
  }
510
510
  let c = a, f = 1;
511
511
  for (; s.has(c); )
512
512
  c = `${a}#${f++}`;
513
513
  s.add(c);
514
514
  let y = i.children;
515
- return Array.isArray(y) && (y = re(y, c)), { ...i, key: c, children: y };
515
+ return Array.isArray(y) && (y = ge(y, c)), { ...i, key: c, children: y };
516
516
  });
517
517
  }
518
518
  const r = e;
519
519
  let n = r.props?.key ?? r.key ?? t, o = r.children;
520
- return Array.isArray(o) && (o = re(o, n)), { ...r, key: n, children: o };
520
+ return Array.isArray(o) && (o = ge(o, n)), { ...r, key: n, children: o };
521
521
  }
522
- function je(e, t, r, n) {
523
- const o = r.directives ?? {}, s = ge(
522
+ function Ue(e, t, r, n) {
523
+ const o = r.directives ?? {}, s = Ee(
524
524
  o,
525
525
  n,
526
526
  e,
@@ -535,192 +535,192 @@ function je(e, t, r, n) {
535
535
  ...s.attrs
536
536
  }, c = t.props ?? {}, f = i;
537
537
  for (const l in { ...c, ...f }) {
538
- const v = c[l], x = f[l];
539
- v !== x && (l === "value" && (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement) ? e.value !== x && (e.value = x ?? "") : l === "checked" && e instanceof HTMLInputElement ? e.checked = !!x : l.startsWith("on") && typeof x == "function" ? (typeof v == "function" && e.removeEventListener(l.slice(2).toLowerCase(), v), e.addEventListener(l.slice(2).toLowerCase(), x)) : x == null || x === !1 ? e.removeAttribute(l) : e.setAttribute(l, String(x)));
538
+ const x = c[l], w = f[l];
539
+ x !== w && (l === "value" && (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement) ? e.value !== w && (e.value = w ?? "") : l === "checked" && e instanceof HTMLInputElement ? e.checked = !!w : l.startsWith("on") && typeof w == "function" ? (typeof x == "function" && e.removeEventListener(l.slice(2).toLowerCase(), x), e.addEventListener(l.slice(2).toLowerCase(), w)) : w == null || w === !1 ? e.removeAttribute(l) : e.setAttribute(l, String(w)));
540
540
  }
541
- for (const [l, v] of Object.entries(
541
+ for (const [l, x] of Object.entries(
542
542
  s.listeners || {}
543
543
  ))
544
- e.addEventListener(l, v);
545
- const y = t.attrs ?? {}, h = a;
546
- for (const l in { ...y, ...h }) {
547
- const v = y[l], x = h[l];
548
- v !== x && (x == null || x === !1 ? e.removeAttribute(l) : e.setAttribute(l, String(x)));
544
+ e.addEventListener(l, x);
545
+ const y = t.attrs ?? {}, g = a;
546
+ for (const l in { ...y, ...g }) {
547
+ const x = y[l], w = g[l];
548
+ x !== w && (w == null || w === !1 ? e.removeAttribute(l) : e.setAttribute(l, String(w)));
549
549
  }
550
550
  }
551
- function j(e, t, r) {
551
+ function P(e, t, r) {
552
552
  if (typeof e == "string")
553
553
  return document.createTextNode(e);
554
554
  if (e.tag === "#text") {
555
- const h = document.createTextNode(
555
+ const g = document.createTextNode(
556
556
  typeof e.children == "string" ? e.children : ""
557
557
  );
558
- return e.key != null && (h.key = e.key), h;
558
+ return e.key != null && (g.key = e.key), g;
559
559
  }
560
560
  if (e.tag === "#anchor") {
561
- const h = e, l = Array.isArray(h.children) ? h.children : [], v = document.createTextNode(""), x = document.createTextNode("");
562
- h.key != null && (v.key = `${h.key}:start`, x.key = `${h.key}:end`), h._startNode = v, h._endNode = x;
563
- const m = document.createDocumentFragment();
564
- m.appendChild(v);
565
- for (const g of l) {
566
- const u = j(g, t);
567
- m.appendChild(u);
561
+ const g = e, l = Array.isArray(g.children) ? g.children : [], x = document.createTextNode(""), w = document.createTextNode("");
562
+ g.key != null && (x.key = `${g.key}:start`, w.key = `${g.key}:end`), g._startNode = x, g._endNode = w;
563
+ const $ = document.createDocumentFragment();
564
+ $.appendChild(x);
565
+ for (const p of l) {
566
+ const u = P(p, t);
567
+ $.appendChild(u);
568
568
  }
569
- return m.appendChild(x), m;
569
+ return $.appendChild(w), $;
570
570
  }
571
571
  const n = document.createElement(e.tag);
572
572
  e.key != null && (n.key = e.key);
573
- const { props: o = {}, attrs: s = {}, directives: i = {} } = e.props ?? {}, a = ge(i, t, n, s), c = {
573
+ const { props: o = {}, attrs: s = {}, directives: i = {} } = e.props ?? {}, a = Ee(i, t, n, s), c = {
574
574
  ...o,
575
575
  ...a.props
576
576
  }, f = {
577
577
  ...s,
578
578
  ...a.attrs
579
579
  };
580
- for (const h in f) {
581
- const l = f[h];
582
- if (typeof h != "string" || /\[object Object\]/.test(h)) {
583
- typeof window < "u" && window.console && console.warn("Skipping invalid attribute key:", h, l);
580
+ for (const g in f) {
581
+ const l = f[g];
582
+ if (typeof g != "string" || /\[object Object\]/.test(g)) {
583
+ typeof window < "u" && window.console && console.warn("Skipping invalid attribute key:", g, l);
584
584
  continue;
585
585
  }
586
- typeof l == "boolean" ? l && n.setAttribute(h, "") : l != null && n.setAttribute(h, l);
586
+ typeof l == "boolean" ? l && n.setAttribute(g, "") : l != null && n.setAttribute(g, l);
587
587
  }
588
- for (const h in c) {
589
- const l = c[h];
590
- if (typeof h != "string" || /\[object Object\]/.test(h)) {
591
- typeof window < "u" && window.console && console.warn("Skipping invalid prop key:", h, l);
588
+ for (const g in c) {
589
+ const l = c[g];
590
+ if (typeof g != "string" || /\[object Object\]/.test(g)) {
591
+ typeof window < "u" && window.console && console.warn("Skipping invalid prop key:", g, l);
592
592
  continue;
593
593
  }
594
- if (h === "value" && (n instanceof HTMLInputElement || n instanceof HTMLTextAreaElement || n instanceof HTMLSelectElement))
594
+ if (g === "value" && (n instanceof HTMLInputElement || n instanceof HTMLTextAreaElement || n instanceof HTMLSelectElement))
595
595
  n.value = l ?? "";
596
- else if (h === "checked" && n instanceof HTMLInputElement)
596
+ else if (g === "checked" && n instanceof HTMLInputElement)
597
597
  n.checked = !!l;
598
- else if (h.startsWith("on") && typeof l == "function")
599
- n.addEventListener(h.slice(2).toLowerCase(), l);
598
+ else if (g.startsWith("on") && typeof l == "function")
599
+ n.addEventListener(g.slice(2).toLowerCase(), l);
600
600
  else {
601
- if (h.startsWith("on") && l === void 0)
601
+ if (g.startsWith("on") && l === void 0)
602
602
  continue;
603
- l == null || l === !1 ? n.removeAttribute(h) : n.setAttribute(h, String(l));
603
+ l == null || l === !1 ? n.removeAttribute(g) : n.setAttribute(g, String(l));
604
604
  }
605
605
  }
606
- for (const [h, l] of Object.entries(
606
+ for (const [g, l] of Object.entries(
607
607
  a.listeners || {}
608
608
  ))
609
- n.addEventListener(h, l);
609
+ n.addEventListener(g, l);
610
610
  const y = e.props?.ref ?? (e.props?.props && e.props.props.ref);
611
611
  if (typeof e != "string" && y && r && (r[y] = n), Array.isArray(e.children))
612
- for (const h of e.children)
613
- n.appendChild(j(h, t, r));
612
+ for (const g of e.children)
613
+ n.appendChild(P(g, t, r));
614
614
  else typeof e.children == "string" && (n.textContent = e.children);
615
615
  return n;
616
616
  }
617
- function ze(e, t, r, n, o) {
617
+ function Fe(e, t, r, n, o) {
618
618
  if (typeof r == "string") {
619
619
  e.textContent !== r && (e.textContent = r);
620
620
  return;
621
621
  }
622
622
  if (!Array.isArray(r)) return;
623
623
  const s = Array.from(e.childNodes), i = Array.isArray(t) ? t : [], a = /* @__PURE__ */ new Map();
624
- for (const v of i)
625
- v && v.key != null && a.set(v.key, v);
624
+ for (const x of i)
625
+ x && x.key != null && a.set(x.key, x);
626
626
  const c = /* @__PURE__ */ new Map();
627
- for (const v of s) {
628
- const x = v.key;
629
- x != null && c.set(x, v);
627
+ for (const x of s) {
628
+ const w = x.key;
629
+ w != null && c.set(w, x);
630
630
  }
631
631
  const f = /* @__PURE__ */ new Set();
632
632
  let y = e.firstChild;
633
- function h(v, x) {
634
- let m = v;
635
- for (; m && (f.add(m), m !== x); )
636
- m = m.nextSibling;
633
+ function g(x, w) {
634
+ let $ = x;
635
+ for (; $ && (f.add($), $ !== w); )
636
+ $ = $.nextSibling;
637
637
  }
638
- function l(v, x, m, g) {
638
+ function l(x, w, $, p) {
639
639
  const u = [];
640
- let p = v.nextSibling;
641
- for (; p && p !== x; )
642
- u.push(p), p = p.nextSibling;
643
- const w = Array.isArray(m) ? m : [];
644
- if (g.some((b) => b && b.key != null) || w.some((b) => b && b.key != null)) {
645
- const b = /* @__PURE__ */ new Map(), $ = /* @__PURE__ */ new Map();
646
- for (const S of w)
647
- S && S.key != null && b.set(S.key, S);
648
- for (const S of u) {
649
- const C = S.key;
650
- C != null && $.set(C, S);
640
+ let h = x.nextSibling;
641
+ for (; h && h !== w; )
642
+ u.push(h), h = h.nextSibling;
643
+ const b = Array.isArray($) ? $ : [];
644
+ if (p.some((v) => v && v.key != null) || b.some((v) => v && v.key != null)) {
645
+ const v = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map();
646
+ for (const C of b)
647
+ C && C.key != null && v.set(C.key, C);
648
+ for (const C of u) {
649
+ const E = C.key;
650
+ E != null && m.set(E, C);
651
651
  }
652
652
  const k = /* @__PURE__ */ new Set();
653
- let _ = v.nextSibling;
654
- for (const S of g) {
655
- let C;
656
- if (S.key != null && $.has(S.key)) {
657
- const A = b.get(S.key);
658
- C = I(
659
- $.get(S.key),
660
- A,
661
- S,
653
+ let _ = x.nextSibling;
654
+ for (const C of p) {
655
+ let E;
656
+ if (C.key != null && m.has(C.key)) {
657
+ const j = v.get(C.key);
658
+ E = Y(
659
+ m.get(C.key),
660
+ j,
661
+ C,
662
662
  n
663
- ), k.add(C), C !== _ && e.contains(C) && e.insertBefore(C, _);
663
+ ), k.add(E), E !== _ && e.contains(E) && e.insertBefore(E, _);
664
664
  } else
665
- C = j(S, n), e.insertBefore(C, _), k.add(C);
666
- _ = C.nextSibling;
665
+ E = P(C, n), e.insertBefore(E, _), k.add(E);
666
+ _ = E.nextSibling;
667
667
  }
668
- for (const S of u)
669
- !k.has(S) && e.contains(S) && e.removeChild(S);
668
+ for (const C of u)
669
+ !k.has(C) && e.contains(C) && e.removeChild(C);
670
670
  } else {
671
- const b = Math.min(
672
- w.length,
673
- g.length
671
+ const v = Math.min(
672
+ b.length,
673
+ p.length
674
674
  );
675
- for (let $ = 0; $ < b; $++) {
676
- const k = w[$], _ = g[$], S = I(u[$], k, _, n);
677
- S !== u[$] && (e.insertBefore(S, u[$]), e.removeChild(u[$]));
675
+ for (let m = 0; m < v; m++) {
676
+ const k = b[m], _ = p[m], C = Y(u[m], k, _, n);
677
+ C !== u[m] && (e.insertBefore(C, u[m]), e.removeChild(u[m]));
678
678
  }
679
- for (let $ = b; $ < g.length; $++)
680
- e.insertBefore(j(g[$], n), x);
681
- for (let $ = b; $ < u.length; $++)
682
- e.removeChild(u[$]);
679
+ for (let m = v; m < p.length; m++)
680
+ e.insertBefore(P(p[m], n), w);
681
+ for (let m = v; m < u.length; m++)
682
+ e.removeChild(u[m]);
683
683
  }
684
684
  }
685
- for (const v of r) {
686
- let x;
687
- if (v.tag === "#anchor") {
688
- const m = v.key, g = `${m}:start`, u = `${m}:end`;
689
- let p = c.get(g), w = c.get(u);
690
- const d = Array.isArray(v.children) ? v.children : [];
691
- if (p || (p = document.createTextNode(""), p.key = g), w || (w = document.createTextNode(""), w.key = u), v._startNode = p, v._endNode = w, !e.contains(p) || !e.contains(w)) {
692
- e.insertBefore(p, y);
693
- for (const b of d)
694
- e.insertBefore(j(b, n), y);
695
- e.insertBefore(w, y);
685
+ for (const x of r) {
686
+ let w;
687
+ if (x.tag === "#anchor") {
688
+ const $ = x.key, p = `${$}:start`, u = `${$}:end`;
689
+ let h = c.get(p), b = c.get(u);
690
+ const d = Array.isArray(x.children) ? x.children : [];
691
+ if (h || (h = document.createTextNode(""), h.key = p), b || (b = document.createTextNode(""), b.key = u), x._startNode = h, x._endNode = b, !e.contains(h) || !e.contains(b)) {
692
+ e.insertBefore(h, y);
693
+ for (const v of d)
694
+ e.insertBefore(P(v, n), y);
695
+ e.insertBefore(b, y);
696
696
  } else
697
697
  l(
698
- p,
699
- w,
700
- a.get(m)?.children,
698
+ h,
699
+ b,
700
+ a.get($)?.children,
701
701
  d
702
702
  );
703
- h(p, w), y = w.nextSibling;
703
+ g(h, b), y = b.nextSibling;
704
704
  continue;
705
705
  }
706
- if (v.key != null && c.has(v.key)) {
707
- const m = a.get(v.key);
708
- x = I(
709
- c.get(v.key),
710
- m,
711
- v,
706
+ if (x.key != null && c.has(x.key)) {
707
+ const $ = a.get(x.key);
708
+ w = Y(
709
+ c.get(x.key),
710
+ $,
711
+ x,
712
712
  n,
713
713
  o
714
- ), f.add(x), x !== y && e.contains(x) && (y && !e.contains(y) && (y = null), e.insertBefore(x, y));
714
+ ), f.add(w), w !== y && e.contains(w) && (y && !e.contains(y) && (y = null), e.insertBefore(w, y));
715
715
  } else
716
- x = j(v, n, o), y && !e.contains(y) && (y = null), e.insertBefore(x, y), f.add(x);
717
- y = x.nextSibling;
716
+ w = P(x, n, o), y && !e.contains(y) && (y = null), e.insertBefore(w, y), f.add(w);
717
+ y = w.nextSibling;
718
718
  }
719
- for (const v of s)
720
- !f.has(v) && e.contains(v) && (B(v, o), e.removeChild(v));
719
+ for (const x of s)
720
+ !f.has(x) && e.contains(x) && (D(x, o), e.removeChild(x));
721
721
  }
722
- function I(e, t, r, n, o) {
723
- if (t && typeof t != "string" && t.props?.ref && o && B(e, o), t === r) return e;
722
+ function Y(e, t, r, n, o) {
723
+ if (t && typeof t != "string" && t.props?.ref && o && D(e, o), t === r) return e;
724
724
  if (typeof r == "string") {
725
725
  if (e.nodeType === Node.TEXT_NODE)
726
726
  return e.textContent !== r && (e.textContent = r), e;
@@ -734,20 +734,20 @@ function I(e, t, r, n, o) {
734
734
  i.key != null && (c.key = `${i.key}:start`, f.key = `${i.key}:end`), i._startNode = c, i._endNode = f;
735
735
  const y = document.createDocumentFragment();
736
736
  y.appendChild(c);
737
- for (const h of a) {
738
- const l = j(h, n);
737
+ for (const g of a) {
738
+ const l = P(g, n);
739
739
  y.appendChild(l);
740
740
  }
741
741
  return y.appendChild(f), e.parentNode?.replaceChild(y, e), c;
742
742
  }
743
743
  if (!r) {
744
- B(e, o);
744
+ D(e, o);
745
745
  const i = document.createComment("removed");
746
746
  return e.parentNode?.replaceChild(i, e), i;
747
747
  }
748
748
  if (!t || typeof t == "string") {
749
- B(e, o);
750
- const i = j(r, n, o);
749
+ D(e, o);
750
+ const i = P(r, n, o);
751
751
  return typeof r != "string" && r.props?.ref && o && (o[r.props.ref] = i), e.parentNode?.replaceChild(i, e), i;
752
752
  }
753
753
  if (r.tag === "#anchor") {
@@ -756,52 +756,52 @@ function I(e, t, r, n, o) {
756
756
  const f = document.createDocumentFragment();
757
757
  f.appendChild(a);
758
758
  for (const y of i)
759
- f.appendChild(j(y, n));
759
+ f.appendChild(P(y, n));
760
760
  return f.appendChild(c), e.parentNode?.replaceChild(f, e), a;
761
761
  }
762
762
  if (typeof t != "string" && typeof r != "string" && t.tag === r.tag && t.key === r.key) {
763
763
  const i = e;
764
- return je(i, t.props || {}, r.props || {}, n), ze(i, t.children, r.children, n, o), typeof r != "string" && r.props?.ref && o && (o[r.props.ref] = i), i;
764
+ return Ue(i, t.props || {}, r.props || {}, n), Fe(i, t.children, r.children, n, o), typeof r != "string" && r.props?.ref && o && (o[r.props.ref] = i), i;
765
765
  }
766
- B(e, o);
767
- const s = j(r, n, o);
766
+ D(e, o);
767
+ const s = P(r, n, o);
768
768
  return typeof r != "string" && r.props?.ref && o && (o[r.props.ref] = s), e.parentNode?.replaceChild(s, e), s;
769
769
  }
770
- function Be(e, t, r, n) {
770
+ function Ke(e, t, r, n) {
771
771
  let o;
772
772
  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 = {
773
773
  tag: "div",
774
774
  key: "__anchor_root__",
775
775
  props: { attrs: { "data-anchor-block-root": "", key: "__anchor_root__" } },
776
776
  children: [o]
777
- }), o = re(o, String(o.key ?? "root"));
777
+ }), o = ge(o, String(o.key ?? "root"));
778
778
  const s = e._prevVNode ?? null, i = e._prevDom ?? e.firstChild ?? null;
779
779
  let a;
780
- s && i ? typeof s != "string" && typeof o != "string" && s.tag === o.tag && s.key === o.key ? a = I(i, s, o, r, n) : (a = j(o, r, n), e.replaceChild(a, i)) : (a = j(o, r, n), e.firstChild ? e.replaceChild(a, e.firstChild) : e.appendChild(a));
780
+ s && i ? typeof s != "string" && typeof o != "string" && s.tag === o.tag && s.key === o.key ? a = Y(i, s, o, r, n) : (a = P(o, r, n), e.replaceChild(a, i)) : (a = P(o, r, n), e.firstChild ? e.replaceChild(a, e.firstChild) : e.appendChild(a));
781
781
  const c = [];
782
782
  for (let f = 0; f < e.childNodes.length; f++) {
783
783
  const y = e.childNodes[f];
784
- y !== a && y.nodeName !== "STYLE" && (B(y, n), c.push(y));
784
+ y !== a && y.nodeName !== "STYLE" && (D(y, n), c.push(y));
785
785
  }
786
786
  c.forEach((f) => e.removeChild(f)), e._prevVNode = o, e._prevDom = a;
787
787
  }
788
- function ye(e, ...t) {
788
+ function Ae(e, ...t) {
789
789
  let r = "";
790
790
  for (let n = 0; n < e.length; n++)
791
791
  r += e[n], n < t.length && (r += t[n]);
792
792
  return r;
793
793
  }
794
- function me(e) {
794
+ function Te(e) {
795
795
  return e.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\s+/g, " ").replace(/\s*([{}:;,>+~])\s*/g, "$1").replace(/;}/g, "}").trim();
796
796
  }
797
- let H = null;
798
- function le() {
799
- return H || (H = new CSSStyleSheet(), H.replaceSync(me(Ne))), H;
797
+ let Q = null;
798
+ function we() {
799
+ return Q || (Q = new CSSStyleSheet(), Q.replaceSync(Te(Je))), Q;
800
800
  }
801
- function Re(e) {
801
+ function Ve(e) {
802
802
  return e.replace(/url\s*\(\s*['"]?javascript:[^)]*\)/gi, "").replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi, "").replace(/expression\s*\([^)]*\)/gi, "");
803
803
  }
804
- const Ne = ye`
804
+ const Je = Ae`
805
805
  :host, *, ::before, ::after {
806
806
  all: isolate;
807
807
  box-sizing: border-box;
@@ -859,7 +859,7 @@ const Ne = ye`
859
859
  sup { top: -.5em }
860
860
  [disabled], [aria-disabled=true] { cursor: not-allowed }
861
861
  [hidden] { display: none }
862
- `, Me = {
862
+ `, Ze = {
863
863
  gray: {
864
864
  50: "var(--color-gray-50, #f9fafb)",
865
865
  100: "var(--color-gray-100, #f3f4f6)",
@@ -994,7 +994,7 @@ const Ne = ye`
994
994
  },
995
995
  white: { DEFAULT: "var(--color-white, #ffffff)" },
996
996
  black: { DEFAULT: "var(--color-black, #000000)" }
997
- }, V = {
997
+ }, se = {
998
998
  /* Display */
999
999
  block: "display:block;",
1000
1000
  inline: "display:inline;",
@@ -1175,7 +1175,7 @@ const Ne = ye`
1175
1175
  "z-30": "z-index:30;",
1176
1176
  "z-40": "z-index:40;",
1177
1177
  "z-50": "z-index:50;"
1178
- }, Oe = "0.25rem", ce = {
1178
+ }, Qe = "0.25rem", ke = {
1179
1179
  m: ["margin"],
1180
1180
  mx: ["margin-inline"],
1181
1181
  my: ["margin-block"],
@@ -1207,44 +1207,43 @@ const Ne = ye`
1207
1207
  "gap-x": ["column-gap"],
1208
1208
  "gap-y": ["row-gap"]
1209
1209
  };
1210
- function L(e, t) {
1211
- let r = 0;
1212
- for (let n = 0; n < e.length; n++) {
1213
- const o = e[n];
1214
- if (o === "[") r++;
1215
- else if (o === "]") r--;
1216
- else if (r === 0 && (o === ">" || o === "+" || o === "~" || o === " "))
1217
- return e.slice(0, n) + t + e.slice(n);
1210
+ function R(e, t) {
1211
+ let r = 0, n = 0;
1212
+ for (let o = 0; o < e.length; o++) {
1213
+ const s = e[o];
1214
+ if (s === "[") r++;
1215
+ else if (s === "]" && r > 0) r--;
1216
+ else if (s === "(") n++;
1217
+ else if (s === ")" && n > 0) n--;
1218
+ else if (r === 0 && n === 0 && (s === ">" || s === "+" || s === "~" || s === " "))
1219
+ return e.slice(0, o) + t + e.slice(o);
1218
1220
  }
1219
1221
  return e + t;
1220
1222
  }
1221
- const Pe = {
1222
- // State variants
1223
+ const Xe = {
1223
1224
  before: (e, t) => `${e}::before{${t}}`,
1224
1225
  after: (e, t) => `${e}::after{${t}}`,
1225
- hover: (e, t) => `${L(e, ":hover")}{${t}}`,
1226
- focus: (e, t) => `${L(e, ":focus")}{${t}}`,
1227
- active: (e, t) => `${L(e, ":active")}{${t}}`,
1228
- disabled: (e, t) => `${L(e, ":disabled")}{${t}}`,
1229
- visited: (e, t) => `${L(e, ":visited")}{${t}}`,
1230
- checked: (e, t) => `${L(e, ":checked")}{${t}}`,
1231
- first: (e, t) => `${L(e, ":first-child")}{${t}}`,
1232
- last: (e, t) => `${L(e, ":last-child")}{${t}}`,
1233
- odd: (e, t) => `${L(e, ":nth-child(odd)")}{${t}}`,
1234
- even: (e, t) => `${L(e, ":nth-child(even)")}{${t}}`,
1235
- "focus-within": (e, t) => `${L(e, ":focus-within")}{${t}}`,
1236
- "focus-visible": (e, t) => `${L(e, ":focus-visible")}{${t}}`,
1237
- // Group variants
1226
+ hover: (e, t) => `${R(e, ":hover")}{${t}}`,
1227
+ focus: (e, t) => `${R(e, ":focus")}{${t}}`,
1228
+ active: (e, t) => `${R(e, ":active")}{${t}}`,
1229
+ disabled: (e, t) => `${R(e, ":disabled")}{${t}}`,
1230
+ visited: (e, t) => `${R(e, ":visited")}{${t}}`,
1231
+ checked: (e, t) => `${R(e, ":checked")}{${t}}`,
1232
+ first: (e, t) => `${R(e, ":first-child")}{${t}}`,
1233
+ last: (e, t) => `${R(e, ":last-child")}{${t}}`,
1234
+ odd: (e, t) => `${R(e, ":nth-child(odd)")}{${t}}`,
1235
+ even: (e, t) => `${R(e, ":nth-child(even)")}{${t}}`,
1236
+ "focus-within": (e, t) => `${R(e, ":focus-within")}{${t}}`,
1237
+ "focus-visible": (e, t) => `${R(e, ":focus-visible")}{${t}}`,
1238
1238
  "group-hover": (e, t) => `.group:hover ${e}{${t}}`,
1239
1239
  "group-focus": (e, t) => `.group:focus ${e}{${t}}`,
1240
1240
  "group-active": (e, t) => `.group:active ${e}{${t}}`,
1241
1241
  "group-disabled": (e, t) => `.group:disabled ${e}{${t}}`,
1242
- // Peer variants
1243
1242
  "peer-hover": (e, t) => `.peer:hover ~ ${e}{${t}}`,
1244
1243
  "peer-focus": (e, t) => `.peer:focus ~ ${e}{${t}}`,
1245
1244
  "peer-checked": (e, t) => `.peer:checked ~ ${e}{${t}}`,
1246
1245
  "peer-disabled": (e, t) => `.peer:disabled ~ ${e}{${t}}`
1247
- }, J = {
1246
+ }, ae = {
1248
1247
  // Responsive
1249
1248
  sm: "(min-width:640px)",
1250
1249
  md: "(min-width:768px)",
@@ -1253,23 +1252,23 @@ const Pe = {
1253
1252
  "2xl": "(min-width:1536px)",
1254
1253
  // Dark mode (now plain string)
1255
1254
  dark: "(prefers-color-scheme: dark)"
1256
- }, Q = ["sm", "md", "lg", "xl", "2xl"];
1257
- function Z(e) {
1255
+ }, le = ["sm", "md", "lg", "xl", "2xl"];
1256
+ function ce(e) {
1258
1257
  const t = e.startsWith("-"), n = (t ? e.slice(1) : e).split("-");
1259
1258
  if (n.length < 2) return null;
1260
1259
  const o = n.slice(0, -1).join("-"), s = n[n.length - 1], i = parseFloat(s);
1261
- if (Number.isNaN(i) || !ce[o]) return null;
1260
+ if (Number.isNaN(i) || !ke[o]) return null;
1262
1261
  const a = t ? "-" : "";
1263
- return ce[o].map((c) => `${c}:calc(${a}${Oe} * ${i});`).join("");
1262
+ return ke[o].map((c) => `${c}:calc(${a}${Qe} * ${i});`).join("");
1264
1263
  }
1265
- function fe(e) {
1264
+ function $e(e) {
1266
1265
  const t = e.replace("#", ""), r = parseInt(t, 16), n = r >> 16 & 255, o = r >> 8 & 255, s = r & 255;
1267
1266
  return `${n} ${o} ${s}`;
1268
1267
  }
1269
- function We(e) {
1268
+ function Ye(e) {
1270
1269
  const t = /^(bg|text|border|decoration|shadow|outline|caret|accent|fill|stroke)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);
1271
1270
  if (!t) return null;
1272
- const [, r, n, o = "DEFAULT"] = t, s = Me[n]?.[o];
1271
+ const [, r, n, o = "DEFAULT"] = t, s = Ze[n]?.[o];
1273
1272
  return s ? `${{
1274
1273
  bg: "background-color",
1275
1274
  decoration: "text-decoration-color",
@@ -1284,47 +1283,56 @@ function We(e) {
1284
1283
  stroke: "stroke-color"
1285
1284
  }[r]}:${s};` : null;
1286
1285
  }
1287
- function De(e) {
1286
+ function Ge(e) {
1288
1287
  const [t, r] = e.split("/");
1289
1288
  if (!r) return { base: t };
1290
1289
  const n = parseInt(r, 10);
1291
1290
  return isNaN(n) || n < 0 || n > 100 ? { base: t } : { base: t, opacity: n / 100 };
1292
1291
  }
1293
- function X(e) {
1294
- const { base: t, opacity: r } = De(e), n = We(t);
1292
+ function fe(e) {
1293
+ const { base: t, opacity: r } = Ge(e), n = Ye(t);
1295
1294
  if (n) {
1296
1295
  if (r !== void 0) {
1297
1296
  const s = /#([0-9a-f]{6})/i.exec(n);
1298
1297
  if (s) {
1299
- const i = fe(s[0]);
1298
+ const i = $e(s[0]);
1300
1299
  return n.replace(/#([0-9a-f]{6})/i, `rgb(${i} / ${r})`);
1301
1300
  }
1302
1301
  }
1303
1302
  return n;
1304
1303
  }
1305
- const o = F(t);
1304
+ const o = G(t);
1306
1305
  if (o && r !== void 0) {
1307
1306
  const s = /#([0-9a-f]{6})/i.exec(o);
1308
1307
  if (s) {
1309
- const i = fe(s[0]);
1308
+ const i = $e(s[0]);
1310
1309
  return o.replace(/#([0-9a-f]{6})/i, `rgb(${i} / ${r})`);
1311
1310
  }
1312
1311
  }
1313
1312
  return o;
1314
1313
  }
1315
- function Y(e) {
1314
+ function ue(e) {
1316
1315
  const t = /^opacity-(\d{1,3})$/.exec(e);
1317
1316
  if (!t) return null;
1318
1317
  const r = parseInt(t[1], 10);
1319
1318
  return r < 0 || r > 100 ? null : `opacity:${r / 100};`;
1320
1319
  }
1321
- function F(e) {
1320
+ function G(e) {
1321
+ if (e.startsWith("[") && e.endsWith("]") && !e.includes("-[")) {
1322
+ const o = e.slice(1, -1).trim().match(/^([a-zA-Z][a-zA-Z0-9-]*)\s*:(.*)$/);
1323
+ if (o) {
1324
+ const s = o[1].trim();
1325
+ let i = o[2].trim();
1326
+ return i = i.replace(/url\('\s*([^']*?)\s*'\)/g, 'url("$1")'), i = i.replace(/^'([^']*)'$/g, '"$1"'), `${s}:${i};`;
1327
+ }
1328
+ return null;
1329
+ }
1322
1330
  const t = e.indexOf("-["), r = e.endsWith("]");
1323
1331
  if (t > 0 && r) {
1324
1332
  const n = e.slice(0, t);
1325
1333
  let o = e.slice(t + 2, -1);
1326
1334
  o = o.replace(/_/g, " ");
1327
- const i = {
1335
+ const s = {
1328
1336
  bg: "background-color",
1329
1337
  text: "color",
1330
1338
  p: "padding",
@@ -1363,12 +1371,15 @@ function F(e) {
1363
1371
  weight: "font-weight",
1364
1372
  leading: "line-height",
1365
1373
  z: "z-index"
1366
- }[n] ?? n.replace(/_/g, "-");
1374
+ };
1375
+ if (n === "rotate")
1376
+ return `transform:rotate(${o});`;
1377
+ const i = s[n] ?? n.replace(/_/g, "-");
1367
1378
  if (i && o) return `${i}:${o};`;
1368
1379
  }
1369
1380
  return null;
1370
1381
  }
1371
- function ue(e) {
1382
+ function et(e) {
1372
1383
  if (e.startsWith("[") && e.endsWith("]")) {
1373
1384
  const r = e.slice(1, -1);
1374
1385
  return r.includes("&") ? r : e;
@@ -1380,123 +1391,198 @@ function ue(e) {
1380
1391
  }
1381
1392
  return null;
1382
1393
  }
1383
- function He(e) {
1394
+ function tt(e) {
1384
1395
  return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, "\\$1");
1385
1396
  }
1386
- function qe(e) {
1387
- const t = /class\s*=\s*["']([^"']+)["']/g, r = [];
1397
+ function rt(e) {
1398
+ const t = /class\s*=\s*(['"])(.*?)\1/g, r = [];
1388
1399
  let n;
1389
1400
  for (; n = t.exec(e); ) {
1390
- const o = n[1].match(/(?:\[[^\]]+\]:[^\s]+|[^\s]+)/g);
1391
- o && r.push(...o);
1401
+ const o = n[2].split(/\s+/).filter(Boolean);
1402
+ o.length && r.push(...o);
1392
1403
  }
1393
1404
  return r.filter(Boolean);
1394
1405
  }
1395
- const de = /* @__PURE__ */ new Map(), Ie = 16;
1396
- function Fe(e) {
1397
- const t = Date.now(), r = de.get(e);
1398
- if (r && t - r.timestamp < Ie) return r.css;
1399
- const n = qe(e), o = new Set(n), s = [], i = [], a = [], c = [], f = {};
1400
- function y(m, g = !1) {
1401
- const u = (g ? "dark|" : "") + m;
1402
- if (u in f) return f[u];
1403
- const p = v(m, g);
1404
- return f[u] = p, p;
1405
- }
1406
- function h(m) {
1407
- const g = m.some((p) => Q.includes(p)), u = m.includes("dark");
1408
- return m.length === 0 ? 1 : !g && !u ? 2 : g && !u ? 3 : 4;
1409
- }
1410
- function l(m) {
1411
- const g = [];
1412
- let u = "", p = 0;
1413
- for (let w = 0; w < m.length; w++) {
1414
- const d = m[w];
1415
- d === "[" && p++, d === "]" && p > 0 && p--, d === ":" && p === 0 ? (g.push(u), u = "") : u += d;
1406
+ const Se = /* @__PURE__ */ new Map(), nt = 16;
1407
+ function ot(e) {
1408
+ const t = Date.now(), r = Se.get(e);
1409
+ if (r && t - r.timestamp < nt) return r.css;
1410
+ const n = rt(e), o = new Set(n), s = [], i = [], a = [], c = [], f = {};
1411
+ function y(p, u = !1) {
1412
+ const h = (u ? "dark|" : "") + p;
1413
+ if (h in f) return f[h];
1414
+ const b = w(p, u);
1415
+ return f[h] = b, b;
1416
+ }
1417
+ function g(p) {
1418
+ const u = p.some((b) => le.includes(b)), h = p.includes("dark");
1419
+ return p.length === 0 ? 1 : !u && !h ? 2 : u && !h ? 3 : 4;
1420
+ }
1421
+ function l(p) {
1422
+ const u = [];
1423
+ let h = "", b = 0, d = 0;
1424
+ for (let v = 0; v < p.length; v++) {
1425
+ const m = p[v];
1426
+ m === "[" ? b++ : m === "]" && b > 0 ? b-- : m === "(" ? d++ : m === ")" && d > 0 && d--, m === ":" && b === 0 && d === 0 ? (u.push(h), h = "") : h += m;
1416
1427
  }
1417
- return u && g.push(u), g;
1418
- }
1419
- function v(m, g = !1) {
1420
- const u = l(m), p = u.find(
1421
- (E) => V[E] || Z(E) || Y(E) || X(E) || F(E)
1422
- );
1423
- if (!p) return null;
1424
- const w = V[p] ?? Z(p) ?? Y(p) ?? X(p) ?? F(p);
1425
- if (!w) return null;
1426
- const d = u.indexOf(p);
1427
- let b = d >= 0 ? u.slice(0, d) : [];
1428
- g && (b = b.filter((E) => E !== "dark"));
1429
- const $ = b.find((E) => ue(E)), k = `.${He(m)}`;
1430
- let _;
1431
- const S = w;
1432
- if ($) {
1433
- const E = ue($);
1434
- E ? E.includes("&") ? _ = E.replace(/&/g, k) : _ = `${E}${k}` : _ = k;
1435
- } else
1436
- _ = k;
1437
- for (const E of b) {
1438
- if (Q.includes(E) || E === "dark" || E === $) continue;
1439
- const ie = Pe[E];
1440
- typeof ie == "function" && (_ = ie(_, S).replace(/\{.*$/, ""));
1428
+ return h && u.push(h), u;
1429
+ }
1430
+ function x(p) {
1431
+ switch (p) {
1432
+ case "hover":
1433
+ return ":hover";
1434
+ case "focus":
1435
+ return ":focus";
1436
+ case "active":
1437
+ return ":active";
1438
+ case "visited":
1439
+ return ":visited";
1440
+ case "disabled":
1441
+ return ":disabled";
1442
+ case "checked":
1443
+ return ":checked";
1444
+ case "first":
1445
+ return ":first-child";
1446
+ case "last":
1447
+ return ":last-child";
1448
+ case "odd":
1449
+ return ":nth-child(odd)";
1450
+ case "even":
1451
+ return ":nth-child(even)";
1452
+ case "focus-within":
1453
+ return ":focus-within";
1454
+ case "focus-visible":
1455
+ return ":focus-visible";
1456
+ default:
1457
+ return null;
1441
1458
  }
1442
- let C = `${_}{${S}}`;
1443
- const A = b.filter((E) => Q.includes(E)), T = A.length ? A[A.length - 1] : null, oe = b.includes("dark");
1444
- return g && T ? C = `@media (prefers-color-scheme: dark) and ${J[T]}{${C}}` : g ? C = `@media (prefers-color-scheme: dark){${C}}` : oe && T ? C = `@media (prefers-color-scheme: dark) and ${J[T]}{${C}}` : oe ? C = `@media (prefers-color-scheme: dark){${C}}` : T && (C = `@media ${J[T]}{${C}}`), C;
1445
1459
  }
1446
- for (const m of o) {
1447
- const g = m.split(":"), u = g.find(
1448
- (b) => V[b] || Z(b) || Y(b) || X(b) || F(b)
1460
+ function w(p, u = !1) {
1461
+ const h = l(p);
1462
+ (p.includes("mask-image") || p.includes("sm: hover") || p.includes("sm:hover") || p.includes("mask.svg")) && console.error("DEBUG generateRule:", p, h);
1463
+ let b = !1, d = h.find((S) => (S.startsWith("!") && (b = !0, S = S.slice(1)), se[S] || ce(S) || ue(S) || fe(S) || G(S)));
1464
+ if (!d) return null;
1465
+ const v = d.replace(/^!/, ""), m = se[v] ?? ce(v) ?? ue(v) ?? fe(v) ?? G(v);
1466
+ if (!m) return null;
1467
+ const k = h.indexOf(d);
1468
+ let _ = k >= 0 ? h.slice(0, k) : [];
1469
+ u && (_ = _.filter((S) => S !== "dark"));
1470
+ const C = `.${tt(p)}`, E = "__SUBJECT__", j = b ? m.replace(/;$/, " !important;") : m;
1471
+ let A = E;
1472
+ const re = [];
1473
+ for (const S of _)
1474
+ S.startsWith("group-") ? (A = `.group:${S.slice(6)} ${A}`, re.push(S)) : S.startsWith("peer-") && (A = A.replace(E, `.peer:${S.slice(5)}~${E}`), re.push(S));
1475
+ _ = _.filter((S) => !re.includes(S));
1476
+ const ne = [], me = [];
1477
+ let N = null;
1478
+ for (const S of _) {
1479
+ if (S === "dark" || le.includes(S)) continue;
1480
+ const O = et(S);
1481
+ if (O) {
1482
+ N = O;
1483
+ continue;
1484
+ }
1485
+ const L = x(S);
1486
+ if (L) {
1487
+ N ? me.push(L) : ne.push(L);
1488
+ continue;
1489
+ }
1490
+ const B = Xe[S];
1491
+ typeof B == "function" && (A = B(A, j).split("{")[0]);
1492
+ }
1493
+ function je(S, O) {
1494
+ if (!O) return S;
1495
+ let L = 0, B = 0;
1496
+ if (S.length && (S[0] === ">" || S[0] === "+" || S[0] === "~" || S[0] === " ")) {
1497
+ let T = 1;
1498
+ for (; T < S.length && S[T] === " "; ) T++;
1499
+ for (; T < S.length; T++) {
1500
+ const z = S[T];
1501
+ if (z === "[" ? L++ : z === "]" && L > 0 ? L-- : z === "(" ? B++ : z === ")" && B > 0 && B--, L === 0 && B === 0 && (S[T] === ">" || S[T] === "+" || S[T] === "~" || S[T] === " "))
1502
+ return S.slice(0, T) + O + S.slice(T);
1503
+ }
1504
+ return S + O;
1505
+ }
1506
+ for (let T = 0; T < S.length; T++) {
1507
+ const z = S[T];
1508
+ if (z === "[" ? L++ : z === "]" && L > 0 ? L-- : z === "(" ? B++ : z === ")" && B > 0 && B--, L === 0 && B === 0 && (z === ">" || z === "+" || z === "~" || z === " "))
1509
+ return S.slice(0, T) + O + S.slice(T);
1510
+ }
1511
+ return S + O;
1512
+ }
1513
+ const oe = ne.join(""), K = me.join("");
1514
+ if (N)
1515
+ if (N.includes("&")) {
1516
+ const S = N.indexOf("&"), O = N.slice(0, S), L = N.slice(S + 1), B = E + oe, T = A;
1517
+ if (ne.length === 0)
1518
+ A = T.replace(E, O + B + K + L);
1519
+ else {
1520
+ const z = je(L, K);
1521
+ A = T.replace(E, O + B + z);
1522
+ }
1523
+ } else
1524
+ A = A.replace(E, `${N}${E + oe}`), K && (A = A.replace(E, `${E}${K}`));
1525
+ else
1526
+ A = E + oe + K;
1527
+ A = A.replace(new RegExp(E, "g"), C);
1528
+ let M = `${A}{${j}}`;
1529
+ const ie = _.filter((S) => le.includes(S)), H = ie.length ? ie[ie.length - 1] : null, be = _.includes("dark");
1530
+ return u && H ? M = `@media (prefers-color-scheme: dark) and ${ae[H]}{${M}}` : u ? M = `@media (prefers-color-scheme: dark){${M}}` : be && H ? M = `@media (prefers-color-scheme: dark) and ${ae[H]}{${M}}` : be ? M = `@media (prefers-color-scheme: dark){${M}}` : H && (M = `@media ${ae[H]}{${M}}`), M;
1531
+ }
1532
+ for (const p of o) {
1533
+ const u = l(p), h = u.find(
1534
+ (m) => se[m] || ce(m) || ue(m) || fe(m) || G(m)
1449
1535
  );
1450
- if (!u) continue;
1451
- const p = g.indexOf(u), w = p >= 0 ? g.slice(0, p) : [], d = h(w);
1452
- if (d === 4) {
1453
- const b = y(m, !0);
1454
- b && c.push(b);
1536
+ if (!h) continue;
1537
+ const b = u.indexOf(h), d = b >= 0 ? u.slice(0, b) : [], v = g(d);
1538
+ if (v === 4) {
1539
+ const m = y(p, !0);
1540
+ m && c.push(m);
1455
1541
  } else {
1456
- const b = y(m);
1457
- b && (d === 1 ? s.push(b) : d === 2 ? i.push(b) : d === 3 && a.push(b));
1542
+ const m = y(p);
1543
+ m && (v === 1 ? s.push(m) : v === 2 ? i.push(m) : v === 3 && a.push(m));
1458
1544
  }
1459
1545
  }
1460
- const x = [...s, ...i, ...a, ...c].join("");
1461
- return de.set(e, { css: x, timestamp: t }), x;
1546
+ const $ = [...s, ...i, ...a, ...c].join("");
1547
+ return Se.set(e, { css: $, timestamp: t }), $;
1462
1548
  }
1463
- const W = [];
1464
- function Ke(e, t, r, n, o, s, i, a) {
1549
+ const J = [];
1550
+ function it(e, t, r, n, o, s, i, a) {
1465
1551
  if (e) {
1466
- W.push(r);
1552
+ J.push(r);
1467
1553
  try {
1468
1554
  if (t.loadingTemplate && r.isLoading) {
1469
- N(e, t.loadingTemplate(r), r, n, o);
1555
+ I(e, t.loadingTemplate(r), r, n, o);
1470
1556
  return;
1471
1557
  }
1472
1558
  if (t.errorTemplate && r.hasError) {
1473
- r.error instanceof Error && N(e, t.errorTemplate(r.error, r), r, n, o);
1559
+ r.error instanceof Error && I(e, t.errorTemplate(r.error, r), r, n, o);
1474
1560
  return;
1475
1561
  }
1476
1562
  const c = t.render(r);
1477
1563
  if (c instanceof Promise) {
1478
1564
  s(!0), c.then((f) => {
1479
- s(!1), i(null), N(e, f, r, n, o), a(e.innerHTML);
1565
+ s(!1), i(null), I(e, f, r, n, o), a(e.innerHTML);
1480
1566
  }).catch((f) => {
1481
- s(!1), i(f), t.errorTemplate && N(e, t.errorTemplate(f, r), r, n, o);
1482
- }), t.loadingTemplate && N(e, t.loadingTemplate(r), r, n, o);
1567
+ s(!1), i(f), t.errorTemplate && I(e, t.errorTemplate(f, r), r, n, o);
1568
+ }), t.loadingTemplate && I(e, t.loadingTemplate(r), r, n, o);
1483
1569
  return;
1484
1570
  }
1485
- N(e, c, r, n, o), a(e.innerHTML);
1571
+ I(e, c, r, n, o), a(e.innerHTML);
1486
1572
  } finally {
1487
- W.pop();
1573
+ J.pop();
1488
1574
  }
1489
1575
  }
1490
1576
  }
1491
- function N(e, t, r, n, o) {
1492
- e && (Be(
1577
+ function I(e, t, r, n, o) {
1578
+ e && (Ke(
1493
1579
  e,
1494
1580
  Array.isArray(t) ? t : [t],
1495
1581
  r,
1496
1582
  n
1497
1583
  ), o(e.innerHTML));
1498
1584
  }
1499
- function Ue(e, t, r, n, o, s, i) {
1585
+ function st(e, t, r, n, o, s, i) {
1500
1586
  if (s !== null && clearTimeout(s), Date.now() - t < 16) {
1501
1587
  if (o(r + 1), r > 10) {
1502
1588
  console.warn("Potential infinite render loop detected. Skipping render."), i(null);
@@ -1509,32 +1595,32 @@ function Ue(e, t, r, n, o, s, i) {
1509
1595
  }, 0);
1510
1596
  i(c);
1511
1597
  }
1512
- function Ve(e, t, r, n, o, s) {
1598
+ function at(e, t, r, n, o, s) {
1513
1599
  if (!e) return;
1514
- const i = Fe(n);
1600
+ const i = ot(n);
1515
1601
  if (!t.style && (!i || i.trim() === "")) {
1516
- s(null), e.adoptedStyleSheets = [le()];
1602
+ s(null), e.adoptedStyleSheets = [we()];
1517
1603
  return;
1518
1604
  }
1519
1605
  let a = "";
1520
1606
  t.style && (typeof t.style == "string" ? a = t.style : typeof t.style == "function" && (a = t.style(r)));
1521
- let c = Re(`${a}
1607
+ let c = Ve(`${a}
1522
1608
  ${i}
1523
1609
  `);
1524
- c = me(c);
1610
+ c = Te(c);
1525
1611
  let f = o;
1526
- f || (f = new CSSStyleSheet()), (f.cssRules.length === 0 || f.toString() !== c) && f.replaceSync(c), e.adoptedStyleSheets = [le(), f], s(f);
1612
+ f || (f = new CSSStyleSheet()), (f.cssRules.length === 0 || f.toString() !== c) && f.replaceSync(c), e.adoptedStyleSheets = [we(), f], s(f);
1527
1613
  }
1528
- const Je = /* @__PURE__ */ new Map();
1529
- function pe(e, t, r) {
1530
- let n = ne(e);
1614
+ const lt = /* @__PURE__ */ new Map();
1615
+ function _e(e, t, r) {
1616
+ let n = ye(e);
1531
1617
  n.includes("-") || (n = `cer-${n}`);
1532
1618
  let o;
1533
1619
  typeof t == "function" ? o = { ...r, render: t } : o = t, typeof o.onError != "function" && (o.onError = (s, i) => {
1534
1620
  console.error(`[${n}] Error:`, s, i);
1535
- }), Je.set(n, o), typeof window < "u" && !customElements.get(n) && customElements.define(n, Qe(o));
1621
+ }), lt.set(n, o), typeof window < "u" && !customElements.get(n) && customElements.define(n, ct(o));
1536
1622
  }
1537
- function Qe(e) {
1623
+ function ct(e) {
1538
1624
  if (!e.render)
1539
1625
  throw new Error(
1540
1626
  "Component must have a render function"
@@ -1621,7 +1707,7 @@ function Qe(e) {
1621
1707
  }
1622
1708
  connectedCallback() {
1623
1709
  this._runLogicWithinErrorBoundary(e, () => {
1624
- $e(
1710
+ Me(
1625
1711
  e,
1626
1712
  this.context,
1627
1713
  this._mounted,
@@ -1633,7 +1719,7 @@ function Qe(e) {
1633
1719
  }
1634
1720
  disconnectedCallback() {
1635
1721
  this._runLogicWithinErrorBoundary(e, () => {
1636
- _e(
1722
+ Oe(
1637
1723
  e,
1638
1724
  this.context,
1639
1725
  this._listeners,
@@ -1657,7 +1743,7 @@ function Qe(e) {
1657
1743
  }
1658
1744
  attributeChangedCallback(t, r, n) {
1659
1745
  this._runLogicWithinErrorBoundary(e, () => {
1660
- this._applyProps(e), Se(
1746
+ this._applyProps(e), We(
1661
1747
  e,
1662
1748
  t,
1663
1749
  r,
@@ -1667,7 +1753,7 @@ function Qe(e) {
1667
1753
  });
1668
1754
  }
1669
1755
  static get observedAttributes() {
1670
- return e.props ? Object.keys(e.props).map(ne) : [];
1756
+ return e.props ? Object.keys(e.props).map(ye) : [];
1671
1757
  }
1672
1758
  _applyComputed(t) {
1673
1759
  this._runLogicWithinErrorBoundary(e, () => {
@@ -1675,7 +1761,7 @@ function Qe(e) {
1675
1761
  Object.defineProperty(this.context, r, {
1676
1762
  get: () => {
1677
1763
  const o = n(this.context);
1678
- return ee(o);
1764
+ return pe(o);
1679
1765
  },
1680
1766
  enumerable: !0
1681
1767
  });
@@ -1685,7 +1771,7 @@ function Qe(e) {
1685
1771
  // --- Render ---
1686
1772
  _render(t) {
1687
1773
  this._runLogicWithinErrorBoundary(t, () => {
1688
- Ke(
1774
+ it(
1689
1775
  this.shadowRoot,
1690
1776
  t,
1691
1777
  this.context,
@@ -1708,7 +1794,7 @@ function Qe(e) {
1708
1794
  }
1709
1795
  _requestRender() {
1710
1796
  this._runLogicWithinErrorBoundary(this._cfg, () => {
1711
- Ue(
1797
+ st(
1712
1798
  () => this._render(this._cfg),
1713
1799
  this._lastRenderTime,
1714
1800
  this._renderCount,
@@ -1728,7 +1814,7 @@ function Qe(e) {
1728
1814
  // --- Style ---
1729
1815
  _applyStyle(t, r) {
1730
1816
  this._runLogicWithinErrorBoundary(t, () => {
1731
- Ve(
1817
+ at(
1732
1818
  this.shadowRoot,
1733
1819
  t,
1734
1820
  this.context,
@@ -1767,11 +1853,11 @@ function Qe(e) {
1767
1853
  "splice",
1768
1854
  "sort",
1769
1855
  "reverse"
1770
- ].includes(a) ? function(...h) {
1771
- const l = f.apply(i, h);
1856
+ ].includes(a) ? function(...g) {
1857
+ const l = f.apply(i, g);
1772
1858
  if (!n._initializing) {
1773
- const v = s || "root";
1774
- n._triggerWatchers(v, i), n._render(t);
1859
+ const x = s || "root";
1860
+ n._triggerWatchers(x, i), n._render(t);
1775
1861
  }
1776
1862
  return l;
1777
1863
  } : f;
@@ -1814,7 +1900,7 @@ function Qe(e) {
1814
1900
  }
1815
1901
  _initWatchers(t) {
1816
1902
  this._runLogicWithinErrorBoundary(t, () => {
1817
- xe(
1903
+ Be(
1818
1904
  this.context,
1819
1905
  this._watchers,
1820
1906
  t.watch || {}
@@ -1822,12 +1908,12 @@ function Qe(e) {
1822
1908
  });
1823
1909
  }
1824
1910
  _triggerWatchers(t, r) {
1825
- we(this.context, this._watchers, t, r);
1911
+ Re(this.context, this._watchers, t, r);
1826
1912
  }
1827
1913
  _applyProps(t) {
1828
1914
  this._runLogicWithinErrorBoundary(t, () => {
1829
1915
  try {
1830
- ke(this, t, this.context);
1916
+ Pe(this, t, this.context);
1831
1917
  } catch (r) {
1832
1918
  this._hasError = !0, t.onError && t.onError(r, this.context), t.errorFallback && this.shadowRoot && (this.shadowRoot.innerHTML = t.errorFallback(r, this.context));
1833
1919
  }
@@ -1835,102 +1921,102 @@ function Qe(e) {
1835
1921
  }
1836
1922
  };
1837
1923
  }
1838
- function P(e, t = {}, r, n) {
1924
+ function V(e, t = {}, r, n) {
1839
1925
  const o = n ?? t.key;
1840
1926
  return { tag: e, key: o, props: t, children: r };
1841
1927
  }
1842
- function K(e) {
1928
+ function ee(e) {
1843
1929
  return !!e && typeof e == "object" && (e.type === "AnchorBlock" || e.tag === "#anchor");
1844
1930
  }
1845
- function q(e) {
1846
- return typeof e == "object" && e !== null && "tag" in e && !K(e);
1931
+ function X(e) {
1932
+ return typeof e == "object" && e !== null && "tag" in e && !ee(e);
1847
1933
  }
1848
- function Ze(e, t) {
1934
+ function ft(e, t) {
1849
1935
  return e.key != null ? e : { ...e, key: t };
1850
1936
  }
1851
- function Xe(e, t = [], r = {}) {
1937
+ function ut(e, t = [], r = {}) {
1852
1938
  const n = {}, o = {}, s = {}, i = /([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;
1853
1939
  let a;
1854
1940
  for (; a = i.exec(e); ) {
1855
- const c = a[1], f = a[2], y = (a[4] || a[6]) ?? "", h = y.match(/^{{(\d+)}}$/);
1856
- let l = h ? t[Number(h[1])] ?? null : y;
1857
- h || (l === "true" ? l = !0 : l === "false" ? l = !1 : l === "null" ? l = null : isNaN(Number(l)) || (l = Number(l)));
1858
- const v = ["model", "bind", "show", "class", "style"];
1941
+ const c = a[1], f = a[2], y = (a[4] || a[6]) ?? "", g = y.match(/^{{(\d+)}}$/);
1942
+ let l = g ? t[Number(g[1])] ?? null : y;
1943
+ g || (l === "true" ? l = !0 : l === "false" ? l = !1 : l === "null" ? l = null : isNaN(Number(l)) || (l = Number(l)));
1944
+ const x = ["model", "bind", "show", "class", "style"];
1859
1945
  if (c === ":") {
1860
- const [x, ...m] = f.split(".");
1861
- if (v.includes(x)) {
1862
- const g = [...m];
1863
- s[x] = {
1946
+ const [w, ...$] = f.split(".");
1947
+ if (x.includes(w)) {
1948
+ const p = [...$];
1949
+ s[w] = {
1864
1950
  value: l,
1865
- modifiers: g
1951
+ modifiers: p
1866
1952
  };
1867
1953
  } else
1868
1954
  o[f] = l;
1869
1955
  } else if (c === "@") {
1870
- const x = "on" + f.charAt(0).toUpperCase() + f.slice(1);
1871
- n[x] = typeof l == "function" ? l : typeof r[l] == "function" ? r[l] : void 0;
1956
+ const w = "on" + f.charAt(0).toUpperCase() + f.slice(1);
1957
+ n[w] = typeof l == "function" ? l : typeof r[l] == "function" ? r[l] : void 0;
1872
1958
  } else f === "ref" ? n.ref = l : o[f] = l;
1873
1959
  }
1874
1960
  return { props: n, attrs: o, directives: s };
1875
1961
  }
1876
- function Ye(e, t, r) {
1877
- const n = W.length > 0 ? W[W.length - 1] : void 0, o = r ?? n;
1878
- function s(d, b) {
1879
- return P("#text", {}, d, b);
1962
+ function dt(e, t, r) {
1963
+ const n = J.length > 0 ? J[J.length - 1] : void 0, o = r ?? n;
1964
+ function s(d, v) {
1965
+ return V("#text", {}, d, v);
1880
1966
  }
1881
1967
  let i = "";
1882
1968
  for (let d = 0; d < e.length; d++)
1883
1969
  i += e[d], d < t.length && (i += `{{${d}}}`);
1884
1970
  const a = /<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g, c = [];
1885
- let f, y = [], h = null, l = {}, v, x = 0, m = [];
1886
- function g(d) {
1887
- !d || typeof d != "object" || K(d) || (d.props || d.attrs ? (d.props && (l.props || (l.props = {}), Object.assign(l.props, d.props)), d.attrs && (l.attrs || (l.attrs = {}), Object.keys(d.attrs).forEach((b) => {
1888
- if (b === "style" && l.attrs.style) {
1889
- const $ = l.attrs.style.replace(
1971
+ let f, y = [], g = null, l = {}, x, w = 0, $ = [];
1972
+ function p(d) {
1973
+ !d || typeof d != "object" || ee(d) || (d.props || d.attrs ? (d.props && (l.props || (l.props = {}), Object.assign(l.props, d.props)), d.attrs && (l.attrs || (l.attrs = {}), Object.keys(d.attrs).forEach((v) => {
1974
+ if (v === "style" && l.attrs.style) {
1975
+ const m = l.attrs.style.replace(
1890
1976
  /;?\s*$/,
1891
1977
  ""
1892
1978
  ), k = d.attrs.style.replace(/^;?\s*/, "");
1893
- l.attrs.style = $ + "; " + k;
1894
- } else if (b === "class" && l.attrs.class) {
1895
- const $ = l.attrs.class.trim().split(/\s+/).filter(Boolean), k = d.attrs.class.trim().split(/\s+/).filter(Boolean), _ = [
1896
- .../* @__PURE__ */ new Set([...$, ...k])
1979
+ l.attrs.style = m + "; " + k;
1980
+ } else if (v === "class" && l.attrs.class) {
1981
+ const m = l.attrs.class.trim().split(/\s+/).filter(Boolean), k = d.attrs.class.trim().split(/\s+/).filter(Boolean), _ = [
1982
+ .../* @__PURE__ */ new Set([...m, ...k])
1897
1983
  ];
1898
1984
  l.attrs.class = _.join(" ");
1899
1985
  } else
1900
- l.attrs[b] = d.attrs[b];
1986
+ l.attrs[v] = d.attrs[v];
1901
1987
  }))) : (l.props || (l.props = {}), Object.assign(l.props, d)));
1902
1988
  }
1903
- function u(d, b) {
1904
- const $ = h ? y : m;
1905
- if (K(d)) {
1906
- const k = d.key ?? b;
1989
+ function u(d, v) {
1990
+ const m = g ? y : $;
1991
+ if (ee(d)) {
1992
+ const k = d.key ?? v;
1907
1993
  let _ = d.children;
1908
- $.push({
1994
+ m.push({
1909
1995
  ...d,
1910
1996
  key: k,
1911
1997
  children: _
1912
1998
  });
1913
1999
  return;
1914
2000
  }
1915
- if (q(d)) {
1916
- $.push(Ze(d, void 0));
2001
+ if (X(d)) {
2002
+ m.push(ft(d, void 0));
1917
2003
  return;
1918
2004
  }
1919
2005
  if (Array.isArray(d)) {
1920
2006
  if (d.length === 0) return;
1921
2007
  for (let k = 0; k < d.length; k++) {
1922
2008
  const _ = d[k];
1923
- K(_) || q(_) || Array.isArray(_) ? u(_, `${b}-${k}`) : _ !== null && typeof _ == "object" ? g(_) : $.push(s(String(_), `${b}-${k}`));
2009
+ ee(_) || X(_) || Array.isArray(_) ? u(_, `${v}-${k}`) : _ !== null && typeof _ == "object" ? p(_) : m.push(s(String(_), `${v}-${k}`));
1924
2010
  }
1925
2011
  return;
1926
2012
  }
1927
2013
  if (d !== null && typeof d == "object") {
1928
- g(d);
2014
+ p(d);
1929
2015
  return;
1930
2016
  }
1931
- $.push(s(String(d), b));
2017
+ m.push(s(String(d), v));
1932
2018
  }
1933
- const p = /* @__PURE__ */ new Set([
2019
+ const h = /* @__PURE__ */ new Set([
1934
2020
  "area",
1935
2021
  "base",
1936
2022
  "br",
@@ -1948,52 +2034,52 @@ function Ye(e, t, r) {
1948
2034
  ]);
1949
2035
  for (; f = a.exec(i); )
1950
2036
  if (f[1]) {
1951
- const d = f[1], b = f[0][1] === "/", $ = f[0][f[0].length - 2] === "/" || p.has(d), {
2037
+ const d = f[1], v = f[0][1] === "/", m = f[0][f[0].length - 2] === "/" || h.has(d), {
1952
2038
  props: k,
1953
2039
  attrs: _,
1954
- directives: S
1955
- } = Xe(f[2] || "", t, o), C = { props: {}, attrs: {} };
1956
- for (const A in k) C.props[A] = k[A];
1957
- for (const A in _) C.attrs[A] = _[A];
1958
- if (Object.keys(S).length > 0 && (C.directives = { ...S }), b) {
1959
- const A = P(
1960
- h,
2040
+ directives: C
2041
+ } = ut(f[2] || "", t, o), E = { props: {}, attrs: {} };
2042
+ for (const j in k) E.props[j] = k[j];
2043
+ for (const j in _) E.attrs[j] = _[j];
2044
+ if (Object.keys(C).length > 0 && (E.directives = { ...C }), v) {
2045
+ const j = V(
2046
+ g,
1961
2047
  l,
1962
- y.length === 1 && q(y[0]) && y[0].tag === "#text" ? typeof y[0].children == "string" ? y[0].children : "" : y.length ? y : void 0,
1963
- v
1964
- ), T = c.pop();
1965
- T ? (h = T.tag, l = T.props, v = T.key, y = T.children, y.push(A)) : (m.push(A), h = null, l = {}, v = void 0, y = []);
1966
- } else $ ? h ? y.push(P(d, C, void 0, void 0)) : m.push(P(d, C, void 0, void 0)) : (h && c.push({
1967
- tag: h,
2048
+ y.length === 1 && X(y[0]) && y[0].tag === "#text" ? typeof y[0].children == "string" ? y[0].children : "" : y.length ? y : void 0,
2049
+ x
2050
+ ), A = c.pop();
2051
+ A ? (g = A.tag, l = A.props, x = A.key, y = A.children, y.push(j)) : ($.push(j), g = null, l = {}, x = void 0, y = []);
2052
+ } else m ? g ? y.push(V(d, E, void 0, void 0)) : $.push(V(d, E, void 0, void 0)) : (g && c.push({
2053
+ tag: g,
1968
2054
  props: l,
1969
2055
  children: y,
1970
- key: v
1971
- }), h = d, l = C, y = []);
2056
+ key: x
2057
+ }), g = d, l = E, y = []);
1972
2058
  } else if (typeof f[3] < "u") {
1973
- const d = Number(f[3]), b = t[d], $ = `interp-${d}`;
1974
- u(b, $);
2059
+ const d = Number(f[3]), v = t[d], m = `interp-${d}`;
2060
+ u(v, m);
1975
2061
  } else if (f[4]) {
1976
- const d = f[4], b = h ? y : m, $ = d.split(/({{\d+}})/);
1977
- for (const k of $) {
2062
+ const d = f[4], v = g ? y : $, m = d.split(/({{\d+}})/);
2063
+ for (const k of m) {
1978
2064
  if (!k) continue;
1979
2065
  const _ = k.match(/^{{(\d+)}}$/);
1980
2066
  if (_) {
1981
- const S = Number(_[1]), C = t[S], A = `interp-${S}`;
1982
- u(C, A);
2067
+ const C = Number(_[1]), E = t[C], j = `interp-${C}`;
2068
+ u(E, j);
1983
2069
  } else {
1984
- const S = `text-${x++}`;
1985
- b.push(s(k, S));
2070
+ const C = `text-${w++}`;
2071
+ v.push(s(k, C));
1986
2072
  }
1987
2073
  }
1988
2074
  }
1989
- const w = m.filter((d) => q(d) && d.tag === "#text" ? typeof d.children == "string" && d.children.trim() !== "" : !0);
1990
- return w.length === 1 ? w[0] : w.length > 1 ? w : P("div", {}, "", "fallback-root");
2075
+ const b = $.filter((d) => X(d) && d.tag === "#text" ? typeof d.children == "string" && d.children.trim() !== "" : !0);
2076
+ return b.length === 1 ? b[0] : b.length > 1 ? b : V("div", {}, "", "fallback-root");
1991
2077
  }
1992
- function M(e, ...t) {
2078
+ function U(e, ...t) {
1993
2079
  const r = t[t.length - 1], n = typeof r == "object" && r && !Array.isArray(r) ? r : void 0;
1994
- return Ye(e, t, n);
2080
+ return dt(e, t, n);
1995
2081
  }
1996
- const he = (e) => e ? typeof URLSearchParams > "u" ? {} : Object.fromEntries(new URLSearchParams(e)) : {}, z = (e, t) => {
2082
+ const Ce = (e) => e ? typeof URLSearchParams > "u" ? {} : Object.fromEntries(new URLSearchParams(e)) : {}, W = (e, t) => {
1997
2083
  for (const r of e) {
1998
2084
  const n = [], o = r.path.replace(/:[^/]+/g, (a) => (n.push(a.slice(1)), "([^/]+)")), s = new RegExp(`^${o}$`), i = t.match(s);
1999
2085
  if (i) {
@@ -2004,140 +2090,140 @@ const he = (e) => e ? typeof URLSearchParams > "u" ? {} : Object.fromEntries(new
2004
2090
  }
2005
2091
  }
2006
2092
  return { route: null, params: {} };
2007
- }, G = {};
2008
- async function Ge(e) {
2093
+ }, de = {};
2094
+ async function pt(e) {
2009
2095
  if (e.component) return e.component;
2010
2096
  if (e.load) {
2011
- if (G[e.path]) return G[e.path];
2097
+ if (de[e.path]) return de[e.path];
2012
2098
  try {
2013
2099
  const t = await e.load();
2014
- return G[e.path] = t.default, t.default;
2100
+ return de[e.path] = t.default, t.default;
2015
2101
  } catch {
2016
2102
  throw new Error(`Failed to load component for route: ${e.path}`);
2017
2103
  }
2018
2104
  }
2019
2105
  throw new Error(`No component or loader defined for route: ${e.path}`);
2020
2106
  }
2021
- function et(e) {
2107
+ function ht(e) {
2022
2108
  const { routes: t, base: r = "", initialUrl: n } = e;
2023
2109
  let o, s, i, a, c, f, y;
2024
- const h = async (m, g) => {
2025
- const u = t.find((p) => z([p], m.path).route !== null);
2110
+ const g = async ($, p) => {
2111
+ const u = t.find((h) => W([h], $.path).route !== null);
2026
2112
  if (u?.beforeEnter)
2027
2113
  try {
2028
- const p = await u.beforeEnter(m, g);
2029
- return typeof p == "string" ? (await x(p, !0), !1) : p !== !1;
2030
- } catch (p) {
2031
- return console.error("beforeEnter error", p), !1;
2114
+ const h = await u.beforeEnter($, p);
2115
+ return typeof h == "string" ? (await w(h, !0), !1) : h !== !1;
2116
+ } catch (h) {
2117
+ return console.error("beforeEnter error", h), !1;
2032
2118
  }
2033
2119
  return !0;
2034
- }, l = async (m, g) => {
2035
- const u = t.find((p) => z([p], m.path).route !== null);
2120
+ }, l = async ($, p) => {
2121
+ const u = t.find((h) => W([h], $.path).route !== null);
2036
2122
  if (u?.onEnter)
2037
2123
  try {
2038
- const p = await u.onEnter(m, g);
2039
- return typeof p == "string" ? (await x(p, !0), !1) : p !== !1;
2040
- } catch (p) {
2041
- return console.error("onEnter error", p), !1;
2124
+ const h = await u.onEnter($, p);
2125
+ return typeof h == "string" ? (await w(h, !0), !1) : h !== !1;
2126
+ } catch (h) {
2127
+ return console.error("onEnter error", h), !1;
2042
2128
  }
2043
2129
  return !0;
2044
- }, v = (m, g) => {
2045
- const u = t.find((p) => z([p], m.path).route !== null);
2130
+ }, x = ($, p) => {
2131
+ const u = t.find((h) => W([h], $.path).route !== null);
2046
2132
  if (u?.afterEnter)
2047
2133
  try {
2048
- u.afterEnter(m, g);
2049
- } catch (p) {
2050
- console.error("afterEnter error", p);
2134
+ u.afterEnter($, p);
2135
+ } catch (h) {
2136
+ console.error("afterEnter error", h);
2051
2137
  }
2052
- }, x = async (m, g = !1) => {
2138
+ }, w = async ($, p = !1) => {
2053
2139
  try {
2054
2140
  const u = {
2055
- path: m.replace(r, "") || "/",
2141
+ path: $.replace(r, "") || "/",
2056
2142
  query: {}
2057
- }, p = z(t, u.path);
2058
- if (!p) throw new Error(`No route found for ${u.path}`);
2059
- const w = i.getState(), d = {
2143
+ }, h = W(t, u.path);
2144
+ if (!h) throw new Error(`No route found for ${u.path}`);
2145
+ const b = i.getState(), d = {
2060
2146
  path: u.path,
2061
- params: p.params,
2147
+ params: h.params,
2062
2148
  query: u.query
2063
2149
  };
2064
- if (!await h(d, w) || !await l(d, w)) return;
2065
- typeof window < "u" && typeof document < "u" && (g ? window.history.replaceState({}, "", r + m) : window.history.pushState({}, "", r + m)), i.setState(d), v(d, w);
2150
+ if (!await g(d, b) || !await l(d, b)) return;
2151
+ typeof window < "u" && typeof document < "u" && (p ? window.history.replaceState({}, "", r + $) : window.history.pushState({}, "", r + $)), i.setState(d), x(d, b);
2066
2152
  } catch (u) {
2067
2153
  console.error("Navigation error:", u);
2068
2154
  }
2069
2155
  };
2070
2156
  if (typeof window < "u" && typeof document < "u") {
2071
2157
  o = () => {
2072
- const g = new URL(window.location.href), u = g.pathname.replace(r, "") || "/", p = he(g.search);
2073
- return { path: u, query: p };
2158
+ const p = new URL(window.location.href), u = p.pathname.replace(r, "") || "/", h = Ce(p.search);
2159
+ return { path: u, query: h };
2074
2160
  }, s = o();
2075
- const m = z(t, s.path);
2076
- i = se({
2161
+ const $ = W(t, s.path);
2162
+ i = ve({
2077
2163
  path: s.path,
2078
- params: m.params,
2164
+ params: $.params,
2079
2165
  query: s.query
2080
- }), a = async (g = !1) => {
2166
+ }), a = async (p = !1) => {
2081
2167
  const u = o();
2082
- await x(u.path, g);
2083
- }, window.addEventListener("popstate", () => a(!0)), c = (g) => x(g, !1), f = (g) => x(g, !0), y = () => window.history.back();
2168
+ await w(u.path, p);
2169
+ }, window.addEventListener("popstate", () => a(!0)), c = (p) => w(p, !1), f = (p) => w(p, !0), y = () => window.history.back();
2084
2170
  } else {
2085
2171
  o = () => {
2086
- const u = new URL(n || "/", "http://localhost"), p = u.pathname.replace(r, "") || "/", w = he(u.search);
2087
- return { path: p, query: w };
2172
+ const u = new URL(n || "/", "http://localhost"), h = u.pathname.replace(r, "") || "/", b = Ce(u.search);
2173
+ return { path: h, query: b };
2088
2174
  }, s = o();
2089
- const m = z(t, s.path);
2090
- i = se({
2175
+ const $ = W(t, s.path);
2176
+ i = ve({
2091
2177
  path: s.path,
2092
- params: m.params,
2178
+ params: $.params,
2093
2179
  query: s.query
2094
2180
  }), a = async () => {
2095
2181
  const u = o();
2096
- await g(u.path);
2182
+ await p(u.path);
2097
2183
  };
2098
- const g = async (u) => {
2184
+ const p = async (u) => {
2099
2185
  try {
2100
- const p = {
2186
+ const h = {
2101
2187
  path: u.replace(r, "") || "/",
2102
2188
  query: {}
2103
- }, w = z(t, p.path);
2104
- if (!w) throw new Error(`No route found for ${p.path}`);
2105
- const d = i.getState(), b = {
2106
- path: p.path,
2107
- params: w.params,
2108
- query: p.query
2109
- }, $ = t.find((k) => z([k], b.path).route !== null);
2110
- if ($?.beforeEnter)
2189
+ }, b = W(t, h.path);
2190
+ if (!b) throw new Error(`No route found for ${h.path}`);
2191
+ const d = i.getState(), v = {
2192
+ path: h.path,
2193
+ params: b.params,
2194
+ query: h.query
2195
+ }, m = t.find((k) => W([k], v.path).route !== null);
2196
+ if (m?.beforeEnter)
2111
2197
  try {
2112
- const k = await $.beforeEnter(b, d);
2198
+ const k = await m.beforeEnter(v, d);
2113
2199
  if (typeof k == "string") {
2114
- await g(k);
2200
+ await p(k);
2115
2201
  return;
2116
2202
  }
2117
2203
  if (k === !1) return;
2118
2204
  } catch {
2119
2205
  return;
2120
2206
  }
2121
- if ($?.onEnter)
2207
+ if (m?.onEnter)
2122
2208
  try {
2123
- const k = await $.onEnter(b, d);
2209
+ const k = await m.onEnter(v, d);
2124
2210
  if (typeof k == "string") {
2125
- await g(k);
2211
+ await p(k);
2126
2212
  return;
2127
2213
  }
2128
2214
  if (k === !1) return;
2129
2215
  } catch {
2130
2216
  return;
2131
2217
  }
2132
- if (i.setState(b), $?.afterEnter)
2218
+ if (i.setState(v), m?.afterEnter)
2133
2219
  try {
2134
- $.afterEnter(b, d);
2220
+ m.afterEnter(v, d);
2135
2221
  } catch {
2136
2222
  }
2137
2223
  } catch {
2138
2224
  }
2139
2225
  };
2140
- c = async (u) => g(u), f = async (u) => g(u), y = () => {
2226
+ c = async (u) => p(u), f = async (u) => p(u), y = () => {
2141
2227
  };
2142
2228
  }
2143
2229
  return {
@@ -2146,34 +2232,34 @@ function et(e) {
2146
2232
  replace: f,
2147
2233
  back: y,
2148
2234
  subscribe: i.subscribe,
2149
- matchRoute: (m) => z(t, m),
2235
+ matchRoute: ($) => W(t, $),
2150
2236
  getCurrent: () => i.getState(),
2151
- resolveRouteComponent: Ge
2237
+ resolveRouteComponent: pt
2152
2238
  };
2153
2239
  }
2154
- function lt(e, t) {
2155
- return z(e, t);
2240
+ function kt(e, t) {
2241
+ return W(e, t);
2156
2242
  }
2157
- function ct(e) {
2158
- const t = et(e);
2159
- return pe("router-view", {
2243
+ function $t(e) {
2244
+ const t = ht(e);
2245
+ return _e("router-view", {
2160
2246
  async render() {
2161
- if (!t) return M`<div>Router not initialized.</div>`;
2247
+ if (!t) return U`<div>Router not initialized.</div>`;
2162
2248
  const r = t.getCurrent(), { path: n } = r, o = t.matchRoute(n);
2163
- if (!o.route) return M`<div>Not found</div>`;
2249
+ if (!o.route) return U`<div>Not found</div>`;
2164
2250
  let s = o.route.component;
2165
2251
  if (o.route.load) {
2166
2252
  const i = await o.route.load();
2167
2253
  typeof i.default == "string" && (s = i.default);
2168
2254
  }
2169
- return typeof s == "string" ? { tag: s, props: {}, children: [] } : M`<div>Invalid route component</div>`;
2255
+ return typeof s == "string" ? { tag: s, props: {}, children: [] } : U`<div>Invalid route component</div>`;
2170
2256
  },
2171
2257
  onConnected(r) {
2172
2258
  t && typeof t.subscribe == "function" && t.subscribe(() => {
2173
2259
  typeof r.requestRender == "function" && r.requestRender();
2174
2260
  });
2175
2261
  }
2176
- }), pe("router-link", {
2262
+ }), _e("router-link", {
2177
2263
  state: {},
2178
2264
  props: {
2179
2265
  to: { type: String, default: "" },
@@ -2186,7 +2272,7 @@ function ct(e) {
2186
2272
  disabled: { type: Boolean, default: !1 },
2187
2273
  external: { type: Boolean, default: !1 },
2188
2274
  class: { type: String, default: "" },
2189
- style: { type: String, default: ye`
2275
+ style: { type: String, default: Ae`
2190
2276
  [aria-disabled="true"] {
2191
2277
  pointer-events: none;
2192
2278
  opacity: 0.5;
@@ -2195,25 +2281,25 @@ function ct(e) {
2195
2281
  },
2196
2282
  style: (r) => r.style,
2197
2283
  render: (r) => {
2198
- const n = t.getCurrent(), o = r.to, s = r.exact, i = r.exactActiveClass, a = r.activeClass, c = r.ariaCurrentValue, f = r.tag, y = r.disabled, h = r.external, l = n.path === o, v = s ? l : n && typeof n.path == "string" ? n.path.startsWith(o) : !1, x = l ? i : v ? a : "", m = l ? `aria-current="${c}"` : "", g = f === "button", u = y ? g ? 'disabled aria-disabled="true" tabindex="-1"' : 'aria-disabled="true" tabindex="-1"' : "", p = h && (f === "a" || !f) ? 'target="_blank" rel="noopener noreferrer"' : "";
2199
- return M`
2200
- ${be().when(g, M`
2284
+ const n = t.getCurrent(), o = r.to, s = r.exact, i = r.exactActiveClass, a = r.activeClass, c = r.ariaCurrentValue, f = r.tag, y = r.disabled, g = r.external, l = n.path === o, x = s ? l : n && typeof n.path == "string" ? n.path.startsWith(o) : !1, w = l ? i : x ? a : "", $ = l ? `aria-current="${c}"` : "", p = f === "button", u = y ? p ? 'disabled aria-disabled="true" tabindex="-1"' : 'aria-disabled="true" tabindex="-1"' : "", h = g && (f === "a" || !f) ? 'target="_blank" rel="noopener noreferrer"' : "";
2285
+ return U`
2286
+ ${Le().when(p, U`
2201
2287
  <button
2202
2288
  part="button"
2203
- :class="${r.class} ${x}"
2204
- ${m}
2289
+ :class="${r.class} ${w}"
2290
+ ${$}
2205
2291
  ${u}
2206
- ${p}
2292
+ ${h}
2207
2293
  @click="navigate"
2208
2294
  ><slot></slot></button>
2209
- `).otherwise(M`
2295
+ `).otherwise(U`
2210
2296
  <a
2211
2297
  part="link"
2212
2298
  href="${o}"
2213
- :class="${r.class} ${x}"
2214
- ${m}
2299
+ :class="${r.class} ${w}"
2300
+ ${$}
2215
2301
  ${u}
2216
- ${p}
2302
+ ${h}
2217
2303
  @click="navigate"
2218
2304
  ><slot></slot></a>
2219
2305
  `).done()}
@@ -2229,25 +2315,25 @@ function ct(e) {
2229
2315
  }), t;
2230
2316
  }
2231
2317
  export {
2232
- O as GlobalEventBus,
2233
- pe as component,
2234
- se as createStore,
2235
- ye as css,
2236
- rt as each,
2237
- nt as emit,
2238
- D as eventBus,
2239
- M as html,
2240
- ct as initRouter,
2241
- at as listen,
2242
- be as match,
2243
- z as matchRoute,
2244
- lt as matchRouteSSR,
2245
- it as off,
2246
- ot as on,
2247
- st as once,
2248
- he as parseQuery,
2249
- Ge as resolveRouteComponent,
2250
- et as useRouter,
2251
- tt as when
2318
+ F as GlobalEventBus,
2319
+ _e as component,
2320
+ ve as createStore,
2321
+ Ae as css,
2322
+ yt as each,
2323
+ mt as emit,
2324
+ Z as eventBus,
2325
+ U as html,
2326
+ $t as initRouter,
2327
+ wt as listen,
2328
+ Le as match,
2329
+ W as matchRoute,
2330
+ kt as matchRouteSSR,
2331
+ vt as off,
2332
+ bt as on,
2333
+ xt as once,
2334
+ Ce as parseQuery,
2335
+ pt as resolveRouteComponent,
2336
+ ht as useRouter,
2337
+ gt as when
2252
2338
  };
2253
2339
  //# sourceMappingURL=custom-elements-runtime.es.js.map