@tempots/dom 21.0.0 → 22.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,8 +1,12 @@
1
- var Ce = Object.defineProperty;
2
- var Le = (t, e, r) => e in t ? Ce(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
- var u = (t, e, r) => Le(t, typeof e != "symbol" ? e + "" : e, r);
4
- const Oe = (t, e, r) => t + (e - t) * r;
5
- const ke = (t, e, r) => {
1
+ var Re = Object.defineProperty;
2
+ var ee = (t) => {
3
+ throw TypeError(t);
4
+ };
5
+ var Me = (t, e, r) => e in t ? Re(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
6
+ var u = (t, e, r) => Me(t, typeof e != "symbol" ? e + "" : e, r), te = (t, e, r) => e.has(t) || ee("Cannot " + r);
7
+ var D = (t, e, r) => (te(t, e, "read from private field"), r ? r.call(t) : e.get(t)), re = (t, e, r) => e.has(t) ? ee("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), J = (t, e, r, s) => (te(t, e, "write to private field"), s ? s.call(t, r) : e.set(t, r), r);
8
+ const $e = (t, e, r) => t + (e - t) * r;
9
+ const Fe = (t, e, r) => {
6
10
  const s = Math.max(t.length, e.length);
7
11
  let n = "";
8
12
  for (let o = 0; o < s; o++) {
@@ -12,51 +16,49 @@ const ke = (t, e, r) => {
12
16
  isNaN(l) && (l = 97), n += String.fromCharCode(i + (l - i) * r);
13
17
  }
14
18
  return n;
15
- }, Ne = (t, e, r) => new Date(t.getTime() + (e.getTime() - t.getTime()) * r), Re = (t, e) => e, Me = (t) => typeof t == "number" ? Oe : typeof t == "string" ? ke : t instanceof Date ? Ne : Re;
16
- class M {
19
+ }, Ve = (t, e, r) => new Date(t.getTime() + (e.getTime() - t.getTime()) * r), qe = (t, e) => e, Ie = (t) => typeof t == "number" ? $e : typeof t == "string" ? Fe : t instanceof Date ? Ve : qe;
20
+ var y;
21
+ class T {
17
22
  /**
18
23
  * Creates a new instance of `ElementPosition`.
19
24
  * @param index - The index of the element.
20
25
  * @param total - The total number of elements in the collection.
21
26
  */
22
27
  constructor(e, r) {
23
- this.index = e, this.total = r;
24
- }
25
- /**
26
- * Gets the counter of the element.
27
- */
28
- get counter() {
29
- return this.index + 1;
30
- }
31
- /**
32
- * Checks if the element is the first element in the collection.
33
- * @returns `true` if the element is the first element, `false` otherwise.
34
- */
35
- get isFirst() {
36
- return this.index === 0;
28
+ /**
29
+ * The counter of the element starting from 1.
30
+ */
31
+ u(this, "counter");
32
+ /**
33
+ * Checks if the element is the first element in the collection.
34
+ * @returns `true` if the element is the first element, `false` otherwise.
35
+ */
36
+ u(this, "isFirst");
37
+ /**
38
+ * Checks if the counter of the element is even.
39
+ * @returns `true` if the counter is even, `false` otherwise.
40
+ */
41
+ u(this, "isEven");
42
+ /**
43
+ * Checks if the counter of the element is odd.
44
+ * @returns `true` if the counter is odd, `false` otherwise.
45
+ */
46
+ u(this, "isOdd");
47
+ re(this, y);
48
+ u(this, "dispose", () => {
49
+ D(this, y) != null && (D(this, y).dispose(), J(this, y, void 0));
50
+ });
51
+ this.index = e, this.total = r, this.counter = e + 1, this.isFirst = e === 0, this.isEven = e % 2 === 1, this.isOdd = e % 2 === 0;
37
52
  }
38
53
  /**
39
54
  * Checks if the element is the last element in the collection.
40
55
  * @returns `true` if the element is the last element, `false` otherwise.
41
56
  */
42
57
  get isLast() {
43
- return this.index === this.total - 1;
44
- }
45
- /**
46
- * Checks if the counter of the element is even.
47
- * @returns `true` if the counter is even, `false` otherwise.
48
- */
49
- get isEven() {
50
- return this.index % 2 === 1;
51
- }
52
- /**
53
- * Checks if the counter of the element is odd.
54
- * @returns `true` if the counter is odd, `false` otherwise.
55
- */
56
- get isOdd() {
57
- return this.index % 2 === 0;
58
+ return D(this, y) == null && J(this, y, this.total.map((e) => this.counter === e)), D(this, y);
58
59
  }
59
60
  }
61
+ y = new WeakMap();
60
62
  const C = class C {
61
63
  /**
62
64
  * Represents a signal with a value of type T.
@@ -241,21 +243,21 @@ const C = class C {
241
243
  * @returns A property that holds the mapped value and can be observed for changes.
242
244
  */
243
245
  u(this, "mapAsync", (e, r, s, n = (o, i) => o === i) => {
244
- const o = L(r, n);
246
+ const o = V(r, n);
245
247
  let i = 0, l = new AbortController();
246
248
  return o.onDispose(
247
249
  this.on(async (a) => {
248
- const c = ++i;
250
+ const f = ++i;
249
251
  l.abort(), l = new AbortController();
250
252
  try {
251
- const d = await e(a, { abortSignal: l.signal });
252
- c === i && o.set(d);
253
- } catch (d) {
254
- if (c === i)
253
+ const g = await e(a, { abortSignal: l.signal });
254
+ f === i && o.set(g);
255
+ } catch (g) {
256
+ if (f === i)
255
257
  if (s != null)
256
- o.set(s(d));
258
+ o.set(s(g));
257
259
  else
258
- throw d;
260
+ throw g;
259
261
  }
260
262
  })
261
263
  ), o;
@@ -286,7 +288,7 @@ const C = class C {
286
288
  * @param autoDisposeProp - Determines whether the derived property should be automatically disposed.
287
289
  * @returns The derived property.
288
290
  */
289
- u(this, "deriveProp", (e = !0) => this.feedProp(L(this.get()), e));
291
+ u(this, "deriveProp", (e = !0) => this.feedProp(V(this.get()), e));
290
292
  /**
291
293
  * Returns a signal that emits the count of values received so far.
292
294
  * @returns A signal that emits the count of values received so far.
@@ -357,7 +359,7 @@ u(C, "is", (e) => (
357
359
  e != null && e.$__signal__ === !0
358
360
  ));
359
361
  let h = C;
360
- const $e = typeof queueMicrotask == "function" ? queueMicrotask : (t) => Promise.resolve().then(t);
362
+ const Be = typeof queueMicrotask == "function" ? queueMicrotask : (t) => Promise.resolve().then(t);
361
363
  class E extends h {
362
364
  /**
363
365
  * Represents a Signal object.
@@ -393,7 +395,7 @@ class E extends h {
393
395
  */
394
396
  u(this, "_scheduleNotify", () => {
395
397
  const r = ++this._scheduleCount;
396
- $e(() => {
398
+ Be(() => {
397
399
  this._scheduleCount !== r || this._disposed !== !1 || this._isDirty && (this._isDirty = !1, this._setAndNotify(this._fn(), !1));
398
400
  });
399
401
  });
@@ -503,10 +505,10 @@ u(q, "is", (r) => (
503
505
  r != null && r.$__prop__ === !0
504
506
  ));
505
507
  let F = q;
506
- const J = (t, e, r = (s, n) => s === n) => {
508
+ const z = (t, e, r = (s, n) => s === n) => {
507
509
  const s = new E(t, r);
508
510
  return e.forEach((n) => n.setDerivative(s)), s;
509
- }, Ve = (t, e) => J(t, e).dispose, L = (t, e = (r, s) => r === s) => new F(t, e), I = (t, e = (r, s) => r === s) => new h(t, e), m = {
511
+ }, je = (t, e) => z(t, e).dispose, V = (t, e = (r, s) => r === s) => new F(t, e), I = (t, e = (r, s) => r === s) => new h(t, e), d = {
510
512
  /**
511
513
  * Maps a value or a Signal to a new value.
512
514
  * If the value is a Signal, it returns a new Signal with the mapped value.
@@ -538,7 +540,7 @@ const J = (t, e, r = (s, n) => s === n) => {
538
540
  */
539
541
  maybeToSignal: (t, e) => {
540
542
  if (t != null)
541
- return m.toSignal(t, e);
543
+ return d.toSignal(t, e);
542
544
  },
543
545
  /**
544
546
  * Gets the value from a `Signal` or the value itself if it is not a `Signal`.
@@ -553,19 +555,28 @@ const J = (t, e, r = (s, n) => s === n) => {
553
555
  * @returns A function to remove the listener.
554
556
  */
555
557
  on: (t, e) => h.is(t) ? t.on(e) : (e(t), () => {
556
- })
557
- }, Fe = (...t) => (e, r) => {
558
+ }),
559
+ /**
560
+ * Disposes of a value or a Signal.
561
+ * If the value is a Signal, it disposes of the Signal.
562
+ * If the value is not a Signal, it does nothing.
563
+ * @param value - The value or Signal instance to dispose of.
564
+ */
565
+ dispose: (t) => {
566
+ h.is(t) && t.dispose();
567
+ }
568
+ }, At = (...t) => (e, r) => {
558
569
  const s = t.filter((n) => h.is(n));
559
- return J(
560
- () => e(...t.map((n) => m.get(n))),
570
+ return z(
571
+ () => e(...t.map((n) => d.get(n))),
561
572
  s,
562
573
  r
563
574
  );
564
- }, _t = (...t) => (e) => {
575
+ }, Et = (...t) => (e) => {
565
576
  const r = t.filter((s) => h.is(s));
566
- Ve(() => e(...t.map(m.get)), r);
577
+ je(() => e(...t.map(d.get)), r);
567
578
  };
568
- class K {
579
+ class ne {
569
580
  constructor() {
570
581
  u(this, "_store", /* @__PURE__ */ new Map());
571
582
  /**
@@ -584,7 +595,7 @@ class K {
584
595
  });
585
596
  }
586
597
  }
587
- const x = ({
598
+ const oe = ({
588
599
  key: t,
589
600
  defaultValue: e,
590
601
  store: r,
@@ -597,57 +608,57 @@ const x = ({
597
608
  l != null ? i(n(l)) : typeof e == "function" ? e() : e,
598
609
  o
599
610
  );
600
- return a.on((c) => {
601
- r.setItem(t, s(c));
611
+ return a.on((f) => {
612
+ r.setItem(t, s(f));
602
613
  }), a;
603
- }, vt = (t) => x({
614
+ }, Pt = (t) => oe({
604
615
  ...t,
605
- store: (window == null ? void 0 : window.localStorage) ?? new K()
606
- }), yt = (t) => x({
616
+ store: (window == null ? void 0 : window.localStorage) ?? new ne()
617
+ }), Dt = (t) => oe({
607
618
  ...t,
608
- store: (window == null ? void 0 : window.sessionStorage) ?? new K()
619
+ store: (window == null ? void 0 : window.sessionStorage) ?? new ne()
609
620
  });
610
- function Z(t) {
621
+ function se(t) {
611
622
  return typeof requestAnimationFrame == "function" ? requestAnimationFrame(t) : setTimeout(t, 0);
612
623
  }
613
- const qe = (t, e, r, s) => {
614
- const n = (s == null ? void 0 : s.duration) ?? 300, o = (s == null ? void 0 : s.easing) ?? ((y) => y), i = (s == null ? void 0 : s.equals) ?? ((y, R) => y === R);
615
- let l = s == null ? void 0 : s.interpolate, a = t, c = e(), d = performance.now(), v = null, p = !0;
616
- const D = new E(e, i), A = L(t, i);
624
+ const Ue = (t, e, r, s) => {
625
+ const n = (s == null ? void 0 : s.duration) ?? 300, o = (s == null ? void 0 : s.easing) ?? ((_) => _), i = (s == null ? void 0 : s.equals) ?? ((_, R) => _ === R);
626
+ let l = s == null ? void 0 : s.interpolate, a = t, f = e(), g = performance.now(), w = null, U = !0;
627
+ const G = new E(e, i), A = V(t, i);
617
628
  A.onDispose(() => {
618
- v !== null && cancelAnimationFrame(v);
619
- }), A.onDispose(D.dispose), r.forEach((y) => {
620
- y.setDerivative(D), y.onDispose(A.dispose);
629
+ w !== null && cancelAnimationFrame(w);
630
+ }), A.onDispose(G.dispose), r.forEach((_) => {
631
+ _.setDerivative(G), _.onDispose(A.dispose);
621
632
  });
622
- const be = (y) => {
623
- c = y, d = performance.now(), a = A.value, p && (p = !1, v = Z(Q));
624
- }, Q = () => {
625
- const R = (performance.now() - d) / m.get(n), Te = o(R);
626
- l == null && (l = Me(a));
627
- let Y = l(a, c, Te);
628
- R >= 1 ? (p = !0, Y = c) : v = Z(Q), A.set(Y);
633
+ const Le = (_) => {
634
+ f = _, g = performance.now(), a = A.value, U && (U = !1, w = se(K));
635
+ }, K = () => {
636
+ const R = (performance.now() - g) / d.get(n), Ne = o(R);
637
+ l == null && (l = Ie(a));
638
+ let x = l(a, f, Ne);
639
+ R >= 1 ? (U = !0, x = f) : w = se(K), A.set(x);
629
640
  };
630
- return D.on(be), A;
631
- }, St = (t, e) => {
641
+ return G.on(Le), A;
642
+ }, bt = (t, e) => {
632
643
  const { initialValue: r, ...s } = e ?? {};
633
- return qe(
644
+ return Ue(
634
645
  r ?? t.get(),
635
646
  t.get,
636
647
  [t],
637
648
  s
638
649
  );
639
- }, wt = (t, e) => {
650
+ }, Tt = (t, e) => {
640
651
  const { signals: r, literals: s } = Object.entries(t).reduce(
641
652
  ({ signals: o, literals: i }, [l, a]) => (h.is(a) ? o.push([l, a]) : i[l] = a, { signals: o, literals: i }),
642
653
  { signals: [], literals: {} }
643
654
  ), n = r.map(([, o]) => o);
644
- return J(() => (r.forEach(([o, i]) => s[o] = i.value), e(s)), n);
645
- }, ee = /* @__PURE__ */ new Set(["checked", "disabled", "hidden", "selected"]), te = /* @__PURE__ */ new Set([
655
+ return z(() => (r.forEach(([o, i]) => s[o] = i.value), e(s)), n);
656
+ }, ie = /* @__PURE__ */ new Set(["checked", "disabled", "hidden", "selected"]), le = /* @__PURE__ */ new Set([
646
657
  "rowSpan",
647
658
  "colSpan",
648
659
  "tabIndex",
649
660
  "valueAsNumber"
650
- ]), re = /* @__PURE__ */ new Set(["valueAsDate"]), se = /* @__PURE__ */ new Set([
661
+ ]), ue = /* @__PURE__ */ new Set(["valueAsDate"]), ae = /* @__PURE__ */ new Set([
651
662
  "value",
652
663
  "textContent",
653
664
  "innerText",
@@ -655,25 +666,25 @@ const qe = (t, e, r, s) => {
655
666
  "outerHTML",
656
667
  "className",
657
668
  "classList"
658
- ]), j = /* @__PURE__ */ new Map(), b = (t, e) => {
659
- if (j.has(t))
660
- return j.get(t);
669
+ ]), H = /* @__PURE__ */ new Map(), b = (t, e) => {
670
+ if (H.has(t))
671
+ return H.get(t);
661
672
  {
662
673
  const r = e(t);
663
- return j.set(t, r), r;
674
+ return H.set(t, r), r;
664
675
  }
665
- }, Ie = (t) => (e, r) => {
676
+ }, Ge = (t) => (e, r) => {
666
677
  r == null ? e[t] = null : e[t] = !!r;
667
- }, Be = (t) => (e, r) => {
678
+ }, Je = (t) => (e, r) => {
668
679
  r == null ? e[t] = null : e[t] = Number(r);
669
- }, je = (t) => (e, r) => {
680
+ }, He = (t) => (e, r) => {
670
681
  r == null ? e[t] = null : e[t] = r;
671
- }, Ue = (t) => (e, r) => {
682
+ }, We = (t) => (e, r) => {
672
683
  r == null ? e[t] = null : e[t] = String(r);
673
- }, Ge = (t) => (e, r) => {
684
+ }, Xe = (t) => (e, r) => {
674
685
  r == null ? e.removeAttribute(t) : e.setAttribute(t, r);
675
- }, ne = (t) => ee.has(t) ? b(t, Ie) : te.has(t) ? b(t, Be) : re.has(t) ? b(t, je) : se.has(t) ? b(t, Ue) : b(t, Ge), oe = (t) => (e) => ee.has(t) ? !!e[t] : te.has(t) ? Number(e[t]) : re.has(t) ? e[t] : se.has(t) ? String(e[t]) : e.getAttribute(t);
676
- class S {
686
+ }, ce = (t) => ie.has(t) ? b(t, Ge) : le.has(t) ? b(t, Je) : ue.has(t) ? b(t, He) : ae.has(t) ? b(t, We) : b(t, Xe), fe = (t) => (e) => ie.has(t) ? !!e[t] : le.has(t) ? Number(e[t]) : ue.has(t) ? e[t] : ae.has(t) ? String(e[t]) : e.getAttribute(t);
687
+ class v {
677
688
  /**
678
689
  * Constructs a new `DOMContext` instance.
679
690
  *
@@ -721,18 +732,18 @@ class S {
721
732
  * @param document - The `Document` to use for the `DOMContext`.
722
733
  * @returns A new `DOMContext` instance.
723
734
  */
724
- u(this, "withDocument", (e) => new S(e, this.element, this.reference, this.providers, !0));
735
+ u(this, "withDocument", (e) => new v(e, this.element, this.reference, this.providers, !0));
725
736
  /**
726
737
  * Creates a new `DOMContext` instance with the provided `element`.
727
738
  * @param element - The DOM element to use in the new `DOMContext` instance.
728
739
  * @returns A new `DOMContext` instance with the provided `element`.
729
740
  */
730
- u(this, "withElement", (e) => new S(this.document, e, void 0, this.providers, !1));
741
+ u(this, "withElement", (e) => new v(this.document, e, void 0, this.providers, !1));
731
742
  /**
732
743
  * Creates a new `DOMContext` instance with the `isFirstLevel` property set to `true`.
733
744
  * @returns A new `DOMContext` instance with the `isFirstLevel` property set to `true`.
734
745
  */
735
- u(this, "withFirstLevel", () => new S(
746
+ u(this, "withFirstLevel", () => new v(
736
747
  this.document,
737
748
  this.element,
738
749
  this.reference,
@@ -745,7 +756,7 @@ class S {
745
756
  * @param reference - The optional `Text` node to use as the reference for the new `DOMContext`.
746
757
  * @returns A new `DOMContext` instance with the specified reference.
747
758
  */
748
- u(this, "withReference", (e) => new S(
759
+ u(this, "withReference", (e) => new v(
749
760
  this.document,
750
761
  this.element,
751
762
  e,
@@ -758,7 +769,7 @@ class S {
758
769
  * @param value - The value to set for the provider.
759
770
  * @returns A new DOMContext with the updated providers.
760
771
  */
761
- u(this, "withProvider", (e, r) => new S(
772
+ u(this, "withProvider", (e, r) => new v(
762
773
  this.document,
763
774
  this.element,
764
775
  this.reference,
@@ -775,7 +786,7 @@ class S {
775
786
  * @param providers - An object containing the providers to be merged into the existing providers.
776
787
  * @returns A new DOMContext instance with the merged providers.
777
788
  */
778
- u(this, "withProviders", (e) => new S(
789
+ u(this, "withProviders", (e) => new v(
779
790
  this.document,
780
791
  this.element,
781
792
  this.reference,
@@ -794,7 +805,7 @@ class S {
794
805
  */
795
806
  u(this, "getProvider", (e) => {
796
807
  if (this.providers[e] === void 0)
797
- throw new Je(e);
808
+ throw new ze(e);
798
809
  return this.providers[e];
799
810
  });
800
811
  this.document = e, this.element = r, this.reference = s, this.providers = n, this.isFirstLevel = o;
@@ -807,41 +818,41 @@ class S {
807
818
  * @returns A new `DOMContext` instance.
808
819
  */
809
820
  static of(e, r) {
810
- return new S(e.ownerDocument, e, r, {}, !0);
821
+ return new v(e.ownerDocument, e, r, {}, !0);
811
822
  }
812
823
  }
813
- class Je extends Error {
824
+ class ze extends Error {
814
825
  constructor(e) {
815
826
  super(`Provider not found: ${e.description}`);
816
827
  }
817
828
  }
818
- const _ = (t) => {
829
+ const m = (t) => {
819
830
  const e = t;
820
831
  e && e.onblur && (e.onblur = null), !(!t || t.ownerDocument === void 0) && t.parentElement && t.parentElement.removeChild(t);
821
- }, He = (t) => ie(t) ? t : t.parentElement, ie = (t) => t.nodeType === 1, le = (t) => (e) => {
822
- me(e);
832
+ }, Qe = (t) => he(t) ? t : t.parentElement, he = (t) => t.nodeType === 1, de = (t) => (e) => {
833
+ we(e);
823
834
  const r = e.createText(t);
824
835
  return e.appendOrInsert(r), (s) => {
825
- s && _(r);
836
+ s && m(r);
826
837
  };
827
- }, ue = (t) => (e) => {
828
- me(e);
838
+ }, pe = (t) => (e) => {
839
+ we(e);
829
840
  const r = e.createText(t.value);
830
841
  e.appendOrInsert(r);
831
842
  const s = t.on((n) => r.data = n);
832
843
  return (n) => {
833
- s(), n && _(r);
844
+ s(), n && m(r);
834
845
  };
835
- }, At = (t) => h.is(t) ? ue(t) : le(t), g = (...t) => (e) => {
836
- const r = t.map((s) => f(s)(e));
846
+ }, Ot = (t) => h.is(t) ? pe(t) : de(t), p = (...t) => (e) => {
847
+ const r = t.map((s) => c(s)(e));
837
848
  return (s) => {
838
849
  r.forEach((n) => n(s));
839
850
  };
840
- }, w = () => () => {
841
- }, We = (t) => (e) => (de(e), e.element.classList.add(...t), (r) => {
851
+ }, S = () => () => {
852
+ }, Ye = (t) => (e) => (ye(e), e.element.classList.add(...t), (r) => {
842
853
  r && e.element.classList.remove(...t);
843
- }), Xe = (t) => (e) => {
844
- de(e);
854
+ }), Ze = (t) => (e) => {
855
+ ye(e);
845
856
  const r = e.element;
846
857
  let s = [];
847
858
  const n = t.on((o) => {
@@ -850,19 +861,19 @@ const _ = (t) => {
850
861
  return (o) => {
851
862
  n(), o && s.forEach((i) => r.classList.remove(i)), s.length = 0;
852
863
  };
853
- }, O = (t, e) => {
854
- const r = ne(t), s = oe(t);
864
+ }, k = (t, e) => {
865
+ const r = ce(t), s = fe(t);
855
866
  return (n) => {
856
- he(n, t);
867
+ ve(n, t);
857
868
  const o = s(n.element);
858
869
  return r(n.element, e), (i) => {
859
870
  i && r(n.element, o);
860
871
  };
861
872
  };
862
- }, k = (t, e) => {
863
- const r = ne(t), s = oe(t);
873
+ }, L = (t, e) => {
874
+ const r = ce(t), s = fe(t);
864
875
  return (n) => {
865
- he(n, t);
876
+ ve(n, t);
866
877
  const o = s(n.element), i = e.on((l) => r(n.element, l));
867
878
  return (l) => {
868
879
  i(), l && r(n.element, o);
@@ -882,17 +893,17 @@ const _ = (t) => {
882
893
  * @returns The renderable component for the specified attribute.
883
894
  *
884
895
  */
885
- get: (t, e) => e === "class" ? (r) => h.is(r) ? Xe(r) : We(
896
+ get: (t, e) => e === "class" ? (r) => h.is(r) ? Ze(r) : Ye(
886
897
  (r ?? "").split(" ").filter((s) => s.length > 0)
887
- ) : (r) => h.is(r) ? k(
898
+ ) : (r) => h.is(r) ? L(
888
899
  e,
889
900
  r
890
- ) : O(
901
+ ) : k(
891
902
  e,
892
903
  r
893
904
  )
894
905
  }
895
- ), Et = new Proxy(
906
+ ), Ct = new Proxy(
896
907
  {},
897
908
  {
898
909
  /**
@@ -903,12 +914,12 @@ const _ = (t) => {
903
914
  * @returns The renderable component for the specified attribute.
904
915
  *
905
916
  */
906
- get: (t, e) => (r) => h.is(r) ? k(
917
+ get: (t, e) => (r) => h.is(r) ? L(
907
918
  `data-${e}`,
908
919
  r
909
- ) : O(`data-${e}`, r)
920
+ ) : k(`data-${e}`, r)
910
921
  }
911
- ), Pt = new Proxy(
922
+ ), kt = new Proxy(
912
923
  {},
913
924
  {
914
925
  /**
@@ -919,15 +930,15 @@ const _ = (t) => {
919
930
  * @returns The renderable component for the specified attribute.
920
931
  *
921
932
  */
922
- get: (t, e) => (r) => h.is(r) ? k(
933
+ get: (t, e) => (r) => h.is(r) ? L(
923
934
  `aria-${e}`,
924
935
  r
925
- ) : O(
936
+ ) : k(
926
937
  `aria-${e}`,
927
938
  r
928
939
  )
929
940
  }
930
- ), Dt = new Proxy(
941
+ ), Lt = new Proxy(
931
942
  {},
932
943
  {
933
944
  /**
@@ -938,15 +949,15 @@ const _ = (t) => {
938
949
  * @returns The renderable component for the specified attribute.
939
950
  *
940
951
  */
941
- get: (t, e) => (r) => h.is(r) ? k(
952
+ get: (t, e) => (r) => h.is(r) ? L(
942
953
  e,
943
954
  r
944
- ) : O(
955
+ ) : k(
945
956
  e,
946
957
  r
947
958
  )
948
959
  }
949
- ), bt = new Proxy(
960
+ ), Nt = new Proxy(
950
961
  {},
951
962
  {
952
963
  /**
@@ -956,29 +967,29 @@ const _ = (t) => {
956
967
  * @returns The renderable component for the specified attribute.
957
968
  *
958
969
  */
959
- get: (t, e) => (r) => h.is(r) ? k(
970
+ get: (t, e) => (r) => h.is(r) ? L(
960
971
  e,
961
972
  r
962
- ) : O(
973
+ ) : k(
963
974
  e,
964
975
  r
965
976
  )
966
977
  }
967
- ), f = (t) => t == null ? w : Array.isArray(t) ? g(...t.map(f)) : typeof t == "string" ? le(t) : h.is(t) ? ue(t) : t, ae = (t, ...e) => (r) => {
978
+ ), c = (t) => t == null ? S : Array.isArray(t) ? p(...t.map(c)) : typeof t == "string" ? de(t) : h.is(t) ? pe(t) : t, me = (t, ...e) => (r) => {
968
979
  const s = r.createElement(t, void 0);
969
- r.isFirstLevel && N() && pe(s), r.appendOrInsert(s), r = r.withElement(s);
970
- const n = e.map((o) => f(o)(r));
980
+ r.isFirstLevel && N() && Se(s), r.appendOrInsert(s), r = r.withElement(s);
981
+ const n = e.map((o) => c(o)(r));
971
982
  return (o) => {
972
- n.forEach((i) => i(!1)), o && _(s);
983
+ n.forEach((i) => i(!1)), o && m(s);
973
984
  };
974
- }, ce = (t, e, ...r) => (s) => {
985
+ }, ge = (t, e, ...r) => (s) => {
975
986
  const n = s.createElement(t, e);
976
- s.isFirstLevel && N() && pe(n), s.appendOrInsert(n), s = s.withElement(n);
977
- const o = r.map((i) => f(i)(s));
987
+ s.isFirstLevel && N() && Se(n), s.appendOrInsert(n), s = s.withElement(n);
988
+ const o = r.map((i) => c(i)(s));
978
989
  return (i) => {
979
- o.forEach((l) => l(!1)), i && _(n);
990
+ o.forEach((l) => l(!1)), i && m(n);
980
991
  };
981
- }, Tt = new Proxy(
992
+ }, Rt = new Proxy(
982
993
  {},
983
994
  {
984
995
  /**
@@ -986,9 +997,9 @@ const _ = (t) => {
986
997
  * @param tagName - The HTML tag name.
987
998
  * @returns A renderable function that creates and appends the HTML element to the DOM.
988
999
  */
989
- get: (t, e) => (...r) => ae(e, r.flatMap(f))
1000
+ get: (t, e) => (...r) => me(e, r.flatMap(c))
990
1001
  }
991
- ), Ct = new Proxy(
1002
+ ), Mt = new Proxy(
992
1003
  {},
993
1004
  {
994
1005
  /**
@@ -996,9 +1007,9 @@ const _ = (t) => {
996
1007
  * @param type - The input type name.
997
1008
  * @returns A renderable function that creates and appends the HTMLInput element to the DOM.
998
1009
  */
999
- get: (t, e) => (...r) => ae("input", P.type(e), ...r)
1010
+ get: (t, e) => (...r) => me("input", P.type(e), ...r)
1000
1011
  }
1001
- ), ze = "http://www.w3.org/2000/svg", Lt = new Proxy(
1012
+ ), Ke = "http://www.w3.org/2000/svg", $t = new Proxy(
1002
1013
  {},
1003
1014
  {
1004
1015
  /**
@@ -1006,9 +1017,9 @@ const _ = (t) => {
1006
1017
  * @param tagName - The SVG tag name.
1007
1018
  * @returns A renderable function that creates and appends the SVG element to the DOM.
1008
1019
  */
1009
- get: (t, e) => (...r) => ce(e, ze, r.flatMap(f))
1020
+ get: (t, e) => (...r) => ge(e, Ke, r.flatMap(c))
1010
1021
  }
1011
- ), Qe = "http://www.w3.org/1998/Math/MathML", Ot = new Proxy(
1022
+ ), xe = "http://www.w3.org/1998/Math/MathML", Ft = new Proxy(
1012
1023
  {},
1013
1024
  {
1014
1025
  /**
@@ -1016,101 +1027,101 @@ const _ = (t) => {
1016
1027
  * @param tagName - The Math tag name.
1017
1028
  * @returns A renderable function that creates and appends the Math element to the DOM.
1018
1029
  */
1019
- get: (t, e) => (...r) => ce(e, Qe, r.flatMap(f))
1030
+ get: (t, e) => (...r) => ge(e, xe, r.flatMap(c))
1020
1031
  }
1021
- ), T = "data-tempo-attr", $ = "data-tempo-class", fe = "data-tempo-node", V = "data-tempo-text", Ye = (t, e) => {
1032
+ ), O = "data-tempo-attr", M = "data-tempo-class", _e = "data-tempo-node", $ = "data-tempo-text", et = (t, e) => {
1022
1033
  const r = t.getAttribute(e);
1023
1034
  if (r != null) {
1024
- const s = t.getAttribute(T) ?? "{}", n = { ...JSON.parse(s), name: r };
1035
+ const s = t.getAttribute(O) ?? "{}", n = { ...JSON.parse(s), name: r };
1025
1036
  t.setAttribute(
1026
- T,
1037
+ O,
1027
1038
  JSON.stringify(n).replace(/"/g, "&quot;")
1028
1039
  );
1029
1040
  }
1030
- }, he = (t, e) => {
1031
- N() && t.isFirstLevel && Ye(t.element, e);
1032
- }, Ze = (t) => {
1033
- t.querySelectorAll(`[${T}]`).forEach((e) => {
1041
+ }, ve = (t, e) => {
1042
+ N() && t.isFirstLevel && et(t.element, e);
1043
+ }, tt = (t) => {
1044
+ t.querySelectorAll(`[${O}]`).forEach((e) => {
1034
1045
  const r = JSON.parse(
1035
- (e.getAttribute(T) ?? "{}").replace(/&quot;/g, '"')
1046
+ (e.getAttribute(O) ?? "{}").replace(/&quot;/g, '"')
1036
1047
  );
1037
1048
  for (const [s, n] of Object.entries(r))
1038
1049
  e.setAttribute(s, n);
1039
- e.removeAttribute(T);
1050
+ e.removeAttribute(O);
1040
1051
  });
1041
1052
  };
1042
- function Ke(t) {
1043
- t.setAttribute($, t.className);
1053
+ function rt(t) {
1054
+ t.setAttribute(M, t.className);
1044
1055
  }
1045
- const de = (t) => {
1046
- N() && t.isFirstLevel && Ke(t.element);
1047
- }, xe = (t) => {
1048
- t.querySelectorAll(`[${$}]`).forEach((e) => {
1049
- const r = e.getAttribute($);
1050
- r !== null && (e.className = r, e.removeAttribute($));
1056
+ const ye = (t) => {
1057
+ N() && t.isFirstLevel && rt(t.element);
1058
+ }, st = (t) => {
1059
+ t.querySelectorAll(`[${M}]`).forEach((e) => {
1060
+ const r = e.getAttribute(M);
1061
+ r !== null && (e.className = r, e.removeAttribute(M));
1051
1062
  });
1052
- }, pe = (t) => {
1053
- t.setAttribute(fe, "");
1054
- }, et = (t) => {
1055
- t.querySelectorAll(`[${fe}]`).forEach((e) => {
1056
- _(e);
1063
+ }, Se = (t) => {
1064
+ t.setAttribute(_e, "");
1065
+ }, nt = (t) => {
1066
+ t.querySelectorAll(`[${_e}]`).forEach((e) => {
1067
+ m(e);
1057
1068
  });
1058
- }, tt = (t) => {
1059
- t.setAttribute(V, t.textContent ?? "");
1060
- }, me = (t) => {
1061
- N() && t.isFirstLevel && tt(t.element);
1062
- }, rt = (t) => {
1063
- t.querySelectorAll(`[${V}]`).forEach((e) => {
1064
- e.textContent = e.getAttribute(V), e.removeAttribute(V);
1069
+ }, ot = (t) => {
1070
+ t.setAttribute($, t.textContent ?? "");
1071
+ }, we = (t) => {
1072
+ N() && t.isFirstLevel && ot(t.element);
1073
+ }, it = (t) => {
1074
+ t.querySelectorAll(`[${$}]`).forEach((e) => {
1075
+ e.textContent = e.getAttribute($), e.removeAttribute($);
1065
1076
  });
1066
- }, st = (t) => {
1067
- et(t), xe(t), Ze(t), rt(t);
1068
- }, ge = () => {
1077
+ }, lt = (t) => {
1078
+ nt(t), st(t), tt(t), it(t);
1079
+ }, Ae = () => {
1069
1080
  const t = globalThis;
1070
1081
  return t.__tempoSSR__ == null && (t.__tempoSSR__ = {
1071
1082
  isSSR: !1,
1072
1083
  counter: 0
1073
1084
  }), t.__tempoSSR__;
1074
- }, H = (t, e) => {
1075
- const r = ge();
1085
+ }, Q = (t, e) => {
1086
+ const r = Ae();
1076
1087
  r[t] = e;
1077
- }, _e = (t) => ge()[t], U = (t) => {
1078
- H("isSSR", t);
1079
- }, W = () => _e("counter"), nt = () => {
1080
- H("counter", (W() ?? 0) + 1);
1081
- }, ot = () => {
1082
- H("counter", (W() ?? 0) - 1);
1083
- }, kt = (t = 30) => (U(!0), new Promise((e, r) => {
1088
+ }, Ee = (t) => Ae()[t], W = (t) => {
1089
+ Q("isSSR", t);
1090
+ }, Y = () => Ee("counter"), ut = () => {
1091
+ Q("counter", (Y() ?? 0) + 1);
1092
+ }, at = () => {
1093
+ Q("counter", (Y() ?? 0) - 1);
1094
+ }, Vt = (t = 30) => (W(!0), new Promise((e, r) => {
1084
1095
  let s;
1085
1096
  const n = setInterval(() => {
1086
- W() <= 0 && (clearInterval(n), clearTimeout(s), U(!1), e());
1097
+ Y() <= 0 && (clearInterval(n), clearTimeout(s), W(!1), e());
1087
1098
  }, 30);
1088
1099
  s = setTimeout(() => {
1089
- clearInterval(n), U(!1), r(new Error("SSR Timeout"));
1100
+ clearInterval(n), W(!1), r(new Error("SSR Timeout"));
1090
1101
  }, t * 1e3);
1091
- })), Nt = (t) => (nt(), f(t(ot))), N = () => _e("isSSR"), ve = (t, e) => {
1102
+ })), qt = (t) => (ut(), c(t(at))), N = () => Ee("isSSR"), Pe = (t, e) => {
1092
1103
  if (typeof e == "function")
1093
- return ve(t, { then: e });
1094
- const r = e.pending != null ? f(e.pending) : w, s = e.then, n = e.error != null ? (o) => f(e.error(o)) : () => w;
1104
+ return Pe(t, { then: e });
1105
+ const r = e.pending != null ? c(e.pending) : S, s = e.then, n = e.error != null ? (o) => c(e.error(o)) : () => S;
1095
1106
  return (o) => {
1096
1107
  let i = !0;
1097
1108
  const l = t();
1098
1109
  o = o.makeRef();
1099
- let a = f(r)(o);
1110
+ let a = c(r)(o);
1100
1111
  return l.then(
1101
- (c) => {
1102
- i && (a(!0), a = f(s(c))(o));
1112
+ (f) => {
1113
+ i && (a(!0), a = c(s(f))(o));
1103
1114
  },
1104
- (c) => {
1105
- i && (a(!0), a = f(n(c))(o));
1115
+ (f) => {
1116
+ i && (a(!0), a = c(n(f))(o));
1106
1117
  }
1107
- ), (c) => {
1108
- i = !1, a(c), c && o.reference && _(o.reference);
1118
+ ), (f) => {
1119
+ i = !1, a(f), f && o.reference && m(o.reference);
1109
1120
  };
1110
1121
  };
1111
- }, Rt = (t, e) => ve(() => t, e), ye = (t, e) => (r) => (r.element.addEventListener(t, e), (s) => {
1122
+ }, It = (t, e) => Pe(() => t, e), De = (t, e) => (r) => (r.element.addEventListener(t, e), (s) => {
1112
1123
  s && r.element.removeEventListener(t, e);
1113
- }), it = (t) => ye("click", (e) => {
1124
+ }), ct = (t) => De("click", (e) => {
1114
1125
  e.preventDefault();
1115
1126
  const r = e.target;
1116
1127
  setTimeout(() => {
@@ -1125,15 +1136,15 @@ const de = (t) => {
1125
1136
  * @param fn - The function to call when the event is triggered.
1126
1137
  * @returns A `Renderable` function that adds the event listener to the element.
1127
1138
  */
1128
- get: (t, e) => (r) => ye(e, r)
1139
+ get: (t, e) => (r) => De(e, r)
1129
1140
  }
1130
- ), lt = (t) => (e) => {
1141
+ ), ft = (t) => (e) => {
1131
1142
  const r = e.target;
1132
1143
  t(r.value);
1133
- }, ut = (t) => (e) => {
1144
+ }, ht = (t) => (e) => {
1134
1145
  const r = e.target;
1135
1146
  t(r.valueAsNumber);
1136
- }, at = (t) => (e) => {
1147
+ }, dt = (t) => (e) => {
1137
1148
  const r = e.target;
1138
1149
  if (r.value === "")
1139
1150
  return;
@@ -1143,7 +1154,7 @@ const de = (t) => {
1143
1154
  Number(s[2].substring(0, 2))
1144
1155
  );
1145
1156
  t(n);
1146
- }, ct = (t) => (e) => {
1157
+ }, pt = (t) => (e) => {
1147
1158
  const r = e.target;
1148
1159
  if (r.value === "")
1149
1160
  return;
@@ -1153,57 +1164,57 @@ const de = (t) => {
1153
1164
  Number(n[2])
1154
1165
  ), i = s[1].split(":");
1155
1166
  o.setHours(Number(i[0])), o.setMinutes(Number(i[1])), o.setSeconds(Number(i[2])), t(o);
1156
- }, Mt = (t) => (e) => {
1167
+ }, Bt = (t) => (e) => {
1157
1168
  const r = e.target;
1158
1169
  t(r.checked);
1159
- }, $t = (t) => (e) => {
1170
+ }, jt = (t) => (e) => {
1160
1171
  e.preventDefault(), t();
1161
- }, Vt = (t) => (e) => {
1172
+ }, Ut = (t) => (e) => {
1162
1173
  e.stopPropagation(), t();
1163
- }, Ft = (t) => (e) => {
1174
+ }, Gt = (t) => (e) => {
1164
1175
  e.stopImmediatePropagation(), t();
1165
- }, qt = (t, e = "input") => g(
1176
+ }, Jt = (t, e = "input") => p(
1166
1177
  P.valueAsDate(t),
1167
- B[e](at(t.set))
1168
- ), It = (t, e = "input") => g(
1178
+ B[e](dt(t.set))
1179
+ ), Ht = (t, e = "input") => p(
1169
1180
  P.valueAsDate(t),
1170
- B[e](ct(t.set))
1171
- ), Bt = (t, e = "input") => g(
1181
+ B[e](pt(t.set))
1182
+ ), Wt = (t, e = "input") => p(
1172
1183
  P.valueAsNumber(t),
1173
- B[e](ut(t.set))
1174
- ), jt = (t, e = "input") => g(P.value(t), B[e](lt(t.set))), Ut = (t) => g(P.checked(t), it(t.set)), X = (t, e) => {
1184
+ B[e](ht(t.set))
1185
+ ), Xt = (t, e = "input") => p(P.value(t), B[e](ft(t.set))), zt = (t) => p(P.checked(t), ct(t.set)), Z = (t, e) => {
1175
1186
  if (h.is(t))
1176
1187
  return (s) => {
1177
1188
  s = s.makeRef();
1178
1189
  let n, o;
1179
- const i = t.map((c) => Object.keys(c)[0]);
1190
+ const i = t.map((f) => Object.keys(f)[0]);
1180
1191
  let l;
1181
- const a = i.on((c) => {
1182
- if (c !== l) {
1183
- o == null || o.dispose(), n == null || n(!0), o = t.map((v) => v[c]);
1184
- const d = e[c](o);
1185
- n = f(d)(s), l = c;
1192
+ const a = i.on((f) => {
1193
+ if (f !== l) {
1194
+ o == null || o.dispose(), n == null || n(!0), o = t.map((w) => w[f]);
1195
+ const g = e[f](o);
1196
+ n = c(g)(s), l = f;
1186
1197
  }
1187
1198
  });
1188
- return (c) => {
1189
- a(), c && s.reference != null && _(s.reference), n == null || n(!0);
1199
+ return (f) => {
1200
+ a(), f && s.reference != null && m(s.reference), n == null || n(!0);
1190
1201
  };
1191
1202
  };
1192
1203
  const r = Object.keys(t)[0];
1193
- return f(e[r](I(t[r])));
1194
- }, Se = (t, e, r) => X(
1195
- m.map(t, (s) => ({ [s[e]]: s })),
1204
+ return c(e[r](I(t[r])));
1205
+ }, be = (t, e, r) => Z(
1206
+ d.map(t, (s) => ({ [s[e]]: s })),
1196
1207
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1197
1208
  r
1198
- ), Gt = (t, e) => Se(t, "kind", e), Jt = (t, e) => {
1199
- const r = m.map(t, ([s, n]) => ({ [s]: n }));
1200
- return X(r, e);
1201
- }, Ht = (t, e) => Se(t, "type", e), z = (t, e) => X(
1202
- m.map(t, (r) => ({ [r]: !0 })),
1209
+ ), Qt = (t, e) => be(t, "kind", e), Yt = (t, e) => {
1210
+ const r = d.map(t, ([s, n]) => ({ [s]: n }));
1211
+ return Z(r, e);
1212
+ }, Zt = (t, e) => be(t, "type", e), mt = (t, e) => Z(
1213
+ d.map(t, (r) => ({ [r]: !0 })),
1203
1214
  e
1204
- ), Wt = (t, e = {}) => (r) => {
1215
+ ), Kt = (t, e = {}) => (r) => {
1205
1216
  const s = (e == null ? void 0 : e.firstSeparator) ?? t, n = (e == null ? void 0 : e.lastSeparator) ?? t;
1206
- return z(
1217
+ return mt(
1207
1218
  r.map((o) => o.isFirst ? "first" : o.isLast ? "last" : "other"),
1208
1219
  {
1209
1220
  first: () => s,
@@ -1211,15 +1222,15 @@ const de = (t) => {
1211
1222
  other: () => t
1212
1223
  }
1213
1224
  );
1214
- }, we = (t, e) => (r) => {
1225
+ }, Te = (t, e) => (r) => {
1215
1226
  const s = Object.values(t).reduce((n, o) => {
1216
1227
  const i = r.getProvider(o);
1217
1228
  if (i == null)
1218
1229
  throw new Error(`No provider found for mark: ${o.description}`);
1219
1230
  return n[o] = i, n;
1220
1231
  }, {});
1221
- return f(e(s))(r);
1222
- }, Xt = (t, e) => (r) => {
1232
+ return c(e(s))(r);
1233
+ }, xt = (t, e) => (r) => {
1223
1234
  const s = [], n = Object.entries(t).reduce(
1224
1235
  (o, [i, l]) => (s.push(
1225
1236
  l((a) => (Reflect.set(o, i, a), null))(r)
@@ -1229,97 +1240,96 @@ const de = (t) => {
1229
1240
  return s.push(e(n)(r)), (o) => {
1230
1241
  s.forEach((i) => i(o));
1231
1242
  };
1232
- }, zt = (t, e) => we([t], (r) => f(e(r[t]))), Qt = (t, e) => we(t, (r) => f(e(r))), Yt = (t) => (e) => t(e), Zt = (t) => (e) => (e.appendOrInsert(t), (r) => {
1233
- r && _(t);
1234
- }), ft = (t, e, r) => {
1243
+ }, er = (t, e) => Te([t], (r) => c(e(r[t]))), tr = (t, e) => Te(t, (r) => c(e(r))), rr = (t) => (e) => t(e), sr = (t) => (e) => (e.appendOrInsert(t), (r) => {
1244
+ r && m(t);
1245
+ }), gt = (t, e, r) => {
1235
1246
  if (h.is(t)) {
1236
1247
  const s = t;
1237
1248
  return (n) => {
1238
1249
  n = n.makeRef();
1239
1250
  let o = null, i = !1;
1240
- const l = L(null), a = s.on((c) => {
1241
- c == null ? (o == null || o(!0), o = f((r == null ? void 0 : r()) ?? w)(n), i = !1) : (l.value = c, i || (o == null || o(!0), o = f(e(l))(n), i = !0));
1251
+ const l = V(null), a = s.on((f) => {
1252
+ f == null ? (o == null || o(!0), o = c((r == null ? void 0 : r()) ?? S)(n), i = !1) : (l.value = f, i || (o == null || o(!0), o = c(e(l))(n), i = !0));
1242
1253
  });
1243
- return (c) => {
1244
- a(), o == null || o(c), c && n.reference && _(n.reference);
1254
+ return (f) => {
1255
+ a(), o == null || o(f), f && n.reference && m(n.reference);
1245
1256
  };
1246
1257
  };
1247
1258
  } else {
1248
1259
  const s = t;
1249
1260
  if (s == null) {
1250
1261
  const n = r == null ? void 0 : r();
1251
- return n != null ? f(n) : w;
1262
+ return n != null ? c(n) : S;
1252
1263
  }
1253
- return f(e(I(s)));
1264
+ return c(e(I(s)));
1254
1265
  }
1255
- }, G = (t) => (e) => (r) => t(r, e), Ae = (t, e, r) => r != null ? Ae(t, (s) => {
1256
- const n = s.map((i) => new M(i.index, i.total - 1)), o = s.map((i) => i.isLast ? "last" : "other");
1257
- return g(
1258
- G(() => {
1259
- n.dispose(), o.dispose();
1260
- }),
1261
- f(e(s)),
1262
- z(o, {
1263
- last: () => w,
1264
- other: () => r(n)
1265
- })
1266
+ }, X = (t) => (e) => (r) => t(r, e), j = (t, e, r) => gt(
1267
+ d.map(t, (s) => s ? !0 : null),
1268
+ () => e,
1269
+ r != null ? () => r : void 0
1270
+ ), nr = (t, e, r) => j(
1271
+ d.map(t, (s) => !s),
1272
+ e,
1273
+ r
1274
+ ), Oe = (t, e, r) => r != null ? Oe(t, (s) => {
1275
+ const n = new T(
1276
+ s.index,
1277
+ s.total.map((o) => o - 1)
1278
+ );
1279
+ return p(
1280
+ X(n.dispose),
1281
+ c(e(s)),
1282
+ j(s.isLast, S, r(n))
1266
1283
  );
1267
1284
  }) : h.is(t) ? (s) => {
1268
1285
  s = s.makeRef();
1269
- const n = t.map(
1270
- (a) => Array.from({ length: a }, (c, d) => d).map(
1271
- (c) => new M(c, a)
1272
- )
1273
- ), o = [], i = [], l = n.on((a) => {
1274
- var d, v;
1275
- const c = a.length;
1276
- for (; c < o.length; )
1277
- (d = o.pop()) == null || d(!0), (v = i.pop()) == null || v.dispose();
1278
- for (let p = 0; p < c; p++)
1279
- if (i[p] == null) {
1280
- i[p] = L(a[p]);
1281
- const D = f(e(i[p]));
1282
- o[p] = D(s);
1283
- } else
1284
- i[p].value = a[p];
1286
+ const n = Array.from(
1287
+ { length: t.value },
1288
+ (l, a) => a
1289
+ ).map((l) => new T(l, t)), o = n.map(
1290
+ (l) => c(e(l))(s)
1291
+ ), i = t.on((l) => {
1292
+ for (; l < o.length; )
1293
+ o.pop()(!0), n.pop().dispose();
1294
+ for (let a = 0; a < l; a++)
1295
+ if (n[a] == null) {
1296
+ n[a] = new T(a, t);
1297
+ const f = c(e(n[a]));
1298
+ o[a] = f(s);
1299
+ }
1285
1300
  });
1286
- return (a) => {
1287
- l(), a && s.reference && _(s.reference);
1301
+ return (l) => {
1302
+ i(), l && s.reference && m(s.reference);
1288
1303
  };
1289
- } : g(
1304
+ } : p(
1290
1305
  ...Array.from({ length: t }, (s, n) => n).map(
1291
- (s) => f(e(I(new M(s, t))))
1306
+ (s) => c(e(new T(s, I(t))))
1292
1307
  )
1293
- ), ht = (t, e, r) => r != null ? ht(t, (s, n) => {
1294
- const o = n.map((l) => new M(l.index, l.total - 1)), i = n.map((l) => l.isLast ? "last" : "other");
1295
- return g([
1296
- G(() => {
1297
- i.dispose(), o.dispose();
1298
- }),
1299
- f(e(s, n)),
1300
- z(i, {
1301
- last: () => w,
1302
- other: () => r(o)
1303
- })
1308
+ ), _t = (t, e, r) => r != null ? _t(t, (s, n) => {
1309
+ const o = new T(
1310
+ n.index,
1311
+ n.total.map((i) => i - 1)
1312
+ );
1313
+ return p([
1314
+ X(o.dispose),
1315
+ c(e(s, n)),
1316
+ j(n.isLast, S, r(o))
1304
1317
  ]);
1305
1318
  }) : (s) => {
1306
- const n = m.map(t, (o) => o.length);
1307
- return Ae(n, (o) => {
1308
- const i = Fe(
1309
- o,
1310
- t
1311
- )((l, a) => a[l.index]);
1312
- return g(
1313
- G(() => i.dispose()),
1314
- f(e(i, o))
1319
+ const n = d.map(t, (i) => i.length), o = d.toSignal(t);
1320
+ return Oe(n, (i) => {
1321
+ const l = o.map((a) => a[i.index]);
1322
+ return p(
1323
+ X(l.dispose),
1324
+ c(e(l, i))
1315
1325
  );
1316
1326
  })(s);
1317
- }, Kt = (t, e) => {
1327
+ }, or = (t, e) => {
1318
1328
  if (h.is(t)) {
1319
1329
  const r = t;
1320
1330
  return (s) => {
1321
1331
  s = s.makeRef();
1322
- const n = r.map((l) => f(e(l)));
1332
+ const n = r.map((l) => c(e(l)));
1323
1333
  let o = () => {
1324
1334
  };
1325
1335
  const i = n.on((l) => {
@@ -1330,57 +1340,49 @@ const de = (t) => {
1330
1340
  };
1331
1341
  };
1332
1342
  }
1333
- return f(e(t));
1334
- }, Ee = (t, e, r) => ft(
1335
- m.map(t, (s) => s ? !0 : null),
1336
- () => e,
1337
- r != null ? () => r : void 0
1338
- ), xt = (t, e, r) => Ee(
1339
- m.map(t, (s) => !s),
1340
- e,
1341
- r
1342
- ), er = (t, e, r = w) => Ee(
1343
- m.map(t, (s) => s.length > 0),
1343
+ return c(e(t));
1344
+ }, ir = (t, e, r = S) => j(
1345
+ d.map(t, (s) => s.length > 0),
1344
1346
  e,
1345
1347
  r
1346
- ), tr = (t) => (e) => t(e.element) ?? (() => {
1347
- }), Pe = (t, e) => {
1348
+ ), lr = (t) => (e) => t(e.element) ?? (() => {
1349
+ }), Ce = (t, e) => {
1348
1350
  const r = t(e);
1349
1351
  return () => r(!0);
1350
- }, rr = (t, e, { doc: r, clear: s } = {}) => {
1352
+ }, ur = (t, e, { doc: r, clear: s } = {}) => {
1351
1353
  const n = typeof e == "string" ? (r ?? document).querySelector(e) : e;
1352
1354
  if (n === null)
1353
- throw new dt(
1355
+ throw new vt(
1354
1356
  `Cannot find element by selector for render: ${e}`
1355
1357
  );
1356
- s !== !1 && (r ?? n.ownerDocument) != null && st(r ?? n.ownerDocument);
1357
- const o = He(n), i = ie(n) ? void 0 : n, l = S.of(o, i);
1358
- return Pe(t, l);
1358
+ s !== !1 && (r ?? n.ownerDocument) != null && lt(r ?? n.ownerDocument);
1359
+ const o = Qe(n), i = he(n) ? void 0 : n, l = v.of(o, i);
1360
+ return Ce(t, l);
1359
1361
  };
1360
- class dt extends Error {
1362
+ class vt extends Error {
1361
1363
  constructor(e) {
1362
1364
  super(e);
1363
1365
  }
1364
1366
  }
1365
- const sr = (t, e) => (r) => {
1367
+ const ar = (t, e) => (r) => {
1366
1368
  const s = r.document.querySelector(t);
1367
1369
  if (s === null)
1368
1370
  throw new Error(`Cannot find element by selector for portal: ${t}`);
1369
- return Pe(
1370
- f(e),
1371
+ return Ce(
1372
+ c(e),
1371
1373
  r.withElement(s).withFirstLevel()
1372
1374
  );
1373
- }, nr = (t) => Symbol(t), De = (t, e) => (r) => f(e)(r.withProviders(t)), or = (...t) => t.length > 0 ? t.reduceRight((e, r) => (s) => e(r(s))) : f, ir = (t, e, r) => De({ [t]: e }, f(r)), lr = (t, e) => De(t, f(e)), pt = (t, e) => (r) => {
1375
+ }, cr = (t) => Symbol(t), ke = (t, e) => (r) => c(e)(r.withProviders(t)), fr = (...t) => t.length > 0 ? t.reduceRight((e, r) => (s) => e(r(s))) : c, hr = (t, e, r) => ke({ [t]: e }, c(r)), dr = (t, e) => ke(t, c(e)), yt = (t, e) => (r) => {
1374
1376
  const s = r.element, n = s.style.getPropertyValue(t);
1375
1377
  return s.style.setProperty(t, e), (o) => {
1376
1378
  o && s.style.setProperty(t, n);
1377
1379
  };
1378
- }, mt = (t, e) => (r) => {
1380
+ }, St = (t, e) => (r) => {
1379
1381
  const s = r.element, n = s.style.getPropertyValue(t);
1380
1382
  return e.on((o) => s.style.setProperty(t, o)), (o) => {
1381
1383
  o && s.style.setProperty(t, n);
1382
1384
  };
1383
- }, ur = new Proxy(
1385
+ }, pr = new Proxy(
1384
1386
  {},
1385
1387
  {
1386
1388
  /**
@@ -1391,116 +1393,116 @@ const sr = (t, e) => (r) => {
1391
1393
  * @returns The renderable component for the specified attribute.
1392
1394
  *
1393
1395
  */
1394
- get: (t, e) => (r) => h.is(r) ? mt(e, r) : pt(e, r)
1396
+ get: (t, e) => (r) => h.is(r) ? St(e, r) : yt(e, r)
1395
1397
  }
1396
1398
  );
1397
1399
  export {
1398
- Rt as Async,
1399
- Ut as BindChecked,
1400
- qt as BindDate,
1401
- It as BindDateTime,
1402
- Bt as BindNumber,
1403
- jt as BindText,
1400
+ It as Async,
1401
+ zt as BindChecked,
1402
+ Jt as BindDate,
1403
+ Ht as BindDateTime,
1404
+ Wt as BindNumber,
1405
+ Xt as BindText,
1404
1406
  E as Computed,
1405
- Wt as Conjunction,
1406
- S as DOMContext,
1407
- Zt as DOMNode,
1408
- ae as El,
1409
- ce as ElNS,
1410
- M as ElementPosition,
1411
- w as Empty,
1412
- ft as Ensure,
1413
- ht as ForEach,
1414
- g as Fragment,
1415
- Kt as MapSignal,
1416
- K as MemoryStore,
1417
- er as NotEmpty,
1418
- it as OnChecked,
1419
- Yt as OnCtx,
1420
- tr as OnMount,
1421
- G as OnUnmount,
1422
- X as OneOf,
1423
- Se as OneOfField,
1424
- Gt as OneOfKind,
1425
- Jt as OneOfTuple,
1426
- Ht as OneOfType,
1427
- z as OneOfValue,
1428
- sr as Portal,
1407
+ Kt as Conjunction,
1408
+ v as DOMContext,
1409
+ sr as DOMNode,
1410
+ me as El,
1411
+ ge as ElNS,
1412
+ T as ElementPosition,
1413
+ S as Empty,
1414
+ gt as Ensure,
1415
+ _t as ForEach,
1416
+ p as Fragment,
1417
+ or as MapSignal,
1418
+ ne as MemoryStore,
1419
+ ir as NotEmpty,
1420
+ ct as OnChecked,
1421
+ rr as OnCtx,
1422
+ lr as OnMount,
1423
+ X as OnUnmount,
1424
+ Z as OneOf,
1425
+ be as OneOfField,
1426
+ Qt as OneOfKind,
1427
+ Yt as OneOfTuple,
1428
+ Zt as OneOfType,
1429
+ mt as OneOfValue,
1430
+ ar as Portal,
1429
1431
  F as Prop,
1430
- or as Provide,
1431
- Je as ProviderNotFoundError,
1432
- dt as RenderingError,
1433
- Ae as Repeat,
1432
+ fr as Provide,
1433
+ ze as ProviderNotFoundError,
1434
+ vt as RenderingError,
1435
+ Oe as Repeat,
1434
1436
  h as Signal,
1435
- ve as Task,
1436
- At as TextNode,
1437
- xt as Unless,
1438
- Xt as Use,
1439
- zt as UseProvider,
1440
- Qt as UseProviders,
1441
- Nt as UseSSRDone,
1442
- m as Value,
1443
- Ee as When,
1444
- ir as WithProvider,
1445
- lr as WithProviders,
1446
- pe as _addNodeTracker,
1447
- st as _clearSSR,
1448
- He as _getSelfOrParentElement,
1449
- ie as _isElement,
1450
- oe as _makeGetter,
1451
- ne as _makeSetter,
1452
- he as _maybeAddAttributeTracker,
1453
- de as _maybeAddClassTracker,
1454
- me as _maybeAddTextTracker,
1455
- _ as _removeDOMNode,
1456
- Ge as _setAttribute,
1457
- Ie as _setBooleanProperty,
1458
- je as _setDateProperty,
1459
- Be as _setNumberProperty,
1460
- Ue as _setStringProperty,
1461
- ue as _signalText,
1462
- le as _staticText,
1463
- St as animateSignal,
1464
- qe as animateSignals,
1465
- Pt as aria,
1437
+ Pe as Task,
1438
+ Ot as TextNode,
1439
+ nr as Unless,
1440
+ xt as Use,
1441
+ er as UseProvider,
1442
+ tr as UseProviders,
1443
+ qt as UseSSRDone,
1444
+ d as Value,
1445
+ j as When,
1446
+ hr as WithProvider,
1447
+ dr as WithProviders,
1448
+ Se as _addNodeTracker,
1449
+ lt as _clearSSR,
1450
+ Qe as _getSelfOrParentElement,
1451
+ he as _isElement,
1452
+ fe as _makeGetter,
1453
+ ce as _makeSetter,
1454
+ ve as _maybeAddAttributeTracker,
1455
+ ye as _maybeAddClassTracker,
1456
+ we as _maybeAddTextTracker,
1457
+ m as _removeDOMNode,
1458
+ Xe as _setAttribute,
1459
+ Ge as _setBooleanProperty,
1460
+ He as _setDateProperty,
1461
+ Je as _setNumberProperty,
1462
+ We as _setStringProperty,
1463
+ pe as _signalText,
1464
+ de as _staticText,
1465
+ bt as animateSignal,
1466
+ Ue as animateSignals,
1467
+ kt as aria,
1466
1468
  P as attr,
1467
- Et as dataAttr,
1468
- Mt as emitChecked,
1469
- $t as emitPreventDefault,
1470
- Ft as emitStopImmediatePropagation,
1471
- Vt as emitStopPropagation,
1472
- lt as emitValue,
1473
- at as emitValueAsDate,
1474
- ct as emitValueAsDateTime,
1475
- ut as emitValueAsNumber,
1476
- Re as endInterpolate,
1477
- Me as guessInterpolate,
1478
- Tt as html,
1479
- Ct as input,
1480
- Ne as interpolateDate,
1481
- Oe as interpolateNumber,
1482
- ke as interpolateString,
1469
+ Ct as dataAttr,
1470
+ Bt as emitChecked,
1471
+ jt as emitPreventDefault,
1472
+ Gt as emitStopImmediatePropagation,
1473
+ Ut as emitStopPropagation,
1474
+ ft as emitValue,
1475
+ dt as emitValueAsDate,
1476
+ pt as emitValueAsDateTime,
1477
+ ht as emitValueAsNumber,
1478
+ qe as endInterpolate,
1479
+ Ie as guessInterpolate,
1480
+ Rt as html,
1481
+ Mt as input,
1482
+ Ve as interpolateDate,
1483
+ $e as interpolateNumber,
1484
+ Fe as interpolateString,
1483
1485
  N as isSSR,
1484
- vt as localStorageProp,
1485
- J as makeComputed,
1486
- Fe as makeComputedOf,
1487
- wt as makeComputedRecord,
1488
- Ve as makeEffect,
1489
- _t as makeEffectOf,
1490
- L as makeProp,
1491
- nr as makeProviderMark,
1486
+ Pt as localStorageProp,
1487
+ z as makeComputed,
1488
+ At as makeComputedOf,
1489
+ Tt as makeComputedRecord,
1490
+ je as makeEffect,
1491
+ Et as makeEffectOf,
1492
+ V as makeProp,
1493
+ cr as makeProviderMark,
1492
1494
  I as makeSignal,
1493
- Ot as math,
1494
- bt as mathAttr,
1495
+ Ft as math,
1496
+ Nt as mathAttr,
1495
1497
  B as on,
1496
- kt as prepareSSR,
1497
- rt as removeTextTrackers,
1498
- rr as render,
1499
- Pe as renderWithContext,
1500
- f as renderableOfTNode,
1501
- yt as sessionStorageProp,
1502
- x as storedProp,
1503
- ur as style,
1504
- Lt as svg,
1505
- Dt as svgAttr
1498
+ Vt as prepareSSR,
1499
+ it as removeTextTrackers,
1500
+ ur as render,
1501
+ Ce as renderWithContext,
1502
+ c as renderableOfTNode,
1503
+ Dt as sessionStorageProp,
1504
+ oe as storedProp,
1505
+ pr as style,
1506
+ $t as svg,
1507
+ Lt as svgAttr
1506
1508
  };