@tempots/dom 9.0.2 → 10.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.
Files changed (129) hide show
  1. package/README.md +6 -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 +1 -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 +1397 -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 +504 -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,1397 @@
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 Fe = Object.defineProperty;
2
+ var Oe = (t, e, r) => e in t ? Fe(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
+ var a = (t, e, r) => Oe(t, typeof e != "symbol" ? e + "" : e, r);
4
+ function We(t, e, r) {
5
+ return t + (e - t) * r;
6
+ }
7
+ const k = 97;
8
+ function xe(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 = k);
14
+ let u = e.charCodeAt(i);
15
+ isNaN(u) && (u = k), s += String.fromCharCode(o + (u - o) * r);
16
+ }
17
+ return s;
18
+ }
19
+ function ze(t, e, r) {
20
+ return new Date(t.getTime() + (e.getTime() - t.getTime()) * r);
21
+ }
22
+ function Ve(t, e, r) {
23
+ return e;
24
+ }
25
+ function qe(t) {
26
+ return typeof t == "number" ? We : typeof t == "string" ? xe : t instanceof Date ? ze : Ve;
27
+ }
28
+ class Ze {
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 le;
47
+ le = ee;
48
+ const P = class P {
49
+ constructor(e, r) {
50
+ a(this, le, !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 L(() => {
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 L(() => {
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 L(() => {
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 L(() => {
109
+ try {
110
+ const o = this.get(), u = e(o);
111
+ return s = u ?? 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 = y(r, s);
120
+ let o = 0;
121
+ return i.onDispose(
122
+ this.on((u) => {
123
+ const l = ++o;
124
+ try {
125
+ e(u).then((c) => {
126
+ l === o && i.set(c);
127
+ }).catch((c) => {
128
+ l === 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(y(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 P(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 P.is(e) ? e : new P(e, r);
173
+ }
174
+ static maybeWrap(e) {
175
+ return e == null ? e : P.wrap(e);
176
+ }
177
+ static unwrap(e) {
178
+ return P.is(e) ? e.get() : e;
179
+ }
180
+ static map(e, r) {
181
+ return P.is(e) ? e.map(r) : r(e);
182
+ }
183
+ get value() {
184
+ return this._value;
185
+ }
186
+ };
187
+ let p = P;
188
+ const Xe = typeof queueMicrotask == "function" ? queueMicrotask : (t) => Promise.resolve().then(t);
189
+ var ae, ue;
190
+ class L extends (ue = p, ae = re, ue) {
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
+ Xe(() => {
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 O extends (fe = p, 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 O(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 L(t, r);
248
+ return e.forEach((s) => s.setDerivative(n)), n;
249
+ }
250
+ function Ct(t, e) {
251
+ return B(t, e).dispose;
252
+ }
253
+ function y(t, e = (r, n) => r === n) {
254
+ return new O(t, e);
255
+ }
256
+ function Tt(t, e = (r, n) => r === n) {
257
+ return new p(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 = (u, l) => u === l,
275
+ onLoad: o = (u) => u
276
+ }) {
277
+ const u = r.getItem(t), l = new O(
278
+ u != null ? o(s(u)) : typeof e == "function" ? e() : e,
279
+ i
280
+ );
281
+ return l.on((c) => {
282
+ r.setItem(t, n(c));
283
+ }), l;
284
+ }
285
+ function Rt(t) {
286
+ return de({
287
+ ...t,
288
+ store: (window == null ? void 0 : window.localStorage) ?? new he()
289
+ });
290
+ }
291
+ function Nt(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 Ye(t, e, r, n) {
301
+ const s = (n == null ? void 0 : n.duration) ?? 300, i = (n == null ? void 0 : n.easing) ?? ((v) => v), o = (n == null ? void 0 : n.equals) ?? ((v, R) => v === R);
302
+ let u = n == null ? void 0 : n.interpolate, l = t, c = e(), m = performance.now(), g = null, d = !0;
303
+ const _ = new L(e, o), E = y(t, o);
304
+ E.onDispose(() => {
305
+ g !== null && cancelAnimationFrame(g);
306
+ }), E.onDispose(_.dispose), r.forEach((v) => {
307
+ v.setDerivative(_), v.onDispose(E.dispose);
308
+ });
309
+ const Z = (v) => {
310
+ c = v, m = performance.now(), l = E.value, d && (d = !1, g = ne(J));
311
+ }, J = () => {
312
+ const R = (performance.now() - m) / p.unwrap(s), Ie = i(R);
313
+ u == null && (u = qe(l));
314
+ let Q = u(l, c, Ie);
315
+ R >= 1 ? (d = !0, Q = c) : g = ne(J), E.set(Q);
316
+ };
317
+ return _.on(Z), E;
318
+ }
319
+ function It(t, e) {
320
+ const { initialValue: r, ...n } = e ?? {};
321
+ return Ye(r ?? t.get(), t.get, [t], n);
322
+ }
323
+ function Ft(t, e) {
324
+ const { signals: r, literals: n } = Object.entries(t).reduce(
325
+ ({ signals: i, literals: o }, [u, l]) => (p.is(l) ? i.push([u, l]) : o[u] = l, { 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, , u, , l] = r, c = o != null ? parseInt(o, 10) : 0, m = u != null ? parseInt(u, 10) : 0;
364
+ return {
365
+ inset: !!n,
366
+ x: parseInt(s, 10),
367
+ y: parseInt(i, 10),
368
+ blur: c,
369
+ spread: m,
370
+ color: l
371
+ };
372
+ }
373
+ function He(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 Ke(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 je(t, e) {
381
+ const [r, n, s, i, o] = se(t), [u, l, c, m] = se(e);
382
+ return (g) => {
383
+ const d = r + (u - r) * g, _ = n + (l - n) * g, E = s + (c - s) * g, Z = i + (m - i) * g;
384
+ return Ke([d, _, E, Z, o]);
385
+ };
386
+ }
387
+ function Ot(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, u = r.blur + (n.blur - r.blur) * s, l = r.spread + (n.spread - r.spread) * s, c = me(r.color, n.color)(s);
391
+ return He({ inset: r.inset, x: i, y: o, blur: u, spread: l, color: c });
392
+ };
393
+ }
394
+ function Ue(t, e) {
395
+ var r, n, s, i, o, u, l, 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" ? (u = t.filter.match(/brightness\((\d+)%\)/)) == null ? void 0 : u[1] : e === "contrast" ? (l = t.filter.match(/contrast\((\d+)%\)/)) == null ? void 0 : l[1] : e === "blur" ? (c = t.filter.match(/blur\((\d+)px\)/)) == null ? void 0 : c[1] : t.getPropertyValue(e));
397
+ }
398
+ function Wt(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] = Ue(n, o));
403
+ }
404
+ return r;
405
+ }
406
+ function I(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 X = /* @__PURE__ */ new Map();
410
+ function pe(t, e, r) {
411
+ if (X.has(r + ":" + t + e))
412
+ return X.get(t + e);
413
+ const n = je(t, e);
414
+ return X.set(r + ":" + t + e, n), n;
415
+ }
416
+ function me(t, e) {
417
+ return pe(t, e, "c");
418
+ }
419
+ function Be(t, e) {
420
+ return pe(t, e, "s");
421
+ }
422
+ function Ge(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
+ I(t, e, i);
427
+ } else if (e === "boxShadow" || e === "textShadow") {
428
+ const i = Be(
429
+ r,
430
+ n
431
+ )(s);
432
+ I(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
+ I(t, e, i);
439
+ }
440
+ }
441
+ }
442
+ function xt(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
+ Ge(t, o, e[o], i, n);
447
+ }
448
+ }
449
+ function zt(t, e) {
450
+ t.style.transform = "", t.style.filter = "";
451
+ for (const [r, n] of Object.entries(e))
452
+ n != null && I(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
+ ]), Se = /* @__PURE__ */ new Set(["valueAsDate"]), ve = /* @__PURE__ */ new Set([
460
+ "value",
461
+ "textContent",
462
+ "innerText",
463
+ "innerHTML",
464
+ "outerHTML",
465
+ "className",
466
+ "classList"
467
+ ]), Y = /* @__PURE__ */ new Map();
468
+ function $(t, e) {
469
+ if (Y.has(t))
470
+ return Y.get(t);
471
+ {
472
+ const r = e(t);
473
+ return Y.set(t, r), r;
474
+ }
475
+ }
476
+ function Je(t) {
477
+ return (e, r) => {
478
+ r == null ? e[t] = null : e[t] = !!r;
479
+ };
480
+ }
481
+ function Qe(t) {
482
+ return (e, r) => {
483
+ r == null ? e[t] = null : e[t] = Number(r);
484
+ };
485
+ }
486
+ function ke(t) {
487
+ return (e, r) => {
488
+ r == null ? e[t] = null : e[t] = r;
489
+ };
490
+ }
491
+ function et(t) {
492
+ return (e, r) => {
493
+ r == null ? e[t] = null : e[t] = String(r);
494
+ };
495
+ }
496
+ function tt(t) {
497
+ return (e, r) => {
498
+ r == null ? e.removeAttribute(t) : e.setAttribute(t, r);
499
+ };
500
+ }
501
+ function be(t) {
502
+ return ge.has(t) ? $(t, Je) : we.has(t) ? $(t, Qe) : Se.has(t) ? $(t, ke) : ve.has(t) ? $(t, et) : $(t, tt);
503
+ }
504
+ function ye(t) {
505
+ return (e) => ge.has(t) ? !!e[t] : we.has(t) ? Number(e[t]) : Se.has(t) ? e[t] : ve.has(t) ? String(e[t]) : e.getAttribute(t);
506
+ }
507
+ class b {
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 b(
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 b(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 b(
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 b(
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 b(
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 b(
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 b(e.ownerDocument, e, r, {}, !0);
648
+ }
649
+ }
650
+ function A(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 rt(t) {
655
+ return Ae(t) ? t : t.parentElement;
656
+ }
657
+ function Ae(t) {
658
+ return t.nodeType === 1;
659
+ }
660
+ function nt(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: u } = s, l = i + o + u;
670
+ if (s.getAttribute("href") !== l || e && !/\/[^/.]*$/.test(i))
671
+ return !0;
672
+ }
673
+ return !1;
674
+ }
675
+ const Vt = (t, e = {
676
+ checkExtension: !0,
677
+ checkExternalUrl: !0
678
+ }) => (r) => {
679
+ const { checkExtension: n, checkExternalUrl: s } = e;
680
+ nt(
681
+ r,
682
+ n === !0,
683
+ s === !0
684
+ ) || t() && r.preventDefault();
685
+ }, Ee = (t) => (e) => {
686
+ e.isFirstLevel && h.isSSR && e.element.setAttribute("data-tempo-text", "");
687
+ const r = e.createText(t);
688
+ return e.appendOrInsert(r), (n) => {
689
+ n && A(r);
690
+ };
691
+ }, Pe = (t) => (e) => {
692
+ e.isFirstLevel && h.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 && A(r);
698
+ };
699
+ };
700
+ function qt(t) {
701
+ return p.is(t) ? Pe(t) : Ee(t);
702
+ }
703
+ const w = (...t) => (e) => {
704
+ const r = t.map((n) => f(n)(e));
705
+ return (n) => {
706
+ r.forEach((s) => s(n));
707
+ };
708
+ }, S = () => () => {
709
+ }, H = "data-tempo-attrs";
710
+ function W(t, e) {
711
+ const r = t.getAttribute(H);
712
+ r === null ? t.setAttribute(H, e) : t.setAttribute(H, `${r} ${e}`);
713
+ }
714
+ const st = (t) => (e) => (console.log("className.static", e.isFirstLevel, h.isSSR), e.isFirstLevel && h.isSSR && W(e.element, "class"), e.element.classList.add(...t), (r) => {
715
+ r && e.element.classList.remove(...t);
716
+ }), it = (t) => (e) => {
717
+ console.log("className.signal", e.isFirstLevel, h.isSSR), e.isFirstLevel && h.isSSR && W(e.element, "class");
718
+ const r = e.element;
719
+ let n = [];
720
+ const s = t.on((i) => {
721
+ n.forEach((o) => r.classList.remove(o)), n = (i ?? "").split(" ").filter((o) => o.length > 0), r.classList.add(...n);
722
+ });
723
+ return (i) => {
724
+ s(), i && n.forEach((o) => r.classList.remove(o)), n.length = 0;
725
+ };
726
+ }, x = (t, e) => {
727
+ const r = be(t), n = ye(t);
728
+ return (s) => {
729
+ console.log("attribute.static", t, s.isFirstLevel, h.isSSR), s.isFirstLevel && h.isSSR && W(s.element, t);
730
+ const i = n(s.element);
731
+ return r(s.element, e), (o) => {
732
+ o && r(s.element, i);
733
+ };
734
+ };
735
+ }, z = (t, e) => {
736
+ const r = be(t), n = ye(t);
737
+ return (s) => {
738
+ console.log("attribute.signal", t, s.isFirstLevel, h.isSSR), s.isFirstLevel && h.isSSR && W(s.element, t);
739
+ const i = n(s.element);
740
+ return e.on((o) => r(s.element, o)), (o) => {
741
+ o && r(s.element, i);
742
+ };
743
+ };
744
+ }, D = new Proxy(
745
+ {},
746
+ {
747
+ get: (t, e) => e === "class" ? (r) => p.is(r) ? it(r) : st(
748
+ (r ?? "").split(" ").filter((n) => n.length > 0)
749
+ ) : (r) => p.is(r) ? z(
750
+ e,
751
+ r
752
+ ) : x(
753
+ e,
754
+ r
755
+ )
756
+ }
757
+ ), Zt = new Proxy(
758
+ {},
759
+ {
760
+ get: (t, e) => (r) => p.is(r) ? z(
761
+ `aria-${e}`,
762
+ r
763
+ ) : x(
764
+ `aria-${e}`,
765
+ r
766
+ )
767
+ }
768
+ ), Xt = new Proxy(
769
+ {},
770
+ {
771
+ get: (t, e) => (r) => p.is(r) ? z(
772
+ e,
773
+ r
774
+ ) : x(
775
+ e,
776
+ r
777
+ )
778
+ }
779
+ ), Yt = new Proxy(
780
+ {},
781
+ {
782
+ get: (t, e) => (r) => p.is(r) ? z(
783
+ e,
784
+ r
785
+ ) : x(
786
+ e,
787
+ r
788
+ )
789
+ }
790
+ );
791
+ function f(t) {
792
+ return t == null ? S : Array.isArray(t) ? w(...t.map(f)) : typeof t == "string" ? Ee(t) : p.is(t) ? Pe(t) : t;
793
+ }
794
+ function _e(t, ...e) {
795
+ return (r) => {
796
+ const n = r.createElement(t, void 0);
797
+ r.appendOrInsert(n), console.log("ctx.isFirstLevel", r.isFirstLevel, "ssr.isSSR", h.isSSR), r.isFirstLevel && h.isSSR && n.setAttribute("data-tempo-node", ""), r = r.withElement(n);
798
+ const s = e.map((i) => f(i)(r));
799
+ return (i) => {
800
+ s.forEach((o) => o(!1)), i && A(n);
801
+ };
802
+ };
803
+ }
804
+ function De(t, e, ...r) {
805
+ return (n) => {
806
+ const s = n.createElement(t, e);
807
+ n.appendOrInsert(s), n.isFirstLevel && h.isSSR && s.setAttribute("data-tempo-node", ""), n = n.withElement(s);
808
+ const i = r.map((o) => f(o)(n));
809
+ return (o) => {
810
+ i.forEach((u) => u(!1)), o && A(s);
811
+ };
812
+ };
813
+ }
814
+ const Ht = new Proxy(
815
+ {},
816
+ {
817
+ get: (t, e) => (...r) => _e(e, r.flatMap(f))
818
+ }
819
+ ), Kt = new Proxy(
820
+ {},
821
+ {
822
+ get: (t, e) => (...r) => _e("input", D.type(e), ...r)
823
+ }
824
+ ), ot = "http://www.w3.org/2000/svg", jt = new Proxy(
825
+ {},
826
+ {
827
+ get: (t, e) => (...r) => De(e, ot, r.flatMap(f))
828
+ }
829
+ ), lt = "http://www.w3.org/1998/Math/MathML", Ut = new Proxy(
830
+ {},
831
+ {
832
+ get: (t, e) => (...r) => De(e, lt, r.flatMap(f))
833
+ }
834
+ );
835
+ let j = !1;
836
+ function at(t) {
837
+ t.querySelectorAll("[data-tempo-attrs]").forEach((e) => {
838
+ const r = e.getAttribute("data-tempo-attrs");
839
+ r !== null && (r.split(" ").forEach((n) => {
840
+ e.removeAttribute(n);
841
+ }), e.removeAttribute("data-tempo-attrs"));
842
+ }), t.querySelectorAll("[data-tempo-node]").forEach((e) => {
843
+ var r;
844
+ (r = e.parentElement) == null || r.removeChild(e), e.removeAttribute("data-tempo-node");
845
+ }), t.querySelectorAll("[data-tempo-text]").forEach((e) => {
846
+ e.textContent = "", e.removeAttribute("data-tempo-text");
847
+ }), t.querySelectorAll("[data-tempo-styles]").forEach((e) => {
848
+ const r = e.getAttribute("data-tempo-styles");
849
+ r !== null && (r.split(" ").forEach((n) => {
850
+ e == null || e.style.removeProperty(n);
851
+ }), e.removeAttribute("data-tempo-styles"));
852
+ });
853
+ }
854
+ let U = 0;
855
+ const Bt = (t = 30) => (j = !0, new Promise((e, r) => {
856
+ let n;
857
+ const s = setInterval(() => {
858
+ U <= 0 && (clearInterval(s), clearTimeout(n), j = !1, e());
859
+ }, 10);
860
+ n = setTimeout(() => {
861
+ clearInterval(s), r(new Error("SSR Timeout"));
862
+ }, t * 1e3);
863
+ })), h = {
864
+ useDone(t) {
865
+ return U++, f(t(() => U--));
866
+ },
867
+ get isSSR() {
868
+ return j;
869
+ }
870
+ }, Le = (t, e) => (r) => {
871
+ const n = Object.values(t).reduce((s, i) => {
872
+ const o = r.getProvider(i);
873
+ if (o == null)
874
+ throw new Error(`No provider found for mark: ${i.description}`);
875
+ return s[i] = o, s;
876
+ }, {});
877
+ return f(e(n))(r);
878
+ }, Gt = (t, e) => (r) => {
879
+ const n = [], s = Object.entries(t).reduce(
880
+ (i, [o, u]) => (n.push(
881
+ u((l) => (Reflect.set(i, o, l), null))(r)
882
+ ), i),
883
+ {}
884
+ );
885
+ return n.push(e(s)(r)), (i) => {
886
+ n.forEach((o) => o(i));
887
+ };
888
+ }, ut = (t, e) => Le([t], (r) => f(e(r[t]))), Jt = (t, e) => Le(t, (r) => f(e(r))), C = (t) => (e) => (r) => t(r, e);
889
+ function ct(t) {
890
+ return Symbol(t);
891
+ }
892
+ const $e = (t, e) => (r) => f(e)(r.withProviders(t)), Qt = (...t) => t.length > 0 ? t.reduceRight((e, r) => (n) => e(r(n))) : f, ft = (t, e, r) => $e({ [t]: e }, f(r)), kt = (t, e) => $e(t, f(e)), oe = ct("Appearance"), er = {
893
+ /**
894
+ * Provides a child component with an appearance context, which can be used to
895
+ * determine the current appearance (light or dark) based on the user's system
896
+ * preferences.
897
+ *
898
+ * The appearance context is updated whenever the user's system preferences
899
+ * change, and the component is cleaned up when it is no longer needed.
900
+ *
901
+ * @param child - The child component to be provided with the appearance context.
902
+ * @returns The child component with the appearance context.
903
+ */
904
+ provide: (t) => {
905
+ const e = window.matchMedia != null && window.matchMedia("(prefers-color-scheme: dark)").matches, r = y(e ? "dark" : "light"), n = (i) => {
906
+ r.set(i.matches ? "dark" : "light");
907
+ }, s = window.matchMedia != null ? window.matchMedia("(prefers-color-scheme: dark)") : void 0;
908
+ return s == null || s.addEventListener("change", n), w(
909
+ ft(oe, r, t),
910
+ C(() => s == null ? void 0 : s.removeEventListener("change", n))
911
+ );
912
+ },
913
+ /**
914
+ * Makes the AppearanceType available to the child component by consuming the signal provided by the parent.
915
+ * The result of the function is returned as the final output.
916
+ *
917
+ * @param fn - A function that accepts the `AppearanceType` signal and returns a `Child` element.
918
+ * @returns The `Child` element returned by the provided function.
919
+ */
920
+ consume: (t) => ut(oe, t)
921
+ }, Me = (t, e) => {
922
+ if (typeof e == "function")
923
+ return Me(t, { then: e });
924
+ const r = e.pending != null ? f(e.pending) : S, n = e.then, s = e.error != null ? (i) => f(e.error(i)) : () => S;
925
+ return (i) => {
926
+ let o = !0;
927
+ const u = t();
928
+ i = i.makeRef();
929
+ let l = f(r)(i);
930
+ return u.then(
931
+ (c) => {
932
+ o && (l(!0), l = f(n(c))(i));
933
+ },
934
+ (c) => {
935
+ o && (l(!0), l = f(s(c))(i));
936
+ }
937
+ ), (c) => {
938
+ o = !1, l(c), c && i.reference && A(i.reference);
939
+ };
940
+ };
941
+ }, tr = (t, e) => Me(() => t, e), rr = (t = 10) => (e) => {
942
+ const r = setTimeout(() => {
943
+ var n;
944
+ (n = e.element) == null || n.focus();
945
+ }, t);
946
+ return (n) => clearTimeout(r);
947
+ }, nr = (t = 10) => (e) => {
948
+ const r = setTimeout(() => {
949
+ var n;
950
+ (n = e.element) == null || n.select();
951
+ }, t);
952
+ return (n) => {
953
+ clearTimeout(r);
954
+ };
955
+ }, Ce = (t, e) => (r) => (r.element.addEventListener(t, e), (n) => {
956
+ n && r.element.removeEventListener(t, e);
957
+ }), ht = (t) => Ce("click", (e) => {
958
+ e.preventDefault();
959
+ const r = e.target;
960
+ setTimeout(() => {
961
+ const n = r.ownerDocument != null ? r == null ? void 0 : r.checked : void 0;
962
+ n != null && t(!n);
963
+ }, 0);
964
+ }), V = new Proxy(
965
+ {},
966
+ {
967
+ get: (t, e) => (r) => Ce(e, r)
968
+ }
969
+ ), q = {
970
+ value: (t) => (e) => {
971
+ const r = e.target;
972
+ t(r.value);
973
+ },
974
+ valueAsNumber: (t) => (e) => {
975
+ const r = e.target;
976
+ t(r.valueAsNumber);
977
+ },
978
+ valueAsDate: (t) => (e) => {
979
+ const r = e.target;
980
+ if (r.value === "")
981
+ return;
982
+ const n = r.value.split("-"), s = new Date(
983
+ Number(n[0]),
984
+ Number(n[1]) - 1,
985
+ Number(n[2].substring(0, 2))
986
+ );
987
+ t(s);
988
+ },
989
+ valueAsDateTime: (t) => (e) => {
990
+ const r = e.target;
991
+ if (r.value === "")
992
+ return;
993
+ const n = r.value.split("T"), s = n[0].split("-"), i = new Date(
994
+ Number(s[0]),
995
+ Number(s[1]) - 1,
996
+ Number(s[2])
997
+ ), o = n[1].split(":");
998
+ i.setHours(Number(o[0])), i.setMinutes(Number(o[1])), i.setSeconds(Number(o[2])), t(i);
999
+ },
1000
+ checked: (t) => (e) => {
1001
+ const r = e.target;
1002
+ t(r.checked);
1003
+ },
1004
+ preventDefault: (t) => (e) => {
1005
+ e.preventDefault(), t();
1006
+ },
1007
+ stopPropagation: (t) => (e) => {
1008
+ e.stopPropagation(), t();
1009
+ },
1010
+ stopImmediatePropagation: (t) => (e) => {
1011
+ e.stopImmediatePropagation(), t();
1012
+ }
1013
+ };
1014
+ function dt(t, e = "input") {
1015
+ return w(
1016
+ D.valueAsDate(t),
1017
+ V[e](q.valueAsDate(t.set))
1018
+ );
1019
+ }
1020
+ function pt(t, e = "input") {
1021
+ return w(
1022
+ D.valueAsDate(t),
1023
+ V[e](q.valueAsDateTime(t.set))
1024
+ );
1025
+ }
1026
+ function mt(t, e = "input") {
1027
+ return w(
1028
+ D.valueAsNumber(t),
1029
+ V[e](q.valueAsNumber(t.set))
1030
+ );
1031
+ }
1032
+ function gt(t, e = "input") {
1033
+ return w(D.value(t), V[e](q.value(t.set)));
1034
+ }
1035
+ function wt(t) {
1036
+ return w(D.checked(t), ht(t.set));
1037
+ }
1038
+ const sr = {
1039
+ date: dt,
1040
+ dateTime: pt,
1041
+ number: mt,
1042
+ text: gt,
1043
+ checked: wt
1044
+ }, N = (t, e) => (r) => {
1045
+ r = r.makeRef();
1046
+ let n, s;
1047
+ const i = t.map((l) => Object.keys(l)[0]);
1048
+ let o;
1049
+ const u = i.on((l) => {
1050
+ if (l !== o) {
1051
+ s == null || s.dispose(), n == null || n(!0), s = t.map((m) => m[l]);
1052
+ const c = e[l](s);
1053
+ n = f(c)(r), o = l;
1054
+ }
1055
+ });
1056
+ return (l) => {
1057
+ u(), l && r.reference != null && A(r.reference), n == null || n(!0);
1058
+ };
1059
+ }, T = {
1060
+ bool: (t, e) => N(
1061
+ t.map((r) => r ? { true: !0 } : { false: !0 }),
1062
+ e
1063
+ ),
1064
+ field: (t, e, r) => N(
1065
+ t.map((n) => ({ [n[e]]: n })),
1066
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1067
+ r
1068
+ ),
1069
+ kind: (t, e) => T.field(t, "kind", e),
1070
+ tuple: (t, e) => {
1071
+ const r = t.map(([n, s]) => ({ [n]: s }));
1072
+ return N(r, e);
1073
+ },
1074
+ type: (t, e) => T.field(t, "type", e),
1075
+ value: (t, e) => N(
1076
+ t.map((r) => ({ [r]: !0 })),
1077
+ e
1078
+ )
1079
+ }, ir = (t, e) => (r) => {
1080
+ const n = (e == null ? void 0 : e.firstSeparator) ?? S, s = (e == null ? void 0 : e.lastSeparator) ?? S;
1081
+ return T.value(
1082
+ r.map((i) => i.isFirst ? "first" : i.isLast ? "last" : "other"),
1083
+ {
1084
+ first: () => n,
1085
+ last: () => s,
1086
+ other: () => t
1087
+ }
1088
+ );
1089
+ }, or = (t) => (e) => t(e)(e), lr = (t) => (e) => (e.appendOrInsert(t), (r) => {
1090
+ r && A(t);
1091
+ }), St = (t, e, r) => (n) => {
1092
+ n = n.makeRef();
1093
+ let s = null, i = !1;
1094
+ const o = y(null), u = t.on((l) => {
1095
+ l == null ? (s == null || s(!0), s = f((r == null ? void 0 : r()) ?? S)(n), i = !1) : (o.value = l, i || (s == null || s(!0), s = f(e(o))(n), i = !0));
1096
+ });
1097
+ return (l) => {
1098
+ u(), s == null || s(l), l && n.reference && A(n.reference);
1099
+ };
1100
+ }, Te = (t, e, r) => r != null ? Te(t, (n) => {
1101
+ const s = n.map((i) => i.isLast ? "last" : "other");
1102
+ return w(
1103
+ C(() => s.dispose()),
1104
+ f(e(n)),
1105
+ T.value(s, {
1106
+ last: () => S,
1107
+ other: () => r(n)
1108
+ })
1109
+ );
1110
+ }) : (n) => {
1111
+ n = n.makeRef();
1112
+ const s = t.map(
1113
+ (l) => Array.from({ length: l }, (c, m) => m).map(
1114
+ (c) => new Ze(c, l)
1115
+ )
1116
+ ), i = [], o = [], u = s.on((l) => {
1117
+ var m, g;
1118
+ const c = l.length;
1119
+ for (; c < i.length; )
1120
+ (m = i.pop()) == null || m(!0), (g = o.pop()) == null || g.dispose();
1121
+ for (let d = 0; d < c; d++)
1122
+ if (o[d] == null) {
1123
+ o[d] = y(l[d]);
1124
+ const _ = f(e(o[d]));
1125
+ i[d] = _(n);
1126
+ } else
1127
+ o[d].value = l[d];
1128
+ });
1129
+ return (l) => {
1130
+ u(), l && n.reference && A(n.reference);
1131
+ };
1132
+ }, vt = (t, e, r) => r != null ? vt(t, (n, s) => {
1133
+ const i = s.map((o) => o.isLast ? "last" : "other");
1134
+ return w([
1135
+ C(() => i.dispose()),
1136
+ f(e(n, s)),
1137
+ T.value(i, {
1138
+ last: () => S,
1139
+ other: () => r(s)
1140
+ })
1141
+ ]);
1142
+ }) : (n) => {
1143
+ const s = t.map((i) => i.length);
1144
+ return Te(s, (i) => {
1145
+ const o = B(
1146
+ () => t.value[i.value.index],
1147
+ [i, t]
1148
+ );
1149
+ return w(
1150
+ C(() => o.dispose()),
1151
+ f(e(o, i))
1152
+ );
1153
+ })(n);
1154
+ }, ar = (t) => {
1155
+ const e = t.element, r = e.style.getPropertyValue(":empty");
1156
+ return e.style.setProperty(":empty", "display:none"), (n) => {
1157
+ n && e.style.setProperty(":empty", r);
1158
+ };
1159
+ };
1160
+ function Re(t, e) {
1161
+ const r = t(e);
1162
+ return () => r(!0);
1163
+ }
1164
+ function ur(t, e, { doc: r, clear: n } = {}) {
1165
+ const s = typeof e == "string" ? (r ?? document).querySelector(e) : e;
1166
+ if (s === null)
1167
+ throw new Error(`Cannot find element by selector for render: ${e}`);
1168
+ n && (r ?? s.ownerDocument) != null && at(r ?? s.ownerDocument);
1169
+ const i = rt(s), o = Ae(s) ? void 0 : s, u = b.of(i, o);
1170
+ return console.log("DOMContext.isFirstLevel", u.isFirstLevel), Re(t, u);
1171
+ }
1172
+ const bt = (t, e) => (r) => {
1173
+ const n = r.document.querySelector(t);
1174
+ if (n === null)
1175
+ throw new Error(`Cannot find element by selector for portal: ${t}`);
1176
+ return Re(
1177
+ f(e),
1178
+ r.withElement(n).withFirstLevel()
1179
+ );
1180
+ }, cr = (t) => bt("head title", D.innerText(t)), yt = (t) => (e) => t(e.element) ?? (() => {
1181
+ }), G = (t, e, r) => St(
1182
+ t.map((n) => n ? !0 : null),
1183
+ () => e,
1184
+ r != null ? () => r : void 0
1185
+ ), fr = (t, e, r) => G(
1186
+ t.map((n) => !n),
1187
+ e,
1188
+ r
1189
+ ), At = {
1190
+ partial: {
1191
+ root: null,
1192
+ rootMargin: "0px",
1193
+ threshold: 0
1194
+ },
1195
+ full: {
1196
+ root: null,
1197
+ rootMargin: "0px",
1198
+ threshold: 1
1199
+ }
1200
+ }, F = {
1201
+ partial: /* @__PURE__ */ new Map(),
1202
+ full: /* @__PURE__ */ new Map()
1203
+ }, M = {
1204
+ partial: null,
1205
+ full: null
1206
+ };
1207
+ function Et(t) {
1208
+ return M[t] == null && (M[t] = new IntersectionObserver((e) => {
1209
+ e.forEach((r) => {
1210
+ const n = F[t].get(r.target);
1211
+ n == null || n.set(r.isIntersecting);
1212
+ });
1213
+ }, At[t])), M[t];
1214
+ }
1215
+ function Pt(t, e) {
1216
+ const r = y(h.isSSR);
1217
+ return w(
1218
+ yt((n) => {
1219
+ const s = typeof IntersectionObserver < "u" ? Et(t) : null;
1220
+ return F[t].set(n, r), s == null || s.observe(n), () => {
1221
+ var i;
1222
+ s == null || s.unobserve(n), F[t].delete(n), F[t].size === 0 && ((i = M[t]) == null || i.disconnect(), M[t] = null);
1223
+ };
1224
+ }),
1225
+ C(r.dispose),
1226
+ f(e(r))
1227
+ );
1228
+ }
1229
+ const hr = (t, e, r) => Pt(t, (n) => G(n, e, r ?? S)), dr = (t, e) => (r) => {
1230
+ r = r.makeRef();
1231
+ const n = t.map((o) => f(e(o)));
1232
+ let s = () => {
1233
+ };
1234
+ const i = n.on((o) => {
1235
+ s(!0), s = o(r);
1236
+ });
1237
+ return (o) => {
1238
+ i(), s(o);
1239
+ };
1240
+ };
1241
+ function pr(t, e, r = S) {
1242
+ return G(
1243
+ t.map((n) => n.length > 0),
1244
+ e,
1245
+ r
1246
+ );
1247
+ }
1248
+ const _t = (t) => (e) => {
1249
+ const r = e.element, n = y({ width: r.clientWidth, height: r.clientHeight }), s = f(t(n))(e), i = () => {
1250
+ n.set({ width: r.clientWidth, height: r.clientHeight });
1251
+ };
1252
+ let o;
1253
+ return typeof ResizeObserver == "function" && (o = new ResizeObserver(i), o.observe(r)), (u) => {
1254
+ o == null || o.disconnect(), s(u);
1255
+ };
1256
+ }, Dt = (t) => (e) => {
1257
+ const r = y({
1258
+ width: (window == null ? void 0 : window.innerWidth) ?? 0,
1259
+ height: (window == null ? void 0 : window.innerHeight) ?? 0
1260
+ }), n = f(t(r))(e), s = () => {
1261
+ r.set({
1262
+ width: (window == null ? void 0 : window.innerWidth) ?? 0,
1263
+ height: (window == null ? void 0 : window.innerHeight) ?? 0
1264
+ });
1265
+ };
1266
+ return window == null || window.addEventListener("resize", s), (i) => {
1267
+ window == null || window.removeEventListener("resize", s), n(i);
1268
+ };
1269
+ }, mr = {
1270
+ element: _t,
1271
+ window: Dt
1272
+ }, K = "data-tempo-styles";
1273
+ function Ne(t, e) {
1274
+ const r = t.getAttribute(K);
1275
+ r === null ? t.setAttribute(K, e) : t.setAttribute(K, `${r} ${e}`);
1276
+ }
1277
+ const Lt = (t, e) => (r) => {
1278
+ r.isFirstLevel && h.isSSR && Ne(r.element, t);
1279
+ const n = r.element, s = n.style.getPropertyValue(t);
1280
+ return n.style.setProperty(t, e), (i) => {
1281
+ i && n.style.setProperty(t, s);
1282
+ };
1283
+ }, $t = (t, e) => (r) => {
1284
+ r.isFirstLevel && h.isSSR && Ne(r.element, t);
1285
+ const n = r.element, s = n.style.getPropertyValue(t);
1286
+ return e.on((i) => n.style.setProperty(t, i)), (i) => {
1287
+ i && n.style.setProperty(t, s);
1288
+ };
1289
+ }, gr = new Proxy(
1290
+ {},
1291
+ {
1292
+ get: (t, e) => (r) => p.is(r) ? $t(e, r) : Lt(e, r)
1293
+ }
1294
+ );
1295
+ export {
1296
+ tr as Async,
1297
+ rr as AutoFocus,
1298
+ nr as AutoSelect,
1299
+ L as Computed,
1300
+ ir as Conjunction,
1301
+ or as Ctx,
1302
+ b as DOMContext,
1303
+ lr as DOMEl,
1304
+ _e as El,
1305
+ De as ElNS,
1306
+ S as Empty,
1307
+ St as Ensure,
1308
+ vt as ForEach,
1309
+ w as Fragment,
1310
+ cr as HTMLTitle,
1311
+ ar as HiddenWhenEmpty,
1312
+ Pt as InViewport,
1313
+ dr as MapSignal,
1314
+ he as MemoryStore,
1315
+ pr as NotEmpty,
1316
+ ht as OnChecked,
1317
+ C as OnDispose,
1318
+ yt as OnMount,
1319
+ bt as Portal,
1320
+ Ze as Position,
1321
+ O as Prop,
1322
+ Qt as Provide,
1323
+ Te as Repeat,
1324
+ p as Signal,
1325
+ Me as Task,
1326
+ qt as Text,
1327
+ fr as Unless,
1328
+ Gt as Use,
1329
+ ut as UseProvider,
1330
+ Jt as UseProviders,
1331
+ G as When,
1332
+ hr as WhenInViewport,
1333
+ ft as WithProvider,
1334
+ kt as WithProviders,
1335
+ Ne as addStyleTracker,
1336
+ Ye as animate,
1337
+ It as animateOne,
1338
+ er as appearance,
1339
+ oe as appearanceMarker,
1340
+ zt as applyAnimatable,
1341
+ I as applyAnimatableProp,
1342
+ xt as applyInterpolatedAnimatable,
1343
+ Ge as applyInterpolatedAnimatableProp,
1344
+ Zt as aria,
1345
+ D as attr,
1346
+ sr as bind,
1347
+ f as childToMountable,
1348
+ at as clearSSR,
1349
+ Ke as colorChannelsToString,
1350
+ B as computed,
1351
+ Ft as computedRecord,
1352
+ ze as dateInterpolate,
1353
+ Ct as effect,
1354
+ q as emit,
1355
+ Ve as endInterpolate,
1356
+ Wt as getComputedAnimatable,
1357
+ Ue as getComputedAnimatableProp,
1358
+ rt as getSelfOrParentElement,
1359
+ qe as guessInterpolate,
1360
+ Vt as handleAnchorClick,
1361
+ Ht as html,
1362
+ Kt as input,
1363
+ je as interpolateColor,
1364
+ Ot as interpolateShadow,
1365
+ Ae as isElement,
1366
+ ye as makeGetter,
1367
+ ct as makeProviderMark,
1368
+ be as makeSetter,
1369
+ Ut as math,
1370
+ Yt as mathAttr,
1371
+ We as numberInterpolate,
1372
+ V as on,
1373
+ T as oneof,
1374
+ se as parseColorChannels,
1375
+ y as prop,
1376
+ Rt as propOfLocalStorage,
1377
+ Nt as propOfSessionStorage,
1378
+ de as propOfStorage,
1379
+ A as removeDOMNode,
1380
+ ur as render,
1381
+ Re as renderWithContext,
1382
+ tt as setAttribute,
1383
+ Je as setBooleanProperty,
1384
+ ke as setDateProperty,
1385
+ Qe as setNumberProperty,
1386
+ et as setStringProperty,
1387
+ Tt as signal,
1388
+ Pe as signalText,
1389
+ mr as size,
1390
+ h as ssr,
1391
+ Bt as startSSR,
1392
+ Ee as staticText,
1393
+ xe as stringInterpolate,
1394
+ gr as style,
1395
+ jt as svg,
1396
+ Xt as svgAttr
1397
+ };