@tempots/ui 0.19.0 → 0.21.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,13 +1,13 @@
1
- import { makeProviderMark as Lt, makeProp as H, Fragment as X, OnUnmount as q, WithProvider as Ot, UseProvider as St, renderableOfTNode as nt, Signal as Gt, html as Tt, on as Ct, Value as ot, attr as kt, Empty as ut, OneOfType as Pt, makeSignal as Qt, Portal as Wt, isSSR as Zt, OnMount as Mt, When as Ft, OneOfTuple as te } from "@tempots/dom";
2
- const ee = (t) => {
1
+ import { makeProviderMark as Pt, makeProp as k, Fragment as X, OnUnmount as q, WithProvider as Dt, UseProvider as Wt, renderableOfTNode as it, Signal as Mt, html as Ft, on as Nt, Value as rt, attr as Vt, Empty as ht, OneOfType as $t, makeSignal as ie, Portal as zt, isSSR as re, OnMount as Ht, When as Ut, OneOfTuple as se, makeComputedOf as ce, Prop as le } from "@tempots/dom";
2
+ const ae = (t) => {
3
3
  const e = t.split("/").pop();
4
4
  if (e == null || e.startsWith(".")) return;
5
- const o = e.split(".") || [];
6
- return o.length > 1 ? "." + o.pop() : void 0;
7
- }, ne = (t, e) => {
8
- const o = ee(e);
9
- return o != null && (t.length === 0 || !t.some((n) => o == n));
10
- }, oe = (t, e, o, n) => {
5
+ const n = e.split(".") || [];
6
+ return n.length > 1 ? "." + n.pop() : void 0;
7
+ }, ue = (t, e) => {
8
+ const n = ae(e);
9
+ return n != null && (t.length === 0 || !t.some((o) => n == o));
10
+ }, fe = (t, e, n, o) => {
11
11
  let i = t.target;
12
12
  for (; i != null && !(i instanceof HTMLAnchorElement); )
13
13
  i = i.parentElement;
@@ -17,29 +17,29 @@ const ee = (t) => {
17
17
  if (t.button !== 0 || t.ctrlKey || t.metaKey || r.target !== "_self" && r.target !== "" || r.getAttribute("download") != null)
18
18
  return !0;
19
19
  const { pathname: s, search: c, hash: a } = r;
20
- if (n) {
20
+ if (o) {
21
21
  const l = s + c + a, u = r.getAttribute("href");
22
22
  if (!(u != null && u.startsWith("#")) && u !== l)
23
23
  return !0;
24
24
  }
25
- return e ? !1 : ne(o, s);
26
- }, ie = (t, e = {
25
+ return e ? !1 : ue(n, s);
26
+ }, he = (t, e = {
27
27
  ignoreUrlWithExtension: !0,
28
28
  allowedExtensions: [],
29
29
  ignoreExternalUrl: !0
30
30
  }) => {
31
- const o = e.ignoreUrlWithExtension === !0 && Array.isArray(e.allowedExtensions) ? e.allowedExtensions.map(
32
- (n) => n.startsWith(".") ? n : "." + n
31
+ const n = e.ignoreUrlWithExtension === !0 && Array.isArray(e.allowedExtensions) ? e.allowedExtensions.map(
32
+ (o) => o.startsWith(".") ? o : "." + o
33
33
  ) : [];
34
- return (n) => {
35
- oe(
36
- n,
37
- e.ignoreUrlWithExtension ?? !0,
34
+ return (o) => {
35
+ fe(
38
36
  o,
37
+ e.ignoreUrlWithExtension ?? !0,
38
+ n,
39
39
  e.ignoreExternalUrl ?? !0
40
- ) || t() && n.preventDefault();
40
+ ) || t() && o.preventDefault();
41
41
  };
42
- }, Dt = Lt("LocationProvider"), re = () => {
42
+ }, _t = Pt("LocationProvider"), de = () => {
43
43
  const t = (window == null ? void 0 : window.location.hash) === "" ? void 0 : (window == null ? void 0 : window.location.hash.substring(1)) ?? void 0;
44
44
  return {
45
45
  pathname: (window == null ? void 0 : window.location.pathname) ?? "",
@@ -48,103 +48,103 @@ const ee = (t) => {
48
48
  ),
49
49
  hash: t
50
50
  };
51
- }, se = (t, e) => t.pathname === e.pathname && JSON.stringify(t.search) === JSON.stringify(e.search) && t.hash === e.hash, ce = (t) => {
52
- const e = new URL(t, (window == null ? void 0 : window.location.toString()) ?? ""), o = Object.fromEntries(e.searchParams.entries());
53
- let n = e.hash;
54
- return n.startsWith("#") && (n = n.substring(1)), {
51
+ }, me = (t, e) => t.pathname === e.pathname && JSON.stringify(t.search) === JSON.stringify(e.search) && t.hash === e.hash, pe = (t) => {
52
+ const e = new URL(t, (window == null ? void 0 : window.location.toString()) ?? ""), n = Object.fromEntries(e.searchParams.entries());
53
+ let o = e.hash;
54
+ return o.startsWith("#") && (o = o.substring(1)), {
55
55
  pathname: e.pathname,
56
- search: o,
57
- hash: n === "" ? void 0 : n
56
+ search: n,
57
+ hash: o === "" ? void 0 : o
58
58
  };
59
- }, le = (t, e) => {
60
- const o = ce(e);
61
- return t.set(o), t;
62
- }, ae = (t) => {
63
- const o = new URLSearchParams(t.search).toString(), n = t.hash;
64
- return `${t.pathname}${o ? `?${o}` : ""}${n ? `#${n}` : ""}`;
65
- }, ue = () => {
66
- const t = H(re(), se), e = () => {
67
- let o = (window == null ? void 0 : window.location.hash) ?? "";
68
- o.startsWith("#") && (o = o.substring(1));
69
- const n = {
59
+ }, ge = (t, e) => {
60
+ const n = pe(e);
61
+ return t.set(n), t;
62
+ }, we = (t) => {
63
+ const n = new URLSearchParams(t.search).toString(), o = t.hash;
64
+ return `${t.pathname}${n ? `?${n}` : ""}${o ? `#${o}` : ""}`;
65
+ }, ye = () => {
66
+ const t = k(de(), me), e = () => {
67
+ let n = (window == null ? void 0 : window.location.hash) ?? "";
68
+ n.startsWith("#") && (n = n.substring(1));
69
+ const o = {
70
70
  pathname: (window == null ? void 0 : window.location.pathname) ?? "",
71
71
  search: Object.fromEntries(
72
72
  new URLSearchParams((window == null ? void 0 : window.location.search) ?? "").entries()
73
73
  ),
74
- hash: o === "" ? void 0 : o
74
+ hash: n === "" ? void 0 : n
75
75
  };
76
- t.set(n);
76
+ t.set(o);
77
77
  };
78
78
  return window == null || window.addEventListener("popstate", e), t.onDispose(() => {
79
79
  window == null || window.removeEventListener("popstate", e);
80
- }), t.on((o) => {
81
- window == null || window.history.pushState({}, "", ae(o));
80
+ }), t.on((n) => {
81
+ window == null || window.history.pushState({}, "", we(n));
82
82
  }), t;
83
- }, en = (t) => {
84
- const e = ue();
83
+ }, dn = (t) => {
84
+ const e = ye();
85
85
  return X(
86
86
  q(e.dispose),
87
- Ot(Dt, e, t)
87
+ Dt(_t, e, t)
88
88
  );
89
- }, Nt = (t) => St(Dt, (e) => (o) => {
90
- const n = H(e.value, e.equals);
91
- e.feedProp(n), n.on(e.set);
92
- const i = nt(t(n))(o);
89
+ }, Bt = (t) => Wt(_t, (e) => (n) => {
90
+ const o = k(e.value, e.equals);
91
+ e.feedProp(o), o.on(e.set);
92
+ const i = it(t(o))(n);
93
93
  return (r) => {
94
- n.dispose(), i(r);
94
+ o.dispose(), i(r);
95
95
  };
96
- }), fe = (t, ...e) => {
97
- if (typeof t == "string" || Gt.is(t))
98
- return fe({ href: t }, ...e);
99
- const { href: o, ...n } = t;
100
- return Nt((i) => Tt.a(
101
- Ct.click(
102
- ie(() => (le(i, ot.get(o)), !0), n)
96
+ }), ve = (t, ...e) => {
97
+ if (typeof t == "string" || Mt.is(t))
98
+ return ve({ href: t }, ...e);
99
+ const { href: n, ...o } = t;
100
+ return Bt((i) => Ft.a(
101
+ Nt.click(
102
+ he(() => (ge(i, rt.get(n)), !0), o)
103
103
  ),
104
- kt.href(o),
104
+ Vt.href(n),
105
105
  ...e
106
106
  ));
107
- }, Vt = Lt("Appearance"), nn = (t) => {
108
- const e = window.matchMedia != null && window.matchMedia("(prefers-color-scheme: dark)").matches, o = H(e ? "dark" : "light"), n = (r) => {
109
- o.set(r.matches ? "dark" : "light");
107
+ }, It = Pt("Appearance"), mn = (t) => {
108
+ const e = window.matchMedia != null && window.matchMedia("(prefers-color-scheme: dark)").matches, n = k(e ? "dark" : "light"), o = (r) => {
109
+ n.set(r.matches ? "dark" : "light");
110
110
  }, i = window.matchMedia != null ? window.matchMedia("(prefers-color-scheme: dark)") : void 0;
111
- return i == null || i.addEventListener("change", n), X(
112
- Ot(Vt, o, t),
113
- q(() => i == null ? void 0 : i.removeEventListener("change", n))
111
+ return i == null || i.addEventListener("change", o), X(
112
+ Dt(It, n, t),
113
+ q(() => i == null ? void 0 : i.removeEventListener("change", o))
114
114
  );
115
- }, on = (t) => St(Vt, t), he = (t, e) => {
115
+ }, pn = (t) => Wt(It, t), xe = (t, e) => {
116
116
  if (typeof e == "function")
117
- return he(t, { success: e });
118
- const o = e.failure ?? ((s) => X(
117
+ return xe(t, { success: e });
118
+ const n = e.failure ?? ((s) => X(
119
119
  q(s.on(console.error)),
120
120
  s.map((c) => `Error: ${c}`)
121
- )), n = e.success, i = e.loading ?? (() => ut), r = e.notAsked ?? (() => ut);
122
- return Pt(ot.toSignal(t), {
123
- AsyncSuccess: (s) => n(s.$.value),
124
- AsyncFailure: (s) => o(s.$.error),
125
- Loading: (s) => i(s.$.previousValue ?? Qt(void 0)),
121
+ )), o = e.success, i = e.loading ?? (() => ht), r = e.notAsked ?? (() => ht);
122
+ return $t(rt.toSignal(t), {
123
+ AsyncSuccess: (s) => o(s.$.value),
124
+ AsyncFailure: (s) => n(s.$.error),
125
+ Loading: (s) => i(s.$.previousValue ?? ie(void 0)),
126
126
  NotAsked: r
127
127
  });
128
- }, rn = (t = 10) => (e) => {
129
- const o = setTimeout(() => {
130
- var n;
131
- (n = e.element) == null || n.focus();
128
+ }, gn = (t = 10) => (e) => {
129
+ const n = setTimeout(() => {
130
+ var o;
131
+ (o = e.element) == null || o.focus();
132
132
  }, t);
133
- return (n) => clearTimeout(o);
134
- }, sn = (t = 10) => (e) => {
135
- const o = setTimeout(() => {
136
- var n;
137
- (n = e.element) == null || n.select();
133
+ return (o) => clearTimeout(n);
134
+ }, wn = (t = 10) => (e) => {
135
+ const n = setTimeout(() => {
136
+ var o;
137
+ (o = e.element) == null || o.select();
138
138
  }, t);
139
- return (n) => {
140
- clearTimeout(o);
139
+ return (o) => {
140
+ clearTimeout(n);
141
141
  };
142
- }, cn = (t) => {
143
- const e = t.element, o = e.style.getPropertyValue(":empty");
144
- return e.style.setProperty(":empty", "display:none"), (n) => {
145
- n && e.style.setProperty(":empty", o);
142
+ }, yn = (t) => {
143
+ const e = t.element, n = e.style.getPropertyValue(":empty");
144
+ return e.style.setProperty(":empty", "display:none"), (o) => {
145
+ o && e.style.setProperty(":empty", n);
146
146
  };
147
- }, ln = (t) => Wt("head > title", kt.innerText(t)), de = {
147
+ }, vn = (t) => zt("head > title", Vt.innerText(t)), be = {
148
148
  partial: {
149
149
  root: null,
150
150
  rootMargin: "0px",
@@ -155,89 +155,89 @@ const ee = (t) => {
155
155
  rootMargin: "0px",
156
156
  threshold: 1
157
157
  }
158
- }, G = {
158
+ }, Q = {
159
159
  partial: /* @__PURE__ */ new Map(),
160
160
  full: /* @__PURE__ */ new Map()
161
161
  }, I = {
162
162
  partial: null,
163
163
  full: null
164
164
  };
165
- function me(t) {
165
+ function Ae(t) {
166
166
  return I[t] == null && (I[t] = new IntersectionObserver((e) => {
167
- e.forEach((o) => {
168
- const n = G[t].get(o.target);
169
- n == null || n.set(o.isIntersecting);
167
+ e.forEach((n) => {
168
+ const o = Q[t].get(n.target);
169
+ o == null || o.set(n.isIntersecting);
170
170
  });
171
- }, de[t])), I[t];
171
+ }, be[t])), I[t];
172
172
  }
173
- const pe = (t, e) => {
174
- const o = H(Zt());
173
+ const Ee = (t, e) => {
174
+ const n = k(re());
175
175
  return X(
176
- Mt((n) => {
177
- const i = typeof IntersectionObserver < "u" ? me(t) : null;
178
- return G[t].set(n, o), i == null || i.observe(n), () => {
176
+ Ht((o) => {
177
+ const i = typeof IntersectionObserver < "u" ? Ae(t) : null;
178
+ return Q[t].set(o, n), i == null || i.observe(o), () => {
179
179
  var r;
180
- i == null || i.unobserve(n), G[t].delete(n), G[t].size === 0 && ((r = I[t]) == null || r.disconnect(), I[t] = null);
180
+ i == null || i.unobserve(o), Q[t].delete(o), Q[t].size === 0 && ((r = I[t]) == null || r.disconnect(), I[t] = null);
181
181
  };
182
182
  }),
183
- q(o.dispose),
184
- nt(e(o))
183
+ q(n.dispose),
184
+ it(e(n))
185
185
  );
186
- }, an = (t, e, o) => pe(t, (n) => Ft(n, e, o ?? ut)), Q = Math.min, W = Math.max, Z = Math.round, J = Math.floor, C = (t) => ({
186
+ }, xn = (t, e, n) => Ee(t, (o) => Ut(o, e, n ?? ht)), Z = Math.min, W = Math.max, tt = Math.round, G = Math.floor, C = (t) => ({
187
187
  x: t,
188
188
  y: t
189
- }), ge = {
189
+ }), Re = {
190
190
  left: "right",
191
191
  right: "left",
192
192
  bottom: "top",
193
193
  top: "bottom"
194
- }, we = {
194
+ }, Le = {
195
195
  start: "end",
196
196
  end: "start"
197
197
  };
198
- function xt(t, e, o) {
199
- return W(t, Q(e, o));
198
+ function At(t, e, n) {
199
+ return W(t, Z(e, n));
200
200
  }
201
- function it(t, e) {
201
+ function st(t, e) {
202
202
  return typeof t == "function" ? t(e) : t;
203
203
  }
204
204
  function M(t) {
205
205
  return t.split("-")[0];
206
206
  }
207
- function rt(t) {
207
+ function ct(t) {
208
208
  return t.split("-")[1];
209
209
  }
210
- function $t(t) {
210
+ function jt(t) {
211
211
  return t === "x" ? "y" : "x";
212
212
  }
213
- function zt(t) {
213
+ function Yt(t) {
214
214
  return t === "y" ? "height" : "width";
215
215
  }
216
- function $(t) {
216
+ function z(t) {
217
217
  return ["top", "bottom"].includes(M(t)) ? "y" : "x";
218
218
  }
219
- function Ht(t) {
220
- return $t($(t));
219
+ function Xt(t) {
220
+ return jt(z(t));
221
221
  }
222
- function ye(t, e, o) {
223
- o === void 0 && (o = !1);
224
- const n = rt(t), i = Ht(t), r = zt(i);
225
- let s = i === "x" ? n === (o ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
226
- return e.reference[r] > e.floating[r] && (s = tt(s)), [s, tt(s)];
222
+ function Oe(t, e, n) {
223
+ n === void 0 && (n = !1);
224
+ const o = ct(t), i = Xt(t), r = Yt(i);
225
+ let s = i === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
226
+ return e.reference[r] > e.floating[r] && (s = et(s)), [s, et(s)];
227
227
  }
228
- function xe(t) {
229
- const e = tt(t);
230
- return [ft(t), e, ft(e)];
228
+ function Se(t) {
229
+ const e = et(t);
230
+ return [dt(t), e, dt(e)];
231
231
  }
232
- function ft(t) {
233
- return t.replace(/start|end/g, (e) => we[e]);
232
+ function dt(t) {
233
+ return t.replace(/start|end/g, (e) => Le[e]);
234
234
  }
235
- function ve(t, e, o) {
236
- const n = ["left", "right"], i = ["right", "left"], r = ["top", "bottom"], s = ["bottom", "top"];
235
+ function Te(t, e, n) {
236
+ const o = ["left", "right"], i = ["right", "left"], r = ["top", "bottom"], s = ["bottom", "top"];
237
237
  switch (t) {
238
238
  case "top":
239
239
  case "bottom":
240
- return o ? e ? i : n : e ? n : i;
240
+ return n ? e ? i : o : e ? o : i;
241
241
  case "left":
242
242
  case "right":
243
243
  return e ? r : s;
@@ -245,15 +245,15 @@ function ve(t, e, o) {
245
245
  return [];
246
246
  }
247
247
  }
248
- function be(t, e, o, n) {
249
- const i = rt(t);
250
- let r = ve(M(t), o === "start", n);
251
- return i && (r = r.map((s) => s + "-" + i), e && (r = r.concat(r.map(ft)))), r;
248
+ function ke(t, e, n, o) {
249
+ const i = ct(t);
250
+ let r = Te(M(t), n === "start", o);
251
+ return i && (r = r.map((s) => s + "-" + i), e && (r = r.concat(r.map(dt)))), r;
252
252
  }
253
- function tt(t) {
254
- return t.replace(/left|right|bottom|top/g, (e) => ge[e]);
253
+ function et(t) {
254
+ return t.replace(/left|right|bottom|top/g, (e) => Re[e]);
255
255
  }
256
- function Ae(t) {
256
+ function Ce(t) {
257
257
  return {
258
258
  top: 0,
259
259
  right: 0,
@@ -262,87 +262,87 @@ function Ae(t) {
262
262
  ...t
263
263
  };
264
264
  }
265
- function Ee(t) {
266
- return typeof t != "number" ? Ae(t) : {
265
+ function Pe(t) {
266
+ return typeof t != "number" ? Ce(t) : {
267
267
  top: t,
268
268
  right: t,
269
269
  bottom: t,
270
270
  left: t
271
271
  };
272
272
  }
273
- function et(t) {
273
+ function nt(t) {
274
274
  const {
275
275
  x: e,
276
- y: o,
277
- width: n,
276
+ y: n,
277
+ width: o,
278
278
  height: i
279
279
  } = t;
280
280
  return {
281
- width: n,
281
+ width: o,
282
282
  height: i,
283
- top: o,
283
+ top: n,
284
284
  left: e,
285
- right: e + n,
286
- bottom: o + i,
285
+ right: e + o,
286
+ bottom: n + i,
287
287
  x: e,
288
- y: o
288
+ y: n
289
289
  };
290
290
  }
291
- function vt(t, e, o) {
291
+ function Et(t, e, n) {
292
292
  let {
293
- reference: n,
293
+ reference: o,
294
294
  floating: i
295
295
  } = t;
296
- const r = $(e), s = Ht(e), c = zt(s), a = M(e), l = r === "y", u = n.x + n.width / 2 - i.width / 2, f = n.y + n.height / 2 - i.height / 2, m = n[c] / 2 - i[c] / 2;
296
+ const r = z(e), s = Xt(e), c = Yt(s), a = M(e), l = r === "y", u = o.x + o.width / 2 - i.width / 2, f = o.y + o.height / 2 - i.height / 2, m = o[c] / 2 - i[c] / 2;
297
297
  let h;
298
298
  switch (a) {
299
299
  case "top":
300
300
  h = {
301
301
  x: u,
302
- y: n.y - i.height
302
+ y: o.y - i.height
303
303
  };
304
304
  break;
305
305
  case "bottom":
306
306
  h = {
307
307
  x: u,
308
- y: n.y + n.height
308
+ y: o.y + o.height
309
309
  };
310
310
  break;
311
311
  case "right":
312
312
  h = {
313
- x: n.x + n.width,
313
+ x: o.x + o.width,
314
314
  y: f
315
315
  };
316
316
  break;
317
317
  case "left":
318
318
  h = {
319
- x: n.x - i.width,
319
+ x: o.x - i.width,
320
320
  y: f
321
321
  };
322
322
  break;
323
323
  default:
324
324
  h = {
325
- x: n.x,
326
- y: n.y
325
+ x: o.x,
326
+ y: o.y
327
327
  };
328
328
  }
329
- switch (rt(e)) {
329
+ switch (ct(e)) {
330
330
  case "start":
331
- h[s] -= m * (o && l ? -1 : 1);
331
+ h[s] -= m * (n && l ? -1 : 1);
332
332
  break;
333
333
  case "end":
334
- h[s] += m * (o && l ? -1 : 1);
334
+ h[s] += m * (n && l ? -1 : 1);
335
335
  break;
336
336
  }
337
337
  return h;
338
338
  }
339
- const Re = async (t, e, o) => {
339
+ const De = async (t, e, n) => {
340
340
  const {
341
- placement: n = "bottom",
341
+ placement: o = "bottom",
342
342
  strategy: i = "absolute",
343
343
  middleware: r = [],
344
344
  platform: s
345
- } = o, c = r.filter(Boolean), a = await (s.isRTL == null ? void 0 : s.isRTL(e));
345
+ } = n, c = r.filter(Boolean), a = await (s.isRTL == null ? void 0 : s.isRTL(e));
346
346
  let l = await s.getElementRects({
347
347
  reference: t,
348
348
  floating: e,
@@ -350,20 +350,20 @@ const Re = async (t, e, o) => {
350
350
  }), {
351
351
  x: u,
352
352
  y: f
353
- } = vt(l, n, a), m = n, h = {}, p = 0;
353
+ } = Et(l, o, a), m = o, h = {}, p = 0;
354
354
  for (let g = 0; g < c.length; g++) {
355
355
  const {
356
356
  name: w,
357
357
  fn: d
358
358
  } = c[g], {
359
359
  x: y,
360
- y: x,
360
+ y: v,
361
361
  data: b,
362
- reset: v
362
+ reset: x
363
363
  } = await d({
364
364
  x: u,
365
365
  y: f,
366
- initialPlacement: n,
366
+ initialPlacement: o,
367
367
  placement: m,
368
368
  strategy: i,
369
369
  middlewareData: h,
@@ -374,20 +374,20 @@ const Re = async (t, e, o) => {
374
374
  floating: e
375
375
  }
376
376
  });
377
- u = y ?? u, f = x ?? f, h = {
377
+ u = y ?? u, f = v ?? f, h = {
378
378
  ...h,
379
379
  [w]: {
380
380
  ...h[w],
381
381
  ...b
382
382
  }
383
- }, v && p <= 50 && (p++, typeof v == "object" && (v.placement && (m = v.placement), v.rects && (l = v.rects === !0 ? await s.getElementRects({
383
+ }, x && p <= 50 && (p++, typeof x == "object" && (x.placement && (m = x.placement), x.rects && (l = x.rects === !0 ? await s.getElementRects({
384
384
  reference: t,
385
385
  floating: e,
386
386
  strategy: i
387
- }) : v.rects), {
387
+ }) : x.rects), {
388
388
  x: u,
389
389
  y: f
390
- } = vt(l, m, a)), g = -1);
390
+ } = Et(l, m, a)), g = -1);
391
391
  }
392
392
  return {
393
393
  x: u,
@@ -397,11 +397,11 @@ const Re = async (t, e, o) => {
397
397
  middlewareData: h
398
398
  };
399
399
  };
400
- async function _t(t, e) {
401
- var o;
400
+ async function qt(t, e) {
401
+ var n;
402
402
  e === void 0 && (e = {});
403
403
  const {
404
- x: n,
404
+ x: o,
405
405
  y: i,
406
406
  platform: r,
407
407
  rects: s,
@@ -413,41 +413,41 @@ async function _t(t, e) {
413
413
  elementContext: f = "floating",
414
414
  altBoundary: m = !1,
415
415
  padding: h = 0
416
- } = it(e, t), p = Ee(h), w = c[m ? f === "floating" ? "reference" : "floating" : f], d = et(await r.getClippingRect({
417
- element: (o = await (r.isElement == null ? void 0 : r.isElement(w))) == null || o ? w : w.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(c.floating)),
416
+ } = st(e, t), p = Pe(h), w = c[m ? f === "floating" ? "reference" : "floating" : f], d = nt(await r.getClippingRect({
417
+ element: (n = await (r.isElement == null ? void 0 : r.isElement(w))) == null || n ? w : w.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(c.floating)),
418
418
  boundary: l,
419
419
  rootBoundary: u,
420
420
  strategy: a
421
421
  })), y = f === "floating" ? {
422
- x: n,
422
+ x: o,
423
423
  y: i,
424
424
  width: s.floating.width,
425
425
  height: s.floating.height
426
- } : s.reference, x = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(c.floating)), b = await (r.isElement == null ? void 0 : r.isElement(x)) ? await (r.getScale == null ? void 0 : r.getScale(x)) || {
426
+ } : s.reference, v = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(c.floating)), b = await (r.isElement == null ? void 0 : r.isElement(v)) ? await (r.getScale == null ? void 0 : r.getScale(v)) || {
427
427
  x: 1,
428
428
  y: 1
429
429
  } : {
430
430
  x: 1,
431
431
  y: 1
432
- }, v = et(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
432
+ }, x = nt(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
433
433
  elements: c,
434
434
  rect: y,
435
- offsetParent: x,
435
+ offsetParent: v,
436
436
  strategy: a
437
437
  }) : y);
438
438
  return {
439
- top: (d.top - v.top + p.top) / b.y,
440
- bottom: (v.bottom - d.bottom + p.bottom) / b.y,
441
- left: (d.left - v.left + p.left) / b.x,
442
- right: (v.right - d.right + p.right) / b.x
439
+ top: (d.top - x.top + p.top) / b.y,
440
+ bottom: (x.bottom - d.bottom + p.bottom) / b.y,
441
+ left: (d.left - x.left + p.left) / b.x,
442
+ right: (x.right - d.right + p.right) / b.x
443
443
  };
444
444
  }
445
- const Le = function(t) {
445
+ const We = function(t) {
446
446
  return t === void 0 && (t = {}), {
447
447
  name: "flip",
448
448
  options: t,
449
449
  async fn(e) {
450
- var o, n;
450
+ var n, o;
451
451
  const {
452
452
  placement: i,
453
453
  middlewareData: r,
@@ -463,58 +463,58 @@ const Le = function(t) {
463
463
  fallbackAxisSideDirection: p = "none",
464
464
  flipAlignment: g = !0,
465
465
  ...w
466
- } = it(t, e);
467
- if ((o = r.arrow) != null && o.alignmentOffset)
466
+ } = st(t, e);
467
+ if ((n = r.arrow) != null && n.alignmentOffset)
468
468
  return {};
469
- const d = M(i), y = $(c), x = M(c) === c, b = await (a.isRTL == null ? void 0 : a.isRTL(l.floating)), v = m || (x || !g ? [tt(c)] : xe(c)), D = p !== "none";
470
- !m && D && v.push(...be(c, g, p, b));
471
- const Kt = [c, ...v], lt = await _t(e, w), K = [];
472
- let B = ((n = r.flip) == null ? void 0 : n.overflows) || [];
473
- if (u && K.push(lt[d]), f) {
474
- const P = ye(i, s, b);
475
- K.push(lt[P[0]], lt[P[1]]);
469
+ const d = M(i), y = z(c), v = M(c) === c, b = await (a.isRTL == null ? void 0 : a.isRTL(l.floating)), x = m || (v || !g ? [et(c)] : Se(c)), N = p !== "none";
470
+ !m && N && x.push(...ke(c, g, p, b));
471
+ const ne = [c, ...x], ut = await qt(e, w), J = [];
472
+ let _ = ((o = r.flip) == null ? void 0 : o.overflows) || [];
473
+ if (u && J.push(ut[d]), f) {
474
+ const D = Oe(i, s, b);
475
+ J.push(ut[D[0]], ut[D[1]]);
476
476
  }
477
- if (B = [...B, {
477
+ if (_ = [..._, {
478
478
  placement: i,
479
- overflows: K
480
- }], !K.every((P) => P <= 0)) {
481
- var pt, gt;
482
- const P = (((pt = r.flip) == null ? void 0 : pt.index) || 0) + 1, yt = Kt[P];
483
- if (yt)
479
+ overflows: J
480
+ }], !J.every((D) => D <= 0)) {
481
+ var yt, vt;
482
+ const D = (((yt = r.flip) == null ? void 0 : yt.index) || 0) + 1, bt = ne[D];
483
+ if (bt)
484
484
  return {
485
485
  data: {
486
- index: P,
487
- overflows: B
486
+ index: D,
487
+ overflows: _
488
488
  },
489
489
  reset: {
490
- placement: yt
490
+ placement: bt
491
491
  }
492
492
  };
493
- let U = (gt = B.filter((N) => N.overflows[0] <= 0).sort((N, S) => N.overflows[1] - S.overflows[1])[0]) == null ? void 0 : gt.placement;
494
- if (!U)
493
+ let B = (vt = _.filter((V) => V.overflows[0] <= 0).sort((V, S) => V.overflows[1] - S.overflows[1])[0]) == null ? void 0 : vt.placement;
494
+ if (!B)
495
495
  switch (h) {
496
496
  case "bestFit": {
497
- var wt;
498
- const N = (wt = B.filter((S) => {
499
- if (D) {
500
- const T = $(S.placement);
497
+ var xt;
498
+ const V = (xt = _.filter((S) => {
499
+ if (N) {
500
+ const T = z(S.placement);
501
501
  return T === y || // Create a bias to the `y` side axis due to horizontal
502
502
  // reading directions favoring greater width.
503
503
  T === "y";
504
504
  }
505
505
  return !0;
506
- }).map((S) => [S.placement, S.overflows.filter((T) => T > 0).reduce((T, Jt) => T + Jt, 0)]).sort((S, T) => S[1] - T[1])[0]) == null ? void 0 : wt[0];
507
- N && (U = N);
506
+ }).map((S) => [S.placement, S.overflows.filter((T) => T > 0).reduce((T, oe) => T + oe, 0)]).sort((S, T) => S[1] - T[1])[0]) == null ? void 0 : xt[0];
507
+ V && (B = V);
508
508
  break;
509
509
  }
510
510
  case "initialPlacement":
511
- U = c;
511
+ B = c;
512
512
  break;
513
513
  }
514
- if (i !== U)
514
+ if (i !== B)
515
515
  return {
516
516
  reset: {
517
- placement: U
517
+ placement: B
518
518
  }
519
519
  };
520
520
  }
@@ -522,12 +522,12 @@ const Le = function(t) {
522
522
  }
523
523
  };
524
524
  };
525
- async function Oe(t, e) {
525
+ async function Me(t, e) {
526
526
  const {
527
- placement: o,
528
- platform: n,
527
+ placement: n,
528
+ platform: o,
529
529
  elements: i
530
- } = t, r = await (n.isRTL == null ? void 0 : n.isRTL(i.floating)), s = M(o), c = rt(o), a = $(o) === "y", l = ["left", "top"].includes(s) ? -1 : 1, u = r && a ? -1 : 1, f = it(e, t);
530
+ } = t, r = await (o.isRTL == null ? void 0 : o.isRTL(i.floating)), s = M(n), c = ct(n), a = z(n) === "y", l = ["left", "top"].includes(s) ? -1 : 1, u = r && a ? -1 : 1, f = st(e, t);
531
531
  let {
532
532
  mainAxis: m,
533
533
  crossAxis: h,
@@ -550,19 +550,19 @@ async function Oe(t, e) {
550
550
  y: h * u
551
551
  };
552
552
  }
553
- const Se = function(t) {
553
+ const Fe = function(t) {
554
554
  return t === void 0 && (t = 0), {
555
555
  name: "offset",
556
556
  options: t,
557
557
  async fn(e) {
558
- var o, n;
558
+ var n, o;
559
559
  const {
560
560
  x: i,
561
561
  y: r,
562
562
  placement: s,
563
563
  middlewareData: c
564
- } = e, a = await Oe(e, t);
565
- return s === ((o = c.offset) == null ? void 0 : o.placement) && (n = c.arrow) != null && n.alignmentOffset ? {} : {
564
+ } = e, a = await Me(e, t);
565
+ return s === ((n = c.offset) == null ? void 0 : n.placement) && (o = c.arrow) != null && o.alignmentOffset ? {} : {
566
566
  x: i + a.x,
567
567
  y: r + a.y,
568
568
  data: {
@@ -572,14 +572,14 @@ const Se = function(t) {
572
572
  };
573
573
  }
574
574
  };
575
- }, Te = function(t) {
575
+ }, Ne = function(t) {
576
576
  return t === void 0 && (t = {}), {
577
577
  name: "shift",
578
578
  options: t,
579
579
  async fn(e) {
580
580
  const {
581
- x: o,
582
- y: n,
581
+ x: n,
582
+ y: o,
583
583
  placement: i
584
584
  } = e, {
585
585
  mainAxis: r = !0,
@@ -597,18 +597,18 @@ const Se = function(t) {
597
597
  }
598
598
  },
599
599
  ...a
600
- } = it(t, e), l = {
601
- x: o,
602
- y: n
603
- }, u = await _t(e, a), f = $(M(i)), m = $t(f);
600
+ } = st(t, e), l = {
601
+ x: n,
602
+ y: o
603
+ }, u = await qt(e, a), f = z(M(i)), m = jt(f);
604
604
  let h = l[m], p = l[f];
605
605
  if (r) {
606
- const w = m === "y" ? "top" : "left", d = m === "y" ? "bottom" : "right", y = h + u[w], x = h - u[d];
607
- h = xt(y, h, x);
606
+ const w = m === "y" ? "top" : "left", d = m === "y" ? "bottom" : "right", y = h + u[w], v = h - u[d];
607
+ h = At(y, h, v);
608
608
  }
609
609
  if (s) {
610
- const w = f === "y" ? "top" : "left", d = f === "y" ? "bottom" : "right", y = p + u[w], x = p - u[d];
611
- p = xt(y, p, x);
610
+ const w = f === "y" ? "top" : "left", d = f === "y" ? "bottom" : "right", y = p + u[w], v = p - u[d];
611
+ p = At(y, p, v);
612
612
  }
613
613
  const g = c.fn({
614
614
  ...e,
@@ -618,15 +618,15 @@ const Se = function(t) {
618
618
  return {
619
619
  ...g,
620
620
  data: {
621
- x: g.x - o,
622
- y: g.y - n
621
+ x: g.x - n,
622
+ y: g.y - o
623
623
  }
624
624
  };
625
625
  }
626
626
  };
627
627
  };
628
- function _(t) {
629
- return Bt(t) ? (t.nodeName || "").toLowerCase() : "#document";
628
+ function U(t) {
629
+ return Kt(t) ? (t.nodeName || "").toLowerCase() : "#document";
630
630
  }
631
631
  function A(t) {
632
632
  var e;
@@ -634,9 +634,9 @@ function A(t) {
634
634
  }
635
635
  function O(t) {
636
636
  var e;
637
- return (e = (Bt(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
637
+ return (e = (Kt(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
638
638
  }
639
- function Bt(t) {
639
+ function Kt(t) {
640
640
  return t instanceof Node || t instanceof A(t).Node;
641
641
  }
642
642
  function R(t) {
@@ -645,22 +645,22 @@ function R(t) {
645
645
  function L(t) {
646
646
  return t instanceof HTMLElement || t instanceof A(t).HTMLElement;
647
647
  }
648
- function bt(t) {
648
+ function Rt(t) {
649
649
  return typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof A(t).ShadowRoot;
650
650
  }
651
- function Y(t) {
651
+ function K(t) {
652
652
  const {
653
653
  overflow: e,
654
- overflowX: o,
655
- overflowY: n,
654
+ overflowX: n,
655
+ overflowY: o,
656
656
  display: i
657
657
  } = E(t);
658
- return /auto|scroll|overlay|hidden|clip/.test(e + n + o) && !["inline", "contents"].includes(i);
658
+ return /auto|scroll|overlay|hidden|clip/.test(e + o + n) && !["inline", "contents"].includes(i);
659
659
  }
660
- function Ce(t) {
661
- return ["table", "td", "th"].includes(_(t));
660
+ function Ve(t) {
661
+ return ["table", "td", "th"].includes(U(t));
662
662
  }
663
- function st(t) {
663
+ function lt(t) {
664
664
  return [":popover-open", ":modal"].some((e) => {
665
665
  try {
666
666
  return t.matches(e);
@@ -669,31 +669,31 @@ function st(t) {
669
669
  }
670
670
  });
671
671
  }
672
- function ht(t) {
673
- const e = dt(), o = E(t);
674
- return o.transform !== "none" || o.perspective !== "none" || (o.containerType ? o.containerType !== "normal" : !1) || !e && (o.backdropFilter ? o.backdropFilter !== "none" : !1) || !e && (o.filter ? o.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((n) => (o.willChange || "").includes(n)) || ["paint", "layout", "strict", "content"].some((n) => (o.contain || "").includes(n));
672
+ function pt(t) {
673
+ const e = gt(), n = E(t);
674
+ 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));
675
675
  }
676
- function ke(t) {
677
- let e = k(t);
678
- for (; L(e) && !z(e); ) {
679
- if (st(e))
676
+ function $e(t) {
677
+ let e = P(t);
678
+ for (; L(e) && !H(e); ) {
679
+ if (lt(e))
680
680
  return null;
681
- if (ht(e))
681
+ if (pt(e))
682
682
  return e;
683
- e = k(e);
683
+ e = P(e);
684
684
  }
685
685
  return null;
686
686
  }
687
- function dt() {
687
+ function gt() {
688
688
  return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
689
689
  }
690
- function z(t) {
691
- return ["html", "body", "#document"].includes(_(t));
690
+ function H(t) {
691
+ return ["html", "body", "#document"].includes(U(t));
692
692
  }
693
693
  function E(t) {
694
694
  return A(t).getComputedStyle(t);
695
695
  }
696
- function ct(t) {
696
+ function at(t) {
697
697
  return R(t) ? {
698
698
  scrollLeft: t.scrollLeft,
699
699
  scrollTop: t.scrollTop
@@ -702,138 +702,138 @@ function ct(t) {
702
702
  scrollTop: t.scrollY
703
703
  };
704
704
  }
705
- function k(t) {
706
- if (_(t) === "html")
705
+ function P(t) {
706
+ if (U(t) === "html")
707
707
  return t;
708
708
  const e = (
709
709
  // Step into the shadow DOM of the parent of a slotted node.
710
710
  t.assignedSlot || // DOM Element detected.
711
711
  t.parentNode || // ShadowRoot detected.
712
- bt(t) && t.host || // Fallback.
712
+ Rt(t) && t.host || // Fallback.
713
713
  O(t)
714
714
  );
715
- return bt(e) ? e.host : e;
715
+ return Rt(e) ? e.host : e;
716
716
  }
717
- function Ut(t) {
718
- const e = k(t);
719
- return z(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : L(e) && Y(e) ? e : Ut(e);
717
+ function Jt(t) {
718
+ const e = P(t);
719
+ return H(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : L(e) && K(e) ? e : Jt(e);
720
720
  }
721
- function j(t, e, o) {
722
- var n;
723
- e === void 0 && (e = []), o === void 0 && (o = !0);
724
- const i = Ut(t), r = i === ((n = t.ownerDocument) == null ? void 0 : n.body), s = A(i);
725
- return r ? e.concat(s, s.visualViewport || [], Y(i) ? i : [], s.frameElement && o ? j(s.frameElement) : []) : e.concat(i, j(i, [], o));
721
+ function j(t, e, n) {
722
+ var o;
723
+ e === void 0 && (e = []), n === void 0 && (n = !0);
724
+ const i = Jt(t), r = i === ((o = t.ownerDocument) == null ? void 0 : o.body), s = A(i);
725
+ return r ? e.concat(s, s.visualViewport || [], K(i) ? i : [], s.frameElement && n ? j(s.frameElement) : []) : e.concat(i, j(i, [], n));
726
726
  }
727
- function It(t) {
727
+ function Gt(t) {
728
728
  const e = E(t);
729
- let o = parseFloat(e.width) || 0, n = parseFloat(e.height) || 0;
730
- const i = L(t), r = i ? t.offsetWidth : o, s = i ? t.offsetHeight : n, c = Z(o) !== r || Z(n) !== s;
731
- return c && (o = r, n = s), {
732
- width: o,
733
- height: n,
729
+ let n = parseFloat(e.width) || 0, o = parseFloat(e.height) || 0;
730
+ const i = L(t), r = i ? t.offsetWidth : n, s = i ? t.offsetHeight : o, c = tt(n) !== r || tt(o) !== s;
731
+ return c && (n = r, o = s), {
732
+ width: n,
733
+ height: o,
734
734
  $: c
735
735
  };
736
736
  }
737
- function mt(t) {
737
+ function wt(t) {
738
738
  return R(t) ? t : t.contextElement;
739
739
  }
740
- function V(t) {
741
- const e = mt(t);
740
+ function $(t) {
741
+ const e = wt(t);
742
742
  if (!L(e))
743
743
  return C(1);
744
- const o = e.getBoundingClientRect(), {
745
- width: n,
744
+ const n = e.getBoundingClientRect(), {
745
+ width: o,
746
746
  height: i,
747
747
  $: r
748
- } = It(e);
749
- let s = (r ? Z(o.width) : o.width) / n, c = (r ? Z(o.height) : o.height) / i;
748
+ } = Gt(e);
749
+ let s = (r ? tt(n.width) : n.width) / o, c = (r ? tt(n.height) : n.height) / i;
750
750
  return (!s || !Number.isFinite(s)) && (s = 1), (!c || !Number.isFinite(c)) && (c = 1), {
751
751
  x: s,
752
752
  y: c
753
753
  };
754
754
  }
755
- const Pe = /* @__PURE__ */ C(0);
756
- function jt(t) {
755
+ const ze = /* @__PURE__ */ C(0);
756
+ function Qt(t) {
757
757
  const e = A(t);
758
- return !dt() || !e.visualViewport ? Pe : {
758
+ return !gt() || !e.visualViewport ? ze : {
759
759
  x: e.visualViewport.offsetLeft,
760
760
  y: e.visualViewport.offsetTop
761
761
  };
762
762
  }
763
- function We(t, e, o) {
764
- return e === void 0 && (e = !1), !o || e && o !== A(t) ? !1 : e;
763
+ function He(t, e, n) {
764
+ return e === void 0 && (e = !1), !n || e && n !== A(t) ? !1 : e;
765
765
  }
766
- function F(t, e, o, n) {
767
- e === void 0 && (e = !1), o === void 0 && (o = !1);
768
- const i = t.getBoundingClientRect(), r = mt(t);
766
+ function F(t, e, n, o) {
767
+ e === void 0 && (e = !1), n === void 0 && (n = !1);
768
+ const i = t.getBoundingClientRect(), r = wt(t);
769
769
  let s = C(1);
770
- e && (n ? R(n) && (s = V(n)) : s = V(t));
771
- const c = We(r, o, n) ? jt(r) : C(0);
770
+ e && (o ? R(o) && (s = $(o)) : s = $(t));
771
+ const c = He(r, n, o) ? Qt(r) : C(0);
772
772
  let a = (i.left + c.x) / s.x, l = (i.top + c.y) / s.y, u = i.width / s.x, f = i.height / s.y;
773
773
  if (r) {
774
- const m = A(r), h = n && R(n) ? A(n) : n;
774
+ const m = A(r), h = o && R(o) ? A(o) : o;
775
775
  let p = m, g = p.frameElement;
776
- for (; g && n && h !== p; ) {
777
- const w = V(g), d = g.getBoundingClientRect(), y = E(g), x = d.left + (g.clientLeft + parseFloat(y.paddingLeft)) * w.x, b = d.top + (g.clientTop + parseFloat(y.paddingTop)) * w.y;
778
- a *= w.x, l *= w.y, u *= w.x, f *= w.y, a += x, l += b, p = A(g), g = p.frameElement;
776
+ for (; g && o && h !== p; ) {
777
+ const w = $(g), d = g.getBoundingClientRect(), y = E(g), v = d.left + (g.clientLeft + parseFloat(y.paddingLeft)) * w.x, b = d.top + (g.clientTop + parseFloat(y.paddingTop)) * w.y;
778
+ a *= w.x, l *= w.y, u *= w.x, f *= w.y, a += v, l += b, p = A(g), g = p.frameElement;
779
779
  }
780
780
  }
781
- return et({
781
+ return nt({
782
782
  width: u,
783
783
  height: f,
784
784
  x: a,
785
785
  y: l
786
786
  });
787
787
  }
788
- function Me(t) {
788
+ function Ue(t) {
789
789
  let {
790
790
  elements: e,
791
- rect: o,
792
- offsetParent: n,
791
+ rect: n,
792
+ offsetParent: o,
793
793
  strategy: i
794
794
  } = t;
795
- const r = i === "fixed", s = O(n), c = e ? st(e.floating) : !1;
796
- if (n === s || c && r)
797
- return o;
795
+ const r = i === "fixed", s = O(o), c = e ? lt(e.floating) : !1;
796
+ if (o === s || c && r)
797
+ return n;
798
798
  let a = {
799
799
  scrollLeft: 0,
800
800
  scrollTop: 0
801
801
  }, l = C(1);
802
- const u = C(0), f = L(n);
803
- if ((f || !f && !r) && ((_(n) !== "body" || Y(s)) && (a = ct(n)), L(n))) {
804
- const m = F(n);
805
- l = V(n), u.x = m.x + n.clientLeft, u.y = m.y + n.clientTop;
802
+ const u = C(0), f = L(o);
803
+ if ((f || !f && !r) && ((U(o) !== "body" || K(s)) && (a = at(o)), L(o))) {
804
+ const m = F(o);
805
+ l = $(o), u.x = m.x + o.clientLeft, u.y = m.y + o.clientTop;
806
806
  }
807
807
  return {
808
- width: o.width * l.x,
809
- height: o.height * l.y,
810
- x: o.x * l.x - a.scrollLeft * l.x + u.x,
811
- y: o.y * l.y - a.scrollTop * l.y + u.y
808
+ width: n.width * l.x,
809
+ height: n.height * l.y,
810
+ x: n.x * l.x - a.scrollLeft * l.x + u.x,
811
+ y: n.y * l.y - a.scrollTop * l.y + u.y
812
812
  };
813
813
  }
814
- function Fe(t) {
814
+ function _e(t) {
815
815
  return Array.from(t.getClientRects());
816
816
  }
817
- function Xt(t) {
818
- return F(O(t)).left + ct(t).scrollLeft;
817
+ function Zt(t) {
818
+ return F(O(t)).left + at(t).scrollLeft;
819
819
  }
820
- function De(t) {
821
- const e = O(t), o = ct(t), n = t.ownerDocument.body, i = W(e.scrollWidth, e.clientWidth, n.scrollWidth, n.clientWidth), r = W(e.scrollHeight, e.clientHeight, n.scrollHeight, n.clientHeight);
822
- let s = -o.scrollLeft + Xt(t);
823
- const c = -o.scrollTop;
824
- return E(n).direction === "rtl" && (s += W(e.clientWidth, n.clientWidth) - i), {
820
+ function Be(t) {
821
+ const e = O(t), n = at(t), o = t.ownerDocument.body, i = W(e.scrollWidth, e.clientWidth, o.scrollWidth, o.clientWidth), r = W(e.scrollHeight, e.clientHeight, o.scrollHeight, o.clientHeight);
822
+ let s = -n.scrollLeft + Zt(t);
823
+ const c = -n.scrollTop;
824
+ return E(o).direction === "rtl" && (s += W(e.clientWidth, o.clientWidth) - i), {
825
825
  width: i,
826
826
  height: r,
827
827
  x: s,
828
828
  y: c
829
829
  };
830
830
  }
831
- function Ne(t, e) {
832
- const o = A(t), n = O(t), i = o.visualViewport;
833
- let r = n.clientWidth, s = n.clientHeight, c = 0, a = 0;
831
+ function Ie(t, e) {
832
+ const n = A(t), o = O(t), i = n.visualViewport;
833
+ let r = o.clientWidth, s = o.clientHeight, c = 0, a = 0;
834
834
  if (i) {
835
835
  r = i.width, s = i.height;
836
- const l = dt();
836
+ const l = gt();
837
837
  (!l || l && e === "fixed") && (c = i.offsetLeft, a = i.offsetTop);
838
838
  }
839
839
  return {
@@ -843,8 +843,8 @@ function Ne(t, e) {
843
843
  y: a
844
844
  };
845
845
  }
846
- function Ve(t, e) {
847
- const o = F(t, !0, e === "fixed"), n = o.top + t.clientTop, i = o.left + t.clientLeft, r = L(t) ? V(t) : C(1), s = t.clientWidth * r.x, c = t.clientHeight * r.y, a = i * r.x, l = n * r.y;
846
+ function je(t, e) {
847
+ const n = F(t, !0, e === "fixed"), o = n.top + t.clientTop, i = n.left + t.clientLeft, r = L(t) ? $(t) : C(1), s = t.clientWidth * r.x, c = t.clientHeight * r.y, a = i * r.x, l = o * r.y;
848
848
  return {
849
849
  width: s,
850
850
  height: c,
@@ -852,52 +852,52 @@ function Ve(t, e) {
852
852
  y: l
853
853
  };
854
854
  }
855
- function At(t, e, o) {
856
- let n;
855
+ function Lt(t, e, n) {
856
+ let o;
857
857
  if (e === "viewport")
858
- n = Ne(t, o);
858
+ o = Ie(t, n);
859
859
  else if (e === "document")
860
- n = De(O(t));
860
+ o = Be(O(t));
861
861
  else if (R(e))
862
- n = Ve(e, o);
862
+ o = je(e, n);
863
863
  else {
864
- const i = jt(t);
865
- n = {
864
+ const i = Qt(t);
865
+ o = {
866
866
  ...e,
867
867
  x: e.x - i.x,
868
868
  y: e.y - i.y
869
869
  };
870
870
  }
871
- return et(n);
871
+ return nt(o);
872
872
  }
873
- function qt(t, e) {
874
- const o = k(t);
875
- return o === e || !R(o) || z(o) ? !1 : E(o).position === "fixed" || qt(o, e);
873
+ function te(t, e) {
874
+ const n = P(t);
875
+ return n === e || !R(n) || H(n) ? !1 : E(n).position === "fixed" || te(n, e);
876
876
  }
877
- function $e(t, e) {
878
- const o = e.get(t);
879
- if (o)
880
- return o;
881
- let n = j(t, [], !1).filter((c) => R(c) && _(c) !== "body"), i = null;
877
+ function Ye(t, e) {
878
+ const n = e.get(t);
879
+ if (n)
880
+ return n;
881
+ let o = j(t, [], !1).filter((c) => R(c) && U(c) !== "body"), i = null;
882
882
  const r = E(t).position === "fixed";
883
- let s = r ? k(t) : t;
884
- for (; R(s) && !z(s); ) {
885
- const c = E(s), a = ht(s);
886
- !a && c.position === "fixed" && (i = null), (r ? !a && !i : !a && c.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) || Y(s) && !a && qt(t, s)) ? n = n.filter((u) => u !== s) : i = c, s = k(s);
883
+ let s = r ? P(t) : t;
884
+ for (; R(s) && !H(s); ) {
885
+ const c = E(s), a = pt(s);
886
+ !a && c.position === "fixed" && (i = null), (r ? !a && !i : !a && c.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) || K(s) && !a && te(t, s)) ? o = o.filter((u) => u !== s) : i = c, s = P(s);
887
887
  }
888
- return e.set(t, n), n;
888
+ return e.set(t, o), o;
889
889
  }
890
- function ze(t) {
890
+ function Xe(t) {
891
891
  let {
892
892
  element: e,
893
- boundary: o,
894
- rootBoundary: n,
893
+ boundary: n,
894
+ rootBoundary: o,
895
895
  strategy: i
896
896
  } = t;
897
- const s = [...o === "clippingAncestors" ? st(e) ? [] : $e(e, this._c) : [].concat(o), n], c = s[0], a = s.reduce((l, u) => {
898
- const f = At(e, u, i);
899
- return l.top = W(f.top, l.top), l.right = Q(f.right, l.right), l.bottom = Q(f.bottom, l.bottom), l.left = W(f.left, l.left), l;
900
- }, At(e, c, i));
897
+ const s = [...n === "clippingAncestors" ? lt(e) ? [] : Ye(e, this._c) : [].concat(n), o], c = s[0], a = s.reduce((l, u) => {
898
+ const f = Lt(e, u, i);
899
+ return l.top = W(f.top, l.top), l.right = Z(f.right, l.right), l.bottom = Z(f.bottom, l.bottom), l.left = W(f.left, l.left), l;
900
+ }, Lt(e, c, i));
901
901
  return {
902
902
  width: a.right - a.left,
903
903
  height: a.bottom - a.top,
@@ -905,28 +905,28 @@ function ze(t) {
905
905
  y: a.top
906
906
  };
907
907
  }
908
- function He(t) {
908
+ function qe(t) {
909
909
  const {
910
910
  width: e,
911
- height: o
912
- } = It(t);
911
+ height: n
912
+ } = Gt(t);
913
913
  return {
914
914
  width: e,
915
- height: o
915
+ height: n
916
916
  };
917
917
  }
918
- function _e(t, e, o) {
919
- const n = L(e), i = O(e), r = o === "fixed", s = F(t, !0, r, e);
918
+ function Ke(t, e, n) {
919
+ const o = L(e), i = O(e), r = n === "fixed", s = F(t, !0, r, e);
920
920
  let c = {
921
921
  scrollLeft: 0,
922
922
  scrollTop: 0
923
923
  };
924
924
  const a = C(0);
925
- if (n || !n && !r)
926
- if ((_(e) !== "body" || Y(i)) && (c = ct(e)), n) {
925
+ if (o || !o && !r)
926
+ if ((U(e) !== "body" || K(i)) && (c = at(e)), o) {
927
927
  const f = F(e, !0, r, e);
928
928
  a.x = f.x + e.clientLeft, a.y = f.y + e.clientTop;
929
- } else i && (a.x = Xt(i));
929
+ } else i && (a.x = Zt(i));
930
930
  const l = s.left + c.scrollLeft - a.x, u = s.top + c.scrollTop - a.y;
931
931
  return {
932
932
  x: l,
@@ -935,63 +935,63 @@ function _e(t, e, o) {
935
935
  height: s.height
936
936
  };
937
937
  }
938
- function at(t) {
938
+ function ft(t) {
939
939
  return E(t).position === "static";
940
940
  }
941
- function Et(t, e) {
941
+ function Ot(t, e) {
942
942
  return !L(t) || E(t).position === "fixed" ? null : e ? e(t) : t.offsetParent;
943
943
  }
944
- function Yt(t, e) {
945
- const o = A(t);
946
- if (st(t))
947
- return o;
944
+ function ee(t, e) {
945
+ const n = A(t);
946
+ if (lt(t))
947
+ return n;
948
948
  if (!L(t)) {
949
- let i = k(t);
950
- for (; i && !z(i); ) {
951
- if (R(i) && !at(i))
949
+ let i = P(t);
950
+ for (; i && !H(i); ) {
951
+ if (R(i) && !ft(i))
952
952
  return i;
953
- i = k(i);
953
+ i = P(i);
954
954
  }
955
- return o;
955
+ return n;
956
956
  }
957
- let n = Et(t, e);
958
- for (; n && Ce(n) && at(n); )
959
- n = Et(n, e);
960
- return n && z(n) && at(n) && !ht(n) ? o : n || ke(t) || o;
957
+ let o = Ot(t, e);
958
+ for (; o && Ve(o) && ft(o); )
959
+ o = Ot(o, e);
960
+ return o && H(o) && ft(o) && !pt(o) ? n : o || $e(t) || n;
961
961
  }
962
- const Be = async function(t) {
963
- const e = this.getOffsetParent || Yt, o = this.getDimensions, n = await o(t.floating);
962
+ const Je = async function(t) {
963
+ const e = this.getOffsetParent || ee, n = this.getDimensions, o = await n(t.floating);
964
964
  return {
965
- reference: _e(t.reference, await e(t.floating), t.strategy),
965
+ reference: Ke(t.reference, await e(t.floating), t.strategy),
966
966
  floating: {
967
967
  x: 0,
968
968
  y: 0,
969
- width: n.width,
970
- height: n.height
969
+ width: o.width,
970
+ height: o.height
971
971
  }
972
972
  };
973
973
  };
974
- function Ue(t) {
974
+ function Ge(t) {
975
975
  return E(t).direction === "rtl";
976
976
  }
977
- const Ie = {
978
- convertOffsetParentRelativeRectToViewportRelativeRect: Me,
977
+ const Qe = {
978
+ convertOffsetParentRelativeRectToViewportRelativeRect: Ue,
979
979
  getDocumentElement: O,
980
- getClippingRect: ze,
981
- getOffsetParent: Yt,
982
- getElementRects: Be,
983
- getClientRects: Fe,
984
- getDimensions: He,
985
- getScale: V,
980
+ getClippingRect: Xe,
981
+ getOffsetParent: ee,
982
+ getElementRects: Je,
983
+ getClientRects: _e,
984
+ getDimensions: qe,
985
+ getScale: $,
986
986
  isElement: R,
987
- isRTL: Ue
987
+ isRTL: Ge
988
988
  };
989
- function je(t, e) {
990
- let o = null, n;
989
+ function Ze(t, e) {
990
+ let n = null, o;
991
991
  const i = O(t);
992
992
  function r() {
993
993
  var c;
994
- clearTimeout(n), (c = o) == null || c.disconnect(), o = null;
994
+ clearTimeout(o), (c = n) == null || c.disconnect(), n = null;
995
995
  }
996
996
  function s(c, a) {
997
997
  c === void 0 && (c = !1), a === void 0 && (a = 1), r();
@@ -1003,106 +1003,106 @@ function je(t, e) {
1003
1003
  } = t.getBoundingClientRect();
1004
1004
  if (c || e(), !f || !m)
1005
1005
  return;
1006
- const h = J(u), p = J(i.clientWidth - (l + f)), g = J(i.clientHeight - (u + m)), w = J(l), y = {
1006
+ const h = G(u), p = G(i.clientWidth - (l + f)), g = G(i.clientHeight - (u + m)), w = G(l), y = {
1007
1007
  rootMargin: -h + "px " + -p + "px " + -g + "px " + -w + "px",
1008
- threshold: W(0, Q(1, a)) || 1
1008
+ threshold: W(0, Z(1, a)) || 1
1009
1009
  };
1010
- let x = !0;
1011
- function b(v) {
1012
- const D = v[0].intersectionRatio;
1013
- if (D !== a) {
1014
- if (!x)
1010
+ let v = !0;
1011
+ function b(x) {
1012
+ const N = x[0].intersectionRatio;
1013
+ if (N !== a) {
1014
+ if (!v)
1015
1015
  return s();
1016
- D ? s(!1, D) : n = setTimeout(() => {
1016
+ N ? s(!1, N) : o = setTimeout(() => {
1017
1017
  s(!1, 1e-7);
1018
1018
  }, 1e3);
1019
1019
  }
1020
- x = !1;
1020
+ v = !1;
1021
1021
  }
1022
1022
  try {
1023
- o = new IntersectionObserver(b, {
1023
+ n = new IntersectionObserver(b, {
1024
1024
  ...y,
1025
1025
  // Handle <iframe>s
1026
1026
  root: i.ownerDocument
1027
1027
  });
1028
1028
  } catch {
1029
- o = new IntersectionObserver(b, y);
1029
+ n = new IntersectionObserver(b, y);
1030
1030
  }
1031
- o.observe(t);
1031
+ n.observe(t);
1032
1032
  }
1033
1033
  return s(!0), r;
1034
1034
  }
1035
- function Xe(t, e, o, n) {
1036
- n === void 0 && (n = {});
1035
+ function tn(t, e, n, o) {
1036
+ o === void 0 && (o = {});
1037
1037
  const {
1038
1038
  ancestorScroll: i = !0,
1039
1039
  ancestorResize: r = !0,
1040
1040
  elementResize: s = typeof ResizeObserver == "function",
1041
1041
  layoutShift: c = typeof IntersectionObserver == "function",
1042
1042
  animationFrame: a = !1
1043
- } = n, l = mt(t), u = i || r ? [...l ? j(l) : [], ...j(e)] : [];
1043
+ } = o, l = wt(t), u = i || r ? [...l ? j(l) : [], ...j(e)] : [];
1044
1044
  u.forEach((d) => {
1045
- i && d.addEventListener("scroll", o, {
1045
+ i && d.addEventListener("scroll", n, {
1046
1046
  passive: !0
1047
- }), r && d.addEventListener("resize", o);
1047
+ }), r && d.addEventListener("resize", n);
1048
1048
  });
1049
- const f = l && c ? je(l, o) : null;
1049
+ const f = l && c ? Ze(l, n) : null;
1050
1050
  let m = -1, h = null;
1051
1051
  s && (h = new ResizeObserver((d) => {
1052
1052
  let [y] = d;
1053
1053
  y && y.target === l && h && (h.unobserve(e), cancelAnimationFrame(m), m = requestAnimationFrame(() => {
1054
- var x;
1055
- (x = h) == null || x.observe(e);
1056
- })), o();
1054
+ var v;
1055
+ (v = h) == null || v.observe(e);
1056
+ })), n();
1057
1057
  }), l && !a && h.observe(l), h.observe(e));
1058
1058
  let p, g = a ? F(t) : null;
1059
1059
  a && w();
1060
1060
  function w() {
1061
1061
  const d = F(t);
1062
- g && (d.x !== g.x || d.y !== g.y || d.width !== g.width || d.height !== g.height) && o(), g = d, p = requestAnimationFrame(w);
1062
+ g && (d.x !== g.x || d.y !== g.y || d.width !== g.width || d.height !== g.height) && n(), g = d, p = requestAnimationFrame(w);
1063
1063
  }
1064
- return o(), () => {
1064
+ return n(), () => {
1065
1065
  var d;
1066
1066
  u.forEach((y) => {
1067
- i && y.removeEventListener("scroll", o), r && y.removeEventListener("resize", o);
1067
+ i && y.removeEventListener("scroll", n), r && y.removeEventListener("resize", n);
1068
1068
  }), f == null || f(), (d = h) == null || d.disconnect(), h = null, a && cancelAnimationFrame(p);
1069
1069
  };
1070
1070
  }
1071
- const qe = Se, Ye = Te, Rt = Le, Ke = (t, e, o) => {
1072
- const n = /* @__PURE__ */ new Map(), i = {
1073
- platform: Ie,
1074
- ...o
1071
+ const en = Fe, nn = Ne, St = We, on = (t, e, n) => {
1072
+ const o = /* @__PURE__ */ new Map(), i = {
1073
+ platform: Qe,
1074
+ ...n
1075
1075
  }, r = {
1076
1076
  ...i.platform,
1077
- _c: n
1077
+ _c: o
1078
1078
  };
1079
- return Re(t, e, {
1079
+ return De(t, e, {
1080
1080
  ...i,
1081
1081
  platform: r
1082
1082
  });
1083
- }, un = ({
1083
+ }, bn = ({
1084
1084
  content: t,
1085
1085
  open: e,
1086
- placement: o,
1087
- offset: { mainAxis: n, crossAxis: i } = { mainAxis: 0, crossAxis: 0 }
1086
+ placement: n,
1087
+ offset: { mainAxis: o, crossAxis: i } = { mainAxis: 0, crossAxis: 0 }
1088
1088
  }) => (r) => {
1089
- const s = r.element, c = ot.toSignal(e);
1090
- return Ft(
1089
+ const s = r.element, c = rt.toSignal(e);
1090
+ return Ut(
1091
1091
  c,
1092
- Wt(
1092
+ zt(
1093
1093
  "body",
1094
- Tt.div(
1095
- Mt((a) => {
1094
+ Ft.div(
1095
+ Ht((a) => {
1096
1096
  const l = a;
1097
- return l.style.position = "absolute", Xe(s, l, () => {
1098
- Ke(s, l, {
1099
- placement: o,
1097
+ return l.style.position = "absolute", tn(s, l, () => {
1098
+ on(s, l, {
1099
+ placement: n,
1100
1100
  strategy: "absolute",
1101
1101
  middleware: [
1102
- Rt(),
1103
- qe({ mainAxis: n, crossAxis: i }),
1104
- Ye(),
1105
- Rt()
1102
+ St(),
1103
+ en({ mainAxis: o, crossAxis: i }),
1104
+ nn(),
1105
+ St()
1106
1106
  ]
1107
1107
  }).then(({ x: u, y: f }) => {
1108
1108
  l.style.top = `${f}px`, l.style.left = `${u}px`;
@@ -1113,73 +1113,73 @@ const qe = Se, Ye = Te, Rt = Le, Ke = (t, e, o) => {
1113
1113
  )
1114
1114
  )
1115
1115
  )(r);
1116
- }, Je = (t, e) => {
1116
+ }, rn = (t, e) => {
1117
1117
  if (typeof e == "function")
1118
- return Je(t, { success: e });
1119
- const o = e.failure ?? ((i) => X(
1118
+ return rn(t, { success: e });
1119
+ const n = e.failure ?? ((i) => X(
1120
1120
  q(i.on(console.error)),
1121
1121
  i.map((r) => `Error: ${r}`)
1122
- )), n = e.success;
1123
- return Pt(ot.toSignal(t), {
1124
- Success: (i) => n(i.$.value),
1125
- Failure: (i) => o(i.$.error)
1122
+ )), o = e.success;
1123
+ return $t(rt.toSignal(t), {
1124
+ Success: (i) => o(i.$.value),
1125
+ Failure: (i) => n(i.$.error)
1126
1126
  });
1127
- }, fn = () => Ct.focus((t) => {
1127
+ }, An = () => Nt.focus((t) => {
1128
1128
  var e;
1129
1129
  return (e = t.target) == null ? void 0 : e.select();
1130
- }), hn = (t) => (e) => {
1131
- const o = e.element, n = H({ width: o.clientWidth, height: o.clientHeight }), i = nt(t(n))(e), r = () => {
1132
- n.set({ width: o.clientWidth, height: o.clientHeight });
1130
+ }), En = (t) => (e) => {
1131
+ const n = e.element, o = k({ width: n.clientWidth, height: n.clientHeight }), i = it(t(o))(e), r = () => {
1132
+ o.set({ width: n.clientWidth, height: n.clientHeight });
1133
1133
  };
1134
1134
  let s;
1135
- return typeof ResizeObserver == "function" && (s = new ResizeObserver(r), s.observe(o)), (c) => {
1135
+ return typeof ResizeObserver == "function" && (s = new ResizeObserver(r), s.observe(n)), (c) => {
1136
1136
  s == null || s.disconnect(), i(c);
1137
1137
  };
1138
- }, dn = (t) => (e) => {
1139
- const o = H({
1138
+ }, Rn = (t) => (e) => {
1139
+ const n = k({
1140
1140
  width: (window == null ? void 0 : window.innerWidth) ?? 0,
1141
1141
  height: (window == null ? void 0 : window.innerHeight) ?? 0
1142
- }), n = nt(t(o))(e), i = () => {
1143
- o.set({
1142
+ }), o = it(t(n))(e), i = () => {
1143
+ n.set({
1144
1144
  width: (window == null ? void 0 : window.innerWidth) ?? 0,
1145
1145
  height: (window == null ? void 0 : window.innerHeight) ?? 0
1146
1146
  });
1147
1147
  };
1148
1148
  return window == null || window.addEventListener("resize", i), (r) => {
1149
- window == null || window.removeEventListener("resize", i), n(r);
1149
+ window == null || window.removeEventListener("resize", i), o(r);
1150
1150
  };
1151
- }, Ge = (t, e) => {
1152
- const o = e.split("/").filter((i) => i !== ""), n = {};
1151
+ }, sn = (t, e) => {
1152
+ const n = e.split("/").filter((i) => i !== ""), o = {};
1153
1153
  for (let i = 0; i < t.length; i++) {
1154
- const r = t[i], s = o[i];
1154
+ const r = t[i], s = n[i];
1155
1155
  if (!s && r.type !== "catch-all")
1156
1156
  return null;
1157
1157
  if (r.type === "literal") {
1158
1158
  if (r.value !== s)
1159
1159
  return null;
1160
1160
  } else if (r.type === "param")
1161
- n[r.name] = s;
1161
+ o[r.name] = s;
1162
1162
  else if (r.type === "catch-all")
1163
- return { params: n, path: e };
1163
+ return { params: o, path: e };
1164
1164
  }
1165
- return o.length !== t.length ? null : { params: n, path: e };
1166
- }, Qe = (t) => t.split("/").map((e) => e.startsWith(":") ? { type: "param", name: e.slice(1) } : e === "*" ? { type: "catch-all" } : { type: "literal", value: e }).filter((e) => e.type !== "literal" || e.value !== ""), Ze = (t) => {
1167
- const e = t.map((o) => {
1168
- const n = Qe(o);
1169
- return { route: o, segments: n };
1165
+ return n.length !== t.length ? null : { params: o, path: e };
1166
+ }, cn = (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 !== ""), ln = (t) => {
1167
+ const e = t.map((n) => {
1168
+ const o = cn(n);
1169
+ return { route: n, segments: o };
1170
1170
  });
1171
- return function(n) {
1171
+ return function(o) {
1172
1172
  for (const { segments: i, route: r } of e) {
1173
- const s = Ge(i, n);
1173
+ const s = sn(i, o);
1174
1174
  if (s)
1175
1175
  return { ...s, route: r };
1176
1176
  }
1177
1177
  return null;
1178
1178
  };
1179
- }, mn = (t) => {
1180
- const e = Ze(Object.keys(t));
1181
- return Nt((o) => {
1182
- const n = o.map((i) => {
1179
+ }, Ln = (t) => {
1180
+ const e = ln(Object.keys(t));
1181
+ return Bt((n) => {
1182
+ const o = n.map((i) => {
1183
1183
  const r = e(i.pathname);
1184
1184
  if (r == null)
1185
1185
  throw console.error("No route found for", i), new Error("No route found");
@@ -1191,44 +1191,120 @@ const qe = Se, Ye = Te, Rt = Le, Ke = (t, e, o) => {
1191
1191
  hash: i.hash
1192
1192
  };
1193
1193
  });
1194
- return te(
1195
- n.map((i) => [i.route, i]),
1194
+ return se(
1195
+ o.map((i) => [i.route, i]),
1196
1196
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1197
1197
  t
1198
1198
  );
1199
1199
  });
1200
+ }, ot = 60 * 1e3, mt = 60 * ot, Y = 24 * mt, Tt = 7 * Y, kt = 30 * Y, an = 365 * Y, un = [
1201
+ {
1202
+ max: ot * 90,
1203
+ value: ot,
1204
+ name: "minute",
1205
+ past: { singular: "a minute ago", plural: "{} minutes ago" },
1206
+ future: { singular: "in a minute", plural: "in {} minutes" }
1207
+ },
1208
+ {
1209
+ max: mt * 36,
1210
+ value: mt,
1211
+ name: "hour",
1212
+ past: { singular: "an hour ago", plural: "{} hours ago" },
1213
+ future: { singular: "in an hour", plural: "in {} hours" }
1214
+ },
1215
+ {
1216
+ max: Y * 10,
1217
+ value: Y,
1218
+ name: "day",
1219
+ past: { singular: "yesterday", plural: "{} days ago" },
1220
+ future: { singular: "tomorrow", plural: "in {} days" }
1221
+ },
1222
+ {
1223
+ max: Tt * 6,
1224
+ value: Tt,
1225
+ name: "week",
1226
+ past: { singular: "last week", plural: "{} weeks ago" },
1227
+ future: { singular: "in a week", plural: "in {} weeks" }
1228
+ },
1229
+ {
1230
+ max: kt * 18,
1231
+ value: kt,
1232
+ name: "month",
1233
+ past: { singular: "last month", plural: "{} months ago" },
1234
+ future: { singular: "in a month", plural: "in {} months" }
1235
+ },
1236
+ {
1237
+ max: 1 / 0,
1238
+ value: an,
1239
+ name: "year",
1240
+ past: { singular: "last year", plural: "{} years ago" },
1241
+ future: { singular: "in a year", plural: "in {} years" }
1242
+ }
1243
+ ];
1244
+ function Ct(t, e, n, o) {
1245
+ const i = Math.round(t / e);
1246
+ return i <= 1 ? n : o.replace(
1247
+ "{}",
1248
+ i.toLocaleString(void 0, {
1249
+ maximumFractionDigits: 0,
1250
+ minimumFractionDigits: 0
1251
+ })
1252
+ );
1253
+ }
1254
+ function fn(t) {
1255
+ const e = Math.abs(t);
1256
+ if (e < ot)
1257
+ return t < 0 ? "just now" : "in a moment";
1258
+ for (const n of un)
1259
+ if (e < n.max)
1260
+ return t < 0 ? Ct(e, n.value, n.past.singular, n.past.plural) : Ct(e, n.value, n.future.singular, n.future.plural);
1261
+ throw new Error("unreachable");
1262
+ }
1263
+ const On = (t, e) => {
1264
+ const n = e != null ? Mt.is(e) ? e.map((r) => r) : k(e) : k(/* @__PURE__ */ new Date()), o = ce(
1265
+ t,
1266
+ n
1267
+ )((r, s) => {
1268
+ const c = s.getTime() - r.getTime();
1269
+ return fn(c);
1270
+ }), i = le.is(n) ? setInterval(() => n.set(/* @__PURE__ */ new Date()), 5e3) : void 0;
1271
+ return o.onDispose(() => {
1272
+ i != null && clearInterval(i), n.dispose();
1273
+ }), o;
1200
1274
  };
1201
1275
  export {
1202
- fe as Anchor,
1203
- he as AsyncResultView,
1204
- rn as AutoFocus,
1205
- sn as AutoSelect,
1206
- hn as ElementSize,
1207
- ln as HTMLTitle,
1208
- cn as HiddenWhenEmpty,
1209
- pe as InViewport,
1210
- Dt as LocationProviderMarker,
1211
- un as PopOver,
1212
- nn as ProvideAppearance,
1213
- en as ProvideLocation,
1214
- Je as ResultView,
1215
- mn as Router,
1216
- fn as SelectOnFocus,
1217
- on as UseAppearance,
1218
- Nt as UseLocation,
1219
- an as WhenInViewport,
1220
- dn as WindowSize,
1221
- ne as _checkExtensionCondition,
1222
- ee as _getExtension,
1223
- re as _makeLocation,
1224
- ue as _makeLocationProp,
1225
- Ze as _makeRouteMatcher,
1226
- Qe as _parseRouteSegments,
1227
- Vt as appearanceMarker,
1228
- se as areLocationsEqual,
1229
- ie as handleAnchorClick,
1230
- ce as locationFromURL,
1231
- Ge as matchesRoute,
1232
- le as setLocationFromUrl,
1233
- ae as urlFromLocation
1276
+ ve as Anchor,
1277
+ xe as AsyncResultView,
1278
+ gn as AutoFocus,
1279
+ wn as AutoSelect,
1280
+ En as ElementSize,
1281
+ vn as HTMLTitle,
1282
+ yn as HiddenWhenEmpty,
1283
+ Ee as InViewport,
1284
+ _t as LocationProviderMarker,
1285
+ bn as PopOver,
1286
+ mn as ProvideAppearance,
1287
+ dn as ProvideLocation,
1288
+ rn as ResultView,
1289
+ Ln as Router,
1290
+ An as SelectOnFocus,
1291
+ pn as UseAppearance,
1292
+ Bt as UseLocation,
1293
+ xn as WhenInViewport,
1294
+ Rn as WindowSize,
1295
+ ue as _checkExtensionCondition,
1296
+ ae as _getExtension,
1297
+ de as _makeLocation,
1298
+ ye as _makeLocationProp,
1299
+ ln as _makeRouteMatcher,
1300
+ cn as _parseRouteSegments,
1301
+ It as appearanceMarker,
1302
+ me as areLocationsEqual,
1303
+ he as handleAnchorClick,
1304
+ pe as locationFromURL,
1305
+ On as makeRelativeTime,
1306
+ sn as matchesRoute,
1307
+ ge as setLocationFromUrl,
1308
+ fn as timeDiffToString,
1309
+ we as urlFromLocation
1234
1310
  };