@tempots/ui 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.cjs +1 -1
  2. package/index.js +736 -1357
  3. package/package.json +2 -2
package/index.js CHANGED
@@ -1,626 +1,5 @@
1
- var _e = Object.defineProperty, Ae = (t, e, n) => e in t ? _e(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, h = (t, e, n) => Ae(t, typeof e != "symbol" ? e + "" : e, n);
2
- const E = class {
3
- /**
4
- * Represents a signal with a value of type T.
5
- *
6
- * @param value - The initial value of the signal.
7
- * @param equals - A function that determines whether two values of type T are equal.
8
- * @public
9
- */
10
- constructor(e, n) {
11
- h(this, "$__signal__", !0), h(this, "_value"), h(this, "_derivatives", []), h(this, "_onValueListeners", []), h(this, "_onDisposeListeners", []), h(this, "get", () => this._value), h(this, "hasListeners", () => this._onValueListeners.length > 0), h(this, "on", (s) => (s(this.get()), this._onValueListeners.push(s), () => {
12
- this._onValueListeners.splice(this._onValueListeners.indexOf(s), 1);
13
- })), h(this, "_setAndNotify", (s, o) => {
14
- const i = this.equals(this._value, s);
15
- i || (this._value = s), (o || !i) && this._onValueListeners.forEach((r) => r(s));
16
- }), h(this, "_disposed", !1), h(this, "isDisposed", () => this._disposed), h(this, "onDispose", (s) => {
17
- this._onDisposeListeners.push(s);
18
- }), h(this, "dispose", () => {
19
- this._disposed || (this._disposed = !0, this._onDisposeListeners.forEach((s) => s()), this._onDisposeListeners.length = 0, this._derivatives.length = 0);
20
- }), h(this, "map", (s, o = (i, r) => i === r) => {
21
- const i = new rt(() => {
22
- try {
23
- return s(this.get());
24
- } catch (r) {
25
- throw console.error("Error in Signal.map:", r), r;
26
- }
27
- }, o);
28
- return this.setDerivative(i), i;
29
- }), h(this, "flatMap", (s, o = (i, r) => i === r) => {
30
- const i = new rt(() => {
31
- try {
32
- return s(this.get()).get();
33
- } catch (r) {
34
- throw console.error("Error in Signal.flatMap:", r), r;
35
- }
36
- }, o);
37
- return this.setDerivative(i), i;
38
- }), h(this, "tap", (s) => this.map((o) => (s(o), o))), h(this, "at", (s) => this.map((o) => o[s])), h(this, "$", new Proxy(this, {
39
- /**
40
- * Retrieves the signal with the specified key.
41
- * @param _ - The target object.
42
- * @param key - The key of the signal.
43
- * @returns The signal associated with the key.
44
- */
45
- get: (s, o) => this.at(o)
46
- })), h(this, "filter", (s, o) => {
47
- let i = o ?? this.get();
48
- const r = new rt(() => {
49
- try {
50
- const c = this.get();
51
- return i = s(c) ? c : i;
52
- } catch (c) {
53
- throw console.error("Error in Signal.filter:", c), c;
54
- }
55
- }, this.equals);
56
- return this.setDerivative(r), r;
57
- }), h(this, "filterMap", (s, o, i = (r, c) => r === c) => {
58
- let r = o;
59
- const c = new rt(() => {
60
- try {
61
- const l = this.get();
62
- return r = s(l) ?? r;
63
- } catch (l) {
64
- throw console.error("Error in Signal.filterMap:", l), l;
65
- }
66
- }, i);
67
- return this.setDerivative(c), c;
68
- }), h(this, "mapAsync", (s, o, i, r = (c, l) => c === l) => {
69
- const c = D(o, r);
70
- let l = 0, a = new AbortController();
71
- return c.onDispose(
72
- this.on(async (f) => {
73
- const u = ++l;
74
- a.abort(), a = new AbortController();
75
- try {
76
- const p = await s(f, { abortSignal: a.signal });
77
- u === l && c.set(p);
78
- } catch (p) {
79
- if (u === l)
80
- if (i != null)
81
- c.set(i(p));
82
- else
83
- throw p;
84
- }
85
- })
86
- ), c;
87
- }), h(this, "mapMaybe", (s, o) => this.map((i) => s(i) ?? o)), h(this, "feedProp", (s, o = !1) => {
88
- const i = this.on(s.set);
89
- return s.onDispose(i), o ? this.onDispose(s.dispose) : this.onDispose(i), s;
90
- }), h(this, "deriveProp", (s = !0) => this.feedProp(D(this.get()), s)), h(this, "count", () => {
91
- let s = 0;
92
- return this.map(() => ++s);
93
- }), h(this, "setDerivative", (s) => {
94
- this._derivatives.push(s), s.onDispose(() => {
95
- this._derivatives.splice(
96
- this._derivatives.indexOf(s),
97
- 1
98
- );
99
- }), s.onDispose(this.on(s.setDirty)), this.onDispose(s.dispose);
100
- }), this.equals = n, this._value = e;
101
- }
102
- /**
103
- * Gets the value of the signal.
104
- * @returns The current value of the signal.
105
- */
106
- get value() {
107
- return this._value;
108
- }
109
- };
110
- h(E, "ofPromise", (t, e, n, s = (o, i) => o === i) => {
111
- const o = new E(e, s);
112
- return t.then((i) => o._setAndNotify(i, !1)).catch((i) => {
113
- n != null ? o._setAndNotify(n(i), !1) : console.error(
114
- "Unhandled promise rejection in Signal.ofPromise:",
115
- i
116
- );
117
- }), o;
118
- }), /**
119
- * Checks if a value is a Signal.
120
- *
121
- * @param value - The value to check.
122
- * @returns `true` if the value is a Signal, `false` otherwise.
123
- */
124
- h(E, "is", (t) => (
125
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
126
- t != null && t.$__signal__ === !0
127
- )), /**
128
- * Wraps a value or a Signal instance into a Signal.
129
- * If the value is already a Signal, it returns the value itself.
130
- * If the value is not a Signal, it creates a new Signal instance with the given value.
131
- *
132
- * @typeParam O - The type of the value.
133
- * @param value - The value or Signal instance to wrap.
134
- * @param equals - A function that determines if two values are equal. Defaults to strict equality (===).
135
- * @returns A Signal instance.
136
- */
137
- h(E, "wrap", (t, e = (n, s) => n === s) => E.is(t) ? t : new E(t, e)), /**
138
- * Wraps a value in a `Signal` if it is not already a `Signal`.
139
- * If the value is `null` or `undefined`, it returns `null` or `undefined` respectively.
140
- * @param value - The value to wrap or check.
141
- * @returns The wrapped value if it is not `null` or `undefined`, otherwise `null` or `undefined`.
142
- */
143
- h(E, "maybeWrap", (t) => t == null ? t : E.wrap(t)), /**
144
- * Unwraps a value from a `Signal` if it is a `Signal`, otherwise returns the value as is.
145
- *
146
- * @param value - The value to unwrap.
147
- * @returns The unwrapped value.
148
- */
149
- h(E, "unwrap", (t) => E.is(t) ? t.get() : t), /**
150
- * Maps the value of a `Signal` or a regular value using the provided mapping function.
151
- * If the input value is a `Signal`, the mapping function is applied to its value.
152
- * If the input value is not a `Signal`, the mapping function is directly applied to the value.
153
- *
154
- * @param value - The input value to be mapped.
155
- * @param fn - The mapping function to be applied to the value.
156
- * @returns A new `Signal` with the mapped value if the input value is a `Signal`,
157
- * otherwise, the result of applying the mapping function to the value.
158
- *
159
- * @typeParam N - The type of the input value.
160
- * @typeParam O - The type of the mapped value.
161
- */
162
- h(E, "map", (t, e) => E.is(t) ? t.map(e) : e(t));
163
- let A = E;
164
- const Le = typeof queueMicrotask == "function" ? queueMicrotask : (t) => Promise.resolve().then(t);
165
- class rt extends A {
166
- /**
167
- * Represents a Signal object.
168
- * @param _fn - The function that returns the value of the signal.
169
- * @param equals - The function used to compare two values of type T for equality.
170
- */
171
- constructor(e, n) {
172
- super(void 0, n), h(this, "$__computed__", !0), h(this, "_isDirty", !1), h(this, "setDirty", () => {
173
- this._isDirty || this._disposed || (this._isDirty = !0, this._derivatives.forEach((s) => s.setDirty()), this._scheduleNotify());
174
- }), h(this, "_scheduleCount", 0), h(this, "_scheduleNotify", () => {
175
- const s = ++this._scheduleCount;
176
- Le(() => {
177
- this._scheduleCount !== s || this._disposed !== !1 || this._isDirty && (this._isDirty = !1, this._setAndNotify(this._fn(), !1));
178
- });
179
- }), h(this, "get", () => (this._isDirty && (this._isDirty = !1, this._value = this._fn(), this._setAndNotify(this._value, !0)), this._value)), this._fn = e, this.setDirty();
180
- }
181
- /**
182
- * Checks if a value is an instance of `Computed`.
183
- *
184
- * @param value - The value to check.
185
- * @returns `true` if the value is an instance of `Computed`, `false` otherwise.
186
- */
187
- static is(e) {
188
- return e != null && e.$__computed__ === !0;
189
- }
190
- /** {@inheritDoc Signal.value} */
191
- get value() {
192
- return this.get();
193
- }
194
- }
195
- const $t = class Ft extends A {
196
- constructor() {
197
- super(...arguments), h(this, "$__prop__", !0), h(this, "set", (e) => {
198
- this._setAndNotify(e, !1);
199
- }), h(this, "update", (e) => {
200
- this._setAndNotify(e(this.get()), !1);
201
- }), h(this, "reducer", (e, ...n) => {
202
- const s = this;
203
- return function o(i) {
204
- const r = s.value;
205
- s.update((c) => e(c, i)), !s.equals(r, s.value) && n.forEach(
206
- (c) => c({
207
- previousState: r,
208
- state: s.value,
209
- action: i,
210
- dispatch: o
211
- })
212
- );
213
- };
214
- }), h(this, "iso", (e, n, s = (o, i) => o === i) => {
215
- const o = new Ft(e(this.get()), s);
216
- return o.onDispose(this.on((i) => o.set(e(i)))), o.on((i) => this._setAndNotify(n(i), !1)), o;
217
- }), h(this, "atProp", (e) => this.iso(
218
- (n) => n[e],
219
- (n) => ({ ...this.value, [e]: n })
220
- ));
221
- }
222
- /**
223
- * Access for the current value of the property.
224
- */
225
- get value() {
226
- return this.get();
227
- }
228
- set value(e) {
229
- this._setAndNotify(e, !1);
230
- }
231
- };
232
- h($t, "is", (t) => (
233
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
234
- t != null && t.$__prop__ === !0
235
- ));
236
- let Ee = $t;
237
- const D = (t, e = (n, s) => n === s) => new Ee(t, e), Se = (t, e = (n, s) => n === s) => new A(t, e), Vt = /* @__PURE__ */ new Set(["checked", "disabled", "hidden", "selected"]), Wt = /* @__PURE__ */ new Set([
238
- "rowSpan",
239
- "colSpan",
240
- "tabIndex",
241
- "valueAsNumber"
242
- ]), Ht = /* @__PURE__ */ new Set(["valueAsDate"]), zt = /* @__PURE__ */ new Set([
243
- "value",
244
- "textContent",
245
- "innerText",
246
- "innerHTML",
247
- "outerHTML",
248
- "className",
249
- "classList"
250
- ]), yt = /* @__PURE__ */ new Map(), G = (t, e) => {
251
- if (yt.has(t))
252
- return yt.get(t);
253
- {
254
- const n = e(t);
255
- return yt.set(t, n), n;
256
- }
257
- }, Re = (t) => (e, n) => {
258
- n == null ? e[t] = null : e[t] = !!n;
259
- }, Oe = (t) => (e, n) => {
260
- n == null ? e[t] = null : e[t] = Number(n);
261
- }, Pe = (t) => (e, n) => {
262
- n == null ? e[t] = null : e[t] = n;
263
- }, De = (t) => (e, n) => {
264
- n == null ? e[t] = null : e[t] = String(n);
265
- }, Ce = (t) => (e, n) => {
266
- n == null ? e.removeAttribute(t) : e.setAttribute(t, n);
267
- }, Bt = (t) => Vt.has(t) ? G(t, Re) : Wt.has(t) ? G(t, Oe) : Ht.has(t) ? G(t, Pe) : zt.has(t) ? G(t, De) : G(t, Ce), It = (t) => (e) => Vt.has(t) ? !!e[t] : Wt.has(t) ? Number(e[t]) : Ht.has(t) ? e[t] : zt.has(t) ? String(e[t]) : e.getAttribute(t), j = (t) => {
268
- const e = t;
269
- e && e.onblur && (e.onblur = null), !(!t || t.ownerDocument === void 0) && t.parentElement && t.parentElement.removeChild(t);
270
- };
271
- function Te(t, e, n) {
272
- let s = t.target;
273
- for (; s != null && !(s instanceof HTMLAnchorElement); )
274
- s = s.parentElement;
275
- if (s == null) return !0;
276
- const o = s;
277
- if (t.button !== 0 || t.ctrlKey || t.metaKey || o.target !== "_self" && o.target !== "" || o.getAttribute("download") != null)
278
- return !0;
279
- if (n) {
280
- const { pathname: i, search: r, hash: c } = o, l = i + r + c;
281
- if (o.getAttribute("href") !== l || e === !0 && !/\/[^/.]*$/.test(i) || Array.isArray(e) && !e.some((a) => i.endsWith(a)))
282
- return !0;
283
- }
284
- return !1;
285
- }
286
- const ke = (t, {
287
- checkExtension: e = [".html"],
288
- checkExternalUrl: n = !0
289
- } = {}) => (s) => {
290
- Te(s, e, n) || t() && s.preventDefault();
291
- }, Me = (t) => (e) => {
292
- Yt(e);
293
- const n = e.createText(t);
294
- return e.appendOrInsert(n), (s) => {
295
- s && j(n);
296
- };
297
- }, Ne = (t) => (e) => {
298
- Yt(e);
299
- const n = e.createText(t.value);
300
- e.appendOrInsert(n);
301
- const s = t.on((o) => n.data = o);
302
- return (o) => {
303
- s(), o && j(n);
304
- };
305
- }, U = (...t) => (e) => {
306
- const n = t.map((s) => b(s)(e));
307
- return (s) => {
308
- n.forEach((o) => o(s));
309
- };
310
- }, Q = () => () => {
311
- }, $e = (t) => (e) => (Kt(e), e.element.classList.add(...t), (n) => {
312
- n && e.element.classList.remove(...t);
313
- }), Fe = (t) => (e) => {
314
- Kt(e);
315
- const n = e.element;
316
- let s = [];
317
- const o = t.on((i) => {
318
- s.forEach((r) => n.classList.remove(r)), s = (i ?? "").split(" ").filter((r) => r.length > 0), n.classList.add(...s);
319
- });
320
- return (i) => {
321
- o(), i && s.forEach((r) => n.classList.remove(r)), s.length = 0;
322
- };
323
- }, et = (t, e) => {
324
- const n = Bt(t), s = It(t);
325
- return (o) => {
326
- Jt(o, t);
327
- const i = s(o.element);
328
- return n(o.element, e), (r) => {
329
- r && n(o.element, i);
330
- };
331
- };
332
- }, nt = (t, e) => {
333
- const n = Bt(t), s = It(t);
334
- return (o) => {
335
- Jt(o, t);
336
- const i = s(o.element), r = e.on((c) => n(o.element, c));
337
- return (c) => {
338
- r(), c && n(o.element, i);
339
- };
340
- };
341
- }, bt = new Proxy(
342
- {},
343
- {
344
- /**
345
- * Creates a renderable component for the specified attribute.
346
- *
347
- * Generally using multiple attributes with the same name is not recommended.
348
- * `class` is the exception and can be used multiple times.
349
- *
350
- * @param _ - The target object.
351
- * @param name - The name of the attribute.
352
- * @returns The renderable component for the specified attribute.
353
- *
354
- */
355
- get: (t, e) => e === "class" ? (n) => A.is(n) ? Fe(n) : $e(
356
- (n ?? "").split(" ").filter((s) => s.length > 0)
357
- ) : (n) => A.is(n) ? nt(
358
- e,
359
- n
360
- ) : et(
361
- e,
362
- n
363
- )
364
- }
365
- );
366
- new Proxy(
367
- {},
368
- {
369
- /**
370
- * Creates a renderable component for the specified `data-?` attribute.
371
- *
372
- * @param _ - The target object.
373
- * @param name - The name of the data attribute.
374
- * @returns The renderable component for the specified attribute.
375
- *
376
- */
377
- get: (t, e) => (n) => A.is(n) ? nt(
378
- `data-${e}`,
379
- n
380
- ) : et(`data-${e}`, n)
381
- }
382
- );
383
- new Proxy(
384
- {},
385
- {
386
- /**
387
- * Creates a renderable component for the specified `aria-?` attribute.
388
- *
389
- * @param _ - The target object.
390
- * @param name - The name of the aria attribute.
391
- * @returns The renderable component for the specified attribute.
392
- *
393
- */
394
- get: (t, e) => (n) => A.is(n) ? nt(
395
- `aria-${e}`,
396
- n
397
- ) : et(
398
- `aria-${e}`,
399
- n
400
- )
401
- }
402
- );
403
- new Proxy(
404
- {},
405
- {
406
- /**
407
- * Creates a renderable component for the specified `svg` attribute.
408
- *
409
- * @param _ - The target object.
410
- * @param name - The name of the SVG attribute.
411
- * @returns The renderable component for the specified attribute.
412
- *
413
- */
414
- get: (t, e) => (n) => A.is(n) ? nt(
415
- e,
416
- n
417
- ) : et(
418
- e,
419
- n
420
- )
421
- }
422
- );
423
- new Proxy(
424
- {},
425
- {
426
- /**
427
- * Creates a renderable component for the specified `math` attribute.
428
- *
429
- * @param name - The name of the Math attribute.
430
- * @returns The renderable component for the specified attribute.
431
- *
432
- */
433
- get: (t, e) => (n) => A.is(n) ? nt(
434
- e,
435
- n
436
- ) : et(
437
- e,
438
- n
439
- )
440
- }
441
- );
442
- const b = (t) => t == null ? Q : Array.isArray(t) ? U(...t.map(b)) : typeof t == "string" ? Me(t) : A.is(t) ? Ne(t) : t, qt = (t, ...e) => (n) => {
443
- const s = n.createElement(t, void 0);
444
- n.isFirstLevel && J() && Xt(s), n.appendOrInsert(s), n = n.withElement(s);
445
- const o = e.map((i) => b(i)(n));
446
- return (i) => {
447
- o.forEach((r) => r(!1)), i && j(s);
448
- };
449
- }, jt = (t, e, ...n) => (s) => {
450
- const o = s.createElement(t, e);
451
- s.isFirstLevel && J() && Xt(o), s.appendOrInsert(o), s = s.withElement(o);
452
- const i = n.map((r) => b(r)(s));
453
- return (r) => {
454
- i.forEach((c) => c(!1)), r && j(o);
455
- };
456
- }, Ut = new Proxy(
457
- {},
458
- {
459
- /**
460
- * Creates a renderable that represents an HTML element.
461
- * @param tagName - The HTML tag name.
462
- * @returns A renderable function that creates and appends the HTML element to the DOM.
463
- */
464
- get: (t, e) => (...n) => qt(e, n.flatMap(b))
465
- }
466
- );
467
- new Proxy(
468
- {},
469
- {
470
- /**
471
- * Creates a renderable that represents an HTMLInput element.
472
- * @param type - The input type name.
473
- * @returns A renderable function that creates and appends the HTMLInput element to the DOM.
474
- */
475
- get: (t, e) => (...n) => qt("input", bt.type(e), ...n)
476
- }
477
- );
478
- const Ve = "http://www.w3.org/2000/svg";
479
- new Proxy(
480
- {},
481
- {
482
- /**
483
- * Creates a renderable that represents an SVG element.
484
- * @param tagName - The SVG tag name.
485
- * @returns A renderable function that creates and appends the SVG element to the DOM.
486
- */
487
- get: (t, e) => (...n) => jt(e, Ve, n.flatMap(b))
488
- }
489
- );
490
- const We = "http://www.w3.org/1998/Math/MathML";
491
- new Proxy(
492
- {},
493
- {
494
- /**
495
- * Creates a renderable that represents an Math element.
496
- * @param tagName - The Math tag name.
497
- * @returns A renderable function that creates and appends the Math element to the DOM.
498
- */
499
- get: (t, e) => (...n) => jt(e, We, n.flatMap(b))
500
- }
501
- );
502
- const Pt = "data-tempo-attr", He = "data-tempo-class", ze = "data-tempo-node", Be = "data-tempo-text", Ie = (t, e) => {
503
- const n = t.getAttribute(e);
504
- if (n != null) {
505
- const s = t.getAttribute(Pt) ?? "{}", o = { ...JSON.parse(s), name: n };
506
- t.setAttribute(
507
- Pt,
508
- JSON.stringify(o).replace(/"/g, """)
509
- );
510
- }
511
- }, Jt = (t, e) => {
512
- J() && t.isFirstLevel && Ie(t.element, e);
513
- };
514
- function qe(t) {
515
- t.setAttribute(He, t.className);
516
- }
517
- const Kt = (t) => {
518
- J() && t.isFirstLevel && qe(t.element);
519
- }, Xt = (t) => {
520
- t.setAttribute(ze, "");
521
- }, je = (t) => {
522
- t.setAttribute(Be, t.textContent ?? "");
523
- }, Yt = (t) => {
524
- J() && t.isFirstLevel && je(t.element);
525
- }, Ue = () => {
526
- const t = globalThis;
527
- return t.__tempoSSR__ == null && (t.__tempoSSR__ = {
528
- isSSR: !1,
529
- counter: 0
530
- }), t.__tempoSSR__;
531
- }, Je = (t) => Ue()[t], J = () => Je("isSSR"), Ke = (t, e) => (n) => (n.element.addEventListener(t, e), (s) => {
532
- s && n.element.removeEventListener(t, e);
533
- }), Gt = new Proxy(
534
- {},
535
- {
536
- /**
537
- * @param name - The name of the event handler.
538
- * @param fn - The function to call when the event is triggered.
539
- * @returns A `Renderable` function that adds the event listener to the element.
540
- */
541
- get: (t, e) => (n) => Ke(e, n)
542
- }
543
- ), Zt = (t, e) => (n) => {
544
- n = n.makeRef();
545
- let s, o;
546
- const i = t.map((l) => Object.keys(l)[0]);
547
- let r;
548
- const c = i.on((l) => {
549
- if (l !== r) {
550
- o == null || o.dispose(), s == null || s(!0), o = t.map((f) => f[l]);
551
- const a = e[l](o);
552
- s = b(a)(n), r = l;
553
- }
554
- });
555
- return (l) => {
556
- c(), l && n.reference != null && j(n.reference), s == null || s(!0);
557
- };
558
- }, Xe = (t, e, n) => Zt(
559
- t.map((s) => ({ [s[e]]: s })),
560
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
561
- n
562
- ), Ye = (t, e) => {
563
- const n = t.map(([s, o]) => ({ [s]: o }));
564
- return Zt(n, e);
565
- }, Qt = (t, e) => Xe(t, "type", e), Ge = (t, e) => (n) => {
566
- const s = Object.values(t).reduce((o, i) => {
567
- const r = n.getProvider(i);
568
- if (r == null)
569
- throw new Error(`No provider found for mark: ${i.description}`);
570
- return o[i] = r, o;
571
- }, {});
572
- return b(e(s))(n);
573
- }, te = (t, e) => Ge([t], (n) => b(e(n[t]))), Ze = (t, e, n) => (s) => {
574
- s = s.makeRef();
575
- let o = null, i = !1;
576
- const r = D(null), c = t.on((l) => {
577
- l == null ? (o == null || o(!0), o = b((n == null ? void 0 : n()) ?? Q)(s), i = !1) : (r.value = l, i || (o == null || o(!0), o = b(e(r))(s), i = !0));
578
- });
579
- return (l) => {
580
- c(), o == null || o(l), l && s.reference && j(s.reference);
581
- };
582
- }, st = (t) => (e) => (n) => t(n, e), ee = (t, e, n) => Ze(
583
- t.map((s) => s ? !0 : null),
584
- () => e,
585
- n != null ? () => n : void 0
586
- ), ne = (t) => (e) => t(e.element) ?? (() => {
587
- }), Qe = (t, e) => {
588
- const n = t(e);
589
- return () => n(!0);
590
- }, se = (t, e) => (n) => {
591
- const s = n.document.querySelector(t);
592
- if (s === null)
593
- throw new Error(`Cannot find element by selector for portal: ${t}`);
594
- return Qe(
595
- b(e),
596
- n.withElement(s).withFirstLevel()
597
- );
598
- }, oe = (t) => Symbol(t), tn = (t, e) => (n) => b(e)(n.withProviders(t)), ie = (t, e, n) => tn({ [t]: e }, b(n)), en = (t, e) => (n) => {
599
- const s = n.element, o = s.style.getPropertyValue(t);
600
- return s.style.setProperty(t, e), (i) => {
601
- i && s.style.setProperty(t, o);
602
- };
603
- }, nn = (t, e) => (n) => {
604
- const s = n.element, o = s.style.getPropertyValue(t);
605
- return e.on((i) => s.style.setProperty(t, i)), (i) => {
606
- i && s.style.setProperty(t, o);
607
- };
608
- };
609
- new Proxy(
610
- {},
611
- {
612
- /**
613
- * Creates a renderable component for the specified `style` property.
614
- *
615
- * @param _ - The target object.
616
- * @param name - The name of the CSS style property.
617
- * @returns The renderable component for the specified attribute.
618
- *
619
- */
620
- get: (t, e) => (n) => A.is(n) ? nn(e, n) : en(e, n)
621
- }
622
- );
623
- const re = oe("LocationProvider"), sn = () => {
1
+ import { makeProviderMark as Et, makeProp as B, Fragment as X, OnUnmount as q, WithProvider as Lt, UseProvider as St, renderableOfTNode as nt, html as Tt, on as Ct, handleAnchorClick as Gt, Signal as ot, attr as kt, Empty as ft, OneOfType as Pt, makeSignal as Qt, Portal as Ft, isSSR as Zt, OnMount as Mt, When as Dt, OneOfTuple as te } from "@tempots/dom";
2
+ const Wt = Et("LocationProvider"), ee = () => {
624
3
  const t = (window == null ? void 0 : window.location.hash) === "" ? void 0 : (window == null ? void 0 : window.location.hash.substring(1)) ?? void 0;
625
4
  return {
626
5
  pathname: (window == null ? void 0 : window.location.pathname) ?? "",
@@ -629,98 +8,98 @@ const re = oe("LocationProvider"), sn = () => {
629
8
  ),
630
9
  hash: t
631
10
  };
632
- }, on = (t, e) => t.pathname === e.pathname && JSON.stringify(t.search) === JSON.stringify(e.search) && t.hash === e.hash, rn = (t) => {
633
- const e = new URL(t, (window == null ? void 0 : window.location.toString()) ?? ""), n = Object.fromEntries(e.searchParams.entries());
634
- let s = e.hash;
635
- return s.startsWith("#") && (s = s.substring(1)), {
11
+ }, ne = (t, e) => t.pathname === e.pathname && JSON.stringify(t.search) === JSON.stringify(e.search) && t.hash === e.hash, oe = (t) => {
12
+ const e = new URL(t, (window == null ? void 0 : window.location.toString()) ?? ""), o = Object.fromEntries(e.searchParams.entries());
13
+ let n = e.hash;
14
+ return n.startsWith("#") && (n = n.substring(1)), {
636
15
  pathname: e.pathname,
637
- search: n,
638
- hash: s === "" ? void 0 : s
16
+ search: o,
17
+ hash: n === "" ? void 0 : n
639
18
  };
640
- }, cn = (t, e) => {
641
- const n = rn(e);
642
- return t.set(n), t;
643
- }, ln = (t) => {
644
- const n = new URLSearchParams(t.search).toString(), s = t.hash;
645
- return `${t.pathname}${n ? `?${n}` : ""}${s ? `#${s}` : ""}`;
646
- }, an = () => {
647
- const t = D(sn(), on), e = () => {
648
- let n = (window == null ? void 0 : window.location.hash) ?? "";
649
- n.startsWith("#") && (n = n.substring(1));
650
- const s = {
19
+ }, ie = (t, e) => {
20
+ const o = oe(e);
21
+ return t.set(o), t;
22
+ }, re = (t) => {
23
+ const o = new URLSearchParams(t.search).toString(), n = t.hash;
24
+ return `${t.pathname}${o ? `?${o}` : ""}${n ? `#${n}` : ""}`;
25
+ }, se = () => {
26
+ const t = B(ee(), ne), e = () => {
27
+ let o = (window == null ? void 0 : window.location.hash) ?? "";
28
+ o.startsWith("#") && (o = o.substring(1));
29
+ const n = {
651
30
  pathname: (window == null ? void 0 : window.location.pathname) ?? "",
652
31
  search: Object.fromEntries(
653
32
  new URLSearchParams((window == null ? void 0 : window.location.search) ?? "").entries()
654
33
  ),
655
- hash: n === "" ? void 0 : n
34
+ hash: o === "" ? void 0 : o
656
35
  };
657
- t.set(s);
36
+ t.set(n);
658
37
  };
659
38
  return window == null || window.addEventListener("popstate", e), t.onDispose(() => {
660
39
  window == null || window.removeEventListener("popstate", e);
661
- }), t.on((n) => {
662
- window == null || window.history.pushState({}, "", ln(n));
40
+ }), t.on((o) => {
41
+ window == null || window.history.pushState({}, "", re(o));
663
42
  }), t;
664
- }, Qn = (t) => {
665
- const e = an();
666
- return U(
667
- st(e.dispose),
668
- ie(re, e, t)
43
+ }, Ke = (t) => {
44
+ const e = se();
45
+ return X(
46
+ q(e.dispose),
47
+ Lt(Wt, e, t)
669
48
  );
670
- }, ce = (t) => te(re, (e) => (n) => {
671
- const s = D(e.value, e.equals);
672
- e.feedProp(s), s.on(e.set);
673
- const o = b(t(s))(n);
674
- return (i) => {
675
- s.dispose(), o(i);
49
+ }, Nt = (t) => St(Wt, (e) => (o) => {
50
+ const n = B(e.value, e.equals);
51
+ e.feedProp(n), n.on(e.set);
52
+ const i = nt(t(n))(o);
53
+ return (r) => {
54
+ n.dispose(), i(r);
676
55
  };
677
- }), ts = (t, ...e) => ce((n) => Ut.a(
678
- Gt.click(
679
- ke(() => (cn(n, A.unwrap(t)), !0))
56
+ }), Ge = (t, ...e) => Nt((o) => Tt.a(
57
+ Ct.click(
58
+ Gt(() => (ie(o, ot.unwrap(t)), !0))
680
59
  ),
681
- bt.href(t),
60
+ kt.href(t),
682
61
  ...e
683
- )), le = oe("Appearance"), es = (t) => {
684
- const e = window.matchMedia != null && window.matchMedia("(prefers-color-scheme: dark)").matches, n = D(e ? "dark" : "light"), s = (i) => {
685
- n.set(i.matches ? "dark" : "light");
686
- }, o = window.matchMedia != null ? window.matchMedia("(prefers-color-scheme: dark)") : void 0;
687
- return o == null || o.addEventListener("change", s), U(
688
- ie(le, n, t),
689
- st(() => o == null ? void 0 : o.removeEventListener("change", s))
62
+ )), $t = Et("Appearance"), Qe = (t) => {
63
+ const e = window.matchMedia != null && window.matchMedia("(prefers-color-scheme: dark)").matches, o = B(e ? "dark" : "light"), n = (r) => {
64
+ o.set(r.matches ? "dark" : "light");
65
+ }, i = window.matchMedia != null ? window.matchMedia("(prefers-color-scheme: dark)") : void 0;
66
+ return i == null || i.addEventListener("change", n), X(
67
+ Lt($t, o, t),
68
+ q(() => i == null ? void 0 : i.removeEventListener("change", n))
690
69
  );
691
- }, ns = (t) => te(le, t), un = (t, e) => {
70
+ }, Ze = (t) => St($t, t), ce = (t, e) => {
692
71
  if (typeof e == "function")
693
- return un(t, { success: e });
694
- const n = e.failure ?? ((r) => U(
695
- st(r.on(console.error)),
696
- r.map((c) => `Error: ${c}`)
697
- )), s = e.success, o = e.loading ?? (() => Q), i = e.notAsked ?? (() => Q);
698
- return Qt(A.wrap(t), {
699
- AsyncSuccess: (r) => s(r.$.value),
700
- AsyncFailure: (r) => n(r.$.error),
701
- Loading: (r) => o(r.$.previousValue ?? Se(void 0)),
702
- NotAsked: i
72
+ return ce(t, { success: e });
73
+ const o = e.failure ?? ((s) => X(
74
+ q(s.on(console.error)),
75
+ s.map((c) => `Error: ${c}`)
76
+ )), n = e.success, i = e.loading ?? (() => ft), r = e.notAsked ?? (() => ft);
77
+ return Pt(ot.wrap(t), {
78
+ AsyncSuccess: (s) => n(s.$.value),
79
+ AsyncFailure: (s) => o(s.$.error),
80
+ Loading: (s) => i(s.$.previousValue ?? Qt(void 0)),
81
+ NotAsked: r
703
82
  });
704
- }, ss = (t = 10) => (e) => {
705
- const n = setTimeout(() => {
706
- var s;
707
- (s = e.element) == null || s.focus();
83
+ }, tn = (t = 10) => (e) => {
84
+ const o = setTimeout(() => {
85
+ var n;
86
+ (n = e.element) == null || n.focus();
708
87
  }, t);
709
- return (s) => clearTimeout(n);
710
- }, os = (t = 10) => (e) => {
711
- const n = setTimeout(() => {
712
- var s;
713
- (s = e.element) == null || s.select();
88
+ return (n) => clearTimeout(o);
89
+ }, en = (t = 10) => (e) => {
90
+ const o = setTimeout(() => {
91
+ var n;
92
+ (n = e.element) == null || n.select();
714
93
  }, t);
715
- return (s) => {
716
- clearTimeout(n);
94
+ return (n) => {
95
+ clearTimeout(o);
717
96
  };
718
- }, is = (t) => {
719
- const e = t.element, n = e.style.getPropertyValue(":empty");
720
- return e.style.setProperty(":empty", "display:none"), (s) => {
721
- s && e.style.setProperty(":empty", n);
97
+ }, nn = (t) => {
98
+ const e = t.element, o = e.style.getPropertyValue(":empty");
99
+ return e.style.setProperty(":empty", "display:none"), (n) => {
100
+ n && e.style.setProperty(":empty", o);
722
101
  };
723
- }, rs = (t) => se("head > title", bt.innerText(t)), fn = {
102
+ }, on = (t) => Ft("head > title", kt.innerText(t)), le = {
724
103
  partial: {
725
104
  root: null,
726
105
  rootMargin: "0px",
@@ -731,105 +110,105 @@ const re = oe("LocationProvider"), sn = () => {
731
110
  rootMargin: "0px",
732
111
  threshold: 1
733
112
  }
734
- }, lt = {
113
+ }, G = {
735
114
  partial: /* @__PURE__ */ new Map(),
736
115
  full: /* @__PURE__ */ new Map()
737
- }, Z = {
116
+ }, U = {
738
117
  partial: null,
739
118
  full: null
740
119
  };
741
- function hn(t) {
742
- return Z[t] == null && (Z[t] = new IntersectionObserver((e) => {
743
- e.forEach((n) => {
744
- const s = lt[t].get(n.target);
745
- s == null || s.set(n.isIntersecting);
120
+ function ae(t) {
121
+ return U[t] == null && (U[t] = new IntersectionObserver((e) => {
122
+ e.forEach((o) => {
123
+ const n = G[t].get(o.target);
124
+ n == null || n.set(o.isIntersecting);
746
125
  });
747
- }, fn[t])), Z[t];
748
- }
749
- const dn = (t, e) => {
750
- const n = D(J());
751
- return U(
752
- ne((s) => {
753
- const o = typeof IntersectionObserver < "u" ? hn(t) : null;
754
- return lt[t].set(s, n), o == null || o.observe(s), () => {
755
- var i;
756
- o == null || o.unobserve(s), lt[t].delete(s), lt[t].size === 0 && ((i = Z[t]) == null || i.disconnect(), Z[t] = null);
126
+ }, le[t])), U[t];
127
+ }
128
+ const fe = (t, e) => {
129
+ const o = B(Zt());
130
+ return X(
131
+ Mt((n) => {
132
+ const i = typeof IntersectionObserver < "u" ? ae(t) : null;
133
+ return G[t].set(n, o), i == null || i.observe(n), () => {
134
+ var r;
135
+ i == null || i.unobserve(n), G[t].delete(n), G[t].size === 0 && ((r = U[t]) == null || r.disconnect(), U[t] = null);
757
136
  };
758
137
  }),
759
- st(n.dispose),
760
- b(e(n))
138
+ q(o.dispose),
139
+ nt(e(o))
761
140
  );
762
- }, cs = (t, e, n) => dn(t, (s) => ee(s, e, n ?? Q)), at = Math.min, F = Math.max, ut = Math.round, ct = Math.floor, M = (t) => ({
141
+ }, rn = (t, e, o) => fe(t, (n) => Dt(n, e, o ?? ft)), Q = Math.min, F = Math.max, Z = Math.round, K = Math.floor, C = (t) => ({
763
142
  x: t,
764
143
  y: t
765
- }), pn = {
144
+ }), ue = {
766
145
  left: "right",
767
146
  right: "left",
768
147
  bottom: "top",
769
148
  top: "bottom"
770
- }, mn = {
149
+ }, he = {
771
150
  start: "end",
772
151
  end: "start"
773
152
  };
774
- function Dt(t, e, n) {
775
- return F(t, at(e, n));
153
+ function xt(t, e, o) {
154
+ return F(t, Q(e, o));
776
155
  }
777
- function dt(t, e) {
156
+ function it(t, e) {
778
157
  return typeof t == "function" ? t(e) : t;
779
158
  }
780
- function V(t) {
159
+ function M(t) {
781
160
  return t.split("-")[0];
782
161
  }
783
- function pt(t) {
162
+ function rt(t) {
784
163
  return t.split("-")[1];
785
164
  }
786
- function ae(t) {
165
+ function Vt(t) {
787
166
  return t === "x" ? "y" : "x";
788
167
  }
789
- function ue(t) {
168
+ function zt(t) {
790
169
  return t === "y" ? "height" : "width";
791
170
  }
792
- function I(t) {
793
- return ["top", "bottom"].includes(V(t)) ? "y" : "x";
171
+ function V(t) {
172
+ return ["top", "bottom"].includes(M(t)) ? "y" : "x";
794
173
  }
795
- function fe(t) {
796
- return ae(I(t));
174
+ function Bt(t) {
175
+ return Vt(V(t));
797
176
  }
798
- function gn(t, e, n) {
799
- n === void 0 && (n = !1);
800
- const s = pt(t), o = fe(t), i = ue(o);
801
- let r = o === "x" ? s === (n ? "end" : "start") ? "right" : "left" : s === "start" ? "bottom" : "top";
802
- return e.reference[i] > e.floating[i] && (r = ft(r)), [r, ft(r)];
177
+ function de(t, e, o) {
178
+ o === void 0 && (o = !1);
179
+ const n = rt(t), i = Bt(t), r = zt(i);
180
+ let s = i === "x" ? n === (o ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
181
+ return e.reference[r] > e.floating[r] && (s = tt(s)), [s, tt(s)];
803
182
  }
804
- function wn(t) {
805
- const e = ft(t);
806
- return [xt(t), e, xt(e)];
183
+ function me(t) {
184
+ const e = tt(t);
185
+ return [ut(t), e, ut(e)];
807
186
  }
808
- function xt(t) {
809
- return t.replace(/start|end/g, (e) => mn[e]);
187
+ function ut(t) {
188
+ return t.replace(/start|end/g, (e) => he[e]);
810
189
  }
811
- function yn(t, e, n) {
812
- const s = ["left", "right"], o = ["right", "left"], i = ["top", "bottom"], r = ["bottom", "top"];
190
+ function pe(t, e, o) {
191
+ const n = ["left", "right"], i = ["right", "left"], r = ["top", "bottom"], s = ["bottom", "top"];
813
192
  switch (t) {
814
193
  case "top":
815
194
  case "bottom":
816
- return n ? e ? o : s : e ? s : o;
195
+ return o ? e ? i : n : e ? n : i;
817
196
  case "left":
818
197
  case "right":
819
- return e ? i : r;
198
+ return e ? r : s;
820
199
  default:
821
200
  return [];
822
201
  }
823
202
  }
824
- function vn(t, e, n, s) {
825
- const o = pt(t);
826
- let i = yn(V(t), n === "start", s);
827
- return o && (i = i.map((r) => r + "-" + o), e && (i = i.concat(i.map(xt)))), i;
203
+ function ge(t, e, o, n) {
204
+ const i = rt(t);
205
+ let r = pe(M(t), o === "start", n);
206
+ return i && (r = r.map((s) => s + "-" + i), e && (r = r.concat(r.map(ut)))), r;
828
207
  }
829
- function ft(t) {
830
- return t.replace(/left|right|bottom|top/g, (e) => pn[e]);
208
+ function tt(t) {
209
+ return t.replace(/left|right|bottom|top/g, (e) => ue[e]);
831
210
  }
832
- function xn(t) {
211
+ function we(t) {
833
212
  return {
834
213
  top: 0,
835
214
  right: 0,
@@ -838,259 +217,259 @@ function xn(t) {
838
217
  ...t
839
218
  };
840
219
  }
841
- function bn(t) {
842
- return typeof t != "number" ? xn(t) : {
220
+ function ye(t) {
221
+ return typeof t != "number" ? we(t) : {
843
222
  top: t,
844
223
  right: t,
845
224
  bottom: t,
846
225
  left: t
847
226
  };
848
227
  }
849
- function ht(t) {
228
+ function et(t) {
850
229
  const {
851
230
  x: e,
852
- y: n,
853
- width: s,
854
- height: o
231
+ y: o,
232
+ width: n,
233
+ height: i
855
234
  } = t;
856
235
  return {
857
- width: s,
858
- height: o,
859
- top: n,
236
+ width: n,
237
+ height: i,
238
+ top: o,
860
239
  left: e,
861
- right: e + s,
862
- bottom: n + o,
240
+ right: e + n,
241
+ bottom: o + i,
863
242
  x: e,
864
- y: n
243
+ y: o
865
244
  };
866
245
  }
867
- function Ct(t, e, n) {
246
+ function vt(t, e, o) {
868
247
  let {
869
- reference: s,
870
- floating: o
248
+ reference: n,
249
+ floating: i
871
250
  } = t;
872
- const i = I(e), r = fe(e), c = ue(r), l = V(e), a = i === "y", f = s.x + s.width / 2 - o.width / 2, u = s.y + s.height / 2 - o.height / 2, p = s[c] / 2 - o[c] / 2;
873
- let d;
874
- switch (l) {
251
+ const r = V(e), s = Bt(e), c = zt(s), a = M(e), l = r === "y", u = n.x + n.width / 2 - i.width / 2, f = n.y + n.height / 2 - i.height / 2, m = n[c] / 2 - i[c] / 2;
252
+ let h;
253
+ switch (a) {
875
254
  case "top":
876
- d = {
877
- x: f,
878
- y: s.y - o.height
255
+ h = {
256
+ x: u,
257
+ y: n.y - i.height
879
258
  };
880
259
  break;
881
260
  case "bottom":
882
- d = {
883
- x: f,
884
- y: s.y + s.height
261
+ h = {
262
+ x: u,
263
+ y: n.y + n.height
885
264
  };
886
265
  break;
887
266
  case "right":
888
- d = {
889
- x: s.x + s.width,
890
- y: u
267
+ h = {
268
+ x: n.x + n.width,
269
+ y: f
891
270
  };
892
271
  break;
893
272
  case "left":
894
- d = {
895
- x: s.x - o.width,
896
- y: u
273
+ h = {
274
+ x: n.x - i.width,
275
+ y: f
897
276
  };
898
277
  break;
899
278
  default:
900
- d = {
901
- x: s.x,
902
- y: s.y
279
+ h = {
280
+ x: n.x,
281
+ y: n.y
903
282
  };
904
283
  }
905
- switch (pt(e)) {
284
+ switch (rt(e)) {
906
285
  case "start":
907
- d[r] -= p * (n && a ? -1 : 1);
286
+ h[s] -= m * (o && l ? -1 : 1);
908
287
  break;
909
288
  case "end":
910
- d[r] += p * (n && a ? -1 : 1);
289
+ h[s] += m * (o && l ? -1 : 1);
911
290
  break;
912
291
  }
913
- return d;
292
+ return h;
914
293
  }
915
- const _n = async (t, e, n) => {
294
+ const xe = async (t, e, o) => {
916
295
  const {
917
- placement: s = "bottom",
918
- strategy: o = "absolute",
919
- middleware: i = [],
920
- platform: r
921
- } = n, c = i.filter(Boolean), l = await (r.isRTL == null ? void 0 : r.isRTL(e));
922
- let a = await r.getElementRects({
296
+ placement: n = "bottom",
297
+ strategy: i = "absolute",
298
+ middleware: r = [],
299
+ platform: s
300
+ } = o, c = r.filter(Boolean), a = await (s.isRTL == null ? void 0 : s.isRTL(e));
301
+ let l = await s.getElementRects({
923
302
  reference: t,
924
303
  floating: e,
925
- strategy: o
304
+ strategy: i
926
305
  }), {
927
- x: f,
928
- y: u
929
- } = Ct(a, s, l), p = s, d = {}, g = 0;
930
- for (let w = 0; w < c.length; w++) {
306
+ x: u,
307
+ y: f
308
+ } = vt(l, n, a), m = n, h = {}, p = 0;
309
+ for (let g = 0; g < c.length; g++) {
931
310
  const {
932
- name: y,
933
- fn: m
934
- } = c[w], {
935
- x: v,
311
+ name: w,
312
+ fn: d
313
+ } = c[g], {
314
+ x: y,
936
315
  y: x,
937
- data: L,
938
- reset: _
939
- } = await m({
940
- x: f,
941
- y: u,
942
- initialPlacement: s,
943
- placement: p,
944
- strategy: o,
945
- middlewareData: d,
946
- rects: a,
947
- platform: r,
316
+ data: b,
317
+ reset: v
318
+ } = await d({
319
+ x: u,
320
+ y: f,
321
+ initialPlacement: n,
322
+ placement: m,
323
+ strategy: i,
324
+ middlewareData: h,
325
+ rects: l,
326
+ platform: s,
948
327
  elements: {
949
328
  reference: t,
950
329
  floating: e
951
330
  }
952
331
  });
953
- f = v ?? f, u = x ?? u, d = {
954
- ...d,
955
- [y]: {
956
- ...d[y],
957
- ...L
332
+ u = y ?? u, f = x ?? f, h = {
333
+ ...h,
334
+ [w]: {
335
+ ...h[w],
336
+ ...b
958
337
  }
959
- }, _ && g <= 50 && (g++, typeof _ == "object" && (_.placement && (p = _.placement), _.rects && (a = _.rects === !0 ? await r.getElementRects({
338
+ }, v && p <= 50 && (p++, typeof v == "object" && (v.placement && (m = v.placement), v.rects && (l = v.rects === !0 ? await s.getElementRects({
960
339
  reference: t,
961
340
  floating: e,
962
- strategy: o
963
- }) : _.rects), {
964
- x: f,
965
- y: u
966
- } = Ct(a, p, l)), w = -1);
341
+ strategy: i
342
+ }) : v.rects), {
343
+ x: u,
344
+ y: f
345
+ } = vt(l, m, a)), g = -1);
967
346
  }
968
347
  return {
969
- x: f,
970
- y: u,
971
- placement: p,
972
- strategy: o,
973
- middlewareData: d
348
+ x: u,
349
+ y: f,
350
+ placement: m,
351
+ strategy: i,
352
+ middlewareData: h
974
353
  };
975
354
  };
976
- async function he(t, e) {
977
- var n;
355
+ async function Ht(t, e) {
356
+ var o;
978
357
  e === void 0 && (e = {});
979
358
  const {
980
- x: s,
981
- y: o,
982
- platform: i,
983
- rects: r,
359
+ x: n,
360
+ y: i,
361
+ platform: r,
362
+ rects: s,
984
363
  elements: c,
985
- strategy: l
364
+ strategy: a
986
365
  } = t, {
987
- boundary: a = "clippingAncestors",
988
- rootBoundary: f = "viewport",
989
- elementContext: u = "floating",
990
- altBoundary: p = !1,
991
- padding: d = 0
992
- } = dt(e, t), g = bn(d), y = c[p ? u === "floating" ? "reference" : "floating" : u], m = ht(await i.getClippingRect({
993
- element: (n = await (i.isElement == null ? void 0 : i.isElement(y))) == null || n ? y : y.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(c.floating)),
994
- boundary: a,
995
- rootBoundary: f,
996
- strategy: l
997
- })), v = u === "floating" ? {
998
- x: s,
999
- y: o,
1000
- width: r.floating.width,
1001
- height: r.floating.height
1002
- } : r.reference, x = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(c.floating)), L = await (i.isElement == null ? void 0 : i.isElement(x)) ? await (i.getScale == null ? void 0 : i.getScale(x)) || {
366
+ boundary: l = "clippingAncestors",
367
+ rootBoundary: u = "viewport",
368
+ elementContext: f = "floating",
369
+ altBoundary: m = !1,
370
+ padding: h = 0
371
+ } = it(e, t), p = ye(h), w = c[m ? f === "floating" ? "reference" : "floating" : f], d = et(await r.getClippingRect({
372
+ element: (o = await (r.isElement == null ? void 0 : r.isElement(w))) == null || o ? w : w.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(c.floating)),
373
+ boundary: l,
374
+ rootBoundary: u,
375
+ strategy: a
376
+ })), y = f === "floating" ? {
377
+ x: n,
378
+ y: i,
379
+ width: s.floating.width,
380
+ height: s.floating.height
381
+ } : s.reference, x = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(c.floating)), b = await (r.isElement == null ? void 0 : r.isElement(x)) ? await (r.getScale == null ? void 0 : r.getScale(x)) || {
1003
382
  x: 1,
1004
383
  y: 1
1005
384
  } : {
1006
385
  x: 1,
1007
386
  y: 1
1008
- }, _ = ht(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
387
+ }, v = et(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
1009
388
  elements: c,
1010
- rect: v,
389
+ rect: y,
1011
390
  offsetParent: x,
1012
- strategy: l
1013
- }) : v);
391
+ strategy: a
392
+ }) : y);
1014
393
  return {
1015
- top: (m.top - _.top + g.top) / L.y,
1016
- bottom: (_.bottom - m.bottom + g.bottom) / L.y,
1017
- left: (m.left - _.left + g.left) / L.x,
1018
- right: (_.right - m.right + g.right) / L.x
394
+ top: (d.top - v.top + p.top) / b.y,
395
+ bottom: (v.bottom - d.bottom + p.bottom) / b.y,
396
+ left: (d.left - v.left + p.left) / b.x,
397
+ right: (v.right - d.right + p.right) / b.x
1019
398
  };
1020
399
  }
1021
- const An = function(t) {
400
+ const ve = function(t) {
1022
401
  return t === void 0 && (t = {}), {
1023
402
  name: "flip",
1024
403
  options: t,
1025
404
  async fn(e) {
1026
- var n, s;
405
+ var o, n;
1027
406
  const {
1028
- placement: o,
1029
- middlewareData: i,
1030
- rects: r,
407
+ placement: i,
408
+ middlewareData: r,
409
+ rects: s,
1031
410
  initialPlacement: c,
1032
- platform: l,
1033
- elements: a
411
+ platform: a,
412
+ elements: l
1034
413
  } = e, {
1035
- mainAxis: f = !0,
1036
- crossAxis: u = !0,
1037
- fallbackPlacements: p,
1038
- fallbackStrategy: d = "bestFit",
1039
- fallbackAxisSideDirection: g = "none",
1040
- flipAlignment: w = !0,
1041
- ...y
1042
- } = dt(t, e);
1043
- if ((n = i.arrow) != null && n.alignmentOffset)
414
+ mainAxis: u = !0,
415
+ crossAxis: f = !0,
416
+ fallbackPlacements: m,
417
+ fallbackStrategy: h = "bestFit",
418
+ fallbackAxisSideDirection: p = "none",
419
+ flipAlignment: g = !0,
420
+ ...w
421
+ } = it(t, e);
422
+ if ((o = r.arrow) != null && o.alignmentOffset)
1044
423
  return {};
1045
- const m = V(o), v = I(c), x = V(c) === c, L = await (l.isRTL == null ? void 0 : l.isRTL(a.floating)), _ = p || (x || !w ? [ft(c)] : wn(c)), H = g !== "none";
1046
- !p && H && _.push(...vn(c, w, g, L));
1047
- const xe = [c, ..._], wt = await he(e, y), it = [];
1048
- let X = ((s = i.flip) == null ? void 0 : s.overflows) || [];
1049
- if (f && it.push(wt[m]), u) {
1050
- const $ = gn(o, r, L);
1051
- it.push(wt[$[0]], wt[$[1]]);
424
+ const d = M(i), y = V(c), x = M(c) === c, b = await (a.isRTL == null ? void 0 : a.isRTL(l.floating)), v = m || (x || !g ? [tt(c)] : me(c)), W = p !== "none";
425
+ !m && W && v.push(...ge(c, g, p, b));
426
+ const Jt = [c, ...v], lt = await Ht(e, w), J = [];
427
+ let _ = ((n = r.flip) == null ? void 0 : n.overflows) || [];
428
+ if (u && J.push(lt[d]), f) {
429
+ const P = de(i, s, b);
430
+ J.push(lt[P[0]], lt[P[1]]);
1052
431
  }
1053
- if (X = [...X, {
1054
- placement: o,
1055
- overflows: it
1056
- }], !it.every(($) => $ <= 0)) {
1057
- var Et, St;
1058
- const $ = (((Et = i.flip) == null ? void 0 : Et.index) || 0) + 1, Ot = xe[$];
1059
- if (Ot)
432
+ if (_ = [..._, {
433
+ placement: i,
434
+ overflows: J
435
+ }], !J.every((P) => P <= 0)) {
436
+ var pt, gt;
437
+ const P = (((pt = r.flip) == null ? void 0 : pt.index) || 0) + 1, yt = Jt[P];
438
+ if (yt)
1060
439
  return {
1061
440
  data: {
1062
- index: $,
1063
- overflows: X
441
+ index: P,
442
+ overflows: _
1064
443
  },
1065
444
  reset: {
1066
- placement: Ot
445
+ placement: yt
1067
446
  }
1068
447
  };
1069
- let Y = (St = X.filter((z) => z.overflows[0] <= 0).sort((z, T) => z.overflows[1] - T.overflows[1])[0]) == null ? void 0 : St.placement;
1070
- if (!Y)
1071
- switch (d) {
448
+ let I = (gt = _.filter((N) => N.overflows[0] <= 0).sort((N, S) => N.overflows[1] - S.overflows[1])[0]) == null ? void 0 : gt.placement;
449
+ if (!I)
450
+ switch (h) {
1072
451
  case "bestFit": {
1073
- var Rt;
1074
- const z = (Rt = X.filter((T) => {
1075
- if (H) {
1076
- const k = I(T.placement);
1077
- return k === v || // Create a bias to the `y` side axis due to horizontal
452
+ var wt;
453
+ const N = (wt = _.filter((S) => {
454
+ if (W) {
455
+ const T = V(S.placement);
456
+ return T === y || // Create a bias to the `y` side axis due to horizontal
1078
457
  // reading directions favoring greater width.
1079
- k === "y";
458
+ T === "y";
1080
459
  }
1081
460
  return !0;
1082
- }).map((T) => [T.placement, T.overflows.filter((k) => k > 0).reduce((k, be) => k + be, 0)]).sort((T, k) => T[1] - k[1])[0]) == null ? void 0 : Rt[0];
1083
- z && (Y = z);
461
+ }).map((S) => [S.placement, S.overflows.filter((T) => T > 0).reduce((T, Kt) => T + Kt, 0)]).sort((S, T) => S[1] - T[1])[0]) == null ? void 0 : wt[0];
462
+ N && (I = N);
1084
463
  break;
1085
464
  }
1086
465
  case "initialPlacement":
1087
- Y = c;
466
+ I = c;
1088
467
  break;
1089
468
  }
1090
- if (o !== Y)
469
+ if (i !== I)
1091
470
  return {
1092
471
  reset: {
1093
- placement: Y
472
+ placement: I
1094
473
  }
1095
474
  };
1096
475
  }
@@ -1098,145 +477,145 @@ const An = function(t) {
1098
477
  }
1099
478
  };
1100
479
  };
1101
- async function Ln(t, e) {
480
+ async function be(t, e) {
1102
481
  const {
1103
- placement: n,
1104
- platform: s,
1105
- elements: o
1106
- } = t, i = await (s.isRTL == null ? void 0 : s.isRTL(o.floating)), r = V(n), c = pt(n), l = I(n) === "y", a = ["left", "top"].includes(r) ? -1 : 1, f = i && l ? -1 : 1, u = dt(e, t);
482
+ placement: o,
483
+ platform: n,
484
+ elements: i
485
+ } = t, r = await (n.isRTL == null ? void 0 : n.isRTL(i.floating)), s = M(o), c = rt(o), a = V(o) === "y", l = ["left", "top"].includes(s) ? -1 : 1, u = r && a ? -1 : 1, f = it(e, t);
1107
486
  let {
1108
- mainAxis: p,
1109
- crossAxis: d,
1110
- alignmentAxis: g
1111
- } = typeof u == "number" ? {
1112
- mainAxis: u,
487
+ mainAxis: m,
488
+ crossAxis: h,
489
+ alignmentAxis: p
490
+ } = typeof f == "number" ? {
491
+ mainAxis: f,
1113
492
  crossAxis: 0,
1114
493
  alignmentAxis: null
1115
494
  } : {
1116
495
  mainAxis: 0,
1117
496
  crossAxis: 0,
1118
497
  alignmentAxis: null,
1119
- ...u
498
+ ...f
1120
499
  };
1121
- return c && typeof g == "number" && (d = c === "end" ? g * -1 : g), l ? {
1122
- x: d * f,
1123
- y: p * a
500
+ return c && typeof p == "number" && (h = c === "end" ? p * -1 : p), a ? {
501
+ x: h * u,
502
+ y: m * l
1124
503
  } : {
1125
- x: p * a,
1126
- y: d * f
504
+ x: m * l,
505
+ y: h * u
1127
506
  };
1128
507
  }
1129
- const En = function(t) {
508
+ const Ae = function(t) {
1130
509
  return t === void 0 && (t = 0), {
1131
510
  name: "offset",
1132
511
  options: t,
1133
512
  async fn(e) {
1134
- var n, s;
513
+ var o, n;
1135
514
  const {
1136
- x: o,
1137
- y: i,
1138
- placement: r,
515
+ x: i,
516
+ y: r,
517
+ placement: s,
1139
518
  middlewareData: c
1140
- } = e, l = await Ln(e, t);
1141
- return r === ((n = c.offset) == null ? void 0 : n.placement) && (s = c.arrow) != null && s.alignmentOffset ? {} : {
1142
- x: o + l.x,
1143
- y: i + l.y,
519
+ } = e, a = await be(e, t);
520
+ return s === ((o = c.offset) == null ? void 0 : o.placement) && (n = c.arrow) != null && n.alignmentOffset ? {} : {
521
+ x: i + a.x,
522
+ y: r + a.y,
1144
523
  data: {
1145
- ...l,
1146
- placement: r
524
+ ...a,
525
+ placement: s
1147
526
  }
1148
527
  };
1149
528
  }
1150
529
  };
1151
- }, Sn = function(t) {
530
+ }, Re = function(t) {
1152
531
  return t === void 0 && (t = {}), {
1153
532
  name: "shift",
1154
533
  options: t,
1155
534
  async fn(e) {
1156
535
  const {
1157
- x: n,
1158
- y: s,
1159
- placement: o
536
+ x: o,
537
+ y: n,
538
+ placement: i
1160
539
  } = e, {
1161
- mainAxis: i = !0,
1162
- crossAxis: r = !1,
540
+ mainAxis: r = !0,
541
+ crossAxis: s = !1,
1163
542
  limiter: c = {
1164
- fn: (y) => {
543
+ fn: (w) => {
1165
544
  let {
1166
- x: m,
1167
- y: v
1168
- } = y;
545
+ x: d,
546
+ y
547
+ } = w;
1169
548
  return {
1170
- x: m,
1171
- y: v
549
+ x: d,
550
+ y
1172
551
  };
1173
552
  }
1174
553
  },
1175
- ...l
1176
- } = dt(t, e), a = {
1177
- x: n,
1178
- y: s
1179
- }, f = await he(e, l), u = I(V(o)), p = ae(u);
1180
- let d = a[p], g = a[u];
1181
- if (i) {
1182
- const y = p === "y" ? "top" : "left", m = p === "y" ? "bottom" : "right", v = d + f[y], x = d - f[m];
1183
- d = Dt(v, d, x);
1184
- }
554
+ ...a
555
+ } = it(t, e), l = {
556
+ x: o,
557
+ y: n
558
+ }, u = await Ht(e, a), f = V(M(i)), m = Vt(f);
559
+ let h = l[m], p = l[f];
1185
560
  if (r) {
1186
- const y = u === "y" ? "top" : "left", m = u === "y" ? "bottom" : "right", v = g + f[y], x = g - f[m];
1187
- g = Dt(v, g, x);
561
+ const w = m === "y" ? "top" : "left", d = m === "y" ? "bottom" : "right", y = h + u[w], x = h - u[d];
562
+ h = xt(y, h, x);
563
+ }
564
+ if (s) {
565
+ const w = f === "y" ? "top" : "left", d = f === "y" ? "bottom" : "right", y = p + u[w], x = p - u[d];
566
+ p = xt(y, p, x);
1188
567
  }
1189
- const w = c.fn({
568
+ const g = c.fn({
1190
569
  ...e,
1191
- [p]: d,
1192
- [u]: g
570
+ [m]: h,
571
+ [f]: p
1193
572
  });
1194
573
  return {
1195
- ...w,
574
+ ...g,
1196
575
  data: {
1197
- x: w.x - n,
1198
- y: w.y - s
576
+ x: g.x - o,
577
+ y: g.y - n
1199
578
  }
1200
579
  };
1201
580
  }
1202
581
  };
1203
582
  };
1204
- function K(t) {
1205
- return de(t) ? (t.nodeName || "").toLowerCase() : "#document";
583
+ function H(t) {
584
+ return _t(t) ? (t.nodeName || "").toLowerCase() : "#document";
1206
585
  }
1207
- function S(t) {
586
+ function A(t) {
1208
587
  var e;
1209
588
  return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
1210
589
  }
1211
- function C(t) {
590
+ function L(t) {
1212
591
  var e;
1213
- return (e = (de(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
592
+ return (e = (_t(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
1214
593
  }
1215
- function de(t) {
1216
- return t instanceof Node || t instanceof S(t).Node;
594
+ function _t(t) {
595
+ return t instanceof Node || t instanceof A(t).Node;
1217
596
  }
1218
597
  function O(t) {
1219
- return t instanceof Element || t instanceof S(t).Element;
598
+ return t instanceof Element || t instanceof A(t).Element;
1220
599
  }
1221
- function P(t) {
1222
- return t instanceof HTMLElement || t instanceof S(t).HTMLElement;
600
+ function E(t) {
601
+ return t instanceof HTMLElement || t instanceof A(t).HTMLElement;
1223
602
  }
1224
- function Tt(t) {
1225
- return typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof S(t).ShadowRoot;
603
+ function bt(t) {
604
+ return typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof A(t).ShadowRoot;
1226
605
  }
1227
- function ot(t) {
606
+ function Y(t) {
1228
607
  const {
1229
608
  overflow: e,
1230
- overflowX: n,
1231
- overflowY: s,
1232
- display: o
609
+ overflowX: o,
610
+ overflowY: n,
611
+ display: i
1233
612
  } = R(t);
1234
- return /auto|scroll|overlay|hidden|clip/.test(e + s + n) && !["inline", "contents"].includes(o);
613
+ return /auto|scroll|overlay|hidden|clip/.test(e + n + o) && !["inline", "contents"].includes(i);
1235
614
  }
1236
- function Rn(t) {
1237
- return ["table", "td", "th"].includes(K(t));
615
+ function Oe(t) {
616
+ return ["table", "td", "th"].includes(H(t));
1238
617
  }
1239
- function mt(t) {
618
+ function st(t) {
1240
619
  return [":popover-open", ":modal"].some((e) => {
1241
620
  try {
1242
621
  return t.matches(e);
@@ -1245,31 +624,31 @@ function mt(t) {
1245
624
  }
1246
625
  });
1247
626
  }
1248
- function _t(t) {
1249
- const e = At(), n = R(t);
1250
- return n.transform !== "none" || n.perspective !== "none" || (n.containerType ? n.containerType !== "normal" : !1) || !e && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !e && (n.filter ? n.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((s) => (n.willChange || "").includes(s)) || ["paint", "layout", "strict", "content"].some((s) => (n.contain || "").includes(s));
627
+ function ht(t) {
628
+ const e = dt(), o = R(t);
629
+ return o.transform !== "none" || o.perspective !== "none" || (o.containerType ? o.containerType !== "normal" : !1) || !e && (o.backdropFilter ? o.backdropFilter !== "none" : !1) || !e && (o.filter ? o.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((n) => (o.willChange || "").includes(n)) || ["paint", "layout", "strict", "content"].some((n) => (o.contain || "").includes(n));
1251
630
  }
1252
- function On(t) {
1253
- let e = N(t);
1254
- for (; P(e) && !q(e); ) {
1255
- if (mt(e))
631
+ function Ee(t) {
632
+ let e = k(t);
633
+ for (; E(e) && !z(e); ) {
634
+ if (st(e))
1256
635
  return null;
1257
- if (_t(e))
636
+ if (ht(e))
1258
637
  return e;
1259
- e = N(e);
638
+ e = k(e);
1260
639
  }
1261
640
  return null;
1262
641
  }
1263
- function At() {
642
+ function dt() {
1264
643
  return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
1265
644
  }
1266
- function q(t) {
1267
- return ["html", "body", "#document"].includes(K(t));
645
+ function z(t) {
646
+ return ["html", "body", "#document"].includes(H(t));
1268
647
  }
1269
648
  function R(t) {
1270
- return S(t).getComputedStyle(t);
649
+ return A(t).getComputedStyle(t);
1271
650
  }
1272
- function gt(t) {
651
+ function ct(t) {
1273
652
  return O(t) ? {
1274
653
  scrollLeft: t.scrollLeft,
1275
654
  scrollTop: t.scrollTop
@@ -1278,530 +657,530 @@ function gt(t) {
1278
657
  scrollTop: t.scrollY
1279
658
  };
1280
659
  }
1281
- function N(t) {
1282
- if (K(t) === "html")
660
+ function k(t) {
661
+ if (H(t) === "html")
1283
662
  return t;
1284
663
  const e = (
1285
664
  // Step into the shadow DOM of the parent of a slotted node.
1286
665
  t.assignedSlot || // DOM Element detected.
1287
666
  t.parentNode || // ShadowRoot detected.
1288
- Tt(t) && t.host || // Fallback.
1289
- C(t)
667
+ bt(t) && t.host || // Fallback.
668
+ L(t)
1290
669
  );
1291
- return Tt(e) ? e.host : e;
670
+ return bt(e) ? e.host : e;
1292
671
  }
1293
- function pe(t) {
1294
- const e = N(t);
1295
- return q(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : P(e) && ot(e) ? e : pe(e);
672
+ function It(t) {
673
+ const e = k(t);
674
+ return z(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : E(e) && Y(e) ? e : It(e);
1296
675
  }
1297
- function tt(t, e, n) {
1298
- var s;
1299
- e === void 0 && (e = []), n === void 0 && (n = !0);
1300
- const o = pe(t), i = o === ((s = t.ownerDocument) == null ? void 0 : s.body), r = S(o);
1301
- return i ? e.concat(r, r.visualViewport || [], ot(o) ? o : [], r.frameElement && n ? tt(r.frameElement) : []) : e.concat(o, tt(o, [], n));
676
+ function j(t, e, o) {
677
+ var n;
678
+ e === void 0 && (e = []), o === void 0 && (o = !0);
679
+ const i = It(t), r = i === ((n = t.ownerDocument) == null ? void 0 : n.body), s = A(i);
680
+ return r ? e.concat(s, s.visualViewport || [], Y(i) ? i : [], s.frameElement && o ? j(s.frameElement) : []) : e.concat(i, j(i, [], o));
1302
681
  }
1303
- function me(t) {
682
+ function Ut(t) {
1304
683
  const e = R(t);
1305
- let n = parseFloat(e.width) || 0, s = parseFloat(e.height) || 0;
1306
- const o = P(t), i = o ? t.offsetWidth : n, r = o ? t.offsetHeight : s, c = ut(n) !== i || ut(s) !== r;
1307
- return c && (n = i, s = r), {
1308
- width: n,
1309
- height: s,
684
+ let o = parseFloat(e.width) || 0, n = parseFloat(e.height) || 0;
685
+ const i = E(t), r = i ? t.offsetWidth : o, s = i ? t.offsetHeight : n, c = Z(o) !== r || Z(n) !== s;
686
+ return c && (o = r, n = s), {
687
+ width: o,
688
+ height: n,
1310
689
  $: c
1311
690
  };
1312
691
  }
1313
- function Lt(t) {
692
+ function mt(t) {
1314
693
  return O(t) ? t : t.contextElement;
1315
694
  }
1316
- function B(t) {
1317
- const e = Lt(t);
1318
- if (!P(e))
1319
- return M(1);
1320
- const n = e.getBoundingClientRect(), {
1321
- width: s,
1322
- height: o,
1323
- $: i
1324
- } = me(e);
1325
- let r = (i ? ut(n.width) : n.width) / s, c = (i ? ut(n.height) : n.height) / o;
1326
- return (!r || !Number.isFinite(r)) && (r = 1), (!c || !Number.isFinite(c)) && (c = 1), {
1327
- x: r,
695
+ function $(t) {
696
+ const e = mt(t);
697
+ if (!E(e))
698
+ return C(1);
699
+ const o = e.getBoundingClientRect(), {
700
+ width: n,
701
+ height: i,
702
+ $: r
703
+ } = Ut(e);
704
+ let s = (r ? Z(o.width) : o.width) / n, c = (r ? Z(o.height) : o.height) / i;
705
+ return (!s || !Number.isFinite(s)) && (s = 1), (!c || !Number.isFinite(c)) && (c = 1), {
706
+ x: s,
1328
707
  y: c
1329
708
  };
1330
709
  }
1331
- const Pn = /* @__PURE__ */ M(0);
1332
- function ge(t) {
1333
- const e = S(t);
1334
- return !At() || !e.visualViewport ? Pn : {
710
+ const Le = /* @__PURE__ */ C(0);
711
+ function jt(t) {
712
+ const e = A(t);
713
+ return !dt() || !e.visualViewport ? Le : {
1335
714
  x: e.visualViewport.offsetLeft,
1336
715
  y: e.visualViewport.offsetTop
1337
716
  };
1338
717
  }
1339
- function Dn(t, e, n) {
1340
- return e === void 0 && (e = !1), !n || e && n !== S(t) ? !1 : e;
1341
- }
1342
- function W(t, e, n, s) {
1343
- e === void 0 && (e = !1), n === void 0 && (n = !1);
1344
- const o = t.getBoundingClientRect(), i = Lt(t);
1345
- let r = M(1);
1346
- e && (s ? O(s) && (r = B(s)) : r = B(t));
1347
- const c = Dn(i, n, s) ? ge(i) : M(0);
1348
- let l = (o.left + c.x) / r.x, a = (o.top + c.y) / r.y, f = o.width / r.x, u = o.height / r.y;
1349
- if (i) {
1350
- const p = S(i), d = s && O(s) ? S(s) : s;
1351
- let g = p, w = g.frameElement;
1352
- for (; w && s && d !== g; ) {
1353
- const y = B(w), m = w.getBoundingClientRect(), v = R(w), x = m.left + (w.clientLeft + parseFloat(v.paddingLeft)) * y.x, L = m.top + (w.clientTop + parseFloat(v.paddingTop)) * y.y;
1354
- l *= y.x, a *= y.y, f *= y.x, u *= y.y, l += x, a += L, g = S(w), w = g.frameElement;
718
+ function Se(t, e, o) {
719
+ return e === void 0 && (e = !1), !o || e && o !== A(t) ? !1 : e;
720
+ }
721
+ function D(t, e, o, n) {
722
+ e === void 0 && (e = !1), o === void 0 && (o = !1);
723
+ const i = t.getBoundingClientRect(), r = mt(t);
724
+ let s = C(1);
725
+ e && (n ? O(n) && (s = $(n)) : s = $(t));
726
+ const c = Se(r, o, n) ? jt(r) : C(0);
727
+ let a = (i.left + c.x) / s.x, l = (i.top + c.y) / s.y, u = i.width / s.x, f = i.height / s.y;
728
+ if (r) {
729
+ const m = A(r), h = n && O(n) ? A(n) : n;
730
+ let p = m, g = p.frameElement;
731
+ for (; g && n && h !== p; ) {
732
+ const w = $(g), d = g.getBoundingClientRect(), y = R(g), x = d.left + (g.clientLeft + parseFloat(y.paddingLeft)) * w.x, b = d.top + (g.clientTop + parseFloat(y.paddingTop)) * w.y;
733
+ a *= w.x, l *= w.y, u *= w.x, f *= w.y, a += x, l += b, p = A(g), g = p.frameElement;
1355
734
  }
1356
735
  }
1357
- return ht({
1358
- width: f,
1359
- height: u,
1360
- x: l,
1361
- y: a
736
+ return et({
737
+ width: u,
738
+ height: f,
739
+ x: a,
740
+ y: l
1362
741
  });
1363
742
  }
1364
- function Cn(t) {
743
+ function Te(t) {
1365
744
  let {
1366
745
  elements: e,
1367
- rect: n,
1368
- offsetParent: s,
1369
- strategy: o
746
+ rect: o,
747
+ offsetParent: n,
748
+ strategy: i
1370
749
  } = t;
1371
- const i = o === "fixed", r = C(s), c = e ? mt(e.floating) : !1;
1372
- if (s === r || c && i)
1373
- return n;
1374
- let l = {
750
+ const r = i === "fixed", s = L(n), c = e ? st(e.floating) : !1;
751
+ if (n === s || c && r)
752
+ return o;
753
+ let a = {
1375
754
  scrollLeft: 0,
1376
755
  scrollTop: 0
1377
- }, a = M(1);
1378
- const f = M(0), u = P(s);
1379
- if ((u || !u && !i) && ((K(s) !== "body" || ot(r)) && (l = gt(s)), P(s))) {
1380
- const p = W(s);
1381
- a = B(s), f.x = p.x + s.clientLeft, f.y = p.y + s.clientTop;
756
+ }, l = C(1);
757
+ const u = C(0), f = E(n);
758
+ if ((f || !f && !r) && ((H(n) !== "body" || Y(s)) && (a = ct(n)), E(n))) {
759
+ const m = D(n);
760
+ l = $(n), u.x = m.x + n.clientLeft, u.y = m.y + n.clientTop;
1382
761
  }
1383
762
  return {
1384
- width: n.width * a.x,
1385
- height: n.height * a.y,
1386
- x: n.x * a.x - l.scrollLeft * a.x + f.x,
1387
- y: n.y * a.y - l.scrollTop * a.y + f.y
763
+ width: o.width * l.x,
764
+ height: o.height * l.y,
765
+ x: o.x * l.x - a.scrollLeft * l.x + u.x,
766
+ y: o.y * l.y - a.scrollTop * l.y + u.y
1388
767
  };
1389
768
  }
1390
- function Tn(t) {
769
+ function Ce(t) {
1391
770
  return Array.from(t.getClientRects());
1392
771
  }
1393
- function we(t) {
1394
- return W(C(t)).left + gt(t).scrollLeft;
772
+ function Xt(t) {
773
+ return D(L(t)).left + ct(t).scrollLeft;
1395
774
  }
1396
- function kn(t) {
1397
- const e = C(t), n = gt(t), s = t.ownerDocument.body, o = F(e.scrollWidth, e.clientWidth, s.scrollWidth, s.clientWidth), i = F(e.scrollHeight, e.clientHeight, s.scrollHeight, s.clientHeight);
1398
- let r = -n.scrollLeft + we(t);
1399
- const c = -n.scrollTop;
1400
- return R(s).direction === "rtl" && (r += F(e.clientWidth, s.clientWidth) - o), {
1401
- width: o,
1402
- height: i,
1403
- x: r,
775
+ function ke(t) {
776
+ const e = L(t), o = ct(t), n = t.ownerDocument.body, i = F(e.scrollWidth, e.clientWidth, n.scrollWidth, n.clientWidth), r = F(e.scrollHeight, e.clientHeight, n.scrollHeight, n.clientHeight);
777
+ let s = -o.scrollLeft + Xt(t);
778
+ const c = -o.scrollTop;
779
+ return R(n).direction === "rtl" && (s += F(e.clientWidth, n.clientWidth) - i), {
780
+ width: i,
781
+ height: r,
782
+ x: s,
1404
783
  y: c
1405
784
  };
1406
785
  }
1407
- function Mn(t, e) {
1408
- const n = S(t), s = C(t), o = n.visualViewport;
1409
- let i = s.clientWidth, r = s.clientHeight, c = 0, l = 0;
1410
- if (o) {
1411
- i = o.width, r = o.height;
1412
- const a = At();
1413
- (!a || a && e === "fixed") && (c = o.offsetLeft, l = o.offsetTop);
786
+ function Pe(t, e) {
787
+ const o = A(t), n = L(t), i = o.visualViewport;
788
+ let r = n.clientWidth, s = n.clientHeight, c = 0, a = 0;
789
+ if (i) {
790
+ r = i.width, s = i.height;
791
+ const l = dt();
792
+ (!l || l && e === "fixed") && (c = i.offsetLeft, a = i.offsetTop);
1414
793
  }
1415
794
  return {
1416
- width: i,
1417
- height: r,
795
+ width: r,
796
+ height: s,
1418
797
  x: c,
1419
- y: l
798
+ y: a
1420
799
  };
1421
800
  }
1422
- function Nn(t, e) {
1423
- const n = W(t, !0, e === "fixed"), s = n.top + t.clientTop, o = n.left + t.clientLeft, i = P(t) ? B(t) : M(1), r = t.clientWidth * i.x, c = t.clientHeight * i.y, l = o * i.x, a = s * i.y;
801
+ function Fe(t, e) {
802
+ const o = D(t, !0, e === "fixed"), n = o.top + t.clientTop, i = o.left + t.clientLeft, r = E(t) ? $(t) : C(1), s = t.clientWidth * r.x, c = t.clientHeight * r.y, a = i * r.x, l = n * r.y;
1424
803
  return {
1425
- width: r,
804
+ width: s,
1426
805
  height: c,
1427
- x: l,
1428
- y: a
806
+ x: a,
807
+ y: l
1429
808
  };
1430
809
  }
1431
- function kt(t, e, n) {
1432
- let s;
810
+ function At(t, e, o) {
811
+ let n;
1433
812
  if (e === "viewport")
1434
- s = Mn(t, n);
813
+ n = Pe(t, o);
1435
814
  else if (e === "document")
1436
- s = kn(C(t));
815
+ n = ke(L(t));
1437
816
  else if (O(e))
1438
- s = Nn(e, n);
817
+ n = Fe(e, o);
1439
818
  else {
1440
- const o = ge(t);
1441
- s = {
819
+ const i = jt(t);
820
+ n = {
1442
821
  ...e,
1443
- x: e.x - o.x,
1444
- y: e.y - o.y
822
+ x: e.x - i.x,
823
+ y: e.y - i.y
1445
824
  };
1446
825
  }
1447
- return ht(s);
1448
- }
1449
- function ye(t, e) {
1450
- const n = N(t);
1451
- return n === e || !O(n) || q(n) ? !1 : R(n).position === "fixed" || ye(n, e);
1452
- }
1453
- function $n(t, e) {
1454
- const n = e.get(t);
1455
- if (n)
1456
- return n;
1457
- let s = tt(t, [], !1).filter((c) => O(c) && K(c) !== "body"), o = null;
1458
- const i = R(t).position === "fixed";
1459
- let r = i ? N(t) : t;
1460
- for (; O(r) && !q(r); ) {
1461
- const c = R(r), l = _t(r);
1462
- !l && c.position === "fixed" && (o = null), (i ? !l && !o : !l && c.position === "static" && !!o && ["absolute", "fixed"].includes(o.position) || ot(r) && !l && ye(t, r)) ? s = s.filter((f) => f !== r) : o = c, r = N(r);
826
+ return et(n);
827
+ }
828
+ function qt(t, e) {
829
+ const o = k(t);
830
+ return o === e || !O(o) || z(o) ? !1 : R(o).position === "fixed" || qt(o, e);
831
+ }
832
+ function Me(t, e) {
833
+ const o = e.get(t);
834
+ if (o)
835
+ return o;
836
+ let n = j(t, [], !1).filter((c) => O(c) && H(c) !== "body"), i = null;
837
+ const r = R(t).position === "fixed";
838
+ let s = r ? k(t) : t;
839
+ for (; O(s) && !z(s); ) {
840
+ const c = R(s), a = ht(s);
841
+ !a && c.position === "fixed" && (i = null), (r ? !a && !i : !a && c.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) || Y(s) && !a && qt(t, s)) ? n = n.filter((u) => u !== s) : i = c, s = k(s);
1463
842
  }
1464
- return e.set(t, s), s;
843
+ return e.set(t, n), n;
1465
844
  }
1466
- function Fn(t) {
845
+ function De(t) {
1467
846
  let {
1468
847
  element: e,
1469
- boundary: n,
1470
- rootBoundary: s,
1471
- strategy: o
848
+ boundary: o,
849
+ rootBoundary: n,
850
+ strategy: i
1472
851
  } = t;
1473
- const r = [...n === "clippingAncestors" ? mt(e) ? [] : $n(e, this._c) : [].concat(n), s], c = r[0], l = r.reduce((a, f) => {
1474
- const u = kt(e, f, o);
1475
- return a.top = F(u.top, a.top), a.right = at(u.right, a.right), a.bottom = at(u.bottom, a.bottom), a.left = F(u.left, a.left), a;
1476
- }, kt(e, c, o));
852
+ const s = [...o === "clippingAncestors" ? st(e) ? [] : Me(e, this._c) : [].concat(o), n], c = s[0], a = s.reduce((l, u) => {
853
+ const f = At(e, u, i);
854
+ return l.top = F(f.top, l.top), l.right = Q(f.right, l.right), l.bottom = Q(f.bottom, l.bottom), l.left = F(f.left, l.left), l;
855
+ }, At(e, c, i));
1477
856
  return {
1478
- width: l.right - l.left,
1479
- height: l.bottom - l.top,
1480
- x: l.left,
1481
- y: l.top
857
+ width: a.right - a.left,
858
+ height: a.bottom - a.top,
859
+ x: a.left,
860
+ y: a.top
1482
861
  };
1483
862
  }
1484
- function Vn(t) {
863
+ function We(t) {
1485
864
  const {
1486
865
  width: e,
1487
- height: n
1488
- } = me(t);
866
+ height: o
867
+ } = Ut(t);
1489
868
  return {
1490
869
  width: e,
1491
- height: n
870
+ height: o
1492
871
  };
1493
872
  }
1494
- function Wn(t, e, n) {
1495
- const s = P(e), o = C(e), i = n === "fixed", r = W(t, !0, i, e);
873
+ function Ne(t, e, o) {
874
+ const n = E(e), i = L(e), r = o === "fixed", s = D(t, !0, r, e);
1496
875
  let c = {
1497
876
  scrollLeft: 0,
1498
877
  scrollTop: 0
1499
878
  };
1500
- const l = M(0);
1501
- if (s || !s && !i)
1502
- if ((K(e) !== "body" || ot(o)) && (c = gt(e)), s) {
1503
- const u = W(e, !0, i, e);
1504
- l.x = u.x + e.clientLeft, l.y = u.y + e.clientTop;
1505
- } else o && (l.x = we(o));
1506
- const a = r.left + c.scrollLeft - l.x, f = r.top + c.scrollTop - l.y;
879
+ const a = C(0);
880
+ if (n || !n && !r)
881
+ if ((H(e) !== "body" || Y(i)) && (c = ct(e)), n) {
882
+ const f = D(e, !0, r, e);
883
+ a.x = f.x + e.clientLeft, a.y = f.y + e.clientTop;
884
+ } else i && (a.x = Xt(i));
885
+ const l = s.left + c.scrollLeft - a.x, u = s.top + c.scrollTop - a.y;
1507
886
  return {
1508
- x: a,
1509
- y: f,
1510
- width: r.width,
1511
- height: r.height
887
+ x: l,
888
+ y: u,
889
+ width: s.width,
890
+ height: s.height
1512
891
  };
1513
892
  }
1514
- function vt(t) {
893
+ function at(t) {
1515
894
  return R(t).position === "static";
1516
895
  }
1517
- function Mt(t, e) {
1518
- return !P(t) || R(t).position === "fixed" ? null : e ? e(t) : t.offsetParent;
1519
- }
1520
- function ve(t, e) {
1521
- const n = S(t);
1522
- if (mt(t))
1523
- return n;
1524
- if (!P(t)) {
1525
- let o = N(t);
1526
- for (; o && !q(o); ) {
1527
- if (O(o) && !vt(o))
1528
- return o;
1529
- o = N(o);
896
+ function Rt(t, e) {
897
+ return !E(t) || R(t).position === "fixed" ? null : e ? e(t) : t.offsetParent;
898
+ }
899
+ function Yt(t, e) {
900
+ const o = A(t);
901
+ if (st(t))
902
+ return o;
903
+ if (!E(t)) {
904
+ let i = k(t);
905
+ for (; i && !z(i); ) {
906
+ if (O(i) && !at(i))
907
+ return i;
908
+ i = k(i);
1530
909
  }
1531
- return n;
910
+ return o;
1532
911
  }
1533
- let s = Mt(t, e);
1534
- for (; s && Rn(s) && vt(s); )
1535
- s = Mt(s, e);
1536
- return s && q(s) && vt(s) && !_t(s) ? n : s || On(t) || n;
912
+ let n = Rt(t, e);
913
+ for (; n && Oe(n) && at(n); )
914
+ n = Rt(n, e);
915
+ return n && z(n) && at(n) && !ht(n) ? o : n || Ee(t) || o;
1537
916
  }
1538
- const Hn = async function(t) {
1539
- const e = this.getOffsetParent || ve, n = this.getDimensions, s = await n(t.floating);
917
+ const $e = async function(t) {
918
+ const e = this.getOffsetParent || Yt, o = this.getDimensions, n = await o(t.floating);
1540
919
  return {
1541
- reference: Wn(t.reference, await e(t.floating), t.strategy),
920
+ reference: Ne(t.reference, await e(t.floating), t.strategy),
1542
921
  floating: {
1543
922
  x: 0,
1544
923
  y: 0,
1545
- width: s.width,
1546
- height: s.height
924
+ width: n.width,
925
+ height: n.height
1547
926
  }
1548
927
  };
1549
928
  };
1550
- function zn(t) {
929
+ function Ve(t) {
1551
930
  return R(t).direction === "rtl";
1552
931
  }
1553
- const Bn = {
1554
- convertOffsetParentRelativeRectToViewportRelativeRect: Cn,
1555
- getDocumentElement: C,
1556
- getClippingRect: Fn,
1557
- getOffsetParent: ve,
1558
- getElementRects: Hn,
1559
- getClientRects: Tn,
1560
- getDimensions: Vn,
1561
- getScale: B,
932
+ const ze = {
933
+ convertOffsetParentRelativeRectToViewportRelativeRect: Te,
934
+ getDocumentElement: L,
935
+ getClippingRect: De,
936
+ getOffsetParent: Yt,
937
+ getElementRects: $e,
938
+ getClientRects: Ce,
939
+ getDimensions: We,
940
+ getScale: $,
1562
941
  isElement: O,
1563
- isRTL: zn
942
+ isRTL: Ve
1564
943
  };
1565
- function In(t, e) {
1566
- let n = null, s;
1567
- const o = C(t);
1568
- function i() {
944
+ function Be(t, e) {
945
+ let o = null, n;
946
+ const i = L(t);
947
+ function r() {
1569
948
  var c;
1570
- clearTimeout(s), (c = n) == null || c.disconnect(), n = null;
949
+ clearTimeout(n), (c = o) == null || c.disconnect(), o = null;
1571
950
  }
1572
- function r(c, l) {
1573
- c === void 0 && (c = !1), l === void 0 && (l = 1), i();
951
+ function s(c, a) {
952
+ c === void 0 && (c = !1), a === void 0 && (a = 1), r();
1574
953
  const {
1575
- left: a,
1576
- top: f,
1577
- width: u,
1578
- height: p
954
+ left: l,
955
+ top: u,
956
+ width: f,
957
+ height: m
1579
958
  } = t.getBoundingClientRect();
1580
- if (c || e(), !u || !p)
959
+ if (c || e(), !f || !m)
1581
960
  return;
1582
- const d = ct(f), g = ct(o.clientWidth - (a + u)), w = ct(o.clientHeight - (f + p)), y = ct(a), v = {
1583
- rootMargin: -d + "px " + -g + "px " + -w + "px " + -y + "px",
1584
- threshold: F(0, at(1, l)) || 1
961
+ const h = K(u), p = K(i.clientWidth - (l + f)), g = K(i.clientHeight - (u + m)), w = K(l), y = {
962
+ rootMargin: -h + "px " + -p + "px " + -g + "px " + -w + "px",
963
+ threshold: F(0, Q(1, a)) || 1
1585
964
  };
1586
965
  let x = !0;
1587
- function L(_) {
1588
- const H = _[0].intersectionRatio;
1589
- if (H !== l) {
966
+ function b(v) {
967
+ const W = v[0].intersectionRatio;
968
+ if (W !== a) {
1590
969
  if (!x)
1591
- return r();
1592
- H ? r(!1, H) : s = setTimeout(() => {
1593
- r(!1, 1e-7);
970
+ return s();
971
+ W ? s(!1, W) : n = setTimeout(() => {
972
+ s(!1, 1e-7);
1594
973
  }, 1e3);
1595
974
  }
1596
975
  x = !1;
1597
976
  }
1598
977
  try {
1599
- n = new IntersectionObserver(L, {
1600
- ...v,
978
+ o = new IntersectionObserver(b, {
979
+ ...y,
1601
980
  // Handle <iframe>s
1602
- root: o.ownerDocument
981
+ root: i.ownerDocument
1603
982
  });
1604
983
  } catch {
1605
- n = new IntersectionObserver(L, v);
984
+ o = new IntersectionObserver(b, y);
1606
985
  }
1607
- n.observe(t);
986
+ o.observe(t);
1608
987
  }
1609
- return r(!0), i;
988
+ return s(!0), r;
1610
989
  }
1611
- function qn(t, e, n, s) {
1612
- s === void 0 && (s = {});
990
+ function He(t, e, o, n) {
991
+ n === void 0 && (n = {});
1613
992
  const {
1614
- ancestorScroll: o = !0,
1615
- ancestorResize: i = !0,
1616
- elementResize: r = typeof ResizeObserver == "function",
993
+ ancestorScroll: i = !0,
994
+ ancestorResize: r = !0,
995
+ elementResize: s = typeof ResizeObserver == "function",
1617
996
  layoutShift: c = typeof IntersectionObserver == "function",
1618
- animationFrame: l = !1
1619
- } = s, a = Lt(t), f = o || i ? [...a ? tt(a) : [], ...tt(e)] : [];
1620
- f.forEach((m) => {
1621
- o && m.addEventListener("scroll", n, {
997
+ animationFrame: a = !1
998
+ } = n, l = mt(t), u = i || r ? [...l ? j(l) : [], ...j(e)] : [];
999
+ u.forEach((d) => {
1000
+ i && d.addEventListener("scroll", o, {
1622
1001
  passive: !0
1623
- }), i && m.addEventListener("resize", n);
1002
+ }), r && d.addEventListener("resize", o);
1624
1003
  });
1625
- const u = a && c ? In(a, n) : null;
1626
- let p = -1, d = null;
1627
- r && (d = new ResizeObserver((m) => {
1628
- let [v] = m;
1629
- v && v.target === a && d && (d.unobserve(e), cancelAnimationFrame(p), p = requestAnimationFrame(() => {
1004
+ const f = l && c ? Be(l, o) : null;
1005
+ let m = -1, h = null;
1006
+ s && (h = new ResizeObserver((d) => {
1007
+ let [y] = d;
1008
+ y && y.target === l && h && (h.unobserve(e), cancelAnimationFrame(m), m = requestAnimationFrame(() => {
1630
1009
  var x;
1631
- (x = d) == null || x.observe(e);
1632
- })), n();
1633
- }), a && !l && d.observe(a), d.observe(e));
1634
- let g, w = l ? W(t) : null;
1635
- l && y();
1636
- function y() {
1637
- const m = W(t);
1638
- w && (m.x !== w.x || m.y !== w.y || m.width !== w.width || m.height !== w.height) && n(), w = m, g = requestAnimationFrame(y);
1010
+ (x = h) == null || x.observe(e);
1011
+ })), o();
1012
+ }), l && !a && h.observe(l), h.observe(e));
1013
+ let p, g = a ? D(t) : null;
1014
+ a && w();
1015
+ function w() {
1016
+ const d = D(t);
1017
+ g && (d.x !== g.x || d.y !== g.y || d.width !== g.width || d.height !== g.height) && o(), g = d, p = requestAnimationFrame(w);
1639
1018
  }
1640
- return n(), () => {
1641
- var m;
1642
- f.forEach((v) => {
1643
- o && v.removeEventListener("scroll", n), i && v.removeEventListener("resize", n);
1644
- }), u == null || u(), (m = d) == null || m.disconnect(), d = null, l && cancelAnimationFrame(g);
1019
+ return o(), () => {
1020
+ var d;
1021
+ u.forEach((y) => {
1022
+ i && y.removeEventListener("scroll", o), r && y.removeEventListener("resize", o);
1023
+ }), f == null || f(), (d = h) == null || d.disconnect(), h = null, a && cancelAnimationFrame(p);
1645
1024
  };
1646
1025
  }
1647
- const jn = En, Un = Sn, Nt = An, Jn = (t, e, n) => {
1648
- const s = /* @__PURE__ */ new Map(), o = {
1649
- platform: Bn,
1650
- ...n
1651
- }, i = {
1652
- ...o.platform,
1653
- _c: s
1026
+ const _e = Ae, Ie = Re, Ot = ve, Ue = (t, e, o) => {
1027
+ const n = /* @__PURE__ */ new Map(), i = {
1028
+ platform: ze,
1029
+ ...o
1030
+ }, r = {
1031
+ ...i.platform,
1032
+ _c: n
1654
1033
  };
1655
- return _n(t, e, {
1656
- ...o,
1657
- platform: i
1034
+ return xe(t, e, {
1035
+ ...i,
1036
+ platform: r
1658
1037
  });
1659
- }, ls = ({
1038
+ }, sn = ({
1660
1039
  content: t,
1661
1040
  open: e,
1662
- placement: n,
1663
- offset: { mainAxis: s, crossAxis: o } = { mainAxis: 0, crossAxis: 0 }
1664
- }) => (i) => {
1665
- const r = i.element, c = A.wrap(e);
1666
- return ee(
1041
+ placement: o,
1042
+ offset: { mainAxis: n, crossAxis: i } = { mainAxis: 0, crossAxis: 0 }
1043
+ }) => (r) => {
1044
+ const s = r.element, c = ot.wrap(e);
1045
+ return Dt(
1667
1046
  c,
1668
- se(
1047
+ Ft(
1669
1048
  "body",
1670
- Ut.div(
1671
- ne((l) => {
1672
- const a = l;
1673
- return a.style.position = "absolute", qn(r, a, () => {
1674
- Jn(r, a, {
1675
- placement: n,
1049
+ Tt.div(
1050
+ Mt((a) => {
1051
+ const l = a;
1052
+ return l.style.position = "absolute", He(s, l, () => {
1053
+ Ue(s, l, {
1054
+ placement: o,
1676
1055
  strategy: "absolute",
1677
1056
  middleware: [
1678
- Nt(),
1679
- jn({ mainAxis: s, crossAxis: o }),
1680
- Un(),
1681
- Nt()
1057
+ Ot(),
1058
+ _e({ mainAxis: n, crossAxis: i }),
1059
+ Ie(),
1060
+ Ot()
1682
1061
  ]
1683
- }).then(({ x: f, y: u }) => {
1684
- a.style.top = `${u}px`, a.style.left = `${f}px`;
1062
+ }).then(({ x: u, y: f }) => {
1063
+ l.style.top = `${f}px`, l.style.left = `${u}px`;
1685
1064
  });
1686
1065
  });
1687
1066
  }),
1688
1067
  t()
1689
1068
  )
1690
1069
  )
1691
- )(i);
1692
- }, Kn = (t, e) => {
1070
+ )(r);
1071
+ }, je = (t, e) => {
1693
1072
  if (typeof e == "function")
1694
- return Kn(t, { success: e });
1695
- const n = e.failure ?? ((o) => U(
1696
- st(o.on(console.error)),
1697
- o.map((i) => `Error: ${i}`)
1698
- )), s = e.success;
1699
- return Qt(A.wrap(t), {
1700
- Success: (o) => s(o.$.value),
1701
- Failure: (o) => n(o.$.error)
1073
+ return je(t, { success: e });
1074
+ const o = e.failure ?? ((i) => X(
1075
+ q(i.on(console.error)),
1076
+ i.map((r) => `Error: ${r}`)
1077
+ )), n = e.success;
1078
+ return Pt(ot.wrap(t), {
1079
+ Success: (i) => n(i.$.value),
1080
+ Failure: (i) => o(i.$.error)
1702
1081
  });
1703
- }, as = () => Gt.focus((t) => {
1082
+ }, cn = () => Ct.focus((t) => {
1704
1083
  var e;
1705
1084
  return (e = t.target) == null ? void 0 : e.select();
1706
- }), us = (t) => (e) => {
1707
- const n = e.element, s = D({ width: n.clientWidth, height: n.clientHeight }), o = b(t(s))(e), i = () => {
1708
- s.set({ width: n.clientWidth, height: n.clientHeight });
1085
+ }), ln = (t) => (e) => {
1086
+ const o = e.element, n = B({ width: o.clientWidth, height: o.clientHeight }), i = nt(t(n))(e), r = () => {
1087
+ n.set({ width: o.clientWidth, height: o.clientHeight });
1709
1088
  };
1710
- let r;
1711
- return typeof ResizeObserver == "function" && (r = new ResizeObserver(i), r.observe(n)), (c) => {
1712
- r == null || r.disconnect(), o(c);
1089
+ let s;
1090
+ return typeof ResizeObserver == "function" && (s = new ResizeObserver(r), s.observe(o)), (c) => {
1091
+ s == null || s.disconnect(), i(c);
1713
1092
  };
1714
- }, fs = (t) => (e) => {
1715
- const n = D({
1093
+ }, an = (t) => (e) => {
1094
+ const o = B({
1716
1095
  width: (window == null ? void 0 : window.innerWidth) ?? 0,
1717
1096
  height: (window == null ? void 0 : window.innerHeight) ?? 0
1718
- }), s = b(t(n))(e), o = () => {
1719
- n.set({
1097
+ }), n = nt(t(o))(e), i = () => {
1098
+ o.set({
1720
1099
  width: (window == null ? void 0 : window.innerWidth) ?? 0,
1721
1100
  height: (window == null ? void 0 : window.innerHeight) ?? 0
1722
1101
  });
1723
1102
  };
1724
- return window == null || window.addEventListener("resize", o), (i) => {
1725
- window == null || window.removeEventListener("resize", o), s(i);
1103
+ return window == null || window.addEventListener("resize", i), (r) => {
1104
+ window == null || window.removeEventListener("resize", i), n(r);
1726
1105
  };
1727
- }, Xn = (t, e) => {
1728
- const n = e.split("/").filter((o) => o !== ""), s = {};
1729
- for (let o = 0; o < t.length; o++) {
1730
- const i = t[o], r = n[o];
1731
- if (!r && i.type !== "catch-all")
1106
+ }, Xe = (t, e) => {
1107
+ const o = e.split("/").filter((i) => i !== ""), n = {};
1108
+ for (let i = 0; i < t.length; i++) {
1109
+ const r = t[i], s = o[i];
1110
+ if (!s && r.type !== "catch-all")
1732
1111
  return null;
1733
- if (i.type === "literal") {
1734
- if (i.value !== r)
1112
+ if (r.type === "literal") {
1113
+ if (r.value !== s)
1735
1114
  return null;
1736
- } else if (i.type === "param")
1737
- s[i.name] = r;
1738
- else if (i.type === "catch-all")
1739
- return { params: s, path: e };
1115
+ } else if (r.type === "param")
1116
+ n[r.name] = s;
1117
+ else if (r.type === "catch-all")
1118
+ return { params: n, path: e };
1740
1119
  }
1741
- return n.length !== t.length ? null : { params: s, path: e };
1742
- }, Yn = (t) => t.split("/").map((e) => e.startsWith(":") ? { type: "param", name: e.slice(1) } : e === "*" ? { type: "catch-all" } : { type: "literal", value: e }).filter((e) => e.type !== "literal" || e.value !== ""), Gn = (t) => {
1743
- const e = t.map((n) => {
1744
- const s = Yn(n);
1745
- return { route: n, segments: s };
1120
+ return o.length !== t.length ? null : { params: n, path: e };
1121
+ }, qe = (t) => t.split("/").map((e) => e.startsWith(":") ? { type: "param", name: e.slice(1) } : e === "*" ? { type: "catch-all" } : { type: "literal", value: e }).filter((e) => e.type !== "literal" || e.value !== ""), Ye = (t) => {
1122
+ const e = t.map((o) => {
1123
+ const n = qe(o);
1124
+ return { route: o, segments: n };
1746
1125
  });
1747
- return function(s) {
1748
- for (const { segments: o, route: i } of e) {
1749
- const r = Xn(o, s);
1750
- if (r)
1751
- return { ...r, route: i };
1126
+ return function(n) {
1127
+ for (const { segments: i, route: r } of e) {
1128
+ const s = Xe(i, n);
1129
+ if (s)
1130
+ return { ...s, route: r };
1752
1131
  }
1753
1132
  return null;
1754
1133
  };
1755
- }, hs = (t) => {
1756
- const e = Gn(Object.keys(t));
1757
- return ce((n) => {
1758
- const s = n.map((o) => {
1759
- const i = e(o.pathname);
1760
- if (i == null)
1761
- throw console.error("No route found for", o), new Error("No route found");
1134
+ }, fn = (t) => {
1135
+ const e = Ye(Object.keys(t));
1136
+ return Nt((o) => {
1137
+ const n = o.map((i) => {
1138
+ const r = e(i.pathname);
1139
+ if (r == null)
1140
+ throw console.error("No route found for", i), new Error("No route found");
1762
1141
  return {
1763
- params: i.params,
1764
- route: i.route,
1765
- path: i.path,
1766
- search: o.search,
1767
- hash: o.hash
1142
+ params: r.params,
1143
+ route: r.route,
1144
+ path: r.path,
1145
+ search: i.search,
1146
+ hash: i.hash
1768
1147
  };
1769
1148
  });
1770
- return Ye(
1771
- s.map((o) => [o.route, o]),
1149
+ return te(
1150
+ n.map((i) => [i.route, i]),
1772
1151
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1773
1152
  t
1774
1153
  );
1775
1154
  });
1776
1155
  };
1777
1156
  export {
1778
- ts as Anchor,
1779
- un as AsyncResultView,
1780
- ss as AutoFocus,
1781
- os as AutoSelect,
1782
- us as ElementSize,
1783
- rs as HTMLTitle,
1784
- is as HiddenWhenEmpty,
1785
- dn as InViewport,
1786
- re as LocationProviderMarker,
1787
- ls as PopOver,
1788
- es as ProvideAppearance,
1789
- Qn as ProvideLocation,
1790
- Kn as ResultView,
1791
- hs as Router,
1792
- as as SelectOnFocus,
1793
- ns as UseAppearance,
1794
- ce as UseLocation,
1795
- cs as WhenInViewport,
1796
- fs as WindowSize,
1797
- sn as _makeLocation,
1798
- an as _makeLocationProp,
1799
- Gn as _makeRouteMatcher,
1800
- Yn as _parseRouteSegments,
1801
- le as appearanceMarker,
1802
- on as areLocationsEqual,
1803
- rn as locationFromURL,
1804
- Xn as matchesRoute,
1805
- cn as setLocationFromUrl,
1806
- ln as urlFromLocation
1157
+ Ge as Anchor,
1158
+ ce as AsyncResultView,
1159
+ tn as AutoFocus,
1160
+ en as AutoSelect,
1161
+ ln as ElementSize,
1162
+ on as HTMLTitle,
1163
+ nn as HiddenWhenEmpty,
1164
+ fe as InViewport,
1165
+ Wt as LocationProviderMarker,
1166
+ sn as PopOver,
1167
+ Qe as ProvideAppearance,
1168
+ Ke as ProvideLocation,
1169
+ je as ResultView,
1170
+ fn as Router,
1171
+ cn as SelectOnFocus,
1172
+ Ze as UseAppearance,
1173
+ Nt as UseLocation,
1174
+ rn as WhenInViewport,
1175
+ an as WindowSize,
1176
+ ee as _makeLocation,
1177
+ se as _makeLocationProp,
1178
+ Ye as _makeRouteMatcher,
1179
+ qe as _parseRouteSegments,
1180
+ $t as appearanceMarker,
1181
+ ne as areLocationsEqual,
1182
+ oe as locationFromURL,
1183
+ Xe as matchesRoute,
1184
+ ie as setLocationFromUrl,
1185
+ re as urlFromLocation
1807
1186
  };