zudoku 0.0.0-eb5886a → 0.0.0-f114fe8
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/cli.js +2 -2
- package/dist/app/entry.client.js +2 -2
- package/dist/app/entry.client.js.map +1 -1
- package/dist/app/entry.server.js +0 -3
- package/dist/app/entry.server.js.map +1 -1
- package/dist/app/main.d.ts +0 -1
- package/dist/app/main.js +21 -6
- package/dist/app/main.js.map +1 -1
- package/dist/app/standalone.js.map +1 -1
- package/dist/cli/common/machine-id/lib.js.map +1 -1
- package/dist/cli/common/outdated.js.map +1 -1
- package/dist/cli/common/utils/box.js.map +1 -1
- package/dist/config/config.d.ts +1 -1
- package/dist/config/validators/SidebarSchema.d.ts +1 -1
- package/dist/config/validators/SidebarSchema.js +9 -5
- package/dist/config/validators/SidebarSchema.js.map +1 -1
- package/dist/config/validators/validate.d.ts +48 -62
- package/dist/config/validators/validate.js +5 -6
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/components/Header.js +1 -5
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/TopNavigation.js +4 -28
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/context/ZudokuContext.d.ts +12 -5
- package/dist/lib/components/context/ZudokuContext.js +20 -26
- package/dist/lib/components/context/ZudokuContext.js.map +1 -1
- package/dist/lib/components/index.d.ts +1 -1
- package/dist/lib/components/navigation/Sidebar.js +3 -3
- package/dist/lib/components/navigation/Sidebar.js.map +1 -1
- package/dist/lib/components/navigation/SidebarCategory.js +3 -1
- package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
- package/dist/lib/components/navigation/SidebarItem.js +3 -1
- package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
- package/dist/lib/components/navigation/utils.js +14 -10
- package/dist/lib/components/navigation/utils.js.map +1 -1
- package/dist/lib/core/DevPortalContext.d.ts +6 -3
- package/dist/lib/core/DevPortalContext.js.map +1 -1
- package/dist/lib/core/plugins.d.ts +0 -1
- package/dist/lib/core/plugins.js.map +1 -1
- package/dist/lib/plugins/markdown/generateRoutes.d.ts +3 -0
- package/dist/lib/plugins/markdown/generateRoutes.js +21 -0
- package/dist/lib/plugins/markdown/generateRoutes.js.map +1 -0
- package/dist/lib/plugins/markdown/index.d.ts +6 -5
- package/dist/lib/plugins/markdown/index.js +3 -31
- package/dist/lib/plugins/markdown/index.js.map +1 -1
- package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/client/worker.js.map +1 -1
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/ui/Button.d.ts +1 -1
- package/dist/lib/util/MdxComponents.d.ts +1 -1
- package/dist/lib/util/useScrollToAnchor.js.map +1 -1
- package/dist/vite/plugin-config-reload.js.map +1 -1
- package/dist/vite/plugin-docs.js +13 -19
- package/dist/vite/plugin-docs.js.map +1 -1
- package/dist/vite/plugin-sidebar.js +2 -5
- package/dist/vite/plugin-sidebar.js.map +1 -1
- package/lib/{AuthenticationPlugin-BFO0iXPa.js → AuthenticationPlugin-Bx9FK124.js} +2 -2
- package/lib/{AuthenticationPlugin-BFO0iXPa.js.map → AuthenticationPlugin-Bx9FK124.js.map} +1 -1
- package/lib/{Input-B2qMWklW.js → Input-CtVUl3eT.js} +3 -3
- package/lib/{Input-B2qMWklW.js.map → Input-CtVUl3eT.js.map} +1 -1
- package/lib/{MdxPage-aE7f-Uli.js → MdxPage-BqBWsXZ1.js} +24 -25
- package/lib/{MdxPage-aE7f-Uli.js.map → MdxPage-BqBWsXZ1.js.map} +1 -1
- package/lib/{OperationList-BcfWM4ir.js → OperationList-CYrmxPa8.js} +4 -4
- package/lib/OperationList-CYrmxPa8.js.map +1 -0
- package/lib/{Route-DzTbXYJ8.js → Route-Q5mqNQrv.js} +2 -2
- package/lib/{Route-DzTbXYJ8.js.map → Route-Q5mqNQrv.js.map} +1 -1
- package/lib/{SidebarBadge-1Mv5r_Vo.js → SidebarBadge-Dx7jtnoA.js} +2 -2
- package/lib/{SidebarBadge-1Mv5r_Vo.js.map → SidebarBadge-Dx7jtnoA.js.map} +1 -1
- package/lib/ZudokuContext-cr-pTRY1.js +1084 -0
- package/lib/ZudokuContext-cr-pTRY1.js.map +1 -0
- package/lib/assets/worker-Bcj4NA2p.js.map +1 -1
- package/lib/{index-DrrYONSc.js → index-BlJ2rj99.js} +419 -416
- package/lib/index-BlJ2rj99.js.map +1 -0
- package/lib/{index-Bwy2Len1.js → index-BngPzhKn.js} +3 -3
- package/lib/{index-Bwy2Len1.js.map → index-BngPzhKn.js.map} +1 -1
- package/lib/{index-DtahPCcC.js → index-Dolisrci.js} +2 -2
- package/lib/{index-DtahPCcC.js.map → index-Dolisrci.js.map} +1 -1
- package/lib/joinPath-B7kNnUX4.js +8 -0
- package/lib/joinPath-B7kNnUX4.js.map +1 -0
- package/lib/{AnchorLink-CnXSVkGB.js → utils-ByIc_KIM.js} +275 -231
- package/lib/utils-ByIc_KIM.js.map +1 -0
- package/lib/zudoku.auth-clerk.js +1 -1
- package/lib/zudoku.auth-openid.js +1 -1
- package/lib/zudoku.components.js +735 -745
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +3 -3
- package/lib/zudoku.plugin-markdown.js +27 -93
- package/lib/zudoku.plugin-markdown.js.map +1 -1
- package/lib/zudoku.plugin-openapi.js +5 -4
- package/lib/zudoku.plugin-openapi.js.map +1 -1
- package/package.json +1 -1
- package/src/app/entry.client.tsx +2 -4
- package/src/app/entry.server.tsx +0 -4
- package/src/app/main.tsx +25 -9
- package/src/app/standalone.tsx +1 -1
- package/src/lib/components/Header.tsx +2 -10
- package/src/lib/components/TopNavigation.tsx +15 -47
- package/src/lib/components/context/ZudokuContext.ts +20 -34
- package/src/lib/components/navigation/Sidebar.tsx +5 -5
- package/src/lib/components/navigation/SidebarCategory.tsx +3 -1
- package/src/lib/components/navigation/SidebarItem.tsx +3 -1
- package/src/lib/components/navigation/utils.ts +16 -11
- package/src/lib/core/DevPortalContext.ts +2 -3
- package/src/lib/core/plugins.ts +0 -2
- package/src/lib/plugins/markdown/generateRoutes.tsx +38 -0
- package/src/lib/plugins/markdown/index.tsx +12 -49
- package/src/lib/plugins/openapi/Endpoint.tsx +2 -2
- package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +1 -1
- package/src/lib/plugins/openapi/Sidecar.tsx +1 -1
- package/src/lib/plugins/openapi/client/worker.ts +2 -2
- package/src/lib/plugins/openapi/index.tsx +1 -1
- package/src/lib/util/useScrollToAnchor.ts +1 -1
- package/dist/lib/plugins/markdown/resolver.d.ts +0 -38
- package/dist/lib/plugins/markdown/resolver.js +0 -75
- package/dist/lib/plugins/markdown/resolver.js.map +0 -1
- package/dist/vite/debug.d.ts +0 -1
- package/dist/vite/debug.js +0 -10
- package/dist/vite/debug.js.map +0 -1
- package/lib/AnchorLink-CnXSVkGB.js.map +0 -1
- package/lib/OperationList-BcfWM4ir.js.map +0 -1
- package/lib/ZudokuContext-CSrx4lfi.js +0 -1134
- package/lib/ZudokuContext-CSrx4lfi.js.map +0 -1
- package/lib/__vite-browser-external-BYRIRx8p.js +0 -9
- package/lib/__vite-browser-external-BYRIRx8p.js.map +0 -1
- package/lib/index-DrrYONSc.js.map +0 -1
- package/src/lib/plugins/markdown/resolver.ts +0 -92
package/lib/zudoku.components.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Oo = Object.defineProperty;
|
|
2
2
|
var sn = (e) => {
|
|
3
3
|
throw TypeError(e);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var J = (e, t, n) =>
|
|
5
|
+
var Io = (e, t, n) => t in e ? Oo(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
6
|
+
var J = (e, t, n) => Io(e, typeof t != "symbol" ? t + "" : t, n), ln = (e, t, n) => t.has(e) || sn("Cannot " + n);
|
|
7
7
|
var b = (e, t, n) => (ln(e, t, "read from private field"), n ? n.call(e) : t.get(e)), ae = (e, t, n) => t.has(e) ? sn("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), G = (e, t, n, r) => (ln(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n);
|
|
8
|
-
var
|
|
8
|
+
var it = (e, t, n, r) => ({
|
|
9
9
|
set _(a) {
|
|
10
10
|
G(e, t, a, n);
|
|
11
11
|
},
|
|
@@ -13,28 +13,29 @@ var lt = (e, t, n, r) => ({
|
|
|
13
13
|
return b(e, t, r);
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
-
import {
|
|
17
|
-
import { e as
|
|
18
|
-
import { E as
|
|
16
|
+
import { c as Rn, H as _t, M as Ao, d as ko, A as $o, b as Lo } from "./utils-ByIc_KIM.js";
|
|
17
|
+
import { e as Fo, f as Ho, R as Uo, N as We, L as Ot, g as Bo, O as Dn, u as zo, b as It } from "./index-BG0g4WW0.js";
|
|
18
|
+
import { E as jn, S as Pe, a as Ko, R as Vo } from "./SlotletProvider-D3UD5Go3.js";
|
|
19
19
|
import { j as o } from "./jsx-runtime-B6kdoens.js";
|
|
20
|
-
import { M as
|
|
21
|
-
import { a as
|
|
22
|
-
import * as
|
|
23
|
-
import
|
|
24
|
-
import { a as
|
|
25
|
-
import { z as
|
|
26
|
-
import { a as
|
|
27
|
-
import { S as Un,
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
20
|
+
import { M as Qo, f as qo, c as Nn, o as Pn, A as Go, d as Ze, i as Wo, b as A, j as Yo, F as Xo, D as Jo, C as Zo, P as He, h as At, p as ea, r as Tn, R as ta, S as na, s as ra, g as oa, q as _n, l as aa, a as ht, u as On, V as In, m as cn, B as Rt } from "./index-Dolisrci.js";
|
|
21
|
+
import { a as O, c as An, b as sa, T as ia, d as la, V as ca, u as kt, e as ua, C as da } from "./Markdown-DapSf3wG.js";
|
|
22
|
+
import * as h from "react";
|
|
23
|
+
import g, { StrictMode as kn, createContext as $n, Component as fa, createElement as un, isValidElement as ha, useState as Te, useLayoutEffect as pa, useEffect as be, useCallback as Ln, Suspense as Fn, memo as Hn, useMemo as xt, useContext as ma, Fragment as ga, useRef as $t, forwardRef as va } from "react";
|
|
24
|
+
import { a as Lt } from "./_commonjsHelpers-BkfeUUK-.js";
|
|
25
|
+
import { z as wa } from "./router-D2p7Olpn.js";
|
|
26
|
+
import { a as Dt, R as ba, T as xa, C as ya } from "./index-BngPzhKn.js";
|
|
27
|
+
import { S as Un, f as Bn, Q as Ma, n as ee, m as dn, g as fn, i as ve, j as Sa, k as Ea, l as Ca, o as Ra, p as hn, r as pn, q as Da, h as mn, t as gn, v as ja, u as Ue, b as Na, Z as Pa, w as Ta, c as zn, x as _a } from "./ZudokuContext-cr-pTRY1.js";
|
|
28
|
+
import { j as Ft } from "./joinPath-B7kNnUX4.js";
|
|
29
|
+
import { ChevronRightIcon as Kn, CheckIcon as Oa, DotIcon as Ia, CircleXIcon as Aa, MenuIcon as ka, SearchIcon as $a, MoonStarIcon as La, SunIcon as Fa, ExternalLinkIcon as Ha, PanelLeftIcon as Ua } from "lucide-react";
|
|
30
|
+
import { c as Vn, P as gt, R as Ba, I as za, O as Ka, C as Va, T as Qa, a as qa, b as Ga, d as Wa, D as Ya, e as Xa, S as yt } from "./SidebarBadge-Dx7jtnoA.js";
|
|
30
31
|
import { S as Ja } from "./Spinner-3cQDBVGr.js";
|
|
31
32
|
function Za({ error: e }) {
|
|
32
|
-
return /* @__PURE__ */ o.jsx(
|
|
33
|
+
return /* @__PURE__ */ o.jsx(jn, { error: e });
|
|
33
34
|
}
|
|
34
|
-
var
|
|
35
|
-
const es = /* @__PURE__ */
|
|
36
|
-
Object.defineProperty(
|
|
37
|
-
var rs =
|
|
35
|
+
var et = {};
|
|
36
|
+
const es = /* @__PURE__ */ Lt(wa), ts = /* @__PURE__ */ Lt(Fo), ns = /* @__PURE__ */ Lt(Ho);
|
|
37
|
+
Object.defineProperty(et, "__esModule", { value: !0 });
|
|
38
|
+
var rs = g, fe = es, Ht = ts, we = ns;
|
|
38
39
|
function os(e) {
|
|
39
40
|
if (e && e.__esModule) return e;
|
|
40
41
|
var t = /* @__PURE__ */ Object.create(null);
|
|
@@ -90,12 +91,12 @@ function ss({
|
|
|
90
91
|
basename: e.basename || "/"
|
|
91
92
|
}, s = /* @__PURE__ */ new Map(), i = "";
|
|
92
93
|
if (n !== !1) {
|
|
93
|
-
let
|
|
94
|
+
let u = {
|
|
94
95
|
loaderData: e.loaderData,
|
|
95
96
|
actionData: e.actionData,
|
|
96
97
|
errors: ls(e.errors)
|
|
97
98
|
};
|
|
98
|
-
i = `window.__staticRouterHydrationData = JSON.parse(${ps(JSON.stringify(JSON.stringify(
|
|
99
|
+
i = `window.__staticRouterHydrationData = JSON.parse(${ps(JSON.stringify(JSON.stringify(u)))});`;
|
|
99
100
|
}
|
|
100
101
|
let {
|
|
101
102
|
state: l
|
|
@@ -185,10 +186,10 @@ function cs(e, t) {
|
|
|
185
186
|
}
|
|
186
187
|
function us(e, t, n = {}) {
|
|
187
188
|
let r = {}, a = fe.UNSAFE_convertRoutesToDataRoutes(e, Ht.UNSAFE_mapRouteProperties, void 0, r), s = t.matches.map((l) => {
|
|
188
|
-
let
|
|
189
|
+
let u = r[l.route.id] || l.route;
|
|
189
190
|
return {
|
|
190
191
|
...l,
|
|
191
|
-
route:
|
|
192
|
+
route: u
|
|
192
193
|
};
|
|
193
194
|
}), i = (l) => `You cannot use router.${l}() on the server because it is a stateless environment`;
|
|
194
195
|
return {
|
|
@@ -196,13 +197,13 @@ function us(e, t, n = {}) {
|
|
|
196
197
|
return t.basename;
|
|
197
198
|
},
|
|
198
199
|
get future() {
|
|
199
|
-
var l,
|
|
200
|
+
var l, u;
|
|
200
201
|
return {
|
|
201
202
|
v7_fetcherPersist: !1,
|
|
202
203
|
v7_normalizeFormMethod: !1,
|
|
203
204
|
v7_partialHydration: ((l = n.future) == null ? void 0 : l.v7_partialHydration) === !0,
|
|
204
205
|
v7_prependBasename: !1,
|
|
205
|
-
v7_relativeSplatPath: ((
|
|
206
|
+
v7_relativeSplatPath: ((u = n.future) == null ? void 0 : u.v7_relativeSplatPath) === !0,
|
|
206
207
|
v7_skipActionErrorRevalidation: !1
|
|
207
208
|
};
|
|
208
209
|
},
|
|
@@ -296,19 +297,19 @@ const ds = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, fs = {
|
|
|
296
297
|
function ps(e) {
|
|
297
298
|
return e.replace(hs, (t) => fs[t]);
|
|
298
299
|
}
|
|
299
|
-
|
|
300
|
-
var ms =
|
|
301
|
-
|
|
302
|
-
|
|
300
|
+
et.StaticRouter = as;
|
|
301
|
+
var ms = et.StaticRouterProvider = ss;
|
|
302
|
+
et.createStaticHandler = cs;
|
|
303
|
+
et.createStaticRouter = us;
|
|
303
304
|
const gs = ({
|
|
304
305
|
router: e,
|
|
305
306
|
hydrate: t = !1
|
|
306
|
-
}) => /* @__PURE__ */ o.jsx(kn, { children: /* @__PURE__ */ o.jsx(Rn, { children: /* @__PURE__ */ o.jsx(
|
|
307
|
+
}) => /* @__PURE__ */ o.jsx(kn, { children: /* @__PURE__ */ o.jsx(Rn, { children: /* @__PURE__ */ o.jsx(Dt.Provider, { value: { stagger: !t }, children: /* @__PURE__ */ o.jsx(Uo, { router: e }) }) }) }), vs = ({
|
|
307
308
|
router: e,
|
|
308
309
|
context: t,
|
|
309
310
|
helmetContext: n
|
|
310
311
|
}) => /* @__PURE__ */ o.jsx(kn, { children: /* @__PURE__ */ o.jsx(Rn, { context: n, children: /* @__PURE__ */ o.jsx(ms, { router: e, context: t }) }) });
|
|
311
|
-
var de,
|
|
312
|
+
var de, Sn, ws = (Sn = class extends Un {
|
|
312
313
|
constructor(t = {}) {
|
|
313
314
|
super();
|
|
314
315
|
ae(this, de);
|
|
@@ -317,7 +318,7 @@ var de, Mn, ws = (Mn = class extends Un {
|
|
|
317
318
|
build(t, n, r) {
|
|
318
319
|
const a = n.queryKey, s = n.queryHash ?? Bn(a, n);
|
|
319
320
|
let i = this.get(s);
|
|
320
|
-
return i || (i = new
|
|
321
|
+
return i || (i = new Ma({
|
|
321
322
|
cache: this,
|
|
322
323
|
queryKey: a,
|
|
323
324
|
queryHash: s,
|
|
@@ -380,29 +381,29 @@ var de, Mn, ws = (Mn = class extends Un {
|
|
|
380
381
|
});
|
|
381
382
|
});
|
|
382
383
|
}
|
|
383
|
-
}, de = new WeakMap(),
|
|
384
|
+
}, de = new WeakMap(), Sn), Z, Je, En, bs = (En = class extends Un {
|
|
384
385
|
constructor(t = {}) {
|
|
385
386
|
super();
|
|
386
387
|
ae(this, Z);
|
|
387
|
-
ae(this,
|
|
388
|
-
this.config = t, G(this, Z, /* @__PURE__ */ new Map()), G(this,
|
|
388
|
+
ae(this, Je);
|
|
389
|
+
this.config = t, G(this, Z, /* @__PURE__ */ new Map()), G(this, Je, Date.now());
|
|
389
390
|
}
|
|
390
391
|
build(t, n, r) {
|
|
391
|
-
const a = new
|
|
392
|
+
const a = new Qo({
|
|
392
393
|
mutationCache: this,
|
|
393
|
-
mutationId: ++
|
|
394
|
+
mutationId: ++it(this, Je)._,
|
|
394
395
|
options: t.defaultMutationOptions(n),
|
|
395
396
|
state: r
|
|
396
397
|
});
|
|
397
398
|
return this.add(a), a;
|
|
398
399
|
}
|
|
399
400
|
add(t) {
|
|
400
|
-
const n =
|
|
401
|
+
const n = lt(t), r = b(this, Z).get(n) ?? [];
|
|
401
402
|
r.push(t), b(this, Z).set(n, r), this.notify({ type: "added", mutation: t });
|
|
402
403
|
}
|
|
403
404
|
remove(t) {
|
|
404
405
|
var r;
|
|
405
|
-
const n =
|
|
406
|
+
const n = lt(t);
|
|
406
407
|
if (b(this, Z).has(n)) {
|
|
407
408
|
const a = (r = b(this, Z).get(n)) == null ? void 0 : r.filter((s) => s !== t);
|
|
408
409
|
a && (a.length === 0 ? b(this, Z).delete(n) : b(this, Z).set(n, a));
|
|
@@ -411,12 +412,12 @@ var de, Mn, ws = (Mn = class extends Un {
|
|
|
411
412
|
}
|
|
412
413
|
canRun(t) {
|
|
413
414
|
var r;
|
|
414
|
-
const n = (r = b(this, Z).get(
|
|
415
|
+
const n = (r = b(this, Z).get(lt(t))) == null ? void 0 : r.find((a) => a.state.status === "pending");
|
|
415
416
|
return !n || n === t;
|
|
416
417
|
}
|
|
417
418
|
runNext(t) {
|
|
418
419
|
var r;
|
|
419
|
-
const n = (r = b(this, Z).get(
|
|
420
|
+
const n = (r = b(this, Z).get(lt(t))) == null ? void 0 : r.find((a) => a !== t && a.state.isPaused);
|
|
420
421
|
return (n == null ? void 0 : n.continue()) ?? Promise.resolve();
|
|
421
422
|
}
|
|
422
423
|
clear() {
|
|
@@ -453,8 +454,8 @@ var de, Mn, ws = (Mn = class extends Un {
|
|
|
453
454
|
)
|
|
454
455
|
);
|
|
455
456
|
}
|
|
456
|
-
}, Z = new WeakMap(),
|
|
457
|
-
function
|
|
457
|
+
}, Z = new WeakMap(), Je = new WeakMap(), En);
|
|
458
|
+
function lt(e) {
|
|
458
459
|
var t;
|
|
459
460
|
return ((t = e.options.scope) == null ? void 0 : t.id) ?? String(e.mutationId);
|
|
460
461
|
}
|
|
@@ -463,54 +464,54 @@ function xs(e) {
|
|
|
463
464
|
onFetch: (t, n) => {
|
|
464
465
|
const r = async () => {
|
|
465
466
|
var y, R, K, H, q;
|
|
466
|
-
const a = t.options, s = (K = (R = (y = t.fetchOptions) == null ? void 0 : y.meta) == null ? void 0 : R.fetchMore) == null ? void 0 : K.direction, i = ((H = t.state.data) == null ? void 0 : H.pages) || [], l = ((q = t.state.data) == null ? void 0 : q.pageParams) || [],
|
|
467
|
-
let
|
|
467
|
+
const a = t.options, s = (K = (R = (y = t.fetchOptions) == null ? void 0 : y.meta) == null ? void 0 : R.fetchMore) == null ? void 0 : K.direction, i = ((H = t.state.data) == null ? void 0 : H.pages) || [], l = ((q = t.state.data) == null ? void 0 : q.pageParams) || [], u = { pages: [], pageParams: [] };
|
|
468
|
+
let v = !1;
|
|
468
469
|
const m = (x) => {
|
|
469
470
|
Object.defineProperty(x, "signal", {
|
|
470
471
|
enumerable: !0,
|
|
471
|
-
get: () => (t.signal.aborted ?
|
|
472
|
-
|
|
472
|
+
get: () => (t.signal.aborted ? v = !0 : t.signal.addEventListener("abort", () => {
|
|
473
|
+
v = !0;
|
|
473
474
|
}), t.signal)
|
|
474
475
|
});
|
|
475
|
-
}, c = Sa(t.options, t.fetchOptions),
|
|
476
|
-
if (
|
|
476
|
+
}, c = Sa(t.options, t.fetchOptions), d = async (x, p, C) => {
|
|
477
|
+
if (v)
|
|
477
478
|
return Promise.reject();
|
|
478
479
|
if (p == null && x.pages.length)
|
|
479
480
|
return Promise.resolve(x);
|
|
480
|
-
const
|
|
481
|
+
const N = {
|
|
481
482
|
queryKey: t.queryKey,
|
|
482
483
|
pageParam: p,
|
|
483
|
-
direction:
|
|
484
|
+
direction: C ? "backward" : "forward",
|
|
484
485
|
meta: t.options.meta
|
|
485
486
|
};
|
|
486
|
-
m(
|
|
487
|
+
m(N);
|
|
487
488
|
const P = await c(
|
|
488
|
-
|
|
489
|
-
), { maxPages: _ } = t.options, w =
|
|
489
|
+
N
|
|
490
|
+
), { maxPages: _ } = t.options, w = C ? Ea : Ca;
|
|
490
491
|
return {
|
|
491
492
|
pages: w(x.pages, P, _),
|
|
492
493
|
pageParams: w(x.pageParams, p, _)
|
|
493
494
|
};
|
|
494
495
|
};
|
|
495
|
-
let
|
|
496
|
+
let f;
|
|
496
497
|
if (s && i.length) {
|
|
497
|
-
const x = s === "backward", p = x ? ys : vn,
|
|
498
|
+
const x = s === "backward", p = x ? ys : vn, C = {
|
|
498
499
|
pages: i,
|
|
499
500
|
pageParams: l
|
|
500
|
-
},
|
|
501
|
-
|
|
501
|
+
}, N = p(a, C);
|
|
502
|
+
f = await d(C, N, x);
|
|
502
503
|
} else {
|
|
503
|
-
|
|
504
|
-
|
|
504
|
+
f = await d(
|
|
505
|
+
u,
|
|
505
506
|
l[0] ?? a.initialPageParam
|
|
506
507
|
);
|
|
507
508
|
const x = e ?? i.length;
|
|
508
509
|
for (let p = 1; p < x; p++) {
|
|
509
|
-
const
|
|
510
|
-
|
|
510
|
+
const C = vn(a, f);
|
|
511
|
+
f = await d(f, C);
|
|
511
512
|
}
|
|
512
513
|
}
|
|
513
|
-
return
|
|
514
|
+
return f;
|
|
514
515
|
};
|
|
515
516
|
t.options.persister ? t.fetchFn = () => {
|
|
516
517
|
var a, s;
|
|
@@ -547,34 +548,34 @@ function ys(e, { pages: t, pageParams: n }) {
|
|
|
547
548
|
n
|
|
548
549
|
);
|
|
549
550
|
}
|
|
550
|
-
var $,
|
|
551
|
+
var $, Se, Ee, ke, $e, Ce, Le, Fe, Cn, Ms = (Cn = class {
|
|
551
552
|
constructor(e = {}) {
|
|
552
553
|
ae(this, $);
|
|
553
|
-
ae(this,
|
|
554
|
-
ae(this,
|
|
554
|
+
ae(this, Se);
|
|
555
|
+
ae(this, Ee);
|
|
556
|
+
ae(this, ke);
|
|
555
557
|
ae(this, $e);
|
|
558
|
+
ae(this, Ce);
|
|
556
559
|
ae(this, Le);
|
|
557
|
-
ae(this, Ee);
|
|
558
560
|
ae(this, Fe);
|
|
559
|
-
|
|
560
|
-
G(this, $, e.queryCache || new ws()), G(this, Me, e.mutationCache || new bs()), G(this, Ce, e.defaultOptions || {}), G(this, $e, /* @__PURE__ */ new Map()), G(this, Le, /* @__PURE__ */ new Map()), G(this, Ee, 0);
|
|
561
|
+
G(this, $, e.queryCache || new ws()), G(this, Se, e.mutationCache || new bs()), G(this, Ee, e.defaultOptions || {}), G(this, ke, /* @__PURE__ */ new Map()), G(this, $e, /* @__PURE__ */ new Map()), G(this, Ce, 0);
|
|
561
562
|
}
|
|
562
563
|
mount() {
|
|
563
|
-
|
|
564
|
+
it(this, Ce)._++, b(this, Ce) === 1 && (G(this, Le, Ra.subscribe(async (e) => {
|
|
564
565
|
e && (await this.resumePausedMutations(), b(this, $).onFocus());
|
|
565
|
-
})), G(this,
|
|
566
|
+
})), G(this, Fe, hn.subscribe(async (e) => {
|
|
566
567
|
e && (await this.resumePausedMutations(), b(this, $).onOnline());
|
|
567
568
|
})));
|
|
568
569
|
}
|
|
569
570
|
unmount() {
|
|
570
571
|
var e, t;
|
|
571
|
-
|
|
572
|
+
it(this, Ce)._--, b(this, Ce) === 0 && ((e = b(this, Le)) == null || e.call(this), G(this, Le, void 0), (t = b(this, Fe)) == null || t.call(this), G(this, Fe, void 0));
|
|
572
573
|
}
|
|
573
574
|
isFetching(e) {
|
|
574
575
|
return b(this, $).findAll({ ...e, fetchStatus: "fetching" }).length;
|
|
575
576
|
}
|
|
576
577
|
isMutating(e) {
|
|
577
|
-
return b(this,
|
|
578
|
+
return b(this, Se).findAll({ ...e, status: "pending" }).length;
|
|
578
579
|
}
|
|
579
580
|
getQueryData(e) {
|
|
580
581
|
var n;
|
|
@@ -599,7 +600,7 @@ var $, Me, Ce, $e, Le, Ee, Fe, He, En, Ss = (En = class {
|
|
|
599
600
|
setQueryData(e, t, n) {
|
|
600
601
|
const r = this.defaultQueryOptions({ queryKey: e }), a = b(this, $).get(
|
|
601
602
|
r.queryHash
|
|
602
|
-
), s = a == null ? void 0 : a.state.data, i =
|
|
603
|
+
), s = a == null ? void 0 : a.state.data, i = Da(t, s);
|
|
603
604
|
if (i !== void 0)
|
|
604
605
|
return b(this, $).build(this, r).setData(i, { ...n, manual: !0 });
|
|
605
606
|
}
|
|
@@ -682,41 +683,41 @@ var $, Me, Ce, $e, Le, Ee, Fe, He, En, Ss = (En = class {
|
|
|
682
683
|
return this.fetchInfiniteQuery(e).then(ve).catch(ve);
|
|
683
684
|
}
|
|
684
685
|
resumePausedMutations() {
|
|
685
|
-
return hn.isOnline() ? b(this,
|
|
686
|
+
return hn.isOnline() ? b(this, Se).resumePausedMutations() : Promise.resolve();
|
|
686
687
|
}
|
|
687
688
|
getQueryCache() {
|
|
688
689
|
return b(this, $);
|
|
689
690
|
}
|
|
690
691
|
getMutationCache() {
|
|
691
|
-
return b(this,
|
|
692
|
+
return b(this, Se);
|
|
692
693
|
}
|
|
693
694
|
getDefaultOptions() {
|
|
694
|
-
return b(this,
|
|
695
|
+
return b(this, Ee);
|
|
695
696
|
}
|
|
696
697
|
setDefaultOptions(e) {
|
|
697
|
-
G(this,
|
|
698
|
+
G(this, Ee, e);
|
|
698
699
|
}
|
|
699
700
|
setQueryDefaults(e, t) {
|
|
700
|
-
b(this,
|
|
701
|
+
b(this, ke).set(mn(e), {
|
|
701
702
|
queryKey: e,
|
|
702
703
|
defaultOptions: t
|
|
703
704
|
});
|
|
704
705
|
}
|
|
705
706
|
getQueryDefaults(e) {
|
|
706
|
-
const t = [...b(this,
|
|
707
|
+
const t = [...b(this, ke).values()];
|
|
707
708
|
let n = {};
|
|
708
709
|
return t.forEach((r) => {
|
|
709
710
|
gn(e, r.queryKey) && (n = { ...n, ...r.defaultOptions });
|
|
710
711
|
}), n;
|
|
711
712
|
}
|
|
712
713
|
setMutationDefaults(e, t) {
|
|
713
|
-
b(this,
|
|
714
|
+
b(this, $e).set(mn(e), {
|
|
714
715
|
mutationKey: e,
|
|
715
716
|
defaultOptions: t
|
|
716
717
|
});
|
|
717
718
|
}
|
|
718
719
|
getMutationDefaults(e) {
|
|
719
|
-
const t = [...b(this,
|
|
720
|
+
const t = [...b(this, $e).values()];
|
|
720
721
|
let n = {};
|
|
721
722
|
return t.forEach((r) => {
|
|
722
723
|
gn(e, r.mutationKey) && (n = { ...n, ...r.defaultOptions });
|
|
@@ -726,7 +727,7 @@ var $, Me, Ce, $e, Le, Ee, Fe, He, En, Ss = (En = class {
|
|
|
726
727
|
if (e._defaulted)
|
|
727
728
|
return e;
|
|
728
729
|
const t = {
|
|
729
|
-
...b(this,
|
|
730
|
+
...b(this, Ee).queries,
|
|
730
731
|
...this.getQueryDefaults(e.queryKey),
|
|
731
732
|
...e,
|
|
732
733
|
_defaulted: !0
|
|
@@ -734,25 +735,25 @@ var $, Me, Ce, $e, Le, Ee, Fe, He, En, Ss = (En = class {
|
|
|
734
735
|
return t.queryHash || (t.queryHash = Bn(
|
|
735
736
|
t.queryKey,
|
|
736
737
|
t
|
|
737
|
-
)), t.refetchOnReconnect === void 0 && (t.refetchOnReconnect = t.networkMode !== "always"), t.throwOnError === void 0 && (t.throwOnError = !!t.suspense), !t.networkMode && t.persister && (t.networkMode = "offlineFirst"), t.enabled !== !0 && t.queryFn ===
|
|
738
|
+
)), t.refetchOnReconnect === void 0 && (t.refetchOnReconnect = t.networkMode !== "always"), t.throwOnError === void 0 && (t.throwOnError = !!t.suspense), !t.networkMode && t.persister && (t.networkMode = "offlineFirst"), t.enabled !== !0 && t.queryFn === ja && (t.enabled = !1), t;
|
|
738
739
|
}
|
|
739
740
|
defaultMutationOptions(e) {
|
|
740
741
|
return e != null && e._defaulted ? e : {
|
|
741
|
-
...b(this,
|
|
742
|
+
...b(this, Ee).mutations,
|
|
742
743
|
...(e == null ? void 0 : e.mutationKey) && this.getMutationDefaults(e.mutationKey),
|
|
743
744
|
...e,
|
|
744
745
|
_defaulted: !0
|
|
745
746
|
};
|
|
746
747
|
}
|
|
747
748
|
clear() {
|
|
748
|
-
b(this, $).clear(), b(this,
|
|
749
|
+
b(this, $).clear(), b(this, Se).clear();
|
|
749
750
|
}
|
|
750
|
-
}, $ = new WeakMap(),
|
|
751
|
-
const
|
|
751
|
+
}, $ = new WeakMap(), Se = new WeakMap(), Ee = new WeakMap(), ke = new WeakMap(), $e = new WeakMap(), Ce = new WeakMap(), Le = new WeakMap(), Fe = new WeakMap(), Cn);
|
|
752
|
+
const Ss = $n(null), Mt = {
|
|
752
753
|
didCatch: !1,
|
|
753
754
|
error: null
|
|
754
755
|
};
|
|
755
|
-
class
|
|
756
|
+
class Es extends fa {
|
|
756
757
|
constructor(t) {
|
|
757
758
|
super(t), this.resetErrorBoundary = this.resetErrorBoundary.bind(this), this.state = Mt;
|
|
758
759
|
}
|
|
@@ -785,7 +786,7 @@ class Cs extends da {
|
|
|
785
786
|
} = this.state, {
|
|
786
787
|
resetKeys: a
|
|
787
788
|
} = this.props;
|
|
788
|
-
if (r && n.error !== null &&
|
|
789
|
+
if (r && n.error !== null && Cs(t.resetKeys, a)) {
|
|
789
790
|
var s, i;
|
|
790
791
|
(s = (i = this.props).onReset) === null || s === void 0 || s.call(i, {
|
|
791
792
|
next: a,
|
|
@@ -806,20 +807,20 @@ class Cs extends da {
|
|
|
806
807
|
} = this.state;
|
|
807
808
|
let l = t;
|
|
808
809
|
if (s) {
|
|
809
|
-
const
|
|
810
|
+
const u = {
|
|
810
811
|
error: i,
|
|
811
812
|
resetErrorBoundary: this.resetErrorBoundary
|
|
812
813
|
};
|
|
813
814
|
if (typeof n == "function")
|
|
814
|
-
l = n(
|
|
815
|
+
l = n(u);
|
|
815
816
|
else if (r)
|
|
816
|
-
l = un(r,
|
|
817
|
-
else if (a === null ||
|
|
817
|
+
l = un(r, u);
|
|
818
|
+
else if (a === null || ha(a))
|
|
818
819
|
l = a;
|
|
819
820
|
else
|
|
820
821
|
throw i;
|
|
821
822
|
}
|
|
822
|
-
return un(
|
|
823
|
+
return un(Ss.Provider, {
|
|
823
824
|
value: {
|
|
824
825
|
didCatch: s,
|
|
825
826
|
error: i,
|
|
@@ -828,12 +829,12 @@ class Cs extends da {
|
|
|
828
829
|
}, l);
|
|
829
830
|
}
|
|
830
831
|
}
|
|
831
|
-
function
|
|
832
|
+
function Cs() {
|
|
832
833
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
|
|
833
834
|
return e.length !== t.length || e.some((n, r) => !Object.is(n, t[r]));
|
|
834
835
|
}
|
|
835
|
-
const Rs = (e) => "getProfileMenuItems" in e && typeof e.getProfileMenuItems == "function", Ds = (e) => "getRoutes" in e && typeof e.getRoutes == "function",
|
|
836
|
-
class
|
|
836
|
+
const Rs = (e) => "getProfileMenuItems" in e && typeof e.getProfileMenuItems == "function", Ds = (e) => "getRoutes" in e && typeof e.getRoutes == "function", js = (e) => "renderSearch" in e && typeof e.renderSearch == "function", Ns = (e) => "initialize" in e && typeof e.initialize == "function", Ps = (e) => "getHead" in e && typeof e.getHead == "function", Ts = (e) => "getMdxComponents" in e && typeof e.getMdxComponents == "function", _s = (e) => "getIdentities" in e && typeof e.getIdentities == "function", Wn = new Ms();
|
|
837
|
+
class Os {
|
|
837
838
|
constructor(t) {
|
|
838
839
|
J(this, "plugins");
|
|
839
840
|
J(this, "sidebars");
|
|
@@ -844,7 +845,7 @@ class Is {
|
|
|
844
845
|
J(this, "navigationPlugins");
|
|
845
846
|
J(this, "initialize", async () => {
|
|
846
847
|
await Promise.all(
|
|
847
|
-
this.plugins.filter(
|
|
848
|
+
this.plugins.filter(Ns).map((t) => {
|
|
848
849
|
var n;
|
|
849
850
|
return (n = t.initialize) == null ? void 0 : n.call(t, this);
|
|
850
851
|
})
|
|
@@ -860,7 +861,7 @@ class Is {
|
|
|
860
861
|
this.navigationPlugins.map(
|
|
861
862
|
(r) => {
|
|
862
863
|
var a;
|
|
863
|
-
return (a = r.getSidebar) == null ? void 0 : a.call(r,
|
|
864
|
+
return (a = r.getSidebar) == null ? void 0 : a.call(r, Ft(t));
|
|
864
865
|
}
|
|
865
866
|
)
|
|
866
867
|
)).flatMap((r) => r ?? []));
|
|
@@ -873,29 +874,29 @@ class Is {
|
|
|
873
874
|
this.plugins = t.plugins ?? [], this.topNavigation = t.topNavigation ?? [], this.sidebars = t.sidebars ?? {}, this.navigationPlugins = this.plugins.filter(Ds), this.authentication = t.authentication, this.meta = t.metadata, this.page = t.page;
|
|
874
875
|
}
|
|
875
876
|
}
|
|
876
|
-
function
|
|
877
|
-
return /* @__PURE__ */ o.jsx(
|
|
877
|
+
function Is({ error: e, resetErrorBoundary: t }) {
|
|
878
|
+
return /* @__PURE__ */ o.jsx(jn, { error: e });
|
|
878
879
|
}
|
|
879
|
-
const
|
|
880
|
-
(!
|
|
880
|
+
const ct = globalThis;
|
|
881
|
+
(!ct.requestIdleCallback || !ct.cancelIdleCallback) && (ct.requestIdleCallback = (e) => setTimeout(e, 1), ct.cancelIdleCallback = clearTimeout);
|
|
881
882
|
var jt = ["Enter", " "], As = ["ArrowDown", "PageUp", "Home"], Yn = ["ArrowUp", "PageDown", "End"], ks = [...As, ...Yn], $s = {
|
|
882
883
|
ltr: [...jt, "ArrowRight"],
|
|
883
884
|
rtl: [...jt, "ArrowLeft"]
|
|
884
885
|
}, Ls = {
|
|
885
886
|
ltr: ["ArrowLeft"],
|
|
886
887
|
rtl: ["ArrowRight"]
|
|
887
|
-
},
|
|
888
|
+
}, tt = "Menu", [Ye, Fs, Hs] = qo(tt), [_e, Xn] = Nn(tt, [
|
|
888
889
|
Hs,
|
|
889
890
|
Pn,
|
|
890
891
|
Vn
|
|
891
|
-
]),
|
|
892
|
-
const { __scopeMenu: t, open: n = !1, children: r, dir: a, onOpenChange: s, modal: i = !0 } = e, l =
|
|
893
|
-
return
|
|
894
|
-
const
|
|
892
|
+
]), nt = Pn(), Jn = Vn(), [Zn, Re] = _e(tt), [Us, rt] = _e(tt), er = (e) => {
|
|
893
|
+
const { __scopeMenu: t, open: n = !1, children: r, dir: a, onOpenChange: s, modal: i = !0 } = e, l = nt(t), [u, v] = h.useState(null), m = h.useRef(!1), c = At(s), d = oa(a);
|
|
894
|
+
return h.useEffect(() => {
|
|
895
|
+
const f = () => {
|
|
895
896
|
m.current = !0, document.addEventListener("pointerdown", y, { capture: !0, once: !0 }), document.addEventListener("pointermove", y, { capture: !0, once: !0 });
|
|
896
897
|
}, y = () => m.current = !1;
|
|
897
|
-
return document.addEventListener("keydown",
|
|
898
|
-
document.removeEventListener("keydown",
|
|
898
|
+
return document.addEventListener("keydown", f, { capture: !0 }), () => {
|
|
899
|
+
document.removeEventListener("keydown", f, { capture: !0 }), document.removeEventListener("pointerdown", y, { capture: !0 }), document.removeEventListener("pointermove", y, { capture: !0 });
|
|
899
900
|
};
|
|
900
901
|
}, []), /* @__PURE__ */ o.jsx(_n, { ...l, children: /* @__PURE__ */ o.jsx(
|
|
901
902
|
Zn,
|
|
@@ -903,15 +904,15 @@ var jt = ["Enter", " "], As = ["ArrowDown", "PageUp", "Home"], Yn = ["ArrowUp",
|
|
|
903
904
|
scope: t,
|
|
904
905
|
open: n,
|
|
905
906
|
onOpenChange: c,
|
|
906
|
-
content:
|
|
907
|
-
onContentChange:
|
|
907
|
+
content: u,
|
|
908
|
+
onContentChange: v,
|
|
908
909
|
children: /* @__PURE__ */ o.jsx(
|
|
909
910
|
Us,
|
|
910
911
|
{
|
|
911
912
|
scope: t,
|
|
912
|
-
onClose:
|
|
913
|
+
onClose: h.useCallback(() => c(!1), [c]),
|
|
913
914
|
isUsingKeyboardRef: m,
|
|
914
|
-
dir:
|
|
915
|
+
dir: d,
|
|
915
916
|
modal: i,
|
|
916
917
|
children: r
|
|
917
918
|
}
|
|
@@ -919,32 +920,32 @@ var jt = ["Enter", " "], As = ["ArrowDown", "PageUp", "Home"], Yn = ["ArrowUp",
|
|
|
919
920
|
}
|
|
920
921
|
) });
|
|
921
922
|
};
|
|
922
|
-
er.displayName =
|
|
923
|
-
var Bs = "MenuAnchor", Ut =
|
|
923
|
+
er.displayName = tt;
|
|
924
|
+
var Bs = "MenuAnchor", Ut = h.forwardRef(
|
|
924
925
|
(e, t) => {
|
|
925
|
-
const { __scopeMenu: n, ...r } = e, a =
|
|
926
|
-
return /* @__PURE__ */ o.jsx(
|
|
926
|
+
const { __scopeMenu: n, ...r } = e, a = nt(n);
|
|
927
|
+
return /* @__PURE__ */ o.jsx(Go, { ...a, ...r, ref: t });
|
|
927
928
|
}
|
|
928
929
|
);
|
|
929
930
|
Ut.displayName = Bs;
|
|
930
|
-
var Bt = "MenuPortal", [zs, tr] =
|
|
931
|
+
var Bt = "MenuPortal", [zs, tr] = _e(Bt, {
|
|
931
932
|
forceMount: void 0
|
|
932
933
|
}), nr = (e) => {
|
|
933
934
|
const { __scopeMenu: t, forceMount: n, children: r, container: a } = e, s = Re(Bt, t);
|
|
934
|
-
return /* @__PURE__ */ o.jsx(zs, { scope: t, forceMount: n, children: /* @__PURE__ */ o.jsx(
|
|
935
|
+
return /* @__PURE__ */ o.jsx(zs, { scope: t, forceMount: n, children: /* @__PURE__ */ o.jsx(gt, { present: n || s.open, children: /* @__PURE__ */ o.jsx(aa, { asChild: !0, container: a, children: r }) }) });
|
|
935
936
|
};
|
|
936
937
|
nr.displayName = Bt;
|
|
937
|
-
var se = "MenuContent", [Ks, zt] =
|
|
938
|
+
var se = "MenuContent", [Ks, zt] = _e(se), rr = h.forwardRef(
|
|
938
939
|
(e, t) => {
|
|
939
|
-
const n = tr(se, e.__scopeMenu), { forceMount: r = n.forceMount, ...a } = e, s = Re(se, e.__scopeMenu), i =
|
|
940
|
-
return /* @__PURE__ */ o.jsx(
|
|
940
|
+
const n = tr(se, e.__scopeMenu), { forceMount: r = n.forceMount, ...a } = e, s = Re(se, e.__scopeMenu), i = rt(se, e.__scopeMenu);
|
|
941
|
+
return /* @__PURE__ */ o.jsx(Ye.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ o.jsx(gt, { present: r || s.open, children: /* @__PURE__ */ o.jsx(Ye.Slot, { scope: e.__scopeMenu, children: i.modal ? /* @__PURE__ */ o.jsx(Vs, { ...a, ref: t }) : /* @__PURE__ */ o.jsx(Qs, { ...a, ref: t }) }) }) });
|
|
941
942
|
}
|
|
942
|
-
), Vs =
|
|
943
|
+
), Vs = h.forwardRef(
|
|
943
944
|
(e, t) => {
|
|
944
|
-
const n = Re(se, e.__scopeMenu), r =
|
|
945
|
-
return
|
|
945
|
+
const n = Re(se, e.__scopeMenu), r = h.useRef(null), a = Ze(t, r);
|
|
946
|
+
return h.useEffect(() => {
|
|
946
947
|
const s = r.current;
|
|
947
|
-
if (s) return
|
|
948
|
+
if (s) return Wo(s);
|
|
948
949
|
}, []), /* @__PURE__ */ o.jsx(
|
|
949
950
|
Kt,
|
|
950
951
|
{
|
|
@@ -962,7 +963,7 @@ var se = "MenuContent", [Ks, zt] = Ie(se), rr = f.forwardRef(
|
|
|
962
963
|
}
|
|
963
964
|
);
|
|
964
965
|
}
|
|
965
|
-
), Qs =
|
|
966
|
+
), Qs = h.forwardRef((e, t) => {
|
|
966
967
|
const n = Re(se, e.__scopeMenu);
|
|
967
968
|
return /* @__PURE__ */ o.jsx(
|
|
968
969
|
Kt,
|
|
@@ -975,7 +976,7 @@ var se = "MenuContent", [Ks, zt] = Ie(se), rr = f.forwardRef(
|
|
|
975
976
|
onDismiss: () => n.onOpenChange(!1)
|
|
976
977
|
}
|
|
977
978
|
);
|
|
978
|
-
}), Kt =
|
|
979
|
+
}), Kt = h.forwardRef(
|
|
979
980
|
(e, t) => {
|
|
980
981
|
const {
|
|
981
982
|
__scopeMenu: n,
|
|
@@ -984,74 +985,74 @@ var se = "MenuContent", [Ks, zt] = Ie(se), rr = f.forwardRef(
|
|
|
984
985
|
onOpenAutoFocus: s,
|
|
985
986
|
onCloseAutoFocus: i,
|
|
986
987
|
disableOutsidePointerEvents: l,
|
|
987
|
-
onEntryFocus:
|
|
988
|
-
onEscapeKeyDown:
|
|
988
|
+
onEntryFocus: u,
|
|
989
|
+
onEscapeKeyDown: v,
|
|
989
990
|
onPointerDownOutside: m,
|
|
990
991
|
onFocusOutside: c,
|
|
991
|
-
onInteractOutside:
|
|
992
|
-
onDismiss:
|
|
992
|
+
onInteractOutside: d,
|
|
993
|
+
onDismiss: f,
|
|
993
994
|
disableOutsideScroll: y,
|
|
994
995
|
...R
|
|
995
|
-
} = e, K = Re(se, n), H =
|
|
996
|
+
} = e, K = Re(se, n), H = rt(se, n), q = nt(n), x = Jn(n), p = Fs(n), [C, N] = h.useState(null), P = h.useRef(null), _ = Ze(t, P, K.onContentChange), w = h.useRef(0), L = h.useRef(""), te = h.useRef(0), Q = h.useRef(null), V = h.useRef("right"), X = h.useRef(0), Oe = y ? ta : h.Fragment, he = y ? { as: na, allowPinchZoom: !0 } : void 0, Be = (E) => {
|
|
996
997
|
var le, ge;
|
|
997
|
-
const U = L.current +
|
|
998
|
-
(function re(
|
|
999
|
-
L.current =
|
|
998
|
+
const U = L.current + E, Y = p().filter((re) => !re.disabled), ne = document.activeElement, De = (le = Y.find((re) => re.ref.current === ne)) == null ? void 0 : le.textValue, pe = Y.map((re) => re.textValue), ye = oi(pe, U, De), me = (ge = Y.find((re) => re.textValue === ye)) == null ? void 0 : ge.ref.current;
|
|
999
|
+
(function re(M) {
|
|
1000
|
+
L.current = M, window.clearTimeout(w.current), M !== "" && (w.current = window.setTimeout(() => re(""), 1e3));
|
|
1000
1001
|
})(U), me && setTimeout(() => me.focus());
|
|
1001
1002
|
};
|
|
1002
|
-
|
|
1003
|
-
const xe =
|
|
1003
|
+
h.useEffect(() => () => window.clearTimeout(w.current), []), Yo();
|
|
1004
|
+
const xe = h.useCallback((E) => {
|
|
1004
1005
|
var Y, ne;
|
|
1005
|
-
return V.current === ((Y = Q.current) == null ? void 0 : Y.side) && si(
|
|
1006
|
+
return V.current === ((Y = Q.current) == null ? void 0 : Y.side) && si(E, (ne = Q.current) == null ? void 0 : ne.area);
|
|
1006
1007
|
}, []);
|
|
1007
1008
|
return /* @__PURE__ */ o.jsx(
|
|
1008
1009
|
Ks,
|
|
1009
1010
|
{
|
|
1010
1011
|
scope: n,
|
|
1011
1012
|
searchRef: L,
|
|
1012
|
-
onItemEnter:
|
|
1013
|
-
(
|
|
1014
|
-
xe(
|
|
1013
|
+
onItemEnter: h.useCallback(
|
|
1014
|
+
(E) => {
|
|
1015
|
+
xe(E) && E.preventDefault();
|
|
1015
1016
|
},
|
|
1016
1017
|
[xe]
|
|
1017
1018
|
),
|
|
1018
|
-
onItemLeave:
|
|
1019
|
-
(
|
|
1019
|
+
onItemLeave: h.useCallback(
|
|
1020
|
+
(E) => {
|
|
1020
1021
|
var U;
|
|
1021
|
-
xe(
|
|
1022
|
+
xe(E) || ((U = P.current) == null || U.focus(), N(null));
|
|
1022
1023
|
},
|
|
1023
1024
|
[xe]
|
|
1024
1025
|
),
|
|
1025
|
-
onTriggerLeave:
|
|
1026
|
-
(
|
|
1027
|
-
xe(
|
|
1026
|
+
onTriggerLeave: h.useCallback(
|
|
1027
|
+
(E) => {
|
|
1028
|
+
xe(E) && E.preventDefault();
|
|
1028
1029
|
},
|
|
1029
1030
|
[xe]
|
|
1030
1031
|
),
|
|
1031
1032
|
pointerGraceTimerRef: te,
|
|
1032
|
-
onPointerGraceIntentChange:
|
|
1033
|
-
Q.current =
|
|
1033
|
+
onPointerGraceIntentChange: h.useCallback((E) => {
|
|
1034
|
+
Q.current = E;
|
|
1034
1035
|
}, []),
|
|
1035
1036
|
children: /* @__PURE__ */ o.jsx(Oe, { ...he, children: /* @__PURE__ */ o.jsx(
|
|
1036
|
-
|
|
1037
|
+
Xo,
|
|
1037
1038
|
{
|
|
1038
1039
|
asChild: !0,
|
|
1039
1040
|
trapped: a,
|
|
1040
|
-
onMountAutoFocus: A(s, (
|
|
1041
|
+
onMountAutoFocus: A(s, (E) => {
|
|
1041
1042
|
var U;
|
|
1042
|
-
|
|
1043
|
+
E.preventDefault(), (U = P.current) == null || U.focus({ preventScroll: !0 });
|
|
1043
1044
|
}),
|
|
1044
1045
|
onUnmountAutoFocus: i,
|
|
1045
1046
|
children: /* @__PURE__ */ o.jsx(
|
|
1046
|
-
|
|
1047
|
+
Jo,
|
|
1047
1048
|
{
|
|
1048
1049
|
asChild: !0,
|
|
1049
1050
|
disableOutsidePointerEvents: l,
|
|
1050
|
-
onEscapeKeyDown:
|
|
1051
|
+
onEscapeKeyDown: v,
|
|
1051
1052
|
onPointerDownOutside: m,
|
|
1052
1053
|
onFocusOutside: c,
|
|
1053
|
-
onInteractOutside:
|
|
1054
|
-
onDismiss:
|
|
1054
|
+
onInteractOutside: d,
|
|
1055
|
+
onDismiss: f,
|
|
1055
1056
|
children: /* @__PURE__ */ o.jsx(
|
|
1056
1057
|
Ba,
|
|
1057
1058
|
{
|
|
@@ -1060,14 +1061,14 @@ var se = "MenuContent", [Ks, zt] = Ie(se), rr = f.forwardRef(
|
|
|
1060
1061
|
dir: H.dir,
|
|
1061
1062
|
orientation: "vertical",
|
|
1062
1063
|
loop: r,
|
|
1063
|
-
currentTabStopId:
|
|
1064
|
-
onCurrentTabStopIdChange:
|
|
1065
|
-
onEntryFocus: A(
|
|
1066
|
-
H.isUsingKeyboardRef.current ||
|
|
1064
|
+
currentTabStopId: C,
|
|
1065
|
+
onCurrentTabStopIdChange: N,
|
|
1066
|
+
onEntryFocus: A(u, (E) => {
|
|
1067
|
+
H.isUsingKeyboardRef.current || E.preventDefault();
|
|
1067
1068
|
}),
|
|
1068
1069
|
preventScrollOnEntryFocus: !0,
|
|
1069
1070
|
children: /* @__PURE__ */ o.jsx(
|
|
1070
|
-
|
|
1071
|
+
Zo,
|
|
1071
1072
|
{
|
|
1072
1073
|
role: "menu",
|
|
1073
1074
|
"aria-orientation": "vertical",
|
|
@@ -1078,25 +1079,25 @@ var se = "MenuContent", [Ks, zt] = Ie(se), rr = f.forwardRef(
|
|
|
1078
1079
|
...R,
|
|
1079
1080
|
ref: _,
|
|
1080
1081
|
style: { outline: "none", ...R.style },
|
|
1081
|
-
onKeyDown: A(R.onKeyDown, (
|
|
1082
|
-
const Y =
|
|
1083
|
-
Y && (
|
|
1082
|
+
onKeyDown: A(R.onKeyDown, (E) => {
|
|
1083
|
+
const Y = E.target.closest("[data-radix-menu-content]") === E.currentTarget, ne = E.ctrlKey || E.altKey || E.metaKey, De = E.key.length === 1;
|
|
1084
|
+
Y && (E.key === "Tab" && E.preventDefault(), !ne && De && Be(E.key));
|
|
1084
1085
|
const pe = P.current;
|
|
1085
|
-
if (
|
|
1086
|
-
|
|
1086
|
+
if (E.target !== pe || !ks.includes(E.key)) return;
|
|
1087
|
+
E.preventDefault();
|
|
1087
1088
|
const me = p().filter((le) => !le.disabled).map((le) => le.ref.current);
|
|
1088
|
-
Yn.includes(
|
|
1089
|
+
Yn.includes(E.key) && me.reverse(), ni(me);
|
|
1089
1090
|
}),
|
|
1090
|
-
onBlur: A(e.onBlur, (
|
|
1091
|
-
|
|
1091
|
+
onBlur: A(e.onBlur, (E) => {
|
|
1092
|
+
E.currentTarget.contains(E.target) || (window.clearTimeout(w.current), L.current = "");
|
|
1092
1093
|
}),
|
|
1093
1094
|
onPointerMove: A(
|
|
1094
1095
|
e.onPointerMove,
|
|
1095
|
-
|
|
1096
|
-
const U =
|
|
1097
|
-
if (
|
|
1098
|
-
const ne =
|
|
1099
|
-
V.current = ne, X.current =
|
|
1096
|
+
Xe((E) => {
|
|
1097
|
+
const U = E.target, Y = X.current !== E.clientX;
|
|
1098
|
+
if (E.currentTarget.contains(U) && Y) {
|
|
1099
|
+
const ne = E.clientX > X.current ? "right" : "left";
|
|
1100
|
+
V.current = ne, X.current = E.clientX;
|
|
1100
1101
|
}
|
|
1101
1102
|
})
|
|
1102
1103
|
)
|
|
@@ -1113,83 +1114,83 @@ var se = "MenuContent", [Ks, zt] = Ie(se), rr = f.forwardRef(
|
|
|
1113
1114
|
}
|
|
1114
1115
|
);
|
|
1115
1116
|
rr.displayName = se;
|
|
1116
|
-
var qs = "MenuGroup", Vt =
|
|
1117
|
+
var qs = "MenuGroup", Vt = h.forwardRef(
|
|
1117
1118
|
(e, t) => {
|
|
1118
1119
|
const { __scopeMenu: n, ...r } = e;
|
|
1119
|
-
return /* @__PURE__ */ o.jsx(
|
|
1120
|
+
return /* @__PURE__ */ o.jsx(He.div, { role: "group", ...r, ref: t });
|
|
1120
1121
|
}
|
|
1121
1122
|
);
|
|
1122
1123
|
Vt.displayName = qs;
|
|
1123
|
-
var Gs = "MenuLabel", or =
|
|
1124
|
+
var Gs = "MenuLabel", or = h.forwardRef(
|
|
1124
1125
|
(e, t) => {
|
|
1125
1126
|
const { __scopeMenu: n, ...r } = e;
|
|
1126
|
-
return /* @__PURE__ */ o.jsx(
|
|
1127
|
+
return /* @__PURE__ */ o.jsx(He.div, { ...r, ref: t });
|
|
1127
1128
|
}
|
|
1128
1129
|
);
|
|
1129
1130
|
or.displayName = Gs;
|
|
1130
|
-
var
|
|
1131
|
+
var pt = "MenuItem", wn = "menu.itemSelect", vt = h.forwardRef(
|
|
1131
1132
|
(e, t) => {
|
|
1132
|
-
const { disabled: n = !1, onSelect: r, ...a } = e, s =
|
|
1133
|
+
const { disabled: n = !1, onSelect: r, ...a } = e, s = h.useRef(null), i = rt(pt, e.__scopeMenu), l = zt(pt, e.__scopeMenu), u = Ze(t, s), v = h.useRef(!1), m = () => {
|
|
1133
1134
|
const c = s.current;
|
|
1134
1135
|
if (!n && c) {
|
|
1135
|
-
const
|
|
1136
|
-
c.addEventListener(wn, (
|
|
1136
|
+
const d = new CustomEvent(wn, { bubbles: !0, cancelable: !0 });
|
|
1137
|
+
c.addEventListener(wn, (f) => r == null ? void 0 : r(f), { once: !0 }), ra(c, d), d.defaultPrevented ? v.current = !1 : i.onClose();
|
|
1137
1138
|
}
|
|
1138
1139
|
};
|
|
1139
1140
|
return /* @__PURE__ */ o.jsx(
|
|
1140
1141
|
ar,
|
|
1141
1142
|
{
|
|
1142
1143
|
...a,
|
|
1143
|
-
ref:
|
|
1144
|
+
ref: u,
|
|
1144
1145
|
disabled: n,
|
|
1145
1146
|
onClick: A(e.onClick, m),
|
|
1146
1147
|
onPointerDown: (c) => {
|
|
1147
|
-
var
|
|
1148
|
-
(
|
|
1148
|
+
var d;
|
|
1149
|
+
(d = e.onPointerDown) == null || d.call(e, c), v.current = !0;
|
|
1149
1150
|
},
|
|
1150
1151
|
onPointerUp: A(e.onPointerUp, (c) => {
|
|
1151
|
-
var
|
|
1152
|
-
|
|
1152
|
+
var d;
|
|
1153
|
+
v.current || (d = c.currentTarget) == null || d.click();
|
|
1153
1154
|
}),
|
|
1154
1155
|
onKeyDown: A(e.onKeyDown, (c) => {
|
|
1155
|
-
const
|
|
1156
|
-
n ||
|
|
1156
|
+
const d = l.searchRef.current !== "";
|
|
1157
|
+
n || d && c.key === " " || jt.includes(c.key) && (c.currentTarget.click(), c.preventDefault());
|
|
1157
1158
|
})
|
|
1158
1159
|
}
|
|
1159
1160
|
);
|
|
1160
1161
|
}
|
|
1161
1162
|
);
|
|
1162
|
-
|
|
1163
|
-
var ar =
|
|
1163
|
+
vt.displayName = pt;
|
|
1164
|
+
var ar = h.forwardRef(
|
|
1164
1165
|
(e, t) => {
|
|
1165
|
-
const { __scopeMenu: n, disabled: r = !1, textValue: a, ...s } = e, i = zt(
|
|
1166
|
-
return
|
|
1167
|
-
const y =
|
|
1168
|
-
y &&
|
|
1166
|
+
const { __scopeMenu: n, disabled: r = !1, textValue: a, ...s } = e, i = zt(pt, n), l = Jn(n), u = h.useRef(null), v = Ze(t, u), [m, c] = h.useState(!1), [d, f] = h.useState("");
|
|
1167
|
+
return h.useEffect(() => {
|
|
1168
|
+
const y = u.current;
|
|
1169
|
+
y && f((y.textContent ?? "").trim());
|
|
1169
1170
|
}, [s.children]), /* @__PURE__ */ o.jsx(
|
|
1170
|
-
|
|
1171
|
+
Ye.ItemSlot,
|
|
1171
1172
|
{
|
|
1172
1173
|
scope: n,
|
|
1173
1174
|
disabled: r,
|
|
1174
|
-
textValue: a ??
|
|
1175
|
+
textValue: a ?? d,
|
|
1175
1176
|
children: /* @__PURE__ */ o.jsx(za, { asChild: !0, ...l, focusable: !r, children: /* @__PURE__ */ o.jsx(
|
|
1176
|
-
|
|
1177
|
+
He.div,
|
|
1177
1178
|
{
|
|
1178
1179
|
role: "menuitem",
|
|
1179
1180
|
"data-highlighted": m ? "" : void 0,
|
|
1180
1181
|
"aria-disabled": r || void 0,
|
|
1181
1182
|
"data-disabled": r ? "" : void 0,
|
|
1182
1183
|
...s,
|
|
1183
|
-
ref:
|
|
1184
|
+
ref: v,
|
|
1184
1185
|
onPointerMove: A(
|
|
1185
1186
|
e.onPointerMove,
|
|
1186
|
-
|
|
1187
|
+
Xe((y) => {
|
|
1187
1188
|
r ? i.onItemLeave(y) : (i.onItemEnter(y), y.defaultPrevented || y.currentTarget.focus({ preventScroll: !0 }));
|
|
1188
1189
|
})
|
|
1189
1190
|
),
|
|
1190
1191
|
onPointerLeave: A(
|
|
1191
1192
|
e.onPointerLeave,
|
|
1192
|
-
|
|
1193
|
+
Xe((y) => i.onItemLeave(y))
|
|
1193
1194
|
),
|
|
1194
1195
|
onFocus: A(e.onFocus, () => c(!0)),
|
|
1195
1196
|
onBlur: A(e.onBlur, () => c(!1))
|
|
@@ -1198,20 +1199,20 @@ var ar = f.forwardRef(
|
|
|
1198
1199
|
}
|
|
1199
1200
|
);
|
|
1200
1201
|
}
|
|
1201
|
-
), Ws = "MenuCheckboxItem", sr =
|
|
1202
|
+
), Ws = "MenuCheckboxItem", sr = h.forwardRef(
|
|
1202
1203
|
(e, t) => {
|
|
1203
1204
|
const { checked: n = !1, onCheckedChange: r, ...a } = e;
|
|
1204
1205
|
return /* @__PURE__ */ o.jsx(dr, { scope: e.__scopeMenu, checked: n, children: /* @__PURE__ */ o.jsx(
|
|
1205
|
-
|
|
1206
|
+
vt,
|
|
1206
1207
|
{
|
|
1207
1208
|
role: "menuitemcheckbox",
|
|
1208
|
-
"aria-checked":
|
|
1209
|
+
"aria-checked": mt(n) ? "mixed" : n,
|
|
1209
1210
|
...a,
|
|
1210
1211
|
ref: t,
|
|
1211
1212
|
"data-state": Gt(n),
|
|
1212
1213
|
onSelect: A(
|
|
1213
1214
|
a.onSelect,
|
|
1214
|
-
() => r == null ? void 0 : r(
|
|
1215
|
+
() => r == null ? void 0 : r(mt(n) ? !0 : !n),
|
|
1215
1216
|
{ checkForDefaultPrevented: !1 }
|
|
1216
1217
|
)
|
|
1217
1218
|
}
|
|
@@ -1219,22 +1220,22 @@ var ar = f.forwardRef(
|
|
|
1219
1220
|
}
|
|
1220
1221
|
);
|
|
1221
1222
|
sr.displayName = Ws;
|
|
1222
|
-
var ir = "MenuRadioGroup", [Ys, Xs] =
|
|
1223
|
+
var ir = "MenuRadioGroup", [Ys, Xs] = _e(
|
|
1223
1224
|
ir,
|
|
1224
1225
|
{ value: void 0, onValueChange: () => {
|
|
1225
1226
|
} }
|
|
1226
|
-
), lr =
|
|
1227
|
+
), lr = h.forwardRef(
|
|
1227
1228
|
(e, t) => {
|
|
1228
|
-
const { value: n, onValueChange: r, ...a } = e, s =
|
|
1229
|
+
const { value: n, onValueChange: r, ...a } = e, s = At(r);
|
|
1229
1230
|
return /* @__PURE__ */ o.jsx(Ys, { scope: e.__scopeMenu, value: n, onValueChange: s, children: /* @__PURE__ */ o.jsx(Vt, { ...a, ref: t }) });
|
|
1230
1231
|
}
|
|
1231
1232
|
);
|
|
1232
1233
|
lr.displayName = ir;
|
|
1233
|
-
var cr = "MenuRadioItem", ur =
|
|
1234
|
+
var cr = "MenuRadioItem", ur = h.forwardRef(
|
|
1234
1235
|
(e, t) => {
|
|
1235
1236
|
const { value: n, ...r } = e, a = Xs(cr, e.__scopeMenu), s = n === a.value;
|
|
1236
1237
|
return /* @__PURE__ */ o.jsx(dr, { scope: e.__scopeMenu, checked: s, children: /* @__PURE__ */ o.jsx(
|
|
1237
|
-
|
|
1238
|
+
vt,
|
|
1238
1239
|
{
|
|
1239
1240
|
role: "menuitemradio",
|
|
1240
1241
|
"aria-checked": s,
|
|
@@ -1254,18 +1255,18 @@ var cr = "MenuRadioItem", ur = f.forwardRef(
|
|
|
1254
1255
|
}
|
|
1255
1256
|
);
|
|
1256
1257
|
ur.displayName = cr;
|
|
1257
|
-
var Qt = "MenuItemIndicator", [dr, Js] =
|
|
1258
|
+
var Qt = "MenuItemIndicator", [dr, Js] = _e(
|
|
1258
1259
|
Qt,
|
|
1259
1260
|
{ checked: !1 }
|
|
1260
|
-
), fr =
|
|
1261
|
+
), fr = h.forwardRef(
|
|
1261
1262
|
(e, t) => {
|
|
1262
1263
|
const { __scopeMenu: n, forceMount: r, ...a } = e, s = Js(Qt, n);
|
|
1263
1264
|
return /* @__PURE__ */ o.jsx(
|
|
1264
|
-
|
|
1265
|
+
gt,
|
|
1265
1266
|
{
|
|
1266
|
-
present: r ||
|
|
1267
|
+
present: r || mt(s.checked) || s.checked === !0,
|
|
1267
1268
|
children: /* @__PURE__ */ o.jsx(
|
|
1268
|
-
|
|
1269
|
+
He.span,
|
|
1269
1270
|
{
|
|
1270
1271
|
...a,
|
|
1271
1272
|
ref: t,
|
|
@@ -1277,11 +1278,11 @@ var Qt = "MenuItemIndicator", [dr, Js] = Ie(
|
|
|
1277
1278
|
}
|
|
1278
1279
|
);
|
|
1279
1280
|
fr.displayName = Qt;
|
|
1280
|
-
var Zs = "MenuSeparator", hr =
|
|
1281
|
+
var Zs = "MenuSeparator", hr = h.forwardRef(
|
|
1281
1282
|
(e, t) => {
|
|
1282
1283
|
const { __scopeMenu: n, ...r } = e;
|
|
1283
1284
|
return /* @__PURE__ */ o.jsx(
|
|
1284
|
-
|
|
1285
|
+
He.div,
|
|
1285
1286
|
{
|
|
1286
1287
|
role: "separator",
|
|
1287
1288
|
"aria-orientation": "horizontal",
|
|
@@ -1292,31 +1293,31 @@ var Zs = "MenuSeparator", hr = f.forwardRef(
|
|
|
1292
1293
|
}
|
|
1293
1294
|
);
|
|
1294
1295
|
hr.displayName = Zs;
|
|
1295
|
-
var ei = "MenuArrow", pr =
|
|
1296
|
+
var ei = "MenuArrow", pr = h.forwardRef(
|
|
1296
1297
|
(e, t) => {
|
|
1297
|
-
const { __scopeMenu: n, ...r } = e, a =
|
|
1298
|
-
return /* @__PURE__ */ o.jsx(
|
|
1298
|
+
const { __scopeMenu: n, ...r } = e, a = nt(n);
|
|
1299
|
+
return /* @__PURE__ */ o.jsx(ea, { ...a, ...r, ref: t });
|
|
1299
1300
|
}
|
|
1300
1301
|
);
|
|
1301
1302
|
pr.displayName = ei;
|
|
1302
|
-
var qt = "MenuSub", [ti, mr] =
|
|
1303
|
-
const { __scopeMenu: t, children: n, open: r = !1, onOpenChange: a } = e, s = Re(qt, t), i =
|
|
1304
|
-
return
|
|
1303
|
+
var qt = "MenuSub", [ti, mr] = _e(qt), gr = (e) => {
|
|
1304
|
+
const { __scopeMenu: t, children: n, open: r = !1, onOpenChange: a } = e, s = Re(qt, t), i = nt(t), [l, u] = h.useState(null), [v, m] = h.useState(null), c = At(a);
|
|
1305
|
+
return h.useEffect(() => (s.open === !1 && c(!1), () => c(!1)), [s.open, c]), /* @__PURE__ */ o.jsx(_n, { ...i, children: /* @__PURE__ */ o.jsx(
|
|
1305
1306
|
Zn,
|
|
1306
1307
|
{
|
|
1307
1308
|
scope: t,
|
|
1308
1309
|
open: r,
|
|
1309
1310
|
onOpenChange: c,
|
|
1310
|
-
content:
|
|
1311
|
+
content: v,
|
|
1311
1312
|
onContentChange: m,
|
|
1312
1313
|
children: /* @__PURE__ */ o.jsx(
|
|
1313
1314
|
ti,
|
|
1314
1315
|
{
|
|
1315
1316
|
scope: t,
|
|
1316
|
-
contentId:
|
|
1317
|
-
triggerId:
|
|
1317
|
+
contentId: ht(),
|
|
1318
|
+
triggerId: ht(),
|
|
1318
1319
|
trigger: l,
|
|
1319
|
-
onTriggerChange:
|
|
1320
|
+
onTriggerChange: u,
|
|
1320
1321
|
children: n
|
|
1321
1322
|
}
|
|
1322
1323
|
)
|
|
@@ -1324,17 +1325,17 @@ var qt = "MenuSub", [ti, mr] = Ie(qt), gr = (e) => {
|
|
|
1324
1325
|
) });
|
|
1325
1326
|
};
|
|
1326
1327
|
gr.displayName = qt;
|
|
1327
|
-
var qe = "MenuSubTrigger", vr =
|
|
1328
|
+
var qe = "MenuSubTrigger", vr = h.forwardRef(
|
|
1328
1329
|
(e, t) => {
|
|
1329
|
-
const n = Re(qe, e.__scopeMenu), r =
|
|
1330
|
+
const n = Re(qe, e.__scopeMenu), r = rt(qe, e.__scopeMenu), a = mr(qe, e.__scopeMenu), s = zt(qe, e.__scopeMenu), i = h.useRef(null), { pointerGraceTimerRef: l, onPointerGraceIntentChange: u } = s, v = { __scopeMenu: e.__scopeMenu }, m = h.useCallback(() => {
|
|
1330
1331
|
i.current && window.clearTimeout(i.current), i.current = null;
|
|
1331
1332
|
}, []);
|
|
1332
|
-
return
|
|
1333
|
+
return h.useEffect(() => m, [m]), h.useEffect(() => {
|
|
1333
1334
|
const c = l.current;
|
|
1334
1335
|
return () => {
|
|
1335
|
-
window.clearTimeout(c),
|
|
1336
|
+
window.clearTimeout(c), u(null);
|
|
1336
1337
|
};
|
|
1337
|
-
}, [l,
|
|
1338
|
+
}, [l, u]), /* @__PURE__ */ o.jsx(Ut, { asChild: !0, ...v, children: /* @__PURE__ */ o.jsx(
|
|
1338
1339
|
ar,
|
|
1339
1340
|
{
|
|
1340
1341
|
id: a.triggerId,
|
|
@@ -1345,12 +1346,12 @@ var qe = "MenuSubTrigger", vr = f.forwardRef(
|
|
|
1345
1346
|
...e,
|
|
1346
1347
|
ref: Tn(t, a.onTriggerChange),
|
|
1347
1348
|
onClick: (c) => {
|
|
1348
|
-
var
|
|
1349
|
-
(
|
|
1349
|
+
var d;
|
|
1350
|
+
(d = e.onClick) == null || d.call(e, c), !(e.disabled || c.defaultPrevented) && (c.currentTarget.focus(), n.open || n.onOpenChange(!0));
|
|
1350
1351
|
},
|
|
1351
1352
|
onPointerMove: A(
|
|
1352
1353
|
e.onPointerMove,
|
|
1353
|
-
|
|
1354
|
+
Xe((c) => {
|
|
1354
1355
|
s.onItemEnter(c), !c.defaultPrevented && !e.disabled && !n.open && !i.current && (s.onPointerGraceIntentChange(null), i.current = window.setTimeout(() => {
|
|
1355
1356
|
n.onOpenChange(!0), m();
|
|
1356
1357
|
}, 100));
|
|
@@ -1358,21 +1359,21 @@ var qe = "MenuSubTrigger", vr = f.forwardRef(
|
|
|
1358
1359
|
),
|
|
1359
1360
|
onPointerLeave: A(
|
|
1360
1361
|
e.onPointerLeave,
|
|
1361
|
-
|
|
1362
|
-
var
|
|
1362
|
+
Xe((c) => {
|
|
1363
|
+
var f, y;
|
|
1363
1364
|
m();
|
|
1364
|
-
const
|
|
1365
|
-
if (
|
|
1366
|
-
const R = (y = n.content) == null ? void 0 : y.dataset.side, K = R === "right", H = K ? -5 : 5, q =
|
|
1365
|
+
const d = (f = n.content) == null ? void 0 : f.getBoundingClientRect();
|
|
1366
|
+
if (d) {
|
|
1367
|
+
const R = (y = n.content) == null ? void 0 : y.dataset.side, K = R === "right", H = K ? -5 : 5, q = d[K ? "left" : "right"], x = d[K ? "right" : "left"];
|
|
1367
1368
|
s.onPointerGraceIntentChange({
|
|
1368
1369
|
area: [
|
|
1369
1370
|
// Apply a bleed on clientX to ensure that our exit point is
|
|
1370
1371
|
// consistently within polygon bounds
|
|
1371
1372
|
{ x: c.clientX + H, y: c.clientY },
|
|
1372
|
-
{ x: q, y:
|
|
1373
|
-
{ x, y:
|
|
1374
|
-
{ x, y:
|
|
1375
|
-
{ x: q, y:
|
|
1373
|
+
{ x: q, y: d.top },
|
|
1374
|
+
{ x, y: d.top },
|
|
1375
|
+
{ x, y: d.bottom },
|
|
1376
|
+
{ x: q, y: d.bottom }
|
|
1376
1377
|
],
|
|
1377
1378
|
side: R
|
|
1378
1379
|
}), window.clearTimeout(l.current), l.current = window.setTimeout(
|
|
@@ -1386,25 +1387,25 @@ var qe = "MenuSubTrigger", vr = f.forwardRef(
|
|
|
1386
1387
|
})
|
|
1387
1388
|
),
|
|
1388
1389
|
onKeyDown: A(e.onKeyDown, (c) => {
|
|
1389
|
-
var
|
|
1390
|
-
const
|
|
1391
|
-
e.disabled ||
|
|
1390
|
+
var f;
|
|
1391
|
+
const d = s.searchRef.current !== "";
|
|
1392
|
+
e.disabled || d && c.key === " " || $s[r.dir].includes(c.key) && (n.onOpenChange(!0), (f = n.content) == null || f.focus(), c.preventDefault());
|
|
1392
1393
|
})
|
|
1393
1394
|
}
|
|
1394
1395
|
) });
|
|
1395
1396
|
}
|
|
1396
1397
|
);
|
|
1397
1398
|
vr.displayName = qe;
|
|
1398
|
-
var wr = "MenuSubContent", br =
|
|
1399
|
+
var wr = "MenuSubContent", br = h.forwardRef(
|
|
1399
1400
|
(e, t) => {
|
|
1400
|
-
const n = tr(se, e.__scopeMenu), { forceMount: r = n.forceMount, ...a } = e, s = Re(se, e.__scopeMenu), i =
|
|
1401
|
-
return /* @__PURE__ */ o.jsx(
|
|
1401
|
+
const n = tr(se, e.__scopeMenu), { forceMount: r = n.forceMount, ...a } = e, s = Re(se, e.__scopeMenu), i = rt(se, e.__scopeMenu), l = mr(wr, e.__scopeMenu), u = h.useRef(null), v = Ze(t, u);
|
|
1402
|
+
return /* @__PURE__ */ o.jsx(Ye.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ o.jsx(gt, { present: r || s.open, children: /* @__PURE__ */ o.jsx(Ye.Slot, { scope: e.__scopeMenu, children: /* @__PURE__ */ o.jsx(
|
|
1402
1403
|
Kt,
|
|
1403
1404
|
{
|
|
1404
1405
|
id: l.contentId,
|
|
1405
1406
|
"aria-labelledby": l.triggerId,
|
|
1406
1407
|
...a,
|
|
1407
|
-
ref:
|
|
1408
|
+
ref: v,
|
|
1408
1409
|
align: "start",
|
|
1409
1410
|
side: i.dir === "rtl" ? "left" : "right",
|
|
1410
1411
|
disableOutsidePointerEvents: !1,
|
|
@@ -1412,7 +1413,7 @@ var wr = "MenuSubContent", br = f.forwardRef(
|
|
|
1412
1413
|
trapFocus: !1,
|
|
1413
1414
|
onOpenAutoFocus: (m) => {
|
|
1414
1415
|
var c;
|
|
1415
|
-
i.isUsingKeyboardRef.current && ((c =
|
|
1416
|
+
i.isUsingKeyboardRef.current && ((c = u.current) == null || c.focus()), m.preventDefault();
|
|
1416
1417
|
},
|
|
1417
1418
|
onCloseAutoFocus: (m) => m.preventDefault(),
|
|
1418
1419
|
onFocusOutside: A(e.onFocusOutside, (m) => {
|
|
@@ -1422,9 +1423,9 @@ var wr = "MenuSubContent", br = f.forwardRef(
|
|
|
1422
1423
|
i.onClose(), m.preventDefault();
|
|
1423
1424
|
}),
|
|
1424
1425
|
onKeyDown: A(e.onKeyDown, (m) => {
|
|
1425
|
-
var
|
|
1426
|
-
const c = m.currentTarget.contains(m.target),
|
|
1427
|
-
c &&
|
|
1426
|
+
var f;
|
|
1427
|
+
const c = m.currentTarget.contains(m.target), d = Ls[i.dir].includes(m.key);
|
|
1428
|
+
c && d && (s.onOpenChange(!1), (f = l.trigger) == null || f.focus(), m.preventDefault());
|
|
1428
1429
|
})
|
|
1429
1430
|
}
|
|
1430
1431
|
) }) }) });
|
|
@@ -1434,11 +1435,11 @@ br.displayName = wr;
|
|
|
1434
1435
|
function xr(e) {
|
|
1435
1436
|
return e ? "open" : "closed";
|
|
1436
1437
|
}
|
|
1437
|
-
function
|
|
1438
|
+
function mt(e) {
|
|
1438
1439
|
return e === "indeterminate";
|
|
1439
1440
|
}
|
|
1440
1441
|
function Gt(e) {
|
|
1441
|
-
return
|
|
1442
|
+
return mt(e) ? "indeterminate" : e ? "checked" : "unchecked";
|
|
1442
1443
|
}
|
|
1443
1444
|
function ni(e) {
|
|
1444
1445
|
const t = document.activeElement;
|
|
@@ -1449,20 +1450,20 @@ function ri(e, t) {
|
|
|
1449
1450
|
return e.map((n, r) => e[(t + r) % e.length]);
|
|
1450
1451
|
}
|
|
1451
1452
|
function oi(e, t, n) {
|
|
1452
|
-
const a = t.length > 1 && Array.from(t).every((
|
|
1453
|
+
const a = t.length > 1 && Array.from(t).every((v) => v === t[0]) ? t[0] : t, s = n ? e.indexOf(n) : -1;
|
|
1453
1454
|
let i = ri(e, Math.max(s, 0));
|
|
1454
|
-
a.length === 1 && (i = i.filter((
|
|
1455
|
-
const
|
|
1456
|
-
(
|
|
1455
|
+
a.length === 1 && (i = i.filter((v) => v !== n));
|
|
1456
|
+
const u = i.find(
|
|
1457
|
+
(v) => v.toLowerCase().startsWith(a.toLowerCase())
|
|
1457
1458
|
);
|
|
1458
|
-
return
|
|
1459
|
+
return u !== n ? u : void 0;
|
|
1459
1460
|
}
|
|
1460
1461
|
function ai(e, t) {
|
|
1461
1462
|
const { x: n, y: r } = e;
|
|
1462
1463
|
let a = !1;
|
|
1463
1464
|
for (let s = 0, i = t.length - 1; s < t.length; i = s++) {
|
|
1464
|
-
const l = t[s].x,
|
|
1465
|
-
|
|
1465
|
+
const l = t[s].x, u = t[s].y, v = t[i].x, m = t[i].y;
|
|
1466
|
+
u > r != m > r && n < (v - l) * (r - u) / (m - u) + l && (a = !a);
|
|
1466
1467
|
}
|
|
1467
1468
|
return a;
|
|
1468
1469
|
}
|
|
@@ -1471,13 +1472,13 @@ function si(e, t) {
|
|
|
1471
1472
|
const n = { x: e.clientX, y: e.clientY };
|
|
1472
1473
|
return ai(n, t);
|
|
1473
1474
|
}
|
|
1474
|
-
function
|
|
1475
|
+
function Xe(e) {
|
|
1475
1476
|
return (t) => t.pointerType === "mouse" ? e(t) : void 0;
|
|
1476
1477
|
}
|
|
1477
|
-
var ii = er, li = Ut, ci = nr, ui = rr, di = Vt, fi = or, hi =
|
|
1478
|
+
var ii = er, li = Ut, ci = nr, ui = rr, di = Vt, fi = or, hi = vt, pi = sr, mi = lr, gi = ur, vi = fr, wi = hr, bi = pr, xi = gr, yi = vr, Mi = br, Wt = "DropdownMenu", [Si, Jl] = Nn(
|
|
1478
1479
|
Wt,
|
|
1479
1480
|
[Xn]
|
|
1480
|
-
), W = Xn(), [
|
|
1481
|
+
), W = Xn(), [Ei, yr] = Si(Wt), Mr = (e) => {
|
|
1481
1482
|
const {
|
|
1482
1483
|
__scopeDropdownMenu: t,
|
|
1483
1484
|
children: n,
|
|
@@ -1486,32 +1487,32 @@ var ii = er, li = Ut, ci = nr, ui = rr, di = Vt, fi = or, hi = wt, pi = sr, mi =
|
|
|
1486
1487
|
defaultOpen: s,
|
|
1487
1488
|
onOpenChange: i,
|
|
1488
1489
|
modal: l = !0
|
|
1489
|
-
} = e,
|
|
1490
|
+
} = e, u = W(t), v = h.useRef(null), [m = !1, c] = On({
|
|
1490
1491
|
prop: a,
|
|
1491
1492
|
defaultProp: s,
|
|
1492
1493
|
onChange: i
|
|
1493
1494
|
});
|
|
1494
1495
|
return /* @__PURE__ */ o.jsx(
|
|
1495
|
-
|
|
1496
|
+
Ei,
|
|
1496
1497
|
{
|
|
1497
1498
|
scope: t,
|
|
1498
|
-
triggerId:
|
|
1499
|
-
triggerRef:
|
|
1500
|
-
contentId:
|
|
1499
|
+
triggerId: ht(),
|
|
1500
|
+
triggerRef: v,
|
|
1501
|
+
contentId: ht(),
|
|
1501
1502
|
open: m,
|
|
1502
1503
|
onOpenChange: c,
|
|
1503
|
-
onOpenToggle:
|
|
1504
|
+
onOpenToggle: h.useCallback(() => c((d) => !d), [c]),
|
|
1504
1505
|
modal: l,
|
|
1505
|
-
children: /* @__PURE__ */ o.jsx(ii, { ...
|
|
1506
|
+
children: /* @__PURE__ */ o.jsx(ii, { ...u, open: m, onOpenChange: c, dir: r, modal: l, children: n })
|
|
1506
1507
|
}
|
|
1507
1508
|
);
|
|
1508
1509
|
};
|
|
1509
|
-
|
|
1510
|
-
var
|
|
1510
|
+
Mr.displayName = Wt;
|
|
1511
|
+
var Sr = "DropdownMenuTrigger", Er = h.forwardRef(
|
|
1511
1512
|
(e, t) => {
|
|
1512
|
-
const { __scopeDropdownMenu: n, disabled: r = !1, ...a } = e, s = yr(
|
|
1513
|
+
const { __scopeDropdownMenu: n, disabled: r = !1, ...a } = e, s = yr(Sr, n), i = W(n);
|
|
1513
1514
|
return /* @__PURE__ */ o.jsx(li, { asChild: !0, ...i, children: /* @__PURE__ */ o.jsx(
|
|
1514
|
-
|
|
1515
|
+
He.button,
|
|
1515
1516
|
{
|
|
1516
1517
|
type: "button",
|
|
1517
1518
|
id: s.triggerId,
|
|
@@ -1533,15 +1534,15 @@ var Mr = "DropdownMenuTrigger", Cr = f.forwardRef(
|
|
|
1533
1534
|
) });
|
|
1534
1535
|
}
|
|
1535
1536
|
);
|
|
1536
|
-
|
|
1537
|
-
var
|
|
1537
|
+
Er.displayName = Sr;
|
|
1538
|
+
var Ci = "DropdownMenuPortal", Cr = (e) => {
|
|
1538
1539
|
const { __scopeDropdownMenu: t, ...n } = e, r = W(t);
|
|
1539
1540
|
return /* @__PURE__ */ o.jsx(ci, { ...r, ...n });
|
|
1540
1541
|
};
|
|
1541
|
-
|
|
1542
|
-
var Rr = "DropdownMenuContent", Dr =
|
|
1542
|
+
Cr.displayName = Ci;
|
|
1543
|
+
var Rr = "DropdownMenuContent", Dr = h.forwardRef(
|
|
1543
1544
|
(e, t) => {
|
|
1544
|
-
const { __scopeDropdownMenu: n, ...r } = e, a = yr(Rr, n), s = W(n), i =
|
|
1545
|
+
const { __scopeDropdownMenu: n, ...r } = e, a = yr(Rr, n), s = W(n), i = h.useRef(!1);
|
|
1545
1546
|
return /* @__PURE__ */ o.jsx(
|
|
1546
1547
|
ui,
|
|
1547
1548
|
{
|
|
@@ -1551,11 +1552,11 @@ var Rr = "DropdownMenuContent", Dr = f.forwardRef(
|
|
|
1551
1552
|
...r,
|
|
1552
1553
|
ref: t,
|
|
1553
1554
|
onCloseAutoFocus: A(e.onCloseAutoFocus, (l) => {
|
|
1554
|
-
var
|
|
1555
|
-
i.current || (
|
|
1555
|
+
var u;
|
|
1556
|
+
i.current || (u = a.triggerRef.current) == null || u.focus(), i.current = !1, l.preventDefault();
|
|
1556
1557
|
}),
|
|
1557
1558
|
onInteractOutside: A(e.onInteractOutside, (l) => {
|
|
1558
|
-
const
|
|
1559
|
+
const u = l.detail.originalEvent, v = u.button === 0 && u.ctrlKey === !0, m = u.button === 2 || v;
|
|
1559
1560
|
(!a.modal || m) && (i.current = !0);
|
|
1560
1561
|
}),
|
|
1561
1562
|
style: {
|
|
@@ -1571,53 +1572,53 @@ var Rr = "DropdownMenuContent", Dr = f.forwardRef(
|
|
|
1571
1572
|
}
|
|
1572
1573
|
);
|
|
1573
1574
|
Dr.displayName = Rr;
|
|
1574
|
-
var Ri = "DropdownMenuGroup", Di =
|
|
1575
|
+
var Ri = "DropdownMenuGroup", Di = h.forwardRef(
|
|
1575
1576
|
(e, t) => {
|
|
1576
1577
|
const { __scopeDropdownMenu: n, ...r } = e, a = W(n);
|
|
1577
1578
|
return /* @__PURE__ */ o.jsx(di, { ...a, ...r, ref: t });
|
|
1578
1579
|
}
|
|
1579
1580
|
);
|
|
1580
1581
|
Di.displayName = Ri;
|
|
1581
|
-
var
|
|
1582
|
+
var ji = "DropdownMenuLabel", jr = h.forwardRef(
|
|
1582
1583
|
(e, t) => {
|
|
1583
1584
|
const { __scopeDropdownMenu: n, ...r } = e, a = W(n);
|
|
1584
1585
|
return /* @__PURE__ */ o.jsx(fi, { ...a, ...r, ref: t });
|
|
1585
1586
|
}
|
|
1586
1587
|
);
|
|
1587
|
-
|
|
1588
|
-
var
|
|
1588
|
+
jr.displayName = ji;
|
|
1589
|
+
var Ni = "DropdownMenuItem", Nr = h.forwardRef(
|
|
1589
1590
|
(e, t) => {
|
|
1590
1591
|
const { __scopeDropdownMenu: n, ...r } = e, a = W(n);
|
|
1591
1592
|
return /* @__PURE__ */ o.jsx(hi, { ...a, ...r, ref: t });
|
|
1592
1593
|
}
|
|
1593
1594
|
);
|
|
1594
|
-
|
|
1595
|
-
var Pi = "DropdownMenuCheckboxItem", Pr =
|
|
1595
|
+
Nr.displayName = Ni;
|
|
1596
|
+
var Pi = "DropdownMenuCheckboxItem", Pr = h.forwardRef((e, t) => {
|
|
1596
1597
|
const { __scopeDropdownMenu: n, ...r } = e, a = W(n);
|
|
1597
1598
|
return /* @__PURE__ */ o.jsx(pi, { ...a, ...r, ref: t });
|
|
1598
1599
|
});
|
|
1599
1600
|
Pr.displayName = Pi;
|
|
1600
|
-
var Ti = "DropdownMenuRadioGroup", _i =
|
|
1601
|
+
var Ti = "DropdownMenuRadioGroup", _i = h.forwardRef((e, t) => {
|
|
1601
1602
|
const { __scopeDropdownMenu: n, ...r } = e, a = W(n);
|
|
1602
1603
|
return /* @__PURE__ */ o.jsx(mi, { ...a, ...r, ref: t });
|
|
1603
1604
|
});
|
|
1604
1605
|
_i.displayName = Ti;
|
|
1605
|
-
var
|
|
1606
|
+
var Oi = "DropdownMenuRadioItem", Tr = h.forwardRef((e, t) => {
|
|
1606
1607
|
const { __scopeDropdownMenu: n, ...r } = e, a = W(n);
|
|
1607
1608
|
return /* @__PURE__ */ o.jsx(gi, { ...a, ...r, ref: t });
|
|
1608
1609
|
});
|
|
1609
|
-
Tr.displayName =
|
|
1610
|
-
var
|
|
1610
|
+
Tr.displayName = Oi;
|
|
1611
|
+
var Ii = "DropdownMenuItemIndicator", _r = h.forwardRef((e, t) => {
|
|
1611
1612
|
const { __scopeDropdownMenu: n, ...r } = e, a = W(n);
|
|
1612
1613
|
return /* @__PURE__ */ o.jsx(vi, { ...a, ...r, ref: t });
|
|
1613
1614
|
});
|
|
1614
|
-
_r.displayName =
|
|
1615
|
-
var Ai = "DropdownMenuSeparator",
|
|
1615
|
+
_r.displayName = Ii;
|
|
1616
|
+
var Ai = "DropdownMenuSeparator", Or = h.forwardRef((e, t) => {
|
|
1616
1617
|
const { __scopeDropdownMenu: n, ...r } = e, a = W(n);
|
|
1617
1618
|
return /* @__PURE__ */ o.jsx(wi, { ...a, ...r, ref: t });
|
|
1618
1619
|
});
|
|
1619
|
-
|
|
1620
|
-
var ki = "DropdownMenuArrow", $i =
|
|
1620
|
+
Or.displayName = Ai;
|
|
1621
|
+
var ki = "DropdownMenuArrow", $i = h.forwardRef(
|
|
1621
1622
|
(e, t) => {
|
|
1622
1623
|
const { __scopeDropdownMenu: n, ...r } = e, a = W(n);
|
|
1623
1624
|
return /* @__PURE__ */ o.jsx(bi, { ...a, ...r, ref: t });
|
|
@@ -1625,21 +1626,21 @@ var ki = "DropdownMenuArrow", $i = f.forwardRef(
|
|
|
1625
1626
|
);
|
|
1626
1627
|
$i.displayName = ki;
|
|
1627
1628
|
var Li = (e) => {
|
|
1628
|
-
const { __scopeDropdownMenu: t, children: n, open: r, onOpenChange: a, defaultOpen: s } = e, i = W(t), [l = !1,
|
|
1629
|
+
const { __scopeDropdownMenu: t, children: n, open: r, onOpenChange: a, defaultOpen: s } = e, i = W(t), [l = !1, u] = On({
|
|
1629
1630
|
prop: r,
|
|
1630
1631
|
defaultProp: s,
|
|
1631
1632
|
onChange: a
|
|
1632
1633
|
});
|
|
1633
|
-
return /* @__PURE__ */ o.jsx(xi, { ...i, open: l, onOpenChange:
|
|
1634
|
-
}, Fi = "DropdownMenuSubTrigger",
|
|
1634
|
+
return /* @__PURE__ */ o.jsx(xi, { ...i, open: l, onOpenChange: u, children: n });
|
|
1635
|
+
}, Fi = "DropdownMenuSubTrigger", Ir = h.forwardRef((e, t) => {
|
|
1635
1636
|
const { __scopeDropdownMenu: n, ...r } = e, a = W(n);
|
|
1636
1637
|
return /* @__PURE__ */ o.jsx(yi, { ...a, ...r, ref: t });
|
|
1637
1638
|
});
|
|
1638
|
-
|
|
1639
|
-
var Hi = "DropdownMenuSubContent", Ar =
|
|
1639
|
+
Ir.displayName = Fi;
|
|
1640
|
+
var Hi = "DropdownMenuSubContent", Ar = h.forwardRef((e, t) => {
|
|
1640
1641
|
const { __scopeDropdownMenu: n, ...r } = e, a = W(n);
|
|
1641
1642
|
return /* @__PURE__ */ o.jsx(
|
|
1642
|
-
|
|
1643
|
+
Mi,
|
|
1643
1644
|
{
|
|
1644
1645
|
...a,
|
|
1645
1646
|
...r,
|
|
@@ -1656,12 +1657,12 @@ var Hi = "DropdownMenuSubContent", Ar = f.forwardRef((e, t) => {
|
|
|
1656
1657
|
);
|
|
1657
1658
|
});
|
|
1658
1659
|
Ar.displayName = Hi;
|
|
1659
|
-
var Ui =
|
|
1660
|
-
const Ki = Ui, Vi = Bi, Qi = kr, qi = zi, Qr =
|
|
1660
|
+
var Ui = Mr, Bi = Er, kr = Cr, $r = Dr, Lr = jr, Fr = Nr, Hr = Pr, Ur = Tr, Br = _r, zr = Or, zi = Li, Kr = Ir, Vr = Ar;
|
|
1661
|
+
const Ki = Ui, Vi = Bi, Qi = kr, qi = zi, Qr = h.forwardRef(({ className: e, inset: t, children: n, ...r }, a) => /* @__PURE__ */ o.jsxs(
|
|
1661
1662
|
Kr,
|
|
1662
1663
|
{
|
|
1663
1664
|
ref: a,
|
|
1664
|
-
className:
|
|
1665
|
+
className: O(
|
|
1665
1666
|
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",
|
|
1666
1667
|
t && "pl-8",
|
|
1667
1668
|
e
|
|
@@ -1674,11 +1675,11 @@ const Ki = Ui, Vi = Bi, Qi = kr, qi = zi, Qr = f.forwardRef(({ className: e, ins
|
|
|
1674
1675
|
}
|
|
1675
1676
|
));
|
|
1676
1677
|
Qr.displayName = Kr.displayName;
|
|
1677
|
-
const qr =
|
|
1678
|
+
const qr = h.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o.jsx(
|
|
1678
1679
|
Vr,
|
|
1679
1680
|
{
|
|
1680
1681
|
ref: n,
|
|
1681
|
-
className:
|
|
1682
|
+
className: O(
|
|
1682
1683
|
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
1683
1684
|
e
|
|
1684
1685
|
),
|
|
@@ -1686,12 +1687,12 @@ const qr = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o.jsx(
|
|
|
1686
1687
|
}
|
|
1687
1688
|
));
|
|
1688
1689
|
qr.displayName = Vr.displayName;
|
|
1689
|
-
const Gr =
|
|
1690
|
+
const Gr = h.forwardRef(({ className: e, sideOffset: t = 4, ...n }, r) => /* @__PURE__ */ o.jsx(kr, { children: /* @__PURE__ */ o.jsx(
|
|
1690
1691
|
$r,
|
|
1691
1692
|
{
|
|
1692
1693
|
ref: r,
|
|
1693
1694
|
sideOffset: t,
|
|
1694
|
-
className:
|
|
1695
|
+
className: O(
|
|
1695
1696
|
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",
|
|
1696
1697
|
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
1697
1698
|
e
|
|
@@ -1700,11 +1701,11 @@ const Gr = f.forwardRef(({ className: e, sideOffset: t = 4, ...n }, r) => /* @__
|
|
|
1700
1701
|
}
|
|
1701
1702
|
) }));
|
|
1702
1703
|
Gr.displayName = $r.displayName;
|
|
1703
|
-
const Wr =
|
|
1704
|
+
const Wr = h.forwardRef(({ className: e, inset: t, ...n }, r) => /* @__PURE__ */ o.jsx(
|
|
1704
1705
|
Fr,
|
|
1705
1706
|
{
|
|
1706
1707
|
ref: r,
|
|
1707
|
-
className:
|
|
1708
|
+
className: O(
|
|
1708
1709
|
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
1709
1710
|
t && "pl-8",
|
|
1710
1711
|
e
|
|
@@ -1713,44 +1714,44 @@ const Wr = f.forwardRef(({ className: e, inset: t, ...n }, r) => /* @__PURE__ */
|
|
|
1713
1714
|
}
|
|
1714
1715
|
));
|
|
1715
1716
|
Wr.displayName = Fr.displayName;
|
|
1716
|
-
const Gi =
|
|
1717
|
+
const Gi = h.forwardRef(({ className: e, children: t, checked: n, ...r }, a) => /* @__PURE__ */ o.jsxs(
|
|
1717
1718
|
Hr,
|
|
1718
1719
|
{
|
|
1719
1720
|
ref: a,
|
|
1720
|
-
className:
|
|
1721
|
+
className: O(
|
|
1721
1722
|
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
1722
1723
|
e
|
|
1723
1724
|
),
|
|
1724
1725
|
checked: n,
|
|
1725
1726
|
...r,
|
|
1726
1727
|
children: [
|
|
1727
|
-
/* @__PURE__ */ o.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ o.jsx(Br, { children: /* @__PURE__ */ o.jsx(
|
|
1728
|
+
/* @__PURE__ */ o.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ o.jsx(Br, { children: /* @__PURE__ */ o.jsx(Oa, { className: "h-4 w-4" }) }) }),
|
|
1728
1729
|
t
|
|
1729
1730
|
]
|
|
1730
1731
|
}
|
|
1731
1732
|
));
|
|
1732
1733
|
Gi.displayName = Hr.displayName;
|
|
1733
|
-
const Wi =
|
|
1734
|
+
const Wi = h.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ o.jsxs(
|
|
1734
1735
|
Ur,
|
|
1735
1736
|
{
|
|
1736
1737
|
ref: r,
|
|
1737
|
-
className:
|
|
1738
|
+
className: O(
|
|
1738
1739
|
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
1739
1740
|
e
|
|
1740
1741
|
),
|
|
1741
1742
|
...n,
|
|
1742
1743
|
children: [
|
|
1743
|
-
/* @__PURE__ */ o.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ o.jsx(Br, { children: /* @__PURE__ */ o.jsx(
|
|
1744
|
+
/* @__PURE__ */ o.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ o.jsx(Br, { children: /* @__PURE__ */ o.jsx(Ia, { className: "h-4 w-4 fill-current" }) }) }),
|
|
1744
1745
|
t
|
|
1745
1746
|
]
|
|
1746
1747
|
}
|
|
1747
1748
|
));
|
|
1748
1749
|
Wi.displayName = Ur.displayName;
|
|
1749
|
-
const Yr =
|
|
1750
|
+
const Yr = h.forwardRef(({ className: e, inset: t, ...n }, r) => /* @__PURE__ */ o.jsx(
|
|
1750
1751
|
Lr,
|
|
1751
1752
|
{
|
|
1752
1753
|
ref: r,
|
|
1753
|
-
className:
|
|
1754
|
+
className: O(
|
|
1754
1755
|
"px-2 py-1.5 text-sm font-semibold",
|
|
1755
1756
|
t && "pl-8",
|
|
1756
1757
|
e
|
|
@@ -1759,11 +1760,11 @@ const Yr = f.forwardRef(({ className: e, inset: t, ...n }, r) => /* @__PURE__ */
|
|
|
1759
1760
|
}
|
|
1760
1761
|
));
|
|
1761
1762
|
Yr.displayName = Lr.displayName;
|
|
1762
|
-
const Xr =
|
|
1763
|
+
const Xr = h.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o.jsx(
|
|
1763
1764
|
zr,
|
|
1764
1765
|
{
|
|
1765
1766
|
ref: n,
|
|
1766
|
-
className:
|
|
1767
|
+
className: O("-mx-1 my-1 h-px bg-muted", e),
|
|
1767
1768
|
...t
|
|
1768
1769
|
}
|
|
1769
1770
|
));
|
|
@@ -1775,11 +1776,11 @@ const Yi = {
|
|
|
1775
1776
|
caution: "bg-orange-500",
|
|
1776
1777
|
danger: "bg-rose-500"
|
|
1777
1778
|
}, Xi = () => {
|
|
1778
|
-
const { page: e } =
|
|
1779
|
+
const { page: e } = Ue(), [t, n] = Te(!0);
|
|
1779
1780
|
return !(e != null && e.banner) || !t ? /* @__PURE__ */ o.jsx("style", { children: ":root { --banner-height: 0px; }" }) : /* @__PURE__ */ o.jsxs(
|
|
1780
1781
|
"div",
|
|
1781
1782
|
{
|
|
1782
|
-
className:
|
|
1783
|
+
className: O(
|
|
1783
1784
|
"relative text-primary-foreground text-sm font-medium px-4 py-2 flex gap-2 items-center",
|
|
1784
1785
|
e.banner.color ? Yi[e.banner.color] : "bg-primary"
|
|
1785
1786
|
),
|
|
@@ -1803,7 +1804,7 @@ function Ji(e) {
|
|
|
1803
1804
|
let t = document.head || document.getElementsByTagName("head")[0], n = document.createElement("style");
|
|
1804
1805
|
n.type = "text/css", t.appendChild(n), n.styleSheet ? n.styleSheet.cssText = e : n.appendChild(document.createTextNode(e));
|
|
1805
1806
|
}
|
|
1806
|
-
const Jr =
|
|
1807
|
+
const Jr = g.createContext({
|
|
1807
1808
|
drawerRef: {
|
|
1808
1809
|
current: null
|
|
1809
1810
|
},
|
|
@@ -1847,15 +1848,15 @@ const Jr = v.createContext({
|
|
|
1847
1848
|
setVisible: () => {
|
|
1848
1849
|
},
|
|
1849
1850
|
direction: "bottom"
|
|
1850
|
-
}),
|
|
1851
|
-
const e =
|
|
1851
|
+
}), wt = () => {
|
|
1852
|
+
const e = g.useContext(Jr);
|
|
1852
1853
|
if (!e)
|
|
1853
1854
|
throw new Error("useDrawerContext must be used within a Drawer.Root");
|
|
1854
1855
|
return e;
|
|
1855
1856
|
};
|
|
1856
1857
|
Ji("[vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1)}[vaul-drawer][vaul-drawer-direction=bottom]{transform:translate3d(0,100%,0)}[vaul-drawer][vaul-drawer-direction=top]{transform:translate3d(0,-100%,0)}[vaul-drawer][vaul-drawer-direction=left]{transform:translate3d(-100%,0,0)}[vaul-drawer][vaul-drawer-direction=right]{transform:translate3d(100%,0,0)}.vaul-dragging .vaul-scrollable [vault-drawer-direction=top]{overflow-y:hidden!important}.vaul-dragging .vaul-scrollable [vault-drawer-direction=bottom]{overflow-y:hidden!important}.vaul-dragging .vaul-scrollable [vault-drawer-direction=left]{overflow-x:hidden!important}.vaul-dragging .vaul-scrollable [vault-drawer-direction=right]{overflow-x:hidden!important}[vaul-drawer][vaul-drawer-visible=true][vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[vaul-drawer][vaul-drawer-visible=true][vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[vaul-drawer][vaul-drawer-visible=true][vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[vaul-drawer][vaul-drawer-visible=true][vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[vaul-overlay]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[vaul-overlay][vaul-drawer-visible=true]{opacity:1}[vaul-drawer]::after{content:'';position:absolute;background:inherit;background-color:inherit}[vaul-drawer][vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[vaul-drawer][vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[vaul-drawer][vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[vaul-drawer][vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[vaul-handle]{display:block;position:relative;opacity:.8;margin-left:auto;margin-right:auto;height:5px;width:56px;border-radius:1rem;touch-action:pan-y;cursor:grab}[vaul-handle]:active,[vaul-handle]:hover{opacity:1}[vaul-handle]:active{cursor:grabbing}[vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}[vaul-overlay][vaul-snap-points=true]:not([vaul-snap-points-overlay=true]):not([data-state=closed]){opacity:0}[vaul-overlay][vaul-snap-points-overlay=true]:not([vaul-drawer-visible=false]){opacity:1}@media (hover:hover) and (pointer:fine){[vaul-drawer]{user-select:none}}@media (pointer:fine){[vaul-handle-hitarea]:{width:100%;height:100%}}");
|
|
1857
|
-
const Zr = typeof window < "u" ?
|
|
1858
|
-
function
|
|
1858
|
+
const Zr = typeof window < "u" ? pa : be;
|
|
1859
|
+
function Nt(...e) {
|
|
1859
1860
|
return (...t) => {
|
|
1860
1861
|
for (let n of e)
|
|
1861
1862
|
typeof n == "function" && n(...t);
|
|
@@ -1877,7 +1878,7 @@ function eo() {
|
|
|
1877
1878
|
function Yt(e) {
|
|
1878
1879
|
return typeof window < "u" && window.navigator != null ? e.test(window.navigator.platform) : void 0;
|
|
1879
1880
|
}
|
|
1880
|
-
const
|
|
1881
|
+
const St = typeof document < "u" && window.visualViewport;
|
|
1881
1882
|
function bn(e) {
|
|
1882
1883
|
let t = window.getComputedStyle(e);
|
|
1883
1884
|
return /(auto|scroll)/.test(t.overflow + t.overflowX + t.overflowY);
|
|
@@ -1898,20 +1899,20 @@ const nl = /* @__PURE__ */ new Set([
|
|
|
1898
1899
|
"submit",
|
|
1899
1900
|
"reset"
|
|
1900
1901
|
]);
|
|
1901
|
-
let
|
|
1902
|
+
let ut = 0, Et;
|
|
1902
1903
|
function rl(e = {}) {
|
|
1903
1904
|
let { isDisabled: t } = e;
|
|
1904
1905
|
Zr(() => {
|
|
1905
1906
|
if (!t)
|
|
1906
|
-
return
|
|
1907
|
-
|
|
1907
|
+
return ut++, ut === 1 && (eo() ? Et = al() : Et = ol()), () => {
|
|
1908
|
+
ut--, ut === 0 && Et();
|
|
1908
1909
|
};
|
|
1909
1910
|
}, [
|
|
1910
1911
|
t
|
|
1911
1912
|
]);
|
|
1912
1913
|
}
|
|
1913
1914
|
function ol() {
|
|
1914
|
-
return
|
|
1915
|
+
return Nt(no(document.documentElement, "paddingRight", `${window.innerWidth - document.documentElement.clientWidth}px`));
|
|
1915
1916
|
}
|
|
1916
1917
|
function al() {
|
|
1917
1918
|
let e, t = 0, n = (c) => {
|
|
@@ -1921,27 +1922,27 @@ function al() {
|
|
|
1921
1922
|
c.preventDefault();
|
|
1922
1923
|
return;
|
|
1923
1924
|
}
|
|
1924
|
-
let
|
|
1925
|
-
y !== 0 && ((
|
|
1925
|
+
let d = c.changedTouches[0].pageY, f = e.scrollTop, y = e.scrollHeight - e.clientHeight;
|
|
1926
|
+
y !== 0 && ((f <= 0 && d > t || f >= y && d < t) && c.preventDefault(), t = d);
|
|
1926
1927
|
}, a = (c) => {
|
|
1927
|
-
let
|
|
1928
|
-
|
|
1929
|
-
|
|
1928
|
+
let d = c.target;
|
|
1929
|
+
Pt(d) && d !== document.activeElement && (c.preventDefault(), d.style.transform = "translateY(-2000px)", d.focus(), requestAnimationFrame(() => {
|
|
1930
|
+
d.style.transform = "";
|
|
1930
1931
|
}));
|
|
1931
1932
|
}, s = (c) => {
|
|
1932
|
-
let
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
xn(
|
|
1936
|
-
}) :
|
|
1933
|
+
let d = c.target;
|
|
1934
|
+
Pt(d) && (d.style.transform = "translateY(-2000px)", requestAnimationFrame(() => {
|
|
1935
|
+
d.style.transform = "", St && (St.height < window.innerHeight ? requestAnimationFrame(() => {
|
|
1936
|
+
xn(d);
|
|
1937
|
+
}) : St.addEventListener("resize", () => xn(d), {
|
|
1937
1938
|
once: !0
|
|
1938
1939
|
}));
|
|
1939
1940
|
}));
|
|
1940
1941
|
}, i = () => {
|
|
1941
1942
|
window.scrollTo(0, 0);
|
|
1942
|
-
}, l = window.pageXOffset,
|
|
1943
|
+
}, l = window.pageXOffset, u = window.pageYOffset, v = Nt(no(document.documentElement, "paddingRight", `${window.innerWidth - document.documentElement.clientWidth}px`));
|
|
1943
1944
|
window.scrollTo(0, 0);
|
|
1944
|
-
let m =
|
|
1945
|
+
let m = Nt(Ve(document, "touchstart", n, {
|
|
1945
1946
|
passive: !1,
|
|
1946
1947
|
capture: !0
|
|
1947
1948
|
}), Ve(document, "touchmove", r, {
|
|
@@ -1952,7 +1953,7 @@ function al() {
|
|
|
1952
1953
|
capture: !0
|
|
1953
1954
|
}), Ve(document, "focus", s, !0), Ve(window, "scroll", i));
|
|
1954
1955
|
return () => {
|
|
1955
|
-
|
|
1956
|
+
v(), m(), window.scrollTo(l, u);
|
|
1956
1957
|
};
|
|
1957
1958
|
}
|
|
1958
1959
|
function no(e, t, n) {
|
|
@@ -1978,7 +1979,7 @@ function xn(e) {
|
|
|
1978
1979
|
e = n.parentElement;
|
|
1979
1980
|
}
|
|
1980
1981
|
}
|
|
1981
|
-
function
|
|
1982
|
+
function Pt(e) {
|
|
1982
1983
|
return e instanceof HTMLInputElement && !nl.has(e.type) || e instanceof HTMLTextAreaElement || e instanceof HTMLElement && e.isContentEditable;
|
|
1983
1984
|
}
|
|
1984
1985
|
function sl(e, t) {
|
|
@@ -1988,11 +1989,11 @@ function il(...e) {
|
|
|
1988
1989
|
return (t) => e.forEach((n) => sl(n, t));
|
|
1989
1990
|
}
|
|
1990
1991
|
function ro(...e) {
|
|
1991
|
-
return
|
|
1992
|
+
return h.useCallback(il(...e), e);
|
|
1992
1993
|
}
|
|
1993
1994
|
let Qe = null;
|
|
1994
1995
|
function ll({ isOpen: e, modal: t, nested: n, hasBeenOpened: r, preventScrollRestoration: a, noBodyStyles: s }) {
|
|
1995
|
-
const [i, l] =
|
|
1996
|
+
const [i, l] = g.useState(() => typeof window < "u" ? window.location.href : ""), u = g.useRef(0), v = g.useCallback(() => {
|
|
1996
1997
|
if (Qe === null && e && !s) {
|
|
1997
1998
|
Qe = {
|
|
1998
1999
|
position: document.body.style.position,
|
|
@@ -2001,42 +2002,42 @@ function ll({ isOpen: e, modal: t, nested: n, hasBeenOpened: r, preventScrollRes
|
|
|
2001
2002
|
height: document.body.style.height,
|
|
2002
2003
|
right: "unset"
|
|
2003
2004
|
};
|
|
2004
|
-
const { scrollX: c, innerHeight:
|
|
2005
|
+
const { scrollX: c, innerHeight: d } = window;
|
|
2005
2006
|
document.body.style.setProperty("position", "fixed", "important"), Object.assign(document.body.style, {
|
|
2006
|
-
top: `${-
|
|
2007
|
+
top: `${-u.current}px`,
|
|
2007
2008
|
left: `${-c}px`,
|
|
2008
2009
|
right: "0px",
|
|
2009
2010
|
height: "auto"
|
|
2010
2011
|
}), window.setTimeout(() => window.requestAnimationFrame(() => {
|
|
2011
|
-
const
|
|
2012
|
-
|
|
2012
|
+
const f = d - window.innerHeight;
|
|
2013
|
+
f && u.current >= d && (document.body.style.top = `${-(u.current + f)}px`);
|
|
2013
2014
|
}), 300);
|
|
2014
2015
|
}
|
|
2015
2016
|
}, [
|
|
2016
2017
|
e
|
|
2017
|
-
]), m =
|
|
2018
|
+
]), m = g.useCallback(() => {
|
|
2018
2019
|
if (Qe !== null && !s) {
|
|
2019
|
-
const c = -parseInt(document.body.style.top, 10),
|
|
2020
|
+
const c = -parseInt(document.body.style.top, 10), d = -parseInt(document.body.style.left, 10);
|
|
2020
2021
|
Object.assign(document.body.style, Qe), window.requestAnimationFrame(() => {
|
|
2021
2022
|
if (a && i !== window.location.href) {
|
|
2022
2023
|
l(window.location.href);
|
|
2023
2024
|
return;
|
|
2024
2025
|
}
|
|
2025
|
-
window.scrollTo(
|
|
2026
|
+
window.scrollTo(d, c);
|
|
2026
2027
|
}), Qe = null;
|
|
2027
2028
|
}
|
|
2028
2029
|
}, [
|
|
2029
2030
|
i
|
|
2030
2031
|
]);
|
|
2031
|
-
return
|
|
2032
|
+
return g.useEffect(() => {
|
|
2032
2033
|
function c() {
|
|
2033
|
-
|
|
2034
|
+
u.current = window.scrollY;
|
|
2034
2035
|
}
|
|
2035
2036
|
return c(), window.addEventListener("scroll", c), () => {
|
|
2036
2037
|
window.removeEventListener("scroll", c);
|
|
2037
2038
|
};
|
|
2038
|
-
}, []),
|
|
2039
|
-
n || !r || (e ? (!window.matchMedia("(display-mode: standalone)").matches &&
|
|
2039
|
+
}, []), g.useEffect(() => {
|
|
2040
|
+
n || !r || (e ? (!window.matchMedia("(display-mode: standalone)").matches && v(), t || window.setTimeout(() => {
|
|
2040
2041
|
m();
|
|
2041
2042
|
}, 500)) : m());
|
|
2042
2043
|
}, [
|
|
@@ -2045,14 +2046,14 @@ function ll({ isOpen: e, modal: t, nested: n, hasBeenOpened: r, preventScrollRes
|
|
|
2045
2046
|
i,
|
|
2046
2047
|
t,
|
|
2047
2048
|
n,
|
|
2048
|
-
|
|
2049
|
+
v,
|
|
2049
2050
|
m
|
|
2050
2051
|
]), {
|
|
2051
2052
|
restorePositionSetting: m
|
|
2052
2053
|
};
|
|
2053
2054
|
}
|
|
2054
2055
|
const oo = /* @__PURE__ */ new WeakMap();
|
|
2055
|
-
function
|
|
2056
|
+
function I(e, t, n = !1) {
|
|
2056
2057
|
if (!e || !(e instanceof HTMLElement)) return;
|
|
2057
2058
|
let r = {};
|
|
2058
2059
|
Object.entries(t).forEach(([a, s]) => {
|
|
@@ -2063,7 +2064,7 @@ function O(e, t, n = !1) {
|
|
|
2063
2064
|
r[a] = e.style[a], e.style[a] = s;
|
|
2064
2065
|
}), !n && oo.set(e, r);
|
|
2065
2066
|
}
|
|
2066
|
-
function
|
|
2067
|
+
function dt(e, t) {
|
|
2067
2068
|
if (!e || !(e instanceof HTMLElement)) return;
|
|
2068
2069
|
let n = oo.get(e);
|
|
2069
2070
|
n && (t ? e.style[t] = n[t] : Object.entries(n).forEach(([r, a]) => {
|
|
@@ -2082,7 +2083,7 @@ const z = (e) => {
|
|
|
2082
2083
|
return e;
|
|
2083
2084
|
}
|
|
2084
2085
|
};
|
|
2085
|
-
function
|
|
2086
|
+
function ft(e, t) {
|
|
2086
2087
|
if (!e)
|
|
2087
2088
|
return null;
|
|
2088
2089
|
const n = window.getComputedStyle(e), r = (
|
|
@@ -2105,14 +2106,14 @@ const T = {
|
|
|
2105
2106
|
]
|
|
2106
2107
|
}, ao = 0.4;
|
|
2107
2108
|
function so(e) {
|
|
2108
|
-
const t =
|
|
2109
|
-
return
|
|
2109
|
+
const t = g.useRef(e);
|
|
2110
|
+
return g.useEffect(() => {
|
|
2110
2111
|
t.current = e;
|
|
2111
|
-
}),
|
|
2112
|
+
}), g.useMemo(() => (...n) => t.current == null ? void 0 : t.current.call(t, ...n), []);
|
|
2112
2113
|
}
|
|
2113
2114
|
function ul({ defaultProp: e, onChange: t }) {
|
|
2114
|
-
const n =
|
|
2115
|
-
return
|
|
2115
|
+
const n = g.useState(e), [r] = n, a = g.useRef(r), s = so(t);
|
|
2116
|
+
return g.useEffect(() => {
|
|
2116
2117
|
a.current !== r && (s(r), a.current = r);
|
|
2117
2118
|
}, [
|
|
2118
2119
|
r,
|
|
@@ -2125,12 +2126,12 @@ function dl({ prop: e, defaultProp: t, onChange: n = () => {
|
|
|
2125
2126
|
const [r, a] = ul({
|
|
2126
2127
|
defaultProp: t,
|
|
2127
2128
|
onChange: n
|
|
2128
|
-
}), s = e !== void 0, i = s ? e : r, l = so(n),
|
|
2129
|
+
}), s = e !== void 0, i = s ? e : r, l = so(n), u = g.useCallback((v) => {
|
|
2129
2130
|
if (s) {
|
|
2130
|
-
const c = typeof
|
|
2131
|
+
const c = typeof v == "function" ? v(e) : v;
|
|
2131
2132
|
c !== e && l(c);
|
|
2132
2133
|
} else
|
|
2133
|
-
a(
|
|
2134
|
+
a(v);
|
|
2134
2135
|
}, [
|
|
2135
2136
|
s,
|
|
2136
2137
|
e,
|
|
@@ -2139,93 +2140,93 @@ function dl({ prop: e, defaultProp: t, onChange: n = () => {
|
|
|
2139
2140
|
]);
|
|
2140
2141
|
return [
|
|
2141
2142
|
i,
|
|
2142
|
-
|
|
2143
|
+
u
|
|
2143
2144
|
];
|
|
2144
2145
|
}
|
|
2145
2146
|
function fl({ activeSnapPointProp: e, setActiveSnapPointProp: t, snapPoints: n, drawerRef: r, overlayRef: a, fadeFromIndex: s, onSnapPointChange: i, direction: l = "bottom" }) {
|
|
2146
|
-
const [
|
|
2147
|
+
const [u, v] = dl({
|
|
2147
2148
|
prop: e,
|
|
2148
2149
|
defaultProp: n == null ? void 0 : n[0],
|
|
2149
2150
|
onChange: t
|
|
2150
|
-
}), m =
|
|
2151
|
+
}), m = g.useMemo(() => u === (n == null ? void 0 : n[n.length - 1]) || null, [
|
|
2151
2152
|
n,
|
|
2152
|
-
|
|
2153
|
-
]), c = n && n.length > 0 && (s || s === 0) && !Number.isNaN(s) && n[s] ===
|
|
2153
|
+
u
|
|
2154
|
+
]), c = n && n.length > 0 && (s || s === 0) && !Number.isNaN(s) && n[s] === u || !n, d = g.useMemo(() => n == null ? void 0 : n.findIndex((x) => x === u), [
|
|
2154
2155
|
n,
|
|
2155
|
-
|
|
2156
|
-
]),
|
|
2156
|
+
u
|
|
2157
|
+
]), f = g.useMemo(() => {
|
|
2157
2158
|
var x;
|
|
2158
2159
|
return (x = n == null ? void 0 : n.map((p) => {
|
|
2159
|
-
const
|
|
2160
|
+
const C = typeof window < "u", N = typeof p == "string";
|
|
2160
2161
|
let P = 0;
|
|
2161
|
-
if (
|
|
2162
|
-
const w =
|
|
2163
|
-
return
|
|
2162
|
+
if (N && (P = parseInt(p, 10)), z(l)) {
|
|
2163
|
+
const w = N ? P : C ? p * window.innerHeight : 0;
|
|
2164
|
+
return C ? l === "bottom" ? window.innerHeight - w : -window.innerHeight + w : w;
|
|
2164
2165
|
}
|
|
2165
|
-
const _ =
|
|
2166
|
-
return
|
|
2166
|
+
const _ = N ? P : C ? p * window.innerWidth : 0;
|
|
2167
|
+
return C ? l === "right" ? window.innerWidth - _ : -window.innerWidth + _ : _;
|
|
2167
2168
|
})) != null ? x : [];
|
|
2168
2169
|
}, [
|
|
2169
2170
|
n
|
|
2170
|
-
]), y =
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
]), R =
|
|
2171
|
+
]), y = g.useMemo(() => d !== null ? f == null ? void 0 : f[d] : null, [
|
|
2172
|
+
f,
|
|
2173
|
+
d
|
|
2174
|
+
]), R = g.useCallback((x) => {
|
|
2174
2175
|
var p;
|
|
2175
|
-
const
|
|
2176
|
-
i(
|
|
2176
|
+
const C = (p = f == null ? void 0 : f.findIndex((N) => N === x)) != null ? p : null;
|
|
2177
|
+
i(C), I(r.current, {
|
|
2177
2178
|
transition: `transform ${T.DURATION}s cubic-bezier(${T.EASE.join(",")})`,
|
|
2178
2179
|
transform: z(l) ? `translate3d(0, ${x}px, 0)` : `translate3d(${x}px, 0, 0)`
|
|
2179
|
-
}),
|
|
2180
|
+
}), f && C !== f.length - 1 && C !== s ? I(a.current, {
|
|
2180
2181
|
transition: `opacity ${T.DURATION}s cubic-bezier(${T.EASE.join(",")})`,
|
|
2181
2182
|
opacity: "0"
|
|
2182
|
-
}) :
|
|
2183
|
+
}) : I(a.current, {
|
|
2183
2184
|
transition: `opacity ${T.DURATION}s cubic-bezier(${T.EASE.join(",")})`,
|
|
2184
2185
|
opacity: "1"
|
|
2185
|
-
}),
|
|
2186
|
+
}), v(C !== null ? n == null ? void 0 : n[C] : null);
|
|
2186
2187
|
}, [
|
|
2187
2188
|
r.current,
|
|
2188
2189
|
n,
|
|
2189
|
-
|
|
2190
|
+
f,
|
|
2190
2191
|
s,
|
|
2191
2192
|
a,
|
|
2192
|
-
|
|
2193
|
+
v
|
|
2193
2194
|
]);
|
|
2194
|
-
|
|
2195
|
-
if (
|
|
2195
|
+
g.useEffect(() => {
|
|
2196
|
+
if (u || e) {
|
|
2196
2197
|
var x;
|
|
2197
|
-
const p = (x = n == null ? void 0 : n.findIndex((
|
|
2198
|
-
|
|
2198
|
+
const p = (x = n == null ? void 0 : n.findIndex((C) => C === e || C === u)) != null ? x : -1;
|
|
2199
|
+
f && p !== -1 && typeof f[p] == "number" && R(f[p]);
|
|
2199
2200
|
}
|
|
2200
2201
|
}, [
|
|
2201
|
-
|
|
2202
|
+
u,
|
|
2202
2203
|
e,
|
|
2203
2204
|
n,
|
|
2204
|
-
|
|
2205
|
+
f,
|
|
2205
2206
|
R
|
|
2206
2207
|
]);
|
|
2207
|
-
function K({ draggedDistance: x, closeDrawer: p, velocity:
|
|
2208
|
+
function K({ draggedDistance: x, closeDrawer: p, velocity: C, dismissible: N }) {
|
|
2208
2209
|
if (s === void 0) return;
|
|
2209
|
-
const P = l === "bottom" || l === "right" ? (y ?? 0) - x : (y ?? 0) + x, _ =
|
|
2210
|
-
if (_ &&
|
|
2210
|
+
const P = l === "bottom" || l === "right" ? (y ?? 0) - x : (y ?? 0) + x, _ = d === s - 1, w = d === 0, L = x > 0;
|
|
2211
|
+
if (_ && I(a.current, {
|
|
2211
2212
|
transition: `opacity ${T.DURATION}s cubic-bezier(${T.EASE.join(",")})`
|
|
2212
|
-
}),
|
|
2213
|
-
|
|
2213
|
+
}), C > 2 && !L) {
|
|
2214
|
+
N ? p() : R(f[0]);
|
|
2214
2215
|
return;
|
|
2215
2216
|
}
|
|
2216
|
-
if (
|
|
2217
|
-
R(
|
|
2217
|
+
if (C > 2 && L && f && n) {
|
|
2218
|
+
R(f[n.length - 1]);
|
|
2218
2219
|
return;
|
|
2219
2220
|
}
|
|
2220
|
-
const te =
|
|
2221
|
-
if (
|
|
2221
|
+
const te = f == null ? void 0 : f.reduce((V, X) => typeof V != "number" || typeof X != "number" ? V : Math.abs(X - P) < Math.abs(V - P) ? X : V), Q = z(l) ? window.innerHeight : window.innerWidth;
|
|
2222
|
+
if (C > ao && Math.abs(x) < Q * 0.4) {
|
|
2222
2223
|
const V = L ? 1 : -1;
|
|
2223
2224
|
if (V > 0 && m) {
|
|
2224
|
-
R(
|
|
2225
|
+
R(f[n.length - 1]);
|
|
2225
2226
|
return;
|
|
2226
2227
|
}
|
|
2227
|
-
if (w && V < 0 &&
|
|
2228
|
-
R(
|
|
2228
|
+
if (w && V < 0 && N && p(), d === null) return;
|
|
2229
|
+
R(f[d + V]);
|
|
2229
2230
|
return;
|
|
2230
2231
|
}
|
|
2231
2232
|
R(te);
|
|
@@ -2233,72 +2234,72 @@ function fl({ activeSnapPointProp: e, setActiveSnapPointProp: t, snapPoints: n,
|
|
|
2233
2234
|
function H({ draggedDistance: x }) {
|
|
2234
2235
|
if (y === null) return;
|
|
2235
2236
|
const p = l === "bottom" || l === "right" ? y - x : y + x;
|
|
2236
|
-
(l === "bottom" || l === "right") && p <
|
|
2237
|
+
(l === "bottom" || l === "right") && p < f[f.length - 1] || (l === "top" || l === "left") && p > f[f.length - 1] || I(r.current, {
|
|
2237
2238
|
transform: z(l) ? `translate3d(0, ${p}px, 0)` : `translate3d(${p}px, 0, 0)`
|
|
2238
2239
|
});
|
|
2239
2240
|
}
|
|
2240
2241
|
function q(x, p) {
|
|
2241
|
-
if (!n || typeof
|
|
2242
|
-
const
|
|
2243
|
-
if (
|
|
2242
|
+
if (!n || typeof d != "number" || !f || s === void 0) return null;
|
|
2243
|
+
const C = d === s - 1;
|
|
2244
|
+
if (d >= s && p)
|
|
2244
2245
|
return 0;
|
|
2245
|
-
if (
|
|
2246
|
-
if (!c && !
|
|
2247
|
-
const P =
|
|
2248
|
-
return
|
|
2246
|
+
if (C && !p) return 1;
|
|
2247
|
+
if (!c && !C) return null;
|
|
2248
|
+
const P = C ? d + 1 : d - 1, _ = C ? f[P] - f[P - 1] : f[P + 1] - f[P], w = x / Math.abs(_);
|
|
2249
|
+
return C ? 1 - w : w;
|
|
2249
2250
|
}
|
|
2250
2251
|
return {
|
|
2251
2252
|
isLastSnapPoint: m,
|
|
2252
|
-
activeSnapPoint:
|
|
2253
|
+
activeSnapPoint: u,
|
|
2253
2254
|
shouldFade: c,
|
|
2254
2255
|
getPercentageDragged: q,
|
|
2255
|
-
setActiveSnapPoint:
|
|
2256
|
-
activeSnapPointIndex:
|
|
2256
|
+
setActiveSnapPoint: v,
|
|
2257
|
+
activeSnapPointIndex: d,
|
|
2257
2258
|
onRelease: K,
|
|
2258
2259
|
onDrag: H,
|
|
2259
|
-
snapPointsOffset:
|
|
2260
|
+
snapPointsOffset: f
|
|
2260
2261
|
};
|
|
2261
2262
|
}
|
|
2262
|
-
const hl = 0.25, pl = 100, yn = 8,
|
|
2263
|
-
function io({ open: e, onOpenChange: t, children: n, shouldScaleBackground: r, onDrag: a, onRelease: s, snapPoints: i, nested: l = !1, setBackgroundColorOnScale:
|
|
2263
|
+
const hl = 0.25, pl = 100, yn = 8, Ne = 16, Mn = 26, Ct = "vaul-dragging";
|
|
2264
|
+
function io({ open: e, onOpenChange: t, children: n, shouldScaleBackground: r, onDrag: a, onRelease: s, snapPoints: i, nested: l = !1, setBackgroundColorOnScale: u = !0, closeThreshold: v = hl, scrollLockTimeout: m = pl, dismissible: c = !0, handleOnly: d = !1, fadeFromIndex: f = i && i.length - 1, activeSnapPoint: y, setActiveSnapPoint: R, fixed: K, modal: H = !0, onClose: q, noBodyStyles: x, direction: p = "bottom", preventScrollRestoration: C = !0, disablePreventScroll: N = !1 }) {
|
|
2264
2265
|
var P;
|
|
2265
|
-
const [_ = !1, w] =
|
|
2266
|
-
i &&
|
|
2267
|
-
}, []), { activeSnapPoint: yo, activeSnapPointIndex: ze, setActiveSnapPoint: tn, onRelease:
|
|
2266
|
+
const [_ = !1, w] = g.useState(!1), [L, te] = g.useState(!1), [Q, V] = g.useState(!1), [X, Oe] = g.useState(!1), [he, Be] = g.useState(!1), [xe, E] = g.useState(!1), U = g.useRef(null), Y = g.useRef(null), ne = g.useRef(null), De = g.useRef(null), pe = g.useRef(null), ye = g.useRef(!1), me = g.useRef(null), le = g.useRef(0), ge = g.useRef(!1), re = g.useRef(0), M = g.useRef(null), en = g.useRef(((P = M.current) == null ? void 0 : P.getBoundingClientRect().height) || 0), bt = g.useRef(0), xo = g.useCallback((S) => {
|
|
2267
|
+
i && S === Ke.length - 1 && (Y.current = /* @__PURE__ */ new Date());
|
|
2268
|
+
}, []), { activeSnapPoint: yo, activeSnapPointIndex: ze, setActiveSnapPoint: tn, onRelease: Mo, snapPointsOffset: Ke, onDrag: So, shouldFade: nn, getPercentageDragged: Eo } = fl({
|
|
2268
2269
|
snapPoints: i,
|
|
2269
2270
|
activeSnapPointProp: y,
|
|
2270
2271
|
setActiveSnapPointProp: R,
|
|
2271
|
-
drawerRef:
|
|
2272
|
-
fadeFromIndex:
|
|
2272
|
+
drawerRef: M,
|
|
2273
|
+
fadeFromIndex: f,
|
|
2273
2274
|
overlayRef: U,
|
|
2274
2275
|
onSnapPointChange: xo,
|
|
2275
2276
|
direction: p
|
|
2276
2277
|
});
|
|
2277
2278
|
rl({
|
|
2278
|
-
isDisabled: !_ || he || !H || xe || !L ||
|
|
2279
|
+
isDisabled: !_ || he || !H || xe || !L || N
|
|
2279
2280
|
});
|
|
2280
|
-
const { restorePositionSetting:
|
|
2281
|
+
const { restorePositionSetting: Co } = ll({
|
|
2281
2282
|
isOpen: _,
|
|
2282
2283
|
modal: H,
|
|
2283
2284
|
nested: l,
|
|
2284
2285
|
hasBeenOpened: L,
|
|
2285
|
-
preventScrollRestoration:
|
|
2286
|
+
preventScrollRestoration: C,
|
|
2286
2287
|
noBodyStyles: x
|
|
2287
2288
|
});
|
|
2288
|
-
function
|
|
2289
|
-
return (window.innerWidth -
|
|
2289
|
+
function Ie() {
|
|
2290
|
+
return (window.innerWidth - Mn) / window.innerWidth;
|
|
2290
2291
|
}
|
|
2291
|
-
function Ro(
|
|
2292
|
+
function Ro(S) {
|
|
2292
2293
|
var D;
|
|
2293
|
-
!c && !i ||
|
|
2294
|
+
!c && !i || M.current && !M.current.contains(S.target) || (en.current = ((D = M.current) == null ? void 0 : D.getBoundingClientRect().height) || 0, Be(!0), ne.current = /* @__PURE__ */ new Date(), eo() && window.addEventListener("touchend", () => ye.current = !1, {
|
|
2294
2295
|
once: !0
|
|
2295
|
-
}),
|
|
2296
|
+
}), S.target.setPointerCapture(S.pointerId), le.current = z(p) ? S.clientY : S.clientX);
|
|
2296
2297
|
}
|
|
2297
|
-
function rn(
|
|
2298
|
+
function rn(S, D) {
|
|
2298
2299
|
var k;
|
|
2299
|
-
let
|
|
2300
|
-
const F = (k = window.getSelection()) == null ? void 0 : k.toString(), B =
|
|
2301
|
-
if (
|
|
2300
|
+
let j = S;
|
|
2301
|
+
const F = (k = window.getSelection()) == null ? void 0 : k.toString(), B = M.current ? ft(M.current, p) : null, oe = /* @__PURE__ */ new Date();
|
|
2302
|
+
if (j.hasAttribute("data-vaul-no-drag") || j.closest("[data-vaul-no-drag]"))
|
|
2302
2303
|
return !1;
|
|
2303
2304
|
if (p === "right" || p === "left")
|
|
2304
2305
|
return !0;
|
|
@@ -2310,86 +2311,86 @@ function io({ open: e, onOpenChange: t, children: n, shouldScaleBackground: r, o
|
|
|
2310
2311
|
return !1;
|
|
2311
2312
|
if (pe.current && oe.getTime() - pe.current.getTime() < m && B === 0 || D)
|
|
2312
2313
|
return pe.current = oe, !1;
|
|
2313
|
-
for (;
|
|
2314
|
-
if (
|
|
2315
|
-
if (
|
|
2314
|
+
for (; j; ) {
|
|
2315
|
+
if (j.scrollHeight > j.clientHeight) {
|
|
2316
|
+
if (j.scrollTop !== 0)
|
|
2316
2317
|
return pe.current = /* @__PURE__ */ new Date(), !1;
|
|
2317
|
-
if (
|
|
2318
|
+
if (j.getAttribute("role") === "dialog")
|
|
2318
2319
|
return !0;
|
|
2319
2320
|
}
|
|
2320
|
-
|
|
2321
|
+
j = j.parentNode;
|
|
2321
2322
|
}
|
|
2322
2323
|
return !0;
|
|
2323
2324
|
}
|
|
2324
|
-
function Do(
|
|
2325
|
-
if (
|
|
2326
|
-
const D = p === "bottom" || p === "right" ? 1 : -1, k = (le.current - (z(p) ?
|
|
2325
|
+
function Do(S) {
|
|
2326
|
+
if (M.current && he) {
|
|
2327
|
+
const D = p === "bottom" || p === "right" ? 1 : -1, k = (le.current - (z(p) ? S.clientY : S.clientX)) * D, j = k > 0, F = i && !c && !j;
|
|
2327
2328
|
if (F && ze === 0) return;
|
|
2328
2329
|
const B = Math.abs(k), oe = document.querySelector("[vaul-drawer-wrapper]");
|
|
2329
2330
|
let ce = B / en.current;
|
|
2330
|
-
const
|
|
2331
|
-
if (
|
|
2332
|
-
if (
|
|
2331
|
+
const Me = Eo(B, j);
|
|
2332
|
+
if (Me !== null && (ce = Me), F && ce >= 1 || !ye.current && !rn(S.target, j)) return;
|
|
2333
|
+
if (M.current.classList.add(Ct), ye.current = !0, I(M.current, {
|
|
2333
2334
|
transition: "none"
|
|
2334
|
-
}),
|
|
2335
|
+
}), I(U.current, {
|
|
2335
2336
|
transition: "none"
|
|
2336
|
-
}), i &&
|
|
2337
|
+
}), i && So({
|
|
2337
2338
|
draggedDistance: k
|
|
2338
|
-
}),
|
|
2339
|
-
const
|
|
2340
|
-
|
|
2341
|
-
transform: z(p) ? `translate3d(0, ${
|
|
2339
|
+
}), j && !i) {
|
|
2340
|
+
const je = cl(k), st = Math.min(je * -1, 0) * D;
|
|
2341
|
+
I(M.current, {
|
|
2342
|
+
transform: z(p) ? `translate3d(0, ${st}px, 0)` : `translate3d(${st}px, 0, 0)`
|
|
2342
2343
|
});
|
|
2343
2344
|
return;
|
|
2344
2345
|
}
|
|
2345
|
-
const
|
|
2346
|
-
if ((nn ||
|
|
2347
|
-
opacity: `${
|
|
2346
|
+
const at = 1 - ce;
|
|
2347
|
+
if ((nn || f && ze === f - 1) && (a == null || a(S, ce), I(U.current, {
|
|
2348
|
+
opacity: `${at}`,
|
|
2348
2349
|
transition: "none"
|
|
2349
2350
|
}, !0)), oe && U.current && r) {
|
|
2350
|
-
const
|
|
2351
|
-
|
|
2352
|
-
borderRadius: `${
|
|
2353
|
-
transform: z(p) ? `scale(${
|
|
2351
|
+
const je = Math.min(Ie() + ce * (1 - Ie()), 1), st = 8 - ce * 8, an = Math.max(0, 14 - ce * 14);
|
|
2352
|
+
I(oe, {
|
|
2353
|
+
borderRadius: `${st}px`,
|
|
2354
|
+
transform: z(p) ? `scale(${je}) translate3d(0, ${an}px, 0)` : `scale(${je}) translate3d(${an}px, 0, 0)`,
|
|
2354
2355
|
transition: "none"
|
|
2355
2356
|
}, !0);
|
|
2356
2357
|
}
|
|
2357
2358
|
if (!i) {
|
|
2358
|
-
const
|
|
2359
|
-
|
|
2360
|
-
transform: z(p) ? `translate3d(0, ${
|
|
2359
|
+
const je = B * D;
|
|
2360
|
+
I(M.current, {
|
|
2361
|
+
transform: z(p) ? `translate3d(0, ${je}px, 0)` : `translate3d(${je}px, 0, 0)`
|
|
2361
2362
|
});
|
|
2362
2363
|
}
|
|
2363
2364
|
}
|
|
2364
2365
|
}
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
}, []),
|
|
2368
|
-
var
|
|
2366
|
+
g.useEffect(() => () => {
|
|
2367
|
+
ot(!1), Co();
|
|
2368
|
+
}, []), g.useEffect(() => {
|
|
2369
|
+
var S;
|
|
2369
2370
|
function D() {
|
|
2370
|
-
if (!
|
|
2371
|
+
if (!M.current) return;
|
|
2371
2372
|
const k = document.activeElement;
|
|
2372
|
-
if (
|
|
2373
|
-
var
|
|
2374
|
-
const F = ((
|
|
2373
|
+
if (Pt(k) || ge.current) {
|
|
2374
|
+
var j;
|
|
2375
|
+
const F = ((j = window.visualViewport) == null ? void 0 : j.height) || 0;
|
|
2375
2376
|
let B = window.innerHeight - F;
|
|
2376
|
-
const oe =
|
|
2377
|
-
|
|
2378
|
-
const ce =
|
|
2377
|
+
const oe = M.current.getBoundingClientRect().height || 0;
|
|
2378
|
+
bt.current || (bt.current = oe);
|
|
2379
|
+
const ce = M.current.getBoundingClientRect().top;
|
|
2379
2380
|
if (Math.abs(re.current - B) > 60 && (ge.current = !ge.current), i && i.length > 0 && Ke && ze) {
|
|
2380
|
-
const
|
|
2381
|
-
B +=
|
|
2381
|
+
const Me = Ke[ze] || 0;
|
|
2382
|
+
B += Me;
|
|
2382
2383
|
}
|
|
2383
2384
|
if (re.current = B, oe > F || ge.current) {
|
|
2384
|
-
const
|
|
2385
|
-
let
|
|
2386
|
-
|
|
2385
|
+
const Me = M.current.getBoundingClientRect().height;
|
|
2386
|
+
let at = Me;
|
|
2387
|
+
Me > F && (at = F - Mn), K ? M.current.style.height = `${Me - Math.max(B, 0)}px` : M.current.style.height = `${Math.max(at, F - ce)}px`;
|
|
2387
2388
|
} else
|
|
2388
|
-
|
|
2389
|
-
i && i.length > 0 && !ge.current ?
|
|
2389
|
+
M.current.style.height = `${bt.current}px`;
|
|
2390
|
+
i && i.length > 0 && !ge.current ? M.current.style.bottom = "0px" : M.current.style.bottom = `${Math.max(B, 0)}px`;
|
|
2390
2391
|
}
|
|
2391
2392
|
}
|
|
2392
|
-
return (
|
|
2393
|
+
return (S = window.visualViewport) == null || S.addEventListener("resize", D), () => {
|
|
2393
2394
|
var k;
|
|
2394
2395
|
return (k = window.visualViewport) == null ? void 0 : k.removeEventListener("resize", D);
|
|
2395
2396
|
};
|
|
@@ -2398,57 +2399,57 @@ function io({ open: e, onOpenChange: t, children: n, shouldScaleBackground: r, o
|
|
|
2398
2399
|
i,
|
|
2399
2400
|
Ke
|
|
2400
2401
|
]);
|
|
2401
|
-
function
|
|
2402
|
-
|
|
2402
|
+
function Ae() {
|
|
2403
|
+
M.current && (jo(), q == null || q(), I(M.current, {
|
|
2403
2404
|
transform: z(p) ? `translate3d(0, ${p === "bottom" ? "100%" : "-100%"}, 0)` : `translate3d(${p === "right" ? "100%" : "-100%"}, 0, 0)`,
|
|
2404
2405
|
transition: `transform ${T.DURATION}s cubic-bezier(${T.EASE.join(",")})`
|
|
2405
|
-
}),
|
|
2406
|
+
}), I(U.current, {
|
|
2406
2407
|
opacity: "0",
|
|
2407
2408
|
transition: `opacity ${T.DURATION}s cubic-bezier(${T.EASE.join(",")})`
|
|
2408
|
-
}),
|
|
2409
|
+
}), ot(!1), setTimeout(() => {
|
|
2409
2410
|
V(!1), w(!1);
|
|
2410
2411
|
}, 300), setTimeout(() => {
|
|
2411
2412
|
i && tn(i[0]);
|
|
2412
2413
|
}, T.DURATION * 1e3));
|
|
2413
2414
|
}
|
|
2414
|
-
|
|
2415
|
+
g.useEffect(() => {
|
|
2415
2416
|
if (!_ && r) {
|
|
2416
|
-
const
|
|
2417
|
-
|
|
2417
|
+
const S = setTimeout(() => {
|
|
2418
|
+
dt(document.body);
|
|
2418
2419
|
}, 200);
|
|
2419
|
-
return () => clearTimeout(
|
|
2420
|
+
return () => clearTimeout(S);
|
|
2420
2421
|
}
|
|
2421
2422
|
}, [
|
|
2422
2423
|
_,
|
|
2423
2424
|
r
|
|
2424
2425
|
]), Zr(() => {
|
|
2425
|
-
e ? (w(!0), te(!0)) :
|
|
2426
|
+
e ? (w(!0), te(!0)) : Ae();
|
|
2426
2427
|
}, [
|
|
2427
2428
|
e
|
|
2428
|
-
]),
|
|
2429
|
+
]), g.useEffect(() => {
|
|
2429
2430
|
X && (t == null || t(_));
|
|
2430
2431
|
}, [
|
|
2431
2432
|
_
|
|
2432
|
-
]),
|
|
2433
|
+
]), g.useEffect(() => {
|
|
2433
2434
|
Oe(!0);
|
|
2434
2435
|
}, []);
|
|
2435
2436
|
function on() {
|
|
2436
|
-
if (!
|
|
2437
|
-
const
|
|
2438
|
-
|
|
2437
|
+
if (!M.current) return;
|
|
2438
|
+
const S = document.querySelector("[vaul-drawer-wrapper]"), D = ft(M.current, p);
|
|
2439
|
+
I(M.current, {
|
|
2439
2440
|
transform: "translate3d(0, 0, 0)",
|
|
2440
2441
|
transition: `transform ${T.DURATION}s cubic-bezier(${T.EASE.join(",")})`
|
|
2441
|
-
}),
|
|
2442
|
+
}), I(U.current, {
|
|
2442
2443
|
transition: `opacity ${T.DURATION}s cubic-bezier(${T.EASE.join(",")})`,
|
|
2443
2444
|
opacity: "1"
|
|
2444
|
-
}), r && D && D > 0 && _ &&
|
|
2445
|
+
}), r && D && D > 0 && _ && I(S, {
|
|
2445
2446
|
borderRadius: `${yn}px`,
|
|
2446
2447
|
overflow: "hidden",
|
|
2447
2448
|
...z(p) ? {
|
|
2448
|
-
transform: `scale(${
|
|
2449
|
+
transform: `scale(${Ie()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,
|
|
2449
2450
|
transformOrigin: "top"
|
|
2450
2451
|
} : {
|
|
2451
|
-
transform: `scale(${
|
|
2452
|
+
transform: `scale(${Ie()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,
|
|
2452
2453
|
transformOrigin: "left"
|
|
2453
2454
|
},
|
|
2454
2455
|
transitionProperty: "transform, border-radius",
|
|
@@ -2456,143 +2457,143 @@ function io({ open: e, onOpenChange: t, children: n, shouldScaleBackground: r, o
|
|
|
2456
2457
|
transitionTimingFunction: `cubic-bezier(${T.EASE.join(",")})`
|
|
2457
2458
|
}, !0);
|
|
2458
2459
|
}
|
|
2459
|
-
function
|
|
2460
|
-
!he || !
|
|
2461
|
-
}
|
|
2462
|
-
function
|
|
2463
|
-
if (!he || !
|
|
2464
|
-
|
|
2465
|
-
const D =
|
|
2466
|
-
if (!rn(
|
|
2467
|
-
const k = De.current.getTime() - ne.current.getTime(),
|
|
2468
|
-
if (F > 0.05 && (
|
|
2469
|
-
|
|
2460
|
+
function jo() {
|
|
2461
|
+
!he || !M.current || (M.current.classList.remove(Ct), ye.current = !1, Be(!1), De.current = /* @__PURE__ */ new Date());
|
|
2462
|
+
}
|
|
2463
|
+
function No(S) {
|
|
2464
|
+
if (!he || !M.current) return;
|
|
2465
|
+
M.current.classList.remove(Ct), ye.current = !1, Be(!1), De.current = /* @__PURE__ */ new Date();
|
|
2466
|
+
const D = ft(M.current, p);
|
|
2467
|
+
if (!rn(S.target, !1) || !D || Number.isNaN(D) || ne.current === null) return;
|
|
2468
|
+
const k = De.current.getTime() - ne.current.getTime(), j = le.current - (z(p) ? S.clientY : S.clientX), F = Math.abs(j) / k;
|
|
2469
|
+
if (F > 0.05 && (E(!0), setTimeout(() => {
|
|
2470
|
+
E(!1);
|
|
2470
2471
|
}, 200)), i) {
|
|
2471
|
-
|
|
2472
|
-
draggedDistance:
|
|
2473
|
-
closeDrawer:
|
|
2472
|
+
Mo({
|
|
2473
|
+
draggedDistance: j * (p === "bottom" || p === "right" ? 1 : -1),
|
|
2474
|
+
closeDrawer: Ae,
|
|
2474
2475
|
velocity: F,
|
|
2475
2476
|
dismissible: c
|
|
2476
|
-
}), s == null || s(
|
|
2477
|
+
}), s == null || s(S, !0);
|
|
2477
2478
|
return;
|
|
2478
2479
|
}
|
|
2479
|
-
if (p === "bottom" || p === "right" ?
|
|
2480
|
-
on(), s == null || s(
|
|
2480
|
+
if (p === "bottom" || p === "right" ? j > 0 : j < 0) {
|
|
2481
|
+
on(), s == null || s(S, !0);
|
|
2481
2482
|
return;
|
|
2482
2483
|
}
|
|
2483
2484
|
if (F > ao) {
|
|
2484
|
-
|
|
2485
|
+
Ae(), s == null || s(S, !1);
|
|
2485
2486
|
return;
|
|
2486
2487
|
}
|
|
2487
2488
|
var B;
|
|
2488
|
-
const oe = Math.min((B =
|
|
2489
|
-
if (D >= oe *
|
|
2490
|
-
|
|
2489
|
+
const oe = Math.min((B = M.current.getBoundingClientRect().height) != null ? B : 0, window.innerHeight);
|
|
2490
|
+
if (D >= oe * v) {
|
|
2491
|
+
Ae(), s == null || s(S, !1);
|
|
2491
2492
|
return;
|
|
2492
2493
|
}
|
|
2493
|
-
s == null || s(
|
|
2494
|
+
s == null || s(S, !0), on();
|
|
2494
2495
|
}
|
|
2495
|
-
|
|
2496
|
-
_ && (
|
|
2496
|
+
g.useEffect(() => {
|
|
2497
|
+
_ && (I(document.documentElement, {
|
|
2497
2498
|
scrollBehavior: "auto"
|
|
2498
|
-
}), Y.current = /* @__PURE__ */ new Date(),
|
|
2499
|
+
}), Y.current = /* @__PURE__ */ new Date(), ot(!0));
|
|
2499
2500
|
}, [
|
|
2500
2501
|
_
|
|
2501
|
-
]),
|
|
2502
|
-
if (
|
|
2503
|
-
var
|
|
2504
|
-
const D =
|
|
2502
|
+
]), g.useEffect(() => {
|
|
2503
|
+
if (M.current && Q) {
|
|
2504
|
+
var S;
|
|
2505
|
+
const D = M == null || (S = M.current) == null ? void 0 : S.querySelectorAll("*");
|
|
2505
2506
|
D == null || D.forEach((k) => {
|
|
2506
|
-
const
|
|
2507
|
-
(
|
|
2507
|
+
const j = k;
|
|
2508
|
+
(j.scrollHeight > j.clientHeight || j.scrollWidth > j.clientWidth) && j.classList.add("vaul-scrollable");
|
|
2508
2509
|
});
|
|
2509
2510
|
}
|
|
2510
2511
|
}, [
|
|
2511
2512
|
Q
|
|
2512
2513
|
]);
|
|
2513
|
-
function
|
|
2514
|
+
function ot(S) {
|
|
2514
2515
|
const D = document.querySelector("[vaul-drawer-wrapper]");
|
|
2515
|
-
!D || !r || (
|
|
2516
|
+
!D || !r || (S ? (u && (x || (I(document.body, {
|
|
2516
2517
|
background: document.body.style.backgroundColor || document.body.style.background
|
|
2517
|
-
}),
|
|
2518
|
+
}), I(document.body, {
|
|
2518
2519
|
background: "black"
|
|
2519
|
-
}, !0))),
|
|
2520
|
+
}, !0))), I(D, {
|
|
2520
2521
|
borderRadius: `${yn}px`,
|
|
2521
2522
|
overflow: "hidden",
|
|
2522
2523
|
...z(p) ? {
|
|
2523
|
-
transform: `scale(${
|
|
2524
|
+
transform: `scale(${Ie()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,
|
|
2524
2525
|
transformOrigin: "top"
|
|
2525
2526
|
} : {
|
|
2526
|
-
transform: `scale(${
|
|
2527
|
+
transform: `scale(${Ie()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,
|
|
2527
2528
|
transformOrigin: "left"
|
|
2528
2529
|
},
|
|
2529
2530
|
transitionProperty: "transform, border-radius",
|
|
2530
2531
|
transitionDuration: `${T.DURATION}s`,
|
|
2531
2532
|
transitionTimingFunction: `cubic-bezier(${T.EASE.join(",")})`
|
|
2532
|
-
})) : (
|
|
2533
|
+
})) : (dt(D, "overflow"), dt(D, "transform"), dt(D, "borderRadius"), I(D, {
|
|
2533
2534
|
transitionProperty: "transform, border-radius",
|
|
2534
2535
|
transitionDuration: `${T.DURATION}s`,
|
|
2535
2536
|
transitionTimingFunction: `cubic-bezier(${T.EASE.join(",")})`
|
|
2536
2537
|
})));
|
|
2537
2538
|
}
|
|
2538
|
-
function Po(
|
|
2539
|
-
const D =
|
|
2540
|
-
me.current && window.clearTimeout(me.current),
|
|
2539
|
+
function Po(S) {
|
|
2540
|
+
const D = S ? (window.innerWidth - Ne) / window.innerWidth : 1, k = S ? -Ne : 0;
|
|
2541
|
+
me.current && window.clearTimeout(me.current), I(M.current, {
|
|
2541
2542
|
transition: `transform ${T.DURATION}s cubic-bezier(${T.EASE.join(",")})`,
|
|
2542
2543
|
transform: `scale(${D}) translate3d(0, ${k}px, 0)`
|
|
2543
|
-
}), !
|
|
2544
|
-
const
|
|
2545
|
-
|
|
2544
|
+
}), !S && M.current && (me.current = setTimeout(() => {
|
|
2545
|
+
const j = ft(M.current, p);
|
|
2546
|
+
I(M.current, {
|
|
2546
2547
|
transition: "none",
|
|
2547
|
-
transform: z(p) ? `translate3d(0, ${
|
|
2548
|
+
transform: z(p) ? `translate3d(0, ${j}px, 0)` : `translate3d(${j}px, 0, 0)`
|
|
2548
2549
|
});
|
|
2549
2550
|
}, 500));
|
|
2550
2551
|
}
|
|
2551
|
-
function To(
|
|
2552
|
+
function To(S, D) {
|
|
2552
2553
|
if (D < 0) return;
|
|
2553
|
-
const k = z(p) ? window.innerHeight : window.innerWidth,
|
|
2554
|
-
|
|
2554
|
+
const k = z(p) ? window.innerHeight : window.innerWidth, j = (k - Ne) / k, F = j + D * (1 - j), B = -Ne + D * Ne;
|
|
2555
|
+
I(M.current, {
|
|
2555
2556
|
transform: z(p) ? `scale(${F}) translate3d(0, ${B}px, 0)` : `scale(${F}) translate3d(${B}px, 0, 0)`,
|
|
2556
2557
|
transition: "none"
|
|
2557
2558
|
});
|
|
2558
2559
|
}
|
|
2559
|
-
function _o(
|
|
2560
|
-
const k = z(p) ? window.innerHeight : window.innerWidth,
|
|
2561
|
-
D &&
|
|
2560
|
+
function _o(S, D) {
|
|
2561
|
+
const k = z(p) ? window.innerHeight : window.innerWidth, j = D ? (k - Ne) / k : 1, F = D ? -Ne : 0;
|
|
2562
|
+
D && I(M.current, {
|
|
2562
2563
|
transition: `transform ${T.DURATION}s cubic-bezier(${T.EASE.join(",")})`,
|
|
2563
|
-
transform: z(p) ? `scale(${
|
|
2564
|
+
transform: z(p) ? `scale(${j}) translate3d(0, ${F}px, 0)` : `scale(${j}) translate3d(${F}px, 0, 0)`
|
|
2564
2565
|
});
|
|
2565
2566
|
}
|
|
2566
|
-
return /* @__PURE__ */
|
|
2567
|
+
return /* @__PURE__ */ g.createElement(Xa, {
|
|
2567
2568
|
modal: H,
|
|
2568
|
-
onOpenChange: (
|
|
2569
|
+
onOpenChange: (S) => {
|
|
2569
2570
|
if (e !== void 0) {
|
|
2570
|
-
t == null || t(
|
|
2571
|
+
t == null || t(S);
|
|
2571
2572
|
return;
|
|
2572
2573
|
}
|
|
2573
|
-
|
|
2574
|
+
S ? (te(!0), w(S)) : Ae();
|
|
2574
2575
|
},
|
|
2575
2576
|
open: _
|
|
2576
|
-
}, /* @__PURE__ */
|
|
2577
|
+
}, /* @__PURE__ */ g.createElement(Jr.Provider, {
|
|
2577
2578
|
value: {
|
|
2578
2579
|
visible: Q,
|
|
2579
2580
|
activeSnapPoint: yo,
|
|
2580
2581
|
snapPoints: i,
|
|
2581
2582
|
setActiveSnapPoint: tn,
|
|
2582
|
-
drawerRef:
|
|
2583
|
+
drawerRef: M,
|
|
2583
2584
|
overlayRef: U,
|
|
2584
|
-
scaleBackground:
|
|
2585
|
+
scaleBackground: ot,
|
|
2585
2586
|
onOpenChange: t,
|
|
2586
2587
|
onPress: Ro,
|
|
2587
2588
|
setVisible: V,
|
|
2588
|
-
onRelease:
|
|
2589
|
+
onRelease: No,
|
|
2589
2590
|
onDrag: Do,
|
|
2590
2591
|
dismissible: c,
|
|
2591
|
-
handleOnly:
|
|
2592
|
+
handleOnly: d,
|
|
2592
2593
|
isOpen: _,
|
|
2593
2594
|
isDragging: he,
|
|
2594
2595
|
shouldFade: nn,
|
|
2595
|
-
closeDrawer:
|
|
2596
|
+
closeDrawer: Ae,
|
|
2596
2597
|
onNestedDrag: To,
|
|
2597
2598
|
onNestedOpenChange: Po,
|
|
2598
2599
|
onNestedRelease: _o,
|
|
@@ -2604,8 +2605,8 @@ function io({ open: e, onOpenChange: t, children: n, shouldScaleBackground: r, o
|
|
|
2604
2605
|
}
|
|
2605
2606
|
}, n));
|
|
2606
2607
|
}
|
|
2607
|
-
const ml = 250, gl = 120, lo = /* @__PURE__ */
|
|
2608
|
-
const { visible: a, closeDrawer: s, isDragging: i, snapPoints: l, activeSnapPoint:
|
|
2608
|
+
const ml = 250, gl = 120, lo = /* @__PURE__ */ g.forwardRef(function({ preventCycle: e = !1, children: t, ...n }, r) {
|
|
2609
|
+
const { visible: a, closeDrawer: s, isDragging: i, snapPoints: l, activeSnapPoint: u, setActiveSnapPoint: v, dismissible: m, handleOnly: c, onPress: d, onDrag: f } = wt(), y = g.useRef(null), R = g.useRef(!1);
|
|
2609
2610
|
function K() {
|
|
2610
2611
|
if (R.current) {
|
|
2611
2612
|
x();
|
|
@@ -2624,14 +2625,14 @@ const ml = 250, gl = 120, lo = /* @__PURE__ */ v.forwardRef(function({ preventCy
|
|
|
2624
2625
|
s();
|
|
2625
2626
|
return;
|
|
2626
2627
|
}
|
|
2627
|
-
if (
|
|
2628
|
+
if (u === l[l.length - 1] && m) {
|
|
2628
2629
|
s();
|
|
2629
2630
|
return;
|
|
2630
2631
|
}
|
|
2631
|
-
const
|
|
2632
|
-
if (
|
|
2633
|
-
const
|
|
2634
|
-
|
|
2632
|
+
const C = l.findIndex((P) => P === u);
|
|
2633
|
+
if (C === -1) return;
|
|
2634
|
+
const N = l[C + 1];
|
|
2635
|
+
v(N);
|
|
2635
2636
|
}
|
|
2636
2637
|
function q() {
|
|
2637
2638
|
y.current = window.setTimeout(() => {
|
|
@@ -2641,17 +2642,17 @@ const ml = 250, gl = 120, lo = /* @__PURE__ */ v.forwardRef(function({ preventCy
|
|
|
2641
2642
|
function x() {
|
|
2642
2643
|
window.clearTimeout(y.current), R.current = !1;
|
|
2643
2644
|
}
|
|
2644
|
-
return /* @__PURE__ */
|
|
2645
|
+
return /* @__PURE__ */ g.createElement("div", {
|
|
2645
2646
|
onClick: K,
|
|
2646
2647
|
onDoubleClick: () => {
|
|
2647
2648
|
R.current = !0, s();
|
|
2648
2649
|
},
|
|
2649
2650
|
onPointerCancel: x,
|
|
2650
2651
|
onPointerDown: (p) => {
|
|
2651
|
-
c &&
|
|
2652
|
+
c && d(p), q();
|
|
2652
2653
|
},
|
|
2653
2654
|
onPointerMove: (p) => {
|
|
2654
|
-
c &&
|
|
2655
|
+
c && f(p);
|
|
2655
2656
|
},
|
|
2656
2657
|
// onPointerUp is already handled by the content component
|
|
2657
2658
|
ref: r,
|
|
@@ -2659,18 +2660,18 @@ const ml = 250, gl = 120, lo = /* @__PURE__ */ v.forwardRef(function({ preventCy
|
|
|
2659
2660
|
"vaul-handle": "",
|
|
2660
2661
|
"aria-hidden": "true",
|
|
2661
2662
|
...n
|
|
2662
|
-
}, /* @__PURE__ */
|
|
2663
|
+
}, /* @__PURE__ */ g.createElement("span", {
|
|
2663
2664
|
"vaul-handle-hitarea": "",
|
|
2664
2665
|
"aria-hidden": "true"
|
|
2665
2666
|
}, t));
|
|
2666
2667
|
});
|
|
2667
2668
|
lo.displayName = "Drawer.Handle";
|
|
2668
|
-
const co = /* @__PURE__ */
|
|
2669
|
-
const { overlayRef: r, snapPoints: a, onRelease: s, shouldFade: i, isOpen: l, visible:
|
|
2670
|
-
return /* @__PURE__ */
|
|
2669
|
+
const co = /* @__PURE__ */ g.forwardRef(function({ children: e, ...t }, n) {
|
|
2670
|
+
const { overlayRef: r, snapPoints: a, onRelease: s, shouldFade: i, isOpen: l, visible: u } = wt(), v = ro(n, r), m = a && a.length > 0;
|
|
2671
|
+
return /* @__PURE__ */ g.createElement(Ka, {
|
|
2671
2672
|
onMouseUp: s,
|
|
2672
|
-
ref:
|
|
2673
|
-
"vaul-drawer-visible":
|
|
2673
|
+
ref: v,
|
|
2674
|
+
"vaul-drawer-visible": u ? "true" : "false",
|
|
2674
2675
|
"vaul-overlay": "",
|
|
2675
2676
|
"vaul-snap-points": l && m ? "true" : "false",
|
|
2676
2677
|
"vaul-snap-points-overlay": l && i ? "true" : "false",
|
|
@@ -2678,8 +2679,8 @@ const co = /* @__PURE__ */ v.forwardRef(function({ children: e, ...t }, n) {
|
|
|
2678
2679
|
});
|
|
2679
2680
|
});
|
|
2680
2681
|
co.displayName = "Drawer.Overlay";
|
|
2681
|
-
const uo = /* @__PURE__ */
|
|
2682
|
-
const { drawerRef: i, onPress: l, onRelease:
|
|
2682
|
+
const uo = /* @__PURE__ */ g.forwardRef(function({ onOpenAutoFocus: e, onPointerDownOutside: t, onAnimationEnd: n, style: r, ...a }, s) {
|
|
2683
|
+
const { drawerRef: i, onPress: l, onRelease: u, onDrag: v, dismissible: m, keyboardIsOpen: c, snapPointsOffset: d, visible: f, closeDrawer: y, modal: R, openProp: K, onOpenChange: H, setVisible: q, handleOnly: x, direction: p } = wt(), C = ro(s, i), N = g.useRef(null), P = g.useRef(!1), _ = (w, L, te = 0) => {
|
|
2683
2684
|
if (P.current) return !0;
|
|
2684
2685
|
const Q = Math.abs(w.y), V = Math.abs(w.x), X = V > Q, Oe = [
|
|
2685
2686
|
"bottom",
|
|
@@ -2692,16 +2693,16 @@ const uo = /* @__PURE__ */ v.forwardRef(function({ onOpenAutoFocus: e, onPointer
|
|
|
2692
2693
|
return !X;
|
|
2693
2694
|
return P.current = !0, !0;
|
|
2694
2695
|
};
|
|
2695
|
-
return
|
|
2696
|
+
return g.useEffect(() => {
|
|
2696
2697
|
q(!0);
|
|
2697
|
-
}, []), /* @__PURE__ */
|
|
2698
|
+
}, []), /* @__PURE__ */ g.createElement(Va, {
|
|
2698
2699
|
"vaul-drawer": "",
|
|
2699
2700
|
"vaul-drawer-direction": p,
|
|
2700
|
-
"vaul-drawer-visible":
|
|
2701
|
+
"vaul-drawer-visible": f ? "true" : "false",
|
|
2701
2702
|
...a,
|
|
2702
|
-
ref:
|
|
2703
|
-
style:
|
|
2704
|
-
"--snap-point-height": `${
|
|
2703
|
+
ref: C,
|
|
2704
|
+
style: d && d.length > 0 ? {
|
|
2705
|
+
"--snap-point-height": `${d[0]}px`,
|
|
2705
2706
|
...r
|
|
2706
2707
|
} : r,
|
|
2707
2708
|
onOpenAutoFocus: (w) => {
|
|
@@ -2713,7 +2714,7 @@ const uo = /* @__PURE__ */ v.forwardRef(function({ onOpenAutoFocus: e, onPointer
|
|
|
2713
2714
|
}
|
|
2714
2715
|
},
|
|
2715
2716
|
onPointerDown: (w) => {
|
|
2716
|
-
x || (a.onPointerDown == null || a.onPointerDown.call(a, w),
|
|
2717
|
+
x || (a.onPointerDown == null || a.onPointerDown.call(a, w), N.current = {
|
|
2717
2718
|
x: w.clientX,
|
|
2718
2719
|
y: w.clientY
|
|
2719
2720
|
}, l(w));
|
|
@@ -2738,24 +2739,24 @@ const uo = /* @__PURE__ */ v.forwardRef(function({ onOpenAutoFocus: e, onPointer
|
|
|
2738
2739
|
}
|
|
2739
2740
|
},
|
|
2740
2741
|
onPointerMove: (w) => {
|
|
2741
|
-
if (x || (a.onPointerMove == null || a.onPointerMove.call(a, w), !
|
|
2742
|
-
const L = w.clientY -
|
|
2742
|
+
if (x || (a.onPointerMove == null || a.onPointerMove.call(a, w), !N.current)) return;
|
|
2743
|
+
const L = w.clientY - N.current.y, te = w.clientX - N.current.x, Q = w.pointerType === "touch" ? 10 : 2;
|
|
2743
2744
|
_({
|
|
2744
2745
|
x: te,
|
|
2745
2746
|
y: L
|
|
2746
|
-
}, p, Q) ?
|
|
2747
|
+
}, p, Q) ? v(w) : (Math.abs(te) > Q || Math.abs(L) > Q) && (N.current = null);
|
|
2747
2748
|
},
|
|
2748
2749
|
onPointerUp: (w) => {
|
|
2749
|
-
a.onPointerUp == null || a.onPointerUp.call(a, w),
|
|
2750
|
+
a.onPointerUp == null || a.onPointerUp.call(a, w), N.current = null, P.current = !1, u(w);
|
|
2750
2751
|
}
|
|
2751
2752
|
});
|
|
2752
2753
|
});
|
|
2753
2754
|
uo.displayName = "Drawer.Content";
|
|
2754
2755
|
function vl({ onDrag: e, onOpenChange: t, ...n }) {
|
|
2755
|
-
const { onNestedDrag: r, onNestedOpenChange: a, onNestedRelease: s } =
|
|
2756
|
+
const { onNestedDrag: r, onNestedOpenChange: a, onNestedRelease: s } = wt();
|
|
2756
2757
|
if (!r)
|
|
2757
2758
|
throw new Error("Drawer.NestedRoot must be placed in another drawer");
|
|
2758
|
-
return /* @__PURE__ */
|
|
2759
|
+
return /* @__PURE__ */ g.createElement(io, {
|
|
2759
2760
|
nested: !0,
|
|
2760
2761
|
onClose: () => {
|
|
2761
2762
|
a(!1);
|
|
@@ -2792,22 +2793,22 @@ const ie = {
|
|
|
2792
2793
|
}
|
|
2793
2794
|
);
|
|
2794
2795
|
Xt.displayName = "Drawer";
|
|
2795
|
-
const fo = ie.Trigger, wl = ie.Portal, bl = ie.Close, ho =
|
|
2796
|
+
const fo = ie.Trigger, wl = ie.Portal, bl = ie.Close, ho = h.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o.jsx(
|
|
2796
2797
|
ie.Overlay,
|
|
2797
2798
|
{
|
|
2798
2799
|
ref: n,
|
|
2799
|
-
className:
|
|
2800
|
+
className: O("fixed inset-0 z-50 bg-black/80", e),
|
|
2800
2801
|
...t
|
|
2801
2802
|
}
|
|
2802
2803
|
));
|
|
2803
2804
|
ho.displayName = ie.Overlay.displayName;
|
|
2804
|
-
const Jt =
|
|
2805
|
+
const Jt = h.forwardRef(({ className: e, children: t, hideBar: n = !0, ...r }, a) => /* @__PURE__ */ o.jsxs(wl, { children: [
|
|
2805
2806
|
/* @__PURE__ */ o.jsx(ho, {}),
|
|
2806
2807
|
/* @__PURE__ */ o.jsxs(
|
|
2807
2808
|
ie.Content,
|
|
2808
2809
|
{
|
|
2809
2810
|
ref: a,
|
|
2810
|
-
className:
|
|
2811
|
+
className: O(
|
|
2811
2812
|
"fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",
|
|
2812
2813
|
e
|
|
2813
2814
|
),
|
|
@@ -2820,11 +2821,11 @@ const Jt = f.forwardRef(({ className: e, children: t, hideBar: n = !0, ...r }, a
|
|
|
2820
2821
|
)
|
|
2821
2822
|
] }));
|
|
2822
2823
|
Jt.displayName = "DrawerContent";
|
|
2823
|
-
const Zt =
|
|
2824
|
+
const Zt = h.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o.jsx(
|
|
2824
2825
|
ie.Title,
|
|
2825
2826
|
{
|
|
2826
2827
|
ref: n,
|
|
2827
|
-
className:
|
|
2828
|
+
className: O(
|
|
2828
2829
|
"text-lg font-semibold leading-none tracking-tight",
|
|
2829
2830
|
e
|
|
2830
2831
|
),
|
|
@@ -2832,17 +2833,17 @@ const Zt = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o.jsx(
|
|
|
2832
2833
|
}
|
|
2833
2834
|
));
|
|
2834
2835
|
Zt.displayName = ie.Title.displayName;
|
|
2835
|
-
const xl =
|
|
2836
|
+
const xl = h.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o.jsx(
|
|
2836
2837
|
ie.Description,
|
|
2837
2838
|
{
|
|
2838
2839
|
ref: n,
|
|
2839
|
-
className:
|
|
2840
|
+
className: O("text-sm text-muted-foreground", e),
|
|
2840
2841
|
...t
|
|
2841
2842
|
}
|
|
2842
2843
|
));
|
|
2843
2844
|
xl.displayName = ie.Description.displayName;
|
|
2844
2845
|
const yl = () => {
|
|
2845
|
-
const { topNavigation: e } =
|
|
2846
|
+
const { topNavigation: e } = Ue();
|
|
2846
2847
|
return /* @__PURE__ */ o.jsxs(Xt, { direction: "right", children: [
|
|
2847
2848
|
/* @__PURE__ */ o.jsx("div", { className: "flex lg:hidden justify-self-end", children: /* @__PURE__ */ o.jsx(fo, { className: "lg:hidden", children: /* @__PURE__ */ o.jsx(ka, { size: 22 }) }) }),
|
|
2848
2849
|
/* @__PURE__ */ o.jsxs(
|
|
@@ -2851,7 +2852,7 @@ const yl = () => {
|
|
|
2851
2852
|
className: "lg:hidden h-screen right-0 left-auto w-[320px] rounded-none",
|
|
2852
2853
|
"aria-describedby": void 0,
|
|
2853
2854
|
children: [
|
|
2854
|
-
/* @__PURE__ */ o.jsx(
|
|
2855
|
+
/* @__PURE__ */ o.jsx(In, { children: /* @__PURE__ */ o.jsx(Zt, { children: "Navigation" }) }),
|
|
2855
2856
|
/* @__PURE__ */ o.jsx("ul", { className: "flex flex-col items-center gap-4 p-4", children: e.map((t) => /* @__PURE__ */ o.jsx("li", { children: /* @__PURE__ */ o.jsx(
|
|
2856
2857
|
We,
|
|
2857
2858
|
{
|
|
@@ -2867,8 +2868,8 @@ const yl = () => {
|
|
|
2867
2868
|
}
|
|
2868
2869
|
)
|
|
2869
2870
|
] });
|
|
2870
|
-
},
|
|
2871
|
-
const e =
|
|
2871
|
+
}, Ml = () => {
|
|
2872
|
+
const e = Ue(), [t, n] = Te(!1), r = Ln(() => n(!1), []);
|
|
2872
2873
|
be(() => {
|
|
2873
2874
|
if (t)
|
|
2874
2875
|
return;
|
|
@@ -2879,7 +2880,7 @@ const yl = () => {
|
|
|
2879
2880
|
window.removeEventListener("keydown", s);
|
|
2880
2881
|
};
|
|
2881
2882
|
}, [t, n]);
|
|
2882
|
-
const a = e.plugins.find(
|
|
2883
|
+
const a = e.plugins.find(js);
|
|
2883
2884
|
return a ? /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
2884
2885
|
/* @__PURE__ */ o.jsxs(
|
|
2885
2886
|
"button",
|
|
@@ -2901,30 +2902,19 @@ const yl = () => {
|
|
|
2901
2902
|
onClose: r
|
|
2902
2903
|
}) })
|
|
2903
2904
|
] }) : null;
|
|
2904
|
-
},
|
|
2905
|
-
const { topNavigation: e } =
|
|
2906
|
-
return e.length <= 1 ? /* @__PURE__ */ o.jsx("style", { children: ":root { --top-nav-height: 0px; }" }) : /* @__PURE__ */ o.jsx("nav", { className: "hidden lg:block border-b text-sm px-12 h-[--top-nav-height]", children: /* @__PURE__ */ o.jsx("ul", { className: "flex flex-row items-center gap-8", children: e.map((t) => /* @__PURE__ */ o.jsx("li", { children: /* @__PURE__ */ o.jsx(
|
|
2907
|
-
}, Cl = ({ id: e, label: t, default: n }) => {
|
|
2908
|
-
var d;
|
|
2909
|
-
const { sidebars: r } = _e(), a = zn(), s = r[e], i = n ?? (s ? Na(s, (g) => {
|
|
2910
|
-
if (g.type === "doc") return Ye(g.id);
|
|
2911
|
-
}) : Ye(e));
|
|
2912
|
-
if (!i)
|
|
2913
|
-
throw new Error(
|
|
2914
|
-
`No links found in top navigation for top navigation '${e}'. Check that the sidebar isn't empty or that a default link set.`
|
|
2915
|
-
);
|
|
2916
|
-
const l = ((d = a.data.topNavItem) == null ? void 0 : d.id) === e;
|
|
2917
|
-
return /* @__PURE__ */ o.jsx(
|
|
2905
|
+
}, Sl = () => {
|
|
2906
|
+
const { topNavigation: e } = Ue();
|
|
2907
|
+
return e.length <= 1 ? /* @__PURE__ */ o.jsx("style", { children: ":root { --top-nav-height: 0px; }" }) : /* @__PURE__ */ o.jsx("nav", { className: "hidden lg:block border-b text-sm px-12 h-[--top-nav-height]", children: /* @__PURE__ */ o.jsx("ul", { className: "flex flex-row items-center gap-8", children: e.map((t) => /* @__PURE__ */ o.jsx("li", { children: /* @__PURE__ */ o.jsx(
|
|
2918
2908
|
We,
|
|
2919
2909
|
{
|
|
2920
|
-
className: An(
|
|
2910
|
+
className: ({ isActive: n }) => An(
|
|
2921
2911
|
"block py-3.5 font-medium -mb-px border-b-2",
|
|
2922
|
-
|
|
2912
|
+
n ? "border-primary text-foreground" : "border-transparent text-foreground/75 hover:text-foreground hover:border-accent-foreground/25"
|
|
2923
2913
|
),
|
|
2924
|
-
to:
|
|
2925
|
-
children: t
|
|
2914
|
+
to: t.id,
|
|
2915
|
+
children: t.label
|
|
2926
2916
|
}
|
|
2927
|
-
);
|
|
2917
|
+
) }, t.label)) }) });
|
|
2928
2918
|
}, po = ({ item: e }) => e.children ? /* @__PURE__ */ o.jsxs(qi, { children: [
|
|
2929
2919
|
/* @__PURE__ */ o.jsx(Qr, { children: e.label }),
|
|
2930
2920
|
/* @__PURE__ */ o.jsx(Qi, { children: /* @__PURE__ */ o.jsx(qr, { children: e.children.map((t, n) => (
|
|
@@ -2932,43 +2922,43 @@ const yl = () => {
|
|
|
2932
2922
|
/* @__PURE__ */ o.jsx(po, { item: t }, n)
|
|
2933
2923
|
)) }) })
|
|
2934
2924
|
] }, e.label) : /* @__PURE__ */ o.jsx(Ot, { to: e.path ?? "", children: /* @__PURE__ */ o.jsx(Wr, { children: e.label }, e.label) }), mo = Hn(function() {
|
|
2935
|
-
const t = cn(), [n, r] =
|
|
2925
|
+
const t = cn(), [n, r] = sa(), { isAuthenticated: a, profile: s, isAuthEnabled: i } = cn(), l = Ue(), { page: u, plugins: v } = l, m = v.filter((d) => Rs(d)).flatMap((d) => d.getProfileMenuItems(l)).map((d) => /* @__PURE__ */ o.jsx(po, { item: d }, d.label)), c = n ? La : Fa;
|
|
2936
2926
|
return /* @__PURE__ */ o.jsxs("header", { className: "sticky lg:top-0 z-10 bg-background/80 backdrop-blur w-full", children: [
|
|
2937
2927
|
/* @__PURE__ */ o.jsx(Xi, {}),
|
|
2938
2928
|
/* @__PURE__ */ o.jsxs("div", { className: "max-w-screen-2xl mx-auto", children: [
|
|
2939
2929
|
/* @__PURE__ */ o.jsxs("div", { className: "grid grid-cols-2 lg:grid-cols-[calc(var(--side-nav-width))_1fr] lg:gap-12 items-center border-b px-10 lg:px-12 h-[--top-header-height]", children: [
|
|
2940
2930
|
/* @__PURE__ */ o.jsx("div", { className: "flex", children: /* @__PURE__ */ o.jsx(Ot, { to: "/", children: /* @__PURE__ */ o.jsxs("div", { className: "flex items-center gap-3.5", children: [
|
|
2941
|
-
(
|
|
2931
|
+
(u == null ? void 0 : u.logo) && /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
2942
2932
|
/* @__PURE__ */ o.jsx(
|
|
2943
2933
|
"img",
|
|
2944
2934
|
{
|
|
2945
|
-
src:
|
|
2946
|
-
alt:
|
|
2947
|
-
style: { width:
|
|
2948
|
-
className:
|
|
2935
|
+
src: u.logo.src.light,
|
|
2936
|
+
alt: u.logo.alt ?? u.pageTitle,
|
|
2937
|
+
style: { width: u.logo.width },
|
|
2938
|
+
className: O("h-10", n && "hidden"),
|
|
2949
2939
|
loading: "lazy"
|
|
2950
2940
|
}
|
|
2951
2941
|
),
|
|
2952
2942
|
/* @__PURE__ */ o.jsx(
|
|
2953
2943
|
"img",
|
|
2954
2944
|
{
|
|
2955
|
-
src:
|
|
2956
|
-
alt:
|
|
2957
|
-
style: { width:
|
|
2958
|
-
className:
|
|
2945
|
+
src: u.logo.src.dark,
|
|
2946
|
+
alt: u.logo.alt ?? u.pageTitle,
|
|
2947
|
+
style: { width: u.logo.width },
|
|
2948
|
+
className: O("h-10", !n && "hidden"),
|
|
2959
2949
|
loading: "lazy"
|
|
2960
2950
|
}
|
|
2961
2951
|
)
|
|
2962
2952
|
] }),
|
|
2963
|
-
/* @__PURE__ */ o.jsx("span", { className: "font-bold text-2xl text-foreground/85 tracking-wide", children:
|
|
2953
|
+
/* @__PURE__ */ o.jsx("span", { className: "font-bold text-2xl text-foreground/85 tracking-wide", children: u == null ? void 0 : u.pageTitle })
|
|
2964
2954
|
] }) }) }),
|
|
2965
2955
|
/* @__PURE__ */ o.jsxs("div", { className: "grid grid-cols-2 md:grid-cols-[--sidecar-grid-cols] items-center gap-8", children: [
|
|
2966
|
-
/* @__PURE__ */ o.jsx("div", { className: "w-full justify-center flex", children: /* @__PURE__ */ o.jsx(
|
|
2956
|
+
/* @__PURE__ */ o.jsx("div", { className: "w-full justify-center flex", children: /* @__PURE__ */ o.jsx(Ml, {}) }),
|
|
2967
2957
|
/* @__PURE__ */ o.jsx(yl, {}),
|
|
2968
2958
|
/* @__PURE__ */ o.jsxs("div", { className: "hidden lg:flex items-center justify-self-end text-sm gap-2", children: [
|
|
2969
2959
|
/* @__PURE__ */ o.jsx(Pe, { name: "head-navigation-start" }),
|
|
2970
|
-
i && !a ? /* @__PURE__ */ o.jsx(
|
|
2971
|
-
/* @__PURE__ */ o.jsx(Vi, { asChild: !0, children: /* @__PURE__ */ o.jsx(
|
|
2960
|
+
i && !a ? /* @__PURE__ */ o.jsx(Rt, { variant: "ghost", onClick: () => t.login(), children: "Login" }) : m.length > 0 && /* @__PURE__ */ o.jsxs(Ki, { modal: !1, children: [
|
|
2961
|
+
/* @__PURE__ */ o.jsx(Vi, { asChild: !0, children: /* @__PURE__ */ o.jsx(Rt, { variant: "ghost", children: s != null && s.email ? `${s.email}` : "My Account" }) }),
|
|
2972
2962
|
/* @__PURE__ */ o.jsxs(Gr, { className: "w-56", children: [
|
|
2973
2963
|
/* @__PURE__ */ o.jsx(Yr, { children: "My Account" }),
|
|
2974
2964
|
/* @__PURE__ */ o.jsx(Xr, {}),
|
|
@@ -2989,12 +2979,12 @@ const yl = () => {
|
|
|
2989
2979
|
] })
|
|
2990
2980
|
] })
|
|
2991
2981
|
] }),
|
|
2992
|
-
/* @__PURE__ */ o.jsx(
|
|
2982
|
+
/* @__PURE__ */ o.jsx(Sl, {})
|
|
2993
2983
|
] })
|
|
2994
2984
|
] });
|
|
2995
2985
|
}), go = {
|
|
2996
2986
|
Header: mo
|
|
2997
|
-
}, El = $n(go),
|
|
2987
|
+
}, El = $n(go), Cl = El.Provider, Rl = (e) => {
|
|
2998
2988
|
const [t, n] = Te(!1);
|
|
2999
2989
|
be(() => {
|
|
3000
2990
|
const s = localStorage.getItem("theme"), i = window.matchMedia("(prefers-color-scheme: dark)"), l = s === "dark" || !s && i.matches;
|
|
@@ -3004,69 +2994,69 @@ const yl = () => {
|
|
|
3004
2994
|
const s = !t;
|
|
3005
2995
|
document.documentElement.classList.toggle("dark", s), localStorage.setItem("theme", s ? "dark" : "light"), n(s);
|
|
3006
2996
|
}, [t]), a = [t, r];
|
|
3007
|
-
return /* @__PURE__ */ o.jsx(
|
|
3008
|
-
},
|
|
2997
|
+
return /* @__PURE__ */ o.jsx(ia.Provider, { value: a, ...e });
|
|
2998
|
+
}, Dl = ({
|
|
3009
2999
|
children: e,
|
|
3010
3000
|
context: t
|
|
3011
|
-
}) => (
|
|
3001
|
+
}) => (Na({
|
|
3012
3002
|
queryFn: async () => (await t.initialize(), !0),
|
|
3013
3003
|
queryKey: ["zudoku-initialize"]
|
|
3014
3004
|
}), /* @__PURE__ */ o.jsx(Pa.Provider, { value: t, children: e })), jl = ({
|
|
3015
3005
|
children: e,
|
|
3016
3006
|
...t
|
|
3017
3007
|
}) => {
|
|
3018
|
-
var c,
|
|
3019
|
-
const n =
|
|
3008
|
+
var c, d;
|
|
3009
|
+
const n = xt(
|
|
3020
3010
|
() => ({ ...go, ...t.overrides }),
|
|
3021
3011
|
[t.overrides]
|
|
3022
|
-
), r =
|
|
3012
|
+
), r = xt(() => {
|
|
3023
3013
|
var y;
|
|
3024
3014
|
return {
|
|
3025
3015
|
...(t.plugins ?? []).filter(Ts).flatMap(
|
|
3026
3016
|
(R) => R.getMdxComponents ? [R.getMdxComponents()] : []
|
|
3027
3017
|
).reduce((R, K) => ({ ...R, ...K }), {}),
|
|
3028
|
-
...
|
|
3018
|
+
...la,
|
|
3029
3019
|
...(y = t.mdx) == null ? void 0 : y.components
|
|
3030
3020
|
};
|
|
3031
|
-
}, [(c = t.mdx) == null ? void 0 : c.components, t.plugins]), { stagger: a } =
|
|
3021
|
+
}, [(c = t.mdx) == null ? void 0 : c.components, t.plugins]), { stagger: a } = ma(Dt), [s, i] = Te(!1), l = xt(
|
|
3032
3022
|
() => s ? { stagger: !0 } : { stagger: a },
|
|
3033
3023
|
[a, s]
|
|
3034
|
-
),
|
|
3024
|
+
), u = Bo();
|
|
3035
3025
|
be(() => {
|
|
3036
3026
|
s || i(!0);
|
|
3037
|
-
}, [s,
|
|
3038
|
-
const [
|
|
3027
|
+
}, [s, u.location]);
|
|
3028
|
+
const [v] = Te(() => new Os(t)), m = (d = t.plugins) == null ? void 0 : d.filter(Ps).map((f, y) => {
|
|
3039
3029
|
var R;
|
|
3040
|
-
return /* @__PURE__ */ o.jsx(
|
|
3030
|
+
return /* @__PURE__ */ o.jsx(ga, { children: (R = f.getHead) == null ? void 0 : R.call(f) }, y);
|
|
3041
3031
|
});
|
|
3042
3032
|
return /* @__PURE__ */ o.jsxs(Ta, { client: Wn, children: [
|
|
3043
|
-
/* @__PURE__ */ o.jsx(
|
|
3044
|
-
/* @__PURE__ */ o.jsx(
|
|
3033
|
+
/* @__PURE__ */ o.jsx(_t, { children: m }),
|
|
3034
|
+
/* @__PURE__ */ o.jsx(Dt.Provider, { value: l, children: /* @__PURE__ */ o.jsx(Dl, { context: v, children: /* @__PURE__ */ o.jsx(Ao, { components: r, children: /* @__PURE__ */ o.jsx(Rl, { children: /* @__PURE__ */ o.jsx(Cl, { value: n, children: /* @__PURE__ */ o.jsx(Ko, { slotlets: t.slotlets, children: /* @__PURE__ */ o.jsx(ca, { children: e ?? /* @__PURE__ */ o.jsx(Dn, {}) }) }) }) }) }) }) })
|
|
3045
3035
|
] });
|
|
3046
|
-
},
|
|
3036
|
+
}, Nl = Hn(jl), vo = (e) => /* @__PURE__ */ o.jsx(Es, { FallbackComponent: Is, children: /* @__PURE__ */ o.jsx(Nl, { ...e }) });
|
|
3047
3037
|
vo.displayName = "DevPortal";
|
|
3048
|
-
const
|
|
3038
|
+
const Pl = ({
|
|
3049
3039
|
category: e,
|
|
3050
3040
|
level: t
|
|
3051
3041
|
}) => {
|
|
3052
|
-
var
|
|
3053
|
-
const n =
|
|
3042
|
+
var d;
|
|
3043
|
+
const n = zn(), r = ko(e), [a, s] = Te(!1), i = e.collapsible ?? !0, l = e.collapsed ?? !0, u = !!(!i || !l || r), [v, m] = Te(u);
|
|
3054
3044
|
be(() => {
|
|
3055
|
-
|
|
3056
|
-
}, [
|
|
3057
|
-
const
|
|
3045
|
+
r && m(!0);
|
|
3046
|
+
}, [r]);
|
|
3047
|
+
const c = i && /* @__PURE__ */ o.jsx(
|
|
3058
3048
|
"button",
|
|
3059
3049
|
{
|
|
3060
3050
|
type: "button",
|
|
3061
|
-
onClick: (
|
|
3062
|
-
|
|
3051
|
+
onClick: (f) => {
|
|
3052
|
+
f.preventDefault(), m((y) => !y), s(!0);
|
|
3063
3053
|
},
|
|
3064
3054
|
children: /* @__PURE__ */ o.jsx(
|
|
3065
3055
|
Kn,
|
|
3066
3056
|
{
|
|
3067
3057
|
size: 16,
|
|
3068
|
-
className:
|
|
3069
|
-
|
|
3058
|
+
className: O(
|
|
3059
|
+
a && "transition",
|
|
3070
3060
|
"shrink-0 group-data-[state=open]:rotate-90"
|
|
3071
3061
|
)
|
|
3072
3062
|
}
|
|
@@ -3074,20 +3064,20 @@ const Tl = ({
|
|
|
3074
3064
|
}
|
|
3075
3065
|
);
|
|
3076
3066
|
return /* @__PURE__ */ o.jsxs(
|
|
3077
|
-
|
|
3067
|
+
ba,
|
|
3078
3068
|
{
|
|
3079
|
-
className:
|
|
3080
|
-
defaultOpen:
|
|
3081
|
-
open:
|
|
3082
|
-
onOpenChange: () =>
|
|
3069
|
+
className: O("flex flex-col", t === 0 && "-mx-[--padding-nav-item]"),
|
|
3070
|
+
defaultOpen: u,
|
|
3071
|
+
open: v,
|
|
3072
|
+
onOpenChange: () => m(!0),
|
|
3083
3073
|
children: [
|
|
3084
|
-
/* @__PURE__ */ o.jsx(
|
|
3074
|
+
/* @__PURE__ */ o.jsx(xa, { className: "group", asChild: !0, disabled: !i, children: /* @__PURE__ */ o.jsxs(
|
|
3085
3075
|
"div",
|
|
3086
3076
|
{
|
|
3087
|
-
className:
|
|
3077
|
+
className: O(
|
|
3088
3078
|
"text-start",
|
|
3089
3079
|
Ge({ isActive: !1, isTopLevel: t === 0 }),
|
|
3090
|
-
|
|
3080
|
+
i ? "cursor-pointer" : "cursor-default hover:bg-transparent"
|
|
3091
3081
|
),
|
|
3092
3082
|
children: [
|
|
3093
3083
|
e.icon && /* @__PURE__ */ o.jsx(
|
|
@@ -3097,55 +3087,55 @@ const Tl = ({
|
|
|
3097
3087
|
className: "align-[-0.125em] -translate-x-1"
|
|
3098
3088
|
}
|
|
3099
3089
|
),
|
|
3100
|
-
((
|
|
3090
|
+
((d = e.link) == null ? void 0 : d.type) === "doc" ? /* @__PURE__ */ o.jsx(
|
|
3101
3091
|
We,
|
|
3102
3092
|
{
|
|
3103
|
-
to:
|
|
3093
|
+
to: Ft(n == null ? void 0 : n.id, e.link.id),
|
|
3104
3094
|
className: "flex-1",
|
|
3105
|
-
onClick: () =>
|
|
3106
|
-
children: ({ isActive:
|
|
3095
|
+
onClick: () => s(!0),
|
|
3096
|
+
children: ({ isActive: f }) => /* @__PURE__ */ o.jsxs(
|
|
3107
3097
|
"div",
|
|
3108
3098
|
{
|
|
3109
|
-
className:
|
|
3099
|
+
className: O(
|
|
3110
3100
|
"flex items-center gap-2 justify-between w-full",
|
|
3111
|
-
|
|
3101
|
+
f ? "text-primary font-medium" : "text-foreground/80"
|
|
3112
3102
|
),
|
|
3113
3103
|
children: [
|
|
3114
3104
|
/* @__PURE__ */ o.jsx("div", { className: "truncate", children: e.label }),
|
|
3115
|
-
|
|
3105
|
+
c
|
|
3116
3106
|
]
|
|
3117
3107
|
}
|
|
3118
3108
|
)
|
|
3119
3109
|
}
|
|
3120
3110
|
) : /* @__PURE__ */ o.jsxs("div", { className: "flex items-center justify-between w-full", children: [
|
|
3121
3111
|
/* @__PURE__ */ o.jsx("div", { className: "flex gap-2 truncate w-full", children: e.label }),
|
|
3122
|
-
|
|
3112
|
+
c
|
|
3123
3113
|
] })
|
|
3124
3114
|
]
|
|
3125
3115
|
}
|
|
3126
3116
|
) }),
|
|
3127
3117
|
/* @__PURE__ */ o.jsx(
|
|
3128
|
-
|
|
3118
|
+
ya,
|
|
3129
3119
|
{
|
|
3130
|
-
className:
|
|
3120
|
+
className: O(
|
|
3131
3121
|
// CollapsibleContent class is used to animate and it should only be applied when the user has triggered the toggle
|
|
3132
|
-
|
|
3122
|
+
a && "CollapsibleContent",
|
|
3133
3123
|
"ms-[calc(var(--padding-nav-item)*1.125)]"
|
|
3134
3124
|
),
|
|
3135
|
-
children: /* @__PURE__ */ o.jsx("ul", { className: "mt-1 border-l ps-2", children: e.items.map((
|
|
3136
|
-
|
|
3125
|
+
children: /* @__PURE__ */ o.jsx("ul", { className: "mt-1 border-l ps-2", children: e.items.map((f) => /* @__PURE__ */ o.jsx(
|
|
3126
|
+
Tt,
|
|
3137
3127
|
{
|
|
3138
3128
|
level: t + 1,
|
|
3139
|
-
item:
|
|
3129
|
+
item: f
|
|
3140
3130
|
},
|
|
3141
|
-
("id" in
|
|
3131
|
+
("id" in f ? f.id : "") + ("href" in f ? f.href : "") + f.label
|
|
3142
3132
|
)) })
|
|
3143
3133
|
}
|
|
3144
3134
|
)
|
|
3145
3135
|
]
|
|
3146
3136
|
}
|
|
3147
3137
|
);
|
|
3148
|
-
}, Ge =
|
|
3138
|
+
}, Ge = ua(
|
|
3149
3139
|
"flex items-center gap-2 px-[--padding-nav-item] py-1.5 rounded-lg hover:bg-accent transition-colors duration-300",
|
|
3150
3140
|
{
|
|
3151
3141
|
variants: {
|
|
@@ -3162,51 +3152,51 @@ const Tl = ({
|
|
|
3162
3152
|
}
|
|
3163
3153
|
}
|
|
3164
3154
|
}
|
|
3165
|
-
), wo = "data-anchor",
|
|
3155
|
+
), wo = "data-anchor", Tt = ({
|
|
3166
3156
|
item: e,
|
|
3167
3157
|
level: t = 0
|
|
3168
3158
|
}) => {
|
|
3169
|
-
const { activeAnchor:
|
|
3159
|
+
const n = zn(), { activeAnchor: r } = kt(), [a] = zo();
|
|
3170
3160
|
switch (e.type) {
|
|
3171
3161
|
case "category":
|
|
3172
|
-
return /* @__PURE__ */ o.jsx(
|
|
3162
|
+
return /* @__PURE__ */ o.jsx(Pl, { category: e, level: t });
|
|
3173
3163
|
case "doc":
|
|
3174
3164
|
return /* @__PURE__ */ o.jsxs(
|
|
3175
3165
|
We,
|
|
3176
3166
|
{
|
|
3177
|
-
className: ({ isActive:
|
|
3178
|
-
to:
|
|
3167
|
+
className: ({ isActive: s }) => Ge({ isActive: s, isTopLevel: t === 0 }),
|
|
3168
|
+
to: Ft(n == null ? void 0 : n.id, e.id),
|
|
3179
3169
|
children: [
|
|
3180
3170
|
e.icon && /* @__PURE__ */ o.jsx(e.icon, { size: 16, className: "align-[-0.125em]" }),
|
|
3181
3171
|
e.badge ? /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
3182
3172
|
/* @__PURE__ */ o.jsx("span", { className: "truncate", title: e.label, children: e.label }),
|
|
3183
|
-
/* @__PURE__ */ o.jsx(
|
|
3173
|
+
/* @__PURE__ */ o.jsx(yt, { ...e.badge })
|
|
3184
3174
|
] }) : e.label
|
|
3185
3175
|
]
|
|
3186
3176
|
}
|
|
3187
3177
|
);
|
|
3188
3178
|
case "link":
|
|
3189
3179
|
return e.href.startsWith("#") ? /* @__PURE__ */ o.jsx(
|
|
3190
|
-
|
|
3180
|
+
$o,
|
|
3191
3181
|
{
|
|
3192
|
-
to: { hash: e.href, search:
|
|
3182
|
+
to: { hash: e.href, search: a.toString() },
|
|
3193
3183
|
[wo]: e.href.slice(1),
|
|
3194
|
-
className:
|
|
3184
|
+
className: O(
|
|
3195
3185
|
"flex gap-2.5 justify-between",
|
|
3196
3186
|
t === 0 && "-mx-[--padding-nav-item]",
|
|
3197
3187
|
Ge({
|
|
3198
|
-
isActive: e.href.slice(1) ===
|
|
3188
|
+
isActive: e.href.slice(1) === r
|
|
3199
3189
|
})
|
|
3200
3190
|
),
|
|
3201
3191
|
children: e.badge ? /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
3202
3192
|
/* @__PURE__ */ o.jsx("span", { className: "truncate", title: e.label, children: e.label }),
|
|
3203
|
-
/* @__PURE__ */ o.jsx(
|
|
3193
|
+
/* @__PURE__ */ o.jsx(yt, { ...e.badge })
|
|
3204
3194
|
] }) : /* @__PURE__ */ o.jsx("span", { className: "break-all", children: e.label })
|
|
3205
3195
|
}
|
|
3206
3196
|
) : e.href.startsWith("http") ? /* @__PURE__ */ o.jsxs(
|
|
3207
3197
|
"a",
|
|
3208
3198
|
{
|
|
3209
|
-
className:
|
|
3199
|
+
className: O(
|
|
3210
3200
|
Ge({ isTopLevel: t === 0 }),
|
|
3211
3201
|
"block"
|
|
3212
3202
|
),
|
|
@@ -3224,26 +3214,26 @@ const Tl = ({
|
|
|
3224
3214
|
) : /* @__PURE__ */ o.jsx(
|
|
3225
3215
|
We,
|
|
3226
3216
|
{
|
|
3227
|
-
className:
|
|
3217
|
+
className: O("flex gap-2.5 justify-between", Ge()),
|
|
3228
3218
|
to: e.href,
|
|
3229
3219
|
children: e.badge ? /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
3230
3220
|
/* @__PURE__ */ o.jsx("span", { className: "truncate", title: e.label, children: e.label }),
|
|
3231
|
-
/* @__PURE__ */ o.jsx(
|
|
3221
|
+
/* @__PURE__ */ o.jsx(yt, { ...e.badge })
|
|
3232
3222
|
] }) : /* @__PURE__ */ o.jsx("span", { className: "break-all", children: e.label })
|
|
3233
3223
|
}
|
|
3234
3224
|
);
|
|
3235
3225
|
}
|
|
3236
|
-
},
|
|
3226
|
+
}, Tl = (e, t = { block: "center" }) => {
|
|
3237
3227
|
if (!e) return;
|
|
3238
3228
|
const n = e.getBoundingClientRect();
|
|
3239
3229
|
n.top >= 0 && n.left >= 0 && n.bottom <= (window.innerHeight || document.documentElement.clientHeight) && n.right <= (window.innerWidth || document.documentElement.clientWidth) || e.scrollIntoView(t);
|
|
3240
|
-
},
|
|
3241
|
-
const e =
|
|
3230
|
+
}, _l = () => {
|
|
3231
|
+
const e = It(), { setActiveAnchor: t } = kt();
|
|
3242
3232
|
be(() => {
|
|
3243
3233
|
if (!e.hash) return;
|
|
3244
3234
|
const n = decodeURIComponent(e.hash.split("/")[0].slice(1)), r = () => {
|
|
3245
3235
|
const a = document.getElementById(n), s = document.querySelector(`[${wo}="${n}"]`);
|
|
3246
|
-
return a ? (a.scrollIntoView(),
|
|
3236
|
+
return a ? (a.scrollIntoView(), Tl(s), requestIdleCallback(() => t(n)), !0) : !1;
|
|
3247
3237
|
};
|
|
3248
3238
|
if (!r()) {
|
|
3249
3239
|
const a = new MutationObserver((s, i) => {
|
|
@@ -3253,15 +3243,15 @@ const Tl = ({
|
|
|
3253
3243
|
}
|
|
3254
3244
|
}, [e.hash, t]);
|
|
3255
3245
|
}, Ol = () => {
|
|
3256
|
-
const e =
|
|
3246
|
+
const e = It(), t = $t(e.pathname);
|
|
3257
3247
|
be(() => {
|
|
3258
3248
|
t.current !== e.pathname && (window.scrollTo(0, 0), t.current = e.pathname);
|
|
3259
3249
|
}, [e.pathname]);
|
|
3260
|
-
}, bo =
|
|
3250
|
+
}, bo = va(({ children: e, className: t, pushMainContent: n }, r) => /* @__PURE__ */ o.jsx(
|
|
3261
3251
|
"nav",
|
|
3262
3252
|
{
|
|
3263
3253
|
"data-navigation": String(n),
|
|
3264
|
-
className:
|
|
3254
|
+
className: O(
|
|
3265
3255
|
"scrollbar peer hidden lg:flex flex-col fixed text-sm overflow-y-auto shrink-0",
|
|
3266
3256
|
"px-[--padding-nav-item] -mx-[--padding-nav-item] pb-20 mt-[--padding-content-top]",
|
|
3267
3257
|
"w-[--side-nav-width] h-[calc(100%-var(--header-height))] scroll-pt-2 gap-2",
|
|
@@ -3272,17 +3262,17 @@ const Tl = ({
|
|
|
3272
3262
|
}
|
|
3273
3263
|
));
|
|
3274
3264
|
bo.displayName = "SidebarWrapper";
|
|
3275
|
-
const
|
|
3276
|
-
const e =
|
|
3265
|
+
const Il = () => {
|
|
3266
|
+
const e = $t(null), t = _a();
|
|
3277
3267
|
return /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
3278
3268
|
/* @__PURE__ */ o.jsxs(
|
|
3279
3269
|
bo,
|
|
3280
3270
|
{
|
|
3281
3271
|
ref: e,
|
|
3282
|
-
pushMainContent: t.data.
|
|
3272
|
+
pushMainContent: t.data.items.length > 0,
|
|
3283
3273
|
children: [
|
|
3284
3274
|
/* @__PURE__ */ o.jsx(Pe, { name: "zudoku-before-navigation" }),
|
|
3285
|
-
t.data.
|
|
3275
|
+
t.data.items.map((n) => /* @__PURE__ */ o.jsx(Tt, { item: n }, n.label)),
|
|
3286
3276
|
/* @__PURE__ */ o.jsx(Pe, { name: "zudoku-after-navigation" })
|
|
3287
3277
|
]
|
|
3288
3278
|
}
|
|
@@ -3293,16 +3283,16 @@ const Al = () => {
|
|
|
3293
3283
|
className: "lg:hidden h-screen left-0 p-6 w-[320px] rounded-none",
|
|
3294
3284
|
"aria-describedby": void 0,
|
|
3295
3285
|
children: [
|
|
3296
|
-
/* @__PURE__ */ o.jsx(
|
|
3297
|
-
t.data.
|
|
3286
|
+
/* @__PURE__ */ o.jsx(In, { children: /* @__PURE__ */ o.jsx(Zt, { children: "Sidebar" }) }),
|
|
3287
|
+
t.data.items.map((n) => /* @__PURE__ */ o.jsx(Tt, { item: n }, n.label))
|
|
3298
3288
|
]
|
|
3299
3289
|
}
|
|
3300
3290
|
)
|
|
3301
3291
|
] });
|
|
3302
|
-
},
|
|
3303
|
-
const t =
|
|
3304
|
-
|
|
3305
|
-
const s =
|
|
3292
|
+
}, Al = ({ children: e }) => {
|
|
3293
|
+
const t = It(), { setActiveAnchor: n } = kt(), { meta: r, authentication: a } = Ue();
|
|
3294
|
+
_l(), Ol();
|
|
3295
|
+
const s = $t(t.pathname);
|
|
3306
3296
|
return be(() => {
|
|
3307
3297
|
var i;
|
|
3308
3298
|
(i = a == null ? void 0 : a.pageLoad) == null || i.call(a);
|
|
@@ -3310,7 +3300,7 @@ const Al = () => {
|
|
|
3310
3300
|
t.pathname !== s.current && n(""), s.current = t.pathname;
|
|
3311
3301
|
}, [t.pathname, n]), /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
3312
3302
|
!1,
|
|
3313
|
-
/* @__PURE__ */ o.jsxs(
|
|
3303
|
+
/* @__PURE__ */ o.jsxs(_t, { titleTemplate: r == null ? void 0 : r.title, children: [
|
|
3314
3304
|
(r == null ? void 0 : r.description) && /* @__PURE__ */ o.jsx("meta", { name: "description", content: r.description }),
|
|
3315
3305
|
(r == null ? void 0 : r.favicon) && /* @__PURE__ */ o.jsx("link", { rel: "icon", href: r.favicon })
|
|
3316
3306
|
] }),
|
|
@@ -3321,11 +3311,11 @@ const Al = () => {
|
|
|
3321
3311
|
{
|
|
3322
3312
|
fallback: /* @__PURE__ */ o.jsx("main", { className: "grid h-[calc(100vh-var(--header-height))] place-items-center", children: /* @__PURE__ */ o.jsx(Ja, {}) }),
|
|
3323
3313
|
children: /* @__PURE__ */ o.jsxs(Xt, { direction: "left", children: [
|
|
3324
|
-
/* @__PURE__ */ o.jsx(
|
|
3314
|
+
/* @__PURE__ */ o.jsx(Il, {}),
|
|
3325
3315
|
/* @__PURE__ */ o.jsx(
|
|
3326
3316
|
"div",
|
|
3327
3317
|
{
|
|
3328
|
-
className:
|
|
3318
|
+
className: O(
|
|
3329
3319
|
"lg:hidden -mx-10 px-10 py-2 sticky bg-background/80 backdrop-blur z-10 top-0 left-0 right-0 border-b",
|
|
3330
3320
|
"peer-data-[navigation=false]:hidden"
|
|
3331
3321
|
),
|
|
@@ -3338,7 +3328,7 @@ const Al = () => {
|
|
|
3338
3328
|
/* @__PURE__ */ o.jsxs(
|
|
3339
3329
|
"main",
|
|
3340
3330
|
{
|
|
3341
|
-
className:
|
|
3331
|
+
className: O(
|
|
3342
3332
|
"h-full dark:border-white/10 translate-x-0",
|
|
3343
3333
|
"lg:overflow-visible",
|
|
3344
3334
|
// This works in tandem with the `SidebarWrapper` component
|
|
@@ -3356,7 +3346,7 @@ const Al = () => {
|
|
|
3356
3346
|
}
|
|
3357
3347
|
) })
|
|
3358
3348
|
] });
|
|
3359
|
-
}, Zl =
|
|
3349
|
+
}, Zl = Lo, ec = da, tc = vo, nc = Al, rc = Ot, oc = Vo, ac = Za, sc = gs, ic = vs, lc = Rt, cc = _t;
|
|
3360
3350
|
export {
|
|
3361
3351
|
sc as Bootstrap,
|
|
3362
3352
|
ic as BootstrapStatic,
|