@tailor-platform/app-shell 0.19.0 → 0.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app-shell.css +1 -1
- package/dist/app-shell.js +544 -289
- package/dist/index.d.ts +2 -0
- package/package.json +8 -7
package/dist/app-shell.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { jsx as a, jsxs as c, Fragment as
|
|
2
|
-
import { AlertCircle as
|
|
3
|
-
import * as
|
|
4
|
-
import { createContext as
|
|
5
|
-
import { useRouteError as
|
|
6
|
-
import { Link as
|
|
7
|
-
import { Slot as
|
|
8
|
-
import { cva as
|
|
9
|
-
import { clsx as
|
|
10
|
-
import { twMerge as
|
|
11
|
-
import { capitalCase as
|
|
12
|
-
import { Toaster as
|
|
13
|
-
import * as
|
|
1
|
+
import { jsx as a, jsxs as c, Fragment as B } from "react/jsx-runtime";
|
|
2
|
+
import { AlertCircle as q, Table as bt, XIcon as rt, PanelLeftIcon as gt, ChevronRight as z, SunIcon as pt, SearchIcon as vt } from "lucide-react";
|
|
3
|
+
import * as y from "react";
|
|
4
|
+
import { createContext as j, useContext as U, useState as T, useMemo as A, useEffect as C, useRef as xt, useCallback as O } from "react";
|
|
5
|
+
import { useRouteError as yt, isRouteErrorResponse as Nt, Outlet as W, NavLink as Ct, redirect as nt, Navigate as St, createMemoryRouter as Tt, createBrowserRouter as kt, RouterProvider as Rt, useHref as Et, Link as Bt, useLocation as ot, useMatch as At, useNavigate as Pt } from "react-router";
|
|
6
|
+
import { Link as ma, useLocation as ha, useNavigate as fa, useParams as ba, useRouteError as ga, useSearchParams as pa } from "react-router";
|
|
7
|
+
import { Slot as D } from "@radix-ui/react-slot";
|
|
8
|
+
import { cva as it } from "class-variance-authority";
|
|
9
|
+
import { clsx as Lt } from "clsx";
|
|
10
|
+
import { twMerge as Dt } from "tailwind-merge";
|
|
11
|
+
import { capitalCase as P } from "change-case";
|
|
12
|
+
import { Toaster as It } from "sonner";
|
|
13
|
+
import * as H from "@radix-ui/react-collapsible";
|
|
14
14
|
import "@radix-ui/react-separator";
|
|
15
|
-
import * as
|
|
16
|
-
import * as
|
|
17
|
-
import { print as
|
|
15
|
+
import * as v from "@radix-ui/react-dialog";
|
|
16
|
+
import * as k from "@radix-ui/react-tooltip";
|
|
17
|
+
import { print as _t } from "graphql";
|
|
18
18
|
import { createAuthClient as Mt } from "@tailor-platform/auth-browser-client";
|
|
19
19
|
function u(...t) {
|
|
20
|
-
return
|
|
20
|
+
return Dt(Lt(t));
|
|
21
21
|
}
|
|
22
|
-
const
|
|
22
|
+
const zt = it(
|
|
23
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",
|
|
24
24
|
{
|
|
25
25
|
variants: {
|
|
@@ -44,7 +44,7 @@ const _t = rt(
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
);
|
|
47
|
-
function
|
|
47
|
+
function L({
|
|
48
48
|
className: t,
|
|
49
49
|
variant: e,
|
|
50
50
|
size: s,
|
|
@@ -52,31 +52,31 @@ function B({
|
|
|
52
52
|
...n
|
|
53
53
|
}) {
|
|
54
54
|
return /* @__PURE__ */ a(
|
|
55
|
-
r ?
|
|
55
|
+
r ? D : "button",
|
|
56
56
|
{
|
|
57
57
|
"data-slot": "button",
|
|
58
|
-
className: u(
|
|
58
|
+
className: u(zt({ variant: e, size: s, className: t })),
|
|
59
59
|
...n
|
|
60
60
|
}
|
|
61
61
|
);
|
|
62
62
|
}
|
|
63
|
-
const
|
|
63
|
+
const E = "en", Ot = () => {
|
|
64
64
|
try {
|
|
65
65
|
if (typeof navigator > "u")
|
|
66
|
-
return
|
|
66
|
+
return E;
|
|
67
67
|
const t = navigator.languages?.[0] ?? navigator.language;
|
|
68
|
-
return t ? new Intl.Locale(t).language :
|
|
68
|
+
return t ? new Intl.Locale(t).language : E;
|
|
69
69
|
} catch {
|
|
70
|
-
return
|
|
70
|
+
return E;
|
|
71
71
|
}
|
|
72
|
-
}, F = (t) => (e, s) => e ? typeof e == "string" ? e : e(t) ?? s : s,
|
|
72
|
+
}, F = (t) => (e, s) => e ? typeof e == "string" ? e : e(t) ?? s : s, Q = (t) => {
|
|
73
73
|
const e = F(t);
|
|
74
|
-
return (s, r) => e(s, typeof s == "string" ? s :
|
|
75
|
-
},
|
|
76
|
-
const { configurations: t } =
|
|
74
|
+
return (s, r) => e(s, typeof s == "string" ? s : P(r));
|
|
75
|
+
}, $t = () => {
|
|
76
|
+
const { configurations: t } = S(), e = F(t.locale);
|
|
77
77
|
return (s, r) => e(s, r);
|
|
78
|
-
},
|
|
79
|
-
const e = (s) => (r) => t[s ??
|
|
78
|
+
}, Kt = (t) => {
|
|
79
|
+
const e = (s) => (r) => t[s ?? E]?.[r] ?? t.en[r];
|
|
80
80
|
return {
|
|
81
81
|
/**
|
|
82
82
|
* Hook to get the translated label resolver function.
|
|
@@ -98,7 +98,7 @@ const C = "en", Pt = () => {
|
|
|
98
98
|
* ```
|
|
99
99
|
*/
|
|
100
100
|
useT: () => {
|
|
101
|
-
const { configurations: s } =
|
|
101
|
+
const { configurations: s } = S(), r = e(s.locale);
|
|
102
102
|
return ((n, ...o) => {
|
|
103
103
|
const l = r(n);
|
|
104
104
|
return typeof l == "function" ? l(o[0]) : l;
|
|
@@ -131,7 +131,7 @@ const C = "en", Pt = () => {
|
|
|
131
131
|
return typeof o == "function" ? o(r[0]) : o;
|
|
132
132
|
}
|
|
133
133
|
};
|
|
134
|
-
},
|
|
134
|
+
}, jt = Kt({
|
|
135
135
|
en: {
|
|
136
136
|
error404Title: "404 Not Found",
|
|
137
137
|
error404Body: "The page you requested could not be found.",
|
|
@@ -147,7 +147,9 @@ const C = "en", Pt = () => {
|
|
|
147
147
|
sidebar: "Sidebar",
|
|
148
148
|
sidebarDesc: "Displays the mobile sidebar.",
|
|
149
149
|
close: "Close",
|
|
150
|
-
more: "More"
|
|
150
|
+
more: "More",
|
|
151
|
+
commandPaletteSearch: "Search pages...",
|
|
152
|
+
commandPaletteNoResults: "No results found"
|
|
151
153
|
},
|
|
152
154
|
ja: {
|
|
153
155
|
error404Title: "404 ページが見つかりません",
|
|
@@ -164,21 +166,23 @@ const C = "en", Pt = () => {
|
|
|
164
166
|
sidebar: "サイドバー",
|
|
165
167
|
sidebarDesc: "モバイル用サイドバーを表示します。",
|
|
166
168
|
close: "閉じる",
|
|
167
|
-
more: "その他"
|
|
169
|
+
more: "その他",
|
|
170
|
+
commandPaletteSearch: "ページを検索...",
|
|
171
|
+
commandPaletteNoResults: "結果が見つかりません"
|
|
168
172
|
}
|
|
169
|
-
}),
|
|
170
|
-
const t =
|
|
173
|
+
}), R = jt.useT, I = () => {
|
|
174
|
+
const t = yt(), e = R(), s = {
|
|
171
175
|
role: "alert",
|
|
172
176
|
"aria-label": "default-error-boundary"
|
|
173
177
|
};
|
|
174
|
-
if (
|
|
178
|
+
if (Nt(t) && t.status === 404)
|
|
175
179
|
return /* @__PURE__ */ a("div", { ...s, className: "astw:p-6", children: /* @__PURE__ */ c("div", { className: "astw:flex astw:items-start astw:gap-4", children: [
|
|
176
|
-
/* @__PURE__ */ a(
|
|
180
|
+
/* @__PURE__ */ a(q, { className: "astw:h-5 astw:w-5 astw:text-destructive astw:flex-shrink-0 astw:mt-0.5" }),
|
|
177
181
|
/* @__PURE__ */ c("div", { children: [
|
|
178
182
|
/* @__PURE__ */ a("h1", { className: "astw:font-semibold astw:text-lg", children: e("error404Title") }),
|
|
179
183
|
/* @__PURE__ */ a("p", { className: "astw:text-sm astw:text-muted-foreground astw:mt-1", children: e("error404Body") }),
|
|
180
184
|
/* @__PURE__ */ a(
|
|
181
|
-
|
|
185
|
+
L,
|
|
182
186
|
{
|
|
183
187
|
variant: "outline",
|
|
184
188
|
size: "sm",
|
|
@@ -191,12 +195,12 @@ const C = "en", Pt = () => {
|
|
|
191
195
|
] }) });
|
|
192
196
|
const r = t instanceof Error ? t.message : e("errorUnexpected");
|
|
193
197
|
return /* @__PURE__ */ a("div", { ...s, className: "astw:p-6", children: /* @__PURE__ */ c("div", { className: "astw:flex astw:items-start astw:gap-4", children: [
|
|
194
|
-
/* @__PURE__ */ a(
|
|
198
|
+
/* @__PURE__ */ a(q, { className: "astw:h-5 astw:w-5 astw:text-destructive astw:flex-shrink-0 astw:mt-0.5" }),
|
|
195
199
|
/* @__PURE__ */ c("div", { children: [
|
|
196
200
|
/* @__PURE__ */ a("h1", { className: "astw:font-semibold astw:text-lg", children: e("errorTitle") }),
|
|
197
201
|
/* @__PURE__ */ a("p", { className: "astw:text-sm astw:text-muted-foreground astw:mt-1", children: r }),
|
|
198
202
|
/* @__PURE__ */ a(
|
|
199
|
-
|
|
203
|
+
L,
|
|
200
204
|
{
|
|
201
205
|
variant: "outline",
|
|
202
206
|
size: "sm",
|
|
@@ -207,36 +211,36 @@ const C = "en", Pt = () => {
|
|
|
207
211
|
)
|
|
208
212
|
] })
|
|
209
213
|
] }) });
|
|
210
|
-
},
|
|
214
|
+
}, Ut = (t) => ({
|
|
211
215
|
modules: t.modules,
|
|
212
216
|
settingsResources: t.settingsResources ?? [],
|
|
213
|
-
errorBoundary: t.errorBoundary ?? /* @__PURE__ */ a(
|
|
217
|
+
errorBoundary: t.errorBoundary ?? /* @__PURE__ */ a(I, {}),
|
|
214
218
|
basePath: t.basePath,
|
|
215
|
-
locale: t.locale ??
|
|
216
|
-
}),
|
|
219
|
+
locale: t.locale ?? Ot()
|
|
220
|
+
}), lt = j({
|
|
217
221
|
navItems: [],
|
|
218
222
|
configurations: {
|
|
219
223
|
modules: [],
|
|
220
224
|
settingsResources: [],
|
|
221
|
-
errorBoundary: /* @__PURE__ */ a(
|
|
222
|
-
locale:
|
|
225
|
+
errorBoundary: /* @__PURE__ */ a(I, {}),
|
|
226
|
+
locale: E
|
|
223
227
|
}
|
|
224
|
-
}),
|
|
225
|
-
const t =
|
|
226
|
-
return /* @__PURE__ */ c(
|
|
228
|
+
}), S = () => U(lt), Wt = () => {
|
|
229
|
+
const t = R();
|
|
230
|
+
return /* @__PURE__ */ c(B, { children: [
|
|
227
231
|
/* @__PURE__ */ a("p", { className: "astw:font-semibold astw:leading-none astw:tracking-tight", children: t("welcomeTitle") }),
|
|
228
232
|
/* @__PURE__ */ a("p", { className: "pt-4", children: t("welcomeBody") })
|
|
229
233
|
] });
|
|
230
|
-
},
|
|
231
|
-
/* @__PURE__ */ a(
|
|
232
|
-
/* @__PURE__ */ a(
|
|
233
|
-
] }),
|
|
234
|
-
const { configurations: t } =
|
|
234
|
+
}, X = () => /* @__PURE__ */ c(B, { children: [
|
|
235
|
+
/* @__PURE__ */ a(W, {}),
|
|
236
|
+
/* @__PURE__ */ a(It, {})
|
|
237
|
+
] }), Ht = () => {
|
|
238
|
+
const { configurations: t } = S(), e = R(), s = $t();
|
|
235
239
|
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: [
|
|
236
240
|
/* @__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: [
|
|
237
241
|
/* @__PURE__ */ a("h2", { className: "astw:text-sm astw:leading-[36px] astw:mb-2 astw:font-bold ", children: e("settings") }),
|
|
238
|
-
/* @__PURE__ */ a("ul", { className: "astw:flex astw:flex-col astw:gap-1", children: t.settingsResources.map((r) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a(
|
|
239
|
-
|
|
242
|
+
/* @__PURE__ */ a("ul", { className: "astw:flex astw:flex-col astw:gap-1", children: t.settingsResources.map((r) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a(Ct, { to: `./${r.path}`, children: ({ isActive: n }) => /* @__PURE__ */ c(
|
|
243
|
+
L,
|
|
240
244
|
{
|
|
241
245
|
variant: n ? "secondary" : "ghost",
|
|
242
246
|
className: "astw:w-full astw:justify-start",
|
|
@@ -247,29 +251,29 @@ const C = "en", Pt = () => {
|
|
|
247
251
|
}
|
|
248
252
|
) }) }, r.path)) })
|
|
249
253
|
] }) }),
|
|
250
|
-
/* @__PURE__ */ a("section", { className: "astw:bg-card astw:flex-1 astw:rounded-md astw:border astw:shadow-xs", children: /* @__PURE__ */ a(
|
|
254
|
+
/* @__PURE__ */ a("section", { className: "astw:bg-card astw:flex-1 astw:rounded-md astw:border astw:shadow-xs", children: /* @__PURE__ */ a(W, {}) })
|
|
251
255
|
] });
|
|
252
256
|
};
|
|
253
|
-
function
|
|
257
|
+
function sa(t) {
|
|
254
258
|
return {
|
|
255
259
|
redirectTo: t
|
|
256
260
|
};
|
|
257
261
|
}
|
|
258
|
-
function
|
|
262
|
+
function $(t) {
|
|
259
263
|
return typeof t == "object" && t !== null && "redirectTo" in t;
|
|
260
264
|
}
|
|
261
|
-
const
|
|
262
|
-
const { configurations: s } =
|
|
265
|
+
const dt = (t, e) => () => {
|
|
266
|
+
const { configurations: s } = S(), { metaTitle: r, fallbackTitle: n } = t, l = F(s.locale)(r, n);
|
|
263
267
|
return e(l);
|
|
264
268
|
};
|
|
265
|
-
function
|
|
266
|
-
const { path: e, meta: s, component: r, resources: n, errorBoundary: o } = t, l = s?.title ??
|
|
269
|
+
function ra(t) {
|
|
270
|
+
const { path: e, meta: s, component: r, resources: n, errorBoundary: o } = t, l = s?.title ?? P(e), d = P(e), i = $(r) ? {
|
|
267
271
|
// Use loader for redirects
|
|
268
272
|
component: () => null,
|
|
269
|
-
loader: () =>
|
|
273
|
+
loader: () => nt(r.redirectTo)
|
|
270
274
|
} : {
|
|
271
275
|
// Regular component with locale-aware title
|
|
272
|
-
component:
|
|
276
|
+
component: dt(
|
|
273
277
|
{ metaTitle: l, fallbackTitle: d },
|
|
274
278
|
(w) => r({ title: w, resources: n })
|
|
275
279
|
)
|
|
@@ -283,15 +287,15 @@ function Qe(t) {
|
|
|
283
287
|
title: l,
|
|
284
288
|
...s?.breadcrumbTitle !== void 0 ? { breadcrumbTitle: s.breadcrumbTitle } : {},
|
|
285
289
|
...s,
|
|
286
|
-
menuItemClickable:
|
|
290
|
+
menuItemClickable: !$(r),
|
|
287
291
|
icon: t.meta?.icon
|
|
288
292
|
},
|
|
289
293
|
resources: n,
|
|
290
|
-
errorBoundary: o || /* @__PURE__ */ a(
|
|
294
|
+
errorBoundary: o || /* @__PURE__ */ a(I, {})
|
|
291
295
|
};
|
|
292
296
|
}
|
|
293
|
-
function
|
|
294
|
-
const { path: e, component: s, subResources: r, meta: n, errorBoundary: o } = t, l = n?.title ??
|
|
297
|
+
function na(t) {
|
|
298
|
+
const { path: e, component: s, subResources: r, meta: n, errorBoundary: o } = t, l = n?.title ?? P(e), d = P(e);
|
|
295
299
|
return {
|
|
296
300
|
_type: "resource",
|
|
297
301
|
type: "component",
|
|
@@ -301,15 +305,15 @@ function Ke(t) {
|
|
|
301
305
|
icon: n?.icon,
|
|
302
306
|
...n?.breadcrumbTitle !== void 0 ? { breadcrumbTitle: n.breadcrumbTitle } : {}
|
|
303
307
|
},
|
|
304
|
-
component:
|
|
308
|
+
component: dt(
|
|
305
309
|
{ metaTitle: l, fallbackTitle: d },
|
|
306
310
|
(i) => s({ title: i, resources: r })
|
|
307
311
|
),
|
|
308
312
|
subResources: r,
|
|
309
|
-
errorBoundary: o ?? /* @__PURE__ */ a(
|
|
313
|
+
errorBoundary: o ?? /* @__PURE__ */ a(I, {})
|
|
310
314
|
};
|
|
311
315
|
}
|
|
312
|
-
const
|
|
316
|
+
const G = (t) => () => /* @__PURE__ */ a(B, { children: t }), ct = (t, e, s) => {
|
|
313
317
|
const r = t.errorBoundary || s, n = {
|
|
314
318
|
index: !0,
|
|
315
319
|
Component: t.component,
|
|
@@ -318,38 +322,38 @@ const Q = (t) => () => /* @__PURE__ */ a(S, { children: t }), lt = (t, e, s) =>
|
|
|
318
322
|
return {
|
|
319
323
|
path: t.path,
|
|
320
324
|
...t.errorBoundary && {
|
|
321
|
-
ErrorBoundary:
|
|
325
|
+
ErrorBoundary: G(t.errorBoundary)
|
|
322
326
|
},
|
|
323
327
|
...e && e.length > 0 ? {
|
|
324
328
|
children: [
|
|
325
329
|
n,
|
|
326
330
|
...e.map(
|
|
327
|
-
(o) =>
|
|
331
|
+
(o) => ct(o, o.subResources, r)
|
|
328
332
|
)
|
|
329
333
|
]
|
|
330
334
|
} : {
|
|
331
335
|
children: [n]
|
|
332
336
|
}
|
|
333
337
|
};
|
|
334
|
-
},
|
|
335
|
-
(e) =>
|
|
336
|
-
),
|
|
338
|
+
}, Ft = (t) => t.map(
|
|
339
|
+
(e) => ct(e, e.resources, e.errorBoundary)
|
|
340
|
+
), Qt = ({
|
|
337
341
|
modules: t,
|
|
338
342
|
settingsResources: e,
|
|
339
343
|
rootComponent: s
|
|
340
344
|
}) => {
|
|
341
|
-
const r =
|
|
345
|
+
const r = $(s) ? {
|
|
342
346
|
index: !0,
|
|
343
|
-
loader: () =>
|
|
347
|
+
loader: () => nt(s.redirectTo)
|
|
344
348
|
} : {
|
|
345
349
|
index: !0,
|
|
346
|
-
Component: s ??
|
|
350
|
+
Component: s ?? Wt
|
|
347
351
|
}, n = e.length > 0 ? [
|
|
348
352
|
{
|
|
349
353
|
path: "settings",
|
|
350
354
|
index: !0,
|
|
351
355
|
Component: () => /* @__PURE__ */ a(
|
|
352
|
-
|
|
356
|
+
St,
|
|
353
357
|
{
|
|
354
358
|
to: e[0].path,
|
|
355
359
|
relative: "path",
|
|
@@ -359,12 +363,12 @@ const Q = (t) => () => /* @__PURE__ */ a(S, { children: t }), lt = (t, e, s) =>
|
|
|
359
363
|
},
|
|
360
364
|
{
|
|
361
365
|
path: "settings",
|
|
362
|
-
Component:
|
|
366
|
+
Component: Ht,
|
|
363
367
|
children: e.map((o) => ({
|
|
364
368
|
path: o.path,
|
|
365
369
|
Component: o.component,
|
|
366
370
|
...o.errorBoundary && {
|
|
367
|
-
ErrorBoundary:
|
|
371
|
+
ErrorBoundary: G(o.errorBoundary)
|
|
368
372
|
}
|
|
369
373
|
}))
|
|
370
374
|
}
|
|
@@ -372,7 +376,7 @@ const Q = (t) => () => /* @__PURE__ */ a(S, { children: t }), lt = (t, e, s) =>
|
|
|
372
376
|
return [
|
|
373
377
|
r,
|
|
374
378
|
{
|
|
375
|
-
children:
|
|
379
|
+
children: Ft(t)
|
|
376
380
|
},
|
|
377
381
|
...n,
|
|
378
382
|
{
|
|
@@ -382,8 +386,8 @@ const Q = (t) => () => /* @__PURE__ */ a(S, { children: t }), lt = (t, e, s) =>
|
|
|
382
386
|
}
|
|
383
387
|
}
|
|
384
388
|
];
|
|
385
|
-
},
|
|
386
|
-
const { configurations: e } =
|
|
389
|
+
}, Gt = (t) => {
|
|
390
|
+
const { configurations: e } = S(), { rootComponent: s, children: r } = t, n = Qt({
|
|
387
391
|
modules: e.modules,
|
|
388
392
|
settingsResources: e.settingsResources,
|
|
389
393
|
rootComponent: s
|
|
@@ -392,8 +396,8 @@ const Q = (t) => () => /* @__PURE__ */ a(S, { children: t }), lt = (t, e, s) =>
|
|
|
392
396
|
element: r,
|
|
393
397
|
children: o ? [
|
|
394
398
|
{
|
|
395
|
-
element: /* @__PURE__ */ a(
|
|
396
|
-
ErrorBoundary:
|
|
399
|
+
element: /* @__PURE__ */ a(W, {}),
|
|
400
|
+
ErrorBoundary: G(o),
|
|
397
401
|
children: n
|
|
398
402
|
}
|
|
399
403
|
] : n
|
|
@@ -401,25 +405,25 @@ const Q = (t) => () => /* @__PURE__ */ a(S, { children: t }), lt = (t, e, s) =>
|
|
|
401
405
|
], d = e.basePath ? "/" + e.basePath : void 0, i = t.memory ? Tt(l, {
|
|
402
406
|
basename: d,
|
|
403
407
|
...t.initialEntries ? { initialEntries: t.initialEntries } : {}
|
|
404
|
-
}) :
|
|
408
|
+
}) : kt(l, {
|
|
405
409
|
basename: d
|
|
406
410
|
});
|
|
407
|
-
return /* @__PURE__ */ a(
|
|
408
|
-
},
|
|
411
|
+
return /* @__PURE__ */ a(Rt, { router: i });
|
|
412
|
+
}, Vt = {
|
|
409
413
|
resolvedTheme: "light",
|
|
410
414
|
theme: "system",
|
|
411
415
|
setTheme: () => null
|
|
412
|
-
},
|
|
413
|
-
function
|
|
416
|
+
}, wt = j(Vt);
|
|
417
|
+
function qt({
|
|
414
418
|
children: t,
|
|
415
419
|
storageKey: e,
|
|
416
420
|
defaultTheme: s = "system",
|
|
417
421
|
...r
|
|
418
422
|
}) {
|
|
419
|
-
const [n, o] =
|
|
423
|
+
const [n, o] = T(
|
|
420
424
|
() => localStorage.getItem(e) || s
|
|
421
|
-
), l =
|
|
422
|
-
|
|
425
|
+
), l = A(() => n !== "system" ? n : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", [n]);
|
|
426
|
+
C(() => {
|
|
423
427
|
const i = window.document.documentElement;
|
|
424
428
|
i.classList.remove("light", "dark"), i.classList.add(l);
|
|
425
429
|
}, [l]);
|
|
@@ -430,20 +434,20 @@ function Qt({
|
|
|
430
434
|
localStorage.setItem(e, i), o(i);
|
|
431
435
|
}
|
|
432
436
|
};
|
|
433
|
-
return /* @__PURE__ */ a(
|
|
437
|
+
return /* @__PURE__ */ a(wt.Provider, { ...r, value: d, children: t });
|
|
434
438
|
}
|
|
435
|
-
const
|
|
436
|
-
const t =
|
|
439
|
+
const Xt = () => {
|
|
440
|
+
const t = U(wt);
|
|
437
441
|
if (t === void 0)
|
|
438
442
|
throw new Error("useTheme must be used within a ThemeProvider");
|
|
439
443
|
return t;
|
|
440
|
-
},
|
|
441
|
-
const [e, s] =
|
|
442
|
-
|
|
444
|
+
}, oa = (t) => {
|
|
445
|
+
const [e, s] = T(!1);
|
|
446
|
+
C(function() {
|
|
443
447
|
s(!0);
|
|
444
448
|
}, []);
|
|
445
|
-
const r =
|
|
446
|
-
const o = t.modules, l =
|
|
449
|
+
const r = Ut(t), n = A(() => {
|
|
450
|
+
const o = t.modules, l = Q(r.locale);
|
|
447
451
|
return o.map((d) => {
|
|
448
452
|
const i = l(d.meta.title, d.path), w = d.resources.map((m) => ({
|
|
449
453
|
title: l(m.meta.title, m.path),
|
|
@@ -453,14 +457,14 @@ const Kt = () => {
|
|
|
453
457
|
title: i,
|
|
454
458
|
url: d.meta.menuItemClickable ? d.path : void 0,
|
|
455
459
|
clickable: d.component,
|
|
456
|
-
icon: d.meta.icon || /* @__PURE__ */ a(
|
|
460
|
+
icon: d.meta.icon || /* @__PURE__ */ a(bt, {}),
|
|
457
461
|
isActive: !0,
|
|
458
462
|
items: w
|
|
459
463
|
};
|
|
460
464
|
});
|
|
461
465
|
}, [t.modules, r.locale]);
|
|
462
466
|
return e ? /* @__PURE__ */ a(
|
|
463
|
-
|
|
467
|
+
lt.Provider,
|
|
464
468
|
{
|
|
465
469
|
value: {
|
|
466
470
|
title: t.title,
|
|
@@ -468,63 +472,79 @@ const Kt = () => {
|
|
|
468
472
|
configurations: r,
|
|
469
473
|
navItems: n
|
|
470
474
|
},
|
|
471
|
-
children: /* @__PURE__ */ a(
|
|
475
|
+
children: /* @__PURE__ */ a(qt, { defaultTheme: "system", storageKey: "appshell-ui-theme", children: /* @__PURE__ */ a(Gt, { rootComponent: t.rootComponent, children: t.children }) })
|
|
472
476
|
}
|
|
473
477
|
) : null;
|
|
474
478
|
};
|
|
475
|
-
function
|
|
479
|
+
function Yt({
|
|
476
480
|
...t
|
|
477
481
|
}) {
|
|
478
|
-
return /* @__PURE__ */ a(
|
|
482
|
+
return /* @__PURE__ */ a(H.Root, { "data-slot": "collapsible", ...t });
|
|
479
483
|
}
|
|
480
|
-
function
|
|
484
|
+
function Y({
|
|
481
485
|
...t
|
|
482
486
|
}) {
|
|
483
487
|
return /* @__PURE__ */ a(
|
|
484
|
-
|
|
488
|
+
H.CollapsibleTrigger,
|
|
485
489
|
{
|
|
486
490
|
"data-slot": "collapsible-trigger",
|
|
487
491
|
...t
|
|
488
492
|
}
|
|
489
493
|
);
|
|
490
494
|
}
|
|
491
|
-
function
|
|
495
|
+
function Jt({
|
|
492
496
|
...t
|
|
493
497
|
}) {
|
|
494
498
|
return /* @__PURE__ */ a(
|
|
495
|
-
|
|
499
|
+
H.CollapsibleContent,
|
|
496
500
|
{
|
|
497
501
|
"data-slot": "collapsible-content",
|
|
498
502
|
...t
|
|
499
503
|
}
|
|
500
504
|
);
|
|
501
505
|
}
|
|
502
|
-
const
|
|
503
|
-
function
|
|
504
|
-
const [t, e] =
|
|
506
|
+
const M = 768;
|
|
507
|
+
function Zt() {
|
|
508
|
+
const [t, e] = y.useState(
|
|
505
509
|
void 0
|
|
506
510
|
);
|
|
507
|
-
return
|
|
508
|
-
const s = window.matchMedia(`(max-width: ${
|
|
509
|
-
e(window.innerWidth <
|
|
511
|
+
return y.useEffect(() => {
|
|
512
|
+
const s = window.matchMedia(`(max-width: ${M - 1}px)`), r = () => {
|
|
513
|
+
e(window.innerWidth < M);
|
|
510
514
|
};
|
|
511
|
-
return s.addEventListener("change", r), e(window.innerWidth <
|
|
515
|
+
return s.addEventListener("change", r), e(window.innerWidth < M), () => s.removeEventListener("change", r);
|
|
512
516
|
}, []), !!t;
|
|
513
517
|
}
|
|
514
|
-
function
|
|
515
|
-
return /* @__PURE__ */ a(
|
|
518
|
+
function te({ className: t, type: e, ...s }) {
|
|
519
|
+
return /* @__PURE__ */ a(
|
|
520
|
+
"input",
|
|
521
|
+
{
|
|
522
|
+
type: e,
|
|
523
|
+
"data-slot": "input",
|
|
524
|
+
className: u(
|
|
525
|
+
"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",
|
|
526
|
+
"astw:focus-visible:border-ring astw:focus-visible:ring-ring/50 astw:focus-visible:ring-[3px]",
|
|
527
|
+
"astw:aria-invalid:ring-destructive/20 astw:dark:aria-invalid:ring-destructive/40 astw:aria-invalid:border-destructive",
|
|
528
|
+
t
|
|
529
|
+
),
|
|
530
|
+
...s
|
|
531
|
+
}
|
|
532
|
+
);
|
|
533
|
+
}
|
|
534
|
+
function ee({ ...t }) {
|
|
535
|
+
return /* @__PURE__ */ a(v.Root, { "data-slot": "sheet", ...t });
|
|
516
536
|
}
|
|
517
|
-
function
|
|
537
|
+
function ae({
|
|
518
538
|
...t
|
|
519
539
|
}) {
|
|
520
|
-
return /* @__PURE__ */ a(
|
|
540
|
+
return /* @__PURE__ */ a(v.Portal, { "data-slot": "sheet-portal", ...t });
|
|
521
541
|
}
|
|
522
|
-
function
|
|
542
|
+
function se({
|
|
523
543
|
className: t,
|
|
524
544
|
...e
|
|
525
545
|
}) {
|
|
526
546
|
return /* @__PURE__ */ a(
|
|
527
|
-
|
|
547
|
+
v.Overlay,
|
|
528
548
|
{
|
|
529
549
|
"data-slot": "sheet-overlay",
|
|
530
550
|
className: u(
|
|
@@ -535,16 +555,16 @@ function Jt({
|
|
|
535
555
|
}
|
|
536
556
|
);
|
|
537
557
|
}
|
|
538
|
-
function
|
|
558
|
+
function re({
|
|
539
559
|
className: t,
|
|
540
560
|
children: e,
|
|
541
561
|
side: s = "right",
|
|
542
562
|
...r
|
|
543
563
|
}) {
|
|
544
|
-
return /* @__PURE__ */ c(
|
|
545
|
-
/* @__PURE__ */ a(
|
|
564
|
+
return /* @__PURE__ */ c(ae, { children: [
|
|
565
|
+
/* @__PURE__ */ a(se, {}),
|
|
546
566
|
/* @__PURE__ */ c(
|
|
547
|
-
|
|
567
|
+
v.Content,
|
|
548
568
|
{
|
|
549
569
|
"data-slot": "sheet-content",
|
|
550
570
|
className: u(
|
|
@@ -558,8 +578,8 @@ function Zt({
|
|
|
558
578
|
...r,
|
|
559
579
|
children: [
|
|
560
580
|
e,
|
|
561
|
-
/* @__PURE__ */ c(
|
|
562
|
-
/* @__PURE__ */ a(
|
|
581
|
+
/* @__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: [
|
|
582
|
+
/* @__PURE__ */ a(rt, { className: "astw:size-4" }),
|
|
563
583
|
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: "Close" })
|
|
564
584
|
] })
|
|
565
585
|
]
|
|
@@ -567,7 +587,7 @@ function Zt({
|
|
|
567
587
|
)
|
|
568
588
|
] });
|
|
569
589
|
}
|
|
570
|
-
function
|
|
590
|
+
function ne({ className: t, ...e }) {
|
|
571
591
|
return /* @__PURE__ */ a(
|
|
572
592
|
"div",
|
|
573
593
|
{
|
|
@@ -577,12 +597,12 @@ function te({ className: t, ...e }) {
|
|
|
577
597
|
}
|
|
578
598
|
);
|
|
579
599
|
}
|
|
580
|
-
function
|
|
600
|
+
function oe({
|
|
581
601
|
className: t,
|
|
582
602
|
...e
|
|
583
603
|
}) {
|
|
584
604
|
return /* @__PURE__ */ a(
|
|
585
|
-
|
|
605
|
+
v.Title,
|
|
586
606
|
{
|
|
587
607
|
"data-slot": "sheet-title",
|
|
588
608
|
className: u("astw:text-foreground astw:font-semibold", t),
|
|
@@ -590,12 +610,12 @@ function ee({
|
|
|
590
610
|
}
|
|
591
611
|
);
|
|
592
612
|
}
|
|
593
|
-
function
|
|
613
|
+
function ie({
|
|
594
614
|
className: t,
|
|
595
615
|
...e
|
|
596
616
|
}) {
|
|
597
617
|
return /* @__PURE__ */ a(
|
|
598
|
-
|
|
618
|
+
v.Description,
|
|
599
619
|
{
|
|
600
620
|
"data-slot": "sheet-description",
|
|
601
621
|
className: u("astw:text-muted-foreground astw:text-sm", t),
|
|
@@ -603,12 +623,12 @@ function ae({
|
|
|
603
623
|
}
|
|
604
624
|
);
|
|
605
625
|
}
|
|
606
|
-
function
|
|
626
|
+
function ut({
|
|
607
627
|
delayDuration: t = 0,
|
|
608
628
|
...e
|
|
609
629
|
}) {
|
|
610
630
|
return /* @__PURE__ */ a(
|
|
611
|
-
|
|
631
|
+
k.Provider,
|
|
612
632
|
{
|
|
613
633
|
"data-slot": "tooltip-provider",
|
|
614
634
|
delayDuration: t,
|
|
@@ -616,24 +636,24 @@ function ct({
|
|
|
616
636
|
}
|
|
617
637
|
);
|
|
618
638
|
}
|
|
619
|
-
function
|
|
639
|
+
function le({
|
|
620
640
|
...t
|
|
621
641
|
}) {
|
|
622
|
-
return /* @__PURE__ */ a(
|
|
642
|
+
return /* @__PURE__ */ a(ut, { children: /* @__PURE__ */ a(k.Root, { "data-slot": "tooltip", ...t }) });
|
|
623
643
|
}
|
|
624
|
-
function
|
|
644
|
+
function de({
|
|
625
645
|
...t
|
|
626
646
|
}) {
|
|
627
|
-
return /* @__PURE__ */ a(
|
|
647
|
+
return /* @__PURE__ */ a(k.Trigger, { "data-slot": "tooltip-trigger", ...t });
|
|
628
648
|
}
|
|
629
|
-
function
|
|
649
|
+
function ce({
|
|
630
650
|
className: t,
|
|
631
651
|
sideOffset: e = 0,
|
|
632
652
|
children: s,
|
|
633
653
|
...r
|
|
634
654
|
}) {
|
|
635
|
-
return /* @__PURE__ */ a(
|
|
636
|
-
|
|
655
|
+
return /* @__PURE__ */ a(k.Portal, { children: /* @__PURE__ */ c(
|
|
656
|
+
k.Content,
|
|
637
657
|
{
|
|
638
658
|
"data-slot": "tooltip-content",
|
|
639
659
|
sideOffset: e,
|
|
@@ -644,19 +664,19 @@ function ne({
|
|
|
644
664
|
...r,
|
|
645
665
|
children: [
|
|
646
666
|
s,
|
|
647
|
-
/* @__PURE__ */ a(
|
|
667
|
+
/* @__PURE__ */ a(k.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]" })
|
|
648
668
|
]
|
|
649
669
|
}
|
|
650
670
|
) });
|
|
651
671
|
}
|
|
652
|
-
const
|
|
672
|
+
const we = "sidebar_state", ue = 3600 * 24 * 7, me = "16rem", he = "18rem", fe = "3rem", be = "b", mt = y.createContext(null);
|
|
653
673
|
function _() {
|
|
654
|
-
const t =
|
|
674
|
+
const t = y.useContext(mt);
|
|
655
675
|
if (!t)
|
|
656
676
|
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
657
677
|
return t;
|
|
658
678
|
}
|
|
659
|
-
function
|
|
679
|
+
function ge({
|
|
660
680
|
defaultOpen: t = !0,
|
|
661
681
|
open: e,
|
|
662
682
|
onOpenChange: s,
|
|
@@ -665,38 +685,38 @@ function ue({
|
|
|
665
685
|
children: o,
|
|
666
686
|
...l
|
|
667
687
|
}) {
|
|
668
|
-
const d =
|
|
669
|
-
(
|
|
670
|
-
const
|
|
671
|
-
s ? s(
|
|
688
|
+
const d = Zt(), [i, w] = y.useState(!1), [m, f] = y.useState(t), g = e ?? m, h = y.useCallback(
|
|
689
|
+
(p) => {
|
|
690
|
+
const N = typeof p == "function" ? p(g) : p;
|
|
691
|
+
s ? s(N) : f(N), document.cookie = `${we}=${N}; path=/; max-age=${ue}`;
|
|
672
692
|
},
|
|
673
|
-
[s,
|
|
674
|
-
),
|
|
675
|
-
|
|
676
|
-
const
|
|
677
|
-
|
|
693
|
+
[s, g]
|
|
694
|
+
), b = y.useCallback(() => d ? w((p) => !p) : h((p) => !p), [d, h, w]);
|
|
695
|
+
y.useEffect(() => {
|
|
696
|
+
const p = (N) => {
|
|
697
|
+
N.key === be && (N.metaKey || N.ctrlKey) && (N.preventDefault(), b());
|
|
678
698
|
};
|
|
679
|
-
return window.addEventListener("keydown",
|
|
680
|
-
}, [
|
|
681
|
-
const
|
|
699
|
+
return window.addEventListener("keydown", p), () => window.removeEventListener("keydown", p);
|
|
700
|
+
}, [b]);
|
|
701
|
+
const x = g ? "expanded" : "collapsed", V = y.useMemo(
|
|
682
702
|
() => ({
|
|
683
|
-
state:
|
|
684
|
-
open:
|
|
685
|
-
setOpen:
|
|
703
|
+
state: x,
|
|
704
|
+
open: g,
|
|
705
|
+
setOpen: h,
|
|
686
706
|
isMobile: d,
|
|
687
707
|
openMobile: i,
|
|
688
708
|
setOpenMobile: w,
|
|
689
|
-
toggleSidebar:
|
|
709
|
+
toggleSidebar: b
|
|
690
710
|
}),
|
|
691
|
-
[
|
|
711
|
+
[x, g, h, d, i, w, b]
|
|
692
712
|
);
|
|
693
|
-
return /* @__PURE__ */ a(
|
|
713
|
+
return /* @__PURE__ */ a(mt.Provider, { value: V, children: /* @__PURE__ */ a(ut, { delayDuration: 0, children: /* @__PURE__ */ a(
|
|
694
714
|
"div",
|
|
695
715
|
{
|
|
696
716
|
"data-slot": "sidebar-wrapper",
|
|
697
717
|
style: {
|
|
698
|
-
"--sidebar-width":
|
|
699
|
-
"--sidebar-width-icon":
|
|
718
|
+
"--sidebar-width": me,
|
|
719
|
+
"--sidebar-width-icon": fe,
|
|
700
720
|
...n
|
|
701
721
|
},
|
|
702
722
|
className: u(
|
|
@@ -708,7 +728,7 @@ function ue({
|
|
|
708
728
|
}
|
|
709
729
|
) }) });
|
|
710
730
|
}
|
|
711
|
-
function
|
|
731
|
+
function pe({
|
|
712
732
|
side: t = "left",
|
|
713
733
|
variant: e = "sidebar",
|
|
714
734
|
collapsible: s = "offcanvas",
|
|
@@ -728,21 +748,21 @@ function me({
|
|
|
728
748
|
...o,
|
|
729
749
|
children: n
|
|
730
750
|
}
|
|
731
|
-
) : l ? /* @__PURE__ */ a(
|
|
732
|
-
|
|
751
|
+
) : l ? /* @__PURE__ */ a(ee, { open: i, onOpenChange: w, ...o, children: /* @__PURE__ */ c(
|
|
752
|
+
re,
|
|
733
753
|
{
|
|
734
754
|
"data-sidebar": "sidebar",
|
|
735
755
|
"data-slot": "sidebar",
|
|
736
756
|
"data-mobile": "true",
|
|
737
757
|
className: "astw:bg-sidebar astw:text-sidebar-foreground astw:w-(--sidebar-width) astw:p-0 astw:[&>button]:hidden",
|
|
738
758
|
style: {
|
|
739
|
-
"--sidebar-width":
|
|
759
|
+
"--sidebar-width": he
|
|
740
760
|
},
|
|
741
761
|
side: t,
|
|
742
762
|
children: [
|
|
743
|
-
/* @__PURE__ */ c(
|
|
744
|
-
/* @__PURE__ */ a(
|
|
745
|
-
/* @__PURE__ */ a(
|
|
763
|
+
/* @__PURE__ */ c(ne, { className: "astw:sr-only", children: [
|
|
764
|
+
/* @__PURE__ */ a(oe, { children: "Sidebar" }),
|
|
765
|
+
/* @__PURE__ */ a(ie, { children: "Displays the mobile sidebar." })
|
|
746
766
|
] }),
|
|
747
767
|
/* @__PURE__ */ a("div", { className: "flex h-full w-full flex-col", children: n })
|
|
748
768
|
]
|
|
@@ -797,14 +817,14 @@ function me({
|
|
|
797
817
|
}
|
|
798
818
|
);
|
|
799
819
|
}
|
|
800
|
-
function
|
|
820
|
+
function ht({
|
|
801
821
|
className: t,
|
|
802
822
|
onClick: e,
|
|
803
823
|
...s
|
|
804
824
|
}) {
|
|
805
825
|
const { toggleSidebar: r } = _();
|
|
806
826
|
return /* @__PURE__ */ c(
|
|
807
|
-
|
|
827
|
+
L,
|
|
808
828
|
{
|
|
809
829
|
"data-sidebar": "trigger",
|
|
810
830
|
"data-slot": "sidebar-trigger",
|
|
@@ -816,13 +836,13 @@ function ut({
|
|
|
816
836
|
},
|
|
817
837
|
...s,
|
|
818
838
|
children: [
|
|
819
|
-
/* @__PURE__ */ a(
|
|
839
|
+
/* @__PURE__ */ a(gt, { className: "astw:size-4.5" }),
|
|
820
840
|
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: "Toggle Sidebar" })
|
|
821
841
|
]
|
|
822
842
|
}
|
|
823
843
|
);
|
|
824
844
|
}
|
|
825
|
-
function
|
|
845
|
+
function ve({ className: t, ...e }) {
|
|
826
846
|
return /* @__PURE__ */ a(
|
|
827
847
|
"main",
|
|
828
848
|
{
|
|
@@ -837,7 +857,7 @@ function he({ className: t, ...e }) {
|
|
|
837
857
|
}
|
|
838
858
|
);
|
|
839
859
|
}
|
|
840
|
-
function
|
|
860
|
+
function xe({ className: t, ...e }) {
|
|
841
861
|
return /* @__PURE__ */ a(
|
|
842
862
|
"div",
|
|
843
863
|
{
|
|
@@ -848,7 +868,7 @@ function be({ className: t, ...e }) {
|
|
|
848
868
|
}
|
|
849
869
|
);
|
|
850
870
|
}
|
|
851
|
-
function
|
|
871
|
+
function ye({ className: t, ...e }) {
|
|
852
872
|
return /* @__PURE__ */ a(
|
|
853
873
|
"div",
|
|
854
874
|
{
|
|
@@ -862,7 +882,7 @@ function fe({ className: t, ...e }) {
|
|
|
862
882
|
}
|
|
863
883
|
);
|
|
864
884
|
}
|
|
865
|
-
function
|
|
885
|
+
function Ne({ className: t, ...e }) {
|
|
866
886
|
return /* @__PURE__ */ a(
|
|
867
887
|
"div",
|
|
868
888
|
{
|
|
@@ -873,7 +893,7 @@ function ge({ className: t, ...e }) {
|
|
|
873
893
|
}
|
|
874
894
|
);
|
|
875
895
|
}
|
|
876
|
-
function
|
|
896
|
+
function Ce({ className: t, ...e }) {
|
|
877
897
|
return /* @__PURE__ */ a(
|
|
878
898
|
"ul",
|
|
879
899
|
{
|
|
@@ -884,7 +904,7 @@ function pe({ className: t, ...e }) {
|
|
|
884
904
|
}
|
|
885
905
|
);
|
|
886
906
|
}
|
|
887
|
-
function
|
|
907
|
+
function Se({ className: t, ...e }) {
|
|
888
908
|
return /* @__PURE__ */ a(
|
|
889
909
|
"li",
|
|
890
910
|
{
|
|
@@ -895,7 +915,7 @@ function ve({ className: t, ...e }) {
|
|
|
895
915
|
}
|
|
896
916
|
);
|
|
897
917
|
}
|
|
898
|
-
const
|
|
918
|
+
const Te = it(
|
|
899
919
|
"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:[&>svg]:size-4 astw:[&>svg]:shrink-0",
|
|
900
920
|
{
|
|
901
921
|
variants: {
|
|
@@ -915,7 +935,7 @@ const xe = rt(
|
|
|
915
935
|
}
|
|
916
936
|
}
|
|
917
937
|
);
|
|
918
|
-
function
|
|
938
|
+
function J({
|
|
919
939
|
asChild: t = !1,
|
|
920
940
|
isActive: e = !1,
|
|
921
941
|
variant: s = "default",
|
|
@@ -924,23 +944,23 @@ function X({
|
|
|
924
944
|
className: o,
|
|
925
945
|
...l
|
|
926
946
|
}) {
|
|
927
|
-
const d = t ?
|
|
947
|
+
const d = t ? D : "button", { isMobile: i, state: w } = _(), m = /* @__PURE__ */ a(
|
|
928
948
|
d,
|
|
929
949
|
{
|
|
930
950
|
"data-slot": "sidebar-menu-button",
|
|
931
951
|
"data-sidebar": "menu-button",
|
|
932
952
|
"data-size": r,
|
|
933
953
|
"data-active": e,
|
|
934
|
-
className: u(
|
|
954
|
+
className: u(Te({ variant: s, size: r }), o),
|
|
935
955
|
...l
|
|
936
956
|
}
|
|
937
957
|
);
|
|
938
958
|
return n ? (typeof n == "string" && (n = {
|
|
939
959
|
children: n
|
|
940
|
-
}), /* @__PURE__ */ c(
|
|
941
|
-
/* @__PURE__ */ a(
|
|
960
|
+
}), /* @__PURE__ */ c(le, { children: [
|
|
961
|
+
/* @__PURE__ */ a(de, { asChild: !0, children: m }),
|
|
942
962
|
/* @__PURE__ */ a(
|
|
943
|
-
|
|
963
|
+
ce,
|
|
944
964
|
{
|
|
945
965
|
side: "right",
|
|
946
966
|
align: "center",
|
|
@@ -950,14 +970,14 @@ function X({
|
|
|
950
970
|
)
|
|
951
971
|
] })) : m;
|
|
952
972
|
}
|
|
953
|
-
function
|
|
973
|
+
function Z({
|
|
954
974
|
className: t,
|
|
955
975
|
asChild: e = !1,
|
|
956
976
|
showOnHover: s = !1,
|
|
957
977
|
...r
|
|
958
978
|
}) {
|
|
959
979
|
return /* @__PURE__ */ a(
|
|
960
|
-
e ?
|
|
980
|
+
e ? D : "button",
|
|
961
981
|
{
|
|
962
982
|
"data-slot": "sidebar-menu-action",
|
|
963
983
|
"data-sidebar": "menu-action",
|
|
@@ -976,7 +996,7 @@ function Y({
|
|
|
976
996
|
}
|
|
977
997
|
);
|
|
978
998
|
}
|
|
979
|
-
function
|
|
999
|
+
function ke({ className: t, ...e }) {
|
|
980
1000
|
return /* @__PURE__ */ a(
|
|
981
1001
|
"ul",
|
|
982
1002
|
{
|
|
@@ -991,7 +1011,7 @@ function ye({ className: t, ...e }) {
|
|
|
991
1011
|
}
|
|
992
1012
|
);
|
|
993
1013
|
}
|
|
994
|
-
function
|
|
1014
|
+
function Re({
|
|
995
1015
|
className: t,
|
|
996
1016
|
...e
|
|
997
1017
|
}) {
|
|
@@ -1005,7 +1025,7 @@ function Te({
|
|
|
1005
1025
|
}
|
|
1006
1026
|
);
|
|
1007
1027
|
}
|
|
1008
|
-
function
|
|
1028
|
+
function Ee({
|
|
1009
1029
|
asChild: t = !1,
|
|
1010
1030
|
size: e = "md",
|
|
1011
1031
|
isActive: s = !1,
|
|
@@ -1013,7 +1033,7 @@ function Ne({
|
|
|
1013
1033
|
...n
|
|
1014
1034
|
}) {
|
|
1015
1035
|
return /* @__PURE__ */ a(
|
|
1016
|
-
t ?
|
|
1036
|
+
t ? D : "a",
|
|
1017
1037
|
{
|
|
1018
1038
|
"data-slot": "sidebar-menu-sub-button",
|
|
1019
1039
|
"data-sidebar": "menu-sub-button",
|
|
@@ -1031,17 +1051,17 @@ function Ne({
|
|
|
1031
1051
|
}
|
|
1032
1052
|
);
|
|
1033
1053
|
}
|
|
1034
|
-
function
|
|
1054
|
+
function K({ to: t, children: e, ...s }) {
|
|
1035
1055
|
try {
|
|
1036
|
-
return
|
|
1056
|
+
return Et(t), /* @__PURE__ */ a(Bt, { to: t, ...s, children: e });
|
|
1037
1057
|
} catch {
|
|
1038
1058
|
return /* @__PURE__ */ a("a", { href: t, ...s, children: e });
|
|
1039
1059
|
}
|
|
1040
1060
|
}
|
|
1041
|
-
function
|
|
1061
|
+
function tt({ ...t }) {
|
|
1042
1062
|
return /* @__PURE__ */ a("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...t });
|
|
1043
1063
|
}
|
|
1044
|
-
function
|
|
1064
|
+
function et({ className: t, ...e }) {
|
|
1045
1065
|
return /* @__PURE__ */ a(
|
|
1046
1066
|
"ol",
|
|
1047
1067
|
{
|
|
@@ -1054,7 +1074,7 @@ function Z({ className: t, ...e }) {
|
|
|
1054
1074
|
}
|
|
1055
1075
|
);
|
|
1056
1076
|
}
|
|
1057
|
-
function
|
|
1077
|
+
function at({ className: t, ...e }) {
|
|
1058
1078
|
return /* @__PURE__ */ a(
|
|
1059
1079
|
"li",
|
|
1060
1080
|
{
|
|
@@ -1064,14 +1084,14 @@ function tt({ className: t, ...e }) {
|
|
|
1064
1084
|
}
|
|
1065
1085
|
);
|
|
1066
1086
|
}
|
|
1067
|
-
function
|
|
1087
|
+
function st({
|
|
1068
1088
|
asChild: t,
|
|
1069
1089
|
className: e,
|
|
1070
1090
|
children: s,
|
|
1071
1091
|
...r
|
|
1072
1092
|
}) {
|
|
1073
1093
|
return /* @__PURE__ */ a(
|
|
1074
|
-
t ?
|
|
1094
|
+
t ? D : K,
|
|
1075
1095
|
{
|
|
1076
1096
|
"data-slot": "breadcrumb-link",
|
|
1077
1097
|
className: u("astw:hover:text-foreground astw:transition-colors", e),
|
|
@@ -1080,7 +1100,7 @@ function et({
|
|
|
1080
1100
|
}
|
|
1081
1101
|
);
|
|
1082
1102
|
}
|
|
1083
|
-
function
|
|
1103
|
+
function Be({
|
|
1084
1104
|
children: t,
|
|
1085
1105
|
className: e,
|
|
1086
1106
|
...s
|
|
@@ -1093,12 +1113,45 @@ function Ce({
|
|
|
1093
1113
|
"aria-hidden": "true",
|
|
1094
1114
|
className: u("astw:[&>svg]:size-3.5", e),
|
|
1095
1115
|
...s,
|
|
1096
|
-
children: t ?? /* @__PURE__ */ a(
|
|
1116
|
+
children: t ?? /* @__PURE__ */ a(z, {})
|
|
1097
1117
|
}
|
|
1098
1118
|
);
|
|
1099
1119
|
}
|
|
1100
|
-
|
|
1101
|
-
const s =
|
|
1120
|
+
function Ae(t, e) {
|
|
1121
|
+
const s = Q(e), r = [], n = (o, l, d) => {
|
|
1122
|
+
if (o.path.startsWith(":")) return;
|
|
1123
|
+
const i = `${l}/${o.path}`, w = s(o.meta.title, o.path), m = [...d, w];
|
|
1124
|
+
r.push({
|
|
1125
|
+
path: i,
|
|
1126
|
+
title: w,
|
|
1127
|
+
icon: o.meta.icon,
|
|
1128
|
+
breadcrumb: m
|
|
1129
|
+
}), o.subResources && o.subResources.forEach(
|
|
1130
|
+
(f) => n(f, i, m)
|
|
1131
|
+
);
|
|
1132
|
+
};
|
|
1133
|
+
return t.forEach((o) => {
|
|
1134
|
+
if (o.path.startsWith(":")) return;
|
|
1135
|
+
const l = s(o.meta.title, o.path), d = [l];
|
|
1136
|
+
o.meta.menuItemClickable && r.push({
|
|
1137
|
+
path: o.path,
|
|
1138
|
+
title: l,
|
|
1139
|
+
icon: o.meta.icon,
|
|
1140
|
+
breadcrumb: d
|
|
1141
|
+
}), o.resources.forEach(
|
|
1142
|
+
(i) => n(i, o.path, d)
|
|
1143
|
+
);
|
|
1144
|
+
}), r;
|
|
1145
|
+
}
|
|
1146
|
+
function Pe(t, e) {
|
|
1147
|
+
if (!e.trim()) return t;
|
|
1148
|
+
const s = e.toLowerCase();
|
|
1149
|
+
return t.filter(
|
|
1150
|
+
(r) => r.title.toLowerCase().includes(s) || r.path.toLowerCase().includes(s)
|
|
1151
|
+
);
|
|
1152
|
+
}
|
|
1153
|
+
const Le = (t, e) => {
|
|
1154
|
+
const s = Q(e);
|
|
1102
1155
|
return t.reduce(
|
|
1103
1156
|
(r, n) => {
|
|
1104
1157
|
const o = s(n.meta.title, n.path);
|
|
@@ -1108,12 +1161,12 @@ const Se = (t, e) => {
|
|
|
1108
1161
|
};
|
|
1109
1162
|
const l = (d, i) => {
|
|
1110
1163
|
!d || d.length === 0 || d.forEach((w) => {
|
|
1111
|
-
const m = `${i}/${w.path}`,
|
|
1164
|
+
const m = `${i}/${w.path}`, f = s(
|
|
1112
1165
|
w.meta.title,
|
|
1113
1166
|
w.path
|
|
1114
1167
|
);
|
|
1115
1168
|
r[m] = {
|
|
1116
|
-
title:
|
|
1169
|
+
title: f,
|
|
1117
1170
|
breadcrumbTitle: w.meta.breadcrumbTitle
|
|
1118
1171
|
}, w.subResources && w.subResources.length > 0 && l(
|
|
1119
1172
|
w.subResources,
|
|
@@ -1126,24 +1179,24 @@ const Se = (t, e) => {
|
|
|
1126
1179
|
{}
|
|
1127
1180
|
);
|
|
1128
1181
|
};
|
|
1129
|
-
function
|
|
1130
|
-
const n = t.split("/").filter((i) => i !== ""), o = e && n[0] === e ? n.slice(1) : n, l =
|
|
1182
|
+
function De(t, e, s, r) {
|
|
1183
|
+
const n = t.split("/").filter((i) => i !== ""), o = e && n[0] === e ? n.slice(1) : n, l = Le(s, r), d = o.map((i, w) => {
|
|
1131
1184
|
const m = o.slice(0, w + 1).join("/");
|
|
1132
|
-
let
|
|
1133
|
-
if (!
|
|
1134
|
-
const
|
|
1135
|
-
([
|
|
1136
|
-
const
|
|
1137
|
-
return new RegExp(`^${
|
|
1185
|
+
let f = l[m];
|
|
1186
|
+
if (!f) {
|
|
1187
|
+
const h = Object.entries(l).find(
|
|
1188
|
+
([b]) => {
|
|
1189
|
+
const x = b.split("/").map((p) => p.startsWith(":") ? "[^/]+" : p).join("/");
|
|
1190
|
+
return new RegExp(`^${x}$`).test(m);
|
|
1138
1191
|
}
|
|
1139
1192
|
)?.[1];
|
|
1140
|
-
|
|
1193
|
+
h && (f = h);
|
|
1141
1194
|
}
|
|
1142
|
-
let
|
|
1143
|
-
return
|
|
1195
|
+
let g;
|
|
1196
|
+
return f ? typeof f.breadcrumbTitle == "function" ? g = f.breadcrumbTitle(i) : typeof f.breadcrumbTitle == "string" ? g = f.breadcrumbTitle : g = f.title : g = decodeURIComponent(i), {
|
|
1144
1197
|
segment: i,
|
|
1145
1198
|
path: m,
|
|
1146
|
-
title:
|
|
1199
|
+
title: g
|
|
1147
1200
|
};
|
|
1148
1201
|
});
|
|
1149
1202
|
return {
|
|
@@ -1151,45 +1204,45 @@ function ke(t, e, s, r) {
|
|
|
1151
1204
|
segments: d
|
|
1152
1205
|
};
|
|
1153
1206
|
}
|
|
1154
|
-
const
|
|
1207
|
+
const Ie = () => {
|
|
1155
1208
|
const { open: t } = _();
|
|
1156
|
-
return /* @__PURE__ */ a("div", { className: t ? "astw:md:hidden" : void 0, children: /* @__PURE__ */ a(
|
|
1157
|
-
},
|
|
1158
|
-
const e = t.children ? t.children({ Outlet:
|
|
1209
|
+
return /* @__PURE__ */ a("div", { className: t ? "astw:md:hidden" : void 0, children: /* @__PURE__ */ a(ht, { className: "astw:-ml-2.5" }) });
|
|
1210
|
+
}, ia = (t) => {
|
|
1211
|
+
const e = t.children ? t.children({ Outlet: X }) : null, s = Xt(), r = () => {
|
|
1159
1212
|
s.setTheme(s.theme === "dark" ? "light" : "dark");
|
|
1160
1213
|
};
|
|
1161
|
-
return /* @__PURE__ */ a(
|
|
1162
|
-
t.sidebar ?? /* @__PURE__ */ a(
|
|
1163
|
-
/* @__PURE__ */ c(
|
|
1214
|
+
return /* @__PURE__ */ a(ge, { className: "astw:flex astw:flex-col", children: /* @__PURE__ */ c("div", { className: "astw:flex astw:flex-1", children: [
|
|
1215
|
+
t.sidebar ?? /* @__PURE__ */ a(_e, {}),
|
|
1216
|
+
/* @__PURE__ */ c(ve, { className: "astw:w-[calc(100%-var(--sidebar-width))]", children: [
|
|
1164
1217
|
/* @__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: [
|
|
1165
1218
|
/* @__PURE__ */ c("div", { className: "astw:flex astw:items-center astw:gap-2", children: [
|
|
1166
|
-
/* @__PURE__ */ a(
|
|
1167
|
-
/* @__PURE__ */ a(
|
|
1219
|
+
/* @__PURE__ */ a(Ie, {}),
|
|
1220
|
+
/* @__PURE__ */ a(ze, {})
|
|
1168
1221
|
] }),
|
|
1169
|
-
/* @__PURE__ */ a("div", { className: "astw:flex astw:items-center astw:gap-2", children: /* @__PURE__ */ a(
|
|
1222
|
+
/* @__PURE__ */ a("div", { className: "astw:flex astw:items-center astw:gap-2", children: /* @__PURE__ */ a(L, { variant: "outline", size: "icon", onClick: r, children: /* @__PURE__ */ a(pt, {}) }) })
|
|
1170
1223
|
] }) }),
|
|
1171
|
-
/* @__PURE__ */ a("div", { className: "astw:flex astw:flex-col astw:gap-4", children: e ?? /* @__PURE__ */ a(
|
|
1224
|
+
/* @__PURE__ */ a("div", { className: "astw:flex astw:flex-col astw:gap-4", children: e ?? /* @__PURE__ */ a(X, {}) })
|
|
1172
1225
|
] })
|
|
1173
1226
|
] }) });
|
|
1174
|
-
},
|
|
1175
|
-
const { title: e, icon: s, navItems: r } =
|
|
1227
|
+
}, _e = (t) => {
|
|
1228
|
+
const { title: e, icon: s, navItems: r } = S(), { pathname: n } = ot(), o = R(), l = /* @__PURE__ */ c(xe, { children: [
|
|
1176
1229
|
s,
|
|
1177
1230
|
/* @__PURE__ */ a("h1", { className: "astw:text-sm astw:mb-2 astw:mt-2 astw:px-2", children: e })
|
|
1178
1231
|
] });
|
|
1179
|
-
return /* @__PURE__ */ c(
|
|
1232
|
+
return /* @__PURE__ */ c(pe, { variant: "inset", children: [
|
|
1180
1233
|
/* @__PURE__ */ c("div", { className: "astw:flex astw:justify-between astw:items-center", children: [
|
|
1181
1234
|
t.header ?? l,
|
|
1182
|
-
/* @__PURE__ */ a("div", { className: "astw:hidden astw:md:block", children: /* @__PURE__ */ a(
|
|
1235
|
+
/* @__PURE__ */ a("div", { className: "astw:hidden astw:md:block", children: /* @__PURE__ */ a(ht, { className: "astw:-ml-1" }) })
|
|
1183
1236
|
] }),
|
|
1184
|
-
/* @__PURE__ */ a(
|
|
1185
|
-
|
|
1237
|
+
/* @__PURE__ */ a(ye, { children: /* @__PURE__ */ a(Ne, { children: /* @__PURE__ */ a(Ce, { children: r.map((i) => /* @__PURE__ */ a(
|
|
1238
|
+
Yt,
|
|
1186
1239
|
{
|
|
1187
1240
|
asChild: !0,
|
|
1188
1241
|
defaultOpen: i.isActive,
|
|
1189
|
-
children: /* @__PURE__ */ c(
|
|
1190
|
-
i.url ? /* @__PURE__ */ c(
|
|
1191
|
-
/* @__PURE__ */ a(
|
|
1192
|
-
|
|
1242
|
+
children: /* @__PURE__ */ c(Se, { children: [
|
|
1243
|
+
i.url ? /* @__PURE__ */ c(B, { children: [
|
|
1244
|
+
/* @__PURE__ */ a(J, { asChild: !0, tooltip: i.title, children: /* @__PURE__ */ c(
|
|
1245
|
+
K,
|
|
1193
1246
|
{
|
|
1194
1247
|
to: i.url,
|
|
1195
1248
|
className: i.url === n ? "astw:bg-sidebar-accent astw:font-medium" : void 0,
|
|
@@ -1199,29 +1252,29 @@ const Be = () => {
|
|
|
1199
1252
|
]
|
|
1200
1253
|
}
|
|
1201
1254
|
) }),
|
|
1202
|
-
!!i.items?.length && /* @__PURE__ */ a(
|
|
1203
|
-
/* @__PURE__ */ a(
|
|
1255
|
+
!!i.items?.length && /* @__PURE__ */ a(Y, { asChild: !0, children: /* @__PURE__ */ c(Z, { className: "astw:data-[state=open]:rotate-90", children: [
|
|
1256
|
+
/* @__PURE__ */ a(z, {}),
|
|
1204
1257
|
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: o("toggle") })
|
|
1205
1258
|
] }) })
|
|
1206
|
-
] }) : /* @__PURE__ */ a(
|
|
1207
|
-
/* @__PURE__ */ a(
|
|
1259
|
+
] }) : /* @__PURE__ */ a(B, { children: /* @__PURE__ */ c(Y, { className: "astw:flex astw:w-[100%] astw:[&[data-state=open]_.astw-rotate-target]:rotate-90", children: [
|
|
1260
|
+
/* @__PURE__ */ a(J, { asChild: !0, tooltip: i.title, children: /* @__PURE__ */ c("span", { className: "astw:flex astw:w-[100%]", children: [
|
|
1208
1261
|
i.icon,
|
|
1209
1262
|
/* @__PURE__ */ a("span", { children: i.title })
|
|
1210
1263
|
] }) }),
|
|
1211
1264
|
!!i.items?.length && /* @__PURE__ */ a(
|
|
1212
|
-
|
|
1265
|
+
Z,
|
|
1213
1266
|
{
|
|
1214
1267
|
className: "astw-rotate-target",
|
|
1215
1268
|
asChild: !0,
|
|
1216
1269
|
children: /* @__PURE__ */ c("span", { children: [
|
|
1217
|
-
/* @__PURE__ */ a(
|
|
1270
|
+
/* @__PURE__ */ a(z, {}),
|
|
1218
1271
|
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: o("toggle") })
|
|
1219
1272
|
] })
|
|
1220
1273
|
}
|
|
1221
1274
|
)
|
|
1222
1275
|
] }) }),
|
|
1223
|
-
!!i.items?.length && /* @__PURE__ */ a(
|
|
1224
|
-
|
|
1276
|
+
!!i.items?.length && /* @__PURE__ */ a(Jt, { children: /* @__PURE__ */ a(ke, { children: i.items?.map((w) => /* @__PURE__ */ a(Re, { children: /* @__PURE__ */ a(Ee, { asChild: !0, children: /* @__PURE__ */ a(
|
|
1277
|
+
K,
|
|
1225
1278
|
{
|
|
1226
1279
|
to: w.url,
|
|
1227
1280
|
className: w.url === n ? "astw:bg-sidebar-accent astw:font-medium" : void 0,
|
|
@@ -1234,42 +1287,243 @@ const Be = () => {
|
|
|
1234
1287
|
)) }) }) }),
|
|
1235
1288
|
t.footer ?? null
|
|
1236
1289
|
] });
|
|
1237
|
-
},
|
|
1238
|
-
const { configurations: t } =
|
|
1239
|
-
return
|
|
1290
|
+
}, Me = () => {
|
|
1291
|
+
const { configurations: t } = S(), e = ot();
|
|
1292
|
+
return De(
|
|
1240
1293
|
e.pathname,
|
|
1241
1294
|
t.basePath,
|
|
1242
1295
|
t.modules,
|
|
1243
1296
|
t.locale
|
|
1244
1297
|
);
|
|
1245
|
-
},
|
|
1246
|
-
const { segments: t } =
|
|
1247
|
-
return e ? /* @__PURE__ */ a(
|
|
1298
|
+
}, ze = () => {
|
|
1299
|
+
const { segments: t } = Me(), e = At("/:prefix/settings/:suffix"), s = R();
|
|
1300
|
+
return e ? /* @__PURE__ */ a(tt, { children: /* @__PURE__ */ a(et, { children: /* @__PURE__ */ a("div", { className: "astw:inline-flex astw:items-center astw:gap-3 astw:last:text-foreground", children: /* @__PURE__ */ a(at, { children: /* @__PURE__ */ a(st, { to: `/${e.params.prefix}/settings`, children: s("settings") }) }) }) }) }) : /* @__PURE__ */ a(tt, { children: /* @__PURE__ */ a(et, { children: t.map((r, n) => /* @__PURE__ */ c(
|
|
1248
1301
|
"div",
|
|
1249
1302
|
{
|
|
1250
1303
|
className: "astw:inline-flex astw:items-center astw:gap-3 astw:last:text-foreground",
|
|
1251
1304
|
children: [
|
|
1252
|
-
/* @__PURE__ */ a(
|
|
1253
|
-
n < t.length - 1 && /* @__PURE__ */ a(
|
|
1305
|
+
/* @__PURE__ */ a(at, { children: /* @__PURE__ */ a(st, { to: r.path, children: r.title }) }),
|
|
1306
|
+
n < t.length - 1 && /* @__PURE__ */ a(Be, {})
|
|
1254
1307
|
]
|
|
1255
1308
|
},
|
|
1256
1309
|
n
|
|
1257
1310
|
)) }) });
|
|
1258
|
-
}
|
|
1259
|
-
|
|
1311
|
+
};
|
|
1312
|
+
function Oe({
|
|
1313
|
+
...t
|
|
1314
|
+
}) {
|
|
1315
|
+
return /* @__PURE__ */ a(v.Root, { "data-slot": "dialog", ...t });
|
|
1316
|
+
}
|
|
1317
|
+
function $e({
|
|
1318
|
+
...t
|
|
1319
|
+
}) {
|
|
1320
|
+
return /* @__PURE__ */ a(v.Portal, { "data-slot": "dialog-portal", ...t });
|
|
1321
|
+
}
|
|
1322
|
+
function Ke({
|
|
1323
|
+
className: t,
|
|
1324
|
+
...e
|
|
1325
|
+
}) {
|
|
1326
|
+
return /* @__PURE__ */ a(
|
|
1327
|
+
v.Overlay,
|
|
1328
|
+
{
|
|
1329
|
+
"data-slot": "dialog-overlay",
|
|
1330
|
+
className: u(
|
|
1331
|
+
"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",
|
|
1332
|
+
t
|
|
1333
|
+
),
|
|
1334
|
+
...e
|
|
1335
|
+
}
|
|
1336
|
+
);
|
|
1337
|
+
}
|
|
1338
|
+
function je({
|
|
1339
|
+
className: t,
|
|
1340
|
+
children: e,
|
|
1341
|
+
...s
|
|
1342
|
+
}) {
|
|
1343
|
+
return /* @__PURE__ */ c($e, { "data-slot": "dialog-portal", children: [
|
|
1344
|
+
/* @__PURE__ */ a(Ke, {}),
|
|
1345
|
+
/* @__PURE__ */ c(
|
|
1346
|
+
v.Content,
|
|
1347
|
+
{
|
|
1348
|
+
"data-slot": "dialog-content",
|
|
1349
|
+
className: u(
|
|
1350
|
+
"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",
|
|
1351
|
+
t
|
|
1352
|
+
),
|
|
1353
|
+
...s,
|
|
1354
|
+
children: [
|
|
1355
|
+
e,
|
|
1356
|
+
/* @__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: [
|
|
1357
|
+
/* @__PURE__ */ a(rt, {}),
|
|
1358
|
+
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: "Close" })
|
|
1359
|
+
] })
|
|
1360
|
+
]
|
|
1361
|
+
}
|
|
1362
|
+
)
|
|
1363
|
+
] });
|
|
1364
|
+
}
|
|
1365
|
+
function Ue({
|
|
1366
|
+
className: t,
|
|
1367
|
+
...e
|
|
1368
|
+
}) {
|
|
1369
|
+
return /* @__PURE__ */ a(
|
|
1370
|
+
v.Title,
|
|
1371
|
+
{
|
|
1372
|
+
"data-slot": "dialog-title",
|
|
1373
|
+
className: u("astw:text-lg astw:leading-none astw:font-semibold", t),
|
|
1374
|
+
...e
|
|
1375
|
+
}
|
|
1376
|
+
);
|
|
1377
|
+
}
|
|
1378
|
+
function We({
|
|
1379
|
+
modules: t,
|
|
1380
|
+
locale: e,
|
|
1381
|
+
onNavigate: s
|
|
1382
|
+
}) {
|
|
1383
|
+
const [r, n] = T(!1), [o, l] = T(""), [d, i] = T(0), w = A(
|
|
1384
|
+
() => Ae(t, e),
|
|
1385
|
+
[t, e]
|
|
1386
|
+
), m = A(
|
|
1387
|
+
() => Pe(w, o),
|
|
1388
|
+
[w, o]
|
|
1389
|
+
);
|
|
1390
|
+
C(() => {
|
|
1391
|
+
i(0);
|
|
1392
|
+
}, [m]), C(() => {
|
|
1393
|
+
r || (l(""), i(0));
|
|
1394
|
+
}, [r]);
|
|
1395
|
+
const f = O(
|
|
1396
|
+
(h) => {
|
|
1397
|
+
s(h.path), n(!1), l("");
|
|
1398
|
+
},
|
|
1399
|
+
[s]
|
|
1400
|
+
), g = O(
|
|
1401
|
+
(h, b) => {
|
|
1402
|
+
if (!b)
|
|
1403
|
+
switch (h) {
|
|
1404
|
+
case "ArrowDown":
|
|
1405
|
+
i(
|
|
1406
|
+
(x) => x < m.length - 1 ? x + 1 : x
|
|
1407
|
+
);
|
|
1408
|
+
break;
|
|
1409
|
+
case "ArrowUp":
|
|
1410
|
+
i((x) => x > 0 ? x - 1 : x);
|
|
1411
|
+
break;
|
|
1412
|
+
case "Enter":
|
|
1413
|
+
m[d] && f(m[d]);
|
|
1414
|
+
break;
|
|
1415
|
+
}
|
|
1416
|
+
},
|
|
1417
|
+
[m, d, f]
|
|
1418
|
+
);
|
|
1419
|
+
return {
|
|
1420
|
+
open: r,
|
|
1421
|
+
setOpen: n,
|
|
1422
|
+
search: o,
|
|
1423
|
+
setSearch: l,
|
|
1424
|
+
selectedIndex: d,
|
|
1425
|
+
filteredRoutes: m,
|
|
1426
|
+
handleSelect: f,
|
|
1427
|
+
handleKeyDown: g
|
|
1428
|
+
};
|
|
1429
|
+
}
|
|
1430
|
+
function la() {
|
|
1431
|
+
const t = xt(null), { configurations: e } = S(), s = Pt(), r = R(), {
|
|
1432
|
+
open: n,
|
|
1433
|
+
setOpen: o,
|
|
1434
|
+
search: l,
|
|
1435
|
+
setSearch: d,
|
|
1436
|
+
selectedIndex: i,
|
|
1437
|
+
filteredRoutes: w,
|
|
1438
|
+
handleSelect: m,
|
|
1439
|
+
handleKeyDown: f
|
|
1440
|
+
} = We({
|
|
1441
|
+
modules: e.modules,
|
|
1442
|
+
locale: e.locale,
|
|
1443
|
+
onNavigate: s
|
|
1444
|
+
});
|
|
1445
|
+
C(() => {
|
|
1446
|
+
t.current && t.current.querySelector(
|
|
1447
|
+
`[data-index="${i}"]`
|
|
1448
|
+
)?.scrollIntoView({ block: "nearest" });
|
|
1449
|
+
}, [i]);
|
|
1450
|
+
const g = O(
|
|
1451
|
+
(h) => {
|
|
1452
|
+
["ArrowDown", "ArrowUp", "Enter"].includes(h.key) && h.preventDefault(), f(h.key, h.nativeEvent.isComposing);
|
|
1453
|
+
},
|
|
1454
|
+
[f]
|
|
1455
|
+
);
|
|
1456
|
+
return C(() => {
|
|
1457
|
+
const h = (b) => {
|
|
1458
|
+
(b.metaKey || b.ctrlKey) && b.key === "k" && (b.preventDefault(), o(!n));
|
|
1459
|
+
};
|
|
1460
|
+
return document.addEventListener("keydown", h), () => document.removeEventListener("keydown", h);
|
|
1461
|
+
}, [n, o]), /* @__PURE__ */ a(Oe, { open: n, onOpenChange: o, children: /* @__PURE__ */ c(
|
|
1462
|
+
je,
|
|
1463
|
+
{
|
|
1464
|
+
className: "astw:p-0 astw:gap-0 astw:sm:max-w-2xl astw:overflow-hidden",
|
|
1465
|
+
onKeyDown: g,
|
|
1466
|
+
"aria-describedby": void 0,
|
|
1467
|
+
children: [
|
|
1468
|
+
/* @__PURE__ */ a(Ue, { className: "astw:sr-only", children: r("commandPaletteSearch") }),
|
|
1469
|
+
/* @__PURE__ */ c("div", { className: "astw:flex astw:items-center astw:border-b astw:px-3 astw:py-1", children: [
|
|
1470
|
+
/* @__PURE__ */ a(vt, { className: "astw:mr-2 astw:h-4 astw:w-4 astw:shrink-0 astw:opacity-50" }),
|
|
1471
|
+
/* @__PURE__ */ a(
|
|
1472
|
+
te,
|
|
1473
|
+
{
|
|
1474
|
+
value: l,
|
|
1475
|
+
onChange: (h) => d(h.target.value),
|
|
1476
|
+
placeholder: r("commandPaletteSearch"),
|
|
1477
|
+
className: "astw:flex astw:h-10 astw:w-full astw:rounded-md astw:bg-transparent astw:py-3 astw:text-sm astw:outline-none astw:border-0 astw:shadow-none astw:focus-visible:ring-0 astw:placeholder:text-muted-foreground astw:disabled:cursor-not-allowed astw:disabled:opacity-50",
|
|
1478
|
+
autoFocus: !0
|
|
1479
|
+
}
|
|
1480
|
+
)
|
|
1481
|
+
] }),
|
|
1482
|
+
/* @__PURE__ */ a(
|
|
1483
|
+
"div",
|
|
1484
|
+
{
|
|
1485
|
+
ref: t,
|
|
1486
|
+
className: "astw:max-h-[300px] astw:overflow-y-auto astw:overflow-x-hidden",
|
|
1487
|
+
children: w.length === 0 ? /* @__PURE__ */ a("div", { className: "astw:py-6 astw:text-center astw:text-sm astw:text-muted-foreground", children: r("commandPaletteNoResults") }) : /* @__PURE__ */ a("div", { className: "astw:p-1", children: w.map((h, b) => /* @__PURE__ */ c(
|
|
1488
|
+
"button",
|
|
1489
|
+
{
|
|
1490
|
+
"data-index": b,
|
|
1491
|
+
onClick: () => m(h),
|
|
1492
|
+
className: u(
|
|
1493
|
+
"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",
|
|
1494
|
+
b === i ? "astw:bg-accent astw:text-accent-foreground" : "astw:hover:bg-accent astw:hover:text-accent-foreground"
|
|
1495
|
+
),
|
|
1496
|
+
children: [
|
|
1497
|
+
/* @__PURE__ */ a("span", { className: "astw:truncate astw:w-full astw:text-left", children: h.breadcrumb.join(" > ") }),
|
|
1498
|
+
/* @__PURE__ */ c("span", { className: "astw:text-[11px] astw:text-muted-foreground astw:truncate astw:w-full astw:text-left", children: [
|
|
1499
|
+
"/",
|
|
1500
|
+
h.path
|
|
1501
|
+
] })
|
|
1502
|
+
]
|
|
1503
|
+
},
|
|
1504
|
+
h.path
|
|
1505
|
+
)) })
|
|
1506
|
+
}
|
|
1507
|
+
)
|
|
1508
|
+
]
|
|
1509
|
+
}
|
|
1510
|
+
) });
|
|
1511
|
+
}
|
|
1512
|
+
const ft = j(null), da = (t) => {
|
|
1513
|
+
const e = A(
|
|
1260
1514
|
() => Mt({
|
|
1261
1515
|
clientId: t.clientId,
|
|
1262
1516
|
appUri: t.apiEndpoint,
|
|
1263
1517
|
redirectUri: t.redirectUri,
|
|
1264
|
-
meQuery: t.meQuery && (typeof t.meQuery == "string" ? t.meQuery :
|
|
1518
|
+
meQuery: t.meQuery && (typeof t.meQuery == "string" ? t.meQuery : _t(t.meQuery))
|
|
1265
1519
|
}),
|
|
1266
1520
|
[t.clientId, t.apiEndpoint, t.redirectUri, t.meQuery]
|
|
1267
|
-
), [s, r] =
|
|
1521
|
+
), [s, r] = T(
|
|
1268
1522
|
() => e.getState()
|
|
1269
1523
|
);
|
|
1270
|
-
|
|
1524
|
+
C(() => {
|
|
1271
1525
|
t.autoLogin && (s.isLoading || s.isAuthenticated || (async () => await e.login())());
|
|
1272
|
-
}, [s.isLoading, s.isAuthenticated, t.autoLogin]),
|
|
1526
|
+
}, [s.isLoading, s.isAuthenticated, t.autoLogin]), C(
|
|
1273
1527
|
() => e.addEventListener((o) => {
|
|
1274
1528
|
o.type === "auth_state_changed" && r(o.data);
|
|
1275
1529
|
}),
|
|
@@ -1277,7 +1531,7 @@ const Be = () => {
|
|
|
1277
1531
|
);
|
|
1278
1532
|
const n = t.guardComponent && (s.isLoading || !s.isAuthenticated) ? /* @__PURE__ */ a(t.guardComponent, {}) : t.children;
|
|
1279
1533
|
return /* @__PURE__ */ a(
|
|
1280
|
-
|
|
1534
|
+
ft.Provider,
|
|
1281
1535
|
{
|
|
1282
1536
|
value: {
|
|
1283
1537
|
authState: s,
|
|
@@ -1289,28 +1543,29 @@ const Be = () => {
|
|
|
1289
1543
|
children: n
|
|
1290
1544
|
}
|
|
1291
1545
|
);
|
|
1292
|
-
},
|
|
1293
|
-
const t =
|
|
1546
|
+
}, ca = () => {
|
|
1547
|
+
const t = U(ft);
|
|
1294
1548
|
if (!t)
|
|
1295
1549
|
throw new Error("useAuth must be used within an AuthProvider");
|
|
1296
1550
|
return t;
|
|
1297
1551
|
};
|
|
1298
1552
|
export {
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1553
|
+
oa as AppShell,
|
|
1554
|
+
da as AuthProvider,
|
|
1555
|
+
la as CommandPalette,
|
|
1556
|
+
_e as DefaultSidebar,
|
|
1557
|
+
ma as Link,
|
|
1558
|
+
ia as SidebarLayout,
|
|
1559
|
+
Kt as defineI18nLabels,
|
|
1560
|
+
ra as defineModule,
|
|
1561
|
+
na as defineResource,
|
|
1562
|
+
sa as redirectToResource,
|
|
1563
|
+
S as useAppShell,
|
|
1564
|
+
ca as useAuth,
|
|
1565
|
+
ha as useLocation,
|
|
1566
|
+
fa as useNavigate,
|
|
1567
|
+
ba as useParams,
|
|
1568
|
+
ga as useRouteError,
|
|
1569
|
+
pa as useSearchParams,
|
|
1570
|
+
Xt as useTheme
|
|
1316
1571
|
};
|