@moondreamsdev/dreamer-ui 1.7.7-test.7 → 1.7.7-test.8

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.
@@ -1 +1 @@
1
- {"version":3,"file":"Toast-DfNdN3Lk.js","sources":["utils.esm.js","X-CIoyLewf.js","Toast-C84BREWE.js","components.esm.js","../src/components/actionmodal/ActionModal.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 join\n};\n//# sourceMappingURL=utils.esm.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 S, jsxs as f } from \"react/jsx-runtime\";\nimport q, { createContext as F, useId as H, useState as y, useEffect as b, useRef as K, useCallback as E, useMemo as C } from \"react\";\nimport { createPortal as P } from \"react-dom\";\nimport { X as D, C as V, E as X, I as Z } from \"./X-CIoyLewf.js\";\nimport { join as _ } from \"./utils.esm.js\";\nfunction w(...e) {\n return e.filter((l) => typeof l == \"string\" && l).join(\" \").trim() || void 0;\n}\nfunction G({ size: e = 15, color: l = \"currentColor\", className: n = \"inline\", ...t }) {\n return /* @__PURE__ */ r(\n \"svg\",\n {\n ...t,\n width: e,\n height: e,\n className: n,\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: l,\n fillRule: \"evenodd\",\n clipRule: \"evenodd\"\n }\n )\n }\n );\n}\nfunction v(...e) {\n return e.filter((l) => typeof l == \"string\" && l).join(\" \").trim() || void 0;\n}\nF(void 0);\nfunction J() {\n const [e, l] = y(0);\n return b(() => {\n const n = setInterval(() => {\n l((t) => (t + 1) % 3);\n }, 500);\n return () => clearInterval(n);\n }, []), /* @__PURE__ */ r(\"div\", { className: \"absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle\", children: [0, 1, 2].map((n) => /* @__PURE__ */ r(\n \"div\",\n {\n className: w(\n \"rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current\",\n e === n && \"transform -translate-y-1\"\n )\n },\n n\n )) });\n}\nconst Q = {\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}, R = {\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}, U = {\n none: \"rounded-none\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n full: \"rounded-full\"\n}, x = {\n variant: \"primary\",\n size: \"md\",\n rounded: \"md\"\n};\nfunction W({\n variant: e = x.variant,\n size: l,\n rounded: n = x.rounded,\n loading: t,\n linkTo: i,\n linkProps: a,\n type: o = \"button\",\n className: s,\n ...d\n}) {\n let c;\n e === \"link\" && !l ? c = \"fitted\" : c = l || x.size;\n const u = w(\n \"appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all\",\n Q[e],\n R[c],\n U[n],\n t && \"relative pointer-events-none\",\n i && \"relative\",\n s\n );\n return /* @__PURE__ */ f(\n \"button\",\n {\n ...d,\n role: i ? \"link\" : d.role,\n \"aria-label\": d[\"aria-label\"] || (a == null ? void 0 : a[\"aria-label\"]),\n \"aria-description\": d[\"aria-description\"] || (a == null ? void 0 : a[\"aria-description\"]),\n \"aria-disabled\": d.disabled || t,\n \"aria-busy\": t,\n type: o,\n className: u,\n children: [\n t && /* @__PURE__ */ r(J, {}),\n /* @__PURE__ */ r(\"span\", { className: w(t && \"invisible\"), children: d.children }),\n i && !d.disabled && /* @__PURE__ */ r(\n \"a\",\n {\n ...a,\n \"aria-hidden\": !0,\n href: i,\n rel: (a == null ? void 0 : a.rel) || \"noreferrer\",\n className: \"absolute inset-0\"\n }\n )\n ]\n }\n );\n}\nfunction Y(e) {\n const [l, n] = y(!1), [t, i] = y(!1);\n return b(() => {\n e ? (i(!0), setTimeout(() => n(!0), 10)) : (n(!1), setTimeout(() => i(!1), 150));\n }, [e]), { show: l, shouldRender: t };\n}\nfunction $(e, l) {\n b(() => {\n const n = (t) => {\n t.key === \"Escape\" && e && l();\n };\n return document.addEventListener(\"keydown\", n), e && (document.body.style.overflow = \"hidden\"), () => {\n document.removeEventListener(\"keydown\", n), document.body.style.overflow = \"auto\";\n };\n }, [e, l]);\n}\nfunction ee(e, l) {\n const n = K(null), t = E(() => {\n const i = document.getElementById(e);\n if (!i) return;\n const a = i.querySelectorAll('[data-modal-action=\"true\"]');\n if (a.length > 0) {\n a[0].focus();\n return;\n }\n const o = i.querySelectorAll(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])'\n );\n if (o.length > 0) {\n const s = Array.from(o).filter((d) => !(d instanceof HTMLButtonElement && d.getAttribute(\"data-modal-close-button\") === \"true\"));\n if (s.length > 0) {\n s[0].focus();\n return;\n }\n o[0].focus();\n return;\n }\n i.focus();\n }, [e]);\n b(() => (l && (n.current = document.activeElement, t()), () => {\n document.body.style.overflow = \"auto\", n.current instanceof HTMLElement && n.current.focus();\n }), [l, t]);\n}\nfunction te({\n id: e,\n isOpen: l,\n onClose: n,\n title: t,\n children: i,\n contentOnly: a = !1,\n className: o,\n overlayClassName: s,\n hideCloseButton: d = !1,\n actions: c = [],\n disableCloseOnOverlayClick: u = !1,\n ariaLabelledBy: m,\n ariaDescribedBy: g\n}) {\n const h = H(), N = e || `modal-${h}`, k = e ? `${e}-title` : `modal-title-${h}`, { show: z, shouldRender: p } = Y(l);\n if (ee(N, p), $(p, n), !p) return null;\n const T = () => t ? q.isValidElement(t) ? /* @__PURE__ */ r(\"div\", { className: \"mb-4\", children: t }) : /* @__PURE__ */ r(\"h2\", { className: \"mb-4 text-xl font-semibold\", id: k, children: t }) : null, j = () => 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, I) => {\n const { label: B, className: O, ...M } = A;\n return /* @__PURE__ */ r(W, { className: O, type: \"button\", ...M, \"data-modal-action\": \"true\", children: B }, I);\n }) });\n return /* @__PURE__ */ r(S, { children: P(\n /* @__PURE__ */ r(\n \"div\",\n {\n \"aria-labelledby\": m ?? t ? k : void 0,\n \"aria-describedby\": g,\n role: \"dialog\",\n \"aria-modal\": \"true\",\n className: \"fixed inset-0 z-[100] overflow-y-auto\",\n children: /* @__PURE__ */ f(\"div\", { className: \"flex min-h-screen items-center justify-center p-4\", children: [\n /* @__PURE__ */ r(\n \"div\",\n {\n className: v(\"fixed inset-0 bg-black/20 transition-all\", s),\n onClick: () => {\n u || n();\n }\n }\n ),\n a && /* @__PURE__ */ r(\"div\", { className: v(\"relative w-fit\", o), children: i }),\n !a && /* @__PURE__ */ f(\n \"div\",\n {\n id: N,\n tabIndex: -1,\n className: v(\n \"relative w-full max-w-xl transform rounded-lg shadow-xl transition-all p-6 bg-inherit focus:ring ease-in duration-75\",\n z ? \"opacity-100 scale-100\" : \"opacity-0 scale-90\",\n o\n ),\n children: [\n !d && /* @__PURE__ */ r(\n \"button\",\n {\n type: \"button\",\n onClick: n,\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(G, { size: 18 })\n }\n ),\n T(),\n i,\n j()\n ]\n }\n )\n ] })\n }\n ),\n document.body\n ) });\n}\nfunction oe({\n type: e,\n message: l,\n cancelText: n,\n confirmText: t,\n onConfirm: i,\n onClose: a,\n destructive: o = !1,\n title: s,\n ...d\n}) {\n const c = C(() => e === \"confirm\" ? {\n confirm: t || \"Confirm\",\n cancel: n || \"Cancel\",\n defaultTitle: s || \"Confirm Action\"\n } : {\n confirm: t || \"OK\",\n cancel: null,\n defaultTitle: s || \"Alert\"\n }, [e, t, s, n]), u = C(\n () => [\n ...c.cancel ? [\n {\n label: c.cancel,\n variant: \"secondary\",\n onClick: a\n }\n ] : [],\n {\n label: c.confirm,\n variant: o ? \"destructive\" : \"primary\",\n onClick: () => {\n i == null || i(), a();\n }\n }\n ],\n [c, o, i, a]\n );\n return /* @__PURE__ */ r(\n te,\n {\n ...d,\n title: s || c.defaultTitle,\n onClose: a,\n actions: u,\n disableCloseOnOverlayClick: e === \"confirm\",\n hideCloseButton: e === \"confirm\",\n children: typeof l == \"string\" ? /* @__PURE__ */ r(\"p\", { className: \"text-sm\", children: l }) : l\n }\n );\n}\nconst 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(Z, { 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(X, { 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(V, { size: 20 })\n }\n};\nfunction de({\n id: e,\n title: l,\n description: n,\n type: t = \"info\",\n action: i,\n duration: a = 5e3,\n onRemove: o,\n customTypes: s,\n customComponent: d\n}) {\n const [c, u] = y(!1), m = E(() => {\n u(!0), setTimeout(() => {\n o == null || o(e);\n }, 150);\n }, [e, o]);\n if (b(() => {\n if (a > 0) {\n const h = setTimeout(() => {\n m();\n }, a);\n return () => clearTimeout(h);\n }\n }, [a, e, o, m]), d)\n return /* @__PURE__ */ r(\n d,\n {\n id: e,\n title: l,\n description: n,\n type: t,\n action: i,\n duration: a,\n onRemove: o\n }\n );\n const g = (s == null ? void 0 : s[t]) || L[t] || L.info;\n return /* @__PURE__ */ f(\n \"div\",\n {\n role: t === \"error\" ? \"alert\" : \"status\",\n \"aria-live\": t === \"error\" ? void 0 : \"polite\",\n className: _(\n \"relative flex items-start p-4 rounded-lg border shadow-lg transition-all duration-150 ease-in-out\",\n i && \"pb-3\",\n g.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: g.icon }),\n /* @__PURE__ */ f(\"div\", { className: \"flex-grow min-w-0\", children: [\n /* @__PURE__ */ r(\"div\", { className: \"font-medium text-sm leading-5\", children: l }),\n n && /* @__PURE__ */ r(\"div\", { className: \"mt-1 text-sm opacity-90 leading-5\", children: n }),\n i && /* @__PURE__ */ r(\"div\", { className: \"mt-1.5\", children: /* @__PURE__ */ r(\n \"button\",\n {\n onClick: i.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: i.label\n }\n ) })\n ] }),\n /* @__PURE__ */ r(\n \"button\",\n {\n onClick: m,\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(D, { size: 16 })\n }\n )\n ]\n }\n );\n}\nexport {\n oe as A,\n de as T,\n w as n\n};\n//# sourceMappingURL=Toast-C84BREWE.js.map\n","import { jsxs as E, jsx as c, Fragment as W } from \"react/jsx-runtime\";\nimport D, { useId as $, useState as x, createElement as Y, useEffect as A, useCallback as I, useMemo as U, useRef as R, isValidElement as ee, cloneElement as te } from \"react\";\nimport { join as y } from \"./utils.esm.js\";\nimport { b as re, C as ne, a as oe, c as ae, E as se, Q as ie } from \"./QuestionMarkCircled-BVBF3skB.js\";\nimport { n as k } from \"./Toast-C84BREWE.js\";\nimport { A as at, T as st } from \"./Toast-C84BREWE.js\";\nimport { E as le, X as P } from \"./X-CIoyLewf.js\";\nimport { createPortal as _ } from \"react-dom\";\nfunction q({\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: u = \"\",\n bodyClassName: d = \"\"\n}) {\n const b = $(), i = o || `accordion-item-${b}`, v = `${i}-header`, f = `${i}-panel`, m = () => {\n !n && l && l();\n }, g = (h) => {\n (h.key === \"Enter\" || h.key === \" \") && (h.preventDefault(), m());\n };\n return /* @__PURE__ */ E(\"div\", { className: y(\"border-b border-gray-200\", n && \"opacity-60 cursor-not-allowed\", e), children: [\n /* @__PURE__ */ E(\n \"button\",\n {\n id: v,\n type: \"button\",\n className: y(\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 u\n ),\n \"aria-expanded\": s,\n \"aria-controls\": f,\n disabled: n,\n onClick: m,\n onKeyDown: g,\n children: [\n /* @__PURE__ */ c(\"span\", { children: a }),\n /* @__PURE__ */ c(\n \"span\",\n {\n className: y(\n \"transform transition-transform duration-300 ease-linear\",\n s ? \"rotate-180\" : \"rotate-0\"\n ),\n \"aria-hidden\": \"true\",\n children: /* @__PURE__ */ c(re, { size: 18 })\n }\n )\n ]\n }\n ),\n /* @__PURE__ */ c(\n \"div\",\n {\n id: f,\n role: \"region\",\n \"aria-labelledby\": v,\n className: y(\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 d\n ),\n children: s && (r || t)\n }\n )\n ] });\n}\nfunction Ue({\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: u = \"\"\n}) {\n const d = $(), b = o || `accordion-group-${d}`, [i, v] = x(new Set(s)), f = (h) => {\n v((w) => {\n const p = new Set(w);\n return p.has(h) ? p.delete(h) : (n || p.clear(), p.add(h)), p;\n });\n }, m = (h) => `${d}-item-${h}`, g = (h) => i.has(h);\n return /* @__PURE__ */ E(\"div\", { id: b, className: r, children: [\n a.length > 0 && a.map((h, w) => {\n const p = h.id || m(w);\n return /* @__PURE__ */ c(\n q,\n {\n id: p,\n title: h.title,\n content: h.content,\n disabled: h.disabled,\n isOpen: g(p),\n onToggle: () => f(p),\n className: e,\n triggerClassName: l,\n bodyClassName: u\n },\n p\n );\n }),\n a.length === 0 && t && D.Children.map(t, (h, w) => {\n if (D.isValidElement(h) && h.type === q) {\n const p = h.props.id || m(w);\n return /* @__PURE__ */ Y(\n q,\n {\n ...h.props,\n key: p,\n id: p,\n className: y(e, h.props.className),\n isOpen: g(p),\n onToggle: () => f(p),\n triggerClassName: y(l, h.props.triggerClassName),\n bodyClassName: y(u, h.props.bodyClassName)\n }\n );\n }\n return null;\n })\n ] });\n}\nfunction ce() {\n const [o, a] = x(0);\n return A(() => {\n const t = setInterval(() => {\n a((r) => (r + 1) % 3);\n }, 500);\n return () => clearInterval(t);\n }, []), /* @__PURE__ */ c(\"div\", { className: \"absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle\", children: [0, 1, 2].map((t) => /* @__PURE__ */ c(\n \"div\",\n {\n className: y(\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 de = {\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}, ue = {\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}, fe = {\n none: \"rounded-none\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n full: \"rounded-full\"\n}, K = {\n variant: \"primary\",\n size: \"md\",\n rounded: \"md\"\n};\nfunction me({\n variant: o = K.variant,\n size: a,\n rounded: t = K.rounded,\n loading: r,\n linkTo: e,\n linkProps: n,\n type: s = \"button\",\n className: l,\n ...u\n}) {\n let d;\n o === \"link\" && !a ? d = \"fitted\" : d = a || K.size;\n const i = y(\n \"appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all\",\n de[o],\n ue[d],\n fe[t],\n r && \"relative pointer-events-none\",\n e && \"relative\",\n l\n );\n return /* @__PURE__ */ E(\n \"button\",\n {\n ...u,\n role: e ? \"link\" : u.role,\n \"aria-label\": u[\"aria-label\"] || (n == null ? void 0 : n[\"aria-label\"]),\n \"aria-description\": u[\"aria-description\"] || (n == null ? void 0 : n[\"aria-description\"]),\n \"aria-disabled\": u.disabled || r,\n \"aria-busy\": r,\n type: s,\n className: i,\n children: [\n r && /* @__PURE__ */ c(ce, {}),\n /* @__PURE__ */ c(\"span\", { className: y(r && \"invisible\"), children: u.children }),\n e && !u.disabled && /* @__PURE__ */ c(\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 be(o) {\n const [a, t] = x(\"\"), r = I((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 A(() => {\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 _e({\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: u,\n className: d = \"\",\n ...b\n}) {\n const i = $(), v = U(() => a || `checkbox-${i}`, [a, i]), f = be(v), [m, g] = x(s);\n A(() => {\n g(s);\n }, [s]);\n const h = () => {\n u || (g(!m), l == null || l(!m));\n }, w = (N) => {\n N.key === \" \" && (N.preventDefault(), h());\n }, p = y(\n \"flex items-center justify-center border outline outline-transparent focus:outline-current focus:outline-offset-2\",\n n && \"rounded\",\n u && \"opacity-40 cursor-not-allowed\",\n !u && \"cursor-pointer\",\n d\n );\n return /* @__PURE__ */ c(\n \"button\",\n {\n id: v,\n type: \"button\",\n ref: o,\n tabIndex: 0,\n role: \"checkbox\",\n onClick: h,\n \"aria-checked\": m,\n \"aria-disabled\": u,\n onKeyDownCapture: w,\n style: {\n width: t,\n height: t,\n color: r,\n backgroundColor: m && e ? \"currentcolor\" : \"transparent\"\n },\n className: p,\n ...b,\n children: m && /* @__PURE__ */ c(ne, { size: t, color: e ? f : void 0 })\n }\n );\n}\nfunction Qe({\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: y(\"relative w-fit\", a), ...s, children: [\n o,\n t && /* @__PURE__ */ c(\n \"a\",\n {\n ...r,\n rel: (r == null ? void 0 : r.rel) || \"noreferrer\",\n href: t,\n className: y(\"absolute inset-0\", r == null ? void 0 : r.className)\n }\n ),\n !t && e && /* @__PURE__ */ c(\n \"button\",\n {\n ...n,\n type: \"button\",\n onClick: e,\n className: y(\"absolute inset-0 cursor-pointer\", n == null ? void 0 : n.className)\n }\n )\n ] });\n}\nfunction V({ elementId: o, type: a, message: t }) {\n return A(() => {\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: y(\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__ */ c(le, {}) : /* @__PURE__ */ c(oe, {}),\n /* @__PURE__ */ c(\"span\", { id: `${o}-${a}-message`, children: t })\n ]\n }\n ) : null;\n}\nconst he = {\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}, pe = {\n none: \"rounded-none\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n full: \"px-3 rounded-full\"\n}, X = {\n variant: \"default\",\n rounded: \"none\"\n};\nfunction Me({\n variant: o = X.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 u = $(), [d, b] = x(!1);\n let i = a;\n o === \"outline\" && !a && (i = \"md\"), i = i || X.rounded;\n const m = y(\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 && he[o],\n !t && pe[i],\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: y(t && \"cursor-text\"), style: { height: l.height, width: l.width }, children: [\n /* @__PURE__ */ E(\"div\", { className: y(n === \"password\" && \"relative\"), children: [\n /* @__PURE__ */ c(\n \"input\",\n {\n ...l,\n id: u,\n type: n === \"password\" && d ? \"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: m\n }\n ),\n n === \"password\" && /* @__PURE__ */ c(\n \"button\",\n {\n onClick: () => b(!d),\n className: \"absolute inset-y-0 right-0 px-2 hover:cursor-pointer\",\n \"aria-label\": \"Toggle password visibility\",\n \"data-state\": d ? \"visible\" : \"hidden\",\n children: d ? /* @__PURE__ */ c(ae, { size: 20 }) : /* @__PURE__ */ c(se, { size: 20 })\n }\n )\n ] }),\n !t && /* @__PURE__ */ c(V, { elementId: u, type: \"error\", message: r }),\n !t && /* @__PURE__ */ c(V, { elementId: u, type: \"success\", message: e })\n ] });\n}\nfunction Xe({\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 ...u\n}) {\n const d = $(), b = y(\"font-medium\", o, t), i = e ? `${s ?? d}-help` : void 0;\n return /* @__PURE__ */ E(\"div\", { style: { display: o === \"inline\" ? \"inline-flex\" : \"flex\", width: a }, className: \"relative\", children: [\n /* @__PURE__ */ E(\"label\", { className: b, htmlFor: s, ...u, children: [\n l,\n r && /* @__PURE__ */ c(\"span\", { className: \"text-red-500 font-medium ml-1\", \"aria-label\": \"required\", children: \"*\" })\n ] }),\n e && /* @__PURE__ */ c(\n \"span\",\n {\n className: \"text-gray-500 ml-1 size-fit -translate-y-1/3\",\n \"aria-describedby\": i,\n \"aria-label\": \"Help information\",\n title: e,\n children: /* @__PURE__ */ c(ie, {})\n }\n ),\n e && /* @__PURE__ */ c(\"div\", { id: i, className: \"sr-only\", children: e }),\n n && /* @__PURE__ */ c(\"span\", { className: \"ml-1\", children: n })\n ] });\n}\nfunction ge(o) {\n const [a, t] = x(!1), [r, e] = x(!1);\n return A(() => {\n o ? (e(!0), setTimeout(() => t(!0), 10)) : (t(!1), setTimeout(() => e(!1), 150));\n }, [o]), { show: a, shouldRender: r };\n}\nfunction ve(o, a) {\n A(() => {\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 we(o, a) {\n const t = R(null), r = I(() => {\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((u) => !(u instanceof HTMLButtonElement && u.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 A(() => (a && (t.current = document.activeElement, r()), () => {\n document.body.style.overflow = \"auto\", t.current instanceof HTMLElement && t.current.focus();\n }), [a, r]);\n}\nfunction Ze({\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: u = !1,\n actions: d = [],\n disableCloseOnOverlayClick: b = !1,\n ariaLabelledBy: i,\n ariaDescribedBy: v\n}) {\n const f = $(), m = o || `modal-${f}`, g = o ? `${o}-title` : `modal-title-${f}`, { show: h, shouldRender: w } = ge(a);\n if (we(m, w), ve(w, t), !w) return null;\n const p = () => r ? D.isValidElement(r) ? /* @__PURE__ */ c(\"div\", { className: \"mb-4\", children: r }) : /* @__PURE__ */ c(\"h2\", { className: \"mb-4 text-xl font-semibold\", id: g, children: r }) : null, N = () => d.length === 0 ? null : /* @__PURE__ */ c(\"div\", { className: \"mt-6 not-sm:grid gap-y-2 sm:flex sm:justify-start sm:flex-row-reverse sm:gap-x-3\", children: d.map((z, C) => {\n const { label: L, className: B, ...S } = z;\n return /* @__PURE__ */ c(me, { className: B, type: \"button\", ...S, \"data-modal-action\": \"true\", children: L }, C);\n }) });\n return /* @__PURE__ */ c(W, { children: _(\n /* @__PURE__ */ c(\n \"div\",\n {\n \"aria-labelledby\": i ?? r ? g : 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__ */ E(\"div\", { className: \"flex min-h-screen items-center justify-center p-4\", children: [\n /* @__PURE__ */ c(\n \"div\",\n {\n className: k(\"fixed inset-0 bg-black/20 transition-all\", l),\n onClick: () => {\n b || t();\n }\n }\n ),\n n && /* @__PURE__ */ c(\"div\", { className: k(\"relative w-fit\", s), children: e }),\n !n && /* @__PURE__ */ E(\n \"div\",\n {\n id: m,\n tabIndex: -1,\n className: k(\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 !u && /* @__PURE__ */ c(\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__ */ c(P, { size: 18 })\n }\n ),\n p(),\n e,\n N()\n ]\n }\n )\n ] })\n }\n ),\n document.body\n ) });\n}\nfunction ye(o) {\n const [a, t] = x(!1), [r, e] = x(!1);\n return A(() => {\n o ? (e(!0), setTimeout(() => t(!0), 10)) : (t(!1), setTimeout(() => e(!1), 300));\n }, [o]), { show: a, shouldRender: r };\n}\nfunction xe(o, a) {\n A(() => {\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 Ee(o, a) {\n const t = R(null), r = I(() => {\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((u) => !(u instanceof HTMLButtonElement && u.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 A(() => (a && (t.current = document.activeElement, r()), () => {\n document.body.style.overflow = \"auto\", t.current instanceof HTMLElement && t.current.focus();\n }), [a, r]);\n}\nconst Ne = {\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 Je({\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: u,\n overlayClassName: d,\n hideCloseButton: b = !1,\n disableCloseOnOverlayClick: i = !1,\n ariaLabelledBy: v,\n ariaDescribedBy: f\n}) {\n const m = $(), g = a || `panel-${m}`, h = a ? `${a}-title` : `panel-title-${m}`, { show: w, shouldRender: p } = ye(t);\n if (Ee(g, p), xe(p, r), !p) return null;\n const N = () => e ? D.isValidElement(e) ? /* @__PURE__ */ c(\"div\", { children: e }) : /* @__PURE__ */ c(\"h2\", { className: \"text-2xl font-semibold\", id: h, children: e }) : null, z = () => {\n if (!s) return null;\n if (D.isValidElement(s)) {\n const C = s, L = C.props.className || \"\";\n return D.cloneElement(C, { className: k(\"px-6 py-4\", L) });\n }\n return /* @__PURE__ */ c(\"div\", { className: \"px-6 py-4\", children: s });\n };\n return /* @__PURE__ */ c(W, { children: _(\n /* @__PURE__ */ E(\n \"div\",\n {\n \"aria-labelledby\": v ?? e ? h : void 0,\n \"aria-describedby\": f,\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__ */ c(\n \"div\",\n {\n className: k(\n \"fixed inset-0 bg-black/40 transition-opacity duration-300\",\n w ? \"opacity-100\" : \"opacity-0\",\n d\n ),\n onClick: () => {\n i || r();\n }\n }\n ),\n /* @__PURE__ */ c(\"div\", { className: \"fixed inset-y-0 right-0 flex max-w-full\", children: /* @__PURE__ */ c(\n \"div\",\n {\n id: g,\n ref: o,\n tabIndex: -1,\n className: k(\n \"relative h-full transform shadow-xl bg-popover transition-transform duration-300 ease-in-out\",\n l !== \"screen\" && \"border-l border-border\",\n Ne.size[l],\n w ? \"translate-x-0\" : \"translate-x-full\",\n u\n ),\n \"data-panel-size\": l,\n children: /* @__PURE__ */ E(\"div\", { className: \"flex h-full flex-col\", children: [\n e && /* @__PURE__ */ c(\"div\", { className: \"px-6 pt-6\", children: N() }),\n !b && /* @__PURE__ */ c(\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__ */ c(P, { size: 18 })\n }\n ),\n /* @__PURE__ */ c(\"div\", { className: k(\"flex-1 overflow-y-auto px-6 pb-6\", e ? \"pt-6\" : \"pt-10\"), children: n }),\n z()\n ] })\n }\n ) })\n ]\n }\n ),\n document.body\n ) });\n}\nfunction Ae({ 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 }, u = y(\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__ */ c(\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: u,\n style: {\n width: \"1em\",\n height: \"1em\",\n padding: \"0.1em\",\n borderWidth: \"0.06em\"\n },\n children: a && /* @__PURE__ */ c(\n \"div\",\n {\n className: y(\"size-full aspect-square rounded-full\", e && \"bg-muted/60\", !e && \"bg-current\")\n }\n )\n }\n );\n}\nfunction G({\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: u\n}) {\n const b = `radio-${$()}-${o}`, i = () => {\n n || e == null || e(o);\n };\n return /* @__PURE__ */ E(\n \"div\",\n {\n title: l,\n className: y(\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__ */ c(\n Ae,\n {\n itemId: b,\n name: u || \"\",\n checked: r,\n onChange: i,\n disabled: n,\n className: y(s && \"\")\n }\n ),\n /* @__PURE__ */ c(\n \"div\",\n {\n id: s ? b : void 0,\n tabIndex: s ? -1 : void 0,\n role: s ? \"radio\" : void 0,\n onClick: s ? i : 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 ${u}` : void 0,\n \"aria-labelledby\": s ? `${b}-label` : void 0,\n className: y(s && \"size-full\", typeof a == \"object\" && \"grow focus:outline-none\"),\n children: /* @__PURE__ */ c(\n \"label\",\n {\n id: `${b}-label`,\n onClick: s ? void 0 : i,\n className: y(n && \"cursor-not-allowed\", !n && \"cursor-pointer\"),\n children: a\n }\n )\n }\n )\n ]\n }\n );\n}\nfunction Ce(o, a) {\n const [t, r] = x(a), [e, n] = x(-1), [s, l] = x(!1), u = I((f, m) => {\n var w;\n const g = f[m];\n g.hasAttribute(\"disabled\") || g.getAttribute(\"aria-disabled\") === \"true\" || ((w = f[m]) == null || w.click(), n(m));\n }, []), d = I(\n (f, m) => {\n var h;\n if (f.preventDefault(), s || !m.length) return;\n const g = a !== -1 ? a : 0;\n (h = m[g]) == null || h.focus(), r(g), a !== -1 && u(m, g);\n },\n [a, s, u]\n ), b = I(\n (f) => {\n var w;\n if (!f.shiftKey)\n return;\n f.preventDefault();\n const m = Array.from(\n document.querySelectorAll(\n 'a, button, input, textarea, select, details, [tabindex]:not([tabindex=\"-1\"])'\n )\n ).filter((p) => !p.hasAttribute(\"disabled\") && p.tabIndex >= 0), g = m.findIndex((p) => p.id === o), h = g > 0 ? g - 1 : m.length - 1;\n (w = m[h]) == null || w.focus();\n },\n [o]\n ), i = I(\n (f, m) => {\n var N;\n if (!m.length) return;\n const g = f.target;\n if (!m.some((z) => z.id === g.id)) return;\n const w = t !== -1 ? t : 0;\n let p = w;\n switch (f.key) {\n case \"ArrowUp\":\n case \"ArrowLeft\":\n f.preventDefault(), p = w > 0 ? w - 1 : m.length - 1;\n break;\n case \"ArrowDown\":\n case \"ArrowRight\":\n f.preventDefault(), p = (w + 1) % m.length;\n break;\n // Select the option when the space key is pressed\n case \" \":\n f.preventDefault(), u(m, w);\n return;\n case \"Tab\":\n b(f);\n return;\n default:\n return;\n }\n (N = m[p]) == null || N.focus(), r(p), e !== -1 && u(m, p);\n },\n [t, e, b, u]\n ), v = I(() => {\n const f = document.querySelector(`[id=\"${o}\"][role=\"radiogroup\"]`);\n return f ? Array.from(f.querySelectorAll('[role=\"radio\"]')) : [];\n }, [o]);\n A(() => {\n const f = document.querySelector(`[id=\"${o}\"][role=\"radiogroup\"]`);\n if (!f) return;\n const m = v(), g = (N) => d(N, m), h = (N) => i(N, m), w = () => l(!0), p = () => l(!1);\n return document.addEventListener(\"keydown\", h), f.addEventListener(\"focus\", g), f.addEventListener(\"mousedown\", w), document.addEventListener(\"mouseup\", p), () => {\n document.removeEventListener(\"keydown\", h), f.removeEventListener(\"focus\", g), f.removeEventListener(\"mousedown\", w), document.removeEventListener(\"mouseup\", p);\n };\n }, [o, v, d, i]);\n}\nfunction Ye({\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 u = $(), d = r || `radio-group-${u}`;\n Ce(\n d,\n o.findIndex((i) => i === a)\n );\n const b = U(() => o.reduce((i, v) => (typeof v == \"string\" ? i.some((f) => f.value === v) || i.push({ label: v, value: v }) : i.push(v), i), []), [o]);\n return /* @__PURE__ */ E(\"div\", { id: d, role: \"radiogroup\", tabIndex: 0, className: y(n, \"focus:outline-none\"), children: [\n b.length > 0 && b.map((i, v) => /* @__PURE__ */ c(\n G,\n {\n value: i.value,\n isSelected: a === i.value,\n onChange: t,\n name: d,\n disabled: i.disabled,\n description: i.description,\n hideInput: l,\n className: s,\n children: i.label\n },\n `${i.value}-${v}`\n )),\n b.length === 0 && e && D.Children.map(e, (i) => D.isValidElement(i) && i.type === G ? /* @__PURE__ */ c(\n G,\n {\n ...i.props,\n className: y(s, i.props.className),\n hideInput: i.props.hideInput || l,\n isSelected: a === i.props.value,\n onChange: t,\n name: d,\n children: i.props.children\n }\n ) : null)\n ] });\n}\nconst Ie = {\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}, $e = {\n horizontal: \"w-full\",\n vertical: \"min-h-4 h-full\"\n};\nfunction Pe({\n orientation: o = \"horizontal\",\n decorative: a = !1,\n thickness: t = \"thin\",\n className: r,\n ...e\n}) {\n const n = y(\n \"shrink-0 bg-border\",\n $e[o],\n Ie[t][o],\n r\n );\n return /* @__PURE__ */ c(\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}\nfunction Oe({ children: o, ref: a, ...t }) {\n if (ee(o)) {\n let r = { ...t };\n return o.props && (r = { ...r, ...o.props }), te(o, {\n ...r,\n ref: (e) => {\n typeof a == \"function\" ? a(e) : a && (a.current = e);\n }\n });\n }\n return Y(\"div\", { ...t, ref: a }, o);\n}\nfunction Te({ elementId: o, maxLength: a }) {\n const [t, r] = x(0);\n return A(() => {\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__ */ c(\n \"small\",\n {\n className: y(\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 ze(o, a) {\n A(() => {\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 De = {\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}, ke = {\n none: \"rounded-none\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n full: \"px-3 rounded-full\"\n}, Z = {\n variant: \"outline\",\n rounded: \"none\"\n};\nfunction et({\n variant: o = Z.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: u,\n ...d\n}) {\n const b = $();\n ze(b, s || t);\n let i = a;\n o === \"outline\" && !a && (i = \"md\"), i = i || Z.rounded;\n let v = n;\n (t || o === \"left-line\" && !n) && (v = !0);\n const m = y(\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 && De[o],\n !t && ke[i],\n !t && \"px-2 py-1\",\n t && \"pointer-events-none\",\n v && \"no-resize-handle\",\n u\n );\n return /* @__PURE__ */ E(\"div\", { className: y(\"-space-y-1.5\", t && \"cursor-text\"), children: [\n /* @__PURE__ */ c(\n \"textarea\",\n {\n ...d,\n id: b,\n \"aria-disabled\": d.disabled,\n readOnly: t,\n \"aria-readonly\": t || d[\"aria-readonly\"],\n style: {\n resize: s ? \"none\" : void 0\n },\n className: m\n }\n ),\n l > 0 && /* @__PURE__ */ c(Te, { elementId: b, maxLength: l }),\n !t && /* @__PURE__ */ c(V, { elementId: b, type: \"error\", message: r }),\n !t && /* @__PURE__ */ c(V, { elementId: b, type: \"success\", message: e })\n ] });\n}\nconst Le = {\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}, Re = {\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}, J = {\n variant: \"default\",\n size: \"md\"\n};\nfunction tt({\n ref: o,\n id: a,\n size: t = J.size,\n variant: r = J.variant,\n checked: e,\n onCheckedChange: n,\n disabled: s = !1,\n className: l,\n thumbClassName: u,\n backgroundClassNames: d,\n ...b\n}) {\n const i = $(), v = U(() => a || `toggle-${i}`, [a, i]), [f, m] = x(e);\n A(() => {\n m(e);\n }, [e]);\n const g = () => {\n if (!s) {\n const C = !f;\n e === void 0 && m(C), n == null || n(C);\n }\n }, h = (C) => {\n (C.key === \" \" || C.key === \"Enter\") && (C.preventDefault(), g());\n }, w = Le[t], p = Re[r], N = y(\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 w.container,\n // Variant and state\n f ? (d == null ? void 0 : d.checked) || p.checked : (d == null ? void 0 : d.unchecked) || p.unchecked,\n // Disabled state\n s && \"opacity-50 cursor-not-allowed\",\n !s && \"cursor-pointer\",\n l\n ), z = y(\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 w.thumb,\n // Position based on state\n f && w.translate,\n u\n );\n return /* @__PURE__ */ E(\n \"button\",\n {\n ref: o,\n id: v,\n type: \"button\",\n role: \"switch\",\n tabIndex: 0,\n \"aria-checked\": f,\n \"aria-disabled\": s,\n disabled: s,\n onClick: g,\n onKeyDown: h,\n className: N,\n ...b,\n children: [\n /* @__PURE__ */ c(\"span\", { className: z }),\n /* @__PURE__ */ c(\"span\", { className: \"sr-only\", children: f ? \"Enabled\" : \"Disabled\" })\n ]\n }\n );\n}\nconst j = 8, F = 4, T = 6;\nfunction Be(o) {\n return { calculatePosition: I(\n (t, r) => {\n const e = t.getBoundingClientRect(), n = r.getBoundingClientRect(), s = {\n width: window.innerWidth,\n height: window.innerHeight\n }, l = (v, f, m, g) => v < 0 || f < 0 || v + m > s.width || f + g > s.height, u = {\n top: {\n x: e.left + e.width / 2 - n.width / 2,\n y: e.top - n.height - F,\n arrow: {\n x: n.width / 2 - T,\n y: n.height\n }\n },\n bottom: {\n x: e.left + e.width / 2 - n.width / 2,\n y: e.bottom + F,\n arrow: {\n x: n.width / 2 - T,\n y: -6\n }\n },\n left: {\n x: e.left - n.width - F,\n y: e.top + e.height / 2 - n.height / 2,\n arrow: {\n x: n.width,\n y: n.height / 2 - T\n }\n },\n right: {\n x: e.right + F,\n y: e.top + e.height / 2 - n.height / 2,\n arrow: {\n x: -6,\n y: n.height / 2 - T\n }\n }\n };\n let d = o, b = u[o];\n if (l(b.x, b.y, n.width, n.height)) {\n const v = {\n top: \"bottom\",\n bottom: \"top\",\n left: \"right\",\n right: \"left\"\n }, f = u[v[o]];\n if (!l(f.x, f.y, n.width, n.height))\n d = v[o], b = f;\n else {\n const m = [\"top\", \"bottom\", \"left\", \"right\"].filter(\n (g) => g !== o && g !== v[o]\n );\n for (const g of m) {\n const h = u[g];\n if (!l(h.x, h.y, n.width, n.height)) {\n d = g, b = h;\n break;\n }\n }\n }\n }\n b.x = Math.max(\n j,\n Math.min(b.x, s.width - n.width - j)\n ), b.y = Math.max(\n j,\n Math.min(b.y, s.height - n.height - j)\n );\n const i = {\n x: e.left + e.width / 2,\n y: e.top + e.height / 2\n };\n return d === \"top\" || d === \"bottom\" ? b.arrow.x = Math.max(\n T,\n Math.min(i.x - b.x - T, n.width - T * 2)\n ) : b.arrow.y = Math.max(\n T,\n Math.min(i.y - b.y - T, n.height - T * 2)\n ), {\n ...b,\n placement: d\n };\n },\n [o]\n ) };\n}\nfunction Se(o, a, t) {\n const r = R(null), e = R(null), n = I(() => {\n if (!r.current || !e.current) return;\n const s = o(r.current, e.current);\n t(s);\n }, [o, t]);\n return A(() => {\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 je(o, a, t, r, e, n, s, l, u) {\n const d = R(null), b = I(() => {\n o || (d.current && clearTimeout(d.current), d.current = window.setTimeout(() => {\n t(!0), requestAnimationFrame(() => {\n e(), r(!0);\n });\n }, a));\n }, [o, a, t, e, r]), i = I(\n (v = !1) => {\n if (d.current && clearTimeout(d.current), v) {\n r(!1), setTimeout(() => t(!1), 150);\n return;\n }\n d.current = window.setTimeout(() => {\n r(!1), setTimeout(() => t(!1), 150);\n }, 100);\n },\n [r, t]\n );\n return A(() => {\n !n && !s && !l && u && i();\n }, [n, s, l, u, i]), A(() => () => {\n d.current && clearTimeout(d.current);\n }, []), {\n showTooltip: b,\n hideTooltip: i,\n timeoutRef: d\n };\n}\nfunction rt({\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, u] = x(!1), [d, b] = x(!1), [i, v] = x(null), [f, m] = x(!1), [g, h] = x(!1), [w, p] = x(!1), { calculatePosition: N } = Be(r), { triggerRef: z, tooltipRef: C, updatePosition: L } = Se(N, d, v), { showTooltip: B, hideTooltip: S, timeoutRef: Q } = je(\n e,\n n,\n b,\n u,\n L,\n f,\n g,\n w,\n l\n ), O = $(), M = o ?? O;\n return /* @__PURE__ */ E(W, { children: [\n D.cloneElement(a, {\n ref: (H) => {\n z.current = H;\n },\n onMouseEnter: () => {\n m(!0), B();\n },\n onMouseLeave: () => {\n m(!1);\n },\n onFocus: () => {\n p(!0), B();\n },\n onBlur: () => {\n p(!1), S(!0);\n },\n onKeyDown: (H) => {\n H.key === \"Escape\" && S(!0);\n },\n \"aria-describedby\": e ? void 0 : M\n }),\n d && _(\n /* @__PURE__ */ c(\n \"div\",\n {\n ref: C,\n id: M,\n role: \"tooltip\",\n className: y(\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: i ? { left: i.x, top: i.y } : { opacity: 0 },\n onMouseEnter: () => {\n h(!0), Q.current && clearTimeout(Q.current);\n },\n onMouseLeave: () => {\n h(!1);\n },\n children: t\n }\n ),\n document.body\n )\n ] });\n}\nexport {\n Ue as Accordion,\n q as AccordionItem,\n at as ActionModal,\n me as Button,\n ce as ButtonLoadingDots,\n _e as Checkbox,\n Qe as Clickable,\n Me as Input,\n Xe as Label,\n Ze as Modal,\n Je as Panel,\n Ye as RadioGroup,\n G as RadioGroupItem,\n Ae as RadioInput,\n Pe as Separator,\n Oe as Slot,\n et as Textarea,\n st as Toast,\n tt as Toggle,\n rt 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 { 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\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","i","e","w","F","ce","o","a","x","A","r","c","y","de","ue","fe","K","me","l","u","d","E","ge","ve","we","R","I","Ze","b","v","f","$","m","g","p","D","N","z","L","B","W","_","k","P","ActionModal","type","message","cancelText","confirmText","onConfirm","onClose","destructive","title","modalProps","defaultTexts","useMemo","actions","jsx","Modal","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,OAAO,IAAI,gBAAgB,WAAW,IAAI,UAAU,GAAGC,EAAC,GAAI;AACrF,SAAuBC,gBAAAA;AAAAA,IACrB;AAAA,IACA;AAAA,MACE,GAAGD;AAAA,MACH,OAAOD;AAAA,MACP,QAAQA;AAAA,MACR,WAAW;AAAA,MACX,SAAS;AAAA,MACT,OAAO;AAAA,MACP,UAA0BE,gBAAAA;AAAAA,QACxB;AAAA,QACA;AAAA,UACE,GAAG;AAAA,UACH,MAAM;AAAA,UACN,UAAU;AAAA,UACV,UAAU;AAAA,QACpB;AAAA,MACA;AAAA,IACA;AAAA,EACG;AACH;AClGA,SAASC,KAAK,GAAG;AACf,SAAO,EAAE,OAAO,CAAC,MAAM,OAAO,KAAK,YAAY,CAAC,EAAE,KAAK,GAAG,EAAE,KAAM,KAAI;AACxE;AA0BAC,EAAE,MAAM;ACiGR,SAASC,IAAK;AACZ,QAAM,CAACC,GAAGC,CAAC,IAAIC,EAAE,CAAC;AAClB,SAAOC,EAAE,MAAM;AACb,UAAMZ,IAAI,YAAY,MAAM;AAC1B,MAAAU,EAAE,CAACG,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AAAA,MAC7C;AAAA,MAGA,UAAA;AAAA,QAAA,gBAAAd,EAAC,OAAI,EAAA,WAAU,sBAAsB,UAAAqB,EAAU,MAAK;AAAA,QAGpD,gBAAAC,EAAC,OAAI,EAAA,WAAU,qBACb,UAAA;AAAA,UAAC,gBAAAtB,EAAA,OAAA,EAAI,WAAU,iCAAiC,UAAML,GAAA;AAAA,UACrDa,KAAe,gBAAAR,EAAC,OAAI,EAAA,WAAU,qCAAqC,UAAYQ,GAAA;AAAA,UAC/EC,KACC,gBAAAT,EAAC,OAAI,EAAA,WAAU,UACb,UAAA,gBAAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,SAASS,EAAO;AAAA,cAChB,WAAU;AAAA,cAET,UAAOA,EAAA;AAAA,YAAA;AAAA,UAAA,EAEZ,CAAA;AAAA,QAAA,GAEJ;AAAA,QAGA,gBAAAT;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,SAASiB;AAAA,YACT,WAAU;AAAA,YAEV,UAAA,gBAAAjB,EAACwB,GAAE,EAAA,MAAM,GAAI,CAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACf;AAAA,IAAA;AAAA,EACF;AAEJ;"}
1
+ {"version":3,"file":"Toast-COzsZuCT.js","sources":["utils.esm.js","X-CIoyLewf.js","Toast-DfNdN3Lk.js","components.esm.js","../src/components/actionmodal/ActionModal.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 join\n};\n//# sourceMappingURL=utils.esm.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 M, jsxs as f } from \"react/jsx-runtime\";\nimport q, { createContext as D, useId as H, useState as p, useEffect as b, useRef as K, useCallback as E, useMemo as C } from \"react\";\nimport { createPortal as P } from \"react-dom\";\nimport { X as Z, C as F, E as V, I as X } from \"./X-CIoyLewf.js\";\nimport { join as G } from \"./utils.esm.js\";\nfunction w(...e) {\n return e.filter((l) => typeof l == \"string\" && l).join(\" \").trim() || void 0;\n}\nfunction J({ size: e = 15, color: l = \"currentColor\", className: n = \"inline\", ...t }) {\n return /* @__PURE__ */ r(\n \"svg\",\n {\n ...t,\n width: e,\n height: e,\n className: n,\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: l,\n fillRule: \"evenodd\",\n clipRule: \"evenodd\"\n }\n )\n }\n );\n}\nfunction y(...e) {\n return e.filter((l) => typeof l == \"string\" && l).join(\" \").trim() || void 0;\n}\nD(void 0);\nfunction Q() {\n const [e, l] = p(0);\n return b(() => {\n const n = setInterval(() => {\n l((t) => (t + 1) % 3);\n }, 500);\n return () => clearInterval(n);\n }, []), /* @__PURE__ */ r(\"div\", { className: \"absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle\", children: [0, 1, 2].map((n) => /* @__PURE__ */ r(\n \"div\",\n {\n className: w(\n \"rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current\",\n e === n && \"transform -translate-y-1\"\n )\n },\n n\n )) });\n}\nconst U = {\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}, Y = {\n none: \"rounded-none\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n full: \"rounded-full\"\n}, x = {\n variant: \"primary\",\n size: \"md\",\n rounded: \"md\"\n};\nfunction _({\n variant: e = x.variant,\n size: l,\n rounded: n = x.rounded,\n loading: t,\n linkTo: i,\n linkProps: a,\n type: o = \"button\",\n className: s,\n ...d\n}) {\n let c;\n e === \"link\" && !l ? c = \"fitted\" : c = l || x.size;\n const u = w(\n \"appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all\",\n U[e],\n W[c],\n Y[n],\n t && \"relative pointer-events-none\",\n i && \"relative\",\n s\n );\n return /* @__PURE__ */ f(\n \"button\",\n {\n ...d,\n role: i ? \"link\" : d.role,\n \"aria-label\": d[\"aria-label\"] || (a == null ? void 0 : a[\"aria-label\"]),\n \"aria-description\": d[\"aria-description\"] || (a == null ? void 0 : a[\"aria-description\"]),\n \"aria-disabled\": d.disabled || t,\n \"aria-busy\": t,\n type: o,\n className: u,\n children: [\n t && /* @__PURE__ */ r(Q, {}),\n /* @__PURE__ */ r(\"span\", { className: w(t && \"invisible\"), children: d.children }),\n i && !d.disabled && /* @__PURE__ */ r(\n \"a\",\n {\n ...a,\n \"aria-hidden\": !0,\n href: i,\n rel: (a == null ? void 0 : a.rel) || \"noreferrer\",\n className: \"absolute inset-0\"\n }\n )\n ]\n }\n );\n}\nfunction R(e) {\n const [l, n] = p(!1), [t, i] = p(!1);\n return b(() => {\n e ? (i(!0), setTimeout(() => n(!0), 10)) : (n(!1), setTimeout(() => i(!1), 150));\n }, [e]), { show: l, shouldRender: t };\n}\nfunction $(e, l) {\n b(() => {\n const n = (t) => {\n t.key === \"Escape\" && e && l();\n };\n return document.addEventListener(\"keydown\", n), e && (document.body.style.overflow = \"hidden\"), () => {\n document.removeEventListener(\"keydown\", n), document.body.style.overflow = \"auto\";\n };\n }, [e, l]);\n}\nfunction ee(e, l) {\n const n = K(null), t = E(() => {\n const i = document.getElementById(e);\n if (!i) return;\n const a = i.querySelectorAll('[data-modal-action=\"true\"]');\n if (a.length > 0) {\n a[0].focus();\n return;\n }\n const o = i.querySelectorAll(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])'\n );\n if (o.length > 0) {\n const s = Array.from(o).filter((d) => !(d instanceof HTMLButtonElement && d.getAttribute(\"data-modal-close-button\") === \"true\"));\n if (s.length > 0) {\n s[0].focus();\n return;\n }\n o[0].focus();\n return;\n }\n i.focus();\n }, [e]);\n b(() => (l && (n.current = document.activeElement, t()), () => {\n document.body.style.overflow = \"auto\", n.current instanceof HTMLElement && n.current.focus();\n }), [l, t]);\n}\nfunction te({\n id: e,\n isOpen: l,\n onClose: n,\n title: t,\n children: i,\n contentOnly: a = !1,\n className: o,\n overlayClassName: s,\n hideCloseButton: d = !1,\n actions: c = [],\n disableCloseOnOverlayClick: u = !1,\n ariaLabelledBy: m,\n ariaDescribedBy: g\n}) {\n const h = H(), N = e || `modal-${h}`, k = e ? `${e}-title` : `modal-title-${h}`, { show: z, shouldRender: v } = R(l);\n if (ee(N, v), $(v, n), !v) return null;\n const T = () => t ? q.isValidElement(t) ? /* @__PURE__ */ r(\"div\", { className: \"mb-4\", children: t }) : /* @__PURE__ */ r(\"h2\", { className: \"mb-4 text-xl font-semibold\", id: k, children: t }) : null, j = () => 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: I, className: O, ...S } = A;\n return /* @__PURE__ */ r(_, { className: O, type: \"button\", ...S, \"data-modal-action\": \"true\", children: I }, B);\n }) });\n return /* @__PURE__ */ r(M, { children: P(\n /* @__PURE__ */ r(\n \"div\",\n {\n \"aria-labelledby\": m ?? t ? k : void 0,\n \"aria-describedby\": g,\n role: \"dialog\",\n \"aria-modal\": \"true\",\n className: \"fixed inset-0 z-[100] overflow-y-auto\",\n children: /* @__PURE__ */ f(\"div\", { className: \"flex min-h-screen items-center justify-center p-4\", children: [\n /* @__PURE__ */ r(\n \"div\",\n {\n className: y(\"fixed inset-0 bg-black/20 transition-all\", s),\n onClick: () => {\n u || n();\n }\n }\n ),\n a && /* @__PURE__ */ r(\"div\", { className: y(\"relative w-fit\", o), children: i }),\n !a && /* @__PURE__ */ f(\n \"div\",\n {\n id: N,\n tabIndex: -1,\n className: y(\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 o\n ),\n children: [\n !d && /* @__PURE__ */ r(\n \"button\",\n {\n type: \"button\",\n onClick: n,\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(J, { size: 18 })\n }\n ),\n T(),\n i,\n j()\n ]\n }\n )\n ] })\n }\n ),\n document.body\n ) });\n}\nfunction oe({\n type: e,\n message: l,\n cancelText: n,\n confirmText: t,\n onConfirm: i,\n onClose: a,\n destructive: o = !1,\n title: s,\n ...d\n}) {\n const c = C(() => e === \"confirm\" ? {\n confirm: t || \"Confirm\",\n cancel: n || \"Cancel\",\n defaultTitle: s || \"Confirm Action\"\n } : {\n confirm: t || \"OK\",\n cancel: null,\n defaultTitle: s || \"Alert\"\n }, [e, t, s, n]), u = C(\n () => [\n ...c.cancel ? [\n {\n label: c.cancel,\n variant: \"secondary\",\n onClick: a\n }\n ] : [],\n {\n label: c.confirm,\n variant: o ? \"destructive\" : \"primary\",\n onClick: () => {\n i == null || i(), a();\n }\n }\n ],\n [c, o, i, a]\n );\n return /* @__PURE__ */ r(\n te,\n {\n ...d,\n title: s || c.defaultTitle,\n onClose: a,\n actions: u,\n disableCloseOnOverlayClick: e === \"confirm\",\n hideCloseButton: e === \"confirm\",\n children: typeof l == \"string\" ? /* @__PURE__ */ r(\"p\", { className: \"text-sm\", children: l }) : l\n }\n );\n}\nconst 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(X, { 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(V, { 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(F, { size: 20 })\n }\n};\nfunction de({\n id: e,\n title: l,\n description: n,\n type: t = \"info\",\n action: i,\n duration: a = 5e3,\n onRemove: o,\n customTypes: s,\n customComponent: d\n}) {\n const [c, u] = p(!1), m = E(() => {\n u(!0), setTimeout(() => {\n o == null || o(e);\n }, 150);\n }, [e, o]);\n if (b(() => {\n if (a > 0) {\n const h = setTimeout(() => {\n m();\n }, a);\n return () => clearTimeout(h);\n }\n }, [a, e, o, m]), d)\n return /* @__PURE__ */ r(\n d,\n {\n id: e,\n title: l,\n description: n,\n type: t,\n action: i,\n duration: a,\n onRemove: o\n }\n );\n const g = (s == null ? void 0 : s[t]) || L[t] || L.info;\n return /* @__PURE__ */ f(\n \"div\",\n {\n role: t === \"error\" ? \"alert\" : \"status\",\n \"aria-live\": t === \"error\" ? void 0 : \"polite\",\n className: G(\n \"relative flex items-start p-4 rounded-lg border shadow-lg transition-all duration-150 ease-in-out\",\n i && \"pb-3\",\n g.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: g.icon }),\n /* @__PURE__ */ f(\"div\", { className: \"flex-grow min-w-0\", children: [\n /* @__PURE__ */ r(\"div\", { className: \"font-medium text-sm leading-5\", children: l }),\n n && /* @__PURE__ */ r(\"div\", { className: \"mt-1 text-sm opacity-90 leading-5\", children: n }),\n i && /* @__PURE__ */ r(\"div\", { className: \"mt-1.5\", children: /* @__PURE__ */ r(\n \"button\",\n {\n onClick: i.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: i.label\n }\n ) })\n ] }),\n /* @__PURE__ */ r(\n \"button\",\n {\n onClick: m,\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(Z, { size: 16 })\n }\n )\n ]\n }\n );\n}\nexport {\n oe as A,\n de as T,\n w as n\n};\n//# sourceMappingURL=Toast-DfNdN3Lk.js.map\n","import { jsxs as E, jsx as c, Fragment as W } from \"react/jsx-runtime\";\nimport z, { useId as $, useState as x, createElement as Y, useEffect as A, useCallback as I, useMemo as U, useRef as R, isValidElement as ee, cloneElement as te } from \"react\";\nimport { join as y } from \"./utils.esm.js\";\nimport { b as re, C as ne, a as oe, c as ae, E as se, Q as ie } from \"./QuestionMarkCircled-BVBF3skB.js\";\nimport { n as k } from \"./Toast-DfNdN3Lk.js\";\nimport { A as at, T as st } from \"./Toast-DfNdN3Lk.js\";\nimport { E as le, X as P } from \"./X-CIoyLewf.js\";\nimport { createPortal as _ } from \"react-dom\";\nfunction q({\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: u = \"\",\n bodyClassName: d = \"\"\n}) {\n const b = $(), i = o || `accordion-item-${b}`, v = `${i}-header`, f = `${i}-panel`, m = () => {\n !n && l && l();\n }, g = (h) => {\n (h.key === \"Enter\" || h.key === \" \") && (h.preventDefault(), m());\n };\n return /* @__PURE__ */ E(\"div\", { className: y(\"border-b border-gray-200\", n && \"opacity-60 cursor-not-allowed\", e), children: [\n /* @__PURE__ */ E(\n \"button\",\n {\n id: v,\n type: \"button\",\n className: y(\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 u\n ),\n \"aria-expanded\": s,\n \"aria-controls\": f,\n disabled: n,\n onClick: m,\n onKeyDown: g,\n children: [\n /* @__PURE__ */ c(\"span\", { children: a }),\n /* @__PURE__ */ c(\n \"span\",\n {\n className: y(\n \"transform transition-transform duration-300 ease-linear\",\n s ? \"rotate-180\" : \"rotate-0\"\n ),\n \"aria-hidden\": \"true\",\n children: /* @__PURE__ */ c(re, { size: 18 })\n }\n )\n ]\n }\n ),\n /* @__PURE__ */ c(\n \"div\",\n {\n id: f,\n role: \"region\",\n \"aria-labelledby\": v,\n className: y(\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 d\n ),\n children: s && (r || t)\n }\n )\n ] });\n}\nfunction Ue({\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: u = \"\"\n}) {\n const d = $(), b = o || `accordion-group-${d}`, [i, v] = x(new Set(s)), f = (h) => {\n v((w) => {\n const p = new Set(w);\n return p.has(h) ? p.delete(h) : (n || p.clear(), p.add(h)), p;\n });\n }, m = (h) => `${d}-item-${h}`, g = (h) => i.has(h);\n return /* @__PURE__ */ E(\"div\", { id: b, className: r, children: [\n a.length > 0 && a.map((h, w) => {\n const p = h.id || m(w);\n return /* @__PURE__ */ c(\n q,\n {\n id: p,\n title: h.title,\n content: h.content,\n disabled: h.disabled,\n isOpen: g(p),\n onToggle: () => f(p),\n className: e,\n triggerClassName: l,\n bodyClassName: u\n },\n p\n );\n }),\n a.length === 0 && t && z.Children.map(t, (h, w) => {\n if (z.isValidElement(h) && h.type === q) {\n const p = h.props.id || m(w);\n return /* @__PURE__ */ Y(\n q,\n {\n ...h.props,\n key: p,\n id: p,\n className: y(e, h.props.className),\n isOpen: g(p),\n onToggle: () => f(p),\n triggerClassName: y(l, h.props.triggerClassName),\n bodyClassName: y(u, h.props.bodyClassName)\n }\n );\n }\n return null;\n })\n ] });\n}\nfunction ce() {\n const [o, a] = x(0);\n return A(() => {\n const t = setInterval(() => {\n a((r) => (r + 1) % 3);\n }, 500);\n return () => clearInterval(t);\n }, []), /* @__PURE__ */ c(\"div\", { className: \"absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle\", children: [0, 1, 2].map((t) => /* @__PURE__ */ c(\n \"div\",\n {\n className: y(\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 de = {\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}, ue = {\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}, fe = {\n none: \"rounded-none\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n full: \"rounded-full\"\n}, K = {\n variant: \"primary\",\n size: \"md\",\n rounded: \"md\"\n};\nfunction me({\n variant: o = K.variant,\n size: a,\n rounded: t = K.rounded,\n loading: r,\n linkTo: e,\n linkProps: n,\n type: s = \"button\",\n className: l,\n ...u\n}) {\n let d;\n o === \"link\" && !a ? d = \"fitted\" : d = a || K.size;\n const i = y(\n \"appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all\",\n de[o],\n ue[d],\n fe[t],\n r && \"relative pointer-events-none\",\n e && \"relative\",\n l\n );\n return /* @__PURE__ */ E(\n \"button\",\n {\n ...u,\n role: e ? \"link\" : u.role,\n \"aria-label\": u[\"aria-label\"] || (n == null ? void 0 : n[\"aria-label\"]),\n \"aria-description\": u[\"aria-description\"] || (n == null ? void 0 : n[\"aria-description\"]),\n \"aria-disabled\": u.disabled || r,\n \"aria-busy\": r,\n type: s,\n className: i,\n children: [\n r && /* @__PURE__ */ c(ce, {}),\n /* @__PURE__ */ c(\"span\", { className: y(r && \"invisible\"), children: u.children }),\n e && !u.disabled && /* @__PURE__ */ c(\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 be(o) {\n const [a, t] = x(\"\"), r = I((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 A(() => {\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 _e({\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: u,\n className: d = \"\",\n ...b\n}) {\n const i = $(), v = U(() => a || `checkbox-${i}`, [a, i]), f = be(v), [m, g] = x(s);\n A(() => {\n g(s);\n }, [s]);\n const h = () => {\n u || (g(!m), l == null || l(!m));\n }, w = (N) => {\n N.key === \" \" && (N.preventDefault(), h());\n }, p = y(\n \"flex items-center justify-center border outline outline-transparent focus:outline-current focus:outline-offset-2\",\n n && \"rounded\",\n u && \"opacity-40 cursor-not-allowed\",\n !u && \"cursor-pointer\",\n d\n );\n return /* @__PURE__ */ c(\n \"button\",\n {\n id: v,\n type: \"button\",\n ref: o,\n tabIndex: 0,\n role: \"checkbox\",\n onClick: h,\n \"aria-checked\": m,\n \"aria-disabled\": u,\n onKeyDownCapture: w,\n style: {\n width: t,\n height: t,\n color: r,\n backgroundColor: m && e ? \"currentcolor\" : \"transparent\"\n },\n className: p,\n ...b,\n children: m && /* @__PURE__ */ c(ne, { size: t, color: e ? f : void 0 })\n }\n );\n}\nfunction Qe({\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: y(\"relative w-fit\", a), ...s, children: [\n o,\n t && /* @__PURE__ */ c(\n \"a\",\n {\n ...r,\n rel: (r == null ? void 0 : r.rel) || \"noreferrer\",\n href: t,\n className: y(\"absolute inset-0\", r == null ? void 0 : r.className)\n }\n ),\n !t && e && /* @__PURE__ */ c(\n \"button\",\n {\n ...n,\n type: \"button\",\n onClick: e,\n className: y(\"absolute inset-0 cursor-pointer\", n == null ? void 0 : n.className)\n }\n )\n ] });\n}\nfunction V({ elementId: o, type: a, message: t }) {\n return A(() => {\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: y(\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__ */ c(le, {}) : /* @__PURE__ */ c(oe, {}),\n /* @__PURE__ */ c(\"span\", { id: `${o}-${a}-message`, children: t })\n ]\n }\n ) : null;\n}\nconst he = {\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}, pe = {\n none: \"rounded-none\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n full: \"px-3 rounded-full\"\n}, X = {\n variant: \"default\",\n rounded: \"none\"\n};\nfunction Me({\n variant: o = X.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 u = $(), [d, b] = x(!1);\n let i = a;\n o === \"outline\" && !a && (i = \"md\"), i = i || X.rounded;\n const m = y(\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 && he[o],\n !t && pe[i],\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: y(t && \"cursor-text\"), style: { height: l.height, width: l.width }, children: [\n /* @__PURE__ */ E(\"div\", { className: y(n === \"password\" && \"relative\"), children: [\n /* @__PURE__ */ c(\n \"input\",\n {\n ...l,\n id: u,\n type: n === \"password\" && d ? \"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: m\n }\n ),\n n === \"password\" && /* @__PURE__ */ c(\n \"button\",\n {\n onClick: () => b(!d),\n className: \"absolute inset-y-0 right-0 px-2 hover:cursor-pointer\",\n \"aria-label\": \"Toggle password visibility\",\n \"data-state\": d ? \"visible\" : \"hidden\",\n children: d ? /* @__PURE__ */ c(ae, { size: 20 }) : /* @__PURE__ */ c(se, { size: 20 })\n }\n )\n ] }),\n !t && /* @__PURE__ */ c(V, { elementId: u, type: \"error\", message: r }),\n !t && /* @__PURE__ */ c(V, { elementId: u, type: \"success\", message: e })\n ] });\n}\nfunction Xe({\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 ...u\n}) {\n const d = $(), b = y(\"font-medium\", o, t), i = e ? `${s ?? d}-help` : void 0;\n return /* @__PURE__ */ E(\"div\", { style: { display: o === \"inline\" ? \"inline-flex\" : \"flex\", width: a }, className: \"relative\", children: [\n /* @__PURE__ */ E(\"label\", { className: b, htmlFor: s, ...u, children: [\n l,\n r && /* @__PURE__ */ c(\"span\", { className: \"text-red-500 font-medium ml-1\", \"aria-label\": \"required\", children: \"*\" })\n ] }),\n e && /* @__PURE__ */ c(\n \"span\",\n {\n className: \"text-gray-500 ml-1 size-fit -translate-y-1/3\",\n \"aria-describedby\": i,\n \"aria-label\": \"Help information\",\n title: e,\n children: /* @__PURE__ */ c(ie, {})\n }\n ),\n e && /* @__PURE__ */ c(\"div\", { id: i, className: \"sr-only\", children: e }),\n n && /* @__PURE__ */ c(\"span\", { className: \"ml-1\", children: n })\n ] });\n}\nfunction ge(o) {\n const [a, t] = x(!1), [r, e] = x(!1);\n return A(() => {\n o ? (e(!0), setTimeout(() => t(!0), 10)) : (t(!1), setTimeout(() => e(!1), 150));\n }, [o]), { show: a, shouldRender: r };\n}\nfunction ve(o, a) {\n A(() => {\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 we(o, a) {\n const t = R(null), r = I(() => {\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((u) => !(u instanceof HTMLButtonElement && u.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 A(() => (a && (t.current = document.activeElement, r()), () => {\n document.body.style.overflow = \"auto\", t.current instanceof HTMLElement && t.current.focus();\n }), [a, r]);\n}\nfunction Ze({\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: u = !1,\n actions: d = [],\n disableCloseOnOverlayClick: b = !1,\n ariaLabelledBy: i,\n ariaDescribedBy: v\n}) {\n const f = $(), m = o || `modal-${f}`, g = o ? `${o}-title` : `modal-title-${f}`, { show: h, shouldRender: w } = ge(a);\n if (we(m, w), ve(w, t), !w) return null;\n const p = () => r ? z.isValidElement(r) ? /* @__PURE__ */ c(\"div\", { className: \"mb-4\", children: r }) : /* @__PURE__ */ c(\"h2\", { className: \"mb-4 text-xl font-semibold\", id: g, children: r }) : null, N = () => d.length === 0 ? null : /* @__PURE__ */ c(\"div\", { className: \"mt-6 not-sm:grid gap-y-2 sm:flex sm:justify-start sm:flex-row-reverse sm:gap-x-3\", children: d.map((D, C) => {\n const { label: L, className: B, ...S } = D;\n return /* @__PURE__ */ c(me, { className: B, type: \"button\", ...S, \"data-modal-action\": \"true\", children: L }, C);\n }) });\n return /* @__PURE__ */ c(W, { children: _(\n /* @__PURE__ */ c(\n \"div\",\n {\n \"aria-labelledby\": i ?? r ? g : 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__ */ E(\"div\", { className: \"flex min-h-screen items-center justify-center p-4\", children: [\n /* @__PURE__ */ c(\n \"div\",\n {\n className: k(\"fixed inset-0 bg-black/20 transition-all\", l),\n onClick: () => {\n b || t();\n }\n }\n ),\n n && /* @__PURE__ */ c(\"div\", { className: k(\"relative w-fit\", s), children: e }),\n !n && /* @__PURE__ */ E(\n \"div\",\n {\n id: m,\n tabIndex: -1,\n className: k(\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 !u && /* @__PURE__ */ c(\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__ */ c(P, { size: 18 })\n }\n ),\n p(),\n e,\n N()\n ]\n }\n )\n ] })\n }\n ),\n document.body\n ) });\n}\nfunction ye(o) {\n const [a, t] = x(!1), [r, e] = x(!1);\n return A(() => {\n o ? (e(!0), setTimeout(() => t(!0), 10)) : (t(!1), setTimeout(() => e(!1), 300));\n }, [o]), { show: a, shouldRender: r };\n}\nfunction xe(o, a) {\n A(() => {\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 Ee(o, a) {\n const t = R(null), r = I(() => {\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((u) => !(u instanceof HTMLButtonElement && u.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 A(() => (a && (t.current = document.activeElement, r()), () => {\n document.body.style.overflow = \"auto\", t.current instanceof HTMLElement && t.current.focus();\n }), [a, r]);\n}\nconst Ne = {\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 Je({\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: u,\n overlayClassName: d,\n hideCloseButton: b = !1,\n disableCloseOnOverlayClick: i = !1,\n ariaLabelledBy: v,\n ariaDescribedBy: f\n}) {\n const m = $(), g = a || `panel-${m}`, h = a ? `${a}-title` : `panel-title-${m}`, { show: w, shouldRender: p } = ye(t);\n if (Ee(g, p), xe(p, r), !p) return null;\n const N = () => e ? z.isValidElement(e) ? /* @__PURE__ */ c(\"div\", { children: e }) : /* @__PURE__ */ c(\"h2\", { className: \"text-2xl font-semibold\", id: h, children: e }) : null, D = () => {\n if (!s) return null;\n if (z.isValidElement(s)) {\n const C = s, L = C.props.className || \"\";\n return z.cloneElement(C, { className: k(\"px-6 py-4\", L) });\n }\n return /* @__PURE__ */ c(\"div\", { className: \"px-6 py-4\", children: s });\n };\n return /* @__PURE__ */ c(W, { children: _(\n /* @__PURE__ */ E(\n \"div\",\n {\n \"aria-labelledby\": v ?? e ? h : void 0,\n \"aria-describedby\": f,\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__ */ c(\n \"div\",\n {\n className: k(\n \"fixed inset-0 bg-black/40 transition-opacity duration-300\",\n w ? \"opacity-100\" : \"opacity-0\",\n d\n ),\n onClick: () => {\n i || r();\n }\n }\n ),\n /* @__PURE__ */ c(\"div\", { className: \"fixed inset-y-0 right-0 flex max-w-full\", children: /* @__PURE__ */ c(\n \"div\",\n {\n id: g,\n ref: o,\n tabIndex: -1,\n className: k(\n \"relative h-full transform shadow-xl bg-popover transition-transform duration-300 ease-in-out\",\n l !== \"screen\" && \"border-l border-border\",\n Ne.size[l],\n w ? \"translate-x-0\" : \"translate-x-full\",\n u\n ),\n \"data-panel-size\": l,\n children: /* @__PURE__ */ E(\"div\", { className: \"flex h-full flex-col\", children: [\n e && /* @__PURE__ */ c(\"div\", { className: \"px-6 pt-6\", children: N() }),\n !b && /* @__PURE__ */ c(\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__ */ c(P, { size: 18 })\n }\n ),\n /* @__PURE__ */ c(\"div\", { className: k(\"flex-1 overflow-y-auto px-6 pb-6\", e ? \"pt-6\" : \"pt-10\"), children: n }),\n D()\n ] })\n }\n ) })\n ]\n }\n ),\n document.body\n ) });\n}\nfunction Ae({ 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 }, u = y(\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__ */ c(\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: u,\n style: {\n width: \"1em\",\n height: \"1em\",\n padding: \"0.1em\",\n borderWidth: \"0.06em\"\n },\n children: a && /* @__PURE__ */ c(\n \"div\",\n {\n className: y(\"size-full aspect-square rounded-full\", e && \"bg-muted/60\", !e && \"bg-current\")\n }\n )\n }\n );\n}\nfunction G({\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: u\n}) {\n const b = `radio-${$()}-${o}`, i = () => {\n n || e == null || e(o);\n };\n return /* @__PURE__ */ E(\n \"div\",\n {\n title: l,\n className: y(\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__ */ c(\n Ae,\n {\n itemId: b,\n name: u || \"\",\n checked: r,\n onChange: i,\n disabled: n,\n className: y(s && \"\")\n }\n ),\n /* @__PURE__ */ c(\n \"div\",\n {\n id: s ? b : void 0,\n tabIndex: s ? -1 : void 0,\n role: s ? \"radio\" : void 0,\n onClick: s ? i : 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 ${u}` : void 0,\n \"aria-labelledby\": s ? `${b}-label` : void 0,\n className: y(s && \"size-full\", typeof a == \"object\" && \"grow focus:outline-none\"),\n children: /* @__PURE__ */ c(\n \"label\",\n {\n id: `${b}-label`,\n onClick: s ? void 0 : i,\n className: y(n && \"cursor-not-allowed\", !n && \"cursor-pointer\"),\n children: a\n }\n )\n }\n )\n ]\n }\n );\n}\nfunction Ce(o, a) {\n const [t, r] = x(a), [e, n] = x(-1), [s, l] = x(!1), u = I((f, m) => {\n var w;\n const g = f[m];\n g.hasAttribute(\"disabled\") || g.getAttribute(\"aria-disabled\") === \"true\" || ((w = f[m]) == null || w.click(), n(m));\n }, []), d = I(\n (f, m) => {\n var h;\n if (f.preventDefault(), s || !m.length) return;\n const g = a !== -1 ? a : 0;\n (h = m[g]) == null || h.focus(), r(g), a !== -1 && u(m, g);\n },\n [a, s, u]\n ), b = I(\n (f) => {\n var w;\n if (!f.shiftKey)\n return;\n f.preventDefault();\n const m = Array.from(\n document.querySelectorAll(\n 'a, button, input, textarea, select, details, [tabindex]:not([tabindex=\"-1\"])'\n )\n ).filter((p) => !p.hasAttribute(\"disabled\") && p.tabIndex >= 0), g = m.findIndex((p) => p.id === o), h = g > 0 ? g - 1 : m.length - 1;\n (w = m[h]) == null || w.focus();\n },\n [o]\n ), i = I(\n (f, m) => {\n var N;\n if (!m.length) return;\n const g = f.target;\n if (!m.some((D) => D.id === g.id)) return;\n const w = t !== -1 ? t : 0;\n let p = w;\n switch (f.key) {\n case \"ArrowUp\":\n case \"ArrowLeft\":\n f.preventDefault(), p = w > 0 ? w - 1 : m.length - 1;\n break;\n case \"ArrowDown\":\n case \"ArrowRight\":\n f.preventDefault(), p = (w + 1) % m.length;\n break;\n // Select the option when the space key is pressed\n case \" \":\n f.preventDefault(), u(m, w);\n return;\n case \"Tab\":\n b(f);\n return;\n default:\n return;\n }\n (N = m[p]) == null || N.focus(), r(p), e !== -1 && u(m, p);\n },\n [t, e, b, u]\n ), v = I(() => {\n const f = document.querySelector(`[id=\"${o}\"][role=\"radiogroup\"]`);\n return f ? Array.from(f.querySelectorAll('[role=\"radio\"]')) : [];\n }, [o]);\n A(() => {\n const f = document.querySelector(`[id=\"${o}\"][role=\"radiogroup\"]`);\n if (!f) return;\n const m = v(), g = (N) => d(N, m), h = (N) => i(N, m), w = () => l(!0), p = () => l(!1);\n return document.addEventListener(\"keydown\", h), f.addEventListener(\"focus\", g), f.addEventListener(\"mousedown\", w), document.addEventListener(\"mouseup\", p), () => {\n document.removeEventListener(\"keydown\", h), f.removeEventListener(\"focus\", g), f.removeEventListener(\"mousedown\", w), document.removeEventListener(\"mouseup\", p);\n };\n }, [o, v, d, i]);\n}\nfunction Ye({\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 u = $(), d = r || `radio-group-${u}`;\n Ce(\n d,\n o.findIndex((i) => i === a)\n );\n const b = U(() => o.reduce((i, v) => (typeof v == \"string\" ? i.some((f) => f.value === v) || i.push({ label: v, value: v }) : i.push(v), i), []), [o]);\n return /* @__PURE__ */ E(\"div\", { id: d, role: \"radiogroup\", tabIndex: 0, className: y(n, \"focus:outline-none\"), children: [\n b.length > 0 && b.map((i, v) => /* @__PURE__ */ c(\n G,\n {\n value: i.value,\n isSelected: a === i.value,\n onChange: t,\n name: d,\n disabled: i.disabled,\n description: i.description,\n hideInput: l,\n className: s,\n children: i.label\n },\n `${i.value}-${v}`\n )),\n b.length === 0 && e && z.Children.map(e, (i) => z.isValidElement(i) && i.type === G ? /* @__PURE__ */ c(\n G,\n {\n ...i.props,\n className: y(s, i.props.className),\n hideInput: i.props.hideInput || l,\n isSelected: a === i.props.value,\n onChange: t,\n name: d,\n children: i.props.children\n }\n ) : null)\n ] });\n}\nconst Ie = {\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}, $e = {\n horizontal: \"w-full\",\n vertical: \"min-h-4 h-full\"\n};\nfunction Pe({\n orientation: o = \"horizontal\",\n decorative: a = !1,\n thickness: t = \"thin\",\n className: r,\n ...e\n}) {\n const n = y(\n \"shrink-0 bg-border\",\n $e[o],\n Ie[t][o],\n r\n );\n return /* @__PURE__ */ c(\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}\nfunction Oe({ children: o, ref: a, ...t }) {\n if (ee(o)) {\n let r = { ...t };\n return o.props && (r = { ...r, ...o.props }), te(o, {\n ...r,\n ref: (e) => {\n typeof a == \"function\" ? a(e) : a && (a.current = e);\n }\n });\n }\n return Y(\"div\", { ...t, ref: a }, o);\n}\nfunction Te({ elementId: o, maxLength: a }) {\n const [t, r] = x(0);\n return A(() => {\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__ */ c(\n \"small\",\n {\n className: y(\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 De(o, a) {\n A(() => {\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 ze = {\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}, ke = {\n none: \"rounded-none\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n full: \"px-3 rounded-full\"\n}, Z = {\n variant: \"outline\",\n rounded: \"none\"\n};\nfunction et({\n variant: o = Z.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: u,\n ...d\n}) {\n const b = $();\n De(b, s || t);\n let i = a;\n o === \"outline\" && !a && (i = \"md\"), i = i || Z.rounded;\n let v = n;\n (t || o === \"left-line\" && !n) && (v = !0);\n const m = y(\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 && ze[o],\n !t && ke[i],\n !t && \"px-2 py-1\",\n t && \"pointer-events-none\",\n v && \"no-resize-handle\",\n u\n );\n return /* @__PURE__ */ E(\"div\", { className: y(\"-space-y-1.5\", t && \"cursor-text\"), children: [\n /* @__PURE__ */ c(\n \"textarea\",\n {\n ...d,\n id: b,\n \"aria-disabled\": d.disabled,\n readOnly: t,\n \"aria-readonly\": t || d[\"aria-readonly\"],\n style: {\n resize: s ? \"none\" : void 0\n },\n className: m\n }\n ),\n l > 0 && /* @__PURE__ */ c(Te, { elementId: b, maxLength: l }),\n !t && /* @__PURE__ */ c(V, { elementId: b, type: \"error\", message: r }),\n !t && /* @__PURE__ */ c(V, { elementId: b, type: \"success\", message: e })\n ] });\n}\nconst Le = {\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}, Re = {\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}, J = {\n variant: \"default\",\n size: \"md\"\n};\nfunction tt({\n ref: o,\n id: a,\n size: t = J.size,\n variant: r = J.variant,\n checked: e,\n onCheckedChange: n,\n disabled: s = !1,\n className: l,\n thumbClassName: u,\n backgroundClassNames: d,\n ...b\n}) {\n const i = $(), v = U(() => a || `toggle-${i}`, [a, i]), [f, m] = x(e);\n A(() => {\n m(e);\n }, [e]);\n const g = () => {\n if (!s) {\n const C = !f;\n e === void 0 && m(C), n == null || n(C);\n }\n }, h = (C) => {\n (C.key === \" \" || C.key === \"Enter\") && (C.preventDefault(), g());\n }, w = Le[t], p = Re[r], N = y(\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 w.container,\n // Variant and state\n f ? (d == null ? void 0 : d.checked) || p.checked : (d == null ? void 0 : d.unchecked) || p.unchecked,\n // Disabled state\n s && \"opacity-50 cursor-not-allowed\",\n !s && \"cursor-pointer\",\n l\n ), D = y(\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 w.thumb,\n // Position based on state\n f && w.translate,\n u\n );\n return /* @__PURE__ */ E(\n \"button\",\n {\n ref: o,\n id: v,\n type: \"button\",\n role: \"switch\",\n tabIndex: 0,\n \"aria-checked\": f,\n \"aria-disabled\": s,\n disabled: s,\n onClick: g,\n onKeyDown: h,\n className: N,\n ...b,\n children: [\n /* @__PURE__ */ c(\"span\", { className: D }),\n /* @__PURE__ */ c(\"span\", { className: \"sr-only\", children: f ? \"Enabled\" : \"Disabled\" })\n ]\n }\n );\n}\nconst j = 8, F = 4, T = 6;\nfunction Be(o) {\n return { calculatePosition: I(\n (t, r) => {\n const e = t.getBoundingClientRect(), n = r.getBoundingClientRect(), s = {\n width: window.innerWidth,\n height: window.innerHeight\n }, l = (v, f, m, g) => v < 0 || f < 0 || v + m > s.width || f + g > s.height, u = {\n top: {\n x: e.left + e.width / 2 - n.width / 2,\n y: e.top - n.height - F,\n arrow: {\n x: n.width / 2 - T,\n y: n.height\n }\n },\n bottom: {\n x: e.left + e.width / 2 - n.width / 2,\n y: e.bottom + F,\n arrow: {\n x: n.width / 2 - T,\n y: -6\n }\n },\n left: {\n x: e.left - n.width - F,\n y: e.top + e.height / 2 - n.height / 2,\n arrow: {\n x: n.width,\n y: n.height / 2 - T\n }\n },\n right: {\n x: e.right + F,\n y: e.top + e.height / 2 - n.height / 2,\n arrow: {\n x: -6,\n y: n.height / 2 - T\n }\n }\n };\n let d = o, b = u[o];\n if (l(b.x, b.y, n.width, n.height)) {\n const v = {\n top: \"bottom\",\n bottom: \"top\",\n left: \"right\",\n right: \"left\"\n }, f = u[v[o]];\n if (!l(f.x, f.y, n.width, n.height))\n d = v[o], b = f;\n else {\n const m = [\"top\", \"bottom\", \"left\", \"right\"].filter(\n (g) => g !== o && g !== v[o]\n );\n for (const g of m) {\n const h = u[g];\n if (!l(h.x, h.y, n.width, n.height)) {\n d = g, b = h;\n break;\n }\n }\n }\n }\n b.x = Math.max(\n j,\n Math.min(b.x, s.width - n.width - j)\n ), b.y = Math.max(\n j,\n Math.min(b.y, s.height - n.height - j)\n );\n const i = {\n x: e.left + e.width / 2,\n y: e.top + e.height / 2\n };\n return d === \"top\" || d === \"bottom\" ? b.arrow.x = Math.max(\n T,\n Math.min(i.x - b.x - T, n.width - T * 2)\n ) : b.arrow.y = Math.max(\n T,\n Math.min(i.y - b.y - T, n.height - T * 2)\n ), {\n ...b,\n placement: d\n };\n },\n [o]\n ) };\n}\nfunction Se(o, a, t) {\n const r = R(null), e = R(null), n = I(() => {\n if (!r.current || !e.current) return;\n const s = o(r.current, e.current);\n t(s);\n }, [o, t]);\n return A(() => {\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 je(o, a, t, r, e, n, s, l, u) {\n const d = R(null), b = I(() => {\n o || (d.current && clearTimeout(d.current), d.current = window.setTimeout(() => {\n t(!0), requestAnimationFrame(() => {\n e(), r(!0);\n });\n }, a));\n }, [o, a, t, e, r]), i = I(\n (v = !1) => {\n if (d.current && clearTimeout(d.current), v) {\n r(!1), setTimeout(() => t(!1), 150);\n return;\n }\n d.current = window.setTimeout(() => {\n r(!1), setTimeout(() => t(!1), 150);\n }, 100);\n },\n [r, t]\n );\n return A(() => {\n !n && !s && !l && u && i();\n }, [n, s, l, u, i]), A(() => () => {\n d.current && clearTimeout(d.current);\n }, []), {\n showTooltip: b,\n hideTooltip: i,\n timeoutRef: d\n };\n}\nfunction rt({\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, u] = x(!1), [d, b] = x(!1), [i, v] = x(null), [f, m] = x(!1), [g, h] = x(!1), [w, p] = x(!1), { calculatePosition: N } = Be(r), { triggerRef: D, tooltipRef: C, updatePosition: L } = Se(N, d, v), { showTooltip: B, hideTooltip: S, timeoutRef: Q } = je(\n e,\n n,\n b,\n u,\n L,\n f,\n g,\n w,\n l\n ), O = $(), M = o ?? O;\n return /* @__PURE__ */ E(W, { children: [\n z.cloneElement(a, {\n ref: (H) => {\n D.current = H;\n },\n onMouseEnter: () => {\n m(!0), B();\n },\n onMouseLeave: () => {\n m(!1);\n },\n onFocus: () => {\n p(!0), B();\n },\n onBlur: () => {\n p(!1), S(!0);\n },\n onKeyDown: (H) => {\n H.key === \"Escape\" && S(!0);\n },\n \"aria-describedby\": e ? void 0 : M\n }),\n d && _(\n /* @__PURE__ */ c(\n \"div\",\n {\n ref: C,\n id: M,\n role: \"tooltip\",\n className: y(\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: i ? { left: i.x, top: i.y } : { opacity: 0 },\n onMouseEnter: () => {\n h(!0), Q.current && clearTimeout(Q.current);\n },\n onMouseLeave: () => {\n h(!1);\n },\n children: t\n }\n ),\n document.body\n )\n ] });\n}\nexport {\n Ue as Accordion,\n q as AccordionItem,\n at as ActionModal,\n me as Button,\n ce as ButtonLoadingDots,\n _e as Checkbox,\n Qe as Clickable,\n Me as Input,\n Xe as Label,\n Ze as Modal,\n Je as Panel,\n Ye as RadioGroup,\n G as RadioGroupItem,\n Ae as RadioInput,\n Pe as Separator,\n Oe as Slot,\n et as Textarea,\n st as Toast,\n tt as Toggle,\n rt 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 { 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\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","i","e","w","D","ce","o","a","x","A","r","c","y","de","ue","fe","K","me","l","u","d","E","ge","ve","we","R","I","Ze","b","v","f","$","m","g","p","z","N","L","B","W","_","k","P","ActionModal","type","message","cancelText","confirmText","onConfirm","onClose","destructive","title","modalProps","defaultTexts","useMemo","actions","jsx","Modal","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,OAAO,IAAI,gBAAgB,WAAW,IAAI,UAAU,GAAGC,EAAC,GAAI;AACrF,SAAuBC,gBAAAA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AAE,EAAA,MAAM,GAAI,CAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACf;AAAA,IAAA;AAAA,EACF;AAEJ;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),l=require("react"),y=require("./utils.cjs.js"),A=require("./QuestionMarkCircled-D5cHmQp1.cjs"),I=require("./Toast-BZMBGn3W.cjs"),F=require("./X-CgjeP2OI.cjs"),V=require("react-dom");function R({id:o,title:s,content:t,children:r,className:e="",disabled:n=!1,isOpen:a=!1,onToggle:c,triggerClassName:f="",bodyClassName:d=""}){const h=l.useId(),u=o||`accordion-item-${h}`,v=`${u}-header`,m=`${u}-panel`,b=()=>{!n&&c&&c()},g=x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),b())};return i.jsxs("div",{className:y.join("border-b border-gray-200",n&&"opacity-60 cursor-not-allowed",e),children:[i.jsxs("button",{id:v,type:"button",className:y.join("w-full text-left py-3 px-4 flex justify-between items-center focus:outline focus:outline-secondary",n?"cursor-not-allowed":"hover:bg-gray-50/10 cursor-pointer",f),"aria-expanded":a,"aria-controls":m,disabled:n,onClick:b,onKeyDown:g,children:[i.jsx("span",{children:s}),i.jsx("span",{className:y.join("transform transition-transform duration-300 ease-linear",a?"rotate-180":"rotate-0"),"aria-hidden":"true",children:i.jsx(A.ChevronDown,{size:18})})]}),i.jsx("div",{id:m,role:"region","aria-labelledby":v,className:y.join("transition-all duration-300 ease-linear px-4",a?"max-h-96 opacity-100 overflow-auto py-3":"max-h-0 opacity-0 overflow-hidden",d),children:a&&(r||t)})]})}function Z({id:o,items:s=[],children:t,className:r="",itemClassName:e="",allowMultiple:n=!1,defaultOpenItems:a=[],triggersClassName:c="",bodiesClassName:f=""}){const d=l.useId(),h=o||`accordion-group-${d}`,[u,v]=l.useState(new Set(a)),m=x=>{v(w=>{const p=new Set(w);return p.has(x)?p.delete(x):(n||p.clear(),p.add(x)),p})},b=x=>`${d}-item-${x}`,g=x=>u.has(x);return i.jsxs("div",{id:h,className:r,children:[s.length>0&&s.map((x,w)=>{const p=x.id||b(w);return i.jsx(R,{id:p,title:x.title,content:x.content,disabled:x.disabled,isOpen:g(p),onToggle:()=>m(p),className:e,triggerClassName:c,bodyClassName:f},p)}),s.length===0&&t&&l.Children.map(t,(x,w)=>{if(l.isValidElement(x)&&x.type===R){const p=x.props.id||b(w);return l.createElement(R,{...x.props,key:p,id:p,className:y.join(e,x.props.className),isOpen:g(p),onToggle:()=>m(p),triggerClassName:y.join(c,x.props.triggerClassName),bodyClassName:y.join(f,x.props.bodyClassName)})}return null})]})}function U(){const[o,s]=l.useState(0);return l.useEffect(()=>{const t=setInterval(()=>{s(r=>(r+1)%3)},500);return()=>clearInterval(t)},[]),i.jsx("div",{className:"absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle",children:[0,1,2].map(t=>i.jsx("div",{className:y.join("rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current",o===t&&"transform -translate-y-1")},t))})}const J={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"},Y={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"},P={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"},q={variant:"primary",size:"md",rounded:"md"};function X({variant:o=q.variant,size:s,rounded:t=q.rounded,loading:r,linkTo:e,linkProps:n,type:a="button",className:c,...f}){let d;o==="link"&&!s?d="fitted":d=s||q.size;const u=y.join("appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all",J[o],Y[d],P[t],r&&"relative pointer-events-none",e&&"relative",c);return i.jsxs("button",{...f,role:e?"link":f.role,"aria-label":f["aria-label"]||(n==null?void 0:n["aria-label"]),"aria-description":f["aria-description"]||(n==null?void 0:n["aria-description"]),"aria-disabled":f.disabled||r,"aria-busy":r,type:a,className:u,children:[r&&i.jsx(U,{}),i.jsx("span",{className:y.join(r&&"invisible"),children:f.children}),e&&!f.disabled&&i.jsx("a",{...n,"aria-hidden":!0,href:e,rel:(n==null?void 0:n.rel)||"noreferrer",className:"absolute inset-0"})]})}function O(o){const[s,t]=l.useState(""),r=l.useCallback(e=>{let n=e,a="";for(;n&&!a;){const c=window.getComputedStyle(n).backgroundColor;c&&c!=="transparent"&&c!=="rgba(0, 0, 0, 0)"&&(a=c),n=n.parentElement}return a||"transparent"},[]);return l.useEffect(()=>{const e=document.getElementById(o);if(e){const n=r(e.parentElement);t(n)}},[o,r]),s}function ee({ref:o,id:s,size:t=20,color:r,filled:e=!1,rounded:n=!0,checked:a=!1,onCheckedChange:c,disabled:f,className:d="",...h}){const u=l.useId(),v=l.useMemo(()=>s||`checkbox-${u}`,[s,u]),m=O(v),[b,g]=l.useState(a);l.useEffect(()=>{g(a)},[a]);const x=()=>{f||(g(!b),c==null||c(!b))},w=j=>{j.key===" "&&(j.preventDefault(),x())},p=y.join("flex items-center justify-center border outline outline-transparent focus:outline-current focus:outline-offset-2",n&&"rounded",f&&"opacity-40 cursor-not-allowed",!f&&"cursor-pointer",d);return i.jsx("button",{id:v,type:"button",ref:o,tabIndex:0,role:"checkbox",onClick:x,"aria-checked":b,"aria-disabled":f,onKeyDownCapture:w,style:{width:t,height:t,color:r,backgroundColor:b&&e?"currentcolor":"transparent"},className:p,...h,children:b&&i.jsx(A.Check,{size:t,color:e?m:void 0})})}function te({children:o,className:s,linkTo:t,linkProps:r,onButtonClick:e,buttonProps:n,...a}){return t&&e&&console.warn('Clickable: Both "linkTo" and "onButtonClick" props are provided. Only "linkTo" will be used.'),i.jsxs("div",{className:y.join("relative w-fit",s),...a,children:[o,t&&i.jsx("a",{...r,rel:(r==null?void 0:r.rel)||"noreferrer",href:t,className:y.join("absolute inset-0",r==null?void 0:r.className)}),!t&&e&&i.jsx("button",{...n,type:"button",onClick:e,className:y.join("absolute inset-0 cursor-pointer",n==null?void 0:n.className)})]})}function L({elementId:o,type:s,message:t}){return l.useEffect(()=>{const r=document.getElementById(o);if(r){if(!t&&s==="error"){r.removeAttribute("data-error");return}if(!t&&s==="success"){r.removeAttribute("data-success");return}return r.setAttribute("aria-describedby",`${o}-${s}-message`),r.setAttribute("aria-invalid",s==="error"?"true":"false"),s==="error"&&r.setAttribute("data-error","true"),s==="success"&&r.setAttribute("data-success","true"),()=>{r.removeAttribute("aria-describedby"),r.removeAttribute("aria-invalid"),r.removeAttribute("data-error"),r.removeAttribute("data-success")}}},[o,s,t]),t?i.jsxs("small",{className:y.join("mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-start",s==="error"&&"text-destructive",s==="success"&&"text-success"),role:"status",children:[s==="error"?i.jsx(F.ExclamationTriangle,{}):i.jsx(A.CheckCircled,{}),i.jsx("span",{id:`${o}-${s}-message`,children:t})]}):null}const re={base:"",default:"ring ring-transparent focus:ring-primary-foreground not-disabled:data-error:ring-destructive not-disabled:data-success:ring-success",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",outline:"border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success"},ne={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"px-3 rounded-full"},G={variant:"default",rounded:"none"};function oe({variant:o=G.variant,rounded:s,displayOnlyMode:t=!1,errorMessage:r,successMessage:e,type:n="text",className:a,...c}){const f=l.useId(),[d,h]=l.useState(!1);let u=s;o==="outline"&&!s&&(u="md"),u=u||G.rounded;const b=y.join("appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all","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",!t&&re[o],!t&&ne[u],n==="password"&&"pr-10",!t&&"px-2 py-1",t&&"pointer-events-none",a);return i.jsxs("div",{className:y.join(t&&"cursor-text"),style:{height:c.height,width:c.width},children:[i.jsxs("div",{className:y.join(n==="password"&&"relative"),children:[i.jsx("input",{...c,id:f,type:n==="password"&&d?"text":n,"aria-disabled":c.disabled,readOnly:t,"aria-readonly":t||c["aria-readonly"],"data-error":r?!0:void 0,"data-success":e?!0:void 0,className:b}),n==="password"&&i.jsx("button",{onClick:()=>h(!d),className:"absolute inset-y-0 right-0 px-2 hover:cursor-pointer","aria-label":"Toggle password visibility","data-state":d?"visible":"hidden",children:d?i.jsx(A.EyeClosed$1,{size:20}):i.jsx(A.EyeClosed,{size:20})})]}),!t&&i.jsx(L,{elementId:f,type:"error",message:r}),!t&&i.jsx(L,{elementId:f,type:"success",message:e})]})}function se({display:o="inline",width:s="fit-content",className:t="",required:r,helpMessage:e,suffix:n,htmlFor:a,children:c,...f}){const d=l.useId(),h=y.join("font-medium",o,t),u=e?`${a??d}-help`:void 0;return i.jsxs("div",{style:{display:o==="inline"?"inline-flex":"flex",width:s},className:"relative",children:[i.jsxs("label",{className:h,htmlFor:a,...f,children:[c,r&&i.jsx("span",{className:"text-red-500 font-medium ml-1","aria-label":"required",children:"*"})]}),e&&i.jsx("span",{className:"text-gray-500 ml-1 size-fit -translate-y-1/3","aria-describedby":u,"aria-label":"Help information",title:e,children:i.jsx(A.QuestionMarkCircled,{})}),e&&i.jsx("div",{id:u,className:"sr-only",children:e}),n&&i.jsx("span",{className:"ml-1",children:n})]})}function ae(o){const[s,t]=l.useState(!1),[r,e]=l.useState(!1);return l.useEffect(()=>{o?(e(!0),setTimeout(()=>t(!0),10)):(t(!1),setTimeout(()=>e(!1),150))},[o]),{show:s,shouldRender:r}}function ie(o,s){l.useEffect(()=>{const t=r=>{r.key==="Escape"&&o&&s()};return document.addEventListener("keydown",t),o&&(document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",t),document.body.style.overflow="auto"}},[o,s])}function le(o,s){const t=l.useRef(null),r=l.useCallback(()=>{const e=document.getElementById(o);if(!e)return;const n=e.querySelectorAll('[data-modal-action="true"]');if(n.length>0){n[0].focus();return}const a=e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(a.length>0){const c=Array.from(a).filter(f=>!(f instanceof HTMLButtonElement&&f.getAttribute("data-modal-close-button")==="true"));if(c.length>0){c[0].focus();return}a[0].focus();return}e.focus()},[o]);l.useEffect(()=>(s&&(t.current=document.activeElement,r()),()=>{document.body.style.overflow="auto",t.current instanceof HTMLElement&&t.current.focus()}),[s,r])}function ue({id:o,isOpen:s,onClose:t,title:r,children:e,contentOnly:n=!1,className:a,overlayClassName:c,hideCloseButton:f=!1,actions:d=[],disableCloseOnOverlayClick:h=!1,ariaLabelledBy:u,ariaDescribedBy:v}){const m=l.useId(),b=o||`modal-${m}`,g=o?`${o}-title`:`modal-title-${m}`,{show:x,shouldRender:w}=ae(s);if(le(b,w),ie(w,t),!w)return null;const p=()=>r?l.isValidElement(r)?i.jsx("div",{className:"mb-4",children:r}):i.jsx("h2",{className:"mb-4 text-xl font-semibold",id:g,children:r}):null,j=()=>d.length===0?null:i.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:d.map((C,E)=>{const{label:k,className:S,...T}=C;return i.jsx(X,{className:S,type:"button",...T,"data-modal-action":"true",children:k},E)})});return i.jsx(i.Fragment,{children:V.createPortal(i.jsx("div",{"aria-labelledby":u??r?g:void 0,"aria-describedby":v,role:"dialog","aria-modal":"true",className:"fixed inset-0 z-[100] overflow-y-auto",children:i.jsxs("div",{className:"flex min-h-screen items-center justify-center p-4",children:[i.jsx("div",{className:I.n("fixed inset-0 bg-black/20 transition-all",c),onClick:()=>{h||t()}}),n&&i.jsx("div",{className:I.n("relative w-fit",a),children:e}),!n&&i.jsxs("div",{id:b,tabIndex:-1,className:I.n("relative w-full max-w-xl transform rounded-lg shadow-xl bg-popover transition-all p-6 focus:ring ease-in duration-75",x?"opacity-100 scale-100":"opacity-0 scale-90",a),children:[!f&&i.jsx("button",{type:"button",onClick:t,"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:i.jsx(F.X,{size:18})}),p(),e,j()]})]})}),document.body)})}function ce(o){const[s,t]=l.useState(!1),[r,e]=l.useState(!1);return l.useEffect(()=>{o?(e(!0),setTimeout(()=>t(!0),10)):(t(!1),setTimeout(()=>e(!1),300))},[o]),{show:s,shouldRender:r}}function de(o,s){l.useEffect(()=>{const t=r=>{r.key==="Escape"&&o&&s()};return document.addEventListener("keydown",t),o&&(document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",t),document.body.style.overflow="auto"}},[o,s])}function fe(o,s){const t=l.useRef(null),r=l.useCallback(()=>{const e=document.getElementById(o);if(!e)return;const n=e.querySelectorAll('[data-panel-action="true"]');if(n.length>0){n[0].focus();return}const a=e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(a.length>0){const c=Array.from(a).filter(f=>!(f instanceof HTMLButtonElement&&f.getAttribute("data-panel-close-button")==="true"));if(c.length>0){c[0].focus();return}a[0].focus();return}e.focus()},[o]);l.useEffect(()=>(s&&(t.current=document.activeElement,r()),()=>{document.body.style.overflow="auto",t.current instanceof HTMLElement&&t.current.focus()}),[s,r])}const me={size:{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl",full:"w-full",screen:"w-screen"}};function be({ref:o,id:s,isOpen:t,onClose:r,title:e,children:n,footer:a,size:c="md",className:f,overlayClassName:d,hideCloseButton:h=!1,disableCloseOnOverlayClick:u=!1,ariaLabelledBy:v,ariaDescribedBy:m}){const b=l.useId(),g=s||`panel-${b}`,x=s?`${s}-title`:`panel-title-${b}`,{show:w,shouldRender:p}=ce(t);if(fe(g,p),de(p,r),!p)return null;const j=()=>e?l.isValidElement(e)?i.jsx("div",{children:e}):i.jsx("h2",{className:"text-2xl font-semibold",id:x,children:e}):null,C=()=>{if(!a)return null;if(l.isValidElement(a)){const E=a,k=E.props.className||"";return l.cloneElement(E,{className:I.n("px-6 py-4",k)})}return i.jsx("div",{className:"px-6 py-4",children:a})};return i.jsx(i.Fragment,{children:V.createPortal(i.jsxs("div",{"aria-labelledby":v??e?x:void 0,"aria-describedby":m,role:"dialog","aria-modal":"true",className:"fixed inset-0 z-[100] overflow-hidden","data-panel-open":t,children:[i.jsx("div",{className:I.n("fixed inset-0 bg-black/40 transition-opacity duration-300",w?"opacity-100":"opacity-0",d),onClick:()=>{u||r()}}),i.jsx("div",{className:"fixed inset-y-0 right-0 flex max-w-full",children:i.jsx("div",{id:g,ref:o,tabIndex:-1,className:I.n("relative h-full transform shadow-xl bg-popover transition-transform duration-300 ease-in-out",c!=="screen"&&"border-l border-border",me.size[c],w?"translate-x-0":"translate-x-full",f),"data-panel-size":c,children:i.jsxs("div",{className:"flex h-full flex-col",children:[e&&i.jsx("div",{className:"px-6 pt-6",children:j()}),!h&&i.jsx("button",{type:"button",onClick:r,"data-panel-close-button":"true","aria-label":"Close panel",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",children:i.jsx(F.X,{size:18})}),i.jsx("div",{className:I.n("flex-1 overflow-y-auto px-6 pb-6",e?"pt-6":"pt-10"),children:n}),C()]})})})]}),document.body)})}function _({itemId:o,checked:s,onChange:t,name:r,disabled:e=!1,className:n=""}){const a="relative inline-flex items-center justify-center rounded-full",c=()=>{e||t()},f=y.join(a,!s&&"hover:border-current/60",!e&&"border-current cursor-pointer",e&&"border-muted/60 cursor-not-allowed",n);return i.jsx("div",{id:o,role:"radio",tabIndex:-1,"aria-checked":s,"aria-disabled":e,"aria-description":`Radio button for ${r}`,"aria-labelledby":`${o}-label`,onClick:c,className:f,style:{width:"1em",height:"1em",padding:"0.1em",borderWidth:"0.06em"},children:s&&i.jsx("div",{className:y.join("size-full aspect-square rounded-full",e&&"bg-muted/60",!e&&"bg-current")})})}function z({value:o,children:s,className:t="",isSelected:r=!1,onChange:e,disabled:n=!1,hideInput:a=!1,description:c,name:f}){const h=`radio-${l.useId()}-${o}`,u=()=>{n||e==null||e(o)};return i.jsxs("div",{title:c,className:y.join("relative flex items-center",t,a&&`p-2 border-2 focus-within:border-dashed focus-within:${n?"border-current/50":"border-current/80"}`,a&&!r&&`border-transparent ${n?"":"not-focus-within:hover:border-border/60"}`,a&&r&&"border-border",n&&"opacity-60 cursor-not-allowed"),style:{gap:"0.5em"},children:[!a&&i.jsx(_,{itemId:h,name:f||"",checked:r,onChange:u,disabled:n,className:y.join(a&&"")}),i.jsx("div",{id:a?h:void 0,tabIndex:a?-1:void 0,role:a?"radio":void 0,onClick:a?u:void 0,"aria-checked":a?r?"true":"false":void 0,"aria-disabled":a?n:void 0,"aria-description":a?c||`Radio button for ${f}`:void 0,"aria-labelledby":a?`${h}-label`:void 0,className:y.join(a&&"size-full",typeof s=="object"&&"grow focus:outline-none"),children:i.jsx("label",{id:`${h}-label`,onClick:a?void 0:u,className:y.join(n&&"cursor-not-allowed",!n&&"cursor-pointer"),children:s})})]})}function he(o,s){const[t,r]=l.useState(s),[e,n]=l.useState(-1),[a,c]=l.useState(!1),f=l.useCallback((m,b)=>{var w;const g=m[b];g.hasAttribute("disabled")||g.getAttribute("aria-disabled")==="true"||((w=m[b])==null||w.click(),n(b))},[]),d=l.useCallback((m,b)=>{var x;if(m.preventDefault(),a||!b.length)return;const g=s!==-1?s:0;(x=b[g])==null||x.focus(),r(g),s!==-1&&f(b,g)},[s,a,f]),h=l.useCallback(m=>{var w;if(!m.shiftKey)return;m.preventDefault();const b=Array.from(document.querySelectorAll('a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')).filter(p=>!p.hasAttribute("disabled")&&p.tabIndex>=0),g=b.findIndex(p=>p.id===o),x=g>0?g-1:b.length-1;(w=b[x])==null||w.focus()},[o]),u=l.useCallback((m,b)=>{var j;if(!b.length)return;const g=m.target;if(!b.some(C=>C.id===g.id))return;const w=t!==-1?t:0;let p=w;switch(m.key){case"ArrowUp":case"ArrowLeft":m.preventDefault(),p=w>0?w-1:b.length-1;break;case"ArrowDown":case"ArrowRight":m.preventDefault(),p=(w+1)%b.length;break;case" ":m.preventDefault(),f(b,w);return;case"Tab":h(m);return;default:return}(j=b[p])==null||j.focus(),r(p),e!==-1&&f(b,p)},[t,e,h,f]),v=l.useCallback(()=>{const m=document.querySelector(`[id="${o}"][role="radiogroup"]`);return m?Array.from(m.querySelectorAll('[role="radio"]')):[]},[o]);l.useEffect(()=>{const m=document.querySelector(`[id="${o}"][role="radiogroup"]`);if(!m)return;const b=v(),g=j=>d(j,b),x=j=>u(j,b),w=()=>c(!0),p=()=>c(!1);return document.addEventListener("keydown",x),m.addEventListener("focus",g),m.addEventListener("mousedown",w),document.addEventListener("mouseup",p),()=>{document.removeEventListener("keydown",x),m.removeEventListener("focus",g),m.removeEventListener("mousedown",w),document.removeEventListener("mouseup",p)}},[o,v,d,u])}function xe({options:o=[],value:s,onChange:t,id:r,children:e,className:n="",childrenClassName:a="",hideInputs:c=!1}){const f=l.useId(),d=r||`radio-group-${f}`;he(d,o.findIndex(u=>u===s));const h=l.useMemo(()=>o.reduce((u,v)=>(typeof v=="string"?u.some(m=>m.value===v)||u.push({label:v,value:v}):u.push(v),u),[]),[o]);return i.jsxs("div",{id:d,role:"radiogroup",tabIndex:0,className:y.join(n,"focus:outline-none"),children:[h.length>0&&h.map((u,v)=>i.jsx(z,{value:u.value,isSelected:s===u.value,onChange:t,name:d,disabled:u.disabled,description:u.description,hideInput:c,className:a,children:u.label},`${u.value}-${v}`)),h.length===0&&e&&l.Children.map(e,u=>l.isValidElement(u)&&u.type===z?i.jsx(z,{...u.props,className:y.join(a,u.props.className),hideInput:u.props.hideInput||c,isSelected:s===u.props.value,onChange:t,name:d,children:u.props.children}):null)]})}const pe={thin:{horizontal:"h-px",vertical:"w-px"},medium:{horizontal:"h-0.5",vertical:"w-0.5"},thick:{horizontal:"h-1",vertical:"w-1"},"extra-thick":{horizontal:"h-2",vertical:"w-2"}},ge={horizontal:"w-full",vertical:"min-h-4 h-full"};function ve({orientation:o="horizontal",decorative:s=!1,thickness:t="thin",className:r,...e}){const n=y.join("shrink-0 bg-border",ge[o],pe[t][o],r);return i.jsx("div",{...e,className:n,role:s?"presentation":"separator","aria-orientation":s?void 0:o,"aria-hidden":s,"data-orientation":o,"data-thickness":t})}function we({children:o,ref:s,...t}){if(l.isValidElement(o)){let r={...t};return o.props&&(r={...r,...o.props}),l.cloneElement(o,{...r,ref:e=>{typeof s=="function"?s(e):s&&(s.current=e)}})}return l.createElement("div",{...t,ref:s},o)}function ye({elementId:o,maxLength:s}){const[t,r]=l.useState(0);return l.useEffect(()=>{const e=document.getElementById(o);if(!e)return;const n=()=>{const a=e.value.length;r(a);const c=a>=s;e.setAttribute("aria-describedby",`${o}-character-count`),e.setAttribute("aria-invalid",c?"true":"false"),c?e.setAttribute("data-error","true"):e.removeAttribute("data-error")};return n(),e.addEventListener("input",n),e.setAttribute("maxlength",String(s)),()=>{e.removeEventListener("input",n),e.removeAttribute("maxlength"),e.removeAttribute("aria-describedby"),e.removeAttribute("aria-invalid"),e.removeAttribute("data-error")}},[o,s]),i.jsx("small",{className:y.join("mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-end",t>=s&&"text-destructive",t<s&&"text-current"),role:"status",children:i.jsxs("span",{id:`${o}-character-count`,children:[t," / ",s," characters"]})})}function je(o,s){l.useEffect(()=>{const t=document.getElementById(o);if(!t)return;if(!s){t.style.height="auto";return}const r=()=>{t.style.height="auto",t.style.height=`${t.scrollHeight}px`};return r(),t.addEventListener("input",r),t.addEventListener("resize",r),window.addEventListener("resize",r),()=>{t.removeEventListener("input",r),t.removeEventListener("resize",r),window.removeEventListener("resize",r)}},[o,s])}const Ee={base:"","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",outline:"border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success"},Ne={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"px-3 rounded-full"},M={variant:"outline",rounded:"none"};function Ce({variant:o=M.variant,rounded:s,displayOnlyMode:t=!1,errorMessage:r,successMessage:e,hideResizeHandle:n=!1,autoExpand:a=!1,characterLimit:c=0,className:f,...d}){const h=l.useId();je(h,a||t);let u=s;o==="outline"&&!s&&(u="md"),u=u||M.rounded;let v=n;(t||o==="left-line"&&!n)&&(v=!0);const b=y.join("appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all",!t&&Ee[o],!t&&Ne[u],!t&&"px-2 py-1",t&&"pointer-events-none",v&&"no-resize-handle",f);return i.jsxs("div",{className:y.join("-space-y-1.5",t&&"cursor-text"),children:[i.jsx("textarea",{...d,id:h,"aria-disabled":d.disabled,readOnly:t,"aria-readonly":t||d["aria-readonly"],style:{resize:a?"none":void 0},className:b}),c>0&&i.jsx(ye,{elementId:h,maxLength:c}),!t&&i.jsx(L,{elementId:h,type:"error",message:r}),!t&&i.jsx(L,{elementId:h,type:"success",message:e})]})}const Ie={sm:{container:"h-5 min-w-9 w-9",thumb:"h-4 w-4",translate:"translate-x-4"},md:{container:"h-6 min-w-11 w-11",thumb:"h-5 w-5",translate:"translate-x-5"},lg:{container:"h-7 min-w-13 w-13",thumb:"h-6 w-6",translate:"translate-x-6"}},Ae={default:{unchecked:"bg-muted",checked:"bg-primary"},success:{unchecked:"bg-muted",checked:"bg-success"},destructive:{unchecked:"bg-muted",checked:"bg-destructive"}},W={variant:"default",size:"md"};function ke({ref:o,id:s,size:t=W.size,variant:r=W.variant,checked:e,onCheckedChange:n,disabled:a=!1,className:c,thumbClassName:f,backgroundClassNames:d,...h}){const u=l.useId(),v=l.useMemo(()=>s||`toggle-${u}`,[s,u]),[m,b]=l.useState(e);l.useEffect(()=>{b(e)},[e]);const g=()=>{if(!a){const E=!m;e===void 0&&b(E),n==null||n(E)}},x=E=>{(E.key===" "||E.key==="Enter")&&(E.preventDefault(),g())},w=Ie[t],p=Ae[r],j=y.join("relative inline-flex items-center rounded-full transition-all duration-200 ease-in-out","focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",w.container,m?(d==null?void 0:d.checked)||p.checked:(d==null?void 0:d.unchecked)||p.unchecked,a&&"opacity-50 cursor-not-allowed",!a&&"cursor-pointer",c),C=y.join("absolute left-0.5 top-1/2 -translate-y-1/2 rounded-full bg-white shadow-sm transition-transform duration-200 ease-in-out",w.thumb,m&&w.translate,f);return i.jsxs("button",{ref:o,id:v,type:"button",role:"switch",tabIndex:0,"aria-checked":m,"aria-disabled":a,disabled:a,onClick:g,onKeyDown:x,className:j,...h,children:[i.jsx("span",{className:C}),i.jsx("span",{className:"sr-only",children:m?"Enabled":"Disabled"})]})}const $=8,D=4,N=6;function Se(o){return{calculatePosition:l.useCallback((t,r)=>{const e=t.getBoundingClientRect(),n=r.getBoundingClientRect(),a={width:window.innerWidth,height:window.innerHeight},c=(v,m,b,g)=>v<0||m<0||v+b>a.width||m+g>a.height,f={top:{x:e.left+e.width/2-n.width/2,y:e.top-n.height-D,arrow:{x:n.width/2-N,y:n.height}},bottom:{x:e.left+e.width/2-n.width/2,y:e.bottom+D,arrow:{x:n.width/2-N,y:-6}},left:{x:e.left-n.width-D,y:e.top+e.height/2-n.height/2,arrow:{x:n.width,y:n.height/2-N}},right:{x:e.right+D,y:e.top+e.height/2-n.height/2,arrow:{x:-6,y:n.height/2-N}}};let d=o,h=f[o];if(c(h.x,h.y,n.width,n.height)){const v={top:"bottom",bottom:"top",left:"right",right:"left"},m=f[v[o]];if(!c(m.x,m.y,n.width,n.height))d=v[o],h=m;else{const b=["top","bottom","left","right"].filter(g=>g!==o&&g!==v[o]);for(const g of b){const x=f[g];if(!c(x.x,x.y,n.width,n.height)){d=g,h=x;break}}}}h.x=Math.max($,Math.min(h.x,a.width-n.width-$)),h.y=Math.max($,Math.min(h.y,a.height-n.height-$));const u={x:e.left+e.width/2,y:e.top+e.height/2};return d==="top"||d==="bottom"?h.arrow.x=Math.max(N,Math.min(u.x-h.x-N,n.width-N*2)):h.arrow.y=Math.max(N,Math.min(u.y-h.y-N,n.height-N*2)),{...h,placement:d}},[o])}}function Te(o,s,t){const r=l.useRef(null),e=l.useRef(null),n=l.useCallback(()=>{if(!r.current||!e.current)return;const a=o(r.current,e.current);t(a)},[o,t]);return l.useEffect(()=>{if(!s)return;const a=()=>n();return window.addEventListener("resize",a),()=>{window.removeEventListener("resize",a)}},[s,n]),{triggerRef:r,tooltipRef:e,updatePosition:n}}function $e(o,s,t,r,e,n,a,c,f){const d=l.useRef(null),h=l.useCallback(()=>{o||(d.current&&clearTimeout(d.current),d.current=window.setTimeout(()=>{t(!0),requestAnimationFrame(()=>{e(),r(!0)})},s))},[o,s,t,e,r]),u=l.useCallback((v=!1)=>{if(d.current&&clearTimeout(d.current),v){r(!1),setTimeout(()=>t(!1),150);return}d.current=window.setTimeout(()=>{r(!1),setTimeout(()=>t(!1),150)},100)},[r,t]);return l.useEffect(()=>{!n&&!a&&!c&&f&&u()},[n,a,c,f,u]),l.useEffect(()=>()=>{d.current&&clearTimeout(d.current)},[]),{showTooltip:h,hideTooltip:u,timeoutRef:d}}function De({id:o,children:s,message:t,placement:r="top",disabled:e=!1,delay:n=200,className:a}){const[c,f]=l.useState(!1),[d,h]=l.useState(!1),[u,v]=l.useState(null),[m,b]=l.useState(!1),[g,x]=l.useState(!1),[w,p]=l.useState(!1),{calculatePosition:j}=Se(r),{triggerRef:C,tooltipRef:E,updatePosition:k}=Te(j,d,v),{showTooltip:S,hideTooltip:T,timeoutRef:H}=$e(e,n,h,f,k,m,g,w,c),Q=l.useId(),K=o??Q;return i.jsxs(i.Fragment,{children:[l.cloneElement(s,{ref:B=>{C.current=B},onMouseEnter:()=>{b(!0),S()},onMouseLeave:()=>{b(!1)},onFocus:()=>{p(!0),S()},onBlur:()=>{p(!1),T(!0)},onKeyDown:B=>{B.key==="Escape"&&T(!0)},"aria-describedby":e?void 0:K}),d&&V.createPortal(i.jsx("div",{ref:E,id:K,role:"tooltip",className:y.join("fixed z-50 px-2 py-1 text-sm rounded shadow-lg bg-popover pointer-events-auto transition-all duration-150 ease-out",c?"opacity-100":"opacity-0",a),style:u?{left:u.x,top:u.y}:{opacity:0},onMouseEnter:()=>{x(!0),H.current&&clearTimeout(H.current)},onMouseLeave:()=>{x(!1)},children:t}),document.body)]})}exports.ActionModal=I.ActionModal;exports.Toast=I.Toast;exports.Accordion=Z;exports.AccordionItem=R;exports.Button=X;exports.ButtonLoadingDots=U;exports.Checkbox=ee;exports.Clickable=te;exports.Input=oe;exports.Label=se;exports.Modal=ue;exports.Panel=be;exports.RadioGroup=xe;exports.RadioGroupItem=z;exports.RadioInput=_;exports.Separator=ve;exports.Slot=we;exports.Textarea=Ce;exports.Toggle=ke;exports.Tooltip=De;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),l=require("react"),y=require("./utils.cjs.js"),A=require("./QuestionMarkCircled-D5cHmQp1.cjs"),I=require("./Toast-BZMBGn3W.cjs"),F=require("./X-CgjeP2OI.cjs"),V=require("react-dom");function D({id:n,title:o,content:t,children:r,className:e="",disabled:s=!1,isOpen:a=!1,onToggle:c,triggerClassName:f="",bodyClassName:d=""}){const h=l.useId(),u=n||`accordion-item-${h}`,v=`${u}-header`,m=`${u}-panel`,b=()=>{!s&&c&&c()},g=x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),b())};return i.jsxs("div",{className:y.join("border-b border-gray-200",s&&"opacity-60 cursor-not-allowed",e),children:[i.jsxs("button",{id:v,type:"button",className:y.join("w-full text-left py-3 px-4 flex justify-between items-center focus:outline focus:outline-secondary",s?"cursor-not-allowed":"hover:bg-gray-50/10 cursor-pointer",f),"aria-expanded":a,"aria-controls":m,disabled:s,onClick:b,onKeyDown:g,children:[i.jsx("span",{children:o}),i.jsx("span",{className:y.join("transform transition-transform duration-300 ease-linear",a?"rotate-180":"rotate-0"),"aria-hidden":"true",children:i.jsx(A.ChevronDown,{size:18})})]}),i.jsx("div",{id:m,role:"region","aria-labelledby":v,className:y.join("transition-all duration-300 ease-linear px-4",a?"max-h-96 opacity-100 overflow-auto py-3":"max-h-0 opacity-0 overflow-hidden",d),children:a&&(r||t)})]})}function J({id:n,items:o=[],children:t,className:r="",itemClassName:e="",allowMultiple:s=!1,defaultOpenItems:a=[],triggersClassName:c="",bodiesClassName:f=""}){const d=l.useId(),h=n||`accordion-group-${d}`,[u,v]=l.useState(new Set(a)),m=x=>{v(w=>{const p=new Set(w);return p.has(x)?p.delete(x):(s||p.clear(),p.add(x)),p})},b=x=>`${d}-item-${x}`,g=x=>u.has(x);return i.jsxs("div",{id:h,className:r,children:[o.length>0&&o.map((x,w)=>{const p=x.id||b(w);return i.jsx(D,{id:p,title:x.title,content:x.content,disabled:x.disabled,isOpen:g(p),onToggle:()=>m(p),className:e,triggerClassName:c,bodyClassName:f},p)}),o.length===0&&t&&l.Children.map(t,(x,w)=>{if(l.isValidElement(x)&&x.type===D){const p=x.props.id||b(w);return l.createElement(D,{...x.props,key:p,id:p,className:y.join(e,x.props.className),isOpen:g(p),onToggle:()=>m(p),triggerClassName:y.join(c,x.props.triggerClassName),bodyClassName:y.join(f,x.props.bodyClassName)})}return null})]})}function U(){const[n,o]=l.useState(0);return l.useEffect(()=>{const t=setInterval(()=>{o(r=>(r+1)%3)},500);return()=>clearInterval(t)},[]),i.jsx("div",{className:"absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle",children:[0,1,2].map(t=>i.jsx("div",{className:y.join("rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current",n===t&&"transform -translate-y-1")},t))})}const Y={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"},P={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"},O={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"},q={variant:"primary",size:"md",rounded:"md"};function X({variant:n=q.variant,size:o,rounded:t=q.rounded,loading:r,linkTo:e,linkProps:s,type:a="button",className:c,...f}){let d;n==="link"&&!o?d="fitted":d=o||q.size;const u=y.join("appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all",Y[n],P[d],O[t],r&&"relative pointer-events-none",e&&"relative",c);return i.jsxs("button",{...f,role:e?"link":f.role,"aria-label":f["aria-label"]||(s==null?void 0:s["aria-label"]),"aria-description":f["aria-description"]||(s==null?void 0:s["aria-description"]),"aria-disabled":f.disabled||r,"aria-busy":r,type:a,className:u,children:[r&&i.jsx(U,{}),i.jsx("span",{className:y.join(r&&"invisible"),children:f.children}),e&&!f.disabled&&i.jsx("a",{...s,"aria-hidden":!0,href:e,rel:(s==null?void 0:s.rel)||"noreferrer",className:"absolute inset-0"})]})}function ee(n){const[o,t]=l.useState(""),r=l.useCallback(e=>{let s=e,a="";for(;s&&!a;){const c=window.getComputedStyle(s).backgroundColor;c&&c!=="transparent"&&c!=="rgba(0, 0, 0, 0)"&&(a=c),s=s.parentElement}return a||"transparent"},[]);return l.useEffect(()=>{const e=document.getElementById(n);if(e){const s=r(e.parentElement);t(s)}},[n,r]),o}function te({ref:n,id:o,size:t=20,color:r,filled:e=!1,rounded:s=!0,checked:a=!1,onCheckedChange:c,disabled:f,className:d="",...h}){const u=l.useId(),v=l.useMemo(()=>o||`checkbox-${u}`,[o,u]),m=ee(v),[b,g]=l.useState(a);l.useEffect(()=>{g(a)},[a]);const x=()=>{f||(g(!b),c==null||c(!b))},w=j=>{j.key===" "&&(j.preventDefault(),x())},p=y.join("flex items-center justify-center border outline outline-transparent focus:outline-current focus:outline-offset-2",s&&"rounded",f&&"opacity-40 cursor-not-allowed",!f&&"cursor-pointer",d);return i.jsx("button",{id:v,type:"button",ref:n,tabIndex:0,role:"checkbox",onClick:x,"aria-checked":b,"aria-disabled":f,onKeyDownCapture:w,style:{width:t,height:t,color:r,backgroundColor:b&&e?"currentcolor":"transparent"},className:p,...h,children:b&&i.jsx(A.Check,{size:t,color:e?m:void 0})})}function re({children:n,className:o,linkTo:t,linkProps:r,onButtonClick:e,buttonProps:s,...a}){return t&&e&&console.warn('Clickable: Both "linkTo" and "onButtonClick" props are provided. Only "linkTo" will be used.'),i.jsxs("div",{className:y.join("relative w-fit",o),...a,children:[n,t&&i.jsx("a",{...r,rel:(r==null?void 0:r.rel)||"noreferrer",href:t,className:y.join("absolute inset-0",r==null?void 0:r.className)}),!t&&e&&i.jsx("button",{...s,type:"button",onClick:e,className:y.join("absolute inset-0 cursor-pointer",s==null?void 0:s.className)})]})}function L({elementId:n,type:o,message:t}){return l.useEffect(()=>{const r=document.getElementById(n);if(r){if(!t&&o==="error"){r.removeAttribute("data-error");return}if(!t&&o==="success"){r.removeAttribute("data-success");return}return r.setAttribute("aria-describedby",`${n}-${o}-message`),r.setAttribute("aria-invalid",o==="error"?"true":"false"),o==="error"&&r.setAttribute("data-error","true"),o==="success"&&r.setAttribute("data-success","true"),()=>{r.removeAttribute("aria-describedby"),r.removeAttribute("aria-invalid"),r.removeAttribute("data-error"),r.removeAttribute("data-success")}}},[n,o,t]),t?i.jsxs("small",{className:y.join("mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-start",o==="error"&&"text-destructive",o==="success"&&"text-success"),role:"status",children:[o==="error"?i.jsx(F.ExclamationTriangle,{}):i.jsx(A.CheckCircled,{}),i.jsx("span",{id:`${n}-${o}-message`,children:t})]}):null}const ne={base:"",default:"ring ring-transparent focus:ring-primary-foreground not-disabled:data-error:ring-destructive not-disabled:data-success:ring-success",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",outline:"border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success"},se={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"px-3 rounded-full"},G={variant:"default",rounded:"none"};function oe({variant:n=G.variant,rounded:o,displayOnlyMode:t=!1,errorMessage:r,successMessage:e,type:s="text",className:a,...c}){const f=l.useId(),[d,h]=l.useState(!1);let u=o;n==="outline"&&!o&&(u="md"),u=u||G.rounded;const b=y.join("appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all","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",!t&&ne[n],!t&&se[u],s==="password"&&"pr-10",!t&&"px-2 py-1",t&&"pointer-events-none",a);return i.jsxs("div",{className:y.join(t&&"cursor-text"),style:{height:c.height,width:c.width},children:[i.jsxs("div",{className:y.join(s==="password"&&"relative"),children:[i.jsx("input",{...c,id:f,type:s==="password"&&d?"text":s,"aria-disabled":c.disabled,readOnly:t,"aria-readonly":t||c["aria-readonly"],"data-error":r?!0:void 0,"data-success":e?!0:void 0,className:b}),s==="password"&&i.jsx("button",{onClick:()=>h(!d),className:"absolute inset-y-0 right-0 px-2 hover:cursor-pointer","aria-label":"Toggle password visibility","data-state":d?"visible":"hidden",children:d?i.jsx(A.EyeClosed$1,{size:20}):i.jsx(A.EyeClosed,{size:20})})]}),!t&&i.jsx(L,{elementId:f,type:"error",message:r}),!t&&i.jsx(L,{elementId:f,type:"success",message:e})]})}function ae({display:n="inline",width:o="fit-content",className:t="",required:r,helpMessage:e,suffix:s,htmlFor:a,children:c,...f}){const d=l.useId(),h=y.join("font-medium",n,t),u=e?`${a??d}-help`:void 0;return i.jsxs("div",{style:{display:n==="inline"?"inline-flex":"flex",width:o},className:"relative",children:[i.jsxs("label",{className:h,htmlFor:a,...f,children:[c,r&&i.jsx("span",{className:"text-red-500 font-medium ml-1","aria-label":"required",children:"*"})]}),e&&i.jsx("span",{className:"text-gray-500 ml-1 size-fit -translate-y-1/3","aria-describedby":u,"aria-label":"Help information",title:e,children:i.jsx(A.QuestionMarkCircled,{})}),e&&i.jsx("div",{id:u,className:"sr-only",children:e}),s&&i.jsx("span",{className:"ml-1",children:s})]})}function ie(n){const[o,t]=l.useState(!1),[r,e]=l.useState(!1);return l.useEffect(()=>{n?(e(!0),setTimeout(()=>t(!0),10)):(t(!1),setTimeout(()=>e(!1),150))},[n]),{show:o,shouldRender:r}}function le(n,o){l.useEffect(()=>{const t=r=>{r.key==="Escape"&&n&&o()};return document.addEventListener("keydown",t),n&&(document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",t),document.body.style.overflow="auto"}},[n,o])}function ue(n,o){const t=l.useRef(null),r=l.useCallback(()=>{const e=document.getElementById(n);if(!e)return;const s=e.querySelectorAll('[data-modal-action="true"]');if(s.length>0){s[0].focus();return}const a=e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(a.length>0){const c=Array.from(a).filter(f=>!(f instanceof HTMLButtonElement&&f.getAttribute("data-modal-close-button")==="true"));if(c.length>0){c[0].focus();return}a[0].focus();return}e.focus()},[n]);l.useEffect(()=>(o&&(t.current=document.activeElement,r()),()=>{document.body.style.overflow="auto",t.current instanceof HTMLElement&&t.current.focus()}),[o,r])}function ce({id:n,isOpen:o,onClose:t,title:r,children:e,contentOnly:s=!1,className:a,overlayClassName:c,hideCloseButton:f=!1,actions:d=[],disableCloseOnOverlayClick:h=!1,ariaLabelledBy:u,ariaDescribedBy:v}){const m=l.useId(),b=n||`modal-${m}`,g=n?`${n}-title`:`modal-title-${m}`,{show:x,shouldRender:w}=ie(o);if(ue(b,w),le(w,t),!w)return null;const p=()=>r?l.isValidElement(r)?i.jsx("div",{className:"mb-4",children:r}):i.jsx("h2",{className:"mb-4 text-xl font-semibold",id:g,children:r}):null,j=()=>d.length===0?null:i.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:d.map((C,E)=>{const{label:k,className:S,...T}=C;return i.jsx(X,{className:S,type:"button",...T,"data-modal-action":"true",children:k},E)})});return i.jsx(i.Fragment,{children:V.createPortal(i.jsx("div",{"aria-labelledby":u??r?g:void 0,"aria-describedby":v,role:"dialog","aria-modal":"true",className:"fixed inset-0 z-[100] overflow-y-auto",children:i.jsxs("div",{className:"flex min-h-screen items-center justify-center p-4",children:[i.jsx("div",{className:I.n("fixed inset-0 bg-black/20 transition-all",c),onClick:()=>{h||t()}}),s&&i.jsx("div",{className:I.n("relative w-fit",a),children:e}),!s&&i.jsxs("div",{id:b,tabIndex:-1,className:I.n("relative w-full max-w-xl transform rounded-lg shadow-xl bg-popover transition-all p-6 focus:ring ease-in duration-75",x?"opacity-100 scale-100":"opacity-0 scale-90",a),children:[!f&&i.jsx("button",{type:"button",onClick:t,"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:i.jsx(F.X,{size:18})}),p(),e,j()]})]})}),document.body)})}function de(n){const[o,t]=l.useState(!1),[r,e]=l.useState(!1);return l.useEffect(()=>{n?(e(!0),setTimeout(()=>t(!0),10)):(t(!1),setTimeout(()=>e(!1),300))},[n]),{show:o,shouldRender:r}}function fe(n,o){l.useEffect(()=>{const t=r=>{r.key==="Escape"&&n&&o()};return document.addEventListener("keydown",t),n&&(document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",t),document.body.style.overflow="auto"}},[n,o])}function me(n,o){const t=l.useRef(null),r=l.useCallback(()=>{const e=document.getElementById(n);if(!e)return;const s=e.querySelectorAll('[data-panel-action="true"]');if(s.length>0){s[0].focus();return}const a=e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(a.length>0){const c=Array.from(a).filter(f=>!(f instanceof HTMLButtonElement&&f.getAttribute("data-panel-close-button")==="true"));if(c.length>0){c[0].focus();return}a[0].focus();return}e.focus()},[n]);l.useEffect(()=>(o&&(t.current=document.activeElement,r()),()=>{document.body.style.overflow="auto",t.current instanceof HTMLElement&&t.current.focus()}),[o,r])}const be={size:{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl",full:"w-full",screen:"w-screen"}};function he({ref:n,id:o,isOpen:t,onClose:r,title:e,children:s,footer:a,size:c="md",className:f,overlayClassName:d,hideCloseButton:h=!1,disableCloseOnOverlayClick:u=!1,ariaLabelledBy:v,ariaDescribedBy:m}){const b=l.useId(),g=o||`panel-${b}`,x=o?`${o}-title`:`panel-title-${b}`,{show:w,shouldRender:p}=de(t);if(me(g,p),fe(p,r),!p)return null;const j=()=>e?l.isValidElement(e)?i.jsx("div",{children:e}):i.jsx("h2",{className:"text-2xl font-semibold",id:x,children:e}):null,C=()=>{if(!a)return null;if(l.isValidElement(a)){const E=a,k=E.props.className||"";return l.cloneElement(E,{className:I.n("px-6 py-4",k)})}return i.jsx("div",{className:"px-6 py-4",children:a})};return i.jsx(i.Fragment,{children:V.createPortal(i.jsxs("div",{"aria-labelledby":v??e?x:void 0,"aria-describedby":m,role:"dialog","aria-modal":"true",className:"fixed inset-0 z-[100] overflow-hidden","data-panel-open":t,children:[i.jsx("div",{className:I.n("fixed inset-0 bg-black/40 transition-opacity duration-300",w?"opacity-100":"opacity-0",d),onClick:()=>{u||r()}}),i.jsx("div",{className:"fixed inset-y-0 right-0 flex max-w-full",children:i.jsx("div",{id:g,ref:n,tabIndex:-1,className:I.n("relative h-full transform shadow-xl bg-popover transition-transform duration-300 ease-in-out",c!=="screen"&&"border-l border-border",be.size[c],w?"translate-x-0":"translate-x-full",f),"data-panel-size":c,children:i.jsxs("div",{className:"flex h-full flex-col",children:[e&&i.jsx("div",{className:"px-6 pt-6",children:j()}),!h&&i.jsx("button",{type:"button",onClick:r,"data-panel-close-button":"true","aria-label":"Close panel",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",children:i.jsx(F.X,{size:18})}),i.jsx("div",{className:I.n("flex-1 overflow-y-auto px-6 pb-6",e?"pt-6":"pt-10"),children:s}),C()]})})})]}),document.body)})}function Q({itemId:n,checked:o,onChange:t,name:r,disabled:e=!1,className:s=""}){const a="relative inline-flex items-center justify-center rounded-full",c=()=>{e||t()},f=y.join(a,!o&&"hover:border-current/60",!e&&"border-current cursor-pointer",e&&"border-muted/60 cursor-not-allowed",s);return i.jsx("div",{id:n,role:"radio",tabIndex:-1,"aria-checked":o,"aria-disabled":e,"aria-description":`Radio button for ${r}`,"aria-labelledby":`${n}-label`,onClick:c,className:f,style:{width:"1em",height:"1em",padding:"0.1em",borderWidth:"0.06em"},children:o&&i.jsx("div",{className:y.join("size-full aspect-square rounded-full",e&&"bg-muted/60",!e&&"bg-current")})})}function R({value:n,children:o,className:t="",isSelected:r=!1,onChange:e,disabled:s=!1,hideInput:a=!1,description:c,name:f}){const h=`radio-${l.useId()}-${n}`,u=()=>{s||e==null||e(n)};return i.jsxs("div",{title:c,className:y.join("relative flex items-center",t,a&&`p-2 border-2 focus-within:border-dashed focus-within:${s?"border-current/50":"border-current/80"}`,a&&!r&&`border-transparent ${s?"":"not-focus-within:hover:border-border/60"}`,a&&r&&"border-border",s&&"opacity-60 cursor-not-allowed"),style:{gap:"0.5em"},children:[!a&&i.jsx(Q,{itemId:h,name:f||"",checked:r,onChange:u,disabled:s,className:y.join(a&&"")}),i.jsx("div",{id:a?h:void 0,tabIndex:a?-1:void 0,role:a?"radio":void 0,onClick:a?u:void 0,"aria-checked":a?r?"true":"false":void 0,"aria-disabled":a?s:void 0,"aria-description":a?c||`Radio button for ${f}`:void 0,"aria-labelledby":a?`${h}-label`:void 0,className:y.join(a&&"size-full",typeof o=="object"&&"grow focus:outline-none"),children:i.jsx("label",{id:`${h}-label`,onClick:a?void 0:u,className:y.join(s&&"cursor-not-allowed",!s&&"cursor-pointer"),children:o})})]})}function xe(n,o){const[t,r]=l.useState(o),[e,s]=l.useState(-1),[a,c]=l.useState(!1),f=l.useCallback((m,b)=>{var w;const g=m[b];g.hasAttribute("disabled")||g.getAttribute("aria-disabled")==="true"||((w=m[b])==null||w.click(),s(b))},[]),d=l.useCallback((m,b)=>{var x;if(m.preventDefault(),a||!b.length)return;const g=o!==-1?o:0;(x=b[g])==null||x.focus(),r(g),o!==-1&&f(b,g)},[o,a,f]),h=l.useCallback(m=>{var w;if(!m.shiftKey)return;m.preventDefault();const b=Array.from(document.querySelectorAll('a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')).filter(p=>!p.hasAttribute("disabled")&&p.tabIndex>=0),g=b.findIndex(p=>p.id===n),x=g>0?g-1:b.length-1;(w=b[x])==null||w.focus()},[n]),u=l.useCallback((m,b)=>{var j;if(!b.length)return;const g=m.target;if(!b.some(C=>C.id===g.id))return;const w=t!==-1?t:0;let p=w;switch(m.key){case"ArrowUp":case"ArrowLeft":m.preventDefault(),p=w>0?w-1:b.length-1;break;case"ArrowDown":case"ArrowRight":m.preventDefault(),p=(w+1)%b.length;break;case" ":m.preventDefault(),f(b,w);return;case"Tab":h(m);return;default:return}(j=b[p])==null||j.focus(),r(p),e!==-1&&f(b,p)},[t,e,h,f]),v=l.useCallback(()=>{const m=document.querySelector(`[id="${n}"][role="radiogroup"]`);return m?Array.from(m.querySelectorAll('[role="radio"]')):[]},[n]);l.useEffect(()=>{const m=document.querySelector(`[id="${n}"][role="radiogroup"]`);if(!m)return;const b=v(),g=j=>d(j,b),x=j=>u(j,b),w=()=>c(!0),p=()=>c(!1);return document.addEventListener("keydown",x),m.addEventListener("focus",g),m.addEventListener("mousedown",w),document.addEventListener("mouseup",p),()=>{document.removeEventListener("keydown",x),m.removeEventListener("focus",g),m.removeEventListener("mousedown",w),document.removeEventListener("mouseup",p)}},[n,v,d,u])}function pe({options:n=[],value:o,onChange:t,id:r,children:e,className:s="",childrenClassName:a="",hideInputs:c=!1}){const f=l.useId(),d=r||`radio-group-${f}`;xe(d,n.findIndex(u=>u===o));const h=l.useMemo(()=>n.reduce((u,v)=>(typeof v=="string"?u.some(m=>m.value===v)||u.push({label:v,value:v}):u.push(v),u),[]),[n]);return i.jsxs("div",{id:d,role:"radiogroup",tabIndex:0,className:y.join(s,"focus:outline-none"),children:[h.length>0&&h.map((u,v)=>i.jsx(R,{value:u.value,isSelected:o===u.value,onChange:t,name:d,disabled:u.disabled,description:u.description,hideInput:c,className:a,children:u.label},`${u.value}-${v}`)),h.length===0&&e&&l.Children.map(e,u=>l.isValidElement(u)&&u.type===R?i.jsx(R,{...u.props,className:y.join(a,u.props.className),hideInput:u.props.hideInput||c,isSelected:o===u.props.value,onChange:t,name:d,children:u.props.children}):null)]})}const ge={thin:{horizontal:"h-px",vertical:"w-px"},medium:{horizontal:"h-0.5",vertical:"w-0.5"},thick:{horizontal:"h-1",vertical:"w-1"},"extra-thick":{horizontal:"h-2",vertical:"w-2"}},ve={horizontal:"w-full",vertical:"min-h-4 h-full"};function ye({orientation:n="horizontal",decorative:o=!1,thickness:t="thin",className:r,...e}){const s=y.join("shrink-0 bg-border",ve[n],ge[t][n],r);return i.jsx("div",{...e,className:s,role:o?"presentation":"separator","aria-orientation":o?void 0:n,"aria-hidden":o,"data-orientation":n,"data-thickness":t})}const M={shape:{rectangle:"rounded-md min-h-1",circle:"rounded-full aspect-square min-h-1",text:"rounded-sm min-h-1 h-4"},lineSpacing:{xs:"space-y-1",sm:"space-y-2",md:"space-y-3",lg:"space-y-4",xl:"space-y-6"}};function we({shape:n="rectangle",lineSpacing:o="sm",className:t,lines:r=1,animate:e=!0,ref:s,...a}){const c=y.join("bg-muted/70",e&&"animate-pulse",M.shape[n],t);return r>1?i.jsx("div",{ref:s,className:M.lineSpacing[o],role:"presentation","aria-hidden":"true","data-testid":"skeleton-container","data-lines":r,"data-shape":n,"data-animate":e,...a,children:Array.from({length:r},(f,d)=>i.jsx("div",{className:y.join(c,d===r-1&&"w-3/4"),role:"presentation","aria-hidden":"true","data-testid":"skeleton-line","data-line-index":d},d))}):i.jsx("div",{ref:s,className:c,role:"presentation","aria-hidden":"true","data-testid":"skeleton","data-shape":n,"data-animate":e,...a})}function je({children:n,ref:o,...t}){if(l.isValidElement(n)){let r={...t};return n.props&&(r={...r,...n.props}),l.cloneElement(n,{...r,ref:e=>{typeof o=="function"?o(e):o&&(o.current=e)}})}return l.createElement("div",{...t,ref:o},n)}function Ee({elementId:n,maxLength:o}){const[t,r]=l.useState(0);return l.useEffect(()=>{const e=document.getElementById(n);if(!e)return;const s=()=>{const a=e.value.length;r(a);const c=a>=o;e.setAttribute("aria-describedby",`${n}-character-count`),e.setAttribute("aria-invalid",c?"true":"false"),c?e.setAttribute("data-error","true"):e.removeAttribute("data-error")};return s(),e.addEventListener("input",s),e.setAttribute("maxlength",String(o)),()=>{e.removeEventListener("input",s),e.removeAttribute("maxlength"),e.removeAttribute("aria-describedby"),e.removeAttribute("aria-invalid"),e.removeAttribute("data-error")}},[n,o]),i.jsx("small",{className:y.join("mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-end",t>=o&&"text-destructive",t<o&&"text-current"),role:"status",children:i.jsxs("span",{id:`${n}-character-count`,children:[t," / ",o," characters"]})})}function Ne(n,o){l.useEffect(()=>{const t=document.getElementById(n);if(!t)return;if(!o){t.style.height="auto";return}const r=()=>{t.style.height="auto",t.style.height=`${t.scrollHeight}px`};return r(),t.addEventListener("input",r),t.addEventListener("resize",r),window.addEventListener("resize",r),()=>{t.removeEventListener("input",r),t.removeEventListener("resize",r),window.removeEventListener("resize",r)}},[n,o])}const Ce={base:"","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",outline:"border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success"},Ie={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"px-3 rounded-full"},W={variant:"outline",rounded:"none"};function Ae({variant:n=W.variant,rounded:o,displayOnlyMode:t=!1,errorMessage:r,successMessage:e,hideResizeHandle:s=!1,autoExpand:a=!1,characterLimit:c=0,className:f,...d}){const h=l.useId();Ne(h,a||t);let u=o;n==="outline"&&!o&&(u="md"),u=u||W.rounded;let v=s;(t||n==="left-line"&&!s)&&(v=!0);const b=y.join("appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all",!t&&Ce[n],!t&&Ie[u],!t&&"px-2 py-1",t&&"pointer-events-none",v&&"no-resize-handle",f);return i.jsxs("div",{className:y.join("-space-y-1.5",t&&"cursor-text"),children:[i.jsx("textarea",{...d,id:h,"aria-disabled":d.disabled,readOnly:t,"aria-readonly":t||d["aria-readonly"],style:{resize:a?"none":void 0},className:b}),c>0&&i.jsx(Ee,{elementId:h,maxLength:c}),!t&&i.jsx(L,{elementId:h,type:"error",message:r}),!t&&i.jsx(L,{elementId:h,type:"success",message:e})]})}const ke={sm:{container:"h-5 min-w-9 w-9",thumb:"h-4 w-4",translate:"translate-x-4"},md:{container:"h-6 min-w-11 w-11",thumb:"h-5 w-5",translate:"translate-x-5"},lg:{container:"h-7 min-w-13 w-13",thumb:"h-6 w-6",translate:"translate-x-6"}},Se={default:{unchecked:"bg-muted",checked:"bg-primary"},success:{unchecked:"bg-muted",checked:"bg-success"},destructive:{unchecked:"bg-muted",checked:"bg-destructive"}},_={variant:"default",size:"md"};function Te({ref:n,id:o,size:t=_.size,variant:r=_.variant,checked:e,onCheckedChange:s,disabled:a=!1,className:c,thumbClassName:f,backgroundClassNames:d,...h}){const u=l.useId(),v=l.useMemo(()=>o||`toggle-${u}`,[o,u]),[m,b]=l.useState(e);l.useEffect(()=>{b(e)},[e]);const g=()=>{if(!a){const E=!m;e===void 0&&b(E),s==null||s(E)}},x=E=>{(E.key===" "||E.key==="Enter")&&(E.preventDefault(),g())},w=ke[t],p=Se[r],j=y.join("relative inline-flex items-center rounded-full transition-all duration-200 ease-in-out","focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",w.container,m?(d==null?void 0:d.checked)||p.checked:(d==null?void 0:d.unchecked)||p.unchecked,a&&"opacity-50 cursor-not-allowed",!a&&"cursor-pointer",c),C=y.join("absolute left-0.5 top-1/2 -translate-y-1/2 rounded-full bg-white shadow-sm transition-transform duration-200 ease-in-out",w.thumb,m&&w.translate,f);return i.jsxs("button",{ref:n,id:v,type:"button",role:"switch",tabIndex:0,"aria-checked":m,"aria-disabled":a,disabled:a,onClick:g,onKeyDown:x,className:j,...h,children:[i.jsx("span",{className:C}),i.jsx("span",{className:"sr-only",children:m?"Enabled":"Disabled"})]})}const $=8,z=4,N=6;function $e(n){return{calculatePosition:l.useCallback((t,r)=>{const e=t.getBoundingClientRect(),s=r.getBoundingClientRect(),a={width:window.innerWidth,height:window.innerHeight},c=(v,m,b,g)=>v<0||m<0||v+b>a.width||m+g>a.height,f={top:{x:e.left+e.width/2-s.width/2,y:e.top-s.height-z,arrow:{x:s.width/2-N,y:s.height}},bottom:{x:e.left+e.width/2-s.width/2,y:e.bottom+z,arrow:{x:s.width/2-N,y:-6}},left:{x:e.left-s.width-z,y:e.top+e.height/2-s.height/2,arrow:{x:s.width,y:s.height/2-N}},right:{x:e.right+z,y:e.top+e.height/2-s.height/2,arrow:{x:-6,y:s.height/2-N}}};let d=n,h=f[n];if(c(h.x,h.y,s.width,s.height)){const v={top:"bottom",bottom:"top",left:"right",right:"left"},m=f[v[n]];if(!c(m.x,m.y,s.width,s.height))d=v[n],h=m;else{const b=["top","bottom","left","right"].filter(g=>g!==n&&g!==v[n]);for(const g of b){const x=f[g];if(!c(x.x,x.y,s.width,s.height)){d=g,h=x;break}}}}h.x=Math.max($,Math.min(h.x,a.width-s.width-$)),h.y=Math.max($,Math.min(h.y,a.height-s.height-$));const u={x:e.left+e.width/2,y:e.top+e.height/2};return d==="top"||d==="bottom"?h.arrow.x=Math.max(N,Math.min(u.x-h.x-N,s.width-N*2)):h.arrow.y=Math.max(N,Math.min(u.y-h.y-N,s.height-N*2)),{...h,placement:d}},[n])}}function ze(n,o,t){const r=l.useRef(null),e=l.useRef(null),s=l.useCallback(()=>{if(!r.current||!e.current)return;const a=n(r.current,e.current);t(a)},[n,t]);return l.useEffect(()=>{if(!o)return;const a=()=>s();return window.addEventListener("resize",a),()=>{window.removeEventListener("resize",a)}},[o,s]),{triggerRef:r,tooltipRef:e,updatePosition:s}}function De(n,o,t,r,e,s,a,c,f){const d=l.useRef(null),h=l.useCallback(()=>{n||(d.current&&clearTimeout(d.current),d.current=window.setTimeout(()=>{t(!0),requestAnimationFrame(()=>{e(),r(!0)})},o))},[n,o,t,e,r]),u=l.useCallback((v=!1)=>{if(d.current&&clearTimeout(d.current),v){r(!1),setTimeout(()=>t(!1),150);return}d.current=window.setTimeout(()=>{r(!1),setTimeout(()=>t(!1),150)},100)},[r,t]);return l.useEffect(()=>{!s&&!a&&!c&&f&&u()},[s,a,c,f,u]),l.useEffect(()=>()=>{d.current&&clearTimeout(d.current)},[]),{showTooltip:h,hideTooltip:u,timeoutRef:d}}function Re({id:n,children:o,message:t,placement:r="top",disabled:e=!1,delay:s=200,className:a}){const[c,f]=l.useState(!1),[d,h]=l.useState(!1),[u,v]=l.useState(null),[m,b]=l.useState(!1),[g,x]=l.useState(!1),[w,p]=l.useState(!1),{calculatePosition:j}=$e(r),{triggerRef:C,tooltipRef:E,updatePosition:k}=ze(j,d,v),{showTooltip:S,hideTooltip:T,timeoutRef:H}=De(e,s,h,f,k,m,g,w,c),Z=l.useId(),K=n??Z;return i.jsxs(i.Fragment,{children:[l.cloneElement(o,{ref:B=>{C.current=B},onMouseEnter:()=>{b(!0),S()},onMouseLeave:()=>{b(!1)},onFocus:()=>{p(!0),S()},onBlur:()=>{p(!1),T(!0)},onKeyDown:B=>{B.key==="Escape"&&T(!0)},"aria-describedby":e?void 0:K}),d&&V.createPortal(i.jsx("div",{ref:E,id:K,role:"tooltip",className:y.join("fixed z-50 px-2 py-1 text-sm rounded shadow-lg bg-popover pointer-events-auto transition-all duration-150 ease-out",c?"opacity-100":"opacity-0",a),style:u?{left:u.x,top:u.y}:{opacity:0},onMouseEnter:()=>{x(!0),H.current&&clearTimeout(H.current)},onMouseLeave:()=>{x(!1)},children:t}),document.body)]})}exports.ActionModal=I.ActionModal;exports.Toast=I.Toast;exports.Accordion=J;exports.AccordionItem=D;exports.Button=X;exports.ButtonLoadingDots=U;exports.Checkbox=te;exports.Clickable=re;exports.Input=oe;exports.Label=ae;exports.Modal=ce;exports.Panel=he;exports.RadioGroup=pe;exports.RadioGroupItem=R;exports.RadioInput=Q;exports.Separator=ye;exports.Skeleton=we;exports.Slot=je;exports.Textarea=Ae;exports.Toggle=Te;exports.Tooltip=Re;
2
2
  //# sourceMappingURL=components.cjs.js.map