@moondreamsdev/dreamer-ui 1.7.10-test.19 → 1.7.10-test.20
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/{Toast-B5n3P7Jb.js → Toast-DPHHf09f.js} +19 -18
- package/dist/Toast-DPHHf09f.js.map +1 -0
- package/dist/Toast-eJp5Ks3u.cjs +2 -0
- package/dist/Toast-eJp5Ks3u.cjs.map +1 -0
- package/dist/components.cjs.js +2 -2
- package/dist/components.cjs.js.map +1 -1
- package/dist/components.esm.js +685 -683
- package/dist/components.esm.js.map +1 -1
- package/dist/providers.cjs.js +1 -1
- package/dist/providers.esm.js +1 -1
- package/dist/src/components/code-block/types.d.ts +2 -0
- package/package.json +1 -1
- package/dist/Toast-B5n3P7Jb.js.map +0 -1
- package/dist/Toast-Dg-GNy7j.cjs +0 -2
- package/dist/Toast-Dg-GNy7j.cjs.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as r, Fragment as q, jsxs as b } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import D, { createContext as t, useId as H, useState as p, useEffect as g, useRef as P, useCallback as T, useMemo as E, useContext as X } from "react";
|
|
3
3
|
import { createPortal as F } from "react-dom";
|
|
4
|
-
import { X as
|
|
5
|
-
import { j as
|
|
4
|
+
import { X as G, C as J, E as K, I as Q } from "./X-CIoyLewf.js";
|
|
5
|
+
import { j as U } from "./join-BmgR_f4v.js";
|
|
6
6
|
function N(...e) {
|
|
7
7
|
return e.filter((n) => typeof n == "string" && n).join(" ").trim() || void 0;
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function V({ size: e = 15, color: n = "currentColor", className: i = "inline", ...l }) {
|
|
10
10
|
return /* @__PURE__ */ r(
|
|
11
11
|
"svg",
|
|
12
12
|
{
|
|
@@ -65,7 +65,8 @@ t(null);
|
|
|
65
65
|
t(null);
|
|
66
66
|
t(null);
|
|
67
67
|
t(null);
|
|
68
|
-
|
|
68
|
+
t(null);
|
|
69
|
+
function Y() {
|
|
69
70
|
const [e, n] = p(0);
|
|
70
71
|
return g(() => {
|
|
71
72
|
const i = setInterval(() => {
|
|
@@ -83,7 +84,7 @@ function Z() {
|
|
|
83
84
|
i
|
|
84
85
|
)) });
|
|
85
86
|
}
|
|
86
|
-
const
|
|
87
|
+
const Z = {
|
|
87
88
|
base: "",
|
|
88
89
|
primary: "bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground",
|
|
89
90
|
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/85 disabled:bg-muted/80 disabled:text-muted-foreground/80",
|
|
@@ -125,7 +126,7 @@ function R({
|
|
|
125
126
|
e === "link" && !n ? c = "fitted" : c = n || w.size;
|
|
126
127
|
const m = N(
|
|
127
128
|
"appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all",
|
|
128
|
-
|
|
129
|
+
Z[e],
|
|
129
130
|
W[c],
|
|
130
131
|
_[i],
|
|
131
132
|
l && "relative pointer-events-none",
|
|
@@ -144,7 +145,7 @@ function R({
|
|
|
144
145
|
type: s,
|
|
145
146
|
className: m,
|
|
146
147
|
children: [
|
|
147
|
-
l && /* @__PURE__ */ r(
|
|
148
|
+
l && /* @__PURE__ */ r(Y, {}),
|
|
148
149
|
/* @__PURE__ */ r("span", { className: N(l && "invisible"), children: d.children }),
|
|
149
150
|
a && !d.disabled && /* @__PURE__ */ r(
|
|
150
151
|
"a",
|
|
@@ -177,7 +178,7 @@ function ee(e, n) {
|
|
|
177
178
|
}, [e, n]);
|
|
178
179
|
}
|
|
179
180
|
function te(e, n) {
|
|
180
|
-
const i =
|
|
181
|
+
const i = P(null), l = T(() => {
|
|
181
182
|
const a = document.getElementById(e);
|
|
182
183
|
if (!a) return;
|
|
183
184
|
const o = a.querySelectorAll('[data-modal-action="true"]');
|
|
@@ -218,9 +219,9 @@ function le({
|
|
|
218
219
|
ariaLabelledBy: f,
|
|
219
220
|
ariaDescribedBy: v
|
|
220
221
|
}) {
|
|
221
|
-
const h =
|
|
222
|
+
const h = H(), k = e || `modal-${h}`, C = e ? `${e}-title` : `modal-title-${h}`, { show: z, shouldRender: y } = $(n);
|
|
222
223
|
if (te(k, y), ee(y, i), !y) return null;
|
|
223
|
-
const j = () => l ?
|
|
224
|
+
const j = () => l ? D.isValidElement(l) ? /* @__PURE__ */ r("div", { className: "mb-4", children: l }) : /* @__PURE__ */ r("h2", { className: "mb-4 text-xl font-semibold", id: C, children: l }) : null, I = () => c.length === 0 ? null : /* @__PURE__ */ r("div", { className: "mt-6 not-sm:grid gap-y-2 sm:flex sm:justify-start sm:flex-row-reverse sm:gap-x-3", children: c.map((A, B) => {
|
|
224
225
|
const { label: O, className: M, ...S } = A;
|
|
225
226
|
return /* @__PURE__ */ r(R, { className: M, type: "button", ...S, "data-modal-action": "true", children: O }, B);
|
|
226
227
|
}) });
|
|
@@ -262,7 +263,7 @@ function le({
|
|
|
262
263
|
onClick: i,
|
|
263
264
|
"data-modal-close-button": "true",
|
|
264
265
|
className: "rounded-md p-0.5 top-2.5 right-2.5 absolute opacity-80 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-gray-500 leading-0",
|
|
265
|
-
children: /* @__PURE__ */ r(
|
|
266
|
+
children: /* @__PURE__ */ r(V, { size: 18 })
|
|
266
267
|
}
|
|
267
268
|
),
|
|
268
269
|
j(),
|
|
@@ -336,15 +337,15 @@ const re = t(null), ue = () => {
|
|
|
336
337
|
}, L = {
|
|
337
338
|
info: {
|
|
338
339
|
className: "bg-blue-50 border-blue-200 text-blue-900 dark:bg-blue-800 dark:border-blue-950 dark:text-blue-100",
|
|
339
|
-
icon: /* @__PURE__ */ r(
|
|
340
|
+
icon: /* @__PURE__ */ r(Q, { size: 20 })
|
|
340
341
|
},
|
|
341
342
|
warning: {
|
|
342
343
|
className: "bg-yellow-50 border-yellow-200 text-yellow-900 dark:bg-yellow-800 dark:border-yellow-950 dark:text-yellow-100",
|
|
343
|
-
icon: /* @__PURE__ */ r(
|
|
344
|
+
icon: /* @__PURE__ */ r(K, { size: 20 })
|
|
344
345
|
},
|
|
345
346
|
error: {
|
|
346
347
|
className: "bg-red-50 border-red-200 text-red-900 dark:bg-red-800 dark:border-red-950 dark:text-red-100",
|
|
347
|
-
icon: /* @__PURE__ */ r(
|
|
348
|
+
icon: /* @__PURE__ */ r(J, { size: 20 })
|
|
348
349
|
}
|
|
349
350
|
};
|
|
350
351
|
function ce({
|
|
@@ -389,7 +390,7 @@ function ce({
|
|
|
389
390
|
{
|
|
390
391
|
role: l === "error" ? "alert" : "status",
|
|
391
392
|
"aria-live": l === "error" ? void 0 : "polite",
|
|
392
|
-
className:
|
|
393
|
+
className: U(
|
|
393
394
|
"relative flex items-start p-4 rounded-lg border shadow-lg transition-all duration-150 ease-in-out",
|
|
394
395
|
a && "pb-3",
|
|
395
396
|
v.className,
|
|
@@ -414,7 +415,7 @@ function ce({
|
|
|
414
415
|
{
|
|
415
416
|
onClick: f,
|
|
416
417
|
className: "flex-shrink-0 ml-3 p-1 rounded-md hover:bg-black/10 dark:hover:bg-white/10 focus:outline-none focus:ring-1 focus:ring-current leading-0",
|
|
417
|
-
children: /* @__PURE__ */ r(
|
|
418
|
+
children: /* @__PURE__ */ r(G, { size: 16 })
|
|
418
419
|
}
|
|
419
420
|
)
|
|
420
421
|
]
|
|
@@ -428,4 +429,4 @@ export {
|
|
|
428
429
|
N as n,
|
|
429
430
|
ue as u
|
|
430
431
|
};
|
|
431
|
-
//# sourceMappingURL=Toast-
|
|
432
|
+
//# sourceMappingURL=Toast-DPHHf09f.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Toast-DPHHf09f.js","sources":["join-BmgR_f4v.js","X-CIoyLewf.js","Toast-B5n3P7Jb.js","components.esm.js","../src/components/actionmodal/ActionModal.tsx","../src/components/tabs/TabsContext.tsx","../src/components/toast/Toast.tsx"],"sourcesContent":["function n(...t) {\n return t.filter((s) => typeof s == \"string\" && s).join(\" \").trim() || void 0;\n}\nexport {\n n as j\n};\n//# sourceMappingURL=join-BmgR_f4v.js.map\n","import { jsx as e } from \"react/jsx-runtime\";\nfunction t({\n size: C = 15,\n color: l = \"currentColor\",\n className: n = \"inline\",\n ...i\n}) {\n return /* @__PURE__ */ e(\n \"svg\",\n {\n ...i,\n width: C,\n height: C,\n className: n,\n viewBox: \"0 0 15 15\",\n xmlns: \"http://www.w3.org/2000/svg\",\n children: /* @__PURE__ */ e(\n \"path\",\n {\n d: \"M0.877075 7.49988C0.877075 3.84219 3.84222 0.877045 7.49991 0.877045C11.1576 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1576 14.1227 7.49991 14.1227C3.84222 14.1227 0.877075 11.1575 0.877075 7.49988ZM7.49991 1.82704C4.36689 1.82704 1.82708 4.36686 1.82708 7.49988C1.82708 10.6329 4.36689 13.1727 7.49991 13.1727C10.6329 13.1727 13.1727 10.6329 13.1727 7.49988C13.1727 4.36686 10.6329 1.82704 7.49991 1.82704ZM9.85358 5.14644C10.0488 5.3417 10.0488 5.65829 9.85358 5.85355L8.20713 7.49999L9.85358 9.14644C10.0488 9.3417 10.0488 9.65829 9.85358 9.85355C9.65832 10.0488 9.34173 10.0488 9.14647 9.85355L7.50002 8.2071L5.85358 9.85355C5.65832 10.0488 5.34173 10.0488 5.14647 9.85355C4.95121 9.65829 4.95121 9.3417 5.14647 9.14644L6.79292 7.49999L5.14647 5.85355C4.95121 5.65829 4.95121 5.3417 5.14647 5.14644C5.34173 4.95118 5.65832 4.95118 5.85358 5.14644L7.50002 6.79289L9.14647 5.14644C9.34173 4.95118 9.65832 4.95118 9.85358 5.14644Z\",\n fill: l,\n fillRule: \"evenodd\",\n clipRule: \"evenodd\"\n }\n )\n }\n );\n}\nfunction o({\n size: C = 15,\n color: l = \"currentColor\",\n className: n = \"inline\",\n ...i\n}) {\n return /* @__PURE__ */ e(\n \"svg\",\n {\n ...i,\n width: C,\n height: C,\n className: n,\n viewBox: \"0 0 15 15\",\n xmlns: \"http://www.w3.org/2000/svg\",\n children: /* @__PURE__ */ e(\n \"path\",\n {\n d: \"M8.4449 0.608765C8.0183 -0.107015 6.9817 -0.107015 6.55509 0.608766L0.161178 11.3368C-0.275824 12.07 0.252503 13 1.10608 13H13.8939C14.7475 13 15.2758 12.07 14.8388 11.3368L8.4449 0.608765ZM7.4141 1.12073C7.45288 1.05566 7.54712 1.05566 7.5859 1.12073L13.9798 11.8488C14.0196 11.9154 13.9715 12 13.8939 12H1.10608C1.02849 12 0.980454 11.9154 1.02018 11.8488L7.4141 1.12073ZM6.8269 4.48611C6.81221 4.10423 7.11783 3.78663 7.5 3.78663C7.88217 3.78663 8.18778 4.10423 8.1731 4.48612L8.01921 8.48701C8.00848 8.766 7.7792 8.98664 7.5 8.98664C7.2208 8.98664 6.99151 8.766 6.98078 8.48701L6.8269 4.48611ZM8.24989 10.476C8.24989 10.8902 7.9141 11.226 7.49989 11.226C7.08567 11.226 6.74989 10.8902 6.74989 10.476C6.74989 10.0618 7.08567 9.72599 7.49989 9.72599C7.9141 9.72599 8.24989 10.0618 8.24989 10.476Z\",\n fill: l,\n fillRule: \"evenodd\",\n clipRule: \"evenodd\"\n }\n )\n }\n );\n}\nfunction d({\n size: C = 15,\n color: l = \"currentColor\",\n className: n = \"inline\",\n ...i\n}) {\n return /* @__PURE__ */ e(\n \"svg\",\n {\n ...i,\n width: C,\n height: C,\n className: n,\n viewBox: \"0 0 15 15\",\n xmlns: \"http://www.w3.org/2000/svg\",\n children: /* @__PURE__ */ e(\n \"path\",\n {\n d: \"M7.49991 0.876892C3.84222 0.876892 0.877075 3.84204 0.877075 7.49972C0.877075 11.1574 3.84222 14.1226 7.49991 14.1226C11.1576 14.1226 14.1227 11.1574 14.1227 7.49972C14.1227 3.84204 11.1576 0.876892 7.49991 0.876892ZM1.82707 7.49972C1.82707 4.36671 4.36689 1.82689 7.49991 1.82689C10.6329 1.82689 13.1727 4.36671 13.1727 7.49972C13.1727 10.6327 10.6329 13.1726 7.49991 13.1726C4.36689 13.1726 1.82707 10.6327 1.82707 7.49972ZM8.24992 4.49999C8.24992 4.9142 7.91413 5.24999 7.49992 5.24999C7.08571 5.24999 6.74992 4.9142 6.74992 4.49999C6.74992 4.08577 7.08571 3.74999 7.49992 3.74999C7.91413 3.74999 8.24992 4.08577 8.24992 4.49999ZM6.00003 5.99999H6.50003H7.50003C7.77618 5.99999 8.00003 6.22384 8.00003 6.49999V9.99999H8.50003H9.00003V11H8.50003H7.50003H6.50003H6.00003V9.99999H6.50003H7.00003V6.99999H6.50003H6.00003V5.99999Z\",\n fill: l,\n fillRule: \"evenodd\",\n clipRule: \"evenodd\"\n }\n )\n }\n );\n}\nfunction h({ size: C = 15, color: l = \"currentColor\", className: n = \"inline\", ...i }) {\n return /* @__PURE__ */ e(\n \"svg\",\n {\n ...i,\n width: C,\n height: C,\n className: n,\n viewBox: \"0 0 15 15\",\n xmlns: \"http://www.w3.org/2000/svg\",\n children: /* @__PURE__ */ e(\n \"path\",\n {\n d: \"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z\",\n fill: l,\n fillRule: \"evenodd\",\n clipRule: \"evenodd\"\n }\n )\n }\n );\n}\nexport {\n t as C,\n o as E,\n d as I,\n h as X\n};\n//# sourceMappingURL=X-CIoyLewf.js.map\n","import { jsx as r, Fragment as q, jsxs as b } from \"react/jsx-runtime\";\nimport P, { createContext as t, useId as D, useState as p, useEffect as g, useRef as H, useCallback as T, useMemo as E, useContext as X } from \"react\";\nimport { createPortal as F } from \"react-dom\";\nimport { X as J, C as K, E as Q, I as U } from \"./X-CIoyLewf.js\";\nimport { j as V } from \"./join-BmgR_f4v.js\";\nfunction N(...e) {\n return e.filter((n) => typeof n == \"string\" && n).join(\" \").trim() || void 0;\n}\nfunction Y({ size: e = 15, color: n = \"currentColor\", className: i = \"inline\", ...l }) {\n return /* @__PURE__ */ r(\n \"svg\",\n {\n ...l,\n width: e,\n height: e,\n className: i,\n viewBox: \"0 0 15 15\",\n xmlns: \"http://www.w3.org/2000/svg\",\n children: /* @__PURE__ */ r(\n \"path\",\n {\n d: \"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z\",\n fill: n,\n fillRule: \"evenodd\",\n clipRule: \"evenodd\"\n }\n )\n }\n );\n}\nfunction x(...e) {\n return e.filter((n) => typeof n == \"string\" && n).join(\" \").trim() || void 0;\n}\nt(void 0);\nt(null);\nt(null);\nt(null);\nt(null);\nt(null);\nt(null);\nt(null);\nt(null);\nt(null);\nt(null);\nt(null);\nt(null);\nt(null);\nt(null);\nt(null);\nt(void 0);\nt(void 0);\nt(null);\nt(void 0);\nt(void 0);\nt(null);\nt(null);\nt(null);\nt(null);\nt(null);\nt(null);\nt(null);\nt(null);\nt(null);\nt(null);\nt(null);\nt(null);\nt(null);\nfunction Z() {\n const [e, n] = p(0);\n return g(() => {\n const i = setInterval(() => {\n n((l) => (l + 1) % 3);\n }, 500);\n return () => clearInterval(i);\n }, []), /* @__PURE__ */ r(\"div\", { className: \"absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle\", children: [0, 1, 2].map((i) => /* @__PURE__ */ r(\n \"div\",\n {\n className: N(\n \"rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current\",\n e === i && \"transform -translate-y-1\"\n )\n },\n i\n )) });\n}\nconst G = {\n base: \"\",\n primary: \"bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground\",\n secondary: \"bg-secondary text-secondary-foreground hover:bg-secondary/85 disabled:bg-muted/80 disabled:text-muted-foreground/80\",\n tertiary: \"text-primary hover:text-primary-foreground disabled:text-muted\",\n outline: \"border border-primary text-primary hover:border-primary-foreground hover:text-primary-foreground disabled:border-muted disabled:text-muted\",\n link: \"underline-offset-4 hover:underline disabled:underline disabled:text-muted\",\n destructive: \"bg-destructive text-destructive-foreground hover:bg-destructive/85 disabled:bg-muted disabled:text-muted-foreground\"\n}, W = {\n stripped: \"\",\n fitted: \"size-fit\",\n sm: \"px-2 py-1 text-sm\",\n md: \"px-4 py-2 text-base\",\n lg: \"px-6 py-3 text-lg\",\n icon: \"p-1 w-fit aspect-square\",\n full: \"p-2 w-full\"\n}, _ = {\n none: \"rounded-none\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n full: \"rounded-full\"\n}, w = {\n variant: \"primary\",\n size: \"md\",\n rounded: \"md\"\n};\nfunction R({\n variant: e = w.variant,\n size: n,\n rounded: i = w.rounded,\n loading: l,\n linkTo: a,\n linkProps: o,\n type: s = \"button\",\n className: u,\n ...d\n}) {\n let c;\n e === \"link\" && !n ? c = \"fitted\" : c = n || w.size;\n const m = N(\n \"appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all\",\n G[e],\n W[c],\n _[i],\n l && \"relative pointer-events-none\",\n a && \"relative\",\n u\n );\n return /* @__PURE__ */ b(\n \"button\",\n {\n ...d,\n role: a ? \"link\" : d.role,\n \"aria-label\": d[\"aria-label\"] || (o == null ? void 0 : o[\"aria-label\"]),\n \"aria-description\": d[\"aria-description\"] || (o == null ? void 0 : o[\"aria-description\"]),\n \"aria-disabled\": d.disabled || l,\n \"aria-busy\": l,\n type: s,\n className: m,\n children: [\n l && /* @__PURE__ */ r(Z, {}),\n /* @__PURE__ */ r(\"span\", { className: N(l && \"invisible\"), children: d.children }),\n a && !d.disabled && /* @__PURE__ */ r(\n \"a\",\n {\n ...o,\n \"aria-hidden\": !0,\n href: a,\n rel: (o == null ? void 0 : o.rel) || \"noreferrer\",\n className: \"absolute inset-0\"\n }\n )\n ]\n }\n );\n}\nfunction $(e) {\n const [n, i] = p(!1), [l, a] = p(!1);\n return g(() => {\n e ? (a(!0), setTimeout(() => i(!0), 10)) : (i(!1), setTimeout(() => a(!1), 150));\n }, [e]), { show: n, shouldRender: l };\n}\nfunction ee(e, n) {\n g(() => {\n const i = (l) => {\n l.key === \"Escape\" && e && n();\n };\n return document.addEventListener(\"keydown\", i), e && (document.body.style.overflow = \"hidden\"), () => {\n document.removeEventListener(\"keydown\", i), document.body.style.overflow = \"auto\";\n };\n }, [e, n]);\n}\nfunction te(e, n) {\n const i = H(null), l = T(() => {\n const a = document.getElementById(e);\n if (!a) return;\n const o = a.querySelectorAll('[data-modal-action=\"true\"]');\n if (o.length > 0) {\n o[0].focus();\n return;\n }\n const s = a.querySelectorAll(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])'\n );\n if (s.length > 0) {\n const u = Array.from(s).filter((d) => !(d instanceof HTMLButtonElement && d.getAttribute(\"data-modal-close-button\") === \"true\"));\n if (u.length > 0) {\n u[0].focus();\n return;\n }\n s[0].focus();\n return;\n }\n a.focus();\n }, [e]);\n g(() => (n && (i.current = document.activeElement, l()), () => {\n document.body.style.overflow = \"auto\", i.current instanceof HTMLElement && i.current.focus();\n }), [n, l]);\n}\nfunction le({\n id: e,\n isOpen: n,\n onClose: i,\n title: l,\n children: a,\n contentOnly: o = !1,\n className: s,\n overlayClassName: u,\n hideCloseButton: d = !1,\n actions: c = [],\n disableCloseOnOverlayClick: m = !1,\n ariaLabelledBy: f,\n ariaDescribedBy: v\n}) {\n const h = D(), k = e || `modal-${h}`, C = e ? `${e}-title` : `modal-title-${h}`, { show: z, shouldRender: y } = $(n);\n if (te(k, y), ee(y, i), !y) return null;\n const j = () => l ? P.isValidElement(l) ? /* @__PURE__ */ r(\"div\", { className: \"mb-4\", children: l }) : /* @__PURE__ */ r(\"h2\", { className: \"mb-4 text-xl font-semibold\", id: C, children: l }) : null, I = () => c.length === 0 ? null : /* @__PURE__ */ r(\"div\", { className: \"mt-6 not-sm:grid gap-y-2 sm:flex sm:justify-start sm:flex-row-reverse sm:gap-x-3\", children: c.map((A, B) => {\n const { label: O, className: M, ...S } = A;\n return /* @__PURE__ */ r(R, { className: M, type: \"button\", ...S, \"data-modal-action\": \"true\", children: O }, B);\n }) });\n return /* @__PURE__ */ r(q, { children: F(\n /* @__PURE__ */ r(\n \"div\",\n {\n \"aria-labelledby\": f ?? l ? C : void 0,\n \"aria-describedby\": v,\n role: \"dialog\",\n \"aria-modal\": \"true\",\n className: \"fixed inset-0 z-[100] overflow-y-auto\",\n children: /* @__PURE__ */ b(\"div\", { className: \"flex min-h-screen items-center justify-center p-4\", children: [\n /* @__PURE__ */ r(\n \"div\",\n {\n className: x(\"fixed inset-0 bg-black/20 transition-all\", u),\n onClick: () => {\n m || i();\n }\n }\n ),\n o && /* @__PURE__ */ r(\"div\", { className: x(\"relative w-fit\", s), children: a }),\n !o && /* @__PURE__ */ b(\n \"div\",\n {\n id: k,\n tabIndex: -1,\n className: x(\n \"relative w-full max-w-xl transform rounded-lg shadow-xl bg-popover transition-all p-6 focus:ring ease-in duration-75\",\n z ? \"opacity-100 scale-100\" : \"opacity-0 scale-90\",\n s\n ),\n children: [\n !d && /* @__PURE__ */ r(\n \"button\",\n {\n type: \"button\",\n onClick: i,\n \"data-modal-close-button\": \"true\",\n className: \"rounded-md p-0.5 top-2.5 right-2.5 absolute opacity-80 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-gray-500 leading-0\",\n children: /* @__PURE__ */ r(Y, { size: 18 })\n }\n ),\n j(),\n a,\n I()\n ]\n }\n )\n ] })\n }\n ),\n document.body\n ) });\n}\nfunction de({\n type: e,\n message: n,\n cancelText: i,\n confirmText: l,\n onConfirm: a,\n onClose: o,\n destructive: s = !1,\n title: u,\n ...d\n}) {\n const c = E(() => e === \"confirm\" ? {\n confirm: l || \"Confirm\",\n cancel: i || \"Cancel\",\n defaultTitle: u || \"Confirm Action\"\n } : {\n confirm: l || \"OK\",\n cancel: null,\n defaultTitle: u || \"Alert\"\n }, [e, l, u, i]), m = E(\n () => [\n ...c.cancel ? [\n {\n label: c.cancel,\n variant: \"secondary\",\n onClick: o\n }\n ] : [],\n {\n label: c.confirm,\n variant: s ? \"destructive\" : \"primary\",\n onClick: () => {\n a == null || a(), o();\n }\n }\n ],\n [c, s, a, o]\n );\n return /* @__PURE__ */ r(\n le,\n {\n ...d,\n title: u || c.defaultTitle,\n onClose: o,\n actions: m,\n disableCloseOnOverlayClick: e === \"confirm\",\n hideCloseButton: e === \"confirm\",\n children: typeof n == \"string\" ? /* @__PURE__ */ r(\"p\", { className: \"text-sm\", children: n }) : n\n }\n );\n}\nconst re = t(null), ue = () => {\n const e = X(re);\n if (!e)\n throw new Error(\"Tabs components must be used within a Tabs component\");\n return e;\n}, L = {\n info: {\n className: \"bg-blue-50 border-blue-200 text-blue-900 dark:bg-blue-800 dark:border-blue-950 dark:text-blue-100\",\n icon: /* @__PURE__ */ r(U, { size: 20 })\n },\n warning: {\n className: \"bg-yellow-50 border-yellow-200 text-yellow-900 dark:bg-yellow-800 dark:border-yellow-950 dark:text-yellow-100\",\n icon: /* @__PURE__ */ r(Q, { size: 20 })\n },\n error: {\n className: \"bg-red-50 border-red-200 text-red-900 dark:bg-red-800 dark:border-red-950 dark:text-red-100\",\n icon: /* @__PURE__ */ r(K, { size: 20 })\n }\n};\nfunction ce({\n id: e,\n title: n,\n description: i,\n type: l = \"info\",\n action: a,\n duration: o = 5e3,\n onRemove: s,\n customTypes: u,\n customComponent: d\n}) {\n const [c, m] = p(!1), f = T(() => {\n m(!0), setTimeout(() => {\n s == null || s(e);\n }, 150);\n }, [e, s]);\n if (g(() => {\n if (o > 0) {\n const h = setTimeout(() => {\n f();\n }, o);\n return () => clearTimeout(h);\n }\n }, [o, e, s, f]), d)\n return /* @__PURE__ */ r(\n d,\n {\n id: e,\n title: n,\n description: i,\n type: l,\n action: a,\n duration: o,\n onRemove: s\n }\n );\n const v = (u == null ? void 0 : u[l]) || L[l] || L.info;\n return /* @__PURE__ */ b(\n \"div\",\n {\n role: l === \"error\" ? \"alert\" : \"status\",\n \"aria-live\": l === \"error\" ? void 0 : \"polite\",\n className: V(\n \"relative flex items-start p-4 rounded-lg border shadow-lg transition-all duration-150 ease-in-out\",\n a && \"pb-3\",\n v.className,\n c ? \"opacity-0 translate-x-full\" : \"opacity-100 translate-x-0\"\n ),\n children: [\n /* @__PURE__ */ r(\"div\", { className: \"flex-shrink-0 mr-3\", children: v.icon }),\n /* @__PURE__ */ b(\"div\", { className: \"flex-grow min-w-0\", children: [\n /* @__PURE__ */ r(\"div\", { className: \"font-medium text-sm leading-5\", children: n }),\n i && /* @__PURE__ */ r(\"div\", { className: \"mt-1 text-sm opacity-90 leading-5\", children: i }),\n a && /* @__PURE__ */ r(\"div\", { className: \"mt-1.5\", children: /* @__PURE__ */ r(\n \"button\",\n {\n onClick: a.onClick,\n className: \"text-sm font-medium underline hover:no-underline focus:outline-none focus:ring-1 focus:ring-current rounded px-1 py-0.5 hover:cursor-pointer\",\n children: a.label\n }\n ) })\n ] }),\n /* @__PURE__ */ r(\n \"button\",\n {\n onClick: f,\n className: \"flex-shrink-0 ml-3 p-1 rounded-md hover:bg-black/10 dark:hover:bg-white/10 focus:outline-none focus:ring-1 focus:ring-current leading-0\",\n children: /* @__PURE__ */ r(J, { size: 16 })\n }\n )\n ]\n }\n );\n}\nexport {\n de as A,\n ce as T,\n re as a,\n N as n,\n ue as u\n};\n//# sourceMappingURL=Toast-B5n3P7Jb.js.map\n","import { jsxs as E, jsx as i, Fragment as Y } from \"react/jsx-runtime\";\nimport G, { useId as P, useState as C, createElement as ze, useEffect as R, useRef as B, useCallback as T, useMemo as q, isValidElement as De, cloneElement as Se } from \"react\";\nimport { j as N } from \"./join-BmgR_f4v.js\";\nimport { f as $e, g as Ae, h as Te, b as pe, D as Re, W as je, j as Le, i as Ve, C as Be, a as We, c as Ke, k as Me, E as Fe, Q as Pe, d as Ge, e as He } from \"./Window-7myUuX6Y.js\";\nimport { n as L, a as Ze, u as ve } from \"./Toast-B5n3P7Jb.js\";\nimport { A as zr, T as $r } from \"./Toast-B5n3P7Jb.js\";\nimport { createPortal as ce } from \"react-dom\";\nimport { downloadFile as _e } from \"./utils.esm.js\";\nimport { E as qe, X as ge } from \"./X-CIoyLewf.js\";\nfunction me({\n id: o,\n title: a,\n content: t,\n children: r,\n className: e = \"\",\n disabled: n = !1,\n isOpen: s = !1,\n onToggle: l,\n triggerClassName: d = \"\",\n bodyClassName: m = \"\"\n}) {\n const f = P(), c = o || `accordion-item-${f}`, b = `${c}-header`, u = `${c}-panel`, p = () => {\n !n && l && l();\n }, v = (h) => {\n (h.key === \"Enter\" || h.key === \" \") && (h.preventDefault(), p());\n };\n return /* @__PURE__ */ E(\"div\", { className: N(\"border-b border-gray-200\", n && \"opacity-60 cursor-not-allowed\", e), children: [\n /* @__PURE__ */ E(\n \"button\",\n {\n id: b,\n type: \"button\",\n className: N(\n \"w-full text-left py-3 px-4 flex justify-between items-center focus:outline focus:outline-secondary\",\n n ? \"cursor-not-allowed\" : \"hover:bg-gray-50/10 cursor-pointer\",\n d\n ),\n \"aria-expanded\": s,\n \"aria-controls\": u,\n disabled: n,\n onClick: p,\n onKeyDown: v,\n children: [\n /* @__PURE__ */ i(\"span\", { children: a }),\n /* @__PURE__ */ i(\n \"span\",\n {\n className: N(\n \"transform transition-transform duration-300 ease-linear\",\n s ? \"rotate-180\" : \"rotate-0\"\n ),\n \"aria-hidden\": \"true\",\n children: /* @__PURE__ */ i($e, { size: 18 })\n }\n )\n ]\n }\n ),\n /* @__PURE__ */ i(\n \"div\",\n {\n id: u,\n role: \"region\",\n \"aria-labelledby\": b,\n className: N(\n \"transition-all duration-300 ease-linear px-4\",\n s ? \"max-h-96 opacity-100 overflow-auto py-3\" : \"max-h-0 opacity-0 overflow-hidden\",\n m\n ),\n children: s && (r || t)\n }\n )\n ] });\n}\nfunction Ot({\n id: o,\n items: a = [],\n children: t,\n className: r = \"\",\n itemClassName: e = \"\",\n allowMultiple: n = !1,\n defaultOpenItems: s = [],\n triggersClassName: l = \"\",\n bodiesClassName: d = \"\"\n}) {\n const m = P(), f = o || `accordion-group-${m}`, [c, b] = C(new Set(s)), u = (h) => {\n b((y) => {\n const x = new Set(y);\n return x.has(h) ? x.delete(h) : (n || x.clear(), x.add(h)), x;\n });\n }, p = (h) => `${m}-item-${h}`, v = (h) => c.has(h);\n return /* @__PURE__ */ E(\"div\", { id: f, className: r, children: [\n a.length > 0 && a.map((h, y) => {\n const x = h.id || p(y);\n return /* @__PURE__ */ i(\n me,\n {\n id: x,\n title: h.title,\n content: h.content,\n disabled: h.disabled,\n isOpen: v(x),\n onToggle: () => u(x),\n className: e,\n triggerClassName: l,\n bodyClassName: d\n },\n x\n );\n }),\n a.length === 0 && t && G.Children.map(t, (h, y) => {\n if (G.isValidElement(h) && h.type === me) {\n const x = h.props.id || p(y);\n return /* @__PURE__ */ ze(\n me,\n {\n ...h.props,\n key: x,\n id: x,\n className: N(e, h.props.className),\n isOpen: v(x),\n onToggle: () => u(x),\n triggerClassName: N(l, h.props.triggerClassName),\n bodyClassName: N(d, h.props.bodyClassName)\n }\n );\n }\n return null;\n })\n ] });\n}\nfunction Ue() {\n const [o, a] = C(0);\n return R(() => {\n const t = setInterval(() => {\n a((r) => (r + 1) % 3);\n }, 500);\n return () => clearInterval(t);\n }, []), /* @__PURE__ */ i(\"div\", { className: \"absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle\", children: [0, 1, 2].map((t) => /* @__PURE__ */ i(\n \"div\",\n {\n className: N(\n \"rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current\",\n o === t && \"transform -translate-y-1\"\n )\n },\n t\n )) });\n}\nconst Xe = {\n base: \"\",\n primary: \"bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground\",\n secondary: \"bg-secondary text-secondary-foreground hover:bg-secondary/85 disabled:bg-muted/80 disabled:text-muted-foreground/80\",\n tertiary: \"text-primary hover:text-primary-foreground disabled:text-muted\",\n outline: \"border border-primary text-primary hover:border-primary-foreground hover:text-primary-foreground disabled:border-muted disabled:text-muted\",\n link: \"underline-offset-4 hover:underline disabled:underline disabled:text-muted\",\n destructive: \"bg-destructive text-destructive-foreground hover:bg-destructive/85 disabled:bg-muted disabled:text-muted-foreground\"\n}, Je = {\n stripped: \"\",\n fitted: \"size-fit\",\n sm: \"px-2 py-1 text-sm\",\n md: \"px-4 py-2 text-base\",\n lg: \"px-6 py-3 text-lg\",\n icon: \"p-1 w-fit aspect-square\",\n full: \"p-2 w-full\"\n}, Qe = {\n none: \"rounded-none\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n full: \"rounded-full\"\n}, he = {\n variant: \"primary\",\n size: \"md\",\n rounded: \"md\"\n};\nfunction Ye({\n variant: o = he.variant,\n size: a,\n rounded: t = he.rounded,\n loading: r,\n linkTo: e,\n linkProps: n,\n type: s = \"button\",\n className: l,\n ...d\n}) {\n let m;\n o === \"link\" && !a ? m = \"fitted\" : m = a || he.size;\n const c = N(\n \"appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all\",\n Xe[o],\n Je[m],\n Qe[t],\n r && \"relative pointer-events-none\",\n e && \"relative\",\n l\n );\n return /* @__PURE__ */ E(\n \"button\",\n {\n ...d,\n role: e ? \"link\" : d.role,\n \"aria-label\": d[\"aria-label\"] || (n == null ? void 0 : n[\"aria-label\"]),\n \"aria-description\": d[\"aria-description\"] || (n == null ? void 0 : n[\"aria-description\"]),\n \"aria-disabled\": d.disabled || r,\n \"aria-busy\": r,\n type: s,\n className: c,\n children: [\n r && /* @__PURE__ */ i(Ue, {}),\n /* @__PURE__ */ i(\"span\", { className: N(r && \"invisible\"), children: d.children }),\n e && !d.disabled && /* @__PURE__ */ i(\n \"a\",\n {\n ...n,\n \"aria-hidden\": !0,\n href: e,\n rel: (n == null ? void 0 : n.rel) || \"noreferrer\",\n className: \"absolute inset-0\"\n }\n )\n ]\n }\n );\n}\nfunction Oe({\n totalItems: o,\n itemsToShow: a,\n infinite: t,\n autoScroll: r,\n scrollInterval: e,\n pauseScrollOnHover: n,\n currentIndex: s,\n onIndexChange: l\n}) {\n const [d, m] = C(s || 0), [f, c] = C(!1), b = B(null), u = Math.ceil(o / a), p = t || d > 0, v = t || d < u - 1, h = T(\n (g) => {\n const w = Math.max(0, Math.min(g, u - 1));\n m(w), l == null || l(w);\n },\n [u, l]\n ), y = T(() => {\n if (p) {\n const g = d === 0 && t ? u - 1 : d - 1;\n h(g);\n }\n }, [d, p, t, u, h]), x = T(() => {\n if (v) {\n const g = d === u - 1 && t ? 0 : d + 1;\n h(g);\n }\n }, [d, v, t, u, h]);\n return R(() => {\n s !== void 0 && s !== d && m(s);\n }, [s, d]), R(() => {\n if (!r) return;\n const g = () => {\n b.current = setInterval(() => {\n n && f || x();\n }, e);\n }, w = () => {\n b.current && (clearInterval(b.current), b.current = null);\n };\n return !f || !n ? g() : w(), w;\n }, [r, e, n, f, x]), R(() => {\n m(0);\n }, [a]), {\n currentSlide: d,\n canGoPrev: p,\n canGoNext: v,\n goToPrev: y,\n goToNext: x,\n goToSlide: h,\n isHovered: f,\n setIsHovered: c\n };\n}\nconst te = {\n xs: 0,\n // Smaller than `sm`\n sm: 640,\n // Tailwind's `sm` breakpoint: `@media (min-width: 640px)`\n md: 768,\n // Tailwind's `md` breakpoint: `@media (min-width: 768px)`\n lg: 1024,\n // Tailwind's `lg` breakpoint: `@media (min-width: 1024px)`\n xl: 1280,\n // Tailwind's `xl` breakpoint: `@media (min-width: 1280px)`\n \"2xl\": 1536\n // Tailwind's `2xl` breakpoint: `@media (min-width: 1536px)`\n};\nfunction et() {\n const [o, a] = C(), [t, r] = C(0), e = (n) => te[n];\n return R(() => {\n const n = (l) => l >= te[\"2xl\"] ? \"2xl\" : l >= te.xl ? \"xl\" : l >= te.lg ? \"lg\" : l >= te.md ? \"md\" : l >= te.sm ? \"sm\" : \"xs\";\n a(n(window.innerWidth)), r(window.innerWidth);\n const s = () => {\n a(n(window.innerWidth)), r(window.innerWidth);\n };\n return window.addEventListener(\"resize\", s), () => {\n window.removeEventListener(\"resize\", s);\n };\n }, []), { screenSize: o, screenWidth: t, getBreakpoint: e };\n}\nconst ae = {\n sm: {\n button: \"h-6 w-6 text-xs\",\n icon: \"size-3\"\n },\n md: {\n button: \"h-8 w-8 text-sm\",\n icon: \"size-4\"\n },\n lg: {\n button: \"h-10 w-10 text-lg\",\n icon: \"size-5\"\n }\n}, xe = {\n default: \"bg-accent text-accent-foreground hover:bg-accent-foreground hover:text-accent\",\n outline: \"border border-border bg-background hover:bg-accent hover:text-accent-foreground hover:border-accent\",\n ghost: \"hover:text-accent\"\n}, oe = {\n aligned: {\n prev: \"absolute top-1/2 -translate-x-1/2 -translate-y-1/2 z-10\",\n next: \"absolute right-0 top-1/2 translate-x-1/2 -translate-y-1/2 z-10\"\n },\n exterior: {\n prev: \"absolute -left-10 top-1/2 -translate-y-1/2 z-10\",\n next: \"absolute -right-10 top-1/2 -translate-y-1/2 z-10\"\n },\n interior: {\n prev: \"absolute left-2 top-1/2 -translate-y-1/2 z-10\",\n next: \"absolute right-2 top-1/2 -translate-y-1/2 z-10\"\n }\n};\nfunction er({\n children: o,\n id: a,\n ref: t,\n className: r,\n autoScroll: e = !1,\n scrollInterval: n = 3e3,\n pauseScrollOnHover: s = !0,\n currentIndex: l,\n onIndexChange: d,\n hidePrevNext: m = !1,\n hideDots: f = !1,\n itemsToShow: c = 1,\n buttonSize: b = \"md\",\n buttonVariant: u = \"default\",\n buttonPosition: p = \"exterior\",\n infinite: v = !0,\n prevButton: h,\n nextButton: y,\n itemsClassName: x,\n containerClassName: g,\n dotsClassName: w,\n gap: k = 8\n}) {\n var W, re;\n const I = B(null), D = G.Children.toArray(o).filter(G.isValidElement), $ = D.length, { screenSize: M } = et(), j = q(() => {\n if (typeof c == \"number\")\n return c;\n if (typeof c == \"object\" && c && M) {\n const Q = [\"2xl\", \"xl\", \"lg\", \"md\", \"sm\", \"xs\"], F = Q.indexOf(M);\n for (let ee = F; ee < Q.length; ee++) {\n const ne = Q[ee];\n if (c[ne] !== void 0)\n return c[ne];\n }\n }\n return 1;\n }, [c, M]), { currentSlide: H, canGoPrev: K, canGoNext: S, goToPrev: z, goToNext: V, goToSlide: Z, setIsHovered: U } = Oe({\n totalItems: $,\n itemsToShow: j,\n infinite: v,\n autoScroll: e,\n scrollInterval: n,\n pauseScrollOnHover: s,\n currentIndex: l,\n onIndexChange: d\n }), J = T(\n (Q) => {\n if (j === 1)\n return { leftWidth: 0, rightWidth: 0, widthReduction: 0 };\n const F = k * (j - 1) / j;\n return Q % j === 0 ? { leftWidth: 0, rightWidth: k / 2, widthReduction: F } : Q % j === j - 1 ? { leftWidth: k / 2, rightWidth: 0, widthReduction: F } : { leftWidth: k / 2, rightWidth: k / 2, widthReduction: F };\n },\n [j, k]\n ), _ = () => {\n z();\n }, O = () => {\n V();\n }, de = () => {\n s && U(!0);\n }, ue = () => {\n s && U(!1);\n }, fe = -(H * (100 / $) * j), A = N(\n \"inline-flex items-center justify-center rounded-md font-medium transition-all focus-visible:outline-none focus-visible:ring focus-visible:ring-ring disabled:pointer-events-none\",\n p === \"aligned\" ? \"disabled:opacity-90\" : \"disabled:opacity-50\"\n );\n return /* @__PURE__ */ E(\"div\", { className: N(\"relative\", r), \"data-carousel-wrapper\": \"true\", children: [\n !m && /* @__PURE__ */ i(Y, { children: h ? G.cloneElement(\n h,\n {\n onClick: _,\n disabled: !K,\n className: N(\n ((W = h.props) == null ? void 0 : W.className) || \"\",\n oe[p].prev\n ),\n role: \"button\",\n \"aria-disabled\": !K,\n \"aria-label\": \"Previous slide\",\n \"data-carousel-prev\": \"true\"\n }\n ) : /* @__PURE__ */ i(\n \"button\",\n {\n type: \"button\",\n onClick: _,\n disabled: !K,\n className: N(\n A,\n ae[b].button,\n xe[u],\n oe[p].prev\n ),\n \"aria-disabled\": !K,\n \"aria-label\": \"Previous slide\",\n \"data-carousel-prev\": \"true\",\n children: /* @__PURE__ */ i(Ae, { className: ae[b].icon })\n }\n ) }),\n /* @__PURE__ */ E(\n \"div\",\n {\n id: a,\n ref: t,\n className: N(\"relative overflow-hidden\", g),\n onMouseEnter: de,\n onMouseLeave: ue,\n \"data-carousel\": \"true\",\n \"data-current-index\": H,\n \"data-items-to-show\": j,\n \"data-auto-scroll\": e,\n \"data-button-position\": p,\n children: [\n /* @__PURE__ */ i(\n \"div\",\n {\n ref: I,\n className: \"flex transition-transform duration-300 ease-in-out\",\n style: {\n transform: `translateX(${fe}%)`,\n width: `${$ / j * 100}%`\n },\n children: D.map((Q, F) => {\n const { leftWidth: ee, rightWidth: ne, widthReduction: Ie } = J(F);\n return /* @__PURE__ */ i(\n \"div\",\n {\n className: N(\"flex-shrink-0\", x),\n style: {\n width: `calc(${100 / $}% - ${Ie}px)`,\n marginRight: ne > 0 ? `${ne}px` : void 0,\n marginLeft: ee > 0 ? `${ee}px` : void 0\n },\n \"data-slide-index\": F,\n children: Q\n },\n F\n );\n })\n }\n ),\n !f && /* @__PURE__ */ i(\"div\", { className: \"absolute bottom-4 left-1/2 -translate-x-1/2 flex space-x-2\", children: Array.from({ length: Math.ceil($ / j) }).map((Q, F) => /* @__PURE__ */ i(\n \"button\",\n {\n type: \"button\",\n onClick: () => Z(F),\n className: N(\n \"w-2 h-2 rounded-full transition-colors duration-200\",\n F === H ? \"bg-accent\" : \"bg-muted hover:bg-muted-foreground/50\",\n w\n ),\n \"aria-label\": `Go to slide ${F + 1}`,\n \"data-carousel-dot\": F\n },\n F\n )) })\n ]\n }\n ),\n !m && /* @__PURE__ */ i(Y, { children: y ? G.cloneElement(\n y,\n {\n onClick: O,\n disabled: !S,\n className: N(\n ((re = y.props) == null ? void 0 : re.className) || \"\",\n oe[p].next\n ),\n role: \"button\",\n \"aria-disabled\": !S,\n \"aria-label\": \"Next slide\",\n \"data-carousel-next\": \"true\"\n }\n ) : /* @__PURE__ */ i(\n \"button\",\n {\n type: \"button\",\n onClick: O,\n disabled: !S,\n className: N(\n A,\n ae[b].button,\n xe[u],\n oe[p].next\n ),\n \"aria-disabled\": !S,\n \"aria-label\": \"Next slide\",\n \"data-carousel-next\": \"true\",\n children: /* @__PURE__ */ i(Te, { className: ae[b].icon })\n }\n ) })\n ] });\n}\nfunction tt(o) {\n const [a, t] = C(\"\"), r = T((e) => {\n let n = e, s = \"\";\n for (; n && !s; ) {\n const l = window.getComputedStyle(n).backgroundColor;\n l && l !== \"transparent\" && l !== \"rgba(0, 0, 0, 0)\" && (s = l), n = n.parentElement;\n }\n return s || \"transparent\";\n }, []);\n return R(() => {\n const e = document.getElementById(o);\n if (e) {\n const n = r(e.parentElement);\n t(n);\n }\n }, [o, r]), a;\n}\nfunction tr({\n ref: o,\n id: a,\n size: t = 20,\n color: r,\n filled: e = !1,\n rounded: n = !0,\n checked: s = !1,\n onCheckedChange: l,\n disabled: d,\n className: m = \"\",\n ...f\n}) {\n const c = P(), b = q(() => a || `checkbox-${c}`, [a, c]), u = tt(b), [p, v] = C(s);\n R(() => {\n v(s);\n }, [s]);\n const h = () => {\n d || (v(!p), l == null || l(!p));\n }, y = (g) => {\n g.key === \" \" && (g.preventDefault(), h());\n }, x = N(\n \"flex items-center justify-center border outline outline-transparent focus:outline-current focus:outline-offset-2\",\n n && \"rounded\",\n d && \"opacity-40 cursor-not-allowed\",\n !d && \"cursor-pointer\",\n m\n );\n return /* @__PURE__ */ i(\n \"button\",\n {\n id: b,\n type: \"button\",\n ref: o,\n tabIndex: 0,\n role: \"checkbox\",\n onClick: h,\n \"aria-checked\": p,\n \"aria-disabled\": d,\n onKeyDownCapture: y,\n style: {\n width: t,\n height: t,\n color: r,\n backgroundColor: p && e ? \"currentcolor\" : \"transparent\"\n },\n className: x,\n ...f,\n children: p && /* @__PURE__ */ i(pe, { size: t, color: e ? u : void 0 })\n }\n );\n}\nfunction rr({\n children: o,\n className: a,\n linkTo: t,\n linkProps: r,\n onButtonClick: e,\n buttonProps: n,\n ...s\n}) {\n return t && e && console.warn('Clickable: Both \"linkTo\" and \"onButtonClick\" props are provided. Only \"linkTo\" will be used.'), /* @__PURE__ */ E(\"div\", { className: N(\"relative w-fit\", a), ...s, children: [\n o,\n t && /* @__PURE__ */ i(\n \"a\",\n {\n ...r,\n rel: (r == null ? void 0 : r.rel) || \"noreferrer\",\n href: t,\n className: N(\"absolute inset-0\", r == null ? void 0 : r.className)\n }\n ),\n !t && e && /* @__PURE__ */ i(\n \"button\",\n {\n ...n,\n type: \"button\",\n onClick: e,\n className: N(\"absolute inset-0 cursor-pointer\", n == null ? void 0 : n.className)\n }\n )\n ] });\n}\nconst rt = {\n keyword: \"text-purple-400 font-semibold\",\n type: \"text-cyan-400 font-medium\",\n string: \"text-green-400\",\n \"jsx-bracket\": \"text-gray-400\",\n \"jsx-tag\": \"text-blue-400 font-medium\",\n \"jsx-attribute\": \"text-amber-400\",\n \"jsx-brace\": \"text-yellow-400\",\n jsx: \"text-blue-400 font-medium\",\n // fallback for old jsx type\n property: \"text-amber-400\",\n number: \"text-orange-400 font-medium\",\n comment: \"text-gray-500 italic\",\n function: \"text-rose-400 font-semibold\",\n hook: \"text-rose-400 font-semibold\",\n operator: \"text-gray-300\",\n plain: \"text-gray-100\"\n}, nt = {\n key: \"text-purple-400 font-semibold\",\n string: \"text-green-400\",\n number: \"text-orange-400 font-medium\",\n boolean: \"text-cyan-400 font-medium\",\n punctuation: \"text-gray-400\",\n plain: \"text-gray-100\"\n}, at = {\n keyword: \"text-rose-400\",\n comment: \"text-gray-400/80\",\n command: \"text-blue-400\",\n variable: \"text-cyan-400\",\n string: \"text-yellow-400\",\n option: \"text-purple-400\",\n plain: \"text-gray-100\"\n};\nfunction ot(o) {\n const a = /* @__PURE__ */ new Set([\"for\", \"in\", \"do\", \"done\", \"else\", \"if\", \"fi\", \"then\", \"while\", \"until\", \"case\", \"esac\"]), t = [], r = o;\n if (r.trim() === \"\")\n return t.push({ text: \" \", type: \"plain\" }), t;\n if (r.trim().startsWith(\"#\"))\n return t.push({ text: r, type: \"comment\" }), t;\n const e = /([a-zA-Z_]\\w*=?|\"[^\"]*\"|'[^']*'|\\$[\\w_]+|--?[\\w-]+|#.*|\\s+|[^\\s]+)/g;\n let n;\n for (; (n = e.exec(r)) !== null; ) {\n const s = n[0];\n /^\\$[\\w_]+$/.test(s) ? t.push({ text: s, type: \"variable\" }) : /^[a-zA-Z_]\\w*=$/.test(s) ? t.push({ text: s, type: \"variable\" }) : /^\"[^\"]*\"$/.test(s) || /^'[^']*'$/.test(s) ? t.push({ text: s, type: \"string\" }) : /^--?[\\w-]+$/.test(s) ? t.push({ text: s, type: \"option\" }) : /^#.*$/.test(s) ? t.push({ text: s, type: \"comment\" }) : /^\\s+$/.test(s) ? t.push({ text: s, type: \"plain\" }) : a.has(s) ? t.push({ text: s, type: \"keyword\" }) : t.push({ text: s, type: \"command\" });\n }\n return t;\n}\nfunction st(o) {\n const a = /(\"[^\"]*\")\\s*(:)|(\"[^\"]*\")|(\\d+)|(true|false|null)|(\\{|\\}|\\[|\\]|,)/g, t = [];\n let r = 0, e;\n for (; (e = a.exec(o)) !== null; )\n e.index > r && t.push({ text: o.slice(r, e.index), type: \"plain\" }), e[1] && e[2] ? (t.push({ text: e[1], type: \"key\" }), t.push({ text: e[2], type: \"punctuation\" })) : e[3] ? t.push({ text: e[3], type: \"string\" }) : e[4] ? t.push({ text: e[4], type: \"number\" }) : e[5] ? t.push({ text: e[5], type: \"boolean\" }) : e[6] && t.push({ text: e[6], type: \"punctuation\" }), r = a.lastIndex;\n return r < o.length && t.push({ text: o.slice(r), type: \"plain\" }), t;\n}\nfunction it(o, a = !1, t = 0) {\n const r = [];\n let e = o, n = a, s = t;\n for (; e.length > 0; ) {\n const l = e.match(/^\\/\\*[\\s\\S]*?\\*\\//);\n if (l) {\n r.push({ text: l[0], type: \"comment\" }), e = e.slice(l[0].length);\n continue;\n }\n const d = e.match(/^\\/\\/.*$/m);\n if (d) {\n r.push({ text: d[0], type: \"comment\" }), e = e.slice(d[0].length);\n continue;\n }\n const m = e.match(/^(`[^`]*`|\"[^\"]*\"|'[^']*')/);\n if (m) {\n r.push({ text: m[0], type: \"string\" }), e = e.slice(m[0].length);\n continue;\n }\n const f = e.match(/^<([a-zA-Z][a-zA-Z0-9]*)/);\n if (f) {\n r.push({ text: \"<\", type: \"jsx-bracket\" }), r.push({ text: f[1], type: \"jsx-tag\" }), e = e.slice(f[0].length), n = !0;\n continue;\n }\n const c = e.match(/^<\\/([a-zA-Z][a-zA-Z0-9]*)>/);\n if (c) {\n r.push({ text: \"</\", type: \"jsx-bracket\" }), r.push({ text: c[1], type: \"jsx-tag\" }), r.push({ text: \">\", type: \"jsx-bracket\" }), e = e.slice(c[0].length), n = !1;\n continue;\n }\n if (e.match(/^\\/?>/)) {\n const I = e.match(/^(\\/?>\\s*)/);\n if (I) {\n r.push({ text: I[1].trim(), type: \"jsx-bracket\" }), e = e.slice(I[1].length), I[1].includes(\">\") && (n = !1);\n continue;\n }\n }\n const b = e.match(/^([a-zA-Z][a-zA-Z0-9]*)(\\s*)(=)/);\n if (b && n && s === 0) {\n r.push({ text: b[1], type: \"jsx-attribute\" }), b[2] && r.push({ text: b[2], type: \"plain\" }), r.push({ text: \"=\", type: \"plain\" }), e = e.slice(b[0].length);\n continue;\n }\n const u = e.match(/^[{}]/);\n if (u) {\n r.push({ text: u[0], type: \"jsx-brace\" }), u[0] === \"{\" ? s++ : u[0] === \"}\" && s--, e = e.slice(1);\n continue;\n }\n const p = e.match(/^\\s+/);\n if (p) {\n r.push({ text: p[0], type: \"plain\" }), e = e.slice(p[0].length);\n continue;\n }\n const v = e.match(/^(=>|===|!==|==|!=|<=|>=|&&|\\|\\||[+\\-*/%=<>!&|^~?:;,()[\\]{}.])/);\n if (v) {\n r.push({ text: v[0], type: \"operator\" }), e = e.slice(v[0].length);\n continue;\n }\n const h = e.match(\n /^(const|let|var|function|if|else|for|while|return|import|export|class|extends|interface|type|enum|async|await|public|private|protected|static|from|as|default|new|this|super|try|catch|finally|throw|break|continue|switch|case|typeof|instanceof)\\b/\n );\n if (h) {\n r.push({ text: h[0], type: \"keyword\" }), e = e.slice(h[0].length);\n continue;\n }\n const y = e.match(/^(use[A-Z][a-zA-Z]*)\\b/);\n if (y) {\n r.push({ text: y[0], type: \"hook\" }), e = e.slice(y[0].length);\n continue;\n }\n const x = e.match(/^([a-zA-Z_$][a-zA-Z0-9_$]*)\\s*(?=(\\?\\.)?\\()/);\n if (x) {\n r.push({ text: x[1], type: \"function\" }), e = e.slice(x[1].length);\n continue;\n }\n const g = e.match(\n /^(string|number|boolean|object|any|void|never|unknown|null|undefined|Promise|Array|React\\.FC|FC|JSX\\.Element|HTMLElement|Event|MouseEvent|KeyboardEvent|ChangeEvent)\\b/\n );\n if (g) {\n r.push({ text: g[0], type: \"type\" }), e = e.slice(g[0].length);\n continue;\n }\n const w = e.match(/^(\\d+\\.?\\d*)/);\n if (w) {\n r.push({ text: w[0], type: \"number\" }), e = e.slice(w[0].length);\n continue;\n }\n const k = e.match(/^([a-zA-Z_$][a-zA-Z0-9_$]*)\\s*(?=:)/);\n if (k && !n) {\n r.push({ text: k[1], type: \"property\" }), e = e.slice(k[1].length);\n continue;\n }\n r.push({ text: e[0], type: \"plain\" }), e = e.slice(1);\n }\n return r;\n}\nfunction lt(o, a) {\n const t = {\n ...at,\n ...a\n };\n return o.map((r, e) => {\n const n = ot(r);\n return /* @__PURE__ */ i(\"div\", { className: \"leading-6\", children: n.map((s, l) => /* @__PURE__ */ i(\"span\", { className: t[s.type] || \"text-gray-100\", children: s.text }, l)) }, e);\n });\n}\nfunction ct(o, a) {\n const t = { ...nt, ...a };\n return o.map((r, e) => /* @__PURE__ */ i(\"div\", { className: \"leading-6\", children: st(r).map((n, s) => /* @__PURE__ */ i(\"span\", { className: t[n.type] || \"text-gray-100\", children: n.text }, s)) }, e));\n}\nfunction dt(o, a) {\n const t = { ...rt, ...a };\n let r = !1, e = 0;\n return o.map((n, s) => {\n if (n.trim() === \"\")\n return /* @__PURE__ */ i(\"div\", { className: \"leading-6\", children: \" \" }, s);\n const l = it(n, r, e);\n n.includes(\"<\") && n.match(/<[a-zA-Z]/) && (r = !0), n.includes(\">\") && !n.includes(\"<\") && (r = !1, e = 0);\n const d = (n.match(/\\{/g) || []).length, m = (n.match(/\\}/g) || []).length;\n return e += d - m, e < 0 && (e = 0), /* @__PURE__ */ i(\"div\", { className: \"leading-6\", children: l.map((f, c) => /* @__PURE__ */ i(\"span\", { className: t[f.type] || \"text-gray-100\", children: f.text }, c)) }, s);\n });\n}\nfunction ut(o) {\n const [a, t] = C(!1), r = T(async () => {\n try {\n await navigator.clipboard.writeText(o), t(!0), setTimeout(() => t(!1), 3e3);\n } catch (e) {\n console.error(\"Failed to copy code:\", e);\n }\n }, [o]);\n return { copied: a, handleCopy: r };\n}\nfunction ft(o, a) {\n const t = B(null), r = B(null);\n return R(() => {\n if (o) {\n t.current = document.activeElement, document.body.style.overflow = \"hidden\", setTimeout(() => {\n var n;\n (n = r.current) == null || n.focus();\n }, 100);\n const e = (n) => {\n n.key === \"Escape\" && a(!1);\n };\n return document.addEventListener(\"keydown\", e), () => {\n document.removeEventListener(\"keydown\", e), document.body.style.overflow = \"\";\n };\n } else t.current && (t.current.focus(), t.current = null);\n }, [o, a]), { containerRef: r };\n}\nfunction mt(o, a, t, r) {\n return { handleKeyDown: T(\n (n) => {\n n.key === \"c\" && (n.metaKey || n.ctrlKey) && o ? (n.preventDefault(), t()) : n.key === \"f\" && a && (n.preventDefault(), r());\n },\n [o, a, t, r]\n ) };\n}\nfunction ht(o) {\n switch (o) {\n case \"typescript\":\n case \"ts\":\n return \"ts\";\n case \"tsx\":\n return \"tsx\";\n case \"json\":\n return \"json\";\n case \"bash\":\n case \"sh\":\n return \"sh\";\n default:\n return \"txt\";\n }\n}\nfunction nr({\n code: o,\n language: a = \"typescript\",\n allowCopy: t = !0,\n allowDownload: r = !1,\n allowFullscreen: e = !1,\n filename: n,\n showTrafficLights: s = !0,\n showLineNumbers: l = !1,\n hideHeader: d = !1,\n hideFiletype: m = !1,\n maxHeight: f,\n tokenClasses: c,\n className: b,\n id: u,\n ref: p,\n ...v\n}) {\n const [h, y] = C(!1), { containerRef: x } = ft(h, y), { copied: g, handleCopy: w } = ut(o), k = T(() => {\n const z = n || `code.${ht(a)}`;\n _e(o, z);\n }, [o, n, a]), I = T(() => {\n y((z) => !z);\n }, []), { handleKeyDown: D } = mt(t, e, w, I), $ = q(() => o.split(`\n`), [o]), M = T(\n (z = !0) => /* @__PURE__ */ E(\"div\", { className: N(\"flex items-center space-x-2\", !z && \"absolute top-2 right-2 z-10\"), children: [\n !m && /* @__PURE__ */ i(\n \"span\",\n {\n className: \"text-xs text-gray-400 uppercase tracking-wide font-medium\",\n \"aria-label\": `Code language: ${a}`,\n children: a\n }\n ),\n e && /* @__PURE__ */ i(\n \"button\",\n {\n onClick: I,\n className: \"p-1.5 leading-0 text-gray-400 hover:text-white hover:bg-gray-700 rounded transition-colors motion-reduce:transition-none min-h-[44px] min-w-[44px] flex items-center justify-center md:min-h-auto md:min-w-auto md:p-1.5\",\n title: h ? \"Exit fullscreen\" : \"Fullscreen\",\n \"aria-label\": h ? \"Exit fullscreen mode\" : \"Enter fullscreen mode\",\n \"aria-pressed\": h,\n type: \"button\",\n children: h ? /* @__PURE__ */ i(Re, { size: 14 }) : /* @__PURE__ */ i(je, { size: 14 })\n }\n ),\n r && /* @__PURE__ */ i(\n \"button\",\n {\n onClick: k,\n className: \"p-1.5 leading-0 text-gray-400 hover:text-white hover:bg-gray-700 rounded transition-colors motion-reduce:transition-none min-h-[44px] min-w-[44px] flex items-center justify-center md:min-h-auto md:min-w-auto md:p-1.5\",\n title: \"Download code\",\n \"aria-label\": \"Download code as file\",\n type: \"button\",\n children: /* @__PURE__ */ i(Le, { size: 14 })\n }\n ),\n t && /* @__PURE__ */ i(\n \"button\",\n {\n onClick: w,\n className: \"p-1.5 leading-0 text-gray-400 hover:text-white hover:bg-gray-700 rounded transition-colors motion-reduce:transition-none min-h-[44px] min-w-[44px] flex items-center justify-center md:min-h-auto md:min-w-auto md:p-1.5\",\n title: g ? \"Code copied!\" : \"Copy code\",\n \"aria-label\": g ? \"Code copied to clipboard\" : \"Copy code to clipboard\",\n \"aria-live\": \"polite\",\n type: \"button\",\n children: g ? /* @__PURE__ */ i(pe, { size: 14, className: \"text-green-400\" }) : /* @__PURE__ */ i(Ve, { size: 14 })\n }\n )\n ] }),\n [\n m,\n a,\n e,\n h,\n r,\n k,\n t,\n w,\n g,\n I\n ]\n ), j = q(() => a === \"json\" ? ct($, c) : a === \"tsx\" || a === \"ts\" || a === \"typescript\" ? dt($, c) : a === \"bash\" || a === \"sh\" ? lt($, c) : [\n /* @__PURE__ */ i(\"span\", { className: \"text-gray-400\", children: \"Unsupported language\" }, 0)\n ], [$, c, a]), H = q(() => l ? $.map((z, V) => /* @__PURE__ */ i(\n \"div\",\n {\n className: \"text-gray-500 text-right pl-3 pr-1 select-none min-w-8 text-sm font-mono leading-6\",\n \"aria-hidden\": \"true\",\n role: \"presentation\",\n children: V + 1\n },\n V\n )) : null, [l, $]), K = q(\n () => ({\n maxHeight: f && !h ? `${f}px` : h ? d ? \"calc(100vh - 5px)\" : \"calc(100vh - 45px)\" : void 0,\n overflow: f || h ? \"auto\" : \"visible\"\n }),\n [f, h, d]\n ), S = /* @__PURE__ */ E(\n \"div\",\n {\n id: u,\n ref: (z) => {\n x.current = z, typeof p == \"function\" ? p(z) : p && (p.current = z);\n },\n className: N(\n \"bg-gray-900 rounded-lg border border-gray-700 overflow-hidden motion-reduce:transition-none\",\n h && \"fixed inset-0 z-[9999] max-h-fit\",\n b\n ),\n \"data-language\": a,\n \"data-filename\": n,\n \"data-fullscreen\": h,\n role: \"region\",\n \"aria-label\": `Code block${n ? ` for ${n}` : \"\"} in ${a}`,\n \"aria-describedby\": l ? `${u}-description` : void 0,\n tabIndex: 0,\n onKeyDown: D,\n ...v,\n children: [\n l && /* @__PURE__ */ E(\"div\", { id: `${u}-description`, className: \"sr-only\", children: [\n \"Code block with line numbers. Use Cmd+C or Ctrl+C to copy code.\",\n e && \" Press F to toggle fullscreen.\"\n ] }),\n /* @__PURE__ */ i(\"div\", { \"aria-live\": \"polite\", \"aria-atomic\": \"true\", className: \"sr-only\", children: g && \"Code copied to clipboard\" }),\n !d && /* @__PURE__ */ E(\"div\", { className: \"flex items-center justify-between px-4 py-2 bg-gray-800 border-b border-gray-700\", children: [\n /* @__PURE__ */ E(\"div\", { className: \"flex items-center space-x-3\", children: [\n s && /* @__PURE__ */ E(\"div\", { className: \"flex space-x-2\", children: [\n /* @__PURE__ */ i(\"div\", { className: \"w-3 h-3 bg-red-500 rounded-full\" }),\n /* @__PURE__ */ i(\"div\", { className: \"w-3 h-3 bg-yellow-500 rounded-full\" }),\n /* @__PURE__ */ i(\"div\", { className: \"w-3 h-3 bg-green-500 rounded-full\" })\n ] }),\n n && /* @__PURE__ */ i(\"span\", { className: \"text-sm text-gray-300 font-medium\", children: n })\n ] }),\n M(!0)\n ] }),\n /* @__PURE__ */ E(\"div\", { className: N(\"flex overflow-hidden\", d && \"relative\"), style: K, children: [\n d && M(!1),\n /* @__PURE__ */ i(\"div\", { className: \"flex-1 overflow-x-auto\", children: /* @__PURE__ */ E(\"div\", { className: \"flex\", children: [\n l && /* @__PURE__ */ i(\n \"div\",\n {\n className: \"bg-gray-800 py-4 border-r border-gray-700 flex flex-col flex-shrink-0\",\n \"aria-hidden\": \"true\",\n role: \"presentation\",\n children: H\n }\n ),\n /* @__PURE__ */ i(\"div\", { className: \"flex-1 p-4\", children: /* @__PURE__ */ i(\n \"pre\",\n {\n className: \"text-sm font-mono focus:outline-none\",\n role: \"code\",\n \"aria-label\": `${a} code content`,\n tabIndex: -1,\n children: /* @__PURE__ */ i(\"code\", { children: j })\n }\n ) })\n ] }) })\n ] })\n ]\n }\n );\n return /* @__PURE__ */ E(Y, { children: [\n !h && S,\n h && ce(\n /* @__PURE__ */ E(Y, { children: [\n /* @__PURE__ */ i(\n \"div\",\n {\n className: \"fixed inset-0 bg-black z-[9998]\",\n onClick: () => y(!1),\n \"aria-hidden\": \"true\"\n }\n ),\n S\n ] }),\n document.body\n )\n ] });\n}\nfunction ar({\n children: o,\n label: a,\n isOpen: t,\n onToggle: r,\n id: e,\n ref: n,\n disabled: s = !1,\n className: l,\n buttonClassName: d\n}) {\n const m = P(), f = e ?? m, [c, b] = C(!1), u = t !== void 0 ? t : c, p = () => {\n s || (t === void 0 && b((v) => !v), r == null || r(!u));\n };\n return R(() => {\n b(t ?? !1);\n }, [t]), /* @__PURE__ */ E(\"div\", { ref: n, id: f, \"data-open\": u, className: N(\"overflow-hidden\", l), children: [\n /* @__PURE__ */ i(\n \"button\",\n {\n id: `${f}-button`,\n type: \"button\",\n \"aria-expanded\": u,\n \"aria-controls\": `${f}-panel`,\n disabled: s,\n tabIndex: 0,\n className: N(\n \"w-full px-4 py-3 font-medium hover:bg-primary/10 disabled:opacity-50 disabled:cursor-not-allowed\",\n d\n ),\n onClick: p,\n onKeyDown: (v) => {\n (v.key === \"Enter\" || v.key === \" \") && (v.preventDefault(), p());\n },\n \"data-open\": u,\n \"data-label\": typeof a == \"string\" ? a : void 0,\n children: /* @__PURE__ */ E(\"div\", { className: \"flex items-center w-full gap-2\", children: [\n /* @__PURE__ */ i(\"span\", { className: \"flex-1 text-left\", children: a }),\n u ? /* @__PURE__ */ i(Be, { className: \"size-5\", \"aria-hidden\": \"true\" }) : /* @__PURE__ */ i(We, { className: \"size-5\", \"aria-hidden\": \"true\" })\n ] })\n }\n ),\n /* @__PURE__ */ i(\"div\", { id: `${f}-panel`, role: \"region\", \"aria-labelledby\": f, \"aria-live\": \"polite\", hidden: !u, children: o })\n ] });\n}\nfunction le({ elementId: o, type: a, message: t }) {\n return R(() => {\n const r = document.getElementById(o);\n if (r) {\n if (!t && a === \"error\") {\n r.removeAttribute(\"data-error\");\n return;\n }\n if (!t && a === \"success\") {\n r.removeAttribute(\"data-success\");\n return;\n }\n return r.setAttribute(\"aria-describedby\", `${o}-${a}-message`), r.setAttribute(\"aria-invalid\", a === \"error\" ? \"true\" : \"false\"), a === \"error\" && r.setAttribute(\"data-error\", \"true\"), a === \"success\" && r.setAttribute(\"data-success\", \"true\"), () => {\n r.removeAttribute(\"aria-describedby\"), r.removeAttribute(\"aria-invalid\"), r.removeAttribute(\"data-error\"), r.removeAttribute(\"data-success\");\n };\n }\n }, [o, a, t]), t ? /* @__PURE__ */ E(\n \"small\",\n {\n className: N(\n \"mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-start\",\n a === \"error\" && \"text-destructive\",\n a === \"success\" && \"text-success\"\n ),\n role: \"status\",\n children: [\n a === \"error\" ? /* @__PURE__ */ i(qe, {}) : /* @__PURE__ */ i(Ke, {}),\n /* @__PURE__ */ i(\"span\", { id: `${o}-${a}-message`, children: t })\n ]\n }\n ) : null;\n}\nconst bt = {\n base: \"\",\n default: \"ring ring-transparent focus:ring-primary-foreground not-disabled:data-error:ring-destructive not-disabled:data-success:ring-success\",\n underline: \"border-b border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success\",\n outline: \"border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success\"\n}, pt = {\n none: \"rounded-none\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n full: \"px-3 rounded-full\"\n}, ye = {\n variant: \"default\",\n rounded: \"none\"\n};\nfunction or({\n variant: o = ye.variant,\n rounded: a,\n displayOnlyMode: t = !1,\n errorMessage: r,\n successMessage: e,\n type: n = \"text\",\n className: s,\n ...l\n}) {\n const d = P(), [m, f] = C(!1);\n let c = a;\n o === \"outline\" && !a && (c = \"md\"), c = c || ye.rounded;\n const p = N(\n \"appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all\",\n \"file:mr-2 file:border-0 file:rounded-md file:px-1.5 file:py-1 file:bg-primary hover:file:bg-primary/85 file:text-sm file:font-medium file:text-foreground file:transition-colors\",\n !t && bt[o],\n !t && pt[c],\n n === \"password\" && \"pr-10\",\n !t && \"px-2 py-1\",\n t && \"pointer-events-none\",\n s\n );\n return /* @__PURE__ */ E(\"div\", { className: N(t && \"cursor-text\"), style: { height: l.height, width: l.width }, children: [\n /* @__PURE__ */ E(\"div\", { className: N(n === \"password\" && \"relative\"), children: [\n /* @__PURE__ */ i(\n \"input\",\n {\n ...l,\n id: d,\n type: n === \"password\" && m ? \"text\" : n,\n \"aria-disabled\": l.disabled,\n readOnly: t,\n \"aria-readonly\": t || l[\"aria-readonly\"],\n \"data-error\": r ? !0 : void 0,\n \"data-success\": e ? !0 : void 0,\n className: p\n }\n ),\n n === \"password\" && /* @__PURE__ */ i(\n \"button\",\n {\n onClick: () => f(!m),\n className: \"absolute inset-y-0 right-0 px-2 hover:cursor-pointer\",\n \"aria-label\": \"Toggle password visibility\",\n \"data-state\": m ? \"visible\" : \"hidden\",\n children: m ? /* @__PURE__ */ i(Me, { size: 20 }) : /* @__PURE__ */ i(Fe, { size: 20 })\n }\n )\n ] }),\n !t && /* @__PURE__ */ i(le, { elementId: d, type: \"error\", message: r }),\n !t && /* @__PURE__ */ i(le, { elementId: d, type: \"success\", message: e })\n ] });\n}\nfunction sr({\n display: o = \"inline\",\n width: a = \"fit-content\",\n className: t = \"\",\n required: r,\n helpMessage: e,\n suffix: n,\n htmlFor: s,\n children: l,\n description: d,\n ...m\n}) {\n var v, h;\n const f = P(), c = (((v = e == null ? void 0 : e.trim()) == null ? void 0 : v.length) || 0) > 0, b = (((h = d == null ? void 0 : d.trim()) == null ? void 0 : h.length) || 0) > 0, u = c ? `${s ?? f}-help` : void 0, p = b ? `${s ?? f}-description` : void 0;\n return /* @__PURE__ */ E(\n \"div\",\n {\n style: { display: o === \"inline\" ? \"inline-block\" : \"block\", width: a },\n className: N(\"mb-0.5\", t),\n children: [\n /* @__PURE__ */ E(\"div\", { className: \"relative flex\", children: [\n /* @__PURE__ */ E(\"label\", { className: \"font-medium\", htmlFor: s, ...m, children: [\n l,\n r && /* @__PURE__ */ i(\"span\", { className: \"text-red-500 font-medium ml-1\", \"aria-label\": \"required\", children: \"*\" })\n ] }),\n c && /* @__PURE__ */ i(\n \"span\",\n {\n className: \"text-gray-500 ml-1 size-fit -translate-y-1/3\",\n \"aria-describedby\": u,\n \"aria-label\": \"Help information\",\n title: e,\n children: /* @__PURE__ */ i(Pe, {})\n }\n ),\n c && /* @__PURE__ */ i(\"div\", { id: u, className: \"sr-only\", children: e }),\n n && /* @__PURE__ */ i(\"span\", { className: \"ml-1\", children: n })\n ] }),\n b && /* @__PURE__ */ i(\"small\", { id: p, className: \"block opacity-80 mt-0.5\", role: \"note\", children: d })\n ]\n }\n );\n}\nfunction vt(o) {\n const [a, t] = C(!1), [r, e] = C(!1);\n return R(() => {\n o ? (e(!0), setTimeout(() => t(!0), 10)) : (t(!1), setTimeout(() => e(!1), 150));\n }, [o]), { show: a, shouldRender: r };\n}\nfunction gt(o, a) {\n R(() => {\n const t = (r) => {\n r.key === \"Escape\" && o && a();\n };\n return document.addEventListener(\"keydown\", t), o && (document.body.style.overflow = \"hidden\"), () => {\n document.removeEventListener(\"keydown\", t), document.body.style.overflow = \"auto\";\n };\n }, [o, a]);\n}\nfunction xt(o, a) {\n const t = B(null), r = T(() => {\n const e = document.getElementById(o);\n if (!e) return;\n const n = e.querySelectorAll('[data-modal-action=\"true\"]');\n if (n.length > 0) {\n n[0].focus();\n return;\n }\n const s = e.querySelectorAll(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])'\n );\n if (s.length > 0) {\n const l = Array.from(s).filter((d) => !(d instanceof HTMLButtonElement && d.getAttribute(\"data-modal-close-button\") === \"true\"));\n if (l.length > 0) {\n l[0].focus();\n return;\n }\n s[0].focus();\n return;\n }\n e.focus();\n }, [o]);\n R(() => (a && (t.current = document.activeElement, r()), () => {\n document.body.style.overflow = \"auto\", t.current instanceof HTMLElement && t.current.focus();\n }), [a, r]);\n}\nfunction ir({\n id: o,\n isOpen: a,\n onClose: t,\n title: r,\n children: e,\n contentOnly: n = !1,\n className: s,\n overlayClassName: l,\n hideCloseButton: d = !1,\n actions: m = [],\n disableCloseOnOverlayClick: f = !1,\n ariaLabelledBy: c,\n ariaDescribedBy: b\n}) {\n const u = P(), p = o || `modal-${u}`, v = o ? `${o}-title` : `modal-title-${u}`, { show: h, shouldRender: y } = vt(a);\n if (xt(p, y), gt(y, t), !y) return null;\n const x = () => r ? G.isValidElement(r) ? /* @__PURE__ */ i(\"div\", { className: \"mb-4\", children: r }) : /* @__PURE__ */ i(\"h2\", { className: \"mb-4 text-xl font-semibold\", id: v, children: r }) : null, g = () => m.length === 0 ? null : /* @__PURE__ */ i(\"div\", { className: \"mt-6 not-sm:grid gap-y-2 sm:flex sm:justify-start sm:flex-row-reverse sm:gap-x-3\", children: m.map((w, k) => {\n const { label: I, className: D, ...$ } = w;\n return /* @__PURE__ */ i(Ye, { className: D, type: \"button\", ...$, \"data-modal-action\": \"true\", children: I }, k);\n }) });\n return /* @__PURE__ */ i(Y, { children: ce(\n /* @__PURE__ */ i(\n \"div\",\n {\n \"aria-labelledby\": c ?? r ? v : void 0,\n \"aria-describedby\": b,\n role: \"dialog\",\n \"aria-modal\": \"true\",\n className: \"fixed inset-0 z-[100] overflow-y-auto\",\n children: /* @__PURE__ */ E(\"div\", { className: \"flex min-h-screen items-center justify-center p-4\", children: [\n /* @__PURE__ */ i(\n \"div\",\n {\n className: L(\"fixed inset-0 bg-black/20 transition-all\", l),\n onClick: () => {\n f || t();\n }\n }\n ),\n n && /* @__PURE__ */ i(\"div\", { className: L(\"relative w-fit\", s), children: e }),\n !n && /* @__PURE__ */ E(\n \"div\",\n {\n id: p,\n tabIndex: -1,\n className: L(\n \"relative w-full max-w-xl transform rounded-lg shadow-xl bg-popover transition-all p-6 focus:ring ease-in duration-75\",\n h ? \"opacity-100 scale-100\" : \"opacity-0 scale-90\",\n s\n ),\n children: [\n !d && /* @__PURE__ */ i(\n \"button\",\n {\n type: \"button\",\n onClick: t,\n \"data-modal-close-button\": \"true\",\n className: \"rounded-md p-0.5 top-2.5 right-2.5 absolute opacity-80 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-gray-500 leading-0\",\n children: /* @__PURE__ */ i(ge, { size: 18 })\n }\n ),\n x(),\n e,\n g()\n ]\n }\n )\n ] })\n }\n ),\n document.body\n ) });\n}\nconst yt = {\n link: \"text-primary hover:text-primary-foreground hover:bg-primary/10 aria-current:text-primary-foreground aria-current:bg-primary\",\n outline: \"border border-primary text-primary hover:bg-primary hover:text-primary-foreground aria-current:bg-primary aria-current:text-primary-foreground aria-current:border-primary\",\n filled: \"bg-secondary text-secondary-foreground hover:bg-primary hover:text-primary-foreground aria-current:bg-primary aria-current:text-primary-foreground\"\n}, wt = {\n sm: \"px-2 py-1 text-sm min-w-[32px] min-h-8\",\n md: \"px-2 py-1 text-base min-w-[40px] min-h-10\"\n};\nfunction lr({\n page: o,\n pageCount: a = 5,\n maxVisiblePages: t = 5,\n showFirstLast: r = !0,\n onPageChange: e,\n size: n = \"md\",\n variant: s = \"link\",\n className: l,\n ref: d,\n buttonsClassName: m,\n ...f\n}) {\n const c = a === 1 / 0, u = T(() => {\n if (c) return [];\n const w = a, k = Math.min(t, w);\n if (w <= k)\n return Array.from({ length: w }, (M, j) => j + 1);\n const I = Math.floor(k / 2);\n let D = Math.max(1, o - I), $ = Math.min(w, D + k - 1);\n return $ - D + 1 < k && (D = Math.max(1, $ - k + 1), $ = Math.min(w, D + k - 1)), Array.from({ length: $ - D + 1 }, (M, j) => D + j);\n }, [c, t, o, a])(), p = o > 1, v = c || o < a, h = r && !c, y = r && !c, x = (w) => {\n w >= 1 && (c || w <= a) && e(w);\n }, g = T(() => {\n const w = L(\n \"flex items-center justify-center min-w-fit\",\n \"disabled:opacity-50 disabled:cursor-not-allowed\",\n wt[n],\n \"rounded-md\"\n );\n return L(w, yt[s], m);\n }, [s, n, m]);\n return /* @__PURE__ */ E(\n \"nav\",\n {\n ref: d,\n className: L(\"flex items-center justify-center gap-1\", l),\n role: \"navigation\",\n \"aria-label\": \"Pagination\",\n \"data-page\": o,\n \"data-page-count\": c ? \"infinite\" : a,\n ...f,\n children: [\n h && /* @__PURE__ */ E(\n \"button\",\n {\n onClick: () => x(1),\n className: g(),\n disabled: o === 1,\n \"aria-label\": \"Go to first page\",\n children: [\n /* @__PURE__ */ i(Ge, { size: n === \"sm\" ? 12 : 15 }),\n /* @__PURE__ */ i(\"span\", { className: \"ml-1\", children: \"First\" })\n ]\n }\n ),\n /* @__PURE__ */ E(\n \"button\",\n {\n onClick: () => x(o - 1),\n className: g(),\n disabled: !p,\n \"aria-label\": \"Go to previous page\",\n children: [\n /* @__PURE__ */ i(Ae, { size: n === \"sm\" ? 12 : 15 }),\n /* @__PURE__ */ i(\"span\", { className: \"ml-1\", children: \"Previous\" })\n ]\n }\n ),\n !c && u.map((w) => /* @__PURE__ */ i(\n \"button\",\n {\n onClick: () => x(w),\n className: L(g(), \"aspect-square\"),\n \"aria-label\": `Go to page ${w}`,\n \"aria-current\": w === o ? !0 : void 0,\n children: w\n },\n w\n )),\n /* @__PURE__ */ E(\n \"button\",\n {\n onClick: () => x(o + 1),\n className: g(),\n disabled: !v,\n \"aria-label\": \"Go to next page\",\n children: [\n /* @__PURE__ */ i(\"span\", { className: \"mr-1\", children: \"Next\" }),\n /* @__PURE__ */ i(Te, { size: n === \"sm\" ? 12 : 15 })\n ]\n }\n ),\n y && /* @__PURE__ */ E(\n \"button\",\n {\n onClick: () => x(a),\n className: g(),\n disabled: o === a,\n \"aria-label\": \"Go to last page\",\n children: [\n /* @__PURE__ */ i(\"span\", { className: \"mr-1\", children: \"Last\" }),\n /* @__PURE__ */ i(He, { size: n === \"sm\" ? 12 : 15 })\n ]\n }\n )\n ]\n }\n );\n}\nfunction Nt(o) {\n const [a, t] = C(!1), [r, e] = C(!1);\n return R(() => {\n o ? (e(!0), setTimeout(() => t(!0), 10)) : (t(!1), setTimeout(() => e(!1), 300));\n }, [o]), { show: a, shouldRender: r };\n}\nfunction kt(o, a) {\n R(() => {\n const t = (r) => {\n r.key === \"Escape\" && o && a();\n };\n return document.addEventListener(\"keydown\", t), o && (document.body.style.overflow = \"hidden\"), () => {\n document.removeEventListener(\"keydown\", t), document.body.style.overflow = \"auto\";\n };\n }, [o, a]);\n}\nfunction Et(o, a) {\n const t = B(null), r = T(() => {\n const e = document.getElementById(o);\n if (!e) return;\n const n = e.querySelectorAll('[data-panel-action=\"true\"]');\n if (n.length > 0) {\n n[0].focus();\n return;\n }\n const s = e.querySelectorAll(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])'\n );\n if (s.length > 0) {\n const l = Array.from(s).filter((d) => !(d instanceof HTMLButtonElement && d.getAttribute(\"data-panel-close-button\") === \"true\"));\n if (l.length > 0) {\n l[0].focus();\n return;\n }\n s[0].focus();\n return;\n }\n e.focus();\n }, [o]);\n R(() => (a && (t.current = document.activeElement, r()), () => {\n document.body.style.overflow = \"auto\", t.current instanceof HTMLElement && t.current.focus();\n }), [a, r]);\n}\nconst Ct = {\n size: {\n sm: \"max-w-sm\",\n md: \"max-w-md\",\n lg: \"max-w-lg\",\n xl: \"max-w-xl\",\n \"2xl\": \"max-w-2xl\",\n full: \"w-full\",\n screen: \"w-screen\"\n }\n};\nfunction cr({\n ref: o,\n id: a,\n isOpen: t,\n onClose: r,\n title: e,\n children: n,\n footer: s,\n size: l = \"md\",\n className: d,\n overlayClassName: m,\n hideCloseButton: f = !1,\n disableCloseOnOverlayClick: c = !1,\n ariaLabelledBy: b,\n ariaDescribedBy: u\n}) {\n const p = P(), v = a || `panel-${p}`, h = a ? `${a}-title` : `panel-title-${p}`, { show: y, shouldRender: x } = Nt(t);\n if (Et(v, x), kt(x, r), !x) return null;\n const g = () => e ? G.isValidElement(e) ? /* @__PURE__ */ i(\"div\", { children: e }) : /* @__PURE__ */ i(\"h2\", { className: \"text-2xl font-semibold\", id: h, children: e }) : null, w = () => {\n if (!s) return null;\n if (G.isValidElement(s)) {\n const k = s, I = k.props.className || \"\";\n return G.cloneElement(k, { className: L(\"px-6 py-4\", I) });\n }\n return /* @__PURE__ */ i(\"div\", { className: \"px-6 py-4\", children: s });\n };\n return /* @__PURE__ */ i(Y, { children: ce(\n /* @__PURE__ */ E(\n \"div\",\n {\n \"aria-labelledby\": b ?? e ? h : void 0,\n \"aria-describedby\": u,\n role: \"dialog\",\n \"aria-modal\": \"true\",\n className: \"fixed inset-0 z-[100] overflow-hidden\",\n \"data-panel-open\": t,\n children: [\n /* @__PURE__ */ i(\n \"div\",\n {\n className: L(\n \"fixed inset-0 bg-black/40 transition-opacity duration-300\",\n y ? \"opacity-100\" : \"opacity-0\",\n m\n ),\n onClick: () => {\n c || r();\n }\n }\n ),\n /* @__PURE__ */ i(\"div\", { className: \"fixed inset-y-0 right-0 flex max-w-full\", children: /* @__PURE__ */ i(\n \"div\",\n {\n id: v,\n ref: o,\n tabIndex: -1,\n className: L(\n \"relative h-full transform shadow-xl bg-popover transition-transform duration-300 ease-in-out\",\n l !== \"screen\" && \"border-l border-border\",\n Ct.size[l],\n y ? \"translate-x-0\" : \"translate-x-full\",\n d\n ),\n \"data-panel-size\": l,\n children: /* @__PURE__ */ E(\"div\", { className: \"flex h-full flex-col\", children: [\n e && /* @__PURE__ */ i(\"div\", { className: \"px-6 pt-6\", children: g() }),\n !f && /* @__PURE__ */ i(\n \"button\",\n {\n type: \"button\",\n onClick: r,\n \"data-panel-close-button\": \"true\",\n \"aria-label\": \"Close panel\",\n className: \"rounded-md p-0.5 top-3 right-3 absolute opacity-80 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-gray-500 leading-0\",\n children: /* @__PURE__ */ i(ge, { size: 18 })\n }\n ),\n /* @__PURE__ */ i(\"div\", { className: L(\"flex-1 overflow-y-auto px-6 pb-6\", e ? \"pt-6\" : \"pt-10\"), children: n }),\n w()\n ] })\n }\n ) })\n ]\n }\n ),\n document.body\n ) });\n}\nfunction zt({ itemId: o, checked: a, onChange: t, name: r, disabled: e = !1, className: n = \"\" }) {\n const s = \"relative inline-flex items-center justify-center rounded-full\", l = () => {\n e || t();\n }, d = N(\n s,\n !a && \"hover:border-current/60\",\n !e && \"border-current cursor-pointer\",\n e && \"border-muted/60 cursor-not-allowed\",\n n\n );\n return /* @__PURE__ */ i(\n \"div\",\n {\n id: o,\n role: \"radio\",\n tabIndex: -1,\n \"aria-checked\": a,\n \"aria-disabled\": e,\n \"aria-description\": `Radio button for ${r}`,\n \"aria-labelledby\": `${o}-label`,\n onClick: l,\n className: d,\n style: {\n width: \"1em\",\n height: \"1em\",\n padding: \"0.1em\",\n borderWidth: \"0.06em\"\n },\n children: a && /* @__PURE__ */ i(\n \"div\",\n {\n className: N(\"size-full aspect-square rounded-full\", e && \"bg-muted/60\", !e && \"bg-current\")\n }\n )\n }\n );\n}\nfunction be({\n value: o,\n children: a,\n className: t = \"\",\n isSelected: r = !1,\n onChange: e,\n disabled: n = !1,\n hideInput: s = !1,\n description: l,\n name: d\n}) {\n const f = `radio-${P()}-${o}`, c = () => {\n n || e == null || e(o);\n };\n return /* @__PURE__ */ E(\n \"div\",\n {\n title: l,\n className: N(\n \"relative flex items-center\",\n t,\n // Uses text color for borders\n s && `p-2 border-2 focus-within:border-dashed focus-within:${n ? \"border-current/50\" : \"border-current/80\"}`,\n s && !r && `border-transparent ${n ? \"\" : \"not-focus-within:hover:border-border/60\"}`,\n s && r && \"border-border\",\n n && \"opacity-60 cursor-not-allowed\"\n ),\n style: {\n gap: \"0.5em\"\n },\n children: [\n !s && /* @__PURE__ */ i(\n zt,\n {\n itemId: f,\n name: d || \"\",\n checked: r,\n onChange: c,\n disabled: n,\n className: N(s && \"\")\n }\n ),\n /* @__PURE__ */ i(\n \"div\",\n {\n id: s ? f : void 0,\n tabIndex: s ? -1 : void 0,\n role: s ? \"radio\" : void 0,\n onClick: s ? c : void 0,\n \"aria-checked\": s ? r ? \"true\" : \"false\" : void 0,\n \"aria-disabled\": s ? n : void 0,\n \"aria-description\": s ? l || `Radio button for ${d}` : void 0,\n \"aria-labelledby\": s ? `${f}-label` : void 0,\n className: N(s && \"size-full\", typeof a == \"object\" && \"grow focus:outline-none\"),\n children: /* @__PURE__ */ i(\n \"label\",\n {\n id: `${f}-label`,\n onClick: s ? void 0 : c,\n className: N(n && \"cursor-not-allowed\", !n && \"cursor-pointer\"),\n children: a\n }\n )\n }\n )\n ]\n }\n );\n}\nfunction $t(o, a) {\n const [t, r] = C(a), [e, n] = C(-1), [s, l] = C(!1), d = T((u, p) => {\n var y;\n const v = u[p];\n v.hasAttribute(\"disabled\") || v.getAttribute(\"aria-disabled\") === \"true\" || ((y = u[p]) == null || y.click(), n(p));\n }, []), m = T(\n (u, p) => {\n var h;\n if (u.preventDefault(), s || !p.length) return;\n const v = a !== -1 ? a : 0;\n (h = p[v]) == null || h.focus(), r(v), a !== -1 && d(p, v);\n },\n [a, s, d]\n ), f = T(\n (u) => {\n var y;\n if (!u.shiftKey)\n return;\n u.preventDefault();\n const p = Array.from(\n document.querySelectorAll(\n 'a, button, input, textarea, select, details, [tabindex]:not([tabindex=\"-1\"])'\n )\n ).filter((x) => !x.hasAttribute(\"disabled\") && x.tabIndex >= 0), v = p.findIndex((x) => x.id === o), h = v > 0 ? v - 1 : p.length - 1;\n (y = p[h]) == null || y.focus();\n },\n [o]\n ), c = T(\n (u, p) => {\n var g;\n if (!p.length) return;\n const v = u.target;\n if (!p.some((w) => w.id === v.id)) return;\n const y = t !== -1 ? t : 0;\n let x = y;\n switch (u.key) {\n case \"ArrowUp\":\n case \"ArrowLeft\":\n u.preventDefault(), x = y > 0 ? y - 1 : p.length - 1;\n break;\n case \"ArrowDown\":\n case \"ArrowRight\":\n u.preventDefault(), x = (y + 1) % p.length;\n break;\n // Select the option when the space key is pressed\n case \" \":\n u.preventDefault(), d(p, y);\n return;\n case \"Tab\":\n f(u);\n return;\n default:\n return;\n }\n (g = p[x]) == null || g.focus(), r(x), e !== -1 && d(p, x);\n },\n [t, e, f, d]\n ), b = T(() => {\n const u = document.querySelector(`[id=\"${o}\"][role=\"radiogroup\"]`);\n return u ? Array.from(u.querySelectorAll('[role=\"radio\"]')) : [];\n }, [o]);\n R(() => {\n const u = document.querySelector(`[id=\"${o}\"][role=\"radiogroup\"]`);\n if (!u) return;\n const p = b(), v = (g) => m(g, p), h = (g) => c(g, p), y = () => l(!0), x = () => l(!1);\n return document.addEventListener(\"keydown\", h), u.addEventListener(\"focus\", v), u.addEventListener(\"mousedown\", y), document.addEventListener(\"mouseup\", x), () => {\n document.removeEventListener(\"keydown\", h), u.removeEventListener(\"focus\", v), u.removeEventListener(\"mousedown\", y), document.removeEventListener(\"mouseup\", x);\n };\n }, [o, b, m, c]);\n}\nfunction dr({\n options: o = [],\n value: a,\n onChange: t,\n id: r,\n children: e,\n className: n = \"\",\n childrenClassName: s = \"\",\n hideInputs: l = !1\n}) {\n const d = P(), m = r || `radio-group-${d}`;\n $t(\n m,\n o.findIndex((c) => c === a)\n );\n const f = q(() => o.reduce((c, b) => (typeof b == \"string\" ? c.some((u) => u.value === b) || c.push({ label: b, value: b }) : c.push(b), c), []), [o]);\n return /* @__PURE__ */ E(\"div\", { id: m, role: \"radiogroup\", tabIndex: 0, className: N(n, \"focus:outline-none\"), children: [\n f.length > 0 && f.map((c, b) => /* @__PURE__ */ i(\n be,\n {\n value: c.value,\n isSelected: a === c.value,\n onChange: t,\n name: m,\n disabled: c.disabled,\n description: c.description,\n hideInput: l,\n className: s,\n children: c.label\n },\n `${c.value}-${b}`\n )),\n f.length === 0 && e && G.Children.map(e, (c) => G.isValidElement(c) && c.type === be ? /* @__PURE__ */ i(\n be,\n {\n ...c.props,\n className: N(s, c.props.className),\n hideInput: c.props.hideInput || l,\n isSelected: a === c.props.value,\n onChange: t,\n name: m,\n children: c.props.children\n }\n ) : null)\n ] });\n}\nfunction At(o) {\n const a = B(null), t = B(null), r = B(null), [e, n] = C(!1), [s, l] = C(!1), [d, m] = C({\n vertical: !1,\n horizontal: !1\n }), f = B(null), c = B(null), b = T(() => {\n const v = a.current;\n if (!v) return;\n const h = v.scrollHeight > v.clientHeight, y = v.scrollWidth > v.clientWidth;\n m({\n vertical: h,\n horizontal: y\n });\n }, []), u = T(() => {\n const v = a.current, h = t.current, y = r.current;\n if (v) {\n if (h && d.vertical) {\n const g = (d.horizontal ? v.clientHeight - o : v.clientHeight) / v.scrollHeight, w = Math.max(g * 100, 10), k = v.scrollHeight - v.clientHeight, I = k > 0 ? v.scrollTop / k : 0, D = 100 - w, $ = I * D;\n h.style.height = `${w}%`, h.style.top = `${$}%`, h.style.transform = \"none\";\n }\n if (y && d.horizontal) {\n const g = (d.vertical ? v.clientWidth - o : v.clientWidth) / v.scrollWidth, w = Math.max(g * 100, 10), k = v.scrollWidth - v.clientWidth, I = k > 0 ? v.scrollLeft / k : 0, D = 100 - w, $ = I * D;\n y.style.width = `${w}%`, y.style.left = `${$}%`, y.style.transform = \"none\";\n }\n }\n }, [d, o]), p = T(() => {\n f.current && clearTimeout(f.current), c.current && clearTimeout(c.current), n(!0), l(!1), u(), f.current = setTimeout(() => {\n l(!0), c.current = setTimeout(() => {\n n(!1), l(!1);\n }, 300);\n }, 1e3);\n }, [u]);\n return R(() => {\n const v = a.current;\n if (!v) return;\n b();\n const h = new ResizeObserver(b);\n h.observe(v);\n const y = new MutationObserver(b);\n return y.observe(v, {\n childList: !0,\n subtree: !0,\n attributes: !0\n }), () => {\n h.disconnect(), y.disconnect();\n };\n }, [b]), R(() => {\n u();\n }, [d, u]), R(() => () => {\n f.current && clearTimeout(f.current), c.current && clearTimeout(c.current);\n }, []), {\n viewportRef: a,\n verticalThumbRef: t,\n horizontalThumbRef: r,\n isScrolling: e,\n isFadingOut: s,\n scrollbarVisible: d,\n handleScroll: p\n };\n}\nfunction ur({\n className: o,\n thumbClassName: a,\n viewportClassName: t,\n scrollbarClassName: r,\n scrollbarThickness: e = 10,\n children: n,\n id: s,\n ref: l,\n ...d\n}) {\n const { viewportRef: m, verticalThumbRef: f, horizontalThumbRef: c, isScrolling: b, isFadingOut: u, scrollbarVisible: p, handleScroll: v } = At(e), h = L(\n \"relative flex-1 rounded-full bg-slate-400/60 hover:bg-slate-400/80 active:bg-slate-400\",\n a\n );\n return /* @__PURE__ */ E(\"div\", { ref: l, id: s, className: L(\"relative overflow-hidden\", o), \"data-scroll-area-root\": \"\", ...d, children: [\n /* @__PURE__ */ i(\n \"div\",\n {\n ref: m,\n className: L(\n \"h-full w-full overflow-auto rounded-[inherit] [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden\",\n t\n ),\n onScroll: v,\n \"data-scroll-area-viewport\": \"\",\n children: n\n }\n ),\n p.vertical && (b || u) && /* @__PURE__ */ i(\n \"div\",\n {\n className: L(\n \"touch-none select-none transition-all duration-300\",\n \"p-[1px]\",\n \"absolute right-0 top-0\",\n u ? \"opacity-0\" : \"opacity-100\",\n r\n ),\n \"data-scroll-area-scrollbar\": \"vertical\",\n \"data-state\": b ? \"visible\" : \"hidden\",\n style: {\n width: `${e}px`,\n height: p.horizontal ? `calc(100% - ${e}px)` : \"100%\"\n },\n children: /* @__PURE__ */ i(\n \"div\",\n {\n ref: f,\n className: L(\"absolute rounded-full\", h),\n \"data-scroll-area-thumb\": \"\",\n style: { height: \"20%\", top: \"0%\", width: \"100%\" }\n }\n )\n }\n ),\n p.horizontal && (b || u) && /* @__PURE__ */ i(\n \"div\",\n {\n className: L(\n \"touch-none select-none transition-all duration-300\",\n \"p-[1px]\",\n \"absolute bottom-0 left-0\",\n u ? \"opacity-0\" : \"opacity-100\",\n r\n ),\n \"data-scroll-area-scrollbar\": \"horizontal\",\n \"data-state\": b ? \"visible\" : \"hidden\",\n style: {\n height: `${e}px`,\n width: p.vertical ? `calc(100% - ${e}px)` : \"100%\"\n },\n children: /* @__PURE__ */ i(\n \"div\",\n {\n ref: c,\n className: L(\"absolute rounded-full\", h),\n \"data-scroll-area-thumb\": \"\",\n style: { width: \"20%\", left: \"0%\", height: \"100%\" }\n }\n )\n }\n ),\n p.vertical && p.horizontal && /* @__PURE__ */ i(\n \"div\",\n {\n className: L(\"bg-transparent\", \"absolute bottom-0 right-0\"),\n \"data-scroll-area-corner\": \"\",\n style: {\n height: `${e}px`,\n width: `${e}px`\n }\n }\n )\n ] });\n}\nfunction Tt(o) {\n const [a, t] = C(!1), [r, e] = C(!1);\n return R(() => {\n o ? (e(!0), setTimeout(() => t(!0), 10)) : (t(!1), setTimeout(() => e(!1), 150));\n }, [o]), { show: a, shouldRender: r };\n}\nfunction It({\n isOpen: o,\n setIsOpen: a,\n filteredOptions: t,\n highlightedIndex: r,\n setHighlightedIndex: e,\n onSelect: n,\n triggerRef: s\n}) {\n return { handleKeyDown: T(\n (d) => {\n var m;\n switch (d.key) {\n case \"ArrowDown\":\n if (d.preventDefault(), !o)\n a(!0);\n else {\n const f = r < t.length - 1 ? r + 1 : 0;\n let c = f;\n for (let b = 0; b < t.length; b++) {\n const u = (f + b) % t.length;\n if (!t[u].disabled) {\n c = u;\n break;\n }\n }\n e(c);\n }\n break;\n case \"ArrowUp\":\n if (d.preventDefault(), !o)\n a(!0);\n else {\n const f = r > 0 ? r - 1 : t.length - 1;\n let c = f;\n for (let b = 0; b < t.length; b++) {\n const u = (f - b + t.length) % t.length;\n if (!t[u].disabled) {\n c = u;\n break;\n }\n }\n e(c);\n }\n break;\n case \"Enter\":\n case \" \":\n if (d.preventDefault(), !o)\n a(!0);\n else if (r >= 0 && r < t.length) {\n const f = t[r];\n f.disabled || n(f);\n }\n break;\n case \"Escape\":\n d.preventDefault(), o && (a(!1), (m = s.current) == null || m.focus());\n break;\n case \"Tab\":\n o && a(!1);\n break;\n }\n },\n [o, a, t, r, e, n, s]\n ) };\n}\nfunction Dt({\n isOpen: o,\n filteredOptions: a,\n selectedOption: t,\n shouldRender: r,\n optionsContainerRef: e\n}) {\n const [n, s] = C(-1), l = q(() => t ? a.findIndex((d) => d.value === t.value) : -1, [a, t]);\n return R(() => {\n o && a.length > 0 ? s(t && l >= 0 ? l : 0) : s(-1);\n }, [a, o, t, l]), R(() => {\n if (n >= 0 && e.current && r) {\n const d = () => {\n const m = e.current, f = m == null ? void 0 : m.querySelector(`[data-option-index=\"${n}\"]`);\n if (f) {\n const c = o && t && n === l ? \"auto\" : \"smooth\";\n f.scrollIntoView({\n behavior: c,\n block: \"nearest\"\n });\n }\n };\n o && r && t ? setTimeout(d, 10) : d();\n }\n }, [n, r, o, t, a, e, l]), { highlightedIndex: n, setHighlightedIndex: s };\n}\nconst we = {\n sm: {\n trigger: \"px-2 py-1 text-sm\",\n options: \"px-2 py-2 text-xs\"\n },\n md: {\n trigger: \"px-3 py-2 text-base\",\n options: \"px-3 py-2.5 text-sm\"\n },\n lg: {\n trigger: \"px-4 py-3 text-lg\",\n options: \"px-4 py-3 text-base\"\n }\n};\nfunction fr({\n options: o,\n value: a,\n placeholder: t = \"Select an option...\",\n searchable: r = !1,\n disabled: e = !1,\n clearable: n = !1,\n size: s = \"md\",\n className: l,\n triggerClassName: d,\n dropdownClassName: m,\n id: f,\n ref: c,\n onChange: b,\n onSearch: u,\n searchPlaceholder: p = \"Search options...\"\n}) {\n const v = P(), y = `${f ?? v}-listbox`, x = (A) => `${y}-option-${A}`, [g, w] = C(!1), [k, I] = C(\"\"), D = B(null), $ = B(null), M = B(null), j = B(null), { show: H, shouldRender: K } = Tt(g), S = q(() => !r || !k ? o : o.filter(\n (A) => {\n var W;\n return A.text.toLowerCase().includes(k.toLowerCase()) || ((W = A.description) == null ? void 0 : W.toLowerCase().includes(k.toLowerCase()));\n }\n ), [o, r, k]), z = q(() => o.find((A) => A.value === a), [o, a]), { highlightedIndex: V, setHighlightedIndex: Z } = Dt({\n isOpen: g,\n filteredOptions: S,\n selectedOption: z,\n shouldRender: K,\n optionsContainerRef: j\n }), U = V >= 0 ? x(V) : void 0;\n R(() => {\n g && K && r && $.current && $.current.focus();\n }, [g, r, K]);\n const J = T(\n (A) => {\n var W;\n A.disabled || (b == null || b(A.value), w(!1), I(\"\"), (W = D.current) == null || W.focus());\n },\n [b]\n ), { handleKeyDown: _ } = It({\n isOpen: g,\n setIsOpen: w,\n filteredOptions: S,\n highlightedIndex: V,\n setHighlightedIndex: Z,\n onSelect: J,\n triggerRef: D\n });\n R(() => {\n if (!g)\n return;\n const A = (W) => {\n var re;\n M.current && !M.current.contains(W.target) && !((re = D.current) != null && re.contains(W.target)) && (w(!1), I(\"\"));\n };\n return document.addEventListener(\"mousedown\", A), () => document.removeEventListener(\"mousedown\", A);\n }, [g]);\n const O = () => {\n e || (w(!g), g || (I(\"\"), Z(-1)));\n }, de = (A) => {\n A.disabled || (b == null || b(A.value), w(!1), I(\"\"));\n }, ue = (A) => {\n const W = A.target.value;\n I(W), u == null || u(W), Z(-1);\n }, fe = (A) => {\n A.preventDefault(), A.stopPropagation(), b == null || b(\"\");\n };\n return /* @__PURE__ */ E(\n \"div\",\n {\n className: N(\"relative\", l),\n id: f,\n ref: c,\n \"data-select\": \"true\",\n \"data-value\": a,\n \"data-searchable\": r,\n \"data-disabled\": e,\n \"data-clearable\": n,\n children: [\n /* @__PURE__ */ E(\"div\", { className: \"relative\", children: [\n /* @__PURE__ */ E(\n \"button\",\n {\n ref: D,\n type: \"button\",\n className: N(\n \"flex items-center justify-between w-full text-left bg-inherit border border-border rounded-md transition-colors\",\n \"hover:border-primary focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary\",\n e && \"opacity-50 cursor-not-allowed hover:border-border\",\n g && \"border-primary ring-1 ring-primary\",\n we[s].trigger,\n d\n ),\n onClick: O,\n onKeyDown: _,\n disabled: e,\n \"aria-disabled\": e,\n \"aria-haspopup\": \"listbox\",\n \"aria-expanded\": g,\n \"aria-controls\": g ? y : void 0,\n \"aria-activedescendant\": g && !r ? U : void 0,\n \"aria-label\": z ? z.text : t,\n \"data-select-trigger\": \"true\",\n children: [\n /* @__PURE__ */ i(\"span\", { className: N(\"block truncate\", !z && \"opacity-70\"), children: z ? z.text : t }),\n /* @__PURE__ */ i(\"div\", { className: \"flex items-center ml-2\", children: /* @__PURE__ */ i($e, { size: 16, className: N(\"transition-transform duration-200\", g && \"rotate-180\") }) })\n ]\n }\n ),\n n && z && /* @__PURE__ */ i(\n \"button\",\n {\n type: \"button\",\n onClick: fe,\n className: \"absolute right-8 top-1/2 -translate-y-1/2 p-0.5 rounded hover:bg-accent/20 transition-colors group z-10\",\n \"aria-label\": \"Clear selection\",\n \"data-select-clear\": \"true\",\n children: /* @__PURE__ */ i(ge, { size: 14, className: \"opacity-70 group-hover:opacity-100 transition-opacity\" })\n }\n )\n ] }),\n K && /* @__PURE__ */ E(\n \"div\",\n {\n ref: M,\n className: N(\n \"absolute z-50 w-full mt-1 bg-popover border border-border rounded-md shadow-lg transition-all duration-150\",\n H ? \"opacity-100 translate-y-0\" : \"opacity-0 -translate-y-2\",\n m\n ),\n id: y,\n role: \"listbox\",\n \"data-select-content\": \"true\",\n children: [\n r && /* @__PURE__ */ i(\"div\", { className: \"border-b border-border\", children: /* @__PURE__ */ i(\n \"input\",\n {\n ref: $,\n type: \"text\",\n value: k,\n onChange: ue,\n onKeyDown: _,\n placeholder: p,\n className: \"w-full px-2 py-2 text-inherit focus:outline-none\",\n \"aria-autocomplete\": \"list\",\n \"aria-controls\": y,\n \"aria-activedescendant\": U,\n \"data-select-search\": \"true\"\n }\n ) }),\n /* @__PURE__ */ i(\"div\", { ref: j, className: \"max-h-60 overflow-auto\", children: S.length > 0 ? S.map((A, W) => /* @__PURE__ */ E(\n \"div\",\n {\n id: x(W),\n className: N(\n \"flex items-center cursor-pointer transition-colors\",\n \"hover:bg-accent/10 focus:bg-accent/10\",\n we[s].options,\n A.disabled && \"opacity-50 cursor-not-allowed\",\n W === V && \"bg-accent/20\",\n a === A.value && \"bg-accent/30\"\n ),\n onClick: () => de(A),\n role: \"option\",\n \"aria-selected\": a === A.value,\n \"aria-disabled\": A.disabled,\n \"data-select-option\": \"true\",\n \"data-value\": A.value,\n \"data-highlighted\": W === V,\n \"data-option-index\": W,\n children: [\n /* @__PURE__ */ E(\"div\", { className: \"flex-1 min-w-0\", children: [\n /* @__PURE__ */ i(\"div\", { className: \"font-medium\", children: A.text }),\n A.description && /* @__PURE__ */ i(\"div\", { className: \"text-xs opacity-70 mt-0.5\", children: A.description })\n ] }),\n a === A.value && /* @__PURE__ */ i(pe, { size: 16, className: \"ml-2 text-primary flex-shrink-0\" })\n ]\n },\n A.value\n )) : /* @__PURE__ */ i(\"div\", { className: \"px-3 py-2 text-sm opacity-70 text-center\", children: r && k ? \"No results found\" : \"No options available\" }) })\n ]\n }\n )\n ]\n }\n );\n}\nconst St = {\n thin: {\n horizontal: \"h-px\",\n vertical: \"w-px\"\n },\n medium: {\n horizontal: \"h-0.5\",\n vertical: \"w-0.5\"\n },\n thick: {\n horizontal: \"h-1\",\n vertical: \"w-1\"\n },\n \"extra-thick\": {\n horizontal: \"h-2\",\n vertical: \"w-2\"\n }\n}, Rt = {\n horizontal: \"w-full\",\n vertical: \"min-h-4 h-full\"\n};\nfunction mr({\n orientation: o = \"horizontal\",\n decorative: a = !1,\n thickness: t = \"thin\",\n className: r,\n ...e\n}) {\n const n = N(\n \"shrink-0 bg-border\",\n Rt[o],\n St[t][o],\n r\n );\n return /* @__PURE__ */ i(\n \"div\",\n {\n ...e,\n className: n,\n role: a ? \"presentation\" : \"separator\",\n \"aria-orientation\": a ? void 0 : o,\n \"aria-hidden\": a,\n \"data-orientation\": o,\n \"data-thickness\": t\n }\n );\n}\nconst Ne = {\n shape: {\n rectangle: \"rounded-md min-h-1\",\n circle: \"rounded-full aspect-square min-h-1\",\n text: \"rounded-sm min-h-1 h-4\"\n },\n lineSpacing: {\n xs: \"space-y-1\",\n sm: \"space-y-2\",\n md: \"space-y-3\",\n lg: \"space-y-4\",\n xl: \"space-y-6\"\n }\n};\nfunction hr({\n shape: o = \"rectangle\",\n lineSpacing: a = \"sm\",\n className: t,\n lines: r = 1,\n animate: e = !0,\n ref: n,\n ...s\n}) {\n const l = N(\"bg-muted/70\", e && \"animate-pulse\", Ne.shape[o], t);\n return r > 1 ? /* @__PURE__ */ i(\n \"div\",\n {\n ref: n,\n className: Ne.lineSpacing[a],\n role: \"presentation\",\n \"aria-hidden\": \"true\",\n \"data-testid\": \"skeleton-container\",\n \"data-lines\": r,\n \"data-shape\": o,\n \"data-animate\": e,\n ...s,\n children: Array.from({ length: r }, (d, m) => /* @__PURE__ */ i(\n \"div\",\n {\n className: N(\n l,\n // Make last line shorter for a more natural text appearance\n m === r - 1 && \"w-3/4\"\n ),\n role: \"presentation\",\n \"aria-hidden\": \"true\",\n \"data-testid\": \"skeleton-line\",\n \"data-line-index\": m\n },\n m\n ))\n }\n ) : /* @__PURE__ */ i(\n \"div\",\n {\n ref: n,\n className: l,\n role: \"presentation\",\n \"aria-hidden\": \"true\",\n \"data-testid\": \"skeleton\",\n \"data-shape\": o,\n \"data-animate\": e,\n ...s\n }\n );\n}\nfunction br({\n id: o,\n value: a,\n defaultValue: t = 0,\n onValueChange: r,\n min: e = 0,\n max: n = 100,\n step: s = 1,\n disabled: l = !1,\n trackClassName: d,\n rangeClassName: m,\n thumbClassName: f,\n className: c,\n ref: b,\n ariaLabel: u,\n ariaLabelledBy: p,\n ...v\n}) {\n const [h, y] = C(t), x = a !== void 0, g = x ? a : h, w = B(null), k = B(!1), I = B(0), D = T(\n (S) => {\n const z = Math.max(e, Math.min(n, S)), V = Math.round(z / s) * s;\n x || y(V), r == null || r(V);\n },\n [e, n, s, x, r]\n ), $ = T(\n (S, z = !1) => {\n var J;\n const V = (J = w.current) == null ? void 0 : J.getBoundingClientRect();\n if (!V) return g;\n let Z = S.clientX;\n z && (Z = Z - I.current);\n const U = Math.max(0, Math.min(1, (Z - V.left) / V.width));\n return e + (n - e) * U;\n },\n [e, n, g]\n ), M = T(\n (S) => {\n if (l || S.target !== S.currentTarget) return;\n const z = $(S);\n D(z);\n },\n [l, $, D]\n ), j = T(\n (S) => {\n var J;\n if (l) return;\n S.stopPropagation(), k.current = !0;\n const z = (J = w.current) == null ? void 0 : J.getBoundingClientRect(), V = S.currentTarget.getBoundingClientRect();\n if (z && V) {\n const _ = V.left + V.width / 2;\n I.current = S.clientX - _;\n }\n S.currentTarget.setPointerCapture(S.pointerId);\n const Z = (_) => {\n if (!k.current) return;\n const O = $(_, !0);\n D(O);\n }, U = (_) => {\n if (_.pointerId === S.pointerId) {\n k.current = !1, I.current = 0;\n try {\n S.currentTarget.releasePointerCapture(_.pointerId);\n } catch {\n }\n document.removeEventListener(\"pointermove\", Z), document.removeEventListener(\"pointerup\", U);\n }\n };\n document.addEventListener(\"pointermove\", Z), document.addEventListener(\"pointerup\", U);\n },\n [l, $, D]\n ), H = T(\n (S) => {\n if (l) return;\n let z = g;\n switch (S.key) {\n case \"ArrowRight\":\n case \"ArrowUp\":\n z = g + s;\n break;\n case \"ArrowLeft\":\n case \"ArrowDown\":\n z = g - s;\n break;\n case \"Home\":\n z = e;\n break;\n case \"End\":\n z = n;\n break;\n case \"PageUp\":\n z = g + s * 10;\n break;\n case \"PageDown\":\n z = g - s * 10;\n break;\n default:\n return;\n }\n S.preventDefault(), D(z);\n },\n [l, g, s, e, n, D]\n ), K = n === e ? 0 : (g - e) / (n - e) * 100;\n return /* @__PURE__ */ i(\n \"div\",\n {\n id: o,\n ref: b,\n className: L(\n \"relative flex items-center w-full touch-none select-none\",\n l && \"opacity-50 cursor-not-allowed\",\n c\n ),\n \"data-disabled\": l,\n \"data-value\": g,\n \"data-min\": e,\n \"data-max\": n,\n \"data-step\": s,\n ...v,\n children: /* @__PURE__ */ E(\n \"div\",\n {\n ref: w,\n className: L(\n \"relative h-1.5 w-full rounded-full bg-muted cursor-pointer\",\n l && \"cursor-not-allowed\",\n d\n ),\n onPointerDown: M,\n children: [\n /* @__PURE__ */ i(\n \"div\",\n {\n className: L(\n \"absolute h-full rounded-full pointer-events-none\",\n // pointer-events are disabled so that user interactions are handled by the track element, enabling correct slider behavior\n !k.current && \"transition-all\",\n m\n ),\n style: { width: `${K}%` }\n }\n ),\n /* @__PURE__ */ i(\n \"div\",\n {\n className: L(\n \"absolute size-5 -top-2 rounded-full shadow-md cursor-grab\",\n l && \"cursor-not-allowed\",\n !l && \"cursor-grab focus:outline-none focus:ring-2\",\n k.current ? \"cursor-grabbing scale-110\" : \"transition-all\",\n f\n ),\n style: { left: `calc(${K}% - 10px)` },\n tabIndex: l ? -1 : 0,\n role: \"slider\",\n \"aria-valuemin\": e,\n \"aria-valuemax\": n,\n \"aria-valuenow\": g,\n \"aria-label\": u,\n \"aria-labelledby\": p,\n \"aria-disabled\": l,\n onKeyDown: H,\n onPointerDown: j\n }\n )\n ]\n }\n )\n }\n );\n}\nfunction pr({ children: o, ref: a, ...t }) {\n if (De(o)) {\n let r = { ...t };\n return o.props && (r = { ...r, ...o.props }), Se(o, {\n ...r,\n ref: (e) => {\n typeof a == \"function\" ? a(e) : a && (a.current = e);\n }\n });\n }\n return ze(\"div\", { ...t, ref: a }, o);\n}\nconst jt = ({ defaultValue: o, value: a, onValueChange: t } = {}) => {\n const [r, e] = C(o || \"\"), n = a !== void 0, s = n ? a : r, l = T((d) => {\n n || e(d), t == null || t(d);\n }, [n, t]);\n return {\n value: s,\n onValueChange: l\n };\n};\nfunction vr({\n defaultValue: o,\n value: a,\n onValueChange: t,\n tabsWidth: r = \"fit\",\n variant: e = \"underline\",\n className: n,\n children: s,\n ref: l,\n id: d,\n triggersClassName: m,\n contentClassName: f\n}) {\n const { value: c, onValueChange: b } = jt({\n defaultValue: o,\n value: a,\n onValueChange: t\n }), u = {\n selectedValue: c,\n onValueChange: b,\n tabsWidth: r,\n variant: e,\n triggersClassName: m,\n contentClassName: f\n };\n return /* @__PURE__ */ i(Ze.Provider, { value: u, children: /* @__PURE__ */ i(\"div\", { id: d, ref: l, className: n, \"data-tabs-width\": r, \"data-variant\": e, children: s }) });\n}\nfunction gr({ value: o, className: a, children: t, ref: r }) {\n const { selectedValue: e, contentClassName: n } = ve(), s = e === o;\n return s ? /* @__PURE__ */ i(\n \"div\",\n {\n ref: r,\n role: \"tabpanel\",\n id: `tabs-content-${o}`,\n \"aria-labelledby\": `tabs-trigger-${o}`,\n \"data-state\": s ? \"active\" : \"inactive\",\n \"data-value\": o,\n className: N(\"mt-4 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2\", n, a),\n tabIndex: 0,\n children: t\n }\n ) : null;\n}\nconst ke = {\n width: {\n fit: \"w-fit\",\n full: \"w-full *:flex-1\"\n },\n variant: {\n underline: \"border-b border-border\",\n pills: \"\",\n bordered: \"border border-border rounded-lg p-1\"\n }\n}, Lt = {\n underline: \"border-b-2 border-transparent data-[state=active]:border-accent data-[state=active]:text-accent hover:text-accent-foreground\",\n pills: \"rounded-md data-[state=active]:bg-accent data-[state=active]:text-accent-foreground hover:bg-accent/30\",\n bordered: \"rounded data-[state=active]:bg-accent data-[state=active]:text-accent-foreground hover:bg-accent/30\"\n};\nfunction xr({ children: o, className: a, id: t, ref: r }) {\n const { tabsWidth: e, variant: n } = ve();\n return /* @__PURE__ */ i(\n \"div\",\n {\n id: t,\n ref: r,\n role: \"tablist\",\n className: N(\"flex\", ke.width[e], ke.variant[n], a),\n \"data-tabs-width\": e,\n \"data-variant\": n,\n children: o\n }\n );\n}\nfunction yr({ value: o, disabled: a = !1, className: t, children: r, onClick: e, id: n, ref: s }) {\n const { selectedValue: l, onValueChange: d, variant: m, triggersClassName: f } = ve(), c = l === o, b = (p) => {\n a || d(o), e == null || e(p);\n };\n return /* @__PURE__ */ i(\n \"button\",\n {\n id: n,\n ref: s,\n role: \"tab\",\n type: \"button\",\n \"aria-selected\": c,\n \"aria-controls\": `tabs-content-${o}`,\n \"data-state\": c ? \"active\" : \"inactive\",\n \"data-value\": o,\n disabled: a,\n className: N(\n \"inline-flex items-center justify-center whitespace-nowrap px-3 py-2 text-sm ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\",\n c ? \"font-medium\" : \"font-light\",\n Lt[m],\n f,\n t\n ),\n onClick: b,\n children: r\n }\n );\n}\nfunction Vt({ elementId: o, maxLength: a }) {\n const [t, r] = C(0);\n return R(() => {\n const e = document.getElementById(o);\n if (!e)\n return;\n const n = () => {\n const s = e.value.length;\n r(s);\n const l = s >= a;\n e.setAttribute(\"aria-describedby\", `${o}-character-count`), e.setAttribute(\"aria-invalid\", l ? \"true\" : \"false\"), l ? e.setAttribute(\"data-error\", \"true\") : e.removeAttribute(\"data-error\");\n };\n return n(), e.addEventListener(\"input\", n), e.setAttribute(\"maxlength\", String(a)), () => {\n e.removeEventListener(\"input\", n), e.removeAttribute(\"maxlength\"), e.removeAttribute(\"aria-describedby\"), e.removeAttribute(\"aria-invalid\"), e.removeAttribute(\"data-error\");\n };\n }, [o, a]), /* @__PURE__ */ i(\n \"small\",\n {\n className: N(\n \"mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-end\",\n t >= a && \"text-destructive\",\n t < a && \"text-current\"\n ),\n role: \"status\",\n children: /* @__PURE__ */ E(\"span\", { id: `${o}-character-count`, children: [\n t,\n \" / \",\n a,\n \" characters\"\n ] })\n }\n );\n}\nfunction Bt(o, a) {\n R(() => {\n const t = document.getElementById(o);\n if (!t)\n return;\n if (!a) {\n t.style.height = \"auto\";\n return;\n }\n const r = () => {\n t.style.height = \"auto\", t.style.height = `${t.scrollHeight}px`;\n };\n return r(), t.addEventListener(\"input\", r), t.addEventListener(\"resize\", r), window.addEventListener(\"resize\", r), () => {\n t.removeEventListener(\"input\", r), t.removeEventListener(\"resize\", r), window.removeEventListener(\"resize\", r);\n };\n }, [o, a]);\n}\nconst Wt = {\n base: \"\",\n \"left-line\": \"border-l border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success\",\n outline: \"border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success\"\n}, Kt = {\n none: \"rounded-none\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n full: \"px-3 rounded-full\"\n}, Ee = {\n variant: \"outline\",\n rounded: \"none\"\n};\nfunction wr({\n variant: o = Ee.variant,\n rounded: a,\n displayOnlyMode: t = !1,\n errorMessage: r,\n successMessage: e,\n hideResizeHandle: n = !1,\n autoExpand: s = !1,\n characterLimit: l = 0,\n className: d,\n ...m\n}) {\n const f = P();\n Bt(f, s || t);\n let c = a;\n o === \"outline\" && !a && (c = \"md\"), c = c || Ee.rounded;\n let b = n;\n (t || o === \"left-line\" && !n) && (b = !0);\n const p = N(\n \"appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all\",\n !t && Wt[o],\n !t && Kt[c],\n !t && \"px-2 py-1\",\n t && \"pointer-events-none\",\n b && \"no-resize-handle\",\n d\n );\n return /* @__PURE__ */ E(\"div\", { className: N(\"-space-y-1.5\", t && \"cursor-text\"), children: [\n /* @__PURE__ */ i(\n \"textarea\",\n {\n ...m,\n id: f,\n \"aria-disabled\": m.disabled,\n readOnly: t,\n \"aria-readonly\": t || m[\"aria-readonly\"],\n style: {\n resize: s ? \"none\" : void 0\n },\n className: p\n }\n ),\n l > 0 && /* @__PURE__ */ i(Vt, { elementId: f, maxLength: l }),\n !t && /* @__PURE__ */ i(le, { elementId: f, type: \"error\", message: r }),\n !t && /* @__PURE__ */ i(le, { elementId: f, type: \"success\", message: e })\n ] });\n}\nconst Mt = {\n sm: {\n container: \"h-5 min-w-9 w-9\",\n thumb: \"h-4 w-4\",\n translate: \"translate-x-4\"\n },\n md: {\n container: \"h-6 min-w-11 w-11\",\n thumb: \"h-5 w-5\",\n translate: \"translate-x-5\"\n },\n lg: {\n container: \"h-7 min-w-13 w-13\",\n thumb: \"h-6 w-6\",\n translate: \"translate-x-6\"\n }\n}, Ft = {\n default: {\n unchecked: \"bg-muted\",\n checked: \"bg-primary\"\n },\n success: {\n unchecked: \"bg-muted\",\n checked: \"bg-success\"\n },\n destructive: {\n unchecked: \"bg-muted\",\n checked: \"bg-destructive\"\n }\n}, Ce = {\n variant: \"default\",\n size: \"md\"\n};\nfunction Nr({\n ref: o,\n id: a,\n size: t = Ce.size,\n variant: r = Ce.variant,\n checked: e,\n onCheckedChange: n,\n disabled: s = !1,\n className: l,\n thumbClassName: d,\n backgroundClassNames: m,\n ...f\n}) {\n const c = P(), b = q(() => a || `toggle-${c}`, [a, c]), [u, p] = C(e);\n R(() => {\n p(e);\n }, [e]);\n const v = () => {\n if (!s) {\n const k = !u;\n e === void 0 && p(k), n == null || n(k);\n }\n }, h = (k) => {\n (k.key === \" \" || k.key === \"Enter\") && (k.preventDefault(), v());\n }, y = Mt[t], x = Ft[r], g = N(\n // Base styles\n \"relative inline-flex items-center rounded-full transition-all duration-200 ease-in-out\",\n \"focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2\",\n // Size\n y.container,\n // Variant and state\n u ? (m == null ? void 0 : m.checked) || x.checked : (m == null ? void 0 : m.unchecked) || x.unchecked,\n // Disabled state\n s && \"opacity-50 cursor-not-allowed\",\n !s && \"cursor-pointer\",\n l\n ), w = N(\n // Base thumb styles\n \"absolute left-0.5 top-1/2 -translate-y-1/2 rounded-full bg-white shadow-sm transition-transform duration-200 ease-in-out\",\n // Size\n y.thumb,\n // Position based on state\n u && y.translate,\n d\n );\n return /* @__PURE__ */ E(\n \"button\",\n {\n ref: o,\n id: b,\n type: \"button\",\n role: \"switch\",\n tabIndex: 0,\n \"aria-checked\": u,\n \"aria-disabled\": s,\n disabled: s,\n onClick: v,\n onKeyDown: h,\n className: g,\n ...f,\n children: [\n /* @__PURE__ */ i(\"span\", { className: w }),\n /* @__PURE__ */ i(\"span\", { className: \"sr-only\", children: u ? \"Enabled\" : \"Disabled\" })\n ]\n }\n );\n}\nconst se = 8, ie = 4, X = 6;\nfunction Pt(o) {\n return { calculatePosition: T(\n (t, r) => {\n const e = t.getBoundingClientRect(), n = r.getBoundingClientRect(), s = {\n width: window.innerWidth,\n height: window.innerHeight\n }, l = (b, u, p, v) => b < 0 || u < 0 || b + p > s.width || u + v > s.height, d = {\n top: {\n x: e.left + e.width / 2 - n.width / 2,\n y: e.top - n.height - ie,\n arrow: {\n x: n.width / 2 - X,\n y: n.height\n }\n },\n bottom: {\n x: e.left + e.width / 2 - n.width / 2,\n y: e.bottom + ie,\n arrow: {\n x: n.width / 2 - X,\n y: -6\n }\n },\n left: {\n x: e.left - n.width - ie,\n y: e.top + e.height / 2 - n.height / 2,\n arrow: {\n x: n.width,\n y: n.height / 2 - X\n }\n },\n right: {\n x: e.right + ie,\n y: e.top + e.height / 2 - n.height / 2,\n arrow: {\n x: -6,\n y: n.height / 2 - X\n }\n }\n };\n let m = o, f = d[o];\n if (l(f.x, f.y, n.width, n.height)) {\n const b = {\n top: \"bottom\",\n bottom: \"top\",\n left: \"right\",\n right: \"left\"\n }, u = d[b[o]];\n if (!l(u.x, u.y, n.width, n.height))\n m = b[o], f = u;\n else {\n const p = [\"top\", \"bottom\", \"left\", \"right\"].filter(\n (v) => v !== o && v !== b[o]\n );\n for (const v of p) {\n const h = d[v];\n if (!l(h.x, h.y, n.width, n.height)) {\n m = v, f = h;\n break;\n }\n }\n }\n }\n f.x = Math.max(\n se,\n Math.min(f.x, s.width - n.width - se)\n ), f.y = Math.max(\n se,\n Math.min(f.y, s.height - n.height - se)\n );\n const c = {\n x: e.left + e.width / 2,\n y: e.top + e.height / 2\n };\n return m === \"top\" || m === \"bottom\" ? f.arrow.x = Math.max(\n X,\n Math.min(c.x - f.x - X, n.width - X * 2)\n ) : f.arrow.y = Math.max(\n X,\n Math.min(c.y - f.y - X, n.height - X * 2)\n ), {\n ...f,\n placement: m\n };\n },\n [o]\n ) };\n}\nfunction Gt(o, a, t) {\n const r = B(null), e = B(null), n = T(() => {\n if (!r.current || !e.current) return;\n const s = o(r.current, e.current);\n t(s);\n }, [o, t]);\n return R(() => {\n if (!a) return;\n const s = () => n();\n return window.addEventListener(\"resize\", s), () => {\n window.removeEventListener(\"resize\", s);\n };\n }, [a, n]), {\n triggerRef: r,\n tooltipRef: e,\n updatePosition: n\n };\n}\nfunction Ht(o, a, t, r, e, n, s, l, d) {\n const m = B(null), f = T(() => {\n o || (m.current && clearTimeout(m.current), m.current = window.setTimeout(() => {\n t(!0), requestAnimationFrame(() => {\n e(), r(!0);\n });\n }, a));\n }, [o, a, t, e, r]), c = T(\n (b = !1) => {\n if (m.current && clearTimeout(m.current), b) {\n r(!1), setTimeout(() => t(!1), 150);\n return;\n }\n m.current = window.setTimeout(() => {\n r(!1), setTimeout(() => t(!1), 150);\n }, 100);\n },\n [r, t]\n );\n return R(() => {\n !n && !s && !l && d && c();\n }, [n, s, l, d, c]), R(() => () => {\n m.current && clearTimeout(m.current);\n }, []), {\n showTooltip: f,\n hideTooltip: c,\n timeoutRef: m\n };\n}\nfunction kr({\n id: o,\n children: a,\n message: t,\n placement: r = \"top\",\n disabled: e = !1,\n delay: n = 200,\n className: s\n}) {\n const [l, d] = C(!1), [m, f] = C(!1), [c, b] = C(null), [u, p] = C(!1), [v, h] = C(!1), [y, x] = C(!1), { calculatePosition: g } = Pt(r), { triggerRef: w, tooltipRef: k, updatePosition: I } = Gt(g, m, b), { showTooltip: D, hideTooltip: $, timeoutRef: M } = Ht(\n e,\n n,\n f,\n d,\n I,\n u,\n v,\n y,\n l\n ), j = P(), H = o ?? j;\n return /* @__PURE__ */ E(Y, { children: [\n G.cloneElement(a, {\n ref: (K) => {\n w.current = K;\n },\n onMouseEnter: () => {\n p(!0), D();\n },\n onMouseLeave: () => {\n p(!1);\n },\n onFocus: () => {\n x(!0), D();\n },\n onBlur: () => {\n x(!1), $(!0);\n },\n onKeyDown: (K) => {\n K.key === \"Escape\" && $(!0);\n },\n \"aria-describedby\": e ? void 0 : H\n }),\n m && ce(\n /* @__PURE__ */ i(\n \"div\",\n {\n ref: k,\n id: H,\n role: \"tooltip\",\n className: N(\n \"fixed z-50 px-2 py-1 text-sm rounded shadow-lg bg-popover pointer-events-auto transition-all duration-150 ease-out\",\n l ? \"opacity-100\" : \"opacity-0\",\n s\n ),\n style: c ? { left: c.x, top: c.y } : { opacity: 0 },\n onMouseEnter: () => {\n h(!0), M.current && clearTimeout(M.current);\n },\n onMouseLeave: () => {\n h(!1);\n },\n children: t\n }\n ),\n document.body\n )\n ] });\n}\nexport {\n Ot as Accordion,\n me as AccordionItem,\n zr as ActionModal,\n Ye as Button,\n er as Carousel,\n tr as Checkbox,\n rr as Clickable,\n nr as CodeBlock,\n ar as Disclosure,\n or as Input,\n sr as Label,\n Ue as LoadingDots,\n ir as Modal,\n lr as Pagination,\n cr as Panel,\n dr as RadioGroup,\n be as RadioGroupItem,\n zt as RadioInput,\n ur as ScrollArea,\n fr as Select,\n mr as Separator,\n hr as Skeleton,\n br as Slider,\n pr as Slot,\n vr as Tabs,\n gr as TabsContent,\n xr as TabsList,\n yr as TabsTrigger,\n wr as Textarea,\n $r as Toast,\n Nr as Toggle,\n kr as Tooltip\n};\n//# sourceMappingURL=components.esm.js.map\n","import { Modal, ModalProps } from '@moondreamsdev/dreamer-ui/components';\nimport React, { useMemo } from 'react';\n\ninterface BaseActionModalProps extends Omit<ModalProps, 'children' | 'actions'> {\n message: React.ReactNode;\n destructive?: boolean;\n}\n\ninterface AlertModalProps extends BaseActionModalProps {\n type: 'alert';\n confirmText?: string;\n onConfirm?: () => void;\n // Cancel-related props are not allowed for alerts\n cancelText?: never;\n}\n\ninterface ConfirmModalProps extends BaseActionModalProps {\n type: 'confirm';\n confirmText?: string;\n cancelText?: string;\n onConfirm?: () => void;\n}\n\nexport type ActionModalProps = AlertModalProps | ConfirmModalProps;\n\nexport function ActionModal({\n type,\n message,\n cancelText,\n confirmText,\n onConfirm,\n onClose,\n destructive = false,\n title,\n ...modalProps\n}: ActionModalProps) {\n const defaultTexts = useMemo(() => {\n if (type === 'confirm') {\n return {\n confirm: confirmText || 'Confirm',\n cancel: cancelText || 'Cancel',\n defaultTitle: title || 'Confirm Action',\n };\n }\n return {\n confirm: confirmText || 'OK',\n cancel: null,\n defaultTitle: title || 'Alert',\n };\n }, [type, confirmText, title, cancelText]);\n\n const actions: ModalProps['actions'] = useMemo(\n () => [\n ...(defaultTexts.cancel\n ? [\n {\n label: defaultTexts.cancel,\n variant: 'secondary' as const,\n onClick: onClose,\n },\n ]\n : []),\n {\n label: defaultTexts.confirm,\n variant: destructive ? 'destructive' : 'primary',\n onClick: () => {\n onConfirm?.();\n onClose();\n },\n },\n ],\n [defaultTexts, destructive, onConfirm, onClose]\n );\n\n return (\n <Modal\n {...modalProps}\n title={title || defaultTexts.defaultTitle}\n onClose={onClose}\n actions={actions}\n disableCloseOnOverlayClick={type === 'confirm'}\n hideCloseButton={type === 'confirm'}\n >\n {typeof message === 'string' ? <p className='text-sm'>{message}</p> : message}\n </Modal>\n );\n}\n","import { createContext, useContext } from 'react';\nimport { TabsVariant, TabsWidth } from './variants';\n\nexport interface TabsContextValue {\n selectedValue: string;\n onValueChange: (value: string) => void;\n tabsWidth: TabsWidth;\n variant: TabsVariant;\n triggersClassName?: string;\n contentClassName?: string;\n}\n\nexport const TabsContext = createContext<TabsContextValue | null>(null);\n\nexport const useTabsContext = () => {\n const context = useContext(TabsContext);\n if (!context) {\n throw new Error('Tabs components must be used within a Tabs component');\n }\n return context;\n};\n","import { ReactNode, useCallback, useEffect, useState } from 'react';\nimport { CrossCircled, ExclamationTriangle, InfoCircled, X } from '../../symbols';\nimport { join } from '../../utils';\nexport type ToastType = 'info' | 'warning' | 'error';\n\nexport interface ToastAction {\n label: string;\n onClick: () => void;\n}\n\n/** Data for a toast notification */\nexport interface ToastData {\n id: string;\n title: string;\n description?: string;\n type?: ToastType;\n action?: ToastAction;\n duration?: number;\n onRemove?: (id: string) => void;\n}\n\ninterface ToastProps extends ToastData {\n customTypes?: Record<string, { className: string; icon?: ReactNode }>;\n customComponent?: React.ComponentType<ToastData>;\n}\n\nconst defaultTypeStyles: Record<ToastType, { className: string; icon: ReactNode }> = {\n info: {\n className: 'bg-blue-50 border-blue-200 text-blue-900 dark:bg-blue-800 dark:border-blue-950 dark:text-blue-100',\n icon: <InfoCircled size={20} />,\n },\n warning: {\n className:\n 'bg-yellow-50 border-yellow-200 text-yellow-900 dark:bg-yellow-800 dark:border-yellow-950 dark:text-yellow-100',\n icon: <ExclamationTriangle size={20} />,\n },\n error: {\n className: 'bg-red-50 border-red-200 text-red-900 dark:bg-red-800 dark:border-red-950 dark:text-red-100',\n icon: <CrossCircled size={20} />,\n },\n};\n\nexport function Toast({\n id,\n title,\n description,\n type = 'info',\n action,\n duration = 5000,\n onRemove,\n customTypes,\n customComponent: CustomComponent,\n}: ToastProps) {\n const [isExiting, setIsExiting] = useState(false);\n\n const handleRemove = useCallback(() => {\n setIsExiting(true);\n setTimeout(() => {\n onRemove?.(id);\n }, 150); // Match animation duration\n }, [id, onRemove]);\n\n useEffect(() => {\n if (duration > 0) {\n const timer = setTimeout(() => {\n handleRemove();\n }, duration);\n\n return () => clearTimeout(timer);\n }\n }, [duration, id, onRemove, handleRemove]);\n\n if (CustomComponent) {\n return (\n <CustomComponent\n id={id}\n title={title}\n description={description}\n type={type}\n action={action}\n duration={duration}\n onRemove={onRemove}\n />\n );\n }\n\n // Check custom types first, then fall back to default\n const typeStyle = customTypes?.[type] || defaultTypeStyles[type as ToastType] || defaultTypeStyles.info;\n\n return (\n <div\n role={type === 'error' ? 'alert' : 'status'}\n aria-live={type === 'error' ? undefined : 'polite'}\n className={join(\n 'relative flex items-start p-4 rounded-lg border shadow-lg transition-all duration-150 ease-in-out',\n action && 'pb-3',\n typeStyle.className,\n isExiting ? 'opacity-0 translate-x-full' : 'opacity-100 translate-x-0'\n )}\n >\n {/* Icon */}\n <div className='flex-shrink-0 mr-3'>{typeStyle.icon}</div>\n\n {/* Content */}\n <div className='flex-grow min-w-0'>\n <div className='font-medium text-sm leading-5'>{title}</div>\n {description && <div className='mt-1 text-sm opacity-90 leading-5'>{description}</div>}\n {action && (\n <div className='mt-1.5'>\n <button\n onClick={action.onClick}\n className='text-sm font-medium underline hover:no-underline focus:outline-none focus:ring-1 focus:ring-current rounded px-1 py-0.5 hover:cursor-pointer'\n >\n {action.label}\n </button>\n </div>\n )}\n </div>\n\n {/* Close button */}\n <button\n onClick={handleRemove}\n className='flex-shrink-0 ml-3 p-1 rounded-md hover:bg-black/10 dark:hover:bg-white/10 focus:outline-none focus:ring-1 focus:ring-current leading-0'\n >\n <X size={16} />\n </button>\n </div>\n );\n}\n"],"names":["n","t","s","h","C","l","i","e","N","Ue","o","a","R","r","Xe","Je","Qe","he","Ye","m","c","E","vt","gt","xt","B","T","ir","f","b","u","P","p","v","x","G","g","w","k","I","D","$","Y","ce","L","ge","ActionModal","type","message","cancelText","confirmText","onConfirm","onClose","destructive","title","modalProps","defaultTexts","useMemo","actions","jsx","Modal","TabsContext","createContext","useTabsContext","context","useContext","defaultTypeStyles","InfoCircled","ExclamationTriangle","CrossCircled","Toast","id","description","action","duration","onRemove","customTypes","CustomComponent","isExiting","setIsExiting","useState","handleRemove","useCallback","useEffect","timer","typeStyle","jsxs","join","X"],"mappings":";;;;;AAAA,SAASA,KAAKC,GAAG;AACf,SAAOA,EAAE,OAAO,CAACC,MAAM,OAAOA,KAAK,YAAYA,CAAC,EAAE,KAAK,GAAG,EAAE,KAAM,KAAI;AACxE;ACgFA,SAASC,EAAE,EAAE,MAAMC,IAAI,IAAI,OAAOC,IAAI,gBAAgB,WAAWL,IAAI,UAAU,GAAGM,EAAC,GAAI;AACrF,SAAuBC,gBAAAA;AAAAA,IACrB;AAAA,IACA;AAAA,MACE,GAAGD;AAAA,MACH,OAAOF;AAAA,MACP,QAAQA;AAAA,MACR,WAAWJ;AAAA,MACX,SAAS;AAAA,MACT,OAAO;AAAA,MACP,UAA0BO,gBAAAA;AAAAA,QACxB;AAAA,QACA;AAAA,UACE,GAAG;AAAA,UACH,MAAMF;AAAA,UACN,UAAU;AAAA,UACV,UAAU;AAAA,QACpB;AAAA,MACA;AAAA,IACA;AAAA,EACG;AACH;AClGA,SAASG,KAAK,GAAG;AACf,SAAO,EAAE,OAAO,CAAC,MAAM,OAAO,KAAK,YAAY,CAAC,EAAE,KAAK,GAAG,EAAE,KAAM,KAAI;AACxE;AA0BAP,EAAE,MAAM;AACRA,EAAE,IAAI;AACNA,EAAE,IAAI;AACNA,EAAE,IAAI;AACNA,EAAE,IAAI;AACNA,EAAE,IAAI;AACNA,EAAE,IAAI;AACNA,EAAE,IAAI;AACNA,EAAE,IAAI;AACNA,EAAE,IAAI;AACNA,EAAE,IAAI;AACNA,EAAE,IAAI;AACNA,EAAE,IAAI;AACNA,EAAE,IAAI;AACNA,EAAE,IAAI;AACNA,EAAE,IAAI;AACNA,EAAE,MAAM;AACRA,EAAE,MAAM;AACRA,EAAE,IAAI;AACNA,EAAE,MAAM;AACRA,EAAE,MAAM;AACRA,EAAE,IAAI;AACNA,EAAE,IAAI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-0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const r=require("react/jsx-runtime"),e=require("react"),S=require("react-dom"),g=require("./X-CgjeP2OI.cjs"),B=require("./join-BVMUUvyP.cjs");function v(...t){return t.filter(l=>typeof l=="string"&&l).join(" ").trim()||void 0}function M({size:t=15,color:l="currentColor",className:a="inline",...n}){return r.jsx("svg",{...n,width:t,height:t,className:a,viewBox:"0 0 15 15",xmlns:"http://www.w3.org/2000/svg",children:r.jsx("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:l,fillRule:"evenodd",clipRule:"evenodd"})})}function y(...t){return t.filter(l=>typeof l=="string"&&l).join(" ").trim()||void 0}e.createContext(void 0);e.createContext(null);e.createContext(null);e.createContext(null);e.createContext(null);e.createContext(null);e.createContext(null);e.createContext(null);e.createContext(null);e.createContext(null);e.createContext(null);e.createContext(null);e.createContext(null);e.createContext(null);e.createContext(null);e.createContext(null);e.createContext(void 0);e.createContext(void 0);e.createContext(null);e.createContext(void 0);e.createContext(void 0);e.createContext(null);e.createContext(null);e.createContext(null);e.createContext(null);e.createContext(null);e.createContext(null);e.createContext(null);e.createContext(null);e.createContext(null);e.createContext(null);e.createContext(null);e.createContext(null);e.createContext(null);e.createContext(null);function O(){const[t,l]=e.useState(0);return e.useEffect(()=>{const a=setInterval(()=>{l(n=>(n+1)%3)},500);return()=>clearInterval(a)},[]),r.jsx("div",{className:"absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle",children:[0,1,2].map(a=>r.jsx("div",{className:v("rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current",t===a&&"transform -translate-y-1")},a))})}const D={base:"",primary:"bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/85 disabled:bg-muted/80 disabled:text-muted-foreground/80",tertiary:"text-primary hover:text-primary-foreground disabled:text-muted",outline:"border border-primary text-primary hover:border-primary-foreground hover:text-primary-foreground disabled:border-muted disabled:text-muted",link:"underline-offset-4 hover:underline disabled:underline disabled:text-muted",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/85 disabled:bg-muted disabled:text-muted-foreground"},X={stripped:"",fitted:"size-fit",sm:"px-2 py-1 text-sm",md:"px-4 py-2 text-base",lg:"px-6 py-3 text-lg",icon:"p-1 w-fit aspect-square",full:"p-2 w-full"},H={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"},p={variant:"primary",size:"md",rounded:"md"};function P({variant:t=p.variant,size:l,rounded:a=p.rounded,loading:n,linkTo:o,linkProps:s,type:i="button",className:c,...d}){let u;t==="link"&&!l?u="fitted":u=l||p.size;const x=v("appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all",D[t],X[u],H[a],n&&"relative pointer-events-none",o&&"relative",c);return r.jsxs("button",{...d,role:o?"link":d.role,"aria-label":d["aria-label"]||(s==null?void 0:s["aria-label"]),"aria-description":d["aria-description"]||(s==null?void 0:s["aria-description"]),"aria-disabled":d.disabled||n,"aria-busy":n,type:i,className:x,children:[n&&r.jsx(O,{}),r.jsx("span",{className:v(n&&"invisible"),children:d.children}),o&&!d.disabled&&r.jsx("a",{...s,"aria-hidden":!0,href:o,rel:(s==null?void 0:s.rel)||"noreferrer",className:"absolute inset-0"})]})}function F(t){const[l,a]=e.useState(!1),[n,o]=e.useState(!1);return e.useEffect(()=>{t?(o(!0),setTimeout(()=>a(!0),10)):(a(!1),setTimeout(()=>o(!1),150))},[t]),{show:l,shouldRender:n}}function G(t,l){e.useEffect(()=>{const a=n=>{n.key==="Escape"&&t&&l()};return document.addEventListener("keydown",a),t&&(document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",a),document.body.style.overflow="auto"}},[t,l])}function J(t,l){const a=e.useRef(null),n=e.useCallback(()=>{const o=document.getElementById(t);if(!o)return;const s=o.querySelectorAll('[data-modal-action="true"]');if(s.length>0){s[0].focus();return}const i=o.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(i.length>0){const c=Array.from(i).filter(d=>!(d instanceof HTMLButtonElement&&d.getAttribute("data-modal-close-button")==="true"));if(c.length>0){c[0].focus();return}i[0].focus();return}o.focus()},[t]);e.useEffect(()=>(l&&(a.current=document.activeElement,n()),()=>{document.body.style.overflow="auto",a.current instanceof HTMLElement&&a.current.focus()}),[l,n])}function K({id:t,isOpen:l,onClose:a,title:n,children:o,contentOnly:s=!1,className:i,overlayClassName:c,hideCloseButton:d=!1,actions:u=[],disableCloseOnOverlayClick:x=!1,ariaLabelledBy:m,ariaDescribedBy:f}){const b=e.useId(),C=t||`modal-${b}`,j=t?`${t}-title`:`modal-title-${b}`,{show:k,shouldRender:h}=F(l);if(J(C,h),G(h,a),!h)return null;const E=()=>n?e.isValidElement(n)?r.jsx("div",{className:"mb-4",children:n}):r.jsx("h2",{className:"mb-4 text-xl font-semibold",id:j,children:n}):null,T=()=>u.length===0?null:r.jsx("div",{className:"mt-6 not-sm:grid gap-y-2 sm:flex sm:justify-start sm:flex-row-reverse sm:gap-x-3",children:u.map((L,z)=>{const{label:q,className:A,...I}=L;return r.jsx(P,{className:A,type:"button",...I,"data-modal-action":"true",children:q},z)})});return r.jsx(r.Fragment,{children:S.createPortal(r.jsx("div",{"aria-labelledby":m??n?j:void 0,"aria-describedby":f,role:"dialog","aria-modal":"true",className:"fixed inset-0 z-[100] overflow-y-auto",children:r.jsxs("div",{className:"flex min-h-screen items-center justify-center p-4",children:[r.jsx("div",{className:y("fixed inset-0 bg-black/20 transition-all",c),onClick:()=>{x||a()}}),s&&r.jsx("div",{className:y("relative w-fit",i),children:o}),!s&&r.jsxs("div",{id:C,tabIndex:-1,className:y("relative w-full max-w-xl transform rounded-lg shadow-xl bg-popover transition-all p-6 focus:ring ease-in duration-75",k?"opacity-100 scale-100":"opacity-0 scale-90",i),children:[!d&&r.jsx("button",{type:"button",onClick:a,"data-modal-close-button":"true",className:"rounded-md p-0.5 top-2.5 right-2.5 absolute opacity-80 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-gray-500 leading-0",children:r.jsx(M,{size:18})}),E(),o,T()]})]})}),document.body)})}function Q({type:t,message:l,cancelText:a,confirmText:n,onConfirm:o,onClose:s,destructive:i=!1,title:c,...d}){const u=e.useMemo(()=>t==="confirm"?{confirm:n||"Confirm",cancel:a||"Cancel",defaultTitle:c||"Confirm Action"}:{confirm:n||"OK",cancel:null,defaultTitle:c||"Alert"},[t,n,c,a]),x=e.useMemo(()=>[...u.cancel?[{label:u.cancel,variant:"secondary",onClick:s}]:[],{label:u.confirm,variant:i?"destructive":"primary",onClick:()=>{o==null||o(),s()}}],[u,i,o,s]);return r.jsx(K,{...d,title:c||u.defaultTitle,onClose:s,actions:x,disableCloseOnOverlayClick:t==="confirm",hideCloseButton:t==="confirm",children:typeof l=="string"?r.jsx("p",{className:"text-sm",children:l}):l})}const N=e.createContext(null),U=()=>{const t=e.useContext(N);if(!t)throw new Error("Tabs components must be used within a Tabs component");return t},w={info:{className:"bg-blue-50 border-blue-200 text-blue-900 dark:bg-blue-800 dark:border-blue-950 dark:text-blue-100",icon:r.jsx(g.InfoCircled,{size:20})},warning:{className:"bg-yellow-50 border-yellow-200 text-yellow-900 dark:bg-yellow-800 dark:border-yellow-950 dark:text-yellow-100",icon:r.jsx(g.ExclamationTriangle,{size:20})},error:{className:"bg-red-50 border-red-200 text-red-900 dark:bg-red-800 dark:border-red-950 dark:text-red-100",icon:r.jsx(g.CrossCircled,{size:20})}};function V({id:t,title:l,description:a,type:n="info",action:o,duration:s=5e3,onRemove:i,customTypes:c,customComponent:d}){const[u,x]=e.useState(!1),m=e.useCallback(()=>{x(!0),setTimeout(()=>{i==null||i(t)},150)},[t,i]);if(e.useEffect(()=>{if(s>0){const b=setTimeout(()=>{m()},s);return()=>clearTimeout(b)}},[s,t,i,m]),d)return r.jsx(d,{id:t,title:l,description:a,type:n,action:o,duration:s,onRemove:i});const f=(c==null?void 0:c[n])||w[n]||w.info;return r.jsxs("div",{role:n==="error"?"alert":"status","aria-live":n==="error"?void 0:"polite",className:B.join("relative flex items-start p-4 rounded-lg border shadow-lg transition-all duration-150 ease-in-out",o&&"pb-3",f.className,u?"opacity-0 translate-x-full":"opacity-100 translate-x-0"),children:[r.jsx("div",{className:"flex-shrink-0 mr-3",children:f.icon}),r.jsxs("div",{className:"flex-grow min-w-0",children:[r.jsx("div",{className:"font-medium text-sm leading-5",children:l}),a&&r.jsx("div",{className:"mt-1 text-sm opacity-90 leading-5",children:a}),o&&r.jsx("div",{className:"mt-1.5",children:r.jsx("button",{onClick:o.onClick,className:"text-sm font-medium underline hover:no-underline focus:outline-none focus:ring-1 focus:ring-current rounded px-1 py-0.5 hover:cursor-pointer",children:o.label})})]}),r.jsx("button",{onClick:m,className:"flex-shrink-0 ml-3 p-1 rounded-md hover:bg-black/10 dark:hover:bg-white/10 focus:outline-none focus:ring-1 focus:ring-current leading-0",children:r.jsx(g.X,{size:16})})]})}exports.ActionModal=Q;exports.TabsContext=N;exports.Toast=V;exports.n=v;exports.useTabsContext=U;
|
|
2
|
+
//# sourceMappingURL=Toast-eJp5Ks3u.cjs.map
|