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