rr-react-ui-library 0.0.6 → 0.0.7
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/components/ui/cards/Card/index.d.ts.map +1 -1
- package/dist/hooks/stores/authStore.d.ts.map +1 -1
- package/dist/index.cjs +10 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +1123 -1100
- package/dist/index.mjs.map +1 -1
- package/dist/utils/axiosInstance.d.ts.map +1 -1
- package/dist/utils/config.d.ts +7 -0
- package/dist/utils/config.d.ts.map +1 -0
- package/dist/utils/constants.d.ts +0 -1
- package/dist/utils/constants.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),y=require("react"),Wr=require("react-dom"),We=require("react-router"),le={ExtraSmall:"xs",Small:"small",Medium:"medium",Large:"large"},re={None:"none",Small:"sm",Medium:"md",Large:"lg",Full:"full"},qs={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"},Hs={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"},Ws={sm:"text-xs px-2 py-0.5",md:"text-sm px-2.5 py-1",lg:"text-base px-3 py-1.5"},Jr=({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",Hs[a],Ws[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]})},Js=({children:t,cols:e=1})=>{const r=`grid-cols-${e}`;return l.jsx("div",{className:`grid ${r} gap-3 mb-3`,children:t})},Xs={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"},Ks={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"},gt=({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",Xs[e],Ks[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%)"}},G={[J.Top]:{bottom:"-5px"},[J.Bottom]:{top:"-5px"},[J.Left]:{right:"-5px"},[J.Right]:{left:"-5px"}},ne={...W[T],...G[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(gt,{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 Gs=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ys=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,r,s)=>s?s.toUpperCase():r.toLowerCase()),lr=t=>{const e=Ys(t);return e.charAt(0).toUpperCase()+e.slice(1)},Xr=(...t)=>t.filter((e,r,s)=>!!e&&e.trim()!==""&&s.indexOf(e)===r).join(" ").trim(),Qs=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};var ea={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 ta=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,...ea,width:e,height:e,stroke:t,strokeWidth:s?Number(r)*24/Number(e):r,className:Xr("lucide",a),...!n&&!Qs(i)&&{"aria-hidden":"true"},...i},[...o.map(([c,d])=>y.createElement(c,d)),...Array.isArray(n)?n:[n]]));const K=(t,e)=>{const r=y.forwardRef(({className:s,...a},n)=>y.createElement(ta,{ref:n,iconNode:e,className:Xr(`lucide-${Gs(lr(t))}`,`lucide-${t}`,s),...a}));return r.displayName=lr(t),r};const ra=[["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"}]],sa=K("activity",ra);const aa=[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]],na=K("arrow-down-right",aa);const oa=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],ia=K("arrow-up-right",oa);const la=[["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"}]],ca=K("bell",la);const da=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],ua=K("chevron-left",da);const fa=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Kr=K("chevron-right",fa);const ma=[["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"}]],ha=K("history",ma);const pa=[["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"}]],ga=K("lock",pa);const ya=[["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"}]],ba=K("log-out",ya);const xa=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],va=K("menu",xa);const _a=[["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"}]],ka=K("monitor",_a);const wa=[["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"}]],Ta=K("moon",wa);const Na=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],ja=K("search",Na);const Sa=[["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"}]],Ca=K("settings",Sa);const Ea=[["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"}]],Ra=K("sparkles",Ea);const Oa=[["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"}]],Aa=K("sun",Oa);const La=[["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"}]],Ia=K("user",La);const $a=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],cr=K("x",$a),Pa={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"},Ma={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"},Gt=({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=Ma[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 ${Pa[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]})]})},Gr=y.createContext(void 0),Ba=({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(Gr.Provider,{value:{theme:e,setTheme:i,resolvedTheme:s},children:t})},Yr=()=>{const t=y.useContext(Gr);if(!t)throw new Error("useTheme must be used within ThemeProvider");return t},Yt=({forceDarkTheme:t=!1})=>{const{theme:e,setTheme:r}=Yr(),s=[{value:"light",label:"Light",icon:l.jsx(Aa,{size:16})},{value:"dark",label:"Dark",icon:l.jsx(Ta,{size:16})},{value:"system",label:"System",icon:l.jsx(ka,{size:16})}];return l.jsx(Gt,{value:e,options:s,onChange:a=>r(a),forceDarkTheme:t})},za={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"}},Ie=({text:t,children:e,position:r="top",color:s="default"})=>{const a=za[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"&&Wr.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)]})},dr={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"},Da={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"},Lt=({children:t,className:e="",variant:r=X.Default})=>{const s="px-6 py-4 rounded-t-xl",a=Da[r];return l.jsx("div",{className:`${s} ${a} ${e}`,children:t})},It=({children:t,className:e=""})=>l.jsx("div",{className:`px-6 py-4 ${e}`,children:t}),Qr=({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}),Fa=({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===Lt?m=w:w.type===It?h=w:w.type===Qr?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=dr[u]||dr.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(Lt,{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(cr,{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(cr,{className:"w-5 h-5"})})}):null,l.jsx("div",{className:"flex-1 overflow-y-auto",children:typeof h=="string"?l.jsx(It,{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"},Ua={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"},Za={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}`},es={[re.Full]:"rounded-3xl",[re.Large]:"rounded-lg",[re.Small]:"rounded-sm",[re.None]:"rounded-none",[re.Medium]:"rounded-md"},ts=y.createContext(void 0),yt=({children:t,className:e="",variant:r=X.Default,shouldTitleBgColor:s=!0,rounded:a=re.Medium})=>(s||(a=re.Small),l.jsx(ts.Provider,{value:{rounded:a,variant:r,shouldTitleBgColor:s},children:l.jsx("div",{className:[e,es[a],`${!s&&Za[r]}`,"bg-slate-50 shadow-lg backdrop-blur-lg transition duration-200 border-2 border-slate-100 dark:border-none dark:bg-slate-800"].join(" "),children:t})})),rs=({children:t,className:e=""})=>{const r=y.useContext(ts),s=r?.shouldTitleBgColor??!1,a=es[r?.rounded??re.Medium],n=Ua[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})},Va=({children:t,className:e=""})=>l.jsx("div",{className:["px-4 py-2 border-t border-slate-300",e].join(" "),children:t}),bt=({children:t,className:e=""})=>l.jsx("div",{className:[e,"px-4 py-2 text-slate-800 dark:text-slate-200"].join(" "),children:t}),qa=({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(yt,{className:`card-hover ${a}`,children:l.jsx(bt,{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}`})})]})})})},Ha=({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(yt,{className:"card-hover",children:l.jsxs(bt,{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(ia,{className:"w-4 h-4"}):l.jsx(na,{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})]})})},Wa={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"},Qt=y.createContext(void 0),Ja=({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",Wa[r],e].filter(Boolean).join(" "),children:l.jsx("table",{className:"w-full border-collapse",children:t})}),Xa=({children:t,className:e=""})=>l.jsx(Qt.Provider,{value:"head",children:l.jsx("thead",{className:`bg-gray-200 dark:bg-gray-800 ${e}`,children:t})}),Ka=({children:t,className:e=""})=>l.jsx(Qt.Provider,{value:"body",children:l.jsx("tbody",{className:e,children:t})}),Ga=({children:t,hover:e=!0,className:r=""})=>{const s=y.useContext(Qt),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})},Ya=({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})},Qa=({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})},ss=({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(gt,{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:Wr.createPortal(o,document.body)},as=({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})]})},en=({title:t="Recent Activity",icon:e=sa,activities:r,className:s=""})=>l.jsxs(yt,{className:s,children:[l.jsx(rs,{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(bt,{children:l.jsx("div",{className:"divide-y divide-slate-200 dark:divide-slate-600",children:r.map((a,n)=>l.jsx(as,{icon:a.icon,action:a.action,target:a.target,time:a.time,type:a.type},n))})})]}),tn=({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))}%`}})})]})},rn=({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(ua,{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(Kr,{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(Gt,{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()})})]})]})]})},sn={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"},$t=({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],sn[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,"!"]})]})},an={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"},nn={none:"resize-none",both:"resize",vertical:"resize-y",horizontal:"resize-x"},on={sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",none:"rounded-none",full:"rounded-full"},ln=({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",on[k],nn[T],an[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]}),cn={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"},dn={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"},un=({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=cn[c],p=dn[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]})]})})},fn={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"},mn={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"},hn=({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?fn[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,mn[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]})]})},pn={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"},gn={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"},yn=({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=pn[c],h=gn[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))})})]})},bn={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"},xn={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"},vn={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"},_n=({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 G=L=>{a(Array.from(new Set(L)))},ne=()=>{G(V?[]:$)},ge=L=>{const F=L.map(oe=>String(oe.value)),me=F.every(oe=>j.includes(oe));G(me?j.filter(oe=>!F.includes(oe)):[...j,...F])},H=L=>{const F=j.includes(L);G(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]),Ue=y.useMemo(()=>{const L=b.toLowerCase();return E.filter(F=>String(F.label).toLowerCase().includes(L))},[E,b]),nt=y.useMemo(()=>{if(!n)return;const L=b.toLowerCase(),F={};return Object.entries(n).forEach(([me,oe])=>{const ir=oe.filter(Vs=>String(Vs.label).toLowerCase().includes(L));ir.length>0&&(F[me]=ir)}),Object.keys(F).length>0?F:void 0},[n,b]),fe=y.useMemo(()=>typeof i=="number"?{maxHeight:`${i}px`}:{maxHeight:i},[i]),xe=xn[p],Ze=vn[p],Oe=v?"border border-slate-300 dark:border-slate-500 shadow-sm":"border border-slate-200 dark:border-slate-600 shadow-sm",Ve=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 ${bn[d]} ${xe} ${Oe}`,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 ${Ze}`,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,nt?Object.entries(nt).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=>Ve(oe))})]},L)}):Ue.length>0?Ue.map(L=>Ve(L)):l.jsx("li",{className:"px-3 py-4 text-sm text-slate-500 dark:text-slate-400",children:g})]})]}):null]})]})};function ns(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=ns(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=ns(t))&&(s&&(s+=" "),s+=e);return s}function kn(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))}kn(`: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 Ye=t=>typeof t=="number"&&!isNaN(t),Ce=t=>typeof t=="string",ye=t=>typeof t=="function",wn=t=>Ce(t)||Ye(t),Pt=t=>Ce(t)||ye(t)?t:null,Tn=(t,e)=>t===!1||Ye(t)&&t>0?t:e,Mt=t=>y.isValidElement(t)||Ce(t)||ye(t)||Ye(t);function Nn(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 jn({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?Nn(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 ur(t,e){return{content:os(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 os(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 Sn({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 Cn({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 En=1,is=()=>`${En++}`;function Rn(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(ur(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,G])=>G!=null)),toastId:w,updateId:A,data:D,isIn:!1,className:Pt(b.className||i.toastClassName),progressClassName:Pt(b.progressClassName||i.progressClassName),autoClose:b.isLoading?!1:Tn(b.autoClose,i.autoClose),closeToast(W){u.get(w).removalReason=W,h(w)},deleteToast(){let W=u.get(w);if(W!=null){if(r(ur(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||Mt(b.closeButton)?V.closeButton=b.closeButton:b.closeButton===!0&&(V.closeButton=Mt(i.closeButton)?i.closeButton:!0);let q={content:x,props:V,staleId:j};i.limit&&i.limit>0&&a>i.limit&&$?n.push(q):Ye(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,Je=[],Bt=new Set,On=t=>Bt.forEach(e=>e(t)),ls=()=>ee.size>0;function An(){Je.forEach(t=>ds(t.content,t.options)),Je=[]}var Ln=(t,{containerId:e})=>{var r;return(r=ee.get(e||1))==null?void 0:r.toasts.get(t)};function cs(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 In(t){if(!ls()){Je=Je.filter(e=>t!=null&&e.options.toastId!==t);return}if(t==null||wn(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 $n=(t={})=>{ee.forEach(e=>{e.props.limit&&(!t.containerId||e.id===t.containerId)&&e.clearQueue()})};function ds(t,e){Mt(t)&&(ls()||Je.push({content:t,options:e}),ee.forEach(r=>{r.buildToast(t,e)}))}function Pn(t){var e;(e=ee.get(t.containerId||1))==null||e.setToggle(t.id,t.fn)}function us(t,e){ee.forEach(r=>{(e==null||!(e!=null&&e.containerId)||e?.containerId===r.id)&&r.toggle(t,e?.id)})}function Mn(t){let e=t.containerId||1;return{subscribe(r){let s=Rn(e,t,On);ee.set(e,s);let a=s.observe(r);return An(),()=>{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 Bn(t){return Bt.add(t),()=>{Bt.delete(t)}}function zn(t){return t&&(Ce(t.toastId)||Ye(t.toastId))?t.toastId:is()}function Qe(t,e){return ds(t,e),e.toastId}function xt(t,e){return{...e,type:e&&e.type||t,toastId:zn(e)}}function vt(t){return(e,r)=>Qe(e,xt(t,r))}function z(t,e){return Qe(t,xt("default",e))}z.loading=(t,e)=>Qe(t,xt("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...e}));function Dn(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=Dn;z.success=vt("success");z.info=vt("info");z.error=vt("error");z.warning=vt("warning");z.warn=z.warning;z.dark=(t,e)=>Qe(t,xt("default",{theme:"dark",...e}));function Fn(t){In(t)}z.dismiss=Fn;z.clearWaitingQueue=$n;z.isActive=cs;z.update=(t,e={})=>{let r=Ln(t,e);if(r){let{props:s,content:a}=r,n={delay:100,...s,...e,toastId:e.toastId||t,updateId:is()};n.toastId!==t&&(n.staleId=t);let o=n.render||a;delete n.render,Qe(o,n)}};z.done=t=>{z.update(t,{progress:1})};z.onChange=Bn;z.play=t=>us(!0,t);z.pause=t=>us(!1,t);function Un(t){var e;let{subscribe:r,getSnapshot:s,setProps:a}=y.useRef(Mn(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:cs,count:n?.length}}function Zn(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;Pn({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 Vn=typeof window<"u"?y.useLayoutEffect:y.useEffect,_t=({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 qn(t){return y.createElement(_t,{...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 Hn(t){return y.createElement(_t,{...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 Wn(t){return y.createElement(_t,{...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 Jn(t){return y.createElement(_t,{...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 Xn(){return y.createElement("div",{className:"Toastify__spinner"})}var zt={info:Hn,warning:qn,success:Wn,error:Jn,spinner:Xn},Kn=t=>t in zt;function Gn({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=zt.spinner():Kn(e)&&(a=zt[e](n))),a}var Yn=t=>{let{isRunning:e,preventExitTransition:r,toastRef:s,eventHandlers:a,playToast:n}=Zn(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,G=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:G}):je(G,h),ge=Gn(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=Sn(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),os(i,t,!e),Q,!t.customProgressBar&&y.createElement(Cn,{...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})))},Qn=(t,e=!1)=>({enter:`Toastify--animate Toastify__${t}-enter`,exit:`Toastify--animate Toastify__${t}-exit`,appendPosition:e}),eo=jn(Qn("bounce",!0)),to={position:"top-right",transition:eo,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 ro(t){let e={...to,...t},r=t.stacked,[s,a]=y.useState(!0),n=y.useRef(null),{getToastToRender:o,isToastActive:i,count:u}=Un(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,Pt(c))}function h(){r&&(a(!0),z.play())}return Vn(()=>{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(Yn,{...w,stacked:r,collapseAll:h,isIn:i(w.toastId,w.containerId),key:`t-${w.key}`},b)))}))}const fr=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},so=(t=>t?fr(t):fr),ao=t=>t;function no(t,e=ao){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 mr=t=>{const e=so(t),r=s=>no(e,s);return Object.assign(r,e),r},fs=(t=>t?mr(t):mr),kt=fs(t=>({menus:[],currentMenu:null,setMenus:e=>t({menus:e}),setCurrentMenu:e=>t({currentMenu:e})})),oo=({menus:t,topNav:e,sideNav:r,children:s})=>{const{setMenus:a}=kt();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(ro,{draggable:!0,rtl:!1,newestOnTop:!0,closeOnClick:!0,pauseOnHover:!0,autoClose:5e3,position:"top-right",hideProgressBar:!1})]})},io=({children:t})=>{const e=We.useLocation(),{menus:r}=kt();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 lo{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 ms=new lo,co=()=>{const[t,e]=y.useState(!0);return y.useEffect(()=>{const r=ms.subscribe(e);return()=>{r()}},[]),l.jsx(ss,{open:t,message:"Loading..."})},uo=({children:t})=>l.jsxs(l.Fragment,{children:[l.jsx(co,{}),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})})]}),wt={autoClose:5e3,draggable:!1,closeOnClick:!0,pauseOnHover:!0,position:"top-right",hideProgressBar:!1},hs=t=>{z.success(t,wt)},fo=t=>{z.error(t,wt)},mo=t=>{z.info(t,wt)},ho=t=>{z.warn(t,wt)},er=(t,e=0)=>t?e?t.split(" ").map(r=>r[0].toUpperCase()).join("").slice(0,e):ps(t):"";function ps(t){return t.split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function po(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 Dt=t=>e=>{try{const r=t(e);return r instanceof Promise?r:{then(s){return Dt(s)(r)},catch(s){return this}}}catch(r){return{then(s){return this},catch(s){return Dt(s)(r)}}}},go=(t,e)=>(r,s,a)=>{let n={storage:po(()=>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 Dt(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},yo=go;function gs(t,e){return function(){return t.apply(e,arguments)}}const{toString:bo}=Object.prototype,{getPrototypeOf:tr}=Object,{iterator:Tt,toStringTag:ys}=Symbol,Nt=(t=>e=>{const r=bo.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),ue=t=>(t=t.toLowerCase(),e=>Nt(e)===t),jt=t=>e=>typeof e===t,{isArray:De}=Array,$e=jt("undefined");function et(t){return t!==null&&!$e(t)&&t.constructor!==null&&!$e(t.constructor)&&se(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const bs=ue("ArrayBuffer");function xo(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&bs(t.buffer),e}const vo=jt("string"),se=jt("function"),xs=jt("number"),tt=t=>t!==null&&typeof t=="object",_o=t=>t===!0||t===!1,it=t=>{if(Nt(t)!=="object")return!1;const e=tr(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(ys in t)&&!(Tt in t)},ko=t=>{if(!tt(t)||et(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},wo=ue("Date"),To=ue("File"),No=ue("Blob"),jo=ue("FileList"),So=t=>tt(t)&&se(t.pipe),Co=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||se(t.append)&&((e=Nt(t))==="formdata"||e==="object"&&se(t.toString)&&t.toString()==="[object FormData]"))},Eo=ue("URLSearchParams"),[Ro,Oo,Ao,Lo]=["ReadableStream","Request","Response","Headers"].map(ue),Io=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function rt(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let s,a;if(typeof t!="object"&&(t=[t]),De(t))for(s=0,a=t.length;s<a;s++)e.call(null,t[s],s,t);else{if(et(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 vs(t,e){if(et(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,_s=t=>!$e(t)&&t!==Ne;function Ft(){const{caseless:t,skipUndefined:e}=_s(this)&&this||{},r={},s=(a,n)=>{const o=t&&vs(r,n)||n;it(r[o])&&it(a)?r[o]=Ft(r[o],a):it(a)?r[o]=Ft({},a):De(a)?r[o]=a.slice():(!e||!$e(a))&&(r[o]=a)};for(let a=0,n=arguments.length;a<n;a++)arguments[a]&&rt(arguments[a],s);return r}const $o=(t,e,r,{allOwnKeys:s}={})=>(rt(e,(a,n)=>{r&&se(a)?t[n]=gs(a,r):t[n]=a},{allOwnKeys:s}),t),Po=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Mo=(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)},Bo=(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&&tr(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},zo=(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},Do=t=>{if(!t)return null;if(De(t))return t;let e=t.length;if(!xs(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},Fo=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&tr(Uint8Array)),Uo=(t,e)=>{const s=(t&&t[Tt]).call(t);let a;for(;(a=s.next())&&!a.done;){const n=a.value;e.call(t,n[0],n[1])}},Zo=(t,e)=>{let r;const s=[];for(;(r=t.exec(e))!==null;)s.push(r);return s},Vo=ue("HTMLFormElement"),qo=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,s,a){return s.toUpperCase()+a}),hr=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),Ho=ue("RegExp"),ks=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),s={};rt(r,(a,n)=>{let o;(o=e(a,n,t))!==!1&&(s[n]=o||a)}),Object.defineProperties(t,s)},Wo=t=>{ks(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+"'")})}})},Jo=(t,e)=>{const r={},s=a=>{a.forEach(n=>{r[n]=!0})};return De(t)?s(t):s(String(t).split(e)),r},Xo=()=>{},Ko=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function Go(t){return!!(t&&se(t.append)&&t[ys]==="FormData"&&t[Tt])}const Yo=t=>{const e=new Array(10),r=(s,a)=>{if(tt(s)){if(e.indexOf(s)>=0)return;if(et(s))return s;if(!("toJSON"in s)){e[a]=s;const n=De(s)?[]:{};return rt(s,(o,i)=>{const u=r(o,a+1);!$e(u)&&(n[i]=u)}),e[a]=void 0,n}}return s};return r(t,0)},Qo=ue("AsyncFunction"),ei=t=>t&&(tt(t)||se(t))&&se(t.then)&&se(t.catch),ws=((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)),ti=typeof queueMicrotask<"u"?queueMicrotask.bind(Ne):typeof process<"u"&&process.nextTick||ws,ri=t=>t!=null&&se(t[Tt]),f={isArray:De,isArrayBuffer:bs,isBuffer:et,isFormData:Co,isArrayBufferView:xo,isString:vo,isNumber:xs,isBoolean:_o,isObject:tt,isPlainObject:it,isEmptyObject:ko,isReadableStream:Ro,isRequest:Oo,isResponse:Ao,isHeaders:Lo,isUndefined:$e,isDate:wo,isFile:To,isBlob:No,isRegExp:Ho,isFunction:se,isStream:So,isURLSearchParams:Eo,isTypedArray:Fo,isFileList:jo,forEach:rt,merge:Ft,extend:$o,trim:Io,stripBOM:Po,inherits:Mo,toFlatObject:Bo,kindOf:Nt,kindOfTest:ue,endsWith:zo,toArray:Do,forEachEntry:Uo,matchAll:Zo,isHTMLForm:Vo,hasOwnProperty:hr,hasOwnProp:hr,reduceDescriptors:ks,freezeMethods:Wo,toObjectSet:Jo,toCamelCase:qo,noop:Xo,toFiniteNumber:Ko,findKey:vs,global:Ne,isContextDefined:_s,isSpecCompliantForm:Go,toJSONObject:Yo,isAsyncFn:Qo,isThenable:ei,setImmediate:ws,asap:ti,isIterable:ri};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 Ts=I.prototype,Ns={};["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=>{Ns[t]={value:t}});Object.defineProperties(I,Ns);Object.defineProperty(Ts,"isAxiosError",{value:!0});I.from=(t,e,r,s,a,n)=>{const o=Object.create(Ts);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 si=null;function Ut(t){return f.isPlainObject(t)||f.isArray(t)}function js(t){return f.endsWith(t,"[]")?t.slice(0,-2):t}function pr(t,e,r){return t?t.concat(e).map(function(a,n){return a=js(a),!r&&n?"["+a+"]":a}).join(r?".":""):e}function ai(t){return f.isArray(t)&&!t.some(Ut)}const ni=f.toFlatObject(f,{},null,function(e){return/^is[A-Z]/.test(e)});function St(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)&&ai(m)||(f.isFileList(m)||f.endsWith(h,"[]"))&&(v=f.toArray(m)))return h=js(h),v.forEach(function(b,w){!(f.isUndefined(b)||b===null)&&e.append(o===!0?pr([h],w,n):o===null?h:h+"[]",c(b))}),!1}return Ut(m)?!0:(e.append(pr(g,h,n),c(m)),!1)}const p=[],k=Object.assign(ni,{defaultVisitor:d,convertValue:c,isVisitable:Ut});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 gr(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(s){return e[s]})}function rr(t,e){this._pairs=[],t&&St(t,this,e)}const Ss=rr.prototype;Ss.append=function(e,r){this._pairs.push([e,r])};Ss.toString=function(e){const r=e?function(s){return e.call(this,s,gr)}:gr;return this._pairs.map(function(a){return r(a[0])+"="+r(a[1])},"").join("&")};function oi(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Cs(t,e,r){if(!e)return t;const s=r&&r.encode||oi;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 rr(e,r).toString(s),n){const o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+n}return t}class yr{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 Es={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ii=typeof URLSearchParams<"u"?URLSearchParams:rr,li=typeof FormData<"u"?FormData:null,ci=typeof Blob<"u"?Blob:null,di={isBrowser:!0,classes:{URLSearchParams:ii,FormData:li,Blob:ci},protocols:["http","https","file","blob","url","data"]},sr=typeof window<"u"&&typeof document<"u",Zt=typeof navigator=="object"&&navigator||void 0,ui=sr&&(!Zt||["ReactNative","NativeScript","NS"].indexOf(Zt.product)<0),fi=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",mi=sr&&window.location.href||"http://localhost",hi=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:sr,hasStandardBrowserEnv:ui,hasStandardBrowserWebWorkerEnv:fi,navigator:Zt,origin:mi},Symbol.toStringTag,{value:"Module"})),Y={...hi,...di};function pi(t,e){return St(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 gi(t){return f.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function yi(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 Rs(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]=yi(a[o])),!i)}if(f.isFormData(t)&&f.isFunction(t.entries)){const r={};return f.forEachEntry(t,(s,a)=>{e(gi(s),a,r,0)}),r}return null}function bi(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 st={transitional:Es,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(Rs(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 pi(e,this.formSerializer).toString();if((i=f.isFileList(e))||s.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return St(i?{"files[]":e}:e,u&&new u,this.formSerializer)}}return n||a?(r.setContentType("application/json",!1),bi(e)):e}],transformResponse:[function(e){const r=this.transitional||st.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=>{st.headers[t]={}});const xi=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"]),vi=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]&&
|
|
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[br]=this[br]={accessors:{}}).accessors,a=this.prototype;function n(o){const i=qe(o);s[i]||(Ti(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 Rt(t,e){const r=this||st,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 Os(t){return!!(t&&t.__CANCEL__)}function Fe(t,e,r){I.call(this,t??"canceled",I.ERR_CANCELED,e,r),this.name="CanceledError"}f.inherits(Fe,I,{__CANCEL__:!0});function As(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 Ni(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function ji(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 Si(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 dt=(t,e,r=3)=>{let s=0;const a=ji(50,250);return Si(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)},xr=(t,e)=>{const r=t!=null;return[s=>e[0]({lengthComputable:r,total:t,loaded:s}),e[1]]},vr=t=>(...e)=>f.asap(()=>t(...e)),Ci=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,Ei=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 Ri(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Oi(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Ls(t,e,r){let s=!Ri(e);return t&&(s||r==!1)?Oi(t,e):e}const _r=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(_r(c),_r(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 Is=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=Cs(Ls(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&&Ci(e.url))){const u=a&&n&&Ei.read(n);u&&o.set(a,u)}return e},Ai=typeof XMLHttpRequest<"u",Li=Ai&&function(t){return new Promise(function(r,s){const a=Is(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};As(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||Es;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]=dt(c,!0),g.addEventListener("progress",k)),u&&g.upload&&([p,T]=dt(u),g.upload.addEventListener("progress",p),g.upload.addEventListener("loadend",T)),(a.cancelToken||a.signal)&&(d=b=>{g&&(s(!b||b.type?new Fe(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=Ni(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)})},Ii=(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 Fe(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}},$i=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},Pi=async function*(t,e){for await(const r of Mi(t))yield*$i(r,e)},Mi=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()}},kr=(t,e,r,s)=>{const a=Pi(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})},wr=64*1024,{isFunction:ot}=f,Bi=(({Request:t,Response:e})=>({Request:t,Response:e}))(f.global),{ReadableStream:Tr,TextEncoder:Nr}=f.global,jr=(t,...e)=>{try{return!!t(...e)}catch{return!1}},zi=t=>{t=f.merge.call({skipUndefined:!0},Bi,t);const{fetch:e,Request:r,Response:s}=t,a=e?ot(e):typeof fetch=="function",n=ot(r),o=ot(s);if(!a)return!1;const i=a&&ot(Tr),u=a&&(typeof Nr=="function"?(m=>h=>m.encode(h))(new Nr):async m=>new Uint8Array(await new r(m).arrayBuffer())),c=n&&i&&jr(()=>{let m=!1;const h=new r(Y.origin,{body:new Tr,method:"POST",get duplex(){return m=!0,"half"}}).headers.has("Content-Type");return m&&!h}),d=o&&i&&jr(()=>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}=Is(m),q=e||fetch;j=j?(j+"").toLowerCase():"text";let W=Ii([x,b&&b.toAbortSignal()],w),G=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[Ze,Oe]=xr(ge,dt(vr(D)));v=kr(fe.body,wr,Ze,Oe)}}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};G=n&&new r(h,te);let Q=await(n?q(G,V):q(h,te));const Ue=d&&(j==="stream"||j==="response");if(d&&(A||Ue&&ne)){const fe={};["status","statusText","headers"].forEach(Ve=>{fe[Ve]=Q[Ve]});const xe=f.toFiniteNumber(Q.headers.get("content-length")),[Ze,Oe]=A&&xr(xe,dt(vr(A),!0))||[];Q=new s(kr(Q.body,wr,Ze,()=>{Oe&&Oe(),ne&&ne()}),fe)}j=j||"text";let nt=await p[f.findKey(p,j)||"text"](Q,m);return!Ue&&ne&&ne(),await new Promise((fe,xe)=>{As(fe,xe,{data:nt,headers:ae.from(Q.headers),status:Q.status,statusText:Q.statusText,config:m,request:G})})}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,G),{cause:H.cause||H}):I.from(H,H&&H.code,m,G)}}},Di=new Map,$s=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=Di;for(;i--;)u=n[i],c=d.get(u),c===void 0&&d.set(u,c=i?new Map:zi(e)),d=c;return c};$s();const ar={http:si,xhr:Li,fetch:{get:$s}};f.forEach(ar,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Sr=t=>`- ${t}`,Fi=t=>f.isFunction(t)||t===null||t===!1;function Ui(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,!Fi(s)&&(a=ar[(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(
|
|
6
|
-
`):" "+
|
|
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&&ct.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}:ct.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),ct.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=[Cr.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=Cr.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=Ls(e.baseURL,e.url,e.allowAbsoluteUrls);return Cs(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 Vi=class Bs{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 Fe(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 Bs(function(a){e=a}),cancel:e}}};function qi(t){return function(r){return t.apply(null,r)}}function Hi(t){return f.isObject(t)&&t.isAxiosError===!0}const Vt={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(Vt).forEach(([t,e])=>{Vt[e]=t});function zs(t){const e=new Se(t),r=gs(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 zs(Ee(t,a))},r}const U=zs(st);U.Axios=Se;U.CanceledError=Fe;U.CancelToken=Vi;U.isCancel=Os;U.VERSION=Ms;U.toFormData=St;U.AxiosError=I;U.Cancel=U.CanceledError;U.all=function(e){return Promise.all(e)};U.spread=qi;U.isAxiosError=Hi;U.mergeConfig=Ee;U.AxiosHeaders=ae;U.formToJSON=t=>Rs(f.isHTMLForm(t)?new FormData(t):t);U.getAdapter=Ps.getAdapter;U.HttpStatusCode=Vt;U.default=U;const{Axios:El,AxiosError:Rl,CanceledError:Ol,isCancel:Al,CancelToken:Ll,VERSION:Il,all:$l,Cancel:Pl,isAxiosError:Ml,spread:Bl,toFormData:zl,AxiosHeaders:Dl,HttpStatusCode:Fl,formToJSON:Ul,getAdapter:Zl,mergeConfig:Vl}=U,nr="",Wi="jsonplaceholder",Ds={LOGIN_KEY:"auth-storage"};throw new Error("API_BASE_URL is not set");const Ji=U.create({baseURL:nr}),qt=Ji,at=fs()(yo(t=>({user:null,error:null,isLoggedIn:!1,justLoggedIn:!1,isSideNavbarOpen:!0,loginAction:async e=>{try{if(nr.includes(Wi)){const r=await qt.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 qt.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:Ds.LOGIN_KEY,partialize:t=>({user:t.user,isLoggedIn:t.isLoggedIn,isSideNavbarOpen:t.isSideNavbarOpen})})),Xi=({hasNotifications:t=!0})=>{const e=We.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}=at(),T=m=>{o(!n),m==="logout"?u():e(m)};return y.useEffect(()=>{c&&i&&(hs(`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(Ie,{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(va,{className:"w-5 h-5"})})}),l.jsxs("div",{className:"relative hidden md:block",children:[l.jsx(ja,{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(Yt,{forceDarkTheme:!0}),l.jsx(Ie,{text:"Notifications",position:"bottom",children:l.jsxs(de,{variant:"default",className:"text-slate-400 hover:bg-slate-600",children:[l.jsx(ca,{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(Ie,{text:"Activity History",position:"bottom",children:l.jsx(de,{variant:"default",className:"text-slate-400 hover:bg-slate-600",icon:l.jsx(ha,{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:er(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(Ia,{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(Ca,{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(ga,{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(ba,{className:"w-4 h-4 mr-3"}),"Logout"]})})]})]})]})]})})},Ki=({item:t})=>{const e=We.useLocation(),{isSideNavbarOpen:r}=at(),s=e.pathname===t.path,a=l.jsxs(We.Link,{to:t.path,className:`
|
|
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:`
|
|
8
8
|
relative flex items-center gap-3 px-3 py-2.5 rounded-sm transition-all duration-200 group
|
|
9
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
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(
|
|
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:`
|
|
12
12
|
${a?"w-64":"w-20"}
|
|
13
13
|
min-h-screen bg-slate-800 border-r border-slate-400
|
|
14
14
|
transition-all duration-300 ease-in-out flex flex-col sticky top-0 z-30
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
`,children:[l.jsxs("div",{className:`
|
|
17
17
|
px-4 py-3 lg:py-3.5 flex items-center gap-3 border-b border-slate-400
|
|
18
18
|
${!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(
|
|
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:`
|
|
20
20
|
px-3 py-4 border-t border-slate-200 dark:border-slate-600
|
|
21
21
|
${!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(Ie,{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 Rr;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Rr||(Rr={}));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 Ht=(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 Yi=Ht;function Qi(){return Yi}const el=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=Qi(),s=el({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===Ht?void 0:Ht].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 R;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 R;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 R=Object.freeze({status:"aborted"}),He=t=>({status:"dirty",value:t}),ce=t=>({status:"valid",value:t}),Or=t=>t.status==="aborted",Ar=t=>t.status==="dirty",Pe=t=>t.status==="valid",ut=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 Lr=(t,e)=>{if(Pe(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(ut(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 Lr(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 Pe(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=>Pe(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(ut(a)?a:Promise.resolve(a));return Lr(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 Be({schema:this,typeName:O.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 ze.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return pe.create(this)}promise(){return pt.create(this,this._def)}or(e){return mt.create([this,e],this._def)}and(e){return ht.create(this,e,this._def)}transform(e){return new Be({...P(this._def),schema:this,typeName:O.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new Jt({...P(this._def),innerType:this,defaultValue:r,typeName:O.ZodDefault})}brand(){return new wl({typeName:O.ZodBranded,type:this,...P(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new Xt({...P(this._def),innerType:this,catchValue:r,typeName:O.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return or.create(this,e)}readonly(){return Kt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const tl=/^c[^\s-]{8,}$/i,rl=/^[0-9a-z]+$/,sl=/^[0-9A-HJKMNP-TV-Z]{26}$/i,al=/^[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,nl=/^[a-z0-9_-]{21}$/i,ol=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,il=/^[-+]?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)?)??$/,ll=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,cl="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let At;const dl=/^(?:(?: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])$/,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])\/(3[0-2]|[12]?[0-9])$/,fl=/^(([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]))$/,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]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,hl=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,pl=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Fs="((\\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])))",gl=new RegExp(`^${Fs}$`);function Us(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 yl(t){return new RegExp(`^${Us(t)}$`)}function bl(t){let e=`${Fs}T${Us(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 xl(t,e){return!!((e==="v4"||!e)&&dl.test(t)||(e==="v6"||!e)&&fl.test(t))}function vl(t,e){if(!ol.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 _l(t,e){return!!((e==="v4"||!e)&&ul.test(t)||(e==="v6"||!e)&&ml.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}),R}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")ll.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")At||(At=new RegExp(cl,"u")),At.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")al.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")nl.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")tl.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")rl.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")sl.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"?bl(n).test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{code:_.invalid_string,validation:"datetime",message:n.message}),s.dirty()):n.kind==="date"?gl.test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{code:_.invalid_string,validation:"date",message:n.message}),s.dirty()):n.kind==="time"?yl(n).test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{code:_.invalid_string,validation:"time",message:n.message}),s.dirty()):n.kind==="duration"?il.test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"duration",code:_.invalid_string,message:n.message}),s.dirty()):n.kind==="ip"?xl(e.data,n.version)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"ip",code:_.invalid_string,message:n.message}),s.dirty()):n.kind==="jwt"?vl(e.data,n.alg)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"jwt",code:_.invalid_string,message:n.message}),s.dirty()):n.kind==="cidr"?_l(e.data,n.version)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"cidr",code:_.invalid_string,message:n.message}),s.dirty()):n.kind==="base64"?hl.test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"base64",code:_.invalid_string,message:n.message}),s.dirty()):n.kind==="base64url"?pl.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:O.ZodString,coerce:t?.coerce??!1,...P(t)});function kl(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 Xe 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}),R}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"?kl(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 Xe({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:s,message:C.toString(a)}]})}_addCheck(e){return new Xe({...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)}}Xe.create=t=>new Xe({checks:[],typeName:O.ZodNumber,coerce:t?.coerce||!1,...P(t)});class Ke 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}),R}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 Ke({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:s,message:C.toString(a)}]})}_addCheck(e){return new Ke({...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}}Ke.create=t=>new Ke({checks:[],typeName:O.ZodBigInt,coerce:t?.coerce??!1,...P(t)});class Ir 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}),R}return ce(e.data)}}Ir.create=t=>new Ir({typeName:O.ZodBoolean,coerce:t?.coerce||!1,...P(t)});class ft 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}),R}if(Number.isNaN(e.data.getTime())){const n=this._getOrReturnCtx(e);return N(n,{code:_.invalid_date}),R}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 ft({...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}}ft.create=t=>new ft({checks:[],coerce:t?.coerce||!1,typeName:O.ZodDate,...P(t)});class $r 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}),R}return ce(e.data)}}$r.create=t=>new $r({typeName:O.ZodSymbol,...P(t)});class Pr 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}),R}return ce(e.data)}}Pr.create=t=>new Pr({typeName:O.ZodUndefined,...P(t)});class Mr 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}),R}return ce(e.data)}}Mr.create=t=>new Mr({typeName:O.ZodNull,...P(t)});class Br extends M{constructor(){super(...arguments),this._any=!0}_parse(e){return ce(e.data)}}Br.create=t=>new Br({typeName:O.ZodAny,...P(t)});class zr extends M{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ce(e.data)}}zr.create=t=>new zr({typeName:O.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}),R}}Te.create=t=>new Te({typeName:O.ZodNever,...P(t)});class Dr 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}),R}return ce(e.data)}}Dr.create=t=>new Dr({typeName:O.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}),R;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:O.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 ze?ze.create(Le(t.unwrap())):t instanceof Re?Re.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}),R}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:O.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 Zs(B.objectKeys(this.shape))}}Z.create=(t,e)=>new Z({shape:()=>t,unknownKeys:"strip",catchall:Te.create(),typeName:O.ZodObject,...P(e)});Z.strictCreate=(t,e)=>new Z({shape:()=>t,unknownKeys:"strict",catchall:Te.create(),typeName:O.ZodObject,...P(e)});Z.lazycreate=(t,e)=>new Z({shape:t,unknownKeys:"strip",catchall:Te.create(),typeName:O.ZodObject,...P(e)});class mt 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}),R}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}),R}}get options(){return this._def.options}}mt.create=(t,e)=>new mt({options:t,typeName:O.ZodUnion,...P(e)});function Wt(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=Wt(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=Wt(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 ht extends M{_parse(e){const{status:r,ctx:s}=this._processInputParams(e),a=(n,o)=>{if(Or(n)||Or(o))return R;const i=Wt(n.value,o.value);return i.valid?((Ar(n)||Ar(o))&&r.dirty(),{status:r.value,value:i.data}):(N(s,{code:_.invalid_intersection_types}),R)};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}))}}ht.create=(t,e,r)=>new ht({left:t,right:e,typeName:O.ZodIntersection,...P(r)});class Re 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}),R;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"}),R;!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 Re({...this._def,rest:e})}}Re.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Re({items:t,typeName:O.ZodTuple,rest:null,...P(e)})};class Fr 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}),R;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 R;(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 R;(c.status==="dirty"||d.status==="dirty")&&r.dirty(),i.set(c.value,d.value)}return{status:r.value,value:i}}}}Fr.create=(t,e,r)=>new Fr({valueType:e,keyType:t,typeName:O.ZodMap,...P(r)});class Ge 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}),R;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 R;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 Ge({...this._def,minSize:{value:e,message:C.toString(r)}})}max(e,r){return new Ge({...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)}}Ge.create=(t,e)=>new Ge({valueType:t,minSize:null,maxSize:null,typeName:O.ZodSet,...P(e)});class Ur 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})}}Ur.create=(t,e)=>new Ur({getter:t,typeName:O.ZodLazy,...P(e)});class Zr 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}),R}return{status:"valid",value:e.data}}get value(){return this._def.value}}Zr.create=(t,e)=>new Zr({value:t,typeName:O.ZodLiteral,...P(e)});function Zs(t,e){return new Me({values:t,typeName:O.ZodEnum,...P(e)})}class Me 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}),R}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}),R}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 Me.create(e,{...this._def,...r})}exclude(e,r=this._def){return Me.create(this.options.filter(s=>!e.includes(s)),{...this._def,...r})}}Me.create=Zs;class Vr 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}),R}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}),R}return ce(e.data)}get enum(){return this._def.values}}Vr.create=(t,e)=>new Vr({values:t,typeName:O.ZodNativeEnum,...P(e)});class pt 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}),R;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})))}}pt.create=(t,e)=>new pt({type:t,typeName:O.ZodPromise,...P(e)});class Be extends M{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===O.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 R;const u=await this._def.schema._parseAsync({data:i,path:s.path,parent:s});return u.status==="aborted"?R:u.status==="dirty"||r.value==="dirty"?He(u.value):u});{if(r.value==="aborted")return R;const i=this._def.schema._parseSync({data:o,path:s.path,parent:s});return i.status==="aborted"?R:i.status==="dirty"||r.value==="dirty"?He(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"?R:(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"?R:(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(!Pe(o))return R;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=>Pe(o)?Promise.resolve(a.transform(o.value,n)).then(i=>({status:r.value,value:i})):R);B.assertNever(a)}}Be.create=(t,e,r)=>new Be({schema:t,typeName:O.ZodEffects,effect:e,...P(r)});Be.createWithPreprocess=(t,e,r)=>new Be({schema:e,effect:{type:"preprocess",transform:t},typeName:O.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:O.ZodOptional,...P(e)});class ze extends M{_parse(e){return this._getType(e)===S.null?ce(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ze.create=(t,e)=>new ze({innerType:t,typeName:O.ZodNullable,...P(e)});class Jt 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}}Jt.create=(t,e)=>new Jt({innerType:t,typeName:O.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...P(e)});class Xt 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 ut(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}}Xt.create=(t,e)=>new Xt({innerType:t,typeName:O.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...P(e)});class qr 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}),R}return{status:"valid",value:e.data}}}qr.create=t=>new qr({typeName:O.ZodNaN,...P(t)});class wl 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 or 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"?R:n.status==="dirty"?(r.dirty(),He(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"?R: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 or({in:e,out:r,typeName:O.ZodPipeline})}}class Kt extends M{_parse(e){const r=this._def.innerType._parse(e),s=a=>(Pe(a)&&(a.value=Object.freeze(a.value)),a);return ut(r)?r.then(a=>s(a)):s(r)}unwrap(){return this._def.innerType}}Kt.create=(t,e)=>new Kt({innerType:t,typeName:O.ZodReadonly,...P(e)});var O;(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"})(O||(O={}));const Hr=_e.create;Te.create;pe.create;const Tl=Z.create;mt.create;ht.create;Re.create;Me.create;pt.create;ke.create;ze.create;const Nl=Tl({email:Hr().min(1,"Email is required").email("Enter a valid email"),password:Hr().min(1,"Password is required").min(6,"Password must be at least 6 characters")}),jl=({logo:t,slogan:e,pageTitle:r})=>{const{error:s,loginAction:a}=at(),[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=Nl.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(Yt,{})}),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(Jr,{variant:"danger",className:"w-full mb-4 justify-center",children:s}),l.jsxs("form",{className:"space-y-3",onSubmit:h,children:[l.jsx($t,{id:"email",value:n,placeholder:"Email",error:c.email,onChange:T}),l.jsx($t,{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(gt,{variant:"default"})," ","Logging..."]}):"Sign In"})})]})]})]})};exports.API_BASE_URL=nr;exports.AUTH=Ds;exports.ActivityFeed=en;exports.ActivityItem=as;exports.AdminLayout=oo;exports.Badge=Jr;exports.BorderRadius=re;exports.Button=de;exports.ButtonState=qs;exports.Card=yt;exports.CardBody=bt;exports.CardFooter=Va;exports.CardHeader=rs;exports.Checkbox=un;exports.GlobalContainer=uo;exports.GlobalLoader=ss;exports.InfoCard=qa;exports.InlineLoader=gt;exports.Input=$t;exports.Login=jl;exports.Modal=Fa;exports.ModalBody=It;exports.ModalFooter=Qr;exports.ModalHeader=Lt;exports.MultiSelect=_n;exports.PageContainer=io;exports.Pagination=rn;exports.Position=J;exports.ProgressStat=tn;exports.RadioGroup=yn;exports.Row=Js;exports.Select=Gt;exports.SideNavbar=Gi;exports.Size=le;exports.StatCard=Ha;exports.Table=Ja;exports.TableBody=Ka;exports.TableData=Qa;exports.TableHead=Ya;exports.TableHeader=Xa;exports.TableRow=Ga;exports.Textarea=ln;exports.ThemeProvider=Ba;exports.ThemeToggle=Yt;exports.Toggle=hn;exports.Tooltip=Ie;exports.TopNavbar=Xi;exports.Variant=X;exports.axiosInstance=qt;exports.capitalizeWords=ps;exports.errorToast=fo;exports.infoToast=mo;exports.loaderService=ms;exports.manageTextLength=er;exports.successToast=hs;exports.useAuthStore=at;exports.useMenuStore=kt;exports.useTheme=Yr;exports.warningToast=ho;
|
|
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;
|
|
23
23
|
//# sourceMappingURL=index.cjs.map
|