@tailor-platform/app-shell 0.26.2 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +21 -0
- package/dist/app-shell.css +1 -1
- package/dist/{index.d.ts → app-shell.d.ts} +588 -93
- package/dist/app-shell.js +1069 -747
- package/dist/vite-plugin.d.ts +5 -0
- package/dist/vite-plugin.js +4 -0
- package/package.json +28 -11
package/dist/app-shell.js
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
2
|
-
import { capitalCase as
|
|
3
|
-
import { useRouteError as
|
|
4
|
-
import { Link as
|
|
5
|
-
import { Slot as
|
|
6
|
-
import { cva as
|
|
7
|
-
import { clsx as
|
|
8
|
-
import { twMerge as
|
|
9
|
-
import { AlertCircle as
|
|
10
|
-
import * as
|
|
11
|
-
import { createContext as
|
|
12
|
-
import { Toaster as
|
|
13
|
-
import
|
|
14
|
-
import "@radix-ui/react-separator";
|
|
15
|
-
import * as
|
|
16
|
-
import * as
|
|
17
|
-
import
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
import { jsx as a, jsxs as c, Fragment as S } from "react/jsx-runtime";
|
|
2
|
+
import { capitalCase as D } from "change-case";
|
|
3
|
+
import { useRouteError as ue, isRouteErrorResponse as we, redirect as he, Outlet as nt, NavLink as me, Navigate as fe, useRouteLoaderData as pe, createMemoryRouter as ge, createBrowserRouter as be, RouterProvider as xe, useHref as ve, Link as ye, useLocation as Y, Await as zt, useMatch as Ne, useNavigate as Se } from "react-router";
|
|
4
|
+
import { Link as er, useLocation as ar, useNavigate as sr, useParams as rr, useRouteError as nr, useSearchParams as or } from "react-router";
|
|
5
|
+
import { Slot as j } from "@radix-ui/react-slot";
|
|
6
|
+
import { cva as ot } from "class-variance-authority";
|
|
7
|
+
import { clsx as Ce } from "clsx";
|
|
8
|
+
import { twMerge as Te } from "tailwind-merge";
|
|
9
|
+
import { AlertCircle as yt, Table as ke, XIcon as _t, PanelLeftIcon as Re, ExternalLink as $t, ChevronRight as $, SunIcon as Pe, SearchIcon as Ae, Check as Ee, Copy as Me } from "lucide-react";
|
|
10
|
+
import * as p from "react";
|
|
11
|
+
import { createContext as X, useContext as L, useState as H, useMemo as M, useEffect as W, useSyncExternalStore as Wt, Suspense as it, useRef as Ft, useCallback as E } from "react";
|
|
12
|
+
import { Toaster as Be, toast as De } from "sonner";
|
|
13
|
+
import { parsePath as Le } from "@tailor-platform/app-shell-vite-plugin/parser";
|
|
14
|
+
import * as Ie from "@radix-ui/react-separator";
|
|
15
|
+
import * as v from "@radix-ui/react-dialog";
|
|
16
|
+
import * as B from "@radix-ui/react-tooltip";
|
|
17
|
+
import * as lt from "@radix-ui/react-collapsible";
|
|
18
|
+
import { createAuthClient as ze } from "@tailor-platform/auth-public-client";
|
|
19
|
+
function h(...t) {
|
|
20
|
+
return Te(Ce(t));
|
|
21
|
+
}
|
|
22
|
+
const _e = ot(
|
|
22
23
|
"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",
|
|
23
24
|
{
|
|
24
25
|
variants: {
|
|
@@ -43,7 +44,7 @@ const Se = Z(
|
|
|
43
44
|
}
|
|
44
45
|
}
|
|
45
46
|
);
|
|
46
|
-
function
|
|
47
|
+
function F({
|
|
47
48
|
className: t,
|
|
48
49
|
variant: e,
|
|
49
50
|
size: s,
|
|
@@ -51,37 +52,37 @@ function _({
|
|
|
51
52
|
...n
|
|
52
53
|
}) {
|
|
53
54
|
return /* @__PURE__ */ a(
|
|
54
|
-
r ?
|
|
55
|
+
r ? j : "button",
|
|
55
56
|
{
|
|
56
57
|
"data-slot": "button",
|
|
57
|
-
className:
|
|
58
|
+
className: h(_e({ variant: e, size: s, className: t })),
|
|
58
59
|
...n
|
|
59
60
|
}
|
|
60
61
|
);
|
|
61
62
|
}
|
|
62
|
-
const
|
|
63
|
+
const G = "en", $e = () => {
|
|
63
64
|
try {
|
|
64
65
|
if (typeof navigator > "u")
|
|
65
|
-
return
|
|
66
|
+
return G;
|
|
66
67
|
const t = navigator.languages?.[0] ?? navigator.language;
|
|
67
|
-
return t ? new Intl.Locale(t).language :
|
|
68
|
+
return t ? new Intl.Locale(t).language : G;
|
|
68
69
|
} catch {
|
|
69
|
-
return
|
|
70
|
+
return G;
|
|
70
71
|
}
|
|
71
|
-
},
|
|
72
|
-
const e =
|
|
73
|
-
return (s, r) => e(s, typeof s == "string" ? s :
|
|
74
|
-
},
|
|
72
|
+
}, U = (t) => (e, s) => e ? typeof e == "string" ? e : e(t) ?? s : s, Ot = (t) => {
|
|
73
|
+
const e = U(t);
|
|
74
|
+
return (s, r) => e(s, typeof s == "string" ? s : D(r));
|
|
75
|
+
}, We = (t) => ({
|
|
75
76
|
modules: t.modules,
|
|
76
77
|
settingsResources: t.settingsResources ?? [],
|
|
77
|
-
errorBoundary: t.errorBoundary ?? /* @__PURE__ */ a(
|
|
78
|
+
errorBoundary: t.errorBoundary ?? /* @__PURE__ */ a(_, {}),
|
|
78
79
|
basePath: t.basePath,
|
|
79
|
-
locale: t.locale ??
|
|
80
|
-
}),
|
|
80
|
+
locale: t.locale ?? $e()
|
|
81
|
+
}), ct = X({
|
|
81
82
|
configurations: {
|
|
82
83
|
modules: [],
|
|
83
84
|
settingsResources: [],
|
|
84
|
-
locale:
|
|
85
|
+
locale: G,
|
|
85
86
|
// Using null! to avoid circular dependency issues.
|
|
86
87
|
// DefaultErrorBoundary imports useT from i18n-labels, which imports
|
|
87
88
|
// defineI18nLabels from hooks/i18n, which imports useAppShellConfig
|
|
@@ -90,18 +91,18 @@ const $ = "en", Ce = () => {
|
|
|
90
91
|
// always provides the context via AppShellConfigContext.Provider.
|
|
91
92
|
errorBoundary: null
|
|
92
93
|
}
|
|
93
|
-
}),
|
|
94
|
+
}), dt = X({
|
|
94
95
|
contextData: {}
|
|
95
|
-
}),
|
|
96
|
-
const t =
|
|
96
|
+
}), C = () => L(ct), Ls = () => L(dt), jt = () => {
|
|
97
|
+
const t = L(ct), e = L(dt);
|
|
97
98
|
return {
|
|
98
99
|
...t,
|
|
99
100
|
...e
|
|
100
101
|
};
|
|
101
|
-
},
|
|
102
|
-
const { configurations: t } =
|
|
102
|
+
}, Fe = () => {
|
|
103
|
+
const { configurations: t } = C(), e = U(t.locale);
|
|
103
104
|
return (s, r) => e(s, r);
|
|
104
|
-
},
|
|
105
|
+
}, Oe = (t) => {
|
|
105
106
|
const e = (s) => (r) => t[s]?.[r] ?? t.en[r];
|
|
106
107
|
return {
|
|
107
108
|
/**
|
|
@@ -124,7 +125,7 @@ const $ = "en", Ce = () => {
|
|
|
124
125
|
* ```
|
|
125
126
|
*/
|
|
126
127
|
useT: () => {
|
|
127
|
-
const { configurations: s } =
|
|
128
|
+
const { configurations: s } = C(), r = e(s.locale), n = ((o, ...i) => {
|
|
128
129
|
const l = r(o);
|
|
129
130
|
return typeof l == "function" ? l(i[0]) : l;
|
|
130
131
|
});
|
|
@@ -160,7 +161,7 @@ const $ = "en", Ce = () => {
|
|
|
160
161
|
return typeof o == "function" ? o(r[0]) : o;
|
|
161
162
|
}
|
|
162
163
|
};
|
|
163
|
-
},
|
|
164
|
+
}, je = Oe({
|
|
164
165
|
en: {
|
|
165
166
|
error404Title: "404 Not Found",
|
|
166
167
|
error404Body: "The page you requested could not be found.",
|
|
@@ -199,19 +200,19 @@ const $ = "en", Ce = () => {
|
|
|
199
200
|
commandPaletteSearch: "ページを検索...",
|
|
200
201
|
commandPaletteNoResults: "結果が見つかりません"
|
|
201
202
|
}
|
|
202
|
-
}),
|
|
203
|
-
const t =
|
|
203
|
+
}), A = je.useT, _ = () => {
|
|
204
|
+
const t = ue(), e = A(), s = {
|
|
204
205
|
role: "alert",
|
|
205
206
|
"aria-label": "default-error-boundary"
|
|
206
207
|
};
|
|
207
|
-
if (
|
|
208
|
-
return /* @__PURE__ */ a("div", { ...s, className: "astw:p-6", children: /* @__PURE__ */
|
|
209
|
-
/* @__PURE__ */ a(
|
|
210
|
-
/* @__PURE__ */
|
|
208
|
+
if (we(t) && t.status === 404)
|
|
209
|
+
return /* @__PURE__ */ a("div", { ...s, className: "astw:p-6", children: /* @__PURE__ */ c("div", { className: "astw:flex astw:items-start astw:gap-4", children: [
|
|
210
|
+
/* @__PURE__ */ a(yt, { className: "astw:h-5 astw:w-5 astw:text-destructive astw:flex-shrink-0 astw:mt-0.5" }),
|
|
211
|
+
/* @__PURE__ */ c("div", { children: [
|
|
211
212
|
/* @__PURE__ */ a("h1", { className: "astw:font-semibold astw:text-lg", children: e("error404Title") }),
|
|
212
213
|
/* @__PURE__ */ a("p", { className: "astw:text-sm astw:text-muted-foreground astw:mt-1", children: e("error404Body") }),
|
|
213
214
|
/* @__PURE__ */ a(
|
|
214
|
-
|
|
215
|
+
F,
|
|
215
216
|
{
|
|
216
217
|
variant: "outline",
|
|
217
218
|
size: "sm",
|
|
@@ -223,13 +224,13 @@ const $ = "en", Ce = () => {
|
|
|
223
224
|
] })
|
|
224
225
|
] }) });
|
|
225
226
|
const r = t instanceof Error ? t.message : e("errorUnexpected");
|
|
226
|
-
return /* @__PURE__ */ a("div", { ...s, className: "astw:p-6", children: /* @__PURE__ */
|
|
227
|
-
/* @__PURE__ */ a(
|
|
228
|
-
/* @__PURE__ */
|
|
227
|
+
return /* @__PURE__ */ a("div", { ...s, className: "astw:p-6", children: /* @__PURE__ */ c("div", { className: "astw:flex astw:items-start astw:gap-4", children: [
|
|
228
|
+
/* @__PURE__ */ a(yt, { className: "astw:h-5 astw:w-5 astw:text-destructive astw:flex-shrink-0 astw:mt-0.5" }),
|
|
229
|
+
/* @__PURE__ */ c("div", { children: [
|
|
229
230
|
/* @__PURE__ */ a("h1", { className: "astw:font-semibold astw:text-lg", children: e("errorTitle") }),
|
|
230
231
|
/* @__PURE__ */ a("p", { className: "astw:text-sm astw:text-muted-foreground astw:mt-1", children: r }),
|
|
231
232
|
/* @__PURE__ */ a(
|
|
232
|
-
|
|
233
|
+
F,
|
|
233
234
|
{
|
|
234
235
|
variant: "outline",
|
|
235
236
|
size: "sm",
|
|
@@ -241,50 +242,52 @@ const $ = "en", Ce = () => {
|
|
|
241
242
|
] })
|
|
242
243
|
] }) });
|
|
243
244
|
};
|
|
244
|
-
let
|
|
245
|
-
const
|
|
246
|
-
|
|
247
|
-
},
|
|
245
|
+
let Ut = {};
|
|
246
|
+
const Ue = (t) => {
|
|
247
|
+
Ut = t;
|
|
248
|
+
}, Is = () => ({ type: "pass" }), zs = () => ({ type: "hidden" }), _s = (t) => ({
|
|
248
249
|
type: "redirect",
|
|
249
250
|
to: t
|
|
250
|
-
}),
|
|
251
|
+
}), Kt = () => new Response("Not Found", { status: 404 }), ut = async (t) => {
|
|
251
252
|
if (!t || t.length === 0) return { type: "pass" };
|
|
252
|
-
const
|
|
253
|
-
|
|
254
|
-
searchParams: s.searchParams,
|
|
255
|
-
signal: e.request.signal,
|
|
256
|
-
context: Lt
|
|
253
|
+
const e = {
|
|
254
|
+
context: Ut
|
|
257
255
|
};
|
|
258
|
-
for (const
|
|
259
|
-
const
|
|
260
|
-
if (
|
|
261
|
-
return
|
|
256
|
+
for (const s of t) {
|
|
257
|
+
const r = await s(e);
|
|
258
|
+
if (r.type !== "pass")
|
|
259
|
+
return r;
|
|
262
260
|
}
|
|
263
261
|
return { type: "pass" };
|
|
264
|
-
},
|
|
265
|
-
const r = await
|
|
262
|
+
}, Vt = (t, e) => async (s) => {
|
|
263
|
+
const r = await ut(t);
|
|
266
264
|
switch (r.type) {
|
|
267
265
|
case "hidden":
|
|
268
|
-
throw
|
|
266
|
+
throw Kt();
|
|
269
267
|
case "redirect":
|
|
270
|
-
return
|
|
268
|
+
return he(r.to);
|
|
271
269
|
case "pass":
|
|
272
270
|
return e ? e(s) : null;
|
|
273
271
|
}
|
|
274
|
-
},
|
|
275
|
-
const { configurations: s } =
|
|
272
|
+
}, Ht = (t, e) => () => {
|
|
273
|
+
const { configurations: s } = C(), { metaTitle: r, fallbackTitle: n } = t, i = U(s.locale)(r, n);
|
|
276
274
|
return e(i);
|
|
277
275
|
};
|
|
278
|
-
function
|
|
279
|
-
const { path: e, meta: s, component: r, resources: n, errorBoundary: o, guards: i } = t, l = s?.title ??
|
|
276
|
+
function $s(t) {
|
|
277
|
+
const { path: e, meta: s, component: r, resources: n, errorBoundary: o, guards: i } = t, l = s?.title ?? D(e), u = D(e);
|
|
278
|
+
if (!r && (!i || i.length === 0))
|
|
279
|
+
throw new Error(
|
|
280
|
+
`Module "${e}" has no component. Either provide a \`component\` or use \`guards\` with \`redirectTo()\` or \`hidden()\` to control access. A guard that only returns \`pass()\` without a component will result in a blank page.`
|
|
281
|
+
);
|
|
282
|
+
const w = i && i.length > 0 ? Vt(i) : void 0, d = r ? Ht(
|
|
280
283
|
{ metaTitle: l, fallbackTitle: u },
|
|
281
|
-
(
|
|
284
|
+
(m) => r({ title: m, resources: n })
|
|
282
285
|
) : void 0;
|
|
283
286
|
return {
|
|
284
287
|
path: e,
|
|
285
288
|
type: "component",
|
|
286
289
|
_type: "module",
|
|
287
|
-
component:
|
|
290
|
+
component: d,
|
|
288
291
|
loader: w,
|
|
289
292
|
meta: {
|
|
290
293
|
title: l,
|
|
@@ -294,12 +297,12 @@ function ws(t) {
|
|
|
294
297
|
icon: t.meta?.icon
|
|
295
298
|
},
|
|
296
299
|
resources: n,
|
|
297
|
-
errorBoundary: o || /* @__PURE__ */ a(
|
|
300
|
+
errorBoundary: o || /* @__PURE__ */ a(_, {}),
|
|
298
301
|
guards: i
|
|
299
302
|
};
|
|
300
303
|
}
|
|
301
|
-
function
|
|
302
|
-
const { path: e, component: s, subResources: r, meta: n, errorBoundary: o, guards: i } = t, l = n?.title ??
|
|
304
|
+
function Ws(t) {
|
|
305
|
+
const { path: e, component: s, subResources: r, meta: n, errorBoundary: o, guards: i } = t, l = n?.title ?? D(e), u = D(e), w = i && i.length > 0 ? Vt(i) : void 0;
|
|
303
306
|
return {
|
|
304
307
|
_type: "resource",
|
|
305
308
|
type: "component",
|
|
@@ -309,32 +312,32 @@ function us(t) {
|
|
|
309
312
|
icon: n?.icon,
|
|
310
313
|
...n?.breadcrumbTitle !== void 0 ? { breadcrumbTitle: n.breadcrumbTitle } : {}
|
|
311
314
|
},
|
|
312
|
-
component:
|
|
315
|
+
component: Ht(
|
|
313
316
|
{ metaTitle: l, fallbackTitle: u },
|
|
314
|
-
(
|
|
317
|
+
(d) => s({ title: d, resources: r })
|
|
315
318
|
),
|
|
316
319
|
subResources: r,
|
|
317
|
-
errorBoundary: o ?? /* @__PURE__ */ a(
|
|
320
|
+
errorBoundary: o ?? /* @__PURE__ */ a(_, {}),
|
|
318
321
|
guards: i,
|
|
319
322
|
loader: w
|
|
320
323
|
};
|
|
321
324
|
}
|
|
322
|
-
const
|
|
323
|
-
const t =
|
|
324
|
-
return /* @__PURE__ */
|
|
325
|
+
const Ke = () => {
|
|
326
|
+
const t = A();
|
|
327
|
+
return /* @__PURE__ */ c(S, { children: [
|
|
325
328
|
/* @__PURE__ */ a("p", { className: "astw:font-semibold astw:leading-none astw:tracking-tight", children: t("welcomeTitle") }),
|
|
326
329
|
/* @__PURE__ */ a("p", { className: "pt-4", children: t("welcomeBody") })
|
|
327
330
|
] });
|
|
328
|
-
},
|
|
329
|
-
/* @__PURE__ */ a(
|
|
330
|
-
/* @__PURE__ */ a(
|
|
331
|
-
] }),
|
|
332
|
-
const { configurations: t } =
|
|
333
|
-
return /* @__PURE__ */
|
|
334
|
-
/* @__PURE__ */ a("div", { children: /* @__PURE__ */
|
|
331
|
+
}, Nt = () => /* @__PURE__ */ c(S, { children: [
|
|
332
|
+
/* @__PURE__ */ a(nt, {}),
|
|
333
|
+
/* @__PURE__ */ a(Be, {})
|
|
334
|
+
] }), Ve = () => {
|
|
335
|
+
const { configurations: t } = jt(), e = A(), s = Fe();
|
|
336
|
+
return /* @__PURE__ */ c("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: [
|
|
337
|
+
/* @__PURE__ */ a("div", { children: /* @__PURE__ */ c("nav", { className: "astw:bg-card astw:md:w-xs astw:rounded-md astw:border astw:p-3 astw:shadow-xs", children: [
|
|
335
338
|
/* @__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(
|
|
337
|
-
|
|
339
|
+
/* @__PURE__ */ a("ul", { className: "astw:flex astw:flex-col astw:gap-1", children: t.settingsResources.map((r) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a(me, { to: `./${r.path}`, children: ({ isActive: n }) => /* @__PURE__ */ c(
|
|
340
|
+
F,
|
|
338
341
|
{
|
|
339
342
|
variant: n ? "secondary" : "ghost",
|
|
340
343
|
className: "astw:w-full astw:justify-start",
|
|
@@ -345,66 +348,46 @@ const De = () => {
|
|
|
345
348
|
}
|
|
346
349
|
) }) }, r.path)) })
|
|
347
350
|
] }) }),
|
|
348
|
-
/* @__PURE__ */ a("section", { className: "astw:bg-card astw:flex-1 astw:rounded-md astw:border astw:shadow-xs", children: /* @__PURE__ */ a(
|
|
351
|
+
/* @__PURE__ */ a("section", { className: "astw:bg-card astw:flex-1 astw:rounded-md astw:border astw:shadow-xs", children: /* @__PURE__ */ a(nt, {}) })
|
|
349
352
|
] });
|
|
350
|
-
},
|
|
353
|
+
}, wt = (t) => () => /* @__PURE__ */ a(S, { children: t }), Gt = (t, e, s) => {
|
|
351
354
|
const r = t.errorBoundary || s, n = t.component ? {
|
|
352
355
|
index: !0,
|
|
353
|
-
Component: t.component
|
|
356
|
+
Component: t.component,
|
|
357
|
+
...t.loader && { loader: t.loader }
|
|
354
358
|
} : void 0;
|
|
355
359
|
return {
|
|
356
360
|
path: t.path,
|
|
357
|
-
...t.loader && { loader: t.loader },
|
|
358
361
|
...t.errorBoundary && {
|
|
359
|
-
ErrorBoundary:
|
|
362
|
+
ErrorBoundary: wt(t.errorBoundary)
|
|
360
363
|
},
|
|
361
364
|
...e && e.length > 0 ? {
|
|
362
365
|
children: [
|
|
363
366
|
...n ? [n] : [],
|
|
364
367
|
...e.map(
|
|
365
|
-
(o) =>
|
|
368
|
+
(o) => Gt(o, o.subResources, r)
|
|
366
369
|
)
|
|
367
370
|
]
|
|
368
371
|
} : n ? {
|
|
369
372
|
children: [n]
|
|
370
373
|
} : {}
|
|
371
374
|
};
|
|
372
|
-
},
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
const s = {
|
|
376
|
-
index: !0,
|
|
377
|
-
// Component is required to suppress React Router's warning about empty leaf routes,
|
|
378
|
-
// even though the loader always redirects and this component will never render.
|
|
379
|
-
Component: () => null,
|
|
380
|
-
loader: async (n) => {
|
|
381
|
-
for (const o of t.resources)
|
|
382
|
-
if ((await V(o.guards, n)).type === "pass")
|
|
383
|
-
return Rt(o.path);
|
|
384
|
-
throw st();
|
|
385
|
-
}
|
|
386
|
-
}, r = {
|
|
387
|
-
path: e.path,
|
|
388
|
-
children: [s, ...e.children ?? []],
|
|
389
|
-
...e.loader && { loader: e.loader }
|
|
390
|
-
};
|
|
391
|
-
return e.ErrorBoundary && (r.ErrorBoundary = e.ErrorBoundary), r;
|
|
392
|
-
}
|
|
393
|
-
return e;
|
|
394
|
-
}, Me = (t) => t.map((e) => Le(e)), Ie = ({
|
|
375
|
+
}, He = (t) => t.map(
|
|
376
|
+
(e) => Gt(e, e.resources, e.errorBoundary)
|
|
377
|
+
), Ge = ({
|
|
395
378
|
modules: t,
|
|
396
379
|
settingsResources: e,
|
|
397
380
|
rootComponent: s
|
|
398
381
|
}) => {
|
|
399
382
|
const r = {
|
|
400
383
|
index: !0,
|
|
401
|
-
Component: s ??
|
|
384
|
+
Component: s ?? Ke
|
|
402
385
|
}, n = e.length > 0 ? [
|
|
403
386
|
{
|
|
404
387
|
path: "settings",
|
|
405
388
|
index: !0,
|
|
406
389
|
Component: () => /* @__PURE__ */ a(
|
|
407
|
-
|
|
390
|
+
fe,
|
|
408
391
|
{
|
|
409
392
|
to: e[0].path,
|
|
410
393
|
relative: "path",
|
|
@@ -414,12 +397,12 @@ const De = () => {
|
|
|
414
397
|
},
|
|
415
398
|
{
|
|
416
399
|
path: "settings",
|
|
417
|
-
Component:
|
|
400
|
+
Component: Ve,
|
|
418
401
|
children: e.map((o) => ({
|
|
419
402
|
path: o.path,
|
|
420
403
|
Component: o.component,
|
|
421
404
|
...o.errorBoundary && {
|
|
422
|
-
ErrorBoundary:
|
|
405
|
+
ErrorBoundary: wt(o.errorBoundary)
|
|
423
406
|
}
|
|
424
407
|
}))
|
|
425
408
|
}
|
|
@@ -427,63 +410,61 @@ const De = () => {
|
|
|
427
410
|
return [
|
|
428
411
|
r,
|
|
429
412
|
{
|
|
430
|
-
children:
|
|
413
|
+
children: He(t)
|
|
431
414
|
},
|
|
432
415
|
...n,
|
|
433
416
|
{
|
|
434
417
|
path: "*",
|
|
435
418
|
loader: () => {
|
|
436
|
-
throw
|
|
419
|
+
throw Kt();
|
|
437
420
|
},
|
|
438
421
|
// Component is required to suppress React Router's warning about empty leaf routes,
|
|
439
422
|
// even though the loader always throws and this component will never render.
|
|
440
423
|
Component: () => null,
|
|
441
|
-
ErrorBoundary:
|
|
424
|
+
ErrorBoundary: _
|
|
442
425
|
}
|
|
443
426
|
];
|
|
444
|
-
},
|
|
445
|
-
loaderID:
|
|
446
|
-
loader: async (
|
|
447
|
-
}),
|
|
448
|
-
const
|
|
427
|
+
}, qt = "appshell-root-nav", qe = (t) => ({
|
|
428
|
+
loaderID: qt,
|
|
429
|
+
loader: async () => ({ navItems: Qe(t) })
|
|
430
|
+
}), Qt = () => pe(qt)?.navItems, Qe = async (t) => {
|
|
431
|
+
const e = Ot(t.locale);
|
|
449
432
|
return (await Promise.all(
|
|
450
|
-
t.modules.map(async (
|
|
451
|
-
if (
|
|
452
|
-
const
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
e
|
|
456
|
-
s
|
|
433
|
+
t.modules.map(async (r) => {
|
|
434
|
+
if (r.path.startsWith(":") || (await ut(r.guards)).type !== "pass") return null;
|
|
435
|
+
const o = await Yt(
|
|
436
|
+
r.resources,
|
|
437
|
+
r.path,
|
|
438
|
+
e
|
|
457
439
|
);
|
|
458
|
-
return
|
|
440
|
+
return o.length === 0 ? null : { module: r, resources: o };
|
|
459
441
|
})
|
|
460
|
-
)).filter((
|
|
461
|
-
title:
|
|
462
|
-
url:
|
|
463
|
-
icon:
|
|
464
|
-
items:
|
|
442
|
+
)).filter((r) => r !== null).map(({ module: r, resources: n }) => ({
|
|
443
|
+
title: e(r.meta.title, r.path),
|
|
444
|
+
url: r.meta.menuItemClickable ? r.path : void 0,
|
|
445
|
+
icon: r.meta.icon || /* @__PURE__ */ a(ke, {}),
|
|
446
|
+
items: n
|
|
465
447
|
}));
|
|
466
|
-
},
|
|
467
|
-
t.map(async (
|
|
468
|
-
if (
|
|
469
|
-
const
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
s
|
|
473
|
-
r
|
|
448
|
+
}, Yt = async (t, e, s) => (await Promise.all(
|
|
449
|
+
t.map(async (n) => {
|
|
450
|
+
if (n.path.startsWith(":") || (await ut(n.guards)).type !== "pass") return null;
|
|
451
|
+
const i = `${e}/${n.path}`, l = s(n.meta.title, n.path), u = n.subResources ? await Yt(
|
|
452
|
+
n.subResources,
|
|
453
|
+
i,
|
|
454
|
+
s
|
|
474
455
|
) : void 0;
|
|
475
456
|
return {
|
|
476
|
-
title:
|
|
477
|
-
url:
|
|
478
|
-
items:
|
|
457
|
+
title: l,
|
|
458
|
+
url: i,
|
|
459
|
+
items: u && u.length > 0 ? u : void 0
|
|
479
460
|
};
|
|
480
461
|
})
|
|
481
|
-
)).filter((
|
|
482
|
-
const { configurations: e } =
|
|
462
|
+
)).filter((n) => n !== null), Ye = (t) => {
|
|
463
|
+
const { configurations: e } = C(), { rootComponent: s, children: r } = t, n = Ge({
|
|
483
464
|
modules: e.modules,
|
|
484
465
|
settingsResources: e.settingsResources,
|
|
485
466
|
rootComponent: s
|
|
486
|
-
}), o = e.errorBoundary, { loaderID: i, loader: l } =
|
|
467
|
+
}), o = e.errorBoundary, { loaderID: i, loader: l } = qe({
|
|
487
468
|
modules: e.modules,
|
|
488
469
|
locale: e.locale
|
|
489
470
|
}), u = [
|
|
@@ -493,8 +474,8 @@ const De = () => {
|
|
|
493
474
|
element: r,
|
|
494
475
|
children: o ? [
|
|
495
476
|
{
|
|
496
|
-
element: /* @__PURE__ */ a(
|
|
497
|
-
ErrorBoundary:
|
|
477
|
+
element: /* @__PURE__ */ a(nt, {}),
|
|
478
|
+
ErrorBoundary: wt(o),
|
|
498
479
|
children: n
|
|
499
480
|
}
|
|
500
481
|
] : n,
|
|
@@ -504,28 +485,28 @@ const De = () => {
|
|
|
504
485
|
*/
|
|
505
486
|
HydrateFallback: () => null
|
|
506
487
|
}
|
|
507
|
-
], w = e.basePath ? "/" + e.basePath : void 0,
|
|
488
|
+
], w = e.basePath ? "/" + e.basePath : void 0, d = t.memory ? ge(u, {
|
|
508
489
|
basename: w,
|
|
509
490
|
...t.initialEntries ? { initialEntries: t.initialEntries } : {}
|
|
510
|
-
}) :
|
|
491
|
+
}) : be(u, {
|
|
511
492
|
basename: w
|
|
512
493
|
});
|
|
513
|
-
return /* @__PURE__ */ a(
|
|
514
|
-
},
|
|
494
|
+
return /* @__PURE__ */ a(xe, { router: d });
|
|
495
|
+
}, Xe = {
|
|
515
496
|
resolvedTheme: "light",
|
|
516
497
|
theme: "system",
|
|
517
498
|
setTheme: () => null
|
|
518
|
-
},
|
|
519
|
-
function
|
|
499
|
+
}, Xt = X(Xe);
|
|
500
|
+
function Ze({
|
|
520
501
|
children: t,
|
|
521
502
|
storageKey: e,
|
|
522
503
|
defaultTheme: s = "system",
|
|
523
504
|
...r
|
|
524
505
|
}) {
|
|
525
|
-
const [n, o] =
|
|
506
|
+
const [n, o] = H(
|
|
526
507
|
() => localStorage.getItem(e) || s
|
|
527
|
-
), i =
|
|
528
|
-
|
|
508
|
+
), i = M(() => n !== "system" ? n : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", [n]);
|
|
509
|
+
W(() => {
|
|
529
510
|
const u = window.document.documentElement;
|
|
530
511
|
u.classList.remove("light", "dark"), u.classList.add(i);
|
|
531
512
|
}, [i]);
|
|
@@ -536,108 +517,190 @@ function $e({
|
|
|
536
517
|
localStorage.setItem(e, u), o(u);
|
|
537
518
|
}
|
|
538
519
|
};
|
|
539
|
-
return /* @__PURE__ */ a(
|
|
520
|
+
return /* @__PURE__ */ a(Xt.Provider, { ...r, value: l, children: t });
|
|
540
521
|
}
|
|
541
|
-
const
|
|
542
|
-
const t =
|
|
522
|
+
const Je = () => {
|
|
523
|
+
const t = L(Xt);
|
|
543
524
|
if (t === void 0)
|
|
544
525
|
throw new Error("useTheme must be used within a ThemeProvider");
|
|
545
526
|
return t;
|
|
546
|
-
},
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
527
|
+
}, ta = () => () => {
|
|
528
|
+
}, ea = () => !0, aa = () => !1;
|
|
529
|
+
function sa() {
|
|
530
|
+
return Wt(
|
|
531
|
+
ta,
|
|
532
|
+
ea,
|
|
533
|
+
aa
|
|
534
|
+
);
|
|
535
|
+
}
|
|
536
|
+
function ra(t) {
|
|
537
|
+
const e = {
|
|
538
|
+
path: "",
|
|
539
|
+
fullPath: "",
|
|
540
|
+
guards: [],
|
|
541
|
+
children: /* @__PURE__ */ new Map()
|
|
542
|
+
};
|
|
543
|
+
for (const s of t) {
|
|
544
|
+
const r = Le(s.path);
|
|
545
|
+
let n = e, o = "";
|
|
546
|
+
for (const i of r)
|
|
547
|
+
i.type !== "group" && (o = o ? `${o}/${i.converted}` : i.converted, n.children.has(i.converted) || n.children.set(i.converted, {
|
|
548
|
+
path: i.converted,
|
|
549
|
+
fullPath: o,
|
|
550
|
+
guards: [],
|
|
551
|
+
children: /* @__PURE__ */ new Map()
|
|
552
|
+
}), n = n.children.get(i.converted));
|
|
553
|
+
n.component = s.component, n.guards = s.component.appShellPageProps?.guards ?? [];
|
|
554
|
+
}
|
|
555
|
+
return e;
|
|
556
|
+
}
|
|
557
|
+
function Zt(t, e) {
|
|
558
|
+
return t?.appShellPageProps?.meta?.title ?? D(e || "home");
|
|
559
|
+
}
|
|
560
|
+
function Jt(t) {
|
|
561
|
+
const e = t.component, s = Zt(e, t.path), r = e?.appShellPageProps?.meta?.icon, n = e?.appShellPageProps?.loader, o = [];
|
|
562
|
+
for (const i of t.children.values())
|
|
563
|
+
o.push(Jt(i));
|
|
564
|
+
return {
|
|
565
|
+
_type: "resource",
|
|
566
|
+
type: "component",
|
|
567
|
+
path: t.path,
|
|
568
|
+
meta: {
|
|
569
|
+
title: s,
|
|
570
|
+
icon: r
|
|
571
|
+
},
|
|
572
|
+
component: e ? () => /* @__PURE__ */ a(e, {}) : () => null,
|
|
573
|
+
subResources: o.length > 0 ? o : void 0,
|
|
574
|
+
errorBoundary: /* @__PURE__ */ a(_, {}),
|
|
575
|
+
guards: t.guards,
|
|
576
|
+
loader: n
|
|
577
|
+
};
|
|
578
|
+
}
|
|
579
|
+
function St(t) {
|
|
580
|
+
const e = t.component;
|
|
581
|
+
if (!e)
|
|
582
|
+
throw new Error(
|
|
583
|
+
`Module "${t.path}" must have a component. Add a page file (e.g., page.tsx) to the module directory.`
|
|
584
|
+
);
|
|
585
|
+
const s = Zt(e, t.path), r = e.appShellPageProps?.meta?.icon, n = e.appShellPageProps?.loader, o = [];
|
|
586
|
+
for (const i of t.children.values())
|
|
587
|
+
o.push(Jt(i));
|
|
588
|
+
return {
|
|
589
|
+
_type: "module",
|
|
590
|
+
type: "component",
|
|
591
|
+
path: t.path,
|
|
592
|
+
meta: {
|
|
593
|
+
title: s,
|
|
594
|
+
icon: r,
|
|
595
|
+
menuItemClickable: e !== void 0
|
|
596
|
+
},
|
|
597
|
+
component: () => /* @__PURE__ */ a(e, {}),
|
|
598
|
+
resources: o,
|
|
599
|
+
errorBoundary: /* @__PURE__ */ a(_, {}),
|
|
600
|
+
guards: t.guards,
|
|
601
|
+
loader: n
|
|
602
|
+
};
|
|
603
|
+
}
|
|
604
|
+
function na(t) {
|
|
605
|
+
if (t.length === 0)
|
|
606
|
+
return [];
|
|
607
|
+
const e = ra(t), s = [];
|
|
608
|
+
if (e.component) {
|
|
609
|
+
const r = St({
|
|
610
|
+
...e,
|
|
611
|
+
path: "",
|
|
612
|
+
children: /* @__PURE__ */ new Map()
|
|
613
|
+
// Root module doesn't include children as resources
|
|
614
|
+
});
|
|
615
|
+
s.push(r);
|
|
616
|
+
}
|
|
617
|
+
for (const r of e.children.values())
|
|
618
|
+
s.push(St(r));
|
|
619
|
+
return s;
|
|
620
|
+
}
|
|
621
|
+
const te = (t) => {
|
|
622
|
+
const e = sa(), s = t.contextData ?? {};
|
|
623
|
+
Ue(s);
|
|
624
|
+
const r = t.modules, n = M(
|
|
625
|
+
() => r ? We({
|
|
626
|
+
modules: r,
|
|
556
627
|
settingsResources: t.settingsResources,
|
|
557
628
|
basePath: t.basePath,
|
|
558
629
|
errorBoundary: t.errorBoundary,
|
|
559
630
|
locale: t.locale
|
|
560
|
-
}),
|
|
631
|
+
}) : null,
|
|
561
632
|
[
|
|
562
|
-
|
|
633
|
+
r,
|
|
563
634
|
t.settingsResources,
|
|
564
635
|
t.basePath,
|
|
565
636
|
t.errorBoundary,
|
|
566
637
|
t.locale
|
|
567
638
|
]
|
|
568
|
-
), o =
|
|
569
|
-
() =>
|
|
639
|
+
), o = M(
|
|
640
|
+
() => n ? { title: t.title, icon: t.icon, configurations: n } : null,
|
|
570
641
|
[t.title, t.icon, n]
|
|
571
|
-
), i =
|
|
642
|
+
), i = M(
|
|
572
643
|
() => ({ contextData: t.contextData ?? {} }),
|
|
573
644
|
[t.contextData]
|
|
574
645
|
);
|
|
575
|
-
|
|
646
|
+
if (!r || !o) {
|
|
647
|
+
const l = "[AppShell] No routes configured. Either use the appShellRoutes() vite-plugin for automatic page configuration, or pass the 'modules' prop for manual configuration.";
|
|
648
|
+
return console.error(l), /* @__PURE__ */ a("div", { className: "astw:flex astw:min-h-screen astw:items-center astw:justify-center astw:bg-background astw:p-4", children: /* @__PURE__ */ c("div", { className: "astw:max-w-md astw:rounded-lg astw:border astw:border-destructive/50 astw:bg-destructive/10 astw:p-6 astw:text-center", children: [
|
|
649
|
+
/* @__PURE__ */ a("h1", { className: "astw:mb-2 astw:text-lg astw:font-semibold astw:text-destructive", children: "Configuration Error" }),
|
|
650
|
+
/* @__PURE__ */ a("p", { className: "astw:text-sm astw:text-muted-foreground", children: l })
|
|
651
|
+
] }) });
|
|
652
|
+
}
|
|
653
|
+
return e ? /* @__PURE__ */ a(ct.Provider, { value: o, children: /* @__PURE__ */ a(dt.Provider, { value: i, children: /* @__PURE__ */ a(Ze, { defaultTheme: "system", storageKey: "appshell-ui-theme", children: /* @__PURE__ */ a(Ye, { rootComponent: t.rootComponent, children: t.children }) }) }) }) : null;
|
|
576
654
|
};
|
|
577
|
-
function
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
}
|
|
582
|
-
function mt({
|
|
583
|
-
...t
|
|
584
|
-
}) {
|
|
585
|
-
return /* @__PURE__ */ a(
|
|
586
|
-
J.CollapsibleTrigger,
|
|
587
|
-
{
|
|
588
|
-
"data-slot": "collapsible-trigger",
|
|
589
|
-
...t
|
|
590
|
-
}
|
|
591
|
-
);
|
|
592
|
-
}
|
|
593
|
-
function Ke({
|
|
594
|
-
...t
|
|
595
|
-
}) {
|
|
596
|
-
return /* @__PURE__ */ a(
|
|
597
|
-
J.CollapsibleContent,
|
|
655
|
+
function oa(t) {
|
|
656
|
+
const e = na(t), s = e.find((o) => o.path === ""), r = e.filter((o) => o.path !== "");
|
|
657
|
+
return (o) => /* @__PURE__ */ a(
|
|
658
|
+
te,
|
|
598
659
|
{
|
|
599
|
-
|
|
600
|
-
|
|
660
|
+
...o,
|
|
661
|
+
modules: r,
|
|
662
|
+
rootComponent: o.rootComponent ?? s?.component
|
|
601
663
|
}
|
|
602
664
|
);
|
|
603
665
|
}
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
666
|
+
te.WithPages = oa;
|
|
667
|
+
const J = 768;
|
|
668
|
+
function ia() {
|
|
669
|
+
const [t, e] = p.useState(
|
|
607
670
|
void 0
|
|
608
671
|
);
|
|
609
|
-
return
|
|
610
|
-
const s = window.matchMedia(`(max-width: ${
|
|
611
|
-
e(window.innerWidth <
|
|
672
|
+
return p.useEffect(() => {
|
|
673
|
+
const s = window.matchMedia(`(max-width: ${J - 1}px)`), r = () => {
|
|
674
|
+
e(window.innerWidth < J);
|
|
612
675
|
};
|
|
613
|
-
return s.addEventListener("change", r), e(window.innerWidth <
|
|
676
|
+
return s.addEventListener("change", r), e(window.innerWidth < J), () => s.removeEventListener("change", r);
|
|
614
677
|
}, []), !!t;
|
|
615
678
|
}
|
|
616
|
-
const
|
|
617
|
-
function
|
|
618
|
-
const [t, e] =
|
|
679
|
+
const tt = 768, et = 1199;
|
|
680
|
+
function la() {
|
|
681
|
+
const [t, e] = p.useState(
|
|
619
682
|
void 0
|
|
620
683
|
);
|
|
621
|
-
return
|
|
684
|
+
return p.useEffect(() => {
|
|
622
685
|
const s = window.matchMedia(
|
|
623
|
-
`(min-width: ${
|
|
686
|
+
`(min-width: ${tt}px) and (max-width: ${et}px)`
|
|
624
687
|
), r = () => {
|
|
625
688
|
e(
|
|
626
|
-
window.innerWidth >=
|
|
689
|
+
window.innerWidth >= tt && window.innerWidth <= et
|
|
627
690
|
);
|
|
628
691
|
};
|
|
629
692
|
return s.addEventListener("change", r), e(
|
|
630
|
-
window.innerWidth >=
|
|
693
|
+
window.innerWidth >= tt && window.innerWidth <= et
|
|
631
694
|
), () => s.removeEventListener("change", r);
|
|
632
695
|
}, []), !!t;
|
|
633
696
|
}
|
|
634
|
-
function
|
|
697
|
+
function ca({ className: t, type: e, ...s }) {
|
|
635
698
|
return /* @__PURE__ */ a(
|
|
636
699
|
"input",
|
|
637
700
|
{
|
|
638
701
|
type: e,
|
|
639
702
|
"data-slot": "input",
|
|
640
|
-
className:
|
|
703
|
+
className: h(
|
|
641
704
|
"astw:file:text-foreground astw:placeholder:text-muted-foreground astw:selection:bg-primary astw:selection:text-primary-foreground astw:dark:bg-input/30 astw:border-input astw:flex astw:h-9 astw:w-full astw:min-w-0 astw:rounded-md astw:border astw:bg-transparent astw:px-3 astw:py-1 astw:text-base astw:shadow-xs astw:transition-[color,box-shadow] astw:outline-none astw:file:inline-flex astw:file:h-7 astw:file:border-0 astw:file:bg-transparent astw:file:text-sm astw:file:font-medium astw:disabled:pointer-events-none astw:disabled:cursor-not-allowed astw:disabled:opacity-50 astw:md:text-sm",
|
|
642
705
|
"astw:focus-visible:border-ring astw:focus-visible:ring-ring/50 astw:focus-visible:ring-[3px]",
|
|
643
706
|
"astw:aria-invalid:ring-destructive/20 astw:dark:aria-invalid:ring-destructive/40 astw:aria-invalid:border-destructive",
|
|
@@ -647,23 +710,43 @@ function He({ className: t, type: e, ...s }) {
|
|
|
647
710
|
}
|
|
648
711
|
);
|
|
649
712
|
}
|
|
650
|
-
function
|
|
651
|
-
|
|
713
|
+
function da({
|
|
714
|
+
className: t,
|
|
715
|
+
orientation: e = "horizontal",
|
|
716
|
+
decorative: s = !0,
|
|
717
|
+
...r
|
|
718
|
+
}) {
|
|
719
|
+
return /* @__PURE__ */ a(
|
|
720
|
+
Ie.Root,
|
|
721
|
+
{
|
|
722
|
+
"data-slot": "separator-root",
|
|
723
|
+
decorative: s,
|
|
724
|
+
orientation: e,
|
|
725
|
+
className: h(
|
|
726
|
+
"astw:bg-border astw:shrink-0 astw:data-[orientation=horizontal]:h-px astw:data-[orientation=horizontal]:w-full astw:data-[orientation=vertical]:h-full astw:data-[orientation=vertical]:w-px",
|
|
727
|
+
t
|
|
728
|
+
),
|
|
729
|
+
...r
|
|
730
|
+
}
|
|
731
|
+
);
|
|
732
|
+
}
|
|
733
|
+
function Ct({ ...t }) {
|
|
734
|
+
return /* @__PURE__ */ a(v.Root, { "data-slot": "sheet", ...t });
|
|
652
735
|
}
|
|
653
|
-
function
|
|
736
|
+
function ua({
|
|
654
737
|
...t
|
|
655
738
|
}) {
|
|
656
|
-
return /* @__PURE__ */ a(
|
|
739
|
+
return /* @__PURE__ */ a(v.Portal, { "data-slot": "sheet-portal", ...t });
|
|
657
740
|
}
|
|
658
|
-
function
|
|
741
|
+
function wa({
|
|
659
742
|
className: t,
|
|
660
743
|
...e
|
|
661
744
|
}) {
|
|
662
745
|
return /* @__PURE__ */ a(
|
|
663
|
-
|
|
746
|
+
v.Overlay,
|
|
664
747
|
{
|
|
665
748
|
"data-slot": "sheet-overlay",
|
|
666
|
-
className:
|
|
749
|
+
className: h(
|
|
667
750
|
"astw:data-[state=open]:animate-in astw:data-[state=closed]:animate-out astw:data-[state=closed]:fade-out-0 astw:data-[state=open]:fade-in-0 astw:fixed astw:inset-0 astw:z-50 astw:bg-black/50",
|
|
668
751
|
t
|
|
669
752
|
),
|
|
@@ -671,19 +754,19 @@ function Ge({
|
|
|
671
754
|
}
|
|
672
755
|
);
|
|
673
756
|
}
|
|
674
|
-
function
|
|
757
|
+
function Tt({
|
|
675
758
|
className: t,
|
|
676
759
|
children: e,
|
|
677
760
|
side: s = "right",
|
|
678
761
|
...r
|
|
679
762
|
}) {
|
|
680
|
-
return /* @__PURE__ */
|
|
681
|
-
/* @__PURE__ */ a(
|
|
682
|
-
/* @__PURE__ */
|
|
683
|
-
|
|
763
|
+
return /* @__PURE__ */ c(ua, { children: [
|
|
764
|
+
/* @__PURE__ */ a(wa, {}),
|
|
765
|
+
/* @__PURE__ */ c(
|
|
766
|
+
v.Content,
|
|
684
767
|
{
|
|
685
768
|
"data-slot": "sheet-content",
|
|
686
|
-
className:
|
|
769
|
+
className: h(
|
|
687
770
|
"astw:bg-background astw:data-[state=open]:animate-in astw:data-[state=closed]:animate-out astw:fixed astw:z-50 astw:flex astw:flex-col astw:gap-4 astw:shadow-lg astw:transition astw:ease-in-out astw:data-[state=closed]:duration-300 astw:data-[state=open]:duration-500",
|
|
688
771
|
s === "right" && "astw:data-[state=closed]:slide-out-to-right astw:data-[state=open]:slide-in-from-right astw:inset-y-0 astw:right-0 astw:h-full astw:w-3/4 astw:border-l astw:sm:max-w-sm",
|
|
689
772
|
s === "left" && "astw:data-[state=closed]:slide-out-to-left astw:data-[state=open]:slide-in-from-left astw:inset-y-0 astw:left-0 astw:h-full astw:w-3/4 astw:border-r astw:sm:max-w-sm",
|
|
@@ -694,8 +777,8 @@ function ft({
|
|
|
694
777
|
...r,
|
|
695
778
|
children: [
|
|
696
779
|
e,
|
|
697
|
-
/* @__PURE__ */
|
|
698
|
-
/* @__PURE__ */ a(
|
|
780
|
+
/* @__PURE__ */ c(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: [
|
|
781
|
+
/* @__PURE__ */ a(_t, { className: "astw:size-4" }),
|
|
699
782
|
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: "Close" })
|
|
700
783
|
] })
|
|
701
784
|
]
|
|
@@ -703,48 +786,48 @@ function ft({
|
|
|
703
786
|
)
|
|
704
787
|
] });
|
|
705
788
|
}
|
|
706
|
-
function
|
|
789
|
+
function kt({ className: t, ...e }) {
|
|
707
790
|
return /* @__PURE__ */ a(
|
|
708
791
|
"div",
|
|
709
792
|
{
|
|
710
793
|
"data-slot": "sheet-header",
|
|
711
|
-
className:
|
|
794
|
+
className: h("astw:flex astw:flex-col astw:gap-1.5 astw:p-4", t),
|
|
712
795
|
...e
|
|
713
796
|
}
|
|
714
797
|
);
|
|
715
798
|
}
|
|
716
|
-
function
|
|
799
|
+
function Rt({
|
|
717
800
|
className: t,
|
|
718
801
|
...e
|
|
719
802
|
}) {
|
|
720
803
|
return /* @__PURE__ */ a(
|
|
721
|
-
|
|
804
|
+
v.Title,
|
|
722
805
|
{
|
|
723
806
|
"data-slot": "sheet-title",
|
|
724
|
-
className:
|
|
807
|
+
className: h("astw:text-foreground astw:font-semibold", t),
|
|
725
808
|
...e
|
|
726
809
|
}
|
|
727
810
|
);
|
|
728
811
|
}
|
|
729
|
-
function
|
|
812
|
+
function Pt({
|
|
730
813
|
className: t,
|
|
731
814
|
...e
|
|
732
815
|
}) {
|
|
733
816
|
return /* @__PURE__ */ a(
|
|
734
|
-
|
|
817
|
+
v.Description,
|
|
735
818
|
{
|
|
736
819
|
"data-slot": "sheet-description",
|
|
737
|
-
className:
|
|
820
|
+
className: h("astw:text-muted-foreground astw:text-sm", t),
|
|
738
821
|
...e
|
|
739
822
|
}
|
|
740
823
|
);
|
|
741
824
|
}
|
|
742
|
-
function
|
|
825
|
+
function ht({
|
|
743
826
|
delayDuration: t = 0,
|
|
744
827
|
...e
|
|
745
828
|
}) {
|
|
746
829
|
return /* @__PURE__ */ a(
|
|
747
|
-
|
|
830
|
+
B.Provider,
|
|
748
831
|
{
|
|
749
832
|
"data-slot": "tooltip-provider",
|
|
750
833
|
delayDuration: t,
|
|
@@ -752,47 +835,47 @@ function nt({
|
|
|
752
835
|
}
|
|
753
836
|
);
|
|
754
837
|
}
|
|
755
|
-
function
|
|
838
|
+
function mt({
|
|
756
839
|
...t
|
|
757
840
|
}) {
|
|
758
|
-
return /* @__PURE__ */ a(
|
|
841
|
+
return /* @__PURE__ */ a(ht, { children: /* @__PURE__ */ a(B.Root, { "data-slot": "tooltip", ...t }) });
|
|
759
842
|
}
|
|
760
|
-
function
|
|
843
|
+
function ft({
|
|
761
844
|
...t
|
|
762
845
|
}) {
|
|
763
|
-
return /* @__PURE__ */ a(
|
|
846
|
+
return /* @__PURE__ */ a(B.Trigger, { "data-slot": "tooltip-trigger", ...t });
|
|
764
847
|
}
|
|
765
|
-
function
|
|
848
|
+
function pt({
|
|
766
849
|
className: t,
|
|
767
850
|
sideOffset: e = 0,
|
|
768
851
|
children: s,
|
|
769
852
|
...r
|
|
770
853
|
}) {
|
|
771
|
-
return /* @__PURE__ */ a(
|
|
772
|
-
|
|
854
|
+
return /* @__PURE__ */ a(B.Portal, { children: /* @__PURE__ */ c(
|
|
855
|
+
B.Content,
|
|
773
856
|
{
|
|
774
857
|
"data-slot": "tooltip-content",
|
|
775
858
|
sideOffset: e,
|
|
776
|
-
className:
|
|
859
|
+
className: h(
|
|
777
860
|
"astw:bg-primary astw:text-primary-foreground astw:animate-in astw:fade-in-0 astw:zoom-in-95 astw:data-[state=closed]:animate-out astw:data-[state=closed]:fade-out-0 astw:data-[state=closed]:zoom-out-95 astw:data-[side=bottom]:slide-in-from-top-2 astw:data-[side=left]:slide-in-from-right-2 astw:data-[side=right]:slide-in-from-left-2 astw:data-[side=top]:slide-in-from-bottom-2 astw:z-50 astw:w-fit astw:origin-(--radix-tooltip-content-transform-origin) astw:rounded-md astw:px-3 astw:py-1.5 astw:text-xs astw:text-balance",
|
|
778
861
|
t
|
|
779
862
|
),
|
|
780
863
|
...r,
|
|
781
864
|
children: [
|
|
782
865
|
s,
|
|
783
|
-
/* @__PURE__ */ a(
|
|
866
|
+
/* @__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
867
|
]
|
|
785
868
|
}
|
|
786
869
|
) });
|
|
787
870
|
}
|
|
788
|
-
const
|
|
789
|
-
function
|
|
790
|
-
const t =
|
|
871
|
+
const ee = "16rem", ha = "18rem", ma = "3rem", fa = "b", ae = p.createContext(null);
|
|
872
|
+
function K() {
|
|
873
|
+
const t = p.useContext(ae);
|
|
791
874
|
if (!t)
|
|
792
875
|
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
793
876
|
return t;
|
|
794
877
|
}
|
|
795
|
-
function
|
|
878
|
+
function pa({
|
|
796
879
|
defaultOpen: t = !0,
|
|
797
880
|
open: e,
|
|
798
881
|
onOpenChange: s,
|
|
@@ -801,55 +884,55 @@ function Ze({
|
|
|
801
884
|
children: o,
|
|
802
885
|
...i
|
|
803
886
|
}) {
|
|
804
|
-
const l =
|
|
805
|
-
(
|
|
806
|
-
const
|
|
807
|
-
s ? s(
|
|
887
|
+
const l = ia(), u = la(), [w, d] = p.useState(!1), [m, f] = p.useState(!1), [g, x] = p.useState(t), b = e ?? g, k = p.useCallback(
|
|
888
|
+
(y) => {
|
|
889
|
+
const P = typeof y == "function" ? y(b) : y;
|
|
890
|
+
s ? s(P) : x(P);
|
|
808
891
|
},
|
|
809
|
-
[s,
|
|
810
|
-
),
|
|
811
|
-
|
|
812
|
-
const
|
|
813
|
-
|
|
892
|
+
[s, b]
|
|
893
|
+
), R = u && !l, V = p.useCallback(() => l ? d((y) => !y) : R ? f((y) => !y) : k((y) => !y), [l, R, k, d]);
|
|
894
|
+
p.useEffect(() => {
|
|
895
|
+
const y = (P) => {
|
|
896
|
+
P.key === fa && (P.metaKey || P.ctrlKey) && (P.preventDefault(), V());
|
|
814
897
|
};
|
|
815
|
-
return window.addEventListener("keydown",
|
|
816
|
-
}, [
|
|
817
|
-
const
|
|
898
|
+
return window.addEventListener("keydown", y), () => window.removeEventListener("keydown", y);
|
|
899
|
+
}, [V]);
|
|
900
|
+
const vt = b ? "expanded" : "collapsed", de = p.useMemo(
|
|
818
901
|
() => ({
|
|
819
|
-
state:
|
|
820
|
-
open:
|
|
821
|
-
setOpen:
|
|
902
|
+
state: vt,
|
|
903
|
+
open: b,
|
|
904
|
+
setOpen: k,
|
|
822
905
|
isMobile: l,
|
|
823
906
|
openMobile: w,
|
|
824
|
-
setOpenMobile:
|
|
825
|
-
toggleSidebar:
|
|
826
|
-
isIconMode:
|
|
827
|
-
openIconMode:
|
|
907
|
+
setOpenMobile: d,
|
|
908
|
+
toggleSidebar: V,
|
|
909
|
+
isIconMode: R,
|
|
910
|
+
openIconMode: m,
|
|
828
911
|
setOpenIconMode: f
|
|
829
912
|
}),
|
|
830
913
|
[
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
914
|
+
vt,
|
|
915
|
+
b,
|
|
916
|
+
k,
|
|
834
917
|
l,
|
|
835
918
|
w,
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
919
|
+
d,
|
|
920
|
+
V,
|
|
921
|
+
R,
|
|
922
|
+
m,
|
|
840
923
|
f
|
|
841
924
|
]
|
|
842
925
|
);
|
|
843
|
-
return /* @__PURE__ */ a(
|
|
926
|
+
return /* @__PURE__ */ a(ae.Provider, { value: de, children: /* @__PURE__ */ a(ht, { delayDuration: 0, children: /* @__PURE__ */ a(
|
|
844
927
|
"div",
|
|
845
928
|
{
|
|
846
929
|
"data-slot": "sidebar-wrapper",
|
|
847
930
|
style: {
|
|
848
|
-
"--sidebar-width":
|
|
849
|
-
"--sidebar-width-icon":
|
|
931
|
+
"--sidebar-width": ee,
|
|
932
|
+
"--sidebar-width-icon": ma,
|
|
850
933
|
...n
|
|
851
934
|
},
|
|
852
|
-
className:
|
|
935
|
+
className: h(
|
|
853
936
|
"astw:group/sidebar-wrapper astw:has-data-[variant=inset]:bg-sidebar astw:flex astw:min-h-svh astw:w-full astw:overflow-hidden",
|
|
854
937
|
r
|
|
855
938
|
),
|
|
@@ -858,7 +941,7 @@ function Ze({
|
|
|
858
941
|
}
|
|
859
942
|
) }) });
|
|
860
943
|
}
|
|
861
|
-
function
|
|
944
|
+
function ga({
|
|
862
945
|
side: t = "left",
|
|
863
946
|
variant: e = "sidebar",
|
|
864
947
|
collapsible: s = "offcanvas",
|
|
@@ -871,42 +954,42 @@ function Je({
|
|
|
871
954
|
state: l,
|
|
872
955
|
openMobile: u,
|
|
873
956
|
setOpenMobile: w,
|
|
874
|
-
isIconMode:
|
|
875
|
-
openIconMode:
|
|
957
|
+
isIconMode: d,
|
|
958
|
+
openIconMode: m,
|
|
876
959
|
setOpenIconMode: f
|
|
877
|
-
} =
|
|
960
|
+
} = K();
|
|
878
961
|
return s === "none" ? /* @__PURE__ */ a(
|
|
879
962
|
"div",
|
|
880
963
|
{
|
|
881
964
|
"data-slot": "sidebar",
|
|
882
|
-
className:
|
|
965
|
+
className: h(
|
|
883
966
|
"astw:bg-sidebar astw:text-sidebar-foreground astw:flex astw:h-full astw:w-(--sidebar-width) astw:flex-col",
|
|
884
967
|
r
|
|
885
968
|
),
|
|
886
969
|
...o,
|
|
887
970
|
children: n
|
|
888
971
|
}
|
|
889
|
-
) : i ? /* @__PURE__ */ a(
|
|
890
|
-
|
|
972
|
+
) : i ? /* @__PURE__ */ a(Ct, { open: u, onOpenChange: w, ...o, children: /* @__PURE__ */ c(
|
|
973
|
+
Tt,
|
|
891
974
|
{
|
|
892
975
|
"data-sidebar": "sidebar",
|
|
893
976
|
"data-slot": "sidebar",
|
|
894
977
|
"data-mobile": "true",
|
|
895
978
|
className: "astw:bg-sidebar astw:text-sidebar-foreground astw:w-(--sidebar-width) astw:p-0 astw:[&>button]:hidden",
|
|
896
979
|
style: {
|
|
897
|
-
"--sidebar-width":
|
|
980
|
+
"--sidebar-width": ha
|
|
898
981
|
},
|
|
899
982
|
side: t,
|
|
900
983
|
children: [
|
|
901
|
-
/* @__PURE__ */
|
|
902
|
-
/* @__PURE__ */ a(
|
|
903
|
-
/* @__PURE__ */ a(
|
|
984
|
+
/* @__PURE__ */ c(kt, { className: "astw:sr-only", children: [
|
|
985
|
+
/* @__PURE__ */ a(Rt, { children: "Sidebar" }),
|
|
986
|
+
/* @__PURE__ */ a(Pt, { children: "Displays the mobile sidebar." })
|
|
904
987
|
] }),
|
|
905
988
|
/* @__PURE__ */ a("div", { className: "flex h-full w-full flex-col", children: n })
|
|
906
989
|
]
|
|
907
990
|
}
|
|
908
|
-
) }) :
|
|
909
|
-
/* @__PURE__ */
|
|
991
|
+
) }) : d && s === "icon" ? /* @__PURE__ */ c(S, { children: [
|
|
992
|
+
/* @__PURE__ */ c(
|
|
910
993
|
"div",
|
|
911
994
|
{
|
|
912
995
|
className: "astw:group astw:peer astw:text-sidebar-foreground astw:hidden astw:md:block",
|
|
@@ -920,7 +1003,7 @@ function Je({
|
|
|
920
1003
|
"div",
|
|
921
1004
|
{
|
|
922
1005
|
"data-slot": "sidebar-gap",
|
|
923
|
-
className:
|
|
1006
|
+
className: h(
|
|
924
1007
|
"astw:relative astw:bg-transparent astw:transition-[width] astw:duration-200 astw:ease-linear",
|
|
925
1008
|
e === "floating" || e === "inset" ? "astw:group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "astw:group-data-[collapsible=icon]:w-(--sidebar-width-icon)"
|
|
926
1009
|
)
|
|
@@ -930,7 +1013,7 @@ function Je({
|
|
|
930
1013
|
"div",
|
|
931
1014
|
{
|
|
932
1015
|
"data-slot": "sidebar-container",
|
|
933
|
-
className:
|
|
1016
|
+
className: h(
|
|
934
1017
|
"astw:fixed astw:inset-y-0 astw:z-10 astw:hidden astw:h-svh astw:transition-[left,right,width] astw:duration-200 astw:ease-linear astw:md:flex",
|
|
935
1018
|
t === "left" ? "astw:left-0" : "astw:right-0",
|
|
936
1019
|
e === "floating" || e === "inset" ? "astw:p-2 astw:group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]" : "astw:group-data-[collapsible=icon]:w-(--sidebar-width-icon) astw:group-data-[side=left]:border-r astw:group-data-[side=right]:border-l",
|
|
@@ -950,27 +1033,27 @@ function Je({
|
|
|
950
1033
|
]
|
|
951
1034
|
}
|
|
952
1035
|
),
|
|
953
|
-
/* @__PURE__ */ a(
|
|
954
|
-
|
|
1036
|
+
/* @__PURE__ */ a(Ct, { open: m, onOpenChange: f, ...o, children: /* @__PURE__ */ c(
|
|
1037
|
+
Tt,
|
|
955
1038
|
{
|
|
956
1039
|
"data-sidebar": "sidebar",
|
|
957
1040
|
"data-slot": "sidebar-overlay",
|
|
958
1041
|
"data-icon-mode": "true",
|
|
959
1042
|
className: "astw:bg-sidebar astw:text-sidebar-foreground astw:w-(--sidebar-width) astw:p-0 astw:[&>button]:hidden",
|
|
960
1043
|
style: {
|
|
961
|
-
"--sidebar-width":
|
|
1044
|
+
"--sidebar-width": ee
|
|
962
1045
|
},
|
|
963
1046
|
side: t,
|
|
964
1047
|
children: [
|
|
965
|
-
/* @__PURE__ */
|
|
966
|
-
/* @__PURE__ */ a(
|
|
967
|
-
/* @__PURE__ */ a(
|
|
1048
|
+
/* @__PURE__ */ c(kt, { className: "astw:sr-only", children: [
|
|
1049
|
+
/* @__PURE__ */ a(Rt, { children: "Sidebar" }),
|
|
1050
|
+
/* @__PURE__ */ a(Pt, { children: "Displays the sidebar overlay." })
|
|
968
1051
|
] }),
|
|
969
1052
|
/* @__PURE__ */ a("div", { className: "flex h-full w-full flex-col", children: n })
|
|
970
1053
|
]
|
|
971
1054
|
}
|
|
972
1055
|
) })
|
|
973
|
-
] }) : /* @__PURE__ */
|
|
1056
|
+
] }) : /* @__PURE__ */ c(
|
|
974
1057
|
"div",
|
|
975
1058
|
{
|
|
976
1059
|
className: "astw:group astw:peer astw:text-sidebar-foreground astw:hidden astw:md:block",
|
|
@@ -984,7 +1067,7 @@ function Je({
|
|
|
984
1067
|
"div",
|
|
985
1068
|
{
|
|
986
1069
|
"data-slot": "sidebar-gap",
|
|
987
|
-
className:
|
|
1070
|
+
className: h(
|
|
988
1071
|
"astw:relative astw:w-(--sidebar-width) astw:bg-transparent astw:transition-[width] astw:duration-200 astw:ease-linear",
|
|
989
1072
|
"astw:group-data-[collapsible=offcanvas]:w-0",
|
|
990
1073
|
"astw:group-data-[side=right]:rotate-180",
|
|
@@ -996,7 +1079,7 @@ function Je({
|
|
|
996
1079
|
"div",
|
|
997
1080
|
{
|
|
998
1081
|
"data-slot": "sidebar-container",
|
|
999
|
-
className:
|
|
1082
|
+
className: h(
|
|
1000
1083
|
"astw:fixed astw:inset-y-0 astw:z-10 astw:hidden astw:h-svh astw:w-(--sidebar-width) astw:transition-[left,right,width] astw:duration-200 astw:ease-linear astw:md:flex",
|
|
1001
1084
|
t === "left" ? "astw:left-0 astw:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]" : "astw:right-0 astw:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
|
|
1002
1085
|
// Adjust the padding for floating and inset variants.
|
|
@@ -1020,37 +1103,37 @@ function Je({
|
|
|
1020
1103
|
}
|
|
1021
1104
|
);
|
|
1022
1105
|
}
|
|
1023
|
-
function
|
|
1106
|
+
function se({
|
|
1024
1107
|
className: t,
|
|
1025
1108
|
onClick: e,
|
|
1026
1109
|
...s
|
|
1027
1110
|
}) {
|
|
1028
|
-
const { toggleSidebar: r } =
|
|
1029
|
-
return /* @__PURE__ */
|
|
1030
|
-
|
|
1111
|
+
const { toggleSidebar: r } = K();
|
|
1112
|
+
return /* @__PURE__ */ c(
|
|
1113
|
+
F,
|
|
1031
1114
|
{
|
|
1032
1115
|
"data-sidebar": "trigger",
|
|
1033
1116
|
"data-slot": "sidebar-trigger",
|
|
1034
1117
|
variant: "ghost",
|
|
1035
1118
|
size: "icon",
|
|
1036
|
-
className:
|
|
1119
|
+
className: h("astw:text-muted-foreground", t),
|
|
1037
1120
|
onClick: (n) => {
|
|
1038
1121
|
e?.(n), r();
|
|
1039
1122
|
},
|
|
1040
1123
|
...s,
|
|
1041
1124
|
children: [
|
|
1042
|
-
/* @__PURE__ */ a(
|
|
1125
|
+
/* @__PURE__ */ a(Re, { className: "astw:size-4.5" }),
|
|
1043
1126
|
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: "Toggle Sidebar" })
|
|
1044
1127
|
]
|
|
1045
1128
|
}
|
|
1046
1129
|
);
|
|
1047
1130
|
}
|
|
1048
|
-
function
|
|
1131
|
+
function ba({ className: t, ...e }) {
|
|
1049
1132
|
return /* @__PURE__ */ a(
|
|
1050
1133
|
"main",
|
|
1051
1134
|
{
|
|
1052
1135
|
"data-slot": "sidebar-inset",
|
|
1053
|
-
className:
|
|
1136
|
+
className: h(
|
|
1054
1137
|
"astw:bg-background astw:relative astw:flex astw:w-full astw:flex-1 astw:flex-col",
|
|
1055
1138
|
"astw:px-4 astw:md:peer-data-[variant=inset]:px-8 astw:md:peer-data-[variant=inset]:py-2",
|
|
1056
1139
|
// astw:md:peer-data-[variant=inset]:peer-data-[state=collapsed]:pl-2
|
|
@@ -1060,13 +1143,13 @@ function ta({ className: t, ...e }) {
|
|
|
1060
1143
|
}
|
|
1061
1144
|
);
|
|
1062
1145
|
}
|
|
1063
|
-
function
|
|
1146
|
+
function xa({ className: t, ...e }) {
|
|
1064
1147
|
return /* @__PURE__ */ a(
|
|
1065
1148
|
"div",
|
|
1066
1149
|
{
|
|
1067
1150
|
"data-slot": "sidebar-header",
|
|
1068
1151
|
"data-sidebar": "header",
|
|
1069
|
-
className:
|
|
1152
|
+
className: h(
|
|
1070
1153
|
"astw:flex astw:flex-row astw:items-center astw:gap-0.5 astw:p-2",
|
|
1071
1154
|
t
|
|
1072
1155
|
),
|
|
@@ -1074,13 +1157,27 @@ function ea({ className: t, ...e }) {
|
|
|
1074
1157
|
}
|
|
1075
1158
|
);
|
|
1076
1159
|
}
|
|
1077
|
-
function
|
|
1160
|
+
function va({
|
|
1161
|
+
className: t,
|
|
1162
|
+
...e
|
|
1163
|
+
}) {
|
|
1164
|
+
return /* @__PURE__ */ a(
|
|
1165
|
+
da,
|
|
1166
|
+
{
|
|
1167
|
+
"data-slot": "sidebar-separator",
|
|
1168
|
+
"data-sidebar": "separator",
|
|
1169
|
+
className: h("astw:bg-sidebar-border astw:mx-2 astw:w-auto", t),
|
|
1170
|
+
...e
|
|
1171
|
+
}
|
|
1172
|
+
);
|
|
1173
|
+
}
|
|
1174
|
+
function ya({ className: t, ...e }) {
|
|
1078
1175
|
return /* @__PURE__ */ a(
|
|
1079
1176
|
"div",
|
|
1080
1177
|
{
|
|
1081
1178
|
"data-slot": "sidebar-content",
|
|
1082
1179
|
"data-sidebar": "content",
|
|
1083
|
-
className:
|
|
1180
|
+
className: h(
|
|
1084
1181
|
"astw:flex astw:min-h-0 astw:flex-1 astw:flex-col astw:gap-2 astw:overflow-auto astw:group-data-[collapsible=icon]:overflow-hidden",
|
|
1085
1182
|
t
|
|
1086
1183
|
),
|
|
@@ -1088,13 +1185,13 @@ function aa({ className: t, ...e }) {
|
|
|
1088
1185
|
}
|
|
1089
1186
|
);
|
|
1090
1187
|
}
|
|
1091
|
-
function
|
|
1188
|
+
function gt({ className: t, ...e }) {
|
|
1092
1189
|
return /* @__PURE__ */ a(
|
|
1093
1190
|
"div",
|
|
1094
1191
|
{
|
|
1095
1192
|
"data-slot": "sidebar-group",
|
|
1096
1193
|
"data-sidebar": "group",
|
|
1097
|
-
className:
|
|
1194
|
+
className: h(
|
|
1098
1195
|
"astw:relative astw:flex astw:w-full astw:min-w-0 astw:flex-col astw:p-2",
|
|
1099
1196
|
t
|
|
1100
1197
|
),
|
|
@@ -1102,13 +1199,13 @@ function Vt({ className: t, ...e }) {
|
|
|
1102
1199
|
}
|
|
1103
1200
|
);
|
|
1104
1201
|
}
|
|
1105
|
-
function
|
|
1202
|
+
function bt({ className: t, ...e }) {
|
|
1106
1203
|
return /* @__PURE__ */ a(
|
|
1107
1204
|
"ul",
|
|
1108
1205
|
{
|
|
1109
1206
|
"data-slot": "sidebar-menu",
|
|
1110
1207
|
"data-sidebar": "menu",
|
|
1111
|
-
className:
|
|
1208
|
+
className: h(
|
|
1112
1209
|
"astw:flex astw:w-full astw:min-w-0 astw:flex-col astw:gap-1",
|
|
1113
1210
|
t
|
|
1114
1211
|
),
|
|
@@ -1116,18 +1213,18 @@ function Ut({ className: t, ...e }) {
|
|
|
1116
1213
|
}
|
|
1117
1214
|
);
|
|
1118
1215
|
}
|
|
1119
|
-
function
|
|
1216
|
+
function I({ className: t, ...e }) {
|
|
1120
1217
|
return /* @__PURE__ */ a(
|
|
1121
1218
|
"li",
|
|
1122
1219
|
{
|
|
1123
1220
|
"data-slot": "sidebar-menu-item",
|
|
1124
1221
|
"data-sidebar": "menu-item",
|
|
1125
|
-
className:
|
|
1222
|
+
className: h("astw:group/menu-item astw:relative", t),
|
|
1126
1223
|
...e
|
|
1127
1224
|
}
|
|
1128
1225
|
);
|
|
1129
1226
|
}
|
|
1130
|
-
const
|
|
1227
|
+
const Na = ot(
|
|
1131
1228
|
"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
1229
|
{
|
|
1133
1230
|
variants: {
|
|
@@ -1147,7 +1244,7 @@ const sa = Z(
|
|
|
1147
1244
|
}
|
|
1148
1245
|
}
|
|
1149
1246
|
);
|
|
1150
|
-
function
|
|
1247
|
+
function z({
|
|
1151
1248
|
asChild: t = !1,
|
|
1152
1249
|
isActive: e = !1,
|
|
1153
1250
|
variant: s = "default",
|
|
@@ -1156,23 +1253,23 @@ function xt({
|
|
|
1156
1253
|
className: o,
|
|
1157
1254
|
...i
|
|
1158
1255
|
}) {
|
|
1159
|
-
const l = t ?
|
|
1256
|
+
const l = t ? j : "button", { isMobile: u, state: w } = K(), d = /* @__PURE__ */ a(
|
|
1160
1257
|
l,
|
|
1161
1258
|
{
|
|
1162
1259
|
"data-slot": "sidebar-menu-button",
|
|
1163
1260
|
"data-sidebar": "menu-button",
|
|
1164
1261
|
"data-size": r,
|
|
1165
1262
|
"data-active": e,
|
|
1166
|
-
className:
|
|
1263
|
+
className: h(Na({ variant: s, size: r }), o),
|
|
1167
1264
|
...i
|
|
1168
1265
|
}
|
|
1169
1266
|
);
|
|
1170
1267
|
return n ? (typeof n == "string" && (n = {
|
|
1171
1268
|
children: n
|
|
1172
|
-
}), /* @__PURE__ */
|
|
1173
|
-
/* @__PURE__ */ a(
|
|
1269
|
+
}), /* @__PURE__ */ c(mt, { children: [
|
|
1270
|
+
/* @__PURE__ */ a(ft, { asChild: !0, children: d }),
|
|
1174
1271
|
/* @__PURE__ */ a(
|
|
1175
|
-
|
|
1272
|
+
pt,
|
|
1176
1273
|
{
|
|
1177
1274
|
side: "right",
|
|
1178
1275
|
align: "center",
|
|
@@ -1180,20 +1277,20 @@ function xt({
|
|
|
1180
1277
|
...n
|
|
1181
1278
|
}
|
|
1182
1279
|
)
|
|
1183
|
-
] })) :
|
|
1280
|
+
] })) : d;
|
|
1184
1281
|
}
|
|
1185
|
-
function
|
|
1282
|
+
function q({
|
|
1186
1283
|
className: t,
|
|
1187
1284
|
asChild: e = !1,
|
|
1188
1285
|
showOnHover: s = !1,
|
|
1189
1286
|
...r
|
|
1190
1287
|
}) {
|
|
1191
1288
|
return /* @__PURE__ */ a(
|
|
1192
|
-
e ?
|
|
1289
|
+
e ? j : "button",
|
|
1193
1290
|
{
|
|
1194
1291
|
"data-slot": "sidebar-menu-action",
|
|
1195
1292
|
"data-sidebar": "menu-action",
|
|
1196
|
-
className:
|
|
1293
|
+
className: h(
|
|
1197
1294
|
"astw:text-sidebar-foreground astw:ring-sidebar-ring astw:hover:bg-sidebar-accent astw:hover:text-sidebar-accent-foreground astw:peer-hover/menu-button:text-sidebar-accent-foreground astw:absolute astw:top-1.5 astw:right-1 astw:flex astw:aspect-square astw:w-5 astw:items-center astw:justify-center astw:rounded-md astw:p-0 astw:outline-hidden astw:transition-transform astw:focus-visible:ring-2 astw:[&>svg]:size-4 astw:[&>svg]:shrink-0",
|
|
1198
1295
|
// Increases the hit area of the button on mobile.
|
|
1199
1296
|
"astw:after:absolute astw:after:-inset-2 astw:md:after:hidden",
|
|
@@ -1208,14 +1305,14 @@ function vt({
|
|
|
1208
1305
|
}
|
|
1209
1306
|
);
|
|
1210
1307
|
}
|
|
1211
|
-
function
|
|
1308
|
+
function at({ className: t, ...e }) {
|
|
1212
1309
|
return /* @__PURE__ */ a(
|
|
1213
1310
|
"ul",
|
|
1214
1311
|
{
|
|
1215
1312
|
"data-slot": "sidebar-menu-sub",
|
|
1216
1313
|
"data-sidebar": "menu-sub",
|
|
1217
|
-
className:
|
|
1218
|
-
"astw:border-sidebar-border astw:
|
|
1314
|
+
className: h(
|
|
1315
|
+
"astw:border-sidebar-border astw:ml-3.5 astw:mr-0 astw:flex astw:min-w-0 astw:translate-x-px astw:flex-col astw:gap-1 astw:border-l astw:pl-2.5 astw:pr-0 astw:py-0.5",
|
|
1219
1316
|
"astw:group-data-[collapsible=icon]:hidden",
|
|
1220
1317
|
t
|
|
1221
1318
|
),
|
|
@@ -1223,7 +1320,7 @@ function ra({ className: t, ...e }) {
|
|
|
1223
1320
|
}
|
|
1224
1321
|
);
|
|
1225
1322
|
}
|
|
1226
|
-
function
|
|
1323
|
+
function Sa({
|
|
1227
1324
|
className: t,
|
|
1228
1325
|
...e
|
|
1229
1326
|
}) {
|
|
@@ -1232,12 +1329,12 @@ function na({
|
|
|
1232
1329
|
{
|
|
1233
1330
|
"data-slot": "sidebar-menu-sub-item",
|
|
1234
1331
|
"data-sidebar": "menu-sub-item",
|
|
1235
|
-
className:
|
|
1332
|
+
className: h("astw:group/menu-sub-item astw:relative", t),
|
|
1236
1333
|
...e
|
|
1237
1334
|
}
|
|
1238
1335
|
);
|
|
1239
1336
|
}
|
|
1240
|
-
function
|
|
1337
|
+
function Ca({
|
|
1241
1338
|
asChild: t = !1,
|
|
1242
1339
|
size: e = "md",
|
|
1243
1340
|
isActive: s = !1,
|
|
@@ -1245,13 +1342,13 @@ function oa({
|
|
|
1245
1342
|
...n
|
|
1246
1343
|
}) {
|
|
1247
1344
|
return /* @__PURE__ */ a(
|
|
1248
|
-
t ?
|
|
1345
|
+
t ? j : "a",
|
|
1249
1346
|
{
|
|
1250
1347
|
"data-slot": "sidebar-menu-sub-button",
|
|
1251
1348
|
"data-sidebar": "menu-sub-button",
|
|
1252
1349
|
"data-size": e,
|
|
1253
1350
|
"data-active": s,
|
|
1254
|
-
className:
|
|
1351
|
+
className: h(
|
|
1255
1352
|
"astw:text-sidebar-foreground astw:ring-sidebar-ring astw:hover:bg-sidebar-accent astw:hover:text-sidebar-accent-foreground astw:active:bg-sidebar-accent astw:active:text-sidebar-accent-foreground astw:[&>svg]:text-sidebar-accent-foreground astw:flex astw:h-7 astw:min-w-0 astw:-translate-x-px astw:items-center astw:gap-2 astw:overflow-hidden astw:rounded-md astw:px-2 astw:outline-hidden astw:focus-visible:ring-2 astw:disabled:pointer-events-none astw:disabled:opacity-50 astw:aria-disabled:pointer-events-none astw:aria-disabled:opacity-50 astw:[&>span:last-child]:truncate astw:group-data-[collapsible=icon]:[&>span:last-child]:hidden astw:[&>svg]:size-4 astw:[&>svg]:shrink-0",
|
|
1256
1353
|
"astw:data-[active=true]:bg-sidebar-accent astw:data-[active=true]:text-sidebar-accent-foreground",
|
|
1257
1354
|
e === "sm" && "astw:text-xs",
|
|
@@ -1263,22 +1360,265 @@ function oa({
|
|
|
1263
1360
|
}
|
|
1264
1361
|
);
|
|
1265
1362
|
}
|
|
1266
|
-
function
|
|
1363
|
+
function O({ to: t, children: e, ...s }) {
|
|
1267
1364
|
try {
|
|
1268
|
-
return
|
|
1365
|
+
return ve(t), /* @__PURE__ */ a(ye, { to: t, ...s, children: e });
|
|
1269
1366
|
} catch {
|
|
1270
1367
|
return /* @__PURE__ */ a("a", { href: t, ...s, children: e });
|
|
1271
1368
|
}
|
|
1272
1369
|
}
|
|
1273
|
-
|
|
1370
|
+
const Ta = (t) => {
|
|
1371
|
+
const { configurations: e } = C(), { modules: s, locale: r } = e;
|
|
1372
|
+
return ka(t) ? null : Ra(t, s, r);
|
|
1373
|
+
}, ka = (t) => t.startsWith("http://") || t.startsWith("https://"), Ra = (t, e, s) => {
|
|
1374
|
+
const r = U(s), n = At(t);
|
|
1375
|
+
for (const o of e) {
|
|
1376
|
+
const i = At(o.path);
|
|
1377
|
+
if (re(n, i))
|
|
1378
|
+
return {
|
|
1379
|
+
title: r(o.meta.title, o.path),
|
|
1380
|
+
icon: o.meta.icon
|
|
1381
|
+
};
|
|
1382
|
+
const l = ne(
|
|
1383
|
+
n,
|
|
1384
|
+
i,
|
|
1385
|
+
o.resources,
|
|
1386
|
+
r
|
|
1387
|
+
);
|
|
1388
|
+
if (l)
|
|
1389
|
+
return l;
|
|
1390
|
+
}
|
|
1391
|
+
return null;
|
|
1392
|
+
}, re = (t, e) => {
|
|
1393
|
+
if (t === e) return !0;
|
|
1394
|
+
const s = t.split("/"), r = e.split("/");
|
|
1395
|
+
return s.length !== r.length ? !1 : r.every(
|
|
1396
|
+
(n, o) => n.startsWith(":") || n === s[o]
|
|
1397
|
+
);
|
|
1398
|
+
}, At = (t) => {
|
|
1399
|
+
let e = t;
|
|
1400
|
+
return e.startsWith("/") || (e = `/${e}`), e.length > 1 && e.endsWith("/") && (e = e.slice(0, -1)), e;
|
|
1401
|
+
}, ne = (t, e, s, r) => {
|
|
1402
|
+
for (const n of s) {
|
|
1403
|
+
const o = `${e}/${n.path}`;
|
|
1404
|
+
if (re(t, o))
|
|
1405
|
+
return {
|
|
1406
|
+
title: r(n.meta.title, n.path),
|
|
1407
|
+
icon: n.meta.icon
|
|
1408
|
+
};
|
|
1409
|
+
if (n.subResources) {
|
|
1410
|
+
const i = ne(
|
|
1411
|
+
t,
|
|
1412
|
+
o,
|
|
1413
|
+
n.subResources,
|
|
1414
|
+
r
|
|
1415
|
+
);
|
|
1416
|
+
if (i)
|
|
1417
|
+
return i;
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
1420
|
+
return null;
|
|
1421
|
+
}, Fs = (t) => {
|
|
1422
|
+
const {
|
|
1423
|
+
to: e,
|
|
1424
|
+
external: s,
|
|
1425
|
+
render: r,
|
|
1426
|
+
activeMatch: n = "prefix",
|
|
1427
|
+
title: o,
|
|
1428
|
+
icon: i
|
|
1429
|
+
} = t, { pathname: l } = Y(), u = Ta(e), w = n === "exact" ? l === e : l === e || l.startsWith(`${e}/`), d = o ?? u?.title ?? Pa(e), m = i ?? u?.icon, f = {
|
|
1430
|
+
title: d,
|
|
1431
|
+
url: e,
|
|
1432
|
+
icon: m,
|
|
1433
|
+
isActive: w
|
|
1434
|
+
};
|
|
1435
|
+
return s || oe(e) ? /* @__PURE__ */ a(I, { children: /* @__PURE__ */ a(z, { asChild: !0, tooltip: d, children: /* @__PURE__ */ a(
|
|
1436
|
+
"a",
|
|
1437
|
+
{
|
|
1438
|
+
href: e,
|
|
1439
|
+
target: "_blank",
|
|
1440
|
+
rel: "noopener noreferrer",
|
|
1441
|
+
className: w ? "astw:bg-sidebar-accent astw:font-medium" : void 0,
|
|
1442
|
+
children: r ? r(f) : /* @__PURE__ */ c(S, { children: [
|
|
1443
|
+
m ?? /* @__PURE__ */ a($t, { className: "astw:size-4" }),
|
|
1444
|
+
/* @__PURE__ */ a("span", { children: d })
|
|
1445
|
+
] })
|
|
1446
|
+
}
|
|
1447
|
+
) }) }) : /* @__PURE__ */ a(I, { children: /* @__PURE__ */ a(z, { asChild: !0, tooltip: d, children: /* @__PURE__ */ a(
|
|
1448
|
+
O,
|
|
1449
|
+
{
|
|
1450
|
+
to: e,
|
|
1451
|
+
className: w ? "astw:bg-sidebar-accent astw:font-medium" : void 0,
|
|
1452
|
+
children: r ? r(f) : /* @__PURE__ */ c(S, { children: [
|
|
1453
|
+
m,
|
|
1454
|
+
/* @__PURE__ */ a("span", { children: d })
|
|
1455
|
+
] })
|
|
1456
|
+
}
|
|
1457
|
+
) }) });
|
|
1458
|
+
}, oe = (t) => t.startsWith("http://") || t.startsWith("https://"), Pa = (t) => {
|
|
1459
|
+
if (oe(t))
|
|
1460
|
+
try {
|
|
1461
|
+
return new URL(t).hostname;
|
|
1462
|
+
} catch {
|
|
1463
|
+
return t;
|
|
1464
|
+
}
|
|
1465
|
+
const e = t.split("/").filter(Boolean);
|
|
1466
|
+
return (e[e.length - 1] ?? t).split("-").map((r) => r.charAt(0).toUpperCase() + r.slice(1)).join(" ");
|
|
1467
|
+
};
|
|
1468
|
+
function st({
|
|
1469
|
+
...t
|
|
1470
|
+
}) {
|
|
1471
|
+
return /* @__PURE__ */ a(lt.Root, { "data-slot": "collapsible", ...t });
|
|
1472
|
+
}
|
|
1473
|
+
function Q({
|
|
1474
|
+
...t
|
|
1475
|
+
}) {
|
|
1476
|
+
return /* @__PURE__ */ a(
|
|
1477
|
+
lt.CollapsibleTrigger,
|
|
1478
|
+
{
|
|
1479
|
+
"data-slot": "collapsible-trigger",
|
|
1480
|
+
...t
|
|
1481
|
+
}
|
|
1482
|
+
);
|
|
1483
|
+
}
|
|
1484
|
+
function rt({
|
|
1485
|
+
...t
|
|
1486
|
+
}) {
|
|
1487
|
+
return /* @__PURE__ */ a(
|
|
1488
|
+
lt.CollapsibleContent,
|
|
1489
|
+
{
|
|
1490
|
+
"data-slot": "collapsible-content",
|
|
1491
|
+
...t
|
|
1492
|
+
}
|
|
1493
|
+
);
|
|
1494
|
+
}
|
|
1495
|
+
const Os = (t) => {
|
|
1496
|
+
const { title: e, icon: s, to: r, defaultOpen: n = !0, children: o } = t, { pathname: i } = Y(), { configurations: l } = C(), u = U(l.locale), w = A(), d = u(e, typeof e == "string" ? e : ""), m = r ? i === r : !1;
|
|
1497
|
+
return r ? /* @__PURE__ */ a(st, { asChild: !0, defaultOpen: n, children: /* @__PURE__ */ c(I, { children: [
|
|
1498
|
+
/* @__PURE__ */ a(z, { asChild: !0, tooltip: d, children: /* @__PURE__ */ c(
|
|
1499
|
+
O,
|
|
1500
|
+
{
|
|
1501
|
+
to: r,
|
|
1502
|
+
className: m ? "astw:bg-sidebar-accent astw:font-medium" : void 0,
|
|
1503
|
+
children: [
|
|
1504
|
+
s,
|
|
1505
|
+
/* @__PURE__ */ a("span", { children: d })
|
|
1506
|
+
]
|
|
1507
|
+
}
|
|
1508
|
+
) }),
|
|
1509
|
+
/* @__PURE__ */ a(Q, { asChild: !0, children: /* @__PURE__ */ c(q, { className: "astw:data-[state=open]:rotate-90", children: [
|
|
1510
|
+
/* @__PURE__ */ a($, {}),
|
|
1511
|
+
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: w("toggle") })
|
|
1512
|
+
] }) }),
|
|
1513
|
+
/* @__PURE__ */ a(rt, { children: /* @__PURE__ */ a(at, { children: o }) })
|
|
1514
|
+
] }) }) : /* @__PURE__ */ a(st, { asChild: !0, defaultOpen: n, children: /* @__PURE__ */ c(I, { children: [
|
|
1515
|
+
/* @__PURE__ */ c(Q, { className: "astw:flex astw:w-[100%] astw:[&[data-state=open]_.astw-rotate-target]:rotate-90", children: [
|
|
1516
|
+
/* @__PURE__ */ a(z, { asChild: !0, tooltip: d, children: /* @__PURE__ */ c("span", { className: "astw:flex astw:w-[100%]", children: [
|
|
1517
|
+
s,
|
|
1518
|
+
/* @__PURE__ */ a("span", { children: d })
|
|
1519
|
+
] }) }),
|
|
1520
|
+
/* @__PURE__ */ a(q, { className: "astw-rotate-target", asChild: !0, children: /* @__PURE__ */ c("span", { children: [
|
|
1521
|
+
/* @__PURE__ */ a($, {}),
|
|
1522
|
+
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: w("toggle") })
|
|
1523
|
+
] }) })
|
|
1524
|
+
] }),
|
|
1525
|
+
/* @__PURE__ */ a(rt, { children: /* @__PURE__ */ a(at, { children: o }) })
|
|
1526
|
+
] }) });
|
|
1527
|
+
}, js = () => /* @__PURE__ */ a(va, {}), Aa = (t) => {
|
|
1528
|
+
const { title: e, icon: s } = C(), { pathname: r } = Y(), { isIconMode: n } = K(), o = /* @__PURE__ */ c(xa, { children: [
|
|
1529
|
+
s,
|
|
1530
|
+
/* @__PURE__ */ a(
|
|
1531
|
+
"h1",
|
|
1532
|
+
{
|
|
1533
|
+
className: h(
|
|
1534
|
+
"astw:text-sm astw:mb-2 astw:mt-2 astw:px-2",
|
|
1535
|
+
n && "astw:hidden"
|
|
1536
|
+
),
|
|
1537
|
+
children: e
|
|
1538
|
+
}
|
|
1539
|
+
)
|
|
1540
|
+
] });
|
|
1541
|
+
return /* @__PURE__ */ c(ga, { variant: "inset", collapsible: n ? "icon" : "offcanvas", children: [
|
|
1542
|
+
!n && /* @__PURE__ */ c("div", { className: "astw:flex astw:justify-between astw:items-center", children: [
|
|
1543
|
+
t.header ?? o,
|
|
1544
|
+
/* @__PURE__ */ a("div", { className: "astw:hidden astw:md:block", children: /* @__PURE__ */ a(se, { className: "astw:-ml-1" }) })
|
|
1545
|
+
] }),
|
|
1546
|
+
/* @__PURE__ */ a(ya, { children: t.children ? (
|
|
1547
|
+
// New API: children-based explicit definition
|
|
1548
|
+
/* @__PURE__ */ a(gt, { children: /* @__PURE__ */ a(bt, { children: t.children }) })
|
|
1549
|
+
) : (
|
|
1550
|
+
// Existing behavior: auto-generation from resources
|
|
1551
|
+
/* @__PURE__ */ a(it, { fallback: /* @__PURE__ */ a(Da, {}), children: /* @__PURE__ */ a(Ea, { currentPath: r }) })
|
|
1552
|
+
) }),
|
|
1553
|
+
t.footer ?? null
|
|
1554
|
+
] });
|
|
1555
|
+
}, Ea = ({ currentPath: t }) => {
|
|
1556
|
+
const e = Qt();
|
|
1557
|
+
return /* @__PURE__ */ a(zt, { resolve: e, children: (s) => /* @__PURE__ */ a(Ma, { items: s ?? [], currentPath: t }) });
|
|
1558
|
+
}, Ma = (t) => {
|
|
1559
|
+
const e = A();
|
|
1560
|
+
return /* @__PURE__ */ a(gt, { children: /* @__PURE__ */ a(bt, { children: t.items.map((s) => /* @__PURE__ */ a(st, { asChild: !0, defaultOpen: !0, children: /* @__PURE__ */ c(I, { children: [
|
|
1561
|
+
s.url ? /* @__PURE__ */ c(S, { children: [
|
|
1562
|
+
/* @__PURE__ */ a(z, { asChild: !0, tooltip: s.title, children: /* @__PURE__ */ c(
|
|
1563
|
+
O,
|
|
1564
|
+
{
|
|
1565
|
+
to: s.url,
|
|
1566
|
+
className: s.url === t.currentPath ? "astw:bg-sidebar-accent astw:font-medium" : void 0,
|
|
1567
|
+
children: [
|
|
1568
|
+
s.icon,
|
|
1569
|
+
/* @__PURE__ */ a("span", { children: s.title })
|
|
1570
|
+
]
|
|
1571
|
+
}
|
|
1572
|
+
) }),
|
|
1573
|
+
!!s.items?.length && /* @__PURE__ */ a(Q, { asChild: !0, children: /* @__PURE__ */ c(q, { className: "astw:data-[state=open]:rotate-90", children: [
|
|
1574
|
+
/* @__PURE__ */ a($, {}),
|
|
1575
|
+
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: e("toggle") })
|
|
1576
|
+
] }) })
|
|
1577
|
+
] }) : /* @__PURE__ */ a(S, { children: /* @__PURE__ */ c(Q, { className: "astw:flex astw:w-full astw:[&[data-state=open]_.astw-rotate-target]:rotate-90", children: [
|
|
1578
|
+
/* @__PURE__ */ a(z, { asChild: !0, tooltip: s.title, children: /* @__PURE__ */ c("span", { className: "astw:flex astw:w-full", children: [
|
|
1579
|
+
s.icon,
|
|
1580
|
+
/* @__PURE__ */ a("span", { children: s.title })
|
|
1581
|
+
] }) }),
|
|
1582
|
+
!!s.items?.length && /* @__PURE__ */ a(
|
|
1583
|
+
q,
|
|
1584
|
+
{
|
|
1585
|
+
className: "astw-rotate-target",
|
|
1586
|
+
asChild: !0,
|
|
1587
|
+
children: /* @__PURE__ */ c("span", { children: [
|
|
1588
|
+
/* @__PURE__ */ a($, {}),
|
|
1589
|
+
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: e("toggle") })
|
|
1590
|
+
] })
|
|
1591
|
+
}
|
|
1592
|
+
)
|
|
1593
|
+
] }) }),
|
|
1594
|
+
!!s.items?.length && /* @__PURE__ */ a(rt, { children: /* @__PURE__ */ a(at, { children: s.items?.map((r) => /* @__PURE__ */ a(Sa, { children: /* @__PURE__ */ a(Ca, { asChild: !0, children: /* @__PURE__ */ a(
|
|
1595
|
+
O,
|
|
1596
|
+
{
|
|
1597
|
+
to: r.url,
|
|
1598
|
+
className: r.url === t.currentPath ? "astw:bg-sidebar-accent astw:font-medium" : void 0,
|
|
1599
|
+
children: /* @__PURE__ */ a("span", { children: r.title })
|
|
1600
|
+
}
|
|
1601
|
+
) }) }, r.title)) }) })
|
|
1602
|
+
] }) }, s.title)) }) });
|
|
1603
|
+
}, Ba = [104, 80, 112, 88, 96, 100, 84, 92], Da = () => /* @__PURE__ */ a(gt, { children: /* @__PURE__ */ a(bt, { className: "astw:px-2", children: Ba.map((t, e) => /* @__PURE__ */ a(I, { children: /* @__PURE__ */ c("div", { className: "astw:flex astw:items-center astw:gap-2 astw:py-1.5", children: [
|
|
1604
|
+
/* @__PURE__ */ a("div", { className: "astw:h-4 astw:w-4 astw:rounded-md astw:bg-muted" }),
|
|
1605
|
+
/* @__PURE__ */ a(
|
|
1606
|
+
"div",
|
|
1607
|
+
{
|
|
1608
|
+
className: "astw:h-4 astw:rounded astw:bg-muted",
|
|
1609
|
+
style: { width: `${t}px` }
|
|
1610
|
+
}
|
|
1611
|
+
)
|
|
1612
|
+
] }) }, e)) }) });
|
|
1613
|
+
function Et({ ...t }) {
|
|
1274
1614
|
return /* @__PURE__ */ a("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...t });
|
|
1275
1615
|
}
|
|
1276
|
-
function
|
|
1616
|
+
function Mt({ className: t, ...e }) {
|
|
1277
1617
|
return /* @__PURE__ */ a(
|
|
1278
1618
|
"ol",
|
|
1279
1619
|
{
|
|
1280
1620
|
"data-slot": "breadcrumb-list",
|
|
1281
|
-
className:
|
|
1621
|
+
className: h(
|
|
1282
1622
|
"astw:text-muted-foreground astw:flex astw:flex-wrap astw:items-center astw:gap-1.5 astw:text-sm astw:break-words astw:sm:gap-2.5",
|
|
1283
1623
|
t
|
|
1284
1624
|
),
|
|
@@ -1286,33 +1626,33 @@ function Nt({ className: t, ...e }) {
|
|
|
1286
1626
|
}
|
|
1287
1627
|
);
|
|
1288
1628
|
}
|
|
1289
|
-
function
|
|
1629
|
+
function Bt({ className: t, ...e }) {
|
|
1290
1630
|
return /* @__PURE__ */ a(
|
|
1291
1631
|
"li",
|
|
1292
1632
|
{
|
|
1293
1633
|
"data-slot": "breadcrumb-item",
|
|
1294
|
-
className:
|
|
1634
|
+
className: h("astw:inline-flex astw:items-center astw:gap-1.5", t),
|
|
1295
1635
|
...e
|
|
1296
1636
|
}
|
|
1297
1637
|
);
|
|
1298
1638
|
}
|
|
1299
|
-
function
|
|
1639
|
+
function Dt({
|
|
1300
1640
|
asChild: t,
|
|
1301
1641
|
className: e,
|
|
1302
1642
|
children: s,
|
|
1303
1643
|
...r
|
|
1304
1644
|
}) {
|
|
1305
1645
|
return /* @__PURE__ */ a(
|
|
1306
|
-
t ?
|
|
1646
|
+
t ? j : O,
|
|
1307
1647
|
{
|
|
1308
1648
|
"data-slot": "breadcrumb-link",
|
|
1309
|
-
className:
|
|
1649
|
+
className: h("astw:hover:text-foreground astw:transition-colors", e),
|
|
1310
1650
|
...r,
|
|
1311
1651
|
children: s
|
|
1312
1652
|
}
|
|
1313
1653
|
);
|
|
1314
1654
|
}
|
|
1315
|
-
function
|
|
1655
|
+
function La({
|
|
1316
1656
|
children: t,
|
|
1317
1657
|
className: e,
|
|
1318
1658
|
...s
|
|
@@ -1323,40 +1663,42 @@ function ia({
|
|
|
1323
1663
|
"data-slot": "breadcrumb-separator",
|
|
1324
1664
|
role: "presentation",
|
|
1325
1665
|
"aria-hidden": "true",
|
|
1326
|
-
className:
|
|
1666
|
+
className: h("astw:[&>svg]:size-3.5", e),
|
|
1327
1667
|
...s,
|
|
1328
|
-
children: t ?? /* @__PURE__ */ a(
|
|
1668
|
+
children: t ?? /* @__PURE__ */ a($, {})
|
|
1329
1669
|
}
|
|
1330
1670
|
);
|
|
1331
1671
|
}
|
|
1332
|
-
function
|
|
1672
|
+
function Ia(t, e) {
|
|
1333
1673
|
if (!e.trim()) return t;
|
|
1334
1674
|
const s = e.toLowerCase();
|
|
1335
1675
|
return t.filter(
|
|
1336
1676
|
(r) => r.title.toLowerCase().includes(s) || r.path.toLowerCase().includes(s)
|
|
1337
1677
|
);
|
|
1338
1678
|
}
|
|
1339
|
-
const
|
|
1340
|
-
const s =
|
|
1679
|
+
const za = (t, e) => {
|
|
1680
|
+
const s = Ot(e);
|
|
1341
1681
|
return t.reduce(
|
|
1342
1682
|
(r, n) => {
|
|
1343
1683
|
const o = s(n.meta.title, n.path);
|
|
1344
1684
|
r[n.path] = {
|
|
1345
1685
|
title: o,
|
|
1686
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- breadcrumbTitle exists at runtime but not in CommonPageResource type
|
|
1346
1687
|
breadcrumbTitle: n.meta.breadcrumbTitle
|
|
1347
1688
|
};
|
|
1348
1689
|
const i = (l, u) => {
|
|
1349
1690
|
!l || l.length === 0 || l.forEach((w) => {
|
|
1350
|
-
const
|
|
1691
|
+
const d = `${u}/${w.path}`, m = s(
|
|
1351
1692
|
w.meta.title,
|
|
1352
1693
|
w.path
|
|
1353
1694
|
);
|
|
1354
|
-
r[
|
|
1355
|
-
title:
|
|
1695
|
+
r[d] = {
|
|
1696
|
+
title: m,
|
|
1697
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- breadcrumbTitle exists at runtime but not in CommonPageResource type
|
|
1356
1698
|
breadcrumbTitle: w.meta.breadcrumbTitle
|
|
1357
1699
|
}, w.subResources && w.subResources.length > 0 && i(
|
|
1358
1700
|
w.subResources,
|
|
1359
|
-
|
|
1701
|
+
d
|
|
1360
1702
|
);
|
|
1361
1703
|
});
|
|
1362
1704
|
};
|
|
@@ -1365,23 +1707,23 @@ const da = (t, e) => {
|
|
|
1365
1707
|
{}
|
|
1366
1708
|
);
|
|
1367
1709
|
};
|
|
1368
|
-
function
|
|
1369
|
-
const n = t.split("/").filter((u) => u !== ""), o = e && n[0] === e ? n.slice(1) : n, i =
|
|
1370
|
-
const
|
|
1371
|
-
let
|
|
1372
|
-
if (!
|
|
1373
|
-
const
|
|
1374
|
-
([
|
|
1375
|
-
const
|
|
1376
|
-
return new RegExp(`^${
|
|
1710
|
+
function _a(t, e, s, r) {
|
|
1711
|
+
const n = t.split("/").filter((u) => u !== ""), o = e && n[0] === e ? n.slice(1) : n, i = za(s, r), l = o.map((u, w) => {
|
|
1712
|
+
const d = o.slice(0, w + 1).join("/");
|
|
1713
|
+
let m = i[d];
|
|
1714
|
+
if (!m) {
|
|
1715
|
+
const g = Object.entries(i).find(
|
|
1716
|
+
([x]) => {
|
|
1717
|
+
const b = x.split("/").map((R) => R.startsWith(":") ? "[^/]+" : R).join("/");
|
|
1718
|
+
return new RegExp(`^${b}$`).test(d);
|
|
1377
1719
|
}
|
|
1378
1720
|
)?.[1];
|
|
1379
|
-
|
|
1721
|
+
g && (m = g);
|
|
1380
1722
|
}
|
|
1381
1723
|
let f;
|
|
1382
|
-
return
|
|
1724
|
+
return m ? typeof m.breadcrumbTitle == "function" ? f = m.breadcrumbTitle(u) : typeof m.breadcrumbTitle == "string" ? f = m.breadcrumbTitle : f = m.title : f = decodeURIComponent(u), {
|
|
1383
1725
|
segment: u,
|
|
1384
|
-
path:
|
|
1726
|
+
path: d,
|
|
1385
1727
|
title: f
|
|
1386
1728
|
};
|
|
1387
1729
|
});
|
|
@@ -1390,149 +1732,67 @@ function ca(t, e, s, r) {
|
|
|
1390
1732
|
segments: l
|
|
1391
1733
|
};
|
|
1392
1734
|
}
|
|
1393
|
-
const
|
|
1394
|
-
const {
|
|
1395
|
-
return
|
|
1396
|
-
}, hs = (t) => {
|
|
1397
|
-
const e = t.children ? t.children({ Outlet: ut }) : null, s = We(), r = () => {
|
|
1398
|
-
s.setTheme(s.theme === "dark" ? "light" : "dark");
|
|
1399
|
-
};
|
|
1400
|
-
return /* @__PURE__ */ a(Ze, { className: "astw:flex astw:flex-col", children: /* @__PURE__ */ d("div", { className: "astw:flex astw:flex-1", children: [
|
|
1401
|
-
t.sidebar ?? /* @__PURE__ */ a(ua, {}),
|
|
1402
|
-
/* @__PURE__ */ d(ta, { className: "astw:w-[calc(100%-var(--sidebar-width))]", children: [
|
|
1403
|
-
/* @__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
|
-
/* @__PURE__ */ d("div", { className: "astw:flex astw:items-center astw:gap-2", children: [
|
|
1405
|
-
/* @__PURE__ */ a(wa, {}),
|
|
1406
|
-
/* @__PURE__ */ a(ga, {})
|
|
1407
|
-
] }),
|
|
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(me, {}) }) })
|
|
1409
|
-
] }) }),
|
|
1410
|
-
/* @__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
|
-
] })
|
|
1412
|
-
] }) });
|
|
1413
|
-
}, ua = (t) => {
|
|
1414
|
-
const { title: e, icon: s } = A(), { pathname: r } = Et(), { isIconMode: n } = F(), o = /* @__PURE__ */ d(ea, { children: [
|
|
1415
|
-
s,
|
|
1416
|
-
/* @__PURE__ */ a(
|
|
1417
|
-
"h1",
|
|
1418
|
-
{
|
|
1419
|
-
className: m(
|
|
1420
|
-
"astw:text-sm astw:mb-2 astw:mt-2 astw:px-2",
|
|
1421
|
-
n && "astw:hidden"
|
|
1422
|
-
),
|
|
1423
|
-
children: e
|
|
1424
|
-
}
|
|
1425
|
-
)
|
|
1426
|
-
] });
|
|
1427
|
-
return /* @__PURE__ */ d(Je, { variant: "inset", collapsible: n ? "icon" : "offcanvas", children: [
|
|
1428
|
-
!n && /* @__PURE__ */ d("div", { className: "astw:flex astw:justify-between astw:items-center", children: [
|
|
1429
|
-
t.header ?? o,
|
|
1430
|
-
/* @__PURE__ */ a("div", { className: "astw:hidden astw:md:block", children: /* @__PURE__ */ a(Kt, { className: "astw:-ml-1" }) })
|
|
1431
|
-
] }),
|
|
1432
|
-
/* @__PURE__ */ a(aa, { children: /* @__PURE__ */ a(Dt, { fallback: /* @__PURE__ */ a(fa, {}), children: /* @__PURE__ */ a(ma, { currentPath: r }) }) }),
|
|
1433
|
-
t.footer ?? null
|
|
1434
|
-
] });
|
|
1435
|
-
}, ma = ({ currentPath: t }) => {
|
|
1436
|
-
const e = Ft();
|
|
1437
|
-
return /* @__PURE__ */ a(Bt, { resolve: e, children: (s) => /* @__PURE__ */ a(ha, { items: s ?? [], currentPath: t }) });
|
|
1438
|
-
}, ha = (t) => {
|
|
1439
|
-
const e = D();
|
|
1440
|
-
return /* @__PURE__ */ a(Vt, { children: /* @__PURE__ */ a(Ut, { children: t.items.map((s) => /* @__PURE__ */ a(je, { asChild: !0, defaultOpen: !0, children: /* @__PURE__ */ d(Ht, { children: [
|
|
1441
|
-
s.url ? /* @__PURE__ */ d(E, { children: [
|
|
1442
|
-
/* @__PURE__ */ a(xt, { asChild: !0, tooltip: s.title, children: /* @__PURE__ */ d(
|
|
1443
|
-
Y,
|
|
1444
|
-
{
|
|
1445
|
-
to: s.url,
|
|
1446
|
-
className: s.url === t.currentPath ? "astw:bg-sidebar-accent astw:font-medium" : void 0,
|
|
1447
|
-
children: [
|
|
1448
|
-
s.icon,
|
|
1449
|
-
/* @__PURE__ */ a("span", { children: s.title })
|
|
1450
|
-
]
|
|
1451
|
-
}
|
|
1452
|
-
) }),
|
|
1453
|
-
!!s.items?.length && /* @__PURE__ */ a(mt, { asChild: !0, children: /* @__PURE__ */ d(vt, { className: "astw:data-[state=open]:rotate-90", children: [
|
|
1454
|
-
/* @__PURE__ */ a(Q, {}),
|
|
1455
|
-
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: e("toggle") })
|
|
1456
|
-
] }) })
|
|
1457
|
-
] }) : /* @__PURE__ */ a(E, { children: /* @__PURE__ */ d(mt, { className: "astw:flex astw:w-[100%] astw:[&[data-state=open]_.astw-rotate-target]:rotate-90", children: [
|
|
1458
|
-
/* @__PURE__ */ a(xt, { asChild: !0, tooltip: s.title, children: /* @__PURE__ */ d("span", { className: "astw:flex astw:w-[100%]", children: [
|
|
1459
|
-
s.icon,
|
|
1460
|
-
/* @__PURE__ */ a("span", { children: s.title })
|
|
1461
|
-
] }) }),
|
|
1462
|
-
!!s.items?.length && /* @__PURE__ */ a(
|
|
1463
|
-
vt,
|
|
1464
|
-
{
|
|
1465
|
-
className: "astw-rotate-target",
|
|
1466
|
-
asChild: !0,
|
|
1467
|
-
children: /* @__PURE__ */ d("span", { children: [
|
|
1468
|
-
/* @__PURE__ */ a(Q, {}),
|
|
1469
|
-
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: e("toggle") })
|
|
1470
|
-
] })
|
|
1471
|
-
}
|
|
1472
|
-
)
|
|
1473
|
-
] }) }),
|
|
1474
|
-
!!s.items?.length && /* @__PURE__ */ a(Ke, { children: /* @__PURE__ */ a(ra, { children: s.items?.map((r) => /* @__PURE__ */ a(na, { children: /* @__PURE__ */ a(oa, { asChild: !0, children: /* @__PURE__ */ a(
|
|
1475
|
-
Y,
|
|
1476
|
-
{
|
|
1477
|
-
to: r.url,
|
|
1478
|
-
className: r.url === t.currentPath ? "astw:bg-sidebar-accent astw:font-medium" : void 0,
|
|
1479
|
-
children: /* @__PURE__ */ a("span", { children: r.title })
|
|
1480
|
-
}
|
|
1481
|
-
) }) }, r.title)) }) })
|
|
1482
|
-
] }) }, s.title)) }) });
|
|
1483
|
-
}, fa = () => {
|
|
1484
|
-
const e = [...[112, 96, 80, 104, 88, 100, 92, 84]].sort(() => Math.random() - 0.5);
|
|
1485
|
-
return /* @__PURE__ */ a(Vt, { children: /* @__PURE__ */ a(Ut, { className: "astw:px-2", children: e.map((s, r) => /* @__PURE__ */ a(Ht, { children: /* @__PURE__ */ d("div", { className: "astw:flex astw:items-center astw:gap-2 astw:py-1.5", children: [
|
|
1486
|
-
/* @__PURE__ */ a("div", { className: "astw:h-4 astw:w-4 astw:rounded-md astw:bg-muted" }),
|
|
1487
|
-
/* @__PURE__ */ a(
|
|
1488
|
-
"div",
|
|
1489
|
-
{
|
|
1490
|
-
className: "astw:h-4 astw:rounded astw:bg-muted",
|
|
1491
|
-
style: { width: `${s}px` }
|
|
1492
|
-
}
|
|
1493
|
-
)
|
|
1494
|
-
] }) }, r)) }) });
|
|
1495
|
-
}, pa = () => {
|
|
1496
|
-
const { configurations: t } = A(), e = Et();
|
|
1497
|
-
return ca(
|
|
1735
|
+
const $a = () => {
|
|
1736
|
+
const { configurations: t } = C(), e = Y();
|
|
1737
|
+
return _a(
|
|
1498
1738
|
e.pathname,
|
|
1499
1739
|
t.basePath,
|
|
1500
1740
|
t.modules,
|
|
1501
1741
|
t.locale
|
|
1502
1742
|
);
|
|
1503
|
-
},
|
|
1504
|
-
const { segments: t } =
|
|
1505
|
-
return e ? /* @__PURE__ */ a(
|
|
1743
|
+
}, Wa = () => {
|
|
1744
|
+
const { segments: t } = $a(), e = Ne("/:prefix/settings/:suffix"), s = A();
|
|
1745
|
+
return e ? /* @__PURE__ */ a(Et, { children: /* @__PURE__ */ a(Mt, { children: /* @__PURE__ */ a("div", { className: "astw:inline-flex astw:items-center astw:gap-3 astw:last:text-foreground", children: /* @__PURE__ */ a(Bt, { children: /* @__PURE__ */ a(Dt, { to: `/${e.params.prefix}/settings`, children: s("settings") }) }) }) }) }) : /* @__PURE__ */ a(Et, { children: /* @__PURE__ */ a(Mt, { children: t.map((r, n) => /* @__PURE__ */ c(
|
|
1506
1746
|
"div",
|
|
1507
1747
|
{
|
|
1508
1748
|
className: "astw:inline-flex astw:items-center astw:gap-3 astw:last:text-foreground",
|
|
1509
1749
|
children: [
|
|
1510
|
-
/* @__PURE__ */ a(
|
|
1511
|
-
n < t.length - 1 && /* @__PURE__ */ a(
|
|
1750
|
+
/* @__PURE__ */ a(Bt, { children: /* @__PURE__ */ a(Dt, { to: r.path, children: r.title }) }),
|
|
1751
|
+
n < t.length - 1 && /* @__PURE__ */ a(La, {})
|
|
1512
1752
|
]
|
|
1513
1753
|
},
|
|
1514
1754
|
n
|
|
1515
1755
|
)) }) });
|
|
1756
|
+
}, Fa = () => {
|
|
1757
|
+
const { open: t, isIconMode: e } = K();
|
|
1758
|
+
return /* @__PURE__ */ a("div", { className: t && !e ? "astw:md:hidden" : void 0, children: /* @__PURE__ */ a(se, { className: "astw:-ml-2.5" }) });
|
|
1759
|
+
}, Us = (t) => {
|
|
1760
|
+
const e = t.children ? t.children({ Outlet: Nt }) : null, s = Je(), r = () => {
|
|
1761
|
+
s.setTheme(s.theme === "dark" ? "light" : "dark");
|
|
1762
|
+
};
|
|
1763
|
+
return /* @__PURE__ */ a(pa, { className: "astw:flex astw:flex-col", children: /* @__PURE__ */ c("div", { className: "astw:flex astw:flex-1", children: [
|
|
1764
|
+
t.sidebar ?? /* @__PURE__ */ a(Aa, {}),
|
|
1765
|
+
/* @__PURE__ */ c(ba, { className: "astw:w-[calc(100%-var(--sidebar-width))]", children: [
|
|
1766
|
+
/* @__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__ */ c("div", { className: "astw:flex astw:w-full astw:items-center astw:justify-between", children: [
|
|
1767
|
+
/* @__PURE__ */ c("div", { className: "astw:flex astw:items-center astw:gap-2", children: [
|
|
1768
|
+
/* @__PURE__ */ a(Fa, {}),
|
|
1769
|
+
/* @__PURE__ */ a(Wa, {})
|
|
1770
|
+
] }),
|
|
1771
|
+
/* @__PURE__ */ a("div", { className: "astw:flex astw:items-center astw:gap-2", children: /* @__PURE__ */ a(F, { variant: "outline", size: "icon", onClick: r, children: /* @__PURE__ */ a(Pe, {}) }) })
|
|
1772
|
+
] }) }),
|
|
1773
|
+
/* @__PURE__ */ a("div", { className: "astw:flex astw:flex-col astw:gap-4 astw:flex-1 astw:min-h-0", children: e ?? /* @__PURE__ */ a(Nt, {}) })
|
|
1774
|
+
] })
|
|
1775
|
+
] }) });
|
|
1516
1776
|
};
|
|
1517
|
-
function
|
|
1777
|
+
function Oa({
|
|
1518
1778
|
...t
|
|
1519
1779
|
}) {
|
|
1520
|
-
return /* @__PURE__ */ a(
|
|
1780
|
+
return /* @__PURE__ */ a(v.Root, { "data-slot": "dialog", ...t });
|
|
1521
1781
|
}
|
|
1522
|
-
function
|
|
1782
|
+
function ja({
|
|
1523
1783
|
...t
|
|
1524
1784
|
}) {
|
|
1525
|
-
return /* @__PURE__ */ a(
|
|
1785
|
+
return /* @__PURE__ */ a(v.Portal, { "data-slot": "dialog-portal", ...t });
|
|
1526
1786
|
}
|
|
1527
|
-
function
|
|
1787
|
+
function Ua({
|
|
1528
1788
|
className: t,
|
|
1529
1789
|
...e
|
|
1530
1790
|
}) {
|
|
1531
1791
|
return /* @__PURE__ */ a(
|
|
1532
|
-
|
|
1792
|
+
v.Overlay,
|
|
1533
1793
|
{
|
|
1534
1794
|
"data-slot": "dialog-overlay",
|
|
1535
|
-
className:
|
|
1795
|
+
className: h(
|
|
1536
1796
|
"astw:data-[state=open]:animate-in astw:data-[state=closed]:animate-out astw:data-[state=closed]:fade-out-0 astw:data-[state=open]:fade-in-0 astw:fixed astw:inset-0 astw:z-50 astw:bg-black/50",
|
|
1537
1797
|
t
|
|
1538
1798
|
),
|
|
@@ -1540,26 +1800,26 @@ function va({
|
|
|
1540
1800
|
}
|
|
1541
1801
|
);
|
|
1542
1802
|
}
|
|
1543
|
-
function
|
|
1803
|
+
function Ka({
|
|
1544
1804
|
className: t,
|
|
1545
1805
|
children: e,
|
|
1546
1806
|
...s
|
|
1547
1807
|
}) {
|
|
1548
|
-
return /* @__PURE__ */
|
|
1549
|
-
/* @__PURE__ */ a(
|
|
1550
|
-
/* @__PURE__ */
|
|
1551
|
-
|
|
1808
|
+
return /* @__PURE__ */ c(ja, { "data-slot": "dialog-portal", children: [
|
|
1809
|
+
/* @__PURE__ */ a(Ua, {}),
|
|
1810
|
+
/* @__PURE__ */ c(
|
|
1811
|
+
v.Content,
|
|
1552
1812
|
{
|
|
1553
1813
|
"data-slot": "dialog-content",
|
|
1554
|
-
className:
|
|
1814
|
+
className: h(
|
|
1555
1815
|
"astw:bg-background astw:data-[state=open]:animate-in astw:data-[state=closed]:animate-out astw:data-[state=closed]:fade-out-0 astw:data-[state=open]:fade-in-0 astw:data-[state=closed]:zoom-out-95 astw:data-[state=open]:zoom-in-95 astw:fixed astw:top-[50%] astw:left-[50%] astw:z-50 astw:grid astw:w-full astw:max-w-[calc(100%-2rem)] astw:translate-x-[-50%] astw:translate-y-[-50%] astw:gap-4 astw:rounded-lg astw:border astw:p-6 astw:shadow-lg astw:duration-200 astw:sm:max-w-lg",
|
|
1556
1816
|
t
|
|
1557
1817
|
),
|
|
1558
1818
|
...s,
|
|
1559
1819
|
children: [
|
|
1560
1820
|
e,
|
|
1561
|
-
/* @__PURE__ */
|
|
1562
|
-
/* @__PURE__ */ a(
|
|
1821
|
+
/* @__PURE__ */ c(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: [
|
|
1822
|
+
/* @__PURE__ */ a(_t, {}),
|
|
1563
1823
|
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: "Close" })
|
|
1564
1824
|
] })
|
|
1565
1825
|
]
|
|
@@ -1567,20 +1827,20 @@ function ya({
|
|
|
1567
1827
|
)
|
|
1568
1828
|
] });
|
|
1569
1829
|
}
|
|
1570
|
-
function
|
|
1830
|
+
function Va({
|
|
1571
1831
|
className: t,
|
|
1572
1832
|
...e
|
|
1573
1833
|
}) {
|
|
1574
1834
|
return /* @__PURE__ */ a(
|
|
1575
|
-
|
|
1835
|
+
v.Title,
|
|
1576
1836
|
{
|
|
1577
1837
|
"data-slot": "dialog-title",
|
|
1578
|
-
className:
|
|
1838
|
+
className: h("astw:text-lg astw:leading-none astw:font-semibold", t),
|
|
1579
1839
|
...e
|
|
1580
1840
|
}
|
|
1581
1841
|
);
|
|
1582
1842
|
}
|
|
1583
|
-
function
|
|
1843
|
+
function Ha(t) {
|
|
1584
1844
|
const e = [], s = (r, n, o) => {
|
|
1585
1845
|
r.forEach((i) => {
|
|
1586
1846
|
const l = [...o, i.title];
|
|
@@ -1601,87 +1861,89 @@ function Sa(t) {
|
|
|
1601
1861
|
}), s(r.items, r.icon, [r.title]);
|
|
1602
1862
|
}), e;
|
|
1603
1863
|
}
|
|
1604
|
-
function
|
|
1864
|
+
function Ga({
|
|
1605
1865
|
routes: t
|
|
1606
1866
|
}) {
|
|
1607
|
-
const e =
|
|
1608
|
-
() =>
|
|
1867
|
+
const e = Se(), s = Ft(null), [r, n] = H(!1), [o, i] = H(""), [l, u] = H(0), w = M(
|
|
1868
|
+
() => Ia(t, o),
|
|
1609
1869
|
[t, o]
|
|
1610
|
-
)
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1870
|
+
), d = E((x) => {
|
|
1871
|
+
i(x), u(0);
|
|
1872
|
+
}, []);
|
|
1873
|
+
W(() => {
|
|
1874
|
+
const x = (b) => {
|
|
1875
|
+
(b.metaKey || b.ctrlKey) && b.key === "k" && (b.preventDefault(), n((k) => !k));
|
|
1614
1876
|
};
|
|
1615
|
-
return document.addEventListener("keydown",
|
|
1616
|
-
}, [])
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1877
|
+
return document.addEventListener("keydown", x), () => document.removeEventListener("keydown", x);
|
|
1878
|
+
}, []);
|
|
1879
|
+
const m = E((x) => {
|
|
1880
|
+
n(x), x || (i(""), u(0));
|
|
1881
|
+
}, []);
|
|
1882
|
+
W(() => {
|
|
1621
1883
|
s.current && s.current.querySelector(`[data-index="${l}"]`)?.scrollIntoView({ block: "nearest" });
|
|
1622
1884
|
}, [l]);
|
|
1623
|
-
const
|
|
1624
|
-
(
|
|
1625
|
-
e(
|
|
1885
|
+
const f = E(
|
|
1886
|
+
(x) => {
|
|
1887
|
+
e(x.path), n(!1), i("");
|
|
1626
1888
|
},
|
|
1627
1889
|
[e]
|
|
1628
|
-
),
|
|
1629
|
-
(
|
|
1630
|
-
if (!
|
|
1631
|
-
switch (
|
|
1890
|
+
), g = E(
|
|
1891
|
+
(x) => {
|
|
1892
|
+
if (!x.nativeEvent.isComposing)
|
|
1893
|
+
switch (x.key) {
|
|
1632
1894
|
case "ArrowDown":
|
|
1633
|
-
|
|
1634
|
-
(
|
|
1895
|
+
x.preventDefault(), u(
|
|
1896
|
+
(b) => b < w.length - 1 ? b + 1 : b
|
|
1635
1897
|
);
|
|
1636
1898
|
break;
|
|
1637
1899
|
case "ArrowUp":
|
|
1638
|
-
|
|
1900
|
+
x.preventDefault(), u((b) => b > 0 ? b - 1 : b);
|
|
1639
1901
|
break;
|
|
1640
1902
|
case "Enter":
|
|
1641
|
-
|
|
1903
|
+
x.preventDefault(), w[l] && f(w[l]);
|
|
1642
1904
|
break;
|
|
1643
1905
|
}
|
|
1644
1906
|
},
|
|
1645
|
-
[w, l,
|
|
1907
|
+
[w, l, f]
|
|
1646
1908
|
);
|
|
1647
1909
|
return {
|
|
1648
1910
|
open: r,
|
|
1649
|
-
|
|
1911
|
+
handleOpenChange: m,
|
|
1650
1912
|
search: o,
|
|
1651
|
-
setSearch:
|
|
1913
|
+
setSearch: d,
|
|
1652
1914
|
selectedIndex: l,
|
|
1653
1915
|
filteredRoutes: w,
|
|
1654
|
-
handleSelect:
|
|
1655
|
-
handleKeyDown:
|
|
1916
|
+
handleSelect: f,
|
|
1917
|
+
handleKeyDown: g,
|
|
1656
1918
|
listRef: s
|
|
1657
1919
|
};
|
|
1658
1920
|
}
|
|
1659
|
-
function
|
|
1921
|
+
function qa({
|
|
1660
1922
|
navItems: t
|
|
1661
1923
|
}) {
|
|
1662
|
-
const e =
|
|
1924
|
+
const e = A(), s = M(() => Ha(t), [t]), {
|
|
1663
1925
|
open: r,
|
|
1664
|
-
|
|
1926
|
+
handleOpenChange: n,
|
|
1665
1927
|
search: o,
|
|
1666
1928
|
setSearch: i,
|
|
1667
1929
|
selectedIndex: l,
|
|
1668
1930
|
filteredRoutes: u,
|
|
1669
1931
|
handleSelect: w,
|
|
1670
|
-
handleKeyDown:
|
|
1671
|
-
listRef:
|
|
1672
|
-
} =
|
|
1673
|
-
return /* @__PURE__ */ a(
|
|
1674
|
-
|
|
1932
|
+
handleKeyDown: d,
|
|
1933
|
+
listRef: m
|
|
1934
|
+
} = Ga({ routes: s });
|
|
1935
|
+
return /* @__PURE__ */ a(Oa, { open: r, onOpenChange: n, children: /* @__PURE__ */ c(
|
|
1936
|
+
Ka,
|
|
1675
1937
|
{
|
|
1676
1938
|
className: "astw:p-0 astw:gap-0 astw:sm:max-w-2xl astw:overflow-hidden",
|
|
1677
|
-
onKeyDown:
|
|
1939
|
+
onKeyDown: d,
|
|
1678
1940
|
"aria-describedby": void 0,
|
|
1679
1941
|
children: [
|
|
1680
|
-
/* @__PURE__ */ a(
|
|
1681
|
-
/* @__PURE__ */
|
|
1682
|
-
/* @__PURE__ */ a(
|
|
1942
|
+
/* @__PURE__ */ a(Va, { className: "astw:sr-only", children: e("commandPaletteSearch") }),
|
|
1943
|
+
/* @__PURE__ */ c("div", { className: "astw:flex astw:items-center astw:border-b astw:px-3 astw:py-1", children: [
|
|
1944
|
+
/* @__PURE__ */ a(Ae, { className: "astw:mr-2 astw:h-4 astw:w-4 astw:shrink-0 astw:opacity-50" }),
|
|
1683
1945
|
/* @__PURE__ */ a(
|
|
1684
|
-
|
|
1946
|
+
ca,
|
|
1685
1947
|
{
|
|
1686
1948
|
value: o,
|
|
1687
1949
|
onChange: (f) => i(f.target.value),
|
|
@@ -1694,20 +1956,20 @@ function Ta({
|
|
|
1694
1956
|
/* @__PURE__ */ a(
|
|
1695
1957
|
"div",
|
|
1696
1958
|
{
|
|
1697
|
-
ref:
|
|
1698
|
-
className: "astw:max-h-
|
|
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((f,
|
|
1959
|
+
ref: m,
|
|
1960
|
+
className: "astw:max-h-75 astw:overflow-y-auto astw:overflow-x-hidden",
|
|
1961
|
+
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((f, g) => /* @__PURE__ */ c(
|
|
1700
1962
|
"button",
|
|
1701
1963
|
{
|
|
1702
|
-
"data-index":
|
|
1964
|
+
"data-index": g,
|
|
1703
1965
|
onClick: () => w(f),
|
|
1704
|
-
className:
|
|
1966
|
+
className: h(
|
|
1705
1967
|
"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
|
-
|
|
1968
|
+
g === l ? "astw:bg-accent astw:text-accent-foreground" : "astw:hover:bg-accent astw:hover:text-accent-foreground"
|
|
1707
1969
|
),
|
|
1708
1970
|
children: [
|
|
1709
1971
|
/* @__PURE__ */ a("span", { className: "astw:truncate astw:w-full astw:text-left", children: f.breadcrumb.join(" > ") }),
|
|
1710
|
-
/* @__PURE__ */
|
|
1972
|
+
/* @__PURE__ */ c("span", { className: "astw:text-[11px] astw:text-muted-foreground astw:truncate astw:w-full astw:text-left", children: [
|
|
1711
1973
|
"/",
|
|
1712
1974
|
f.path
|
|
1713
1975
|
] })
|
|
@@ -1721,18 +1983,60 @@ function Ta({
|
|
|
1721
1983
|
}
|
|
1722
1984
|
) });
|
|
1723
1985
|
}
|
|
1724
|
-
function
|
|
1725
|
-
const t =
|
|
1726
|
-
return /* @__PURE__ */ a(
|
|
1986
|
+
function Ks() {
|
|
1987
|
+
const t = Qt();
|
|
1988
|
+
return /* @__PURE__ */ a(it, { fallback: null, children: /* @__PURE__ */ a(zt, { resolve: t, children: (e) => /* @__PURE__ */ a(qa, { navItems: e ?? [] }) }) });
|
|
1989
|
+
}
|
|
1990
|
+
function Qa(t, e, s) {
|
|
1991
|
+
if (s.current === null || s.current.contextData !== e || s.current.guards !== t) {
|
|
1992
|
+
const r = Za(t, e), n = {
|
|
1993
|
+
contextData: e,
|
|
1994
|
+
guards: t,
|
|
1995
|
+
promise: r,
|
|
1996
|
+
state: { status: "pending", promise: r }
|
|
1997
|
+
};
|
|
1998
|
+
r.then(
|
|
1999
|
+
(o) => {
|
|
2000
|
+
n.state = { status: "fulfilled", value: o };
|
|
2001
|
+
},
|
|
2002
|
+
(o) => {
|
|
2003
|
+
n.state = { status: "rejected", error: o };
|
|
2004
|
+
}
|
|
2005
|
+
), s.current = n;
|
|
2006
|
+
}
|
|
2007
|
+
return s.current;
|
|
2008
|
+
}
|
|
2009
|
+
function Ya(t) {
|
|
2010
|
+
const { state: e } = t;
|
|
2011
|
+
switch (e.status) {
|
|
2012
|
+
case "fulfilled":
|
|
2013
|
+
return e.value;
|
|
2014
|
+
case "rejected":
|
|
2015
|
+
throw e.error;
|
|
2016
|
+
case "pending":
|
|
2017
|
+
throw e.promise;
|
|
2018
|
+
}
|
|
1727
2019
|
}
|
|
1728
|
-
|
|
2020
|
+
const Vs = (t) => {
|
|
2021
|
+
const { guards: e, children: s, fallback: r = null, loading: n = null } = t, { contextData: o } = jt(), i = Ft(null), l = Qa(e, o, i);
|
|
2022
|
+
return /* @__PURE__ */ a(it, { fallback: n, children: /* @__PURE__ */ a(Xa, { cache: l, children: s, fallback: r }) });
|
|
2023
|
+
}, Xa = (t) => Ya(t.cache).type === "pass" ? /* @__PURE__ */ a(S, { children: t.children }) : /* @__PURE__ */ a(S, { children: t.fallback }), Za = async (t, e) => {
|
|
2024
|
+
const s = { context: e };
|
|
2025
|
+
for (const r of t) {
|
|
2026
|
+
const n = await r(s);
|
|
2027
|
+
if (n.type !== "pass")
|
|
2028
|
+
return n;
|
|
2029
|
+
}
|
|
2030
|
+
return { type: "pass" };
|
|
2031
|
+
};
|
|
2032
|
+
function Ja(t) {
|
|
1729
2033
|
const e = new URLSearchParams(t.search);
|
|
1730
2034
|
e.delete("code"), e.delete("state");
|
|
1731
2035
|
const s = e.toString();
|
|
1732
2036
|
return t.pathname + (s ? `?${s}` : "") + t.hash;
|
|
1733
2037
|
}
|
|
1734
|
-
function
|
|
1735
|
-
const e =
|
|
2038
|
+
function Hs(t) {
|
|
2039
|
+
const e = ze(t), { appUri: s } = t;
|
|
1736
2040
|
return {
|
|
1737
2041
|
...e,
|
|
1738
2042
|
getAppUri() {
|
|
@@ -1744,19 +2048,19 @@ function ps(t) {
|
|
|
1744
2048
|
}
|
|
1745
2049
|
};
|
|
1746
2050
|
}
|
|
1747
|
-
const
|
|
1748
|
-
const e = t.client, s =
|
|
2051
|
+
const ie = X(null), Gs = (t) => {
|
|
2052
|
+
const e = t.client, s = E(
|
|
1749
2053
|
(l) => e.addEventListener((u) => {
|
|
1750
2054
|
u.type === "auth_state_changed" && l();
|
|
1751
2055
|
}),
|
|
1752
2056
|
[e]
|
|
1753
|
-
), r =
|
|
1754
|
-
|
|
2057
|
+
), r = E(() => e.getState(), [e]), n = Wt(s, r);
|
|
2058
|
+
W(() => {
|
|
1755
2059
|
(async () => {
|
|
1756
2060
|
if (new URLSearchParams(window.location.search).has("code"))
|
|
1757
2061
|
try {
|
|
1758
2062
|
await e.handleCallback();
|
|
1759
|
-
const w =
|
|
2063
|
+
const w = Ja(
|
|
1760
2064
|
new URL(window.location.href)
|
|
1761
2065
|
);
|
|
1762
2066
|
window.history.replaceState({}, "", w);
|
|
@@ -1766,12 +2070,12 @@ const qt = j(null), gs = (t) => {
|
|
|
1766
2070
|
else
|
|
1767
2071
|
await e.checkAuthStatus();
|
|
1768
2072
|
})();
|
|
1769
|
-
}, [e]),
|
|
2073
|
+
}, [e]), W(() => {
|
|
1770
2074
|
t.autoLogin && (!n.isReady || n.isAuthenticated || e.login());
|
|
1771
2075
|
}, [n.isReady, n.isAuthenticated, t.autoLogin, e]);
|
|
1772
2076
|
const o = n.isAuthenticated, i = t.guardComponent && (!n.isReady || !o) ? /* @__PURE__ */ a(t.guardComponent, {}) : t.children;
|
|
1773
2077
|
return /* @__PURE__ */ a(
|
|
1774
|
-
|
|
2078
|
+
ie.Provider,
|
|
1775
2079
|
{
|
|
1776
2080
|
value: {
|
|
1777
2081
|
authState: n,
|
|
@@ -1783,15 +2087,15 @@ const qt = j(null), gs = (t) => {
|
|
|
1783
2087
|
children: i
|
|
1784
2088
|
}
|
|
1785
2089
|
);
|
|
1786
|
-
},
|
|
1787
|
-
const t =
|
|
2090
|
+
}, le = () => {
|
|
2091
|
+
const t = L(ie);
|
|
1788
2092
|
if (!t)
|
|
1789
2093
|
throw new Error(
|
|
1790
2094
|
"useAuth/useAuthSuspense must be used within an AuthProvider"
|
|
1791
2095
|
);
|
|
1792
2096
|
return t;
|
|
1793
|
-
},
|
|
1794
|
-
const t =
|
|
2097
|
+
}, qs = () => {
|
|
2098
|
+
const t = le(), { isAuthenticated: e, error: s, isReady: r } = t.authState;
|
|
1795
2099
|
return {
|
|
1796
2100
|
error: s,
|
|
1797
2101
|
isAuthenticated: e,
|
|
@@ -1800,8 +2104,8 @@ const qt = j(null), gs = (t) => {
|
|
|
1800
2104
|
logout: t.logout,
|
|
1801
2105
|
checkAuthStatus: t.checkAuthStatus
|
|
1802
2106
|
};
|
|
1803
|
-
},
|
|
1804
|
-
const t =
|
|
2107
|
+
}, Qs = () => {
|
|
2108
|
+
const t = le();
|
|
1805
2109
|
if (!t.authState.isReady)
|
|
1806
2110
|
throw t.ready();
|
|
1807
2111
|
const { isAuthenticated: e, error: s } = t.authState;
|
|
@@ -1812,7 +2116,7 @@ const qt = j(null), gs = (t) => {
|
|
|
1812
2116
|
logout: t.logout,
|
|
1813
2117
|
checkAuthStatus: t.checkAuthStatus
|
|
1814
2118
|
};
|
|
1815
|
-
},
|
|
2119
|
+
}, Ys = () => De, ts = ot(
|
|
1816
2120
|
"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
2121
|
{
|
|
1818
2122
|
variants: {
|
|
@@ -1834,51 +2138,51 @@ const qt = j(null), gs = (t) => {
|
|
|
1834
2138
|
variant: "default"
|
|
1835
2139
|
}
|
|
1836
2140
|
}
|
|
1837
|
-
),
|
|
2141
|
+
), es = {
|
|
1838
2142
|
"outline-success": "astw:bg-green-500",
|
|
1839
2143
|
"outline-warning": "astw:bg-orange-500",
|
|
1840
2144
|
"outline-error": "astw:bg-red-500",
|
|
1841
2145
|
"outline-info": "astw:bg-blue-500",
|
|
1842
2146
|
"outline-neutral": "astw:bg-neutral-400"
|
|
1843
2147
|
};
|
|
1844
|
-
function
|
|
1845
|
-
const e =
|
|
1846
|
-
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:
|
|
2148
|
+
function as({ variant: t }) {
|
|
2149
|
+
const e = es[t];
|
|
2150
|
+
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: h("astw:size-[7px] astw:rounded-full", e) }) }) : null;
|
|
1847
2151
|
}
|
|
1848
|
-
function
|
|
2152
|
+
function ss({ className: t, variant: e, children: s, ...r }) {
|
|
1849
2153
|
const n = e?.toString().startsWith("outline-");
|
|
1850
|
-
return /* @__PURE__ */
|
|
2154
|
+
return /* @__PURE__ */ c(
|
|
1851
2155
|
"div",
|
|
1852
2156
|
{
|
|
1853
|
-
className:
|
|
2157
|
+
className: h(ts({ variant: e }), t),
|
|
1854
2158
|
...r,
|
|
1855
2159
|
children: [
|
|
1856
|
-
n && /* @__PURE__ */ a(
|
|
2160
|
+
n && /* @__PURE__ */ a(as, { variant: e }),
|
|
1857
2161
|
s
|
|
1858
2162
|
]
|
|
1859
2163
|
}
|
|
1860
2164
|
);
|
|
1861
2165
|
}
|
|
1862
|
-
function
|
|
2166
|
+
function rs(t) {
|
|
1863
2167
|
return t.type === "divider";
|
|
1864
2168
|
}
|
|
1865
|
-
function
|
|
2169
|
+
function ns(t) {
|
|
1866
2170
|
return t.type !== "divider" && "key" in t;
|
|
1867
2171
|
}
|
|
1868
|
-
function
|
|
2172
|
+
function Z(t, e) {
|
|
1869
2173
|
return e.split(".").reduce((s, r) => {
|
|
1870
2174
|
if (s && typeof s == "object" && r in s)
|
|
1871
2175
|
return s[r];
|
|
1872
2176
|
}, t);
|
|
1873
2177
|
}
|
|
1874
|
-
function
|
|
2178
|
+
function N(t) {
|
|
1875
2179
|
return t == null || t === "";
|
|
1876
2180
|
}
|
|
1877
|
-
function
|
|
2181
|
+
function os(t) {
|
|
1878
2182
|
return t.toLowerCase().replace(/_/g, " ").replace(/^\w/, (e) => e.toUpperCase());
|
|
1879
2183
|
}
|
|
1880
|
-
function
|
|
1881
|
-
if (
|
|
2184
|
+
function is(t, e = "medium") {
|
|
2185
|
+
if (N(t)) return "";
|
|
1882
2186
|
const s = t instanceof Date ? t : new Date(String(t));
|
|
1883
2187
|
if (isNaN(s.getTime())) return String(t);
|
|
1884
2188
|
switch (e) {
|
|
@@ -1909,8 +2213,8 @@ function Ma(t, e = "medium") {
|
|
|
1909
2213
|
return s.toLocaleDateString();
|
|
1910
2214
|
}
|
|
1911
2215
|
}
|
|
1912
|
-
function
|
|
1913
|
-
if (
|
|
2216
|
+
function ls(t, e) {
|
|
2217
|
+
if (N(t)) return "";
|
|
1914
2218
|
const s = typeof t == "number" ? t : parseFloat(String(t));
|
|
1915
2219
|
if (isNaN(s)) return String(t);
|
|
1916
2220
|
try {
|
|
@@ -1922,8 +2226,8 @@ function Ia(t, e) {
|
|
|
1922
2226
|
return `${e || "$"}${s.toFixed(2)}`;
|
|
1923
2227
|
}
|
|
1924
2228
|
}
|
|
1925
|
-
function
|
|
1926
|
-
if (
|
|
2229
|
+
function cs(t) {
|
|
2230
|
+
if (N(t)) return [];
|
|
1927
2231
|
if (typeof t == "string")
|
|
1928
2232
|
return t.split(/[,\n]/).map((e) => e.trim()).filter(Boolean);
|
|
1929
2233
|
if (typeof t == "object" && t !== null) {
|
|
@@ -1938,10 +2242,10 @@ function _a(t) {
|
|
|
1938
2242
|
}
|
|
1939
2243
|
return [String(t)];
|
|
1940
2244
|
}
|
|
1941
|
-
function
|
|
1942
|
-
const [e, s] =
|
|
1943
|
-
return /* @__PURE__ */
|
|
1944
|
-
/* @__PURE__ */ a(
|
|
2245
|
+
function ce({ value: t }) {
|
|
2246
|
+
const [e, s] = p.useState(!1);
|
|
2247
|
+
return /* @__PURE__ */ c(mt, { children: [
|
|
2248
|
+
/* @__PURE__ */ a(ft, { asChild: !0, children: /* @__PURE__ */ a(
|
|
1945
2249
|
"button",
|
|
1946
2250
|
{
|
|
1947
2251
|
onClick: async (n) => {
|
|
@@ -1952,28 +2256,28 @@ function Qt({ value: t }) {
|
|
|
1952
2256
|
}
|
|
1953
2257
|
},
|
|
1954
2258
|
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(
|
|
2259
|
+
children: e ? /* @__PURE__ */ a(Ee, { className: "astw:h-3 astw:w-3", strokeWidth: 2.5 }) : /* @__PURE__ */ a(Me, { className: "astw:h-3 astw:w-3", strokeWidth: 2.5 })
|
|
1956
2260
|
}
|
|
1957
2261
|
) }),
|
|
1958
|
-
/* @__PURE__ */ a(
|
|
2262
|
+
/* @__PURE__ */ a(pt, { side: "top", children: e ? "Copied!" : "Copy" })
|
|
1959
2263
|
] });
|
|
1960
2264
|
}
|
|
1961
|
-
const
|
|
1962
|
-
function
|
|
1963
|
-
const e =
|
|
1964
|
-
|
|
2265
|
+
const T = "–";
|
|
2266
|
+
function ds({ field: t }) {
|
|
2267
|
+
const e = N(t.value) ? T : String(t.value), s = t.meta?.copyable && !N(t.value), r = t.meta?.truncateLines, n = p.useRef(null), [o, i] = p.useState(!1);
|
|
2268
|
+
p.useEffect(() => {
|
|
1965
2269
|
if (!r) {
|
|
1966
2270
|
i(!1);
|
|
1967
2271
|
return;
|
|
1968
2272
|
}
|
|
1969
2273
|
const w = () => {
|
|
1970
2274
|
if (n.current) {
|
|
1971
|
-
const
|
|
1972
|
-
i(
|
|
2275
|
+
const m = n.current;
|
|
2276
|
+
i(m.scrollHeight > m.clientHeight + 1);
|
|
1973
2277
|
}
|
|
1974
|
-
},
|
|
2278
|
+
}, d = setTimeout(w, 50);
|
|
1975
2279
|
return window.addEventListener("resize", w), () => {
|
|
1976
|
-
clearTimeout(
|
|
2280
|
+
clearTimeout(d), window.removeEventListener("resize", w);
|
|
1977
2281
|
};
|
|
1978
2282
|
}, [e, r]);
|
|
1979
2283
|
const l = r && r > 0 ? {
|
|
@@ -1981,46 +2285,46 @@ function za({ field: t }) {
|
|
|
1981
2285
|
WebkitLineClamp: r,
|
|
1982
2286
|
WebkitBoxOrient: "vertical",
|
|
1983
2287
|
overflow: "hidden"
|
|
1984
|
-
} : void 0, u = /* @__PURE__ */
|
|
2288
|
+
} : void 0, u = /* @__PURE__ */ c("div", { className: "astw:flex astw:items-start astw:gap-1 astw:min-w-0", children: [
|
|
1985
2289
|
/* @__PURE__ */ a(
|
|
1986
2290
|
"p",
|
|
1987
2291
|
{
|
|
1988
2292
|
ref: n,
|
|
1989
|
-
className: "astw:text-sm astw:font-medium astw:text-foreground astw:break-
|
|
2293
|
+
className: "astw:text-sm astw:font-medium astw:text-foreground astw:wrap-break-word astw:m-0",
|
|
1990
2294
|
style: l,
|
|
1991
2295
|
children: e
|
|
1992
2296
|
}
|
|
1993
2297
|
),
|
|
1994
|
-
s && /* @__PURE__ */ a(
|
|
2298
|
+
s && /* @__PURE__ */ a(ce, { value: String(t.value) })
|
|
1995
2299
|
] });
|
|
1996
|
-
return r && o ? /* @__PURE__ */
|
|
1997
|
-
/* @__PURE__ */ a(
|
|
1998
|
-
/* @__PURE__ */ a(
|
|
2300
|
+
return r && o ? /* @__PURE__ */ c(mt, { children: [
|
|
2301
|
+
/* @__PURE__ */ a(ft, { asChild: !0, children: /* @__PURE__ */ a("span", { className: "astw:cursor-default", children: u }) }),
|
|
2302
|
+
/* @__PURE__ */ a(pt, { side: "bottom", style: { maxWidth: 320 }, children: /* @__PURE__ */ a("p", { className: "astw:text-sm", children: e }) })
|
|
1999
2303
|
] }) : u;
|
|
2000
2304
|
}
|
|
2001
|
-
function
|
|
2002
|
-
if (
|
|
2003
|
-
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children:
|
|
2305
|
+
function us({ field: t }) {
|
|
2306
|
+
if (N(t.value))
|
|
2307
|
+
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: T });
|
|
2004
2308
|
const e = String(t.value), s = t.meta?.badgeVariantMap || {}, r = e.toLowerCase(), n = s[e] || s[r] || "outline-neutral";
|
|
2005
|
-
return /* @__PURE__ */ a(
|
|
2309
|
+
return /* @__PURE__ */ a(ss, { variant: n, className: "astw:w-fit", children: os(e) });
|
|
2006
2310
|
}
|
|
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 =
|
|
2311
|
+
function ws({ field: t }) {
|
|
2312
|
+
if (N(t.value))
|
|
2313
|
+
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: T });
|
|
2314
|
+
const e = t.meta?.currencyKey || "currency", s = Z(t.data, e), r = ls(t.value, s);
|
|
2011
2315
|
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground astw:tabular-nums", children: r });
|
|
2012
2316
|
}
|
|
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 =
|
|
2317
|
+
function hs({ field: t }) {
|
|
2318
|
+
if (N(t.value))
|
|
2319
|
+
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: T });
|
|
2320
|
+
const e = t.meta?.dateFormat || "medium", s = is(t.value, e);
|
|
2017
2321
|
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: s });
|
|
2018
2322
|
}
|
|
2019
|
-
function
|
|
2020
|
-
if (
|
|
2021
|
-
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children:
|
|
2022
|
-
const e = t.meta?.hrefKey, s = e ?
|
|
2023
|
-
return s ? /* @__PURE__ */
|
|
2323
|
+
function ms({ field: t }) {
|
|
2324
|
+
if (N(t.value))
|
|
2325
|
+
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: T });
|
|
2326
|
+
const e = t.meta?.hrefKey, s = e ? Z(t.data, e) : void 0, r = t.meta?.external ?? !1, n = String(t.value);
|
|
2327
|
+
return s ? /* @__PURE__ */ c(
|
|
2024
2328
|
"a",
|
|
2025
2329
|
{
|
|
2026
2330
|
href: s,
|
|
@@ -2029,63 +2333,63 @@ function Wa({ field: t }) {
|
|
|
2029
2333
|
className: "astw:inline-flex astw:items-center astw:gap-1 astw:text-sm astw:text-primary astw:hover:underline",
|
|
2030
2334
|
children: [
|
|
2031
2335
|
n,
|
|
2032
|
-
r && /* @__PURE__ */ a(
|
|
2336
|
+
r && /* @__PURE__ */ a($t, { className: "astw:h-3 astw:w-3" })
|
|
2033
2337
|
]
|
|
2034
2338
|
}
|
|
2035
2339
|
) : /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: n });
|
|
2036
2340
|
}
|
|
2037
|
-
function
|
|
2038
|
-
if (
|
|
2039
|
-
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children:
|
|
2040
|
-
const e =
|
|
2341
|
+
function fs({ field: t }) {
|
|
2342
|
+
if (N(t.value))
|
|
2343
|
+
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: T });
|
|
2344
|
+
const e = cs(t.value), s = t.meta?.copyable && !N(t.value), r = e.join(`
|
|
2041
2345
|
`);
|
|
2042
|
-
return /* @__PURE__ */
|
|
2043
|
-
/* @__PURE__ */ a("address", { className: "astw:text-sm astw:font-medium astw:text-foreground astw:not-italic", children: e.map((n, o) => /* @__PURE__ */
|
|
2346
|
+
return /* @__PURE__ */ c("div", { className: "astw:flex astw:items-start astw:gap-1 astw:min-w-0", children: [
|
|
2347
|
+
/* @__PURE__ */ a("address", { className: "astw:text-sm astw:font-medium astw:text-foreground astw:not-italic", children: e.map((n, o) => /* @__PURE__ */ c(p.Fragment, { children: [
|
|
2044
2348
|
n,
|
|
2045
2349
|
o < e.length - 1 && /* @__PURE__ */ a("br", {})
|
|
2046
2350
|
] }, o)) }),
|
|
2047
|
-
s && /* @__PURE__ */ a(
|
|
2351
|
+
s && /* @__PURE__ */ a(ce, { value: r })
|
|
2048
2352
|
] });
|
|
2049
2353
|
}
|
|
2050
|
-
function
|
|
2051
|
-
if (
|
|
2052
|
-
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children:
|
|
2053
|
-
const e = t.meta?.referenceIdKey, s = t.meta?.referenceUrlPattern, r = e ?
|
|
2354
|
+
function ps({ field: t }) {
|
|
2355
|
+
if (N(t.value))
|
|
2356
|
+
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: T });
|
|
2357
|
+
const e = t.meta?.referenceIdKey, s = t.meta?.referenceUrlPattern, r = e ? Z(t.data, e) : void 0, n = String(t.value);
|
|
2054
2358
|
if (!r || !s)
|
|
2055
2359
|
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: n });
|
|
2056
2360
|
const o = s.replace("{id}", r);
|
|
2057
2361
|
return /* @__PURE__ */ a("a", { href: o, className: "astw:text-sm astw:text-primary astw:hover:underline", children: n });
|
|
2058
2362
|
}
|
|
2059
|
-
function
|
|
2363
|
+
function Lt(t) {
|
|
2060
2364
|
switch (t.type) {
|
|
2061
2365
|
case "text":
|
|
2062
|
-
return /* @__PURE__ */ a(
|
|
2366
|
+
return /* @__PURE__ */ a(ds, { field: t });
|
|
2063
2367
|
case "badge":
|
|
2064
|
-
return /* @__PURE__ */ a(
|
|
2368
|
+
return /* @__PURE__ */ a(us, { field: t });
|
|
2065
2369
|
case "money":
|
|
2066
|
-
return /* @__PURE__ */ a(
|
|
2370
|
+
return /* @__PURE__ */ a(ws, { field: t });
|
|
2067
2371
|
case "date":
|
|
2068
|
-
return /* @__PURE__ */ a(
|
|
2372
|
+
return /* @__PURE__ */ a(hs, { field: t });
|
|
2069
2373
|
case "link":
|
|
2070
|
-
return /* @__PURE__ */ a(
|
|
2374
|
+
return /* @__PURE__ */ a(ms, { field: t });
|
|
2071
2375
|
case "address":
|
|
2072
|
-
return /* @__PURE__ */ a(
|
|
2376
|
+
return /* @__PURE__ */ a(fs, { field: t });
|
|
2073
2377
|
case "reference":
|
|
2074
|
-
return /* @__PURE__ */ a(
|
|
2378
|
+
return /* @__PURE__ */ a(ps, { field: t });
|
|
2075
2379
|
default:
|
|
2076
|
-
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children:
|
|
2380
|
+
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: T });
|
|
2077
2381
|
}
|
|
2078
2382
|
}
|
|
2079
|
-
function
|
|
2383
|
+
function gs(t) {
|
|
2080
2384
|
if (t.emptyBehavior !== "hide") return !1;
|
|
2081
2385
|
const e = t.value;
|
|
2082
2386
|
return e == null || e === "";
|
|
2083
2387
|
}
|
|
2084
|
-
function
|
|
2388
|
+
function bs(t) {
|
|
2085
2389
|
return !1;
|
|
2086
2390
|
}
|
|
2087
|
-
function
|
|
2088
|
-
const r =
|
|
2391
|
+
function xs(t, e, s) {
|
|
2392
|
+
const r = Z(e, t.key);
|
|
2089
2393
|
return {
|
|
2090
2394
|
id: `${t.key}-${s}`,
|
|
2091
2395
|
label: t.label,
|
|
@@ -2096,23 +2400,23 @@ function Ha(t, e, s) {
|
|
|
2096
2400
|
data: e
|
|
2097
2401
|
};
|
|
2098
2402
|
}
|
|
2099
|
-
function
|
|
2403
|
+
function vs(t, e) {
|
|
2100
2404
|
const s = [];
|
|
2101
2405
|
let r = [], n = 0, o = 0;
|
|
2102
2406
|
for (const i of t)
|
|
2103
|
-
if (
|
|
2407
|
+
if (rs(i))
|
|
2104
2408
|
r.length > 0 && (s.push({ id: `section-${n}`, fields: r }), n++, r = []);
|
|
2105
|
-
else if (
|
|
2106
|
-
const l =
|
|
2107
|
-
o++,
|
|
2409
|
+
else if (ns(i)) {
|
|
2410
|
+
const l = xs(i, e, o);
|
|
2411
|
+
o++, gs(l) || r.push(l);
|
|
2108
2412
|
}
|
|
2109
2413
|
return r.length > 0 && s.push({ id: `section-${n}`, fields: r }), s;
|
|
2110
2414
|
}
|
|
2111
|
-
function
|
|
2112
|
-
return /* @__PURE__ */
|
|
2415
|
+
function It({ label: t, children: e, fullWidth: s }) {
|
|
2416
|
+
return /* @__PURE__ */ c(
|
|
2113
2417
|
"div",
|
|
2114
2418
|
{
|
|
2115
|
-
className:
|
|
2419
|
+
className: h(
|
|
2116
2420
|
"astw:flex astw:flex-col astw:gap-1 astw:min-w-0 astw:py-2",
|
|
2117
2421
|
s && "astw:col-span-full"
|
|
2118
2422
|
),
|
|
@@ -2123,7 +2427,7 @@ function kt({ label: t, children: e, fullWidth: s }) {
|
|
|
2123
2427
|
}
|
|
2124
2428
|
);
|
|
2125
2429
|
}
|
|
2126
|
-
function
|
|
2430
|
+
function Xs({
|
|
2127
2431
|
data: t,
|
|
2128
2432
|
title: e,
|
|
2129
2433
|
fields: s,
|
|
@@ -2131,7 +2435,7 @@ function ys({
|
|
|
2131
2435
|
className: n,
|
|
2132
2436
|
headerAction: o
|
|
2133
2437
|
}) {
|
|
2134
|
-
const i =
|
|
2438
|
+
const i = vs(s, t), l = i.some((d) => d.fields.length > 0), u = h(
|
|
2135
2439
|
"astw:grid astw:gap-x-6 astw:gap-y-4",
|
|
2136
2440
|
// Default: 1 column
|
|
2137
2441
|
"astw:grid-cols-1",
|
|
@@ -2143,46 +2447,46 @@ function ys({
|
|
|
2143
2447
|
// 3-column mode: 1 → 2 → 3 columns
|
|
2144
2448
|
"astw:@[400px]:grid-cols-2 astw:@[600px]:grid-cols-3"
|
|
2145
2449
|
)
|
|
2146
|
-
), w = (
|
|
2147
|
-
const
|
|
2148
|
-
return /* @__PURE__ */
|
|
2149
|
-
|
|
2150
|
-
f.length > 0 && /* @__PURE__ */ a("div", { className: u, children: f.map((
|
|
2151
|
-
] },
|
|
2450
|
+
), w = (d) => {
|
|
2451
|
+
const m = d.fields.filter((g) => !0), f = d.fields.filter((g) => bs());
|
|
2452
|
+
return /* @__PURE__ */ c("div", { className: "astw:space-y-4", children: [
|
|
2453
|
+
m.length > 0 && /* @__PURE__ */ a("div", { className: u, children: m.map((g) => /* @__PURE__ */ a(It, { label: g.label, children: Lt(g) }, g.id)) }),
|
|
2454
|
+
f.length > 0 && /* @__PURE__ */ a("div", { className: u, children: f.map((g) => /* @__PURE__ */ a(It, { label: g.label, fullWidth: !0, children: Lt(g) }, g.id)) })
|
|
2455
|
+
] }, d.id);
|
|
2152
2456
|
};
|
|
2153
|
-
return /* @__PURE__ */ a(
|
|
2457
|
+
return /* @__PURE__ */ a(ht, { delayDuration: 300, children: /* @__PURE__ */ c(
|
|
2154
2458
|
"div",
|
|
2155
2459
|
{
|
|
2156
|
-
className:
|
|
2460
|
+
className: h(
|
|
2157
2461
|
"astw:@container astw:bg-card astw:text-card-foreground astw:rounded-xl astw:border",
|
|
2158
2462
|
n
|
|
2159
2463
|
),
|
|
2160
2464
|
children: [
|
|
2161
|
-
/* @__PURE__ */
|
|
2465
|
+
/* @__PURE__ */ c("div", { className: "astw:flex astw:items-center astw:justify-between astw:px-6 astw:py-6", children: [
|
|
2162
2466
|
/* @__PURE__ */ a("h3", { className: "astw:text-lg astw:font-semibold astw:leading-none", children: e }),
|
|
2163
2467
|
o && /* @__PURE__ */ a("div", { children: o })
|
|
2164
2468
|
] }),
|
|
2165
|
-
/* @__PURE__ */ a("div", { className: "astw:px-6 astw:pb-4", children: l ? /* @__PURE__ */ a("div", { className: "astw:space-y-4", children: i.map((
|
|
2166
|
-
|
|
2167
|
-
w(
|
|
2168
|
-
] },
|
|
2469
|
+
/* @__PURE__ */ a("div", { className: "astw:px-6 astw:pb-4", children: l ? /* @__PURE__ */ a("div", { className: "astw:space-y-4", children: i.map((d, m) => /* @__PURE__ */ c(p.Fragment, { children: [
|
|
2470
|
+
m > 0 && /* @__PURE__ */ a("div", { className: "astw:h-px astw:bg-border", role: "separator" }),
|
|
2471
|
+
w(d)
|
|
2472
|
+
] }, d.id)) }) : /* @__PURE__ */ a("p", { className: "astw:text-sm astw:text-muted-foreground", children: "No information available" }) })
|
|
2169
2473
|
]
|
|
2170
2474
|
}
|
|
2171
2475
|
) });
|
|
2172
2476
|
}
|
|
2173
|
-
const
|
|
2477
|
+
const xt = p.forwardRef(
|
|
2174
2478
|
({ className: t, children: e, ...s }, r) => /* @__PURE__ */ a(
|
|
2175
2479
|
"div",
|
|
2176
2480
|
{
|
|
2177
2481
|
ref: r,
|
|
2178
|
-
className:
|
|
2482
|
+
className: h("astw:min-w-0 astw:flex astw:flex-col astw:gap-4", t),
|
|
2179
2483
|
...s,
|
|
2180
2484
|
children: e
|
|
2181
2485
|
}
|
|
2182
2486
|
)
|
|
2183
2487
|
);
|
|
2184
|
-
|
|
2185
|
-
function
|
|
2488
|
+
xt.displayName = "Layout.Column";
|
|
2489
|
+
function ys({
|
|
2186
2490
|
columns: t,
|
|
2187
2491
|
className: e,
|
|
2188
2492
|
gap: s = 4,
|
|
@@ -2191,13 +2495,13 @@ function Ga({
|
|
|
2191
2495
|
children: o
|
|
2192
2496
|
}) {
|
|
2193
2497
|
if (process.env.NODE_ENV !== "production") {
|
|
2194
|
-
const
|
|
2195
|
-
if (
|
|
2498
|
+
const m = p.Children.toArray(o).reduce((f, g) => p.isValidElement(g) && g.type === xt ? f + 1 : f, 0);
|
|
2499
|
+
if (m !== t)
|
|
2196
2500
|
throw new Error(
|
|
2197
|
-
`Layout: Expected exactly ${t} Layout.Column child${t === 1 ? "" : "ren"}, but found ${
|
|
2501
|
+
`Layout: Expected exactly ${t} Layout.Column child${t === 1 ? "" : "ren"}, but found ${m}. Please ensure the number of <Layout.Column> children matches the \`columns={${t}}\` prop.`
|
|
2198
2502
|
);
|
|
2199
2503
|
}
|
|
2200
|
-
const l =
|
|
2504
|
+
const l = h(
|
|
2201
2505
|
"astw:flex astw:w-full",
|
|
2202
2506
|
s === 4 ? "astw:gap-4" : s === 6 ? "astw:gap-6" : s === 8 ? "astw:gap-8" : "astw:gap-4",
|
|
2203
2507
|
// 1 column: Always stack vertically
|
|
@@ -2215,63 +2519,81 @@ function Ga({
|
|
|
2215
2519
|
"astw:xl:flex-row"
|
|
2216
2520
|
],
|
|
2217
2521
|
e
|
|
2218
|
-
), u =
|
|
2219
|
-
className:
|
|
2220
|
-
|
|
2221
|
-
|
|
2522
|
+
), u = p.useMemo(() => t === 1 ? p.Children.map(o, (d) => d) : t === 2 ? p.Children.map(o, (d, m) => p.isValidElement(d) ? p.cloneElement(d, {
|
|
2523
|
+
className: h(
|
|
2524
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- React child props type is not known
|
|
2525
|
+
d.props.className,
|
|
2526
|
+
m === 0 ? "astw:lg:flex-1" : "astw:lg:min-w-[280px]"
|
|
2222
2527
|
// Second column: fixed 280px
|
|
2223
2528
|
)
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2529
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- React.cloneElement requires type assertion
|
|
2530
|
+
}) : d) : t === 3 ? p.Children.map(o, (d, m) => p.isValidElement(d) ? p.cloneElement(d, {
|
|
2531
|
+
className: h(
|
|
2532
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- React child props type is not known
|
|
2533
|
+
d.props.className,
|
|
2534
|
+
m === 0 ? "astw:xl:min-w-[320px]" : m === 2 ? "astw:xl:min-w-[280px]" : "astw:xl:flex-1"
|
|
2228
2535
|
// Middle column: flexible
|
|
2229
2536
|
)
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2537
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- React.cloneElement requires type assertion
|
|
2538
|
+
}) : d) : o, [o, t]), w = r || n && n.length > 0;
|
|
2539
|
+
return /* @__PURE__ */ c("div", { className: "astw:flex astw:flex-col", children: [
|
|
2540
|
+
w && /* @__PURE__ */ c(
|
|
2233
2541
|
"header",
|
|
2234
2542
|
{
|
|
2235
2543
|
className: "astw:w-full astw:flex astw:justify-between astw:items-center",
|
|
2236
2544
|
style: { padding: "1.5rem", paddingBottom: "1rem" },
|
|
2237
2545
|
children: [
|
|
2238
2546
|
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((
|
|
2547
|
+
n && n.length > 0 && /* @__PURE__ */ a("div", { className: "astw:flex astw:gap-2 astw:items-center", children: n.map((d, m) => /* @__PURE__ */ a(p.Fragment, { children: d }, m)) })
|
|
2240
2548
|
]
|
|
2241
2549
|
}
|
|
2242
2550
|
),
|
|
2243
2551
|
/* @__PURE__ */ a("div", { style: { padding: w ? "0 1.5rem 1.5rem 1.5rem" : "1.5rem" }, children: /* @__PURE__ */ a("div", { className: l, children: u }) })
|
|
2244
2552
|
] });
|
|
2245
2553
|
}
|
|
2246
|
-
|
|
2554
|
+
ys.Column = xt;
|
|
2555
|
+
function Zs() {
|
|
2556
|
+
return {
|
|
2557
|
+
for(t, ...e) {
|
|
2558
|
+
const s = e[0];
|
|
2559
|
+
return s ? t.replace(/:([^/?]+)|\*([^/?]+)/g, (r, n, o) => n ? encodeURIComponent(s[n] ?? "") : (s[o] ?? "").split("/").map((l) => encodeURIComponent(l)).join("/")) : t;
|
|
2560
|
+
}
|
|
2561
|
+
};
|
|
2562
|
+
}
|
|
2247
2563
|
export {
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2564
|
+
te as AppShell,
|
|
2565
|
+
Gs as AuthProvider,
|
|
2566
|
+
ss as Badge,
|
|
2567
|
+
Ks as CommandPalette,
|
|
2568
|
+
Aa as DefaultSidebar,
|
|
2569
|
+
Xs as DescriptionCard,
|
|
2570
|
+
ys as Layout,
|
|
2571
|
+
er as Link,
|
|
2572
|
+
Os as SidebarGroup,
|
|
2573
|
+
Fs as SidebarItem,
|
|
2574
|
+
Us as SidebarLayout,
|
|
2575
|
+
js as SidebarSeparator,
|
|
2576
|
+
Vs as WithGuard,
|
|
2577
|
+
ts as badgeVariants,
|
|
2578
|
+
Hs as createAuthClient,
|
|
2579
|
+
Zs as createTypedPaths,
|
|
2580
|
+
Oe as defineI18nLabels,
|
|
2581
|
+
$s as defineModule,
|
|
2582
|
+
Ws as defineResource,
|
|
2583
|
+
zs as hidden,
|
|
2584
|
+
Is as pass,
|
|
2585
|
+
_s as redirectTo,
|
|
2586
|
+
jt as useAppShell,
|
|
2587
|
+
C as useAppShellConfig,
|
|
2588
|
+
Ls as useAppShellData,
|
|
2589
|
+
qs as useAuth,
|
|
2590
|
+
Qs as useAuthSuspense,
|
|
2591
|
+
ar as useLocation,
|
|
2592
|
+
sr as useNavigate,
|
|
2593
|
+
Ta as usePageMeta,
|
|
2594
|
+
rr as useParams,
|
|
2595
|
+
nr as useRouteError,
|
|
2596
|
+
or as useSearchParams,
|
|
2597
|
+
Je as useTheme,
|
|
2598
|
+
Ys as useToast
|
|
2277
2599
|
};
|