@techlabi/kycrazy-ui-kit 0.25.0 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(l,S){typeof exports=="object"&&typeof module<"u"?module.exports=S(require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["react/jsx-runtime","react","react-dom"],S):(l=typeof globalThis<"u"?globalThis:l||self,l.KycrazyUIKit=S(l.jsxRuntime,l.React,l.ReactDOM))})(this,function(l,S,Ge){"use strict";var Ih=l=>{throw TypeError(l)};var el=(l,S,Ge)=>S.has(l)||Ih("Cannot "+Ge);var _=(l,S,Ge)=>(el(l,S,"read from private field"),Ge?Ge.call(l):S.get(l)),ee=(l,S,Ge)=>S.has(l)?Ih("Cannot add the same private member more than once"):S instanceof WeakSet?S.add(l):S.set(l,Ge),K=(l,S,Ge,Jr)=>(el(l,S,"write to private field"),Jr?Jr.call(l,Ge):S.set(l,Ge),Ge),ce=(l,S,Ge)=>(el(l,S,"access private method"),Ge);var ta=(l,S,Ge,Jr)=>({set _(m){K(l,S,m,Ge)},get _(){return _(l,S,Jr)}});var hn,Br,Kn,_h,Qn,Wr,Gn,Ch,pn,Sh,Xn,Jn,Nt,mn,Je,Hs,vn,Lt,br,kh,Gt,Nh,Xt,lt,gn,Jt,Xr,Eh,ur,Vt,zs,Ph,Ue,jr,Ur,Rn,es,Hr,ts,rs,Th,vt,ge,Ys,ct,yn,ns,fr,zr,qs,ss,os,bn,wn,Yr,as,Ne,Zs,tl,rl,nl,sl,ol,al,il,Fh,Oh,qr,Zr,gt,hr,pr,ra,ll,Mh;function Jr(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const m=Jr(S),ls=Jr(Ge),Lh=1,Vh=1e6;let na=0;function $h(){return na=(na+1)%Number.MAX_SAFE_INTEGER,na.toString()}const sa=new Map,cl=e=>{if(sa.has(e))return;const t=setTimeout(()=>{sa.delete(e),cs({type:"REMOVE_TOAST",toastId:e})},Vh);sa.set(e,t)},Bh=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Lh)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?cl(r):e.toasts.forEach(n=>{cl(n.id)}),{...e,toasts:e.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==t.toastId)}}},Ks=[];let Qs={toasts:[]};function cs(e){Qs=Bh(Qs,e),Ks.forEach(t=>{t(Qs)})}function Wh({...e}){const t=$h(),r=s=>cs({type:"UPDATE_TOAST",toast:{...s,id:t}}),n=()=>cs({type:"DISMISS_TOAST",toastId:t});return cs({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||n()}}}),{id:t,dismiss:n,update:r}}function Gs(){const[e,t]=m.useState(Qs);return m.useEffect(()=>(Ks.push(t),()=>{const r=Ks.indexOf(t);r>-1&&Ks.splice(r,1)}),[e]),{...e,toast:Wh,dismiss:r=>cs({type:"DISMISS_TOAST",toastId:r})}}function ie(e,t,{checkForDefaultPrevented:r=!0}={}){return function(s){if(e==null||e(s),r===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function dl(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ul(...e){return t=>{let r=!1;const n=e.map(s=>{const o=dl(s,t);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let s=0;s<n.length;s++){const o=n[s];typeof o=="function"?o():dl(e[s],null)}}}}function Ie(...e){return m.useCallback(ul(...e),e)}function Rr(e,t=[]){let r=[];function n(o,a){const i=m.createContext(a),c=r.length;r=[...r,a];const d=h=>{var x;const{scope:v,children:f,...b}=h,p=((x=v==null?void 0:v[e])==null?void 0:x[c])||i,g=m.useMemo(()=>b,Object.values(b));return l.jsx(p.Provider,{value:g,children:f})};d.displayName=o+"Provider";function u(h,v){var p;const f=((p=v==null?void 0:v[e])==null?void 0:p[c])||i,b=m.useContext(f);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[d,u]}const s=()=>{const o=r.map(a=>m.createContext(a));return function(i){const c=(i==null?void 0:i[e])||o;return m.useMemo(()=>({[`__scope${e}`]:{...i,[e]:c}}),[i,c])}};return s.scopeName=e,[n,jh(s,...t)]}function jh(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const a=n.reduce((i,{useScope:c,scopeName:d})=>{const h=c(o)[`__scope${d}`];return{...i,...h}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}function Cn(e){const t=Uh(e),r=m.forwardRef((n,s)=>{const{children:o,...a}=n,i=m.Children.toArray(o),c=i.find(zh);if(c){const d=c.props.children,u=i.map(h=>h===c?m.Children.count(d)>1?m.Children.only(null):m.isValidElement(d)?d.props.children:null:h);return l.jsx(t,{...a,ref:s,children:m.isValidElement(d)?m.cloneElement(d,void 0,u):null})}return l.jsx(t,{...a,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}var fl=Cn("Slot");function Uh(e){const t=m.forwardRef((r,n)=>{const{children:s,...o}=r;if(m.isValidElement(s)){const a=qh(s),i=Yh(o,s.props);return s.type!==m.Fragment&&(i.ref=n?ul(n,a):a),m.cloneElement(s,i)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var hl=Symbol("radix.slottable");function Hh(e){const t=({children:r})=>l.jsx(l.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=hl,t}function zh(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===hl}function Yh(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...i)=>{const c=o(...i);return s(...i),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function qh(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function pl(e){const t=e+"CollectionProvider",[r,n]=Rr(t),[s,o]=r(t,{collectionRef:{current:null},itemMap:new Map}),a=p=>{const{scope:g,children:x}=p,y=S.useRef(null),w=S.useRef(new Map).current;return l.jsx(s,{scope:g,itemMap:w,collectionRef:y,children:x})};a.displayName=t;const i=e+"CollectionSlot",c=Cn(i),d=S.forwardRef((p,g)=>{const{scope:x,children:y}=p,w=o(i,x),k=Ie(g,w.collectionRef);return l.jsx(c,{ref:k,children:y})});d.displayName=i;const u=e+"CollectionItemSlot",h="data-radix-collection-item",v=Cn(u),f=S.forwardRef((p,g)=>{const{scope:x,children:y,...w}=p,k=S.useRef(null),E=Ie(g,k),M=o(u,x);return S.useEffect(()=>(M.itemMap.set(k,{ref:k,...w}),()=>void M.itemMap.delete(k))),l.jsx(v,{[h]:"",ref:E,children:y})});f.displayName=u;function b(p){const g=o(e+"CollectionConsumer",p);return S.useCallback(()=>{const y=g.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${h}]`));return Array.from(g.itemMap.values()).sort((M,O)=>w.indexOf(M.ref.current)-w.indexOf(O.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:a,Slot:d,ItemSlot:f},b,n]}var Zh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],we=Zh.reduce((e,t)=>{const r=Cn(`Primitive.${t}`),n=m.forwardRef((s,o)=>{const{asChild:a,...i}=s,c=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function ml(e,t){e&&ls.flushSync(()=>e.dispatchEvent(t))}function Et(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function Kh(e,t=globalThis==null?void 0:globalThis.document){const r=Et(e);m.useEffect(()=>{const n=s=>{s.key==="Escape"&&r(s)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var Qh="DismissableLayer",oa="dismissableLayer.update",Gh="dismissableLayer.pointerDownOutside",Xh="dismissableLayer.focusOutside",vl,gl=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ds=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:i,...c}=e,d=m.useContext(gl),[u,h]=m.useState(null),v=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,f]=m.useState({}),b=Ie(t,O=>h(O)),p=Array.from(d.layers),[g]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=p.indexOf(g),y=u?p.indexOf(u):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,k=y>=x,E=Rh(O=>{const P=O.target,F=[...d.branches].some(W=>W.contains(P));!k||F||(s==null||s(O),a==null||a(O),O.defaultPrevented||i==null||i())},v),M=ep(O=>{const P=O.target;[...d.branches].some(W=>W.contains(P))||(o==null||o(O),a==null||a(O),O.defaultPrevented||i==null||i())},v);return Kh(O=>{y===d.layers.size-1&&(n==null||n(O),!O.defaultPrevented&&i&&(O.preventDefault(),i()))},v),m.useEffect(()=>{if(u)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(vl=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),bl(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=vl)}},[u,v,r,d]),m.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),bl())},[u,d]),m.useEffect(()=>{const O=()=>f({});return document.addEventListener(oa,O),()=>document.removeEventListener(oa,O)},[]),l.jsx(we.div,{...c,ref:b,style:{pointerEvents:w?k?"auto":"none":void 0,...e.style},onFocusCapture:ie(e.onFocusCapture,M.onFocusCapture),onBlurCapture:ie(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:ie(e.onPointerDownCapture,E.onPointerDownCapture)})});ds.displayName=Qh;var Jh="DismissableLayerBranch",yl=m.forwardRef((e,t)=>{const r=m.useContext(gl),n=m.useRef(null),s=Ie(t,n);return m.useEffect(()=>{const o=n.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),l.jsx(we.div,{...e,ref:s})});yl.displayName=Jh;function Rh(e,t=globalThis==null?void 0:globalThis.document){const r=Et(e),n=m.useRef(!1),s=m.useRef(()=>{});return m.useEffect(()=>{const o=i=>{if(i.target&&!n.current){let c=function(){wl(Gh,r,d,{discrete:!0})};const d={originalEvent:i};i.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);n.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function ep(e,t=globalThis==null?void 0:globalThis.document){const r=Et(e),n=m.useRef(!1);return m.useEffect(()=>{const s=o=>{o.target&&!n.current&&wl(Xh,r,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function bl(){const e=new CustomEvent(oa);document.dispatchEvent(e)}function wl(e,t,r,{discrete:n}){const s=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?ml(s,o):s.dispatchEvent(o)}var tp=ds,rp=yl,et=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},np="Portal",Xs=m.forwardRef((e,t)=>{var i;const{container:r,...n}=e,[s,o]=m.useState(!1);et(()=>o(!0),[]);const a=r||s&&((i=globalThis==null?void 0:globalThis.document)==null?void 0:i.body);return a?Ge.createPortal(l.jsx(we.div,{...n,ref:t}),a):null});Xs.displayName=np;function sp(e,t){return m.useReducer((r,n)=>t[r][n]??r,e)}var us=e=>{const{present:t,children:r}=e,n=op(t),s=typeof r=="function"?r({present:n.isPresent}):m.Children.only(r),o=Ie(n.ref,ap(s));return typeof r=="function"||n.isPresent?m.cloneElement(s,{ref:o}):null};us.displayName="Presence";function op(e){const[t,r]=m.useState(),n=m.useRef(null),s=m.useRef(e),o=m.useRef("none"),a=e?"mounted":"unmounted",[i,c]=sp(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const d=Js(n.current);o.current=i==="mounted"?d:"none"},[i]),et(()=>{const d=n.current,u=s.current;if(u!==e){const v=o.current,f=Js(d);e?c("MOUNT"):f==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(u&&v!==f?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),et(()=>{if(t){let d;const u=t.ownerDocument.defaultView??window,h=f=>{const p=Js(n.current).includes(f.animationName);if(f.target===t&&p&&(c("ANIMATION_END"),!s.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",d=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},v=f=>{f.target===t&&(o.current=Js(n.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{u.clearTimeout(d),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:m.useCallback(d=>{n.current=d?getComputedStyle(d):null,r(d)},[])}}function Js(e){return(e==null?void 0:e.animationName)||"none"}function ap(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var ip=m[" useInsertionEffect ".trim().toString()]||et;function Rs({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[s,o,a]=lp({defaultProp:t,onChange:r}),i=e!==void 0,c=i?e:s;{const u=m.useRef(e!==void 0);m.useEffect(()=>{const h=u.current;h!==i&&console.warn(`${n} is changing from ${h?"controlled":"uncontrolled"} to ${i?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=i},[i,n])}const d=m.useCallback(u=>{var h;if(i){const v=cp(u)?u(e):u;v!==e&&((h=a.current)==null||h.call(a,v))}else o(u)},[i,e,o,a]);return[c,d]}function lp({defaultProp:e,onChange:t}){const[r,n]=m.useState(e),s=m.useRef(r),o=m.useRef(t);return ip(()=>{o.current=t},[t]),m.useEffect(()=>{var a;s.current!==r&&((a=o.current)==null||a.call(o,r),s.current=r)},[r,s]),[r,n,o]}function cp(e){return typeof e=="function"}var xl=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),dp="VisuallyHidden",eo=m.forwardRef((e,t)=>l.jsx(we.span,{...e,ref:t,style:{...xl,...e.style}}));eo.displayName=dp;var up=eo,aa="ToastProvider",[ia,fp,hp]=pl("Toast"),[_l,xC]=Rr("Toast",[hp]),[pp,to]=_l(aa),Cl=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:s="right",swipeThreshold:o=50,children:a}=e,[i,c]=m.useState(null),[d,u]=m.useState(0),h=m.useRef(!1),v=m.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${aa}\`. Expected non-empty \`string\`.`),l.jsx(ia.Provider,{scope:t,children:l.jsx(pp,{scope:t,label:r,duration:n,swipeDirection:s,swipeThreshold:o,toastCount:d,viewport:i,onViewportChange:c,onToastAdd:m.useCallback(()=>u(f=>f+1),[]),onToastRemove:m.useCallback(()=>u(f=>f-1),[]),isFocusedToastEscapeKeyDownRef:h,isClosePausedRef:v,children:a})})};Cl.displayName=aa;var Sl="ToastViewport",mp=["F8"],la="toast.viewportPause",ca="toast.viewportResume",kl=m.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=mp,label:s="Notifications ({hotkey})",...o}=e,a=to(Sl,r),i=fp(r),c=m.useRef(null),d=m.useRef(null),u=m.useRef(null),h=m.useRef(null),v=Ie(t,h,a.onViewportChange),f=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),b=a.toastCount>0;m.useEffect(()=>{const g=x=>{var w;n.length!==0&&n.every(k=>x[k]||x.code===k)&&((w=h.current)==null||w.focus())};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[n]),m.useEffect(()=>{const g=c.current,x=h.current;if(b&&g&&x){const y=()=>{if(!a.isClosePausedRef.current){const M=new CustomEvent(la);x.dispatchEvent(M),a.isClosePausedRef.current=!0}},w=()=>{if(a.isClosePausedRef.current){const M=new CustomEvent(ca);x.dispatchEvent(M),a.isClosePausedRef.current=!1}},k=M=>{!g.contains(M.relatedTarget)&&w()},E=()=>{g.contains(document.activeElement)||w()};return g.addEventListener("focusin",y),g.addEventListener("focusout",k),g.addEventListener("pointermove",y),g.addEventListener("pointerleave",E),window.addEventListener("blur",y),window.addEventListener("focus",w),()=>{g.removeEventListener("focusin",y),g.removeEventListener("focusout",k),g.removeEventListener("pointermove",y),g.removeEventListener("pointerleave",E),window.removeEventListener("blur",y),window.removeEventListener("focus",w)}}},[b,a.isClosePausedRef]);const p=m.useCallback(({tabbingDirection:g})=>{const y=i().map(w=>{const k=w.ref.current,E=[k,...Pp(k)];return g==="forwards"?E:E.reverse()});return(g==="forwards"?y.reverse():y).flat()},[i]);return m.useEffect(()=>{const g=h.current;if(g){const x=y=>{var E,M,O;const w=y.altKey||y.ctrlKey||y.metaKey;if(y.key==="Tab"&&!w){const P=document.activeElement,F=y.shiftKey;if(y.target===g&&F){(E=d.current)==null||E.focus();return}const D=p({tabbingDirection:F?"backwards":"forwards"}),U=D.findIndex(L=>L===P);fa(D.slice(U+1))?y.preventDefault():F?(M=d.current)==null||M.focus():(O=u.current)==null||O.focus()}};return g.addEventListener("keydown",x),()=>g.removeEventListener("keydown",x)}},[i,p]),l.jsxs(rp,{ref:c,role:"region","aria-label":s.replace("{hotkey}",f),tabIndex:-1,style:{pointerEvents:b?void 0:"none"},children:[b&&l.jsx(da,{ref:d,onFocusFromOutsideViewport:()=>{const g=p({tabbingDirection:"forwards"});fa(g)}}),l.jsx(ia.Slot,{scope:r,children:l.jsx(we.ol,{tabIndex:-1,...o,ref:v})}),b&&l.jsx(da,{ref:u,onFocusFromOutsideViewport:()=>{const g=p({tabbingDirection:"backwards"});fa(g)}})]})});kl.displayName=Sl;var Nl="ToastFocusProxy",da=m.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...s}=e,o=to(Nl,r);return l.jsx(eo,{"aria-hidden":!0,tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:a=>{var d;const i=a.relatedTarget;!((d=o.viewport)!=null&&d.contains(i))&&n()}})});da.displayName=Nl;var fs="Toast",vp="toast.swipeStart",gp="toast.swipeMove",yp="toast.swipeCancel",bp="toast.swipeEnd",El=m.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:s,onOpenChange:o,...a}=e,[i,c]=Rs({prop:n,defaultProp:s??!0,onChange:o,caller:fs});return l.jsx(us,{present:r||i,children:l.jsx(_p,{open:i,...a,ref:t,onClose:()=>c(!1),onPause:Et(e.onPause),onResume:Et(e.onResume),onSwipeStart:ie(e.onSwipeStart,d=>{d.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ie(e.onSwipeMove,d=>{const{x:u,y:h}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","move"),d.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${h}px`)}),onSwipeCancel:ie(e.onSwipeCancel,d=>{d.currentTarget.setAttribute("data-swipe","cancel"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:ie(e.onSwipeEnd,d=>{const{x:u,y:h}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","end"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${h}px`),c(!1)})})})});El.displayName=fs;var[wp,xp]=_l(fs,{onClose(){}}),_p=m.forwardRef((e,t)=>{const{__scopeToast:r,type:n="foreground",duration:s,open:o,onClose:a,onEscapeKeyDown:i,onPause:c,onResume:d,onSwipeStart:u,onSwipeMove:h,onSwipeCancel:v,onSwipeEnd:f,...b}=e,p=to(fs,r),[g,x]=m.useState(null),y=Ie(t,L=>x(L)),w=m.useRef(null),k=m.useRef(null),E=s||p.duration,M=m.useRef(0),O=m.useRef(E),P=m.useRef(0),{onToastAdd:F,onToastRemove:W}=p,G=Et(()=>{var J;(g==null?void 0:g.contains(document.activeElement))&&((J=p.viewport)==null||J.focus()),a()}),D=m.useCallback(L=>{!L||L===1/0||(window.clearTimeout(P.current),M.current=new Date().getTime(),P.current=window.setTimeout(G,L))},[G]);m.useEffect(()=>{const L=p.viewport;if(L){const J=()=>{D(O.current),d==null||d()},Y=()=>{const I=new Date().getTime()-M.current;O.current=O.current-I,window.clearTimeout(P.current),c==null||c()};return L.addEventListener(la,Y),L.addEventListener(ca,J),()=>{L.removeEventListener(la,Y),L.removeEventListener(ca,J)}}},[p.viewport,E,c,d,D]),m.useEffect(()=>{o&&!p.isClosePausedRef.current&&D(E)},[o,E,p.isClosePausedRef,D]),m.useEffect(()=>(F(),()=>W()),[F,W]);const U=m.useMemo(()=>g?Il(g):null,[g]);return p.viewport?l.jsxs(l.Fragment,{children:[U&&l.jsx(Cp,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:U}),l.jsx(wp,{scope:r,onClose:G,children:ls.createPortal(l.jsx(ia.ItemSlot,{scope:r,children:l.jsx(tp,{asChild:!0,onEscapeKeyDown:ie(i,()=>{p.isFocusedToastEscapeKeyDownRef.current||G(),p.isFocusedToastEscapeKeyDownRef.current=!1}),children:l.jsx(we.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":p.swipeDirection,...b,ref:y,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:ie(e.onKeyDown,L=>{L.key==="Escape"&&(i==null||i(L.nativeEvent),L.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,G()))}),onPointerDown:ie(e.onPointerDown,L=>{L.button===0&&(w.current={x:L.clientX,y:L.clientY})}),onPointerMove:ie(e.onPointerMove,L=>{if(!w.current)return;const J=L.clientX-w.current.x,Y=L.clientY-w.current.y,I=!!k.current,A=["left","right"].includes(p.swipeDirection),B=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,ae=A?B(0,J):0,Se=A?0:B(0,Y),de=L.pointerType==="touch"?10:2,ue={x:ae,y:Se},pe={originalEvent:L,delta:ue};I?(k.current=ue,ro(gp,h,pe,{discrete:!1})):Fl(ue,p.swipeDirection,de)?(k.current=ue,ro(vp,u,pe,{discrete:!1}),L.target.setPointerCapture(L.pointerId)):(Math.abs(J)>de||Math.abs(Y)>de)&&(w.current=null)}),onPointerUp:ie(e.onPointerUp,L=>{const J=k.current,Y=L.target;if(Y.hasPointerCapture(L.pointerId)&&Y.releasePointerCapture(L.pointerId),k.current=null,w.current=null,J){const I=L.currentTarget,A={originalEvent:L,delta:J};Fl(J,p.swipeDirection,p.swipeThreshold)?ro(bp,f,A,{discrete:!0}):ro(yp,v,A,{discrete:!0}),I.addEventListener("click",B=>B.preventDefault(),{once:!0})}})})})}),p.viewport)})]}):null}),Cp=e=>{const{__scopeToast:t,children:r,...n}=e,s=to(fs,t),[o,a]=m.useState(!1),[i,c]=m.useState(!1);return Np(()=>a(!0)),m.useEffect(()=>{const d=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(d)},[]),i?null:l.jsx(Xs,{asChild:!0,children:l.jsx(eo,{...n,children:o&&l.jsxs(l.Fragment,{children:[s.label," ",r]})})})},Sp="ToastTitle",Pl=m.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return l.jsx(we.div,{...n,ref:t})});Pl.displayName=Sp;var kp="ToastDescription",Tl=m.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return l.jsx(we.div,{...n,ref:t})});Tl.displayName=kp;var Ol="ToastAction",Ml=m.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?l.jsx(Dl,{altText:r,asChild:!0,children:l.jsx(ua,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Ol}\`. Expected non-empty \`string\`.`),null)});Ml.displayName=Ol;var Al="ToastClose",ua=m.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,s=xp(Al,r);return l.jsx(Dl,{asChild:!0,children:l.jsx(we.button,{type:"button",...n,ref:t,onClick:ie(e.onClick,s.onClose)})})});ua.displayName=Al;var Dl=m.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...s}=e;return l.jsx(we.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...s,ref:t})});function Il(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),Ep(n)){const s=n.ariaHidden||n.hidden||n.style.display==="none",o=n.dataset.radixToastAnnounceExclude==="";if(!s)if(o){const a=n.dataset.radixToastAnnounceAlt;a&&t.push(a)}else t.push(...Il(n))}}),t}function ro(e,t,r,{discrete:n}){const s=r.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?ml(s,o):s.dispatchEvent(o)}var Fl=(e,t,r=0)=>{const n=Math.abs(e.x),s=Math.abs(e.y),o=n>s;return t==="left"||t==="right"?o&&n>r:!o&&s>r};function Np(e=()=>{}){const t=Et(e);et(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function Ep(e){return e.nodeType===e.ELEMENT_NODE}function Pp(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function fa(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var Tp=Cl,Ll=kl,Vl=El,$l=Pl,Bl=Tl,Wl=Ml,jl=ua;function Ul(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=Ul(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Hl(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=Ul(e))&&(n&&(n+=" "),n+=t);return n}const zl=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Yl=Hl,ha=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return Yl(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:o}=t,a=Object.keys(s).map(d=>{const u=r==null?void 0:r[d],h=o==null?void 0:o[d];if(u===null)return null;const v=zl(u)||zl(h);return s[d][v]}),i=r&&Object.entries(r).reduce((d,u)=>{let[h,v]=u;return v===void 0||(d[h]=v),d},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((d,u)=>{let{class:h,className:v,...f}=u;return Object.entries(f).every(b=>{let[p,g]=b;return Array.isArray(g)?g.includes({...o,...i}[p]):{...o,...i}[p]===g})?[...d,h,v]:d},[]);return Yl(e,a,c,r==null?void 0:r.class,r==null?void 0:r.className)};/**
1
+ (function(l,S){typeof exports=="object"&&typeof module<"u"?module.exports=S(require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["react/jsx-runtime","react","react-dom"],S):(l=typeof globalThis<"u"?globalThis:l||self,l.KycrazyUIKit=S(l.jsxRuntime,l.React,l.ReactDOM))})(this,function(l,S,Ge){"use strict";var Ih=l=>{throw TypeError(l)};var el=(l,S,Ge)=>S.has(l)||Ih("Cannot "+Ge);var _=(l,S,Ge)=>(el(l,S,"read from private field"),Ge?Ge.call(l):S.get(l)),ee=(l,S,Ge)=>S.has(l)?Ih("Cannot add the same private member more than once"):S instanceof WeakSet?S.add(l):S.set(l,Ge),K=(l,S,Ge,Jr)=>(el(l,S,"write to private field"),Jr?Jr.call(l,Ge):S.set(l,Ge),Ge),ce=(l,S,Ge)=>(el(l,S,"access private method"),Ge);var ta=(l,S,Ge,Jr)=>({set _(m){K(l,S,m,Ge)},get _(){return _(l,S,Jr)}});var hn,Br,Kn,_h,Qn,Wr,Gn,Ch,pn,Sh,Xn,Jn,Nt,mn,Je,Hs,vn,Lt,br,kh,Gt,Nh,Xt,lt,gn,Jt,Xr,Eh,ur,Vt,zs,Ph,Ue,jr,Ur,Rn,es,Hr,ts,rs,Th,vt,ge,Ys,ct,yn,ns,fr,zr,qs,ss,os,bn,wn,Yr,as,Ne,Zs,tl,rl,nl,sl,ol,al,il,Fh,Oh,qr,Zr,gt,hr,pr,ra,ll,Mh;function Jr(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const m=Jr(S),ls=Jr(Ge),Lh=1,Vh=1e6;let na=0;function $h(){return na=(na+1)%Number.MAX_SAFE_INTEGER,na.toString()}const sa=new Map,cl=e=>{if(sa.has(e))return;const t=setTimeout(()=>{sa.delete(e),cs({type:"REMOVE_TOAST",toastId:e})},Vh);sa.set(e,t)},Bh=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Lh)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?cl(r):e.toasts.forEach(n=>{cl(n.id)}),{...e,toasts:e.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==t.toastId)}}},Ks=[];let Qs={toasts:[]};function cs(e){Qs=Bh(Qs,e),Ks.forEach(t=>{t(Qs)})}function Wh({...e}){const t=$h(),r=s=>cs({type:"UPDATE_TOAST",toast:{...s,id:t}}),n=()=>cs({type:"DISMISS_TOAST",toastId:t});return cs({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||n()}}}),{id:t,dismiss:n,update:r}}function Gs(){const[e,t]=m.useState(Qs);return m.useEffect(()=>(Ks.push(t),()=>{const r=Ks.indexOf(t);r>-1&&Ks.splice(r,1)}),[e]),{...e,toast:Wh,dismiss:r=>cs({type:"DISMISS_TOAST",toastId:r})}}function ie(e,t,{checkForDefaultPrevented:r=!0}={}){return function(s){if(e==null||e(s),r===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function dl(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ul(...e){return t=>{let r=!1;const n=e.map(s=>{const o=dl(s,t);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let s=0;s<n.length;s++){const o=n[s];typeof o=="function"?o():dl(e[s],null)}}}}function Ie(...e){return m.useCallback(ul(...e),e)}function Rr(e,t=[]){let r=[];function n(o,a){const i=m.createContext(a),c=r.length;r=[...r,a];const d=h=>{var x;const{scope:v,children:f,...b}=h,p=((x=v==null?void 0:v[e])==null?void 0:x[c])||i,g=m.useMemo(()=>b,Object.values(b));return l.jsx(p.Provider,{value:g,children:f})};d.displayName=o+"Provider";function u(h,v){var p;const f=((p=v==null?void 0:v[e])==null?void 0:p[c])||i,b=m.useContext(f);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[d,u]}const s=()=>{const o=r.map(a=>m.createContext(a));return function(i){const c=(i==null?void 0:i[e])||o;return m.useMemo(()=>({[`__scope${e}`]:{...i,[e]:c}}),[i,c])}};return s.scopeName=e,[n,jh(s,...t)]}function jh(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const a=n.reduce((i,{useScope:c,scopeName:d})=>{const h=c(o)[`__scope${d}`];return{...i,...h}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}function Cn(e){const t=Uh(e),r=m.forwardRef((n,s)=>{const{children:o,...a}=n,i=m.Children.toArray(o),c=i.find(zh);if(c){const d=c.props.children,u=i.map(h=>h===c?m.Children.count(d)>1?m.Children.only(null):m.isValidElement(d)?d.props.children:null:h);return l.jsx(t,{...a,ref:s,children:m.isValidElement(d)?m.cloneElement(d,void 0,u):null})}return l.jsx(t,{...a,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}var fl=Cn("Slot");function Uh(e){const t=m.forwardRef((r,n)=>{const{children:s,...o}=r;if(m.isValidElement(s)){const a=qh(s),i=Yh(o,s.props);return s.type!==m.Fragment&&(i.ref=n?ul(n,a):a),m.cloneElement(s,i)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var hl=Symbol("radix.slottable");function Hh(e){const t=({children:r})=>l.jsx(l.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=hl,t}function zh(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===hl}function Yh(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...i)=>{const c=o(...i);return s(...i),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function qh(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function pl(e){const t=e+"CollectionProvider",[r,n]=Rr(t),[s,o]=r(t,{collectionRef:{current:null},itemMap:new Map}),a=p=>{const{scope:g,children:x}=p,y=S.useRef(null),w=S.useRef(new Map).current;return l.jsx(s,{scope:g,itemMap:w,collectionRef:y,children:x})};a.displayName=t;const i=e+"CollectionSlot",c=Cn(i),d=S.forwardRef((p,g)=>{const{scope:x,children:y}=p,w=o(i,x),k=Ie(g,w.collectionRef);return l.jsx(c,{ref:k,children:y})});d.displayName=i;const u=e+"CollectionItemSlot",h="data-radix-collection-item",v=Cn(u),f=S.forwardRef((p,g)=>{const{scope:x,children:y,...w}=p,k=S.useRef(null),E=Ie(g,k),M=o(u,x);return S.useEffect(()=>(M.itemMap.set(k,{ref:k,...w}),()=>void M.itemMap.delete(k))),l.jsx(v,{[h]:"",ref:E,children:y})});f.displayName=u;function b(p){const g=o(e+"CollectionConsumer",p);return S.useCallback(()=>{const y=g.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${h}]`));return Array.from(g.itemMap.values()).sort((M,T)=>w.indexOf(M.ref.current)-w.indexOf(T.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:a,Slot:d,ItemSlot:f},b,n]}var Zh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],we=Zh.reduce((e,t)=>{const r=Cn(`Primitive.${t}`),n=m.forwardRef((s,o)=>{const{asChild:a,...i}=s,c=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function ml(e,t){e&&ls.flushSync(()=>e.dispatchEvent(t))}function Et(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function Kh(e,t=globalThis==null?void 0:globalThis.document){const r=Et(e);m.useEffect(()=>{const n=s=>{s.key==="Escape"&&r(s)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var Qh="DismissableLayer",oa="dismissableLayer.update",Gh="dismissableLayer.pointerDownOutside",Xh="dismissableLayer.focusOutside",vl,gl=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ds=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:i,...c}=e,d=m.useContext(gl),[u,h]=m.useState(null),v=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,f]=m.useState({}),b=Ie(t,T=>h(T)),p=Array.from(d.layers),[g]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=p.indexOf(g),y=u?p.indexOf(u):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,k=y>=x,E=Rh(T=>{const O=T.target,F=[...d.branches].some(W=>W.contains(O));!k||F||(s==null||s(T),a==null||a(T),T.defaultPrevented||i==null||i())},v),M=ep(T=>{const O=T.target;[...d.branches].some(W=>W.contains(O))||(o==null||o(T),a==null||a(T),T.defaultPrevented||i==null||i())},v);return Kh(T=>{y===d.layers.size-1&&(n==null||n(T),!T.defaultPrevented&&i&&(T.preventDefault(),i()))},v),m.useEffect(()=>{if(u)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(vl=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),bl(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=vl)}},[u,v,r,d]),m.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),bl())},[u,d]),m.useEffect(()=>{const T=()=>f({});return document.addEventListener(oa,T),()=>document.removeEventListener(oa,T)},[]),l.jsx(we.div,{...c,ref:b,style:{pointerEvents:w?k?"auto":"none":void 0,...e.style},onFocusCapture:ie(e.onFocusCapture,M.onFocusCapture),onBlurCapture:ie(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:ie(e.onPointerDownCapture,E.onPointerDownCapture)})});ds.displayName=Qh;var Jh="DismissableLayerBranch",yl=m.forwardRef((e,t)=>{const r=m.useContext(gl),n=m.useRef(null),s=Ie(t,n);return m.useEffect(()=>{const o=n.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),l.jsx(we.div,{...e,ref:s})});yl.displayName=Jh;function Rh(e,t=globalThis==null?void 0:globalThis.document){const r=Et(e),n=m.useRef(!1),s=m.useRef(()=>{});return m.useEffect(()=>{const o=i=>{if(i.target&&!n.current){let c=function(){wl(Gh,r,d,{discrete:!0})};const d={originalEvent:i};i.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);n.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function ep(e,t=globalThis==null?void 0:globalThis.document){const r=Et(e),n=m.useRef(!1);return m.useEffect(()=>{const s=o=>{o.target&&!n.current&&wl(Xh,r,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function bl(){const e=new CustomEvent(oa);document.dispatchEvent(e)}function wl(e,t,r,{discrete:n}){const s=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?ml(s,o):s.dispatchEvent(o)}var tp=ds,rp=yl,et=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},np="Portal",Xs=m.forwardRef((e,t)=>{var i;const{container:r,...n}=e,[s,o]=m.useState(!1);et(()=>o(!0),[]);const a=r||s&&((i=globalThis==null?void 0:globalThis.document)==null?void 0:i.body);return a?Ge.createPortal(l.jsx(we.div,{...n,ref:t}),a):null});Xs.displayName=np;function sp(e,t){return m.useReducer((r,n)=>t[r][n]??r,e)}var us=e=>{const{present:t,children:r}=e,n=op(t),s=typeof r=="function"?r({present:n.isPresent}):m.Children.only(r),o=Ie(n.ref,ap(s));return typeof r=="function"||n.isPresent?m.cloneElement(s,{ref:o}):null};us.displayName="Presence";function op(e){const[t,r]=m.useState(),n=m.useRef(null),s=m.useRef(e),o=m.useRef("none"),a=e?"mounted":"unmounted",[i,c]=sp(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const d=Js(n.current);o.current=i==="mounted"?d:"none"},[i]),et(()=>{const d=n.current,u=s.current;if(u!==e){const v=o.current,f=Js(d);e?c("MOUNT"):f==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(u&&v!==f?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),et(()=>{if(t){let d;const u=t.ownerDocument.defaultView??window,h=f=>{const p=Js(n.current).includes(f.animationName);if(f.target===t&&p&&(c("ANIMATION_END"),!s.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",d=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},v=f=>{f.target===t&&(o.current=Js(n.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{u.clearTimeout(d),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:m.useCallback(d=>{n.current=d?getComputedStyle(d):null,r(d)},[])}}function Js(e){return(e==null?void 0:e.animationName)||"none"}function ap(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var ip=m[" useInsertionEffect ".trim().toString()]||et;function Rs({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[s,o,a]=lp({defaultProp:t,onChange:r}),i=e!==void 0,c=i?e:s;{const u=m.useRef(e!==void 0);m.useEffect(()=>{const h=u.current;h!==i&&console.warn(`${n} is changing from ${h?"controlled":"uncontrolled"} to ${i?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=i},[i,n])}const d=m.useCallback(u=>{var h;if(i){const v=cp(u)?u(e):u;v!==e&&((h=a.current)==null||h.call(a,v))}else o(u)},[i,e,o,a]);return[c,d]}function lp({defaultProp:e,onChange:t}){const[r,n]=m.useState(e),s=m.useRef(r),o=m.useRef(t);return ip(()=>{o.current=t},[t]),m.useEffect(()=>{var a;s.current!==r&&((a=o.current)==null||a.call(o,r),s.current=r)},[r,s]),[r,n,o]}function cp(e){return typeof e=="function"}var xl=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),dp="VisuallyHidden",eo=m.forwardRef((e,t)=>l.jsx(we.span,{...e,ref:t,style:{...xl,...e.style}}));eo.displayName=dp;var up=eo,aa="ToastProvider",[ia,fp,hp]=pl("Toast"),[_l,_C]=Rr("Toast",[hp]),[pp,to]=_l(aa),Cl=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:s="right",swipeThreshold:o=50,children:a}=e,[i,c]=m.useState(null),[d,u]=m.useState(0),h=m.useRef(!1),v=m.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${aa}\`. Expected non-empty \`string\`.`),l.jsx(ia.Provider,{scope:t,children:l.jsx(pp,{scope:t,label:r,duration:n,swipeDirection:s,swipeThreshold:o,toastCount:d,viewport:i,onViewportChange:c,onToastAdd:m.useCallback(()=>u(f=>f+1),[]),onToastRemove:m.useCallback(()=>u(f=>f-1),[]),isFocusedToastEscapeKeyDownRef:h,isClosePausedRef:v,children:a})})};Cl.displayName=aa;var Sl="ToastViewport",mp=["F8"],la="toast.viewportPause",ca="toast.viewportResume",kl=m.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=mp,label:s="Notifications ({hotkey})",...o}=e,a=to(Sl,r),i=fp(r),c=m.useRef(null),d=m.useRef(null),u=m.useRef(null),h=m.useRef(null),v=Ie(t,h,a.onViewportChange),f=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),b=a.toastCount>0;m.useEffect(()=>{const g=x=>{var w;n.length!==0&&n.every(k=>x[k]||x.code===k)&&((w=h.current)==null||w.focus())};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[n]),m.useEffect(()=>{const g=c.current,x=h.current;if(b&&g&&x){const y=()=>{if(!a.isClosePausedRef.current){const M=new CustomEvent(la);x.dispatchEvent(M),a.isClosePausedRef.current=!0}},w=()=>{if(a.isClosePausedRef.current){const M=new CustomEvent(ca);x.dispatchEvent(M),a.isClosePausedRef.current=!1}},k=M=>{!g.contains(M.relatedTarget)&&w()},E=()=>{g.contains(document.activeElement)||w()};return g.addEventListener("focusin",y),g.addEventListener("focusout",k),g.addEventListener("pointermove",y),g.addEventListener("pointerleave",E),window.addEventListener("blur",y),window.addEventListener("focus",w),()=>{g.removeEventListener("focusin",y),g.removeEventListener("focusout",k),g.removeEventListener("pointermove",y),g.removeEventListener("pointerleave",E),window.removeEventListener("blur",y),window.removeEventListener("focus",w)}}},[b,a.isClosePausedRef]);const p=m.useCallback(({tabbingDirection:g})=>{const y=i().map(w=>{const k=w.ref.current,E=[k,...Pp(k)];return g==="forwards"?E:E.reverse()});return(g==="forwards"?y.reverse():y).flat()},[i]);return m.useEffect(()=>{const g=h.current;if(g){const x=y=>{var E,M,T;const w=y.altKey||y.ctrlKey||y.metaKey;if(y.key==="Tab"&&!w){const O=document.activeElement,F=y.shiftKey;if(y.target===g&&F){(E=d.current)==null||E.focus();return}const D=p({tabbingDirection:F?"backwards":"forwards"}),U=D.findIndex(L=>L===O);fa(D.slice(U+1))?y.preventDefault():F?(M=d.current)==null||M.focus():(T=u.current)==null||T.focus()}};return g.addEventListener("keydown",x),()=>g.removeEventListener("keydown",x)}},[i,p]),l.jsxs(rp,{ref:c,role:"region","aria-label":s.replace("{hotkey}",f),tabIndex:-1,style:{pointerEvents:b?void 0:"none"},children:[b&&l.jsx(da,{ref:d,onFocusFromOutsideViewport:()=>{const g=p({tabbingDirection:"forwards"});fa(g)}}),l.jsx(ia.Slot,{scope:r,children:l.jsx(we.ol,{tabIndex:-1,...o,ref:v})}),b&&l.jsx(da,{ref:u,onFocusFromOutsideViewport:()=>{const g=p({tabbingDirection:"backwards"});fa(g)}})]})});kl.displayName=Sl;var Nl="ToastFocusProxy",da=m.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...s}=e,o=to(Nl,r);return l.jsx(eo,{"aria-hidden":!0,tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:a=>{var d;const i=a.relatedTarget;!((d=o.viewport)!=null&&d.contains(i))&&n()}})});da.displayName=Nl;var fs="Toast",vp="toast.swipeStart",gp="toast.swipeMove",yp="toast.swipeCancel",bp="toast.swipeEnd",El=m.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:s,onOpenChange:o,...a}=e,[i,c]=Rs({prop:n,defaultProp:s??!0,onChange:o,caller:fs});return l.jsx(us,{present:r||i,children:l.jsx(_p,{open:i,...a,ref:t,onClose:()=>c(!1),onPause:Et(e.onPause),onResume:Et(e.onResume),onSwipeStart:ie(e.onSwipeStart,d=>{d.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ie(e.onSwipeMove,d=>{const{x:u,y:h}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","move"),d.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${h}px`)}),onSwipeCancel:ie(e.onSwipeCancel,d=>{d.currentTarget.setAttribute("data-swipe","cancel"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:ie(e.onSwipeEnd,d=>{const{x:u,y:h}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","end"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${h}px`),c(!1)})})})});El.displayName=fs;var[wp,xp]=_l(fs,{onClose(){}}),_p=m.forwardRef((e,t)=>{const{__scopeToast:r,type:n="foreground",duration:s,open:o,onClose:a,onEscapeKeyDown:i,onPause:c,onResume:d,onSwipeStart:u,onSwipeMove:h,onSwipeCancel:v,onSwipeEnd:f,...b}=e,p=to(fs,r),[g,x]=m.useState(null),y=Ie(t,L=>x(L)),w=m.useRef(null),k=m.useRef(null),E=s||p.duration,M=m.useRef(0),T=m.useRef(E),O=m.useRef(0),{onToastAdd:F,onToastRemove:W}=p,G=Et(()=>{var J;(g==null?void 0:g.contains(document.activeElement))&&((J=p.viewport)==null||J.focus()),a()}),D=m.useCallback(L=>{!L||L===1/0||(window.clearTimeout(O.current),M.current=new Date().getTime(),O.current=window.setTimeout(G,L))},[G]);m.useEffect(()=>{const L=p.viewport;if(L){const J=()=>{D(T.current),d==null||d()},Y=()=>{const I=new Date().getTime()-M.current;T.current=T.current-I,window.clearTimeout(O.current),c==null||c()};return L.addEventListener(la,Y),L.addEventListener(ca,J),()=>{L.removeEventListener(la,Y),L.removeEventListener(ca,J)}}},[p.viewport,E,c,d,D]),m.useEffect(()=>{o&&!p.isClosePausedRef.current&&D(E)},[o,E,p.isClosePausedRef,D]),m.useEffect(()=>(F(),()=>W()),[F,W]);const U=m.useMemo(()=>g?Il(g):null,[g]);return p.viewport?l.jsxs(l.Fragment,{children:[U&&l.jsx(Cp,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:U}),l.jsx(wp,{scope:r,onClose:G,children:ls.createPortal(l.jsx(ia.ItemSlot,{scope:r,children:l.jsx(tp,{asChild:!0,onEscapeKeyDown:ie(i,()=>{p.isFocusedToastEscapeKeyDownRef.current||G(),p.isFocusedToastEscapeKeyDownRef.current=!1}),children:l.jsx(we.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":p.swipeDirection,...b,ref:y,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:ie(e.onKeyDown,L=>{L.key==="Escape"&&(i==null||i(L.nativeEvent),L.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,G()))}),onPointerDown:ie(e.onPointerDown,L=>{L.button===0&&(w.current={x:L.clientX,y:L.clientY})}),onPointerMove:ie(e.onPointerMove,L=>{if(!w.current)return;const J=L.clientX-w.current.x,Y=L.clientY-w.current.y,I=!!k.current,A=["left","right"].includes(p.swipeDirection),B=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,ae=A?B(0,J):0,Se=A?0:B(0,Y),de=L.pointerType==="touch"?10:2,ue={x:ae,y:Se},pe={originalEvent:L,delta:ue};I?(k.current=ue,ro(gp,h,pe,{discrete:!1})):Fl(ue,p.swipeDirection,de)?(k.current=ue,ro(vp,u,pe,{discrete:!1}),L.target.setPointerCapture(L.pointerId)):(Math.abs(J)>de||Math.abs(Y)>de)&&(w.current=null)}),onPointerUp:ie(e.onPointerUp,L=>{const J=k.current,Y=L.target;if(Y.hasPointerCapture(L.pointerId)&&Y.releasePointerCapture(L.pointerId),k.current=null,w.current=null,J){const I=L.currentTarget,A={originalEvent:L,delta:J};Fl(J,p.swipeDirection,p.swipeThreshold)?ro(bp,f,A,{discrete:!0}):ro(yp,v,A,{discrete:!0}),I.addEventListener("click",B=>B.preventDefault(),{once:!0})}})})})}),p.viewport)})]}):null}),Cp=e=>{const{__scopeToast:t,children:r,...n}=e,s=to(fs,t),[o,a]=m.useState(!1),[i,c]=m.useState(!1);return Np(()=>a(!0)),m.useEffect(()=>{const d=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(d)},[]),i?null:l.jsx(Xs,{asChild:!0,children:l.jsx(eo,{...n,children:o&&l.jsxs(l.Fragment,{children:[s.label," ",r]})})})},Sp="ToastTitle",Pl=m.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return l.jsx(we.div,{...n,ref:t})});Pl.displayName=Sp;var kp="ToastDescription",Tl=m.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return l.jsx(we.div,{...n,ref:t})});Tl.displayName=kp;var Ol="ToastAction",Ml=m.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?l.jsx(Dl,{altText:r,asChild:!0,children:l.jsx(ua,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Ol}\`. Expected non-empty \`string\`.`),null)});Ml.displayName=Ol;var Al="ToastClose",ua=m.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,s=xp(Al,r);return l.jsx(Dl,{asChild:!0,children:l.jsx(we.button,{type:"button",...n,ref:t,onClick:ie(e.onClick,s.onClose)})})});ua.displayName=Al;var Dl=m.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...s}=e;return l.jsx(we.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...s,ref:t})});function Il(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),Ep(n)){const s=n.ariaHidden||n.hidden||n.style.display==="none",o=n.dataset.radixToastAnnounceExclude==="";if(!s)if(o){const a=n.dataset.radixToastAnnounceAlt;a&&t.push(a)}else t.push(...Il(n))}}),t}function ro(e,t,r,{discrete:n}){const s=r.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?ml(s,o):s.dispatchEvent(o)}var Fl=(e,t,r=0)=>{const n=Math.abs(e.x),s=Math.abs(e.y),o=n>s;return t==="left"||t==="right"?o&&n>r:!o&&s>r};function Np(e=()=>{}){const t=Et(e);et(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function Ep(e){return e.nodeType===e.ELEMENT_NODE}function Pp(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function fa(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var Tp=Cl,Ll=kl,Vl=El,$l=Pl,Bl=Tl,Wl=Ml,jl=ua;function Ul(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=Ul(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Hl(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=Ul(e))&&(n&&(n+=" "),n+=t);return n}const zl=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Yl=Hl,ha=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return Yl(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:o}=t,a=Object.keys(s).map(d=>{const u=r==null?void 0:r[d],h=o==null?void 0:o[d];if(u===null)return null;const v=zl(u)||zl(h);return s[d][v]}),i=r&&Object.entries(r).reduce((d,u)=>{let[h,v]=u;return v===void 0||(d[h]=v),d},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((d,u)=>{let{class:h,className:v,...f}=u;return Object.entries(f).every(b=>{let[p,g]=b;return Array.isArray(g)?g.includes({...o,...i}[p]):{...o,...i}[p]===g})?[...d,h,v]:d},[]);return Yl(e,a,c,r==null?void 0:r.class,r==null?void 0:r.className)};/**
2
2
  * @license lucide-react v0.462.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -98,9 +98,9 @@
98
98
  *
99
99
  * This source code is licensed under the ISC license.
100
100
  * See the LICENSE file in the root directory of this source tree.
101
- */const Jl=tt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),pa="-",Hp=e=>{const t=Yp(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:a=>{const i=a.split(pa);return i[0]===""&&i.length!==1&&i.shift(),Rl(i,t)||zp(a)},getConflictingClassGroupIds:(a,i)=>{const c=r[a]||[];return i&&n[a]?[...c,...n[a]]:c}}},Rl=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),s=n?Rl(e.slice(1),n):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(pa);return(a=t.validators.find(({validator:i})=>i(o)))==null?void 0:a.classGroupId},ec=/^\[(.+)\]$/,zp=e=>{if(ec.test(e)){const t=ec.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Yp=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return Zp(Object.entries(e.classGroups),r).forEach(([o,a])=>{ma(a,n,o,t)}),n},ma=(e,t,r,n)=>{e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:tc(t,s);o.classGroupId=r;return}if(typeof s=="function"){if(qp(s)){ma(s(n),t,r,n);return}t.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([o,a])=>{ma(a,tc(t,o),r,n)})})},tc=(e,t)=>{let r=e;return t.split(pa).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},qp=e=>e.isThemeGetter,Zp=(e,t)=>t?e.map(([r,n])=>{const s=n.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,i])=>[t+a,i])):o);return[r,s]}):e,Kp=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const s=(o,a)=>{r.set(o,a),t++,t>e&&(t=0,n=r,r=new Map)};return{get(o){let a=r.get(o);if(a!==void 0)return a;if((a=n.get(o))!==void 0)return s(o,a),a},set(o,a){r.has(o)?r.set(o,a):s(o,a)}}},rc="!",Qp=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,s=t[0],o=t.length,a=i=>{const c=[];let d=0,u=0,h;for(let g=0;g<i.length;g++){let x=i[g];if(d===0){if(x===s&&(n||i.slice(g,g+o)===t)){c.push(i.slice(u,g)),u=g+o;continue}if(x==="/"){h=g;continue}}x==="["?d++:x==="]"&&d--}const v=c.length===0?i:i.substring(u),f=v.startsWith(rc),b=f?v.substring(1):v,p=h&&h>u?h-u:void 0;return{modifiers:c,hasImportantModifier:f,baseClassName:b,maybePostfixModifierPosition:p}};return r?i=>r({className:i,parseClassName:a}):a},Gp=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},Xp=e=>({cache:Kp(e.cacheSize),parseClassName:Qp(e),...Hp(e)}),Jp=/\s+/,Rp=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=t,o=[],a=e.trim().split(Jp);let i="";for(let c=a.length-1;c>=0;c-=1){const d=a[c],{modifiers:u,hasImportantModifier:h,baseClassName:v,maybePostfixModifierPosition:f}=r(d);let b=!!f,p=n(b?v.substring(0,f):v);if(!p){if(!b){i=d+(i.length>0?" "+i:i);continue}if(p=n(v),!p){i=d+(i.length>0?" "+i:i);continue}b=!1}const g=Gp(u).join(":"),x=h?g+rc:g,y=x+p;if(o.includes(y))continue;o.push(y);const w=s(p,b);for(let k=0;k<w.length;++k){const E=w[k];o.push(x+E)}i=d+(i.length>0?" "+i:i)}return i};function em(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=nc(t))&&(n&&(n+=" "),n+=r);return n}const nc=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=nc(e[n]))&&(r&&(r+=" "),r+=t);return r};function tm(e,...t){let r,n,s,o=a;function a(c){const d=t.reduce((u,h)=>h(u),e());return r=Xp(d),n=r.cache.get,s=r.cache.set,o=i,i(c)}function i(c){const d=n(c);if(d)return d;const u=Rp(c,r);return s(c,u),u}return function(){return o(em.apply(null,arguments))}}const De=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},sc=/^\[(?:([a-z-]+):)?(.+)\]$/i,rm=/^\d+\/\d+$/,nm=new Set(["px","full","screen"]),sm=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,om=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,am=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,im=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,lm=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,nr=e=>Sn(e)||nm.has(e)||rm.test(e),wr=e=>kn(e,"length",vm),Sn=e=>!!e&&!Number.isNaN(Number(e)),va=e=>kn(e,"number",Sn),hs=e=>!!e&&Number.isInteger(Number(e)),cm=e=>e.endsWith("%")&&Sn(e.slice(0,-1)),le=e=>sc.test(e),xr=e=>sm.test(e),dm=new Set(["length","size","percentage"]),um=e=>kn(e,dm,oc),fm=e=>kn(e,"position",oc),hm=new Set(["image","url"]),pm=e=>kn(e,hm,ym),mm=e=>kn(e,"",gm),ps=()=>!0,kn=(e,t,r)=>{const n=sc.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},vm=e=>om.test(e)&&!am.test(e),oc=()=>!1,gm=e=>im.test(e),ym=e=>lm.test(e),bm=tm(()=>{const e=De("colors"),t=De("spacing"),r=De("blur"),n=De("brightness"),s=De("borderColor"),o=De("borderRadius"),a=De("borderSpacing"),i=De("borderWidth"),c=De("contrast"),d=De("grayscale"),u=De("hueRotate"),h=De("invert"),v=De("gap"),f=De("gradientColorStops"),b=De("gradientColorStopPositions"),p=De("inset"),g=De("margin"),x=De("opacity"),y=De("padding"),w=De("saturate"),k=De("scale"),E=De("sepia"),M=De("skew"),O=De("space"),P=De("translate"),F=()=>["auto","contain","none"],W=()=>["auto","hidden","clip","visible","scroll"],G=()=>["auto",le,t],D=()=>[le,t],U=()=>["",nr,wr],L=()=>["auto",Sn,le],J=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Y=()=>["solid","dashed","dotted","double","none"],I=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],A=()=>["start","end","center","between","around","evenly","stretch"],B=()=>["","0",le],ae=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Se=()=>[Sn,le];return{cacheSize:500,separator:":",theme:{colors:[ps],spacing:[nr,wr],blur:["none","",xr,le],brightness:Se(),borderColor:[e],borderRadius:["none","","full",xr,le],borderSpacing:D(),borderWidth:U(),contrast:Se(),grayscale:B(),hueRotate:Se(),invert:B(),gap:D(),gradientColorStops:[e],gradientColorStopPositions:[cm,wr],inset:G(),margin:G(),opacity:Se(),padding:D(),saturate:Se(),scale:Se(),sepia:B(),skew:Se(),space:D(),translate:D()},classGroups:{aspect:[{aspect:["auto","square","video",le]}],container:["container"],columns:[{columns:[xr]}],"break-after":[{"break-after":ae()}],"break-before":[{"break-before":ae()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...J(),le]}],overflow:[{overflow:W()}],"overflow-x":[{"overflow-x":W()}],"overflow-y":[{"overflow-y":W()}],overscroll:[{overscroll:F()}],"overscroll-x":[{"overscroll-x":F()}],"overscroll-y":[{"overscroll-y":F()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",hs,le]}],basis:[{basis:G()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",le]}],grow:[{grow:B()}],shrink:[{shrink:B()}],order:[{order:["first","last","none",hs,le]}],"grid-cols":[{"grid-cols":[ps]}],"col-start-end":[{col:["auto",{span:["full",hs,le]},le]}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":[ps]}],"row-start-end":[{row:["auto",{span:[hs,le]},le]}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",le]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",le]}],gap:[{gap:[v]}],"gap-x":[{"gap-x":[v]}],"gap-y":[{"gap-y":[v]}],"justify-content":[{justify:["normal",...A()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...A(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...A(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[O]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[O]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",le,t]}],"min-w":[{"min-w":[le,t,"min","max","fit"]}],"max-w":[{"max-w":[le,t,"none","full","min","max","fit","prose",{screen:[xr]},xr]}],h:[{h:[le,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[le,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[le,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[le,t,"auto","min","max","fit"]}],"font-size":[{text:["base",xr,wr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",va]}],"font-family":[{font:[ps]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",le]}],"line-clamp":[{"line-clamp":["none",Sn,va]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",nr,le]}],"list-image":[{"list-image":["none",le]}],"list-style-type":[{list:["none","disc","decimal",le]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Y(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",nr,wr]}],"underline-offset":[{"underline-offset":["auto",nr,le]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",le]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",le]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...J(),fm]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",um]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},pm]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[f]}],"gradient-via":[{via:[f]}],"gradient-to":[{to:[f]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[i]}],"border-w-x":[{"border-x":[i]}],"border-w-y":[{"border-y":[i]}],"border-w-s":[{"border-s":[i]}],"border-w-e":[{"border-e":[i]}],"border-w-t":[{"border-t":[i]}],"border-w-r":[{"border-r":[i]}],"border-w-b":[{"border-b":[i]}],"border-w-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[x]}],"border-style":[{border:[...Y(),"hidden"]}],"divide-x":[{"divide-x":[i]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[i]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[x]}],"divide-style":[{divide:Y()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...Y()]}],"outline-offset":[{"outline-offset":[nr,le]}],"outline-w":[{outline:[nr,wr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[nr,wr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",xr,mm]}],"shadow-color":[{shadow:[ps]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...I(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":I()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",xr,le]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[h]}],saturate:[{saturate:[w]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",le]}],duration:[{duration:Se()}],ease:[{ease:["linear","in","out","in-out",le]}],delay:[{delay:Se()}],animate:[{animate:["none","spin","ping","pulse","bounce",le]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[k]}],"scale-x":[{"scale-x":[k]}],"scale-y":[{"scale-y":[k]}],rotate:[{rotate:[hs,le]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[M]}],"skew-y":[{"skew-y":[M]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",le]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",le]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",le]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[nr,wr,va]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}});function he(...e){return bm(Hl(e))}const wm=Tp,ac=m.forwardRef(({className:e,...t},r)=>l.jsx(Ll,{ref:r,className:he("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));ac.displayName=Ll.displayName;const xm=ha("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),ic=m.forwardRef(({className:e,variant:t,...r},n)=>l.jsx(Vl,{ref:n,className:he(xm({variant:t}),e),...r}));ic.displayName=Vl.displayName;const _m=m.forwardRef(({className:e,...t},r)=>l.jsx(Wl,{ref:r,className:he("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));_m.displayName=Wl.displayName;const lc=m.forwardRef(({className:e,...t},r)=>l.jsx(jl,{ref:r,className:he("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:l.jsx(Jl,{className:"h-4 w-4"})}));lc.displayName=jl.displayName;const cc=m.forwardRef(({className:e,...t},r)=>l.jsx($l,{ref:r,className:he("text-sm font-semibold",e),...t}));cc.displayName=$l.displayName;const dc=m.forwardRef(({className:e,...t},r)=>l.jsx(Bl,{ref:r,className:he("text-sm opacity-90",e),...t}));dc.displayName=Bl.displayName;function Cm(){const{toasts:e}=Gs();return l.jsxs(wm,{children:[e.map(function({id:t,title:r,description:n,action:s,...o}){return l.jsxs(ic,{...o,children:[l.jsxs("div",{className:"grid gap-1",children:[r&&l.jsx(cc,{children:r}),n&&l.jsx(dc,{children:n})]}),s,l.jsx(lc,{})]},t)}),l.jsx(ac,{})]})}var uc=["light","dark"],Sm="(prefers-color-scheme: dark)",km=m.createContext(void 0),Nm={setTheme:e=>{},themes:[]},Em=()=>{var e;return(e=m.useContext(km))!=null?e:Nm};m.memo(({forcedTheme:e,storageKey:t,attribute:r,enableSystem:n,enableColorScheme:s,defaultTheme:o,value:a,attrs:i,nonce:c})=>{let d=o==="system",u=r==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${i.map(b=>`'${b}'`).join(",")})`};`:`var d=document.documentElement,n='${r}',s='setAttribute';`,h=s?uc.includes(o)&&o?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${o}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",v=(b,p=!1,g=!0)=>{let x=a?a[b]:b,y=p?b+"|| ''":`'${x}'`,w="";return s&&g&&!p&&uc.includes(b)&&(w+=`d.style.colorScheme = '${b}';`),r==="class"?p||x?w+=`c.add(${y})`:w+="null":x&&(w+=`d[s](n,${y})`),w},f=e?`!function(){${u}${v(e)}}()`:n?`!function(){try{${u}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${d})){var t='${Sm}',m=window.matchMedia(t);if(m.media!==t||m.matches){${v("dark")}}else{${v("light")}}}else if(e){${a?`var x=${JSON.stringify(a)};`:""}${v(a?"x[e]":"e",!0)}}${d?"":"else{"+v(o,!1,!1)+"}"}${h}}catch(e){}}()`:`!function(){try{${u}var e=localStorage.getItem('${t}');if(e){${a?`var x=${JSON.stringify(a)};`:""}${v(a?"x[e]":"e",!0)}}else{${v(o,!1,!1)};}${h}}catch(t){}}();`;return m.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:f}})});var Pm=e=>{switch(e){case"success":return Mm;case"info":return Dm;case"warning":return Am;case"error":return Im;default:return null}},Tm=Array(12).fill(0),Om=({visible:e,className:t})=>S.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},S.createElement("div",{className:"sonner-spinner"},Tm.map((r,n)=>S.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),Mm=S.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},S.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Am=S.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},S.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Dm=S.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},S.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Im=S.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},S.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Fm=S.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},S.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),S.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Lm=()=>{let[e,t]=S.useState(document.hidden);return S.useEffect(()=>{let r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e},ga=1,Vm=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:r,...n}=e,s=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:ga++,o=this.toasts.find(i=>i.id===s),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),o?this.toasts=this.toasts.map(i=>i.id===s?(this.publish({...i,...e,id:s,title:r}),{...i,...e,id:s,dismissible:a,title:r}):i):this.addToast({title:r,...n,dismissible:a,id:s}),s},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(r=>r({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let n=e instanceof Promise?e:e(),s=r!==void 0,o,a=n.then(async c=>{if(o=["resolve",c],S.isValidElement(c))s=!1,this.create({id:r,type:"default",message:c});else if(Bm(c)&&!c.ok){s=!1;let d=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,u=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:r,type:"error",message:d,description:u})}else if(t.success!==void 0){s=!1;let d=typeof t.success=="function"?await t.success(c):t.success,u=typeof t.description=="function"?await t.description(c):t.description;this.create({id:r,type:"success",message:d,description:u})}}).catch(async c=>{if(o=["reject",c],t.error!==void 0){s=!1;let d=typeof t.error=="function"?await t.error(c):t.error,u=typeof t.description=="function"?await t.description(c):t.description;this.create({id:r,type:"error",message:d,description:u})}}).finally(()=>{var c;s&&(this.dismiss(r),r=void 0),(c=t.finally)==null||c.call(t)}),i=()=>new Promise((c,d)=>a.then(()=>o[0]==="reject"?d(o[1]):c(o[1])).catch(d));return typeof r!="string"&&typeof r!="number"?{unwrap:i}:Object.assign(r,{unwrap:i})},this.custom=(e,t)=>{let r=(t==null?void 0:t.id)||ga++;return this.create({jsx:e(r),id:r,...t}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},ut=new Vm,$m=(e,t)=>{let r=(t==null?void 0:t.id)||ga++;return ut.addToast({title:e,...t,id:r}),r},Bm=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Wm=$m,jm=()=>ut.toasts,Um=()=>ut.getActiveToasts();Object.assign(Wm,{success:ut.success,info:ut.info,warning:ut.warning,error:ut.error,custom:ut.custom,message:ut.message,promise:ut.promise,dismiss:ut.dismiss,loading:ut.loading},{getHistory:jm,getToasts:Um});function Hm(e,{insertAt:t}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}Hm(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
102
- `);function no(e){return e.label!==void 0}var zm=3,Ym="32px",qm="16px",fc=4e3,Zm=356,Km=14,Qm=20,Gm=200;function Pt(...e){return e.filter(Boolean).join(" ")}function Xm(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}var Jm=e=>{var t,r,n,s,o,a,i,c,d,u,h;let{invert:v,toast:f,unstyled:b,interacting:p,setHeights:g,visibleToasts:x,heights:y,index:w,toasts:k,expanded:E,removeToast:M,defaultRichColors:O,closeButton:P,style:F,cancelButtonStyle:W,actionButtonStyle:G,className:D="",descriptionClassName:U="",duration:L,position:J,gap:Y,loadingIcon:I,expandByDefault:A,classNames:B,icons:ae,closeButtonAriaLabel:Se="Close toast",pauseWhenPageIsHidden:de}=e,[ue,pe]=S.useState(null),[Fe,rt]=S.useState(null),[q,ke]=S.useState(!1),[Ae,ye]=S.useState(!1),[me,be]=S.useState(!1),[Re,dt]=S.useState(!1),[Rt,er]=S.useState(!1),[mr,is]=S.useState(0),[vr,C]=S.useState(0),N=S.useRef(f.duration||L||fc),T=S.useRef(null),H=S.useRef(null),j=w===0,$=w+1<=x,Q=f.type,ve=f.dismissible!==!1,Te=f.className||"",yt=f.descriptionClassName||"",gr=S.useMemo(()=>y.findIndex(oe=>oe.toastId===f.id)||0,[y,f.id]),tr=S.useMemo(()=>{var oe;return(oe=f.closeButton)!=null?oe:P},[f.closeButton,P]),Jo=S.useMemo(()=>f.duration||L||fc,[f.duration,L]),xn=S.useRef(0),rr=S.useRef(0),Ro=S.useRef(0),yr=S.useRef(null),[Ji,ea]=J.split("-"),Ah=S.useMemo(()=>y.reduce((oe,Oe,Le)=>Le>=gr?oe:oe+Oe.height,0),[y,gr]),Dh=Lm(),bC=f.invert||v,Ri=Q==="loading";rr.current=S.useMemo(()=>gr*Y+Ah,[gr,Ah]),S.useEffect(()=>{N.current=Jo},[Jo]),S.useEffect(()=>{ke(!0)},[]),S.useEffect(()=>{let oe=H.current;if(oe){let Oe=oe.getBoundingClientRect().height;return C(Oe),g(Le=>[{toastId:f.id,height:Oe,position:f.position},...Le]),()=>g(Le=>Le.filter($t=>$t.toastId!==f.id))}},[g,f.id]),S.useLayoutEffect(()=>{if(!q)return;let oe=H.current,Oe=oe.style.height;oe.style.height="auto";let Le=oe.getBoundingClientRect().height;oe.style.height=Oe,C(Le),g($t=>$t.find(Bt=>Bt.toastId===f.id)?$t.map(Bt=>Bt.toastId===f.id?{...Bt,height:Le}:Bt):[{toastId:f.id,height:Le,position:f.position},...$t])},[q,f.title,f.description,g,f.id]);let Kr=S.useCallback(()=>{ye(!0),is(rr.current),g(oe=>oe.filter(Oe=>Oe.toastId!==f.id)),setTimeout(()=>{M(f)},Gm)},[f,M,g,rr]);S.useEffect(()=>{if(f.promise&&Q==="loading"||f.duration===1/0||f.type==="loading")return;let oe;return E||p||de&&Dh?(()=>{if(Ro.current<xn.current){let Oe=new Date().getTime()-xn.current;N.current=N.current-Oe}Ro.current=new Date().getTime()})():N.current!==1/0&&(xn.current=new Date().getTime(),oe=setTimeout(()=>{var Oe;(Oe=f.onAutoClose)==null||Oe.call(f,f),Kr()},N.current)),()=>clearTimeout(oe)},[E,p,f,Q,de,Dh,Kr]),S.useEffect(()=>{f.delete&&Kr()},[Kr,f.delete]);function wC(){var oe,Oe,Le;return ae!=null&&ae.loading?S.createElement("div",{className:Pt(B==null?void 0:B.loader,(oe=f==null?void 0:f.classNames)==null?void 0:oe.loader,"sonner-loader"),"data-visible":Q==="loading"},ae.loading):I?S.createElement("div",{className:Pt(B==null?void 0:B.loader,(Oe=f==null?void 0:f.classNames)==null?void 0:Oe.loader,"sonner-loader"),"data-visible":Q==="loading"},I):S.createElement(Om,{className:Pt(B==null?void 0:B.loader,(Le=f==null?void 0:f.classNames)==null?void 0:Le.loader),visible:Q==="loading"})}return S.createElement("li",{tabIndex:0,ref:H,className:Pt(D,Te,B==null?void 0:B.toast,(t=f==null?void 0:f.classNames)==null?void 0:t.toast,B==null?void 0:B.default,B==null?void 0:B[Q],(r=f==null?void 0:f.classNames)==null?void 0:r[Q]),"data-sonner-toast":"","data-rich-colors":(n=f.richColors)!=null?n:O,"data-styled":!(f.jsx||f.unstyled||b),"data-mounted":q,"data-promise":!!f.promise,"data-swiped":Rt,"data-removed":Ae,"data-visible":$,"data-y-position":Ji,"data-x-position":ea,"data-index":w,"data-front":j,"data-swiping":me,"data-dismissible":ve,"data-type":Q,"data-invert":bC,"data-swipe-out":Re,"data-swipe-direction":Fe,"data-expanded":!!(E||A&&q),style:{"--index":w,"--toasts-before":w,"--z-index":k.length-w,"--offset":`${Ae?mr:rr.current}px`,"--initial-height":A?"auto":`${vr}px`,...F,...f.style},onDragEnd:()=>{be(!1),pe(null),yr.current=null},onPointerDown:oe=>{Ri||!ve||(T.current=new Date,is(rr.current),oe.target.setPointerCapture(oe.pointerId),oe.target.tagName!=="BUTTON"&&(be(!0),yr.current={x:oe.clientX,y:oe.clientY}))},onPointerUp:()=>{var oe,Oe,Le,$t;if(Re||!ve)return;yr.current=null;let Bt=Number(((oe=H.current)==null?void 0:oe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Qr=Number(((Oe=H.current)==null?void 0:Oe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),_n=new Date().getTime()-((Le=T.current)==null?void 0:Le.getTime()),Wt=ue==="x"?Bt:Qr,Gr=Math.abs(Wt)/_n;if(Math.abs(Wt)>=Qm||Gr>.11){is(rr.current),($t=f.onDismiss)==null||$t.call(f,f),rt(ue==="x"?Bt>0?"right":"left":Qr>0?"down":"up"),Kr(),dt(!0),er(!1);return}be(!1),pe(null)},onPointerMove:oe=>{var Oe,Le,$t,Bt;if(!yr.current||!ve||((Oe=window.getSelection())==null?void 0:Oe.toString().length)>0)return;let Qr=oe.clientY-yr.current.y,_n=oe.clientX-yr.current.x,Wt=(Le=e.swipeDirections)!=null?Le:Xm(J);!ue&&(Math.abs(_n)>1||Math.abs(Qr)>1)&&pe(Math.abs(_n)>Math.abs(Qr)?"x":"y");let Gr={x:0,y:0};ue==="y"?(Wt.includes("top")||Wt.includes("bottom"))&&(Wt.includes("top")&&Qr<0||Wt.includes("bottom")&&Qr>0)&&(Gr.y=Qr):ue==="x"&&(Wt.includes("left")||Wt.includes("right"))&&(Wt.includes("left")&&_n<0||Wt.includes("right")&&_n>0)&&(Gr.x=_n),(Math.abs(Gr.x)>0||Math.abs(Gr.y)>0)&&er(!0),($t=H.current)==null||$t.style.setProperty("--swipe-amount-x",`${Gr.x}px`),(Bt=H.current)==null||Bt.style.setProperty("--swipe-amount-y",`${Gr.y}px`)}},tr&&!f.jsx?S.createElement("button",{"aria-label":Se,"data-disabled":Ri,"data-close-button":!0,onClick:Ri||!ve?()=>{}:()=>{var oe;Kr(),(oe=f.onDismiss)==null||oe.call(f,f)},className:Pt(B==null?void 0:B.closeButton,(s=f==null?void 0:f.classNames)==null?void 0:s.closeButton)},(o=ae==null?void 0:ae.close)!=null?o:Fm):null,f.jsx||S.isValidElement(f.title)?f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title:S.createElement(S.Fragment,null,Q||f.icon||f.promise?S.createElement("div",{"data-icon":"",className:Pt(B==null?void 0:B.icon,(a=f==null?void 0:f.classNames)==null?void 0:a.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||wC():null,f.type!=="loading"?f.icon||(ae==null?void 0:ae[Q])||Pm(Q):null):null,S.createElement("div",{"data-content":"",className:Pt(B==null?void 0:B.content,(i=f==null?void 0:f.classNames)==null?void 0:i.content)},S.createElement("div",{"data-title":"",className:Pt(B==null?void 0:B.title,(c=f==null?void 0:f.classNames)==null?void 0:c.title)},typeof f.title=="function"?f.title():f.title),f.description?S.createElement("div",{"data-description":"",className:Pt(U,yt,B==null?void 0:B.description,(d=f==null?void 0:f.classNames)==null?void 0:d.description)},typeof f.description=="function"?f.description():f.description):null),S.isValidElement(f.cancel)?f.cancel:f.cancel&&no(f.cancel)?S.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||W,onClick:oe=>{var Oe,Le;no(f.cancel)&&ve&&((Le=(Oe=f.cancel).onClick)==null||Le.call(Oe,oe),Kr())},className:Pt(B==null?void 0:B.cancelButton,(u=f==null?void 0:f.classNames)==null?void 0:u.cancelButton)},f.cancel.label):null,S.isValidElement(f.action)?f.action:f.action&&no(f.action)?S.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||G,onClick:oe=>{var Oe,Le;no(f.action)&&((Le=(Oe=f.action).onClick)==null||Le.call(Oe,oe),!oe.defaultPrevented&&Kr())},className:Pt(B==null?void 0:B.actionButton,(h=f==null?void 0:f.classNames)==null?void 0:h.actionButton)},f.action.label):null))};function hc(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Rm(e,t){let r={};return[e,t].forEach((n,s)=>{let o=s===1,a=o?"--mobile-offset":"--offset",i=o?qm:Ym;function c(d){["top","right","bottom","left"].forEach(u=>{r[`${a}-${u}`]=typeof d=="number"?`${d}px`:d})}typeof n=="number"||typeof n=="string"?c(n):typeof n=="object"?["top","right","bottom","left"].forEach(d=>{n[d]===void 0?r[`${a}-${d}`]=i:r[`${a}-${d}`]=typeof n[d]=="number"?`${n[d]}px`:n[d]}):c(i)}),r}var ev=S.forwardRef(function(e,t){let{invert:r,position:n="bottom-right",hotkey:s=["altKey","KeyT"],expand:o,closeButton:a,className:i,offset:c,mobileOffset:d,theme:u="light",richColors:h,duration:v,style:f,visibleToasts:b=zm,toastOptions:p,dir:g=hc(),gap:x=Km,loadingIcon:y,icons:w,containerAriaLabel:k="Notifications",pauseWhenPageIsHidden:E}=e,[M,O]=S.useState([]),P=S.useMemo(()=>Array.from(new Set([n].concat(M.filter(de=>de.position).map(de=>de.position)))),[M,n]),[F,W]=S.useState([]),[G,D]=S.useState(!1),[U,L]=S.useState(!1),[J,Y]=S.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),I=S.useRef(null),A=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),B=S.useRef(null),ae=S.useRef(!1),Se=S.useCallback(de=>{O(ue=>{var pe;return(pe=ue.find(Fe=>Fe.id===de.id))!=null&&pe.delete||ut.dismiss(de.id),ue.filter(({id:Fe})=>Fe!==de.id)})},[]);return S.useEffect(()=>ut.subscribe(de=>{if(de.dismiss){O(ue=>ue.map(pe=>pe.id===de.id?{...pe,delete:!0}:pe));return}setTimeout(()=>{Ge.flushSync(()=>{O(ue=>{let pe=ue.findIndex(Fe=>Fe.id===de.id);return pe!==-1?[...ue.slice(0,pe),{...ue[pe],...de},...ue.slice(pe+1)]:[de,...ue]})})})}),[]),S.useEffect(()=>{if(u!=="system"){Y(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Y("dark"):Y("light")),typeof window>"u")return;let de=window.matchMedia("(prefers-color-scheme: dark)");try{de.addEventListener("change",({matches:ue})=>{Y(ue?"dark":"light")})}catch{de.addListener(({matches:pe})=>{try{Y(pe?"dark":"light")}catch(Fe){console.error(Fe)}})}},[u]),S.useEffect(()=>{M.length<=1&&D(!1)},[M]),S.useEffect(()=>{let de=ue=>{var pe,Fe;s.every(rt=>ue[rt]||ue.code===rt)&&(D(!0),(pe=I.current)==null||pe.focus()),ue.code==="Escape"&&(document.activeElement===I.current||(Fe=I.current)!=null&&Fe.contains(document.activeElement))&&D(!1)};return document.addEventListener("keydown",de),()=>document.removeEventListener("keydown",de)},[s]),S.useEffect(()=>{if(I.current)return()=>{B.current&&(B.current.focus({preventScroll:!0}),B.current=null,ae.current=!1)}},[I.current]),S.createElement("section",{ref:t,"aria-label":`${k} ${A}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},P.map((de,ue)=>{var pe;let[Fe,rt]=de.split("-");return M.length?S.createElement("ol",{key:de,dir:g==="auto"?hc():g,tabIndex:-1,ref:I,className:i,"data-sonner-toaster":!0,"data-theme":J,"data-y-position":Fe,"data-lifted":G&&M.length>1&&!o,"data-x-position":rt,style:{"--front-toast-height":`${((pe=F[0])==null?void 0:pe.height)||0}px`,"--width":`${Zm}px`,"--gap":`${x}px`,...f,...Rm(c,d)},onBlur:q=>{ae.current&&!q.currentTarget.contains(q.relatedTarget)&&(ae.current=!1,B.current&&(B.current.focus({preventScroll:!0}),B.current=null))},onFocus:q=>{q.target instanceof HTMLElement&&q.target.dataset.dismissible==="false"||ae.current||(ae.current=!0,B.current=q.relatedTarget)},onMouseEnter:()=>D(!0),onMouseMove:()=>D(!0),onMouseLeave:()=>{U||D(!1)},onDragEnd:()=>D(!1),onPointerDown:q=>{q.target instanceof HTMLElement&&q.target.dataset.dismissible==="false"||L(!0)},onPointerUp:()=>L(!1)},M.filter(q=>!q.position&&ue===0||q.position===de).map((q,ke)=>{var Ae,ye;return S.createElement(Jm,{key:q.id,icons:w,index:ke,toast:q,defaultRichColors:h,duration:(Ae=p==null?void 0:p.duration)!=null?Ae:v,className:p==null?void 0:p.className,descriptionClassName:p==null?void 0:p.descriptionClassName,invert:r,visibleToasts:b,closeButton:(ye=p==null?void 0:p.closeButton)!=null?ye:a,interacting:U,position:de,style:p==null?void 0:p.style,unstyled:p==null?void 0:p.unstyled,classNames:p==null?void 0:p.classNames,cancelButtonStyle:p==null?void 0:p.cancelButtonStyle,actionButtonStyle:p==null?void 0:p.actionButtonStyle,removeToast:Se,toasts:M.filter(me=>me.position==q.position),heights:F.filter(me=>me.position==q.position),setHeights:W,expandByDefault:o,gap:x,loadingIcon:y,expanded:G,pauseWhenPageIsHidden:E,swipeDirections:e.swipeDirections})})):null}))});const tv=({...e})=>{const{theme:t="system"}=Em();return l.jsx(ev,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})};var rv=m[" useId ".trim().toString()]||(()=>{}),nv=0;function so(e){const[t,r]=m.useState(rv());return et(()=>{r(n=>n??String(nv++))},[e]),t?`radix-${t}`:""}const sv=["top","right","bottom","left"],_r=Math.min,bt=Math.max,oo=Math.round,ao=Math.floor,jt=e=>({x:e,y:e}),ov={left:"right",right:"left",bottom:"top",top:"bottom"},av={start:"end",end:"start"};function ya(e,t,r){return bt(e,_r(t,r))}function sr(e,t){return typeof e=="function"?e(t):e}function or(e){return e.split("-")[0]}function Nn(e){return e.split("-")[1]}function ba(e){return e==="x"?"y":"x"}function wa(e){return e==="y"?"height":"width"}const iv=new Set(["top","bottom"]);function Ut(e){return iv.has(or(e))?"y":"x"}function xa(e){return ba(Ut(e))}function lv(e,t,r){r===void 0&&(r=!1);const n=Nn(e),s=xa(e),o=wa(s);let a=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=io(a)),[a,io(a)]}function cv(e){const t=io(e);return[_a(e),t,_a(t)]}function _a(e){return e.replace(/start|end/g,t=>av[t])}const pc=["left","right"],mc=["right","left"],dv=["top","bottom"],uv=["bottom","top"];function fv(e,t,r){switch(e){case"top":case"bottom":return r?t?mc:pc:t?pc:mc;case"left":case"right":return t?dv:uv;default:return[]}}function hv(e,t,r,n){const s=Nn(e);let o=fv(or(e),r==="start",n);return s&&(o=o.map(a=>a+"-"+s),t&&(o=o.concat(o.map(_a)))),o}function io(e){return e.replace(/left|right|bottom|top/g,t=>ov[t])}function pv(e){return{top:0,right:0,bottom:0,left:0,...e}}function vc(e){return typeof e!="number"?pv(e):{top:e,right:e,bottom:e,left:e}}function lo(e){const{x:t,y:r,width:n,height:s}=e;return{width:n,height:s,top:r,left:t,right:t+n,bottom:r+s,x:t,y:r}}function gc(e,t,r){let{reference:n,floating:s}=e;const o=Ut(t),a=xa(t),i=wa(a),c=or(t),d=o==="y",u=n.x+n.width/2-s.width/2,h=n.y+n.height/2-s.height/2,v=n[i]/2-s[i]/2;let f;switch(c){case"top":f={x:u,y:n.y-s.height};break;case"bottom":f={x:u,y:n.y+n.height};break;case"right":f={x:n.x+n.width,y:h};break;case"left":f={x:n.x-s.width,y:h};break;default:f={x:n.x,y:n.y}}switch(Nn(t)){case"start":f[a]-=v*(r&&d?-1:1);break;case"end":f[a]+=v*(r&&d?-1:1);break}return f}const mv=async(e,t,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:o=[],platform:a}=r,i=o.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t));let d=await a.getElementRects({reference:e,floating:t,strategy:s}),{x:u,y:h}=gc(d,n,c),v=n,f={},b=0;for(let p=0;p<i.length;p++){const{name:g,fn:x}=i[p],{x:y,y:w,data:k,reset:E}=await x({x:u,y:h,initialPlacement:n,placement:v,strategy:s,middlewareData:f,rects:d,platform:a,elements:{reference:e,floating:t}});u=y??u,h=w??h,f={...f,[g]:{...f[g],...k}},E&&b<=50&&(b++,typeof E=="object"&&(E.placement&&(v=E.placement),E.rects&&(d=E.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:s}):E.rects),{x:u,y:h}=gc(d,v,c)),p=-1)}return{x:u,y:h,placement:v,strategy:s,middlewareData:f}};async function ms(e,t){var r;t===void 0&&(t={});const{x:n,y:s,platform:o,rects:a,elements:i,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:v=!1,padding:f=0}=sr(t,e),b=vc(f),g=i[v?h==="floating"?"reference":"floating":h],x=lo(await o.getClippingRect({element:(r=await(o.isElement==null?void 0:o.isElement(g)))==null||r?g:g.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(i.floating)),boundary:d,rootBoundary:u,strategy:c})),y=h==="floating"?{x:n,y:s,width:a.floating.width,height:a.floating.height}:a.reference,w=await(o.getOffsetParent==null?void 0:o.getOffsetParent(i.floating)),k=await(o.isElement==null?void 0:o.isElement(w))?await(o.getScale==null?void 0:o.getScale(w))||{x:1,y:1}:{x:1,y:1},E=lo(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:y,offsetParent:w,strategy:c}):y);return{top:(x.top-E.top+b.top)/k.y,bottom:(E.bottom-x.bottom+b.bottom)/k.y,left:(x.left-E.left+b.left)/k.x,right:(E.right-x.right+b.right)/k.x}}const vv=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:s,rects:o,platform:a,elements:i,middlewareData:c}=t,{element:d,padding:u=0}=sr(e,t)||{};if(d==null)return{};const h=vc(u),v={x:r,y:n},f=xa(s),b=wa(f),p=await a.getDimensions(d),g=f==="y",x=g?"top":"left",y=g?"bottom":"right",w=g?"clientHeight":"clientWidth",k=o.reference[b]+o.reference[f]-v[f]-o.floating[b],E=v[f]-o.reference[f],M=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let O=M?M[w]:0;(!O||!await(a.isElement==null?void 0:a.isElement(M)))&&(O=i.floating[w]||o.floating[b]);const P=k/2-E/2,F=O/2-p[b]/2-1,W=_r(h[x],F),G=_r(h[y],F),D=W,U=O-p[b]-G,L=O/2-p[b]/2+P,J=ya(D,L,U),Y=!c.arrow&&Nn(s)!=null&&L!==J&&o.reference[b]/2-(L<D?W:G)-p[b]/2<0,I=Y?L<D?L-D:L-U:0;return{[f]:v[f]+I,data:{[f]:J,centerOffset:L-J-I,...Y&&{alignmentOffset:I}},reset:Y}}}),gv=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:s,middlewareData:o,rects:a,initialPlacement:i,platform:c,elements:d}=t,{mainAxis:u=!0,crossAxis:h=!0,fallbackPlacements:v,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:p=!0,...g}=sr(e,t);if((r=o.arrow)!=null&&r.alignmentOffset)return{};const x=or(s),y=Ut(i),w=or(i)===i,k=await(c.isRTL==null?void 0:c.isRTL(d.floating)),E=v||(w||!p?[io(i)]:cv(i)),M=b!=="none";!v&&M&&E.push(...hv(i,p,b,k));const O=[i,...E],P=await ms(t,g),F=[];let W=((n=o.flip)==null?void 0:n.overflows)||[];if(u&&F.push(P[x]),h){const L=lv(s,a,k);F.push(P[L[0]],P[L[1]])}if(W=[...W,{placement:s,overflows:F}],!F.every(L=>L<=0)){var G,D;const L=(((G=o.flip)==null?void 0:G.index)||0)+1,J=O[L];if(J&&(!(h==="alignment"?y!==Ut(J):!1)||W.every(A=>A.overflows[0]>0&&Ut(A.placement)===y)))return{data:{index:L,overflows:W},reset:{placement:J}};let Y=(D=W.filter(I=>I.overflows[0]<=0).sort((I,A)=>I.overflows[1]-A.overflows[1])[0])==null?void 0:D.placement;if(!Y)switch(f){case"bestFit":{var U;const I=(U=W.filter(A=>{if(M){const B=Ut(A.placement);return B===y||B==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(B=>B>0).reduce((B,ae)=>B+ae,0)]).sort((A,B)=>A[1]-B[1])[0])==null?void 0:U[0];I&&(Y=I);break}case"initialPlacement":Y=i;break}if(s!==Y)return{reset:{placement:Y}}}return{}}}};function yc(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function bc(e){return sv.some(t=>e[t]>=0)}const yv=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...s}=sr(e,t);switch(n){case"referenceHidden":{const o=await ms(t,{...s,elementContext:"reference"}),a=yc(o,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:bc(a)}}}case"escaped":{const o=await ms(t,{...s,altBoundary:!0}),a=yc(o,r.floating);return{data:{escapedOffsets:a,escaped:bc(a)}}}default:return{}}}}},wc=new Set(["left","top"]);async function bv(e,t){const{placement:r,platform:n,elements:s}=e,o=await(n.isRTL==null?void 0:n.isRTL(s.floating)),a=or(r),i=Nn(r),c=Ut(r)==="y",d=wc.has(a)?-1:1,u=o&&c?-1:1,h=sr(t,e);let{mainAxis:v,crossAxis:f,alignmentAxis:b}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return i&&typeof b=="number"&&(f=i==="end"?b*-1:b),c?{x:f*u,y:v*d}:{x:v*d,y:f*u}}const wv=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:s,y:o,placement:a,middlewareData:i}=t,c=await bv(t,e);return a===((r=i.offset)==null?void 0:r.placement)&&(n=i.arrow)!=null&&n.alignmentOffset?{}:{x:s+c.x,y:o+c.y,data:{...c,placement:a}}}}},xv=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:s}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:i={fn:g=>{let{x,y}=g;return{x,y}}},...c}=sr(e,t),d={x:r,y:n},u=await ms(t,c),h=Ut(or(s)),v=ba(h);let f=d[v],b=d[h];if(o){const g=v==="y"?"top":"left",x=v==="y"?"bottom":"right",y=f+u[g],w=f-u[x];f=ya(y,f,w)}if(a){const g=h==="y"?"top":"left",x=h==="y"?"bottom":"right",y=b+u[g],w=b-u[x];b=ya(y,b,w)}const p=i.fn({...t,[v]:f,[h]:b});return{...p,data:{x:p.x-r,y:p.y-n,enabled:{[v]:o,[h]:a}}}}}},_v=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:s,rects:o,middlewareData:a}=t,{offset:i=0,mainAxis:c=!0,crossAxis:d=!0}=sr(e,t),u={x:r,y:n},h=Ut(s),v=ba(h);let f=u[v],b=u[h];const p=sr(i,t),g=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(c){const w=v==="y"?"height":"width",k=o.reference[v]-o.floating[w]+g.mainAxis,E=o.reference[v]+o.reference[w]-g.mainAxis;f<k?f=k:f>E&&(f=E)}if(d){var x,y;const w=v==="y"?"width":"height",k=wc.has(or(s)),E=o.reference[h]-o.floating[w]+(k&&((x=a.offset)==null?void 0:x[h])||0)+(k?0:g.crossAxis),M=o.reference[h]+o.reference[w]+(k?0:((y=a.offset)==null?void 0:y[h])||0)-(k?g.crossAxis:0);b<E?b=E:b>M&&(b=M)}return{[v]:f,[h]:b}}}},Cv=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:s,rects:o,platform:a,elements:i}=t,{apply:c=()=>{},...d}=sr(e,t),u=await ms(t,d),h=or(s),v=Nn(s),f=Ut(s)==="y",{width:b,height:p}=o.floating;let g,x;h==="top"||h==="bottom"?(g=h,x=v===(await(a.isRTL==null?void 0:a.isRTL(i.floating))?"start":"end")?"left":"right"):(x=h,g=v==="end"?"top":"bottom");const y=p-u.top-u.bottom,w=b-u.left-u.right,k=_r(p-u[g],y),E=_r(b-u[x],w),M=!t.middlewareData.shift;let O=k,P=E;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(P=w),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(O=y),M&&!v){const W=bt(u.left,0),G=bt(u.right,0),D=bt(u.top,0),U=bt(u.bottom,0);f?P=b-2*(W!==0||G!==0?W+G:bt(u.left,u.right)):O=p-2*(D!==0||U!==0?D+U:bt(u.top,u.bottom))}await c({...t,availableWidth:P,availableHeight:O});const F=await a.getDimensions(i.floating);return b!==F.width||p!==F.height?{reset:{rects:!0}}:{}}}};function co(){return typeof window<"u"}function En(e){return xc(e)?(e.nodeName||"").toLowerCase():"#document"}function wt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ht(e){var t;return(t=(xc(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function xc(e){return co()?e instanceof Node||e instanceof wt(e).Node:!1}function Tt(e){return co()?e instanceof Element||e instanceof wt(e).Element:!1}function zt(e){return co()?e instanceof HTMLElement||e instanceof wt(e).HTMLElement:!1}function _c(e){return!co()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof wt(e).ShadowRoot}const Sv=new Set(["inline","contents"]);function vs(e){const{overflow:t,overflowX:r,overflowY:n,display:s}=Ot(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Sv.has(s)}const kv=new Set(["table","td","th"]);function Nv(e){return kv.has(En(e))}const Ev=[":popover-open",":modal"];function uo(e){return Ev.some(t=>{try{return e.matches(t)}catch{return!1}})}const Pv=["transform","translate","scale","rotate","perspective"],Tv=["transform","translate","scale","rotate","perspective","filter"],Ov=["paint","layout","strict","content"];function Ca(e){const t=Sa(),r=Tt(e)?Ot(e):e;return Pv.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||Tv.some(n=>(r.willChange||"").includes(n))||Ov.some(n=>(r.contain||"").includes(n))}function Mv(e){let t=Cr(e);for(;zt(t)&&!Pn(t);){if(Ca(t))return t;if(uo(t))return null;t=Cr(t)}return null}function Sa(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Av=new Set(["html","body","#document"]);function Pn(e){return Av.has(En(e))}function Ot(e){return wt(e).getComputedStyle(e)}function fo(e){return Tt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Cr(e){if(En(e)==="html")return e;const t=e.assignedSlot||e.parentNode||_c(e)&&e.host||Ht(e);return _c(t)?t.host:t}function Cc(e){const t=Cr(e);return Pn(t)?e.ownerDocument?e.ownerDocument.body:e.body:zt(t)&&vs(t)?t:Cc(t)}function gs(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const s=Cc(e),o=s===((n=e.ownerDocument)==null?void 0:n.body),a=wt(s);if(o){const i=ka(a);return t.concat(a,a.visualViewport||[],vs(s)?s:[],i&&r?gs(i):[])}return t.concat(s,gs(s,[],r))}function ka(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Sc(e){const t=Ot(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=zt(e),o=s?e.offsetWidth:r,a=s?e.offsetHeight:n,i=oo(r)!==o||oo(n)!==a;return i&&(r=o,n=a),{width:r,height:n,$:i}}function Na(e){return Tt(e)?e:e.contextElement}function Tn(e){const t=Na(e);if(!zt(t))return jt(1);const r=t.getBoundingClientRect(),{width:n,height:s,$:o}=Sc(t);let a=(o?oo(r.width):r.width)/n,i=(o?oo(r.height):r.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!i||!Number.isFinite(i))&&(i=1),{x:a,y:i}}const Dv=jt(0);function kc(e){const t=wt(e);return!Sa()||!t.visualViewport?Dv:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Iv(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==wt(e)?!1:t}function en(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),o=Na(e);let a=jt(1);t&&(n?Tt(n)&&(a=Tn(n)):a=Tn(e));const i=Iv(o,r,n)?kc(o):jt(0);let c=(s.left+i.x)/a.x,d=(s.top+i.y)/a.y,u=s.width/a.x,h=s.height/a.y;if(o){const v=wt(o),f=n&&Tt(n)?wt(n):n;let b=v,p=ka(b);for(;p&&n&&f!==b;){const g=Tn(p),x=p.getBoundingClientRect(),y=Ot(p),w=x.left+(p.clientLeft+parseFloat(y.paddingLeft))*g.x,k=x.top+(p.clientTop+parseFloat(y.paddingTop))*g.y;c*=g.x,d*=g.y,u*=g.x,h*=g.y,c+=w,d+=k,b=wt(p),p=ka(b)}}return lo({width:u,height:h,x:c,y:d})}function Ea(e,t){const r=fo(e).scrollLeft;return t?t.left+r:en(Ht(e)).left+r}function Nc(e,t,r){r===void 0&&(r=!1);const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-(r?0:Ea(e,n)),o=n.top+t.scrollTop;return{x:s,y:o}}function Fv(e){let{elements:t,rect:r,offsetParent:n,strategy:s}=e;const o=s==="fixed",a=Ht(n),i=t?uo(t.floating):!1;if(n===a||i&&o)return r;let c={scrollLeft:0,scrollTop:0},d=jt(1);const u=jt(0),h=zt(n);if((h||!h&&!o)&&((En(n)!=="body"||vs(a))&&(c=fo(n)),zt(n))){const f=en(n);d=Tn(n),u.x=f.x+n.clientLeft,u.y=f.y+n.clientTop}const v=a&&!h&&!o?Nc(a,c,!0):jt(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-c.scrollLeft*d.x+u.x+v.x,y:r.y*d.y-c.scrollTop*d.y+u.y+v.y}}function Lv(e){return Array.from(e.getClientRects())}function Vv(e){const t=Ht(e),r=fo(e),n=e.ownerDocument.body,s=bt(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=bt(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let a=-r.scrollLeft+Ea(e);const i=-r.scrollTop;return Ot(n).direction==="rtl"&&(a+=bt(t.clientWidth,n.clientWidth)-s),{width:s,height:o,x:a,y:i}}function $v(e,t){const r=wt(e),n=Ht(e),s=r.visualViewport;let o=n.clientWidth,a=n.clientHeight,i=0,c=0;if(s){o=s.width,a=s.height;const d=Sa();(!d||d&&t==="fixed")&&(i=s.offsetLeft,c=s.offsetTop)}return{width:o,height:a,x:i,y:c}}const Bv=new Set(["absolute","fixed"]);function Wv(e,t){const r=en(e,!0,t==="fixed"),n=r.top+e.clientTop,s=r.left+e.clientLeft,o=zt(e)?Tn(e):jt(1),a=e.clientWidth*o.x,i=e.clientHeight*o.y,c=s*o.x,d=n*o.y;return{width:a,height:i,x:c,y:d}}function Ec(e,t,r){let n;if(t==="viewport")n=$v(e,r);else if(t==="document")n=Vv(Ht(e));else if(Tt(t))n=Wv(t,r);else{const s=kc(e);n={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return lo(n)}function Pc(e,t){const r=Cr(e);return r===t||!Tt(r)||Pn(r)?!1:Ot(r).position==="fixed"||Pc(r,t)}function jv(e,t){const r=t.get(e);if(r)return r;let n=gs(e,[],!1).filter(i=>Tt(i)&&En(i)!=="body"),s=null;const o=Ot(e).position==="fixed";let a=o?Cr(e):e;for(;Tt(a)&&!Pn(a);){const i=Ot(a),c=Ca(a);!c&&i.position==="fixed"&&(s=null),(o?!c&&!s:!c&&i.position==="static"&&!!s&&Bv.has(s.position)||vs(a)&&!c&&Pc(e,a))?n=n.filter(u=>u!==a):s=i,a=Cr(a)}return t.set(e,n),n}function Uv(e){let{element:t,boundary:r,rootBoundary:n,strategy:s}=e;const a=[...r==="clippingAncestors"?uo(t)?[]:jv(t,this._c):[].concat(r),n],i=a[0],c=a.reduce((d,u)=>{const h=Ec(t,u,s);return d.top=bt(h.top,d.top),d.right=_r(h.right,d.right),d.bottom=_r(h.bottom,d.bottom),d.left=bt(h.left,d.left),d},Ec(t,i,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Hv(e){const{width:t,height:r}=Sc(e);return{width:t,height:r}}function zv(e,t,r){const n=zt(t),s=Ht(t),o=r==="fixed",a=en(e,!0,o,t);let i={scrollLeft:0,scrollTop:0};const c=jt(0);function d(){c.x=Ea(s)}if(n||!n&&!o)if((En(t)!=="body"||vs(s))&&(i=fo(t)),n){const f=en(t,!0,o,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}else s&&d();o&&!n&&s&&d();const u=s&&!n&&!o?Nc(s,i):jt(0),h=a.left+i.scrollLeft-c.x-u.x,v=a.top+i.scrollTop-c.y-u.y;return{x:h,y:v,width:a.width,height:a.height}}function Pa(e){return Ot(e).position==="static"}function Tc(e,t){if(!zt(e)||Ot(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Ht(e)===r&&(r=r.ownerDocument.body),r}function Oc(e,t){const r=wt(e);if(uo(e))return r;if(!zt(e)){let s=Cr(e);for(;s&&!Pn(s);){if(Tt(s)&&!Pa(s))return s;s=Cr(s)}return r}let n=Tc(e,t);for(;n&&Nv(n)&&Pa(n);)n=Tc(n,t);return n&&Pn(n)&&Pa(n)&&!Ca(n)?r:n||Mv(e)||r}const Yv=async function(e){const t=this.getOffsetParent||Oc,r=this.getDimensions,n=await r(e.floating);return{reference:zv(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function qv(e){return Ot(e).direction==="rtl"}const Zv={convertOffsetParentRelativeRectToViewportRelativeRect:Fv,getDocumentElement:Ht,getClippingRect:Uv,getOffsetParent:Oc,getElementRects:Yv,getClientRects:Lv,getDimensions:Hv,getScale:Tn,isElement:Tt,isRTL:qv};function Mc(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Kv(e,t){let r=null,n;const s=Ht(e);function o(){var i;clearTimeout(n),(i=r)==null||i.disconnect(),r=null}function a(i,c){i===void 0&&(i=!1),c===void 0&&(c=1),o();const d=e.getBoundingClientRect(),{left:u,top:h,width:v,height:f}=d;if(i||t(),!v||!f)return;const b=ao(h),p=ao(s.clientWidth-(u+v)),g=ao(s.clientHeight-(h+f)),x=ao(u),w={rootMargin:-b+"px "+-p+"px "+-g+"px "+-x+"px",threshold:bt(0,_r(1,c))||1};let k=!0;function E(M){const O=M[0].intersectionRatio;if(O!==c){if(!k)return a();O?a(!1,O):n=setTimeout(()=>{a(!1,1e-7)},1e3)}O===1&&!Mc(d,e.getBoundingClientRect())&&a(),k=!1}try{r=new IntersectionObserver(E,{...w,root:s.ownerDocument})}catch{r=new IntersectionObserver(E,w)}r.observe(e)}return a(!0),o}function Qv(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,d=Na(e),u=s||o?[...d?gs(d):[],...gs(t)]:[];u.forEach(x=>{s&&x.addEventListener("scroll",r,{passive:!0}),o&&x.addEventListener("resize",r)});const h=d&&i?Kv(d,r):null;let v=-1,f=null;a&&(f=new ResizeObserver(x=>{let[y]=x;y&&y.target===d&&f&&(f.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var w;(w=f)==null||w.observe(t)})),r()}),d&&!c&&f.observe(d),f.observe(t));let b,p=c?en(e):null;c&&g();function g(){const x=en(e);p&&!Mc(p,x)&&r(),p=x,b=requestAnimationFrame(g)}return r(),()=>{var x;u.forEach(y=>{s&&y.removeEventListener("scroll",r),o&&y.removeEventListener("resize",r)}),h==null||h(),(x=f)==null||x.disconnect(),f=null,c&&cancelAnimationFrame(b)}}const Gv=wv,Xv=xv,Jv=gv,Rv=Cv,eg=yv,Ac=vv,tg=_v,rg=(e,t,r)=>{const n=new Map,s={platform:Zv,...r},o={...s.platform,_c:n};return mv(e,t,{...s,platform:o})};var ng=typeof document<"u",sg=function(){},ho=ng?S.useLayoutEffect:sg;function po(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!po(e[n],t[n]))return!1;return!0}if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,s[n]))return!1;for(n=r;n--!==0;){const o=s[n];if(!(o==="_owner"&&e.$$typeof)&&!po(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Dc(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ic(e,t){const r=Dc(e);return Math.round(t*r)/r}function Ta(e){const t=m.useRef(e);return ho(()=>{t.current=e}),t}function og(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:o,floating:a}={},transform:i=!0,whileElementsMounted:c,open:d}=e,[u,h]=m.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[v,f]=m.useState(n);po(v,n)||f(n);const[b,p]=m.useState(null),[g,x]=m.useState(null),y=m.useCallback(A=>{A!==M.current&&(M.current=A,p(A))},[]),w=m.useCallback(A=>{A!==O.current&&(O.current=A,x(A))},[]),k=o||b,E=a||g,M=m.useRef(null),O=m.useRef(null),P=m.useRef(u),F=c!=null,W=Ta(c),G=Ta(s),D=Ta(d),U=m.useCallback(()=>{if(!M.current||!O.current)return;const A={placement:t,strategy:r,middleware:v};G.current&&(A.platform=G.current),rg(M.current,O.current,A).then(B=>{const ae={...B,isPositioned:D.current!==!1};L.current&&!po(P.current,ae)&&(P.current=ae,ls.flushSync(()=>{h(ae)}))})},[v,t,r,G,D]);ho(()=>{d===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,h(A=>({...A,isPositioned:!1})))},[d]);const L=m.useRef(!1);ho(()=>(L.current=!0,()=>{L.current=!1}),[]),ho(()=>{if(k&&(M.current=k),E&&(O.current=E),k&&E){if(W.current)return W.current(k,E,U);U()}},[k,E,U,W,F]);const J=m.useMemo(()=>({reference:M,floating:O,setReference:y,setFloating:w}),[y,w]),Y=m.useMemo(()=>({reference:k,floating:E}),[k,E]),I=m.useMemo(()=>{const A={position:r,left:0,top:0};if(!Y.floating)return A;const B=Ic(Y.floating,u.x),ae=Ic(Y.floating,u.y);return i?{...A,transform:"translate("+B+"px, "+ae+"px)",...Dc(Y.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:B,top:ae}},[r,i,Y.floating,u.x,u.y]);return m.useMemo(()=>({...u,update:U,refs:J,elements:Y,floatingStyles:I}),[u,U,J,Y,I])}const ag=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:s}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Ac({element:n.current,padding:s}).fn(r):{}:n?Ac({element:n,padding:s}).fn(r):{}}}},ig=(e,t)=>({...Gv(e),options:[e,t]}),lg=(e,t)=>({...Xv(e),options:[e,t]}),cg=(e,t)=>({...tg(e),options:[e,t]}),dg=(e,t)=>({...Jv(e),options:[e,t]}),ug=(e,t)=>({...Rv(e),options:[e,t]}),fg=(e,t)=>({...eg(e),options:[e,t]}),hg=(e,t)=>({...ag(e),options:[e,t]});var pg="Arrow",Fc=m.forwardRef((e,t)=>{const{children:r,width:n=10,height:s=5,...o}=e;return l.jsx(we.svg,{...o,ref:t,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});Fc.displayName=pg;var mg=Fc;function vg(e){const[t,r]=m.useState(void 0);return et(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let a,i;if("borderBoxSize"in o){const c=o.borderBoxSize,d=Array.isArray(c)?c[0]:c;a=d.inlineSize,i=d.blockSize}else a=e.offsetWidth,i=e.offsetHeight;r({width:a,height:i})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Oa="Popper",[Lc,On]=Rr(Oa),[gg,Vc]=Lc(Oa),$c=e=>{const{__scopePopper:t,children:r}=e,[n,s]=m.useState(null);return l.jsx(gg,{scope:t,anchor:n,onAnchorChange:s,children:r})};$c.displayName=Oa;var Bc="PopperAnchor",Wc=m.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...s}=e,o=Vc(Bc,r),a=m.useRef(null),i=Ie(t,a);return m.useEffect(()=>{o.onAnchorChange((n==null?void 0:n.current)||a.current)}),n?null:l.jsx(we.div,{...s,ref:i})});Wc.displayName=Bc;var Ma="PopperContent",[yg,bg]=Lc(Ma),jc=m.forwardRef((e,t)=>{var q,ke,Ae,ye,me,be;const{__scopePopper:r,side:n="bottom",sideOffset:s=0,align:o="center",alignOffset:a=0,arrowPadding:i=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:h="partial",hideWhenDetached:v=!1,updatePositionStrategy:f="optimized",onPlaced:b,...p}=e,g=Vc(Ma,r),[x,y]=m.useState(null),w=Ie(t,Re=>y(Re)),[k,E]=m.useState(null),M=vg(k),O=(M==null?void 0:M.width)??0,P=(M==null?void 0:M.height)??0,F=n+(o!=="center"?"-"+o:""),W=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},G=Array.isArray(d)?d:[d],D=G.length>0,U={padding:W,boundary:G.filter(xg),altBoundary:D},{refs:L,floatingStyles:J,placement:Y,isPositioned:I,middlewareData:A}=og({strategy:"fixed",placement:F,whileElementsMounted:(...Re)=>Qv(...Re,{animationFrame:f==="always"}),elements:{reference:g.anchor},middleware:[ig({mainAxis:s+P,alignmentAxis:a}),c&&lg({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?cg():void 0,...U}),c&&dg({...U}),ug({...U,apply:({elements:Re,rects:dt,availableWidth:Rt,availableHeight:er})=>{const{width:mr,height:is}=dt.reference,vr=Re.floating.style;vr.setProperty("--radix-popper-available-width",`${Rt}px`),vr.setProperty("--radix-popper-available-height",`${er}px`),vr.setProperty("--radix-popper-anchor-width",`${mr}px`),vr.setProperty("--radix-popper-anchor-height",`${is}px`)}}),k&&hg({element:k,padding:i}),_g({arrowWidth:O,arrowHeight:P}),v&&fg({strategy:"referenceHidden",...U})]}),[B,ae]=zc(Y),Se=Et(b);et(()=>{I&&(Se==null||Se())},[I,Se]);const de=(q=A.arrow)==null?void 0:q.x,ue=(ke=A.arrow)==null?void 0:ke.y,pe=((Ae=A.arrow)==null?void 0:Ae.centerOffset)!==0,[Fe,rt]=m.useState();return et(()=>{x&&rt(window.getComputedStyle(x).zIndex)},[x]),l.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...J,transform:I?J.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Fe,"--radix-popper-transform-origin":[(ye=A.transformOrigin)==null?void 0:ye.x,(me=A.transformOrigin)==null?void 0:me.y].join(" "),...((be=A.hide)==null?void 0:be.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(yg,{scope:r,placedSide:B,onArrowChange:E,arrowX:de,arrowY:ue,shouldHideArrow:pe,children:l.jsx(we.div,{"data-side":B,"data-align":ae,...p,ref:w,style:{...p.style,animation:I?void 0:"none"}})})})});jc.displayName=Ma;var Uc="PopperArrow",wg={top:"bottom",right:"left",bottom:"top",left:"right"},Hc=m.forwardRef(function(t,r){const{__scopePopper:n,...s}=t,o=bg(Uc,n),a=wg[o.placedSide];return l.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:l.jsx(mg,{...s,ref:r,style:{...s.style,display:"block"}})})});Hc.displayName=Uc;function xg(e){return e!==null}var _g=e=>({name:"transformOrigin",options:e,fn(t){var g,x,y;const{placement:r,rects:n,middlewareData:s}=t,a=((g=s.arrow)==null?void 0:g.centerOffset)!==0,i=a?0:e.arrowWidth,c=a?0:e.arrowHeight,[d,u]=zc(r),h={start:"0%",center:"50%",end:"100%"}[u],v=(((x=s.arrow)==null?void 0:x.x)??0)+i/2,f=(((y=s.arrow)==null?void 0:y.y)??0)+c/2;let b="",p="";return d==="bottom"?(b=a?h:`${v}px`,p=`${-c}px`):d==="top"?(b=a?h:`${v}px`,p=`${n.floating.height+c}px`):d==="right"?(b=`${-c}px`,p=a?h:`${f}px`):d==="left"&&(b=`${n.floating.width+c}px`,p=a?h:`${f}px`),{data:{x:b,y:p}}}});function zc(e){const[t,r="center"]=e.split("-");return[t,r]}var Yc=$c,mo=Wc,Aa=jc,Da=Hc,[vo,CC]=Rr("Tooltip",[On]),Ia=On(),qc="TooltipProvider",Cg=700,Zc="tooltip.open",[Sg,Kc]=vo(qc),Qc=e=>{const{__scopeTooltip:t,delayDuration:r=Cg,skipDelayDuration:n=300,disableHoverableContent:s=!1,children:o}=e,a=m.useRef(!0),i=m.useRef(!1),c=m.useRef(0);return m.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),l.jsx(Sg,{scope:t,isOpenDelayedRef:a,delayDuration:r,onOpen:m.useCallback(()=>{window.clearTimeout(c.current),a.current=!1},[]),onClose:m.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,n)},[n]),isPointerInTransitRef:i,onPointerInTransitChange:m.useCallback(d=>{i.current=d},[]),disableHoverableContent:s,children:o})};Qc.displayName=qc;var Gc="Tooltip",[SC,go]=vo(Gc),Fa="TooltipTrigger",kg=m.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=go(Fa,r),o=Kc(Fa,r),a=Ia(r),i=m.useRef(null),c=Ie(t,i,s.onTriggerChange),d=m.useRef(!1),u=m.useRef(!1),h=m.useCallback(()=>d.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),l.jsx(mo,{asChild:!0,...a,children:l.jsx(we.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:c,onPointerMove:ie(e.onPointerMove,v=>{v.pointerType!=="touch"&&!u.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),u.current=!0)}),onPointerLeave:ie(e.onPointerLeave,()=>{s.onTriggerLeave(),u.current=!1}),onPointerDown:ie(e.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:ie(e.onFocus,()=>{d.current||s.onOpen()}),onBlur:ie(e.onBlur,s.onClose),onClick:ie(e.onClick,s.onClose)})})});kg.displayName=Fa;var Ng="TooltipPortal",[kC,Eg]=vo(Ng,{forceMount:void 0}),Mn="TooltipContent",Xc=m.forwardRef((e,t)=>{const r=Eg(Mn,e.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...o}=e,a=go(Mn,e.__scopeTooltip);return l.jsx(us,{present:n||a.open,children:a.disableHoverableContent?l.jsx(Jc,{side:s,...o,ref:t}):l.jsx(Pg,{side:s,...o,ref:t})})}),Pg=m.forwardRef((e,t)=>{const r=go(Mn,e.__scopeTooltip),n=Kc(Mn,e.__scopeTooltip),s=m.useRef(null),o=Ie(t,s),[a,i]=m.useState(null),{trigger:c,onClose:d}=r,u=s.current,{onPointerInTransitChange:h}=n,v=m.useCallback(()=>{i(null),h(!1)},[h]),f=m.useCallback((b,p)=>{const g=b.currentTarget,x={x:b.clientX,y:b.clientY},y=Dg(x,g.getBoundingClientRect()),w=Ig(x,y),k=Fg(p.getBoundingClientRect()),E=Vg([...w,...k]);i(E),h(!0)},[h]);return m.useEffect(()=>()=>v(),[v]),m.useEffect(()=>{if(c&&u){const b=g=>f(g,u),p=g=>f(g,c);return c.addEventListener("pointerleave",b),u.addEventListener("pointerleave",p),()=>{c.removeEventListener("pointerleave",b),u.removeEventListener("pointerleave",p)}}},[c,u,f,v]),m.useEffect(()=>{if(a){const b=p=>{const g=p.target,x={x:p.clientX,y:p.clientY},y=(c==null?void 0:c.contains(g))||(u==null?void 0:u.contains(g)),w=!Lg(x,a);y?v():w&&(v(),d())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[c,u,a,d,v]),l.jsx(Jc,{...e,ref:o})}),[Tg,Og]=vo(Gc,{isInside:!1}),Mg=Hh("TooltipContent"),Jc=m.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:a,...i}=e,c=go(Mn,r),d=Ia(r),{onClose:u}=c;return m.useEffect(()=>(document.addEventListener(Zc,u),()=>document.removeEventListener(Zc,u)),[u]),m.useEffect(()=>{if(c.trigger){const h=v=>{const f=v.target;f!=null&&f.contains(c.trigger)&&u()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[c.trigger,u]),l.jsx(ds,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:h=>h.preventDefault(),onDismiss:u,children:l.jsxs(Aa,{"data-state":c.stateAttribute,...d,...i,ref:t,style:{...i.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[l.jsx(Mg,{children:n}),l.jsx(Tg,{scope:r,isInside:!0,children:l.jsx(up,{id:c.contentId,role:"tooltip",children:s||n})})]})})});Xc.displayName=Mn;var Rc="TooltipArrow",Ag=m.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=Ia(r);return Og(Rc,r).isInside?null:l.jsx(Da,{...s,...n,ref:t})});Ag.displayName=Rc;function Dg(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(r,n,s,o)){case o:return"left";case s:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function Ig(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function Fg(e){const{top:t,right:r,bottom:n,left:s}=e;return[{x:s,y:t},{x:r,y:t},{x:r,y:n},{x:s,y:n}]}function Lg(e,t){const{x:r,y:n}=e;let s=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const i=t[o],c=t[a],d=i.x,u=i.y,h=c.x,v=c.y;u>n!=v>n&&r<(h-d)*(n-u)/(v-u)+d&&(s=!s)}return s}function Vg(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),$g(t)}function $g(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const s=e[n];for(;t.length>=2;){const o=t[t.length-1],a=t[t.length-2];if((o.x-a.x)*(s.y-a.y)>=(o.y-a.y)*(s.x-a.x))t.pop();else break}t.push(s)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const s=e[n];for(;r.length>=2;){const o=r[r.length-1],a=r[r.length-2];if((o.x-a.x)*(s.y-a.y)>=(o.y-a.y)*(s.x-a.x))r.pop();else break}r.push(s)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var Bg=Qc,ed=Xc;const Wg=Bg,jg=m.forwardRef(({className:e,sideOffset:t=4,...r},n)=>l.jsx(ed,{ref:n,sideOffset:t,className:he("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));jg.displayName=ed.displayName;var An=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},tn=typeof window>"u"||"Deno"in globalThis;function nt(){}function Ug(e,t){return typeof e=="function"?e(t):e}function La(e){return typeof e=="number"&&e>=0&&e!==1/0}function td(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Sr(e,t){return typeof e=="function"?e(t):e}function St(e,t){return typeof e=="function"?e(t):e}function rd(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:o,queryKey:a,stale:i}=e;if(a){if(n){if(t.queryHash!==Va(a,t.options))return!1}else if(!ys(t.queryKey,a))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof i=="boolean"&&t.isStale()!==i||s&&s!==t.state.fetchStatus||o&&!o(t))}function nd(e,t){const{exact:r,status:n,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(r){if(rn(t.options.mutationKey)!==rn(o))return!1}else if(!ys(t.options.mutationKey,o))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function Va(e,t){return((t==null?void 0:t.queryKeyHashFn)||rn)(e)}function rn(e){return JSON.stringify(e,(t,r)=>Ba(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function ys(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>ys(e[r],t[r])):!1}function $a(e,t){if(e===t)return e;const r=sd(e)&&sd(t);if(r||Ba(e)&&Ba(t)){const n=r?e:Object.keys(e),s=n.length,o=r?t:Object.keys(t),a=o.length,i=r?[]:{},c=new Set(n);let d=0;for(let u=0;u<a;u++){const h=r?u:o[u];(!r&&c.has(h)||r)&&e[h]===void 0&&t[h]===void 0?(i[h]=void 0,d++):(i[h]=$a(e[h],t[h]),i[h]===e[h]&&e[h]!==void 0&&d++)}return s===a&&d===s?e:i}return t}function yo(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function sd(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ba(e){if(!od(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!od(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function od(e){return Object.prototype.toString.call(e)==="[object Object]"}function Hg(e){return new Promise(t=>{setTimeout(t,e)})}function Wa(e,t,r){if(typeof r.structuralSharing=="function")return r.structuralSharing(e,t);if(r.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return $a(e,t)}catch(n){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${r.queryHash}]: ${n}`),n}return $a(e,t)}return t}function zg(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function Yg(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var bo=Symbol();function ad(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===bo&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===bo?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function id(e,t){return typeof e=="function"?e(...t):!!e}var qg=(_h=class extends An{constructor(){super();ee(this,hn);ee(this,Br);ee(this,Kn);K(this,Kn,t=>{if(!tn&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){_(this,Br)||this.setEventListener(_(this,Kn))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,Br))==null||t.call(this),K(this,Br,void 0))}setEventListener(t){var r;K(this,Kn,t),(r=_(this,Br))==null||r.call(this),K(this,Br,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){_(this,hn)!==t&&(K(this,hn,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof _(this,hn)=="boolean"?_(this,hn):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},hn=new WeakMap,Br=new WeakMap,Kn=new WeakMap,_h),ja=new qg,Zg=(Ch=class extends An{constructor(){super();ee(this,Qn,!0);ee(this,Wr);ee(this,Gn);K(this,Gn,t=>{if(!tn&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){_(this,Wr)||this.setEventListener(_(this,Gn))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,Wr))==null||t.call(this),K(this,Wr,void 0))}setEventListener(t){var r;K(this,Gn,t),(r=_(this,Wr))==null||r.call(this),K(this,Wr,t(this.setOnline.bind(this)))}setOnline(t){_(this,Qn)!==t&&(K(this,Qn,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return _(this,Qn)}},Qn=new WeakMap,Wr=new WeakMap,Gn=new WeakMap,Ch),wo=new Zg;function Ua(){let e,t;const r=new Promise((s,o)=>{e=s,t=o});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),e(s)},r.reject=s=>{n({status:"rejected",reason:s}),t(s)},r}function Kg(e){return Math.min(1e3*2**e,3e4)}function ld(e){return(e??"online")==="online"?wo.isOnline():!0}var cd=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function dd(e){let t=!1,r=0,n;const s=Ua(),o=()=>s.status!=="pending",a=p=>{var g;o()||(v(new cd(p)),(g=e.abort)==null||g.call(e))},i=()=>{t=!0},c=()=>{t=!1},d=()=>ja.isFocused()&&(e.networkMode==="always"||wo.isOnline())&&e.canRun(),u=()=>ld(e.networkMode)&&e.canRun(),h=p=>{o()||(n==null||n(),s.resolve(p))},v=p=>{o()||(n==null||n(),s.reject(p))},f=()=>new Promise(p=>{var g;n=x=>{(o()||d())&&p(x)},(g=e.onPause)==null||g.call(e)}).then(()=>{var p;n=void 0,o()||(p=e.onContinue)==null||p.call(e)}),b=()=>{if(o())return;let p;const g=r===0?e.initialPromise:void 0;try{p=g??e.fn()}catch(x){p=Promise.reject(x)}Promise.resolve(p).then(h).catch(x=>{var M;if(o())return;const y=e.retry??(tn?0:3),w=e.retryDelay??Kg,k=typeof w=="function"?w(r,x):w,E=y===!0||typeof y=="number"&&r<y||typeof y=="function"&&y(r,x);if(t||!E){v(x);return}r++,(M=e.onFail)==null||M.call(e,r,x),Hg(k).then(()=>d()?void 0:f()).then(()=>{t?v(x):b()})})};return{promise:s,status:()=>s.status,cancel:a,continue:()=>(n==null||n(),s),cancelRetry:i,continueRetry:c,canStart:u,start:()=>(u()?b():f().then(b),s)}}var Qg=e=>setTimeout(e,0);function Gg(){let e=[],t=0,r=i=>{i()},n=i=>{i()},s=Qg;const o=i=>{t?e.push(i):s(()=>{r(i)})},a=()=>{const i=e;e=[],i.length&&s(()=>{n(()=>{i.forEach(c=>{r(c)})})})};return{batch:i=>{let c;t++;try{c=i()}finally{t--,t||a()}return c},batchCalls:i=>(...c)=>{o(()=>{i(...c)})},schedule:o,setNotifyFunction:i=>{r=i},setBatchNotifyFunction:i=>{n=i},setScheduler:i=>{s=i}}}var Ke=Gg(),ud=(Sh=class{constructor(){ee(this,pn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),La(this.gcTime)&&K(this,pn,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(tn?1/0:5*60*1e3))}clearGcTimeout(){_(this,pn)&&(clearTimeout(_(this,pn)),K(this,pn,void 0))}},pn=new WeakMap,Sh),Xg=(kh=class extends ud{constructor(t){super();ee(this,Lt);ee(this,Xn);ee(this,Jn);ee(this,Nt);ee(this,mn);ee(this,Je);ee(this,Hs);ee(this,vn);K(this,vn,!1),K(this,Hs,t.defaultOptions),this.setOptions(t.options),this.observers=[],K(this,mn,t.client),K(this,Nt,_(this,mn).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,K(this,Xn,Jg(this.options)),this.state=t.state??_(this,Xn),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=_(this,Je))==null?void 0:t.promise}setOptions(t){this.options={..._(this,Hs),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&_(this,Nt).remove(this)}setData(t,r){const n=Wa(this.state.data,t,this.options);return ce(this,Lt,br).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){ce(this,Lt,br).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,s;const r=(n=_(this,Je))==null?void 0:n.promise;return(s=_(this,Je))==null||s.cancel(t),r?r.then(nt).catch(nt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(_(this,Xn))}isActive(){return this.observers.some(t=>St(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===bo||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Sr(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!td(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=_(this,Je))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=_(this,Je))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),_(this,Nt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(_(this,Je)&&(_(this,vn)?_(this,Je).cancel({revert:!0}):_(this,Je).cancelRetry()),this.scheduleGc()),_(this,Nt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ce(this,Lt,br).call(this,{type:"invalidate"})}async fetch(t,r){var c,d,u,h,v,f,b,p,g,x,y,w;if(this.state.fetchStatus!=="idle"&&((c=_(this,Je))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(_(this,Je))return _(this,Je).continueRetry(),_(this,Je).promise}if(t&&this.setOptions(t),!this.options.queryFn){const k=this.observers.find(E=>E.options.queryFn);k&&this.setOptions(k.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const n=new AbortController,s=k=>{Object.defineProperty(k,"signal",{enumerable:!0,get:()=>(K(this,vn,!0),n.signal)})},o=()=>{const k=ad(this.options,r),M=(()=>{const O={client:_(this,mn),queryKey:this.queryKey,meta:this.meta};return s(O),O})();return K(this,vn,!1),this.options.persister?this.options.persister(k,M,this):k(M)},i=(()=>{const k={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:_(this,mn),state:this.state,fetchFn:o};return s(k),k})();(d=this.options.behavior)==null||d.onFetch(i,this),K(this,Jn,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=i.fetchOptions)==null?void 0:u.meta))&&ce(this,Lt,br).call(this,{type:"fetch",meta:(h=i.fetchOptions)==null?void 0:h.meta}),K(this,Je,dd({initialPromise:r==null?void 0:r.initialPromise,fn:i.fetchFn,abort:n.abort.bind(n),onFail:(k,E)=>{ce(this,Lt,br).call(this,{type:"failed",failureCount:k,error:E})},onPause:()=>{ce(this,Lt,br).call(this,{type:"pause"})},onContinue:()=>{ce(this,Lt,br).call(this,{type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0}));try{const k=await _(this,Je).start();if(k===void 0)throw process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(k),(f=(v=_(this,Nt).config).onSuccess)==null||f.call(v,k,this),(p=(b=_(this,Nt).config).onSettled)==null||p.call(b,k,this.state.error,this),k}catch(k){if(k instanceof cd){if(k.silent)return _(this,Je).promise;if(k.revert){if(this.setState({..._(this,Jn),fetchStatus:"idle"}),this.state.data===void 0)throw k;return this.state.data}}throw ce(this,Lt,br).call(this,{type:"error",error:k}),(x=(g=_(this,Nt).config).onError)==null||x.call(g,k,this),(w=(y=_(this,Nt).config).onSettled)==null||w.call(y,this.state.data,k,this),k}finally{this.scheduleGc()}}},Xn=new WeakMap,Jn=new WeakMap,Nt=new WeakMap,mn=new WeakMap,Je=new WeakMap,Hs=new WeakMap,vn=new WeakMap,Lt=new WeakSet,br=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...fd(n.data,this.options),fetchMeta:t.meta??null};case"success":const s={...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return K(this,Jn,t.manual?s:void 0),s;case"error":const o=t.error;return{...n,error:o,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),Ke.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),_(this,Nt).notify({query:this,type:"updated",action:t})})},kh);function fd(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ld(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Jg(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Rg=(Nh=class extends An{constructor(t={}){super();ee(this,Gt);this.config=t,K(this,Gt,new Map)}build(t,r,n){const s=r.queryKey,o=r.queryHash??Va(s,r);let a=this.get(o);return a||(a=new Xg({client:t,queryKey:s,queryHash:o,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(s)}),this.add(a)),a}add(t){_(this,Gt).has(t.queryHash)||(_(this,Gt).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=_(this,Gt).get(t.queryHash);r&&(t.destroy(),r===t&&_(this,Gt).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ke.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return _(this,Gt).get(t)}getAll(){return[..._(this,Gt).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>rd(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>rd(t,n)):r}notify(t){Ke.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Ke.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ke.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Gt=new WeakMap,Nh),ey=(Eh=class extends ud{constructor(t){super();ee(this,Jt);ee(this,Xt);ee(this,lt);ee(this,gn);this.mutationId=t.mutationId,K(this,lt,t.mutationCache),K(this,Xt,[]),this.state=t.state||hd(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){_(this,Xt).includes(t)||(_(this,Xt).push(t),this.clearGcTimeout(),_(this,lt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){K(this,Xt,_(this,Xt).filter(r=>r!==t)),this.scheduleGc(),_(this,lt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){_(this,Xt).length||(this.state.status==="pending"?this.scheduleGc():_(this,lt).remove(this))}continue(){var t;return((t=_(this,gn))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,a,i,c,d,u,h,v,f,b,p,g,x,y,w,k,E,M,O,P;const r=()=>{ce(this,Jt,Xr).call(this,{type:"continue"})};K(this,gn,dd({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(F,W)=>{ce(this,Jt,Xr).call(this,{type:"failed",failureCount:F,error:W})},onPause:()=>{ce(this,Jt,Xr).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>_(this,lt).canRun(this)}));const n=this.state.status==="pending",s=!_(this,gn).canStart();try{if(n)r();else{ce(this,Jt,Xr).call(this,{type:"pending",variables:t,isPaused:s}),await((a=(o=_(this,lt).config).onMutate)==null?void 0:a.call(o,t,this));const W=await((c=(i=this.options).onMutate)==null?void 0:c.call(i,t));W!==this.state.context&&ce(this,Jt,Xr).call(this,{type:"pending",context:W,variables:t,isPaused:s})}const F=await _(this,gn).start();return await((u=(d=_(this,lt).config).onSuccess)==null?void 0:u.call(d,F,t,this.state.context,this)),await((v=(h=this.options).onSuccess)==null?void 0:v.call(h,F,t,this.state.context)),await((b=(f=_(this,lt).config).onSettled)==null?void 0:b.call(f,F,null,this.state.variables,this.state.context,this)),await((g=(p=this.options).onSettled)==null?void 0:g.call(p,F,null,t,this.state.context)),ce(this,Jt,Xr).call(this,{type:"success",data:F}),F}catch(F){try{throw await((y=(x=_(this,lt).config).onError)==null?void 0:y.call(x,F,t,this.state.context,this)),await((k=(w=this.options).onError)==null?void 0:k.call(w,F,t,this.state.context)),await((M=(E=_(this,lt).config).onSettled)==null?void 0:M.call(E,void 0,F,this.state.variables,this.state.context,this)),await((P=(O=this.options).onSettled)==null?void 0:P.call(O,void 0,F,t,this.state.context)),F}finally{ce(this,Jt,Xr).call(this,{type:"error",error:F})}}finally{_(this,lt).runNext(this)}}},Xt=new WeakMap,lt=new WeakMap,gn=new WeakMap,Jt=new WeakSet,Xr=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Ke.batch(()=>{_(this,Xt).forEach(n=>{n.onMutationUpdate(t)}),_(this,lt).notify({mutation:this,type:"updated",action:t})})},Eh);function hd(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ty=(Ph=class extends An{constructor(t={}){super();ee(this,ur);ee(this,Vt);ee(this,zs);this.config=t,K(this,ur,new Set),K(this,Vt,new Map),K(this,zs,0)}build(t,r,n){const s=new ey({mutationCache:this,mutationId:++ta(this,zs)._,options:t.defaultMutationOptions(r),state:n});return this.add(s),s}add(t){_(this,ur).add(t);const r=xo(t);if(typeof r=="string"){const n=_(this,Vt).get(r);n?n.push(t):_(this,Vt).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(_(this,ur).delete(t)){const r=xo(t);if(typeof r=="string"){const n=_(this,Vt).get(r);if(n)if(n.length>1){const s=n.indexOf(t);s!==-1&&n.splice(s,1)}else n[0]===t&&_(this,Vt).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=xo(t);if(typeof r=="string"){const n=_(this,Vt).get(r),s=n==null?void 0:n.find(o=>o.state.status==="pending");return!s||s===t}else return!0}runNext(t){var n;const r=xo(t);if(typeof r=="string"){const s=(n=_(this,Vt).get(r))==null?void 0:n.find(o=>o!==t&&o.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Ke.batch(()=>{_(this,ur).forEach(t=>{this.notify({type:"removed",mutation:t})}),_(this,ur).clear(),_(this,Vt).clear()})}getAll(){return Array.from(_(this,ur))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>nd(r,n))}findAll(t={}){return this.getAll().filter(r=>nd(t,r))}notify(t){Ke.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return Ke.batch(()=>Promise.all(t.map(r=>r.continue().catch(nt))))}},ur=new WeakMap,Vt=new WeakMap,zs=new WeakMap,Ph);function xo(e){var t;return(t=e.options.scope)==null?void 0:t.id}function pd(e){return{onFetch:(t,r)=>{var u,h,v,f,b;const n=t.options,s=(v=(h=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:h.fetchMore)==null?void 0:v.direction,o=((f=t.state.data)==null?void 0:f.pages)||[],a=((b=t.state.data)==null?void 0:b.pageParams)||[];let i={pages:[],pageParams:[]},c=0;const d=async()=>{let p=!1;const g=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?p=!0:t.signal.addEventListener("abort",()=>{p=!0}),t.signal)})},x=ad(t.options,t.fetchOptions),y=async(w,k,E)=>{if(p)return Promise.reject();if(k==null&&w.pages.length)return Promise.resolve(w);const O=(()=>{const G={client:t.client,queryKey:t.queryKey,pageParam:k,direction:E?"backward":"forward",meta:t.options.meta};return g(G),G})(),P=await x(O),{maxPages:F}=t.options,W=E?Yg:zg;return{pages:W(w.pages,P,F),pageParams:W(w.pageParams,k,F)}};if(s&&o.length){const w=s==="backward",k=w?ry:md,E={pages:o,pageParams:a},M=k(n,E);i=await y(E,M,w)}else{const w=e??o.length;do{const k=c===0?a[0]??n.initialPageParam:md(n,i);if(c>0&&k==null)break;i=await y(i,k),c++}while(c<w)}return i};t.options.persister?t.fetchFn=()=>{var p,g;return(g=(p=t.options).persister)==null?void 0:g.call(p,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=d}}}function md(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function ry(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var ny=(Th=class{constructor(e={}){ee(this,Ue);ee(this,jr);ee(this,Ur);ee(this,Rn);ee(this,es);ee(this,Hr);ee(this,ts);ee(this,rs);K(this,Ue,e.queryCache||new Rg),K(this,jr,e.mutationCache||new ty),K(this,Ur,e.defaultOptions||{}),K(this,Rn,new Map),K(this,es,new Map),K(this,Hr,0)}mount(){ta(this,Hr)._++,_(this,Hr)===1&&(K(this,ts,ja.subscribe(async e=>{e&&(await this.resumePausedMutations(),_(this,Ue).onFocus())})),K(this,rs,wo.subscribe(async e=>{e&&(await this.resumePausedMutations(),_(this,Ue).onOnline())})))}unmount(){var e,t;ta(this,Hr)._--,_(this,Hr)===0&&((e=_(this,ts))==null||e.call(this),K(this,ts,void 0),(t=_(this,rs))==null||t.call(this),K(this,rs,void 0))}isFetching(e){return _(this,Ue).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return _(this,jr).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=_(this,Ue).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=_(this,Ue).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Sr(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return _(this,Ue).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),s=_(this,Ue).get(n.queryHash),o=s==null?void 0:s.state.data,a=Ug(t,o);if(a!==void 0)return _(this,Ue).build(this,n).setData(a,{...r,manual:!0})}setQueriesData(e,t,r){return Ke.batch(()=>_(this,Ue).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=_(this,Ue).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=_(this,Ue);Ke.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=_(this,Ue);return Ke.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=Ke.batch(()=>_(this,Ue).findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(nt).catch(nt)}invalidateQueries(e,t={}){return Ke.batch(()=>(_(this,Ue).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=Ke.batch(()=>_(this,Ue).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,r);return r.throwOnError||(o=o.catch(nt)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(n).then(nt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=_(this,Ue).build(this,t);return r.isStaleByTime(Sr(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(nt).catch(nt)}fetchInfiniteQuery(e){return e.behavior=pd(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(nt).catch(nt)}ensureInfiniteQueryData(e){return e.behavior=pd(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return wo.isOnline()?_(this,jr).resumePausedMutations():Promise.resolve()}getQueryCache(){return _(this,Ue)}getMutationCache(){return _(this,jr)}getDefaultOptions(){return _(this,Ur)}setDefaultOptions(e){K(this,Ur,e)}setQueryDefaults(e,t){_(this,Rn).set(rn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[..._(this,Rn).values()],r={};return t.forEach(n=>{ys(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){_(this,es).set(rn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[..._(this,es).values()],r={};return t.forEach(n=>{ys(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={..._(this,Ur).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Va(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===bo&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{..._(this,Ur).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){_(this,Ue).clear(),_(this,jr).clear()}},Ue=new WeakMap,jr=new WeakMap,Ur=new WeakMap,Rn=new WeakMap,es=new WeakMap,Hr=new WeakMap,ts=new WeakMap,rs=new WeakMap,Th),sy=(Oh=class extends An{constructor(t,r){super();ee(this,Ne);ee(this,vt);ee(this,ge);ee(this,Ys);ee(this,ct);ee(this,yn);ee(this,ns);ee(this,fr);ee(this,zr);ee(this,qs);ee(this,ss);ee(this,os);ee(this,bn);ee(this,wn);ee(this,Yr);ee(this,as,new Set);this.options=r,K(this,vt,t),K(this,zr,null),K(this,fr,Ua()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(_(this,ge).addObserver(this),vd(_(this,ge),this.options)?ce(this,Ne,Zs).call(this):this.updateResult(),ce(this,Ne,sl).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ha(_(this,ge),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ha(_(this,ge),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ce(this,Ne,ol).call(this),ce(this,Ne,al).call(this),_(this,ge).removeObserver(this)}setOptions(t){const r=this.options,n=_(this,ge);if(this.options=_(this,vt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof St(this.options.enabled,_(this,ge))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ce(this,Ne,il).call(this),_(this,ge).setOptions(this.options),r._defaulted&&!yo(this.options,r)&&_(this,vt).getQueryCache().notify({type:"observerOptionsUpdated",query:_(this,ge),observer:this});const s=this.hasListeners();s&&gd(_(this,ge),n,this.options,r)&&ce(this,Ne,Zs).call(this),this.updateResult(),s&&(_(this,ge)!==n||St(this.options.enabled,_(this,ge))!==St(r.enabled,_(this,ge))||Sr(this.options.staleTime,_(this,ge))!==Sr(r.staleTime,_(this,ge)))&&ce(this,Ne,tl).call(this);const o=ce(this,Ne,rl).call(this);s&&(_(this,ge)!==n||St(this.options.enabled,_(this,ge))!==St(r.enabled,_(this,ge))||o!==_(this,Yr))&&ce(this,Ne,nl).call(this,o)}getOptimisticResult(t){const r=_(this,vt).getQueryCache().build(_(this,vt),t),n=this.createResult(r,t);return ay(this,n)&&(K(this,ct,n),K(this,ns,this.options),K(this,yn,_(this,ge).state)),n}getCurrentResult(){return _(this,ct)}trackResult(t,r){return new Proxy(t,{get:(n,s)=>(this.trackProp(s),r==null||r(s),s==="promise"&&!this.options.experimental_prefetchInRender&&_(this,fr).status==="pending"&&_(this,fr).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),Reflect.get(n,s))})}trackProp(t){_(this,as).add(t)}getCurrentQuery(){return _(this,ge)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=_(this,vt).defaultQueryOptions(t),n=_(this,vt).getQueryCache().build(_(this,vt),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return ce(this,Ne,Zs).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),_(this,ct)))}createResult(t,r){var F;const n=_(this,ge),s=this.options,o=_(this,ct),a=_(this,yn),i=_(this,ns),d=t!==n?t.state:_(this,Ys),{state:u}=t;let h={...u},v=!1,f;if(r._optimisticResults){const W=this.hasListeners(),G=!W&&vd(t,r),D=W&&gd(t,n,r,s);(G||D)&&(h={...h,...fd(u.data,t.options)}),r._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:b,errorUpdatedAt:p,status:g}=h;f=h.data;let x=!1;if(r.placeholderData!==void 0&&f===void 0&&g==="pending"){let W;o!=null&&o.isPlaceholderData&&r.placeholderData===(i==null?void 0:i.placeholderData)?(W=o.data,x=!0):W=typeof r.placeholderData=="function"?r.placeholderData((F=_(this,os))==null?void 0:F.state.data,_(this,os)):r.placeholderData,W!==void 0&&(g="success",f=Wa(o==null?void 0:o.data,W,r),v=!0)}if(r.select&&f!==void 0&&!x)if(o&&f===(a==null?void 0:a.data)&&r.select===_(this,qs))f=_(this,ss);else try{K(this,qs,r.select),f=r.select(f),f=Wa(o==null?void 0:o.data,f,r),K(this,ss,f),K(this,zr,null)}catch(W){K(this,zr,W)}_(this,zr)&&(b=_(this,zr),f=_(this,ss),p=Date.now(),g="error");const y=h.fetchStatus==="fetching",w=g==="pending",k=g==="error",E=w&&y,M=f!==void 0,P={status:g,fetchStatus:h.fetchStatus,isPending:w,isSuccess:g==="success",isError:k,isInitialLoading:E,isLoading:E,data:f,dataUpdatedAt:h.dataUpdatedAt,error:b,errorUpdatedAt:p,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>d.dataUpdateCount||h.errorUpdateCount>d.errorUpdateCount,isFetching:y,isRefetching:y&&!w,isLoadingError:k&&!M,isPaused:h.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:k&&M,isStale:za(t,r),refetch:this.refetch,promise:_(this,fr),isEnabled:St(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const W=U=>{P.status==="error"?U.reject(P.error):P.data!==void 0&&U.resolve(P.data)},G=()=>{const U=K(this,fr,P.promise=Ua());W(U)},D=_(this,fr);switch(D.status){case"pending":t.queryHash===n.queryHash&&W(D);break;case"fulfilled":(P.status==="error"||P.data!==D.value)&&G();break;case"rejected":(P.status!=="error"||P.error!==D.reason)&&G();break}}return P}updateResult(){const t=_(this,ct),r=this.createResult(_(this,ge),this.options);if(K(this,yn,_(this,ge).state),K(this,ns,this.options),_(this,yn).data!==void 0&&K(this,os,_(this,ge)),yo(r,t))return;K(this,ct,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,o=typeof s=="function"?s():s;if(o==="all"||!o&&!_(this,as).size)return!0;const a=new Set(o??_(this,as));return this.options.throwOnError&&a.add("error"),Object.keys(_(this,ct)).some(i=>{const c=i;return _(this,ct)[c]!==t[c]&&a.has(c)})};ce(this,Ne,Fh).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ce(this,Ne,sl).call(this)}},vt=new WeakMap,ge=new WeakMap,Ys=new WeakMap,ct=new WeakMap,yn=new WeakMap,ns=new WeakMap,fr=new WeakMap,zr=new WeakMap,qs=new WeakMap,ss=new WeakMap,os=new WeakMap,bn=new WeakMap,wn=new WeakMap,Yr=new WeakMap,as=new WeakMap,Ne=new WeakSet,Zs=function(t){ce(this,Ne,il).call(this);let r=_(this,ge).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(nt)),r},tl=function(){ce(this,Ne,ol).call(this);const t=Sr(this.options.staleTime,_(this,ge));if(tn||_(this,ct).isStale||!La(t))return;const n=td(_(this,ct).dataUpdatedAt,t)+1;K(this,bn,setTimeout(()=>{_(this,ct).isStale||this.updateResult()},n))},rl=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(_(this,ge)):this.options.refetchInterval)??!1},nl=function(t){ce(this,Ne,al).call(this),K(this,Yr,t),!(tn||St(this.options.enabled,_(this,ge))===!1||!La(_(this,Yr))||_(this,Yr)===0)&&K(this,wn,setInterval(()=>{(this.options.refetchIntervalInBackground||ja.isFocused())&&ce(this,Ne,Zs).call(this)},_(this,Yr)))},sl=function(){ce(this,Ne,tl).call(this),ce(this,Ne,nl).call(this,ce(this,Ne,rl).call(this))},ol=function(){_(this,bn)&&(clearTimeout(_(this,bn)),K(this,bn,void 0))},al=function(){_(this,wn)&&(clearInterval(_(this,wn)),K(this,wn,void 0))},il=function(){const t=_(this,vt).getQueryCache().build(_(this,vt),this.options);if(t===_(this,ge))return;const r=_(this,ge);K(this,ge,t),K(this,Ys,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},Fh=function(t){Ke.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(_(this,ct))}),_(this,vt).getQueryCache().notify({query:_(this,ge),type:"observerResultsUpdated"})})},Oh);function oy(e,t){return St(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function vd(e,t){return oy(e,t)||e.state.data!==void 0&&Ha(e,t,t.refetchOnMount)}function Ha(e,t,r){if(St(t.enabled,e)!==!1&&Sr(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&za(e,t)}return!1}function gd(e,t,r,n){return(e!==t||St(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&za(e,r)}function za(e,t){return St(t.enabled,e)!==!1&&e.isStaleByTime(Sr(t.staleTime,e))}function ay(e,t){return!yo(e.getCurrentResult(),t)}var iy=(Mh=class extends An{constructor(r,n){super();ee(this,pr);ee(this,qr);ee(this,Zr);ee(this,gt);ee(this,hr);K(this,qr,r),this.setOptions(n),this.bindMethods(),ce(this,pr,ra).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var s;const n=this.options;this.options=_(this,qr).defaultMutationOptions(r),yo(this.options,n)||_(this,qr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:_(this,gt),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&rn(n.mutationKey)!==rn(this.options.mutationKey)?this.reset():((s=_(this,gt))==null?void 0:s.state.status)==="pending"&&_(this,gt).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=_(this,gt))==null||r.removeObserver(this)}onMutationUpdate(r){ce(this,pr,ra).call(this),ce(this,pr,ll).call(this,r)}getCurrentResult(){return _(this,Zr)}reset(){var r;(r=_(this,gt))==null||r.removeObserver(this),K(this,gt,void 0),ce(this,pr,ra).call(this),ce(this,pr,ll).call(this)}mutate(r,n){var s;return K(this,hr,n),(s=_(this,gt))==null||s.removeObserver(this),K(this,gt,_(this,qr).getMutationCache().build(_(this,qr),this.options)),_(this,gt).addObserver(this),_(this,gt).execute(r)}},qr=new WeakMap,Zr=new WeakMap,gt=new WeakMap,hr=new WeakMap,pr=new WeakSet,ra=function(){var n;const r=((n=_(this,gt))==null?void 0:n.state)??hd();K(this,Zr,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},ll=function(r){Ke.batch(()=>{var n,s,o,a,i,c,d,u;if(_(this,hr)&&this.hasListeners()){const h=_(this,Zr).variables,v=_(this,Zr).context;(r==null?void 0:r.type)==="success"?((s=(n=_(this,hr)).onSuccess)==null||s.call(n,r.data,h,v),(a=(o=_(this,hr)).onSettled)==null||a.call(o,r.data,null,h,v)):(r==null?void 0:r.type)==="error"&&((c=(i=_(this,hr)).onError)==null||c.call(i,r.error,h,v),(u=(d=_(this,hr)).onSettled)==null||u.call(d,void 0,r.error,h,v))}this.listeners.forEach(h=>{h(_(this,Zr))})})},Mh),yd=m.createContext(void 0),bd=e=>{const t=m.useContext(yd);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},ly=({client:e,children:t})=>(m.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(yd.Provider,{value:e,children:t})),wd=m.createContext(!1),cy=()=>m.useContext(wd);wd.Provider;function dy(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var uy=m.createContext(dy()),fy=()=>m.useContext(uy),hy=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},py=e=>{m.useEffect(()=>{e.clearReset()},[e])},my=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&e.data===void 0||id(r,[e.error,n])),vy=e=>{if(e.suspense){const t=n=>n==="static"?n:Math.max(n??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...n)=>t(r(...n)):t(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},gy=(e,t)=>e.isLoading&&e.isFetching&&!t,yy=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,xd=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function by(e,t,r){var h,v,f,b,p;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const n=cy(),s=fy(),o=bd(),a=o.defaultQueryOptions(e);(v=(h=o.getDefaultOptions().queries)==null?void 0:h._experimental_beforeQuery)==null||v.call(h,a),process.env.NODE_ENV!=="production"&&(a.queryFn||console.error(`[${a.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),a._optimisticResults=n?"isRestoring":"optimistic",vy(a),hy(a,s),py(s);const i=!o.getQueryCache().get(a.queryHash),[c]=m.useState(()=>new t(o,a)),d=c.getOptimisticResult(a),u=!n&&e.subscribed!==!1;if(m.useSyncExternalStore(m.useCallback(g=>{const x=u?c.subscribe(Ke.batchCalls(g)):nt;return c.updateResult(),x},[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),m.useEffect(()=>{c.setOptions(a)},[a,c]),yy(a,d))throw xd(a,c,s);if(my({result:d,errorResetBoundary:s,throwOnError:a.throwOnError,query:o.getQueryCache().get(a.queryHash),suspense:a.suspense}))throw d.error;if((b=(f=o.getDefaultOptions().queries)==null?void 0:f._experimental_afterQuery)==null||b.call(f,a,d),a.experimental_prefetchInRender&&!tn&&gy(d,n)){const g=i?xd(a,c,s):(p=o.getQueryCache().get(a.queryHash))==null?void 0:p.promise;g==null||g.catch(nt).finally(()=>{c.updateResult()})}return a.notifyOnChangeProps?d:c.trackResult(d)}function wy(e,t){return by(e,sy)}function _d(e,t){const r=bd(),[n]=m.useState(()=>new iy(r,e));m.useEffect(()=>{n.setOptions(e)},[n,e]);const s=m.useSyncExternalStore(m.useCallback(a=>n.subscribe(Ke.batchCalls(a)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),o=m.useCallback((a,i)=>{n.mutate(a,i).catch(nt)},[n]);if(s.error&&id(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:o,mutateAsync:s.mutate}}const _o=ha("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),He=m.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...s},o)=>{const a=n?fl:"button";return l.jsx(a,{className:he(_o({variant:t,size:r,className:e})),ref:o,...s})});He.displayName="Button";const st=m.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,className:he("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));st.displayName="Card";const kr=m.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,className:he("flex flex-col space-y-1.5 p-6",e),...t}));kr.displayName="CardHeader";const Ya=m.forwardRef(({className:e,...t},r)=>l.jsx("h3",{ref:r,className:he("text-2xl font-semibold leading-none tracking-tight",e),...t}));Ya.displayName="CardTitle";const xy=m.forwardRef(({className:e,...t},r)=>l.jsx("p",{ref:r,className:he("text-sm text-muted-foreground",e),...t}));xy.displayName="CardDescription";const ot=m.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,className:he("p-6 pt-0",e),...t}));ot.displayName="CardContent";const _y=m.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,className:he("flex items-center p-6 pt-0",e),...t}));_y.displayName="CardFooter";const Cd=({title:e="Verify your identity",subtitle:t="We need some information to help us confirm your identity.",onContinue:r})=>l.jsx(st,{className:"w-full max-w-md mx-auto",children:l.jsxs(ot,{className:"pt-8 text-center",children:[l.jsx("div",{className:"bg-gradient-to-br from-primary/10 to-primary/5 rounded-3xl p-8 mb-8",children:l.jsx("div",{className:"relative mb-8",children:l.jsxs("div",{className:"relative mx-auto w-48 h-32",children:[l.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-primary to-primary/80 rounded-2xl transform rotate-3 shadow-lg",children:l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx("div",{className:"w-12 h-12 bg-white/20 rounded-full flex items-center justify-center",children:l.jsx("svg",{viewBox:"0 0 24 24",className:"w-6 h-6 text-white",fill:"currentColor",children:l.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})})})})}),l.jsx("div",{className:"absolute top-4 right-0 bg-card rounded-xl shadow-lg p-4 transform -rotate-3",children:l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx("div",{className:"w-8 h-8 bg-primary/20 rounded-full"}),l.jsxs("div",{className:"space-y-1",children:[l.jsx("div",{className:"w-12 h-2 bg-primary rounded"}),l.jsx("div",{className:"w-8 h-2 bg-primary/60 rounded"})]})]})}),l.jsx("div",{className:"absolute -top-2 -right-2 w-10 h-10 bg-primary rounded-full flex items-center justify-center shadow-lg",children:l.jsx(Xl,{className:"w-6 h-6 text-white"})})]})})}),l.jsx("h1",{className:"text-3xl font-bold text-foreground mb-4",children:e}),l.jsx("p",{className:"text-lg text-muted-foreground mb-12",children:t}),l.jsx(He,{className:"w-full h-14 text-lg font-semibold",onClick:r,children:"Start"}),l.jsx("p",{className:"text-sm text-muted-foreground mt-6",children:"Verifying usually takes a few seconds."})]})}),ft=m.forwardRef(({className:e,type:t,...r},n)=>l.jsx("input",{type:t,className:he("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...r}));ft.displayName="Input";var Cy="Label",Sd=m.forwardRef((e,t)=>l.jsx(we.label,{...e,ref:t,onMouseDown:r=>{var s;r.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));Sd.displayName=Cy;var kd=Sd;const Sy=ha("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),nn=m.forwardRef(({className:e,...t},r)=>l.jsx(kd,{ref:r,className:he(Sy(),e),...t}));nn.displayName=kd.displayName;const ky=({fullName:e,onNameChange:t,onContinue:r,renderProgress:n})=>l.jsxs(st,{className:"w-full max-w-md mx-auto",children:[l.jsxs(kr,{className:"text-center",children:[l.jsx(jp,{className:"w-12 h-12 mx-auto mb-4 text-primary"}),l.jsx(Ya,{children:"Personal Information"}),l.jsx("p",{className:"text-muted-foreground",children:"Please enter your full legal name"})]}),l.jsxs(ot,{children:[l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx(nn,{htmlFor:"fullName",children:"Full Name"}),l.jsx(ft,{id:"fullName",placeholder:"Enter your full name",value:e,onChange:s=>t(s.target.value)})]}),l.jsx(He,{className:"w-full",onClick:r,disabled:!e.trim(),children:"Continue"})]}),l.jsx("div",{className:"mt-6",children:n()})]})]}),Nr=({title:e,subTitle:t,onBack:r})=>l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex items-center mb-6",children:[l.jsx(He,{variant:"ghost",size:"icon",className:"mr-2",onClick:r,children:l.jsx(Zl,{className:"w-6 h-6"})}),l.jsx("h1",{className:"text-2xl font-semibold ml-4",children:e})]}),l.jsx("p",{className:"text-center text-muted-foreground mb-6",children:t})]}),Ny=({selectedDocumentType:e,onDocumentTypeChange:t,onContinue:r,onBack:n,renderProgress:s})=>{const o=[{id:"id-card",title:"ID Card",description:"Government-issued personal ID.",icon:Bp},{id:"drivers-license",title:"Drivers license",description:"Government-issued Drivers license",icon:Ip},{id:"passport",title:"Passport",description:"Your official travel document.",icon:Dp},{id:"voter-id",title:"Voter ID",description:"Government-issued Voter ID",icon:Up}];return l.jsx(st,{className:"w-full max-w-md mx-auto",children:l.jsxs(ot,{className:"p-6",children:[l.jsx(Nr,{title:"Upload ID",subTitle:"Choose the document type you would like to identify with",onBack:n}),l.jsx("div",{className:"space-y-3",children:o.map(a=>{const i=a.icon;return l.jsx("button",{className:`w-full p-4 rounded-lg border text-left transition-colors hover:bg-muted/50 ${e===a.id?"border-primary bg-primary/5":"border-border"}`,onClick:()=>t(a.id),children:l.jsxs("div",{className:"flex items-center space-x-4",children:[l.jsx("div",{className:"w-12 h-12 bg-primary rounded-full flex items-center justify-center",children:l.jsx(i,{className:"w-6 h-6 text-white"})}),l.jsxs("div",{className:"flex-1",children:[l.jsx("h3",{className:"font-semibold text-foreground",children:a.title}),l.jsx("p",{className:"text-sm text-muted-foreground",children:a.description})]})]})},a.id)})}),l.jsx(He,{className:"w-full mt-6",onClick:r,disabled:!e,children:"Continue"}),l.jsx("div",{className:"mt-6",children:s()})]})})},Nd=({onContinue:e,onBack:t})=>l.jsx(st,{className:"w-full max-w-md mx-auto",children:l.jsxs(ot,{className:"p-6",children:[l.jsx(Nr,{title:"Selfie",subTitle:"Make sure your face is clear and is fully inside the frame.",onBack:t}),l.jsx("div",{className:"m-auto w-44 h-80 bg-gradient-to-br from-primary/20 to-primary/40 rounded-3xl p-4 shadow-2xl",children:l.jsx("div",{className:"w-full h-full bg-background rounded-2xl overflow-hidden relative",children:l.jsx("div",{className:"flex items-center justify-center h-full bg-muted/30",children:l.jsxs("div",{className:"text-center",children:[l.jsx("div",{className:"w-16 h-16 bg-primary rounded-full flex items-center justify-center mx-auto mb-2"}),l.jsx("div",{className:"w-28 h-32 bg-primary/30 rounded-2xl mx-auto"})]})})})}),l.jsx("div",{className:"mt-8",children:l.jsx(He,{onClick:e,className:"w-full h-12 text-lg font-semibold",children:"Take a selfie"})})]})}),Ey=({fullName:e,onComplete:t,onStartOver:r})=>l.jsxs(st,{className:"w-full max-w-md mx-auto",children:[l.jsxs(kr,{className:"text-center",children:[l.jsx(Xl,{className:"w-12 h-12 mx-auto mb-4 text-green-500"}),l.jsx(Ya,{children:"Review Information"}),l.jsx("p",{className:"text-muted-foreground",children:"Please review your information before submitting"})]}),l.jsx(ot,{children:l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx(nn,{children:"Full Name"}),l.jsx("p",{className:"font-medium",children:e})]}),l.jsxs("div",{className:"grid grid-cols-3 gap-2 text-center",children:[l.jsxs("div",{children:[l.jsx(nn,{className:"text-xs",children:"Selfie"}),l.jsx("div",{className:"text-green-500",children:"✓"})]}),l.jsxs("div",{children:[l.jsx(nn,{className:"text-xs",children:"ID Front"}),l.jsx("div",{className:"text-green-500",children:"✓"})]}),l.jsxs("div",{children:[l.jsx(nn,{className:"text-xs",children:"ID Back"}),l.jsx("div",{className:"text-green-500",children:"✓"})]})]}),l.jsx(He,{className:"w-full text-md",onClick:t,children:"Complete Verification"}),l.jsx(He,{variant:"outline",className:"w-full text-md",onClick:r,children:"Start Over"})]})})]}),Ed=({onComplete:e})=>(S.useEffect(()=>{const t=setTimeout(()=>{e()},3e3);return()=>clearTimeout(t)},[e]),l.jsx(st,{className:"w-full max-w-md mx-auto min-h-[500px] flex items-center justify-center",children:l.jsxs(ot,{className:"text-center space-y-8",children:[l.jsx("div",{children:l.jsx("h2",{className:"text-2xl font-semibold text-foreground mb-2",children:"We're verifying your documents"})}),l.jsx("div",{className:"flex justify-center",children:l.jsx("div",{className:"w-16 h-16 border-4 border-primary border-t-transparent rounded-full animate-spin"})})]})})),Pd=({onDoneClick:e})=>l.jsx(st,{className:"w-full max-w-md mx-auto min-h-[500px] flex items-center justify-center",children:l.jsx(ot,{className:"text-center space-y-8",children:l.jsxs("div",{children:[l.jsx("h2",{className:"text-2xl font-semibold text-foreground mb-2",children:"Your documents have been submitted successfully"}),l.jsx("div",{className:"flex justify-center",children:l.jsx(Ql,{size:60,className:"text-primary"})}),l.jsx("p",{className:"text-foreground mt-2",children:"Our compliance team will review your information, and we'll notify you once verification is complete."}),l.jsx("p",{className:"text-foreground mt-2",children:"Thank you for your patience."}),l.jsx(He,{className:"text-md mt-8",onClick:e,children:"Explore App"})]})})}),Dn=({currentStep:e,onRetake:t,onConfirm:r,onBack:n,title:s,description:o,frameType:a})=>{const[i,c]=S.useState(null),[d,u]=S.useState(null),h=S.useRef(null),v=S.useRef(null),f=!!i,{toast:b}=Gs();S.useEffect(()=>{i&&h.current&&(h.current.srcObject=i)},[i]);const p=S.useMemo(()=>d&&URL.createObjectURL(d),[d]);S.useEffect(()=>()=>{console.log("REVOKEEEEEE",p)},[p]);const g=S.useCallback(async()=>{try{const O=await navigator.mediaDevices.getUserMedia({video:{facingMode:e==="selfie"?"user":"environment",width:{ideal:1280},height:{ideal:720}}});c(O)}catch{b({title:"Camera Error",description:"Unable to access camera. Please check permissions.",variant:"destructive"})}},[e,b]);S.useEffect(()=>{!i&&!d&&g()},[e,d,i]);const x=S.useCallback(()=>{i&&(i.getTracks().forEach(O=>O.stop()),c(null))},[i]),y=S.useCallback(()=>{if(!h.current||!v.current)return;const O=h.current,P=v.current,F=P.getContext("2d");F&&(P.width=O.videoWidth,P.height=O.videoHeight,F.drawImage(O,0,0),P.toBlob(W=>{if(W){const G=new File([W],`${e}-${Date.now()}.jpg`,{type:"image/jpeg"});u(G),x(),b({title:"Photo Captured",description:"Photo captured successfully"})}},"image/jpeg",.8))},[e,x,b]);S.useEffect(()=>()=>{x()},[x]);const w=()=>{u(null),x(),n()},k=()=>{u(null),t()},E=()=>{r(d),u(null)},M=()=>l.jsx(st,{className:"w-full max-w-md mx-auto",children:l.jsxs(ot,{className:"p-6",children:[l.jsx(Nr,{title:"Review picture",subTitle:"Make sure the information is seen clearly, with no blur or glare.",onBack:w}),l.jsx("div",{className:"mb-8",children:l.jsx("div",{className:"relative",children:l.jsx("img",{src:p,alt:"Captured photo",className:"w-full h-64 object-cover rounded-2xl bg-muted"})})}),l.jsxs("div",{className:"flex gap-4",children:[l.jsx(He,{variant:"outline",onClick:k,className:"flex-1 text-md",children:"Take again"}),l.jsx(He,{onClick:E,className:"flex-1 text-md",children:"Looks good"})]})]})});return d?M():l.jsx(st,{className:"w-full max-w-md mx-auto border-gray-900 bg-gray-900",children:l.jsxs(ot,{className:" text-white flex flex-col",children:[l.jsxs("div",{className:"flex items-center p-6",children:[l.jsx(He,{variant:"ghost",size:"sm",onClick:w,className:"text-white hover:bg-gray-800",children:l.jsx(Zl,{className:"h-6 w-6"})}),l.jsx("h1",{className:"text-xl font-semibold ml-4",children:s})]}),l.jsx("div",{className:"px-6 mb-8",children:l.jsx("p",{className:"text-gray-300 text-center",children:o})}),l.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-6",children:[l.jsx("div",{className:"relative mb-16",children:f?l.jsxs(l.Fragment,{children:[l.jsx("video",{ref:h,autoPlay:!0,playsInline:!0,className:`bg-gray-800 object-cover ${a==="circular"?"w-80 h-80 rounded-full":"w-80 h-48 rounded-2xl"}`}),l.jsx("canvas",{ref:v,className:"hidden"})]}):l.jsx("div",{className:`bg-gray-700 flex items-center justify-center ${a==="circular"?"w-80 h-80 rounded-full":"w-80 h-48 rounded-2xl"}`,children:l.jsx("p",{className:"text-gray-400",children:"Camera loading..."})})}),l.jsx(He,{onClick:f?y:g,size:"lg",className:"w-16 h-16 rounded-full bg-white hover:bg-gray-100 border-4 border-gray-600 p-0",disabled:!f,children:l.jsx("div",{className:"w-8 h-8 rounded-full bg-white"})})]})]})})},Py=({apiEndpoint:e,apiKey:t,onComplete:r,onDoneClick:n})=>{const[s,o]=S.useState("landing"),[a,i]=S.useState(""),[c,d]=S.useState(""),[u,h]=S.useState(null),[v,f]=S.useState(null),[b,p]=S.useState(null),{data:g}=My(e,t),x=_d({mutationFn:Ty}),{toast:y}=Gs(),w=S.useMemo(()=>[...g!=null&&g.hide_name_step?[]:["name"],...g!=null&&g.hide_document_selection_step?[]:["document-selection"],"selfie","pre-selfie","id-front","id-back","verify"],[g]),k=()=>g.hide_name_step?g.hide_document_selection_step?"id-front":"document-selection":"name",E=async()=>{if((g.hide_name_step||!!a)&&u&&v&&b){const F={full_name:a,selfie_photo:u,id_photo:v,id_photo_back:b},W=await x.mutateAsync({apiEndpoint:e,apiKey:t,data:F});r(W.data.token,F),y({title:"KYC Complete",description:"Identity verification completed successfully"}),i(""),h(null),f(null),p(null),o("done")}},M=()=>l.jsx(l.Fragment,{children:s!=="landing"&&l.jsx("div",{className:"flex justify-center",children:l.jsx("div",{className:"flex space-x-2",children:w.map((P,F)=>l.jsx("div",{className:`w-3 h-3 rounded-full ${w.indexOf(s)>=F?"bg-primary":"bg-muted"}`},P))})})}),O=()=>{switch(console.log("currentStep",s),s){case"landing":return l.jsx(Cd,{onContinue:()=>o(k())});case"name":return l.jsx(ky,{fullName:a,onNameChange:i,onContinue:()=>o(g.hide_document_selection_step?"id-front":"document-selection"),renderProgress:M});case"document-selection":return l.jsx(Ny,{selectedDocumentType:c,onDocumentTypeChange:d,onContinue:()=>o("id-front"),onBack:()=>o(g.hide_name_step?"landing":"name"),renderProgress:M});case"id-front":return l.jsx(Dn,{title:"Upload ID",description:"Place your ID inside the frame and take a picture. Make sure it is not cut or has any glare.",frameType:"rectangular",currentStep:s,onRetake:()=>{f(null)},onConfirm:P=>{f(P),o("id-back")},onBack:()=>{f(null),o(g.hide_document_selection_step?g.hide_name_step?"landing":"name":"document-selection")}});case"id-back":return l.jsx(Dn,{title:"Upload ID Back",description:"Place the back of your ID inside the frame and take a picture. Make sure it is not cut or has any glare.",frameType:"rectangular",currentStep:s,onRetake:()=>{p(null)},onConfirm:P=>{p(P),o("pre-selfie")},onBack:()=>{p(null),o("id-front")}});case"pre-selfie":return l.jsx(Nd,{onContinue:()=>o("selfie"),onBack:()=>o("id-back")});case"selfie":return l.jsx(Dn,{title:"Selfie",description:"Place your face inside the frame and take a picture. Make sure it is clearly visible.",frameType:"circular",currentStep:s,onRetake:()=>{h(null)},onConfirm:P=>{h(P),o("verify")},onBack:()=>{h(null),o("id-back")}});case"verify":return l.jsx(Ey,{fullName:a,onComplete:()=>o("processing"),onStartOver:()=>o("landing")});case"processing":return l.jsx(Ed,{onComplete:E});case"done":return l.jsx(Pd,{onDoneClick:n});default:return null}};return l.jsx("div",{className:"w-[430px]",children:O()})};async function Ty({apiEndpoint:e,apiKey:t,data:r}){const n=new FormData;n.append("full_name",r.full_name),n.append("selfie_photo",r.selfie_photo,r.selfie_photo.name),n.append("id_photo",r.id_photo,r.id_photo.name),n.append("id_photo_back",r.id_photo_back,r.id_photo_back.name);const s=await fetch(`${e}/api/kyc`,{method:"POST",headers:{"X-API-Key":t},body:n});if(!s.ok)throw new Error("Network response was not ok");return s.json()}const Oy=async(e,t)=>{const r=await fetch(`${e}/api/settings`,{method:"GET",headers:{"X-API-Key":t,"Content-Type":"application/json"}});if(!r.ok)throw new Error("Network response was not ok");return(await r.json()).data},My=(e,t)=>wy({queryKey:["settings",e,t],queryFn:()=>Oy(e,t),enabled:!!e&&!!t});var bs=e=>e.type==="checkbox",sn=e=>e instanceof Date,at=e=>e==null;const Td=e=>typeof e=="object";var ze=e=>!at(e)&&!Array.isArray(e)&&Td(e)&&!sn(e),Od=e=>ze(e)&&e.target?bs(e.target)?e.target.checked:e.target.value:e,Ay=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Md=(e,t)=>e.has(Ay(t)),Dy=e=>{const t=e.constructor&&e.constructor.prototype;return ze(t)&&t.hasOwnProperty("isPrototypeOf")},qa=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Qe(e){let t;const r=Array.isArray(e),n=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(qa&&(e instanceof Blob||n))&&(r||ze(e)))if(t=r?[]:{},!r&&!Dy(e))t=e;else for(const s in e)e.hasOwnProperty(s)&&(t[s]=Qe(e[s]));else return e;return t}var Co=e=>/^\w*$/.test(e),Ye=e=>e===void 0,Za=e=>Array.isArray(e)?e.filter(Boolean):[],Ka=e=>Za(e.replace(/["|']|\]/g,"").split(/\.|\[/)),z=(e,t,r)=>{if(!t||!ze(e))return r;const n=(Co(t)?[t]:Ka(t)).reduce((s,o)=>at(s)?s:s[o],e);return Ye(n)||n===e?Ye(e[t])?r:e[t]:n},xt=e=>typeof e=="boolean",Ee=(e,t,r)=>{let n=-1;const s=Co(t)?[t]:Ka(t),o=s.length,a=o-1;for(;++n<o;){const i=s[n];let c=r;if(n!==a){const d=e[i];c=ze(d)||Array.isArray(d)?d:isNaN(+s[n+1])?{}:[]}if(i==="__proto__"||i==="constructor"||i==="prototype")return;e[i]=c,e=e[i]}};const So={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Mt={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},ar={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Qa=S.createContext(null);Qa.displayName="HookFormContext";const ko=()=>S.useContext(Qa),Iy=e=>{const{children:t,...r}=e;return S.createElement(Qa.Provider,{value:r},t)};var Ad=(e,t,r,n=!0)=>{const s={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(s,o,{get:()=>{const a=o;return t._proxyFormState[a]!==Mt.all&&(t._proxyFormState[a]=!n||Mt.all),r&&(r[a]=!0),e[a]}});return s};const Ga=typeof window<"u"?S.useLayoutEffect:S.useEffect;function Fy(e){const t=ko(),{control:r=t.control,disabled:n,name:s,exact:o}=e||{},[a,i]=S.useState(r._formState),c=S.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Ga(()=>r._subscribe({name:s,formState:c.current,exact:o,callback:d=>{!n&&i({...r._formState,...d})}}),[s,n,o]),S.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),S.useMemo(()=>Ad(a,r,c.current,!1),[a,r])}var Yt=e=>typeof e=="string",Dd=(e,t,r,n,s)=>Yt(e)?(n&&t.watch.add(e),z(r,e,s)):Array.isArray(e)?e.map(o=>(n&&t.watch.add(o),z(r,o))):(n&&(t.watchAll=!0),r),Xa=e=>at(e)||!Td(e);function ir(e,t,r=new WeakSet){if(Xa(e)||Xa(t))return e===t;if(sn(e)&&sn(t))return e.getTime()===t.getTime();const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const o of n){const a=e[o];if(!s.includes(o))return!1;if(o!=="ref"){const i=t[o];if(sn(a)&&sn(i)||ze(a)&&ze(i)||Array.isArray(a)&&Array.isArray(i)?!ir(a,i,r):a!==i)return!1}}return!0}function Ly(e){const t=ko(),{control:r=t.control,name:n,defaultValue:s,disabled:o,exact:a,compute:i}=e||{},c=S.useRef(s),d=S.useRef(i),u=S.useRef(void 0);d.current=i;const h=S.useMemo(()=>r._getWatch(n,c.current),[r,n]),[v,f]=S.useState(d.current?d.current(h):h);return Ga(()=>r._subscribe({name:n,formState:{values:!0},exact:a,callback:b=>{if(!o){const p=Dd(n,r._names,b.values||r._formValues,!1,c.current);if(d.current){const g=d.current(p);ir(g,u.current)||(f(g),u.current=g)}else f(p)}}}),[r,o,n,a]),S.useEffect(()=>r._removeUnmounted()),v}function Vy(e){const t=ko(),{name:r,disabled:n,control:s=t.control,shouldUnregister:o,defaultValue:a}=e,i=Md(s._names.array,r),c=S.useMemo(()=>z(s._formValues,r,z(s._defaultValues,r,a)),[s,r,a]),d=Ly({control:s,name:r,defaultValue:c,exact:!0}),u=Fy({control:s,name:r,exact:!0}),h=S.useRef(e),v=S.useRef(s.register(r,{...e.rules,value:d,...xt(e.disabled)?{disabled:e.disabled}:{}}));h.current=e;const f=S.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!z(u.errors,r)},isDirty:{enumerable:!0,get:()=>!!z(u.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!z(u.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!z(u.validatingFields,r)},error:{enumerable:!0,get:()=>z(u.errors,r)}}),[u,r]),b=S.useCallback(y=>v.current.onChange({target:{value:Od(y),name:r},type:So.CHANGE}),[r]),p=S.useCallback(()=>v.current.onBlur({target:{value:z(s._formValues,r),name:r},type:So.BLUR}),[r,s._formValues]),g=S.useCallback(y=>{const w=z(s._fields,r);w&&y&&(w._f.ref={focus:()=>y.focus&&y.focus(),select:()=>y.select&&y.select(),setCustomValidity:k=>y.setCustomValidity(k),reportValidity:()=>y.reportValidity()})},[s._fields,r]),x=S.useMemo(()=>({name:r,value:d,...xt(n)||u.disabled?{disabled:u.disabled||n}:{},onChange:b,onBlur:p,ref:g}),[r,n,u.disabled,b,p,g,d]);return S.useEffect(()=>{const y=s._options.shouldUnregister||o;s.register(r,{...h.current.rules,...xt(h.current.disabled)?{disabled:h.current.disabled}:{}});const w=(k,E)=>{const M=z(s._fields,k);M&&M._f&&(M._f.mount=E)};if(w(r,!0),y){const k=Qe(z(s._options.defaultValues,r));Ee(s._defaultValues,r,k),Ye(z(s._formValues,r))&&Ee(s._formValues,r,k)}return!i&&s.register(r),()=>{(i?y&&!s._state.action:y)?s.unregister(r):w(r,!1)}},[r,s,i,o]),S.useEffect(()=>{s._setDisabledField({disabled:n,name:r})},[n,r,s]),S.useMemo(()=>({field:x,formState:u,fieldState:f}),[x,u,f])}const $y=e=>e.render(Vy(e));var Id=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},ws=e=>Array.isArray(e)?e:[e],Fd=()=>{let e=[];return{get observers(){return e},next:s=>{for(const o of e)o.next&&o.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(o=>o!==s)}}),unsubscribe:()=>{e=[]}}},ht=e=>ze(e)&&!Object.keys(e).length,Ja=e=>e.type==="file",At=e=>typeof e=="function",No=e=>{if(!qa)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Ld=e=>e.type==="select-multiple",Ra=e=>e.type==="radio",By=e=>Ra(e)||bs(e),ei=e=>No(e)&&e.isConnected;function Wy(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=Ye(e)?n++:e[t[n++]];return e}function jy(e){for(const t in e)if(e.hasOwnProperty(t)&&!Ye(e[t]))return!1;return!0}function Ze(e,t){const r=Array.isArray(t)?t:Co(t)?[t]:Ka(t),n=r.length===1?e:Wy(e,r),s=r.length-1,o=r[s];return n&&delete n[o],s!==0&&(ze(n)&&ht(n)||Array.isArray(n)&&jy(n))&&Ze(e,r.slice(0,-1)),e}var Vd=e=>{for(const t in e)if(At(e[t]))return!0;return!1};function Eo(e,t={}){const r=Array.isArray(e);if(ze(e)||r)for(const n in e)Array.isArray(e[n])||ze(e[n])&&!Vd(e[n])?(t[n]=Array.isArray(e[n])?[]:{},Eo(e[n],t[n])):at(e[n])||(t[n]=!0);return t}function $d(e,t,r){const n=Array.isArray(e);if(ze(e)||n)for(const s in e)Array.isArray(e[s])||ze(e[s])&&!Vd(e[s])?Ye(t)||Xa(r[s])?r[s]=Array.isArray(e[s])?Eo(e[s],[]):{...Eo(e[s])}:$d(e[s],at(t)?{}:t[s],r[s]):r[s]=!ir(e[s],t[s]);return r}var xs=(e,t)=>$d(e,t,Eo(t));const Bd={value:!1,isValid:!1},Wd={value:!0,isValid:!0};var jd=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Ye(e[0].attributes.value)?Ye(e[0].value)||e[0].value===""?Wd:{value:e[0].value,isValid:!0}:Wd:Bd}return Bd},Ud=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Ye(e)?e:t?e===""?NaN:e&&+e:r&&Yt(e)?new Date(e):n?n(e):e;const Hd={isValid:!1,value:null};var zd=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,Hd):Hd;function Yd(e){const t=e.ref;return Ja(t)?t.files:Ra(t)?zd(e.refs).value:Ld(t)?[...t.selectedOptions].map(({value:r})=>r):bs(t)?jd(e.refs).value:Ud(Ye(t.value)?e.ref.value:t.value,e)}var Uy=(e,t,r,n)=>{const s={};for(const o of e){const a=z(t,o);a&&Ee(s,o,a._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}},Po=e=>e instanceof RegExp,_s=e=>Ye(e)?e:Po(e)?e.source:ze(e)?Po(e.value)?e.value.source:e.value:e,qd=e=>({isOnSubmit:!e||e===Mt.onSubmit,isOnBlur:e===Mt.onBlur,isOnChange:e===Mt.onChange,isOnAll:e===Mt.all,isOnTouch:e===Mt.onTouched});const Zd="AsyncFunction";var Hy=e=>!!e&&!!e.validate&&!!(At(e.validate)&&e.validate.constructor.name===Zd||ze(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===Zd)),zy=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Kd=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const Cs=(e,t,r,n)=>{for(const s of r||Object.keys(e)){const o=z(e,s);if(o){const{_f:a,...i}=o;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],s)&&!n)return!0;if(a.ref&&t(a.ref,a.name)&&!n)return!0;if(Cs(i,t))break}else if(ze(i)&&Cs(i,t))break}}};function Qd(e,t,r){const n=z(e,r);if(n||Co(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const o=s.join("."),a=z(t,o),i=z(e,o);if(a&&!Array.isArray(a)&&r!==o)return{name:r};if(i&&i.type)return{name:o,error:i};if(i&&i.root&&i.root.type)return{name:`${o}.root`,error:i.root};s.pop()}return{name:r}}var Yy=(e,t,r,n)=>{r(e);const{name:s,...o}=e;return ht(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(a=>t[a]===(!n||Mt.all))},qy=(e,t,r)=>!e||!t||e===t||ws(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),Zy=(e,t,r,n,s)=>s.isOnAll?!1:!r&&s.isOnTouch?!(t||e):(r?n.isOnBlur:s.isOnBlur)?!e:(r?n.isOnChange:s.isOnChange)?e:!0,Ky=(e,t)=>!Za(z(e,t)).length&&Ze(e,t),Qy=(e,t,r)=>{const n=ws(z(e,r));return Ee(n,"root",t[r]),Ee(e,r,n),e},To=e=>Yt(e);function Gd(e,t,r="validate"){if(To(e)||Array.isArray(e)&&e.every(To)||xt(e)&&!e)return{type:r,message:To(e)?e:"",ref:t}}var In=e=>ze(e)&&!Po(e)?e:{value:e,message:""},Xd=async(e,t,r,n,s,o)=>{const{ref:a,refs:i,required:c,maxLength:d,minLength:u,min:h,max:v,pattern:f,validate:b,name:p,valueAsNumber:g,mount:x}=e._f,y=z(r,p);if(!x||t.has(p))return{};const w=i?i[0]:a,k=D=>{s&&w.reportValidity&&(w.setCustomValidity(xt(D)?"":D||""),w.reportValidity())},E={},M=Ra(a),O=bs(a),P=M||O,F=(g||Ja(a))&&Ye(a.value)&&Ye(y)||No(a)&&a.value===""||y===""||Array.isArray(y)&&!y.length,W=Id.bind(null,p,n,E),G=(D,U,L,J=ar.maxLength,Y=ar.minLength)=>{const I=D?U:L;E[p]={type:D?J:Y,message:I,ref:a,...W(D?J:Y,I)}};if(o?!Array.isArray(y)||!y.length:c&&(!P&&(F||at(y))||xt(y)&&!y||O&&!jd(i).isValid||M&&!zd(i).isValid)){const{value:D,message:U}=To(c)?{value:!!c,message:c}:In(c);if(D&&(E[p]={type:ar.required,message:U,ref:w,...W(ar.required,U)},!n))return k(U),E}if(!F&&(!at(h)||!at(v))){let D,U;const L=In(v),J=In(h);if(!at(y)&&!isNaN(y)){const Y=a.valueAsNumber||y&&+y;at(L.value)||(D=Y>L.value),at(J.value)||(U=Y<J.value)}else{const Y=a.valueAsDate||new Date(y),I=ae=>new Date(new Date().toDateString()+" "+ae),A=a.type=="time",B=a.type=="week";Yt(L.value)&&y&&(D=A?I(y)>I(L.value):B?y>L.value:Y>new Date(L.value)),Yt(J.value)&&y&&(U=A?I(y)<I(J.value):B?y<J.value:Y<new Date(J.value))}if((D||U)&&(G(!!D,L.message,J.message,ar.max,ar.min),!n))return k(E[p].message),E}if((d||u)&&!F&&(Yt(y)||o&&Array.isArray(y))){const D=In(d),U=In(u),L=!at(D.value)&&y.length>+D.value,J=!at(U.value)&&y.length<+U.value;if((L||J)&&(G(L,D.message,U.message),!n))return k(E[p].message),E}if(f&&!F&&Yt(y)){const{value:D,message:U}=In(f);if(Po(D)&&!y.match(D)&&(E[p]={type:ar.pattern,message:U,ref:a,...W(ar.pattern,U)},!n))return k(U),E}if(b){if(At(b)){const D=await b(y,r),U=Gd(D,w);if(U&&(E[p]={...U,...W(ar.validate,U.message)},!n))return k(U.message),E}else if(ze(b)){let D={};for(const U in b){if(!ht(D)&&!n)break;const L=Gd(await b[U](y,r),w,U);L&&(D={...L,...W(U,L.message)},k(L.message),n&&(E[p]=D))}if(!ht(D)&&(E[p]={ref:w,...D},!n))return E}}return k(!0),E};const Gy={mode:Mt.onSubmit,reValidateMode:Mt.onChange,shouldFocusError:!0};function Xy(e={}){let t={...Gy,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:At(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},s=ze(t.defaultValues)||ze(t.values)?Qe(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:Qe(s),a={action:!1,mount:!1,watch:!1},i={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,d=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let h={...u};const v={array:Fd(),state:Fd()},f=t.criteriaMode===Mt.all,b=C=>N=>{clearTimeout(d),d=setTimeout(C,N)},p=async C=>{if(!t.disabled&&(u.isValid||h.isValid||C)){const N=t.resolver?ht((await O()).errors):await F(n,!0);N!==r.isValid&&v.state.next({isValid:N})}},g=(C,N)=>{!t.disabled&&(u.isValidating||u.validatingFields||h.isValidating||h.validatingFields)&&((C||Array.from(i.mount)).forEach(T=>{T&&(N?Ee(r.validatingFields,T,N):Ze(r.validatingFields,T))}),v.state.next({validatingFields:r.validatingFields,isValidating:!ht(r.validatingFields)}))},x=(C,N=[],T,H,j=!0,$=!0)=>{if(H&&T&&!t.disabled){if(a.action=!0,$&&Array.isArray(z(n,C))){const Q=T(z(n,C),H.argA,H.argB);j&&Ee(n,C,Q)}if($&&Array.isArray(z(r.errors,C))){const Q=T(z(r.errors,C),H.argA,H.argB);j&&Ee(r.errors,C,Q),Ky(r.errors,C)}if((u.touchedFields||h.touchedFields)&&$&&Array.isArray(z(r.touchedFields,C))){const Q=T(z(r.touchedFields,C),H.argA,H.argB);j&&Ee(r.touchedFields,C,Q)}(u.dirtyFields||h.dirtyFields)&&(r.dirtyFields=xs(s,o)),v.state.next({name:C,isDirty:G(C,N),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Ee(o,C,N)},y=(C,N)=>{Ee(r.errors,C,N),v.state.next({errors:r.errors})},w=C=>{r.errors=C,v.state.next({errors:r.errors,isValid:!1})},k=(C,N,T,H)=>{const j=z(n,C);if(j){const $=z(o,C,Ye(T)?z(s,C):T);Ye($)||H&&H.defaultChecked||N?Ee(o,C,N?$:Yd(j._f)):L(C,$),a.mount&&p()}},E=(C,N,T,H,j)=>{let $=!1,Q=!1;const ve={name:C};if(!t.disabled){if(!T||H){(u.isDirty||h.isDirty)&&(Q=r.isDirty,r.isDirty=ve.isDirty=G(),$=Q!==ve.isDirty);const Te=ir(z(s,C),N);Q=!!z(r.dirtyFields,C),Te?Ze(r.dirtyFields,C):Ee(r.dirtyFields,C,!0),ve.dirtyFields=r.dirtyFields,$=$||(u.dirtyFields||h.dirtyFields)&&Q!==!Te}if(T){const Te=z(r.touchedFields,C);Te||(Ee(r.touchedFields,C,T),ve.touchedFields=r.touchedFields,$=$||(u.touchedFields||h.touchedFields)&&Te!==T)}$&&j&&v.state.next(ve)}return $?ve:{}},M=(C,N,T,H)=>{const j=z(r.errors,C),$=(u.isValid||h.isValid)&&xt(N)&&r.isValid!==N;if(t.delayError&&T?(c=b(()=>y(C,T)),c(t.delayError)):(clearTimeout(d),c=null,T?Ee(r.errors,C,T):Ze(r.errors,C)),(T?!ir(j,T):j)||!ht(H)||$){const Q={...H,...$&&xt(N)?{isValid:N}:{},errors:r.errors,name:C};r={...r,...Q},v.state.next(Q)}},O=async C=>{g(C,!0);const N=await t.resolver(o,t.context,Uy(C||i.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return g(C),N},P=async C=>{const{errors:N}=await O(C);if(C)for(const T of C){const H=z(N,T);H?Ee(r.errors,T,H):Ze(r.errors,T)}else r.errors=N;return N},F=async(C,N,T={valid:!0})=>{for(const H in C){const j=C[H];if(j){const{_f:$,...Q}=j;if($){const ve=i.array.has($.name),Te=j._f&&Hy(j._f);Te&&u.validatingFields&&g([H],!0);const yt=await Xd(j,i.disabled,o,f,t.shouldUseNativeValidation&&!N,ve);if(Te&&u.validatingFields&&g([H]),yt[$.name]&&(T.valid=!1,N))break;!N&&(z(yt,$.name)?ve?Qy(r.errors,yt,$.name):Ee(r.errors,$.name,yt[$.name]):Ze(r.errors,$.name))}!ht(Q)&&await F(Q,N,T)}}return T.valid},W=()=>{for(const C of i.unMount){const N=z(n,C);N&&(N._f.refs?N._f.refs.every(T=>!ei(T)):!ei(N._f.ref))&&q(C)}i.unMount=new Set},G=(C,N)=>!t.disabled&&(C&&N&&Ee(o,C,N),!ir(ae(),s)),D=(C,N,T)=>Dd(C,i,{...a.mount?o:Ye(N)?s:Yt(C)?{[C]:N}:N},T,N),U=C=>Za(z(a.mount?o:s,C,t.shouldUnregister?z(s,C,[]):[])),L=(C,N,T={})=>{const H=z(n,C);let j=N;if(H){const $=H._f;$&&(!$.disabled&&Ee(o,C,Ud(N,$)),j=No($.ref)&&at(N)?"":N,Ld($.ref)?[...$.ref.options].forEach(Q=>Q.selected=j.includes(Q.value)):$.refs?bs($.ref)?$.refs.forEach(Q=>{(!Q.defaultChecked||!Q.disabled)&&(Array.isArray(j)?Q.checked=!!j.find(ve=>ve===Q.value):Q.checked=j===Q.value||!!j)}):$.refs.forEach(Q=>Q.checked=Q.value===j):Ja($.ref)?$.ref.value="":($.ref.value=j,$.ref.type||v.state.next({name:C,values:Qe(o)})))}(T.shouldDirty||T.shouldTouch)&&E(C,j,T.shouldTouch,T.shouldDirty,!0),T.shouldValidate&&B(C)},J=(C,N,T)=>{for(const H in N){if(!N.hasOwnProperty(H))return;const j=N[H],$=C+"."+H,Q=z(n,$);(i.array.has(C)||ze(j)||Q&&!Q._f)&&!sn(j)?J($,j,T):L($,j,T)}},Y=(C,N,T={})=>{const H=z(n,C),j=i.array.has(C),$=Qe(N);Ee(o,C,$),j?(v.array.next({name:C,values:Qe(o)}),(u.isDirty||u.dirtyFields||h.isDirty||h.dirtyFields)&&T.shouldDirty&&v.state.next({name:C,dirtyFields:xs(s,o),isDirty:G(C,$)})):H&&!H._f&&!at($)?J(C,$,T):L(C,$,T),Kd(C,i)&&v.state.next({...r,name:C}),v.state.next({name:a.mount?C:void 0,values:Qe(o)})},I=async C=>{a.mount=!0;const N=C.target;let T=N.name,H=!0;const j=z(n,T),$=Te=>{H=Number.isNaN(Te)||sn(Te)&&isNaN(Te.getTime())||ir(Te,z(o,T,Te))},Q=qd(t.mode),ve=qd(t.reValidateMode);if(j){let Te,yt;const gr=N.type?Yd(j._f):Od(C),tr=C.type===So.BLUR||C.type===So.FOCUS_OUT,Jo=!zy(j._f)&&!t.resolver&&!z(r.errors,T)&&!j._f.deps||Zy(tr,z(r.touchedFields,T),r.isSubmitted,ve,Q),xn=Kd(T,i,tr);Ee(o,T,gr),tr?(j._f.onBlur&&j._f.onBlur(C),c&&c(0)):j._f.onChange&&j._f.onChange(C);const rr=E(T,gr,tr),Ro=!ht(rr)||xn;if(!tr&&v.state.next({name:T,type:C.type,values:Qe(o)}),Jo)return(u.isValid||h.isValid)&&(t.mode==="onBlur"?tr&&p():tr||p()),Ro&&v.state.next({name:T,...xn?{}:rr});if(!tr&&xn&&v.state.next({...r}),t.resolver){const{errors:yr}=await O([T]);if($(gr),H){const Ji=Qd(r.errors,n,T),ea=Qd(yr,n,Ji.name||T);Te=ea.error,T=ea.name,yt=ht(yr)}}else g([T],!0),Te=(await Xd(j,i.disabled,o,f,t.shouldUseNativeValidation))[T],g([T]),$(gr),H&&(Te?yt=!1:(u.isValid||h.isValid)&&(yt=await F(n,!0)));H&&(j._f.deps&&B(j._f.deps),M(T,yt,Te,rr))}},A=(C,N)=>{if(z(r.errors,N)&&C.focus)return C.focus(),1},B=async(C,N={})=>{let T,H;const j=ws(C);if(t.resolver){const $=await P(Ye(C)?C:j);T=ht($),H=C?!j.some(Q=>z($,Q)):T}else C?(H=(await Promise.all(j.map(async $=>{const Q=z(n,$);return await F(Q&&Q._f?{[$]:Q}:Q)}))).every(Boolean),!(!H&&!r.isValid)&&p()):H=T=await F(n);return v.state.next({...!Yt(C)||(u.isValid||h.isValid)&&T!==r.isValid?{}:{name:C},...t.resolver||!C?{isValid:T}:{},errors:r.errors}),N.shouldFocus&&!H&&Cs(n,A,C?j:i.mount),H},ae=C=>{const N={...a.mount?o:s};return Ye(C)?N:Yt(C)?z(N,C):C.map(T=>z(N,T))},Se=(C,N)=>({invalid:!!z((N||r).errors,C),isDirty:!!z((N||r).dirtyFields,C),error:z((N||r).errors,C),isValidating:!!z(r.validatingFields,C),isTouched:!!z((N||r).touchedFields,C)}),de=C=>{C&&ws(C).forEach(N=>Ze(r.errors,N)),v.state.next({errors:C?r.errors:{}})},ue=(C,N,T)=>{const H=(z(n,C,{_f:{}})._f||{}).ref,j=z(r.errors,C)||{},{ref:$,message:Q,type:ve,...Te}=j;Ee(r.errors,C,{...Te,...N,ref:H}),v.state.next({name:C,errors:r.errors,isValid:!1}),T&&T.shouldFocus&&H&&H.focus&&H.focus()},pe=(C,N)=>At(C)?v.state.subscribe({next:T=>"values"in T&&C(D(void 0,N),T)}):D(C,N,!0),Fe=C=>v.state.subscribe({next:N=>{qy(C.name,N.name,C.exact)&&Yy(N,C.formState||u,mr,C.reRenderRoot)&&C.callback({values:{...o},...r,...N,defaultValues:s})}}).unsubscribe,rt=C=>(a.mount=!0,h={...h,...C.formState},Fe({...C,formState:h})),q=(C,N={})=>{for(const T of C?ws(C):i.mount)i.mount.delete(T),i.array.delete(T),N.keepValue||(Ze(n,T),Ze(o,T)),!N.keepError&&Ze(r.errors,T),!N.keepDirty&&Ze(r.dirtyFields,T),!N.keepTouched&&Ze(r.touchedFields,T),!N.keepIsValidating&&Ze(r.validatingFields,T),!t.shouldUnregister&&!N.keepDefaultValue&&Ze(s,T);v.state.next({values:Qe(o)}),v.state.next({...r,...N.keepDirty?{isDirty:G()}:{}}),!N.keepIsValid&&p()},ke=({disabled:C,name:N})=>{(xt(C)&&a.mount||C||i.disabled.has(N))&&(C?i.disabled.add(N):i.disabled.delete(N))},Ae=(C,N={})=>{let T=z(n,C);const H=xt(N.disabled)||xt(t.disabled);return Ee(n,C,{...T||{},_f:{...T&&T._f?T._f:{ref:{name:C}},name:C,mount:!0,...N}}),i.mount.add(C),T?ke({disabled:xt(N.disabled)?N.disabled:t.disabled,name:C}):k(C,!0,N.value),{...H?{disabled:N.disabled||t.disabled}:{},...t.progressive?{required:!!N.required,min:_s(N.min),max:_s(N.max),minLength:_s(N.minLength),maxLength:_s(N.maxLength),pattern:_s(N.pattern)}:{},name:C,onChange:I,onBlur:I,ref:j=>{if(j){Ae(C,N),T=z(n,C);const $=Ye(j.value)&&j.querySelectorAll&&j.querySelectorAll("input,select,textarea")[0]||j,Q=By($),ve=T._f.refs||[];if(Q?ve.find(Te=>Te===$):$===T._f.ref)return;Ee(n,C,{_f:{...T._f,...Q?{refs:[...ve.filter(ei),$,...Array.isArray(z(s,C))?[{}]:[]],ref:{type:$.type,name:C}}:{ref:$}}}),k(C,!1,void 0,$)}else T=z(n,C,{}),T._f&&(T._f.mount=!1),(t.shouldUnregister||N.shouldUnregister)&&!(Md(i.array,C)&&a.action)&&i.unMount.add(C)}}},ye=()=>t.shouldFocusError&&Cs(n,A,i.mount),me=C=>{xt(C)&&(v.state.next({disabled:C}),Cs(n,(N,T)=>{const H=z(n,T);H&&(N.disabled=H._f.disabled||C,Array.isArray(H._f.refs)&&H._f.refs.forEach(j=>{j.disabled=H._f.disabled||C}))},0,!1))},be=(C,N)=>async T=>{let H;T&&(T.preventDefault&&T.preventDefault(),T.persist&&T.persist());let j=Qe(o);if(v.state.next({isSubmitting:!0}),t.resolver){const{errors:$,values:Q}=await O();r.errors=$,j=Qe(Q)}else await F(n);if(i.disabled.size)for(const $ of i.disabled)Ze(j,$);if(Ze(r.errors,"root"),ht(r.errors)){v.state.next({errors:{}});try{await C(j,T)}catch($){H=$}}else N&&await N({...r.errors},T),ye(),setTimeout(ye);if(v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ht(r.errors)&&!H,submitCount:r.submitCount+1,errors:r.errors}),H)throw H},Re=(C,N={})=>{z(n,C)&&(Ye(N.defaultValue)?Y(C,Qe(z(s,C))):(Y(C,N.defaultValue),Ee(s,C,Qe(N.defaultValue))),N.keepTouched||Ze(r.touchedFields,C),N.keepDirty||(Ze(r.dirtyFields,C),r.isDirty=N.defaultValue?G(C,Qe(z(s,C))):G()),N.keepError||(Ze(r.errors,C),u.isValid&&p()),v.state.next({...r}))},dt=(C,N={})=>{const T=C?Qe(C):s,H=Qe(T),j=ht(C),$=j?s:H;if(N.keepDefaultValues||(s=T),!N.keepValues){if(N.keepDirtyValues){const Q=new Set([...i.mount,...Object.keys(xs(s,o))]);for(const ve of Array.from(Q))z(r.dirtyFields,ve)?Ee($,ve,z(o,ve)):Y(ve,z($,ve))}else{if(qa&&Ye(C))for(const Q of i.mount){const ve=z(n,Q);if(ve&&ve._f){const Te=Array.isArray(ve._f.refs)?ve._f.refs[0]:ve._f.ref;if(No(Te)){const yt=Te.closest("form");if(yt){yt.reset();break}}}}if(N.keepFieldsRef)for(const Q of i.mount)Y(Q,z($,Q));else n={}}o=t.shouldUnregister?N.keepDefaultValues?Qe(s):{}:Qe($),v.array.next({values:{...$}}),v.state.next({values:{...$}})}i={mount:N.keepDirtyValues?i.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!u.isValid||!!N.keepIsValid||!!N.keepDirtyValues,a.watch=!!t.shouldUnregister,v.state.next({submitCount:N.keepSubmitCount?r.submitCount:0,isDirty:j?!1:N.keepDirty?r.isDirty:!!(N.keepDefaultValues&&!ir(C,s)),isSubmitted:N.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:j?{}:N.keepDirtyValues?N.keepDefaultValues&&o?xs(s,o):r.dirtyFields:N.keepDefaultValues&&C?xs(s,C):N.keepDirty?r.dirtyFields:{},touchedFields:N.keepTouched?r.touchedFields:{},errors:N.keepErrors?r.errors:{},isSubmitSuccessful:N.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},Rt=(C,N)=>dt(At(C)?C(o):C,N),er=(C,N={})=>{const T=z(n,C),H=T&&T._f;if(H){const j=H.refs?H.refs[0]:H.ref;j.focus&&(j.focus(),N.shouldSelect&&At(j.select)&&j.select())}},mr=C=>{r={...r,...C}},vr={control:{register:Ae,unregister:q,getFieldState:Se,handleSubmit:be,setError:ue,_subscribe:Fe,_runSchema:O,_focusError:ye,_getWatch:D,_getDirty:G,_setValid:p,_setFieldArray:x,_setDisabledField:ke,_setErrors:w,_getFieldArray:U,_reset:dt,_resetDefaultValues:()=>At(t.defaultValues)&&t.defaultValues().then(C=>{Rt(C,t.resetOptions),v.state.next({isLoading:!1})}),_removeUnmounted:W,_disableForm:me,_subjects:v,_proxyFormState:u,get _fields(){return n},get _formValues(){return o},get _state(){return a},set _state(C){a=C},get _defaultValues(){return s},get _names(){return i},set _names(C){i=C},get _formState(){return r},get _options(){return t},set _options(C){t={...t,...C}}},subscribe:rt,trigger:B,register:Ae,handleSubmit:be,watch:pe,setValue:Y,getValues:ae,reset:Rt,resetField:Re,clearErrors:de,unregister:q,setError:ue,setFocus:er,getFieldState:Se};return{...vr,formControl:vr}}function Ss(e={}){const t=S.useRef(void 0),r=S.useRef(void 0),[n,s]=S.useState({isDirty:!1,isValidating:!1,isLoading:At(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:At(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!At(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:a,...i}=Xy(e);t.current={...i,formState:n}}const o=t.current.control;return o._options=e,Ga(()=>{const a=o._subscribe({formState:o._proxyFormState,callback:()=>s({...o._formState}),reRenderRoot:!0});return s(i=>({...i,isReady:!0})),o._formState.isReady=!0,a},[o]),S.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),S.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),S.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),S.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),S.useEffect(()=>{if(o._proxyFormState.isDirty){const a=o._getDirty();a!==n.isDirty&&o._subjects.state.next({isDirty:a})}},[o,n.isDirty]),S.useEffect(()=>{e.values&&!ir(e.values,r.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),r.current=e.values,s(a=>({...a}))):o._resetDefaultValues()},[o,e.values]),S.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),t.current.formState=Ad(n,o),t.current}const Jd=(e,t,r)=>{if(e&&"reportValidity"in e){const n=z(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},Rd=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?Jd(n.ref,r,e):n.refs&&n.refs.forEach(s=>Jd(s,r,e))}},Jy=(e,t)=>{t.shouldUseNativeValidation&&Rd(e,t);const r={};for(const n in e){const s=z(t.fields,n),o=Object.assign(e[n]||{},{ref:s&&s.ref});if(Ry(t.names||Object.keys(e),n)){const a=Object.assign({},z(r,n));Ee(a,"root",o),Ee(r,n,a)}else Ee(r,n,o)}return r},Ry=(e,t)=>e.some(r=>r.startsWith(t+"."));var eb=function(e,t){for(var r={};e.length;){var n=e[0],s=n.code,o=n.message,a=n.path.join(".");if(!r[a])if("unionErrors"in n){var i=n.unionErrors[0].errors[0];r[a]={message:i.message,type:i.code}}else r[a]={message:o,type:s};if("unionErrors"in n&&n.unionErrors.forEach(function(u){return u.errors.forEach(function(h){return e.push(h)})}),t){var c=r[a].types,d=c&&c[n.code];r[a]=Id(a,t,r,s,d?[].concat(d,n.message):n.message)}e.shift()}return r},ks=function(e,t,r){return r===void 0&&(r={}),function(n,s,o){try{return Promise.resolve(function(a,i){try{var c=Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(d){return o.shouldUseNativeValidation&&Rd({},o),{errors:{},values:r.raw?n:d}})}catch(d){return i(d)}return c&&c.then?c.then(void 0,i):c}(0,function(a){if(function(i){return Array.isArray(i==null?void 0:i.errors)}(a))return{values:{},errors:Jy(eb(a.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw a}))}catch(a){return Promise.reject(a)}}},Ce;(function(e){e.assertEqual=s=>{};function t(s){}e.assertIs=t;function r(s){throw new Error}e.assertNever=r,e.arrayToEnum=s=>{const o={};for(const a of s)o[a]=a;return o},e.getValidEnumValues=s=>{const o=e.objectKeys(s).filter(i=>typeof s[s[i]]!="number"),a={};for(const i of o)a[i]=s[i];return e.objectValues(a)},e.objectValues=s=>e.objectKeys(s).map(function(o){return s[o]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const a in s)Object.prototype.hasOwnProperty.call(s,a)&&o.push(a);return o},e.find=(s,o)=>{for(const a of s)if(o(a))return a},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,o=" | "){return s.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}e.joinValues=n,e.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(Ce||(Ce={}));var eu;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(eu||(eu={}));const X=Ce.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Er=e=>{switch(typeof e){case"undefined":return X.undefined;case"string":return X.string;case"number":return Number.isNaN(e)?X.nan:X.number;case"boolean":return X.boolean;case"function":return X.function;case"bigint":return X.bigint;case"symbol":return X.symbol;case"object":return Array.isArray(e)?X.array:e===null?X.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?X.promise:typeof Map<"u"&&e instanceof Map?X.map:typeof Set<"u"&&e instanceof Set?X.set:typeof Date<"u"&&e instanceof Date?X.date:X.object;default:return X.unknown}},V=Ce.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 lr extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){const r=t||function(o){return o.message},n={_errors:[]},s=o=>{for(const a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(s);else if(a.code==="invalid_return_type")s(a.returnTypeError);else if(a.code==="invalid_arguments")s(a.argumentsError);else if(a.path.length===0)n._errors.push(r(a));else{let i=n,c=0;for(;c<a.path.length;){const d=a.path[c];c===a.path.length-1?(i[d]=i[d]||{_errors:[]},i[d]._errors.push(r(a))):i[d]=i[d]||{_errors:[]},i=i[d],c++}}};return s(this),n}static assert(t){if(!(t instanceof lr))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ce.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){const r={},n=[];for(const s of this.issues)if(s.path.length>0){const o=s.path[0];r[o]=r[o]||[],r[o].push(t(s))}else n.push(t(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}lr.create=e=>new lr(e);const ti=(e,t)=>{let r;switch(e.code){case V.invalid_type:e.received===X.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case V.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Ce.jsonStringifyReplacer)}`;break;case V.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ce.joinValues(e.keys,", ")}`;break;case V.invalid_union:r="Invalid input";break;case V.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ce.joinValues(e.options)}`;break;case V.invalid_enum_value:r=`Invalid enum value. Expected ${Ce.joinValues(e.options)}, received '${e.received}'`;break;case V.invalid_arguments:r="Invalid function arguments";break;case V.invalid_return_type:r="Invalid function return type";break;case V.invalid_date:r="Invalid date";break;case V.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:Ce.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case V.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case V.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case V.custom:r="Invalid input";break;case V.invalid_intersection_types:r="Intersection results could not be merged";break;case V.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case V.not_finite:r="Number must be finite";break;default:r=t.defaultError,Ce.assertNever(e)}return{message:r}};let tb=ti;function rb(){return tb}const nb=e=>{const{data:t,path:r,errorMaps:n,issueData:s}=e,o=[...r,...s.path||[]],a={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let i="";const c=n.filter(d=>!!d).slice().reverse();for(const d of c)i=d(a,{data:t,defaultError:i}).message;return{...s,path:o,message:i}};function Z(e,t){const r=rb(),n=nb({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===ti?void 0:ti].filter(s=>!!s)});e.common.issues.push(n)}class _t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const s of r){if(s.status==="aborted")return ne;s.status==="dirty"&&t.dirty(),n.push(s.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const s of r){const o=await s.key,a=await s.value;n.push({key:o,value:a})}return _t.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const s of r){const{key:o,value:a}=s;if(o.status==="aborted"||a.status==="aborted")return ne;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||s.alwaysSet)&&(n[o.value]=a.value)}return{status:t.value,value:n}}}const ne=Object.freeze({status:"aborted"}),Ns=e=>({status:"dirty",value:e}),kt=e=>({status:"valid",value:e}),tu=e=>e.status==="aborted",ru=e=>e.status==="dirty",Fn=e=>e.status==="valid",Oo=e=>typeof Promise<"u"&&e instanceof Promise;var R;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(R||(R={}));class Pr{constructor(t,r,n,s){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=s}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 nu=(e,t)=>{if(Fn(t))return{success:!0,data:t.value};if(!e.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 lr(e.common.issues);return this._error=r,this._error}}};function fe(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:s}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(a,i)=>{const{message:c}=e;return a.code==="invalid_enum_value"?{message:c??i.defaultError}:typeof i.data>"u"?{message:c??n??i.defaultError}:a.code!=="invalid_type"?{message:i.defaultError}:{message:c??r??i.defaultError}},description:s}}class xe{get description(){return this._def.description}_getType(t){return Er(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Er(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new _t,ctx:{common:t.parent.common,data:t.data,parsedType:Er(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(Oo(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){const n={common:{issues:[],async:(r==null?void 0:r.async)??!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Er(t)},s=this._parseSync({data:t,path:n.path,parent:n});return nu(n,s)}"~validate"(t){var n,s;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Er(t)};if(!this["~standard"].async)try{const o=this._parseSync({data:t,path:[],parent:r});return Fn(o)?{value:o.value}:{issues:r.common.issues}}catch(o){(s=(n=o==null?void 0:o.message)==null?void 0:n.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(o=>Fn(o)?{value:o.value}:{issues:r.common.issues})}async parseAsync(t,r){const n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Er(t)},s=this._parse({data:t,path:n.path,parent:n}),o=await(Oo(s)?s:Promise.resolve(s));return nu(n,o)}refine(t,r){const n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,o)=>{const a=t(s),i=()=>o.addIssue({code:V.custom,...n(s)});return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?!0:(i(),!1)):a?!0:(i(),!1)})}refinement(t,r){return this._refinement((n,s)=>t(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(t){return new $n({schema:this,typeName:se.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,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 Mr.create(this,this._def)}nullable(){return Bn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return qt.create(this)}promise(){return Do.create(this,this._def)}or(t){return Mo.create([this,t],this._def)}and(t){return Ao.create(this,t,this._def)}transform(t){return new $n({...fe(this._def),schema:this,typeName:se.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new oi({...fe(this._def),innerType:this,defaultValue:r,typeName:se.ZodDefault})}brand(){return new Nb({typeName:se.ZodBranded,type:this,...fe(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new ai({...fe(this._def),innerType:this,catchValue:r,typeName:se.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return ii.create(this,t)}readonly(){return li.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const sb=/^c[^\s-]{8,}$/i,ob=/^[0-9a-z]+$/,ab=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ib=/^[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,lb=/^[a-z0-9_-]{21}$/i,cb=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,db=/^[-+]?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)?)??$/,ub=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,fb="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ri;const hb=/^(?:(?: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])$/,pb=/^(?:(?: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])$/,mb=/^(([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]))$/,vb=/^(([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])$/,gb=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,yb=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,su="((\\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])))",bb=new RegExp(`^${su}$`);function ou(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function wb(e){return new RegExp(`^${ou(e)}$`)}function xb(e){let t=`${su}T${ou(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function _b(e,t){return!!((t==="v4"||!t)&&hb.test(e)||(t==="v6"||!t)&&mb.test(e))}function Cb(e,t){if(!cb.test(e))return!1;try{const[r]=e.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||t&&s.alg!==t)}catch{return!1}}function Sb(e,t){return!!((t==="v4"||!t)&&pb.test(e)||(t==="v6"||!t)&&vb.test(e))}class Tr extends xe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==X.string){const o=this._getOrReturnCtx(t);return Z(o,{code:V.invalid_type,expected:X.string,received:o.parsedType}),ne}const n=new _t;let s;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(s=this._getOrReturnCtx(t,s),Z(s,{code:V.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")t.data.length>o.value&&(s=this._getOrReturnCtx(t,s),Z(s,{code:V.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){const a=t.data.length>o.value,i=t.data.length<o.value;(a||i)&&(s=this._getOrReturnCtx(t,s),a?Z(s,{code:V.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):i&&Z(s,{code:V.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")ub.test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"email",code:V.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")ri||(ri=new RegExp(fb,"u")),ri.test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"emoji",code:V.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")ib.test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"uuid",code:V.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")lb.test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"nanoid",code:V.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")sb.test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"cuid",code:V.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")ob.test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"cuid2",code:V.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")ab.test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"ulid",code:V.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),Z(s,{validation:"url",code:V.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"regex",code:V.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(s=this._getOrReturnCtx(t,s),Z(s,{code:V.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(s=this._getOrReturnCtx(t,s),Z(s,{code:V.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(s=this._getOrReturnCtx(t,s),Z(s,{code:V.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?xb(o).test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{code:V.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?bb.test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{code:V.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?wb(o).test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{code:V.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?db.test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"duration",code:V.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?_b(t.data,o.version)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"ip",code:V.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?Cb(t.data,o.alg)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"jwt",code:V.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?Sb(t.data,o.version)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"cidr",code:V.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?gb.test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"base64",code:V.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?yb.test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"base64url",code:V.invalid_string,message:o.message}),n.dirty()):Ce.assertNever(o);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(s=>t.test(s),{validation:r,code:V.invalid_string,...R.errToObj(n)})}_addCheck(t){return new Tr({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...R.errToObj(t)})}url(t){return this._addCheck({kind:"url",...R.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...R.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...R.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...R.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...R.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...R.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...R.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...R.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...R.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...R.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...R.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...R.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...R.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...R.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...R.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...R.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...R.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...R.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...R.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...R.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...R.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...R.errToObj(r)})}nonempty(t){return this.min(1,R.errToObj(t))}trim(){return new Tr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Tr({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Tr({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}Tr.create=e=>new Tr({checks:[],typeName:se.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...fe(e)});function kb(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,s=r>n?r:n,o=Number.parseInt(e.toFixed(s).replace(".","")),a=Number.parseInt(t.toFixed(s).replace(".",""));return o%a/10**s}class Es extends xe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==X.number){const o=this._getOrReturnCtx(t);return Z(o,{code:V.invalid_type,expected:X.number,received:o.parsedType}),ne}let n;const s=new _t;for(const o of this._def.checks)o.kind==="int"?Ce.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),Z(n,{code:V.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),Z(n,{code:V.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),Z(n,{code:V.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="multipleOf"?kb(t.data,o.value)!==0&&(n=this._getOrReturnCtx(t,n),Z(n,{code:V.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),Z(n,{code:V.not_finite,message:o.message}),s.dirty()):Ce.assertNever(o);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,R.toString(r))}gt(t,r){return this.setLimit("min",t,!1,R.toString(r))}lte(t,r){return this.setLimit("max",t,!0,R.toString(r))}lt(t,r){return this.setLimit("max",t,!1,R.toString(r))}setLimit(t,r,n,s){return new Es({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:R.toString(s)}]})}_addCheck(t){return new Es({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:R.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:R.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:R.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:R.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:R.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:R.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:R.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:R.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:R.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Ce.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}}Es.create=e=>new Es({checks:[],typeName:se.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...fe(e)});class Ps extends xe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==X.bigint)return this._getInvalidInput(t);let n;const s=new _t;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),Z(n,{code:V.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),Z(n,{code:V.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),Z(n,{code:V.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):Ce.assertNever(o);return{status:s.value,value:t.data}}_getInvalidInput(t){const r=this._getOrReturnCtx(t);return Z(r,{code:V.invalid_type,expected:X.bigint,received:r.parsedType}),ne}gte(t,r){return this.setLimit("min",t,!0,R.toString(r))}gt(t,r){return this.setLimit("min",t,!1,R.toString(r))}lte(t,r){return this.setLimit("max",t,!0,R.toString(r))}lt(t,r){return this.setLimit("max",t,!1,R.toString(r))}setLimit(t,r,n,s){return new Ps({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:R.toString(s)}]})}_addCheck(t){return new Ps({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:R.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:R.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:R.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:R.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:R.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}Ps.create=e=>new Ps({checks:[],typeName:se.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...fe(e)});class au extends xe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==X.boolean){const n=this._getOrReturnCtx(t);return Z(n,{code:V.invalid_type,expected:X.boolean,received:n.parsedType}),ne}return kt(t.data)}}au.create=e=>new au({typeName:se.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...fe(e)});class Ts extends xe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==X.date){const o=this._getOrReturnCtx(t);return Z(o,{code:V.invalid_type,expected:X.date,received:o.parsedType}),ne}if(Number.isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return Z(o,{code:V.invalid_date}),ne}const n=new _t;let s;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(s=this._getOrReturnCtx(t,s),Z(s,{code:V.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(s=this._getOrReturnCtx(t,s),Z(s,{code:V.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):Ce.assertNever(o);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Ts({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:R.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:R.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}}Ts.create=e=>new Ts({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:se.ZodDate,...fe(e)});class iu extends xe{_parse(t){if(this._getType(t)!==X.symbol){const n=this._getOrReturnCtx(t);return Z(n,{code:V.invalid_type,expected:X.symbol,received:n.parsedType}),ne}return kt(t.data)}}iu.create=e=>new iu({typeName:se.ZodSymbol,...fe(e)});class lu extends xe{_parse(t){if(this._getType(t)!==X.undefined){const n=this._getOrReturnCtx(t);return Z(n,{code:V.invalid_type,expected:X.undefined,received:n.parsedType}),ne}return kt(t.data)}}lu.create=e=>new lu({typeName:se.ZodUndefined,...fe(e)});class cu extends xe{_parse(t){if(this._getType(t)!==X.null){const n=this._getOrReturnCtx(t);return Z(n,{code:V.invalid_type,expected:X.null,received:n.parsedType}),ne}return kt(t.data)}}cu.create=e=>new cu({typeName:se.ZodNull,...fe(e)});class Os extends xe{constructor(){super(...arguments),this._any=!0}_parse(t){return kt(t.data)}}Os.create=e=>new Os({typeName:se.ZodAny,...fe(e)});class du extends xe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return kt(t.data)}}du.create=e=>new du({typeName:se.ZodUnknown,...fe(e)});class Or extends xe{_parse(t){const r=this._getOrReturnCtx(t);return Z(r,{code:V.invalid_type,expected:X.never,received:r.parsedType}),ne}}Or.create=e=>new Or({typeName:se.ZodNever,...fe(e)});class uu extends xe{_parse(t){if(this._getType(t)!==X.undefined){const n=this._getOrReturnCtx(t);return Z(n,{code:V.invalid_type,expected:X.void,received:n.parsedType}),ne}return kt(t.data)}}uu.create=e=>new uu({typeName:se.ZodVoid,...fe(e)});class qt extends xe{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),s=this._def;if(r.parsedType!==X.array)return Z(r,{code:V.invalid_type,expected:X.array,received:r.parsedType}),ne;if(s.exactLength!==null){const a=r.data.length>s.exactLength.value,i=r.data.length<s.exactLength.value;(a||i)&&(Z(r,{code:a?V.too_big:V.too_small,minimum:i?s.exactLength.value:void 0,maximum:a?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&(Z(r,{code:V.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&(Z(r,{code:V.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((a,i)=>s.type._parseAsync(new Pr(r,a,r.path,i)))).then(a=>_t.mergeArray(n,a));const o=[...r.data].map((a,i)=>s.type._parseSync(new Pr(r,a,r.path,i)));return _t.mergeArray(n,o)}get element(){return this._def.type}min(t,r){return new qt({...this._def,minLength:{value:t,message:R.toString(r)}})}max(t,r){return new qt({...this._def,maxLength:{value:t,message:R.toString(r)}})}length(t,r){return new qt({...this._def,exactLength:{value:t,message:R.toString(r)}})}nonempty(t){return this.min(1,t)}}qt.create=(e,t)=>new qt({type:e,minLength:null,maxLength:null,exactLength:null,typeName:se.ZodArray,...fe(t)});function Ln(e){if(e instanceof Ve){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=Mr.create(Ln(n))}return new Ve({...e._def,shape:()=>t})}else return e instanceof qt?new qt({...e._def,type:Ln(e.element)}):e instanceof Mr?Mr.create(Ln(e.unwrap())):e instanceof Bn?Bn.create(Ln(e.unwrap())):e instanceof on?on.create(e.items.map(t=>Ln(t))):e}class Ve extends xe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),r=Ce.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==X.object){const d=this._getOrReturnCtx(t);return Z(d,{code:V.invalid_type,expected:X.object,received:d.parsedType}),ne}const{status:n,ctx:s}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),i=[];if(!(this._def.catchall instanceof Or&&this._def.unknownKeys==="strip"))for(const d in s.data)a.includes(d)||i.push(d);const c=[];for(const d of a){const u=o[d],h=s.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new Pr(s,h,s.path,d)),alwaysSet:d in s.data})}if(this._def.catchall instanceof Or){const d=this._def.unknownKeys;if(d==="passthrough")for(const u of i)c.push({key:{status:"valid",value:u},value:{status:"valid",value:s.data[u]}});else if(d==="strict")i.length>0&&(Z(s,{code:V.unrecognized_keys,keys:i}),n.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const u of i){const h=s.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new Pr(s,h,s.path,u)),alwaysSet:u in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const d=[];for(const u of c){const h=await u.key,v=await u.value;d.push({key:h,value:v,alwaysSet:u.alwaysSet})}return d}).then(d=>_t.mergeObjectSync(n,d)):_t.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return R.errToObj,new Ve({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var o,a;const s=((a=(o=this._def).errorMap)==null?void 0:a.call(o,r,n).message)??n.defaultError;return r.code==="unrecognized_keys"?{message:R.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new Ve({...this._def,unknownKeys:"strip"})}passthrough(){return new Ve({...this._def,unknownKeys:"passthrough"})}extend(t){return new Ve({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Ve({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:se.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new Ve({...this._def,catchall:t})}pick(t){const r={};for(const n of Ce.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new Ve({...this._def,shape:()=>r})}omit(t){const r={};for(const n of Ce.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new Ve({...this._def,shape:()=>r})}deepPartial(){return Ln(this)}partial(t){const r={};for(const n of Ce.objectKeys(this.shape)){const s=this.shape[n];t&&!t[n]?r[n]=s:r[n]=s.optional()}return new Ve({...this._def,shape:()=>r})}required(t){const r={};for(const n of Ce.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof Mr;)o=o._def.innerType;r[n]=o}return new Ve({...this._def,shape:()=>r})}keyof(){return pu(Ce.objectKeys(this.shape))}}Ve.create=(e,t)=>new Ve({shape:()=>e,unknownKeys:"strip",catchall:Or.create(),typeName:se.ZodObject,...fe(t)}),Ve.strictCreate=(e,t)=>new Ve({shape:()=>e,unknownKeys:"strict",catchall:Or.create(),typeName:se.ZodObject,...fe(t)}),Ve.lazycreate=(e,t)=>new Ve({shape:e,unknownKeys:"strip",catchall:Or.create(),typeName:se.ZodObject,...fe(t)});class Mo extends xe{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function s(o){for(const i of o)if(i.result.status==="valid")return i.result;for(const i of o)if(i.result.status==="dirty")return r.common.issues.push(...i.ctx.common.issues),i.result;const a=o.map(i=>new lr(i.ctx.common.issues));return Z(r,{code:V.invalid_union,unionErrors:a}),ne}if(r.common.async)return Promise.all(n.map(async o=>{const a={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}})).then(s);{let o;const a=[];for(const c of n){const d={...r,common:{...r.common,issues:[]},parent:null},u=c._parseSync({data:r.data,path:r.path,parent:d});if(u.status==="valid")return u;u.status==="dirty"&&!o&&(o={result:u,ctx:d}),d.common.issues.length&&a.push(d.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;const i=a.map(c=>new lr(c));return Z(r,{code:V.invalid_union,unionErrors:i}),ne}}get options(){return this._def.options}}Mo.create=(e,t)=>new Mo({options:e,typeName:se.ZodUnion,...fe(t)});function ni(e,t){const r=Er(e),n=Er(t);if(e===t)return{valid:!0,data:e};if(r===X.object&&n===X.object){const s=Ce.objectKeys(t),o=Ce.objectKeys(e).filter(i=>s.indexOf(i)!==-1),a={...e,...t};for(const i of o){const c=ni(e[i],t[i]);if(!c.valid)return{valid:!1};a[i]=c.data}return{valid:!0,data:a}}else if(r===X.array&&n===X.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let o=0;o<e.length;o++){const a=e[o],i=t[o],c=ni(a,i);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return r===X.date&&n===X.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Ao extends xe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t),s=(o,a)=>{if(tu(o)||tu(a))return ne;const i=ni(o.value,a.value);return i.valid?((ru(o)||ru(a))&&r.dirty(),{status:r.value,value:i.data}):(Z(n,{code:V.invalid_intersection_types}),ne)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,a])=>s(o,a)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Ao.create=(e,t,r)=>new Ao({left:e,right:t,typeName:se.ZodIntersection,...fe(r)});class on extends xe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==X.array)return Z(n,{code:V.invalid_type,expected:X.array,received:n.parsedType}),ne;if(n.data.length<this._def.items.length)return Z(n,{code:V.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ne;!this._def.rest&&n.data.length>this._def.items.length&&(Z(n,{code:V.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const o=[...n.data].map((a,i)=>{const c=this._def.items[i]||this._def.rest;return c?c._parse(new Pr(n,a,n.path,i)):null}).filter(a=>!!a);return n.common.async?Promise.all(o).then(a=>_t.mergeArray(r,a)):_t.mergeArray(r,o)}get items(){return this._def.items}rest(t){return new on({...this._def,rest:t})}}on.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new on({items:e,typeName:se.ZodTuple,rest:null,...fe(t)})};class fu extends xe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==X.map)return Z(n,{code:V.invalid_type,expected:X.map,received:n.parsedType}),ne;const s=this._def.keyType,o=this._def.valueType,a=[...n.data.entries()].map(([i,c],d)=>({key:s._parse(new Pr(n,i,n.path,[d,"key"])),value:o._parse(new Pr(n,c,n.path,[d,"value"]))}));if(n.common.async){const i=new Map;return Promise.resolve().then(async()=>{for(const c of a){const d=await c.key,u=await c.value;if(d.status==="aborted"||u.status==="aborted")return ne;(d.status==="dirty"||u.status==="dirty")&&r.dirty(),i.set(d.value,u.value)}return{status:r.value,value:i}})}else{const i=new Map;for(const c of a){const d=c.key,u=c.value;if(d.status==="aborted"||u.status==="aborted")return ne;(d.status==="dirty"||u.status==="dirty")&&r.dirty(),i.set(d.value,u.value)}return{status:r.value,value:i}}}}fu.create=(e,t,r)=>new fu({valueType:t,keyType:e,typeName:se.ZodMap,...fe(r)});class Ms extends xe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==X.set)return Z(n,{code:V.invalid_type,expected:X.set,received:n.parsedType}),ne;const s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(Z(n,{code:V.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(Z(n,{code:V.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());const o=this._def.valueType;function a(c){const d=new Set;for(const u of c){if(u.status==="aborted")return ne;u.status==="dirty"&&r.dirty(),d.add(u.value)}return{status:r.value,value:d}}const i=[...n.data.values()].map((c,d)=>o._parse(new Pr(n,c,n.path,d)));return n.common.async?Promise.all(i).then(c=>a(c)):a(i)}min(t,r){return new Ms({...this._def,minSize:{value:t,message:R.toString(r)}})}max(t,r){return new Ms({...this._def,maxSize:{value:t,message:R.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}Ms.create=(e,t)=>new Ms({valueType:e,minSize:null,maxSize:null,typeName:se.ZodSet,...fe(t)});class hu extends xe{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}hu.create=(e,t)=>new hu({getter:e,typeName:se.ZodLazy,...fe(t)});class si extends xe{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return Z(r,{received:r.data,code:V.invalid_literal,expected:this._def.value}),ne}return{status:"valid",value:t.data}}get value(){return this._def.value}}si.create=(e,t)=>new si({value:e,typeName:se.ZodLiteral,...fe(t)});function pu(e,t){return new Vn({values:e,typeName:se.ZodEnum,...fe(t)})}class Vn extends xe{_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return Z(r,{expected:Ce.joinValues(n),received:r.parsedType,code:V.invalid_type}),ne}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return Z(r,{received:r.data,code:V.invalid_enum_value,options:n}),ne}return kt(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return Vn.create(t,{...this._def,...r})}exclude(t,r=this._def){return Vn.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}Vn.create=pu;class mu extends xe{_parse(t){const r=Ce.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==X.string&&n.parsedType!==X.number){const s=Ce.objectValues(r);return Z(n,{expected:Ce.joinValues(s),received:n.parsedType,code:V.invalid_type}),ne}if(this._cache||(this._cache=new Set(Ce.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const s=Ce.objectValues(r);return Z(n,{received:n.data,code:V.invalid_enum_value,options:s}),ne}return kt(t.data)}get enum(){return this._def.values}}mu.create=(e,t)=>new mu({values:e,typeName:se.ZodNativeEnum,...fe(t)});class Do extends xe{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==X.promise&&r.common.async===!1)return Z(r,{code:V.invalid_type,expected:X.promise,received:r.parsedType}),ne;const n=r.parsedType===X.promise?r.data:Promise.resolve(r.data);return kt(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}}Do.create=(e,t)=>new Do({type:e,typeName:se.ZodPromise,...fe(t)});class $n extends xe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===se.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),s=this._def.effect||null,o={addIssue:a=>{Z(n,a),a.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){const a=s.transform(n.data,o);if(n.common.async)return Promise.resolve(a).then(async i=>{if(r.value==="aborted")return ne;const c=await this._def.schema._parseAsync({data:i,path:n.path,parent:n});return c.status==="aborted"?ne:c.status==="dirty"||r.value==="dirty"?Ns(c.value):c});{if(r.value==="aborted")return ne;const i=this._def.schema._parseSync({data:a,path:n.path,parent:n});return i.status==="aborted"?ne:i.status==="dirty"||r.value==="dirty"?Ns(i.value):i}}if(s.type==="refinement"){const a=i=>{const c=s.refinement(i,o);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return i};if(n.common.async===!1){const i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?ne:(i.status==="dirty"&&r.dirty(),a(i.value),{status:r.value,value:i.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>i.status==="aborted"?ne:(i.status==="dirty"&&r.dirty(),a(i.value).then(()=>({status:r.value,value:i.value}))))}if(s.type==="transform")if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Fn(a))return ne;const i=s.transform(a.value,o);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:n.data,path:n.path,parent:n}).then(a=>Fn(a)?Promise.resolve(s.transform(a.value,o)).then(i=>({status:r.value,value:i})):ne);Ce.assertNever(s)}}$n.create=(e,t,r)=>new $n({schema:e,typeName:se.ZodEffects,effect:t,...fe(r)}),$n.createWithPreprocess=(e,t,r)=>new $n({schema:t,effect:{type:"preprocess",transform:e},typeName:se.ZodEffects,...fe(r)});class Mr extends xe{_parse(t){return this._getType(t)===X.undefined?kt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Mr.create=(e,t)=>new Mr({innerType:e,typeName:se.ZodOptional,...fe(t)});class Bn extends xe{_parse(t){return this._getType(t)===X.null?kt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Bn.create=(e,t)=>new Bn({innerType:e,typeName:se.ZodNullable,...fe(t)});class oi extends xe{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===X.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}oi.create=(e,t)=>new oi({innerType:e,typeName:se.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...fe(t)});class ai extends xe{_parse(t){const{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Oo(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new lr(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new lr(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}ai.create=(e,t)=>new ai({innerType:e,typeName:se.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...fe(t)});class vu extends xe{_parse(t){if(this._getType(t)!==X.nan){const n=this._getOrReturnCtx(t);return Z(n,{code:V.invalid_type,expected:X.nan,received:n.parsedType}),ne}return{status:"valid",value:t.data}}}vu.create=e=>new vu({typeName:se.ZodNaN,...fe(e)});class Nb extends xe{_parse(t){const{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class ii extends xe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?ne:o.status==="dirty"?(r.dirty(),Ns(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?ne:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(t,r){return new ii({in:t,out:r,typeName:se.ZodPipeline})}}class li extends xe{_parse(t){const r=this._def.innerType._parse(t),n=s=>(Fn(s)&&(s.value=Object.freeze(s.value)),s);return Oo(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}}li.create=(e,t)=>new li({innerType:e,typeName:se.ZodReadonly,...fe(t)});function gu(e,t){const r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function Eb(e,t={},r){return e?Os.create().superRefine((n,s)=>{const o=e(n);if(o instanceof Promise)return o.then(a=>{if(!a){const i=gu(t,n),c=i.fatal??r??!0;s.addIssue({code:"custom",...i,fatal:c})}});if(!o){const a=gu(t,n),i=a.fatal??r??!0;s.addIssue({code:"custom",...a,fatal:i})}}):Os.create()}Ve.lazycreate;var se;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(se||(se={}));const ci=(e,t={message:`Input not instance of ${e.name}`})=>Eb(r=>r instanceof e,t),Xe=Tr.create,yu=Ts.create;Os.create,Or.create,qt.create;const As=Ve.create;Ve.strictCreate,Mo.create,Ao.create,on.create;const Pb=si.create;Vn.create,Do.create,Mr.create,Bn.create;const Ds=Iy,bu=m.createContext({}),qe=({...e})=>l.jsx(bu.Provider,{value:{name:e.name},children:l.jsx($y,{...e})}),Io=()=>{const e=m.useContext(bu),t=m.useContext(wu),{getFieldState:r,formState:n}=ko(),s=r(e.name,n);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:o}=t;return{id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...s}},wu=m.createContext({}),$e=m.forwardRef(({className:e,...t},r)=>{const n=m.useId();return l.jsx(wu.Provider,{value:{id:n},children:l.jsx("div",{ref:r,className:he("space-y-2",e),...t})})});$e.displayName="FormItem";const Be=m.forwardRef(({className:e,...t},r)=>{const{error:n,formItemId:s}=Io();return l.jsx(nn,{ref:r,className:he(n&&"text-destructive",e),htmlFor:s,...t})});Be.displayName="FormLabel";const We=m.forwardRef(({...e},t)=>{const{error:r,formItemId:n,formDescriptionId:s,formMessageId:o}=Io();return l.jsx(fl,{ref:t,id:n,"aria-describedby":r?`${s} ${o}`:`${s}`,"aria-invalid":!!r,...e})});We.displayName="FormControl";const Tb=m.forwardRef(({className:e,...t},r)=>{const{formDescriptionId:n}=Io();return l.jsx("p",{ref:r,id:n,className:he("text-sm text-muted-foreground",e),...t})});Tb.displayName="FormDescription";const je=m.forwardRef(({className:e,children:t,...r},n)=>{const{error:s,formMessageId:o}=Io(),a=s?String(s==null?void 0:s.message):t;return a?l.jsx("p",{ref:n,id:o,className:he("text-sm font-medium text-destructive",e),...r,children:a}):null});je.displayName="FormMessage";const Ob=As({bank_statement:ci(File).optional().refine(e=>e!==void 0,"Bank statement is required"),company_structure:ci(File).optional().refine(e=>e!==void 0,"Company structure document is required"),certificate_of_registration:ci(File).optional().refine(e=>e!==void 0,"Certificate of registration is required")}),Mb=({data:e,onDataChange:t,onContinue:r,onBack:n,renderProgress:s})=>{const o=S.useRef(null),a=S.useRef(null),i=S.useRef(null),c=Ss({resolver:ks(Ob),defaultValues:{bank_statement:e.bank_statement||void 0,company_structure:e.company_structure||void 0,certificate_of_registration:e.certificate_of_registration||void 0}}),d=v=>{t(v),r()},u=(v,f)=>{c.setValue(v,f),t({[v]:f})},h=({field:v,label:f,description:b,inputRef:p})=>{const g=c.watch(v);return l.jsx(qe,{control:c.control,name:v,render:()=>l.jsxs($e,{children:[l.jsx(Be,{children:f}),l.jsx(We,{children:l.jsxs("div",{className:"border-2 border-dashed border-muted-foreground/25 rounded-lg p-6",children:[l.jsx("input",{ref:p,type:"file",accept:".pdf,.jpg,.jpeg,.png,.doc,.docx",className:"hidden",onChange:x=>{var w;const y=((w=x.target.files)==null?void 0:w[0])||null;u(v,y)}}),g?l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx($p,{className:"w-5 h-5 text-primary"}),l.jsx("span",{className:"text-sm font-medium",children:g.name})]}),l.jsx(He,{type:"button",variant:"ghost",size:"sm",onClick:()=>{u(v,null),p.current&&(p.current.value="")},children:l.jsx(Jl,{className:"w-4 h-4"})})]}):l.jsxs("div",{className:"text-center cursor-pointer",onClick:()=>{var x;return(x=p.current)==null?void 0:x.click()},children:[l.jsx(Wp,{className:"w-8 h-8 mx-auto mb-2 text-muted-foreground"}),l.jsx("p",{className:"font-medium",children:f}),l.jsx("p",{className:"text-sm text-muted-foreground",children:b}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Supported: PDF, JPG, PNG, DOC, DOCX"})]})]})}),l.jsx(je,{})]})})};return l.jsxs(st,{className:"w-full max-w-2xl mx-auto",children:[l.jsx(kr,{children:l.jsx(Nr,{title:"Company Documents",subTitle:"Please upload the required company documents",onBack:n})}),l.jsxs(ot,{children:[l.jsx(Ds,{...c,children:l.jsxs("form",{onSubmit:c.handleSubmit(d),className:"space-y-6",children:[l.jsx(h,{field:"bank_statement",label:"Bank Statement",description:"Upload your latest bank statement",inputRef:o}),l.jsx(h,{field:"company_structure",label:"Company Structure",description:"Upload document showing directors & legal representatives",inputRef:a}),l.jsx(h,{field:"certificate_of_registration",label:"Certificate of Registration",description:"Upload your company's certificate of registration",inputRef:i}),l.jsx(He,{type:"submit",className:"w-full",children:"Complete Verification"})]})}),l.jsx("div",{className:"mt-6",children:s()})]})]})};function xu(e,[t,r]){return Math.min(r,Math.max(t,e))}var Ab=m.createContext(void 0);function Db(e){const t=m.useContext(Ab);return e||t||"ltr"}var di=0;function _u(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Cu()),document.body.insertAdjacentElement("beforeend",e[1]??Cu()),di++,()=>{di===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),di--}},[])}function Cu(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var ui="focusScope.autoFocusOnMount",fi="focusScope.autoFocusOnUnmount",Su={bubbles:!1,cancelable:!0},Ib="FocusScope",hi=m.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...a}=e,[i,c]=m.useState(null),d=Et(s),u=Et(o),h=m.useRef(null),v=Ie(t,p=>c(p)),f=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(n){let p=function(w){if(f.paused||!i)return;const k=w.target;i.contains(k)?h.current=k:Ar(h.current,{select:!0})},g=function(w){if(f.paused||!i)return;const k=w.relatedTarget;k!==null&&(i.contains(k)||Ar(h.current,{select:!0}))},x=function(w){if(document.activeElement===document.body)for(const E of w)E.removedNodes.length>0&&Ar(i)};document.addEventListener("focusin",p),document.addEventListener("focusout",g);const y=new MutationObserver(x);return i&&y.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",g),y.disconnect()}}},[n,i,f.paused]),m.useEffect(()=>{if(i){Eu.add(f);const p=document.activeElement;if(!i.contains(p)){const x=new CustomEvent(ui,Su);i.addEventListener(ui,d),i.dispatchEvent(x),x.defaultPrevented||(Fb(Wb(ku(i)),{select:!0}),document.activeElement===p&&Ar(i))}return()=>{i.removeEventListener(ui,d),setTimeout(()=>{const x=new CustomEvent(fi,Su);i.addEventListener(fi,u),i.dispatchEvent(x),x.defaultPrevented||Ar(p??document.body,{select:!0}),i.removeEventListener(fi,u),Eu.remove(f)},0)}}},[i,d,u,f]);const b=m.useCallback(p=>{if(!r&&!n||f.paused)return;const g=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,x=document.activeElement;if(g&&x){const y=p.currentTarget,[w,k]=Lb(y);w&&k?!p.shiftKey&&x===k?(p.preventDefault(),r&&Ar(w,{select:!0})):p.shiftKey&&x===w&&(p.preventDefault(),r&&Ar(k,{select:!0})):x===y&&p.preventDefault()}},[r,n,f.paused]);return l.jsx(we.div,{tabIndex:-1,...a,ref:v,onKeyDown:b})});hi.displayName=Ib;function Fb(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Ar(n,{select:t}),document.activeElement!==r)return}function Lb(e){const t=ku(e),r=Nu(t,e),n=Nu(t.reverse(),e);return[r,n]}function ku(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Nu(e,t){for(const r of e)if(!Vb(r,{upTo:t}))return r}function Vb(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function $b(e){return e instanceof HTMLInputElement&&"select"in e}function Ar(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&$b(e)&&t&&e.select()}}var Eu=Bb();function Bb(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=Pu(e,t),e.unshift(t)},remove(t){var r;e=Pu(e,t),(r=e[0])==null||r.resume()}}}function Pu(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function Wb(e){return e.filter(t=>t.tagName!=="A")}function jb(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Ub=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Wn=new WeakMap,Fo=new WeakMap,Lo={},pi=0,Tu=function(e){return e&&(e.host||Tu(e.parentNode))},Hb=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Tu(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},zb=function(e,t,r,n){var s=Hb(t,Array.isArray(e)?e:[e]);Lo[r]||(Lo[r]=new WeakMap);var o=Lo[r],a=[],i=new Set,c=new Set(s),d=function(h){!h||i.has(h)||(i.add(h),d(h.parentNode))};s.forEach(d);var u=function(h){!h||c.has(h)||Array.prototype.forEach.call(h.children,function(v){if(i.has(v))u(v);else try{var f=v.getAttribute(n),b=f!==null&&f!=="false",p=(Wn.get(v)||0)+1,g=(o.get(v)||0)+1;Wn.set(v,p),o.set(v,g),a.push(v),p===1&&b&&Fo.set(v,!0),g===1&&v.setAttribute(r,"true"),b||v.setAttribute(n,"true")}catch(x){console.error("aria-hidden: cannot operate on ",v,x)}})};return u(t),i.clear(),pi++,function(){a.forEach(function(h){var v=Wn.get(h)-1,f=o.get(h)-1;Wn.set(h,v),o.set(h,f),v||(Fo.has(h)||h.removeAttribute(n),Fo.delete(h)),f||h.removeAttribute(r)}),pi--,pi||(Wn=new WeakMap,Wn=new WeakMap,Fo=new WeakMap,Lo={})}},Ou=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),s=Ub(e);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live]"))),zb(n,s,r,"aria-hidden")):function(){return null}},Zt=function(){return Zt=Object.assign||function(t){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},Zt.apply(this,arguments)};function Mu(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}function Yb(e,t,r){if(r||arguments.length===2)for(var n=0,s=t.length,o;n<s;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Vo="right-scroll-bar-position",$o="width-before-scroll-bar",qb="with-scroll-bars-hidden",Zb="--removed-body-scroll-bar-size";function mi(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Kb(e,t){var r=S.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var s=r.value;s!==n&&(r.value=n,r.callback(n,s))}}}})[0];return r.callback=t,r.facade}var Qb=typeof window<"u"?m.useLayoutEffect:m.useEffect,Au=new WeakMap;function Gb(e,t){var r=Kb(null,function(n){return e.forEach(function(s){return mi(s,n)})});return Qb(function(){var n=Au.get(r);if(n){var s=new Set(n),o=new Set(e),a=r.current;s.forEach(function(i){o.has(i)||mi(i,null)}),o.forEach(function(i){s.has(i)||mi(i,a)})}Au.set(r,e)},[e]),r}function Xb(e){return e}function Jb(e,t){t===void 0&&(t=Xb);var r=[],n=!1,s={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(o){var a=t(o,n);return r.push(a),function(){r=r.filter(function(i){return i!==a})}},assignSyncMedium:function(o){for(n=!0;r.length;){var a=r;r=[],a.forEach(o)}r={push:function(i){return o(i)},filter:function(){return r}}},assignMedium:function(o){n=!0;var a=[];if(r.length){var i=r;r=[],i.forEach(o),a=r}var c=function(){var u=a;a=[],u.forEach(o)},d=function(){return Promise.resolve().then(c)};d(),r={push:function(u){a.push(u),d()},filter:function(u){return a=a.filter(u),r}}}};return s}function Rb(e){e===void 0&&(e={});var t=Jb(null);return t.options=Zt({async:!0,ssr:!1},e),t}var Du=function(e){var t=e.sideCar,r=Mu(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return m.createElement(n,Zt({},r))};Du.isSideCarExport=!0;function ew(e,t){return e.useMedium(t),Du}var Iu=Rb(),vi=function(){},Bo=m.forwardRef(function(e,t){var r=m.useRef(null),n=m.useState({onScrollCapture:vi,onWheelCapture:vi,onTouchMoveCapture:vi}),s=n[0],o=n[1],a=e.forwardProps,i=e.children,c=e.className,d=e.removeScrollBar,u=e.enabled,h=e.shards,v=e.sideCar,f=e.noRelative,b=e.noIsolation,p=e.inert,g=e.allowPinchZoom,x=e.as,y=x===void 0?"div":x,w=e.gapMode,k=Mu(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=v,M=Gb([r,t]),O=Zt(Zt({},k),s);return m.createElement(m.Fragment,null,u&&m.createElement(E,{sideCar:Iu,removeScrollBar:d,shards:h,noRelative:f,noIsolation:b,inert:p,setCallbacks:o,allowPinchZoom:!!g,lockRef:r,gapMode:w}),a?m.cloneElement(m.Children.only(i),Zt(Zt({},O),{ref:M})):m.createElement(y,Zt({},O,{className:c,ref:M}),i))});Bo.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Bo.classNames={fullWidth:$o,zeroRight:Vo};var tw=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function rw(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=tw();return t&&e.setAttribute("nonce",t),e}function nw(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function sw(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var ow=function(){var e=0,t=null;return{add:function(r){e==0&&(t=rw())&&(nw(t,r),sw(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},aw=function(){var e=ow();return function(t,r){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},Fu=function(){var e=aw(),t=function(r){var n=r.styles,s=r.dynamic;return e(n,s),null};return t},iw={left:0,top:0,right:0,gap:0},gi=function(e){return parseInt(e||"",10)||0},lw=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[gi(r),gi(n),gi(s)]},cw=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return iw;var t=lw(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},dw=Fu(),jn="data-scroll-locked",uw=function(e,t,r,n){var s=e.left,o=e.top,a=e.right,i=e.gap;return r===void 0&&(r="margin"),`
103
- .`.concat(qb,` {
101
+ */const Jl=tt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),pa="-",Hp=e=>{const t=Yp(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:a=>{const i=a.split(pa);return i[0]===""&&i.length!==1&&i.shift(),Rl(i,t)||zp(a)},getConflictingClassGroupIds:(a,i)=>{const c=r[a]||[];return i&&n[a]?[...c,...n[a]]:c}}},Rl=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),s=n?Rl(e.slice(1),n):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(pa);return(a=t.validators.find(({validator:i})=>i(o)))==null?void 0:a.classGroupId},ec=/^\[(.+)\]$/,zp=e=>{if(ec.test(e)){const t=ec.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Yp=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return Zp(Object.entries(e.classGroups),r).forEach(([o,a])=>{ma(a,n,o,t)}),n},ma=(e,t,r,n)=>{e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:tc(t,s);o.classGroupId=r;return}if(typeof s=="function"){if(qp(s)){ma(s(n),t,r,n);return}t.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([o,a])=>{ma(a,tc(t,o),r,n)})})},tc=(e,t)=>{let r=e;return t.split(pa).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},qp=e=>e.isThemeGetter,Zp=(e,t)=>t?e.map(([r,n])=>{const s=n.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,i])=>[t+a,i])):o);return[r,s]}):e,Kp=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const s=(o,a)=>{r.set(o,a),t++,t>e&&(t=0,n=r,r=new Map)};return{get(o){let a=r.get(o);if(a!==void 0)return a;if((a=n.get(o))!==void 0)return s(o,a),a},set(o,a){r.has(o)?r.set(o,a):s(o,a)}}},rc="!",Qp=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,s=t[0],o=t.length,a=i=>{const c=[];let d=0,u=0,h;for(let g=0;g<i.length;g++){let x=i[g];if(d===0){if(x===s&&(n||i.slice(g,g+o)===t)){c.push(i.slice(u,g)),u=g+o;continue}if(x==="/"){h=g;continue}}x==="["?d++:x==="]"&&d--}const v=c.length===0?i:i.substring(u),f=v.startsWith(rc),b=f?v.substring(1):v,p=h&&h>u?h-u:void 0;return{modifiers:c,hasImportantModifier:f,baseClassName:b,maybePostfixModifierPosition:p}};return r?i=>r({className:i,parseClassName:a}):a},Gp=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},Xp=e=>({cache:Kp(e.cacheSize),parseClassName:Qp(e),...Hp(e)}),Jp=/\s+/,Rp=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=t,o=[],a=e.trim().split(Jp);let i="";for(let c=a.length-1;c>=0;c-=1){const d=a[c],{modifiers:u,hasImportantModifier:h,baseClassName:v,maybePostfixModifierPosition:f}=r(d);let b=!!f,p=n(b?v.substring(0,f):v);if(!p){if(!b){i=d+(i.length>0?" "+i:i);continue}if(p=n(v),!p){i=d+(i.length>0?" "+i:i);continue}b=!1}const g=Gp(u).join(":"),x=h?g+rc:g,y=x+p;if(o.includes(y))continue;o.push(y);const w=s(p,b);for(let k=0;k<w.length;++k){const E=w[k];o.push(x+E)}i=d+(i.length>0?" "+i:i)}return i};function em(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=nc(t))&&(n&&(n+=" "),n+=r);return n}const nc=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=nc(e[n]))&&(r&&(r+=" "),r+=t);return r};function tm(e,...t){let r,n,s,o=a;function a(c){const d=t.reduce((u,h)=>h(u),e());return r=Xp(d),n=r.cache.get,s=r.cache.set,o=i,i(c)}function i(c){const d=n(c);if(d)return d;const u=Rp(c,r);return s(c,u),u}return function(){return o(em.apply(null,arguments))}}const De=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},sc=/^\[(?:([a-z-]+):)?(.+)\]$/i,rm=/^\d+\/\d+$/,nm=new Set(["px","full","screen"]),sm=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,om=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,am=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,im=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,lm=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,nr=e=>Sn(e)||nm.has(e)||rm.test(e),wr=e=>kn(e,"length",vm),Sn=e=>!!e&&!Number.isNaN(Number(e)),va=e=>kn(e,"number",Sn),hs=e=>!!e&&Number.isInteger(Number(e)),cm=e=>e.endsWith("%")&&Sn(e.slice(0,-1)),le=e=>sc.test(e),xr=e=>sm.test(e),dm=new Set(["length","size","percentage"]),um=e=>kn(e,dm,oc),fm=e=>kn(e,"position",oc),hm=new Set(["image","url"]),pm=e=>kn(e,hm,ym),mm=e=>kn(e,"",gm),ps=()=>!0,kn=(e,t,r)=>{const n=sc.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},vm=e=>om.test(e)&&!am.test(e),oc=()=>!1,gm=e=>im.test(e),ym=e=>lm.test(e),bm=tm(()=>{const e=De("colors"),t=De("spacing"),r=De("blur"),n=De("brightness"),s=De("borderColor"),o=De("borderRadius"),a=De("borderSpacing"),i=De("borderWidth"),c=De("contrast"),d=De("grayscale"),u=De("hueRotate"),h=De("invert"),v=De("gap"),f=De("gradientColorStops"),b=De("gradientColorStopPositions"),p=De("inset"),g=De("margin"),x=De("opacity"),y=De("padding"),w=De("saturate"),k=De("scale"),E=De("sepia"),M=De("skew"),T=De("space"),O=De("translate"),F=()=>["auto","contain","none"],W=()=>["auto","hidden","clip","visible","scroll"],G=()=>["auto",le,t],D=()=>[le,t],U=()=>["",nr,wr],L=()=>["auto",Sn,le],J=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Y=()=>["solid","dashed","dotted","double","none"],I=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],A=()=>["start","end","center","between","around","evenly","stretch"],B=()=>["","0",le],ae=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Se=()=>[Sn,le];return{cacheSize:500,separator:":",theme:{colors:[ps],spacing:[nr,wr],blur:["none","",xr,le],brightness:Se(),borderColor:[e],borderRadius:["none","","full",xr,le],borderSpacing:D(),borderWidth:U(),contrast:Se(),grayscale:B(),hueRotate:Se(),invert:B(),gap:D(),gradientColorStops:[e],gradientColorStopPositions:[cm,wr],inset:G(),margin:G(),opacity:Se(),padding:D(),saturate:Se(),scale:Se(),sepia:B(),skew:Se(),space:D(),translate:D()},classGroups:{aspect:[{aspect:["auto","square","video",le]}],container:["container"],columns:[{columns:[xr]}],"break-after":[{"break-after":ae()}],"break-before":[{"break-before":ae()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...J(),le]}],overflow:[{overflow:W()}],"overflow-x":[{"overflow-x":W()}],"overflow-y":[{"overflow-y":W()}],overscroll:[{overscroll:F()}],"overscroll-x":[{"overscroll-x":F()}],"overscroll-y":[{"overscroll-y":F()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",hs,le]}],basis:[{basis:G()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",le]}],grow:[{grow:B()}],shrink:[{shrink:B()}],order:[{order:["first","last","none",hs,le]}],"grid-cols":[{"grid-cols":[ps]}],"col-start-end":[{col:["auto",{span:["full",hs,le]},le]}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":[ps]}],"row-start-end":[{row:["auto",{span:[hs,le]},le]}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",le]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",le]}],gap:[{gap:[v]}],"gap-x":[{"gap-x":[v]}],"gap-y":[{"gap-y":[v]}],"justify-content":[{justify:["normal",...A()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...A(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...A(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",le,t]}],"min-w":[{"min-w":[le,t,"min","max","fit"]}],"max-w":[{"max-w":[le,t,"none","full","min","max","fit","prose",{screen:[xr]},xr]}],h:[{h:[le,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[le,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[le,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[le,t,"auto","min","max","fit"]}],"font-size":[{text:["base",xr,wr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",va]}],"font-family":[{font:[ps]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",le]}],"line-clamp":[{"line-clamp":["none",Sn,va]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",nr,le]}],"list-image":[{"list-image":["none",le]}],"list-style-type":[{list:["none","disc","decimal",le]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Y(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",nr,wr]}],"underline-offset":[{"underline-offset":["auto",nr,le]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",le]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",le]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...J(),fm]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",um]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},pm]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[f]}],"gradient-via":[{via:[f]}],"gradient-to":[{to:[f]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[i]}],"border-w-x":[{"border-x":[i]}],"border-w-y":[{"border-y":[i]}],"border-w-s":[{"border-s":[i]}],"border-w-e":[{"border-e":[i]}],"border-w-t":[{"border-t":[i]}],"border-w-r":[{"border-r":[i]}],"border-w-b":[{"border-b":[i]}],"border-w-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[x]}],"border-style":[{border:[...Y(),"hidden"]}],"divide-x":[{"divide-x":[i]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[i]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[x]}],"divide-style":[{divide:Y()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...Y()]}],"outline-offset":[{"outline-offset":[nr,le]}],"outline-w":[{outline:[nr,wr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[nr,wr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",xr,mm]}],"shadow-color":[{shadow:[ps]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...I(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":I()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",xr,le]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[h]}],saturate:[{saturate:[w]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",le]}],duration:[{duration:Se()}],ease:[{ease:["linear","in","out","in-out",le]}],delay:[{delay:Se()}],animate:[{animate:["none","spin","ping","pulse","bounce",le]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[k]}],"scale-x":[{"scale-x":[k]}],"scale-y":[{"scale-y":[k]}],rotate:[{rotate:[hs,le]}],"translate-x":[{"translate-x":[O]}],"translate-y":[{"translate-y":[O]}],"skew-x":[{"skew-x":[M]}],"skew-y":[{"skew-y":[M]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",le]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",le]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",le]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[nr,wr,va]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}});function he(...e){return bm(Hl(e))}const wm=Tp,ac=m.forwardRef(({className:e,...t},r)=>l.jsx(Ll,{ref:r,className:he("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));ac.displayName=Ll.displayName;const xm=ha("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),ic=m.forwardRef(({className:e,variant:t,...r},n)=>l.jsx(Vl,{ref:n,className:he(xm({variant:t}),e),...r}));ic.displayName=Vl.displayName;const _m=m.forwardRef(({className:e,...t},r)=>l.jsx(Wl,{ref:r,className:he("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));_m.displayName=Wl.displayName;const lc=m.forwardRef(({className:e,...t},r)=>l.jsx(jl,{ref:r,className:he("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:l.jsx(Jl,{className:"h-4 w-4"})}));lc.displayName=jl.displayName;const cc=m.forwardRef(({className:e,...t},r)=>l.jsx($l,{ref:r,className:he("text-sm font-semibold",e),...t}));cc.displayName=$l.displayName;const dc=m.forwardRef(({className:e,...t},r)=>l.jsx(Bl,{ref:r,className:he("text-sm opacity-90",e),...t}));dc.displayName=Bl.displayName;function Cm(){const{toasts:e}=Gs();return l.jsxs(wm,{children:[e.map(function({id:t,title:r,description:n,action:s,...o}){return l.jsxs(ic,{...o,children:[l.jsxs("div",{className:"grid gap-1",children:[r&&l.jsx(cc,{children:r}),n&&l.jsx(dc,{children:n})]}),s,l.jsx(lc,{})]},t)}),l.jsx(ac,{})]})}var uc=["light","dark"],Sm="(prefers-color-scheme: dark)",km=m.createContext(void 0),Nm={setTheme:e=>{},themes:[]},Em=()=>{var e;return(e=m.useContext(km))!=null?e:Nm};m.memo(({forcedTheme:e,storageKey:t,attribute:r,enableSystem:n,enableColorScheme:s,defaultTheme:o,value:a,attrs:i,nonce:c})=>{let d=o==="system",u=r==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${i.map(b=>`'${b}'`).join(",")})`};`:`var d=document.documentElement,n='${r}',s='setAttribute';`,h=s?uc.includes(o)&&o?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${o}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",v=(b,p=!1,g=!0)=>{let x=a?a[b]:b,y=p?b+"|| ''":`'${x}'`,w="";return s&&g&&!p&&uc.includes(b)&&(w+=`d.style.colorScheme = '${b}';`),r==="class"?p||x?w+=`c.add(${y})`:w+="null":x&&(w+=`d[s](n,${y})`),w},f=e?`!function(){${u}${v(e)}}()`:n?`!function(){try{${u}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${d})){var t='${Sm}',m=window.matchMedia(t);if(m.media!==t||m.matches){${v("dark")}}else{${v("light")}}}else if(e){${a?`var x=${JSON.stringify(a)};`:""}${v(a?"x[e]":"e",!0)}}${d?"":"else{"+v(o,!1,!1)+"}"}${h}}catch(e){}}()`:`!function(){try{${u}var e=localStorage.getItem('${t}');if(e){${a?`var x=${JSON.stringify(a)};`:""}${v(a?"x[e]":"e",!0)}}else{${v(o,!1,!1)};}${h}}catch(t){}}();`;return m.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:f}})});var Pm=e=>{switch(e){case"success":return Mm;case"info":return Dm;case"warning":return Am;case"error":return Im;default:return null}},Tm=Array(12).fill(0),Om=({visible:e,className:t})=>S.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},S.createElement("div",{className:"sonner-spinner"},Tm.map((r,n)=>S.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),Mm=S.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},S.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Am=S.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},S.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Dm=S.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},S.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Im=S.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},S.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Fm=S.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},S.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),S.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Lm=()=>{let[e,t]=S.useState(document.hidden);return S.useEffect(()=>{let r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e},ga=1,Vm=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:r,...n}=e,s=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:ga++,o=this.toasts.find(i=>i.id===s),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),o?this.toasts=this.toasts.map(i=>i.id===s?(this.publish({...i,...e,id:s,title:r}),{...i,...e,id:s,dismissible:a,title:r}):i):this.addToast({title:r,...n,dismissible:a,id:s}),s},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(r=>r({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let n=e instanceof Promise?e:e(),s=r!==void 0,o,a=n.then(async c=>{if(o=["resolve",c],S.isValidElement(c))s=!1,this.create({id:r,type:"default",message:c});else if(Bm(c)&&!c.ok){s=!1;let d=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,u=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:r,type:"error",message:d,description:u})}else if(t.success!==void 0){s=!1;let d=typeof t.success=="function"?await t.success(c):t.success,u=typeof t.description=="function"?await t.description(c):t.description;this.create({id:r,type:"success",message:d,description:u})}}).catch(async c=>{if(o=["reject",c],t.error!==void 0){s=!1;let d=typeof t.error=="function"?await t.error(c):t.error,u=typeof t.description=="function"?await t.description(c):t.description;this.create({id:r,type:"error",message:d,description:u})}}).finally(()=>{var c;s&&(this.dismiss(r),r=void 0),(c=t.finally)==null||c.call(t)}),i=()=>new Promise((c,d)=>a.then(()=>o[0]==="reject"?d(o[1]):c(o[1])).catch(d));return typeof r!="string"&&typeof r!="number"?{unwrap:i}:Object.assign(r,{unwrap:i})},this.custom=(e,t)=>{let r=(t==null?void 0:t.id)||ga++;return this.create({jsx:e(r),id:r,...t}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},ut=new Vm,$m=(e,t)=>{let r=(t==null?void 0:t.id)||ga++;return ut.addToast({title:e,...t,id:r}),r},Bm=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Wm=$m,jm=()=>ut.toasts,Um=()=>ut.getActiveToasts();Object.assign(Wm,{success:ut.success,info:ut.info,warning:ut.warning,error:ut.error,custom:ut.custom,message:ut.message,promise:ut.promise,dismiss:ut.dismiss,loading:ut.loading},{getHistory:jm,getToasts:Um});function Hm(e,{insertAt:t}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}Hm(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
102
+ `);function no(e){return e.label!==void 0}var zm=3,Ym="32px",qm="16px",fc=4e3,Zm=356,Km=14,Qm=20,Gm=200;function Pt(...e){return e.filter(Boolean).join(" ")}function Xm(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}var Jm=e=>{var t,r,n,s,o,a,i,c,d,u,h;let{invert:v,toast:f,unstyled:b,interacting:p,setHeights:g,visibleToasts:x,heights:y,index:w,toasts:k,expanded:E,removeToast:M,defaultRichColors:T,closeButton:O,style:F,cancelButtonStyle:W,actionButtonStyle:G,className:D="",descriptionClassName:U="",duration:L,position:J,gap:Y,loadingIcon:I,expandByDefault:A,classNames:B,icons:ae,closeButtonAriaLabel:Se="Close toast",pauseWhenPageIsHidden:de}=e,[ue,pe]=S.useState(null),[Fe,rt]=S.useState(null),[q,ke]=S.useState(!1),[Ae,ye]=S.useState(!1),[me,be]=S.useState(!1),[Re,dt]=S.useState(!1),[Rt,er]=S.useState(!1),[mr,is]=S.useState(0),[vr,C]=S.useState(0),N=S.useRef(f.duration||L||fc),P=S.useRef(null),H=S.useRef(null),j=w===0,$=w+1<=x,Q=f.type,ve=f.dismissible!==!1,Te=f.className||"",yt=f.descriptionClassName||"",gr=S.useMemo(()=>y.findIndex(oe=>oe.toastId===f.id)||0,[y,f.id]),tr=S.useMemo(()=>{var oe;return(oe=f.closeButton)!=null?oe:O},[f.closeButton,O]),Jo=S.useMemo(()=>f.duration||L||fc,[f.duration,L]),xn=S.useRef(0),rr=S.useRef(0),Ro=S.useRef(0),yr=S.useRef(null),[Ji,ea]=J.split("-"),Ah=S.useMemo(()=>y.reduce((oe,Oe,Le)=>Le>=gr?oe:oe+Oe.height,0),[y,gr]),Dh=Lm(),wC=f.invert||v,Ri=Q==="loading";rr.current=S.useMemo(()=>gr*Y+Ah,[gr,Ah]),S.useEffect(()=>{N.current=Jo},[Jo]),S.useEffect(()=>{ke(!0)},[]),S.useEffect(()=>{let oe=H.current;if(oe){let Oe=oe.getBoundingClientRect().height;return C(Oe),g(Le=>[{toastId:f.id,height:Oe,position:f.position},...Le]),()=>g(Le=>Le.filter($t=>$t.toastId!==f.id))}},[g,f.id]),S.useLayoutEffect(()=>{if(!q)return;let oe=H.current,Oe=oe.style.height;oe.style.height="auto";let Le=oe.getBoundingClientRect().height;oe.style.height=Oe,C(Le),g($t=>$t.find(Bt=>Bt.toastId===f.id)?$t.map(Bt=>Bt.toastId===f.id?{...Bt,height:Le}:Bt):[{toastId:f.id,height:Le,position:f.position},...$t])},[q,f.title,f.description,g,f.id]);let Kr=S.useCallback(()=>{ye(!0),is(rr.current),g(oe=>oe.filter(Oe=>Oe.toastId!==f.id)),setTimeout(()=>{M(f)},Gm)},[f,M,g,rr]);S.useEffect(()=>{if(f.promise&&Q==="loading"||f.duration===1/0||f.type==="loading")return;let oe;return E||p||de&&Dh?(()=>{if(Ro.current<xn.current){let Oe=new Date().getTime()-xn.current;N.current=N.current-Oe}Ro.current=new Date().getTime()})():N.current!==1/0&&(xn.current=new Date().getTime(),oe=setTimeout(()=>{var Oe;(Oe=f.onAutoClose)==null||Oe.call(f,f),Kr()},N.current)),()=>clearTimeout(oe)},[E,p,f,Q,de,Dh,Kr]),S.useEffect(()=>{f.delete&&Kr()},[Kr,f.delete]);function xC(){var oe,Oe,Le;return ae!=null&&ae.loading?S.createElement("div",{className:Pt(B==null?void 0:B.loader,(oe=f==null?void 0:f.classNames)==null?void 0:oe.loader,"sonner-loader"),"data-visible":Q==="loading"},ae.loading):I?S.createElement("div",{className:Pt(B==null?void 0:B.loader,(Oe=f==null?void 0:f.classNames)==null?void 0:Oe.loader,"sonner-loader"),"data-visible":Q==="loading"},I):S.createElement(Om,{className:Pt(B==null?void 0:B.loader,(Le=f==null?void 0:f.classNames)==null?void 0:Le.loader),visible:Q==="loading"})}return S.createElement("li",{tabIndex:0,ref:H,className:Pt(D,Te,B==null?void 0:B.toast,(t=f==null?void 0:f.classNames)==null?void 0:t.toast,B==null?void 0:B.default,B==null?void 0:B[Q],(r=f==null?void 0:f.classNames)==null?void 0:r[Q]),"data-sonner-toast":"","data-rich-colors":(n=f.richColors)!=null?n:T,"data-styled":!(f.jsx||f.unstyled||b),"data-mounted":q,"data-promise":!!f.promise,"data-swiped":Rt,"data-removed":Ae,"data-visible":$,"data-y-position":Ji,"data-x-position":ea,"data-index":w,"data-front":j,"data-swiping":me,"data-dismissible":ve,"data-type":Q,"data-invert":wC,"data-swipe-out":Re,"data-swipe-direction":Fe,"data-expanded":!!(E||A&&q),style:{"--index":w,"--toasts-before":w,"--z-index":k.length-w,"--offset":`${Ae?mr:rr.current}px`,"--initial-height":A?"auto":`${vr}px`,...F,...f.style},onDragEnd:()=>{be(!1),pe(null),yr.current=null},onPointerDown:oe=>{Ri||!ve||(P.current=new Date,is(rr.current),oe.target.setPointerCapture(oe.pointerId),oe.target.tagName!=="BUTTON"&&(be(!0),yr.current={x:oe.clientX,y:oe.clientY}))},onPointerUp:()=>{var oe,Oe,Le,$t;if(Re||!ve)return;yr.current=null;let Bt=Number(((oe=H.current)==null?void 0:oe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Qr=Number(((Oe=H.current)==null?void 0:Oe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),_n=new Date().getTime()-((Le=P.current)==null?void 0:Le.getTime()),Wt=ue==="x"?Bt:Qr,Gr=Math.abs(Wt)/_n;if(Math.abs(Wt)>=Qm||Gr>.11){is(rr.current),($t=f.onDismiss)==null||$t.call(f,f),rt(ue==="x"?Bt>0?"right":"left":Qr>0?"down":"up"),Kr(),dt(!0),er(!1);return}be(!1),pe(null)},onPointerMove:oe=>{var Oe,Le,$t,Bt;if(!yr.current||!ve||((Oe=window.getSelection())==null?void 0:Oe.toString().length)>0)return;let Qr=oe.clientY-yr.current.y,_n=oe.clientX-yr.current.x,Wt=(Le=e.swipeDirections)!=null?Le:Xm(J);!ue&&(Math.abs(_n)>1||Math.abs(Qr)>1)&&pe(Math.abs(_n)>Math.abs(Qr)?"x":"y");let Gr={x:0,y:0};ue==="y"?(Wt.includes("top")||Wt.includes("bottom"))&&(Wt.includes("top")&&Qr<0||Wt.includes("bottom")&&Qr>0)&&(Gr.y=Qr):ue==="x"&&(Wt.includes("left")||Wt.includes("right"))&&(Wt.includes("left")&&_n<0||Wt.includes("right")&&_n>0)&&(Gr.x=_n),(Math.abs(Gr.x)>0||Math.abs(Gr.y)>0)&&er(!0),($t=H.current)==null||$t.style.setProperty("--swipe-amount-x",`${Gr.x}px`),(Bt=H.current)==null||Bt.style.setProperty("--swipe-amount-y",`${Gr.y}px`)}},tr&&!f.jsx?S.createElement("button",{"aria-label":Se,"data-disabled":Ri,"data-close-button":!0,onClick:Ri||!ve?()=>{}:()=>{var oe;Kr(),(oe=f.onDismiss)==null||oe.call(f,f)},className:Pt(B==null?void 0:B.closeButton,(s=f==null?void 0:f.classNames)==null?void 0:s.closeButton)},(o=ae==null?void 0:ae.close)!=null?o:Fm):null,f.jsx||S.isValidElement(f.title)?f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title:S.createElement(S.Fragment,null,Q||f.icon||f.promise?S.createElement("div",{"data-icon":"",className:Pt(B==null?void 0:B.icon,(a=f==null?void 0:f.classNames)==null?void 0:a.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||xC():null,f.type!=="loading"?f.icon||(ae==null?void 0:ae[Q])||Pm(Q):null):null,S.createElement("div",{"data-content":"",className:Pt(B==null?void 0:B.content,(i=f==null?void 0:f.classNames)==null?void 0:i.content)},S.createElement("div",{"data-title":"",className:Pt(B==null?void 0:B.title,(c=f==null?void 0:f.classNames)==null?void 0:c.title)},typeof f.title=="function"?f.title():f.title),f.description?S.createElement("div",{"data-description":"",className:Pt(U,yt,B==null?void 0:B.description,(d=f==null?void 0:f.classNames)==null?void 0:d.description)},typeof f.description=="function"?f.description():f.description):null),S.isValidElement(f.cancel)?f.cancel:f.cancel&&no(f.cancel)?S.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||W,onClick:oe=>{var Oe,Le;no(f.cancel)&&ve&&((Le=(Oe=f.cancel).onClick)==null||Le.call(Oe,oe),Kr())},className:Pt(B==null?void 0:B.cancelButton,(u=f==null?void 0:f.classNames)==null?void 0:u.cancelButton)},f.cancel.label):null,S.isValidElement(f.action)?f.action:f.action&&no(f.action)?S.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||G,onClick:oe=>{var Oe,Le;no(f.action)&&((Le=(Oe=f.action).onClick)==null||Le.call(Oe,oe),!oe.defaultPrevented&&Kr())},className:Pt(B==null?void 0:B.actionButton,(h=f==null?void 0:f.classNames)==null?void 0:h.actionButton)},f.action.label):null))};function hc(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Rm(e,t){let r={};return[e,t].forEach((n,s)=>{let o=s===1,a=o?"--mobile-offset":"--offset",i=o?qm:Ym;function c(d){["top","right","bottom","left"].forEach(u=>{r[`${a}-${u}`]=typeof d=="number"?`${d}px`:d})}typeof n=="number"||typeof n=="string"?c(n):typeof n=="object"?["top","right","bottom","left"].forEach(d=>{n[d]===void 0?r[`${a}-${d}`]=i:r[`${a}-${d}`]=typeof n[d]=="number"?`${n[d]}px`:n[d]}):c(i)}),r}var ev=S.forwardRef(function(e,t){let{invert:r,position:n="bottom-right",hotkey:s=["altKey","KeyT"],expand:o,closeButton:a,className:i,offset:c,mobileOffset:d,theme:u="light",richColors:h,duration:v,style:f,visibleToasts:b=zm,toastOptions:p,dir:g=hc(),gap:x=Km,loadingIcon:y,icons:w,containerAriaLabel:k="Notifications",pauseWhenPageIsHidden:E}=e,[M,T]=S.useState([]),O=S.useMemo(()=>Array.from(new Set([n].concat(M.filter(de=>de.position).map(de=>de.position)))),[M,n]),[F,W]=S.useState([]),[G,D]=S.useState(!1),[U,L]=S.useState(!1),[J,Y]=S.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),I=S.useRef(null),A=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),B=S.useRef(null),ae=S.useRef(!1),Se=S.useCallback(de=>{T(ue=>{var pe;return(pe=ue.find(Fe=>Fe.id===de.id))!=null&&pe.delete||ut.dismiss(de.id),ue.filter(({id:Fe})=>Fe!==de.id)})},[]);return S.useEffect(()=>ut.subscribe(de=>{if(de.dismiss){T(ue=>ue.map(pe=>pe.id===de.id?{...pe,delete:!0}:pe));return}setTimeout(()=>{Ge.flushSync(()=>{T(ue=>{let pe=ue.findIndex(Fe=>Fe.id===de.id);return pe!==-1?[...ue.slice(0,pe),{...ue[pe],...de},...ue.slice(pe+1)]:[de,...ue]})})})}),[]),S.useEffect(()=>{if(u!=="system"){Y(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Y("dark"):Y("light")),typeof window>"u")return;let de=window.matchMedia("(prefers-color-scheme: dark)");try{de.addEventListener("change",({matches:ue})=>{Y(ue?"dark":"light")})}catch{de.addListener(({matches:pe})=>{try{Y(pe?"dark":"light")}catch(Fe){console.error(Fe)}})}},[u]),S.useEffect(()=>{M.length<=1&&D(!1)},[M]),S.useEffect(()=>{let de=ue=>{var pe,Fe;s.every(rt=>ue[rt]||ue.code===rt)&&(D(!0),(pe=I.current)==null||pe.focus()),ue.code==="Escape"&&(document.activeElement===I.current||(Fe=I.current)!=null&&Fe.contains(document.activeElement))&&D(!1)};return document.addEventListener("keydown",de),()=>document.removeEventListener("keydown",de)},[s]),S.useEffect(()=>{if(I.current)return()=>{B.current&&(B.current.focus({preventScroll:!0}),B.current=null,ae.current=!1)}},[I.current]),S.createElement("section",{ref:t,"aria-label":`${k} ${A}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},O.map((de,ue)=>{var pe;let[Fe,rt]=de.split("-");return M.length?S.createElement("ol",{key:de,dir:g==="auto"?hc():g,tabIndex:-1,ref:I,className:i,"data-sonner-toaster":!0,"data-theme":J,"data-y-position":Fe,"data-lifted":G&&M.length>1&&!o,"data-x-position":rt,style:{"--front-toast-height":`${((pe=F[0])==null?void 0:pe.height)||0}px`,"--width":`${Zm}px`,"--gap":`${x}px`,...f,...Rm(c,d)},onBlur:q=>{ae.current&&!q.currentTarget.contains(q.relatedTarget)&&(ae.current=!1,B.current&&(B.current.focus({preventScroll:!0}),B.current=null))},onFocus:q=>{q.target instanceof HTMLElement&&q.target.dataset.dismissible==="false"||ae.current||(ae.current=!0,B.current=q.relatedTarget)},onMouseEnter:()=>D(!0),onMouseMove:()=>D(!0),onMouseLeave:()=>{U||D(!1)},onDragEnd:()=>D(!1),onPointerDown:q=>{q.target instanceof HTMLElement&&q.target.dataset.dismissible==="false"||L(!0)},onPointerUp:()=>L(!1)},M.filter(q=>!q.position&&ue===0||q.position===de).map((q,ke)=>{var Ae,ye;return S.createElement(Jm,{key:q.id,icons:w,index:ke,toast:q,defaultRichColors:h,duration:(Ae=p==null?void 0:p.duration)!=null?Ae:v,className:p==null?void 0:p.className,descriptionClassName:p==null?void 0:p.descriptionClassName,invert:r,visibleToasts:b,closeButton:(ye=p==null?void 0:p.closeButton)!=null?ye:a,interacting:U,position:de,style:p==null?void 0:p.style,unstyled:p==null?void 0:p.unstyled,classNames:p==null?void 0:p.classNames,cancelButtonStyle:p==null?void 0:p.cancelButtonStyle,actionButtonStyle:p==null?void 0:p.actionButtonStyle,removeToast:Se,toasts:M.filter(me=>me.position==q.position),heights:F.filter(me=>me.position==q.position),setHeights:W,expandByDefault:o,gap:x,loadingIcon:y,expanded:G,pauseWhenPageIsHidden:E,swipeDirections:e.swipeDirections})})):null}))});const tv=({...e})=>{const{theme:t="system"}=Em();return l.jsx(ev,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})};var rv=m[" useId ".trim().toString()]||(()=>{}),nv=0;function so(e){const[t,r]=m.useState(rv());return et(()=>{r(n=>n??String(nv++))},[e]),t?`radix-${t}`:""}const sv=["top","right","bottom","left"],_r=Math.min,bt=Math.max,oo=Math.round,ao=Math.floor,jt=e=>({x:e,y:e}),ov={left:"right",right:"left",bottom:"top",top:"bottom"},av={start:"end",end:"start"};function ya(e,t,r){return bt(e,_r(t,r))}function sr(e,t){return typeof e=="function"?e(t):e}function or(e){return e.split("-")[0]}function Nn(e){return e.split("-")[1]}function ba(e){return e==="x"?"y":"x"}function wa(e){return e==="y"?"height":"width"}const iv=new Set(["top","bottom"]);function Ut(e){return iv.has(or(e))?"y":"x"}function xa(e){return ba(Ut(e))}function lv(e,t,r){r===void 0&&(r=!1);const n=Nn(e),s=xa(e),o=wa(s);let a=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=io(a)),[a,io(a)]}function cv(e){const t=io(e);return[_a(e),t,_a(t)]}function _a(e){return e.replace(/start|end/g,t=>av[t])}const pc=["left","right"],mc=["right","left"],dv=["top","bottom"],uv=["bottom","top"];function fv(e,t,r){switch(e){case"top":case"bottom":return r?t?mc:pc:t?pc:mc;case"left":case"right":return t?dv:uv;default:return[]}}function hv(e,t,r,n){const s=Nn(e);let o=fv(or(e),r==="start",n);return s&&(o=o.map(a=>a+"-"+s),t&&(o=o.concat(o.map(_a)))),o}function io(e){return e.replace(/left|right|bottom|top/g,t=>ov[t])}function pv(e){return{top:0,right:0,bottom:0,left:0,...e}}function vc(e){return typeof e!="number"?pv(e):{top:e,right:e,bottom:e,left:e}}function lo(e){const{x:t,y:r,width:n,height:s}=e;return{width:n,height:s,top:r,left:t,right:t+n,bottom:r+s,x:t,y:r}}function gc(e,t,r){let{reference:n,floating:s}=e;const o=Ut(t),a=xa(t),i=wa(a),c=or(t),d=o==="y",u=n.x+n.width/2-s.width/2,h=n.y+n.height/2-s.height/2,v=n[i]/2-s[i]/2;let f;switch(c){case"top":f={x:u,y:n.y-s.height};break;case"bottom":f={x:u,y:n.y+n.height};break;case"right":f={x:n.x+n.width,y:h};break;case"left":f={x:n.x-s.width,y:h};break;default:f={x:n.x,y:n.y}}switch(Nn(t)){case"start":f[a]-=v*(r&&d?-1:1);break;case"end":f[a]+=v*(r&&d?-1:1);break}return f}const mv=async(e,t,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:o=[],platform:a}=r,i=o.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t));let d=await a.getElementRects({reference:e,floating:t,strategy:s}),{x:u,y:h}=gc(d,n,c),v=n,f={},b=0;for(let p=0;p<i.length;p++){const{name:g,fn:x}=i[p],{x:y,y:w,data:k,reset:E}=await x({x:u,y:h,initialPlacement:n,placement:v,strategy:s,middlewareData:f,rects:d,platform:a,elements:{reference:e,floating:t}});u=y??u,h=w??h,f={...f,[g]:{...f[g],...k}},E&&b<=50&&(b++,typeof E=="object"&&(E.placement&&(v=E.placement),E.rects&&(d=E.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:s}):E.rects),{x:u,y:h}=gc(d,v,c)),p=-1)}return{x:u,y:h,placement:v,strategy:s,middlewareData:f}};async function ms(e,t){var r;t===void 0&&(t={});const{x:n,y:s,platform:o,rects:a,elements:i,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:v=!1,padding:f=0}=sr(t,e),b=vc(f),g=i[v?h==="floating"?"reference":"floating":h],x=lo(await o.getClippingRect({element:(r=await(o.isElement==null?void 0:o.isElement(g)))==null||r?g:g.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(i.floating)),boundary:d,rootBoundary:u,strategy:c})),y=h==="floating"?{x:n,y:s,width:a.floating.width,height:a.floating.height}:a.reference,w=await(o.getOffsetParent==null?void 0:o.getOffsetParent(i.floating)),k=await(o.isElement==null?void 0:o.isElement(w))?await(o.getScale==null?void 0:o.getScale(w))||{x:1,y:1}:{x:1,y:1},E=lo(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:y,offsetParent:w,strategy:c}):y);return{top:(x.top-E.top+b.top)/k.y,bottom:(E.bottom-x.bottom+b.bottom)/k.y,left:(x.left-E.left+b.left)/k.x,right:(E.right-x.right+b.right)/k.x}}const vv=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:s,rects:o,platform:a,elements:i,middlewareData:c}=t,{element:d,padding:u=0}=sr(e,t)||{};if(d==null)return{};const h=vc(u),v={x:r,y:n},f=xa(s),b=wa(f),p=await a.getDimensions(d),g=f==="y",x=g?"top":"left",y=g?"bottom":"right",w=g?"clientHeight":"clientWidth",k=o.reference[b]+o.reference[f]-v[f]-o.floating[b],E=v[f]-o.reference[f],M=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let T=M?M[w]:0;(!T||!await(a.isElement==null?void 0:a.isElement(M)))&&(T=i.floating[w]||o.floating[b]);const O=k/2-E/2,F=T/2-p[b]/2-1,W=_r(h[x],F),G=_r(h[y],F),D=W,U=T-p[b]-G,L=T/2-p[b]/2+O,J=ya(D,L,U),Y=!c.arrow&&Nn(s)!=null&&L!==J&&o.reference[b]/2-(L<D?W:G)-p[b]/2<0,I=Y?L<D?L-D:L-U:0;return{[f]:v[f]+I,data:{[f]:J,centerOffset:L-J-I,...Y&&{alignmentOffset:I}},reset:Y}}}),gv=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:s,middlewareData:o,rects:a,initialPlacement:i,platform:c,elements:d}=t,{mainAxis:u=!0,crossAxis:h=!0,fallbackPlacements:v,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:p=!0,...g}=sr(e,t);if((r=o.arrow)!=null&&r.alignmentOffset)return{};const x=or(s),y=Ut(i),w=or(i)===i,k=await(c.isRTL==null?void 0:c.isRTL(d.floating)),E=v||(w||!p?[io(i)]:cv(i)),M=b!=="none";!v&&M&&E.push(...hv(i,p,b,k));const T=[i,...E],O=await ms(t,g),F=[];let W=((n=o.flip)==null?void 0:n.overflows)||[];if(u&&F.push(O[x]),h){const L=lv(s,a,k);F.push(O[L[0]],O[L[1]])}if(W=[...W,{placement:s,overflows:F}],!F.every(L=>L<=0)){var G,D;const L=(((G=o.flip)==null?void 0:G.index)||0)+1,J=T[L];if(J&&(!(h==="alignment"?y!==Ut(J):!1)||W.every(A=>A.overflows[0]>0&&Ut(A.placement)===y)))return{data:{index:L,overflows:W},reset:{placement:J}};let Y=(D=W.filter(I=>I.overflows[0]<=0).sort((I,A)=>I.overflows[1]-A.overflows[1])[0])==null?void 0:D.placement;if(!Y)switch(f){case"bestFit":{var U;const I=(U=W.filter(A=>{if(M){const B=Ut(A.placement);return B===y||B==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(B=>B>0).reduce((B,ae)=>B+ae,0)]).sort((A,B)=>A[1]-B[1])[0])==null?void 0:U[0];I&&(Y=I);break}case"initialPlacement":Y=i;break}if(s!==Y)return{reset:{placement:Y}}}return{}}}};function yc(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function bc(e){return sv.some(t=>e[t]>=0)}const yv=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...s}=sr(e,t);switch(n){case"referenceHidden":{const o=await ms(t,{...s,elementContext:"reference"}),a=yc(o,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:bc(a)}}}case"escaped":{const o=await ms(t,{...s,altBoundary:!0}),a=yc(o,r.floating);return{data:{escapedOffsets:a,escaped:bc(a)}}}default:return{}}}}},wc=new Set(["left","top"]);async function bv(e,t){const{placement:r,platform:n,elements:s}=e,o=await(n.isRTL==null?void 0:n.isRTL(s.floating)),a=or(r),i=Nn(r),c=Ut(r)==="y",d=wc.has(a)?-1:1,u=o&&c?-1:1,h=sr(t,e);let{mainAxis:v,crossAxis:f,alignmentAxis:b}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return i&&typeof b=="number"&&(f=i==="end"?b*-1:b),c?{x:f*u,y:v*d}:{x:v*d,y:f*u}}const wv=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:s,y:o,placement:a,middlewareData:i}=t,c=await bv(t,e);return a===((r=i.offset)==null?void 0:r.placement)&&(n=i.arrow)!=null&&n.alignmentOffset?{}:{x:s+c.x,y:o+c.y,data:{...c,placement:a}}}}},xv=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:s}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:i={fn:g=>{let{x,y}=g;return{x,y}}},...c}=sr(e,t),d={x:r,y:n},u=await ms(t,c),h=Ut(or(s)),v=ba(h);let f=d[v],b=d[h];if(o){const g=v==="y"?"top":"left",x=v==="y"?"bottom":"right",y=f+u[g],w=f-u[x];f=ya(y,f,w)}if(a){const g=h==="y"?"top":"left",x=h==="y"?"bottom":"right",y=b+u[g],w=b-u[x];b=ya(y,b,w)}const p=i.fn({...t,[v]:f,[h]:b});return{...p,data:{x:p.x-r,y:p.y-n,enabled:{[v]:o,[h]:a}}}}}},_v=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:s,rects:o,middlewareData:a}=t,{offset:i=0,mainAxis:c=!0,crossAxis:d=!0}=sr(e,t),u={x:r,y:n},h=Ut(s),v=ba(h);let f=u[v],b=u[h];const p=sr(i,t),g=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(c){const w=v==="y"?"height":"width",k=o.reference[v]-o.floating[w]+g.mainAxis,E=o.reference[v]+o.reference[w]-g.mainAxis;f<k?f=k:f>E&&(f=E)}if(d){var x,y;const w=v==="y"?"width":"height",k=wc.has(or(s)),E=o.reference[h]-o.floating[w]+(k&&((x=a.offset)==null?void 0:x[h])||0)+(k?0:g.crossAxis),M=o.reference[h]+o.reference[w]+(k?0:((y=a.offset)==null?void 0:y[h])||0)-(k?g.crossAxis:0);b<E?b=E:b>M&&(b=M)}return{[v]:f,[h]:b}}}},Cv=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:s,rects:o,platform:a,elements:i}=t,{apply:c=()=>{},...d}=sr(e,t),u=await ms(t,d),h=or(s),v=Nn(s),f=Ut(s)==="y",{width:b,height:p}=o.floating;let g,x;h==="top"||h==="bottom"?(g=h,x=v===(await(a.isRTL==null?void 0:a.isRTL(i.floating))?"start":"end")?"left":"right"):(x=h,g=v==="end"?"top":"bottom");const y=p-u.top-u.bottom,w=b-u.left-u.right,k=_r(p-u[g],y),E=_r(b-u[x],w),M=!t.middlewareData.shift;let T=k,O=E;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(O=w),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(T=y),M&&!v){const W=bt(u.left,0),G=bt(u.right,0),D=bt(u.top,0),U=bt(u.bottom,0);f?O=b-2*(W!==0||G!==0?W+G:bt(u.left,u.right)):T=p-2*(D!==0||U!==0?D+U:bt(u.top,u.bottom))}await c({...t,availableWidth:O,availableHeight:T});const F=await a.getDimensions(i.floating);return b!==F.width||p!==F.height?{reset:{rects:!0}}:{}}}};function co(){return typeof window<"u"}function En(e){return xc(e)?(e.nodeName||"").toLowerCase():"#document"}function wt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ht(e){var t;return(t=(xc(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function xc(e){return co()?e instanceof Node||e instanceof wt(e).Node:!1}function Tt(e){return co()?e instanceof Element||e instanceof wt(e).Element:!1}function zt(e){return co()?e instanceof HTMLElement||e instanceof wt(e).HTMLElement:!1}function _c(e){return!co()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof wt(e).ShadowRoot}const Sv=new Set(["inline","contents"]);function vs(e){const{overflow:t,overflowX:r,overflowY:n,display:s}=Ot(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Sv.has(s)}const kv=new Set(["table","td","th"]);function Nv(e){return kv.has(En(e))}const Ev=[":popover-open",":modal"];function uo(e){return Ev.some(t=>{try{return e.matches(t)}catch{return!1}})}const Pv=["transform","translate","scale","rotate","perspective"],Tv=["transform","translate","scale","rotate","perspective","filter"],Ov=["paint","layout","strict","content"];function Ca(e){const t=Sa(),r=Tt(e)?Ot(e):e;return Pv.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||Tv.some(n=>(r.willChange||"").includes(n))||Ov.some(n=>(r.contain||"").includes(n))}function Mv(e){let t=Cr(e);for(;zt(t)&&!Pn(t);){if(Ca(t))return t;if(uo(t))return null;t=Cr(t)}return null}function Sa(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Av=new Set(["html","body","#document"]);function Pn(e){return Av.has(En(e))}function Ot(e){return wt(e).getComputedStyle(e)}function fo(e){return Tt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Cr(e){if(En(e)==="html")return e;const t=e.assignedSlot||e.parentNode||_c(e)&&e.host||Ht(e);return _c(t)?t.host:t}function Cc(e){const t=Cr(e);return Pn(t)?e.ownerDocument?e.ownerDocument.body:e.body:zt(t)&&vs(t)?t:Cc(t)}function gs(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const s=Cc(e),o=s===((n=e.ownerDocument)==null?void 0:n.body),a=wt(s);if(o){const i=ka(a);return t.concat(a,a.visualViewport||[],vs(s)?s:[],i&&r?gs(i):[])}return t.concat(s,gs(s,[],r))}function ka(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Sc(e){const t=Ot(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=zt(e),o=s?e.offsetWidth:r,a=s?e.offsetHeight:n,i=oo(r)!==o||oo(n)!==a;return i&&(r=o,n=a),{width:r,height:n,$:i}}function Na(e){return Tt(e)?e:e.contextElement}function Tn(e){const t=Na(e);if(!zt(t))return jt(1);const r=t.getBoundingClientRect(),{width:n,height:s,$:o}=Sc(t);let a=(o?oo(r.width):r.width)/n,i=(o?oo(r.height):r.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!i||!Number.isFinite(i))&&(i=1),{x:a,y:i}}const Dv=jt(0);function kc(e){const t=wt(e);return!Sa()||!t.visualViewport?Dv:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Iv(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==wt(e)?!1:t}function en(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),o=Na(e);let a=jt(1);t&&(n?Tt(n)&&(a=Tn(n)):a=Tn(e));const i=Iv(o,r,n)?kc(o):jt(0);let c=(s.left+i.x)/a.x,d=(s.top+i.y)/a.y,u=s.width/a.x,h=s.height/a.y;if(o){const v=wt(o),f=n&&Tt(n)?wt(n):n;let b=v,p=ka(b);for(;p&&n&&f!==b;){const g=Tn(p),x=p.getBoundingClientRect(),y=Ot(p),w=x.left+(p.clientLeft+parseFloat(y.paddingLeft))*g.x,k=x.top+(p.clientTop+parseFloat(y.paddingTop))*g.y;c*=g.x,d*=g.y,u*=g.x,h*=g.y,c+=w,d+=k,b=wt(p),p=ka(b)}}return lo({width:u,height:h,x:c,y:d})}function Ea(e,t){const r=fo(e).scrollLeft;return t?t.left+r:en(Ht(e)).left+r}function Nc(e,t,r){r===void 0&&(r=!1);const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-(r?0:Ea(e,n)),o=n.top+t.scrollTop;return{x:s,y:o}}function Fv(e){let{elements:t,rect:r,offsetParent:n,strategy:s}=e;const o=s==="fixed",a=Ht(n),i=t?uo(t.floating):!1;if(n===a||i&&o)return r;let c={scrollLeft:0,scrollTop:0},d=jt(1);const u=jt(0),h=zt(n);if((h||!h&&!o)&&((En(n)!=="body"||vs(a))&&(c=fo(n)),zt(n))){const f=en(n);d=Tn(n),u.x=f.x+n.clientLeft,u.y=f.y+n.clientTop}const v=a&&!h&&!o?Nc(a,c,!0):jt(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-c.scrollLeft*d.x+u.x+v.x,y:r.y*d.y-c.scrollTop*d.y+u.y+v.y}}function Lv(e){return Array.from(e.getClientRects())}function Vv(e){const t=Ht(e),r=fo(e),n=e.ownerDocument.body,s=bt(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=bt(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let a=-r.scrollLeft+Ea(e);const i=-r.scrollTop;return Ot(n).direction==="rtl"&&(a+=bt(t.clientWidth,n.clientWidth)-s),{width:s,height:o,x:a,y:i}}function $v(e,t){const r=wt(e),n=Ht(e),s=r.visualViewport;let o=n.clientWidth,a=n.clientHeight,i=0,c=0;if(s){o=s.width,a=s.height;const d=Sa();(!d||d&&t==="fixed")&&(i=s.offsetLeft,c=s.offsetTop)}return{width:o,height:a,x:i,y:c}}const Bv=new Set(["absolute","fixed"]);function Wv(e,t){const r=en(e,!0,t==="fixed"),n=r.top+e.clientTop,s=r.left+e.clientLeft,o=zt(e)?Tn(e):jt(1),a=e.clientWidth*o.x,i=e.clientHeight*o.y,c=s*o.x,d=n*o.y;return{width:a,height:i,x:c,y:d}}function Ec(e,t,r){let n;if(t==="viewport")n=$v(e,r);else if(t==="document")n=Vv(Ht(e));else if(Tt(t))n=Wv(t,r);else{const s=kc(e);n={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return lo(n)}function Pc(e,t){const r=Cr(e);return r===t||!Tt(r)||Pn(r)?!1:Ot(r).position==="fixed"||Pc(r,t)}function jv(e,t){const r=t.get(e);if(r)return r;let n=gs(e,[],!1).filter(i=>Tt(i)&&En(i)!=="body"),s=null;const o=Ot(e).position==="fixed";let a=o?Cr(e):e;for(;Tt(a)&&!Pn(a);){const i=Ot(a),c=Ca(a);!c&&i.position==="fixed"&&(s=null),(o?!c&&!s:!c&&i.position==="static"&&!!s&&Bv.has(s.position)||vs(a)&&!c&&Pc(e,a))?n=n.filter(u=>u!==a):s=i,a=Cr(a)}return t.set(e,n),n}function Uv(e){let{element:t,boundary:r,rootBoundary:n,strategy:s}=e;const a=[...r==="clippingAncestors"?uo(t)?[]:jv(t,this._c):[].concat(r),n],i=a[0],c=a.reduce((d,u)=>{const h=Ec(t,u,s);return d.top=bt(h.top,d.top),d.right=_r(h.right,d.right),d.bottom=_r(h.bottom,d.bottom),d.left=bt(h.left,d.left),d},Ec(t,i,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Hv(e){const{width:t,height:r}=Sc(e);return{width:t,height:r}}function zv(e,t,r){const n=zt(t),s=Ht(t),o=r==="fixed",a=en(e,!0,o,t);let i={scrollLeft:0,scrollTop:0};const c=jt(0);function d(){c.x=Ea(s)}if(n||!n&&!o)if((En(t)!=="body"||vs(s))&&(i=fo(t)),n){const f=en(t,!0,o,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}else s&&d();o&&!n&&s&&d();const u=s&&!n&&!o?Nc(s,i):jt(0),h=a.left+i.scrollLeft-c.x-u.x,v=a.top+i.scrollTop-c.y-u.y;return{x:h,y:v,width:a.width,height:a.height}}function Pa(e){return Ot(e).position==="static"}function Tc(e,t){if(!zt(e)||Ot(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Ht(e)===r&&(r=r.ownerDocument.body),r}function Oc(e,t){const r=wt(e);if(uo(e))return r;if(!zt(e)){let s=Cr(e);for(;s&&!Pn(s);){if(Tt(s)&&!Pa(s))return s;s=Cr(s)}return r}let n=Tc(e,t);for(;n&&Nv(n)&&Pa(n);)n=Tc(n,t);return n&&Pn(n)&&Pa(n)&&!Ca(n)?r:n||Mv(e)||r}const Yv=async function(e){const t=this.getOffsetParent||Oc,r=this.getDimensions,n=await r(e.floating);return{reference:zv(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function qv(e){return Ot(e).direction==="rtl"}const Zv={convertOffsetParentRelativeRectToViewportRelativeRect:Fv,getDocumentElement:Ht,getClippingRect:Uv,getOffsetParent:Oc,getElementRects:Yv,getClientRects:Lv,getDimensions:Hv,getScale:Tn,isElement:Tt,isRTL:qv};function Mc(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Kv(e,t){let r=null,n;const s=Ht(e);function o(){var i;clearTimeout(n),(i=r)==null||i.disconnect(),r=null}function a(i,c){i===void 0&&(i=!1),c===void 0&&(c=1),o();const d=e.getBoundingClientRect(),{left:u,top:h,width:v,height:f}=d;if(i||t(),!v||!f)return;const b=ao(h),p=ao(s.clientWidth-(u+v)),g=ao(s.clientHeight-(h+f)),x=ao(u),w={rootMargin:-b+"px "+-p+"px "+-g+"px "+-x+"px",threshold:bt(0,_r(1,c))||1};let k=!0;function E(M){const T=M[0].intersectionRatio;if(T!==c){if(!k)return a();T?a(!1,T):n=setTimeout(()=>{a(!1,1e-7)},1e3)}T===1&&!Mc(d,e.getBoundingClientRect())&&a(),k=!1}try{r=new IntersectionObserver(E,{...w,root:s.ownerDocument})}catch{r=new IntersectionObserver(E,w)}r.observe(e)}return a(!0),o}function Qv(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,d=Na(e),u=s||o?[...d?gs(d):[],...gs(t)]:[];u.forEach(x=>{s&&x.addEventListener("scroll",r,{passive:!0}),o&&x.addEventListener("resize",r)});const h=d&&i?Kv(d,r):null;let v=-1,f=null;a&&(f=new ResizeObserver(x=>{let[y]=x;y&&y.target===d&&f&&(f.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var w;(w=f)==null||w.observe(t)})),r()}),d&&!c&&f.observe(d),f.observe(t));let b,p=c?en(e):null;c&&g();function g(){const x=en(e);p&&!Mc(p,x)&&r(),p=x,b=requestAnimationFrame(g)}return r(),()=>{var x;u.forEach(y=>{s&&y.removeEventListener("scroll",r),o&&y.removeEventListener("resize",r)}),h==null||h(),(x=f)==null||x.disconnect(),f=null,c&&cancelAnimationFrame(b)}}const Gv=wv,Xv=xv,Jv=gv,Rv=Cv,eg=yv,Ac=vv,tg=_v,rg=(e,t,r)=>{const n=new Map,s={platform:Zv,...r},o={...s.platform,_c:n};return mv(e,t,{...s,platform:o})};var ng=typeof document<"u",sg=function(){},ho=ng?S.useLayoutEffect:sg;function po(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!po(e[n],t[n]))return!1;return!0}if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,s[n]))return!1;for(n=r;n--!==0;){const o=s[n];if(!(o==="_owner"&&e.$$typeof)&&!po(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Dc(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ic(e,t){const r=Dc(e);return Math.round(t*r)/r}function Ta(e){const t=m.useRef(e);return ho(()=>{t.current=e}),t}function og(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:o,floating:a}={},transform:i=!0,whileElementsMounted:c,open:d}=e,[u,h]=m.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[v,f]=m.useState(n);po(v,n)||f(n);const[b,p]=m.useState(null),[g,x]=m.useState(null),y=m.useCallback(A=>{A!==M.current&&(M.current=A,p(A))},[]),w=m.useCallback(A=>{A!==T.current&&(T.current=A,x(A))},[]),k=o||b,E=a||g,M=m.useRef(null),T=m.useRef(null),O=m.useRef(u),F=c!=null,W=Ta(c),G=Ta(s),D=Ta(d),U=m.useCallback(()=>{if(!M.current||!T.current)return;const A={placement:t,strategy:r,middleware:v};G.current&&(A.platform=G.current),rg(M.current,T.current,A).then(B=>{const ae={...B,isPositioned:D.current!==!1};L.current&&!po(O.current,ae)&&(O.current=ae,ls.flushSync(()=>{h(ae)}))})},[v,t,r,G,D]);ho(()=>{d===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,h(A=>({...A,isPositioned:!1})))},[d]);const L=m.useRef(!1);ho(()=>(L.current=!0,()=>{L.current=!1}),[]),ho(()=>{if(k&&(M.current=k),E&&(T.current=E),k&&E){if(W.current)return W.current(k,E,U);U()}},[k,E,U,W,F]);const J=m.useMemo(()=>({reference:M,floating:T,setReference:y,setFloating:w}),[y,w]),Y=m.useMemo(()=>({reference:k,floating:E}),[k,E]),I=m.useMemo(()=>{const A={position:r,left:0,top:0};if(!Y.floating)return A;const B=Ic(Y.floating,u.x),ae=Ic(Y.floating,u.y);return i?{...A,transform:"translate("+B+"px, "+ae+"px)",...Dc(Y.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:B,top:ae}},[r,i,Y.floating,u.x,u.y]);return m.useMemo(()=>({...u,update:U,refs:J,elements:Y,floatingStyles:I}),[u,U,J,Y,I])}const ag=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:s}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Ac({element:n.current,padding:s}).fn(r):{}:n?Ac({element:n,padding:s}).fn(r):{}}}},ig=(e,t)=>({...Gv(e),options:[e,t]}),lg=(e,t)=>({...Xv(e),options:[e,t]}),cg=(e,t)=>({...tg(e),options:[e,t]}),dg=(e,t)=>({...Jv(e),options:[e,t]}),ug=(e,t)=>({...Rv(e),options:[e,t]}),fg=(e,t)=>({...eg(e),options:[e,t]}),hg=(e,t)=>({...ag(e),options:[e,t]});var pg="Arrow",Fc=m.forwardRef((e,t)=>{const{children:r,width:n=10,height:s=5,...o}=e;return l.jsx(we.svg,{...o,ref:t,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});Fc.displayName=pg;var mg=Fc;function vg(e){const[t,r]=m.useState(void 0);return et(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let a,i;if("borderBoxSize"in o){const c=o.borderBoxSize,d=Array.isArray(c)?c[0]:c;a=d.inlineSize,i=d.blockSize}else a=e.offsetWidth,i=e.offsetHeight;r({width:a,height:i})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Oa="Popper",[Lc,On]=Rr(Oa),[gg,Vc]=Lc(Oa),$c=e=>{const{__scopePopper:t,children:r}=e,[n,s]=m.useState(null);return l.jsx(gg,{scope:t,anchor:n,onAnchorChange:s,children:r})};$c.displayName=Oa;var Bc="PopperAnchor",Wc=m.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...s}=e,o=Vc(Bc,r),a=m.useRef(null),i=Ie(t,a);return m.useEffect(()=>{o.onAnchorChange((n==null?void 0:n.current)||a.current)}),n?null:l.jsx(we.div,{...s,ref:i})});Wc.displayName=Bc;var Ma="PopperContent",[yg,bg]=Lc(Ma),jc=m.forwardRef((e,t)=>{var q,ke,Ae,ye,me,be;const{__scopePopper:r,side:n="bottom",sideOffset:s=0,align:o="center",alignOffset:a=0,arrowPadding:i=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:h="partial",hideWhenDetached:v=!1,updatePositionStrategy:f="optimized",onPlaced:b,...p}=e,g=Vc(Ma,r),[x,y]=m.useState(null),w=Ie(t,Re=>y(Re)),[k,E]=m.useState(null),M=vg(k),T=(M==null?void 0:M.width)??0,O=(M==null?void 0:M.height)??0,F=n+(o!=="center"?"-"+o:""),W=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},G=Array.isArray(d)?d:[d],D=G.length>0,U={padding:W,boundary:G.filter(xg),altBoundary:D},{refs:L,floatingStyles:J,placement:Y,isPositioned:I,middlewareData:A}=og({strategy:"fixed",placement:F,whileElementsMounted:(...Re)=>Qv(...Re,{animationFrame:f==="always"}),elements:{reference:g.anchor},middleware:[ig({mainAxis:s+O,alignmentAxis:a}),c&&lg({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?cg():void 0,...U}),c&&dg({...U}),ug({...U,apply:({elements:Re,rects:dt,availableWidth:Rt,availableHeight:er})=>{const{width:mr,height:is}=dt.reference,vr=Re.floating.style;vr.setProperty("--radix-popper-available-width",`${Rt}px`),vr.setProperty("--radix-popper-available-height",`${er}px`),vr.setProperty("--radix-popper-anchor-width",`${mr}px`),vr.setProperty("--radix-popper-anchor-height",`${is}px`)}}),k&&hg({element:k,padding:i}),_g({arrowWidth:T,arrowHeight:O}),v&&fg({strategy:"referenceHidden",...U})]}),[B,ae]=zc(Y),Se=Et(b);et(()=>{I&&(Se==null||Se())},[I,Se]);const de=(q=A.arrow)==null?void 0:q.x,ue=(ke=A.arrow)==null?void 0:ke.y,pe=((Ae=A.arrow)==null?void 0:Ae.centerOffset)!==0,[Fe,rt]=m.useState();return et(()=>{x&&rt(window.getComputedStyle(x).zIndex)},[x]),l.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...J,transform:I?J.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Fe,"--radix-popper-transform-origin":[(ye=A.transformOrigin)==null?void 0:ye.x,(me=A.transformOrigin)==null?void 0:me.y].join(" "),...((be=A.hide)==null?void 0:be.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(yg,{scope:r,placedSide:B,onArrowChange:E,arrowX:de,arrowY:ue,shouldHideArrow:pe,children:l.jsx(we.div,{"data-side":B,"data-align":ae,...p,ref:w,style:{...p.style,animation:I?void 0:"none"}})})})});jc.displayName=Ma;var Uc="PopperArrow",wg={top:"bottom",right:"left",bottom:"top",left:"right"},Hc=m.forwardRef(function(t,r){const{__scopePopper:n,...s}=t,o=bg(Uc,n),a=wg[o.placedSide];return l.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:l.jsx(mg,{...s,ref:r,style:{...s.style,display:"block"}})})});Hc.displayName=Uc;function xg(e){return e!==null}var _g=e=>({name:"transformOrigin",options:e,fn(t){var g,x,y;const{placement:r,rects:n,middlewareData:s}=t,a=((g=s.arrow)==null?void 0:g.centerOffset)!==0,i=a?0:e.arrowWidth,c=a?0:e.arrowHeight,[d,u]=zc(r),h={start:"0%",center:"50%",end:"100%"}[u],v=(((x=s.arrow)==null?void 0:x.x)??0)+i/2,f=(((y=s.arrow)==null?void 0:y.y)??0)+c/2;let b="",p="";return d==="bottom"?(b=a?h:`${v}px`,p=`${-c}px`):d==="top"?(b=a?h:`${v}px`,p=`${n.floating.height+c}px`):d==="right"?(b=`${-c}px`,p=a?h:`${f}px`):d==="left"&&(b=`${n.floating.width+c}px`,p=a?h:`${f}px`),{data:{x:b,y:p}}}});function zc(e){const[t,r="center"]=e.split("-");return[t,r]}var Yc=$c,mo=Wc,Aa=jc,Da=Hc,[vo,SC]=Rr("Tooltip",[On]),Ia=On(),qc="TooltipProvider",Cg=700,Zc="tooltip.open",[Sg,Kc]=vo(qc),Qc=e=>{const{__scopeTooltip:t,delayDuration:r=Cg,skipDelayDuration:n=300,disableHoverableContent:s=!1,children:o}=e,a=m.useRef(!0),i=m.useRef(!1),c=m.useRef(0);return m.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),l.jsx(Sg,{scope:t,isOpenDelayedRef:a,delayDuration:r,onOpen:m.useCallback(()=>{window.clearTimeout(c.current),a.current=!1},[]),onClose:m.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,n)},[n]),isPointerInTransitRef:i,onPointerInTransitChange:m.useCallback(d=>{i.current=d},[]),disableHoverableContent:s,children:o})};Qc.displayName=qc;var Gc="Tooltip",[kC,go]=vo(Gc),Fa="TooltipTrigger",kg=m.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=go(Fa,r),o=Kc(Fa,r),a=Ia(r),i=m.useRef(null),c=Ie(t,i,s.onTriggerChange),d=m.useRef(!1),u=m.useRef(!1),h=m.useCallback(()=>d.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),l.jsx(mo,{asChild:!0,...a,children:l.jsx(we.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:c,onPointerMove:ie(e.onPointerMove,v=>{v.pointerType!=="touch"&&!u.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),u.current=!0)}),onPointerLeave:ie(e.onPointerLeave,()=>{s.onTriggerLeave(),u.current=!1}),onPointerDown:ie(e.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:ie(e.onFocus,()=>{d.current||s.onOpen()}),onBlur:ie(e.onBlur,s.onClose),onClick:ie(e.onClick,s.onClose)})})});kg.displayName=Fa;var Ng="TooltipPortal",[NC,Eg]=vo(Ng,{forceMount:void 0}),Mn="TooltipContent",Xc=m.forwardRef((e,t)=>{const r=Eg(Mn,e.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...o}=e,a=go(Mn,e.__scopeTooltip);return l.jsx(us,{present:n||a.open,children:a.disableHoverableContent?l.jsx(Jc,{side:s,...o,ref:t}):l.jsx(Pg,{side:s,...o,ref:t})})}),Pg=m.forwardRef((e,t)=>{const r=go(Mn,e.__scopeTooltip),n=Kc(Mn,e.__scopeTooltip),s=m.useRef(null),o=Ie(t,s),[a,i]=m.useState(null),{trigger:c,onClose:d}=r,u=s.current,{onPointerInTransitChange:h}=n,v=m.useCallback(()=>{i(null),h(!1)},[h]),f=m.useCallback((b,p)=>{const g=b.currentTarget,x={x:b.clientX,y:b.clientY},y=Dg(x,g.getBoundingClientRect()),w=Ig(x,y),k=Fg(p.getBoundingClientRect()),E=Vg([...w,...k]);i(E),h(!0)},[h]);return m.useEffect(()=>()=>v(),[v]),m.useEffect(()=>{if(c&&u){const b=g=>f(g,u),p=g=>f(g,c);return c.addEventListener("pointerleave",b),u.addEventListener("pointerleave",p),()=>{c.removeEventListener("pointerleave",b),u.removeEventListener("pointerleave",p)}}},[c,u,f,v]),m.useEffect(()=>{if(a){const b=p=>{const g=p.target,x={x:p.clientX,y:p.clientY},y=(c==null?void 0:c.contains(g))||(u==null?void 0:u.contains(g)),w=!Lg(x,a);y?v():w&&(v(),d())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[c,u,a,d,v]),l.jsx(Jc,{...e,ref:o})}),[Tg,Og]=vo(Gc,{isInside:!1}),Mg=Hh("TooltipContent"),Jc=m.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:a,...i}=e,c=go(Mn,r),d=Ia(r),{onClose:u}=c;return m.useEffect(()=>(document.addEventListener(Zc,u),()=>document.removeEventListener(Zc,u)),[u]),m.useEffect(()=>{if(c.trigger){const h=v=>{const f=v.target;f!=null&&f.contains(c.trigger)&&u()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[c.trigger,u]),l.jsx(ds,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:h=>h.preventDefault(),onDismiss:u,children:l.jsxs(Aa,{"data-state":c.stateAttribute,...d,...i,ref:t,style:{...i.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[l.jsx(Mg,{children:n}),l.jsx(Tg,{scope:r,isInside:!0,children:l.jsx(up,{id:c.contentId,role:"tooltip",children:s||n})})]})})});Xc.displayName=Mn;var Rc="TooltipArrow",Ag=m.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=Ia(r);return Og(Rc,r).isInside?null:l.jsx(Da,{...s,...n,ref:t})});Ag.displayName=Rc;function Dg(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(r,n,s,o)){case o:return"left";case s:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function Ig(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function Fg(e){const{top:t,right:r,bottom:n,left:s}=e;return[{x:s,y:t},{x:r,y:t},{x:r,y:n},{x:s,y:n}]}function Lg(e,t){const{x:r,y:n}=e;let s=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const i=t[o],c=t[a],d=i.x,u=i.y,h=c.x,v=c.y;u>n!=v>n&&r<(h-d)*(n-u)/(v-u)+d&&(s=!s)}return s}function Vg(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),$g(t)}function $g(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const s=e[n];for(;t.length>=2;){const o=t[t.length-1],a=t[t.length-2];if((o.x-a.x)*(s.y-a.y)>=(o.y-a.y)*(s.x-a.x))t.pop();else break}t.push(s)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const s=e[n];for(;r.length>=2;){const o=r[r.length-1],a=r[r.length-2];if((o.x-a.x)*(s.y-a.y)>=(o.y-a.y)*(s.x-a.x))r.pop();else break}r.push(s)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var Bg=Qc,ed=Xc;const Wg=Bg,jg=m.forwardRef(({className:e,sideOffset:t=4,...r},n)=>l.jsx(ed,{ref:n,sideOffset:t,className:he("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));jg.displayName=ed.displayName;var An=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},tn=typeof window>"u"||"Deno"in globalThis;function nt(){}function Ug(e,t){return typeof e=="function"?e(t):e}function La(e){return typeof e=="number"&&e>=0&&e!==1/0}function td(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Sr(e,t){return typeof e=="function"?e(t):e}function St(e,t){return typeof e=="function"?e(t):e}function rd(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:o,queryKey:a,stale:i}=e;if(a){if(n){if(t.queryHash!==Va(a,t.options))return!1}else if(!ys(t.queryKey,a))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof i=="boolean"&&t.isStale()!==i||s&&s!==t.state.fetchStatus||o&&!o(t))}function nd(e,t){const{exact:r,status:n,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(r){if(rn(t.options.mutationKey)!==rn(o))return!1}else if(!ys(t.options.mutationKey,o))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function Va(e,t){return((t==null?void 0:t.queryKeyHashFn)||rn)(e)}function rn(e){return JSON.stringify(e,(t,r)=>Ba(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function ys(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>ys(e[r],t[r])):!1}function $a(e,t){if(e===t)return e;const r=sd(e)&&sd(t);if(r||Ba(e)&&Ba(t)){const n=r?e:Object.keys(e),s=n.length,o=r?t:Object.keys(t),a=o.length,i=r?[]:{},c=new Set(n);let d=0;for(let u=0;u<a;u++){const h=r?u:o[u];(!r&&c.has(h)||r)&&e[h]===void 0&&t[h]===void 0?(i[h]=void 0,d++):(i[h]=$a(e[h],t[h]),i[h]===e[h]&&e[h]!==void 0&&d++)}return s===a&&d===s?e:i}return t}function yo(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function sd(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ba(e){if(!od(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!od(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function od(e){return Object.prototype.toString.call(e)==="[object Object]"}function Hg(e){return new Promise(t=>{setTimeout(t,e)})}function Wa(e,t,r){if(typeof r.structuralSharing=="function")return r.structuralSharing(e,t);if(r.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return $a(e,t)}catch(n){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${r.queryHash}]: ${n}`),n}return $a(e,t)}return t}function zg(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function Yg(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var bo=Symbol();function ad(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===bo&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===bo?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function id(e,t){return typeof e=="function"?e(...t):!!e}var qg=(_h=class extends An{constructor(){super();ee(this,hn);ee(this,Br);ee(this,Kn);K(this,Kn,t=>{if(!tn&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){_(this,Br)||this.setEventListener(_(this,Kn))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,Br))==null||t.call(this),K(this,Br,void 0))}setEventListener(t){var r;K(this,Kn,t),(r=_(this,Br))==null||r.call(this),K(this,Br,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){_(this,hn)!==t&&(K(this,hn,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof _(this,hn)=="boolean"?_(this,hn):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},hn=new WeakMap,Br=new WeakMap,Kn=new WeakMap,_h),ja=new qg,Zg=(Ch=class extends An{constructor(){super();ee(this,Qn,!0);ee(this,Wr);ee(this,Gn);K(this,Gn,t=>{if(!tn&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){_(this,Wr)||this.setEventListener(_(this,Gn))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,Wr))==null||t.call(this),K(this,Wr,void 0))}setEventListener(t){var r;K(this,Gn,t),(r=_(this,Wr))==null||r.call(this),K(this,Wr,t(this.setOnline.bind(this)))}setOnline(t){_(this,Qn)!==t&&(K(this,Qn,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return _(this,Qn)}},Qn=new WeakMap,Wr=new WeakMap,Gn=new WeakMap,Ch),wo=new Zg;function Ua(){let e,t;const r=new Promise((s,o)=>{e=s,t=o});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),e(s)},r.reject=s=>{n({status:"rejected",reason:s}),t(s)},r}function Kg(e){return Math.min(1e3*2**e,3e4)}function ld(e){return(e??"online")==="online"?wo.isOnline():!0}var cd=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function dd(e){let t=!1,r=0,n;const s=Ua(),o=()=>s.status!=="pending",a=p=>{var g;o()||(v(new cd(p)),(g=e.abort)==null||g.call(e))},i=()=>{t=!0},c=()=>{t=!1},d=()=>ja.isFocused()&&(e.networkMode==="always"||wo.isOnline())&&e.canRun(),u=()=>ld(e.networkMode)&&e.canRun(),h=p=>{o()||(n==null||n(),s.resolve(p))},v=p=>{o()||(n==null||n(),s.reject(p))},f=()=>new Promise(p=>{var g;n=x=>{(o()||d())&&p(x)},(g=e.onPause)==null||g.call(e)}).then(()=>{var p;n=void 0,o()||(p=e.onContinue)==null||p.call(e)}),b=()=>{if(o())return;let p;const g=r===0?e.initialPromise:void 0;try{p=g??e.fn()}catch(x){p=Promise.reject(x)}Promise.resolve(p).then(h).catch(x=>{var M;if(o())return;const y=e.retry??(tn?0:3),w=e.retryDelay??Kg,k=typeof w=="function"?w(r,x):w,E=y===!0||typeof y=="number"&&r<y||typeof y=="function"&&y(r,x);if(t||!E){v(x);return}r++,(M=e.onFail)==null||M.call(e,r,x),Hg(k).then(()=>d()?void 0:f()).then(()=>{t?v(x):b()})})};return{promise:s,status:()=>s.status,cancel:a,continue:()=>(n==null||n(),s),cancelRetry:i,continueRetry:c,canStart:u,start:()=>(u()?b():f().then(b),s)}}var Qg=e=>setTimeout(e,0);function Gg(){let e=[],t=0,r=i=>{i()},n=i=>{i()},s=Qg;const o=i=>{t?e.push(i):s(()=>{r(i)})},a=()=>{const i=e;e=[],i.length&&s(()=>{n(()=>{i.forEach(c=>{r(c)})})})};return{batch:i=>{let c;t++;try{c=i()}finally{t--,t||a()}return c},batchCalls:i=>(...c)=>{o(()=>{i(...c)})},schedule:o,setNotifyFunction:i=>{r=i},setBatchNotifyFunction:i=>{n=i},setScheduler:i=>{s=i}}}var Ke=Gg(),ud=(Sh=class{constructor(){ee(this,pn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),La(this.gcTime)&&K(this,pn,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(tn?1/0:5*60*1e3))}clearGcTimeout(){_(this,pn)&&(clearTimeout(_(this,pn)),K(this,pn,void 0))}},pn=new WeakMap,Sh),Xg=(kh=class extends ud{constructor(t){super();ee(this,Lt);ee(this,Xn);ee(this,Jn);ee(this,Nt);ee(this,mn);ee(this,Je);ee(this,Hs);ee(this,vn);K(this,vn,!1),K(this,Hs,t.defaultOptions),this.setOptions(t.options),this.observers=[],K(this,mn,t.client),K(this,Nt,_(this,mn).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,K(this,Xn,Jg(this.options)),this.state=t.state??_(this,Xn),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=_(this,Je))==null?void 0:t.promise}setOptions(t){this.options={..._(this,Hs),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&_(this,Nt).remove(this)}setData(t,r){const n=Wa(this.state.data,t,this.options);return ce(this,Lt,br).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){ce(this,Lt,br).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,s;const r=(n=_(this,Je))==null?void 0:n.promise;return(s=_(this,Je))==null||s.cancel(t),r?r.then(nt).catch(nt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(_(this,Xn))}isActive(){return this.observers.some(t=>St(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===bo||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Sr(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!td(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=_(this,Je))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=_(this,Je))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),_(this,Nt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(_(this,Je)&&(_(this,vn)?_(this,Je).cancel({revert:!0}):_(this,Je).cancelRetry()),this.scheduleGc()),_(this,Nt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ce(this,Lt,br).call(this,{type:"invalidate"})}async fetch(t,r){var c,d,u,h,v,f,b,p,g,x,y,w;if(this.state.fetchStatus!=="idle"&&((c=_(this,Je))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(_(this,Je))return _(this,Je).continueRetry(),_(this,Je).promise}if(t&&this.setOptions(t),!this.options.queryFn){const k=this.observers.find(E=>E.options.queryFn);k&&this.setOptions(k.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const n=new AbortController,s=k=>{Object.defineProperty(k,"signal",{enumerable:!0,get:()=>(K(this,vn,!0),n.signal)})},o=()=>{const k=ad(this.options,r),M=(()=>{const T={client:_(this,mn),queryKey:this.queryKey,meta:this.meta};return s(T),T})();return K(this,vn,!1),this.options.persister?this.options.persister(k,M,this):k(M)},i=(()=>{const k={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:_(this,mn),state:this.state,fetchFn:o};return s(k),k})();(d=this.options.behavior)==null||d.onFetch(i,this),K(this,Jn,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=i.fetchOptions)==null?void 0:u.meta))&&ce(this,Lt,br).call(this,{type:"fetch",meta:(h=i.fetchOptions)==null?void 0:h.meta}),K(this,Je,dd({initialPromise:r==null?void 0:r.initialPromise,fn:i.fetchFn,abort:n.abort.bind(n),onFail:(k,E)=>{ce(this,Lt,br).call(this,{type:"failed",failureCount:k,error:E})},onPause:()=>{ce(this,Lt,br).call(this,{type:"pause"})},onContinue:()=>{ce(this,Lt,br).call(this,{type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0}));try{const k=await _(this,Je).start();if(k===void 0)throw process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(k),(f=(v=_(this,Nt).config).onSuccess)==null||f.call(v,k,this),(p=(b=_(this,Nt).config).onSettled)==null||p.call(b,k,this.state.error,this),k}catch(k){if(k instanceof cd){if(k.silent)return _(this,Je).promise;if(k.revert){if(this.setState({..._(this,Jn),fetchStatus:"idle"}),this.state.data===void 0)throw k;return this.state.data}}throw ce(this,Lt,br).call(this,{type:"error",error:k}),(x=(g=_(this,Nt).config).onError)==null||x.call(g,k,this),(w=(y=_(this,Nt).config).onSettled)==null||w.call(y,this.state.data,k,this),k}finally{this.scheduleGc()}}},Xn=new WeakMap,Jn=new WeakMap,Nt=new WeakMap,mn=new WeakMap,Je=new WeakMap,Hs=new WeakMap,vn=new WeakMap,Lt=new WeakSet,br=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...fd(n.data,this.options),fetchMeta:t.meta??null};case"success":const s={...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return K(this,Jn,t.manual?s:void 0),s;case"error":const o=t.error;return{...n,error:o,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),Ke.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),_(this,Nt).notify({query:this,type:"updated",action:t})})},kh);function fd(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ld(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Jg(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Rg=(Nh=class extends An{constructor(t={}){super();ee(this,Gt);this.config=t,K(this,Gt,new Map)}build(t,r,n){const s=r.queryKey,o=r.queryHash??Va(s,r);let a=this.get(o);return a||(a=new Xg({client:t,queryKey:s,queryHash:o,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(s)}),this.add(a)),a}add(t){_(this,Gt).has(t.queryHash)||(_(this,Gt).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=_(this,Gt).get(t.queryHash);r&&(t.destroy(),r===t&&_(this,Gt).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ke.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return _(this,Gt).get(t)}getAll(){return[..._(this,Gt).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>rd(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>rd(t,n)):r}notify(t){Ke.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Ke.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ke.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Gt=new WeakMap,Nh),ey=(Eh=class extends ud{constructor(t){super();ee(this,Jt);ee(this,Xt);ee(this,lt);ee(this,gn);this.mutationId=t.mutationId,K(this,lt,t.mutationCache),K(this,Xt,[]),this.state=t.state||hd(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){_(this,Xt).includes(t)||(_(this,Xt).push(t),this.clearGcTimeout(),_(this,lt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){K(this,Xt,_(this,Xt).filter(r=>r!==t)),this.scheduleGc(),_(this,lt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){_(this,Xt).length||(this.state.status==="pending"?this.scheduleGc():_(this,lt).remove(this))}continue(){var t;return((t=_(this,gn))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,a,i,c,d,u,h,v,f,b,p,g,x,y,w,k,E,M,T,O;const r=()=>{ce(this,Jt,Xr).call(this,{type:"continue"})};K(this,gn,dd({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(F,W)=>{ce(this,Jt,Xr).call(this,{type:"failed",failureCount:F,error:W})},onPause:()=>{ce(this,Jt,Xr).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>_(this,lt).canRun(this)}));const n=this.state.status==="pending",s=!_(this,gn).canStart();try{if(n)r();else{ce(this,Jt,Xr).call(this,{type:"pending",variables:t,isPaused:s}),await((a=(o=_(this,lt).config).onMutate)==null?void 0:a.call(o,t,this));const W=await((c=(i=this.options).onMutate)==null?void 0:c.call(i,t));W!==this.state.context&&ce(this,Jt,Xr).call(this,{type:"pending",context:W,variables:t,isPaused:s})}const F=await _(this,gn).start();return await((u=(d=_(this,lt).config).onSuccess)==null?void 0:u.call(d,F,t,this.state.context,this)),await((v=(h=this.options).onSuccess)==null?void 0:v.call(h,F,t,this.state.context)),await((b=(f=_(this,lt).config).onSettled)==null?void 0:b.call(f,F,null,this.state.variables,this.state.context,this)),await((g=(p=this.options).onSettled)==null?void 0:g.call(p,F,null,t,this.state.context)),ce(this,Jt,Xr).call(this,{type:"success",data:F}),F}catch(F){try{throw await((y=(x=_(this,lt).config).onError)==null?void 0:y.call(x,F,t,this.state.context,this)),await((k=(w=this.options).onError)==null?void 0:k.call(w,F,t,this.state.context)),await((M=(E=_(this,lt).config).onSettled)==null?void 0:M.call(E,void 0,F,this.state.variables,this.state.context,this)),await((O=(T=this.options).onSettled)==null?void 0:O.call(T,void 0,F,t,this.state.context)),F}finally{ce(this,Jt,Xr).call(this,{type:"error",error:F})}}finally{_(this,lt).runNext(this)}}},Xt=new WeakMap,lt=new WeakMap,gn=new WeakMap,Jt=new WeakSet,Xr=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Ke.batch(()=>{_(this,Xt).forEach(n=>{n.onMutationUpdate(t)}),_(this,lt).notify({mutation:this,type:"updated",action:t})})},Eh);function hd(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ty=(Ph=class extends An{constructor(t={}){super();ee(this,ur);ee(this,Vt);ee(this,zs);this.config=t,K(this,ur,new Set),K(this,Vt,new Map),K(this,zs,0)}build(t,r,n){const s=new ey({mutationCache:this,mutationId:++ta(this,zs)._,options:t.defaultMutationOptions(r),state:n});return this.add(s),s}add(t){_(this,ur).add(t);const r=xo(t);if(typeof r=="string"){const n=_(this,Vt).get(r);n?n.push(t):_(this,Vt).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(_(this,ur).delete(t)){const r=xo(t);if(typeof r=="string"){const n=_(this,Vt).get(r);if(n)if(n.length>1){const s=n.indexOf(t);s!==-1&&n.splice(s,1)}else n[0]===t&&_(this,Vt).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=xo(t);if(typeof r=="string"){const n=_(this,Vt).get(r),s=n==null?void 0:n.find(o=>o.state.status==="pending");return!s||s===t}else return!0}runNext(t){var n;const r=xo(t);if(typeof r=="string"){const s=(n=_(this,Vt).get(r))==null?void 0:n.find(o=>o!==t&&o.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Ke.batch(()=>{_(this,ur).forEach(t=>{this.notify({type:"removed",mutation:t})}),_(this,ur).clear(),_(this,Vt).clear()})}getAll(){return Array.from(_(this,ur))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>nd(r,n))}findAll(t={}){return this.getAll().filter(r=>nd(t,r))}notify(t){Ke.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return Ke.batch(()=>Promise.all(t.map(r=>r.continue().catch(nt))))}},ur=new WeakMap,Vt=new WeakMap,zs=new WeakMap,Ph);function xo(e){var t;return(t=e.options.scope)==null?void 0:t.id}function pd(e){return{onFetch:(t,r)=>{var u,h,v,f,b;const n=t.options,s=(v=(h=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:h.fetchMore)==null?void 0:v.direction,o=((f=t.state.data)==null?void 0:f.pages)||[],a=((b=t.state.data)==null?void 0:b.pageParams)||[];let i={pages:[],pageParams:[]},c=0;const d=async()=>{let p=!1;const g=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?p=!0:t.signal.addEventListener("abort",()=>{p=!0}),t.signal)})},x=ad(t.options,t.fetchOptions),y=async(w,k,E)=>{if(p)return Promise.reject();if(k==null&&w.pages.length)return Promise.resolve(w);const T=(()=>{const G={client:t.client,queryKey:t.queryKey,pageParam:k,direction:E?"backward":"forward",meta:t.options.meta};return g(G),G})(),O=await x(T),{maxPages:F}=t.options,W=E?Yg:zg;return{pages:W(w.pages,O,F),pageParams:W(w.pageParams,k,F)}};if(s&&o.length){const w=s==="backward",k=w?ry:md,E={pages:o,pageParams:a},M=k(n,E);i=await y(E,M,w)}else{const w=e??o.length;do{const k=c===0?a[0]??n.initialPageParam:md(n,i);if(c>0&&k==null)break;i=await y(i,k),c++}while(c<w)}return i};t.options.persister?t.fetchFn=()=>{var p,g;return(g=(p=t.options).persister)==null?void 0:g.call(p,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=d}}}function md(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function ry(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var ny=(Th=class{constructor(e={}){ee(this,Ue);ee(this,jr);ee(this,Ur);ee(this,Rn);ee(this,es);ee(this,Hr);ee(this,ts);ee(this,rs);K(this,Ue,e.queryCache||new Rg),K(this,jr,e.mutationCache||new ty),K(this,Ur,e.defaultOptions||{}),K(this,Rn,new Map),K(this,es,new Map),K(this,Hr,0)}mount(){ta(this,Hr)._++,_(this,Hr)===1&&(K(this,ts,ja.subscribe(async e=>{e&&(await this.resumePausedMutations(),_(this,Ue).onFocus())})),K(this,rs,wo.subscribe(async e=>{e&&(await this.resumePausedMutations(),_(this,Ue).onOnline())})))}unmount(){var e,t;ta(this,Hr)._--,_(this,Hr)===0&&((e=_(this,ts))==null||e.call(this),K(this,ts,void 0),(t=_(this,rs))==null||t.call(this),K(this,rs,void 0))}isFetching(e){return _(this,Ue).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return _(this,jr).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=_(this,Ue).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=_(this,Ue).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Sr(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return _(this,Ue).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),s=_(this,Ue).get(n.queryHash),o=s==null?void 0:s.state.data,a=Ug(t,o);if(a!==void 0)return _(this,Ue).build(this,n).setData(a,{...r,manual:!0})}setQueriesData(e,t,r){return Ke.batch(()=>_(this,Ue).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=_(this,Ue).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=_(this,Ue);Ke.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=_(this,Ue);return Ke.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=Ke.batch(()=>_(this,Ue).findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(nt).catch(nt)}invalidateQueries(e,t={}){return Ke.batch(()=>(_(this,Ue).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=Ke.batch(()=>_(this,Ue).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,r);return r.throwOnError||(o=o.catch(nt)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(n).then(nt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=_(this,Ue).build(this,t);return r.isStaleByTime(Sr(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(nt).catch(nt)}fetchInfiniteQuery(e){return e.behavior=pd(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(nt).catch(nt)}ensureInfiniteQueryData(e){return e.behavior=pd(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return wo.isOnline()?_(this,jr).resumePausedMutations():Promise.resolve()}getQueryCache(){return _(this,Ue)}getMutationCache(){return _(this,jr)}getDefaultOptions(){return _(this,Ur)}setDefaultOptions(e){K(this,Ur,e)}setQueryDefaults(e,t){_(this,Rn).set(rn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[..._(this,Rn).values()],r={};return t.forEach(n=>{ys(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){_(this,es).set(rn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[..._(this,es).values()],r={};return t.forEach(n=>{ys(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={..._(this,Ur).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Va(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===bo&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{..._(this,Ur).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){_(this,Ue).clear(),_(this,jr).clear()}},Ue=new WeakMap,jr=new WeakMap,Ur=new WeakMap,Rn=new WeakMap,es=new WeakMap,Hr=new WeakMap,ts=new WeakMap,rs=new WeakMap,Th),sy=(Oh=class extends An{constructor(t,r){super();ee(this,Ne);ee(this,vt);ee(this,ge);ee(this,Ys);ee(this,ct);ee(this,yn);ee(this,ns);ee(this,fr);ee(this,zr);ee(this,qs);ee(this,ss);ee(this,os);ee(this,bn);ee(this,wn);ee(this,Yr);ee(this,as,new Set);this.options=r,K(this,vt,t),K(this,zr,null),K(this,fr,Ua()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(_(this,ge).addObserver(this),vd(_(this,ge),this.options)?ce(this,Ne,Zs).call(this):this.updateResult(),ce(this,Ne,sl).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ha(_(this,ge),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ha(_(this,ge),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ce(this,Ne,ol).call(this),ce(this,Ne,al).call(this),_(this,ge).removeObserver(this)}setOptions(t){const r=this.options,n=_(this,ge);if(this.options=_(this,vt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof St(this.options.enabled,_(this,ge))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ce(this,Ne,il).call(this),_(this,ge).setOptions(this.options),r._defaulted&&!yo(this.options,r)&&_(this,vt).getQueryCache().notify({type:"observerOptionsUpdated",query:_(this,ge),observer:this});const s=this.hasListeners();s&&gd(_(this,ge),n,this.options,r)&&ce(this,Ne,Zs).call(this),this.updateResult(),s&&(_(this,ge)!==n||St(this.options.enabled,_(this,ge))!==St(r.enabled,_(this,ge))||Sr(this.options.staleTime,_(this,ge))!==Sr(r.staleTime,_(this,ge)))&&ce(this,Ne,tl).call(this);const o=ce(this,Ne,rl).call(this);s&&(_(this,ge)!==n||St(this.options.enabled,_(this,ge))!==St(r.enabled,_(this,ge))||o!==_(this,Yr))&&ce(this,Ne,nl).call(this,o)}getOptimisticResult(t){const r=_(this,vt).getQueryCache().build(_(this,vt),t),n=this.createResult(r,t);return ay(this,n)&&(K(this,ct,n),K(this,ns,this.options),K(this,yn,_(this,ge).state)),n}getCurrentResult(){return _(this,ct)}trackResult(t,r){return new Proxy(t,{get:(n,s)=>(this.trackProp(s),r==null||r(s),s==="promise"&&!this.options.experimental_prefetchInRender&&_(this,fr).status==="pending"&&_(this,fr).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),Reflect.get(n,s))})}trackProp(t){_(this,as).add(t)}getCurrentQuery(){return _(this,ge)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=_(this,vt).defaultQueryOptions(t),n=_(this,vt).getQueryCache().build(_(this,vt),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return ce(this,Ne,Zs).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),_(this,ct)))}createResult(t,r){var F;const n=_(this,ge),s=this.options,o=_(this,ct),a=_(this,yn),i=_(this,ns),d=t!==n?t.state:_(this,Ys),{state:u}=t;let h={...u},v=!1,f;if(r._optimisticResults){const W=this.hasListeners(),G=!W&&vd(t,r),D=W&&gd(t,n,r,s);(G||D)&&(h={...h,...fd(u.data,t.options)}),r._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:b,errorUpdatedAt:p,status:g}=h;f=h.data;let x=!1;if(r.placeholderData!==void 0&&f===void 0&&g==="pending"){let W;o!=null&&o.isPlaceholderData&&r.placeholderData===(i==null?void 0:i.placeholderData)?(W=o.data,x=!0):W=typeof r.placeholderData=="function"?r.placeholderData((F=_(this,os))==null?void 0:F.state.data,_(this,os)):r.placeholderData,W!==void 0&&(g="success",f=Wa(o==null?void 0:o.data,W,r),v=!0)}if(r.select&&f!==void 0&&!x)if(o&&f===(a==null?void 0:a.data)&&r.select===_(this,qs))f=_(this,ss);else try{K(this,qs,r.select),f=r.select(f),f=Wa(o==null?void 0:o.data,f,r),K(this,ss,f),K(this,zr,null)}catch(W){K(this,zr,W)}_(this,zr)&&(b=_(this,zr),f=_(this,ss),p=Date.now(),g="error");const y=h.fetchStatus==="fetching",w=g==="pending",k=g==="error",E=w&&y,M=f!==void 0,O={status:g,fetchStatus:h.fetchStatus,isPending:w,isSuccess:g==="success",isError:k,isInitialLoading:E,isLoading:E,data:f,dataUpdatedAt:h.dataUpdatedAt,error:b,errorUpdatedAt:p,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>d.dataUpdateCount||h.errorUpdateCount>d.errorUpdateCount,isFetching:y,isRefetching:y&&!w,isLoadingError:k&&!M,isPaused:h.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:k&&M,isStale:za(t,r),refetch:this.refetch,promise:_(this,fr),isEnabled:St(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const W=U=>{O.status==="error"?U.reject(O.error):O.data!==void 0&&U.resolve(O.data)},G=()=>{const U=K(this,fr,O.promise=Ua());W(U)},D=_(this,fr);switch(D.status){case"pending":t.queryHash===n.queryHash&&W(D);break;case"fulfilled":(O.status==="error"||O.data!==D.value)&&G();break;case"rejected":(O.status!=="error"||O.error!==D.reason)&&G();break}}return O}updateResult(){const t=_(this,ct),r=this.createResult(_(this,ge),this.options);if(K(this,yn,_(this,ge).state),K(this,ns,this.options),_(this,yn).data!==void 0&&K(this,os,_(this,ge)),yo(r,t))return;K(this,ct,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,o=typeof s=="function"?s():s;if(o==="all"||!o&&!_(this,as).size)return!0;const a=new Set(o??_(this,as));return this.options.throwOnError&&a.add("error"),Object.keys(_(this,ct)).some(i=>{const c=i;return _(this,ct)[c]!==t[c]&&a.has(c)})};ce(this,Ne,Fh).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ce(this,Ne,sl).call(this)}},vt=new WeakMap,ge=new WeakMap,Ys=new WeakMap,ct=new WeakMap,yn=new WeakMap,ns=new WeakMap,fr=new WeakMap,zr=new WeakMap,qs=new WeakMap,ss=new WeakMap,os=new WeakMap,bn=new WeakMap,wn=new WeakMap,Yr=new WeakMap,as=new WeakMap,Ne=new WeakSet,Zs=function(t){ce(this,Ne,il).call(this);let r=_(this,ge).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(nt)),r},tl=function(){ce(this,Ne,ol).call(this);const t=Sr(this.options.staleTime,_(this,ge));if(tn||_(this,ct).isStale||!La(t))return;const n=td(_(this,ct).dataUpdatedAt,t)+1;K(this,bn,setTimeout(()=>{_(this,ct).isStale||this.updateResult()},n))},rl=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(_(this,ge)):this.options.refetchInterval)??!1},nl=function(t){ce(this,Ne,al).call(this),K(this,Yr,t),!(tn||St(this.options.enabled,_(this,ge))===!1||!La(_(this,Yr))||_(this,Yr)===0)&&K(this,wn,setInterval(()=>{(this.options.refetchIntervalInBackground||ja.isFocused())&&ce(this,Ne,Zs).call(this)},_(this,Yr)))},sl=function(){ce(this,Ne,tl).call(this),ce(this,Ne,nl).call(this,ce(this,Ne,rl).call(this))},ol=function(){_(this,bn)&&(clearTimeout(_(this,bn)),K(this,bn,void 0))},al=function(){_(this,wn)&&(clearInterval(_(this,wn)),K(this,wn,void 0))},il=function(){const t=_(this,vt).getQueryCache().build(_(this,vt),this.options);if(t===_(this,ge))return;const r=_(this,ge);K(this,ge,t),K(this,Ys,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},Fh=function(t){Ke.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(_(this,ct))}),_(this,vt).getQueryCache().notify({query:_(this,ge),type:"observerResultsUpdated"})})},Oh);function oy(e,t){return St(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function vd(e,t){return oy(e,t)||e.state.data!==void 0&&Ha(e,t,t.refetchOnMount)}function Ha(e,t,r){if(St(t.enabled,e)!==!1&&Sr(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&za(e,t)}return!1}function gd(e,t,r,n){return(e!==t||St(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&za(e,r)}function za(e,t){return St(t.enabled,e)!==!1&&e.isStaleByTime(Sr(t.staleTime,e))}function ay(e,t){return!yo(e.getCurrentResult(),t)}var iy=(Mh=class extends An{constructor(r,n){super();ee(this,pr);ee(this,qr);ee(this,Zr);ee(this,gt);ee(this,hr);K(this,qr,r),this.setOptions(n),this.bindMethods(),ce(this,pr,ra).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var s;const n=this.options;this.options=_(this,qr).defaultMutationOptions(r),yo(this.options,n)||_(this,qr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:_(this,gt),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&rn(n.mutationKey)!==rn(this.options.mutationKey)?this.reset():((s=_(this,gt))==null?void 0:s.state.status)==="pending"&&_(this,gt).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=_(this,gt))==null||r.removeObserver(this)}onMutationUpdate(r){ce(this,pr,ra).call(this),ce(this,pr,ll).call(this,r)}getCurrentResult(){return _(this,Zr)}reset(){var r;(r=_(this,gt))==null||r.removeObserver(this),K(this,gt,void 0),ce(this,pr,ra).call(this),ce(this,pr,ll).call(this)}mutate(r,n){var s;return K(this,hr,n),(s=_(this,gt))==null||s.removeObserver(this),K(this,gt,_(this,qr).getMutationCache().build(_(this,qr),this.options)),_(this,gt).addObserver(this),_(this,gt).execute(r)}},qr=new WeakMap,Zr=new WeakMap,gt=new WeakMap,hr=new WeakMap,pr=new WeakSet,ra=function(){var n;const r=((n=_(this,gt))==null?void 0:n.state)??hd();K(this,Zr,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},ll=function(r){Ke.batch(()=>{var n,s,o,a,i,c,d,u;if(_(this,hr)&&this.hasListeners()){const h=_(this,Zr).variables,v=_(this,Zr).context;(r==null?void 0:r.type)==="success"?((s=(n=_(this,hr)).onSuccess)==null||s.call(n,r.data,h,v),(a=(o=_(this,hr)).onSettled)==null||a.call(o,r.data,null,h,v)):(r==null?void 0:r.type)==="error"&&((c=(i=_(this,hr)).onError)==null||c.call(i,r.error,h,v),(u=(d=_(this,hr)).onSettled)==null||u.call(d,void 0,r.error,h,v))}this.listeners.forEach(h=>{h(_(this,Zr))})})},Mh),yd=m.createContext(void 0),bd=e=>{const t=m.useContext(yd);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},ly=({client:e,children:t})=>(m.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(yd.Provider,{value:e,children:t})),wd=m.createContext(!1),cy=()=>m.useContext(wd);wd.Provider;function dy(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var uy=m.createContext(dy()),fy=()=>m.useContext(uy),hy=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},py=e=>{m.useEffect(()=>{e.clearReset()},[e])},my=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&e.data===void 0||id(r,[e.error,n])),vy=e=>{if(e.suspense){const t=n=>n==="static"?n:Math.max(n??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...n)=>t(r(...n)):t(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},gy=(e,t)=>e.isLoading&&e.isFetching&&!t,yy=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,xd=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function by(e,t,r){var h,v,f,b,p;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const n=cy(),s=fy(),o=bd(),a=o.defaultQueryOptions(e);(v=(h=o.getDefaultOptions().queries)==null?void 0:h._experimental_beforeQuery)==null||v.call(h,a),process.env.NODE_ENV!=="production"&&(a.queryFn||console.error(`[${a.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),a._optimisticResults=n?"isRestoring":"optimistic",vy(a),hy(a,s),py(s);const i=!o.getQueryCache().get(a.queryHash),[c]=m.useState(()=>new t(o,a)),d=c.getOptimisticResult(a),u=!n&&e.subscribed!==!1;if(m.useSyncExternalStore(m.useCallback(g=>{const x=u?c.subscribe(Ke.batchCalls(g)):nt;return c.updateResult(),x},[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),m.useEffect(()=>{c.setOptions(a)},[a,c]),yy(a,d))throw xd(a,c,s);if(my({result:d,errorResetBoundary:s,throwOnError:a.throwOnError,query:o.getQueryCache().get(a.queryHash),suspense:a.suspense}))throw d.error;if((b=(f=o.getDefaultOptions().queries)==null?void 0:f._experimental_afterQuery)==null||b.call(f,a,d),a.experimental_prefetchInRender&&!tn&&gy(d,n)){const g=i?xd(a,c,s):(p=o.getQueryCache().get(a.queryHash))==null?void 0:p.promise;g==null||g.catch(nt).finally(()=>{c.updateResult()})}return a.notifyOnChangeProps?d:c.trackResult(d)}function wy(e,t){return by(e,sy)}function _d(e,t){const r=bd(),[n]=m.useState(()=>new iy(r,e));m.useEffect(()=>{n.setOptions(e)},[n,e]);const s=m.useSyncExternalStore(m.useCallback(a=>n.subscribe(Ke.batchCalls(a)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),o=m.useCallback((a,i)=>{n.mutate(a,i).catch(nt)},[n]);if(s.error&&id(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:o,mutateAsync:s.mutate}}const _o=ha("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),He=m.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...s},o)=>{const a=n?fl:"button";return l.jsx(a,{className:he(_o({variant:t,size:r,className:e})),ref:o,...s})});He.displayName="Button";const st=m.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,className:he("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));st.displayName="Card";const kr=m.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,className:he("flex flex-col space-y-1.5 p-6",e),...t}));kr.displayName="CardHeader";const Ya=m.forwardRef(({className:e,...t},r)=>l.jsx("h3",{ref:r,className:he("text-2xl font-semibold leading-none tracking-tight",e),...t}));Ya.displayName="CardTitle";const xy=m.forwardRef(({className:e,...t},r)=>l.jsx("p",{ref:r,className:he("text-sm text-muted-foreground",e),...t}));xy.displayName="CardDescription";const ot=m.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,className:he("p-6 pt-0",e),...t}));ot.displayName="CardContent";const _y=m.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,className:he("flex items-center p-6 pt-0",e),...t}));_y.displayName="CardFooter";const Cd=({title:e="Verify your identity",subtitle:t="We need some information to help us confirm your identity.",onContinue:r})=>l.jsx(st,{className:"w-full max-w-md mx-auto",children:l.jsxs(ot,{className:"pt-8 text-center",children:[l.jsx("div",{className:"bg-gradient-to-br from-primary/10 to-primary/5 rounded-3xl p-8 mb-8",children:l.jsx("div",{className:"relative mb-8",children:l.jsxs("div",{className:"relative mx-auto w-48 h-32",children:[l.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-primary to-primary/80 rounded-2xl transform rotate-3 shadow-lg",children:l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx("div",{className:"w-12 h-12 bg-white/20 rounded-full flex items-center justify-center",children:l.jsx("svg",{viewBox:"0 0 24 24",className:"w-6 h-6 text-white",fill:"currentColor",children:l.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})})})})}),l.jsx("div",{className:"absolute top-4 right-0 bg-card rounded-xl shadow-lg p-4 transform -rotate-3",children:l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx("div",{className:"w-8 h-8 bg-primary/20 rounded-full"}),l.jsxs("div",{className:"space-y-1",children:[l.jsx("div",{className:"w-12 h-2 bg-primary rounded"}),l.jsx("div",{className:"w-8 h-2 bg-primary/60 rounded"})]})]})}),l.jsx("div",{className:"absolute -top-2 -right-2 w-10 h-10 bg-primary rounded-full flex items-center justify-center shadow-lg",children:l.jsx(Xl,{className:"w-6 h-6 text-white"})})]})})}),l.jsx("h1",{className:"text-3xl font-bold text-foreground mb-4",children:e}),l.jsx("p",{className:"text-lg text-muted-foreground mb-12",children:t}),l.jsx(He,{className:"w-full h-14 text-lg font-semibold",onClick:r,children:"Start"}),l.jsx("p",{className:"text-sm text-muted-foreground mt-6",children:"Verifying usually takes a few seconds."})]})}),ft=m.forwardRef(({className:e,type:t,...r},n)=>l.jsx("input",{type:t,className:he("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...r}));ft.displayName="Input";var Cy="Label",Sd=m.forwardRef((e,t)=>l.jsx(we.label,{...e,ref:t,onMouseDown:r=>{var s;r.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));Sd.displayName=Cy;var kd=Sd;const Sy=ha("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),nn=m.forwardRef(({className:e,...t},r)=>l.jsx(kd,{ref:r,className:he(Sy(),e),...t}));nn.displayName=kd.displayName;const ky=({fullName:e,onNameChange:t,onContinue:r,renderProgress:n})=>l.jsxs(st,{className:"w-full max-w-md mx-auto",children:[l.jsxs(kr,{className:"text-center",children:[l.jsx(jp,{className:"w-12 h-12 mx-auto mb-4 text-primary"}),l.jsx(Ya,{children:"Personal Information"}),l.jsx("p",{className:"text-muted-foreground",children:"Please enter your full legal name"})]}),l.jsxs(ot,{children:[l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx(nn,{htmlFor:"fullName",children:"Full Name"}),l.jsx(ft,{id:"fullName",placeholder:"Enter your full name",value:e,onChange:s=>t(s.target.value)})]}),l.jsx(He,{className:"w-full",onClick:r,disabled:!e.trim(),children:"Continue"})]}),l.jsx("div",{className:"mt-6",children:n()})]})]}),Nr=({title:e,subTitle:t,onBack:r})=>l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex items-center mb-6",children:[l.jsx(He,{variant:"ghost",size:"icon",className:"mr-2",onClick:r,children:l.jsx(Zl,{className:"w-6 h-6"})}),l.jsx("h1",{className:"text-2xl font-semibold ml-4",children:e})]}),l.jsx("p",{className:"text-center text-muted-foreground mb-6",children:t})]}),Ny=({selectedDocumentType:e,onDocumentTypeChange:t,onContinue:r,onBack:n,renderProgress:s})=>{const o=[{id:"id-card",title:"ID Card",description:"Government-issued personal ID.",icon:Bp},{id:"drivers-license",title:"Drivers license",description:"Government-issued Drivers license",icon:Ip},{id:"passport",title:"Passport",description:"Your official travel document.",icon:Dp},{id:"voter-id",title:"Voter ID",description:"Government-issued Voter ID",icon:Up}];return l.jsx(st,{className:"w-full max-w-md mx-auto",children:l.jsxs(ot,{className:"p-6",children:[l.jsx(Nr,{title:"Upload ID",subTitle:"Choose the document type you would like to identify with",onBack:n}),l.jsx("div",{className:"space-y-3",children:o.map(a=>{const i=a.icon;return l.jsx("button",{className:`w-full p-4 rounded-lg border text-left transition-colors hover:bg-muted/50 ${e===a.id?"border-primary bg-primary/5":"border-border"}`,onClick:()=>t(a.id),children:l.jsxs("div",{className:"flex items-center space-x-4",children:[l.jsx("div",{className:"w-12 h-12 bg-primary rounded-full flex items-center justify-center",children:l.jsx(i,{className:"w-6 h-6 text-white"})}),l.jsxs("div",{className:"flex-1",children:[l.jsx("h3",{className:"font-semibold text-foreground",children:a.title}),l.jsx("p",{className:"text-sm text-muted-foreground",children:a.description})]})]})},a.id)})}),l.jsx(He,{className:"w-full mt-6",onClick:r,disabled:!e,children:"Continue"}),l.jsx("div",{className:"mt-6",children:s()})]})})},Nd=({onContinue:e,onBack:t})=>l.jsx(st,{className:"w-full max-w-md mx-auto",children:l.jsxs(ot,{className:"p-6",children:[l.jsx(Nr,{title:"Selfie",subTitle:"Make sure your face is clear and is fully inside the frame.",onBack:t}),l.jsx("div",{className:"m-auto w-44 h-80 bg-gradient-to-br from-primary/20 to-primary/40 rounded-3xl p-4 shadow-2xl",children:l.jsx("div",{className:"w-full h-full bg-background rounded-2xl overflow-hidden relative",children:l.jsx("div",{className:"flex items-center justify-center h-full bg-muted/30",children:l.jsxs("div",{className:"text-center",children:[l.jsx("div",{className:"w-16 h-16 bg-primary rounded-full flex items-center justify-center mx-auto mb-2"}),l.jsx("div",{className:"w-28 h-32 bg-primary/30 rounded-2xl mx-auto"})]})})})}),l.jsx("div",{className:"mt-8",children:l.jsx(He,{onClick:e,className:"w-full h-12 text-lg font-semibold",children:"Take a selfie"})})]})}),Ey=({fullName:e,onComplete:t,onStartOver:r})=>l.jsxs(st,{className:"w-full max-w-md mx-auto",children:[l.jsxs(kr,{className:"text-center",children:[l.jsx(Xl,{className:"w-12 h-12 mx-auto mb-4 text-green-500"}),l.jsx(Ya,{children:"Review Information"}),l.jsx("p",{className:"text-muted-foreground",children:"Please review your information before submitting"})]}),l.jsx(ot,{children:l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx(nn,{children:"Full Name"}),l.jsx("p",{className:"font-medium",children:e})]}),l.jsxs("div",{className:"grid grid-cols-3 gap-2 text-center",children:[l.jsxs("div",{children:[l.jsx(nn,{className:"text-xs",children:"Selfie"}),l.jsx("div",{className:"text-green-500",children:"✓"})]}),l.jsxs("div",{children:[l.jsx(nn,{className:"text-xs",children:"ID Front"}),l.jsx("div",{className:"text-green-500",children:"✓"})]}),l.jsxs("div",{children:[l.jsx(nn,{className:"text-xs",children:"ID Back"}),l.jsx("div",{className:"text-green-500",children:"✓"})]})]}),l.jsx(He,{className:"w-full text-md",onClick:t,children:"Complete Verification"}),l.jsx(He,{variant:"outline",className:"w-full text-md",onClick:r,children:"Start Over"})]})})]}),Ed=({onComplete:e})=>(S.useEffect(()=>{const t=setTimeout(()=>{e()},3e3);return()=>clearTimeout(t)},[e]),l.jsx(st,{className:"w-full max-w-md mx-auto min-h-[500px] flex items-center justify-center",children:l.jsxs(ot,{className:"text-center space-y-8",children:[l.jsx("div",{children:l.jsx("h2",{className:"text-2xl font-semibold text-foreground mb-2",children:"We're verifying your documents"})}),l.jsx("div",{className:"flex justify-center",children:l.jsx("div",{className:"w-16 h-16 border-4 border-primary border-t-transparent rounded-full animate-spin"})})]})})),Pd=({onDoneClick:e})=>l.jsx(st,{className:"w-full max-w-md mx-auto min-h-[500px] flex items-center justify-center",children:l.jsx(ot,{className:"text-center space-y-8",children:l.jsxs("div",{children:[l.jsx("h2",{className:"text-2xl font-semibold text-foreground mb-2",children:"Your documents have been submitted successfully"}),l.jsx("div",{className:"flex justify-center",children:l.jsx(Ql,{size:60,className:"text-primary"})}),l.jsx("p",{className:"text-foreground mt-2",children:"Our compliance team will review your information, and we'll notify you once verification is complete."}),l.jsx("p",{className:"text-foreground mt-2",children:"Thank you for your patience."}),l.jsx(He,{className:"text-md mt-8",onClick:e,children:"Explore App"})]})})}),Py={"id-front":"ID Front","id-back":"ID Back",selfie:"Selfie"},Dn=({currentStep:e,onRetake:t,onConfirm:r,onBack:n,title:s,description:o,frameType:a})=>{const[i,c]=S.useState(null),[d,u]=S.useState(null),h=S.useRef(null),v=S.useRef(null),f=!!i,{toast:b}=Gs();S.useEffect(()=>{h.current&&i&&(h.current.srcObject=i)},[i]);const p=S.useMemo(()=>d?URL.createObjectURL(d):null,[d]);S.useEffect(()=>()=>{p&&URL.revokeObjectURL(p)},[p]);const g=S.useCallback(async()=>{try{const T=await navigator.mediaDevices.getUserMedia({video:{facingMode:e==="selfie"?"user":"environment",width:{ideal:1280},height:{ideal:720}}});c(T)}catch{b({title:"Camera Error",description:"Unable to access camera. Please check permissions.",variant:"destructive"})}},[e,b]),x=S.useCallback(()=>{i&&(i.getTracks().forEach(T=>T.stop()),c(null))},[i]);S.useEffect(()=>(!d&&!i&&g(),()=>{x()}),[d,i,g,x]);const y=S.useCallback(()=>{if(!h.current||!v.current)return;const T=h.current,O=v.current,F=O.getContext("2d");F&&(O.width=T.videoWidth,O.height=T.videoHeight,F.drawImage(T,0,0),O.toBlob(W=>{if(!W)return;const G=new File([W],`${e}-${Date.now()}.jpg`,{type:"image/jpeg"});u(G),x(),b({title:"Photo Captured",description:"Photo captured successfully"})},"image/jpeg",.8))},[e,x,b]),w=()=>{u(null),n()},k=()=>{u(null),t()},E=()=>{d&&r(d),u(null)},M=()=>{const T=Py[e]||"Photo";return l.jsx(st,{className:"w-full max-w-md mx-auto",children:l.jsxs(ot,{className:"p-6",children:[l.jsx(Nr,{title:`Review ${T}`,subTitle:"Make sure the information is seen clearly, with no blur or glare.",onBack:w}),l.jsx("div",{className:"mb-8",children:l.jsx("div",{className:"relative",children:p&&l.jsx("img",{src:p,alt:"Captured photo",className:"w-full h-64 object-cover rounded-2xl bg-muted"})})}),l.jsxs("div",{className:"flex gap-4",children:[l.jsx(He,{variant:"outline",onClick:k,className:"flex-1 text-md",children:"Take again"}),l.jsx(He,{onClick:E,className:"flex-1 text-md",children:"Looks good"})]})]})})};return d?M():l.jsx(st,{className:"w-full max-w-md mx-auto border-gray-900 bg-gray-900",children:l.jsxs(ot,{className:"text-white flex flex-col",children:[l.jsxs("div",{className:"flex items-center p-6",children:[l.jsx(He,{variant:"ghost",size:"sm",onClick:w,className:"text-white hover:bg-gray-800",children:l.jsx(Zl,{className:"h-6 w-6"})}),l.jsx("h1",{className:"text-xl font-semibold ml-4",children:s})]}),l.jsx("div",{className:"px-6 mb-8",children:l.jsx("p",{className:"text-gray-300 text-center",children:o})}),l.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-6",children:[l.jsx("div",{className:"relative mb-16",children:f?l.jsxs(l.Fragment,{children:[l.jsx("video",{ref:h,autoPlay:!0,playsInline:!0,className:`bg-gray-800 object-cover ${a==="circular"?"w-80 h-80 rounded-full":"w-80 h-48 rounded-2xl"}`}),l.jsx("canvas",{ref:v,className:"hidden"})]}):l.jsx("div",{className:`bg-gray-700 flex items-center justify-center ${a==="circular"?"w-80 h-80 rounded-full":"w-80 h-48 rounded-2xl"}`,children:l.jsx("p",{className:"text-gray-400",children:"Camera loading..."})})}),l.jsx(He,{onClick:y,size:"lg",className:"w-16 h-16 rounded-full bg-white hover:bg-gray-100 border-4 border-gray-600 p-0",disabled:!f,children:l.jsx("div",{className:"w-8 h-8 rounded-full bg-white"})})]})]})})},Ty=({apiEndpoint:e,apiKey:t,onComplete:r,onDoneClick:n})=>{const[s,o]=S.useState("landing"),[a,i]=S.useState(""),[c,d]=S.useState(""),[u,h]=S.useState(null),[v,f]=S.useState(null),[b,p]=S.useState(null),{data:g}=Ay(e,t),x=_d({mutationFn:Oy}),{toast:y}=Gs(),w=S.useMemo(()=>[...g!=null&&g.hide_name_step?[]:["name"],...g!=null&&g.hide_document_selection_step?[]:["document-selection"],"selfie","pre-selfie","id-front","id-back","verify"],[g]),k=()=>g.hide_name_step?g.hide_document_selection_step?"id-front":"document-selection":"name",E=async()=>{if((g.hide_name_step||!!a)&&u&&v&&b){const F={full_name:a,selfie_photo:u,id_photo:v,id_photo_back:b},W=await x.mutateAsync({apiEndpoint:e,apiKey:t,data:F});r(W.data.token,F),y({title:"KYC Complete",description:"Identity verification completed successfully"}),i(""),h(null),f(null),p(null),o("done")}},M=()=>l.jsx(l.Fragment,{children:s!=="landing"&&l.jsx("div",{className:"flex justify-center",children:l.jsx("div",{className:"flex space-x-2",children:w.map((O,F)=>l.jsx("div",{className:`w-3 h-3 rounded-full ${w.indexOf(s)>=F?"bg-primary":"bg-muted"}`},O))})})}),T=()=>{switch(console.log("currentStep",s),s){case"landing":return l.jsx(Cd,{onContinue:()=>o(k())});case"name":return l.jsx(ky,{fullName:a,onNameChange:i,onContinue:()=>o(g.hide_document_selection_step?"id-front":"document-selection"),renderProgress:M});case"document-selection":return l.jsx(Ny,{selectedDocumentType:c,onDocumentTypeChange:d,onContinue:()=>o("id-front"),onBack:()=>o(g.hide_name_step?"landing":"name"),renderProgress:M});case"id-front":return l.jsx(Dn,{title:"Upload ID",description:"Place your ID inside the frame and take a picture. Make sure it is not cut or has any glare.",frameType:"rectangular",currentStep:s,onRetake:()=>{f(null)},onConfirm:O=>{f(O),o("id-back")},onBack:()=>{f(null),o(g.hide_document_selection_step?g.hide_name_step?"landing":"name":"document-selection")}});case"id-back":return l.jsx(Dn,{title:"Upload ID Back",description:"Place the back of your ID inside the frame and take a picture. Make sure it is not cut or has any glare.",frameType:"rectangular",currentStep:s,onRetake:()=>{p(null)},onConfirm:O=>{p(O),o("pre-selfie")},onBack:()=>{p(null),o("id-front")}});case"pre-selfie":return l.jsx(Nd,{onContinue:()=>o("selfie"),onBack:()=>o("id-back")});case"selfie":return l.jsx(Dn,{title:"Selfie",description:"Place your face inside the frame and take a picture. Make sure it is clearly visible.",frameType:"circular",currentStep:s,onRetake:()=>{h(null)},onConfirm:O=>{h(O),o("verify")},onBack:()=>{h(null),o("id-back")}});case"verify":return l.jsx(Ey,{fullName:a,onComplete:()=>o("processing"),onStartOver:()=>o("landing")});case"processing":return l.jsx(Ed,{onComplete:E});case"done":return l.jsx(Pd,{onDoneClick:n});default:return null}};return l.jsx("div",{className:"w-[430px]",children:T()})};async function Oy({apiEndpoint:e,apiKey:t,data:r}){const n=new FormData;n.append("full_name",r.full_name),n.append("selfie_photo",r.selfie_photo,r.selfie_photo.name),n.append("id_photo",r.id_photo,r.id_photo.name),n.append("id_photo_back",r.id_photo_back,r.id_photo_back.name);const s=await fetch(`${e}/api/kyc`,{method:"POST",headers:{"X-API-Key":t},body:n});if(!s.ok)throw new Error("Network response was not ok");return s.json()}const My=async(e,t)=>{const r=await fetch(`${e}/api/settings`,{method:"GET",headers:{"X-API-Key":t,"Content-Type":"application/json"}});if(!r.ok)throw new Error("Network response was not ok");return(await r.json()).data},Ay=(e,t)=>wy({queryKey:["settings",e,t],queryFn:()=>My(e,t),enabled:!!e&&!!t});var bs=e=>e.type==="checkbox",sn=e=>e instanceof Date,at=e=>e==null;const Td=e=>typeof e=="object";var ze=e=>!at(e)&&!Array.isArray(e)&&Td(e)&&!sn(e),Od=e=>ze(e)&&e.target?bs(e.target)?e.target.checked:e.target.value:e,Dy=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Md=(e,t)=>e.has(Dy(t)),Iy=e=>{const t=e.constructor&&e.constructor.prototype;return ze(t)&&t.hasOwnProperty("isPrototypeOf")},qa=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Qe(e){let t;const r=Array.isArray(e),n=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(qa&&(e instanceof Blob||n))&&(r||ze(e)))if(t=r?[]:{},!r&&!Iy(e))t=e;else for(const s in e)e.hasOwnProperty(s)&&(t[s]=Qe(e[s]));else return e;return t}var Co=e=>/^\w*$/.test(e),Ye=e=>e===void 0,Za=e=>Array.isArray(e)?e.filter(Boolean):[],Ka=e=>Za(e.replace(/["|']|\]/g,"").split(/\.|\[/)),z=(e,t,r)=>{if(!t||!ze(e))return r;const n=(Co(t)?[t]:Ka(t)).reduce((s,o)=>at(s)?s:s[o],e);return Ye(n)||n===e?Ye(e[t])?r:e[t]:n},xt=e=>typeof e=="boolean",Ee=(e,t,r)=>{let n=-1;const s=Co(t)?[t]:Ka(t),o=s.length,a=o-1;for(;++n<o;){const i=s[n];let c=r;if(n!==a){const d=e[i];c=ze(d)||Array.isArray(d)?d:isNaN(+s[n+1])?{}:[]}if(i==="__proto__"||i==="constructor"||i==="prototype")return;e[i]=c,e=e[i]}};const So={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Mt={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},ar={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Qa=S.createContext(null);Qa.displayName="HookFormContext";const ko=()=>S.useContext(Qa),Fy=e=>{const{children:t,...r}=e;return S.createElement(Qa.Provider,{value:r},t)};var Ad=(e,t,r,n=!0)=>{const s={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(s,o,{get:()=>{const a=o;return t._proxyFormState[a]!==Mt.all&&(t._proxyFormState[a]=!n||Mt.all),r&&(r[a]=!0),e[a]}});return s};const Ga=typeof window<"u"?S.useLayoutEffect:S.useEffect;function Ly(e){const t=ko(),{control:r=t.control,disabled:n,name:s,exact:o}=e||{},[a,i]=S.useState(r._formState),c=S.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Ga(()=>r._subscribe({name:s,formState:c.current,exact:o,callback:d=>{!n&&i({...r._formState,...d})}}),[s,n,o]),S.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),S.useMemo(()=>Ad(a,r,c.current,!1),[a,r])}var Yt=e=>typeof e=="string",Dd=(e,t,r,n,s)=>Yt(e)?(n&&t.watch.add(e),z(r,e,s)):Array.isArray(e)?e.map(o=>(n&&t.watch.add(o),z(r,o))):(n&&(t.watchAll=!0),r),Xa=e=>at(e)||!Td(e);function ir(e,t,r=new WeakSet){if(Xa(e)||Xa(t))return e===t;if(sn(e)&&sn(t))return e.getTime()===t.getTime();const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const o of n){const a=e[o];if(!s.includes(o))return!1;if(o!=="ref"){const i=t[o];if(sn(a)&&sn(i)||ze(a)&&ze(i)||Array.isArray(a)&&Array.isArray(i)?!ir(a,i,r):a!==i)return!1}}return!0}function Vy(e){const t=ko(),{control:r=t.control,name:n,defaultValue:s,disabled:o,exact:a,compute:i}=e||{},c=S.useRef(s),d=S.useRef(i),u=S.useRef(void 0);d.current=i;const h=S.useMemo(()=>r._getWatch(n,c.current),[r,n]),[v,f]=S.useState(d.current?d.current(h):h);return Ga(()=>r._subscribe({name:n,formState:{values:!0},exact:a,callback:b=>{if(!o){const p=Dd(n,r._names,b.values||r._formValues,!1,c.current);if(d.current){const g=d.current(p);ir(g,u.current)||(f(g),u.current=g)}else f(p)}}}),[r,o,n,a]),S.useEffect(()=>r._removeUnmounted()),v}function $y(e){const t=ko(),{name:r,disabled:n,control:s=t.control,shouldUnregister:o,defaultValue:a}=e,i=Md(s._names.array,r),c=S.useMemo(()=>z(s._formValues,r,z(s._defaultValues,r,a)),[s,r,a]),d=Vy({control:s,name:r,defaultValue:c,exact:!0}),u=Ly({control:s,name:r,exact:!0}),h=S.useRef(e),v=S.useRef(s.register(r,{...e.rules,value:d,...xt(e.disabled)?{disabled:e.disabled}:{}}));h.current=e;const f=S.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!z(u.errors,r)},isDirty:{enumerable:!0,get:()=>!!z(u.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!z(u.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!z(u.validatingFields,r)},error:{enumerable:!0,get:()=>z(u.errors,r)}}),[u,r]),b=S.useCallback(y=>v.current.onChange({target:{value:Od(y),name:r},type:So.CHANGE}),[r]),p=S.useCallback(()=>v.current.onBlur({target:{value:z(s._formValues,r),name:r},type:So.BLUR}),[r,s._formValues]),g=S.useCallback(y=>{const w=z(s._fields,r);w&&y&&(w._f.ref={focus:()=>y.focus&&y.focus(),select:()=>y.select&&y.select(),setCustomValidity:k=>y.setCustomValidity(k),reportValidity:()=>y.reportValidity()})},[s._fields,r]),x=S.useMemo(()=>({name:r,value:d,...xt(n)||u.disabled?{disabled:u.disabled||n}:{},onChange:b,onBlur:p,ref:g}),[r,n,u.disabled,b,p,g,d]);return S.useEffect(()=>{const y=s._options.shouldUnregister||o;s.register(r,{...h.current.rules,...xt(h.current.disabled)?{disabled:h.current.disabled}:{}});const w=(k,E)=>{const M=z(s._fields,k);M&&M._f&&(M._f.mount=E)};if(w(r,!0),y){const k=Qe(z(s._options.defaultValues,r));Ee(s._defaultValues,r,k),Ye(z(s._formValues,r))&&Ee(s._formValues,r,k)}return!i&&s.register(r),()=>{(i?y&&!s._state.action:y)?s.unregister(r):w(r,!1)}},[r,s,i,o]),S.useEffect(()=>{s._setDisabledField({disabled:n,name:r})},[n,r,s]),S.useMemo(()=>({field:x,formState:u,fieldState:f}),[x,u,f])}const By=e=>e.render($y(e));var Id=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},ws=e=>Array.isArray(e)?e:[e],Fd=()=>{let e=[];return{get observers(){return e},next:s=>{for(const o of e)o.next&&o.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(o=>o!==s)}}),unsubscribe:()=>{e=[]}}},ht=e=>ze(e)&&!Object.keys(e).length,Ja=e=>e.type==="file",At=e=>typeof e=="function",No=e=>{if(!qa)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Ld=e=>e.type==="select-multiple",Ra=e=>e.type==="radio",Wy=e=>Ra(e)||bs(e),ei=e=>No(e)&&e.isConnected;function jy(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=Ye(e)?n++:e[t[n++]];return e}function Uy(e){for(const t in e)if(e.hasOwnProperty(t)&&!Ye(e[t]))return!1;return!0}function Ze(e,t){const r=Array.isArray(t)?t:Co(t)?[t]:Ka(t),n=r.length===1?e:jy(e,r),s=r.length-1,o=r[s];return n&&delete n[o],s!==0&&(ze(n)&&ht(n)||Array.isArray(n)&&Uy(n))&&Ze(e,r.slice(0,-1)),e}var Vd=e=>{for(const t in e)if(At(e[t]))return!0;return!1};function Eo(e,t={}){const r=Array.isArray(e);if(ze(e)||r)for(const n in e)Array.isArray(e[n])||ze(e[n])&&!Vd(e[n])?(t[n]=Array.isArray(e[n])?[]:{},Eo(e[n],t[n])):at(e[n])||(t[n]=!0);return t}function $d(e,t,r){const n=Array.isArray(e);if(ze(e)||n)for(const s in e)Array.isArray(e[s])||ze(e[s])&&!Vd(e[s])?Ye(t)||Xa(r[s])?r[s]=Array.isArray(e[s])?Eo(e[s],[]):{...Eo(e[s])}:$d(e[s],at(t)?{}:t[s],r[s]):r[s]=!ir(e[s],t[s]);return r}var xs=(e,t)=>$d(e,t,Eo(t));const Bd={value:!1,isValid:!1},Wd={value:!0,isValid:!0};var jd=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Ye(e[0].attributes.value)?Ye(e[0].value)||e[0].value===""?Wd:{value:e[0].value,isValid:!0}:Wd:Bd}return Bd},Ud=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Ye(e)?e:t?e===""?NaN:e&&+e:r&&Yt(e)?new Date(e):n?n(e):e;const Hd={isValid:!1,value:null};var zd=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,Hd):Hd;function Yd(e){const t=e.ref;return Ja(t)?t.files:Ra(t)?zd(e.refs).value:Ld(t)?[...t.selectedOptions].map(({value:r})=>r):bs(t)?jd(e.refs).value:Ud(Ye(t.value)?e.ref.value:t.value,e)}var Hy=(e,t,r,n)=>{const s={};for(const o of e){const a=z(t,o);a&&Ee(s,o,a._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}},Po=e=>e instanceof RegExp,_s=e=>Ye(e)?e:Po(e)?e.source:ze(e)?Po(e.value)?e.value.source:e.value:e,qd=e=>({isOnSubmit:!e||e===Mt.onSubmit,isOnBlur:e===Mt.onBlur,isOnChange:e===Mt.onChange,isOnAll:e===Mt.all,isOnTouch:e===Mt.onTouched});const Zd="AsyncFunction";var zy=e=>!!e&&!!e.validate&&!!(At(e.validate)&&e.validate.constructor.name===Zd||ze(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===Zd)),Yy=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Kd=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const Cs=(e,t,r,n)=>{for(const s of r||Object.keys(e)){const o=z(e,s);if(o){const{_f:a,...i}=o;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],s)&&!n)return!0;if(a.ref&&t(a.ref,a.name)&&!n)return!0;if(Cs(i,t))break}else if(ze(i)&&Cs(i,t))break}}};function Qd(e,t,r){const n=z(e,r);if(n||Co(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const o=s.join("."),a=z(t,o),i=z(e,o);if(a&&!Array.isArray(a)&&r!==o)return{name:r};if(i&&i.type)return{name:o,error:i};if(i&&i.root&&i.root.type)return{name:`${o}.root`,error:i.root};s.pop()}return{name:r}}var qy=(e,t,r,n)=>{r(e);const{name:s,...o}=e;return ht(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(a=>t[a]===(!n||Mt.all))},Zy=(e,t,r)=>!e||!t||e===t||ws(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),Ky=(e,t,r,n,s)=>s.isOnAll?!1:!r&&s.isOnTouch?!(t||e):(r?n.isOnBlur:s.isOnBlur)?!e:(r?n.isOnChange:s.isOnChange)?e:!0,Qy=(e,t)=>!Za(z(e,t)).length&&Ze(e,t),Gy=(e,t,r)=>{const n=ws(z(e,r));return Ee(n,"root",t[r]),Ee(e,r,n),e},To=e=>Yt(e);function Gd(e,t,r="validate"){if(To(e)||Array.isArray(e)&&e.every(To)||xt(e)&&!e)return{type:r,message:To(e)?e:"",ref:t}}var In=e=>ze(e)&&!Po(e)?e:{value:e,message:""},Xd=async(e,t,r,n,s,o)=>{const{ref:a,refs:i,required:c,maxLength:d,minLength:u,min:h,max:v,pattern:f,validate:b,name:p,valueAsNumber:g,mount:x}=e._f,y=z(r,p);if(!x||t.has(p))return{};const w=i?i[0]:a,k=D=>{s&&w.reportValidity&&(w.setCustomValidity(xt(D)?"":D||""),w.reportValidity())},E={},M=Ra(a),T=bs(a),O=M||T,F=(g||Ja(a))&&Ye(a.value)&&Ye(y)||No(a)&&a.value===""||y===""||Array.isArray(y)&&!y.length,W=Id.bind(null,p,n,E),G=(D,U,L,J=ar.maxLength,Y=ar.minLength)=>{const I=D?U:L;E[p]={type:D?J:Y,message:I,ref:a,...W(D?J:Y,I)}};if(o?!Array.isArray(y)||!y.length:c&&(!O&&(F||at(y))||xt(y)&&!y||T&&!jd(i).isValid||M&&!zd(i).isValid)){const{value:D,message:U}=To(c)?{value:!!c,message:c}:In(c);if(D&&(E[p]={type:ar.required,message:U,ref:w,...W(ar.required,U)},!n))return k(U),E}if(!F&&(!at(h)||!at(v))){let D,U;const L=In(v),J=In(h);if(!at(y)&&!isNaN(y)){const Y=a.valueAsNumber||y&&+y;at(L.value)||(D=Y>L.value),at(J.value)||(U=Y<J.value)}else{const Y=a.valueAsDate||new Date(y),I=ae=>new Date(new Date().toDateString()+" "+ae),A=a.type=="time",B=a.type=="week";Yt(L.value)&&y&&(D=A?I(y)>I(L.value):B?y>L.value:Y>new Date(L.value)),Yt(J.value)&&y&&(U=A?I(y)<I(J.value):B?y<J.value:Y<new Date(J.value))}if((D||U)&&(G(!!D,L.message,J.message,ar.max,ar.min),!n))return k(E[p].message),E}if((d||u)&&!F&&(Yt(y)||o&&Array.isArray(y))){const D=In(d),U=In(u),L=!at(D.value)&&y.length>+D.value,J=!at(U.value)&&y.length<+U.value;if((L||J)&&(G(L,D.message,U.message),!n))return k(E[p].message),E}if(f&&!F&&Yt(y)){const{value:D,message:U}=In(f);if(Po(D)&&!y.match(D)&&(E[p]={type:ar.pattern,message:U,ref:a,...W(ar.pattern,U)},!n))return k(U),E}if(b){if(At(b)){const D=await b(y,r),U=Gd(D,w);if(U&&(E[p]={...U,...W(ar.validate,U.message)},!n))return k(U.message),E}else if(ze(b)){let D={};for(const U in b){if(!ht(D)&&!n)break;const L=Gd(await b[U](y,r),w,U);L&&(D={...L,...W(U,L.message)},k(L.message),n&&(E[p]=D))}if(!ht(D)&&(E[p]={ref:w,...D},!n))return E}}return k(!0),E};const Xy={mode:Mt.onSubmit,reValidateMode:Mt.onChange,shouldFocusError:!0};function Jy(e={}){let t={...Xy,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:At(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},s=ze(t.defaultValues)||ze(t.values)?Qe(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:Qe(s),a={action:!1,mount:!1,watch:!1},i={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,d=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let h={...u};const v={array:Fd(),state:Fd()},f=t.criteriaMode===Mt.all,b=C=>N=>{clearTimeout(d),d=setTimeout(C,N)},p=async C=>{if(!t.disabled&&(u.isValid||h.isValid||C)){const N=t.resolver?ht((await T()).errors):await F(n,!0);N!==r.isValid&&v.state.next({isValid:N})}},g=(C,N)=>{!t.disabled&&(u.isValidating||u.validatingFields||h.isValidating||h.validatingFields)&&((C||Array.from(i.mount)).forEach(P=>{P&&(N?Ee(r.validatingFields,P,N):Ze(r.validatingFields,P))}),v.state.next({validatingFields:r.validatingFields,isValidating:!ht(r.validatingFields)}))},x=(C,N=[],P,H,j=!0,$=!0)=>{if(H&&P&&!t.disabled){if(a.action=!0,$&&Array.isArray(z(n,C))){const Q=P(z(n,C),H.argA,H.argB);j&&Ee(n,C,Q)}if($&&Array.isArray(z(r.errors,C))){const Q=P(z(r.errors,C),H.argA,H.argB);j&&Ee(r.errors,C,Q),Qy(r.errors,C)}if((u.touchedFields||h.touchedFields)&&$&&Array.isArray(z(r.touchedFields,C))){const Q=P(z(r.touchedFields,C),H.argA,H.argB);j&&Ee(r.touchedFields,C,Q)}(u.dirtyFields||h.dirtyFields)&&(r.dirtyFields=xs(s,o)),v.state.next({name:C,isDirty:G(C,N),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Ee(o,C,N)},y=(C,N)=>{Ee(r.errors,C,N),v.state.next({errors:r.errors})},w=C=>{r.errors=C,v.state.next({errors:r.errors,isValid:!1})},k=(C,N,P,H)=>{const j=z(n,C);if(j){const $=z(o,C,Ye(P)?z(s,C):P);Ye($)||H&&H.defaultChecked||N?Ee(o,C,N?$:Yd(j._f)):L(C,$),a.mount&&p()}},E=(C,N,P,H,j)=>{let $=!1,Q=!1;const ve={name:C};if(!t.disabled){if(!P||H){(u.isDirty||h.isDirty)&&(Q=r.isDirty,r.isDirty=ve.isDirty=G(),$=Q!==ve.isDirty);const Te=ir(z(s,C),N);Q=!!z(r.dirtyFields,C),Te?Ze(r.dirtyFields,C):Ee(r.dirtyFields,C,!0),ve.dirtyFields=r.dirtyFields,$=$||(u.dirtyFields||h.dirtyFields)&&Q!==!Te}if(P){const Te=z(r.touchedFields,C);Te||(Ee(r.touchedFields,C,P),ve.touchedFields=r.touchedFields,$=$||(u.touchedFields||h.touchedFields)&&Te!==P)}$&&j&&v.state.next(ve)}return $?ve:{}},M=(C,N,P,H)=>{const j=z(r.errors,C),$=(u.isValid||h.isValid)&&xt(N)&&r.isValid!==N;if(t.delayError&&P?(c=b(()=>y(C,P)),c(t.delayError)):(clearTimeout(d),c=null,P?Ee(r.errors,C,P):Ze(r.errors,C)),(P?!ir(j,P):j)||!ht(H)||$){const Q={...H,...$&&xt(N)?{isValid:N}:{},errors:r.errors,name:C};r={...r,...Q},v.state.next(Q)}},T=async C=>{g(C,!0);const N=await t.resolver(o,t.context,Hy(C||i.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return g(C),N},O=async C=>{const{errors:N}=await T(C);if(C)for(const P of C){const H=z(N,P);H?Ee(r.errors,P,H):Ze(r.errors,P)}else r.errors=N;return N},F=async(C,N,P={valid:!0})=>{for(const H in C){const j=C[H];if(j){const{_f:$,...Q}=j;if($){const ve=i.array.has($.name),Te=j._f&&zy(j._f);Te&&u.validatingFields&&g([H],!0);const yt=await Xd(j,i.disabled,o,f,t.shouldUseNativeValidation&&!N,ve);if(Te&&u.validatingFields&&g([H]),yt[$.name]&&(P.valid=!1,N))break;!N&&(z(yt,$.name)?ve?Gy(r.errors,yt,$.name):Ee(r.errors,$.name,yt[$.name]):Ze(r.errors,$.name))}!ht(Q)&&await F(Q,N,P)}}return P.valid},W=()=>{for(const C of i.unMount){const N=z(n,C);N&&(N._f.refs?N._f.refs.every(P=>!ei(P)):!ei(N._f.ref))&&q(C)}i.unMount=new Set},G=(C,N)=>!t.disabled&&(C&&N&&Ee(o,C,N),!ir(ae(),s)),D=(C,N,P)=>Dd(C,i,{...a.mount?o:Ye(N)?s:Yt(C)?{[C]:N}:N},P,N),U=C=>Za(z(a.mount?o:s,C,t.shouldUnregister?z(s,C,[]):[])),L=(C,N,P={})=>{const H=z(n,C);let j=N;if(H){const $=H._f;$&&(!$.disabled&&Ee(o,C,Ud(N,$)),j=No($.ref)&&at(N)?"":N,Ld($.ref)?[...$.ref.options].forEach(Q=>Q.selected=j.includes(Q.value)):$.refs?bs($.ref)?$.refs.forEach(Q=>{(!Q.defaultChecked||!Q.disabled)&&(Array.isArray(j)?Q.checked=!!j.find(ve=>ve===Q.value):Q.checked=j===Q.value||!!j)}):$.refs.forEach(Q=>Q.checked=Q.value===j):Ja($.ref)?$.ref.value="":($.ref.value=j,$.ref.type||v.state.next({name:C,values:Qe(o)})))}(P.shouldDirty||P.shouldTouch)&&E(C,j,P.shouldTouch,P.shouldDirty,!0),P.shouldValidate&&B(C)},J=(C,N,P)=>{for(const H in N){if(!N.hasOwnProperty(H))return;const j=N[H],$=C+"."+H,Q=z(n,$);(i.array.has(C)||ze(j)||Q&&!Q._f)&&!sn(j)?J($,j,P):L($,j,P)}},Y=(C,N,P={})=>{const H=z(n,C),j=i.array.has(C),$=Qe(N);Ee(o,C,$),j?(v.array.next({name:C,values:Qe(o)}),(u.isDirty||u.dirtyFields||h.isDirty||h.dirtyFields)&&P.shouldDirty&&v.state.next({name:C,dirtyFields:xs(s,o),isDirty:G(C,$)})):H&&!H._f&&!at($)?J(C,$,P):L(C,$,P),Kd(C,i)&&v.state.next({...r,name:C}),v.state.next({name:a.mount?C:void 0,values:Qe(o)})},I=async C=>{a.mount=!0;const N=C.target;let P=N.name,H=!0;const j=z(n,P),$=Te=>{H=Number.isNaN(Te)||sn(Te)&&isNaN(Te.getTime())||ir(Te,z(o,P,Te))},Q=qd(t.mode),ve=qd(t.reValidateMode);if(j){let Te,yt;const gr=N.type?Yd(j._f):Od(C),tr=C.type===So.BLUR||C.type===So.FOCUS_OUT,Jo=!Yy(j._f)&&!t.resolver&&!z(r.errors,P)&&!j._f.deps||Ky(tr,z(r.touchedFields,P),r.isSubmitted,ve,Q),xn=Kd(P,i,tr);Ee(o,P,gr),tr?(j._f.onBlur&&j._f.onBlur(C),c&&c(0)):j._f.onChange&&j._f.onChange(C);const rr=E(P,gr,tr),Ro=!ht(rr)||xn;if(!tr&&v.state.next({name:P,type:C.type,values:Qe(o)}),Jo)return(u.isValid||h.isValid)&&(t.mode==="onBlur"?tr&&p():tr||p()),Ro&&v.state.next({name:P,...xn?{}:rr});if(!tr&&xn&&v.state.next({...r}),t.resolver){const{errors:yr}=await T([P]);if($(gr),H){const Ji=Qd(r.errors,n,P),ea=Qd(yr,n,Ji.name||P);Te=ea.error,P=ea.name,yt=ht(yr)}}else g([P],!0),Te=(await Xd(j,i.disabled,o,f,t.shouldUseNativeValidation))[P],g([P]),$(gr),H&&(Te?yt=!1:(u.isValid||h.isValid)&&(yt=await F(n,!0)));H&&(j._f.deps&&B(j._f.deps),M(P,yt,Te,rr))}},A=(C,N)=>{if(z(r.errors,N)&&C.focus)return C.focus(),1},B=async(C,N={})=>{let P,H;const j=ws(C);if(t.resolver){const $=await O(Ye(C)?C:j);P=ht($),H=C?!j.some(Q=>z($,Q)):P}else C?(H=(await Promise.all(j.map(async $=>{const Q=z(n,$);return await F(Q&&Q._f?{[$]:Q}:Q)}))).every(Boolean),!(!H&&!r.isValid)&&p()):H=P=await F(n);return v.state.next({...!Yt(C)||(u.isValid||h.isValid)&&P!==r.isValid?{}:{name:C},...t.resolver||!C?{isValid:P}:{},errors:r.errors}),N.shouldFocus&&!H&&Cs(n,A,C?j:i.mount),H},ae=C=>{const N={...a.mount?o:s};return Ye(C)?N:Yt(C)?z(N,C):C.map(P=>z(N,P))},Se=(C,N)=>({invalid:!!z((N||r).errors,C),isDirty:!!z((N||r).dirtyFields,C),error:z((N||r).errors,C),isValidating:!!z(r.validatingFields,C),isTouched:!!z((N||r).touchedFields,C)}),de=C=>{C&&ws(C).forEach(N=>Ze(r.errors,N)),v.state.next({errors:C?r.errors:{}})},ue=(C,N,P)=>{const H=(z(n,C,{_f:{}})._f||{}).ref,j=z(r.errors,C)||{},{ref:$,message:Q,type:ve,...Te}=j;Ee(r.errors,C,{...Te,...N,ref:H}),v.state.next({name:C,errors:r.errors,isValid:!1}),P&&P.shouldFocus&&H&&H.focus&&H.focus()},pe=(C,N)=>At(C)?v.state.subscribe({next:P=>"values"in P&&C(D(void 0,N),P)}):D(C,N,!0),Fe=C=>v.state.subscribe({next:N=>{Zy(C.name,N.name,C.exact)&&qy(N,C.formState||u,mr,C.reRenderRoot)&&C.callback({values:{...o},...r,...N,defaultValues:s})}}).unsubscribe,rt=C=>(a.mount=!0,h={...h,...C.formState},Fe({...C,formState:h})),q=(C,N={})=>{for(const P of C?ws(C):i.mount)i.mount.delete(P),i.array.delete(P),N.keepValue||(Ze(n,P),Ze(o,P)),!N.keepError&&Ze(r.errors,P),!N.keepDirty&&Ze(r.dirtyFields,P),!N.keepTouched&&Ze(r.touchedFields,P),!N.keepIsValidating&&Ze(r.validatingFields,P),!t.shouldUnregister&&!N.keepDefaultValue&&Ze(s,P);v.state.next({values:Qe(o)}),v.state.next({...r,...N.keepDirty?{isDirty:G()}:{}}),!N.keepIsValid&&p()},ke=({disabled:C,name:N})=>{(xt(C)&&a.mount||C||i.disabled.has(N))&&(C?i.disabled.add(N):i.disabled.delete(N))},Ae=(C,N={})=>{let P=z(n,C);const H=xt(N.disabled)||xt(t.disabled);return Ee(n,C,{...P||{},_f:{...P&&P._f?P._f:{ref:{name:C}},name:C,mount:!0,...N}}),i.mount.add(C),P?ke({disabled:xt(N.disabled)?N.disabled:t.disabled,name:C}):k(C,!0,N.value),{...H?{disabled:N.disabled||t.disabled}:{},...t.progressive?{required:!!N.required,min:_s(N.min),max:_s(N.max),minLength:_s(N.minLength),maxLength:_s(N.maxLength),pattern:_s(N.pattern)}:{},name:C,onChange:I,onBlur:I,ref:j=>{if(j){Ae(C,N),P=z(n,C);const $=Ye(j.value)&&j.querySelectorAll&&j.querySelectorAll("input,select,textarea")[0]||j,Q=Wy($),ve=P._f.refs||[];if(Q?ve.find(Te=>Te===$):$===P._f.ref)return;Ee(n,C,{_f:{...P._f,...Q?{refs:[...ve.filter(ei),$,...Array.isArray(z(s,C))?[{}]:[]],ref:{type:$.type,name:C}}:{ref:$}}}),k(C,!1,void 0,$)}else P=z(n,C,{}),P._f&&(P._f.mount=!1),(t.shouldUnregister||N.shouldUnregister)&&!(Md(i.array,C)&&a.action)&&i.unMount.add(C)}}},ye=()=>t.shouldFocusError&&Cs(n,A,i.mount),me=C=>{xt(C)&&(v.state.next({disabled:C}),Cs(n,(N,P)=>{const H=z(n,P);H&&(N.disabled=H._f.disabled||C,Array.isArray(H._f.refs)&&H._f.refs.forEach(j=>{j.disabled=H._f.disabled||C}))},0,!1))},be=(C,N)=>async P=>{let H;P&&(P.preventDefault&&P.preventDefault(),P.persist&&P.persist());let j=Qe(o);if(v.state.next({isSubmitting:!0}),t.resolver){const{errors:$,values:Q}=await T();r.errors=$,j=Qe(Q)}else await F(n);if(i.disabled.size)for(const $ of i.disabled)Ze(j,$);if(Ze(r.errors,"root"),ht(r.errors)){v.state.next({errors:{}});try{await C(j,P)}catch($){H=$}}else N&&await N({...r.errors},P),ye(),setTimeout(ye);if(v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ht(r.errors)&&!H,submitCount:r.submitCount+1,errors:r.errors}),H)throw H},Re=(C,N={})=>{z(n,C)&&(Ye(N.defaultValue)?Y(C,Qe(z(s,C))):(Y(C,N.defaultValue),Ee(s,C,Qe(N.defaultValue))),N.keepTouched||Ze(r.touchedFields,C),N.keepDirty||(Ze(r.dirtyFields,C),r.isDirty=N.defaultValue?G(C,Qe(z(s,C))):G()),N.keepError||(Ze(r.errors,C),u.isValid&&p()),v.state.next({...r}))},dt=(C,N={})=>{const P=C?Qe(C):s,H=Qe(P),j=ht(C),$=j?s:H;if(N.keepDefaultValues||(s=P),!N.keepValues){if(N.keepDirtyValues){const Q=new Set([...i.mount,...Object.keys(xs(s,o))]);for(const ve of Array.from(Q))z(r.dirtyFields,ve)?Ee($,ve,z(o,ve)):Y(ve,z($,ve))}else{if(qa&&Ye(C))for(const Q of i.mount){const ve=z(n,Q);if(ve&&ve._f){const Te=Array.isArray(ve._f.refs)?ve._f.refs[0]:ve._f.ref;if(No(Te)){const yt=Te.closest("form");if(yt){yt.reset();break}}}}if(N.keepFieldsRef)for(const Q of i.mount)Y(Q,z($,Q));else n={}}o=t.shouldUnregister?N.keepDefaultValues?Qe(s):{}:Qe($),v.array.next({values:{...$}}),v.state.next({values:{...$}})}i={mount:N.keepDirtyValues?i.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!u.isValid||!!N.keepIsValid||!!N.keepDirtyValues,a.watch=!!t.shouldUnregister,v.state.next({submitCount:N.keepSubmitCount?r.submitCount:0,isDirty:j?!1:N.keepDirty?r.isDirty:!!(N.keepDefaultValues&&!ir(C,s)),isSubmitted:N.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:j?{}:N.keepDirtyValues?N.keepDefaultValues&&o?xs(s,o):r.dirtyFields:N.keepDefaultValues&&C?xs(s,C):N.keepDirty?r.dirtyFields:{},touchedFields:N.keepTouched?r.touchedFields:{},errors:N.keepErrors?r.errors:{},isSubmitSuccessful:N.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},Rt=(C,N)=>dt(At(C)?C(o):C,N),er=(C,N={})=>{const P=z(n,C),H=P&&P._f;if(H){const j=H.refs?H.refs[0]:H.ref;j.focus&&(j.focus(),N.shouldSelect&&At(j.select)&&j.select())}},mr=C=>{r={...r,...C}},vr={control:{register:Ae,unregister:q,getFieldState:Se,handleSubmit:be,setError:ue,_subscribe:Fe,_runSchema:T,_focusError:ye,_getWatch:D,_getDirty:G,_setValid:p,_setFieldArray:x,_setDisabledField:ke,_setErrors:w,_getFieldArray:U,_reset:dt,_resetDefaultValues:()=>At(t.defaultValues)&&t.defaultValues().then(C=>{Rt(C,t.resetOptions),v.state.next({isLoading:!1})}),_removeUnmounted:W,_disableForm:me,_subjects:v,_proxyFormState:u,get _fields(){return n},get _formValues(){return o},get _state(){return a},set _state(C){a=C},get _defaultValues(){return s},get _names(){return i},set _names(C){i=C},get _formState(){return r},get _options(){return t},set _options(C){t={...t,...C}}},subscribe:rt,trigger:B,register:Ae,handleSubmit:be,watch:pe,setValue:Y,getValues:ae,reset:Rt,resetField:Re,clearErrors:de,unregister:q,setError:ue,setFocus:er,getFieldState:Se};return{...vr,formControl:vr}}function Ss(e={}){const t=S.useRef(void 0),r=S.useRef(void 0),[n,s]=S.useState({isDirty:!1,isValidating:!1,isLoading:At(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:At(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!At(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:a,...i}=Jy(e);t.current={...i,formState:n}}const o=t.current.control;return o._options=e,Ga(()=>{const a=o._subscribe({formState:o._proxyFormState,callback:()=>s({...o._formState}),reRenderRoot:!0});return s(i=>({...i,isReady:!0})),o._formState.isReady=!0,a},[o]),S.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),S.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),S.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),S.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),S.useEffect(()=>{if(o._proxyFormState.isDirty){const a=o._getDirty();a!==n.isDirty&&o._subjects.state.next({isDirty:a})}},[o,n.isDirty]),S.useEffect(()=>{e.values&&!ir(e.values,r.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),r.current=e.values,s(a=>({...a}))):o._resetDefaultValues()},[o,e.values]),S.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),t.current.formState=Ad(n,o),t.current}const Jd=(e,t,r)=>{if(e&&"reportValidity"in e){const n=z(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},Rd=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?Jd(n.ref,r,e):n.refs&&n.refs.forEach(s=>Jd(s,r,e))}},Ry=(e,t)=>{t.shouldUseNativeValidation&&Rd(e,t);const r={};for(const n in e){const s=z(t.fields,n),o=Object.assign(e[n]||{},{ref:s&&s.ref});if(eb(t.names||Object.keys(e),n)){const a=Object.assign({},z(r,n));Ee(a,"root",o),Ee(r,n,a)}else Ee(r,n,o)}return r},eb=(e,t)=>e.some(r=>r.startsWith(t+"."));var tb=function(e,t){for(var r={};e.length;){var n=e[0],s=n.code,o=n.message,a=n.path.join(".");if(!r[a])if("unionErrors"in n){var i=n.unionErrors[0].errors[0];r[a]={message:i.message,type:i.code}}else r[a]={message:o,type:s};if("unionErrors"in n&&n.unionErrors.forEach(function(u){return u.errors.forEach(function(h){return e.push(h)})}),t){var c=r[a].types,d=c&&c[n.code];r[a]=Id(a,t,r,s,d?[].concat(d,n.message):n.message)}e.shift()}return r},ks=function(e,t,r){return r===void 0&&(r={}),function(n,s,o){try{return Promise.resolve(function(a,i){try{var c=Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(d){return o.shouldUseNativeValidation&&Rd({},o),{errors:{},values:r.raw?n:d}})}catch(d){return i(d)}return c&&c.then?c.then(void 0,i):c}(0,function(a){if(function(i){return Array.isArray(i==null?void 0:i.errors)}(a))return{values:{},errors:Ry(tb(a.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw a}))}catch(a){return Promise.reject(a)}}},Ce;(function(e){e.assertEqual=s=>{};function t(s){}e.assertIs=t;function r(s){throw new Error}e.assertNever=r,e.arrayToEnum=s=>{const o={};for(const a of s)o[a]=a;return o},e.getValidEnumValues=s=>{const o=e.objectKeys(s).filter(i=>typeof s[s[i]]!="number"),a={};for(const i of o)a[i]=s[i];return e.objectValues(a)},e.objectValues=s=>e.objectKeys(s).map(function(o){return s[o]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const a in s)Object.prototype.hasOwnProperty.call(s,a)&&o.push(a);return o},e.find=(s,o)=>{for(const a of s)if(o(a))return a},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,o=" | "){return s.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}e.joinValues=n,e.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(Ce||(Ce={}));var eu;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(eu||(eu={}));const X=Ce.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Er=e=>{switch(typeof e){case"undefined":return X.undefined;case"string":return X.string;case"number":return Number.isNaN(e)?X.nan:X.number;case"boolean":return X.boolean;case"function":return X.function;case"bigint":return X.bigint;case"symbol":return X.symbol;case"object":return Array.isArray(e)?X.array:e===null?X.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?X.promise:typeof Map<"u"&&e instanceof Map?X.map:typeof Set<"u"&&e instanceof Set?X.set:typeof Date<"u"&&e instanceof Date?X.date:X.object;default:return X.unknown}},V=Ce.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 lr extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){const r=t||function(o){return o.message},n={_errors:[]},s=o=>{for(const a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(s);else if(a.code==="invalid_return_type")s(a.returnTypeError);else if(a.code==="invalid_arguments")s(a.argumentsError);else if(a.path.length===0)n._errors.push(r(a));else{let i=n,c=0;for(;c<a.path.length;){const d=a.path[c];c===a.path.length-1?(i[d]=i[d]||{_errors:[]},i[d]._errors.push(r(a))):i[d]=i[d]||{_errors:[]},i=i[d],c++}}};return s(this),n}static assert(t){if(!(t instanceof lr))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ce.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){const r={},n=[];for(const s of this.issues)if(s.path.length>0){const o=s.path[0];r[o]=r[o]||[],r[o].push(t(s))}else n.push(t(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}lr.create=e=>new lr(e);const ti=(e,t)=>{let r;switch(e.code){case V.invalid_type:e.received===X.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case V.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Ce.jsonStringifyReplacer)}`;break;case V.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ce.joinValues(e.keys,", ")}`;break;case V.invalid_union:r="Invalid input";break;case V.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ce.joinValues(e.options)}`;break;case V.invalid_enum_value:r=`Invalid enum value. Expected ${Ce.joinValues(e.options)}, received '${e.received}'`;break;case V.invalid_arguments:r="Invalid function arguments";break;case V.invalid_return_type:r="Invalid function return type";break;case V.invalid_date:r="Invalid date";break;case V.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:Ce.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case V.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case V.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case V.custom:r="Invalid input";break;case V.invalid_intersection_types:r="Intersection results could not be merged";break;case V.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case V.not_finite:r="Number must be finite";break;default:r=t.defaultError,Ce.assertNever(e)}return{message:r}};let rb=ti;function nb(){return rb}const sb=e=>{const{data:t,path:r,errorMaps:n,issueData:s}=e,o=[...r,...s.path||[]],a={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let i="";const c=n.filter(d=>!!d).slice().reverse();for(const d of c)i=d(a,{data:t,defaultError:i}).message;return{...s,path:o,message:i}};function Z(e,t){const r=nb(),n=sb({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===ti?void 0:ti].filter(s=>!!s)});e.common.issues.push(n)}class _t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const s of r){if(s.status==="aborted")return ne;s.status==="dirty"&&t.dirty(),n.push(s.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const s of r){const o=await s.key,a=await s.value;n.push({key:o,value:a})}return _t.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const s of r){const{key:o,value:a}=s;if(o.status==="aborted"||a.status==="aborted")return ne;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||s.alwaysSet)&&(n[o.value]=a.value)}return{status:t.value,value:n}}}const ne=Object.freeze({status:"aborted"}),Ns=e=>({status:"dirty",value:e}),kt=e=>({status:"valid",value:e}),tu=e=>e.status==="aborted",ru=e=>e.status==="dirty",Fn=e=>e.status==="valid",Oo=e=>typeof Promise<"u"&&e instanceof Promise;var R;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(R||(R={}));class Pr{constructor(t,r,n,s){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=s}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 nu=(e,t)=>{if(Fn(t))return{success:!0,data:t.value};if(!e.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 lr(e.common.issues);return this._error=r,this._error}}};function fe(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:s}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(a,i)=>{const{message:c}=e;return a.code==="invalid_enum_value"?{message:c??i.defaultError}:typeof i.data>"u"?{message:c??n??i.defaultError}:a.code!=="invalid_type"?{message:i.defaultError}:{message:c??r??i.defaultError}},description:s}}class xe{get description(){return this._def.description}_getType(t){return Er(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Er(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new _t,ctx:{common:t.parent.common,data:t.data,parsedType:Er(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(Oo(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){const n={common:{issues:[],async:(r==null?void 0:r.async)??!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Er(t)},s=this._parseSync({data:t,path:n.path,parent:n});return nu(n,s)}"~validate"(t){var n,s;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Er(t)};if(!this["~standard"].async)try{const o=this._parseSync({data:t,path:[],parent:r});return Fn(o)?{value:o.value}:{issues:r.common.issues}}catch(o){(s=(n=o==null?void 0:o.message)==null?void 0:n.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(o=>Fn(o)?{value:o.value}:{issues:r.common.issues})}async parseAsync(t,r){const n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Er(t)},s=this._parse({data:t,path:n.path,parent:n}),o=await(Oo(s)?s:Promise.resolve(s));return nu(n,o)}refine(t,r){const n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,o)=>{const a=t(s),i=()=>o.addIssue({code:V.custom,...n(s)});return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?!0:(i(),!1)):a?!0:(i(),!1)})}refinement(t,r){return this._refinement((n,s)=>t(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(t){return new $n({schema:this,typeName:se.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,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 Mr.create(this,this._def)}nullable(){return Bn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return qt.create(this)}promise(){return Do.create(this,this._def)}or(t){return Mo.create([this,t],this._def)}and(t){return Ao.create(this,t,this._def)}transform(t){return new $n({...fe(this._def),schema:this,typeName:se.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new oi({...fe(this._def),innerType:this,defaultValue:r,typeName:se.ZodDefault})}brand(){return new Eb({typeName:se.ZodBranded,type:this,...fe(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new ai({...fe(this._def),innerType:this,catchValue:r,typeName:se.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return ii.create(this,t)}readonly(){return li.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const ob=/^c[^\s-]{8,}$/i,ab=/^[0-9a-z]+$/,ib=/^[0-9A-HJKMNP-TV-Z]{26}$/i,lb=/^[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,cb=/^[a-z0-9_-]{21}$/i,db=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ub=/^[-+]?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)?)??$/,fb=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,hb="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ri;const pb=/^(?:(?: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])$/,mb=/^(?:(?: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])$/,vb=/^(([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]))$/,gb=/^(([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])$/,yb=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,bb=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,su="((\\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])))",wb=new RegExp(`^${su}$`);function ou(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function xb(e){return new RegExp(`^${ou(e)}$`)}function _b(e){let t=`${su}T${ou(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function Cb(e,t){return!!((t==="v4"||!t)&&pb.test(e)||(t==="v6"||!t)&&vb.test(e))}function Sb(e,t){if(!db.test(e))return!1;try{const[r]=e.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||t&&s.alg!==t)}catch{return!1}}function kb(e,t){return!!((t==="v4"||!t)&&mb.test(e)||(t==="v6"||!t)&&gb.test(e))}class Tr extends xe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==X.string){const o=this._getOrReturnCtx(t);return Z(o,{code:V.invalid_type,expected:X.string,received:o.parsedType}),ne}const n=new _t;let s;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(s=this._getOrReturnCtx(t,s),Z(s,{code:V.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")t.data.length>o.value&&(s=this._getOrReturnCtx(t,s),Z(s,{code:V.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){const a=t.data.length>o.value,i=t.data.length<o.value;(a||i)&&(s=this._getOrReturnCtx(t,s),a?Z(s,{code:V.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):i&&Z(s,{code:V.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")fb.test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"email",code:V.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")ri||(ri=new RegExp(hb,"u")),ri.test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"emoji",code:V.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")lb.test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"uuid",code:V.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")cb.test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"nanoid",code:V.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")ob.test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"cuid",code:V.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")ab.test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"cuid2",code:V.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")ib.test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"ulid",code:V.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),Z(s,{validation:"url",code:V.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"regex",code:V.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(s=this._getOrReturnCtx(t,s),Z(s,{code:V.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(s=this._getOrReturnCtx(t,s),Z(s,{code:V.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(s=this._getOrReturnCtx(t,s),Z(s,{code:V.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?_b(o).test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{code:V.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?wb.test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{code:V.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?xb(o).test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{code:V.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?ub.test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"duration",code:V.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?Cb(t.data,o.version)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"ip",code:V.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?Sb(t.data,o.alg)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"jwt",code:V.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?kb(t.data,o.version)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"cidr",code:V.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?yb.test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"base64",code:V.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?bb.test(t.data)||(s=this._getOrReturnCtx(t,s),Z(s,{validation:"base64url",code:V.invalid_string,message:o.message}),n.dirty()):Ce.assertNever(o);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(s=>t.test(s),{validation:r,code:V.invalid_string,...R.errToObj(n)})}_addCheck(t){return new Tr({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...R.errToObj(t)})}url(t){return this._addCheck({kind:"url",...R.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...R.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...R.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...R.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...R.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...R.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...R.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...R.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...R.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...R.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...R.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...R.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...R.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...R.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...R.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...R.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...R.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...R.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...R.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...R.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...R.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...R.errToObj(r)})}nonempty(t){return this.min(1,R.errToObj(t))}trim(){return new Tr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Tr({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Tr({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}Tr.create=e=>new Tr({checks:[],typeName:se.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...fe(e)});function Nb(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,s=r>n?r:n,o=Number.parseInt(e.toFixed(s).replace(".","")),a=Number.parseInt(t.toFixed(s).replace(".",""));return o%a/10**s}class Es extends xe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==X.number){const o=this._getOrReturnCtx(t);return Z(o,{code:V.invalid_type,expected:X.number,received:o.parsedType}),ne}let n;const s=new _t;for(const o of this._def.checks)o.kind==="int"?Ce.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),Z(n,{code:V.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),Z(n,{code:V.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),Z(n,{code:V.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="multipleOf"?Nb(t.data,o.value)!==0&&(n=this._getOrReturnCtx(t,n),Z(n,{code:V.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),Z(n,{code:V.not_finite,message:o.message}),s.dirty()):Ce.assertNever(o);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,R.toString(r))}gt(t,r){return this.setLimit("min",t,!1,R.toString(r))}lte(t,r){return this.setLimit("max",t,!0,R.toString(r))}lt(t,r){return this.setLimit("max",t,!1,R.toString(r))}setLimit(t,r,n,s){return new Es({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:R.toString(s)}]})}_addCheck(t){return new Es({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:R.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:R.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:R.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:R.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:R.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:R.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:R.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:R.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:R.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Ce.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}}Es.create=e=>new Es({checks:[],typeName:se.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...fe(e)});class Ps extends xe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==X.bigint)return this._getInvalidInput(t);let n;const s=new _t;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),Z(n,{code:V.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),Z(n,{code:V.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),Z(n,{code:V.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):Ce.assertNever(o);return{status:s.value,value:t.data}}_getInvalidInput(t){const r=this._getOrReturnCtx(t);return Z(r,{code:V.invalid_type,expected:X.bigint,received:r.parsedType}),ne}gte(t,r){return this.setLimit("min",t,!0,R.toString(r))}gt(t,r){return this.setLimit("min",t,!1,R.toString(r))}lte(t,r){return this.setLimit("max",t,!0,R.toString(r))}lt(t,r){return this.setLimit("max",t,!1,R.toString(r))}setLimit(t,r,n,s){return new Ps({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:R.toString(s)}]})}_addCheck(t){return new Ps({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:R.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:R.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:R.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:R.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:R.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}Ps.create=e=>new Ps({checks:[],typeName:se.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...fe(e)});class au extends xe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==X.boolean){const n=this._getOrReturnCtx(t);return Z(n,{code:V.invalid_type,expected:X.boolean,received:n.parsedType}),ne}return kt(t.data)}}au.create=e=>new au({typeName:se.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...fe(e)});class Ts extends xe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==X.date){const o=this._getOrReturnCtx(t);return Z(o,{code:V.invalid_type,expected:X.date,received:o.parsedType}),ne}if(Number.isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return Z(o,{code:V.invalid_date}),ne}const n=new _t;let s;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(s=this._getOrReturnCtx(t,s),Z(s,{code:V.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(s=this._getOrReturnCtx(t,s),Z(s,{code:V.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):Ce.assertNever(o);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Ts({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:R.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:R.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}}Ts.create=e=>new Ts({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:se.ZodDate,...fe(e)});class iu extends xe{_parse(t){if(this._getType(t)!==X.symbol){const n=this._getOrReturnCtx(t);return Z(n,{code:V.invalid_type,expected:X.symbol,received:n.parsedType}),ne}return kt(t.data)}}iu.create=e=>new iu({typeName:se.ZodSymbol,...fe(e)});class lu extends xe{_parse(t){if(this._getType(t)!==X.undefined){const n=this._getOrReturnCtx(t);return Z(n,{code:V.invalid_type,expected:X.undefined,received:n.parsedType}),ne}return kt(t.data)}}lu.create=e=>new lu({typeName:se.ZodUndefined,...fe(e)});class cu extends xe{_parse(t){if(this._getType(t)!==X.null){const n=this._getOrReturnCtx(t);return Z(n,{code:V.invalid_type,expected:X.null,received:n.parsedType}),ne}return kt(t.data)}}cu.create=e=>new cu({typeName:se.ZodNull,...fe(e)});class Os extends xe{constructor(){super(...arguments),this._any=!0}_parse(t){return kt(t.data)}}Os.create=e=>new Os({typeName:se.ZodAny,...fe(e)});class du extends xe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return kt(t.data)}}du.create=e=>new du({typeName:se.ZodUnknown,...fe(e)});class Or extends xe{_parse(t){const r=this._getOrReturnCtx(t);return Z(r,{code:V.invalid_type,expected:X.never,received:r.parsedType}),ne}}Or.create=e=>new Or({typeName:se.ZodNever,...fe(e)});class uu extends xe{_parse(t){if(this._getType(t)!==X.undefined){const n=this._getOrReturnCtx(t);return Z(n,{code:V.invalid_type,expected:X.void,received:n.parsedType}),ne}return kt(t.data)}}uu.create=e=>new uu({typeName:se.ZodVoid,...fe(e)});class qt extends xe{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),s=this._def;if(r.parsedType!==X.array)return Z(r,{code:V.invalid_type,expected:X.array,received:r.parsedType}),ne;if(s.exactLength!==null){const a=r.data.length>s.exactLength.value,i=r.data.length<s.exactLength.value;(a||i)&&(Z(r,{code:a?V.too_big:V.too_small,minimum:i?s.exactLength.value:void 0,maximum:a?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&(Z(r,{code:V.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&(Z(r,{code:V.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((a,i)=>s.type._parseAsync(new Pr(r,a,r.path,i)))).then(a=>_t.mergeArray(n,a));const o=[...r.data].map((a,i)=>s.type._parseSync(new Pr(r,a,r.path,i)));return _t.mergeArray(n,o)}get element(){return this._def.type}min(t,r){return new qt({...this._def,minLength:{value:t,message:R.toString(r)}})}max(t,r){return new qt({...this._def,maxLength:{value:t,message:R.toString(r)}})}length(t,r){return new qt({...this._def,exactLength:{value:t,message:R.toString(r)}})}nonempty(t){return this.min(1,t)}}qt.create=(e,t)=>new qt({type:e,minLength:null,maxLength:null,exactLength:null,typeName:se.ZodArray,...fe(t)});function Ln(e){if(e instanceof Ve){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=Mr.create(Ln(n))}return new Ve({...e._def,shape:()=>t})}else return e instanceof qt?new qt({...e._def,type:Ln(e.element)}):e instanceof Mr?Mr.create(Ln(e.unwrap())):e instanceof Bn?Bn.create(Ln(e.unwrap())):e instanceof on?on.create(e.items.map(t=>Ln(t))):e}class Ve extends xe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),r=Ce.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==X.object){const d=this._getOrReturnCtx(t);return Z(d,{code:V.invalid_type,expected:X.object,received:d.parsedType}),ne}const{status:n,ctx:s}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),i=[];if(!(this._def.catchall instanceof Or&&this._def.unknownKeys==="strip"))for(const d in s.data)a.includes(d)||i.push(d);const c=[];for(const d of a){const u=o[d],h=s.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new Pr(s,h,s.path,d)),alwaysSet:d in s.data})}if(this._def.catchall instanceof Or){const d=this._def.unknownKeys;if(d==="passthrough")for(const u of i)c.push({key:{status:"valid",value:u},value:{status:"valid",value:s.data[u]}});else if(d==="strict")i.length>0&&(Z(s,{code:V.unrecognized_keys,keys:i}),n.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const u of i){const h=s.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new Pr(s,h,s.path,u)),alwaysSet:u in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const d=[];for(const u of c){const h=await u.key,v=await u.value;d.push({key:h,value:v,alwaysSet:u.alwaysSet})}return d}).then(d=>_t.mergeObjectSync(n,d)):_t.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return R.errToObj,new Ve({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var o,a;const s=((a=(o=this._def).errorMap)==null?void 0:a.call(o,r,n).message)??n.defaultError;return r.code==="unrecognized_keys"?{message:R.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new Ve({...this._def,unknownKeys:"strip"})}passthrough(){return new Ve({...this._def,unknownKeys:"passthrough"})}extend(t){return new Ve({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Ve({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:se.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new Ve({...this._def,catchall:t})}pick(t){const r={};for(const n of Ce.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new Ve({...this._def,shape:()=>r})}omit(t){const r={};for(const n of Ce.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new Ve({...this._def,shape:()=>r})}deepPartial(){return Ln(this)}partial(t){const r={};for(const n of Ce.objectKeys(this.shape)){const s=this.shape[n];t&&!t[n]?r[n]=s:r[n]=s.optional()}return new Ve({...this._def,shape:()=>r})}required(t){const r={};for(const n of Ce.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof Mr;)o=o._def.innerType;r[n]=o}return new Ve({...this._def,shape:()=>r})}keyof(){return pu(Ce.objectKeys(this.shape))}}Ve.create=(e,t)=>new Ve({shape:()=>e,unknownKeys:"strip",catchall:Or.create(),typeName:se.ZodObject,...fe(t)}),Ve.strictCreate=(e,t)=>new Ve({shape:()=>e,unknownKeys:"strict",catchall:Or.create(),typeName:se.ZodObject,...fe(t)}),Ve.lazycreate=(e,t)=>new Ve({shape:e,unknownKeys:"strip",catchall:Or.create(),typeName:se.ZodObject,...fe(t)});class Mo extends xe{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function s(o){for(const i of o)if(i.result.status==="valid")return i.result;for(const i of o)if(i.result.status==="dirty")return r.common.issues.push(...i.ctx.common.issues),i.result;const a=o.map(i=>new lr(i.ctx.common.issues));return Z(r,{code:V.invalid_union,unionErrors:a}),ne}if(r.common.async)return Promise.all(n.map(async o=>{const a={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}})).then(s);{let o;const a=[];for(const c of n){const d={...r,common:{...r.common,issues:[]},parent:null},u=c._parseSync({data:r.data,path:r.path,parent:d});if(u.status==="valid")return u;u.status==="dirty"&&!o&&(o={result:u,ctx:d}),d.common.issues.length&&a.push(d.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;const i=a.map(c=>new lr(c));return Z(r,{code:V.invalid_union,unionErrors:i}),ne}}get options(){return this._def.options}}Mo.create=(e,t)=>new Mo({options:e,typeName:se.ZodUnion,...fe(t)});function ni(e,t){const r=Er(e),n=Er(t);if(e===t)return{valid:!0,data:e};if(r===X.object&&n===X.object){const s=Ce.objectKeys(t),o=Ce.objectKeys(e).filter(i=>s.indexOf(i)!==-1),a={...e,...t};for(const i of o){const c=ni(e[i],t[i]);if(!c.valid)return{valid:!1};a[i]=c.data}return{valid:!0,data:a}}else if(r===X.array&&n===X.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let o=0;o<e.length;o++){const a=e[o],i=t[o],c=ni(a,i);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return r===X.date&&n===X.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Ao extends xe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t),s=(o,a)=>{if(tu(o)||tu(a))return ne;const i=ni(o.value,a.value);return i.valid?((ru(o)||ru(a))&&r.dirty(),{status:r.value,value:i.data}):(Z(n,{code:V.invalid_intersection_types}),ne)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,a])=>s(o,a)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Ao.create=(e,t,r)=>new Ao({left:e,right:t,typeName:se.ZodIntersection,...fe(r)});class on extends xe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==X.array)return Z(n,{code:V.invalid_type,expected:X.array,received:n.parsedType}),ne;if(n.data.length<this._def.items.length)return Z(n,{code:V.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ne;!this._def.rest&&n.data.length>this._def.items.length&&(Z(n,{code:V.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const o=[...n.data].map((a,i)=>{const c=this._def.items[i]||this._def.rest;return c?c._parse(new Pr(n,a,n.path,i)):null}).filter(a=>!!a);return n.common.async?Promise.all(o).then(a=>_t.mergeArray(r,a)):_t.mergeArray(r,o)}get items(){return this._def.items}rest(t){return new on({...this._def,rest:t})}}on.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new on({items:e,typeName:se.ZodTuple,rest:null,...fe(t)})};class fu extends xe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==X.map)return Z(n,{code:V.invalid_type,expected:X.map,received:n.parsedType}),ne;const s=this._def.keyType,o=this._def.valueType,a=[...n.data.entries()].map(([i,c],d)=>({key:s._parse(new Pr(n,i,n.path,[d,"key"])),value:o._parse(new Pr(n,c,n.path,[d,"value"]))}));if(n.common.async){const i=new Map;return Promise.resolve().then(async()=>{for(const c of a){const d=await c.key,u=await c.value;if(d.status==="aborted"||u.status==="aborted")return ne;(d.status==="dirty"||u.status==="dirty")&&r.dirty(),i.set(d.value,u.value)}return{status:r.value,value:i}})}else{const i=new Map;for(const c of a){const d=c.key,u=c.value;if(d.status==="aborted"||u.status==="aborted")return ne;(d.status==="dirty"||u.status==="dirty")&&r.dirty(),i.set(d.value,u.value)}return{status:r.value,value:i}}}}fu.create=(e,t,r)=>new fu({valueType:t,keyType:e,typeName:se.ZodMap,...fe(r)});class Ms extends xe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==X.set)return Z(n,{code:V.invalid_type,expected:X.set,received:n.parsedType}),ne;const s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(Z(n,{code:V.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(Z(n,{code:V.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());const o=this._def.valueType;function a(c){const d=new Set;for(const u of c){if(u.status==="aborted")return ne;u.status==="dirty"&&r.dirty(),d.add(u.value)}return{status:r.value,value:d}}const i=[...n.data.values()].map((c,d)=>o._parse(new Pr(n,c,n.path,d)));return n.common.async?Promise.all(i).then(c=>a(c)):a(i)}min(t,r){return new Ms({...this._def,minSize:{value:t,message:R.toString(r)}})}max(t,r){return new Ms({...this._def,maxSize:{value:t,message:R.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}Ms.create=(e,t)=>new Ms({valueType:e,minSize:null,maxSize:null,typeName:se.ZodSet,...fe(t)});class hu extends xe{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}hu.create=(e,t)=>new hu({getter:e,typeName:se.ZodLazy,...fe(t)});class si extends xe{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return Z(r,{received:r.data,code:V.invalid_literal,expected:this._def.value}),ne}return{status:"valid",value:t.data}}get value(){return this._def.value}}si.create=(e,t)=>new si({value:e,typeName:se.ZodLiteral,...fe(t)});function pu(e,t){return new Vn({values:e,typeName:se.ZodEnum,...fe(t)})}class Vn extends xe{_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return Z(r,{expected:Ce.joinValues(n),received:r.parsedType,code:V.invalid_type}),ne}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return Z(r,{received:r.data,code:V.invalid_enum_value,options:n}),ne}return kt(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return Vn.create(t,{...this._def,...r})}exclude(t,r=this._def){return Vn.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}Vn.create=pu;class mu extends xe{_parse(t){const r=Ce.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==X.string&&n.parsedType!==X.number){const s=Ce.objectValues(r);return Z(n,{expected:Ce.joinValues(s),received:n.parsedType,code:V.invalid_type}),ne}if(this._cache||(this._cache=new Set(Ce.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const s=Ce.objectValues(r);return Z(n,{received:n.data,code:V.invalid_enum_value,options:s}),ne}return kt(t.data)}get enum(){return this._def.values}}mu.create=(e,t)=>new mu({values:e,typeName:se.ZodNativeEnum,...fe(t)});class Do extends xe{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==X.promise&&r.common.async===!1)return Z(r,{code:V.invalid_type,expected:X.promise,received:r.parsedType}),ne;const n=r.parsedType===X.promise?r.data:Promise.resolve(r.data);return kt(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}}Do.create=(e,t)=>new Do({type:e,typeName:se.ZodPromise,...fe(t)});class $n extends xe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===se.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),s=this._def.effect||null,o={addIssue:a=>{Z(n,a),a.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){const a=s.transform(n.data,o);if(n.common.async)return Promise.resolve(a).then(async i=>{if(r.value==="aborted")return ne;const c=await this._def.schema._parseAsync({data:i,path:n.path,parent:n});return c.status==="aborted"?ne:c.status==="dirty"||r.value==="dirty"?Ns(c.value):c});{if(r.value==="aborted")return ne;const i=this._def.schema._parseSync({data:a,path:n.path,parent:n});return i.status==="aborted"?ne:i.status==="dirty"||r.value==="dirty"?Ns(i.value):i}}if(s.type==="refinement"){const a=i=>{const c=s.refinement(i,o);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return i};if(n.common.async===!1){const i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?ne:(i.status==="dirty"&&r.dirty(),a(i.value),{status:r.value,value:i.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>i.status==="aborted"?ne:(i.status==="dirty"&&r.dirty(),a(i.value).then(()=>({status:r.value,value:i.value}))))}if(s.type==="transform")if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Fn(a))return ne;const i=s.transform(a.value,o);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:n.data,path:n.path,parent:n}).then(a=>Fn(a)?Promise.resolve(s.transform(a.value,o)).then(i=>({status:r.value,value:i})):ne);Ce.assertNever(s)}}$n.create=(e,t,r)=>new $n({schema:e,typeName:se.ZodEffects,effect:t,...fe(r)}),$n.createWithPreprocess=(e,t,r)=>new $n({schema:t,effect:{type:"preprocess",transform:e},typeName:se.ZodEffects,...fe(r)});class Mr extends xe{_parse(t){return this._getType(t)===X.undefined?kt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Mr.create=(e,t)=>new Mr({innerType:e,typeName:se.ZodOptional,...fe(t)});class Bn extends xe{_parse(t){return this._getType(t)===X.null?kt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Bn.create=(e,t)=>new Bn({innerType:e,typeName:se.ZodNullable,...fe(t)});class oi extends xe{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===X.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}oi.create=(e,t)=>new oi({innerType:e,typeName:se.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...fe(t)});class ai extends xe{_parse(t){const{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Oo(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new lr(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new lr(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}ai.create=(e,t)=>new ai({innerType:e,typeName:se.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...fe(t)});class vu extends xe{_parse(t){if(this._getType(t)!==X.nan){const n=this._getOrReturnCtx(t);return Z(n,{code:V.invalid_type,expected:X.nan,received:n.parsedType}),ne}return{status:"valid",value:t.data}}}vu.create=e=>new vu({typeName:se.ZodNaN,...fe(e)});class Eb extends xe{_parse(t){const{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class ii extends xe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?ne:o.status==="dirty"?(r.dirty(),Ns(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?ne:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(t,r){return new ii({in:t,out:r,typeName:se.ZodPipeline})}}class li extends xe{_parse(t){const r=this._def.innerType._parse(t),n=s=>(Fn(s)&&(s.value=Object.freeze(s.value)),s);return Oo(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}}li.create=(e,t)=>new li({innerType:e,typeName:se.ZodReadonly,...fe(t)});function gu(e,t){const r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function Pb(e,t={},r){return e?Os.create().superRefine((n,s)=>{const o=e(n);if(o instanceof Promise)return o.then(a=>{if(!a){const i=gu(t,n),c=i.fatal??r??!0;s.addIssue({code:"custom",...i,fatal:c})}});if(!o){const a=gu(t,n),i=a.fatal??r??!0;s.addIssue({code:"custom",...a,fatal:i})}}):Os.create()}Ve.lazycreate;var se;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(se||(se={}));const ci=(e,t={message:`Input not instance of ${e.name}`})=>Pb(r=>r instanceof e,t),Xe=Tr.create,yu=Ts.create;Os.create,Or.create,qt.create;const As=Ve.create;Ve.strictCreate,Mo.create,Ao.create,on.create;const Tb=si.create;Vn.create,Do.create,Mr.create,Bn.create;const Ds=Fy,bu=m.createContext({}),qe=({...e})=>l.jsx(bu.Provider,{value:{name:e.name},children:l.jsx(By,{...e})}),Io=()=>{const e=m.useContext(bu),t=m.useContext(wu),{getFieldState:r,formState:n}=ko(),s=r(e.name,n);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:o}=t;return{id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...s}},wu=m.createContext({}),$e=m.forwardRef(({className:e,...t},r)=>{const n=m.useId();return l.jsx(wu.Provider,{value:{id:n},children:l.jsx("div",{ref:r,className:he("space-y-2",e),...t})})});$e.displayName="FormItem";const Be=m.forwardRef(({className:e,...t},r)=>{const{error:n,formItemId:s}=Io();return l.jsx(nn,{ref:r,className:he(n&&"text-destructive",e),htmlFor:s,...t})});Be.displayName="FormLabel";const We=m.forwardRef(({...e},t)=>{const{error:r,formItemId:n,formDescriptionId:s,formMessageId:o}=Io();return l.jsx(fl,{ref:t,id:n,"aria-describedby":r?`${s} ${o}`:`${s}`,"aria-invalid":!!r,...e})});We.displayName="FormControl";const Ob=m.forwardRef(({className:e,...t},r)=>{const{formDescriptionId:n}=Io();return l.jsx("p",{ref:r,id:n,className:he("text-sm text-muted-foreground",e),...t})});Ob.displayName="FormDescription";const je=m.forwardRef(({className:e,children:t,...r},n)=>{const{error:s,formMessageId:o}=Io(),a=s?String(s==null?void 0:s.message):t;return a?l.jsx("p",{ref:n,id:o,className:he("text-sm font-medium text-destructive",e),...r,children:a}):null});je.displayName="FormMessage";const Mb=As({bank_statement:ci(File).optional().refine(e=>e!==void 0,"Bank statement is required"),company_structure:ci(File).optional().refine(e=>e!==void 0,"Company structure document is required"),certificate_of_registration:ci(File).optional().refine(e=>e!==void 0,"Certificate of registration is required")}),Ab=({data:e,onDataChange:t,onContinue:r,onBack:n,renderProgress:s})=>{const o=S.useRef(null),a=S.useRef(null),i=S.useRef(null),c=Ss({resolver:ks(Mb),defaultValues:{bank_statement:e.bank_statement||void 0,company_structure:e.company_structure||void 0,certificate_of_registration:e.certificate_of_registration||void 0}}),d=v=>{t(v),r()},u=(v,f)=>{c.setValue(v,f),t({[v]:f})},h=({field:v,label:f,description:b,inputRef:p})=>{const g=c.watch(v);return l.jsx(qe,{control:c.control,name:v,render:()=>l.jsxs($e,{children:[l.jsx(Be,{children:f}),l.jsx(We,{children:l.jsxs("div",{className:"border-2 border-dashed border-muted-foreground/25 rounded-lg p-6",children:[l.jsx("input",{ref:p,type:"file",accept:".pdf,.jpg,.jpeg,.png,.doc,.docx",className:"hidden",onChange:x=>{var w;const y=((w=x.target.files)==null?void 0:w[0])||null;u(v,y)}}),g?l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx($p,{className:"w-5 h-5 text-primary"}),l.jsx("span",{className:"text-sm font-medium",children:g.name})]}),l.jsx(He,{type:"button",variant:"ghost",size:"sm",onClick:()=>{u(v,null),p.current&&(p.current.value="")},children:l.jsx(Jl,{className:"w-4 h-4"})})]}):l.jsxs("div",{className:"text-center cursor-pointer",onClick:()=>{var x;return(x=p.current)==null?void 0:x.click()},children:[l.jsx(Wp,{className:"w-8 h-8 mx-auto mb-2 text-muted-foreground"}),l.jsx("p",{className:"font-medium",children:f}),l.jsx("p",{className:"text-sm text-muted-foreground",children:b}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Supported: PDF, JPG, PNG, DOC, DOCX"})]})]})}),l.jsx(je,{})]})})};return l.jsxs(st,{className:"w-full max-w-2xl mx-auto",children:[l.jsx(kr,{children:l.jsx(Nr,{title:"Company Documents",subTitle:"Please upload the required company documents",onBack:n})}),l.jsxs(ot,{children:[l.jsx(Ds,{...c,children:l.jsxs("form",{onSubmit:c.handleSubmit(d),className:"space-y-6",children:[l.jsx(h,{field:"bank_statement",label:"Bank Statement",description:"Upload your latest bank statement",inputRef:o}),l.jsx(h,{field:"company_structure",label:"Company Structure",description:"Upload document showing directors & legal representatives",inputRef:a}),l.jsx(h,{field:"certificate_of_registration",label:"Certificate of Registration",description:"Upload your company's certificate of registration",inputRef:i}),l.jsx(He,{type:"submit",className:"w-full",children:"Complete Verification"})]})}),l.jsx("div",{className:"mt-6",children:s()})]})]})};function xu(e,[t,r]){return Math.min(r,Math.max(t,e))}var Db=m.createContext(void 0);function Ib(e){const t=m.useContext(Db);return e||t||"ltr"}var di=0;function _u(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Cu()),document.body.insertAdjacentElement("beforeend",e[1]??Cu()),di++,()=>{di===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),di--}},[])}function Cu(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var ui="focusScope.autoFocusOnMount",fi="focusScope.autoFocusOnUnmount",Su={bubbles:!1,cancelable:!0},Fb="FocusScope",hi=m.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...a}=e,[i,c]=m.useState(null),d=Et(s),u=Et(o),h=m.useRef(null),v=Ie(t,p=>c(p)),f=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(n){let p=function(w){if(f.paused||!i)return;const k=w.target;i.contains(k)?h.current=k:Ar(h.current,{select:!0})},g=function(w){if(f.paused||!i)return;const k=w.relatedTarget;k!==null&&(i.contains(k)||Ar(h.current,{select:!0}))},x=function(w){if(document.activeElement===document.body)for(const E of w)E.removedNodes.length>0&&Ar(i)};document.addEventListener("focusin",p),document.addEventListener("focusout",g);const y=new MutationObserver(x);return i&&y.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",g),y.disconnect()}}},[n,i,f.paused]),m.useEffect(()=>{if(i){Eu.add(f);const p=document.activeElement;if(!i.contains(p)){const x=new CustomEvent(ui,Su);i.addEventListener(ui,d),i.dispatchEvent(x),x.defaultPrevented||(Lb(jb(ku(i)),{select:!0}),document.activeElement===p&&Ar(i))}return()=>{i.removeEventListener(ui,d),setTimeout(()=>{const x=new CustomEvent(fi,Su);i.addEventListener(fi,u),i.dispatchEvent(x),x.defaultPrevented||Ar(p??document.body,{select:!0}),i.removeEventListener(fi,u),Eu.remove(f)},0)}}},[i,d,u,f]);const b=m.useCallback(p=>{if(!r&&!n||f.paused)return;const g=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,x=document.activeElement;if(g&&x){const y=p.currentTarget,[w,k]=Vb(y);w&&k?!p.shiftKey&&x===k?(p.preventDefault(),r&&Ar(w,{select:!0})):p.shiftKey&&x===w&&(p.preventDefault(),r&&Ar(k,{select:!0})):x===y&&p.preventDefault()}},[r,n,f.paused]);return l.jsx(we.div,{tabIndex:-1,...a,ref:v,onKeyDown:b})});hi.displayName=Fb;function Lb(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Ar(n,{select:t}),document.activeElement!==r)return}function Vb(e){const t=ku(e),r=Nu(t,e),n=Nu(t.reverse(),e);return[r,n]}function ku(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Nu(e,t){for(const r of e)if(!$b(r,{upTo:t}))return r}function $b(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Bb(e){return e instanceof HTMLInputElement&&"select"in e}function Ar(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&Bb(e)&&t&&e.select()}}var Eu=Wb();function Wb(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=Pu(e,t),e.unshift(t)},remove(t){var r;e=Pu(e,t),(r=e[0])==null||r.resume()}}}function Pu(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function jb(e){return e.filter(t=>t.tagName!=="A")}function Ub(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Hb=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Wn=new WeakMap,Fo=new WeakMap,Lo={},pi=0,Tu=function(e){return e&&(e.host||Tu(e.parentNode))},zb=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Tu(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},Yb=function(e,t,r,n){var s=zb(t,Array.isArray(e)?e:[e]);Lo[r]||(Lo[r]=new WeakMap);var o=Lo[r],a=[],i=new Set,c=new Set(s),d=function(h){!h||i.has(h)||(i.add(h),d(h.parentNode))};s.forEach(d);var u=function(h){!h||c.has(h)||Array.prototype.forEach.call(h.children,function(v){if(i.has(v))u(v);else try{var f=v.getAttribute(n),b=f!==null&&f!=="false",p=(Wn.get(v)||0)+1,g=(o.get(v)||0)+1;Wn.set(v,p),o.set(v,g),a.push(v),p===1&&b&&Fo.set(v,!0),g===1&&v.setAttribute(r,"true"),b||v.setAttribute(n,"true")}catch(x){console.error("aria-hidden: cannot operate on ",v,x)}})};return u(t),i.clear(),pi++,function(){a.forEach(function(h){var v=Wn.get(h)-1,f=o.get(h)-1;Wn.set(h,v),o.set(h,f),v||(Fo.has(h)||h.removeAttribute(n),Fo.delete(h)),f||h.removeAttribute(r)}),pi--,pi||(Wn=new WeakMap,Wn=new WeakMap,Fo=new WeakMap,Lo={})}},Ou=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),s=Hb(e);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live]"))),Yb(n,s,r,"aria-hidden")):function(){return null}},Zt=function(){return Zt=Object.assign||function(t){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},Zt.apply(this,arguments)};function Mu(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}function qb(e,t,r){if(r||arguments.length===2)for(var n=0,s=t.length,o;n<s;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Vo="right-scroll-bar-position",$o="width-before-scroll-bar",Zb="with-scroll-bars-hidden",Kb="--removed-body-scroll-bar-size";function mi(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Qb(e,t){var r=S.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var s=r.value;s!==n&&(r.value=n,r.callback(n,s))}}}})[0];return r.callback=t,r.facade}var Gb=typeof window<"u"?m.useLayoutEffect:m.useEffect,Au=new WeakMap;function Xb(e,t){var r=Qb(null,function(n){return e.forEach(function(s){return mi(s,n)})});return Gb(function(){var n=Au.get(r);if(n){var s=new Set(n),o=new Set(e),a=r.current;s.forEach(function(i){o.has(i)||mi(i,null)}),o.forEach(function(i){s.has(i)||mi(i,a)})}Au.set(r,e)},[e]),r}function Jb(e){return e}function Rb(e,t){t===void 0&&(t=Jb);var r=[],n=!1,s={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(o){var a=t(o,n);return r.push(a),function(){r=r.filter(function(i){return i!==a})}},assignSyncMedium:function(o){for(n=!0;r.length;){var a=r;r=[],a.forEach(o)}r={push:function(i){return o(i)},filter:function(){return r}}},assignMedium:function(o){n=!0;var a=[];if(r.length){var i=r;r=[],i.forEach(o),a=r}var c=function(){var u=a;a=[],u.forEach(o)},d=function(){return Promise.resolve().then(c)};d(),r={push:function(u){a.push(u),d()},filter:function(u){return a=a.filter(u),r}}}};return s}function ew(e){e===void 0&&(e={});var t=Rb(null);return t.options=Zt({async:!0,ssr:!1},e),t}var Du=function(e){var t=e.sideCar,r=Mu(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return m.createElement(n,Zt({},r))};Du.isSideCarExport=!0;function tw(e,t){return e.useMedium(t),Du}var Iu=ew(),vi=function(){},Bo=m.forwardRef(function(e,t){var r=m.useRef(null),n=m.useState({onScrollCapture:vi,onWheelCapture:vi,onTouchMoveCapture:vi}),s=n[0],o=n[1],a=e.forwardProps,i=e.children,c=e.className,d=e.removeScrollBar,u=e.enabled,h=e.shards,v=e.sideCar,f=e.noRelative,b=e.noIsolation,p=e.inert,g=e.allowPinchZoom,x=e.as,y=x===void 0?"div":x,w=e.gapMode,k=Mu(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=v,M=Xb([r,t]),T=Zt(Zt({},k),s);return m.createElement(m.Fragment,null,u&&m.createElement(E,{sideCar:Iu,removeScrollBar:d,shards:h,noRelative:f,noIsolation:b,inert:p,setCallbacks:o,allowPinchZoom:!!g,lockRef:r,gapMode:w}),a?m.cloneElement(m.Children.only(i),Zt(Zt({},T),{ref:M})):m.createElement(y,Zt({},T,{className:c,ref:M}),i))});Bo.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Bo.classNames={fullWidth:$o,zeroRight:Vo};var rw=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function nw(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=rw();return t&&e.setAttribute("nonce",t),e}function sw(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ow(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var aw=function(){var e=0,t=null;return{add:function(r){e==0&&(t=nw())&&(sw(t,r),ow(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},iw=function(){var e=aw();return function(t,r){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},Fu=function(){var e=iw(),t=function(r){var n=r.styles,s=r.dynamic;return e(n,s),null};return t},lw={left:0,top:0,right:0,gap:0},gi=function(e){return parseInt(e||"",10)||0},cw=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[gi(r),gi(n),gi(s)]},dw=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return lw;var t=cw(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},uw=Fu(),jn="data-scroll-locked",fw=function(e,t,r,n){var s=e.left,o=e.top,a=e.right,i=e.gap;return r===void 0&&(r="margin"),`
103
+ .`.concat(Zb,` {
104
104
  overflow: hidden `).concat(n,`;
105
105
  padding-right: `).concat(i,"px ").concat(n,`;
106
106
  }
@@ -134,14 +134,14 @@
134
134
  }
135
135
 
136
136
  body[`).concat(jn,`] {
137
- `).concat(Zb,": ").concat(i,`px;
137
+ `).concat(Kb,": ").concat(i,`px;
138
138
  }
139
- `)},Lu=function(){var e=parseInt(document.body.getAttribute(jn)||"0",10);return isFinite(e)?e:0},fw=function(){m.useEffect(function(){return document.body.setAttribute(jn,(Lu()+1).toString()),function(){var e=Lu()-1;e<=0?document.body.removeAttribute(jn):document.body.setAttribute(jn,e.toString())}},[])},hw=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,s=n===void 0?"margin":n;fw();var o=m.useMemo(function(){return cw(s)},[s]);return m.createElement(dw,{styles:uw(o,!t,s,r?"":"!important")})},yi=!1;if(typeof window<"u")try{var Wo=Object.defineProperty({},"passive",{get:function(){return yi=!0,!0}});window.addEventListener("test",Wo,Wo),window.removeEventListener("test",Wo,Wo)}catch{yi=!1}var Un=yi?{passive:!1}:!1,pw=function(e){return e.tagName==="TEXTAREA"},Vu=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!pw(e)&&r[t]==="visible")},mw=function(e){return Vu(e,"overflowY")},vw=function(e){return Vu(e,"overflowX")},$u=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var s=Bu(e,n);if(s){var o=Wu(e,n),a=o[1],i=o[2];if(a>i)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},gw=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},yw=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},Bu=function(e,t){return e==="v"?mw(t):vw(t)},Wu=function(e,t){return e==="v"?gw(t):yw(t)},bw=function(e,t){return e==="h"&&t==="rtl"?-1:1},ww=function(e,t,r,n,s){var o=bw(e,window.getComputedStyle(t).direction),a=o*n,i=r.target,c=t.contains(i),d=!1,u=a>0,h=0,v=0;do{if(!i)break;var f=Wu(e,i),b=f[0],p=f[1],g=f[2],x=p-g-o*b;(b||x)&&Bu(e,i)&&(h+=x,v+=b);var y=i.parentNode;i=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!c&&i!==document.body||c&&(t.contains(i)||t===i));return(u&&(Math.abs(h)<1||!s)||!u&&(Math.abs(v)<1||!s))&&(d=!0),d},jo=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ju=function(e){return[e.deltaX,e.deltaY]},Uu=function(e){return e&&"current"in e?e.current:e},xw=function(e,t){return e[0]===t[0]&&e[1]===t[1]},_w=function(e){return`
139
+ `)},Lu=function(){var e=parseInt(document.body.getAttribute(jn)||"0",10);return isFinite(e)?e:0},hw=function(){m.useEffect(function(){return document.body.setAttribute(jn,(Lu()+1).toString()),function(){var e=Lu()-1;e<=0?document.body.removeAttribute(jn):document.body.setAttribute(jn,e.toString())}},[])},pw=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,s=n===void 0?"margin":n;hw();var o=m.useMemo(function(){return dw(s)},[s]);return m.createElement(uw,{styles:fw(o,!t,s,r?"":"!important")})},yi=!1;if(typeof window<"u")try{var Wo=Object.defineProperty({},"passive",{get:function(){return yi=!0,!0}});window.addEventListener("test",Wo,Wo),window.removeEventListener("test",Wo,Wo)}catch{yi=!1}var Un=yi?{passive:!1}:!1,mw=function(e){return e.tagName==="TEXTAREA"},Vu=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!mw(e)&&r[t]==="visible")},vw=function(e){return Vu(e,"overflowY")},gw=function(e){return Vu(e,"overflowX")},$u=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var s=Bu(e,n);if(s){var o=Wu(e,n),a=o[1],i=o[2];if(a>i)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},yw=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},bw=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},Bu=function(e,t){return e==="v"?vw(t):gw(t)},Wu=function(e,t){return e==="v"?yw(t):bw(t)},ww=function(e,t){return e==="h"&&t==="rtl"?-1:1},xw=function(e,t,r,n,s){var o=ww(e,window.getComputedStyle(t).direction),a=o*n,i=r.target,c=t.contains(i),d=!1,u=a>0,h=0,v=0;do{if(!i)break;var f=Wu(e,i),b=f[0],p=f[1],g=f[2],x=p-g-o*b;(b||x)&&Bu(e,i)&&(h+=x,v+=b);var y=i.parentNode;i=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!c&&i!==document.body||c&&(t.contains(i)||t===i));return(u&&(Math.abs(h)<1||!s)||!u&&(Math.abs(v)<1||!s))&&(d=!0),d},jo=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ju=function(e){return[e.deltaX,e.deltaY]},Uu=function(e){return e&&"current"in e?e.current:e},_w=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Cw=function(e){return`
140
140
  .block-interactivity-`.concat(e,` {pointer-events: none;}
141
141
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
142
- `)},Cw=0,Hn=[];function Sw(e){var t=m.useRef([]),r=m.useRef([0,0]),n=m.useRef(),s=m.useState(Cw++)[0],o=m.useState(Fu)[0],a=m.useRef(e);m.useEffect(function(){a.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var p=Yb([e.lockRef.current],(e.shards||[]).map(Uu),!0).filter(Boolean);return p.forEach(function(g){return g.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),p.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var i=m.useCallback(function(p,g){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!a.current.allowPinchZoom;var x=jo(p),y=r.current,w="deltaX"in p?p.deltaX:y[0]-x[0],k="deltaY"in p?p.deltaY:y[1]-x[1],E,M=p.target,O=Math.abs(w)>Math.abs(k)?"h":"v";if("touches"in p&&O==="h"&&M.type==="range")return!1;var P=$u(O,M);if(!P)return!0;if(P?E=O:(E=O==="v"?"h":"v",P=$u(O,M)),!P)return!1;if(!n.current&&"changedTouches"in p&&(w||k)&&(n.current=E),!E)return!0;var F=n.current||E;return ww(F,g,p,F==="h"?w:k,!0)},[]),c=m.useCallback(function(p){var g=p;if(!(!Hn.length||Hn[Hn.length-1]!==o)){var x="deltaY"in g?ju(g):jo(g),y=t.current.filter(function(E){return E.name===g.type&&(E.target===g.target||g.target===E.shadowParent)&&xw(E.delta,x)})[0];if(y&&y.should){g.cancelable&&g.preventDefault();return}if(!y){var w=(a.current.shards||[]).map(Uu).filter(Boolean).filter(function(E){return E.contains(g.target)}),k=w.length>0?i(g,w[0]):!a.current.noIsolation;k&&g.cancelable&&g.preventDefault()}}},[]),d=m.useCallback(function(p,g,x,y){var w={name:p,delta:g,target:x,should:y,shadowParent:kw(x)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(k){return k!==w})},1)},[]),u=m.useCallback(function(p){r.current=jo(p),n.current=void 0},[]),h=m.useCallback(function(p){d(p.type,ju(p),p.target,i(p,e.lockRef.current))},[]),v=m.useCallback(function(p){d(p.type,jo(p),p.target,i(p,e.lockRef.current))},[]);m.useEffect(function(){return Hn.push(o),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:v}),document.addEventListener("wheel",c,Un),document.addEventListener("touchmove",c,Un),document.addEventListener("touchstart",u,Un),function(){Hn=Hn.filter(function(p){return p!==o}),document.removeEventListener("wheel",c,Un),document.removeEventListener("touchmove",c,Un),document.removeEventListener("touchstart",u,Un)}},[]);var f=e.removeScrollBar,b=e.inert;return m.createElement(m.Fragment,null,b?m.createElement(o,{styles:_w(s)}):null,f?m.createElement(hw,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function kw(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Nw=ew(Iu,Sw);var bi=m.forwardRef(function(e,t){return m.createElement(Bo,Zt({},e,{ref:t,sideCar:Nw}))});bi.classNames=Bo.classNames;var Ew=[" ","Enter","ArrowUp","ArrowDown"],Pw=[" ","Enter"],an="Select",[Uo,Ho,Tw]=pl(an),[zn,NC]=Rr(an,[Tw,On]),zo=On(),[Ow,Dr]=zn(an),[Mw,Aw]=zn(an),Hu=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:s,onOpenChange:o,value:a,defaultValue:i,onValueChange:c,dir:d,name:u,autoComplete:h,disabled:v,required:f,form:b}=e,p=zo(t),[g,x]=m.useState(null),[y,w]=m.useState(null),[k,E]=m.useState(!1),M=Db(d),[O,P]=Rs({prop:n,defaultProp:s??!1,onChange:o,caller:an}),[F,W]=Rs({prop:a,defaultProp:i,onChange:c,caller:an}),G=m.useRef(null),D=g?b||!!g.closest("form"):!0,[U,L]=m.useState(new Set),J=Array.from(U).map(Y=>Y.props.value).join(";");return l.jsx(Yc,{...p,children:l.jsxs(Ow,{required:f,scope:t,trigger:g,onTriggerChange:x,valueNode:y,onValueNodeChange:w,valueNodeHasChildren:k,onValueNodeHasChildrenChange:E,contentId:so(),value:F,onValueChange:W,open:O,onOpenChange:P,dir:M,triggerPointerDownPosRef:G,disabled:v,children:[l.jsx(Uo.Provider,{scope:t,children:l.jsx(Mw,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(Y=>{L(I=>new Set(I).add(Y))},[]),onNativeOptionRemove:m.useCallback(Y=>{L(I=>{const A=new Set(I);return A.delete(Y),A})},[]),children:r})}),D?l.jsxs(pf,{"aria-hidden":!0,required:f,tabIndex:-1,name:u,autoComplete:h,value:F,onChange:Y=>W(Y.target.value),disabled:v,form:b,children:[F===void 0?l.jsx("option",{value:""}):null,Array.from(U)]},J):null]})})};Hu.displayName=an;var zu="SelectTrigger",Yu=m.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...s}=e,o=zo(r),a=Dr(zu,r),i=a.disabled||n,c=Ie(t,a.onTriggerChange),d=Ho(r),u=m.useRef("touch"),[h,v,f]=vf(p=>{const g=d().filter(w=>!w.disabled),x=g.find(w=>w.value===a.value),y=gf(g,p,x);y!==void 0&&a.onValueChange(y.value)}),b=p=>{i||(a.onOpenChange(!0),f()),p&&(a.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return l.jsx(mo,{asChild:!0,...o,children:l.jsx(we.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:i,"data-disabled":i?"":void 0,"data-placeholder":mf(a.value)?"":void 0,...s,ref:c,onClick:ie(s.onClick,p=>{p.currentTarget.focus(),u.current!=="mouse"&&b(p)}),onPointerDown:ie(s.onPointerDown,p=>{u.current=p.pointerType;const g=p.target;g.hasPointerCapture(p.pointerId)&&g.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(b(p),p.preventDefault())}),onKeyDown:ie(s.onKeyDown,p=>{const g=h.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&v(p.key),!(g&&p.key===" ")&&Ew.includes(p.key)&&(b(),p.preventDefault())})})})});Yu.displayName=zu;var qu="SelectValue",Zu=m.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,children:o,placeholder:a="",...i}=e,c=Dr(qu,r),{onValueNodeHasChildrenChange:d}=c,u=o!==void 0,h=Ie(t,c.onValueNodeChange);return et(()=>{d(u)},[d,u]),l.jsx(we.span,{...i,ref:h,style:{pointerEvents:"none"},children:mf(c.value)?l.jsx(l.Fragment,{children:a}):o})});Zu.displayName=qu;var Dw="SelectIcon",Ku=m.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...s}=e;return l.jsx(we.span,{"aria-hidden":!0,...s,ref:t,children:n||"▼"})});Ku.displayName=Dw;var Iw="SelectPortal",Qu=e=>l.jsx(Xs,{asChild:!0,...e});Qu.displayName=Iw;var ln="SelectContent",Gu=m.forwardRef((e,t)=>{const r=Dr(ln,e.__scopeSelect),[n,s]=m.useState();if(et(()=>{s(new DocumentFragment)},[]),!r.open){const o=n;return o?ls.createPortal(l.jsx(Xu,{scope:e.__scopeSelect,children:l.jsx(Uo.Slot,{scope:e.__scopeSelect,children:l.jsx("div",{children:e.children})})}),o):null}return l.jsx(Ju,{...e,ref:t})});Gu.displayName=ln;var Dt=10,[Xu,Ir]=zn(ln),Fw="SelectContentImpl",Lw=Cn("SelectContent.RemoveScroll"),Ju=m.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:a,side:i,sideOffset:c,align:d,alignOffset:u,arrowPadding:h,collisionBoundary:v,collisionPadding:f,sticky:b,hideWhenDetached:p,avoidCollisions:g,...x}=e,y=Dr(ln,r),[w,k]=m.useState(null),[E,M]=m.useState(null),O=Ie(t,q=>k(q)),[P,F]=m.useState(null),[W,G]=m.useState(null),D=Ho(r),[U,L]=m.useState(!1),J=m.useRef(!1);m.useEffect(()=>{if(w)return Ou(w)},[w]),_u();const Y=m.useCallback(q=>{const[ke,...Ae]=D().map(be=>be.ref.current),[ye]=Ae.slice(-1),me=document.activeElement;for(const be of q)if(be===me||(be==null||be.scrollIntoView({block:"nearest"}),be===ke&&E&&(E.scrollTop=0),be===ye&&E&&(E.scrollTop=E.scrollHeight),be==null||be.focus(),document.activeElement!==me))return},[D,E]),I=m.useCallback(()=>Y([P,w]),[Y,P,w]);m.useEffect(()=>{U&&I()},[U,I]);const{onOpenChange:A,triggerPointerDownPosRef:B}=y;m.useEffect(()=>{if(w){let q={x:0,y:0};const ke=ye=>{var me,be;q={x:Math.abs(Math.round(ye.pageX)-(((me=B.current)==null?void 0:me.x)??0)),y:Math.abs(Math.round(ye.pageY)-(((be=B.current)==null?void 0:be.y)??0))}},Ae=ye=>{q.x<=10&&q.y<=10?ye.preventDefault():w.contains(ye.target)||A(!1),document.removeEventListener("pointermove",ke),B.current=null};return B.current!==null&&(document.addEventListener("pointermove",ke),document.addEventListener("pointerup",Ae,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ke),document.removeEventListener("pointerup",Ae,{capture:!0})}}},[w,A,B]),m.useEffect(()=>{const q=()=>A(!1);return window.addEventListener("blur",q),window.addEventListener("resize",q),()=>{window.removeEventListener("blur",q),window.removeEventListener("resize",q)}},[A]);const[ae,Se]=vf(q=>{const ke=D().filter(me=>!me.disabled),Ae=ke.find(me=>me.ref.current===document.activeElement),ye=gf(ke,q,Ae);ye&&setTimeout(()=>ye.ref.current.focus())}),de=m.useCallback((q,ke,Ae)=>{const ye=!J.current&&!Ae;(y.value!==void 0&&y.value===ke||ye)&&(F(q),ye&&(J.current=!0))},[y.value]),ue=m.useCallback(()=>w==null?void 0:w.focus(),[w]),pe=m.useCallback((q,ke,Ae)=>{const ye=!J.current&&!Ae;(y.value!==void 0&&y.value===ke||ye)&&G(q)},[y.value]),Fe=n==="popper"?wi:Ru,rt=Fe===wi?{side:i,sideOffset:c,align:d,alignOffset:u,arrowPadding:h,collisionBoundary:v,collisionPadding:f,sticky:b,hideWhenDetached:p,avoidCollisions:g}:{};return l.jsx(Xu,{scope:r,content:w,viewport:E,onViewportChange:M,itemRefCallback:de,selectedItem:P,onItemLeave:ue,itemTextRefCallback:pe,focusSelectedItem:I,selectedItemText:W,position:n,isPositioned:U,searchRef:ae,children:l.jsx(bi,{as:Lw,allowPinchZoom:!0,children:l.jsx(hi,{asChild:!0,trapped:y.open,onMountAutoFocus:q=>{q.preventDefault()},onUnmountAutoFocus:ie(s,q=>{var ke;(ke=y.trigger)==null||ke.focus({preventScroll:!0}),q.preventDefault()}),children:l.jsx(ds,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:q=>q.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:l.jsx(Fe,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:q=>q.preventDefault(),...x,...rt,onPlaced:()=>L(!0),ref:O,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:ie(x.onKeyDown,q=>{const ke=q.ctrlKey||q.altKey||q.metaKey;if(q.key==="Tab"&&q.preventDefault(),!ke&&q.key.length===1&&Se(q.key),["ArrowUp","ArrowDown","Home","End"].includes(q.key)){let ye=D().filter(me=>!me.disabled).map(me=>me.ref.current);if(["ArrowUp","End"].includes(q.key)&&(ye=ye.slice().reverse()),["ArrowUp","ArrowDown"].includes(q.key)){const me=q.target,be=ye.indexOf(me);ye=ye.slice(be+1)}setTimeout(()=>Y(ye)),q.preventDefault()}})})})})})})});Ju.displayName=Fw;var Vw="SelectItemAlignedPosition",Ru=m.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...s}=e,o=Dr(ln,r),a=Ir(ln,r),[i,c]=m.useState(null),[d,u]=m.useState(null),h=Ie(t,O=>u(O)),v=Ho(r),f=m.useRef(!1),b=m.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:x,focusSelectedItem:y}=a,w=m.useCallback(()=>{if(o.trigger&&o.valueNode&&i&&d&&p&&g&&x){const O=o.trigger.getBoundingClientRect(),P=d.getBoundingClientRect(),F=o.valueNode.getBoundingClientRect(),W=x.getBoundingClientRect();if(o.dir!=="rtl"){const me=W.left-P.left,be=F.left-me,Re=O.left-be,dt=O.width+Re,Rt=Math.max(dt,P.width),er=window.innerWidth-Dt,mr=xu(be,[Dt,Math.max(Dt,er-Rt)]);i.style.minWidth=dt+"px",i.style.left=mr+"px"}else{const me=P.right-W.right,be=window.innerWidth-F.right-me,Re=window.innerWidth-O.right-be,dt=O.width+Re,Rt=Math.max(dt,P.width),er=window.innerWidth-Dt,mr=xu(be,[Dt,Math.max(Dt,er-Rt)]);i.style.minWidth=dt+"px",i.style.right=mr+"px"}const G=v(),D=window.innerHeight-Dt*2,U=p.scrollHeight,L=window.getComputedStyle(d),J=parseInt(L.borderTopWidth,10),Y=parseInt(L.paddingTop,10),I=parseInt(L.borderBottomWidth,10),A=parseInt(L.paddingBottom,10),B=J+Y+U+A+I,ae=Math.min(g.offsetHeight*5,B),Se=window.getComputedStyle(p),de=parseInt(Se.paddingTop,10),ue=parseInt(Se.paddingBottom,10),pe=O.top+O.height/2-Dt,Fe=D-pe,rt=g.offsetHeight/2,q=g.offsetTop+rt,ke=J+Y+q,Ae=B-ke;if(ke<=pe){const me=G.length>0&&g===G[G.length-1].ref.current;i.style.bottom="0px";const be=d.clientHeight-p.offsetTop-p.offsetHeight,Re=Math.max(Fe,rt+(me?ue:0)+be+I),dt=ke+Re;i.style.height=dt+"px"}else{const me=G.length>0&&g===G[0].ref.current;i.style.top="0px";const Re=Math.max(pe,J+p.offsetTop+(me?de:0)+rt)+Ae;i.style.height=Re+"px",p.scrollTop=ke-pe+p.offsetTop}i.style.margin=`${Dt}px 0`,i.style.minHeight=ae+"px",i.style.maxHeight=D+"px",n==null||n(),requestAnimationFrame(()=>f.current=!0)}},[v,o.trigger,o.valueNode,i,d,p,g,x,o.dir,n]);et(()=>w(),[w]);const[k,E]=m.useState();et(()=>{d&&E(window.getComputedStyle(d).zIndex)},[d]);const M=m.useCallback(O=>{O&&b.current===!0&&(w(),y==null||y(),b.current=!1)},[w,y]);return l.jsx(Bw,{scope:r,contentWrapper:i,shouldExpandOnScrollRef:f,onScrollButtonChange:M,children:l.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:l.jsx(we.div,{...s,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});Ru.displayName=Vw;var $w="SelectPopperPosition",wi=m.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:s=Dt,...o}=e,a=zo(r);return l.jsx(Aa,{...a,...o,ref:t,align:n,collisionPadding:s,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});wi.displayName=$w;var[Bw,xi]=zn(ln,{}),_i="SelectViewport",ef=m.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...s}=e,o=Ir(_i,r),a=xi(_i,r),i=Ie(t,o.onViewportChange),c=m.useRef(0);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),l.jsx(Uo.Slot,{scope:r,children:l.jsx(we.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:i,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:ie(s.onScroll,d=>{const u=d.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:v}=a;if(v!=null&&v.current&&h){const f=Math.abs(c.current-u.scrollTop);if(f>0){const b=window.innerHeight-Dt*2,p=parseFloat(h.style.minHeight),g=parseFloat(h.style.height),x=Math.max(p,g);if(x<b){const y=x+f,w=Math.min(b,y),k=y-w;h.style.height=w+"px",h.style.bottom==="0px"&&(u.scrollTop=k>0?k:0,h.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});ef.displayName=_i;var tf="SelectGroup",[Ww,jw]=zn(tf),Uw=m.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=so();return l.jsx(Ww,{scope:r,id:s,children:l.jsx(we.div,{role:"group","aria-labelledby":s,...n,ref:t})})});Uw.displayName=tf;var rf="SelectLabel",nf=m.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=jw(rf,r);return l.jsx(we.div,{id:s.id,...n,ref:t})});nf.displayName=rf;var Yo="SelectItem",[Hw,sf]=zn(Yo),of=m.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:s=!1,textValue:o,...a}=e,i=Dr(Yo,r),c=Ir(Yo,r),d=i.value===n,[u,h]=m.useState(o??""),[v,f]=m.useState(!1),b=Ie(t,y=>{var w;return(w=c.itemRefCallback)==null?void 0:w.call(c,y,n,s)}),p=so(),g=m.useRef("touch"),x=()=>{s||(i.onValueChange(n),i.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return l.jsx(Hw,{scope:r,value:n,disabled:s,textId:p,isSelected:d,onItemTextChange:m.useCallback(y=>{h(w=>w||((y==null?void 0:y.textContent)??"").trim())},[]),children:l.jsx(Uo.ItemSlot,{scope:r,value:n,disabled:s,textValue:u,children:l.jsx(we.div,{role:"option","aria-labelledby":p,"data-highlighted":v?"":void 0,"aria-selected":d&&v,"data-state":d?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...a,ref:b,onFocus:ie(a.onFocus,()=>f(!0)),onBlur:ie(a.onBlur,()=>f(!1)),onClick:ie(a.onClick,()=>{g.current!=="mouse"&&x()}),onPointerUp:ie(a.onPointerUp,()=>{g.current==="mouse"&&x()}),onPointerDown:ie(a.onPointerDown,y=>{g.current=y.pointerType}),onPointerMove:ie(a.onPointerMove,y=>{var w;g.current=y.pointerType,s?(w=c.onItemLeave)==null||w.call(c):g.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ie(a.onPointerLeave,y=>{var w;y.currentTarget===document.activeElement&&((w=c.onItemLeave)==null||w.call(c))}),onKeyDown:ie(a.onKeyDown,y=>{var k;((k=c.searchRef)==null?void 0:k.current)!==""&&y.key===" "||(Pw.includes(y.key)&&x(),y.key===" "&&y.preventDefault())})})})})});of.displayName=Yo;var Is="SelectItemText",af=m.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,...o}=e,a=Dr(Is,r),i=Ir(Is,r),c=sf(Is,r),d=Aw(Is,r),[u,h]=m.useState(null),v=Ie(t,x=>h(x),c.onItemTextChange,x=>{var y;return(y=i.itemTextRefCallback)==null?void 0:y.call(i,x,c.value,c.disabled)}),f=u==null?void 0:u.textContent,b=m.useMemo(()=>l.jsx("option",{value:c.value,disabled:c.disabled,children:f},c.value),[c.disabled,c.value,f]),{onNativeOptionAdd:p,onNativeOptionRemove:g}=d;return et(()=>(p(b),()=>g(b)),[p,g,b]),l.jsxs(l.Fragment,{children:[l.jsx(we.span,{id:c.textId,...o,ref:v}),c.isSelected&&a.valueNode&&!a.valueNodeHasChildren?ls.createPortal(o.children,a.valueNode):null]})});af.displayName=Is;var lf="SelectItemIndicator",cf=m.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return sf(lf,r).isSelected?l.jsx(we.span,{"aria-hidden":!0,...n,ref:t}):null});cf.displayName=lf;var Ci="SelectScrollUpButton",df=m.forwardRef((e,t)=>{const r=Ir(Ci,e.__scopeSelect),n=xi(Ci,e.__scopeSelect),[s,o]=m.useState(!1),a=Ie(t,n.onScrollButtonChange);return et(()=>{if(r.viewport&&r.isPositioned){let i=function(){const d=c.scrollTop>0;o(d)};const c=r.viewport;return i(),c.addEventListener("scroll",i),()=>c.removeEventListener("scroll",i)}},[r.viewport,r.isPositioned]),s?l.jsx(ff,{...e,ref:a,onAutoScroll:()=>{const{viewport:i,selectedItem:c}=r;i&&c&&(i.scrollTop=i.scrollTop-c.offsetHeight)}}):null});df.displayName=Ci;var Si="SelectScrollDownButton",uf=m.forwardRef((e,t)=>{const r=Ir(Si,e.__scopeSelect),n=xi(Si,e.__scopeSelect),[s,o]=m.useState(!1),a=Ie(t,n.onScrollButtonChange);return et(()=>{if(r.viewport&&r.isPositioned){let i=function(){const d=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<d;o(u)};const c=r.viewport;return i(),c.addEventListener("scroll",i),()=>c.removeEventListener("scroll",i)}},[r.viewport,r.isPositioned]),s?l.jsx(ff,{...e,ref:a,onAutoScroll:()=>{const{viewport:i,selectedItem:c}=r;i&&c&&(i.scrollTop=i.scrollTop+c.offsetHeight)}}):null});uf.displayName=Si;var ff=m.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...s}=e,o=Ir("SelectScrollButton",r),a=m.useRef(null),i=Ho(r),c=m.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return m.useEffect(()=>()=>c(),[c]),et(()=>{var u;const d=i().find(h=>h.ref.current===document.activeElement);(u=d==null?void 0:d.ref.current)==null||u.scrollIntoView({block:"nearest"})},[i]),l.jsx(we.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:ie(s.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(n,50))}),onPointerMove:ie(s.onPointerMove,()=>{var d;(d=o.onItemLeave)==null||d.call(o),a.current===null&&(a.current=window.setInterval(n,50))}),onPointerLeave:ie(s.onPointerLeave,()=>{c()})})}),zw="SelectSeparator",hf=m.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return l.jsx(we.div,{"aria-hidden":!0,...n,ref:t})});hf.displayName=zw;var ki="SelectArrow",Yw=m.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=zo(r),o=Dr(ki,r),a=Ir(ki,r);return o.open&&a.position==="popper"?l.jsx(Da,{...s,...n,ref:t}):null});Yw.displayName=ki;var qw="SelectBubbleInput",pf=m.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const s=m.useRef(null),o=Ie(n,s),a=jb(t);return m.useEffect(()=>{const i=s.current;if(!i)return;const c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==t&&u){const h=new Event("change",{bubbles:!0});u.call(i,t),i.dispatchEvent(h)}},[a,t]),l.jsx(we.select,{...r,style:{...xl,...r.style},ref:o,defaultValue:t})});pf.displayName=qw;function mf(e){return e===""||e===void 0}function vf(e){const t=Et(e),r=m.useRef(""),n=m.useRef(0),s=m.useCallback(a=>{const i=r.current+a;t(i),function c(d){r.current=d,window.clearTimeout(n.current),d!==""&&(n.current=window.setTimeout(()=>c(""),1e3))}(i)},[t]),o=m.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,s,o]}function gf(e,t,r){const s=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let a=Zw(e,Math.max(o,0));s.length===1&&(a=a.filter(d=>d!==r));const c=a.find(d=>d.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==r?c:void 0}function Zw(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Kw=Hu,yf=Yu,Qw=Zu,Gw=Ku,Xw=Qu,bf=Gu,Jw=ef,wf=nf,xf=of,Rw=af,e0=cf,_f=df,Cf=uf,Sf=hf;const cn=Kw,dn=Qw,Fr=m.forwardRef(({className:e,children:t,...r},n)=>l.jsxs(yf,{ref:n,className:he("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,l.jsx(Gw,{asChild:!0,children:l.jsx(Gl,{className:"h-4 w-4 opacity-50"})})]}));Fr.displayName=yf.displayName;const kf=m.forwardRef(({className:e,...t},r)=>l.jsx(_f,{ref:r,className:he("flex cursor-default items-center justify-center py-1",e),...t,children:l.jsx(Vp,{className:"h-4 w-4"})}));kf.displayName=_f.displayName;const Nf=m.forwardRef(({className:e,...t},r)=>l.jsx(Cf,{ref:r,className:he("flex cursor-default items-center justify-center py-1",e),...t,children:l.jsx(Gl,{className:"h-4 w-4"})}));Nf.displayName=Cf.displayName;const Lr=m.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>l.jsx(Xw,{children:l.jsxs(bf,{ref:s,className:he("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[l.jsx(kf,{}),l.jsx(Jw,{className:he("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),l.jsx(Nf,{})]})}));Lr.displayName=bf.displayName;const t0=m.forwardRef(({className:e,...t},r)=>l.jsx(wf,{ref:r,className:he("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));t0.displayName=wf.displayName;const re=m.forwardRef(({className:e,children:t,...r},n)=>l.jsxs(xf,{ref:n,className:he("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(e0,{children:l.jsx(Ql,{className:"h-4 w-4"})})}),l.jsx(Rw,{children:t})]}));re.displayName=xf.displayName;const r0=m.forwardRef(({className:e,...t},r)=>l.jsx(Sf,{ref:r,className:he("-mx-1 my-1 h-px bg-muted",e),...t}));r0.displayName=Sf.displayName;const n0=As({industry:Xe().min(1,"Industry is required"),business_model:Xe().min(1,"Business model is required"),annual_sales_volume:Xe().min(1,"Annual sales volume is required"),website_url:Xe().url("Please enter a valid URL").optional().or(Pb(""))}),s0=({data:e,onDataChange:t,onContinue:r,onBack:n,renderProgress:s})=>{const o=Ss({resolver:ks(n0),defaultValues:{industry:e.industry,business_model:e.business_model,annual_sales_volume:e.annual_sales_volume,website_url:e.website_url}}),a=i=>{t(i),r()};return l.jsxs(st,{className:"w-full max-w-2xl mx-auto",children:[l.jsx(kr,{children:l.jsx(Nr,{title:"Company Activity",subTitle:"Tell us about your business operations",onBack:n})}),l.jsxs(ot,{children:[l.jsx(Ds,{...o,children:l.jsxs("form",{onSubmit:o.handleSubmit(a),className:"space-y-6",children:[l.jsx(qe,{control:o.control,name:"industry",render:({field:i})=>l.jsxs($e,{children:[l.jsx(Be,{children:"Industry"}),l.jsxs(cn,{onValueChange:i.onChange,defaultValue:i.value,children:[l.jsx(We,{children:l.jsx(Fr,{children:l.jsx(dn,{placeholder:"Select industry"})})}),l.jsxs(Lr,{children:[l.jsx(re,{value:"technology",children:"Technology"}),l.jsx(re,{value:"finance",children:"Finance"}),l.jsx(re,{value:"healthcare",children:"Healthcare"}),l.jsx(re,{value:"retail",children:"Retail"}),l.jsx(re,{value:"manufacturing",children:"Manufacturing"}),l.jsx(re,{value:"education",children:"Education"}),l.jsx(re,{value:"hospitality",children:"Hospitality"}),l.jsx(re,{value:"real-estate",children:"Real Estate"}),l.jsx(re,{value:"consulting",children:"Consulting"}),l.jsx(re,{value:"other",children:"Other"})]})]}),l.jsx(je,{})]})}),l.jsx(qe,{control:o.control,name:"business_model",render:({field:i})=>l.jsxs($e,{children:[l.jsx(Be,{children:"Business Model"}),l.jsxs(cn,{onValueChange:i.onChange,defaultValue:i.value,children:[l.jsx(We,{children:l.jsx(Fr,{children:l.jsx(dn,{placeholder:"Select business model"})})}),l.jsxs(Lr,{children:[l.jsx(re,{value:"b2b",children:"B2B (Business to Business)"}),l.jsx(re,{value:"b2c",children:"B2C (Business to Consumer)"}),l.jsx(re,{value:"b2b2c",children:"B2B2C (Business to Business to Consumer)"}),l.jsx(re,{value:"marketplace",children:"Marketplace"}),l.jsx(re,{value:"saas",children:"SaaS (Software as a Service)"}),l.jsx(re,{value:"subscription",children:"Subscription"}),l.jsx(re,{value:"freemium",children:"Freemium"}),l.jsx(re,{value:"other",children:"Other"})]})]}),l.jsx(je,{})]})}),l.jsx(qe,{control:o.control,name:"annual_sales_volume",render:({field:i})=>l.jsxs($e,{children:[l.jsx(Be,{children:"Annual Sales Volume (USD)"}),l.jsxs(cn,{onValueChange:i.onChange,defaultValue:i.value,children:[l.jsx(We,{children:l.jsx(Fr,{children:l.jsx(dn,{placeholder:"Select annual sales volume"})})}),l.jsxs(Lr,{children:[l.jsx(re,{value:"0-50k",children:"$0 - $50,000"}),l.jsx(re,{value:"50k-100k",children:"$50,000 - $100,000"}),l.jsx(re,{value:"100k-500k",children:"$100,000 - $500,000"}),l.jsx(re,{value:"500k-1m",children:"$500,000 - $1,000,000"}),l.jsx(re,{value:"1m-5m",children:"$1,000,000 - $5,000,000"}),l.jsx(re,{value:"5m-10m",children:"$5,000,000 - $10,000,000"}),l.jsx(re,{value:"10m+",children:"$10,000,000+"})]})]}),l.jsx(je,{})]})}),l.jsx(qe,{control:o.control,name:"website_url",render:({field:i})=>l.jsxs($e,{children:[l.jsx(Be,{children:"Website URL (Optional)"}),l.jsx(We,{children:l.jsx(ft,{placeholder:"https://www.yourcompany.com",...i})}),l.jsx(je,{})]})}),l.jsx(He,{type:"submit",className:"w-full",children:"Continue"})]})}),l.jsx("div",{className:"mt-6",children:s()})]})]})},o0=As({street:Xe().min(1,"Street is required"),number:Xe().min(1,"Number is required"),postal_code:Xe().min(1,"Postal code is required"),city:Xe().min(1,"City is required"),address_country:Xe().min(1,"Country is required"),state:Xe()}),a0=({data:e,onDataChange:t,onContinue:r,onBack:n,renderProgress:s})=>{const o=Ss({resolver:ks(o0),defaultValues:{street:e.street,number:e.number,postal_code:e.postal_code,city:e.city,address_country:e.address_country,state:e.state}}),a=i=>{t(i),r()};return l.jsxs(st,{className:"w-full max-w-2xl mx-auto",children:[l.jsx(kr,{children:l.jsx(Nr,{title:"Business Address",subTitle:"Please provide your business address",onBack:n})}),l.jsxs(ot,{children:[l.jsx(Ds,{...o,children:l.jsxs("form",{onSubmit:o.handleSubmit(a),className:"space-y-6",children:[l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[l.jsx(qe,{control:o.control,name:"street",render:({field:i})=>l.jsxs($e,{children:[l.jsx(Be,{children:"Street"}),l.jsx(We,{children:l.jsx(ft,{placeholder:"Enter street name",...i})}),l.jsx(je,{})]})}),l.jsx(qe,{control:o.control,name:"number",render:({field:i})=>l.jsxs($e,{children:[l.jsx(Be,{children:"Suite / Unit Number"}),l.jsx(We,{children:l.jsx(ft,{placeholder:"Enter suite / unit",...i})}),l.jsx(je,{})]})})]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[l.jsx(qe,{control:o.control,name:"postal_code",render:({field:i})=>l.jsxs($e,{children:[l.jsx(Be,{children:"Zip Code / Postal Code"}),l.jsx(We,{children:l.jsx(ft,{placeholder:"Enter zip/postal code",...i})}),l.jsx(je,{})]})}),l.jsx(qe,{control:o.control,name:"city",render:({field:i})=>l.jsxs($e,{children:[l.jsx(Be,{children:"City"}),l.jsx(We,{children:l.jsx(ft,{placeholder:"Enter city",...i})}),l.jsx(je,{})]})})]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[l.jsx(qe,{control:o.control,name:"address_country",render:({field:i})=>l.jsxs($e,{children:[l.jsx(Be,{children:"Country"}),l.jsxs(cn,{onValueChange:i.onChange,defaultValue:i.value,children:[l.jsx(We,{children:l.jsx(Fr,{children:l.jsx(dn,{placeholder:"Select country"})})}),l.jsxs(Lr,{children:[l.jsx(re,{value:"us",children:"United States"}),l.jsx(re,{value:"uk",children:"United Kingdom"}),l.jsx(re,{value:"ca",children:"Canada"}),l.jsx(re,{value:"au",children:"Australia"}),l.jsx(re,{value:"de",children:"Germany"}),l.jsx(re,{value:"fr",children:"France"}),l.jsx(re,{value:"other",children:"Other"})]})]}),l.jsx(je,{})]})}),l.jsx(qe,{control:o.control,name:"state",render:({field:i})=>l.jsxs($e,{children:[l.jsx(Be,{children:"State / Province"}),l.jsx(We,{children:l.jsx(ft,{placeholder:"Enter state / province",...i})}),l.jsx(je,{})]})})]}),l.jsx(He,{type:"submit",className:"w-full",children:"Continue"})]})}),l.jsx("div",{className:"mt-6",children:s()})]})]})};function _e(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function Ct(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function it(e,t){const r=_e(e);return isNaN(t)?Ct(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function It(e,t){const r=_e(e);if(isNaN(t))return Ct(e,NaN);if(!t)return r;const n=r.getDate(),s=Ct(e,r.getTime());s.setMonth(r.getMonth()+t+1,0);const o=s.getDate();return n>=o?s:(r.setFullYear(s.getFullYear(),s.getMonth(),n),r)}const Ni=6048e5,i0=864e5;let l0={};function Fs(){return l0}function Kt(e,t){var i,c,d,u;const r=Fs(),n=(t==null?void 0:t.weekStartsOn)??((c=(i=t==null?void 0:t.locale)==null?void 0:i.options)==null?void 0:c.weekStartsOn)??r.weekStartsOn??((u=(d=r.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,s=_e(e),o=s.getDay(),a=(o<n?7:0)+o-n;return s.setDate(s.getDate()-a),s.setHours(0,0,0,0),s}function un(e){return Kt(e,{weekStartsOn:1})}function Ef(e){const t=_e(e),r=t.getFullYear(),n=Ct(e,0);n.setFullYear(r+1,0,4),n.setHours(0,0,0,0);const s=un(n),o=Ct(e,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);const a=un(o);return t.getTime()>=s.getTime()?r+1:t.getTime()>=a.getTime()?r:r-1}function Yn(e){const t=_e(e);return t.setHours(0,0,0,0),t}function qo(e){const t=_e(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function Qt(e,t){const r=Yn(e),n=Yn(t),s=+r-qo(r),o=+n-qo(n);return Math.round((s-o)/i0)}function c0(e){const t=Ef(e),r=Ct(e,0);return r.setFullYear(t,0,4),r.setHours(0,0,0,0),un(r)}function Ei(e,t){const r=t*7;return it(e,r)}function d0(e,t){return It(e,t*12)}function u0(e){let t;return e.forEach(function(r){const n=_e(r);(t===void 0||t<n||isNaN(Number(n)))&&(t=n)}),t||new Date(NaN)}function f0(e){let t;return e.forEach(r=>{const n=_e(r);(!t||t>n||isNaN(+n))&&(t=n)}),t||new Date(NaN)}function pt(e,t){const r=Yn(e),n=Yn(t);return+r==+n}function Pi(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function h0(e){if(!Pi(e)&&typeof e!="number")return!1;const t=_e(e);return!isNaN(Number(t))}function Ls(e,t){const r=_e(e),n=_e(t),s=r.getFullYear()-n.getFullYear(),o=r.getMonth()-n.getMonth();return s*12+o}function p0(e,t,r){const n=Kt(e,r),s=Kt(t,r),o=+n-qo(n),a=+s-qo(s);return Math.round((o-a)/Ni)}function Ti(e){const t=_e(e),r=t.getMonth();return t.setFullYear(t.getFullYear(),r+1,0),t.setHours(23,59,59,999),t}function mt(e){const t=_e(e);return t.setDate(1),t.setHours(0,0,0,0),t}function Pf(e){const t=_e(e),r=Ct(e,0);return r.setFullYear(t.getFullYear(),0,1),r.setHours(0,0,0,0),r}function Oi(e,t){var i,c,d,u;const r=Fs(),n=(t==null?void 0:t.weekStartsOn)??((c=(i=t==null?void 0:t.locale)==null?void 0:i.options)==null?void 0:c.weekStartsOn)??r.weekStartsOn??((u=(d=r.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,s=_e(e),o=s.getDay(),a=(o<n?-7:0)+6-(o-n);return s.setDate(s.getDate()+a),s.setHours(23,59,59,999),s}function Tf(e){return Oi(e,{weekStartsOn:1})}const m0={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},v0=(e,t,r)=>{let n;const s=m0[e];return typeof s=="string"?n=s:t===1?n=s.one:n=s.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function Mi(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const g0={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},y0={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},b0={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},w0={date:Mi({formats:g0,defaultWidth:"full"}),time:Mi({formats:y0,defaultWidth:"full"}),dateTime:Mi({formats:b0,defaultWidth:"full"})},x0={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},_0=(e,t,r,n)=>x0[e];function Vs(e){return(t,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let s;if(n==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,i=r!=null&&r.width?String(r.width):a;s=e.formattingValues[i]||e.formattingValues[a]}else{const a=e.defaultWidth,i=r!=null&&r.width?String(r.width):e.defaultWidth;s=e.values[i]||e.values[a]}const o=e.argumentCallback?e.argumentCallback(t):t;return s[o]}}const C0={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},S0={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},k0={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},N0={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},E0={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},P0={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},T0={ordinalNumber:(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:Vs({values:C0,defaultWidth:"wide"}),quarter:Vs({values:S0,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Vs({values:k0,defaultWidth:"wide"}),day:Vs({values:N0,defaultWidth:"wide"}),dayPeriod:Vs({values:E0,defaultWidth:"wide",formattingValues:P0,defaultFormattingWidth:"wide"})};function $s(e){return(t,r={})=>{const n=r.width,s=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],o=t.match(s);if(!o)return null;const a=o[0],i=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(i)?M0(i,h=>h.test(a)):O0(i,h=>h.test(a));let d;d=e.valueCallback?e.valueCallback(c):c,d=r.valueCallback?r.valueCallback(d):d;const u=t.slice(a.length);return{value:d,rest:u}}}function O0(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function M0(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function A0(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const s=n[0],o=t.match(e.parsePattern);if(!o)return null;let a=e.valueCallback?e.valueCallback(o[0]):o[0];a=r.valueCallback?r.valueCallback(a):a;const i=t.slice(s.length);return{value:a,rest:i}}}const D0=/^(\d+)(th|st|nd|rd)?/i,I0=/\d+/i,F0={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},L0={any:[/^b/i,/^(a|c)/i]},V0={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},$0={any:[/1/i,/2/i,/3/i,/4/i]},B0={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},W0={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},j0={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},U0={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},H0={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},z0={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Y0={ordinalNumber:A0({matchPattern:D0,parsePattern:I0,valueCallback:e=>parseInt(e,10)}),era:$s({matchPatterns:F0,defaultMatchWidth:"wide",parsePatterns:L0,defaultParseWidth:"any"}),quarter:$s({matchPatterns:V0,defaultMatchWidth:"wide",parsePatterns:$0,defaultParseWidth:"any",valueCallback:e=>e+1}),month:$s({matchPatterns:B0,defaultMatchWidth:"wide",parsePatterns:W0,defaultParseWidth:"any"}),day:$s({matchPatterns:j0,defaultMatchWidth:"wide",parsePatterns:U0,defaultParseWidth:"any"}),dayPeriod:$s({matchPatterns:H0,defaultMatchWidth:"any",parsePatterns:z0,defaultParseWidth:"any"})},Of={code:"en-US",formatDistance:v0,formatLong:w0,formatRelative:_0,localize:T0,match:Y0,options:{weekStartsOn:0,firstWeekContainsDate:1}};function q0(e){const t=_e(e);return Qt(t,Pf(t))+1}function Mf(e){const t=_e(e),r=+un(t)-+c0(t);return Math.round(r/Ni)+1}function Af(e,t){var u,h,v,f;const r=_e(e),n=r.getFullYear(),s=Fs(),o=(t==null?void 0:t.firstWeekContainsDate)??((h=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??s.firstWeekContainsDate??((f=(v=s.locale)==null?void 0:v.options)==null?void 0:f.firstWeekContainsDate)??1,a=Ct(e,0);a.setFullYear(n+1,0,o),a.setHours(0,0,0,0);const i=Kt(a,t),c=Ct(e,0);c.setFullYear(n,0,o),c.setHours(0,0,0,0);const d=Kt(c,t);return r.getTime()>=i.getTime()?n+1:r.getTime()>=d.getTime()?n:n-1}function Z0(e,t){var i,c,d,u;const r=Fs(),n=(t==null?void 0:t.firstWeekContainsDate)??((c=(i=t==null?void 0:t.locale)==null?void 0:i.options)==null?void 0:c.firstWeekContainsDate)??r.firstWeekContainsDate??((u=(d=r.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,s=Af(e,t),o=Ct(e,0);return o.setFullYear(s,0,n),o.setHours(0,0,0,0),Kt(o,t)}function Df(e,t){const r=_e(e),n=+Kt(r,t)-+Z0(r,t);return Math.round(n/Ni)+1}function Pe(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const Vr={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return Pe(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):Pe(r+1,2)},d(e,t){return Pe(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return Pe(e.getHours()%12||12,t.length)},H(e,t){return Pe(e.getHours(),t.length)},m(e,t){return Pe(e.getMinutes(),t.length)},s(e,t){return Pe(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),s=Math.trunc(n*Math.pow(10,r-3));return Pe(s,t.length)}},qn={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},If={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const n=e.getFullYear(),s=n>0?n:1-n;return r.ordinalNumber(s,{unit:"year"})}return Vr.y(e,t)},Y:function(e,t,r,n){const s=Af(e,n),o=s>0?s:1-s;if(t==="YY"){const a=o%100;return Pe(a,2)}return t==="Yo"?r.ordinalNumber(o,{unit:"year"}):Pe(o,t.length)},R:function(e,t){const r=Ef(e);return Pe(r,t.length)},u:function(e,t){const r=e.getFullYear();return Pe(r,t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return Pe(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return Pe(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return Vr.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return Pe(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const s=Df(e,n);return t==="wo"?r.ordinalNumber(s,{unit:"week"}):Pe(s,t.length)},I:function(e,t,r){const n=Mf(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):Pe(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):Vr.d(e,t)},D:function(e,t,r){const n=q0(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):Pe(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const s=e.getDay(),o=(s-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return Pe(o,2);case"eo":return r.ordinalNumber(o,{unit:"day"});case"eee":return r.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(s,{width:"short",context:"formatting"});case"eeee":default:return r.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const s=e.getDay(),o=(s-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return Pe(o,t.length);case"co":return r.ordinalNumber(o,{unit:"day"});case"ccc":return r.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(s,{width:"narrow",context:"standalone"});case"cccccc":return r.day(s,{width:"short",context:"standalone"});case"cccc":default:return r.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),s=n===0?7:n;switch(t){case"i":return String(s);case"ii":return Pe(s,t.length);case"io":return r.ordinalNumber(s,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const s=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let s;switch(n===12?s=qn.noon:n===0?s=qn.midnight:s=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let s;switch(n>=17?s=qn.evening:n>=12?s=qn.afternoon:n>=4?s=qn.morning:s=qn.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let n=e.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return Vr.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):Vr.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):Pe(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):Pe(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):Vr.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):Vr.s(e,t)},S:function(e,t){return Vr.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return Lf(n);case"XXXX":case"XX":return fn(n);case"XXXXX":case"XXX":default:return fn(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return Lf(n);case"xxxx":case"xx":return fn(n);case"xxxxx":case"xxx":default:return fn(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Ff(n,":");case"OOOO":default:return"GMT"+fn(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Ff(n,":");case"zzzz":default:return"GMT"+fn(n,":")}},t:function(e,t,r){const n=Math.trunc(e.getTime()/1e3);return Pe(n,t.length)},T:function(e,t,r){const n=e.getTime();return Pe(n,t.length)}};function Ff(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),s=Math.trunc(n/60),o=n%60;return o===0?r+String(s):r+String(s)+t+Pe(o,2)}function Lf(e,t){return e%60===0?(e>0?"-":"+")+Pe(Math.abs(e)/60,2):fn(e,t)}function fn(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),s=Pe(Math.trunc(n/60),2),o=Pe(n%60,2);return r+s+t+o}const Vf=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},$f=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},K0={p:$f,P:(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],s=r[2];if(!s)return Vf(e,t);let o;switch(n){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",Vf(n,t)).replace("{{time}}",$f(s,t))}},Q0=/^D+$/,G0=/^Y+$/,X0=["D","DD","YY","YYYY"];function J0(e){return Q0.test(e)}function R0(e){return G0.test(e)}function ex(e,t,r){const n=tx(e,t,r);if(console.warn(n),X0.includes(e))throw new RangeError(n)}function tx(e,t,r){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const rx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,nx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,sx=/^'([^]*?)'?$/,ox=/''/g,ax=/[a-zA-Z]/;function cr(e,t,r){var u,h,v,f,b,p,g,x;const n=Fs(),s=(r==null?void 0:r.locale)??n.locale??Of,o=(r==null?void 0:r.firstWeekContainsDate)??((h=(u=r==null?void 0:r.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(v=n.locale)==null?void 0:v.options)==null?void 0:f.firstWeekContainsDate)??1,a=(r==null?void 0:r.weekStartsOn)??((p=(b=r==null?void 0:r.locale)==null?void 0:b.options)==null?void 0:p.weekStartsOn)??n.weekStartsOn??((x=(g=n.locale)==null?void 0:g.options)==null?void 0:x.weekStartsOn)??0,i=_e(e);if(!h0(i))throw new RangeError("Invalid time value");let c=t.match(nx).map(y=>{const w=y[0];if(w==="p"||w==="P"){const k=K0[w];return k(y,s.formatLong)}return y}).join("").match(rx).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const w=y[0];if(w==="'")return{isToken:!1,value:ix(y)};if(If[w])return{isToken:!0,value:y};if(w.match(ax))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:y}});s.localize.preprocessor&&(c=s.localize.preprocessor(i,c));const d={firstWeekContainsDate:o,weekStartsOn:a,locale:s};return c.map(y=>{if(!y.isToken)return y.value;const w=y.value;(!(r!=null&&r.useAdditionalWeekYearTokens)&&R0(w)||!(r!=null&&r.useAdditionalDayOfYearTokens)&&J0(w))&&ex(w,t,String(e));const k=If[w[0]];return k(i,w,s.localize,d)}).join("")}function ix(e){const t=e.match(sx);return t?t[1].replace(ox,"'"):e}function lx(e){const t=_e(e),r=t.getFullYear(),n=t.getMonth(),s=Ct(e,0);return s.setFullYear(r,n+1,0),s.setHours(0,0,0,0),s.getDate()}function cx(e){return Math.trunc(+_e(e)/1e3)}function dx(e){const t=_e(e),r=t.getMonth();return t.setFullYear(t.getFullYear(),r+1,0),t.setHours(0,0,0,0),t}function ux(e,t){return p0(dx(e),mt(e),t)+1}function Ai(e,t){const r=_e(e),n=_e(t);return r.getTime()>n.getTime()}function Bf(e,t){const r=_e(e),n=_e(t);return+r<+n}function Di(e,t){const r=_e(e),n=_e(t);return r.getFullYear()===n.getFullYear()&&r.getMonth()===n.getMonth()}function fx(e,t){const r=_e(e),n=_e(t);return r.getFullYear()===n.getFullYear()}function Ii(e,t){return it(e,-t)}function Fi(e,t){const r=_e(e),n=r.getFullYear(),s=r.getDate(),o=Ct(e,0);o.setFullYear(n,t,15),o.setHours(0,0,0,0);const a=lx(o);return r.setMonth(t,Math.min(s,a)),r}function Wf(e,t){const r=_e(e);return isNaN(+r)?Ct(e,NaN):(r.setFullYear(t),r)}var Zo="Popover",[jf,TC]=Rr(Zo,[On]),Bs=On(),[hx,$r]=jf(Zo),Uf=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:s,onOpenChange:o,modal:a=!1}=e,i=Bs(t),c=m.useRef(null),[d,u]=m.useState(!1),[h,v]=Rs({prop:n,defaultProp:s??!1,onChange:o,caller:Zo});return l.jsx(Yc,{...i,children:l.jsx(hx,{scope:t,contentId:so(),triggerRef:c,open:h,onOpenChange:v,onOpenToggle:m.useCallback(()=>v(f=>!f),[v]),hasCustomAnchor:d,onCustomAnchorAdd:m.useCallback(()=>u(!0),[]),onCustomAnchorRemove:m.useCallback(()=>u(!1),[]),modal:a,children:r})})};Uf.displayName=Zo;var Hf="PopoverAnchor",px=m.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=$r(Hf,r),o=Bs(r),{onCustomAnchorAdd:a,onCustomAnchorRemove:i}=s;return m.useEffect(()=>(a(),()=>i()),[a,i]),l.jsx(mo,{...o,...n,ref:t})});px.displayName=Hf;var zf="PopoverTrigger",Yf=m.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=$r(zf,r),o=Bs(r),a=Ie(t,s.triggerRef),i=l.jsx(we.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Gf(s.open),...n,ref:a,onClick:ie(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?i:l.jsx(mo,{asChild:!0,...o,children:i})});Yf.displayName=zf;var Li="PopoverPortal",[mx,vx]=jf(Li,{forceMount:void 0}),qf=e=>{const{__scopePopover:t,forceMount:r,children:n,container:s}=e,o=$r(Li,t);return l.jsx(mx,{scope:t,forceMount:r,children:l.jsx(us,{present:r||o.open,children:l.jsx(Xs,{asChild:!0,container:s,children:n})})})};qf.displayName=Li;var Zn="PopoverContent",Zf=m.forwardRef((e,t)=>{const r=vx(Zn,e.__scopePopover),{forceMount:n=r.forceMount,...s}=e,o=$r(Zn,e.__scopePopover);return l.jsx(us,{present:n||o.open,children:o.modal?l.jsx(yx,{...s,ref:t}):l.jsx(bx,{...s,ref:t})})});Zf.displayName=Zn;var gx=Cn("PopoverContent.RemoveScroll"),yx=m.forwardRef((e,t)=>{const r=$r(Zn,e.__scopePopover),n=m.useRef(null),s=Ie(t,n),o=m.useRef(!1);return m.useEffect(()=>{const a=n.current;if(a)return Ou(a)},[]),l.jsx(bi,{as:gx,allowPinchZoom:!0,children:l.jsx(Kf,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ie(e.onCloseAutoFocus,a=>{var i;a.preventDefault(),o.current||(i=r.triggerRef.current)==null||i.focus()}),onPointerDownOutside:ie(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,c=i.button===0&&i.ctrlKey===!0,d=i.button===2||c;o.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:ie(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),bx=m.forwardRef((e,t)=>{const r=$r(Zn,e.__scopePopover),n=m.useRef(!1),s=m.useRef(!1);return l.jsx(Kf,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a,i;(a=e.onCloseAutoFocus)==null||a.call(e,o),o.defaultPrevented||(n.current||(i=r.triggerRef.current)==null||i.focus(),o.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:o=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=o.target;((d=r.triggerRef.current)==null?void 0:d.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),Kf=m.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:u,...h}=e,v=$r(Zn,r),f=Bs(r);return _u(),l.jsx(hi,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:o,children:l.jsx(ds,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:u,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>v.onOpenChange(!1),children:l.jsx(Aa,{"data-state":Gf(v.open),role:"dialog",id:v.contentId,...f,...h,ref:t,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Qf="PopoverClose",wx=m.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=$r(Qf,r);return l.jsx(we.button,{type:"button",...n,ref:t,onClick:ie(e.onClick,()=>s.onOpenChange(!1))})});wx.displayName=Qf;var xx="PopoverArrow",_x=m.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=Bs(r);return l.jsx(Da,{...s,...n,ref:t})});_x.displayName=xx;function Gf(e){return e?"open":"closed"}var Cx=Uf,Sx=Yf,kx=qf,Xf=Zf;const Jf=Cx,Rf=Sx,Vi=m.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},s)=>l.jsx(kx,{children:l.jsx(Xf,{ref:s,align:t,sideOffset:r,className:he("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Vi.displayName=Xf.displayName;var te=function(){return te=Object.assign||function(t){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},te.apply(this,arguments)};function Nx(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}function eh(e,t,r){for(var n=0,s=t.length,o;n<s;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;function Ws(e){return e.mode==="multiple"}function js(e){return e.mode==="range"}function Ko(e){return e.mode==="single"}var Ex={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function Px(e,t){return cr(e,"LLLL y",t)}function Tx(e,t){return cr(e,"d",t)}function Ox(e,t){return cr(e,"LLLL",t)}function Mx(e){return"".concat(e)}function Ax(e,t){return cr(e,"cccccc",t)}function Dx(e,t){return cr(e,"yyyy",t)}var Ix=Object.freeze({__proto__:null,formatCaption:Px,formatDay:Tx,formatMonthCaption:Ox,formatWeekNumber:Mx,formatWeekdayName:Ax,formatYearCaption:Dx}),Fx=function(e,t,r){return cr(e,"do MMMM (EEEE)",r)},Lx=function(){return"Month: "},Vx=function(){return"Go to next month"},$x=function(){return"Go to previous month"},Bx=function(e,t){return cr(e,"cccc",t)},Wx=function(e){return"Week n. ".concat(e)},jx=function(){return"Year: "},Ux=Object.freeze({__proto__:null,labelDay:Fx,labelMonthDropdown:Lx,labelNext:Vx,labelPrevious:$x,labelWeekNumber:Wx,labelWeekday:Bx,labelYearDropdown:jx});function Hx(){var e="buttons",t=Ex,r=Of,n={},s={},o=1,a={},i=new Date;return{captionLayout:e,classNames:t,formatters:Ix,labels:Ux,locale:r,modifiersClassNames:n,modifiers:s,numberOfMonths:o,styles:a,today:i,mode:"default"}}function zx(e){var t=e.fromYear,r=e.toYear,n=e.fromMonth,s=e.toMonth,o=e.fromDate,a=e.toDate;return n?o=mt(n):t&&(o=new Date(t,0,1)),s?a=Ti(s):r&&(a=new Date(r,11,31)),{fromDate:o?Yn(o):void 0,toDate:a?Yn(a):void 0}}var th=S.createContext(void 0);function Yx(e){var t,r=e.initialProps,n=Hx(),s=zx(r),o=s.fromDate,a=s.toDate,i=(t=r.captionLayout)!==null&&t!==void 0?t:n.captionLayout;i!=="buttons"&&(!o||!a)&&(i="buttons");var c;(Ko(r)||Ws(r)||js(r))&&(c=r.onSelect);var d=te(te(te({},n),r),{captionLayout:i,classNames:te(te({},n.classNames),r.classNames),components:te({},r.components),formatters:te(te({},n.formatters),r.formatters),fromDate:o,labels:te(te({},n.labels),r.labels),mode:r.mode||n.mode,modifiers:te(te({},n.modifiers),r.modifiers),modifiersClassNames:te(te({},n.modifiersClassNames),r.modifiersClassNames),onSelect:c,styles:te(te({},n.styles),r.styles),toDate:a});return l.jsx(th.Provider,{value:d,children:e.children})}function Me(){var e=S.useContext(th);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function rh(e){var t=Me(),r=t.locale,n=t.classNames,s=t.styles,o=t.formatters.formatCaption;return l.jsx("div",{className:n.caption_label,style:s.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:o(e.displayMonth,{locale:r})})}function qx(e){return l.jsx("svg",te({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:l.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function nh(e){var t,r,n=e.onChange,s=e.value,o=e.children,a=e.caption,i=e.className,c=e.style,d=Me(),u=(r=(t=d.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&r!==void 0?r:qx;return l.jsxs("div",{className:i,style:c,children:[l.jsx("span",{className:d.classNames.vhidden,children:e["aria-label"]}),l.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:d.classNames.dropdown,style:d.styles.dropdown,value:s,onChange:n,children:o}),l.jsxs("div",{className:d.classNames.caption_label,style:d.styles.caption_label,"aria-hidden":"true",children:[a,l.jsx(u,{className:d.classNames.dropdown_icon,style:d.styles.dropdown_icon})]})]})}function Zx(e){var t,r=Me(),n=r.fromDate,s=r.toDate,o=r.styles,a=r.locale,i=r.formatters.formatMonthCaption,c=r.classNames,d=r.components,u=r.labels.labelMonthDropdown;if(!n)return l.jsx(l.Fragment,{});if(!s)return l.jsx(l.Fragment,{});var h=[];if(fx(n,s))for(var v=mt(n),f=n.getMonth();f<=s.getMonth();f++)h.push(Fi(v,f));else for(var v=mt(new Date),f=0;f<=11;f++)h.push(Fi(v,f));var b=function(g){var x=Number(g.target.value),y=Fi(mt(e.displayMonth),x);e.onChange(y)},p=(t=d==null?void 0:d.Dropdown)!==null&&t!==void 0?t:nh;return l.jsx(p,{name:"months","aria-label":u(),className:c.dropdown_month,style:o.dropdown_month,onChange:b,value:e.displayMonth.getMonth(),caption:i(e.displayMonth,{locale:a}),children:h.map(function(g){return l.jsx("option",{value:g.getMonth(),children:i(g,{locale:a})},g.getMonth())})})}function Kx(e){var t,r=e.displayMonth,n=Me(),s=n.fromDate,o=n.toDate,a=n.locale,i=n.styles,c=n.classNames,d=n.components,u=n.formatters.formatYearCaption,h=n.labels.labelYearDropdown,v=[];if(!s)return l.jsx(l.Fragment,{});if(!o)return l.jsx(l.Fragment,{});for(var f=s.getFullYear(),b=o.getFullYear(),p=f;p<=b;p++)v.push(Wf(Pf(new Date),p));var g=function(y){var w=Wf(mt(r),Number(y.target.value));e.onChange(w)},x=(t=d==null?void 0:d.Dropdown)!==null&&t!==void 0?t:nh;return l.jsx(x,{name:"years","aria-label":h(),className:c.dropdown_year,style:i.dropdown_year,onChange:g,value:r.getFullYear(),caption:u(r,{locale:a}),children:v.map(function(y){return l.jsx("option",{value:y.getFullYear(),children:u(y,{locale:a})},y.getFullYear())})})}function Qx(e,t){var r=S.useState(e),n=r[0],s=r[1],o=t===void 0?n:t;return[o,s]}function Gx(e){var t=e.month,r=e.defaultMonth,n=e.today,s=t||r||n||new Date,o=e.toDate,a=e.fromDate,i=e.numberOfMonths,c=i===void 0?1:i;if(o&&Ls(o,s)<0){var d=-1*(c-1);s=It(o,d)}return a&&Ls(s,a)<0&&(s=a),mt(s)}function Xx(){var e=Me(),t=Gx(e),r=Qx(t,e.month),n=r[0],s=r[1],o=function(a){var i;if(!e.disableNavigation){var c=mt(a);s(c),(i=e.onMonthChange)===null||i===void 0||i.call(e,c)}};return[n,o]}function Jx(e,t){for(var r=t.reverseMonths,n=t.numberOfMonths,s=mt(e),o=mt(It(s,n)),a=Ls(o,s),i=[],c=0;c<a;c++){var d=It(s,c);i.push(d)}return r&&(i=i.reverse()),i}function Rx(e,t){if(!t.disableNavigation){var r=t.toDate,n=t.pagedNavigation,s=t.numberOfMonths,o=s===void 0?1:s,a=n?o:1,i=mt(e);if(!r)return It(i,a);var c=Ls(r,e);if(!(c<o))return It(i,a)}}function e_(e,t){if(!t.disableNavigation){var r=t.fromDate,n=t.pagedNavigation,s=t.numberOfMonths,o=s===void 0?1:s,a=n?o:1,i=mt(e);if(!r)return It(i,-a);var c=Ls(i,r);if(!(c<=0))return It(i,-a)}}var sh=S.createContext(void 0);function t_(e){var t=Me(),r=Xx(),n=r[0],s=r[1],o=Jx(n,t),a=Rx(n,t),i=e_(n,t),c=function(h){return o.some(function(v){return Di(h,v)})},d=function(h,v){c(h)||(v&&Bf(h,v)?s(It(h,1+t.numberOfMonths*-1)):s(h))},u={currentMonth:n,displayMonths:o,goToMonth:s,goToDate:d,previousMonth:i,nextMonth:a,isDateDisplayed:c};return l.jsx(sh.Provider,{value:u,children:e.children})}function Us(){var e=S.useContext(sh);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function oh(e){var t,r=Me(),n=r.classNames,s=r.styles,o=r.components,a=Us().goToMonth,i=function(u){a(It(u,e.displayIndex?-e.displayIndex:0))},c=(t=o==null?void 0:o.CaptionLabel)!==null&&t!==void 0?t:rh,d=l.jsx(c,{id:e.id,displayMonth:e.displayMonth});return l.jsxs("div",{className:n.caption_dropdowns,style:s.caption_dropdowns,children:[l.jsx("div",{className:n.vhidden,children:d}),l.jsx(Zx,{onChange:i,displayMonth:e.displayMonth}),l.jsx(Kx,{onChange:i,displayMonth:e.displayMonth})]})}function r_(e){return l.jsx("svg",te({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:l.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function n_(e){return l.jsx("svg",te({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:l.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var Qo=S.forwardRef(function(e,t){var r=Me(),n=r.classNames,s=r.styles,o=[n.button_reset,n.button];e.className&&o.push(e.className);var a=o.join(" "),i=te(te({},s.button_reset),s.button);return e.style&&Object.assign(i,e.style),l.jsx("button",te({},e,{ref:t,type:"button",className:a,style:i}))});function s_(e){var t,r,n=Me(),s=n.dir,o=n.locale,a=n.classNames,i=n.styles,c=n.labels,d=c.labelPrevious,u=c.labelNext,h=n.components;if(!e.nextMonth&&!e.previousMonth)return l.jsx(l.Fragment,{});var v=d(e.previousMonth,{locale:o}),f=[a.nav_button,a.nav_button_previous].join(" "),b=u(e.nextMonth,{locale:o}),p=[a.nav_button,a.nav_button_next].join(" "),g=(t=h==null?void 0:h.IconRight)!==null&&t!==void 0?t:n_,x=(r=h==null?void 0:h.IconLeft)!==null&&r!==void 0?r:r_;return l.jsxs("div",{className:a.nav,style:i.nav,children:[!e.hidePrevious&&l.jsx(Qo,{name:"previous-month","aria-label":v,className:f,style:i.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:s==="rtl"?l.jsx(g,{className:a.nav_icon,style:i.nav_icon}):l.jsx(x,{className:a.nav_icon,style:i.nav_icon})}),!e.hideNext&&l.jsx(Qo,{name:"next-month","aria-label":b,className:p,style:i.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:s==="rtl"?l.jsx(x,{className:a.nav_icon,style:i.nav_icon}):l.jsx(g,{className:a.nav_icon,style:i.nav_icon})})]})}function ah(e){var t=Me().numberOfMonths,r=Us(),n=r.previousMonth,s=r.nextMonth,o=r.goToMonth,a=r.displayMonths,i=a.findIndex(function(b){return Di(e.displayMonth,b)}),c=i===0,d=i===a.length-1,u=t>1&&(c||!d),h=t>1&&(d||!c),v=function(){n&&o(n)},f=function(){s&&o(s)};return l.jsx(s_,{displayMonth:e.displayMonth,hideNext:u,hidePrevious:h,nextMonth:s,previousMonth:n,onPreviousClick:v,onNextClick:f})}function o_(e){var t,r=Me(),n=r.classNames,s=r.disableNavigation,o=r.styles,a=r.captionLayout,i=r.components,c=(t=i==null?void 0:i.CaptionLabel)!==null&&t!==void 0?t:rh,d;return s?d=l.jsx(c,{id:e.id,displayMonth:e.displayMonth}):a==="dropdown"?d=l.jsx(oh,{displayMonth:e.displayMonth,id:e.id}):a==="dropdown-buttons"?d=l.jsxs(l.Fragment,{children:[l.jsx(oh,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),l.jsx(ah,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):d=l.jsxs(l.Fragment,{children:[l.jsx(c,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),l.jsx(ah,{displayMonth:e.displayMonth,id:e.id})]}),l.jsx("div",{className:n.caption,style:o.caption,children:d})}function a_(e){var t=Me(),r=t.footer,n=t.styles,s=t.classNames.tfoot;return r?l.jsx("tfoot",{className:s,style:n.tfoot,children:l.jsx("tr",{children:l.jsx("td",{colSpan:8,children:r})})}):l.jsx(l.Fragment,{})}function i_(e,t,r){for(var n=r?un(new Date):Kt(new Date,{locale:e,weekStartsOn:t}),s=[],o=0;o<7;o++){var a=it(n,o);s.push(a)}return s}function l_(){var e=Me(),t=e.classNames,r=e.styles,n=e.showWeekNumber,s=e.locale,o=e.weekStartsOn,a=e.ISOWeek,i=e.formatters.formatWeekdayName,c=e.labels.labelWeekday,d=i_(s,o,a);return l.jsxs("tr",{style:r.head_row,className:t.head_row,children:[n&&l.jsx("td",{style:r.head_cell,className:t.head_cell}),d.map(function(u,h){return l.jsx("th",{scope:"col",className:t.head_cell,style:r.head_cell,"aria-label":c(u,{locale:s}),children:i(u,{locale:s})},h)})]})}function c_(){var e,t=Me(),r=t.classNames,n=t.styles,s=t.components,o=(e=s==null?void 0:s.HeadRow)!==null&&e!==void 0?e:l_;return l.jsx("thead",{style:n.head,className:r.head,children:l.jsx(o,{})})}function d_(e){var t=Me(),r=t.locale,n=t.formatters.formatDay;return l.jsx(l.Fragment,{children:n(e.date,{locale:r})})}var $i=S.createContext(void 0);function u_(e){if(!Ws(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return l.jsx($i.Provider,{value:t,children:e.children})}return l.jsx(f_,{initialProps:e.initialProps,children:e.children})}function f_(e){var t=e.initialProps,r=e.children,n=t.selected,s=t.min,o=t.max,a=function(d,u,h){var v,f;(v=t.onDayClick)===null||v===void 0||v.call(t,d,u,h);var b=!!(u.selected&&s&&(n==null?void 0:n.length)===s);if(!b){var p=!!(!u.selected&&o&&(n==null?void 0:n.length)===o);if(!p){var g=n?eh([],n):[];if(u.selected){var x=g.findIndex(function(y){return pt(d,y)});g.splice(x,1)}else g.push(d);(f=t.onSelect)===null||f===void 0||f.call(t,g,d,u,h)}}},i={disabled:[]};n&&i.disabled.push(function(d){var u=o&&n.length>o-1,h=n.some(function(v){return pt(v,d)});return!!(u&&!h)});var c={selected:n,onDayClick:a,modifiers:i};return l.jsx($i.Provider,{value:c,children:r})}function Bi(){var e=S.useContext($i);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function h_(e,t){var r=t||{},n=r.from,s=r.to;return n&&s?pt(s,e)&&pt(n,e)?void 0:pt(s,e)?{from:s,to:void 0}:pt(n,e)?void 0:Ai(n,e)?{from:e,to:s}:{from:n,to:e}:s?Ai(e,s)?{from:s,to:e}:{from:e,to:s}:n?Bf(e,n)?{from:e,to:n}:{from:n,to:e}:{from:e,to:void 0}}var Wi=S.createContext(void 0);function p_(e){if(!js(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return l.jsx(Wi.Provider,{value:t,children:e.children})}return l.jsx(m_,{initialProps:e.initialProps,children:e.children})}function m_(e){var t=e.initialProps,r=e.children,n=t.selected,s=n||{},o=s.from,a=s.to,i=t.min,c=t.max,d=function(f,b,p){var g,x;(g=t.onDayClick)===null||g===void 0||g.call(t,f,b,p);var y=h_(f,n);(x=t.onSelect)===null||x===void 0||x.call(t,y,f,b,p)},u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(o?(u.range_start=[o],a?(u.range_end=[a],pt(o,a)||(u.range_middle=[{after:o,before:a}])):u.range_end=[o]):a&&(u.range_start=[a],u.range_end=[a]),i&&(o&&!a&&u.disabled.push({after:Ii(o,i-1),before:it(o,i-1)}),o&&a&&u.disabled.push({after:o,before:it(o,i-1)}),!o&&a&&u.disabled.push({after:Ii(a,i-1),before:it(a,i-1)})),c){if(o&&!a&&(u.disabled.push({before:it(o,-c+1)}),u.disabled.push({after:it(o,c-1)})),o&&a){var h=Qt(a,o)+1,v=c-h;u.disabled.push({before:Ii(o,v)}),u.disabled.push({after:it(a,v)})}!o&&a&&(u.disabled.push({before:it(a,-c+1)}),u.disabled.push({after:it(a,c-1)}))}return l.jsx(Wi.Provider,{value:{selected:n,onDayClick:d,modifiers:u},children:r})}function ji(){var e=S.useContext(Wi);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function Go(e){return Array.isArray(e)?eh([],e):e!==void 0?[e]:[]}function v_(e){var t={};return Object.entries(e).forEach(function(r){var n=r[0],s=r[1];t[n]=Go(s)}),t}var Ft;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(Ft||(Ft={}));var g_=Ft.Selected,dr=Ft.Disabled,y_=Ft.Hidden,b_=Ft.Today,Ui=Ft.RangeEnd,Hi=Ft.RangeMiddle,zi=Ft.RangeStart,w_=Ft.Outside;function x_(e,t,r){var n,s=(n={},n[g_]=Go(e.selected),n[dr]=Go(e.disabled),n[y_]=Go(e.hidden),n[b_]=[e.today],n[Ui]=[],n[Hi]=[],n[zi]=[],n[w_]=[],n);return e.fromDate&&s[dr].push({before:e.fromDate}),e.toDate&&s[dr].push({after:e.toDate}),Ws(e)?s[dr]=s[dr].concat(t.modifiers[dr]):js(e)&&(s[dr]=s[dr].concat(r.modifiers[dr]),s[zi]=r.modifiers[zi],s[Hi]=r.modifiers[Hi],s[Ui]=r.modifiers[Ui]),s}var ih=S.createContext(void 0);function __(e){var t=Me(),r=Bi(),n=ji(),s=x_(t,r,n),o=v_(t.modifiers),a=te(te({},s),o);return l.jsx(ih.Provider,{value:a,children:e.children})}function lh(){var e=S.useContext(ih);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function C_(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function S_(e){return!!(e&&typeof e=="object"&&"from"in e)}function k_(e){return!!(e&&typeof e=="object"&&"after"in e)}function N_(e){return!!(e&&typeof e=="object"&&"before"in e)}function E_(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function P_(e,t){var r,n=t.from,s=t.to;if(n&&s){var o=Qt(s,n)<0;o&&(r=[s,n],n=r[0],s=r[1]);var a=Qt(e,n)>=0&&Qt(s,e)>=0;return a}return s?pt(s,e):n?pt(n,e):!1}function T_(e){return Pi(e)}function O_(e){return Array.isArray(e)&&e.every(Pi)}function M_(e,t){return t.some(function(r){if(typeof r=="boolean")return r;if(T_(r))return pt(e,r);if(O_(r))return r.includes(e);if(S_(r))return P_(e,r);if(E_(r))return r.dayOfWeek.includes(e.getDay());if(C_(r)){var n=Qt(r.before,e),s=Qt(r.after,e),o=n>0,a=s<0,i=Ai(r.before,r.after);return i?a&&o:o||a}return k_(r)?Qt(e,r.after)>0:N_(r)?Qt(r.before,e)>0:typeof r=="function"?r(e):!1})}function Yi(e,t,r){var n=Object.keys(t).reduce(function(o,a){var i=t[a];return M_(e,i)&&o.push(a),o},[]),s={};return n.forEach(function(o){return s[o]=!0}),r&&!Di(e,r)&&(s.outside=!0),s}function A_(e,t){for(var r=mt(e[0]),n=Ti(e[e.length-1]),s,o,a=r;a<=n;){var i=Yi(a,t),c=!i.disabled&&!i.hidden;if(!c){a=it(a,1);continue}if(i.selected)return a;i.today&&!o&&(o=a),s||(s=a),a=it(a,1)}return o||s}var D_=365;function ch(e,t){var r=t.moveBy,n=t.direction,s=t.context,o=t.modifiers,a=t.retry,i=a===void 0?{count:0,lastFocused:e}:a,c=s.weekStartsOn,d=s.fromDate,u=s.toDate,h=s.locale,v={day:it,week:Ei,month:It,year:d0,startOfWeek:function(g){return s.ISOWeek?un(g):Kt(g,{locale:h,weekStartsOn:c})},endOfWeek:function(g){return s.ISOWeek?Tf(g):Oi(g,{locale:h,weekStartsOn:c})}},f=v[r](e,n==="after"?1:-1);n==="before"&&d?f=u0([d,f]):n==="after"&&u&&(f=f0([u,f]));var b=!0;if(o){var p=Yi(f,o);b=!p.disabled&&!p.hidden}return b?f:i.count>D_?i.lastFocused:ch(f,{moveBy:r,direction:n,context:s,modifiers:o,retry:te(te({},i),{count:i.count+1})})}var dh=S.createContext(void 0);function I_(e){var t=Us(),r=lh(),n=S.useState(),s=n[0],o=n[1],a=S.useState(),i=a[0],c=a[1],d=A_(t.displayMonths,r),u=s??(i&&t.isDateDisplayed(i))?i:d,h=function(){c(s),o(void 0)},v=function(g){o(g)},f=Me(),b=function(g,x){if(s){var y=ch(s,{moveBy:g,direction:x,context:f,modifiers:r});pt(s,y)||(t.goToDate(y,s),v(y))}},p={focusedDay:s,focusTarget:u,blur:h,focus:v,focusDayAfter:function(){return b("day","after")},focusDayBefore:function(){return b("day","before")},focusWeekAfter:function(){return b("week","after")},focusWeekBefore:function(){return b("week","before")},focusMonthBefore:function(){return b("month","before")},focusMonthAfter:function(){return b("month","after")},focusYearBefore:function(){return b("year","before")},focusYearAfter:function(){return b("year","after")},focusStartOfWeek:function(){return b("startOfWeek","before")},focusEndOfWeek:function(){return b("endOfWeek","after")}};return l.jsx(dh.Provider,{value:p,children:e.children})}function qi(){var e=S.useContext(dh);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function F_(e,t){var r=lh(),n=Yi(e,r,t);return n}var Zi=S.createContext(void 0);function L_(e){if(!Ko(e.initialProps)){var t={selected:void 0};return l.jsx(Zi.Provider,{value:t,children:e.children})}return l.jsx(V_,{initialProps:e.initialProps,children:e.children})}function V_(e){var t=e.initialProps,r=e.children,n=function(o,a,i){var c,d,u;if((c=t.onDayClick)===null||c===void 0||c.call(t,o,a,i),a.selected&&!t.required){(d=t.onSelect)===null||d===void 0||d.call(t,void 0,o,a,i);return}(u=t.onSelect)===null||u===void 0||u.call(t,o,o,a,i)},s={selected:t.selected,onDayClick:n};return l.jsx(Zi.Provider,{value:s,children:r})}function uh(){var e=S.useContext(Zi);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function $_(e,t){var r=Me(),n=uh(),s=Bi(),o=ji(),a=qi(),i=a.focusDayAfter,c=a.focusDayBefore,d=a.focusWeekAfter,u=a.focusWeekBefore,h=a.blur,v=a.focus,f=a.focusMonthBefore,b=a.focusMonthAfter,p=a.focusYearBefore,g=a.focusYearAfter,x=a.focusStartOfWeek,y=a.focusEndOfWeek,w=function(I){var A,B,ae,Se;Ko(r)?(A=n.onDayClick)===null||A===void 0||A.call(n,e,t,I):Ws(r)?(B=s.onDayClick)===null||B===void 0||B.call(s,e,t,I):js(r)?(ae=o.onDayClick)===null||ae===void 0||ae.call(o,e,t,I):(Se=r.onDayClick)===null||Se===void 0||Se.call(r,e,t,I)},k=function(I){var A;v(e),(A=r.onDayFocus)===null||A===void 0||A.call(r,e,t,I)},E=function(I){var A;h(),(A=r.onDayBlur)===null||A===void 0||A.call(r,e,t,I)},M=function(I){var A;(A=r.onDayMouseEnter)===null||A===void 0||A.call(r,e,t,I)},O=function(I){var A;(A=r.onDayMouseLeave)===null||A===void 0||A.call(r,e,t,I)},P=function(I){var A;(A=r.onDayPointerEnter)===null||A===void 0||A.call(r,e,t,I)},F=function(I){var A;(A=r.onDayPointerLeave)===null||A===void 0||A.call(r,e,t,I)},W=function(I){var A;(A=r.onDayTouchCancel)===null||A===void 0||A.call(r,e,t,I)},G=function(I){var A;(A=r.onDayTouchEnd)===null||A===void 0||A.call(r,e,t,I)},D=function(I){var A;(A=r.onDayTouchMove)===null||A===void 0||A.call(r,e,t,I)},U=function(I){var A;(A=r.onDayTouchStart)===null||A===void 0||A.call(r,e,t,I)},L=function(I){var A;(A=r.onDayKeyUp)===null||A===void 0||A.call(r,e,t,I)},J=function(I){var A;switch(I.key){case"ArrowLeft":I.preventDefault(),I.stopPropagation(),r.dir==="rtl"?i():c();break;case"ArrowRight":I.preventDefault(),I.stopPropagation(),r.dir==="rtl"?c():i();break;case"ArrowDown":I.preventDefault(),I.stopPropagation(),d();break;case"ArrowUp":I.preventDefault(),I.stopPropagation(),u();break;case"PageUp":I.preventDefault(),I.stopPropagation(),I.shiftKey?p():f();break;case"PageDown":I.preventDefault(),I.stopPropagation(),I.shiftKey?g():b();break;case"Home":I.preventDefault(),I.stopPropagation(),x();break;case"End":I.preventDefault(),I.stopPropagation(),y();break}(A=r.onDayKeyDown)===null||A===void 0||A.call(r,e,t,I)},Y={onClick:w,onFocus:k,onBlur:E,onKeyDown:J,onKeyUp:L,onMouseEnter:M,onMouseLeave:O,onPointerEnter:P,onPointerLeave:F,onTouchCancel:W,onTouchEnd:G,onTouchMove:D,onTouchStart:U};return Y}function B_(){var e=Me(),t=uh(),r=Bi(),n=ji(),s=Ko(e)?t.selected:Ws(e)?r.selected:js(e)?n.selected:void 0;return s}function W_(e){return Object.values(Ft).includes(e)}function j_(e,t){var r=[e.classNames.day];return Object.keys(t).forEach(function(n){var s=e.modifiersClassNames[n];if(s)r.push(s);else if(W_(n)){var o=e.classNames["day_".concat(n)];o&&r.push(o)}}),r}function U_(e,t){var r=te({},e.styles.day);return Object.keys(t).forEach(function(n){var s;r=te(te({},r),(s=e.modifiersStyles)===null||s===void 0?void 0:s[n])}),r}function H_(e,t,r){var n,s,o,a=Me(),i=qi(),c=F_(e,t),d=$_(e,c),u=B_(),h=!!(a.onDayClick||a.mode!=="default");S.useEffect(function(){var M;c.outside||i.focusedDay&&h&&pt(i.focusedDay,e)&&((M=r.current)===null||M===void 0||M.focus())},[i.focusedDay,e,r,h,c.outside]);var v=j_(a,c).join(" "),f=U_(a,c),b=!!(c.outside&&!a.showOutsideDays||c.hidden),p=(o=(s=a.components)===null||s===void 0?void 0:s.DayContent)!==null&&o!==void 0?o:d_,g=l.jsx(p,{date:e,displayMonth:t,activeModifiers:c}),x={style:f,className:v,children:g,role:"gridcell"},y=i.focusTarget&&pt(i.focusTarget,e)&&!c.outside,w=i.focusedDay&&pt(i.focusedDay,e),k=te(te(te({},x),(n={disabled:c.disabled,role:"gridcell"},n["aria-selected"]=c.selected,n.tabIndex=w||y?0:-1,n)),d),E={isButton:h,isHidden:b,activeModifiers:c,selectedDays:u,buttonProps:k,divProps:x};return E}function z_(e){var t=S.useRef(null),r=H_(e.date,e.displayMonth,t);return r.isHidden?l.jsx("div",{role:"gridcell"}):r.isButton?l.jsx(Qo,te({name:"day",ref:t},r.buttonProps)):l.jsx("div",te({},r.divProps))}function Y_(e){var t=e.number,r=e.dates,n=Me(),s=n.onWeekNumberClick,o=n.styles,a=n.classNames,i=n.locale,c=n.labels.labelWeekNumber,d=n.formatters.formatWeekNumber,u=d(Number(t),{locale:i});if(!s)return l.jsx("span",{className:a.weeknumber,style:o.weeknumber,children:u});var h=c(Number(t),{locale:i}),v=function(f){s(t,r,f)};return l.jsx(Qo,{name:"week-number","aria-label":h,className:a.weeknumber,style:o.weeknumber,onClick:v,children:u})}function q_(e){var t,r,n=Me(),s=n.styles,o=n.classNames,a=n.showWeekNumber,i=n.components,c=(t=i==null?void 0:i.Day)!==null&&t!==void 0?t:z_,d=(r=i==null?void 0:i.WeekNumber)!==null&&r!==void 0?r:Y_,u;return a&&(u=l.jsx("td",{className:o.cell,style:s.cell,children:l.jsx(d,{number:e.weekNumber,dates:e.dates})})),l.jsxs("tr",{className:o.row,style:s.row,children:[u,e.dates.map(function(h){return l.jsx("td",{className:o.cell,style:s.cell,role:"presentation",children:l.jsx(c,{displayMonth:e.displayMonth,date:h})},cx(h))})]})}function fh(e,t,r){for(var n=r!=null&&r.ISOWeek?Tf(t):Oi(t,r),s=r!=null&&r.ISOWeek?un(e):Kt(e,r),o=Qt(n,s),a=[],i=0;i<=o;i++)a.push(it(s,i));var c=a.reduce(function(d,u){var h=r!=null&&r.ISOWeek?Mf(u):Df(u,r),v=d.find(function(f){return f.weekNumber===h});return v?(v.dates.push(u),d):(d.push({weekNumber:h,dates:[u]}),d)},[]);return c}function Z_(e,t){var r=fh(mt(e),Ti(e),t);if(t!=null&&t.useFixedWeeks){var n=ux(e,t);if(n<6){var s=r[r.length-1],o=s.dates[s.dates.length-1],a=Ei(o,6-n),i=fh(Ei(o,1),a,t);r.push.apply(r,i)}}return r}function K_(e){var t,r,n,s=Me(),o=s.locale,a=s.classNames,i=s.styles,c=s.hideHead,d=s.fixedWeeks,u=s.components,h=s.weekStartsOn,v=s.firstWeekContainsDate,f=s.ISOWeek,b=Z_(e.displayMonth,{useFixedWeeks:!!d,ISOWeek:f,locale:o,weekStartsOn:h,firstWeekContainsDate:v}),p=(t=u==null?void 0:u.Head)!==null&&t!==void 0?t:c_,g=(r=u==null?void 0:u.Row)!==null&&r!==void 0?r:q_,x=(n=u==null?void 0:u.Footer)!==null&&n!==void 0?n:a_;return l.jsxs("table",{id:e.id,className:a.table,style:i.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!c&&l.jsx(p,{}),l.jsx("tbody",{className:a.tbody,style:i.tbody,children:b.map(function(y){return l.jsx(g,{displayMonth:e.displayMonth,dates:y.dates,weekNumber:y.weekNumber},y.weekNumber)})}),l.jsx(x,{displayMonth:e.displayMonth})]})}function Q_(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var G_=Q_()?S.useLayoutEffect:S.useEffect,Ki=!1,X_=0;function hh(){return"react-day-picker-".concat(++X_)}function J_(e){var t,r=e??(Ki?hh():null),n=S.useState(r),s=n[0],o=n[1];return G_(function(){s===null&&o(hh())},[]),S.useEffect(function(){Ki===!1&&(Ki=!0)},[]),(t=e??s)!==null&&t!==void 0?t:void 0}function R_(e){var t,r,n=Me(),s=n.dir,o=n.classNames,a=n.styles,i=n.components,c=Us().displayMonths,d=J_(n.id?"".concat(n.id,"-").concat(e.displayIndex):void 0),u=n.id?"".concat(n.id,"-grid-").concat(e.displayIndex):void 0,h=[o.month],v=a.month,f=e.displayIndex===0,b=e.displayIndex===c.length-1,p=!f&&!b;s==="rtl"&&(t=[f,b],b=t[0],f=t[1]),f&&(h.push(o.caption_start),v=te(te({},v),a.caption_start)),b&&(h.push(o.caption_end),v=te(te({},v),a.caption_end)),p&&(h.push(o.caption_between),v=te(te({},v),a.caption_between));var g=(r=i==null?void 0:i.Caption)!==null&&r!==void 0?r:o_;return l.jsxs("div",{className:h.join(" "),style:v,children:[l.jsx(g,{id:d,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),l.jsx(K_,{id:u,"aria-labelledby":d,displayMonth:e.displayMonth})]},e.displayIndex)}function eC(e){var t=Me(),r=t.classNames,n=t.styles;return l.jsx("div",{className:r.months,style:n.months,children:e.children})}function tC(e){var t,r,n=e.initialProps,s=Me(),o=qi(),a=Us(),i=S.useState(!1),c=i[0],d=i[1];S.useEffect(function(){s.initialFocus&&o.focusTarget&&(c||(o.focus(o.focusTarget),d(!0)))},[s.initialFocus,c,o.focus,o.focusTarget,o]);var u=[s.classNames.root,s.className];s.numberOfMonths>1&&u.push(s.classNames.multiple_months),s.showWeekNumber&&u.push(s.classNames.with_weeknumber);var h=te(te({},s.styles.root),s.style),v=Object.keys(n).filter(function(b){return b.startsWith("data-")}).reduce(function(b,p){var g;return te(te({},b),(g={},g[p]=n[p],g))},{}),f=(r=(t=n.components)===null||t===void 0?void 0:t.Months)!==null&&r!==void 0?r:eC;return l.jsx("div",te({className:u.join(" "),style:h,dir:s.dir,id:s.id,nonce:n.nonce,title:n.title,lang:n.lang},v,{children:l.jsx(f,{children:a.displayMonths.map(function(b,p){return l.jsx(R_,{displayIndex:p,displayMonth:b},p)})})}))}function rC(e){var t=e.children,r=Nx(e,["children"]);return l.jsx(Yx,{initialProps:r,children:l.jsx(t_,{children:l.jsx(L_,{initialProps:r,children:l.jsx(u_,{initialProps:r,children:l.jsx(p_,{initialProps:r,children:l.jsx(__,{children:l.jsx(I_,{children:t})})})})})})})}function nC(e){return l.jsx(rC,te({},e,{children:l.jsx(tC,{initialProps:e})}))}function Qi({className:e,classNames:t,showOutsideDays:r=!0,...n}){const s=(o,a)=>{const i={target:{value:String(o)}};a(i)};return l.jsx(nC,{showOutsideDays:r,className:he("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption_start:"is-start",caption_between:"is-between",caption_end:"is-end",caption:"flex justify-center pt-1 relative items-center gap-1",caption_label:"flex h-7 text-sm font-medium justify-center items-center grow [.is-multiple_&]:flex",caption_dropdowns:"flex justify-center gap-1 grow dropdowns pl-8 pr-9",multiple_months:"is-multiple",vhidden:"hidden [.is-between_&]:flex [.is-end_&]:flex [.is-start.is-end_&]:hidden",nav:"flex items-center [&:has([name='previous-month'])]:order-first [&:has([name='next-month'])]:order-last gap-1",nav_button:he(_o({variant:"outline"}),"h-7 w-7 bg-transparent p-0 text-muted-foreground"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:he("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent",n.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:he(_o({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"text-muted-foreground opacity-50",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible"},components:{IconLeft:({...o})=>l.jsx(Fp,{className:"h-4 w-4"}),IconRight:({...o})=>l.jsx(Lp,{className:"h-4 w-4"}),Dropdown:({...o})=>l.jsxs(cn,{...o,onValueChange:a=>{o.onChange&&s(a,o.onChange)},value:o.value,children:[l.jsx(Fr,{className:he(_o({variant:"ghost"}),"pl-2 pr-1 py-2 h-7 w-fit font-medium [.is-between_&]:hidden [.is-end_&]:hidden [.is-start.is-end_&]:flex"),children:l.jsx(dn,{placeholder:o==null?void 0:o.caption,children:o==null?void 0:o.caption})}),l.jsx(Lr,{className:"max-h-[var(--radix-popper-available-height);] overflow-y-auto scrolling-auto min-w-[var(--radix-popper-anchor-width)]",children:o.children&&m.Children.map(o.children,a=>{var i,c;return l.jsx(re,{value:(i=a==null?void 0:a.props)==null?void 0:i.value,className:"min-w-[var(--radix-popper-anchor-width)]",children:(c=a==null?void 0:a.props)==null?void 0:c.children})})})]})},...n})}Qi.displayName="Calendar";const sC=As({registration_number:Xe().min(1,"Registration number is required"),country:Xe().min(1,"Country is required"),company_name:Xe().min(2,"Company name must be at least 2 characters"),tax_identity_number:Xe().min(1,"Tax identity number is required"),corporate_type:Xe().min(1,"Corporate type is required"),date_of_establishment:yu({required_error:"Date of establishment is required"})}),oC=({data:e,onDataChange:t,onContinue:r,onBack:n,renderProgress:s})=>{const o=Ss({resolver:ks(sC),defaultValues:{registration_number:e.registration_number,country:e.country,company_name:e.company_name,tax_identity_number:e.tax_identity_number,corporate_type:e.corporate_type,date_of_establishment:e.date_of_establishment||void 0}}),a=i=>{t(i),r()};return l.jsxs(st,{className:"w-full max-w-2xl mx-auto",children:[l.jsx(kr,{children:l.jsx(Nr,{title:"Business Information",subTitle:"Please provide your business details",onBack:n})}),l.jsxs(ot,{children:[l.jsx(Ds,{...o,children:l.jsxs("form",{onSubmit:o.handleSubmit(a),className:"space-y-6",children:[l.jsx(qe,{control:o.control,name:"registration_number",render:({field:i})=>l.jsxs($e,{children:[l.jsx(Be,{children:"Registration Number"}),l.jsx(We,{children:l.jsx(ft,{placeholder:"Enter registration number",...i})}),l.jsx(je,{})]})}),l.jsx(qe,{control:o.control,name:"country",render:({field:i})=>l.jsxs($e,{children:[l.jsx(Be,{children:"Country"}),l.jsxs(cn,{onValueChange:i.onChange,defaultValue:i.value,children:[l.jsx(We,{children:l.jsx(Fr,{children:l.jsx(dn,{placeholder:"Select country"})})}),l.jsxs(Lr,{children:[l.jsx(re,{value:"us",children:"United States"}),l.jsx(re,{value:"uk",children:"United Kingdom"}),l.jsx(re,{value:"ca",children:"Canada"}),l.jsx(re,{value:"au",children:"Australia"}),l.jsx(re,{value:"de",children:"Germany"}),l.jsx(re,{value:"fr",children:"France"}),l.jsx(re,{value:"other",children:"Other"})]})]}),l.jsx(je,{})]})}),l.jsx(qe,{control:o.control,name:"company_name",render:({field:i})=>l.jsxs($e,{children:[l.jsx(Be,{children:"Company Name"}),l.jsx(We,{children:l.jsx(ft,{placeholder:"Enter company name",...i})}),l.jsx(je,{})]})}),l.jsx(qe,{control:o.control,name:"tax_identity_number",render:({field:i})=>l.jsxs($e,{children:[l.jsx(Be,{children:"Tax Identity Number"}),l.jsx(We,{children:l.jsx(ft,{placeholder:"Enter tax identity number",...i})}),l.jsx(je,{})]})}),l.jsx(qe,{control:o.control,name:"corporate_type",render:({field:i})=>l.jsxs($e,{children:[l.jsx(Be,{children:"Corporate Type"}),l.jsxs(cn,{onValueChange:i.onChange,defaultValue:i.value,children:[l.jsx(We,{children:l.jsx(Fr,{children:l.jsx(dn,{placeholder:"Select corporate type"})})}),l.jsxs(Lr,{children:[l.jsx(re,{value:"llc",children:"LLC"}),l.jsx(re,{value:"corporation",children:"Corporation"}),l.jsx(re,{value:"partnership",children:"Partnership"}),l.jsx(re,{value:"sole-proprietorship",children:"Sole Proprietorship"}),l.jsx(re,{value:"other",children:"Other"})]})]}),l.jsx(je,{})]})}),l.jsx(qe,{control:o.control,name:"date_of_establishment",render:({field:i})=>l.jsxs($e,{className:"flex flex-col",children:[l.jsx(Be,{children:"Date of Establishment"}),l.jsxs(Jf,{modal:!0,children:[l.jsx(Rf,{asChild:!0,children:l.jsx(We,{children:l.jsxs(He,{variant:"outline",className:he("w-full pl-3 text-left font-normal",!i.value&&"text-muted-foreground"),children:[i.value?cr(i.value,"PPP"):l.jsx("span",{children:"Pick a date"}),l.jsx(Kl,{className:"ml-auto h-4 w-4 opacity-50"})]})})}),l.jsx(Vi,{className:"w-auto p-0",align:"start",onOpenAutoFocus:c=>c.preventDefault(),children:l.jsx(Qi,{mode:"single",selected:i.value,onSelect:i.onChange,captionLayout:"dropdown-buttons",fromYear:1900,toYear:2026,disabled:c=>c>new Date,initialFocus:!0,className:"p-3 pointer-events-auto"})})]}),l.jsx(je,{})]})}),l.jsx(He,{type:"submit",className:"w-full",children:"Continue"})]})}),l.jsx("div",{className:"mt-6",children:s()})]})]})},aC=As({full_name:Xe().min(2,"Full name must be at least 2 characters"),title:Xe().min(1,"Title is required"),birth:yu({required_error:"Birth date is required"}),phone_number:Xe().min(10,"Phone number must be at least 10 characters")}),iC=({data:e,onDataChange:t,onContinue:r,onBack:n,renderProgress:s})=>{const o=Ss({resolver:ks(aC),defaultValues:{full_name:e.full_name,title:e.title,birth:e.birth||void 0,phone_number:e.phone_number}}),a=i=>{t(i),r()};return l.jsxs(st,{className:"w-full max-w-2xl mx-auto",children:[l.jsx(kr,{children:l.jsx(Nr,{title:"Personal Details",subTitle:"Please provide your personal information",onBack:n})}),l.jsxs(ot,{children:[l.jsx(Ds,{...o,children:l.jsxs("form",{onSubmit:o.handleSubmit(a),className:"space-y-6",children:[l.jsx(qe,{control:o.control,name:"full_name",render:({field:i})=>l.jsxs($e,{children:[l.jsx(Be,{children:"Full Name"}),l.jsx(We,{children:l.jsx(ft,{placeholder:"Enter your full name",...i})}),l.jsx(je,{})]})}),l.jsx(qe,{control:o.control,name:"title",render:({field:i})=>l.jsxs($e,{children:[l.jsx(Be,{children:"Title"}),l.jsx(We,{children:l.jsx(ft,{placeholder:"e.g., CEO, Director, Manager",...i})}),l.jsx(je,{})]})}),l.jsx(qe,{control:o.control,name:"birth",render:({field:i})=>l.jsxs($e,{className:"flex flex-col",children:[l.jsx(Be,{children:"Date of Birth"}),l.jsxs(Jf,{modal:!0,children:[l.jsx(Rf,{asChild:!0,children:l.jsx(We,{children:l.jsxs(He,{variant:"outline",className:he("w-full pl-3 text-left font-normal",!i.value&&"text-muted-foreground"),children:[i.value?cr(i.value,"PPP"):l.jsx("span",{children:"Pick a date"}),l.jsx(Kl,{className:"ml-auto h-4 w-4 opacity-50"})]})})}),l.jsx(Vi,{className:"w-auto p-0",align:"start",onOpenAutoFocus:c=>c.preventDefault(),children:l.jsx(Qi,{mode:"single",selected:i.value,onSelect:i.onChange,captionLayout:"dropdown-buttons",fromYear:1900,toYear:2026,disabled:c=>c>new Date||c<new Date("1900-01-01"),initialFocus:!0,className:"p-3 pointer-events-auto"})})]}),l.jsx(je,{})]})}),l.jsx(qe,{control:o.control,name:"phone_number",render:({field:i})=>l.jsxs($e,{children:[l.jsx(Be,{children:"Phone Number"}),l.jsx(We,{children:l.jsx(ft,{placeholder:"Enter your phone number",...i})}),l.jsx(je,{})]})}),l.jsx(He,{type:"submit",className:"w-full",children:"Continue"})]})}),l.jsx("div",{className:"mt-6",children:s()})]})]})};var Gi="Progress",Xi=100,[lC,OC]=Rr(Gi),[cC,dC]=lC(Gi),ph=m.forwardRef((e,t)=>{const{__scopeProgress:r,value:n=null,max:s,getValueLabel:o=uC,...a}=e;(s||s===0)&&!yh(s)&&console.error(fC(`${s}`,"Progress"));const i=yh(s)?s:Xi;n!==null&&!bh(n,i)&&console.error(hC(`${n}`,"Progress"));const c=bh(n,i)?n:null,d=Xo(c)?o(c,i):void 0;return l.jsx(cC,{scope:r,value:c,max:i,children:l.jsx(we.div,{"aria-valuemax":i,"aria-valuemin":0,"aria-valuenow":Xo(c)?c:void 0,"aria-valuetext":d,role:"progressbar","data-state":gh(c,i),"data-value":c??void 0,"data-max":i,...a,ref:t})})});ph.displayName=Gi;var mh="ProgressIndicator",vh=m.forwardRef((e,t)=>{const{__scopeProgress:r,...n}=e,s=dC(mh,r);return l.jsx(we.div,{"data-state":gh(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...n,ref:t})});vh.displayName=mh;function uC(e,t){return`${Math.round(e/t*100)}%`}function gh(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Xo(e){return typeof e=="number"}function yh(e){return Xo(e)&&!isNaN(e)&&e>0}function bh(e,t){return Xo(e)&&!isNaN(e)&&e<=t&&e>=0}function fC(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Xi}\`.`}function hC(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
142
+ `)},Sw=0,Hn=[];function kw(e){var t=m.useRef([]),r=m.useRef([0,0]),n=m.useRef(),s=m.useState(Sw++)[0],o=m.useState(Fu)[0],a=m.useRef(e);m.useEffect(function(){a.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var p=qb([e.lockRef.current],(e.shards||[]).map(Uu),!0).filter(Boolean);return p.forEach(function(g){return g.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),p.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var i=m.useCallback(function(p,g){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!a.current.allowPinchZoom;var x=jo(p),y=r.current,w="deltaX"in p?p.deltaX:y[0]-x[0],k="deltaY"in p?p.deltaY:y[1]-x[1],E,M=p.target,T=Math.abs(w)>Math.abs(k)?"h":"v";if("touches"in p&&T==="h"&&M.type==="range")return!1;var O=$u(T,M);if(!O)return!0;if(O?E=T:(E=T==="v"?"h":"v",O=$u(T,M)),!O)return!1;if(!n.current&&"changedTouches"in p&&(w||k)&&(n.current=E),!E)return!0;var F=n.current||E;return xw(F,g,p,F==="h"?w:k,!0)},[]),c=m.useCallback(function(p){var g=p;if(!(!Hn.length||Hn[Hn.length-1]!==o)){var x="deltaY"in g?ju(g):jo(g),y=t.current.filter(function(E){return E.name===g.type&&(E.target===g.target||g.target===E.shadowParent)&&_w(E.delta,x)})[0];if(y&&y.should){g.cancelable&&g.preventDefault();return}if(!y){var w=(a.current.shards||[]).map(Uu).filter(Boolean).filter(function(E){return E.contains(g.target)}),k=w.length>0?i(g,w[0]):!a.current.noIsolation;k&&g.cancelable&&g.preventDefault()}}},[]),d=m.useCallback(function(p,g,x,y){var w={name:p,delta:g,target:x,should:y,shadowParent:Nw(x)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(k){return k!==w})},1)},[]),u=m.useCallback(function(p){r.current=jo(p),n.current=void 0},[]),h=m.useCallback(function(p){d(p.type,ju(p),p.target,i(p,e.lockRef.current))},[]),v=m.useCallback(function(p){d(p.type,jo(p),p.target,i(p,e.lockRef.current))},[]);m.useEffect(function(){return Hn.push(o),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:v}),document.addEventListener("wheel",c,Un),document.addEventListener("touchmove",c,Un),document.addEventListener("touchstart",u,Un),function(){Hn=Hn.filter(function(p){return p!==o}),document.removeEventListener("wheel",c,Un),document.removeEventListener("touchmove",c,Un),document.removeEventListener("touchstart",u,Un)}},[]);var f=e.removeScrollBar,b=e.inert;return m.createElement(m.Fragment,null,b?m.createElement(o,{styles:Cw(s)}):null,f?m.createElement(pw,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Nw(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Ew=tw(Iu,kw);var bi=m.forwardRef(function(e,t){return m.createElement(Bo,Zt({},e,{ref:t,sideCar:Ew}))});bi.classNames=Bo.classNames;var Pw=[" ","Enter","ArrowUp","ArrowDown"],Tw=[" ","Enter"],an="Select",[Uo,Ho,Ow]=pl(an),[zn,EC]=Rr(an,[Ow,On]),zo=On(),[Mw,Dr]=zn(an),[Aw,Dw]=zn(an),Hu=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:s,onOpenChange:o,value:a,defaultValue:i,onValueChange:c,dir:d,name:u,autoComplete:h,disabled:v,required:f,form:b}=e,p=zo(t),[g,x]=m.useState(null),[y,w]=m.useState(null),[k,E]=m.useState(!1),M=Ib(d),[T,O]=Rs({prop:n,defaultProp:s??!1,onChange:o,caller:an}),[F,W]=Rs({prop:a,defaultProp:i,onChange:c,caller:an}),G=m.useRef(null),D=g?b||!!g.closest("form"):!0,[U,L]=m.useState(new Set),J=Array.from(U).map(Y=>Y.props.value).join(";");return l.jsx(Yc,{...p,children:l.jsxs(Mw,{required:f,scope:t,trigger:g,onTriggerChange:x,valueNode:y,onValueNodeChange:w,valueNodeHasChildren:k,onValueNodeHasChildrenChange:E,contentId:so(),value:F,onValueChange:W,open:T,onOpenChange:O,dir:M,triggerPointerDownPosRef:G,disabled:v,children:[l.jsx(Uo.Provider,{scope:t,children:l.jsx(Aw,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(Y=>{L(I=>new Set(I).add(Y))},[]),onNativeOptionRemove:m.useCallback(Y=>{L(I=>{const A=new Set(I);return A.delete(Y),A})},[]),children:r})}),D?l.jsxs(pf,{"aria-hidden":!0,required:f,tabIndex:-1,name:u,autoComplete:h,value:F,onChange:Y=>W(Y.target.value),disabled:v,form:b,children:[F===void 0?l.jsx("option",{value:""}):null,Array.from(U)]},J):null]})})};Hu.displayName=an;var zu="SelectTrigger",Yu=m.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...s}=e,o=zo(r),a=Dr(zu,r),i=a.disabled||n,c=Ie(t,a.onTriggerChange),d=Ho(r),u=m.useRef("touch"),[h,v,f]=vf(p=>{const g=d().filter(w=>!w.disabled),x=g.find(w=>w.value===a.value),y=gf(g,p,x);y!==void 0&&a.onValueChange(y.value)}),b=p=>{i||(a.onOpenChange(!0),f()),p&&(a.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return l.jsx(mo,{asChild:!0,...o,children:l.jsx(we.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:i,"data-disabled":i?"":void 0,"data-placeholder":mf(a.value)?"":void 0,...s,ref:c,onClick:ie(s.onClick,p=>{p.currentTarget.focus(),u.current!=="mouse"&&b(p)}),onPointerDown:ie(s.onPointerDown,p=>{u.current=p.pointerType;const g=p.target;g.hasPointerCapture(p.pointerId)&&g.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(b(p),p.preventDefault())}),onKeyDown:ie(s.onKeyDown,p=>{const g=h.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&v(p.key),!(g&&p.key===" ")&&Pw.includes(p.key)&&(b(),p.preventDefault())})})})});Yu.displayName=zu;var qu="SelectValue",Zu=m.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,children:o,placeholder:a="",...i}=e,c=Dr(qu,r),{onValueNodeHasChildrenChange:d}=c,u=o!==void 0,h=Ie(t,c.onValueNodeChange);return et(()=>{d(u)},[d,u]),l.jsx(we.span,{...i,ref:h,style:{pointerEvents:"none"},children:mf(c.value)?l.jsx(l.Fragment,{children:a}):o})});Zu.displayName=qu;var Iw="SelectIcon",Ku=m.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...s}=e;return l.jsx(we.span,{"aria-hidden":!0,...s,ref:t,children:n||"▼"})});Ku.displayName=Iw;var Fw="SelectPortal",Qu=e=>l.jsx(Xs,{asChild:!0,...e});Qu.displayName=Fw;var ln="SelectContent",Gu=m.forwardRef((e,t)=>{const r=Dr(ln,e.__scopeSelect),[n,s]=m.useState();if(et(()=>{s(new DocumentFragment)},[]),!r.open){const o=n;return o?ls.createPortal(l.jsx(Xu,{scope:e.__scopeSelect,children:l.jsx(Uo.Slot,{scope:e.__scopeSelect,children:l.jsx("div",{children:e.children})})}),o):null}return l.jsx(Ju,{...e,ref:t})});Gu.displayName=ln;var Dt=10,[Xu,Ir]=zn(ln),Lw="SelectContentImpl",Vw=Cn("SelectContent.RemoveScroll"),Ju=m.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:a,side:i,sideOffset:c,align:d,alignOffset:u,arrowPadding:h,collisionBoundary:v,collisionPadding:f,sticky:b,hideWhenDetached:p,avoidCollisions:g,...x}=e,y=Dr(ln,r),[w,k]=m.useState(null),[E,M]=m.useState(null),T=Ie(t,q=>k(q)),[O,F]=m.useState(null),[W,G]=m.useState(null),D=Ho(r),[U,L]=m.useState(!1),J=m.useRef(!1);m.useEffect(()=>{if(w)return Ou(w)},[w]),_u();const Y=m.useCallback(q=>{const[ke,...Ae]=D().map(be=>be.ref.current),[ye]=Ae.slice(-1),me=document.activeElement;for(const be of q)if(be===me||(be==null||be.scrollIntoView({block:"nearest"}),be===ke&&E&&(E.scrollTop=0),be===ye&&E&&(E.scrollTop=E.scrollHeight),be==null||be.focus(),document.activeElement!==me))return},[D,E]),I=m.useCallback(()=>Y([O,w]),[Y,O,w]);m.useEffect(()=>{U&&I()},[U,I]);const{onOpenChange:A,triggerPointerDownPosRef:B}=y;m.useEffect(()=>{if(w){let q={x:0,y:0};const ke=ye=>{var me,be;q={x:Math.abs(Math.round(ye.pageX)-(((me=B.current)==null?void 0:me.x)??0)),y:Math.abs(Math.round(ye.pageY)-(((be=B.current)==null?void 0:be.y)??0))}},Ae=ye=>{q.x<=10&&q.y<=10?ye.preventDefault():w.contains(ye.target)||A(!1),document.removeEventListener("pointermove",ke),B.current=null};return B.current!==null&&(document.addEventListener("pointermove",ke),document.addEventListener("pointerup",Ae,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ke),document.removeEventListener("pointerup",Ae,{capture:!0})}}},[w,A,B]),m.useEffect(()=>{const q=()=>A(!1);return window.addEventListener("blur",q),window.addEventListener("resize",q),()=>{window.removeEventListener("blur",q),window.removeEventListener("resize",q)}},[A]);const[ae,Se]=vf(q=>{const ke=D().filter(me=>!me.disabled),Ae=ke.find(me=>me.ref.current===document.activeElement),ye=gf(ke,q,Ae);ye&&setTimeout(()=>ye.ref.current.focus())}),de=m.useCallback((q,ke,Ae)=>{const ye=!J.current&&!Ae;(y.value!==void 0&&y.value===ke||ye)&&(F(q),ye&&(J.current=!0))},[y.value]),ue=m.useCallback(()=>w==null?void 0:w.focus(),[w]),pe=m.useCallback((q,ke,Ae)=>{const ye=!J.current&&!Ae;(y.value!==void 0&&y.value===ke||ye)&&G(q)},[y.value]),Fe=n==="popper"?wi:Ru,rt=Fe===wi?{side:i,sideOffset:c,align:d,alignOffset:u,arrowPadding:h,collisionBoundary:v,collisionPadding:f,sticky:b,hideWhenDetached:p,avoidCollisions:g}:{};return l.jsx(Xu,{scope:r,content:w,viewport:E,onViewportChange:M,itemRefCallback:de,selectedItem:O,onItemLeave:ue,itemTextRefCallback:pe,focusSelectedItem:I,selectedItemText:W,position:n,isPositioned:U,searchRef:ae,children:l.jsx(bi,{as:Vw,allowPinchZoom:!0,children:l.jsx(hi,{asChild:!0,trapped:y.open,onMountAutoFocus:q=>{q.preventDefault()},onUnmountAutoFocus:ie(s,q=>{var ke;(ke=y.trigger)==null||ke.focus({preventScroll:!0}),q.preventDefault()}),children:l.jsx(ds,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:q=>q.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:l.jsx(Fe,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:q=>q.preventDefault(),...x,...rt,onPlaced:()=>L(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:ie(x.onKeyDown,q=>{const ke=q.ctrlKey||q.altKey||q.metaKey;if(q.key==="Tab"&&q.preventDefault(),!ke&&q.key.length===1&&Se(q.key),["ArrowUp","ArrowDown","Home","End"].includes(q.key)){let ye=D().filter(me=>!me.disabled).map(me=>me.ref.current);if(["ArrowUp","End"].includes(q.key)&&(ye=ye.slice().reverse()),["ArrowUp","ArrowDown"].includes(q.key)){const me=q.target,be=ye.indexOf(me);ye=ye.slice(be+1)}setTimeout(()=>Y(ye)),q.preventDefault()}})})})})})})});Ju.displayName=Lw;var $w="SelectItemAlignedPosition",Ru=m.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...s}=e,o=Dr(ln,r),a=Ir(ln,r),[i,c]=m.useState(null),[d,u]=m.useState(null),h=Ie(t,T=>u(T)),v=Ho(r),f=m.useRef(!1),b=m.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:x,focusSelectedItem:y}=a,w=m.useCallback(()=>{if(o.trigger&&o.valueNode&&i&&d&&p&&g&&x){const T=o.trigger.getBoundingClientRect(),O=d.getBoundingClientRect(),F=o.valueNode.getBoundingClientRect(),W=x.getBoundingClientRect();if(o.dir!=="rtl"){const me=W.left-O.left,be=F.left-me,Re=T.left-be,dt=T.width+Re,Rt=Math.max(dt,O.width),er=window.innerWidth-Dt,mr=xu(be,[Dt,Math.max(Dt,er-Rt)]);i.style.minWidth=dt+"px",i.style.left=mr+"px"}else{const me=O.right-W.right,be=window.innerWidth-F.right-me,Re=window.innerWidth-T.right-be,dt=T.width+Re,Rt=Math.max(dt,O.width),er=window.innerWidth-Dt,mr=xu(be,[Dt,Math.max(Dt,er-Rt)]);i.style.minWidth=dt+"px",i.style.right=mr+"px"}const G=v(),D=window.innerHeight-Dt*2,U=p.scrollHeight,L=window.getComputedStyle(d),J=parseInt(L.borderTopWidth,10),Y=parseInt(L.paddingTop,10),I=parseInt(L.borderBottomWidth,10),A=parseInt(L.paddingBottom,10),B=J+Y+U+A+I,ae=Math.min(g.offsetHeight*5,B),Se=window.getComputedStyle(p),de=parseInt(Se.paddingTop,10),ue=parseInt(Se.paddingBottom,10),pe=T.top+T.height/2-Dt,Fe=D-pe,rt=g.offsetHeight/2,q=g.offsetTop+rt,ke=J+Y+q,Ae=B-ke;if(ke<=pe){const me=G.length>0&&g===G[G.length-1].ref.current;i.style.bottom="0px";const be=d.clientHeight-p.offsetTop-p.offsetHeight,Re=Math.max(Fe,rt+(me?ue:0)+be+I),dt=ke+Re;i.style.height=dt+"px"}else{const me=G.length>0&&g===G[0].ref.current;i.style.top="0px";const Re=Math.max(pe,J+p.offsetTop+(me?de:0)+rt)+Ae;i.style.height=Re+"px",p.scrollTop=ke-pe+p.offsetTop}i.style.margin=`${Dt}px 0`,i.style.minHeight=ae+"px",i.style.maxHeight=D+"px",n==null||n(),requestAnimationFrame(()=>f.current=!0)}},[v,o.trigger,o.valueNode,i,d,p,g,x,o.dir,n]);et(()=>w(),[w]);const[k,E]=m.useState();et(()=>{d&&E(window.getComputedStyle(d).zIndex)},[d]);const M=m.useCallback(T=>{T&&b.current===!0&&(w(),y==null||y(),b.current=!1)},[w,y]);return l.jsx(Ww,{scope:r,contentWrapper:i,shouldExpandOnScrollRef:f,onScrollButtonChange:M,children:l.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:l.jsx(we.div,{...s,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});Ru.displayName=$w;var Bw="SelectPopperPosition",wi=m.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:s=Dt,...o}=e,a=zo(r);return l.jsx(Aa,{...a,...o,ref:t,align:n,collisionPadding:s,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});wi.displayName=Bw;var[Ww,xi]=zn(ln,{}),_i="SelectViewport",ef=m.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...s}=e,o=Ir(_i,r),a=xi(_i,r),i=Ie(t,o.onViewportChange),c=m.useRef(0);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),l.jsx(Uo.Slot,{scope:r,children:l.jsx(we.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:i,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:ie(s.onScroll,d=>{const u=d.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:v}=a;if(v!=null&&v.current&&h){const f=Math.abs(c.current-u.scrollTop);if(f>0){const b=window.innerHeight-Dt*2,p=parseFloat(h.style.minHeight),g=parseFloat(h.style.height),x=Math.max(p,g);if(x<b){const y=x+f,w=Math.min(b,y),k=y-w;h.style.height=w+"px",h.style.bottom==="0px"&&(u.scrollTop=k>0?k:0,h.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});ef.displayName=_i;var tf="SelectGroup",[jw,Uw]=zn(tf),Hw=m.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=so();return l.jsx(jw,{scope:r,id:s,children:l.jsx(we.div,{role:"group","aria-labelledby":s,...n,ref:t})})});Hw.displayName=tf;var rf="SelectLabel",nf=m.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=Uw(rf,r);return l.jsx(we.div,{id:s.id,...n,ref:t})});nf.displayName=rf;var Yo="SelectItem",[zw,sf]=zn(Yo),of=m.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:s=!1,textValue:o,...a}=e,i=Dr(Yo,r),c=Ir(Yo,r),d=i.value===n,[u,h]=m.useState(o??""),[v,f]=m.useState(!1),b=Ie(t,y=>{var w;return(w=c.itemRefCallback)==null?void 0:w.call(c,y,n,s)}),p=so(),g=m.useRef("touch"),x=()=>{s||(i.onValueChange(n),i.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return l.jsx(zw,{scope:r,value:n,disabled:s,textId:p,isSelected:d,onItemTextChange:m.useCallback(y=>{h(w=>w||((y==null?void 0:y.textContent)??"").trim())},[]),children:l.jsx(Uo.ItemSlot,{scope:r,value:n,disabled:s,textValue:u,children:l.jsx(we.div,{role:"option","aria-labelledby":p,"data-highlighted":v?"":void 0,"aria-selected":d&&v,"data-state":d?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...a,ref:b,onFocus:ie(a.onFocus,()=>f(!0)),onBlur:ie(a.onBlur,()=>f(!1)),onClick:ie(a.onClick,()=>{g.current!=="mouse"&&x()}),onPointerUp:ie(a.onPointerUp,()=>{g.current==="mouse"&&x()}),onPointerDown:ie(a.onPointerDown,y=>{g.current=y.pointerType}),onPointerMove:ie(a.onPointerMove,y=>{var w;g.current=y.pointerType,s?(w=c.onItemLeave)==null||w.call(c):g.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ie(a.onPointerLeave,y=>{var w;y.currentTarget===document.activeElement&&((w=c.onItemLeave)==null||w.call(c))}),onKeyDown:ie(a.onKeyDown,y=>{var k;((k=c.searchRef)==null?void 0:k.current)!==""&&y.key===" "||(Tw.includes(y.key)&&x(),y.key===" "&&y.preventDefault())})})})})});of.displayName=Yo;var Is="SelectItemText",af=m.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,...o}=e,a=Dr(Is,r),i=Ir(Is,r),c=sf(Is,r),d=Dw(Is,r),[u,h]=m.useState(null),v=Ie(t,x=>h(x),c.onItemTextChange,x=>{var y;return(y=i.itemTextRefCallback)==null?void 0:y.call(i,x,c.value,c.disabled)}),f=u==null?void 0:u.textContent,b=m.useMemo(()=>l.jsx("option",{value:c.value,disabled:c.disabled,children:f},c.value),[c.disabled,c.value,f]),{onNativeOptionAdd:p,onNativeOptionRemove:g}=d;return et(()=>(p(b),()=>g(b)),[p,g,b]),l.jsxs(l.Fragment,{children:[l.jsx(we.span,{id:c.textId,...o,ref:v}),c.isSelected&&a.valueNode&&!a.valueNodeHasChildren?ls.createPortal(o.children,a.valueNode):null]})});af.displayName=Is;var lf="SelectItemIndicator",cf=m.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return sf(lf,r).isSelected?l.jsx(we.span,{"aria-hidden":!0,...n,ref:t}):null});cf.displayName=lf;var Ci="SelectScrollUpButton",df=m.forwardRef((e,t)=>{const r=Ir(Ci,e.__scopeSelect),n=xi(Ci,e.__scopeSelect),[s,o]=m.useState(!1),a=Ie(t,n.onScrollButtonChange);return et(()=>{if(r.viewport&&r.isPositioned){let i=function(){const d=c.scrollTop>0;o(d)};const c=r.viewport;return i(),c.addEventListener("scroll",i),()=>c.removeEventListener("scroll",i)}},[r.viewport,r.isPositioned]),s?l.jsx(ff,{...e,ref:a,onAutoScroll:()=>{const{viewport:i,selectedItem:c}=r;i&&c&&(i.scrollTop=i.scrollTop-c.offsetHeight)}}):null});df.displayName=Ci;var Si="SelectScrollDownButton",uf=m.forwardRef((e,t)=>{const r=Ir(Si,e.__scopeSelect),n=xi(Si,e.__scopeSelect),[s,o]=m.useState(!1),a=Ie(t,n.onScrollButtonChange);return et(()=>{if(r.viewport&&r.isPositioned){let i=function(){const d=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<d;o(u)};const c=r.viewport;return i(),c.addEventListener("scroll",i),()=>c.removeEventListener("scroll",i)}},[r.viewport,r.isPositioned]),s?l.jsx(ff,{...e,ref:a,onAutoScroll:()=>{const{viewport:i,selectedItem:c}=r;i&&c&&(i.scrollTop=i.scrollTop+c.offsetHeight)}}):null});uf.displayName=Si;var ff=m.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...s}=e,o=Ir("SelectScrollButton",r),a=m.useRef(null),i=Ho(r),c=m.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return m.useEffect(()=>()=>c(),[c]),et(()=>{var u;const d=i().find(h=>h.ref.current===document.activeElement);(u=d==null?void 0:d.ref.current)==null||u.scrollIntoView({block:"nearest"})},[i]),l.jsx(we.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:ie(s.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(n,50))}),onPointerMove:ie(s.onPointerMove,()=>{var d;(d=o.onItemLeave)==null||d.call(o),a.current===null&&(a.current=window.setInterval(n,50))}),onPointerLeave:ie(s.onPointerLeave,()=>{c()})})}),Yw="SelectSeparator",hf=m.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return l.jsx(we.div,{"aria-hidden":!0,...n,ref:t})});hf.displayName=Yw;var ki="SelectArrow",qw=m.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=zo(r),o=Dr(ki,r),a=Ir(ki,r);return o.open&&a.position==="popper"?l.jsx(Da,{...s,...n,ref:t}):null});qw.displayName=ki;var Zw="SelectBubbleInput",pf=m.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const s=m.useRef(null),o=Ie(n,s),a=Ub(t);return m.useEffect(()=>{const i=s.current;if(!i)return;const c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==t&&u){const h=new Event("change",{bubbles:!0});u.call(i,t),i.dispatchEvent(h)}},[a,t]),l.jsx(we.select,{...r,style:{...xl,...r.style},ref:o,defaultValue:t})});pf.displayName=Zw;function mf(e){return e===""||e===void 0}function vf(e){const t=Et(e),r=m.useRef(""),n=m.useRef(0),s=m.useCallback(a=>{const i=r.current+a;t(i),function c(d){r.current=d,window.clearTimeout(n.current),d!==""&&(n.current=window.setTimeout(()=>c(""),1e3))}(i)},[t]),o=m.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,s,o]}function gf(e,t,r){const s=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let a=Kw(e,Math.max(o,0));s.length===1&&(a=a.filter(d=>d!==r));const c=a.find(d=>d.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==r?c:void 0}function Kw(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Qw=Hu,yf=Yu,Gw=Zu,Xw=Ku,Jw=Qu,bf=Gu,Rw=ef,wf=nf,xf=of,e0=af,t0=cf,_f=df,Cf=uf,Sf=hf;const cn=Qw,dn=Gw,Fr=m.forwardRef(({className:e,children:t,...r},n)=>l.jsxs(yf,{ref:n,className:he("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,l.jsx(Xw,{asChild:!0,children:l.jsx(Gl,{className:"h-4 w-4 opacity-50"})})]}));Fr.displayName=yf.displayName;const kf=m.forwardRef(({className:e,...t},r)=>l.jsx(_f,{ref:r,className:he("flex cursor-default items-center justify-center py-1",e),...t,children:l.jsx(Vp,{className:"h-4 w-4"})}));kf.displayName=_f.displayName;const Nf=m.forwardRef(({className:e,...t},r)=>l.jsx(Cf,{ref:r,className:he("flex cursor-default items-center justify-center py-1",e),...t,children:l.jsx(Gl,{className:"h-4 w-4"})}));Nf.displayName=Cf.displayName;const Lr=m.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>l.jsx(Jw,{children:l.jsxs(bf,{ref:s,className:he("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[l.jsx(kf,{}),l.jsx(Rw,{className:he("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),l.jsx(Nf,{})]})}));Lr.displayName=bf.displayName;const r0=m.forwardRef(({className:e,...t},r)=>l.jsx(wf,{ref:r,className:he("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));r0.displayName=wf.displayName;const re=m.forwardRef(({className:e,children:t,...r},n)=>l.jsxs(xf,{ref:n,className:he("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(t0,{children:l.jsx(Ql,{className:"h-4 w-4"})})}),l.jsx(e0,{children:t})]}));re.displayName=xf.displayName;const n0=m.forwardRef(({className:e,...t},r)=>l.jsx(Sf,{ref:r,className:he("-mx-1 my-1 h-px bg-muted",e),...t}));n0.displayName=Sf.displayName;const s0=As({industry:Xe().min(1,"Industry is required"),business_model:Xe().min(1,"Business model is required"),annual_sales_volume:Xe().min(1,"Annual sales volume is required"),website_url:Xe().url("Please enter a valid URL").optional().or(Tb(""))}),o0=({data:e,onDataChange:t,onContinue:r,onBack:n,renderProgress:s})=>{const o=Ss({resolver:ks(s0),defaultValues:{industry:e.industry,business_model:e.business_model,annual_sales_volume:e.annual_sales_volume,website_url:e.website_url}}),a=i=>{t(i),r()};return l.jsxs(st,{className:"w-full max-w-2xl mx-auto",children:[l.jsx(kr,{children:l.jsx(Nr,{title:"Company Activity",subTitle:"Tell us about your business operations",onBack:n})}),l.jsxs(ot,{children:[l.jsx(Ds,{...o,children:l.jsxs("form",{onSubmit:o.handleSubmit(a),className:"space-y-6",children:[l.jsx(qe,{control:o.control,name:"industry",render:({field:i})=>l.jsxs($e,{children:[l.jsx(Be,{children:"Industry"}),l.jsxs(cn,{onValueChange:i.onChange,defaultValue:i.value,children:[l.jsx(We,{children:l.jsx(Fr,{children:l.jsx(dn,{placeholder:"Select industry"})})}),l.jsxs(Lr,{children:[l.jsx(re,{value:"technology",children:"Technology"}),l.jsx(re,{value:"finance",children:"Finance"}),l.jsx(re,{value:"healthcare",children:"Healthcare"}),l.jsx(re,{value:"retail",children:"Retail"}),l.jsx(re,{value:"manufacturing",children:"Manufacturing"}),l.jsx(re,{value:"education",children:"Education"}),l.jsx(re,{value:"hospitality",children:"Hospitality"}),l.jsx(re,{value:"real-estate",children:"Real Estate"}),l.jsx(re,{value:"consulting",children:"Consulting"}),l.jsx(re,{value:"other",children:"Other"})]})]}),l.jsx(je,{})]})}),l.jsx(qe,{control:o.control,name:"business_model",render:({field:i})=>l.jsxs($e,{children:[l.jsx(Be,{children:"Business Model"}),l.jsxs(cn,{onValueChange:i.onChange,defaultValue:i.value,children:[l.jsx(We,{children:l.jsx(Fr,{children:l.jsx(dn,{placeholder:"Select business model"})})}),l.jsxs(Lr,{children:[l.jsx(re,{value:"b2b",children:"B2B (Business to Business)"}),l.jsx(re,{value:"b2c",children:"B2C (Business to Consumer)"}),l.jsx(re,{value:"b2b2c",children:"B2B2C (Business to Business to Consumer)"}),l.jsx(re,{value:"marketplace",children:"Marketplace"}),l.jsx(re,{value:"saas",children:"SaaS (Software as a Service)"}),l.jsx(re,{value:"subscription",children:"Subscription"}),l.jsx(re,{value:"freemium",children:"Freemium"}),l.jsx(re,{value:"other",children:"Other"})]})]}),l.jsx(je,{})]})}),l.jsx(qe,{control:o.control,name:"annual_sales_volume",render:({field:i})=>l.jsxs($e,{children:[l.jsx(Be,{children:"Annual Sales Volume (USD)"}),l.jsxs(cn,{onValueChange:i.onChange,defaultValue:i.value,children:[l.jsx(We,{children:l.jsx(Fr,{children:l.jsx(dn,{placeholder:"Select annual sales volume"})})}),l.jsxs(Lr,{children:[l.jsx(re,{value:"0-50k",children:"$0 - $50,000"}),l.jsx(re,{value:"50k-100k",children:"$50,000 - $100,000"}),l.jsx(re,{value:"100k-500k",children:"$100,000 - $500,000"}),l.jsx(re,{value:"500k-1m",children:"$500,000 - $1,000,000"}),l.jsx(re,{value:"1m-5m",children:"$1,000,000 - $5,000,000"}),l.jsx(re,{value:"5m-10m",children:"$5,000,000 - $10,000,000"}),l.jsx(re,{value:"10m+",children:"$10,000,000+"})]})]}),l.jsx(je,{})]})}),l.jsx(qe,{control:o.control,name:"website_url",render:({field:i})=>l.jsxs($e,{children:[l.jsx(Be,{children:"Website URL (Optional)"}),l.jsx(We,{children:l.jsx(ft,{placeholder:"https://www.yourcompany.com",...i})}),l.jsx(je,{})]})}),l.jsx(He,{type:"submit",className:"w-full",children:"Continue"})]})}),l.jsx("div",{className:"mt-6",children:s()})]})]})},a0=As({street:Xe().min(1,"Street is required"),number:Xe().min(1,"Number is required"),postal_code:Xe().min(1,"Postal code is required"),city:Xe().min(1,"City is required"),address_country:Xe().min(1,"Country is required"),state:Xe()}),i0=({data:e,onDataChange:t,onContinue:r,onBack:n,renderProgress:s})=>{const o=Ss({resolver:ks(a0),defaultValues:{street:e.street,number:e.number,postal_code:e.postal_code,city:e.city,address_country:e.address_country,state:e.state}}),a=i=>{t(i),r()};return l.jsxs(st,{className:"w-full max-w-2xl mx-auto",children:[l.jsx(kr,{children:l.jsx(Nr,{title:"Business Address",subTitle:"Please provide your business address",onBack:n})}),l.jsxs(ot,{children:[l.jsx(Ds,{...o,children:l.jsxs("form",{onSubmit:o.handleSubmit(a),className:"space-y-6",children:[l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[l.jsx(qe,{control:o.control,name:"street",render:({field:i})=>l.jsxs($e,{children:[l.jsx(Be,{children:"Street"}),l.jsx(We,{children:l.jsx(ft,{placeholder:"Enter street name",...i})}),l.jsx(je,{})]})}),l.jsx(qe,{control:o.control,name:"number",render:({field:i})=>l.jsxs($e,{children:[l.jsx(Be,{children:"Suite / Unit Number"}),l.jsx(We,{children:l.jsx(ft,{placeholder:"Enter suite / unit",...i})}),l.jsx(je,{})]})})]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[l.jsx(qe,{control:o.control,name:"postal_code",render:({field:i})=>l.jsxs($e,{children:[l.jsx(Be,{children:"Zip Code / Postal Code"}),l.jsx(We,{children:l.jsx(ft,{placeholder:"Enter zip/postal code",...i})}),l.jsx(je,{})]})}),l.jsx(qe,{control:o.control,name:"city",render:({field:i})=>l.jsxs($e,{children:[l.jsx(Be,{children:"City"}),l.jsx(We,{children:l.jsx(ft,{placeholder:"Enter city",...i})}),l.jsx(je,{})]})})]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[l.jsx(qe,{control:o.control,name:"address_country",render:({field:i})=>l.jsxs($e,{children:[l.jsx(Be,{children:"Country"}),l.jsxs(cn,{onValueChange:i.onChange,defaultValue:i.value,children:[l.jsx(We,{children:l.jsx(Fr,{children:l.jsx(dn,{placeholder:"Select country"})})}),l.jsxs(Lr,{children:[l.jsx(re,{value:"us",children:"United States"}),l.jsx(re,{value:"uk",children:"United Kingdom"}),l.jsx(re,{value:"ca",children:"Canada"}),l.jsx(re,{value:"au",children:"Australia"}),l.jsx(re,{value:"de",children:"Germany"}),l.jsx(re,{value:"fr",children:"France"}),l.jsx(re,{value:"other",children:"Other"})]})]}),l.jsx(je,{})]})}),l.jsx(qe,{control:o.control,name:"state",render:({field:i})=>l.jsxs($e,{children:[l.jsx(Be,{children:"State / Province"}),l.jsx(We,{children:l.jsx(ft,{placeholder:"Enter state / province",...i})}),l.jsx(je,{})]})})]}),l.jsx(He,{type:"submit",className:"w-full",children:"Continue"})]})}),l.jsx("div",{className:"mt-6",children:s()})]})]})};function _e(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function Ct(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function it(e,t){const r=_e(e);return isNaN(t)?Ct(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function It(e,t){const r=_e(e);if(isNaN(t))return Ct(e,NaN);if(!t)return r;const n=r.getDate(),s=Ct(e,r.getTime());s.setMonth(r.getMonth()+t+1,0);const o=s.getDate();return n>=o?s:(r.setFullYear(s.getFullYear(),s.getMonth(),n),r)}const Ni=6048e5,l0=864e5;let c0={};function Fs(){return c0}function Kt(e,t){var i,c,d,u;const r=Fs(),n=(t==null?void 0:t.weekStartsOn)??((c=(i=t==null?void 0:t.locale)==null?void 0:i.options)==null?void 0:c.weekStartsOn)??r.weekStartsOn??((u=(d=r.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,s=_e(e),o=s.getDay(),a=(o<n?7:0)+o-n;return s.setDate(s.getDate()-a),s.setHours(0,0,0,0),s}function un(e){return Kt(e,{weekStartsOn:1})}function Ef(e){const t=_e(e),r=t.getFullYear(),n=Ct(e,0);n.setFullYear(r+1,0,4),n.setHours(0,0,0,0);const s=un(n),o=Ct(e,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);const a=un(o);return t.getTime()>=s.getTime()?r+1:t.getTime()>=a.getTime()?r:r-1}function Yn(e){const t=_e(e);return t.setHours(0,0,0,0),t}function qo(e){const t=_e(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function Qt(e,t){const r=Yn(e),n=Yn(t),s=+r-qo(r),o=+n-qo(n);return Math.round((s-o)/l0)}function d0(e){const t=Ef(e),r=Ct(e,0);return r.setFullYear(t,0,4),r.setHours(0,0,0,0),un(r)}function Ei(e,t){const r=t*7;return it(e,r)}function u0(e,t){return It(e,t*12)}function f0(e){let t;return e.forEach(function(r){const n=_e(r);(t===void 0||t<n||isNaN(Number(n)))&&(t=n)}),t||new Date(NaN)}function h0(e){let t;return e.forEach(r=>{const n=_e(r);(!t||t>n||isNaN(+n))&&(t=n)}),t||new Date(NaN)}function pt(e,t){const r=Yn(e),n=Yn(t);return+r==+n}function Pi(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function p0(e){if(!Pi(e)&&typeof e!="number")return!1;const t=_e(e);return!isNaN(Number(t))}function Ls(e,t){const r=_e(e),n=_e(t),s=r.getFullYear()-n.getFullYear(),o=r.getMonth()-n.getMonth();return s*12+o}function m0(e,t,r){const n=Kt(e,r),s=Kt(t,r),o=+n-qo(n),a=+s-qo(s);return Math.round((o-a)/Ni)}function Ti(e){const t=_e(e),r=t.getMonth();return t.setFullYear(t.getFullYear(),r+1,0),t.setHours(23,59,59,999),t}function mt(e){const t=_e(e);return t.setDate(1),t.setHours(0,0,0,0),t}function Pf(e){const t=_e(e),r=Ct(e,0);return r.setFullYear(t.getFullYear(),0,1),r.setHours(0,0,0,0),r}function Oi(e,t){var i,c,d,u;const r=Fs(),n=(t==null?void 0:t.weekStartsOn)??((c=(i=t==null?void 0:t.locale)==null?void 0:i.options)==null?void 0:c.weekStartsOn)??r.weekStartsOn??((u=(d=r.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,s=_e(e),o=s.getDay(),a=(o<n?-7:0)+6-(o-n);return s.setDate(s.getDate()+a),s.setHours(23,59,59,999),s}function Tf(e){return Oi(e,{weekStartsOn:1})}const v0={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},g0=(e,t,r)=>{let n;const s=v0[e];return typeof s=="string"?n=s:t===1?n=s.one:n=s.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function Mi(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const y0={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},b0={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},w0={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},x0={date:Mi({formats:y0,defaultWidth:"full"}),time:Mi({formats:b0,defaultWidth:"full"}),dateTime:Mi({formats:w0,defaultWidth:"full"})},_0={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},C0=(e,t,r,n)=>_0[e];function Vs(e){return(t,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let s;if(n==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,i=r!=null&&r.width?String(r.width):a;s=e.formattingValues[i]||e.formattingValues[a]}else{const a=e.defaultWidth,i=r!=null&&r.width?String(r.width):e.defaultWidth;s=e.values[i]||e.values[a]}const o=e.argumentCallback?e.argumentCallback(t):t;return s[o]}}const S0={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},k0={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},N0={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},E0={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},P0={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},T0={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},O0={ordinalNumber:(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:Vs({values:S0,defaultWidth:"wide"}),quarter:Vs({values:k0,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Vs({values:N0,defaultWidth:"wide"}),day:Vs({values:E0,defaultWidth:"wide"}),dayPeriod:Vs({values:P0,defaultWidth:"wide",formattingValues:T0,defaultFormattingWidth:"wide"})};function $s(e){return(t,r={})=>{const n=r.width,s=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],o=t.match(s);if(!o)return null;const a=o[0],i=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(i)?A0(i,h=>h.test(a)):M0(i,h=>h.test(a));let d;d=e.valueCallback?e.valueCallback(c):c,d=r.valueCallback?r.valueCallback(d):d;const u=t.slice(a.length);return{value:d,rest:u}}}function M0(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function A0(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function D0(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const s=n[0],o=t.match(e.parsePattern);if(!o)return null;let a=e.valueCallback?e.valueCallback(o[0]):o[0];a=r.valueCallback?r.valueCallback(a):a;const i=t.slice(s.length);return{value:a,rest:i}}}const I0=/^(\d+)(th|st|nd|rd)?/i,F0=/\d+/i,L0={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},V0={any:[/^b/i,/^(a|c)/i]},$0={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},B0={any:[/1/i,/2/i,/3/i,/4/i]},W0={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},j0={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},U0={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},H0={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},z0={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Y0={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},q0={ordinalNumber:D0({matchPattern:I0,parsePattern:F0,valueCallback:e=>parseInt(e,10)}),era:$s({matchPatterns:L0,defaultMatchWidth:"wide",parsePatterns:V0,defaultParseWidth:"any"}),quarter:$s({matchPatterns:$0,defaultMatchWidth:"wide",parsePatterns:B0,defaultParseWidth:"any",valueCallback:e=>e+1}),month:$s({matchPatterns:W0,defaultMatchWidth:"wide",parsePatterns:j0,defaultParseWidth:"any"}),day:$s({matchPatterns:U0,defaultMatchWidth:"wide",parsePatterns:H0,defaultParseWidth:"any"}),dayPeriod:$s({matchPatterns:z0,defaultMatchWidth:"any",parsePatterns:Y0,defaultParseWidth:"any"})},Of={code:"en-US",formatDistance:g0,formatLong:x0,formatRelative:C0,localize:O0,match:q0,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Z0(e){const t=_e(e);return Qt(t,Pf(t))+1}function Mf(e){const t=_e(e),r=+un(t)-+d0(t);return Math.round(r/Ni)+1}function Af(e,t){var u,h,v,f;const r=_e(e),n=r.getFullYear(),s=Fs(),o=(t==null?void 0:t.firstWeekContainsDate)??((h=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??s.firstWeekContainsDate??((f=(v=s.locale)==null?void 0:v.options)==null?void 0:f.firstWeekContainsDate)??1,a=Ct(e,0);a.setFullYear(n+1,0,o),a.setHours(0,0,0,0);const i=Kt(a,t),c=Ct(e,0);c.setFullYear(n,0,o),c.setHours(0,0,0,0);const d=Kt(c,t);return r.getTime()>=i.getTime()?n+1:r.getTime()>=d.getTime()?n:n-1}function K0(e,t){var i,c,d,u;const r=Fs(),n=(t==null?void 0:t.firstWeekContainsDate)??((c=(i=t==null?void 0:t.locale)==null?void 0:i.options)==null?void 0:c.firstWeekContainsDate)??r.firstWeekContainsDate??((u=(d=r.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,s=Af(e,t),o=Ct(e,0);return o.setFullYear(s,0,n),o.setHours(0,0,0,0),Kt(o,t)}function Df(e,t){const r=_e(e),n=+Kt(r,t)-+K0(r,t);return Math.round(n/Ni)+1}function Pe(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const Vr={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return Pe(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):Pe(r+1,2)},d(e,t){return Pe(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return Pe(e.getHours()%12||12,t.length)},H(e,t){return Pe(e.getHours(),t.length)},m(e,t){return Pe(e.getMinutes(),t.length)},s(e,t){return Pe(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),s=Math.trunc(n*Math.pow(10,r-3));return Pe(s,t.length)}},qn={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},If={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const n=e.getFullYear(),s=n>0?n:1-n;return r.ordinalNumber(s,{unit:"year"})}return Vr.y(e,t)},Y:function(e,t,r,n){const s=Af(e,n),o=s>0?s:1-s;if(t==="YY"){const a=o%100;return Pe(a,2)}return t==="Yo"?r.ordinalNumber(o,{unit:"year"}):Pe(o,t.length)},R:function(e,t){const r=Ef(e);return Pe(r,t.length)},u:function(e,t){const r=e.getFullYear();return Pe(r,t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return Pe(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return Pe(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return Vr.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return Pe(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const s=Df(e,n);return t==="wo"?r.ordinalNumber(s,{unit:"week"}):Pe(s,t.length)},I:function(e,t,r){const n=Mf(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):Pe(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):Vr.d(e,t)},D:function(e,t,r){const n=Z0(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):Pe(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const s=e.getDay(),o=(s-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return Pe(o,2);case"eo":return r.ordinalNumber(o,{unit:"day"});case"eee":return r.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(s,{width:"short",context:"formatting"});case"eeee":default:return r.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const s=e.getDay(),o=(s-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return Pe(o,t.length);case"co":return r.ordinalNumber(o,{unit:"day"});case"ccc":return r.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(s,{width:"narrow",context:"standalone"});case"cccccc":return r.day(s,{width:"short",context:"standalone"});case"cccc":default:return r.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),s=n===0?7:n;switch(t){case"i":return String(s);case"ii":return Pe(s,t.length);case"io":return r.ordinalNumber(s,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const s=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let s;switch(n===12?s=qn.noon:n===0?s=qn.midnight:s=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let s;switch(n>=17?s=qn.evening:n>=12?s=qn.afternoon:n>=4?s=qn.morning:s=qn.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let n=e.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return Vr.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):Vr.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):Pe(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):Pe(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):Vr.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):Vr.s(e,t)},S:function(e,t){return Vr.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return Lf(n);case"XXXX":case"XX":return fn(n);case"XXXXX":case"XXX":default:return fn(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return Lf(n);case"xxxx":case"xx":return fn(n);case"xxxxx":case"xxx":default:return fn(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Ff(n,":");case"OOOO":default:return"GMT"+fn(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Ff(n,":");case"zzzz":default:return"GMT"+fn(n,":")}},t:function(e,t,r){const n=Math.trunc(e.getTime()/1e3);return Pe(n,t.length)},T:function(e,t,r){const n=e.getTime();return Pe(n,t.length)}};function Ff(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),s=Math.trunc(n/60),o=n%60;return o===0?r+String(s):r+String(s)+t+Pe(o,2)}function Lf(e,t){return e%60===0?(e>0?"-":"+")+Pe(Math.abs(e)/60,2):fn(e,t)}function fn(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),s=Pe(Math.trunc(n/60),2),o=Pe(n%60,2);return r+s+t+o}const Vf=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},$f=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Q0={p:$f,P:(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],s=r[2];if(!s)return Vf(e,t);let o;switch(n){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",Vf(n,t)).replace("{{time}}",$f(s,t))}},G0=/^D+$/,X0=/^Y+$/,J0=["D","DD","YY","YYYY"];function R0(e){return G0.test(e)}function ex(e){return X0.test(e)}function tx(e,t,r){const n=rx(e,t,r);if(console.warn(n),J0.includes(e))throw new RangeError(n)}function rx(e,t,r){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const nx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,sx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ox=/^'([^]*?)'?$/,ax=/''/g,ix=/[a-zA-Z]/;function cr(e,t,r){var u,h,v,f,b,p,g,x;const n=Fs(),s=(r==null?void 0:r.locale)??n.locale??Of,o=(r==null?void 0:r.firstWeekContainsDate)??((h=(u=r==null?void 0:r.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(v=n.locale)==null?void 0:v.options)==null?void 0:f.firstWeekContainsDate)??1,a=(r==null?void 0:r.weekStartsOn)??((p=(b=r==null?void 0:r.locale)==null?void 0:b.options)==null?void 0:p.weekStartsOn)??n.weekStartsOn??((x=(g=n.locale)==null?void 0:g.options)==null?void 0:x.weekStartsOn)??0,i=_e(e);if(!p0(i))throw new RangeError("Invalid time value");let c=t.match(sx).map(y=>{const w=y[0];if(w==="p"||w==="P"){const k=Q0[w];return k(y,s.formatLong)}return y}).join("").match(nx).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const w=y[0];if(w==="'")return{isToken:!1,value:lx(y)};if(If[w])return{isToken:!0,value:y};if(w.match(ix))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:y}});s.localize.preprocessor&&(c=s.localize.preprocessor(i,c));const d={firstWeekContainsDate:o,weekStartsOn:a,locale:s};return c.map(y=>{if(!y.isToken)return y.value;const w=y.value;(!(r!=null&&r.useAdditionalWeekYearTokens)&&ex(w)||!(r!=null&&r.useAdditionalDayOfYearTokens)&&R0(w))&&tx(w,t,String(e));const k=If[w[0]];return k(i,w,s.localize,d)}).join("")}function lx(e){const t=e.match(ox);return t?t[1].replace(ax,"'"):e}function cx(e){const t=_e(e),r=t.getFullYear(),n=t.getMonth(),s=Ct(e,0);return s.setFullYear(r,n+1,0),s.setHours(0,0,0,0),s.getDate()}function dx(e){return Math.trunc(+_e(e)/1e3)}function ux(e){const t=_e(e),r=t.getMonth();return t.setFullYear(t.getFullYear(),r+1,0),t.setHours(0,0,0,0),t}function fx(e,t){return m0(ux(e),mt(e),t)+1}function Ai(e,t){const r=_e(e),n=_e(t);return r.getTime()>n.getTime()}function Bf(e,t){const r=_e(e),n=_e(t);return+r<+n}function Di(e,t){const r=_e(e),n=_e(t);return r.getFullYear()===n.getFullYear()&&r.getMonth()===n.getMonth()}function hx(e,t){const r=_e(e),n=_e(t);return r.getFullYear()===n.getFullYear()}function Ii(e,t){return it(e,-t)}function Fi(e,t){const r=_e(e),n=r.getFullYear(),s=r.getDate(),o=Ct(e,0);o.setFullYear(n,t,15),o.setHours(0,0,0,0);const a=cx(o);return r.setMonth(t,Math.min(s,a)),r}function Wf(e,t){const r=_e(e);return isNaN(+r)?Ct(e,NaN):(r.setFullYear(t),r)}var Zo="Popover",[jf,OC]=Rr(Zo,[On]),Bs=On(),[px,$r]=jf(Zo),Uf=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:s,onOpenChange:o,modal:a=!1}=e,i=Bs(t),c=m.useRef(null),[d,u]=m.useState(!1),[h,v]=Rs({prop:n,defaultProp:s??!1,onChange:o,caller:Zo});return l.jsx(Yc,{...i,children:l.jsx(px,{scope:t,contentId:so(),triggerRef:c,open:h,onOpenChange:v,onOpenToggle:m.useCallback(()=>v(f=>!f),[v]),hasCustomAnchor:d,onCustomAnchorAdd:m.useCallback(()=>u(!0),[]),onCustomAnchorRemove:m.useCallback(()=>u(!1),[]),modal:a,children:r})})};Uf.displayName=Zo;var Hf="PopoverAnchor",mx=m.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=$r(Hf,r),o=Bs(r),{onCustomAnchorAdd:a,onCustomAnchorRemove:i}=s;return m.useEffect(()=>(a(),()=>i()),[a,i]),l.jsx(mo,{...o,...n,ref:t})});mx.displayName=Hf;var zf="PopoverTrigger",Yf=m.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=$r(zf,r),o=Bs(r),a=Ie(t,s.triggerRef),i=l.jsx(we.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Gf(s.open),...n,ref:a,onClick:ie(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?i:l.jsx(mo,{asChild:!0,...o,children:i})});Yf.displayName=zf;var Li="PopoverPortal",[vx,gx]=jf(Li,{forceMount:void 0}),qf=e=>{const{__scopePopover:t,forceMount:r,children:n,container:s}=e,o=$r(Li,t);return l.jsx(vx,{scope:t,forceMount:r,children:l.jsx(us,{present:r||o.open,children:l.jsx(Xs,{asChild:!0,container:s,children:n})})})};qf.displayName=Li;var Zn="PopoverContent",Zf=m.forwardRef((e,t)=>{const r=gx(Zn,e.__scopePopover),{forceMount:n=r.forceMount,...s}=e,o=$r(Zn,e.__scopePopover);return l.jsx(us,{present:n||o.open,children:o.modal?l.jsx(bx,{...s,ref:t}):l.jsx(wx,{...s,ref:t})})});Zf.displayName=Zn;var yx=Cn("PopoverContent.RemoveScroll"),bx=m.forwardRef((e,t)=>{const r=$r(Zn,e.__scopePopover),n=m.useRef(null),s=Ie(t,n),o=m.useRef(!1);return m.useEffect(()=>{const a=n.current;if(a)return Ou(a)},[]),l.jsx(bi,{as:yx,allowPinchZoom:!0,children:l.jsx(Kf,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ie(e.onCloseAutoFocus,a=>{var i;a.preventDefault(),o.current||(i=r.triggerRef.current)==null||i.focus()}),onPointerDownOutside:ie(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,c=i.button===0&&i.ctrlKey===!0,d=i.button===2||c;o.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:ie(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),wx=m.forwardRef((e,t)=>{const r=$r(Zn,e.__scopePopover),n=m.useRef(!1),s=m.useRef(!1);return l.jsx(Kf,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a,i;(a=e.onCloseAutoFocus)==null||a.call(e,o),o.defaultPrevented||(n.current||(i=r.triggerRef.current)==null||i.focus(),o.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:o=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=o.target;((d=r.triggerRef.current)==null?void 0:d.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),Kf=m.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:u,...h}=e,v=$r(Zn,r),f=Bs(r);return _u(),l.jsx(hi,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:o,children:l.jsx(ds,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:u,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>v.onOpenChange(!1),children:l.jsx(Aa,{"data-state":Gf(v.open),role:"dialog",id:v.contentId,...f,...h,ref:t,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Qf="PopoverClose",xx=m.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=$r(Qf,r);return l.jsx(we.button,{type:"button",...n,ref:t,onClick:ie(e.onClick,()=>s.onOpenChange(!1))})});xx.displayName=Qf;var _x="PopoverArrow",Cx=m.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=Bs(r);return l.jsx(Da,{...s,...n,ref:t})});Cx.displayName=_x;function Gf(e){return e?"open":"closed"}var Sx=Uf,kx=Yf,Nx=qf,Xf=Zf;const Jf=Sx,Rf=kx,Vi=m.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},s)=>l.jsx(Nx,{children:l.jsx(Xf,{ref:s,align:t,sideOffset:r,className:he("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Vi.displayName=Xf.displayName;var te=function(){return te=Object.assign||function(t){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},te.apply(this,arguments)};function Ex(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}function eh(e,t,r){for(var n=0,s=t.length,o;n<s;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;function Ws(e){return e.mode==="multiple"}function js(e){return e.mode==="range"}function Ko(e){return e.mode==="single"}var Px={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function Tx(e,t){return cr(e,"LLLL y",t)}function Ox(e,t){return cr(e,"d",t)}function Mx(e,t){return cr(e,"LLLL",t)}function Ax(e){return"".concat(e)}function Dx(e,t){return cr(e,"cccccc",t)}function Ix(e,t){return cr(e,"yyyy",t)}var Fx=Object.freeze({__proto__:null,formatCaption:Tx,formatDay:Ox,formatMonthCaption:Mx,formatWeekNumber:Ax,formatWeekdayName:Dx,formatYearCaption:Ix}),Lx=function(e,t,r){return cr(e,"do MMMM (EEEE)",r)},Vx=function(){return"Month: "},$x=function(){return"Go to next month"},Bx=function(){return"Go to previous month"},Wx=function(e,t){return cr(e,"cccc",t)},jx=function(e){return"Week n. ".concat(e)},Ux=function(){return"Year: "},Hx=Object.freeze({__proto__:null,labelDay:Lx,labelMonthDropdown:Vx,labelNext:$x,labelPrevious:Bx,labelWeekNumber:jx,labelWeekday:Wx,labelYearDropdown:Ux});function zx(){var e="buttons",t=Px,r=Of,n={},s={},o=1,a={},i=new Date;return{captionLayout:e,classNames:t,formatters:Fx,labels:Hx,locale:r,modifiersClassNames:n,modifiers:s,numberOfMonths:o,styles:a,today:i,mode:"default"}}function Yx(e){var t=e.fromYear,r=e.toYear,n=e.fromMonth,s=e.toMonth,o=e.fromDate,a=e.toDate;return n?o=mt(n):t&&(o=new Date(t,0,1)),s?a=Ti(s):r&&(a=new Date(r,11,31)),{fromDate:o?Yn(o):void 0,toDate:a?Yn(a):void 0}}var th=S.createContext(void 0);function qx(e){var t,r=e.initialProps,n=zx(),s=Yx(r),o=s.fromDate,a=s.toDate,i=(t=r.captionLayout)!==null&&t!==void 0?t:n.captionLayout;i!=="buttons"&&(!o||!a)&&(i="buttons");var c;(Ko(r)||Ws(r)||js(r))&&(c=r.onSelect);var d=te(te(te({},n),r),{captionLayout:i,classNames:te(te({},n.classNames),r.classNames),components:te({},r.components),formatters:te(te({},n.formatters),r.formatters),fromDate:o,labels:te(te({},n.labels),r.labels),mode:r.mode||n.mode,modifiers:te(te({},n.modifiers),r.modifiers),modifiersClassNames:te(te({},n.modifiersClassNames),r.modifiersClassNames),onSelect:c,styles:te(te({},n.styles),r.styles),toDate:a});return l.jsx(th.Provider,{value:d,children:e.children})}function Me(){var e=S.useContext(th);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function rh(e){var t=Me(),r=t.locale,n=t.classNames,s=t.styles,o=t.formatters.formatCaption;return l.jsx("div",{className:n.caption_label,style:s.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:o(e.displayMonth,{locale:r})})}function Zx(e){return l.jsx("svg",te({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:l.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function nh(e){var t,r,n=e.onChange,s=e.value,o=e.children,a=e.caption,i=e.className,c=e.style,d=Me(),u=(r=(t=d.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&r!==void 0?r:Zx;return l.jsxs("div",{className:i,style:c,children:[l.jsx("span",{className:d.classNames.vhidden,children:e["aria-label"]}),l.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:d.classNames.dropdown,style:d.styles.dropdown,value:s,onChange:n,children:o}),l.jsxs("div",{className:d.classNames.caption_label,style:d.styles.caption_label,"aria-hidden":"true",children:[a,l.jsx(u,{className:d.classNames.dropdown_icon,style:d.styles.dropdown_icon})]})]})}function Kx(e){var t,r=Me(),n=r.fromDate,s=r.toDate,o=r.styles,a=r.locale,i=r.formatters.formatMonthCaption,c=r.classNames,d=r.components,u=r.labels.labelMonthDropdown;if(!n)return l.jsx(l.Fragment,{});if(!s)return l.jsx(l.Fragment,{});var h=[];if(hx(n,s))for(var v=mt(n),f=n.getMonth();f<=s.getMonth();f++)h.push(Fi(v,f));else for(var v=mt(new Date),f=0;f<=11;f++)h.push(Fi(v,f));var b=function(g){var x=Number(g.target.value),y=Fi(mt(e.displayMonth),x);e.onChange(y)},p=(t=d==null?void 0:d.Dropdown)!==null&&t!==void 0?t:nh;return l.jsx(p,{name:"months","aria-label":u(),className:c.dropdown_month,style:o.dropdown_month,onChange:b,value:e.displayMonth.getMonth(),caption:i(e.displayMonth,{locale:a}),children:h.map(function(g){return l.jsx("option",{value:g.getMonth(),children:i(g,{locale:a})},g.getMonth())})})}function Qx(e){var t,r=e.displayMonth,n=Me(),s=n.fromDate,o=n.toDate,a=n.locale,i=n.styles,c=n.classNames,d=n.components,u=n.formatters.formatYearCaption,h=n.labels.labelYearDropdown,v=[];if(!s)return l.jsx(l.Fragment,{});if(!o)return l.jsx(l.Fragment,{});for(var f=s.getFullYear(),b=o.getFullYear(),p=f;p<=b;p++)v.push(Wf(Pf(new Date),p));var g=function(y){var w=Wf(mt(r),Number(y.target.value));e.onChange(w)},x=(t=d==null?void 0:d.Dropdown)!==null&&t!==void 0?t:nh;return l.jsx(x,{name:"years","aria-label":h(),className:c.dropdown_year,style:i.dropdown_year,onChange:g,value:r.getFullYear(),caption:u(r,{locale:a}),children:v.map(function(y){return l.jsx("option",{value:y.getFullYear(),children:u(y,{locale:a})},y.getFullYear())})})}function Gx(e,t){var r=S.useState(e),n=r[0],s=r[1],o=t===void 0?n:t;return[o,s]}function Xx(e){var t=e.month,r=e.defaultMonth,n=e.today,s=t||r||n||new Date,o=e.toDate,a=e.fromDate,i=e.numberOfMonths,c=i===void 0?1:i;if(o&&Ls(o,s)<0){var d=-1*(c-1);s=It(o,d)}return a&&Ls(s,a)<0&&(s=a),mt(s)}function Jx(){var e=Me(),t=Xx(e),r=Gx(t,e.month),n=r[0],s=r[1],o=function(a){var i;if(!e.disableNavigation){var c=mt(a);s(c),(i=e.onMonthChange)===null||i===void 0||i.call(e,c)}};return[n,o]}function Rx(e,t){for(var r=t.reverseMonths,n=t.numberOfMonths,s=mt(e),o=mt(It(s,n)),a=Ls(o,s),i=[],c=0;c<a;c++){var d=It(s,c);i.push(d)}return r&&(i=i.reverse()),i}function e_(e,t){if(!t.disableNavigation){var r=t.toDate,n=t.pagedNavigation,s=t.numberOfMonths,o=s===void 0?1:s,a=n?o:1,i=mt(e);if(!r)return It(i,a);var c=Ls(r,e);if(!(c<o))return It(i,a)}}function t_(e,t){if(!t.disableNavigation){var r=t.fromDate,n=t.pagedNavigation,s=t.numberOfMonths,o=s===void 0?1:s,a=n?o:1,i=mt(e);if(!r)return It(i,-a);var c=Ls(i,r);if(!(c<=0))return It(i,-a)}}var sh=S.createContext(void 0);function r_(e){var t=Me(),r=Jx(),n=r[0],s=r[1],o=Rx(n,t),a=e_(n,t),i=t_(n,t),c=function(h){return o.some(function(v){return Di(h,v)})},d=function(h,v){c(h)||(v&&Bf(h,v)?s(It(h,1+t.numberOfMonths*-1)):s(h))},u={currentMonth:n,displayMonths:o,goToMonth:s,goToDate:d,previousMonth:i,nextMonth:a,isDateDisplayed:c};return l.jsx(sh.Provider,{value:u,children:e.children})}function Us(){var e=S.useContext(sh);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function oh(e){var t,r=Me(),n=r.classNames,s=r.styles,o=r.components,a=Us().goToMonth,i=function(u){a(It(u,e.displayIndex?-e.displayIndex:0))},c=(t=o==null?void 0:o.CaptionLabel)!==null&&t!==void 0?t:rh,d=l.jsx(c,{id:e.id,displayMonth:e.displayMonth});return l.jsxs("div",{className:n.caption_dropdowns,style:s.caption_dropdowns,children:[l.jsx("div",{className:n.vhidden,children:d}),l.jsx(Kx,{onChange:i,displayMonth:e.displayMonth}),l.jsx(Qx,{onChange:i,displayMonth:e.displayMonth})]})}function n_(e){return l.jsx("svg",te({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:l.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function s_(e){return l.jsx("svg",te({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:l.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var Qo=S.forwardRef(function(e,t){var r=Me(),n=r.classNames,s=r.styles,o=[n.button_reset,n.button];e.className&&o.push(e.className);var a=o.join(" "),i=te(te({},s.button_reset),s.button);return e.style&&Object.assign(i,e.style),l.jsx("button",te({},e,{ref:t,type:"button",className:a,style:i}))});function o_(e){var t,r,n=Me(),s=n.dir,o=n.locale,a=n.classNames,i=n.styles,c=n.labels,d=c.labelPrevious,u=c.labelNext,h=n.components;if(!e.nextMonth&&!e.previousMonth)return l.jsx(l.Fragment,{});var v=d(e.previousMonth,{locale:o}),f=[a.nav_button,a.nav_button_previous].join(" "),b=u(e.nextMonth,{locale:o}),p=[a.nav_button,a.nav_button_next].join(" "),g=(t=h==null?void 0:h.IconRight)!==null&&t!==void 0?t:s_,x=(r=h==null?void 0:h.IconLeft)!==null&&r!==void 0?r:n_;return l.jsxs("div",{className:a.nav,style:i.nav,children:[!e.hidePrevious&&l.jsx(Qo,{name:"previous-month","aria-label":v,className:f,style:i.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:s==="rtl"?l.jsx(g,{className:a.nav_icon,style:i.nav_icon}):l.jsx(x,{className:a.nav_icon,style:i.nav_icon})}),!e.hideNext&&l.jsx(Qo,{name:"next-month","aria-label":b,className:p,style:i.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:s==="rtl"?l.jsx(x,{className:a.nav_icon,style:i.nav_icon}):l.jsx(g,{className:a.nav_icon,style:i.nav_icon})})]})}function ah(e){var t=Me().numberOfMonths,r=Us(),n=r.previousMonth,s=r.nextMonth,o=r.goToMonth,a=r.displayMonths,i=a.findIndex(function(b){return Di(e.displayMonth,b)}),c=i===0,d=i===a.length-1,u=t>1&&(c||!d),h=t>1&&(d||!c),v=function(){n&&o(n)},f=function(){s&&o(s)};return l.jsx(o_,{displayMonth:e.displayMonth,hideNext:u,hidePrevious:h,nextMonth:s,previousMonth:n,onPreviousClick:v,onNextClick:f})}function a_(e){var t,r=Me(),n=r.classNames,s=r.disableNavigation,o=r.styles,a=r.captionLayout,i=r.components,c=(t=i==null?void 0:i.CaptionLabel)!==null&&t!==void 0?t:rh,d;return s?d=l.jsx(c,{id:e.id,displayMonth:e.displayMonth}):a==="dropdown"?d=l.jsx(oh,{displayMonth:e.displayMonth,id:e.id}):a==="dropdown-buttons"?d=l.jsxs(l.Fragment,{children:[l.jsx(oh,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),l.jsx(ah,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):d=l.jsxs(l.Fragment,{children:[l.jsx(c,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),l.jsx(ah,{displayMonth:e.displayMonth,id:e.id})]}),l.jsx("div",{className:n.caption,style:o.caption,children:d})}function i_(e){var t=Me(),r=t.footer,n=t.styles,s=t.classNames.tfoot;return r?l.jsx("tfoot",{className:s,style:n.tfoot,children:l.jsx("tr",{children:l.jsx("td",{colSpan:8,children:r})})}):l.jsx(l.Fragment,{})}function l_(e,t,r){for(var n=r?un(new Date):Kt(new Date,{locale:e,weekStartsOn:t}),s=[],o=0;o<7;o++){var a=it(n,o);s.push(a)}return s}function c_(){var e=Me(),t=e.classNames,r=e.styles,n=e.showWeekNumber,s=e.locale,o=e.weekStartsOn,a=e.ISOWeek,i=e.formatters.formatWeekdayName,c=e.labels.labelWeekday,d=l_(s,o,a);return l.jsxs("tr",{style:r.head_row,className:t.head_row,children:[n&&l.jsx("td",{style:r.head_cell,className:t.head_cell}),d.map(function(u,h){return l.jsx("th",{scope:"col",className:t.head_cell,style:r.head_cell,"aria-label":c(u,{locale:s}),children:i(u,{locale:s})},h)})]})}function d_(){var e,t=Me(),r=t.classNames,n=t.styles,s=t.components,o=(e=s==null?void 0:s.HeadRow)!==null&&e!==void 0?e:c_;return l.jsx("thead",{style:n.head,className:r.head,children:l.jsx(o,{})})}function u_(e){var t=Me(),r=t.locale,n=t.formatters.formatDay;return l.jsx(l.Fragment,{children:n(e.date,{locale:r})})}var $i=S.createContext(void 0);function f_(e){if(!Ws(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return l.jsx($i.Provider,{value:t,children:e.children})}return l.jsx(h_,{initialProps:e.initialProps,children:e.children})}function h_(e){var t=e.initialProps,r=e.children,n=t.selected,s=t.min,o=t.max,a=function(d,u,h){var v,f;(v=t.onDayClick)===null||v===void 0||v.call(t,d,u,h);var b=!!(u.selected&&s&&(n==null?void 0:n.length)===s);if(!b){var p=!!(!u.selected&&o&&(n==null?void 0:n.length)===o);if(!p){var g=n?eh([],n):[];if(u.selected){var x=g.findIndex(function(y){return pt(d,y)});g.splice(x,1)}else g.push(d);(f=t.onSelect)===null||f===void 0||f.call(t,g,d,u,h)}}},i={disabled:[]};n&&i.disabled.push(function(d){var u=o&&n.length>o-1,h=n.some(function(v){return pt(v,d)});return!!(u&&!h)});var c={selected:n,onDayClick:a,modifiers:i};return l.jsx($i.Provider,{value:c,children:r})}function Bi(){var e=S.useContext($i);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function p_(e,t){var r=t||{},n=r.from,s=r.to;return n&&s?pt(s,e)&&pt(n,e)?void 0:pt(s,e)?{from:s,to:void 0}:pt(n,e)?void 0:Ai(n,e)?{from:e,to:s}:{from:n,to:e}:s?Ai(e,s)?{from:s,to:e}:{from:e,to:s}:n?Bf(e,n)?{from:e,to:n}:{from:n,to:e}:{from:e,to:void 0}}var Wi=S.createContext(void 0);function m_(e){if(!js(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return l.jsx(Wi.Provider,{value:t,children:e.children})}return l.jsx(v_,{initialProps:e.initialProps,children:e.children})}function v_(e){var t=e.initialProps,r=e.children,n=t.selected,s=n||{},o=s.from,a=s.to,i=t.min,c=t.max,d=function(f,b,p){var g,x;(g=t.onDayClick)===null||g===void 0||g.call(t,f,b,p);var y=p_(f,n);(x=t.onSelect)===null||x===void 0||x.call(t,y,f,b,p)},u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(o?(u.range_start=[o],a?(u.range_end=[a],pt(o,a)||(u.range_middle=[{after:o,before:a}])):u.range_end=[o]):a&&(u.range_start=[a],u.range_end=[a]),i&&(o&&!a&&u.disabled.push({after:Ii(o,i-1),before:it(o,i-1)}),o&&a&&u.disabled.push({after:o,before:it(o,i-1)}),!o&&a&&u.disabled.push({after:Ii(a,i-1),before:it(a,i-1)})),c){if(o&&!a&&(u.disabled.push({before:it(o,-c+1)}),u.disabled.push({after:it(o,c-1)})),o&&a){var h=Qt(a,o)+1,v=c-h;u.disabled.push({before:Ii(o,v)}),u.disabled.push({after:it(a,v)})}!o&&a&&(u.disabled.push({before:it(a,-c+1)}),u.disabled.push({after:it(a,c-1)}))}return l.jsx(Wi.Provider,{value:{selected:n,onDayClick:d,modifiers:u},children:r})}function ji(){var e=S.useContext(Wi);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function Go(e){return Array.isArray(e)?eh([],e):e!==void 0?[e]:[]}function g_(e){var t={};return Object.entries(e).forEach(function(r){var n=r[0],s=r[1];t[n]=Go(s)}),t}var Ft;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(Ft||(Ft={}));var y_=Ft.Selected,dr=Ft.Disabled,b_=Ft.Hidden,w_=Ft.Today,Ui=Ft.RangeEnd,Hi=Ft.RangeMiddle,zi=Ft.RangeStart,x_=Ft.Outside;function __(e,t,r){var n,s=(n={},n[y_]=Go(e.selected),n[dr]=Go(e.disabled),n[b_]=Go(e.hidden),n[w_]=[e.today],n[Ui]=[],n[Hi]=[],n[zi]=[],n[x_]=[],n);return e.fromDate&&s[dr].push({before:e.fromDate}),e.toDate&&s[dr].push({after:e.toDate}),Ws(e)?s[dr]=s[dr].concat(t.modifiers[dr]):js(e)&&(s[dr]=s[dr].concat(r.modifiers[dr]),s[zi]=r.modifiers[zi],s[Hi]=r.modifiers[Hi],s[Ui]=r.modifiers[Ui]),s}var ih=S.createContext(void 0);function C_(e){var t=Me(),r=Bi(),n=ji(),s=__(t,r,n),o=g_(t.modifiers),a=te(te({},s),o);return l.jsx(ih.Provider,{value:a,children:e.children})}function lh(){var e=S.useContext(ih);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function S_(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function k_(e){return!!(e&&typeof e=="object"&&"from"in e)}function N_(e){return!!(e&&typeof e=="object"&&"after"in e)}function E_(e){return!!(e&&typeof e=="object"&&"before"in e)}function P_(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function T_(e,t){var r,n=t.from,s=t.to;if(n&&s){var o=Qt(s,n)<0;o&&(r=[s,n],n=r[0],s=r[1]);var a=Qt(e,n)>=0&&Qt(s,e)>=0;return a}return s?pt(s,e):n?pt(n,e):!1}function O_(e){return Pi(e)}function M_(e){return Array.isArray(e)&&e.every(Pi)}function A_(e,t){return t.some(function(r){if(typeof r=="boolean")return r;if(O_(r))return pt(e,r);if(M_(r))return r.includes(e);if(k_(r))return T_(e,r);if(P_(r))return r.dayOfWeek.includes(e.getDay());if(S_(r)){var n=Qt(r.before,e),s=Qt(r.after,e),o=n>0,a=s<0,i=Ai(r.before,r.after);return i?a&&o:o||a}return N_(r)?Qt(e,r.after)>0:E_(r)?Qt(r.before,e)>0:typeof r=="function"?r(e):!1})}function Yi(e,t,r){var n=Object.keys(t).reduce(function(o,a){var i=t[a];return A_(e,i)&&o.push(a),o},[]),s={};return n.forEach(function(o){return s[o]=!0}),r&&!Di(e,r)&&(s.outside=!0),s}function D_(e,t){for(var r=mt(e[0]),n=Ti(e[e.length-1]),s,o,a=r;a<=n;){var i=Yi(a,t),c=!i.disabled&&!i.hidden;if(!c){a=it(a,1);continue}if(i.selected)return a;i.today&&!o&&(o=a),s||(s=a),a=it(a,1)}return o||s}var I_=365;function ch(e,t){var r=t.moveBy,n=t.direction,s=t.context,o=t.modifiers,a=t.retry,i=a===void 0?{count:0,lastFocused:e}:a,c=s.weekStartsOn,d=s.fromDate,u=s.toDate,h=s.locale,v={day:it,week:Ei,month:It,year:u0,startOfWeek:function(g){return s.ISOWeek?un(g):Kt(g,{locale:h,weekStartsOn:c})},endOfWeek:function(g){return s.ISOWeek?Tf(g):Oi(g,{locale:h,weekStartsOn:c})}},f=v[r](e,n==="after"?1:-1);n==="before"&&d?f=f0([d,f]):n==="after"&&u&&(f=h0([u,f]));var b=!0;if(o){var p=Yi(f,o);b=!p.disabled&&!p.hidden}return b?f:i.count>I_?i.lastFocused:ch(f,{moveBy:r,direction:n,context:s,modifiers:o,retry:te(te({},i),{count:i.count+1})})}var dh=S.createContext(void 0);function F_(e){var t=Us(),r=lh(),n=S.useState(),s=n[0],o=n[1],a=S.useState(),i=a[0],c=a[1],d=D_(t.displayMonths,r),u=s??(i&&t.isDateDisplayed(i))?i:d,h=function(){c(s),o(void 0)},v=function(g){o(g)},f=Me(),b=function(g,x){if(s){var y=ch(s,{moveBy:g,direction:x,context:f,modifiers:r});pt(s,y)||(t.goToDate(y,s),v(y))}},p={focusedDay:s,focusTarget:u,blur:h,focus:v,focusDayAfter:function(){return b("day","after")},focusDayBefore:function(){return b("day","before")},focusWeekAfter:function(){return b("week","after")},focusWeekBefore:function(){return b("week","before")},focusMonthBefore:function(){return b("month","before")},focusMonthAfter:function(){return b("month","after")},focusYearBefore:function(){return b("year","before")},focusYearAfter:function(){return b("year","after")},focusStartOfWeek:function(){return b("startOfWeek","before")},focusEndOfWeek:function(){return b("endOfWeek","after")}};return l.jsx(dh.Provider,{value:p,children:e.children})}function qi(){var e=S.useContext(dh);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function L_(e,t){var r=lh(),n=Yi(e,r,t);return n}var Zi=S.createContext(void 0);function V_(e){if(!Ko(e.initialProps)){var t={selected:void 0};return l.jsx(Zi.Provider,{value:t,children:e.children})}return l.jsx($_,{initialProps:e.initialProps,children:e.children})}function $_(e){var t=e.initialProps,r=e.children,n=function(o,a,i){var c,d,u;if((c=t.onDayClick)===null||c===void 0||c.call(t,o,a,i),a.selected&&!t.required){(d=t.onSelect)===null||d===void 0||d.call(t,void 0,o,a,i);return}(u=t.onSelect)===null||u===void 0||u.call(t,o,o,a,i)},s={selected:t.selected,onDayClick:n};return l.jsx(Zi.Provider,{value:s,children:r})}function uh(){var e=S.useContext(Zi);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function B_(e,t){var r=Me(),n=uh(),s=Bi(),o=ji(),a=qi(),i=a.focusDayAfter,c=a.focusDayBefore,d=a.focusWeekAfter,u=a.focusWeekBefore,h=a.blur,v=a.focus,f=a.focusMonthBefore,b=a.focusMonthAfter,p=a.focusYearBefore,g=a.focusYearAfter,x=a.focusStartOfWeek,y=a.focusEndOfWeek,w=function(I){var A,B,ae,Se;Ko(r)?(A=n.onDayClick)===null||A===void 0||A.call(n,e,t,I):Ws(r)?(B=s.onDayClick)===null||B===void 0||B.call(s,e,t,I):js(r)?(ae=o.onDayClick)===null||ae===void 0||ae.call(o,e,t,I):(Se=r.onDayClick)===null||Se===void 0||Se.call(r,e,t,I)},k=function(I){var A;v(e),(A=r.onDayFocus)===null||A===void 0||A.call(r,e,t,I)},E=function(I){var A;h(),(A=r.onDayBlur)===null||A===void 0||A.call(r,e,t,I)},M=function(I){var A;(A=r.onDayMouseEnter)===null||A===void 0||A.call(r,e,t,I)},T=function(I){var A;(A=r.onDayMouseLeave)===null||A===void 0||A.call(r,e,t,I)},O=function(I){var A;(A=r.onDayPointerEnter)===null||A===void 0||A.call(r,e,t,I)},F=function(I){var A;(A=r.onDayPointerLeave)===null||A===void 0||A.call(r,e,t,I)},W=function(I){var A;(A=r.onDayTouchCancel)===null||A===void 0||A.call(r,e,t,I)},G=function(I){var A;(A=r.onDayTouchEnd)===null||A===void 0||A.call(r,e,t,I)},D=function(I){var A;(A=r.onDayTouchMove)===null||A===void 0||A.call(r,e,t,I)},U=function(I){var A;(A=r.onDayTouchStart)===null||A===void 0||A.call(r,e,t,I)},L=function(I){var A;(A=r.onDayKeyUp)===null||A===void 0||A.call(r,e,t,I)},J=function(I){var A;switch(I.key){case"ArrowLeft":I.preventDefault(),I.stopPropagation(),r.dir==="rtl"?i():c();break;case"ArrowRight":I.preventDefault(),I.stopPropagation(),r.dir==="rtl"?c():i();break;case"ArrowDown":I.preventDefault(),I.stopPropagation(),d();break;case"ArrowUp":I.preventDefault(),I.stopPropagation(),u();break;case"PageUp":I.preventDefault(),I.stopPropagation(),I.shiftKey?p():f();break;case"PageDown":I.preventDefault(),I.stopPropagation(),I.shiftKey?g():b();break;case"Home":I.preventDefault(),I.stopPropagation(),x();break;case"End":I.preventDefault(),I.stopPropagation(),y();break}(A=r.onDayKeyDown)===null||A===void 0||A.call(r,e,t,I)},Y={onClick:w,onFocus:k,onBlur:E,onKeyDown:J,onKeyUp:L,onMouseEnter:M,onMouseLeave:T,onPointerEnter:O,onPointerLeave:F,onTouchCancel:W,onTouchEnd:G,onTouchMove:D,onTouchStart:U};return Y}function W_(){var e=Me(),t=uh(),r=Bi(),n=ji(),s=Ko(e)?t.selected:Ws(e)?r.selected:js(e)?n.selected:void 0;return s}function j_(e){return Object.values(Ft).includes(e)}function U_(e,t){var r=[e.classNames.day];return Object.keys(t).forEach(function(n){var s=e.modifiersClassNames[n];if(s)r.push(s);else if(j_(n)){var o=e.classNames["day_".concat(n)];o&&r.push(o)}}),r}function H_(e,t){var r=te({},e.styles.day);return Object.keys(t).forEach(function(n){var s;r=te(te({},r),(s=e.modifiersStyles)===null||s===void 0?void 0:s[n])}),r}function z_(e,t,r){var n,s,o,a=Me(),i=qi(),c=L_(e,t),d=B_(e,c),u=W_(),h=!!(a.onDayClick||a.mode!=="default");S.useEffect(function(){var M;c.outside||i.focusedDay&&h&&pt(i.focusedDay,e)&&((M=r.current)===null||M===void 0||M.focus())},[i.focusedDay,e,r,h,c.outside]);var v=U_(a,c).join(" "),f=H_(a,c),b=!!(c.outside&&!a.showOutsideDays||c.hidden),p=(o=(s=a.components)===null||s===void 0?void 0:s.DayContent)!==null&&o!==void 0?o:u_,g=l.jsx(p,{date:e,displayMonth:t,activeModifiers:c}),x={style:f,className:v,children:g,role:"gridcell"},y=i.focusTarget&&pt(i.focusTarget,e)&&!c.outside,w=i.focusedDay&&pt(i.focusedDay,e),k=te(te(te({},x),(n={disabled:c.disabled,role:"gridcell"},n["aria-selected"]=c.selected,n.tabIndex=w||y?0:-1,n)),d),E={isButton:h,isHidden:b,activeModifiers:c,selectedDays:u,buttonProps:k,divProps:x};return E}function Y_(e){var t=S.useRef(null),r=z_(e.date,e.displayMonth,t);return r.isHidden?l.jsx("div",{role:"gridcell"}):r.isButton?l.jsx(Qo,te({name:"day",ref:t},r.buttonProps)):l.jsx("div",te({},r.divProps))}function q_(e){var t=e.number,r=e.dates,n=Me(),s=n.onWeekNumberClick,o=n.styles,a=n.classNames,i=n.locale,c=n.labels.labelWeekNumber,d=n.formatters.formatWeekNumber,u=d(Number(t),{locale:i});if(!s)return l.jsx("span",{className:a.weeknumber,style:o.weeknumber,children:u});var h=c(Number(t),{locale:i}),v=function(f){s(t,r,f)};return l.jsx(Qo,{name:"week-number","aria-label":h,className:a.weeknumber,style:o.weeknumber,onClick:v,children:u})}function Z_(e){var t,r,n=Me(),s=n.styles,o=n.classNames,a=n.showWeekNumber,i=n.components,c=(t=i==null?void 0:i.Day)!==null&&t!==void 0?t:Y_,d=(r=i==null?void 0:i.WeekNumber)!==null&&r!==void 0?r:q_,u;return a&&(u=l.jsx("td",{className:o.cell,style:s.cell,children:l.jsx(d,{number:e.weekNumber,dates:e.dates})})),l.jsxs("tr",{className:o.row,style:s.row,children:[u,e.dates.map(function(h){return l.jsx("td",{className:o.cell,style:s.cell,role:"presentation",children:l.jsx(c,{displayMonth:e.displayMonth,date:h})},dx(h))})]})}function fh(e,t,r){for(var n=r!=null&&r.ISOWeek?Tf(t):Oi(t,r),s=r!=null&&r.ISOWeek?un(e):Kt(e,r),o=Qt(n,s),a=[],i=0;i<=o;i++)a.push(it(s,i));var c=a.reduce(function(d,u){var h=r!=null&&r.ISOWeek?Mf(u):Df(u,r),v=d.find(function(f){return f.weekNumber===h});return v?(v.dates.push(u),d):(d.push({weekNumber:h,dates:[u]}),d)},[]);return c}function K_(e,t){var r=fh(mt(e),Ti(e),t);if(t!=null&&t.useFixedWeeks){var n=fx(e,t);if(n<6){var s=r[r.length-1],o=s.dates[s.dates.length-1],a=Ei(o,6-n),i=fh(Ei(o,1),a,t);r.push.apply(r,i)}}return r}function Q_(e){var t,r,n,s=Me(),o=s.locale,a=s.classNames,i=s.styles,c=s.hideHead,d=s.fixedWeeks,u=s.components,h=s.weekStartsOn,v=s.firstWeekContainsDate,f=s.ISOWeek,b=K_(e.displayMonth,{useFixedWeeks:!!d,ISOWeek:f,locale:o,weekStartsOn:h,firstWeekContainsDate:v}),p=(t=u==null?void 0:u.Head)!==null&&t!==void 0?t:d_,g=(r=u==null?void 0:u.Row)!==null&&r!==void 0?r:Z_,x=(n=u==null?void 0:u.Footer)!==null&&n!==void 0?n:i_;return l.jsxs("table",{id:e.id,className:a.table,style:i.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!c&&l.jsx(p,{}),l.jsx("tbody",{className:a.tbody,style:i.tbody,children:b.map(function(y){return l.jsx(g,{displayMonth:e.displayMonth,dates:y.dates,weekNumber:y.weekNumber},y.weekNumber)})}),l.jsx(x,{displayMonth:e.displayMonth})]})}function G_(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var X_=G_()?S.useLayoutEffect:S.useEffect,Ki=!1,J_=0;function hh(){return"react-day-picker-".concat(++J_)}function R_(e){var t,r=e??(Ki?hh():null),n=S.useState(r),s=n[0],o=n[1];return X_(function(){s===null&&o(hh())},[]),S.useEffect(function(){Ki===!1&&(Ki=!0)},[]),(t=e??s)!==null&&t!==void 0?t:void 0}function eC(e){var t,r,n=Me(),s=n.dir,o=n.classNames,a=n.styles,i=n.components,c=Us().displayMonths,d=R_(n.id?"".concat(n.id,"-").concat(e.displayIndex):void 0),u=n.id?"".concat(n.id,"-grid-").concat(e.displayIndex):void 0,h=[o.month],v=a.month,f=e.displayIndex===0,b=e.displayIndex===c.length-1,p=!f&&!b;s==="rtl"&&(t=[f,b],b=t[0],f=t[1]),f&&(h.push(o.caption_start),v=te(te({},v),a.caption_start)),b&&(h.push(o.caption_end),v=te(te({},v),a.caption_end)),p&&(h.push(o.caption_between),v=te(te({},v),a.caption_between));var g=(r=i==null?void 0:i.Caption)!==null&&r!==void 0?r:a_;return l.jsxs("div",{className:h.join(" "),style:v,children:[l.jsx(g,{id:d,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),l.jsx(Q_,{id:u,"aria-labelledby":d,displayMonth:e.displayMonth})]},e.displayIndex)}function tC(e){var t=Me(),r=t.classNames,n=t.styles;return l.jsx("div",{className:r.months,style:n.months,children:e.children})}function rC(e){var t,r,n=e.initialProps,s=Me(),o=qi(),a=Us(),i=S.useState(!1),c=i[0],d=i[1];S.useEffect(function(){s.initialFocus&&o.focusTarget&&(c||(o.focus(o.focusTarget),d(!0)))},[s.initialFocus,c,o.focus,o.focusTarget,o]);var u=[s.classNames.root,s.className];s.numberOfMonths>1&&u.push(s.classNames.multiple_months),s.showWeekNumber&&u.push(s.classNames.with_weeknumber);var h=te(te({},s.styles.root),s.style),v=Object.keys(n).filter(function(b){return b.startsWith("data-")}).reduce(function(b,p){var g;return te(te({},b),(g={},g[p]=n[p],g))},{}),f=(r=(t=n.components)===null||t===void 0?void 0:t.Months)!==null&&r!==void 0?r:tC;return l.jsx("div",te({className:u.join(" "),style:h,dir:s.dir,id:s.id,nonce:n.nonce,title:n.title,lang:n.lang},v,{children:l.jsx(f,{children:a.displayMonths.map(function(b,p){return l.jsx(eC,{displayIndex:p,displayMonth:b},p)})})}))}function nC(e){var t=e.children,r=Ex(e,["children"]);return l.jsx(qx,{initialProps:r,children:l.jsx(r_,{children:l.jsx(V_,{initialProps:r,children:l.jsx(f_,{initialProps:r,children:l.jsx(m_,{initialProps:r,children:l.jsx(C_,{children:l.jsx(F_,{children:t})})})})})})})}function sC(e){return l.jsx(nC,te({},e,{children:l.jsx(rC,{initialProps:e})}))}function Qi({className:e,classNames:t,showOutsideDays:r=!0,...n}){const s=(o,a)=>{const i={target:{value:String(o)}};a(i)};return l.jsx(sC,{showOutsideDays:r,className:he("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption_start:"is-start",caption_between:"is-between",caption_end:"is-end",caption:"flex justify-center pt-1 relative items-center gap-1",caption_label:"flex h-7 text-sm font-medium justify-center items-center grow [.is-multiple_&]:flex",caption_dropdowns:"flex justify-center gap-1 grow dropdowns pl-8 pr-9",multiple_months:"is-multiple",vhidden:"hidden [.is-between_&]:flex [.is-end_&]:flex [.is-start.is-end_&]:hidden",nav:"flex items-center [&:has([name='previous-month'])]:order-first [&:has([name='next-month'])]:order-last gap-1",nav_button:he(_o({variant:"outline"}),"h-7 w-7 bg-transparent p-0 text-muted-foreground"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:he("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent",n.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:he(_o({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"text-muted-foreground opacity-50",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible"},components:{IconLeft:({...o})=>l.jsx(Fp,{className:"h-4 w-4"}),IconRight:({...o})=>l.jsx(Lp,{className:"h-4 w-4"}),Dropdown:({...o})=>l.jsxs(cn,{...o,onValueChange:a=>{o.onChange&&s(a,o.onChange)},value:o.value,children:[l.jsx(Fr,{className:he(_o({variant:"ghost"}),"pl-2 pr-1 py-2 h-7 w-fit font-medium [.is-between_&]:hidden [.is-end_&]:hidden [.is-start.is-end_&]:flex"),children:l.jsx(dn,{placeholder:o==null?void 0:o.caption,children:o==null?void 0:o.caption})}),l.jsx(Lr,{className:"max-h-[var(--radix-popper-available-height);] overflow-y-auto scrolling-auto min-w-[var(--radix-popper-anchor-width)]",children:o.children&&m.Children.map(o.children,a=>{var i,c;return l.jsx(re,{value:(i=a==null?void 0:a.props)==null?void 0:i.value,className:"min-w-[var(--radix-popper-anchor-width)]",children:(c=a==null?void 0:a.props)==null?void 0:c.children})})})]})},...n})}Qi.displayName="Calendar";const oC=As({registration_number:Xe().min(1,"Registration number is required"),country:Xe().min(1,"Country is required"),company_name:Xe().min(2,"Company name must be at least 2 characters"),tax_identity_number:Xe().min(1,"Tax identity number is required"),corporate_type:Xe().min(1,"Corporate type is required"),date_of_establishment:yu({required_error:"Date of establishment is required"})}),aC=({data:e,onDataChange:t,onContinue:r,onBack:n,renderProgress:s})=>{const o=Ss({resolver:ks(oC),defaultValues:{registration_number:e.registration_number,country:e.country,company_name:e.company_name,tax_identity_number:e.tax_identity_number,corporate_type:e.corporate_type,date_of_establishment:e.date_of_establishment||void 0}}),a=i=>{t(i),r()};return l.jsxs(st,{className:"w-full max-w-2xl mx-auto",children:[l.jsx(kr,{children:l.jsx(Nr,{title:"Business Information",subTitle:"Please provide your business details",onBack:n})}),l.jsxs(ot,{children:[l.jsx(Ds,{...o,children:l.jsxs("form",{onSubmit:o.handleSubmit(a),className:"space-y-6",children:[l.jsx(qe,{control:o.control,name:"registration_number",render:({field:i})=>l.jsxs($e,{children:[l.jsx(Be,{children:"Registration Number"}),l.jsx(We,{children:l.jsx(ft,{placeholder:"Enter registration number",...i})}),l.jsx(je,{})]})}),l.jsx(qe,{control:o.control,name:"country",render:({field:i})=>l.jsxs($e,{children:[l.jsx(Be,{children:"Country"}),l.jsxs(cn,{onValueChange:i.onChange,defaultValue:i.value,children:[l.jsx(We,{children:l.jsx(Fr,{children:l.jsx(dn,{placeholder:"Select country"})})}),l.jsxs(Lr,{children:[l.jsx(re,{value:"us",children:"United States"}),l.jsx(re,{value:"uk",children:"United Kingdom"}),l.jsx(re,{value:"ca",children:"Canada"}),l.jsx(re,{value:"au",children:"Australia"}),l.jsx(re,{value:"de",children:"Germany"}),l.jsx(re,{value:"fr",children:"France"}),l.jsx(re,{value:"other",children:"Other"})]})]}),l.jsx(je,{})]})}),l.jsx(qe,{control:o.control,name:"company_name",render:({field:i})=>l.jsxs($e,{children:[l.jsx(Be,{children:"Company Name"}),l.jsx(We,{children:l.jsx(ft,{placeholder:"Enter company name",...i})}),l.jsx(je,{})]})}),l.jsx(qe,{control:o.control,name:"tax_identity_number",render:({field:i})=>l.jsxs($e,{children:[l.jsx(Be,{children:"Tax Identity Number"}),l.jsx(We,{children:l.jsx(ft,{placeholder:"Enter tax identity number",...i})}),l.jsx(je,{})]})}),l.jsx(qe,{control:o.control,name:"corporate_type",render:({field:i})=>l.jsxs($e,{children:[l.jsx(Be,{children:"Corporate Type"}),l.jsxs(cn,{onValueChange:i.onChange,defaultValue:i.value,children:[l.jsx(We,{children:l.jsx(Fr,{children:l.jsx(dn,{placeholder:"Select corporate type"})})}),l.jsxs(Lr,{children:[l.jsx(re,{value:"llc",children:"LLC"}),l.jsx(re,{value:"corporation",children:"Corporation"}),l.jsx(re,{value:"partnership",children:"Partnership"}),l.jsx(re,{value:"sole-proprietorship",children:"Sole Proprietorship"}),l.jsx(re,{value:"other",children:"Other"})]})]}),l.jsx(je,{})]})}),l.jsx(qe,{control:o.control,name:"date_of_establishment",render:({field:i})=>l.jsxs($e,{className:"flex flex-col",children:[l.jsx(Be,{children:"Date of Establishment"}),l.jsxs(Jf,{modal:!0,children:[l.jsx(Rf,{asChild:!0,children:l.jsx(We,{children:l.jsxs(He,{variant:"outline",className:he("w-full pl-3 text-left font-normal",!i.value&&"text-muted-foreground"),children:[i.value?cr(i.value,"PPP"):l.jsx("span",{children:"Pick a date"}),l.jsx(Kl,{className:"ml-auto h-4 w-4 opacity-50"})]})})}),l.jsx(Vi,{className:"w-auto p-0",align:"start",onOpenAutoFocus:c=>c.preventDefault(),children:l.jsx(Qi,{mode:"single",selected:i.value,onSelect:i.onChange,captionLayout:"dropdown-buttons",fromYear:1900,toYear:2026,disabled:c=>c>new Date,initialFocus:!0,className:"p-3 pointer-events-auto"})})]}),l.jsx(je,{})]})}),l.jsx(He,{type:"submit",className:"w-full",children:"Continue"})]})}),l.jsx("div",{className:"mt-6",children:s()})]})]})},iC=As({full_name:Xe().min(2,"Full name must be at least 2 characters"),title:Xe().min(1,"Title is required"),birth:yu({required_error:"Birth date is required"}),phone_number:Xe().min(10,"Phone number must be at least 10 characters")}),lC=({data:e,onDataChange:t,onContinue:r,onBack:n,renderProgress:s})=>{const o=Ss({resolver:ks(iC),defaultValues:{full_name:e.full_name,title:e.title,birth:e.birth||void 0,phone_number:e.phone_number}}),a=i=>{t(i),r()};return l.jsxs(st,{className:"w-full max-w-2xl mx-auto",children:[l.jsx(kr,{children:l.jsx(Nr,{title:"Personal Details",subTitle:"Please provide your personal information",onBack:n})}),l.jsxs(ot,{children:[l.jsx(Ds,{...o,children:l.jsxs("form",{onSubmit:o.handleSubmit(a),className:"space-y-6",children:[l.jsx(qe,{control:o.control,name:"full_name",render:({field:i})=>l.jsxs($e,{children:[l.jsx(Be,{children:"Full Name"}),l.jsx(We,{children:l.jsx(ft,{placeholder:"Enter your full name",...i})}),l.jsx(je,{})]})}),l.jsx(qe,{control:o.control,name:"title",render:({field:i})=>l.jsxs($e,{children:[l.jsx(Be,{children:"Title"}),l.jsx(We,{children:l.jsx(ft,{placeholder:"e.g., CEO, Director, Manager",...i})}),l.jsx(je,{})]})}),l.jsx(qe,{control:o.control,name:"birth",render:({field:i})=>l.jsxs($e,{className:"flex flex-col",children:[l.jsx(Be,{children:"Date of Birth"}),l.jsxs(Jf,{modal:!0,children:[l.jsx(Rf,{asChild:!0,children:l.jsx(We,{children:l.jsxs(He,{variant:"outline",className:he("w-full pl-3 text-left font-normal",!i.value&&"text-muted-foreground"),children:[i.value?cr(i.value,"PPP"):l.jsx("span",{children:"Pick a date"}),l.jsx(Kl,{className:"ml-auto h-4 w-4 opacity-50"})]})})}),l.jsx(Vi,{className:"w-auto p-0",align:"start",onOpenAutoFocus:c=>c.preventDefault(),children:l.jsx(Qi,{mode:"single",selected:i.value,onSelect:i.onChange,captionLayout:"dropdown-buttons",fromYear:1900,toYear:2026,disabled:c=>c>new Date||c<new Date("1900-01-01"),initialFocus:!0,className:"p-3 pointer-events-auto"})})]}),l.jsx(je,{})]})}),l.jsx(qe,{control:o.control,name:"phone_number",render:({field:i})=>l.jsxs($e,{children:[l.jsx(Be,{children:"Phone Number"}),l.jsx(We,{children:l.jsx(ft,{placeholder:"Enter your phone number",...i})}),l.jsx(je,{})]})}),l.jsx(He,{type:"submit",className:"w-full",children:"Continue"})]})}),l.jsx("div",{className:"mt-6",children:s()})]})]})};var Gi="Progress",Xi=100,[cC,MC]=Rr(Gi),[dC,uC]=cC(Gi),ph=m.forwardRef((e,t)=>{const{__scopeProgress:r,value:n=null,max:s,getValueLabel:o=fC,...a}=e;(s||s===0)&&!yh(s)&&console.error(hC(`${s}`,"Progress"));const i=yh(s)?s:Xi;n!==null&&!bh(n,i)&&console.error(pC(`${n}`,"Progress"));const c=bh(n,i)?n:null,d=Xo(c)?o(c,i):void 0;return l.jsx(dC,{scope:r,value:c,max:i,children:l.jsx(we.div,{"aria-valuemax":i,"aria-valuemin":0,"aria-valuenow":Xo(c)?c:void 0,"aria-valuetext":d,role:"progressbar","data-state":gh(c,i),"data-value":c??void 0,"data-max":i,...a,ref:t})})});ph.displayName=Gi;var mh="ProgressIndicator",vh=m.forwardRef((e,t)=>{const{__scopeProgress:r,...n}=e,s=uC(mh,r);return l.jsx(we.div,{"data-state":gh(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...n,ref:t})});vh.displayName=mh;function fC(e,t){return`${Math.round(e/t*100)}%`}function gh(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Xo(e){return typeof e=="number"}function yh(e){return Xo(e)&&!isNaN(e)&&e>0}function bh(e,t){return Xo(e)&&!isNaN(e)&&e<=t&&e>=0}function hC(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Xi}\`.`}function pC(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
143
143
  - a positive number
144
144
  - less than the value passed to \`max\` (or ${Xi} if no \`max\` prop is set)
145
145
  - \`null\` or \`undefined\` if the progress is indeterminate.
146
146
 
147
- Defaulting to \`null\`.`}var wh=ph,pC=vh;const xh=m.forwardRef(({className:e,value:t,...r},n)=>l.jsx(wh,{ref:n,className:he("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...r,children:l.jsx(pC,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));xh.displayName=wh.displayName;const mC=({apiEndpoint:e,apiKey:t,onComplete:r,onDoneClick:n})=>{const[s,o]=S.useState("landing"),[a,i]=S.useState({full_name:"",title:"",birth:null,phone_number:"",selfie_photo:null,id_photo:null,id_photo_back:null}),[c,d]=S.useState({registration_number:"",country:"",company_name:"",tax_identity_number:"",corporate_type:"",date_of_establishment:null}),[u,h]=S.useState({street:"",number:"",postal_code:"",city:"",address_country:"",state:""}),[v,f]=S.useState({industry:"",business_model:"",annual_sales_volume:"",website_url:""}),[b,p]=S.useState({bank_statement:null,company_structure:null,certificate_of_registration:null}),g=["personal-details","id-front","id-back","pre-selfie","selfie","business-information","business-address","company-activity","company-documents"],x=_d({mutationFn:vC}),{toast:y}=Gs(),w=()=>s==="landing"||s==="processing"?-1:g.indexOf(s),k=()=>{const P=w();return P===-1?0:(P+1)/g.length*100},E=async()=>{const P={personal_details:a,business_information:c,business_address:u,company_activity:v,company_documents:b},F=await x.mutateAsync({apiEndpoint:e,apiKey:t,data:P});r(F.data.token,P),y({title:"Business verification submitted!",description:"Your business verification request has been submitted successfully."}),i({full_name:"",title:"",birth:null,phone_number:"",selfie_photo:null,id_photo:null,id_photo_back:null}),d({registration_number:"",country:"",company_name:"",tax_identity_number:"",corporate_type:"",date_of_establishment:null}),h({street:"",number:"",postal_code:"",city:"",address_country:""}),f({industry:"",business_model:"",annual_sales_volume:"",website_url:""}),p({bank_statement:null,company_structure:null,certificate_of_registration:null}),o("done")},M=()=>{const P=w();return P===-1?null:l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex justify-between text-sm text-muted-foreground",children:[l.jsxs("span",{children:["Step ",P+1," of ",g.length]}),l.jsxs("span",{children:[Math.round(k()),"%"]})]}),l.jsx(xh,{value:k(),className:"h-2"})]})},O=()=>{switch(s){case"landing":return l.jsx(Cd,{title:"Business Verification",subtitle:"Complete your business verification to access all features",onContinue:()=>o("personal-details")});case"personal-details":return l.jsx(iC,{data:a,onDataChange:P=>i(F=>({...F,...P})),onContinue:()=>o("id-front"),onBack:()=>o("landing"),renderProgress:M});case"id-front":return l.jsx(Dn,{title:"Upload ID",description:"Place your ID inside the frame and take a picture. Make sure it is not cut or has any glare.",frameType:"rectangular",currentStep:s,onRetake:()=>{i(P=>({...P,id_photo:null}))},onConfirm:P=>{i(F=>({...F,id_photo:P})),o("id-back")},onBack:()=>{i(P=>({...P,id_photo:null})),o("personal-details")}});case"id-back":return l.jsx(Dn,{title:"Upload ID Back",description:"Place the back of your ID inside the frame and take a picture. Make sure it is not cut or has any glare.",frameType:"rectangular",currentStep:s,onRetake:()=>{i(P=>({...P,id_photo_back:null}))},onConfirm:P=>{i(F=>({...F,id_photo_back:P})),o("pre-selfie")},onBack:()=>{i(P=>({...P,id_photo_back:null})),o("id-front")}});case"pre-selfie":return l.jsx(Nd,{onContinue:()=>o("selfie"),onBack:()=>o("id-back")});case"selfie":return l.jsx(Dn,{title:"Selfie",description:"Place your face inside the frame and take a picture. Make sure it is clearly visible.",frameType:"circular",currentStep:s,onRetake:()=>{i(P=>({...P,selfie_photo:null}))},onConfirm:P=>{i(F=>({...F,selfie_photo:P})),o("business-information")},onBack:()=>{i(P=>({...P,selfie_photo:null})),o("id-back")}});case"business-information":return l.jsx(oC,{data:c,onDataChange:P=>d(F=>({...F,...P})),onContinue:()=>o("business-address"),onBack:()=>o("personal-details"),renderProgress:M});case"business-address":return l.jsx(a0,{data:u,onDataChange:P=>h(F=>({...F,...P})),onContinue:()=>o("company-activity"),onBack:()=>o("business-information"),renderProgress:M});case"company-activity":return l.jsx(s0,{data:v,onDataChange:P=>f(F=>({...F,...P})),onContinue:()=>o("company-documents"),onBack:()=>o("business-address"),renderProgress:M});case"company-documents":return l.jsx(Mb,{data:b,onDataChange:P=>p(F=>({...F,...P})),onContinue:()=>o("processing"),onBack:()=>o("company-activity"),renderProgress:M});case"processing":return l.jsx(Ed,{onComplete:E});case"done":return l.jsx(Pd,{onDoneClick:n});default:return null}};return l.jsx("div",{className:"w-[430px]",children:O()})};async function vC({apiEndpoint:e,apiKey:t,data:r}){const{company_documents:n,personal_details:s,...o}=r,a={...s};delete a.selfie_photo,delete a.id_photo,delete a.id_photo_back;const i=new FormData;i.append("payload",gC({...o,personal_details:a})),i.append("bank_statement",n.bank_statement,n.bank_statement.name),i.append("company_structure",n.company_structure,n.company_structure.name),i.append("certificate_of_registration",n.certificate_of_registration,n.certificate_of_registration.name),i.append("selfie_photo",s.selfie_photo,s.selfie_photo.name),i.append("id_photo",s.id_photo,s.id_photo.name),i.append("id_photo_back",s.id_photo_back,s.id_photo_back.name);const c=await fetch(`${e}/api/kyb`,{method:"POST",headers:{"X-API-Key":t},body:i});if(!c.ok)throw new Error("Network response was not ok");return c.json()}function gC(e){return JSON.stringify(e,(t,r)=>r instanceof Date?r.toISOString():r)}const yC=new ny;return e=>l.jsx(ly,{client:yC,children:l.jsxs(Wg,{children:[l.jsx(Cm,{}),l.jsx(tv,{}),e.isKYB?l.jsx(mC,{...e}):l.jsx(Py,{...e})]})})});
147
+ Defaulting to \`null\`.`}var wh=ph,mC=vh;const xh=m.forwardRef(({className:e,value:t,...r},n)=>l.jsx(wh,{ref:n,className:he("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...r,children:l.jsx(mC,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));xh.displayName=wh.displayName;const vC=({apiEndpoint:e,apiKey:t,onComplete:r,onDoneClick:n})=>{const[s,o]=S.useState("landing"),[a,i]=S.useState({full_name:"",title:"",birth:null,phone_number:"",selfie_photo:null,id_photo:null,id_photo_back:null}),[c,d]=S.useState({registration_number:"",country:"",company_name:"",tax_identity_number:"",corporate_type:"",date_of_establishment:null}),[u,h]=S.useState({street:"",number:"",postal_code:"",city:"",address_country:"",state:""}),[v,f]=S.useState({industry:"",business_model:"",annual_sales_volume:"",website_url:""}),[b,p]=S.useState({bank_statement:null,company_structure:null,certificate_of_registration:null}),g=["personal-details","id-front","id-back","pre-selfie","selfie","business-information","business-address","company-activity","company-documents"],x=_d({mutationFn:gC}),{toast:y}=Gs(),w=()=>s==="landing"||s==="processing"?-1:g.indexOf(s),k=()=>{const O=w();return O===-1?0:(O+1)/g.length*100},E=async()=>{const O={personal_details:a,business_information:c,business_address:u,company_activity:v,company_documents:b},F=await x.mutateAsync({apiEndpoint:e,apiKey:t,data:O});r(F.data.token,O),y({title:"Business verification submitted!",description:"Your business verification request has been submitted successfully."}),i({full_name:"",title:"",birth:null,phone_number:"",selfie_photo:null,id_photo:null,id_photo_back:null}),d({registration_number:"",country:"",company_name:"",tax_identity_number:"",corporate_type:"",date_of_establishment:null}),h({street:"",number:"",postal_code:"",city:"",address_country:""}),f({industry:"",business_model:"",annual_sales_volume:"",website_url:""}),p({bank_statement:null,company_structure:null,certificate_of_registration:null}),o("done")},M=()=>{const O=w();return O===-1?null:l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex justify-between text-sm text-muted-foreground",children:[l.jsxs("span",{children:["Step ",O+1," of ",g.length]}),l.jsxs("span",{children:[Math.round(k()),"%"]})]}),l.jsx(xh,{value:k(),className:"h-2"})]})},T=()=>{switch(s){case"landing":return l.jsx(Cd,{title:"Business Verification",subtitle:"Complete your business verification to access all features",onContinue:()=>o("personal-details")});case"personal-details":return l.jsx(lC,{data:a,onDataChange:O=>i(F=>({...F,...O})),onContinue:()=>o("id-front"),onBack:()=>o("landing"),renderProgress:M});case"id-front":return l.jsx(Dn,{title:"Upload ID",description:"Place your ID inside the frame and take a picture. Make sure it is not cut or has any glare.",frameType:"rectangular",currentStep:s,onRetake:()=>{i(O=>({...O,id_photo:null}))},onConfirm:O=>{i(F=>({...F,id_photo:O})),o("id-back")},onBack:()=>{o("personal-details")}});case"id-back":return l.jsx(Dn,{title:"Upload ID Back",description:"Place the back of your ID inside the frame and take a picture. Make sure it is not cut or has any glare.",frameType:"rectangular",currentStep:s,onRetake:()=>{i(O=>({...O,id_photo_back:null}))},onConfirm:O=>{i(F=>({...F,id_photo_back:O})),o("pre-selfie")},onBack:()=>{o("id-front")}});case"pre-selfie":return l.jsx(Nd,{onContinue:()=>o("selfie"),onBack:()=>o("id-back")});case"selfie":return l.jsx(Dn,{title:"Selfie",description:"Place your face inside the frame and take a picture. Make sure it is clearly visible.",frameType:"circular",currentStep:s,onRetake:()=>{i(O=>({...O,selfie_photo:null}))},onConfirm:O=>{i(F=>({...F,selfie_photo:O})),o("business-information")},onBack:()=>{o("id-back")}});case"business-information":return l.jsx(aC,{data:c,onDataChange:O=>d(F=>({...F,...O})),onContinue:()=>o("business-address"),onBack:()=>o("selfie"),renderProgress:M});case"business-address":return l.jsx(i0,{data:u,onDataChange:O=>h(F=>({...F,...O})),onContinue:()=>o("company-activity"),onBack:()=>o("business-information"),renderProgress:M});case"company-activity":return l.jsx(o0,{data:v,onDataChange:O=>f(F=>({...F,...O})),onContinue:()=>o("company-documents"),onBack:()=>o("business-address"),renderProgress:M});case"company-documents":return l.jsx(Ab,{data:b,onDataChange:O=>p(F=>({...F,...O})),onContinue:()=>o("processing"),onBack:()=>o("company-activity"),renderProgress:M});case"processing":return l.jsx(Ed,{onComplete:E});case"done":return l.jsx(Pd,{onDoneClick:n});default:return null}};return l.jsx("div",{className:"w-[430px]",children:T()})};async function gC({apiEndpoint:e,apiKey:t,data:r}){const{company_documents:n,personal_details:s,...o}=r,a={...s};delete a.selfie_photo,delete a.id_photo,delete a.id_photo_back;const i=new FormData;i.append("payload",yC({...o,personal_details:a})),i.append("bank_statement",n.bank_statement,n.bank_statement.name),i.append("company_structure",n.company_structure,n.company_structure.name),i.append("certificate_of_registration",n.certificate_of_registration,n.certificate_of_registration.name),i.append("selfie_photo",s.selfie_photo,s.selfie_photo.name),i.append("id_photo",s.id_photo,s.id_photo.name),i.append("id_photo_back",s.id_photo_back,s.id_photo_back.name);const c=await fetch(`${e}/api/kyb`,{method:"POST",headers:{"X-API-Key":t},body:i});if(!c.ok)throw new Error("Network response was not ok");return c.json()}function yC(e){return JSON.stringify(e,(t,r)=>r instanceof Date?r.toISOString():r)}const bC=new ny;return e=>l.jsx(ly,{client:bC,children:l.jsxs(Wg,{children:[l.jsx(Cm,{}),l.jsx(tv,{}),e.isKYB?l.jsx(vC,{...e}):l.jsx(Ty,{...e})]})})});