@tailor-platform/app-shell 0.21.1 → 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 R } from "react/jsx-runtime";
2
- import * as v from "react";
3
- import { createContext as j, useContext as K, useState as S, useMemo as I, useEffect as N, Suspense as rt, useRef as Rt, useCallback as q } from "react";
4
- import { useRouteError as Et, isRouteErrorResponse as Pt, Outlet as U, NavLink as Bt, redirect as nt, Navigate as Lt, useRouteLoaderData as At, createMemoryRouter as Dt, createBrowserRouter as It, RouterProvider as Mt, useHref as _t, Link as zt, useLocation as ot, useMatch as Ot, Await as it, useNavigate as $t } from "react-router";
5
- import { Link as Ea, useLocation as Pa, useNavigate as Ba, useParams as La, useRouteError as Aa, useSearchParams as Da } from "react-router";
6
- import { Slot as B } from "@radix-ui/react-slot";
7
- import { cva as lt } from "class-variance-authority";
8
- import { clsx as jt } from "clsx";
9
- import { twMerge as Kt } from "tailwind-merge";
10
- import { AlertCircle as G, Table as Ut, XIcon as dt, PanelLeftIcon as Ft, ChevronRight as z, SunIcon as Wt, SearchIcon as Ht } from "lucide-react";
11
- import { capitalCase as E } from "change-case";
12
- import { Toaster as Qt } from "sonner";
13
- import * as F from "@radix-ui/react-collapsible";
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 p from "@radix-ui/react-dialog";
16
- import * as T from "@radix-ui/react-tooltip";
17
- import { print as Vt } from "graphql";
18
- import { createAuthClient as qt } from "@tailor-platform/auth-browser-client";
19
- function u(...t) {
20
- return Kt(jt(t));
21
- }
22
- const Gt = lt(
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 Gt = lt(
44
44
  }
45
45
  }
46
46
  );
47
- function P({
47
+ function I({
48
48
  className: t,
49
49
  variant: e,
50
50
  size: s,
@@ -52,30 +52,30 @@ function P({
52
52
  ...n
53
53
  }) {
54
54
  return /* @__PURE__ */ a(
55
- r ? B : "button",
55
+ r ? A : "button",
56
56
  {
57
57
  "data-slot": "button",
58
- className: u(Gt({ 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 D = "en", Xt = () => {
63
+ const O = "en", ye = () => {
64
64
  try {
65
65
  if (typeof navigator > "u")
66
- return D;
66
+ return O;
67
67
  const t = navigator.languages?.[0] ?? navigator.language;
68
- return t ? new Intl.Locale(t).language : D;
68
+ return t ? new Intl.Locale(t).language : O;
69
69
  } catch {
70
- return D;
70
+ return O;
71
71
  }
72
- }, W = (t) => (e, s) => e ? typeof e == "string" ? e : e(t) ?? s : s, ct = (t) => {
73
- const e = W(t);
74
- return (s, r) => e(s, typeof s == "string" ? s : E(r));
75
- }, Yt = () => {
76
- const { configurations: t } = C(), e = W(t.locale);
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
- }, Jt = (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 D = "en", Xt = () => {
98
98
  * ```
99
99
  */
100
100
  useT: () => {
101
- const { configurations: s } = C(), 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 D = "en", Xt = () => {
131
131
  return typeof o == "function" ? o(r[0]) : o;
132
132
  }
133
133
  };
134
- }, Zt = Jt({
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 D = "en", Xt = () => {
170
170
  commandPaletteSearch: "ページを検索...",
171
171
  commandPaletteNoResults: "結果が見つかりません"
172
172
  }
173
- }), k = Zt.useT, L = () => {
174
- const t = Et(), e = k(), 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 (Pt(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(G, { 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
- P,
185
+ I,
186
186
  {
187
187
  variant: "outline",
188
188
  size: "sm",
@@ -195,12 +195,12 @@ const D = "en", Xt = () => {
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(G, { 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
- P,
203
+ I,
204
204
  {
205
205
  variant: "outline",
206
206
  size: "sm",
@@ -211,35 +211,35 @@ const D = "en", Xt = () => {
211
211
  )
212
212
  ] })
213
213
  ] }) });
214
- }, te = (t) => ({
214
+ }, Te = (t) => ({
215
215
  modules: t.modules,
216
216
  settingsResources: t.settingsResources ?? [],
217
- errorBoundary: t.errorBoundary ?? /* @__PURE__ */ a(L, {}),
217
+ errorBoundary: t.errorBoundary ?? /* @__PURE__ */ a(z, {}),
218
218
  basePath: t.basePath,
219
- locale: t.locale ?? Xt()
220
- }), wt = j({
219
+ locale: t.locale ?? ye()
220
+ }), Pt = q({
221
221
  configurations: {
222
222
  modules: [],
223
223
  settingsResources: [],
224
- errorBoundary: /* @__PURE__ */ a(L, {}),
225
- locale: D
224
+ errorBoundary: /* @__PURE__ */ a(z, {}),
225
+ locale: O
226
226
  }
227
- }), C = () => K(wt), ee = () => {
228
- const t = k();
229
- return /* @__PURE__ */ l(R, { children: [
227
+ }), k = () => G(Pt), ke = () => {
228
+ const t = B();
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
- }, X = () => /* @__PURE__ */ l(R, { children: [
234
- /* @__PURE__ */ a(U, {}),
235
- /* @__PURE__ */ a(Qt, {})
236
- ] }), ae = () => {
237
- const { configurations: t } = C(), e = k(), s = Yt();
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(Bt, { to: `./${r.path}`, children: ({ isActive: n }) => /* @__PURE__ */ l(
242
- P,
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 D = "en", Xt = () => {
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(U, {}) })
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
- }, ut = () => new Response("Not Found", { status: 404 }), H = 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 D = "en", Xt = () => {
260
260
  searchParams: s.searchParams,
261
261
  signal: e.request.signal
262
262
  }) ?? { state: "visible" };
263
- }, mt = (t, e) => async (s) => {
264
- switch ((await H(t, s)).state) {
263
+ }, Mt = (t, e) => async (s) => {
264
+ switch ((await tt(t, s)).state) {
265
265
  case "hidden":
266
- throw ut();
266
+ throw Dt();
267
267
  case "visible":
268
268
  return e ? e(s) : null;
269
269
  }
270
270
  };
271
- function pa(t) {
271
+ function es(t) {
272
272
  return {
273
273
  redirectTo: t
274
274
  };
275
275
  }
276
- function O(t) {
276
+ function U(t) {
277
277
  return typeof t == "object" && t !== null && "redirectTo" in t;
278
278
  }
279
- const ht = (t, e) => () => {
280
- const { configurations: s } = C(), { metaTitle: r, fallbackTitle: n } = t, i = W(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 va(t) {
284
- const { path: e, meta: s, component: r, resources: n, errorBoundary: o, accessControl: i } = t, d = s?.title ?? E(e), w = E(e), c = O(r) ? {
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: () => nt(r.redirectTo)
287
+ baseLoader: () => kt(r.redirectTo)
288
288
  } : {
289
289
  // Regular component with locale-aware title
290
- component: ht(
291
- { metaTitle: d, fallbackTitle: w },
292
- (b) => r({ title: b, 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
- }, h = i || c.baseLoader ? mt(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: h,
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: !O(r),
306
+ menuItemClickable: !U(r),
307
307
  icon: t.meta?.icon
308
308
  },
309
309
  resources: n,
310
- errorBoundary: o || /* @__PURE__ */ a(L, {}),
310
+ errorBoundary: o || /* @__PURE__ */ a(z, {}),
311
311
  accessControl: i
312
312
  };
313
313
  }
314
- function xa(t) {
315
- const { path: e, component: s, subResources: r, meta: n, errorBoundary: o, accessControl: i } = t, d = n?.title ?? E(e), w = E(e), c = i ? mt(i) : void 0;
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: ht(
326
- { metaTitle: d, fallbackTitle: w },
327
- (h) => s({ title: h, 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(L, {}),
330
+ errorBoundary: o ?? /* @__PURE__ */ a(z, {}),
331
331
  accessControl: i,
332
- loader: c
332
+ loader: w
333
333
  };
334
334
  }
335
- const Q = (t) => () => /* @__PURE__ */ a(R, { children: t }), ft = (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 Q = (t) => () => /* @__PURE__ */ a(R, { children: t }), ft = (t, e, s) =>
341
341
  return {
342
342
  path: t.path,
343
343
  ...t.errorBoundary && {
344
- ErrorBoundary: Q(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) => ft(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
- }, se = (t) => t.map(
358
- (e) => ft(e, e.resources, e.errorBoundary)
359
- ), re = ({
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 = O(s) ? {
364
+ const r = U(s) ? {
365
365
  index: !0,
366
- loader: () => nt(s.redirectTo)
366
+ loader: () => kt(s.redirectTo)
367
367
  } : {
368
368
  index: !0,
369
- Component: s ?? ee
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
- Lt,
375
+ Jt,
376
376
  {
377
377
  to: e[0].path,
378
378
  relative: "path",
@@ -382,12 +382,12 @@ const Q = (t) => () => /* @__PURE__ */ a(R, { children: t }), ft = (t, e, s) =>
382
382
  },
383
383
  {
384
384
  path: "settings",
385
- Component: ae,
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: Q(o.errorBoundary)
390
+ ErrorBoundary: et(o.errorBoundary)
391
391
  }
392
392
  }))
393
393
  }
@@ -395,29 +395,29 @@ const Q = (t) => () => /* @__PURE__ */ a(R, { children: t }), ft = (t, e, s) =>
395
395
  return [
396
396
  r,
397
397
  {
398
- children: se(t)
398
+ children: Ee(t)
399
399
  },
400
400
  ...n,
401
401
  {
402
402
  path: "*",
403
403
  loader: () => {
404
- throw ut();
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: L
409
+ ErrorBoundary: z
410
410
  }
411
411
  ];
412
- }, bt = "appshell-root-nav", ne = (t) => ({
413
- loaderID: bt,
414
- loader: async (e) => ({ navItems: oe(t, e) })
415
- }), gt = () => At(bt)?.navItems, oe = async (t, e) => {
416
- const s = ct(t.locale);
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 H(n.accessControl, e)).state !== "visible") return null;
420
- const i = await pt(
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 Q = (t) => () => /* @__PURE__ */ a(R, { children: t }), ft = (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(Ut, {}),
431
+ icon: n.meta.icon || /* @__PURE__ */ a(ce, {}),
432
432
  items: o
433
433
  }));
434
- }, pt = 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 H(o.accessControl, s)).state !== "visible") return null;
437
- const d = `${e}/${o.path}`, w = r(o.meta.title, o.path), c = o.subResources ? await pt(
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), ie = (t) => {
450
- const { configurations: e } = C(), { rootComponent: s, children: r } = t, n = re({
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 } = ne({
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(U, {}),
465
- ErrorBoundary: Q(o),
464
+ element: /* @__PURE__ */ a(Y, {}),
465
+ ErrorBoundary: et(o),
466
466
  children: n
467
467
  }
468
468
  ] : n,
@@ -472,107 +472,125 @@ const Q = (t) => () => /* @__PURE__ */ a(R, { children: t }), ft = (t, e, s) =>
472
472
  */
473
473
  HydrateFallback: () => null
474
474
  }
475
- ], c = e.basePath ? "/" + e.basePath : void 0, h = t.memory ? Dt(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
- }) : It(w, {
479
- basename: c
478
+ }) : ae(u, {
479
+ basename: w
480
480
  });
481
- return /* @__PURE__ */ a(Mt, { router: h });
482
- }, le = {
481
+ return /* @__PURE__ */ a(se, { router: d });
482
+ }, Me = {
483
483
  resolvedTheme: "light",
484
484
  theme: "system",
485
485
  setTheme: () => null
486
- }, vt = j(le);
487
- function de({
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] = S(
493
+ const [n, o] = R(
494
494
  () => localStorage.getItem(e) || s
495
- ), i = I(() => n !== "system" ? n : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", [n]);
496
- N(() => {
497
- const w = window.document.documentElement;
498
- w.classList.remove("light", "dark"), w.classList.add(i);
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(vt.Provider, { ...r, value: d, children: t });
507
+ return /* @__PURE__ */ a(Ot.Provider, { ...r, value: c, children: t });
508
508
  }
509
- const ce = () => {
510
- const t = K(vt);
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
- }, ya = (t) => {
515
- const [e, s] = S(!1);
516
- return N(function() {
514
+ }, rs = (t) => {
515
+ const [e, s] = R(!1);
516
+ return y(function() {
517
517
  s(!0);
518
518
  }, []), e ? /* @__PURE__ */ a(
519
- wt.Provider,
519
+ Pt.Provider,
520
520
  {
521
521
  value: {
522
522
  title: t.title,
523
523
  icon: t.icon,
524
- configurations: te(t)
524
+ configurations: Te(t)
525
525
  },
526
- children: /* @__PURE__ */ a(de, { defaultTheme: "system", storageKey: "appshell-ui-theme", children: /* @__PURE__ */ a(ie, { 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 we({
530
+ function ze({
531
531
  ...t
532
532
  }) {
533
- return /* @__PURE__ */ a(F.Root, { "data-slot": "collapsible", ...t });
533
+ return /* @__PURE__ */ a(Z.Root, { "data-slot": "collapsible", ...t });
534
534
  }
535
- function Y({
535
+ function wt({
536
536
  ...t
537
537
  }) {
538
538
  return /* @__PURE__ */ a(
539
- F.CollapsibleTrigger,
539
+ Z.CollapsibleTrigger,
540
540
  {
541
541
  "data-slot": "collapsible-trigger",
542
542
  ...t
543
543
  }
544
544
  );
545
545
  }
546
- function ue({
546
+ function _e({
547
547
  ...t
548
548
  }) {
549
549
  return /* @__PURE__ */ a(
550
- F.CollapsibleContent,
550
+ Z.CollapsibleContent,
551
551
  {
552
552
  "data-slot": "collapsible-content",
553
553
  ...t
554
554
  }
555
555
  );
556
556
  }
557
- const _ = 768;
558
- function me() {
559
- const [t, e] = v.useState(
557
+ const j = 768;
558
+ function Fe() {
559
+ const [t, e] = g.useState(
560
+ void 0
561
+ );
562
+ return g.useEffect(() => {
563
+ const s = window.matchMedia(`(max-width: ${j - 1}px)`), r = () => {
564
+ e(window.innerWidth < j);
565
+ };
566
+ return s.addEventListener("change", r), e(window.innerWidth < j), () => s.removeEventListener("change", r);
567
+ }, []), !!t;
568
+ }
569
+ const K = 768, V = 1199;
570
+ function Oe() {
571
+ const [t, e] = g.useState(
560
572
  void 0
561
573
  );
562
- return v.useEffect(() => {
563
- const s = window.matchMedia(`(max-width: ${_ - 1}px)`), r = () => {
564
- e(window.innerWidth < _);
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
+ );
565
581
  };
566
- return s.addEventListener("change", r), e(window.innerWidth < _), () => s.removeEventListener("change", r);
582
+ return s.addEventListener("change", r), e(
583
+ window.innerWidth >= K && window.innerWidth <= V
584
+ ), () => s.removeEventListener("change", r);
567
585
  }, []), !!t;
568
586
  }
569
- function he({ className: t, type: e, ...s }) {
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 he({ className: t, type: e, ...s }) {
582
600
  }
583
601
  );
584
602
  }
585
- function fe({ ...t }) {
586
- return /* @__PURE__ */ a(p.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(p.Portal, { "data-slot": "sheet-portal", ...t });
609
+ return /* @__PURE__ */ a(b.Portal, { "data-slot": "sheet-portal", ...t });
592
610
  }
593
- function ge({
611
+ function je({
594
612
  className: t,
595
613
  ...e
596
614
  }) {
597
615
  return /* @__PURE__ */ a(
598
- p.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 ge({
606
624
  }
607
625
  );
608
626
  }
609
- function pe({
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(ge, {}),
633
+ return /* @__PURE__ */ l(We, { children: [
634
+ /* @__PURE__ */ a(je, {}),
617
635
  /* @__PURE__ */ l(
618
- p.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 pe({
629
647
  ...r,
630
648
  children: [
631
649
  e,
632
- /* @__PURE__ */ l(p.Close, { className: "astw:ring-offset-bg astw:focus:ring-ring astw:data-[state=open]:bg-secondary astw:absolute astw:top-4 astw:right-4 astw:rounded-xs astw:opacity-70 astw:transition-opacity astw:hover:opacity-100 astw:focus:ring-2 astw:focus:ring-offset-2 astw:focus:outline-hidden astw:disabled:pointer-events-none", children: [
633
- /* @__PURE__ */ a(dt, { className: "astw:size-4" }),
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 pe({
638
656
  )
639
657
  ] });
640
658
  }
641
- function ve({ 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 xe({
669
+ function ft({
652
670
  className: t,
653
671
  ...e
654
672
  }) {
655
673
  return /* @__PURE__ */ a(
656
- p.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 ye({
682
+ function pt({
665
683
  className: t,
666
684
  ...e
667
685
  }) {
668
686
  return /* @__PURE__ */ a(
669
- p.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 xt({
695
+ function at({
678
696
  delayDuration: t = 0,
679
697
  ...e
680
698
  }) {
681
699
  return /* @__PURE__ */ a(
682
- T.Provider,
700
+ E.Provider,
683
701
  {
684
702
  "data-slot": "tooltip-provider",
685
703
  delayDuration: t,
@@ -687,47 +705,47 @@ function xt({
687
705
  }
688
706
  );
689
707
  }
690
- function Ne({
708
+ function st({
691
709
  ...t
692
710
  }) {
693
- return /* @__PURE__ */ a(xt, { children: /* @__PURE__ */ a(T.Root, { "data-slot": "tooltip", ...t }) });
711
+ return /* @__PURE__ */ a(at, { children: /* @__PURE__ */ a(E.Root, { "data-slot": "tooltip", ...t }) });
694
712
  }
695
- function Ce({
713
+ function rt({
696
714
  ...t
697
715
  }) {
698
- return /* @__PURE__ */ a(T.Trigger, { "data-slot": "tooltip-trigger", ...t });
716
+ return /* @__PURE__ */ a(E.Trigger, { "data-slot": "tooltip-trigger", ...t });
699
717
  }
700
- function Se({
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(T.Portal, { children: /* @__PURE__ */ l(
707
- T.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(T.Arrow, { className: "astw:bg-primary astw:fill-primary astw:z-50 astw:size-2.5 astw:translate-y-[calc(-50%_-_2px)] astw:rotate-45 astw:rounded-[2px]" })
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 Te = "sidebar_state", ke = 3600 * 24 * 7, Re = "16rem", Ee = "18rem", Pe = "3rem", Be = "b", yt = v.createContext(null);
724
- function M() {
725
- const t = v.useContext(yt);
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 Le({
748
+ function Ue({
731
749
  defaultOpen: t = !0,
732
750
  open: e,
733
751
  onOpenChange: s,
@@ -736,41 +754,44 @@ function Le({
736
754
  children: o,
737
755
  ...i
738
756
  }) {
739
- const d = me(), [w, c] = v.useState(!1), [h, b] = v.useState(t), m = e ?? h, f = v.useCallback(
740
- (g) => {
741
- const y = typeof g == "function" ? g(m) : g;
742
- s ? s(y) : b(y), document.cookie = `${Te}=${y}; path=/; max-age=${ke}`;
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, m]
745
- ), x = v.useCallback(() => d ? c((g) => !g) : f((g) => !g), [d, f, c]);
746
- v.useEffect(() => {
747
- const g = (y) => {
748
- y.key === Be && (y.metaKey || y.ctrlKey) && (y.preventDefault(), x());
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", g), () => window.removeEventListener("keydown", g);
751
- }, [x]);
752
- const A = m ? "expanded" : "collapsed", V = v.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: m,
756
- setOpen: f,
757
- isMobile: d,
772
+ state: it,
773
+ open: C,
774
+ setOpen: D,
775
+ isMobile: c,
758
776
  openMobile: w,
759
- setOpenMobile: c,
760
- toggleSidebar: x
777
+ setOpenMobile: d,
778
+ toggleSidebar: F,
779
+ isIconMode: S,
780
+ openIconMode: h,
781
+ setOpenIconMode: f
761
782
  }),
762
- [A, m, f, d, w, c, x]
783
+ [it, C, D, c, w, d, F, S, h, f]
763
784
  );
764
- return /* @__PURE__ */ a(yt.Provider, { value: V, children: /* @__PURE__ */ a(xt, { 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": Re,
770
- "--sidebar-width-icon": Pe,
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 Le({
779
800
  }
780
801
  ) }) });
781
802
  }
782
- function Ae({
803
+ function Qe({
783
804
  side: t = "left",
784
805
  variant: e = "sidebar",
785
806
  collapsible: s = "offcanvas",
@@ -787,43 +808,108 @@ function Ae({
787
808
  children: n,
788
809
  ...o
789
810
  }) {
790
- const { isMobile: i, state: d, openMobile: w, setOpenMobile: c } = M();
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(fe, { open: w, onOpenChange: c, ...o, children: /* @__PURE__ */ l(
803
- pe,
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": Ee
831
+ "--sidebar-width": Ke
811
832
  },
812
833
  side: t,
813
834
  children: [
814
- /* @__PURE__ */ l(ve, { className: "astw:sr-only", children: [
815
- /* @__PURE__ */ a(xe, { children: "Sidebar" }),
816
- /* @__PURE__ */ a(ye, { 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 Ae({
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 Ae({
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 Ae({
868
954
  }
869
955
  );
870
956
  }
871
- function Nt({
957
+ function jt({
872
958
  className: t,
873
959
  onClick: e,
874
960
  ...s
875
961
  }) {
876
- const { toggleSidebar: r } = M();
962
+ const { toggleSidebar: r } = _();
877
963
  return /* @__PURE__ */ l(
878
- P,
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(Ft, { 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 De({ 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 De({ className: t, ...e }) {
908
994
  }
909
995
  );
910
996
  }
911
- function Ie({ 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 Me({ 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 Ct({ 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 St({ 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 Tt({ 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 _e = lt(
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 _e = lt(
986
1069
  }
987
1070
  }
988
1071
  );
989
- function J({
1072
+ function gt({
990
1073
  asChild: t = !1,
991
1074
  isActive: e = !1,
992
1075
  variant: s = "default",
@@ -995,44 +1078,44 @@ function J({
995
1078
  className: o,
996
1079
  ...i
997
1080
  }) {
998
- const d = t ? B : "button", { isMobile: w, state: c } = M(), h = /* @__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(_e({ 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(Ne, { children: [
1012
- /* @__PURE__ */ a(Ce, { asChild: !0, children: h }),
1094
+ }), /* @__PURE__ */ l(st, { children: [
1095
+ /* @__PURE__ */ a(rt, { asChild: !0, children: d }),
1013
1096
  /* @__PURE__ */ a(
1014
- Se,
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
- ] })) : h;
1105
+ ] })) : d;
1023
1106
  }
1024
- function Z({
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 ? B : "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 Z({
1047
1130
  }
1048
1131
  );
1049
1132
  }
1050
- function ze({ 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 ze({ className: t, ...e }) {
1062
1145
  }
1063
1146
  );
1064
1147
  }
1065
- function Oe({
1148
+ function Je({
1066
1149
  className: t,
1067
1150
  ...e
1068
1151
  }) {
@@ -1071,12 +1154,12 @@ function Oe({
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 $e({
1162
+ function ta({
1080
1163
  asChild: t = !1,
1081
1164
  size: e = "md",
1082
1165
  isActive: s = !1,
@@ -1084,14 +1167,14 @@ function $e({
1084
1167
  ...n
1085
1168
  }) {
1086
1169
  return /* @__PURE__ */ a(
1087
- t ? B : "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 $e({
1102
1185
  }
1103
1186
  );
1104
1187
  }
1105
- function $({ to: t, children: e, ...s }) {
1188
+ function Q({ to: t, children: e, ...s }) {
1106
1189
  try {
1107
- return _t(t), /* @__PURE__ */ a(zt, { 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 tt({ ...t }) {
1195
+ function xt({ ...t }) {
1113
1196
  return /* @__PURE__ */ a("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...t });
1114
1197
  }
1115
- function et({ 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 et({ className: t, ...e }) {
1125
1208
  }
1126
1209
  );
1127
1210
  }
1128
- function at({ 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 st({
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 ? B : $,
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 je({
1237
+ function ea({
1155
1238
  children: t,
1156
1239
  className: e,
1157
1240
  ...s
@@ -1162,21 +1245,21 @@ function je({
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(z, {})
1250
+ children: t ?? /* @__PURE__ */ a(H, {})
1168
1251
  }
1169
1252
  );
1170
1253
  }
1171
- function Ke(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 Ue = (t, e) => {
1179
- const s = ct(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 Ue = (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 h = `${w}/${c.path}`, b = 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[h] = {
1194
- title: b,
1195
- breadcrumbTitle: c.meta.breadcrumbTitle
1196
- }, c.subResources && c.subResources.length > 0 && i(
1197
- c.subResources,
1198
- h
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 Ue = (t, e) => {
1204
1287
  {}
1205
1288
  );
1206
1289
  };
1207
- function Fe(t, e, s, r) {
1208
- const n = t.split("/").filter((w) => w !== ""), o = e && n[0] === e ? n.slice(1) : n, i = Ue(s, r), d = o.map((w, c) => {
1209
- const h = o.slice(0, c + 1).join("/");
1210
- let b = i[h];
1211
- if (!b) {
1212
- const f = Object.entries(i).find(
1213
- ([x]) => {
1214
- const A = x.split("/").map((g) => g.startsWith(":") ? "[^/]+" : g).join("/");
1215
- return new RegExp(`^${A}$`).test(h);
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
- f && (b = f);
1301
+ p && (h = p);
1219
1302
  }
1220
- let m;
1221
- return b ? typeof b.breadcrumbTitle == "function" ? m = b.breadcrumbTitle(w) : typeof b.breadcrumbTitle == "string" ? m = b.breadcrumbTitle : m = b.title : m = decodeURIComponent(w), {
1222
- segment: w,
1223
- path: h,
1224
- title: m
1303
+ let f;
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,
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 We = () => {
1233
- const { open: t } = M();
1234
- return /* @__PURE__ */ a("div", { className: t ? "astw:md:hidden" : void 0, children: /* @__PURE__ */ a(Nt, { className: "astw:-ml-2.5" }) });
1235
- }, Na = (t) => {
1236
- const e = t.children ? t.children({ Outlet: X }) : null, s = ce(), r = () => {
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(Le, { className: "astw:flex astw:flex-col", children: /* @__PURE__ */ l("div", { className: "astw:flex astw:flex-1", children: [
1240
- t.sidebar ?? /* @__PURE__ */ a(He, {}),
1241
- /* @__PURE__ */ l(De, { className: "astw:w-[calc(100%-var(--sidebar-width))]", children: [
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(We, {}),
1245
- /* @__PURE__ */ a(Xe, {})
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(P, { variant: "outline", size: "icon", onClick: r, children: /* @__PURE__ */ a(Wt, {}) }) })
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(X, {}) })
1332
+ /* @__PURE__ */ a("div", { className: "astw:flex astw:flex-col astw:gap-4", children: e ?? /* @__PURE__ */ a(ct, {}) })
1250
1333
  ] })
1251
1334
  ] }) });
1252
- }, He = (t) => {
1253
- const { title: e, icon: s } = C(), { pathname: r } = ot(), n = /* @__PURE__ */ l(Ie, { 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(Ae, { variant: "inset", children: [
1258
- /* @__PURE__ */ l("div", { className: "astw:flex astw:justify-between astw:items-center", children: [
1259
- t.header ?? n,
1260
- /* @__PURE__ */ a("div", { className: "astw:hidden astw:md:block", children: /* @__PURE__ */ a(Nt, { className: "astw:-ml-1" }) })
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(Me, { children: /* @__PURE__ */ a(rt, { fallback: /* @__PURE__ */ a(qe, {}), children: /* @__PURE__ */ a(Qe, { 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
- }, Qe = ({ currentPath: t }) => {
1266
- const e = gt();
1267
- return /* @__PURE__ */ a(it, { resolve: e, children: (s) => /* @__PURE__ */ a(Ve, { items: s ?? [], currentPath: t }) });
1268
- }, Ve = (t) => {
1269
- const e = k();
1270
- return /* @__PURE__ */ a(Ct, { children: /* @__PURE__ */ a(St, { children: t.items.map((s) => /* @__PURE__ */ a(we, { asChild: !0, defaultOpen: !0, children: /* @__PURE__ */ l(Tt, { children: [
1271
- s.url ? /* @__PURE__ */ l(R, { children: [
1272
- /* @__PURE__ */ a(J, { asChild: !0, tooltip: s.title, children: /* @__PURE__ */ l(
1273
- $,
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) => {
1361
+ const e = B();
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 We = () => {
1280
1372
  ]
1281
1373
  }
1282
1374
  ) }),
1283
- !!s.items?.length && /* @__PURE__ */ a(Y, { asChild: !0, children: /* @__PURE__ */ l(Z, { className: "astw:data-[state=open]:rotate-90", children: [
1284
- /* @__PURE__ */ a(z, {}),
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(R, { children: /* @__PURE__ */ l(Y, { className: "astw:flex astw:w-[100%] astw:[&[data-state=open]_.astw-rotate-target]:rotate-90", children: [
1288
- /* @__PURE__ */ a(J, { asChild: !0, tooltip: s.title, children: /* @__PURE__ */ l("span", { className: "astw:flex astw:w-[100%]", children: [
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
- Z,
1385
+ bt,
1294
1386
  {
1295
1387
  className: "astw-rotate-target",
1296
1388
  asChild: !0,
1297
1389
  children: /* @__PURE__ */ l("span", { children: [
1298
- /* @__PURE__ */ a(z, {}),
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(ue, { children: /* @__PURE__ */ a(ze, { children: s.items?.map((r) => /* @__PURE__ */ a(Oe, { children: /* @__PURE__ */ a($e, { asChild: !0, children: /* @__PURE__ */ a(
1305
- $,
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 We = () => {
1310
1402
  }
1311
1403
  ) }) }, r.title)) }) })
1312
1404
  ] }) }, s.title)) }) });
1313
- }, qe = () => {
1405
+ }, da = () => {
1314
1406
  const e = [...[112, 96, 80, 104, 88, 100, 92, 84]].sort(() => Math.random() - 0.5);
1315
- return /* @__PURE__ */ a(Ct, { children: /* @__PURE__ */ a(St, { className: "astw:px-2", children: e.map((s, r) => /* @__PURE__ */ a(Tt, { children: /* @__PURE__ */ l("div", { className: "astw:flex astw:items-center astw:gap-2 astw:py-1.5", children: [
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 We = () => {
1322
1414
  }
1323
1415
  )
1324
1416
  ] }) }, r)) }) });
1325
- }, Ge = () => {
1326
- const { configurations: t } = C(), e = ot();
1327
- return Fe(
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
- }, Xe = () => {
1334
- const { segments: t } = Ge(), e = Ot("/:prefix/settings/:suffix"), s = k();
1335
- return e ? /* @__PURE__ */ a(tt, { children: /* @__PURE__ */ a(et, { children: /* @__PURE__ */ a("div", { className: "astw:inline-flex astw:items-center astw:gap-3 astw:last:text-foreground", children: /* @__PURE__ */ a(at, { children: /* @__PURE__ */ a(st, { to: `/${e.params.prefix}/settings`, children: s("settings") }) }) }) }) }) : /* @__PURE__ */ a(tt, { children: /* @__PURE__ */ a(et, { children: t.map((r, n) => /* @__PURE__ */ l(
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(at, { children: /* @__PURE__ */ a(st, { to: r.path, children: r.title }) }),
1341
- n < t.length - 1 && /* @__PURE__ */ a(je, {})
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 Ye({
1439
+ function ua({
1348
1440
  ...t
1349
1441
  }) {
1350
- return /* @__PURE__ */ a(p.Root, { "data-slot": "dialog", ...t });
1442
+ return /* @__PURE__ */ a(b.Root, { "data-slot": "dialog", ...t });
1351
1443
  }
1352
- function Je({
1444
+ function ma({
1353
1445
  ...t
1354
1446
  }) {
1355
- return /* @__PURE__ */ a(p.Portal, { "data-slot": "dialog-portal", ...t });
1447
+ return /* @__PURE__ */ a(b.Portal, { "data-slot": "dialog-portal", ...t });
1356
1448
  }
1357
- function Ze({
1449
+ function ha({
1358
1450
  className: t,
1359
1451
  ...e
1360
1452
  }) {
1361
1453
  return /* @__PURE__ */ a(
1362
- p.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 Ze({
1370
1462
  }
1371
1463
  );
1372
1464
  }
1373
- function ta({
1465
+ function fa({
1374
1466
  className: t,
1375
1467
  children: e,
1376
1468
  ...s
1377
1469
  }) {
1378
- return /* @__PURE__ */ l(Je, { "data-slot": "dialog-portal", children: [
1379
- /* @__PURE__ */ a(Ze, {}),
1470
+ return /* @__PURE__ */ l(ma, { "data-slot": "dialog-portal", children: [
1471
+ /* @__PURE__ */ a(ha, {}),
1380
1472
  /* @__PURE__ */ l(
1381
- p.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(p.Close, { className: "astw:ring-offset-bg astw:focus:ring-ring astw:data-[state=open]:bg-accent astw:data-[state=open]:text-muted-foreground astw:absolute astw:top-4 astw:right-4 astw:rounded-xs astw:opacity-70 astw:transition-opacity astw:hover:opacity-100 astw:focus:ring-2 astw:focus:ring-offset-2 astw:focus:outline-hidden astw:disabled:pointer-events-none astw:[&_svg]:pointer-events-none astw:[&_svg]:shrink-0 astw:[&_svg:not([class*='size-'])]:size-4", children: [
1392
- /* @__PURE__ */ a(dt, {}),
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 ta({
1397
1489
  )
1398
1490
  ] });
1399
1491
  }
1400
- function ea({
1492
+ function pa({
1401
1493
  className: t,
1402
1494
  ...e
1403
1495
  }) {
1404
1496
  return /* @__PURE__ */ a(
1405
- p.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 aa(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,90 +1523,90 @@ function aa(t) {
1431
1523
  }), s(r.items, r.icon, [r.title]);
1432
1524
  }), e;
1433
1525
  }
1434
- function sa({
1526
+ function ba({
1435
1527
  routes: t
1436
1528
  }) {
1437
- const e = $t(), s = Rt(null), [r, n] = S(!1), [o, i] = S(""), [d, w] = S(0), c = I(
1438
- () => Ke(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
- N(() => {
1442
- const m = (f) => {
1443
- (f.metaKey || f.ctrlKey) && f.key === "k" && (f.preventDefault(), n((x) => !x));
1533
+ y(() => {
1534
+ const f = (p) => {
1535
+ (p.metaKey || p.ctrlKey) && p.key === "k" && (p.preventDefault(), n((P) => !P));
1444
1536
  };
1445
- return document.addEventListener("keydown", m), () => document.removeEventListener("keydown", m);
1446
- }, []), N(() => {
1447
- w(0);
1448
- }, [c]), N(() => {
1449
- r || (i(""), w(0));
1450
- }, [r]), N(() => {
1451
- s.current && s.current.querySelector(`[data-index="${d}"]`)?.scrollIntoView({ block: "nearest" });
1452
- }, [d]);
1453
- const h = q(
1454
- (m) => {
1455
- e(m.path), n(!1), i("");
1537
+ return document.addEventListener("keydown", f), () => document.removeEventListener("keydown", f);
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(
1546
+ (f) => {
1547
+ e(f.path), n(!1), i("");
1456
1548
  },
1457
1549
  [e]
1458
- ), b = q(
1459
- (m) => {
1460
- if (!m.nativeEvent.isComposing)
1461
- switch (m.key) {
1550
+ ), h = lt(
1551
+ (f) => {
1552
+ if (!f.nativeEvent.isComposing)
1553
+ switch (f.key) {
1462
1554
  case "ArrowDown":
1463
- m.preventDefault(), w(
1464
- (f) => f < c.length - 1 ? f + 1 : f
1555
+ f.preventDefault(), u(
1556
+ (p) => p < w.length - 1 ? p + 1 : p
1465
1557
  );
1466
1558
  break;
1467
1559
  case "ArrowUp":
1468
- m.preventDefault(), w((f) => f > 0 ? f - 1 : f);
1560
+ f.preventDefault(), u((p) => p > 0 ? p - 1 : p);
1469
1561
  break;
1470
1562
  case "Enter":
1471
- m.preventDefault(), c[d] && h(c[d]);
1563
+ f.preventDefault(), w[c] && d(w[c]);
1472
1564
  break;
1473
1565
  }
1474
1566
  },
1475
- [c, d, h]
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: h,
1485
- handleKeyDown: b,
1574
+ selectedIndex: c,
1575
+ filteredRoutes: w,
1576
+ handleSelect: d,
1577
+ handleKeyDown: h,
1486
1578
  listRef: s
1487
1579
  };
1488
1580
  }
1489
- function ra({
1581
+ function xa({
1490
1582
  navItems: t
1491
1583
  }) {
1492
- const e = k(), s = I(() => aa(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: h,
1501
- listRef: b
1502
- } = sa({ routes: s });
1503
- return /* @__PURE__ */ a(Ye, { open: r, onOpenChange: n, children: /* @__PURE__ */ l(
1504
- ta,
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: h,
1599
+ onKeyDown: d,
1508
1600
  "aria-describedby": void 0,
1509
1601
  children: [
1510
- /* @__PURE__ */ a(ea, { 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(Ht, { 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
- he,
1606
+ $e,
1515
1607
  {
1516
1608
  value: o,
1517
- onChange: (m) => i(m.target.value),
1609
+ onChange: (f) => i(f.target.value),
1518
1610
  placeholder: e("commandPaletteSearch"),
1519
1611
  className: "astw:flex astw:h-10 astw:w-full astw:rounded-md astw:bg-transparent astw:py-3 astw:text-sm astw:outline-none astw:border-0 astw:shadow-none astw:focus-visible:ring-0 astw:placeholder:text-muted-foreground astw:disabled:cursor-not-allowed astw:disabled:opacity-50",
1520
1612
  autoFocus: !0
@@ -1524,26 +1616,26 @@ function ra({
1524
1616
  /* @__PURE__ */ a(
1525
1617
  "div",
1526
1618
  {
1527
- ref: b,
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((m, f) => /* @__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": f,
1533
- onClick: () => c(m),
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
- f === 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
- /* @__PURE__ */ a("span", { className: "astw:truncate astw:w-full astw:text-left", children: m.breadcrumb.join(" > ") }),
1631
+ /* @__PURE__ */ a("span", { className: "astw:truncate astw:w-full astw:text-left", children: f.breadcrumb.join(" > ") }),
1540
1632
  /* @__PURE__ */ l("span", { className: "astw:text-[11px] astw:text-muted-foreground astw:truncate astw:w-full astw:text-left", children: [
1541
1633
  "/",
1542
- m.path
1634
+ f.path
1543
1635
  ] })
1544
1636
  ]
1545
1637
  },
1546
- m.path
1638
+ f.path
1547
1639
  )) })
1548
1640
  }
1549
1641
  )
@@ -1551,25 +1643,25 @@ function ra({
1551
1643
  }
1552
1644
  ) });
1553
1645
  }
1554
- function Ca() {
1555
- const t = gt();
1556
- return /* @__PURE__ */ a(rt, { fallback: null, children: /* @__PURE__ */ a(it, { resolve: t, children: (e) => /* @__PURE__ */ a(ra, { navItems: e ?? [] }) }) });
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 kt = j(null), Sa = (t) => {
1559
- const e = I(
1560
- () => qt({
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 : Vt(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] = S(
1659
+ ), [s, r] = R(
1568
1660
  () => e.getState()
1569
1661
  );
1570
- N(() => {
1662
+ y(() => {
1571
1663
  t.autoLogin && (s.isLoading || s.isAuthenticated || (async () => await e.login())());
1572
- }, [s.isLoading, s.isAuthenticated, t.autoLogin]), N(
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 kt = j(null), Sa = (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
- kt.Provider,
1672
+ Ut.Provider,
1581
1673
  {
1582
1674
  value: {
1583
1675
  authState: s,
@@ -1589,29 +1681,464 @@ const kt = j(null), Sa = (t) => {
1589
1681
  children: n
1590
1682
  }
1591
1683
  );
1592
- }, Ta = () => {
1593
- const t = K(kt);
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;
1689
+ }, va = X(
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",
1691
+ {
1692
+ variants: {
1693
+ variant: {
1694
+ default: "astw:border-transparent astw:bg-primary astw:text-primary-foreground astw:hover:bg-primary/80",
1695
+ success: "astw:border-transparent astw:bg-green-500 astw:text-white astw:hover:bg-green-600",
1696
+ warning: "astw:border-transparent astw:bg-yellow-500 astw:text-white astw:hover:bg-yellow-600",
1697
+ error: "astw:border-transparent astw:bg-destructive astw:text-destructive-foreground astw:hover:bg-destructive/80",
1698
+ neutral: "astw:border-transparent astw:bg-secondary astw:text-secondary-foreground astw:hover:bg-secondary/80",
1699
+ // Outline variants with status dots - matches Figma design
1700
+ "outline-success": "astw:gap-0.5 astw:pl-1.5 astw:pr-2 astw:border-border astw:bg-card astw:text-foreground",
1701
+ "outline-warning": "astw:gap-0.5 astw:pl-1.5 astw:pr-2 astw:border-border astw:bg-card astw:text-foreground",
1702
+ "outline-error": "astw:gap-0.5 astw:pl-1.5 astw:pr-2 astw:border-border astw:bg-card astw:text-foreground",
1703
+ "outline-info": "astw:gap-0.5 astw:pl-1.5 astw:pr-2 astw:border-border astw:bg-card astw:text-foreground",
1704
+ "outline-neutral": "astw:gap-0.5 astw:pl-1.5 astw:pr-2 astw:border-border astw:bg-card astw:text-foreground"
1705
+ }
1706
+ },
1707
+ defaultVariants: {
1708
+ variant: "default"
1709
+ }
1710
+ }
1711
+ ), ya = {
1712
+ "outline-success": "astw:bg-green-500",
1713
+ "outline-warning": "astw:bg-orange-500",
1714
+ "outline-error": "astw:bg-red-500",
1715
+ "outline-info": "astw:bg-blue-500",
1716
+ "outline-neutral": "astw:bg-neutral-400"
1597
1717
  };
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;
1721
+ }
1722
+ function Ca({ className: t, variant: e, children: s, ...r }) {
1723
+ const n = e?.toString().startsWith("outline-");
1724
+ return /* @__PURE__ */ l(
1725
+ "div",
1726
+ {
1727
+ className: m(va({ variant: e }), t),
1728
+ ...r,
1729
+ children: [
1730
+ n && /* @__PURE__ */ a(Na, { variant: e }),
1731
+ s
1732
+ ]
1733
+ }
1734
+ );
1735
+ }
1736
+ function Sa(t) {
1737
+ return t.type === "divider";
1738
+ }
1739
+ function Ta(t) {
1740
+ return t.type !== "divider" && "key" in t;
1741
+ }
1742
+ function W(t, e) {
1743
+ return e.split(".").reduce((s, r) => {
1744
+ if (s && typeof s == "object" && r in s)
1745
+ return s[r];
1746
+ }, t);
1747
+ }
1748
+ function v(t) {
1749
+ return t == null || t === "";
1750
+ }
1751
+ function ka(t) {
1752
+ return t.toLowerCase().replace(/_/g, " ").replace(/^\w/, (e) => e.toUpperCase());
1753
+ }
1754
+ function Ra(t, e = "medium") {
1755
+ if (v(t)) return "";
1756
+ const s = t instanceof Date ? t : new Date(String(t));
1757
+ if (isNaN(s.getTime())) return String(t);
1758
+ switch (e) {
1759
+ case "short":
1760
+ return s.toLocaleDateString(void 0, {
1761
+ month: "numeric",
1762
+ day: "numeric",
1763
+ year: "2-digit"
1764
+ });
1765
+ case "medium":
1766
+ return s.toLocaleDateString(void 0, {
1767
+ month: "short",
1768
+ day: "numeric",
1769
+ year: "numeric"
1770
+ });
1771
+ case "long":
1772
+ return s.toLocaleDateString(void 0, {
1773
+ weekday: "long",
1774
+ month: "long",
1775
+ day: "numeric",
1776
+ year: "numeric"
1777
+ });
1778
+ case "relative": {
1779
+ const n = (/* @__PURE__ */ new Date()).getTime() - s.getTime(), o = Math.floor(n / (1e3 * 60 * 60 * 24));
1780
+ return o === 0 ? "Today" : o === 1 ? "Yesterday" : o < 7 ? `${o} days ago` : o < 30 ? `${Math.floor(o / 7)} weeks ago` : o < 365 ? `${Math.floor(o / 30)} months ago` : `${Math.floor(o / 365)} years ago`;
1781
+ }
1782
+ default:
1783
+ return s.toLocaleDateString();
1784
+ }
1785
+ }
1786
+ function Ea(t, e) {
1787
+ if (v(t)) return "";
1788
+ const s = typeof t == "number" ? t : parseFloat(String(t));
1789
+ if (isNaN(s)) return String(t);
1790
+ try {
1791
+ return new Intl.NumberFormat(void 0, {
1792
+ style: "currency",
1793
+ currency: e || "USD"
1794
+ }).format(s);
1795
+ } catch {
1796
+ return `${e || "$"}${s.toFixed(2)}`;
1797
+ }
1798
+ }
1799
+ function La(t) {
1800
+ if (v(t)) return [];
1801
+ if (typeof t == "string")
1802
+ return t.split(/[,\n]/).map((e) => e.trim()).filter(Boolean);
1803
+ if (typeof t == "object" && t !== null) {
1804
+ const e = t, s = [];
1805
+ e.line1 && s.push(String(e.line1)), e.line2 && s.push(String(e.line2));
1806
+ const r = [
1807
+ e.city,
1808
+ e.state || e.province,
1809
+ e.zip || e.postalCode
1810
+ ].filter(Boolean).join(", ");
1811
+ return r && s.push(r), e.country && s.push(String(e.country)), s;
1812
+ }
1813
+ return [String(t)];
1814
+ }
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(
1819
+ "button",
1820
+ {
1821
+ onClick: async (n) => {
1822
+ n.stopPropagation();
1823
+ try {
1824
+ await navigator.clipboard.writeText(t), s(!0), setTimeout(() => s(!1), 2e3);
1825
+ } catch {
1826
+ }
1827
+ },
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",
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 })
1830
+ }
1831
+ ) }),
1832
+ /* @__PURE__ */ a(nt, { side: "top", children: e ? "Copied!" : "Copy" })
1833
+ ] });
1834
+ }
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(() => {
1839
+ if (!r) {
1840
+ i(!1);
1841
+ return;
1842
+ }
1843
+ const w = () => {
1844
+ if (n.current) {
1845
+ const h = n.current;
1846
+ i(h.scrollHeight > h.clientHeight + 1);
1847
+ }
1848
+ }, d = setTimeout(w, 50);
1849
+ return window.addEventListener("resize", w), () => {
1850
+ clearTimeout(d), window.removeEventListener("resize", w);
1851
+ };
1852
+ }, [e, r]);
1853
+ const c = r && r > 0 ? {
1854
+ display: "-webkit-box",
1855
+ WebkitLineClamp: r,
1856
+ WebkitBoxOrient: "vertical",
1857
+ overflow: "hidden"
1858
+ } : void 0, u = /* @__PURE__ */ l("div", { className: "astw:flex astw:items-start astw:gap-1 astw:min-w-0", children: [
1859
+ /* @__PURE__ */ a(
1860
+ "p",
1861
+ {
1862
+ ref: n,
1863
+ className: "astw:text-sm astw:font-medium astw:text-foreground astw:break-words astw:m-0",
1864
+ style: c,
1865
+ children: e
1866
+ }
1867
+ ),
1868
+ s && /* @__PURE__ */ a(Qt, { value: String(t.value) })
1869
+ ] });
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 });
1878
+ const e = String(t.value), s = t.meta?.badgeVariantMap || {}, r = e.toLowerCase(), n = s[e] || s[r] || "outline-neutral";
1879
+ return /* @__PURE__ */ a(Ca, { variant: n, className: "astw:w-fit", children: ka(e) });
1880
+ }
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);
1885
+ return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground astw:tabular-nums", children: r });
1886
+ }
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);
1891
+ return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: s });
1892
+ }
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);
1897
+ return s ? /* @__PURE__ */ l(
1898
+ "a",
1899
+ {
1900
+ href: s,
1901
+ target: r ? "_blank" : void 0,
1902
+ rel: r ? "noopener noreferrer" : void 0,
1903
+ className: "astw:inline-flex astw:items-center astw:gap-1 astw:text-sm astw:text-primary astw:hover:underline",
1904
+ children: [
1905
+ n,
1906
+ r && /* @__PURE__ */ a(he, { className: "astw:h-3 astw:w-3" })
1907
+ ]
1908
+ }
1909
+ ) : /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: n });
1910
+ }
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(`
1915
+ `);
1916
+ return /* @__PURE__ */ l("div", { className: "astw:flex astw:items-start astw:gap-1 astw:min-w-0", 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: [
1918
+ n,
1919
+ o < e.length - 1 && /* @__PURE__ */ a("br", {})
1920
+ ] }, o)) }),
1921
+ s && /* @__PURE__ */ a(Qt, { value: r })
1922
+ ] });
1923
+ }
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);
1928
+ if (!r || !s)
1929
+ return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: n });
1930
+ const o = s.replace("{id}", r);
1931
+ return /* @__PURE__ */ a("a", { href: o, className: "astw:text-sm astw:text-primary astw:hover:underline", children: n });
1932
+ }
1933
+ function Ct(t) {
1934
+ switch (t.type) {
1935
+ case "text":
1936
+ return /* @__PURE__ */ a(Ba, { field: t });
1937
+ case "badge":
1938
+ return /* @__PURE__ */ a(Pa, { field: t });
1939
+ case "money":
1940
+ return /* @__PURE__ */ a(Da, { field: t });
1941
+ case "date":
1942
+ return /* @__PURE__ */ a(Ma, { field: t });
1943
+ case "link":
1944
+ return /* @__PURE__ */ a(Ia, { field: t });
1945
+ case "address":
1946
+ return /* @__PURE__ */ a(Aa, { field: t });
1947
+ case "reference":
1948
+ return /* @__PURE__ */ a(za, { field: t });
1949
+ default:
1950
+ return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: N });
1951
+ }
1952
+ }
1953
+ function _a(t) {
1954
+ if (t.emptyBehavior !== "hide") return !1;
1955
+ const e = t.value;
1956
+ return e == null || e === "";
1957
+ }
1958
+ function Fa(t) {
1959
+ return !1;
1960
+ }
1961
+ function Oa(t, e, s) {
1962
+ const r = W(e, t.key);
1963
+ return {
1964
+ id: `${t.key}-${s}`,
1965
+ label: t.label,
1966
+ type: t.type ?? "text",
1967
+ value: r,
1968
+ emptyBehavior: t.emptyBehavior ?? "dash",
1969
+ meta: t.meta,
1970
+ data: e
1971
+ };
1972
+ }
1973
+ function $a(t, e) {
1974
+ const s = [];
1975
+ let r = [], n = 0, o = 0;
1976
+ for (const i of t)
1977
+ if (Sa(i))
1978
+ r.length > 0 && (s.push({ id: `section-${n}`, fields: r }), n++, r = []);
1979
+ else if (Ta(i)) {
1980
+ const c = Oa(i, e, o);
1981
+ o++, _a(c) || r.push(c);
1982
+ }
1983
+ return r.length > 0 && s.push({ id: `section-${n}`, fields: r }), s;
1984
+ }
1985
+ function St({ label: t, children: e, fullWidth: s }) {
1986
+ return /* @__PURE__ */ l(
1987
+ "div",
1988
+ {
1989
+ className: m(
1990
+ "astw:flex astw:flex-col astw:gap-1 astw:min-w-0 astw:py-2",
1991
+ s && "astw:col-span-full"
1992
+ ),
1993
+ children: [
1994
+ /* @__PURE__ */ a("p", { className: "astw:text-sm astw:font-medium astw:text-muted-foreground astw:leading-none", children: t }),
1995
+ /* @__PURE__ */ a("div", { className: "astw:min-w-0", children: e })
1996
+ ]
1997
+ }
1998
+ );
1999
+ }
2000
+ function ds({
2001
+ data: t,
2002
+ title: e,
2003
+ fields: s,
2004
+ columns: r = 3,
2005
+ className: n,
2006
+ headerAction: o
2007
+ }) {
2008
+ const i = $a(s, t), c = i.some((d) => d.fields.length > 0), u = m(
2009
+ "astw:grid astw:gap-x-6 astw:gap-y-4",
2010
+ // Default: 1 column
2011
+ "astw:grid-cols-1",
2012
+ // Container queries for responsive columns
2013
+ r === 4 ? (
2014
+ // 4-column mode: 1 → 2 → 3 → 4 columns
2015
+ "astw:@[400px]:grid-cols-2 astw:@[600px]:grid-cols-3 astw:@[800px]:grid-cols-4"
2016
+ ) : (
2017
+ // 3-column mode: 1 → 2 → 3 columns
2018
+ "astw:@[400px]:grid-cols-2 astw:@[600px]:grid-cols-3"
2019
+ )
2020
+ ), w = (d) => {
2021
+ const h = d.fields.filter((p) => !0), f = d.fields.filter((p) => Fa());
2022
+ return /* @__PURE__ */ l("div", { className: "astw:space-y-4", children: [
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);
2026
+ };
2027
+ return /* @__PURE__ */ a(at, { delayDuration: 300, children: /* @__PURE__ */ l(
2028
+ "div",
2029
+ {
2030
+ className: m(
2031
+ "astw:@container astw:bg-card astw:text-card-foreground astw:rounded-xl astw:border",
2032
+ n
2033
+ ),
2034
+ children: [
2035
+ /* @__PURE__ */ l("div", { className: "astw:flex astw:items-center astw:justify-between astw:px-6 astw:py-6", children: [
2036
+ /* @__PURE__ */ a("h3", { className: "astw:text-lg astw:font-semibold astw:leading-none", children: e }),
2037
+ o && /* @__PURE__ */ a("div", { children: o })
2038
+ ] }),
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" }) })
2043
+ ]
2044
+ }
2045
+ ) });
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;
1598
2121
  export {
1599
- ya as AppShell,
1600
- Sa as AuthProvider,
1601
- Ca as CommandPalette,
1602
- He as DefaultSidebar,
1603
- Ea as Link,
1604
- Na as SidebarLayout,
1605
- Jt as defineI18nLabels,
1606
- va as defineModule,
1607
- xa as defineResource,
1608
- pa as redirectToResource,
1609
- C as useAppShell,
1610
- Ta as useAuth,
1611
- Pa as useLocation,
1612
- Ba as useNavigate,
1613
- La as useParams,
1614
- Aa as useRouteError,
1615
- Da as useSearchParams,
1616
- ce as useTheme
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
1617
2144
  };