@tailor-platform/app-shell 0.22.0 → 0.23.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 l, Fragment as E } from "react/jsx-runtime";
2
- import * as p from "react";
3
- import { createContext as K, useContext as U, useState as k, useMemo as _, useEffect as C, Suspense as ht, useRef as _t, useCallback as at } from "react";
4
- import { useRouteError as zt, isRouteErrorResponse as Ft, Outlet as H, NavLink as Ot, redirect as ft, Navigate as $t, useRouteLoaderData as Wt, createMemoryRouter as jt, createBrowserRouter as Kt, RouterProvider as Ut, useHref as Ht, Link as Vt, useLocation as gt, useMatch as Qt, Await as pt, useNavigate as qt } from "react-router";
5
- import { Link as ns, useLocation as os, useNavigate as is, useParams as ls, useRouteError as ds, useSearchParams as cs } from "react-router";
6
- import { Slot as P } from "@radix-ui/react-slot";
7
- import { cva as V } from "class-variance-authority";
8
- import { clsx as Gt } from "clsx";
9
- import { twMerge as Yt } from "tailwind-merge";
10
- import { AlertCircle as st, Table as Xt, XIcon as bt, PanelLeftIcon as Zt, ChevronRight as $, SunIcon as Jt, SearchIcon as te, ExternalLink as ee, Check as ae, Copy as se } from "lucide-react";
11
- import { capitalCase as L } from "change-case";
12
- import { Toaster as re } from "sonner";
13
- import * as Q from "@radix-ui/react-collapsible";
1
+ import { jsx as a, jsxs as l, Fragment as L } from "react/jsx-runtime";
2
+ import * as g from "react";
3
+ import { createContext as q, useContext as G, useState as R, useMemo as $, useEffect as y, Suspense as Tt, useRef as Gt, useCallback as lt } from "react";
4
+ import { useRouteError as Yt, isRouteErrorResponse as Xt, Outlet as Y, NavLink as Zt, redirect as kt, Navigate as Jt, useRouteLoaderData as te, createMemoryRouter as ee, createBrowserRouter as ae, RouterProvider as se, useHref as re, Link as ne, useLocation as Rt, useMatch as oe, Await as Et, useNavigate as ie } from "react-router";
5
+ import { Link as us, useLocation as ms, useNavigate as hs, useParams as fs, useRouteError as ps, useSearchParams as gs } from "react-router";
6
+ import { Slot as A } from "@radix-ui/react-slot";
7
+ import { cva as X } from "class-variance-authority";
8
+ import { clsx as le } from "clsx";
9
+ import { twMerge as de } from "tailwind-merge";
10
+ import { AlertCircle as dt, Table as ce, XIcon as Lt, PanelLeftIcon as we, ChevronRight as H, SunIcon as ue, SearchIcon as me, ExternalLink as he, Check as fe, Copy as pe } from "lucide-react";
11
+ import { capitalCase as M } from "change-case";
12
+ import { Toaster as ge } from "sonner";
13
+ import * as Z from "@radix-ui/react-collapsible";
14
14
  import "@radix-ui/react-separator";
15
- import * as v from "@radix-ui/react-dialog";
16
- import * as R from "@radix-ui/react-tooltip";
17
- import { print as ne } from "graphql";
18
- import { createAuthClient as oe } from "@tailor-platform/auth-browser-client";
19
- function u(...t) {
20
- return Yt(Gt(t));
21
- }
22
- const ie = V(
15
+ import * as b from "@radix-ui/react-dialog";
16
+ import * as E from "@radix-ui/react-tooltip";
17
+ import { print as be } from "graphql";
18
+ import { createAuthClient as xe } from "@tailor-platform/auth-browser-client";
19
+ function m(...t) {
20
+ return de(le(t));
21
+ }
22
+ const ve = X(
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 ie = V(
44
44
  }
45
45
  }
46
46
  );
47
- function D({
47
+ function I({
48
48
  className: t,
49
49
  variant: e,
50
50
  size: s,
@@ -52,30 +52,30 @@ function D({
52
52
  ...n
53
53
  }) {
54
54
  return /* @__PURE__ */ a(
55
- r ? P : "button",
55
+ r ? A : "button",
56
56
  {
57
57
  "data-slot": "button",
58
- className: u(ie({ variant: e, size: s, className: t })),
58
+ className: m(ve({ variant: e, size: s, className: t })),
59
59
  ...n
60
60
  }
61
61
  );
62
62
  }
63
- const I = "en", le = () => {
63
+ const O = "en", ye = () => {
64
64
  try {
65
65
  if (typeof navigator > "u")
66
- return I;
66
+ return O;
67
67
  const t = navigator.languages?.[0] ?? navigator.language;
68
- return t ? new Intl.Locale(t).language : I;
68
+ return t ? new Intl.Locale(t).language : O;
69
69
  } catch {
70
- return I;
70
+ return O;
71
71
  }
72
- }, q = (t) => (e, s) => e ? typeof e == "string" ? e : e(t) ?? s : s, vt = (t) => {
73
- const e = q(t);
74
- return (s, r) => e(s, typeof s == "string" ? s : L(r));
75
- }, de = () => {
76
- const { configurations: t } = T(), e = q(t.locale);
72
+ }, J = (t) => (e, s) => e ? typeof e == "string" ? e : e(t) ?? s : s, Bt = (t) => {
73
+ const e = J(t);
74
+ return (s, r) => e(s, typeof s == "string" ? s : M(r));
75
+ }, Ne = () => {
76
+ const { configurations: t } = k(), e = J(t.locale);
77
77
  return (s, r) => e(s, r);
78
- }, ce = (t) => {
78
+ }, Ce = (t) => {
79
79
  const e = (s) => (r) => t[s]?.[r] ?? t.en[r];
80
80
  return {
81
81
  /**
@@ -98,7 +98,7 @@ const I = "en", le = () => {
98
98
  * ```
99
99
  */
100
100
  useT: () => {
101
- const { configurations: s } = T(), r = e(s.locale);
101
+ const { configurations: s } = k(), r = e(s.locale);
102
102
  return ((n, ...o) => {
103
103
  const i = r(n);
104
104
  return typeof i == "function" ? i(o[0]) : i;
@@ -131,7 +131,7 @@ const I = "en", le = () => {
131
131
  return typeof o == "function" ? o(r[0]) : o;
132
132
  }
133
133
  };
134
- }, we = ce({
134
+ }, Se = Ce({
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 I = "en", le = () => {
170
170
  commandPaletteSearch: "ページを検索...",
171
171
  commandPaletteNoResults: "結果が見つかりません"
172
172
  }
173
- }), B = we.useT, M = () => {
174
- const t = zt(), e = B(), s = {
173
+ }), B = Se.useT, z = () => {
174
+ const t = Yt(), e = B(), s = {
175
175
  role: "alert",
176
176
  "aria-label": "default-error-boundary"
177
177
  };
178
- if (Ft(t) && t.status === 404)
178
+ if (Xt(t) && t.status === 404)
179
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(st, { className: "astw:h-5 astw:w-5 astw:text-destructive astw:flex-shrink-0 astw:mt-0.5" }),
180
+ /* @__PURE__ */ a(dt, { className: "astw:h-5 astw:w-5 astw:text-destructive astw:flex-shrink-0 astw:mt-0.5" }),
181
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
- D,
185
+ I,
186
186
  {
187
187
  variant: "outline",
188
188
  size: "sm",
@@ -195,12 +195,12 @@ const I = "en", le = () => {
195
195
  ] }) });
196
196
  const r = t instanceof Error ? t.message : e("errorUnexpected");
197
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(st, { className: "astw:h-5 astw:w-5 astw:text-destructive astw:flex-shrink-0 astw:mt-0.5" }),
198
+ /* @__PURE__ */ a(dt, { className: "astw:h-5 astw:w-5 astw:text-destructive astw:flex-shrink-0 astw:mt-0.5" }),
199
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
- D,
203
+ I,
204
204
  {
205
205
  variant: "outline",
206
206
  size: "sm",
@@ -211,35 +211,35 @@ const I = "en", le = () => {
211
211
  )
212
212
  ] })
213
213
  ] }) });
214
- }, ue = (t) => ({
214
+ }, Te = (t) => ({
215
215
  modules: t.modules,
216
216
  settingsResources: t.settingsResources ?? [],
217
- errorBoundary: t.errorBoundary ?? /* @__PURE__ */ a(M, {}),
217
+ errorBoundary: t.errorBoundary ?? /* @__PURE__ */ a(z, {}),
218
218
  basePath: t.basePath,
219
- locale: t.locale ?? le()
220
- }), xt = K({
219
+ locale: t.locale ?? ye()
220
+ }), Pt = q({
221
221
  configurations: {
222
222
  modules: [],
223
223
  settingsResources: [],
224
- errorBoundary: /* @__PURE__ */ a(M, {}),
225
- locale: I
224
+ errorBoundary: /* @__PURE__ */ a(z, {}),
225
+ locale: O
226
226
  }
227
- }), T = () => U(xt), me = () => {
227
+ }), k = () => G(Pt), ke = () => {
228
228
  const t = B();
229
- return /* @__PURE__ */ l(E, { children: [
229
+ return /* @__PURE__ */ l(L, { children: [
230
230
  /* @__PURE__ */ a("p", { className: "astw:font-semibold astw:leading-none astw:tracking-tight", children: t("welcomeTitle") }),
231
231
  /* @__PURE__ */ a("p", { className: "pt-4", children: t("welcomeBody") })
232
232
  ] });
233
- }, rt = () => /* @__PURE__ */ l(E, { children: [
234
- /* @__PURE__ */ a(H, {}),
235
- /* @__PURE__ */ a(re, {})
236
- ] }), he = () => {
237
- const { configurations: t } = T(), e = B(), s = de();
233
+ }, ct = () => /* @__PURE__ */ l(L, { children: [
234
+ /* @__PURE__ */ a(Y, {}),
235
+ /* @__PURE__ */ a(ge, {})
236
+ ] }), Re = () => {
237
+ const { configurations: t } = k(), e = B(), s = Ne();
238
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
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: [
240
240
  /* @__PURE__ */ a("h2", { className: "astw:text-sm astw:leading-[36px] astw:mb-2 astw:font-bold ", children: e("settings") }),
241
- /* @__PURE__ */ a("ul", { className: "astw:flex astw:flex-col astw:gap-1", children: t.settingsResources.map((r) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a(Ot, { to: `./${r.path}`, children: ({ isActive: n }) => /* @__PURE__ */ l(
242
- D,
241
+ /* @__PURE__ */ a("ul", { className: "astw:flex astw:flex-col astw:gap-1", children: t.settingsResources.map((r) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a(Zt, { to: `./${r.path}`, children: ({ isActive: n }) => /* @__PURE__ */ l(
242
+ I,
243
243
  {
244
244
  variant: n ? "secondary" : "ghost",
245
245
  className: "astw:w-full astw:justify-start",
@@ -250,9 +250,9 @@ const I = "en", le = () => {
250
250
  }
251
251
  ) }) }, r.path)) })
252
252
  ] }) }),
253
- /* @__PURE__ */ a("section", { className: "astw:bg-card astw:flex-1 astw:rounded-md astw:border astw:shadow-xs", children: /* @__PURE__ */ a(H, {}) })
253
+ /* @__PURE__ */ a("section", { className: "astw:bg-card astw:flex-1 astw:rounded-md astw:border astw:shadow-xs", children: /* @__PURE__ */ a(Y, {}) })
254
254
  ] });
255
- }, yt = () => new Response("Not Found", { status: 404 }), G = async (t, e) => {
255
+ }, Dt = () => new Response("Not Found", { status: 404 }), tt = async (t, e) => {
256
256
  if (!t) return { state: "visible" };
257
257
  const s = new URL(e.request.url);
258
258
  return await t({
@@ -260,79 +260,79 @@ const I = "en", le = () => {
260
260
  searchParams: s.searchParams,
261
261
  signal: e.request.signal
262
262
  }) ?? { state: "visible" };
263
- }, Nt = (t, e) => async (s) => {
264
- switch ((await G(t, s)).state) {
263
+ }, Mt = (t, e) => async (s) => {
264
+ switch ((await tt(t, s)).state) {
265
265
  case "hidden":
266
- throw yt();
266
+ throw Dt();
267
267
  case "visible":
268
268
  return e ? e(s) : null;
269
269
  }
270
270
  };
271
- function qa(t) {
271
+ function es(t) {
272
272
  return {
273
273
  redirectTo: t
274
274
  };
275
275
  }
276
- function W(t) {
276
+ function U(t) {
277
277
  return typeof t == "object" && t !== null && "redirectTo" in t;
278
278
  }
279
- const Ct = (t, e) => () => {
280
- const { configurations: s } = T(), { metaTitle: r, fallbackTitle: n } = t, i = q(s.locale)(r, n);
279
+ const It = (t, e) => () => {
280
+ const { configurations: s } = k(), { metaTitle: r, fallbackTitle: n } = t, i = J(s.locale)(r, n);
281
281
  return e(i);
282
282
  };
283
- function Ga(t) {
284
- const { path: e, meta: s, component: r, resources: n, errorBoundary: o, accessControl: i } = t, d = s?.title ?? L(e), w = L(e), c = W(r) ? {
283
+ function as(t) {
284
+ const { path: e, meta: s, component: r, resources: n, errorBoundary: o, accessControl: i } = t, c = s?.title ?? M(e), u = M(e), w = U(r) ? {
285
285
  // Use loader for redirects
286
286
  component: () => null,
287
- baseLoader: () => ft(r.redirectTo)
287
+ baseLoader: () => kt(r.redirectTo)
288
288
  } : {
289
289
  // Regular component with locale-aware title
290
- component: Ct(
291
- { metaTitle: d, fallbackTitle: w },
292
- (g) => r({ title: g, resources: n })
290
+ component: It(
291
+ { metaTitle: c, fallbackTitle: u },
292
+ (h) => r({ title: h, resources: n })
293
293
  ),
294
294
  baseLoader: void 0
295
- }, m = i || c.baseLoader ? Nt(i, c.baseLoader) : void 0;
295
+ }, d = i || w.baseLoader ? Mt(i, w.baseLoader) : void 0;
296
296
  return {
297
297
  path: e,
298
298
  type: "component",
299
299
  _type: "module",
300
- component: c.component,
301
- loader: m,
300
+ component: w.component,
301
+ loader: d,
302
302
  meta: {
303
- title: d,
303
+ title: c,
304
304
  ...s?.breadcrumbTitle !== void 0 ? { breadcrumbTitle: s.breadcrumbTitle } : {},
305
305
  ...s,
306
- menuItemClickable: !W(r),
306
+ menuItemClickable: !U(r),
307
307
  icon: t.meta?.icon
308
308
  },
309
309
  resources: n,
310
- errorBoundary: o || /* @__PURE__ */ a(M, {}),
310
+ errorBoundary: o || /* @__PURE__ */ a(z, {}),
311
311
  accessControl: i
312
312
  };
313
313
  }
314
- function Ya(t) {
315
- const { path: e, component: s, subResources: r, meta: n, errorBoundary: o, accessControl: i } = t, d = n?.title ?? L(e), w = L(e), c = i ? Nt(i) : void 0;
314
+ function ss(t) {
315
+ const { path: e, component: s, subResources: r, meta: n, errorBoundary: o, accessControl: i } = t, c = n?.title ?? M(e), u = M(e), w = i ? Mt(i) : void 0;
316
316
  return {
317
317
  _type: "resource",
318
318
  type: "component",
319
319
  path: e,
320
320
  meta: {
321
- title: d,
321
+ title: c,
322
322
  icon: n?.icon,
323
323
  ...n?.breadcrumbTitle !== void 0 ? { breadcrumbTitle: n.breadcrumbTitle } : {}
324
324
  },
325
- component: Ct(
326
- { metaTitle: d, fallbackTitle: w },
327
- (m) => s({ title: m, resources: r })
325
+ component: It(
326
+ { metaTitle: c, fallbackTitle: u },
327
+ (d) => s({ title: d, resources: r })
328
328
  ),
329
329
  subResources: r,
330
- errorBoundary: o ?? /* @__PURE__ */ a(M, {}),
330
+ errorBoundary: o ?? /* @__PURE__ */ a(z, {}),
331
331
  accessControl: i,
332
- loader: c
332
+ loader: w
333
333
  };
334
334
  }
335
- const Y = (t) => () => /* @__PURE__ */ a(E, { children: t }), St = (t, e, s) => {
335
+ const et = (t) => () => /* @__PURE__ */ a(L, { children: t }), At = (t, e, s) => {
336
336
  const r = t.errorBoundary || s, n = {
337
337
  index: !0,
338
338
  Component: t.component,
@@ -341,38 +341,38 @@ const Y = (t) => () => /* @__PURE__ */ a(E, { children: t }), St = (t, e, s) =>
341
341
  return {
342
342
  path: t.path,
343
343
  ...t.errorBoundary && {
344
- ErrorBoundary: Y(t.errorBoundary)
344
+ ErrorBoundary: et(t.errorBoundary)
345
345
  },
346
346
  ...e && e.length > 0 ? {
347
347
  children: [
348
348
  n,
349
349
  ...e.map(
350
- (o) => St(o, o.subResources, r)
350
+ (o) => At(o, o.subResources, r)
351
351
  )
352
352
  ]
353
353
  } : {
354
354
  children: [n]
355
355
  }
356
356
  };
357
- }, fe = (t) => t.map(
358
- (e) => St(e, e.resources, e.errorBoundary)
359
- ), ge = ({
357
+ }, Ee = (t) => t.map(
358
+ (e) => At(e, e.resources, e.errorBoundary)
359
+ ), Le = ({
360
360
  modules: t,
361
361
  settingsResources: e,
362
362
  rootComponent: s
363
363
  }) => {
364
- const r = W(s) ? {
364
+ const r = U(s) ? {
365
365
  index: !0,
366
- loader: () => ft(s.redirectTo)
366
+ loader: () => kt(s.redirectTo)
367
367
  } : {
368
368
  index: !0,
369
- Component: s ?? me
369
+ Component: s ?? ke
370
370
  }, n = e.length > 0 ? [
371
371
  {
372
372
  path: "settings",
373
373
  index: !0,
374
374
  Component: () => /* @__PURE__ */ a(
375
- $t,
375
+ Jt,
376
376
  {
377
377
  to: e[0].path,
378
378
  relative: "path",
@@ -382,12 +382,12 @@ const Y = (t) => () => /* @__PURE__ */ a(E, { children: t }), St = (t, e, s) =>
382
382
  },
383
383
  {
384
384
  path: "settings",
385
- Component: he,
385
+ Component: Re,
386
386
  children: e.map((o) => ({
387
387
  path: o.path,
388
388
  Component: o.component,
389
389
  ...o.errorBoundary && {
390
- ErrorBoundary: Y(o.errorBoundary)
390
+ ErrorBoundary: et(o.errorBoundary)
391
391
  }
392
392
  }))
393
393
  }
@@ -395,29 +395,29 @@ const Y = (t) => () => /* @__PURE__ */ a(E, { children: t }), St = (t, e, s) =>
395
395
  return [
396
396
  r,
397
397
  {
398
- children: fe(t)
398
+ children: Ee(t)
399
399
  },
400
400
  ...n,
401
401
  {
402
402
  path: "*",
403
403
  loader: () => {
404
- throw yt();
404
+ throw Dt();
405
405
  },
406
406
  // Component is required to suppress React Router's warning about empty leaf routes,
407
407
  // even though the loader always throws and this component will never render.
408
408
  Component: () => null,
409
- ErrorBoundary: M
409
+ ErrorBoundary: z
410
410
  }
411
411
  ];
412
- }, Tt = "appshell-root-nav", pe = (t) => ({
413
- loaderID: Tt,
414
- loader: async (e) => ({ navItems: be(t, e) })
415
- }), kt = () => Wt(Tt)?.navItems, be = async (t, e) => {
416
- const s = vt(t.locale);
412
+ }, zt = "appshell-root-nav", Be = (t) => ({
413
+ loaderID: zt,
414
+ loader: async (e) => ({ navItems: Pe(t, e) })
415
+ }), _t = () => te(zt)?.navItems, Pe = async (t, e) => {
416
+ const s = Bt(t.locale);
417
417
  return (await Promise.all(
418
418
  t.modules.map(async (n) => {
419
- if (n.path.startsWith(":") || (await G(n.accessControl, e)).state !== "visible") return null;
420
- const i = await Rt(
419
+ if (n.path.startsWith(":") || (await tt(n.accessControl, e)).state !== "visible") return null;
420
+ const i = await Ft(
421
421
  n.resources,
422
422
  n.path,
423
423
  e,
@@ -428,41 +428,41 @@ const Y = (t) => () => /* @__PURE__ */ a(E, { children: t }), St = (t, e, s) =>
428
428
  )).filter((n) => n !== null).map(({ module: n, resources: o }) => ({
429
429
  title: s(n.meta.title, n.path),
430
430
  url: n.meta.menuItemClickable ? n.path : void 0,
431
- icon: n.meta.icon || /* @__PURE__ */ a(Xt, {}),
431
+ icon: n.meta.icon || /* @__PURE__ */ a(ce, {}),
432
432
  items: o
433
433
  }));
434
- }, Rt = async (t, e, s, r) => (await Promise.all(
434
+ }, Ft = async (t, e, s, r) => (await Promise.all(
435
435
  t.map(async (o) => {
436
- if (o.path.startsWith(":") || (await G(o.accessControl, s)).state !== "visible") return null;
437
- const d = `${e}/${o.path}`, w = r(o.meta.title, o.path), c = o.subResources ? await Rt(
436
+ if (o.path.startsWith(":") || (await tt(o.accessControl, s)).state !== "visible") return null;
437
+ const c = `${e}/${o.path}`, u = r(o.meta.title, o.path), w = o.subResources ? await Ft(
438
438
  o.subResources,
439
- d,
439
+ c,
440
440
  s,
441
441
  r
442
442
  ) : void 0;
443
443
  return {
444
- title: w,
445
- url: d,
446
- items: c && c.length > 0 ? c : void 0
444
+ title: u,
445
+ url: c,
446
+ items: w && w.length > 0 ? w : void 0
447
447
  };
448
448
  })
449
- )).filter((o) => o !== null), ve = (t) => {
450
- const { configurations: e } = T(), { rootComponent: s, children: r } = t, n = ge({
449
+ )).filter((o) => o !== null), De = (t) => {
450
+ const { configurations: e } = k(), { rootComponent: s, children: r } = t, n = Le({
451
451
  modules: e.modules,
452
452
  settingsResources: e.settingsResources,
453
453
  rootComponent: s
454
- }), o = e.errorBoundary, { loaderID: i, loader: d } = pe({
454
+ }), o = e.errorBoundary, { loaderID: i, loader: c } = Be({
455
455
  modules: e.modules,
456
456
  locale: e.locale
457
- }), w = [
457
+ }), u = [
458
458
  {
459
459
  id: i,
460
- loader: d,
460
+ loader: c,
461
461
  element: r,
462
462
  children: o ? [
463
463
  {
464
- element: /* @__PURE__ */ a(H, {}),
465
- ErrorBoundary: Y(o),
464
+ element: /* @__PURE__ */ a(Y, {}),
465
+ ErrorBoundary: et(o),
466
466
  children: n
467
467
  }
468
468
  ] : n,
@@ -472,107 +472,125 @@ const Y = (t) => () => /* @__PURE__ */ a(E, { children: t }), St = (t, e, s) =>
472
472
  */
473
473
  HydrateFallback: () => null
474
474
  }
475
- ], c = e.basePath ? "/" + e.basePath : void 0, m = t.memory ? jt(w, {
476
- basename: c,
475
+ ], w = e.basePath ? "/" + e.basePath : void 0, d = t.memory ? ee(u, {
476
+ basename: w,
477
477
  ...t.initialEntries ? { initialEntries: t.initialEntries } : {}
478
- }) : Kt(w, {
479
- basename: c
478
+ }) : ae(u, {
479
+ basename: w
480
480
  });
481
- return /* @__PURE__ */ a(Ut, { router: m });
482
- }, xe = {
481
+ return /* @__PURE__ */ a(se, { router: d });
482
+ }, Me = {
483
483
  resolvedTheme: "light",
484
484
  theme: "system",
485
485
  setTheme: () => null
486
- }, Bt = K(xe);
487
- function ye({
486
+ }, Ot = q(Me);
487
+ function Ie({
488
488
  children: t,
489
489
  storageKey: e,
490
490
  defaultTheme: s = "system",
491
491
  ...r
492
492
  }) {
493
- const [n, o] = k(
493
+ const [n, o] = R(
494
494
  () => localStorage.getItem(e) || s
495
- ), i = _(() => n !== "system" ? n : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", [n]);
496
- C(() => {
497
- const w = window.document.documentElement;
498
- w.classList.remove("light", "dark"), w.classList.add(i);
495
+ ), i = $(() => n !== "system" ? n : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", [n]);
496
+ y(() => {
497
+ const u = window.document.documentElement;
498
+ u.classList.remove("light", "dark"), u.classList.add(i);
499
499
  }, [i]);
500
- const d = {
500
+ const c = {
501
501
  resolvedTheme: i,
502
502
  theme: n,
503
- setTheme: (w) => {
504
- localStorage.setItem(e, w), o(w);
503
+ setTheme: (u) => {
504
+ localStorage.setItem(e, u), o(u);
505
505
  }
506
506
  };
507
- return /* @__PURE__ */ a(Bt.Provider, { ...r, value: d, children: t });
507
+ return /* @__PURE__ */ a(Ot.Provider, { ...r, value: c, children: t });
508
508
  }
509
- const Ne = () => {
510
- const t = U(Bt);
509
+ const Ae = () => {
510
+ const t = G(Ot);
511
511
  if (t === void 0)
512
512
  throw new Error("useTheme must be used within a ThemeProvider");
513
513
  return t;
514
- }, Xa = (t) => {
515
- const [e, s] = k(!1);
516
- return C(function() {
514
+ }, rs = (t) => {
515
+ const [e, s] = R(!1);
516
+ return y(function() {
517
517
  s(!0);
518
518
  }, []), e ? /* @__PURE__ */ a(
519
- xt.Provider,
519
+ Pt.Provider,
520
520
  {
521
521
  value: {
522
522
  title: t.title,
523
523
  icon: t.icon,
524
- configurations: ue(t)
524
+ configurations: Te(t)
525
525
  },
526
- children: /* @__PURE__ */ a(ye, { defaultTheme: "system", storageKey: "appshell-ui-theme", children: /* @__PURE__ */ a(ve, { rootComponent: t.rootComponent, children: t.children }) })
526
+ children: /* @__PURE__ */ a(Ie, { defaultTheme: "system", storageKey: "appshell-ui-theme", children: /* @__PURE__ */ a(De, { rootComponent: t.rootComponent, children: t.children }) })
527
527
  }
528
528
  ) : null;
529
529
  };
530
- function Ce({
530
+ function ze({
531
531
  ...t
532
532
  }) {
533
- return /* @__PURE__ */ a(Q.Root, { "data-slot": "collapsible", ...t });
533
+ return /* @__PURE__ */ a(Z.Root, { "data-slot": "collapsible", ...t });
534
534
  }
535
- function nt({
535
+ function wt({
536
536
  ...t
537
537
  }) {
538
538
  return /* @__PURE__ */ a(
539
- Q.CollapsibleTrigger,
539
+ Z.CollapsibleTrigger,
540
540
  {
541
541
  "data-slot": "collapsible-trigger",
542
542
  ...t
543
543
  }
544
544
  );
545
545
  }
546
- function Se({
546
+ function _e({
547
547
  ...t
548
548
  }) {
549
549
  return /* @__PURE__ */ a(
550
- Q.CollapsibleContent,
550
+ Z.CollapsibleContent,
551
551
  {
552
552
  "data-slot": "collapsible-content",
553
553
  ...t
554
554
  }
555
555
  );
556
556
  }
557
- const O = 768;
558
- function Te() {
559
- const [t, e] = p.useState(
557
+ const j = 768;
558
+ function Fe() {
559
+ const [t, e] = g.useState(
560
560
  void 0
561
561
  );
562
- return p.useEffect(() => {
563
- const s = window.matchMedia(`(max-width: ${O - 1}px)`), r = () => {
564
- e(window.innerWidth < O);
562
+ return g.useEffect(() => {
563
+ const s = window.matchMedia(`(max-width: ${j - 1}px)`), r = () => {
564
+ e(window.innerWidth < j);
565
565
  };
566
- return s.addEventListener("change", r), e(window.innerWidth < O), () => s.removeEventListener("change", r);
566
+ return s.addEventListener("change", r), e(window.innerWidth < j), () => s.removeEventListener("change", r);
567
567
  }, []), !!t;
568
568
  }
569
- function ke({ className: t, type: e, ...s }) {
569
+ const K = 768, V = 1199;
570
+ function Oe() {
571
+ const [t, e] = g.useState(
572
+ void 0
573
+ );
574
+ return g.useEffect(() => {
575
+ const s = window.matchMedia(
576
+ `(min-width: ${K}px) and (max-width: ${V}px)`
577
+ ), r = () => {
578
+ e(
579
+ window.innerWidth >= K && window.innerWidth <= V
580
+ );
581
+ };
582
+ return s.addEventListener("change", r), e(
583
+ window.innerWidth >= K && window.innerWidth <= V
584
+ ), () => s.removeEventListener("change", r);
585
+ }, []), !!t;
586
+ }
587
+ function $e({ className: t, type: e, ...s }) {
570
588
  return /* @__PURE__ */ a(
571
589
  "input",
572
590
  {
573
591
  type: e,
574
592
  "data-slot": "input",
575
- className: u(
593
+ className: m(
576
594
  "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",
577
595
  "astw:focus-visible:border-ring astw:focus-visible:ring-ring/50 astw:focus-visible:ring-[3px]",
578
596
  "astw:aria-invalid:ring-destructive/20 astw:dark:aria-invalid:ring-destructive/40 astw:aria-invalid:border-destructive",
@@ -582,23 +600,23 @@ function ke({ className: t, type: e, ...s }) {
582
600
  }
583
601
  );
584
602
  }
585
- function Re({ ...t }) {
586
- return /* @__PURE__ */ a(v.Root, { "data-slot": "sheet", ...t });
603
+ function ut({ ...t }) {
604
+ return /* @__PURE__ */ a(b.Root, { "data-slot": "sheet", ...t });
587
605
  }
588
- function Be({
606
+ function We({
589
607
  ...t
590
608
  }) {
591
- return /* @__PURE__ */ a(v.Portal, { "data-slot": "sheet-portal", ...t });
609
+ return /* @__PURE__ */ a(b.Portal, { "data-slot": "sheet-portal", ...t });
592
610
  }
593
- function Ee({
611
+ function je({
594
612
  className: t,
595
613
  ...e
596
614
  }) {
597
615
  return /* @__PURE__ */ a(
598
- v.Overlay,
616
+ b.Overlay,
599
617
  {
600
618
  "data-slot": "sheet-overlay",
601
- className: u(
619
+ className: m(
602
620
  "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",
603
621
  t
604
622
  ),
@@ -606,19 +624,19 @@ function Ee({
606
624
  }
607
625
  );
608
626
  }
609
- function Le({
627
+ function mt({
610
628
  className: t,
611
629
  children: e,
612
630
  side: s = "right",
613
631
  ...r
614
632
  }) {
615
- return /* @__PURE__ */ l(Be, { children: [
616
- /* @__PURE__ */ a(Ee, {}),
633
+ return /* @__PURE__ */ l(We, { children: [
634
+ /* @__PURE__ */ a(je, {}),
617
635
  /* @__PURE__ */ l(
618
- v.Content,
636
+ b.Content,
619
637
  {
620
638
  "data-slot": "sheet-content",
621
- className: u(
639
+ className: m(
622
640
  "astw:bg-background astw:data-[state=open]:animate-in astw:data-[state=closed]:animate-out astw:fixed astw:z-50 astw:flex astw:flex-col astw:gap-4 astw:shadow-lg astw:transition astw:ease-in-out astw:data-[state=closed]:duration-300 astw:data-[state=open]:duration-500",
623
641
  s === "right" && "astw:data-[state=closed]:slide-out-to-right astw:data-[state=open]:slide-in-from-right astw:inset-y-0 astw:right-0 astw:h-full astw:w-3/4 astw:border-l astw:sm:max-w-sm",
624
642
  s === "left" && "astw:data-[state=closed]:slide-out-to-left astw:data-[state=open]:slide-in-from-left astw:inset-y-0 astw:left-0 astw:h-full astw:w-3/4 astw:border-r astw:sm:max-w-sm",
@@ -629,8 +647,8 @@ function Le({
629
647
  ...r,
630
648
  children: [
631
649
  e,
632
- /* @__PURE__ */ l(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: [
633
- /* @__PURE__ */ a(bt, { className: "astw:size-4" }),
650
+ /* @__PURE__ */ l(b.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: [
651
+ /* @__PURE__ */ a(Lt, { className: "astw:size-4" }),
634
652
  /* @__PURE__ */ a("span", { className: "astw:sr-only", children: "Close" })
635
653
  ] })
636
654
  ]
@@ -638,48 +656,48 @@ function Le({
638
656
  )
639
657
  ] });
640
658
  }
641
- function De({ className: t, ...e }) {
659
+ function ht({ className: t, ...e }) {
642
660
  return /* @__PURE__ */ a(
643
661
  "div",
644
662
  {
645
663
  "data-slot": "sheet-header",
646
- className: u("astw:flex astw:flex-col astw:gap-1.5 astw:p-4", t),
664
+ className: m("astw:flex astw:flex-col astw:gap-1.5 astw:p-4", t),
647
665
  ...e
648
666
  }
649
667
  );
650
668
  }
651
- function Pe({
669
+ function ft({
652
670
  className: t,
653
671
  ...e
654
672
  }) {
655
673
  return /* @__PURE__ */ a(
656
- v.Title,
674
+ b.Title,
657
675
  {
658
676
  "data-slot": "sheet-title",
659
- className: u("astw:text-foreground astw:font-semibold", t),
677
+ className: m("astw:text-foreground astw:font-semibold", t),
660
678
  ...e
661
679
  }
662
680
  );
663
681
  }
664
- function Me({
682
+ function pt({
665
683
  className: t,
666
684
  ...e
667
685
  }) {
668
686
  return /* @__PURE__ */ a(
669
- v.Description,
687
+ b.Description,
670
688
  {
671
689
  "data-slot": "sheet-description",
672
- className: u("astw:text-muted-foreground astw:text-sm", t),
690
+ className: m("astw:text-muted-foreground astw:text-sm", t),
673
691
  ...e
674
692
  }
675
693
  );
676
694
  }
677
- function X({
695
+ function at({
678
696
  delayDuration: t = 0,
679
697
  ...e
680
698
  }) {
681
699
  return /* @__PURE__ */ a(
682
- R.Provider,
700
+ E.Provider,
683
701
  {
684
702
  "data-slot": "tooltip-provider",
685
703
  delayDuration: t,
@@ -687,47 +705,47 @@ function X({
687
705
  }
688
706
  );
689
707
  }
690
- function Z({
708
+ function st({
691
709
  ...t
692
710
  }) {
693
- return /* @__PURE__ */ a(X, { children: /* @__PURE__ */ a(R.Root, { "data-slot": "tooltip", ...t }) });
711
+ return /* @__PURE__ */ a(at, { children: /* @__PURE__ */ a(E.Root, { "data-slot": "tooltip", ...t }) });
694
712
  }
695
- function J({
713
+ function rt({
696
714
  ...t
697
715
  }) {
698
- return /* @__PURE__ */ a(R.Trigger, { "data-slot": "tooltip-trigger", ...t });
716
+ return /* @__PURE__ */ a(E.Trigger, { "data-slot": "tooltip-trigger", ...t });
699
717
  }
700
- function tt({
718
+ function nt({
701
719
  className: t,
702
720
  sideOffset: e = 0,
703
721
  children: s,
704
722
  ...r
705
723
  }) {
706
- return /* @__PURE__ */ a(R.Portal, { children: /* @__PURE__ */ l(
707
- R.Content,
724
+ return /* @__PURE__ */ a(E.Portal, { children: /* @__PURE__ */ l(
725
+ E.Content,
708
726
  {
709
727
  "data-slot": "tooltip-content",
710
728
  sideOffset: e,
711
- className: u(
729
+ className: m(
712
730
  "astw:bg-primary astw:text-primary-foreground astw:animate-in astw:fade-in-0 astw:zoom-in-95 astw:data-[state=closed]:animate-out astw:data-[state=closed]:fade-out-0 astw:data-[state=closed]:zoom-out-95 astw:data-[side=bottom]:slide-in-from-top-2 astw:data-[side=left]:slide-in-from-right-2 astw:data-[side=right]:slide-in-from-left-2 astw:data-[side=top]:slide-in-from-bottom-2 astw:z-50 astw:w-fit astw:origin-(--radix-tooltip-content-transform-origin) astw:rounded-md astw:px-3 astw:py-1.5 astw:text-xs astw:text-balance",
713
731
  t
714
732
  ),
715
733
  ...r,
716
734
  children: [
717
735
  s,
718
- /* @__PURE__ */ a(R.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]" })
736
+ /* @__PURE__ */ a(E.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]" })
719
737
  ]
720
738
  }
721
739
  ) });
722
740
  }
723
- const Ae = "sidebar_state", Ie = 3600 * 24 * 7, _e = "16rem", ze = "18rem", Fe = "3rem", Oe = "b", Et = p.createContext(null);
724
- function z() {
725
- const t = p.useContext(Et);
741
+ const $t = "16rem", Ke = "18rem", Ve = "3rem", He = "b", Wt = g.createContext(null);
742
+ function _() {
743
+ const t = g.useContext(Wt);
726
744
  if (!t)
727
745
  throw new Error("useSidebar must be used within a SidebarProvider.");
728
746
  return t;
729
747
  }
730
- function $e({
748
+ function Ue({
731
749
  defaultOpen: t = !0,
732
750
  open: e,
733
751
  onOpenChange: s,
@@ -736,41 +754,44 @@ function $e({
736
754
  children: o,
737
755
  ...i
738
756
  }) {
739
- const d = Te(), [w, c] = p.useState(!1), [m, g] = p.useState(t), f = e ?? m, h = p.useCallback(
740
- (b) => {
741
- const N = typeof b == "function" ? b(f) : b;
742
- s ? s(N) : g(N), document.cookie = `${Ae}=${N}; path=/; max-age=${Ie}`;
757
+ const c = Fe(), u = Oe(), [w, d] = g.useState(!1), [h, f] = g.useState(!1), [p, P] = g.useState(t), C = e ?? p, D = g.useCallback(
758
+ (x) => {
759
+ const T = typeof x == "function" ? x(C) : x;
760
+ s ? s(T) : P(T);
743
761
  },
744
- [s, f]
745
- ), y = p.useCallback(() => d ? c((b) => !b) : h((b) => !b), [d, h, c]);
746
- p.useEffect(() => {
747
- const b = (N) => {
748
- N.key === Oe && (N.metaKey || N.ctrlKey) && (N.preventDefault(), y());
762
+ [s, C]
763
+ ), S = u && !c, F = g.useCallback(() => c ? d((x) => !x) : S ? f((x) => !x) : D((x) => !x), [c, S, D, d]);
764
+ g.useEffect(() => {
765
+ const x = (T) => {
766
+ T.key === He && (T.metaKey || T.ctrlKey) && (T.preventDefault(), F());
749
767
  };
750
- return window.addEventListener("keydown", b), () => window.removeEventListener("keydown", b);
751
- }, [y]);
752
- const A = f ? "expanded" : "collapsed", et = p.useMemo(
768
+ return window.addEventListener("keydown", x), () => window.removeEventListener("keydown", x);
769
+ }, [F]);
770
+ const it = C ? "expanded" : "collapsed", qt = g.useMemo(
753
771
  () => ({
754
- state: A,
755
- open: f,
756
- setOpen: h,
757
- isMobile: d,
772
+ state: it,
773
+ open: C,
774
+ setOpen: D,
775
+ isMobile: c,
758
776
  openMobile: w,
759
- setOpenMobile: c,
760
- toggleSidebar: y
777
+ setOpenMobile: d,
778
+ toggleSidebar: F,
779
+ isIconMode: S,
780
+ openIconMode: h,
781
+ setOpenIconMode: f
761
782
  }),
762
- [A, f, h, d, w, c, y]
783
+ [it, C, D, c, w, d, F, S, h, f]
763
784
  );
764
- return /* @__PURE__ */ a(Et.Provider, { value: et, children: /* @__PURE__ */ a(X, { delayDuration: 0, children: /* @__PURE__ */ a(
785
+ return /* @__PURE__ */ a(Wt.Provider, { value: qt, children: /* @__PURE__ */ a(at, { delayDuration: 0, children: /* @__PURE__ */ a(
765
786
  "div",
766
787
  {
767
788
  "data-slot": "sidebar-wrapper",
768
789
  style: {
769
- "--sidebar-width": _e,
770
- "--sidebar-width-icon": Fe,
790
+ "--sidebar-width": $t,
791
+ "--sidebar-width-icon": Ve,
771
792
  ...n
772
793
  },
773
- className: u(
794
+ className: m(
774
795
  "astw:group/sidebar-wrapper astw:has-data-[variant=inset]:bg-sidebar astw:flex astw:min-h-svh astw:w-full",
775
796
  r
776
797
  ),
@@ -779,7 +800,7 @@ function $e({
779
800
  }
780
801
  ) }) });
781
802
  }
782
- function We({
803
+ function Qe({
783
804
  side: t = "left",
784
805
  variant: e = "sidebar",
785
806
  collapsible: s = "offcanvas",
@@ -787,43 +808,108 @@ function We({
787
808
  children: n,
788
809
  ...o
789
810
  }) {
790
- const { isMobile: i, state: d, openMobile: w, setOpenMobile: c } = z();
811
+ const { isMobile: i, state: c, openMobile: u, setOpenMobile: w, isIconMode: d, openIconMode: h, setOpenIconMode: f } = _();
791
812
  return s === "none" ? /* @__PURE__ */ a(
792
813
  "div",
793
814
  {
794
815
  "data-slot": "sidebar",
795
- className: u(
816
+ className: m(
796
817
  "astw:bg-sidebar astw:text-sidebar-foreground astw:flex astw:h-full astw:w-(--sidebar-width) astw:flex-col",
797
818
  r
798
819
  ),
799
820
  ...o,
800
821
  children: n
801
822
  }
802
- ) : i ? /* @__PURE__ */ a(Re, { open: w, onOpenChange: c, ...o, children: /* @__PURE__ */ l(
803
- Le,
823
+ ) : i ? /* @__PURE__ */ a(ut, { open: u, onOpenChange: w, ...o, children: /* @__PURE__ */ l(
824
+ mt,
804
825
  {
805
826
  "data-sidebar": "sidebar",
806
827
  "data-slot": "sidebar",
807
828
  "data-mobile": "true",
808
829
  className: "astw:bg-sidebar astw:text-sidebar-foreground astw:w-(--sidebar-width) astw:p-0 astw:[&>button]:hidden",
809
830
  style: {
810
- "--sidebar-width": ze
831
+ "--sidebar-width": Ke
811
832
  },
812
833
  side: t,
813
834
  children: [
814
- /* @__PURE__ */ l(De, { className: "astw:sr-only", children: [
815
- /* @__PURE__ */ a(Pe, { children: "Sidebar" }),
816
- /* @__PURE__ */ a(Me, { children: "Displays the mobile sidebar." })
835
+ /* @__PURE__ */ l(ht, { className: "astw:sr-only", children: [
836
+ /* @__PURE__ */ a(ft, { children: "Sidebar" }),
837
+ /* @__PURE__ */ a(pt, { children: "Displays the mobile sidebar." })
817
838
  ] }),
818
839
  /* @__PURE__ */ a("div", { className: "flex h-full w-full flex-col", children: n })
819
840
  ]
820
841
  }
821
- ) }) : /* @__PURE__ */ l(
842
+ ) }) : d && s === "icon" ? /* @__PURE__ */ l(L, { children: [
843
+ /* @__PURE__ */ l(
844
+ "div",
845
+ {
846
+ className: "astw:group astw:peer astw:text-sidebar-foreground astw:hidden astw:md:block",
847
+ "data-state": "collapsed",
848
+ "data-collapsible": "icon",
849
+ "data-variant": e,
850
+ "data-side": t,
851
+ "data-slot": "sidebar",
852
+ children: [
853
+ /* @__PURE__ */ a(
854
+ "div",
855
+ {
856
+ "data-slot": "sidebar-gap",
857
+ className: m(
858
+ "astw:relative astw:bg-transparent astw:transition-[width] astw:duration-200 astw:ease-linear",
859
+ e === "floating" || e === "inset" ? "astw:group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "astw:group-data-[collapsible=icon]:w-(--sidebar-width-icon)"
860
+ )
861
+ }
862
+ ),
863
+ /* @__PURE__ */ a(
864
+ "div",
865
+ {
866
+ "data-slot": "sidebar-container",
867
+ className: m(
868
+ "astw:fixed astw:inset-y-0 astw:z-10 astw:hidden astw:h-svh astw:transition-[left,right,width] astw:duration-200 astw:ease-linear astw:md:flex",
869
+ t === "left" ? "astw:left-0" : "astw:right-0",
870
+ e === "floating" || e === "inset" ? "astw:p-2 astw:group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]" : "astw:group-data-[collapsible=icon]:w-(--sidebar-width-icon) astw:group-data-[side=left]:border-r astw:group-data-[side=right]:border-l",
871
+ e === "inset" && "astw:border-x astw:border-x-border"
872
+ ),
873
+ children: /* @__PURE__ */ a(
874
+ "div",
875
+ {
876
+ "data-sidebar": "sidebar",
877
+ "data-slot": "sidebar-inner",
878
+ className: "astw:bg-sidebar astw:group-data-[variant=floating]:border-sidebar-border astw:flex astw:h-full astw:w-full astw:flex-col astw:overflow-hidden astw:group-data-[variant=floating]:rounded-lg astw:group-data-[variant=floating]:border astw:group-data-[variant=floating]:shadow-sm",
879
+ children: n
880
+ }
881
+ )
882
+ }
883
+ )
884
+ ]
885
+ }
886
+ ),
887
+ /* @__PURE__ */ a(ut, { open: h, onOpenChange: f, ...o, children: /* @__PURE__ */ l(
888
+ mt,
889
+ {
890
+ "data-sidebar": "sidebar",
891
+ "data-slot": "sidebar-overlay",
892
+ "data-icon-mode": "true",
893
+ className: "astw:bg-sidebar astw:text-sidebar-foreground astw:w-(--sidebar-width) astw:p-0 astw:[&>button]:hidden",
894
+ style: {
895
+ "--sidebar-width": $t
896
+ },
897
+ side: t,
898
+ children: [
899
+ /* @__PURE__ */ l(ht, { className: "astw:sr-only", children: [
900
+ /* @__PURE__ */ a(ft, { children: "Sidebar" }),
901
+ /* @__PURE__ */ a(pt, { children: "Displays the sidebar overlay." })
902
+ ] }),
903
+ /* @__PURE__ */ a("div", { className: "flex h-full w-full flex-col", children: n })
904
+ ]
905
+ }
906
+ ) })
907
+ ] }) : /* @__PURE__ */ l(
822
908
  "div",
823
909
  {
824
910
  className: "astw:group astw:peer astw:text-sidebar-foreground astw:hidden astw:md:block",
825
- "data-state": d,
826
- "data-collapsible": d === "collapsed" ? s : "",
911
+ "data-state": c,
912
+ "data-collapsible": c === "collapsed" ? s : "",
827
913
  "data-variant": e,
828
914
  "data-side": t,
829
915
  "data-slot": "sidebar",
@@ -832,7 +918,7 @@ function We({
832
918
  "div",
833
919
  {
834
920
  "data-slot": "sidebar-gap",
835
- className: u(
921
+ className: m(
836
922
  "astw:relative astw:w-(--sidebar-width) astw:bg-transparent astw:transition-[width] astw:duration-200 astw:ease-linear",
837
923
  "astw:group-data-[collapsible=offcanvas]:w-0",
838
924
  "astw:group-data-[side=right]:rotate-180",
@@ -844,7 +930,7 @@ function We({
844
930
  "div",
845
931
  {
846
932
  "data-slot": "sidebar-container",
847
- className: u(
933
+ className: m(
848
934
  "astw:fixed astw:inset-y-0 astw:z-10 astw:hidden astw:h-svh astw:w-(--sidebar-width) astw:transition-[left,right,width] astw:duration-200 astw:ease-linear astw:md:flex",
849
935
  t === "left" ? "astw:left-0 astw:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]" : "astw:right-0 astw:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
850
936
  // Adjust the padding for floating and inset variants.
@@ -868,37 +954,37 @@ function We({
868
954
  }
869
955
  );
870
956
  }
871
- function Lt({
957
+ function jt({
872
958
  className: t,
873
959
  onClick: e,
874
960
  ...s
875
961
  }) {
876
- const { toggleSidebar: r } = z();
962
+ const { toggleSidebar: r } = _();
877
963
  return /* @__PURE__ */ l(
878
- D,
964
+ I,
879
965
  {
880
966
  "data-sidebar": "trigger",
881
967
  "data-slot": "sidebar-trigger",
882
968
  variant: "ghost",
883
969
  size: "icon",
884
- className: u("astw:text-muted-foreground", t),
970
+ className: m("astw:text-muted-foreground", t),
885
971
  onClick: (n) => {
886
972
  e?.(n), r();
887
973
  },
888
974
  ...s,
889
975
  children: [
890
- /* @__PURE__ */ a(Zt, { className: "astw:size-4.5" }),
976
+ /* @__PURE__ */ a(we, { className: "astw:size-4.5" }),
891
977
  /* @__PURE__ */ a("span", { className: "astw:sr-only", children: "Toggle Sidebar" })
892
978
  ]
893
979
  }
894
980
  );
895
981
  }
896
- function je({ className: t, ...e }) {
982
+ function qe({ className: t, ...e }) {
897
983
  return /* @__PURE__ */ a(
898
984
  "main",
899
985
  {
900
986
  "data-slot": "sidebar-inset",
901
- className: u(
987
+ className: m(
902
988
  "astw:bg-background astw:relative astw:flex astw:w-full astw:flex-1 astw:flex-col",
903
989
  "astw:px-4 astw:md:peer-data-[variant=inset]:px-8 astw:md:peer-data-[variant=inset]:py-2",
904
990
  // astw:md:peer-data-[variant=inset]:peer-data-[state=collapsed]:pl-2
@@ -908,66 +994,63 @@ function je({ className: t, ...e }) {
908
994
  }
909
995
  );
910
996
  }
911
- function Ke({ className: t, ...e }) {
997
+ function Ge({ className: t, ...e }) {
912
998
  return /* @__PURE__ */ a(
913
999
  "div",
914
1000
  {
915
1001
  "data-slot": "sidebar-header",
916
1002
  "data-sidebar": "header",
917
- className: u("astw:flex astw:flex-row astw:items-center astw:gap-0.5 astw:p-2", t),
1003
+ className: m("astw:flex astw:flex-row astw:items-center astw:gap-0.5 astw:p-2", t),
918
1004
  ...e
919
1005
  }
920
1006
  );
921
1007
  }
922
- function Ue({ className: t, ...e }) {
1008
+ function Ye({ className: t, ...e }) {
923
1009
  return /* @__PURE__ */ a(
924
1010
  "div",
925
1011
  {
926
1012
  "data-slot": "sidebar-content",
927
1013
  "data-sidebar": "content",
928
- className: u(
929
- "astw:flex astw:min-h-0 astw:flex-1 astw:flex-col astw:gap-2 astw:overflow-auto astw:group-data-[collapsible=icon]:overflow-hidden",
930
- t
931
- ),
1014
+ className: m("astw:flex astw:min-h-0 astw:flex-1 astw:flex-col astw:gap-2 astw:overflow-auto astw:group-data-[collapsible=icon]:overflow-hidden", t),
932
1015
  ...e
933
1016
  }
934
1017
  );
935
1018
  }
936
- function Dt({ className: t, ...e }) {
1019
+ function Kt({ className: t, ...e }) {
937
1020
  return /* @__PURE__ */ a(
938
1021
  "div",
939
1022
  {
940
1023
  "data-slot": "sidebar-group",
941
1024
  "data-sidebar": "group",
942
- className: u("astw:relative astw:flex astw:w-full astw:min-w-0 astw:flex-col astw:p-2", t),
1025
+ className: m("astw:relative astw:flex astw:w-full astw:min-w-0 astw:flex-col astw:p-2", t),
943
1026
  ...e
944
1027
  }
945
1028
  );
946
1029
  }
947
- function Pt({ className: t, ...e }) {
1030
+ function Vt({ className: t, ...e }) {
948
1031
  return /* @__PURE__ */ a(
949
1032
  "ul",
950
1033
  {
951
1034
  "data-slot": "sidebar-menu",
952
1035
  "data-sidebar": "menu",
953
- className: u("astw:flex astw:w-full astw:min-w-0 astw:flex-col astw:gap-1", t),
1036
+ className: m("astw:flex astw:w-full astw:min-w-0 astw:flex-col astw:gap-1", t),
954
1037
  ...e
955
1038
  }
956
1039
  );
957
1040
  }
958
- function Mt({ className: t, ...e }) {
1041
+ function Ht({ className: t, ...e }) {
959
1042
  return /* @__PURE__ */ a(
960
1043
  "li",
961
1044
  {
962
1045
  "data-slot": "sidebar-menu-item",
963
1046
  "data-sidebar": "menu-item",
964
- className: u("astw:group/menu-item astw:relative", t),
1047
+ className: m("astw:group/menu-item astw:relative", t),
965
1048
  ...e
966
1049
  }
967
1050
  );
968
1051
  }
969
- const He = V(
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",
1052
+ const Xe = X(
1053
+ "astw:peer/menu-button astw:flex astw:w-full astw:items-center astw:gap-2 astw:overflow-hidden astw:rounded-md astw:p-2 astw:text-left astw:text-sm astw:outline-hidden astw:ring-sidebar-ring astw:transition-[width,height,padding] astw:hover:bg-sidebar-accent astw:hover:text-sidebar-accent-foreground astw:focus-visible:ring-2 astw:active:bg-sidebar-accent astw:active:text-sidebar-accent-foreground astw:disabled:pointer-events-none astw:disabled:opacity-50 astw:group-has-data-[sidebar=menu-action]/menu-item:pr-8 astw:aria-disabled:pointer-events-none astw:aria-disabled:opacity-50 astw:data-[active=true]:bg-sidebar-accent astw:data-[active=true]:font-medium astw:data-[active=true]:text-sidebar-accent-foreground astw:data-[state=open]:hover:bg-sidebar-accent astw:data-[state=open]:hover:text-sidebar-accent-foreground astw:group-data-[collapsible=icon]:size-8! astw:group-data-[collapsible=icon]:p-2! astw:[&>span:last-child]:truncate astw:group-data-[collapsible=icon]:[&>span:last-child]:hidden astw:[&>svg]:size-4 astw:[&>svg]:shrink-0",
971
1054
  {
972
1055
  variants: {
973
1056
  variant: {
@@ -986,7 +1069,7 @@ const He = V(
986
1069
  }
987
1070
  }
988
1071
  );
989
- function ot({
1072
+ function gt({
990
1073
  asChild: t = !1,
991
1074
  isActive: e = !1,
992
1075
  variant: s = "default",
@@ -995,44 +1078,44 @@ function ot({
995
1078
  className: o,
996
1079
  ...i
997
1080
  }) {
998
- const d = t ? P : "button", { isMobile: w, state: c } = z(), m = /* @__PURE__ */ a(
999
- d,
1081
+ const c = t ? A : "button", { isMobile: u, state: w } = _(), d = /* @__PURE__ */ a(
1082
+ c,
1000
1083
  {
1001
1084
  "data-slot": "sidebar-menu-button",
1002
1085
  "data-sidebar": "menu-button",
1003
1086
  "data-size": r,
1004
1087
  "data-active": e,
1005
- className: u(He({ variant: s, size: r }), o),
1088
+ className: m(Xe({ variant: s, size: r }), o),
1006
1089
  ...i
1007
1090
  }
1008
1091
  );
1009
1092
  return n ? (typeof n == "string" && (n = {
1010
1093
  children: n
1011
- }), /* @__PURE__ */ l(Z, { children: [
1012
- /* @__PURE__ */ a(J, { asChild: !0, children: m }),
1094
+ }), /* @__PURE__ */ l(st, { children: [
1095
+ /* @__PURE__ */ a(rt, { asChild: !0, children: d }),
1013
1096
  /* @__PURE__ */ a(
1014
- tt,
1097
+ nt,
1015
1098
  {
1016
1099
  side: "right",
1017
1100
  align: "center",
1018
- hidden: c !== "collapsed" || w,
1101
+ hidden: w !== "collapsed" || u,
1019
1102
  ...n
1020
1103
  }
1021
1104
  )
1022
- ] })) : m;
1105
+ ] })) : d;
1023
1106
  }
1024
- function it({
1107
+ function bt({
1025
1108
  className: t,
1026
1109
  asChild: e = !1,
1027
1110
  showOnHover: s = !1,
1028
1111
  ...r
1029
1112
  }) {
1030
1113
  return /* @__PURE__ */ a(
1031
- e ? P : "button",
1114
+ e ? A : "button",
1032
1115
  {
1033
1116
  "data-slot": "sidebar-menu-action",
1034
1117
  "data-sidebar": "menu-action",
1035
- className: u(
1118
+ className: m(
1036
1119
  "astw:text-sidebar-foreground astw:ring-sidebar-ring astw:hover:bg-sidebar-accent astw:hover:text-sidebar-accent-foreground astw:peer-hover/menu-button:text-sidebar-accent-foreground astw:absolute astw:top-1.5 astw:right-1 astw:flex astw:aspect-square astw:w-5 astw:items-center astw:justify-center astw:rounded-md astw:p-0 astw:outline-hidden astw:transition-transform astw:focus-visible:ring-2 astw:[&>svg]:size-4 astw:[&>svg]:shrink-0",
1037
1120
  // Increases the hit area of the button on mobile.
1038
1121
  "astw:after:absolute astw:after:-inset-2 astw:md:after:hidden",
@@ -1047,13 +1130,13 @@ function it({
1047
1130
  }
1048
1131
  );
1049
1132
  }
1050
- function Ve({ className: t, ...e }) {
1133
+ function Ze({ className: t, ...e }) {
1051
1134
  return /* @__PURE__ */ a(
1052
1135
  "ul",
1053
1136
  {
1054
1137
  "data-slot": "sidebar-menu-sub",
1055
1138
  "data-sidebar": "menu-sub",
1056
- className: u(
1139
+ className: m(
1057
1140
  "astw:border-sidebar-border astw:mx-3.5 astw:flex astw:min-w-0 astw:translate-x-px astw:flex-col astw:gap-1 astw:border-l astw:px-2.5 astw:py-0.5",
1058
1141
  "astw:group-data-[collapsible=icon]:hidden",
1059
1142
  t
@@ -1062,7 +1145,7 @@ function Ve({ className: t, ...e }) {
1062
1145
  }
1063
1146
  );
1064
1147
  }
1065
- function Qe({
1148
+ function Je({
1066
1149
  className: t,
1067
1150
  ...e
1068
1151
  }) {
@@ -1071,12 +1154,12 @@ function Qe({
1071
1154
  {
1072
1155
  "data-slot": "sidebar-menu-sub-item",
1073
1156
  "data-sidebar": "menu-sub-item",
1074
- className: u("astw:group/menu-sub-item astw:relative", t),
1157
+ className: m("astw:group/menu-sub-item astw:relative", t),
1075
1158
  ...e
1076
1159
  }
1077
1160
  );
1078
1161
  }
1079
- function qe({
1162
+ function ta({
1080
1163
  asChild: t = !1,
1081
1164
  size: e = "md",
1082
1165
  isActive: s = !1,
@@ -1084,14 +1167,14 @@ function qe({
1084
1167
  ...n
1085
1168
  }) {
1086
1169
  return /* @__PURE__ */ a(
1087
- t ? P : "a",
1170
+ t ? A : "a",
1088
1171
  {
1089
1172
  "data-slot": "sidebar-menu-sub-button",
1090
1173
  "data-sidebar": "menu-sub-button",
1091
1174
  "data-size": e,
1092
1175
  "data-active": s,
1093
- className: u(
1094
- "astw:text-sidebar-foreground astw:ring-sidebar-ring astw:hover:bg-sidebar-accent astw:hover:text-sidebar-accent-foreground astw:active:bg-sidebar-accent astw:active:text-sidebar-accent-foreground astw:[&>svg]:text-sidebar-accent-foreground astw:flex astw:h-7 astw:min-w-0 astw:-translate-x-px astw:items-center astw:gap-2 astw:overflow-hidden astw:rounded-md astw:px-2 astw:outline-hidden astw:focus-visible:ring-2 astw:disabled:pointer-events-none astw:disabled:opacity-50 astw:aria-disabled:pointer-events-none astw:aria-disabled:opacity-50 astw:[&>span:last-child]:truncate astw:[&>svg]:size-4 astw:[&>svg]:shrink-0",
1176
+ className: m(
1177
+ "astw:text-sidebar-foreground astw:ring-sidebar-ring astw:hover:bg-sidebar-accent astw:hover:text-sidebar-accent-foreground astw:active:bg-sidebar-accent astw:active:text-sidebar-accent-foreground astw:[&>svg]:text-sidebar-accent-foreground astw:flex astw:h-7 astw:min-w-0 astw:-translate-x-px astw:items-center astw:gap-2 astw:overflow-hidden astw:rounded-md astw:px-2 astw:outline-hidden astw:focus-visible:ring-2 astw:disabled:pointer-events-none astw:disabled:opacity-50 astw:aria-disabled:pointer-events-none astw:aria-disabled:opacity-50 astw:[&>span:last-child]:truncate astw:group-data-[collapsible=icon]:[&>span:last-child]:hidden astw:[&>svg]:size-4 astw:[&>svg]:shrink-0",
1095
1178
  "astw:data-[active=true]:bg-sidebar-accent astw:data-[active=true]:text-sidebar-accent-foreground",
1096
1179
  e === "sm" && "astw:text-xs",
1097
1180
  e === "md" && "astw:text-sm",
@@ -1102,22 +1185,22 @@ function qe({
1102
1185
  }
1103
1186
  );
1104
1187
  }
1105
- function j({ to: t, children: e, ...s }) {
1188
+ function Q({ to: t, children: e, ...s }) {
1106
1189
  try {
1107
- return Ht(t), /* @__PURE__ */ a(Vt, { to: t, ...s, children: e });
1190
+ return re(t), /* @__PURE__ */ a(ne, { to: t, ...s, children: e });
1108
1191
  } catch {
1109
1192
  return /* @__PURE__ */ a("a", { href: t, ...s, children: e });
1110
1193
  }
1111
1194
  }
1112
- function lt({ ...t }) {
1195
+ function xt({ ...t }) {
1113
1196
  return /* @__PURE__ */ a("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...t });
1114
1197
  }
1115
- function dt({ className: t, ...e }) {
1198
+ function vt({ className: t, ...e }) {
1116
1199
  return /* @__PURE__ */ a(
1117
1200
  "ol",
1118
1201
  {
1119
1202
  "data-slot": "breadcrumb-list",
1120
- className: u(
1203
+ className: m(
1121
1204
  "astw:text-muted-foreground astw:flex astw:flex-wrap astw:items-center astw:gap-1.5 astw:text-sm astw:break-words astw:sm:gap-2.5",
1122
1205
  t
1123
1206
  ),
@@ -1125,33 +1208,33 @@ function dt({ className: t, ...e }) {
1125
1208
  }
1126
1209
  );
1127
1210
  }
1128
- function ct({ className: t, ...e }) {
1211
+ function yt({ className: t, ...e }) {
1129
1212
  return /* @__PURE__ */ a(
1130
1213
  "li",
1131
1214
  {
1132
1215
  "data-slot": "breadcrumb-item",
1133
- className: u("astw:inline-flex astw:items-center astw:gap-1.5", t),
1216
+ className: m("astw:inline-flex astw:items-center astw:gap-1.5", t),
1134
1217
  ...e
1135
1218
  }
1136
1219
  );
1137
1220
  }
1138
- function wt({
1221
+ function Nt({
1139
1222
  asChild: t,
1140
1223
  className: e,
1141
1224
  children: s,
1142
1225
  ...r
1143
1226
  }) {
1144
1227
  return /* @__PURE__ */ a(
1145
- t ? P : j,
1228
+ t ? A : Q,
1146
1229
  {
1147
1230
  "data-slot": "breadcrumb-link",
1148
- className: u("astw:hover:text-foreground astw:transition-colors", e),
1231
+ className: m("astw:hover:text-foreground astw:transition-colors", e),
1149
1232
  ...r,
1150
1233
  children: s
1151
1234
  }
1152
1235
  );
1153
1236
  }
1154
- function Ge({
1237
+ function ea({
1155
1238
  children: t,
1156
1239
  className: e,
1157
1240
  ...s
@@ -1162,21 +1245,21 @@ function Ge({
1162
1245
  "data-slot": "breadcrumb-separator",
1163
1246
  role: "presentation",
1164
1247
  "aria-hidden": "true",
1165
- className: u("astw:[&>svg]:size-3.5", e),
1248
+ className: m("astw:[&>svg]:size-3.5", e),
1166
1249
  ...s,
1167
- children: t ?? /* @__PURE__ */ a($, {})
1250
+ children: t ?? /* @__PURE__ */ a(H, {})
1168
1251
  }
1169
1252
  );
1170
1253
  }
1171
- function Ye(t, e) {
1254
+ function aa(t, e) {
1172
1255
  if (!e.trim()) return t;
1173
1256
  const s = e.toLowerCase();
1174
1257
  return t.filter(
1175
1258
  (r) => r.title.toLowerCase().includes(s) || r.path.toLowerCase().includes(s)
1176
1259
  );
1177
1260
  }
1178
- const Xe = (t, e) => {
1179
- const s = vt(e);
1261
+ const sa = (t, e) => {
1262
+ const s = Bt(e);
1180
1263
  return t.reduce(
1181
1264
  (r, n) => {
1182
1265
  const o = s(n.meta.title, n.path);
@@ -1184,18 +1267,18 @@ const Xe = (t, e) => {
1184
1267
  title: o,
1185
1268
  breadcrumbTitle: n.meta.breadcrumbTitle
1186
1269
  };
1187
- const i = (d, w) => {
1188
- !d || d.length === 0 || d.forEach((c) => {
1189
- const m = `${w}/${c.path}`, g = s(
1190
- c.meta.title,
1191
- c.path
1270
+ const i = (c, u) => {
1271
+ !c || c.length === 0 || c.forEach((w) => {
1272
+ const d = `${u}/${w.path}`, h = s(
1273
+ w.meta.title,
1274
+ w.path
1192
1275
  );
1193
- r[m] = {
1194
- title: g,
1195
- breadcrumbTitle: c.meta.breadcrumbTitle
1196
- }, c.subResources && c.subResources.length > 0 && i(
1197
- c.subResources,
1198
- m
1276
+ r[d] = {
1277
+ title: h,
1278
+ breadcrumbTitle: w.meta.breadcrumbTitle
1279
+ }, w.subResources && w.subResources.length > 0 && i(
1280
+ w.subResources,
1281
+ d
1199
1282
  );
1200
1283
  });
1201
1284
  };
@@ -1204,73 +1287,82 @@ const Xe = (t, e) => {
1204
1287
  {}
1205
1288
  );
1206
1289
  };
1207
- function Ze(t, e, s, r) {
1208
- const n = t.split("/").filter((w) => w !== ""), o = e && n[0] === e ? n.slice(1) : n, i = Xe(s, r), d = o.map((w, c) => {
1209
- const m = o.slice(0, c + 1).join("/");
1210
- let g = i[m];
1211
- if (!g) {
1212
- const h = Object.entries(i).find(
1213
- ([y]) => {
1214
- const A = y.split("/").map((b) => b.startsWith(":") ? "[^/]+" : b).join("/");
1215
- return new RegExp(`^${A}$`).test(m);
1290
+ function ra(t, e, s, r) {
1291
+ const n = t.split("/").filter((u) => u !== ""), o = e && n[0] === e ? n.slice(1) : n, i = sa(s, r), c = o.map((u, w) => {
1292
+ const d = o.slice(0, w + 1).join("/");
1293
+ let h = i[d];
1294
+ if (!h) {
1295
+ const p = Object.entries(i).find(
1296
+ ([P]) => {
1297
+ const C = P.split("/").map((S) => S.startsWith(":") ? "[^/]+" : S).join("/");
1298
+ return new RegExp(`^${C}$`).test(d);
1216
1299
  }
1217
1300
  )?.[1];
1218
- h && (g = h);
1301
+ p && (h = p);
1219
1302
  }
1220
1303
  let f;
1221
- return g ? typeof g.breadcrumbTitle == "function" ? f = g.breadcrumbTitle(w) : typeof g.breadcrumbTitle == "string" ? f = g.breadcrumbTitle : f = g.title : f = decodeURIComponent(w), {
1222
- segment: w,
1223
- path: m,
1304
+ return h ? typeof h.breadcrumbTitle == "function" ? f = h.breadcrumbTitle(u) : typeof h.breadcrumbTitle == "string" ? f = h.breadcrumbTitle : f = h.title : f = decodeURIComponent(u), {
1305
+ segment: u,
1306
+ path: d,
1224
1307
  title: f
1225
1308
  };
1226
1309
  });
1227
1310
  return {
1228
1311
  basePath: e || null,
1229
- segments: d
1312
+ segments: c
1230
1313
  };
1231
1314
  }
1232
- const Je = () => {
1233
- const { open: t } = z();
1234
- return /* @__PURE__ */ a("div", { className: t ? "astw:md:hidden" : void 0, children: /* @__PURE__ */ a(Lt, { className: "astw:-ml-2.5" }) });
1235
- }, Za = (t) => {
1236
- const e = t.children ? t.children({ Outlet: rt }) : null, s = Ne(), r = () => {
1315
+ const na = () => {
1316
+ const { open: t, isIconMode: e } = _();
1317
+ return /* @__PURE__ */ a("div", { className: t && !e ? "astw:md:hidden" : void 0, children: /* @__PURE__ */ a(jt, { className: "astw:-ml-2.5" }) });
1318
+ }, ns = (t) => {
1319
+ const e = t.children ? t.children({ Outlet: ct }) : null, s = Ae(), r = () => {
1237
1320
  s.setTheme(s.theme === "dark" ? "light" : "dark");
1238
1321
  };
1239
- return /* @__PURE__ */ a($e, { className: "astw:flex astw:flex-col", children: /* @__PURE__ */ l("div", { className: "astw:flex astw:flex-1", children: [
1240
- t.sidebar ?? /* @__PURE__ */ a(ta, {}),
1241
- /* @__PURE__ */ l(je, { className: "astw:w-[calc(100%-var(--sidebar-width))]", children: [
1322
+ return /* @__PURE__ */ a(Ue, { className: "astw:flex astw:flex-col", children: /* @__PURE__ */ l("div", { className: "astw:flex astw:flex-1", children: [
1323
+ t.sidebar ?? /* @__PURE__ */ a(oa, {}),
1324
+ /* @__PURE__ */ l(qe, { className: "astw:w-[calc(100%-var(--sidebar-width))]", children: [
1242
1325
  /* @__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
1326
  /* @__PURE__ */ l("div", { className: "astw:flex astw:items-center astw:gap-2", children: [
1244
- /* @__PURE__ */ a(Je, {}),
1245
- /* @__PURE__ */ a(na, {})
1327
+ /* @__PURE__ */ a(na, {}),
1328
+ /* @__PURE__ */ a(wa, {})
1246
1329
  ] }),
1247
- /* @__PURE__ */ a("div", { className: "astw:flex astw:items-center astw:gap-2", children: /* @__PURE__ */ a(D, { variant: "outline", size: "icon", onClick: r, children: /* @__PURE__ */ a(Jt, {}) }) })
1330
+ /* @__PURE__ */ a("div", { className: "astw:flex astw:items-center astw:gap-2", children: /* @__PURE__ */ a(I, { variant: "outline", size: "icon", onClick: r, children: /* @__PURE__ */ a(ue, {}) }) })
1248
1331
  ] }) }),
1249
- /* @__PURE__ */ a("div", { className: "astw:flex astw:flex-col astw:gap-4", children: e ?? /* @__PURE__ */ a(rt, {}) })
1332
+ /* @__PURE__ */ a("div", { className: "astw:flex astw:flex-col astw:gap-4", children: e ?? /* @__PURE__ */ a(ct, {}) })
1250
1333
  ] })
1251
1334
  ] }) });
1252
- }, ta = (t) => {
1253
- const { title: e, icon: s } = T(), { pathname: r } = gt(), n = /* @__PURE__ */ l(Ke, { children: [
1335
+ }, oa = (t) => {
1336
+ const { title: e, icon: s } = k(), { pathname: r } = Rt(), { isIconMode: n } = _(), o = /* @__PURE__ */ l(Ge, { children: [
1254
1337
  s,
1255
- /* @__PURE__ */ a("h1", { className: "astw:text-sm astw:mb-2 astw:mt-2 astw:px-2", children: e })
1338
+ /* @__PURE__ */ a(
1339
+ "h1",
1340
+ {
1341
+ className: m(
1342
+ "astw:text-sm astw:mb-2 astw:mt-2 astw:px-2",
1343
+ n && "astw:hidden"
1344
+ ),
1345
+ children: e
1346
+ }
1347
+ )
1256
1348
  ] });
1257
- return /* @__PURE__ */ l(We, { 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(Lt, { className: "astw:-ml-1" }) })
1349
+ return /* @__PURE__ */ l(Qe, { variant: "inset", collapsible: n ? "icon" : "offcanvas", children: [
1350
+ !n && /* @__PURE__ */ l("div", { className: "astw:flex astw:justify-between astw:items-center", children: [
1351
+ t.header ?? o,
1352
+ /* @__PURE__ */ a("div", { className: "astw:hidden astw:md:block", children: /* @__PURE__ */ a(jt, { className: "astw:-ml-1" }) })
1261
1353
  ] }),
1262
- /* @__PURE__ */ a(Ue, { children: /* @__PURE__ */ a(ht, { fallback: /* @__PURE__ */ a(sa, {}), children: /* @__PURE__ */ a(ea, { currentPath: r }) }) }),
1354
+ /* @__PURE__ */ a(Ye, { children: /* @__PURE__ */ a(Tt, { fallback: /* @__PURE__ */ a(da, {}), children: /* @__PURE__ */ a(ia, { currentPath: r }) }) }),
1263
1355
  t.footer ?? null
1264
1356
  ] });
1265
- }, ea = ({ currentPath: t }) => {
1266
- const e = kt();
1267
- return /* @__PURE__ */ a(pt, { resolve: e, children: (s) => /* @__PURE__ */ a(aa, { items: s ?? [], currentPath: t }) });
1268
- }, aa = (t) => {
1357
+ }, ia = ({ currentPath: t }) => {
1358
+ const e = _t();
1359
+ return /* @__PURE__ */ a(Et, { resolve: e, children: (s) => /* @__PURE__ */ a(la, { items: s ?? [], currentPath: t }) });
1360
+ }, la = (t) => {
1269
1361
  const e = B();
1270
- return /* @__PURE__ */ a(Dt, { children: /* @__PURE__ */ a(Pt, { children: t.items.map((s) => /* @__PURE__ */ a(Ce, { asChild: !0, defaultOpen: !0, children: /* @__PURE__ */ l(Mt, { children: [
1271
- s.url ? /* @__PURE__ */ l(E, { children: [
1272
- /* @__PURE__ */ a(ot, { asChild: !0, tooltip: s.title, children: /* @__PURE__ */ l(
1273
- j,
1362
+ return /* @__PURE__ */ a(Kt, { children: /* @__PURE__ */ a(Vt, { children: t.items.map((s) => /* @__PURE__ */ a(ze, { asChild: !0, defaultOpen: !0, children: /* @__PURE__ */ l(Ht, { children: [
1363
+ s.url ? /* @__PURE__ */ l(L, { children: [
1364
+ /* @__PURE__ */ a(gt, { asChild: !0, tooltip: s.title, children: /* @__PURE__ */ l(
1365
+ Q,
1274
1366
  {
1275
1367
  to: s.url,
1276
1368
  className: s.url === t.currentPath ? "astw:bg-sidebar-accent astw:font-medium" : void 0,
@@ -1280,29 +1372,29 @@ const Je = () => {
1280
1372
  ]
1281
1373
  }
1282
1374
  ) }),
1283
- !!s.items?.length && /* @__PURE__ */ a(nt, { asChild: !0, children: /* @__PURE__ */ l(it, { className: "astw:data-[state=open]:rotate-90", children: [
1284
- /* @__PURE__ */ a($, {}),
1375
+ !!s.items?.length && /* @__PURE__ */ a(wt, { asChild: !0, children: /* @__PURE__ */ l(bt, { className: "astw:data-[state=open]:rotate-90", children: [
1376
+ /* @__PURE__ */ a(H, {}),
1285
1377
  /* @__PURE__ */ a("span", { className: "astw:sr-only", children: e("toggle") })
1286
1378
  ] }) })
1287
- ] }) : /* @__PURE__ */ a(E, { children: /* @__PURE__ */ l(nt, { className: "astw:flex astw:w-[100%] astw:[&[data-state=open]_.astw-rotate-target]:rotate-90", children: [
1288
- /* @__PURE__ */ a(ot, { asChild: !0, tooltip: s.title, children: /* @__PURE__ */ l("span", { className: "astw:flex astw:w-[100%]", children: [
1379
+ ] }) : /* @__PURE__ */ a(L, { children: /* @__PURE__ */ l(wt, { className: "astw:flex astw:w-[100%] astw:[&[data-state=open]_.astw-rotate-target]:rotate-90", children: [
1380
+ /* @__PURE__ */ a(gt, { asChild: !0, tooltip: s.title, children: /* @__PURE__ */ l("span", { className: "astw:flex astw:w-[100%]", children: [
1289
1381
  s.icon,
1290
1382
  /* @__PURE__ */ a("span", { children: s.title })
1291
1383
  ] }) }),
1292
1384
  !!s.items?.length && /* @__PURE__ */ a(
1293
- it,
1385
+ bt,
1294
1386
  {
1295
1387
  className: "astw-rotate-target",
1296
1388
  asChild: !0,
1297
1389
  children: /* @__PURE__ */ l("span", { children: [
1298
- /* @__PURE__ */ a($, {}),
1390
+ /* @__PURE__ */ a(H, {}),
1299
1391
  /* @__PURE__ */ a("span", { className: "astw:sr-only", children: e("toggle") })
1300
1392
  ] })
1301
1393
  }
1302
1394
  )
1303
1395
  ] }) }),
1304
- !!s.items?.length && /* @__PURE__ */ a(Se, { children: /* @__PURE__ */ a(Ve, { children: s.items?.map((r) => /* @__PURE__ */ a(Qe, { children: /* @__PURE__ */ a(qe, { asChild: !0, children: /* @__PURE__ */ a(
1305
- j,
1396
+ !!s.items?.length && /* @__PURE__ */ a(_e, { children: /* @__PURE__ */ a(Ze, { children: s.items?.map((r) => /* @__PURE__ */ a(Je, { children: /* @__PURE__ */ a(ta, { asChild: !0, children: /* @__PURE__ */ a(
1397
+ Q,
1306
1398
  {
1307
1399
  to: r.url,
1308
1400
  className: r.url === t.currentPath ? "astw:bg-sidebar-accent astw:font-medium" : void 0,
@@ -1310,9 +1402,9 @@ const Je = () => {
1310
1402
  }
1311
1403
  ) }) }, r.title)) }) })
1312
1404
  ] }) }, s.title)) }) });
1313
- }, sa = () => {
1405
+ }, da = () => {
1314
1406
  const e = [...[112, 96, 80, 104, 88, 100, 92, 84]].sort(() => Math.random() - 0.5);
1315
- return /* @__PURE__ */ a(Dt, { children: /* @__PURE__ */ a(Pt, { className: "astw:px-2", children: e.map((s, r) => /* @__PURE__ */ a(Mt, { children: /* @__PURE__ */ l("div", { className: "astw:flex astw:items-center astw:gap-2 astw:py-1.5", children: [
1407
+ return /* @__PURE__ */ a(Kt, { children: /* @__PURE__ */ a(Vt, { className: "astw:px-2", children: e.map((s, r) => /* @__PURE__ */ a(Ht, { children: /* @__PURE__ */ l("div", { className: "astw:flex astw:items-center astw:gap-2 astw:py-1.5", children: [
1316
1408
  /* @__PURE__ */ a("div", { className: "astw:h-4 astw:w-4 astw:rounded-md astw:bg-muted" }),
1317
1409
  /* @__PURE__ */ a(
1318
1410
  "div",
@@ -1322,47 +1414,47 @@ const Je = () => {
1322
1414
  }
1323
1415
  )
1324
1416
  ] }) }, r)) }) });
1325
- }, ra = () => {
1326
- const { configurations: t } = T(), e = gt();
1327
- return Ze(
1417
+ }, ca = () => {
1418
+ const { configurations: t } = k(), e = Rt();
1419
+ return ra(
1328
1420
  e.pathname,
1329
1421
  t.basePath,
1330
1422
  t.modules,
1331
1423
  t.locale
1332
1424
  );
1333
- }, na = () => {
1334
- const { segments: t } = ra(), e = Qt("/:prefix/settings/:suffix"), s = B();
1335
- return e ? /* @__PURE__ */ a(lt, { children: /* @__PURE__ */ a(dt, { children: /* @__PURE__ */ a("div", { className: "astw:inline-flex astw:items-center astw:gap-3 astw:last:text-foreground", children: /* @__PURE__ */ a(ct, { children: /* @__PURE__ */ a(wt, { to: `/${e.params.prefix}/settings`, children: s("settings") }) }) }) }) }) : /* @__PURE__ */ a(lt, { children: /* @__PURE__ */ a(dt, { children: t.map((r, n) => /* @__PURE__ */ l(
1425
+ }, wa = () => {
1426
+ const { segments: t } = ca(), e = oe("/:prefix/settings/:suffix"), s = B();
1427
+ return e ? /* @__PURE__ */ a(xt, { children: /* @__PURE__ */ a(vt, { children: /* @__PURE__ */ a("div", { className: "astw:inline-flex astw:items-center astw:gap-3 astw:last:text-foreground", children: /* @__PURE__ */ a(yt, { children: /* @__PURE__ */ a(Nt, { to: `/${e.params.prefix}/settings`, children: s("settings") }) }) }) }) }) : /* @__PURE__ */ a(xt, { children: /* @__PURE__ */ a(vt, { children: t.map((r, n) => /* @__PURE__ */ l(
1336
1428
  "div",
1337
1429
  {
1338
1430
  className: "astw:inline-flex astw:items-center astw:gap-3 astw:last:text-foreground",
1339
1431
  children: [
1340
- /* @__PURE__ */ a(ct, { children: /* @__PURE__ */ a(wt, { to: r.path, children: r.title }) }),
1341
- n < t.length - 1 && /* @__PURE__ */ a(Ge, {})
1432
+ /* @__PURE__ */ a(yt, { children: /* @__PURE__ */ a(Nt, { to: r.path, children: r.title }) }),
1433
+ n < t.length - 1 && /* @__PURE__ */ a(ea, {})
1342
1434
  ]
1343
1435
  },
1344
1436
  n
1345
1437
  )) }) });
1346
1438
  };
1347
- function oa({
1439
+ function ua({
1348
1440
  ...t
1349
1441
  }) {
1350
- return /* @__PURE__ */ a(v.Root, { "data-slot": "dialog", ...t });
1442
+ return /* @__PURE__ */ a(b.Root, { "data-slot": "dialog", ...t });
1351
1443
  }
1352
- function ia({
1444
+ function ma({
1353
1445
  ...t
1354
1446
  }) {
1355
- return /* @__PURE__ */ a(v.Portal, { "data-slot": "dialog-portal", ...t });
1447
+ return /* @__PURE__ */ a(b.Portal, { "data-slot": "dialog-portal", ...t });
1356
1448
  }
1357
- function la({
1449
+ function ha({
1358
1450
  className: t,
1359
1451
  ...e
1360
1452
  }) {
1361
1453
  return /* @__PURE__ */ a(
1362
- v.Overlay,
1454
+ b.Overlay,
1363
1455
  {
1364
1456
  "data-slot": "dialog-overlay",
1365
- className: u(
1457
+ className: m(
1366
1458
  "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",
1367
1459
  t
1368
1460
  ),
@@ -1370,26 +1462,26 @@ function la({
1370
1462
  }
1371
1463
  );
1372
1464
  }
1373
- function da({
1465
+ function fa({
1374
1466
  className: t,
1375
1467
  children: e,
1376
1468
  ...s
1377
1469
  }) {
1378
- return /* @__PURE__ */ l(ia, { "data-slot": "dialog-portal", children: [
1379
- /* @__PURE__ */ a(la, {}),
1470
+ return /* @__PURE__ */ l(ma, { "data-slot": "dialog-portal", children: [
1471
+ /* @__PURE__ */ a(ha, {}),
1380
1472
  /* @__PURE__ */ l(
1381
- v.Content,
1473
+ b.Content,
1382
1474
  {
1383
1475
  "data-slot": "dialog-content",
1384
- className: u(
1476
+ className: m(
1385
1477
  "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",
1386
1478
  t
1387
1479
  ),
1388
1480
  ...s,
1389
1481
  children: [
1390
1482
  e,
1391
- /* @__PURE__ */ l(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: [
1392
- /* @__PURE__ */ a(bt, {}),
1483
+ /* @__PURE__ */ l(b.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: [
1484
+ /* @__PURE__ */ a(Lt, {}),
1393
1485
  /* @__PURE__ */ a("span", { className: "astw:sr-only", children: "Close" })
1394
1486
  ] })
1395
1487
  ]
@@ -1397,29 +1489,29 @@ function da({
1397
1489
  )
1398
1490
  ] });
1399
1491
  }
1400
- function ca({
1492
+ function pa({
1401
1493
  className: t,
1402
1494
  ...e
1403
1495
  }) {
1404
1496
  return /* @__PURE__ */ a(
1405
- v.Title,
1497
+ b.Title,
1406
1498
  {
1407
1499
  "data-slot": "dialog-title",
1408
- className: u("astw:text-lg astw:leading-none astw:font-semibold", t),
1500
+ className: m("astw:text-lg astw:leading-none astw:font-semibold", t),
1409
1501
  ...e
1410
1502
  }
1411
1503
  );
1412
1504
  }
1413
- function wa(t) {
1505
+ function ga(t) {
1414
1506
  const e = [], s = (r, n, o) => {
1415
1507
  r.forEach((i) => {
1416
- const d = [...o, i.title];
1508
+ const c = [...o, i.title];
1417
1509
  e.push({
1418
1510
  path: i.url,
1419
1511
  title: i.title,
1420
1512
  icon: n,
1421
- breadcrumb: d
1422
- }), i.items && i.items.length > 0 && s(i.items, n, d);
1513
+ breadcrumb: c
1514
+ }), i.items && i.items.length > 0 && s(i.items, n, c);
1423
1515
  });
1424
1516
  };
1425
1517
  return t.forEach((r) => {
@@ -1431,87 +1523,87 @@ function wa(t) {
1431
1523
  }), s(r.items, r.icon, [r.title]);
1432
1524
  }), e;
1433
1525
  }
1434
- function ua({
1526
+ function ba({
1435
1527
  routes: t
1436
1528
  }) {
1437
- const e = qt(), s = _t(null), [r, n] = k(!1), [o, i] = k(""), [d, w] = k(0), c = _(
1438
- () => Ye(t, o),
1529
+ const e = ie(), s = Gt(null), [r, n] = R(!1), [o, i] = R(""), [c, u] = R(0), w = $(
1530
+ () => aa(t, o),
1439
1531
  [t, o]
1440
1532
  );
1441
- C(() => {
1442
- const f = (h) => {
1443
- (h.metaKey || h.ctrlKey) && h.key === "k" && (h.preventDefault(), n((y) => !y));
1533
+ y(() => {
1534
+ const f = (p) => {
1535
+ (p.metaKey || p.ctrlKey) && p.key === "k" && (p.preventDefault(), n((P) => !P));
1444
1536
  };
1445
1537
  return document.addEventListener("keydown", f), () => document.removeEventListener("keydown", f);
1446
- }, []), C(() => {
1447
- w(0);
1448
- }, [c]), C(() => {
1449
- r || (i(""), w(0));
1450
- }, [r]), C(() => {
1451
- s.current && s.current.querySelector(`[data-index="${d}"]`)?.scrollIntoView({ block: "nearest" });
1452
- }, [d]);
1453
- const m = at(
1538
+ }, []), y(() => {
1539
+ u(0);
1540
+ }, [w]), y(() => {
1541
+ r || (i(""), u(0));
1542
+ }, [r]), y(() => {
1543
+ s.current && s.current.querySelector(`[data-index="${c}"]`)?.scrollIntoView({ block: "nearest" });
1544
+ }, [c]);
1545
+ const d = lt(
1454
1546
  (f) => {
1455
1547
  e(f.path), n(!1), i("");
1456
1548
  },
1457
1549
  [e]
1458
- ), g = at(
1550
+ ), h = lt(
1459
1551
  (f) => {
1460
1552
  if (!f.nativeEvent.isComposing)
1461
1553
  switch (f.key) {
1462
1554
  case "ArrowDown":
1463
- f.preventDefault(), w(
1464
- (h) => h < c.length - 1 ? h + 1 : h
1555
+ f.preventDefault(), u(
1556
+ (p) => p < w.length - 1 ? p + 1 : p
1465
1557
  );
1466
1558
  break;
1467
1559
  case "ArrowUp":
1468
- f.preventDefault(), w((h) => h > 0 ? h - 1 : h);
1560
+ f.preventDefault(), u((p) => p > 0 ? p - 1 : p);
1469
1561
  break;
1470
1562
  case "Enter":
1471
- f.preventDefault(), c[d] && m(c[d]);
1563
+ f.preventDefault(), w[c] && d(w[c]);
1472
1564
  break;
1473
1565
  }
1474
1566
  },
1475
- [c, d, m]
1567
+ [w, c, d]
1476
1568
  );
1477
1569
  return {
1478
1570
  open: r,
1479
1571
  setOpen: n,
1480
1572
  search: o,
1481
1573
  setSearch: i,
1482
- selectedIndex: d,
1483
- filteredRoutes: c,
1484
- handleSelect: m,
1485
- handleKeyDown: g,
1574
+ selectedIndex: c,
1575
+ filteredRoutes: w,
1576
+ handleSelect: d,
1577
+ handleKeyDown: h,
1486
1578
  listRef: s
1487
1579
  };
1488
1580
  }
1489
- function ma({
1581
+ function xa({
1490
1582
  navItems: t
1491
1583
  }) {
1492
- const e = B(), s = _(() => wa(t), [t]), {
1584
+ const e = B(), s = $(() => ga(t), [t]), {
1493
1585
  open: r,
1494
1586
  setOpen: n,
1495
1587
  search: o,
1496
1588
  setSearch: i,
1497
- selectedIndex: d,
1498
- filteredRoutes: w,
1499
- handleSelect: c,
1500
- handleKeyDown: m,
1501
- listRef: g
1502
- } = ua({ routes: s });
1503
- return /* @__PURE__ */ a(oa, { open: r, onOpenChange: n, children: /* @__PURE__ */ l(
1504
- da,
1589
+ selectedIndex: c,
1590
+ filteredRoutes: u,
1591
+ handleSelect: w,
1592
+ handleKeyDown: d,
1593
+ listRef: h
1594
+ } = ba({ routes: s });
1595
+ return /* @__PURE__ */ a(ua, { open: r, onOpenChange: n, children: /* @__PURE__ */ l(
1596
+ fa,
1505
1597
  {
1506
1598
  className: "astw:p-0 astw:gap-0 astw:sm:max-w-2xl astw:overflow-hidden",
1507
- onKeyDown: m,
1599
+ onKeyDown: d,
1508
1600
  "aria-describedby": void 0,
1509
1601
  children: [
1510
- /* @__PURE__ */ a(ca, { className: "astw:sr-only", children: e("commandPaletteSearch") }),
1602
+ /* @__PURE__ */ a(pa, { className: "astw:sr-only", children: e("commandPaletteSearch") }),
1511
1603
  /* @__PURE__ */ l("div", { className: "astw:flex astw:items-center astw:border-b astw:px-3 astw:py-1", children: [
1512
- /* @__PURE__ */ a(te, { className: "astw:mr-2 astw:h-4 astw:w-4 astw:shrink-0 astw:opacity-50" }),
1604
+ /* @__PURE__ */ a(me, { className: "astw:mr-2 astw:h-4 astw:w-4 astw:shrink-0 astw:opacity-50" }),
1513
1605
  /* @__PURE__ */ a(
1514
- ke,
1606
+ $e,
1515
1607
  {
1516
1608
  value: o,
1517
1609
  onChange: (f) => i(f.target.value),
@@ -1524,16 +1616,16 @@ function ma({
1524
1616
  /* @__PURE__ */ a(
1525
1617
  "div",
1526
1618
  {
1527
- ref: g,
1619
+ ref: h,
1528
1620
  className: "astw:max-h-[300px] astw:overflow-y-auto astw:overflow-x-hidden",
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((f, h) => /* @__PURE__ */ l(
1621
+ children: u.length === 0 ? /* @__PURE__ */ a("div", { className: "astw:py-6 astw:text-center astw:text-sm astw:text-muted-foreground", children: e("commandPaletteNoResults") }) : /* @__PURE__ */ a("div", { className: "astw:p-1", children: u.map((f, p) => /* @__PURE__ */ l(
1530
1622
  "button",
1531
1623
  {
1532
- "data-index": h,
1533
- onClick: () => c(f),
1534
- className: u(
1624
+ "data-index": p,
1625
+ onClick: () => w(f),
1626
+ className: m(
1535
1627
  "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
- h === d ? "astw:bg-accent astw:text-accent-foreground" : "astw:hover:bg-accent astw:hover:text-accent-foreground"
1628
+ p === c ? "astw:bg-accent astw:text-accent-foreground" : "astw:hover:bg-accent astw:hover:text-accent-foreground"
1537
1629
  ),
1538
1630
  children: [
1539
1631
  /* @__PURE__ */ a("span", { className: "astw:truncate astw:w-full astw:text-left", children: f.breadcrumb.join(" > ") }),
@@ -1551,25 +1643,25 @@ function ma({
1551
1643
  }
1552
1644
  ) });
1553
1645
  }
1554
- function Ja() {
1555
- const t = kt();
1556
- return /* @__PURE__ */ a(ht, { fallback: null, children: /* @__PURE__ */ a(pt, { resolve: t, children: (e) => /* @__PURE__ */ a(ma, { navItems: e ?? [] }) }) });
1646
+ function os() {
1647
+ const t = _t();
1648
+ return /* @__PURE__ */ a(Tt, { fallback: null, children: /* @__PURE__ */ a(Et, { resolve: t, children: (e) => /* @__PURE__ */ a(xa, { navItems: e ?? [] }) }) });
1557
1649
  }
1558
- const At = K(null), ts = (t) => {
1559
- const e = _(
1560
- () => oe({
1650
+ const Ut = q(null), is = (t) => {
1651
+ const e = $(
1652
+ () => xe({
1561
1653
  clientId: t.clientId,
1562
1654
  appUri: t.apiEndpoint,
1563
1655
  redirectUri: t.redirectUri,
1564
- meQuery: t.meQuery && (typeof t.meQuery == "string" ? t.meQuery : ne(t.meQuery))
1656
+ meQuery: t.meQuery && (typeof t.meQuery == "string" ? t.meQuery : be(t.meQuery))
1565
1657
  }),
1566
1658
  [t.clientId, t.apiEndpoint, t.redirectUri, t.meQuery]
1567
- ), [s, r] = k(
1659
+ ), [s, r] = R(
1568
1660
  () => e.getState()
1569
1661
  );
1570
- C(() => {
1662
+ y(() => {
1571
1663
  t.autoLogin && (s.isLoading || s.isAuthenticated || (async () => await e.login())());
1572
- }, [s.isLoading, s.isAuthenticated, t.autoLogin]), C(
1664
+ }, [s.isLoading, s.isAuthenticated, t.autoLogin]), y(
1573
1665
  () => e.addEventListener((o) => {
1574
1666
  o.type === "auth_state_changed" && r(o.data);
1575
1667
  }),
@@ -1577,7 +1669,7 @@ const At = K(null), ts = (t) => {
1577
1669
  );
1578
1670
  const n = t.guardComponent && (s.isLoading || !s.isAuthenticated) ? /* @__PURE__ */ a(t.guardComponent, {}) : t.children;
1579
1671
  return /* @__PURE__ */ a(
1580
- At.Provider,
1672
+ Ut.Provider,
1581
1673
  {
1582
1674
  value: {
1583
1675
  authState: s,
@@ -1589,12 +1681,12 @@ const At = K(null), ts = (t) => {
1589
1681
  children: n
1590
1682
  }
1591
1683
  );
1592
- }, es = () => {
1593
- const t = U(At);
1684
+ }, ls = () => {
1685
+ const t = G(Ut);
1594
1686
  if (!t)
1595
1687
  throw new Error("useAuth must be used within an AuthProvider");
1596
1688
  return t;
1597
- }, ha = V(
1689
+ }, va = X(
1598
1690
  "astw:inline-flex astw:items-center astw:rounded-md astw:border astw:px-2 astw:py-0.5 astw:text-xs astw:font-medium astw:transition-colors astw:focus:outline-none astw:focus:ring-2 astw:focus:ring-ring astw:focus:ring-offset-2",
1599
1691
  {
1600
1692
  variants: {
@@ -1616,51 +1708,51 @@ const At = K(null), ts = (t) => {
1616
1708
  variant: "default"
1617
1709
  }
1618
1710
  }
1619
- ), fa = {
1711
+ ), ya = {
1620
1712
  "outline-success": "astw:bg-green-500",
1621
1713
  "outline-warning": "astw:bg-orange-500",
1622
1714
  "outline-error": "astw:bg-red-500",
1623
1715
  "outline-info": "astw:bg-blue-500",
1624
1716
  "outline-neutral": "astw:bg-neutral-400"
1625
1717
  };
1626
- function ga({ variant: t }) {
1627
- const e = fa[t];
1628
- return e ? /* @__PURE__ */ a("div", { className: "astw:size-3 astw:shrink-0 astw:flex astw:items-center astw:justify-center", children: /* @__PURE__ */ a("div", { className: u("astw:size-[7px] astw:rounded-full", e) }) }) : null;
1718
+ function Na({ variant: t }) {
1719
+ const e = ya[t];
1720
+ return e ? /* @__PURE__ */ a("div", { className: "astw:size-3 astw:shrink-0 astw:flex astw:items-center astw:justify-center", children: /* @__PURE__ */ a("div", { className: m("astw:size-[7px] astw:rounded-full", e) }) }) : null;
1629
1721
  }
1630
- function pa({ className: t, variant: e, children: s, ...r }) {
1722
+ function Ca({ className: t, variant: e, children: s, ...r }) {
1631
1723
  const n = e?.toString().startsWith("outline-");
1632
1724
  return /* @__PURE__ */ l(
1633
1725
  "div",
1634
1726
  {
1635
- className: u(ha({ variant: e }), t),
1727
+ className: m(va({ variant: e }), t),
1636
1728
  ...r,
1637
1729
  children: [
1638
- n && /* @__PURE__ */ a(ga, { variant: e }),
1730
+ n && /* @__PURE__ */ a(Na, { variant: e }),
1639
1731
  s
1640
1732
  ]
1641
1733
  }
1642
1734
  );
1643
1735
  }
1644
- function ba(t) {
1736
+ function Sa(t) {
1645
1737
  return t.type === "divider";
1646
1738
  }
1647
- function va(t) {
1739
+ function Ta(t) {
1648
1740
  return t.type !== "divider" && "key" in t;
1649
1741
  }
1650
- function F(t, e) {
1742
+ function W(t, e) {
1651
1743
  return e.split(".").reduce((s, r) => {
1652
1744
  if (s && typeof s == "object" && r in s)
1653
1745
  return s[r];
1654
1746
  }, t);
1655
1747
  }
1656
- function x(t) {
1748
+ function v(t) {
1657
1749
  return t == null || t === "";
1658
1750
  }
1659
- function xa(t) {
1751
+ function ka(t) {
1660
1752
  return t.toLowerCase().replace(/_/g, " ").replace(/^\w/, (e) => e.toUpperCase());
1661
1753
  }
1662
- function ya(t, e = "medium") {
1663
- if (x(t)) return "";
1754
+ function Ra(t, e = "medium") {
1755
+ if (v(t)) return "";
1664
1756
  const s = t instanceof Date ? t : new Date(String(t));
1665
1757
  if (isNaN(s.getTime())) return String(t);
1666
1758
  switch (e) {
@@ -1691,8 +1783,8 @@ function ya(t, e = "medium") {
1691
1783
  return s.toLocaleDateString();
1692
1784
  }
1693
1785
  }
1694
- function Na(t, e) {
1695
- if (x(t)) return "";
1786
+ function Ea(t, e) {
1787
+ if (v(t)) return "";
1696
1788
  const s = typeof t == "number" ? t : parseFloat(String(t));
1697
1789
  if (isNaN(s)) return String(t);
1698
1790
  try {
@@ -1704,8 +1796,8 @@ function Na(t, e) {
1704
1796
  return `${e || "$"}${s.toFixed(2)}`;
1705
1797
  }
1706
1798
  }
1707
- function Ca(t) {
1708
- if (x(t)) return [];
1799
+ function La(t) {
1800
+ if (v(t)) return [];
1709
1801
  if (typeof t == "string")
1710
1802
  return t.split(/[,\n]/).map((e) => e.trim()).filter(Boolean);
1711
1803
  if (typeof t == "object" && t !== null) {
@@ -1720,10 +1812,10 @@ function Ca(t) {
1720
1812
  }
1721
1813
  return [String(t)];
1722
1814
  }
1723
- function It({ value: t }) {
1724
- const [e, s] = p.useState(!1);
1725
- return /* @__PURE__ */ l(Z, { children: [
1726
- /* @__PURE__ */ a(J, { asChild: !0, children: /* @__PURE__ */ a(
1815
+ function Qt({ value: t }) {
1816
+ const [e, s] = g.useState(!1);
1817
+ return /* @__PURE__ */ l(st, { children: [
1818
+ /* @__PURE__ */ a(rt, { asChild: !0, children: /* @__PURE__ */ a(
1727
1819
  "button",
1728
1820
  {
1729
1821
  onClick: async (n) => {
@@ -1734,74 +1826,74 @@ function It({ value: t }) {
1734
1826
  }
1735
1827
  },
1736
1828
  className: "astw:ml-0.5 astw:inline-flex astw:items-center astw:justify-center astw:p-1 astw:rounded astw:hover:bg-muted astw:transition-colors astw:text-muted-foreground astw:hover:text-foreground",
1737
- children: e ? /* @__PURE__ */ a(ae, { className: "astw:h-3 astw:w-3", strokeWidth: 2.5 }) : /* @__PURE__ */ a(se, { className: "astw:h-3 astw:w-3", strokeWidth: 2.5 })
1829
+ children: e ? /* @__PURE__ */ a(fe, { className: "astw:h-3 astw:w-3", strokeWidth: 2.5 }) : /* @__PURE__ */ a(pe, { className: "astw:h-3 astw:w-3", strokeWidth: 2.5 })
1738
1830
  }
1739
1831
  ) }),
1740
- /* @__PURE__ */ a(tt, { side: "top", children: e ? "Copied!" : "Copy" })
1832
+ /* @__PURE__ */ a(nt, { side: "top", children: e ? "Copied!" : "Copy" })
1741
1833
  ] });
1742
1834
  }
1743
- const S = "–";
1744
- function Sa({ field: t }) {
1745
- const e = x(t.value) ? S : String(t.value), s = t.meta?.copyable && !x(t.value), r = t.meta?.truncateLines, n = p.useRef(null), [o, i] = p.useState(!1);
1746
- p.useEffect(() => {
1835
+ const N = "–";
1836
+ function Ba({ field: t }) {
1837
+ const e = v(t.value) ? N : String(t.value), s = t.meta?.copyable && !v(t.value), r = t.meta?.truncateLines, n = g.useRef(null), [o, i] = g.useState(!1);
1838
+ g.useEffect(() => {
1747
1839
  if (!r) {
1748
1840
  i(!1);
1749
1841
  return;
1750
1842
  }
1751
- const c = () => {
1843
+ const w = () => {
1752
1844
  if (n.current) {
1753
- const g = n.current;
1754
- i(g.scrollHeight > g.clientHeight + 1);
1845
+ const h = n.current;
1846
+ i(h.scrollHeight > h.clientHeight + 1);
1755
1847
  }
1756
- }, m = setTimeout(c, 50);
1757
- return window.addEventListener("resize", c), () => {
1758
- clearTimeout(m), window.removeEventListener("resize", c);
1848
+ }, d = setTimeout(w, 50);
1849
+ return window.addEventListener("resize", w), () => {
1850
+ clearTimeout(d), window.removeEventListener("resize", w);
1759
1851
  };
1760
1852
  }, [e, r]);
1761
- const d = r && r > 0 ? {
1853
+ const c = r && r > 0 ? {
1762
1854
  display: "-webkit-box",
1763
1855
  WebkitLineClamp: r,
1764
1856
  WebkitBoxOrient: "vertical",
1765
1857
  overflow: "hidden"
1766
- } : void 0, w = /* @__PURE__ */ l("div", { className: "astw:flex astw:items-start astw:gap-1 astw:min-w-0", children: [
1858
+ } : void 0, u = /* @__PURE__ */ l("div", { className: "astw:flex astw:items-start astw:gap-1 astw:min-w-0", children: [
1767
1859
  /* @__PURE__ */ a(
1768
1860
  "p",
1769
1861
  {
1770
1862
  ref: n,
1771
1863
  className: "astw:text-sm astw:font-medium astw:text-foreground astw:break-words astw:m-0",
1772
- style: d,
1864
+ style: c,
1773
1865
  children: e
1774
1866
  }
1775
1867
  ),
1776
- s && /* @__PURE__ */ a(It, { value: String(t.value) })
1868
+ s && /* @__PURE__ */ a(Qt, { value: String(t.value) })
1777
1869
  ] });
1778
- return r && o ? /* @__PURE__ */ l(Z, { children: [
1779
- /* @__PURE__ */ a(J, { asChild: !0, children: /* @__PURE__ */ a("span", { className: "astw:cursor-default", children: w }) }),
1780
- /* @__PURE__ */ a(tt, { side: "bottom", style: { maxWidth: 320 }, children: /* @__PURE__ */ a("p", { className: "astw:text-sm", children: e }) })
1781
- ] }) : w;
1782
- }
1783
- function Ta({ field: t }) {
1784
- if (x(t.value))
1785
- return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: S });
1870
+ return r && o ? /* @__PURE__ */ l(st, { children: [
1871
+ /* @__PURE__ */ a(rt, { asChild: !0, children: /* @__PURE__ */ a("span", { className: "astw:cursor-default", children: u }) }),
1872
+ /* @__PURE__ */ a(nt, { side: "bottom", style: { maxWidth: 320 }, children: /* @__PURE__ */ a("p", { className: "astw:text-sm", children: e }) })
1873
+ ] }) : u;
1874
+ }
1875
+ function Pa({ field: t }) {
1876
+ if (v(t.value))
1877
+ return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: N });
1786
1878
  const e = String(t.value), s = t.meta?.badgeVariantMap || {}, r = e.toLowerCase(), n = s[e] || s[r] || "outline-neutral";
1787
- return /* @__PURE__ */ a(pa, { variant: n, className: "astw:w-fit", children: xa(e) });
1879
+ return /* @__PURE__ */ a(Ca, { variant: n, className: "astw:w-fit", children: ka(e) });
1788
1880
  }
1789
- function ka({ field: t }) {
1790
- if (x(t.value))
1791
- return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: S });
1792
- const e = t.meta?.currencyKey || "currency", s = F(t.data, e), r = Na(t.value, s);
1881
+ function Da({ field: t }) {
1882
+ if (v(t.value))
1883
+ return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: N });
1884
+ const e = t.meta?.currencyKey || "currency", s = W(t.data, e), r = Ea(t.value, s);
1793
1885
  return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground astw:tabular-nums", children: r });
1794
1886
  }
1795
- function Ra({ field: t }) {
1796
- if (x(t.value))
1797
- return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: S });
1798
- const e = t.meta?.dateFormat || "medium", s = ya(t.value, e);
1887
+ function Ma({ field: t }) {
1888
+ if (v(t.value))
1889
+ return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: N });
1890
+ const e = t.meta?.dateFormat || "medium", s = Ra(t.value, e);
1799
1891
  return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: s });
1800
1892
  }
1801
- function Ba({ field: t }) {
1802
- if (x(t.value))
1803
- return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: S });
1804
- const e = t.meta?.hrefKey, s = e ? F(t.data, e) : void 0, r = t.meta?.external ?? !1, n = String(t.value);
1893
+ function Ia({ field: t }) {
1894
+ if (v(t.value))
1895
+ return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: N });
1896
+ const e = t.meta?.hrefKey, s = e ? W(t.data, e) : void 0, r = t.meta?.external ?? !1, n = String(t.value);
1805
1897
  return s ? /* @__PURE__ */ l(
1806
1898
  "a",
1807
1899
  {
@@ -1811,63 +1903,63 @@ function Ba({ field: t }) {
1811
1903
  className: "astw:inline-flex astw:items-center astw:gap-1 astw:text-sm astw:text-primary astw:hover:underline",
1812
1904
  children: [
1813
1905
  n,
1814
- r && /* @__PURE__ */ a(ee, { className: "astw:h-3 astw:w-3" })
1906
+ r && /* @__PURE__ */ a(he, { className: "astw:h-3 astw:w-3" })
1815
1907
  ]
1816
1908
  }
1817
1909
  ) : /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: n });
1818
1910
  }
1819
- function Ea({ field: t }) {
1820
- if (x(t.value))
1821
- return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: S });
1822
- const e = Ca(t.value), s = t.meta?.copyable && !x(t.value), r = e.join(`
1911
+ function Aa({ field: t }) {
1912
+ if (v(t.value))
1913
+ return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: N });
1914
+ const e = La(t.value), s = t.meta?.copyable && !v(t.value), r = e.join(`
1823
1915
  `);
1824
1916
  return /* @__PURE__ */ l("div", { className: "astw:flex astw:items-start astw:gap-1 astw:min-w-0", children: [
1825
- /* @__PURE__ */ a("address", { className: "astw:text-sm astw:font-medium astw:text-foreground astw:not-italic", children: e.map((n, o) => /* @__PURE__ */ l(p.Fragment, { children: [
1917
+ /* @__PURE__ */ a("address", { className: "astw:text-sm astw:font-medium astw:text-foreground astw:not-italic", children: e.map((n, o) => /* @__PURE__ */ l(g.Fragment, { children: [
1826
1918
  n,
1827
1919
  o < e.length - 1 && /* @__PURE__ */ a("br", {})
1828
1920
  ] }, o)) }),
1829
- s && /* @__PURE__ */ a(It, { value: r })
1921
+ s && /* @__PURE__ */ a(Qt, { value: r })
1830
1922
  ] });
1831
1923
  }
1832
- function La({ field: t }) {
1833
- if (x(t.value))
1834
- return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: S });
1835
- const e = t.meta?.referenceIdKey, s = t.meta?.referenceUrlPattern, r = e ? F(t.data, e) : void 0, n = String(t.value);
1924
+ function za({ field: t }) {
1925
+ if (v(t.value))
1926
+ return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: N });
1927
+ const e = t.meta?.referenceIdKey, s = t.meta?.referenceUrlPattern, r = e ? W(t.data, e) : void 0, n = String(t.value);
1836
1928
  if (!r || !s)
1837
1929
  return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: n });
1838
1930
  const o = s.replace("{id}", r);
1839
1931
  return /* @__PURE__ */ a("a", { href: o, className: "astw:text-sm astw:text-primary astw:hover:underline", children: n });
1840
1932
  }
1841
- function ut(t) {
1933
+ function Ct(t) {
1842
1934
  switch (t.type) {
1843
1935
  case "text":
1844
- return /* @__PURE__ */ a(Sa, { field: t });
1936
+ return /* @__PURE__ */ a(Ba, { field: t });
1845
1937
  case "badge":
1846
- return /* @__PURE__ */ a(Ta, { field: t });
1938
+ return /* @__PURE__ */ a(Pa, { field: t });
1847
1939
  case "money":
1848
- return /* @__PURE__ */ a(ka, { field: t });
1940
+ return /* @__PURE__ */ a(Da, { field: t });
1849
1941
  case "date":
1850
- return /* @__PURE__ */ a(Ra, { field: t });
1942
+ return /* @__PURE__ */ a(Ma, { field: t });
1851
1943
  case "link":
1852
- return /* @__PURE__ */ a(Ba, { field: t });
1944
+ return /* @__PURE__ */ a(Ia, { field: t });
1853
1945
  case "address":
1854
- return /* @__PURE__ */ a(Ea, { field: t });
1946
+ return /* @__PURE__ */ a(Aa, { field: t });
1855
1947
  case "reference":
1856
- return /* @__PURE__ */ a(La, { field: t });
1948
+ return /* @__PURE__ */ a(za, { field: t });
1857
1949
  default:
1858
- return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: S });
1950
+ return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: N });
1859
1951
  }
1860
1952
  }
1861
- function Da(t) {
1953
+ function _a(t) {
1862
1954
  if (t.emptyBehavior !== "hide") return !1;
1863
1955
  const e = t.value;
1864
1956
  return e == null || e === "";
1865
1957
  }
1866
- function Pa(t) {
1958
+ function Fa(t) {
1867
1959
  return !1;
1868
1960
  }
1869
- function Ma(t, e, s) {
1870
- const r = F(e, t.key);
1961
+ function Oa(t, e, s) {
1962
+ const r = W(e, t.key);
1871
1963
  return {
1872
1964
  id: `${t.key}-${s}`,
1873
1965
  label: t.label,
@@ -1878,23 +1970,23 @@ function Ma(t, e, s) {
1878
1970
  data: e
1879
1971
  };
1880
1972
  }
1881
- function Aa(t, e) {
1973
+ function $a(t, e) {
1882
1974
  const s = [];
1883
1975
  let r = [], n = 0, o = 0;
1884
1976
  for (const i of t)
1885
- if (ba(i))
1977
+ if (Sa(i))
1886
1978
  r.length > 0 && (s.push({ id: `section-${n}`, fields: r }), n++, r = []);
1887
- else if (va(i)) {
1888
- const d = Ma(i, e, o);
1889
- o++, Da(d) || r.push(d);
1979
+ else if (Ta(i)) {
1980
+ const c = Oa(i, e, o);
1981
+ o++, _a(c) || r.push(c);
1890
1982
  }
1891
1983
  return r.length > 0 && s.push({ id: `section-${n}`, fields: r }), s;
1892
1984
  }
1893
- function mt({ label: t, children: e, fullWidth: s }) {
1985
+ function St({ label: t, children: e, fullWidth: s }) {
1894
1986
  return /* @__PURE__ */ l(
1895
1987
  "div",
1896
1988
  {
1897
- className: u(
1989
+ className: m(
1898
1990
  "astw:flex astw:flex-col astw:gap-1 astw:min-w-0 astw:py-2",
1899
1991
  s && "astw:col-span-full"
1900
1992
  ),
@@ -1905,7 +1997,7 @@ function mt({ label: t, children: e, fullWidth: s }) {
1905
1997
  }
1906
1998
  );
1907
1999
  }
1908
- function as({
2000
+ function ds({
1909
2001
  data: t,
1910
2002
  title: e,
1911
2003
  fields: s,
@@ -1913,7 +2005,7 @@ function as({
1913
2005
  className: n,
1914
2006
  headerAction: o
1915
2007
  }) {
1916
- const i = Aa(s, t), d = i.some((m) => m.fields.length > 0), w = u(
2008
+ const i = $a(s, t), c = i.some((d) => d.fields.length > 0), u = m(
1917
2009
  "astw:grid astw:gap-x-6 astw:gap-y-4",
1918
2010
  // Default: 1 column
1919
2011
  "astw:grid-cols-1",
@@ -1925,17 +2017,17 @@ function as({
1925
2017
  // 3-column mode: 1 → 2 → 3 columns
1926
2018
  "astw:@[400px]:grid-cols-2 astw:@[600px]:grid-cols-3"
1927
2019
  )
1928
- ), c = (m) => {
1929
- const g = m.fields.filter((h) => !0), f = m.fields.filter((h) => Pa());
2020
+ ), w = (d) => {
2021
+ const h = d.fields.filter((p) => !0), f = d.fields.filter((p) => Fa());
1930
2022
  return /* @__PURE__ */ l("div", { className: "astw:space-y-4", children: [
1931
- g.length > 0 && /* @__PURE__ */ a("div", { className: w, children: g.map((h) => /* @__PURE__ */ a(mt, { label: h.label, children: ut(h) }, h.id)) }),
1932
- f.length > 0 && /* @__PURE__ */ a("div", { className: w, children: f.map((h) => /* @__PURE__ */ a(mt, { label: h.label, fullWidth: !0, children: ut(h) }, h.id)) })
1933
- ] }, m.id);
2023
+ h.length > 0 && /* @__PURE__ */ a("div", { className: u, children: h.map((p) => /* @__PURE__ */ a(St, { label: p.label, children: Ct(p) }, p.id)) }),
2024
+ f.length > 0 && /* @__PURE__ */ a("div", { className: u, children: f.map((p) => /* @__PURE__ */ a(St, { label: p.label, fullWidth: !0, children: Ct(p) }, p.id)) })
2025
+ ] }, d.id);
1934
2026
  };
1935
- return /* @__PURE__ */ a(X, { delayDuration: 300, children: /* @__PURE__ */ l(
2027
+ return /* @__PURE__ */ a(at, { delayDuration: 300, children: /* @__PURE__ */ l(
1936
2028
  "div",
1937
2029
  {
1938
- className: u(
2030
+ className: m(
1939
2031
  "astw:@container astw:bg-card astw:text-card-foreground astw:rounded-xl astw:border",
1940
2032
  n
1941
2033
  ),
@@ -1944,34 +2036,109 @@ function as({
1944
2036
  /* @__PURE__ */ a("h3", { className: "astw:text-lg astw:font-semibold astw:leading-none", children: e }),
1945
2037
  o && /* @__PURE__ */ a("div", { children: o })
1946
2038
  ] }),
1947
- /* @__PURE__ */ a("div", { className: "astw:px-6 astw:pb-4", children: d ? /* @__PURE__ */ a("div", { className: "astw:space-y-4", children: i.map((m, g) => /* @__PURE__ */ l(p.Fragment, { children: [
1948
- g > 0 && /* @__PURE__ */ a("div", { className: "astw:h-px astw:bg-border", role: "separator" }),
1949
- c(m)
1950
- ] }, m.id)) }) : /* @__PURE__ */ a("p", { className: "astw:text-sm astw:text-muted-foreground", children: "No information available" }) })
2039
+ /* @__PURE__ */ a("div", { className: "astw:px-6 astw:pb-4", children: c ? /* @__PURE__ */ a("div", { className: "astw:space-y-4", children: i.map((d, h) => /* @__PURE__ */ l(g.Fragment, { children: [
2040
+ h > 0 && /* @__PURE__ */ a("div", { className: "astw:h-px astw:bg-border", role: "separator" }),
2041
+ w(d)
2042
+ ] }, d.id)) }) : /* @__PURE__ */ a("p", { className: "astw:text-sm astw:text-muted-foreground", children: "No information available" }) })
1951
2043
  ]
1952
2044
  }
1953
2045
  ) });
1954
2046
  }
2047
+ const ot = g.forwardRef(
2048
+ ({ className: t, children: e, ...s }, r) => /* @__PURE__ */ a(
2049
+ "div",
2050
+ {
2051
+ ref: r,
2052
+ className: m("astw:min-w-0 astw:flex astw:flex-col astw:gap-4", t),
2053
+ ...s,
2054
+ children: e
2055
+ }
2056
+ )
2057
+ );
2058
+ ot.displayName = "Layout.Column";
2059
+ function Wa({
2060
+ columns: t,
2061
+ className: e,
2062
+ gap: s = 4,
2063
+ title: r,
2064
+ actions: n,
2065
+ children: o
2066
+ }) {
2067
+ if (process.env.NODE_ENV !== "production") {
2068
+ const h = g.Children.toArray(o).reduce((f, p) => g.isValidElement(p) && p.type === ot ? f + 1 : f, 0);
2069
+ if (h !== t)
2070
+ throw new Error(
2071
+ `Layout: Expected exactly ${t} Layout.Column child${t === 1 ? "" : "ren"}, but found ${h}. Please ensure the number of <Layout.Column> children matches the \`columns={${t}}\` prop.`
2072
+ );
2073
+ }
2074
+ const c = m(
2075
+ "astw:flex astw:w-full",
2076
+ s === 4 ? "astw:gap-4" : s === 6 ? "astw:gap-6" : s === 8 ? "astw:gap-8" : "astw:gap-4",
2077
+ // 1 column: Always stack vertically
2078
+ t === 1 && "astw:flex-col",
2079
+ // 2 columns: Stack on mobile, side-by-side on desktop (lg: ≥1024px)
2080
+ // Main column flexible, side column fixed 360px
2081
+ t === 2 && [
2082
+ "astw:flex-col",
2083
+ "astw:lg:flex-row"
2084
+ ],
2085
+ // 3 columns: Stack on mobile, 3 columns side-by-side on desktop (xl: ≥1280px)
2086
+ // Outer columns fixed 360px, middle column flexible
2087
+ t === 3 && [
2088
+ "astw:flex-col",
2089
+ "astw:xl:flex-row"
2090
+ ],
2091
+ e
2092
+ ), u = g.useMemo(() => t === 1 ? g.Children.map(o, (d) => d) : t === 2 ? g.Children.map(o, (d, h) => g.isValidElement(d) ? g.cloneElement(d, {
2093
+ className: m(
2094
+ d.props.className,
2095
+ h === 0 ? "astw:lg:flex-1" : "astw:lg:min-w-[280px]"
2096
+ // Second column: fixed 280px
2097
+ )
2098
+ }) : d) : t === 3 ? g.Children.map(o, (d, h) => g.isValidElement(d) ? g.cloneElement(d, {
2099
+ className: m(
2100
+ d.props.className,
2101
+ h === 0 ? "astw:xl:min-w-[320px]" : h === 2 ? "astw:xl:min-w-[280px]" : "astw:xl:flex-1"
2102
+ // Middle column: flexible
2103
+ )
2104
+ }) : d) : o, [o, t]), w = r || n && n.length > 0;
2105
+ return /* @__PURE__ */ l("div", { className: "astw:flex astw:flex-col", children: [
2106
+ w && /* @__PURE__ */ l(
2107
+ "header",
2108
+ {
2109
+ className: "astw:w-full astw:flex astw:justify-between astw:items-center",
2110
+ style: { padding: "1.5rem", paddingBottom: "1rem" },
2111
+ children: [
2112
+ r && /* @__PURE__ */ a("h1", { style: { fontSize: "1.5rem", fontWeight: "bold" }, children: r }),
2113
+ n && n.length > 0 && /* @__PURE__ */ a("div", { className: "astw:flex astw:gap-2 astw:items-center", children: n.map((d, h) => /* @__PURE__ */ a(g.Fragment, { children: d }, h)) })
2114
+ ]
2115
+ }
2116
+ ),
2117
+ /* @__PURE__ */ a("div", { style: { padding: w ? "0 1.5rem 1.5rem 1.5rem" : "1.5rem" }, children: /* @__PURE__ */ a("div", { className: c, children: u }) })
2118
+ ] });
2119
+ }
2120
+ Wa.Column = ot;
1955
2121
  export {
1956
- Xa as AppShell,
1957
- ts as AuthProvider,
1958
- pa as Badge,
1959
- Ja as CommandPalette,
1960
- ta as DefaultSidebar,
1961
- as as DescriptionCard,
1962
- ns as Link,
1963
- Za as SidebarLayout,
1964
- ha as badgeVariants,
1965
- ce as defineI18nLabels,
1966
- Ga as defineModule,
1967
- Ya as defineResource,
1968
- qa as redirectToResource,
1969
- T as useAppShell,
1970
- es as useAuth,
1971
- os as useLocation,
1972
- is as useNavigate,
1973
- ls as useParams,
1974
- ds as useRouteError,
1975
- cs as useSearchParams,
1976
- Ne as useTheme
2122
+ rs as AppShell,
2123
+ is as AuthProvider,
2124
+ Ca as Badge,
2125
+ os as CommandPalette,
2126
+ oa as DefaultSidebar,
2127
+ ds as DescriptionCard,
2128
+ Wa as Layout,
2129
+ us as Link,
2130
+ ns as SidebarLayout,
2131
+ va as badgeVariants,
2132
+ Ce as defineI18nLabels,
2133
+ as as defineModule,
2134
+ ss as defineResource,
2135
+ es as redirectToResource,
2136
+ k as useAppShell,
2137
+ ls as useAuth,
2138
+ ms as useLocation,
2139
+ hs as useNavigate,
2140
+ fs as useParams,
2141
+ ps as useRouteError,
2142
+ gs as useSearchParams,
2143
+ Ae as useTheme
1977
2144
  };