rr-react-ui-library 0.0.7 → 0.0.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.
package/dist/index.cjs CHANGED
@@ -1,23 +1,18 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),y=require("react"),Gr=require("react-dom"),Xe=require("react-router"),le={ExtraSmall:"xs",Small:"small",Medium:"medium",Large:"large"},re={None:"none",Small:"sm",Medium:"md",Large:"lg",Full:"full"},Ws={Default:"default",Hover:"hover",Active:"active",Disabled:"disabled"},X={Default:"default",Primary:"primary",Secondary:"secondary",Success:"success",Warning:"warning",Info:"info",Danger:"danger"},J={Top:"top",Right:"right",Bottom:"bottom",Left:"left"},Js={default:"bg-slate-100 text-slate-800 dark:bg-slate-800 dark:text-slate-100",primary:"bg-violet-100 text-violet-800 dark:bg-violet-900/70 dark:text-violet-100",secondary:"bg-slate-200 text-slate-900 dark:bg-slate-700 dark:text-slate-50",success:"bg-emerald-100 text-emerald-800 dark:bg-emerald-900/70 dark:text-emerald-100",warning:"bg-amber-100 text-amber-800 dark:bg-amber-900/70 dark:text-amber-100",danger:"bg-red-100 text-red-800 dark:bg-red-900/70 dark:text-red-100",info:"bg-sky-100 text-sky-800 dark:bg-sky-900/70 dark:text-sky-100"},Xs={sm:"text-xs px-2 py-0.5",md:"text-sm px-2.5 py-1",lg:"text-base px-3 py-1.5"},Kr=({children:t,size:e="md",dot:r=!1,className:s="",variant:a=X.Default,rounded:n=re.Medium})=>{const o={sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",none:"rounded-none",full:"rounded-full"};return l.jsxs("span",{className:["badge inline-flex items-center font-medium",Js[a],Xs[e],o[n],s].join(" "),children:[r&&l.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-current mr-1.5"}),t]})},Gs=({children:t,cols:e=1})=>{const r=`grid-cols-${e}`;return l.jsx("div",{className:`grid ${r} gap-3 mb-3`,children:t})},Ks={xs:"h-3 w-3 border-2",sm:"h-4 w-4 border-2",md:"h-5 w-5 border-[3px]",lg:"h-6 w-6 border-4"},Ys={default:"text-slate-200",info:"text-sky-600 dark:text-sky-300",danger:"text-red-600 dark:text-red-300",warning:"text-amber-600 dark:text-amber-300",primary:"text-violet-600 dark:text-violet-300",secondary:"text-slate-700 dark:text-slate-200",success:"text-emerald-600 dark:text-emerald-300"},xt=({className:t,size:e="sm",label:r="Loading",showLabel:s=!1,variant:a=X.Primary})=>l.jsxs("span",{className:["inline-flex items-center gap-2 text-current",t].filter(Boolean).join(" "),role:"status","aria-live":"polite","aria-label":r,children:[l.jsx("span",{className:["inline-block rounded-full border-solid border-current border-t-transparent animate-spin",Ks[e],Ys[a]].join(" ")}),s?l.jsx("span",{className:"text-xs font-medium leading-none text-current",children:r}):l.jsx("span",{className:"sr-only",children:r})]}),de=({icon:t,label:e,tooltip:r,children:s,ariaLabel:a,className:n,loadingLabel:o,outline:i=!1,loading:u=!1,size:c=le.Medium,variant:d=X.Primary,tooltipVariant:p=d,rounded:k=re.Medium,tooltipPosition:T=J.Top,...m})=>{const g=t&&!!!(e||s),v={xs:g?"p-2 text-xs":"px-1 py-1 text-xs",small:g?"p-2 text-xs":"px-4 py-2 text-xs",medium:g?"p-2.5 text-sm":"px-5 py-2.5 text-sm",large:g?"p-3.5 text-base":"px-6 py-3 text-base"}[c],w=i?{default:"bg-transparent text-slate-800 ring-1 ring-slate-400 hover:bg-slate-100 hover:ring-slate-500 dark:text-slate-100 dark:ring-slate-600 dark:hover:bg-slate-800/60 focus-visible:outline-slate-300",primary:"bg-transparent text-violet-600 ring-1 ring-violet-600 hover:bg-violet-50 hover:ring-violet-500 dark:text-violet-200 dark:ring-slate-500 dark:hover:bg-violet-900/30 focus-visible:outline-violet-300",secondary:"bg-transparent text-slate-900 ring-1 ring-slate-300 hover:bg-slate-100 hover:ring-slate-400 dark:text-slate-100 dark:ring-slate-600 dark:hover:bg-slate-800 focus-visible:outline-slate-400",success:"bg-transparent text-emerald-600 ring-1 ring-emerald-600 hover:bg-emerald-50 hover:ring-emerald-500 dark:text-emerald-200 dark:ring-emerald-600 dark:hover:bg-emerald-900/30 focus-visible:outline-emerald-300",danger:"bg-transparent text-red-600 ring-1 ring-red-600 hover:bg-red-50 hover:ring-red-500 dark:text-red-200 dark:ring-red-600 dark:hover:bg-red-900/30 focus-visible:outline-red-300",info:"bg-transparent text-sky-600 ring-1 ring-sky-600 hover:bg-sky-50 hover:ring-sky-500 dark:text-sky-200 dark:ring-sky-600 dark:hover:bg-sky-900/30 focus-visible:outline-syk-300",warning:"bg-transparent text-amber-600 ring-1 ring-amber-500 hover:bg-amber-50 hover:ring-amber-500 dark:text-amber-200 dark:ring-amber-500 dark:hover:bg-amber-900/30 focus-visible:outline-amber-300"}[d]:{default:"",primary:"bg-violet-600 text-white hover:bg-violet-500 ring-1 ring-violet-600 shadow shadow-violet-600/30 dark:bg-slate-700 dark:hover:bg-slate-700 dark:ring-slate-600 dark:shadow-slate-800/30 focus-visible:outline-violet-300",secondary:"bg-slate-200 text-slate-900 ring-1 ring-slate-300 hover:bg-slate-300 hover:ring-slate-400 dark:bg-slate-800 dark:text-slate-100 dark:ring-slate-700 dark:hover:bg-slate-700 focus-visible:outline-slate-400",success:"bg-emerald-600 text-white hover:bg-emerald-500 shadow shadow-emerald-600/30 dark:bg-emerald-800 dark:hover:bg-emerald-700 dark:shadow-emerald-800/30 focus-visible:outline-emerald-300",danger:"bg-red-600 text-white hover:bg-red-500 shadow shadow-red-600/30 dark:bg-red-800 dark:hover:bg-red-700 dark:shadow-red-800/30 focus-visible:outline-red-300",info:"bg-sky-600 text-white hover:bg-sky-500 shadow shadow-sky-600/30 dark:bg-sky-800 dark:hover:bg-sky-700 dark:shadow-sky-800/30 focus-visible:outline-sky-300",warning:"bg-amber-500 text-slate-950 hover:bg-amber-400 shadow shadow-amber-500/30 dark:bg-amber-800 dark:text-white dark:hover:bg-amber-700 dark:shadow-amber-800/30 focus-visible:outline-amber-300"}[d],j=i?{default:"bg-slate-50 text-slate-800 ring-1 ring-slate-300 dark:bg-slate-800 dark:text-slate-100 dark:ring-slate-600",primary:"bg-slate-50 text-violet-700 ring-1 ring-violet-600 dark:bg-violet-950 dark:text-violet-100 dark:ring-violet-700",secondary:"bg-slate-50 text-slate-900 ring-1 ring-slate-300 dark:bg-slate-900 dark:text-slate-100 dark:ring-slate-700",success:"bg-slate-50 text-emerald-700 ring-1 ring-emerald-500 dark:bg-emerald-900 dark:text-emerald-100 dark:ring-emerald-700",danger:"bg-slate-50 text-red-700 ring-1 ring-red-500 dark:bg-red-900 dark:text-red-100 dark:ring-red-700",info:"bg-slate-50 text-sky-700 ring-1 ring-sky-500 dark:bg-sky-900 dark:text-sky-100 dark:ring-sky-700",warning:"bg-slate-50 text-amber-700 ring-1 ring-amber-500 dark:bg-amber-900 dark:text-amber-100 dark:ring-amber-700"}:{default:"bg-slate-700 text-white",primary:"bg-violet-600 text-white",secondary:"bg-slate-200 text-slate-900 dark:bg-slate-700 dark:text-white",success:"bg-emerald-600 text-white",danger:"bg-red-600 text-white",info:"bg-sky-600 text-white",warning:"bg-amber-500 text-slate-950 dark:bg-amber-700 dark:text-white"},E=p??d,$={sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",none:"rounded-none",full:"rounded-full"},V={[J.Top]:"bottom-[calc(100%+0.75rem)] left-1/2 -translate-x-1/2",[J.Bottom]:"top-[calc(100%+0.75rem)] left-1/2 -translate-x-1/2",[J.Left]:"right-[calc(100%+0.75rem)] top-1/2 -translate-y-1/2",[J.Right]:"left-[calc(100%+0.75rem)] top-1/2 -translate-y-1/2"}[T],q={[J.Top]:"bottom-0 left-1/2 -translate-x-1/2 translate-y-1/2",[J.Bottom]:"top-0 left-1/2 -translate-x-1/2 -translate-y-1/2",[J.Left]:"right-0 top-1/2 translate-x-1/2 -translate-y-1/2",[J.Right]:"left-0 top-1/2 -translate-x-1/2 -translate-y-1/2"}[T],W={[J.Top]:{clipPath:"polygon(0 0, 100% 0, 50% 100%)"},[J.Bottom]:{clipPath:"polygon(50% 0, 0 100%, 100% 100%)"},[J.Left]:{clipPath:"polygon(0 0, 100% 50%, 0 100%)"},[J.Right]:{clipPath:"polygon(100% 0, 0 50%, 100% 100%)"}},K={[J.Top]:{bottom:"-5px"},[J.Bottom]:{top:"-5px"},[J.Left]:{right:"-5px"},[J.Right]:{left:"-5px"}},ne={...W[T],...K[T]},ge={default:"border border-slate-700",primary:"border border-violet-600 dark:border-slate-700",secondary:"border border-slate-300 dark:border-slate-600",success:"border border-emerald-600",warning:"border border-amber-500",info:"border border-sky-600",danger:"border border-red-600"},H={default:"bg-slate-700 border border-slate-700",primary:"bg-violet-600 border border-violet-600 dark:border-slate-700",secondary:"bg-slate-400 border border-slate-400",success:"bg-emerald-600 border border-emerald-600",warning:"bg-amber-500 border border-amber-500",info:"bg-sky-600 border border-sky-600",danger:"bg-red-600 border border-red-600"},te=u??m.disabled;return l.jsxs("span",{className:"relative group",children:[l.jsx("button",{type:"button",className:["w-full flex items-center justify-center font-semibold transition-colors duration-200 disabled:cursor-not-allowed disabled:opacity-60",v,w,$[k],n].filter(Boolean).join(" "),"aria-label":g?a:e,"aria-busy":u||void 0,disabled:te,...m,children:l.jsxs("span",{className:"flex items-center justify-center gap-2",children:[u&&l.jsx(xt,{size:g?"xs":"sm",variant:d,label:o,showLabel:!1}),t&&l.jsx("span",{children:t}),e,s]})}),r&&l.jsxs("span",{className:["pointer-events-none absolute whitespace-nowrap rounded-md px-3 py-1 text-xs font-medium shadow-lg transition duration-150 opacity-0 scale-95 transform-gpu z-10 group-hover:opacity-100 group-hover:scale-100",V,j[E]].join(" "),children:[r,l.jsx("span",{className:["absolute w-2.5 h-2.5 transform-gpu ring-0",q,i?H[E]:[j[E],ge[E]].join(" ")].join(" "),style:ne})]})]})};const Qs=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ea=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,r,s)=>s?s.toUpperCase():r.toLowerCase()),ur=t=>{const e=ea(t);return e.charAt(0).toUpperCase()+e.slice(1)},Yr=(...t)=>t.filter((e,r,s)=>!!e&&e.trim()!==""&&s.indexOf(e)===r).join(" ").trim(),ta=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};var ra={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const sa=y.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:s,className:a="",children:n,iconNode:o,...i},u)=>y.createElement("svg",{ref:u,...ra,width:e,height:e,stroke:t,strokeWidth:s?Number(r)*24/Number(e):r,className:Yr("lucide",a),...!n&&!ta(i)&&{"aria-hidden":"true"},...i},[...o.map(([c,d])=>y.createElement(c,d)),...Array.isArray(n)?n:[n]]));const G=(t,e)=>{const r=y.forwardRef(({className:s,...a},n)=>y.createElement(sa,{ref:n,iconNode:e,className:Yr(`lucide-${Qs(ur(t))}`,`lucide-${t}`,s),...a}));return r.displayName=ur(t),r};const aa=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],na=G("activity",aa);const oa=[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]],ia=G("arrow-down-right",oa);const la=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],ca=G("arrow-up-right",la);const da=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],ua=G("bell",da);const fa=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],ma=G("chevron-left",fa);const ha=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Qr=G("chevron-right",ha);const pa=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],ga=G("history",pa);const ya=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],ba=G("lock",ya);const xa=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],va=G("log-out",xa);const _a=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],ka=G("menu",_a);const wa=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],Ta=G("monitor",wa);const Na=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],ja=G("moon",Na);const Sa=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Ca=G("search",Sa);const Ea=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Oa=G("settings",Ea);const Ra=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],Aa=G("sparkles",Ra);const La=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Ia=G("sun",La);const $a=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Pa=G("user",$a);const Ma=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],fr=G("x",Ma),Ba={info:"focus:border-sky-400 focus-visible:border-sky-400",danger:"focus:border-red-400 focus-visible:border-red-400",default:"focus:border-slate-400 focus-visible:border-slate-400",warning:"focus:border-amber-400 focus-visible:border-amber-400",primary:"focus:border-violet-400 focus-visible:border-violet-400",secondary:"focus:border-slate-400 focus-visible:border-slate-400",success:"focus:border-emerald-400 focus-visible:border-emerald-400"},za={xs:"px-2 py-2 text-xs",small:"px-3 py-2.5 text-sm",medium:"px-3.5 py-3 text-sm",large:"px-4 py-3.5 text-base"},Qt=({id:t,name:e,label:r,value:s,options:a,onChange:n,placeholder:o="Select an option",className:i="",disabled:u=!1,size:c=le.Small,forceDarkTheme:d=!1,variant:p=X.Primary,dropdownMaxHeight:k="60vh",emptyStateLabel:T="No options available"})=>{const[m,h]=y.useState(!1),g=y.useRef(null),v=y.useMemo(()=>a.find($=>String($.value)===String(s)),[a,s]),x=v?.label??o,b=za[c],w=y.useMemo(()=>typeof k=="number"?{maxHeight:`${k}px`}:{maxHeight:k},[k]),A=m?"border border-slate-300 dark:border-slate-500 shadow-sm":"border border-slate-200 dark:border-slate-600 shadow-sm",D=()=>!u&&h($=>!$),j=y.useCallback($=>{g.current&&!g.current.contains($.target)&&h(!1)},[]);y.useEffect(()=>{if(m)return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[j,m]);const E=$=>{n(String($)),h(!1)};return l.jsxs("div",{className:d?"dark":"",children:[r?l.jsx("label",{htmlFor:t,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:r}):null,l.jsxs("div",{ref:g,className:`relative ${i}`,"aria-expanded":m,"aria-haspopup":"listbox",children:[l.jsxs("button",{type:"button",id:t,name:e,disabled:u,onClick:D,className:`w-full flex items-center justify-between gap-2 rounded-md bg-slate-50 dark:bg-gray-700 text-slate-900 dark:text-slate-100 border border-slate-200 dark:border-slate-500 focus:outline-none focus-visible:shadow-sm disabled:cursor-not-allowed disabled:opacity-60 transition-colors ${Ba[p]} ${b} ${A}`,children:[l.jsxs("div",{className:"flex items-center gap-2 min-h-5",children:[v?.icon?l.jsx("span",{className:"text-gray-500 dark:text-gray-300",children:v.icon}):null,l.jsx("span",{className:`text-sm ${v?"text-slate-900 dark:text-slate-100":"text-slate-500 dark:text-slate-400"}`,children:x})]}),l.jsx("span",{className:`text-gray-500 dark:text-gray-300 transition-transform duration-150 ${m?"rotate-180":""}`,children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"none",className:"h-4 w-4",stroke:"currentColor",strokeWidth:"1.5",children:l.jsx("path",{d:"M6 8l4 4 4-4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),m?l.jsx("div",{className:"absolute left-0 right-0 mt-2 rounded-md bg-slate-50 dark:bg-slate-900 border border-gray-200 dark:border-gray-700 shadow-lg z-20",children:l.jsx("ul",{role:"listbox",style:w,className:"max-h-[60vh] overflow-auto py-2",children:a.length?a.map($=>{const V=String($.value),q=V===String(s);return l.jsx("li",{children:l.jsxs("button",{type:"button",className:`w-full flex items-center justify-between gap-2 px-3 py-2 text-left hover:bg-slate-200 dark:hover:bg-slate-800 ${q?"bg-slate-100 dark:bg-slate-700":""}`,onClick:()=>E($.value),children:[l.jsxs("div",{className:"flex items-center gap-2",children:[$.icon?l.jsx("span",{className:"text-gray-500 dark:text-gray-300",children:$.icon}):null,l.jsx("span",{className:"text-sm text-slate-800 dark:text-slate-100",children:$.label})]}),q?l.jsx("span",{className:"text-violet-600 dark:text-violet-300",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"none",className:"h-4 w-4",stroke:"currentColor",strokeWidth:"2",children:l.jsx("path",{d:"M5 11l3 3 7-7",strokeLinecap:"round",strokeLinejoin:"round"})})}):null]})},V)}):l.jsx("li",{className:"px-3 py-4 text-sm text-slate-500 dark:text-slate-400",children:T})})}):null]})]})},es=y.createContext(void 0),Da=({children:t})=>{const[e,r]=y.useState("system"),[s,a]=y.useState("light"),[n,o]=y.useState(!1);y.useEffect(()=>{const u=localStorage.getItem("theme");u&&["light","dark","system"].includes(u)&&r(u),o(!0)},[]),y.useEffect(()=>{if(!n)return;const u=c=>{let d="light";c==="system"?d=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":d=c,a(d),d==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")};if(u(e),localStorage.setItem("theme",e),e==="system"){const c=window.matchMedia("(prefers-color-scheme: dark)"),d=()=>{u(e)};return c.addEventListener("change",d),()=>c.removeEventListener("change",d)}},[e,n]);const i=u=>{r(u)};return l.jsx(es.Provider,{value:{theme:e,setTheme:i,resolvedTheme:s},children:t})},ts=()=>{const t=y.useContext(es);if(!t)throw new Error("useTheme must be used within ThemeProvider");return t},er=({forceDarkTheme:t=!1})=>{const{theme:e,setTheme:r}=ts(),s=[{value:"light",label:"Light",icon:l.jsx(Ia,{size:16})},{value:"dark",label:"Dark",icon:l.jsx(ja,{size:16})},{value:"system",label:"System",icon:l.jsx(Ta,{size:16})}];return l.jsx(Qt,{value:e,options:s,onChange:a=>r(a),forceDarkTheme:t})},Fa={violet:{text:"text-slate-50",arrow:"border-t-violet-600",bg:"bg-violet-600 dark:bg-slate-600"},yellow:{text:"text-black dark:text-slate-50",arrow:"border-t-yellow-500",bg:"bg-yellow-500 dark:bg-amber-800"},red:{text:"text-slate-50",arrow:"border-t-red-600",bg:"bg-red-600 dark:bg-red-800"},default:{bg:"bg-gray-600",text:"text-slate-50",arrow:"border-t-gray-800"}},$e=({text:t,children:e,position:r="top",color:s="default"})=>{const a=Fa[s],n=y.useRef(null),[o,i]=y.useState(!1),[u,c]=y.useState({top:0,left:0,transform:""});return y.useEffect(()=>{if(!o||!n.current)return;const d=n.current.getBoundingClientRect(),p=8,k=(()=>{switch(r){case"bottom":return{top:d.bottom+window.scrollY+p,left:d.left+window.scrollX+d.width/2,transform:"translateX(-50%)"};case"left":return{top:d.top+window.scrollY+d.height/2,left:d.left+window.scrollX-p,transform:"translate(-100%, -50%)"};case"right":return{top:d.top+window.scrollY+d.height/2,left:d.right+window.scrollX+p,transform:"translateY(-50%)"};default:return{top:d.top+window.scrollY-p,left:d.left+window.scrollX+d.width/2,transform:"translate(-50%, -100%)"}}})();c(k)},[o,r]),l.jsxs("div",{ref:n,className:"relative",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onFocus:()=>i(!0),onBlur:()=>i(!1),children:[e,typeof document<"u"&&Gr.createPortal(l.jsx("div",{style:{top:u.top,left:u.left,transform:u.transform},className:`fixed px-2 py-1 text-xs rounded shadow-lg transition-opacity duration-150 whitespace-nowrap pointer-events-none z-50 ${a.bg} ${a.text} ${o?"opacity-100":"opacity-0"}`,children:t}),document.body)]})},mr={xs:"max-w-xs",xl:"max-w-xl",small:"max-w-sm",large:"max-w-lg",medium:"max-w-md","2xl":"max-w-2xl","3xl":"max-w-3xl","4xl":"max-w-4xl",full:"max-w-full mx-4"},Ua={info:"bg-cyan-500 dark:bg-cyan-600 text-white",danger:"bg-red-500 dark:bg-red-600 text-white",secondary:"bg-gray-500 dark:bg-gray-600 text-white",success:"bg-green-500 dark:bg-green-600 text-white",primary:"bg-violet-600 dark:bg-violet-700 text-white",warning:"bg-yellow-500 dark:bg-yellow-600 text-white",default:"bg-slate-50 dark:bg-slate-800/50 border-b border-slate-200 dark:border-slate-700"},Pt=({children:t,className:e="",variant:r=X.Default})=>{const s="px-6 py-4 rounded-t-xl",a=Ua[r];return l.jsx("div",{className:`${s} ${a} ${e}`,children:t})},Mt=({children:t,className:e=""})=>l.jsx("div",{className:`px-6 py-4 ${e}`,children:t}),rs=({children:t,className:e=""})=>l.jsx("div",{className:`px-6 py-4 bg-slate-50 dark:bg-slate-800/50 border-t border-slate-200 dark:border-slate-700 rounded-b-xl flex items-center justify-end gap-3 ${e}`,children:t}),Za=({title:t,isOpen:e,onClose:r,children:s,zIndex:a=50,className:n="",onOverlayClick:o,onEscapeKeyDown:i,size:u=le.Medium,contentClassName:c="",closeOnEscape:d=!1,showCloseButton:p=!0,variant:k=X.Default,closeOnOverlayClick:T=!1})=>{let m=null,h=null,g=null;if(y.Children.forEach(s,w=>{y.isValidElement(w)&&(w.type===Pt?m=w:w.type===Mt?h=w:w.type===rs?g=w:h=w)}),y.useEffect(()=>{if(!e||!d)return;const w=A=>{A.key==="Escape"&&(i?i(A):r())};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[e,d,r,i]),y.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),!e)return null;const v=w=>{w.target===w.currentTarget&&(o?o(w):T&&r())},x=mr[u]||mr.medium,b=k!==X.Default;return l.jsx("div",{role:"dialog","aria-modal":"true",style:{zIndex:a},onClick:v,className:`fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center p-4 ${n}`,children:l.jsxs("div",{className:`bg-white dark:bg-slate-800 rounded-xl shadow-2xl w-full max-h-[90vh] flex flex-col ${x} transform transition-all ${c}`,children:[m?l.jsx("div",{className:"shrink-0",children:m}):t?l.jsx("div",{className:"shrink-0",children:l.jsx(Pt,{variant:k,children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h3",{className:`text-xl font-semibold ${b?"text-white":"text-slate-900 dark:text-slate-100"}`,children:t}),p&&l.jsx("button",{onClick:r,"aria-label":"Close modal",className:`p-1 rounded-lg transition-colors ${b?"hover:bg-white/20 text-white":"hover:bg-slate-100 dark:hover:bg-slate-700 text-slate-500 dark:text-slate-400"}`,children:l.jsx(fr,{className:"w-5 h-5"})})]})})}):p?l.jsx("div",{className:"absolute top-4 right-4 z-10",children:l.jsx("button",{onClick:r,className:"p-1 rounded-lg hover:bg-slate-100 dark:hover:bg-slate-700 text-slate-500 dark:text-slate-400 transition-colors","aria-label":"Close modal",children:l.jsx(fr,{className:"w-5 h-5"})})}):null,l.jsx("div",{className:"flex-1 overflow-y-auto",children:typeof h=="string"?l.jsx(Mt,{children:h}):h}),g&&l.jsx("div",{className:"shrink-0",children:g})]})})},Ae={info:"border-t-cyan-500",danger:"border-t-red-500",success:"border-t-green-500",secondary:"border-t-gray-500",warning:"border-t-yellow-500",primary:"border-t-violet-600"},Va={info:"text-slate-100 bg-cyan-500",danger:"text-slate-100 bg-red-500",default:"border-b border-slate-300",success:"text-slate-100 bg-green-500",secondary:"text-slate-100 bg-gray-500",warning:"text-slate-100 bg-yellow-500",primary:"text-slate-100 bg-violet-600 dark:bg-slate-500 dark:text-slate-200"},qa={default:"border-slate-300",info:`border-white/5 border-t-2 ${Ae.info}`,danger:`border-white/5 border-t-2 ${Ae.danger}`,success:`border-white/5 border-t-2 ${Ae.success}`,primary:`border-white/5 border-t-2 ${Ae.primary}`,warning:`border-white/5 border-t-2 ${Ae.warning}`,secondary:`border-white/5 border-t-2 ${Ae.secondary}`},ss={[re.Full]:"rounded-3xl",[re.Large]:"rounded-lg",[re.Small]:"rounded-sm",[re.None]:"rounded-none",[re.Medium]:"rounded-md"},as=y.createContext(void 0),vt=({children:t,className:e="",variant:r=X.Default,shouldTitleBgColor:s=!0,rounded:a=re.Medium})=>(s||(a=re.Small),l.jsx(as.Provider,{value:{rounded:a,variant:r,shouldTitleBgColor:s},children:l.jsx("div",{className:[e,ss[a],`${!s&&qa[r]}`,"bg-slate-50 shadow-lg backdrop-blur-lg transition duration-200 border-2 border-slate-100 dark:border-none dark:bg-slate-800"].filter(Boolean).join(" "),children:t})})),ns=({children:t,className:e=""})=>{const r=y.useContext(as),s=r?.shouldTitleBgColor??!1,a=ss[r?.rounded??re.Medium],n=Va[r?.variant??X.Primary],o=s?n:"border-b border-slate-300";return l.jsx("div",{className:[a,e,o,"px-4 py-2 rounded-bl-none rounded-br-none"].join(" "),children:t})},Ha=({children:t,className:e=""})=>l.jsx("div",{className:["px-4 py-2 border-t border-slate-300",e].join(" "),children:t}),_t=({children:t,className:e=""})=>l.jsx("div",{className:[e,"px-4 py-2 text-slate-800 dark:text-slate-200"].join(" "),children:t}),Wa=({title:t,value:e,color:r,icon:s,className:a=""})=>{const n={"bg-orange-500":{light:"bg-orange-100",dark:"dark:bg-orange-900/30",icon:"text-orange-600 dark:text-orange-400"},"bg-green-500":{light:"bg-green-100",dark:"dark:bg-green-900/30",icon:"text-green-600 dark:text-green-400"},"bg-violet-500":{light:"bg-violet-100",dark:"dark:bg-violet-900/30",icon:"text-violet-600 dark:text-violet-400"},"bg-blue-500":{light:"bg-blue-100",dark:"dark:bg-blue-900/30",icon:"text-blue-600 dark:text-blue-400"},"bg-yellow-500":{light:"bg-yellow-100",dark:"dark:bg-yellow-900/30",icon:"text-yellow-600 dark:text-yellow-400"}},o=n[r]||n["bg-violet-500"];return l.jsx(vt,{className:`card-hover ${a}`,children:l.jsx(_t,{className:"p-6",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-slate-600 dark:text-slate-400 mb-1",children:t}),l.jsx("p",{className:"text-2xl font-bold text-slate-900 dark:text-slate-100",children:e})]}),l.jsx("div",{className:`p-3 rounded-xl ${o.light} ${o.dark}`,children:l.jsx(s,{className:`w-6 h-6 ${o.icon}`})})]})})})},Ja=({title:t,value:e,color:r,change:s,changeType:a,icon:n})=>{const o={"bg-violet-500":{light:"bg-violet-100",dark:"dark:bg-violet-900/30",icon:"text-violet-600 dark:text-violet-400"},"bg-green-500":{light:"bg-green-100",dark:"dark:bg-green-900/30",icon:"text-green-600 dark:text-green-400"},"bg-yellow-500":{light:"bg-yellow-100",dark:"dark:bg-yellow-900/30",icon:"text-yellow-600 dark:text-yellow-400"},"bg-blue-500":{light:"bg-blue-100",dark:"dark:bg-blue-900/30",icon:"text-blue-600 dark:text-blue-400"}},i=o[r]||o["bg-violet-500"];return l.jsx(vt,{className:"card-hover",children:l.jsxs(_t,{className:"p-6",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsx("div",{className:`p-3 rounded-xl ${i.light} ${i.dark}`,children:l.jsx(n,{className:`w-6 h-6 ${i.icon}`})}),s&&l.jsxs("div",{className:`flex items-center gap-1 text-sm font-semibold ${a==="positive"?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400"}`,children:[a==="positive"?l.jsx(ca,{className:"w-4 h-4"}):l.jsx(ia,{className:"w-4 h-4"}),s]})]}),l.jsx("h3",{className:"text-sm font-semibold text-slate-500 dark:text-slate-400 mb-1 uppercase tracking-wide",children:t}),l.jsx("p",{className:"text-3xl font-bold text-slate-900 dark:text-slate-100",children:e})]})})},Xa={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"},tr=y.createContext(void 0),Ga=({children:t,className:e="",rounded:r=re.Medium})=>l.jsx("div",{className:["overflow-x-auto overflow-hidden border border-gray-200 dark:border-gray-700",Xa[r],e].filter(Boolean).join(" "),children:l.jsx("table",{className:"w-full border-collapse",children:t})}),Ka=({children:t,className:e=""})=>l.jsx(tr.Provider,{value:"head",children:l.jsx("thead",{className:`bg-gray-200 dark:bg-gray-800 ${e}`,children:t})}),Ya=({children:t,className:e=""})=>l.jsx(tr.Provider,{value:"body",children:l.jsx("tbody",{className:e,children:t})}),Qa=({children:t,hover:e=!0,className:r=""})=>{const s=y.useContext(tr),a=e&&s!=="head",n=s==="body";return l.jsx("tr",{className:["border-b border-gray-200 dark:border-gray-700",n&&"even:bg-gray-100 dark:even:bg-gray-700",a&&"hover:bg-gray-50 dark:hover:bg-gray-800/50",r].filter(Boolean).join(" "),children:t})},en=({children:t,align:e="left",className:r=""})=>{const s={left:"text-left",right:"text-right",center:"text-center"};return l.jsx("th",{className:["px-4 py-3 font-semibold text-sm text-gray-700 dark:text-gray-300 uppercase tracking-wider",s[e],r].filter(Boolean).join(" "),children:t})},tn=({colSpan:t,children:e,className:r="",align:s="left"})=>{const a={left:"text-left",right:"text-right",center:"text-center"};return l.jsx("td",{colSpan:t,className:`px-4 py-3 text-sm text-gray-900 dark:text-gray-100 ${a[s]} ${r}`,children:e})},os=({open:t,blur:e=!0,overlayClassName:r,showBackdrop:s=!0,variant:a=X.Primary,message:n="Getting things ready..."})=>{if(!t)return null;const o=l.jsx("div",{className:["fixed inset-0 z-1200 flex items-center justify-center p-6",s?"bg-slate-900/50 dark:bg-black/20":"pointer-events-none",e?"backdrop-blur-sm":"",r].filter(Boolean).join(" "),role:"alert","aria-busy":"true","aria-live":"assertive",children:l.jsxs("div",{className:"flex items-center gap-3 rounded-xl bg-slate-50/90 px-6 py-4 shadow-2xl ring-1 ring-black/5 dark:bg-slate-900/85 dark:ring-white/5",children:[l.jsx(xt,{size:"lg",variant:a}),n&&l.jsx("span",{className:"text-sm font-semibold text-slate-800 dark:text-slate-100",children:n})]})});return typeof document>"u"?o:Gr.createPortal(o,document.body)},is=({icon:t,action:e,target:r,time:s,type:a})=>{const n={success:"bg-green-100 dark:bg-green-900/30 text-green-600 dark:text-green-400",info:"bg-blue-100 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400",warning:"bg-yellow-100 dark:bg-yellow-900/30 text-yellow-600 dark:text-yellow-400"};return l.jsxs("div",{className:"flex items-start gap-4 py-3",children:[l.jsx("div",{className:`p-2 rounded-lg ${n[a]}`,children:l.jsx(t,{className:"w-4 h-4"})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("p",{className:"text-sm font-medium text-slate-900 dark:text-slate-100",children:e}),l.jsx("p",{className:"text-sm text-violet-600 dark:text-violet-400 font-medium",children:r})]}),l.jsx("span",{className:"text-xs text-slate-500 dark:text-slate-400 whitespace-nowrap",children:s})]})},rn=({title:t="Recent Activity",icon:e=na,activities:r,className:s=""})=>l.jsxs(vt,{className:s,children:[l.jsx(ns,{children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h2",{className:"text-lg font-semibold text-slate-900 dark:text-slate-100",children:t}),l.jsx(e,{className:"w-5 h-5 text-slate-400"})]})}),l.jsx(_t,{children:l.jsx("div",{className:"divide-y divide-slate-200 dark:divide-slate-600",children:r.map((a,n)=>l.jsx(is,{icon:a.icon,action:a.action,target:a.target,time:a.time,type:a.type},n))})})]}),sn=({label:t,value:e,color:r="bg-violet-600",showPercentage:s=!0,className:a=""})=>{const o={"bg-violet-600":"bg-violet-600","bg-blue-600":"bg-blue-600","bg-green-600":"bg-green-600","bg-red-600":"bg-red-600","bg-yellow-600":"bg-yellow-600","bg-orange-600":"bg-orange-600","bg-purple-600":"bg-purple-600","bg-pink-600":"bg-pink-600"}[r]||r;return l.jsxs("div",{className:`space-y-2 ${a}`,children:[l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx("span",{className:"text-sm font-medium text-slate-700 dark:text-slate-300",children:t}),l.jsxs("span",{className:"text-sm font-bold text-slate-900 dark:text-slate-100",children:[e,s&&"%"]})]}),l.jsx("div",{className:"w-full bg-slate-200 dark:bg-slate-700 rounded-full h-2 overflow-hidden",children:l.jsx("div",{className:`${o} h-2 rounded-full transition-all duration-700 ease-out`,style:{width:`${Math.min(100,Math.max(0,e))}%`}})})]})},an=({limit:t,totalDocs:e,totalPages:r,currentPage:s,hasPrevPage:a,hasNextPage:n,onPageChange:o,onLimitChange:i,outline:u=!1,variant:c=X.Primary})=>{const d=u,p=u||!0,k=(s-1)*t+1,T=Math.min(s*t,e),m=()=>{const h=[];let v=Math.max(1,s-Math.floor(2.5)),x=Math.min(r,v+5-1);x-v+1<5&&(v=Math.max(1,x-5+1)),h.push(l.jsx(de,{outline:!0,size:le.Small,variant:c,ariaLabel:"Previous",disabled:!a,icon:l.jsx(ma,{className:"size-4","aria-hidden":"true"}),onClick:()=>a&&o(s-1),className:"rounded-l-md focus:z-20"},"prev")),v>1&&(h.push(l.jsx(de,{outline:!0,label:"1",size:le.Small,variant:c,ariaLabel:"Page 1",onClick:()=>o(1),className:"focus:z-20"},1)),v>2&&h.push(l.jsx("span",{className:"relative inline-flex items-center px-4 py-2 text-sm font-semibold text-gray-400 inset-ring inset-ring-gray-700 focus:outline-offset-0 rounded-md",children:"..."},"ellipsis-start")));for(let b=v;b<=x;b++)h.push(l.jsx(de,{size:le.Small,variant:c,label:b.toString(),ariaLabel:`Page ${b}`,onClick:()=>o(b),outline:b!==s?p:d,className:`focus:z-20 ${s===b&&"dark:bg-gray-700"}`},b));return x<r&&(x<r-1&&h.push(l.jsx("span",{className:"relative inline-flex items-center px-4 py-2 text-sm rounded-md font-semibold text-gray-500 inset-ring inset-ring-gray-300 focus:outline-offset-0",children:"..."},"ellipsis-end")),h.push(l.jsx(de,{outline:!0,size:le.Small,variant:c,label:r.toString(),ariaLabel:`Page ${r}`,onClick:()=>o(r),className:"focus:z-20"},r))),h.push(l.jsx(de,{outline:!0,ariaLabel:"Next",size:le.Small,variant:c,disabled:!n,onClick:()=>n&&o(s+1),icon:l.jsx(Qr,{className:"size-4","aria-hidden":"true"}),className:"rounded-r-md focus:z-20"},"next")),h};return l.jsxs("div",{className:"mt-4 flex justify-between items-center border-t-2 border-gray-300 dark:border-gray-500",children:[l.jsx("div",{className:"flex items-center gap-2",children:l.jsx(Qt,{value:t,onChange:h=>i(Number(h)),options:[{label:"1",value:1},{label:"10",value:10},{label:"25",value:25},{label:"50",value:50},{label:"100",value:100}]})}),l.jsxs("div",{className:"flex items-center justify-between pl-4 py-2 sm:pl-6",children:[l.jsxs("div",{className:"flex justify-between sm:hidden gap-2",children:[l.jsx(de,{outline:!0,label:"Previous",variant:c,size:le.Medium,disabled:!a,onClick:()=>a&&o(s-1),className:"w-full justify-center"}),l.jsx(de,{outline:!0,label:"Next",variant:c,size:le.Medium,disabled:!n,onClick:()=>n&&o(s+1),className:"w-full justify-center"})]}),l.jsxs("div",{className:"hidden sm:flex sm:flex-1 sm:items-center sm:justify-between",children:[l.jsx("div",{children:l.jsxs("p",{className:"text-sm text-gray-800 dark:text-gray-200 mr-2",children:["Showing ",l.jsxs("span",{className:"font-medium",children:[k," "]}),"to ",l.jsxs("span",{className:"font-medium",children:[T," "]}),"of ",l.jsxs("span",{className:"font-medium",children:[e," "]}),"results"]})}),l.jsx("div",{children:l.jsx("nav",{"aria-label":"Pagination",className:"isolate inline-flex gap-2 rounded-md",children:m()})})]})]})]})},nn={info:"focus:border-sky-400 focus-visible:border-sky-400",danger:"focus:border-red-400 focus-visible:border-red-400",default:"focus:border-slate-400 focus-visible:border-slate-400",warning:"focus:border-amber-400 focus-visible:border-amber-400",primary:"focus:border-violet-400 focus-visible:border-violet-400",secondary:"focus:border-slate-400 focus-visible:border-slate-400",success:"focus:border-emerald-400 focus-visible:border-emerald-400"},Bt=({id:t,name:e,icon:r,label:s,error:a,value:n,onChange:o,placeholder:i,type:u="text",className:c="",disabled:d=!1,forceDarkTheme:p=!1,variant:k=X.Primary,rounded:T=re.Medium})=>{const m=!!r,h=m?"pl-9 pr-3 py-2":"p-2",g={sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",none:"rounded-none",full:"rounded-full"};return l.jsxs("div",{className:`${p?"dark":""} w-full`,children:[s?l.jsx("label",{htmlFor:t,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:s}):null,l.jsxs("div",{className:"relative",children:[m?l.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-3 flex items-center text-gray-800 dark:text-gray-300",children:r}):null,l.jsx("input",{id:t,name:e,type:u,value:n,disabled:d,placeholder:i,onChange:v=>o(v.target.value),className:["block w-full px-4 py-3 bg-slate-50 dark:bg-gray-700 text-slate-800 dark:text-slate-100 shadow-sm placeholder-gray-400 focus:outline-none transition-colors",h,g[T],nn[k],c,a?"border border-red-700 dark:border-red-500 focus:border-red-700 focus-visible:border-red-700":"border border-gray-300 dark:border-gray-600 focus:border-violet-400 focus-visible:border-violet-400"].join(" ")})]}),a&&l.jsxs("div",{role:"alert",className:"mt-1 text-sm font-medium text-red-700",children:[a,"!"]})]})},on={info:"focus:border-sky-400 focus-visible:border-sky-400",danger:"focus:border-red-400 focus-visible:border-red-400",default:"focus:border-slate-400 focus-visible:border-slate-400",warning:"focus:border-amber-400 focus-visible:border-amber-400",primary:"focus:border-violet-400 focus-visible:border-violet-400",secondary:"focus:border-slate-400 focus-visible:border-slate-400",success:"focus:border-emerald-400 focus-visible:border-emerald-400"},ln={none:"resize-none",both:"resize",vertical:"resize-y",horizontal:"resize-x"},cn={sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",none:"rounded-none",full:"rounded-full"},dn=({id:t,name:e,label:r,error:s,value:a,onChange:n,placeholder:o,rows:i=4,className:u="",disabled:c=!1,forceDarkTheme:d=!1,variant:p=X.Primary,rounded:k=re.Medium,resize:T="vertical"})=>l.jsxs("div",{className:d?"dark":"",children:[r?l.jsx("label",{htmlFor:t,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:r}):null,l.jsx("textarea",{id:t,name:e,rows:i,disabled:c,placeholder:o,value:a,onChange:m=>n(m.target.value),className:["block w-full px-4 py-3 bg-slate-50 dark:bg-gray-700 text-slate-800 dark:text-slate-100 shadow-sm placeholder-gray-400 focus:outline-none border transition-colors",cn[k],ln[T],on[p],s?"border-red-700 dark:border-red-500 focus:border-red-700 focus-visible:border-red-700":"border-gray-300 dark:border-gray-600 focus:border-violet-400 focus-visible:border-violet-400",c?"cursor-not-allowed opacity-70":"",u].join(" ")}),s?l.jsx("p",{role:"alert",className:"mt-1 text-sm font-medium text-red-700",children:s}):null]}),un={info:"text-sky-600 accent-sky-500 hover:border-sky-400 focus-visible:border-sky-400",danger:"text-red-600 accent-red-500 hover:border-red-400 focus-visible:border-red-400",default:"text-slate-700 accent-slate-500 hover:border-slate-400 focus-visible:border-slate-400",warning:"text-amber-600 accent-amber-500 hover:border-amber-400 focus-visible:border-amber-400",primary:"text-violet-700 accent-violet-500 hover:border-violet-400 focus-visible:border-violet-400",secondary:"text-slate-700 accent-slate-600 hover:border-slate-500 focus-visible:border-slate-500",success:"text-emerald-700 accent-emerald-500 hover:border-emerald-400 focus-visible:border-emerald-400"},fn={info:"focus-within:border-sky-400",danger:"focus-within:border-red-400",default:"focus-within:border-slate-400",warning:"focus-within:border-amber-400",primary:"focus-within:border-violet-400",secondary:"focus-within:border-slate-500",success:"focus-within:border-emerald-400"},mn=({id:t,name:e,label:r,description:s,checked:a,onChange:n,className:o="",disabled:i=!1,forceDarkTheme:u=!1,variant:c=X.Primary})=>{const d=un[c],p=fn[c],k=i?"cursor-not-allowed opacity-60":"cursor-pointer";return l.jsx("div",{className:u?"dark":"",children:l.jsxs("label",{htmlFor:t,className:["flex items-start gap-3 rounded-lg px-3 py-2.5 transition-colors border-transparent",p,k,o].join(" "),children:[l.jsx("input",{id:t,name:e,type:"checkbox",checked:a,disabled:i,onChange:T=>n(T.target.checked),className:["mt-0.5 h-5 w-5 rounded-md border border-slate-300 bg-slate-50 text-slate-900 outline-none transition duration-150 ease-in-out","focus:outline-none focus-visible:border-slate-400 dark:border-gray-600 dark:bg-gray-700 dark:focus-visible:border-slate-300",d,k].join(" ")}),l.jsxs("span",{className:"space-y-1 select-none",children:[r?l.jsx("span",{className:"block text-sm font-semibold text-gray-700 dark:text-slate-100",children:r}):null,s?l.jsx("span",{className:"block text-xs text-gray-600 dark:text-gray-300",children:s}):null]})]})})},hn={info:"bg-sky-500",danger:"bg-red-600",default:"bg-slate-500",warning:"bg-amber-500",primary:"bg-violet-600",secondary:"bg-slate-600",success:"bg-emerald-600"},pn={info:"focus-visible:border-sky-400",danger:"focus-visible:border-red-400",default:"focus-visible:border-slate-400",warning:"focus-visible:border-amber-400",primary:"focus-visible:border-violet-500",secondary:"focus-visible:border-slate-500",success:"focus-visible:border-emerald-400"},gn=({id:t,name:e,label:r,description:s,checked:a,onChange:n,className:o="",disabled:i=!1,forceDarkTheme:u=!1,variant:c=X.Primary})=>{const d=a?hn[c]:"bg-gray-200 dark:bg-gray-700",p=i?"opacity-60 cursor-not-allowed":"cursor-pointer";return l.jsxs("div",{className:[u?"dark":"","flex items-center gap-3"].join(" "),children:[l.jsx("button",{id:t,name:e,type:"button",role:"switch","aria-checked":a,"aria-disabled":i,onClick:()=>i?null:n(!a),className:["relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors border border-transparent focus:outline-none focus-visible:shadow-sm",d,pn[c],p,o].join(" "),children:l.jsx("span",{"aria-hidden":"true",className:["inline-block h-5 w-5 transform rounded-full bg-slate-50 shadow transition",a?"translate-x-5":"translate-x-1"].join(" ")})}),(r||s)&&l.jsxs("div",{className:"space-y-0.5",children:[r?l.jsx("label",{htmlFor:t,className:["text-sm font-semibold text-slate-900 dark:text-slate-100",p].join(" "),children:r}):null,s?l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300",children:s}):null]})]})},yn={info:"text-sky-600 accent-sky-500 hover:border-sky-400 focus-visible:border-sky-400",danger:"text-red-600 accent-red-500 hover:border-red-400 focus-visible:border-red-400",default:"text-slate-700 accent-slate-500 hover:border-slate-400 focus-visible:border-slate-400",warning:"text-amber-600 accent-amber-500 hover:border-amber-400 focus-visible:border-amber-400",primary:"text-violet-700 accent-violet-500 hover:border-violet-400 focus-visible:border-violet-400",secondary:"text-slate-700 accent-slate-600 hover:border-slate-500 focus-visible:border-slate-500",success:"text-emerald-700 accent-emerald-500 hover:border-emerald-400 focus-visible:border-emerald-400"},bn={info:"focus-within:border-sky-400",danger:"focus-within:border-red-400",default:"focus-within:border-slate-400",warning:"focus-within:border-amber-400",primary:"focus-within:border-violet-400",secondary:"focus-within:border-slate-500",success:"focus-within:border-emerald-400"},xn=({name:t,label:e,options:r,value:s,onChange:a,className:n="",disabled:o=!1,forceDarkTheme:i=!1,orientation:u="vertical",variant:c=X.Primary})=>{const d=u==="horizontal"?"flex-row flex-wrap gap-4":"flex-col gap-3";return l.jsxs("fieldset",{className:[i?"dark":"",n].join(" "),children:[e?l.jsx("legend",{className:"text-sm font-semibold text-gray-700 dark:text-slate-100",children:e}):null,l.jsx("div",{className:["flex",d].join(" "),children:r.map(p=>{const k=String(s)===String(p.value),T=o||p.disabled,m=yn[c],h=bn[c],g=T?"cursor-not-allowed opacity-60":"cursor-pointer";return l.jsxs("label",{className:["flex items-start gap-2 rounded-lg px-3 py-2.5 shadow-sm dark:shadow-none transition-colors border border-transparent",h,g].join(" "),children:[l.jsx("input",{type:"radio",name:t,value:String(p.value),checked:k,disabled:T,onChange:v=>a(v.target.value),className:["mt-0.5 h-5 w-5 rounded-full border border-slate-300 bg-slate-50 text-slate-900 outline-none transition duration-150 ease-in-out","focus:outline-none focus-visible:border-slate-400 dark:border-gray-600 dark:bg-gray-700 dark:focus-visible:border-slate-300",m,g].join(" ")}),l.jsxs("span",{className:"space-y-1",children:[l.jsx("span",{className:"block text-sm font-semibold text-gray-700 dark:text-slate-100",children:p.label}),p.description?l.jsx("span",{className:"block text-xs text-gray-600 dark:text-gray-300",children:p.description}):null]})]},String(p.value))})})]})},vn={info:"focus:border-sky-400 focus-visible:border-sky-400",danger:"focus:border-red-400 focus-visible:border-red-400",default:"focus:border-slate-400 focus-visible:border-slate-400",warning:"focus:border-amber-400 focus-visible:border-amber-400",primary:"focus:border-violet-400 focus-visible:border-violet-400 dark:focus:border-slate-300 dark:focus-visible:border-slate-300",secondary:"focus:border-slate-400 focus-visible:border-slate-400",success:"focus:border-emerald-400 focus-visible:border-emerald-400"},_n={xs:"px-2 py-2 text-xs",small:"px-3 py-2.5 text-sm",medium:"px-3.5 py-3 text-sm",large:"px-4 py-3.5 text-base"},kn={xs:"text-[10px] px-1.5 py-0.5",small:"text-xs px-2 py-0.5",medium:"text-xs px-2 py-1",large:"text-sm px-2.5 py-1"},wn=({id:t,name:e,label:r,options:s,onChange:a,groupedOptions:n,selectedValues:o,dropdownMaxHeight:i="60vh",placeholder:u="Select option(s)",disabled:c=!1,variant:d=X.Primary,size:p=le.Small,forceDarkTheme:k=!1,className:T="",searchable:m=!0,showSelectAll:h=!0,emptyStateLabel:g="No results found"})=>{const[v,x]=y.useState(!1),[b,w]=y.useState(""),A=y.useRef(null),D=y.useRef(null),j=y.useMemo(()=>o.map(L=>String(L)),[o]),E=y.useMemo(()=>n&&Object.keys(n).length>0?Object.values(n).flat():s??[],[n,s]),$=y.useMemo(()=>E.map(L=>String(L.value)),[E]),V=y.useMemo(()=>$.length>0&&$.every(L=>j.includes(L)),[$,j]),q=()=>!c&&x(L=>!L),W=y.useCallback(L=>{A.current&&!A.current.contains(L.target)&&x(!1)},[]);y.useEffect(()=>{if(v)return document.addEventListener("mousedown",W),()=>document.removeEventListener("mousedown",W)},[W,v]),y.useEffect(()=>{v&&D.current&&m&&D.current.focus()},[v,m]);const K=L=>{a(Array.from(new Set(L)))},ne=()=>{K(V?[]:$)},ge=L=>{const F=L.map(oe=>String(oe.value)),me=F.every(oe=>j.includes(oe));K(me?j.filter(oe=>!F.includes(oe)):[...j,...F])},H=L=>{const F=j.includes(L);K(F?j.filter(me=>me!==L):[...j,L])},te=y.useMemo(()=>E.filter(L=>j.includes(String(L.value))),[E,j]),Q=y.useMemo(()=>{if(!te.length)return u;const[L,...F]=te;return F.length?`${L.label} +${F.length} more`:L.label},[te,u]),Ve=y.useMemo(()=>{const L=b.toLowerCase();return E.filter(F=>String(F.label).toLowerCase().includes(L))},[E,b]),lt=y.useMemo(()=>{if(!n)return;const L=b.toLowerCase(),F={};return Object.entries(n).forEach(([me,oe])=>{const dr=oe.filter(Hs=>String(Hs.label).toLowerCase().includes(L));dr.length>0&&(F[me]=dr)}),Object.keys(F).length>0?F:void 0},[n,b]),fe=y.useMemo(()=>typeof i=="number"?{maxHeight:`${i}px`}:{maxHeight:i},[i]),xe=_n[p],qe=kn[p],Re=v?"border border-slate-300 dark:border-slate-500 shadow-sm":"border border-slate-200 dark:border-slate-600 shadow-sm",He=L=>{const F=String(L.value),me=j.includes(F);return l.jsxs("li",{className:`flex items-center gap-2 px-3 py-2 cursor-pointer hover:bg-slate-200 dark:hover:bg-slate-800 ${me?"bg-slate-100 dark:bg-slate-700":""}`,onClick:()=>H(F),children:[l.jsx("input",{type:"checkbox",readOnly:!0,checked:me,className:"w-5 h-5 rounded-md border border-slate-300 bg-slate-50 text-violet-600 accent-violet-500 outline-none transition duration-150 ease-in-out cursor-pointer hover:border-violet-400 focus-visible:border-violet-400 dark:text-slate-100 dark:accent-slate-100 dark:hover:border-slate-400 dark:focus-visible:border-slate-300 disabled:opacity-60 disabled:cursor-not-allowed"}),l.jsx("span",{className:"text-sm text-slate-800 dark:text-slate-100",children:L.label})]},F)};return l.jsxs("div",{className:k?"dark":"",children:[r?l.jsx("label",{htmlFor:t,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:r}):null,l.jsxs("div",{ref:A,className:`relative ${T}`,"aria-expanded":v,"aria-haspopup":"listbox",children:[l.jsxs("button",{type:"button",id:t,name:e,disabled:c,onClick:q,className:`w-full flex items-center justify-between gap-2 rounded-md bg-slate-50 dark:bg-gray-700 text-slate-900 dark:text-slate-100 border border-slate-200 dark:border-slate-500 focus:outline-none focus-visible:shadow-sm disabled:cursor-not-allowed disabled:opacity-60 transition-colors ${vn[d]} ${xe} ${Re}`,children:[l.jsx("div",{className:"flex flex-wrap items-center gap-2 min-h-6 flex-1",children:te.length?te.map(L=>l.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full bg-violet-600 text-slate-50 dark:bg-slate-500 dark:text-slate-100 ${qe}`,children:[L.label,l.jsx("span",{role:"button",tabIndex:0,className:"text-xs font-semibold hover:text-violet-900 dark:hover:text-slate-50 cursor-pointer",onClick:F=>{F.stopPropagation(),H(String(L.value))},onKeyDown:F=>{(F.key==="Enter"||F.key===" ")&&(F.stopPropagation(),F.preventDefault(),H(String(L.value)))},children:"×"})]},String(L.value))):l.jsx("span",{className:"text-sm text-slate-500 dark:text-slate-400",children:Q})}),l.jsx("span",{className:"pointer-events-none text-gray-500 dark:text-gray-300",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"none",className:"h-4 w-4",stroke:"currentColor",strokeWidth:"1.5",children:l.jsx("path",{d:"M6 8l4 4 4-4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),v?l.jsxs("div",{className:"absolute left-0 right-0 mt-2 rounded-md bg-slate-50 dark:bg-slate-900 border border-gray-200 dark:border-gray-700 shadow-lg z-20",children:[m?l.jsx("div",{className:"p-2 border-b border-gray-200 dark:border-gray-700",children:l.jsx("input",{ref:D,type:"text",placeholder:"Search options...",value:b,onChange:L=>w(L.target.value),className:"w-full rounded-md border border-gray-300 dark:border-gray-700 bg-slate-50 dark:bg-gray-800 px-3 py-2 text-sm text-slate-800 dark:text-slate-100 focus:outline-none focus:border-violet-400 focus-visible:border-violet-400 dark:focus:border-slate-300 dark:focus-visible:border-slate-300 transition-colors",onClick:L=>L.stopPropagation()})}):null,l.jsxs("ul",{role:"listbox",style:fe,className:"max-h-[60vh] overflow-auto py-2",children:[h&&$.length>0?l.jsx("li",{className:"px-3 pb-2",children:l.jsxs("button",{type:"button",onClick:ne,className:"flex items-center gap-2 text-sm font-semibold text-slate-800 dark:text-slate-100 hover:text-violet-600 dark:hover:text-slate-100",children:[l.jsx("input",{readOnly:!0,type:"checkbox",checked:V,className:"w-5 h-5 rounded-md border border-slate-300 bg-slate-50 text-violet-600 accent-violet-500 outline-none transition duration-150 ease-in-out cursor-pointer hover:border-violet-400 focus-visible:border-violet-400 dark:text-slate-100 dark:accent-slate-100 dark:hover:border-slate-400 dark:focus-visible:border-slate-300 disabled:opacity-60 disabled:cursor-not-allowed"}),"Select all"]})}):null,lt?Object.entries(lt).map(([L,F])=>{const me=F.map(oe=>String(oe.value)).every(oe=>j.includes(oe));return l.jsxs("li",{className:"py-1",children:[l.jsxs("button",{type:"button",className:"w-full flex items-center gap-2 px-3 py-2 text-sm font-semibold text-slate-700 dark:text-slate-200 hover:bg-slate-200 dark:hover:bg-slate-800",onClick:()=>ge(F),children:[l.jsx("input",{type:"checkbox",checked:me,readOnly:!0,className:"w-5 h-5 rounded-md border border-slate-300 bg-slate-50 text-violet-600 accent-violet-500 outline-none transition duration-150 ease-in-out cursor-pointer hover:border-violet-400 focus-visible:border-violet-400 dark:text-slate-100 dark:accent-slate-100 dark:hover:border-slate-400 dark:focus-visible:border-slate-300 disabled:opacity-60 disabled:cursor-not-allowed"}),L]}),l.jsx("ul",{className:"mt-1 border-l border-gray-200 dark:border-gray-700 ml-5",children:F.map(oe=>He(oe))})]},L)}):Ve.length>0?Ve.map(L=>He(L)):l.jsx("li",{className:"px-3 py-4 text-sm text-slate-500 dark:text-slate-400",children:g})]})]}):null]})]})};function ls(t){var e,r,s="";if(typeof t=="string"||typeof t=="number")s+=t;else if(typeof t=="object")if(Array.isArray(t)){var a=t.length;for(e=0;e<a;e++)t[e]&&(r=ls(t[e]))&&(s&&(s+=" "),s+=r)}else for(r in t)t[r]&&(s&&(s+=" "),s+=r);return s}function je(){for(var t,e,r=0,s="",a=arguments.length;r<a;r++)(t=arguments[r])&&(e=ls(t))&&(s&&(s+=" "),s+=e);return s}function Tn(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e.firstChild?e.insertBefore(r,e.firstChild):e.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}Tn(`:root{--toastify-color-light: #fff;--toastify-color-dark: #121212;--toastify-color-info: #3498db;--toastify-color-success: #07bc0c;--toastify-color-warning: #f1c40f;--toastify-color-error: hsl(6, 78%, 57%);--toastify-color-transparent: rgba(255, 255, 255, .7);--toastify-icon-color-info: var(--toastify-color-info);--toastify-icon-color-success: var(--toastify-color-success);--toastify-icon-color-warning: var(--toastify-color-warning);--toastify-icon-color-error: var(--toastify-color-error);--toastify-container-width: fit-content;--toastify-toast-width: 320px;--toastify-toast-offset: 16px;--toastify-toast-top: max(var(--toastify-toast-offset), env(safe-area-inset-top));--toastify-toast-right: max(var(--toastify-toast-offset), env(safe-area-inset-right));--toastify-toast-left: max(var(--toastify-toast-offset), env(safe-area-inset-left));--toastify-toast-bottom: max(var(--toastify-toast-offset), env(safe-area-inset-bottom));--toastify-toast-background: #fff;--toastify-toast-padding: 14px;--toastify-toast-min-height: 64px;--toastify-toast-max-height: 800px;--toastify-toast-bd-radius: 6px;--toastify-toast-shadow: 0px 4px 12px rgba(0, 0, 0, .1);--toastify-font-family: sans-serif;--toastify-z-index: 9999;--toastify-text-color-light: #757575;--toastify-text-color-dark: #fff;--toastify-text-color-info: #fff;--toastify-text-color-success: #fff;--toastify-text-color-warning: #fff;--toastify-text-color-error: #fff;--toastify-spinner-color: #616161;--toastify-spinner-color-empty-area: #e0e0e0;--toastify-color-progress-light: linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55);--toastify-color-progress-dark: #bb86fc;--toastify-color-progress-info: var(--toastify-color-info);--toastify-color-progress-success: var(--toastify-color-success);--toastify-color-progress-warning: var(--toastify-color-warning);--toastify-color-progress-error: var(--toastify-color-error);--toastify-color-progress-bgo: .2}.Toastify__toast-container{z-index:var(--toastify-z-index);-webkit-transform:translate3d(0,0,var(--toastify-z-index));position:fixed;width:var(--toastify-container-width);box-sizing:border-box;color:#fff;display:flex;flex-direction:column}.Toastify__toast-container--top-left{top:var(--toastify-toast-top);left:var(--toastify-toast-left)}.Toastify__toast-container--top-center{top:var(--toastify-toast-top);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--top-right{top:var(--toastify-toast-top);right:var(--toastify-toast-right);align-items:end}.Toastify__toast-container--bottom-left{bottom:var(--toastify-toast-bottom);left:var(--toastify-toast-left)}.Toastify__toast-container--bottom-center{bottom:var(--toastify-toast-bottom);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--bottom-right{bottom:var(--toastify-toast-bottom);right:var(--toastify-toast-right);align-items:end}.Toastify__toast{--y: 0;position:relative;touch-action:none;width:var(--toastify-toast-width);min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:var(--toastify-toast-padding);border-radius:var(--toastify-toast-bd-radius);box-shadow:var(--toastify-toast-shadow);max-height:var(--toastify-toast-max-height);font-family:var(--toastify-font-family);z-index:0;display:flex;flex:1 auto;align-items:center;word-break:break-word}@media only screen and (max-width: 480px){.Toastify__toast-container{width:100vw;left:env(safe-area-inset-left);margin:0}.Toastify__toast-container--top-left,.Toastify__toast-container--top-center,.Toastify__toast-container--top-right{top:env(safe-area-inset-top);transform:translate(0)}.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-right{bottom:env(safe-area-inset-bottom);transform:translate(0)}.Toastify__toast-container--rtl{right:env(safe-area-inset-right);left:initial}.Toastify__toast{--toastify-toast-width: 100%;margin-bottom:0;border-radius:0}}.Toastify__toast-container[data-stacked=true]{width:var(--toastify-toast-width)}.Toastify__toast--stacked{position:absolute;width:100%;transform:translate3d(0,var(--y),0) scale(var(--s));transition:transform .3s}.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body,.Toastify__toast--stacked[data-collapsed] .Toastify__close-button{transition:opacity .1s}.Toastify__toast--stacked[data-collapsed=false]{overflow:visible}.Toastify__toast--stacked[data-collapsed=true]:not(:last-child)>*{opacity:0}.Toastify__toast--stacked:after{content:"";position:absolute;left:0;right:0;height:calc(var(--g) * 1px);bottom:100%}.Toastify__toast--stacked[data-pos=top]{top:0}.Toastify__toast--stacked[data-pos=bot]{bottom:0}.Toastify__toast--stacked[data-pos=bot].Toastify__toast--stacked:before{transform-origin:top}.Toastify__toast--stacked[data-pos=top].Toastify__toast--stacked:before{transform-origin:bottom}.Toastify__toast--stacked:before{content:"";position:absolute;left:0;right:0;bottom:0;height:100%;transform:scaleY(3);z-index:-1}.Toastify__toast--rtl{direction:rtl}.Toastify__toast--close-on-click{cursor:pointer}.Toastify__toast-icon{margin-inline-end:10px;width:22px;flex-shrink:0;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.5s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--light,.Toastify__toast-theme--colored.Toastify__toast--default{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;position:absolute;top:6px;right:6px;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;z-index:1}.Toastify__toast--rtl .Toastify__close-button{left:6px;right:unset}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:hover,.Toastify__close-button:focus{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:100%;z-index:1;opacity:.7;transform-origin:left}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:initial;transform-origin:right;border-bottom-left-radius:initial}.Toastify__progress-bar--wrp{position:absolute;overflow:hidden;bottom:0;left:0;width:100%;height:5px;border-bottom-left-radius:var(--toastify-toast-bd-radius);border-bottom-right-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp[data-hidden=true]{opacity:0}.Toastify__progress-bar--bg{opacity:var(--toastify-color-progress-bgo);width:100%;height:100%}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,var(--y),0)}to{opacity:0;transform:translate3d(2000px,var(--y),0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,var(--y),0)}to{opacity:0;transform:translate3d(-2000px,var(--y),0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--top-left,.Toastify__bounce-enter--bottom-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--top-right,.Toastify__bounce-enter--bottom-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--top-left,.Toastify__bounce-exit--bottom-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--top-right,.Toastify__bounce-exit--bottom-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:translate3d(0,var(--y),0) scale3d(.3,.3,.3)}to{opacity:0}}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:translate3d(0,var(--y),0) perspective(400px)}30%{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(-20deg);opacity:1}to{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideOutRight{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(110%,var(--y),0)}}@keyframes Toastify__slideOutLeft{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(-110%,var(--y),0)}}@keyframes Toastify__slideOutDown{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--top-left,.Toastify__slide-enter--bottom-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--top-right,.Toastify__slide-enter--bottom-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--top-left,.Toastify__slide-exit--bottom-left{animation-name:Toastify__slideOutLeft;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-right,.Toastify__slide-exit--bottom-right{animation-name:Toastify__slideOutRight;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown;animation-timing-function:ease-in;animation-duration:.3s}@keyframes Toastify__spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}
2
- `);var tt=t=>typeof t=="number"&&!isNaN(t),Ce=t=>typeof t=="string",ye=t=>typeof t=="function",Nn=t=>Ce(t)||tt(t),zt=t=>Ce(t)||ye(t)?t:null,jn=(t,e)=>t===!1||tt(t)&&t>0?t:e,Dt=t=>y.isValidElement(t)||Ce(t)||ye(t)||tt(t);function Sn(t,e,r=300){let{scrollHeight:s,style:a}=t;requestAnimationFrame(()=>{a.minHeight="initial",a.height=s+"px",a.transition=`all ${r}ms`,requestAnimationFrame(()=>{a.height="0",a.padding="0",a.margin="0",setTimeout(e,r)})})}function Cn({enter:t,exit:e,appendPosition:r=!1,collapse:s=!0,collapseDuration:a=300}){return function({children:n,position:o,preventExitTransition:i,done:u,nodeRef:c,isIn:d,playToast:p}){let k=r?`${t}--${o}`:t,T=r?`${e}--${o}`:e,m=y.useRef(0);return y.useLayoutEffect(()=>{let h=c.current,g=k.split(" "),v=x=>{x.target===c.current&&(p(),h.removeEventListener("animationend",v),h.removeEventListener("animationcancel",v),m.current===0&&x.type!=="animationcancel"&&h.classList.remove(...g))};h.classList.add(...g),h.addEventListener("animationend",v),h.addEventListener("animationcancel",v)},[]),y.useEffect(()=>{let h=c.current,g=()=>{h.removeEventListener("animationend",g),s?Sn(h,u,a):u()};d||(i?g():(m.current=1,h.className+=` ${T}`,h.addEventListener("animationend",g)))},[d]),y.createElement(y.Fragment,null,n)}}function hr(t,e){return{content:cs(t.content,t.props),containerId:t.props.containerId,id:t.props.toastId,theme:t.props.theme,type:t.props.type,data:t.props.data||{},isLoading:t.props.isLoading,icon:t.props.icon,reason:t.removalReason,status:e}}function cs(t,e,r=!1){return y.isValidElement(t)&&!Ce(t.type)?y.cloneElement(t,{closeToast:e.closeToast,toastProps:e,data:e.data,isPaused:r}):ye(t)?t({closeToast:e.closeToast,toastProps:e,data:e.data,isPaused:r}):t}function En({closeToast:t,theme:e,ariaLabel:r="close"}){return y.createElement("button",{className:`Toastify__close-button Toastify__close-button--${e}`,type:"button",onClick:s=>{s.stopPropagation(),t(!0)},"aria-label":r},y.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},y.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function On({delay:t,isRunning:e,closeToast:r,type:s="default",hide:a,className:n,controlledProgress:o,progress:i,rtl:u,isIn:c,theme:d}){let p=a||o&&i===0,k={animationDuration:`${t}ms`,animationPlayState:e?"running":"paused"};o&&(k.transform=`scaleX(${i})`);let T=je("Toastify__progress-bar",o?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${d}`,`Toastify__progress-bar--${s}`,{"Toastify__progress-bar--rtl":u}),m=ye(n)?n({rtl:u,type:s,defaultClassName:T}):je(T,n),h={[o&&i>=1?"onTransitionEnd":"onAnimationEnd"]:o&&i<1?null:()=>{c&&r()}};return y.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":p},y.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${d} Toastify__progress-bar--${s}`}),y.createElement("div",{role:"progressbar","aria-hidden":p?"true":"false","aria-label":"notification timer",className:m,style:k,...h}))}var Rn=1,ds=()=>`${Rn++}`;function An(t,e,r){let s=1,a=0,n=[],o=[],i=e,u=new Map,c=new Set,d=x=>(c.add(x),()=>c.delete(x)),p=()=>{o=Array.from(u.values()),c.forEach(x=>x())},k=({containerId:x,toastId:b,updateId:w})=>{let A=x?x!==t:t!==1,D=u.has(b)&&w==null;return A||D},T=(x,b)=>{u.forEach(w=>{var A;(b==null||b===w.props.toastId)&&((A=w.toggle)==null||A.call(w,x))})},m=x=>{var b,w;(w=(b=x.props)==null?void 0:b.onClose)==null||w.call(b,x.removalReason),x.isActive=!1},h=x=>{if(x==null)u.forEach(m);else{let b=u.get(x);b&&m(b)}p()},g=()=>{a-=n.length,n=[]},v=x=>{var b,w;let{toastId:A,updateId:D}=x.props,j=D==null;x.staleId&&u.delete(x.staleId),x.isActive=!0,u.set(A,x),p(),r(hr(x,j?"added":"updated")),j&&((w=(b=x.props).onOpen)==null||w.call(b))};return{id:t,props:i,observe:d,toggle:T,removeToast:h,toasts:u,clearQueue:g,buildToast:(x,b)=>{if(k(b))return;let{toastId:w,updateId:A,data:D,staleId:j,delay:E}=b,$=A==null;$&&a++;let V={...i,style:i.toastStyle,key:s++,...Object.fromEntries(Object.entries(b).filter(([W,K])=>K!=null)),toastId:w,updateId:A,data:D,isIn:!1,className:zt(b.className||i.toastClassName),progressClassName:zt(b.progressClassName||i.progressClassName),autoClose:b.isLoading?!1:jn(b.autoClose,i.autoClose),closeToast(W){u.get(w).removalReason=W,h(w)},deleteToast(){let W=u.get(w);if(W!=null){if(r(hr(W,"removed")),u.delete(w),a--,a<0&&(a=0),n.length>0){v(n.shift());return}p()}}};V.closeButton=i.closeButton,b.closeButton===!1||Dt(b.closeButton)?V.closeButton=b.closeButton:b.closeButton===!0&&(V.closeButton=Dt(i.closeButton)?i.closeButton:!0);let q={content:x,props:V,staleId:j};i.limit&&i.limit>0&&a>i.limit&&$?n.push(q):tt(E)?setTimeout(()=>{v(q)},E):v(q)},setProps(x){i=x},setToggle:(x,b)=>{let w=u.get(x);w&&(w.toggle=b)},isToastActive:x=>{var b;return(b=u.get(x))==null?void 0:b.isActive},getSnapshot:()=>o}}var ee=new Map,Ge=[],Ft=new Set,Ln=t=>Ft.forEach(e=>e(t)),us=()=>ee.size>0;function In(){Ge.forEach(t=>ms(t.content,t.options)),Ge=[]}var $n=(t,{containerId:e})=>{var r;return(r=ee.get(e||1))==null?void 0:r.toasts.get(t)};function fs(t,e){var r;if(e)return!!((r=ee.get(e))!=null&&r.isToastActive(t));let s=!1;return ee.forEach(a=>{a.isToastActive(t)&&(s=!0)}),s}function Pn(t){if(!us()){Ge=Ge.filter(e=>t!=null&&e.options.toastId!==t);return}if(t==null||Nn(t))ee.forEach(e=>{e.removeToast(t)});else if(t&&("containerId"in t||"id"in t)){let e=ee.get(t.containerId);e?e.removeToast(t.id):ee.forEach(r=>{r.removeToast(t.id)})}}var Mn=(t={})=>{ee.forEach(e=>{e.props.limit&&(!t.containerId||e.id===t.containerId)&&e.clearQueue()})};function ms(t,e){Dt(t)&&(us()||Ge.push({content:t,options:e}),ee.forEach(r=>{r.buildToast(t,e)}))}function Bn(t){var e;(e=ee.get(t.containerId||1))==null||e.setToggle(t.id,t.fn)}function hs(t,e){ee.forEach(r=>{(e==null||!(e!=null&&e.containerId)||e?.containerId===r.id)&&r.toggle(t,e?.id)})}function zn(t){let e=t.containerId||1;return{subscribe(r){let s=An(e,t,Ln);ee.set(e,s);let a=s.observe(r);return In(),()=>{a(),ee.delete(e)}},setProps(r){var s;(s=ee.get(e))==null||s.setProps(r)},getSnapshot(){var r;return(r=ee.get(e))==null?void 0:r.getSnapshot()}}}function Dn(t){return Ft.add(t),()=>{Ft.delete(t)}}function Fn(t){return t&&(Ce(t.toastId)||tt(t.toastId))?t.toastId:ds()}function rt(t,e){return ms(t,e),e.toastId}function kt(t,e){return{...e,type:e&&e.type||t,toastId:Fn(e)}}function wt(t){return(e,r)=>rt(e,kt(t,r))}function z(t,e){return rt(t,kt("default",e))}z.loading=(t,e)=>rt(t,kt("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...e}));function Un(t,{pending:e,error:r,success:s},a){let n;e&&(n=Ce(e)?z.loading(e,a):z.loading(e.render,{...a,...e}));let o={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},i=(c,d,p)=>{if(d==null){z.dismiss(n);return}let k={type:c,...o,...a,data:p},T=Ce(d)?{render:d}:d;return n?z.update(n,{...k,...T}):z(T.render,{...k,...T}),p},u=ye(t)?t():t;return u.then(c=>i("success",s,c)).catch(c=>i("error",r,c)),u}z.promise=Un;z.success=wt("success");z.info=wt("info");z.error=wt("error");z.warning=wt("warning");z.warn=z.warning;z.dark=(t,e)=>rt(t,kt("default",{theme:"dark",...e}));function Zn(t){Pn(t)}z.dismiss=Zn;z.clearWaitingQueue=Mn;z.isActive=fs;z.update=(t,e={})=>{let r=$n(t,e);if(r){let{props:s,content:a}=r,n={delay:100,...s,...e,toastId:e.toastId||t,updateId:ds()};n.toastId!==t&&(n.staleId=t);let o=n.render||a;delete n.render,rt(o,n)}};z.done=t=>{z.update(t,{progress:1})};z.onChange=Dn;z.play=t=>hs(!0,t);z.pause=t=>hs(!1,t);function Vn(t){var e;let{subscribe:r,getSnapshot:s,setProps:a}=y.useRef(zn(t)).current;a(t);let n=(e=y.useSyncExternalStore(r,s,s))==null?void 0:e.slice();function o(i){if(!n)return[];let u=new Map;return t.newestOnTop&&n.reverse(),n.forEach(c=>{let{position:d}=c.props;u.has(d)||u.set(d,[]),u.get(d).push(c)}),Array.from(u,c=>i(c[0],c[1]))}return{getToastToRender:o,isToastActive:fs,count:n?.length}}function qn(t){let[e,r]=y.useState(!1),[s,a]=y.useState(!1),n=y.useRef(null),o=y.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:i,pauseOnHover:u,closeToast:c,onClick:d,closeOnClick:p}=t;Bn({id:t.toastId,containerId:t.containerId,fn:r}),y.useEffect(()=>{if(t.pauseOnFocusLoss)return k(),()=>{T()}},[t.pauseOnFocusLoss]);function k(){document.hasFocus()||v(),window.addEventListener("focus",g),window.addEventListener("blur",v)}function T(){window.removeEventListener("focus",g),window.removeEventListener("blur",v)}function m(j){if(t.draggable===!0||t.draggable===j.pointerType){x();let E=n.current;o.canCloseOnClick=!0,o.canDrag=!0,E.style.transition="none",t.draggableDirection==="x"?(o.start=j.clientX,o.removalDistance=E.offsetWidth*(t.draggablePercent/100)):(o.start=j.clientY,o.removalDistance=E.offsetHeight*(t.draggablePercent===80?t.draggablePercent*1.5:t.draggablePercent)/100)}}function h(j){let{top:E,bottom:$,left:V,right:q}=n.current.getBoundingClientRect();j.nativeEvent.type!=="touchend"&&t.pauseOnHover&&j.clientX>=V&&j.clientX<=q&&j.clientY>=E&&j.clientY<=$?v():g()}function g(){r(!0)}function v(){r(!1)}function x(){o.didMove=!1,document.addEventListener("pointermove",w),document.addEventListener("pointerup",A)}function b(){document.removeEventListener("pointermove",w),document.removeEventListener("pointerup",A)}function w(j){let E=n.current;if(o.canDrag&&E){o.didMove=!0,e&&v(),t.draggableDirection==="x"?o.delta=j.clientX-o.start:o.delta=j.clientY-o.start,o.start!==j.clientX&&(o.canCloseOnClick=!1);let $=t.draggableDirection==="x"?`${o.delta}px, var(--y)`:`0, calc(${o.delta}px + var(--y))`;E.style.transform=`translate3d(${$},0)`,E.style.opacity=`${1-Math.abs(o.delta/o.removalDistance)}`}}function A(){b();let j=n.current;if(o.canDrag&&o.didMove&&j){if(o.canDrag=!1,Math.abs(o.delta)>o.removalDistance){a(!0),t.closeToast(!0),t.collapseAll();return}j.style.transition="transform 0.2s, opacity 0.2s",j.style.removeProperty("transform"),j.style.removeProperty("opacity")}}let D={onPointerDown:m,onPointerUp:h};return i&&u&&(D.onMouseEnter=v,t.stacked||(D.onMouseLeave=g)),p&&(D.onClick=j=>{d&&d(j),o.canCloseOnClick&&c(!0)}),{playToast:g,pauseToast:v,isRunning:e,preventExitTransition:s,toastRef:n,eventHandlers:D}}var Hn=typeof window<"u"?y.useLayoutEffect:y.useEffect,Tt=({theme:t,type:e,isLoading:r,...s})=>y.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${e})`,...s});function Wn(t){return y.createElement(Tt,{...t},y.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))}function Jn(t){return y.createElement(Tt,{...t},y.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))}function Xn(t){return y.createElement(Tt,{...t},y.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))}function Gn(t){return y.createElement(Tt,{...t},y.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))}function Kn(){return y.createElement("div",{className:"Toastify__spinner"})}var Ut={info:Jn,warning:Wn,success:Xn,error:Gn,spinner:Kn},Yn=t=>t in Ut;function Qn({theme:t,type:e,isLoading:r,icon:s}){let a=null,n={theme:t,type:e};return s===!1||(ye(s)?a=s({...n,isLoading:r}):y.isValidElement(s)?a=y.cloneElement(s,n):r?a=Ut.spinner():Yn(e)&&(a=Ut[e](n))),a}var eo=t=>{let{isRunning:e,preventExitTransition:r,toastRef:s,eventHandlers:a,playToast:n}=qn(t),{closeButton:o,children:i,autoClose:u,onClick:c,type:d,hideProgressBar:p,closeToast:k,transition:T,position:m,className:h,style:g,progressClassName:v,updateId:x,role:b,progress:w,rtl:A,toastId:D,deleteToast:j,isIn:E,isLoading:$,closeOnClick:V,theme:q,ariaLabel:W}=t,K=je("Toastify__toast",`Toastify__toast-theme--${q}`,`Toastify__toast--${d}`,{"Toastify__toast--rtl":A},{"Toastify__toast--close-on-click":V}),ne=ye(h)?h({rtl:A,position:m,type:d,defaultClassName:K}):je(K,h),ge=Qn(t),H=!!w||!u,te={closeToast:k,type:d,theme:q},Q=null;return o===!1||(ye(o)?Q=o(te):y.isValidElement(o)?Q=y.cloneElement(o,te):Q=En(te)),y.createElement(T,{isIn:E,done:j,position:m,preventExitTransition:r,nodeRef:s,playToast:n},y.createElement("div",{id:D,tabIndex:0,onClick:c,"data-in":E,className:ne,...a,style:g,ref:s,...E&&{role:b,"aria-label":W}},ge!=null&&y.createElement("div",{className:je("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!$})},ge),cs(i,t,!e),Q,!t.customProgressBar&&y.createElement(On,{...x&&!H?{key:`p-${x}`}:{},rtl:A,theme:q,delay:u,isRunning:e,isIn:E,closeToast:k,hide:p,type:d,className:v,controlledProgress:H,progress:w||0})))},to=(t,e=!1)=>({enter:`Toastify--animate Toastify__${t}-enter`,exit:`Toastify--animate Toastify__${t}-exit`,appendPosition:e}),ro=Cn(to("bounce",!0)),so={position:"top-right",transition:ro,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light","aria-label":"Notifications Alt+T",hotKeys:t=>t.altKey&&t.code==="KeyT"};function ao(t){let e={...so,...t},r=t.stacked,[s,a]=y.useState(!0),n=y.useRef(null),{getToastToRender:o,isToastActive:i,count:u}=Vn(e),{className:c,style:d,rtl:p,containerId:k,hotKeys:T}=e;function m(g){let v=je("Toastify__toast-container",`Toastify__toast-container--${g}`,{"Toastify__toast-container--rtl":p});return ye(c)?c({position:g,rtl:p,defaultClassName:v}):je(v,zt(c))}function h(){r&&(a(!0),z.play())}return Hn(()=>{var g;if(r){let v=n.current.querySelectorAll('[data-in="true"]'),x=12,b=(g=e.position)==null?void 0:g.includes("top"),w=0,A=0;Array.from(v).reverse().forEach((D,j)=>{let E=D;E.classList.add("Toastify__toast--stacked"),j>0&&(E.dataset.collapsed=`${s}`),E.dataset.pos||(E.dataset.pos=b?"top":"bot");let $=w*(s?.2:1)+(s?0:x*j);E.style.setProperty("--y",`${b?$:$*-1}px`),E.style.setProperty("--g",`${x}`),E.style.setProperty("--s",`${1-(s?A:0)}`),w+=E.offsetHeight,A+=.025})}},[s,u,r]),y.useEffect(()=>{function g(v){var x;let b=n.current;T(v)&&((x=b.querySelector('[tabIndex="0"]'))==null||x.focus(),a(!1),z.pause()),v.key==="Escape"&&(document.activeElement===b||b!=null&&b.contains(document.activeElement))&&(a(!0),z.play())}return document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g)}},[T]),y.createElement("section",{ref:n,className:"Toastify",id:k,onMouseEnter:()=>{r&&(a(!1),z.pause())},onMouseLeave:h,"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text","aria-label":e["aria-label"]},o((g,v)=>{let x=v.length?{...d}:{...d,pointerEvents:"none"};return y.createElement("div",{tabIndex:-1,className:m(g),"data-stacked":r,style:x,key:`c-${g}`},v.map(({content:b,props:w})=>y.createElement(eo,{...w,stacked:r,collapseAll:h,isIn:i(w.toastId,w.containerId),key:`t-${w.key}`},b)))}))}const pr=t=>{let e;const r=new Set,s=(c,d)=>{const p=typeof c=="function"?c(e):c;if(!Object.is(p,e)){const k=e;e=d??(typeof p!="object"||p===null)?p:Object.assign({},e,p),r.forEach(T=>T(e,k))}},a=()=>e,i={setState:s,getState:a,getInitialState:()=>u,subscribe:c=>(r.add(c),()=>r.delete(c))},u=e=t(s,a,i);return i},no=(t=>t?pr(t):pr),oo=t=>t;function io(t,e=oo){const r=y.useSyncExternalStore(t.subscribe,y.useCallback(()=>e(t.getState()),[t,e]),y.useCallback(()=>e(t.getInitialState()),[t,e]));return y.useDebugValue(r),r}const gr=t=>{const e=no(t),r=s=>io(e,s);return Object.assign(r,e),r},ps=(t=>t?gr(t):gr),Nt=ps(t=>({menus:[],currentMenu:null,setMenus:e=>t({menus:e}),setCurrentMenu:e=>t({currentMenu:e})})),lo=({menus:t,topNav:e,sideNav:r,children:s})=>{const{setMenus:a}=Nt();return y.useEffect(()=>{a(t)},[a]),l.jsxs(l.Fragment,{children:[r,l.jsxs("main",{className:"flex-1 flex flex-col transition-all duration-300 overflow-hidden",children:[e,l.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-4",children:s})]}),l.jsx(ao,{draggable:!0,rtl:!1,newestOnTop:!0,closeOnClick:!0,pauseOnHover:!0,autoClose:5e3,position:"top-right",hideProgressBar:!1})]})},co=({children:t})=>{const e=Xe.useLocation(),{menus:r}=Nt();let s=null;return r.length&&(s=r.find(a=>a.path===e.pathname)??null),l.jsx("div",{className:"min-h-screen",children:l.jsxs("div",{className:"space-y-4 animate-fade-in",children:[l.jsx("div",{className:"flex justify-between items-center",children:l.jsx("h2",{className:"text-2xl font-bold flex items-center",children:s?.label??"N/A"})}),t]})})};class uo{activeRequests=0;listeners=new Set;constructor(){this.setupInterceptors()}subscribe(e){return this.listeners.add(e),e(this.activeRequests>0),()=>this.listeners.delete(e)}notify(){const e=this.activeRequests>0;this.listeners.forEach(r=>r(e))}start(){this.activeRequests++,this.notify()}stop(){this.activeRequests>0&&this.activeRequests--,this.notify()}reset(){this.activeRequests=0,this.notify()}setupInterceptors(){if(typeof window>"u")return;const e=window.fetch;window.fetch=async(...a)=>{this.start();try{return await e(...a)}finally{this.stop()}};const r=XMLHttpRequest.prototype.send,s=this;XMLHttpRequest.prototype.send=function(...a){return s.start(),this.addEventListener("loadend",()=>{s.stop()}),r.apply(this,a)}}}const Pe=new uo,fo=()=>{const[t,e]=y.useState(!0);return y.useEffect(()=>{const r=Pe.subscribe(e);return()=>{r()}},[]),l.jsx(os,{open:t,message:"Loading..."})},mo=({children:t})=>l.jsxs(l.Fragment,{children:[l.jsx(fo,{}),l.jsx("div",{className:"min-h-screen bg-slate-100 dark:bg-slate-900",children:l.jsx("div",{className:"w-full h-screen flex overflow-hidden",children:t})})]}),jt={autoClose:5e3,draggable:!1,closeOnClick:!0,pauseOnHover:!0,position:"top-right",hideProgressBar:!1},gs=t=>{z.success(t,jt)},ho=t=>{z.error(t,jt)},po=t=>{z.info(t,jt)},go=t=>{z.warn(t,jt)},rr=(t,e=0)=>t?e?t.split(" ").map(r=>r[0].toUpperCase()).join("").slice(0,e):ys(t):"";function ys(t){return t.split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function yo(t,e){let r;try{r=t()}catch{return}return{getItem:a=>{var n;const o=u=>u===null?null:JSON.parse(u,void 0),i=(n=r.getItem(a))!=null?n:null;return i instanceof Promise?i.then(o):o(i)},setItem:(a,n)=>r.setItem(a,JSON.stringify(n,void 0)),removeItem:a=>r.removeItem(a)}}const Zt=t=>e=>{try{const r=t(e);return r instanceof Promise?r:{then(s){return Zt(s)(r)},catch(s){return this}}}catch(r){return{then(s){return this},catch(s){return Zt(s)(r)}}}},bo=(t,e)=>(r,s,a)=>{let n={storage:yo(()=>localStorage),partialize:h=>h,version:0,merge:(h,g)=>({...g,...h}),...e},o=!1;const i=new Set,u=new Set;let c=n.storage;if(!c)return t((...h)=>{console.warn(`[zustand persist middleware] Unable to update item '${n.name}', the given storage is currently unavailable.`),r(...h)},s,a);const d=()=>{const h=n.partialize({...s()});return c.setItem(n.name,{state:h,version:n.version})},p=a.setState;a.setState=(h,g)=>(p(h,g),d());const k=t((...h)=>(r(...h),d()),s,a);a.getInitialState=()=>k;let T;const m=()=>{var h,g;if(!c)return;o=!1,i.forEach(x=>{var b;return x((b=s())!=null?b:k)});const v=((g=n.onRehydrateStorage)==null?void 0:g.call(n,(h=s())!=null?h:k))||void 0;return Zt(c.getItem.bind(c))(n.name).then(x=>{if(x)if(typeof x.version=="number"&&x.version!==n.version){if(n.migrate){const b=n.migrate(x.state,x.version);return b instanceof Promise?b.then(w=>[!0,w]):[!0,b]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,x.state];return[!1,void 0]}).then(x=>{var b;const[w,A]=x;if(T=n.merge(A,(b=s())!=null?b:k),r(T,!0),w)return d()}).then(()=>{v?.(T,void 0),T=s(),o=!0,u.forEach(x=>x(T))}).catch(x=>{v?.(void 0,x)})};return a.persist={setOptions:h=>{n={...n,...h},h.storage&&(c=h.storage)},clearStorage:()=>{c?.removeItem(n.name)},getOptions:()=>n,rehydrate:()=>m(),hasHydrated:()=>o,onHydrate:h=>(i.add(h),()=>{i.delete(h)}),onFinishHydration:h=>(u.add(h),()=>{u.delete(h)})},n.skipHydration||m(),T||k},xo=bo;let Ie={debug:!1,apiBaseUrl:""};const vo=t=>{Ie={...Ie,...t},Ie.debug&&console.info("Package initialized with config:",Ie)},sr=()=>(Ie.apiBaseUrl||console.warn("Warning: API Base URL is not set. Make sure to call initConfig() first."),Ie);function bs(t,e){return function(){return t.apply(e,arguments)}}const{toString:_o}=Object.prototype,{getPrototypeOf:ar}=Object,{iterator:St,toStringTag:xs}=Symbol,Ct=(t=>e=>{const r=_o.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),ue=t=>(t=t.toLowerCase(),e=>Ct(e)===t),Et=t=>e=>typeof e===t,{isArray:Ue}=Array,Me=Et("undefined");function st(t){return t!==null&&!Me(t)&&t.constructor!==null&&!Me(t.constructor)&&se(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const vs=ue("ArrayBuffer");function ko(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&vs(t.buffer),e}const wo=Et("string"),se=Et("function"),_s=Et("number"),at=t=>t!==null&&typeof t=="object",To=t=>t===!0||t===!1,dt=t=>{if(Ct(t)!=="object")return!1;const e=ar(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(xs in t)&&!(St in t)},No=t=>{if(!at(t)||st(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},jo=ue("Date"),So=ue("File"),Co=ue("Blob"),Eo=ue("FileList"),Oo=t=>at(t)&&se(t.pipe),Ro=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||se(t.append)&&((e=Ct(t))==="formdata"||e==="object"&&se(t.toString)&&t.toString()==="[object FormData]"))},Ao=ue("URLSearchParams"),[Lo,Io,$o,Po]=["ReadableStream","Request","Response","Headers"].map(ue),Mo=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function nt(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let s,a;if(typeof t!="object"&&(t=[t]),Ue(t))for(s=0,a=t.length;s<a;s++)e.call(null,t[s],s,t);else{if(st(t))return;const n=r?Object.getOwnPropertyNames(t):Object.keys(t),o=n.length;let i;for(s=0;s<o;s++)i=n[s],e.call(null,t[i],i,t)}}function ks(t,e){if(st(t))return null;e=e.toLowerCase();const r=Object.keys(t);let s=r.length,a;for(;s-- >0;)if(a=r[s],e===a.toLowerCase())return a;return null}const Ne=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ws=t=>!Me(t)&&t!==Ne;function Vt(){const{caseless:t,skipUndefined:e}=ws(this)&&this||{},r={},s=(a,n)=>{const o=t&&ks(r,n)||n;dt(r[o])&&dt(a)?r[o]=Vt(r[o],a):dt(a)?r[o]=Vt({},a):Ue(a)?r[o]=a.slice():(!e||!Me(a))&&(r[o]=a)};for(let a=0,n=arguments.length;a<n;a++)arguments[a]&&nt(arguments[a],s);return r}const Bo=(t,e,r,{allOwnKeys:s}={})=>(nt(e,(a,n)=>{r&&se(a)?t[n]=bs(a,r):t[n]=a},{allOwnKeys:s}),t),zo=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Do=(t,e,r,s)=>{t.prototype=Object.create(e.prototype,s),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},Fo=(t,e,r,s)=>{let a,n,o;const i={};if(e=e||{},t==null)return e;do{for(a=Object.getOwnPropertyNames(t),n=a.length;n-- >0;)o=a[n],(!s||s(o,t,e))&&!i[o]&&(e[o]=t[o],i[o]=!0);t=r!==!1&&ar(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},Uo=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;const s=t.indexOf(e,r);return s!==-1&&s===r},Zo=t=>{if(!t)return null;if(Ue(t))return t;let e=t.length;if(!_s(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},Vo=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&ar(Uint8Array)),qo=(t,e)=>{const s=(t&&t[St]).call(t);let a;for(;(a=s.next())&&!a.done;){const n=a.value;e.call(t,n[0],n[1])}},Ho=(t,e)=>{let r;const s=[];for(;(r=t.exec(e))!==null;)s.push(r);return s},Wo=ue("HTMLFormElement"),Jo=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,s,a){return s.toUpperCase()+a}),yr=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),Xo=ue("RegExp"),Ts=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),s={};nt(r,(a,n)=>{let o;(o=e(a,n,t))!==!1&&(s[n]=o||a)}),Object.defineProperties(t,s)},Go=t=>{Ts(t,(e,r)=>{if(se(t)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const s=t[r];if(se(s)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Ko=(t,e)=>{const r={},s=a=>{a.forEach(n=>{r[n]=!0})};return Ue(t)?s(t):s(String(t).split(e)),r},Yo=()=>{},Qo=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function ei(t){return!!(t&&se(t.append)&&t[xs]==="FormData"&&t[St])}const ti=t=>{const e=new Array(10),r=(s,a)=>{if(at(s)){if(e.indexOf(s)>=0)return;if(st(s))return s;if(!("toJSON"in s)){e[a]=s;const n=Ue(s)?[]:{};return nt(s,(o,i)=>{const u=r(o,a+1);!Me(u)&&(n[i]=u)}),e[a]=void 0,n}}return s};return r(t,0)},ri=ue("AsyncFunction"),si=t=>t&&(at(t)||se(t))&&se(t.then)&&se(t.catch),Ns=((t,e)=>t?setImmediate:e?((r,s)=>(Ne.addEventListener("message",({source:a,data:n})=>{a===Ne&&n===r&&s.length&&s.shift()()},!1),a=>{s.push(a),Ne.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",se(Ne.postMessage)),ai=typeof queueMicrotask<"u"?queueMicrotask.bind(Ne):typeof process<"u"&&process.nextTick||Ns,ni=t=>t!=null&&se(t[St]),f={isArray:Ue,isArrayBuffer:vs,isBuffer:st,isFormData:Ro,isArrayBufferView:ko,isString:wo,isNumber:_s,isBoolean:To,isObject:at,isPlainObject:dt,isEmptyObject:No,isReadableStream:Lo,isRequest:Io,isResponse:$o,isHeaders:Po,isUndefined:Me,isDate:jo,isFile:So,isBlob:Co,isRegExp:Xo,isFunction:se,isStream:Oo,isURLSearchParams:Ao,isTypedArray:Vo,isFileList:Eo,forEach:nt,merge:Vt,extend:Bo,trim:Mo,stripBOM:zo,inherits:Do,toFlatObject:Fo,kindOf:Ct,kindOfTest:ue,endsWith:Uo,toArray:Zo,forEachEntry:qo,matchAll:Ho,isHTMLForm:Wo,hasOwnProperty:yr,hasOwnProp:yr,reduceDescriptors:Ts,freezeMethods:Go,toObjectSet:Ko,toCamelCase:Jo,noop:Yo,toFiniteNumber:Qo,findKey:ks,global:Ne,isContextDefined:ws,isSpecCompliantForm:ei,toJSONObject:ti,isAsyncFn:ri,isThenable:si,setImmediate:Ns,asap:ai,isIterable:ni};function I(t,e,r,s,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),s&&(this.request=s),a&&(this.response=a,this.status=a.status?a.status:null)}f.inherits(I,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:f.toJSONObject(this.config),code:this.code,status:this.status}}});const js=I.prototype,Ss={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{Ss[t]={value:t}});Object.defineProperties(I,Ss);Object.defineProperty(js,"isAxiosError",{value:!0});I.from=(t,e,r,s,a,n)=>{const o=Object.create(js);f.toFlatObject(t,o,function(d){return d!==Error.prototype},c=>c!=="isAxiosError");const i=t&&t.message?t.message:"Error",u=e==null&&t?t.code:e;return I.call(o,i,u,r,s,a),t&&o.cause==null&&Object.defineProperty(o,"cause",{value:t,configurable:!0}),o.name=t&&t.name||"Error",n&&Object.assign(o,n),o};const oi=null;function qt(t){return f.isPlainObject(t)||f.isArray(t)}function Cs(t){return f.endsWith(t,"[]")?t.slice(0,-2):t}function br(t,e,r){return t?t.concat(e).map(function(a,n){return a=Cs(a),!r&&n?"["+a+"]":a}).join(r?".":""):e}function ii(t){return f.isArray(t)&&!t.some(qt)}const li=f.toFlatObject(f,{},null,function(e){return/^is[A-Z]/.test(e)});function Ot(t,e,r){if(!f.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,r=f.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,g){return!f.isUndefined(g[h])});const s=r.metaTokens,a=r.visitor||d,n=r.dots,o=r.indexes,u=(r.Blob||typeof Blob<"u"&&Blob)&&f.isSpecCompliantForm(e);if(!f.isFunction(a))throw new TypeError("visitor must be a function");function c(m){if(m===null)return"";if(f.isDate(m))return m.toISOString();if(f.isBoolean(m))return m.toString();if(!u&&f.isBlob(m))throw new I("Blob is not supported. Use a Buffer instead.");return f.isArrayBuffer(m)||f.isTypedArray(m)?u&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function d(m,h,g){let v=m;if(m&&!g&&typeof m=="object"){if(f.endsWith(h,"{}"))h=s?h:h.slice(0,-2),m=JSON.stringify(m);else if(f.isArray(m)&&ii(m)||(f.isFileList(m)||f.endsWith(h,"[]"))&&(v=f.toArray(m)))return h=Cs(h),v.forEach(function(b,w){!(f.isUndefined(b)||b===null)&&e.append(o===!0?br([h],w,n):o===null?h:h+"[]",c(b))}),!1}return qt(m)?!0:(e.append(br(g,h,n),c(m)),!1)}const p=[],k=Object.assign(li,{defaultVisitor:d,convertValue:c,isVisitable:qt});function T(m,h){if(!f.isUndefined(m)){if(p.indexOf(m)!==-1)throw Error("Circular reference detected in "+h.join("."));p.push(m),f.forEach(m,function(v,x){(!(f.isUndefined(v)||v===null)&&a.call(e,v,f.isString(x)?x.trim():x,h,k))===!0&&T(v,h?h.concat(x):[x])}),p.pop()}}if(!f.isObject(t))throw new TypeError("data must be an object");return T(t),e}function xr(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(s){return e[s]})}function nr(t,e){this._pairs=[],t&&Ot(t,this,e)}const Es=nr.prototype;Es.append=function(e,r){this._pairs.push([e,r])};Es.toString=function(e){const r=e?function(s){return e.call(this,s,xr)}:xr;return this._pairs.map(function(a){return r(a[0])+"="+r(a[1])},"").join("&")};function ci(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Os(t,e,r){if(!e)return t;const s=r&&r.encode||ci;f.isFunction(r)&&(r={serialize:r});const a=r&&r.serialize;let n;if(a?n=a(e,r):n=f.isURLSearchParams(e)?e.toString():new nr(e,r).toString(s),n){const o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+n}return t}class vr{constructor(){this.handlers=[]}use(e,r,s){return this.handlers.push({fulfilled:e,rejected:r,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){f.forEach(this.handlers,function(s){s!==null&&e(s)})}}const Rs={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},di=typeof URLSearchParams<"u"?URLSearchParams:nr,ui=typeof FormData<"u"?FormData:null,fi=typeof Blob<"u"?Blob:null,mi={isBrowser:!0,classes:{URLSearchParams:di,FormData:ui,Blob:fi},protocols:["http","https","file","blob","url","data"]},or=typeof window<"u"&&typeof document<"u",Ht=typeof navigator=="object"&&navigator||void 0,hi=or&&(!Ht||["ReactNative","NativeScript","NS"].indexOf(Ht.product)<0),pi=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",gi=or&&window.location.href||"http://localhost",yi=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:or,hasStandardBrowserEnv:hi,hasStandardBrowserWebWorkerEnv:pi,navigator:Ht,origin:gi},Symbol.toStringTag,{value:"Module"})),Y={...yi,...mi};function bi(t,e){return Ot(t,new Y.classes.URLSearchParams,{visitor:function(r,s,a,n){return Y.isNode&&f.isBuffer(r)?(this.append(s,r.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...e})}function xi(t){return f.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function vi(t){const e={},r=Object.keys(t);let s;const a=r.length;let n;for(s=0;s<a;s++)n=r[s],e[n]=t[n];return e}function As(t){function e(r,s,a,n){let o=r[n++];if(o==="__proto__")return!0;const i=Number.isFinite(+o),u=n>=r.length;return o=!o&&f.isArray(a)?a.length:o,u?(f.hasOwnProp(a,o)?a[o]=[a[o],s]:a[o]=s,!i):((!a[o]||!f.isObject(a[o]))&&(a[o]=[]),e(r,s,a[o],n)&&f.isArray(a[o])&&(a[o]=vi(a[o])),!i)}if(f.isFormData(t)&&f.isFunction(t.entries)){const r={};return f.forEachEntry(t,(s,a)=>{e(xi(s),a,r,0)}),r}return null}function _i(t,e,r){if(f.isString(t))try{return(e||JSON.parse)(t),f.trim(t)}catch(s){if(s.name!=="SyntaxError")throw s}return(r||JSON.stringify)(t)}const ot={transitional:Rs,adapter:["xhr","http","fetch"],transformRequest:[function(e,r){const s=r.getContentType()||"",a=s.indexOf("application/json")>-1,n=f.isObject(e);if(n&&f.isHTMLForm(e)&&(e=new FormData(e)),f.isFormData(e))return a?JSON.stringify(As(e)):e;if(f.isArrayBuffer(e)||f.isBuffer(e)||f.isStream(e)||f.isFile(e)||f.isBlob(e)||f.isReadableStream(e))return e;if(f.isArrayBufferView(e))return e.buffer;if(f.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(n){if(s.indexOf("application/x-www-form-urlencoded")>-1)return bi(e,this.formSerializer).toString();if((i=f.isFileList(e))||s.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return Ot(i?{"files[]":e}:e,u&&new u,this.formSerializer)}}return n||a?(r.setContentType("application/json",!1),_i(e)):e}],transformResponse:[function(e){const r=this.transitional||ot.transitional,s=r&&r.forcedJSONParsing,a=this.responseType==="json";if(f.isResponse(e)||f.isReadableStream(e))return e;if(e&&f.isString(e)&&(s&&!this.responseType||a)){const o=!(r&&r.silentJSONParsing)&&a;try{return JSON.parse(e,this.parseReviver)}catch(i){if(o)throw i.name==="SyntaxError"?I.from(i,I.ERR_BAD_RESPONSE,this,null,this.response):i}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Y.classes.FormData,Blob:Y.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};f.forEach(["delete","get","head","post","put","patch"],t=>{ot.headers[t]={}});const ki=f.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),wi=t=>{const e={};let r,s,a;return t&&t.split(`
3
- `).forEach(function(o){a=o.indexOf(":"),r=o.substring(0,a).trim().toLowerCase(),s=o.substring(a+1).trim(),!(!r||e[r]&&ki[r])&&(r==="set-cookie"?e[r]?e[r].push(s):e[r]=[s]:e[r]=e[r]?e[r]+", "+s:s)}),e},_r=Symbol("internals");function We(t){return t&&String(t).trim().toLowerCase()}function ut(t){return t===!1||t==null?t:f.isArray(t)?t.map(ut):String(t)}function Ti(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=r.exec(t);)e[s[1]]=s[2];return e}const Ni=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function At(t,e,r,s,a){if(f.isFunction(s))return s.call(this,e,r);if(a&&(e=r),!!f.isString(e)){if(f.isString(s))return e.indexOf(s)!==-1;if(f.isRegExp(s))return s.test(e)}}function ji(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,s)=>r.toUpperCase()+s)}function Si(t,e){const r=f.toCamelCase(" "+e);["get","set","has"].forEach(s=>{Object.defineProperty(t,s+r,{value:function(a,n,o){return this[s].call(this,e,a,n,o)},configurable:!0})})}let ae=class{constructor(e){e&&this.set(e)}set(e,r,s){const a=this;function n(i,u,c){const d=We(u);if(!d)throw new Error("header name must be a non-empty string");const p=f.findKey(a,d);(!p||a[p]===void 0||c===!0||c===void 0&&a[p]!==!1)&&(a[p||u]=ut(i))}const o=(i,u)=>f.forEach(i,(c,d)=>n(c,d,u));if(f.isPlainObject(e)||e instanceof this.constructor)o(e,r);else if(f.isString(e)&&(e=e.trim())&&!Ni(e))o(wi(e),r);else if(f.isObject(e)&&f.isIterable(e)){let i={},u,c;for(const d of e){if(!f.isArray(d))throw TypeError("Object iterator must return a key-value pair");i[c=d[0]]=(u=i[c])?f.isArray(u)?[...u,d[1]]:[u,d[1]]:d[1]}o(i,r)}else e!=null&&n(r,e,s);return this}get(e,r){if(e=We(e),e){const s=f.findKey(this,e);if(s){const a=this[s];if(!r)return a;if(r===!0)return Ti(a);if(f.isFunction(r))return r.call(this,a,s);if(f.isRegExp(r))return r.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,r){if(e=We(e),e){const s=f.findKey(this,e);return!!(s&&this[s]!==void 0&&(!r||At(this,this[s],s,r)))}return!1}delete(e,r){const s=this;let a=!1;function n(o){if(o=We(o),o){const i=f.findKey(s,o);i&&(!r||At(s,s[i],i,r))&&(delete s[i],a=!0)}}return f.isArray(e)?e.forEach(n):n(e),a}clear(e){const r=Object.keys(this);let s=r.length,a=!1;for(;s--;){const n=r[s];(!e||At(this,this[n],n,e,!0))&&(delete this[n],a=!0)}return a}normalize(e){const r=this,s={};return f.forEach(this,(a,n)=>{const o=f.findKey(s,n);if(o){r[o]=ut(a),delete r[n];return}const i=e?ji(n):String(n).trim();i!==n&&delete r[n],r[i]=ut(a),s[i]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const r=Object.create(null);return f.forEach(this,(s,a)=>{s!=null&&s!==!1&&(r[a]=e&&f.isArray(s)?s.join(", "):s)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,r])=>e+": "+r).join(`
4
- `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...r){const s=new this(e);return r.forEach(a=>s.set(a)),s}static accessor(e){const s=(this[_r]=this[_r]={accessors:{}}).accessors,a=this.prototype;function n(o){const i=We(o);s[i]||(Si(a,o),s[i]=!0)}return f.isArray(e)?e.forEach(n):n(e),this}};ae.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);f.reduceDescriptors(ae.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(s){this[r]=s}}});f.freezeMethods(ae);function Lt(t,e){const r=this||ot,s=e||r,a=ae.from(s.headers);let n=s.data;return f.forEach(t,function(i){n=i.call(r,n,a.normalize(),e?e.status:void 0)}),a.normalize(),n}function Ls(t){return!!(t&&t.__CANCEL__)}function Ze(t,e,r){I.call(this,t??"canceled",I.ERR_CANCELED,e,r),this.name="CanceledError"}f.inherits(Ze,I,{__CANCEL__:!0});function Is(t,e,r){const s=r.config.validateStatus;!r.status||!s||s(r.status)?t(r):e(new I("Request failed with status code "+r.status,[I.ERR_BAD_REQUEST,I.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function Ci(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Ei(t,e){t=t||10;const r=new Array(t),s=new Array(t);let a=0,n=0,o;return e=e!==void 0?e:1e3,function(u){const c=Date.now(),d=s[n];o||(o=c),r[a]=u,s[a]=c;let p=n,k=0;for(;p!==a;)k+=r[p++],p=p%t;if(a=(a+1)%t,a===n&&(n=(n+1)%t),c-o<e)return;const T=d&&c-d;return T?Math.round(k*1e3/T):void 0}}function Oi(t,e){let r=0,s=1e3/e,a,n;const o=(c,d=Date.now())=>{r=d,a=null,n&&(clearTimeout(n),n=null),t(...c)};return[(...c)=>{const d=Date.now(),p=d-r;p>=s?o(c,d):(a=c,n||(n=setTimeout(()=>{n=null,o(a)},s-p)))},()=>a&&o(a)]}const mt=(t,e,r=3)=>{let s=0;const a=Ei(50,250);return Oi(n=>{const o=n.loaded,i=n.lengthComputable?n.total:void 0,u=o-s,c=a(u),d=o<=i;s=o;const p={loaded:o,total:i,progress:i?o/i:void 0,bytes:u,rate:c||void 0,estimated:c&&i&&d?(i-o)/c:void 0,event:n,lengthComputable:i!=null,[e?"download":"upload"]:!0};t(p)},r)},kr=(t,e)=>{const r=t!=null;return[s=>e[0]({lengthComputable:r,total:t,loaded:s}),e[1]]},wr=t=>(...e)=>f.asap(()=>t(...e)),Ri=Y.hasStandardBrowserEnv?((t,e)=>r=>(r=new URL(r,Y.origin),t.protocol===r.protocol&&t.host===r.host&&(e||t.port===r.port)))(new URL(Y.origin),Y.navigator&&/(msie|trident)/i.test(Y.navigator.userAgent)):()=>!0,Ai=Y.hasStandardBrowserEnv?{write(t,e,r,s,a,n,o){if(typeof document>"u")return;const i=[`${t}=${encodeURIComponent(e)}`];f.isNumber(r)&&i.push(`expires=${new Date(r).toUTCString()}`),f.isString(s)&&i.push(`path=${s}`),f.isString(a)&&i.push(`domain=${a}`),n===!0&&i.push("secure"),f.isString(o)&&i.push(`SameSite=${o}`),document.cookie=i.join("; ")},read(t){if(typeof document>"u")return null;const e=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Li(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Ii(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function $s(t,e,r){let s=!Li(e);return t&&(s||r==!1)?Ii(t,e):e}const Tr=t=>t instanceof ae?{...t}:t;function Ee(t,e){e=e||{};const r={};function s(c,d,p,k){return f.isPlainObject(c)&&f.isPlainObject(d)?f.merge.call({caseless:k},c,d):f.isPlainObject(d)?f.merge({},d):f.isArray(d)?d.slice():d}function a(c,d,p,k){if(f.isUndefined(d)){if(!f.isUndefined(c))return s(void 0,c,p,k)}else return s(c,d,p,k)}function n(c,d){if(!f.isUndefined(d))return s(void 0,d)}function o(c,d){if(f.isUndefined(d)){if(!f.isUndefined(c))return s(void 0,c)}else return s(void 0,d)}function i(c,d,p){if(p in e)return s(c,d);if(p in t)return s(void 0,c)}const u={url:n,method:n,data:n,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:i,headers:(c,d,p)=>a(Tr(c),Tr(d),p,!0)};return f.forEach(Object.keys({...t,...e}),function(d){const p=u[d]||a,k=p(t[d],e[d],d);f.isUndefined(k)&&p!==i||(r[d]=k)}),r}const Ps=t=>{const e=Ee({},t);let{data:r,withXSRFToken:s,xsrfHeaderName:a,xsrfCookieName:n,headers:o,auth:i}=e;if(e.headers=o=ae.from(o),e.url=Os($s(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),i&&o.set("Authorization","Basic "+btoa((i.username||"")+":"+(i.password?unescape(encodeURIComponent(i.password)):""))),f.isFormData(r)){if(Y.hasStandardBrowserEnv||Y.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(f.isFunction(r.getHeaders)){const u=r.getHeaders(),c=["content-type","content-length"];Object.entries(u).forEach(([d,p])=>{c.includes(d.toLowerCase())&&o.set(d,p)})}}if(Y.hasStandardBrowserEnv&&(s&&f.isFunction(s)&&(s=s(e)),s||s!==!1&&Ri(e.url))){const u=a&&n&&Ai.read(n);u&&o.set(a,u)}return e},$i=typeof XMLHttpRequest<"u",Pi=$i&&function(t){return new Promise(function(r,s){const a=Ps(t);let n=a.data;const o=ae.from(a.headers).normalize();let{responseType:i,onUploadProgress:u,onDownloadProgress:c}=a,d,p,k,T,m;function h(){T&&T(),m&&m(),a.cancelToken&&a.cancelToken.unsubscribe(d),a.signal&&a.signal.removeEventListener("abort",d)}let g=new XMLHttpRequest;g.open(a.method.toUpperCase(),a.url,!0),g.timeout=a.timeout;function v(){if(!g)return;const b=ae.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders()),A={data:!i||i==="text"||i==="json"?g.responseText:g.response,status:g.status,statusText:g.statusText,headers:b,config:t,request:g};Is(function(j){r(j),h()},function(j){s(j),h()},A),g=null}"onloadend"in g?g.onloadend=v:g.onreadystatechange=function(){!g||g.readyState!==4||g.status===0&&!(g.responseURL&&g.responseURL.indexOf("file:")===0)||setTimeout(v)},g.onabort=function(){g&&(s(new I("Request aborted",I.ECONNABORTED,t,g)),g=null)},g.onerror=function(w){const A=w&&w.message?w.message:"Network Error",D=new I(A,I.ERR_NETWORK,t,g);D.event=w||null,s(D),g=null},g.ontimeout=function(){let w=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const A=a.transitional||Rs;a.timeoutErrorMessage&&(w=a.timeoutErrorMessage),s(new I(w,A.clarifyTimeoutError?I.ETIMEDOUT:I.ECONNABORTED,t,g)),g=null},n===void 0&&o.setContentType(null),"setRequestHeader"in g&&f.forEach(o.toJSON(),function(w,A){g.setRequestHeader(A,w)}),f.isUndefined(a.withCredentials)||(g.withCredentials=!!a.withCredentials),i&&i!=="json"&&(g.responseType=a.responseType),c&&([k,m]=mt(c,!0),g.addEventListener("progress",k)),u&&g.upload&&([p,T]=mt(u),g.upload.addEventListener("progress",p),g.upload.addEventListener("loadend",T)),(a.cancelToken||a.signal)&&(d=b=>{g&&(s(!b||b.type?new Ze(null,t,g):b),g.abort(),g=null)},a.cancelToken&&a.cancelToken.subscribe(d),a.signal&&(a.signal.aborted?d():a.signal.addEventListener("abort",d)));const x=Ci(a.url);if(x&&Y.protocols.indexOf(x)===-1){s(new I("Unsupported protocol "+x+":",I.ERR_BAD_REQUEST,t));return}g.send(n||null)})},Mi=(t,e)=>{const{length:r}=t=t?t.filter(Boolean):[];if(e||r){let s=new AbortController,a;const n=function(c){if(!a){a=!0,i();const d=c instanceof Error?c:this.reason;s.abort(d instanceof I?d:new Ze(d instanceof Error?d.message:d))}};let o=e&&setTimeout(()=>{o=null,n(new I(`timeout ${e} of ms exceeded`,I.ETIMEDOUT))},e);const i=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach(c=>{c.unsubscribe?c.unsubscribe(n):c.removeEventListener("abort",n)}),t=null)};t.forEach(c=>c.addEventListener("abort",n));const{signal:u}=s;return u.unsubscribe=()=>f.asap(i),u}},Bi=function*(t,e){let r=t.byteLength;if(r<e){yield t;return}let s=0,a;for(;s<r;)a=s+e,yield t.slice(s,a),s=a},zi=async function*(t,e){for await(const r of Di(t))yield*Bi(r,e)},Di=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:r,value:s}=await e.read();if(r)break;yield s}}finally{await e.cancel()}},Nr=(t,e,r,s)=>{const a=zi(t,e);let n=0,o,i=u=>{o||(o=!0,s&&s(u))};return new ReadableStream({async pull(u){try{const{done:c,value:d}=await a.next();if(c){i(),u.close();return}let p=d.byteLength;if(r){let k=n+=p;r(k)}u.enqueue(new Uint8Array(d))}catch(c){throw i(c),c}},cancel(u){return i(u),a.return()}},{highWaterMark:2})},jr=64*1024,{isFunction:ct}=f,Fi=(({Request:t,Response:e})=>({Request:t,Response:e}))(f.global),{ReadableStream:Sr,TextEncoder:Cr}=f.global,Er=(t,...e)=>{try{return!!t(...e)}catch{return!1}},Ui=t=>{t=f.merge.call({skipUndefined:!0},Fi,t);const{fetch:e,Request:r,Response:s}=t,a=e?ct(e):typeof fetch=="function",n=ct(r),o=ct(s);if(!a)return!1;const i=a&&ct(Sr),u=a&&(typeof Cr=="function"?(m=>h=>m.encode(h))(new Cr):async m=>new Uint8Array(await new r(m).arrayBuffer())),c=n&&i&&Er(()=>{let m=!1;const h=new r(Y.origin,{body:new Sr,method:"POST",get duplex(){return m=!0,"half"}}).headers.has("Content-Type");return m&&!h}),d=o&&i&&Er(()=>f.isReadableStream(new s("").body)),p={stream:d&&(m=>m.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(m=>{!p[m]&&(p[m]=(h,g)=>{let v=h&&h[m];if(v)return v.call(h);throw new I(`Response type '${m}' is not supported`,I.ERR_NOT_SUPPORT,g)})});const k=async m=>{if(m==null)return 0;if(f.isBlob(m))return m.size;if(f.isSpecCompliantForm(m))return(await new r(Y.origin,{method:"POST",body:m}).arrayBuffer()).byteLength;if(f.isArrayBufferView(m)||f.isArrayBuffer(m))return m.byteLength;if(f.isURLSearchParams(m)&&(m=m+""),f.isString(m))return(await u(m)).byteLength},T=async(m,h)=>{const g=f.toFiniteNumber(m.getContentLength());return g??k(h)};return async m=>{let{url:h,method:g,data:v,signal:x,cancelToken:b,timeout:w,onDownloadProgress:A,onUploadProgress:D,responseType:j,headers:E,withCredentials:$="same-origin",fetchOptions:V}=Ps(m),q=e||fetch;j=j?(j+"").toLowerCase():"text";let W=Mi([x,b&&b.toAbortSignal()],w),K=null;const ne=W&&W.unsubscribe&&(()=>{W.unsubscribe()});let ge;try{if(D&&c&&g!=="get"&&g!=="head"&&(ge=await T(E,v))!==0){let fe=new r(h,{method:"POST",body:v,duplex:"half"}),xe;if(f.isFormData(v)&&(xe=fe.headers.get("content-type"))&&E.setContentType(xe),fe.body){const[qe,Re]=kr(ge,mt(wr(D)));v=Nr(fe.body,jr,qe,Re)}}f.isString($)||($=$?"include":"omit");const H=n&&"credentials"in r.prototype,te={...V,signal:W,method:g.toUpperCase(),headers:E.normalize().toJSON(),body:v,duplex:"half",credentials:H?$:void 0};K=n&&new r(h,te);let Q=await(n?q(K,V):q(h,te));const Ve=d&&(j==="stream"||j==="response");if(d&&(A||Ve&&ne)){const fe={};["status","statusText","headers"].forEach(He=>{fe[He]=Q[He]});const xe=f.toFiniteNumber(Q.headers.get("content-length")),[qe,Re]=A&&kr(xe,mt(wr(A),!0))||[];Q=new s(Nr(Q.body,jr,qe,()=>{Re&&Re(),ne&&ne()}),fe)}j=j||"text";let lt=await p[f.findKey(p,j)||"text"](Q,m);return!Ve&&ne&&ne(),await new Promise((fe,xe)=>{Is(fe,xe,{data:lt,headers:ae.from(Q.headers),status:Q.status,statusText:Q.statusText,config:m,request:K})})}catch(H){throw ne&&ne(),H&&H.name==="TypeError"&&/Load failed|fetch/i.test(H.message)?Object.assign(new I("Network Error",I.ERR_NETWORK,m,K),{cause:H.cause||H}):I.from(H,H&&H.code,m,K)}}},Zi=new Map,Ms=t=>{let e=t&&t.env||{};const{fetch:r,Request:s,Response:a}=e,n=[s,a,r];let o=n.length,i=o,u,c,d=Zi;for(;i--;)u=n[i],c=d.get(u),c===void 0&&d.set(u,c=i?new Map:Ui(e)),d=c;return c};Ms();const ir={http:oi,xhr:Pi,fetch:{get:Ms}};f.forEach(ir,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Or=t=>`- ${t}`,Vi=t=>f.isFunction(t)||t===null||t===!1;function qi(t,e){t=f.isArray(t)?t:[t];const{length:r}=t;let s,a;const n={};for(let o=0;o<r;o++){s=t[o];let i;if(a=s,!Vi(s)&&(a=ir[(i=String(s)).toLowerCase()],a===void 0))throw new I(`Unknown adapter '${i}'`);if(a&&(f.isFunction(a)||(a=a.get(e))))break;n[i||"#"+o]=a}if(!a){const o=Object.entries(n).map(([u,c])=>`adapter ${u} `+(c===!1?"is not supported by the environment":"is not available in the build"));let i=r?o.length>1?`since :
5
- `+o.map(Or).join(`
6
- `):" "+Or(o[0]):"as no adapter specified";throw new I("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return a}const Bs={getAdapter:qi,adapters:ir};function It(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Ze(null,t)}function Rr(t){return It(t),t.headers=ae.from(t.headers),t.data=Lt.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Bs.getAdapter(t.adapter||ot.adapter,t)(t).then(function(s){return It(t),s.data=Lt.call(t,t.transformResponse,s),s.headers=ae.from(s.headers),s},function(s){return Ls(s)||(It(t),s&&s.response&&(s.response.data=Lt.call(t,t.transformResponse,s.response),s.response.headers=ae.from(s.response.headers))),Promise.reject(s)})}const zs="1.13.2",Rt={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Rt[t]=function(s){return typeof s===t||"a"+(e<1?"n ":" ")+t}});const Ar={};Rt.transitional=function(e,r,s){function a(n,o){return"[Axios v"+zs+"] Transitional option '"+n+"'"+o+(s?". "+s:"")}return(n,o,i)=>{if(e===!1)throw new I(a(o," has been removed"+(r?" in "+r:"")),I.ERR_DEPRECATED);return r&&!Ar[o]&&(Ar[o]=!0,console.warn(a(o," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(n,o,i):!0}};Rt.spelling=function(e){return(r,s)=>(console.warn(`${s} is likely a misspelling of ${e}`),!0)};function Hi(t,e,r){if(typeof t!="object")throw new I("options must be an object",I.ERR_BAD_OPTION_VALUE);const s=Object.keys(t);let a=s.length;for(;a-- >0;){const n=s[a],o=e[n];if(o){const i=t[n],u=i===void 0||o(i,n,t);if(u!==!0)throw new I("option "+n+" must be "+u,I.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new I("Unknown option "+n,I.ERR_BAD_OPTION)}}const ft={assertOptions:Hi,validators:Rt},he=ft.validators;let Se=class{constructor(e){this.defaults=e||{},this.interceptors={request:new vr,response:new vr}}async request(e,r){try{return await this._request(e,r)}catch(s){if(s instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const n=a.stack?a.stack.replace(/^.+\n/,""):"";try{s.stack?n&&!String(s.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(s.stack+=`
7
- `+n):s.stack=n}catch{}}throw s}}_request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=Ee(this.defaults,r);const{transitional:s,paramsSerializer:a,headers:n}=r;s!==void 0&&ft.assertOptions(s,{silentJSONParsing:he.transitional(he.boolean),forcedJSONParsing:he.transitional(he.boolean),clarifyTimeoutError:he.transitional(he.boolean)},!1),a!=null&&(f.isFunction(a)?r.paramsSerializer={serialize:a}:ft.assertOptions(a,{encode:he.function,serialize:he.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),ft.assertOptions(r,{baseUrl:he.spelling("baseURL"),withXsrfToken:he.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=n&&f.merge(n.common,n[r.method]);n&&f.forEach(["delete","get","head","post","put","patch","common"],m=>{delete n[m]}),r.headers=ae.concat(o,n);const i=[];let u=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(r)===!1||(u=u&&h.synchronous,i.unshift(h.fulfilled,h.rejected))});const c=[];this.interceptors.response.forEach(function(h){c.push(h.fulfilled,h.rejected)});let d,p=0,k;if(!u){const m=[Rr.bind(this),void 0];for(m.unshift(...i),m.push(...c),k=m.length,d=Promise.resolve(r);p<k;)d=d.then(m[p++],m[p++]);return d}k=i.length;let T=r;for(;p<k;){const m=i[p++],h=i[p++];try{T=m(T)}catch(g){h.call(this,g);break}}try{d=Rr.call(this,T)}catch(m){return Promise.reject(m)}for(p=0,k=c.length;p<k;)d=d.then(c[p++],c[p++]);return d}getUri(e){e=Ee(this.defaults,e);const r=$s(e.baseURL,e.url,e.allowAbsoluteUrls);return Os(r,e.params,e.paramsSerializer)}};f.forEach(["delete","get","head","options"],function(e){Se.prototype[e]=function(r,s){return this.request(Ee(s||{},{method:e,url:r,data:(s||{}).data}))}});f.forEach(["post","put","patch"],function(e){function r(s){return function(n,o,i){return this.request(Ee(i||{},{method:e,headers:s?{"Content-Type":"multipart/form-data"}:{},url:n,data:o}))}}Se.prototype[e]=r(),Se.prototype[e+"Form"]=r(!0)});let Wi=class Ds{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(n){r=n});const s=this;this.promise.then(a=>{if(!s._listeners)return;let n=s._listeners.length;for(;n-- >0;)s._listeners[n](a);s._listeners=null}),this.promise.then=a=>{let n;const o=new Promise(i=>{s.subscribe(i),n=i}).then(a);return o.cancel=function(){s.unsubscribe(n)},o},e(function(n,o,i){s.reason||(s.reason=new Ze(n,o,i),r(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const e=new AbortController,r=s=>{e.abort(s)};return this.subscribe(r),e.signal.unsubscribe=()=>this.unsubscribe(r),e.signal}static source(){let e;return{token:new Ds(function(a){e=a}),cancel:e}}};function Ji(t){return function(r){return t.apply(null,r)}}function Xi(t){return f.isObject(t)&&t.isAxiosError===!0}const Wt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Wt).forEach(([t,e])=>{Wt[e]=t});function Fs(t){const e=new Se(t),r=bs(Se.prototype.request,e);return f.extend(r,Se.prototype,e,{allOwnKeys:!0}),f.extend(r,e,null,{allOwnKeys:!0}),r.create=function(a){return Fs(Ee(t,a))},r}const U=Fs(ot);U.Axios=Se;U.CanceledError=Ze;U.CancelToken=Wi;U.isCancel=Ls;U.VERSION=zs;U.toFormData=Ot;U.AxiosError=I;U.Cancel=U.CanceledError;U.all=function(e){return Promise.all(e)};U.spread=Ji;U.isAxiosError=Xi;U.mergeConfig=Ee;U.AxiosHeaders=ae;U.formToJSON=t=>As(f.isHTMLForm(t)?new FormData(t):t);U.getAdapter=Bs.getAdapter;U.HttpStatusCode=Wt;U.default=U;const{Axios:Ol,AxiosError:Rl,CanceledError:Al,isCancel:Ll,CancelToken:Il,VERSION:$l,all:Pl,Cancel:Ml,isAxiosError:Bl,spread:zl,toFormData:Dl,AxiosHeaders:Fl,HttpStatusCode:Ul,formToJSON:Zl,getAdapter:Vl,mergeConfig:ql}=U,Us="jsonplaceholder",lr={LOGIN_KEY:"auth-storage"},Ke=U.create();Ke.interceptors.request.use(t=>{const{apiBaseUrl:e}=sr();return t.baseURL=e,t.skipLoader||Pe.start(),delete t.skipLoader,t.headers["ngrok-skip-browser-warning"]="true",t.headers.society="69229bb020bbf21b81e80c29",t.headers.authorization=`Bearer ${localStorage.getItem(lr.LOGIN_KEY)}`,t},t=>(t.config?.skipLoader||Pe.stop(),Promise.reject(t)));Ke.interceptors.response.use(t=>(t.config.skipLoader||Pe.stop(),t.data),t=>(t.config?.skipLoader||Pe.stop(),t.response&&t.response.status===401&&(localStorage.clear(),window.location.replace("/")),Promise.reject(t.response?t.response.data:t)));const it=ps()(xo(t=>({user:null,error:null,isLoggedIn:!1,justLoggedIn:!1,isSideNavbarOpen:!0,loginAction:async e=>{try{if(sr().apiBaseUrl.includes(Us)){const r=await Ke.get("users",{params:e});if(r.length>0){const{name:s,email:a,id:n}=r[0];return t({error:null,isLoggedIn:!0,justLoggedIn:!0,user:{id:n,email:a,fullName:s,roles:["MEMBER","MANAGER"]}}),!0}else{const s=`No user found with email: ${e.email}`;return t({error:s}),console.error("Login error:",s),!1}}else{const r=await Ke.post("auth/login",e);return t({error:null,isLoggedIn:!0,justLoggedIn:!0,user:r.data}),!0}}catch(r){const s=r?.message??"An error occurred during login";return t({error:s}),console.error("Login error:",r,r instanceof Error),!1}},clearError:()=>{t({error:null})},resetJustLoggedIn:()=>{t({justLoggedIn:!1})},logout:()=>{t({isLoggedIn:!1,user:null,isSideNavbarOpen:!0,error:null})},toggleSidebar:()=>{t(e=>({isSideNavbarOpen:!e.isSideNavbarOpen}))},setSideNavbarOpen:e=>{t({isSideNavbarOpen:e})}}),{name:lr.LOGIN_KEY,partialize:t=>({user:t.user,isLoggedIn:t.isLoggedIn,isSideNavbarOpen:t.isSideNavbarOpen})})),Gi=({hasNotifications:t=!0})=>{const e=Xe.useNavigate(),[r,s]=y.useState(""),a=y.useRef(null),[n,o]=y.useState(!1),{user:i,logout:u,justLoggedIn:c,isSideNavbarOpen:d,resetJustLoggedIn:p,setSideNavbarOpen:k}=it(),T=m=>{o(!n),m==="logout"?u():e(m)};return y.useEffect(()=>{c&&i&&(gs(`Welcome back, ${i.fullName||i.email}!`),p())},[c,p,i]),y.useEffect(()=>{const m=h=>{a.current&&!a.current.contains(h.target)&&o(!1)};return document.addEventListener("mousedown",m),()=>{document.removeEventListener("mousedown",m)}},[]),l.jsx("header",{className:"sticky top-0 z-40 bg-slate-800 backdrop-blur-md border-b border-slate-400 shadow-sm transition-colors duration-300",children:l.jsxs("div",{className:"flex items-center justify-between text-slate-100 py-3 px-4",children:[l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx($e,{text:"Toggle Sidebar",position:"right",children:l.jsx("button",{onClick:()=>k(!d),className:"p-2 rounded-lg text-slate-400 hover:bg-slate-700 dark:hover:bg-slate-700 transition-all duration-200 focus:outline-none",children:l.jsx(ka,{className:"w-5 h-5"})})}),l.jsxs("div",{className:"relative hidden md:block",children:[l.jsx(Ca,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-slate-500"}),l.jsx("input",{type:"search",value:r,placeholder:"Search anything...",onChange:m=>s(m.target.value),className:"w-64 lg:w-80 pl-10 pr-4 py-2 bg-slate-50 dark:bg-slate-900 border border-transparent rounded-lg text-sm text-slate-900 dark:text-slate-100 placeholder:text-slate-500 dark:placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-violet-500 focus:border-transparent focus:bg-slate-50 dark:focus:bg-slate-800 transition-all duration-200"})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(er,{forceDarkTheme:!0}),l.jsx($e,{text:"Notifications",position:"bottom",children:l.jsxs(de,{variant:"default",className:"text-slate-400 hover:bg-slate-600",children:[l.jsx(ua,{className:"w-5 h-5"}),t&&l.jsx("span",{className:"absolute top-1.5 right-3.5 w-2 h-2 bg-amber-300 rounded-full ring-2 ring-slate-200 animate-pulse"})]})}),l.jsx($e,{text:"Activity History",position:"bottom",children:l.jsx(de,{variant:"default",className:"text-slate-400 hover:bg-slate-600",icon:l.jsx(ga,{className:"w-5 h-5"})})}),l.jsx("div",{className:"w-px h-6 bg-slate-200 dark:bg-dark-border mx-1 bg-slate-border"}),l.jsxs("div",{className:"relative",ref:a,children:[l.jsxs("button",{onClick:()=>o(!n),className:"flex items-center gap-2 p-1.5 rounded-lg hover:bg-slate-700 transition-all duration-200 focus:outline-none",children:[l.jsx("div",{className:"h-8 w-8 rounded-lg bg-linear-to-br from-violet-500 to-purple-600 flex items-center justify-center text-white font-semibold text-sm shadow-md",children:rr(i?.fullName??"N/A",2)}),l.jsxs("div",{className:"hidden lg:block text-left",children:[l.jsx("p",{className:"text-sm font-medium text-slate-100",children:i?.fullName??"N/A"}),l.jsx("p",{className:"text-xs text-slate-400",children:i?.email})]})]}),n&&l.jsxs("div",{className:"absolute right-0 mt-3 w-56 bg-gray-300 dark:bg-slate-800 rounded-md shadow-2xl border border-slate-200 dark:border-slate-600 overflow-hidden animate-scale-in",children:[l.jsxs("div",{className:"px-4 py-3 border-b border-slate-200 dark:border-slate-600",children:[l.jsx("p",{className:"text-sm font-semibold text-slate-900 dark:text-slate-100",children:i?.fullName??"N/A"}),l.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400",children:i?.email})]}),l.jsxs("div",{className:"py-1",children:[l.jsxs("button",{onClick:()=>T("/my-profile"),className:"flex items-center w-full px-4 py-2.5 text-sm text-slate-700 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-slate-700 transition-colors",children:[l.jsx(Pa,{className:"w-4 h-4 mr-3"}),"My Profile"]}),l.jsxs("button",{onClick:()=>T("/settings"),className:"flex items-center w-full px-4 py-2.5 text-sm text-slate-700 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-slate-700 transition-colors",children:[l.jsx(Oa,{className:"w-4 h-4 mr-3"}),"Settings"]}),l.jsxs("button",{onClick:()=>T("/my-profile"),className:"flex items-center w-full px-4 py-2.5 text-sm text-slate-700 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-slate-700 transition-colors",children:[l.jsx(ba,{className:"w-4 h-4 mr-3"}),"Change Password"]})]}),l.jsx("div",{className:"border-t border-slate-200 dark:border-slate-600 py-1",children:l.jsxs("button",{onClick:()=>T("logout"),className:"flex items-center w-full px-4 py-2.5 text-sm text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors",children:[l.jsx(va,{className:"w-4 h-4 mr-3"}),"Logout"]})})]})]})]})]})})},Ki=({item:t})=>{const e=Xe.useLocation(),{isSideNavbarOpen:r}=it(),s=e.pathname===t.path,a=l.jsxs(Xe.Link,{to:t.path,className:`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),f=require("react"),Zt=require("react-dom"),Te=require("react-router"),Q={ExtraSmall:"xs",Small:"small",Medium:"medium",Large:"large"},X={None:"none",Small:"sm",Medium:"md",Large:"lg",Full:"full"},bs={Default:"default",Hover:"hover",Active:"active",Disabled:"disabled"},V={Default:"default",Primary:"primary",Secondary:"secondary",Success:"success",Warning:"warning",Info:"info",Danger:"danger"},U={Top:"top",Right:"right",Bottom:"bottom",Left:"left"},xs={default:"bg-slate-100 text-slate-800 dark:bg-slate-800 dark:text-slate-100",primary:"bg-violet-100 text-violet-800 dark:bg-violet-900/70 dark:text-violet-100",secondary:"bg-slate-200 text-slate-900 dark:bg-slate-700 dark:text-slate-50",success:"bg-emerald-100 text-emerald-800 dark:bg-emerald-900/70 dark:text-emerald-100",warning:"bg-amber-100 text-amber-800 dark:bg-amber-900/70 dark:text-amber-100",danger:"bg-red-100 text-red-800 dark:bg-red-900/70 dark:text-red-100",info:"bg-sky-100 text-sky-800 dark:bg-sky-900/70 dark:text-sky-100"},vs={sm:"text-xs px-2 py-0.5",md:"text-sm px-2.5 py-1",lg:"text-base px-3 py-1.5"},Bt=({children:t,size:e="md",dot:s=!1,className:r="",variant:a=V.Default,rounded:n=X.Medium})=>{const i={sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",none:"rounded-none",full:"rounded-full"};return o.jsxs("span",{className:["badge inline-flex items-center font-medium",xs[a],vs[e],i[n],r].join(" "),children:[s&&o.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-current mr-1.5"}),t]})},_s=({children:t,cols:e=1})=>{const s=`grid-cols-${e}`;return o.jsx("div",{className:`grid ${s} gap-3 mb-3`,children:t})},ks={xs:"h-3 w-3 border-2",sm:"h-4 w-4 border-2",md:"h-5 w-5 border-[3px]",lg:"h-6 w-6 border-4"},ws={default:"text-slate-200",info:"text-sky-600 dark:text-sky-300",danger:"text-red-600 dark:text-red-300",warning:"text-amber-600 dark:text-amber-300",primary:"text-violet-600 dark:text-violet-300",secondary:"text-slate-700 dark:text-slate-200",success:"text-emerald-600 dark:text-emerald-300"},Ze=({className:t,size:e="sm",label:s="Loading",showLabel:r=!1,variant:a=V.Primary})=>o.jsxs("span",{className:["inline-flex items-center gap-2 text-current",t].filter(Boolean).join(" "),role:"status","aria-live":"polite","aria-label":s,children:[o.jsx("span",{className:["inline-block rounded-full border-solid border-current border-t-transparent animate-spin",ks[e],ws[a]].join(" ")}),r?o.jsx("span",{className:"text-xs font-medium leading-none text-current",children:s}):o.jsx("span",{className:"sr-only",children:s})]}),K=({icon:t,label:e,tooltip:s,children:r,ariaLabel:a,className:n,loadingLabel:i,outline:l=!1,loading:d=!1,size:c=Q.Medium,variant:u=V.Primary,tooltipVariant:y=u,rounded:w=X.Medium,tooltipPosition:N=U.Top,...T})=>{const p=t&&!!!(e||r),_={xs:p?"p-2 text-xs":"px-1 py-1 text-xs",small:p?"p-2 text-xs":"px-4 py-2 text-xs",medium:p?"p-2.5 text-sm":"px-5 py-2.5 text-sm",large:p?"p-3.5 text-base":"px-6 py-3 text-base"}[c],g=l?{default:"bg-transparent text-slate-800 ring-1 ring-slate-400 hover:bg-slate-100 hover:ring-slate-500 dark:text-slate-100 dark:ring-slate-600 dark:hover:bg-slate-800/60 focus-visible:outline-slate-300",primary:"bg-transparent text-violet-600 ring-1 ring-violet-600 hover:bg-violet-50 hover:ring-violet-500 dark:text-violet-200 dark:ring-slate-500 dark:hover:bg-violet-900/30 focus-visible:outline-violet-300",secondary:"bg-transparent text-slate-900 ring-1 ring-slate-300 hover:bg-slate-100 hover:ring-slate-400 dark:text-slate-100 dark:ring-slate-600 dark:hover:bg-slate-800 focus-visible:outline-slate-400",success:"bg-transparent text-emerald-600 ring-1 ring-emerald-600 hover:bg-emerald-50 hover:ring-emerald-500 dark:text-emerald-200 dark:ring-emerald-600 dark:hover:bg-emerald-900/30 focus-visible:outline-emerald-300",danger:"bg-transparent text-red-600 ring-1 ring-red-600 hover:bg-red-50 hover:ring-red-500 dark:text-red-200 dark:ring-red-600 dark:hover:bg-red-900/30 focus-visible:outline-red-300",info:"bg-transparent text-sky-600 ring-1 ring-sky-600 hover:bg-sky-50 hover:ring-sky-500 dark:text-sky-200 dark:ring-sky-600 dark:hover:bg-sky-900/30 focus-visible:outline-syk-300",warning:"bg-transparent text-amber-600 ring-1 ring-amber-500 hover:bg-amber-50 hover:ring-amber-500 dark:text-amber-200 dark:ring-amber-500 dark:hover:bg-amber-900/30 focus-visible:outline-amber-300"}[u]:{default:"",primary:"bg-violet-600 text-white hover:bg-violet-500 ring-1 ring-violet-600 shadow shadow-violet-600/30 dark:bg-slate-700 dark:hover:bg-slate-700 dark:ring-slate-600 dark:shadow-slate-800/30 focus-visible:outline-violet-300",secondary:"bg-slate-200 text-slate-900 ring-1 ring-slate-300 hover:bg-slate-300 hover:ring-slate-400 dark:bg-slate-800 dark:text-slate-100 dark:ring-slate-700 dark:hover:bg-slate-700 focus-visible:outline-slate-400",success:"bg-emerald-600 text-white hover:bg-emerald-500 shadow shadow-emerald-600/30 dark:bg-emerald-800 dark:hover:bg-emerald-700 dark:shadow-emerald-800/30 focus-visible:outline-emerald-300",danger:"bg-red-600 text-white hover:bg-red-500 shadow shadow-red-600/30 dark:bg-red-800 dark:hover:bg-red-700 dark:shadow-red-800/30 focus-visible:outline-red-300",info:"bg-sky-600 text-white hover:bg-sky-500 shadow shadow-sky-600/30 dark:bg-sky-800 dark:hover:bg-sky-700 dark:shadow-sky-800/30 focus-visible:outline-sky-300",warning:"bg-amber-500 text-slate-950 hover:bg-amber-400 shadow shadow-amber-500/30 dark:bg-amber-800 dark:text-white dark:hover:bg-amber-700 dark:shadow-amber-800/30 focus-visible:outline-amber-300"}[u],$=l?{default:"bg-slate-50 text-slate-800 ring-1 ring-slate-300 dark:bg-slate-800 dark:text-slate-100 dark:ring-slate-600",primary:"bg-slate-50 text-violet-700 ring-1 ring-violet-600 dark:bg-violet-950 dark:text-violet-100 dark:ring-violet-700",secondary:"bg-slate-50 text-slate-900 ring-1 ring-slate-300 dark:bg-slate-900 dark:text-slate-100 dark:ring-slate-700",success:"bg-slate-50 text-emerald-700 ring-1 ring-emerald-500 dark:bg-emerald-900 dark:text-emerald-100 dark:ring-emerald-700",danger:"bg-slate-50 text-red-700 ring-1 ring-red-500 dark:bg-red-900 dark:text-red-100 dark:ring-red-700",info:"bg-slate-50 text-sky-700 ring-1 ring-sky-500 dark:bg-sky-900 dark:text-sky-100 dark:ring-sky-700",warning:"bg-slate-50 text-amber-700 ring-1 ring-amber-500 dark:bg-amber-900 dark:text-amber-100 dark:ring-amber-700"}:{default:"bg-slate-700 text-white",primary:"bg-violet-600 text-white",secondary:"bg-slate-200 text-slate-900 dark:bg-slate-700 dark:text-white",success:"bg-emerald-600 text-white",danger:"bg-red-600 text-white",info:"bg-sky-600 text-white",warning:"bg-amber-500 text-slate-950 dark:bg-amber-700 dark:text-white"},C=y??u,B={sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",none:"rounded-none",full:"rounded-full"},F={[U.Top]:"bottom-[calc(100%+0.75rem)] left-1/2 -translate-x-1/2",[U.Bottom]:"top-[calc(100%+0.75rem)] left-1/2 -translate-x-1/2",[U.Left]:"right-[calc(100%+0.75rem)] top-1/2 -translate-y-1/2",[U.Right]:"left-[calc(100%+0.75rem)] top-1/2 -translate-y-1/2"}[N],P={[U.Top]:"bottom-0 left-1/2 -translate-x-1/2 translate-y-1/2",[U.Bottom]:"top-0 left-1/2 -translate-x-1/2 -translate-y-1/2",[U.Left]:"right-0 top-1/2 translate-x-1/2 -translate-y-1/2",[U.Right]:"left-0 top-1/2 -translate-x-1/2 -translate-y-1/2"}[N],W={[U.Top]:{clipPath:"polygon(0 0, 100% 0, 50% 100%)"},[U.Bottom]:{clipPath:"polygon(50% 0, 0 100%, 100% 100%)"},[U.Left]:{clipPath:"polygon(0 0, 100% 50%, 0 100%)"},[U.Right]:{clipPath:"polygon(100% 0, 0 50%, 100% 100%)"}},G={[U.Top]:{bottom:"-5px"},[U.Bottom]:{top:"-5px"},[U.Left]:{right:"-5px"},[U.Right]:{left:"-5px"}},fe={...W[N],...G[N]},ge={default:"border border-slate-700",primary:"border border-violet-600 dark:border-slate-700",secondary:"border border-slate-300 dark:border-slate-600",success:"border border-emerald-600",warning:"border border-amber-500",info:"border border-sky-600",danger:"border border-red-600"},ye={default:"bg-slate-700 border border-slate-700",primary:"bg-violet-600 border border-violet-600 dark:border-slate-700",secondary:"bg-slate-400 border border-slate-400",success:"bg-emerald-600 border border-emerald-600",warning:"bg-amber-500 border border-amber-500",info:"bg-sky-600 border border-sky-600",danger:"bg-red-600 border border-red-600"},ae=d??T.disabled;return o.jsxs("span",{className:"relative group",children:[o.jsx("button",{type:"button",className:["w-full flex items-center justify-center font-semibold transition-colors duration-200 disabled:cursor-not-allowed disabled:opacity-60",_,g,B[w],n].filter(Boolean).join(" "),"aria-label":p?a:e,"aria-busy":d||void 0,disabled:ae,...T,children:o.jsxs("span",{className:"flex items-center justify-center gap-2",children:[d&&o.jsx(Ze,{size:p?"xs":"sm",variant:u,label:i,showLabel:!1}),t&&o.jsx("span",{children:t}),e,r]})}),s&&o.jsxs("span",{className:["pointer-events-none absolute whitespace-nowrap rounded-md px-3 py-1 text-xs font-medium shadow-lg transition duration-150 opacity-0 scale-95 transform-gpu z-10 group-hover:opacity-100 group-hover:scale-100",F,$[C]].join(" "),children:[s,o.jsx("span",{className:["absolute w-2.5 h-2.5 transform-gpu ring-0",P,l?ye[C]:[$[C],ge[C]].join(" ")].join(" "),style:fe})]})]})};const js=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ns=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,s,r)=>r?r.toUpperCase():s.toLowerCase()),gt=t=>{const e=Ns(t);return e.charAt(0).toUpperCase()+e.slice(1)},Dt=(...t)=>t.filter((e,s,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===s).join(" ").trim(),Ts=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};var Cs={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Ss=f.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:s=2,absoluteStrokeWidth:r,className:a="",children:n,iconNode:i,...l},d)=>f.createElement("svg",{ref:d,...Cs,width:e,height:e,stroke:t,strokeWidth:r?Number(s)*24/Number(e):s,className:Dt("lucide",a),...!n&&!Ts(l)&&{"aria-hidden":"true"},...l},[...i.map(([c,u])=>f.createElement(c,u)),...Array.isArray(n)?n:[n]]));const H=(t,e)=>{const s=f.forwardRef(({className:r,...a},n)=>f.createElement(Ss,{ref:n,iconNode:e,className:Dt(`lucide-${js(gt(t))}`,`lucide-${t}`,r),...a}));return s.displayName=gt(t),s};const Es=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Is=H("activity",Es);const $s=[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]],Os=H("arrow-down-right",$s);const Ls=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],Rs=H("arrow-up-right",Ls);const As=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],Ms=H("bell",As);const zs=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Ps=H("chevron-left",zs);const Zs=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Vt=H("chevron-right",Zs);const Bs=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],Ds=H("history",Bs);const Vs=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],Fs=H("lock",Vs);const Us=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Hs=H("log-out",Us);const qs=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],Ws=H("menu",qs);const Xs=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],Gs=H("monitor",Xs);const Ys=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],Js=H("moon",Ys);const Qs=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Ks=H("search",Qs);const er=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],tr=H("settings",er);const sr=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],rr=H("sparkles",sr);const ar=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],nr=H("sun",ar);const or=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],ir=H("user",or);const lr=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],yt=H("x",lr),dr={info:"focus:border-sky-400 focus-visible:border-sky-400",danger:"focus:border-red-400 focus-visible:border-red-400",default:"focus:border-slate-400 focus-visible:border-slate-400",warning:"focus:border-amber-400 focus-visible:border-amber-400",primary:"focus:border-violet-400 focus-visible:border-violet-400",secondary:"focus:border-slate-400 focus-visible:border-slate-400",success:"focus:border-emerald-400 focus-visible:border-emerald-400"},cr={xs:"px-2 py-2 text-xs",small:"px-3 py-2.5 text-sm",medium:"px-3.5 py-3 text-sm",large:"px-4 py-3.5 text-base"},it=({id:t,name:e,label:s,error:r,value:a,options:n,onChange:i,className:l="",disabled:d=!1,size:c=Q.Small,forceDarkTheme:u=!1,variant:y=V.Primary,dropdownMaxHeight:w="60vh",placeholder:N="Select an option",emptyStateLabel:T="No options available"})=>{const[v,p]=f.useState(!1),_=f.useRef(null),h=f.useMemo(()=>n.find(P=>String(P.value)===String(a)),[n,a]),b=h?.label??N,g=cr[c],L=f.useMemo(()=>typeof w=="number"?{maxHeight:`${w}px`}:{maxHeight:w},[w]),Z=v?"border border-slate-300 dark:border-slate-500 shadow-sm":"border border-slate-200 dark:border-slate-600 shadow-sm",$=r?"border border-red-700 dark:border-red-500 focus:border-red-700 focus-visible:border-red-700":"",C=()=>!d&&p(P=>!P),B=f.useCallback(P=>{_.current&&!_.current.contains(P.target)&&p(!1)},[]);f.useEffect(()=>{if(v)return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[B,v]);const F=P=>{i(String(P)),p(!1)};return o.jsxs("div",{className:u?"dark":"",children:[s?o.jsx("label",{htmlFor:t,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:s}):null,o.jsxs("div",{ref:_,className:`relative ${l}`,"aria-expanded":v,"aria-haspopup":"listbox",children:[o.jsxs("button",{type:"button",id:t,name:e,disabled:d,onClick:C,className:`w-full flex items-center justify-between gap-2 rounded-md bg-slate-50 dark:bg-gray-700 text-slate-900 dark:text-slate-100 border border-slate-200 dark:border-slate-500 focus:outline-none focus-visible:shadow-sm disabled:cursor-not-allowed disabled:opacity-60 transition-colors ${dr[y]} ${g} ${Z} ${$}`,children:[o.jsxs("div",{className:"flex items-center gap-2 min-h-5",children:[h?.icon?o.jsx("span",{className:"text-gray-500 dark:text-gray-300",children:h.icon}):null,o.jsx("span",{className:`text-sm ${h?"text-slate-900 dark:text-slate-100":"text-slate-500 dark:text-slate-400"}`,children:b})]}),o.jsx("span",{className:`text-gray-500 dark:text-gray-300 transition-transform duration-150 ${v?"rotate-180":""}`,children:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"none",className:"h-4 w-4",stroke:"currentColor",strokeWidth:"1.5",children:o.jsx("path",{d:"M6 8l4 4 4-4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),v?o.jsx("div",{className:"absolute left-0 right-0 mt-2 rounded-md bg-slate-50 dark:bg-slate-900 border border-gray-200 dark:border-gray-700 shadow-lg z-20",children:o.jsx("ul",{role:"listbox",style:L,className:"max-h-[60vh] overflow-auto py-2",children:n.length?n.map(P=>{const W=String(P.value),G=W===String(a);return o.jsx("li",{children:o.jsxs("button",{type:"button",className:`w-full flex items-center justify-between gap-2 px-3 py-2 text-left hover:bg-slate-200 dark:hover:bg-slate-800 ${G?"bg-slate-100 dark:bg-slate-700":""}`,onClick:()=>F(P.value),children:[o.jsxs("div",{className:"flex items-center gap-2",children:[P.icon?o.jsx("span",{className:"text-gray-500 dark:text-gray-300",children:P.icon}):null,o.jsx("span",{className:"text-sm text-slate-800 dark:text-slate-100",children:P.label})]}),G?o.jsx("span",{className:"text-violet-600 dark:text-violet-300",children:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"none",className:"h-4 w-4",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"M5 11l3 3 7-7",strokeLinecap:"round",strokeLinejoin:"round"})})}):null]})},W)}):o.jsx("li",{className:"px-3 py-4 text-sm text-slate-500 dark:text-slate-400",children:T})})}):null]}),r&&o.jsxs("div",{role:"alert",className:"mt-1 text-sm font-medium text-red-700",children:[r,"!"]})]})},Ft=f.createContext(void 0),ur=({children:t})=>{const[e,s]=f.useState("system"),[r,a]=f.useState("light"),[n,i]=f.useState(!1);f.useEffect(()=>{const d=localStorage.getItem("theme");d&&["light","dark","system"].includes(d)&&s(d),i(!0)},[]),f.useEffect(()=>{if(!n)return;const d=c=>{let u="light";c==="system"?u=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":u=c,a(u),u==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")};if(d(e),localStorage.setItem("theme",e),e==="system"){const c=window.matchMedia("(prefers-color-scheme: dark)"),u=()=>{d(e)};return c.addEventListener("change",u),()=>c.removeEventListener("change",u)}},[e,n]);const l=d=>{s(d)};return o.jsx(Ft.Provider,{value:{theme:e,setTheme:l,resolvedTheme:r},children:t})},Ut=()=>{const t=f.useContext(Ft);if(!t)throw new Error("useTheme must be used within ThemeProvider");return t},lt=({forceDarkTheme:t=!1})=>{const{theme:e,setTheme:s}=Ut(),r=[{value:"light",label:"Light",icon:o.jsx(nr,{size:16})},{value:"dark",label:"Dark",icon:o.jsx(Js,{size:16})},{value:"system",label:"System",icon:o.jsx(Gs,{size:16})}];return o.jsx(it,{value:e,options:r,onChange:a=>s(a),forceDarkTheme:t})},fr={violet:{text:"text-slate-50",arrow:"border-t-violet-600",bg:"bg-violet-600 dark:bg-slate-600"},yellow:{text:"text-black dark:text-slate-50",arrow:"border-t-yellow-500",bg:"bg-yellow-500 dark:bg-amber-800"},red:{text:"text-slate-50",arrow:"border-t-red-600",bg:"bg-red-600 dark:bg-red-800"},default:{bg:"bg-gray-600",text:"text-slate-50",arrow:"border-t-gray-800"}},ve=({text:t,children:e,position:s="top",color:r="default"})=>{const a=fr[r],n=f.useRef(null),[i,l]=f.useState(!1),[d,c]=f.useState({top:0,left:0,transform:""});return f.useEffect(()=>{if(!i||!n.current)return;const u=n.current.getBoundingClientRect(),y=8,w=(()=>{switch(s){case"bottom":return{top:u.bottom+window.scrollY+y,left:u.left+window.scrollX+u.width/2,transform:"translateX(-50%)"};case"left":return{top:u.top+window.scrollY+u.height/2,left:u.left+window.scrollX-y,transform:"translate(-100%, -50%)"};case"right":return{top:u.top+window.scrollY+u.height/2,left:u.right+window.scrollX+y,transform:"translateY(-50%)"};default:return{top:u.top+window.scrollY-y,left:u.left+window.scrollX+u.width/2,transform:"translate(-50%, -100%)"}}})();c(w)},[i,s]),o.jsxs("div",{ref:n,className:"relative",onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),onFocus:()=>l(!0),onBlur:()=>l(!1),children:[e,typeof document<"u"&&Zt.createPortal(o.jsx("div",{style:{top:d.top,left:d.left,transform:d.transform},className:`fixed px-2 py-1 text-xs rounded shadow-lg transition-opacity duration-150 whitespace-nowrap pointer-events-none z-50 ${a.bg} ${a.text} ${i?"opacity-100":"opacity-0"}`,children:t}),document.body)]})},bt={xs:"max-w-xs",xl:"max-w-xl",small:"max-w-sm",large:"max-w-lg",medium:"max-w-md","2xl":"max-w-2xl","3xl":"max-w-3xl","4xl":"max-w-4xl",full:"max-w-full mx-4"},mr={info:"bg-cyan-500 dark:bg-cyan-600 text-white",danger:"bg-red-500 dark:bg-red-600 text-white",secondary:"bg-gray-500 dark:bg-gray-600 text-white",success:"bg-green-500 dark:bg-green-600 text-white",primary:"bg-violet-600 dark:bg-violet-700 text-white",warning:"bg-yellow-500 dark:bg-yellow-600 text-white",default:"bg-slate-50 dark:bg-slate-800/50 border-b border-slate-200 dark:border-slate-700"},Xe=({children:t,className:e="",variant:s=V.Default})=>{const r="px-6 py-4 rounded-t-xl",a=mr[s];return o.jsx("div",{className:`${r} ${a} ${e}`,children:t})},Ge=({children:t,className:e=""})=>o.jsx("div",{className:`px-6 py-4 ${e}`,children:t}),Ht=({children:t,className:e=""})=>o.jsx("div",{className:`px-6 py-4 bg-slate-50 dark:bg-slate-800/50 border-t border-slate-200 dark:border-slate-700 rounded-b-xl flex items-center justify-end gap-3 ${e}`,children:t}),hr=({title:t,isOpen:e,onClose:s,children:r,zIndex:a=50,className:n="",onOverlayClick:i,onEscapeKeyDown:l,size:d=Q.Medium,contentClassName:c="",closeOnEscape:u=!1,showCloseButton:y=!0,variant:w=V.Default,closeOnOverlayClick:N=!1})=>{let T=null,v=null,p=null;if(f.Children.forEach(r,g=>{f.isValidElement(g)&&(g.type===Xe?T=g:g.type===Ge?v=g:g.type===Ht?p=g:v=g)}),f.useEffect(()=>{if(!e||!u)return;const g=L=>{L.key==="Escape"&&(l?l(L):s())};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[e,u,s,l]),f.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),!e)return null;const _=g=>{g.target===g.currentTarget&&(i?i(g):N&&s())},h=bt[d]||bt.medium,b=w!==V.Default;return o.jsx("div",{role:"dialog","aria-modal":"true",style:{zIndex:a},onClick:_,className:`fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center p-4 ${n}`,children:o.jsxs("div",{className:`bg-white dark:bg-slate-800 rounded-xl shadow-2xl w-full max-h-[90vh] flex flex-col ${h} transform transition-all ${c}`,children:[T?o.jsx("div",{className:"shrink-0",children:T}):t?o.jsx("div",{className:"shrink-0",children:o.jsx(Xe,{variant:w,children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("h3",{className:`text-xl font-semibold ${b?"text-white":"text-slate-900 dark:text-slate-100"}`,children:t}),y&&o.jsx("button",{onClick:s,"aria-label":"Close modal",className:`p-1 rounded-lg transition-colors ${b?"hover:bg-white/20 text-white":"hover:bg-slate-100 dark:hover:bg-slate-700 text-slate-500 dark:text-slate-400"}`,children:o.jsx(yt,{className:"w-5 h-5"})})]})})}):y?o.jsx("div",{className:"absolute top-4 right-4 z-10",children:o.jsx("button",{onClick:s,className:"p-1 rounded-lg hover:bg-slate-100 dark:hover:bg-slate-700 text-slate-500 dark:text-slate-400 transition-colors","aria-label":"Close modal",children:o.jsx(yt,{className:"w-5 h-5"})})}):null,o.jsx("div",{className:"flex-1 overflow-y-auto",children:typeof v=="string"?o.jsx(Ge,{children:v}):v}),p&&o.jsx("div",{className:"shrink-0",children:p})]})})},be={info:"border-t-cyan-500",danger:"border-t-red-500",success:"border-t-green-500",secondary:"border-t-gray-500",warning:"border-t-yellow-500",primary:"border-t-violet-600"},pr={info:"text-slate-100 bg-cyan-500",danger:"text-slate-100 bg-red-500",default:"border-b border-slate-300",success:"text-slate-100 bg-green-500",secondary:"text-slate-100 bg-gray-500",warning:"text-slate-100 bg-yellow-500",primary:"text-slate-100 bg-violet-600 dark:bg-slate-500 dark:text-slate-200"},gr={default:"border-slate-300",info:`border-white/5 border-t-2 ${be.info}`,danger:`border-white/5 border-t-2 ${be.danger}`,success:`border-white/5 border-t-2 ${be.success}`,primary:`border-white/5 border-t-2 ${be.primary}`,warning:`border-white/5 border-t-2 ${be.warning}`,secondary:`border-white/5 border-t-2 ${be.secondary}`},qt={[X.Full]:"rounded-3xl",[X.Large]:"rounded-lg",[X.Small]:"rounded-sm",[X.None]:"rounded-none",[X.Medium]:"rounded-md"},Wt=f.createContext(void 0),Be=({children:t,className:e="",variant:s=V.Default,shouldTitleBgColor:r=!0,rounded:a=X.Medium})=>(r||(a=X.Small),o.jsx(Wt.Provider,{value:{rounded:a,variant:s,shouldTitleBgColor:r},children:o.jsx("div",{className:[e,qt[a],`${!r&&gr[s]}`,"bg-slate-50 shadow-lg backdrop-blur-lg transition duration-200 border-2 border-slate-100 dark:border-none dark:bg-slate-800"].filter(Boolean).join(" "),children:t})})),Xt=({children:t,className:e=""})=>{const s=f.useContext(Wt),r=s?.shouldTitleBgColor??!1,a=qt[s?.rounded??X.Medium],n=pr[s?.variant??V.Primary],i=r?n:"border-b border-slate-300";return o.jsx("div",{className:[a,e,i,"px-4 py-2 rounded-bl-none rounded-br-none"].join(" "),children:t})},yr=({children:t,className:e=""})=>o.jsx("div",{className:["px-4 py-2 border-t border-slate-300",e].join(" "),children:t}),De=({children:t,className:e=""})=>o.jsx("div",{className:[e,"px-4 py-2 text-slate-800 dark:text-slate-200"].join(" "),children:t}),br=({title:t,value:e,color:s,icon:r,className:a=""})=>{const n={"bg-orange-500":{light:"bg-orange-100",dark:"dark:bg-orange-900/30",icon:"text-orange-600 dark:text-orange-400"},"bg-green-500":{light:"bg-green-100",dark:"dark:bg-green-900/30",icon:"text-green-600 dark:text-green-400"},"bg-violet-500":{light:"bg-violet-100",dark:"dark:bg-violet-900/30",icon:"text-violet-600 dark:text-violet-400"},"bg-blue-500":{light:"bg-blue-100",dark:"dark:bg-blue-900/30",icon:"text-blue-600 dark:text-blue-400"},"bg-yellow-500":{light:"bg-yellow-100",dark:"dark:bg-yellow-900/30",icon:"text-yellow-600 dark:text-yellow-400"}},i=n[s]||n["bg-violet-500"];return o.jsx(Be,{className:`card-hover ${a}`,children:o.jsx(De,{className:"p-6",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium text-slate-600 dark:text-slate-400 mb-1",children:t}),o.jsx("p",{className:"text-2xl font-bold text-slate-900 dark:text-slate-100",children:e})]}),o.jsx("div",{className:`p-3 rounded-xl ${i.light} ${i.dark}`,children:o.jsx(r,{className:`w-6 h-6 ${i.icon}`})})]})})})},xr=({title:t,value:e,color:s,change:r,changeType:a,icon:n})=>{const i={"bg-violet-500":{light:"bg-violet-100",dark:"dark:bg-violet-900/30",icon:"text-violet-600 dark:text-violet-400"},"bg-green-500":{light:"bg-green-100",dark:"dark:bg-green-900/30",icon:"text-green-600 dark:text-green-400"},"bg-yellow-500":{light:"bg-yellow-100",dark:"dark:bg-yellow-900/30",icon:"text-yellow-600 dark:text-yellow-400"},"bg-blue-500":{light:"bg-blue-100",dark:"dark:bg-blue-900/30",icon:"text-blue-600 dark:text-blue-400"}},l=i[s]||i["bg-violet-500"];return o.jsx(Be,{className:"card-hover",children:o.jsxs(De,{className:"p-6",children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsx("div",{className:`p-3 rounded-xl ${l.light} ${l.dark}`,children:o.jsx(n,{className:`w-6 h-6 ${l.icon}`})}),r&&o.jsxs("div",{className:`flex items-center gap-1 text-sm font-semibold ${a==="positive"?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400"}`,children:[a==="positive"?o.jsx(Rs,{className:"w-4 h-4"}):o.jsx(Os,{className:"w-4 h-4"}),r]})]}),o.jsx("h3",{className:"text-sm font-semibold text-slate-500 dark:text-slate-400 mb-1 uppercase tracking-wide",children:t}),o.jsx("p",{className:"text-3xl font-bold text-slate-900 dark:text-slate-100",children:e})]})})},vr={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"},dt=f.createContext(void 0),_r=({children:t,className:e="",rounded:s=X.Medium})=>o.jsx("div",{className:["overflow-x-auto overflow-hidden border border-gray-200 dark:border-gray-700",vr[s],e].filter(Boolean).join(" "),children:o.jsx("table",{className:"w-full border-collapse",children:t})}),kr=({children:t,className:e=""})=>o.jsx(dt.Provider,{value:"head",children:o.jsx("thead",{className:`bg-gray-200 dark:bg-gray-800 ${e}`,children:t})}),wr=({children:t,className:e=""})=>o.jsx(dt.Provider,{value:"body",children:o.jsx("tbody",{className:e,children:t})}),jr=({children:t,hover:e=!0,className:s=""})=>{const r=f.useContext(dt),a=e&&r!=="head",n=r==="body";return o.jsx("tr",{className:["border-b border-gray-200 dark:border-gray-700",n&&"even:bg-gray-100 dark:even:bg-gray-700",a&&"hover:bg-gray-50 dark:hover:bg-gray-800/50",s].filter(Boolean).join(" "),children:t})},Nr=({children:t,align:e="left",className:s=""})=>{const r={left:"text-left",right:"text-right",center:"text-center"};return o.jsx("th",{className:["px-4 py-3 font-semibold text-sm text-gray-700 dark:text-gray-300 uppercase tracking-wider",r[e],s].filter(Boolean).join(" "),children:t})},Tr=({colSpan:t,children:e,className:s="",align:r="left"})=>{const a={left:"text-left",right:"text-right",center:"text-center"};return o.jsx("td",{colSpan:t,className:`px-4 py-3 text-sm text-gray-900 dark:text-gray-100 ${a[r]} ${s}`,children:e})},Gt=({open:t,blur:e=!0,overlayClassName:s,showBackdrop:r=!0,variant:a=V.Primary,message:n="Getting things ready..."})=>{if(!t)return null;const i=o.jsx("div",{className:["fixed inset-0 z-1200 flex items-center justify-center p-6",r?"bg-slate-900/50 dark:bg-black/20":"pointer-events-none",e?"backdrop-blur-sm":"",s].filter(Boolean).join(" "),role:"alert","aria-busy":"true","aria-live":"assertive",children:o.jsxs("div",{className:"flex items-center gap-3 rounded-xl bg-slate-50/90 px-6 py-4 shadow-2xl ring-1 ring-black/5 dark:bg-slate-900/85 dark:ring-white/5",children:[o.jsx(Ze,{size:"lg",variant:a}),n&&o.jsx("span",{className:"text-sm font-semibold text-slate-800 dark:text-slate-100",children:n})]})});return typeof document>"u"?i:Zt.createPortal(i,document.body)},Yt=({icon:t,action:e,target:s,time:r,type:a})=>{const n={success:"bg-green-100 dark:bg-green-900/30 text-green-600 dark:text-green-400",info:"bg-blue-100 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400",warning:"bg-yellow-100 dark:bg-yellow-900/30 text-yellow-600 dark:text-yellow-400"};return o.jsxs("div",{className:"flex items-start gap-4 py-3",children:[o.jsx("div",{className:`p-2 rounded-lg ${n[a]}`,children:o.jsx(t,{className:"w-4 h-4"})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"text-sm font-medium text-slate-900 dark:text-slate-100",children:e}),o.jsx("p",{className:"text-sm text-violet-600 dark:text-violet-400 font-medium",children:s})]}),o.jsx("span",{className:"text-xs text-slate-500 dark:text-slate-400 whitespace-nowrap",children:r})]})},Cr=({title:t="Recent Activity",icon:e=Is,activities:s,className:r=""})=>o.jsxs(Be,{className:r,children:[o.jsx(Xt,{children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("h2",{className:"text-lg font-semibold text-slate-900 dark:text-slate-100",children:t}),o.jsx(e,{className:"w-5 h-5 text-slate-400"})]})}),o.jsx(De,{children:o.jsx("div",{className:"divide-y divide-slate-200 dark:divide-slate-600",children:s.map((a,n)=>o.jsx(Yt,{icon:a.icon,action:a.action,target:a.target,time:a.time,type:a.type},n))})})]}),Sr=({label:t,value:e,color:s="bg-violet-600",showPercentage:r=!0,className:a=""})=>{const i={"bg-violet-600":"bg-violet-600","bg-blue-600":"bg-blue-600","bg-green-600":"bg-green-600","bg-red-600":"bg-red-600","bg-yellow-600":"bg-yellow-600","bg-orange-600":"bg-orange-600","bg-purple-600":"bg-purple-600","bg-pink-600":"bg-pink-600"}[s]||s;return o.jsxs("div",{className:`space-y-2 ${a}`,children:[o.jsxs("div",{className:"flex justify-between items-center",children:[o.jsx("span",{className:"text-sm font-medium text-slate-700 dark:text-slate-300",children:t}),o.jsxs("span",{className:"text-sm font-bold text-slate-900 dark:text-slate-100",children:[e,r&&"%"]})]}),o.jsx("div",{className:"w-full bg-slate-200 dark:bg-slate-700 rounded-full h-2 overflow-hidden",children:o.jsx("div",{className:`${i} h-2 rounded-full transition-all duration-700 ease-out`,style:{width:`${Math.min(100,Math.max(0,e))}%`}})})]})},Er=({limit:t,totalDocs:e,totalPages:s,currentPage:r,hasPrevPage:a,hasNextPage:n,onPageChange:i,onLimitChange:l,outline:d=!1,variant:c=V.Primary})=>{const u=d,y=d||!0,w=(r-1)*t+1,N=Math.min(r*t,e),T=()=>{const v=[];let _=Math.max(1,r-Math.floor(2.5)),h=Math.min(s,_+5-1);h-_+1<5&&(_=Math.max(1,h-5+1)),v.push(o.jsx(K,{outline:!0,size:Q.Small,variant:c,ariaLabel:"Previous",disabled:!a,icon:o.jsx(Ps,{className:"size-4","aria-hidden":"true"}),onClick:()=>a&&i(r-1),className:"rounded-l-md focus:z-20"},"prev")),_>1&&(v.push(o.jsx(K,{outline:!0,label:"1",size:Q.Small,variant:c,ariaLabel:"Page 1",onClick:()=>i(1),className:"focus:z-20"},1)),_>2&&v.push(o.jsx("span",{className:"relative inline-flex items-center px-4 py-2 text-sm font-semibold text-gray-400 inset-ring inset-ring-gray-700 focus:outline-offset-0 rounded-md",children:"..."},"ellipsis-start")));for(let b=_;b<=h;b++)v.push(o.jsx(K,{size:Q.Small,variant:c,label:b.toString(),ariaLabel:`Page ${b}`,onClick:()=>i(b),outline:b!==r?y:u,className:`focus:z-20 ${r===b&&"dark:bg-gray-700"}`},b));return h<s&&(h<s-1&&v.push(o.jsx("span",{className:"relative inline-flex items-center px-4 py-2 text-sm rounded-md font-semibold text-gray-500 inset-ring inset-ring-gray-300 focus:outline-offset-0",children:"..."},"ellipsis-end")),v.push(o.jsx(K,{outline:!0,size:Q.Small,variant:c,label:s.toString(),ariaLabel:`Page ${s}`,onClick:()=>i(s),className:"focus:z-20"},s))),v.push(o.jsx(K,{outline:!0,ariaLabel:"Next",size:Q.Small,variant:c,disabled:!n,onClick:()=>n&&i(r+1),icon:o.jsx(Vt,{className:"size-4","aria-hidden":"true"}),className:"rounded-r-md focus:z-20"},"next")),v};return o.jsxs("div",{className:"mt-4 flex justify-between items-center border-t-2 border-gray-300 dark:border-gray-500",children:[o.jsx("div",{className:"flex items-center gap-2",children:o.jsx(it,{value:t,onChange:v=>l(Number(v)),options:[{label:"1",value:1},{label:"10",value:10},{label:"25",value:25},{label:"50",value:50},{label:"100",value:100}]})}),o.jsxs("div",{className:"flex items-center justify-between pl-4 py-2 sm:pl-6",children:[o.jsxs("div",{className:"flex justify-between sm:hidden gap-2",children:[o.jsx(K,{outline:!0,label:"Previous",variant:c,size:Q.Medium,disabled:!a,onClick:()=>a&&i(r-1),className:"w-full justify-center"}),o.jsx(K,{outline:!0,label:"Next",variant:c,size:Q.Medium,disabled:!n,onClick:()=>n&&i(r+1),className:"w-full justify-center"})]}),o.jsxs("div",{className:"hidden sm:flex sm:flex-1 sm:items-center sm:justify-between",children:[o.jsx("div",{children:o.jsxs("p",{className:"text-sm text-gray-800 dark:text-gray-200 mr-2",children:["Showing ",o.jsxs("span",{className:"font-medium",children:[w," "]}),"to ",o.jsxs("span",{className:"font-medium",children:[N," "]}),"of ",o.jsxs("span",{className:"font-medium",children:[e," "]}),"results"]})}),o.jsx("div",{children:o.jsx("nav",{"aria-label":"Pagination",className:"isolate inline-flex gap-2 rounded-md",children:T()})})]})]})]})},Ir={info:"focus:border-sky-400 focus-visible:border-sky-400",danger:"focus:border-red-400 focus-visible:border-red-400",default:"focus:border-slate-400 focus-visible:border-slate-400",warning:"focus:border-amber-400 focus-visible:border-amber-400",primary:"focus:border-violet-400 focus-visible:border-violet-400",secondary:"focus:border-slate-400 focus-visible:border-slate-400",success:"focus:border-emerald-400 focus-visible:border-emerald-400"},Ye=({id:t,name:e,icon:s,label:r,error:a,value:n,onChange:i,placeholder:l,type:d="text",className:c="",disabled:u=!1,forceDarkTheme:y=!1,variant:w=V.Primary,rounded:N=X.Medium})=>{const T=!!s,v=T?"pl-9 pr-3 py-2":"p-2",p={sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",none:"rounded-none",full:"rounded-full"};return o.jsxs("div",{className:`${y?"dark":""} w-full`,children:[r?o.jsx("label",{htmlFor:t,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:r}):null,o.jsxs("div",{className:"relative",children:[T?o.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-3 flex items-center text-gray-800 dark:text-gray-300",children:s}):null,o.jsx("input",{id:t,name:e,type:d,value:n,disabled:u,placeholder:l,onChange:_=>i(_.target.value),className:["block w-full px-4 py-3 bg-slate-50 dark:bg-gray-700 text-slate-800 dark:text-slate-100 shadow-sm placeholder-gray-400 focus:outline-none transition-colors",v,p[N],Ir[w],c,a?"border border-red-700 dark:border-red-500 focus:border-red-700 focus-visible:border-red-700":"border border-gray-300 dark:border-gray-600 focus:border-violet-400 focus-visible:border-violet-400"].join(" ")})]}),a&&o.jsxs("div",{role:"alert",className:"mt-1 text-sm font-medium text-red-700",children:[a,"!"]})]})},$r={info:"focus:border-sky-400 focus-visible:border-sky-400",danger:"focus:border-red-400 focus-visible:border-red-400",default:"focus:border-slate-400 focus-visible:border-slate-400",warning:"focus:border-amber-400 focus-visible:border-amber-400",primary:"focus:border-violet-400 focus-visible:border-violet-400",secondary:"focus:border-slate-400 focus-visible:border-slate-400",success:"focus:border-emerald-400 focus-visible:border-emerald-400"},Or={none:"resize-none",both:"resize",vertical:"resize-y",horizontal:"resize-x"},Lr={sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",none:"rounded-none",full:"rounded-full"},Rr=({id:t,name:e,label:s,error:r,value:a,onChange:n,placeholder:i,rows:l=4,className:d="",disabled:c=!1,forceDarkTheme:u=!1,variant:y=V.Primary,rounded:w=X.Medium,resize:N="vertical"})=>o.jsxs("div",{className:u?"dark":"",children:[s?o.jsx("label",{htmlFor:t,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:s}):null,o.jsx("textarea",{id:t,name:e,rows:l,disabled:c,placeholder:i,value:a,onChange:T=>n(T.target.value),className:["block w-full px-4 py-3 bg-slate-50 dark:bg-gray-700 text-slate-800 dark:text-slate-100 shadow-sm placeholder-gray-400 focus:outline-none border transition-colors",Lr[w],Or[N],$r[y],r?"border-red-700 dark:border-red-500 focus:border-red-700 focus-visible:border-red-700":"border-gray-300 dark:border-gray-600 focus:border-violet-400 focus-visible:border-violet-400",c?"cursor-not-allowed opacity-70":"",d].join(" ")}),r?o.jsx("p",{role:"alert",className:"mt-1 text-sm font-medium text-red-700",children:r}):null]}),Ar={info:"text-sky-600 accent-sky-500 hover:border-sky-400 focus-visible:border-sky-400",danger:"text-red-600 accent-red-500 hover:border-red-400 focus-visible:border-red-400",default:"text-slate-700 accent-slate-500 hover:border-slate-400 focus-visible:border-slate-400",warning:"text-amber-600 accent-amber-500 hover:border-amber-400 focus-visible:border-amber-400",primary:"text-violet-700 accent-violet-500 hover:border-violet-400 focus-visible:border-violet-400",secondary:"text-slate-700 accent-slate-600 hover:border-slate-500 focus-visible:border-slate-500",success:"text-emerald-700 accent-emerald-500 hover:border-emerald-400 focus-visible:border-emerald-400"},Mr={info:"focus-within:border-sky-400",danger:"focus-within:border-red-400",default:"focus-within:border-slate-400",warning:"focus-within:border-amber-400",primary:"focus-within:border-violet-400",secondary:"focus-within:border-slate-500",success:"focus-within:border-emerald-400"},zr=({id:t,name:e,label:s,description:r,checked:a,onChange:n,className:i="",disabled:l=!1,forceDarkTheme:d=!1,variant:c=V.Primary})=>{const u=Ar[c],y=Mr[c],w=l?"cursor-not-allowed opacity-60":"cursor-pointer";return o.jsx("div",{className:d?"dark":"",children:o.jsxs("label",{htmlFor:t,className:["flex items-start gap-3 rounded-lg px-3 py-2.5 transition-colors border-transparent",y,w,i].join(" "),children:[o.jsx("input",{id:t,name:e,type:"checkbox",checked:a,disabled:l,onChange:N=>n(N.target.checked),className:["mt-0.5 h-5 w-5 rounded-md border border-slate-300 bg-slate-50 text-slate-900 outline-none transition duration-150 ease-in-out","focus:outline-none focus-visible:border-slate-400 dark:border-gray-600 dark:bg-gray-700 dark:focus-visible:border-slate-300",u,w].join(" ")}),o.jsxs("span",{className:"space-y-1 select-none",children:[s?o.jsx("span",{className:"block text-sm font-semibold text-gray-700 dark:text-slate-100",children:s}):null,r?o.jsx("span",{className:"block text-xs text-gray-600 dark:text-gray-300",children:r}):null]})]})})},Pr={info:"bg-sky-500",danger:"bg-red-600",default:"bg-slate-500",warning:"bg-amber-500",primary:"bg-violet-600",secondary:"bg-slate-600",success:"bg-emerald-600"},Zr={info:"focus-visible:border-sky-400",danger:"focus-visible:border-red-400",default:"focus-visible:border-slate-400",warning:"focus-visible:border-amber-400",primary:"focus-visible:border-violet-500",secondary:"focus-visible:border-slate-500",success:"focus-visible:border-emerald-400"},Br=({id:t,name:e,label:s,error:r,checked:a,onChange:n,description:i,className:l="",disabled:d=!1,forceDarkTheme:c=!1,variant:u=V.Primary})=>{const y=a?Pr[u]:"bg-gray-200 dark:bg-gray-700",w=d?"opacity-60 cursor-not-allowed":"cursor-pointer";return o.jsxs("div",{className:[c?"dark":"","flex items-center gap-3"].join(" "),children:[o.jsx("button",{id:t,name:e,type:"button",role:"switch","aria-checked":a,"aria-disabled":d,onClick:()=>d?null:n(!a),className:["relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors border border-transparent focus:outline-none focus-visible:shadow-sm",y,Zr[u],w,l].join(" "),children:o.jsx("span",{"aria-hidden":"true",className:["inline-block h-5 w-5 transform rounded-full bg-slate-50 shadow transition",a?"translate-x-5":"translate-x-1"].join(" ")})}),(s||i)&&o.jsxs("div",{className:"space-y-0.5",children:[s?o.jsx("label",{htmlFor:t,className:["text-sm font-semibold text-slate-900 dark:text-slate-100",w].join(" "),children:s}):null,i?o.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300",children:i}):null]}),r&&o.jsxs("div",{role:"alert",className:"mt-1 text-sm font-medium text-red-700",children:[r,"!"]})]})},Dr={info:"text-sky-600 accent-sky-500 hover:border-sky-400 focus-visible:border-sky-400",danger:"text-red-600 accent-red-500 hover:border-red-400 focus-visible:border-red-400",default:"text-slate-700 accent-slate-500 hover:border-slate-400 focus-visible:border-slate-400",warning:"text-amber-600 accent-amber-500 hover:border-amber-400 focus-visible:border-amber-400",primary:"text-violet-700 accent-violet-500 hover:border-violet-400 focus-visible:border-violet-400",secondary:"text-slate-700 accent-slate-600 hover:border-slate-500 focus-visible:border-slate-500",success:"text-emerald-700 accent-emerald-500 hover:border-emerald-400 focus-visible:border-emerald-400"},Vr={info:"focus-within:border-sky-400",danger:"focus-within:border-red-400",default:"focus-within:border-slate-400",warning:"focus-within:border-amber-400",primary:"focus-within:border-violet-400",secondary:"focus-within:border-slate-500",success:"focus-within:border-emerald-400"},Fr=({name:t,label:e,options:s,value:r,onChange:a,className:n="",disabled:i=!1,error:l,forceDarkTheme:d=!1,orientation:c="vertical",variant:u=V.Primary})=>{const y=c==="horizontal"?"flex-row flex-wrap gap-4":"flex-col gap-3";return o.jsxs("fieldset",{className:[d?"dark":"",n].join(" "),children:[e?o.jsx("legend",{className:"text-sm font-semibold text-gray-700 dark:text-slate-100",children:e}):null,o.jsx("div",{className:["flex",y].join(" "),children:s.map(w=>{const N=String(r)===String(w.value),T=i||w.disabled,v=Dr[u],p=Vr[u],_=T?"cursor-not-allowed opacity-60":"cursor-pointer";return o.jsxs("label",{className:["flex items-start gap-2 rounded-lg px-3 py-2.5 shadow-sm dark:shadow-none transition-colors border border-transparent",p,_].join(" "),children:[o.jsx("input",{type:"radio",name:t,value:String(w.value),checked:N,disabled:T,onChange:h=>a(h.target.value),className:["mt-0.5 h-5 w-5 rounded-full border border-slate-300 bg-slate-50 text-slate-900 outline-none transition duration-150 ease-in-out","focus:outline-none focus-visible:border-slate-400 dark:border-gray-600 dark:bg-gray-700 dark:focus-visible:border-slate-300",v,_].join(" ")}),o.jsxs("span",{className:"space-y-1",children:[o.jsx("span",{className:"block text-sm font-semibold text-gray-700 dark:text-slate-100",children:w.label}),w.description?o.jsx("span",{className:"block text-xs text-gray-600 dark:text-gray-300",children:w.description}):null]})]},String(w.value))})}),l&&o.jsxs("div",{role:"alert",className:"mt-1 text-sm font-medium text-red-700",children:[l,"!"]})]})},Ur={info:"focus:border-sky-400 focus-visible:border-sky-400",danger:"focus:border-red-400 focus-visible:border-red-400",default:"focus:border-slate-400 focus-visible:border-slate-400",warning:"focus:border-amber-400 focus-visible:border-amber-400",primary:"focus:border-violet-400 focus-visible:border-violet-400 dark:focus:border-slate-300 dark:focus-visible:border-slate-300",secondary:"focus:border-slate-400 focus-visible:border-slate-400",success:"focus:border-emerald-400 focus-visible:border-emerald-400"},Hr={xs:"px-2 py-2 text-xs",small:"px-3 py-2.5 text-sm",medium:"px-3.5 py-3 text-sm",large:"px-4 py-3.5 text-base"},qr={xs:"text-[10px] px-1.5 py-0.5",small:"text-xs px-2 py-0.5",medium:"text-xs px-2 py-1",large:"text-sm px-2.5 py-1"},Wr=({id:t,name:e,label:s,error:r,options:a,onChange:n,className:i="",groupedOptions:l,selectedValues:d,disabled:c=!1,size:u=Q.Small,searchable:y=!0,showSelectAll:w=!0,forceDarkTheme:N=!1,variant:T=V.Primary,dropdownMaxHeight:v="60vh",placeholder:p="Select option(s)",emptyStateLabel:_="No results found"})=>{const[h,b]=f.useState(!1),[g,L]=f.useState(""),Z=f.useRef(null),$=f.useRef(null),C=f.useMemo(()=>d.map(I=>String(I)),[d]),B=f.useMemo(()=>l&&Object.keys(l).length>0?Object.values(l).flat():a??[],[l,a]),F=f.useMemo(()=>B.map(I=>String(I.value)),[B]),P=f.useMemo(()=>F.length>0&&F.every(I=>C.includes(I)),[F,C]),W=()=>!c&&b(I=>!I),G=f.useCallback(I=>{Z.current&&!Z.current.contains(I.target)&&b(!1)},[]);f.useEffect(()=>{if(h)return document.addEventListener("mousedown",G),()=>document.removeEventListener("mousedown",G)},[G,h]),f.useEffect(()=>{h&&$.current&&y&&$.current.focus()},[h,y]);const fe=I=>{n(Array.from(new Set(I)))},ge=()=>{fe(P?[]:F)},ye=I=>{const z=I.map(Y=>String(Y.value)),se=z.every(Y=>C.includes(Y));fe(se?C.filter(Y=>!z.includes(Y)):[...C,...z])},ae=I=>{const z=C.includes(I);fe(z?C.filter(se=>se!==I):[...C,I])},te=f.useMemo(()=>B.filter(I=>C.includes(String(I.value))),[B,C]),fs=f.useMemo(()=>{if(!te.length)return p;const[I,...z]=te;return z.length?`${I.label} +${z.length} more`:I.label},[te,p]),ft=f.useMemo(()=>{const I=g.toLowerCase();return B.filter(z=>String(z.label).toLowerCase().includes(I))},[B,g]),mt=f.useMemo(()=>{if(!l)return;const I=g.toLowerCase(),z={};return Object.entries(l).forEach(([se,Y])=>{const pt=Y.filter(ys=>String(ys.label).toLowerCase().includes(I));pt.length>0&&(z[se]=pt)}),Object.keys(z).length>0?z:void 0},[l,g]),ms=f.useMemo(()=>typeof v=="number"?{maxHeight:`${v}px`}:{maxHeight:v},[v]),hs=Hr[u],ps=qr[u],gs=r?"border border-red-700 dark:border-red-500 focus:border-red-700 focus-visible:border-red-700":h?"border border-slate-300 dark:border-slate-500 shadow-sm":"border border-slate-200 dark:border-slate-600 shadow-sm",ht=I=>{const z=String(I.value),se=C.includes(z);return o.jsxs("li",{className:`flex items-center gap-2 px-3 py-2 cursor-pointer hover:bg-slate-200 dark:hover:bg-slate-800 ${se?"bg-slate-100 dark:bg-slate-700":""}`,onClick:()=>ae(z),children:[o.jsx("input",{type:"checkbox",readOnly:!0,checked:se,className:"w-5 h-5 rounded-md border border-slate-300 bg-slate-50 text-violet-600 accent-violet-500 outline-none transition duration-150 ease-in-out cursor-pointer hover:border-violet-400 focus-visible:border-violet-400 dark:text-slate-100 dark:accent-slate-100 dark:hover:border-slate-400 dark:focus-visible:border-slate-300 disabled:opacity-60 disabled:cursor-not-allowed"}),o.jsx("span",{className:"text-sm text-slate-800 dark:text-slate-100",children:I.label})]},z)};return o.jsxs("div",{className:N?"dark":"",children:[s?o.jsx("label",{htmlFor:t,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:s}):null,o.jsxs("div",{ref:Z,className:`relative ${i}`,"aria-expanded":h,"aria-haspopup":"listbox",children:[o.jsxs("button",{type:"button",id:t,name:e,disabled:c,onClick:W,className:`w-full flex items-center justify-between gap-2 rounded-md bg-slate-50 dark:bg-gray-700 text-slate-900 dark:text-slate-100 border border-slate-200 dark:border-slate-500 focus:outline-none focus-visible:shadow-sm disabled:cursor-not-allowed disabled:opacity-60 transition-colors ${Ur[T]} ${hs} ${gs}`,children:[o.jsx("div",{className:"flex flex-wrap items-center gap-2 min-h-6 flex-1",children:te.length?te.map(I=>o.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full bg-violet-600 text-slate-50 dark:bg-slate-500 dark:text-slate-100 ${ps}`,children:[I.label,o.jsx("span",{role:"button",tabIndex:0,className:"text-xs font-semibold hover:text-violet-900 dark:hover:text-slate-50 cursor-pointer",onClick:z=>{z.stopPropagation(),ae(String(I.value))},onKeyDown:z=>{(z.key==="Enter"||z.key===" ")&&(z.stopPropagation(),z.preventDefault(),ae(String(I.value)))},children:"×"})]},String(I.value))):o.jsx("span",{className:"text-sm text-slate-500 dark:text-slate-400",children:fs})}),o.jsx("span",{className:"pointer-events-none text-gray-500 dark:text-gray-300",children:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"none",className:"h-4 w-4",stroke:"currentColor",strokeWidth:"1.5",children:o.jsx("path",{d:"M6 8l4 4 4-4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),h?o.jsxs("div",{className:"absolute left-0 right-0 mt-2 rounded-md bg-slate-50 dark:bg-slate-900 border border-gray-200 dark:border-gray-700 shadow-lg z-20",children:[y?o.jsx("div",{className:"p-2 border-b border-gray-200 dark:border-gray-700",children:o.jsx("input",{ref:$,type:"text",placeholder:"Search options...",value:g,onChange:I=>L(I.target.value),className:"w-full rounded-md border border-gray-300 dark:border-gray-700 bg-slate-50 dark:bg-gray-800 px-3 py-2 text-sm text-slate-800 dark:text-slate-100 focus:outline-none focus:border-violet-400 focus-visible:border-violet-400 dark:focus:border-slate-300 dark:focus-visible:border-slate-300 transition-colors",onClick:I=>I.stopPropagation()})}):null,o.jsxs("ul",{role:"listbox",style:ms,className:"max-h-[60vh] overflow-auto py-2",children:[w&&F.length>0?o.jsx("li",{className:"px-3 pb-2",children:o.jsxs("button",{type:"button",onClick:ge,className:"flex items-center gap-2 text-sm font-semibold text-slate-800 dark:text-slate-100 hover:text-violet-600 dark:hover:text-slate-100",children:[o.jsx("input",{readOnly:!0,type:"checkbox",checked:P,className:"w-5 h-5 rounded-md border border-slate-300 bg-slate-50 text-violet-600 accent-violet-500 outline-none transition duration-150 ease-in-out cursor-pointer hover:border-violet-400 focus-visible:border-violet-400 dark:text-slate-100 dark:accent-slate-100 dark:hover:border-slate-400 dark:focus-visible:border-slate-300 disabled:opacity-60 disabled:cursor-not-allowed"}),"Select all"]})}):null,mt?Object.entries(mt).map(([I,z])=>{const se=z.map(Y=>String(Y.value)).every(Y=>C.includes(Y));return o.jsxs("li",{className:"py-1",children:[o.jsxs("button",{type:"button",className:"w-full flex items-center gap-2 px-3 py-2 text-sm font-semibold text-slate-700 dark:text-slate-200 hover:bg-slate-200 dark:hover:bg-slate-800",onClick:()=>ye(z),children:[o.jsx("input",{type:"checkbox",checked:se,readOnly:!0,className:"w-5 h-5 rounded-md border border-slate-300 bg-slate-50 text-violet-600 accent-violet-500 outline-none transition duration-150 ease-in-out cursor-pointer hover:border-violet-400 focus-visible:border-violet-400 dark:text-slate-100 dark:accent-slate-100 dark:hover:border-slate-400 dark:focus-visible:border-slate-300 disabled:opacity-60 disabled:cursor-not-allowed"}),I]}),o.jsx("ul",{className:"mt-1 border-l border-gray-200 dark:border-gray-700 ml-5",children:z.map(Y=>ht(Y))})]},I)}):ft.length>0?ft.map(I=>ht(I)):o.jsx("li",{className:"px-3 py-4 text-sm text-slate-500 dark:text-slate-400",children:_})]})]}):null]}),r&&o.jsxs("div",{role:"alert",className:"mt-1 text-sm font-medium text-red-700",children:[r,"!"]})]})};function Jt(t){var e,s,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var a=t.length;for(e=0;e<a;e++)t[e]&&(s=Jt(t[e]))&&(r&&(r+=" "),r+=s)}else for(s in t)t[s]&&(r&&(r+=" "),r+=s);return r}function me(){for(var t,e,s=0,r="",a=arguments.length;s<a;s++)(t=arguments[s])&&(e=Jt(t))&&(r&&(r+=" "),r+=e);return r}function Xr(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s),s.styleSheet?s.styleSheet.cssText=t:s.appendChild(document.createTextNode(t))}Xr(`:root{--toastify-color-light: #fff;--toastify-color-dark: #121212;--toastify-color-info: #3498db;--toastify-color-success: #07bc0c;--toastify-color-warning: #f1c40f;--toastify-color-error: hsl(6, 78%, 57%);--toastify-color-transparent: rgba(255, 255, 255, .7);--toastify-icon-color-info: var(--toastify-color-info);--toastify-icon-color-success: var(--toastify-color-success);--toastify-icon-color-warning: var(--toastify-color-warning);--toastify-icon-color-error: var(--toastify-color-error);--toastify-container-width: fit-content;--toastify-toast-width: 320px;--toastify-toast-offset: 16px;--toastify-toast-top: max(var(--toastify-toast-offset), env(safe-area-inset-top));--toastify-toast-right: max(var(--toastify-toast-offset), env(safe-area-inset-right));--toastify-toast-left: max(var(--toastify-toast-offset), env(safe-area-inset-left));--toastify-toast-bottom: max(var(--toastify-toast-offset), env(safe-area-inset-bottom));--toastify-toast-background: #fff;--toastify-toast-padding: 14px;--toastify-toast-min-height: 64px;--toastify-toast-max-height: 800px;--toastify-toast-bd-radius: 6px;--toastify-toast-shadow: 0px 4px 12px rgba(0, 0, 0, .1);--toastify-font-family: sans-serif;--toastify-z-index: 9999;--toastify-text-color-light: #757575;--toastify-text-color-dark: #fff;--toastify-text-color-info: #fff;--toastify-text-color-success: #fff;--toastify-text-color-warning: #fff;--toastify-text-color-error: #fff;--toastify-spinner-color: #616161;--toastify-spinner-color-empty-area: #e0e0e0;--toastify-color-progress-light: linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55);--toastify-color-progress-dark: #bb86fc;--toastify-color-progress-info: var(--toastify-color-info);--toastify-color-progress-success: var(--toastify-color-success);--toastify-color-progress-warning: var(--toastify-color-warning);--toastify-color-progress-error: var(--toastify-color-error);--toastify-color-progress-bgo: .2}.Toastify__toast-container{z-index:var(--toastify-z-index);-webkit-transform:translate3d(0,0,var(--toastify-z-index));position:fixed;width:var(--toastify-container-width);box-sizing:border-box;color:#fff;display:flex;flex-direction:column}.Toastify__toast-container--top-left{top:var(--toastify-toast-top);left:var(--toastify-toast-left)}.Toastify__toast-container--top-center{top:var(--toastify-toast-top);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--top-right{top:var(--toastify-toast-top);right:var(--toastify-toast-right);align-items:end}.Toastify__toast-container--bottom-left{bottom:var(--toastify-toast-bottom);left:var(--toastify-toast-left)}.Toastify__toast-container--bottom-center{bottom:var(--toastify-toast-bottom);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--bottom-right{bottom:var(--toastify-toast-bottom);right:var(--toastify-toast-right);align-items:end}.Toastify__toast{--y: 0;position:relative;touch-action:none;width:var(--toastify-toast-width);min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:var(--toastify-toast-padding);border-radius:var(--toastify-toast-bd-radius);box-shadow:var(--toastify-toast-shadow);max-height:var(--toastify-toast-max-height);font-family:var(--toastify-font-family);z-index:0;display:flex;flex:1 auto;align-items:center;word-break:break-word}@media only screen and (max-width: 480px){.Toastify__toast-container{width:100vw;left:env(safe-area-inset-left);margin:0}.Toastify__toast-container--top-left,.Toastify__toast-container--top-center,.Toastify__toast-container--top-right{top:env(safe-area-inset-top);transform:translate(0)}.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-right{bottom:env(safe-area-inset-bottom);transform:translate(0)}.Toastify__toast-container--rtl{right:env(safe-area-inset-right);left:initial}.Toastify__toast{--toastify-toast-width: 100%;margin-bottom:0;border-radius:0}}.Toastify__toast-container[data-stacked=true]{width:var(--toastify-toast-width)}.Toastify__toast--stacked{position:absolute;width:100%;transform:translate3d(0,var(--y),0) scale(var(--s));transition:transform .3s}.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body,.Toastify__toast--stacked[data-collapsed] .Toastify__close-button{transition:opacity .1s}.Toastify__toast--stacked[data-collapsed=false]{overflow:visible}.Toastify__toast--stacked[data-collapsed=true]:not(:last-child)>*{opacity:0}.Toastify__toast--stacked:after{content:"";position:absolute;left:0;right:0;height:calc(var(--g) * 1px);bottom:100%}.Toastify__toast--stacked[data-pos=top]{top:0}.Toastify__toast--stacked[data-pos=bot]{bottom:0}.Toastify__toast--stacked[data-pos=bot].Toastify__toast--stacked:before{transform-origin:top}.Toastify__toast--stacked[data-pos=top].Toastify__toast--stacked:before{transform-origin:bottom}.Toastify__toast--stacked:before{content:"";position:absolute;left:0;right:0;bottom:0;height:100%;transform:scaleY(3);z-index:-1}.Toastify__toast--rtl{direction:rtl}.Toastify__toast--close-on-click{cursor:pointer}.Toastify__toast-icon{margin-inline-end:10px;width:22px;flex-shrink:0;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.5s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--light,.Toastify__toast-theme--colored.Toastify__toast--default{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;position:absolute;top:6px;right:6px;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;z-index:1}.Toastify__toast--rtl .Toastify__close-button{left:6px;right:unset}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:hover,.Toastify__close-button:focus{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:100%;z-index:1;opacity:.7;transform-origin:left}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:initial;transform-origin:right;border-bottom-left-radius:initial}.Toastify__progress-bar--wrp{position:absolute;overflow:hidden;bottom:0;left:0;width:100%;height:5px;border-bottom-left-radius:var(--toastify-toast-bd-radius);border-bottom-right-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp[data-hidden=true]{opacity:0}.Toastify__progress-bar--bg{opacity:var(--toastify-color-progress-bgo);width:100%;height:100%}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,var(--y),0)}to{opacity:0;transform:translate3d(2000px,var(--y),0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,var(--y),0)}to{opacity:0;transform:translate3d(-2000px,var(--y),0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--top-left,.Toastify__bounce-enter--bottom-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--top-right,.Toastify__bounce-enter--bottom-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--top-left,.Toastify__bounce-exit--bottom-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--top-right,.Toastify__bounce-exit--bottom-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:translate3d(0,var(--y),0) scale3d(.3,.3,.3)}to{opacity:0}}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:translate3d(0,var(--y),0) perspective(400px)}30%{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(-20deg);opacity:1}to{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideOutRight{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(110%,var(--y),0)}}@keyframes Toastify__slideOutLeft{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(-110%,var(--y),0)}}@keyframes Toastify__slideOutDown{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--top-left,.Toastify__slide-enter--bottom-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--top-right,.Toastify__slide-enter--bottom-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--top-left,.Toastify__slide-exit--bottom-left{animation-name:Toastify__slideOutLeft;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-right,.Toastify__slide-exit--bottom-right{animation-name:Toastify__slideOutRight;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown;animation-timing-function:ease-in;animation-duration:.3s}@keyframes Toastify__spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}
2
+ `);var $e=t=>typeof t=="number"&&!isNaN(t),he=t=>typeof t=="string",ne=t=>typeof t=="function",Gr=t=>he(t)||$e(t),Je=t=>he(t)||ne(t)?t:null,Yr=(t,e)=>t===!1||$e(t)&&t>0?t:e,Qe=t=>f.isValidElement(t)||he(t)||ne(t)||$e(t);function Jr(t,e,s=300){let{scrollHeight:r,style:a}=t;requestAnimationFrame(()=>{a.minHeight="initial",a.height=r+"px",a.transition=`all ${s}ms`,requestAnimationFrame(()=>{a.height="0",a.padding="0",a.margin="0",setTimeout(e,s)})})}function Qr({enter:t,exit:e,appendPosition:s=!1,collapse:r=!0,collapseDuration:a=300}){return function({children:n,position:i,preventExitTransition:l,done:d,nodeRef:c,isIn:u,playToast:y}){let w=s?`${t}--${i}`:t,N=s?`${e}--${i}`:e,T=f.useRef(0);return f.useLayoutEffect(()=>{let v=c.current,p=w.split(" "),_=h=>{h.target===c.current&&(y(),v.removeEventListener("animationend",_),v.removeEventListener("animationcancel",_),T.current===0&&h.type!=="animationcancel"&&v.classList.remove(...p))};v.classList.add(...p),v.addEventListener("animationend",_),v.addEventListener("animationcancel",_)},[]),f.useEffect(()=>{let v=c.current,p=()=>{v.removeEventListener("animationend",p),r?Jr(v,d,a):d()};u||(l?p():(T.current=1,v.className+=` ${N}`,v.addEventListener("animationend",p)))},[u]),f.createElement(f.Fragment,null,n)}}function xt(t,e){return{content:Qt(t.content,t.props),containerId:t.props.containerId,id:t.props.toastId,theme:t.props.theme,type:t.props.type,data:t.props.data||{},isLoading:t.props.isLoading,icon:t.props.icon,reason:t.removalReason,status:e}}function Qt(t,e,s=!1){return f.isValidElement(t)&&!he(t.type)?f.cloneElement(t,{closeToast:e.closeToast,toastProps:e,data:e.data,isPaused:s}):ne(t)?t({closeToast:e.closeToast,toastProps:e,data:e.data,isPaused:s}):t}function Kr({closeToast:t,theme:e,ariaLabel:s="close"}){return f.createElement("button",{className:`Toastify__close-button Toastify__close-button--${e}`,type:"button",onClick:r=>{r.stopPropagation(),t(!0)},"aria-label":s},f.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},f.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function ea({delay:t,isRunning:e,closeToast:s,type:r="default",hide:a,className:n,controlledProgress:i,progress:l,rtl:d,isIn:c,theme:u}){let y=a||i&&l===0,w={animationDuration:`${t}ms`,animationPlayState:e?"running":"paused"};i&&(w.transform=`scaleX(${l})`);let N=me("Toastify__progress-bar",i?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${u}`,`Toastify__progress-bar--${r}`,{"Toastify__progress-bar--rtl":d}),T=ne(n)?n({rtl:d,type:r,defaultClassName:N}):me(N,n),v={[i&&l>=1?"onTransitionEnd":"onAnimationEnd"]:i&&l<1?null:()=>{c&&s()}};return f.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":y},f.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${u} Toastify__progress-bar--${r}`}),f.createElement("div",{role:"progressbar","aria-hidden":y?"true":"false","aria-label":"notification timer",className:T,style:w,...v}))}var ta=1,Kt=()=>`${ta++}`;function sa(t,e,s){let r=1,a=0,n=[],i=[],l=e,d=new Map,c=new Set,u=h=>(c.add(h),()=>c.delete(h)),y=()=>{i=Array.from(d.values()),c.forEach(h=>h())},w=({containerId:h,toastId:b,updateId:g})=>{let L=h?h!==t:t!==1,Z=d.has(b)&&g==null;return L||Z},N=(h,b)=>{d.forEach(g=>{var L;(b==null||b===g.props.toastId)&&((L=g.toggle)==null||L.call(g,h))})},T=h=>{var b,g;(g=(b=h.props)==null?void 0:b.onClose)==null||g.call(b,h.removalReason),h.isActive=!1},v=h=>{if(h==null)d.forEach(T);else{let b=d.get(h);b&&T(b)}y()},p=()=>{a-=n.length,n=[]},_=h=>{var b,g;let{toastId:L,updateId:Z}=h.props,$=Z==null;h.staleId&&d.delete(h.staleId),h.isActive=!0,d.set(L,h),y(),s(xt(h,$?"added":"updated")),$&&((g=(b=h.props).onOpen)==null||g.call(b))};return{id:t,props:l,observe:u,toggle:N,removeToast:v,toasts:d,clearQueue:p,buildToast:(h,b)=>{if(w(b))return;let{toastId:g,updateId:L,data:Z,staleId:$,delay:C}=b,B=L==null;B&&a++;let F={...l,style:l.toastStyle,key:r++,...Object.fromEntries(Object.entries(b).filter(([W,G])=>G!=null)),toastId:g,updateId:L,data:Z,isIn:!1,className:Je(b.className||l.toastClassName),progressClassName:Je(b.progressClassName||l.progressClassName),autoClose:b.isLoading?!1:Yr(b.autoClose,l.autoClose),closeToast(W){d.get(g).removalReason=W,v(g)},deleteToast(){let W=d.get(g);if(W!=null){if(s(xt(W,"removed")),d.delete(g),a--,a<0&&(a=0),n.length>0){_(n.shift());return}y()}}};F.closeButton=l.closeButton,b.closeButton===!1||Qe(b.closeButton)?F.closeButton=b.closeButton:b.closeButton===!0&&(F.closeButton=Qe(l.closeButton)?l.closeButton:!0);let P={content:h,props:F,staleId:$};l.limit&&l.limit>0&&a>l.limit&&B?n.push(P):$e(C)?setTimeout(()=>{_(P)},C):_(P)},setProps(h){l=h},setToggle:(h,b)=>{let g=d.get(h);g&&(g.toggle=b)},isToastActive:h=>{var b;return(b=d.get(h))==null?void 0:b.isActive},getSnapshot:()=>i}}var q=new Map,Ce=[],Ke=new Set,ra=t=>Ke.forEach(e=>e(t)),es=()=>q.size>0;function aa(){Ce.forEach(t=>ss(t.content,t.options)),Ce=[]}var na=(t,{containerId:e})=>{var s;return(s=q.get(e||1))==null?void 0:s.toasts.get(t)};function ts(t,e){var s;if(e)return!!((s=q.get(e))!=null&&s.isToastActive(t));let r=!1;return q.forEach(a=>{a.isToastActive(t)&&(r=!0)}),r}function oa(t){if(!es()){Ce=Ce.filter(e=>t!=null&&e.options.toastId!==t);return}if(t==null||Gr(t))q.forEach(e=>{e.removeToast(t)});else if(t&&("containerId"in t||"id"in t)){let e=q.get(t.containerId);e?e.removeToast(t.id):q.forEach(s=>{s.removeToast(t.id)})}}var ia=(t={})=>{q.forEach(e=>{e.props.limit&&(!t.containerId||e.id===t.containerId)&&e.clearQueue()})};function ss(t,e){Qe(t)&&(es()||Ce.push({content:t,options:e}),q.forEach(s=>{s.buildToast(t,e)}))}function la(t){var e;(e=q.get(t.containerId||1))==null||e.setToggle(t.id,t.fn)}function rs(t,e){q.forEach(s=>{(e==null||!(e!=null&&e.containerId)||e?.containerId===s.id)&&s.toggle(t,e?.id)})}function da(t){let e=t.containerId||1;return{subscribe(s){let r=sa(e,t,ra);q.set(e,r);let a=r.observe(s);return aa(),()=>{a(),q.delete(e)}},setProps(s){var r;(r=q.get(e))==null||r.setProps(s)},getSnapshot(){var s;return(s=q.get(e))==null?void 0:s.getSnapshot()}}}function ca(t){return Ke.add(t),()=>{Ke.delete(t)}}function ua(t){return t&&(he(t.toastId)||$e(t.toastId))?t.toastId:Kt()}function Oe(t,e){return ss(t,e),e.toastId}function Ve(t,e){return{...e,type:e&&e.type||t,toastId:ua(e)}}function Fe(t){return(e,s)=>Oe(e,Ve(t,s))}function M(t,e){return Oe(t,Ve("default",e))}M.loading=(t,e)=>Oe(t,Ve("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...e}));function fa(t,{pending:e,error:s,success:r},a){let n;e&&(n=he(e)?M.loading(e,a):M.loading(e.render,{...a,...e}));let i={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},l=(c,u,y)=>{if(u==null){M.dismiss(n);return}let w={type:c,...i,...a,data:y},N=he(u)?{render:u}:u;return n?M.update(n,{...w,...N}):M(N.render,{...w,...N}),y},d=ne(t)?t():t;return d.then(c=>l("success",r,c)).catch(c=>l("error",s,c)),d}M.promise=fa;M.success=Fe("success");M.info=Fe("info");M.error=Fe("error");M.warning=Fe("warning");M.warn=M.warning;M.dark=(t,e)=>Oe(t,Ve("default",{theme:"dark",...e}));function ma(t){oa(t)}M.dismiss=ma;M.clearWaitingQueue=ia;M.isActive=ts;M.update=(t,e={})=>{let s=na(t,e);if(s){let{props:r,content:a}=s,n={delay:100,...r,...e,toastId:e.toastId||t,updateId:Kt()};n.toastId!==t&&(n.staleId=t);let i=n.render||a;delete n.render,Oe(i,n)}};M.done=t=>{M.update(t,{progress:1})};M.onChange=ca;M.play=t=>rs(!0,t);M.pause=t=>rs(!1,t);function ha(t){var e;let{subscribe:s,getSnapshot:r,setProps:a}=f.useRef(da(t)).current;a(t);let n=(e=f.useSyncExternalStore(s,r,r))==null?void 0:e.slice();function i(l){if(!n)return[];let d=new Map;return t.newestOnTop&&n.reverse(),n.forEach(c=>{let{position:u}=c.props;d.has(u)||d.set(u,[]),d.get(u).push(c)}),Array.from(d,c=>l(c[0],c[1]))}return{getToastToRender:i,isToastActive:ts,count:n?.length}}function pa(t){let[e,s]=f.useState(!1),[r,a]=f.useState(!1),n=f.useRef(null),i=f.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:l,pauseOnHover:d,closeToast:c,onClick:u,closeOnClick:y}=t;la({id:t.toastId,containerId:t.containerId,fn:s}),f.useEffect(()=>{if(t.pauseOnFocusLoss)return w(),()=>{N()}},[t.pauseOnFocusLoss]);function w(){document.hasFocus()||_(),window.addEventListener("focus",p),window.addEventListener("blur",_)}function N(){window.removeEventListener("focus",p),window.removeEventListener("blur",_)}function T($){if(t.draggable===!0||t.draggable===$.pointerType){h();let C=n.current;i.canCloseOnClick=!0,i.canDrag=!0,C.style.transition="none",t.draggableDirection==="x"?(i.start=$.clientX,i.removalDistance=C.offsetWidth*(t.draggablePercent/100)):(i.start=$.clientY,i.removalDistance=C.offsetHeight*(t.draggablePercent===80?t.draggablePercent*1.5:t.draggablePercent)/100)}}function v($){let{top:C,bottom:B,left:F,right:P}=n.current.getBoundingClientRect();$.nativeEvent.type!=="touchend"&&t.pauseOnHover&&$.clientX>=F&&$.clientX<=P&&$.clientY>=C&&$.clientY<=B?_():p()}function p(){s(!0)}function _(){s(!1)}function h(){i.didMove=!1,document.addEventListener("pointermove",g),document.addEventListener("pointerup",L)}function b(){document.removeEventListener("pointermove",g),document.removeEventListener("pointerup",L)}function g($){let C=n.current;if(i.canDrag&&C){i.didMove=!0,e&&_(),t.draggableDirection==="x"?i.delta=$.clientX-i.start:i.delta=$.clientY-i.start,i.start!==$.clientX&&(i.canCloseOnClick=!1);let B=t.draggableDirection==="x"?`${i.delta}px, var(--y)`:`0, calc(${i.delta}px + var(--y))`;C.style.transform=`translate3d(${B},0)`,C.style.opacity=`${1-Math.abs(i.delta/i.removalDistance)}`}}function L(){b();let $=n.current;if(i.canDrag&&i.didMove&&$){if(i.canDrag=!1,Math.abs(i.delta)>i.removalDistance){a(!0),t.closeToast(!0),t.collapseAll();return}$.style.transition="transform 0.2s, opacity 0.2s",$.style.removeProperty("transform"),$.style.removeProperty("opacity")}}let Z={onPointerDown:T,onPointerUp:v};return l&&d&&(Z.onMouseEnter=_,t.stacked||(Z.onMouseLeave=p)),y&&(Z.onClick=$=>{u&&u($),i.canCloseOnClick&&c(!0)}),{playToast:p,pauseToast:_,isRunning:e,preventExitTransition:r,toastRef:n,eventHandlers:Z}}var ga=typeof window<"u"?f.useLayoutEffect:f.useEffect,Ue=({theme:t,type:e,isLoading:s,...r})=>f.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${e})`,...r});function ya(t){return f.createElement(Ue,{...t},f.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))}function ba(t){return f.createElement(Ue,{...t},f.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))}function xa(t){return f.createElement(Ue,{...t},f.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))}function va(t){return f.createElement(Ue,{...t},f.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))}function _a(){return f.createElement("div",{className:"Toastify__spinner"})}var et={info:ba,warning:ya,success:xa,error:va,spinner:_a},ka=t=>t in et;function wa({theme:t,type:e,isLoading:s,icon:r}){let a=null,n={theme:t,type:e};return r===!1||(ne(r)?a=r({...n,isLoading:s}):f.isValidElement(r)?a=f.cloneElement(r,n):s?a=et.spinner():ka(e)&&(a=et[e](n))),a}var ja=t=>{let{isRunning:e,preventExitTransition:s,toastRef:r,eventHandlers:a,playToast:n}=pa(t),{closeButton:i,children:l,autoClose:d,onClick:c,type:u,hideProgressBar:y,closeToast:w,transition:N,position:T,className:v,style:p,progressClassName:_,updateId:h,role:b,progress:g,rtl:L,toastId:Z,deleteToast:$,isIn:C,isLoading:B,closeOnClick:F,theme:P,ariaLabel:W}=t,G=me("Toastify__toast",`Toastify__toast-theme--${P}`,`Toastify__toast--${u}`,{"Toastify__toast--rtl":L},{"Toastify__toast--close-on-click":F}),fe=ne(v)?v({rtl:L,position:T,type:u,defaultClassName:G}):me(G,v),ge=wa(t),ye=!!g||!d,ae={closeToast:w,type:u,theme:P},te=null;return i===!1||(ne(i)?te=i(ae):f.isValidElement(i)?te=f.cloneElement(i,ae):te=Kr(ae)),f.createElement(N,{isIn:C,done:$,position:T,preventExitTransition:s,nodeRef:r,playToast:n},f.createElement("div",{id:Z,tabIndex:0,onClick:c,"data-in":C,className:fe,...a,style:p,ref:r,...C&&{role:b,"aria-label":W}},ge!=null&&f.createElement("div",{className:me("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!B})},ge),Qt(l,t,!e),te,!t.customProgressBar&&f.createElement(ea,{...h&&!ye?{key:`p-${h}`}:{},rtl:L,theme:P,delay:d,isRunning:e,isIn:C,closeToast:w,hide:y,type:u,className:_,controlledProgress:ye,progress:g||0})))},Na=(t,e=!1)=>({enter:`Toastify--animate Toastify__${t}-enter`,exit:`Toastify--animate Toastify__${t}-exit`,appendPosition:e}),Ta=Qr(Na("bounce",!0)),Ca={position:"top-right",transition:Ta,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light","aria-label":"Notifications Alt+T",hotKeys:t=>t.altKey&&t.code==="KeyT"};function Sa(t){let e={...Ca,...t},s=t.stacked,[r,a]=f.useState(!0),n=f.useRef(null),{getToastToRender:i,isToastActive:l,count:d}=ha(e),{className:c,style:u,rtl:y,containerId:w,hotKeys:N}=e;function T(p){let _=me("Toastify__toast-container",`Toastify__toast-container--${p}`,{"Toastify__toast-container--rtl":y});return ne(c)?c({position:p,rtl:y,defaultClassName:_}):me(_,Je(c))}function v(){s&&(a(!0),M.play())}return ga(()=>{var p;if(s){let _=n.current.querySelectorAll('[data-in="true"]'),h=12,b=(p=e.position)==null?void 0:p.includes("top"),g=0,L=0;Array.from(_).reverse().forEach((Z,$)=>{let C=Z;C.classList.add("Toastify__toast--stacked"),$>0&&(C.dataset.collapsed=`${r}`),C.dataset.pos||(C.dataset.pos=b?"top":"bot");let B=g*(r?.2:1)+(r?0:h*$);C.style.setProperty("--y",`${b?B:B*-1}px`),C.style.setProperty("--g",`${h}`),C.style.setProperty("--s",`${1-(r?L:0)}`),g+=C.offsetHeight,L+=.025})}},[r,d,s]),f.useEffect(()=>{function p(_){var h;let b=n.current;N(_)&&((h=b.querySelector('[tabIndex="0"]'))==null||h.focus(),a(!1),M.pause()),_.key==="Escape"&&(document.activeElement===b||b!=null&&b.contains(document.activeElement))&&(a(!0),M.play())}return document.addEventListener("keydown",p),()=>{document.removeEventListener("keydown",p)}},[N]),f.createElement("section",{ref:n,className:"Toastify",id:w,onMouseEnter:()=>{s&&(a(!1),M.pause())},onMouseLeave:v,"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text","aria-label":e["aria-label"]},i((p,_)=>{let h=_.length?{...u}:{...u,pointerEvents:"none"};return f.createElement("div",{tabIndex:-1,className:T(p),"data-stacked":s,style:h,key:`c-${p}`},_.map(({content:b,props:g})=>f.createElement(ja,{...g,stacked:s,collapseAll:v,isIn:l(g.toastId,g.containerId),key:`t-${g.key}`},b)))}))}const vt=t=>{let e;const s=new Set,r=(c,u)=>{const y=typeof c=="function"?c(e):c;if(!Object.is(y,e)){const w=e;e=u??(typeof y!="object"||y===null)?y:Object.assign({},e,y),s.forEach(N=>N(e,w))}},a=()=>e,l={setState:r,getState:a,getInitialState:()=>d,subscribe:c=>(s.add(c),()=>s.delete(c))},d=e=t(r,a,l);return l},Ea=(t=>t?vt(t):vt),Ia=t=>t;function $a(t,e=Ia){const s=f.useSyncExternalStore(t.subscribe,f.useCallback(()=>e(t.getState()),[t,e]),f.useCallback(()=>e(t.getInitialState()),[t,e]));return f.useDebugValue(s),s}const _t=t=>{const e=Ea(t),s=r=>$a(e,r);return Object.assign(s,e),s},as=(t=>t?_t(t):_t),He=as(t=>({menus:[],currentMenu:null,setMenus:e=>t({menus:e}),setCurrentMenu:e=>t({currentMenu:e})})),Oa=({menus:t,topNav:e,sideNav:s,children:r})=>{const{setMenus:a}=He();return f.useEffect(()=>{a(t)},[a]),o.jsxs(o.Fragment,{children:[s,o.jsxs("main",{className:"flex-1 flex flex-col transition-all duration-300 overflow-hidden",children:[e,o.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-4",children:r})]}),o.jsx(Sa,{draggable:!0,rtl:!1,newestOnTop:!0,closeOnClick:!0,pauseOnHover:!0,autoClose:5e3,position:"top-right",hideProgressBar:!1})]})},La=({children:t,button:e=null})=>{const s=Te.useLocation(),{menus:r}=He();let a=null;return r.length&&(a=r.find(n=>n.path===s.pathname)??null),o.jsx("div",{className:"min-h-screen",children:o.jsxs("div",{className:"space-y-4 animate-fade-in",children:[o.jsxs("div",{className:"grid grid-cols-2",children:[o.jsx("h2",{className:"text-2xl font-bold",children:a?.label??"N/A"}),e&&o.jsx("div",{className:"flex justify-end",children:o.jsx(K,{label:e.label,onClick:e.onClick,variant:V.Success})})]}),t]})})};class Ra{activeRequests=0;listeners=new Set;constructor(){this.setupInterceptors()}subscribe(e){return this.listeners.add(e),e(this.activeRequests>0),()=>this.listeners.delete(e)}notify(){const e=this.activeRequests>0;this.listeners.forEach(s=>s(e))}start(){this.activeRequests++,this.notify()}stop(){this.activeRequests>0&&this.activeRequests--,this.notify()}reset(){this.activeRequests=0,this.notify()}setupInterceptors(){if(typeof window>"u")return;const e=window.fetch;window.fetch=async(...a)=>{this.start();try{return await e(...a)}finally{this.stop()}};const s=XMLHttpRequest.prototype.send,r=this;XMLHttpRequest.prototype.send=function(...a){return r.start(),this.addEventListener("loadend",()=>{r.stop()}),s.apply(this,a)}}}const ns=new Ra,Aa=()=>{const[t,e]=f.useState(!0);return f.useEffect(()=>{const s=ns.subscribe(e);return()=>{s()}},[]),o.jsx(Gt,{open:t,message:"Loading..."})},Ma=({children:t})=>o.jsxs(o.Fragment,{children:[o.jsx(Aa,{}),o.jsx("div",{className:"min-h-screen bg-slate-100 dark:bg-slate-900",children:o.jsx("div",{className:"w-full h-screen flex overflow-hidden",children:t})})]}),qe={autoClose:5e3,draggable:!1,closeOnClick:!0,pauseOnHover:!0,position:"top-right",hideProgressBar:!1},os=t=>{M.success(t,qe)},za=t=>{M.error(t,qe)},Pa=t=>{M.info(t,qe)},Za=t=>{M.warn(t,qe)},ct=(t,e=0)=>t?e?t.split(" ").map(s=>s[0].toUpperCase()).join("").slice(0,e):is(t):"";function is(t){return t.split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Ba(t,e){let s;try{s=t()}catch{return}return{getItem:a=>{var n;const i=d=>d===null?null:JSON.parse(d,void 0),l=(n=s.getItem(a))!=null?n:null;return l instanceof Promise?l.then(i):i(l)},setItem:(a,n)=>s.setItem(a,JSON.stringify(n,void 0)),removeItem:a=>s.removeItem(a)}}const tt=t=>e=>{try{const s=t(e);return s instanceof Promise?s:{then(r){return tt(r)(s)},catch(r){return this}}}catch(s){return{then(r){return this},catch(r){return tt(r)(s)}}}},Da=(t,e)=>(s,r,a)=>{let n={storage:Ba(()=>localStorage),partialize:p=>p,version:0,merge:(p,_)=>({..._,...p}),...e},i=!1,l=0;const d=new Set,c=new Set;let u=n.storage;if(!u)return t((...p)=>{console.warn(`[zustand persist middleware] Unable to update item '${n.name}', the given storage is currently unavailable.`),s(...p)},r,a);const y=()=>{const p=n.partialize({...r()});return u.setItem(n.name,{state:p,version:n.version})},w=a.setState;a.setState=(p,_)=>(w(p,_),y());const N=t((...p)=>(s(...p),y()),r,a);a.getInitialState=()=>N;let T;const v=()=>{var p,_;if(!u)return;const h=++l;i=!1,d.forEach(g=>{var L;return g((L=r())!=null?L:N)});const b=((_=n.onRehydrateStorage)==null?void 0:_.call(n,(p=r())!=null?p:N))||void 0;return tt(u.getItem.bind(u))(n.name).then(g=>{if(g)if(typeof g.version=="number"&&g.version!==n.version){if(n.migrate){const L=n.migrate(g.state,g.version);return L instanceof Promise?L.then(Z=>[!0,Z]):[!0,L]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,g.state];return[!1,void 0]}).then(g=>{var L;if(h!==l)return;const[Z,$]=g;if(T=n.merge($,(L=r())!=null?L:N),s(T,!0),Z)return y()}).then(()=>{h===l&&(b?.(T,void 0),T=r(),i=!0,c.forEach(g=>g(T)))}).catch(g=>{h===l&&b?.(void 0,g)})};return a.persist={setOptions:p=>{n={...n,...p},p.storage&&(u=p.storage)},clearStorage:()=>{u?.removeItem(n.name)},getOptions:()=>n,rehydrate:()=>v(),hasHydrated:()=>i,onHydrate:p=>(d.add(p),()=>{d.delete(p)}),onFinishHydration:p=>(c.add(p),()=>{c.delete(p)})},n.skipHydration||v(),T||N},Va=Da,Fa="jsonplaceholder",ls={LOGIN_KEY:"auth-storage"},Le=as()(Va(t=>({user:null,error:null,isLoggedIn:!1,justLoggedIn:!1,isSideNavbarOpen:!0,loginAction:async(e,s)=>{try{if(!s&&s.includes(Fa)){const r=new URLSearchParams(e).toString(),n=await(await fetch(`${s}?${r}`)).json();if(n.length>0){const{name:i,email:l,id:d}=n[0];return t({error:null,isLoggedIn:!0,justLoggedIn:!0,user:{id:d,email:l,fullName:i,roles:["MANAGER"]}}),!0}else{const i=`No user found with email: ${e.email}`;return t({error:i}),console.error("Login error:",i),!1}}else{const r=await fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!r.ok)throw await r.json();const a=await r.json();return t({error:null,isLoggedIn:!0,justLoggedIn:!0,user:a.data}),!0}}catch(r){const a=r?.message??"An error occurred during login";return t({error:a}),console.error("Login error:",r,r instanceof Error),!1}},clearError:()=>{t({error:null})},resetJustLoggedIn:()=>{t({justLoggedIn:!1})},logout:()=>{t({isLoggedIn:!1,user:null,isSideNavbarOpen:!0,error:null})},toggleSidebar:()=>{t(e=>({isSideNavbarOpen:!e.isSideNavbarOpen}))},setSideNavbarOpen:e=>{t({isSideNavbarOpen:e})}}),{name:ls.LOGIN_KEY,partialize:t=>({user:t.user,isLoggedIn:t.isLoggedIn,isSideNavbarOpen:t.isSideNavbarOpen})})),Ua=({hasNotifications:t=!0})=>{const e=Te.useNavigate(),[s,r]=f.useState(""),a=f.useRef(null),[n,i]=f.useState(!1),{user:l,logout:d,justLoggedIn:c,isSideNavbarOpen:u,resetJustLoggedIn:y,setSideNavbarOpen:w}=Le(),N=T=>{i(!n),T==="logout"?d():e(T)};return f.useEffect(()=>{c&&l&&(os(`Welcome back, ${l.fullName||l.email}!`),y())},[c,y,l]),f.useEffect(()=>{const T=v=>{a.current&&!a.current.contains(v.target)&&i(!1)};return document.addEventListener("mousedown",T),()=>{document.removeEventListener("mousedown",T)}},[]),o.jsx("header",{className:"sticky top-0 z-40 bg-slate-800 backdrop-blur-md border-b border-slate-400 shadow-sm transition-colors duration-300",children:o.jsxs("div",{className:"flex items-center justify-between text-slate-100 py-3 px-4",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx(ve,{text:"Toggle Sidebar",position:"right",children:o.jsx("button",{onClick:()=>w(!u),className:"p-2 rounded-lg text-slate-400 hover:bg-slate-700 dark:hover:bg-slate-700 transition-all duration-200 focus:outline-none",children:o.jsx(Ws,{className:"w-5 h-5"})})}),o.jsxs("div",{className:"relative hidden md:block",children:[o.jsx(Ks,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-slate-500"}),o.jsx("input",{type:"search",value:s,placeholder:"Search anything...",onChange:T=>r(T.target.value),className:"w-64 lg:w-80 pl-10 pr-4 py-2 bg-slate-50 dark:bg-slate-900 border border-transparent rounded-lg text-sm text-slate-900 dark:text-slate-100 placeholder:text-slate-500 dark:placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-violet-500 focus:border-transparent focus:bg-slate-50 dark:focus:bg-slate-800 transition-all duration-200"})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(lt,{forceDarkTheme:!0}),o.jsx(ve,{text:"Notifications",position:"bottom",children:o.jsxs(K,{variant:"default",className:"text-slate-400 hover:bg-slate-600",children:[o.jsx(Ms,{className:"w-5 h-5"}),t&&o.jsx("span",{className:"absolute top-1.5 right-3.5 w-2 h-2 bg-amber-300 rounded-full ring-2 ring-slate-200 animate-pulse"})]})}),o.jsx(ve,{text:"Activity History",position:"bottom",children:o.jsx(K,{variant:"default",className:"text-slate-400 hover:bg-slate-600",icon:o.jsx(Ds,{className:"w-5 h-5"})})}),o.jsx("div",{className:"w-px h-6 bg-slate-200 dark:bg-dark-border mx-1 bg-slate-border"}),o.jsxs("div",{className:"relative",ref:a,children:[o.jsxs("button",{onClick:()=>i(!n),className:"flex items-center gap-2 p-1.5 rounded-lg hover:bg-slate-700 transition-all duration-200 focus:outline-none",children:[o.jsx("div",{className:"h-8 w-8 rounded-lg bg-linear-to-br from-violet-500 to-purple-600 flex items-center justify-center text-white font-semibold text-sm shadow-md",children:ct(l?.fullName??"N/A",2)}),o.jsxs("div",{className:"hidden lg:block text-left",children:[o.jsx("p",{className:"text-sm font-medium text-slate-100",children:l?.fullName??"N/A"}),o.jsx("p",{className:"text-xs text-slate-400",children:l?.email})]})]}),n&&o.jsxs("div",{className:"absolute right-0 mt-3 w-56 bg-gray-300 dark:bg-slate-800 rounded-md shadow-2xl border border-slate-200 dark:border-slate-600 overflow-hidden animate-scale-in",children:[o.jsxs("div",{className:"px-4 py-3 border-b border-slate-200 dark:border-slate-600",children:[o.jsx("p",{className:"text-sm font-semibold text-slate-900 dark:text-slate-100",children:l?.fullName??"N/A"}),o.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400",children:l?.email})]}),o.jsxs("div",{className:"py-1",children:[o.jsxs("button",{onClick:()=>N("/my-profile"),className:"flex items-center w-full px-4 py-2.5 text-sm text-slate-700 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-slate-700 transition-colors",children:[o.jsx(ir,{className:"w-4 h-4 mr-3"}),"My Profile"]}),o.jsxs("button",{onClick:()=>N("/settings"),className:"flex items-center w-full px-4 py-2.5 text-sm text-slate-700 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-slate-700 transition-colors",children:[o.jsx(tr,{className:"w-4 h-4 mr-3"}),"Settings"]}),o.jsxs("button",{onClick:()=>N("/my-profile"),className:"flex items-center w-full px-4 py-2.5 text-sm text-slate-700 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-slate-700 transition-colors",children:[o.jsx(Fs,{className:"w-4 h-4 mr-3"}),"Change Password"]})]}),o.jsx("div",{className:"border-t border-slate-200 dark:border-slate-600 py-1",children:o.jsxs("button",{onClick:()=>N("logout"),className:"flex items-center w-full px-4 py-2.5 text-sm text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors",children:[o.jsx(Hs,{className:"w-4 h-4 mr-3"}),"Logout"]})})]})]})]})]})})},Ha=({item:t})=>{const e=Te.useLocation(),{isSideNavbarOpen:s}=Le(),r=e.pathname===t.path,a=o.jsxs(Te.Link,{to:t.path,className:`
8
3
  relative flex items-center gap-3 px-3 py-2.5 rounded-sm transition-all duration-200 group
9
- ${s?"bg-gray-600 text-gray-200":"text-slate-300 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-slate-700 dark:hover:text-gray-200"}
10
- ${!r&&"justify-center"}
11
- `,children:[s&&l.jsx("div",{className:"absolute left-0 w-1 h-10 bg-slate-50 rounded-r-full animate-slide-in"}),l.jsx(t.icon,{className:`w-5 h-5 shrink-0 transition-transform duration-200 ${s?"scale-110":"group-hover:scale-110"}`}),r&&l.jsx("span",{className:"flex-1 text-sm font-medium whitespace-nowrap",children:t.label}),r&&t.badge&&l.jsx("span",{className:`px-2 py-0.5 text-xs font-semibold rounded-full ${s?"bg-slate-50/20 text-white":"bg-violet-100 dark:bg-violet-900/30 text-violet-700 dark:text-violet-400"}`,children:t.badge}),r&&s&&l.jsx(Qr,{className:"w-4 h-4 animate-pulse"})]});return r?a:l.jsx($e,{text:t.label,position:"right",children:a})},Yi=()=>{const t=Xe.useLocation(),{menus:e,setCurrentMenu:r}=Nt(),{user:s,isSideNavbarOpen:a}=it(),n=s?.society||null;return y.useEffect(()=>{r(t.pathname)},[t.pathname]),l.jsxs("aside",{className:`
4
+ ${r?"bg-gray-600 text-gray-200":"text-slate-300 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-slate-700 dark:hover:text-gray-200"}
5
+ ${!s&&"justify-center"}
6
+ `,children:[r&&o.jsx("div",{className:"absolute left-0 w-1 h-10 bg-slate-50 rounded-r-full animate-slide-in"}),o.jsx(t.icon,{className:`w-5 h-5 shrink-0 transition-transform duration-200 ${r?"scale-110":"group-hover:scale-110"}`}),s&&o.jsx("span",{className:"flex-1 text-sm font-medium whitespace-nowrap",children:t.label}),s&&t.badge&&o.jsx("span",{className:`px-2 py-0.5 text-xs font-semibold rounded-full ${r?"bg-slate-50/20 text-white":"bg-violet-100 dark:bg-violet-900/30 text-violet-700 dark:text-violet-400"}`,children:t.badge}),s&&r&&o.jsx(Vt,{className:"w-4 h-4 animate-pulse"})]});return s?a:o.jsx(ve,{text:t.label,position:"right",children:a})},qa=()=>{const t=Te.useLocation(),{menus:e,setCurrentMenu:s}=He(),{user:r,isSideNavbarOpen:a}=Le(),n=r?.society||null;return f.useEffect(()=>{s(t.pathname)},[t.pathname]),o.jsxs("aside",{className:`
12
7
  ${a?"w-64":"w-20"}
13
8
  min-h-screen bg-slate-800 border-r border-slate-400
14
9
  transition-all duration-300 ease-in-out flex flex-col sticky top-0 z-30
15
10
  shadow-sm
16
- `,children:[l.jsxs("div",{className:`
11
+ `,children:[o.jsxs("div",{className:`
17
12
  px-4 py-3 lg:py-3.5 flex items-center gap-3 border-b border-slate-400
18
13
  ${!a&&"justify-center"}
19
- `,children:[l.jsx("div",{className:"w-10 h-10 bg-linear-to-br from-violet-500 to-purple-600 rounded-xl flex items-center justify-center shadow-lg shadow-violet-500/30",children:l.jsx(Aa,{className:"w-6 h-6 text-white"})}),a&&l.jsxs("div",{className:"flex-1 animate-slide-in",children:[l.jsx("h1",{className:"text-lg font-bold text-slate-100",children:"Resident Rise"}),l.jsx("p",{className:"text-xs text-slate-400",children:"Society Management Portal"})]})]}),l.jsxs("nav",{className:"flex-1 overflow-y-auto overflow-x-visible",children:[n&&l.jsx("div",{className:"px-3 py-3 font-bold text-xl text-center border-b truncate border-slate-400 bg-gray-600 text-gray-200",children:rr(n?.name,a?0:2)}),l.jsx("div",{className:"space-y-1 px-3 mt-2",children:e.length?e.map(o=>l.jsx(Ki,{item:o},o.path)):l.jsx("div",{className:"text-center py-2 bg-slate-700 rounded-md",children:"No menu found"})})]}),l.jsx("div",{className:`
14
+ `,children:[o.jsx("div",{className:"w-10 h-10 bg-linear-to-br from-violet-500 to-purple-600 rounded-xl flex items-center justify-center shadow-lg shadow-violet-500/30",children:o.jsx(rr,{className:"w-6 h-6 text-white"})}),a&&o.jsxs("div",{className:"flex-1 animate-slide-in",children:[o.jsx("h1",{className:"text-lg font-bold text-slate-100",children:"Resident Rise"}),o.jsx("p",{className:"text-xs text-slate-400",children:"Society Management Portal"})]})]}),o.jsxs("nav",{className:"flex-1 overflow-y-auto overflow-x-visible",children:[n&&o.jsx("div",{className:"px-3 py-3 font-bold text-xl text-center border-b truncate border-slate-400 bg-gray-600 text-gray-200",children:ct(n?.name,a?0:2)}),o.jsx("div",{className:"space-y-1 px-3 mt-2",children:e.length?e.map(i=>o.jsx(Ha,{item:i},i.path)):o.jsx("div",{className:"text-center py-2 bg-slate-700 rounded-md",children:"No menu found"})})]}),o.jsx("div",{className:`
20
15
  px-3 py-4 border-t border-slate-200 dark:border-slate-600
21
16
  ${!a&&"flex justify-center"}
22
- `,children:a?l.jsxs("div",{className:"px-3 py-2 rounded-xl bg-linear-to-br from-violet-50 to-purple-50 dark:from-violet-900/20 dark:to-purple-900/20 border border-violet-200 dark:border-violet-800",children:[l.jsx("p",{className:"text-xs font-semibold text-violet-700 dark:text-violet-400",children:"Need Help?"}),l.jsx("p",{className:"text-xs text-slate-600 dark:text-slate-400 mt-1",children:"Contact support team"})]}):l.jsx($e,{text:"Need Help?",position:"right",children:l.jsx("div",{className:"w-10 h-10 rounded-xl bg-linear-to-br from-violet-50 to-purple-50 dark:from-violet-900/20 dark:to-purple-900/20 border border-violet-200 dark:border-violet-800 flex items-center justify-center cursor-pointer hover:scale-110 transition-transform",children:l.jsx("span",{className:"text-violet-700 dark:text-violet-400 font-bold text-sm",children:"?"})})})})]})};var B;(function(t){t.assertEqual=a=>{};function e(a){}t.assertIs=e;function r(a){throw new Error}t.assertNever=r,t.arrayToEnum=a=>{const n={};for(const o of a)n[o]=o;return n},t.getValidEnumValues=a=>{const n=t.objectKeys(a).filter(i=>typeof a[a[i]]!="number"),o={};for(const i of n)o[i]=a[i];return t.objectValues(o)},t.objectValues=a=>t.objectKeys(a).map(function(n){return a[n]}),t.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const n=[];for(const o in a)Object.prototype.hasOwnProperty.call(a,o)&&n.push(o);return n},t.find=(a,n)=>{for(const o of a)if(n(o))return o},t.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function s(a,n=" | "){return a.map(o=>typeof o=="string"?`'${o}'`:o).join(n)}t.joinValues=s,t.jsonStringifyReplacer=(a,n)=>typeof n=="bigint"?n.toString():n})(B||(B={}));var Lr;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Lr||(Lr={}));const S=B.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ve=t=>{switch(typeof t){case"undefined":return S.undefined;case"string":return S.string;case"number":return Number.isNaN(t)?S.nan:S.number;case"boolean":return S.boolean;case"function":return S.function;case"bigint":return S.bigint;case"symbol":return S.symbol;case"object":return Array.isArray(t)?S.array:t===null?S.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?S.promise:typeof Map<"u"&&t instanceof Map?S.map:typeof Set<"u"&&t instanceof Set?S.set:typeof Date<"u"&&t instanceof Date?S.date:S.object;default:return S.unknown}},_=B.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class be extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){const r=e||function(n){return n.message},s={_errors:[]},a=n=>{for(const o of n.issues)if(o.code==="invalid_union")o.unionErrors.map(a);else if(o.code==="invalid_return_type")a(o.returnTypeError);else if(o.code==="invalid_arguments")a(o.argumentsError);else if(o.path.length===0)s._errors.push(r(o));else{let i=s,u=0;for(;u<o.path.length;){const c=o.path[u];u===o.path.length-1?(i[c]=i[c]||{_errors:[]},i[c]._errors.push(r(o))):i[c]=i[c]||{_errors:[]},i=i[c],u++}}};return a(this),s}static assert(e){if(!(e instanceof be))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,B.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){const r={},s=[];for(const a of this.issues)if(a.path.length>0){const n=a.path[0];r[n]=r[n]||[],r[n].push(e(a))}else s.push(e(a));return{formErrors:s,fieldErrors:r}}get formErrors(){return this.flatten()}}be.create=t=>new be(t);const Jt=(t,e)=>{let r;switch(t.code){case _.invalid_type:t.received===S.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case _.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,B.jsonStringifyReplacer)}`;break;case _.unrecognized_keys:r=`Unrecognized key(s) in object: ${B.joinValues(t.keys,", ")}`;break;case _.invalid_union:r="Invalid input";break;case _.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${B.joinValues(t.options)}`;break;case _.invalid_enum_value:r=`Invalid enum value. Expected ${B.joinValues(t.options)}, received '${t.received}'`;break;case _.invalid_arguments:r="Invalid function arguments";break;case _.invalid_return_type:r="Invalid function return type";break;case _.invalid_date:r="Invalid date";break;case _.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:B.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case _.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case _.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case _.custom:r="Invalid input";break;case _.invalid_intersection_types:r="Intersection results could not be merged";break;case _.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case _.not_finite:r="Number must be finite";break;default:r=e.defaultError,B.assertNever(t)}return{message:r}};let Qi=Jt;function el(){return Qi}const tl=t=>{const{data:e,path:r,errorMaps:s,issueData:a}=t,n=[...r,...a.path||[]],o={...a,path:n};if(a.message!==void 0)return{...a,path:n,message:a.message};let i="";const u=s.filter(c=>!!c).slice().reverse();for(const c of u)i=c(o,{data:e,defaultError:i}).message;return{...a,path:n,message:i}};function N(t,e){const r=el(),s=tl({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===Jt?void 0:Jt].filter(a=>!!a)});t.common.issues.push(s)}class ie{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){const s=[];for(const a of r){if(a.status==="aborted")return O;a.status==="dirty"&&e.dirty(),s.push(a.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,r){const s=[];for(const a of r){const n=await a.key,o=await a.value;s.push({key:n,value:o})}return ie.mergeObjectSync(e,s)}static mergeObjectSync(e,r){const s={};for(const a of r){const{key:n,value:o}=a;if(n.status==="aborted"||o.status==="aborted")return O;n.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),n.value!=="__proto__"&&(typeof o.value<"u"||a.alwaysSet)&&(s[n.value]=o.value)}return{status:e.value,value:s}}}const O=Object.freeze({status:"aborted"}),Je=t=>({status:"dirty",value:t}),ce=t=>({status:"valid",value:t}),Ir=t=>t.status==="aborted",$r=t=>t.status==="dirty",Be=t=>t.status==="valid",ht=t=>typeof Promise<"u"&&t instanceof Promise;var C;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(C||(C={}));class we{constructor(e,r,s,a){this._cachedPath=[],this.parent=e,this.data=r,this._path=s,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Pr=(t,e)=>{if(Be(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new be(t.common.issues);return this._error=r,this._error}}};function P(t){if(!t)return{};const{errorMap:e,invalid_type_error:r,required_error:s,description:a}=t;if(e&&(r||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(o,i)=>{const{message:u}=t;return o.code==="invalid_enum_value"?{message:u??i.defaultError}:typeof i.data>"u"?{message:u??s??i.defaultError}:o.code!=="invalid_type"?{message:i.defaultError}:{message:u??r??i.defaultError}},description:a}}class M{get description(){return this._def.description}_getType(e){return ve(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:ve(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ie,ctx:{common:e.parent.common,data:e.data,parsedType:ve(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(ht(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){const r=this._parse(e);return Promise.resolve(r)}parse(e,r){const s=this.safeParse(e,r);if(s.success)return s.data;throw s.error}safeParse(e,r){const s={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ve(e)},a=this._parseSync({data:e,path:s.path,parent:s});return Pr(s,a)}"~validate"(e){const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ve(e)};if(!this["~standard"].async)try{const s=this._parseSync({data:e,path:[],parent:r});return Be(s)?{value:s.value}:{issues:r.common.issues}}catch(s){s?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(s=>Be(s)?{value:s.value}:{issues:r.common.issues})}async parseAsync(e,r){const s=await this.safeParseAsync(e,r);if(s.success)return s.data;throw s.error}async safeParseAsync(e,r){const s={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ve(e)},a=this._parse({data:e,path:s.path,parent:s}),n=await(ht(a)?a:Promise.resolve(a));return Pr(s,n)}refine(e,r){const s=a=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(a):r;return this._refinement((a,n)=>{const o=e(a),i=()=>n.addIssue({code:_.custom,...s(a)});return typeof Promise<"u"&&o instanceof Promise?o.then(u=>u?!0:(i(),!1)):o?!0:(i(),!1)})}refinement(e,r){return this._refinement((s,a)=>e(s)?!0:(a.addIssue(typeof r=="function"?r(s,a):r),!1))}_refinement(e){return new De({schema:this,typeName:R.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return ke.create(this,this._def)}nullable(){return Fe.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return pe.create(this)}promise(){return bt.create(this,this._def)}or(e){return gt.create([this,e],this._def)}and(e){return yt.create(this,e,this._def)}transform(e){return new De({...P(this._def),schema:this,typeName:R.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new Gt({...P(this._def),innerType:this,defaultValue:r,typeName:R.ZodDefault})}brand(){return new Tl({typeName:R.ZodBranded,type:this,...P(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new Kt({...P(this._def),innerType:this,catchValue:r,typeName:R.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return cr.create(this,e)}readonly(){return Yt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const rl=/^c[^\s-]{8,}$/i,sl=/^[0-9a-z]+$/,al=/^[0-9A-HJKMNP-TV-Z]{26}$/i,nl=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ol=/^[a-z0-9_-]{21}$/i,il=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ll=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,cl=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,dl="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let $t;const ul=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,fl=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ml=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,hl=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,pl=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,gl=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Zs="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",yl=new RegExp(`^${Zs}$`);function Vs(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function bl(t){return new RegExp(`^${Vs(t)}$`)}function xl(t){let e=`${Zs}T${Vs(t)}`;const r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function vl(t,e){return!!((e==="v4"||!e)&&ul.test(t)||(e==="v6"||!e)&&ml.test(t))}function _l(t,e){if(!il.test(t))return!1;try{const[r]=t.split(".");if(!r)return!1;const s=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),a=JSON.parse(atob(s));return!(typeof a!="object"||a===null||"typ"in a&&a?.typ!=="JWT"||!a.alg||e&&a.alg!==e)}catch{return!1}}function kl(t,e){return!!((e==="v4"||!e)&&fl.test(t)||(e==="v6"||!e)&&hl.test(t))}class _e extends M{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==S.string){const n=this._getOrReturnCtx(e);return N(n,{code:_.invalid_type,expected:S.string,received:n.parsedType}),O}const s=new ie;let a;for(const n of this._def.checks)if(n.kind==="min")e.data.length<n.value&&(a=this._getOrReturnCtx(e,a),N(a,{code:_.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),s.dirty());else if(n.kind==="max")e.data.length>n.value&&(a=this._getOrReturnCtx(e,a),N(a,{code:_.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),s.dirty());else if(n.kind==="length"){const o=e.data.length>n.value,i=e.data.length<n.value;(o||i)&&(a=this._getOrReturnCtx(e,a),o?N(a,{code:_.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):i&&N(a,{code:_.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),s.dirty())}else if(n.kind==="email")cl.test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"email",code:_.invalid_string,message:n.message}),s.dirty());else if(n.kind==="emoji")$t||($t=new RegExp(dl,"u")),$t.test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"emoji",code:_.invalid_string,message:n.message}),s.dirty());else if(n.kind==="uuid")nl.test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"uuid",code:_.invalid_string,message:n.message}),s.dirty());else if(n.kind==="nanoid")ol.test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"nanoid",code:_.invalid_string,message:n.message}),s.dirty());else if(n.kind==="cuid")rl.test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"cuid",code:_.invalid_string,message:n.message}),s.dirty());else if(n.kind==="cuid2")sl.test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"cuid2",code:_.invalid_string,message:n.message}),s.dirty());else if(n.kind==="ulid")al.test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"ulid",code:_.invalid_string,message:n.message}),s.dirty());else if(n.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),N(a,{validation:"url",code:_.invalid_string,message:n.message}),s.dirty()}else n.kind==="regex"?(n.regex.lastIndex=0,n.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"regex",code:_.invalid_string,message:n.message}),s.dirty())):n.kind==="trim"?e.data=e.data.trim():n.kind==="includes"?e.data.includes(n.value,n.position)||(a=this._getOrReturnCtx(e,a),N(a,{code:_.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),s.dirty()):n.kind==="toLowerCase"?e.data=e.data.toLowerCase():n.kind==="toUpperCase"?e.data=e.data.toUpperCase():n.kind==="startsWith"?e.data.startsWith(n.value)||(a=this._getOrReturnCtx(e,a),N(a,{code:_.invalid_string,validation:{startsWith:n.value},message:n.message}),s.dirty()):n.kind==="endsWith"?e.data.endsWith(n.value)||(a=this._getOrReturnCtx(e,a),N(a,{code:_.invalid_string,validation:{endsWith:n.value},message:n.message}),s.dirty()):n.kind==="datetime"?xl(n).test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{code:_.invalid_string,validation:"datetime",message:n.message}),s.dirty()):n.kind==="date"?yl.test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{code:_.invalid_string,validation:"date",message:n.message}),s.dirty()):n.kind==="time"?bl(n).test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{code:_.invalid_string,validation:"time",message:n.message}),s.dirty()):n.kind==="duration"?ll.test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"duration",code:_.invalid_string,message:n.message}),s.dirty()):n.kind==="ip"?vl(e.data,n.version)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"ip",code:_.invalid_string,message:n.message}),s.dirty()):n.kind==="jwt"?_l(e.data,n.alg)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"jwt",code:_.invalid_string,message:n.message}),s.dirty()):n.kind==="cidr"?kl(e.data,n.version)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"cidr",code:_.invalid_string,message:n.message}),s.dirty()):n.kind==="base64"?pl.test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"base64",code:_.invalid_string,message:n.message}),s.dirty()):n.kind==="base64url"?gl.test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"base64url",code:_.invalid_string,message:n.message}),s.dirty()):B.assertNever(n);return{status:s.value,value:e.data}}_regex(e,r,s){return this.refinement(a=>e.test(a),{validation:r,code:_.invalid_string,...C.errToObj(s)})}_addCheck(e){return new _e({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...C.errToObj(e)})}url(e){return this._addCheck({kind:"url",...C.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...C.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...C.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...C.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...C.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...C.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...C.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...C.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...C.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...C.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...C.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...C.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...C.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...C.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...C.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...C.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...C.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...C.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...C.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...C.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...C.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...C.errToObj(r)})}nonempty(e){return this.min(1,C.errToObj(e))}trim(){return new _e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new _e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new _e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}_e.create=t=>new _e({checks:[],typeName:R.ZodString,coerce:t?.coerce??!1,...P(t)});function wl(t,e){const r=(t.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,a=r>s?r:s,n=Number.parseInt(t.toFixed(a).replace(".","")),o=Number.parseInt(e.toFixed(a).replace(".",""));return n%o/10**a}class Ye extends M{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==S.number){const n=this._getOrReturnCtx(e);return N(n,{code:_.invalid_type,expected:S.number,received:n.parsedType}),O}let s;const a=new ie;for(const n of this._def.checks)n.kind==="int"?B.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),N(s,{code:_.invalid_type,expected:"integer",received:"float",message:n.message}),a.dirty()):n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(s=this._getOrReturnCtx(e,s),N(s,{code:_.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),a.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(s=this._getOrReturnCtx(e,s),N(s,{code:_.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),a.dirty()):n.kind==="multipleOf"?wl(e.data,n.value)!==0&&(s=this._getOrReturnCtx(e,s),N(s,{code:_.not_multiple_of,multipleOf:n.value,message:n.message}),a.dirty()):n.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),N(s,{code:_.not_finite,message:n.message}),a.dirty()):B.assertNever(n);return{status:a.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,C.toString(r))}gt(e,r){return this.setLimit("min",e,!1,C.toString(r))}lte(e,r){return this.setLimit("max",e,!0,C.toString(r))}lt(e,r){return this.setLimit("max",e,!1,C.toString(r))}setLimit(e,r,s,a){return new Ye({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:s,message:C.toString(a)}]})}_addCheck(e){return new Ye({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:C.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:C.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:C.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:C.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:C.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:C.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:C.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:C.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:C.toString(e)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&B.isInteger(e.value))}get isFinite(){let e=null,r=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(r===null||s.value>r)&&(r=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(r)&&Number.isFinite(e)}}Ye.create=t=>new Ye({checks:[],typeName:R.ZodNumber,coerce:t?.coerce||!1,...P(t)});class Qe extends M{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==S.bigint)return this._getInvalidInput(e);let s;const a=new ie;for(const n of this._def.checks)n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(s=this._getOrReturnCtx(e,s),N(s,{code:_.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),a.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(s=this._getOrReturnCtx(e,s),N(s,{code:_.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),a.dirty()):n.kind==="multipleOf"?e.data%n.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),N(s,{code:_.not_multiple_of,multipleOf:n.value,message:n.message}),a.dirty()):B.assertNever(n);return{status:a.value,value:e.data}}_getInvalidInput(e){const r=this._getOrReturnCtx(e);return N(r,{code:_.invalid_type,expected:S.bigint,received:r.parsedType}),O}gte(e,r){return this.setLimit("min",e,!0,C.toString(r))}gt(e,r){return this.setLimit("min",e,!1,C.toString(r))}lte(e,r){return this.setLimit("max",e,!0,C.toString(r))}lt(e,r){return this.setLimit("max",e,!1,C.toString(r))}setLimit(e,r,s,a){return new Qe({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:s,message:C.toString(a)}]})}_addCheck(e){return new Qe({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:C.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:C.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:C.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:C.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:C.toString(r)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}Qe.create=t=>new Qe({checks:[],typeName:R.ZodBigInt,coerce:t?.coerce??!1,...P(t)});class Mr extends M{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==S.boolean){const s=this._getOrReturnCtx(e);return N(s,{code:_.invalid_type,expected:S.boolean,received:s.parsedType}),O}return ce(e.data)}}Mr.create=t=>new Mr({typeName:R.ZodBoolean,coerce:t?.coerce||!1,...P(t)});class pt extends M{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==S.date){const n=this._getOrReturnCtx(e);return N(n,{code:_.invalid_type,expected:S.date,received:n.parsedType}),O}if(Number.isNaN(e.data.getTime())){const n=this._getOrReturnCtx(e);return N(n,{code:_.invalid_date}),O}const s=new ie;let a;for(const n of this._def.checks)n.kind==="min"?e.data.getTime()<n.value&&(a=this._getOrReturnCtx(e,a),N(a,{code:_.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),s.dirty()):n.kind==="max"?e.data.getTime()>n.value&&(a=this._getOrReturnCtx(e,a),N(a,{code:_.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),s.dirty()):B.assertNever(n);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new pt({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:C.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:C.toString(r)})}get minDate(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}}pt.create=t=>new pt({checks:[],coerce:t?.coerce||!1,typeName:R.ZodDate,...P(t)});class Br extends M{_parse(e){if(this._getType(e)!==S.symbol){const s=this._getOrReturnCtx(e);return N(s,{code:_.invalid_type,expected:S.symbol,received:s.parsedType}),O}return ce(e.data)}}Br.create=t=>new Br({typeName:R.ZodSymbol,...P(t)});class zr extends M{_parse(e){if(this._getType(e)!==S.undefined){const s=this._getOrReturnCtx(e);return N(s,{code:_.invalid_type,expected:S.undefined,received:s.parsedType}),O}return ce(e.data)}}zr.create=t=>new zr({typeName:R.ZodUndefined,...P(t)});class Dr extends M{_parse(e){if(this._getType(e)!==S.null){const s=this._getOrReturnCtx(e);return N(s,{code:_.invalid_type,expected:S.null,received:s.parsedType}),O}return ce(e.data)}}Dr.create=t=>new Dr({typeName:R.ZodNull,...P(t)});class Fr extends M{constructor(){super(...arguments),this._any=!0}_parse(e){return ce(e.data)}}Fr.create=t=>new Fr({typeName:R.ZodAny,...P(t)});class Ur extends M{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ce(e.data)}}Ur.create=t=>new Ur({typeName:R.ZodUnknown,...P(t)});class Te extends M{_parse(e){const r=this._getOrReturnCtx(e);return N(r,{code:_.invalid_type,expected:S.never,received:r.parsedType}),O}}Te.create=t=>new Te({typeName:R.ZodNever,...P(t)});class Zr extends M{_parse(e){if(this._getType(e)!==S.undefined){const s=this._getOrReturnCtx(e);return N(s,{code:_.invalid_type,expected:S.void,received:s.parsedType}),O}return ce(e.data)}}Zr.create=t=>new Zr({typeName:R.ZodVoid,...P(t)});class pe extends M{_parse(e){const{ctx:r,status:s}=this._processInputParams(e),a=this._def;if(r.parsedType!==S.array)return N(r,{code:_.invalid_type,expected:S.array,received:r.parsedType}),O;if(a.exactLength!==null){const o=r.data.length>a.exactLength.value,i=r.data.length<a.exactLength.value;(o||i)&&(N(r,{code:o?_.too_big:_.too_small,minimum:i?a.exactLength.value:void 0,maximum:o?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),s.dirty())}if(a.minLength!==null&&r.data.length<a.minLength.value&&(N(r,{code:_.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),s.dirty()),a.maxLength!==null&&r.data.length>a.maxLength.value&&(N(r,{code:_.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),s.dirty()),r.common.async)return Promise.all([...r.data].map((o,i)=>a.type._parseAsync(new we(r,o,r.path,i)))).then(o=>ie.mergeArray(s,o));const n=[...r.data].map((o,i)=>a.type._parseSync(new we(r,o,r.path,i)));return ie.mergeArray(s,n)}get element(){return this._def.type}min(e,r){return new pe({...this._def,minLength:{value:e,message:C.toString(r)}})}max(e,r){return new pe({...this._def,maxLength:{value:e,message:C.toString(r)}})}length(e,r){return new pe({...this._def,exactLength:{value:e,message:C.toString(r)}})}nonempty(e){return this.min(1,e)}}pe.create=(t,e)=>new pe({type:t,minLength:null,maxLength:null,exactLength:null,typeName:R.ZodArray,...P(e)});function Le(t){if(t instanceof Z){const e={};for(const r in t.shape){const s=t.shape[r];e[r]=ke.create(Le(s))}return new Z({...t._def,shape:()=>e})}else return t instanceof pe?new pe({...t._def,type:Le(t.element)}):t instanceof ke?ke.create(Le(t.unwrap())):t instanceof Fe?Fe.create(Le(t.unwrap())):t instanceof Oe?Oe.create(t.items.map(e=>Le(e))):t}class Z extends M{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),r=B.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==S.object){const c=this._getOrReturnCtx(e);return N(c,{code:_.invalid_type,expected:S.object,received:c.parsedType}),O}const{status:s,ctx:a}=this._processInputParams(e),{shape:n,keys:o}=this._getCached(),i=[];if(!(this._def.catchall instanceof Te&&this._def.unknownKeys==="strip"))for(const c in a.data)o.includes(c)||i.push(c);const u=[];for(const c of o){const d=n[c],p=a.data[c];u.push({key:{status:"valid",value:c},value:d._parse(new we(a,p,a.path,c)),alwaysSet:c in a.data})}if(this._def.catchall instanceof Te){const c=this._def.unknownKeys;if(c==="passthrough")for(const d of i)u.push({key:{status:"valid",value:d},value:{status:"valid",value:a.data[d]}});else if(c==="strict")i.length>0&&(N(a,{code:_.unrecognized_keys,keys:i}),s.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const d of i){const p=a.data[d];u.push({key:{status:"valid",value:d},value:c._parse(new we(a,p,a.path,d)),alwaysSet:d in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const c=[];for(const d of u){const p=await d.key,k=await d.value;c.push({key:p,value:k,alwaysSet:d.alwaysSet})}return c}).then(c=>ie.mergeObjectSync(s,c)):ie.mergeObjectSync(s,u)}get shape(){return this._def.shape()}strict(e){return C.errToObj,new Z({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,s)=>{const a=this._def.errorMap?.(r,s).message??s.defaultError;return r.code==="unrecognized_keys"?{message:C.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new Z({...this._def,unknownKeys:"strip"})}passthrough(){return new Z({...this._def,unknownKeys:"passthrough"})}extend(e){return new Z({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Z({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:R.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new Z({...this._def,catchall:e})}pick(e){const r={};for(const s of B.objectKeys(e))e[s]&&this.shape[s]&&(r[s]=this.shape[s]);return new Z({...this._def,shape:()=>r})}omit(e){const r={};for(const s of B.objectKeys(this.shape))e[s]||(r[s]=this.shape[s]);return new Z({...this._def,shape:()=>r})}deepPartial(){return Le(this)}partial(e){const r={};for(const s of B.objectKeys(this.shape)){const a=this.shape[s];e&&!e[s]?r[s]=a:r[s]=a.optional()}return new Z({...this._def,shape:()=>r})}required(e){const r={};for(const s of B.objectKeys(this.shape))if(e&&!e[s])r[s]=this.shape[s];else{let n=this.shape[s];for(;n instanceof ke;)n=n._def.innerType;r[s]=n}return new Z({...this._def,shape:()=>r})}keyof(){return qs(B.objectKeys(this.shape))}}Z.create=(t,e)=>new Z({shape:()=>t,unknownKeys:"strip",catchall:Te.create(),typeName:R.ZodObject,...P(e)});Z.strictCreate=(t,e)=>new Z({shape:()=>t,unknownKeys:"strict",catchall:Te.create(),typeName:R.ZodObject,...P(e)});Z.lazycreate=(t,e)=>new Z({shape:t,unknownKeys:"strip",catchall:Te.create(),typeName:R.ZodObject,...P(e)});class gt extends M{_parse(e){const{ctx:r}=this._processInputParams(e),s=this._def.options;function a(n){for(const i of n)if(i.result.status==="valid")return i.result;for(const i of n)if(i.result.status==="dirty")return r.common.issues.push(...i.ctx.common.issues),i.result;const o=n.map(i=>new be(i.ctx.common.issues));return N(r,{code:_.invalid_union,unionErrors:o}),O}if(r.common.async)return Promise.all(s.map(async n=>{const o={...r,common:{...r.common,issues:[]},parent:null};return{result:await n._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(a);{let n;const o=[];for(const u of s){const c={...r,common:{...r.common,issues:[]},parent:null},d=u._parseSync({data:r.data,path:r.path,parent:c});if(d.status==="valid")return d;d.status==="dirty"&&!n&&(n={result:d,ctx:c}),c.common.issues.length&&o.push(c.common.issues)}if(n)return r.common.issues.push(...n.ctx.common.issues),n.result;const i=o.map(u=>new be(u));return N(r,{code:_.invalid_union,unionErrors:i}),O}}get options(){return this._def.options}}gt.create=(t,e)=>new gt({options:t,typeName:R.ZodUnion,...P(e)});function Xt(t,e){const r=ve(t),s=ve(e);if(t===e)return{valid:!0,data:t};if(r===S.object&&s===S.object){const a=B.objectKeys(e),n=B.objectKeys(t).filter(i=>a.indexOf(i)!==-1),o={...t,...e};for(const i of n){const u=Xt(t[i],e[i]);if(!u.valid)return{valid:!1};o[i]=u.data}return{valid:!0,data:o}}else if(r===S.array&&s===S.array){if(t.length!==e.length)return{valid:!1};const a=[];for(let n=0;n<t.length;n++){const o=t[n],i=e[n],u=Xt(o,i);if(!u.valid)return{valid:!1};a.push(u.data)}return{valid:!0,data:a}}else return r===S.date&&s===S.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class yt extends M{_parse(e){const{status:r,ctx:s}=this._processInputParams(e),a=(n,o)=>{if(Ir(n)||Ir(o))return O;const i=Xt(n.value,o.value);return i.valid?(($r(n)||$r(o))&&r.dirty(),{status:r.value,value:i.data}):(N(s,{code:_.invalid_intersection_types}),O)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([n,o])=>a(n,o)):a(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}yt.create=(t,e,r)=>new yt({left:t,right:e,typeName:R.ZodIntersection,...P(r)});class Oe extends M{_parse(e){const{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==S.array)return N(s,{code:_.invalid_type,expected:S.array,received:s.parsedType}),O;if(s.data.length<this._def.items.length)return N(s,{code:_.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),O;!this._def.rest&&s.data.length>this._def.items.length&&(N(s,{code:_.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const n=[...s.data].map((o,i)=>{const u=this._def.items[i]||this._def.rest;return u?u._parse(new we(s,o,s.path,i)):null}).filter(o=>!!o);return s.common.async?Promise.all(n).then(o=>ie.mergeArray(r,o)):ie.mergeArray(r,n)}get items(){return this._def.items}rest(e){return new Oe({...this._def,rest:e})}}Oe.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Oe({items:t,typeName:R.ZodTuple,rest:null,...P(e)})};class Vr extends M{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==S.map)return N(s,{code:_.invalid_type,expected:S.map,received:s.parsedType}),O;const a=this._def.keyType,n=this._def.valueType,o=[...s.data.entries()].map(([i,u],c)=>({key:a._parse(new we(s,i,s.path,[c,"key"])),value:n._parse(new we(s,u,s.path,[c,"value"]))}));if(s.common.async){const i=new Map;return Promise.resolve().then(async()=>{for(const u of o){const c=await u.key,d=await u.value;if(c.status==="aborted"||d.status==="aborted")return O;(c.status==="dirty"||d.status==="dirty")&&r.dirty(),i.set(c.value,d.value)}return{status:r.value,value:i}})}else{const i=new Map;for(const u of o){const c=u.key,d=u.value;if(c.status==="aborted"||d.status==="aborted")return O;(c.status==="dirty"||d.status==="dirty")&&r.dirty(),i.set(c.value,d.value)}return{status:r.value,value:i}}}}Vr.create=(t,e,r)=>new Vr({valueType:e,keyType:t,typeName:R.ZodMap,...P(r)});class et extends M{_parse(e){const{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==S.set)return N(s,{code:_.invalid_type,expected:S.set,received:s.parsedType}),O;const a=this._def;a.minSize!==null&&s.data.size<a.minSize.value&&(N(s,{code:_.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),r.dirty()),a.maxSize!==null&&s.data.size>a.maxSize.value&&(N(s,{code:_.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),r.dirty());const n=this._def.valueType;function o(u){const c=new Set;for(const d of u){if(d.status==="aborted")return O;d.status==="dirty"&&r.dirty(),c.add(d.value)}return{status:r.value,value:c}}const i=[...s.data.values()].map((u,c)=>n._parse(new we(s,u,s.path,c)));return s.common.async?Promise.all(i).then(u=>o(u)):o(i)}min(e,r){return new et({...this._def,minSize:{value:e,message:C.toString(r)}})}max(e,r){return new et({...this._def,maxSize:{value:e,message:C.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}et.create=(t,e)=>new et({valueType:t,minSize:null,maxSize:null,typeName:R.ZodSet,...P(e)});class qr extends M{get schema(){return this._def.getter()}_parse(e){const{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}qr.create=(t,e)=>new qr({getter:t,typeName:R.ZodLazy,...P(e)});class Hr extends M{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return N(r,{received:r.data,code:_.invalid_literal,expected:this._def.value}),O}return{status:"valid",value:e.data}}get value(){return this._def.value}}Hr.create=(t,e)=>new Hr({value:t,typeName:R.ZodLiteral,...P(e)});function qs(t,e){return new ze({values:t,typeName:R.ZodEnum,...P(e)})}class ze extends M{_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),s=this._def.values;return N(r,{expected:B.joinValues(s),received:r.parsedType,code:_.invalid_type}),O}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const r=this._getOrReturnCtx(e),s=this._def.values;return N(r,{received:r.data,code:_.invalid_enum_value,options:s}),O}return ce(e.data)}get options(){return this._def.values}get enum(){const e={};for(const r of this._def.values)e[r]=r;return e}get Values(){const e={};for(const r of this._def.values)e[r]=r;return e}get Enum(){const e={};for(const r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return ze.create(e,{...this._def,...r})}exclude(e,r=this._def){return ze.create(this.options.filter(s=>!e.includes(s)),{...this._def,...r})}}ze.create=qs;class Wr extends M{_parse(e){const r=B.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==S.string&&s.parsedType!==S.number){const a=B.objectValues(r);return N(s,{expected:B.joinValues(a),received:s.parsedType,code:_.invalid_type}),O}if(this._cache||(this._cache=new Set(B.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const a=B.objectValues(r);return N(s,{received:s.data,code:_.invalid_enum_value,options:a}),O}return ce(e.data)}get enum(){return this._def.values}}Wr.create=(t,e)=>new Wr({values:t,typeName:R.ZodNativeEnum,...P(e)});class bt extends M{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==S.promise&&r.common.async===!1)return N(r,{code:_.invalid_type,expected:S.promise,received:r.parsedType}),O;const s=r.parsedType===S.promise?r.data:Promise.resolve(r.data);return ce(s.then(a=>this._def.type.parseAsync(a,{path:r.path,errorMap:r.common.contextualErrorMap})))}}bt.create=(t,e)=>new bt({type:t,typeName:R.ZodPromise,...P(e)});class De extends M{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===R.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:r,ctx:s}=this._processInputParams(e),a=this._def.effect||null,n={addIssue:o=>{N(s,o),o.fatal?r.abort():r.dirty()},get path(){return s.path}};if(n.addIssue=n.addIssue.bind(n),a.type==="preprocess"){const o=a.transform(s.data,n);if(s.common.async)return Promise.resolve(o).then(async i=>{if(r.value==="aborted")return O;const u=await this._def.schema._parseAsync({data:i,path:s.path,parent:s});return u.status==="aborted"?O:u.status==="dirty"||r.value==="dirty"?Je(u.value):u});{if(r.value==="aborted")return O;const i=this._def.schema._parseSync({data:o,path:s.path,parent:s});return i.status==="aborted"?O:i.status==="dirty"||r.value==="dirty"?Je(i.value):i}}if(a.type==="refinement"){const o=i=>{const u=a.refinement(i,n);if(s.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return i};if(s.common.async===!1){const i=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return i.status==="aborted"?O:(i.status==="dirty"&&r.dirty(),o(i.value),{status:r.value,value:i.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(i=>i.status==="aborted"?O:(i.status==="dirty"&&r.dirty(),o(i.value).then(()=>({status:r.value,value:i.value}))))}if(a.type==="transform")if(s.common.async===!1){const o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!Be(o))return O;const i=a.transform(o.value,n);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:i}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>Be(o)?Promise.resolve(a.transform(o.value,n)).then(i=>({status:r.value,value:i})):O);B.assertNever(a)}}De.create=(t,e,r)=>new De({schema:t,typeName:R.ZodEffects,effect:e,...P(r)});De.createWithPreprocess=(t,e,r)=>new De({schema:e,effect:{type:"preprocess",transform:t},typeName:R.ZodEffects,...P(r)});class ke extends M{_parse(e){return this._getType(e)===S.undefined?ce(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ke.create=(t,e)=>new ke({innerType:t,typeName:R.ZodOptional,...P(e)});class Fe extends M{_parse(e){return this._getType(e)===S.null?ce(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Fe.create=(t,e)=>new Fe({innerType:t,typeName:R.ZodNullable,...P(e)});class Gt extends M{_parse(e){const{ctx:r}=this._processInputParams(e);let s=r.data;return r.parsedType===S.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}Gt.create=(t,e)=>new Gt({innerType:t,typeName:R.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...P(e)});class Kt extends M{_parse(e){const{ctx:r}=this._processInputParams(e),s={...r,common:{...r.common,issues:[]}},a=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return ht(a)?a.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new be(s.common.issues)},input:s.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new be(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}Kt.create=(t,e)=>new Kt({innerType:t,typeName:R.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...P(e)});class Jr extends M{_parse(e){if(this._getType(e)!==S.nan){const s=this._getOrReturnCtx(e);return N(s,{code:_.invalid_type,expected:S.nan,received:s.parsedType}),O}return{status:"valid",value:e.data}}}Jr.create=t=>new Jr({typeName:R.ZodNaN,...P(t)});class Tl extends M{_parse(e){const{ctx:r}=this._processInputParams(e),s=r.data;return this._def.type._parse({data:s,path:r.path,parent:r})}unwrap(){return this._def.type}}class cr extends M{_parse(e){const{status:r,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const n=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?O:n.status==="dirty"?(r.dirty(),Je(n.value)):this._def.out._parseAsync({data:n.value,path:s.path,parent:s})})();{const a=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?O:a.status==="dirty"?(r.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:s.path,parent:s})}}static create(e,r){return new cr({in:e,out:r,typeName:R.ZodPipeline})}}class Yt extends M{_parse(e){const r=this._def.innerType._parse(e),s=a=>(Be(a)&&(a.value=Object.freeze(a.value)),a);return ht(r)?r.then(a=>s(a)):s(r)}unwrap(){return this._def.innerType}}Yt.create=(t,e)=>new Yt({innerType:t,typeName:R.ZodReadonly,...P(e)});var R;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(R||(R={}));const Xr=_e.create;Te.create;pe.create;const Nl=Z.create;gt.create;yt.create;Oe.create;ze.create;bt.create;ke.create;Fe.create;const jl=Nl({email:Xr().min(1,"Email is required").email("Enter a valid email"),password:Xr().min(1,"Password is required").min(6,"Password must be at least 6 characters")}),Sl=({logo:t,slogan:e,pageTitle:r})=>{const{error:s,loginAction:a}=it(),[n,o]=y.useState(""),[i,u]=y.useState(""),[c,d]=y.useState({}),[p,k]=y.useState(!1),T=g=>{o(g),c.email&&d(v=>({...v,form:void 0,email:void 0}))},m=g=>{u(g),c.password&&d(v=>({...v,form:void 0,password:void 0}))},h=async g=>{g.preventDefault(),d({});const v=jl.safeParse({email:n,password:i});if(!v.success){const{fieldErrors:b}=v.error.flatten();d({email:b.email?.[0],password:b.password?.[0]});return}k(!0);const x=await a({email:n,password:i,loginType:"M"});k(!1),x||d({form:"Invalid email or password. Please try again."})};return l.jsxs("div",{className:"relative flex items-center justify-center min-h-screen bg-gary-100 dark:bg-slate-900",children:[l.jsx("div",{className:"absolute top-4 right-4 z-10",children:l.jsx(er,{})}),l.jsxs("div",{className:"w-full max-w-md p-8 m-4 bg-gary-100 dark:bg-slate-800 rounded-lg shadow-2xl transform transition-all duration-500 scale-100 hover:shadow-violet-700",children:[l.jsx("div",{className:"flex justify-center mb-6",children:t}),l.jsx("h2",{className:"text-3xl font-extrabold text-center text-slate-700 dark:text-slate-100 mb-2",children:r}),l.jsx("p",{className:"text-center text-sm text-slate-500 dark:text-slate-400 mb-8",children:e}),s&&l.jsx(Kr,{variant:"danger",className:"w-full mb-4 justify-center",children:s}),l.jsxs("form",{className:"space-y-3",onSubmit:h,children:[l.jsx(Bt,{id:"email",value:n,placeholder:"Email",error:c.email,onChange:T}),l.jsx(Bt,{id:"password",type:"password",value:i,placeholder:"Password",error:c.password,onChange:m}),l.jsx("div",{children:l.jsx(de,{size:"large",type:"submit",disabled:p,className:"w-full mt-2",children:p?l.jsxs(l.Fragment,{children:[l.jsx(xt,{variant:"default"})," ","Logging..."]}):"Sign In"})})]})]})]})};exports.AUTH=lr;exports.ActivityFeed=rn;exports.ActivityItem=is;exports.AdminLayout=lo;exports.Badge=Kr;exports.BorderRadius=re;exports.Button=de;exports.ButtonState=Ws;exports.Card=vt;exports.CardBody=_t;exports.CardFooter=Ha;exports.CardHeader=ns;exports.Checkbox=mn;exports.GlobalContainer=mo;exports.GlobalLoader=os;exports.InfoCard=Wa;exports.InlineLoader=xt;exports.Input=Bt;exports.LoginPage=Sl;exports.Modal=Za;exports.ModalBody=Mt;exports.ModalFooter=rs;exports.ModalHeader=Pt;exports.MultiSelect=wn;exports.PageContainer=co;exports.Pagination=an;exports.Position=J;exports.ProgressStat=sn;exports.RadioGroup=xn;exports.Row=Gs;exports.Select=Qt;exports.SideNavbar=Yi;exports.Size=le;exports.StatCard=Ja;exports.Switch=gn;exports.TEMP_LOGIN_URL=Us;exports.Table=Ga;exports.TableBody=Ya;exports.TableData=tn;exports.TableHead=en;exports.TableHeader=Ka;exports.TableRow=Qa;exports.Textarea=dn;exports.ThemeProvider=Da;exports.ThemeToggle=er;exports.Tooltip=$e;exports.TopNavbar=Gi;exports.Variant=X;exports.axiosInstance=Ke;exports.capitalizeWords=ys;exports.errorToast=ho;exports.getConfig=sr;exports.infoToast=po;exports.initConfig=vo;exports.loaderService=Pe;exports.manageTextLength=rr;exports.successToast=gs;exports.useAuthStore=it;exports.useMenuStore=Nt;exports.useTheme=ts;exports.warningToast=go;
17
+ `,children:a?o.jsxs("div",{className:"px-3 py-2 rounded-xl bg-linear-to-br from-violet-50 to-purple-50 dark:from-violet-900/20 dark:to-purple-900/20 border border-violet-200 dark:border-violet-800",children:[o.jsx("p",{className:"text-xs font-semibold text-violet-700 dark:text-violet-400",children:"Need Help?"}),o.jsx("p",{className:"text-xs text-slate-600 dark:text-slate-400 mt-1",children:"Contact support team"})]}):o.jsx(ve,{text:"Need Help?",position:"right",children:o.jsx("div",{className:"w-10 h-10 rounded-xl bg-linear-to-br from-violet-50 to-purple-50 dark:from-violet-900/20 dark:to-purple-900/20 border border-violet-200 dark:border-violet-800 flex items-center justify-center cursor-pointer hover:scale-110 transition-transform",children:o.jsx("span",{className:"text-violet-700 dark:text-violet-400 font-bold text-sm",children:"?"})})})})]})};var A;(function(t){t.assertEqual=a=>{};function e(a){}t.assertIs=e;function s(a){throw new Error}t.assertNever=s,t.arrayToEnum=a=>{const n={};for(const i of a)n[i]=i;return n},t.getValidEnumValues=a=>{const n=t.objectKeys(a).filter(l=>typeof a[a[l]]!="number"),i={};for(const l of n)i[l]=a[l];return t.objectValues(i)},t.objectValues=a=>t.objectKeys(a).map(function(n){return a[n]}),t.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const n=[];for(const i in a)Object.prototype.hasOwnProperty.call(a,i)&&n.push(i);return n},t.find=(a,n)=>{for(const i of a)if(n(i))return i},t.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function r(a,n=" | "){return a.map(i=>typeof i=="string"?`'${i}'`:i).join(n)}t.joinValues=r,t.jsonStringifyReplacer=(a,n)=>typeof n=="bigint"?n.toString():n})(A||(A={}));var kt;(function(t){t.mergeShapes=(e,s)=>({...e,...s})})(kt||(kt={}));const k=A.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ie=t=>{switch(typeof t){case"undefined":return k.undefined;case"string":return k.string;case"number":return Number.isNaN(t)?k.nan:k.number;case"boolean":return k.boolean;case"function":return k.function;case"bigint":return k.bigint;case"symbol":return k.symbol;case"object":return Array.isArray(t)?k.array:t===null?k.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?k.promise:typeof Map<"u"&&t instanceof Map?k.map:typeof Set<"u"&&t instanceof Set?k.set:typeof Date<"u"&&t instanceof Date?k.date:k.object;default:return k.unknown}},m=A.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class oe extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const s=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,s):this.__proto__=s,this.name="ZodError",this.issues=e}format(e){const s=e||function(n){return n.message},r={_errors:[]},a=n=>{for(const i of n.issues)if(i.code==="invalid_union")i.unionErrors.map(a);else if(i.code==="invalid_return_type")a(i.returnTypeError);else if(i.code==="invalid_arguments")a(i.argumentsError);else if(i.path.length===0)r._errors.push(s(i));else{let l=r,d=0;for(;d<i.path.length;){const c=i.path[d];d===i.path.length-1?(l[c]=l[c]||{_errors:[]},l[c]._errors.push(s(i))):l[c]=l[c]||{_errors:[]},l=l[c],d++}}};return a(this),r}static assert(e){if(!(e instanceof oe))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,A.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=s=>s.message){const s={},r=[];for(const a of this.issues)if(a.path.length>0){const n=a.path[0];s[n]=s[n]||[],s[n].push(e(a))}else r.push(e(a));return{formErrors:r,fieldErrors:s}}get formErrors(){return this.flatten()}}oe.create=t=>new oe(t);const st=(t,e)=>{let s;switch(t.code){case m.invalid_type:t.received===k.undefined?s="Required":s=`Expected ${t.expected}, received ${t.received}`;break;case m.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(t.expected,A.jsonStringifyReplacer)}`;break;case m.unrecognized_keys:s=`Unrecognized key(s) in object: ${A.joinValues(t.keys,", ")}`;break;case m.invalid_union:s="Invalid input";break;case m.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${A.joinValues(t.options)}`;break;case m.invalid_enum_value:s=`Invalid enum value. Expected ${A.joinValues(t.options)}, received '${t.received}'`;break;case m.invalid_arguments:s="Invalid function arguments";break;case m.invalid_return_type:s="Invalid function return type";break;case m.invalid_date:s="Invalid date";break;case m.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(s=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(s=`${s} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?s=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?s=`Invalid input: must end with "${t.validation.endsWith}"`:A.assertNever(t.validation):t.validation!=="regex"?s=`Invalid ${t.validation}`:s="Invalid";break;case m.too_small:t.type==="array"?s=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?s=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?s=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?s=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?s=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:s="Invalid input";break;case m.too_big:t.type==="array"?s=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?s=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?s=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?s=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?s=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:s="Invalid input";break;case m.custom:s="Invalid input";break;case m.invalid_intersection_types:s="Intersection results could not be merged";break;case m.not_multiple_of:s=`Number must be a multiple of ${t.multipleOf}`;break;case m.not_finite:s="Number must be finite";break;default:s=e.defaultError,A.assertNever(t)}return{message:s}};let Wa=st;function Xa(){return Wa}const Ga=t=>{const{data:e,path:s,errorMaps:r,issueData:a}=t,n=[...s,...a.path||[]],i={...a,path:n};if(a.message!==void 0)return{...a,path:n,message:a.message};let l="";const d=r.filter(c=>!!c).slice().reverse();for(const c of d)l=c(i,{data:e,defaultError:l}).message;return{...a,path:n,message:l}};function x(t,e){const s=Xa(),r=Ga({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,s,s===st?void 0:st].filter(a=>!!a)});t.common.issues.push(r)}class J{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,s){const r=[];for(const a of s){if(a.status==="aborted")return S;a.status==="dirty"&&e.dirty(),r.push(a.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,s){const r=[];for(const a of s){const n=await a.key,i=await a.value;r.push({key:n,value:i})}return J.mergeObjectSync(e,r)}static mergeObjectSync(e,s){const r={};for(const a of s){const{key:n,value:i}=a;if(n.status==="aborted"||i.status==="aborted")return S;n.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),n.value!=="__proto__"&&(typeof i.value<"u"||a.alwaysSet)&&(r[n.value]=i.value)}return{status:e.value,value:r}}}const S=Object.freeze({status:"aborted"}),Ne=t=>({status:"dirty",value:t}),ee=t=>({status:"valid",value:t}),wt=t=>t.status==="aborted",jt=t=>t.status==="dirty",_e=t=>t.status==="valid",Re=t=>typeof Promise<"u"&&t instanceof Promise;var j;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(j||(j={}));class ce{constructor(e,s,r,a){this._cachedPath=[],this.parent=e,this.data=s,this._path=r,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Nt=(t,e)=>{if(_e(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const s=new oe(t.common.issues);return this._error=s,this._error}}};function O(t){if(!t)return{};const{errorMap:e,invalid_type_error:s,required_error:r,description:a}=t;if(e&&(s||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(i,l)=>{const{message:d}=t;return i.code==="invalid_enum_value"?{message:d??l.defaultError}:typeof l.data>"u"?{message:d??r??l.defaultError}:i.code!=="invalid_type"?{message:l.defaultError}:{message:d??s??l.defaultError}},description:a}}class R{get description(){return this._def.description}_getType(e){return ie(e.data)}_getOrReturnCtx(e,s){return s||{common:e.parent.common,data:e.data,parsedType:ie(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new J,ctx:{common:e.parent.common,data:e.data,parsedType:ie(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const s=this._parse(e);if(Re(s))throw new Error("Synchronous parse encountered promise.");return s}_parseAsync(e){const s=this._parse(e);return Promise.resolve(s)}parse(e,s){const r=this.safeParse(e,s);if(r.success)return r.data;throw r.error}safeParse(e,s){const r={common:{issues:[],async:s?.async??!1,contextualErrorMap:s?.errorMap},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ie(e)},a=this._parseSync({data:e,path:r.path,parent:r});return Nt(r,a)}"~validate"(e){const s={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ie(e)};if(!this["~standard"].async)try{const r=this._parseSync({data:e,path:[],parent:s});return _e(r)?{value:r.value}:{issues:s.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),s.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:s}).then(r=>_e(r)?{value:r.value}:{issues:s.common.issues})}async parseAsync(e,s){const r=await this.safeParseAsync(e,s);if(r.success)return r.data;throw r.error}async safeParseAsync(e,s){const r={common:{issues:[],contextualErrorMap:s?.errorMap,async:!0},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ie(e)},a=this._parse({data:e,path:r.path,parent:r}),n=await(Re(a)?a:Promise.resolve(a));return Nt(r,n)}refine(e,s){const r=a=>typeof s=="string"||typeof s>"u"?{message:s}:typeof s=="function"?s(a):s;return this._refinement((a,n)=>{const i=e(a),l=()=>n.addIssue({code:m.custom,...r(a)});return typeof Promise<"u"&&i instanceof Promise?i.then(d=>d?!0:(l(),!1)):i?!0:(l(),!1)})}refinement(e,s){return this._refinement((r,a)=>e(r)?!0:(a.addIssue(typeof s=="function"?s(r,a):s),!1))}_refinement(e){return new we({schema:this,typeName:E.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:s=>this["~validate"](s)}}optional(){return de.create(this,this._def)}nullable(){return je.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return re.create(this)}promise(){return Pe.create(this,this._def)}or(e){return Me.create([this,e],this._def)}and(e){return ze.create(this,e,this._def)}transform(e){return new we({...O(this._def),schema:this,typeName:E.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const s=typeof e=="function"?e:()=>e;return new at({...O(this._def),innerType:this,defaultValue:s,typeName:E.ZodDefault})}brand(){return new xn({typeName:E.ZodBranded,type:this,...O(this._def)})}catch(e){const s=typeof e=="function"?e:()=>e;return new nt({...O(this._def),innerType:this,catchValue:s,typeName:E.ZodCatch})}describe(e){const s=this.constructor;return new s({...this._def,description:e})}pipe(e){return ut.create(this,e)}readonly(){return ot.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Ya=/^c[^\s-]{8,}$/i,Ja=/^[0-9a-z]+$/,Qa=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Ka=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,en=/^[a-z0-9_-]{21}$/i,tn=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,sn=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,rn=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,an="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let We;const nn=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,on=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ln=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,dn=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,cn=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,un=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ds="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",fn=new RegExp(`^${ds}$`);function cs(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const s=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${s}`}function mn(t){return new RegExp(`^${cs(t)}$`)}function hn(t){let e=`${ds}T${cs(t)}`;const s=[];return s.push(t.local?"Z?":"Z"),t.offset&&s.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${s.join("|")})`,new RegExp(`^${e}$`)}function pn(t,e){return!!((e==="v4"||!e)&&nn.test(t)||(e==="v6"||!e)&&ln.test(t))}function gn(t,e){if(!tn.test(t))return!1;try{const[s]=t.split(".");if(!s)return!1;const r=s.replace(/-/g,"+").replace(/_/g,"/").padEnd(s.length+(4-s.length%4)%4,"="),a=JSON.parse(atob(r));return!(typeof a!="object"||a===null||"typ"in a&&a?.typ!=="JWT"||!a.alg||e&&a.alg!==e)}catch{return!1}}function yn(t,e){return!!((e==="v4"||!e)&&on.test(t)||(e==="v6"||!e)&&dn.test(t))}class le extends R{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==k.string){const n=this._getOrReturnCtx(e);return x(n,{code:m.invalid_type,expected:k.string,received:n.parsedType}),S}const r=new J;let a;for(const n of this._def.checks)if(n.kind==="min")e.data.length<n.value&&(a=this._getOrReturnCtx(e,a),x(a,{code:m.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),r.dirty());else if(n.kind==="max")e.data.length>n.value&&(a=this._getOrReturnCtx(e,a),x(a,{code:m.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),r.dirty());else if(n.kind==="length"){const i=e.data.length>n.value,l=e.data.length<n.value;(i||l)&&(a=this._getOrReturnCtx(e,a),i?x(a,{code:m.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):l&&x(a,{code:m.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),r.dirty())}else if(n.kind==="email")rn.test(e.data)||(a=this._getOrReturnCtx(e,a),x(a,{validation:"email",code:m.invalid_string,message:n.message}),r.dirty());else if(n.kind==="emoji")We||(We=new RegExp(an,"u")),We.test(e.data)||(a=this._getOrReturnCtx(e,a),x(a,{validation:"emoji",code:m.invalid_string,message:n.message}),r.dirty());else if(n.kind==="uuid")Ka.test(e.data)||(a=this._getOrReturnCtx(e,a),x(a,{validation:"uuid",code:m.invalid_string,message:n.message}),r.dirty());else if(n.kind==="nanoid")en.test(e.data)||(a=this._getOrReturnCtx(e,a),x(a,{validation:"nanoid",code:m.invalid_string,message:n.message}),r.dirty());else if(n.kind==="cuid")Ya.test(e.data)||(a=this._getOrReturnCtx(e,a),x(a,{validation:"cuid",code:m.invalid_string,message:n.message}),r.dirty());else if(n.kind==="cuid2")Ja.test(e.data)||(a=this._getOrReturnCtx(e,a),x(a,{validation:"cuid2",code:m.invalid_string,message:n.message}),r.dirty());else if(n.kind==="ulid")Qa.test(e.data)||(a=this._getOrReturnCtx(e,a),x(a,{validation:"ulid",code:m.invalid_string,message:n.message}),r.dirty());else if(n.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),x(a,{validation:"url",code:m.invalid_string,message:n.message}),r.dirty()}else n.kind==="regex"?(n.regex.lastIndex=0,n.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),x(a,{validation:"regex",code:m.invalid_string,message:n.message}),r.dirty())):n.kind==="trim"?e.data=e.data.trim():n.kind==="includes"?e.data.includes(n.value,n.position)||(a=this._getOrReturnCtx(e,a),x(a,{code:m.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),r.dirty()):n.kind==="toLowerCase"?e.data=e.data.toLowerCase():n.kind==="toUpperCase"?e.data=e.data.toUpperCase():n.kind==="startsWith"?e.data.startsWith(n.value)||(a=this._getOrReturnCtx(e,a),x(a,{code:m.invalid_string,validation:{startsWith:n.value},message:n.message}),r.dirty()):n.kind==="endsWith"?e.data.endsWith(n.value)||(a=this._getOrReturnCtx(e,a),x(a,{code:m.invalid_string,validation:{endsWith:n.value},message:n.message}),r.dirty()):n.kind==="datetime"?hn(n).test(e.data)||(a=this._getOrReturnCtx(e,a),x(a,{code:m.invalid_string,validation:"datetime",message:n.message}),r.dirty()):n.kind==="date"?fn.test(e.data)||(a=this._getOrReturnCtx(e,a),x(a,{code:m.invalid_string,validation:"date",message:n.message}),r.dirty()):n.kind==="time"?mn(n).test(e.data)||(a=this._getOrReturnCtx(e,a),x(a,{code:m.invalid_string,validation:"time",message:n.message}),r.dirty()):n.kind==="duration"?sn.test(e.data)||(a=this._getOrReturnCtx(e,a),x(a,{validation:"duration",code:m.invalid_string,message:n.message}),r.dirty()):n.kind==="ip"?pn(e.data,n.version)||(a=this._getOrReturnCtx(e,a),x(a,{validation:"ip",code:m.invalid_string,message:n.message}),r.dirty()):n.kind==="jwt"?gn(e.data,n.alg)||(a=this._getOrReturnCtx(e,a),x(a,{validation:"jwt",code:m.invalid_string,message:n.message}),r.dirty()):n.kind==="cidr"?yn(e.data,n.version)||(a=this._getOrReturnCtx(e,a),x(a,{validation:"cidr",code:m.invalid_string,message:n.message}),r.dirty()):n.kind==="base64"?cn.test(e.data)||(a=this._getOrReturnCtx(e,a),x(a,{validation:"base64",code:m.invalid_string,message:n.message}),r.dirty()):n.kind==="base64url"?un.test(e.data)||(a=this._getOrReturnCtx(e,a),x(a,{validation:"base64url",code:m.invalid_string,message:n.message}),r.dirty()):A.assertNever(n);return{status:r.value,value:e.data}}_regex(e,s,r){return this.refinement(a=>e.test(a),{validation:s,code:m.invalid_string,...j.errToObj(r)})}_addCheck(e){return new le({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...j.errToObj(e)})}url(e){return this._addCheck({kind:"url",...j.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...j.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...j.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...j.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...j.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...j.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...j.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...j.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...j.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...j.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...j.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...j.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...j.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...j.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...j.errToObj(e)})}regex(e,s){return this._addCheck({kind:"regex",regex:e,...j.errToObj(s)})}includes(e,s){return this._addCheck({kind:"includes",value:e,position:s?.position,...j.errToObj(s?.message)})}startsWith(e,s){return this._addCheck({kind:"startsWith",value:e,...j.errToObj(s)})}endsWith(e,s){return this._addCheck({kind:"endsWith",value:e,...j.errToObj(s)})}min(e,s){return this._addCheck({kind:"min",value:e,...j.errToObj(s)})}max(e,s){return this._addCheck({kind:"max",value:e,...j.errToObj(s)})}length(e,s){return this._addCheck({kind:"length",value:e,...j.errToObj(s)})}nonempty(e){return this.min(1,j.errToObj(e))}trim(){return new le({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new le({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new le({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e}get maxLength(){let e=null;for(const s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e}}le.create=t=>new le({checks:[],typeName:E.ZodString,coerce:t?.coerce??!1,...O(t)});function bn(t,e){const s=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,a=s>r?s:r,n=Number.parseInt(t.toFixed(a).replace(".","")),i=Number.parseInt(e.toFixed(a).replace(".",""));return n%i/10**a}class Se extends R{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==k.number){const n=this._getOrReturnCtx(e);return x(n,{code:m.invalid_type,expected:k.number,received:n.parsedType}),S}let r;const a=new J;for(const n of this._def.checks)n.kind==="int"?A.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),x(r,{code:m.invalid_type,expected:"integer",received:"float",message:n.message}),a.dirty()):n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(r=this._getOrReturnCtx(e,r),x(r,{code:m.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),a.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(r=this._getOrReturnCtx(e,r),x(r,{code:m.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),a.dirty()):n.kind==="multipleOf"?bn(e.data,n.value)!==0&&(r=this._getOrReturnCtx(e,r),x(r,{code:m.not_multiple_of,multipleOf:n.value,message:n.message}),a.dirty()):n.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),x(r,{code:m.not_finite,message:n.message}),a.dirty()):A.assertNever(n);return{status:a.value,value:e.data}}gte(e,s){return this.setLimit("min",e,!0,j.toString(s))}gt(e,s){return this.setLimit("min",e,!1,j.toString(s))}lte(e,s){return this.setLimit("max",e,!0,j.toString(s))}lt(e,s){return this.setLimit("max",e,!1,j.toString(s))}setLimit(e,s,r,a){return new Se({...this._def,checks:[...this._def.checks,{kind:e,value:s,inclusive:r,message:j.toString(a)}]})}_addCheck(e){return new Se({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:j.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:j.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:j.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:j.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:j.toString(e)})}multipleOf(e,s){return this._addCheck({kind:"multipleOf",value:e,message:j.toString(s)})}finite(e){return this._addCheck({kind:"finite",message:j.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:j.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:j.toString(e)})}get minValue(){let e=null;for(const s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e}get maxValue(){let e=null;for(const s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&A.isInteger(e.value))}get isFinite(){let e=null,s=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(s===null||r.value>s)&&(s=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(s)&&Number.isFinite(e)}}Se.create=t=>new Se({checks:[],typeName:E.ZodNumber,coerce:t?.coerce||!1,...O(t)});class Ee extends R{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==k.bigint)return this._getInvalidInput(e);let r;const a=new J;for(const n of this._def.checks)n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(r=this._getOrReturnCtx(e,r),x(r,{code:m.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),a.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(r=this._getOrReturnCtx(e,r),x(r,{code:m.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),a.dirty()):n.kind==="multipleOf"?e.data%n.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),x(r,{code:m.not_multiple_of,multipleOf:n.value,message:n.message}),a.dirty()):A.assertNever(n);return{status:a.value,value:e.data}}_getInvalidInput(e){const s=this._getOrReturnCtx(e);return x(s,{code:m.invalid_type,expected:k.bigint,received:s.parsedType}),S}gte(e,s){return this.setLimit("min",e,!0,j.toString(s))}gt(e,s){return this.setLimit("min",e,!1,j.toString(s))}lte(e,s){return this.setLimit("max",e,!0,j.toString(s))}lt(e,s){return this.setLimit("max",e,!1,j.toString(s))}setLimit(e,s,r,a){return new Ee({...this._def,checks:[...this._def.checks,{kind:e,value:s,inclusive:r,message:j.toString(a)}]})}_addCheck(e){return new Ee({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:j.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:j.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:j.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:j.toString(e)})}multipleOf(e,s){return this._addCheck({kind:"multipleOf",value:e,message:j.toString(s)})}get minValue(){let e=null;for(const s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e}get maxValue(){let e=null;for(const s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e}}Ee.create=t=>new Ee({checks:[],typeName:E.ZodBigInt,coerce:t?.coerce??!1,...O(t)});class Tt extends R{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==k.boolean){const r=this._getOrReturnCtx(e);return x(r,{code:m.invalid_type,expected:k.boolean,received:r.parsedType}),S}return ee(e.data)}}Tt.create=t=>new Tt({typeName:E.ZodBoolean,coerce:t?.coerce||!1,...O(t)});class Ae extends R{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==k.date){const n=this._getOrReturnCtx(e);return x(n,{code:m.invalid_type,expected:k.date,received:n.parsedType}),S}if(Number.isNaN(e.data.getTime())){const n=this._getOrReturnCtx(e);return x(n,{code:m.invalid_date}),S}const r=new J;let a;for(const n of this._def.checks)n.kind==="min"?e.data.getTime()<n.value&&(a=this._getOrReturnCtx(e,a),x(a,{code:m.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),r.dirty()):n.kind==="max"?e.data.getTime()>n.value&&(a=this._getOrReturnCtx(e,a),x(a,{code:m.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),r.dirty()):A.assertNever(n);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Ae({...this._def,checks:[...this._def.checks,e]})}min(e,s){return this._addCheck({kind:"min",value:e.getTime(),message:j.toString(s)})}max(e,s){return this._addCheck({kind:"max",value:e.getTime(),message:j.toString(s)})}get minDate(){let e=null;for(const s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e!=null?new Date(e):null}}Ae.create=t=>new Ae({checks:[],coerce:t?.coerce||!1,typeName:E.ZodDate,...O(t)});class Ct extends R{_parse(e){if(this._getType(e)!==k.symbol){const r=this._getOrReturnCtx(e);return x(r,{code:m.invalid_type,expected:k.symbol,received:r.parsedType}),S}return ee(e.data)}}Ct.create=t=>new Ct({typeName:E.ZodSymbol,...O(t)});class St extends R{_parse(e){if(this._getType(e)!==k.undefined){const r=this._getOrReturnCtx(e);return x(r,{code:m.invalid_type,expected:k.undefined,received:r.parsedType}),S}return ee(e.data)}}St.create=t=>new St({typeName:E.ZodUndefined,...O(t)});class Et extends R{_parse(e){if(this._getType(e)!==k.null){const r=this._getOrReturnCtx(e);return x(r,{code:m.invalid_type,expected:k.null,received:r.parsedType}),S}return ee(e.data)}}Et.create=t=>new Et({typeName:E.ZodNull,...O(t)});class It extends R{constructor(){super(...arguments),this._any=!0}_parse(e){return ee(e.data)}}It.create=t=>new It({typeName:E.ZodAny,...O(t)});class $t extends R{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ee(e.data)}}$t.create=t=>new $t({typeName:E.ZodUnknown,...O(t)});class ue extends R{_parse(e){const s=this._getOrReturnCtx(e);return x(s,{code:m.invalid_type,expected:k.never,received:s.parsedType}),S}}ue.create=t=>new ue({typeName:E.ZodNever,...O(t)});class Ot extends R{_parse(e){if(this._getType(e)!==k.undefined){const r=this._getOrReturnCtx(e);return x(r,{code:m.invalid_type,expected:k.void,received:r.parsedType}),S}return ee(e.data)}}Ot.create=t=>new Ot({typeName:E.ZodVoid,...O(t)});class re extends R{_parse(e){const{ctx:s,status:r}=this._processInputParams(e),a=this._def;if(s.parsedType!==k.array)return x(s,{code:m.invalid_type,expected:k.array,received:s.parsedType}),S;if(a.exactLength!==null){const i=s.data.length>a.exactLength.value,l=s.data.length<a.exactLength.value;(i||l)&&(x(s,{code:i?m.too_big:m.too_small,minimum:l?a.exactLength.value:void 0,maximum:i?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(a.minLength!==null&&s.data.length<a.minLength.value&&(x(s,{code:m.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),a.maxLength!==null&&s.data.length>a.maxLength.value&&(x(s,{code:m.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),s.common.async)return Promise.all([...s.data].map((i,l)=>a.type._parseAsync(new ce(s,i,s.path,l)))).then(i=>J.mergeArray(r,i));const n=[...s.data].map((i,l)=>a.type._parseSync(new ce(s,i,s.path,l)));return J.mergeArray(r,n)}get element(){return this._def.type}min(e,s){return new re({...this._def,minLength:{value:e,message:j.toString(s)}})}max(e,s){return new re({...this._def,maxLength:{value:e,message:j.toString(s)}})}length(e,s){return new re({...this._def,exactLength:{value:e,message:j.toString(s)}})}nonempty(e){return this.min(1,e)}}re.create=(t,e)=>new re({type:t,minLength:null,maxLength:null,exactLength:null,typeName:E.ZodArray,...O(e)});function xe(t){if(t instanceof D){const e={};for(const s in t.shape){const r=t.shape[s];e[s]=de.create(xe(r))}return new D({...t._def,shape:()=>e})}else return t instanceof re?new re({...t._def,type:xe(t.element)}):t instanceof de?de.create(xe(t.unwrap())):t instanceof je?je.create(xe(t.unwrap())):t instanceof pe?pe.create(t.items.map(e=>xe(e))):t}class D extends R{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),s=A.objectKeys(e);return this._cached={shape:e,keys:s},this._cached}_parse(e){if(this._getType(e)!==k.object){const c=this._getOrReturnCtx(e);return x(c,{code:m.invalid_type,expected:k.object,received:c.parsedType}),S}const{status:r,ctx:a}=this._processInputParams(e),{shape:n,keys:i}=this._getCached(),l=[];if(!(this._def.catchall instanceof ue&&this._def.unknownKeys==="strip"))for(const c in a.data)i.includes(c)||l.push(c);const d=[];for(const c of i){const u=n[c],y=a.data[c];d.push({key:{status:"valid",value:c},value:u._parse(new ce(a,y,a.path,c)),alwaysSet:c in a.data})}if(this._def.catchall instanceof ue){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of l)d.push({key:{status:"valid",value:u},value:{status:"valid",value:a.data[u]}});else if(c==="strict")l.length>0&&(x(a,{code:m.unrecognized_keys,keys:l}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of l){const y=a.data[u];d.push({key:{status:"valid",value:u},value:c._parse(new ce(a,y,a.path,u)),alwaysSet:u in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of d){const y=await u.key,w=await u.value;c.push({key:y,value:w,alwaysSet:u.alwaysSet})}return c}).then(c=>J.mergeObjectSync(r,c)):J.mergeObjectSync(r,d)}get shape(){return this._def.shape()}strict(e){return j.errToObj,new D({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(s,r)=>{const a=this._def.errorMap?.(s,r).message??r.defaultError;return s.code==="unrecognized_keys"?{message:j.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new D({...this._def,unknownKeys:"strip"})}passthrough(){return new D({...this._def,unknownKeys:"passthrough"})}extend(e){return new D({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new D({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:E.ZodObject})}setKey(e,s){return this.augment({[e]:s})}catchall(e){return new D({...this._def,catchall:e})}pick(e){const s={};for(const r of A.objectKeys(e))e[r]&&this.shape[r]&&(s[r]=this.shape[r]);return new D({...this._def,shape:()=>s})}omit(e){const s={};for(const r of A.objectKeys(this.shape))e[r]||(s[r]=this.shape[r]);return new D({...this._def,shape:()=>s})}deepPartial(){return xe(this)}partial(e){const s={};for(const r of A.objectKeys(this.shape)){const a=this.shape[r];e&&!e[r]?s[r]=a:s[r]=a.optional()}return new D({...this._def,shape:()=>s})}required(e){const s={};for(const r of A.objectKeys(this.shape))if(e&&!e[r])s[r]=this.shape[r];else{let n=this.shape[r];for(;n instanceof de;)n=n._def.innerType;s[r]=n}return new D({...this._def,shape:()=>s})}keyof(){return us(A.objectKeys(this.shape))}}D.create=(t,e)=>new D({shape:()=>t,unknownKeys:"strip",catchall:ue.create(),typeName:E.ZodObject,...O(e)});D.strictCreate=(t,e)=>new D({shape:()=>t,unknownKeys:"strict",catchall:ue.create(),typeName:E.ZodObject,...O(e)});D.lazycreate=(t,e)=>new D({shape:t,unknownKeys:"strip",catchall:ue.create(),typeName:E.ZodObject,...O(e)});class Me extends R{_parse(e){const{ctx:s}=this._processInputParams(e),r=this._def.options;function a(n){for(const l of n)if(l.result.status==="valid")return l.result;for(const l of n)if(l.result.status==="dirty")return s.common.issues.push(...l.ctx.common.issues),l.result;const i=n.map(l=>new oe(l.ctx.common.issues));return x(s,{code:m.invalid_union,unionErrors:i}),S}if(s.common.async)return Promise.all(r.map(async n=>{const i={...s,common:{...s.common,issues:[]},parent:null};return{result:await n._parseAsync({data:s.data,path:s.path,parent:i}),ctx:i}})).then(a);{let n;const i=[];for(const d of r){const c={...s,common:{...s.common,issues:[]},parent:null},u=d._parseSync({data:s.data,path:s.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!n&&(n={result:u,ctx:c}),c.common.issues.length&&i.push(c.common.issues)}if(n)return s.common.issues.push(...n.ctx.common.issues),n.result;const l=i.map(d=>new oe(d));return x(s,{code:m.invalid_union,unionErrors:l}),S}}get options(){return this._def.options}}Me.create=(t,e)=>new Me({options:t,typeName:E.ZodUnion,...O(e)});function rt(t,e){const s=ie(t),r=ie(e);if(t===e)return{valid:!0,data:t};if(s===k.object&&r===k.object){const a=A.objectKeys(e),n=A.objectKeys(t).filter(l=>a.indexOf(l)!==-1),i={...t,...e};for(const l of n){const d=rt(t[l],e[l]);if(!d.valid)return{valid:!1};i[l]=d.data}return{valid:!0,data:i}}else if(s===k.array&&r===k.array){if(t.length!==e.length)return{valid:!1};const a=[];for(let n=0;n<t.length;n++){const i=t[n],l=e[n],d=rt(i,l);if(!d.valid)return{valid:!1};a.push(d.data)}return{valid:!0,data:a}}else return s===k.date&&r===k.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class ze extends R{_parse(e){const{status:s,ctx:r}=this._processInputParams(e),a=(n,i)=>{if(wt(n)||wt(i))return S;const l=rt(n.value,i.value);return l.valid?((jt(n)||jt(i))&&s.dirty(),{status:s.value,value:l.data}):(x(r,{code:m.invalid_intersection_types}),S)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([n,i])=>a(n,i)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}ze.create=(t,e,s)=>new ze({left:t,right:e,typeName:E.ZodIntersection,...O(s)});class pe extends R{_parse(e){const{status:s,ctx:r}=this._processInputParams(e);if(r.parsedType!==k.array)return x(r,{code:m.invalid_type,expected:k.array,received:r.parsedType}),S;if(r.data.length<this._def.items.length)return x(r,{code:m.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),S;!this._def.rest&&r.data.length>this._def.items.length&&(x(r,{code:m.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),s.dirty());const n=[...r.data].map((i,l)=>{const d=this._def.items[l]||this._def.rest;return d?d._parse(new ce(r,i,r.path,l)):null}).filter(i=>!!i);return r.common.async?Promise.all(n).then(i=>J.mergeArray(s,i)):J.mergeArray(s,n)}get items(){return this._def.items}rest(e){return new pe({...this._def,rest:e})}}pe.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new pe({items:t,typeName:E.ZodTuple,rest:null,...O(e)})};class Lt extends R{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:s,ctx:r}=this._processInputParams(e);if(r.parsedType!==k.map)return x(r,{code:m.invalid_type,expected:k.map,received:r.parsedType}),S;const a=this._def.keyType,n=this._def.valueType,i=[...r.data.entries()].map(([l,d],c)=>({key:a._parse(new ce(r,l,r.path,[c,"key"])),value:n._parse(new ce(r,d,r.path,[c,"value"]))}));if(r.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const d of i){const c=await d.key,u=await d.value;if(c.status==="aborted"||u.status==="aborted")return S;(c.status==="dirty"||u.status==="dirty")&&s.dirty(),l.set(c.value,u.value)}return{status:s.value,value:l}})}else{const l=new Map;for(const d of i){const c=d.key,u=d.value;if(c.status==="aborted"||u.status==="aborted")return S;(c.status==="dirty"||u.status==="dirty")&&s.dirty(),l.set(c.value,u.value)}return{status:s.value,value:l}}}}Lt.create=(t,e,s)=>new Lt({valueType:e,keyType:t,typeName:E.ZodMap,...O(s)});class Ie extends R{_parse(e){const{status:s,ctx:r}=this._processInputParams(e);if(r.parsedType!==k.set)return x(r,{code:m.invalid_type,expected:k.set,received:r.parsedType}),S;const a=this._def;a.minSize!==null&&r.data.size<a.minSize.value&&(x(r,{code:m.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),s.dirty()),a.maxSize!==null&&r.data.size>a.maxSize.value&&(x(r,{code:m.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),s.dirty());const n=this._def.valueType;function i(d){const c=new Set;for(const u of d){if(u.status==="aborted")return S;u.status==="dirty"&&s.dirty(),c.add(u.value)}return{status:s.value,value:c}}const l=[...r.data.values()].map((d,c)=>n._parse(new ce(r,d,r.path,c)));return r.common.async?Promise.all(l).then(d=>i(d)):i(l)}min(e,s){return new Ie({...this._def,minSize:{value:e,message:j.toString(s)}})}max(e,s){return new Ie({...this._def,maxSize:{value:e,message:j.toString(s)}})}size(e,s){return this.min(e,s).max(e,s)}nonempty(e){return this.min(1,e)}}Ie.create=(t,e)=>new Ie({valueType:t,minSize:null,maxSize:null,typeName:E.ZodSet,...O(e)});class Rt extends R{get schema(){return this._def.getter()}_parse(e){const{ctx:s}=this._processInputParams(e);return this._def.getter()._parse({data:s.data,path:s.path,parent:s})}}Rt.create=(t,e)=>new Rt({getter:t,typeName:E.ZodLazy,...O(e)});class At extends R{_parse(e){if(e.data!==this._def.value){const s=this._getOrReturnCtx(e);return x(s,{received:s.data,code:m.invalid_literal,expected:this._def.value}),S}return{status:"valid",value:e.data}}get value(){return this._def.value}}At.create=(t,e)=>new At({value:t,typeName:E.ZodLiteral,...O(e)});function us(t,e){return new ke({values:t,typeName:E.ZodEnum,...O(e)})}class ke extends R{_parse(e){if(typeof e.data!="string"){const s=this._getOrReturnCtx(e),r=this._def.values;return x(s,{expected:A.joinValues(r),received:s.parsedType,code:m.invalid_type}),S}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const s=this._getOrReturnCtx(e),r=this._def.values;return x(s,{received:s.data,code:m.invalid_enum_value,options:r}),S}return ee(e.data)}get options(){return this._def.values}get enum(){const e={};for(const s of this._def.values)e[s]=s;return e}get Values(){const e={};for(const s of this._def.values)e[s]=s;return e}get Enum(){const e={};for(const s of this._def.values)e[s]=s;return e}extract(e,s=this._def){return ke.create(e,{...this._def,...s})}exclude(e,s=this._def){return ke.create(this.options.filter(r=>!e.includes(r)),{...this._def,...s})}}ke.create=us;class Mt extends R{_parse(e){const s=A.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==k.string&&r.parsedType!==k.number){const a=A.objectValues(s);return x(r,{expected:A.joinValues(a),received:r.parsedType,code:m.invalid_type}),S}if(this._cache||(this._cache=new Set(A.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const a=A.objectValues(s);return x(r,{received:r.data,code:m.invalid_enum_value,options:a}),S}return ee(e.data)}get enum(){return this._def.values}}Mt.create=(t,e)=>new Mt({values:t,typeName:E.ZodNativeEnum,...O(e)});class Pe extends R{unwrap(){return this._def.type}_parse(e){const{ctx:s}=this._processInputParams(e);if(s.parsedType!==k.promise&&s.common.async===!1)return x(s,{code:m.invalid_type,expected:k.promise,received:s.parsedType}),S;const r=s.parsedType===k.promise?s.data:Promise.resolve(s.data);return ee(r.then(a=>this._def.type.parseAsync(a,{path:s.path,errorMap:s.common.contextualErrorMap})))}}Pe.create=(t,e)=>new Pe({type:t,typeName:E.ZodPromise,...O(e)});class we extends R{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===E.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:s,ctx:r}=this._processInputParams(e),a=this._def.effect||null,n={addIssue:i=>{x(r,i),i.fatal?s.abort():s.dirty()},get path(){return r.path}};if(n.addIssue=n.addIssue.bind(n),a.type==="preprocess"){const i=a.transform(r.data,n);if(r.common.async)return Promise.resolve(i).then(async l=>{if(s.value==="aborted")return S;const d=await this._def.schema._parseAsync({data:l,path:r.path,parent:r});return d.status==="aborted"?S:d.status==="dirty"||s.value==="dirty"?Ne(d.value):d});{if(s.value==="aborted")return S;const l=this._def.schema._parseSync({data:i,path:r.path,parent:r});return l.status==="aborted"?S:l.status==="dirty"||s.value==="dirty"?Ne(l.value):l}}if(a.type==="refinement"){const i=l=>{const d=a.refinement(l,n);if(r.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return l.status==="aborted"?S:(l.status==="dirty"&&s.dirty(),i(l.value),{status:s.value,value:l.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>l.status==="aborted"?S:(l.status==="dirty"&&s.dirty(),i(l.value).then(()=>({status:s.value,value:l.value}))))}if(a.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!_e(i))return S;const l=a.transform(i.value,n);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:s.value,value:l}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>_e(i)?Promise.resolve(a.transform(i.value,n)).then(l=>({status:s.value,value:l})):S);A.assertNever(a)}}we.create=(t,e,s)=>new we({schema:t,typeName:E.ZodEffects,effect:e,...O(s)});we.createWithPreprocess=(t,e,s)=>new we({schema:e,effect:{type:"preprocess",transform:t},typeName:E.ZodEffects,...O(s)});class de extends R{_parse(e){return this._getType(e)===k.undefined?ee(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}de.create=(t,e)=>new de({innerType:t,typeName:E.ZodOptional,...O(e)});class je extends R{_parse(e){return this._getType(e)===k.null?ee(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}je.create=(t,e)=>new je({innerType:t,typeName:E.ZodNullable,...O(e)});class at extends R{_parse(e){const{ctx:s}=this._processInputParams(e);let r=s.data;return s.parsedType===k.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:s.path,parent:s})}removeDefault(){return this._def.innerType}}at.create=(t,e)=>new at({innerType:t,typeName:E.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...O(e)});class nt extends R{_parse(e){const{ctx:s}=this._processInputParams(e),r={...s,common:{...s.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Re(a)?a.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new oe(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new oe(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}nt.create=(t,e)=>new nt({innerType:t,typeName:E.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...O(e)});class zt extends R{_parse(e){if(this._getType(e)!==k.nan){const r=this._getOrReturnCtx(e);return x(r,{code:m.invalid_type,expected:k.nan,received:r.parsedType}),S}return{status:"valid",value:e.data}}}zt.create=t=>new zt({typeName:E.ZodNaN,...O(t)});class xn extends R{_parse(e){const{ctx:s}=this._processInputParams(e),r=s.data;return this._def.type._parse({data:r,path:s.path,parent:s})}unwrap(){return this._def.type}}class ut extends R{_parse(e){const{status:s,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const n=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return n.status==="aborted"?S:n.status==="dirty"?(s.dirty(),Ne(n.value)):this._def.out._parseAsync({data:n.value,path:r.path,parent:r})})();{const a=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?S:a.status==="dirty"?(s.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:r.path,parent:r})}}static create(e,s){return new ut({in:e,out:s,typeName:E.ZodPipeline})}}class ot extends R{_parse(e){const s=this._def.innerType._parse(e),r=a=>(_e(a)&&(a.value=Object.freeze(a.value)),a);return Re(s)?s.then(a=>r(a)):r(s)}unwrap(){return this._def.innerType}}ot.create=(t,e)=>new ot({innerType:t,typeName:E.ZodReadonly,...O(e)});var E;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(E||(E={}));const Pt=le.create;ue.create;re.create;const vn=D.create;Me.create;ze.create;pe.create;ke.create;Pe.create;de.create;je.create;const _n=vn({email:Pt().min(1,"Email is required").email("Enter a valid email"),password:Pt().min(1,"Password is required").min(6,"Password must be at least 6 characters")}),kn=({logo:t,slogan:e,loginUrl:s,pageTitle:r})=>{const{error:a,loginAction:n}=Le(),[i,l]=f.useState(""),[d,c]=f.useState(""),[u,y]=f.useState({}),[w,N]=f.useState(!1),T=_=>{l(_),u.email&&y(h=>({...h,form:void 0,email:void 0}))},v=_=>{c(_),u.password&&y(h=>({...h,form:void 0,password:void 0}))},p=async _=>{_.preventDefault(),y({});const h=_n.safeParse({email:i,password:d});if(!h.success){const{fieldErrors:g}=h.error.flatten();y({email:g.email?.[0],password:g.password?.[0]});return}N(!0);const b=await n({email:i,password:d,loginType:"M"},s);N(!1),b||y({form:"Invalid email or password. Please try again."})};return o.jsxs("div",{className:"relative flex items-center justify-center min-h-screen bg-gary-100 dark:bg-slate-900",children:[o.jsx("div",{className:"absolute top-4 right-4 z-10",children:o.jsx(lt,{})}),o.jsxs("div",{className:"w-full max-w-md p-8 m-4 bg-gary-100 dark:bg-slate-800 rounded-lg shadow-2xl transform transition-all duration-500 scale-100 hover:shadow-violet-700",children:[o.jsx("div",{className:"flex justify-center mb-6",children:t}),o.jsx("h2",{className:"text-3xl font-extrabold text-center text-slate-700 dark:text-slate-100 mb-2",children:r}),o.jsx("p",{className:"text-center text-sm text-slate-500 dark:text-slate-400 mb-8",children:e}),a&&o.jsx(Bt,{variant:"danger",className:"w-full mb-4 justify-center",children:a}),o.jsxs("form",{className:"space-y-3",onSubmit:p,children:[o.jsx(Ye,{id:"email",value:i,placeholder:"Email",error:u.email,onChange:T}),o.jsx(Ye,{id:"password",type:"password",value:d,placeholder:"Password",error:u.password,onChange:v}),o.jsx("div",{children:o.jsx(K,{size:"large",type:"submit",disabled:w,className:"w-full mt-2",children:w?o.jsxs(o.Fragment,{children:[o.jsx(Ze,{variant:"default"})," ","Logging..."]}):"Sign In"})})]})]})]})};exports.AUTH=ls;exports.ActivityFeed=Cr;exports.ActivityItem=Yt;exports.AdminLayout=Oa;exports.Badge=Bt;exports.BorderRadius=X;exports.Button=K;exports.ButtonState=bs;exports.Card=Be;exports.CardBody=De;exports.CardFooter=yr;exports.CardHeader=Xt;exports.Checkbox=zr;exports.GlobalContainer=Ma;exports.GlobalLoader=Gt;exports.InfoCard=br;exports.InlineLoader=Ze;exports.Input=Ye;exports.LoginPage=kn;exports.Modal=hr;exports.ModalBody=Ge;exports.ModalFooter=Ht;exports.ModalHeader=Xe;exports.MultiSelect=Wr;exports.PageContainer=La;exports.Pagination=Er;exports.Position=U;exports.ProgressStat=Sr;exports.RadioGroup=Fr;exports.Row=_s;exports.Select=it;exports.SideNavbar=qa;exports.Size=Q;exports.StatCard=xr;exports.Switch=Br;exports.Table=_r;exports.TableBody=wr;exports.TableData=Tr;exports.TableHead=Nr;exports.TableHeader=kr;exports.TableRow=jr;exports.Textarea=Rr;exports.ThemeProvider=ur;exports.ThemeToggle=lt;exports.Tooltip=ve;exports.TopNavbar=Ua;exports.Variant=V;exports.capitalizeWords=is;exports.errorToast=za;exports.infoToast=Pa;exports.loaderService=ns;exports.manageTextLength=ct;exports.successToast=os;exports.useAuthStore=Le;exports.useMenuStore=He;exports.useTheme=Ut;exports.warningToast=Za;
23
18
  //# sourceMappingURL=index.cjs.map