@tempots/ui 16.0.10 → 16.1.1
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/README.md +21 -26
- package/index.cjs +1 -1
- package/index.js +321 -299
- package/package.json +2 -2
- package/renderables/mutation.d.ts +18 -13
- package/renderables/query.d.ts +28 -63
- package/utils/mutation-resource.d.ts +22 -10
- package/utils/query-resource.d.ts +2 -4
package/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { getWindow as
|
|
2
|
-
import { delayed as
|
|
3
|
-
import { autoUpdate as
|
|
1
|
+
import { getWindow as K, prop as x, makeProviderMark as Q, computedOf as J, Signal as pt, Use as N, html as j, on as ft, Value as k, attr as X, Empty as _, OneOfType as mt, WithElement as O, OnDispose as b, Fragment as R, Portal as gt, renderableOfTNode as vt, When as wt, previousSignal as Ot, effectOf as Lt, WithBrowserCtx as Rt, WithCtx as At, OneOfTuple as yt, Provide as Ht, Prop as Tt, strictEquals as Wt } from "@tempots/dom";
|
|
2
|
+
import { delayed as St, AsyncResult as v, nearEqual as T, interval as Ut } from "@tempots/std";
|
|
3
|
+
import { autoUpdate as Kt, flip as Mt, offset as Dt, shift as Nt, computePosition as Ft, arrow as Ct } from "@floating-ui/dom";
|
|
4
4
|
const zt = (e) => {
|
|
5
5
|
const t = e.split("/").pop();
|
|
6
6
|
if (t == null || t.startsWith(".")) return;
|
|
7
7
|
const n = t.split(".") || [];
|
|
8
8
|
return n.length > 1 ? "." + n.pop() : void 0;
|
|
9
|
-
},
|
|
9
|
+
}, Vt = (e, t) => {
|
|
10
10
|
const n = zt(t);
|
|
11
11
|
return n != null && (e.length === 0 || !e.some((s) => n == s));
|
|
12
|
-
},
|
|
12
|
+
}, $t = (e, t, n, s) => {
|
|
13
13
|
let a = e.target;
|
|
14
14
|
for (; a != null && !(a instanceof HTMLAnchorElement); )
|
|
15
15
|
a = a.parentElement;
|
|
@@ -20,12 +20,12 @@ const zt = (e) => {
|
|
|
20
20
|
return !0;
|
|
21
21
|
const { pathname: r, search: i, hash: c } = o;
|
|
22
22
|
if (s) {
|
|
23
|
-
const u = r + i + c,
|
|
24
|
-
if (!
|
|
23
|
+
const u = r + i + c, h = o.getAttribute("href");
|
|
24
|
+
if (!h?.startsWith("#") && h !== u)
|
|
25
25
|
return !0;
|
|
26
26
|
}
|
|
27
|
-
return t ? !1 :
|
|
28
|
-
},
|
|
27
|
+
return t ? !1 : Vt(n, r);
|
|
28
|
+
}, jt = (e, t = {
|
|
29
29
|
ignoreUrlWithExtension: !0,
|
|
30
30
|
allowedExtensions: [],
|
|
31
31
|
ignoreExternalUrl: !0
|
|
@@ -34,7 +34,7 @@ const zt = (e) => {
|
|
|
34
34
|
(s) => s.startsWith(".") ? s : "." + s
|
|
35
35
|
) : [];
|
|
36
36
|
return (s) => {
|
|
37
|
-
|
|
37
|
+
$t(
|
|
38
38
|
s,
|
|
39
39
|
t.ignoreUrlWithExtension ?? !0,
|
|
40
40
|
n,
|
|
@@ -42,20 +42,20 @@ const zt = (e) => {
|
|
|
42
42
|
) || e() && s.preventDefault();
|
|
43
43
|
};
|
|
44
44
|
}, _t = (e, t) => e.pathname === t.pathname && JSON.stringify(e.search) === JSON.stringify(t.search) && e.hash === t.hash, I = (e, t) => {
|
|
45
|
-
const n = new URL(e, t ??
|
|
45
|
+
const n = new URL(e, t ?? K()?.location.toString()), s = Object.fromEntries(n.searchParams?.entries() ?? []);
|
|
46
46
|
let a = n.hash;
|
|
47
47
|
return a.startsWith("#") && (a = a.substring(1)), {
|
|
48
48
|
pathname: n.pathname,
|
|
49
49
|
search: s,
|
|
50
50
|
hash: a === "" ? void 0 : a
|
|
51
51
|
};
|
|
52
|
-
},
|
|
52
|
+
}, U = (e) => {
|
|
53
53
|
const n = new URLSearchParams(e.search).toString(), s = e.hash;
|
|
54
54
|
return `${e.pathname}${n ? `?${n}` : ""}${s ? `#${s}` : ""}`;
|
|
55
55
|
}, It = (e) => {
|
|
56
56
|
document.startViewTransition ? document.startViewTransition(e) : e();
|
|
57
|
-
},
|
|
58
|
-
const e =
|
|
57
|
+
}, st = () => {
|
|
58
|
+
const e = K(), t = e?.location.hash ?? "";
|
|
59
59
|
return {
|
|
60
60
|
pathname: e?.location.pathname ?? "",
|
|
61
61
|
search: Object.fromEntries(
|
|
@@ -63,32 +63,32 @@ const zt = (e) => {
|
|
|
63
63
|
),
|
|
64
64
|
hash: t.startsWith("#") ? t.substring(1) || void 0 : t === "" ? void 0 : t
|
|
65
65
|
};
|
|
66
|
-
},
|
|
66
|
+
}, rt = (e) => {
|
|
67
67
|
if (e?.scroll !== "auto")
|
|
68
68
|
return;
|
|
69
|
-
const t =
|
|
69
|
+
const t = K();
|
|
70
70
|
t && t.requestAnimationFrame(
|
|
71
71
|
() => t.scrollTo({ top: 0, left: 0, behavior: "auto" })
|
|
72
72
|
);
|
|
73
|
-
},
|
|
73
|
+
}, at = (e, t) => {
|
|
74
74
|
t?.viewTransition ? It(e) : e();
|
|
75
75
|
}, Bt = () => {
|
|
76
|
-
const e =
|
|
77
|
-
e.set(
|
|
76
|
+
const e = x(st(), _t), t = K(), n = () => {
|
|
77
|
+
e.set(st());
|
|
78
78
|
};
|
|
79
79
|
t?.addEventListener("popstate", n), t?.addEventListener("hashchange", n);
|
|
80
|
-
const s = (c, u,
|
|
81
|
-
|
|
80
|
+
const s = (c, u, h) => {
|
|
81
|
+
at(() => {
|
|
82
82
|
if (t) {
|
|
83
|
-
const w =
|
|
84
|
-
|
|
83
|
+
const w = U(c), f = u?.state ?? {};
|
|
84
|
+
h === "replaceState" || u?.replace ? t.history.replaceState(f, "", w) : t.history.pushState(f, "", w);
|
|
85
85
|
}
|
|
86
86
|
e.set(c);
|
|
87
|
-
}, u),
|
|
87
|
+
}, u), rt(u);
|
|
88
88
|
}, a = (c, u) => {
|
|
89
|
-
|
|
89
|
+
at(() => {
|
|
90
90
|
t?.history.go(c);
|
|
91
|
-
}, u),
|
|
91
|
+
}, u), rt(u);
|
|
92
92
|
};
|
|
93
93
|
return {
|
|
94
94
|
location: e,
|
|
@@ -106,9 +106,9 @@ const zt = (e) => {
|
|
|
106
106
|
(r) => I(r, t.value),
|
|
107
107
|
(r) => {
|
|
108
108
|
if (qt(r.pathname))
|
|
109
|
-
return
|
|
109
|
+
return U(r);
|
|
110
110
|
const i = new URL(r.pathname, t.value), c = i.origin + i.pathname;
|
|
111
|
-
return
|
|
111
|
+
return U({ ...r, pathname: c });
|
|
112
112
|
}
|
|
113
113
|
);
|
|
114
114
|
return {
|
|
@@ -129,7 +129,7 @@ const zt = (e) => {
|
|
|
129
129
|
},
|
|
130
130
|
resolve: (r) => I(r, t.value)
|
|
131
131
|
};
|
|
132
|
-
},
|
|
132
|
+
}, M = (e) => ({
|
|
133
133
|
pathname: e.pathname,
|
|
134
134
|
search: { ...e.search },
|
|
135
135
|
hash: e.hash ?? void 0
|
|
@@ -137,7 +137,7 @@ const zt = (e) => {
|
|
|
137
137
|
if (e == null) return;
|
|
138
138
|
const t = `${e}`;
|
|
139
139
|
return t === "" ? void 0 : t;
|
|
140
|
-
},
|
|
140
|
+
}, kt = (e, t) => {
|
|
141
141
|
const n = { ...e };
|
|
142
142
|
for (const [s, a] of Object.entries(t))
|
|
143
143
|
a == null ? delete n[s] : n[s] = a;
|
|
@@ -160,9 +160,9 @@ const zt = (e) => {
|
|
|
160
160
|
search: o,
|
|
161
161
|
hash: s ? e.hash : void 0
|
|
162
162
|
};
|
|
163
|
-
},
|
|
163
|
+
}, ot = (e, t, n) => {
|
|
164
164
|
const s = Qt(e, n);
|
|
165
|
-
return typeof t == "string" ?
|
|
165
|
+
return typeof t == "string" ? U(s) === t : t instanceof RegExp ? ((t.global || t.sticky) && (t.lastIndex = 0), t.test(U(s))) : t(s);
|
|
166
166
|
};
|
|
167
167
|
class Jt {
|
|
168
168
|
constructor(t) {
|
|
@@ -172,7 +172,7 @@ class Jt {
|
|
|
172
172
|
return this.current;
|
|
173
173
|
}
|
|
174
174
|
setLocation(t) {
|
|
175
|
-
return this.current =
|
|
175
|
+
return this.current = M(t), this;
|
|
176
176
|
}
|
|
177
177
|
setPathname(t) {
|
|
178
178
|
return this.current = {
|
|
@@ -199,7 +199,7 @@ class Jt {
|
|
|
199
199
|
setSearch(t) {
|
|
200
200
|
return this.current = {
|
|
201
201
|
...this.current,
|
|
202
|
-
search:
|
|
202
|
+
search: kt(this.current.search, t)
|
|
203
203
|
}, this;
|
|
204
204
|
}
|
|
205
205
|
setSearchParam(t, n) {
|
|
@@ -213,44 +213,44 @@ class Jt {
|
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
const Xt = (e, t) => e?.replace ? "replaceState" : t, Gt = (e) => {
|
|
216
|
-
const t = e.location, n = t.map(
|
|
216
|
+
const t = e.location, n = t.map(U), s = t.map((l) => l.pathname), a = t.map((l) => ({ ...l.search })), o = t.map((l) => l.hash), r = (l, d) => ot(e.location.value, l, d), i = (l, d) => J(
|
|
217
217
|
t,
|
|
218
218
|
l
|
|
219
219
|
)(
|
|
220
|
-
(p,
|
|
221
|
-
), c = (l,
|
|
222
|
-
const
|
|
220
|
+
(p, H) => ot(p, H, d)
|
|
221
|
+
), c = (l, d, p) => {
|
|
222
|
+
const H = M({
|
|
223
223
|
...l,
|
|
224
224
|
hash: B(l.hash ?? void 0)
|
|
225
225
|
});
|
|
226
|
-
e.commit(
|
|
227
|
-
}, u = (l,
|
|
228
|
-
const p = Xt(
|
|
229
|
-
c(l,
|
|
230
|
-
},
|
|
231
|
-
const p = l(
|
|
232
|
-
u(p,
|
|
233
|
-
}, w = (l,
|
|
226
|
+
e.commit(H, d, p);
|
|
227
|
+
}, u = (l, d) => {
|
|
228
|
+
const p = Xt(d, "pushState");
|
|
229
|
+
c(l, d, p);
|
|
230
|
+
}, h = (l, d) => {
|
|
231
|
+
const p = l(M(e.location.value));
|
|
232
|
+
u(p, d);
|
|
233
|
+
}, w = (l, d) => {
|
|
234
234
|
const p = e.resolve(l);
|
|
235
|
-
u(p,
|
|
236
|
-
},
|
|
237
|
-
const p = { ...
|
|
235
|
+
u(p, d);
|
|
236
|
+
}, f = (l, d) => {
|
|
237
|
+
const p = { ...d, replace: !0 };
|
|
238
238
|
w(l, p);
|
|
239
|
-
},
|
|
240
|
-
e.go(l,
|
|
241
|
-
},
|
|
239
|
+
}, A = (l, d) => {
|
|
240
|
+
e.go(l, d);
|
|
241
|
+
}, g = (l) => {
|
|
242
242
|
e.back(l);
|
|
243
|
-
},
|
|
243
|
+
}, P = (l) => {
|
|
244
244
|
e.forward(l);
|
|
245
|
-
}, m = (l,
|
|
246
|
-
const
|
|
247
|
-
return nt == null ? delete
|
|
248
|
-
},
|
|
245
|
+
}, m = (l, d) => h((p) => ({ ...p, pathname: l }), d), E = (l, d) => h((p) => {
|
|
246
|
+
const H = { ...p }, nt = B(l);
|
|
247
|
+
return nt == null ? delete H.hash : H.hash = nt, H;
|
|
248
|
+
}, d), S = (l) => E(void 0, l), y = (l, d) => h(
|
|
249
249
|
(p) => ({
|
|
250
250
|
...p,
|
|
251
|
-
search:
|
|
251
|
+
search: kt(p.search, l)
|
|
252
252
|
}),
|
|
253
|
-
|
|
253
|
+
d
|
|
254
254
|
);
|
|
255
255
|
return {
|
|
256
256
|
handle: {
|
|
@@ -260,30 +260,30 @@ const Xt = (e, t) => e?.replace ? "replaceState" : t, Gt = (e) => {
|
|
|
260
260
|
search: a,
|
|
261
261
|
hash: o,
|
|
262
262
|
setLocation: u,
|
|
263
|
-
updateLocation:
|
|
263
|
+
updateLocation: h,
|
|
264
264
|
navigate: w,
|
|
265
|
-
replace:
|
|
266
|
-
go:
|
|
267
|
-
back:
|
|
268
|
-
forward:
|
|
265
|
+
replace: f,
|
|
266
|
+
go: A,
|
|
267
|
+
back: g,
|
|
268
|
+
forward: P,
|
|
269
269
|
setPathname: m,
|
|
270
|
-
setHash:
|
|
271
|
-
clearHash:
|
|
272
|
-
setSearch:
|
|
273
|
-
setSearchParam: (l,
|
|
274
|
-
updateSearch: (l,
|
|
270
|
+
setHash: E,
|
|
271
|
+
clearHash: S,
|
|
272
|
+
setSearch: y,
|
|
273
|
+
setSearchParam: (l, d, p) => y({ [l]: d }, p),
|
|
274
|
+
updateSearch: (l, d) => h(
|
|
275
275
|
(p) => ({
|
|
276
276
|
...p,
|
|
277
277
|
search: { ...l({ ...p.search }) }
|
|
278
278
|
}),
|
|
279
|
-
|
|
279
|
+
d
|
|
280
280
|
),
|
|
281
|
-
queryParam: (l) => t.map((
|
|
282
|
-
run: (l,
|
|
281
|
+
queryParam: (l) => t.map((d) => d.search[l]),
|
|
282
|
+
run: (l, d) => {
|
|
283
283
|
const p = new Jt(
|
|
284
|
-
|
|
284
|
+
M(e.location.value)
|
|
285
285
|
);
|
|
286
|
-
l(p), u(
|
|
286
|
+
l(p), u(M(p.location), d);
|
|
287
287
|
},
|
|
288
288
|
match: r,
|
|
289
289
|
matchSignal: i
|
|
@@ -308,17 +308,17 @@ const Xt = (e, t) => e?.replace ? "replaceState" : t, Gt = (e) => {
|
|
|
308
308
|
};
|
|
309
309
|
}
|
|
310
310
|
}, te = (e, ...t) => {
|
|
311
|
-
if (typeof e == "string" ||
|
|
311
|
+
if (typeof e == "string" || pt.is(e))
|
|
312
312
|
return te({ href: e }, ...t);
|
|
313
313
|
const { href: n, state: s, scroll: a, viewTransition: o, replace: r, ...i } = e;
|
|
314
|
-
return
|
|
315
|
-
|
|
316
|
-
|
|
314
|
+
return N(G, (c) => j.a(
|
|
315
|
+
ft.click(
|
|
316
|
+
jt(() => {
|
|
317
317
|
let u = !1;
|
|
318
|
-
const
|
|
319
|
-
return s !== void 0 && (
|
|
320
|
-
|
|
321
|
-
u ?
|
|
318
|
+
const h = {};
|
|
319
|
+
return s !== void 0 && (h.state = s, u = !0), a !== void 0 && (h.scroll = a, u = !0), o !== void 0 && (h.viewTransition = o, u = !0), r !== void 0 && (h.replace = r, u = !0), c.navigate(
|
|
320
|
+
k.get(n),
|
|
321
|
+
u ? h : void 0
|
|
322
322
|
), !0;
|
|
323
323
|
}, i)
|
|
324
324
|
),
|
|
@@ -337,37 +337,37 @@ const Xt = (e, t) => e?.replace ? "replaceState" : t, Gt = (e) => {
|
|
|
337
337
|
}
|
|
338
338
|
};
|
|
339
339
|
function ee() {
|
|
340
|
-
const e =
|
|
340
|
+
const e = K(), t = e != null && e.matchMedia != null ? e.matchMedia("(prefers-color-scheme: dark)") : void 0, n = t?.matches ?? !1, s = x(n ? "dark" : "light"), a = (o) => s.set(o.matches ? "dark" : "light");
|
|
341
341
|
return t?.addEventListener("change", a), s.onDispose(() => t?.removeEventListener("change", a)), s;
|
|
342
342
|
}
|
|
343
|
-
const
|
|
343
|
+
const xt = (e, t) => {
|
|
344
344
|
if (typeof t == "function")
|
|
345
|
-
return
|
|
345
|
+
return xt(e, { success: t });
|
|
346
346
|
const n = t.failure ?? ((r) => r.map((i) => `Error: ${i}`)), s = t.success, a = t.loading ?? (() => _), o = t.notAsked ?? (() => _);
|
|
347
|
-
return
|
|
347
|
+
return mt(k.toSignal(e), {
|
|
348
348
|
AsyncSuccess: (r) => s(r.$.value),
|
|
349
349
|
AsyncFailure: (r) => n(r.$.error),
|
|
350
350
|
Loading: (r) => a(r.map((i) => i.previousValue)),
|
|
351
351
|
NotAsked: o
|
|
352
352
|
});
|
|
353
|
-
}, Le = (e = 10) =>
|
|
354
|
-
const n =
|
|
355
|
-
return
|
|
353
|
+
}, Le = (e = 10) => O((t) => b(St(() => t?.focus(), e))), Re = (e = 10) => O((t) => {
|
|
354
|
+
const n = St(() => t.select(), e);
|
|
355
|
+
return b(n);
|
|
356
356
|
});
|
|
357
357
|
function Ae(e) {
|
|
358
358
|
const t = Object.entries(e);
|
|
359
359
|
return R(
|
|
360
360
|
...t.map(
|
|
361
|
-
([n, s]) => X.class(
|
|
361
|
+
([n, s]) => X.class(k.map(s, (a) => a ? n : void 0))
|
|
362
362
|
)
|
|
363
363
|
);
|
|
364
364
|
}
|
|
365
|
-
const He =
|
|
365
|
+
const He = O((e) => {
|
|
366
366
|
const t = e.style.getPropertyValue(":empty");
|
|
367
|
-
return e.style.setProperty(":empty", "display:none"),
|
|
367
|
+
return e.style.setProperty(":empty", "display:none"), b((n) => {
|
|
368
368
|
n && e.style.setProperty(":empty", t);
|
|
369
369
|
});
|
|
370
|
-
}), Te = (e) =>
|
|
370
|
+
}), Te = (e) => gt("head > title", X.innerText(e)), ne = {
|
|
371
371
|
partial: {
|
|
372
372
|
root: null,
|
|
373
373
|
rootMargin: "0px",
|
|
@@ -378,61 +378,61 @@ const He = L((e) => {
|
|
|
378
378
|
rootMargin: "0px",
|
|
379
379
|
threshold: 1
|
|
380
380
|
}
|
|
381
|
-
},
|
|
381
|
+
}, C = {
|
|
382
382
|
partial: /* @__PURE__ */ new Map(),
|
|
383
383
|
full: /* @__PURE__ */ new Map()
|
|
384
|
-
},
|
|
384
|
+
}, D = {
|
|
385
385
|
partial: null,
|
|
386
386
|
full: null
|
|
387
387
|
};
|
|
388
388
|
function se(e) {
|
|
389
|
-
return
|
|
389
|
+
return D[e] == null && (D[e] = new IntersectionObserver((t) => {
|
|
390
390
|
t.forEach((n) => {
|
|
391
|
-
|
|
391
|
+
C[e].get(n.target)?.set(n.isIntersecting);
|
|
392
392
|
});
|
|
393
|
-
}, ne[e])),
|
|
393
|
+
}, ne[e])), D[e];
|
|
394
394
|
}
|
|
395
395
|
const re = ({ mode: e = "partial", once: t = !1 }, n) => {
|
|
396
|
-
const s =
|
|
396
|
+
const s = x(!1);
|
|
397
397
|
return R(
|
|
398
|
-
|
|
398
|
+
O((a) => {
|
|
399
399
|
const o = typeof IntersectionObserver < "u" ? se(e) : null;
|
|
400
|
-
|
|
400
|
+
C[e].set(a, s), o?.observe(a);
|
|
401
401
|
function r() {
|
|
402
|
-
o?.unobserve(a),
|
|
402
|
+
o?.unobserve(a), C[e].delete(a), C[e].size === 0 && (D[e]?.disconnect(), D[e] = null);
|
|
403
403
|
}
|
|
404
404
|
let i = null;
|
|
405
405
|
return t && (i = s.on((c) => {
|
|
406
406
|
c && r();
|
|
407
|
-
})),
|
|
407
|
+
})), b(() => {
|
|
408
408
|
s.dispose(), r(), i?.();
|
|
409
409
|
});
|
|
410
410
|
}),
|
|
411
|
-
|
|
411
|
+
vt(n(s))
|
|
412
412
|
);
|
|
413
|
-
}, We = (e, t, n) => re(e, (s) =>
|
|
413
|
+
}, We = (e, t, n) => re(e, (s) => wt(s, t, n ?? (() => _)));
|
|
414
414
|
function ae(e) {
|
|
415
|
-
return
|
|
415
|
+
return O((t) => {
|
|
416
416
|
const n = (s) => {
|
|
417
417
|
t.contains(s.target) || e(s);
|
|
418
418
|
};
|
|
419
|
-
return document.addEventListener("click", n),
|
|
419
|
+
return document.addEventListener("click", n), b(() => {
|
|
420
420
|
document.removeEventListener("click", n);
|
|
421
421
|
});
|
|
422
422
|
});
|
|
423
423
|
}
|
|
424
|
-
const
|
|
424
|
+
const W = (e, t) => e === void 0 || e === t, it = (e, t) => e === void 0 || e === t;
|
|
425
425
|
function oe(e, t) {
|
|
426
|
-
return typeof e == "string" ? t.key === e :
|
|
426
|
+
return typeof e == "string" ? t.key === e : it(e.key, t.key) && it(e.code, t.code) && W(e.ctrlKey, t.ctrlKey) && W(e.altKey, t.altKey) && W(e.shiftKey, t.shiftKey) && W(e.metaKey, t.metaKey) && W(e.repeat, t.repeat) && W(
|
|
427
427
|
e.commandOrControlKey,
|
|
428
428
|
t.metaKey || t.ctrlKey
|
|
429
429
|
);
|
|
430
430
|
}
|
|
431
|
-
function
|
|
431
|
+
function bt({
|
|
432
432
|
allowedKeys: e,
|
|
433
433
|
handler: t
|
|
434
434
|
}) {
|
|
435
|
-
return
|
|
435
|
+
return O((n) => {
|
|
436
436
|
const s = (a) => {
|
|
437
437
|
if (n.contains(a.target)) {
|
|
438
438
|
for (const o of e)
|
|
@@ -442,16 +442,16 @@ function kt({
|
|
|
442
442
|
}
|
|
443
443
|
}
|
|
444
444
|
};
|
|
445
|
-
return document.addEventListener("keydown", s),
|
|
445
|
+
return document.addEventListener("keydown", s), b(() => {
|
|
446
446
|
document.removeEventListener("keydown", s);
|
|
447
447
|
});
|
|
448
448
|
});
|
|
449
449
|
}
|
|
450
450
|
function Ue(e) {
|
|
451
|
-
return
|
|
451
|
+
return bt({ allowedKeys: ["Enter"], handler: e });
|
|
452
452
|
}
|
|
453
453
|
function Ke(e) {
|
|
454
|
-
return
|
|
454
|
+
return bt({ allowedKeys: ["Escape"], handler: e });
|
|
455
455
|
}
|
|
456
456
|
const ie = ({
|
|
457
457
|
mutate: e,
|
|
@@ -461,43 +461,45 @@ const ie = ({
|
|
|
461
461
|
onSettled: a
|
|
462
462
|
}) => {
|
|
463
463
|
let o;
|
|
464
|
-
const r =
|
|
465
|
-
(
|
|
464
|
+
const r = x(v.notAsked), i = r.map(
|
|
465
|
+
(g) => v.isSuccess(g) ? g.value : void 0
|
|
466
466
|
), c = r.map(
|
|
467
|
-
(
|
|
468
|
-
), u = r.map((
|
|
467
|
+
(g) => v.isFailure(g) ? g.error : void 0
|
|
468
|
+
), u = r.map((g) => v.isLoading(g)), h = () => {
|
|
469
469
|
o?.abort(), o = void 0;
|
|
470
|
+
}, w = (g) => {
|
|
471
|
+
h(), r.set(g ?? v.notAsked);
|
|
470
472
|
};
|
|
471
473
|
return {
|
|
472
474
|
status: r,
|
|
473
475
|
value: i,
|
|
474
476
|
error: c,
|
|
475
477
|
pending: u,
|
|
476
|
-
execute: async (
|
|
477
|
-
|
|
478
|
-
const m = o.signal,
|
|
479
|
-
|
|
478
|
+
execute: async (g, P) => {
|
|
479
|
+
h(), o = new AbortController();
|
|
480
|
+
const m = o.signal, E = r.get(), S = P?.optimisticValue ?? (P?.optimisticFromRequest != null ? P.optimisticFromRequest(g) : void 0);
|
|
481
|
+
S != null ? r.set(v.loading(S)) : r.set(v.loading(v.getOrUndefined(E)));
|
|
480
482
|
try {
|
|
481
|
-
const
|
|
482
|
-
o = void 0, r.set(v.success(
|
|
483
|
-
} catch (
|
|
484
|
-
o = void 0
|
|
483
|
+
const y = await e({ request: g, abortSignal: m, previous: E, cancel: w });
|
|
484
|
+
o = void 0, r.set(v.success(y)), n?.(y, g);
|
|
485
|
+
} catch (y) {
|
|
486
|
+
o = void 0;
|
|
487
|
+
const L = t(y);
|
|
488
|
+
r.set(v.failure(L)), s?.(L, g);
|
|
485
489
|
}
|
|
486
|
-
a?.(r.get(),
|
|
487
|
-
},
|
|
488
|
-
cancel: (f) => {
|
|
489
|
-
d(), r.set(f ?? v.notAsked);
|
|
490
|
+
a?.(r.get(), g);
|
|
490
491
|
},
|
|
492
|
+
cancel: w,
|
|
491
493
|
dispose: () => {
|
|
492
494
|
o?.abort(), o = void 0, r.dispose();
|
|
493
495
|
}
|
|
494
496
|
};
|
|
495
497
|
}, ce = (e, t) => {
|
|
496
|
-
const { status: n, dispose: s, execute: a, cancel: o, pending: r, error: i, value: c } = e, { content: u } = t,
|
|
498
|
+
const { status: n, dispose: s, execute: a, cancel: o, pending: r, error: i, value: c } = e, { content: u } = t, h = Ot(c);
|
|
497
499
|
return R(
|
|
498
|
-
|
|
500
|
+
b(s),
|
|
499
501
|
u({
|
|
500
|
-
previous:
|
|
502
|
+
previous: h,
|
|
501
503
|
execute: a,
|
|
502
504
|
cancel: o,
|
|
503
505
|
pending: r,
|
|
@@ -536,41 +538,40 @@ const ie = ({
|
|
|
536
538
|
"left-start",
|
|
537
539
|
"left-end"
|
|
538
540
|
], Ne = (e, t = { isOpen: !1 }) => {
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
s = i, a.set(!0);
|
|
541
|
+
let n = null;
|
|
542
|
+
const s = k.deriveProp(t.isOpen);
|
|
543
|
+
function a(r) {
|
|
544
|
+
n = r, s.set(!0);
|
|
544
545
|
}
|
|
545
|
-
function
|
|
546
|
-
|
|
546
|
+
function o() {
|
|
547
|
+
s.set(!1);
|
|
547
548
|
}
|
|
548
549
|
return R(
|
|
549
|
-
e(
|
|
550
|
-
|
|
551
|
-
|
|
550
|
+
e(a, o),
|
|
551
|
+
wt(
|
|
552
|
+
s,
|
|
552
553
|
() => R(
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
(
|
|
554
|
+
n?.onClickOutside != null ? ae(n.onClickOutside) : null,
|
|
555
|
+
O(
|
|
556
|
+
(r) => gt(
|
|
556
557
|
"body",
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
const
|
|
561
|
-
|
|
562
|
-
) :
|
|
563
|
-
if (
|
|
564
|
-
throw new Error(`Target not found: ${
|
|
565
|
-
let
|
|
566
|
-
const
|
|
567
|
-
|
|
568
|
-
),
|
|
558
|
+
j.div(
|
|
559
|
+
O((i) => {
|
|
560
|
+
i.style.position = "absolute", i.style.width = "max-content";
|
|
561
|
+
const c = typeof n?.target == "string" ? r.querySelector(
|
|
562
|
+
n.target
|
|
563
|
+
) : n?.target ?? r;
|
|
564
|
+
if (c == null)
|
|
565
|
+
throw new Error(`Target not found: ${n?.target}`);
|
|
566
|
+
let u = null;
|
|
567
|
+
const h = k.toSignal(n?.mainAxisOffset ?? 0), w = k.toSignal(
|
|
568
|
+
n?.crossAxisOffset ?? 0
|
|
569
|
+
), f = k.toSignal(
|
|
569
570
|
/* c8 ignore next 3 */
|
|
570
|
-
|
|
571
|
-
),
|
|
572
|
-
|
|
573
|
-
),
|
|
571
|
+
n?.placement ?? "top"
|
|
572
|
+
), A = k.toSignal(
|
|
573
|
+
n?.arrowPadding ?? 0
|
|
574
|
+
), g = n?.arrow, P = x({
|
|
574
575
|
centerOffset: 0,
|
|
575
576
|
alignmentOffset: 0,
|
|
576
577
|
containerWidth: 0,
|
|
@@ -578,71 +579,70 @@ const ie = ({
|
|
|
578
579
|
x: void 0,
|
|
579
580
|
y: void 0
|
|
580
581
|
});
|
|
581
|
-
async function
|
|
582
|
-
const
|
|
583
|
-
|
|
582
|
+
async function m() {
|
|
583
|
+
const S = [
|
|
584
|
+
Mt(),
|
|
584
585
|
Dt({
|
|
585
|
-
mainAxis:
|
|
586
|
-
crossAxis:
|
|
586
|
+
mainAxis: h.get(),
|
|
587
|
+
crossAxis: w.get()
|
|
587
588
|
}),
|
|
588
|
-
Nt()
|
|
589
|
-
st()
|
|
589
|
+
Nt()
|
|
590
590
|
];
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
element:
|
|
594
|
-
padding:
|
|
591
|
+
g != null && u != null && S.push(
|
|
592
|
+
Ct({
|
|
593
|
+
element: u,
|
|
594
|
+
padding: A.get()
|
|
595
595
|
})
|
|
596
596
|
);
|
|
597
|
-
const
|
|
598
|
-
placement:
|
|
597
|
+
const y = await Ft(c, i, {
|
|
598
|
+
placement: f.get(),
|
|
599
599
|
strategy: "absolute",
|
|
600
|
-
middleware:
|
|
601
|
-
}), { x:
|
|
602
|
-
if (
|
|
600
|
+
middleware: S
|
|
601
|
+
}), { x: L, y: Z, middlewareData: $ } = y;
|
|
602
|
+
if (i.style.top = `${Z}px`, i.style.left = `${L}px`, u != null && $.arrow != null) {
|
|
603
603
|
const {
|
|
604
|
-
x:
|
|
605
|
-
y:
|
|
606
|
-
centerOffset:
|
|
607
|
-
alignmentOffset:
|
|
608
|
-
} =
|
|
609
|
-
|
|
610
|
-
x:
|
|
611
|
-
y:
|
|
612
|
-
centerOffset:
|
|
613
|
-
alignmentOffset:
|
|
614
|
-
containerWidth:
|
|
615
|
-
containerHeight:
|
|
604
|
+
x: tt,
|
|
605
|
+
y: et,
|
|
606
|
+
centerOffset: l,
|
|
607
|
+
alignmentOffset: d
|
|
608
|
+
} = $.arrow;
|
|
609
|
+
P.set({
|
|
610
|
+
x: tt,
|
|
611
|
+
y: et,
|
|
612
|
+
centerOffset: l,
|
|
613
|
+
alignmentOffset: d,
|
|
614
|
+
containerWidth: i.offsetWidth,
|
|
615
|
+
containerHeight: i.offsetHeight
|
|
616
616
|
});
|
|
617
617
|
}
|
|
618
618
|
}
|
|
619
|
-
const
|
|
619
|
+
const E = Lt(
|
|
620
|
+
h,
|
|
620
621
|
w,
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
)(S);
|
|
622
|
+
f
|
|
623
|
+
)(m);
|
|
624
624
|
return R(
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
625
|
+
n?.content,
|
|
626
|
+
n?.arrow != null ? j.div(
|
|
627
|
+
n?.arrow(
|
|
628
628
|
J(
|
|
629
|
-
|
|
630
|
-
|
|
629
|
+
P,
|
|
630
|
+
f
|
|
631
631
|
)(
|
|
632
|
-
(
|
|
633
|
-
...
|
|
634
|
-
placement:
|
|
632
|
+
(S, y) => ({
|
|
633
|
+
...S,
|
|
634
|
+
placement: y
|
|
635
635
|
})
|
|
636
636
|
)
|
|
637
637
|
),
|
|
638
|
-
|
|
639
|
-
|
|
638
|
+
O((S) => {
|
|
639
|
+
u = S, m();
|
|
640
640
|
})
|
|
641
641
|
) : null,
|
|
642
642
|
// arrowSignal is automatically disposed by the scope
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
643
|
+
b(
|
|
644
|
+
Kt(c, i, m),
|
|
645
|
+
E
|
|
646
646
|
)
|
|
647
647
|
);
|
|
648
648
|
})
|
|
@@ -661,59 +661,75 @@ const ie = ({
|
|
|
661
661
|
onSettled: o
|
|
662
662
|
}) => {
|
|
663
663
|
let r;
|
|
664
|
-
const i =
|
|
664
|
+
const i = x(v.notAsked), c = i.map(
|
|
665
665
|
(m) => v.isSuccess(m) ? m.value : void 0
|
|
666
666
|
), u = i.map(
|
|
667
667
|
(m) => v.isFailure(m) ? m.error : void 0
|
|
668
|
-
),
|
|
668
|
+
), h = i.map((m) => v.isLoading(m)), w = () => {
|
|
669
669
|
r?.abort(), r = void 0;
|
|
670
|
-
},
|
|
670
|
+
}, f = (m) => {
|
|
671
671
|
w(), i.set(m ?? v.notAsked);
|
|
672
|
-
},
|
|
672
|
+
}, A = async (m) => {
|
|
673
673
|
w(), r = new AbortController();
|
|
674
|
-
const
|
|
675
|
-
i.set(v.loading(v.getOrUndefined(
|
|
674
|
+
const E = r.signal, S = i.get();
|
|
675
|
+
i.set(v.loading(v.getOrUndefined(S)));
|
|
676
676
|
try {
|
|
677
|
-
const
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
677
|
+
const y = await t({
|
|
678
|
+
request: m,
|
|
679
|
+
abortSignal: E,
|
|
680
|
+
previous: S,
|
|
681
|
+
cancel: f
|
|
682
|
+
});
|
|
683
|
+
await Promise.resolve(), r = void 0, i.set(v.success(y)), s?.(y, m);
|
|
684
|
+
} catch (y) {
|
|
685
|
+
r = void 0;
|
|
686
|
+
const L = n(y);
|
|
687
|
+
i.set(v.failure(L)), a?.(L, m);
|
|
681
688
|
}
|
|
682
689
|
o?.(i.get(), m);
|
|
683
|
-
},
|
|
690
|
+
}, g = () => A(k.get(e)), P = () => {
|
|
684
691
|
r?.abort(), r = void 0, i.dispose();
|
|
685
692
|
};
|
|
686
|
-
return i.onDispose(
|
|
693
|
+
return i.onDispose(k.on(e, A)), {
|
|
687
694
|
status: i,
|
|
688
695
|
value: c,
|
|
689
696
|
error: u,
|
|
690
|
-
loading:
|
|
691
|
-
cancel:
|
|
692
|
-
reload:
|
|
693
|
-
dispose:
|
|
697
|
+
loading: h,
|
|
698
|
+
cancel: f,
|
|
699
|
+
reload: g,
|
|
700
|
+
dispose: P
|
|
694
701
|
};
|
|
695
702
|
}, ue = (e, t) => {
|
|
696
|
-
const { status: n, dispose: s, reload: a
|
|
703
|
+
const { status: n, dispose: s, reload: a, loading: o } = e, {
|
|
704
|
+
notAsked: r,
|
|
705
|
+
pending: i,
|
|
706
|
+
failure: c,
|
|
707
|
+
success: u,
|
|
708
|
+
keepOnReload: h = !1
|
|
709
|
+
} = t, w = h ? n.map((f) => v.isLoading(f) && f.previousValue !== void 0 ? v.success(f.previousValue) : f) : n;
|
|
697
710
|
return R(
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
711
|
+
b(s),
|
|
712
|
+
xt(w, {
|
|
713
|
+
notAsked: r,
|
|
714
|
+
loading: i != null ? (f) => i({ previous: f, reload: a, cancel: e.cancel }) : void 0,
|
|
715
|
+
failure: c != null ? (f) => c({ error: f, reload: a }) : void 0,
|
|
716
|
+
success: (f) => u({ value: f, reload: a, loading: o })
|
|
703
717
|
})
|
|
704
718
|
);
|
|
705
|
-
},
|
|
719
|
+
}, Fe = ({
|
|
706
720
|
request: e,
|
|
707
721
|
load: t,
|
|
708
|
-
convertError: n = (
|
|
722
|
+
convertError: n = (w) => w,
|
|
709
723
|
onSuccess: s,
|
|
710
724
|
onError: a,
|
|
711
725
|
onSettled: o,
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
726
|
+
notAsked: r,
|
|
727
|
+
success: i,
|
|
728
|
+
pending: c,
|
|
729
|
+
failure: u,
|
|
730
|
+
keepOnReload: h
|
|
715
731
|
}) => {
|
|
716
|
-
const
|
|
732
|
+
const w = le({
|
|
717
733
|
request: e,
|
|
718
734
|
load: t,
|
|
719
735
|
convertError: n,
|
|
@@ -721,17 +737,23 @@ const ie = ({
|
|
|
721
737
|
onError: a,
|
|
722
738
|
onSettled: o
|
|
723
739
|
});
|
|
724
|
-
return ue(
|
|
740
|
+
return ue(w, {
|
|
741
|
+
notAsked: r,
|
|
742
|
+
success: i,
|
|
743
|
+
pending: c,
|
|
744
|
+
failure: u,
|
|
745
|
+
keepOnReload: h
|
|
746
|
+
});
|
|
725
747
|
}, he = (e, t) => {
|
|
726
748
|
if (typeof t == "function")
|
|
727
749
|
return he(e, { success: t });
|
|
728
750
|
const n = t.failure ?? ((a) => (a.on(console.error), a.map((o) => `Error: ${o}`))), s = t.success;
|
|
729
|
-
return
|
|
751
|
+
return mt(k.toSignal(e), {
|
|
730
752
|
Success: (a) => s(a.$.value),
|
|
731
753
|
Failure: (a) => n(a.$.error)
|
|
732
754
|
});
|
|
733
|
-
},
|
|
734
|
-
class
|
|
755
|
+
}, Ce = () => ft.focus((e) => e.target?.select());
|
|
756
|
+
class V {
|
|
735
757
|
/**
|
|
736
758
|
* Creates a new Rect instance.
|
|
737
759
|
*
|
|
@@ -785,7 +807,7 @@ class $ {
|
|
|
785
807
|
localLeft: o = 0,
|
|
786
808
|
localTop: r = 0
|
|
787
809
|
}) {
|
|
788
|
-
return new
|
|
810
|
+
return new V(t, n, s, a, o, r);
|
|
789
811
|
}
|
|
790
812
|
/**
|
|
791
813
|
* Gets the x-coordinate of the right edge of the rectangle.
|
|
@@ -917,11 +939,11 @@ class $ {
|
|
|
917
939
|
* console.log(rect1.equals(rect3)); // true (within tolerance)
|
|
918
940
|
* ```
|
|
919
941
|
*/
|
|
920
|
-
equals = (t) =>
|
|
942
|
+
equals = (t) => T(this.left, t.left) && T(this.top, t.top) && T(this.width, t.width) && T(this.height, t.height) && T(this.localLeft, t.localLeft) && T(this.localTop, t.localTop);
|
|
921
943
|
}
|
|
922
|
-
function
|
|
944
|
+
function ct(e) {
|
|
923
945
|
const t = e.getBoundingClientRect();
|
|
924
|
-
return
|
|
946
|
+
return V.of({
|
|
925
947
|
top: t.top + window.scrollY,
|
|
926
948
|
left: t.left + window.scrollX,
|
|
927
949
|
width: t.width,
|
|
@@ -930,27 +952,27 @@ function lt(e) {
|
|
|
930
952
|
localTop: e.offsetTop
|
|
931
953
|
});
|
|
932
954
|
}
|
|
933
|
-
const ze = (e) =>
|
|
934
|
-
const { element: n } = t, s =
|
|
955
|
+
const ze = (e) => Rt((t) => {
|
|
956
|
+
const { element: n } = t, s = x(ct(n), (i, c) => i.equals(c)), a = vt(e(s)).render(t), o = () => s.set(V.of(ct(n)));
|
|
935
957
|
let r = null;
|
|
936
|
-
return typeof ResizeObserver < "u" && (r = new ResizeObserver(o)), r?.observe(n),
|
|
958
|
+
return typeof ResizeObserver < "u" && (r = new ResizeObserver(o)), r?.observe(n), b((i) => {
|
|
937
959
|
r?.disconnect(), a(i);
|
|
938
960
|
});
|
|
939
961
|
});
|
|
940
|
-
function
|
|
962
|
+
function lt(e) {
|
|
941
963
|
return {
|
|
942
964
|
/* c8 ignore next 6 */
|
|
943
965
|
width: e?.innerWidth ?? 0,
|
|
944
966
|
height: e?.innerHeight ?? 0
|
|
945
967
|
};
|
|
946
968
|
}
|
|
947
|
-
const
|
|
948
|
-
const t =
|
|
949
|
-
|
|
969
|
+
const Ve = (e) => At(() => {
|
|
970
|
+
const t = K(), n = x(
|
|
971
|
+
lt(t),
|
|
950
972
|
(a, o) => a.width === o.width && a.height === o.height
|
|
951
|
-
), s = () => n.set(
|
|
973
|
+
), s = () => n.set(lt(t));
|
|
952
974
|
return t?.addEventListener("resize", s), R(
|
|
953
|
-
|
|
975
|
+
b(() => {
|
|
954
976
|
t?.removeEventListener("resize", s);
|
|
955
977
|
}),
|
|
956
978
|
e(n)
|
|
@@ -981,7 +1003,7 @@ const $e = (e) => Ht(() => {
|
|
|
981
1003
|
}
|
|
982
1004
|
}
|
|
983
1005
|
return n.length !== e.length ? null : { params: a, path: t };
|
|
984
|
-
},
|
|
1006
|
+
}, Pt = (e) => e.split("/").map((t) => {
|
|
985
1007
|
if (t.startsWith(":"))
|
|
986
1008
|
return { type: "param", name: t.slice(1) };
|
|
987
1009
|
if (t.startsWith("*")) {
|
|
@@ -989,9 +1011,9 @@ const $e = (e) => Ht(() => {
|
|
|
989
1011
|
return n != "" ? { type: "catch-all", name: n } : { type: "catch-all" };
|
|
990
1012
|
} else
|
|
991
1013
|
return { type: "literal", value: t };
|
|
992
|
-
}).filter((t) => t.type !== "literal" || t.value !== ""),
|
|
1014
|
+
}).filter((t) => t.type !== "literal" || t.value !== ""), $e = (e) => {
|
|
993
1015
|
const t = e.map((n) => {
|
|
994
|
-
const s =
|
|
1016
|
+
const s = Pt(n);
|
|
995
1017
|
return { route: n, segments: s };
|
|
996
1018
|
});
|
|
997
1019
|
return function(s) {
|
|
@@ -1065,10 +1087,10 @@ class fe {
|
|
|
1065
1087
|
this.getHandle().run(t, n);
|
|
1066
1088
|
}
|
|
1067
1089
|
}
|
|
1068
|
-
const
|
|
1090
|
+
const je = new fe(), q = {
|
|
1069
1091
|
mark: Q("RouterContext"),
|
|
1070
1092
|
create: () => {
|
|
1071
|
-
const e =
|
|
1093
|
+
const e = x([]);
|
|
1072
1094
|
return {
|
|
1073
1095
|
value: e,
|
|
1074
1096
|
dispose: () => e.dispose()
|
|
@@ -1089,11 +1111,11 @@ const Ve = new fe(), q = {
|
|
|
1089
1111
|
a[i.name] = c, o++;
|
|
1090
1112
|
else if (i.type === "catch-all") {
|
|
1091
1113
|
i.name && (a[i.name] = s.slice(o).join("/"));
|
|
1092
|
-
const u = "/" + s.slice(0, o).join("/"),
|
|
1114
|
+
const u = "/" + s.slice(0, o).join("/"), h = "/" + s.slice(o).join("/");
|
|
1093
1115
|
return {
|
|
1094
1116
|
params: a,
|
|
1095
1117
|
matchedPath: u === "/" ? "" : u,
|
|
1096
|
-
remainingPath:
|
|
1118
|
+
remainingPath: h === "/" ? "" : h,
|
|
1097
1119
|
route: t
|
|
1098
1120
|
};
|
|
1099
1121
|
}
|
|
@@ -1108,9 +1130,9 @@ const Ve = new fe(), q = {
|
|
|
1108
1130
|
};
|
|
1109
1131
|
}
|
|
1110
1132
|
return null;
|
|
1111
|
-
},
|
|
1133
|
+
}, Et = (e) => {
|
|
1112
1134
|
const t = e.map((n) => {
|
|
1113
|
-
const s =
|
|
1135
|
+
const s = Pt(n);
|
|
1114
1136
|
return { route: n, segments: s };
|
|
1115
1137
|
});
|
|
1116
1138
|
return function(s) {
|
|
@@ -1122,11 +1144,11 @@ const Ve = new fe(), q = {
|
|
|
1122
1144
|
return null;
|
|
1123
1145
|
};
|
|
1124
1146
|
}, _e = (e) => {
|
|
1125
|
-
const t =
|
|
1126
|
-
return
|
|
1147
|
+
const t = Et(Object.keys(e));
|
|
1148
|
+
return Ht(
|
|
1127
1149
|
q,
|
|
1128
1150
|
{},
|
|
1129
|
-
() =>
|
|
1151
|
+
() => N(G, (n) => N(q, (s) => {
|
|
1130
1152
|
const a = n.location.map((o) => {
|
|
1131
1153
|
const r = t(o.pathname);
|
|
1132
1154
|
if (r == null)
|
|
@@ -1145,7 +1167,7 @@ const Ve = new fe(), q = {
|
|
|
1145
1167
|
hash: o.hash
|
|
1146
1168
|
};
|
|
1147
1169
|
});
|
|
1148
|
-
return
|
|
1170
|
+
return yt(
|
|
1149
1171
|
a.map((o) => [o.route, o]),
|
|
1150
1172
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1151
1173
|
e
|
|
@@ -1153,8 +1175,8 @@ const Ve = new fe(), q = {
|
|
|
1153
1175
|
}))
|
|
1154
1176
|
);
|
|
1155
1177
|
}, Ie = (e) => {
|
|
1156
|
-
const t =
|
|
1157
|
-
return
|
|
1178
|
+
const t = Et(Object.keys(e));
|
|
1179
|
+
return N(q, (n) => N(G, (s) => {
|
|
1158
1180
|
const a = n.map((o) => {
|
|
1159
1181
|
const r = o[o.length - 1];
|
|
1160
1182
|
if (r == null)
|
|
@@ -1171,13 +1193,13 @@ const Ve = new fe(), q = {
|
|
|
1171
1193
|
hash: s.location.value.hash
|
|
1172
1194
|
};
|
|
1173
1195
|
});
|
|
1174
|
-
return
|
|
1196
|
+
return yt(
|
|
1175
1197
|
a.map((o) => [o.route, o]),
|
|
1176
1198
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1177
1199
|
e
|
|
1178
1200
|
);
|
|
1179
1201
|
}));
|
|
1180
|
-
}, z = 60 * 1e3, Y = 60 * z,
|
|
1202
|
+
}, z = 60 * 1e3, Y = 60 * z, F = 24 * Y, ut = 7 * F, ht = 30 * F, ge = 365 * F, ve = [
|
|
1181
1203
|
{
|
|
1182
1204
|
max: z * 90,
|
|
1183
1205
|
value: z,
|
|
@@ -1193,22 +1215,22 @@ const Ve = new fe(), q = {
|
|
|
1193
1215
|
future: { singular: "in an hour", plural: "in {} hours" }
|
|
1194
1216
|
},
|
|
1195
1217
|
{
|
|
1196
|
-
max:
|
|
1197
|
-
value:
|
|
1218
|
+
max: F * 10,
|
|
1219
|
+
value: F,
|
|
1198
1220
|
name: "day",
|
|
1199
1221
|
past: { singular: "yesterday", plural: "{} days ago" },
|
|
1200
1222
|
future: { singular: "tomorrow", plural: "in {} days" }
|
|
1201
1223
|
},
|
|
1202
1224
|
{
|
|
1203
|
-
max:
|
|
1204
|
-
value:
|
|
1225
|
+
max: ut * 6,
|
|
1226
|
+
value: ut,
|
|
1205
1227
|
name: "week",
|
|
1206
1228
|
past: { singular: "last week", plural: "{} weeks ago" },
|
|
1207
1229
|
future: { singular: "in a week", plural: "in {} weeks" }
|
|
1208
1230
|
},
|
|
1209
1231
|
{
|
|
1210
|
-
max:
|
|
1211
|
-
value:
|
|
1232
|
+
max: ht * 18,
|
|
1233
|
+
value: ht,
|
|
1212
1234
|
name: "month",
|
|
1213
1235
|
past: { singular: "last month", plural: "{} months ago" },
|
|
1214
1236
|
future: { singular: "in a month", plural: "in {} months" }
|
|
@@ -1221,7 +1243,7 @@ const Ve = new fe(), q = {
|
|
|
1221
1243
|
future: { singular: "in a year", plural: "in {} years" }
|
|
1222
1244
|
}
|
|
1223
1245
|
];
|
|
1224
|
-
function
|
|
1246
|
+
function dt(e, t, n, s) {
|
|
1225
1247
|
const a = Math.round(e / t);
|
|
1226
1248
|
return a <= 1 ? n : s.replace(
|
|
1227
1249
|
"{}",
|
|
@@ -1232,7 +1254,7 @@ function pt(e, t, n, s) {
|
|
|
1232
1254
|
);
|
|
1233
1255
|
}
|
|
1234
1256
|
const we = (e = 1e3) => {
|
|
1235
|
-
const t =
|
|
1257
|
+
const t = x(/* @__PURE__ */ new Date()), n = Ut(() => t.set(/* @__PURE__ */ new Date()), e);
|
|
1236
1258
|
return t.onDispose(n), t;
|
|
1237
1259
|
}, ye = (e) => {
|
|
1238
1260
|
const t = Math.abs(e);
|
|
@@ -1240,30 +1262,30 @@ const we = (e = 1e3) => {
|
|
|
1240
1262
|
return e < 0 ? "just now" : "in a moment";
|
|
1241
1263
|
for (const n of ve)
|
|
1242
1264
|
if (t < n.max)
|
|
1243
|
-
return e < 0 ?
|
|
1265
|
+
return e < 0 ? dt(t, n.value, n.past.singular, n.past.plural) : dt(t, n.value, n.future.singular, n.future.plural);
|
|
1244
1266
|
throw new Error("unreachable");
|
|
1245
1267
|
}, Se = (e, { now: t, frequency: n = 1e4 } = {}) => {
|
|
1246
|
-
const s = t != null ?
|
|
1268
|
+
const s = t != null ? pt.is(t) ? t.derive() : x(t) : we(n), a = J(
|
|
1247
1269
|
e,
|
|
1248
1270
|
s
|
|
1249
1271
|
)((o, r) => o.getTime() - r.getTime());
|
|
1250
|
-
return a.onDispose(() =>
|
|
1251
|
-
},
|
|
1272
|
+
return a.onDispose(() => k.dispose(s)), a;
|
|
1273
|
+
}, ke = (e, t = {}) => {
|
|
1252
1274
|
const n = Se(e, t), s = n.map(ye);
|
|
1253
1275
|
return s.onDispose(() => n.dispose()), s;
|
|
1254
|
-
}, Be = (e, t = {}) =>
|
|
1255
|
-
class xe extends
|
|
1276
|
+
}, Be = (e, t = {}) => ke(e, t);
|
|
1277
|
+
class xe extends Tt {
|
|
1256
1278
|
/**
|
|
1257
1279
|
* Triggers an update of the Ticker by incrementing its internal value.
|
|
1258
1280
|
* @returns void
|
|
1259
1281
|
*/
|
|
1260
1282
|
tick = () => this.update((t) => t + 1);
|
|
1261
1283
|
}
|
|
1262
|
-
const qe = (e = 0) => new xe(e,
|
|
1284
|
+
const qe = (e = 0) => new xe(e, Wt);
|
|
1263
1285
|
export {
|
|
1264
1286
|
te as Anchor,
|
|
1265
1287
|
Oe as Appearance,
|
|
1266
|
-
|
|
1288
|
+
xt as AsyncResultView,
|
|
1267
1289
|
Le as AutoFocus,
|
|
1268
1290
|
Re as AutoSelect,
|
|
1269
1291
|
Ie as ChildRouter,
|
|
@@ -1274,32 +1296,32 @@ export {
|
|
|
1274
1296
|
G as Location,
|
|
1275
1297
|
Me as Mutation,
|
|
1276
1298
|
ce as MutationDisplay,
|
|
1277
|
-
|
|
1299
|
+
je as NavigationService,
|
|
1278
1300
|
ae as OnClickOutside,
|
|
1279
1301
|
Ue as OnEnterKey,
|
|
1280
1302
|
Ke as OnEscapeKey,
|
|
1281
|
-
|
|
1303
|
+
bt as OnKeyPressed,
|
|
1282
1304
|
Ne as PopOver,
|
|
1283
|
-
|
|
1305
|
+
Fe as Query,
|
|
1284
1306
|
ue as QueryDisplay,
|
|
1285
|
-
|
|
1307
|
+
V as Rect,
|
|
1286
1308
|
he as ResultView,
|
|
1287
1309
|
_e as RootRouter,
|
|
1288
1310
|
q as RouterContextProvider,
|
|
1289
|
-
|
|
1311
|
+
Ce as SelectOnFocus,
|
|
1290
1312
|
xe as Ticker,
|
|
1291
1313
|
We as WhenInViewport,
|
|
1292
|
-
|
|
1293
|
-
|
|
1314
|
+
Ve as WindowSize,
|
|
1315
|
+
Vt as _checkExtensionCondition,
|
|
1294
1316
|
zt as _getExtension,
|
|
1295
|
-
|
|
1296
|
-
|
|
1317
|
+
$e as _makeRouteMatcher,
|
|
1318
|
+
Pt as _parseRouteSegments,
|
|
1297
1319
|
De as allPlacements,
|
|
1298
1320
|
_t as areLocationsEqual,
|
|
1299
1321
|
Ae as classes,
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1322
|
+
ot as evaluateLocationMatch,
|
|
1323
|
+
ct as getAbsoluteRect,
|
|
1324
|
+
jt as handleAnchorClick,
|
|
1303
1325
|
I as locationFromURL,
|
|
1304
1326
|
ie as makeMutationResource,
|
|
1305
1327
|
le as makeQueryResource,
|
|
@@ -1308,9 +1330,9 @@ export {
|
|
|
1308
1330
|
we as nowSignal,
|
|
1309
1331
|
Be as relativeTime,
|
|
1310
1332
|
Se as relativeTimeMillisSignal,
|
|
1311
|
-
|
|
1333
|
+
ke as relativeTimeSignal,
|
|
1312
1334
|
qe as ticker,
|
|
1313
1335
|
ye as timeDiffToString,
|
|
1314
|
-
|
|
1336
|
+
U as urlFromLocation,
|
|
1315
1337
|
ee as useAppearance
|
|
1316
1338
|
};
|