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