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