@tempots/dom 24.0.0-next.5 → 24.0.0-next.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,65 +1,65 @@
1
- var De = Object.defineProperty;
2
- var X = (s) => {
3
- throw TypeError(s);
1
+ var He = Object.defineProperty;
2
+ var te = (t) => {
3
+ throw TypeError(t);
4
4
  };
5
- var Oe = (s, e, t) => e in s ? De(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
6
- var i = (s, e, t) => Oe(s, typeof e != "symbol" ? e + "" : e, t), Y = (s, e, t) => e.has(s) || X("Cannot " + t);
7
- var A = (s, e, t) => (Y(s, e, "read from private field"), t ? t.call(s) : e.get(s)), Z = (s, e, t) => e.has(s) ? X("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(s) : e.set(s, t), U = (s, e, t, r) => (Y(s, e, "write to private field"), r ? r.call(s, t) : e.set(s, t), t);
8
- const Ae = (s, e, t) => s + (e - s) * t;
9
- const Me = (s, e, t) => {
10
- const r = Math.max(s.length, e.length);
5
+ var ke = (t, e, s) => e in t ? He(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
6
+ var o = (t, e, s) => ke(t, typeof e != "symbol" ? e + "" : e, s), se = (t, e, s) => e.has(t) || te("Cannot " + s);
7
+ var D = (t, e, s) => (se(t, e, "read from private field"), s ? s.call(t) : e.get(t)), re = (t, e, s) => e.has(t) ? te("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), Y = (t, e, s, r) => (se(t, e, "write to private field"), r ? r.call(t, s) : e.set(t, s), s);
8
+ const Ie = (t, e, s) => t + (e - t) * s;
9
+ const Ne = (t, e, s) => {
10
+ const r = Math.max(t.length, e.length);
11
11
  let n = "";
12
- for (let o = 0; o < r; o++) {
13
- let l = s.charCodeAt(o);
12
+ for (let i = 0; i < r; i++) {
13
+ let l = t.charCodeAt(i);
14
14
  isNaN(l) && (l = 97);
15
- let c = e.charCodeAt(o);
16
- isNaN(c) && (c = 97), n += String.fromCharCode(l + (c - l) * t);
15
+ let c = e.charCodeAt(i);
16
+ isNaN(c) && (c = 97), n += String.fromCharCode(l + (c - l) * s);
17
17
  }
18
18
  return n;
19
- }, ke = (s, e, t) => new Date(s.getTime() + (e.getTime() - s.getTime()) * t), Le = (s, e) => e, $e = (s) => typeof s == "number" ? Ae : typeof s == "string" ? Me : s instanceof Date ? ke : Le;
19
+ }, Re = (t, e, s) => new Date(t.getTime() + (e.getTime() - t.getTime()) * s), Ve = (t, e) => e, je = (t) => typeof t == "number" ? Ie : typeof t == "string" ? Ne : t instanceof Date ? Re : Ve;
20
20
  var w;
21
- class M {
21
+ class L {
22
22
  /**
23
23
  * Creates a new instance of `ElementPosition`.
24
24
  * @param index - The index of the element.
25
25
  * @param total - The total number of elements in the collection.
26
26
  */
27
- constructor(e, t) {
27
+ constructor(e, s) {
28
28
  /**
29
29
  * The counter of the element starting from 1.
30
30
  */
31
- i(this, "counter");
31
+ o(this, "counter");
32
32
  /**
33
33
  * Checks if the element is the first element in the collection.
34
34
  * @returns `true` if the element is the first element, `false` otherwise.
35
35
  */
36
- i(this, "isFirst");
36
+ o(this, "isFirst");
37
37
  /**
38
38
  * Checks if the counter of the element is even.
39
39
  * @returns `true` if the counter is even, `false` otherwise.
40
40
  */
41
- i(this, "isEven");
41
+ o(this, "isEven");
42
42
  /**
43
43
  * Checks if the counter of the element is odd.
44
44
  * @returns `true` if the counter is odd, `false` otherwise.
45
45
  */
46
- i(this, "isOdd");
47
- Z(this, w);
48
- i(this, "dispose", () => {
49
- A(this, w) != null && (A(this, w).dispose(), U(this, w, void 0));
46
+ o(this, "isOdd");
47
+ re(this, w);
48
+ o(this, "dispose", () => {
49
+ D(this, w) != null && (D(this, w).dispose(), Y(this, w, void 0));
50
50
  });
51
- this.index = e, this.total = t, this.counter = e + 1, this.isFirst = e === 0, this.isEven = e % 2 === 1, this.isOdd = e % 2 === 0;
51
+ this.index = e, this.total = s, this.counter = e + 1, this.isFirst = e === 0, this.isEven = e % 2 === 1, this.isOdd = e % 2 === 0;
52
52
  }
53
53
  /**
54
54
  * Checks if the element is the last element in the collection.
55
55
  * @returns `true` if the element is the last element, `false` otherwise.
56
56
  */
57
57
  get isLast() {
58
- return A(this, w) == null && U(this, w, this.total.map((e) => this.counter === e)), A(this, w);
58
+ return D(this, w) == null && Y(this, w, this.total.map((e) => this.counter === e)), D(this, w);
59
59
  }
60
60
  }
61
61
  w = new WeakMap();
62
- const k = class k {
62
+ const M = class M {
63
63
  /**
64
64
  * Represents a signal with a value of type T.
65
65
  *
@@ -67,37 +67,37 @@ const k = class k {
67
67
  * @param equals - A function that determines whether two values of type T are equal.
68
68
  * @public
69
69
  */
70
- constructor(e, t) {
70
+ constructor(e, s) {
71
71
  /**
72
72
  * @internal
73
73
  */
74
- i(this, "$__signal__", !0);
74
+ o(this, "$__signal__", !0);
75
75
  /**
76
76
  * @internal
77
77
  */
78
- i(this, "_value");
78
+ o(this, "_value");
79
79
  /**
80
80
  * @internal
81
81
  */
82
- i(this, "_derivatives", []);
82
+ o(this, "_derivatives", []);
83
83
  /**
84
84
  * @internal
85
85
  */
86
- i(this, "_onValueListeners", []);
86
+ o(this, "_onValueListeners", []);
87
87
  /**
88
88
  * @internal
89
89
  */
90
- i(this, "_onDisposeListeners", []);
90
+ o(this, "_onDisposeListeners", []);
91
91
  /**
92
92
  * Gets the current value of the signal.
93
93
  * @returns The current value of the signal.
94
94
  */
95
- i(this, "get", () => this._value);
95
+ o(this, "get", () => this._value);
96
96
  /**
97
97
  * Checks if the signal has any registered listeners.
98
98
  * @returns `true` if the signal has listeners, `false` otherwise.
99
99
  */
100
- i(this, "hasListeners", () => this._onValueListeners.length > 0);
100
+ o(this, "hasListeners", () => this._onValueListeners.length > 0);
101
101
  /**
102
102
  * Registers a listener function to be called whenever the value of the signal changes.
103
103
  * The listener function will be immediately called with the current value of the signal.
@@ -105,37 +105,37 @@ const k = class k {
105
105
  *
106
106
  * @param listener - The listener function to be called when the value of the signal changes.
107
107
  */
108
- i(this, "on", (e) => (e(this.get()), this._onValueListeners.push(e), () => {
108
+ o(this, "on", (e) => (e(this.get()), this._onValueListeners.push(e), () => {
109
109
  this._onValueListeners.splice(this._onValueListeners.indexOf(e), 1);
110
110
  }));
111
111
  /**
112
112
  * @internal
113
113
  */
114
- i(this, "_setAndNotify", (e, t) => {
114
+ o(this, "_setAndNotify", (e, s) => {
115
115
  const r = this.equals(this._value, e);
116
- r || (this._value = e), (t || !r) && this._onValueListeners.forEach((n) => n(e));
116
+ r || (this._value = e), (s || !r) && this._onValueListeners.forEach((n) => n(e));
117
117
  });
118
118
  /**
119
119
  * @internal
120
120
  */
121
- i(this, "_disposed", !1);
121
+ o(this, "_disposed", !1);
122
122
  /**
123
123
  * Checks whether the signal is disposed.
124
124
  * @returns True if the signal is disposed, false otherwise.
125
125
  */
126
- i(this, "isDisposed", () => this._disposed);
126
+ o(this, "isDisposed", () => this._disposed);
127
127
  /**
128
128
  * Adds a listener function to be called when the object is disposed.
129
129
  * @param listener - The listener function to be called when the object is disposed.
130
130
  * @returns A function that can be called to remove the listener.
131
131
  */
132
- i(this, "onDispose", (e) => {
132
+ o(this, "onDispose", (e) => {
133
133
  this._onDisposeListeners.push(e);
134
134
  });
135
135
  /**
136
136
  * Disposes the signal, releasing any resources associated with it.
137
137
  */
138
- i(this, "dispose", () => {
138
+ o(this, "dispose", () => {
139
139
  this._disposed || (this._disposed = !0, this._onDisposeListeners.forEach((e) => e()), this._onDisposeListeners.length = 0, this._derivatives.length = 0);
140
140
  });
141
141
  /**
@@ -147,14 +147,14 @@ const k = class k {
147
147
  * @param equals - Optional equality function to determine if two mapped values are equal.
148
148
  * @returns - A new Computed instance with the mapped value.
149
149
  */
150
- i(this, "map", (e, t = (r, n) => r === n) => {
150
+ o(this, "map", (e, s = (r, n) => r === n) => {
151
151
  const r = new C(() => {
152
152
  try {
153
153
  return e(this.get());
154
154
  } catch (n) {
155
155
  throw console.error("Error in Signal.map:", n), n;
156
156
  }
157
- }, t);
157
+ }, s);
158
158
  return this.setDerivative(r), r;
159
159
  });
160
160
  /**
@@ -167,14 +167,14 @@ const k = class k {
167
167
  * Defaults to a strict equality check (===).
168
168
  * @returns A new Signal that emits the values of the resulting Signal.
169
169
  */
170
- i(this, "flatMap", (e, t = (r, n) => r === n) => {
170
+ o(this, "flatMap", (e, s = (r, n) => r === n) => {
171
171
  const r = new C(() => {
172
172
  try {
173
173
  return e(this.get()).get();
174
174
  } catch (n) {
175
175
  throw console.error("Error in Signal.flatMap:", n), n;
176
176
  }
177
- }, t);
177
+ }, s);
178
178
  return this.setDerivative(r), r;
179
179
  });
180
180
  /**
@@ -183,26 +183,26 @@ const k = class k {
183
183
  * @param fn - The callback function to be invoked with the current value of the signal.
184
184
  * @returns A new signal that emits the same value as the original signal and invokes the callback function.
185
185
  */
186
- i(this, "tap", (e) => this.map((t) => (e(t), t)));
186
+ o(this, "tap", (e) => this.map((s) => (e(s), s)));
187
187
  /**
188
188
  * Returns a new Signal that emits the value at the specified key of the current value.
189
189
  *
190
190
  * @param key - The key of the value to retrieve.
191
191
  * @returns A new Signal that emits the value at the specified key.
192
192
  */
193
- i(this, "at", (e) => this.map((t) => t[e]));
193
+ o(this, "at", (e) => this.map((s) => s[e]));
194
194
  /**
195
195
  * @internal
196
196
  */
197
- i(this, "_$");
198
- i(this, "filter", (e, t) => {
199
- let r = t ?? this.get();
197
+ o(this, "_$");
198
+ o(this, "filter", (e, s) => {
199
+ let r = s ?? this.get();
200
200
  const n = new C(() => {
201
201
  try {
202
- const o = this.get();
203
- return r = e(o) ? o : r;
204
- } catch (o) {
205
- throw console.error("Error in Signal.filter:", o), o;
202
+ const i = this.get();
203
+ return r = e(i) ? i : r;
204
+ } catch (i) {
205
+ throw console.error("Error in Signal.filter:", i), i;
206
206
  }
207
207
  }, this.equals);
208
208
  return this.setDerivative(n), n;
@@ -217,9 +217,9 @@ const k = class k {
217
217
  * @param equals - Optional equality function to determine if two values are equal.
218
218
  * @returns - A new Computed object with the mapped and filtered values.
219
219
  */
220
- i(this, "filterMap", (e, t, r = (n, o) => n === o) => {
221
- let n = t;
222
- const o = new C(() => {
220
+ o(this, "filterMap", (e, s, r = (n, i) => n === i) => {
221
+ let n = s;
222
+ const i = new C(() => {
223
223
  try {
224
224
  const l = this.get(), c = e(l);
225
225
  return n = c ?? n;
@@ -227,7 +227,7 @@ const k = class k {
227
227
  throw console.error("Error in Signal.filterMap:", l), l;
228
228
  }
229
229
  }, r);
230
- return this.setDerivative(o), o;
230
+ return this.setDerivative(i), i;
231
231
  });
232
232
  /**
233
233
  * Maps the values emitted by the signal to a new value asynchronously using the provided function.
@@ -242,25 +242,25 @@ const k = class k {
242
242
  * @param equals - The equality function to compare the mapped values for equality.
243
243
  * @returns A property that holds the mapped value and can be observed for changes.
244
244
  */
245
- i(this, "mapAsync", (e, t, r, n = (o, l) => o === l) => {
246
- const o = I(t, n);
245
+ o(this, "mapAsync", (e, s, r, n = (i, l) => i === l) => {
246
+ const i = N(s, n);
247
247
  let l = 0, c = new AbortController();
248
- return o.onDispose(
248
+ return i.onDispose(
249
249
  this.on(async (a) => {
250
- const f = ++l;
250
+ const u = ++l;
251
251
  c.abort(), c = new AbortController();
252
252
  try {
253
253
  const h = await e(a, { abortSignal: c.signal });
254
- f === l && o.set(h);
254
+ u === l && i.set(h);
255
255
  } catch (h) {
256
- if (f === l)
256
+ if (u === l)
257
257
  if (r != null)
258
- o.set(r(h));
258
+ i.set(r(h));
259
259
  else
260
260
  throw h;
261
261
  }
262
262
  })
263
- ), o;
263
+ ), i;
264
264
  });
265
265
  /**
266
266
  * Maps the values of the signal using the provided function `fn`, and returns a new signal
@@ -272,28 +272,28 @@ const k = class k {
272
272
  * @param alt - The alternative value to use when the mapped value is `undefined` or `null`.
273
273
  * @returns A new signal containing the mapped values.
274
274
  */
275
- i(this, "mapMaybe", (e, t) => this.map((r) => e(r) ?? t));
275
+ o(this, "mapMaybe", (e, s) => this.map((r) => e(r) ?? s));
276
276
  /**
277
277
  * Feeds a property into the signal and sets up disposal behavior.
278
278
  * @param prop - The property to feed into the signal.
279
279
  * @param autoDisposeProp - Determines whether the property should be automatically disposed when the signal is disposed.
280
280
  * @returns The input property.
281
281
  */
282
- i(this, "feedProp", (e, t = !1) => {
282
+ o(this, "feedProp", (e, s = !1) => {
283
283
  const r = this.on(e.set);
284
- return e.onDispose(r), t ? this.onDispose(e.dispose) : this.onDispose(r), e;
284
+ return e.onDispose(r), s ? this.onDispose(e.dispose) : this.onDispose(r), e;
285
285
  });
286
286
  /**
287
287
  * Derives a new property from the current signal.
288
288
  * @param autoDisposeProp - Determines whether the derived property should be automatically disposed.
289
289
  * @returns The derived property.
290
290
  */
291
- i(this, "deriveProp", (e = !0) => this.feedProp(I(this.get()), e));
291
+ o(this, "deriveProp", (e = !0) => this.feedProp(N(this.get()), e));
292
292
  /**
293
293
  * Returns a signal that emits the count of values received so far.
294
294
  * @returns A signal that emits the count of values received so far.
295
295
  */
296
- i(this, "count", () => {
296
+ o(this, "count", () => {
297
297
  let e = 0;
298
298
  return this.map(() => ++e);
299
299
  });
@@ -303,7 +303,7 @@ const k = class k {
303
303
  * Additionally, when the computed value is disposed, it sets the signal as dirty.
304
304
  * @param computed - The computed value to add as a derivative.
305
305
  */
306
- i(this, "setDerivative", (e) => {
306
+ o(this, "setDerivative", (e) => {
307
307
  this._derivatives.push(e), e.onDispose(() => {
308
308
  this._derivatives.splice(
309
309
  this._derivatives.indexOf(e),
@@ -311,7 +311,7 @@ const k = class k {
311
311
  );
312
312
  }), e.onDispose(this.on(e.setDirty)), this.onDispose(e.dispose);
313
313
  });
314
- this.equals = t, this._value = e;
314
+ this.equals = s, this._value = e;
315
315
  }
316
316
  /**
317
317
  * Gets the value of the signal.
@@ -326,7 +326,7 @@ const k = class k {
326
326
  */
327
327
  get $() {
328
328
  return this._$ !== void 0 ? this._$ : this._$ = new Proxy(this, {
329
- get: (e, t) => this.at(t)
329
+ get: (e, s) => this.at(s)
330
330
  });
331
331
  }
332
332
  };
@@ -340,68 +340,68 @@ const k = class k {
340
340
  * @param equals - A function to compare two values of type O for equality. Defaults to strict equality (===).
341
341
  * @returns - A Signal that represents the result of the Promise.
342
342
  */
343
- i(k, "ofPromise", (e, t, r, n = (o, l) => o === l) => {
344
- const o = new k(t, n);
345
- return e.then((l) => o._setAndNotify(l, !1)).catch((l) => {
346
- r != null ? o._setAndNotify(r(l), !1) : console.error(
343
+ o(M, "ofPromise", (e, s, r, n = (i, l) => i === l) => {
344
+ const i = new M(s, n);
345
+ return e.then((l) => i._setAndNotify(l, !1)).catch((l) => {
346
+ r != null ? i._setAndNotify(r(l), !1) : console.error(
347
347
  "Unhandled promise rejection in Signal.ofPromise:",
348
348
  l
349
349
  );
350
- }), o;
350
+ }), i;
351
351
  }), /**
352
352
  * Checks if a value is a Signal.
353
353
  *
354
354
  * @param value - The value to check.
355
355
  * @returns `true` if the value is a Signal, `false` otherwise.
356
356
  */
357
- i(k, "is", (e) => (
357
+ o(M, "is", (e) => (
358
358
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
359
359
  e != null && e.$__signal__ === !0
360
360
  ));
361
- let d = k;
362
- const Ne = typeof queueMicrotask == "function" ? queueMicrotask : (s) => Promise.resolve().then(s);
361
+ let d = M;
362
+ const qe = typeof queueMicrotask == "function" ? queueMicrotask : (t) => Promise.resolve().then(t);
363
363
  class C extends d {
364
364
  /**
365
365
  * Represents a Signal object.
366
366
  * @param _fn - The function that returns the value of the signal.
367
367
  * @param equals - The function used to compare two values of type T for equality.
368
368
  */
369
- constructor(t, r) {
369
+ constructor(s, r) {
370
370
  super(void 0, r);
371
371
  /**
372
372
  * @internal
373
373
  */
374
- i(this, "$__computed__", !0);
374
+ o(this, "$__computed__", !0);
375
375
  /**
376
376
  * @internal
377
377
  */
378
- i(this, "_isDirty", !1);
378
+ o(this, "_isDirty", !1);
379
379
  /**
380
380
  * Marks the signal as dirty, indicating that its value has changed and needs to be recalculated.
381
381
  * If the signal is already dirty or disposed, this method does nothing.
382
382
  * It also marks all dependent signals as dirty and schedules a notification to update their values.
383
383
  */
384
- i(this, "setDirty", () => {
385
- this._isDirty || this._disposed || (this._isDirty = !0, this._derivatives.forEach((t) => t.setDirty()), this._scheduleNotify());
384
+ o(this, "setDirty", () => {
385
+ this._isDirty || this._disposed || (this._isDirty = !0, this._derivatives.forEach((s) => s.setDirty()), this._scheduleNotify());
386
386
  });
387
387
  /**
388
388
  * @internal
389
389
  */
390
- i(this, "_scheduleCount", 0);
390
+ o(this, "_scheduleCount", 0);
391
391
  /**
392
392
  * Schedules a notification to be executed asynchronously.
393
393
  * If the signal is dirty, it will be updated and notified.
394
394
  * @internal
395
395
  */
396
- i(this, "_scheduleNotify", () => {
397
- const t = ++this._scheduleCount;
398
- Ne(() => {
399
- this._scheduleCount !== t || this._disposed !== !1 || this._isDirty && (this._isDirty = !1, this._setAndNotify(this._fn(), !1));
396
+ o(this, "_scheduleNotify", () => {
397
+ const s = ++this._scheduleCount;
398
+ qe(() => {
399
+ this._scheduleCount !== s || this._disposed !== !1 || this._isDirty && (this._isDirty = !1, this._setAndNotify(this._fn(), !1));
400
400
  });
401
401
  });
402
402
  /** {@inheritDoc Signal.get} */
403
- i(this, "get", () => (this._isDirty && (this._isDirty = !1, this._value = this._fn(), this._setAndNotify(this._value, !0)), this._value));
404
- this._fn = t, this.setDirty();
403
+ o(this, "get", () => (this._isDirty && (this._isDirty = !1, this._value = this._fn(), this._setAndNotify(this._value, !0)), this._value));
404
+ this._fn = s, this.setDirty();
405
405
  }
406
406
  /**
407
407
  * Checks if a value is an instance of `Computed`.
@@ -409,35 +409,35 @@ class C extends d {
409
409
  * @param value - The value to check.
410
410
  * @returns `true` if the value is an instance of `Computed`, `false` otherwise.
411
411
  */
412
- static is(t) {
413
- return t != null && t.$__computed__ === !0;
412
+ static is(s) {
413
+ return s != null && s.$__computed__ === !0;
414
414
  }
415
415
  /** {@inheritDoc Signal.value} */
416
416
  get value() {
417
417
  return this.get();
418
418
  }
419
419
  }
420
- const R = class R extends d {
420
+ const W = class W extends d {
421
421
  constructor() {
422
422
  super(...arguments);
423
423
  /**
424
424
  * @internal
425
425
  */
426
- i(this, "$__prop__", !0);
426
+ o(this, "$__prop__", !0);
427
427
  /**
428
428
  * Changes the value of the property and notifies its listeners.
429
429
  *
430
430
  * @param value - The new value of the property.
431
431
  */
432
- i(this, "set", (t) => {
433
- this._setAndNotify(t, !1);
432
+ o(this, "set", (s) => {
433
+ this._setAndNotify(s, !1);
434
434
  });
435
435
  /**
436
436
  * Updates the value of the signal by applying the provided function to the current value.
437
437
  * @param fn - The function to apply to the current value.
438
438
  */
439
- i(this, "update", (t) => {
440
- this._setAndNotify(t(this.get()), !1);
439
+ o(this, "update", (s) => {
440
+ this._setAndNotify(s(this.get()), !1);
441
441
  });
442
442
  /**
443
443
  * Creates a reducer function that combines the provided reducer function and effects.
@@ -445,16 +445,16 @@ const R = class R extends d {
445
445
  * @param effects - An array of effects to be executed after the state is updated.
446
446
  * @returns A dispatch function that can be used to update the state and trigger the effects.
447
447
  */
448
- i(this, "reducer", (t, ...r) => {
448
+ o(this, "reducer", (s, ...r) => {
449
449
  const n = this;
450
- return function o(l) {
450
+ return function i(l) {
451
451
  const c = n.value;
452
- n.update((a) => t(a, l)), !n.equals(c, n.value) && r.forEach(
452
+ n.update((a) => s(a, l)), !n.equals(c, n.value) && r.forEach(
453
453
  (a) => a({
454
454
  previousState: c,
455
455
  state: n.value,
456
456
  action: l,
457
- dispatch: o
457
+ dispatch: i
458
458
  })
459
459
  );
460
460
  };
@@ -470,9 +470,9 @@ const R = class R extends d {
470
470
  * Defaults to a strict equality check (===).
471
471
  * @returns A Prop object representing the isomorphism.
472
472
  */
473
- i(this, "iso", (t, r, n = (o, l) => o === l) => {
474
- const o = new R(t(this.get()), n);
475
- return o.onDispose(this.on((l) => o.set(t(l)))), o.on((l) => this._setAndNotify(r(l), !1)), o;
473
+ o(this, "iso", (s, r, n = (i, l) => i === l) => {
474
+ const i = new W(s(this.get()), n);
475
+ return i.onDispose(this.on((l) => i.set(s(l)))), i.on((l) => this._setAndNotify(r(l), !1)), i;
476
476
  });
477
477
  /**
478
478
  * Returns a `Prop` that represents the value at the specified key of the current value.
@@ -480,9 +480,9 @@ const R = class R extends d {
480
480
  * @param key - The key of the value to access.
481
481
  * @returns A `Prop` that represents the value at the specified key.
482
482
  */
483
- i(this, "atProp", (t) => this.iso(
484
- (r) => r[t],
485
- (r) => ({ ...this.value, [t]: r })
483
+ o(this, "atProp", (s) => this.iso(
484
+ (r) => r[s],
485
+ (r) => ({ ...this.value, [s]: r })
486
486
  ));
487
487
  }
488
488
  /**
@@ -491,8 +491,8 @@ const R = class R extends d {
491
491
  get value() {
492
492
  return this.get();
493
493
  }
494
- set value(t) {
495
- this._setAndNotify(t, !1);
494
+ set value(s) {
495
+ this._setAndNotify(s, !1);
496
496
  }
497
497
  };
498
498
  /**
@@ -500,15 +500,15 @@ const R = class R extends d {
500
500
  * @param value - The value to check.
501
501
  * @returns `true` if the value is a Prop, `false` otherwise.
502
502
  */
503
- i(R, "is", (t) => (
503
+ o(W, "is", (s) => (
504
504
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
505
- t != null && t.$__prop__ === !0
505
+ s != null && s.$__prop__ === !0
506
506
  ));
507
- let H = R;
508
- const G = (s, e, t = (r, n) => r === n) => {
509
- const r = new C(s, t);
507
+ let I = W;
508
+ const Q = (t, e, s = (r, n) => r === n) => {
509
+ const r = new C(t, s);
510
510
  return e.forEach((n) => n.setDerivative(r)), r;
511
- }, He = (s, e) => G(s, e).dispose, I = (s, e = (t, r) => t === r) => new H(s, e), j = (s, e = (t, r) => t === r) => new d(s, e), ee = () => typeof window < "u" ? window : void 0, p = {
511
+ }, Be = (t, e) => Q(t, e).dispose, N = (t, e = (s, r) => s === r) => new I(t, e), J = (t, e = (s, r) => s === r) => new d(t, e), ie = () => typeof window < "u" ? window : void 0, p = {
512
512
  /**
513
513
  * Maps a value or a Signal to a new value.
514
514
  * If the value is a Signal, it returns a new Signal with the mapped value.
@@ -520,7 +520,7 @@ const G = (s, e, t = (r, n) => r === n) => {
520
520
  * @param fn - The function to map the value.
521
521
  * @returns The mapped value.
522
522
  */
523
- map: (s, e) => d.is(s) ? s.map(e) : e(s),
523
+ map: (t, e) => d.is(t) ? t.map(e) : e(t),
524
524
  /**
525
525
  * Wraps a value or a Signal instance into a Signal.
526
526
  * If the value is already a Signal, it returns the value itself.
@@ -531,30 +531,30 @@ const G = (s, e, t = (r, n) => r === n) => {
531
531
  * @param equals - A function that determines if two values are equal. Defaults to strict equality (===).
532
532
  * @returns A Signal instance.
533
533
  */
534
- toSignal: (s, e) => d.is(s) ? s : j(s, e),
534
+ toSignal: (t, e) => d.is(t) ? t : J(t, e),
535
535
  /**
536
536
  * Wraps a value in a `Signal` if it is not already a `Signal`.
537
537
  * If the value is `null` or `undefined`, it returns `null` or `undefined` respectively.
538
538
  * @param value - The value to wrap or check.
539
539
  * @returns The wrapped value if it is not `null` or `undefined`, otherwise `null` or `undefined`.
540
540
  */
541
- maybeToSignal: (s, e) => {
542
- if (s != null)
543
- return p.toSignal(s, e);
541
+ maybeToSignal: (t, e) => {
542
+ if (t != null)
543
+ return p.toSignal(t, e);
544
544
  },
545
545
  /**
546
546
  * Gets the value from a `Signal` or the value itself if it is not a `Signal`.
547
547
  * @param value - The value or Signal instance to get the value from.
548
548
  * @returns The value.
549
549
  */
550
- get: (s) => d.is(s) ? s.get() : s,
550
+ get: (t) => d.is(t) ? t.get() : t,
551
551
  /**
552
552
  * Adds a listener to a `Signal` or calls the listener immediately if it is not a `Signal`.
553
553
  * @param value - The value or Signal instance to add the listener to.
554
554
  * @param listener - The listener to call when the value changes.
555
555
  * @returns A function to remove the listener.
556
556
  */
557
- on: (s, e) => d.is(s) ? s.on(e) : (e(s), () => {
557
+ on: (t, e) => d.is(t) ? t.on(e) : (e(t), () => {
558
558
  }),
559
559
  /**
560
560
  * Disposes of a value or a Signal.
@@ -562,109 +562,109 @@ const G = (s, e, t = (r, n) => r === n) => {
562
562
  * If the value is not a Signal, it does nothing.
563
563
  * @param value - The value or Signal instance to dispose of.
564
564
  */
565
- dispose: (s) => {
566
- d.is(s) && s.dispose();
565
+ dispose: (t) => {
566
+ d.is(t) && t.dispose();
567
567
  }
568
- }, yt = (...s) => (e, t) => {
569
- const r = s.filter((n) => d.is(n));
570
- return G(
571
- () => e(...s.map((n) => p.get(n))),
568
+ }, Ht = (...t) => (e, s) => {
569
+ const r = t.filter((n) => d.is(n));
570
+ return Q(
571
+ () => e(...t.map((n) => p.get(n))),
572
572
  r,
573
- t
573
+ s
574
574
  );
575
- }, wt = (...s) => (e) => {
576
- const t = s.filter((r) => d.is(r));
577
- He(() => e(...s.map(p.get)), t);
575
+ }, kt = (...t) => (e) => {
576
+ const s = t.filter((r) => d.is(r));
577
+ Be(() => e(...t.map(p.get)), s);
578
578
  };
579
- class te {
579
+ class oe {
580
580
  constructor() {
581
- i(this, "_store", /* @__PURE__ */ new Map());
581
+ o(this, "_store", /* @__PURE__ */ new Map());
582
582
  /**
583
583
  * Retrieves the value associated with the specified key from the memory store.
584
584
  * @param key - The key to retrieve the value for.
585
585
  * @returns The value associated with the key, or `null` if the key is not found.
586
586
  */
587
- i(this, "getItem", (e) => this._store.get(e) ?? null);
587
+ o(this, "getItem", (e) => this._store.get(e) ?? null);
588
588
  /**
589
589
  * Sets the value associated with the specified key in the memory store.
590
590
  * @param key - The key to set the value for.
591
591
  * @param value - The value to set.
592
592
  */
593
- i(this, "setItem", (e, t) => {
594
- this._store.set(e, t);
593
+ o(this, "setItem", (e, s) => {
594
+ this._store.set(e, s);
595
595
  });
596
596
  }
597
597
  }
598
- const se = ({
599
- key: s,
598
+ const le = ({
599
+ key: t,
600
600
  defaultValue: e,
601
- store: t,
601
+ store: s,
602
602
  serialize: r = JSON.stringify,
603
603
  deserialize: n = JSON.parse,
604
- equals: o = (c, a) => c === a,
604
+ equals: i = (c, a) => c === a,
605
605
  onLoad: l = (c) => c
606
606
  }) => {
607
- const c = t.getItem(s), a = new H(
607
+ const c = s.getItem(t), a = new I(
608
608
  c != null ? l(n(c)) : typeof e == "function" ? e() : e,
609
- o
609
+ i
610
610
  );
611
- return a.on((f) => {
612
- t.setItem(s, r(f));
611
+ return a.on((u) => {
612
+ s.setItem(t, r(u));
613
613
  }), a;
614
- }, _t = (s) => {
614
+ }, It = (t) => {
615
615
  var e;
616
- return se({
617
- ...s,
618
- store: ((e = ee()) == null ? void 0 : e.localStorage) ?? new te()
616
+ return le({
617
+ ...t,
618
+ store: ((e = ie()) == null ? void 0 : e.localStorage) ?? new oe()
619
619
  });
620
- }, vt = (s) => {
620
+ }, Nt = (t) => {
621
621
  var e;
622
- return se({
623
- ...s,
624
- store: ((e = ee()) == null ? void 0 : e.sessionStorage) ?? new te()
622
+ return le({
623
+ ...t,
624
+ store: ((e = ie()) == null ? void 0 : e.sessionStorage) ?? new oe()
625
625
  });
626
626
  };
627
- function K(s) {
628
- return typeof requestAnimationFrame == "function" ? requestAnimationFrame(s) : setTimeout(s, 0);
627
+ function ne(t) {
628
+ return typeof requestAnimationFrame == "function" ? requestAnimationFrame(t) : setTimeout(t, 0);
629
629
  }
630
- const Ie = (s, e, t, r) => {
631
- const n = (r == null ? void 0 : r.duration) ?? 300, o = (r == null ? void 0 : r.easing) ?? ((y) => y), l = (r == null ? void 0 : r.equals) ?? ((y, N) => y === N);
632
- let c = r == null ? void 0 : r.interpolate, a = s, f = e(), h = performance.now(), S = null, O = !0;
633
- const F = new C(e, l), P = I(s, l);
634
- P.onDispose(() => {
635
- S !== null && cancelAnimationFrame(S);
636
- }), P.onDispose(F.dispose), t.forEach((y) => {
637
- y.setDerivative(F), y.onDispose(P.dispose);
630
+ const Fe = (t, e, s, r) => {
631
+ const n = (r == null ? void 0 : r.duration) ?? 300, i = (r == null ? void 0 : r.easing) ?? ((T) => T), l = (r == null ? void 0 : r.equals) ?? ((T, k) => T === k);
632
+ let c = r == null ? void 0 : r.interpolate, a = t, u = e(), h = performance.now(), m = null, S = !0;
633
+ const X = new C(e, l), b = N(t, l);
634
+ b.onDispose(() => {
635
+ m !== null && cancelAnimationFrame(m);
636
+ }), b.onDispose(X.dispose), s.forEach((T) => {
637
+ T.setDerivative(X), T.onDispose(b.dispose);
638
638
  });
639
- const be = (y) => {
640
- f = y, h = performance.now(), a = P.value, O && (O = !1, S = K(J));
641
- }, J = () => {
642
- const N = (performance.now() - h) / p.get(n), Ee = o(N);
643
- c == null && (c = $e(a));
644
- let Q = c(a, f, Ee);
645
- N >= 1 ? (O = !0, Q = f) : S = K(J), P.set(Q);
639
+ const Me = (T) => {
640
+ u = T, h = performance.now(), a = b.value, S && (S = !1, m = ne(K));
641
+ }, K = () => {
642
+ const k = (performance.now() - h) / p.get(n), $e = i(k);
643
+ c == null && (c = je(a));
644
+ let ee = c(a, u, $e);
645
+ k >= 1 ? (S = !0, ee = u) : m = ne(K), b.set(ee);
646
646
  };
647
- return F.on(be), P;
648
- }, St = (s, e) => {
649
- const { initialValue: t, ...r } = e ?? {};
650
- return Ie(
651
- t ?? s.get(),
652
- s.get,
653
- [s],
647
+ return X.on(Me), b;
648
+ }, Rt = (t, e) => {
649
+ const { initialValue: s, ...r } = e ?? {};
650
+ return Fe(
651
+ s ?? t.get(),
652
+ t.get,
653
+ [t],
654
654
  r
655
655
  );
656
- }, Pt = (s, e) => {
657
- const { signals: t, literals: r } = Object.entries(s).reduce(
658
- ({ signals: o, literals: l }, [c, a]) => (d.is(a) ? o.push([c, a]) : l[c] = a, { signals: o, literals: l }),
656
+ }, Vt = (t, e) => {
657
+ const { signals: s, literals: r } = Object.entries(t).reduce(
658
+ ({ signals: i, literals: l }, [c, a]) => (d.is(a) ? i.push([c, a]) : l[c] = a, { signals: i, literals: l }),
659
659
  { signals: [], literals: {} }
660
- ), n = t.map(([, o]) => o);
661
- return G(() => (t.forEach(([o, l]) => r[o] = l.value), e(r)), n);
662
- }, re = /* @__PURE__ */ new Set(["checked", "disabled", "hidden", "selected"]), ne = /* @__PURE__ */ new Set([
660
+ ), n = s.map(([, i]) => i);
661
+ return Q(() => (s.forEach(([i, l]) => r[i] = l.value), e(r)), n);
662
+ }, ce = /* @__PURE__ */ new Set(["checked", "disabled", "hidden", "selected"]), ae = /* @__PURE__ */ new Set([
663
663
  "rowSpan",
664
664
  "colSpan",
665
665
  "tabIndex",
666
666
  "valueAsNumber"
667
- ]), ie = /* @__PURE__ */ new Set(["valueAsDate"]), oe = /* @__PURE__ */ new Set([
667
+ ]), ue = /* @__PURE__ */ new Set(["valueAsDate"]), he = /* @__PURE__ */ new Set([
668
668
  "value",
669
669
  "textContent",
670
670
  "innerText",
@@ -672,26 +672,26 @@ const Ie = (s, e, t, r) => {
672
672
  "outerHTML",
673
673
  "className",
674
674
  "classList"
675
- ]), Ve = (s, e) => re.has(s) ? (t) => {
676
- t == null ? e[s] = null : e[s] = !!t;
677
- } : ne.has(s) ? (t) => {
678
- t == null ? e[s] = null : e[s] = Number(t);
679
- } : ie.has(s) ? (t) => {
680
- t == null ? e[s] = null : e[s] = t;
681
- } : oe.has(s) ? (t) => {
682
- t == null ? e[s] = null : e[s] = String(t);
683
- } : (t) => {
684
- t == null ? e.removeAttribute(s) : e.setAttribute(s, t);
685
- }, Re = (s, e) => re.has(s) ? () => !!e[s] : ne.has(s) ? () => Number(e[s]) : ie.has(s) ? () => e[s] : oe.has(s) ? () => String(e[s]) : () => e.getAttribute(s), W = (s) => {
686
- const e = s;
687
- e && e.onblur && (e.onblur = null), !(!s || s.ownerDocument === void 0) && s.parentElement && s.parentElement.removeChild(s);
688
- }, je = (s) => le(s) ? s : s.parentElement, le = (s) => s.nodeType === 1;
689
- class ce extends Error {
675
+ ]), Ue = (t, e) => ce.has(t) ? (s) => {
676
+ s == null ? e[t] = null : e[t] = !!s;
677
+ } : ae.has(t) ? (s) => {
678
+ s == null ? e[t] = null : e[t] = Number(s);
679
+ } : ue.has(t) ? (s) => {
680
+ s == null ? e[t] = null : e[t] = s;
681
+ } : he.has(t) ? (s) => {
682
+ s == null ? e[t] = null : e[t] = String(s);
683
+ } : (s) => {
684
+ s == null ? e.removeAttribute(t) : e.setAttribute(t, s);
685
+ }, We = (t, e) => ce.has(t) ? () => !!e[t] : ae.has(t) ? () => Number(e[t]) : ue.has(t) ? () => e[t] : he.has(t) ? () => String(e[t]) : () => e.getAttribute(t), R = (t) => {
686
+ const e = t;
687
+ e && e.onblur && (e.onblur = null), !(!t || t.ownerDocument === void 0) && t.parentElement && t.parentElement.removeChild(t);
688
+ }, Je = (t) => fe(t) ? t : t.parentElement, fe = (t) => t.nodeType === 1;
689
+ class de extends Error {
690
690
  constructor(e) {
691
691
  super(`Provider not found: ${e.description}`);
692
692
  }
693
693
  }
694
- class b {
694
+ class P {
695
695
  /**
696
696
  * Constructs a new `DOMContext` instance.
697
697
  *
@@ -701,7 +701,7 @@ class b {
701
701
  * @param providers - The `Providers` instance associated with this context.
702
702
  * @param isFirstLevel - A boolean value indicating whether this context is at the first level, meaning the outermost node in the generated DOM.
703
703
  */
704
- constructor(e, t, r, n) {
704
+ constructor(e, s, r, n) {
705
705
  /**
706
706
  * Creates a new DOM element (eg: HTML or SVG) with the specified tag name and namespace.
707
707
  *
@@ -709,7 +709,7 @@ class b {
709
709
  * @param namespace - The namespace URI to create the element in, or `undefined` to create a standard HTML element.
710
710
  * @returns The newly created element.
711
711
  */
712
- i(this, "createElement", (e, t) => t !== void 0 ? this.document.createElementNS(t, e) : this.document.createElement(e));
712
+ o(this, "createElement", (e, s) => s !== void 0 ? this.document.createElementNS(s, e) : this.document.createElement(e));
713
713
  /**
714
714
  * Creates a new DOM element (eg: HTML or SVG) with the specified tag name and namespace and appends it to the current element.
715
715
  *
@@ -717,8 +717,8 @@ class b {
717
717
  * @param namespace - The namespace URI to create the element in, or `undefined` to create a standard HTML element.
718
718
  * @returns The newly created element.
719
719
  */
720
- i(this, "makeChildElement", (e, t) => {
721
- const r = this.createElement(e, t);
720
+ o(this, "makeChildElement", (e, s) => {
721
+ const r = this.createElement(e, s);
722
722
  return this.appendOrInsert(r), this.withElement(r);
723
723
  });
724
724
  /**
@@ -726,28 +726,28 @@ class b {
726
726
  * @param text - The text content for the new text node.
727
727
  * @returns A new `Text` node with the specified text content.
728
728
  */
729
- i(this, "createText", (e) => this.document.createTextNode(e));
729
+ o(this, "createText", (e) => this.document.createTextNode(e));
730
730
  /**
731
731
  * Creates a new text node with the specified text content and appends it to the current element.
732
732
  * @param text - The text content for the new text node.
733
733
  * @returns A new `DOMContext` with a reference to the new text node.
734
734
  */
735
- i(this, "makeChildText", (e) => {
736
- const t = this.createText(e);
737
- return this.appendOrInsert(t), this.withReference(t);
735
+ o(this, "makeChildText", (e) => {
736
+ const s = this.createText(e);
737
+ return this.appendOrInsert(s), this.withReference(s);
738
738
  });
739
739
  /**
740
740
  * Sets the text content of the current element.
741
741
  * @param text - The text content to set.
742
742
  */
743
- i(this, "setText", (e) => {
743
+ o(this, "setText", (e) => {
744
744
  this.reference.nodeValue = e;
745
745
  });
746
746
  /**
747
747
  * Gets the text content of the current element or text node.
748
748
  * @returns The text content of the current element or text node.
749
749
  */
750
- i(this, "getText", () => {
750
+ o(this, "getText", () => {
751
751
  var e;
752
752
  return ((e = this.reference) == null ? void 0 : e.nodeValue) ?? this.element.textContent ?? "";
753
753
  });
@@ -756,7 +756,7 @@ class b {
756
756
  * The text node is appended or inserted to the current `DOMContext`.
757
757
  * The new `DOMContext` with the reference is returned.
758
758
  */
759
- i(this, "makeRef", () => {
759
+ o(this, "makeRef", () => {
760
760
  const e = this.createText("");
761
761
  return this.appendOrInsert(e), this.withReference(e);
762
762
  });
@@ -765,7 +765,7 @@ class b {
765
765
  *
766
766
  * @param child - The child node to append or insert.
767
767
  */
768
- i(this, "appendOrInsert", (e) => {
768
+ o(this, "appendOrInsert", (e) => {
769
769
  this.reference === void 0 ? this.element.appendChild(e) : this.element.insertBefore(e, this.reference);
770
770
  });
771
771
  /**
@@ -773,17 +773,17 @@ class b {
773
773
  * @param element - The DOM element to use in the new `DOMContext` instance.
774
774
  * @returns A new `DOMContext` instance with the provided `element`.
775
775
  */
776
- i(this, "withElement", (e) => new b(this.document, e, void 0, this.providers));
776
+ o(this, "withElement", (e) => new P(this.document, e, void 0, this.providers));
777
777
  /**
778
778
  * Creates a new `DOMContext` instance with a reference to a DOM element selected by the provided `selector`.
779
779
  * @param selector - The CSS selector for the target DOM element.
780
780
  * @returns A new `DOMContext` instance with a reference to the selected DOM element.
781
781
  */
782
- i(this, "makePortal", (e) => {
783
- const t = this.document.querySelector(e);
784
- if (t == null)
782
+ o(this, "makePortal", (e) => {
783
+ const s = this.document.querySelector(e);
784
+ if (s == null)
785
785
  throw new Error(`Cannot find element by selector for portal: ${e}`);
786
- return this.withElement(t);
786
+ return this.withElement(s);
787
787
  });
788
788
  /**
789
789
  * Creates a new `DOMContext` instance with the specified reference.
@@ -791,7 +791,7 @@ class b {
791
791
  * @param reference - The optional `Text` node to use as the reference for the new `DOMContext`.
792
792
  * @returns A new `DOMContext` instance with the specified reference.
793
793
  */
794
- i(this, "withReference", (e) => new b(this.document, this.element, e, this.providers));
794
+ o(this, "withReference", (e) => new P(this.document, this.element, e, this.providers));
795
795
  /**
796
796
  * Returns a new HTMLDOMContext instance with the specified providers merged into
797
797
  * the existing providers.
@@ -799,7 +799,7 @@ class b {
799
799
  * @param providers - An object containing the providers to be merged into the existing providers.
800
800
  * @returns A new HTMLDOMContext instance with the merged providers.
801
801
  */
802
- i(this, "withProviders", (e) => new b(this.document, this.element, this.reference, {
802
+ o(this, "withProviders", (e) => new P(this.document, this.element, this.reference, {
803
803
  ...this.providers,
804
804
  ...e
805
805
  }));
@@ -810,71 +810,71 @@ class b {
810
810
  * @returns The provider for the given mark.
811
811
  * @throws Throws `ProviderNotFoundError` if the provider for the given mark is not found.
812
812
  */
813
- i(this, "getProvider", (e) => {
813
+ o(this, "getProvider", (e) => {
814
814
  if (this.providers[e] === void 0)
815
- throw new ce(e);
815
+ throw new de(e);
816
816
  return this.providers[e];
817
817
  });
818
- i(this, "clear", (e) => {
819
- e && (this.reference !== void 0 ? W(this.reference) : W(this.element));
818
+ o(this, "clear", (e) => {
819
+ e && (this.reference !== void 0 ? R(this.reference) : R(this.element));
820
820
  });
821
821
  /**
822
822
  * Adds classes to the element.
823
823
  * @param tokens - The class names to add.
824
824
  */
825
- i(this, "addClasses", (e) => {
825
+ o(this, "addClasses", (e) => {
826
826
  this.element.classList.add(...e);
827
827
  });
828
828
  /**
829
829
  * Removes classes from the element.
830
830
  * @param tokens - The class names to remove.
831
831
  */
832
- i(this, "removeClasses", (e) => {
832
+ o(this, "removeClasses", (e) => {
833
833
  this.element.classList.remove(...e);
834
834
  });
835
835
  /**
836
836
  * Gets the classes of the element.
837
837
  * @returns The classes of the element.
838
838
  */
839
- i(this, "getClasses", () => Array.from(this.element.classList));
839
+ o(this, "getClasses", () => Array.from(this.element.classList));
840
840
  /**
841
841
  * Adds an event listener to the element.
842
842
  * @param event - The event to listen for.
843
843
  * @param listener - The listener to call when the event occurs.
844
844
  * @returns A function to remove the event listener.
845
845
  */
846
- i(this, "on", (e, t) => (this.element.addEventListener(e, t), (r) => {
847
- r && this.element.removeEventListener(e, t);
846
+ o(this, "on", (e, s) => (this.element.addEventListener(e, s), (r) => {
847
+ r && this.element.removeEventListener(e, s);
848
848
  }));
849
849
  /**
850
850
  * Returns `true` if the context is a browser DOM context.
851
851
  * @returns `true` if the context is a browser DOM context.
852
852
  */
853
- i(this, "isBrowserDOM", () => !0);
853
+ o(this, "isBrowserDOM", () => !0);
854
854
  /**
855
855
  * Returns `true` if the context is a headless DOM context.
856
856
  * @returns `true` if the context is a headless DOM context.
857
857
  */
858
- i(this, "isHeadlessDOM", () => !1);
858
+ o(this, "isHeadlessDOM", () => !1);
859
859
  /**
860
860
  * Sets the style of the element.
861
861
  * @param name - The name of the style to set.
862
862
  * @param value - The value of the style to set.
863
863
  */
864
- i(this, "setStyle", (e, t) => {
865
- this.element.style.setProperty(e, t);
864
+ o(this, "setStyle", (e, s) => {
865
+ this.element.style.setProperty(e, s);
866
866
  });
867
867
  /**
868
868
  * Gets the style of the element.
869
869
  * @param name - The name of the style to get.
870
870
  * @returns The value of the style.
871
871
  */
872
- i(this, "getStyle", (e) => this.element.style.getPropertyValue(e));
873
- i(this, "makeAccessors", (e) => ({
874
- get: Re(e, this.element),
875
- set: Ve(e, this.element)
872
+ o(this, "getStyle", (e) => this.element.style.getPropertyValue(e));
873
+ o(this, "makeAccessors", (e) => ({
874
+ get: We(e, this.element),
875
+ set: Ue(e, this.element)
876
876
  }));
877
- this.document = e, this.element = t, this.reference = r, this.providers = n;
877
+ this.document = e, this.element = s, this.reference = r, this.providers = n;
878
878
  }
879
879
  /**
880
880
  * Creates a new `DOMContext` instance for the given `Element` and optional reference `Node`.
@@ -883,256 +883,387 @@ class b {
883
883
  * @param ref - An optional reference `Node` to associate with the `DOMContext`.
884
884
  * @returns A new `DOMContext` instance.
885
885
  */
886
- static of(e, t) {
887
- return new b(e.ownerDocument, e, t, {});
886
+ static of(e, s) {
887
+ return new P(e.ownerDocument, e, s, {});
888
888
  }
889
889
  }
890
- const g = Symbol("class"), _ = Symbol("style"), T = Symbol("handler"), ae = () => Math.random().toString(36).substring(2, 15), qe = (s) => s.replace(/<[^>]*>?/g, "");
891
- class ue {
890
+ const Z = (t, e) => {
891
+ const s = t(e);
892
+ return () => s(!0);
893
+ }, jt = (t, e, { doc: s, clear: r } = {}) => {
894
+ const n = typeof e == "string" ? (s ?? document).querySelector(e) : e;
895
+ if (n === null)
896
+ throw new Ge(
897
+ `Cannot find element by selector for render: ${e}`
898
+ );
899
+ r !== !1 && (s ?? n.ownerDocument) != null && n.nodeType === 1 && (n.innerHTML = "");
900
+ const i = Je(n), l = fe(n) ? void 0 : n, c = P.of(i, l);
901
+ return Z(t, c);
902
+ }, qt = (t, {
903
+ startUrl: e = "https://example.com",
904
+ selector: s = ":root"
905
+ } = {}) => {
906
+ const r = p.toSignal(e).deriveProp(), n = new ye(s, void 0), i = new x(n, void 0, { currentURL: r }, {});
907
+ return {
908
+ clear: Z(t(), i),
909
+ root: n,
910
+ currentURL: r
911
+ };
912
+ };
913
+ class Ge extends Error {
914
+ constructor(e) {
915
+ super(e);
916
+ }
917
+ }
918
+ const pe = "data-tts-node", V = "data-tts-class", j = "data-tts-style", q = "data-tts-html", B = "data-tts-text", F = "data-tts-attrs";
919
+ class Bt {
920
+ constructor(e, s, r, n, i, l, c, a, u, h, m, S) {
921
+ o(this, "setFromRoot", (e, s) => {
922
+ e.getPortals().forEach((n) => {
923
+ const i = this.select(n.selector)[0];
924
+ if (i == null)
925
+ throw new Error(
926
+ `Cannot find element by selector for render: ${n.selector}`
927
+ );
928
+ if (n.hasChildren() && this.appendHTML(i, n.contentToHTML(s)), n.hasInnerHTML()) {
929
+ if (s) {
930
+ const l = this.getInnerHTML(i);
931
+ l != null && this.setAttribute(i, q, l);
932
+ }
933
+ this.setInnerHTML(i, n.getInnerHTML());
934
+ }
935
+ if (n.hasInnerText()) {
936
+ if (s) {
937
+ const l = this.getInnerText(i);
938
+ l != null && this.setAttribute(i, B, l);
939
+ }
940
+ this.setInnerText(i, n.getInnerText());
941
+ }
942
+ if (n.hasClasses()) {
943
+ if (s) {
944
+ const l = this.getClass(i);
945
+ l != null && this.setAttribute(i, V, l);
946
+ }
947
+ this.setClass(i, n.getClasses().join(" "));
948
+ }
949
+ if (n.hasStyles()) {
950
+ if (s) {
951
+ const l = this.getStyles(i);
952
+ l != null && this.setAttribute(
953
+ i,
954
+ j,
955
+ JSON.stringify(l)
956
+ );
957
+ }
958
+ this.setStyles(i, n.getStyles());
959
+ }
960
+ if (n.hasAttributes()) {
961
+ const l = n.getAttributes();
962
+ if (s) {
963
+ const c = [];
964
+ l.forEach(([a]) => {
965
+ const u = this.getAttribute(i, a);
966
+ u != null && c.push([a, u]);
967
+ }), this.setAttribute(
968
+ i,
969
+ F,
970
+ JSON.stringify(Object.fromEntries(c))
971
+ );
972
+ }
973
+ l.forEach(([c, a]) => {
974
+ this.setAttribute(i, c, a);
975
+ });
976
+ }
977
+ });
978
+ });
979
+ this.select = e, this.getAttribute = s, this.setAttribute = r, this.getClass = n, this.setClass = i, this.getStyles = l, this.setStyles = c, this.appendHTML = a, this.getInnerHTML = u, this.setInnerHTML = h, this.getInnerText = m, this.setInnerText = S;
980
+ }
981
+ }
982
+ const ze = () => {
983
+ document.querySelectorAll(`[${pe}]`).forEach(R);
984
+ }, Xe = (t) => {
985
+ const e = t.getAttribute(V);
986
+ t.removeAttribute(V), e != null && t.setAttribute("class", e);
987
+ }, Ye = () => {
988
+ document.querySelectorAll(`[${V}]`).forEach((e) => Xe(e));
989
+ }, Qe = (t) => {
990
+ const e = t.getAttribute(q);
991
+ t.removeAttribute(q), e != null && (t.innerHTML = e);
992
+ }, Ze = () => {
993
+ document.querySelectorAll(`[${q}]`).forEach((e) => Qe(e));
994
+ }, Ke = (t) => {
995
+ const e = t.getAttribute(B);
996
+ t.removeAttribute(B), e != null && (t.innerText = e);
997
+ }, et = () => {
998
+ document.querySelectorAll(`[${B}]`).forEach((e) => Ke(e));
999
+ }, tt = (t) => {
1000
+ const e = t.getAttribute(j);
1001
+ if (t.removeAttribute(j), e != null) {
1002
+ const s = JSON.parse(e);
1003
+ Object.entries(s).forEach(([r, n]) => {
1004
+ t.style.setProperty(r, n);
1005
+ });
1006
+ }
1007
+ }, st = () => {
1008
+ document.querySelectorAll(`[${j}]`).forEach((e) => tt(e));
1009
+ }, rt = (t) => {
1010
+ const e = t.getAttribute(F);
1011
+ if (t.removeAttribute(F), e != null) {
1012
+ const s = JSON.parse(e);
1013
+ Object.entries(s).forEach(([r, n]) => {
1014
+ n == null ? t.removeAttribute(r) : t.setAttribute(r, n);
1015
+ });
1016
+ }
1017
+ }, nt = () => {
1018
+ document.querySelectorAll(`[${F}]`).forEach((e) => rt(e));
1019
+ }, Ft = () => {
1020
+ ze(), Ye(), et(), Ze(), st(), nt();
1021
+ }, y = Symbol("class"), _ = Symbol("style"), E = Symbol("handler"), ge = () => Math.random().toString(36).substring(2, 15), it = (t) => t.replace(/<[^>]*>?/g, "");
1022
+ class me {
892
1023
  constructor(e) {
893
- i(this, "id", ae());
894
- i(this, "properties", {});
895
- i(this, "children", []);
896
- i(this, "isElement", () => !0);
897
- i(this, "isText", () => !1);
898
- i(this, "getText", () => this.properties.innerText != null ? this.properties.innerText : this.properties.innerHTML != null ? qe(this.properties.innerHTML) : this.children.map((e) => e.getText()).join(""));
899
- i(this, "removeChild", (e) => {
900
- const t = this.children.indexOf(e);
901
- t !== -1 && this.children.splice(t, 1);
1024
+ o(this, "id", ge());
1025
+ o(this, "properties", {});
1026
+ o(this, "children", []);
1027
+ o(this, "isElement", () => !0);
1028
+ o(this, "isText", () => !1);
1029
+ o(this, "getText", () => this.properties.innerText != null ? this.properties.innerText : this.properties.innerHTML != null ? it(this.properties.innerHTML) : this.children.map((e) => e.getText()).join(""));
1030
+ o(this, "removeChild", (e) => {
1031
+ const s = this.children.indexOf(e);
1032
+ s !== -1 && this.children.splice(s, 1);
902
1033
  });
903
- i(this, "remove", () => {
1034
+ o(this, "remove", () => {
904
1035
  if (this.parent != null)
905
1036
  this.parent.removeChild(this);
906
1037
  else
907
1038
  throw new Error("Parent is undefined");
908
1039
  });
909
- i(this, "getPortals", () => {
910
- const e = this.elements().flatMap((t) => t.isPortal() ? [t, ...t.getPortals()] : t.getPortals());
1040
+ o(this, "getPortals", () => {
1041
+ const e = this.elements().flatMap((s) => s.isPortal() ? [s, ...s.getPortals()] : s.getPortals());
911
1042
  return this.isPortal() && e.unshift(this), e;
912
1043
  });
913
- i(this, "elements", () => this.children.filter((e) => e.isElement()));
914
- i(this, "hasInnerHTML", () => this.properties.innerHTML != null);
915
- i(this, "getInnerHTML", () => this.properties.innerHTML ?? "");
916
- i(this, "getInnerText", () => this.properties.innerText ?? "");
917
- i(this, "hasInnerText", () => this.properties.innerText != null);
918
- i(this, "hasChildren", () => this.children.length > 0);
919
- i(this, "hasClasses", () => this.properties[g] != null);
920
- i(this, "hasStyles", () => this.properties[_] != null);
921
- i(this, "hasAttributes", () => Object.keys(this.properties).length > 0);
922
- i(this, "hasHandlers", () => this.properties[T] != null);
923
- i(this, "hasRenderableProperties", () => this.hasClasses() || this.hasAttributes() || this.hasStyles());
924
- i(this, "getById", (e) => {
1044
+ o(this, "elements", () => this.children.filter((e) => e.isElement()));
1045
+ o(this, "hasInnerHTML", () => this.properties.innerHTML != null);
1046
+ o(this, "getInnerHTML", () => this.properties.innerHTML ?? "");
1047
+ o(this, "getInnerText", () => this.properties.innerText ?? "");
1048
+ o(this, "hasInnerText", () => this.properties.innerText != null);
1049
+ o(this, "hasChildren", () => this.children.length > 0);
1050
+ o(this, "hasClasses", () => this.properties[y] != null);
1051
+ o(this, "hasStyles", () => this.properties[_] != null);
1052
+ o(this, "hasAttributes", () => Object.keys(this.properties).length > 0);
1053
+ o(this, "hasHandlers", () => this.properties[E] != null);
1054
+ o(this, "hasRenderableProperties", () => this.hasClasses() || this.hasAttributes() || this.hasStyles());
1055
+ o(this, "getById", (e) => {
925
1056
  if (this.properties.id === e)
926
1057
  return this;
927
- for (const t of this.elements()) {
928
- const r = t.getById(e);
1058
+ for (const s of this.elements()) {
1059
+ const r = s.getById(e);
929
1060
  if (r != null)
930
1061
  return r;
931
1062
  }
932
1063
  });
933
- i(this, "trigger", (e, t) => {
934
- ((this.properties[T] ?? {})[e] ?? []).forEach((n) => n(t));
1064
+ o(this, "trigger", (e, s) => {
1065
+ ((this.properties[E] ?? {})[e] ?? []).forEach((n) => n(s));
935
1066
  });
936
- i(this, "click", () => {
1067
+ o(this, "click", () => {
937
1068
  this.trigger("click", {});
938
1069
  });
939
- i(this, "on", (e, t) => {
940
- var o;
941
- const r = (o = this.properties)[T] ?? (o[T] = {}), n = t;
1070
+ o(this, "on", (e, s) => {
1071
+ var i;
1072
+ const r = (i = this.properties)[E] ?? (i[E] = {}), n = s;
942
1073
  return r[e] = [...r[e] ?? [], n], () => {
943
1074
  const l = r[e] ?? [], c = l.indexOf(n);
944
- c !== -1 && (l.splice(c, 1), l.length === 0 ? (delete r[e], Object.keys(r).length === 0 && delete this.properties[T]) : r[e] = l);
1075
+ c !== -1 && (l.splice(c, 1), l.length === 0 ? (delete r[e], Object.keys(r).length === 0 && delete this.properties[E]) : r[e] = l);
945
1076
  };
946
1077
  });
947
- i(this, "addClasses", (e) => {
1078
+ o(this, "addClasses", (e) => {
948
1079
  var r;
949
1080
  if (e.length === 0)
950
1081
  return;
951
- const t = (r = this.properties)[g] ?? (r[g] = []);
1082
+ const s = (r = this.properties)[y] ?? (r[y] = []);
952
1083
  e.forEach((n) => {
953
- t.includes(n) || t.push(n);
1084
+ s.includes(n) || s.push(n);
954
1085
  });
955
1086
  });
956
- i(this, "removeClasses", (e) => {
1087
+ o(this, "removeClasses", (e) => {
957
1088
  var r;
958
1089
  if (e.length === 0)
959
1090
  return;
960
- const t = (r = this.properties)[g] ?? (r[g] = []);
1091
+ const s = (r = this.properties)[y] ?? (r[y] = []);
961
1092
  e.forEach((n) => {
962
- const o = t.indexOf(n);
963
- o !== -1 && t.splice(o, 1);
964
- }), t.length === 0 && delete this.properties[g];
1093
+ const i = s.indexOf(n);
1094
+ i !== -1 && s.splice(i, 1);
1095
+ }), s.length === 0 && delete this.properties[y];
965
1096
  });
966
- i(this, "getClasses", () => this.properties[g] ?? []);
967
- i(this, "getAttributes", () => Object.entries(this.properties).filter(
1097
+ o(this, "getClasses", () => this.properties[y] ?? []);
1098
+ o(this, "getAttributes", () => Object.entries(this.properties).filter(
968
1099
  ([e]) => !["innerText", "innerHTML"].includes(e)
969
1100
  ));
970
- i(this, "getVisibleAttributes", () => Reflect.ownKeys(this.properties).flatMap(
971
- (e) => e === g ? [["class", this.getClasses()]] : e === _ ? [["style", this.getStyles()]] : typeof e == "string" ? [[e, String(this.properties[e])]] : []
1101
+ o(this, "getVisibleAttributes", () => Reflect.ownKeys(this.properties).flatMap(
1102
+ (e) => e === y ? [["class", this.getClasses()]] : e === _ ? [["style", this.getStyles()]] : typeof e == "string" ? [[e, String(this.properties[e])]] : []
972
1103
  ));
973
- i(this, "setStyle", (e, t) => {
1104
+ o(this, "setStyle", (e, s) => {
974
1105
  var n;
975
1106
  const r = (n = this.properties)[_] ?? (n[_] = {});
976
- r[e] = t, t === "" && (delete r[e], Object.keys(r).length === 0 && delete this.properties[_]);
1107
+ r[e] = s, s === "" && (delete r[e], Object.keys(r).length === 0 && delete this.properties[_]);
977
1108
  });
978
- i(this, "getStyle", (e) => {
979
- var t;
980
- return ((t = this.properties[_]) == null ? void 0 : t[e]) ?? "";
1109
+ o(this, "getStyle", (e) => {
1110
+ var s;
1111
+ return ((s = this.properties[_]) == null ? void 0 : s[e]) ?? "";
981
1112
  });
982
- i(this, "getStyles", () => this.properties[_] ?? {});
983
- i(this, "makeAccessors", (e) => {
984
- const t = this.properties;
1113
+ o(this, "getStyles", () => this.properties[_] ?? {});
1114
+ o(this, "makeAccessors", (e) => {
1115
+ const s = this.properties;
985
1116
  return {
986
- get: () => t[e],
987
- set: (r) => t[e] = r
1117
+ get: () => s[e],
1118
+ set: (r) => s[e] = r
988
1119
  };
989
1120
  });
990
1121
  this.parent = e;
991
1122
  }
992
1123
  }
993
- const Be = (s) => s.replace(/"/g, "&quot;"), Fe = (s) => s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
994
- class Ue extends ue {
995
- constructor(t, r, n) {
1124
+ const ot = (t) => t.replace(/"/g, "&quot;"), lt = (t) => t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
1125
+ class ct extends me {
1126
+ constructor(s, r, n) {
996
1127
  super(n);
997
- i(this, "isPortal", () => !1);
998
- i(this, "toHTML", () => {
999
- const t = this.children.map((l) => l.toHTML()).join(""), r = this.namespace ? ` xmlns="${this.namespace}"` : "";
1000
- let n = null;
1001
- const o = this.getVisibleAttributes().map(([l, c]) => l === "class" ? ` class="${c.join(" ")}"` : l === "style" ? typeof c == "string" ? ` style="${c}"` : ` style="${Object.entries(c).map(([a, f]) => `${a}: ${f};`).join(" ")}"` : Ge.has(l) ? ` ${l}` : l === "innerHTML" ? (n = c, "") : l === "innerText" ? (n = Fe(c), "") : ` ${l}="${Be(c)}"`).join("");
1002
- return ze.has(this.tagName) && t === "" ? `<${this.tagName}${r}${o} />` : `<${this.tagName}${r}${o}>${n ?? t}</${this.tagName}>`;
1128
+ o(this, "isPortal", () => !1);
1129
+ o(this, "toHTML", (s = !1) => {
1130
+ const r = this.children.map((a) => a.toHTML()).join(""), n = this.namespace ? ` xmlns="${this.namespace}"` : "";
1131
+ let i = null;
1132
+ const l = this.getVisibleAttributes().map(([a, u]) => a === "class" ? ` class="${u.join(" ")}"` : a === "style" ? typeof u == "string" ? ` style="${u}"` : ` style="${Object.entries(u).map(([h, m]) => `${h}: ${m};`).join(" ")}"` : ut.has(a) ? ` ${a}` : a === "innerHTML" ? (i = u, "") : a === "innerText" ? (i = lt(u), "") : ` ${a}="${ot(u)}"`).join(""), c = s ? ` ${pe}` : "";
1133
+ return ht.has(this.tagName) && r === "" ? `<${this.tagName}${n}${l}${c} />` : `<${this.tagName}${n}${l}${c}>${i ?? r}</${this.tagName}>`;
1003
1134
  });
1004
- this.tagName = t, this.namespace = r;
1135
+ this.tagName = s, this.namespace = r;
1005
1136
  }
1006
1137
  }
1007
- class he extends ue {
1008
- constructor(t, r) {
1138
+ class ye extends me {
1139
+ constructor(s, r) {
1009
1140
  super(r);
1010
- i(this, "isPortal", () => !0);
1011
- i(this, "toHTML", () => "");
1012
- i(this, "contentToHTML", () => this.children.map((t) => t.toHTML()).join(""));
1013
- this.selector = t;
1141
+ o(this, "isPortal", () => !0);
1142
+ o(this, "toHTML", () => "");
1143
+ o(this, "contentToHTML", (s = !1) => this.children.map((r) => r.toHTML(s)).join(""));
1144
+ this.selector = s;
1014
1145
  }
1015
1146
  }
1016
- class We {
1147
+ class at {
1017
1148
  constructor(e) {
1018
- i(this, "id", ae());
1019
- i(this, "isElement", () => !1);
1020
- i(this, "isText", () => !0);
1021
- i(this, "getText", () => this.text);
1022
- i(this, "toHTML", () => this.text);
1149
+ o(this, "id", ge());
1150
+ o(this, "isElement", () => !1);
1151
+ o(this, "isText", () => !0);
1152
+ o(this, "getText", () => this.text);
1153
+ o(this, "toHTML", () => this.text);
1023
1154
  this.text = e;
1024
1155
  }
1025
1156
  }
1026
- class E {
1027
- constructor(e, t, r, n) {
1028
- i(this, "appendOrInsert", (e) => {
1157
+ class x {
1158
+ constructor(e, s, r, n) {
1159
+ o(this, "appendOrInsert", (e) => {
1029
1160
  if (this.reference != null) {
1030
- const t = this.element.children.indexOf(this.reference);
1031
- this.element.children.splice(t, 0, e);
1161
+ const s = this.element.children.indexOf(this.reference);
1162
+ this.element.children.splice(s, 0, e);
1032
1163
  } else
1033
1164
  this.element.children.push(e);
1034
1165
  });
1035
- i(this, "makeChildElement", (e, t) => {
1036
- const r = new Ue(e, t, this.element);
1037
- return this.appendOrInsert(r), new E(
1166
+ o(this, "makeChildElement", (e, s) => {
1167
+ const r = new ct(e, s, this.element);
1168
+ return this.appendOrInsert(r), new x(
1038
1169
  r,
1039
1170
  void 0,
1040
1171
  this.container,
1041
1172
  this.providers
1042
1173
  );
1043
1174
  });
1044
- i(this, "makeChildText", (e) => {
1045
- const t = new We(e);
1046
- return this.appendOrInsert(t), new E(
1175
+ o(this, "makeChildText", (e) => {
1176
+ const s = new at(e);
1177
+ return this.appendOrInsert(s), new x(
1047
1178
  this.element,
1048
- t,
1179
+ s,
1049
1180
  this.container,
1050
1181
  this.providers
1051
1182
  );
1052
1183
  });
1053
- i(this, "setText", (e) => {
1184
+ o(this, "setText", (e) => {
1054
1185
  this.reference && this.reference.isText() && (this.reference.text = e);
1055
1186
  });
1056
- i(this, "getText", () => {
1187
+ o(this, "getText", () => {
1057
1188
  var e;
1058
1189
  return ((e = this.reference) == null ? void 0 : e.getText()) ?? this.element.getText();
1059
1190
  });
1060
- i(this, "makeRef", () => this.makeChildText(""));
1061
- i(this, "makePortal", (e) => {
1062
- const t = new he(e, this.element);
1063
- return this.appendOrInsert(t), new E(
1064
- t,
1191
+ o(this, "makeRef", () => this.makeChildText(""));
1192
+ o(this, "makePortal", (e) => {
1193
+ const s = new ye(e, this.element);
1194
+ return this.appendOrInsert(s), new x(
1195
+ s,
1065
1196
  void 0,
1066
1197
  this.container,
1067
1198
  this.providers
1068
1199
  );
1069
1200
  });
1070
- i(this, "withProviders", (e) => new E(this.element, this.reference, this.container, {
1201
+ o(this, "withProviders", (e) => new x(this.element, this.reference, this.container, {
1071
1202
  ...this.providers,
1072
1203
  ...e
1073
1204
  }));
1074
- i(this, "getProvider", (e) => {
1205
+ o(this, "getProvider", (e) => {
1075
1206
  if (this.providers[e] === void 0)
1076
- throw new ce(e);
1207
+ throw new de(e);
1077
1208
  return this.providers[e];
1078
1209
  });
1079
- i(this, "clear", (e) => {
1210
+ o(this, "clear", (e) => {
1080
1211
  e && (this.reference !== void 0 ? this.element.removeChild(this.reference) : this.element.remove());
1081
1212
  });
1082
- i(this, "on", (e, t) => this.element.on(e, t));
1083
- i(this, "addClasses", (e) => this.element.addClasses(e));
1084
- i(this, "removeClasses", (e) => this.element.removeClasses(e));
1085
- i(this, "getClasses", () => this.element.getClasses());
1086
- i(this, "isBrowserDOM", () => !1);
1087
- i(this, "isHeadlessDOM", () => !0);
1088
- i(this, "setStyle", (e, t) => this.element.setStyle(e, t));
1089
- i(this, "getStyle", (e) => this.element.getStyle(e));
1090
- i(this, "makeAccessors", (e) => this.element.makeAccessors(e));
1091
- this.element = e, this.reference = t, this.container = r, this.providers = n;
1213
+ o(this, "on", (e, s) => this.element.on(e, s));
1214
+ o(this, "addClasses", (e) => this.element.addClasses(e));
1215
+ o(this, "removeClasses", (e) => this.element.removeClasses(e));
1216
+ o(this, "getClasses", () => this.element.getClasses());
1217
+ o(this, "isBrowserDOM", () => !1);
1218
+ o(this, "isHeadlessDOM", () => !0);
1219
+ o(this, "setStyle", (e, s) => this.element.setStyle(e, s));
1220
+ o(this, "getStyle", (e) => this.element.getStyle(e));
1221
+ o(this, "makeAccessors", (e) => this.element.makeAccessors(e));
1222
+ this.element = e, this.reference = s, this.container = r, this.providers = n;
1092
1223
  }
1093
1224
  }
1094
- const Ge = /* @__PURE__ */ new Set([
1225
+ const ut = /* @__PURE__ */ new Set([
1095
1226
  "checked",
1096
1227
  "disabled",
1097
1228
  "multiple",
1098
1229
  "readonly",
1099
1230
  "required",
1100
1231
  "selected"
1101
- ]), ze = /* @__PURE__ */ new Set(["img", "br", "hr", "input", "link", "meta"]), fe = (s) => (e) => {
1102
- const t = e.makeChildText(s);
1103
- return (r) => t.clear(r);
1104
- }, de = (s) => (e) => {
1105
- const t = e.makeChildText(s.value), r = s.on((n) => t.setText(n));
1232
+ ]), ht = /* @__PURE__ */ new Set(["img", "br", "hr", "input", "link", "meta"]), Te = (t) => (e) => {
1233
+ const s = e.makeChildText(t);
1234
+ return (r) => s.clear(r);
1235
+ }, we = (t) => (e) => {
1236
+ const s = e.makeChildText(t.value), r = t.on((n) => s.setText(n));
1106
1237
  return (n) => {
1107
- r(), t.clear(n);
1238
+ r(), s.clear(n);
1108
1239
  };
1109
- }, Tt = (s) => d.is(s) ? de(s) : fe(s), m = (...s) => (e) => {
1110
- const t = s.map((r) => u(r)(e));
1240
+ }, Ut = (t) => d.is(t) ? we(t) : Te(t), g = (...t) => (e) => {
1241
+ const s = t.map((r) => f(r)(e));
1111
1242
  return (r) => {
1112
- t.forEach((n) => n(r));
1243
+ s.forEach((n) => n(r));
1113
1244
  };
1114
- }, v = () => () => {
1115
- }, Je = (s) => (e) => (e.addClasses(s), (t) => {
1116
- t && e.removeClasses(s);
1117
- }), Qe = (s) => (e) => {
1118
- let t = [];
1119
- const r = s.on((n) => {
1120
- e.removeClasses(t), t = (n ?? "").split(" ").filter((o) => o.length > 0), e.addClasses(t);
1245
+ }, A = () => () => {
1246
+ }, ft = (t) => (e) => (e.addClasses(t), (s) => {
1247
+ s && e.removeClasses(t);
1248
+ }), dt = (t) => (e) => {
1249
+ let s = [];
1250
+ const r = t.on((n) => {
1251
+ e.removeClasses(s), s = (n ?? "").split(" ").filter((i) => i.length > 0), e.addClasses(s);
1121
1252
  });
1122
1253
  return (n) => {
1123
- r(), n && e.removeClasses(t), t.length = 0;
1254
+ r(), n && e.removeClasses(s), s.length = 0;
1124
1255
  };
1125
- }, L = (s, e) => (t) => {
1126
- const { get: r, set: n } = t.makeAccessors(s), o = r();
1256
+ }, $ = (t, e) => (s) => {
1257
+ const { get: r, set: n } = s.makeAccessors(t), i = r();
1127
1258
  return n(e), (l) => {
1128
- l && n(o);
1259
+ l && n(i);
1129
1260
  };
1130
- }, $ = (s, e) => (t) => {
1131
- const { get: r, set: n } = t.makeAccessors(s), o = r(), l = e.on(n);
1261
+ }, H = (t, e) => (s) => {
1262
+ const { get: r, set: n } = s.makeAccessors(t), i = r(), l = e.on(n);
1132
1263
  return (c) => {
1133
- l(), c && n(o);
1264
+ l(), c && n(i);
1134
1265
  };
1135
- }, D = new Proxy(
1266
+ }, O = new Proxy(
1136
1267
  {},
1137
1268
  {
1138
1269
  /**
@@ -1146,17 +1277,17 @@ const Ge = /* @__PURE__ */ new Set([
1146
1277
  * @returns The renderable component for the specified attribute.
1147
1278
  *
1148
1279
  */
1149
- get: (s, e) => e === "class" ? (t) => d.is(t) ? Qe(t) : Je(
1150
- (t ?? "").split(" ").filter((r) => r.length > 0)
1151
- ) : (t) => d.is(t) ? $(
1280
+ get: (t, e) => e === "class" ? (s) => d.is(s) ? dt(s) : ft(
1281
+ (s ?? "").split(" ").filter((r) => r.length > 0)
1282
+ ) : (s) => d.is(s) ? H(
1152
1283
  e,
1153
- t
1154
- ) : L(
1284
+ s
1285
+ ) : $(
1155
1286
  e,
1156
- t
1287
+ s
1157
1288
  )
1158
1289
  }
1159
- ), xt = new Proxy(
1290
+ ), Wt = new Proxy(
1160
1291
  {},
1161
1292
  {
1162
1293
  /**
@@ -1167,12 +1298,12 @@ const Ge = /* @__PURE__ */ new Set([
1167
1298
  * @returns The renderable component for the specified attribute.
1168
1299
  *
1169
1300
  */
1170
- get: (s, e) => (t) => d.is(t) ? $(
1301
+ get: (t, e) => (s) => d.is(s) ? H(
1171
1302
  `data-${e}`,
1172
- t
1173
- ) : L(`data-${e}`, t)
1303
+ s
1304
+ ) : $(`data-${e}`, s)
1174
1305
  }
1175
- ), Ct = new Proxy(
1306
+ ), Jt = new Proxy(
1176
1307
  {},
1177
1308
  {
1178
1309
  /**
@@ -1183,15 +1314,15 @@ const Ge = /* @__PURE__ */ new Set([
1183
1314
  * @returns The renderable component for the specified attribute.
1184
1315
  *
1185
1316
  */
1186
- get: (s, e) => (t) => d.is(t) ? $(
1317
+ get: (t, e) => (s) => d.is(s) ? H(
1187
1318
  `aria-${e}`,
1188
- t
1189
- ) : L(
1319
+ s
1320
+ ) : $(
1190
1321
  `aria-${e}`,
1191
- t
1322
+ s
1192
1323
  )
1193
1324
  }
1194
- ), bt = new Proxy(
1325
+ ), Gt = new Proxy(
1195
1326
  {},
1196
1327
  {
1197
1328
  /**
@@ -1202,15 +1333,15 @@ const Ge = /* @__PURE__ */ new Set([
1202
1333
  * @returns The renderable component for the specified attribute.
1203
1334
  *
1204
1335
  */
1205
- get: (s, e) => (t) => d.is(t) ? $(
1336
+ get: (t, e) => (s) => d.is(s) ? H(
1206
1337
  e,
1207
- t
1208
- ) : L(
1338
+ s
1339
+ ) : $(
1209
1340
  e,
1210
- t
1341
+ s
1211
1342
  )
1212
1343
  }
1213
- ), Et = new Proxy(
1344
+ ), zt = new Proxy(
1214
1345
  {},
1215
1346
  {
1216
1347
  /**
@@ -1220,37 +1351,37 @@ const Ge = /* @__PURE__ */ new Set([
1220
1351
  * @returns The renderable component for the specified attribute.
1221
1352
  *
1222
1353
  */
1223
- get: (s, e) => (t) => d.is(t) ? $(
1354
+ get: (t, e) => (s) => d.is(s) ? H(
1224
1355
  e,
1225
- t
1226
- ) : L(
1356
+ s
1357
+ ) : $(
1227
1358
  e,
1228
- t
1359
+ s
1229
1360
  )
1230
1361
  }
1231
- ), u = (s) => {
1232
- if (s == null)
1233
- return v;
1234
- if (Array.isArray(s))
1235
- return m(...s.map(u));
1236
- if (typeof s == "string")
1237
- return fe(s);
1238
- if (d.is(s))
1239
- return de(s);
1240
- if (typeof s == "function")
1241
- return s;
1242
- throw new Error(`Unknown type: '${typeof s}' for child: ${s}`);
1243
- }, pe = (s, ...e) => (t) => {
1244
- const r = t.makeChildElement(s, void 0), n = e.map((o) => u(o)(r));
1245
- return (o) => {
1246
- n.forEach((l) => l(!1)), r.clear(o);
1362
+ ), f = (t) => {
1363
+ if (t == null)
1364
+ return A;
1365
+ if (Array.isArray(t))
1366
+ return g(...t.map(f));
1367
+ if (typeof t == "string")
1368
+ return Te(t);
1369
+ if (d.is(t))
1370
+ return we(t);
1371
+ if (typeof t == "function")
1372
+ return t;
1373
+ throw new Error(`Unknown type: '${typeof t}' for child: ${t}`);
1374
+ }, _e = (t, ...e) => (s) => {
1375
+ const r = s.makeChildElement(t, void 0), n = e.map((i) => f(i)(r));
1376
+ return (i) => {
1377
+ n.forEach((l) => l(!1)), r.clear(i);
1247
1378
  };
1248
- }, me = (s, e, ...t) => (r) => {
1249
- const n = r.makeChildElement(s, e), o = t.map((l) => u(l)(n));
1379
+ }, Ae = (t, e, ...s) => (r) => {
1380
+ const n = r.makeChildElement(t, e), i = s.map((l) => f(l)(n));
1250
1381
  return (l) => {
1251
- o.forEach((c) => c(!1)), n.clear(l);
1382
+ i.forEach((c) => c(!1)), n.clear(l);
1252
1383
  };
1253
- }, Dt = new Proxy(
1384
+ }, Xt = new Proxy(
1254
1385
  {},
1255
1386
  {
1256
1387
  /**
@@ -1258,9 +1389,9 @@ const Ge = /* @__PURE__ */ new Set([
1258
1389
  * @param tagName - The HTML tag name.
1259
1390
  * @returns A renderable function that creates and appends the HTML element to the DOM.
1260
1391
  */
1261
- get: (s, e) => (...t) => pe(e, t.flatMap(u))
1392
+ get: (t, e) => (...s) => _e(e, s.flatMap(f))
1262
1393
  }
1263
- ), Ot = new Proxy(
1394
+ ), Yt = new Proxy(
1264
1395
  {},
1265
1396
  {
1266
1397
  /**
@@ -1268,9 +1399,9 @@ const Ge = /* @__PURE__ */ new Set([
1268
1399
  * @param type - The input type name.
1269
1400
  * @returns A renderable function that creates and appends the HTMLInput element to the DOM.
1270
1401
  */
1271
- get: (s, e) => (...t) => pe("input", D.type(e), ...t)
1402
+ get: (t, e) => (...s) => _e("input", O.type(e), ...s)
1272
1403
  }
1273
- ), Xe = "http://www.w3.org/2000/svg", At = new Proxy(
1404
+ ), pt = "http://www.w3.org/2000/svg", Qt = new Proxy(
1274
1405
  {},
1275
1406
  {
1276
1407
  /**
@@ -1278,9 +1409,9 @@ const Ge = /* @__PURE__ */ new Set([
1278
1409
  * @param tagName - The SVG tag name.
1279
1410
  * @returns A renderable function that creates and appends the SVG element to the DOM.
1280
1411
  */
1281
- get: (s, e) => (...t) => me(e, Xe, t.flatMap(u))
1412
+ get: (t, e) => (...s) => Ae(e, pt, s.flatMap(f))
1282
1413
  }
1283
- ), Ye = "http://www.w3.org/1998/Math/MathML", Mt = new Proxy(
1414
+ ), gt = "http://www.w3.org/1998/Math/MathML", Zt = new Proxy(
1284
1415
  {},
1285
1416
  {
1286
1417
  /**
@@ -1288,35 +1419,35 @@ const Ge = /* @__PURE__ */ new Set([
1288
1419
  * @param tagName - The Math tag name.
1289
1420
  * @returns A renderable function that creates and appends the Math element to the DOM.
1290
1421
  */
1291
- get: (s, e) => (...t) => me(e, Ye, t.flatMap(u))
1422
+ get: (t, e) => (...s) => Ae(e, gt, s.flatMap(f))
1292
1423
  }
1293
- ), ge = (s, e) => {
1424
+ ), Se = (t, e) => {
1294
1425
  if (typeof e == "function")
1295
- return ge(s, { then: e });
1296
- const t = e.pending != null ? u(e.pending) : v, r = e.then, n = e.error != null ? (o) => u(e.error(o)) : () => v;
1297
- return (o) => {
1426
+ return Se(t, { then: e });
1427
+ const s = e.pending != null ? f(e.pending) : A, r = e.then, n = e.error != null ? (i) => f(e.error(i)) : () => A;
1428
+ return (i) => {
1298
1429
  let l = !0;
1299
- const c = s(), a = o.makeRef();
1300
- let f = u(t)(a);
1430
+ const c = t(), a = i.makeRef();
1431
+ let u = f(s)(a);
1301
1432
  return c.then(
1302
1433
  (h) => {
1303
- l && (f(!0), f = u(r(h))(a));
1434
+ l && (u(!0), u = f(r(h))(a));
1304
1435
  },
1305
1436
  (h) => {
1306
- l && (f(!0), f = u(n(h))(a));
1437
+ l && (u(!0), u = f(n(h))(a));
1307
1438
  }
1308
1439
  ), (h) => {
1309
- l = !1, f(h), a.clear(h);
1440
+ l = !1, u(h), a.clear(h);
1310
1441
  };
1311
1442
  };
1312
- }, kt = (s, e) => ge(() => s, e), ye = (s, e) => (t) => t.on(s, e), Ze = (s) => ye("click", (e) => {
1443
+ }, Kt = (t, e) => Se(() => t, e), be = (t, e) => (s) => s.on(t, e), mt = (t) => be("click", (e) => {
1313
1444
  e.preventDefault();
1314
- const t = e.target;
1445
+ const s = e.target;
1315
1446
  setTimeout(() => {
1316
- const r = t.ownerDocument != null ? t == null ? void 0 : t.checked : void 0;
1317
- r != null && s(!r);
1447
+ const r = s.ownerDocument != null ? s == null ? void 0 : s.checked : void 0;
1448
+ r != null && t(!r);
1318
1449
  }, 0);
1319
- }), q = new Proxy(
1450
+ }), G = new Proxy(
1320
1451
  {},
1321
1452
  {
1322
1453
  /**
@@ -1324,311 +1455,282 @@ const Ge = /* @__PURE__ */ new Set([
1324
1455
  * @param fn - The function to call when the event is triggered.
1325
1456
  * @returns A `Renderable` function that adds the event listener to the element.
1326
1457
  */
1327
- get: (s, e) => (t) => ye(e, t)
1458
+ get: (t, e) => (s) => be(e, s)
1328
1459
  }
1329
- ), Ke = (s) => (e) => {
1330
- const t = e.target;
1331
- s(t.value);
1332
- }, et = (s) => (e) => {
1333
- const t = e.target;
1334
- s(t.valueAsNumber);
1335
- }, tt = (s) => (e) => {
1336
- const t = e.target;
1337
- if (t.value === "")
1460
+ ), yt = (t) => (e) => {
1461
+ const s = e.target;
1462
+ t(s.value);
1463
+ }, Tt = (t) => (e) => {
1464
+ const s = e.target;
1465
+ t(s.valueAsNumber);
1466
+ }, wt = (t) => (e) => {
1467
+ const s = e.target;
1468
+ if (s.value === "")
1338
1469
  return;
1339
- const r = t.value.split("-"), n = new Date(
1470
+ const r = s.value.split("-"), n = new Date(
1340
1471
  Number(r[0]),
1341
1472
  Number(r[1]) - 1,
1342
1473
  Number(r[2].substring(0, 2))
1343
1474
  );
1344
- s(n);
1345
- }, st = (s) => (e) => {
1346
- const t = e.target;
1347
- if (t.value === "")
1475
+ t(n);
1476
+ }, _t = (t) => (e) => {
1477
+ const s = e.target;
1478
+ if (s.value === "")
1348
1479
  return;
1349
- const r = t.value.split("T"), n = r[0].split("-"), o = new Date(
1480
+ const r = s.value.split("T"), n = r[0].split("-"), i = new Date(
1350
1481
  Number(n[0]),
1351
1482
  Number(n[1]) - 1,
1352
1483
  Number(n[2])
1353
1484
  ), l = r[1].split(":");
1354
- o.setHours(Number(l[0])), o.setMinutes(Number(l[1])), o.setSeconds(Number(l[2])), s(o);
1355
- }, Lt = (s) => (e) => {
1356
- const t = e.target;
1357
- s(t.checked);
1358
- }, $t = (s) => (e) => {
1359
- e.preventDefault(), s();
1360
- }, Nt = (s) => (e) => {
1361
- e.stopPropagation(), s();
1362
- }, Ht = (s) => (e) => {
1363
- e.stopImmediatePropagation(), s();
1364
- }, It = (s, e = "input") => m(
1365
- D.valueAsDate(s),
1366
- q[e](tt(s.set))
1367
- ), Vt = (s, e = "input") => m(
1368
- D.valueAsDate(s),
1369
- q[e](st(s.set))
1370
- ), Rt = (s, e = "input") => m(
1371
- D.valueAsNumber(s),
1372
- q[e](et(s.set))
1373
- ), jt = (s, e = "input") => m(D.value(s), q[e](Ke(s.set))), qt = (s) => m(D.checked(s), Ze(s.set)), B = (s, e) => {
1374
- if (d.is(s))
1485
+ i.setHours(Number(l[0])), i.setMinutes(Number(l[1])), i.setSeconds(Number(l[2])), t(i);
1486
+ }, es = (t) => (e) => {
1487
+ const s = e.target;
1488
+ t(s.checked);
1489
+ }, ts = (t) => (e) => {
1490
+ e.preventDefault(), t();
1491
+ }, ss = (t) => (e) => {
1492
+ e.stopPropagation(), t();
1493
+ }, rs = (t) => (e) => {
1494
+ e.stopImmediatePropagation(), t();
1495
+ }, ns = (t, e = "input") => g(
1496
+ O.valueAsDate(t),
1497
+ G[e](wt(t.set))
1498
+ ), is = (t, e = "input") => g(
1499
+ O.valueAsDate(t),
1500
+ G[e](_t(t.set))
1501
+ ), os = (t, e = "input") => g(
1502
+ O.valueAsNumber(t),
1503
+ G[e](Tt(t.set))
1504
+ ), ls = (t, e = "input") => g(O.value(t), G[e](yt(t.set))), cs = (t) => g(O.checked(t), mt(t.set)), z = (t, e) => {
1505
+ if (d.is(t))
1375
1506
  return (r) => {
1376
1507
  const n = r.makeRef();
1377
- let o, l;
1378
- const c = s.map((h) => Object.keys(h)[0]);
1508
+ let i, l;
1509
+ const c = t.map((h) => Object.keys(h)[0]);
1379
1510
  let a;
1380
- const f = c.on((h) => {
1511
+ const u = c.on((h) => {
1381
1512
  if (h !== a) {
1382
- l == null || l.dispose(), o == null || o(!0), l = s.map((O) => O[h]);
1383
- const S = e[h](l);
1384
- o = u(S)(n), a = h;
1513
+ l == null || l.dispose(), i == null || i(!0), l = t.map((S) => S[h]);
1514
+ const m = e[h](l);
1515
+ i = f(m)(n), a = h;
1385
1516
  }
1386
1517
  });
1387
1518
  return (h) => {
1388
- f(), n.clear(h), o == null || o(h);
1519
+ u(), n.clear(h), i == null || i(h);
1389
1520
  };
1390
1521
  };
1391
- const t = Object.keys(s)[0];
1392
- return u(e[t](j(s[t])));
1393
- }, we = (s, e, t) => B(
1394
- p.map(s, (r) => ({ [r[e]]: r })),
1522
+ const s = Object.keys(t)[0];
1523
+ return f(e[s](J(t[s])));
1524
+ }, Ee = (t, e, s) => z(
1525
+ p.map(t, (r) => ({ [r[e]]: r })),
1395
1526
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1396
- t
1397
- ), Bt = (s, e) => we(s, "kind", e), Ft = (s, e) => {
1398
- const t = p.map(s, ([r, n]) => ({ [r]: n }));
1399
- return B(t, e);
1400
- }, Ut = (s, e) => we(s, "type", e), rt = (s, e) => B(
1401
- p.map(s, (t) => ({ [t]: !0 })),
1527
+ s
1528
+ ), as = (t, e) => Ee(t, "kind", e), us = (t, e) => {
1529
+ const s = p.map(t, ([r, n]) => ({ [r]: n }));
1530
+ return z(s, e);
1531
+ }, hs = (t, e) => Ee(t, "type", e), At = (t, e) => z(
1532
+ p.map(t, (s) => ({ [s]: !0 })),
1402
1533
  e
1403
- ), Wt = (s, e = {}) => (t) => {
1404
- const r = (e == null ? void 0 : e.firstSeparator) ?? s, n = (e == null ? void 0 : e.lastSeparator) ?? s;
1405
- return rt(
1406
- t.map((o) => o.isFirst ? "first" : o.isLast ? "last" : "other"),
1534
+ ), fs = (t, e = {}) => (s) => {
1535
+ const r = (e == null ? void 0 : e.firstSeparator) ?? t, n = (e == null ? void 0 : e.lastSeparator) ?? t;
1536
+ return At(
1537
+ s.map((i) => i.isFirst ? "first" : i.isLast ? "last" : "other"),
1407
1538
  {
1408
1539
  first: () => r,
1409
1540
  last: () => n,
1410
- other: () => s
1541
+ other: () => t
1411
1542
  }
1412
1543
  );
1413
- }, _e = (s, e) => (t) => {
1414
- const r = Object.values(s).reduce((n, o) => {
1415
- const l = t.getProvider(o);
1416
- return n[o] = l, n;
1544
+ }, ve = (t, e) => (s) => {
1545
+ const r = Object.values(t).reduce((n, i) => {
1546
+ const l = s.getProvider(i);
1547
+ return n[i] = l, n;
1417
1548
  }, {});
1418
- return u(e(r))(t);
1419
- }, Gt = (s, e) => (t) => {
1420
- const r = [], n = Object.entries(s).reduce(
1421
- (o, [l, c]) => (r.push(
1422
- c((a) => (Reflect.set(o, l, a), null))(t)
1423
- ), o),
1549
+ return f(e(r))(s);
1550
+ }, ds = (t, e) => (s) => {
1551
+ const r = [], n = Object.entries(t).reduce(
1552
+ (i, [l, c]) => (r.push(
1553
+ c((a) => (Reflect.set(i, l, a), null))(s)
1554
+ ), i),
1424
1555
  {}
1425
1556
  );
1426
- return r.push(e(n)(t)), (o) => {
1427
- r.forEach((l) => l(o));
1557
+ return r.push(e(n)(s)), (i) => {
1558
+ r.forEach((l) => l(i));
1428
1559
  };
1429
- }, nt = (s, e) => _e([s], (t) => u(e(t[s]))), zt = (s, e) => _e(s, (t) => u(e(t))), Jt = (s) => (e) => s(e) ?? (() => {
1430
- }), Qt = (s) => (e) => (e.appendOrInsert(s), (t) => {
1431
- t && W(s);
1432
- }), it = (s, e, t) => {
1433
- if (d.is(s)) {
1434
- const r = s;
1560
+ }, St = (t, e) => ve([t], (s) => f(e(s[t]))), ps = (t, e) => ve(t, (s) => f(e(s))), gs = (t) => (e) => t(e) ?? (() => {
1561
+ }), ms = (t) => (e) => (e.appendOrInsert(t), (s) => {
1562
+ s && R(t);
1563
+ }), bt = (t, e, s) => {
1564
+ if (d.is(t)) {
1565
+ const r = t;
1435
1566
  return (n) => {
1436
- const o = n.makeRef();
1567
+ const i = n.makeRef();
1437
1568
  let l = null, c = !1;
1438
- const a = I(null), f = r.on((h) => {
1439
- h == null ? (l == null || l(!0), l = u((t == null ? void 0 : t()) ?? v)(o), c = !1) : (a.value = h, c || (l == null || l(!0), l = u(e(a))(
1440
- o
1569
+ const a = N(null), u = r.on((h) => {
1570
+ h == null ? (l == null || l(!0), l = f((s == null ? void 0 : s()) ?? A)(i), c = !1) : (a.value = h, c || (l == null || l(!0), l = f(e(a))(
1571
+ i
1441
1572
  ), c = !0));
1442
1573
  });
1443
1574
  return (h) => {
1444
- f(), l == null || l(h), o.clear(h);
1575
+ u(), l == null || l(h), i.clear(h);
1445
1576
  };
1446
1577
  };
1447
1578
  } else {
1448
- const r = s;
1579
+ const r = t;
1449
1580
  if (r == null) {
1450
- const n = t == null ? void 0 : t();
1451
- return n != null ? u(n) : v;
1581
+ const n = s == null ? void 0 : s();
1582
+ return n != null ? f(n) : A;
1452
1583
  }
1453
- return u(e(j(r)));
1584
+ return f(e(J(r)));
1454
1585
  }
1455
- }, V = (s) => (e) => (t) => s(t, e), ve = (s, e, t) => Se(
1456
- s,
1586
+ }, U = (t) => (e) => (s) => t(s, e), Ce = (t, e, s) => Pe(
1587
+ t,
1457
1588
  () => e,
1458
- () => t
1459
- ), Se = (s, e, t) => it(
1460
- p.map(s, (r) => r ? !0 : null),
1589
+ () => s
1590
+ ), Pe = (t, e, s) => bt(
1591
+ p.map(t, (r) => r ? !0 : null),
1461
1592
  e,
1462
- t ?? void 0
1463
- ), Xt = (s, e, t) => ot(
1464
- s,
1593
+ s ?? void 0
1594
+ ), ys = (t, e, s) => Et(
1595
+ t,
1465
1596
  () => e,
1466
- () => t
1467
- ), ot = (s, e, t) => Se(
1468
- p.map(s, (r) => !r),
1597
+ () => s
1598
+ ), Et = (t, e, s) => Pe(
1599
+ p.map(t, (r) => !r),
1469
1600
  e,
1470
- t
1471
- ), Pe = (s, e, t) => t != null ? Pe(s, (r) => {
1472
- const n = new M(
1601
+ s
1602
+ ), xe = (t, e, s) => s != null ? xe(t, (r) => {
1603
+ const n = new L(
1473
1604
  r.index,
1474
- r.total.map((o) => o - 1)
1605
+ r.total.map((i) => i - 1)
1475
1606
  );
1476
- return m(
1477
- V(n.dispose),
1478
- u(e(r)),
1479
- ve(r.isLast, v, t(n))
1607
+ return g(
1608
+ U(n.dispose),
1609
+ f(e(r)),
1610
+ Ce(r.isLast, A, s(n))
1480
1611
  );
1481
- }) : d.is(s) ? (r) => {
1482
- const n = r.makeRef(), o = Array.from(
1483
- { length: s.value },
1484
- (a, f) => f
1485
- ).map((a) => new M(a, s)), l = o.map(
1486
- (a) => u(e(a))(n)
1487
- ), c = s.on((a) => {
1612
+ }) : d.is(t) ? (r) => {
1613
+ const n = r.makeRef(), i = Array.from(
1614
+ { length: t.value },
1615
+ (a, u) => u
1616
+ ).map((a) => new L(a, t)), l = i.map(
1617
+ (a) => f(e(a))(n)
1618
+ ), c = t.on((a) => {
1488
1619
  for (; a < l.length; )
1489
- o.pop().dispose(), l.pop()(!0);
1490
- for (let f = 0; f < a; f++)
1491
- if (o[f] == null) {
1492
- o[f] = new M(f, s);
1493
- const h = u(e(o[f]));
1494
- l[f] = h(n);
1620
+ i.pop().dispose(), l.pop()(!0);
1621
+ for (let u = 0; u < a; u++)
1622
+ if (i[u] == null) {
1623
+ i[u] = new L(u, t);
1624
+ const h = f(e(i[u]));
1625
+ l[u] = h(n);
1495
1626
  }
1496
1627
  });
1497
1628
  return (a) => {
1498
1629
  c(), n.clear(a);
1499
1630
  };
1500
- } : m(
1501
- ...Array.from({ length: s }, (r, n) => n).map(
1502
- (r) => u(e(new M(r, j(s))))
1631
+ } : g(
1632
+ ...Array.from({ length: t }, (r, n) => n).map(
1633
+ (r) => f(e(new L(r, J(t))))
1503
1634
  )
1504
- ), lt = (s, e, t) => {
1505
- if (t != null)
1506
- return lt(s, (r, n) => {
1507
- const o = new M(
1635
+ ), vt = (t, e, s) => {
1636
+ if (s != null)
1637
+ return vt(t, (r, n) => {
1638
+ const i = new L(
1508
1639
  n.index,
1509
1640
  n.total.map((l) => l - 1)
1510
1641
  );
1511
- return m([
1512
- V(o.dispose),
1513
- u(e(r, n)),
1514
- ve(n.isLast, v, t(o))
1642
+ return g([
1643
+ U(i.dispose),
1644
+ f(e(r, n)),
1645
+ Ce(n.isLast, A, s(i))
1515
1646
  ]);
1516
1647
  });
1517
1648
  {
1518
- const r = p.map(s, (o) => o.length), n = p.toSignal(s);
1519
- return Pe(r, (o) => {
1520
- const l = n.map((c) => c[o.index]);
1521
- return m(
1522
- V(l.dispose),
1523
- u(e(l, o))
1649
+ const r = p.map(t, (i) => i.length), n = p.toSignal(t);
1650
+ return xe(r, (i) => {
1651
+ const l = n.map((c) => c[i.index]);
1652
+ return g(
1653
+ U(l.dispose),
1654
+ f(e(l, i))
1524
1655
  );
1525
1656
  });
1526
1657
  }
1527
- }, ct = (s) => (e) => e.isBrowserDOM() ? s(e) ?? (() => {
1658
+ }, Ct = (t) => (e) => e.isBrowserDOM() ? t(e) ?? (() => {
1528
1659
  }) : () => {
1529
- }, Yt = (s) => (e) => e.isHeadlessDOM() ? s(e) ?? (() => {
1660
+ }, Ts = (t) => (e) => e.isHeadlessDOM() ? t(e) ?? (() => {
1530
1661
  }) : () => {
1531
- }, Zt = (s) => ct((e) => s(e.element) ?? (() => {
1532
- })), Kt = (s, e) => {
1533
- if (d.is(s)) {
1534
- const t = s;
1662
+ }, ws = (t) => Ct((e) => t(e.element) ?? (() => {
1663
+ })), _s = (t, e) => {
1664
+ if (d.is(t)) {
1665
+ const s = t;
1535
1666
  return (r) => {
1536
1667
  r = r.makeRef();
1537
- const n = t.map((c) => u(e(c)));
1538
- let o = () => {
1668
+ const n = s.map((c) => f(e(c)));
1669
+ let i = () => {
1539
1670
  };
1540
1671
  const l = n.on((c) => {
1541
- o(!0), o = c(r);
1672
+ i(!0), i = c(r);
1542
1673
  });
1543
1674
  return (c) => {
1544
- l(), o(c);
1675
+ l(), i(c);
1545
1676
  };
1546
1677
  };
1547
1678
  }
1548
- return u(e(s));
1549
- }, es = (s, e, t = () => v) => B(
1679
+ return f(e(t));
1680
+ }, As = (t, e, s = () => A) => z(
1550
1681
  p.map(
1551
- s,
1682
+ t,
1552
1683
  (r) => r.length > 0 ? { notEmpty: r } : { whenEmpty: null }
1553
1684
  ),
1554
1685
  {
1555
1686
  notEmpty: (r) => e(r),
1556
- whenEmpty: () => t()
1687
+ whenEmpty: () => s()
1557
1688
  }
1558
- ), z = (s, e) => {
1559
- const t = s(e);
1560
- return () => t(!0);
1561
- }, ts = (s, e, { doc: t, clear: r } = {}) => {
1562
- const n = typeof e == "string" ? (t ?? document).querySelector(e) : e;
1563
- if (n === null)
1564
- throw new at(
1565
- `Cannot find element by selector for render: ${e}`
1566
- );
1567
- r !== !1 && (t ?? n.ownerDocument) != null && n.nodeType === 1 && (n.innerHTML = "");
1568
- const o = je(n), l = le(n) ? void 0 : n, c = b.of(o, l);
1569
- return z(s, c);
1570
- }, ss = (s, {
1571
- startUrl: e = "https://example.com",
1572
- selector: t = ":root"
1573
- } = {}) => {
1574
- const r = p.toSignal(e).deriveProp(), n = new he(t, void 0), o = new E(n, void 0, { currentURL: r }, {});
1575
- return {
1576
- clear: z(s(), o),
1577
- root: n,
1578
- currentURL: r
1579
- };
1580
- };
1581
- class at extends Error {
1582
- constructor(e) {
1583
- super(e);
1584
- }
1585
- }
1586
- const rs = (s, e) => (t) => {
1587
- const r = t.makePortal(s);
1588
- return z(u(e), r);
1589
- }, ut = (s) => Symbol(s), Te = (s, e) => (t) => u(e)(t.withProviders(s)), ns = (...s) => s.length > 0 ? s.reduceRight((e, t) => (r) => e(t(r))) : u, ht = (s, e, t) => Te({ [s]: e }, u(t)), is = (s, e) => Te(s, u(e)), xe = ut("Probe"), x = /* @__PURE__ */ new Map(), ft = ({
1590
- identifier: s,
1689
+ ), Ss = (t, e) => (s) => {
1690
+ const r = s.makePortal(t);
1691
+ return Z(f(e), r);
1692
+ }, Pt = (t) => Symbol(t), Oe = (t, e) => (s) => f(e)(s.withProviders(t)), bs = (...t) => t.length > 0 ? t.reduceRight((e, s) => (r) => e(s(r))) : f, xt = (t, e, s) => Oe({ [t]: e }, f(s)), Es = (t, e) => Oe(t, f(e)), De = Pt("Probe"), v = /* @__PURE__ */ new Map(), Ot = ({
1693
+ identifier: t,
1591
1694
  callback: e,
1592
- child: t,
1695
+ child: s,
1593
1696
  timeout: r = 10
1594
1697
  }) => {
1595
- if (x.has(s))
1596
- throw new Error(`Probe already exists: ${s.description}`);
1698
+ if (v.has(t))
1699
+ throw new Error(`Probe already exists: ${t.description}`);
1597
1700
  const n = setTimeout(() => e("timeout"), r);
1598
- x.set(s, {
1701
+ v.set(t, {
1599
1702
  counter: 0,
1600
1703
  timeoutId: n
1601
1704
  });
1602
- const o = (l) => {
1705
+ const i = (l) => {
1603
1706
  clearTimeout(n);
1604
- const c = x.get(l);
1707
+ const c = v.get(l);
1605
1708
  if (c == null)
1606
1709
  throw new Error(`Probe not found: ${l.description}`);
1607
- --c.counter === 0 ? (e("resolved"), x.delete(l)) : x.set(l, c);
1710
+ --c.counter === 0 ? (e("resolved"), v.delete(l)) : v.set(l, c);
1608
1711
  };
1609
- return m(
1610
- V(() => clearTimeout(n)),
1611
- ht(xe, o, t)
1712
+ return g(
1713
+ U(() => clearTimeout(n)),
1714
+ xt(De, i, s)
1612
1715
  );
1613
- }, dt = (s, e) => nt(xe, (t) => {
1614
- const r = x.get(s);
1615
- if (r == null)
1616
- throw new Error(`Probe not found: ${s.description}`);
1617
- return clearTimeout(r.timeoutId), r.counter++, e(() => t(s));
1618
- }), Ce = Symbol("globalProbe"), os = ({
1619
- callback: s,
1716
+ }, Dt = (t, e) => St(De, (s) => {
1717
+ const r = v.get(t);
1718
+ return r == null ? e(() => {
1719
+ }) : (clearTimeout(r.timeoutId), r.counter++, e(() => s(t)));
1720
+ }), Le = Symbol("globalProbe"), vs = ({
1721
+ callback: t,
1620
1722
  timeout: e
1621
- }, t) => ft({ identifier: Ce, callback: s, child: t, timeout: e }), ls = (s) => dt(Ce, s), pt = (s, e) => (t) => {
1622
- const r = t.getStyle(s);
1623
- return t.setStyle(s, e), (n) => {
1624
- n && t.setStyle(s, r);
1723
+ }, s) => Ot({ identifier: Le, callback: t, child: s, timeout: e }), Cs = (t) => Dt(Le, t), Lt = (t, e) => (s) => {
1724
+ const r = s.getStyle(t);
1725
+ return s.setStyle(t, e), (n) => {
1726
+ n && s.setStyle(t, r);
1625
1727
  };
1626
- }, mt = (s, e) => (t) => {
1627
- const r = t.getStyle(s);
1628
- return e.on((n) => t.setStyle(s, n)), (n) => {
1629
- n && t.setStyle(s, r);
1728
+ }, Mt = (t, e) => (s) => {
1729
+ const r = s.getStyle(t);
1730
+ return e.on((n) => s.setStyle(t, n)), (n) => {
1731
+ n && s.setStyle(t, r);
1630
1732
  };
1631
- }, cs = new Proxy(
1733
+ }, Ps = new Proxy(
1632
1734
  {},
1633
1735
  {
1634
1736
  /**
@@ -1639,117 +1741,125 @@ const rs = (s, e) => (t) => {
1639
1741
  * @returns The renderable component for the specified attribute.
1640
1742
  *
1641
1743
  */
1642
- get: (s, e) => (t) => d.is(t) ? mt(e, t) : pt(e, t)
1744
+ get: (t, e) => (s) => d.is(s) ? Mt(e, s) : Lt(e, s)
1643
1745
  }
1644
1746
  );
1645
1747
  export {
1646
- kt as Async,
1647
- qt as BindChecked,
1648
- It as BindDate,
1649
- Vt as BindDateTime,
1650
- Rt as BindNumber,
1651
- jt as BindText,
1652
- b as BrowserContext,
1748
+ F as ATTRS_PLACEHOLDER_ATTR,
1749
+ Kt as Async,
1750
+ cs as BindChecked,
1751
+ ns as BindDate,
1752
+ is as BindDateTime,
1753
+ os as BindNumber,
1754
+ ls as BindText,
1755
+ P as BrowserContext,
1756
+ V as CLASS_PLACEHOLDER_ATTR,
1653
1757
  C as Computed,
1654
- Wt as Conjunction,
1655
- Qt as DOMNode,
1656
- pe as El,
1657
- me as ElNS,
1658
- M as ElementPosition,
1659
- v as Empty,
1660
- it as Ensure,
1661
- lt as ForEach,
1662
- m as Fragment,
1663
- E as HeadlessContext,
1664
- Ue as HeadlessElement,
1665
- he as HeadlessPortal,
1666
- We as HeadlessText,
1667
- ot as LazyUnless,
1668
- Se as LazyWhen,
1669
- Kt as MapSignal,
1670
- te as MemoryStore,
1671
- es as NotEmpty,
1672
- ct as OnBrowserCtx,
1673
- Ze as OnChecked,
1674
- Jt as OnCtx,
1675
- V as OnDispose,
1676
- Zt as OnElement,
1677
- Yt as OnHeadlessCtx,
1678
- B as OneOf,
1679
- we as OneOfField,
1680
- Bt as OneOfKind,
1681
- Ft as OneOfTuple,
1682
- Ut as OneOfType,
1683
- rt as OneOfValue,
1684
- rs as Portal,
1685
- H as Prop,
1686
- ns as Provide,
1687
- os as ProvideGlobalProbe,
1688
- ft as ProvideProbe,
1689
- ce as ProviderNotFoundError,
1690
- at as RenderingError,
1691
- Pe as Repeat,
1758
+ fs as Conjunction,
1759
+ ms as DOMNode,
1760
+ _e as El,
1761
+ Ae as ElNS,
1762
+ L as ElementPosition,
1763
+ A as Empty,
1764
+ bt as Ensure,
1765
+ vt as ForEach,
1766
+ g as Fragment,
1767
+ q as HTML_PLACEHOLDER_ATTR,
1768
+ Bt as HeadlessAdapter,
1769
+ x as HeadlessContext,
1770
+ ct as HeadlessElement,
1771
+ ye as HeadlessPortal,
1772
+ at as HeadlessText,
1773
+ Et as LazyUnless,
1774
+ Pe as LazyWhen,
1775
+ _s as MapSignal,
1776
+ oe as MemoryStore,
1777
+ pe as NODE_PLACEHOLDER_ATTR,
1778
+ As as NotEmpty,
1779
+ Ct as OnBrowserCtx,
1780
+ mt as OnChecked,
1781
+ gs as OnCtx,
1782
+ U as OnDispose,
1783
+ ws as OnElement,
1784
+ Ts as OnHeadlessCtx,
1785
+ z as OneOf,
1786
+ Ee as OneOfField,
1787
+ as as OneOfKind,
1788
+ us as OneOfTuple,
1789
+ hs as OneOfType,
1790
+ At as OneOfValue,
1791
+ Ss as Portal,
1792
+ I as Prop,
1793
+ bs as Provide,
1794
+ vs as ProvideGlobalProbe,
1795
+ Ot as ProvideProbe,
1796
+ de as ProviderNotFoundError,
1797
+ Ge as RenderingError,
1798
+ xe as Repeat,
1799
+ j as STYLE_PLACEHOLDER_ATTR,
1692
1800
  d as Signal,
1693
- ge as Task,
1694
- Tt as TextNode,
1695
- Xt as Unless,
1696
- Gt as Use,
1697
- ls as UseGlobalProbe,
1698
- dt as UseProbe,
1699
- nt as UseProvider,
1700
- zt as UseProviders,
1801
+ B as TEXT_PLACEHOLDER_ATTR,
1802
+ Se as Task,
1803
+ Ut as TextNode,
1804
+ ys as Unless,
1805
+ ds as Use,
1806
+ Cs as UseGlobalProbe,
1807
+ Dt as UseProbe,
1808
+ St as UseProvider,
1809
+ ps as UseProviders,
1701
1810
  p as Value,
1702
- ve as When,
1703
- ht as WithProvider,
1704
- is as WithProviders,
1705
- je as _getSelfOrParentElement,
1706
- le as _isElement,
1707
- Re as _makeGetter,
1708
- Ve as _makeSetter,
1709
- W as _removeDOMNode,
1710
- de as _signalText,
1711
- fe as _staticText,
1712
- St as animateSignal,
1713
- Ie as animateSignals,
1714
- Ct as aria,
1715
- D as attr,
1716
- xt as dataAttr,
1717
- Lt as emitChecked,
1718
- $t as emitPreventDefault,
1719
- Ht as emitStopImmediatePropagation,
1720
- Nt as emitStopPropagation,
1721
- Ke as emitValue,
1722
- tt as emitValueAsDate,
1723
- st as emitValueAsDateTime,
1724
- et as emitValueAsNumber,
1725
- Le as endInterpolate,
1726
- ee as getWindow,
1727
- $e as guessInterpolate,
1728
- Dt as html,
1729
- Ot as input,
1730
- ke as interpolateDate,
1731
- Ae as interpolateNumber,
1732
- Me as interpolateString,
1733
- _t as localStorageProp,
1734
- G as makeComputed,
1735
- yt as makeComputedOf,
1736
- Pt as makeComputedRecord,
1737
- He as makeEffect,
1738
- wt as makeEffectOf,
1739
- I as makeProp,
1740
- ut as makeProviderMark,
1741
- j as makeSignal,
1742
- Mt as math,
1743
- Et as mathAttr,
1744
- q as on,
1745
- xe as probeMarker,
1746
- ts as render,
1747
- z as renderWithContext,
1748
- u as renderableOfTNode,
1749
- ss as runHeadless,
1750
- vt as sessionStorageProp,
1751
- se as storedProp,
1752
- cs as style,
1753
- At as svg,
1754
- bt as svgAttr
1811
+ Ce as When,
1812
+ xt as WithProvider,
1813
+ Es as WithProviders,
1814
+ Je as _getSelfOrParentElement,
1815
+ fe as _isElement,
1816
+ We as _makeGetter,
1817
+ Ue as _makeSetter,
1818
+ R as _removeDOMNode,
1819
+ we as _signalText,
1820
+ Te as _staticText,
1821
+ Rt as animateSignal,
1822
+ Fe as animateSignals,
1823
+ Jt as aria,
1824
+ O as attr,
1825
+ Wt as dataAttr,
1826
+ es as emitChecked,
1827
+ ts as emitPreventDefault,
1828
+ rs as emitStopImmediatePropagation,
1829
+ ss as emitStopPropagation,
1830
+ yt as emitValue,
1831
+ wt as emitValueAsDate,
1832
+ _t as emitValueAsDateTime,
1833
+ Tt as emitValueAsNumber,
1834
+ Ve as endInterpolate,
1835
+ ie as getWindow,
1836
+ je as guessInterpolate,
1837
+ Xt as html,
1838
+ Yt as input,
1839
+ Re as interpolateDate,
1840
+ Ie as interpolateNumber,
1841
+ Ne as interpolateString,
1842
+ It as localStorageProp,
1843
+ Q as makeComputed,
1844
+ Ht as makeComputedOf,
1845
+ Vt as makeComputedRecord,
1846
+ Be as makeEffect,
1847
+ kt as makeEffectOf,
1848
+ N as makeProp,
1849
+ Pt as makeProviderMark,
1850
+ J as makeSignal,
1851
+ Zt as math,
1852
+ zt as mathAttr,
1853
+ G as on,
1854
+ De as probeMarker,
1855
+ jt as render,
1856
+ Z as renderWithContext,
1857
+ f as renderableOfTNode,
1858
+ Ft as restoreTempoPlaceholders,
1859
+ qt as runHeadless,
1860
+ Nt as sessionStorageProp,
1861
+ le as storedProp,
1862
+ Ps as style,
1863
+ Qt as svg,
1864
+ Gt as svgAttr
1755
1865
  };