@tempots/ui 7.0.3 → 8.0.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,8 +1,8 @@
1
1
  var Le = Object.defineProperty;
2
2
  var Pe = (t, e, o) => e in t ? Le(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o;
3
- var Ot = (t, e, o) => Pe(t, typeof e != "symbol" ? e + "" : e, o);
4
- import { getWindow as at, prop as F, makeProviderMark as Wt, Signal as ee, Use as st, html as Et, on as ne, Value as A, attr as Ft, Empty as Lt, OneOfType as oe, WithElement as B, OnDispose as M, Fragment as q, Portal as re, renderableOfTNode as Mt, When as se, effectOf as Se, computedOf as ie, WithBrowserCtx as Te, Provide as ke, OneOfTuple as ce, Prop as Ce } from "@tempots/dom";
5
- import { delayed as ae, AsyncResult as U, nearEqual as ht, interval as De } from "@tempots/std";
3
+ var At = (t, e, o) => Pe(t, typeof e != "symbol" ? e + "" : e, o);
4
+ import { getWindow as at, prop as F, makeProviderMark as Wt, Signal as ee, Use as rt, html as Et, on as ne, Value as O, attr as Ft, Empty as Lt, OneOfType as oe, WithElement as H, OnDispose as M, Fragment as q, Portal as se, renderableOfTNode as Mt, When as re, effectOf as Te, computedOf as ie, WithBrowserCtx as Se, Provide as ke, OneOfTuple as ce, Prop as Ce } from "@tempots/dom";
5
+ import { delayed as ae, AsyncResult as B, nearEqual as ht, interval as De } from "@tempots/std";
6
6
  const We = (t) => {
7
7
  const e = t.split("/").pop();
8
8
  if (e == null || e.startsWith(".")) return;
@@ -12,21 +12,21 @@ const We = (t) => {
12
12
  const o = We(e);
13
13
  return o != null && (t.length === 0 || !t.some((n) => o == n));
14
14
  }, Me = (t, e, o, n) => {
15
- let r = t.target;
16
- for (; r != null && !(r instanceof HTMLAnchorElement); )
17
- r = r.parentElement;
18
- if (r == null)
15
+ let s = t.target;
16
+ for (; s != null && !(s instanceof HTMLAnchorElement); )
17
+ s = s.parentElement;
18
+ if (s == null)
19
19
  return !0;
20
- const s = r;
21
- if (t.button !== 0 || t.ctrlKey || t.metaKey || s.target !== "_self" && s.target !== "" || s.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: a } = s;
23
+ const { pathname: r, search: c, hash: a } = i;
24
24
  if (n) {
25
- const l = i + c + a, h = s.getAttribute("href");
26
- if (!(h != null && h.startsWith("#")) && h !== l)
25
+ const l = r + c + a, f = i.getAttribute("href");
26
+ if (!(f != null && f.startsWith("#")) && f !== l)
27
27
  return !0;
28
28
  }
29
- return e ? !1 : Fe(o, i);
29
+ return e ? !1 : Fe(o, r);
30
30
  }, Ne = (t, e = {
31
31
  ignoreUrlWithExtension: !0,
32
32
  allowedExtensions: [],
@@ -44,13 +44,13 @@ const We = (t) => {
44
44
  ) || t() && n.preventDefault();
45
45
  };
46
46
  }, Ve = (t, e) => t.pathname === e.pathname && JSON.stringify(t.search) === JSON.stringify(e.search) && t.hash === e.hash, le = (t, e) => {
47
- var s, i;
48
- const o = new URL(t, e ?? ((s = at()) == null ? void 0 : s.location.toString())), n = Object.fromEntries(((i = o.searchParams) == null ? void 0 : i.entries()) ?? []);
49
- let r = o.hash;
50
- return r.startsWith("#") && (r = r.substring(1)), {
47
+ var i, r;
48
+ const o = new URL(t, e ?? ((i = at()) == null ? void 0 : i.location.toString())), n = Object.fromEntries(((r = o.searchParams) == null ? void 0 : r.entries()) ?? []);
49
+ let s = o.hash;
50
+ return s.startsWith("#") && (s = s.substring(1)), {
51
51
  pathname: o.pathname,
52
52
  search: n,
53
- hash: r === "" ? void 0 : r
53
+ hash: s === "" ? void 0 : s
54
54
  };
55
55
  }, Kt = (t, e) => {
56
56
  const o = le(e);
@@ -64,8 +64,8 @@ const We = (t) => {
64
64
  (n) => {
65
65
  if ($e(n.pathname))
66
66
  return Pt(n);
67
- const r = new URL(n.pathname, e.value), s = r.origin + r.pathname;
68
- return Pt({ ...n, pathname: s });
67
+ const s = new URL(n.pathname, e.value), i = s.origin + s.pathname;
68
+ return Pt({ ...n, pathname: i });
69
69
  }
70
70
  );
71
71
  return { value: o, dispose: o.dispose };
@@ -82,14 +82,14 @@ const We = (t) => {
82
82
  const t = F(He(), Ve), e = at(), o = () => {
83
83
  let n = (e == null ? void 0 : e.location.hash) ?? "";
84
84
  n.startsWith("#") && (n = n.substring(1));
85
- const r = {
85
+ const s = {
86
86
  pathname: (e == null ? void 0 : e.location.pathname) ?? "",
87
87
  search: Object.fromEntries(
88
88
  new URLSearchParams((e == null ? void 0 : e.location.search) ?? "").entries()
89
89
  ),
90
90
  hash: n === "" ? void 0 : n
91
91
  };
92
- t.set(r);
92
+ t.set(s);
93
93
  };
94
94
  return e == null || e.addEventListener("popstate", o), t.onDispose(() => {
95
95
  e == null || e.removeEventListener("popstate", o);
@@ -116,13 +116,13 @@ const We = (t) => {
116
116
  const {
117
117
  href: o,
118
118
  withViewTransition: n,
119
- ...r
119
+ ...s
120
120
  } = t;
121
- return st(Nt, (s) => Et.a(
121
+ return rt(Nt, (i) => Et.a(
122
122
  ne.click(
123
123
  Ne(() => (n === !0 ? ze(() => {
124
- Kt(s, A.get(o));
125
- }) : Kt(s, A.get(o)), !0), r)
124
+ Kt(i, O.get(o));
125
+ }) : Kt(i, O.get(o)), !0), s)
126
126
  ),
127
127
  Ft.href(o),
128
128
  ...e
@@ -139,37 +139,37 @@ const We = (t) => {
139
139
  }
140
140
  };
141
141
  function je() {
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 = F(o ? "dark" : "light"), r = (s) => n.set(s.matches ? "dark" : "light");
143
- return e == null || e.addEventListener("change", r), n.onDispose(() => e == null ? void 0 : e.removeEventListener("change", r)), n;
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 = F(o ? "dark" : "light"), s = (i) => n.set(i.matches ? "dark" : "light");
143
+ return e == null || e.addEventListener("change", s), n.onDispose(() => e == null ? void 0 : e.removeEventListener("change", s)), n;
144
144
  }
145
145
  const ue = (t, e) => {
146
146
  if (typeof e == "function")
147
147
  return ue(t, { success: e });
148
- const o = e.failure ?? ((i) => i.map((c) => `Error: ${c}`)), n = e.success, r = e.loading ?? (() => Lt), s = e.notAsked ?? (() => Lt);
149
- return oe(A.toSignal(t), {
150
- AsyncSuccess: (i) => n(i.$.value),
151
- AsyncFailure: (i) => o(i.$.error),
152
- Loading: (i) => r(i.map((c) => c.previousValue)),
153
- NotAsked: s
148
+ const o = e.failure ?? ((r) => r.map((c) => `Error: ${c}`)), n = e.success, s = e.loading ?? (() => Lt), i = e.notAsked ?? (() => Lt);
149
+ return oe(O.toSignal(t), {
150
+ AsyncSuccess: (r) => n(r.$.value),
151
+ AsyncFailure: (r) => o(r.$.error),
152
+ Loading: (r) => s(r.map((c) => c.previousValue)),
153
+ NotAsked: i
154
154
  });
155
- }, qn = (t = 10) => B((e) => M(ae(() => e == null ? void 0 : e.focus(), t))), Xn = (t = 10) => B((e) => {
155
+ }, qn = (t = 10) => H((e) => M(ae(() => e == null ? void 0 : e.focus(), t))), Xn = (t = 10) => H((e) => {
156
156
  const o = ae(() => e.select(), t);
157
157
  return M(o);
158
158
  });
159
- function Jn(t) {
159
+ function Qn(t) {
160
160
  const e = Object.entries(t);
161
161
  return q(
162
162
  ...e.map(
163
- ([o, n]) => Ft.class(A.map(n, (r) => r ? o : void 0))
163
+ ([o, n]) => Ft.class(O.map(n, (s) => s ? o : void 0))
164
164
  )
165
165
  );
166
166
  }
167
- const Gn = B((t) => {
167
+ const Jn = H((t) => {
168
168
  const e = t.style.getPropertyValue(":empty");
169
169
  return t.style.setProperty(":empty", "display:none"), M((o) => {
170
170
  o && t.style.setProperty(":empty", e);
171
171
  });
172
- }), Qn = (t) => re("head > title", Ft.innerText(t)), _e = {
172
+ }), Gn = (t) => se("head > title", Ft.innerText(t)), _e = {
173
173
  partial: {
174
174
  root: null,
175
175
  rootMargin: "0px",
@@ -183,40 +183,40 @@ const Gn = B((t) => {
183
183
  }, mt = {
184
184
  partial: /* @__PURE__ */ new Map(),
185
185
  full: /* @__PURE__ */ new Map()
186
- }, rt = {
186
+ }, st = {
187
187
  partial: null,
188
188
  full: null
189
189
  };
190
190
  function Ie(t) {
191
- return rt[t] == null && (rt[t] = new IntersectionObserver((e) => {
191
+ return st[t] == null && (st[t] = new IntersectionObserver((e) => {
192
192
  e.forEach((o) => {
193
193
  const n = mt[t].get(o.target);
194
194
  n == null || n.set(o.isIntersecting);
195
195
  });
196
- }, _e[t])), rt[t];
196
+ }, _e[t])), st[t];
197
197
  }
198
198
  const Ye = ({ mode: t = "partial", once: e = !1 }, o) => {
199
199
  const n = F(!1);
200
200
  return q(
201
- B((r) => {
202
- const s = typeof IntersectionObserver < "u" ? Ie(t) : null;
203
- mt[t].set(r, n), s == null || s.observe(r);
204
- function i() {
201
+ H((s) => {
202
+ const i = typeof IntersectionObserver < "u" ? Ie(t) : null;
203
+ mt[t].set(s, n), i == null || i.observe(s);
204
+ function r() {
205
205
  var a;
206
- s == null || s.unobserve(r), mt[t].delete(r), mt[t].size === 0 && ((a = rt[t]) == null || a.disconnect(), rt[t] = null);
206
+ i == null || i.unobserve(s), mt[t].delete(s), mt[t].size === 0 && ((a = st[t]) == null || a.disconnect(), st[t] = null);
207
207
  }
208
208
  let c = null;
209
209
  return e && (c = n.on((a) => {
210
- a && i();
210
+ a && r();
211
211
  })), M(() => {
212
- n.dispose(), i(), c == null || c();
212
+ n.dispose(), r(), c == null || c();
213
213
  });
214
214
  }),
215
215
  Mt(o(n))
216
216
  );
217
- }, Zn = (t, e, o) => Ye(t, (n) => se(n, e, o ?? (() => Lt)));
217
+ }, Zn = (t, e, o) => Ye(t, (n) => re(n, e, o ?? (() => Lt)));
218
218
  function qe(t) {
219
- return B((e) => {
219
+ return H((e) => {
220
220
  const o = (n) => {
221
221
  e.contains(n.target) || t(n);
222
222
  };
@@ -225,9 +225,9 @@ function qe(t) {
225
225
  });
226
226
  });
227
227
  }
228
- const Q = (t, e) => t === void 0 || t === e, jt = (t, e) => t === void 0 || t === e;
228
+ const G = (t, e) => t === void 0 || t === e, jt = (t, e) => t === void 0 || t === e;
229
229
  function Xe(t, e) {
230
- return typeof t == "string" ? e.key === t : jt(t.key, e.key) && jt(t.code, e.code) && Q(t.ctrlKey, e.ctrlKey) && Q(t.altKey, e.altKey) && Q(t.shiftKey, e.shiftKey) && Q(t.metaKey, e.metaKey) && Q(t.repeat, e.repeat) && Q(
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(
231
231
  t.commandOrControlKey,
232
232
  e.metaKey || e.ctrlKey
233
233
  );
@@ -236,12 +236,12 @@ function fe({
236
236
  allowedKeys: t,
237
237
  handler: e
238
238
  }) {
239
- return B((o) => {
240
- const n = (r) => {
241
- if (o.contains(r.target)) {
242
- for (const s of t)
243
- if (Xe(s, r)) {
244
- e(r);
239
+ return H((o) => {
240
+ const n = (s) => {
241
+ if (o.contains(s.target)) {
242
+ for (const i of t)
243
+ if (Xe(i, s)) {
244
+ e(s);
245
245
  break;
246
246
  }
247
247
  }
@@ -260,22 +260,22 @@ function eo(t) {
260
260
  const tt = Math.min, X = Math.max, gt = Math.round, dt = Math.floor, D = (t) => ({
261
261
  x: t,
262
262
  y: t
263
- }), Je = {
263
+ }), Qe = {
264
264
  left: "right",
265
265
  right: "left",
266
266
  bottom: "top",
267
267
  top: "bottom"
268
- }, Ge = {
268
+ }, Je = {
269
269
  start: "end",
270
270
  end: "start"
271
271
  };
272
- function St(t, e, o) {
272
+ function Tt(t, e, o) {
273
273
  return X(t, tt(e, o));
274
274
  }
275
275
  function lt(t, e) {
276
276
  return typeof t == "function" ? t(e) : t;
277
277
  }
278
- function J(t) {
278
+ function Q(t) {
279
279
  return t.split("-")[0];
280
280
  }
281
281
  function ut(t) {
@@ -288,44 +288,44 @@ function Vt(t) {
288
288
  return t === "y" ? "height" : "width";
289
289
  }
290
290
  function z(t) {
291
- return ["top", "bottom"].includes(J(t)) ? "y" : "x";
291
+ return ["top", "bottom"].includes(Q(t)) ? "y" : "x";
292
292
  }
293
293
  function $t(t) {
294
294
  return he(z(t));
295
295
  }
296
- function Qe(t, e, o) {
296
+ function Ge(t, e, o) {
297
297
  o === void 0 && (o = !1);
298
- const n = ut(t), r = $t(t), s = Vt(r);
299
- let i = r === "x" ? n === (o ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
300
- return e.reference[s] > e.floating[s] && (i = pt(i)), [i, pt(i)];
298
+ const n = ut(t), s = $t(t), i = Vt(s);
299
+ let r = s === "x" ? n === (o ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
300
+ return e.reference[i] > e.floating[i] && (r = pt(r)), [r, pt(r)];
301
301
  }
302
302
  function Ze(t) {
303
303
  const e = pt(t);
304
- return [Tt(t), e, Tt(e)];
304
+ return [St(t), e, St(e)];
305
305
  }
306
- function Tt(t) {
307
- return t.replace(/start|end/g, (e) => Ge[e]);
306
+ function St(t) {
307
+ return t.replace(/start|end/g, (e) => Je[e]);
308
308
  }
309
309
  function tn(t, e, o) {
310
- const n = ["left", "right"], r = ["right", "left"], s = ["top", "bottom"], i = ["bottom", "top"];
310
+ const n = ["left", "right"], s = ["right", "left"], i = ["top", "bottom"], r = ["bottom", "top"];
311
311
  switch (t) {
312
312
  case "top":
313
313
  case "bottom":
314
- return o ? e ? r : n : e ? n : r;
314
+ return o ? e ? s : n : e ? n : s;
315
315
  case "left":
316
316
  case "right":
317
- return e ? s : i;
317
+ return e ? i : r;
318
318
  default:
319
319
  return [];
320
320
  }
321
321
  }
322
322
  function en(t, e, o, n) {
323
- const r = ut(t);
324
- let s = tn(J(t), o === "start", n);
325
- return r && (s = s.map((i) => i + "-" + r), e && (s = s.concat(s.map(Tt)))), s;
323
+ const s = ut(t);
324
+ let i = tn(Q(t), o === "start", n);
325
+ return s && (i = i.map((r) => r + "-" + s), e && (i = i.concat(i.map(St)))), i;
326
326
  }
327
327
  function pt(t) {
328
- return t.replace(/left|right|bottom|top/g, (e) => Je[e]);
328
+ return t.replace(/left|right|bottom|top/g, (e) => Qe[e]);
329
329
  }
330
330
  function nn(t) {
331
331
  return {
@@ -349,15 +349,15 @@ function wt(t) {
349
349
  x: e,
350
350
  y: o,
351
351
  width: n,
352
- height: r
352
+ height: s
353
353
  } = t;
354
354
  return {
355
355
  width: n,
356
- height: r,
356
+ height: s,
357
357
  top: o,
358
358
  left: e,
359
359
  right: e + n,
360
- bottom: o + r,
360
+ bottom: o + s,
361
361
  x: e,
362
362
  y: o
363
363
  };
@@ -365,33 +365,33 @@ function wt(t) {
365
365
  function _t(t, e, o) {
366
366
  let {
367
367
  reference: n,
368
- floating: r
368
+ floating: s
369
369
  } = t;
370
- const s = z(e), i = $t(e), c = Vt(i), a = J(e), l = s === "y", h = n.x + n.width / 2 - r.width / 2, f = n.y + n.height / 2 - r.height / 2, m = n[c] / 2 - r[c] / 2;
370
+ const i = z(e), r = $t(e), c = Vt(r), a = Q(e), l = i === "y", f = n.x + n.width / 2 - s.width / 2, h = n.y + n.height / 2 - s.height / 2, m = n[c] / 2 - s[c] / 2;
371
371
  let u;
372
372
  switch (a) {
373
373
  case "top":
374
374
  u = {
375
- x: h,
376
- y: n.y - r.height
375
+ x: f,
376
+ y: n.y - s.height
377
377
  };
378
378
  break;
379
379
  case "bottom":
380
380
  u = {
381
- x: h,
381
+ x: f,
382
382
  y: n.y + n.height
383
383
  };
384
384
  break;
385
385
  case "right":
386
386
  u = {
387
387
  x: n.x + n.width,
388
- y: f
388
+ y: h
389
389
  };
390
390
  break;
391
391
  case "left":
392
392
  u = {
393
- x: n.x - r.width,
394
- y: f
393
+ x: n.x - s.width,
394
+ y: h
395
395
  };
396
396
  break;
397
397
  default:
@@ -402,10 +402,10 @@ function _t(t, e, o) {
402
402
  }
403
403
  switch (ut(e)) {
404
404
  case "start":
405
- u[i] -= m * (o && l ? -1 : 1);
405
+ u[r] -= m * (o && l ? -1 : 1);
406
406
  break;
407
407
  case "end":
408
- u[i] += m * (o && l ? -1 : 1);
408
+ u[r] += m * (o && l ? -1 : 1);
409
409
  break;
410
410
  }
411
411
  return u;
@@ -413,61 +413,61 @@ function _t(t, e, o) {
413
413
  const on = async (t, e, o) => {
414
414
  const {
415
415
  placement: n = "bottom",
416
- strategy: r = "absolute",
417
- middleware: s = [],
418
- platform: i
419
- } = o, c = s.filter(Boolean), a = await (i.isRTL == null ? void 0 : i.isRTL(e));
420
- let l = await i.getElementRects({
416
+ strategy: s = "absolute",
417
+ middleware: i = [],
418
+ platform: r
419
+ } = o, c = i.filter(Boolean), a = await (r.isRTL == null ? void 0 : r.isRTL(e));
420
+ let l = await r.getElementRects({
421
421
  reference: t,
422
422
  floating: e,
423
- strategy: r
423
+ strategy: s
424
424
  }), {
425
- x: h,
426
- y: f
427
- } = _t(l, n, a), m = n, u = {}, d = 0;
428
- for (let p = 0; p < c.length; p++) {
425
+ x: f,
426
+ y: h
427
+ } = _t(l, n, a), m = n, u = {}, g = 0;
428
+ for (let w = 0; w < c.length; w++) {
429
429
  const {
430
- name: w,
431
- fn: g
432
- } = c[p], {
430
+ name: d,
431
+ fn: p
432
+ } = c[w], {
433
433
  x,
434
434
  y,
435
435
  data: b,
436
436
  reset: v
437
- } = await g({
438
- x: h,
439
- y: f,
437
+ } = await p({
438
+ x: f,
439
+ y: h,
440
440
  initialPlacement: n,
441
441
  placement: m,
442
- strategy: r,
442
+ strategy: s,
443
443
  middlewareData: u,
444
444
  rects: l,
445
- platform: i,
445
+ platform: r,
446
446
  elements: {
447
447
  reference: t,
448
448
  floating: e
449
449
  }
450
450
  });
451
- h = x ?? h, f = y ?? f, u = {
451
+ f = x ?? f, h = y ?? h, u = {
452
452
  ...u,
453
- [w]: {
454
- ...u[w],
453
+ [d]: {
454
+ ...u[d],
455
455
  ...b
456
456
  }
457
- }, v && d <= 50 && (d++, typeof v == "object" && (v.placement && (m = v.placement), v.rects && (l = v.rects === !0 ? await i.getElementRects({
457
+ }, v && g <= 50 && (g++, typeof v == "object" && (v.placement && (m = v.placement), v.rects && (l = v.rects === !0 ? await r.getElementRects({
458
458
  reference: t,
459
459
  floating: e,
460
- strategy: r
460
+ strategy: s
461
461
  }) : v.rects), {
462
- x: h,
463
- y: f
464
- } = _t(l, m, a)), p = -1);
462
+ x: f,
463
+ y: h
464
+ } = _t(l, m, a)), w = -1);
465
465
  }
466
466
  return {
467
- x: h,
468
- y: f,
467
+ x: f,
468
+ y: h,
469
469
  placement: m,
470
- strategy: r,
470
+ strategy: s,
471
471
  middlewareData: u
472
472
  };
473
473
  };
@@ -476,155 +476,155 @@ async function me(t, e) {
476
476
  e === void 0 && (e = {});
477
477
  const {
478
478
  x: n,
479
- y: r,
480
- platform: s,
481
- rects: i,
479
+ y: s,
480
+ platform: i,
481
+ rects: r,
482
482
  elements: c,
483
483
  strategy: a
484
484
  } = t, {
485
485
  boundary: l = "clippingAncestors",
486
- rootBoundary: h = "viewport",
487
- elementContext: f = "floating",
486
+ rootBoundary: f = "viewport",
487
+ elementContext: h = "floating",
488
488
  altBoundary: m = !1,
489
489
  padding: u = 0
490
- } = lt(e, t), d = de(u), w = c[m ? f === "floating" ? "reference" : "floating" : f], g = wt(await s.getClippingRect({
491
- element: (o = await (s.isElement == null ? void 0 : s.isElement(w))) == null || o ? w : w.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(c.floating)),
490
+ } = lt(e, t), g = de(u), d = c[m ? h === "floating" ? "reference" : "floating" : h], p = wt(await i.getClippingRect({
491
+ element: (o = await (i.isElement == null ? void 0 : i.isElement(d))) == null || o ? d : d.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(c.floating)),
492
492
  boundary: l,
493
- rootBoundary: h,
493
+ rootBoundary: f,
494
494
  strategy: a
495
- })), x = f === "floating" ? {
495
+ })), x = h === "floating" ? {
496
496
  x: n,
497
- y: r,
498
- width: i.floating.width,
499
- height: i.floating.height
500
- } : i.reference, y = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(c.floating)), b = await (s.isElement == null ? void 0 : s.isElement(y)) ? await (s.getScale == null ? void 0 : s.getScale(y)) || {
497
+ y: s,
498
+ width: r.floating.width,
499
+ height: r.floating.height
500
+ } : r.reference, y = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(c.floating)), b = await (i.isElement == null ? void 0 : i.isElement(y)) ? await (i.getScale == null ? void 0 : i.getScale(y)) || {
501
501
  x: 1,
502
502
  y: 1
503
503
  } : {
504
504
  x: 1,
505
505
  y: 1
506
- }, v = wt(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
506
+ }, v = wt(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
507
507
  elements: c,
508
508
  rect: x,
509
509
  offsetParent: y,
510
510
  strategy: a
511
511
  }) : x);
512
512
  return {
513
- top: (g.top - v.top + d.top) / b.y,
514
- bottom: (v.bottom - g.bottom + d.bottom) / b.y,
515
- left: (g.left - v.left + d.left) / b.x,
516
- right: (v.right - g.right + d.right) / b.x
513
+ top: (p.top - v.top + g.top) / b.y,
514
+ bottom: (v.bottom - p.bottom + g.bottom) / b.y,
515
+ left: (p.left - v.left + g.left) / b.x,
516
+ right: (v.right - p.right + g.right) / b.x
517
517
  };
518
518
  }
519
- const rn = (t) => ({
519
+ const sn = (t) => ({
520
520
  name: "arrow",
521
521
  options: t,
522
522
  async fn(e) {
523
523
  const {
524
524
  x: o,
525
525
  y: n,
526
- placement: r,
527
- rects: s,
528
- platform: i,
526
+ placement: s,
527
+ rects: i,
528
+ platform: r,
529
529
  elements: c,
530
530
  middlewareData: a
531
531
  } = e, {
532
532
  element: l,
533
- padding: h = 0
533
+ padding: f = 0
534
534
  } = lt(t, e) || {};
535
535
  if (l == null)
536
536
  return {};
537
- const f = de(h), m = {
537
+ const h = de(f), m = {
538
538
  x: o,
539
539
  y: n
540
- }, u = $t(r), d = Vt(u), p = await i.getDimensions(l), w = u === "y", g = w ? "top" : "left", x = w ? "bottom" : "right", y = w ? "clientHeight" : "clientWidth", b = s.reference[d] + s.reference[u] - m[u] - s.floating[d], v = m[u] - s.reference[u], L = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(l));
540
+ }, u = $t(s), g = Vt(u), w = await r.getDimensions(l), d = u === "y", p = d ? "top" : "left", x = d ? "bottom" : "right", y = d ? "clientHeight" : "clientWidth", b = i.reference[g] + i.reference[u] - m[u] - i.floating[g], v = m[u] - i.reference[u], L = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(l));
541
541
  let R = L ? L[y] : 0;
542
- (!R || !await (i.isElement == null ? void 0 : i.isElement(L))) && (R = c.floating[y] || s.floating[d]);
543
- const j = b / 2 - v / 2, V = R / 2 - p[d] / 2 - 1, P = tt(f[g], V), _ = tt(f[x], V), I = P, ot = R - p[d] - _, O = R / 2 - p[d] / 2 + j, Y = St(I, O, ot), $ = !a.arrow && ut(r) != null && O !== Y && s.reference[d] / 2 - (O < I ? P : _) - p[d] / 2 < 0, S = $ ? O < I ? O - I : O - ot : 0;
542
+ (!R || !await (r.isElement == null ? void 0 : r.isElement(L))) && (R = c.floating[y] || i.floating[g]);
543
+ const j = b / 2 - v / 2, V = R / 2 - w[g] / 2 - 1, P = tt(h[p], V), _ = tt(h[x], V), I = P, ot = R - w[g] - _, A = R / 2 - w[g] / 2 + j, Y = Tt(I, A, ot), $ = !a.arrow && ut(s) != null && A !== Y && i.reference[g] / 2 - (A < I ? P : _) - w[g] / 2 < 0, T = $ ? A < I ? A - I : A - ot : 0;
544
544
  return {
545
- [u]: m[u] + S,
545
+ [u]: m[u] + T,
546
546
  data: {
547
547
  [u]: Y,
548
- centerOffset: O - Y - S,
548
+ centerOffset: A - Y - T,
549
549
  ...$ && {
550
- alignmentOffset: S
550
+ alignmentOffset: T
551
551
  }
552
552
  },
553
553
  reset: $
554
554
  };
555
555
  }
556
- }), sn = function(t) {
556
+ }), rn = function(t) {
557
557
  return t === void 0 && (t = {}), {
558
558
  name: "flip",
559
559
  options: t,
560
560
  async fn(e) {
561
561
  var o, n;
562
562
  const {
563
- placement: r,
564
- middlewareData: s,
565
- rects: i,
563
+ placement: s,
564
+ middlewareData: i,
565
+ rects: r,
566
566
  initialPlacement: c,
567
567
  platform: a,
568
568
  elements: l
569
569
  } = e, {
570
- mainAxis: h = !0,
571
- crossAxis: f = !0,
570
+ mainAxis: f = !0,
571
+ crossAxis: h = !0,
572
572
  fallbackPlacements: m,
573
573
  fallbackStrategy: u = "bestFit",
574
- fallbackAxisSideDirection: d = "none",
575
- flipAlignment: p = !0,
576
- ...w
574
+ fallbackAxisSideDirection: g = "none",
575
+ flipAlignment: w = !0,
576
+ ...d
577
577
  } = lt(t, e);
578
- if ((o = s.arrow) != null && o.alignmentOffset)
578
+ if ((o = i.arrow) != null && o.alignmentOffset)
579
579
  return {};
580
- const g = J(r), x = z(c), y = J(c) === c, b = await (a.isRTL == null ? void 0 : a.isRTL(l.floating)), v = m || (y || !p ? [pt(c)] : Ze(c)), L = d !== "none";
581
- !m && L && v.push(...en(c, p, d, b));
582
- const R = [c, ...v], j = await me(e, w), V = [];
583
- let P = ((n = s.flip) == null ? void 0 : n.overflows) || [];
584
- if (h && V.push(j[g]), f) {
585
- const O = Qe(r, i, b);
586
- V.push(j[O[0]], j[O[1]]);
580
+ const p = Q(s), x = z(c), y = Q(c) === c, b = await (a.isRTL == null ? void 0 : a.isRTL(l.floating)), v = m || (y || !w ? [pt(c)] : Ze(c)), L = g !== "none";
581
+ !m && L && v.push(...en(c, w, g, b));
582
+ const R = [c, ...v], j = await me(e, d), V = [];
583
+ let P = ((n = i.flip) == null ? void 0 : n.overflows) || [];
584
+ if (f && V.push(j[p]), h) {
585
+ const A = Ge(s, r, b);
586
+ V.push(j[A[0]], j[A[1]]);
587
587
  }
588
588
  if (P = [...P, {
589
- placement: r,
589
+ placement: s,
590
590
  overflows: V
591
- }], !V.every((O) => O <= 0)) {
591
+ }], !V.every((A) => A <= 0)) {
592
592
  var _, I;
593
- const O = (((_ = s.flip) == null ? void 0 : _.index) || 0) + 1, Y = R[O];
594
- if (Y && (!(f === "alignment" ? x !== z(Y) : !1) || // We leave the current main axis only if every placement on that axis
593
+ const A = (((_ = i.flip) == null ? void 0 : _.index) || 0) + 1, Y = R[A];
594
+ if (Y && (!(h === "alignment" ? x !== z(Y) : !1) || // We leave the current main axis only if every placement on that axis
595
595
  // overflows the main axis.
596
- P.every((T) => T.overflows[0] > 0 && z(T.placement) === x)))
596
+ P.every((S) => S.overflows[0] > 0 && z(S.placement) === x)))
597
597
  return {
598
598
  data: {
599
- index: O,
599
+ index: A,
600
600
  overflows: P
601
601
  },
602
602
  reset: {
603
603
  placement: Y
604
604
  }
605
605
  };
606
- let $ = (I = P.filter((S) => S.overflows[0] <= 0).sort((S, T) => S.overflows[1] - T.overflows[1])[0]) == null ? void 0 : I.placement;
606
+ let $ = (I = P.filter((T) => T.overflows[0] <= 0).sort((T, S) => T.overflows[1] - S.overflows[1])[0]) == null ? void 0 : I.placement;
607
607
  if (!$)
608
608
  switch (u) {
609
609
  case "bestFit": {
610
610
  var ot;
611
- const S = (ot = P.filter((T) => {
611
+ const T = (ot = P.filter((S) => {
612
612
  if (L) {
613
- const H = z(T.placement);
614
- return H === x || // Create a bias to the `y` side axis due to horizontal
613
+ const U = z(S.placement);
614
+ return U === x || // Create a bias to the `y` side axis due to horizontal
615
615
  // reading directions favoring greater width.
616
- H === "y";
616
+ U === "y";
617
617
  }
618
618
  return !0;
619
- }).map((T) => [T.placement, T.overflows.filter((H) => H > 0).reduce((H, Ee) => H + Ee, 0)]).sort((T, H) => T[1] - H[1])[0]) == null ? void 0 : ot[0];
620
- S && ($ = S);
619
+ }).map((S) => [S.placement, S.overflows.filter((U) => U > 0).reduce((U, Ee) => U + Ee, 0)]).sort((S, U) => S[1] - U[1])[0]) == null ? void 0 : ot[0];
620
+ T && ($ = T);
621
621
  break;
622
622
  }
623
623
  case "initialPlacement":
624
624
  $ = c;
625
625
  break;
626
626
  }
627
- if (r !== $)
627
+ if (s !== $)
628
628
  return {
629
629
  reset: {
630
630
  placement: $
@@ -639,27 +639,27 @@ async function cn(t, e) {
639
639
  const {
640
640
  placement: o,
641
641
  platform: n,
642
- elements: r
643
- } = t, s = await (n.isRTL == null ? void 0 : n.isRTL(r.floating)), i = J(o), c = ut(o), a = z(o) === "y", l = ["left", "top"].includes(i) ? -1 : 1, h = s && a ? -1 : 1, f = lt(e, t);
642
+ elements: s
643
+ } = t, i = await (n.isRTL == null ? void 0 : n.isRTL(s.floating)), r = Q(o), c = ut(o), a = z(o) === "y", l = ["left", "top"].includes(r) ? -1 : 1, f = i && a ? -1 : 1, h = lt(e, t);
644
644
  let {
645
645
  mainAxis: m,
646
646
  crossAxis: u,
647
- alignmentAxis: d
648
- } = typeof f == "number" ? {
649
- mainAxis: f,
647
+ alignmentAxis: g
648
+ } = typeof h == "number" ? {
649
+ mainAxis: h,
650
650
  crossAxis: 0,
651
651
  alignmentAxis: null
652
652
  } : {
653
- mainAxis: f.mainAxis || 0,
654
- crossAxis: f.crossAxis || 0,
655
- alignmentAxis: f.alignmentAxis
653
+ mainAxis: h.mainAxis || 0,
654
+ crossAxis: h.crossAxis || 0,
655
+ alignmentAxis: h.alignmentAxis
656
656
  };
657
- return c && typeof d == "number" && (u = c === "end" ? d * -1 : d), a ? {
658
- x: u * h,
657
+ return c && typeof g == "number" && (u = c === "end" ? g * -1 : g), a ? {
658
+ x: u * f,
659
659
  y: m * l
660
660
  } : {
661
661
  x: m * l,
662
- y: u * h
662
+ y: u * f
663
663
  };
664
664
  }
665
665
  const an = function(t) {
@@ -669,17 +669,17 @@ const an = function(t) {
669
669
  async fn(e) {
670
670
  var o, n;
671
671
  const {
672
- x: r,
673
- y: s,
674
- placement: i,
672
+ x: s,
673
+ y: i,
674
+ placement: r,
675
675
  middlewareData: c
676
676
  } = e, a = await cn(e, t);
677
- return i === ((o = c.offset) == null ? void 0 : o.placement) && (n = c.arrow) != null && n.alignmentOffset ? {} : {
678
- x: r + a.x,
679
- y: s + a.y,
677
+ return r === ((o = c.offset) == null ? void 0 : o.placement) && (n = c.arrow) != null && n.alignmentOffset ? {} : {
678
+ x: s + a.x,
679
+ y: i + a.y,
680
680
  data: {
681
681
  ...a,
682
- placement: i
682
+ placement: r
683
683
  }
684
684
  };
685
685
  }
@@ -692,18 +692,18 @@ const an = function(t) {
692
692
  const {
693
693
  x: o,
694
694
  y: n,
695
- placement: r
695
+ placement: s
696
696
  } = e, {
697
- mainAxis: s = !0,
698
- crossAxis: i = !1,
697
+ mainAxis: i = !0,
698
+ crossAxis: r = !1,
699
699
  limiter: c = {
700
- fn: (w) => {
700
+ fn: (d) => {
701
701
  let {
702
- x: g,
702
+ x: p,
703
703
  y: x
704
- } = w;
704
+ } = d;
705
705
  return {
706
- x: g,
706
+ x: p,
707
707
  y: x
708
708
  };
709
709
  }
@@ -712,29 +712,29 @@ const an = function(t) {
712
712
  } = lt(t, e), l = {
713
713
  x: o,
714
714
  y: n
715
- }, h = await me(e, a), f = z(J(r)), m = he(f);
716
- let u = l[m], d = l[f];
717
- if (s) {
718
- const w = m === "y" ? "top" : "left", g = m === "y" ? "bottom" : "right", x = u + h[w], y = u - h[g];
719
- u = St(x, u, y);
720
- }
715
+ }, f = await me(e, a), h = z(Q(s)), m = he(h);
716
+ let u = l[m], g = l[h];
721
717
  if (i) {
722
- const w = f === "y" ? "top" : "left", g = f === "y" ? "bottom" : "right", x = d + h[w], y = d - h[g];
723
- d = St(x, d, y);
718
+ const d = m === "y" ? "top" : "left", p = m === "y" ? "bottom" : "right", x = u + f[d], y = u - f[p];
719
+ u = Tt(x, u, y);
720
+ }
721
+ if (r) {
722
+ const d = h === "y" ? "top" : "left", p = h === "y" ? "bottom" : "right", x = g + f[d], y = g - f[p];
723
+ g = Tt(x, g, y);
724
724
  }
725
- const p = c.fn({
725
+ const w = c.fn({
726
726
  ...e,
727
727
  [m]: u,
728
- [f]: d
728
+ [h]: g
729
729
  });
730
730
  return {
731
- ...p,
731
+ ...w,
732
732
  data: {
733
- x: p.x - o,
734
- y: p.y - n,
733
+ x: w.x - o,
734
+ y: w.y - n,
735
735
  enabled: {
736
- [m]: s,
737
- [f]: i
736
+ [m]: i,
737
+ [h]: r
738
738
  }
739
739
  }
740
740
  };
@@ -772,9 +772,9 @@ function ft(t) {
772
772
  overflow: e,
773
773
  overflowX: o,
774
774
  overflowY: n,
775
- display: r
775
+ display: s
776
776
  } = C(t);
777
- return /auto|scroll|overlay|hidden|clip/.test(e + n + o) && !["inline", "contents"].includes(r);
777
+ return /auto|scroll|overlay|hidden|clip/.test(e + n + o) && !["inline", "contents"].includes(s);
778
778
  }
779
779
  function un(t) {
780
780
  return ["table", "td", "th"].includes(nt(t));
@@ -840,12 +840,12 @@ function pe(t) {
840
840
  function it(t, e, o) {
841
841
  var n;
842
842
  e === void 0 && (e = []), o === void 0 && (o = !0);
843
- const r = pe(t), s = r === ((n = t.ownerDocument) == null ? void 0 : n.body), i = E(r);
844
- if (s) {
845
- const c = kt(i);
846
- return e.concat(i, i.visualViewport || [], ft(r) ? r : [], c && o ? it(c) : []);
843
+ const s = pe(t), i = s === ((n = t.ownerDocument) == null ? void 0 : n.body), r = E(s);
844
+ if (i) {
845
+ const c = kt(r);
846
+ return e.concat(r, r.visualViewport || [], ft(s) ? s : [], c && o ? it(c) : []);
847
847
  }
848
- return e.concat(r, it(r, [], o));
848
+ return e.concat(s, it(s, [], o));
849
849
  }
850
850
  function kt(t) {
851
851
  return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
@@ -853,8 +853,8 @@ function kt(t) {
853
853
  function we(t) {
854
854
  const e = C(t);
855
855
  let o = parseFloat(e.width) || 0, n = parseFloat(e.height) || 0;
856
- const r = W(t), s = r ? t.offsetWidth : o, i = r ? t.offsetHeight : n, c = gt(o) !== s || gt(n) !== i;
857
- return c && (o = s, n = i), {
856
+ const s = W(t), i = s ? t.offsetWidth : o, r = s ? t.offsetHeight : n, c = gt(o) !== i || gt(n) !== r;
857
+ return c && (o = i, n = r), {
858
858
  width: o,
859
859
  height: n,
860
860
  $: c
@@ -869,12 +869,12 @@ function Z(t) {
869
869
  return D(1);
870
870
  const o = e.getBoundingClientRect(), {
871
871
  width: n,
872
- height: r,
873
- $: s
872
+ height: s,
873
+ $: i
874
874
  } = we(e);
875
- let i = (s ? gt(o.width) : o.width) / n, c = (s ? gt(o.height) : o.height) / r;
876
- return (!i || !Number.isFinite(i)) && (i = 1), (!c || !Number.isFinite(c)) && (c = 1), {
877
- x: i,
875
+ let r = (i ? gt(o.width) : o.width) / n, c = (i ? gt(o.height) : o.height) / s;
876
+ return (!r || !Number.isFinite(r)) && (r = 1), (!c || !Number.isFinite(c)) && (c = 1), {
877
+ x: r,
878
878
  y: c
879
879
  };
880
880
  }
@@ -889,41 +889,41 @@ function ye(t) {
889
889
  function dn(t, e, o) {
890
890
  return e === void 0 && (e = !1), !o || e && o !== E(t) ? !1 : e;
891
891
  }
892
- function G(t, e, o, n) {
892
+ function J(t, e, o, n) {
893
893
  e === void 0 && (e = !1), o === void 0 && (o = !1);
894
- const r = t.getBoundingClientRect(), s = Ut(t);
895
- let i = D(1);
896
- e && (n ? k(n) && (i = Z(n)) : i = Z(t));
897
- const c = dn(s, o, n) ? ye(s) : D(0);
898
- let a = (r.left + c.x) / i.x, l = (r.top + c.y) / i.y, h = r.width / i.x, f = r.height / i.y;
899
- if (s) {
900
- const m = E(s), u = n && k(n) ? E(n) : n;
901
- let d = m, p = kt(d);
902
- for (; p && n && u !== d; ) {
903
- const w = Z(p), g = p.getBoundingClientRect(), x = C(p), y = g.left + (p.clientLeft + parseFloat(x.paddingLeft)) * w.x, b = g.top + (p.clientTop + parseFloat(x.paddingTop)) * w.y;
904
- a *= w.x, l *= w.y, h *= w.x, f *= w.y, a += y, l += b, d = E(p), p = kt(d);
894
+ const s = t.getBoundingClientRect(), i = Ut(t);
895
+ let r = D(1);
896
+ e && (n ? k(n) && (r = Z(n)) : r = Z(t));
897
+ const c = dn(i, o, n) ? ye(i) : D(0);
898
+ let a = (s.left + c.x) / r.x, l = (s.top + c.y) / r.y, f = s.width / r.x, h = s.height / r.y;
899
+ if (i) {
900
+ const m = E(i), u = n && k(n) ? E(n) : n;
901
+ let g = m, w = kt(g);
902
+ for (; w && n && u !== g; ) {
903
+ const d = Z(w), p = w.getBoundingClientRect(), x = C(w), y = p.left + (w.clientLeft + parseFloat(x.paddingLeft)) * d.x, b = p.top + (w.clientTop + parseFloat(x.paddingTop)) * d.y;
904
+ a *= d.x, l *= d.y, f *= d.x, h *= d.y, a += y, l += b, g = E(w), w = kt(g);
905
905
  }
906
906
  }
907
907
  return wt({
908
- width: h,
909
- height: f,
908
+ width: f,
909
+ height: h,
910
910
  x: a,
911
911
  y: l
912
912
  });
913
913
  }
914
914
  function zt(t, e) {
915
915
  const o = bt(t).scrollLeft;
916
- return e ? e.left + o : G(N(t)).left + o;
916
+ return e ? e.left + o : J(N(t)).left + o;
917
917
  }
918
918
  function xe(t, e, o) {
919
919
  o === void 0 && (o = !1);
920
- const n = t.getBoundingClientRect(), r = n.left + e.scrollLeft - (o ? 0 : (
920
+ const n = t.getBoundingClientRect(), s = n.left + e.scrollLeft - (o ? 0 : (
921
921
  // RTL <body> scrollbar.
922
922
  zt(t, n)
923
- )), s = n.top + e.scrollTop;
923
+ )), i = n.top + e.scrollTop;
924
924
  return {
925
- x: r,
926
- y: s
925
+ x: s,
926
+ y: i
927
927
  };
928
928
  }
929
929
  function mn(t) {
@@ -931,61 +931,61 @@ function mn(t) {
931
931
  elements: e,
932
932
  rect: o,
933
933
  offsetParent: n,
934
- strategy: r
934
+ strategy: s
935
935
  } = t;
936
- const s = r === "fixed", i = N(n), c = e ? vt(e.floating) : !1;
937
- if (n === i || c && s)
936
+ const i = s === "fixed", r = N(n), c = e ? vt(e.floating) : !1;
937
+ if (n === r || c && i)
938
938
  return o;
939
939
  let a = {
940
940
  scrollLeft: 0,
941
941
  scrollTop: 0
942
942
  }, l = D(1);
943
- const h = D(0), f = W(n);
944
- if ((f || !f && !s) && ((nt(n) !== "body" || ft(i)) && (a = bt(n)), W(n))) {
945
- const u = G(n);
946
- l = Z(n), h.x = u.x + n.clientLeft, h.y = u.y + n.clientTop;
943
+ const f = D(0), h = W(n);
944
+ if ((h || !h && !i) && ((nt(n) !== "body" || ft(r)) && (a = bt(n)), W(n))) {
945
+ const u = J(n);
946
+ l = Z(n), f.x = u.x + n.clientLeft, f.y = u.y + n.clientTop;
947
947
  }
948
- const m = i && !f && !s ? xe(i, a, !0) : D(0);
948
+ const m = r && !h && !i ? xe(r, a, !0) : D(0);
949
949
  return {
950
950
  width: o.width * l.x,
951
951
  height: o.height * l.y,
952
- x: o.x * l.x - a.scrollLeft * l.x + h.x + m.x,
953
- y: o.y * l.y - a.scrollTop * l.y + h.y + m.y
952
+ x: o.x * l.x - a.scrollLeft * l.x + f.x + m.x,
953
+ y: o.y * l.y - a.scrollTop * l.y + f.y + m.y
954
954
  };
955
955
  }
956
956
  function gn(t) {
957
957
  return Array.from(t.getClientRects());
958
958
  }
959
959
  function pn(t) {
960
- const e = N(t), o = bt(t), n = t.ownerDocument.body, r = X(e.scrollWidth, e.clientWidth, n.scrollWidth, n.clientWidth), s = X(e.scrollHeight, e.clientHeight, n.scrollHeight, n.clientHeight);
961
- let i = -o.scrollLeft + zt(t);
960
+ const e = N(t), o = bt(t), n = t.ownerDocument.body, s = X(e.scrollWidth, e.clientWidth, n.scrollWidth, n.clientWidth), i = X(e.scrollHeight, e.clientHeight, n.scrollHeight, n.clientHeight);
961
+ let r = -o.scrollLeft + zt(t);
962
962
  const c = -o.scrollTop;
963
- return C(n).direction === "rtl" && (i += X(e.clientWidth, n.clientWidth) - r), {
964
- width: r,
965
- height: s,
966
- x: i,
963
+ return C(n).direction === "rtl" && (r += X(e.clientWidth, n.clientWidth) - s), {
964
+ width: s,
965
+ height: i,
966
+ x: r,
967
967
  y: c
968
968
  };
969
969
  }
970
970
  function wn(t, e) {
971
- const o = E(t), n = N(t), r = o.visualViewport;
972
- let s = n.clientWidth, i = n.clientHeight, c = 0, a = 0;
973
- if (r) {
974
- s = r.width, i = r.height;
971
+ const o = E(t), n = N(t), s = o.visualViewport;
972
+ let i = n.clientWidth, r = n.clientHeight, c = 0, a = 0;
973
+ if (s) {
974
+ i = s.width, r = s.height;
975
975
  const l = Ht();
976
- (!l || l && e === "fixed") && (c = r.offsetLeft, a = r.offsetTop);
976
+ (!l || l && e === "fixed") && (c = s.offsetLeft, a = s.offsetTop);
977
977
  }
978
978
  return {
979
- width: s,
980
- height: i,
979
+ width: i,
980
+ height: r,
981
981
  x: c,
982
982
  y: a
983
983
  };
984
984
  }
985
985
  function yn(t, e) {
986
- const o = G(t, !0, e === "fixed"), n = o.top + t.clientTop, r = o.left + t.clientLeft, s = W(t) ? Z(t) : D(1), i = t.clientWidth * s.x, c = t.clientHeight * s.y, a = r * s.x, l = n * s.y;
986
+ const o = J(t, !0, e === "fixed"), n = o.top + t.clientTop, s = o.left + t.clientLeft, i = W(t) ? Z(t) : D(1), r = t.clientWidth * i.x, c = t.clientHeight * i.y, a = s * i.x, l = n * i.y;
987
987
  return {
988
- width: i,
988
+ width: r,
989
989
  height: c,
990
990
  x: a,
991
991
  y: l
@@ -1000,10 +1000,10 @@ function Yt(t, e, o) {
1000
1000
  else if (k(e))
1001
1001
  n = yn(e, o);
1002
1002
  else {
1003
- const r = ye(t);
1003
+ const s = ye(t);
1004
1004
  n = {
1005
- x: e.x - r.x,
1006
- y: e.y - r.y,
1005
+ x: e.x - s.x,
1006
+ y: e.y - s.y,
1007
1007
  width: e.width,
1008
1008
  height: e.height
1009
1009
  };
@@ -1018,12 +1018,12 @@ function xn(t, e) {
1018
1018
  const o = e.get(t);
1019
1019
  if (o)
1020
1020
  return o;
1021
- let n = it(t, [], !1).filter((c) => k(c) && nt(c) !== "body"), r = null;
1022
- const s = C(t).position === "fixed";
1023
- let i = s ? K(t) : t;
1024
- for (; k(i) && !et(i); ) {
1025
- const c = C(i), a = Bt(i);
1026
- !a && c.position === "fixed" && (r = null), (s ? !a && !r : !a && c.position === "static" && !!r && ["absolute", "fixed"].includes(r.position) || ft(i) && !a && ve(t, i)) ? n = n.filter((h) => h !== i) : r = c, i = K(i);
1021
+ let n = it(t, [], !1).filter((c) => k(c) && nt(c) !== "body"), s = null;
1022
+ const i = C(t).position === "fixed";
1023
+ let r = i ? K(t) : t;
1024
+ for (; k(r) && !et(r); ) {
1025
+ const c = C(r), a = Bt(r);
1026
+ !a && c.position === "fixed" && (s = null), (i ? !a && !s : !a && c.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || ft(r) && !a && ve(t, r)) ? n = n.filter((f) => f !== r) : s = c, r = K(r);
1027
1027
  }
1028
1028
  return e.set(t, n), n;
1029
1029
  }
@@ -1032,12 +1032,12 @@ function vn(t) {
1032
1032
  element: e,
1033
1033
  boundary: o,
1034
1034
  rootBoundary: n,
1035
- strategy: r
1035
+ strategy: s
1036
1036
  } = t;
1037
- const i = [...o === "clippingAncestors" ? vt(e) ? [] : xn(e, this._c) : [].concat(o), n], c = i[0], a = i.reduce((l, h) => {
1038
- const f = Yt(e, h, r);
1039
- return l.top = X(f.top, l.top), l.right = tt(f.right, l.right), l.bottom = tt(f.bottom, l.bottom), l.left = X(f.left, l.left), l;
1040
- }, Yt(e, c, r));
1037
+ const r = [...o === "clippingAncestors" ? vt(e) ? [] : xn(e, this._c) : [].concat(o), n], c = r[0], a = r.reduce((l, f) => {
1038
+ const h = Yt(e, f, s);
1039
+ return l.top = X(h.top, l.top), l.right = tt(h.right, l.right), l.bottom = tt(h.bottom, l.bottom), l.left = X(h.left, l.left), l;
1040
+ }, Yt(e, c, s));
1041
1041
  return {
1042
1042
  width: a.right - a.left,
1043
1043
  height: a.bottom - a.top,
@@ -1056,30 +1056,30 @@ function bn(t) {
1056
1056
  };
1057
1057
  }
1058
1058
  function Rn(t, e, o) {
1059
- const n = W(e), r = N(e), s = o === "fixed", i = G(t, !0, s, e);
1059
+ const n = W(e), s = N(e), i = o === "fixed", r = J(t, !0, i, e);
1060
1060
  let c = {
1061
1061
  scrollLeft: 0,
1062
1062
  scrollTop: 0
1063
1063
  };
1064
1064
  const a = D(0);
1065
1065
  function l() {
1066
- a.x = zt(r);
1066
+ a.x = zt(s);
1067
1067
  }
1068
- if (n || !n && !s)
1069
- if ((nt(e) !== "body" || ft(r)) && (c = bt(e)), n) {
1070
- const u = G(e, !0, s, e);
1068
+ if (n || !n && !i)
1069
+ if ((nt(e) !== "body" || ft(s)) && (c = bt(e)), n) {
1070
+ const u = J(e, !0, i, e);
1071
1071
  a.x = u.x + e.clientLeft, a.y = u.y + e.clientTop;
1072
- } else r && l();
1073
- s && !n && r && l();
1074
- const h = r && !n && !s ? xe(r, c) : D(0), f = i.left + c.scrollLeft - a.x - h.x, m = i.top + c.scrollTop - a.y - h.y;
1072
+ } else s && l();
1073
+ i && !n && s && l();
1074
+ const f = s && !n && !i ? xe(s, c) : D(0), h = r.left + c.scrollLeft - a.x - f.x, m = r.top + c.scrollTop - a.y - f.y;
1075
1075
  return {
1076
- x: f,
1076
+ x: h,
1077
1077
  y: m,
1078
- width: i.width,
1079
- height: i.height
1078
+ width: r.width,
1079
+ height: r.height
1080
1080
  };
1081
1081
  }
1082
- function At(t) {
1082
+ function Ot(t) {
1083
1083
  return C(t).position === "static";
1084
1084
  }
1085
1085
  function qt(t, e) {
@@ -1095,20 +1095,20 @@ function be(t, e) {
1095
1095
  if (vt(t))
1096
1096
  return o;
1097
1097
  if (!W(t)) {
1098
- let r = K(t);
1099
- for (; r && !et(r); ) {
1100
- if (k(r) && !At(r))
1101
- return r;
1102
- r = K(r);
1098
+ let s = K(t);
1099
+ for (; s && !et(s); ) {
1100
+ if (k(s) && !Ot(s))
1101
+ return s;
1102
+ s = K(s);
1103
1103
  }
1104
1104
  return o;
1105
1105
  }
1106
1106
  let n = qt(t, e);
1107
- for (; n && un(n) && At(n); )
1107
+ for (; n && un(n) && Ot(n); )
1108
1108
  n = qt(n, e);
1109
- return n && et(n) && At(n) && !Bt(n) ? o : n || fn(t) || o;
1109
+ return n && et(n) && Ot(n) && !Bt(n) ? o : n || fn(t) || o;
1110
1110
  }
1111
- const On = async function(t) {
1111
+ const An = async function(t) {
1112
1112
  const e = this.getOffsetParent || be, o = this.getDimensions, n = await o(t.floating);
1113
1113
  return {
1114
1114
  reference: Rn(t.reference, await e(t.floating), t.strategy),
@@ -1120,7 +1120,7 @@ const On = async function(t) {
1120
1120
  }
1121
1121
  };
1122
1122
  };
1123
- function An(t) {
1123
+ function On(t) {
1124
1124
  return C(t).direction === "rtl";
1125
1125
  }
1126
1126
  const En = {
@@ -1128,35 +1128,35 @@ const En = {
1128
1128
  getDocumentElement: N,
1129
1129
  getClippingRect: vn,
1130
1130
  getOffsetParent: be,
1131
- getElementRects: On,
1131
+ getElementRects: An,
1132
1132
  getClientRects: gn,
1133
1133
  getDimensions: bn,
1134
1134
  getScale: Z,
1135
1135
  isElement: k,
1136
- isRTL: An
1136
+ isRTL: On
1137
1137
  };
1138
1138
  function Re(t, e) {
1139
1139
  return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
1140
1140
  }
1141
1141
  function Ln(t, e) {
1142
1142
  let o = null, n;
1143
- const r = N(t);
1144
- function s() {
1143
+ const s = N(t);
1144
+ function i() {
1145
1145
  var c;
1146
1146
  clearTimeout(n), (c = o) == null || c.disconnect(), o = null;
1147
1147
  }
1148
- function i(c, a) {
1149
- c === void 0 && (c = !1), a === void 0 && (a = 1), s();
1148
+ function r(c, a) {
1149
+ c === void 0 && (c = !1), a === void 0 && (a = 1), i();
1150
1150
  const l = t.getBoundingClientRect(), {
1151
- left: h,
1152
- top: f,
1151
+ left: f,
1152
+ top: h,
1153
1153
  width: m,
1154
1154
  height: u
1155
1155
  } = l;
1156
1156
  if (c || e(), !m || !u)
1157
1157
  return;
1158
- const d = dt(f), p = dt(r.clientWidth - (h + m)), w = dt(r.clientHeight - (f + u)), g = dt(h), y = {
1159
- rootMargin: -d + "px " + -p + "px " + -w + "px " + -g + "px",
1158
+ const g = dt(h), w = dt(s.clientWidth - (f + m)), d = dt(s.clientHeight - (h + u)), p = dt(f), y = {
1159
+ rootMargin: -g + "px " + -w + "px " + -d + "px " + -p + "px",
1160
1160
  threshold: X(0, tt(1, a)) || 1
1161
1161
  };
1162
1162
  let b = !0;
@@ -1164,73 +1164,73 @@ function Ln(t, e) {
1164
1164
  const R = L[0].intersectionRatio;
1165
1165
  if (R !== a) {
1166
1166
  if (!b)
1167
- return i();
1168
- R ? i(!1, R) : n = setTimeout(() => {
1169
- i(!1, 1e-7);
1167
+ return r();
1168
+ R ? r(!1, R) : n = setTimeout(() => {
1169
+ r(!1, 1e-7);
1170
1170
  }, 1e3);
1171
1171
  }
1172
- R === 1 && !Re(l, t.getBoundingClientRect()) && i(), b = !1;
1172
+ R === 1 && !Re(l, t.getBoundingClientRect()) && r(), b = !1;
1173
1173
  }
1174
1174
  try {
1175
1175
  o = new IntersectionObserver(v, {
1176
1176
  ...y,
1177
1177
  // Handle <iframe>s
1178
- root: r.ownerDocument
1178
+ root: s.ownerDocument
1179
1179
  });
1180
1180
  } catch {
1181
1181
  o = new IntersectionObserver(v, y);
1182
1182
  }
1183
1183
  o.observe(t);
1184
1184
  }
1185
- return i(!0), s;
1185
+ return r(!0), i;
1186
1186
  }
1187
1187
  function Pn(t, e, o, n) {
1188
1188
  n === void 0 && (n = {});
1189
1189
  const {
1190
- ancestorScroll: r = !0,
1191
- ancestorResize: s = !0,
1192
- elementResize: i = typeof ResizeObserver == "function",
1190
+ ancestorScroll: s = !0,
1191
+ ancestorResize: i = !0,
1192
+ elementResize: r = typeof ResizeObserver == "function",
1193
1193
  layoutShift: c = typeof IntersectionObserver == "function",
1194
1194
  animationFrame: a = !1
1195
- } = n, l = Ut(t), h = r || s ? [...l ? it(l) : [], ...it(e)] : [];
1196
- h.forEach((g) => {
1197
- r && g.addEventListener("scroll", o, {
1195
+ } = n, l = Ut(t), f = s || i ? [...l ? it(l) : [], ...it(e)] : [];
1196
+ f.forEach((p) => {
1197
+ s && p.addEventListener("scroll", o, {
1198
1198
  passive: !0
1199
- }), s && g.addEventListener("resize", o);
1199
+ }), i && p.addEventListener("resize", o);
1200
1200
  });
1201
- const f = l && c ? Ln(l, o) : null;
1201
+ const h = l && c ? Ln(l, o) : null;
1202
1202
  let m = -1, u = null;
1203
- i && (u = new ResizeObserver((g) => {
1204
- let [x] = g;
1203
+ r && (u = new ResizeObserver((p) => {
1204
+ let [x] = p;
1205
1205
  x && x.target === l && u && (u.unobserve(e), cancelAnimationFrame(m), m = requestAnimationFrame(() => {
1206
1206
  var y;
1207
1207
  (y = u) == null || y.observe(e);
1208
1208
  })), o();
1209
1209
  }), l && !a && u.observe(l), u.observe(e));
1210
- let d, p = a ? G(t) : null;
1211
- a && w();
1212
- function w() {
1213
- const g = G(t);
1214
- p && !Re(p, g) && o(), p = g, d = requestAnimationFrame(w);
1210
+ let g, w = a ? J(t) : null;
1211
+ a && d();
1212
+ function d() {
1213
+ const p = J(t);
1214
+ w && !Re(w, p) && o(), w = p, g = requestAnimationFrame(d);
1215
1215
  }
1216
1216
  return o(), () => {
1217
- var g;
1218
- h.forEach((x) => {
1219
- r && x.removeEventListener("scroll", o), s && x.removeEventListener("resize", o);
1220
- }), f == null || f(), (g = u) == null || g.disconnect(), u = null, a && cancelAnimationFrame(d);
1217
+ var p;
1218
+ f.forEach((x) => {
1219
+ s && x.removeEventListener("scroll", o), i && x.removeEventListener("resize", o);
1220
+ }), h == null || h(), (p = u) == null || p.disconnect(), u = null, a && cancelAnimationFrame(g);
1221
1221
  };
1222
1222
  }
1223
- const Sn = an, Tn = ln, Xt = sn, kn = rn, Cn = (t, e, o) => {
1224
- const n = /* @__PURE__ */ new Map(), r = {
1223
+ const Tn = an, Sn = ln, Xt = rn, kn = sn, Cn = (t, e, o) => {
1224
+ const n = /* @__PURE__ */ new Map(), s = {
1225
1225
  platform: En,
1226
1226
  ...o
1227
- }, s = {
1228
- ...r.platform,
1227
+ }, i = {
1228
+ ...s.platform,
1229
1229
  _c: n
1230
1230
  };
1231
1231
  return on(t, e, {
1232
- ...r,
1233
- platform: s
1232
+ ...s,
1233
+ platform: i
1234
1234
  });
1235
1235
  }, no = [
1236
1236
  "top",
@@ -1248,39 +1248,39 @@ const Sn = an, Tn = ln, Xt = sn, kn = rn, Cn = (t, e, o) => {
1248
1248
  ], oo = (t, e = { isOpen: !1 }) => {
1249
1249
  const o = [];
1250
1250
  let n = null;
1251
- const r = A.deriveProp(e.isOpen);
1252
- function s(c) {
1253
- n = c, r.set(!0);
1251
+ const s = O.deriveProp(e.isOpen);
1252
+ function i(c) {
1253
+ n = c, s.set(!0);
1254
1254
  }
1255
- function i() {
1256
- r.set(!1), o.forEach((c) => c()), o.length = 0;
1255
+ function r() {
1256
+ s.set(!1), o.forEach((c) => c()), o.length = 0;
1257
1257
  }
1258
1258
  return q(
1259
- t(s, i),
1260
- se(
1261
- r,
1259
+ t(i, r),
1260
+ re(
1261
+ s,
1262
1262
  () => q(
1263
1263
  (n == null ? void 0 : n.onClickOutside) != null ? qe(n.onClickOutside) : null,
1264
- B(
1265
- (c) => re(
1264
+ H(
1265
+ (c) => se(
1266
1266
  "body",
1267
1267
  Et.div(
1268
- B((a) => {
1268
+ H((a) => {
1269
1269
  a.style.position = "absolute";
1270
1270
  const l = typeof (n == null ? void 0 : n.target) == "string" ? c.querySelector(
1271
1271
  n.target
1272
1272
  ) : (n == null ? void 0 : n.target) ?? c;
1273
1273
  if (l == null)
1274
1274
  throw new Error(`Target not found: ${n == null ? void 0 : n.target}`);
1275
- let h = null;
1276
- const f = A.toSignal((n == null ? void 0 : n.mainAxisOffset) ?? 0), m = A.toSignal(
1275
+ let f = null;
1276
+ const h = O.toSignal((n == null ? void 0 : n.mainAxisOffset) ?? 0), m = O.toSignal(
1277
1277
  (n == null ? void 0 : n.crossAxisOffset) ?? 0
1278
- ), u = A.toSignal(
1278
+ ), u = O.toSignal(
1279
1279
  /* c8 ignore next 3 */
1280
1280
  (n == null ? void 0 : n.placement) ?? "top"
1281
- ), d = A.toSignal(
1281
+ ), g = O.toSignal(
1282
1282
  (n == null ? void 0 : n.arrowPadding) ?? 0
1283
- ), p = n == null ? void 0 : n.arrow, w = F({
1283
+ ), w = n == null ? void 0 : n.arrow, d = F({
1284
1284
  centerOffset: 0,
1285
1285
  alignmentOffset: 0,
1286
1286
  containerWidth: 0,
@@ -1288,20 +1288,20 @@ const Sn = an, Tn = ln, Xt = sn, kn = rn, Cn = (t, e, o) => {
1288
1288
  x: void 0,
1289
1289
  y: void 0
1290
1290
  });
1291
- async function g() {
1291
+ async function p() {
1292
1292
  const y = [
1293
1293
  Xt(),
1294
- Sn({
1295
- mainAxis: f.get(),
1294
+ Tn({
1295
+ mainAxis: h.get(),
1296
1296
  crossAxis: m.get()
1297
1297
  }),
1298
- Tn(),
1298
+ Sn(),
1299
1299
  Xt()
1300
1300
  ];
1301
- p != null && h != null && y.push(
1301
+ w != null && f != null && y.push(
1302
1302
  kn({
1303
- element: h,
1304
- padding: d.get()
1303
+ element: f,
1304
+ padding: g.get()
1305
1305
  })
1306
1306
  );
1307
1307
  const b = await Cn(l, a, {
@@ -1309,14 +1309,14 @@ const Sn = an, Tn = ln, Xt = sn, kn = rn, Cn = (t, e, o) => {
1309
1309
  strategy: "absolute",
1310
1310
  middleware: y
1311
1311
  }), { x: v, y: L, middlewareData: R } = b;
1312
- if (a.style.top = `${L}px`, a.style.left = `${v}px`, h != null && R.arrow != null) {
1312
+ if (a.style.top = `${L}px`, a.style.left = `${v}px`, f != null && R.arrow != null) {
1313
1313
  const {
1314
1314
  x: j,
1315
1315
  y: V,
1316
1316
  centerOffset: P,
1317
1317
  alignmentOffset: _
1318
1318
  } = R.arrow;
1319
- w.set({
1319
+ d.set({
1320
1320
  x: j,
1321
1321
  y: V,
1322
1322
  centerOffset: P,
@@ -1326,30 +1326,30 @@ const Sn = an, Tn = ln, Xt = sn, kn = rn, Cn = (t, e, o) => {
1326
1326
  });
1327
1327
  }
1328
1328
  }
1329
- const x = Se(
1330
- f,
1329
+ const x = Te(
1330
+ h,
1331
1331
  m,
1332
1332
  u
1333
- )(g);
1333
+ )(p);
1334
1334
  return q(
1335
1335
  n == null ? void 0 : n.content,
1336
1336
  (n == null ? void 0 : n.arrow) != null ? Et.div(
1337
1337
  n == null ? void 0 : n.arrow(
1338
1338
  ie(
1339
- w,
1339
+ d,
1340
1340
  u
1341
1341
  )((y, b) => ({
1342
1342
  ...y,
1343
1343
  placement: b
1344
1344
  }))
1345
1345
  ),
1346
- B((y) => {
1347
- h = y, g();
1346
+ H((y) => {
1347
+ f = y, p();
1348
1348
  })
1349
1349
  ) : null,
1350
1350
  M(
1351
- w.dispose,
1352
- Pn(l, a, g),
1351
+ d.dispose,
1352
+ Pn(l, a, p),
1353
1353
  x
1354
1354
  )
1355
1355
  );
@@ -1360,63 +1360,88 @@ const Sn = an, Tn = ln, Xt = sn, kn = rn, Cn = (t, e, o) => {
1360
1360
  )
1361
1361
  )
1362
1362
  );
1363
- }, Dn = (t, e, o) => {
1364
- const n = F(U.notAsked), r = n.map(
1365
- (f) => U.isSuccess(f) ? f.value : void 0
1366
- ), s = n.map(
1367
- (f) => U.isFailure(f) ? f.error : void 0
1368
- ), i = n.map((f) => U.isLoading(f));
1369
- let c;
1370
- const a = async (f) => {
1371
- c == null || c.abort(), c = new AbortController();
1372
- const m = c.signal, u = n.get();
1373
- n.set(U.loading(U.getOrUndefined(u)));
1363
+ }, Dn = ({
1364
+ request: t,
1365
+ load: e,
1366
+ convertError: o,
1367
+ onSuccess: n,
1368
+ onError: s,
1369
+ onSettled: i
1370
+ }) => {
1371
+ let r;
1372
+ const c = F(B.notAsked), a = c.map(
1373
+ (d) => B.isSuccess(d) ? d.value : void 0
1374
+ ), l = c.map(
1375
+ (d) => B.isFailure(d) ? d.error : void 0
1376
+ ), f = c.map((d) => B.isLoading(d)), h = () => {
1377
+ r == null || r.abort(), r = void 0;
1378
+ }, m = (d) => {
1379
+ h(), c.set(d ?? B.notAsked);
1380
+ }, u = async (d) => {
1381
+ h(), r = new AbortController();
1382
+ const p = r.signal, x = c.get();
1383
+ c.set(B.loading(B.getOrUndefined(x)));
1374
1384
  try {
1375
- const d = await e({ request: f, abortSignal: m, previous: u });
1376
- await Promise.resolve(), c = void 0, n.set(U.success(d));
1377
- } catch (d) {
1378
- c = void 0, n.set(U.failure(o(d)));
1385
+ const y = await e({ request: d, abortSignal: p, previous: x });
1386
+ await Promise.resolve(), r = void 0, c.set(B.success(y)), n == null || n(y, d);
1387
+ } catch (y) {
1388
+ r = void 0, c.set(B.failure(o(y))), s == null || s(o(y), d);
1379
1389
  }
1380
- }, l = () => a(A.get(t)), h = () => {
1381
- c == null || c.abort(), c = void 0, n.dispose();
1390
+ i == null || i(c.get(), d);
1391
+ }, g = () => u(O.get(t)), w = () => {
1392
+ r == null || r.abort(), r = void 0, c.dispose();
1382
1393
  };
1383
- return n.onDispose(A.on(t, a)), {
1384
- status: n,
1385
- value: r,
1386
- error: s,
1387
- loading: i,
1388
- reload: l,
1389
- dispose: h
1394
+ return c.onDispose(O.on(t, u)), {
1395
+ status: c,
1396
+ value: a,
1397
+ error: l,
1398
+ loading: f,
1399
+ cancel: m,
1400
+ reload: g,
1401
+ dispose: w
1390
1402
  };
1391
1403
  }, Wn = (t, e) => {
1392
- const { status: o, dispose: n, reload: r } = t, { loading: s, failure: i, success: c } = e;
1404
+ const { status: o, dispose: n, reload: s } = t, { pending: i, failure: r, success: c } = e;
1393
1405
  return q(
1394
1406
  M(n),
1395
1407
  ue(o, {
1396
- loading: s != null ? (a) => s(a, r) : void 0,
1397
- failure: i != null ? (a) => i(a, r) : void 0,
1398
- success: (a) => c(a, r)
1408
+ loading: i != null ? (a) => i({ previous: a, reload: s, cancel: t.cancel }) : void 0,
1409
+ failure: r != null ? (a) => r({ error: a, reload: s }) : void 0,
1410
+ success: (a) => c({ value: a, reload: s })
1399
1411
  })
1400
1412
  );
1401
- }, ro = ({
1413
+ }, so = ({
1402
1414
  request: t,
1403
1415
  load: e,
1404
- mapError: o = (n) => n
1416
+ convertError: o = (l) => l,
1417
+ onSuccess: n,
1418
+ onError: s,
1419
+ onSettled: i,
1420
+ success: r,
1421
+ pending: c,
1422
+ failure: a
1405
1423
  }) => {
1406
- const n = Dn(t, e, o);
1407
- return (r) => Wn(n, r);
1424
+ const l = Dn({
1425
+ request: t,
1426
+ load: e,
1427
+ convertError: o,
1428
+ onSuccess: n,
1429
+ onError: s,
1430
+ onSettled: i
1431
+ });
1432
+ return Wn(l, { success: r, pending: c, failure: a });
1408
1433
  }, Fn = (t, e) => {
1409
1434
  if (typeof e == "function")
1410
1435
  return Fn(t, { success: e });
1411
- const o = e.failure ?? ((r) => q(
1412
- M(r.on(console.error)),
1413
- r.map((s) => `Error: ${s}`)
1436
+ const o = e.failure ?? ((s) => q(
1437
+ M(s.on(console.error)),
1438
+ s.map((i) => `Error: ${i}`)
1414
1439
  )), n = e.success;
1415
- return oe(A.toSignal(t), {
1416
- Success: (r) => n(r.$.value),
1417
- Failure: (r) => o(r.$.error)
1440
+ return oe(O.toSignal(t), {
1441
+ Success: (s) => n(s.$.value),
1442
+ Failure: (s) => o(s.$.error)
1418
1443
  });
1419
- }, so = () => ne.focus((t) => {
1444
+ }, ro = () => ne.focus((t) => {
1420
1445
  var e;
1421
1446
  return (e = t.target) == null ? void 0 : e.select();
1422
1447
  });
@@ -1438,7 +1463,7 @@ class Rt {
1438
1463
  * console.log(rect.height); // 50
1439
1464
  * ```
1440
1465
  */
1441
- constructor(e, o, n, r, s, i) {
1466
+ constructor(e, o, n, s, i, r) {
1442
1467
  /**
1443
1468
  * Compares this rectangle with another rectangle for equality.
1444
1469
  *
@@ -1459,8 +1484,8 @@ class Rt {
1459
1484
  * console.log(rect1.equals(rect3)); // true (within tolerance)
1460
1485
  * ```
1461
1486
  */
1462
- Ot(this, "equals", (e) => ht(this.left, e.left) && ht(this.top, e.top) && ht(this.width, e.width) && ht(this.height, e.height));
1463
- this.left = e, this.top = o, this.width = n, this.height = r, this.localLeft = s, this.localTop = i;
1487
+ At(this, "equals", (e) => ht(this.left, e.left) && ht(this.top, e.top) && ht(this.width, e.width) && ht(this.height, e.height));
1488
+ this.left = e, this.top = o, this.width = n, this.height = s, this.localLeft = i, this.localTop = r;
1464
1489
  }
1465
1490
  /**
1466
1491
  * Creates a new Rect instance using an object with optional properties.
@@ -1491,11 +1516,11 @@ class Rt {
1491
1516
  left: e = 0,
1492
1517
  top: o = 0,
1493
1518
  width: n = 0,
1494
- height: r = 0,
1495
- localLeft: s = 0,
1496
- localTop: i = 0
1519
+ height: s = 0,
1520
+ localLeft: i = 0,
1521
+ localTop: r = 0
1497
1522
  }) {
1498
- return new Rt(e, o, n, r, s, i);
1523
+ return new Rt(e, o, n, s, i, r);
1499
1524
  }
1500
1525
  /**
1501
1526
  * Gets the x-coordinate of the right edge of the rectangle.
@@ -1608,7 +1633,7 @@ class Rt {
1608
1633
  return { width: this.width, height: this.height };
1609
1634
  }
1610
1635
  }
1611
- function Jt(t) {
1636
+ function Qt(t) {
1612
1637
  const e = t.getBoundingClientRect();
1613
1638
  return Rt.of({
1614
1639
  top: e.top + window.scrollY,
@@ -1619,14 +1644,14 @@ function Jt(t) {
1619
1644
  localTop: t.offsetTop
1620
1645
  });
1621
1646
  }
1622
- const io = (t) => Te((e) => {
1623
- const { element: o } = e, n = F(Jt(o), (c, a) => c.equals(a)), r = Mt(t(n))(e), s = () => n.set(Rt.of(Jt(o)));
1624
- let i = null;
1625
- return typeof ResizeObserver < "u" && (i = new ResizeObserver(s)), i == null || i.observe(o), M((c) => {
1626
- i == null || i.disconnect(), r(c);
1647
+ const io = (t) => Se((e) => {
1648
+ const { element: o } = e, n = F(Qt(o), (c, a) => c.equals(a)), s = Mt(t(n))(e), i = () => n.set(Rt.of(Qt(o)));
1649
+ let r = null;
1650
+ return typeof ResizeObserver < "u" && (r = new ResizeObserver(i)), r == null || r.observe(o), M((c) => {
1651
+ r == null || r.disconnect(), s(c);
1627
1652
  });
1628
1653
  });
1629
- function Gt(t) {
1654
+ function Jt(t) {
1630
1655
  return {
1631
1656
  /* c8 ignore next 6 */
1632
1657
  width: (t == null ? void 0 : t.innerWidth) ?? 0,
@@ -1635,37 +1660,37 @@ function Gt(t) {
1635
1660
  }
1636
1661
  const co = (t) => (e) => {
1637
1662
  const o = at(), n = F(
1638
- Gt(o),
1639
- (i, c) => i.width === c.width && i.height === c.height
1640
- ), r = Mt(t(n))(e), s = () => n.set(Gt(o));
1641
- return o == null || o.addEventListener("resize", s), (i) => {
1642
- o == null || o.removeEventListener("resize", s), r(i);
1663
+ Jt(o),
1664
+ (r, c) => r.width === c.width && r.height === c.height
1665
+ ), s = Mt(t(n))(e), i = () => n.set(Jt(o));
1666
+ return o == null || o.addEventListener("resize", i), (r) => {
1667
+ o == null || o.removeEventListener("resize", i), s(r);
1643
1668
  };
1644
1669
  }, Mn = (t, e) => {
1645
- const o = e.split("/").filter((r) => r !== ""), n = {};
1646
- for (let r = 0; r < t.length; r++) {
1647
- const s = t[r], i = o[r];
1648
- if (!i && s.type !== "catch-all")
1670
+ const o = e.split("/").filter((s) => s !== ""), n = {};
1671
+ for (let s = 0; s < t.length; s++) {
1672
+ const i = t[s], r = o[s];
1673
+ if (!r && i.type !== "catch-all")
1649
1674
  return null;
1650
- if (s.type === "literal") {
1651
- if (s.value !== i)
1675
+ if (i.type === "literal") {
1676
+ if (i.value !== r)
1652
1677
  return null;
1653
- } else if (s.type === "param")
1654
- n[s.name] = i;
1655
- else if (s.type === "catch-all")
1678
+ } else if (i.type === "param")
1679
+ n[i.name] = r;
1680
+ else if (i.type === "catch-all")
1656
1681
  return { params: n, path: e };
1657
1682
  }
1658
1683
  return o.length !== t.length ? null : { params: n, path: e };
1659
- }, Oe = (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 !== ""), ao = (t) => {
1684
+ }, 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 !== ""), ao = (t) => {
1660
1685
  const e = t.map((o) => {
1661
- const n = Oe(o);
1686
+ const n = Ae(o);
1662
1687
  return { route: o, segments: n };
1663
1688
  });
1664
1689
  return function(n) {
1665
- for (const { segments: r, route: s } of e) {
1666
- const i = Mn(r, n);
1667
- if (i)
1668
- return { ...i, route: s };
1690
+ for (const { segments: s, route: i } of e) {
1691
+ const r = Mn(s, n);
1692
+ if (r)
1693
+ return { ...r, route: i };
1669
1694
  }
1670
1695
  return null;
1671
1696
  };
@@ -1679,89 +1704,89 @@ const co = (t) => (e) => {
1679
1704
  };
1680
1705
  }
1681
1706
  }, Nn = (t, e, o) => {
1682
- const n = o.split("/").filter((i) => i !== ""), r = {};
1683
- let s = 0;
1684
- for (let i = 0; i < t.length; i++) {
1685
- const c = t[i], a = n[i];
1707
+ const n = o.split("/").filter((r) => r !== ""), s = {};
1708
+ let i = 0;
1709
+ for (let r = 0; r < t.length; r++) {
1710
+ const c = t[r], a = n[r];
1686
1711
  if (!a && c.type !== "catch-all")
1687
1712
  return null;
1688
1713
  if (c.type === "literal") {
1689
1714
  if (c.value !== a)
1690
1715
  return null;
1691
- s++;
1716
+ i++;
1692
1717
  } else if (c.type === "param")
1693
- r[c.name] = a, s++;
1718
+ s[c.name] = a, i++;
1694
1719
  else if (c.type === "catch-all") {
1695
- const l = "/" + n.slice(0, s).join("/"), h = "/" + n.slice(s).join("/");
1720
+ const l = "/" + n.slice(0, i).join("/"), f = "/" + n.slice(i).join("/");
1696
1721
  return {
1697
- params: r,
1722
+ params: s,
1698
1723
  matchedPath: l === "/" ? "" : l,
1699
- remainingPath: h === "/" ? "" : h,
1724
+ remainingPath: f === "/" ? "" : f,
1700
1725
  route: e
1701
1726
  };
1702
1727
  }
1703
1728
  }
1704
1729
  if (n.length === t.length) {
1705
- const i = "/" + n.join("/");
1730
+ const r = "/" + n.join("/");
1706
1731
  return {
1707
- params: r,
1708
- matchedPath: i === "/" ? "" : i,
1732
+ params: s,
1733
+ matchedPath: r === "/" ? "" : r,
1709
1734
  remainingPath: "",
1710
1735
  route: e
1711
1736
  };
1712
1737
  }
1713
1738
  return null;
1714
- }, Ae = (t) => {
1739
+ }, Oe = (t) => {
1715
1740
  const e = t.map((o) => {
1716
- const n = Oe(o);
1741
+ const n = Ae(o);
1717
1742
  return { route: o, segments: n };
1718
1743
  });
1719
1744
  return function(n) {
1720
- for (const { segments: r, route: s } of e) {
1721
- const i = Nn(r, s, n);
1722
- if (i)
1723
- return i;
1745
+ for (const { segments: s, route: i } of e) {
1746
+ const r = Nn(s, i, n);
1747
+ if (r)
1748
+ return r;
1724
1749
  }
1725
1750
  return null;
1726
1751
  };
1727
1752
  }, lo = (t) => {
1728
- const e = Ae(Object.keys(t));
1753
+ const e = Oe(Object.keys(t));
1729
1754
  return ke(
1730
1755
  Ct,
1731
1756
  {},
1732
- () => st(Nt, (o) => st(Ct, (n) => {
1733
- const r = o.map((s) => {
1734
- const i = e(s.pathname);
1735
- if (i == null)
1736
- throw console.error("No route found for", s), new Error("No route found");
1757
+ () => rt(Nt, (o) => rt(Ct, (n) => {
1758
+ const s = o.map((i) => {
1759
+ const r = e(i.pathname);
1760
+ if (r == null)
1761
+ throw console.error("No route found for", i), new Error("No route found");
1737
1762
  const c = {
1738
- matchedPath: i.matchedPath,
1739
- remainingPath: i.remainingPath,
1740
- fullPath: s.pathname,
1741
- params: i.params
1763
+ matchedPath: r.matchedPath,
1764
+ remainingPath: r.remainingPath,
1765
+ fullPath: i.pathname,
1766
+ params: r.params
1742
1767
  };
1743
1768
  return n.value = [...n.value, c], {
1744
- params: i.params,
1745
- route: i.route,
1746
- path: i.matchedPath || s.pathname,
1747
- search: s.search,
1748
- hash: s.hash
1769
+ params: r.params,
1770
+ route: r.route,
1771
+ path: r.matchedPath || i.pathname,
1772
+ search: i.search,
1773
+ hash: i.hash
1749
1774
  };
1750
1775
  });
1751
1776
  return ce(
1752
- r.map((s) => [s.route, s]),
1777
+ s.map((i) => [i.route, i]),
1753
1778
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1754
1779
  t
1755
1780
  );
1756
1781
  }))
1757
1782
  );
1758
1783
  }, uo = (t) => {
1759
- const e = Ae(Object.keys(t));
1760
- return st(Ct, (o) => st(Nt, (n) => {
1761
- const r = o.map((s) => {
1762
- const i = s[s.length - 1], c = (i == null ? void 0 : i.remainingPath) || "";
1784
+ const e = Oe(Object.keys(t));
1785
+ return rt(Ct, (o) => rt(Nt, (n) => {
1786
+ const s = o.map((i) => {
1787
+ const r = i[i.length - 1], c = (r == null ? void 0 : r.remainingPath) || "";
1763
1788
  if (c === "")
1764
- throw console.error("No remaining path for SubRouter", s), new Error("No remaining path for SubRouter");
1789
+ throw console.error("No remaining path for SubRouter", i), new Error("No remaining path for SubRouter");
1765
1790
  const a = e(c);
1766
1791
  if (a == null)
1767
1792
  throw console.error("No route found for remaining path", c), new Error("No route found");
@@ -1775,12 +1800,12 @@ const co = (t) => (e) => {
1775
1800
  };
1776
1801
  });
1777
1802
  return ce(
1778
- r.map((s) => [s.route, s]),
1803
+ s.map((i) => [i.route, i]),
1779
1804
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1780
1805
  t
1781
1806
  );
1782
1807
  }));
1783
- }, yt = 60 * 1e3, Dt = 60 * yt, ct = 24 * Dt, Qt = 7 * ct, Zt = 30 * ct, Vn = 365 * ct, $n = [
1808
+ }, yt = 60 * 1e3, Dt = 60 * yt, ct = 24 * Dt, Gt = 7 * ct, Zt = 30 * ct, Vn = 365 * ct, $n = [
1784
1809
  {
1785
1810
  max: yt * 90,
1786
1811
  value: yt,
@@ -1803,8 +1828,8 @@ const co = (t) => (e) => {
1803
1828
  future: { singular: "tomorrow", plural: "in {} days" }
1804
1829
  },
1805
1830
  {
1806
- max: Qt * 6,
1807
- value: Qt,
1831
+ max: Gt * 6,
1832
+ value: Gt,
1808
1833
  name: "week",
1809
1834
  past: { singular: "last week", plural: "{} weeks ago" },
1810
1835
  future: { singular: "in a week", plural: "in {} weeks" }
@@ -1825,10 +1850,10 @@ const co = (t) => (e) => {
1825
1850
  }
1826
1851
  ];
1827
1852
  function te(t, e, o, n) {
1828
- const r = Math.round(t / e);
1829
- return r <= 1 ? o : n.replace(
1853
+ const s = Math.round(t / e);
1854
+ return s <= 1 ? o : n.replace(
1830
1855
  "{}",
1831
- r.toLocaleString(void 0, {
1856
+ s.toLocaleString(void 0, {
1832
1857
  maximumFractionDigits: 0,
1833
1858
  minimumFractionDigits: 0
1834
1859
  })
@@ -1846,11 +1871,11 @@ const Bn = (t = 1e3) => {
1846
1871
  return t < 0 ? te(e, o.value, o.past.singular, o.past.plural) : te(e, o.value, o.future.singular, o.future.plural);
1847
1872
  throw new Error("unreachable");
1848
1873
  }, Un = (t, { now: e, frequency: o = 1e4 } = {}) => {
1849
- const n = e != null ? ee.is(e) ? e.derive() : F(e) : Bn(o), r = ie(
1874
+ const n = e != null ? ee.is(e) ? e.derive() : F(e) : Bn(o), s = ie(
1850
1875
  t,
1851
1876
  n
1852
- )((s, i) => s.getTime() - i.getTime());
1853
- return r.onDispose(() => A.dispose(n)), r;
1877
+ )((i, r) => i.getTime() - r.getTime());
1878
+ return s.onDispose(() => O.dispose(n)), s;
1854
1879
  }, zn = (t, e = {}) => {
1855
1880
  const o = Un(t, e), n = o.map(Hn);
1856
1881
  return n.onDispose(o.dispose), n;
@@ -1862,7 +1887,7 @@ class Kn extends Ce {
1862
1887
  * Triggers an update of the Ticker by incrementing its internal value.
1863
1888
  * @returns void
1864
1889
  */
1865
- Ot(this, "tick", () => this.update((o) => o + 1));
1890
+ At(this, "tick", () => this.update((o) => o + 1));
1866
1891
  }
1867
1892
  }
1868
1893
  const ho = (t = 0) => new Kn(t, (e, o) => e === o);
@@ -1874,8 +1899,8 @@ export {
1874
1899
  Xn as AutoSelect,
1875
1900
  uo as ChildRouter,
1876
1901
  io as ElementRect,
1877
- Qn as HTMLTitle,
1878
- Gn as HiddenWhenEmpty,
1902
+ Gn as HTMLTitle,
1903
+ Jn as HiddenWhenEmpty,
1879
1904
  Ye as InViewport,
1880
1905
  Nt as Location,
1881
1906
  qe as OnClickOutside,
@@ -1883,27 +1908,27 @@ export {
1883
1908
  eo as OnEscapeKey,
1884
1909
  fe as OnKeyPressed,
1885
1910
  oo as PopOver,
1911
+ so as Query,
1912
+ Wn as QueryDisplay,
1886
1913
  Rt as Rect,
1887
- ro as Resource,
1888
- Wn as ResourceDisplay,
1889
1914
  Fn as ResultView,
1890
1915
  lo as RootRouter,
1891
1916
  Ct as RouterContextProvider,
1892
- so as SelectOnFocus,
1917
+ ro as SelectOnFocus,
1893
1918
  Kn as Ticker,
1894
1919
  Zn as WhenInViewport,
1895
1920
  co as WindowSize,
1896
1921
  Fe as _checkExtensionCondition,
1897
1922
  We as _getExtension,
1898
1923
  ao as _makeRouteMatcher,
1899
- Oe as _parseRouteSegments,
1924
+ Ae as _parseRouteSegments,
1900
1925
  no as allPlacements,
1901
1926
  Ve as areLocationsEqual,
1902
- Jn as classes,
1903
- Jt as getAbsoluteRect,
1927
+ Qn as classes,
1928
+ Qt as getAbsoluteRect,
1904
1929
  Ne as handleAnchorClick,
1905
1930
  le as locationFromURL,
1906
- Dn as makeResource,
1931
+ Dn as makeQueryResource,
1907
1932
  Xe as matchesKeyCombo,
1908
1933
  Mn as matchesRoute,
1909
1934
  Bn as nowSignal,