@tailor-platform/app-shell 0.26.2 → 0.26.3
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/LICENSE.md +21 -0
- package/dist/app-shell.css +1 -1
- package/dist/app-shell.js +399 -389
- package/package.json +14 -9
package/dist/app-shell.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { jsx as a, jsxs as d, Fragment as
|
|
2
|
-
import { capitalCase as
|
|
3
|
-
import { useRouteError as
|
|
4
|
-
import { Link as
|
|
1
|
+
import { jsx as a, jsxs as d, Fragment as A } from "react/jsx-runtime";
|
|
2
|
+
import { capitalCase as M } from "change-case";
|
|
3
|
+
import { useRouteError as Zt, isRouteErrorResponse as Jt, redirect as Rt, Outlet as X, NavLink as te, Navigate as ee, useRouteLoaderData as ae, createMemoryRouter as se, createBrowserRouter as re, RouterProvider as ne, useHref as oe, Link as ie, useLocation as Et, Await as Bt, useMatch as le, useNavigate as de } from "react-router";
|
|
4
|
+
import { Link as Bs, useLocation as As, useNavigate as Ds, useParams as Ps, useRouteError as Ls, useSearchParams as Ms } from "react-router";
|
|
5
5
|
import { Slot as z } from "@radix-ui/react-slot";
|
|
6
6
|
import { cva as Z } from "class-variance-authority";
|
|
7
|
-
import { clsx as
|
|
8
|
-
import { twMerge as
|
|
9
|
-
import { AlertCircle as wt, Table as
|
|
10
|
-
import * as
|
|
11
|
-
import { createContext as j, useContext as
|
|
7
|
+
import { clsx as ce } from "clsx";
|
|
8
|
+
import { twMerge as we } from "tailwind-merge";
|
|
9
|
+
import { AlertCircle as wt, Table as ue, XIcon as At, PanelLeftIcon as me, ChevronRight as Q, SunIcon as he, SearchIcon as fe, ExternalLink as ge, Check as pe, Copy as be } from "lucide-react";
|
|
10
|
+
import * as f from "react";
|
|
11
|
+
import { createContext as j, useContext as D, useState as $, useMemo as E, useEffect as I, useSyncExternalStore as Dt, Suspense as Pt, useRef as xe, useCallback as R } from "react";
|
|
12
12
|
import { Toaster as ve, toast as ye } from "sonner";
|
|
13
13
|
import * as J from "@radix-ui/react-collapsible";
|
|
14
14
|
import "@radix-ui/react-separator";
|
|
15
|
-
import * as
|
|
16
|
-
import * as
|
|
15
|
+
import * as v from "@radix-ui/react-dialog";
|
|
16
|
+
import * as B from "@radix-ui/react-tooltip";
|
|
17
17
|
import { createAuthClient as Ne } from "@tailor-platform/auth-public-client";
|
|
18
18
|
function m(...t) {
|
|
19
|
-
return ce(
|
|
19
|
+
return we(ce(t));
|
|
20
20
|
}
|
|
21
21
|
const Se = Z(
|
|
22
22
|
"astw:inline-flex astw:items-center astw:justify-center astw:gap-2 astw:whitespace-nowrap astw:rounded-md astw:text-sm astw:font-medium astw:transition-all astw:disabled:pointer-events-none astw:disabled:opacity-50 astw:[&_svg]:pointer-events-none astw:[&_svg:not([class*='size-'])]:size-4 astw:shrink-0 astw:[&_svg]:shrink-0 astw:outline-none astw:focus-visible:border-ring astw:focus-visible:ring-ring/50 astw:focus-visible:ring-[3px] astw:aria-invalid:ring-destructive/20 astw:dark:aria-invalid:ring-destructive/40 astw:aria-invalid:border-destructive",
|
|
@@ -59,18 +59,18 @@ function _({
|
|
|
59
59
|
}
|
|
60
60
|
);
|
|
61
61
|
}
|
|
62
|
-
const
|
|
62
|
+
const W = "en", Ce = () => {
|
|
63
63
|
try {
|
|
64
64
|
if (typeof navigator > "u")
|
|
65
|
-
return
|
|
65
|
+
return W;
|
|
66
66
|
const t = navigator.languages?.[0] ?? navigator.language;
|
|
67
|
-
return t ? new Intl.Locale(t).language :
|
|
67
|
+
return t ? new Intl.Locale(t).language : W;
|
|
68
68
|
} catch {
|
|
69
|
-
return
|
|
69
|
+
return W;
|
|
70
70
|
}
|
|
71
|
-
}, tt = (t) => (e, s) => e ? typeof e == "string" ? e : e(t) ?? s : s,
|
|
71
|
+
}, tt = (t) => (e, s) => e ? typeof e == "string" ? e : e(t) ?? s : s, Lt = (t) => {
|
|
72
72
|
const e = tt(t);
|
|
73
|
-
return (s, r) => e(s, typeof s == "string" ? s :
|
|
73
|
+
return (s, r) => e(s, typeof s == "string" ? s : M(r));
|
|
74
74
|
}, Te = (t) => ({
|
|
75
75
|
modules: t.modules,
|
|
76
76
|
settingsResources: t.settingsResources ?? [],
|
|
@@ -81,7 +81,7 @@ const $ = "en", Ce = () => {
|
|
|
81
81
|
configurations: {
|
|
82
82
|
modules: [],
|
|
83
83
|
settingsResources: [],
|
|
84
|
-
locale:
|
|
84
|
+
locale: W,
|
|
85
85
|
// Using null! to avoid circular dependency issues.
|
|
86
86
|
// DefaultErrorBoundary imports useT from i18n-labels, which imports
|
|
87
87
|
// defineI18nLabels from hooks/i18n, which imports useAppShellConfig
|
|
@@ -92,14 +92,14 @@ const $ = "en", Ce = () => {
|
|
|
92
92
|
}
|
|
93
93
|
}), at = j({
|
|
94
94
|
contextData: {}
|
|
95
|
-
}),
|
|
96
|
-
const t =
|
|
95
|
+
}), P = () => D(et), us = () => D(at), ke = () => {
|
|
96
|
+
const t = D(et), e = D(at);
|
|
97
97
|
return {
|
|
98
98
|
...t,
|
|
99
99
|
...e
|
|
100
100
|
};
|
|
101
101
|
}, Re = () => {
|
|
102
|
-
const { configurations: t } =
|
|
102
|
+
const { configurations: t } = P(), e = tt(t.locale);
|
|
103
103
|
return (s, r) => e(s, r);
|
|
104
104
|
}, Ee = (t) => {
|
|
105
105
|
const e = (s) => (r) => t[s]?.[r] ?? t.en[r];
|
|
@@ -124,7 +124,7 @@ const $ = "en", Ce = () => {
|
|
|
124
124
|
* ```
|
|
125
125
|
*/
|
|
126
126
|
useT: () => {
|
|
127
|
-
const { configurations: s } =
|
|
127
|
+
const { configurations: s } = P(), r = e(s.locale), n = ((o, ...i) => {
|
|
128
128
|
const l = r(o);
|
|
129
129
|
return typeof l == "function" ? l(i[0]) : l;
|
|
130
130
|
});
|
|
@@ -199,12 +199,12 @@ const $ = "en", Ce = () => {
|
|
|
199
199
|
commandPaletteSearch: "ページを検索...",
|
|
200
200
|
commandPaletteNoResults: "結果が見つかりません"
|
|
201
201
|
}
|
|
202
|
-
}),
|
|
203
|
-
const t =
|
|
202
|
+
}), L = Be.useT, K = () => {
|
|
203
|
+
const t = Zt(), e = L(), s = {
|
|
204
204
|
role: "alert",
|
|
205
205
|
"aria-label": "default-error-boundary"
|
|
206
206
|
};
|
|
207
|
-
if (
|
|
207
|
+
if (Jt(t) && t.status === 404)
|
|
208
208
|
return /* @__PURE__ */ a("div", { ...s, className: "astw:p-6", children: /* @__PURE__ */ d("div", { className: "astw:flex astw:items-start astw:gap-4", children: [
|
|
209
209
|
/* @__PURE__ */ a(wt, { className: "astw:h-5 astw:w-5 astw:text-destructive astw:flex-shrink-0 astw:mt-0.5" }),
|
|
210
210
|
/* @__PURE__ */ d("div", { children: [
|
|
@@ -241,10 +241,10 @@ const $ = "en", Ce = () => {
|
|
|
241
241
|
] })
|
|
242
242
|
] }) });
|
|
243
243
|
};
|
|
244
|
-
let
|
|
244
|
+
let Mt = {};
|
|
245
245
|
const Ae = (t) => {
|
|
246
|
-
|
|
247
|
-
},
|
|
246
|
+
Mt = t;
|
|
247
|
+
}, ms = () => ({ type: "pass" }), hs = () => ({ type: "hidden" }), fs = (t) => ({
|
|
248
248
|
type: "redirect",
|
|
249
249
|
to: t
|
|
250
250
|
}), st = () => new Response("Not Found", { status: 404 }), V = async (t, e) => {
|
|
@@ -253,7 +253,7 @@ const Ae = (t) => {
|
|
|
253
253
|
params: e.params,
|
|
254
254
|
searchParams: s.searchParams,
|
|
255
255
|
signal: e.request.signal,
|
|
256
|
-
context:
|
|
256
|
+
context: Mt
|
|
257
257
|
};
|
|
258
258
|
for (const n of t) {
|
|
259
259
|
const o = await n(r);
|
|
@@ -261,7 +261,7 @@ const Ae = (t) => {
|
|
|
261
261
|
return o;
|
|
262
262
|
}
|
|
263
263
|
return { type: "pass" };
|
|
264
|
-
},
|
|
264
|
+
}, It = (t, e) => async (s) => {
|
|
265
265
|
const r = await V(t, s);
|
|
266
266
|
switch (r.type) {
|
|
267
267
|
case "hidden":
|
|
@@ -271,12 +271,12 @@ const Ae = (t) => {
|
|
|
271
271
|
case "pass":
|
|
272
272
|
return e ? e(s) : null;
|
|
273
273
|
}
|
|
274
|
-
},
|
|
275
|
-
const { configurations: s } =
|
|
274
|
+
}, _t = (t, e) => () => {
|
|
275
|
+
const { configurations: s } = P(), { metaTitle: r, fallbackTitle: n } = t, i = tt(s.locale)(r, n);
|
|
276
276
|
return e(i);
|
|
277
277
|
};
|
|
278
|
-
function
|
|
279
|
-
const { path: e, meta: s, component: r, resources: n, errorBoundary: o, guards: i } = t, l = s?.title ??
|
|
278
|
+
function gs(t) {
|
|
279
|
+
const { path: e, meta: s, component: r, resources: n, errorBoundary: o, guards: i } = t, l = s?.title ?? M(e), u = M(e), w = i && i.length > 0 ? It(i) : void 0, c = r ? _t(
|
|
280
280
|
{ metaTitle: l, fallbackTitle: u },
|
|
281
281
|
(h) => r({ title: h, resources: n })
|
|
282
282
|
) : void 0;
|
|
@@ -298,8 +298,8 @@ function ws(t) {
|
|
|
298
298
|
guards: i
|
|
299
299
|
};
|
|
300
300
|
}
|
|
301
|
-
function
|
|
302
|
-
const { path: e, component: s, subResources: r, meta: n, errorBoundary: o, guards: i } = t, l = n?.title ??
|
|
301
|
+
function ps(t) {
|
|
302
|
+
const { path: e, component: s, subResources: r, meta: n, errorBoundary: o, guards: i } = t, l = n?.title ?? M(e), u = M(e), w = i && i.length > 0 ? It(i) : void 0;
|
|
303
303
|
return {
|
|
304
304
|
_type: "resource",
|
|
305
305
|
type: "component",
|
|
@@ -309,7 +309,7 @@ function us(t) {
|
|
|
309
309
|
icon: n?.icon,
|
|
310
310
|
...n?.breadcrumbTitle !== void 0 ? { breadcrumbTitle: n.breadcrumbTitle } : {}
|
|
311
311
|
},
|
|
312
|
-
component:
|
|
312
|
+
component: _t(
|
|
313
313
|
{ metaTitle: l, fallbackTitle: u },
|
|
314
314
|
(c) => s({ title: c, resources: r })
|
|
315
315
|
),
|
|
@@ -320,20 +320,20 @@ function us(t) {
|
|
|
320
320
|
};
|
|
321
321
|
}
|
|
322
322
|
const De = () => {
|
|
323
|
-
const t =
|
|
324
|
-
return /* @__PURE__ */ d(
|
|
323
|
+
const t = L();
|
|
324
|
+
return /* @__PURE__ */ d(A, { children: [
|
|
325
325
|
/* @__PURE__ */ a("p", { className: "astw:font-semibold astw:leading-none astw:tracking-tight", children: t("welcomeTitle") }),
|
|
326
326
|
/* @__PURE__ */ a("p", { className: "pt-4", children: t("welcomeBody") })
|
|
327
327
|
] });
|
|
328
|
-
}, ut = () => /* @__PURE__ */ d(
|
|
328
|
+
}, ut = () => /* @__PURE__ */ d(A, { children: [
|
|
329
329
|
/* @__PURE__ */ a(X, {}),
|
|
330
330
|
/* @__PURE__ */ a(ve, {})
|
|
331
331
|
] }), Pe = () => {
|
|
332
|
-
const { configurations: t } = ke(), e =
|
|
332
|
+
const { configurations: t } = ke(), e = L(), s = Re();
|
|
333
333
|
return /* @__PURE__ */ d("div", { className: "astw:mx-auto astw:flex-col astw:flex astw:md:flex-row astw:max-w-5xl astw:gap-[10px] astw:w-full", children: [
|
|
334
334
|
/* @__PURE__ */ a("div", { children: /* @__PURE__ */ d("nav", { className: "astw:bg-card astw:md:w-xs astw:rounded-md astw:border astw:p-3 astw:shadow-xs", children: [
|
|
335
335
|
/* @__PURE__ */ a("h2", { className: "astw:text-sm astw:leading-[36px] astw:mb-2 astw:font-bold ", children: e("settings") }),
|
|
336
|
-
/* @__PURE__ */ a("ul", { className: "astw:flex astw:flex-col astw:gap-1", children: t.settingsResources.map((r) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a(
|
|
336
|
+
/* @__PURE__ */ a("ul", { className: "astw:flex astw:flex-col astw:gap-1", children: t.settingsResources.map((r) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a(te, { to: `./${r.path}`, children: ({ isActive: n }) => /* @__PURE__ */ d(
|
|
337
337
|
_,
|
|
338
338
|
{
|
|
339
339
|
variant: n ? "secondary" : "ghost",
|
|
@@ -347,7 +347,7 @@ const De = () => {
|
|
|
347
347
|
] }) }),
|
|
348
348
|
/* @__PURE__ */ a("section", { className: "astw:bg-card astw:flex-1 astw:rounded-md astw:border astw:shadow-xs", children: /* @__PURE__ */ a(X, {}) })
|
|
349
349
|
] });
|
|
350
|
-
}, rt = (t) => () => /* @__PURE__ */ a(
|
|
350
|
+
}, rt = (t) => () => /* @__PURE__ */ a(A, { children: t }), zt = (t, e, s) => {
|
|
351
351
|
const r = t.errorBoundary || s, n = t.component ? {
|
|
352
352
|
index: !0,
|
|
353
353
|
Component: t.component
|
|
@@ -362,7 +362,7 @@ const De = () => {
|
|
|
362
362
|
children: [
|
|
363
363
|
...n ? [n] : [],
|
|
364
364
|
...e.map(
|
|
365
|
-
(o) =>
|
|
365
|
+
(o) => zt(o, o.subResources, r)
|
|
366
366
|
)
|
|
367
367
|
]
|
|
368
368
|
} : n ? {
|
|
@@ -370,7 +370,7 @@ const De = () => {
|
|
|
370
370
|
} : {}
|
|
371
371
|
};
|
|
372
372
|
}, Le = (t) => {
|
|
373
|
-
const e =
|
|
373
|
+
const e = zt(t, t.resources, t.errorBoundary);
|
|
374
374
|
if (!t.component && t.resources.length > 0) {
|
|
375
375
|
const s = {
|
|
376
376
|
index: !0,
|
|
@@ -404,7 +404,7 @@ const De = () => {
|
|
|
404
404
|
path: "settings",
|
|
405
405
|
index: !0,
|
|
406
406
|
Component: () => /* @__PURE__ */ a(
|
|
407
|
-
|
|
407
|
+
ee,
|
|
408
408
|
{
|
|
409
409
|
to: e[0].path,
|
|
410
410
|
relative: "path",
|
|
@@ -441,15 +441,15 @@ const De = () => {
|
|
|
441
441
|
ErrorBoundary: K
|
|
442
442
|
}
|
|
443
443
|
];
|
|
444
|
-
},
|
|
445
|
-
loaderID:
|
|
444
|
+
}, Ft = "appshell-root-nav", _e = (t) => ({
|
|
445
|
+
loaderID: Ft,
|
|
446
446
|
loader: async (e) => ({ navItems: ze(t, e) })
|
|
447
|
-
}),
|
|
448
|
-
const s =
|
|
447
|
+
}), Ot = () => ae(Ft)?.navItems, ze = async (t, e) => {
|
|
448
|
+
const s = Lt(t.locale);
|
|
449
449
|
return (await Promise.all(
|
|
450
450
|
t.modules.map(async (n) => {
|
|
451
451
|
if (n.path.startsWith(":") || (await V(n.guards, e)).type !== "pass") return null;
|
|
452
|
-
const i = await
|
|
452
|
+
const i = await $t(
|
|
453
453
|
n.resources,
|
|
454
454
|
n.path,
|
|
455
455
|
e,
|
|
@@ -460,13 +460,13 @@ const De = () => {
|
|
|
460
460
|
)).filter((n) => n !== null).map(({ module: n, resources: o }) => ({
|
|
461
461
|
title: s(n.meta.title, n.path),
|
|
462
462
|
url: n.meta.menuItemClickable ? n.path : void 0,
|
|
463
|
-
icon: n.meta.icon || /* @__PURE__ */ a(
|
|
463
|
+
icon: n.meta.icon || /* @__PURE__ */ a(ue, {}),
|
|
464
464
|
items: o
|
|
465
465
|
}));
|
|
466
|
-
},
|
|
466
|
+
}, $t = async (t, e, s, r) => (await Promise.all(
|
|
467
467
|
t.map(async (o) => {
|
|
468
468
|
if (o.path.startsWith(":") || (await V(o.guards, s)).type !== "pass") return null;
|
|
469
|
-
const l = `${e}/${o.path}`, u = r(o.meta.title, o.path), w = o.subResources ? await
|
|
469
|
+
const l = `${e}/${o.path}`, u = r(o.meta.title, o.path), w = o.subResources ? await $t(
|
|
470
470
|
o.subResources,
|
|
471
471
|
l,
|
|
472
472
|
s,
|
|
@@ -479,7 +479,7 @@ const De = () => {
|
|
|
479
479
|
};
|
|
480
480
|
})
|
|
481
481
|
)).filter((o) => o !== null), Fe = (t) => {
|
|
482
|
-
const { configurations: e } =
|
|
482
|
+
const { configurations: e } = P(), { rootComponent: s, children: r } = t, n = Ie({
|
|
483
483
|
modules: e.modules,
|
|
484
484
|
settingsResources: e.settingsResources,
|
|
485
485
|
rootComponent: s
|
|
@@ -504,28 +504,28 @@ const De = () => {
|
|
|
504
504
|
*/
|
|
505
505
|
HydrateFallback: () => null
|
|
506
506
|
}
|
|
507
|
-
], w = e.basePath ? "/" + e.basePath : void 0, c = t.memory ?
|
|
507
|
+
], w = e.basePath ? "/" + e.basePath : void 0, c = t.memory ? se(u, {
|
|
508
508
|
basename: w,
|
|
509
509
|
...t.initialEntries ? { initialEntries: t.initialEntries } : {}
|
|
510
|
-
}) :
|
|
510
|
+
}) : re(u, {
|
|
511
511
|
basename: w
|
|
512
512
|
});
|
|
513
|
-
return /* @__PURE__ */ a(
|
|
513
|
+
return /* @__PURE__ */ a(ne, { router: c });
|
|
514
514
|
}, Oe = {
|
|
515
515
|
resolvedTheme: "light",
|
|
516
516
|
theme: "system",
|
|
517
517
|
setTheme: () => null
|
|
518
|
-
},
|
|
518
|
+
}, Wt = j(Oe);
|
|
519
519
|
function $e({
|
|
520
520
|
children: t,
|
|
521
521
|
storageKey: e,
|
|
522
522
|
defaultTheme: s = "system",
|
|
523
523
|
...r
|
|
524
524
|
}) {
|
|
525
|
-
const [n, o] =
|
|
525
|
+
const [n, o] = $(
|
|
526
526
|
() => localStorage.getItem(e) || s
|
|
527
|
-
), i =
|
|
528
|
-
|
|
527
|
+
), i = E(() => n !== "system" ? n : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", [n]);
|
|
528
|
+
I(() => {
|
|
529
529
|
const u = window.document.documentElement;
|
|
530
530
|
u.classList.remove("light", "dark"), u.classList.add(i);
|
|
531
531
|
}, [i]);
|
|
@@ -536,21 +536,26 @@ function $e({
|
|
|
536
536
|
localStorage.setItem(e, u), o(u);
|
|
537
537
|
}
|
|
538
538
|
};
|
|
539
|
-
return /* @__PURE__ */ a(
|
|
539
|
+
return /* @__PURE__ */ a(Wt.Provider, { ...r, value: l, children: t });
|
|
540
540
|
}
|
|
541
541
|
const We = () => {
|
|
542
|
-
const t =
|
|
542
|
+
const t = D(Wt);
|
|
543
543
|
if (t === void 0)
|
|
544
544
|
throw new Error("useTheme must be used within a ThemeProvider");
|
|
545
545
|
return t;
|
|
546
|
-
},
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
546
|
+
}, je = () => () => {
|
|
547
|
+
}, Ke = () => !0, Ve = () => !1;
|
|
548
|
+
function Ue() {
|
|
549
|
+
return Dt(
|
|
550
|
+
je,
|
|
551
|
+
Ke,
|
|
552
|
+
Ve
|
|
553
|
+
);
|
|
554
|
+
}
|
|
555
|
+
const bs = (t) => {
|
|
556
|
+
const e = Ue(), s = t.contextData ?? {};
|
|
557
|
+
Ae(s);
|
|
558
|
+
const r = E(
|
|
554
559
|
() => Te({
|
|
555
560
|
modules: t.modules,
|
|
556
561
|
settingsResources: t.settingsResources,
|
|
@@ -565,16 +570,16 @@ const We = () => {
|
|
|
565
570
|
t.errorBoundary,
|
|
566
571
|
t.locale
|
|
567
572
|
]
|
|
568
|
-
),
|
|
569
|
-
() => ({ title: t.title, icon: t.icon, configurations:
|
|
570
|
-
[t.title, t.icon,
|
|
571
|
-
),
|
|
573
|
+
), n = E(
|
|
574
|
+
() => ({ title: t.title, icon: t.icon, configurations: r }),
|
|
575
|
+
[t.title, t.icon, r]
|
|
576
|
+
), o = E(
|
|
572
577
|
() => ({ contextData: t.contextData ?? {} }),
|
|
573
578
|
[t.contextData]
|
|
574
579
|
);
|
|
575
|
-
return e ? /* @__PURE__ */ a(et.Provider, { value:
|
|
580
|
+
return e ? /* @__PURE__ */ a(et.Provider, { value: n, children: /* @__PURE__ */ a(at.Provider, { value: o, children: /* @__PURE__ */ a($e, { defaultTheme: "system", storageKey: "appshell-ui-theme", children: /* @__PURE__ */ a(Fe, { rootComponent: t.rootComponent, children: t.children }) }) }) }) : null;
|
|
576
581
|
};
|
|
577
|
-
function
|
|
582
|
+
function He({
|
|
578
583
|
...t
|
|
579
584
|
}) {
|
|
580
585
|
return /* @__PURE__ */ a(J.Root, { "data-slot": "collapsible", ...t });
|
|
@@ -590,7 +595,7 @@ function mt({
|
|
|
590
595
|
}
|
|
591
596
|
);
|
|
592
597
|
}
|
|
593
|
-
function
|
|
598
|
+
function qe({
|
|
594
599
|
...t
|
|
595
600
|
}) {
|
|
596
601
|
return /* @__PURE__ */ a(
|
|
@@ -602,11 +607,11 @@ function Ke({
|
|
|
602
607
|
);
|
|
603
608
|
}
|
|
604
609
|
const H = 768;
|
|
605
|
-
function
|
|
606
|
-
const [t, e] =
|
|
610
|
+
function Ge() {
|
|
611
|
+
const [t, e] = f.useState(
|
|
607
612
|
void 0
|
|
608
613
|
);
|
|
609
|
-
return
|
|
614
|
+
return f.useEffect(() => {
|
|
610
615
|
const s = window.matchMedia(`(max-width: ${H - 1}px)`), r = () => {
|
|
611
616
|
e(window.innerWidth < H);
|
|
612
617
|
};
|
|
@@ -614,11 +619,11 @@ function Ve() {
|
|
|
614
619
|
}, []), !!t;
|
|
615
620
|
}
|
|
616
621
|
const q = 768, G = 1199;
|
|
617
|
-
function
|
|
618
|
-
const [t, e] =
|
|
622
|
+
function Qe() {
|
|
623
|
+
const [t, e] = f.useState(
|
|
619
624
|
void 0
|
|
620
625
|
);
|
|
621
|
-
return
|
|
626
|
+
return f.useEffect(() => {
|
|
622
627
|
const s = window.matchMedia(
|
|
623
628
|
`(min-width: ${q}px) and (max-width: ${G}px)`
|
|
624
629
|
), r = () => {
|
|
@@ -631,7 +636,7 @@ function Ue() {
|
|
|
631
636
|
), () => s.removeEventListener("change", r);
|
|
632
637
|
}, []), !!t;
|
|
633
638
|
}
|
|
634
|
-
function
|
|
639
|
+
function Ye({ className: t, type: e, ...s }) {
|
|
635
640
|
return /* @__PURE__ */ a(
|
|
636
641
|
"input",
|
|
637
642
|
{
|
|
@@ -648,19 +653,19 @@ function He({ className: t, type: e, ...s }) {
|
|
|
648
653
|
);
|
|
649
654
|
}
|
|
650
655
|
function ht({ ...t }) {
|
|
651
|
-
return /* @__PURE__ */ a(
|
|
656
|
+
return /* @__PURE__ */ a(v.Root, { "data-slot": "sheet", ...t });
|
|
652
657
|
}
|
|
653
|
-
function
|
|
658
|
+
function Xe({
|
|
654
659
|
...t
|
|
655
660
|
}) {
|
|
656
|
-
return /* @__PURE__ */ a(
|
|
661
|
+
return /* @__PURE__ */ a(v.Portal, { "data-slot": "sheet-portal", ...t });
|
|
657
662
|
}
|
|
658
|
-
function
|
|
663
|
+
function Ze({
|
|
659
664
|
className: t,
|
|
660
665
|
...e
|
|
661
666
|
}) {
|
|
662
667
|
return /* @__PURE__ */ a(
|
|
663
|
-
|
|
668
|
+
v.Overlay,
|
|
664
669
|
{
|
|
665
670
|
"data-slot": "sheet-overlay",
|
|
666
671
|
className: m(
|
|
@@ -677,10 +682,10 @@ function ft({
|
|
|
677
682
|
side: s = "right",
|
|
678
683
|
...r
|
|
679
684
|
}) {
|
|
680
|
-
return /* @__PURE__ */ d(
|
|
681
|
-
/* @__PURE__ */ a(
|
|
685
|
+
return /* @__PURE__ */ d(Xe, { children: [
|
|
686
|
+
/* @__PURE__ */ a(Ze, {}),
|
|
682
687
|
/* @__PURE__ */ d(
|
|
683
|
-
|
|
688
|
+
v.Content,
|
|
684
689
|
{
|
|
685
690
|
"data-slot": "sheet-content",
|
|
686
691
|
className: m(
|
|
@@ -694,7 +699,7 @@ function ft({
|
|
|
694
699
|
...r,
|
|
695
700
|
children: [
|
|
696
701
|
e,
|
|
697
|
-
/* @__PURE__ */ d(
|
|
702
|
+
/* @__PURE__ */ d(v.Close, { className: "astw:ring-offset-bg astw:focus:ring-ring astw:data-[state=open]:bg-secondary astw:absolute astw:top-4 astw:right-4 astw:rounded-xs astw:opacity-70 astw:transition-opacity astw:hover:opacity-100 astw:focus:ring-2 astw:focus:ring-offset-2 astw:focus:outline-hidden astw:disabled:pointer-events-none", children: [
|
|
698
703
|
/* @__PURE__ */ a(At, { className: "astw:size-4" }),
|
|
699
704
|
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: "Close" })
|
|
700
705
|
] })
|
|
@@ -703,7 +708,7 @@ function ft({
|
|
|
703
708
|
)
|
|
704
709
|
] });
|
|
705
710
|
}
|
|
706
|
-
function
|
|
711
|
+
function gt({ className: t, ...e }) {
|
|
707
712
|
return /* @__PURE__ */ a(
|
|
708
713
|
"div",
|
|
709
714
|
{
|
|
@@ -713,12 +718,12 @@ function pt({ className: t, ...e }) {
|
|
|
713
718
|
}
|
|
714
719
|
);
|
|
715
720
|
}
|
|
716
|
-
function
|
|
721
|
+
function pt({
|
|
717
722
|
className: t,
|
|
718
723
|
...e
|
|
719
724
|
}) {
|
|
720
725
|
return /* @__PURE__ */ a(
|
|
721
|
-
|
|
726
|
+
v.Title,
|
|
722
727
|
{
|
|
723
728
|
"data-slot": "sheet-title",
|
|
724
729
|
className: m("astw:text-foreground astw:font-semibold", t),
|
|
@@ -731,7 +736,7 @@ function bt({
|
|
|
731
736
|
...e
|
|
732
737
|
}) {
|
|
733
738
|
return /* @__PURE__ */ a(
|
|
734
|
-
|
|
739
|
+
v.Description,
|
|
735
740
|
{
|
|
736
741
|
"data-slot": "sheet-description",
|
|
737
742
|
className: m("astw:text-muted-foreground astw:text-sm", t),
|
|
@@ -744,7 +749,7 @@ function nt({
|
|
|
744
749
|
...e
|
|
745
750
|
}) {
|
|
746
751
|
return /* @__PURE__ */ a(
|
|
747
|
-
|
|
752
|
+
B.Provider,
|
|
748
753
|
{
|
|
749
754
|
"data-slot": "tooltip-provider",
|
|
750
755
|
delayDuration: t,
|
|
@@ -755,12 +760,12 @@ function nt({
|
|
|
755
760
|
function ot({
|
|
756
761
|
...t
|
|
757
762
|
}) {
|
|
758
|
-
return /* @__PURE__ */ a(nt, { children: /* @__PURE__ */ a(
|
|
763
|
+
return /* @__PURE__ */ a(nt, { children: /* @__PURE__ */ a(B.Root, { "data-slot": "tooltip", ...t }) });
|
|
759
764
|
}
|
|
760
765
|
function it({
|
|
761
766
|
...t
|
|
762
767
|
}) {
|
|
763
|
-
return /* @__PURE__ */ a(
|
|
768
|
+
return /* @__PURE__ */ a(B.Trigger, { "data-slot": "tooltip-trigger", ...t });
|
|
764
769
|
}
|
|
765
770
|
function lt({
|
|
766
771
|
className: t,
|
|
@@ -768,8 +773,8 @@ function lt({
|
|
|
768
773
|
children: s,
|
|
769
774
|
...r
|
|
770
775
|
}) {
|
|
771
|
-
return /* @__PURE__ */ a(
|
|
772
|
-
|
|
776
|
+
return /* @__PURE__ */ a(B.Portal, { children: /* @__PURE__ */ d(
|
|
777
|
+
B.Content,
|
|
773
778
|
{
|
|
774
779
|
"data-slot": "tooltip-content",
|
|
775
780
|
sideOffset: e,
|
|
@@ -780,19 +785,19 @@ function lt({
|
|
|
780
785
|
...r,
|
|
781
786
|
children: [
|
|
782
787
|
s,
|
|
783
|
-
/* @__PURE__ */ a(
|
|
788
|
+
/* @__PURE__ */ a(B.Arrow, { className: "astw:bg-primary astw:fill-primary astw:z-50 astw:size-2.5 astw:translate-y-[calc(-50%_-_2px)] astw:rotate-45 astw:rounded-[2px]" })
|
|
784
789
|
]
|
|
785
790
|
}
|
|
786
791
|
) });
|
|
787
792
|
}
|
|
788
|
-
const
|
|
793
|
+
const jt = "16rem", Je = "18rem", ta = "3rem", ea = "b", Kt = f.createContext(null);
|
|
789
794
|
function F() {
|
|
790
|
-
const t =
|
|
795
|
+
const t = f.useContext(Kt);
|
|
791
796
|
if (!t)
|
|
792
797
|
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
793
798
|
return t;
|
|
794
799
|
}
|
|
795
|
-
function
|
|
800
|
+
function aa({
|
|
796
801
|
defaultOpen: t = !0,
|
|
797
802
|
open: e,
|
|
798
803
|
onOpenChange: s,
|
|
@@ -801,52 +806,52 @@ function Ze({
|
|
|
801
806
|
children: o,
|
|
802
807
|
...i
|
|
803
808
|
}) {
|
|
804
|
-
const l =
|
|
805
|
-
(
|
|
806
|
-
const
|
|
807
|
-
s ? s(
|
|
809
|
+
const l = Ge(), u = Qe(), [w, c] = f.useState(!1), [h, g] = f.useState(!1), [p, x] = f.useState(t), b = e ?? p, C = f.useCallback(
|
|
810
|
+
(y) => {
|
|
811
|
+
const k = typeof y == "function" ? y(b) : y;
|
|
812
|
+
s ? s(k) : x(k);
|
|
808
813
|
},
|
|
809
|
-
[s,
|
|
810
|
-
),
|
|
811
|
-
|
|
812
|
-
const
|
|
813
|
-
|
|
814
|
+
[s, b]
|
|
815
|
+
), T = u && !l, O = f.useCallback(() => l ? c((y) => !y) : T ? g((y) => !y) : C((y) => !y), [l, T, C, c]);
|
|
816
|
+
f.useEffect(() => {
|
|
817
|
+
const y = (k) => {
|
|
818
|
+
k.key === ea && (k.metaKey || k.ctrlKey) && (k.preventDefault(), O());
|
|
814
819
|
};
|
|
815
|
-
return window.addEventListener("keydown",
|
|
820
|
+
return window.addEventListener("keydown", y), () => window.removeEventListener("keydown", y);
|
|
816
821
|
}, [O]);
|
|
817
|
-
const ct =
|
|
822
|
+
const ct = b ? "expanded" : "collapsed", Xt = f.useMemo(
|
|
818
823
|
() => ({
|
|
819
824
|
state: ct,
|
|
820
|
-
open:
|
|
821
|
-
setOpen:
|
|
825
|
+
open: b,
|
|
826
|
+
setOpen: C,
|
|
822
827
|
isMobile: l,
|
|
823
828
|
openMobile: w,
|
|
824
829
|
setOpenMobile: c,
|
|
825
830
|
toggleSidebar: O,
|
|
826
|
-
isIconMode:
|
|
831
|
+
isIconMode: T,
|
|
827
832
|
openIconMode: h,
|
|
828
|
-
setOpenIconMode:
|
|
833
|
+
setOpenIconMode: g
|
|
829
834
|
}),
|
|
830
835
|
[
|
|
831
836
|
ct,
|
|
832
|
-
|
|
833
|
-
|
|
837
|
+
b,
|
|
838
|
+
C,
|
|
834
839
|
l,
|
|
835
840
|
w,
|
|
836
841
|
c,
|
|
837
842
|
O,
|
|
838
|
-
|
|
843
|
+
T,
|
|
839
844
|
h,
|
|
840
|
-
|
|
845
|
+
g
|
|
841
846
|
]
|
|
842
847
|
);
|
|
843
|
-
return /* @__PURE__ */ a(
|
|
848
|
+
return /* @__PURE__ */ a(Kt.Provider, { value: Xt, children: /* @__PURE__ */ a(nt, { delayDuration: 0, children: /* @__PURE__ */ a(
|
|
844
849
|
"div",
|
|
845
850
|
{
|
|
846
851
|
"data-slot": "sidebar-wrapper",
|
|
847
852
|
style: {
|
|
848
|
-
"--sidebar-width":
|
|
849
|
-
"--sidebar-width-icon":
|
|
853
|
+
"--sidebar-width": jt,
|
|
854
|
+
"--sidebar-width-icon": ta,
|
|
850
855
|
...n
|
|
851
856
|
},
|
|
852
857
|
className: m(
|
|
@@ -858,7 +863,7 @@ function Ze({
|
|
|
858
863
|
}
|
|
859
864
|
) }) });
|
|
860
865
|
}
|
|
861
|
-
function
|
|
866
|
+
function sa({
|
|
862
867
|
side: t = "left",
|
|
863
868
|
variant: e = "sidebar",
|
|
864
869
|
collapsible: s = "offcanvas",
|
|
@@ -873,7 +878,7 @@ function Je({
|
|
|
873
878
|
setOpenMobile: w,
|
|
874
879
|
isIconMode: c,
|
|
875
880
|
openIconMode: h,
|
|
876
|
-
setOpenIconMode:
|
|
881
|
+
setOpenIconMode: g
|
|
877
882
|
} = F();
|
|
878
883
|
return s === "none" ? /* @__PURE__ */ a(
|
|
879
884
|
"div",
|
|
@@ -894,18 +899,18 @@ function Je({
|
|
|
894
899
|
"data-mobile": "true",
|
|
895
900
|
className: "astw:bg-sidebar astw:text-sidebar-foreground astw:w-(--sidebar-width) astw:p-0 astw:[&>button]:hidden",
|
|
896
901
|
style: {
|
|
897
|
-
"--sidebar-width":
|
|
902
|
+
"--sidebar-width": Je
|
|
898
903
|
},
|
|
899
904
|
side: t,
|
|
900
905
|
children: [
|
|
901
|
-
/* @__PURE__ */ d(
|
|
902
|
-
/* @__PURE__ */ a(
|
|
906
|
+
/* @__PURE__ */ d(gt, { className: "astw:sr-only", children: [
|
|
907
|
+
/* @__PURE__ */ a(pt, { children: "Sidebar" }),
|
|
903
908
|
/* @__PURE__ */ a(bt, { children: "Displays the mobile sidebar." })
|
|
904
909
|
] }),
|
|
905
910
|
/* @__PURE__ */ a("div", { className: "flex h-full w-full flex-col", children: n })
|
|
906
911
|
]
|
|
907
912
|
}
|
|
908
|
-
) }) : c && s === "icon" ? /* @__PURE__ */ d(
|
|
913
|
+
) }) : c && s === "icon" ? /* @__PURE__ */ d(A, { children: [
|
|
909
914
|
/* @__PURE__ */ d(
|
|
910
915
|
"div",
|
|
911
916
|
{
|
|
@@ -950,7 +955,7 @@ function Je({
|
|
|
950
955
|
]
|
|
951
956
|
}
|
|
952
957
|
),
|
|
953
|
-
/* @__PURE__ */ a(ht, { open: h, onOpenChange:
|
|
958
|
+
/* @__PURE__ */ a(ht, { open: h, onOpenChange: g, ...o, children: /* @__PURE__ */ d(
|
|
954
959
|
ft,
|
|
955
960
|
{
|
|
956
961
|
"data-sidebar": "sidebar",
|
|
@@ -958,12 +963,12 @@ function Je({
|
|
|
958
963
|
"data-icon-mode": "true",
|
|
959
964
|
className: "astw:bg-sidebar astw:text-sidebar-foreground astw:w-(--sidebar-width) astw:p-0 astw:[&>button]:hidden",
|
|
960
965
|
style: {
|
|
961
|
-
"--sidebar-width":
|
|
966
|
+
"--sidebar-width": jt
|
|
962
967
|
},
|
|
963
968
|
side: t,
|
|
964
969
|
children: [
|
|
965
|
-
/* @__PURE__ */ d(
|
|
966
|
-
/* @__PURE__ */ a(
|
|
970
|
+
/* @__PURE__ */ d(gt, { className: "astw:sr-only", children: [
|
|
971
|
+
/* @__PURE__ */ a(pt, { children: "Sidebar" }),
|
|
967
972
|
/* @__PURE__ */ a(bt, { children: "Displays the sidebar overlay." })
|
|
968
973
|
] }),
|
|
969
974
|
/* @__PURE__ */ a("div", { className: "flex h-full w-full flex-col", children: n })
|
|
@@ -1020,7 +1025,7 @@ function Je({
|
|
|
1020
1025
|
}
|
|
1021
1026
|
);
|
|
1022
1027
|
}
|
|
1023
|
-
function
|
|
1028
|
+
function Vt({
|
|
1024
1029
|
className: t,
|
|
1025
1030
|
onClick: e,
|
|
1026
1031
|
...s
|
|
@@ -1039,13 +1044,13 @@ function Kt({
|
|
|
1039
1044
|
},
|
|
1040
1045
|
...s,
|
|
1041
1046
|
children: [
|
|
1042
|
-
/* @__PURE__ */ a(
|
|
1047
|
+
/* @__PURE__ */ a(me, { className: "astw:size-4.5" }),
|
|
1043
1048
|
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: "Toggle Sidebar" })
|
|
1044
1049
|
]
|
|
1045
1050
|
}
|
|
1046
1051
|
);
|
|
1047
1052
|
}
|
|
1048
|
-
function
|
|
1053
|
+
function ra({ className: t, ...e }) {
|
|
1049
1054
|
return /* @__PURE__ */ a(
|
|
1050
1055
|
"main",
|
|
1051
1056
|
{
|
|
@@ -1060,7 +1065,7 @@ function ta({ className: t, ...e }) {
|
|
|
1060
1065
|
}
|
|
1061
1066
|
);
|
|
1062
1067
|
}
|
|
1063
|
-
function
|
|
1068
|
+
function na({ className: t, ...e }) {
|
|
1064
1069
|
return /* @__PURE__ */ a(
|
|
1065
1070
|
"div",
|
|
1066
1071
|
{
|
|
@@ -1074,7 +1079,7 @@ function ea({ className: t, ...e }) {
|
|
|
1074
1079
|
}
|
|
1075
1080
|
);
|
|
1076
1081
|
}
|
|
1077
|
-
function
|
|
1082
|
+
function oa({ className: t, ...e }) {
|
|
1078
1083
|
return /* @__PURE__ */ a(
|
|
1079
1084
|
"div",
|
|
1080
1085
|
{
|
|
@@ -1088,7 +1093,7 @@ function aa({ className: t, ...e }) {
|
|
|
1088
1093
|
}
|
|
1089
1094
|
);
|
|
1090
1095
|
}
|
|
1091
|
-
function
|
|
1096
|
+
function Ut({ className: t, ...e }) {
|
|
1092
1097
|
return /* @__PURE__ */ a(
|
|
1093
1098
|
"div",
|
|
1094
1099
|
{
|
|
@@ -1102,7 +1107,7 @@ function Vt({ className: t, ...e }) {
|
|
|
1102
1107
|
}
|
|
1103
1108
|
);
|
|
1104
1109
|
}
|
|
1105
|
-
function
|
|
1110
|
+
function Ht({ className: t, ...e }) {
|
|
1106
1111
|
return /* @__PURE__ */ a(
|
|
1107
1112
|
"ul",
|
|
1108
1113
|
{
|
|
@@ -1116,7 +1121,7 @@ function Ut({ className: t, ...e }) {
|
|
|
1116
1121
|
}
|
|
1117
1122
|
);
|
|
1118
1123
|
}
|
|
1119
|
-
function
|
|
1124
|
+
function qt({ className: t, ...e }) {
|
|
1120
1125
|
return /* @__PURE__ */ a(
|
|
1121
1126
|
"li",
|
|
1122
1127
|
{
|
|
@@ -1127,7 +1132,7 @@ function Ht({ className: t, ...e }) {
|
|
|
1127
1132
|
}
|
|
1128
1133
|
);
|
|
1129
1134
|
}
|
|
1130
|
-
const
|
|
1135
|
+
const ia = Z(
|
|
1131
1136
|
"astw:peer/menu-button astw:flex astw:w-full astw:items-center astw:gap-2 astw:overflow-hidden astw:rounded-md astw:p-2 astw:text-left astw:text-sm astw:outline-hidden astw:ring-sidebar-ring astw:transition-[width,height,padding] astw:hover:bg-sidebar-accent astw:hover:text-sidebar-accent-foreground astw:focus-visible:ring-2 astw:active:bg-sidebar-accent astw:active:text-sidebar-accent-foreground astw:disabled:pointer-events-none astw:disabled:opacity-50 astw:group-has-data-[sidebar=menu-action]/menu-item:pr-8 astw:aria-disabled:pointer-events-none astw:aria-disabled:opacity-50 astw:data-[active=true]:bg-sidebar-accent astw:data-[active=true]:font-medium astw:data-[active=true]:text-sidebar-accent-foreground astw:data-[state=open]:hover:bg-sidebar-accent astw:data-[state=open]:hover:text-sidebar-accent-foreground astw:group-data-[collapsible=icon]:size-8! astw:group-data-[collapsible=icon]:p-2! astw:[&>span:last-child]:truncate astw:group-data-[collapsible=icon]:[&>span:last-child]:hidden astw:[&>svg]:size-4 astw:[&>svg]:shrink-0",
|
|
1132
1137
|
{
|
|
1133
1138
|
variants: {
|
|
@@ -1163,7 +1168,7 @@ function xt({
|
|
|
1163
1168
|
"data-sidebar": "menu-button",
|
|
1164
1169
|
"data-size": r,
|
|
1165
1170
|
"data-active": e,
|
|
1166
|
-
className: m(
|
|
1171
|
+
className: m(ia({ variant: s, size: r }), o),
|
|
1167
1172
|
...i
|
|
1168
1173
|
}
|
|
1169
1174
|
);
|
|
@@ -1208,7 +1213,7 @@ function vt({
|
|
|
1208
1213
|
}
|
|
1209
1214
|
);
|
|
1210
1215
|
}
|
|
1211
|
-
function
|
|
1216
|
+
function la({ className: t, ...e }) {
|
|
1212
1217
|
return /* @__PURE__ */ a(
|
|
1213
1218
|
"ul",
|
|
1214
1219
|
{
|
|
@@ -1223,7 +1228,7 @@ function ra({ className: t, ...e }) {
|
|
|
1223
1228
|
}
|
|
1224
1229
|
);
|
|
1225
1230
|
}
|
|
1226
|
-
function
|
|
1231
|
+
function da({
|
|
1227
1232
|
className: t,
|
|
1228
1233
|
...e
|
|
1229
1234
|
}) {
|
|
@@ -1237,7 +1242,7 @@ function na({
|
|
|
1237
1242
|
}
|
|
1238
1243
|
);
|
|
1239
1244
|
}
|
|
1240
|
-
function
|
|
1245
|
+
function ca({
|
|
1241
1246
|
asChild: t = !1,
|
|
1242
1247
|
size: e = "md",
|
|
1243
1248
|
isActive: s = !1,
|
|
@@ -1265,7 +1270,7 @@ function oa({
|
|
|
1265
1270
|
}
|
|
1266
1271
|
function Y({ to: t, children: e, ...s }) {
|
|
1267
1272
|
try {
|
|
1268
|
-
return
|
|
1273
|
+
return oe(t), /* @__PURE__ */ a(ie, { to: t, ...s, children: e });
|
|
1269
1274
|
} catch {
|
|
1270
1275
|
return /* @__PURE__ */ a("a", { href: t, ...s, children: e });
|
|
1271
1276
|
}
|
|
@@ -1312,7 +1317,7 @@ function Ct({
|
|
|
1312
1317
|
}
|
|
1313
1318
|
);
|
|
1314
1319
|
}
|
|
1315
|
-
function
|
|
1320
|
+
function wa({
|
|
1316
1321
|
children: t,
|
|
1317
1322
|
className: e,
|
|
1318
1323
|
...s
|
|
@@ -1329,20 +1334,21 @@ function ia({
|
|
|
1329
1334
|
}
|
|
1330
1335
|
);
|
|
1331
1336
|
}
|
|
1332
|
-
function
|
|
1337
|
+
function ua(t, e) {
|
|
1333
1338
|
if (!e.trim()) return t;
|
|
1334
1339
|
const s = e.toLowerCase();
|
|
1335
1340
|
return t.filter(
|
|
1336
1341
|
(r) => r.title.toLowerCase().includes(s) || r.path.toLowerCase().includes(s)
|
|
1337
1342
|
);
|
|
1338
1343
|
}
|
|
1339
|
-
const
|
|
1340
|
-
const s =
|
|
1344
|
+
const ma = (t, e) => {
|
|
1345
|
+
const s = Lt(e);
|
|
1341
1346
|
return t.reduce(
|
|
1342
1347
|
(r, n) => {
|
|
1343
1348
|
const o = s(n.meta.title, n.path);
|
|
1344
1349
|
r[n.path] = {
|
|
1345
1350
|
title: o,
|
|
1351
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- breadcrumbTitle exists at runtime but not in CommonPageResource type
|
|
1346
1352
|
breadcrumbTitle: n.meta.breadcrumbTitle
|
|
1347
1353
|
};
|
|
1348
1354
|
const i = (l, u) => {
|
|
@@ -1353,6 +1359,7 @@ const da = (t, e) => {
|
|
|
1353
1359
|
);
|
|
1354
1360
|
r[c] = {
|
|
1355
1361
|
title: h,
|
|
1362
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- breadcrumbTitle exists at runtime but not in CommonPageResource type
|
|
1356
1363
|
breadcrumbTitle: w.meta.breadcrumbTitle
|
|
1357
1364
|
}, w.subResources && w.subResources.length > 0 && i(
|
|
1358
1365
|
w.subResources,
|
|
@@ -1365,24 +1372,24 @@ const da = (t, e) => {
|
|
|
1365
1372
|
{}
|
|
1366
1373
|
);
|
|
1367
1374
|
};
|
|
1368
|
-
function
|
|
1369
|
-
const n = t.split("/").filter((u) => u !== ""), o = e && n[0] === e ? n.slice(1) : n, i =
|
|
1375
|
+
function ha(t, e, s, r) {
|
|
1376
|
+
const n = t.split("/").filter((u) => u !== ""), o = e && n[0] === e ? n.slice(1) : n, i = ma(s, r), l = o.map((u, w) => {
|
|
1370
1377
|
const c = o.slice(0, w + 1).join("/");
|
|
1371
1378
|
let h = i[c];
|
|
1372
1379
|
if (!h) {
|
|
1373
1380
|
const p = Object.entries(i).find(
|
|
1374
|
-
([
|
|
1375
|
-
const
|
|
1376
|
-
return new RegExp(`^${
|
|
1381
|
+
([x]) => {
|
|
1382
|
+
const b = x.split("/").map((T) => T.startsWith(":") ? "[^/]+" : T).join("/");
|
|
1383
|
+
return new RegExp(`^${b}$`).test(c);
|
|
1377
1384
|
}
|
|
1378
1385
|
)?.[1];
|
|
1379
1386
|
p && (h = p);
|
|
1380
1387
|
}
|
|
1381
|
-
let
|
|
1382
|
-
return h ? typeof h.breadcrumbTitle == "function" ?
|
|
1388
|
+
let g;
|
|
1389
|
+
return h ? typeof h.breadcrumbTitle == "function" ? g = h.breadcrumbTitle(u) : typeof h.breadcrumbTitle == "string" ? g = h.breadcrumbTitle : g = h.title : g = decodeURIComponent(u), {
|
|
1383
1390
|
segment: u,
|
|
1384
1391
|
path: c,
|
|
1385
|
-
title:
|
|
1392
|
+
title: g
|
|
1386
1393
|
};
|
|
1387
1394
|
});
|
|
1388
1395
|
return {
|
|
@@ -1390,28 +1397,28 @@ function ca(t, e, s, r) {
|
|
|
1390
1397
|
segments: l
|
|
1391
1398
|
};
|
|
1392
1399
|
}
|
|
1393
|
-
const
|
|
1400
|
+
const fa = () => {
|
|
1394
1401
|
const { open: t, isIconMode: e } = F();
|
|
1395
|
-
return /* @__PURE__ */ a("div", { className: t && !e ? "astw:md:hidden" : void 0, children: /* @__PURE__ */ a(
|
|
1396
|
-
},
|
|
1402
|
+
return /* @__PURE__ */ a("div", { className: t && !e ? "astw:md:hidden" : void 0, children: /* @__PURE__ */ a(Vt, { className: "astw:-ml-2.5" }) });
|
|
1403
|
+
}, xs = (t) => {
|
|
1397
1404
|
const e = t.children ? t.children({ Outlet: ut }) : null, s = We(), r = () => {
|
|
1398
1405
|
s.setTheme(s.theme === "dark" ? "light" : "dark");
|
|
1399
1406
|
};
|
|
1400
|
-
return /* @__PURE__ */ a(
|
|
1401
|
-
t.sidebar ?? /* @__PURE__ */ a(
|
|
1402
|
-
/* @__PURE__ */ d(
|
|
1407
|
+
return /* @__PURE__ */ a(aa, { className: "astw:flex astw:flex-col", children: /* @__PURE__ */ d("div", { className: "astw:flex astw:flex-1", children: [
|
|
1408
|
+
t.sidebar ?? /* @__PURE__ */ a(ga, {}),
|
|
1409
|
+
/* @__PURE__ */ d(ra, { className: "astw:w-[calc(100%-var(--sidebar-width))]", children: [
|
|
1403
1410
|
/* @__PURE__ */ a("header", { className: "astw:flex astw:h-14 astw:shrink-0 astw:items-center astw:gap-2 astw:transition-[width,height] astw:ease-linear astw:group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: /* @__PURE__ */ d("div", { className: "astw:flex astw:w-full astw:items-center astw:justify-between", children: [
|
|
1404
1411
|
/* @__PURE__ */ d("div", { className: "astw:flex astw:items-center astw:gap-2", children: [
|
|
1405
|
-
/* @__PURE__ */ a(
|
|
1406
|
-
/* @__PURE__ */ a(
|
|
1412
|
+
/* @__PURE__ */ a(fa, {}),
|
|
1413
|
+
/* @__PURE__ */ a(Na, {})
|
|
1407
1414
|
] }),
|
|
1408
|
-
/* @__PURE__ */ a("div", { className: "astw:flex astw:items-center astw:gap-2", children: /* @__PURE__ */ a(_, { variant: "outline", size: "icon", onClick: r, children: /* @__PURE__ */ a(
|
|
1415
|
+
/* @__PURE__ */ a("div", { className: "astw:flex astw:items-center astw:gap-2", children: /* @__PURE__ */ a(_, { variant: "outline", size: "icon", onClick: r, children: /* @__PURE__ */ a(he, {}) }) })
|
|
1409
1416
|
] }) }),
|
|
1410
1417
|
/* @__PURE__ */ a("div", { className: "astw:flex astw:flex-col astw:gap-4 astw:flex-1 astw:min-h-0", children: e ?? /* @__PURE__ */ a(ut, {}) })
|
|
1411
1418
|
] })
|
|
1412
1419
|
] }) });
|
|
1413
|
-
},
|
|
1414
|
-
const { title: e, icon: s } =
|
|
1420
|
+
}, ga = (t) => {
|
|
1421
|
+
const { title: e, icon: s } = P(), { pathname: r } = Et(), { isIconMode: n } = F(), o = /* @__PURE__ */ d(na, { children: [
|
|
1415
1422
|
s,
|
|
1416
1423
|
/* @__PURE__ */ a(
|
|
1417
1424
|
"h1",
|
|
@@ -1424,21 +1431,21 @@ const wa = () => {
|
|
|
1424
1431
|
}
|
|
1425
1432
|
)
|
|
1426
1433
|
] });
|
|
1427
|
-
return /* @__PURE__ */ d(
|
|
1434
|
+
return /* @__PURE__ */ d(sa, { variant: "inset", collapsible: n ? "icon" : "offcanvas", children: [
|
|
1428
1435
|
!n && /* @__PURE__ */ d("div", { className: "astw:flex astw:justify-between astw:items-center", children: [
|
|
1429
1436
|
t.header ?? o,
|
|
1430
|
-
/* @__PURE__ */ a("div", { className: "astw:hidden astw:md:block", children: /* @__PURE__ */ a(
|
|
1437
|
+
/* @__PURE__ */ a("div", { className: "astw:hidden astw:md:block", children: /* @__PURE__ */ a(Vt, { className: "astw:-ml-1" }) })
|
|
1431
1438
|
] }),
|
|
1432
|
-
/* @__PURE__ */ a(
|
|
1439
|
+
/* @__PURE__ */ a(oa, { children: /* @__PURE__ */ a(Pt, { fallback: /* @__PURE__ */ a(va, {}), children: /* @__PURE__ */ a(pa, { currentPath: r }) }) }),
|
|
1433
1440
|
t.footer ?? null
|
|
1434
1441
|
] });
|
|
1435
|
-
},
|
|
1436
|
-
const e =
|
|
1437
|
-
return /* @__PURE__ */ a(Bt, { resolve: e, children: (s) => /* @__PURE__ */ a(
|
|
1438
|
-
},
|
|
1439
|
-
const e =
|
|
1440
|
-
return /* @__PURE__ */ a(
|
|
1441
|
-
s.url ? /* @__PURE__ */ d(
|
|
1442
|
+
}, pa = ({ currentPath: t }) => {
|
|
1443
|
+
const e = Ot();
|
|
1444
|
+
return /* @__PURE__ */ a(Bt, { resolve: e, children: (s) => /* @__PURE__ */ a(ba, { items: s ?? [], currentPath: t }) });
|
|
1445
|
+
}, ba = (t) => {
|
|
1446
|
+
const e = L();
|
|
1447
|
+
return /* @__PURE__ */ a(Ut, { children: /* @__PURE__ */ a(Ht, { children: t.items.map((s) => /* @__PURE__ */ a(He, { asChild: !0, defaultOpen: !0, children: /* @__PURE__ */ d(qt, { children: [
|
|
1448
|
+
s.url ? /* @__PURE__ */ d(A, { children: [
|
|
1442
1449
|
/* @__PURE__ */ a(xt, { asChild: !0, tooltip: s.title, children: /* @__PURE__ */ d(
|
|
1443
1450
|
Y,
|
|
1444
1451
|
{
|
|
@@ -1454,8 +1461,8 @@ const wa = () => {
|
|
|
1454
1461
|
/* @__PURE__ */ a(Q, {}),
|
|
1455
1462
|
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: e("toggle") })
|
|
1456
1463
|
] }) })
|
|
1457
|
-
] }) : /* @__PURE__ */ a(
|
|
1458
|
-
/* @__PURE__ */ a(xt, { asChild: !0, tooltip: s.title, children: /* @__PURE__ */ d("span", { className: "astw:flex astw:w-
|
|
1464
|
+
] }) : /* @__PURE__ */ a(A, { children: /* @__PURE__ */ d(mt, { className: "astw:flex astw:w-full astw:[&[data-state=open]_.astw-rotate-target]:rotate-90", children: [
|
|
1465
|
+
/* @__PURE__ */ a(xt, { asChild: !0, tooltip: s.title, children: /* @__PURE__ */ d("span", { className: "astw:flex astw:w-full", children: [
|
|
1459
1466
|
s.icon,
|
|
1460
1467
|
/* @__PURE__ */ a("span", { children: s.title })
|
|
1461
1468
|
] }) }),
|
|
@@ -1471,7 +1478,7 @@ const wa = () => {
|
|
|
1471
1478
|
}
|
|
1472
1479
|
)
|
|
1473
1480
|
] }) }),
|
|
1474
|
-
!!s.items?.length && /* @__PURE__ */ a(
|
|
1481
|
+
!!s.items?.length && /* @__PURE__ */ a(qe, { children: /* @__PURE__ */ a(la, { children: s.items?.map((r) => /* @__PURE__ */ a(da, { children: /* @__PURE__ */ a(ca, { asChild: !0, children: /* @__PURE__ */ a(
|
|
1475
1482
|
Y,
|
|
1476
1483
|
{
|
|
1477
1484
|
to: r.url,
|
|
@@ -1480,56 +1487,53 @@ const wa = () => {
|
|
|
1480
1487
|
}
|
|
1481
1488
|
) }) }, r.title)) }) })
|
|
1482
1489
|
] }) }, s.title)) }) });
|
|
1483
|
-
},
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
"
|
|
1489
|
-
{
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
}, pa = () => {
|
|
1496
|
-
const { configurations: t } = A(), e = Et();
|
|
1497
|
-
return ca(
|
|
1490
|
+
}, xa = [104, 80, 112, 88, 96, 100, 84, 92], va = () => /* @__PURE__ */ a(Ut, { children: /* @__PURE__ */ a(Ht, { className: "astw:px-2", children: xa.map((t, e) => /* @__PURE__ */ a(qt, { children: /* @__PURE__ */ d("div", { className: "astw:flex astw:items-center astw:gap-2 astw:py-1.5", children: [
|
|
1491
|
+
/* @__PURE__ */ a("div", { className: "astw:h-4 astw:w-4 astw:rounded-md astw:bg-muted" }),
|
|
1492
|
+
/* @__PURE__ */ a(
|
|
1493
|
+
"div",
|
|
1494
|
+
{
|
|
1495
|
+
className: "astw:h-4 astw:rounded astw:bg-muted",
|
|
1496
|
+
style: { width: `${t}px` }
|
|
1497
|
+
}
|
|
1498
|
+
)
|
|
1499
|
+
] }) }, e)) }) }), ya = () => {
|
|
1500
|
+
const { configurations: t } = P(), e = Et();
|
|
1501
|
+
return ha(
|
|
1498
1502
|
e.pathname,
|
|
1499
1503
|
t.basePath,
|
|
1500
1504
|
t.modules,
|
|
1501
1505
|
t.locale
|
|
1502
1506
|
);
|
|
1503
|
-
},
|
|
1504
|
-
const { segments: t } =
|
|
1507
|
+
}, Na = () => {
|
|
1508
|
+
const { segments: t } = ya(), e = le("/:prefix/settings/:suffix"), s = L();
|
|
1505
1509
|
return e ? /* @__PURE__ */ a(yt, { children: /* @__PURE__ */ a(Nt, { children: /* @__PURE__ */ a("div", { className: "astw:inline-flex astw:items-center astw:gap-3 astw:last:text-foreground", children: /* @__PURE__ */ a(St, { children: /* @__PURE__ */ a(Ct, { to: `/${e.params.prefix}/settings`, children: s("settings") }) }) }) }) }) : /* @__PURE__ */ a(yt, { children: /* @__PURE__ */ a(Nt, { children: t.map((r, n) => /* @__PURE__ */ d(
|
|
1506
1510
|
"div",
|
|
1507
1511
|
{
|
|
1508
1512
|
className: "astw:inline-flex astw:items-center astw:gap-3 astw:last:text-foreground",
|
|
1509
1513
|
children: [
|
|
1510
1514
|
/* @__PURE__ */ a(St, { children: /* @__PURE__ */ a(Ct, { to: r.path, children: r.title }) }),
|
|
1511
|
-
n < t.length - 1 && /* @__PURE__ */ a(
|
|
1515
|
+
n < t.length - 1 && /* @__PURE__ */ a(wa, {})
|
|
1512
1516
|
]
|
|
1513
1517
|
},
|
|
1514
1518
|
n
|
|
1515
1519
|
)) }) });
|
|
1516
1520
|
};
|
|
1517
|
-
function
|
|
1521
|
+
function Sa({
|
|
1518
1522
|
...t
|
|
1519
1523
|
}) {
|
|
1520
|
-
return /* @__PURE__ */ a(
|
|
1524
|
+
return /* @__PURE__ */ a(v.Root, { "data-slot": "dialog", ...t });
|
|
1521
1525
|
}
|
|
1522
|
-
function
|
|
1526
|
+
function Ca({
|
|
1523
1527
|
...t
|
|
1524
1528
|
}) {
|
|
1525
|
-
return /* @__PURE__ */ a(
|
|
1529
|
+
return /* @__PURE__ */ a(v.Portal, { "data-slot": "dialog-portal", ...t });
|
|
1526
1530
|
}
|
|
1527
|
-
function
|
|
1531
|
+
function Ta({
|
|
1528
1532
|
className: t,
|
|
1529
1533
|
...e
|
|
1530
1534
|
}) {
|
|
1531
1535
|
return /* @__PURE__ */ a(
|
|
1532
|
-
|
|
1536
|
+
v.Overlay,
|
|
1533
1537
|
{
|
|
1534
1538
|
"data-slot": "dialog-overlay",
|
|
1535
1539
|
className: m(
|
|
@@ -1540,15 +1544,15 @@ function va({
|
|
|
1540
1544
|
}
|
|
1541
1545
|
);
|
|
1542
1546
|
}
|
|
1543
|
-
function
|
|
1547
|
+
function ka({
|
|
1544
1548
|
className: t,
|
|
1545
1549
|
children: e,
|
|
1546
1550
|
...s
|
|
1547
1551
|
}) {
|
|
1548
|
-
return /* @__PURE__ */ d(
|
|
1549
|
-
/* @__PURE__ */ a(
|
|
1552
|
+
return /* @__PURE__ */ d(Ca, { "data-slot": "dialog-portal", children: [
|
|
1553
|
+
/* @__PURE__ */ a(Ta, {}),
|
|
1550
1554
|
/* @__PURE__ */ d(
|
|
1551
|
-
|
|
1555
|
+
v.Content,
|
|
1552
1556
|
{
|
|
1553
1557
|
"data-slot": "dialog-content",
|
|
1554
1558
|
className: m(
|
|
@@ -1558,7 +1562,7 @@ function ya({
|
|
|
1558
1562
|
...s,
|
|
1559
1563
|
children: [
|
|
1560
1564
|
e,
|
|
1561
|
-
/* @__PURE__ */ d(
|
|
1565
|
+
/* @__PURE__ */ d(v.Close, { className: "astw:ring-offset-bg astw:focus:ring-ring astw:data-[state=open]:bg-accent astw:data-[state=open]:text-muted-foreground astw:absolute astw:top-4 astw:right-4 astw:rounded-xs astw:opacity-70 astw:transition-opacity astw:hover:opacity-100 astw:focus:ring-2 astw:focus:ring-offset-2 astw:focus:outline-hidden astw:disabled:pointer-events-none astw:[&_svg]:pointer-events-none astw:[&_svg]:shrink-0 astw:[&_svg:not([class*='size-'])]:size-4", children: [
|
|
1562
1566
|
/* @__PURE__ */ a(At, {}),
|
|
1563
1567
|
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: "Close" })
|
|
1564
1568
|
] })
|
|
@@ -1567,12 +1571,12 @@ function ya({
|
|
|
1567
1571
|
)
|
|
1568
1572
|
] });
|
|
1569
1573
|
}
|
|
1570
|
-
function
|
|
1574
|
+
function Ra({
|
|
1571
1575
|
className: t,
|
|
1572
1576
|
...e
|
|
1573
1577
|
}) {
|
|
1574
1578
|
return /* @__PURE__ */ a(
|
|
1575
|
-
|
|
1579
|
+
v.Title,
|
|
1576
1580
|
{
|
|
1577
1581
|
"data-slot": "dialog-title",
|
|
1578
1582
|
className: m("astw:text-lg astw:leading-none astw:font-semibold", t),
|
|
@@ -1580,7 +1584,7 @@ function Na({
|
|
|
1580
1584
|
}
|
|
1581
1585
|
);
|
|
1582
1586
|
}
|
|
1583
|
-
function
|
|
1587
|
+
function Ea(t) {
|
|
1584
1588
|
const e = [], s = (r, n, o) => {
|
|
1585
1589
|
r.forEach((i) => {
|
|
1586
1590
|
const l = [...o, i.title];
|
|
@@ -1601,67 +1605,69 @@ function Sa(t) {
|
|
|
1601
1605
|
}), s(r.items, r.icon, [r.title]);
|
|
1602
1606
|
}), e;
|
|
1603
1607
|
}
|
|
1604
|
-
function
|
|
1608
|
+
function Ba({
|
|
1605
1609
|
routes: t
|
|
1606
1610
|
}) {
|
|
1607
|
-
const e =
|
|
1608
|
-
() =>
|
|
1611
|
+
const e = de(), s = xe(null), [r, n] = $(!1), [o, i] = $(""), [l, u] = $(0), w = E(
|
|
1612
|
+
() => ua(t, o),
|
|
1609
1613
|
[t, o]
|
|
1610
|
-
)
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
+
), c = R((x) => {
|
|
1615
|
+
i(x), u(0);
|
|
1616
|
+
}, []);
|
|
1617
|
+
I(() => {
|
|
1618
|
+
const x = (b) => {
|
|
1619
|
+
(b.metaKey || b.ctrlKey) && b.key === "k" && (b.preventDefault(), n((C) => !C));
|
|
1614
1620
|
};
|
|
1615
|
-
return document.addEventListener("keydown",
|
|
1616
|
-
}, [])
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
+
return document.addEventListener("keydown", x), () => document.removeEventListener("keydown", x);
|
|
1622
|
+
}, []);
|
|
1623
|
+
const h = R((x) => {
|
|
1624
|
+
n(x), x || (i(""), u(0));
|
|
1625
|
+
}, []);
|
|
1626
|
+
I(() => {
|
|
1621
1627
|
s.current && s.current.querySelector(`[data-index="${l}"]`)?.scrollIntoView({ block: "nearest" });
|
|
1622
1628
|
}, [l]);
|
|
1623
|
-
const
|
|
1624
|
-
(
|
|
1625
|
-
e(
|
|
1629
|
+
const g = R(
|
|
1630
|
+
(x) => {
|
|
1631
|
+
e(x.path), n(!1), i("");
|
|
1626
1632
|
},
|
|
1627
1633
|
[e]
|
|
1628
|
-
),
|
|
1629
|
-
(
|
|
1630
|
-
if (!
|
|
1631
|
-
switch (
|
|
1634
|
+
), p = R(
|
|
1635
|
+
(x) => {
|
|
1636
|
+
if (!x.nativeEvent.isComposing)
|
|
1637
|
+
switch (x.key) {
|
|
1632
1638
|
case "ArrowDown":
|
|
1633
|
-
|
|
1634
|
-
(
|
|
1639
|
+
x.preventDefault(), u(
|
|
1640
|
+
(b) => b < w.length - 1 ? b + 1 : b
|
|
1635
1641
|
);
|
|
1636
1642
|
break;
|
|
1637
1643
|
case "ArrowUp":
|
|
1638
|
-
|
|
1644
|
+
x.preventDefault(), u((b) => b > 0 ? b - 1 : b);
|
|
1639
1645
|
break;
|
|
1640
1646
|
case "Enter":
|
|
1641
|
-
|
|
1647
|
+
x.preventDefault(), w[l] && g(w[l]);
|
|
1642
1648
|
break;
|
|
1643
1649
|
}
|
|
1644
1650
|
},
|
|
1645
|
-
[w, l,
|
|
1651
|
+
[w, l, g]
|
|
1646
1652
|
);
|
|
1647
1653
|
return {
|
|
1648
1654
|
open: r,
|
|
1649
|
-
|
|
1655
|
+
handleOpenChange: h,
|
|
1650
1656
|
search: o,
|
|
1651
|
-
setSearch:
|
|
1657
|
+
setSearch: c,
|
|
1652
1658
|
selectedIndex: l,
|
|
1653
1659
|
filteredRoutes: w,
|
|
1654
|
-
handleSelect:
|
|
1655
|
-
handleKeyDown:
|
|
1660
|
+
handleSelect: g,
|
|
1661
|
+
handleKeyDown: p,
|
|
1656
1662
|
listRef: s
|
|
1657
1663
|
};
|
|
1658
1664
|
}
|
|
1659
|
-
function
|
|
1665
|
+
function Aa({
|
|
1660
1666
|
navItems: t
|
|
1661
1667
|
}) {
|
|
1662
|
-
const e =
|
|
1668
|
+
const e = L(), s = E(() => Ea(t), [t]), {
|
|
1663
1669
|
open: r,
|
|
1664
|
-
|
|
1670
|
+
handleOpenChange: n,
|
|
1665
1671
|
search: o,
|
|
1666
1672
|
setSearch: i,
|
|
1667
1673
|
selectedIndex: l,
|
|
@@ -1669,22 +1675,22 @@ function Ta({
|
|
|
1669
1675
|
handleSelect: w,
|
|
1670
1676
|
handleKeyDown: c,
|
|
1671
1677
|
listRef: h
|
|
1672
|
-
} =
|
|
1673
|
-
return /* @__PURE__ */ a(
|
|
1674
|
-
|
|
1678
|
+
} = Ba({ routes: s });
|
|
1679
|
+
return /* @__PURE__ */ a(Sa, { open: r, onOpenChange: n, children: /* @__PURE__ */ d(
|
|
1680
|
+
ka,
|
|
1675
1681
|
{
|
|
1676
1682
|
className: "astw:p-0 astw:gap-0 astw:sm:max-w-2xl astw:overflow-hidden",
|
|
1677
1683
|
onKeyDown: c,
|
|
1678
1684
|
"aria-describedby": void 0,
|
|
1679
1685
|
children: [
|
|
1680
|
-
/* @__PURE__ */ a(
|
|
1686
|
+
/* @__PURE__ */ a(Ra, { className: "astw:sr-only", children: e("commandPaletteSearch") }),
|
|
1681
1687
|
/* @__PURE__ */ d("div", { className: "astw:flex astw:items-center astw:border-b astw:px-3 astw:py-1", children: [
|
|
1682
|
-
/* @__PURE__ */ a(
|
|
1688
|
+
/* @__PURE__ */ a(fe, { className: "astw:mr-2 astw:h-4 astw:w-4 astw:shrink-0 astw:opacity-50" }),
|
|
1683
1689
|
/* @__PURE__ */ a(
|
|
1684
|
-
|
|
1690
|
+
Ye,
|
|
1685
1691
|
{
|
|
1686
1692
|
value: o,
|
|
1687
|
-
onChange: (
|
|
1693
|
+
onChange: (g) => i(g.target.value),
|
|
1688
1694
|
placeholder: e("commandPaletteSearch"),
|
|
1689
1695
|
className: "astw:flex astw:h-10 astw:w-full astw:rounded-md astw:bg-transparent astw:py-3 astw:text-sm astw:outline-none astw:border-0 astw:shadow-none astw:focus-visible:ring-0 astw:placeholder:text-muted-foreground astw:disabled:cursor-not-allowed astw:disabled:opacity-50",
|
|
1690
1696
|
autoFocus: !0
|
|
@@ -1696,24 +1702,24 @@ function Ta({
|
|
|
1696
1702
|
{
|
|
1697
1703
|
ref: h,
|
|
1698
1704
|
className: "astw:max-h-[300px] astw:overflow-y-auto astw:overflow-x-hidden",
|
|
1699
|
-
children: u.length === 0 ? /* @__PURE__ */ a("div", { className: "astw:py-6 astw:text-center astw:text-sm astw:text-muted-foreground", children: e("commandPaletteNoResults") }) : /* @__PURE__ */ a("div", { className: "astw:p-1", children: u.map((
|
|
1705
|
+
children: u.length === 0 ? /* @__PURE__ */ a("div", { className: "astw:py-6 astw:text-center astw:text-sm astw:text-muted-foreground", children: e("commandPaletteNoResults") }) : /* @__PURE__ */ a("div", { className: "astw:p-1", children: u.map((g, p) => /* @__PURE__ */ d(
|
|
1700
1706
|
"button",
|
|
1701
1707
|
{
|
|
1702
1708
|
"data-index": p,
|
|
1703
|
-
onClick: () => w(
|
|
1709
|
+
onClick: () => w(g),
|
|
1704
1710
|
className: m(
|
|
1705
1711
|
"astw:relative astw:flex astw:flex-col astw:w-full astw:cursor-pointer astw:select-none astw:items-start astw:rounded-sm astw:px-2 astw:py-2 astw:text-sm astw:outline-none astw:text-left",
|
|
1706
1712
|
p === l ? "astw:bg-accent astw:text-accent-foreground" : "astw:hover:bg-accent astw:hover:text-accent-foreground"
|
|
1707
1713
|
),
|
|
1708
1714
|
children: [
|
|
1709
|
-
/* @__PURE__ */ a("span", { className: "astw:truncate astw:w-full astw:text-left", children:
|
|
1715
|
+
/* @__PURE__ */ a("span", { className: "astw:truncate astw:w-full astw:text-left", children: g.breadcrumb.join(" > ") }),
|
|
1710
1716
|
/* @__PURE__ */ d("span", { className: "astw:text-[11px] astw:text-muted-foreground astw:truncate astw:w-full astw:text-left", children: [
|
|
1711
1717
|
"/",
|
|
1712
|
-
|
|
1718
|
+
g.path
|
|
1713
1719
|
] })
|
|
1714
1720
|
]
|
|
1715
1721
|
},
|
|
1716
|
-
|
|
1722
|
+
g.path
|
|
1717
1723
|
)) })
|
|
1718
1724
|
}
|
|
1719
1725
|
)
|
|
@@ -1721,17 +1727,17 @@ function Ta({
|
|
|
1721
1727
|
}
|
|
1722
1728
|
) });
|
|
1723
1729
|
}
|
|
1724
|
-
function
|
|
1725
|
-
const t =
|
|
1726
|
-
return /* @__PURE__ */ a(
|
|
1730
|
+
function vs() {
|
|
1731
|
+
const t = Ot();
|
|
1732
|
+
return /* @__PURE__ */ a(Pt, { fallback: null, children: /* @__PURE__ */ a(Bt, { resolve: t, children: (e) => /* @__PURE__ */ a(Aa, { navItems: e ?? [] }) }) });
|
|
1727
1733
|
}
|
|
1728
|
-
function
|
|
1734
|
+
function Da(t) {
|
|
1729
1735
|
const e = new URLSearchParams(t.search);
|
|
1730
1736
|
e.delete("code"), e.delete("state");
|
|
1731
1737
|
const s = e.toString();
|
|
1732
1738
|
return t.pathname + (s ? `?${s}` : "") + t.hash;
|
|
1733
1739
|
}
|
|
1734
|
-
function
|
|
1740
|
+
function ys(t) {
|
|
1735
1741
|
const e = Ne(t), { appUri: s } = t;
|
|
1736
1742
|
return {
|
|
1737
1743
|
...e,
|
|
@@ -1744,19 +1750,19 @@ function ps(t) {
|
|
|
1744
1750
|
}
|
|
1745
1751
|
};
|
|
1746
1752
|
}
|
|
1747
|
-
const
|
|
1748
|
-
const e = t.client, s =
|
|
1753
|
+
const Gt = j(null), Ns = (t) => {
|
|
1754
|
+
const e = t.client, s = R(
|
|
1749
1755
|
(l) => e.addEventListener((u) => {
|
|
1750
1756
|
u.type === "auth_state_changed" && l();
|
|
1751
1757
|
}),
|
|
1752
1758
|
[e]
|
|
1753
|
-
), r =
|
|
1754
|
-
|
|
1759
|
+
), r = R(() => e.getState(), [e]), n = Dt(s, r);
|
|
1760
|
+
I(() => {
|
|
1755
1761
|
(async () => {
|
|
1756
1762
|
if (new URLSearchParams(window.location.search).has("code"))
|
|
1757
1763
|
try {
|
|
1758
1764
|
await e.handleCallback();
|
|
1759
|
-
const w =
|
|
1765
|
+
const w = Da(
|
|
1760
1766
|
new URL(window.location.href)
|
|
1761
1767
|
);
|
|
1762
1768
|
window.history.replaceState({}, "", w);
|
|
@@ -1766,12 +1772,12 @@ const qt = j(null), gs = (t) => {
|
|
|
1766
1772
|
else
|
|
1767
1773
|
await e.checkAuthStatus();
|
|
1768
1774
|
})();
|
|
1769
|
-
}, [e]),
|
|
1775
|
+
}, [e]), I(() => {
|
|
1770
1776
|
t.autoLogin && (!n.isReady || n.isAuthenticated || e.login());
|
|
1771
1777
|
}, [n.isReady, n.isAuthenticated, t.autoLogin, e]);
|
|
1772
1778
|
const o = n.isAuthenticated, i = t.guardComponent && (!n.isReady || !o) ? /* @__PURE__ */ a(t.guardComponent, {}) : t.children;
|
|
1773
1779
|
return /* @__PURE__ */ a(
|
|
1774
|
-
|
|
1780
|
+
Gt.Provider,
|
|
1775
1781
|
{
|
|
1776
1782
|
value: {
|
|
1777
1783
|
authState: n,
|
|
@@ -1783,15 +1789,15 @@ const qt = j(null), gs = (t) => {
|
|
|
1783
1789
|
children: i
|
|
1784
1790
|
}
|
|
1785
1791
|
);
|
|
1786
|
-
},
|
|
1787
|
-
const t =
|
|
1792
|
+
}, Qt = () => {
|
|
1793
|
+
const t = D(Gt);
|
|
1788
1794
|
if (!t)
|
|
1789
1795
|
throw new Error(
|
|
1790
1796
|
"useAuth/useAuthSuspense must be used within an AuthProvider"
|
|
1791
1797
|
);
|
|
1792
1798
|
return t;
|
|
1793
|
-
},
|
|
1794
|
-
const t =
|
|
1799
|
+
}, Ss = () => {
|
|
1800
|
+
const t = Qt(), { isAuthenticated: e, error: s, isReady: r } = t.authState;
|
|
1795
1801
|
return {
|
|
1796
1802
|
error: s,
|
|
1797
1803
|
isAuthenticated: e,
|
|
@@ -1800,8 +1806,8 @@ const qt = j(null), gs = (t) => {
|
|
|
1800
1806
|
logout: t.logout,
|
|
1801
1807
|
checkAuthStatus: t.checkAuthStatus
|
|
1802
1808
|
};
|
|
1803
|
-
},
|
|
1804
|
-
const t =
|
|
1809
|
+
}, Cs = () => {
|
|
1810
|
+
const t = Qt();
|
|
1805
1811
|
if (!t.authState.isReady)
|
|
1806
1812
|
throw t.ready();
|
|
1807
1813
|
const { isAuthenticated: e, error: s } = t.authState;
|
|
@@ -1812,7 +1818,7 @@ const qt = j(null), gs = (t) => {
|
|
|
1812
1818
|
logout: t.logout,
|
|
1813
1819
|
checkAuthStatus: t.checkAuthStatus
|
|
1814
1820
|
};
|
|
1815
|
-
},
|
|
1821
|
+
}, Ts = () => ye, Pa = Z(
|
|
1816
1822
|
"astw:inline-flex astw:items-center astw:rounded-md astw:border astw:px-2 astw:py-0.5 astw:text-xs astw:font-medium astw:transition-colors astw:focus:outline-none astw:focus:ring-2 astw:focus:ring-ring astw:focus:ring-offset-2",
|
|
1817
1823
|
{
|
|
1818
1824
|
variants: {
|
|
@@ -1834,35 +1840,35 @@ const qt = j(null), gs = (t) => {
|
|
|
1834
1840
|
variant: "default"
|
|
1835
1841
|
}
|
|
1836
1842
|
}
|
|
1837
|
-
),
|
|
1843
|
+
), La = {
|
|
1838
1844
|
"outline-success": "astw:bg-green-500",
|
|
1839
1845
|
"outline-warning": "astw:bg-orange-500",
|
|
1840
1846
|
"outline-error": "astw:bg-red-500",
|
|
1841
1847
|
"outline-info": "astw:bg-blue-500",
|
|
1842
1848
|
"outline-neutral": "astw:bg-neutral-400"
|
|
1843
1849
|
};
|
|
1844
|
-
function
|
|
1845
|
-
const e =
|
|
1850
|
+
function Ma({ variant: t }) {
|
|
1851
|
+
const e = La[t];
|
|
1846
1852
|
return e ? /* @__PURE__ */ a("div", { className: "astw:size-3 astw:shrink-0 astw:flex astw:items-center astw:justify-center", children: /* @__PURE__ */ a("div", { className: m("astw:size-[7px] astw:rounded-full", e) }) }) : null;
|
|
1847
1853
|
}
|
|
1848
|
-
function
|
|
1854
|
+
function Ia({ className: t, variant: e, children: s, ...r }) {
|
|
1849
1855
|
const n = e?.toString().startsWith("outline-");
|
|
1850
1856
|
return /* @__PURE__ */ d(
|
|
1851
1857
|
"div",
|
|
1852
1858
|
{
|
|
1853
|
-
className: m(
|
|
1859
|
+
className: m(Pa({ variant: e }), t),
|
|
1854
1860
|
...r,
|
|
1855
1861
|
children: [
|
|
1856
|
-
n && /* @__PURE__ */ a(
|
|
1862
|
+
n && /* @__PURE__ */ a(Ma, { variant: e }),
|
|
1857
1863
|
s
|
|
1858
1864
|
]
|
|
1859
1865
|
}
|
|
1860
1866
|
);
|
|
1861
1867
|
}
|
|
1862
|
-
function
|
|
1868
|
+
function _a(t) {
|
|
1863
1869
|
return t.type === "divider";
|
|
1864
1870
|
}
|
|
1865
|
-
function
|
|
1871
|
+
function za(t) {
|
|
1866
1872
|
return t.type !== "divider" && "key" in t;
|
|
1867
1873
|
}
|
|
1868
1874
|
function U(t, e) {
|
|
@@ -1871,14 +1877,14 @@ function U(t, e) {
|
|
|
1871
1877
|
return s[r];
|
|
1872
1878
|
}, t);
|
|
1873
1879
|
}
|
|
1874
|
-
function
|
|
1880
|
+
function N(t) {
|
|
1875
1881
|
return t == null || t === "";
|
|
1876
1882
|
}
|
|
1877
|
-
function
|
|
1883
|
+
function Fa(t) {
|
|
1878
1884
|
return t.toLowerCase().replace(/_/g, " ").replace(/^\w/, (e) => e.toUpperCase());
|
|
1879
1885
|
}
|
|
1880
|
-
function
|
|
1881
|
-
if (
|
|
1886
|
+
function Oa(t, e = "medium") {
|
|
1887
|
+
if (N(t)) return "";
|
|
1882
1888
|
const s = t instanceof Date ? t : new Date(String(t));
|
|
1883
1889
|
if (isNaN(s.getTime())) return String(t);
|
|
1884
1890
|
switch (e) {
|
|
@@ -1909,8 +1915,8 @@ function Ma(t, e = "medium") {
|
|
|
1909
1915
|
return s.toLocaleDateString();
|
|
1910
1916
|
}
|
|
1911
1917
|
}
|
|
1912
|
-
function
|
|
1913
|
-
if (
|
|
1918
|
+
function $a(t, e) {
|
|
1919
|
+
if (N(t)) return "";
|
|
1914
1920
|
const s = typeof t == "number" ? t : parseFloat(String(t));
|
|
1915
1921
|
if (isNaN(s)) return String(t);
|
|
1916
1922
|
try {
|
|
@@ -1922,8 +1928,8 @@ function Ia(t, e) {
|
|
|
1922
1928
|
return `${e || "$"}${s.toFixed(2)}`;
|
|
1923
1929
|
}
|
|
1924
1930
|
}
|
|
1925
|
-
function
|
|
1926
|
-
if (
|
|
1931
|
+
function Wa(t) {
|
|
1932
|
+
if (N(t)) return [];
|
|
1927
1933
|
if (typeof t == "string")
|
|
1928
1934
|
return t.split(/[,\n]/).map((e) => e.trim()).filter(Boolean);
|
|
1929
1935
|
if (typeof t == "object" && t !== null) {
|
|
@@ -1938,8 +1944,8 @@ function _a(t) {
|
|
|
1938
1944
|
}
|
|
1939
1945
|
return [String(t)];
|
|
1940
1946
|
}
|
|
1941
|
-
function
|
|
1942
|
-
const [e, s] =
|
|
1947
|
+
function Yt({ value: t }) {
|
|
1948
|
+
const [e, s] = f.useState(!1);
|
|
1943
1949
|
return /* @__PURE__ */ d(ot, { children: [
|
|
1944
1950
|
/* @__PURE__ */ a(it, { asChild: !0, children: /* @__PURE__ */ a(
|
|
1945
1951
|
"button",
|
|
@@ -1952,16 +1958,16 @@ function Qt({ value: t }) {
|
|
|
1952
1958
|
}
|
|
1953
1959
|
},
|
|
1954
1960
|
className: "astw:ml-0.5 astw:inline-flex astw:items-center astw:justify-center astw:p-1 astw:rounded astw:hover:bg-muted astw:transition-colors astw:text-muted-foreground astw:hover:text-foreground",
|
|
1955
|
-
children: e ? /* @__PURE__ */ a(pe, { className: "astw:h-3 astw:w-3", strokeWidth: 2.5 }) : /* @__PURE__ */ a(
|
|
1961
|
+
children: e ? /* @__PURE__ */ a(pe, { className: "astw:h-3 astw:w-3", strokeWidth: 2.5 }) : /* @__PURE__ */ a(be, { className: "astw:h-3 astw:w-3", strokeWidth: 2.5 })
|
|
1956
1962
|
}
|
|
1957
1963
|
) }),
|
|
1958
1964
|
/* @__PURE__ */ a(lt, { side: "top", children: e ? "Copied!" : "Copy" })
|
|
1959
1965
|
] });
|
|
1960
1966
|
}
|
|
1961
|
-
const
|
|
1962
|
-
function
|
|
1963
|
-
const e =
|
|
1964
|
-
|
|
1967
|
+
const S = "–";
|
|
1968
|
+
function ja({ field: t }) {
|
|
1969
|
+
const e = N(t.value) ? S : String(t.value), s = t.meta?.copyable && !N(t.value), r = t.meta?.truncateLines, n = f.useRef(null), [o, i] = f.useState(!1);
|
|
1970
|
+
f.useEffect(() => {
|
|
1965
1971
|
if (!r) {
|
|
1966
1972
|
i(!1);
|
|
1967
1973
|
return;
|
|
@@ -1991,34 +1997,34 @@ function za({ field: t }) {
|
|
|
1991
1997
|
children: e
|
|
1992
1998
|
}
|
|
1993
1999
|
),
|
|
1994
|
-
s && /* @__PURE__ */ a(
|
|
2000
|
+
s && /* @__PURE__ */ a(Yt, { value: String(t.value) })
|
|
1995
2001
|
] });
|
|
1996
2002
|
return r && o ? /* @__PURE__ */ d(ot, { children: [
|
|
1997
2003
|
/* @__PURE__ */ a(it, { asChild: !0, children: /* @__PURE__ */ a("span", { className: "astw:cursor-default", children: u }) }),
|
|
1998
2004
|
/* @__PURE__ */ a(lt, { side: "bottom", style: { maxWidth: 320 }, children: /* @__PURE__ */ a("p", { className: "astw:text-sm", children: e }) })
|
|
1999
2005
|
] }) : u;
|
|
2000
2006
|
}
|
|
2001
|
-
function
|
|
2002
|
-
if (
|
|
2003
|
-
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children:
|
|
2007
|
+
function Ka({ field: t }) {
|
|
2008
|
+
if (N(t.value))
|
|
2009
|
+
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: S });
|
|
2004
2010
|
const e = String(t.value), s = t.meta?.badgeVariantMap || {}, r = e.toLowerCase(), n = s[e] || s[r] || "outline-neutral";
|
|
2005
|
-
return /* @__PURE__ */ a(
|
|
2011
|
+
return /* @__PURE__ */ a(Ia, { variant: n, className: "astw:w-fit", children: Fa(e) });
|
|
2006
2012
|
}
|
|
2007
|
-
function
|
|
2008
|
-
if (
|
|
2009
|
-
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children:
|
|
2010
|
-
const e = t.meta?.currencyKey || "currency", s = U(t.data, e), r =
|
|
2013
|
+
function Va({ field: t }) {
|
|
2014
|
+
if (N(t.value))
|
|
2015
|
+
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: S });
|
|
2016
|
+
const e = t.meta?.currencyKey || "currency", s = U(t.data, e), r = $a(t.value, s);
|
|
2011
2017
|
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground astw:tabular-nums", children: r });
|
|
2012
2018
|
}
|
|
2013
|
-
function
|
|
2014
|
-
if (
|
|
2015
|
-
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children:
|
|
2016
|
-
const e = t.meta?.dateFormat || "medium", s =
|
|
2019
|
+
function Ua({ field: t }) {
|
|
2020
|
+
if (N(t.value))
|
|
2021
|
+
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: S });
|
|
2022
|
+
const e = t.meta?.dateFormat || "medium", s = Oa(t.value, e);
|
|
2017
2023
|
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: s });
|
|
2018
2024
|
}
|
|
2019
|
-
function
|
|
2020
|
-
if (
|
|
2021
|
-
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children:
|
|
2025
|
+
function Ha({ field: t }) {
|
|
2026
|
+
if (N(t.value))
|
|
2027
|
+
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: S });
|
|
2022
2028
|
const e = t.meta?.hrefKey, s = e ? U(t.data, e) : void 0, r = t.meta?.external ?? !1, n = String(t.value);
|
|
2023
2029
|
return s ? /* @__PURE__ */ d(
|
|
2024
2030
|
"a",
|
|
@@ -2029,27 +2035,27 @@ function Wa({ field: t }) {
|
|
|
2029
2035
|
className: "astw:inline-flex astw:items-center astw:gap-1 astw:text-sm astw:text-primary astw:hover:underline",
|
|
2030
2036
|
children: [
|
|
2031
2037
|
n,
|
|
2032
|
-
r && /* @__PURE__ */ a(
|
|
2038
|
+
r && /* @__PURE__ */ a(ge, { className: "astw:h-3 astw:w-3" })
|
|
2033
2039
|
]
|
|
2034
2040
|
}
|
|
2035
2041
|
) : /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: n });
|
|
2036
2042
|
}
|
|
2037
|
-
function
|
|
2038
|
-
if (
|
|
2039
|
-
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children:
|
|
2040
|
-
const e =
|
|
2043
|
+
function qa({ field: t }) {
|
|
2044
|
+
if (N(t.value))
|
|
2045
|
+
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: S });
|
|
2046
|
+
const e = Wa(t.value), s = t.meta?.copyable && !N(t.value), r = e.join(`
|
|
2041
2047
|
`);
|
|
2042
2048
|
return /* @__PURE__ */ d("div", { className: "astw:flex astw:items-start astw:gap-1 astw:min-w-0", children: [
|
|
2043
|
-
/* @__PURE__ */ a("address", { className: "astw:text-sm astw:font-medium astw:text-foreground astw:not-italic", children: e.map((n, o) => /* @__PURE__ */ d(
|
|
2049
|
+
/* @__PURE__ */ a("address", { className: "astw:text-sm astw:font-medium astw:text-foreground astw:not-italic", children: e.map((n, o) => /* @__PURE__ */ d(f.Fragment, { children: [
|
|
2044
2050
|
n,
|
|
2045
2051
|
o < e.length - 1 && /* @__PURE__ */ a("br", {})
|
|
2046
2052
|
] }, o)) }),
|
|
2047
|
-
s && /* @__PURE__ */ a(
|
|
2053
|
+
s && /* @__PURE__ */ a(Yt, { value: r })
|
|
2048
2054
|
] });
|
|
2049
2055
|
}
|
|
2050
|
-
function
|
|
2051
|
-
if (
|
|
2052
|
-
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children:
|
|
2056
|
+
function Ga({ field: t }) {
|
|
2057
|
+
if (N(t.value))
|
|
2058
|
+
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: S });
|
|
2053
2059
|
const e = t.meta?.referenceIdKey, s = t.meta?.referenceUrlPattern, r = e ? U(t.data, e) : void 0, n = String(t.value);
|
|
2054
2060
|
if (!r || !s)
|
|
2055
2061
|
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: n });
|
|
@@ -2059,32 +2065,32 @@ function Ka({ field: t }) {
|
|
|
2059
2065
|
function Tt(t) {
|
|
2060
2066
|
switch (t.type) {
|
|
2061
2067
|
case "text":
|
|
2062
|
-
return /* @__PURE__ */ a(
|
|
2068
|
+
return /* @__PURE__ */ a(ja, { field: t });
|
|
2063
2069
|
case "badge":
|
|
2064
|
-
return /* @__PURE__ */ a(
|
|
2070
|
+
return /* @__PURE__ */ a(Ka, { field: t });
|
|
2065
2071
|
case "money":
|
|
2066
|
-
return /* @__PURE__ */ a(
|
|
2072
|
+
return /* @__PURE__ */ a(Va, { field: t });
|
|
2067
2073
|
case "date":
|
|
2068
|
-
return /* @__PURE__ */ a(
|
|
2074
|
+
return /* @__PURE__ */ a(Ua, { field: t });
|
|
2069
2075
|
case "link":
|
|
2070
|
-
return /* @__PURE__ */ a(
|
|
2076
|
+
return /* @__PURE__ */ a(Ha, { field: t });
|
|
2071
2077
|
case "address":
|
|
2072
|
-
return /* @__PURE__ */ a(
|
|
2078
|
+
return /* @__PURE__ */ a(qa, { field: t });
|
|
2073
2079
|
case "reference":
|
|
2074
|
-
return /* @__PURE__ */ a(
|
|
2080
|
+
return /* @__PURE__ */ a(Ga, { field: t });
|
|
2075
2081
|
default:
|
|
2076
|
-
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children:
|
|
2082
|
+
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: S });
|
|
2077
2083
|
}
|
|
2078
2084
|
}
|
|
2079
|
-
function
|
|
2085
|
+
function Qa(t) {
|
|
2080
2086
|
if (t.emptyBehavior !== "hide") return !1;
|
|
2081
2087
|
const e = t.value;
|
|
2082
2088
|
return e == null || e === "";
|
|
2083
2089
|
}
|
|
2084
|
-
function
|
|
2090
|
+
function Ya(t) {
|
|
2085
2091
|
return !1;
|
|
2086
2092
|
}
|
|
2087
|
-
function
|
|
2093
|
+
function Xa(t, e, s) {
|
|
2088
2094
|
const r = U(e, t.key);
|
|
2089
2095
|
return {
|
|
2090
2096
|
id: `${t.key}-${s}`,
|
|
@@ -2096,15 +2102,15 @@ function Ha(t, e, s) {
|
|
|
2096
2102
|
data: e
|
|
2097
2103
|
};
|
|
2098
2104
|
}
|
|
2099
|
-
function
|
|
2105
|
+
function Za(t, e) {
|
|
2100
2106
|
const s = [];
|
|
2101
2107
|
let r = [], n = 0, o = 0;
|
|
2102
2108
|
for (const i of t)
|
|
2103
|
-
if (
|
|
2109
|
+
if (_a(i))
|
|
2104
2110
|
r.length > 0 && (s.push({ id: `section-${n}`, fields: r }), n++, r = []);
|
|
2105
|
-
else if (
|
|
2106
|
-
const l =
|
|
2107
|
-
o++,
|
|
2111
|
+
else if (za(i)) {
|
|
2112
|
+
const l = Xa(i, e, o);
|
|
2113
|
+
o++, Qa(l) || r.push(l);
|
|
2108
2114
|
}
|
|
2109
2115
|
return r.length > 0 && s.push({ id: `section-${n}`, fields: r }), s;
|
|
2110
2116
|
}
|
|
@@ -2123,7 +2129,7 @@ function kt({ label: t, children: e, fullWidth: s }) {
|
|
|
2123
2129
|
}
|
|
2124
2130
|
);
|
|
2125
2131
|
}
|
|
2126
|
-
function
|
|
2132
|
+
function ks({
|
|
2127
2133
|
data: t,
|
|
2128
2134
|
title: e,
|
|
2129
2135
|
fields: s,
|
|
@@ -2131,7 +2137,7 @@ function ys({
|
|
|
2131
2137
|
className: n,
|
|
2132
2138
|
headerAction: o
|
|
2133
2139
|
}) {
|
|
2134
|
-
const i =
|
|
2140
|
+
const i = Za(s, t), l = i.some((c) => c.fields.length > 0), u = m(
|
|
2135
2141
|
"astw:grid astw:gap-x-6 astw:gap-y-4",
|
|
2136
2142
|
// Default: 1 column
|
|
2137
2143
|
"astw:grid-cols-1",
|
|
@@ -2144,10 +2150,10 @@ function ys({
|
|
|
2144
2150
|
"astw:@[400px]:grid-cols-2 astw:@[600px]:grid-cols-3"
|
|
2145
2151
|
)
|
|
2146
2152
|
), w = (c) => {
|
|
2147
|
-
const h = c.fields.filter((p) => !0),
|
|
2153
|
+
const h = c.fields.filter((p) => !0), g = c.fields.filter((p) => Ya());
|
|
2148
2154
|
return /* @__PURE__ */ d("div", { className: "astw:space-y-4", children: [
|
|
2149
2155
|
h.length > 0 && /* @__PURE__ */ a("div", { className: u, children: h.map((p) => /* @__PURE__ */ a(kt, { label: p.label, children: Tt(p) }, p.id)) }),
|
|
2150
|
-
|
|
2156
|
+
g.length > 0 && /* @__PURE__ */ a("div", { className: u, children: g.map((p) => /* @__PURE__ */ a(kt, { label: p.label, fullWidth: !0, children: Tt(p) }, p.id)) })
|
|
2151
2157
|
] }, c.id);
|
|
2152
2158
|
};
|
|
2153
2159
|
return /* @__PURE__ */ a(nt, { delayDuration: 300, children: /* @__PURE__ */ d(
|
|
@@ -2162,7 +2168,7 @@ function ys({
|
|
|
2162
2168
|
/* @__PURE__ */ a("h3", { className: "astw:text-lg astw:font-semibold astw:leading-none", children: e }),
|
|
2163
2169
|
o && /* @__PURE__ */ a("div", { children: o })
|
|
2164
2170
|
] }),
|
|
2165
|
-
/* @__PURE__ */ a("div", { className: "astw:px-6 astw:pb-4", children: l ? /* @__PURE__ */ a("div", { className: "astw:space-y-4", children: i.map((c, h) => /* @__PURE__ */ d(
|
|
2171
|
+
/* @__PURE__ */ a("div", { className: "astw:px-6 astw:pb-4", children: l ? /* @__PURE__ */ a("div", { className: "astw:space-y-4", children: i.map((c, h) => /* @__PURE__ */ d(f.Fragment, { children: [
|
|
2166
2172
|
h > 0 && /* @__PURE__ */ a("div", { className: "astw:h-px astw:bg-border", role: "separator" }),
|
|
2167
2173
|
w(c)
|
|
2168
2174
|
] }, c.id)) }) : /* @__PURE__ */ a("p", { className: "astw:text-sm astw:text-muted-foreground", children: "No information available" }) })
|
|
@@ -2170,7 +2176,7 @@ function ys({
|
|
|
2170
2176
|
}
|
|
2171
2177
|
) });
|
|
2172
2178
|
}
|
|
2173
|
-
const dt =
|
|
2179
|
+
const dt = f.forwardRef(
|
|
2174
2180
|
({ className: t, children: e, ...s }, r) => /* @__PURE__ */ a(
|
|
2175
2181
|
"div",
|
|
2176
2182
|
{
|
|
@@ -2182,7 +2188,7 @@ const dt = g.forwardRef(
|
|
|
2182
2188
|
)
|
|
2183
2189
|
);
|
|
2184
2190
|
dt.displayName = "Layout.Column";
|
|
2185
|
-
function
|
|
2191
|
+
function Ja({
|
|
2186
2192
|
columns: t,
|
|
2187
2193
|
className: e,
|
|
2188
2194
|
gap: s = 4,
|
|
@@ -2191,7 +2197,7 @@ function Ga({
|
|
|
2191
2197
|
children: o
|
|
2192
2198
|
}) {
|
|
2193
2199
|
if (process.env.NODE_ENV !== "production") {
|
|
2194
|
-
const h =
|
|
2200
|
+
const h = f.Children.toArray(o).reduce((g, p) => f.isValidElement(p) && p.type === dt ? g + 1 : g, 0);
|
|
2195
2201
|
if (h !== t)
|
|
2196
2202
|
throw new Error(
|
|
2197
2203
|
`Layout: Expected exactly ${t} Layout.Column child${t === 1 ? "" : "ren"}, but found ${h}. Please ensure the number of <Layout.Column> children matches the \`columns={${t}}\` prop.`
|
|
@@ -2215,18 +2221,22 @@ function Ga({
|
|
|
2215
2221
|
"astw:xl:flex-row"
|
|
2216
2222
|
],
|
|
2217
2223
|
e
|
|
2218
|
-
), u =
|
|
2224
|
+
), u = f.useMemo(() => t === 1 ? f.Children.map(o, (c) => c) : t === 2 ? f.Children.map(o, (c, h) => f.isValidElement(c) ? f.cloneElement(c, {
|
|
2219
2225
|
className: m(
|
|
2226
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- React child props type is not known
|
|
2220
2227
|
c.props.className,
|
|
2221
2228
|
h === 0 ? "astw:lg:flex-1" : "astw:lg:min-w-[280px]"
|
|
2222
2229
|
// Second column: fixed 280px
|
|
2223
2230
|
)
|
|
2224
|
-
|
|
2231
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- React.cloneElement requires type assertion
|
|
2232
|
+
}) : c) : t === 3 ? f.Children.map(o, (c, h) => f.isValidElement(c) ? f.cloneElement(c, {
|
|
2225
2233
|
className: m(
|
|
2234
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- React child props type is not known
|
|
2226
2235
|
c.props.className,
|
|
2227
2236
|
h === 0 ? "astw:xl:min-w-[320px]" : h === 2 ? "astw:xl:min-w-[280px]" : "astw:xl:flex-1"
|
|
2228
2237
|
// Middle column: flexible
|
|
2229
2238
|
)
|
|
2239
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- React.cloneElement requires type assertion
|
|
2230
2240
|
}) : c) : o, [o, t]), w = r || n && n.length > 0;
|
|
2231
2241
|
return /* @__PURE__ */ d("div", { className: "astw:flex astw:flex-col", children: [
|
|
2232
2242
|
w && /* @__PURE__ */ d(
|
|
@@ -2236,42 +2246,42 @@ function Ga({
|
|
|
2236
2246
|
style: { padding: "1.5rem", paddingBottom: "1rem" },
|
|
2237
2247
|
children: [
|
|
2238
2248
|
r && /* @__PURE__ */ a("h1", { style: { fontSize: "1.5rem", fontWeight: "bold" }, children: r }),
|
|
2239
|
-
n && n.length > 0 && /* @__PURE__ */ a("div", { className: "astw:flex astw:gap-2 astw:items-center", children: n.map((c, h) => /* @__PURE__ */ a(
|
|
2249
|
+
n && n.length > 0 && /* @__PURE__ */ a("div", { className: "astw:flex astw:gap-2 astw:items-center", children: n.map((c, h) => /* @__PURE__ */ a(f.Fragment, { children: c }, h)) })
|
|
2240
2250
|
]
|
|
2241
2251
|
}
|
|
2242
2252
|
),
|
|
2243
2253
|
/* @__PURE__ */ a("div", { style: { padding: w ? "0 1.5rem 1.5rem 1.5rem" : "1.5rem" }, children: /* @__PURE__ */ a("div", { className: l, children: u }) })
|
|
2244
2254
|
] });
|
|
2245
2255
|
}
|
|
2246
|
-
|
|
2256
|
+
Ja.Column = dt;
|
|
2247
2257
|
export {
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2258
|
+
bs as AppShell,
|
|
2259
|
+
Ns as AuthProvider,
|
|
2260
|
+
Ia as Badge,
|
|
2261
|
+
vs as CommandPalette,
|
|
2262
|
+
ga as DefaultSidebar,
|
|
2263
|
+
ks as DescriptionCard,
|
|
2264
|
+
Ja as Layout,
|
|
2265
|
+
Bs as Link,
|
|
2266
|
+
xs as SidebarLayout,
|
|
2267
|
+
Pa as badgeVariants,
|
|
2268
|
+
ys as createAuthClient,
|
|
2259
2269
|
Ee as defineI18nLabels,
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2270
|
+
gs as defineModule,
|
|
2271
|
+
ps as defineResource,
|
|
2272
|
+
hs as hidden,
|
|
2273
|
+
ms as pass,
|
|
2274
|
+
fs as redirectTo,
|
|
2265
2275
|
ke as useAppShell,
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2276
|
+
P as useAppShellConfig,
|
|
2277
|
+
us as useAppShellData,
|
|
2278
|
+
Ss as useAuth,
|
|
2279
|
+
Cs as useAuthSuspense,
|
|
2280
|
+
As as useLocation,
|
|
2281
|
+
Ds as useNavigate,
|
|
2282
|
+
Ps as useParams,
|
|
2283
|
+
Ls as useRouteError,
|
|
2284
|
+
Ms as useSearchParams,
|
|
2275
2285
|
We as useTheme,
|
|
2276
|
-
|
|
2286
|
+
Ts as useToast
|
|
2277
2287
|
};
|