@tempots/dom 9.0.2 → 10.0.1

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.
Files changed (129) hide show
  1. package/README.md +1 -1
  2. package/{components → dom}/animatable.d.ts +7 -1
  3. package/dom/attr.d.ts +73 -0
  4. package/dom/dom-context.d.ts +108 -0
  5. package/dom/dom-utils.d.ts +21 -0
  6. package/dom/handle-anchor-click.d.ts +13 -0
  7. package/dom/ssr-tracker.d.ts +14 -0
  8. package/dom/ssr.d.ts +8 -0
  9. package/index.cjs +1 -0
  10. package/index.d.ts +52 -34
  11. package/index.js +1412 -31
  12. package/mountable/appearance.d.ts +38 -0
  13. package/mountable/async.d.ts +7 -0
  14. package/mountable/attribute.d.ts +489 -0
  15. package/mountable/autofocus.d.ts +3 -0
  16. package/mountable/autoselect.d.ts +3 -0
  17. package/mountable/bind.d.ts +16 -0
  18. package/mountable/conjunction.d.ts +8 -0
  19. package/mountable/consumers.d.ts +12 -0
  20. package/mountable/ctx.d.ts +3 -0
  21. package/mountable/domel.d.ts +3 -0
  22. package/mountable/element.d.ts +236 -0
  23. package/mountable/empty.d.ts +3 -0
  24. package/mountable/ensure.d.ts +4 -0
  25. package/mountable/foreach.d.ts +5 -0
  26. package/mountable/fragment.d.ts +3 -0
  27. package/mountable/handler.d.ts +102 -0
  28. package/mountable/hidden-when-empty.d.ts +3 -0
  29. package/mountable/html-title.d.ts +3 -0
  30. package/mountable/inviewport.d.ts +6 -0
  31. package/mountable/map-signal.d.ts +4 -0
  32. package/mountable/not-empty.d.ts +4 -0
  33. package/mountable/ondispose.d.ts +4 -0
  34. package/mountable/oneof.d.ts +22 -0
  35. package/mountable/onmount.d.ts +3 -0
  36. package/mountable/portal.d.ts +4 -0
  37. package/mountable/providers.d.ts +16 -0
  38. package/mountable/render.d.ts +8 -0
  39. package/mountable/repeat.d.ts +5 -0
  40. package/mountable/size.d.ts +8 -0
  41. package/mountable/style.d.ts +503 -0
  42. package/mountable/task.d.ts +7 -0
  43. package/mountable/text.d.ts +6 -0
  44. package/mountable/when.d.ts +4 -0
  45. package/package.json +15 -8
  46. package/std/interpolate.d.ts +5 -0
  47. package/std/position.d.ts +9 -0
  48. package/std/signal.d.ts +120 -0
  49. package/types/aria-attributes.d.ts +50 -0
  50. package/types/css-styles.d.ts +3 -0
  51. package/types/domain.d.ts +14 -0
  52. package/types/html-attributes.d.ts +115 -0
  53. package/types/html-events.d.ts +89 -0
  54. package/types/html-tags.d.ts +113 -0
  55. package/types/mathml-attributes.d.ts +50 -0
  56. package/types/mathml-tags.d.ts +30 -0
  57. package/types/svg-attributes.d.ts +243 -0
  58. package/types/svg-tags.d.ts +64 -0
  59. package/clean.d.ts +0 -2
  60. package/clean.js +0 -1
  61. package/components/Attribute.d.ts +0 -15
  62. package/components/Attribute.js +0 -16
  63. package/components/Autofocus.d.ts +0 -2
  64. package/components/Autofocus.js +0 -4
  65. package/components/BooleanAttribute.d.ts +0 -15
  66. package/components/BooleanAttribute.js +0 -16
  67. package/components/ClassName.d.ts +0 -13
  68. package/components/ClassName.js +0 -14
  69. package/components/El.d.ts +0 -15
  70. package/components/El.js +0 -21
  71. package/components/FadeIn.d.ts +0 -20
  72. package/components/FadeIn.js +0 -54
  73. package/components/FadeOut.d.ts +0 -16
  74. package/components/FadeOut.js +0 -39
  75. package/components/For.d.ts +0 -18
  76. package/components/For.js +0 -27
  77. package/components/Fragment.d.ts +0 -12
  78. package/components/Fragment.js +0 -16
  79. package/components/HiddenWhenEmpty.d.ts +0 -7
  80. package/components/HiddenWhenEmpty.js +0 -13
  81. package/components/If.d.ts +0 -14
  82. package/components/If.js +0 -19
  83. package/components/InnerHTML.d.ts +0 -13
  84. package/components/InnerHTML.js +0 -23
  85. package/components/Lifecycle.d.ts +0 -14
  86. package/components/Lifecycle.js +0 -18
  87. package/components/NotEmpty.d.ts +0 -9
  88. package/components/NotEmpty.js +0 -11
  89. package/components/On.d.ts +0 -15
  90. package/components/On.js +0 -14
  91. package/components/OnRemove.d.ts +0 -6
  92. package/components/OnRemove.js +0 -4
  93. package/components/OneOf.d.ts +0 -62
  94. package/components/OneOf.js +0 -68
  95. package/components/Portal.d.ts +0 -15
  96. package/components/Portal.js +0 -20
  97. package/components/Property.d.ts +0 -15
  98. package/components/Property.js +0 -16
  99. package/components/Provider.d.ts +0 -28
  100. package/components/Provider.js +0 -44
  101. package/components/Repeat.d.ts +0 -28
  102. package/components/Repeat.js +0 -146
  103. package/components/Show.d.ts +0 -15
  104. package/components/Show.js +0 -8
  105. package/components/Text.d.ts +0 -15
  106. package/components/Text.js +0 -33
  107. package/components/TextContent.d.ts +0 -13
  108. package/components/TextContent.js +0 -23
  109. package/components/animatable.js +0 -283
  110. package/dom-context.d.ts +0 -39
  111. package/dom-context.js +0 -263
  112. package/helpers/handle-anchor-click.d.ts +0 -4
  113. package/helpers/handle-anchor-click.js +0 -43
  114. package/helpers/handle-text-input.d.ts +0 -1
  115. package/helpers/handle-text-input.js +0 -4
  116. package/helpers/is-empty-element.d.ts +0 -2
  117. package/helpers/is-empty-element.js +0 -8
  118. package/jsx-dev-runtime.d.ts +0 -1
  119. package/jsx-dev-runtime.js +0 -1
  120. package/jsx-runtime.d.ts +0 -9
  121. package/jsx-runtime.js +0 -157
  122. package/jsx.d.ts +0 -806
  123. package/jsx.js +0 -1
  124. package/prop.d.ts +0 -58
  125. package/prop.js +0 -256
  126. package/render.d.ts +0 -3
  127. package/render.js +0 -7
  128. package/renderable.d.ts +0 -5
  129. package/renderable.js +0 -1
package/index.js CHANGED
@@ -1,31 +1,1412 @@
1
- export { makeProviderMark, DOMContext } from './dom-context';
2
- export { Prop, Signal } from './prop';
3
- export { render } from './render';
4
- export { isEmptyElement } from './helpers/is-empty-element';
5
- export { handleTextInput } from './helpers/handle-text-input';
6
- export { handleAnchorClick } from './helpers/handle-anchor-click';
7
- export { applyInterpolatedAnimatableProp, applyInterpolatedAnimatable, applyAnimatableProp, applyAnimatable, getComputedAnimatableProp, getComputedAnimatable } from './components/animatable';
8
- export { AttributeImpl, Attribute } from './components/Attribute';
9
- export { Autofocus } from './components/Autofocus';
10
- export { BooleanAttributeImpl, BooleanAttribute } from './components/BooleanAttribute';
11
- export { ClassNameImpl, ClassName } from './components/ClassName';
12
- export { ConsumerImpl, Consumer, ProviderImpl, Provider } from './components/Provider';
13
- export { ElImpl, El } from './components/El';
14
- export { FadeIn, FadeInImpl } from './components/FadeIn';
15
- export { FadeOut, FadeOutImpl } from './components/FadeOut';
16
- export { For } from './components/For';
17
- export { FragmentImpl, Fragment } from './components/Fragment';
18
- export { HiddenWhenEmptyImpl, HiddenWhenEmpty } from './components/HiddenWhenEmpty';
19
- export { If, Unless, When } from './components/If';
20
- export { InnerHTMLImpl, InnerHTML } from './components/InnerHTML';
21
- export { Lifecycle, LifecycleImpl } from './components/Lifecycle';
22
- export { NotEmpty } from './components/NotEmpty';
23
- export { OnImpl, On } from './components/On';
24
- export { OnRemove } from './components/OnRemove';
25
- export { OneOfImpl, OneOf, OneOfLiteral, OneOfUnion, OneOfUnionKind, OneOfUnionType } from './components/OneOf';
26
- export { PortalImpl, Portal } from './components/Portal';
27
- export { PropertyImpl, Property } from './components/Property';
28
- export { RepeatImpl, Repeat, conjuctions } from './components/Repeat';
29
- export { Show } from './components/Show';
30
- export { TextImpl, Text } from './components/Text';
31
- export { TextContentImpl, TextContent } from './components/TextContent';
1
+ var We = Object.defineProperty;
2
+ var Fe = (t, e, r) => e in t ? We(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
+ var a = (t, e, r) => Fe(t, typeof e != "symbol" ? e + "" : e, r);
4
+ function ze(t, e, r) {
5
+ return t + (e - t) * r;
6
+ }
7
+ const Q = 97;
8
+ function Ve(t, e, r) {
9
+ const n = Math.max(t.length, e.length);
10
+ let s = "";
11
+ for (let i = 0; i < n; i++) {
12
+ let o = t.charCodeAt(i);
13
+ isNaN(o) && (o = Q);
14
+ let l = e.charCodeAt(i);
15
+ isNaN(l) && (l = Q), s += String.fromCharCode(o + (l - o) * r);
16
+ }
17
+ return s;
18
+ }
19
+ function qe(t, e, r) {
20
+ return new Date(t.getTime() + (e.getTime() - t.getTime()) * r);
21
+ }
22
+ function Ze(t, e, r) {
23
+ return e;
24
+ }
25
+ function Xe(t) {
26
+ return typeof t == "number" ? ze : typeof t == "string" ? Ve : t instanceof Date ? qe : Ze;
27
+ }
28
+ class Ye {
29
+ constructor(e, r) {
30
+ this.index = e, this.total = r;
31
+ }
32
+ get isFirst() {
33
+ return this.index === 0;
34
+ }
35
+ get isLast() {
36
+ return this.index === this.total - 1;
37
+ }
38
+ get isEven() {
39
+ return this.index % 2 === 0;
40
+ }
41
+ get isOdd() {
42
+ return this.index % 2 === 1;
43
+ }
44
+ }
45
+ const ee = Symbol("isSignal"), te = Symbol("isProp"), re = Symbol("isComputed");
46
+ var ue;
47
+ ue = ee;
48
+ const E = class E {
49
+ constructor(e, r) {
50
+ a(this, ue, !0);
51
+ a(this, "_value");
52
+ a(this, "_derivatives", []);
53
+ a(this, "_onValueListeners", []);
54
+ a(this, "_onDisposeListeners", []);
55
+ a(this, "get", () => this._value);
56
+ a(this, "hasListeners", () => this._onValueListeners.length > 0);
57
+ a(this, "on", (e) => (e(this.get()), this._onValueListeners.push(e), () => {
58
+ this._onValueListeners.splice(this._onValueListeners.indexOf(e), 1);
59
+ }));
60
+ a(this, "_setAndNotify", (e, r) => {
61
+ const n = this.equals(this._value, e);
62
+ n || (this._value = e), (r || !n) && this._onValueListeners.forEach((s) => s(e));
63
+ });
64
+ a(this, "_disposed", !1);
65
+ a(this, "isDisposed", () => this._disposed);
66
+ a(this, "onDispose", (e) => {
67
+ this._onDisposeListeners.push(e);
68
+ });
69
+ a(this, "dispose", () => {
70
+ this._disposed || (this._disposed = !0, this._onDisposeListeners.forEach((e) => e()), this._onDisposeListeners.length = 0, this._derivatives.length = 0);
71
+ });
72
+ a(this, "map", (e, r = (n, s) => n === s) => {
73
+ const n = new T(() => {
74
+ try {
75
+ return e(this.get());
76
+ } catch (s) {
77
+ throw console.error("Error in Signal.map:", s), s;
78
+ }
79
+ }, r);
80
+ return this.setDerivative(n), n;
81
+ });
82
+ a(this, "flatMap", (e, r = (n, s) => n === s) => {
83
+ const n = new T(() => {
84
+ try {
85
+ return e(this.get()).get();
86
+ } catch (s) {
87
+ throw console.error("Error in Signal.flatMap:", s), s;
88
+ }
89
+ }, r);
90
+ return this.setDerivative(n), n;
91
+ });
92
+ a(this, "tap", (e) => this.map((r) => (e(r), r)));
93
+ a(this, "at", (e) => this.map((r) => r[e]));
94
+ a(this, "filter", (e, r) => {
95
+ let n = r ?? this.get();
96
+ const s = new T(() => {
97
+ try {
98
+ const i = this.get();
99
+ return n = e(i) ? i : n;
100
+ } catch (i) {
101
+ throw console.error("Error in Signal.filter:", i), i;
102
+ }
103
+ }, this.equals);
104
+ return this.setDerivative(s), s;
105
+ });
106
+ a(this, "filterMap", (e, r, n = (s, i) => s === i) => {
107
+ let s = r;
108
+ const i = new T(() => {
109
+ try {
110
+ const o = this.get(), l = e(o);
111
+ return s = l ?? s;
112
+ } catch (o) {
113
+ throw console.error("Error in Signal.filterMap:", o), o;
114
+ }
115
+ }, n);
116
+ return this.setDerivative(i), i;
117
+ });
118
+ a(this, "mapAsync", (e, r, n, s = (i, o) => i === o) => {
119
+ const i = A(r, s);
120
+ let o = 0;
121
+ return i.onDispose(
122
+ this.on((l) => {
123
+ const u = ++o;
124
+ try {
125
+ e(l).then((c) => {
126
+ u === o && i.set(c);
127
+ }).catch((c) => {
128
+ u === o && (n != null ? i.set(n(c)) : console.error(
129
+ "Unhandled promise rejection in Signal.mapAsync:",
130
+ c
131
+ ));
132
+ });
133
+ } catch (c) {
134
+ throw console.error("Error in Signal.mapAsync:", c), c;
135
+ }
136
+ })
137
+ ), i;
138
+ });
139
+ a(this, "mapMaybe", (e, r) => this.map((n) => e(n) ?? r));
140
+ a(this, "feedProp", (e, r = !1) => {
141
+ const n = this.on(e.set);
142
+ return e.onDispose(n), r ? this.onDispose(e.dispose) : this.onDispose(n), e;
143
+ });
144
+ a(this, "deriveProp", (e = !0) => this.feedProp(A(this.get()), e));
145
+ a(this, "count", () => {
146
+ let e = 0;
147
+ return this.map(() => ++e);
148
+ });
149
+ a(this, "setDerivative", (e) => {
150
+ this._derivatives.push(e), e.onDispose(() => {
151
+ this._derivatives.splice(
152
+ this._derivatives.indexOf(e),
153
+ 1
154
+ );
155
+ }), e.onDispose(this.on(e.setDirty)), this.onDispose(e.dispose);
156
+ });
157
+ this.equals = r, this._value = e;
158
+ }
159
+ static ofPromise(e, r, n, s = (i, o) => i === o) {
160
+ const i = new E(r, s);
161
+ return e.then((o) => i._setAndNotify(o, !1)).catch((o) => {
162
+ n != null ? i._setAndNotify(n(o), !1) : console.error(
163
+ "Unhandled promise rejection in Signal.ofPromise:",
164
+ o
165
+ );
166
+ }), i;
167
+ }
168
+ static is(e) {
169
+ return e != null && e[ee] === !0;
170
+ }
171
+ static wrap(e, r = (n, s) => n === s) {
172
+ return E.is(e) ? e : new E(e, r);
173
+ }
174
+ static maybeWrap(e) {
175
+ return e == null ? e : E.wrap(e);
176
+ }
177
+ static unwrap(e) {
178
+ return E.is(e) ? e.get() : e;
179
+ }
180
+ static map(e, r) {
181
+ return E.is(e) ? e.map(r) : r(e);
182
+ }
183
+ get value() {
184
+ return this._value;
185
+ }
186
+ };
187
+ let d = E;
188
+ const He = typeof queueMicrotask == "function" ? queueMicrotask : (t) => Promise.resolve().then(t);
189
+ var ae, le;
190
+ class T extends (le = d, ae = re, le) {
191
+ constructor(r, n) {
192
+ super(void 0, n);
193
+ a(this, ae, !0);
194
+ a(this, "_isDirty", !1);
195
+ a(this, "setDirty", () => {
196
+ this._isDirty || this._disposed || (this._isDirty = !0, this._derivatives.forEach((r) => r.setDirty()), this.scheduleNotify());
197
+ });
198
+ a(this, "_scheduleCount", 0);
199
+ a(this, "scheduleNotify", () => {
200
+ const r = ++this._scheduleCount;
201
+ He(() => {
202
+ this._scheduleCount !== r || this._disposed !== !1 || this._isDirty && (this._isDirty = !1, this._setAndNotify(this._fn(), !1));
203
+ });
204
+ });
205
+ a(this, "get", () => (this._isDirty && (this._isDirty = !1, this._value = this._fn(), this._setAndNotify(this._value, !0)), this._value));
206
+ this._fn = r, this.setDirty();
207
+ }
208
+ static is(r) {
209
+ return r != null && r[re] === !0;
210
+ }
211
+ get value() {
212
+ return this.get();
213
+ }
214
+ }
215
+ var ce, fe;
216
+ class F extends (fe = d, ce = te, fe) {
217
+ constructor() {
218
+ super(...arguments);
219
+ a(this, ce, !0);
220
+ a(this, "set", (r) => {
221
+ this._setAndNotify(r, !1);
222
+ });
223
+ a(this, "update", (r) => {
224
+ this._setAndNotify(r(this.get()), !1);
225
+ });
226
+ a(this, "reducer", (r) => (n) => this.update((s) => r(s, n)));
227
+ a(this, "iso", (r, n, s = (i, o) => i === o) => {
228
+ const i = new F(r(this.get()), s);
229
+ return i.onDispose(this.on((o) => i.set(r(o)))), i.on((o) => this._setAndNotify(n(o), !1)), i;
230
+ });
231
+ a(this, "atProp", (r) => this.iso(
232
+ (n) => n[r],
233
+ (n) => ({ ...this.value, [r]: n })
234
+ ));
235
+ }
236
+ static is(r) {
237
+ return r != null && r[te] === !0;
238
+ }
239
+ get value() {
240
+ return this.get();
241
+ }
242
+ set value(r) {
243
+ this._setAndNotify(r, !1);
244
+ }
245
+ }
246
+ function B(t, e, r = (n, s) => n === s) {
247
+ const n = new T(t, r);
248
+ return e.forEach((s) => s.setDerivative(n)), n;
249
+ }
250
+ function zt(t, e) {
251
+ return B(t, e).dispose;
252
+ }
253
+ function A(t, e = (r, n) => r === n) {
254
+ return new F(t, e);
255
+ }
256
+ function Vt(t, e = (r, n) => r === n) {
257
+ return new d(t, e);
258
+ }
259
+ class he {
260
+ constructor() {
261
+ a(this, "_store", /* @__PURE__ */ new Map());
262
+ a(this, "getItem", (e) => this._store.get(e) ?? null);
263
+ a(this, "setItem", (e, r) => {
264
+ this._store.set(e, r);
265
+ });
266
+ }
267
+ }
268
+ function de({
269
+ key: t,
270
+ defaultValue: e,
271
+ store: r,
272
+ serialize: n = JSON.stringify,
273
+ deserialize: s = JSON.parse,
274
+ equals: i = (l, u) => l === u,
275
+ onLoad: o = (l) => l
276
+ }) {
277
+ const l = r.getItem(t), u = new F(
278
+ l != null ? o(s(l)) : typeof e == "function" ? e() : e,
279
+ i
280
+ );
281
+ return u.on((c) => {
282
+ r.setItem(t, n(c));
283
+ }), u;
284
+ }
285
+ function qt(t) {
286
+ return de({
287
+ ...t,
288
+ store: (window == null ? void 0 : window.localStorage) ?? new he()
289
+ });
290
+ }
291
+ function Zt(t) {
292
+ return de({
293
+ ...t,
294
+ store: (window == null ? void 0 : window.sessionStorage) ?? new he()
295
+ });
296
+ }
297
+ function ne(t) {
298
+ return typeof requestAnimationFrame == "function" ? requestAnimationFrame(t) : setTimeout(t, 0);
299
+ }
300
+ function Ke(t, e, r, n) {
301
+ const s = (n == null ? void 0 : n.duration) ?? 300, i = (n == null ? void 0 : n.easing) ?? ((S) => S), o = (n == null ? void 0 : n.equals) ?? ((S, L) => S === L);
302
+ let l = n == null ? void 0 : n.interpolate, u = t, c = e(), p = performance.now(), m = null, h = !0;
303
+ const _ = new T(e, o), y = A(t, o);
304
+ y.onDispose(() => {
305
+ m !== null && cancelAnimationFrame(m);
306
+ }), y.onDispose(_.dispose), r.forEach((S) => {
307
+ S.setDerivative(_), S.onDispose(y.dispose);
308
+ });
309
+ const X = (S) => {
310
+ c = S, p = performance.now(), u = y.value, h && (h = !1, m = ne(G));
311
+ }, G = () => {
312
+ const L = (performance.now() - p) / d.unwrap(s), xe = i(L);
313
+ l == null && (l = Xe(u));
314
+ let J = l(u, c, xe);
315
+ L >= 1 ? (h = !0, J = c) : m = ne(G), y.set(J);
316
+ };
317
+ return _.on(X), y;
318
+ }
319
+ function Xt(t, e) {
320
+ const { initialValue: r, ...n } = e ?? {};
321
+ return Ke(r ?? t.get(), t.get, [t], n);
322
+ }
323
+ function Yt(t, e) {
324
+ const { signals: r, literals: n } = Object.entries(t).reduce(
325
+ ({ signals: i, literals: o }, [l, u]) => (d.is(u) ? i.push([l, u]) : o[l] = u, { signals: i, literals: o }),
326
+ { signals: [], literals: {} }
327
+ ), s = r.map(([, i]) => i);
328
+ return B(() => (r.forEach(([i, o]) => n[i] = o.value), e(n)), s);
329
+ }
330
+ function se(t) {
331
+ let e = t.match(/rgba?\((\d+), (\d+), (\d+)(, (\d+))?\)/);
332
+ return e != null ? [
333
+ Number(e[1]),
334
+ Number(e[2]),
335
+ Number(e[3]),
336
+ e[4] != null ? Number(e[5]) : 1,
337
+ "rgba"
338
+ ] : (e = t.match(/#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})/), e != null ? [
339
+ parseInt(e[1], 16),
340
+ parseInt(e[2], 16),
341
+ parseInt(e[3], 16),
342
+ 1,
343
+ "hex"
344
+ ] : (e = t.match(/hsla?\((\d+), (\d+)%?, (\d+)%?(, (\d+))?\)/), e != null ? [
345
+ Number(e[1]),
346
+ Number(e[2]),
347
+ Number(e[3]),
348
+ e[4] != null ? Number(e[5]) : 1,
349
+ "hsla"
350
+ ] : [0, 0, 0, 1, "rgba"]));
351
+ }
352
+ function ie(t) {
353
+ const e = /^(inset\s)?(-?\d+)([a-zA-Z]*)(\s+)(-?\d+)([a-zA-Z]*)(?:\s+(-?\d+)([a-zA-Z]*))?(?:\s+(-?\d+)([a-zA-Z]*))?(?:\s+(-?\d+)([a-zA-Z]*))?(?:\s+)([a-zA-Z0-9(),.]+)$/i, r = t.match(e);
354
+ if (r == null)
355
+ return {
356
+ inset: !1,
357
+ x: 0,
358
+ y: 0,
359
+ blur: 0,
360
+ spread: 0,
361
+ color: "rgba(0, 0, 0, 0)"
362
+ };
363
+ const [, n, s, , , i, , o, , l, , u] = r, c = o != null ? parseInt(o, 10) : 0, p = l != null ? parseInt(l, 10) : 0;
364
+ return {
365
+ inset: !!n,
366
+ x: parseInt(s, 10),
367
+ y: parseInt(i, 10),
368
+ blur: c,
369
+ spread: p,
370
+ color: u
371
+ };
372
+ }
373
+ function je(t) {
374
+ const { inset: e, x: r, y: n, blur: s, spread: i, color: o } = t;
375
+ return `${e ? "inset " : ""}${r}px ${n}px ${s}px ${i}px ${o}`;
376
+ }
377
+ function Ue(t) {
378
+ return t[4] === "rgba" ? `rgba(${t[0]}, ${t[1]}, ${t[2]}, ${t[3]})` : t[4] === "hex" ? `#${t[0].toString(16).padStart(2, "0")}${t[1].toString(16).padStart(2, "0")}${t[2].toString(16).padStart(2, "0")}` : t[4] === "hsla" ? `hsla(${t[0]}, ${t[1]}%, ${t[2]}%, ${t[3]})` : "";
379
+ }
380
+ function Be(t, e) {
381
+ const [r, n, s, i, o] = se(t), [l, u, c, p] = se(e);
382
+ return (m) => {
383
+ const h = r + (l - r) * m, _ = n + (u - n) * m, y = s + (c - s) * m, X = i + (p - i) * m;
384
+ return Ue([h, _, y, X, o]);
385
+ };
386
+ }
387
+ function Ht(t, e) {
388
+ const r = ie(t), n = ie(e);
389
+ return (s) => {
390
+ const i = r.x + (n.x - r.x) * s, o = r.y + (n.y - r.y) * s, l = r.blur + (n.blur - r.blur) * s, u = r.spread + (n.spread - r.spread) * s, c = me(r.color, n.color)(s);
391
+ return je({ inset: r.inset, x: i, y: o, blur: l, spread: u, color: c });
392
+ };
393
+ }
394
+ function ke(t, e) {
395
+ var r, n, s, i, o, l, u, c;
396
+ return e === "translateX" ? new WebKitCSSMatrix(t.transform).m41 : e === "translateY" ? new WebKitCSSMatrix(t.transform).m42 : e === "translateZ" ? new WebKitCSSMatrix(t.transform).m43 : e === "rotateX" ? new WebKitCSSMatrix(t.transform).m12 : e === "rotateY" ? new WebKitCSSMatrix(t.transform).m21 : e === "rotateZ" ? new WebKitCSSMatrix(t.transform).m31 : e === "scaleX" ? new WebKitCSSMatrix(t.transform).m11 : e === "scaleY" ? new WebKitCSSMatrix(t.transform).m22 : e === "scaleZ" ? new WebKitCSSMatrix(t.transform).m33 : e === "skewX" ? new WebKitCSSMatrix(t.transform).m13 : e === "skewY" ? new WebKitCSSMatrix(t.transform).m23 : Number(e === "grayScale" ? (r = t.filter.match(/grayscale\((\d+)%\)/)) == null ? void 0 : r[1] : e === "sepia" ? (n = t.filter.match(/sepia\((\d+)%\)/)) == null ? void 0 : n[1] : e === "saturate" ? (s = t.filter.match(/saturate\((\d+)%\)/)) == null ? void 0 : s[1] : e === "hueRotate" ? (i = t.filter.match(/hue-rotate\((\d+)deg\)/)) == null ? void 0 : i[1] : e === "invert" ? (o = t.filter.match(/invert\((\d+)%\)/)) == null ? void 0 : o[1] : e === "brightness" ? (l = t.filter.match(/brightness\((\d+)%\)/)) == null ? void 0 : l[1] : e === "contrast" ? (u = t.filter.match(/contrast\((\d+)%\)/)) == null ? void 0 : u[1] : e === "blur" ? (c = t.filter.match(/blur\((\d+)px\)/)) == null ? void 0 : c[1] : t.getPropertyValue(e));
397
+ }
398
+ function Kt(t, e) {
399
+ const r = {}, n = getComputedStyle(t);
400
+ for (const [s, i] of Object.entries(e)) {
401
+ const o = s;
402
+ i != null && (r[o] = ke(n, o));
403
+ }
404
+ return r;
405
+ }
406
+ function R(t, e, r) {
407
+ r != null && (e === "translateX" ? t.style.transform += ` translateX(${r}px)` : e === "translateY" ? t.style.transform += ` translateY(${r}px)` : e === "translateZ" ? t.style.transform += ` translateZ(${r}px)` : e === "rotateX" ? t.style.transform += ` rotateX(${r}deg)` : e === "rotateY" ? t.style.transform += ` rotateY(${r}deg)` : e === "rotateZ" ? t.style.transform += ` rotateZ(${r}deg)` : e === "scaleX" ? t.style.transform += ` scaleX(${r})` : e === "scaleY" ? t.style.transform += ` scaleY(${r})` : e === "scaleZ" ? t.style.transform += ` scaleZ(${r})` : e === "skewX" ? t.style.transform += ` skewX(${r}deg)` : e === "skewY" ? t.style.transform += ` skewY(${r}deg)` : e === "grayScale" ? t.style.filter += ` grayscale(${r}%)` : e === "sepia" ? t.style.filter += ` sepia(${r}%)` : e === "saturate" ? t.style.filter += ` saturate(${r}%)` : e === "hueRotate" ? t.style.filter += ` hue-rotate(${r}deg)` : e === "invert" ? t.style.filter += ` invert(${r}%)` : e === "brightness" ? t.style.filter += ` brightness(${r}%)` : e === "contrast" ? t.style.filter += ` contrast(${r}%)` : e === "blur" && (t.style.filter += ` blur(${r}px)`), t.style.setProperty(e, String(r)));
408
+ }
409
+ const Y = /* @__PURE__ */ new Map();
410
+ function pe(t, e, r) {
411
+ if (Y.has(r + ":" + t + e))
412
+ return Y.get(t + e);
413
+ const n = Be(t, e);
414
+ return Y.set(r + ":" + t + e, n), n;
415
+ }
416
+ function me(t, e) {
417
+ return pe(t, e, "c");
418
+ }
419
+ function Ge(t, e) {
420
+ return pe(t, e, "s");
421
+ }
422
+ function Je(t, e, r, n, s) {
423
+ if (r != null && n != null) {
424
+ if (typeof r == "number" && typeof n == "number") {
425
+ const i = r + (n - r) * s;
426
+ R(t, e, i);
427
+ } else if (e === "boxShadow" || e === "textShadow") {
428
+ const i = Ge(
429
+ r,
430
+ n
431
+ )(s);
432
+ R(t, e, i);
433
+ } else if (e === "color" || e === "backgroundColor" || e === "borderColor" || e === "outlineColor") {
434
+ const i = me(
435
+ r,
436
+ n
437
+ )(s);
438
+ R(t, e, i);
439
+ }
440
+ }
441
+ }
442
+ function jt(t, e, r, n) {
443
+ t.style.transform = "", t.style.filter = "";
444
+ for (const [s, i] of Object.entries(r)) {
445
+ const o = s;
446
+ Je(t, o, e[o], i, n);
447
+ }
448
+ }
449
+ function Ut(t, e) {
450
+ t.style.transform = "", t.style.filter = "";
451
+ for (const [r, n] of Object.entries(e))
452
+ n != null && R(t, r, n);
453
+ }
454
+ const ge = /* @__PURE__ */ new Set(["checked", "disabled", "hidden", "selected"]), we = /* @__PURE__ */ new Set([
455
+ "rowSpan",
456
+ "colSpan",
457
+ "tabIndex",
458
+ "valueAsNumber"
459
+ ]), be = /* @__PURE__ */ new Set(["valueAsDate"]), Se = /* @__PURE__ */ new Set([
460
+ "value",
461
+ "textContent",
462
+ "innerText",
463
+ "innerHTML",
464
+ "outerHTML",
465
+ "className",
466
+ "classList"
467
+ ]), H = /* @__PURE__ */ new Map();
468
+ function $(t, e) {
469
+ if (H.has(t))
470
+ return H.get(t);
471
+ {
472
+ const r = e(t);
473
+ return H.set(t, r), r;
474
+ }
475
+ }
476
+ function Qe(t) {
477
+ return (e, r) => {
478
+ r == null ? e[t] = null : e[t] = !!r;
479
+ };
480
+ }
481
+ function et(t) {
482
+ return (e, r) => {
483
+ r == null ? e[t] = null : e[t] = Number(r);
484
+ };
485
+ }
486
+ function tt(t) {
487
+ return (e, r) => {
488
+ r == null ? e[t] = null : e[t] = r;
489
+ };
490
+ }
491
+ function rt(t) {
492
+ return (e, r) => {
493
+ r == null ? e[t] = null : e[t] = String(r);
494
+ };
495
+ }
496
+ function nt(t) {
497
+ return (e, r) => {
498
+ r == null ? e.removeAttribute(t) : e.setAttribute(t, r);
499
+ };
500
+ }
501
+ function ve(t) {
502
+ return ge.has(t) ? $(t, Qe) : we.has(t) ? $(t, et) : be.has(t) ? $(t, tt) : Se.has(t) ? $(t, rt) : $(t, nt);
503
+ }
504
+ function Ae(t) {
505
+ return (e) => ge.has(t) ? !!e[t] : we.has(t) ? Number(e[t]) : be.has(t) ? e[t] : Se.has(t) ? String(e[t]) : e.getAttribute(t);
506
+ }
507
+ class v {
508
+ /**
509
+ * Constructs a new `DOMContext` instance.
510
+ *
511
+ * @param document - The `Document` instance associated with this context.
512
+ * @param element - The `Element` instance associated with this context.
513
+ * @param reference - An optional `Node` instance that serves as a reference for this context.
514
+ * @param providers - The `Providers` instance associated with this context.
515
+ * @param isFirstLevel - A boolean value indicating whether this context is at the first level, meaning the outermost node in the generated DOM.
516
+ */
517
+ constructor(e, r, n, s, i) {
518
+ /**
519
+ * Creates a new DOM element (eg: HTML or SVG) with the specified tag name and namespace.
520
+ *
521
+ * @param tagName - The tag name of the element to create.
522
+ * @param namespace - The namespace URI to create the element in, or `undefined` to create a standard HTML element.
523
+ * @returns The newly created element.
524
+ */
525
+ a(this, "createElement", (e, r) => r !== void 0 ? this.document.createElementNS(r, e) : this.document.createElement(e));
526
+ /**
527
+ * Creates a new text node with the specified text content.
528
+ * @param text - The text content for the new text node.
529
+ * @returns A new `Text` node with the specified text content.
530
+ */
531
+ a(this, "createText", (e) => this.document.createTextNode(e));
532
+ /**
533
+ * Creates a new `DOMContext` with a reference to a newly created text node.
534
+ * The text node is appended or inserted to the current `DOMContext`.
535
+ * The new `DOMContext` with the reference is returned.
536
+ */
537
+ a(this, "makeRef", () => {
538
+ const e = this.createText("");
539
+ return this.appendOrInsert(e), this.withReference(e);
540
+ });
541
+ /**
542
+ * Appends or inserts a child node to the element, depending on whether a reference node is provided.
543
+ *
544
+ * @param child - The child node to append or insert.
545
+ */
546
+ a(this, "appendOrInsert", (e) => {
547
+ this.reference === void 0 ? this.element.appendChild(e) : this.element.insertBefore(e, this.reference);
548
+ });
549
+ /**
550
+ * Creates a new `DOMContext` instance with the provided `document`.
551
+ *
552
+ * @param document - The `Document` to use for the `DOMContext`.
553
+ * @returns A new `DOMContext` instance.
554
+ */
555
+ a(this, "withDocument", (e) => new v(
556
+ e,
557
+ this.element,
558
+ this.reference,
559
+ this.providers,
560
+ !1
561
+ ));
562
+ /**
563
+ * Creates a new `DOMContext` instance with the provided `element`.
564
+ * @param element - The DOM element to use in the new `DOMContext` instance.
565
+ * @returns A new `DOMContext` instance with the provided `element`.
566
+ */
567
+ a(this, "withElement", (e) => new v(this.document, e, void 0, this.providers, !1));
568
+ /**
569
+ * Creates a new `DOMContext` instance with the `isFirstLevel` property set to `true`.
570
+ * @returns A new `DOMContext` instance with the `isFirstLevel` property set to `true`.
571
+ */
572
+ a(this, "withFirstLevel", () => new v(
573
+ this.document,
574
+ this.element,
575
+ this.reference,
576
+ this.providers,
577
+ !0
578
+ ));
579
+ /**
580
+ * Creates a new `DOMContext` instance with the specified reference.
581
+ *
582
+ * @param reference - The optional `Text` node to use as the reference for the new `DOMContext`.
583
+ * @returns A new `DOMContext` instance with the specified reference.
584
+ */
585
+ a(this, "withReference", (e) => new v(
586
+ this.document,
587
+ this.element,
588
+ e,
589
+ this.providers,
590
+ this.isFirstLevel
591
+ ));
592
+ /** Creates a new DOMContext with the provided provider value.
593
+ *
594
+ * @param mark - The provider mark to associate the value with.
595
+ * @param value - The value to set for the provider.
596
+ * @returns A new DOMContext with the updated providers.
597
+ */
598
+ a(this, "withProvider", (e, r) => new v(
599
+ this.document,
600
+ this.element,
601
+ this.reference,
602
+ {
603
+ ...this.providers,
604
+ [e]: r
605
+ },
606
+ this.isFirstLevel
607
+ ));
608
+ /**
609
+ * Returns a new DOMContext instance with the specified providers merged into
610
+ * the existing providers.
611
+ *
612
+ * @param providers - An object containing the providers to be merged into the existing providers.
613
+ * @returns A new DOMContext instance with the merged providers.
614
+ */
615
+ a(this, "withProviders", (e) => new v(
616
+ this.document,
617
+ this.element,
618
+ this.reference,
619
+ {
620
+ ...this.providers,
621
+ ...e
622
+ },
623
+ this.isFirstLevel
624
+ ));
625
+ /**
626
+ * Retrieves a provider for the given provider mark.
627
+ *
628
+ * @param mark - The provider mark to retrieve the provider for.
629
+ * @returns The provider for the given mark.
630
+ * @throws {Error} If the provider for the given mark is not found.
631
+ */
632
+ a(this, "getProvider", (e) => {
633
+ if (this.providers[e] === void 0)
634
+ throw new Error(`Provider not found: ${e.description}`);
635
+ return this.providers[e];
636
+ });
637
+ this.document = e, this.element = r, this.reference = n, this.providers = s, this.isFirstLevel = i;
638
+ }
639
+ /**
640
+ * Creates a new `DOMContext` instance for the given `Element` and optional reference `Node`.
641
+ *
642
+ * @param element - The `Element` to create the `DOMContext` for.
643
+ * @param ref - An optional reference `Node` to associate with the `DOMContext`.
644
+ * @returns A new `DOMContext` instance.
645
+ */
646
+ static of(e, r) {
647
+ return new v(e.ownerDocument, e, r, {}, !0);
648
+ }
649
+ }
650
+ function b(t) {
651
+ const e = t;
652
+ e && e.onblur && (e.onblur = null), !(!t || t.ownerDocument === void 0) && t.parentElement && t.parentElement.removeChild(t);
653
+ }
654
+ function st(t) {
655
+ return ye(t) ? t : t.parentElement;
656
+ }
657
+ function ye(t) {
658
+ return t.nodeType === 1;
659
+ }
660
+ function it(t, e, r) {
661
+ let n = t.target;
662
+ for (; n != null && !(n instanceof HTMLAnchorElement); )
663
+ n = n.parentElement;
664
+ if (n == null) return !0;
665
+ const s = n;
666
+ if (t.button !== 0 || t.ctrlKey || t.metaKey || s.target !== "_self" && s.target !== "" || s.getAttribute("download") != null)
667
+ return !0;
668
+ if (r) {
669
+ const { pathname: i, search: o, hash: l } = s, u = i + o + l;
670
+ if (s.getAttribute("href") !== u || e && !/\/[^/.]*$/.test(i))
671
+ return !0;
672
+ }
673
+ return !1;
674
+ }
675
+ const Bt = (t, e = {
676
+ checkExtension: !0,
677
+ checkExternalUrl: !0
678
+ }) => (r) => {
679
+ const { checkExtension: n, checkExternalUrl: s } = e;
680
+ it(
681
+ r,
682
+ n === !0,
683
+ s === !0
684
+ ) || t() && r.preventDefault();
685
+ }, Ee = (t) => (e) => {
686
+ e.isFirstLevel && D.isSSR && e.element.setAttribute("data-tempo-text", "");
687
+ const r = e.createText(t);
688
+ return e.appendOrInsert(r), (n) => {
689
+ n && b(r);
690
+ };
691
+ }, _e = (t) => (e) => {
692
+ e.isFirstLevel && D.isSSR && e.element.setAttribute("data-tempo-text", "");
693
+ const r = e.createText(t.value);
694
+ e.appendOrInsert(r);
695
+ const n = t.on((s) => r.data = s);
696
+ return (s) => {
697
+ n(), s && b(r);
698
+ };
699
+ };
700
+ function kt(t) {
701
+ return d.is(t) ? _e(t) : Ee(t);
702
+ }
703
+ const g = (...t) => (e) => {
704
+ const r = t.map((n) => f(n)(e));
705
+ return (n) => {
706
+ r.forEach((s) => s(n));
707
+ };
708
+ }, w = () => () => {
709
+ }, W = "data-tempo-attr", O = "data-tempo-class", Pe = "data-tempo-node", K = "data-tempo-text";
710
+ function ot(t, e) {
711
+ const r = t.getAttribute(W);
712
+ r != null && t.setAttribute(`${W}:${e}`, r);
713
+ }
714
+ function De(t, e) {
715
+ D.isSSR && t.isFirstLevel && ot(t.element, e);
716
+ }
717
+ function ut(t) {
718
+ t.querySelectorAll(`[^${W}:]`).forEach((e) => {
719
+ const r = e.getAttributeNames().filter((n) => n.startsWith(`${W}:`));
720
+ for (const n of r) {
721
+ const s = e.getAttribute(n), i = n.split("-").pop();
722
+ e.removeAttribute(n), e.setAttribute(i, s);
723
+ }
724
+ });
725
+ }
726
+ function at(t) {
727
+ const e = t.className.trim();
728
+ e.length > 0 && t.setAttribute(O, e);
729
+ }
730
+ function Te(t) {
731
+ D.isSSR && t.isFirstLevel && at(t.element);
732
+ }
733
+ function lt(t) {
734
+ t.querySelectorAll(`[${O}]`).forEach((e) => {
735
+ const r = e.getAttribute(O);
736
+ r !== null && (e.className = r, e.removeAttribute(O));
737
+ });
738
+ }
739
+ function ct(t) {
740
+ t.setAttribute(Pe, "");
741
+ }
742
+ function ft(t) {
743
+ t.querySelectorAll(`[${Pe}]`).forEach((e) => {
744
+ b(e);
745
+ });
746
+ }
747
+ function ht(t) {
748
+ t.querySelectorAll(`[${K}]`).forEach((e) => {
749
+ e.textContent = e.getAttribute(K), e.removeAttribute(K);
750
+ });
751
+ }
752
+ const dt = (t) => (e) => (Te(e), e.element.classList.add(...t), (r) => {
753
+ r && e.element.classList.remove(...t);
754
+ }), pt = (t) => (e) => {
755
+ Te(e);
756
+ const r = e.element;
757
+ let n = [];
758
+ const s = t.on((i) => {
759
+ n.forEach((o) => r.classList.remove(o)), n = (i ?? "").split(" ").filter((o) => o.length > 0), r.classList.add(...n);
760
+ });
761
+ return (i) => {
762
+ s(), i && n.forEach((o) => r.classList.remove(o)), n.length = 0;
763
+ };
764
+ }, z = (t, e) => {
765
+ const r = ve(t), n = Ae(t);
766
+ return (s) => {
767
+ De(s, t);
768
+ const i = n(s.element);
769
+ return r(s.element, e), (o) => {
770
+ o && r(s.element, i);
771
+ };
772
+ };
773
+ }, V = (t, e) => {
774
+ const r = ve(t), n = Ae(t);
775
+ return (s) => {
776
+ De(s, t);
777
+ const i = n(s.element);
778
+ return e.on((o) => r(s.element, o)), (o) => {
779
+ o && r(s.element, i);
780
+ };
781
+ };
782
+ }, P = new Proxy(
783
+ {},
784
+ {
785
+ get: (t, e) => e === "class" ? (r) => d.is(r) ? pt(r) : dt(
786
+ (r ?? "").split(" ").filter((n) => n.length > 0)
787
+ ) : (r) => d.is(r) ? V(
788
+ e,
789
+ r
790
+ ) : z(
791
+ e,
792
+ r
793
+ )
794
+ }
795
+ ), Gt = new Proxy(
796
+ {},
797
+ {
798
+ get: (t, e) => (r) => d.is(r) ? V(
799
+ `aria-${e}`,
800
+ r
801
+ ) : z(
802
+ `aria-${e}`,
803
+ r
804
+ )
805
+ }
806
+ ), Jt = new Proxy(
807
+ {},
808
+ {
809
+ get: (t, e) => (r) => d.is(r) ? V(
810
+ e,
811
+ r
812
+ ) : z(
813
+ e,
814
+ r
815
+ )
816
+ }
817
+ ), Qt = new Proxy(
818
+ {},
819
+ {
820
+ get: (t, e) => (r) => d.is(r) ? V(
821
+ e,
822
+ r
823
+ ) : z(
824
+ e,
825
+ r
826
+ )
827
+ }
828
+ );
829
+ function f(t) {
830
+ return t == null ? w : Array.isArray(t) ? g(...t.map(f)) : typeof t == "string" ? Ee(t) : d.is(t) ? _e(t) : t;
831
+ }
832
+ function $e(t, ...e) {
833
+ return (r) => {
834
+ const n = r.createElement(t, void 0);
835
+ r.appendOrInsert(n), r.isFirstLevel && D.isSSR && ct(n), r = r.withElement(n);
836
+ const s = e.map((i) => f(i)(r));
837
+ return (i) => {
838
+ s.forEach((o) => o(!1)), i && b(n);
839
+ };
840
+ };
841
+ }
842
+ function Ce(t, e, ...r) {
843
+ return (n) => {
844
+ const s = n.createElement(t, e);
845
+ n.appendOrInsert(s), n.isFirstLevel && D.isSSR && s.setAttribute("data-tempo-node", ""), n = n.withElement(s);
846
+ const i = r.map((o) => f(o)(n));
847
+ return (o) => {
848
+ i.forEach((l) => l(!1)), o && b(s);
849
+ };
850
+ };
851
+ }
852
+ const er = new Proxy(
853
+ {},
854
+ {
855
+ get: (t, e) => (...r) => $e(e, r.flatMap(f))
856
+ }
857
+ ), tr = new Proxy(
858
+ {},
859
+ {
860
+ get: (t, e) => (...r) => $e("input", P.type(e), ...r)
861
+ }
862
+ ), mt = "http://www.w3.org/2000/svg", rr = new Proxy(
863
+ {},
864
+ {
865
+ get: (t, e) => (...r) => Ce(e, mt, r.flatMap(f))
866
+ }
867
+ ), gt = "http://www.w3.org/1998/Math/MathML", nr = new Proxy(
868
+ {},
869
+ {
870
+ get: (t, e) => (...r) => Ce(e, gt, r.flatMap(f))
871
+ }
872
+ );
873
+ let j = !1;
874
+ function wt(t) {
875
+ ft(t), lt(t), ut(t), ht(t);
876
+ }
877
+ let U = 0;
878
+ const sr = (t = 30) => (j = !0, new Promise((e, r) => {
879
+ let n;
880
+ const s = setInterval(() => {
881
+ U <= 0 && (clearInterval(s), clearTimeout(n), j = !1, e());
882
+ }, 10);
883
+ n = setTimeout(() => {
884
+ clearInterval(s), r(new Error("SSR Timeout"));
885
+ }, t * 1e3);
886
+ })), D = {
887
+ useDone(t) {
888
+ return U++, f(t(() => U--));
889
+ },
890
+ get isSSR() {
891
+ return j;
892
+ }
893
+ }, Me = (t, e) => (r) => {
894
+ const n = Object.values(t).reduce((s, i) => {
895
+ const o = r.getProvider(i);
896
+ if (o == null)
897
+ throw new Error(`No provider found for mark: ${i.description}`);
898
+ return s[i] = o, s;
899
+ }, {});
900
+ return f(e(n))(r);
901
+ }, ir = (t, e) => (r) => {
902
+ const n = [], s = Object.entries(t).reduce(
903
+ (i, [o, l]) => (n.push(
904
+ l((u) => (Reflect.set(i, o, u), null))(r)
905
+ ), i),
906
+ {}
907
+ );
908
+ return n.push(e(s)(r)), (i) => {
909
+ n.forEach((o) => o(i));
910
+ };
911
+ }, bt = (t, e) => Me([t], (r) => f(e(r[t]))), or = (t, e) => Me(t, (r) => f(e(r))), M = (t) => (e) => (r) => t(r, e);
912
+ function St(t) {
913
+ return Symbol(t);
914
+ }
915
+ const Ne = (t, e) => (r) => f(e)(r.withProviders(t)), ur = (...t) => t.length > 0 ? t.reduceRight((e, r) => (n) => e(r(n))) : f, vt = (t, e, r) => Ne({ [t]: e }, f(r)), ar = (t, e) => Ne(t, f(e)), oe = St("Appearance"), lr = {
916
+ /**
917
+ * Provides a child component with an appearance context, which can be used to
918
+ * determine the current appearance (light or dark) based on the user's system
919
+ * preferences.
920
+ *
921
+ * The appearance context is updated whenever the user's system preferences
922
+ * change, and the component is cleaned up when it is no longer needed.
923
+ *
924
+ * @param child - The child component to be provided with the appearance context.
925
+ * @returns The child component with the appearance context.
926
+ */
927
+ provide: (t) => {
928
+ const e = window.matchMedia != null && window.matchMedia("(prefers-color-scheme: dark)").matches, r = A(e ? "dark" : "light"), n = (i) => {
929
+ r.set(i.matches ? "dark" : "light");
930
+ }, s = window.matchMedia != null ? window.matchMedia("(prefers-color-scheme: dark)") : void 0;
931
+ return s == null || s.addEventListener("change", n), g(
932
+ vt(oe, r, t),
933
+ M(() => s == null ? void 0 : s.removeEventListener("change", n))
934
+ );
935
+ },
936
+ /**
937
+ * Makes the AppearanceType available to the child component by consuming the signal provided by the parent.
938
+ * The result of the function is returned as the final output.
939
+ *
940
+ * @param fn - A function that accepts the `AppearanceType` signal and returns a `Child` element.
941
+ * @returns The `Child` element returned by the provided function.
942
+ */
943
+ consume: (t) => bt(oe, t)
944
+ }, Le = (t, e) => {
945
+ if (typeof e == "function")
946
+ return Le(t, { then: e });
947
+ const r = e.pending != null ? f(e.pending) : w, n = e.then, s = e.error != null ? (i) => f(e.error(i)) : () => w;
948
+ return (i) => {
949
+ let o = !0;
950
+ const l = t();
951
+ i = i.makeRef();
952
+ let u = f(r)(i);
953
+ return l.then(
954
+ (c) => {
955
+ o && (u(!0), u = f(n(c))(i));
956
+ },
957
+ (c) => {
958
+ o && (u(!0), u = f(s(c))(i));
959
+ }
960
+ ), (c) => {
961
+ o = !1, u(c), c && i.reference && b(i.reference);
962
+ };
963
+ };
964
+ }, cr = (t, e) => Le(() => t, e), fr = (t = 10) => (e) => {
965
+ const r = setTimeout(() => {
966
+ var n;
967
+ (n = e.element) == null || n.focus();
968
+ }, t);
969
+ return (n) => clearTimeout(r);
970
+ }, hr = (t = 10) => (e) => {
971
+ const r = setTimeout(() => {
972
+ var n;
973
+ (n = e.element) == null || n.select();
974
+ }, t);
975
+ return (n) => {
976
+ clearTimeout(r);
977
+ };
978
+ }, Ie = (t, e) => (r) => (r.element.addEventListener(t, e), (n) => {
979
+ n && r.element.removeEventListener(t, e);
980
+ }), At = (t) => Ie("click", (e) => {
981
+ e.preventDefault();
982
+ const r = e.target;
983
+ setTimeout(() => {
984
+ const n = r.ownerDocument != null ? r == null ? void 0 : r.checked : void 0;
985
+ n != null && t(!n);
986
+ }, 0);
987
+ }), q = new Proxy(
988
+ {},
989
+ {
990
+ get: (t, e) => (r) => Ie(e, r)
991
+ }
992
+ ), Z = {
993
+ value: (t) => (e) => {
994
+ const r = e.target;
995
+ t(r.value);
996
+ },
997
+ valueAsNumber: (t) => (e) => {
998
+ const r = e.target;
999
+ t(r.valueAsNumber);
1000
+ },
1001
+ valueAsDate: (t) => (e) => {
1002
+ const r = e.target;
1003
+ if (r.value === "")
1004
+ return;
1005
+ const n = r.value.split("-"), s = new Date(
1006
+ Number(n[0]),
1007
+ Number(n[1]) - 1,
1008
+ Number(n[2].substring(0, 2))
1009
+ );
1010
+ t(s);
1011
+ },
1012
+ valueAsDateTime: (t) => (e) => {
1013
+ const r = e.target;
1014
+ if (r.value === "")
1015
+ return;
1016
+ const n = r.value.split("T"), s = n[0].split("-"), i = new Date(
1017
+ Number(s[0]),
1018
+ Number(s[1]) - 1,
1019
+ Number(s[2])
1020
+ ), o = n[1].split(":");
1021
+ i.setHours(Number(o[0])), i.setMinutes(Number(o[1])), i.setSeconds(Number(o[2])), t(i);
1022
+ },
1023
+ checked: (t) => (e) => {
1024
+ const r = e.target;
1025
+ t(r.checked);
1026
+ },
1027
+ preventDefault: (t) => (e) => {
1028
+ e.preventDefault(), t();
1029
+ },
1030
+ stopPropagation: (t) => (e) => {
1031
+ e.stopPropagation(), t();
1032
+ },
1033
+ stopImmediatePropagation: (t) => (e) => {
1034
+ e.stopImmediatePropagation(), t();
1035
+ }
1036
+ };
1037
+ function yt(t, e = "input") {
1038
+ return g(
1039
+ P.valueAsDate(t),
1040
+ q[e](Z.valueAsDate(t.set))
1041
+ );
1042
+ }
1043
+ function Et(t, e = "input") {
1044
+ return g(
1045
+ P.valueAsDate(t),
1046
+ q[e](Z.valueAsDateTime(t.set))
1047
+ );
1048
+ }
1049
+ function _t(t, e = "input") {
1050
+ return g(
1051
+ P.valueAsNumber(t),
1052
+ q[e](Z.valueAsNumber(t.set))
1053
+ );
1054
+ }
1055
+ function Pt(t, e = "input") {
1056
+ return g(P.value(t), q[e](Z.value(t.set)));
1057
+ }
1058
+ function Dt(t) {
1059
+ return g(P.checked(t), At(t.set));
1060
+ }
1061
+ const dr = {
1062
+ date: yt,
1063
+ dateTime: Et,
1064
+ number: _t,
1065
+ text: Pt,
1066
+ checked: Dt
1067
+ }, I = (t, e) => (r) => {
1068
+ r = r.makeRef();
1069
+ let n, s;
1070
+ const i = t.map((u) => Object.keys(u)[0]);
1071
+ let o;
1072
+ const l = i.on((u) => {
1073
+ if (u !== o) {
1074
+ s == null || s.dispose(), n == null || n(!0), s = t.map((p) => p[u]);
1075
+ const c = e[u](s);
1076
+ n = f(c)(r), o = u;
1077
+ }
1078
+ });
1079
+ return (u) => {
1080
+ l(), u && r.reference != null && b(r.reference), n == null || n(!0);
1081
+ };
1082
+ }, N = {
1083
+ bool: (t, e) => I(
1084
+ t.map((r) => r ? { true: !0 } : { false: !0 }),
1085
+ e
1086
+ ),
1087
+ field: (t, e, r) => I(
1088
+ t.map((n) => ({ [n[e]]: n })),
1089
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1090
+ r
1091
+ ),
1092
+ kind: (t, e) => N.field(t, "kind", e),
1093
+ tuple: (t, e) => {
1094
+ const r = t.map(([n, s]) => ({ [n]: s }));
1095
+ return I(r, e);
1096
+ },
1097
+ type: (t, e) => N.field(t, "type", e),
1098
+ value: (t, e) => I(
1099
+ t.map((r) => ({ [r]: !0 })),
1100
+ e
1101
+ )
1102
+ }, pr = (t, e) => (r) => {
1103
+ const n = (e == null ? void 0 : e.firstSeparator) ?? w, s = (e == null ? void 0 : e.lastSeparator) ?? w;
1104
+ return N.value(
1105
+ r.map((i) => i.isFirst ? "first" : i.isLast ? "last" : "other"),
1106
+ {
1107
+ first: () => n,
1108
+ last: () => s,
1109
+ other: () => t
1110
+ }
1111
+ );
1112
+ }, mr = (t) => (e) => t(e)(e), gr = (t) => (e) => (e.appendOrInsert(t), (r) => {
1113
+ r && b(t);
1114
+ }), Tt = (t, e, r) => (n) => {
1115
+ n = n.makeRef();
1116
+ let s = null, i = !1;
1117
+ const o = A(null), l = t.on((u) => {
1118
+ u == null ? (s == null || s(!0), s = f((r == null ? void 0 : r()) ?? w)(n), i = !1) : (o.value = u, i || (s == null || s(!0), s = f(e(o))(n), i = !0));
1119
+ });
1120
+ return (u) => {
1121
+ l(), s == null || s(u), u && n.reference && b(n.reference);
1122
+ };
1123
+ }, Re = (t, e, r) => r != null ? Re(t, (n) => {
1124
+ const s = n.map((i) => i.isLast ? "last" : "other");
1125
+ return g(
1126
+ M(() => s.dispose()),
1127
+ f(e(n)),
1128
+ N.value(s, {
1129
+ last: () => w,
1130
+ other: () => r(n)
1131
+ })
1132
+ );
1133
+ }) : (n) => {
1134
+ n = n.makeRef();
1135
+ const s = t.map(
1136
+ (u) => Array.from({ length: u }, (c, p) => p).map(
1137
+ (c) => new Ye(c, u)
1138
+ )
1139
+ ), i = [], o = [], l = s.on((u) => {
1140
+ var p, m;
1141
+ const c = u.length;
1142
+ for (; c < i.length; )
1143
+ (p = i.pop()) == null || p(!0), (m = o.pop()) == null || m.dispose();
1144
+ for (let h = 0; h < c; h++)
1145
+ if (o[h] == null) {
1146
+ o[h] = A(u[h]);
1147
+ const _ = f(e(o[h]));
1148
+ i[h] = _(n);
1149
+ } else
1150
+ o[h].value = u[h];
1151
+ });
1152
+ return (u) => {
1153
+ l(), u && n.reference && b(n.reference);
1154
+ };
1155
+ }, $t = (t, e, r) => r != null ? $t(t, (n, s) => {
1156
+ const i = s.map((o) => o.isLast ? "last" : "other");
1157
+ return g([
1158
+ M(() => i.dispose()),
1159
+ f(e(n, s)),
1160
+ N.value(i, {
1161
+ last: () => w,
1162
+ other: () => r(s)
1163
+ })
1164
+ ]);
1165
+ }) : (n) => {
1166
+ const s = t.map((i) => i.length);
1167
+ return Re(s, (i) => {
1168
+ const o = B(
1169
+ () => t.value[i.value.index],
1170
+ [i, t]
1171
+ );
1172
+ return g(
1173
+ M(() => o.dispose()),
1174
+ f(e(o, i))
1175
+ );
1176
+ })(n);
1177
+ }, wr = (t) => {
1178
+ const e = t.element, r = e.style.getPropertyValue(":empty");
1179
+ return e.style.setProperty(":empty", "display:none"), (n) => {
1180
+ n && e.style.setProperty(":empty", r);
1181
+ };
1182
+ };
1183
+ function Oe(t, e) {
1184
+ const r = t(e);
1185
+ return () => r(!0);
1186
+ }
1187
+ function br(t, e, { doc: r, clear: n } = {}) {
1188
+ const s = typeof e == "string" ? (r ?? document).querySelector(e) : e;
1189
+ if (s === null)
1190
+ throw new Error(`Cannot find element by selector for render: ${e}`);
1191
+ n && (r ?? s.ownerDocument) != null && wt(r ?? s.ownerDocument);
1192
+ const i = st(s), o = ye(s) ? void 0 : s, l = v.of(i, o);
1193
+ return Oe(t, l);
1194
+ }
1195
+ const Ct = (t, e) => (r) => {
1196
+ const n = r.document.querySelector(t);
1197
+ if (n === null)
1198
+ throw new Error(`Cannot find element by selector for portal: ${t}`);
1199
+ return Oe(
1200
+ f(e),
1201
+ r.withElement(n).withFirstLevel()
1202
+ );
1203
+ }, Sr = (t) => Ct("head title", P.innerText(t)), Mt = (t) => (e) => t(e.element) ?? (() => {
1204
+ }), k = (t, e, r) => Tt(
1205
+ t.map((n) => n ? !0 : null),
1206
+ () => e,
1207
+ r != null ? () => r : void 0
1208
+ ), vr = (t, e, r) => k(
1209
+ t.map((n) => !n),
1210
+ e,
1211
+ r
1212
+ ), Nt = {
1213
+ partial: {
1214
+ root: null,
1215
+ rootMargin: "0px",
1216
+ threshold: 0
1217
+ },
1218
+ full: {
1219
+ root: null,
1220
+ rootMargin: "0px",
1221
+ threshold: 1
1222
+ }
1223
+ }, x = {
1224
+ partial: /* @__PURE__ */ new Map(),
1225
+ full: /* @__PURE__ */ new Map()
1226
+ }, C = {
1227
+ partial: null,
1228
+ full: null
1229
+ };
1230
+ function Lt(t) {
1231
+ return C[t] == null && (C[t] = new IntersectionObserver((e) => {
1232
+ e.forEach((r) => {
1233
+ const n = x[t].get(r.target);
1234
+ n == null || n.set(r.isIntersecting);
1235
+ });
1236
+ }, Nt[t])), C[t];
1237
+ }
1238
+ function It(t, e) {
1239
+ const r = A(D.isSSR);
1240
+ return g(
1241
+ Mt((n) => {
1242
+ const s = typeof IntersectionObserver < "u" ? Lt(t) : null;
1243
+ return x[t].set(n, r), s == null || s.observe(n), () => {
1244
+ var i;
1245
+ s == null || s.unobserve(n), x[t].delete(n), x[t].size === 0 && ((i = C[t]) == null || i.disconnect(), C[t] = null);
1246
+ };
1247
+ }),
1248
+ M(r.dispose),
1249
+ f(e(r))
1250
+ );
1251
+ }
1252
+ const Ar = (t, e, r) => It(t, (n) => k(n, e, r ?? w)), yr = (t, e) => (r) => {
1253
+ r = r.makeRef();
1254
+ const n = t.map((o) => f(e(o)));
1255
+ let s = () => {
1256
+ };
1257
+ const i = n.on((o) => {
1258
+ s(!0), s = o(r);
1259
+ });
1260
+ return (o) => {
1261
+ i(), s(o);
1262
+ };
1263
+ };
1264
+ function Er(t, e, r = w) {
1265
+ return k(
1266
+ t.map((n) => n.length > 0),
1267
+ e,
1268
+ r
1269
+ );
1270
+ }
1271
+ const Rt = (t) => (e) => {
1272
+ const r = e.element, n = A({ width: r.clientWidth, height: r.clientHeight }), s = f(t(n))(e), i = () => {
1273
+ n.set({ width: r.clientWidth, height: r.clientHeight });
1274
+ };
1275
+ let o;
1276
+ return typeof ResizeObserver == "function" && (o = new ResizeObserver(i), o.observe(r)), (l) => {
1277
+ o == null || o.disconnect(), s(l);
1278
+ };
1279
+ }, Ot = (t) => (e) => {
1280
+ const r = A({
1281
+ width: (window == null ? void 0 : window.innerWidth) ?? 0,
1282
+ height: (window == null ? void 0 : window.innerHeight) ?? 0
1283
+ }), n = f(t(r))(e), s = () => {
1284
+ r.set({
1285
+ width: (window == null ? void 0 : window.innerWidth) ?? 0,
1286
+ height: (window == null ? void 0 : window.innerHeight) ?? 0
1287
+ });
1288
+ };
1289
+ return window == null || window.addEventListener("resize", s), (i) => {
1290
+ window == null || window.removeEventListener("resize", s), n(i);
1291
+ };
1292
+ }, _r = {
1293
+ element: Rt,
1294
+ window: Ot
1295
+ }, xt = (t, e) => (r) => {
1296
+ const n = r.element, s = n.style.getPropertyValue(t);
1297
+ return n.style.setProperty(t, e), (i) => {
1298
+ i && n.style.setProperty(t, s);
1299
+ };
1300
+ }, Wt = (t, e) => (r) => {
1301
+ const n = r.element, s = n.style.getPropertyValue(t);
1302
+ return e.on((i) => n.style.setProperty(t, i)), (i) => {
1303
+ i && n.style.setProperty(t, s);
1304
+ };
1305
+ }, Pr = new Proxy(
1306
+ {},
1307
+ {
1308
+ get: (t, e) => (r) => d.is(r) ? Wt(e, r) : xt(e, r)
1309
+ }
1310
+ );
1311
+ export {
1312
+ cr as Async,
1313
+ fr as AutoFocus,
1314
+ hr as AutoSelect,
1315
+ T as Computed,
1316
+ pr as Conjunction,
1317
+ mr as Ctx,
1318
+ v as DOMContext,
1319
+ gr as DOMEl,
1320
+ $e as El,
1321
+ Ce as ElNS,
1322
+ w as Empty,
1323
+ Tt as Ensure,
1324
+ $t as ForEach,
1325
+ g as Fragment,
1326
+ Sr as HTMLTitle,
1327
+ wr as HiddenWhenEmpty,
1328
+ It as InViewport,
1329
+ yr as MapSignal,
1330
+ he as MemoryStore,
1331
+ Er as NotEmpty,
1332
+ At as OnChecked,
1333
+ M as OnDispose,
1334
+ Mt as OnMount,
1335
+ Ct as Portal,
1336
+ Ye as Position,
1337
+ F as Prop,
1338
+ ur as Provide,
1339
+ Re as Repeat,
1340
+ d as Signal,
1341
+ Le as Task,
1342
+ kt as Text,
1343
+ vr as Unless,
1344
+ ir as Use,
1345
+ bt as UseProvider,
1346
+ or as UseProviders,
1347
+ k as When,
1348
+ Ar as WhenInViewport,
1349
+ vt as WithProvider,
1350
+ ar as WithProviders,
1351
+ Ke as animate,
1352
+ Xt as animateOne,
1353
+ lr as appearance,
1354
+ oe as appearanceMarker,
1355
+ Ut as applyAnimatable,
1356
+ R as applyAnimatableProp,
1357
+ jt as applyInterpolatedAnimatable,
1358
+ Je as applyInterpolatedAnimatableProp,
1359
+ Gt as aria,
1360
+ P as attr,
1361
+ dr as bind,
1362
+ f as childToMountable,
1363
+ wt as clearSSR,
1364
+ Ue as colorChannelsToString,
1365
+ B as computed,
1366
+ Yt as computedRecord,
1367
+ qe as dateInterpolate,
1368
+ zt as effect,
1369
+ Z as emit,
1370
+ Ze as endInterpolate,
1371
+ Kt as getComputedAnimatable,
1372
+ ke as getComputedAnimatableProp,
1373
+ st as getSelfOrParentElement,
1374
+ Xe as guessInterpolate,
1375
+ Bt as handleAnchorClick,
1376
+ er as html,
1377
+ tr as input,
1378
+ Be as interpolateColor,
1379
+ Ht as interpolateShadow,
1380
+ ye as isElement,
1381
+ Ae as makeGetter,
1382
+ St as makeProviderMark,
1383
+ ve as makeSetter,
1384
+ nr as math,
1385
+ Qt as mathAttr,
1386
+ ze as numberInterpolate,
1387
+ q as on,
1388
+ N as oneof,
1389
+ se as parseColorChannels,
1390
+ A as prop,
1391
+ qt as propOfLocalStorage,
1392
+ Zt as propOfSessionStorage,
1393
+ de as propOfStorage,
1394
+ b as removeDOMNode,
1395
+ br as render,
1396
+ Oe as renderWithContext,
1397
+ nt as setAttribute,
1398
+ Qe as setBooleanProperty,
1399
+ tt as setDateProperty,
1400
+ et as setNumberProperty,
1401
+ rt as setStringProperty,
1402
+ Vt as signal,
1403
+ _e as signalText,
1404
+ _r as size,
1405
+ D as ssr,
1406
+ sr as startSSR,
1407
+ Ee as staticText,
1408
+ Ve as stringInterpolate,
1409
+ Pr as style,
1410
+ rr as svg,
1411
+ Jt as svgAttr
1412
+ };