@tempots/ui 9.0.0 → 10.1.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 CHANGED
@@ -1,175 +1,376 @@
1
- var Ee = Object.defineProperty;
2
- var Pe = (t, e, o) => e in t ? Ee(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o;
3
- var At = (t, e, o) => Pe(t, typeof e != "symbol" ? e + "" : e, o);
4
- import { getWindow as at, prop as W, makeProviderMark as Wt, Signal as ee, Use as it, html as Lt, on as ne, Value as L, attr as Ft, Empty as Et, OneOfType as oe, WithElement as H, OnDispose as F, Fragment as K, Portal as se, renderableOfTNode as Mt, When as ie, previousSignal as Te, effectOf as ke, computedOf as re, WithBrowserCtx as Se, Provide as Ce, OneOfTuple as ce, Prop as De } from "@tempots/dom";
5
- import { delayed as ae, AsyncResult as R, nearEqual as ht, interval as We } from "@tempots/std";
6
- const Fe = (t) => {
1
+ var De = Object.defineProperty;
2
+ var We = (t, e, s) => e in t ? De(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
3
+ var Lt = (t, e, s) => We(t, typeof e != "symbol" ? e + "" : e, s);
4
+ import { getWindow as ot, prop as N, makeProviderMark as Nt, computedOf as Ht, Signal as ae, Use as at, html as Et, on as le, Value as C, attr as Vt, Empty as Pt, OneOfType as ue, WithElement as _, OnDispose as H, Fragment as Y, Portal as fe, renderableOfTNode as $t, When as he, previousSignal as Fe, effectOf as Me, WithBrowserCtx as Ne, Provide as He, OneOfTuple as de, Prop as Ve } from "@tempots/dom";
5
+ import { delayed as me, AsyncResult as L, nearEqual as mt, interval as $e } from "@tempots/std";
6
+ const ze = (t) => {
7
7
  const e = t.split("/").pop();
8
8
  if (e == null || e.startsWith(".")) return;
9
- const o = e.split(".") || [];
10
- return o.length > 1 ? "." + o.pop() : void 0;
11
- }, Me = (t, e) => {
12
- const o = Fe(e);
13
- return o != null && (t.length === 0 || !t.some((n) => o == n));
14
- }, Ne = (t, e, o, n) => {
15
- let s = t.target;
16
- for (; s != null && !(s instanceof HTMLAnchorElement); )
17
- s = s.parentElement;
18
- if (s == null)
9
+ const s = e.split(".") || [];
10
+ return s.length > 1 ? "." + s.pop() : void 0;
11
+ }, Be = (t, e) => {
12
+ const s = ze(e);
13
+ return s != null && (t.length === 0 || !t.some((n) => s == n));
14
+ }, _e = (t, e, s, n) => {
15
+ let r = t.target;
16
+ for (; r != null && !(r instanceof HTMLAnchorElement); )
17
+ r = r.parentElement;
18
+ if (r == null)
19
19
  return !0;
20
- const r = s;
21
- if (t.button !== 0 || t.ctrlKey || t.metaKey || r.target !== "_self" && r.target !== "" || r.getAttribute("download") != null)
20
+ const i = r;
21
+ if (t.button !== 0 || t.ctrlKey || t.metaKey || i.target !== "_self" && i.target !== "" || i.getAttribute("download") != null)
22
22
  return !0;
23
- const { pathname: i, search: c, hash: a } = r;
23
+ const { pathname: o, search: c, hash: a } = i;
24
24
  if (n) {
25
- const l = i + c + a, f = r.getAttribute("href");
26
- if (!(f != null && f.startsWith("#")) && f !== l)
25
+ const l = o + c + a, u = i.getAttribute("href");
26
+ if (!(u != null && u.startsWith("#")) && u !== l)
27
27
  return !0;
28
28
  }
29
- return e ? !1 : Me(o, i);
30
- }, Ve = (t, e = {
29
+ return e ? !1 : Be(s, o);
30
+ }, Ke = (t, e = {
31
31
  ignoreUrlWithExtension: !0,
32
32
  allowedExtensions: [],
33
33
  ignoreExternalUrl: !0
34
34
  }) => {
35
- const o = e.ignoreUrlWithExtension === !0 && Array.isArray(e.allowedExtensions) ? e.allowedExtensions.map(
35
+ const s = e.ignoreUrlWithExtension === !0 && Array.isArray(e.allowedExtensions) ? e.allowedExtensions.map(
36
36
  (n) => n.startsWith(".") ? n : "." + n
37
37
  ) : [];
38
38
  return (n) => {
39
- Ne(
39
+ _e(
40
40
  n,
41
41
  e.ignoreUrlWithExtension ?? !0,
42
- o,
42
+ s,
43
43
  e.ignoreExternalUrl ?? !0
44
44
  ) || t() && n.preventDefault();
45
45
  };
46
- }, $e = (t, e) => t.pathname === e.pathname && JSON.stringify(t.search) === JSON.stringify(e.search) && t.hash === e.hash, le = (t, e) => {
47
- var r, i;
48
- const o = new URL(t, e ?? ((r = at()) == null ? void 0 : r.location.toString())), n = Object.fromEntries(((i = o.searchParams) == null ? void 0 : i.entries()) ?? []);
49
- let s = o.hash;
50
- return s.startsWith("#") && (s = s.substring(1)), {
51
- pathname: o.pathname,
46
+ }, Ue = (t, e) => t.pathname === e.pathname && JSON.stringify(t.search) === JSON.stringify(e.search) && t.hash === e.hash, Tt = (t, e) => {
47
+ var i, o;
48
+ const s = new URL(t, e ?? ((i = ot()) == null ? void 0 : i.location.toString())), n = Object.fromEntries(((o = s.searchParams) == null ? void 0 : o.entries()) ?? []);
49
+ let r = s.hash;
50
+ return r.startsWith("#") && (r = r.substring(1)), {
51
+ pathname: s.pathname,
52
52
  search: n,
53
- hash: s === "" ? void 0 : s
53
+ hash: r === "" ? void 0 : r
54
54
  };
55
- }, Kt = (t, e) => {
56
- const o = le(e);
57
- return t.set(o), t;
58
- }, Pt = (t) => {
59
- const o = new URLSearchParams(t.search).toString(), n = t.hash;
60
- return `${t.pathname}${o ? `?${o}` : ""}${n ? `#${n}` : ""}`;
61
- }, Be = (t) => t.startsWith("http://") || t.startsWith("https://") || t.startsWith("//"), He = (t) => {
62
- const e = t.container.currentURL, o = e.iso(
63
- (n) => le(n),
64
- (n) => {
65
- if (Be(n.pathname))
66
- return Pt(n);
67
- const s = new URL(n.pathname, e.value), r = s.origin + s.pathname;
68
- return Pt({ ...n, pathname: r });
69
- }
70
- );
71
- return { value: o, dispose: o.dispose };
72
- }, Ue = () => {
73
- const t = at(), e = (t == null ? void 0 : t.location.hash) === "" ? void 0 : (t == null ? void 0 : t.location.hash.substring(1)) ?? void 0;
55
+ }, et = (t) => {
56
+ const s = new URLSearchParams(t.search).toString(), n = t.hash;
57
+ return `${t.pathname}${s ? `?${s}` : ""}${n ? `#${n}` : ""}`;
58
+ }, je = (t) => {
59
+ document.startViewTransition ? document.startViewTransition(t) : t();
60
+ }, Yt = () => {
61
+ const t = ot(), e = (t == null ? void 0 : t.location.hash) ?? "";
74
62
  return {
75
63
  pathname: (t == null ? void 0 : t.location.pathname) ?? "",
76
64
  search: Object.fromEntries(
77
65
  new URLSearchParams((t == null ? void 0 : t.location.search) ?? "").entries()
78
66
  ),
79
- hash: e
67
+ hash: e.startsWith("#") ? e.substring(1) || void 0 : e === "" ? void 0 : e
80
68
  };
81
- }, ze = () => {
82
- const t = W(Ue(), $e), e = at(), o = () => {
83
- let n = (e == null ? void 0 : e.location.hash) ?? "";
84
- n.startsWith("#") && (n = n.substring(1));
85
- const s = {
86
- pathname: (e == null ? void 0 : e.location.pathname) ?? "",
87
- search: Object.fromEntries(
88
- new URLSearchParams((e == null ? void 0 : e.location.search) ?? "").entries()
89
- ),
90
- hash: n === "" ? void 0 : n
91
- };
92
- t.set(s);
69
+ }, qt = (t) => {
70
+ if ((t == null ? void 0 : t.scroll) !== "auto")
71
+ return;
72
+ const e = ot();
73
+ e && e.requestAnimationFrame(
74
+ () => e.scrollTo({ top: 0, left: 0, behavior: "auto" })
75
+ );
76
+ }, Xt = (t, e) => {
77
+ e != null && e.viewTransition ? je(t) : t();
78
+ }, Ie = () => {
79
+ const t = N(Yt(), Ue), e = ot(), s = () => {
80
+ t.set(Yt());
93
81
  };
94
- return e == null || e.addEventListener("popstate", o), t.onDispose(() => {
95
- e == null || e.removeEventListener("popstate", o);
96
- }), t.on((n) => {
97
- e == null || e.history.pushState({}, "", Pt(n));
98
- }), {
99
- value: t,
100
- dispose: t.dispose
82
+ e == null || e.addEventListener("popstate", s), e == null || e.addEventListener("hashchange", s);
83
+ const n = (a, l, u) => {
84
+ Xt(() => {
85
+ if (e) {
86
+ const h = et(a), p = (l == null ? void 0 : l.state) ?? {};
87
+ u === "replaceState" || l != null && l.replace ? e.history.replaceState(p, "", h) : e.history.pushState(p, "", h);
88
+ }
89
+ t.set(a);
90
+ }, l), qt(l);
91
+ }, r = (a, l) => {
92
+ Xt(() => {
93
+ e == null || e.history.go(a);
94
+ }, l), qt(l);
95
+ };
96
+ return {
97
+ location: t,
98
+ commit: n,
99
+ go: r,
100
+ back: (a) => r(-1, a),
101
+ forward: (a) => r(1, a),
102
+ resolve: (a) => Tt(a),
103
+ dispose: () => {
104
+ e == null || e.removeEventListener("popstate", s), e == null || e.removeEventListener("hashchange", s), t.dispose();
105
+ }
106
+ };
107
+ }, Ye = (t) => t.startsWith("http://") || t.startsWith("https://") || t.startsWith("//"), qe = (t) => {
108
+ const e = t.container.currentURL, s = e.iso(
109
+ (o) => Tt(o, e.value),
110
+ (o) => {
111
+ if (Ye(o.pathname))
112
+ return et(o);
113
+ const c = new URL(o.pathname, e.value), a = c.origin + c.pathname;
114
+ return et({ ...o, pathname: a });
115
+ }
116
+ );
117
+ return {
118
+ location: s,
119
+ dispose: () => {
120
+ s.dispose();
121
+ },
122
+ commit: (o, c, a) => {
123
+ s.set(o);
124
+ },
125
+ go: (o, c) => {
126
+ },
127
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
128
+ back: (o) => {
129
+ },
130
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
131
+ forward: (o) => {
132
+ },
133
+ resolve: (o) => Tt(o, e.value)
134
+ };
135
+ }, it = (t) => ({
136
+ pathname: t.pathname,
137
+ search: { ...t.search },
138
+ hash: t.hash ?? void 0
139
+ }), kt = (t) => {
140
+ if (t == null) return;
141
+ const e = `${t}`;
142
+ return e === "" ? void 0 : e;
143
+ }, ge = (t, e) => {
144
+ const s = { ...t };
145
+ for (const [n, r] of Object.entries(e))
146
+ r == null ? delete s[n] : s[n] = r;
147
+ return s;
148
+ }, Xe = (t, e) => {
149
+ const s = (e == null ? void 0 : e.includeSearch) ?? !0, n = (e == null ? void 0 : e.includeHash) ?? !0, r = (e == null ? void 0 : e.ignoreSearchParams) ?? [];
150
+ let i;
151
+ if (!s)
152
+ i = {};
153
+ else if (r.length === 0)
154
+ i = { ...t.search };
155
+ else {
156
+ const o = new Set(r);
157
+ i = {};
158
+ for (const [c, a] of Object.entries(t.search))
159
+ o.has(c) || (i[c] = a);
160
+ }
161
+ return {
162
+ pathname: t.pathname,
163
+ search: i,
164
+ hash: n ? t.hash : void 0
165
+ };
166
+ }, Qt = (t, e, s) => {
167
+ const n = Xe(t, s);
168
+ return typeof e == "string" ? et(n) === e : e instanceof RegExp ? ((e.global || e.sticky) && (e.lastIndex = 0), e.test(et(n))) : e(n);
169
+ };
170
+ class Qe {
171
+ constructor(e) {
172
+ this.current = e;
173
+ }
174
+ get location() {
175
+ return this.current;
176
+ }
177
+ setLocation(e) {
178
+ return this.current = it(e), this;
179
+ }
180
+ setPathname(e) {
181
+ return this.current = {
182
+ ...this.current,
183
+ pathname: e
184
+ }, this;
185
+ }
186
+ setHash(e) {
187
+ const s = kt(e);
188
+ if (s == null) {
189
+ const { hash: n, ...r } = this.current;
190
+ this.current = r;
191
+ } else
192
+ this.current = {
193
+ ...this.current,
194
+ hash: s
195
+ };
196
+ return this;
197
+ }
198
+ clearHash() {
199
+ const { hash: e, ...s } = this.current;
200
+ return this.current = s, this;
201
+ }
202
+ setSearch(e) {
203
+ return this.current = {
204
+ ...this.current,
205
+ search: ge(this.current.search, e)
206
+ }, this;
207
+ }
208
+ setSearchParam(e, s) {
209
+ return this.setSearch({ [e]: s });
210
+ }
211
+ updateSearch(e) {
212
+ return this.current = {
213
+ ...this.current,
214
+ search: { ...e({ ...this.current.search }) }
215
+ }, this;
216
+ }
217
+ }
218
+ const Je = (t, e) => t != null && t.replace ? "replaceState" : e, Ge = (t) => {
219
+ const e = t.location, s = e.map(et), n = e.map((g) => g.pathname), r = e.map((g) => ({ ...g.search })), i = e.map((g) => g.hash), o = (g, x) => Qt(t.location.value, g, x), c = (g, x) => Ht(
220
+ e,
221
+ g
222
+ )(
223
+ (O, E) => Qt(O, E, x)
224
+ ), a = (g, x, O) => {
225
+ const E = it({
226
+ ...g,
227
+ hash: kt(g.hash ?? void 0)
228
+ });
229
+ t.commit(E, x, O);
230
+ }, l = (g, x) => {
231
+ const O = Je(x, "pushState");
232
+ a(g, x, O);
233
+ }, u = (g, x) => {
234
+ const O = g(it(t.location.value));
235
+ l(O, x);
236
+ }, h = (g, x) => {
237
+ const O = t.resolve(g);
238
+ l(O, x);
239
+ }, p = (g, x) => {
240
+ const O = { ...x, replace: !0 };
241
+ h(g, O);
242
+ }, f = (g, x) => {
243
+ t.go(g, x);
244
+ }, d = (g) => {
245
+ t.back(g);
246
+ }, w = (g) => {
247
+ t.forward(g);
248
+ }, m = (g, x) => u((O) => ({ ...O, pathname: g }), x), v = (g, x) => u((O) => {
249
+ const E = { ...O }, U = kt(g);
250
+ return U == null ? delete E.hash : E.hash = U, E;
251
+ }, x), b = (g) => v(void 0, g), y = (g, x) => u(
252
+ (O) => ({
253
+ ...O,
254
+ search: ge(O.search, g)
255
+ }),
256
+ x
257
+ );
258
+ return {
259
+ handle: {
260
+ location: e,
261
+ url: s,
262
+ pathname: n,
263
+ search: r,
264
+ hash: i,
265
+ setLocation: l,
266
+ updateLocation: u,
267
+ navigate: h,
268
+ replace: p,
269
+ go: f,
270
+ back: d,
271
+ forward: w,
272
+ setPathname: m,
273
+ setHash: v,
274
+ clearHash: b,
275
+ setSearch: y,
276
+ setSearchParam: (g, x, O) => y({ [g]: x }, O),
277
+ updateSearch: (g, x) => u(
278
+ (O) => ({
279
+ ...O,
280
+ search: { ...g({ ...O.search }) }
281
+ }),
282
+ x
283
+ ),
284
+ queryParam: (g) => e.map((x) => x.search[g]),
285
+ run: (g, x) => {
286
+ const O = new Qe(
287
+ it(t.location.value)
288
+ );
289
+ g(O), l(it(O.location), x);
290
+ },
291
+ match: o,
292
+ matchSignal: c
293
+ },
294
+ dispose: () => {
295
+ t.dispose(), s.dispose(), n.dispose(), r.dispose(), i.dispose();
296
+ }
101
297
  };
102
- }, Nt = {
103
- mark: Wt("Location"),
298
+ }, Ze = (t) => {
299
+ if (t.isBrowser())
300
+ return Ie();
301
+ if (t.isHeadless())
302
+ return qe(t);
303
+ throw new Error("Unknown context");
304
+ }, zt = {
305
+ mark: Nt("Location"),
104
306
  create: (t, e) => {
105
- if (e.isBrowser())
106
- return ze();
107
- if (e.isHeadless())
108
- return He(e);
109
- throw new Error("Unknown context");
307
+ const s = Ze(e), { handle: n, dispose: r } = Ge(s);
308
+ return {
309
+ value: n,
310
+ dispose: r
311
+ };
110
312
  }
111
- }, Ke = (t) => {
112
- document.startViewTransition ? document.startViewTransition(t) : t();
113
- }, je = (t, ...e) => {
114
- if (typeof t == "string" || ee.is(t))
115
- return je({ href: t }, ...e);
116
- const {
117
- href: o,
118
- withViewTransition: n,
119
- ...s
120
- } = t;
121
- return it(Nt, (r) => Lt.a(
122
- ne.click(
123
- Ve(() => (n === !0 ? Ke(() => {
124
- Kt(r, L.get(o));
125
- }) : Kt(r, L.get(o)), !0), s)
313
+ }, tn = (t, ...e) => {
314
+ if (typeof t == "string" || ae.is(t))
315
+ return tn({ href: t }, ...e);
316
+ const { href: s, state: n, scroll: r, viewTransition: i, replace: o, ...c } = t;
317
+ return at(zt, (a) => Et.a(
318
+ le.click(
319
+ Ke(() => {
320
+ let l = !1;
321
+ const u = {};
322
+ return n !== void 0 && (u.state = n, l = !0), r !== void 0 && (u.scroll = r, l = !0), i !== void 0 && (u.viewTransition = i, l = !0), o !== void 0 && (u.replace = o, l = !0), a.navigate(
323
+ C.get(s),
324
+ l ? u : void 0
325
+ ), !0;
326
+ }, c)
126
327
  ),
127
- Ft.href(o),
328
+ Vt.href(s),
128
329
  ...e
129
330
  /* c8 ignore next 2 */
130
331
  ));
131
- }, Qn = {
132
- mark: Wt("Appearance"),
332
+ }, is = {
333
+ mark: Nt("Appearance"),
133
334
  create: () => {
134
- const t = _e();
335
+ const t = en();
135
336
  return {
136
337
  value: t,
137
338
  dispose: t.dispose
138
339
  };
139
340
  }
140
341
  };
141
- function _e() {
142
- const t = at(), e = t != null && t.matchMedia != null ? t.matchMedia("(prefers-color-scheme: dark)") : void 0, o = (e == null ? void 0 : e.matches) ?? !1, n = W(o ? "dark" : "light"), s = (r) => n.set(r.matches ? "dark" : "light");
143
- return e == null || e.addEventListener("change", s), n.onDispose(() => e == null ? void 0 : e.removeEventListener("change", s)), n;
342
+ function en() {
343
+ const t = ot(), e = t != null && t.matchMedia != null ? t.matchMedia("(prefers-color-scheme: dark)") : void 0, s = (e == null ? void 0 : e.matches) ?? !1, n = N(s ? "dark" : "light"), r = (i) => n.set(i.matches ? "dark" : "light");
344
+ return e == null || e.addEventListener("change", r), n.onDispose(() => e == null ? void 0 : e.removeEventListener("change", r)), n;
144
345
  }
145
- const ue = (t, e) => {
346
+ const pe = (t, e) => {
146
347
  if (typeof e == "function")
147
- return ue(t, { success: e });
148
- const o = e.failure ?? ((i) => i.map((c) => `Error: ${c}`)), n = e.success, s = e.loading ?? (() => Et), r = e.notAsked ?? (() => Et);
149
- return oe(L.toSignal(t), {
150
- AsyncSuccess: (i) => n(i.$.value),
151
- AsyncFailure: (i) => o(i.$.error),
152
- Loading: (i) => s(i.map((c) => c.previousValue)),
153
- NotAsked: r
348
+ return pe(t, { success: e });
349
+ const s = e.failure ?? ((o) => o.map((c) => `Error: ${c}`)), n = e.success, r = e.loading ?? (() => Pt), i = e.notAsked ?? (() => Pt);
350
+ return ue(C.toSignal(t), {
351
+ AsyncSuccess: (o) => n(o.$.value),
352
+ AsyncFailure: (o) => s(o.$.error),
353
+ Loading: (o) => r(o.map((c) => c.previousValue)),
354
+ NotAsked: i
154
355
  });
155
- }, Jn = (t = 10) => H((e) => F(ae(() => e == null ? void 0 : e.focus(), t))), Gn = (t = 10) => H((e) => {
156
- const o = ae(() => e.select(), t);
157
- return F(o);
356
+ }, cs = (t = 10) => _((e) => H(me(() => e == null ? void 0 : e.focus(), t))), as = (t = 10) => _((e) => {
357
+ const s = me(() => e.select(), t);
358
+ return H(s);
158
359
  });
159
- function Zn(t) {
360
+ function ls(t) {
160
361
  const e = Object.entries(t);
161
- return K(
362
+ return Y(
162
363
  ...e.map(
163
- ([o, n]) => Ft.class(L.map(n, (s) => s ? o : void 0))
364
+ ([s, n]) => Vt.class(C.map(n, (r) => r ? s : void 0))
164
365
  )
165
366
  );
166
367
  }
167
- const to = H((t) => {
368
+ const us = _((t) => {
168
369
  const e = t.style.getPropertyValue(":empty");
169
- return t.style.setProperty(":empty", "display:none"), F((o) => {
170
- o && t.style.setProperty(":empty", e);
370
+ return t.style.setProperty(":empty", "display:none"), H((s) => {
371
+ s && t.style.setProperty(":empty", e);
171
372
  });
172
- }), eo = (t) => se("head > title", Ft.innerText(t)), Ie = {
373
+ }), fs = (t) => fe("head > title", Vt.innerText(t)), nn = {
173
374
  partial: {
174
375
  root: null,
175
376
  rootMargin: "0px",
@@ -180,223 +381,223 @@ const to = H((t) => {
180
381
  rootMargin: "0px",
181
382
  threshold: 1
182
383
  }
183
- }, mt = {
384
+ }, pt = {
184
385
  partial: /* @__PURE__ */ new Map(),
185
386
  full: /* @__PURE__ */ new Map()
186
- }, st = {
387
+ }, ct = {
187
388
  partial: null,
188
389
  full: null
189
390
  };
190
- function Ye(t) {
191
- return st[t] == null && (st[t] = new IntersectionObserver((e) => {
192
- e.forEach((o) => {
193
- const n = mt[t].get(o.target);
194
- n == null || n.set(o.isIntersecting);
391
+ function sn(t) {
392
+ return ct[t] == null && (ct[t] = new IntersectionObserver((e) => {
393
+ e.forEach((s) => {
394
+ const n = pt[t].get(s.target);
395
+ n == null || n.set(s.isIntersecting);
195
396
  });
196
- }, Ie[t])), st[t];
197
- }
198
- const Xe = ({ mode: t = "partial", once: e = !1 }, o) => {
199
- const n = W(!1);
200
- return K(
201
- H((s) => {
202
- const r = typeof IntersectionObserver < "u" ? Ye(t) : null;
203
- mt[t].set(s, n), r == null || r.observe(s);
204
- function i() {
397
+ }, nn[t])), ct[t];
398
+ }
399
+ const on = ({ mode: t = "partial", once: e = !1 }, s) => {
400
+ const n = N(!1);
401
+ return Y(
402
+ _((r) => {
403
+ const i = typeof IntersectionObserver < "u" ? sn(t) : null;
404
+ pt[t].set(r, n), i == null || i.observe(r);
405
+ function o() {
205
406
  var a;
206
- r == null || r.unobserve(s), mt[t].delete(s), mt[t].size === 0 && ((a = st[t]) == null || a.disconnect(), st[t] = null);
407
+ i == null || i.unobserve(r), pt[t].delete(r), pt[t].size === 0 && ((a = ct[t]) == null || a.disconnect(), ct[t] = null);
207
408
  }
208
409
  let c = null;
209
410
  return e && (c = n.on((a) => {
210
- a && i();
211
- })), F(() => {
212
- n.dispose(), i(), c == null || c();
411
+ a && o();
412
+ })), H(() => {
413
+ n.dispose(), o(), c == null || c();
213
414
  });
214
415
  }),
215
- Mt(o(n))
416
+ $t(s(n))
216
417
  );
217
- }, no = (t, e, o) => Xe(t, (n) => ie(n, e, o ?? (() => Et)));
218
- function qe(t) {
219
- return H((e) => {
220
- const o = (n) => {
418
+ }, hs = (t, e, s) => on(t, (n) => he(n, e, s ?? (() => Pt)));
419
+ function rn(t) {
420
+ return _((e) => {
421
+ const s = (n) => {
221
422
  e.contains(n.target) || t(n);
222
423
  };
223
- return document.addEventListener("click", o), F(() => {
224
- document.removeEventListener("click", o);
424
+ return document.addEventListener("click", s), H(() => {
425
+ document.removeEventListener("click", s);
225
426
  });
226
427
  });
227
428
  }
228
- const G = (t, e) => t === void 0 || t === e, jt = (t, e) => t === void 0 || t === e;
229
- function Qe(t, e) {
230
- return typeof t == "string" ? e.key === t : jt(t.key, e.key) && jt(t.code, e.code) && G(t.ctrlKey, e.ctrlKey) && G(t.altKey, e.altKey) && G(t.shiftKey, e.shiftKey) && G(t.metaKey, e.metaKey) && G(t.repeat, e.repeat) && G(
429
+ const Z = (t, e) => t === void 0 || t === e, Jt = (t, e) => t === void 0 || t === e;
430
+ function cn(t, e) {
431
+ return typeof t == "string" ? e.key === t : Jt(t.key, e.key) && Jt(t.code, e.code) && Z(t.ctrlKey, e.ctrlKey) && Z(t.altKey, e.altKey) && Z(t.shiftKey, e.shiftKey) && Z(t.metaKey, e.metaKey) && Z(t.repeat, e.repeat) && Z(
231
432
  t.commandOrControlKey,
232
433
  e.metaKey || e.ctrlKey
233
434
  );
234
435
  }
235
- function fe({
436
+ function we({
236
437
  allowedKeys: t,
237
438
  handler: e
238
439
  }) {
239
- return H((o) => {
240
- const n = (s) => {
241
- if (o.contains(s.target)) {
242
- for (const r of t)
243
- if (Qe(r, s)) {
244
- e(s);
440
+ return _((s) => {
441
+ const n = (r) => {
442
+ if (s.contains(r.target)) {
443
+ for (const i of t)
444
+ if (cn(i, r)) {
445
+ e(r);
245
446
  break;
246
447
  }
247
448
  }
248
449
  };
249
- return document.addEventListener("keydown", n), F(() => {
450
+ return document.addEventListener("keydown", n), H(() => {
250
451
  document.removeEventListener("keydown", n);
251
452
  });
252
453
  });
253
454
  }
254
- function oo(t) {
255
- return fe({ allowedKeys: ["Enter"], handler: t });
455
+ function ds(t) {
456
+ return we({ allowedKeys: ["Enter"], handler: t });
256
457
  }
257
- function so(t) {
258
- return fe({ allowedKeys: ["Escape"], handler: t });
458
+ function ms(t) {
459
+ return we({ allowedKeys: ["Escape"], handler: t });
259
460
  }
260
- const Je = ({
461
+ const an = ({
261
462
  mutate: t,
262
463
  convertError: e,
263
- onSuccess: o,
464
+ onSuccess: s,
264
465
  onError: n,
265
- onSettled: s
466
+ onSettled: r
266
467
  }) => {
267
- let r;
268
- const i = W(R.notAsked), c = i.map(
269
- (h) => R.isSuccess(h) ? h.value : void 0
270
- ), a = i.map(
271
- (h) => R.isFailure(h) ? h.error : void 0
272
- ), l = i.map((h) => R.isLoading(h)), f = () => {
273
- r == null || r.abort(), r = void 0;
468
+ let i;
469
+ const o = N(L.notAsked), c = o.map(
470
+ (d) => L.isSuccess(d) ? d.value : void 0
471
+ ), a = o.map(
472
+ (d) => L.isFailure(d) ? d.error : void 0
473
+ ), l = o.map((d) => L.isLoading(d)), u = () => {
474
+ i == null || i.abort(), i = void 0;
274
475
  };
275
476
  return {
276
- status: i,
477
+ status: o,
277
478
  value: c,
278
479
  error: a,
279
480
  pending: l,
280
- execute: async (h, p) => {
281
- f(), r = new AbortController();
282
- const m = r.signal, y = i.get(), v = (p == null ? void 0 : p.optimisticValue) ?? ((p == null ? void 0 : p.optimisticFromRequest) != null ? p.optimisticFromRequest(h) : void 0);
283
- v != null ? i.set(R.loading(v)) : i.set(R.loading(R.getOrUndefined(y)));
481
+ execute: async (d, w) => {
482
+ u(), i = new AbortController();
483
+ const m = i.signal, v = o.get(), b = (w == null ? void 0 : w.optimisticValue) ?? ((w == null ? void 0 : w.optimisticFromRequest) != null ? w.optimisticFromRequest(d) : void 0);
484
+ b != null ? o.set(L.loading(b)) : o.set(L.loading(L.getOrUndefined(v)));
284
485
  try {
285
- const w = await t({ request: h, abortSignal: m, previous: y });
286
- r = void 0, i.set(R.success(w)), o == null || o(w, h);
287
- } catch (w) {
288
- r = void 0, i.set(R.failure(e(w))), n == null || n(e(w), h);
486
+ const y = await t({ request: d, abortSignal: m, previous: v });
487
+ i = void 0, o.set(L.success(y)), s == null || s(y, d);
488
+ } catch (y) {
489
+ i = void 0, o.set(L.failure(e(y))), n == null || n(e(y), d);
289
490
  }
290
- s == null || s(i.get(), h);
491
+ r == null || r(o.get(), d);
291
492
  },
292
- cancel: (h) => {
293
- f(), i.set(h ?? R.notAsked);
493
+ cancel: (d) => {
494
+ u(), o.set(d ?? L.notAsked);
294
495
  },
295
496
  dispose: () => {
296
- r == null || r.abort(), r = void 0, i.dispose();
497
+ i == null || i.abort(), i = void 0, o.dispose();
297
498
  }
298
499
  };
299
- }, Ge = (t, e) => {
300
- const { status: o, dispose: n, execute: s, cancel: r, pending: i, error: c, value: a } = t, { content: l } = e, f = Te(a);
301
- return K(
302
- F(n),
500
+ }, ln = (t, e) => {
501
+ const { status: s, dispose: n, execute: r, cancel: i, pending: o, error: c, value: a } = t, { content: l } = e, u = Fe(a);
502
+ return Y(
503
+ H(n),
303
504
  l({
304
- previous: f,
305
- execute: s,
306
- cancel: r,
307
- pending: i,
505
+ previous: u,
506
+ execute: r,
507
+ cancel: i,
508
+ pending: o,
308
509
  error: c,
309
510
  value: a,
310
- status: o
511
+ status: s
311
512
  })
312
513
  );
313
- }, io = ({
514
+ }, gs = ({
314
515
  mutate: t,
315
- convertError: e = (i) => i,
316
- onSuccess: o,
516
+ convertError: e = (o) => o,
517
+ onSuccess: s,
317
518
  onError: n,
318
- onSettled: s,
319
- content: r
519
+ onSettled: r,
520
+ content: i
320
521
  }) => {
321
- const i = Je({
522
+ const o = an({
322
523
  mutate: t,
323
524
  convertError: e,
324
- onSuccess: o,
525
+ onSuccess: s,
325
526
  onError: n,
326
- onSettled: s
527
+ onSettled: r
327
528
  });
328
- return Ge(i, { content: r });
329
- }, tt = Math.min, q = Math.max, gt = Math.round, dt = Math.floor, M = (t) => ({
529
+ return ln(o, { content: i });
530
+ }, nt = Math.min, Q = Math.max, wt = Math.round, gt = Math.floor, V = (t) => ({
330
531
  x: t,
331
532
  y: t
332
- }), Ze = {
533
+ }), un = {
333
534
  left: "right",
334
535
  right: "left",
335
536
  bottom: "top",
336
537
  top: "bottom"
337
- }, tn = {
538
+ }, fn = {
338
539
  start: "end",
339
540
  end: "start"
340
541
  };
341
- function Tt(t, e, o) {
342
- return q(t, tt(e, o));
542
+ function Ct(t, e, s) {
543
+ return Q(t, nt(e, s));
343
544
  }
344
- function lt(t, e) {
545
+ function ft(t, e) {
345
546
  return typeof t == "function" ? t(e) : t;
346
547
  }
347
- function Q(t) {
548
+ function J(t) {
348
549
  return t.split("-")[0];
349
550
  }
350
- function ut(t) {
551
+ function ht(t) {
351
552
  return t.split("-")[1];
352
553
  }
353
- function he(t) {
554
+ function ye(t) {
354
555
  return t === "x" ? "y" : "x";
355
556
  }
356
- function Vt(t) {
557
+ function Bt(t) {
357
558
  return t === "y" ? "height" : "width";
358
559
  }
359
- function z(t) {
360
- return ["top", "bottom"].includes(Q(t)) ? "y" : "x";
560
+ function I(t) {
561
+ return ["top", "bottom"].includes(J(t)) ? "y" : "x";
361
562
  }
362
- function $t(t) {
363
- return he(z(t));
563
+ function _t(t) {
564
+ return ye(I(t));
364
565
  }
365
- function en(t, e, o) {
366
- o === void 0 && (o = !1);
367
- const n = ut(t), s = $t(t), r = Vt(s);
368
- let i = s === "x" ? n === (o ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
369
- return e.reference[r] > e.floating[r] && (i = pt(i)), [i, pt(i)];
566
+ function hn(t, e, s) {
567
+ s === void 0 && (s = !1);
568
+ const n = ht(t), r = _t(t), i = Bt(r);
569
+ let o = r === "x" ? n === (s ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
570
+ return e.reference[i] > e.floating[i] && (o = yt(o)), [o, yt(o)];
370
571
  }
371
- function nn(t) {
372
- const e = pt(t);
373
- return [kt(t), e, kt(e)];
572
+ function dn(t) {
573
+ const e = yt(t);
574
+ return [Dt(t), e, Dt(e)];
374
575
  }
375
- function kt(t) {
376
- return t.replace(/start|end/g, (e) => tn[e]);
576
+ function Dt(t) {
577
+ return t.replace(/start|end/g, (e) => fn[e]);
377
578
  }
378
- function on(t, e, o) {
379
- const n = ["left", "right"], s = ["right", "left"], r = ["top", "bottom"], i = ["bottom", "top"];
579
+ function mn(t, e, s) {
580
+ const n = ["left", "right"], r = ["right", "left"], i = ["top", "bottom"], o = ["bottom", "top"];
380
581
  switch (t) {
381
582
  case "top":
382
583
  case "bottom":
383
- return o ? e ? s : n : e ? n : s;
584
+ return s ? e ? r : n : e ? n : r;
384
585
  case "left":
385
586
  case "right":
386
- return e ? r : i;
587
+ return e ? i : o;
387
588
  default:
388
589
  return [];
389
590
  }
390
591
  }
391
- function sn(t, e, o, n) {
392
- const s = ut(t);
393
- let r = on(Q(t), o === "start", n);
394
- return s && (r = r.map((i) => i + "-" + s), e && (r = r.concat(r.map(kt)))), r;
592
+ function gn(t, e, s, n) {
593
+ const r = ht(t);
594
+ let i = mn(J(t), s === "start", n);
595
+ return r && (i = i.map((o) => o + "-" + r), e && (i = i.concat(i.map(Dt)))), i;
395
596
  }
396
- function pt(t) {
397
- return t.replace(/left|right|bottom|top/g, (e) => Ze[e]);
597
+ function yt(t) {
598
+ return t.replace(/left|right|bottom|top/g, (e) => un[e]);
398
599
  }
399
- function rn(t) {
600
+ function pn(t) {
400
601
  return {
401
602
  top: 0,
402
603
  right: 0,
@@ -405,295 +606,295 @@ function rn(t) {
405
606
  ...t
406
607
  };
407
608
  }
408
- function de(t) {
409
- return typeof t != "number" ? rn(t) : {
609
+ function ve(t) {
610
+ return typeof t != "number" ? pn(t) : {
410
611
  top: t,
411
612
  right: t,
412
613
  bottom: t,
413
614
  left: t
414
615
  };
415
616
  }
416
- function wt(t) {
617
+ function vt(t) {
417
618
  const {
418
619
  x: e,
419
- y: o,
620
+ y: s,
420
621
  width: n,
421
- height: s
622
+ height: r
422
623
  } = t;
423
624
  return {
424
625
  width: n,
425
- height: s,
426
- top: o,
626
+ height: r,
627
+ top: s,
427
628
  left: e,
428
629
  right: e + n,
429
- bottom: o + s,
630
+ bottom: s + r,
430
631
  x: e,
431
- y: o
632
+ y: s
432
633
  };
433
634
  }
434
- function _t(t, e, o) {
635
+ function Gt(t, e, s) {
435
636
  let {
436
637
  reference: n,
437
- floating: s
638
+ floating: r
438
639
  } = t;
439
- const r = z(e), i = $t(e), c = Vt(i), a = Q(e), l = r === "y", f = n.x + n.width / 2 - s.width / 2, d = n.y + n.height / 2 - s.height / 2, g = n[c] / 2 - s[c] / 2;
440
- let u;
640
+ const i = I(e), o = _t(e), c = Bt(o), a = J(e), l = i === "y", u = n.x + n.width / 2 - r.width / 2, h = n.y + n.height / 2 - r.height / 2, p = n[c] / 2 - r[c] / 2;
641
+ let f;
441
642
  switch (a) {
442
643
  case "top":
443
- u = {
444
- x: f,
445
- y: n.y - s.height
644
+ f = {
645
+ x: u,
646
+ y: n.y - r.height
446
647
  };
447
648
  break;
448
649
  case "bottom":
449
- u = {
450
- x: f,
650
+ f = {
651
+ x: u,
451
652
  y: n.y + n.height
452
653
  };
453
654
  break;
454
655
  case "right":
455
- u = {
656
+ f = {
456
657
  x: n.x + n.width,
457
- y: d
658
+ y: h
458
659
  };
459
660
  break;
460
661
  case "left":
461
- u = {
462
- x: n.x - s.width,
463
- y: d
662
+ f = {
663
+ x: n.x - r.width,
664
+ y: h
464
665
  };
465
666
  break;
466
667
  default:
467
- u = {
668
+ f = {
468
669
  x: n.x,
469
670
  y: n.y
470
671
  };
471
672
  }
472
- switch (ut(e)) {
673
+ switch (ht(e)) {
473
674
  case "start":
474
- u[i] -= g * (o && l ? -1 : 1);
675
+ f[o] -= p * (s && l ? -1 : 1);
475
676
  break;
476
677
  case "end":
477
- u[i] += g * (o && l ? -1 : 1);
678
+ f[o] += p * (s && l ? -1 : 1);
478
679
  break;
479
680
  }
480
- return u;
681
+ return f;
481
682
  }
482
- const cn = async (t, e, o) => {
683
+ const wn = async (t, e, s) => {
483
684
  const {
484
685
  placement: n = "bottom",
485
- strategy: s = "absolute",
486
- middleware: r = [],
487
- platform: i
488
- } = o, c = r.filter(Boolean), a = await (i.isRTL == null ? void 0 : i.isRTL(e));
489
- let l = await i.getElementRects({
686
+ strategy: r = "absolute",
687
+ middleware: i = [],
688
+ platform: o
689
+ } = s, c = i.filter(Boolean), a = await (o.isRTL == null ? void 0 : o.isRTL(e));
690
+ let l = await o.getElementRects({
490
691
  reference: t,
491
692
  floating: e,
492
- strategy: s
693
+ strategy: r
493
694
  }), {
494
- x: f,
495
- y: d
496
- } = _t(l, n, a), g = n, u = {}, h = 0;
497
- for (let p = 0; p < c.length; p++) {
695
+ x: u,
696
+ y: h
697
+ } = Gt(l, n, a), p = n, f = {}, d = 0;
698
+ for (let w = 0; w < c.length; w++) {
498
699
  const {
499
700
  name: m,
500
- fn: y
501
- } = c[p], {
502
- x: v,
503
- y: w,
504
- data: b,
505
- reset: x
506
- } = await y({
507
- x: f,
508
- y: d,
701
+ fn: v
702
+ } = c[w], {
703
+ x: b,
704
+ y,
705
+ data: R,
706
+ reset: A
707
+ } = await v({
708
+ x: u,
709
+ y: h,
509
710
  initialPlacement: n,
510
- placement: g,
511
- strategy: s,
512
- middlewareData: u,
711
+ placement: p,
712
+ strategy: r,
713
+ middlewareData: f,
513
714
  rects: l,
514
- platform: i,
715
+ platform: o,
515
716
  elements: {
516
717
  reference: t,
517
718
  floating: e
518
719
  }
519
720
  });
520
- f = v ?? f, d = w ?? d, u = {
521
- ...u,
721
+ u = b ?? u, h = y ?? h, f = {
722
+ ...f,
522
723
  [m]: {
523
- ...u[m],
524
- ...b
724
+ ...f[m],
725
+ ...R
525
726
  }
526
- }, x && h <= 50 && (h++, typeof x == "object" && (x.placement && (g = x.placement), x.rects && (l = x.rects === !0 ? await i.getElementRects({
727
+ }, A && d <= 50 && (d++, typeof A == "object" && (A.placement && (p = A.placement), A.rects && (l = A.rects === !0 ? await o.getElementRects({
527
728
  reference: t,
528
729
  floating: e,
529
- strategy: s
530
- }) : x.rects), {
531
- x: f,
532
- y: d
533
- } = _t(l, g, a)), p = -1);
730
+ strategy: r
731
+ }) : A.rects), {
732
+ x: u,
733
+ y: h
734
+ } = Gt(l, p, a)), w = -1);
534
735
  }
535
736
  return {
536
- x: f,
537
- y: d,
538
- placement: g,
539
- strategy: s,
540
- middlewareData: u
737
+ x: u,
738
+ y: h,
739
+ placement: p,
740
+ strategy: r,
741
+ middlewareData: f
541
742
  };
542
743
  };
543
- async function me(t, e) {
544
- var o;
744
+ async function xe(t, e) {
745
+ var s;
545
746
  e === void 0 && (e = {});
546
747
  const {
547
748
  x: n,
548
- y: s,
549
- platform: r,
550
- rects: i,
749
+ y: r,
750
+ platform: i,
751
+ rects: o,
551
752
  elements: c,
552
753
  strategy: a
553
754
  } = t, {
554
755
  boundary: l = "clippingAncestors",
555
- rootBoundary: f = "viewport",
556
- elementContext: d = "floating",
557
- altBoundary: g = !1,
558
- padding: u = 0
559
- } = lt(e, t), h = de(u), m = c[g ? d === "floating" ? "reference" : "floating" : d], y = wt(await r.getClippingRect({
560
- element: (o = await (r.isElement == null ? void 0 : r.isElement(m))) == null || o ? m : m.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(c.floating)),
756
+ rootBoundary: u = "viewport",
757
+ elementContext: h = "floating",
758
+ altBoundary: p = !1,
759
+ padding: f = 0
760
+ } = ft(e, t), d = ve(f), m = c[p ? h === "floating" ? "reference" : "floating" : h], v = vt(await i.getClippingRect({
761
+ element: (s = await (i.isElement == null ? void 0 : i.isElement(m))) == null || s ? m : m.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(c.floating)),
561
762
  boundary: l,
562
- rootBoundary: f,
763
+ rootBoundary: u,
563
764
  strategy: a
564
- })), v = d === "floating" ? {
765
+ })), b = h === "floating" ? {
565
766
  x: n,
566
- y: s,
567
- width: i.floating.width,
568
- height: i.floating.height
569
- } : i.reference, w = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(c.floating)), b = await (r.isElement == null ? void 0 : r.isElement(w)) ? await (r.getScale == null ? void 0 : r.getScale(w)) || {
767
+ y: r,
768
+ width: o.floating.width,
769
+ height: o.floating.height
770
+ } : o.reference, y = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(c.floating)), R = await (i.isElement == null ? void 0 : i.isElement(y)) ? await (i.getScale == null ? void 0 : i.getScale(y)) || {
570
771
  x: 1,
571
772
  y: 1
572
773
  } : {
573
774
  x: 1,
574
775
  y: 1
575
- }, x = wt(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
776
+ }, A = vt(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
576
777
  elements: c,
577
- rect: v,
578
- offsetParent: w,
778
+ rect: b,
779
+ offsetParent: y,
579
780
  strategy: a
580
- }) : v);
781
+ }) : b);
581
782
  return {
582
- top: (y.top - x.top + h.top) / b.y,
583
- bottom: (x.bottom - y.bottom + h.bottom) / b.y,
584
- left: (y.left - x.left + h.left) / b.x,
585
- right: (x.right - y.right + h.right) / b.x
783
+ top: (v.top - A.top + d.top) / R.y,
784
+ bottom: (A.bottom - v.bottom + d.bottom) / R.y,
785
+ left: (v.left - A.left + d.left) / R.x,
786
+ right: (A.right - v.right + d.right) / R.x
586
787
  };
587
788
  }
588
- const an = (t) => ({
789
+ const yn = (t) => ({
589
790
  name: "arrow",
590
791
  options: t,
591
792
  async fn(e) {
592
793
  const {
593
- x: o,
794
+ x: s,
594
795
  y: n,
595
- placement: s,
596
- rects: r,
597
- platform: i,
796
+ placement: r,
797
+ rects: i,
798
+ platform: o,
598
799
  elements: c,
599
800
  middlewareData: a
600
801
  } = e, {
601
802
  element: l,
602
- padding: f = 0
603
- } = lt(t, e) || {};
803
+ padding: u = 0
804
+ } = ft(t, e) || {};
604
805
  if (l == null)
605
806
  return {};
606
- const d = de(f), g = {
607
- x: o,
807
+ const h = ve(u), p = {
808
+ x: s,
608
809
  y: n
609
- }, u = $t(s), h = Vt(u), p = await i.getDimensions(l), m = u === "y", y = m ? "top" : "left", v = m ? "bottom" : "right", w = m ? "clientHeight" : "clientWidth", b = r.reference[h] + r.reference[u] - g[u] - r.floating[h], x = g[u] - r.reference[u], P = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(l));
610
- let A = P ? P[w] : 0;
611
- (!A || !await (i.isElement == null ? void 0 : i.isElement(P))) && (A = c.floating[w] || r.floating[h]);
612
- const _ = b / 2 - x / 2, $ = A / 2 - p[h] / 2 - 1, T = tt(d[y], $), I = tt(d[v], $), Y = T, ot = A - p[h] - I, O = A / 2 - p[h] / 2 + _, X = Tt(Y, O, ot), B = !a.arrow && ut(s) != null && O !== X && r.reference[h] / 2 - (O < Y ? T : I) - p[h] / 2 < 0, k = B ? O < Y ? O - Y : O - ot : 0;
810
+ }, f = _t(r), d = Bt(f), w = await o.getDimensions(l), m = f === "y", v = m ? "top" : "left", b = m ? "bottom" : "right", y = m ? "clientHeight" : "clientWidth", R = i.reference[d] + i.reference[f] - p[f] - i.floating[d], A = p[f] - i.reference[f], k = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(l));
811
+ let S = k ? k[y] : 0;
812
+ (!S || !await (o.isElement == null ? void 0 : o.isElement(k))) && (S = c.floating[y] || i.floating[d]);
813
+ const K = R / 2 - A / 2, g = S / 2 - w[d] / 2 - 1, x = nt(h[v], g), O = nt(h[b], g), E = x, U = S - w[d] - O, P = S / 2 - w[d] / 2 + K, X = Ct(E, P, U), B = !a.arrow && ht(r) != null && P !== X && i.reference[d] / 2 - (P < E ? x : O) - w[d] / 2 < 0, D = B ? P < E ? P - E : P - U : 0;
613
814
  return {
614
- [u]: g[u] + k,
815
+ [f]: p[f] + D,
615
816
  data: {
616
- [u]: X,
617
- centerOffset: O - X - k,
817
+ [f]: X,
818
+ centerOffset: P - X - D,
618
819
  ...B && {
619
- alignmentOffset: k
820
+ alignmentOffset: D
620
821
  }
621
822
  },
622
823
  reset: B
623
824
  };
624
825
  }
625
- }), ln = function(t) {
826
+ }), vn = function(t) {
626
827
  return t === void 0 && (t = {}), {
627
828
  name: "flip",
628
829
  options: t,
629
830
  async fn(e) {
630
- var o, n;
831
+ var s, n;
631
832
  const {
632
- placement: s,
633
- middlewareData: r,
634
- rects: i,
833
+ placement: r,
834
+ middlewareData: i,
835
+ rects: o,
635
836
  initialPlacement: c,
636
837
  platform: a,
637
838
  elements: l
638
839
  } = e, {
639
- mainAxis: f = !0,
640
- crossAxis: d = !0,
641
- fallbackPlacements: g,
642
- fallbackStrategy: u = "bestFit",
643
- fallbackAxisSideDirection: h = "none",
644
- flipAlignment: p = !0,
840
+ mainAxis: u = !0,
841
+ crossAxis: h = !0,
842
+ fallbackPlacements: p,
843
+ fallbackStrategy: f = "bestFit",
844
+ fallbackAxisSideDirection: d = "none",
845
+ flipAlignment: w = !0,
645
846
  ...m
646
- } = lt(t, e);
647
- if ((o = r.arrow) != null && o.alignmentOffset)
847
+ } = ft(t, e);
848
+ if ((s = i.arrow) != null && s.alignmentOffset)
648
849
  return {};
649
- const y = Q(s), v = z(c), w = Q(c) === c, b = await (a.isRTL == null ? void 0 : a.isRTL(l.floating)), x = g || (w || !p ? [pt(c)] : nn(c)), P = h !== "none";
650
- !g && P && x.push(...sn(c, p, h, b));
651
- const A = [c, ...x], _ = await me(e, m), $ = [];
652
- let T = ((n = r.flip) == null ? void 0 : n.overflows) || [];
653
- if (f && $.push(_[y]), d) {
654
- const O = en(s, i, b);
655
- $.push(_[O[0]], _[O[1]]);
850
+ const v = J(r), b = I(c), y = J(c) === c, R = await (a.isRTL == null ? void 0 : a.isRTL(l.floating)), A = p || (y || !w ? [yt(c)] : dn(c)), k = d !== "none";
851
+ !p && k && A.push(...gn(c, w, d, R));
852
+ const S = [c, ...A], K = await xe(e, m), g = [];
853
+ let x = ((n = i.flip) == null ? void 0 : n.overflows) || [];
854
+ if (u && g.push(K[v]), h) {
855
+ const P = hn(r, o, R);
856
+ g.push(K[P[0]], K[P[1]]);
656
857
  }
657
- if (T = [...T, {
658
- placement: s,
659
- overflows: $
660
- }], !$.every((O) => O <= 0)) {
661
- var I, Y;
662
- const O = (((I = r.flip) == null ? void 0 : I.index) || 0) + 1, X = A[O];
663
- if (X && (!(d === "alignment" ? v !== z(X) : !1) || // We leave the current main axis only if every placement on that axis
858
+ if (x = [...x, {
859
+ placement: r,
860
+ overflows: g
861
+ }], !g.every((P) => P <= 0)) {
862
+ var O, E;
863
+ const P = (((O = i.flip) == null ? void 0 : O.index) || 0) + 1, X = S[P];
864
+ if (X && (!(h === "alignment" ? b !== I(X) : !1) || // We leave the current main axis only if every placement on that axis
664
865
  // overflows the main axis.
665
- T.every((S) => S.overflows[0] > 0 && z(S.placement) === v)))
866
+ x.every((W) => W.overflows[0] > 0 && I(W.placement) === b)))
666
867
  return {
667
868
  data: {
668
- index: O,
669
- overflows: T
869
+ index: P,
870
+ overflows: x
670
871
  },
671
872
  reset: {
672
873
  placement: X
673
874
  }
674
875
  };
675
- let B = (Y = T.filter((k) => k.overflows[0] <= 0).sort((k, S) => k.overflows[1] - S.overflows[1])[0]) == null ? void 0 : Y.placement;
876
+ let B = (E = x.filter((D) => D.overflows[0] <= 0).sort((D, W) => D.overflows[1] - W.overflows[1])[0]) == null ? void 0 : E.placement;
676
877
  if (!B)
677
- switch (u) {
878
+ switch (f) {
678
879
  case "bestFit": {
679
- var ot;
680
- const k = (ot = T.filter((S) => {
681
- if (P) {
682
- const U = z(S.placement);
683
- return U === v || // Create a bias to the `y` side axis due to horizontal
880
+ var U;
881
+ const D = (U = x.filter((W) => {
882
+ if (k) {
883
+ const j = I(W.placement);
884
+ return j === b || // Create a bias to the `y` side axis due to horizontal
684
885
  // reading directions favoring greater width.
685
- U === "y";
886
+ j === "y";
686
887
  }
687
888
  return !0;
688
- }).map((S) => [S.placement, S.overflows.filter((U) => U > 0).reduce((U, Le) => U + Le, 0)]).sort((S, U) => S[1] - U[1])[0]) == null ? void 0 : ot[0];
689
- k && (B = k);
889
+ }).map((W) => [W.placement, W.overflows.filter((j) => j > 0).reduce((j, Ce) => j + Ce, 0)]).sort((W, j) => W[1] - j[1])[0]) == null ? void 0 : U[0];
890
+ D && (B = D);
690
891
  break;
691
892
  }
692
893
  case "initialPlacement":
693
894
  B = c;
694
895
  break;
695
896
  }
696
- if (s !== B)
897
+ if (r !== B)
697
898
  return {
698
899
  reset: {
699
900
  placement: B
@@ -704,151 +905,151 @@ const an = (t) => ({
704
905
  }
705
906
  };
706
907
  };
707
- async function un(t, e) {
908
+ async function xn(t, e) {
708
909
  const {
709
- placement: o,
910
+ placement: s,
710
911
  platform: n,
711
- elements: s
712
- } = t, r = await (n.isRTL == null ? void 0 : n.isRTL(s.floating)), i = Q(o), c = ut(o), a = z(o) === "y", l = ["left", "top"].includes(i) ? -1 : 1, f = r && a ? -1 : 1, d = lt(e, t);
912
+ elements: r
913
+ } = t, i = await (n.isRTL == null ? void 0 : n.isRTL(r.floating)), o = J(s), c = ht(s), a = I(s) === "y", l = ["left", "top"].includes(o) ? -1 : 1, u = i && a ? -1 : 1, h = ft(e, t);
713
914
  let {
714
- mainAxis: g,
715
- crossAxis: u,
716
- alignmentAxis: h
717
- } = typeof d == "number" ? {
718
- mainAxis: d,
915
+ mainAxis: p,
916
+ crossAxis: f,
917
+ alignmentAxis: d
918
+ } = typeof h == "number" ? {
919
+ mainAxis: h,
719
920
  crossAxis: 0,
720
921
  alignmentAxis: null
721
922
  } : {
722
- mainAxis: d.mainAxis || 0,
723
- crossAxis: d.crossAxis || 0,
724
- alignmentAxis: d.alignmentAxis
923
+ mainAxis: h.mainAxis || 0,
924
+ crossAxis: h.crossAxis || 0,
925
+ alignmentAxis: h.alignmentAxis
725
926
  };
726
- return c && typeof h == "number" && (u = c === "end" ? h * -1 : h), a ? {
727
- x: u * f,
728
- y: g * l
927
+ return c && typeof d == "number" && (f = c === "end" ? d * -1 : d), a ? {
928
+ x: f * u,
929
+ y: p * l
729
930
  } : {
730
- x: g * l,
731
- y: u * f
931
+ x: p * l,
932
+ y: f * u
732
933
  };
733
934
  }
734
- const fn = function(t) {
935
+ const bn = function(t) {
735
936
  return t === void 0 && (t = 0), {
736
937
  name: "offset",
737
938
  options: t,
738
939
  async fn(e) {
739
- var o, n;
940
+ var s, n;
740
941
  const {
741
- x: s,
742
- y: r,
743
- placement: i,
942
+ x: r,
943
+ y: i,
944
+ placement: o,
744
945
  middlewareData: c
745
- } = e, a = await un(e, t);
746
- return i === ((o = c.offset) == null ? void 0 : o.placement) && (n = c.arrow) != null && n.alignmentOffset ? {} : {
747
- x: s + a.x,
748
- y: r + a.y,
946
+ } = e, a = await xn(e, t);
947
+ return o === ((s = c.offset) == null ? void 0 : s.placement) && (n = c.arrow) != null && n.alignmentOffset ? {} : {
948
+ x: r + a.x,
949
+ y: i + a.y,
749
950
  data: {
750
951
  ...a,
751
- placement: i
952
+ placement: o
752
953
  }
753
954
  };
754
955
  }
755
956
  };
756
- }, hn = function(t) {
957
+ }, On = function(t) {
757
958
  return t === void 0 && (t = {}), {
758
959
  name: "shift",
759
960
  options: t,
760
961
  async fn(e) {
761
962
  const {
762
- x: o,
963
+ x: s,
763
964
  y: n,
764
- placement: s
965
+ placement: r
765
966
  } = e, {
766
- mainAxis: r = !0,
767
- crossAxis: i = !1,
967
+ mainAxis: i = !0,
968
+ crossAxis: o = !1,
768
969
  limiter: c = {
769
970
  fn: (m) => {
770
971
  let {
771
- x: y,
772
- y: v
972
+ x: v,
973
+ y: b
773
974
  } = m;
774
975
  return {
775
- x: y,
776
- y: v
976
+ x: v,
977
+ y: b
777
978
  };
778
979
  }
779
980
  },
780
981
  ...a
781
- } = lt(t, e), l = {
782
- x: o,
982
+ } = ft(t, e), l = {
983
+ x: s,
783
984
  y: n
784
- }, f = await me(e, a), d = z(Q(s)), g = he(d);
785
- let u = l[g], h = l[d];
786
- if (r) {
787
- const m = g === "y" ? "top" : "left", y = g === "y" ? "bottom" : "right", v = u + f[m], w = u - f[y];
788
- u = Tt(v, u, w);
789
- }
985
+ }, u = await xe(e, a), h = I(J(r)), p = ye(h);
986
+ let f = l[p], d = l[h];
790
987
  if (i) {
791
- const m = d === "y" ? "top" : "left", y = d === "y" ? "bottom" : "right", v = h + f[m], w = h - f[y];
792
- h = Tt(v, h, w);
988
+ const m = p === "y" ? "top" : "left", v = p === "y" ? "bottom" : "right", b = f + u[m], y = f - u[v];
989
+ f = Ct(b, f, y);
990
+ }
991
+ if (o) {
992
+ const m = h === "y" ? "top" : "left", v = h === "y" ? "bottom" : "right", b = d + u[m], y = d - u[v];
993
+ d = Ct(b, d, y);
793
994
  }
794
- const p = c.fn({
995
+ const w = c.fn({
795
996
  ...e,
796
- [g]: u,
797
- [d]: h
997
+ [p]: f,
998
+ [h]: d
798
999
  });
799
1000
  return {
800
- ...p,
1001
+ ...w,
801
1002
  data: {
802
- x: p.x - o,
803
- y: p.y - n,
1003
+ x: w.x - s,
1004
+ y: w.y - n,
804
1005
  enabled: {
805
- [g]: r,
806
- [d]: i
1006
+ [p]: i,
1007
+ [h]: o
807
1008
  }
808
1009
  }
809
1010
  };
810
1011
  }
811
1012
  };
812
1013
  };
813
- function vt() {
1014
+ function bt() {
814
1015
  return typeof window < "u";
815
1016
  }
816
- function nt(t) {
817
- return ge(t) ? (t.nodeName || "").toLowerCase() : "#document";
1017
+ function rt(t) {
1018
+ return be(t) ? (t.nodeName || "").toLowerCase() : "#document";
818
1019
  }
819
- function E(t) {
1020
+ function T(t) {
820
1021
  var e;
821
1022
  return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
822
1023
  }
823
- function V(t) {
1024
+ function z(t) {
824
1025
  var e;
825
- return (e = (ge(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
1026
+ return (e = (be(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
826
1027
  }
827
- function ge(t) {
828
- return vt() ? t instanceof Node || t instanceof E(t).Node : !1;
1028
+ function be(t) {
1029
+ return bt() ? t instanceof Node || t instanceof T(t).Node : !1;
829
1030
  }
830
- function C(t) {
831
- return vt() ? t instanceof Element || t instanceof E(t).Element : !1;
1031
+ function F(t) {
1032
+ return bt() ? t instanceof Element || t instanceof T(t).Element : !1;
832
1033
  }
833
- function N(t) {
834
- return vt() ? t instanceof HTMLElement || t instanceof E(t).HTMLElement : !1;
1034
+ function $(t) {
1035
+ return bt() ? t instanceof HTMLElement || t instanceof T(t).HTMLElement : !1;
835
1036
  }
836
- function It(t) {
837
- return !vt() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof E(t).ShadowRoot;
1037
+ function Zt(t) {
1038
+ return !bt() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof T(t).ShadowRoot;
838
1039
  }
839
- function ft(t) {
1040
+ function dt(t) {
840
1041
  const {
841
1042
  overflow: e,
842
- overflowX: o,
1043
+ overflowX: s,
843
1044
  overflowY: n,
844
- display: s
845
- } = D(t);
846
- return /auto|scroll|overlay|hidden|clip/.test(e + n + o) && !["inline", "contents"].includes(s);
1045
+ display: r
1046
+ } = M(t);
1047
+ return /auto|scroll|overlay|hidden|clip/.test(e + n + s) && !["inline", "contents"].includes(r);
847
1048
  }
848
- function dn(t) {
849
- return ["table", "td", "th"].includes(nt(t));
1049
+ function An(t) {
1050
+ return ["table", "td", "th"].includes(rt(t));
850
1051
  }
851
- function xt(t) {
1052
+ function Ot(t) {
852
1053
  return [":popover-open", ":modal"].some((e) => {
853
1054
  try {
854
1055
  return t.matches(e);
@@ -857,32 +1058,32 @@ function xt(t) {
857
1058
  }
858
1059
  });
859
1060
  }
860
- function Bt(t) {
861
- const e = Ht(), o = C(t) ? D(t) : t;
862
- return ["transform", "translate", "scale", "rotate", "perspective"].some((n) => o[n] ? o[n] !== "none" : !1) || (o.containerType ? o.containerType !== "normal" : !1) || !e && (o.backdropFilter ? o.backdropFilter !== "none" : !1) || !e && (o.filter ? o.filter !== "none" : !1) || ["transform", "translate", "scale", "rotate", "perspective", "filter"].some((n) => (o.willChange || "").includes(n)) || ["paint", "layout", "strict", "content"].some((n) => (o.contain || "").includes(n));
1061
+ function Kt(t) {
1062
+ const e = Ut(), s = F(t) ? M(t) : t;
1063
+ return ["transform", "translate", "scale", "rotate", "perspective"].some((n) => s[n] ? s[n] !== "none" : !1) || (s.containerType ? s.containerType !== "normal" : !1) || !e && (s.backdropFilter ? s.backdropFilter !== "none" : !1) || !e && (s.filter ? s.filter !== "none" : !1) || ["transform", "translate", "scale", "rotate", "perspective", "filter"].some((n) => (s.willChange || "").includes(n)) || ["paint", "layout", "strict", "content"].some((n) => (s.contain || "").includes(n));
863
1064
  }
864
- function mn(t) {
865
- let e = j(t);
866
- for (; N(e) && !et(e); ) {
867
- if (Bt(e))
1065
+ function Rn(t) {
1066
+ let e = q(t);
1067
+ for (; $(e) && !st(e); ) {
1068
+ if (Kt(e))
868
1069
  return e;
869
- if (xt(e))
1070
+ if (Ot(e))
870
1071
  return null;
871
- e = j(e);
1072
+ e = q(e);
872
1073
  }
873
1074
  return null;
874
1075
  }
875
- function Ht() {
1076
+ function Ut() {
876
1077
  return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
877
1078
  }
878
- function et(t) {
879
- return ["html", "body", "#document"].includes(nt(t));
1079
+ function st(t) {
1080
+ return ["html", "body", "#document"].includes(rt(t));
880
1081
  }
881
- function D(t) {
882
- return E(t).getComputedStyle(t);
1082
+ function M(t) {
1083
+ return T(t).getComputedStyle(t);
883
1084
  }
884
- function bt(t) {
885
- return C(t) ? {
1085
+ function At(t) {
1086
+ return F(t) ? {
886
1087
  scrollLeft: t.scrollLeft,
887
1088
  scrollTop: t.scrollTop
888
1089
  } : {
@@ -890,223 +1091,223 @@ function bt(t) {
890
1091
  scrollTop: t.scrollY
891
1092
  };
892
1093
  }
893
- function j(t) {
894
- if (nt(t) === "html")
1094
+ function q(t) {
1095
+ if (rt(t) === "html")
895
1096
  return t;
896
1097
  const e = (
897
1098
  // Step into the shadow DOM of the parent of a slotted node.
898
1099
  t.assignedSlot || // DOM Element detected.
899
1100
  t.parentNode || // ShadowRoot detected.
900
- It(t) && t.host || // Fallback.
901
- V(t)
1101
+ Zt(t) && t.host || // Fallback.
1102
+ z(t)
902
1103
  );
903
- return It(e) ? e.host : e;
1104
+ return Zt(e) ? e.host : e;
904
1105
  }
905
- function pe(t) {
906
- const e = j(t);
907
- return et(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : N(e) && ft(e) ? e : pe(e);
1106
+ function Oe(t) {
1107
+ const e = q(t);
1108
+ return st(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : $(e) && dt(e) ? e : Oe(e);
908
1109
  }
909
- function rt(t, e, o) {
1110
+ function lt(t, e, s) {
910
1111
  var n;
911
- e === void 0 && (e = []), o === void 0 && (o = !0);
912
- const s = pe(t), r = s === ((n = t.ownerDocument) == null ? void 0 : n.body), i = E(s);
913
- if (r) {
914
- const c = St(i);
915
- return e.concat(i, i.visualViewport || [], ft(s) ? s : [], c && o ? rt(c) : []);
1112
+ e === void 0 && (e = []), s === void 0 && (s = !0);
1113
+ const r = Oe(t), i = r === ((n = t.ownerDocument) == null ? void 0 : n.body), o = T(r);
1114
+ if (i) {
1115
+ const c = Wt(o);
1116
+ return e.concat(o, o.visualViewport || [], dt(r) ? r : [], c && s ? lt(c) : []);
916
1117
  }
917
- return e.concat(s, rt(s, [], o));
1118
+ return e.concat(r, lt(r, [], s));
918
1119
  }
919
- function St(t) {
1120
+ function Wt(t) {
920
1121
  return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
921
1122
  }
922
- function we(t) {
923
- const e = D(t);
924
- let o = parseFloat(e.width) || 0, n = parseFloat(e.height) || 0;
925
- const s = N(t), r = s ? t.offsetWidth : o, i = s ? t.offsetHeight : n, c = gt(o) !== r || gt(n) !== i;
926
- return c && (o = r, n = i), {
927
- width: o,
1123
+ function Ae(t) {
1124
+ const e = M(t);
1125
+ let s = parseFloat(e.width) || 0, n = parseFloat(e.height) || 0;
1126
+ const r = $(t), i = r ? t.offsetWidth : s, o = r ? t.offsetHeight : n, c = wt(s) !== i || wt(n) !== o;
1127
+ return c && (s = i, n = o), {
1128
+ width: s,
928
1129
  height: n,
929
1130
  $: c
930
1131
  };
931
1132
  }
932
- function Ut(t) {
933
- return C(t) ? t : t.contextElement;
1133
+ function jt(t) {
1134
+ return F(t) ? t : t.contextElement;
934
1135
  }
935
- function Z(t) {
936
- const e = Ut(t);
937
- if (!N(e))
938
- return M(1);
939
- const o = e.getBoundingClientRect(), {
1136
+ function tt(t) {
1137
+ const e = jt(t);
1138
+ if (!$(e))
1139
+ return V(1);
1140
+ const s = e.getBoundingClientRect(), {
940
1141
  width: n,
941
- height: s,
942
- $: r
943
- } = we(e);
944
- let i = (r ? gt(o.width) : o.width) / n, c = (r ? gt(o.height) : o.height) / s;
945
- return (!i || !Number.isFinite(i)) && (i = 1), (!c || !Number.isFinite(c)) && (c = 1), {
946
- x: i,
1142
+ height: r,
1143
+ $: i
1144
+ } = Ae(e);
1145
+ let o = (i ? wt(s.width) : s.width) / n, c = (i ? wt(s.height) : s.height) / r;
1146
+ return (!o || !Number.isFinite(o)) && (o = 1), (!c || !Number.isFinite(c)) && (c = 1), {
1147
+ x: o,
947
1148
  y: c
948
1149
  };
949
1150
  }
950
- const gn = /* @__PURE__ */ M(0);
951
- function ye(t) {
952
- const e = E(t);
953
- return !Ht() || !e.visualViewport ? gn : {
1151
+ const Ln = /* @__PURE__ */ V(0);
1152
+ function Re(t) {
1153
+ const e = T(t);
1154
+ return !Ut() || !e.visualViewport ? Ln : {
954
1155
  x: e.visualViewport.offsetLeft,
955
1156
  y: e.visualViewport.offsetTop
956
1157
  };
957
1158
  }
958
- function pn(t, e, o) {
959
- return e === void 0 && (e = !1), !o || e && o !== E(t) ? !1 : e;
960
- }
961
- function J(t, e, o, n) {
962
- e === void 0 && (e = !1), o === void 0 && (o = !1);
963
- const s = t.getBoundingClientRect(), r = Ut(t);
964
- let i = M(1);
965
- e && (n ? C(n) && (i = Z(n)) : i = Z(t));
966
- const c = pn(r, o, n) ? ye(r) : M(0);
967
- let a = (s.left + c.x) / i.x, l = (s.top + c.y) / i.y, f = s.width / i.x, d = s.height / i.y;
968
- if (r) {
969
- const g = E(r), u = n && C(n) ? E(n) : n;
970
- let h = g, p = St(h);
971
- for (; p && n && u !== h; ) {
972
- const m = Z(p), y = p.getBoundingClientRect(), v = D(p), w = y.left + (p.clientLeft + parseFloat(v.paddingLeft)) * m.x, b = y.top + (p.clientTop + parseFloat(v.paddingTop)) * m.y;
973
- a *= m.x, l *= m.y, f *= m.x, d *= m.y, a += w, l += b, h = E(p), p = St(h);
1159
+ function Sn(t, e, s) {
1160
+ return e === void 0 && (e = !1), !s || e && s !== T(t) ? !1 : e;
1161
+ }
1162
+ function G(t, e, s, n) {
1163
+ e === void 0 && (e = !1), s === void 0 && (s = !1);
1164
+ const r = t.getBoundingClientRect(), i = jt(t);
1165
+ let o = V(1);
1166
+ e && (n ? F(n) && (o = tt(n)) : o = tt(t));
1167
+ const c = Sn(i, s, n) ? Re(i) : V(0);
1168
+ let a = (r.left + c.x) / o.x, l = (r.top + c.y) / o.y, u = r.width / o.x, h = r.height / o.y;
1169
+ if (i) {
1170
+ const p = T(i), f = n && F(n) ? T(n) : n;
1171
+ let d = p, w = Wt(d);
1172
+ for (; w && n && f !== d; ) {
1173
+ const m = tt(w), v = w.getBoundingClientRect(), b = M(w), y = v.left + (w.clientLeft + parseFloat(b.paddingLeft)) * m.x, R = v.top + (w.clientTop + parseFloat(b.paddingTop)) * m.y;
1174
+ a *= m.x, l *= m.y, u *= m.x, h *= m.y, a += y, l += R, d = T(w), w = Wt(d);
974
1175
  }
975
1176
  }
976
- return wt({
977
- width: f,
978
- height: d,
1177
+ return vt({
1178
+ width: u,
1179
+ height: h,
979
1180
  x: a,
980
1181
  y: l
981
1182
  });
982
1183
  }
983
- function zt(t, e) {
984
- const o = bt(t).scrollLeft;
985
- return e ? e.left + o : J(V(t)).left + o;
1184
+ function It(t, e) {
1185
+ const s = At(t).scrollLeft;
1186
+ return e ? e.left + s : G(z(t)).left + s;
986
1187
  }
987
- function ve(t, e, o) {
988
- o === void 0 && (o = !1);
989
- const n = t.getBoundingClientRect(), s = n.left + e.scrollLeft - (o ? 0 : (
1188
+ function Le(t, e, s) {
1189
+ s === void 0 && (s = !1);
1190
+ const n = t.getBoundingClientRect(), r = n.left + e.scrollLeft - (s ? 0 : (
990
1191
  // RTL <body> scrollbar.
991
- zt(t, n)
992
- )), r = n.top + e.scrollTop;
1192
+ It(t, n)
1193
+ )), i = n.top + e.scrollTop;
993
1194
  return {
994
- x: s,
995
- y: r
1195
+ x: r,
1196
+ y: i
996
1197
  };
997
1198
  }
998
- function wn(t) {
1199
+ function En(t) {
999
1200
  let {
1000
1201
  elements: e,
1001
- rect: o,
1202
+ rect: s,
1002
1203
  offsetParent: n,
1003
- strategy: s
1204
+ strategy: r
1004
1205
  } = t;
1005
- const r = s === "fixed", i = V(n), c = e ? xt(e.floating) : !1;
1006
- if (n === i || c && r)
1007
- return o;
1206
+ const i = r === "fixed", o = z(n), c = e ? Ot(e.floating) : !1;
1207
+ if (n === o || c && i)
1208
+ return s;
1008
1209
  let a = {
1009
1210
  scrollLeft: 0,
1010
1211
  scrollTop: 0
1011
- }, l = M(1);
1012
- const f = M(0), d = N(n);
1013
- if ((d || !d && !r) && ((nt(n) !== "body" || ft(i)) && (a = bt(n)), N(n))) {
1014
- const u = J(n);
1015
- l = Z(n), f.x = u.x + n.clientLeft, f.y = u.y + n.clientTop;
1212
+ }, l = V(1);
1213
+ const u = V(0), h = $(n);
1214
+ if ((h || !h && !i) && ((rt(n) !== "body" || dt(o)) && (a = At(n)), $(n))) {
1215
+ const f = G(n);
1216
+ l = tt(n), u.x = f.x + n.clientLeft, u.y = f.y + n.clientTop;
1016
1217
  }
1017
- const g = i && !d && !r ? ve(i, a, !0) : M(0);
1218
+ const p = o && !h && !i ? Le(o, a, !0) : V(0);
1018
1219
  return {
1019
- width: o.width * l.x,
1020
- height: o.height * l.y,
1021
- x: o.x * l.x - a.scrollLeft * l.x + f.x + g.x,
1022
- y: o.y * l.y - a.scrollTop * l.y + f.y + g.y
1220
+ width: s.width * l.x,
1221
+ height: s.height * l.y,
1222
+ x: s.x * l.x - a.scrollLeft * l.x + u.x + p.x,
1223
+ y: s.y * l.y - a.scrollTop * l.y + u.y + p.y
1023
1224
  };
1024
1225
  }
1025
- function yn(t) {
1226
+ function Pn(t) {
1026
1227
  return Array.from(t.getClientRects());
1027
1228
  }
1028
- function vn(t) {
1029
- const e = V(t), o = bt(t), n = t.ownerDocument.body, s = q(e.scrollWidth, e.clientWidth, n.scrollWidth, n.clientWidth), r = q(e.scrollHeight, e.clientHeight, n.scrollHeight, n.clientHeight);
1030
- let i = -o.scrollLeft + zt(t);
1031
- const c = -o.scrollTop;
1032
- return D(n).direction === "rtl" && (i += q(e.clientWidth, n.clientWidth) - s), {
1033
- width: s,
1034
- height: r,
1035
- x: i,
1229
+ function Tn(t) {
1230
+ const e = z(t), s = At(t), n = t.ownerDocument.body, r = Q(e.scrollWidth, e.clientWidth, n.scrollWidth, n.clientWidth), i = Q(e.scrollHeight, e.clientHeight, n.scrollHeight, n.clientHeight);
1231
+ let o = -s.scrollLeft + It(t);
1232
+ const c = -s.scrollTop;
1233
+ return M(n).direction === "rtl" && (o += Q(e.clientWidth, n.clientWidth) - r), {
1234
+ width: r,
1235
+ height: i,
1236
+ x: o,
1036
1237
  y: c
1037
1238
  };
1038
1239
  }
1039
- function xn(t, e) {
1040
- const o = E(t), n = V(t), s = o.visualViewport;
1041
- let r = n.clientWidth, i = n.clientHeight, c = 0, a = 0;
1042
- if (s) {
1043
- r = s.width, i = s.height;
1044
- const l = Ht();
1045
- (!l || l && e === "fixed") && (c = s.offsetLeft, a = s.offsetTop);
1240
+ function kn(t, e) {
1241
+ const s = T(t), n = z(t), r = s.visualViewport;
1242
+ let i = n.clientWidth, o = n.clientHeight, c = 0, a = 0;
1243
+ if (r) {
1244
+ i = r.width, o = r.height;
1245
+ const l = Ut();
1246
+ (!l || l && e === "fixed") && (c = r.offsetLeft, a = r.offsetTop);
1046
1247
  }
1047
1248
  return {
1048
- width: r,
1049
- height: i,
1249
+ width: i,
1250
+ height: o,
1050
1251
  x: c,
1051
1252
  y: a
1052
1253
  };
1053
1254
  }
1054
- function bn(t, e) {
1055
- const o = J(t, !0, e === "fixed"), n = o.top + t.clientTop, s = o.left + t.clientLeft, r = N(t) ? Z(t) : M(1), i = t.clientWidth * r.x, c = t.clientHeight * r.y, a = s * r.x, l = n * r.y;
1255
+ function Cn(t, e) {
1256
+ const s = G(t, !0, e === "fixed"), n = s.top + t.clientTop, r = s.left + t.clientLeft, i = $(t) ? tt(t) : V(1), o = t.clientWidth * i.x, c = t.clientHeight * i.y, a = r * i.x, l = n * i.y;
1056
1257
  return {
1057
- width: i,
1258
+ width: o,
1058
1259
  height: c,
1059
1260
  x: a,
1060
1261
  y: l
1061
1262
  };
1062
1263
  }
1063
- function Yt(t, e, o) {
1264
+ function te(t, e, s) {
1064
1265
  let n;
1065
1266
  if (e === "viewport")
1066
- n = xn(t, o);
1267
+ n = kn(t, s);
1067
1268
  else if (e === "document")
1068
- n = vn(V(t));
1069
- else if (C(e))
1070
- n = bn(e, o);
1269
+ n = Tn(z(t));
1270
+ else if (F(e))
1271
+ n = Cn(e, s);
1071
1272
  else {
1072
- const s = ye(t);
1273
+ const r = Re(t);
1073
1274
  n = {
1074
- x: e.x - s.x,
1075
- y: e.y - s.y,
1275
+ x: e.x - r.x,
1276
+ y: e.y - r.y,
1076
1277
  width: e.width,
1077
1278
  height: e.height
1078
1279
  };
1079
1280
  }
1080
- return wt(n);
1081
- }
1082
- function xe(t, e) {
1083
- const o = j(t);
1084
- return o === e || !C(o) || et(o) ? !1 : D(o).position === "fixed" || xe(o, e);
1085
- }
1086
- function Rn(t, e) {
1087
- const o = e.get(t);
1088
- if (o)
1089
- return o;
1090
- let n = rt(t, [], !1).filter((c) => C(c) && nt(c) !== "body"), s = null;
1091
- const r = D(t).position === "fixed";
1092
- let i = r ? j(t) : t;
1093
- for (; C(i) && !et(i); ) {
1094
- const c = D(i), a = Bt(i);
1095
- !a && c.position === "fixed" && (s = null), (r ? !a && !s : !a && c.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || ft(i) && !a && xe(t, i)) ? n = n.filter((f) => f !== i) : s = c, i = j(i);
1281
+ return vt(n);
1282
+ }
1283
+ function Se(t, e) {
1284
+ const s = q(t);
1285
+ return s === e || !F(s) || st(s) ? !1 : M(s).position === "fixed" || Se(s, e);
1286
+ }
1287
+ function Dn(t, e) {
1288
+ const s = e.get(t);
1289
+ if (s)
1290
+ return s;
1291
+ let n = lt(t, [], !1).filter((c) => F(c) && rt(c) !== "body"), r = null;
1292
+ const i = M(t).position === "fixed";
1293
+ let o = i ? q(t) : t;
1294
+ for (; F(o) && !st(o); ) {
1295
+ const c = M(o), a = Kt(o);
1296
+ !a && c.position === "fixed" && (r = null), (i ? !a && !r : !a && c.position === "static" && !!r && ["absolute", "fixed"].includes(r.position) || dt(o) && !a && Se(t, o)) ? n = n.filter((u) => u !== o) : r = c, o = q(o);
1096
1297
  }
1097
1298
  return e.set(t, n), n;
1098
1299
  }
1099
- function An(t) {
1300
+ function Wn(t) {
1100
1301
  let {
1101
1302
  element: e,
1102
- boundary: o,
1303
+ boundary: s,
1103
1304
  rootBoundary: n,
1104
- strategy: s
1305
+ strategy: r
1105
1306
  } = t;
1106
- const i = [...o === "clippingAncestors" ? xt(e) ? [] : Rn(e, this._c) : [].concat(o), n], c = i[0], a = i.reduce((l, f) => {
1107
- const d = Yt(e, f, s);
1108
- return l.top = q(d.top, l.top), l.right = tt(d.right, l.right), l.bottom = tt(d.bottom, l.bottom), l.left = q(d.left, l.left), l;
1109
- }, Yt(e, c, s));
1307
+ const o = [...s === "clippingAncestors" ? Ot(e) ? [] : Dn(e, this._c) : [].concat(s), n], c = o[0], a = o.reduce((l, u) => {
1308
+ const h = te(e, u, r);
1309
+ return l.top = Q(h.top, l.top), l.right = nt(h.right, l.right), l.bottom = nt(h.bottom, l.bottom), l.left = Q(h.left, l.left), l;
1310
+ }, te(e, c, r));
1110
1311
  return {
1111
1312
  width: a.right - a.left,
1112
1313
  height: a.bottom - a.top,
@@ -1114,73 +1315,73 @@ function An(t) {
1114
1315
  y: a.top
1115
1316
  };
1116
1317
  }
1117
- function On(t) {
1318
+ function Fn(t) {
1118
1319
  const {
1119
1320
  width: e,
1120
- height: o
1121
- } = we(t);
1321
+ height: s
1322
+ } = Ae(t);
1122
1323
  return {
1123
1324
  width: e,
1124
- height: o
1325
+ height: s
1125
1326
  };
1126
1327
  }
1127
- function Ln(t, e, o) {
1128
- const n = N(e), s = V(e), r = o === "fixed", i = J(t, !0, r, e);
1328
+ function Mn(t, e, s) {
1329
+ const n = $(e), r = z(e), i = s === "fixed", o = G(t, !0, i, e);
1129
1330
  let c = {
1130
1331
  scrollLeft: 0,
1131
1332
  scrollTop: 0
1132
1333
  };
1133
- const a = M(0);
1334
+ const a = V(0);
1134
1335
  function l() {
1135
- a.x = zt(s);
1336
+ a.x = It(r);
1136
1337
  }
1137
- if (n || !n && !r)
1138
- if ((nt(e) !== "body" || ft(s)) && (c = bt(e)), n) {
1139
- const u = J(e, !0, r, e);
1140
- a.x = u.x + e.clientLeft, a.y = u.y + e.clientTop;
1141
- } else s && l();
1142
- r && !n && s && l();
1143
- const f = s && !n && !r ? ve(s, c) : M(0), d = i.left + c.scrollLeft - a.x - f.x, g = i.top + c.scrollTop - a.y - f.y;
1338
+ if (n || !n && !i)
1339
+ if ((rt(e) !== "body" || dt(r)) && (c = At(e)), n) {
1340
+ const f = G(e, !0, i, e);
1341
+ a.x = f.x + e.clientLeft, a.y = f.y + e.clientTop;
1342
+ } else r && l();
1343
+ i && !n && r && l();
1344
+ const u = r && !n && !i ? Le(r, c) : V(0), h = o.left + c.scrollLeft - a.x - u.x, p = o.top + c.scrollTop - a.y - u.y;
1144
1345
  return {
1145
- x: d,
1146
- y: g,
1147
- width: i.width,
1148
- height: i.height
1346
+ x: h,
1347
+ y: p,
1348
+ width: o.width,
1349
+ height: o.height
1149
1350
  };
1150
1351
  }
1151
- function Ot(t) {
1152
- return D(t).position === "static";
1352
+ function St(t) {
1353
+ return M(t).position === "static";
1153
1354
  }
1154
- function Xt(t, e) {
1155
- if (!N(t) || D(t).position === "fixed")
1355
+ function ee(t, e) {
1356
+ if (!$(t) || M(t).position === "fixed")
1156
1357
  return null;
1157
1358
  if (e)
1158
1359
  return e(t);
1159
- let o = t.offsetParent;
1160
- return V(t) === o && (o = o.ownerDocument.body), o;
1161
- }
1162
- function be(t, e) {
1163
- const o = E(t);
1164
- if (xt(t))
1165
- return o;
1166
- if (!N(t)) {
1167
- let s = j(t);
1168
- for (; s && !et(s); ) {
1169
- if (C(s) && !Ot(s))
1170
- return s;
1171
- s = j(s);
1360
+ let s = t.offsetParent;
1361
+ return z(t) === s && (s = s.ownerDocument.body), s;
1362
+ }
1363
+ function Ee(t, e) {
1364
+ const s = T(t);
1365
+ if (Ot(t))
1366
+ return s;
1367
+ if (!$(t)) {
1368
+ let r = q(t);
1369
+ for (; r && !st(r); ) {
1370
+ if (F(r) && !St(r))
1371
+ return r;
1372
+ r = q(r);
1172
1373
  }
1173
- return o;
1374
+ return s;
1174
1375
  }
1175
- let n = Xt(t, e);
1176
- for (; n && dn(n) && Ot(n); )
1177
- n = Xt(n, e);
1178
- return n && et(n) && Ot(n) && !Bt(n) ? o : n || mn(t) || o;
1376
+ let n = ee(t, e);
1377
+ for (; n && An(n) && St(n); )
1378
+ n = ee(n, e);
1379
+ return n && st(n) && St(n) && !Kt(n) ? s : n || Rn(t) || s;
1179
1380
  }
1180
- const En = async function(t) {
1181
- const e = this.getOffsetParent || be, o = this.getDimensions, n = await o(t.floating);
1381
+ const Nn = async function(t) {
1382
+ const e = this.getOffsetParent || Ee, s = this.getDimensions, n = await s(t.floating);
1182
1383
  return {
1183
- reference: Ln(t.reference, await e(t.floating), t.strategy),
1384
+ reference: Mn(t.reference, await e(t.floating), t.strategy),
1184
1385
  floating: {
1185
1386
  x: 0,
1186
1387
  y: 0,
@@ -1189,119 +1390,119 @@ const En = async function(t) {
1189
1390
  }
1190
1391
  };
1191
1392
  };
1192
- function Pn(t) {
1193
- return D(t).direction === "rtl";
1194
- }
1195
- const Tn = {
1196
- convertOffsetParentRelativeRectToViewportRelativeRect: wn,
1197
- getDocumentElement: V,
1198
- getClippingRect: An,
1199
- getOffsetParent: be,
1200
- getElementRects: En,
1201
- getClientRects: yn,
1202
- getDimensions: On,
1203
- getScale: Z,
1204
- isElement: C,
1205
- isRTL: Pn
1393
+ function Hn(t) {
1394
+ return M(t).direction === "rtl";
1395
+ }
1396
+ const Vn = {
1397
+ convertOffsetParentRelativeRectToViewportRelativeRect: En,
1398
+ getDocumentElement: z,
1399
+ getClippingRect: Wn,
1400
+ getOffsetParent: Ee,
1401
+ getElementRects: Nn,
1402
+ getClientRects: Pn,
1403
+ getDimensions: Fn,
1404
+ getScale: tt,
1405
+ isElement: F,
1406
+ isRTL: Hn
1206
1407
  };
1207
- function Re(t, e) {
1408
+ function Pe(t, e) {
1208
1409
  return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
1209
1410
  }
1210
- function kn(t, e) {
1211
- let o = null, n;
1212
- const s = V(t);
1213
- function r() {
1411
+ function $n(t, e) {
1412
+ let s = null, n;
1413
+ const r = z(t);
1414
+ function i() {
1214
1415
  var c;
1215
- clearTimeout(n), (c = o) == null || c.disconnect(), o = null;
1416
+ clearTimeout(n), (c = s) == null || c.disconnect(), s = null;
1216
1417
  }
1217
- function i(c, a) {
1218
- c === void 0 && (c = !1), a === void 0 && (a = 1), r();
1418
+ function o(c, a) {
1419
+ c === void 0 && (c = !1), a === void 0 && (a = 1), i();
1219
1420
  const l = t.getBoundingClientRect(), {
1220
- left: f,
1221
- top: d,
1222
- width: g,
1223
- height: u
1421
+ left: u,
1422
+ top: h,
1423
+ width: p,
1424
+ height: f
1224
1425
  } = l;
1225
- if (c || e(), !g || !u)
1426
+ if (c || e(), !p || !f)
1226
1427
  return;
1227
- const h = dt(d), p = dt(s.clientWidth - (f + g)), m = dt(s.clientHeight - (d + u)), y = dt(f), w = {
1228
- rootMargin: -h + "px " + -p + "px " + -m + "px " + -y + "px",
1229
- threshold: q(0, tt(1, a)) || 1
1428
+ const d = gt(h), w = gt(r.clientWidth - (u + p)), m = gt(r.clientHeight - (h + f)), v = gt(u), y = {
1429
+ rootMargin: -d + "px " + -w + "px " + -m + "px " + -v + "px",
1430
+ threshold: Q(0, nt(1, a)) || 1
1230
1431
  };
1231
- let b = !0;
1232
- function x(P) {
1233
- const A = P[0].intersectionRatio;
1234
- if (A !== a) {
1235
- if (!b)
1236
- return i();
1237
- A ? i(!1, A) : n = setTimeout(() => {
1238
- i(!1, 1e-7);
1432
+ let R = !0;
1433
+ function A(k) {
1434
+ const S = k[0].intersectionRatio;
1435
+ if (S !== a) {
1436
+ if (!R)
1437
+ return o();
1438
+ S ? o(!1, S) : n = setTimeout(() => {
1439
+ o(!1, 1e-7);
1239
1440
  }, 1e3);
1240
1441
  }
1241
- A === 1 && !Re(l, t.getBoundingClientRect()) && i(), b = !1;
1442
+ S === 1 && !Pe(l, t.getBoundingClientRect()) && o(), R = !1;
1242
1443
  }
1243
1444
  try {
1244
- o = new IntersectionObserver(x, {
1245
- ...w,
1445
+ s = new IntersectionObserver(A, {
1446
+ ...y,
1246
1447
  // Handle <iframe>s
1247
- root: s.ownerDocument
1448
+ root: r.ownerDocument
1248
1449
  });
1249
1450
  } catch {
1250
- o = new IntersectionObserver(x, w);
1451
+ s = new IntersectionObserver(A, y);
1251
1452
  }
1252
- o.observe(t);
1453
+ s.observe(t);
1253
1454
  }
1254
- return i(!0), r;
1455
+ return o(!0), i;
1255
1456
  }
1256
- function Sn(t, e, o, n) {
1457
+ function zn(t, e, s, n) {
1257
1458
  n === void 0 && (n = {});
1258
1459
  const {
1259
- ancestorScroll: s = !0,
1260
- ancestorResize: r = !0,
1261
- elementResize: i = typeof ResizeObserver == "function",
1460
+ ancestorScroll: r = !0,
1461
+ ancestorResize: i = !0,
1462
+ elementResize: o = typeof ResizeObserver == "function",
1262
1463
  layoutShift: c = typeof IntersectionObserver == "function",
1263
1464
  animationFrame: a = !1
1264
- } = n, l = Ut(t), f = s || r ? [...l ? rt(l) : [], ...rt(e)] : [];
1265
- f.forEach((y) => {
1266
- s && y.addEventListener("scroll", o, {
1465
+ } = n, l = jt(t), u = r || i ? [...l ? lt(l) : [], ...lt(e)] : [];
1466
+ u.forEach((v) => {
1467
+ r && v.addEventListener("scroll", s, {
1267
1468
  passive: !0
1268
- }), r && y.addEventListener("resize", o);
1469
+ }), i && v.addEventListener("resize", s);
1269
1470
  });
1270
- const d = l && c ? kn(l, o) : null;
1271
- let g = -1, u = null;
1272
- i && (u = new ResizeObserver((y) => {
1273
- let [v] = y;
1274
- v && v.target === l && u && (u.unobserve(e), cancelAnimationFrame(g), g = requestAnimationFrame(() => {
1275
- var w;
1276
- (w = u) == null || w.observe(e);
1277
- })), o();
1278
- }), l && !a && u.observe(l), u.observe(e));
1279
- let h, p = a ? J(t) : null;
1471
+ const h = l && c ? $n(l, s) : null;
1472
+ let p = -1, f = null;
1473
+ o && (f = new ResizeObserver((v) => {
1474
+ let [b] = v;
1475
+ b && b.target === l && f && (f.unobserve(e), cancelAnimationFrame(p), p = requestAnimationFrame(() => {
1476
+ var y;
1477
+ (y = f) == null || y.observe(e);
1478
+ })), s();
1479
+ }), l && !a && f.observe(l), f.observe(e));
1480
+ let d, w = a ? G(t) : null;
1280
1481
  a && m();
1281
1482
  function m() {
1282
- const y = J(t);
1283
- p && !Re(p, y) && o(), p = y, h = requestAnimationFrame(m);
1483
+ const v = G(t);
1484
+ w && !Pe(w, v) && s(), w = v, d = requestAnimationFrame(m);
1284
1485
  }
1285
- return o(), () => {
1286
- var y;
1287
- f.forEach((v) => {
1288
- s && v.removeEventListener("scroll", o), r && v.removeEventListener("resize", o);
1289
- }), d == null || d(), (y = u) == null || y.disconnect(), u = null, a && cancelAnimationFrame(h);
1486
+ return s(), () => {
1487
+ var v;
1488
+ u.forEach((b) => {
1489
+ r && b.removeEventListener("scroll", s), i && b.removeEventListener("resize", s);
1490
+ }), h == null || h(), (v = f) == null || v.disconnect(), f = null, a && cancelAnimationFrame(d);
1290
1491
  };
1291
1492
  }
1292
- const Cn = fn, Dn = hn, qt = ln, Wn = an, Fn = (t, e, o) => {
1293
- const n = /* @__PURE__ */ new Map(), s = {
1294
- platform: Tn,
1295
- ...o
1296
- }, r = {
1297
- ...s.platform,
1493
+ const Bn = bn, _n = On, ne = vn, Kn = yn, Un = (t, e, s) => {
1494
+ const n = /* @__PURE__ */ new Map(), r = {
1495
+ platform: Vn,
1496
+ ...s
1497
+ }, i = {
1498
+ ...r.platform,
1298
1499
  _c: n
1299
1500
  };
1300
- return cn(t, e, {
1301
- ...s,
1302
- platform: r
1501
+ return wn(t, e, {
1502
+ ...r,
1503
+ platform: i
1303
1504
  });
1304
- }, ro = [
1505
+ }, ps = [
1305
1506
  "top",
1306
1507
  "top-start",
1307
1508
  "top-end",
@@ -1314,42 +1515,42 @@ const Cn = fn, Dn = hn, qt = ln, Wn = an, Fn = (t, e, o) => {
1314
1515
  "left",
1315
1516
  "left-start",
1316
1517
  "left-end"
1317
- ], co = (t, e = { isOpen: !1 }) => {
1318
- const o = [];
1518
+ ], ws = (t, e = { isOpen: !1 }) => {
1519
+ const s = [];
1319
1520
  let n = null;
1320
- const s = L.deriveProp(e.isOpen);
1321
- function r(c) {
1322
- n = c, s.set(!0);
1521
+ const r = C.deriveProp(e.isOpen);
1522
+ function i(c) {
1523
+ n = c, r.set(!0);
1323
1524
  }
1324
- function i() {
1325
- s.set(!1), o.forEach((c) => c()), o.length = 0;
1525
+ function o() {
1526
+ r.set(!1), s.forEach((c) => c()), s.length = 0;
1326
1527
  }
1327
- return K(
1328
- t(r, i),
1329
- ie(
1330
- s,
1331
- () => K(
1332
- (n == null ? void 0 : n.onClickOutside) != null ? qe(n.onClickOutside) : null,
1333
- H(
1334
- (c) => se(
1528
+ return Y(
1529
+ t(i, o),
1530
+ he(
1531
+ r,
1532
+ () => Y(
1533
+ (n == null ? void 0 : n.onClickOutside) != null ? rn(n.onClickOutside) : null,
1534
+ _(
1535
+ (c) => fe(
1335
1536
  "body",
1336
- Lt.div(
1337
- H((a) => {
1537
+ Et.div(
1538
+ _((a) => {
1338
1539
  a.style.position = "absolute";
1339
1540
  const l = typeof (n == null ? void 0 : n.target) == "string" ? c.querySelector(
1340
1541
  n.target
1341
1542
  ) : (n == null ? void 0 : n.target) ?? c;
1342
1543
  if (l == null)
1343
1544
  throw new Error(`Target not found: ${n == null ? void 0 : n.target}`);
1344
- let f = null;
1345
- const d = L.toSignal((n == null ? void 0 : n.mainAxisOffset) ?? 0), g = L.toSignal(
1545
+ let u = null;
1546
+ const h = C.toSignal((n == null ? void 0 : n.mainAxisOffset) ?? 0), p = C.toSignal(
1346
1547
  (n == null ? void 0 : n.crossAxisOffset) ?? 0
1347
- ), u = L.toSignal(
1548
+ ), f = C.toSignal(
1348
1549
  /* c8 ignore next 3 */
1349
1550
  (n == null ? void 0 : n.placement) ?? "top"
1350
- ), h = L.toSignal(
1551
+ ), d = C.toSignal(
1351
1552
  (n == null ? void 0 : n.arrowPadding) ?? 0
1352
- ), p = n == null ? void 0 : n.arrow, m = W({
1553
+ ), w = n == null ? void 0 : n.arrow, m = N({
1353
1554
  centerOffset: 0,
1354
1555
  alignmentOffset: 0,
1355
1556
  containerWidth: 0,
@@ -1357,69 +1558,69 @@ const Cn = fn, Dn = hn, qt = ln, Wn = an, Fn = (t, e, o) => {
1357
1558
  x: void 0,
1358
1559
  y: void 0
1359
1560
  });
1360
- async function y() {
1361
- const w = [
1362
- qt(),
1363
- Cn({
1364
- mainAxis: d.get(),
1365
- crossAxis: g.get()
1561
+ async function v() {
1562
+ const y = [
1563
+ ne(),
1564
+ Bn({
1565
+ mainAxis: h.get(),
1566
+ crossAxis: p.get()
1366
1567
  }),
1367
- Dn(),
1368
- qt()
1568
+ _n(),
1569
+ ne()
1369
1570
  ];
1370
- p != null && f != null && w.push(
1371
- Wn({
1372
- element: f,
1373
- padding: h.get()
1571
+ w != null && u != null && y.push(
1572
+ Kn({
1573
+ element: u,
1574
+ padding: d.get()
1374
1575
  })
1375
1576
  );
1376
- const b = await Fn(l, a, {
1377
- placement: u.get(),
1577
+ const R = await Un(l, a, {
1578
+ placement: f.get(),
1378
1579
  strategy: "absolute",
1379
- middleware: w
1380
- }), { x, y: P, middlewareData: A } = b;
1381
- if (a.style.top = `${P}px`, a.style.left = `${x}px`, f != null && A.arrow != null) {
1580
+ middleware: y
1581
+ }), { x: A, y: k, middlewareData: S } = R;
1582
+ if (a.style.top = `${k}px`, a.style.left = `${A}px`, u != null && S.arrow != null) {
1382
1583
  const {
1383
- x: _,
1384
- y: $,
1385
- centerOffset: T,
1386
- alignmentOffset: I
1387
- } = A.arrow;
1584
+ x: K,
1585
+ y: g,
1586
+ centerOffset: x,
1587
+ alignmentOffset: O
1588
+ } = S.arrow;
1388
1589
  m.set({
1389
- x: _,
1390
- y: $,
1391
- centerOffset: T,
1392
- alignmentOffset: I,
1590
+ x: K,
1591
+ y: g,
1592
+ centerOffset: x,
1593
+ alignmentOffset: O,
1393
1594
  containerWidth: a.offsetWidth,
1394
1595
  containerHeight: a.offsetHeight
1395
1596
  });
1396
1597
  }
1397
1598
  }
1398
- const v = ke(
1399
- d,
1400
- g,
1401
- u
1402
- )(y);
1403
- return K(
1599
+ const b = Me(
1600
+ h,
1601
+ p,
1602
+ f
1603
+ )(v);
1604
+ return Y(
1404
1605
  n == null ? void 0 : n.content,
1405
- (n == null ? void 0 : n.arrow) != null ? Lt.div(
1606
+ (n == null ? void 0 : n.arrow) != null ? Et.div(
1406
1607
  n == null ? void 0 : n.arrow(
1407
- re(
1608
+ Ht(
1408
1609
  m,
1409
- u
1410
- )((w, b) => ({
1411
- ...w,
1412
- placement: b
1610
+ f
1611
+ )((y, R) => ({
1612
+ ...y,
1613
+ placement: R
1413
1614
  }))
1414
1615
  ),
1415
- H((w) => {
1416
- f = w, y();
1616
+ _((y) => {
1617
+ u = y, v();
1417
1618
  })
1418
1619
  ) : null,
1419
- F(
1620
+ H(
1420
1621
  m.dispose,
1421
- Sn(l, a, y),
1422
- v
1622
+ zn(l, a, v),
1623
+ b
1423
1624
  )
1424
1625
  );
1425
1626
  })
@@ -1429,88 +1630,88 @@ const Cn = fn, Dn = hn, qt = ln, Wn = an, Fn = (t, e, o) => {
1429
1630
  )
1430
1631
  )
1431
1632
  );
1432
- }, Mn = ({
1633
+ }, jn = ({
1433
1634
  request: t,
1434
1635
  load: e,
1435
- convertError: o,
1636
+ convertError: s,
1436
1637
  onSuccess: n,
1437
- onError: s,
1438
- onSettled: r
1638
+ onError: r,
1639
+ onSettled: i
1439
1640
  }) => {
1440
- let i;
1441
- const c = W(R.notAsked), a = c.map(
1442
- (m) => R.isSuccess(m) ? m.value : void 0
1641
+ let o;
1642
+ const c = N(L.notAsked), a = c.map(
1643
+ (m) => L.isSuccess(m) ? m.value : void 0
1443
1644
  ), l = c.map(
1444
- (m) => R.isFailure(m) ? m.error : void 0
1445
- ), f = c.map((m) => R.isLoading(m)), d = () => {
1446
- i == null || i.abort(), i = void 0;
1447
- }, g = (m) => {
1448
- d(), c.set(m ?? R.notAsked);
1449
- }, u = async (m) => {
1450
- d(), i = new AbortController();
1451
- const y = i.signal, v = c.get();
1452
- c.set(R.loading(R.getOrUndefined(v)));
1645
+ (m) => L.isFailure(m) ? m.error : void 0
1646
+ ), u = c.map((m) => L.isLoading(m)), h = () => {
1647
+ o == null || o.abort(), o = void 0;
1648
+ }, p = (m) => {
1649
+ h(), c.set(m ?? L.notAsked);
1650
+ }, f = async (m) => {
1651
+ h(), o = new AbortController();
1652
+ const v = o.signal, b = c.get();
1653
+ c.set(L.loading(L.getOrUndefined(b)));
1453
1654
  try {
1454
- const w = await e({ request: m, abortSignal: y, previous: v });
1455
- await Promise.resolve(), i = void 0, c.set(R.success(w)), n == null || n(w, m);
1456
- } catch (w) {
1457
- i = void 0, c.set(R.failure(o(w))), s == null || s(o(w), m);
1655
+ const y = await e({ request: m, abortSignal: v, previous: b });
1656
+ await Promise.resolve(), o = void 0, c.set(L.success(y)), n == null || n(y, m);
1657
+ } catch (y) {
1658
+ o = void 0, c.set(L.failure(s(y))), r == null || r(s(y), m);
1458
1659
  }
1459
- r == null || r(c.get(), m);
1460
- }, h = () => u(L.get(t)), p = () => {
1461
- i == null || i.abort(), i = void 0, c.dispose();
1660
+ i == null || i(c.get(), m);
1661
+ }, d = () => f(C.get(t)), w = () => {
1662
+ o == null || o.abort(), o = void 0, c.dispose();
1462
1663
  };
1463
- return c.onDispose(L.on(t, u)), {
1664
+ return c.onDispose(C.on(t, f)), {
1464
1665
  status: c,
1465
1666
  value: a,
1466
1667
  error: l,
1467
- loading: f,
1468
- cancel: g,
1469
- reload: h,
1470
- dispose: p
1668
+ loading: u,
1669
+ cancel: p,
1670
+ reload: d,
1671
+ dispose: w
1471
1672
  };
1472
- }, Nn = (t, e) => {
1473
- const { status: o, dispose: n, reload: s } = t, { pending: r, failure: i, success: c } = e;
1474
- return K(
1475
- F(n),
1476
- ue(o, {
1477
- loading: r != null ? (a) => r({ previous: a, reload: s, cancel: t.cancel }) : void 0,
1478
- failure: i != null ? (a) => i({ error: a, reload: s }) : void 0,
1479
- success: (a) => c({ value: a, reload: s })
1673
+ }, In = (t, e) => {
1674
+ const { status: s, dispose: n, reload: r } = t, { pending: i, failure: o, success: c } = e;
1675
+ return Y(
1676
+ H(n),
1677
+ pe(s, {
1678
+ loading: i != null ? (a) => i({ previous: a, reload: r, cancel: t.cancel }) : void 0,
1679
+ failure: o != null ? (a) => o({ error: a, reload: r }) : void 0,
1680
+ success: (a) => c({ value: a, reload: r })
1480
1681
  })
1481
1682
  );
1482
- }, ao = ({
1683
+ }, ys = ({
1483
1684
  request: t,
1484
1685
  load: e,
1485
- convertError: o = (l) => l,
1686
+ convertError: s = (l) => l,
1486
1687
  onSuccess: n,
1487
- onError: s,
1488
- onSettled: r,
1489
- success: i,
1688
+ onError: r,
1689
+ onSettled: i,
1690
+ success: o,
1490
1691
  pending: c,
1491
1692
  failure: a
1492
1693
  }) => {
1493
- const l = Mn({
1694
+ const l = jn({
1494
1695
  request: t,
1495
1696
  load: e,
1496
- convertError: o,
1697
+ convertError: s,
1497
1698
  onSuccess: n,
1498
- onError: s,
1499
- onSettled: r
1699
+ onError: r,
1700
+ onSettled: i
1500
1701
  });
1501
- return Nn(l, { success: i, pending: c, failure: a });
1502
- }, Vn = (t, e) => {
1702
+ return In(l, { success: o, pending: c, failure: a });
1703
+ }, Yn = (t, e) => {
1503
1704
  if (typeof e == "function")
1504
- return Vn(t, { success: e });
1505
- const o = e.failure ?? ((s) => K(
1506
- F(s.on(console.error)),
1507
- s.map((r) => `Error: ${r}`)
1705
+ return Yn(t, { success: e });
1706
+ const s = e.failure ?? ((r) => Y(
1707
+ H(r.on(console.error)),
1708
+ r.map((i) => `Error: ${i}`)
1508
1709
  )), n = e.success;
1509
- return oe(L.toSignal(t), {
1510
- Success: (s) => n(s.$.value),
1511
- Failure: (s) => o(s.$.error)
1710
+ return ue(C.toSignal(t), {
1711
+ Success: (r) => n(r.$.value),
1712
+ Failure: (r) => s(r.$.error)
1512
1713
  });
1513
- }, lo = () => ne.focus((t) => {
1714
+ }, vs = () => le.focus((t) => {
1514
1715
  var e;
1515
1716
  return (e = t.target) == null ? void 0 : e.select();
1516
1717
  });
@@ -1532,7 +1733,7 @@ class Rt {
1532
1733
  * console.log(rect.height); // 50
1533
1734
  * ```
1534
1735
  */
1535
- constructor(e, o, n, s, r, i) {
1736
+ constructor(e, s, n, r, i, o) {
1536
1737
  /**
1537
1738
  * Compares this rectangle with another rectangle for equality.
1538
1739
  *
@@ -1553,8 +1754,8 @@ class Rt {
1553
1754
  * console.log(rect1.equals(rect3)); // true (within tolerance)
1554
1755
  * ```
1555
1756
  */
1556
- At(this, "equals", (e) => ht(this.left, e.left) && ht(this.top, e.top) && ht(this.width, e.width) && ht(this.height, e.height));
1557
- this.left = e, this.top = o, this.width = n, this.height = s, this.localLeft = r, this.localTop = i;
1757
+ Lt(this, "equals", (e) => mt(this.left, e.left) && mt(this.top, e.top) && mt(this.width, e.width) && mt(this.height, e.height));
1758
+ this.left = e, this.top = s, this.width = n, this.height = r, this.localLeft = i, this.localTop = o;
1558
1759
  }
1559
1760
  /**
1560
1761
  * Creates a new Rect instance using an object with optional properties.
@@ -1583,13 +1784,13 @@ class Rt {
1583
1784
  */
1584
1785
  static of({
1585
1786
  left: e = 0,
1586
- top: o = 0,
1787
+ top: s = 0,
1587
1788
  width: n = 0,
1588
- height: s = 0,
1589
- localLeft: r = 0,
1590
- localTop: i = 0
1789
+ height: r = 0,
1790
+ localLeft: i = 0,
1791
+ localTop: o = 0
1591
1792
  }) {
1592
- return new Rt(e, o, n, s, r, i);
1793
+ return new Rt(e, s, n, r, i, o);
1593
1794
  }
1594
1795
  /**
1595
1796
  * Gets the x-coordinate of the right edge of the rectangle.
@@ -1702,7 +1903,7 @@ class Rt {
1702
1903
  return { width: this.width, height: this.height };
1703
1904
  }
1704
1905
  }
1705
- function Qt(t) {
1906
+ function se(t) {
1706
1907
  const e = t.getBoundingClientRect();
1707
1908
  return Rt.of({
1708
1909
  top: e.top + window.scrollY,
@@ -1713,149 +1914,163 @@ function Qt(t) {
1713
1914
  localTop: t.offsetTop
1714
1915
  });
1715
1916
  }
1716
- const uo = (t) => Se((e) => {
1717
- const { element: o } = e, n = W(Qt(o), (c, a) => c.equals(a)), s = Mt(t(n))(e), r = () => n.set(Rt.of(Qt(o)));
1718
- let i = null;
1719
- return typeof ResizeObserver < "u" && (i = new ResizeObserver(r)), i == null || i.observe(o), F((c) => {
1720
- i == null || i.disconnect(), s(c);
1917
+ const xs = (t) => Ne((e) => {
1918
+ const { element: s } = e, n = N(se(s), (c, a) => c.equals(a)), r = $t(t(n))(e), i = () => n.set(Rt.of(se(s)));
1919
+ let o = null;
1920
+ return typeof ResizeObserver < "u" && (o = new ResizeObserver(i)), o == null || o.observe(s), H((c) => {
1921
+ o == null || o.disconnect(), r(c);
1721
1922
  });
1722
1923
  });
1723
- function Jt(t) {
1924
+ function oe(t) {
1724
1925
  return {
1725
1926
  /* c8 ignore next 6 */
1726
1927
  width: (t == null ? void 0 : t.innerWidth) ?? 0,
1727
1928
  height: (t == null ? void 0 : t.innerHeight) ?? 0
1728
1929
  };
1729
1930
  }
1730
- const fo = (t) => (e) => {
1731
- const o = at(), n = W(
1732
- Jt(o),
1733
- (i, c) => i.width === c.width && i.height === c.height
1734
- ), s = Mt(t(n))(e), r = () => n.set(Jt(o));
1735
- return o == null || o.addEventListener("resize", r), (i) => {
1736
- o == null || o.removeEventListener("resize", r), s(i);
1931
+ const bs = (t) => (e) => {
1932
+ const s = ot(), n = N(
1933
+ oe(s),
1934
+ (o, c) => o.width === c.width && o.height === c.height
1935
+ ), r = $t(t(n))(e), i = () => n.set(oe(s));
1936
+ return s == null || s.addEventListener("resize", i), (o) => {
1937
+ s == null || s.removeEventListener("resize", i), r(o);
1737
1938
  };
1738
- }, $n = (t, e) => {
1739
- const o = e.split("/").filter((s) => s !== ""), n = {};
1740
- for (let s = 0; s < t.length; s++) {
1741
- const r = t[s], i = o[s];
1742
- if (!i && r.type !== "catch-all")
1939
+ }, qn = (t, e) => {
1940
+ const s = e.split("/").filter((r) => r !== ""), n = {};
1941
+ for (let r = 0; r < t.length; r++) {
1942
+ const i = t[r], o = s[r];
1943
+ if (!o && i.type !== "catch-all")
1743
1944
  return null;
1744
- if (r.type === "literal") {
1745
- if (r.value !== i)
1945
+ if (i.type === "literal") {
1946
+ if (i.value !== o)
1746
1947
  return null;
1747
- } else if (r.type === "param")
1748
- n[r.name] = i;
1749
- else if (r.type === "catch-all")
1948
+ } else if (i.type === "param")
1949
+ n[i.name] = o;
1950
+ else if (i.type === "catch-all") {
1951
+ if (i.name) {
1952
+ const c = s.slice(r).join("/");
1953
+ n[i.name] = c;
1954
+ }
1750
1955
  return { params: n, path: e };
1956
+ }
1751
1957
  }
1752
- return o.length !== t.length ? null : { params: n, path: e };
1753
- }, Ae = (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 !== ""), ho = (t) => {
1754
- const e = t.map((o) => {
1755
- const n = Ae(o);
1756
- return { route: o, segments: n };
1958
+ return s.length !== t.length ? null : { params: n, path: e };
1959
+ }, Te = (t) => t.split("/").map((e) => {
1960
+ if (e.startsWith(":"))
1961
+ return { type: "param", name: e.slice(1) };
1962
+ if (e.startsWith("*")) {
1963
+ const s = e.slice(1);
1964
+ return s != "" ? { type: "catch-all", name: s } : { type: "catch-all" };
1965
+ } else
1966
+ return { type: "literal", value: e };
1967
+ }).filter((e) => e.type !== "literal" || e.value !== ""), Os = (t) => {
1968
+ const e = t.map((s) => {
1969
+ const n = Te(s);
1970
+ return { route: s, segments: n };
1757
1971
  });
1758
1972
  return function(n) {
1759
- for (const { segments: s, route: r } of e) {
1760
- const i = $n(s, n);
1761
- if (i)
1762
- return { ...i, route: r };
1973
+ for (const { segments: r, route: i } of e) {
1974
+ const o = qn(r, n);
1975
+ if (o)
1976
+ return { ...o, route: i };
1763
1977
  }
1764
1978
  return null;
1765
1979
  };
1766
- }, Ct = {
1767
- mark: Wt("RouterContext"),
1980
+ }, Ft = {
1981
+ mark: Nt("RouterContext"),
1768
1982
  create: () => {
1769
- const t = W([]);
1983
+ const t = N([]);
1770
1984
  return {
1771
1985
  value: t,
1772
1986
  dispose: () => t.dispose()
1773
1987
  };
1774
1988
  }
1775
- }, Bn = (t, e, o) => {
1776
- const n = o.split("/").filter((i) => i !== ""), s = {};
1777
- let r = 0;
1778
- for (let i = 0; i < t.length; i++) {
1779
- const c = t[i], a = n[i];
1989
+ }, Xn = (t, e, s) => {
1990
+ const n = s.split("/").filter((o) => o !== ""), r = {};
1991
+ let i = 0;
1992
+ for (let o = 0; o < t.length; o++) {
1993
+ const c = t[o], a = n[o];
1780
1994
  if (!a && c.type !== "catch-all")
1781
1995
  return null;
1782
1996
  if (c.type === "literal") {
1783
1997
  if (c.value !== a)
1784
1998
  return null;
1785
- r++;
1999
+ i++;
1786
2000
  } else if (c.type === "param")
1787
- s[c.name] = a, r++;
2001
+ r[c.name] = a, i++;
1788
2002
  else if (c.type === "catch-all") {
1789
- const l = "/" + n.slice(0, r).join("/"), f = "/" + n.slice(r).join("/");
2003
+ c.name && (r[c.name] = n.slice(i).join("/"));
2004
+ const l = "/" + n.slice(0, i).join("/"), u = "/" + n.slice(i).join("/");
1790
2005
  return {
1791
- params: s,
2006
+ params: r,
1792
2007
  matchedPath: l === "/" ? "" : l,
1793
- remainingPath: f === "/" ? "" : f,
2008
+ remainingPath: u === "/" ? "" : u,
1794
2009
  route: e
1795
2010
  };
1796
2011
  }
1797
2012
  }
1798
2013
  if (n.length === t.length) {
1799
- const i = "/" + n.join("/");
2014
+ const o = "/" + n.join("/");
1800
2015
  return {
1801
- params: s,
1802
- matchedPath: i === "/" ? "" : i,
2016
+ params: r,
2017
+ matchedPath: o === "/" ? "" : o,
1803
2018
  remainingPath: "",
1804
2019
  route: e
1805
2020
  };
1806
2021
  }
1807
2022
  return null;
1808
- }, Oe = (t) => {
1809
- const e = t.map((o) => {
1810
- const n = Ae(o);
1811
- return { route: o, segments: n };
2023
+ }, ke = (t) => {
2024
+ const e = t.map((s) => {
2025
+ const n = Te(s);
2026
+ return { route: s, segments: n };
1812
2027
  });
1813
2028
  return function(n) {
1814
- for (const { segments: s, route: r } of e) {
1815
- const i = Bn(s, r, n);
1816
- if (i)
1817
- return i;
2029
+ for (const { segments: r, route: i } of e) {
2030
+ const o = Xn(r, i, n);
2031
+ if (o)
2032
+ return o;
1818
2033
  }
1819
2034
  return null;
1820
2035
  };
1821
- }, mo = (t) => {
1822
- const e = Oe(Object.keys(t));
1823
- return Ce(
1824
- Ct,
2036
+ }, As = (t) => {
2037
+ const e = ke(Object.keys(t));
2038
+ return He(
2039
+ Ft,
1825
2040
  {},
1826
- () => it(Nt, (o) => it(Ct, (n) => {
1827
- const s = o.map((r) => {
1828
- const i = e(r.pathname);
1829
- if (i == null)
1830
- throw console.error("No route found for", r), new Error("No route found");
2041
+ () => at(zt, (s) => at(Ft, (n) => {
2042
+ const r = s.location.map((i) => {
2043
+ const o = e(i.pathname);
2044
+ if (o == null)
2045
+ throw console.error("No route found for", i), new Error("No route found");
1831
2046
  const c = {
1832
- matchedPath: i.matchedPath,
1833
- remainingPath: i.remainingPath,
1834
- fullPath: r.pathname,
1835
- params: i.params
2047
+ matchedPath: o.matchedPath,
2048
+ remainingPath: o.remainingPath,
2049
+ fullPath: i.pathname,
2050
+ params: o.params
1836
2051
  };
1837
2052
  return n.value = [...n.value, c], {
1838
- params: i.params,
1839
- route: i.route,
1840
- path: i.matchedPath || r.pathname,
1841
- search: r.search,
1842
- hash: r.hash
2053
+ params: o.params,
2054
+ route: o.route,
2055
+ path: o.matchedPath || i.pathname,
2056
+ search: i.search,
2057
+ hash: i.hash
1843
2058
  };
1844
2059
  });
1845
- return ce(
1846
- s.map((r) => [r.route, r]),
2060
+ return de(
2061
+ r.map((i) => [i.route, i]),
1847
2062
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1848
2063
  t
1849
2064
  );
1850
2065
  }))
1851
2066
  );
1852
- }, go = (t) => {
1853
- const e = Oe(Object.keys(t));
1854
- return it(Ct, (o) => it(Nt, (n) => {
1855
- const s = o.map((r) => {
1856
- const i = r[r.length - 1], c = (i == null ? void 0 : i.remainingPath) || "";
2067
+ }, Rs = (t) => {
2068
+ const e = ke(Object.keys(t));
2069
+ return at(Ft, (s) => at(zt, (n) => {
2070
+ const r = s.map((i) => {
2071
+ const o = i[i.length - 1], c = (o == null ? void 0 : o.remainingPath) || "";
1857
2072
  if (c === "")
1858
- throw console.error("No remaining path for SubRouter", r), new Error("No remaining path for SubRouter");
2073
+ throw console.error("No remaining path for SubRouter", i), new Error("No remaining path for SubRouter");
1859
2074
  const a = e(c);
1860
2075
  if (a == null)
1861
2076
  throw console.error("No route found for remaining path", c), new Error("No route found");
@@ -1864,152 +2079,152 @@ const fo = (t) => (e) => {
1864
2079
  // Only this router's parameters
1865
2080
  route: a.route,
1866
2081
  path: a.matchedPath,
1867
- search: n.value.search,
1868
- hash: n.value.hash
2082
+ search: n.location.value.search,
2083
+ hash: n.location.value.hash
1869
2084
  };
1870
2085
  });
1871
- return ce(
1872
- s.map((r) => [r.route, r]),
2086
+ return de(
2087
+ r.map((i) => [i.route, i]),
1873
2088
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1874
2089
  t
1875
2090
  );
1876
2091
  }));
1877
- }, yt = 60 * 1e3, Dt = 60 * yt, ct = 24 * Dt, Gt = 7 * ct, Zt = 30 * ct, Hn = 365 * ct, Un = [
2092
+ }, xt = 60 * 1e3, Mt = 60 * xt, ut = 24 * Mt, re = 7 * ut, ie = 30 * ut, Qn = 365 * ut, Jn = [
1878
2093
  {
1879
- max: yt * 90,
1880
- value: yt,
2094
+ max: xt * 90,
2095
+ value: xt,
1881
2096
  name: "minute",
1882
2097
  past: { singular: "a minute ago", plural: "{} minutes ago" },
1883
2098
  future: { singular: "in a minute", plural: "in {} minutes" }
1884
2099
  },
1885
2100
  {
1886
- max: Dt * 36,
1887
- value: Dt,
2101
+ max: Mt * 36,
2102
+ value: Mt,
1888
2103
  name: "hour",
1889
2104
  past: { singular: "an hour ago", plural: "{} hours ago" },
1890
2105
  future: { singular: "in an hour", plural: "in {} hours" }
1891
2106
  },
1892
2107
  {
1893
- max: ct * 10,
1894
- value: ct,
2108
+ max: ut * 10,
2109
+ value: ut,
1895
2110
  name: "day",
1896
2111
  past: { singular: "yesterday", plural: "{} days ago" },
1897
2112
  future: { singular: "tomorrow", plural: "in {} days" }
1898
2113
  },
1899
2114
  {
1900
- max: Gt * 6,
1901
- value: Gt,
2115
+ max: re * 6,
2116
+ value: re,
1902
2117
  name: "week",
1903
2118
  past: { singular: "last week", plural: "{} weeks ago" },
1904
2119
  future: { singular: "in a week", plural: "in {} weeks" }
1905
2120
  },
1906
2121
  {
1907
- max: Zt * 18,
1908
- value: Zt,
2122
+ max: ie * 18,
2123
+ value: ie,
1909
2124
  name: "month",
1910
2125
  past: { singular: "last month", plural: "{} months ago" },
1911
2126
  future: { singular: "in a month", plural: "in {} months" }
1912
2127
  },
1913
2128
  {
1914
2129
  max: 1 / 0,
1915
- value: Hn,
2130
+ value: Qn,
1916
2131
  name: "year",
1917
2132
  past: { singular: "last year", plural: "{} years ago" },
1918
2133
  future: { singular: "in a year", plural: "in {} years" }
1919
2134
  }
1920
2135
  ];
1921
- function te(t, e, o, n) {
1922
- const s = Math.round(t / e);
1923
- return s <= 1 ? o : n.replace(
2136
+ function ce(t, e, s, n) {
2137
+ const r = Math.round(t / e);
2138
+ return r <= 1 ? s : n.replace(
1924
2139
  "{}",
1925
- s.toLocaleString(void 0, {
2140
+ r.toLocaleString(void 0, {
1926
2141
  maximumFractionDigits: 0,
1927
2142
  minimumFractionDigits: 0
1928
2143
  })
1929
2144
  );
1930
2145
  }
1931
- const zn = (t = 1e3) => {
1932
- const e = W(/* @__PURE__ */ new Date()), o = We(() => e.set(/* @__PURE__ */ new Date()), t);
1933
- return e.onDispose(o), e;
1934
- }, Kn = (t) => {
2146
+ const Gn = (t = 1e3) => {
2147
+ const e = N(/* @__PURE__ */ new Date()), s = $e(() => e.set(/* @__PURE__ */ new Date()), t);
2148
+ return e.onDispose(s), e;
2149
+ }, Zn = (t) => {
1935
2150
  const e = Math.abs(t);
1936
- if (e < yt)
2151
+ if (e < xt)
1937
2152
  return t < 0 ? "just now" : "in a moment";
1938
- for (const o of Un)
1939
- if (e < o.max)
1940
- return t < 0 ? te(e, o.value, o.past.singular, o.past.plural) : te(e, o.value, o.future.singular, o.future.plural);
2153
+ for (const s of Jn)
2154
+ if (e < s.max)
2155
+ return t < 0 ? ce(e, s.value, s.past.singular, s.past.plural) : ce(e, s.value, s.future.singular, s.future.plural);
1941
2156
  throw new Error("unreachable");
1942
- }, jn = (t, { now: e, frequency: o = 1e4 } = {}) => {
1943
- const n = e != null ? ee.is(e) ? e.derive() : W(e) : zn(o), s = re(
2157
+ }, ts = (t, { now: e, frequency: s = 1e4 } = {}) => {
2158
+ const n = e != null ? ae.is(e) ? e.derive() : N(e) : Gn(s), r = Ht(
1944
2159
  t,
1945
2160
  n
1946
- )((r, i) => r.getTime() - i.getTime());
1947
- return s.onDispose(() => L.dispose(n)), s;
1948
- }, _n = (t, e = {}) => {
1949
- const o = jn(t, e), n = o.map(Kn);
1950
- return n.onDispose(o.dispose), n;
1951
- }, po = (t, e = {}) => _n(t, e);
1952
- class In extends De {
2161
+ )((i, o) => i.getTime() - o.getTime());
2162
+ return r.onDispose(() => C.dispose(n)), r;
2163
+ }, es = (t, e = {}) => {
2164
+ const s = ts(t, e), n = s.map(Zn);
2165
+ return n.onDispose(s.dispose), n;
2166
+ }, Ls = (t, e = {}) => es(t, e);
2167
+ class ns extends Ve {
1953
2168
  constructor() {
1954
2169
  super(...arguments);
1955
2170
  /**
1956
2171
  * Triggers an update of the Ticker by incrementing its internal value.
1957
2172
  * @returns void
1958
2173
  */
1959
- At(this, "tick", () => this.update((o) => o + 1));
2174
+ Lt(this, "tick", () => this.update((s) => s + 1));
1960
2175
  }
1961
2176
  }
1962
- const wo = (t = 0) => new In(t, (e, o) => e === o);
2177
+ const Ss = (t = 0) => new ns(t, (e, s) => e === s);
1963
2178
  export {
1964
- je as Anchor,
1965
- Qn as Appearance,
1966
- ue as AsyncResultView,
1967
- Jn as AutoFocus,
1968
- Gn as AutoSelect,
1969
- go as ChildRouter,
1970
- uo as ElementRect,
1971
- eo as HTMLTitle,
1972
- to as HiddenWhenEmpty,
1973
- Xe as InViewport,
1974
- Nt as Location,
1975
- io as Mutation,
1976
- Ge as MutationDisplay,
1977
- qe as OnClickOutside,
1978
- oo as OnEnterKey,
1979
- so as OnEscapeKey,
1980
- fe as OnKeyPressed,
1981
- co as PopOver,
1982
- ao as Query,
1983
- Nn as QueryDisplay,
2179
+ tn as Anchor,
2180
+ is as Appearance,
2181
+ pe as AsyncResultView,
2182
+ cs as AutoFocus,
2183
+ as as AutoSelect,
2184
+ Rs as ChildRouter,
2185
+ xs as ElementRect,
2186
+ fs as HTMLTitle,
2187
+ us as HiddenWhenEmpty,
2188
+ on as InViewport,
2189
+ zt as Location,
2190
+ gs as Mutation,
2191
+ ln as MutationDisplay,
2192
+ rn as OnClickOutside,
2193
+ ds as OnEnterKey,
2194
+ ms as OnEscapeKey,
2195
+ we as OnKeyPressed,
2196
+ ws as PopOver,
2197
+ ys as Query,
2198
+ In as QueryDisplay,
1984
2199
  Rt as Rect,
1985
- Vn as ResultView,
1986
- mo as RootRouter,
1987
- Ct as RouterContextProvider,
1988
- lo as SelectOnFocus,
1989
- In as Ticker,
1990
- no as WhenInViewport,
1991
- fo as WindowSize,
1992
- Me as _checkExtensionCondition,
1993
- Fe as _getExtension,
1994
- ho as _makeRouteMatcher,
1995
- Ae as _parseRouteSegments,
1996
- ro as allPlacements,
1997
- $e as areLocationsEqual,
1998
- Zn as classes,
1999
- Qt as getAbsoluteRect,
2000
- Ve as handleAnchorClick,
2001
- le as locationFromURL,
2002
- Je as makeMutationResource,
2003
- Mn as makeQueryResource,
2004
- Qe as matchesKeyCombo,
2005
- $n as matchesRoute,
2006
- zn as nowSignal,
2007
- po as relativeTime,
2008
- jn as relativeTimeMillisSignal,
2009
- _n as relativeTimeSignal,
2010
- Kt as setLocationFromUrl,
2011
- wo as ticker,
2012
- Kn as timeDiffToString,
2013
- Pt as urlFromLocation,
2014
- _e as useAppearance
2200
+ Yn as ResultView,
2201
+ As as RootRouter,
2202
+ Ft as RouterContextProvider,
2203
+ vs as SelectOnFocus,
2204
+ ns as Ticker,
2205
+ hs as WhenInViewport,
2206
+ bs as WindowSize,
2207
+ Be as _checkExtensionCondition,
2208
+ ze as _getExtension,
2209
+ Os as _makeRouteMatcher,
2210
+ Te as _parseRouteSegments,
2211
+ ps as allPlacements,
2212
+ Ue as areLocationsEqual,
2213
+ ls as classes,
2214
+ Qt as evaluateLocationMatch,
2215
+ se as getAbsoluteRect,
2216
+ Ke as handleAnchorClick,
2217
+ Tt as locationFromURL,
2218
+ an as makeMutationResource,
2219
+ jn as makeQueryResource,
2220
+ cn as matchesKeyCombo,
2221
+ qn as matchesRoute,
2222
+ Gn as nowSignal,
2223
+ Ls as relativeTime,
2224
+ ts as relativeTimeMillisSignal,
2225
+ es as relativeTimeSignal,
2226
+ Ss as ticker,
2227
+ Zn as timeDiffToString,
2228
+ et as urlFromLocation,
2229
+ en as useAppearance
2015
2230
  };