@tempots/dom 18.0.0 → 19.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 (49) hide show
  1. package/dom/animatable.d.ts +12 -12
  2. package/dom/attr.d.ts +14 -7
  3. package/dom/dom-context.d.ts +47 -2
  4. package/dom/dom-utils.d.ts +6 -3
  5. package/dom/handle-anchor-click.d.ts +13 -2
  6. package/dom/ssr.d.ts +48 -16
  7. package/index.cjs +1 -1
  8. package/index.js +984 -744
  9. package/package.json +1 -1
  10. package/renderable/async.d.ts +33 -3
  11. package/renderable/attribute.d.ts +24 -7
  12. package/renderable/bind.d.ts +43 -13
  13. package/renderable/conjunction.d.ts +23 -4
  14. package/renderable/consumers.d.ts +54 -1
  15. package/renderable/domnode.d.ts +10 -2
  16. package/renderable/element.d.ts +50 -3
  17. package/renderable/empty.d.ts +5 -0
  18. package/renderable/ensure.d.ts +10 -0
  19. package/renderable/foreach.d.ts +12 -2
  20. package/renderable/fragment.d.ts +11 -0
  21. package/renderable/handler.d.ts +64 -10
  22. package/renderable/map-signal.d.ts +15 -0
  23. package/renderable/not-empty.d.ts +13 -1
  24. package/renderable/onctx.d.ts +9 -2
  25. package/renderable/oneof.d.ts +138 -16
  26. package/renderable/onmount.d.ts +8 -0
  27. package/renderable/onunmount.d.ts +6 -0
  28. package/renderable/portal.d.ts +12 -3
  29. package/renderable/providers.d.ts +39 -6
  30. package/renderable/render.d.ts +39 -3
  31. package/renderable/repeat.d.ts +11 -2
  32. package/renderable/style.d.ts +4 -0
  33. package/renderable/task.d.ts +18 -2
  34. package/renderable/text.d.ts +16 -3
  35. package/renderable/when.d.ts +21 -3
  36. package/std/interpolate.d.ts +56 -5
  37. package/std/position.d.ts +42 -2
  38. package/std/signal-utils.d.ts +195 -19
  39. package/std/signal.d.ts +399 -30
  40. package/types/aria-attributes.d.ts +5 -0
  41. package/types/css-styles.d.ts +11 -0
  42. package/types/domain.d.ts +62 -2
  43. package/types/html-attributes.d.ts +10 -0
  44. package/types/html-events.d.ts +5 -0
  45. package/types/html-tags.d.ts +5 -0
  46. package/types/mathml-attributes.d.ts +5 -0
  47. package/types/mathml-tags.d.ts +4 -0
  48. package/types/svg-attributes.d.ts +5 -0
  49. package/types/svg-tags.d.ts +5 -0
package/index.js CHANGED
@@ -1,154 +1,310 @@
1
- var Me = Object.defineProperty;
2
- var Oe = (t, e, r) => e in t ? Me(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
- var l = (t, e, r) => Oe(t, typeof e != "symbol" ? e + "" : e, r);
4
- function Ie(t, e, r) {
5
- return t + (e - t) * r;
6
- }
7
- const z = 97;
8
- function $e(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 = z);
14
- let a = e.charCodeAt(i);
15
- isNaN(a) && (a = z), s += String.fromCharCode(o + (a - o) * r);
1
+ var De = Object.defineProperty;
2
+ var be = (t, e, r) => e in t ? De(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
+ var l = (t, e, r) => be(t, typeof e != "symbol" ? e + "" : e, r);
4
+ const Te = (t, e, r) => t + (e - t) * r;
5
+ const Le = (t, e, r) => {
6
+ const s = Math.max(t.length, e.length);
7
+ let n = "";
8
+ for (let o = 0; o < s; o++) {
9
+ let i = t.charCodeAt(o);
10
+ isNaN(i) && (i = 97);
11
+ let a = e.charCodeAt(o);
12
+ isNaN(a) && (a = 97), n += String.fromCharCode(i + (a - i) * r);
16
13
  }
17
- return s;
18
- }
19
- function Fe(t, e, r) {
20
- return new Date(t.getTime() + (e.getTime() - t.getTime()) * r);
21
- }
22
- function qe(t, e, r) {
23
- return e;
24
- }
25
- function Ve(t) {
26
- return typeof t == "number" ? Ie : typeof t == "string" ? $e : t instanceof Date ? Fe : qe;
27
- }
28
- class Ue {
14
+ return n;
15
+ }, Ne = (t, e, r) => new Date(t.getTime() + (e.getTime() - t.getTime()) * r), Ce = (t, e) => e, Oe = (t) => typeof t == "number" ? Te : typeof t == "string" ? Le : t instanceof Date ? Ne : Ce;
16
+ class ke {
17
+ /**
18
+ * Creates a new instance of `ElementPosition`.
19
+ * @param index - The index of the element.
20
+ * @param total - The total number of elements in the collection.
21
+ */
29
22
  constructor(e, r) {
30
23
  this.index = e, this.total = r;
31
24
  }
25
+ /**
26
+ * Checks if the element is the first element in the collection.
27
+ * @returns `true` if the element is the first element, `false` otherwise.
28
+ */
32
29
  get isFirst() {
33
30
  return this.index === 0;
34
31
  }
32
+ /**
33
+ * Checks if the element is the last element in the collection.
34
+ * @returns `true` if the element is the last element, `false` otherwise.
35
+ */
35
36
  get isLast() {
36
37
  return this.index === this.total - 1;
37
38
  }
39
+ /**
40
+ * Checks if the index of the element is even.
41
+ * @returns `true` if the index is even, `false` otherwise.
42
+ */
38
43
  get isEven() {
39
44
  return this.index % 2 === 0;
40
45
  }
46
+ /**
47
+ * Checks if the index of the element is odd.
48
+ * @returns `true` if the index is odd, `false` otherwise.
49
+ */
41
50
  get isOdd() {
42
51
  return this.index % 2 === 1;
43
52
  }
44
53
  }
45
- const K = "$__signal__", Q = "$__prop__", Y = "$__computed__";
46
- var x;
47
- x = K;
48
- const w = class w {
54
+ const d = class d {
55
+ /**
56
+ * Represents a signal with a value of type T.
57
+ *
58
+ * @param value - The initial value of the signal.
59
+ * @param equals - A function that determines whether two values of type T are equal.
60
+ * @public
61
+ */
49
62
  constructor(e, r) {
50
- l(this, x, !0);
63
+ /**
64
+ * @internal
65
+ */
66
+ l(this, "$__signal__", !0);
67
+ /**
68
+ * @internal
69
+ */
51
70
  l(this, "_value");
71
+ /**
72
+ * @internal
73
+ */
52
74
  l(this, "_derivatives", []);
75
+ /**
76
+ * @internal
77
+ */
53
78
  l(this, "_onValueListeners", []);
79
+ /**
80
+ * @internal
81
+ */
54
82
  l(this, "_onDisposeListeners", []);
83
+ /**
84
+ * Gets the current value of the signal.
85
+ * @returns The current value of the signal.
86
+ */
55
87
  l(this, "get", () => this._value);
88
+ /**
89
+ * Checks if the signal has any registered listeners.
90
+ * @returns `true` if the signal has listeners, `false` otherwise.
91
+ */
56
92
  l(this, "hasListeners", () => this._onValueListeners.length > 0);
93
+ /**
94
+ * Registers a listener function to be called whenever the value of the signal changes.
95
+ * The listener function will be immediately called with the current value of the signal.
96
+ * Returns a function that can be called to unregister the listener.
97
+ *
98
+ * @param listener - The listener function to be called when the value of the signal changes.
99
+ */
57
100
  l(this, "on", (e) => (e(this.get()), this._onValueListeners.push(e), () => {
58
101
  this._onValueListeners.splice(this._onValueListeners.indexOf(e), 1);
59
102
  }));
103
+ /**
104
+ * @internal
105
+ */
60
106
  l(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));
107
+ const s = this.equals(this._value, e);
108
+ s || (this._value = e), (r || !s) && this._onValueListeners.forEach((n) => n(e));
63
109
  });
110
+ /**
111
+ * @internal
112
+ */
64
113
  l(this, "_disposed", !1);
114
+ /**
115
+ * Checks whether the signal is disposed.
116
+ * @returns True if the signal is disposed, false otherwise.
117
+ */
65
118
  l(this, "isDisposed", () => this._disposed);
119
+ /**
120
+ * Adds a listener function to be called when the object is disposed.
121
+ * @param listener - The listener function to be called when the object is disposed.
122
+ * @returns A function that can be called to remove the listener.
123
+ */
66
124
  l(this, "onDispose", (e) => {
67
125
  this._onDisposeListeners.push(e);
68
126
  });
127
+ /**
128
+ * Disposes the signal, releasing any resources associated with it.
129
+ */
69
130
  l(this, "dispose", () => {
70
131
  this._disposed || (this._disposed = !0, this._onDisposeListeners.forEach((e) => e()), this._onDisposeListeners.length = 0, this._derivatives.length = 0);
71
132
  });
72
- l(this, "map", (e, r = (n, s) => n === s) => {
73
- const n = new E(() => {
133
+ /**
134
+ * Returns a new Computed instance that applies the given mapping function to the value of this Signal.
135
+ * The mapping function is called whenever the value of this Signal changes.
136
+ *
137
+ * @typeParam O - The type of the mapped value.
138
+ * @param fn - The mapping function to apply to the value of this Signal.
139
+ * @param equals - Optional equality function to determine if two mapped values are equal.
140
+ * @returns - A new Computed instance with the mapped value.
141
+ */
142
+ l(this, "map", (e, r = (s, n) => s === n) => {
143
+ const s = new E(() => {
74
144
  try {
75
145
  return e(this.get());
76
- } catch (s) {
77
- throw console.error("Error in Signal.map:", s), s;
146
+ } catch (n) {
147
+ throw console.error("Error in Signal.map:", n), n;
78
148
  }
79
149
  }, r);
80
- return this.setDerivative(n), n;
150
+ return this.setDerivative(s), s;
81
151
  });
82
- l(this, "flatMap", (e, r = (n, s) => n === s) => {
83
- const n = new E(() => {
152
+ /**
153
+ * Returns a new Signal that applies the given function to the value of the current Signal,
154
+ * and then flattens the resulting Signal.
155
+ *
156
+ * @typeParam O - The type of the value emitted by the resulting Signal.
157
+ * @param fn - The function to apply to the value of the current Signal.
158
+ * @param equals - A function that determines whether two values of type O are equal.
159
+ * Defaults to a strict equality check (===).
160
+ * @returns A new Signal that emits the values of the resulting Signal.
161
+ */
162
+ l(this, "flatMap", (e, r = (s, n) => s === n) => {
163
+ const s = new E(() => {
84
164
  try {
85
165
  return e(this.get()).get();
86
- } catch (s) {
87
- throw console.error("Error in Signal.flatMap:", s), s;
166
+ } catch (n) {
167
+ throw console.error("Error in Signal.flatMap:", n), n;
88
168
  }
89
169
  }, r);
90
- return this.setDerivative(n), n;
170
+ return this.setDerivative(s), s;
91
171
  });
172
+ /**
173
+ * Invokes a callback function with the current value of the signal, without modifying the signal.
174
+ *
175
+ * @param fn - The callback function to be invoked with the current value of the signal.
176
+ * @returns A new signal that emits the same value as the original signal and invokes the callback function.
177
+ */
92
178
  l(this, "tap", (e) => this.map((r) => (e(r), r)));
179
+ /**
180
+ * Returns a new Signal that emits the value at the specified key of the current value.
181
+ *
182
+ * @param key - The key of the value to retrieve.
183
+ * @returns A new Signal that emits the value at the specified key.
184
+ */
93
185
  l(this, "at", (e) => this.map((r) => r[e]));
186
+ /**
187
+ * Represents a collection of signals for each key in the value of the signal.
188
+ * @typeParam T - The type of the signals.
189
+ */
94
190
  l(this, "$", new Proxy(this, {
191
+ /**
192
+ * Retrieves the signal with the specified key.
193
+ * @param _ - The target object.
194
+ * @param key - The key of the signal.
195
+ * @returns The signal associated with the key.
196
+ */
95
197
  get: (e, r) => this.at(r)
96
198
  }));
97
199
  l(this, "filter", (e, r) => {
98
- let n = r ?? this.get();
99
- const s = new E(() => {
200
+ let s = r ?? this.get();
201
+ const n = new E(() => {
100
202
  try {
101
- const i = this.get();
102
- return n = e(i) ? i : n;
103
- } catch (i) {
104
- throw console.error("Error in Signal.filter:", i), i;
203
+ const o = this.get();
204
+ return s = e(o) ? o : s;
205
+ } catch (o) {
206
+ throw console.error("Error in Signal.filter:", o), o;
105
207
  }
106
208
  }, this.equals);
107
- return this.setDerivative(s), s;
209
+ return this.setDerivative(n), n;
108
210
  });
109
- l(this, "filterMap", (e, r, n = (s, i) => s === i) => {
110
- let s = r;
111
- const i = new E(() => {
211
+ /**
212
+ * Returns a new Computed object that applies the provided mapping function to the value of this Signal,
213
+ * and filters out values that are `undefined` or `null`.
214
+ *
215
+ * @typeParam O - The type of the mapped value.
216
+ * @param fn - The mapping function to apply to the value of this Signal.
217
+ * @param startValue - The initial value for the Computed object.
218
+ * @param equals - Optional equality function to determine if two values are equal.
219
+ * @returns - A new Computed object with the mapped and filtered values.
220
+ */
221
+ l(this, "filterMap", (e, r, s = (n, o) => n === o) => {
222
+ let n = r;
223
+ const o = new E(() => {
112
224
  try {
113
- const o = this.get(), a = e(o);
114
- return s = a ?? s;
115
- } catch (o) {
116
- throw console.error("Error in Signal.filterMap:", o), o;
225
+ const i = this.get(), a = e(i);
226
+ return n = a ?? n;
227
+ } catch (i) {
228
+ throw console.error("Error in Signal.filterMap:", i), i;
117
229
  }
118
- }, n);
119
- return this.setDerivative(i), i;
230
+ }, s);
231
+ return this.setDerivative(o), o;
120
232
  });
121
- l(this, "mapAsync", (e, r, n, s = (i, o) => i === o) => {
122
- const i = L(r, s);
123
- let o = 0;
124
- return i.onDispose(
233
+ /**
234
+ * Maps the values emitted by the signal to a new value asynchronously using the provided function.
235
+ * If the function throws an error, it will be caught and logged.
236
+ * If a recovery function is provided, it will be called with the error and its return value will be used as the mapped value.
237
+ * If no recovery function is provided, the error will be logged as an unhandled promise rejection.
238
+ *
239
+ * @typeParam O - The type of the mapped value.
240
+ * @param fn - The function to map the values emitted by the signal.
241
+ * @param alt - The alternate value to use if the signal is disposed or the mapping function throws an error.
242
+ * @param recover - The recovery function to handle errors thrown by the mapping function.
243
+ * @param equals - The equality function to compare the mapped values for equality.
244
+ * @returns A property that holds the mapped value and can be observed for changes.
245
+ */
246
+ l(this, "mapAsync", (e, r, s, n = (o, i) => o === i) => {
247
+ const o = L(r, n);
248
+ let i = 0;
249
+ return o.onDispose(
125
250
  this.on((a) => {
126
- const u = ++o;
251
+ const u = ++i;
127
252
  try {
128
- e(a).then((f) => {
129
- u === o && i.set(f);
130
- }).catch((f) => {
131
- u === o && (n != null ? i.set(n(f)) : console.error(
253
+ e(a).then((c) => {
254
+ u === i && o.set(c);
255
+ }).catch((c) => {
256
+ u === i && (s != null ? o.set(s(c)) : console.error(
132
257
  "Unhandled promise rejection in Signal.mapAsync:",
133
- f
258
+ c
134
259
  ));
135
260
  });
136
- } catch (f) {
137
- throw console.error("Error in Signal.mapAsync:", f), f;
261
+ } catch (c) {
262
+ throw console.error("Error in Signal.mapAsync:", c), c;
138
263
  }
139
264
  })
140
- ), i;
265
+ ), o;
141
266
  });
142
- l(this, "mapMaybe", (e, r) => this.map((n) => e(n) ?? r));
267
+ /**
268
+ * Maps the values of the signal using the provided function `fn`, and returns a new signal
269
+ * containing the mapped values. If the mapped value is `undefined` or `null`, it is replaced
270
+ * with the provided `alt` value.
271
+ *
272
+ * @typeParam O - The type of the mapped value.
273
+ * @param fn - The function used to map the values of the signal.
274
+ * @param alt - The alternative value to use when the mapped value is `undefined` or `null`.
275
+ * @returns A new signal containing the mapped values.
276
+ */
277
+ l(this, "mapMaybe", (e, r) => this.map((s) => e(s) ?? r));
278
+ /**
279
+ * Feeds a property into the signal and sets up disposal behavior.
280
+ * @param prop - The property to feed into the signal.
281
+ * @param autoDisposeProp - Determines whether the property should be automatically disposed when the signal is disposed.
282
+ * @returns The input property.
283
+ */
143
284
  l(this, "feedProp", (e, r = !1) => {
144
- const n = this.on(e.set);
145
- return e.onDispose(n), r ? this.onDispose(e.dispose) : this.onDispose(n), e;
285
+ const s = this.on(e.set);
286
+ return e.onDispose(s), r ? this.onDispose(e.dispose) : this.onDispose(s), e;
146
287
  });
288
+ /**
289
+ * Derives a new property from the current signal.
290
+ * @param autoDisposeProp - Determines whether the derived property should be automatically disposed.
291
+ * @returns The derived property.
292
+ */
147
293
  l(this, "deriveProp", (e = !0) => this.feedProp(L(this.get()), e));
294
+ /**
295
+ * Returns a signal that emits the count of values received so far.
296
+ * @returns A signal that emits the count of values received so far.
297
+ */
148
298
  l(this, "count", () => {
149
299
  let e = 0;
150
300
  return this.map(() => ++e);
151
301
  });
302
+ /**
303
+ * Adds a computed value as a derivative of the signal.
304
+ * When the computed value is disposed, it is automatically removed from the derivatives list.
305
+ * Additionally, when the computed value is disposed, it sets the signal as dirty.
306
+ * @param computed - The computed value to add as a derivative.
307
+ */
152
308
  l(this, "setDerivative", (e) => {
153
309
  this._derivatives.push(e), e.onDispose(() => {
154
310
  this._derivatives.splice(
@@ -159,49 +315,115 @@ const w = class w {
159
315
  });
160
316
  this.equals = r, this._value = e;
161
317
  }
162
- static ofPromise(e, r, n, s = (i, o) => i === o) {
163
- const i = new w(r, s);
164
- return e.then((o) => i._setAndNotify(o, !1)).catch((o) => {
165
- n != null ? i._setAndNotify(n(o), !1) : console.error(
166
- "Unhandled promise rejection in Signal.ofPromise:",
167
- o
168
- );
169
- }), i;
170
- }
171
- static is(e) {
172
- return e != null && e[K] === !0;
173
- }
174
- static wrap(e, r = (n, s) => n === s) {
175
- return w.is(e) ? e : new w(e, r);
176
- }
177
- static maybeWrap(e) {
178
- return e == null ? e : w.wrap(e);
179
- }
180
- static unwrap(e) {
181
- return w.is(e) ? e.get() : e;
182
- }
183
- static map(e, r) {
184
- return w.is(e) ? e.map(r) : r(e);
185
- }
318
+ /**
319
+ * Gets the value of the signal.
320
+ * @returns The current value of the signal.
321
+ */
186
322
  get value() {
187
323
  return this._value;
188
324
  }
189
325
  };
190
- let h = w;
191
- const je = typeof queueMicrotask == "function" ? queueMicrotask : (t) => Promise.resolve().then(t);
192
- var ee, te;
193
- class E extends (te = h, ee = Y, te) {
194
- constructor(r, n) {
195
- super(void 0, n);
196
- l(this, ee, !0);
326
+ /**
327
+ * Creates a Signal that holds the result of a Promise.
328
+ *
329
+ * @typeParam O - The type of the value returned by the Promise.
330
+ * @param promise - The Promise to use to feed the Signal.
331
+ * @param init - The initial value of the Signal before the Promise resolves.
332
+ * @param recover - A function to recover from Promise rejection and provide an alternative value for the Signal.
333
+ * @param equals - A function to compare two values of type O for equality. Defaults to strict equality (===).
334
+ * @returns - A Signal that represents the result of the Promise.
335
+ */
336
+ l(d, "ofPromise", (e, r, s, n = (o, i) => o === i) => {
337
+ const o = new d(r, n);
338
+ return e.then((i) => o._setAndNotify(i, !1)).catch((i) => {
339
+ s != null ? o._setAndNotify(s(i), !1) : console.error(
340
+ "Unhandled promise rejection in Signal.ofPromise:",
341
+ i
342
+ );
343
+ }), o;
344
+ }), /**
345
+ * Checks if a value is a Signal.
346
+ *
347
+ * @param value - The value to check.
348
+ * @returns `true` if the value is a Signal, `false` otherwise.
349
+ */
350
+ l(d, "is", (e) => (
351
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
352
+ e != null && e.$__signal__ === !0
353
+ )), /**
354
+ * Wraps a value or a Signal instance into a Signal.
355
+ * If the value is already a Signal, it returns the value itself.
356
+ * If the value is not a Signal, it creates a new Signal instance with the given value.
357
+ *
358
+ * @typeParam O - The type of the value.
359
+ * @param value - The value or Signal instance to wrap.
360
+ * @param equals - A function that determines if two values are equal. Defaults to strict equality (===).
361
+ * @returns A Signal instance.
362
+ */
363
+ l(d, "wrap", (e, r = (s, n) => s === n) => d.is(e) ? e : new d(e, r)), /**
364
+ * Wraps a value in a `Signal` if it is not already a `Signal`.
365
+ * If the value is `null` or `undefined`, it returns `null` or `undefined` respectively.
366
+ * @param value - The value to wrap or check.
367
+ * @returns The wrapped value if it is not `null` or `undefined`, otherwise `null` or `undefined`.
368
+ */
369
+ l(d, "maybeWrap", (e) => e == null ? e : d.wrap(e)), /**
370
+ * Unwraps a value from a `Signal` if it is a `Signal`, otherwise returns the value as is.
371
+ *
372
+ * @param value - The value to unwrap.
373
+ * @returns The unwrapped value.
374
+ */
375
+ l(d, "unwrap", (e) => d.is(e) ? e.get() : e), /**
376
+ * Maps the value of a `Signal` or a regular value using the provided mapping function.
377
+ * If the input value is a `Signal`, the mapping function is applied to its value.
378
+ * If the input value is not a `Signal`, the mapping function is directly applied to the value.
379
+ *
380
+ * @param value - The input value to be mapped.
381
+ * @param fn - The mapping function to be applied to the value.
382
+ * @returns A new `Signal` with the mapped value if the input value is a `Signal`,
383
+ * otherwise, the result of applying the mapping function to the value.
384
+ *
385
+ * @typeParam N - The type of the input value.
386
+ * @typeParam O - The type of the mapped value.
387
+ */
388
+ l(d, "map", (e, r) => d.is(e) ? e.map(r) : r(e));
389
+ let h = d;
390
+ const Re = typeof queueMicrotask == "function" ? queueMicrotask : (t) => Promise.resolve().then(t);
391
+ class E extends h {
392
+ /**
393
+ * Represents a Signal object.
394
+ * @param _fn - The function that returns the value of the signal.
395
+ * @param equals - The function used to compare two values of type T for equality.
396
+ */
397
+ constructor(r, s) {
398
+ super(void 0, s);
399
+ /**
400
+ * @internal
401
+ */
402
+ l(this, "$__computed__", !0);
403
+ /**
404
+ * @internal
405
+ */
197
406
  l(this, "_isDirty", !1);
407
+ /**
408
+ * Marks the signal as dirty, indicating that its value has changed and needs to be recalculated.
409
+ * If the signal is already dirty or disposed, this method does nothing.
410
+ * It also marks all dependent signals as dirty and schedules a notification to update their values.
411
+ */
198
412
  l(this, "setDirty", () => {
199
- this._isDirty || this._disposed || (this._isDirty = !0, this._derivatives.forEach((r) => r.setDirty()), this.scheduleNotify());
413
+ this._isDirty || this._disposed || (this._isDirty = !0, this._derivatives.forEach((r) => r.setDirty()), this._scheduleNotify());
200
414
  });
415
+ /**
416
+ * @internal
417
+ */
201
418
  l(this, "_scheduleCount", 0);
202
- l(this, "scheduleNotify", () => {
419
+ /**
420
+ * Schedules a notification to be executed asynchronously.
421
+ * If the signal is dirty, it will be updated and notified.
422
+ * @internal
423
+ */
424
+ l(this, "_scheduleNotify", () => {
203
425
  const r = ++this._scheduleCount;
204
- je(() => {
426
+ Re(() => {
205
427
  this._scheduleCount !== r || this._disposed !== !1 || this._isDirty && (this._isDirty = !1, this._setAndNotify(this._fn(), !1));
206
428
  });
207
429
  });
@@ -209,154 +431,195 @@ class E extends (te = h, ee = Y, te) {
209
431
  l(this, "get", () => (this._isDirty && (this._isDirty = !1, this._value = this._fn(), this._setAndNotify(this._value, !0)), this._value));
210
432
  this._fn = r, this.setDirty();
211
433
  }
434
+ /**
435
+ * Checks if a value is an instance of `Computed`.
436
+ *
437
+ * @param value - The value to check.
438
+ * @returns `true` if the value is an instance of `Computed`, `false` otherwise.
439
+ */
212
440
  static is(r) {
213
- return r != null && r[Y] === !0;
441
+ return r != null && r.$__computed__ === !0;
214
442
  }
215
443
  /** {@inheritDoc Signal.value} */
216
444
  get value() {
217
445
  return this.get();
218
446
  }
219
447
  }
220
- var re, ne;
221
- class F extends (ne = h, re = Q, ne) {
448
+ const V = class V extends h {
222
449
  constructor() {
223
450
  super(...arguments);
224
- l(this, re, !0);
451
+ /**
452
+ * @internal
453
+ */
454
+ l(this, "$__prop__", !0);
455
+ /**
456
+ * Changes the value of the property and notifies its listeners.
457
+ *
458
+ * @param value - The new value of the property.
459
+ */
225
460
  l(this, "set", (r) => {
226
461
  this._setAndNotify(r, !1);
227
462
  });
463
+ /**
464
+ * Updates the value of the signal by applying the provided function to the current value.
465
+ * @param fn - The function to apply to the current value.
466
+ */
228
467
  l(this, "update", (r) => {
229
468
  this._setAndNotify(r(this.get()), !1);
230
469
  });
231
- l(this, "reducer", (r, ...n) => {
232
- const s = this;
233
- return function i(o) {
234
- const a = s.value;
235
- s.update((u) => r(u, o)), !s.equals(a, s.value) && n.forEach(
470
+ /**
471
+ * Creates a reducer function that combines the provided reducer function and effects.
472
+ * @param fn - The reducer function that takes the current state and an action, and returns the new state.
473
+ * @param effects - An array of effects to be executed after the state is updated.
474
+ * @returns A dispatch function that can be used to update the state and trigger the effects.
475
+ */
476
+ l(this, "reducer", (r, ...s) => {
477
+ const n = this;
478
+ return function o(i) {
479
+ const a = n.value;
480
+ n.update((u) => r(u, i)), !n.equals(a, n.value) && s.forEach(
236
481
  (u) => u({
237
482
  previousState: a,
238
- state: s.value,
239
- action: o,
240
- dispatch: i
483
+ state: n.value,
484
+ action: i,
485
+ dispatch: o
241
486
  })
242
487
  );
243
488
  };
244
489
  });
245
- l(this, "iso", (r, n, s = (i, o) => i === o) => {
246
- const i = new F(r(this.get()), s);
247
- return i.onDispose(this.on((o) => i.set(r(o)))), i.on((o) => this._setAndNotify(n(o), !1)), i;
490
+ /**
491
+ * Creates an isomorphism for the Signal.
492
+ * An isomorphism is a pair of functions that convert values between two types,
493
+ * along with an equality function to compare values of the second type.
494
+ *
495
+ * @param to - A function that converts values from type T to type O.
496
+ * @param from - A function that converts values from type O to type T.
497
+ * @param equals - An optional function that compares values of type O for equality.
498
+ * Defaults to a strict equality check (===).
499
+ * @returns A Prop object representing the isomorphism.
500
+ */
501
+ l(this, "iso", (r, s, n = (o, i) => o === i) => {
502
+ const o = new V(r(this.get()), n);
503
+ return o.onDispose(this.on((i) => o.set(r(i)))), o.on((i) => this._setAndNotify(s(i), !1)), o;
248
504
  });
505
+ /**
506
+ * Returns a `Prop` that represents the value at the specified key of the current value.
507
+ *
508
+ * @param key - The key of the value to access.
509
+ * @returns A `Prop` that represents the value at the specified key.
510
+ */
249
511
  l(this, "atProp", (r) => this.iso(
250
- (n) => n[r],
251
- (n) => ({ ...this.value, [r]: n })
512
+ (s) => s[r],
513
+ (s) => ({ ...this.value, [r]: s })
252
514
  ));
253
515
  }
254
- static is(r) {
255
- return r != null && r[Q] === !0;
256
- }
257
- /** {@inheritDoc Signal.get} */
516
+ /**
517
+ * Access for the current value of the property.
518
+ */
258
519
  get value() {
259
520
  return this.get();
260
521
  }
261
522
  set value(r) {
262
523
  this._setAndNotify(r, !1);
263
524
  }
264
- }
265
- function H(t, e, r = (n, s) => n === s) {
266
- const n = new E(t, r);
267
- return e.forEach((s) => s.setDerivative(n)), n;
268
- }
269
- function At(t, e) {
270
- return H(t, e).dispose;
271
- }
272
- function L(t, e = (r, n) => r === n) {
273
- return new F(t, e);
274
- }
275
- function Et(t, e = (r, n) => r === n) {
276
- return new h(t, e);
277
- }
278
- class se {
525
+ };
526
+ /**
527
+ * Checks if a value is a Prop.
528
+ * @param value - The value to check.
529
+ * @returns `true` if the value is a Prop, `false` otherwise.
530
+ */
531
+ l(V, "is", (r) => (
532
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
533
+ r != null && r.$__prop__ === !0
534
+ ));
535
+ let F = V;
536
+ const j = (t, e, r = (s, n) => s === n) => {
537
+ const s = new E(t, r);
538
+ return e.forEach((n) => n.setDerivative(s)), s;
539
+ }, pt = (t, e) => j(t, e).dispose, L = (t, e = (r, s) => r === s) => new F(t, e), mt = (t, e = (r, s) => r === s) => new h(t, e);
540
+ class z {
279
541
  constructor() {
280
542
  l(this, "_store", /* @__PURE__ */ new Map());
543
+ /**
544
+ * Retrieves the value associated with the specified key from the memory store.
545
+ * @param key - The key to retrieve the value for.
546
+ * @returns The value associated with the key, or `null` if the key is not found.
547
+ */
281
548
  l(this, "getItem", (e) => this._store.get(e) ?? null);
549
+ /**
550
+ * Sets the value associated with the specified key in the memory store.
551
+ * @param key - The key to set the value for.
552
+ * @param value - The value to set.
553
+ */
282
554
  l(this, "setItem", (e, r) => {
283
555
  this._store.set(e, r);
284
556
  });
285
557
  }
286
558
  }
287
- function ie({
559
+ const Q = ({
288
560
  key: t,
289
561
  defaultValue: e,
290
562
  store: r,
291
- serialize: n = JSON.stringify,
292
- deserialize: s = JSON.parse,
293
- equals: i = (a, u) => a === u,
294
- onLoad: o = (a) => a
295
- }) {
563
+ serialize: s = JSON.stringify,
564
+ deserialize: n = JSON.parse,
565
+ equals: o = (a, u) => a === u,
566
+ onLoad: i = (a) => a
567
+ }) => {
296
568
  const a = r.getItem(t), u = new F(
297
- a != null ? o(s(a)) : typeof e == "function" ? e() : e,
298
- i
569
+ a != null ? i(n(a)) : typeof e == "function" ? e() : e,
570
+ o
299
571
  );
300
- return u.on((f) => {
301
- r.setItem(t, n(f));
572
+ return u.on((c) => {
573
+ r.setItem(t, s(c));
302
574
  }), u;
303
- }
304
- function bt(t) {
305
- return ie({
306
- ...t,
307
- store: (window == null ? void 0 : window.localStorage) ?? new se()
308
- });
309
- }
310
- function Pt(t) {
311
- return ie({
312
- ...t,
313
- store: (window == null ? void 0 : window.sessionStorage) ?? new se()
314
- });
315
- }
316
- function Z(t) {
575
+ }, gt = (t) => Q({
576
+ ...t,
577
+ store: (window == null ? void 0 : window.localStorage) ?? new z()
578
+ }), _t = (t) => Q({
579
+ ...t,
580
+ store: (window == null ? void 0 : window.sessionStorage) ?? new z()
581
+ });
582
+ function X(t) {
317
583
  return typeof requestAnimationFrame == "function" ? requestAnimationFrame(t) : setTimeout(t, 0);
318
584
  }
319
- function Ge(t, e, r, n) {
320
- const s = (n == null ? void 0 : n.duration) ?? 300, i = (n == null ? void 0 : n.easing) ?? ((g) => g), o = (n == null ? void 0 : n.equals) ?? ((g, M) => g === M);
321
- let a = n == null ? void 0 : n.interpolate, u = t, f = e(), m = performance.now(), _ = null, d = !0;
322
- const P = new E(e, o), A = L(t, o);
585
+ const Me = (t, e, r, s) => {
586
+ const n = (s == null ? void 0 : s.duration) ?? 300, o = (s == null ? void 0 : s.easing) ?? ((_) => _), i = (s == null ? void 0 : s.equals) ?? ((_, k) => _ === k);
587
+ let a = s == null ? void 0 : s.interpolate, u = t, c = e(), g = performance.now(), S = null, p = !0;
588
+ const D = new E(e, i), A = L(t, i);
323
589
  A.onDispose(() => {
324
- _ !== null && cancelAnimationFrame(_);
325
- }), A.onDispose(P.dispose), r.forEach((g) => {
326
- g.setDerivative(P), g.onDispose(A.dispose);
590
+ S !== null && cancelAnimationFrame(S);
591
+ }), A.onDispose(D.dispose), r.forEach((_) => {
592
+ _.setDerivative(D), _.onDispose(A.dispose);
327
593
  });
328
- const Ce = (g) => {
329
- f = g, m = performance.now(), u = A.value, d && (d = !1, _ = Z(B));
330
- }, B = () => {
331
- const M = (performance.now() - m) / h.unwrap(s), Re = i(M);
332
- a == null && (a = Ve(u));
333
- let X = a(u, f, Re);
334
- M >= 1 ? (d = !0, X = f) : _ = Z(B), A.set(X);
594
+ const Ee = (_) => {
595
+ c = _, g = performance.now(), u = A.value, p && (p = !1, S = X(J));
596
+ }, J = () => {
597
+ const k = (performance.now() - g) / h.unwrap(n), Pe = o(k);
598
+ a == null && (a = Oe(u));
599
+ let K = a(u, c, Pe);
600
+ k >= 1 ? (p = !0, K = c) : S = X(J), A.set(K);
335
601
  };
336
- return P.on(Ce), A;
337
- }
338
- function Dt(t, e) {
339
- const { initialValue: r, ...n } = e ?? {};
340
- return Ge(
602
+ return D.on(Ee), A;
603
+ }, vt = (t, e) => {
604
+ const { initialValue: r, ...s } = e ?? {};
605
+ return Me(
341
606
  r ?? t.get(),
342
607
  t.get,
343
608
  [t],
344
- n
609
+ s
345
610
  );
346
- }
347
- function Tt(t, e) {
348
- const { signals: r, literals: n } = Object.entries(t).reduce(
349
- ({ signals: i, literals: o }, [a, u]) => (h.is(u) ? i.push([a, u]) : o[a] = u, { signals: i, literals: o }),
611
+ }, yt = (t, e) => {
612
+ const { signals: r, literals: s } = Object.entries(t).reduce(
613
+ ({ signals: o, literals: i }, [a, u]) => (h.is(u) ? o.push([a, u]) : i[a] = u, { signals: o, literals: i }),
350
614
  { signals: [], literals: {} }
351
- ), s = r.map(([, i]) => i);
352
- return H(() => (r.forEach(([i, o]) => n[i] = o.value), e(n)), s);
353
- }
354
- const oe = /* @__PURE__ */ new Set(["checked", "disabled", "hidden", "selected"]), ue = /* @__PURE__ */ new Set([
615
+ ), n = r.map(([, o]) => o);
616
+ return j(() => (r.forEach(([o, i]) => s[o] = i.value), e(s)), n);
617
+ }, Y = /* @__PURE__ */ new Set(["checked", "disabled", "hidden", "selected"]), Z = /* @__PURE__ */ new Set([
355
618
  "rowSpan",
356
619
  "colSpan",
357
620
  "tabIndex",
358
621
  "valueAsNumber"
359
- ]), le = /* @__PURE__ */ new Set(["valueAsDate"]), ae = /* @__PURE__ */ new Set([
622
+ ]), x = /* @__PURE__ */ new Set(["valueAsDate"]), ee = /* @__PURE__ */ new Set([
360
623
  "value",
361
624
  "textContent",
362
625
  "innerText",
@@ -364,46 +627,24 @@ const oe = /* @__PURE__ */ new Set(["checked", "disabled", "hidden", "selected"]
364
627
  "outerHTML",
365
628
  "className",
366
629
  "classList"
367
- ]), U = /* @__PURE__ */ new Map();
368
- function D(t, e) {
369
- if (U.has(t))
370
- return U.get(t);
630
+ ]), q = /* @__PURE__ */ new Map(), b = (t, e) => {
631
+ if (q.has(t))
632
+ return q.get(t);
371
633
  {
372
634
  const r = e(t);
373
- return U.set(t, r), r;
635
+ return q.set(t, r), r;
374
636
  }
375
- }
376
- function He(t) {
377
- return (e, r) => {
378
- r == null ? e[t] = null : e[t] = !!r;
379
- };
380
- }
381
- function Je(t) {
382
- return (e, r) => {
383
- r == null ? e[t] = null : e[t] = Number(r);
384
- };
385
- }
386
- function We(t) {
387
- return (e, r) => {
388
- r == null ? e[t] = null : e[t] = r;
389
- };
390
- }
391
- function Be(t) {
392
- return (e, r) => {
393
- r == null ? e[t] = null : e[t] = String(r);
394
- };
395
- }
396
- function Xe(t) {
397
- return (e, r) => {
398
- r == null ? e.removeAttribute(t) : e.setAttribute(t, r);
399
- };
400
- }
401
- function ce(t) {
402
- return oe.has(t) ? D(t, He) : ue.has(t) ? D(t, Je) : le.has(t) ? D(t, We) : ae.has(t) ? D(t, Be) : D(t, Xe);
403
- }
404
- function fe(t) {
405
- return (e) => oe.has(t) ? !!e[t] : ue.has(t) ? Number(e[t]) : le.has(t) ? e[t] : ae.has(t) ? String(e[t]) : e.getAttribute(t);
406
- }
637
+ }, Fe = (t) => (e, r) => {
638
+ r == null ? e[t] = null : e[t] = !!r;
639
+ }, Ve = (t) => (e, r) => {
640
+ r == null ? e[t] = null : e[t] = Number(r);
641
+ }, $e = (t) => (e, r) => {
642
+ r == null ? e[t] = null : e[t] = r;
643
+ }, qe = (t) => (e, r) => {
644
+ r == null ? e[t] = null : e[t] = String(r);
645
+ }, Ie = (t) => (e, r) => {
646
+ r == null ? e.removeAttribute(t) : e.setAttribute(t, r);
647
+ }, te = (t) => Y.has(t) ? b(t, Fe) : Z.has(t) ? b(t, Ve) : x.has(t) ? b(t, $e) : ee.has(t) ? b(t, qe) : b(t, Ie), re = (t) => (e) => Y.has(t) ? !!e[t] : Z.has(t) ? Number(e[t]) : x.has(t) ? e[t] : ee.has(t) ? String(e[t]) : e.getAttribute(t);
407
648
  class v {
408
649
  /**
409
650
  * Constructs a new `DOMContext` instance.
@@ -414,7 +655,7 @@ class v {
414
655
  * @param providers - The `Providers` instance associated with this context.
415
656
  * @param isFirstLevel - A boolean value indicating whether this context is at the first level, meaning the outermost node in the generated DOM.
416
657
  */
417
- constructor(e, r, n, s, i) {
658
+ constructor(e, r, s, n, o) {
418
659
  /**
419
660
  * Creates a new DOM element (eg: HTML or SVG) with the specified tag name and namespace.
420
661
  *
@@ -521,14 +762,14 @@ class v {
521
762
  *
522
763
  * @param mark - The provider mark to retrieve the provider for.
523
764
  * @returns The provider for the given mark.
524
- * @throws Error If the provider for the given mark is not found.
765
+ * @throws Throws `ProviderNotFoundError` if the provider for the given mark is not found.
525
766
  */
526
767
  l(this, "getProvider", (e) => {
527
768
  if (this.providers[e] === void 0)
528
- throw new Error(`Provider not found: ${e.description}`);
769
+ throw new Be(e);
529
770
  return this.providers[e];
530
771
  });
531
- this.document = e, this.element = r, this.reference = n, this.providers = s, this.isFirstLevel = i;
772
+ this.document = e, this.element = r, this.reference = s, this.providers = n, this.isFirstLevel = o;
532
773
  }
533
774
  /**
534
775
  * Creates a new `DOMContext` instance for the given `Element` and optional reference `Node`.
@@ -541,100 +782,101 @@ class v {
541
782
  return new v(e.ownerDocument, e, r, {}, !0);
542
783
  }
543
784
  }
544
- function p(t) {
785
+ class Be extends Error {
786
+ constructor(e) {
787
+ super(`Provider not found: ${e.description}`);
788
+ }
789
+ }
790
+ const m = (t) => {
545
791
  const e = t;
546
792
  e && e.onblur && (e.onblur = null), !(!t || t.ownerDocument === void 0) && t.parentElement && t.parentElement.removeChild(t);
547
- }
548
- function ze(t) {
549
- return he(t) ? t : t.parentElement;
550
- }
551
- function he(t) {
552
- return t.nodeType === 1;
553
- }
554
- function Ke(t, e, r) {
555
- let n = t.target;
556
- for (; n != null && !(n instanceof HTMLAnchorElement); )
557
- n = n.parentElement;
558
- if (n == null) return !0;
559
- const s = n;
560
- if (t.button !== 0 || t.ctrlKey || t.metaKey || s.target !== "_self" && s.target !== "" || s.getAttribute("download") != null)
793
+ }, je = (t) => se(t) ? t : t.parentElement, se = (t) => t.nodeType === 1;
794
+ function Ue(t, e, r) {
795
+ let s = t.target;
796
+ for (; s != null && !(s instanceof HTMLAnchorElement); )
797
+ s = s.parentElement;
798
+ if (s == null) return !0;
799
+ const n = s;
800
+ if (t.button !== 0 || t.ctrlKey || t.metaKey || n.target !== "_self" && n.target !== "" || n.getAttribute("download") != null)
561
801
  return !0;
562
802
  if (r) {
563
- const { pathname: i, search: o, hash: a } = s, u = i + o + a;
564
- if (s.getAttribute("href") !== u || e && !/\/[^/.]*$/.test(i))
803
+ const { pathname: o, search: i, hash: a } = n, u = o + i + a;
804
+ if (n.getAttribute("href") !== u || e === !0 && !/\/[^/.]*$/.test(o) || Array.isArray(e) && !e.some((c) => o.endsWith(c)))
565
805
  return !0;
566
806
  }
567
807
  return !1;
568
808
  }
569
- const Lt = (t, e = {
570
- checkExtension: !0,
571
- checkExternalUrl: !0
572
- }) => (r) => {
573
- const { checkExtension: n, checkExternalUrl: s } = e;
574
- Ke(
575
- r,
576
- n === !0,
577
- s === !0
578
- ) || t() && r.preventDefault();
579
- }, de = (t) => (e) => {
580
- _e(e);
809
+ const wt = (t, {
810
+ checkExtension: e = [".html"],
811
+ checkExternalUrl: r = !0
812
+ } = {}) => (s) => {
813
+ Ue(s, e, r) || t() && s.preventDefault();
814
+ }, ne = (t) => (e) => {
815
+ he(e);
581
816
  const r = e.createText(t);
582
- return e.appendOrInsert(r), (n) => {
583
- n && p(r);
817
+ return e.appendOrInsert(r), (s) => {
818
+ s && m(r);
584
819
  };
585
- }, pe = (t) => (e) => {
586
- _e(e);
820
+ }, oe = (t) => (e) => {
821
+ he(e);
587
822
  const r = e.createText(t.value);
588
823
  e.appendOrInsert(r);
589
- const n = t.on((s) => r.data = s);
590
- return (s) => {
591
- n(), s && p(r);
592
- };
593
- };
594
- function kt(t) {
595
- return h.is(t) ? pe(t) : de(t);
596
- }
597
- const y = (...t) => (e) => {
598
- const r = t.map((n) => c(n)(e));
824
+ const s = t.on((n) => r.data = n);
599
825
  return (n) => {
600
- r.forEach((s) => s(n));
826
+ s(), n && m(r);
827
+ };
828
+ }, St = (t) => h.is(t) ? oe(t) : ne(t), y = (...t) => (e) => {
829
+ const r = t.map((s) => f(s)(e));
830
+ return (s) => {
831
+ r.forEach((n) => n(s));
601
832
  };
602
- }, S = () => () => {
603
- }, Qe = (t) => (e) => (Se(e), e.element.classList.add(...t), (r) => {
833
+ }, w = () => () => {
834
+ }, We = (t) => (e) => (ce(e), e.element.classList.add(...t), (r) => {
604
835
  r && e.element.classList.remove(...t);
605
- }), Ye = (t) => (e) => {
606
- Se(e);
836
+ }), Ge = (t) => (e) => {
837
+ ce(e);
607
838
  const r = e.element;
608
- let n = [];
609
- const s = t.on((i) => {
610
- n.forEach((o) => r.classList.remove(o)), n = (i ?? "").split(" ").filter((o) => o.length > 0), r.classList.add(...n);
839
+ let s = [];
840
+ const n = t.on((o) => {
841
+ s.forEach((i) => r.classList.remove(i)), s = (o ?? "").split(" ").filter((i) => i.length > 0), r.classList.add(...s);
611
842
  });
612
- return (i) => {
613
- s(), i && n.forEach((o) => r.classList.remove(o)), n.length = 0;
843
+ return (o) => {
844
+ n(), o && s.forEach((i) => r.classList.remove(i)), s.length = 0;
614
845
  };
615
846
  }, N = (t, e) => {
616
- const r = ce(t), n = fe(t);
617
- return (s) => {
618
- ye(s, t);
619
- const i = n(s.element);
620
- return r(s.element, e), (o) => {
621
- o && r(s.element, i);
847
+ const r = te(t), s = re(t);
848
+ return (n) => {
849
+ ae(n, t);
850
+ const o = s(n.element);
851
+ return r(n.element, e), (i) => {
852
+ i && r(n.element, o);
622
853
  };
623
854
  };
624
855
  }, C = (t, e) => {
625
- const r = ce(t), n = fe(t);
626
- return (s) => {
627
- ye(s, t);
628
- const i = n(s.element);
629
- return e.on((o) => r(s.element, o)), (o) => {
630
- o && r(s.element, i);
856
+ const r = te(t), s = re(t);
857
+ return (n) => {
858
+ ae(n, t);
859
+ const o = s(n.element), i = e.on((a) => r(n.element, a));
860
+ return (a) => {
861
+ i(), a && r(n.element, o);
631
862
  };
632
863
  };
633
- }, b = new Proxy(
864
+ }, P = new Proxy(
634
865
  {},
635
866
  {
636
- get: (t, e) => e === "class" ? (r) => h.is(r) ? Ye(r) : Qe(
637
- (r ?? "").split(" ").filter((n) => n.length > 0)
867
+ /**
868
+ * Creates a renderable component for the specified attribute.
869
+ *
870
+ * Generally using multiple attributes with the same name is not recommended.
871
+ * `class` is the exception and can be used multiple times.
872
+ *
873
+ * @param _ - The target object.
874
+ * @param name - The name of the attribute.
875
+ * @returns The renderable component for the specified attribute.
876
+ *
877
+ */
878
+ get: (t, e) => e === "class" ? (r) => h.is(r) ? Ge(r) : We(
879
+ (r ?? "").split(" ").filter((s) => s.length > 0)
638
880
  ) : (r) => h.is(r) ? C(
639
881
  e,
640
882
  r
@@ -643,17 +885,33 @@ const y = (...t) => (e) => {
643
885
  r
644
886
  )
645
887
  }
646
- ), Nt = new Proxy(
888
+ ), At = new Proxy(
647
889
  {},
648
890
  {
891
+ /**
892
+ * Creates a renderable component for the specified `data-?` attribute.
893
+ *
894
+ * @param _ - The target object.
895
+ * @param name - The name of the data attribute.
896
+ * @returns The renderable component for the specified attribute.
897
+ *
898
+ */
649
899
  get: (t, e) => (r) => h.is(r) ? C(
650
900
  `data-${e}`,
651
901
  r
652
902
  ) : N(`data-${e}`, r)
653
903
  }
654
- ), Ct = new Proxy(
904
+ ), Et = new Proxy(
655
905
  {},
656
906
  {
907
+ /**
908
+ * Creates a renderable component for the specified `aria-?` attribute.
909
+ *
910
+ * @param _ - The target object.
911
+ * @param name - The name of the aria attribute.
912
+ * @returns The renderable component for the specified attribute.
913
+ *
914
+ */
657
915
  get: (t, e) => (r) => h.is(r) ? C(
658
916
  `aria-${e}`,
659
917
  r
@@ -662,9 +920,17 @@ const y = (...t) => (e) => {
662
920
  r
663
921
  )
664
922
  }
665
- ), Rt = new Proxy(
923
+ ), Pt = new Proxy(
666
924
  {},
667
925
  {
926
+ /**
927
+ * Creates a renderable component for the specified `svg` attribute.
928
+ *
929
+ * @param _ - The target object.
930
+ * @param name - The name of the SVG attribute.
931
+ * @returns The renderable component for the specified attribute.
932
+ *
933
+ */
668
934
  get: (t, e) => (r) => h.is(r) ? C(
669
935
  e,
670
936
  r
@@ -673,9 +939,16 @@ const y = (...t) => (e) => {
673
939
  r
674
940
  )
675
941
  }
676
- ), Mt = new Proxy(
942
+ ), Dt = new Proxy(
677
943
  {},
678
944
  {
945
+ /**
946
+ * Creates a renderable component for the specified `math` attribute.
947
+ *
948
+ * @param name - The name of the Math attribute.
949
+ * @returns The renderable component for the specified attribute.
950
+ *
951
+ */
679
952
  get: (t, e) => (r) => h.is(r) ? C(
680
953
  e,
681
954
  r
@@ -684,173 +957,160 @@ const y = (...t) => (e) => {
684
957
  r
685
958
  )
686
959
  }
687
- );
688
- function c(t) {
689
- return t == null ? S : Array.isArray(t) ? y(...t.map(c)) : typeof t == "string" ? de(t) : h.is(t) ? pe(t) : t;
690
- }
691
- function me(t, ...e) {
692
- return (r) => {
693
- const n = r.createElement(t, void 0);
694
- r.isFirstLevel && R.isSSR() && we(n), r.appendOrInsert(n), r = r.withElement(n);
695
- const s = e.map((i) => c(i)(r));
696
- return (i) => {
697
- s.forEach((o) => o(!1)), i && p(n);
698
- };
960
+ ), f = (t) => t == null ? w : Array.isArray(t) ? y(...t.map(f)) : typeof t == "string" ? ne(t) : h.is(t) ? oe(t) : t, ie = (t, ...e) => (r) => {
961
+ const s = r.createElement(t, void 0);
962
+ r.isFirstLevel && O() && fe(s), r.appendOrInsert(s), r = r.withElement(s);
963
+ const n = e.map((o) => f(o)(r));
964
+ return (o) => {
965
+ n.forEach((i) => i(!1)), o && m(s);
699
966
  };
700
- }
701
- function ge(t, e, ...r) {
702
- return (n) => {
703
- const s = n.createElement(t, e);
704
- n.isFirstLevel && R.isSSR() && we(s), n.appendOrInsert(s), n = n.withElement(s);
705
- const i = r.map((o) => c(o)(n));
706
- return (o) => {
707
- i.forEach((a) => a(!1)), o && p(s);
708
- };
967
+ }, le = (t, e, ...r) => (s) => {
968
+ const n = s.createElement(t, e);
969
+ s.isFirstLevel && O() && fe(n), s.appendOrInsert(n), s = s.withElement(n);
970
+ const o = r.map((i) => f(i)(s));
971
+ return (i) => {
972
+ o.forEach((a) => a(!1)), i && m(n);
709
973
  };
710
- }
711
- const Ot = new Proxy(
974
+ }, bt = new Proxy(
712
975
  {},
713
976
  {
714
- get: (t, e) => (...r) => me(e, r.flatMap(c))
977
+ /**
978
+ * Creates a renderable that represents an HTML element.
979
+ * @param tagName - The HTML tag name.
980
+ * @returns A renderable function that creates and appends the HTML element to the DOM.
981
+ */
982
+ get: (t, e) => (...r) => ie(e, r.flatMap(f))
715
983
  }
716
- ), It = new Proxy(
984
+ ), Tt = new Proxy(
717
985
  {},
718
986
  {
719
- get: (t, e) => (...r) => me("input", b.type(e), ...r)
987
+ /**
988
+ * Creates a renderable that represents an HTMLInput element.
989
+ * @param type - The input type name.
990
+ * @returns A renderable function that creates and appends the HTMLInput element to the DOM.
991
+ */
992
+ get: (t, e) => (...r) => ie("input", P.type(e), ...r)
720
993
  }
721
- ), Ze = "http://www.w3.org/2000/svg", $t = new Proxy(
994
+ ), He = "http://www.w3.org/2000/svg", Lt = new Proxy(
722
995
  {},
723
996
  {
724
- get: (t, e) => (...r) => ge(e, Ze, r.flatMap(c))
997
+ /**
998
+ * Creates a renderable that represents an SVG element.
999
+ * @param tagName - The SVG tag name.
1000
+ * @returns A renderable function that creates and appends the SVG element to the DOM.
1001
+ */
1002
+ get: (t, e) => (...r) => le(e, He, r.flatMap(f))
725
1003
  }
726
- ), xe = "http://www.w3.org/1998/Math/MathML", Ft = new Proxy(
1004
+ ), Je = "http://www.w3.org/1998/Math/MathML", Nt = new Proxy(
727
1005
  {},
728
1006
  {
729
- get: (t, e) => (...r) => ge(e, xe, r.flatMap(c))
1007
+ /**
1008
+ * Creates a renderable that represents an Math element.
1009
+ * @param tagName - The Math tag name.
1010
+ * @returns A renderable function that creates and appends the Math element to the DOM.
1011
+ */
1012
+ get: (t, e) => (...r) => le(e, Je, r.flatMap(f))
730
1013
  }
731
- ), T = "data-tempo-attr", I = "data-tempo-class", ve = "data-tempo-node", $ = "data-tempo-text";
732
- function et(t, e) {
1014
+ ), T = "data-tempo-attr", R = "data-tempo-class", ue = "data-tempo-node", M = "data-tempo-text", Ke = (t, e) => {
733
1015
  const r = t.getAttribute(e);
734
1016
  if (r != null) {
735
- const n = t.getAttribute(T) ?? "{}", s = { ...JSON.parse(n), name: r };
736
- t.setAttribute(T, JSON.stringify(s));
1017
+ const s = t.getAttribute(T) ?? "{}", n = { ...JSON.parse(s), name: r };
1018
+ t.setAttribute(
1019
+ T,
1020
+ JSON.stringify(n).replace(/"/g, "&quot;")
1021
+ );
737
1022
  }
738
- }
739
- function ye(t, e) {
740
- R.isSSR() && t.isFirstLevel && et(t.element, e);
741
- }
742
- function tt(t) {
1023
+ }, ae = (t, e) => {
1024
+ O() && t.isFirstLevel && Ke(t.element, e);
1025
+ }, Xe = (t) => {
743
1026
  t.querySelectorAll(`[${T}]`).forEach((e) => {
744
- const r = JSON.parse(e.getAttribute(T) ?? "{}");
745
- for (const [n, s] of Object.entries(r))
746
- e.setAttribute(n, s);
1027
+ const r = JSON.parse(
1028
+ (e.getAttribute(T) ?? "{}").replace(/&quot;/g, '"')
1029
+ );
1030
+ for (const [s, n] of Object.entries(r))
1031
+ e.setAttribute(s, n);
747
1032
  e.removeAttribute(T);
748
1033
  });
749
- }
750
- function rt(t) {
751
- t.setAttribute(I, t.className);
752
- }
753
- function Se(t) {
754
- R.isSSR() && t.isFirstLevel && rt(t.element);
755
- }
756
- function nt(t) {
757
- t.querySelectorAll(`[${I}]`).forEach((e) => {
758
- const r = e.getAttribute(I);
759
- r !== null && (e.className = r, e.removeAttribute(I));
1034
+ };
1035
+ function ze(t) {
1036
+ t.setAttribute(R, t.className);
1037
+ }
1038
+ const ce = (t) => {
1039
+ O() && t.isFirstLevel && ze(t.element);
1040
+ }, Qe = (t) => {
1041
+ t.querySelectorAll(`[${R}]`).forEach((e) => {
1042
+ const r = e.getAttribute(R);
1043
+ r !== null && (e.className = r, e.removeAttribute(R));
760
1044
  });
761
- }
762
- function we(t) {
763
- t.setAttribute(ve, "");
764
- }
765
- function st(t) {
766
- t.querySelectorAll(`[${ve}]`).forEach((e) => {
767
- p(e);
1045
+ }, fe = (t) => {
1046
+ t.setAttribute(ue, "");
1047
+ }, Ye = (t) => {
1048
+ t.querySelectorAll(`[${ue}]`).forEach((e) => {
1049
+ m(e);
768
1050
  });
769
- }
770
- function it(t) {
771
- t.setAttribute($, t.textContent ?? "");
772
- }
773
- function _e(t) {
774
- R.isSSR() && t.isFirstLevel && it(t.element);
775
- }
776
- function ot(t) {
777
- t.querySelectorAll(`[${$}]`).forEach((e) => {
778
- e.textContent = e.getAttribute($), e.removeAttribute($);
1051
+ }, Ze = (t) => {
1052
+ t.setAttribute(M, t.textContent ?? "");
1053
+ }, he = (t) => {
1054
+ O() && t.isFirstLevel && Ze(t.element);
1055
+ }, xe = (t) => {
1056
+ t.querySelectorAll(`[${M}]`).forEach((e) => {
1057
+ e.textContent = e.getAttribute(M), e.removeAttribute(M);
779
1058
  });
780
- }
781
- function ut(t) {
782
- st(t), nt(t), tt(t), ot(t);
783
- }
784
- function Ae() {
1059
+ }, et = (t) => {
1060
+ Ye(t), Qe(t), Xe(t), xe(t);
1061
+ }, de = () => {
785
1062
  const t = globalThis;
786
1063
  return t.__tempoSSR__ == null && (t.__tempoSSR__ = {
787
1064
  isSSR: !1,
788
1065
  counter: 0
789
1066
  }), t.__tempoSSR__;
790
- }
791
- function J(t, e) {
792
- const r = Ae();
1067
+ }, U = (t, e) => {
1068
+ const r = de();
793
1069
  r[t] = e;
794
- }
795
- function Ee(t) {
796
- return Ae()[t];
797
- }
798
- function lt() {
799
- return Ee("isSSR");
800
- }
801
- function j(t) {
802
- J("isSSR", t);
803
- }
804
- function W() {
805
- return Ee("counter");
806
- }
807
- function at() {
808
- J("counter", (W() ?? 0) + 1);
809
- }
810
- function ct() {
811
- J("counter", (W() ?? 0) - 1);
812
- }
813
- const qt = (t = 30) => (j(!0), new Promise((e, r) => {
814
- let n;
815
- const s = setInterval(() => {
816
- W() <= 0 && (clearInterval(s), clearTimeout(n), j(!1), e());
1070
+ }, pe = (t) => de()[t], I = (t) => {
1071
+ U("isSSR", t);
1072
+ }, W = () => pe("counter"), tt = () => {
1073
+ U("counter", (W() ?? 0) + 1);
1074
+ }, rt = () => {
1075
+ U("counter", (W() ?? 0) - 1);
1076
+ }, Ct = (t = 30) => (I(!0), new Promise((e, r) => {
1077
+ let s;
1078
+ const n = setInterval(() => {
1079
+ W() <= 0 && (clearInterval(n), clearTimeout(s), I(!1), e());
817
1080
  }, 30);
818
- n = setTimeout(() => {
819
- clearInterval(s), j(!1), r(new Error("SSR Timeout"));
1081
+ s = setTimeout(() => {
1082
+ clearInterval(n), I(!1), r(new Error("SSR Timeout"));
820
1083
  }, t * 1e3);
821
- })), R = {
822
- useDone: (t) => (at(), c(t(ct))),
823
- isSSR: lt
824
- }, be = (t, e) => {
1084
+ })), Ot = (t) => (tt(), f(t(rt))), O = () => pe("isSSR"), me = (t, e) => {
825
1085
  if (typeof e == "function")
826
- return be(t, { then: e });
827
- const r = e.pending != null ? c(e.pending) : S, n = e.then, s = e.error != null ? (i) => c(e.error(i)) : () => S;
828
- return (i) => {
829
- let o = !0;
1086
+ return me(t, { then: e });
1087
+ const r = e.pending != null ? f(e.pending) : w, s = e.then, n = e.error != null ? (o) => f(e.error(o)) : () => w;
1088
+ return (o) => {
1089
+ let i = !0;
830
1090
  const a = t();
831
- i = i.makeRef();
832
- let u = c(r)(i);
1091
+ o = o.makeRef();
1092
+ let u = f(r)(o);
833
1093
  return a.then(
834
- (f) => {
835
- o && (u(!0), u = c(n(f))(i));
1094
+ (c) => {
1095
+ i && (u(!0), u = f(s(c))(o));
836
1096
  },
837
- (f) => {
838
- o && (u(!0), u = c(s(f))(i));
1097
+ (c) => {
1098
+ i && (u(!0), u = f(n(c))(o));
839
1099
  }
840
- ), (f) => {
841
- o = !1, u(f), f && i.reference && p(i.reference);
1100
+ ), (c) => {
1101
+ i = !1, u(c), c && o.reference && m(o.reference);
842
1102
  };
843
1103
  };
844
- }, Vt = (t, e) => be(() => t, e), Pe = (t, e) => (r) => (r.element.addEventListener(t, e), (n) => {
845
- n && r.element.removeEventListener(t, e);
846
- }), ft = (t) => Pe("click", (e) => {
1104
+ }, kt = (t, e) => me(() => t, e), ge = (t, e) => (r) => (r.element.addEventListener(t, e), (s) => {
1105
+ s && r.element.removeEventListener(t, e);
1106
+ }), st = (t) => ge("click", (e) => {
847
1107
  e.preventDefault();
848
1108
  const r = e.target;
849
1109
  setTimeout(() => {
850
- const n = r.ownerDocument != null ? r == null ? void 0 : r.checked : void 0;
851
- n != null && t(!n);
1110
+ const s = r.ownerDocument != null ? r == null ? void 0 : r.checked : void 0;
1111
+ s != null && t(!s);
852
1112
  }, 0);
853
- }), q = new Proxy(
1113
+ }), $ = new Proxy(
854
1114
  {},
855
1115
  {
856
1116
  /**
@@ -858,369 +1118,349 @@ const qt = (t = 30) => (j(!0), new Promise((e, r) => {
858
1118
  * @param fn - The function to call when the event is triggered.
859
1119
  * @returns A `Renderable` function that adds the event listener to the element.
860
1120
  */
861
- get: (t, e) => (r) => Pe(e, r)
1121
+ get: (t, e) => (r) => ge(e, r)
862
1122
  }
863
- ), V = {
864
- value: (t) => (e) => {
865
- const r = e.target;
866
- t(r.value);
867
- },
868
- valueAsNumber: (t) => (e) => {
869
- const r = e.target;
870
- t(r.valueAsNumber);
871
- },
872
- valueAsDate: (t) => (e) => {
873
- const r = e.target;
874
- if (r.value === "")
875
- return;
876
- const n = r.value.split("-"), s = new Date(
877
- Number(n[0]),
878
- Number(n[1]) - 1,
879
- Number(n[2].substring(0, 2))
880
- );
881
- t(s);
882
- },
883
- valueAsDateTime: (t) => (e) => {
884
- const r = e.target;
885
- if (r.value === "")
886
- return;
887
- const n = r.value.split("T"), s = n[0].split("-"), i = new Date(
888
- Number(s[0]),
889
- Number(s[1]) - 1,
890
- Number(s[2])
891
- ), o = n[1].split(":");
892
- i.setHours(Number(o[0])), i.setMinutes(Number(o[1])), i.setSeconds(Number(o[2])), t(i);
893
- },
894
- checked: (t) => (e) => {
895
- const r = e.target;
896
- t(r.checked);
897
- },
898
- preventDefault: (t) => (e) => {
899
- e.preventDefault(), t();
900
- },
901
- stopPropagation: (t) => (e) => {
902
- e.stopPropagation(), t();
903
- },
904
- stopImmediatePropagation: (t) => (e) => {
905
- e.stopImmediatePropagation(), t();
906
- }
907
- };
908
- function ht(t, e = "input") {
909
- return y(
910
- b.valueAsDate(t),
911
- q[e](V.valueAsDate(t.set))
912
- );
913
- }
914
- function dt(t, e = "input") {
915
- return y(
916
- b.valueAsDate(t),
917
- q[e](V.valueAsDateTime(t.set))
918
- );
919
- }
920
- function pt(t, e = "input") {
921
- return y(
922
- b.valueAsNumber(t),
923
- q[e](V.valueAsNumber(t.set))
1123
+ ), nt = (t) => (e) => {
1124
+ const r = e.target;
1125
+ t(r.value);
1126
+ }, ot = (t) => (e) => {
1127
+ const r = e.target;
1128
+ t(r.valueAsNumber);
1129
+ }, it = (t) => (e) => {
1130
+ const r = e.target;
1131
+ if (r.value === "")
1132
+ return;
1133
+ const s = r.value.split("-"), n = new Date(
1134
+ Number(s[0]),
1135
+ Number(s[1]) - 1,
1136
+ Number(s[2].substring(0, 2))
924
1137
  );
925
- }
926
- function mt(t, e = "input") {
927
- return y(b.value(t), q[e](V.value(t.set)));
928
- }
929
- function gt(t) {
930
- return y(b.checked(t), ft(t.set));
931
- }
932
- const Ut = {
933
- date: ht,
934
- dateTime: dt,
935
- number: pt,
936
- text: mt,
937
- checked: gt
938
- }, O = (t, e) => (r) => {
1138
+ t(n);
1139
+ }, lt = (t) => (e) => {
1140
+ const r = e.target;
1141
+ if (r.value === "")
1142
+ return;
1143
+ const s = r.value.split("T"), n = s[0].split("-"), o = new Date(
1144
+ Number(n[0]),
1145
+ Number(n[1]) - 1,
1146
+ Number(n[2])
1147
+ ), i = s[1].split(":");
1148
+ o.setHours(Number(i[0])), o.setMinutes(Number(i[1])), o.setSeconds(Number(i[2])), t(o);
1149
+ }, Rt = (t) => (e) => {
1150
+ const r = e.target;
1151
+ t(r.checked);
1152
+ }, Mt = (t) => (e) => {
1153
+ e.preventDefault(), t();
1154
+ }, Ft = (t) => (e) => {
1155
+ e.stopPropagation(), t();
1156
+ }, Vt = (t) => (e) => {
1157
+ e.stopImmediatePropagation(), t();
1158
+ }, $t = (t, e = "input") => y(
1159
+ P.valueAsDate(t),
1160
+ $[e](it(t.set))
1161
+ ), qt = (t, e = "input") => y(
1162
+ P.valueAsDate(t),
1163
+ $[e](lt(t.set))
1164
+ ), It = (t, e = "input") => y(
1165
+ P.valueAsNumber(t),
1166
+ $[e](ot(t.set))
1167
+ ), Bt = (t, e = "input") => y(P.value(t), $[e](nt(t.set))), jt = (t) => y(P.checked(t), st(t.set)), G = (t, e) => (r) => {
939
1168
  r = r.makeRef();
940
- let n, s;
941
- const i = t.map((u) => Object.keys(u)[0]);
942
- let o;
943
- const a = i.on((u) => {
944
- if (u !== o) {
945
- s == null || s.dispose(), n == null || n(!0), s = t.map((m) => m[u]);
946
- const f = e[u](s);
947
- n = c(f)(r), o = u;
1169
+ let s, n;
1170
+ const o = t.map((u) => Object.keys(u)[0]);
1171
+ let i;
1172
+ const a = o.on((u) => {
1173
+ if (u !== i) {
1174
+ n == null || n.dispose(), s == null || s(!0), n = t.map((g) => g[u]);
1175
+ const c = e[u](n);
1176
+ s = f(c)(r), i = u;
948
1177
  }
949
1178
  });
950
1179
  return (u) => {
951
- a(), u && r.reference != null && p(r.reference), n == null || n(!0);
1180
+ a(), u && r.reference != null && m(r.reference), s == null || s(!0);
952
1181
  };
953
- }, k = {
954
- bool: (t, e) => O(
955
- t.map((r) => r ? { true: !0 } : { false: !0 }),
956
- e
957
- ),
958
- field: (t, e, r) => O(
959
- t.map((n) => ({ [n[e]]: n })),
960
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
961
- r
962
- ),
963
- kind: (t, e) => k.field(t, "kind", e),
964
- tuple: (t, e) => {
965
- const r = t.map(([n, s]) => ({ [n]: s }));
966
- return O(r, e);
967
- },
968
- type: (t, e) => k.field(t, "type", e),
969
- value: (t, e) => O(
970
- t.map((r) => ({ [r]: !0 })),
971
- e
972
- )
973
- }, jt = (t, e) => (r) => {
974
- const n = (e == null ? void 0 : e.firstSeparator) ?? S, s = (e == null ? void 0 : e.lastSeparator) ?? S;
975
- return k.value(
976
- r.map((i) => i.isFirst ? "first" : i.isLast ? "last" : "other"),
1182
+ }, _e = (t, e, r) => G(
1183
+ t.map((s) => ({ [s[e]]: s })),
1184
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1185
+ r
1186
+ ), Ut = (t, e) => _e(t, "kind", e), Wt = (t, e) => {
1187
+ const r = t.map(([s, n]) => ({ [s]: n }));
1188
+ return G(r, e);
1189
+ }, Gt = (t, e) => _e(t, "type", e), H = (t, e) => G(
1190
+ t.map((r) => ({ [r]: !0 })),
1191
+ e
1192
+ ), Ht = (t, e = {}) => (r) => {
1193
+ const s = (e == null ? void 0 : e.firstSeparator) ?? w, n = (e == null ? void 0 : e.lastSeparator) ?? w;
1194
+ return H(
1195
+ r.map((o) => o.isFirst ? "first" : o.isLast ? "last" : "other"),
977
1196
  {
978
- first: () => n,
979
- last: () => s,
1197
+ first: () => s,
1198
+ last: () => n,
980
1199
  other: () => t
981
1200
  }
982
1201
  );
983
- }, De = (t, e) => (r) => {
984
- const n = Object.values(t).reduce((s, i) => {
985
- const o = r.getProvider(i);
986
- if (o == null)
987
- throw new Error(`No provider found for mark: ${i.description}`);
988
- return s[i] = o, s;
1202
+ }, ve = (t, e) => (r) => {
1203
+ const s = Object.values(t).reduce((n, o) => {
1204
+ const i = r.getProvider(o);
1205
+ if (i == null)
1206
+ throw new Error(`No provider found for mark: ${o.description}`);
1207
+ return n[o] = i, n;
989
1208
  }, {});
990
- return c(e(n))(r);
991
- }, Gt = (t, e) => (r) => {
992
- const n = [], s = Object.entries(t).reduce(
993
- (i, [o, a]) => (n.push(
994
- a((u) => (Reflect.set(i, o, u), null))(r)
995
- ), i),
1209
+ return f(e(s))(r);
1210
+ }, Jt = (t, e) => (r) => {
1211
+ const s = [], n = Object.entries(t).reduce(
1212
+ (o, [i, a]) => (s.push(
1213
+ a((u) => (Reflect.set(o, i, u), null))(r)
1214
+ ), o),
996
1215
  {}
997
1216
  );
998
- return n.push(e(s)(r)), (i) => {
999
- n.forEach((o) => o(i));
1217
+ return s.push(e(n)(r)), (o) => {
1218
+ s.forEach((i) => i(o));
1000
1219
  };
1001
- }, Ht = (t, e) => De([t], (r) => c(e(r[t]))), Jt = (t, e) => De(t, (r) => c(e(r))), Wt = (t) => (e) => t(e), Bt = (t) => (e) => (e.appendOrInsert(t), (r) => {
1002
- r && p(t);
1003
- }), vt = (t, e, r) => (n) => {
1004
- n = n.makeRef();
1005
- let s = null, i = !1;
1006
- const o = L(null), a = t.on((u) => {
1007
- u == null ? (s == null || s(!0), s = c((r == null ? void 0 : r()) ?? S)(n), i = !1) : (o.value = u, i || (s == null || s(!0), s = c(e(o))(n), i = !0));
1220
+ }, Kt = (t, e) => ve([t], (r) => f(e(r[t]))), Xt = (t, e) => ve(t, (r) => f(e(r))), zt = (t) => (e) => t(e), Qt = (t) => (e) => (e.appendOrInsert(t), (r) => {
1221
+ r && m(t);
1222
+ }), ut = (t, e, r) => (s) => {
1223
+ s = s.makeRef();
1224
+ let n = null, o = !1;
1225
+ const i = L(null), a = t.on((u) => {
1226
+ u == null ? (n == null || n(!0), n = f((r == null ? void 0 : r()) ?? w)(s), o = !1) : (i.value = u, o || (n == null || n(!0), n = f(e(i))(s), o = !0));
1008
1227
  });
1009
1228
  return (u) => {
1010
- a(), s == null || s(u), u && n.reference && p(n.reference);
1229
+ a(), n == null || n(u), u && s.reference && m(s.reference);
1011
1230
  };
1012
- }, G = (t) => (e) => (r) => t(r, e), Te = (t, e, r) => r != null ? Te(t, (n) => {
1013
- const s = n.map((i) => i.isLast ? "last" : "other");
1231
+ }, B = (t) => (e) => (r) => t(r, e), ye = (t, e, r) => r != null ? ye(t, (s) => {
1232
+ const n = s.map((o) => o.isLast ? "last" : "other");
1014
1233
  return y(
1015
- G(() => s.dispose()),
1016
- c(e(n)),
1017
- k.value(s, {
1018
- last: () => S,
1019
- other: () => r(n)
1234
+ B(() => n.dispose()),
1235
+ f(e(s)),
1236
+ H(n, {
1237
+ last: () => w,
1238
+ other: () => r(s)
1020
1239
  })
1021
1240
  );
1022
- }) : (n) => {
1023
- n = n.makeRef();
1024
- const s = t.map(
1025
- (u) => Array.from({ length: u }, (f, m) => m).map(
1026
- (f) => new Ue(f, u)
1241
+ }) : (s) => {
1242
+ s = s.makeRef();
1243
+ const n = t.map(
1244
+ (u) => Array.from({ length: u }, (c, g) => g).map(
1245
+ (c) => new ke(c, u)
1027
1246
  )
1028
- ), i = [], o = [], a = s.on((u) => {
1029
- var m, _;
1030
- const f = u.length;
1031
- for (; f < i.length; )
1032
- (m = i.pop()) == null || m(!0), (_ = o.pop()) == null || _.dispose();
1033
- for (let d = 0; d < f; d++)
1034
- if (o[d] == null) {
1035
- o[d] = L(u[d]);
1036
- const P = c(e(o[d]));
1037
- i[d] = P(n);
1247
+ ), o = [], i = [], a = n.on((u) => {
1248
+ var g, S;
1249
+ const c = u.length;
1250
+ for (; c < o.length; )
1251
+ (g = o.pop()) == null || g(!0), (S = i.pop()) == null || S.dispose();
1252
+ for (let p = 0; p < c; p++)
1253
+ if (i[p] == null) {
1254
+ i[p] = L(u[p]);
1255
+ const D = f(e(i[p]));
1256
+ o[p] = D(s);
1038
1257
  } else
1039
- o[d].value = u[d];
1258
+ i[p].value = u[p];
1040
1259
  });
1041
1260
  return (u) => {
1042
- a(), u && n.reference && p(n.reference);
1261
+ a(), u && s.reference && m(s.reference);
1043
1262
  };
1044
- }, yt = (t, e, r) => r != null ? yt(t, (n, s) => {
1045
- const i = s.map((o) => o.isLast ? "last" : "other");
1263
+ }, at = (t, e, r) => r != null ? at(t, (s, n) => {
1264
+ const o = n.map((i) => i.isLast ? "last" : "other");
1046
1265
  return y([
1047
- G(() => i.dispose()),
1048
- c(e(n, s)),
1049
- k.value(i, {
1050
- last: () => S,
1051
- other: () => r(s)
1266
+ B(() => o.dispose()),
1267
+ f(e(s, n)),
1268
+ H(o, {
1269
+ last: () => w,
1270
+ other: () => r(n)
1052
1271
  })
1053
1272
  ]);
1054
- }) : (n) => {
1055
- const s = t.map((i) => i.length);
1056
- return Te(s, (i) => {
1057
- const o = H(
1058
- () => t.value[i.value.index],
1059
- [i, t]
1273
+ }) : (s) => {
1274
+ const n = t.map((o) => o.length);
1275
+ return ye(n, (o) => {
1276
+ const i = j(
1277
+ () => t.value[o.value.index],
1278
+ [o, t]
1060
1279
  );
1061
1280
  return y(
1062
- G(() => o.dispose()),
1063
- c(e(o, i))
1281
+ B(() => i.dispose()),
1282
+ f(e(i, o))
1064
1283
  );
1065
- })(n);
1066
- }, Xt = (t, e) => (r) => {
1284
+ })(s);
1285
+ }, Yt = (t, e) => (r) => {
1067
1286
  r = r.makeRef();
1068
- const n = t.map((o) => c(e(o)));
1069
- let s = () => {
1287
+ const s = t.map((i) => f(e(i)));
1288
+ let n = () => {
1070
1289
  };
1071
- const i = n.on((o) => {
1072
- s(!0), s = o(r);
1290
+ const o = s.on((i) => {
1291
+ n(!0), n = i(r);
1073
1292
  });
1074
- return (o) => {
1075
- i(), s(o);
1293
+ return (i) => {
1294
+ o(), n(i);
1076
1295
  };
1077
- }, Le = (t, e, r) => vt(
1078
- t.map((n) => n ? !0 : null),
1296
+ }, we = (t, e, r) => ut(
1297
+ t.map((s) => s ? !0 : null),
1079
1298
  () => e,
1080
1299
  r != null ? () => r : void 0
1081
- ), zt = (t, e, r) => Le(
1082
- t.map((n) => !n),
1300
+ ), Zt = (t, e, r) => we(
1301
+ t.map((s) => !s),
1083
1302
  e,
1084
1303
  r
1085
- );
1086
- function Kt(t, e, r = S) {
1087
- return Le(
1088
- t.map((n) => n.length > 0),
1089
- e,
1090
- r
1091
- );
1092
- }
1093
- const Qt = (t) => (e) => t(e.element) ?? (() => {
1094
- });
1095
- function ke(t, e) {
1304
+ ), xt = (t, e, r = w) => we(
1305
+ t.map((s) => s.length > 0),
1306
+ e,
1307
+ r
1308
+ ), er = (t) => (e) => t(e.element) ?? (() => {
1309
+ }), Se = (t, e) => {
1096
1310
  const r = t(e);
1097
1311
  return () => r(!0);
1312
+ }, tr = (t, e, { doc: r, clear: s } = {}) => {
1313
+ const n = typeof e == "string" ? (r ?? document).querySelector(e) : e;
1314
+ if (n === null)
1315
+ throw new ct(
1316
+ `Cannot find element by selector for render: ${e}`
1317
+ );
1318
+ s !== !1 && (r ?? n.ownerDocument) != null && et(r ?? n.ownerDocument);
1319
+ const o = je(n), i = se(n) ? void 0 : n, a = v.of(o, i);
1320
+ return Se(t, a);
1321
+ };
1322
+ class ct extends Error {
1323
+ constructor(e) {
1324
+ super(e);
1325
+ }
1098
1326
  }
1099
- function Yt(t, e, { doc: r, clear: n } = {}) {
1100
- const s = typeof e == "string" ? (r ?? document).querySelector(e) : e;
1327
+ const rr = (t, e) => (r) => {
1328
+ const s = r.document.querySelector(t);
1101
1329
  if (s === null)
1102
- throw new Error(`Cannot find element by selector for render: ${e}`);
1103
- n && (r ?? s.ownerDocument) != null && ut(r ?? s.ownerDocument);
1104
- const i = ze(s), o = he(s) ? void 0 : s, a = v.of(i, o);
1105
- return ke(t, a);
1106
- }
1107
- const Zt = (t, e) => (r) => {
1108
- const n = r.document.querySelector(t);
1109
- if (n === null)
1110
1330
  throw new Error(`Cannot find element by selector for portal: ${t}`);
1111
- return ke(
1112
- c(e),
1113
- r.withElement(n).withFirstLevel()
1331
+ return Se(
1332
+ f(e),
1333
+ r.withElement(s).withFirstLevel()
1114
1334
  );
1115
- };
1116
- function xt(t) {
1117
- return Symbol(t);
1118
- }
1119
- const Ne = (t, e) => (r) => c(e)(r.withProviders(t)), er = (...t) => t.length > 0 ? t.reduceRight((e, r) => (n) => e(r(n))) : c, tr = (t, e, r) => Ne({ [t]: e }, c(r)), rr = (t, e) => Ne(t, c(e)), St = (t, e) => (r) => {
1120
- const n = r.element, s = n.style.getPropertyValue(t);
1121
- return n.style.setProperty(t, e), (i) => {
1122
- i && n.style.setProperty(t, s);
1335
+ }, sr = (t) => Symbol(t), Ae = (t, e) => (r) => f(e)(r.withProviders(t)), nr = (...t) => t.length > 0 ? t.reduceRight((e, r) => (s) => e(r(s))) : f, or = (t, e, r) => Ae({ [t]: e }, f(r)), ir = (t, e) => Ae(t, f(e)), ft = (t, e) => (r) => {
1336
+ const s = r.element, n = s.style.getPropertyValue(t);
1337
+ return s.style.setProperty(t, e), (o) => {
1338
+ o && s.style.setProperty(t, n);
1123
1339
  };
1124
- }, wt = (t, e) => (r) => {
1125
- const n = r.element, s = n.style.getPropertyValue(t);
1126
- return e.on((i) => n.style.setProperty(t, i)), (i) => {
1127
- i && n.style.setProperty(t, s);
1340
+ }, ht = (t, e) => (r) => {
1341
+ const s = r.element, n = s.style.getPropertyValue(t);
1342
+ return e.on((o) => s.style.setProperty(t, o)), (o) => {
1343
+ o && s.style.setProperty(t, n);
1128
1344
  };
1129
- }, nr = new Proxy(
1345
+ }, lr = new Proxy(
1130
1346
  {},
1131
1347
  {
1132
- get: (t, e) => (r) => h.is(r) ? wt(e, r) : St(e, r)
1348
+ /**
1349
+ * Creates a renderable component for the specified `style` property.
1350
+ *
1351
+ * @param _ - The target object.
1352
+ * @param name - The name of the CSS style property.
1353
+ * @returns The renderable component for the specified attribute.
1354
+ *
1355
+ */
1356
+ get: (t, e) => (r) => h.is(r) ? ht(e, r) : ft(e, r)
1133
1357
  }
1134
1358
  );
1135
1359
  export {
1136
- Vt as Async,
1360
+ kt as Async,
1361
+ jt as BindChecked,
1362
+ $t as BindDate,
1363
+ qt as BindDateTime,
1364
+ It as BindNumber,
1365
+ Bt as BindText,
1137
1366
  E as Computed,
1138
- jt as Conjunction,
1367
+ Ht as Conjunction,
1139
1368
  v as DOMContext,
1140
- Bt as DOMNode,
1141
- me as El,
1142
- ge as ElNS,
1143
- S as Empty,
1144
- vt as Ensure,
1145
- yt as ForEach,
1369
+ Qt as DOMNode,
1370
+ ie as El,
1371
+ le as ElNS,
1372
+ ke as ElementPosition,
1373
+ Rt as EmitChecked,
1374
+ Mt as EmitPreventDefault,
1375
+ Vt as EmitStopImmediatePropagation,
1376
+ Ft as EmitStopPropagation,
1377
+ nt as EmitValue,
1378
+ it as EmitValueAsDate,
1379
+ lt as EmitValueAsDateTime,
1380
+ ot as EmitValueAsNumber,
1381
+ w as Empty,
1382
+ ut as Ensure,
1383
+ at as ForEach,
1146
1384
  y as Fragment,
1147
- Xt as MapSignal,
1148
- se as MemoryStore,
1149
- Kt as NotEmpty,
1150
- ft as OnChecked,
1151
- Wt as OnCtx,
1152
- Qt as OnMount,
1153
- G as OnUnmount,
1154
- Zt as Portal,
1155
- Ue as Position,
1385
+ Yt as MapSignal,
1386
+ z as MemoryStore,
1387
+ xt as NotEmpty,
1388
+ st as OnChecked,
1389
+ zt as OnCtx,
1390
+ er as OnMount,
1391
+ B as OnUnmount,
1392
+ G as OneOf,
1393
+ _e as OneOfField,
1394
+ Ut as OneOfKind,
1395
+ Wt as OneOfTuple,
1396
+ Gt as OneOfType,
1397
+ H as OneOfValue,
1398
+ rr as Portal,
1156
1399
  F as Prop,
1157
- er as Provide,
1158
- Te as Repeat,
1400
+ nr as Provide,
1401
+ Be as ProviderNotFoundError,
1402
+ ct as RenderingError,
1403
+ ye as Repeat,
1159
1404
  h as Signal,
1160
- be as Task,
1161
- kt as Text,
1162
- zt as Unless,
1163
- Gt as Use,
1164
- Ht as UseProvider,
1165
- Jt as UseProviders,
1166
- Le as When,
1167
- tr as WithProvider,
1168
- rr as WithProviders,
1169
- we as addNodeTracker,
1170
- Dt as animateSignal,
1171
- Ge as animateSignals,
1172
- Ct as aria,
1173
- b as attr,
1174
- Ut as bind,
1175
- ut as clearSSR,
1176
- Tt as computedRecord,
1177
- Nt as dataAttr,
1178
- Fe as dateInterpolate,
1179
- V as emit,
1180
- qe as endInterpolate,
1181
- ze as getSelfOrParentElement,
1182
- Ve as guessInterpolate,
1183
- Lt as handleAnchorClick,
1184
- Ot as html,
1185
- It as input,
1186
- he as isElement,
1187
- bt as localStorageProp,
1188
- fe as makeGetter,
1189
- xt as makeProviderMark,
1190
- ce as makeSetter,
1191
- Ft as math,
1192
- Mt as mathAttr,
1193
- ye as maybeAddAttributeTracker,
1194
- Se as maybeAddClassTracker,
1195
- _e as maybeAddTextTracker,
1196
- Ie as numberInterpolate,
1197
- q as on,
1198
- k as oneof,
1199
- tt as removeAttributeTrackers,
1200
- nt as removeClassTrackers,
1201
- p as removeDOMNode,
1202
- st as removeNodeTrackers,
1203
- ot as removeTextTrackers,
1204
- Yt as render,
1205
- ke as renderWithContext,
1206
- c as renderableOfTNode,
1207
- Pt as sessionStorageProp,
1208
- Xe as setAttribute,
1209
- He as setBooleanProperty,
1210
- We as setDateProperty,
1211
- Je as setNumberProperty,
1212
- Be as setStringProperty,
1213
- pe as signalText,
1214
- R as ssr,
1215
- qt as startSSR,
1216
- de as staticText,
1217
- ie as storedProp,
1218
- $e as stringInterpolate,
1219
- nr as style,
1220
- $t as svg,
1221
- Rt as svgAttr,
1222
- H as useComputed,
1223
- At as useEffect,
1224
- L as useProp,
1225
- Et as useSignal
1405
+ me as Task,
1406
+ St as TextNode,
1407
+ Zt as Unless,
1408
+ Jt as Use,
1409
+ Kt as UseProvider,
1410
+ Xt as UseProviders,
1411
+ we as When,
1412
+ or as WithProvider,
1413
+ ir as WithProviders,
1414
+ fe as _addNodeTracker,
1415
+ et as _clearSSR,
1416
+ je as _getSelfOrParentElement,
1417
+ se as _isElement,
1418
+ re as _makeGetter,
1419
+ te as _makeSetter,
1420
+ ae as _maybeAddAttributeTracker,
1421
+ ce as _maybeAddClassTracker,
1422
+ he as _maybeAddTextTracker,
1423
+ m as _removeDOMNode,
1424
+ Ie as _setAttribute,
1425
+ Fe as _setBooleanProperty,
1426
+ $e as _setDateProperty,
1427
+ Ve as _setNumberProperty,
1428
+ qe as _setStringProperty,
1429
+ oe as _signalText,
1430
+ ne as _staticText,
1431
+ vt as animateSignal,
1432
+ Me as animateSignals,
1433
+ Et as aria,
1434
+ P as attr,
1435
+ At as dataAttr,
1436
+ Ce as endInterpolate,
1437
+ Oe as guessInterpolate,
1438
+ wt as handleAnchorClick,
1439
+ bt as html,
1440
+ Tt as input,
1441
+ Ne as interpolateDate,
1442
+ Te as interpolateNumber,
1443
+ Le as interpolateString,
1444
+ O as isSSR,
1445
+ gt as localStorageProp,
1446
+ j as makeComputed,
1447
+ yt as makeComputedRecord,
1448
+ pt as makeEffect,
1449
+ L as makeProp,
1450
+ sr as makeProviderMark,
1451
+ mt as makeSignal,
1452
+ Nt as math,
1453
+ Dt as mathAttr,
1454
+ $ as on,
1455
+ Ct as prepareSSR,
1456
+ xe as removeTextTrackers,
1457
+ tr as render,
1458
+ Se as renderWithContext,
1459
+ f as renderableOfTNode,
1460
+ _t as sessionStorageProp,
1461
+ Q as storedProp,
1462
+ lr as style,
1463
+ Lt as svg,
1464
+ Pt as svgAttr,
1465
+ Ot as useSSRDone
1226
1466
  };