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