@tempots/ui 2.8.0 → 2.10.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,33 +1,33 @@
1
- var he = Object.defineProperty;
2
- var me = (t, e, n) => e in t ? he(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var kt = (t, e, n) => me(t, typeof e != "symbol" ? e + "" : e, n);
4
- import { getWindow as J, prop as W, makeProviderMark as Ut, Signal as Bt, Use as zt, html as _t, on as It, Value as B, attr as jt, Empty as mt, OneOfType as Yt, WithElement as G, OnDispose as P, Portal as Kt, Fragment as xt, renderableOfTNode as vt, When as qt, WithBrowserCtx as Xt, OneOfTuple as pe, computedOf as ge, Prop as ye } from "@tempots/dom";
5
- import { delayed as Jt, AsyncResult as C, interval as we } from "@tempots/std";
6
- const xe = (t) => {
1
+ var ge = Object.defineProperty;
2
+ var ye = (t, e, n) => e in t ? ge(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var pt = (t, e, n) => ye(t, typeof e != "symbol" ? e + "" : e, n);
4
+ import { getWindow as J, prop as W, makeProviderMark as _t, Signal as It, Use as jt, html as Yt, on as qt, Value as D, attr as Kt, Empty as yt, OneOfType as Xt, WithElement as G, OnDispose as F, Portal as Jt, Fragment as At, renderableOfTNode as Rt, When as Gt, WithBrowserCtx as Qt, OneOfTuple as we, computedOf as xe, Prop as ve } from "@tempots/dom";
5
+ import { delayed as Zt, AsyncResult as C, nearEquals as tt, interval as be } from "@tempots/std";
6
+ const Ae = (t) => {
7
7
  const e = t.split("/").pop();
8
8
  if (e == null || e.startsWith(".")) return;
9
9
  const n = e.split(".") || [];
10
10
  return n.length > 1 ? "." + n.pop() : void 0;
11
- }, ve = (t, e) => {
12
- const n = xe(e);
11
+ }, Re = (t, e) => {
12
+ const n = Ae(e);
13
13
  return n != null && (t.length === 0 || !t.some((o) => n == o));
14
- }, be = (t, e, n, o) => {
14
+ }, Ee = (t, e, n, o) => {
15
15
  let s = t.target;
16
16
  for (; s != null && !(s instanceof HTMLAnchorElement); )
17
17
  s = s.parentElement;
18
18
  if (s == 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 = s;
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: l } = r;
23
+ const { pathname: r, search: c, hash: l } = i;
24
24
  if (o) {
25
- const a = i + c + l, f = r.getAttribute("href");
25
+ const a = r + c + l, f = i.getAttribute("href");
26
26
  if (!(f != null && f.startsWith("#")) && f !== a)
27
27
  return !0;
28
28
  }
29
- return e ? !1 : ve(n, i);
30
- }, Ae = (t, e = {
29
+ return e ? !1 : Re(n, r);
30
+ }, Le = (t, e = {
31
31
  ignoreUrlWithExtension: !0,
32
32
  allowedExtensions: [],
33
33
  ignoreExternalUrl: !0
@@ -36,40 +36,40 @@ const xe = (t) => {
36
36
  (o) => o.startsWith(".") ? o : "." + o
37
37
  ) : [];
38
38
  return (o) => {
39
- be(
39
+ Ee(
40
40
  o,
41
41
  e.ignoreUrlWithExtension ?? !0,
42
42
  n,
43
43
  e.ignoreExternalUrl ?? !0
44
44
  ) || t() && o.preventDefault();
45
45
  };
46
- }, Re = (t, e) => t.pathname === e.pathname && JSON.stringify(t.search) === JSON.stringify(e.search) && t.hash === e.hash, Gt = (t, e) => {
47
- var r;
48
- const n = new URL(t, e ?? ((r = J()) == null ? void 0 : r.location.toString())), o = Object.fromEntries(n.searchParams.entries());
46
+ }, Oe = (t, e) => t.pathname === e.pathname && JSON.stringify(t.search) === JSON.stringify(e.search) && t.hash === e.hash, te = (t, e) => {
47
+ var i;
48
+ const n = new URL(t, e ?? ((i = J()) == null ? void 0 : i.location.toString())), o = Object.fromEntries(n.searchParams.entries());
49
49
  let s = n.hash;
50
50
  return s.startsWith("#") && (s = s.substring(1)), {
51
51
  pathname: n.pathname,
52
52
  search: o,
53
53
  hash: s === "" ? void 0 : s
54
54
  };
55
- }, Ct = (t, e) => {
56
- const n = Gt(e);
55
+ }, Pt = (t, e) => {
56
+ const n = te(e);
57
57
  return t.set(n), t;
58
- }, pt = (t) => {
58
+ }, wt = (t) => {
59
59
  const n = new URLSearchParams(t.search).toString(), o = t.hash;
60
60
  return `${t.pathname}${n ? `?${n}` : ""}${o ? `#${o}` : ""}`;
61
- }, Ee = (t) => t.startsWith("http://") || t.startsWith("https://") || t.startsWith("//"), Le = (t) => {
61
+ }, Te = (t) => t.startsWith("http://") || t.startsWith("https://") || t.startsWith("//"), Se = (t) => {
62
62
  const e = t.container.currentURL, n = e.iso(
63
- (o) => Gt(o),
63
+ (o) => te(o),
64
64
  (o) => {
65
- if (Ee(o.pathname))
66
- return pt(o);
67
- const s = new URL(o.pathname, e.value), r = s.origin + s.pathname;
68
- return pt({ ...o, pathname: r });
65
+ if (Te(o.pathname))
66
+ return wt(o);
67
+ const s = new URL(o.pathname, e.value), i = s.origin + s.pathname;
68
+ return wt({ ...o, pathname: i });
69
69
  }
70
70
  );
71
71
  return { value: n, dispose: n.dispose };
72
- }, Oe = () => {
72
+ }, ke = () => {
73
73
  const t = J(), e = (t == null ? void 0 : t.location.hash) === "" ? void 0 : (t == null ? void 0 : t.location.hash.substring(1)) ?? void 0;
74
74
  return {
75
75
  pathname: (t == null ? void 0 : t.location.pathname) ?? "",
@@ -78,8 +78,8 @@ const xe = (t) => {
78
78
  ),
79
79
  hash: e
80
80
  };
81
- }, Te = () => {
82
- const t = W(Oe(), Re), e = J(), n = () => {
81
+ }, Ce = () => {
82
+ const t = W(ke(), Oe), e = J(), n = () => {
83
83
  let o = (e == null ? void 0 : e.location.hash) ?? "";
84
84
  o.startsWith("#") && (o = o.substring(1));
85
85
  const s = {
@@ -94,67 +94,67 @@ const xe = (t) => {
94
94
  return e == null || e.addEventListener("popstate", n), t.onDispose(() => {
95
95
  e == null || e.removeEventListener("popstate", n);
96
96
  }), t.on((o) => {
97
- e == null || e.history.pushState({}, "", pt(o));
97
+ e == null || e.history.pushState({}, "", wt(o));
98
98
  }), {
99
99
  value: t,
100
100
  dispose: t.dispose
101
101
  };
102
- }, Qt = {
103
- mark: Ut("LocationProvider"),
102
+ }, ee = {
103
+ mark: _t("LocationProvider"),
104
104
  create: (t, e) => {
105
105
  if (e.isBrowser())
106
- return Te();
106
+ return Ce();
107
107
  if (e.isHeadless())
108
- return Le(e);
108
+ return Se(e);
109
109
  throw new Error("Unknown context");
110
110
  }
111
- }, Se = (t) => {
111
+ }, De = (t) => {
112
112
  document.startViewTransition ? document.startViewTransition(t) : t();
113
- }, ke = (t, ...e) => {
114
- if (typeof t == "string" || Bt.is(t))
115
- return ke({ href: t }, ...e);
113
+ }, Pe = (t, ...e) => {
114
+ if (typeof t == "string" || It.is(t))
115
+ return Pe({ href: t }, ...e);
116
116
  const {
117
117
  href: n,
118
118
  withViewTransition: o,
119
119
  ...s
120
120
  } = t;
121
- return zt(Qt, (r) => _t.a(
122
- It.click(
123
- Ae(() => (o == !0 ? Se(() => {
124
- Ct(r, B.get(n));
125
- }) : Ct(r, B.get(n)), !0), s)
121
+ return jt(ee, (i) => Yt.a(
122
+ qt.click(
123
+ Le(() => (o == !0 ? De(() => {
124
+ Pt(i, D.get(n));
125
+ }) : Pt(i, D.get(n)), !0), s)
126
126
  ),
127
- jt.href(n),
127
+ Kt.href(n),
128
128
  ...e
129
129
  ));
130
- }, Cn = {
131
- mark: Ut("Appearance"),
130
+ }, Fn = {
131
+ mark: _t("Appearance"),
132
132
  create: () => {
133
- const t = J(), e = t != null && t.matchMedia != null ? t.matchMedia("(prefers-color-scheme: dark)") : void 0, n = (e == null ? void 0 : e.matches) ?? !1, o = W(n ? "dark" : "light"), s = (r) => o.set(r.matches ? "dark" : "light");
133
+ const t = J(), e = t != null && t.matchMedia != null ? t.matchMedia("(prefers-color-scheme: dark)") : void 0, n = (e == null ? void 0 : e.matches) ?? !1, o = W(n ? "dark" : "light"), s = (i) => o.set(i.matches ? "dark" : "light");
134
134
  return e == null || e.addEventListener("change", s), {
135
135
  value: o,
136
136
  dispose: () => e == null ? void 0 : e.removeEventListener("change", s)
137
137
  };
138
138
  }
139
- }, Zt = (t, e) => {
139
+ }, ne = (t, e) => {
140
140
  if (typeof e == "function")
141
- return Zt(t, { success: e });
142
- const n = e.failure ?? ((i) => i.map((c) => `Error: ${c}`)), o = e.success, s = e.loading ?? (() => mt), r = e.notAsked ?? (() => mt);
143
- return Yt(B.toSignal(t), {
144
- AsyncSuccess: (i) => o(i.$.value),
145
- AsyncFailure: (i) => n(i.$.error),
146
- Loading: (i) => s(i.map((c) => c.previousValue)),
147
- NotAsked: r
141
+ return ne(t, { success: e });
142
+ const n = e.failure ?? ((r) => r.map((c) => `Error: ${c}`)), o = e.success, s = e.loading ?? (() => yt), i = e.notAsked ?? (() => yt);
143
+ return Xt(D.toSignal(t), {
144
+ AsyncSuccess: (r) => o(r.$.value),
145
+ AsyncFailure: (r) => n(r.$.error),
146
+ Loading: (r) => s(r.map((c) => c.previousValue)),
147
+ NotAsked: i
148
148
  });
149
- }, Dn = (t = 10) => G((e) => P(Jt(() => e == null ? void 0 : e.focus(), t))), Wn = (t = 10) => G((e) => {
150
- const n = Jt(() => e.select(), t);
151
- return P(n);
152
- }), Pn = G((t) => {
149
+ }, Mn = (t = 10) => G((e) => F(Zt(() => e == null ? void 0 : e.focus(), t))), Vn = (t = 10) => G((e) => {
150
+ const n = Zt(() => e.select(), t);
151
+ return F(n);
152
+ }), Nn = G((t) => {
153
153
  const e = t.style.getPropertyValue(":empty");
154
- return t.style.setProperty(":empty", "display:none"), P((n) => {
154
+ return t.style.setProperty(":empty", "display:none"), F((n) => {
155
155
  n && t.style.setProperty(":empty", e);
156
156
  });
157
- }), Fn = (t) => Kt("head > title", jt.innerText(t)), Ce = {
157
+ }), $n = (t) => Jt("head > title", Kt.innerText(t)), We = {
158
158
  partial: {
159
159
  root: null,
160
160
  rootMargin: "0px",
@@ -165,104 +165,104 @@ const xe = (t) => {
165
165
  rootMargin: "0px",
166
166
  threshold: 1
167
167
  }
168
- }, et = {
168
+ }, nt = {
169
169
  partial: /* @__PURE__ */ new Map(),
170
170
  full: /* @__PURE__ */ new Map()
171
- }, K = {
171
+ }, q = {
172
172
  partial: null,
173
173
  full: null
174
174
  };
175
- function De(t) {
176
- return K[t] == null && (K[t] = new IntersectionObserver((e) => {
175
+ function Fe(t) {
176
+ return q[t] == null && (q[t] = new IntersectionObserver((e) => {
177
177
  e.forEach((n) => {
178
- const o = et[t].get(n.target);
178
+ const o = nt[t].get(n.target);
179
179
  o == null || o.set(n.isIntersecting);
180
180
  });
181
- }, Ce[t])), K[t];
181
+ }, We[t])), q[t];
182
182
  }
183
- const We = (t, e) => {
183
+ const Me = (t, e) => {
184
184
  const n = W(!1);
185
- return xt(
185
+ return At(
186
186
  G((o) => {
187
- const s = typeof IntersectionObserver < "u" ? De(t) : null;
188
- return et[t].set(o, n), s == null || s.observe(o), P(() => {
189
- var r;
190
- n.dispose(), s == null || s.unobserve(o), et[t].delete(o), et[t].size === 0 && ((r = K[t]) == null || r.disconnect(), K[t] = null);
187
+ const s = typeof IntersectionObserver < "u" ? Fe(t) : null;
188
+ return nt[t].set(o, n), s == null || s.observe(o), F(() => {
189
+ var i;
190
+ n.dispose(), s == null || s.unobserve(o), nt[t].delete(o), nt[t].size === 0 && ((i = q[t]) == null || i.disconnect(), q[t] = null);
191
191
  });
192
192
  }),
193
- vt(e(n))
193
+ Rt(e(n))
194
194
  );
195
- }, Mn = (t, e, n) => We(t, (o) => qt(o, e, n ?? (() => mt))), nt = Math.min, M = Math.max, ot = Math.round, tt = Math.floor, L = (t) => ({
195
+ }, Bn = (t, e, n) => Me(t, (o) => Gt(o, e, n ?? (() => yt))), ot = Math.min, V = Math.max, st = Math.round, et = Math.floor, L = (t) => ({
196
196
  x: t,
197
197
  y: t
198
- }), Pe = {
198
+ }), Ve = {
199
199
  left: "right",
200
200
  right: "left",
201
201
  bottom: "top",
202
202
  top: "bottom"
203
- }, Fe = {
203
+ }, Ne = {
204
204
  start: "end",
205
205
  end: "start"
206
206
  };
207
- function Dt(t, e, n) {
208
- return M(t, nt(e, n));
207
+ function Wt(t, e, n) {
208
+ return V(t, ot(e, n));
209
209
  }
210
- function ct(t, e) {
210
+ function lt(t, e) {
211
211
  return typeof t == "function" ? t(e) : t;
212
212
  }
213
- function V(t) {
213
+ function N(t) {
214
214
  return t.split("-")[0];
215
215
  }
216
- function lt(t) {
216
+ function at(t) {
217
217
  return t.split("-")[1];
218
218
  }
219
- function te(t) {
219
+ function oe(t) {
220
220
  return t === "x" ? "y" : "x";
221
221
  }
222
- function ee(t) {
222
+ function se(t) {
223
223
  return t === "y" ? "height" : "width";
224
224
  }
225
225
  function z(t) {
226
- return ["top", "bottom"].includes(V(t)) ? "y" : "x";
226
+ return ["top", "bottom"].includes(N(t)) ? "y" : "x";
227
227
  }
228
- function ne(t) {
229
- return te(z(t));
228
+ function ie(t) {
229
+ return oe(z(t));
230
230
  }
231
- function Me(t, e, n) {
231
+ function $e(t, e, n) {
232
232
  n === void 0 && (n = !1);
233
- const o = lt(t), s = ne(t), r = ee(s);
234
- let i = s === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
235
- return e.reference[r] > e.floating[r] && (i = st(i)), [i, st(i)];
233
+ const o = at(t), s = ie(t), i = se(s);
234
+ let r = s === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
235
+ return e.reference[i] > e.floating[i] && (r = it(r)), [r, it(r)];
236
236
  }
237
- function Ve(t) {
238
- const e = st(t);
239
- return [gt(t), e, gt(e)];
237
+ function Be(t) {
238
+ const e = it(t);
239
+ return [xt(t), e, xt(e)];
240
240
  }
241
- function gt(t) {
242
- return t.replace(/start|end/g, (e) => Fe[e]);
241
+ function xt(t) {
242
+ return t.replace(/start|end/g, (e) => Ne[e]);
243
243
  }
244
- function Ne(t, e, n) {
245
- const o = ["left", "right"], s = ["right", "left"], r = ["top", "bottom"], i = ["bottom", "top"];
244
+ function Ue(t, e, n) {
245
+ const o = ["left", "right"], s = ["right", "left"], i = ["top", "bottom"], r = ["bottom", "top"];
246
246
  switch (t) {
247
247
  case "top":
248
248
  case "bottom":
249
249
  return n ? e ? s : o : e ? o : s;
250
250
  case "left":
251
251
  case "right":
252
- return e ? r : i;
252
+ return e ? i : r;
253
253
  default:
254
254
  return [];
255
255
  }
256
256
  }
257
- function $e(t, e, n, o) {
258
- const s = lt(t);
259
- let r = Ne(V(t), n === "start", o);
260
- return s && (r = r.map((i) => i + "-" + s), e && (r = r.concat(r.map(gt)))), r;
257
+ function He(t, e, n, o) {
258
+ const s = at(t);
259
+ let i = Ue(N(t), n === "start", o);
260
+ return s && (i = i.map((r) => r + "-" + s), e && (i = i.concat(i.map(xt)))), i;
261
261
  }
262
- function st(t) {
263
- return t.replace(/left|right|bottom|top/g, (e) => Pe[e]);
262
+ function it(t) {
263
+ return t.replace(/left|right|bottom|top/g, (e) => Ve[e]);
264
264
  }
265
- function He(t) {
265
+ function ze(t) {
266
266
  return {
267
267
  top: 0,
268
268
  right: 0,
@@ -271,8 +271,8 @@ function He(t) {
271
271
  ...t
272
272
  };
273
273
  }
274
- function Ue(t) {
275
- return typeof t != "number" ? He(t) : {
274
+ function _e(t) {
275
+ return typeof t != "number" ? ze(t) : {
276
276
  top: t,
277
277
  right: t,
278
278
  bottom: t,
@@ -297,69 +297,69 @@ function rt(t) {
297
297
  y: n
298
298
  };
299
299
  }
300
- function Wt(t, e, n) {
300
+ function Ft(t, e, n) {
301
301
  let {
302
302
  reference: o,
303
303
  floating: s
304
304
  } = t;
305
- const r = z(e), i = ne(e), c = ee(i), l = V(e), a = r === "y", f = o.x + o.width / 2 - s.width / 2, u = o.y + o.height / 2 - s.height / 2, h = o[c] / 2 - s[c] / 2;
306
- let d;
305
+ const i = z(e), r = ie(e), c = se(r), l = N(e), a = i === "y", f = o.x + o.width / 2 - s.width / 2, u = o.y + o.height / 2 - s.height / 2, d = o[c] / 2 - s[c] / 2;
306
+ let h;
307
307
  switch (l) {
308
308
  case "top":
309
- d = {
309
+ h = {
310
310
  x: f,
311
311
  y: o.y - s.height
312
312
  };
313
313
  break;
314
314
  case "bottom":
315
- d = {
315
+ h = {
316
316
  x: f,
317
317
  y: o.y + o.height
318
318
  };
319
319
  break;
320
320
  case "right":
321
- d = {
321
+ h = {
322
322
  x: o.x + o.width,
323
323
  y: u
324
324
  };
325
325
  break;
326
326
  case "left":
327
- d = {
327
+ h = {
328
328
  x: o.x - s.width,
329
329
  y: u
330
330
  };
331
331
  break;
332
332
  default:
333
- d = {
333
+ h = {
334
334
  x: o.x,
335
335
  y: o.y
336
336
  };
337
337
  }
338
- switch (lt(e)) {
338
+ switch (at(e)) {
339
339
  case "start":
340
- d[i] -= h * (n && a ? -1 : 1);
340
+ h[r] -= d * (n && a ? -1 : 1);
341
341
  break;
342
342
  case "end":
343
- d[i] += h * (n && a ? -1 : 1);
343
+ h[r] += d * (n && a ? -1 : 1);
344
344
  break;
345
345
  }
346
- return d;
346
+ return h;
347
347
  }
348
- const Be = async (t, e, n) => {
348
+ const Ie = async (t, e, n) => {
349
349
  const {
350
350
  placement: o = "bottom",
351
351
  strategy: s = "absolute",
352
- middleware: r = [],
353
- platform: i
354
- } = n, c = r.filter(Boolean), l = await (i.isRTL == null ? void 0 : i.isRTL(e));
355
- let a = await i.getElementRects({
352
+ middleware: i = [],
353
+ platform: r
354
+ } = n, c = i.filter(Boolean), l = await (r.isRTL == null ? void 0 : r.isRTL(e));
355
+ let a = await r.getElementRects({
356
356
  reference: t,
357
357
  floating: e,
358
358
  strategy: s
359
359
  }), {
360
360
  x: f,
361
361
  y: u
362
- } = Wt(a, o, l), h = o, d = {}, m = 0;
362
+ } = Ft(a, o, l), d = o, h = {}, m = 0;
363
363
  for (let g = 0; g < c.length; g++) {
364
364
  const {
365
365
  name: y,
@@ -373,72 +373,72 @@ const Be = async (t, e, n) => {
373
373
  x: f,
374
374
  y: u,
375
375
  initialPlacement: o,
376
- placement: h,
376
+ placement: d,
377
377
  strategy: s,
378
- middlewareData: d,
378
+ middlewareData: h,
379
379
  rects: a,
380
- platform: i,
380
+ platform: r,
381
381
  elements: {
382
382
  reference: t,
383
383
  floating: e
384
384
  }
385
385
  });
386
- f = w ?? f, u = x ?? u, d = {
387
- ...d,
386
+ f = w ?? f, u = x ?? u, h = {
387
+ ...h,
388
388
  [y]: {
389
- ...d[y],
389
+ ...h[y],
390
390
  ...b
391
391
  }
392
- }, v && m <= 50 && (m++, typeof v == "object" && (v.placement && (h = v.placement), v.rects && (a = v.rects === !0 ? await i.getElementRects({
392
+ }, v && m <= 50 && (m++, typeof v == "object" && (v.placement && (d = v.placement), v.rects && (a = v.rects === !0 ? await r.getElementRects({
393
393
  reference: t,
394
394
  floating: e,
395
395
  strategy: s
396
396
  }) : v.rects), {
397
397
  x: f,
398
398
  y: u
399
- } = Wt(a, h, l)), g = -1);
399
+ } = Ft(a, d, l)), g = -1);
400
400
  }
401
401
  return {
402
402
  x: f,
403
403
  y: u,
404
- placement: h,
404
+ placement: d,
405
405
  strategy: s,
406
- middlewareData: d
406
+ middlewareData: h
407
407
  };
408
408
  };
409
- async function oe(t, e) {
409
+ async function re(t, e) {
410
410
  var n;
411
411
  e === void 0 && (e = {});
412
412
  const {
413
413
  x: o,
414
414
  y: s,
415
- platform: r,
416
- rects: i,
415
+ platform: i,
416
+ rects: r,
417
417
  elements: c,
418
418
  strategy: l
419
419
  } = t, {
420
420
  boundary: a = "clippingAncestors",
421
421
  rootBoundary: f = "viewport",
422
422
  elementContext: u = "floating",
423
- altBoundary: h = !1,
424
- padding: d = 0
425
- } = ct(e, t), m = Ue(d), y = c[h ? u === "floating" ? "reference" : "floating" : u], p = rt(await r.getClippingRect({
426
- element: (n = await (r.isElement == null ? void 0 : r.isElement(y))) == null || n ? y : y.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(c.floating)),
423
+ altBoundary: d = !1,
424
+ padding: h = 0
425
+ } = lt(e, t), m = _e(h), y = c[d ? u === "floating" ? "reference" : "floating" : u], p = rt(await i.getClippingRect({
426
+ element: (n = await (i.isElement == null ? void 0 : i.isElement(y))) == null || n ? y : y.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(c.floating)),
427
427
  boundary: a,
428
428
  rootBoundary: f,
429
429
  strategy: l
430
430
  })), w = u === "floating" ? {
431
431
  x: o,
432
432
  y: s,
433
- width: i.floating.width,
434
- height: i.floating.height
435
- } : i.reference, x = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(c.floating)), b = await (r.isElement == null ? void 0 : r.isElement(x)) ? await (r.getScale == null ? void 0 : r.getScale(x)) || {
433
+ width: r.floating.width,
434
+ height: r.floating.height
435
+ } : r.reference, x = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(c.floating)), b = await (i.isElement == null ? void 0 : i.isElement(x)) ? await (i.getScale == null ? void 0 : i.getScale(x)) || {
436
436
  x: 1,
437
437
  y: 1
438
438
  } : {
439
439
  x: 1,
440
440
  y: 1
441
- }, v = rt(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
441
+ }, v = rt(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
442
442
  elements: c,
443
443
  rect: w,
444
444
  offsetParent: x,
@@ -451,7 +451,7 @@ async function oe(t, e) {
451
451
  right: (v.right - p.right + m.right) / b.x
452
452
  };
453
453
  }
454
- const ze = function(t) {
454
+ const je = function(t) {
455
455
  return t === void 0 && (t = {}), {
456
456
  name: "flip",
457
457
  options: t,
@@ -459,61 +459,61 @@ const ze = function(t) {
459
459
  var n, o;
460
460
  const {
461
461
  placement: s,
462
- middlewareData: r,
463
- rects: i,
462
+ middlewareData: i,
463
+ rects: r,
464
464
  initialPlacement: c,
465
465
  platform: l,
466
466
  elements: a
467
467
  } = e, {
468
468
  mainAxis: f = !0,
469
469
  crossAxis: u = !0,
470
- fallbackPlacements: h,
471
- fallbackStrategy: d = "bestFit",
470
+ fallbackPlacements: d,
471
+ fallbackStrategy: h = "bestFit",
472
472
  fallbackAxisSideDirection: m = "none",
473
473
  flipAlignment: g = !0,
474
474
  ...y
475
- } = ct(t, e);
476
- if ((n = r.arrow) != null && n.alignmentOffset)
475
+ } = lt(t, e);
476
+ if ((n = i.arrow) != null && n.alignmentOffset)
477
477
  return {};
478
- const p = V(s), w = z(c), x = V(c) === c, b = await (l.isRTL == null ? void 0 : l.isRTL(a.floating)), v = h || (x || !g ? [st(c)] : Ve(c)), $ = m !== "none";
479
- !h && $ && v.push(...$e(c, g, m, b));
480
- const fe = [c, ...v], dt = await oe(e, y), Z = [];
481
- let j = ((o = r.flip) == null ? void 0 : o.overflows) || [];
482
- if (f && Z.push(dt[p]), u) {
483
- const F = Me(s, i, b);
484
- Z.push(dt[F[0]], dt[F[1]]);
478
+ const p = N(s), w = z(c), x = N(c) === c, b = await (l.isRTL == null ? void 0 : l.isRTL(a.floating)), v = d || (x || !g ? [it(c)] : Be(c)), B = m !== "none";
479
+ !d && B && v.push(...He(c, g, m, b));
480
+ const me = [c, ...v], mt = await re(e, y), Z = [];
481
+ let j = ((o = i.flip) == null ? void 0 : o.overflows) || [];
482
+ if (f && Z.push(mt[p]), u) {
483
+ const M = $e(s, r, b);
484
+ Z.push(mt[M[0]], mt[M[1]]);
485
485
  }
486
486
  if (j = [...j, {
487
487
  placement: s,
488
488
  overflows: Z
489
- }], !Z.every((F) => F <= 0)) {
490
- var Lt, Ot;
491
- const F = (((Lt = r.flip) == null ? void 0 : Lt.index) || 0) + 1, St = fe[F];
492
- if (St)
489
+ }], !Z.every((M) => M <= 0)) {
490
+ var St, kt;
491
+ const M = (((St = i.flip) == null ? void 0 : St.index) || 0) + 1, Dt = me[M];
492
+ if (Dt)
493
493
  return {
494
494
  data: {
495
- index: F,
495
+ index: M,
496
496
  overflows: j
497
497
  },
498
498
  reset: {
499
- placement: St
499
+ placement: Dt
500
500
  }
501
501
  };
502
- let Y = (Ot = j.filter((H) => H.overflows[0] <= 0).sort((H, S) => H.overflows[1] - S.overflows[1])[0]) == null ? void 0 : Ot.placement;
502
+ let Y = (kt = j.filter((U) => U.overflows[0] <= 0).sort((U, S) => U.overflows[1] - S.overflows[1])[0]) == null ? void 0 : kt.placement;
503
503
  if (!Y)
504
- switch (d) {
504
+ switch (h) {
505
505
  case "bestFit": {
506
- var Tt;
507
- const H = (Tt = j.filter((S) => {
508
- if ($) {
506
+ var Ct;
507
+ const U = (Ct = j.filter((S) => {
508
+ if (B) {
509
509
  const k = z(S.placement);
510
510
  return k === w || // Create a bias to the `y` side axis due to horizontal
511
511
  // reading directions favoring greater width.
512
512
  k === "y";
513
513
  }
514
514
  return !0;
515
- }).map((S) => [S.placement, S.overflows.filter((k) => k > 0).reduce((k, de) => k + de, 0)]).sort((S, k) => S[1] - k[1])[0]) == null ? void 0 : Tt[0];
516
- H && (Y = H);
515
+ }).map((S) => [S.placement, S.overflows.filter((k) => k > 0).reduce((k, pe) => k + pe, 0)]).sort((S, k) => S[1] - k[1])[0]) == null ? void 0 : Ct[0];
516
+ U && (Y = U);
517
517
  break;
518
518
  }
519
519
  case "initialPlacement":
@@ -531,15 +531,15 @@ const ze = function(t) {
531
531
  }
532
532
  };
533
533
  };
534
- async function _e(t, e) {
534
+ async function Ye(t, e) {
535
535
  const {
536
536
  placement: n,
537
537
  platform: o,
538
538
  elements: s
539
- } = t, r = await (o.isRTL == null ? void 0 : o.isRTL(s.floating)), i = V(n), c = lt(n), l = z(n) === "y", a = ["left", "top"].includes(i) ? -1 : 1, f = r && l ? -1 : 1, u = ct(e, t);
539
+ } = t, i = await (o.isRTL == null ? void 0 : o.isRTL(s.floating)), r = N(n), c = at(n), l = z(n) === "y", a = ["left", "top"].includes(r) ? -1 : 1, f = i && l ? -1 : 1, u = lt(e, t);
540
540
  let {
541
- mainAxis: h,
542
- crossAxis: d,
541
+ mainAxis: d,
542
+ crossAxis: h,
543
543
  alignmentAxis: m
544
544
  } = typeof u == "number" ? {
545
545
  mainAxis: u,
@@ -550,15 +550,15 @@ async function _e(t, e) {
550
550
  crossAxis: u.crossAxis || 0,
551
551
  alignmentAxis: u.alignmentAxis
552
552
  };
553
- return c && typeof m == "number" && (d = c === "end" ? m * -1 : m), l ? {
554
- x: d * f,
555
- y: h * a
553
+ return c && typeof m == "number" && (h = c === "end" ? m * -1 : m), l ? {
554
+ x: h * f,
555
+ y: d * a
556
556
  } : {
557
- x: h * a,
558
- y: d * f
557
+ x: d * a,
558
+ y: h * f
559
559
  };
560
560
  }
561
- const Ie = function(t) {
561
+ const qe = function(t) {
562
562
  return t === void 0 && (t = 0), {
563
563
  name: "offset",
564
564
  options: t,
@@ -566,21 +566,21 @@ const Ie = function(t) {
566
566
  var n, o;
567
567
  const {
568
568
  x: s,
569
- y: r,
570
- placement: i,
569
+ y: i,
570
+ placement: r,
571
571
  middlewareData: c
572
- } = e, l = await _e(e, t);
573
- return i === ((n = c.offset) == null ? void 0 : n.placement) && (o = c.arrow) != null && o.alignmentOffset ? {} : {
572
+ } = e, l = await Ye(e, t);
573
+ return r === ((n = c.offset) == null ? void 0 : n.placement) && (o = c.arrow) != null && o.alignmentOffset ? {} : {
574
574
  x: s + l.x,
575
- y: r + l.y,
575
+ y: i + l.y,
576
576
  data: {
577
577
  ...l,
578
- placement: i
578
+ placement: r
579
579
  }
580
580
  };
581
581
  }
582
582
  };
583
- }, je = function(t) {
583
+ }, Ke = function(t) {
584
584
  return t === void 0 && (t = {}), {
585
585
  name: "shift",
586
586
  options: t,
@@ -590,8 +590,8 @@ const Ie = function(t) {
590
590
  y: o,
591
591
  placement: s
592
592
  } = e, {
593
- mainAxis: r = !0,
594
- crossAxis: i = !1,
593
+ mainAxis: i = !0,
594
+ crossAxis: r = !1,
595
595
  limiter: c = {
596
596
  fn: (y) => {
597
597
  let {
@@ -605,22 +605,22 @@ const Ie = function(t) {
605
605
  }
606
606
  },
607
607
  ...l
608
- } = ct(t, e), a = {
608
+ } = lt(t, e), a = {
609
609
  x: n,
610
610
  y: o
611
- }, f = await oe(e, l), u = z(V(s)), h = te(u);
612
- let d = a[h], m = a[u];
613
- if (r) {
614
- const y = h === "y" ? "top" : "left", p = h === "y" ? "bottom" : "right", w = d + f[y], x = d - f[p];
615
- d = Dt(w, d, x);
616
- }
611
+ }, f = await re(e, l), u = z(N(s)), d = oe(u);
612
+ let h = a[d], m = a[u];
617
613
  if (i) {
614
+ const y = d === "y" ? "top" : "left", p = d === "y" ? "bottom" : "right", w = h + f[y], x = h - f[p];
615
+ h = Wt(w, h, x);
616
+ }
617
+ if (r) {
618
618
  const y = u === "y" ? "top" : "left", p = u === "y" ? "bottom" : "right", w = m + f[y], x = m - f[p];
619
- m = Dt(w, m, x);
619
+ m = Wt(w, m, x);
620
620
  }
621
621
  const g = c.fn({
622
622
  ...e,
623
- [h]: d,
623
+ [d]: h,
624
624
  [u]: m
625
625
  });
626
626
  return {
@@ -629,19 +629,19 @@ const Ie = function(t) {
629
629
  x: g.x - n,
630
630
  y: g.y - o,
631
631
  enabled: {
632
- [h]: r,
633
- [u]: i
632
+ [d]: i,
633
+ [u]: r
634
634
  }
635
635
  }
636
636
  };
637
637
  }
638
638
  };
639
639
  };
640
- function at() {
640
+ function ut() {
641
641
  return typeof window < "u";
642
642
  }
643
643
  function I(t) {
644
- return se(t) ? (t.nodeName || "").toLowerCase() : "#document";
644
+ return ce(t) ? (t.nodeName || "").toLowerCase() : "#document";
645
645
  }
646
646
  function A(t) {
647
647
  var e;
@@ -649,19 +649,19 @@ function A(t) {
649
649
  }
650
650
  function T(t) {
651
651
  var e;
652
- return (e = (se(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
652
+ return (e = (ce(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
653
653
  }
654
- function se(t) {
655
- return at() ? t instanceof Node || t instanceof A(t).Node : !1;
654
+ function ce(t) {
655
+ return ut() ? t instanceof Node || t instanceof A(t).Node : !1;
656
656
  }
657
657
  function R(t) {
658
- return at() ? t instanceof Element || t instanceof A(t).Element : !1;
658
+ return ut() ? t instanceof Element || t instanceof A(t).Element : !1;
659
659
  }
660
660
  function O(t) {
661
- return at() ? t instanceof HTMLElement || t instanceof A(t).HTMLElement : !1;
661
+ return ut() ? t instanceof HTMLElement || t instanceof A(t).HTMLElement : !1;
662
662
  }
663
- function Pt(t) {
664
- return !at() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof A(t).ShadowRoot;
663
+ function Mt(t) {
664
+ return !ut() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof A(t).ShadowRoot;
665
665
  }
666
666
  function Q(t) {
667
667
  const {
@@ -672,10 +672,10 @@ function Q(t) {
672
672
  } = E(t);
673
673
  return /auto|scroll|overlay|hidden|clip/.test(e + o + n) && !["inline", "contents"].includes(s);
674
674
  }
675
- function Ye(t) {
675
+ function Xe(t) {
676
676
  return ["table", "td", "th"].includes(I(t));
677
677
  }
678
- function ut(t) {
678
+ function ft(t) {
679
679
  return [":popover-open", ":modal"].some((e) => {
680
680
  try {
681
681
  return t.matches(e);
@@ -684,22 +684,22 @@ function ut(t) {
684
684
  }
685
685
  });
686
686
  }
687
- function bt(t) {
688
- const e = At(), n = R(t) ? E(t) : t;
687
+ function Et(t) {
688
+ const e = Lt(), n = R(t) ? E(t) : t;
689
689
  return n.transform !== "none" || n.perspective !== "none" || (n.containerType ? n.containerType !== "normal" : !1) || !e && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !e && (n.filter ? n.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((o) => (n.willChange || "").includes(o)) || ["paint", "layout", "strict", "content"].some((o) => (n.contain || "").includes(o));
690
690
  }
691
- function Ke(t) {
692
- let e = D(t);
691
+ function Je(t) {
692
+ let e = P(t);
693
693
  for (; O(e) && !_(e); ) {
694
- if (bt(e))
694
+ if (Et(e))
695
695
  return e;
696
- if (ut(e))
696
+ if (ft(e))
697
697
  return null;
698
- e = D(e);
698
+ e = P(e);
699
699
  }
700
700
  return null;
701
701
  }
702
- function At() {
702
+ function Lt() {
703
703
  return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
704
704
  }
705
705
  function _(t) {
@@ -708,7 +708,7 @@ function _(t) {
708
708
  function E(t) {
709
709
  return A(t).getComputedStyle(t);
710
710
  }
711
- function ft(t) {
711
+ function ht(t) {
712
712
  return R(t) ? {
713
713
  scrollLeft: t.scrollLeft,
714
714
  scrollTop: t.scrollTop
@@ -717,87 +717,87 @@ function ft(t) {
717
717
  scrollTop: t.scrollY
718
718
  };
719
719
  }
720
- function D(t) {
720
+ function P(t) {
721
721
  if (I(t) === "html")
722
722
  return t;
723
723
  const e = (
724
724
  // Step into the shadow DOM of the parent of a slotted node.
725
725
  t.assignedSlot || // DOM Element detected.
726
726
  t.parentNode || // ShadowRoot detected.
727
- Pt(t) && t.host || // Fallback.
727
+ Mt(t) && t.host || // Fallback.
728
728
  T(t)
729
729
  );
730
- return Pt(e) ? e.host : e;
730
+ return Mt(e) ? e.host : e;
731
731
  }
732
- function re(t) {
733
- const e = D(t);
734
- return _(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : O(e) && Q(e) ? e : re(e);
732
+ function le(t) {
733
+ const e = P(t);
734
+ return _(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : O(e) && Q(e) ? e : le(e);
735
735
  }
736
- function q(t, e, n) {
736
+ function K(t, e, n) {
737
737
  var o;
738
738
  e === void 0 && (e = []), n === void 0 && (n = !0);
739
- const s = re(t), r = s === ((o = t.ownerDocument) == null ? void 0 : o.body), i = A(s);
740
- if (r) {
741
- const c = yt(i);
742
- return e.concat(i, i.visualViewport || [], Q(s) ? s : [], c && n ? q(c) : []);
739
+ const s = le(t), i = s === ((o = t.ownerDocument) == null ? void 0 : o.body), r = A(s);
740
+ if (i) {
741
+ const c = vt(r);
742
+ return e.concat(r, r.visualViewport || [], Q(s) ? s : [], c && n ? K(c) : []);
743
743
  }
744
- return e.concat(s, q(s, [], n));
744
+ return e.concat(s, K(s, [], n));
745
745
  }
746
- function yt(t) {
746
+ function vt(t) {
747
747
  return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
748
748
  }
749
- function ie(t) {
749
+ function ae(t) {
750
750
  const e = E(t);
751
751
  let n = parseFloat(e.width) || 0, o = parseFloat(e.height) || 0;
752
- const s = O(t), r = s ? t.offsetWidth : n, i = s ? t.offsetHeight : o, c = ot(n) !== r || ot(o) !== i;
753
- return c && (n = r, o = i), {
752
+ const s = O(t), i = s ? t.offsetWidth : n, r = s ? t.offsetHeight : o, c = st(n) !== i || st(o) !== r;
753
+ return c && (n = i, o = r), {
754
754
  width: n,
755
755
  height: o,
756
756
  $: c
757
757
  };
758
758
  }
759
- function Rt(t) {
759
+ function Ot(t) {
760
760
  return R(t) ? t : t.contextElement;
761
761
  }
762
- function U(t) {
763
- const e = Rt(t);
762
+ function H(t) {
763
+ const e = Ot(t);
764
764
  if (!O(e))
765
765
  return L(1);
766
766
  const n = e.getBoundingClientRect(), {
767
767
  width: o,
768
768
  height: s,
769
- $: r
770
- } = ie(e);
771
- let i = (r ? ot(n.width) : n.width) / o, c = (r ? ot(n.height) : n.height) / s;
772
- return (!i || !Number.isFinite(i)) && (i = 1), (!c || !Number.isFinite(c)) && (c = 1), {
773
- x: i,
769
+ $: i
770
+ } = ae(e);
771
+ let r = (i ? st(n.width) : n.width) / o, c = (i ? st(n.height) : n.height) / s;
772
+ return (!r || !Number.isFinite(r)) && (r = 1), (!c || !Number.isFinite(c)) && (c = 1), {
773
+ x: r,
774
774
  y: c
775
775
  };
776
776
  }
777
- const qe = /* @__PURE__ */ L(0);
778
- function ce(t) {
777
+ const Ge = /* @__PURE__ */ L(0);
778
+ function ue(t) {
779
779
  const e = A(t);
780
- return !At() || !e.visualViewport ? qe : {
780
+ return !Lt() || !e.visualViewport ? Ge : {
781
781
  x: e.visualViewport.offsetLeft,
782
782
  y: e.visualViewport.offsetTop
783
783
  };
784
784
  }
785
- function Xe(t, e, n) {
785
+ function Qe(t, e, n) {
786
786
  return e === void 0 && (e = !1), !n || e && n !== A(t) ? !1 : e;
787
787
  }
788
- function N(t, e, n, o) {
788
+ function $(t, e, n, o) {
789
789
  e === void 0 && (e = !1), n === void 0 && (n = !1);
790
- const s = t.getBoundingClientRect(), r = Rt(t);
791
- let i = L(1);
792
- e && (o ? R(o) && (i = U(o)) : i = U(t));
793
- const c = Xe(r, n, o) ? ce(r) : L(0);
794
- let l = (s.left + c.x) / i.x, a = (s.top + c.y) / i.y, f = s.width / i.x, u = s.height / i.y;
795
- if (r) {
796
- const h = A(r), d = o && R(o) ? A(o) : o;
797
- let m = h, g = yt(m);
798
- for (; g && o && d !== m; ) {
799
- const y = U(g), p = g.getBoundingClientRect(), w = E(g), x = p.left + (g.clientLeft + parseFloat(w.paddingLeft)) * y.x, b = p.top + (g.clientTop + parseFloat(w.paddingTop)) * y.y;
800
- l *= y.x, a *= y.y, f *= y.x, u *= y.y, l += x, a += b, m = A(g), g = yt(m);
790
+ const s = t.getBoundingClientRect(), i = Ot(t);
791
+ let r = L(1);
792
+ e && (o ? R(o) && (r = H(o)) : r = H(t));
793
+ const c = Qe(i, n, o) ? ue(i) : L(0);
794
+ let l = (s.left + c.x) / r.x, a = (s.top + c.y) / r.y, f = s.width / r.x, u = s.height / r.y;
795
+ if (i) {
796
+ const d = A(i), h = o && R(o) ? A(o) : o;
797
+ let m = d, g = vt(m);
798
+ for (; g && o && h !== m; ) {
799
+ const y = H(g), p = g.getBoundingClientRect(), w = E(g), x = p.left + (g.clientLeft + parseFloat(w.paddingLeft)) * y.x, b = p.top + (g.clientTop + parseFloat(w.paddingTop)) * y.y;
800
+ l *= y.x, a *= y.y, f *= y.x, u *= y.y, l += x, a += b, m = A(g), g = vt(m);
801
801
  }
802
802
  }
803
803
  return rt({
@@ -807,96 +807,96 @@ function N(t, e, n, o) {
807
807
  y: a
808
808
  });
809
809
  }
810
- function Et(t, e) {
811
- const n = ft(t).scrollLeft;
812
- return e ? e.left + n : N(T(t)).left + n;
810
+ function Tt(t, e) {
811
+ const n = ht(t).scrollLeft;
812
+ return e ? e.left + n : $(T(t)).left + n;
813
813
  }
814
- function le(t, e, n) {
814
+ function fe(t, e, n) {
815
815
  n === void 0 && (n = !1);
816
816
  const o = t.getBoundingClientRect(), s = o.left + e.scrollLeft - (n ? 0 : (
817
817
  // RTL <body> scrollbar.
818
- Et(t, o)
819
- )), r = o.top + e.scrollTop;
818
+ Tt(t, o)
819
+ )), i = o.top + e.scrollTop;
820
820
  return {
821
821
  x: s,
822
- y: r
822
+ y: i
823
823
  };
824
824
  }
825
- function Je(t) {
825
+ function Ze(t) {
826
826
  let {
827
827
  elements: e,
828
828
  rect: n,
829
829
  offsetParent: o,
830
830
  strategy: s
831
831
  } = t;
832
- const r = s === "fixed", i = T(o), c = e ? ut(e.floating) : !1;
833
- if (o === i || c && r)
832
+ const i = s === "fixed", r = T(o), c = e ? ft(e.floating) : !1;
833
+ if (o === r || c && i)
834
834
  return n;
835
835
  let l = {
836
836
  scrollLeft: 0,
837
837
  scrollTop: 0
838
838
  }, a = L(1);
839
839
  const f = L(0), u = O(o);
840
- if ((u || !u && !r) && ((I(o) !== "body" || Q(i)) && (l = ft(o)), O(o))) {
841
- const d = N(o);
842
- a = U(o), f.x = d.x + o.clientLeft, f.y = d.y + o.clientTop;
840
+ if ((u || !u && !i) && ((I(o) !== "body" || Q(r)) && (l = ht(o)), O(o))) {
841
+ const h = $(o);
842
+ a = H(o), f.x = h.x + o.clientLeft, f.y = h.y + o.clientTop;
843
843
  }
844
- const h = i && !u && !r ? le(i, l, !0) : L(0);
844
+ const d = r && !u && !i ? fe(r, l, !0) : L(0);
845
845
  return {
846
846
  width: n.width * a.x,
847
847
  height: n.height * a.y,
848
- x: n.x * a.x - l.scrollLeft * a.x + f.x + h.x,
849
- y: n.y * a.y - l.scrollTop * a.y + f.y + h.y
848
+ x: n.x * a.x - l.scrollLeft * a.x + f.x + d.x,
849
+ y: n.y * a.y - l.scrollTop * a.y + f.y + d.y
850
850
  };
851
851
  }
852
- function Ge(t) {
852
+ function tn(t) {
853
853
  return Array.from(t.getClientRects());
854
854
  }
855
- function Qe(t) {
856
- const e = T(t), n = ft(t), o = t.ownerDocument.body, s = M(e.scrollWidth, e.clientWidth, o.scrollWidth, o.clientWidth), r = M(e.scrollHeight, e.clientHeight, o.scrollHeight, o.clientHeight);
857
- let i = -n.scrollLeft + Et(t);
855
+ function en(t) {
856
+ const e = T(t), n = ht(t), o = t.ownerDocument.body, s = V(e.scrollWidth, e.clientWidth, o.scrollWidth, o.clientWidth), i = V(e.scrollHeight, e.clientHeight, o.scrollHeight, o.clientHeight);
857
+ let r = -n.scrollLeft + Tt(t);
858
858
  const c = -n.scrollTop;
859
- return E(o).direction === "rtl" && (i += M(e.clientWidth, o.clientWidth) - s), {
859
+ return E(o).direction === "rtl" && (r += V(e.clientWidth, o.clientWidth) - s), {
860
860
  width: s,
861
- height: r,
862
- x: i,
861
+ height: i,
862
+ x: r,
863
863
  y: c
864
864
  };
865
865
  }
866
- function Ze(t, e) {
866
+ function nn(t, e) {
867
867
  const n = A(t), o = T(t), s = n.visualViewport;
868
- let r = o.clientWidth, i = o.clientHeight, c = 0, l = 0;
868
+ let i = o.clientWidth, r = o.clientHeight, c = 0, l = 0;
869
869
  if (s) {
870
- r = s.width, i = s.height;
871
- const a = At();
870
+ i = s.width, r = s.height;
871
+ const a = Lt();
872
872
  (!a || a && e === "fixed") && (c = s.offsetLeft, l = s.offsetTop);
873
873
  }
874
874
  return {
875
- width: r,
876
- height: i,
875
+ width: i,
876
+ height: r,
877
877
  x: c,
878
878
  y: l
879
879
  };
880
880
  }
881
- function tn(t, e) {
882
- const n = N(t, !0, e === "fixed"), o = n.top + t.clientTop, s = n.left + t.clientLeft, r = O(t) ? U(t) : L(1), i = t.clientWidth * r.x, c = t.clientHeight * r.y, l = s * r.x, a = o * r.y;
881
+ function on(t, e) {
882
+ const n = $(t, !0, e === "fixed"), o = n.top + t.clientTop, s = n.left + t.clientLeft, i = O(t) ? H(t) : L(1), r = t.clientWidth * i.x, c = t.clientHeight * i.y, l = s * i.x, a = o * i.y;
883
883
  return {
884
- width: i,
884
+ width: r,
885
885
  height: c,
886
886
  x: l,
887
887
  y: a
888
888
  };
889
889
  }
890
- function Ft(t, e, n) {
890
+ function Vt(t, e, n) {
891
891
  let o;
892
892
  if (e === "viewport")
893
- o = Ze(t, n);
893
+ o = nn(t, n);
894
894
  else if (e === "document")
895
- o = Qe(T(t));
895
+ o = en(T(t));
896
896
  else if (R(e))
897
- o = tn(e, n);
897
+ o = on(e, n);
898
898
  else {
899
- const s = ce(t);
899
+ const s = ue(t);
900
900
  o = {
901
901
  x: e.x - s.x,
902
902
  y: e.y - s.y,
@@ -906,34 +906,34 @@ function Ft(t, e, n) {
906
906
  }
907
907
  return rt(o);
908
908
  }
909
- function ae(t, e) {
910
- const n = D(t);
911
- return n === e || !R(n) || _(n) ? !1 : E(n).position === "fixed" || ae(n, e);
909
+ function he(t, e) {
910
+ const n = P(t);
911
+ return n === e || !R(n) || _(n) ? !1 : E(n).position === "fixed" || he(n, e);
912
912
  }
913
- function en(t, e) {
913
+ function sn(t, e) {
914
914
  const n = e.get(t);
915
915
  if (n)
916
916
  return n;
917
- let o = q(t, [], !1).filter((c) => R(c) && I(c) !== "body"), s = null;
918
- const r = E(t).position === "fixed";
919
- let i = r ? D(t) : t;
920
- for (; R(i) && !_(i); ) {
921
- const c = E(i), l = bt(i);
922
- !l && c.position === "fixed" && (s = null), (r ? !l && !s : !l && c.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || Q(i) && !l && ae(t, i)) ? o = o.filter((f) => f !== i) : s = c, i = D(i);
917
+ let o = K(t, [], !1).filter((c) => R(c) && I(c) !== "body"), s = null;
918
+ const i = E(t).position === "fixed";
919
+ let r = i ? P(t) : t;
920
+ for (; R(r) && !_(r); ) {
921
+ const c = E(r), l = Et(r);
922
+ !l && c.position === "fixed" && (s = null), (i ? !l && !s : !l && c.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || Q(r) && !l && he(t, r)) ? o = o.filter((f) => f !== r) : s = c, r = P(r);
923
923
  }
924
924
  return e.set(t, o), o;
925
925
  }
926
- function nn(t) {
926
+ function rn(t) {
927
927
  let {
928
928
  element: e,
929
929
  boundary: n,
930
930
  rootBoundary: o,
931
931
  strategy: s
932
932
  } = t;
933
- const i = [...n === "clippingAncestors" ? ut(e) ? [] : en(e, this._c) : [].concat(n), o], c = i[0], l = i.reduce((a, f) => {
934
- const u = Ft(e, f, s);
935
- return a.top = M(u.top, a.top), a.right = nt(u.right, a.right), a.bottom = nt(u.bottom, a.bottom), a.left = M(u.left, a.left), a;
936
- }, Ft(e, c, s));
933
+ const r = [...n === "clippingAncestors" ? ft(e) ? [] : sn(e, this._c) : [].concat(n), o], c = r[0], l = r.reduce((a, f) => {
934
+ const u = Vt(e, f, s);
935
+ return a.top = V(u.top, a.top), a.right = ot(u.right, a.right), a.bottom = ot(u.bottom, a.bottom), a.left = V(u.left, a.left), a;
936
+ }, Vt(e, c, s));
937
937
  return {
938
938
  width: l.right - l.left,
939
939
  height: l.bottom - l.top,
@@ -941,40 +941,40 @@ function nn(t) {
941
941
  y: l.top
942
942
  };
943
943
  }
944
- function on(t) {
944
+ function cn(t) {
945
945
  const {
946
946
  width: e,
947
947
  height: n
948
- } = ie(t);
948
+ } = ae(t);
949
949
  return {
950
950
  width: e,
951
951
  height: n
952
952
  };
953
953
  }
954
- function sn(t, e, n) {
955
- const o = O(e), s = T(e), r = n === "fixed", i = N(t, !0, r, e);
954
+ function ln(t, e, n) {
955
+ const o = O(e), s = T(e), i = n === "fixed", r = $(t, !0, i, e);
956
956
  let c = {
957
957
  scrollLeft: 0,
958
958
  scrollTop: 0
959
959
  };
960
960
  const l = L(0);
961
- if (o || !o && !r)
962
- if ((I(e) !== "body" || Q(s)) && (c = ft(e)), o) {
963
- const h = N(e, !0, r, e);
964
- l.x = h.x + e.clientLeft, l.y = h.y + e.clientTop;
965
- } else s && (l.x = Et(s));
966
- const a = s && !o && !r ? le(s, c) : L(0), f = i.left + c.scrollLeft - l.x - a.x, u = i.top + c.scrollTop - l.y - a.y;
961
+ if (o || !o && !i)
962
+ if ((I(e) !== "body" || Q(s)) && (c = ht(e)), o) {
963
+ const d = $(e, !0, i, e);
964
+ l.x = d.x + e.clientLeft, l.y = d.y + e.clientTop;
965
+ } else s && (l.x = Tt(s));
966
+ const a = s && !o && !i ? fe(s, c) : L(0), f = r.left + c.scrollLeft - l.x - a.x, u = r.top + c.scrollTop - l.y - a.y;
967
967
  return {
968
968
  x: f,
969
969
  y: u,
970
- width: i.width,
971
- height: i.height
970
+ width: r.width,
971
+ height: r.height
972
972
  };
973
973
  }
974
- function ht(t) {
974
+ function gt(t) {
975
975
  return E(t).position === "static";
976
976
  }
977
- function Mt(t, e) {
977
+ function Nt(t, e) {
978
978
  if (!O(t) || E(t).position === "fixed")
979
979
  return null;
980
980
  if (e)
@@ -982,28 +982,28 @@ function Mt(t, e) {
982
982
  let n = t.offsetParent;
983
983
  return T(t) === n && (n = n.ownerDocument.body), n;
984
984
  }
985
- function ue(t, e) {
985
+ function de(t, e) {
986
986
  const n = A(t);
987
- if (ut(t))
987
+ if (ft(t))
988
988
  return n;
989
989
  if (!O(t)) {
990
- let s = D(t);
990
+ let s = P(t);
991
991
  for (; s && !_(s); ) {
992
- if (R(s) && !ht(s))
992
+ if (R(s) && !gt(s))
993
993
  return s;
994
- s = D(s);
994
+ s = P(s);
995
995
  }
996
996
  return n;
997
997
  }
998
- let o = Mt(t, e);
999
- for (; o && Ye(o) && ht(o); )
1000
- o = Mt(o, e);
1001
- return o && _(o) && ht(o) && !bt(o) ? n : o || Ke(t) || n;
998
+ let o = Nt(t, e);
999
+ for (; o && Xe(o) && gt(o); )
1000
+ o = Nt(o, e);
1001
+ return o && _(o) && gt(o) && !Et(o) ? n : o || Je(t) || n;
1002
1002
  }
1003
- const rn = async function(t) {
1004
- const e = this.getOffsetParent || ue, n = this.getDimensions, o = await n(t.floating);
1003
+ const an = async function(t) {
1004
+ const e = this.getOffsetParent || de, n = this.getDimensions, o = await n(t.floating);
1005
1005
  return {
1006
- reference: sn(t.reference, await e(t.floating), t.strategy),
1006
+ reference: ln(t.reference, await e(t.floating), t.strategy),
1007
1007
  floating: {
1008
1008
  x: 0,
1009
1009
  y: 0,
@@ -1012,50 +1012,50 @@ const rn = async function(t) {
1012
1012
  }
1013
1013
  };
1014
1014
  };
1015
- function cn(t) {
1015
+ function un(t) {
1016
1016
  return E(t).direction === "rtl";
1017
1017
  }
1018
- const ln = {
1019
- convertOffsetParentRelativeRectToViewportRelativeRect: Je,
1018
+ const fn = {
1019
+ convertOffsetParentRelativeRectToViewportRelativeRect: Ze,
1020
1020
  getDocumentElement: T,
1021
- getClippingRect: nn,
1022
- getOffsetParent: ue,
1023
- getElementRects: rn,
1024
- getClientRects: Ge,
1025
- getDimensions: on,
1026
- getScale: U,
1021
+ getClippingRect: rn,
1022
+ getOffsetParent: de,
1023
+ getElementRects: an,
1024
+ getClientRects: tn,
1025
+ getDimensions: cn,
1026
+ getScale: H,
1027
1027
  isElement: R,
1028
- isRTL: cn
1028
+ isRTL: un
1029
1029
  };
1030
- function an(t, e) {
1030
+ function hn(t, e) {
1031
1031
  let n = null, o;
1032
1032
  const s = T(t);
1033
- function r() {
1033
+ function i() {
1034
1034
  var c;
1035
1035
  clearTimeout(o), (c = n) == null || c.disconnect(), n = null;
1036
1036
  }
1037
- function i(c, l) {
1038
- c === void 0 && (c = !1), l === void 0 && (l = 1), r();
1037
+ function r(c, l) {
1038
+ c === void 0 && (c = !1), l === void 0 && (l = 1), i();
1039
1039
  const {
1040
1040
  left: a,
1041
1041
  top: f,
1042
1042
  width: u,
1043
- height: h
1043
+ height: d
1044
1044
  } = t.getBoundingClientRect();
1045
- if (c || e(), !u || !h)
1045
+ if (c || e(), !u || !d)
1046
1046
  return;
1047
- const d = tt(f), m = tt(s.clientWidth - (a + u)), g = tt(s.clientHeight - (f + h)), y = tt(a), w = {
1048
- rootMargin: -d + "px " + -m + "px " + -g + "px " + -y + "px",
1049
- threshold: M(0, nt(1, l)) || 1
1047
+ const h = et(f), m = et(s.clientWidth - (a + u)), g = et(s.clientHeight - (f + d)), y = et(a), w = {
1048
+ rootMargin: -h + "px " + -m + "px " + -g + "px " + -y + "px",
1049
+ threshold: V(0, ot(1, l)) || 1
1050
1050
  };
1051
1051
  let x = !0;
1052
1052
  function b(v) {
1053
- const $ = v[0].intersectionRatio;
1054
- if ($ !== l) {
1053
+ const B = v[0].intersectionRatio;
1054
+ if (B !== l) {
1055
1055
  if (!x)
1056
- return i();
1057
- $ ? i(!1, $) : o = setTimeout(() => {
1058
- i(!1, 1e-7);
1056
+ return r();
1057
+ B ? r(!1, B) : o = setTimeout(() => {
1058
+ r(!1, 1e-7);
1059
1059
  }, 1e3);
1060
1060
  }
1061
1061
  x = !1;
@@ -1071,80 +1071,80 @@ function an(t, e) {
1071
1071
  }
1072
1072
  n.observe(t);
1073
1073
  }
1074
- return i(!0), r;
1074
+ return r(!0), i;
1075
1075
  }
1076
- function un(t, e, n, o) {
1076
+ function dn(t, e, n, o) {
1077
1077
  o === void 0 && (o = {});
1078
1078
  const {
1079
1079
  ancestorScroll: s = !0,
1080
- ancestorResize: r = !0,
1081
- elementResize: i = typeof ResizeObserver == "function",
1080
+ ancestorResize: i = !0,
1081
+ elementResize: r = typeof ResizeObserver == "function",
1082
1082
  layoutShift: c = typeof IntersectionObserver == "function",
1083
1083
  animationFrame: l = !1
1084
- } = o, a = Rt(t), f = s || r ? [...a ? q(a) : [], ...q(e)] : [];
1084
+ } = o, a = Ot(t), f = s || i ? [...a ? K(a) : [], ...K(e)] : [];
1085
1085
  f.forEach((p) => {
1086
1086
  s && p.addEventListener("scroll", n, {
1087
1087
  passive: !0
1088
- }), r && p.addEventListener("resize", n);
1088
+ }), i && p.addEventListener("resize", n);
1089
1089
  });
1090
- const u = a && c ? an(a, n) : null;
1091
- let h = -1, d = null;
1092
- i && (d = new ResizeObserver((p) => {
1090
+ const u = a && c ? hn(a, n) : null;
1091
+ let d = -1, h = null;
1092
+ r && (h = new ResizeObserver((p) => {
1093
1093
  let [w] = p;
1094
- w && w.target === a && d && (d.unobserve(e), cancelAnimationFrame(h), h = requestAnimationFrame(() => {
1094
+ w && w.target === a && h && (h.unobserve(e), cancelAnimationFrame(d), d = requestAnimationFrame(() => {
1095
1095
  var x;
1096
- (x = d) == null || x.observe(e);
1096
+ (x = h) == null || x.observe(e);
1097
1097
  })), n();
1098
- }), a && !l && d.observe(a), d.observe(e));
1099
- let m, g = l ? N(t) : null;
1098
+ }), a && !l && h.observe(a), h.observe(e));
1099
+ let m, g = l ? $(t) : null;
1100
1100
  l && y();
1101
1101
  function y() {
1102
- const p = N(t);
1102
+ const p = $(t);
1103
1103
  g && (p.x !== g.x || p.y !== g.y || p.width !== g.width || p.height !== g.height) && n(), g = p, m = requestAnimationFrame(y);
1104
1104
  }
1105
1105
  return n(), () => {
1106
1106
  var p;
1107
1107
  f.forEach((w) => {
1108
- s && w.removeEventListener("scroll", n), r && w.removeEventListener("resize", n);
1109
- }), u == null || u(), (p = d) == null || p.disconnect(), d = null, l && cancelAnimationFrame(m);
1108
+ s && w.removeEventListener("scroll", n), i && w.removeEventListener("resize", n);
1109
+ }), u == null || u(), (p = h) == null || p.disconnect(), h = null, l && cancelAnimationFrame(m);
1110
1110
  };
1111
1111
  }
1112
- const fn = Ie, dn = je, Vt = ze, hn = (t, e, n) => {
1112
+ const mn = qe, pn = Ke, $t = je, gn = (t, e, n) => {
1113
1113
  const o = /* @__PURE__ */ new Map(), s = {
1114
- platform: ln,
1114
+ platform: fn,
1115
1115
  ...n
1116
- }, r = {
1116
+ }, i = {
1117
1117
  ...s.platform,
1118
1118
  _c: o
1119
1119
  };
1120
- return Be(t, e, {
1120
+ return Ie(t, e, {
1121
1121
  ...s,
1122
- platform: r
1122
+ platform: i
1123
1123
  });
1124
- }, Vn = ({
1124
+ }, Un = ({
1125
1125
  content: t,
1126
1126
  open: e,
1127
1127
  placement: n,
1128
1128
  offset: { mainAxis: o, crossAxis: s } = { mainAxis: 0, crossAxis: 0 }
1129
- }) => Xt((r) => {
1130
- const i = B.toSignal(e), c = r.element;
1131
- return qt(
1132
- i,
1133
- () => Kt(
1129
+ }) => Qt((i) => {
1130
+ const r = D.toSignal(e), c = i.element;
1131
+ return Gt(
1132
+ r,
1133
+ () => Jt(
1134
1134
  "body",
1135
- _t.div(
1135
+ Yt.div(
1136
1136
  G((l) => {
1137
1137
  const a = l;
1138
- return a.style.position = "absolute", P(
1139
- un(c, a, async () => {
1140
- const { x: f, y: u } = await hn(c, a, {
1138
+ return a.style.position = "absolute", F(
1139
+ dn(c, a, async () => {
1140
+ const { x: f, y: u } = await gn(c, a, {
1141
1141
  placement: n,
1142
1142
  strategy: "absolute",
1143
1143
  middleware: [
1144
- Vt(),
1145
- fn({ mainAxis: o, crossAxis: s }),
1146
- dn(),
1147
- Vt()
1144
+ $t(),
1145
+ mn({ mainAxis: o, crossAxis: s }),
1146
+ pn(),
1147
+ $t()
1148
1148
  ]
1149
1149
  });
1150
1150
  a.style.top = `${u}px`, a.style.left = `${f}px`;
@@ -1155,149 +1155,295 @@ const fn = Ie, dn = je, Vt = ze, hn = (t, e, n) => {
1155
1155
  )
1156
1156
  )
1157
1157
  );
1158
- }), mn = (t, e, n) => {
1158
+ }), yn = (t, e, n) => {
1159
1159
  const o = W(C.notAsked), s = o.map(
1160
1160
  (u) => C.isSuccess(u) ? u.value : void 0
1161
- ), r = o.map(
1161
+ ), i = o.map(
1162
1162
  (u) => C.isFailure(u) ? u.error : void 0
1163
- ), i = o.map((u) => C.isLoading(u));
1163
+ ), r = o.map((u) => C.isLoading(u));
1164
1164
  let c;
1165
1165
  const l = async (u) => {
1166
1166
  c == null || c.abort(), c = new AbortController();
1167
- const h = c.signal, d = o.get();
1168
- o.set(C.loading(C.getOrUndefined(d)));
1167
+ const d = c.signal, h = o.get();
1168
+ o.set(C.loading(C.getOrUndefined(h)));
1169
1169
  try {
1170
- const m = await e({ request: u, abortSignal: h, previous: d });
1170
+ const m = await e({ request: u, abortSignal: d, previous: h });
1171
1171
  await Promise.resolve(), c = void 0, o.set(C.success(m));
1172
1172
  } catch (m) {
1173
1173
  c = void 0, o.set(C.failure(n(m)));
1174
1174
  }
1175
- }, a = () => l(t.get()), f = () => {
1175
+ }, a = () => l(D.get(t)), f = () => {
1176
1176
  c == null || c.abort(), c = void 0, o.dispose();
1177
1177
  };
1178
- return o.onDispose(t.on(l)), {
1178
+ return o.onDispose(D.on(t, l)), {
1179
1179
  status: o,
1180
1180
  value: s,
1181
- error: r,
1182
- loading: i,
1181
+ error: i,
1182
+ loading: r,
1183
1183
  reload: a,
1184
1184
  dispose: f
1185
1185
  };
1186
- }, pn = (t, e) => {
1187
- const { status: n, dispose: o, reload: s } = t, { loading: r, failure: i, success: c } = e;
1188
- return xt(
1189
- P(o),
1190
- Zt(n, {
1191
- loading: r != null ? (l) => r(l, s) : void 0,
1192
- failure: i != null ? (l) => i(l, s) : void 0,
1186
+ }, wn = (t, e) => {
1187
+ const { status: n, dispose: o, reload: s } = t, { loading: i, failure: r, success: c } = e;
1188
+ return At(
1189
+ F(o),
1190
+ ne(n, {
1191
+ loading: i != null ? (l) => i(l, s) : void 0,
1192
+ failure: r != null ? (l) => r(l, s) : void 0,
1193
1193
  success: (l) => c(l, s)
1194
1194
  })
1195
1195
  );
1196
- }, Nn = ({
1196
+ }, Hn = ({
1197
1197
  request: t,
1198
1198
  load: e,
1199
1199
  mapError: n = (o) => o
1200
1200
  }) => {
1201
- const o = mn(t, e, n);
1202
- return (s) => pn(o, s);
1203
- }, gn = (t, e) => {
1201
+ const o = yn(t, e, n);
1202
+ return (s) => wn(o, s);
1203
+ }, xn = (t, e) => {
1204
1204
  if (typeof e == "function")
1205
- return gn(t, { success: e });
1206
- const n = e.failure ?? ((s) => xt(
1207
- P(s.on(console.error)),
1208
- s.map((r) => `Error: ${r}`)
1205
+ return xn(t, { success: e });
1206
+ const n = e.failure ?? ((s) => At(
1207
+ F(s.on(console.error)),
1208
+ s.map((i) => `Error: ${i}`)
1209
1209
  )), o = e.success;
1210
- return Yt(B.toSignal(t), {
1210
+ return Xt(D.toSignal(t), {
1211
1211
  Success: (s) => o(s.$.value),
1212
1212
  Failure: (s) => n(s.$.error)
1213
1213
  });
1214
- }, $n = () => It.focus((t) => {
1214
+ }, zn = () => qt.focus((t) => {
1215
1215
  var e;
1216
1216
  return (e = t.target) == null ? void 0 : e.select();
1217
- }), Hn = (t) => Xt((e) => {
1218
- const { element: n } = e, o = W({
1219
- width: n.clientWidth,
1220
- height: n.clientHeight
1221
- }), s = vt(t(o))(e), r = () => {
1222
- o.set({ width: n.clientWidth, height: n.clientHeight });
1217
+ });
1218
+ class dt {
1219
+ /**
1220
+ * Creates a new Rect instance.
1221
+ *
1222
+ * @param left - The x-coordinate of the left edge
1223
+ * @param top - The y-coordinate of the top edge
1224
+ * @param width - The width of the rectangle
1225
+ * @param height - The height of the rectangle
1226
+ *
1227
+ * @example
1228
+ * ```typescript
1229
+ * const rect = new Rect(10, 20, 100, 50);
1230
+ * console.log(rect.left); // 10
1231
+ * console.log(rect.top); // 20
1232
+ * console.log(rect.width); // 100
1233
+ * console.log(rect.height); // 50
1234
+ * ```
1235
+ */
1236
+ constructor(e, n, o, s) {
1237
+ /**
1238
+ * Compares this rectangle with another rectangle for equality.
1239
+ *
1240
+ * Uses near-equality comparison for floating-point precision tolerance.
1241
+ * Two rectangles are considered equal if all their corresponding properties
1242
+ * (left, top, width, height) are nearly equal within a small tolerance.
1243
+ *
1244
+ * @param other - The rectangle to compare with
1245
+ * @returns True if the rectangles are equal, false otherwise
1246
+ *
1247
+ * @example
1248
+ * ```typescript
1249
+ * const rect1 = new Rect(10, 20, 100, 50);
1250
+ * const rect2 = new Rect(10, 20, 100, 50);
1251
+ * const rect3 = new Rect(10.00000001, 20, 100, 50); // Very close values
1252
+ *
1253
+ * console.log(rect1.equals(rect2)); // true
1254
+ * console.log(rect1.equals(rect3)); // true (within tolerance)
1255
+ * ```
1256
+ */
1257
+ pt(this, "equals", (e) => tt(this.left, e.left) && tt(this.top, e.top) && tt(this.width, e.width) && tt(this.height, e.height));
1258
+ this.left = e, this.top = n, this.width = o, this.height = s;
1259
+ }
1260
+ /**
1261
+ * Creates a new Rect instance using an object with optional properties.
1262
+ *
1263
+ * This factory method provides a convenient way to create rectangles with
1264
+ * default values for any unspecified properties.
1265
+ *
1266
+ * @param options - Object containing rectangle properties
1267
+ * @param options.left - The x-coordinate of the left edge (default: 0)
1268
+ * @param options.top - The y-coordinate of the top edge (default: 0)
1269
+ * @param options.width - The width of the rectangle (default: 0)
1270
+ * @param options.height - The height of the rectangle (default: 0)
1271
+ * @returns A new Rect instance
1272
+ *
1273
+ * @example
1274
+ * ```typescript
1275
+ * // Create a rectangle at origin with no size
1276
+ * const emptyRect = Rect.of({});
1277
+ *
1278
+ * // Create a rectangle with only position
1279
+ * const positioned = Rect.of({ left: 10, top: 20 });
1280
+ *
1281
+ * // Create a rectangle with all properties
1282
+ * const fullRect = Rect.of({ left: 10, top: 20, width: 100, height: 50 });
1283
+ * ```
1284
+ */
1285
+ static of({
1286
+ left: e = 0,
1287
+ top: n = 0,
1288
+ width: o = 0,
1289
+ height: s = 0
1290
+ }) {
1291
+ return new dt(e, n, o, s);
1292
+ }
1293
+ /**
1294
+ * Gets the x-coordinate of the right edge of the rectangle.
1295
+ *
1296
+ * @returns The right edge position (left + width)
1297
+ *
1298
+ * @example
1299
+ * ```typescript
1300
+ * const rect = new Rect(10, 20, 100, 50);
1301
+ * console.log(rect.right); // 110
1302
+ * ```
1303
+ */
1304
+ get right() {
1305
+ return this.left + this.width;
1306
+ }
1307
+ /**
1308
+ * Gets the y-coordinate of the bottom edge of the rectangle.
1309
+ *
1310
+ * @returns The bottom edge position (top + height)
1311
+ *
1312
+ * @example
1313
+ * ```typescript
1314
+ * const rect = new Rect(10, 20, 100, 50);
1315
+ * console.log(rect.bottom); // 70
1316
+ * ```
1317
+ */
1318
+ get bottom() {
1319
+ return this.top + this.height;
1320
+ }
1321
+ /**
1322
+ * Gets the center point of the rectangle.
1323
+ *
1324
+ * @returns An object with x and y coordinates of the center point
1325
+ *
1326
+ * @example
1327
+ * ```typescript
1328
+ * const rect = new Rect(10, 20, 100, 50);
1329
+ * const center = rect.center;
1330
+ * console.log(center.x); // 60 (left + width/2)
1331
+ * console.log(center.y); // 45 (top + height/2)
1332
+ * ```
1333
+ */
1334
+ get center() {
1335
+ return {
1336
+ x: this.left + this.width / 2,
1337
+ y: this.top + this.height / 2
1338
+ };
1339
+ }
1340
+ /**
1341
+ * Gets the size dimensions of the rectangle.
1342
+ *
1343
+ * @returns An object containing width and height properties
1344
+ *
1345
+ * @example
1346
+ * ```typescript
1347
+ * const rect = new Rect(10, 20, 100, 50);
1348
+ * const size = rect.size;
1349
+ * console.log(size.width); // 100
1350
+ * console.log(size.height); // 50
1351
+ * ```
1352
+ */
1353
+ get size() {
1354
+ return { width: this.width, height: this.height };
1355
+ }
1356
+ }
1357
+ function Bt(t) {
1358
+ const e = t.getBoundingClientRect();
1359
+ return dt.of({
1360
+ top: e.top + window.scrollY,
1361
+ left: e.left + window.scrollX,
1362
+ width: e.width,
1363
+ height: e.height
1364
+ });
1365
+ }
1366
+ const vn = (t) => Qt((e) => {
1367
+ const { element: n } = e, o = W(Bt(n)), s = Rt(t(o))(e), i = () => {
1368
+ o.set(dt.of(Bt(n)));
1223
1369
  };
1224
- let i;
1225
- return typeof ResizeObserver == "function" && (i = new ResizeObserver(r), i.observe(n)), P((c) => {
1226
- i == null || i.disconnect(), s(c);
1370
+ let r;
1371
+ return typeof ResizeObserver == "function" && (r = new ResizeObserver(i), r.observe(n)), F((c) => {
1372
+ r == null || r.disconnect(), s(c);
1227
1373
  });
1228
- }), Un = (t) => (e) => {
1374
+ }), _n = (t) => vn(t), In = (t) => (e) => {
1229
1375
  const n = J(), o = W({
1230
1376
  width: (n == null ? void 0 : n.innerWidth) ?? 0,
1231
1377
  height: (n == null ? void 0 : n.innerHeight) ?? 0
1232
- }), s = vt(t(o))(e), r = () => {
1378
+ }), s = Rt(t(o))(e), i = () => {
1233
1379
  o.set({
1234
1380
  width: (n == null ? void 0 : n.innerWidth) ?? 0,
1235
1381
  height: (n == null ? void 0 : n.innerHeight) ?? 0
1236
1382
  });
1237
1383
  };
1238
- return n == null || n.addEventListener("resize", r), (i) => {
1239
- n == null || n.removeEventListener("resize", r), s(i);
1384
+ return n == null || n.addEventListener("resize", i), (r) => {
1385
+ n == null || n.removeEventListener("resize", i), s(r);
1240
1386
  };
1241
- }, yn = (t, e) => {
1387
+ }, bn = (t, e) => {
1242
1388
  const n = e.split("/").filter((s) => s !== ""), o = {};
1243
1389
  for (let s = 0; s < t.length; s++) {
1244
- const r = t[s], i = n[s];
1245
- if (!i && r.type !== "catch-all")
1390
+ const i = t[s], r = n[s];
1391
+ if (!r && i.type !== "catch-all")
1246
1392
  return null;
1247
- if (r.type === "literal") {
1248
- if (r.value !== i)
1393
+ if (i.type === "literal") {
1394
+ if (i.value !== r)
1249
1395
  return null;
1250
- } else if (r.type === "param")
1251
- o[r.name] = i;
1252
- else if (r.type === "catch-all")
1396
+ } else if (i.type === "param")
1397
+ o[i.name] = r;
1398
+ else if (i.type === "catch-all")
1253
1399
  return { params: o, path: e };
1254
1400
  }
1255
1401
  return n.length !== t.length ? null : { params: o, path: e };
1256
- }, wn = (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 !== ""), xn = (t) => {
1402
+ }, An = (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 !== ""), Rn = (t) => {
1257
1403
  const e = t.map((n) => {
1258
- const o = wn(n);
1404
+ const o = An(n);
1259
1405
  return { route: n, segments: o };
1260
1406
  });
1261
1407
  return function(o) {
1262
- for (const { segments: s, route: r } of e) {
1263
- const i = yn(s, o);
1264
- if (i)
1265
- return { ...i, route: r };
1408
+ for (const { segments: s, route: i } of e) {
1409
+ const r = bn(s, o);
1410
+ if (r)
1411
+ return { ...r, route: i };
1266
1412
  }
1267
1413
  return null;
1268
1414
  };
1269
- }, Bn = (t) => {
1270
- const e = xn(Object.keys(t));
1271
- return zt(Qt, (n) => {
1415
+ }, jn = (t) => {
1416
+ const e = Rn(Object.keys(t));
1417
+ return jt(ee, (n) => {
1272
1418
  const o = n.map((s) => {
1273
- const r = e(s.pathname);
1274
- if (r == null)
1419
+ const i = e(s.pathname);
1420
+ if (i == null)
1275
1421
  throw console.error("No route found for", s), new Error("No route found");
1276
1422
  return {
1277
- params: r.params,
1278
- route: r.route,
1279
- path: r.path,
1423
+ params: i.params,
1424
+ route: i.route,
1425
+ path: i.path,
1280
1426
  search: s.search,
1281
1427
  hash: s.hash
1282
1428
  };
1283
1429
  });
1284
- return pe(
1430
+ return we(
1285
1431
  o.map((s) => [s.route, s]),
1286
1432
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1287
1433
  t
1288
1434
  );
1289
1435
  });
1290
- }, it = 60 * 1e3, wt = 60 * it, X = 24 * wt, Nt = 7 * X, $t = 30 * X, vn = 365 * X, bn = [
1436
+ }, ct = 60 * 1e3, bt = 60 * ct, X = 24 * bt, Ut = 7 * X, Ht = 30 * X, En = 365 * X, Ln = [
1291
1437
  {
1292
- max: it * 90,
1293
- value: it,
1438
+ max: ct * 90,
1439
+ value: ct,
1294
1440
  name: "minute",
1295
1441
  past: { singular: "a minute ago", plural: "{} minutes ago" },
1296
1442
  future: { singular: "in a minute", plural: "in {} minutes" }
1297
1443
  },
1298
1444
  {
1299
- max: wt * 36,
1300
- value: wt,
1445
+ max: bt * 36,
1446
+ value: bt,
1301
1447
  name: "hour",
1302
1448
  past: { singular: "an hour ago", plural: "{} hours ago" },
1303
1449
  future: { singular: "in an hour", plural: "in {} hours" }
@@ -1310,28 +1456,28 @@ const fn = Ie, dn = je, Vt = ze, hn = (t, e, n) => {
1310
1456
  future: { singular: "tomorrow", plural: "in {} days" }
1311
1457
  },
1312
1458
  {
1313
- max: Nt * 6,
1314
- value: Nt,
1459
+ max: Ut * 6,
1460
+ value: Ut,
1315
1461
  name: "week",
1316
1462
  past: { singular: "last week", plural: "{} weeks ago" },
1317
1463
  future: { singular: "in a week", plural: "in {} weeks" }
1318
1464
  },
1319
1465
  {
1320
- max: $t * 18,
1321
- value: $t,
1466
+ max: Ht * 18,
1467
+ value: Ht,
1322
1468
  name: "month",
1323
1469
  past: { singular: "last month", plural: "{} months ago" },
1324
1470
  future: { singular: "in a month", plural: "in {} months" }
1325
1471
  },
1326
1472
  {
1327
1473
  max: 1 / 0,
1328
- value: vn,
1474
+ value: En,
1329
1475
  name: "year",
1330
1476
  past: { singular: "last year", plural: "{} years ago" },
1331
1477
  future: { singular: "in a year", plural: "in {} years" }
1332
1478
  }
1333
1479
  ];
1334
- function Ht(t, e, n, o) {
1480
+ function zt(t, e, n, o) {
1335
1481
  const s = Math.round(t / e);
1336
1482
  return s <= 1 ? n : o.replace(
1337
1483
  "{}",
@@ -1341,73 +1487,76 @@ function Ht(t, e, n, o) {
1341
1487
  })
1342
1488
  );
1343
1489
  }
1344
- const An = (t = 1e3) => {
1345
- const e = W(/* @__PURE__ */ new Date()), n = we(() => e.set(/* @__PURE__ */ new Date()), t);
1490
+ const On = (t = 1e3) => {
1491
+ const e = W(/* @__PURE__ */ new Date()), n = be(() => e.set(/* @__PURE__ */ new Date()), t);
1346
1492
  return e.onDispose(n), e;
1347
- }, Rn = (t) => {
1493
+ }, Tn = (t) => {
1348
1494
  const e = Math.abs(t);
1349
- if (e < it)
1495
+ if (e < ct)
1350
1496
  return t < 0 ? "just now" : "in a moment";
1351
- for (const n of bn)
1497
+ for (const n of Ln)
1352
1498
  if (e < n.max)
1353
- return t < 0 ? Ht(e, n.value, n.past.singular, n.past.plural) : Ht(e, n.value, n.future.singular, n.future.plural);
1499
+ return t < 0 ? zt(e, n.value, n.past.singular, n.past.plural) : zt(e, n.value, n.future.singular, n.future.plural);
1354
1500
  throw new Error("unreachable");
1355
- }, En = (t, { now: e, frequency: n = 1e4 } = {}) => {
1356
- const o = e != null ? Bt.is(e) ? e.derive() : W(e) : An(n), s = ge(
1501
+ }, Sn = (t, { now: e, frequency: n = 1e4 } = {}) => {
1502
+ const o = e != null ? It.is(e) ? e.derive() : W(e) : On(n), s = xe(
1357
1503
  t,
1358
1504
  o
1359
- )((r, i) => r.getTime() - i.getTime());
1360
- return s.onDispose(() => B.dispose(o)), s;
1361
- }, Ln = (t, e = {}) => {
1362
- const n = En(t, e), o = n.map(Rn);
1505
+ )((i, r) => i.getTime() - r.getTime());
1506
+ return s.onDispose(() => D.dispose(o)), s;
1507
+ }, kn = (t, e = {}) => {
1508
+ const n = Sn(t, e), o = n.map(Tn);
1363
1509
  return o.onDispose(n.dispose), o;
1364
- }, zn = (t, e = {}) => Ln(t, e);
1365
- class On extends ye {
1510
+ }, Yn = (t, e = {}) => kn(t, e);
1511
+ class Cn extends ve {
1366
1512
  constructor() {
1367
1513
  super(...arguments);
1368
1514
  /**
1369
1515
  * Triggers an update of the Ticker by incrementing its internal value.
1370
1516
  * @returns void
1371
1517
  */
1372
- kt(this, "tick", () => this.update((n) => n + 1));
1518
+ pt(this, "tick", () => this.update((n) => n + 1));
1373
1519
  }
1374
1520
  }
1375
- const _n = (t = 0) => new On(t, (e, n) => e === n);
1521
+ const qn = (t = 0) => new Cn(t, (e, n) => e === n);
1376
1522
  export {
1377
- ke as Anchor,
1378
- Cn as Appearance,
1379
- Zt as AsyncResultView,
1380
- Dn as AutoFocus,
1381
- Wn as AutoSelect,
1382
- Hn as ElementSize,
1383
- Fn as HTMLTitle,
1384
- Pn as HiddenWhenEmpty,
1385
- We as InViewport,
1386
- Qt as Location,
1387
- Vn as PopOver,
1388
- Nn as Resource,
1389
- pn as ResourceDisplay,
1390
- gn as ResultView,
1391
- Bn as Router,
1392
- $n as SelectOnFocus,
1393
- On as Ticker,
1394
- Mn as WhenInViewport,
1395
- Un as WindowSize,
1396
- ve as _checkExtensionCondition,
1397
- xe as _getExtension,
1398
- xn as _makeRouteMatcher,
1399
- wn as _parseRouteSegments,
1400
- Re as areLocationsEqual,
1401
- Ae as handleAnchorClick,
1402
- Gt as locationFromURL,
1403
- mn as makeResource,
1404
- yn as matchesRoute,
1405
- An as nowSignal,
1406
- zn as relativeTime,
1407
- En as relativeTimeMillisSignal,
1408
- Ln as relativeTimeSignal,
1409
- Ct as setLocationFromUrl,
1410
- _n as ticker,
1411
- Rn as timeDiffToString,
1412
- pt as urlFromLocation
1523
+ Pe as Anchor,
1524
+ Fn as Appearance,
1525
+ ne as AsyncResultView,
1526
+ Mn as AutoFocus,
1527
+ Vn as AutoSelect,
1528
+ vn as ElementRect,
1529
+ _n as ElementSize,
1530
+ $n as HTMLTitle,
1531
+ Nn as HiddenWhenEmpty,
1532
+ Me as InViewport,
1533
+ ee as Location,
1534
+ Un as PopOver,
1535
+ dt as Rect,
1536
+ Hn as Resource,
1537
+ wn as ResourceDisplay,
1538
+ xn as ResultView,
1539
+ jn as Router,
1540
+ zn as SelectOnFocus,
1541
+ Cn as Ticker,
1542
+ Bn as WhenInViewport,
1543
+ In as WindowSize,
1544
+ Re as _checkExtensionCondition,
1545
+ Ae as _getExtension,
1546
+ Rn as _makeRouteMatcher,
1547
+ An as _parseRouteSegments,
1548
+ Oe as areLocationsEqual,
1549
+ Bt as getAbsoluteRect,
1550
+ Le as handleAnchorClick,
1551
+ te as locationFromURL,
1552
+ yn as makeResource,
1553
+ bn as matchesRoute,
1554
+ On as nowSignal,
1555
+ Yn as relativeTime,
1556
+ Sn as relativeTimeMillisSignal,
1557
+ kn as relativeTimeSignal,
1558
+ Pt as setLocationFromUrl,
1559
+ qn as ticker,
1560
+ Tn as timeDiffToString,
1561
+ wt as urlFromLocation
1413
1562
  };