@oniratec/onira-react-ui 3.0.1 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Wo=require("tailwind-merge"),ha=require("clsx"),l=require("react/jsx-runtime"),b=require("react"),J=require("lucide-react"),ma=require("react-dom"),Dd=require("@radix-ui/react-dropdown-menu"),Rd=require("lottie-react"),Ad=require("@radix-ui/react-select"),Md=require("@radix-ui/react-tooltip");function Br(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const h=Br(b),Zo=Br(ma),fe=Br(Dd),pe=Br(Ad),zt=Br(Md),wr=t=>{let e=0;for(let r=0;r<t.length;r++){const n=t.charCodeAt(r);e=(e<<5)-e+n,e=e&e}return Math.abs(e)},Bo=(t,e)=>Math.floor(t/Math.pow(10,e)%10),$s=(t,e)=>!(Bo(t,e)%2),Se=(t,e,r)=>{const n=t%e;return r&&Bo(t,r)%2===0?-n:n},Wt=(t,e,r)=>e[t%r],Id=t=>{t.slice(0,1)==="#"&&(t=t.slice(1));const e=parseInt(t.substr(0,2),16),r=parseInt(t.substr(2,2),16),n=parseInt(t.substr(4,2),16);return(e*299+r*587+n*114)/1e3>=128?"#000000":"#FFFFFF"},Pd=4,ue=80;function Fd(t,e){const r=wr(t),n=e&&e.length;return Array.from({length:Pd},(s,a)=>({color:Wt(r+a,e,n),translateX:Se(r*(a+1),ue/2-(a+17),1),translateY:Se(r*(a+1),ue/2-(a+17),2),rotate:Se(r*(a+1),360),isSquare:$s(r,2)}))}const di=({name:t,colors:e,title:r,square:n,size:s,...a})=>{const i=Fd(t,e),o=h.useId();return l.jsxs("svg",{viewBox:"0 0 "+ue+" "+ue,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:s,height:s,...a,children:[r&&l.jsx("title",{children:t}),l.jsx("mask",{id:o,maskUnits:"userSpaceOnUse",x:0,y:0,width:ue,height:ue,children:l.jsx("rect",{width:ue,height:ue,rx:n?void 0:ue*2,fill:"#FFFFFF"})}),l.jsxs("g",{mask:`url(#${o})`,children:[l.jsx("rect",{width:ue,height:ue,fill:i[0].color}),l.jsx("rect",{x:(ue-60)/2,y:(ue-20)/2,width:ue,height:i[1].isSquare?ue:ue/8,fill:i[1].color,transform:"translate("+i[1].translateX+" "+i[1].translateY+") rotate("+i[1].rotate+" "+ue/2+" "+ue/2+")"}),l.jsx("circle",{cx:ue/2,cy:ue/2,fill:i[2].color,r:ue/5,transform:"translate("+i[2].translateX+" "+i[2].translateY+")"}),l.jsx("line",{x1:0,y1:ue/2,x2:ue,y2:ue/2,strokeWidth:2,stroke:i[3].color,transform:"translate("+i[3].translateX+" "+i[3].translateY+") rotate("+i[3].rotate+" "+ue/2+" "+ue/2+")"})]})]})},It=90,Ld=5;function Vd(t,e){const r=wr(t),n=e&&e.length,s=Array.from({length:Ld},(i,o)=>Wt(r+o,e,n)),a=[];return a[0]=s[0],a[1]=s[1],a[2]=s[1],a[3]=s[2],a[4]=s[2],a[5]=s[3],a[6]=s[3],a[7]=s[0],a[8]=s[4],a}const $d=({name:t,colors:e,title:r,square:n,size:s,...a})=>{const i=Vd(t,e),o=b.useId();return l.jsxs("svg",{viewBox:"0 0 "+It+" "+It,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:s,height:s,...a,children:[r&&l.jsx("title",{children:t}),l.jsx("mask",{id:o,maskUnits:"userSpaceOnUse",x:0,y:0,width:It,height:It,children:l.jsx("rect",{width:It,height:It,rx:n?void 0:It*2,fill:"#FFFFFF"})}),l.jsxs("g",{mask:`url(#${o})`,children:[l.jsx("path",{d:"M0 0h90v45H0z",fill:i[0]}),l.jsx("path",{d:"M0 45h90v45H0z",fill:i[1]}),l.jsx("path",{d:"M83 45a38 38 0 00-76 0h76z",fill:i[2]}),l.jsx("path",{d:"M83 45a38 38 0 01-76 0h76z",fill:i[3]}),l.jsx("path",{d:"M77 45a32 32 0 10-64 0h64z",fill:i[4]}),l.jsx("path",{d:"M77 45a32 32 0 11-64 0h64z",fill:i[5]}),l.jsx("path",{d:"M71 45a26 26 0 00-52 0h52z",fill:i[6]}),l.jsx("path",{d:"M71 45a26 26 0 01-52 0h52z",fill:i[7]}),l.jsx("circle",{cx:45,cy:45,r:23,fill:i[8]})]})]})},zd=64,Pt=80;function Wd(t,e){const r=wr(t),n=e&&e.length;return Array.from({length:zd},(s,a)=>Wt(r%(a+1),e,n))}const Zd=({name:t,colors:e,title:r,square:n,size:s,...a})=>{const i=Wd(t,e),o=h.useId();return l.jsxs("svg",{viewBox:"0 0 "+Pt+" "+Pt,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:s,height:s,...a,children:[r&&l.jsx("title",{children:t}),l.jsx("mask",{id:o,"mask-type":"alpha",maskUnits:"userSpaceOnUse",x:0,y:0,width:Pt,height:Pt,children:l.jsx("rect",{width:Pt,height:Pt,rx:n?void 0:Pt*2,fill:"#FFFFFF"})}),l.jsxs("g",{mask:`url(#${o})`,children:[l.jsx("rect",{width:10,height:10,fill:i[0]}),l.jsx("rect",{x:20,width:10,height:10,fill:i[1]}),l.jsx("rect",{x:40,width:10,height:10,fill:i[2]}),l.jsx("rect",{x:60,width:10,height:10,fill:i[3]}),l.jsx("rect",{x:10,width:10,height:10,fill:i[4]}),l.jsx("rect",{x:30,width:10,height:10,fill:i[5]}),l.jsx("rect",{x:50,width:10,height:10,fill:i[6]}),l.jsx("rect",{x:70,width:10,height:10,fill:i[7]}),l.jsx("rect",{y:10,width:10,height:10,fill:i[8]}),l.jsx("rect",{y:20,width:10,height:10,fill:i[9]}),l.jsx("rect",{y:30,width:10,height:10,fill:i[10]}),l.jsx("rect",{y:40,width:10,height:10,fill:i[11]}),l.jsx("rect",{y:50,width:10,height:10,fill:i[12]}),l.jsx("rect",{y:60,width:10,height:10,fill:i[13]}),l.jsx("rect",{y:70,width:10,height:10,fill:i[14]}),l.jsx("rect",{x:20,y:10,width:10,height:10,fill:i[15]}),l.jsx("rect",{x:20,y:20,width:10,height:10,fill:i[16]}),l.jsx("rect",{x:20,y:30,width:10,height:10,fill:i[17]}),l.jsx("rect",{x:20,y:40,width:10,height:10,fill:i[18]}),l.jsx("rect",{x:20,y:50,width:10,height:10,fill:i[19]}),l.jsx("rect",{x:20,y:60,width:10,height:10,fill:i[20]}),l.jsx("rect",{x:20,y:70,width:10,height:10,fill:i[21]}),l.jsx("rect",{x:40,y:10,width:10,height:10,fill:i[22]}),l.jsx("rect",{x:40,y:20,width:10,height:10,fill:i[23]}),l.jsx("rect",{x:40,y:30,width:10,height:10,fill:i[24]}),l.jsx("rect",{x:40,y:40,width:10,height:10,fill:i[25]}),l.jsx("rect",{x:40,y:50,width:10,height:10,fill:i[26]}),l.jsx("rect",{x:40,y:60,width:10,height:10,fill:i[27]}),l.jsx("rect",{x:40,y:70,width:10,height:10,fill:i[28]}),l.jsx("rect",{x:60,y:10,width:10,height:10,fill:i[29]}),l.jsx("rect",{x:60,y:20,width:10,height:10,fill:i[30]}),l.jsx("rect",{x:60,y:30,width:10,height:10,fill:i[31]}),l.jsx("rect",{x:60,y:40,width:10,height:10,fill:i[32]}),l.jsx("rect",{x:60,y:50,width:10,height:10,fill:i[33]}),l.jsx("rect",{x:60,y:60,width:10,height:10,fill:i[34]}),l.jsx("rect",{x:60,y:70,width:10,height:10,fill:i[35]}),l.jsx("rect",{x:10,y:10,width:10,height:10,fill:i[36]}),l.jsx("rect",{x:10,y:20,width:10,height:10,fill:i[37]}),l.jsx("rect",{x:10,y:30,width:10,height:10,fill:i[38]}),l.jsx("rect",{x:10,y:40,width:10,height:10,fill:i[39]}),l.jsx("rect",{x:10,y:50,width:10,height:10,fill:i[40]}),l.jsx("rect",{x:10,y:60,width:10,height:10,fill:i[41]}),l.jsx("rect",{x:10,y:70,width:10,height:10,fill:i[42]}),l.jsx("rect",{x:30,y:10,width:10,height:10,fill:i[43]}),l.jsx("rect",{x:30,y:20,width:10,height:10,fill:i[44]}),l.jsx("rect",{x:30,y:30,width:10,height:10,fill:i[45]}),l.jsx("rect",{x:30,y:40,width:10,height:10,fill:i[46]}),l.jsx("rect",{x:30,y:50,width:10,height:10,fill:i[47]}),l.jsx("rect",{x:30,y:60,width:10,height:10,fill:i[48]}),l.jsx("rect",{x:30,y:70,width:10,height:10,fill:i[49]}),l.jsx("rect",{x:50,y:10,width:10,height:10,fill:i[50]}),l.jsx("rect",{x:50,y:20,width:10,height:10,fill:i[51]}),l.jsx("rect",{x:50,y:30,width:10,height:10,fill:i[52]}),l.jsx("rect",{x:50,y:40,width:10,height:10,fill:i[53]}),l.jsx("rect",{x:50,y:50,width:10,height:10,fill:i[54]}),l.jsx("rect",{x:50,y:60,width:10,height:10,fill:i[55]}),l.jsx("rect",{x:50,y:70,width:10,height:10,fill:i[56]}),l.jsx("rect",{x:70,y:10,width:10,height:10,fill:i[57]}),l.jsx("rect",{x:70,y:20,width:10,height:10,fill:i[58]}),l.jsx("rect",{x:70,y:30,width:10,height:10,fill:i[59]}),l.jsx("rect",{x:70,y:40,width:10,height:10,fill:i[60]}),l.jsx("rect",{x:70,y:50,width:10,height:10,fill:i[61]}),l.jsx("rect",{x:70,y:60,width:10,height:10,fill:i[62]}),l.jsx("rect",{x:70,y:70,width:10,height:10,fill:i[63]})]})]})},he=36;function Bd(t,e){const r=wr(t),n=e&&e.length,s=Wt(r,e,n),a=Se(r,10,1),i=a<5?a+he/9:a,o=Se(r,10,2),c=o<5?o+he/9:o;return{wrapperColor:s,faceColor:Id(s),backgroundColor:Wt(r+13,e,n),wrapperTranslateX:i,wrapperTranslateY:c,wrapperRotate:Se(r,360),wrapperScale:1+Se(r,he/12)/10,isMouthOpen:$s(r,2),isCircle:$s(r,1),eyeSpread:Se(r,5),mouthSpread:Se(r,3),faceRotate:Se(r,10,3),faceTranslateX:i>he/6?i/2:Se(r,8,1),faceTranslateY:c>he/6?c/2:Se(r,7,2)}}const fi=({name:t,colors:e,title:r,square:n,size:s,...a})=>{const i=Bd(t,e),o=h.useId();return l.jsxs("svg",{viewBox:"0 0 "+he+" "+he,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:s,height:s,...a,children:[r&&l.jsx("title",{children:t}),l.jsx("mask",{id:o,maskUnits:"userSpaceOnUse",x:0,y:0,width:he,height:he,children:l.jsx("rect",{width:he,height:he,rx:n?void 0:he*2,fill:"#FFFFFF"})}),l.jsxs("g",{mask:`url(#${o})`,children:[l.jsx("rect",{width:he,height:he,fill:i.backgroundColor}),l.jsx("rect",{x:"0",y:"0",width:he,height:he,transform:"translate("+i.wrapperTranslateX+" "+i.wrapperTranslateY+") rotate("+i.wrapperRotate+" "+he/2+" "+he/2+") scale("+i.wrapperScale+")",fill:i.wrapperColor,rx:i.isCircle?he:he/6}),l.jsxs("g",{transform:"translate("+i.faceTranslateX+" "+i.faceTranslateY+") rotate("+i.faceRotate+" "+he/2+" "+he/2+")",children:[i.isMouthOpen?l.jsx("path",{d:"M15 "+(19+i.mouthSpread)+"c2 1 4 1 6 0",stroke:i.faceColor,fill:"none",strokeLinecap:"round"}):l.jsx("path",{d:"M13,"+(19+i.mouthSpread)+" a1,0.75 0 0,0 10,0",fill:i.faceColor}),l.jsx("rect",{x:14-i.eyeSpread,y:14,width:1.5,height:2,rx:1,stroke:"none",fill:i.faceColor}),l.jsx("rect",{x:20+i.eyeSpread,y:14,width:1.5,height:2,rx:1,stroke:"none",fill:i.faceColor})]})]})]})},Ud=4,Ee=80;function Hd(t,e){const r=wr(t),n=e&&e.length;return Array.from({length:Ud},(s,a)=>Wt(r+a,e,n))}const qd=({name:t,colors:e,title:r,square:n,size:s,...a})=>{const i=Hd(t,e),o=t.replace(/\s/g,""),c=h.useId();return l.jsxs("svg",{viewBox:"0 0 "+Ee+" "+Ee,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:s,height:s,...a,children:[r&&l.jsx("title",{children:t}),l.jsx("mask",{id:c,maskUnits:"userSpaceOnUse",x:0,y:0,width:Ee,height:Ee,children:l.jsx("rect",{width:Ee,height:Ee,rx:n?void 0:Ee*2,fill:"#FFFFFF"})}),l.jsxs("g",{mask:`url(#${c})`,children:[l.jsx("path",{fill:"url(#gradient_paint0_linear_"+o+")",d:"M0 0h80v40H0z"}),l.jsx("path",{fill:"url(#gradient_paint1_linear_"+o+")",d:"M0 40h80v40H0z"})]}),l.jsxs("defs",{children:[l.jsxs("linearGradient",{id:"gradient_paint0_linear_"+o,x1:Ee/2,y1:0,x2:Ee/2,y2:Ee/2,gradientUnits:"userSpaceOnUse",children:[l.jsx("stop",{stopColor:i[0]}),l.jsx("stop",{offset:1,stopColor:i[1]})]}),l.jsxs("linearGradient",{id:"gradient_paint1_linear_"+o,x1:Ee/2,y1:Ee/2,x2:Ee/2,y2:Ee,gradientUnits:"userSpaceOnUse",children:[l.jsx("stop",{stopColor:i[2]}),l.jsx("stop",{offset:1,stopColor:i[3]})]})]})]})},Yd=3,ke=80;function Gd(t,e){const r=wr(t),n=e&&e.length;return Array.from({length:Yd},(s,a)=>({color:Wt(r+a,e,n),translateX:Se(r*(a+1),ke/10,1),translateY:Se(r*(a+1),ke/10,2),scale:1.2+Se(r*(a+1),ke/20)/10,rotate:Se(r*(a+1),360,1)}))}const Uo=({name:t,colors:e,title:r,square:n,size:s,...a})=>{const i=Gd(t,e),o=h.useId();return l.jsxs("svg",{viewBox:"0 0 "+ke+" "+ke,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:s,height:s,...a,children:[r&&l.jsx("title",{children:t}),l.jsx("mask",{id:o,maskUnits:"userSpaceOnUse",x:0,y:0,width:ke,height:ke,children:l.jsx("rect",{width:ke,height:ke,rx:n?void 0:ke*2,fill:"#FFFFFF"})}),l.jsxs("g",{mask:`url(#${o})`,children:[l.jsx("rect",{width:ke,height:ke,fill:i[0].color}),l.jsx("path",{filter:`url(#filter_${o})`,d:"M32.414 59.35L50.376 70.5H72.5v-71H33.728L26.5 13.381l19.057 27.08L32.414 59.35z",fill:i[1].color,transform:"translate("+i[1].translateX+" "+i[1].translateY+") rotate("+i[1].rotate+" "+ke/2+" "+ke/2+") scale("+i[2].scale+")"}),l.jsx("path",{filter:`url(#filter_${o})`,style:{mixBlendMode:"overlay"},d:"M22.216 24L0 46.75l14.108 38.129L78 86l-3.081-59.276-22.378 4.005 12.972 20.186-23.35 27.395L22.215 24z",fill:i[2].color,transform:"translate("+i[2].translateX+" "+i[2].translateY+") rotate("+i[2].rotate+" "+ke/2+" "+ke/2+") scale("+i[2].scale+")"})]}),l.jsx("defs",{children:l.jsxs("filter",{id:`filter_${o}`,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[l.jsx("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),l.jsx("feBlend",{in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),l.jsx("feGaussianBlur",{stdDeviation:7,result:"effect1_foregroundBlur"})]})})]})},Xd={pixel:Zd,bauhaus:di,ring:$d,beam:fi,sunset:qd,marble:Uo,geometric:fi,abstract:di},Ho=({variant:t="marble",colors:e=["#92A1C6","#146A7C","#F0AB3D","#C271B4","#C20D90"],name:r="Clara Barton",title:n=!1,size:s="40px",square:a=!1,...i})=>{const o=Xd[t]||Uo;return l.jsx(o,{colors:e,name:r,title:n,size:s,square:a,...i})},qo=["var(--oniratec-brand)","var(--oniratec-fill-primary)","var(--oniratec-label-primary)"],Jd=({personId:t})=>l.jsx(Ho,{size:40,name:t,variant:"beam",colors:qo}),Kd=({userId:t})=>l.jsx(Ho,{size:40,name:t,variant:"bauhaus",colors:qo});function N(...t){return Wo.twMerge(ha.clsx(t))}const Qd=({children:t,className:e})=>l.jsx("div",{className:N("rounded-lg border border-[color:var(--oniratec-border-primary)] bg-[color:var(--oniratec-fill-primary)] p-4 shadow-[var(--oniratec-shadow-card-md)]",e),children:t});function hi(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Yo(...t){return e=>{let r=!1;const n=t.map(s=>{const a=hi(s,e);return!r&&typeof a=="function"&&(r=!0),a});if(r)return()=>{for(let s=0;s<n.length;s++){const a=n[s];typeof a=="function"?a():hi(t[s],null)}}}}function $e(...t){return h.useCallback(Yo(...t),t)}function Zn(t){const e=ef(t),r=h.forwardRef((n,s)=>{const{children:a,...i}=n,o=h.Children.toArray(a),c=o.find(rf);if(c){const u=c.props.children,f=o.map(d=>d===c?h.Children.count(u)>1?h.Children.only(null):h.isValidElement(u)?u.props.children:null:d);return l.jsx(e,{...i,ref:s,children:h.isValidElement(u)?h.cloneElement(u,void 0,f):null})}return l.jsx(e,{...i,ref:s,children:a})});return r.displayName=`${t}.Slot`,r}var Go=Zn("Slot");function ef(t){const e=h.forwardRef((r,n)=>{const{children:s,...a}=r;if(h.isValidElement(s)){const i=sf(s),o=nf(a,s.props);return s.type!==h.Fragment&&(o.ref=n?Yo(n,i):i),h.cloneElement(s,o)}return h.Children.count(s)>1?h.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var tf=Symbol("radix.slottable");function rf(t){return h.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===tf}function nf(t,e){const r={...e};for(const n in e){const s=t[n],a=e[n];/^on[A-Z]/.test(n)?s&&a?r[n]=(...o)=>{const c=a(...o);return s(...o),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...a}:n==="className"&&(r[n]=[s,a].filter(Boolean).join(" "))}return{...t,...r}}function sf(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}const mi=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,pi=ha.clsx,Bn=(t,e)=>r=>{var n;if(e?.variants==null)return pi(t,r?.class,r?.className);const{variants:s,defaultVariants:a}=e,i=Object.keys(s).map(u=>{const f=r?.[u],d=a?.[u];if(f===null)return null;const m=mi(f)||mi(d);return s[u][m]}),o=r&&Object.entries(r).reduce((u,f)=>{let[d,m]=f;return m===void 0||(u[d]=m),u},{}),c=e==null||(n=e.compoundVariants)===null||n===void 0?void 0:n.reduce((u,f)=>{let{class:d,className:m,...p}=f;return Object.entries(p).every(y=>{let[g,x]=y;return Array.isArray(x)?x.includes({...a,...o}[g]):{...a,...o}[g]===x})?[...u,d,m]:u},[]);return pi(t,i,c,r?.class,r?.className)},Xo=Bn("inline-flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap rounded-lg border border-transparent text-sm font-medium transition-[background-color,border-color,color,transform,box-shadow] outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",primary:"bg-primary text-primary-foreground hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted dark:border-input dark:bg-input/30 dark:hover:bg-input/50",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted dark:hover:bg-muted/60",link:"h-auto rounded-none border-transparent px-0 py-0 text-primary underline-offset-4 hover:underline focus-visible:border-transparent focus-visible:ring-0"},size:{xs:"h-6 rounded-md px-2 text-xs [&_svg]:size-3",sm:"h-7 rounded-md px-2.5 text-[0.8rem] [&_svg]:size-3.5",md:"h-8 px-2.5",lg:"h-9 px-3 text-sm",icon:"h-8 w-8","icon-sm":"h-7 w-7 rounded-md","icon-lg":"h-9 w-9"}},defaultVariants:{variant:"default",size:"md"}}),Le=h.forwardRef(({className:t,asChild:e=!1,variant:r="default",size:n="md",loading:s=!1,disabled:a,children:i,...o},c)=>{const u=e?Go:"button";return l.jsxs(u,{ref:c,"data-size":n??void 0,"data-variant":r??void 0,className:N(Xo({variant:r,size:n}),t),disabled:a||s,...o,children:[s&&l.jsx(J.Loader2,{className:"h-4 w-4 animate-spin"}),i]})});Le.displayName="Button";const af=({src:t,alt:e,width:r=70,height:n=70,className:s,ImageComponent:a,...i})=>{const o=a??"img";return l.jsx(o,{type:void 0,props:void 0,src:t,alt:e,width:r,height:n,className:N("inline-block object-contain",s),...i},null)},zs=({children:t,className:e,size:r="default"})=>l.jsx("div",{className:N("flex flex-col overflow-hidden rounded-xl bg-card text-card-foreground ring-1 ring-foreground/10 shadow-card-sm transition-[box-shadow,transform]",r==="sm"?"gap-3 py-3":"gap-4 py-4","hover:shadow-card-md",e),children:t}),Jo=({children:t,className:e})=>l.jsx("div",{className:N("grid gap-1 px-4",e),children:t}),Ko=({children:t,className:e})=>l.jsx("h3",{className:N("text-base font-medium leading-snug text-card-foreground",e),children:t}),of=({children:t,className:e})=>l.jsx("p",{className:N("text-sm text-muted-foreground",e),children:t}),Qo=({children:t,className:e})=>l.jsx("div",{className:N("px-4",e),children:t}),lf=({children:t,className:e})=>l.jsx("div",{className:N("ml-auto flex items-center gap-2",e),children:t}),cf=({children:t,className:e})=>l.jsx("div",{className:N("flex items-center gap-2 border-t bg-muted/50 p-4",e),children:t}),el=Bn("relative grid w-full grid-cols-[auto_1fr] items-start gap-3 rounded-xl bg-card p-4 text-sm text-card-foreground ring-1 ring-foreground/10",{variants:{variant:{info:"[&_svg]:text-muted-foreground",success:"bg-primary/5 ring-primary/15 [&_svg]:text-primary dark:bg-primary/10",warning:"bg-amber-500/10 ring-amber-500/20 [&_svg]:text-amber-600 dark:bg-amber-500/15 dark:[&_svg]:text-amber-400",error:"bg-destructive/10 ring-destructive/20 [&_svg]:text-destructive dark:bg-destructive/15"}},defaultVariants:{variant:"info"}}),uf={error:J.AlertCircle,warning:J.AlertTriangle,info:J.Info,success:J.CheckCircle},tl=h.forwardRef(({className:t,variant:e="info",children:r,...n},s)=>{const a=uf[e];return l.jsxs("div",{ref:s,role:"alert",className:N(el({variant:e}),t),...n,children:[a&&l.jsx(a,{className:"mt-0.5 h-4 w-4 shrink-0","aria-hidden":"true"}),l.jsx("div",{className:"flex-1",children:r})]})});tl.displayName="Alert";const rl=h.forwardRef(({className:t,...e},r)=>l.jsx("h5",{ref:r,className:N("mb-1 font-medium leading-none tracking-tight",t),...e}));rl.displayName="AlertTitle";const nl=h.forwardRef(({className:t,...e},r)=>l.jsx("div",{ref:r,className:N("text-sm text-muted-foreground [&_p]:leading-relaxed",t),...e}));nl.displayName="AlertDescription";const sl=Bn("inline-flex items-center rounded-md border font-medium transition-colors focus:outline-none focus-visible:ring-3 focus-visible:ring-ring/50",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",success:"border-transparent bg-emerald-500/15 text-emerald-700 dark:text-emerald-400",warning:"border-transparent bg-amber-500/10 text-amber-700 dark:text-amber-300",danger:"border-transparent bg-destructive/10 text-destructive",info:"border-transparent bg-accent text-accent-foreground",outline:"border-border bg-background text-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground"},size:{sm:"px-1.5 py-0.5 text-[11px]",md:"px-2 py-0.5 text-xs"}},defaultVariants:{variant:"default",size:"md"}}),pa=h.forwardRef(({className:t,variant:e="default",size:r="md",...n},s)=>l.jsx("span",{ref:s,className:N(sl({variant:e,size:r}),t),...n}));pa.displayName="Badge";const al=h.forwardRef(({className:t,id:e,label:r,description:n,size:s="md",indeterminate:a=!1,disabled:i,"aria-describedby":o,"aria-invalid":c,...u},f)=>{const d=h.useId(),m=e??d,p=n?`${m}-description`:void 0,y=c===!0||c==="true",g=h.useRef(null);h.useEffect(()=>{g.current&&(g.current.indeterminate=a)},[a]);const x=h.useCallback(v=>{g.current=v,typeof f=="function"?f(v):f&&(f.current=v)},[f]);return l.jsxs("label",{htmlFor:m,className:N("inline-flex w-fit items-start gap-2.5 text-sm",i&&"cursor-not-allowed opacity-60",t),children:[l.jsx("input",{ref:x,id:m,type:"checkbox",disabled:i,"aria-invalid":y||void 0,"aria-checked":a?"mixed":void 0,"aria-describedby":[o,p].filter(Boolean).join(" ")||void 0,className:"peer sr-only",...u}),l.jsx("span",{className:N("flex shrink-0 items-center justify-center rounded-[min(var(--radius-md),10px)] border border-input bg-background text-primary-foreground transition-[background-color,border-color,box-shadow,color] outline-none","peer-focus-visible:border-ring peer-focus-visible:ring-3 peer-focus-visible:ring-ring/50","peer-disabled:border-border/50 peer-disabled:bg-muted/50 peer-disabled:opacity-70",!a&&"peer-checked:border-primary peer-checked:bg-primary peer-checked:[&_svg]:opacity-100",a&&"border-primary bg-primary [&_svg]:opacity-100",y&&"border-destructive peer-focus-visible:border-destructive peer-focus-visible:ring-destructive/20",s==="sm"?"h-4 w-4":"h-5 w-5"),children:a?l.jsx(J.Minus,{className:"h-3.5 w-3.5 opacity-0 transition-opacity"}):l.jsx(J.Check,{className:"h-3.5 w-3.5 opacity-0 transition-opacity"})}),(r||n)&&l.jsxs("span",{className:"grid gap-1 leading-tight",children:[r&&l.jsx("span",{className:"font-medium text-foreground",children:r}),n&&l.jsx("span",{id:p,className:"text-sm text-muted-foreground",children:n})]})]})});al.displayName="Checkbox";function Re(t,e,{checkForDefaultPrevented:r=!0}={}){return function(s){if(t?.(s),r===!1||!s.defaultPrevented)return e?.(s)}}function df(t,e){const r=h.createContext(e),n=a=>{const{children:i,...o}=a,c=h.useMemo(()=>o,Object.values(o));return l.jsx(r.Provider,{value:c,children:i})};n.displayName=t+"Provider";function s(a){const i=h.useContext(r);if(i)return i;if(e!==void 0)return e;throw new Error(`\`${a}\` must be used within \`${t}\``)}return[n,s]}function Un(t,e=[]){let r=[];function n(a,i){const o=h.createContext(i),c=r.length;r=[...r,i];const u=d=>{const{scope:m,children:p,...y}=d,g=m?.[t]?.[c]||o,x=h.useMemo(()=>y,Object.values(y));return l.jsx(g.Provider,{value:x,children:p})};u.displayName=a+"Provider";function f(d,m){const p=m?.[t]?.[c]||o,y=h.useContext(p);if(y)return y;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${a}\``)}return[u,f]}const s=()=>{const a=r.map(i=>h.createContext(i));return function(o){const c=o?.[t]||a;return h.useMemo(()=>({[`__scope${t}`]:{...o,[t]:c}}),[o,c])}};return s.scopeName=t,[n,ff(s,...e)]}function ff(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const n=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(a){const i=n.reduce((o,{useScope:c,scopeName:u})=>{const d=c(a)[`__scope${u}`];return{...o,...d}},{});return h.useMemo(()=>({[`__scope${e.scopeName}`]:i}),[i])}};return r.scopeName=e.scopeName,r}var hf=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],_e=hf.reduce((t,e)=>{const r=Zn(`Primitive.${e}`),n=h.forwardRef((s,a)=>{const{asChild:i,...o}=s,c=i?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...o,ref:a})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function mf(t,e){t&&Zo.flushSync(()=>t.dispatchEvent(e))}function hr(t){const e=h.useRef(t);return h.useEffect(()=>{e.current=t}),h.useMemo(()=>(...r)=>e.current?.(...r),[])}function pf(t,e=globalThis?.document){const r=hr(t);h.useEffect(()=>{const n=s=>{s.key==="Escape"&&r(s)};return e.addEventListener("keydown",n,{capture:!0}),()=>e.removeEventListener("keydown",n,{capture:!0})},[r,e])}var gf="DismissableLayer",Ws="dismissableLayer.update",yf="dismissableLayer.pointerDownOutside",vf="dismissableLayer.focusOutside",gi,il=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ga=h.forwardRef((t,e)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:i,onDismiss:o,...c}=t,u=h.useContext(il),[f,d]=h.useState(null),m=f?.ownerDocument??globalThis?.document,[,p]=h.useState({}),y=$e(e,T=>d(T)),g=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(x),S=f?g.indexOf(f):-1,C=u.layersWithOutsidePointerEventsDisabled.size>0,k=S>=v,w=wf(T=>{const A=T.target,$=[...u.branches].some(L=>L.contains(A));!k||$||(s?.(T),i?.(T),T.defaultPrevented||o?.())},m),j=kf(T=>{const A=T.target;[...u.branches].some(L=>L.contains(A))||(a?.(T),i?.(T),T.defaultPrevented||o?.())},m);return pf(T=>{S===u.layers.size-1&&(n?.(T),!T.defaultPrevented&&o&&(T.preventDefault(),o()))},m),h.useEffect(()=>{if(f)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(gi=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),yi(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=gi)}},[f,m,r,u]),h.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),yi())},[f,u]),h.useEffect(()=>{const T=()=>p({});return document.addEventListener(Ws,T),()=>document.removeEventListener(Ws,T)},[]),l.jsx(_e.div,{...c,ref:y,style:{pointerEvents:C?k?"auto":"none":void 0,...t.style},onFocusCapture:Re(t.onFocusCapture,j.onFocusCapture),onBlurCapture:Re(t.onBlurCapture,j.onBlurCapture),onPointerDownCapture:Re(t.onPointerDownCapture,w.onPointerDownCapture)})});ga.displayName=gf;var xf="DismissableLayerBranch",bf=h.forwardRef((t,e)=>{const r=h.useContext(il),n=h.useRef(null),s=$e(e,n);return h.useEffect(()=>{const a=n.current;if(a)return r.branches.add(a),()=>{r.branches.delete(a)}},[r.branches]),l.jsx(_e.div,{...t,ref:s})});bf.displayName=xf;function wf(t,e=globalThis?.document){const r=hr(t),n=h.useRef(!1),s=h.useRef(()=>{});return h.useEffect(()=>{const a=o=>{if(o.target&&!n.current){let c=function(){ol(yf,r,u,{discrete:!0})};const u={originalEvent:o};o.pointerType==="touch"?(e.removeEventListener("click",s.current),s.current=c,e.addEventListener("click",s.current,{once:!0})):c()}else e.removeEventListener("click",s.current);n.current=!1},i=window.setTimeout(()=>{e.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(i),e.removeEventListener("pointerdown",a),e.removeEventListener("click",s.current)}},[e,r]),{onPointerDownCapture:()=>n.current=!0}}function kf(t,e=globalThis?.document){const r=hr(t),n=h.useRef(!1);return h.useEffect(()=>{const s=a=>{a.target&&!n.current&&ol(vf,r,{originalEvent:a},{discrete:!1})};return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function yi(){const t=new CustomEvent(Ws);document.dispatchEvent(t)}function ol(t,e,r,{discrete:n}){const s=r.originalEvent.target,a=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&s.addEventListener(t,e,{once:!0}),n?mf(s,a):s.dispatchEvent(a)}var vs=0;function ll(){h.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??vi()),document.body.insertAdjacentElement("beforeend",t[1]??vi()),vs++,()=>{vs===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),vs--}},[])}function vi(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var xs="focusScope.autoFocusOnMount",bs="focusScope.autoFocusOnUnmount",xi={bubbles:!1,cancelable:!0},Sf="FocusScope",ya=h.forwardRef((t,e)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...i}=t,[o,c]=h.useState(null),u=hr(s),f=hr(a),d=h.useRef(null),m=$e(e,g=>c(g)),p=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(n){let g=function(C){if(p.paused||!o)return;const k=C.target;o.contains(k)?d.current=k:kt(d.current,{select:!0})},x=function(C){if(p.paused||!o)return;const k=C.relatedTarget;k!==null&&(o.contains(k)||kt(d.current,{select:!0}))},v=function(C){if(document.activeElement===document.body)for(const w of C)w.removedNodes.length>0&&kt(o)};document.addEventListener("focusin",g),document.addEventListener("focusout",x);const S=new MutationObserver(v);return o&&S.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",x),S.disconnect()}}},[n,o,p.paused]),h.useEffect(()=>{if(o){wi.add(p);const g=document.activeElement;if(!o.contains(g)){const v=new CustomEvent(xs,xi);o.addEventListener(xs,u),o.dispatchEvent(v),v.defaultPrevented||(Nf(Ef(cl(o)),{select:!0}),document.activeElement===g&&kt(o))}return()=>{o.removeEventListener(xs,u),setTimeout(()=>{const v=new CustomEvent(bs,xi);o.addEventListener(bs,f),o.dispatchEvent(v),v.defaultPrevented||kt(g??document.body,{select:!0}),o.removeEventListener(bs,f),wi.remove(p)},0)}}},[o,u,f,p]);const y=h.useCallback(g=>{if(!r&&!n||p.paused)return;const x=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,v=document.activeElement;if(x&&v){const S=g.currentTarget,[C,k]=Cf(S);C&&k?!g.shiftKey&&v===k?(g.preventDefault(),r&&kt(C,{select:!0})):g.shiftKey&&v===C&&(g.preventDefault(),r&&kt(k,{select:!0})):v===S&&g.preventDefault()}},[r,n,p.paused]);return l.jsx(_e.div,{tabIndex:-1,...i,ref:m,onKeyDown:y})});ya.displayName=Sf;function Nf(t,{select:e=!1}={}){const r=document.activeElement;for(const n of t)if(kt(n,{select:e}),document.activeElement!==r)return}function Cf(t){const e=cl(t),r=bi(e,t),n=bi(e.reverse(),t);return[r,n]}function cl(t){const e=[],r=document.createTreeWalker(t,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();)e.push(r.currentNode);return e}function bi(t,e){for(const r of t)if(!_f(r,{upTo:e}))return r}function _f(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function Tf(t){return t instanceof HTMLInputElement&&"select"in t}function kt(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&Tf(t)&&e&&t.select()}}var wi=jf();function jf(){let t=[];return{add(e){const r=t[0];e!==r&&r?.pause(),t=ki(t,e),t.unshift(e)},remove(e){t=ki(t,e),t[0]?.resume()}}}function ki(t,e){const r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}function Ef(t){return t.filter(e=>e.tagName!=="A")}var jt=globalThis?.document?h.useLayoutEffect:()=>{},Of=h[" useId ".trim().toString()]||(()=>{}),Df=0;function xn(t){const[e,r]=h.useState(Of());return jt(()=>{r(n=>n??String(Df++))},[t]),t||(e?`radix-${e}`:"")}const Rf=["top","right","bottom","left"],Et=Math.min,Ie=Math.max,Tn=Math.round,an=Math.floor,lt=t=>({x:t,y:t}),Af={left:"right",right:"left",bottom:"top",top:"bottom"},Mf={start:"end",end:"start"};function Zs(t,e,r){return Ie(t,Et(e,r))}function pt(t,e){return typeof t=="function"?t(e):t}function gt(t){return t.split("-")[0]}function kr(t){return t.split("-")[1]}function va(t){return t==="x"?"y":"x"}function xa(t){return t==="y"?"height":"width"}const If=new Set(["top","bottom"]);function ot(t){return If.has(gt(t))?"y":"x"}function ba(t){return va(ot(t))}function Pf(t,e,r){r===void 0&&(r=!1);const n=kr(t),s=ba(t),a=xa(s);let i=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[a]>e.floating[a]&&(i=jn(i)),[i,jn(i)]}function Ff(t){const e=jn(t);return[Bs(t),e,Bs(e)]}function Bs(t){return t.replace(/start|end/g,e=>Mf[e])}const Si=["left","right"],Ni=["right","left"],Lf=["top","bottom"],Vf=["bottom","top"];function $f(t,e,r){switch(t){case"top":case"bottom":return r?e?Ni:Si:e?Si:Ni;case"left":case"right":return e?Lf:Vf;default:return[]}}function zf(t,e,r,n){const s=kr(t);let a=$f(gt(t),r==="start",n);return s&&(a=a.map(i=>i+"-"+s),e&&(a=a.concat(a.map(Bs)))),a}function jn(t){return t.replace(/left|right|bottom|top/g,e=>Af[e])}function Wf(t){return{top:0,right:0,bottom:0,left:0,...t}}function ul(t){return typeof t!="number"?Wf(t):{top:t,right:t,bottom:t,left:t}}function En(t){const{x:e,y:r,width:n,height:s}=t;return{width:n,height:s,top:r,left:e,right:e+n,bottom:r+s,x:e,y:r}}function Ci(t,e,r){let{reference:n,floating:s}=t;const a=ot(e),i=ba(e),o=xa(i),c=gt(e),u=a==="y",f=n.x+n.width/2-s.width/2,d=n.y+n.height/2-s.height/2,m=n[o]/2-s[o]/2;let p;switch(c){case"top":p={x:f,y:n.y-s.height};break;case"bottom":p={x:f,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:d};break;case"left":p={x:n.x-s.width,y:d};break;default:p={x:n.x,y:n.y}}switch(kr(e)){case"start":p[i]-=m*(r&&u?-1:1);break;case"end":p[i]+=m*(r&&u?-1:1);break}return p}const Zf=async(t,e,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:a=[],platform:i}=r,o=a.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(e));let u=await i.getElementRects({reference:t,floating:e,strategy:s}),{x:f,y:d}=Ci(u,n,c),m=n,p={},y=0;for(let g=0;g<o.length;g++){const{name:x,fn:v}=o[g],{x:S,y:C,data:k,reset:w}=await v({x:f,y:d,initialPlacement:n,placement:m,strategy:s,middlewareData:p,rects:u,platform:i,elements:{reference:t,floating:e}});f=S??f,d=C??d,p={...p,[x]:{...p[x],...k}},w&&y<=50&&(y++,typeof w=="object"&&(w.placement&&(m=w.placement),w.rects&&(u=w.rects===!0?await i.getElementRects({reference:t,floating:e,strategy:s}):w.rects),{x:f,y:d}=Ci(u,m,c)),g=-1)}return{x:f,y:d,placement:m,strategy:s,middlewareData:p}};async function Fr(t,e){var r;e===void 0&&(e={});const{x:n,y:s,platform:a,rects:i,elements:o,strategy:c}=t,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:m=!1,padding:p=0}=pt(e,t),y=ul(p),x=o[m?d==="floating"?"reference":"floating":d],v=En(await a.getClippingRect({element:(r=await(a.isElement==null?void 0:a.isElement(x)))==null||r?x:x.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(o.floating)),boundary:u,rootBoundary:f,strategy:c})),S=d==="floating"?{x:n,y:s,width:i.floating.width,height:i.floating.height}:i.reference,C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(o.floating)),k=await(a.isElement==null?void 0:a.isElement(C))?await(a.getScale==null?void 0:a.getScale(C))||{x:1,y:1}:{x:1,y:1},w=En(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:S,offsetParent:C,strategy:c}):S);return{top:(v.top-w.top+y.top)/k.y,bottom:(w.bottom-v.bottom+y.bottom)/k.y,left:(v.left-w.left+y.left)/k.x,right:(w.right-v.right+y.right)/k.x}}const Bf=t=>({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:s,rects:a,platform:i,elements:o,middlewareData:c}=e,{element:u,padding:f=0}=pt(t,e)||{};if(u==null)return{};const d=ul(f),m={x:r,y:n},p=ba(s),y=xa(p),g=await i.getDimensions(u),x=p==="y",v=x?"top":"left",S=x?"bottom":"right",C=x?"clientHeight":"clientWidth",k=a.reference[y]+a.reference[p]-m[p]-a.floating[y],w=m[p]-a.reference[p],j=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let T=j?j[C]:0;(!T||!await(i.isElement==null?void 0:i.isElement(j)))&&(T=o.floating[C]||a.floating[y]);const A=k/2-w/2,$=T/2-g[y]/2-1,L=Et(d[v],$),W=Et(d[S],$),B=L,G=T-g[y]-W,Q=T/2-g[y]/2+A,H=Zs(B,Q,G),P=!c.arrow&&kr(s)!=null&&Q!==H&&a.reference[y]/2-(Q<B?L:W)-g[y]/2<0,U=P?Q<B?Q-B:Q-G:0;return{[p]:m[p]+U,data:{[p]:H,centerOffset:Q-H-U,...P&&{alignmentOffset:U}},reset:P}}}),Uf=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var r,n;const{placement:s,middlewareData:a,rects:i,initialPlacement:o,platform:c,elements:u}=e,{mainAxis:f=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:g=!0,...x}=pt(t,e);if((r=a.arrow)!=null&&r.alignmentOffset)return{};const v=gt(s),S=ot(o),C=gt(o)===o,k=await(c.isRTL==null?void 0:c.isRTL(u.floating)),w=m||(C||!g?[jn(o)]:Ff(o)),j=y!=="none";!m&&j&&w.push(...zf(o,g,y,k));const T=[o,...w],A=await Fr(e,x),$=[];let L=((n=a.flip)==null?void 0:n.overflows)||[];if(f&&$.push(A[v]),d){const Q=Pf(s,i,k);$.push(A[Q[0]],A[Q[1]])}if(L=[...L,{placement:s,overflows:$}],!$.every(Q=>Q<=0)){var W,B;const Q=(((W=a.flip)==null?void 0:W.index)||0)+1,H=T[Q];if(H&&(!(d==="alignment"?S!==ot(H):!1)||L.every(V=>ot(V.placement)===S?V.overflows[0]>0:!0)))return{data:{index:Q,overflows:L},reset:{placement:H}};let P=(B=L.filter(U=>U.overflows[0]<=0).sort((U,V)=>U.overflows[1]-V.overflows[1])[0])==null?void 0:B.placement;if(!P)switch(p){case"bestFit":{var G;const U=(G=L.filter(V=>{if(j){const ie=ot(V.placement);return ie===S||ie==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(ie=>ie>0).reduce((ie,F)=>ie+F,0)]).sort((V,ie)=>V[1]-ie[1])[0])==null?void 0:G[0];U&&(P=U);break}case"initialPlacement":P=o;break}if(s!==P)return{reset:{placement:P}}}return{}}}};function _i(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Ti(t){return Rf.some(e=>t[e]>=0)}const Hf=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r}=e,{strategy:n="referenceHidden",...s}=pt(t,e);switch(n){case"referenceHidden":{const a=await Fr(e,{...s,elementContext:"reference"}),i=_i(a,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Ti(i)}}}case"escaped":{const a=await Fr(e,{...s,altBoundary:!0}),i=_i(a,r.floating);return{data:{escapedOffsets:i,escaped:Ti(i)}}}default:return{}}}}},dl=new Set(["left","top"]);async function qf(t,e){const{placement:r,platform:n,elements:s}=t,a=await(n.isRTL==null?void 0:n.isRTL(s.floating)),i=gt(r),o=kr(r),c=ot(r)==="y",u=dl.has(i)?-1:1,f=a&&c?-1:1,d=pt(e,t);let{mainAxis:m,crossAxis:p,alignmentAxis:y}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return o&&typeof y=="number"&&(p=o==="end"?y*-1:y),c?{x:p*f,y:m*u}:{x:m*u,y:p*f}}const Yf=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,n;const{x:s,y:a,placement:i,middlewareData:o}=e,c=await qf(e,t);return i===((r=o.offset)==null?void 0:r.placement)&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:s+c.x,y:a+c.y,data:{...c,placement:i}}}}},Gf=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:s}=e,{mainAxis:a=!0,crossAxis:i=!1,limiter:o={fn:x=>{let{x:v,y:S}=x;return{x:v,y:S}}},...c}=pt(t,e),u={x:r,y:n},f=await Fr(e,c),d=ot(gt(s)),m=va(d);let p=u[m],y=u[d];if(a){const x=m==="y"?"top":"left",v=m==="y"?"bottom":"right",S=p+f[x],C=p-f[v];p=Zs(S,p,C)}if(i){const x=d==="y"?"top":"left",v=d==="y"?"bottom":"right",S=y+f[x],C=y-f[v];y=Zs(S,y,C)}const g=o.fn({...e,[m]:p,[d]:y});return{...g,data:{x:g.x-r,y:g.y-n,enabled:{[m]:a,[d]:i}}}}}},Xf=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:n,placement:s,rects:a,middlewareData:i}=e,{offset:o=0,mainAxis:c=!0,crossAxis:u=!0}=pt(t,e),f={x:r,y:n},d=ot(s),m=va(d);let p=f[m],y=f[d];const g=pt(o,e),x=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const C=m==="y"?"height":"width",k=a.reference[m]-a.floating[C]+x.mainAxis,w=a.reference[m]+a.reference[C]-x.mainAxis;p<k?p=k:p>w&&(p=w)}if(u){var v,S;const C=m==="y"?"width":"height",k=dl.has(gt(s)),w=a.reference[d]-a.floating[C]+(k&&((v=i.offset)==null?void 0:v[d])||0)+(k?0:x.crossAxis),j=a.reference[d]+a.reference[C]+(k?0:((S=i.offset)==null?void 0:S[d])||0)-(k?x.crossAxis:0);y<w?y=w:y>j&&(y=j)}return{[m]:p,[d]:y}}}},Jf=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var r,n;const{placement:s,rects:a,platform:i,elements:o}=e,{apply:c=()=>{},...u}=pt(t,e),f=await Fr(e,u),d=gt(s),m=kr(s),p=ot(s)==="y",{width:y,height:g}=a.floating;let x,v;d==="top"||d==="bottom"?(x=d,v=m===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(v=d,x=m==="end"?"top":"bottom");const S=g-f.top-f.bottom,C=y-f.left-f.right,k=Et(g-f[x],S),w=Et(y-f[v],C),j=!e.middlewareData.shift;let T=k,A=w;if((r=e.middlewareData.shift)!=null&&r.enabled.x&&(A=C),(n=e.middlewareData.shift)!=null&&n.enabled.y&&(T=S),j&&!m){const L=Ie(f.left,0),W=Ie(f.right,0),B=Ie(f.top,0),G=Ie(f.bottom,0);p?A=y-2*(L!==0||W!==0?L+W:Ie(f.left,f.right)):T=g-2*(B!==0||G!==0?B+G:Ie(f.top,f.bottom))}await c({...e,availableWidth:A,availableHeight:T});const $=await i.getDimensions(o.floating);return y!==$.width||g!==$.height?{reset:{rects:!0}}:{}}}};function Hn(){return typeof window<"u"}function Sr(t){return fl(t)?(t.nodeName||"").toLowerCase():"#document"}function Pe(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ft(t){var e;return(e=(fl(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function fl(t){return Hn()?t instanceof Node||t instanceof Pe(t).Node:!1}function Qe(t){return Hn()?t instanceof Element||t instanceof Pe(t).Element:!1}function ut(t){return Hn()?t instanceof HTMLElement||t instanceof Pe(t).HTMLElement:!1}function ji(t){return!Hn()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Pe(t).ShadowRoot}const Kf=new Set(["inline","contents"]);function Ur(t){const{overflow:e,overflowX:r,overflowY:n,display:s}=et(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!Kf.has(s)}const Qf=new Set(["table","td","th"]);function eh(t){return Qf.has(Sr(t))}const th=[":popover-open",":modal"];function qn(t){return th.some(e=>{try{return t.matches(e)}catch{return!1}})}const rh=["transform","translate","scale","rotate","perspective"],nh=["transform","translate","scale","rotate","perspective","filter"],sh=["paint","layout","strict","content"];function wa(t){const e=ka(),r=Qe(t)?et(t):t;return rh.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||nh.some(n=>(r.willChange||"").includes(n))||sh.some(n=>(r.contain||"").includes(n))}function ah(t){let e=Ot(t);for(;ut(e)&&!mr(e);){if(wa(e))return e;if(qn(e))return null;e=Ot(e)}return null}function ka(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const ih=new Set(["html","body","#document"]);function mr(t){return ih.has(Sr(t))}function et(t){return Pe(t).getComputedStyle(t)}function Yn(t){return Qe(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Ot(t){if(Sr(t)==="html")return t;const e=t.assignedSlot||t.parentNode||ji(t)&&t.host||ft(t);return ji(e)?e.host:e}function hl(t){const e=Ot(t);return mr(e)?t.ownerDocument?t.ownerDocument.body:t.body:ut(e)&&Ur(e)?e:hl(e)}function Lr(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const s=hl(t),a=s===((n=t.ownerDocument)==null?void 0:n.body),i=Pe(s);if(a){const o=Us(i);return e.concat(i,i.visualViewport||[],Ur(s)?s:[],o&&r?Lr(o):[])}return e.concat(s,Lr(s,[],r))}function Us(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function ml(t){const e=et(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const s=ut(t),a=s?t.offsetWidth:r,i=s?t.offsetHeight:n,o=Tn(r)!==a||Tn(n)!==i;return o&&(r=a,n=i),{width:r,height:n,$:o}}function Sa(t){return Qe(t)?t:t.contextElement}function cr(t){const e=Sa(t);if(!ut(e))return lt(1);const r=e.getBoundingClientRect(),{width:n,height:s,$:a}=ml(e);let i=(a?Tn(r.width):r.width)/n,o=(a?Tn(r.height):r.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!o||!Number.isFinite(o))&&(o=1),{x:i,y:o}}const oh=lt(0);function pl(t){const e=Pe(t);return!ka()||!e.visualViewport?oh:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function lh(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==Pe(t)?!1:e}function Zt(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const s=t.getBoundingClientRect(),a=Sa(t);let i=lt(1);e&&(n?Qe(n)&&(i=cr(n)):i=cr(t));const o=lh(a,r,n)?pl(a):lt(0);let c=(s.left+o.x)/i.x,u=(s.top+o.y)/i.y,f=s.width/i.x,d=s.height/i.y;if(a){const m=Pe(a),p=n&&Qe(n)?Pe(n):n;let y=m,g=Us(y);for(;g&&n&&p!==y;){const x=cr(g),v=g.getBoundingClientRect(),S=et(g),C=v.left+(g.clientLeft+parseFloat(S.paddingLeft))*x.x,k=v.top+(g.clientTop+parseFloat(S.paddingTop))*x.y;c*=x.x,u*=x.y,f*=x.x,d*=x.y,c+=C,u+=k,y=Pe(g),g=Us(y)}}return En({width:f,height:d,x:c,y:u})}function Gn(t,e){const r=Yn(t).scrollLeft;return e?e.left+r:Zt(ft(t)).left+r}function gl(t,e){const r=t.getBoundingClientRect(),n=r.left+e.scrollLeft-Gn(t,r),s=r.top+e.scrollTop;return{x:n,y:s}}function ch(t){let{elements:e,rect:r,offsetParent:n,strategy:s}=t;const a=s==="fixed",i=ft(n),o=e?qn(e.floating):!1;if(n===i||o&&a)return r;let c={scrollLeft:0,scrollTop:0},u=lt(1);const f=lt(0),d=ut(n);if((d||!d&&!a)&&((Sr(n)!=="body"||Ur(i))&&(c=Yn(n)),ut(n))){const p=Zt(n);u=cr(n),f.x=p.x+n.clientLeft,f.y=p.y+n.clientTop}const m=i&&!d&&!a?gl(i,c):lt(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-c.scrollLeft*u.x+f.x+m.x,y:r.y*u.y-c.scrollTop*u.y+f.y+m.y}}function uh(t){return Array.from(t.getClientRects())}function dh(t){const e=ft(t),r=Yn(t),n=t.ownerDocument.body,s=Ie(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),a=Ie(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+Gn(t);const o=-r.scrollTop;return et(n).direction==="rtl"&&(i+=Ie(e.clientWidth,n.clientWidth)-s),{width:s,height:a,x:i,y:o}}const Ei=25;function fh(t,e){const r=Pe(t),n=ft(t),s=r.visualViewport;let a=n.clientWidth,i=n.clientHeight,o=0,c=0;if(s){a=s.width,i=s.height;const f=ka();(!f||f&&e==="fixed")&&(o=s.offsetLeft,c=s.offsetTop)}const u=Gn(n);if(u<=0){const f=n.ownerDocument,d=f.body,m=getComputedStyle(d),p=f.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,y=Math.abs(n.clientWidth-d.clientWidth-p);y<=Ei&&(a-=y)}else u<=Ei&&(a+=u);return{width:a,height:i,x:o,y:c}}const hh=new Set(["absolute","fixed"]);function mh(t,e){const r=Zt(t,!0,e==="fixed"),n=r.top+t.clientTop,s=r.left+t.clientLeft,a=ut(t)?cr(t):lt(1),i=t.clientWidth*a.x,o=t.clientHeight*a.y,c=s*a.x,u=n*a.y;return{width:i,height:o,x:c,y:u}}function Oi(t,e,r){let n;if(e==="viewport")n=fh(t,r);else if(e==="document")n=dh(ft(t));else if(Qe(e))n=mh(e,r);else{const s=pl(t);n={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return En(n)}function yl(t,e){const r=Ot(t);return r===e||!Qe(r)||mr(r)?!1:et(r).position==="fixed"||yl(r,e)}function ph(t,e){const r=e.get(t);if(r)return r;let n=Lr(t,[],!1).filter(o=>Qe(o)&&Sr(o)!=="body"),s=null;const a=et(t).position==="fixed";let i=a?Ot(t):t;for(;Qe(i)&&!mr(i);){const o=et(i),c=wa(i);!c&&o.position==="fixed"&&(s=null),(a?!c&&!s:!c&&o.position==="static"&&!!s&&hh.has(s.position)||Ur(i)&&!c&&yl(t,i))?n=n.filter(f=>f!==i):s=o,i=Ot(i)}return e.set(t,n),n}function gh(t){let{element:e,boundary:r,rootBoundary:n,strategy:s}=t;const i=[...r==="clippingAncestors"?qn(e)?[]:ph(e,this._c):[].concat(r),n],o=i[0],c=i.reduce((u,f)=>{const d=Oi(e,f,s);return u.top=Ie(d.top,u.top),u.right=Et(d.right,u.right),u.bottom=Et(d.bottom,u.bottom),u.left=Ie(d.left,u.left),u},Oi(e,o,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function yh(t){const{width:e,height:r}=ml(t);return{width:e,height:r}}function vh(t,e,r){const n=ut(e),s=ft(e),a=r==="fixed",i=Zt(t,!0,a,e);let o={scrollLeft:0,scrollTop:0};const c=lt(0);function u(){c.x=Gn(s)}if(n||!n&&!a)if((Sr(e)!=="body"||Ur(s))&&(o=Yn(e)),n){const p=Zt(e,!0,a,e);c.x=p.x+e.clientLeft,c.y=p.y+e.clientTop}else s&&u();a&&!n&&s&&u();const f=s&&!n&&!a?gl(s,o):lt(0),d=i.left+o.scrollLeft-c.x-f.x,m=i.top+o.scrollTop-c.y-f.y;return{x:d,y:m,width:i.width,height:i.height}}function ws(t){return et(t).position==="static"}function Di(t,e){if(!ut(t)||et(t).position==="fixed")return null;if(e)return e(t);let r=t.offsetParent;return ft(t)===r&&(r=r.ownerDocument.body),r}function vl(t,e){const r=Pe(t);if(qn(t))return r;if(!ut(t)){let s=Ot(t);for(;s&&!mr(s);){if(Qe(s)&&!ws(s))return s;s=Ot(s)}return r}let n=Di(t,e);for(;n&&eh(n)&&ws(n);)n=Di(n,e);return n&&mr(n)&&ws(n)&&!wa(n)?r:n||ah(t)||r}const xh=async function(t){const e=this.getOffsetParent||vl,r=this.getDimensions,n=await r(t.floating);return{reference:vh(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function bh(t){return et(t).direction==="rtl"}const wh={convertOffsetParentRelativeRectToViewportRelativeRect:ch,getDocumentElement:ft,getClippingRect:gh,getOffsetParent:vl,getElementRects:xh,getClientRects:uh,getDimensions:yh,getScale:cr,isElement:Qe,isRTL:bh};function xl(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function kh(t,e){let r=null,n;const s=ft(t);function a(){var o;clearTimeout(n),(o=r)==null||o.disconnect(),r=null}function i(o,c){o===void 0&&(o=!1),c===void 0&&(c=1),a();const u=t.getBoundingClientRect(),{left:f,top:d,width:m,height:p}=u;if(o||e(),!m||!p)return;const y=an(d),g=an(s.clientWidth-(f+m)),x=an(s.clientHeight-(d+p)),v=an(f),C={rootMargin:-y+"px "+-g+"px "+-x+"px "+-v+"px",threshold:Ie(0,Et(1,c))||1};let k=!0;function w(j){const T=j[0].intersectionRatio;if(T!==c){if(!k)return i();T?i(!1,T):n=setTimeout(()=>{i(!1,1e-7)},1e3)}T===1&&!xl(u,t.getBoundingClientRect())&&i(),k=!1}try{r=new IntersectionObserver(w,{...C,root:s.ownerDocument})}catch{r=new IntersectionObserver(w,C)}r.observe(t)}return i(!0),a}function Sh(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,u=Sa(t),f=s||a?[...u?Lr(u):[],...Lr(e)]:[];f.forEach(v=>{s&&v.addEventListener("scroll",r,{passive:!0}),a&&v.addEventListener("resize",r)});const d=u&&o?kh(u,r):null;let m=-1,p=null;i&&(p=new ResizeObserver(v=>{let[S]=v;S&&S.target===u&&p&&(p.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var C;(C=p)==null||C.observe(e)})),r()}),u&&!c&&p.observe(u),p.observe(e));let y,g=c?Zt(t):null;c&&x();function x(){const v=Zt(t);g&&!xl(g,v)&&r(),g=v,y=requestAnimationFrame(x)}return r(),()=>{var v;f.forEach(S=>{s&&S.removeEventListener("scroll",r),a&&S.removeEventListener("resize",r)}),d?.(),(v=p)==null||v.disconnect(),p=null,c&&cancelAnimationFrame(y)}}const Nh=Yf,Ch=Gf,_h=Uf,Th=Jf,jh=Hf,Ri=Bf,Eh=Xf,Oh=(t,e,r)=>{const n=new Map,s={platform:wh,...r},a={...s.platform,_c:n};return Zf(t,e,{...s,platform:a})};var Dh=typeof document<"u",Rh=function(){},bn=Dh?b.useLayoutEffect:Rh;function On(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,n,s;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!==e.length)return!1;for(n=r;n--!==0;)if(!On(t[n],e[n]))return!1;return!0}if(s=Object.keys(t),r=s.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(e,s[n]))return!1;for(n=r;n--!==0;){const a=s[n];if(!(a==="_owner"&&t.$$typeof)&&!On(t[a],e[a]))return!1}return!0}return t!==t&&e!==e}function bl(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Ai(t,e){const r=bl(t);return Math.round(e*r)/r}function ks(t){const e=h.useRef(t);return bn(()=>{e.current=t}),e}function Ah(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:a,floating:i}={},transform:o=!0,whileElementsMounted:c,open:u}=t,[f,d]=h.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[m,p]=h.useState(n);On(m,n)||p(n);const[y,g]=h.useState(null),[x,v]=h.useState(null),S=h.useCallback(V=>{V!==j.current&&(j.current=V,g(V))},[]),C=h.useCallback(V=>{V!==T.current&&(T.current=V,v(V))},[]),k=a||y,w=i||x,j=h.useRef(null),T=h.useRef(null),A=h.useRef(f),$=c!=null,L=ks(c),W=ks(s),B=ks(u),G=h.useCallback(()=>{if(!j.current||!T.current)return;const V={placement:e,strategy:r,middleware:m};W.current&&(V.platform=W.current),Oh(j.current,T.current,V).then(ie=>{const F={...ie,isPositioned:B.current!==!1};Q.current&&!On(A.current,F)&&(A.current=F,Zo.flushSync(()=>{d(F)}))})},[m,e,r,W,B]);bn(()=>{u===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,d(V=>({...V,isPositioned:!1})))},[u]);const Q=h.useRef(!1);bn(()=>(Q.current=!0,()=>{Q.current=!1}),[]),bn(()=>{if(k&&(j.current=k),w&&(T.current=w),k&&w){if(L.current)return L.current(k,w,G);G()}},[k,w,G,L,$]);const H=h.useMemo(()=>({reference:j,floating:T,setReference:S,setFloating:C}),[S,C]),P=h.useMemo(()=>({reference:k,floating:w}),[k,w]),U=h.useMemo(()=>{const V={position:r,left:0,top:0};if(!P.floating)return V;const ie=Ai(P.floating,f.x),F=Ai(P.floating,f.y);return o?{...V,transform:"translate("+ie+"px, "+F+"px)",...bl(P.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:ie,top:F}},[r,o,P.floating,f.x,f.y]);return h.useMemo(()=>({...f,update:G,refs:H,elements:P,floatingStyles:U}),[f,G,H,P,U])}const Mh=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:n,padding:s}=typeof t=="function"?t(r):t;return n&&e(n)?n.current!=null?Ri({element:n.current,padding:s}).fn(r):{}:n?Ri({element:n,padding:s}).fn(r):{}}}},Ih=(t,e)=>({...Nh(t),options:[t,e]}),Ph=(t,e)=>({...Ch(t),options:[t,e]}),Fh=(t,e)=>({...Eh(t),options:[t,e]}),Lh=(t,e)=>({..._h(t),options:[t,e]}),Vh=(t,e)=>({...Th(t),options:[t,e]}),$h=(t,e)=>({...jh(t),options:[t,e]}),zh=(t,e)=>({...Mh(t),options:[t,e]});var Wh="Arrow",wl=h.forwardRef((t,e)=>{const{children:r,width:n=10,height:s=5,...a}=t;return l.jsx(_e.svg,{...a,ref:e,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});wl.displayName=Wh;var Zh=wl;function kl(t){const[e,r]=h.useState(void 0);return jt(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const n=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const a=s[0];let i,o;if("borderBoxSize"in a){const c=a.borderBoxSize,u=Array.isArray(c)?c[0]:c;i=u.inlineSize,o=u.blockSize}else i=t.offsetWidth,o=t.offsetHeight;r({width:i,height:o})});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0)},[t]),e}var Na="Popper",[Sl,Nl]=Un(Na),[Bh,Cl]=Sl(Na),_l=t=>{const{__scopePopper:e,children:r}=t,[n,s]=h.useState(null);return l.jsx(Bh,{scope:e,anchor:n,onAnchorChange:s,children:r})};_l.displayName=Na;var Tl="PopperAnchor",jl=h.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:n,...s}=t,a=Cl(Tl,r),i=h.useRef(null),o=$e(e,i),c=h.useRef(null);return h.useEffect(()=>{const u=c.current;c.current=n?.current||i.current,u!==c.current&&a.onAnchorChange(c.current)}),n?null:l.jsx(_e.div,{...s,ref:o})});jl.displayName=Tl;var Ca="PopperContent",[Uh,Hh]=Sl(Ca),El=h.forwardRef((t,e)=>{const{__scopePopper:r,side:n="bottom",sideOffset:s=0,align:a="center",alignOffset:i=0,arrowPadding:o=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:d="partial",hideWhenDetached:m=!1,updatePositionStrategy:p="optimized",onPlaced:y,...g}=t,x=Cl(Ca,r),[v,S]=h.useState(null),C=$e(e,Te=>S(Te)),[k,w]=h.useState(null),j=kl(k),T=j?.width??0,A=j?.height??0,$=n+(a!=="center"?"-"+a:""),L=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},W=Array.isArray(u)?u:[u],B=W.length>0,G={padding:L,boundary:W.filter(Yh),altBoundary:B},{refs:Q,floatingStyles:H,placement:P,isPositioned:U,middlewareData:V}=Ah({strategy:"fixed",placement:$,whileElementsMounted:(...Te)=>Sh(...Te,{animationFrame:p==="always"}),elements:{reference:x.anchor},middleware:[Ih({mainAxis:s+A,alignmentAxis:i}),c&&Ph({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?Fh():void 0,...G}),c&&Lh({...G}),Vh({...G,apply:({elements:Te,rects:le,availableWidth:vt,availableHeight:Yt})=>{const{width:Gt,height:xt}=le.reference,Xt=Te.floating.style;Xt.setProperty("--radix-popper-available-width",`${vt}px`),Xt.setProperty("--radix-popper-available-height",`${Yt}px`),Xt.setProperty("--radix-popper-anchor-width",`${Gt}px`),Xt.setProperty("--radix-popper-anchor-height",`${xt}px`)}}),k&&zh({element:k,padding:o}),Gh({arrowWidth:T,arrowHeight:A}),m&&$h({strategy:"referenceHidden",...G})]}),[ie,F]=Rl(P),D=hr(y);jt(()=>{U&&D?.()},[U,D]);const ee=V.arrow?.x,z=V.arrow?.y,oe=V.arrow?.centerOffset!==0,[ce,ve]=h.useState();return jt(()=>{v&&ve(window.getComputedStyle(v).zIndex)},[v]),l.jsx("div",{ref:Q.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:U?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ce,"--radix-popper-transform-origin":[V.transformOrigin?.x,V.transformOrigin?.y].join(" "),...V.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:l.jsx(Uh,{scope:r,placedSide:ie,onArrowChange:w,arrowX:ee,arrowY:z,shouldHideArrow:oe,children:l.jsx(_e.div,{"data-side":ie,"data-align":F,...g,ref:C,style:{...g.style,animation:U?void 0:"none"}})})})});El.displayName=Ca;var Ol="PopperArrow",qh={top:"bottom",right:"left",bottom:"top",left:"right"},Dl=h.forwardRef(function(e,r){const{__scopePopper:n,...s}=e,a=Hh(Ol,n),i=qh[a.placedSide];return l.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:l.jsx(Zh,{...s,ref:r,style:{...s.style,display:"block"}})})});Dl.displayName=Ol;function Yh(t){return t!==null}var Gh=t=>({name:"transformOrigin",options:t,fn(e){const{placement:r,rects:n,middlewareData:s}=e,i=s.arrow?.centerOffset!==0,o=i?0:t.arrowWidth,c=i?0:t.arrowHeight,[u,f]=Rl(r),d={start:"0%",center:"50%",end:"100%"}[f],m=(s.arrow?.x??0)+o/2,p=(s.arrow?.y??0)+c/2;let y="",g="";return u==="bottom"?(y=i?d:`${m}px`,g=`${-c}px`):u==="top"?(y=i?d:`${m}px`,g=`${n.floating.height+c}px`):u==="right"?(y=`${-c}px`,g=i?d:`${p}px`):u==="left"&&(y=`${n.floating.width+c}px`,g=i?d:`${p}px`),{data:{x:y,y:g}}}});function Rl(t){const[e,r="center"]=t.split("-");return[e,r]}var Xh=_l,Al=jl,Jh=El,Kh=Dl,Qh="Portal",_a=h.forwardRef((t,e)=>{const{container:r,...n}=t,[s,a]=h.useState(!1);jt(()=>a(!0),[]);const i=r||s&&globalThis?.document?.body;return i?ma.createPortal(l.jsx(_e.div,{...n,ref:e}),i):null});_a.displayName=Qh;function em(t,e){return h.useReducer((r,n)=>e[r][n]??r,t)}var Nr=t=>{const{present:e,children:r}=t,n=tm(e),s=typeof r=="function"?r({present:n.isPresent}):h.Children.only(r),a=$e(n.ref,rm(s));return typeof r=="function"||n.isPresent?h.cloneElement(s,{ref:a}):null};Nr.displayName="Presence";function tm(t){const[e,r]=h.useState(),n=h.useRef(null),s=h.useRef(t),a=h.useRef("none"),i=t?"mounted":"unmounted",[o,c]=em(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const u=on(n.current);a.current=o==="mounted"?u:"none"},[o]),jt(()=>{const u=n.current,f=s.current;if(f!==t){const m=a.current,p=on(u);t?c("MOUNT"):p==="none"||u?.display==="none"?c("UNMOUNT"):c(f&&m!==p?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,c]),jt(()=>{if(e){let u;const f=e.ownerDocument.defaultView??window,d=p=>{const g=on(n.current).includes(CSS.escape(p.animationName));if(p.target===e&&g&&(c("ANIMATION_END"),!s.current)){const x=e.style.animationFillMode;e.style.animationFillMode="forwards",u=f.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=x)})}},m=p=>{p.target===e&&(a.current=on(n.current))};return e.addEventListener("animationstart",m),e.addEventListener("animationcancel",d),e.addEventListener("animationend",d),()=>{f.clearTimeout(u),e.removeEventListener("animationstart",m),e.removeEventListener("animationcancel",d),e.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:h.useCallback(u=>{n.current=u?getComputedStyle(u):null,r(u)},[])}}function on(t){return t?.animationName||"none"}function rm(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var nm=h[" useInsertionEffect ".trim().toString()]||jt;function Ta({prop:t,defaultProp:e,onChange:r=()=>{},caller:n}){const[s,a,i]=sm({defaultProp:e,onChange:r}),o=t!==void 0,c=o?t:s;{const f=h.useRef(t!==void 0);h.useEffect(()=>{const d=f.current;d!==o&&console.warn(`${n} is changing from ${d?"controlled":"uncontrolled"} to ${o?"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.`),f.current=o},[o,n])}const u=h.useCallback(f=>{if(o){const d=am(f)?f(t):f;d!==t&&i.current?.(d)}else a(f)},[o,t,a,i]);return[c,u]}function sm({defaultProp:t,onChange:e}){const[r,n]=h.useState(t),s=h.useRef(r),a=h.useRef(e);return nm(()=>{a.current=e},[e]),h.useEffect(()=>{s.current!==r&&(a.current?.(r),s.current=r)},[r,s]),[r,n,a]}function am(t){return typeof t=="function"}var im=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},er=new WeakMap,ln=new WeakMap,cn={},Ss=0,Ml=function(t){return t&&(t.host||Ml(t.parentNode))},om=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=Ml(r);return n&&t.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",t,". Doing nothing"),null)}).filter(function(r){return!!r})},lm=function(t,e,r,n){var s=om(e,Array.isArray(t)?t:[t]);cn[r]||(cn[r]=new WeakMap);var a=cn[r],i=[],o=new Set,c=new Set(s),u=function(d){!d||o.has(d)||(o.add(d),u(d.parentNode))};s.forEach(u);var f=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(m){if(o.has(m))f(m);else try{var p=m.getAttribute(n),y=p!==null&&p!=="false",g=(er.get(m)||0)+1,x=(a.get(m)||0)+1;er.set(m,g),a.set(m,x),i.push(m),g===1&&y&&ln.set(m,!0),x===1&&m.setAttribute(r,"true"),y||m.setAttribute(n,"true")}catch(v){console.error("aria-hidden: cannot operate on ",m,v)}})};return f(e),o.clear(),Ss++,function(){i.forEach(function(d){var m=er.get(d)-1,p=a.get(d)-1;er.set(d,m),a.set(d,p),m||(ln.has(d)||d.removeAttribute(n),ln.delete(d)),p||d.removeAttribute(r)}),Ss--,Ss||(er=new WeakMap,er=new WeakMap,ln=new WeakMap,cn={})}},Il=function(t,e,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),s=im(t);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live], script"))),lm(n,s,r,"aria-hidden")):function(){return null}},it=function(){return it=Object.assign||function(e){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},it.apply(this,arguments)};function Pl(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(r[n[s]]=t[n[s]]);return r}function cm(t,e,r){if(r||arguments.length===2)for(var n=0,s=e.length,a;n<s;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||Array.prototype.slice.call(e))}var wn="right-scroll-bar-position",kn="width-before-scroll-bar",um="with-scroll-bars-hidden",dm="--removed-body-scroll-bar-size";function Ns(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function fm(t,e){var r=b.useState(function(){return{value:t,callback:e,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=e,r.facade}var hm=typeof window<"u"?h.useLayoutEffect:h.useEffect,Mi=new WeakMap;function mm(t,e){var r=fm(null,function(n){return t.forEach(function(s){return Ns(s,n)})});return hm(function(){var n=Mi.get(r);if(n){var s=new Set(n),a=new Set(t),i=r.current;s.forEach(function(o){a.has(o)||Ns(o,null)}),a.forEach(function(o){s.has(o)||Ns(o,i)})}Mi.set(r,t)},[t]),r}function pm(t){return t}function gm(t,e){e===void 0&&(e=pm);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]:t},useMedium:function(a){var i=e(a,n);return r.push(i),function(){r=r.filter(function(o){return o!==i})}},assignSyncMedium:function(a){for(n=!0;r.length;){var i=r;r=[],i.forEach(a)}r={push:function(o){return a(o)},filter:function(){return r}}},assignMedium:function(a){n=!0;var i=[];if(r.length){var o=r;r=[],o.forEach(a),i=r}var c=function(){var f=i;i=[],f.forEach(a)},u=function(){return Promise.resolve().then(c)};u(),r={push:function(f){i.push(f),u()},filter:function(f){return i=i.filter(f),r}}}};return s}function ym(t){t===void 0&&(t={});var e=gm(null);return e.options=it({async:!0,ssr:!1},t),e}var Fl=function(t){var e=t.sideCar,r=Pl(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=e.read();if(!n)throw new Error("Sidecar medium not found");return h.createElement(n,it({},r))};Fl.isSideCarExport=!0;function vm(t,e){return t.useMedium(e),Fl}var Ll=ym(),Cs=function(){},Xn=h.forwardRef(function(t,e){var r=h.useRef(null),n=h.useState({onScrollCapture:Cs,onWheelCapture:Cs,onTouchMoveCapture:Cs}),s=n[0],a=n[1],i=t.forwardProps,o=t.children,c=t.className,u=t.removeScrollBar,f=t.enabled,d=t.shards,m=t.sideCar,p=t.noRelative,y=t.noIsolation,g=t.inert,x=t.allowPinchZoom,v=t.as,S=v===void 0?"div":v,C=t.gapMode,k=Pl(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=m,j=mm([r,e]),T=it(it({},k),s);return h.createElement(h.Fragment,null,f&&h.createElement(w,{sideCar:Ll,removeScrollBar:u,shards:d,noRelative:p,noIsolation:y,inert:g,setCallbacks:a,allowPinchZoom:!!x,lockRef:r,gapMode:C}),i?h.cloneElement(h.Children.only(o),it(it({},T),{ref:j})):h.createElement(S,it({},T,{className:c,ref:j}),o))});Xn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Xn.classNames={fullWidth:kn,zeroRight:wn};var xm=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function bm(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=xm();return e&&t.setAttribute("nonce",e),t}function wm(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function km(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var Sm=function(){var t=0,e=null;return{add:function(r){t==0&&(e=bm())&&(wm(e,r),km(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},Nm=function(){var t=Sm();return function(e,r){h.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&r])}},Vl=function(){var t=Nm(),e=function(r){var n=r.styles,s=r.dynamic;return t(n,s),null};return e},Cm={left:0,top:0,right:0,gap:0},_s=function(t){return parseInt(t||"",10)||0},_m=function(t){var e=window.getComputedStyle(document.body),r=e[t==="padding"?"paddingLeft":"marginLeft"],n=e[t==="padding"?"paddingTop":"marginTop"],s=e[t==="padding"?"paddingRight":"marginRight"];return[_s(r),_s(n),_s(s)]},Tm=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return Cm;var e=_m(t),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,n-r+e[2]-e[0])}},jm=Vl(),ur="data-scroll-locked",Em=function(t,e,r,n){var s=t.left,a=t.top,i=t.right,o=t.gap;return r===void 0&&(r="margin"),`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Wo=require("tailwind-merge"),ha=require("clsx"),l=require("react/jsx-runtime"),b=require("react"),J=require("lucide-react"),ma=require("react-dom"),Dd=require("@radix-ui/react-dropdown-menu"),Rd=require("lottie-react"),Ad=require("@radix-ui/react-select"),Md=require("@radix-ui/react-tooltip");function Br(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const h=Br(b),Zo=Br(ma),fe=Br(Dd),pe=Br(Ad),zt=Br(Md),wr=t=>{let e=0;for(let r=0;r<t.length;r++){const n=t.charCodeAt(r);e=(e<<5)-e+n,e=e&e}return Math.abs(e)},Bo=(t,e)=>Math.floor(t/Math.pow(10,e)%10),$s=(t,e)=>!(Bo(t,e)%2),Se=(t,e,r)=>{const n=t%e;return r&&Bo(t,r)%2===0?-n:n},Wt=(t,e,r)=>e[t%r],Id=t=>{t.slice(0,1)==="#"&&(t=t.slice(1));const e=parseInt(t.substr(0,2),16),r=parseInt(t.substr(2,2),16),n=parseInt(t.substr(4,2),16);return(e*299+r*587+n*114)/1e3>=128?"#000000":"#FFFFFF"},Pd=4,ue=80;function Fd(t,e){const r=wr(t),n=e&&e.length;return Array.from({length:Pd},(s,a)=>({color:Wt(r+a,e,n),translateX:Se(r*(a+1),ue/2-(a+17),1),translateY:Se(r*(a+1),ue/2-(a+17),2),rotate:Se(r*(a+1),360),isSquare:$s(r,2)}))}const di=({name:t,colors:e,title:r,square:n,size:s,...a})=>{const i=Fd(t,e),o=h.useId();return l.jsxs("svg",{viewBox:"0 0 "+ue+" "+ue,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:s,height:s,...a,children:[r&&l.jsx("title",{children:t}),l.jsx("mask",{id:o,maskUnits:"userSpaceOnUse",x:0,y:0,width:ue,height:ue,children:l.jsx("rect",{width:ue,height:ue,rx:n?void 0:ue*2,fill:"#FFFFFF"})}),l.jsxs("g",{mask:`url(#${o})`,children:[l.jsx("rect",{width:ue,height:ue,fill:i[0].color}),l.jsx("rect",{x:(ue-60)/2,y:(ue-20)/2,width:ue,height:i[1].isSquare?ue:ue/8,fill:i[1].color,transform:"translate("+i[1].translateX+" "+i[1].translateY+") rotate("+i[1].rotate+" "+ue/2+" "+ue/2+")"}),l.jsx("circle",{cx:ue/2,cy:ue/2,fill:i[2].color,r:ue/5,transform:"translate("+i[2].translateX+" "+i[2].translateY+")"}),l.jsx("line",{x1:0,y1:ue/2,x2:ue,y2:ue/2,strokeWidth:2,stroke:i[3].color,transform:"translate("+i[3].translateX+" "+i[3].translateY+") rotate("+i[3].rotate+" "+ue/2+" "+ue/2+")"})]})]})},It=90,Ld=5;function Vd(t,e){const r=wr(t),n=e&&e.length,s=Array.from({length:Ld},(i,o)=>Wt(r+o,e,n)),a=[];return a[0]=s[0],a[1]=s[1],a[2]=s[1],a[3]=s[2],a[4]=s[2],a[5]=s[3],a[6]=s[3],a[7]=s[0],a[8]=s[4],a}const $d=({name:t,colors:e,title:r,square:n,size:s,...a})=>{const i=Vd(t,e),o=b.useId();return l.jsxs("svg",{viewBox:"0 0 "+It+" "+It,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:s,height:s,...a,children:[r&&l.jsx("title",{children:t}),l.jsx("mask",{id:o,maskUnits:"userSpaceOnUse",x:0,y:0,width:It,height:It,children:l.jsx("rect",{width:It,height:It,rx:n?void 0:It*2,fill:"#FFFFFF"})}),l.jsxs("g",{mask:`url(#${o})`,children:[l.jsx("path",{d:"M0 0h90v45H0z",fill:i[0]}),l.jsx("path",{d:"M0 45h90v45H0z",fill:i[1]}),l.jsx("path",{d:"M83 45a38 38 0 00-76 0h76z",fill:i[2]}),l.jsx("path",{d:"M83 45a38 38 0 01-76 0h76z",fill:i[3]}),l.jsx("path",{d:"M77 45a32 32 0 10-64 0h64z",fill:i[4]}),l.jsx("path",{d:"M77 45a32 32 0 11-64 0h64z",fill:i[5]}),l.jsx("path",{d:"M71 45a26 26 0 00-52 0h52z",fill:i[6]}),l.jsx("path",{d:"M71 45a26 26 0 01-52 0h52z",fill:i[7]}),l.jsx("circle",{cx:45,cy:45,r:23,fill:i[8]})]})]})},zd=64,Pt=80;function Wd(t,e){const r=wr(t),n=e&&e.length;return Array.from({length:zd},(s,a)=>Wt(r%(a+1),e,n))}const Zd=({name:t,colors:e,title:r,square:n,size:s,...a})=>{const i=Wd(t,e),o=h.useId();return l.jsxs("svg",{viewBox:"0 0 "+Pt+" "+Pt,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:s,height:s,...a,children:[r&&l.jsx("title",{children:t}),l.jsx("mask",{id:o,"mask-type":"alpha",maskUnits:"userSpaceOnUse",x:0,y:0,width:Pt,height:Pt,children:l.jsx("rect",{width:Pt,height:Pt,rx:n?void 0:Pt*2,fill:"#FFFFFF"})}),l.jsxs("g",{mask:`url(#${o})`,children:[l.jsx("rect",{width:10,height:10,fill:i[0]}),l.jsx("rect",{x:20,width:10,height:10,fill:i[1]}),l.jsx("rect",{x:40,width:10,height:10,fill:i[2]}),l.jsx("rect",{x:60,width:10,height:10,fill:i[3]}),l.jsx("rect",{x:10,width:10,height:10,fill:i[4]}),l.jsx("rect",{x:30,width:10,height:10,fill:i[5]}),l.jsx("rect",{x:50,width:10,height:10,fill:i[6]}),l.jsx("rect",{x:70,width:10,height:10,fill:i[7]}),l.jsx("rect",{y:10,width:10,height:10,fill:i[8]}),l.jsx("rect",{y:20,width:10,height:10,fill:i[9]}),l.jsx("rect",{y:30,width:10,height:10,fill:i[10]}),l.jsx("rect",{y:40,width:10,height:10,fill:i[11]}),l.jsx("rect",{y:50,width:10,height:10,fill:i[12]}),l.jsx("rect",{y:60,width:10,height:10,fill:i[13]}),l.jsx("rect",{y:70,width:10,height:10,fill:i[14]}),l.jsx("rect",{x:20,y:10,width:10,height:10,fill:i[15]}),l.jsx("rect",{x:20,y:20,width:10,height:10,fill:i[16]}),l.jsx("rect",{x:20,y:30,width:10,height:10,fill:i[17]}),l.jsx("rect",{x:20,y:40,width:10,height:10,fill:i[18]}),l.jsx("rect",{x:20,y:50,width:10,height:10,fill:i[19]}),l.jsx("rect",{x:20,y:60,width:10,height:10,fill:i[20]}),l.jsx("rect",{x:20,y:70,width:10,height:10,fill:i[21]}),l.jsx("rect",{x:40,y:10,width:10,height:10,fill:i[22]}),l.jsx("rect",{x:40,y:20,width:10,height:10,fill:i[23]}),l.jsx("rect",{x:40,y:30,width:10,height:10,fill:i[24]}),l.jsx("rect",{x:40,y:40,width:10,height:10,fill:i[25]}),l.jsx("rect",{x:40,y:50,width:10,height:10,fill:i[26]}),l.jsx("rect",{x:40,y:60,width:10,height:10,fill:i[27]}),l.jsx("rect",{x:40,y:70,width:10,height:10,fill:i[28]}),l.jsx("rect",{x:60,y:10,width:10,height:10,fill:i[29]}),l.jsx("rect",{x:60,y:20,width:10,height:10,fill:i[30]}),l.jsx("rect",{x:60,y:30,width:10,height:10,fill:i[31]}),l.jsx("rect",{x:60,y:40,width:10,height:10,fill:i[32]}),l.jsx("rect",{x:60,y:50,width:10,height:10,fill:i[33]}),l.jsx("rect",{x:60,y:60,width:10,height:10,fill:i[34]}),l.jsx("rect",{x:60,y:70,width:10,height:10,fill:i[35]}),l.jsx("rect",{x:10,y:10,width:10,height:10,fill:i[36]}),l.jsx("rect",{x:10,y:20,width:10,height:10,fill:i[37]}),l.jsx("rect",{x:10,y:30,width:10,height:10,fill:i[38]}),l.jsx("rect",{x:10,y:40,width:10,height:10,fill:i[39]}),l.jsx("rect",{x:10,y:50,width:10,height:10,fill:i[40]}),l.jsx("rect",{x:10,y:60,width:10,height:10,fill:i[41]}),l.jsx("rect",{x:10,y:70,width:10,height:10,fill:i[42]}),l.jsx("rect",{x:30,y:10,width:10,height:10,fill:i[43]}),l.jsx("rect",{x:30,y:20,width:10,height:10,fill:i[44]}),l.jsx("rect",{x:30,y:30,width:10,height:10,fill:i[45]}),l.jsx("rect",{x:30,y:40,width:10,height:10,fill:i[46]}),l.jsx("rect",{x:30,y:50,width:10,height:10,fill:i[47]}),l.jsx("rect",{x:30,y:60,width:10,height:10,fill:i[48]}),l.jsx("rect",{x:30,y:70,width:10,height:10,fill:i[49]}),l.jsx("rect",{x:50,y:10,width:10,height:10,fill:i[50]}),l.jsx("rect",{x:50,y:20,width:10,height:10,fill:i[51]}),l.jsx("rect",{x:50,y:30,width:10,height:10,fill:i[52]}),l.jsx("rect",{x:50,y:40,width:10,height:10,fill:i[53]}),l.jsx("rect",{x:50,y:50,width:10,height:10,fill:i[54]}),l.jsx("rect",{x:50,y:60,width:10,height:10,fill:i[55]}),l.jsx("rect",{x:50,y:70,width:10,height:10,fill:i[56]}),l.jsx("rect",{x:70,y:10,width:10,height:10,fill:i[57]}),l.jsx("rect",{x:70,y:20,width:10,height:10,fill:i[58]}),l.jsx("rect",{x:70,y:30,width:10,height:10,fill:i[59]}),l.jsx("rect",{x:70,y:40,width:10,height:10,fill:i[60]}),l.jsx("rect",{x:70,y:50,width:10,height:10,fill:i[61]}),l.jsx("rect",{x:70,y:60,width:10,height:10,fill:i[62]}),l.jsx("rect",{x:70,y:70,width:10,height:10,fill:i[63]})]})]})},he=36;function Bd(t,e){const r=wr(t),n=e&&e.length,s=Wt(r,e,n),a=Se(r,10,1),i=a<5?a+he/9:a,o=Se(r,10,2),c=o<5?o+he/9:o;return{wrapperColor:s,faceColor:Id(s),backgroundColor:Wt(r+13,e,n),wrapperTranslateX:i,wrapperTranslateY:c,wrapperRotate:Se(r,360),wrapperScale:1+Se(r,he/12)/10,isMouthOpen:$s(r,2),isCircle:$s(r,1),eyeSpread:Se(r,5),mouthSpread:Se(r,3),faceRotate:Se(r,10,3),faceTranslateX:i>he/6?i/2:Se(r,8,1),faceTranslateY:c>he/6?c/2:Se(r,7,2)}}const fi=({name:t,colors:e,title:r,square:n,size:s,...a})=>{const i=Bd(t,e),o=h.useId();return l.jsxs("svg",{viewBox:"0 0 "+he+" "+he,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:s,height:s,...a,children:[r&&l.jsx("title",{children:t}),l.jsx("mask",{id:o,maskUnits:"userSpaceOnUse",x:0,y:0,width:he,height:he,children:l.jsx("rect",{width:he,height:he,rx:n?void 0:he*2,fill:"#FFFFFF"})}),l.jsxs("g",{mask:`url(#${o})`,children:[l.jsx("rect",{width:he,height:he,fill:i.backgroundColor}),l.jsx("rect",{x:"0",y:"0",width:he,height:he,transform:"translate("+i.wrapperTranslateX+" "+i.wrapperTranslateY+") rotate("+i.wrapperRotate+" "+he/2+" "+he/2+") scale("+i.wrapperScale+")",fill:i.wrapperColor,rx:i.isCircle?he:he/6}),l.jsxs("g",{transform:"translate("+i.faceTranslateX+" "+i.faceTranslateY+") rotate("+i.faceRotate+" "+he/2+" "+he/2+")",children:[i.isMouthOpen?l.jsx("path",{d:"M15 "+(19+i.mouthSpread)+"c2 1 4 1 6 0",stroke:i.faceColor,fill:"none",strokeLinecap:"round"}):l.jsx("path",{d:"M13,"+(19+i.mouthSpread)+" a1,0.75 0 0,0 10,0",fill:i.faceColor}),l.jsx("rect",{x:14-i.eyeSpread,y:14,width:1.5,height:2,rx:1,stroke:"none",fill:i.faceColor}),l.jsx("rect",{x:20+i.eyeSpread,y:14,width:1.5,height:2,rx:1,stroke:"none",fill:i.faceColor})]})]})]})},Ud=4,Ee=80;function Hd(t,e){const r=wr(t),n=e&&e.length;return Array.from({length:Ud},(s,a)=>Wt(r+a,e,n))}const qd=({name:t,colors:e,title:r,square:n,size:s,...a})=>{const i=Hd(t,e),o=t.replace(/\s/g,""),c=h.useId();return l.jsxs("svg",{viewBox:"0 0 "+Ee+" "+Ee,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:s,height:s,...a,children:[r&&l.jsx("title",{children:t}),l.jsx("mask",{id:c,maskUnits:"userSpaceOnUse",x:0,y:0,width:Ee,height:Ee,children:l.jsx("rect",{width:Ee,height:Ee,rx:n?void 0:Ee*2,fill:"#FFFFFF"})}),l.jsxs("g",{mask:`url(#${c})`,children:[l.jsx("path",{fill:"url(#gradient_paint0_linear_"+o+")",d:"M0 0h80v40H0z"}),l.jsx("path",{fill:"url(#gradient_paint1_linear_"+o+")",d:"M0 40h80v40H0z"})]}),l.jsxs("defs",{children:[l.jsxs("linearGradient",{id:"gradient_paint0_linear_"+o,x1:Ee/2,y1:0,x2:Ee/2,y2:Ee/2,gradientUnits:"userSpaceOnUse",children:[l.jsx("stop",{stopColor:i[0]}),l.jsx("stop",{offset:1,stopColor:i[1]})]}),l.jsxs("linearGradient",{id:"gradient_paint1_linear_"+o,x1:Ee/2,y1:Ee/2,x2:Ee/2,y2:Ee,gradientUnits:"userSpaceOnUse",children:[l.jsx("stop",{stopColor:i[2]}),l.jsx("stop",{offset:1,stopColor:i[3]})]})]})]})},Yd=3,ke=80;function Gd(t,e){const r=wr(t),n=e&&e.length;return Array.from({length:Yd},(s,a)=>({color:Wt(r+a,e,n),translateX:Se(r*(a+1),ke/10,1),translateY:Se(r*(a+1),ke/10,2),scale:1.2+Se(r*(a+1),ke/20)/10,rotate:Se(r*(a+1),360,1)}))}const Uo=({name:t,colors:e,title:r,square:n,size:s,...a})=>{const i=Gd(t,e),o=h.useId();return l.jsxs("svg",{viewBox:"0 0 "+ke+" "+ke,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:s,height:s,...a,children:[r&&l.jsx("title",{children:t}),l.jsx("mask",{id:o,maskUnits:"userSpaceOnUse",x:0,y:0,width:ke,height:ke,children:l.jsx("rect",{width:ke,height:ke,rx:n?void 0:ke*2,fill:"#FFFFFF"})}),l.jsxs("g",{mask:`url(#${o})`,children:[l.jsx("rect",{width:ke,height:ke,fill:i[0].color}),l.jsx("path",{filter:`url(#filter_${o})`,d:"M32.414 59.35L50.376 70.5H72.5v-71H33.728L26.5 13.381l19.057 27.08L32.414 59.35z",fill:i[1].color,transform:"translate("+i[1].translateX+" "+i[1].translateY+") rotate("+i[1].rotate+" "+ke/2+" "+ke/2+") scale("+i[2].scale+")"}),l.jsx("path",{filter:`url(#filter_${o})`,style:{mixBlendMode:"overlay"},d:"M22.216 24L0 46.75l14.108 38.129L78 86l-3.081-59.276-22.378 4.005 12.972 20.186-23.35 27.395L22.215 24z",fill:i[2].color,transform:"translate("+i[2].translateX+" "+i[2].translateY+") rotate("+i[2].rotate+" "+ke/2+" "+ke/2+") scale("+i[2].scale+")"})]}),l.jsx("defs",{children:l.jsxs("filter",{id:`filter_${o}`,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[l.jsx("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),l.jsx("feBlend",{in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),l.jsx("feGaussianBlur",{stdDeviation:7,result:"effect1_foregroundBlur"})]})})]})},Xd={pixel:Zd,bauhaus:di,ring:$d,beam:fi,sunset:qd,marble:Uo,geometric:fi,abstract:di},Ho=({variant:t="marble",colors:e=["#92A1C6","#146A7C","#F0AB3D","#C271B4","#C20D90"],name:r="Clara Barton",title:n=!1,size:s="40px",square:a=!1,...i})=>{const o=Xd[t]||Uo;return l.jsx(o,{colors:e,name:r,title:n,size:s,square:a,...i})},qo=["var(--oniratec-brand)","var(--oniratec-fill-primary)","var(--oniratec-label-primary)"],Jd=({personId:t})=>l.jsx(Ho,{size:40,name:t,variant:"beam",colors:qo}),Kd=({userId:t})=>l.jsx(Ho,{size:40,name:t,variant:"bauhaus",colors:qo});function N(...t){return Wo.twMerge(ha.clsx(t))}const Qd=({children:t,className:e})=>l.jsx("div",{className:N("rounded-lg border border-[color:var(--oniratec-border-primary)] bg-[color:var(--oniratec-fill-primary)] p-4 shadow-[var(--oniratec-shadow-card-md)]",e),children:t});function hi(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Yo(...t){return e=>{let r=!1;const n=t.map(s=>{const a=hi(s,e);return!r&&typeof a=="function"&&(r=!0),a});if(r)return()=>{for(let s=0;s<n.length;s++){const a=n[s];typeof a=="function"?a():hi(t[s],null)}}}}function $e(...t){return h.useCallback(Yo(...t),t)}function Zn(t){const e=ef(t),r=h.forwardRef((n,s)=>{const{children:a,...i}=n,o=h.Children.toArray(a),c=o.find(rf);if(c){const u=c.props.children,f=o.map(d=>d===c?h.Children.count(u)>1?h.Children.only(null):h.isValidElement(u)?u.props.children:null:d);return l.jsx(e,{...i,ref:s,children:h.isValidElement(u)?h.cloneElement(u,void 0,f):null})}return l.jsx(e,{...i,ref:s,children:a})});return r.displayName=`${t}.Slot`,r}var Go=Zn("Slot");function ef(t){const e=h.forwardRef((r,n)=>{const{children:s,...a}=r;if(h.isValidElement(s)){const i=sf(s),o=nf(a,s.props);return s.type!==h.Fragment&&(o.ref=n?Yo(n,i):i),h.cloneElement(s,o)}return h.Children.count(s)>1?h.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var tf=Symbol("radix.slottable");function rf(t){return h.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===tf}function nf(t,e){const r={...e};for(const n in e){const s=t[n],a=e[n];/^on[A-Z]/.test(n)?s&&a?r[n]=(...o)=>{const c=a(...o);return s(...o),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...a}:n==="className"&&(r[n]=[s,a].filter(Boolean).join(" "))}return{...t,...r}}function sf(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}const mi=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,pi=ha.clsx,Bn=(t,e)=>r=>{var n;if(e?.variants==null)return pi(t,r?.class,r?.className);const{variants:s,defaultVariants:a}=e,i=Object.keys(s).map(u=>{const f=r?.[u],d=a?.[u];if(f===null)return null;const m=mi(f)||mi(d);return s[u][m]}),o=r&&Object.entries(r).reduce((u,f)=>{let[d,m]=f;return m===void 0||(u[d]=m),u},{}),c=e==null||(n=e.compoundVariants)===null||n===void 0?void 0:n.reduce((u,f)=>{let{class:d,className:m,...p}=f;return Object.entries(p).every(y=>{let[g,x]=y;return Array.isArray(x)?x.includes({...a,...o}[g]):{...a,...o}[g]===x})?[...u,d,m]:u},[]);return pi(t,i,c,r?.class,r?.className)},Xo=Bn("inline-flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap rounded-lg border border-transparent text-sm font-medium transition-[background-color,border-color,color,transform,box-shadow] outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",primary:"bg-primary text-primary-foreground hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted dark:border-input dark:bg-input/30 dark:hover:bg-input/50",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted dark:hover:bg-muted/60",link:"h-auto rounded-none border-transparent px-0 py-0 text-primary underline-offset-4 hover:underline focus-visible:border-transparent focus-visible:ring-0"},size:{xs:"h-6 rounded-md px-2 text-xs [&_svg]:size-3",sm:"h-7 rounded-md px-2.5 text-[0.8rem] [&_svg]:size-3.5",md:"h-8 px-2.5",lg:"h-9 px-3 text-sm",icon:"h-8 w-8","icon-sm":"h-7 w-7 rounded-md","icon-lg":"h-9 w-9"}},defaultVariants:{variant:"default",size:"md"}}),Le=h.forwardRef(({className:t,asChild:e=!1,variant:r="default",size:n="md",loading:s=!1,disabled:a,children:i,...o},c)=>{const u=e?Go:"button";return l.jsxs(u,{ref:c,"data-size":n??void 0,"data-variant":r??void 0,className:N(Xo({variant:r,size:n}),t),disabled:a||s,...o,children:[s&&l.jsx(J.Loader2,{className:"h-4 w-4 animate-spin"}),i]})});Le.displayName="Button";const af=({src:t,alt:e,width:r=70,height:n=70,className:s,ImageComponent:a,...i})=>{const o=a??"img";return l.jsx(o,{type:void 0,props:void 0,src:t,alt:e,width:r,height:n,className:N("inline-block object-contain",s),...i},null)},zs=({children:t,className:e,size:r="default"})=>l.jsx("div",{className:N("flex flex-col overflow-hidden rounded-xl border border-border bg-card text-card-foreground shadow-card-sm transition-[box-shadow,transform]",r==="sm"?"gap-3 py-3":"gap-4 py-4","hover:shadow-card-md",e),children:t}),Jo=({children:t,className:e})=>l.jsx("div",{className:N("grid gap-1 px-4",e),children:t}),Ko=({children:t,className:e})=>l.jsx("h3",{className:N("text-base font-medium leading-snug text-card-foreground",e),children:t}),of=({children:t,className:e})=>l.jsx("p",{className:N("text-sm text-muted-foreground",e),children:t}),Qo=({children:t,className:e})=>l.jsx("div",{className:N("px-4",e),children:t}),lf=({children:t,className:e})=>l.jsx("div",{className:N("ml-auto flex items-center gap-2",e),children:t}),cf=({children:t,className:e})=>l.jsx("div",{className:N("flex items-center gap-2 border-t bg-muted/50 p-4",e),children:t}),el=Bn("relative grid w-full grid-cols-[auto_1fr] items-start gap-3 rounded-xl bg-card p-4 text-sm text-card-foreground ring-1 ring-foreground/10",{variants:{variant:{info:"[&_svg]:text-muted-foreground",success:"bg-primary/5 ring-primary/15 [&_svg]:text-primary dark:bg-primary/10",warning:"bg-amber-500/10 ring-amber-500/20 [&_svg]:text-amber-600 dark:bg-amber-500/15 dark:[&_svg]:text-amber-400",error:"bg-destructive/10 ring-destructive/20 [&_svg]:text-destructive dark:bg-destructive/15"}},defaultVariants:{variant:"info"}}),uf={error:J.AlertCircle,warning:J.AlertTriangle,info:J.Info,success:J.CheckCircle},tl=h.forwardRef(({className:t,variant:e="info",children:r,...n},s)=>{const a=uf[e];return l.jsxs("div",{ref:s,role:"alert",className:N(el({variant:e}),t),...n,children:[a&&l.jsx(a,{className:"mt-0.5 h-4 w-4 shrink-0","aria-hidden":"true"}),l.jsx("div",{className:"flex-1",children:r})]})});tl.displayName="Alert";const rl=h.forwardRef(({className:t,...e},r)=>l.jsx("h5",{ref:r,className:N("mb-1 font-medium leading-none tracking-tight",t),...e}));rl.displayName="AlertTitle";const nl=h.forwardRef(({className:t,...e},r)=>l.jsx("div",{ref:r,className:N("text-sm text-muted-foreground [&_p]:leading-relaxed",t),...e}));nl.displayName="AlertDescription";const sl=Bn("inline-flex items-center rounded-md border font-medium transition-colors focus:outline-none focus-visible:ring-3 focus-visible:ring-ring/50",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",success:"border-transparent bg-emerald-500/15 text-emerald-700 dark:text-emerald-400",warning:"border-transparent bg-amber-500/10 text-amber-700 dark:text-amber-300",danger:"border-transparent bg-destructive/10 text-destructive",info:"border-transparent bg-accent text-accent-foreground",outline:"border-border bg-background text-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground"},size:{sm:"px-1.5 py-0.5 text-[11px]",md:"px-2 py-0.5 text-xs"}},defaultVariants:{variant:"default",size:"md"}}),pa=h.forwardRef(({className:t,variant:e="default",size:r="md",...n},s)=>l.jsx("span",{ref:s,className:N(sl({variant:e,size:r}),t),...n}));pa.displayName="Badge";const al=h.forwardRef(({className:t,id:e,label:r,description:n,size:s="md",indeterminate:a=!1,disabled:i,"aria-describedby":o,"aria-invalid":c,...u},f)=>{const d=h.useId(),m=e??d,p=n?`${m}-description`:void 0,y=c===!0||c==="true",g=h.useRef(null);h.useEffect(()=>{g.current&&(g.current.indeterminate=a)},[a]);const x=h.useCallback(v=>{g.current=v,typeof f=="function"?f(v):f&&(f.current=v)},[f]);return l.jsxs("label",{htmlFor:m,className:N("inline-flex w-fit items-start gap-2.5 text-sm",i&&"cursor-not-allowed opacity-60",t),children:[l.jsx("input",{ref:x,id:m,type:"checkbox",disabled:i,"aria-invalid":y||void 0,"aria-checked":a?"mixed":void 0,"aria-describedby":[o,p].filter(Boolean).join(" ")||void 0,className:"peer sr-only",...u}),l.jsx("span",{className:N("flex shrink-0 items-center justify-center rounded-[min(var(--radius-md),10px)] border border-input bg-background text-primary-foreground transition-[background-color,border-color,box-shadow,color] outline-none","peer-focus-visible:border-ring peer-focus-visible:ring-3 peer-focus-visible:ring-ring/50","peer-disabled:border-border/50 peer-disabled:bg-muted/50 peer-disabled:opacity-70",!a&&"peer-checked:border-primary peer-checked:bg-primary peer-checked:[&_svg]:opacity-100",a&&"border-primary bg-primary [&_svg]:opacity-100",y&&"border-destructive peer-focus-visible:border-destructive peer-focus-visible:ring-destructive/20",s==="sm"?"h-4 w-4":"h-5 w-5"),children:a?l.jsx(J.Minus,{className:"h-3.5 w-3.5 opacity-0 transition-opacity"}):l.jsx(J.Check,{className:"h-3.5 w-3.5 opacity-0 transition-opacity"})}),(r||n)&&l.jsxs("span",{className:"grid gap-1 leading-tight",children:[r&&l.jsx("span",{className:"font-medium text-foreground",children:r}),n&&l.jsx("span",{id:p,className:"text-sm text-muted-foreground",children:n})]})]})});al.displayName="Checkbox";function Re(t,e,{checkForDefaultPrevented:r=!0}={}){return function(s){if(t?.(s),r===!1||!s.defaultPrevented)return e?.(s)}}function df(t,e){const r=h.createContext(e),n=a=>{const{children:i,...o}=a,c=h.useMemo(()=>o,Object.values(o));return l.jsx(r.Provider,{value:c,children:i})};n.displayName=t+"Provider";function s(a){const i=h.useContext(r);if(i)return i;if(e!==void 0)return e;throw new Error(`\`${a}\` must be used within \`${t}\``)}return[n,s]}function Un(t,e=[]){let r=[];function n(a,i){const o=h.createContext(i),c=r.length;r=[...r,i];const u=d=>{const{scope:m,children:p,...y}=d,g=m?.[t]?.[c]||o,x=h.useMemo(()=>y,Object.values(y));return l.jsx(g.Provider,{value:x,children:p})};u.displayName=a+"Provider";function f(d,m){const p=m?.[t]?.[c]||o,y=h.useContext(p);if(y)return y;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${a}\``)}return[u,f]}const s=()=>{const a=r.map(i=>h.createContext(i));return function(o){const c=o?.[t]||a;return h.useMemo(()=>({[`__scope${t}`]:{...o,[t]:c}}),[o,c])}};return s.scopeName=t,[n,ff(s,...e)]}function ff(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const n=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(a){const i=n.reduce((o,{useScope:c,scopeName:u})=>{const d=c(a)[`__scope${u}`];return{...o,...d}},{});return h.useMemo(()=>({[`__scope${e.scopeName}`]:i}),[i])}};return r.scopeName=e.scopeName,r}var hf=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],_e=hf.reduce((t,e)=>{const r=Zn(`Primitive.${e}`),n=h.forwardRef((s,a)=>{const{asChild:i,...o}=s,c=i?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...o,ref:a})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function mf(t,e){t&&Zo.flushSync(()=>t.dispatchEvent(e))}function hr(t){const e=h.useRef(t);return h.useEffect(()=>{e.current=t}),h.useMemo(()=>(...r)=>e.current?.(...r),[])}function pf(t,e=globalThis?.document){const r=hr(t);h.useEffect(()=>{const n=s=>{s.key==="Escape"&&r(s)};return e.addEventListener("keydown",n,{capture:!0}),()=>e.removeEventListener("keydown",n,{capture:!0})},[r,e])}var gf="DismissableLayer",Ws="dismissableLayer.update",yf="dismissableLayer.pointerDownOutside",vf="dismissableLayer.focusOutside",gi,il=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ga=h.forwardRef((t,e)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:i,onDismiss:o,...c}=t,u=h.useContext(il),[f,d]=h.useState(null),m=f?.ownerDocument??globalThis?.document,[,p]=h.useState({}),y=$e(e,T=>d(T)),g=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(x),S=f?g.indexOf(f):-1,C=u.layersWithOutsidePointerEventsDisabled.size>0,k=S>=v,w=wf(T=>{const A=T.target,$=[...u.branches].some(L=>L.contains(A));!k||$||(s?.(T),i?.(T),T.defaultPrevented||o?.())},m),j=kf(T=>{const A=T.target;[...u.branches].some(L=>L.contains(A))||(a?.(T),i?.(T),T.defaultPrevented||o?.())},m);return pf(T=>{S===u.layers.size-1&&(n?.(T),!T.defaultPrevented&&o&&(T.preventDefault(),o()))},m),h.useEffect(()=>{if(f)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(gi=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),yi(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=gi)}},[f,m,r,u]),h.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),yi())},[f,u]),h.useEffect(()=>{const T=()=>p({});return document.addEventListener(Ws,T),()=>document.removeEventListener(Ws,T)},[]),l.jsx(_e.div,{...c,ref:y,style:{pointerEvents:C?k?"auto":"none":void 0,...t.style},onFocusCapture:Re(t.onFocusCapture,j.onFocusCapture),onBlurCapture:Re(t.onBlurCapture,j.onBlurCapture),onPointerDownCapture:Re(t.onPointerDownCapture,w.onPointerDownCapture)})});ga.displayName=gf;var xf="DismissableLayerBranch",bf=h.forwardRef((t,e)=>{const r=h.useContext(il),n=h.useRef(null),s=$e(e,n);return h.useEffect(()=>{const a=n.current;if(a)return r.branches.add(a),()=>{r.branches.delete(a)}},[r.branches]),l.jsx(_e.div,{...t,ref:s})});bf.displayName=xf;function wf(t,e=globalThis?.document){const r=hr(t),n=h.useRef(!1),s=h.useRef(()=>{});return h.useEffect(()=>{const a=o=>{if(o.target&&!n.current){let c=function(){ol(yf,r,u,{discrete:!0})};const u={originalEvent:o};o.pointerType==="touch"?(e.removeEventListener("click",s.current),s.current=c,e.addEventListener("click",s.current,{once:!0})):c()}else e.removeEventListener("click",s.current);n.current=!1},i=window.setTimeout(()=>{e.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(i),e.removeEventListener("pointerdown",a),e.removeEventListener("click",s.current)}},[e,r]),{onPointerDownCapture:()=>n.current=!0}}function kf(t,e=globalThis?.document){const r=hr(t),n=h.useRef(!1);return h.useEffect(()=>{const s=a=>{a.target&&!n.current&&ol(vf,r,{originalEvent:a},{discrete:!1})};return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function yi(){const t=new CustomEvent(Ws);document.dispatchEvent(t)}function ol(t,e,r,{discrete:n}){const s=r.originalEvent.target,a=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&s.addEventListener(t,e,{once:!0}),n?mf(s,a):s.dispatchEvent(a)}var vs=0;function ll(){h.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??vi()),document.body.insertAdjacentElement("beforeend",t[1]??vi()),vs++,()=>{vs===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),vs--}},[])}function vi(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var xs="focusScope.autoFocusOnMount",bs="focusScope.autoFocusOnUnmount",xi={bubbles:!1,cancelable:!0},Sf="FocusScope",ya=h.forwardRef((t,e)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...i}=t,[o,c]=h.useState(null),u=hr(s),f=hr(a),d=h.useRef(null),m=$e(e,g=>c(g)),p=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(n){let g=function(C){if(p.paused||!o)return;const k=C.target;o.contains(k)?d.current=k:kt(d.current,{select:!0})},x=function(C){if(p.paused||!o)return;const k=C.relatedTarget;k!==null&&(o.contains(k)||kt(d.current,{select:!0}))},v=function(C){if(document.activeElement===document.body)for(const w of C)w.removedNodes.length>0&&kt(o)};document.addEventListener("focusin",g),document.addEventListener("focusout",x);const S=new MutationObserver(v);return o&&S.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",x),S.disconnect()}}},[n,o,p.paused]),h.useEffect(()=>{if(o){wi.add(p);const g=document.activeElement;if(!o.contains(g)){const v=new CustomEvent(xs,xi);o.addEventListener(xs,u),o.dispatchEvent(v),v.defaultPrevented||(Nf(Ef(cl(o)),{select:!0}),document.activeElement===g&&kt(o))}return()=>{o.removeEventListener(xs,u),setTimeout(()=>{const v=new CustomEvent(bs,xi);o.addEventListener(bs,f),o.dispatchEvent(v),v.defaultPrevented||kt(g??document.body,{select:!0}),o.removeEventListener(bs,f),wi.remove(p)},0)}}},[o,u,f,p]);const y=h.useCallback(g=>{if(!r&&!n||p.paused)return;const x=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,v=document.activeElement;if(x&&v){const S=g.currentTarget,[C,k]=Cf(S);C&&k?!g.shiftKey&&v===k?(g.preventDefault(),r&&kt(C,{select:!0})):g.shiftKey&&v===C&&(g.preventDefault(),r&&kt(k,{select:!0})):v===S&&g.preventDefault()}},[r,n,p.paused]);return l.jsx(_e.div,{tabIndex:-1,...i,ref:m,onKeyDown:y})});ya.displayName=Sf;function Nf(t,{select:e=!1}={}){const r=document.activeElement;for(const n of t)if(kt(n,{select:e}),document.activeElement!==r)return}function Cf(t){const e=cl(t),r=bi(e,t),n=bi(e.reverse(),t);return[r,n]}function cl(t){const e=[],r=document.createTreeWalker(t,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();)e.push(r.currentNode);return e}function bi(t,e){for(const r of t)if(!_f(r,{upTo:e}))return r}function _f(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function Tf(t){return t instanceof HTMLInputElement&&"select"in t}function kt(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&Tf(t)&&e&&t.select()}}var wi=jf();function jf(){let t=[];return{add(e){const r=t[0];e!==r&&r?.pause(),t=ki(t,e),t.unshift(e)},remove(e){t=ki(t,e),t[0]?.resume()}}}function ki(t,e){const r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}function Ef(t){return t.filter(e=>e.tagName!=="A")}var jt=globalThis?.document?h.useLayoutEffect:()=>{},Of=h[" useId ".trim().toString()]||(()=>{}),Df=0;function xn(t){const[e,r]=h.useState(Of());return jt(()=>{r(n=>n??String(Df++))},[t]),t||(e?`radix-${e}`:"")}const Rf=["top","right","bottom","left"],Et=Math.min,Ie=Math.max,Tn=Math.round,an=Math.floor,lt=t=>({x:t,y:t}),Af={left:"right",right:"left",bottom:"top",top:"bottom"},Mf={start:"end",end:"start"};function Zs(t,e,r){return Ie(t,Et(e,r))}function pt(t,e){return typeof t=="function"?t(e):t}function gt(t){return t.split("-")[0]}function kr(t){return t.split("-")[1]}function va(t){return t==="x"?"y":"x"}function xa(t){return t==="y"?"height":"width"}const If=new Set(["top","bottom"]);function ot(t){return If.has(gt(t))?"y":"x"}function ba(t){return va(ot(t))}function Pf(t,e,r){r===void 0&&(r=!1);const n=kr(t),s=ba(t),a=xa(s);let i=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[a]>e.floating[a]&&(i=jn(i)),[i,jn(i)]}function Ff(t){const e=jn(t);return[Bs(t),e,Bs(e)]}function Bs(t){return t.replace(/start|end/g,e=>Mf[e])}const Si=["left","right"],Ni=["right","left"],Lf=["top","bottom"],Vf=["bottom","top"];function $f(t,e,r){switch(t){case"top":case"bottom":return r?e?Ni:Si:e?Si:Ni;case"left":case"right":return e?Lf:Vf;default:return[]}}function zf(t,e,r,n){const s=kr(t);let a=$f(gt(t),r==="start",n);return s&&(a=a.map(i=>i+"-"+s),e&&(a=a.concat(a.map(Bs)))),a}function jn(t){return t.replace(/left|right|bottom|top/g,e=>Af[e])}function Wf(t){return{top:0,right:0,bottom:0,left:0,...t}}function ul(t){return typeof t!="number"?Wf(t):{top:t,right:t,bottom:t,left:t}}function En(t){const{x:e,y:r,width:n,height:s}=t;return{width:n,height:s,top:r,left:e,right:e+n,bottom:r+s,x:e,y:r}}function Ci(t,e,r){let{reference:n,floating:s}=t;const a=ot(e),i=ba(e),o=xa(i),c=gt(e),u=a==="y",f=n.x+n.width/2-s.width/2,d=n.y+n.height/2-s.height/2,m=n[o]/2-s[o]/2;let p;switch(c){case"top":p={x:f,y:n.y-s.height};break;case"bottom":p={x:f,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:d};break;case"left":p={x:n.x-s.width,y:d};break;default:p={x:n.x,y:n.y}}switch(kr(e)){case"start":p[i]-=m*(r&&u?-1:1);break;case"end":p[i]+=m*(r&&u?-1:1);break}return p}const Zf=async(t,e,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:a=[],platform:i}=r,o=a.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(e));let u=await i.getElementRects({reference:t,floating:e,strategy:s}),{x:f,y:d}=Ci(u,n,c),m=n,p={},y=0;for(let g=0;g<o.length;g++){const{name:x,fn:v}=o[g],{x:S,y:C,data:k,reset:w}=await v({x:f,y:d,initialPlacement:n,placement:m,strategy:s,middlewareData:p,rects:u,platform:i,elements:{reference:t,floating:e}});f=S??f,d=C??d,p={...p,[x]:{...p[x],...k}},w&&y<=50&&(y++,typeof w=="object"&&(w.placement&&(m=w.placement),w.rects&&(u=w.rects===!0?await i.getElementRects({reference:t,floating:e,strategy:s}):w.rects),{x:f,y:d}=Ci(u,m,c)),g=-1)}return{x:f,y:d,placement:m,strategy:s,middlewareData:p}};async function Fr(t,e){var r;e===void 0&&(e={});const{x:n,y:s,platform:a,rects:i,elements:o,strategy:c}=t,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:m=!1,padding:p=0}=pt(e,t),y=ul(p),x=o[m?d==="floating"?"reference":"floating":d],v=En(await a.getClippingRect({element:(r=await(a.isElement==null?void 0:a.isElement(x)))==null||r?x:x.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(o.floating)),boundary:u,rootBoundary:f,strategy:c})),S=d==="floating"?{x:n,y:s,width:i.floating.width,height:i.floating.height}:i.reference,C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(o.floating)),k=await(a.isElement==null?void 0:a.isElement(C))?await(a.getScale==null?void 0:a.getScale(C))||{x:1,y:1}:{x:1,y:1},w=En(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:S,offsetParent:C,strategy:c}):S);return{top:(v.top-w.top+y.top)/k.y,bottom:(w.bottom-v.bottom+y.bottom)/k.y,left:(v.left-w.left+y.left)/k.x,right:(w.right-v.right+y.right)/k.x}}const Bf=t=>({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:s,rects:a,platform:i,elements:o,middlewareData:c}=e,{element:u,padding:f=0}=pt(t,e)||{};if(u==null)return{};const d=ul(f),m={x:r,y:n},p=ba(s),y=xa(p),g=await i.getDimensions(u),x=p==="y",v=x?"top":"left",S=x?"bottom":"right",C=x?"clientHeight":"clientWidth",k=a.reference[y]+a.reference[p]-m[p]-a.floating[y],w=m[p]-a.reference[p],j=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let T=j?j[C]:0;(!T||!await(i.isElement==null?void 0:i.isElement(j)))&&(T=o.floating[C]||a.floating[y]);const A=k/2-w/2,$=T/2-g[y]/2-1,L=Et(d[v],$),W=Et(d[S],$),B=L,G=T-g[y]-W,Q=T/2-g[y]/2+A,H=Zs(B,Q,G),P=!c.arrow&&kr(s)!=null&&Q!==H&&a.reference[y]/2-(Q<B?L:W)-g[y]/2<0,U=P?Q<B?Q-B:Q-G:0;return{[p]:m[p]+U,data:{[p]:H,centerOffset:Q-H-U,...P&&{alignmentOffset:U}},reset:P}}}),Uf=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var r,n;const{placement:s,middlewareData:a,rects:i,initialPlacement:o,platform:c,elements:u}=e,{mainAxis:f=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:g=!0,...x}=pt(t,e);if((r=a.arrow)!=null&&r.alignmentOffset)return{};const v=gt(s),S=ot(o),C=gt(o)===o,k=await(c.isRTL==null?void 0:c.isRTL(u.floating)),w=m||(C||!g?[jn(o)]:Ff(o)),j=y!=="none";!m&&j&&w.push(...zf(o,g,y,k));const T=[o,...w],A=await Fr(e,x),$=[];let L=((n=a.flip)==null?void 0:n.overflows)||[];if(f&&$.push(A[v]),d){const Q=Pf(s,i,k);$.push(A[Q[0]],A[Q[1]])}if(L=[...L,{placement:s,overflows:$}],!$.every(Q=>Q<=0)){var W,B;const Q=(((W=a.flip)==null?void 0:W.index)||0)+1,H=T[Q];if(H&&(!(d==="alignment"?S!==ot(H):!1)||L.every(V=>ot(V.placement)===S?V.overflows[0]>0:!0)))return{data:{index:Q,overflows:L},reset:{placement:H}};let P=(B=L.filter(U=>U.overflows[0]<=0).sort((U,V)=>U.overflows[1]-V.overflows[1])[0])==null?void 0:B.placement;if(!P)switch(p){case"bestFit":{var G;const U=(G=L.filter(V=>{if(j){const ie=ot(V.placement);return ie===S||ie==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(ie=>ie>0).reduce((ie,F)=>ie+F,0)]).sort((V,ie)=>V[1]-ie[1])[0])==null?void 0:G[0];U&&(P=U);break}case"initialPlacement":P=o;break}if(s!==P)return{reset:{placement:P}}}return{}}}};function _i(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Ti(t){return Rf.some(e=>t[e]>=0)}const Hf=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r}=e,{strategy:n="referenceHidden",...s}=pt(t,e);switch(n){case"referenceHidden":{const a=await Fr(e,{...s,elementContext:"reference"}),i=_i(a,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Ti(i)}}}case"escaped":{const a=await Fr(e,{...s,altBoundary:!0}),i=_i(a,r.floating);return{data:{escapedOffsets:i,escaped:Ti(i)}}}default:return{}}}}},dl=new Set(["left","top"]);async function qf(t,e){const{placement:r,platform:n,elements:s}=t,a=await(n.isRTL==null?void 0:n.isRTL(s.floating)),i=gt(r),o=kr(r),c=ot(r)==="y",u=dl.has(i)?-1:1,f=a&&c?-1:1,d=pt(e,t);let{mainAxis:m,crossAxis:p,alignmentAxis:y}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return o&&typeof y=="number"&&(p=o==="end"?y*-1:y),c?{x:p*f,y:m*u}:{x:m*u,y:p*f}}const Yf=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,n;const{x:s,y:a,placement:i,middlewareData:o}=e,c=await qf(e,t);return i===((r=o.offset)==null?void 0:r.placement)&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:s+c.x,y:a+c.y,data:{...c,placement:i}}}}},Gf=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:s}=e,{mainAxis:a=!0,crossAxis:i=!1,limiter:o={fn:x=>{let{x:v,y:S}=x;return{x:v,y:S}}},...c}=pt(t,e),u={x:r,y:n},f=await Fr(e,c),d=ot(gt(s)),m=va(d);let p=u[m],y=u[d];if(a){const x=m==="y"?"top":"left",v=m==="y"?"bottom":"right",S=p+f[x],C=p-f[v];p=Zs(S,p,C)}if(i){const x=d==="y"?"top":"left",v=d==="y"?"bottom":"right",S=y+f[x],C=y-f[v];y=Zs(S,y,C)}const g=o.fn({...e,[m]:p,[d]:y});return{...g,data:{x:g.x-r,y:g.y-n,enabled:{[m]:a,[d]:i}}}}}},Xf=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:n,placement:s,rects:a,middlewareData:i}=e,{offset:o=0,mainAxis:c=!0,crossAxis:u=!0}=pt(t,e),f={x:r,y:n},d=ot(s),m=va(d);let p=f[m],y=f[d];const g=pt(o,e),x=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const C=m==="y"?"height":"width",k=a.reference[m]-a.floating[C]+x.mainAxis,w=a.reference[m]+a.reference[C]-x.mainAxis;p<k?p=k:p>w&&(p=w)}if(u){var v,S;const C=m==="y"?"width":"height",k=dl.has(gt(s)),w=a.reference[d]-a.floating[C]+(k&&((v=i.offset)==null?void 0:v[d])||0)+(k?0:x.crossAxis),j=a.reference[d]+a.reference[C]+(k?0:((S=i.offset)==null?void 0:S[d])||0)-(k?x.crossAxis:0);y<w?y=w:y>j&&(y=j)}return{[m]:p,[d]:y}}}},Jf=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var r,n;const{placement:s,rects:a,platform:i,elements:o}=e,{apply:c=()=>{},...u}=pt(t,e),f=await Fr(e,u),d=gt(s),m=kr(s),p=ot(s)==="y",{width:y,height:g}=a.floating;let x,v;d==="top"||d==="bottom"?(x=d,v=m===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(v=d,x=m==="end"?"top":"bottom");const S=g-f.top-f.bottom,C=y-f.left-f.right,k=Et(g-f[x],S),w=Et(y-f[v],C),j=!e.middlewareData.shift;let T=k,A=w;if((r=e.middlewareData.shift)!=null&&r.enabled.x&&(A=C),(n=e.middlewareData.shift)!=null&&n.enabled.y&&(T=S),j&&!m){const L=Ie(f.left,0),W=Ie(f.right,0),B=Ie(f.top,0),G=Ie(f.bottom,0);p?A=y-2*(L!==0||W!==0?L+W:Ie(f.left,f.right)):T=g-2*(B!==0||G!==0?B+G:Ie(f.top,f.bottom))}await c({...e,availableWidth:A,availableHeight:T});const $=await i.getDimensions(o.floating);return y!==$.width||g!==$.height?{reset:{rects:!0}}:{}}}};function Hn(){return typeof window<"u"}function Sr(t){return fl(t)?(t.nodeName||"").toLowerCase():"#document"}function Pe(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ft(t){var e;return(e=(fl(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function fl(t){return Hn()?t instanceof Node||t instanceof Pe(t).Node:!1}function Qe(t){return Hn()?t instanceof Element||t instanceof Pe(t).Element:!1}function ut(t){return Hn()?t instanceof HTMLElement||t instanceof Pe(t).HTMLElement:!1}function ji(t){return!Hn()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Pe(t).ShadowRoot}const Kf=new Set(["inline","contents"]);function Ur(t){const{overflow:e,overflowX:r,overflowY:n,display:s}=et(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!Kf.has(s)}const Qf=new Set(["table","td","th"]);function eh(t){return Qf.has(Sr(t))}const th=[":popover-open",":modal"];function qn(t){return th.some(e=>{try{return t.matches(e)}catch{return!1}})}const rh=["transform","translate","scale","rotate","perspective"],nh=["transform","translate","scale","rotate","perspective","filter"],sh=["paint","layout","strict","content"];function wa(t){const e=ka(),r=Qe(t)?et(t):t;return rh.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||nh.some(n=>(r.willChange||"").includes(n))||sh.some(n=>(r.contain||"").includes(n))}function ah(t){let e=Ot(t);for(;ut(e)&&!mr(e);){if(wa(e))return e;if(qn(e))return null;e=Ot(e)}return null}function ka(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const ih=new Set(["html","body","#document"]);function mr(t){return ih.has(Sr(t))}function et(t){return Pe(t).getComputedStyle(t)}function Yn(t){return Qe(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Ot(t){if(Sr(t)==="html")return t;const e=t.assignedSlot||t.parentNode||ji(t)&&t.host||ft(t);return ji(e)?e.host:e}function hl(t){const e=Ot(t);return mr(e)?t.ownerDocument?t.ownerDocument.body:t.body:ut(e)&&Ur(e)?e:hl(e)}function Lr(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const s=hl(t),a=s===((n=t.ownerDocument)==null?void 0:n.body),i=Pe(s);if(a){const o=Us(i);return e.concat(i,i.visualViewport||[],Ur(s)?s:[],o&&r?Lr(o):[])}return e.concat(s,Lr(s,[],r))}function Us(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function ml(t){const e=et(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const s=ut(t),a=s?t.offsetWidth:r,i=s?t.offsetHeight:n,o=Tn(r)!==a||Tn(n)!==i;return o&&(r=a,n=i),{width:r,height:n,$:o}}function Sa(t){return Qe(t)?t:t.contextElement}function cr(t){const e=Sa(t);if(!ut(e))return lt(1);const r=e.getBoundingClientRect(),{width:n,height:s,$:a}=ml(e);let i=(a?Tn(r.width):r.width)/n,o=(a?Tn(r.height):r.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!o||!Number.isFinite(o))&&(o=1),{x:i,y:o}}const oh=lt(0);function pl(t){const e=Pe(t);return!ka()||!e.visualViewport?oh:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function lh(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==Pe(t)?!1:e}function Zt(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const s=t.getBoundingClientRect(),a=Sa(t);let i=lt(1);e&&(n?Qe(n)&&(i=cr(n)):i=cr(t));const o=lh(a,r,n)?pl(a):lt(0);let c=(s.left+o.x)/i.x,u=(s.top+o.y)/i.y,f=s.width/i.x,d=s.height/i.y;if(a){const m=Pe(a),p=n&&Qe(n)?Pe(n):n;let y=m,g=Us(y);for(;g&&n&&p!==y;){const x=cr(g),v=g.getBoundingClientRect(),S=et(g),C=v.left+(g.clientLeft+parseFloat(S.paddingLeft))*x.x,k=v.top+(g.clientTop+parseFloat(S.paddingTop))*x.y;c*=x.x,u*=x.y,f*=x.x,d*=x.y,c+=C,u+=k,y=Pe(g),g=Us(y)}}return En({width:f,height:d,x:c,y:u})}function Gn(t,e){const r=Yn(t).scrollLeft;return e?e.left+r:Zt(ft(t)).left+r}function gl(t,e){const r=t.getBoundingClientRect(),n=r.left+e.scrollLeft-Gn(t,r),s=r.top+e.scrollTop;return{x:n,y:s}}function ch(t){let{elements:e,rect:r,offsetParent:n,strategy:s}=t;const a=s==="fixed",i=ft(n),o=e?qn(e.floating):!1;if(n===i||o&&a)return r;let c={scrollLeft:0,scrollTop:0},u=lt(1);const f=lt(0),d=ut(n);if((d||!d&&!a)&&((Sr(n)!=="body"||Ur(i))&&(c=Yn(n)),ut(n))){const p=Zt(n);u=cr(n),f.x=p.x+n.clientLeft,f.y=p.y+n.clientTop}const m=i&&!d&&!a?gl(i,c):lt(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-c.scrollLeft*u.x+f.x+m.x,y:r.y*u.y-c.scrollTop*u.y+f.y+m.y}}function uh(t){return Array.from(t.getClientRects())}function dh(t){const e=ft(t),r=Yn(t),n=t.ownerDocument.body,s=Ie(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),a=Ie(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+Gn(t);const o=-r.scrollTop;return et(n).direction==="rtl"&&(i+=Ie(e.clientWidth,n.clientWidth)-s),{width:s,height:a,x:i,y:o}}const Ei=25;function fh(t,e){const r=Pe(t),n=ft(t),s=r.visualViewport;let a=n.clientWidth,i=n.clientHeight,o=0,c=0;if(s){a=s.width,i=s.height;const f=ka();(!f||f&&e==="fixed")&&(o=s.offsetLeft,c=s.offsetTop)}const u=Gn(n);if(u<=0){const f=n.ownerDocument,d=f.body,m=getComputedStyle(d),p=f.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,y=Math.abs(n.clientWidth-d.clientWidth-p);y<=Ei&&(a-=y)}else u<=Ei&&(a+=u);return{width:a,height:i,x:o,y:c}}const hh=new Set(["absolute","fixed"]);function mh(t,e){const r=Zt(t,!0,e==="fixed"),n=r.top+t.clientTop,s=r.left+t.clientLeft,a=ut(t)?cr(t):lt(1),i=t.clientWidth*a.x,o=t.clientHeight*a.y,c=s*a.x,u=n*a.y;return{width:i,height:o,x:c,y:u}}function Oi(t,e,r){let n;if(e==="viewport")n=fh(t,r);else if(e==="document")n=dh(ft(t));else if(Qe(e))n=mh(e,r);else{const s=pl(t);n={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return En(n)}function yl(t,e){const r=Ot(t);return r===e||!Qe(r)||mr(r)?!1:et(r).position==="fixed"||yl(r,e)}function ph(t,e){const r=e.get(t);if(r)return r;let n=Lr(t,[],!1).filter(o=>Qe(o)&&Sr(o)!=="body"),s=null;const a=et(t).position==="fixed";let i=a?Ot(t):t;for(;Qe(i)&&!mr(i);){const o=et(i),c=wa(i);!c&&o.position==="fixed"&&(s=null),(a?!c&&!s:!c&&o.position==="static"&&!!s&&hh.has(s.position)||Ur(i)&&!c&&yl(t,i))?n=n.filter(f=>f!==i):s=o,i=Ot(i)}return e.set(t,n),n}function gh(t){let{element:e,boundary:r,rootBoundary:n,strategy:s}=t;const i=[...r==="clippingAncestors"?qn(e)?[]:ph(e,this._c):[].concat(r),n],o=i[0],c=i.reduce((u,f)=>{const d=Oi(e,f,s);return u.top=Ie(d.top,u.top),u.right=Et(d.right,u.right),u.bottom=Et(d.bottom,u.bottom),u.left=Ie(d.left,u.left),u},Oi(e,o,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function yh(t){const{width:e,height:r}=ml(t);return{width:e,height:r}}function vh(t,e,r){const n=ut(e),s=ft(e),a=r==="fixed",i=Zt(t,!0,a,e);let o={scrollLeft:0,scrollTop:0};const c=lt(0);function u(){c.x=Gn(s)}if(n||!n&&!a)if((Sr(e)!=="body"||Ur(s))&&(o=Yn(e)),n){const p=Zt(e,!0,a,e);c.x=p.x+e.clientLeft,c.y=p.y+e.clientTop}else s&&u();a&&!n&&s&&u();const f=s&&!n&&!a?gl(s,o):lt(0),d=i.left+o.scrollLeft-c.x-f.x,m=i.top+o.scrollTop-c.y-f.y;return{x:d,y:m,width:i.width,height:i.height}}function ws(t){return et(t).position==="static"}function Di(t,e){if(!ut(t)||et(t).position==="fixed")return null;if(e)return e(t);let r=t.offsetParent;return ft(t)===r&&(r=r.ownerDocument.body),r}function vl(t,e){const r=Pe(t);if(qn(t))return r;if(!ut(t)){let s=Ot(t);for(;s&&!mr(s);){if(Qe(s)&&!ws(s))return s;s=Ot(s)}return r}let n=Di(t,e);for(;n&&eh(n)&&ws(n);)n=Di(n,e);return n&&mr(n)&&ws(n)&&!wa(n)?r:n||ah(t)||r}const xh=async function(t){const e=this.getOffsetParent||vl,r=this.getDimensions,n=await r(t.floating);return{reference:vh(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function bh(t){return et(t).direction==="rtl"}const wh={convertOffsetParentRelativeRectToViewportRelativeRect:ch,getDocumentElement:ft,getClippingRect:gh,getOffsetParent:vl,getElementRects:xh,getClientRects:uh,getDimensions:yh,getScale:cr,isElement:Qe,isRTL:bh};function xl(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function kh(t,e){let r=null,n;const s=ft(t);function a(){var o;clearTimeout(n),(o=r)==null||o.disconnect(),r=null}function i(o,c){o===void 0&&(o=!1),c===void 0&&(c=1),a();const u=t.getBoundingClientRect(),{left:f,top:d,width:m,height:p}=u;if(o||e(),!m||!p)return;const y=an(d),g=an(s.clientWidth-(f+m)),x=an(s.clientHeight-(d+p)),v=an(f),C={rootMargin:-y+"px "+-g+"px "+-x+"px "+-v+"px",threshold:Ie(0,Et(1,c))||1};let k=!0;function w(j){const T=j[0].intersectionRatio;if(T!==c){if(!k)return i();T?i(!1,T):n=setTimeout(()=>{i(!1,1e-7)},1e3)}T===1&&!xl(u,t.getBoundingClientRect())&&i(),k=!1}try{r=new IntersectionObserver(w,{...C,root:s.ownerDocument})}catch{r=new IntersectionObserver(w,C)}r.observe(t)}return i(!0),a}function Sh(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,u=Sa(t),f=s||a?[...u?Lr(u):[],...Lr(e)]:[];f.forEach(v=>{s&&v.addEventListener("scroll",r,{passive:!0}),a&&v.addEventListener("resize",r)});const d=u&&o?kh(u,r):null;let m=-1,p=null;i&&(p=new ResizeObserver(v=>{let[S]=v;S&&S.target===u&&p&&(p.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var C;(C=p)==null||C.observe(e)})),r()}),u&&!c&&p.observe(u),p.observe(e));let y,g=c?Zt(t):null;c&&x();function x(){const v=Zt(t);g&&!xl(g,v)&&r(),g=v,y=requestAnimationFrame(x)}return r(),()=>{var v;f.forEach(S=>{s&&S.removeEventListener("scroll",r),a&&S.removeEventListener("resize",r)}),d?.(),(v=p)==null||v.disconnect(),p=null,c&&cancelAnimationFrame(y)}}const Nh=Yf,Ch=Gf,_h=Uf,Th=Jf,jh=Hf,Ri=Bf,Eh=Xf,Oh=(t,e,r)=>{const n=new Map,s={platform:wh,...r},a={...s.platform,_c:n};return Zf(t,e,{...s,platform:a})};var Dh=typeof document<"u",Rh=function(){},bn=Dh?b.useLayoutEffect:Rh;function On(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,n,s;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!==e.length)return!1;for(n=r;n--!==0;)if(!On(t[n],e[n]))return!1;return!0}if(s=Object.keys(t),r=s.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(e,s[n]))return!1;for(n=r;n--!==0;){const a=s[n];if(!(a==="_owner"&&t.$$typeof)&&!On(t[a],e[a]))return!1}return!0}return t!==t&&e!==e}function bl(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Ai(t,e){const r=bl(t);return Math.round(e*r)/r}function ks(t){const e=h.useRef(t);return bn(()=>{e.current=t}),e}function Ah(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:a,floating:i}={},transform:o=!0,whileElementsMounted:c,open:u}=t,[f,d]=h.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[m,p]=h.useState(n);On(m,n)||p(n);const[y,g]=h.useState(null),[x,v]=h.useState(null),S=h.useCallback(V=>{V!==j.current&&(j.current=V,g(V))},[]),C=h.useCallback(V=>{V!==T.current&&(T.current=V,v(V))},[]),k=a||y,w=i||x,j=h.useRef(null),T=h.useRef(null),A=h.useRef(f),$=c!=null,L=ks(c),W=ks(s),B=ks(u),G=h.useCallback(()=>{if(!j.current||!T.current)return;const V={placement:e,strategy:r,middleware:m};W.current&&(V.platform=W.current),Oh(j.current,T.current,V).then(ie=>{const F={...ie,isPositioned:B.current!==!1};Q.current&&!On(A.current,F)&&(A.current=F,Zo.flushSync(()=>{d(F)}))})},[m,e,r,W,B]);bn(()=>{u===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,d(V=>({...V,isPositioned:!1})))},[u]);const Q=h.useRef(!1);bn(()=>(Q.current=!0,()=>{Q.current=!1}),[]),bn(()=>{if(k&&(j.current=k),w&&(T.current=w),k&&w){if(L.current)return L.current(k,w,G);G()}},[k,w,G,L,$]);const H=h.useMemo(()=>({reference:j,floating:T,setReference:S,setFloating:C}),[S,C]),P=h.useMemo(()=>({reference:k,floating:w}),[k,w]),U=h.useMemo(()=>{const V={position:r,left:0,top:0};if(!P.floating)return V;const ie=Ai(P.floating,f.x),F=Ai(P.floating,f.y);return o?{...V,transform:"translate("+ie+"px, "+F+"px)",...bl(P.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:ie,top:F}},[r,o,P.floating,f.x,f.y]);return h.useMemo(()=>({...f,update:G,refs:H,elements:P,floatingStyles:U}),[f,G,H,P,U])}const Mh=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:n,padding:s}=typeof t=="function"?t(r):t;return n&&e(n)?n.current!=null?Ri({element:n.current,padding:s}).fn(r):{}:n?Ri({element:n,padding:s}).fn(r):{}}}},Ih=(t,e)=>({...Nh(t),options:[t,e]}),Ph=(t,e)=>({...Ch(t),options:[t,e]}),Fh=(t,e)=>({...Eh(t),options:[t,e]}),Lh=(t,e)=>({..._h(t),options:[t,e]}),Vh=(t,e)=>({...Th(t),options:[t,e]}),$h=(t,e)=>({...jh(t),options:[t,e]}),zh=(t,e)=>({...Mh(t),options:[t,e]});var Wh="Arrow",wl=h.forwardRef((t,e)=>{const{children:r,width:n=10,height:s=5,...a}=t;return l.jsx(_e.svg,{...a,ref:e,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});wl.displayName=Wh;var Zh=wl;function kl(t){const[e,r]=h.useState(void 0);return jt(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const n=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const a=s[0];let i,o;if("borderBoxSize"in a){const c=a.borderBoxSize,u=Array.isArray(c)?c[0]:c;i=u.inlineSize,o=u.blockSize}else i=t.offsetWidth,o=t.offsetHeight;r({width:i,height:o})});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0)},[t]),e}var Na="Popper",[Sl,Nl]=Un(Na),[Bh,Cl]=Sl(Na),_l=t=>{const{__scopePopper:e,children:r}=t,[n,s]=h.useState(null);return l.jsx(Bh,{scope:e,anchor:n,onAnchorChange:s,children:r})};_l.displayName=Na;var Tl="PopperAnchor",jl=h.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:n,...s}=t,a=Cl(Tl,r),i=h.useRef(null),o=$e(e,i),c=h.useRef(null);return h.useEffect(()=>{const u=c.current;c.current=n?.current||i.current,u!==c.current&&a.onAnchorChange(c.current)}),n?null:l.jsx(_e.div,{...s,ref:o})});jl.displayName=Tl;var Ca="PopperContent",[Uh,Hh]=Sl(Ca),El=h.forwardRef((t,e)=>{const{__scopePopper:r,side:n="bottom",sideOffset:s=0,align:a="center",alignOffset:i=0,arrowPadding:o=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:d="partial",hideWhenDetached:m=!1,updatePositionStrategy:p="optimized",onPlaced:y,...g}=t,x=Cl(Ca,r),[v,S]=h.useState(null),C=$e(e,Te=>S(Te)),[k,w]=h.useState(null),j=kl(k),T=j?.width??0,A=j?.height??0,$=n+(a!=="center"?"-"+a:""),L=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},W=Array.isArray(u)?u:[u],B=W.length>0,G={padding:L,boundary:W.filter(Yh),altBoundary:B},{refs:Q,floatingStyles:H,placement:P,isPositioned:U,middlewareData:V}=Ah({strategy:"fixed",placement:$,whileElementsMounted:(...Te)=>Sh(...Te,{animationFrame:p==="always"}),elements:{reference:x.anchor},middleware:[Ih({mainAxis:s+A,alignmentAxis:i}),c&&Ph({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?Fh():void 0,...G}),c&&Lh({...G}),Vh({...G,apply:({elements:Te,rects:le,availableWidth:vt,availableHeight:Yt})=>{const{width:Gt,height:xt}=le.reference,Xt=Te.floating.style;Xt.setProperty("--radix-popper-available-width",`${vt}px`),Xt.setProperty("--radix-popper-available-height",`${Yt}px`),Xt.setProperty("--radix-popper-anchor-width",`${Gt}px`),Xt.setProperty("--radix-popper-anchor-height",`${xt}px`)}}),k&&zh({element:k,padding:o}),Gh({arrowWidth:T,arrowHeight:A}),m&&$h({strategy:"referenceHidden",...G})]}),[ie,F]=Rl(P),D=hr(y);jt(()=>{U&&D?.()},[U,D]);const ee=V.arrow?.x,z=V.arrow?.y,oe=V.arrow?.centerOffset!==0,[ce,ve]=h.useState();return jt(()=>{v&&ve(window.getComputedStyle(v).zIndex)},[v]),l.jsx("div",{ref:Q.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:U?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ce,"--radix-popper-transform-origin":[V.transformOrigin?.x,V.transformOrigin?.y].join(" "),...V.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:l.jsx(Uh,{scope:r,placedSide:ie,onArrowChange:w,arrowX:ee,arrowY:z,shouldHideArrow:oe,children:l.jsx(_e.div,{"data-side":ie,"data-align":F,...g,ref:C,style:{...g.style,animation:U?void 0:"none"}})})})});El.displayName=Ca;var Ol="PopperArrow",qh={top:"bottom",right:"left",bottom:"top",left:"right"},Dl=h.forwardRef(function(e,r){const{__scopePopper:n,...s}=e,a=Hh(Ol,n),i=qh[a.placedSide];return l.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:l.jsx(Zh,{...s,ref:r,style:{...s.style,display:"block"}})})});Dl.displayName=Ol;function Yh(t){return t!==null}var Gh=t=>({name:"transformOrigin",options:t,fn(e){const{placement:r,rects:n,middlewareData:s}=e,i=s.arrow?.centerOffset!==0,o=i?0:t.arrowWidth,c=i?0:t.arrowHeight,[u,f]=Rl(r),d={start:"0%",center:"50%",end:"100%"}[f],m=(s.arrow?.x??0)+o/2,p=(s.arrow?.y??0)+c/2;let y="",g="";return u==="bottom"?(y=i?d:`${m}px`,g=`${-c}px`):u==="top"?(y=i?d:`${m}px`,g=`${n.floating.height+c}px`):u==="right"?(y=`${-c}px`,g=i?d:`${p}px`):u==="left"&&(y=`${n.floating.width+c}px`,g=i?d:`${p}px`),{data:{x:y,y:g}}}});function Rl(t){const[e,r="center"]=t.split("-");return[e,r]}var Xh=_l,Al=jl,Jh=El,Kh=Dl,Qh="Portal",_a=h.forwardRef((t,e)=>{const{container:r,...n}=t,[s,a]=h.useState(!1);jt(()=>a(!0),[]);const i=r||s&&globalThis?.document?.body;return i?ma.createPortal(l.jsx(_e.div,{...n,ref:e}),i):null});_a.displayName=Qh;function em(t,e){return h.useReducer((r,n)=>e[r][n]??r,t)}var Nr=t=>{const{present:e,children:r}=t,n=tm(e),s=typeof r=="function"?r({present:n.isPresent}):h.Children.only(r),a=$e(n.ref,rm(s));return typeof r=="function"||n.isPresent?h.cloneElement(s,{ref:a}):null};Nr.displayName="Presence";function tm(t){const[e,r]=h.useState(),n=h.useRef(null),s=h.useRef(t),a=h.useRef("none"),i=t?"mounted":"unmounted",[o,c]=em(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const u=on(n.current);a.current=o==="mounted"?u:"none"},[o]),jt(()=>{const u=n.current,f=s.current;if(f!==t){const m=a.current,p=on(u);t?c("MOUNT"):p==="none"||u?.display==="none"?c("UNMOUNT"):c(f&&m!==p?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,c]),jt(()=>{if(e){let u;const f=e.ownerDocument.defaultView??window,d=p=>{const g=on(n.current).includes(CSS.escape(p.animationName));if(p.target===e&&g&&(c("ANIMATION_END"),!s.current)){const x=e.style.animationFillMode;e.style.animationFillMode="forwards",u=f.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=x)})}},m=p=>{p.target===e&&(a.current=on(n.current))};return e.addEventListener("animationstart",m),e.addEventListener("animationcancel",d),e.addEventListener("animationend",d),()=>{f.clearTimeout(u),e.removeEventListener("animationstart",m),e.removeEventListener("animationcancel",d),e.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:h.useCallback(u=>{n.current=u?getComputedStyle(u):null,r(u)},[])}}function on(t){return t?.animationName||"none"}function rm(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var nm=h[" useInsertionEffect ".trim().toString()]||jt;function Ta({prop:t,defaultProp:e,onChange:r=()=>{},caller:n}){const[s,a,i]=sm({defaultProp:e,onChange:r}),o=t!==void 0,c=o?t:s;{const f=h.useRef(t!==void 0);h.useEffect(()=>{const d=f.current;d!==o&&console.warn(`${n} is changing from ${d?"controlled":"uncontrolled"} to ${o?"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.`),f.current=o},[o,n])}const u=h.useCallback(f=>{if(o){const d=am(f)?f(t):f;d!==t&&i.current?.(d)}else a(f)},[o,t,a,i]);return[c,u]}function sm({defaultProp:t,onChange:e}){const[r,n]=h.useState(t),s=h.useRef(r),a=h.useRef(e);return nm(()=>{a.current=e},[e]),h.useEffect(()=>{s.current!==r&&(a.current?.(r),s.current=r)},[r,s]),[r,n,a]}function am(t){return typeof t=="function"}var im=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},er=new WeakMap,ln=new WeakMap,cn={},Ss=0,Ml=function(t){return t&&(t.host||Ml(t.parentNode))},om=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=Ml(r);return n&&t.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",t,". Doing nothing"),null)}).filter(function(r){return!!r})},lm=function(t,e,r,n){var s=om(e,Array.isArray(t)?t:[t]);cn[r]||(cn[r]=new WeakMap);var a=cn[r],i=[],o=new Set,c=new Set(s),u=function(d){!d||o.has(d)||(o.add(d),u(d.parentNode))};s.forEach(u);var f=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(m){if(o.has(m))f(m);else try{var p=m.getAttribute(n),y=p!==null&&p!=="false",g=(er.get(m)||0)+1,x=(a.get(m)||0)+1;er.set(m,g),a.set(m,x),i.push(m),g===1&&y&&ln.set(m,!0),x===1&&m.setAttribute(r,"true"),y||m.setAttribute(n,"true")}catch(v){console.error("aria-hidden: cannot operate on ",m,v)}})};return f(e),o.clear(),Ss++,function(){i.forEach(function(d){var m=er.get(d)-1,p=a.get(d)-1;er.set(d,m),a.set(d,p),m||(ln.has(d)||d.removeAttribute(n),ln.delete(d)),p||d.removeAttribute(r)}),Ss--,Ss||(er=new WeakMap,er=new WeakMap,ln=new WeakMap,cn={})}},Il=function(t,e,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),s=im(t);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live], script"))),lm(n,s,r,"aria-hidden")):function(){return null}},it=function(){return it=Object.assign||function(e){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},it.apply(this,arguments)};function Pl(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(r[n[s]]=t[n[s]]);return r}function cm(t,e,r){if(r||arguments.length===2)for(var n=0,s=e.length,a;n<s;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||Array.prototype.slice.call(e))}var wn="right-scroll-bar-position",kn="width-before-scroll-bar",um="with-scroll-bars-hidden",dm="--removed-body-scroll-bar-size";function Ns(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function fm(t,e){var r=b.useState(function(){return{value:t,callback:e,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=e,r.facade}var hm=typeof window<"u"?h.useLayoutEffect:h.useEffect,Mi=new WeakMap;function mm(t,e){var r=fm(null,function(n){return t.forEach(function(s){return Ns(s,n)})});return hm(function(){var n=Mi.get(r);if(n){var s=new Set(n),a=new Set(t),i=r.current;s.forEach(function(o){a.has(o)||Ns(o,null)}),a.forEach(function(o){s.has(o)||Ns(o,i)})}Mi.set(r,t)},[t]),r}function pm(t){return t}function gm(t,e){e===void 0&&(e=pm);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]:t},useMedium:function(a){var i=e(a,n);return r.push(i),function(){r=r.filter(function(o){return o!==i})}},assignSyncMedium:function(a){for(n=!0;r.length;){var i=r;r=[],i.forEach(a)}r={push:function(o){return a(o)},filter:function(){return r}}},assignMedium:function(a){n=!0;var i=[];if(r.length){var o=r;r=[],o.forEach(a),i=r}var c=function(){var f=i;i=[],f.forEach(a)},u=function(){return Promise.resolve().then(c)};u(),r={push:function(f){i.push(f),u()},filter:function(f){return i=i.filter(f),r}}}};return s}function ym(t){t===void 0&&(t={});var e=gm(null);return e.options=it({async:!0,ssr:!1},t),e}var Fl=function(t){var e=t.sideCar,r=Pl(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=e.read();if(!n)throw new Error("Sidecar medium not found");return h.createElement(n,it({},r))};Fl.isSideCarExport=!0;function vm(t,e){return t.useMedium(e),Fl}var Ll=ym(),Cs=function(){},Xn=h.forwardRef(function(t,e){var r=h.useRef(null),n=h.useState({onScrollCapture:Cs,onWheelCapture:Cs,onTouchMoveCapture:Cs}),s=n[0],a=n[1],i=t.forwardProps,o=t.children,c=t.className,u=t.removeScrollBar,f=t.enabled,d=t.shards,m=t.sideCar,p=t.noRelative,y=t.noIsolation,g=t.inert,x=t.allowPinchZoom,v=t.as,S=v===void 0?"div":v,C=t.gapMode,k=Pl(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=m,j=mm([r,e]),T=it(it({},k),s);return h.createElement(h.Fragment,null,f&&h.createElement(w,{sideCar:Ll,removeScrollBar:u,shards:d,noRelative:p,noIsolation:y,inert:g,setCallbacks:a,allowPinchZoom:!!x,lockRef:r,gapMode:C}),i?h.cloneElement(h.Children.only(o),it(it({},T),{ref:j})):h.createElement(S,it({},T,{className:c,ref:j}),o))});Xn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Xn.classNames={fullWidth:kn,zeroRight:wn};var xm=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function bm(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=xm();return e&&t.setAttribute("nonce",e),t}function wm(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function km(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var Sm=function(){var t=0,e=null;return{add:function(r){t==0&&(e=bm())&&(wm(e,r),km(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},Nm=function(){var t=Sm();return function(e,r){h.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&r])}},Vl=function(){var t=Nm(),e=function(r){var n=r.styles,s=r.dynamic;return t(n,s),null};return e},Cm={left:0,top:0,right:0,gap:0},_s=function(t){return parseInt(t||"",10)||0},_m=function(t){var e=window.getComputedStyle(document.body),r=e[t==="padding"?"paddingLeft":"marginLeft"],n=e[t==="padding"?"paddingTop":"marginTop"],s=e[t==="padding"?"paddingRight":"marginRight"];return[_s(r),_s(n),_s(s)]},Tm=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return Cm;var e=_m(t),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,n-r+e[2]-e[0])}},jm=Vl(),ur="data-scroll-locked",Em=function(t,e,r,n){var s=t.left,a=t.top,i=t.right,o=t.gap;return r===void 0&&(r="margin"),`
2
2
  .`.concat(um,` {
3
3
  overflow: hidden `).concat(n,`;
4
4
  padding-right: `).concat(o,"px ").concat(n,`;
@@ -42,5 +42,5 @@
42
42
 
43
43
  If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
44
44
 
45
- For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return h.useEffect(()=>{t&&(document.getElementById(t)||console.error(r))},[r,t]),null},vy="DialogDescriptionWarning",xy=({contentRef:t,descriptionId:e})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${gu(vy).contentName}}.`;return h.useEffect(()=>{const s=t.current?.getAttribute("aria-describedby");e&&s&&(document.getElementById(e)||console.warn(n))},[n,t,e]),null},yu=ru,vu=su,xu=iu,as=ou,is=lu,os=uu,ls=fu,cs=mu;const bu=yu,by=vu,wu=xu,wy=cs,za=h.forwardRef(({className:t,...e},r)=>l.jsx(as,{ref:r,className:N("fixed inset-0 isolate z-50 bg-black/10 backdrop-blur-[2px] transition-opacity duration-100","data-[state=closed]:opacity-0 data-[state=open]:opacity-100",t),...e}));za.displayName=as.displayName;const ky={sm:"sm:max-w-sm",md:"sm:max-w-md",lg:"sm:max-w-lg",xl:"sm:max-w-xl","2xl":"sm:max-w-2xl",full:"sm:max-w-full"},Wa=h.forwardRef(({className:t,children:e,hideClose:r,size:n="md",...s},a)=>l.jsxs(wu,{children:[l.jsx(za,{}),l.jsxs(is,{ref:a,className:N("fixed left-1/2 top-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-background p-4 text-sm","ring-1 ring-foreground/10 shadow-card-lg outline-none transition-[opacity,transform] duration-100",ky[n],"data-[state=closed]:opacity-0 data-[state=closed]:scale-95","data-[state=open]:opacity-100 data-[state=open]:scale-100",t),...s,children:[e,!r&&l.jsx(cs,{asChild:!0,children:l.jsxs(Le,{variant:"ghost",size:"icon-sm",className:"absolute right-2 top-2","aria-label":"Cerrar",children:[l.jsx(J.X,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Cerrar"})]})})]})]}));Wa.displayName=is.displayName;const Za=({className:t,...e})=>l.jsx("div",{className:N("flex flex-col gap-2",t),...e});Za.displayName="DialogHeader";const Ba=({className:t,...e})=>l.jsx("div",{className:N("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",t),...e});Ba.displayName="DialogFooter";const Ua=h.forwardRef(({className:t,...e},r)=>l.jsx(os,{ref:r,className:N("text-base font-medium leading-none text-foreground",t),...e}));Ua.displayName=os.displayName;const Ha=h.forwardRef(({className:t,...e},r)=>l.jsx(ls,{ref:r,className:N("text-sm text-muted-foreground",t),...e}));Ha.displayName=ls.displayName;const Sy=fe.Root,Ny=fe.Trigger,Cy=fe.Group,_y=fe.Portal,Ty=fe.Sub,jy=fe.RadioGroup,ku=h.forwardRef(({className:t,sideOffset:e=6,...r},n)=>l.jsx(fe.Portal,{children:l.jsx(fe.Content,{ref:n,sideOffset:e,className:N("z-50 min-w-[10rem] overflow-hidden rounded-lg bg-popover p-1 text-popover-foreground shadow-card-sm ring-1 ring-foreground/10 outline-none","transition-[opacity,transform] duration-100","data-[state=closed]:opacity-0 data-[state=closed]:scale-95","data-[state=open]:opacity-100 data-[state=open]:scale-100",t),...r})}));ku.displayName=fe.Content.displayName;const Su=h.forwardRef(({className:t,inset:e,icon:r,destructive:n,children:s,...a},i)=>l.jsxs(fe.Item,{ref:i,className:N("relative flex cursor-default select-none items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-none transition-colors","focus:bg-accent focus:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e&&"pl-8",n&&"text-destructive focus:bg-destructive/10 focus:text-destructive",t),...a,children:[r&&l.jsx("span",{className:"h-4 w-4 shrink-0 [&>svg]:h-4 [&>svg]:w-4",children:r}),s]}));Su.displayName=fe.Item.displayName;const Nu=h.forwardRef(({className:t,children:e,checked:r,...n},s)=>l.jsxs(fe.CheckboxItem,{ref:s,className:N("relative flex cursor-default select-none items-center gap-1.5 rounded-md py-1 pl-1.5 pr-8 text-sm outline-none transition-colors","focus:bg-accent focus:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:r,...n,children:[l.jsx("span",{className:"absolute right-2 flex h-4 w-4 items-center justify-center",children:l.jsx(fe.ItemIndicator,{children:l.jsx(J.Check,{className:"h-4 w-4"})})}),e]}));Nu.displayName=fe.CheckboxItem.displayName;const Cu=h.forwardRef(({className:t,children:e,...r},n)=>l.jsxs(fe.RadioItem,{ref:n,className:N("relative flex cursor-default select-none items-center gap-1.5 rounded-md py-1 pl-1.5 pr-8 text-sm outline-none transition-colors","focus:bg-accent focus:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...r,children:[l.jsx("span",{className:"absolute right-2 flex h-4 w-4 items-center justify-center",children:l.jsx(fe.ItemIndicator,{children:l.jsx(J.Circle,{className:"h-2.5 w-2.5 fill-current"})})}),e]}));Cu.displayName=fe.RadioItem.displayName;const _u=h.forwardRef(({className:t,inset:e,...r},n)=>l.jsx(fe.Label,{ref:n,className:N("px-1.5 py-1 text-xs font-medium text-muted-foreground",e&&"pl-8",t),...r}));_u.displayName=fe.Label.displayName;const Tu=h.forwardRef(({className:t,...e},r)=>l.jsx(fe.Separator,{ref:r,className:N("-mx-1 my-1 h-px bg-border",t),...e}));Tu.displayName=fe.Separator.displayName;const ju=h.forwardRef(({className:t,inset:e,children:r,...n},s)=>l.jsxs(fe.SubTrigger,{ref:s,className:N("flex cursor-default select-none items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-none transition-colors","focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",e&&"pl-8",t),...n,children:[r,l.jsx(J.ChevronRight,{className:"ml-auto h-4 w-4"})]}));ju.displayName=fe.SubTrigger.displayName;const Eu=h.forwardRef(({className:t,...e},r)=>l.jsx(fe.SubContent,{ref:r,className:N("z-50 min-w-[8rem] overflow-hidden rounded-lg bg-popover p-1 text-popover-foreground shadow-card-sm ring-1 ring-foreground/10 outline-none","transition-[opacity,transform] duration-100","data-[state=closed]:opacity-0 data-[state=closed]:scale-95","data-[state=open]:opacity-100 data-[state=open]:scale-100",t),...e}));Eu.displayName=fe.SubContent.displayName;const Ou=({className:t,...e})=>l.jsx("span",{className:N("ml-auto text-xs tracking-widest text-muted-foreground",t),...e});Ou.displayName="DropdownMenuShortcut";const Ey="Arrastra y suelta archivos aquí o selecciona desde tu dispositivo.",Oy=t=>{if(t===0)return"0 B";const e=1024,r=["B","KB","MB","GB","TB"],n=Math.floor(Math.log(t)/Math.log(e));return`${(t/Math.pow(e,n)).toFixed(n===0?0:1)} ${r[n]}`},ir=t=>`${t.name}-${t.size}-${t.lastModified}`,go=t=>t.type.startsWith("image/");function us({label:t,helperText:e,error:r,disabled:n=!1,multiple:s=!1,accept:a,files:i,defaultFiles:o=[],onFilesChange:c,id:u,name:f,allowDrop:d=!1,placeholder:m=Ey,showPreview:p=!0,previewMode:y="auto",maxPreviewItems:g=4,defaultPreviewUrl:x}){const v=b.useId(),S=u??v,C=e?`${S}-helper`:void 0,k=r?`${S}-error`:void 0,w=[C,k].filter(Boolean).join(" ")||void 0,j=b.useRef(null),[T,A]=b.useState(o),[$,L]=b.useState(!1),W=i!==void 0,B=W?i:T,G=F=>{const D=s?F:F.slice(0,1);W||A(D),c?.(D)},Q=F=>{if(!s)return F.slice(0,1);const D=new Map(B.map(ee=>[ir(ee),ee]));for(const ee of F)D.set(ir(ee),ee);return Array.from(D.values())},H=F=>{const D=Array.from(F.target.files??[]);G(s?Q(D):D),F.target.value=""},P=F=>{G(B.filter(D=>ir(D)!==ir(F)))},U=F=>{if(!d||n)return;F.preventDefault(),L(!1);const D=Array.from(F.dataTransfer.files??[]);D.length!==0&&G(s?Q(D):D)},V=b.useMemo(()=>{if(!p)return[];const F=B.slice(0,g);return y==="image"||y==="auto"&&F.some(ee=>go(ee))?F.filter(ee=>go(ee)).map(ee=>({key:ir(ee),file:ee,url:URL.createObjectURL(ee)})):[]},[B,g,y,p]);b.useEffect(()=>()=>{for(const F of V)URL.revokeObjectURL(F.url)},[V]);const ie=!!x&&B.length===0;return l.jsxs("div",{className:N("flex flex-col gap-2",n&&"pointer-events-none opacity-60"),children:[t&&l.jsx("label",{htmlFor:S,className:"text-sm font-medium text-foreground",children:t}),l.jsx("input",{ref:j,id:S,name:f,type:"file",className:"sr-only",disabled:n,multiple:s,accept:a,"aria-invalid":r?"true":void 0,"aria-describedby":w,onChange:H}),l.jsxs("button",{type:"button",disabled:n,className:N("flex min-h-44 flex-col items-center justify-center gap-3 rounded-xl border border-dashed border-border bg-card px-6 py-8 text-center","transition-[border-color,background-color,box-shadow,transform] hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px",d&&"cursor-pointer",$&&"border-ring bg-muted",r&&"border-destructive focus-visible:ring-destructive/20"),onClick:()=>j.current?.click(),onDragOver:F=>{!d||n||(F.preventDefault(),L(!0))},onDragLeave:()=>d&&L(!1),onDrop:U,children:[l.jsx(J.UploadCloud,{className:"h-8 w-8 text-muted-foreground"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-foreground",children:s?"Seleccionar archivos":"Seleccionar archivo"}),l.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:m}),a&&l.jsxs("p",{className:"mt-0.5 text-xs text-muted-foreground",children:["Acepta: ",a]})]})]}),ie&&l.jsx("div",{className:"mt-2 flex gap-2",children:l.jsx("div",{className:"h-16 w-16 overflow-hidden rounded-lg bg-muted ring-1 ring-foreground/10",children:l.jsx("img",{src:x,alt:"Logo actual",className:"h-full w-full object-cover"})})}),V.length>0&&l.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:V.map(F=>l.jsx("div",{className:"h-16 w-16 overflow-hidden rounded-lg bg-muted ring-1 ring-foreground/10",children:l.jsx("img",{src:F.url,alt:F.file.name,className:"h-full w-full object-cover"})},F.key))}),e&&!r&&l.jsx("p",{id:C,className:"text-xs text-muted-foreground",children:e}),r&&l.jsx("p",{id:k,className:"text-xs text-destructive",children:r}),B.length>0&&l.jsx("ul",{className:"mt-2 flex flex-col gap-1",children:B.map(F=>l.jsxs("li",{className:"flex items-center justify-between gap-2 rounded-lg bg-muted/40 px-3 py-2 ring-1 ring-foreground/10",children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l.jsx(J.FileIcon,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:F.name}),l.jsx("p",{className:"text-xs text-muted-foreground",children:Oy(F.size)})]})]}),l.jsx("button",{type:"button",className:"shrink-0 rounded-md p-1 text-muted-foreground transition-colors hover:bg-background hover:text-foreground focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50",onClick:()=>P(F),"aria-label":`Eliminar ${F.name}`,children:l.jsx(J.X,{className:"h-4 w-4"})})]},ir(F)))})]})}const Dy=us,Du=h.createContext(null);function ds(){const t=h.useContext(Du);if(!t)throw new Error("Field components must be used inside <Field>");return t}function st({className:t,error:e,required:r,...n}){const s=h.useId();return l.jsx(Du.Provider,{value:{id:s,error:e,required:r},children:l.jsx("div",{className:N("flex flex-col gap-1.5",t),...n})})}const Xe=b.forwardRef((t,e)=>{const{id:r,error:n}=ds();return l.jsx(Go,{ref:e,id:r,"aria-invalid":!!n,...t})});Xe.displayName="FieldControl";const at=h.forwardRef(({className:t,children:e,...r},n)=>{const{id:s,required:a}=ds();return l.jsxs("label",{ref:n,htmlFor:s,className:N("text-sm font-medium text-foreground leading-none",t),...r,children:[e,a&&l.jsx("span",{className:"ml-0.5 text-destructive",children:"*"})]})});at.displayName="FieldLabel";const Je=h.forwardRef(({className:t,children:e,...r},n)=>{const{error:s}=ds(),a=s??e;return a?l.jsx("p",{ref:n,className:N("text-xs",s?"text-destructive":"text-muted-foreground",t),...r,children:a}):null});Je.displayName="FieldMessage";const Ru=b.forwardRef(({className:t,containerClassName:e,isInvalid:r,...n},s)=>{const[a,i]=b.useState(!1);return l.jsxs("div",{className:N("relative",e),children:[l.jsx("input",{ref:s,type:a?"text":"password","aria-invalid":r||void 0,className:N("flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 pr-10 text-sm text-foreground shadow-sm transition-colors","placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1","disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-muted",r&&"border-destructive focus-visible:ring-destructive",t),...n}),l.jsx("button",{type:"button",className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",onClick:()=>i(o=>!o),children:a?l.jsx(J.EyeOff,{className:"h-4 w-4"}):l.jsx(J.EyeIcon,{className:"h-4 w-4"})})]})});Ru.displayName="PasswordInput";const $r=h.forwardRef(({className:t,isInvalid:e,"aria-invalid":r,...n},s)=>{const a=e??(r===!0||r==="true");return l.jsx("input",{ref:s,"aria-invalid":a||void 0,className:N("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-sm text-foreground transition-[border-color,box-shadow,color,background-color] outline-none","file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground","placeholder:text-muted-foreground","focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50","disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50","dark:bg-input/30 dark:disabled:bg-input/80",a&&"border-destructive focus-visible:border-destructive focus-visible:ring-destructive/20 dark:border-destructive/50 dark:focus-visible:ring-destructive/40",t),...n})});$r.displayName="Input";const Au=h.forwardRef(({className:t,...e},r)=>l.jsx("kbd",{ref:r,className:N("inline-flex min-h-6 items-center rounded-md border border-border bg-muted px-1.5 font-mono text-[11px] font-medium text-muted-foreground shadow-sm",t),...e}));Au.displayName="Kbd";const Ry=({lottieJson:t,title:e,description:r,actionLabel:n,onAction:s,fallbackIcon:a})=>l.jsxs("div",{className:"flex w-full flex-col items-center justify-center text-center",children:[t?l.jsx("div",{className:"mb-4 w-1/2",children:l.jsx(Rd,{animationData:t,loop:!0})}):a&&l.jsx("div",{className:"mb-4 text-[color:var(--oniratec-label-secondary)]",children:a}),l.jsx("h2",{className:"mb-2 text-lg font-semibold text-[color:var(--oniratec-label-primary)]",children:e}),r&&l.jsx("p",{className:"mb-6 max-w-md text-sm text-[color:var(--oniratec-label-secondary)]",children:r}),n&&s&&l.jsx(Le,{size:"md",onClick:s,children:n})]}),Mu=h.forwardRef(({className:t,indicatorClassName:e,max:r=100,value:n=0,...s},a)=>{const i=r>0?r:100,o=n==null?0:Math.min(Math.max(n,0),i),c=`${o/i*100}%`;return l.jsx("div",{ref:a,role:"progressbar","aria-valuemin":0,"aria-valuemax":i,"aria-valuenow":n==null?void 0:o,className:N("h-2 w-full overflow-hidden rounded-full bg-muted ring-1 ring-foreground/10",t),...s,children:l.jsx("div",{className:N("h-full rounded-full bg-primary transition-[width] duration-300",e),style:{width:c}})})});Mu.displayName="Progress";const Iu=h.createContext(null);function Ay(){const t=h.useContext(Iu);if(!t)throw new Error("RadioGroupItem must be used inside <RadioGroup>.");return t}function My({className:t,defaultValue:e,disabled:r,name:n,onValueChange:s,orientation:a="vertical",required:i,value:o,...c}){const u=h.useId(),[f,d]=h.useState(e),m=o!==void 0,p=m?o:f,y=h.useCallback(g=>{m||d(g),s?.(g)},[m,s]);return l.jsx(Iu.Provider,{value:{disabled:r,name:n??u,onValueChange:y,orientation:a,required:i,value:p},children:l.jsx("div",{role:"radiogroup","aria-required":i,"data-orientation":a,className:N("flex gap-3",a==="horizontal"?"flex-row flex-wrap items-center":"flex-col",t),...c})})}const Pu=h.forwardRef(({className:t,description:e,disabled:r,id:n,label:s,size:a="md",value:i,"aria-describedby":o,"aria-invalid":c,onChange:u,...f},d)=>{const m=h.useId(),p=n??m,y=e?`${p}-description`:void 0,g=c===!0||c==="true",x=Ay(),v=x.value===i,S=x.disabled||r;return l.jsxs("label",{htmlFor:p,className:N("inline-flex w-fit items-start gap-2.5 text-sm",S&&"cursor-not-allowed opacity-60",t),children:[l.jsx("input",{ref:d,id:p,type:"radio",name:x.name,value:i,checked:v,required:x.required,disabled:S,"aria-invalid":g||void 0,"aria-describedby":[o,y].filter(Boolean).join(" ")||void 0,className:"peer sr-only",onChange:C=>{C.target.checked&&x.onValueChange(i),u?.(C)},...f}),l.jsx("span",{className:N("flex shrink-0 items-center justify-center rounded-full border border-input bg-background text-primary transition-[background-color,border-color,box-shadow,color] outline-none","peer-focus-visible:border-ring peer-focus-visible:ring-3 peer-focus-visible:ring-ring/50","peer-disabled:border-input peer-disabled:bg-input/50","peer-checked:border-primary peer-checked:bg-primary/10 peer-checked:[&_span]:scale-100 peer-checked:[&_span]:opacity-100",g&&"border-destructive peer-focus-visible:border-destructive peer-focus-visible:ring-destructive/20",a==="sm"?"h-4 w-4":"h-5 w-5"),children:l.jsx("span",{className:N("rounded-full bg-primary opacity-0 transition-[opacity,transform]",a==="sm"?"h-2 w-2 scale-75":"h-2.5 w-2.5 scale-75")})}),(s||e)&&l.jsxs("span",{className:"grid gap-1 leading-tight",children:[s&&l.jsx("span",{className:"font-medium text-foreground",children:s}),e&&l.jsx("span",{id:y,className:"text-sm text-muted-foreground",children:e})]})]})});Pu.displayName="RadioGroupItem";const fs=pe.Root,Iy=pe.Group,hs=pe.Value,Kr=h.forwardRef(({className:t,hasError:e,children:r,...n},s)=>l.jsxs(pe.Trigger,{ref:s,"aria-invalid":e||void 0,className:N("flex h-8 w-full items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent px-2.5 py-1 pr-2 text-sm transition-[border-color,box-shadow,color,background-color] outline-none","data-[placeholder]:text-muted-foreground","focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50","disabled:cursor-not-allowed disabled:opacity-50","dark:bg-input/30 dark:hover:bg-input/50","[&>span]:line-clamp-1",e&&"border-destructive focus-visible:border-destructive focus-visible:ring-destructive/20 dark:border-destructive/50 dark:focus-visible:ring-destructive/40",t),...n,children:[r,l.jsx(pe.Icon,{asChild:!0,children:l.jsx(J.ChevronDown,{className:"h-4 w-4 shrink-0 text-muted-foreground"})})]}));Kr.displayName=pe.Trigger.displayName;const qa=h.forwardRef(({className:t,...e},r)=>l.jsx(pe.ScrollUpButton,{ref:r,className:N("flex cursor-default items-center justify-center bg-popover py-1",t),...e,children:l.jsx(J.ChevronUp,{className:"h-4 w-4"})}));qa.displayName=pe.ScrollUpButton.displayName;const Ya=h.forwardRef(({className:t,...e},r)=>l.jsx(pe.ScrollDownButton,{ref:r,className:N("flex cursor-default items-center justify-center bg-popover py-1",t),...e,children:l.jsx(J.ChevronDown,{className:"h-4 w-4"})}));Ya.displayName=pe.ScrollDownButton.displayName;const Qr=h.forwardRef(({className:t,children:e,position:r="popper",...n},s)=>l.jsx(pe.Portal,{children:l.jsxs(pe.Content,{ref:s,className:N("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-lg bg-popover text-popover-foreground shadow-card-sm ring-1 ring-foreground/10 outline-none","transition-[opacity,transform] duration-100","data-[state=closed]:opacity-0 data-[state=closed]:scale-95","data-[state=open]:opacity-100 data-[state=open]:scale-100",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",t),position:r,...n,children:[l.jsx(qa,{}),l.jsx(pe.Viewport,{className:N("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),l.jsx(Ya,{})]})}));Qr.displayName=pe.Content.displayName;const Fu=h.forwardRef(({className:t,...e},r)=>l.jsx(pe.Label,{ref:r,className:N("px-1.5 py-1 text-xs font-medium text-muted-foreground",t),...e}));Fu.displayName=pe.Label.displayName;const en=h.forwardRef(({className:t,children:e,...r},n)=>l.jsxs(pe.Item,{ref:n,className:N("relative flex w-full cursor-default select-none items-center gap-1.5 rounded-md py-1 pl-1.5 pr-8 text-sm outline-none transition-colors","focus:bg-accent focus:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...r,children:[l.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(pe.ItemIndicator,{children:l.jsx(J.Check,{className:"h-4 w-4"})})}),l.jsx(pe.ItemText,{children:e})]}));en.displayName=pe.Item.displayName;const Lu=h.forwardRef(({className:t,...e},r)=>l.jsx(pe.Separator,{ref:r,className:N("-mx-1 my-1 h-px bg-border",t),...e}));Lu.displayName=pe.Separator.displayName;function Py(t,e){const[r,n]=h.useState(t);return h.useEffect(()=>{const s=setTimeout(()=>n(t),e);return()=>clearTimeout(s)},[t,e]),r}function Ga({value:t,onValueChange:e,placeholder:r="Seleccionar",searchPlaceholder:n="Buscar...",disabled:s,hasError:a,minChars:i=2,debounceMs:o=300,fetcher:c,getOptionValue:u,getOptionLabel:f,emptyLabel:d="Sin resultados",loadingLabel:m="Buscando...",emptyActionLabel:p,onEmptyActionClick:y,contentClassName:g,triggerClassName:x}){const[v,S]=h.useState(!1),[C,k]=h.useState(""),[w,j]=h.useState(!1),[T,A]=h.useState([]),[$,L]=h.useState(""),W=Py(C,o),B=W.trim().length>=i,G=h.useRef(null);h.useEffect(()=>{const H=P=>{G.current&&(G.current.contains(P.target)||S(!1))};return document.addEventListener("mousedown",H),()=>document.removeEventListener("mousedown",H)},[]),h.useEffect(()=>{let H=!0;return(async()=>{if(v){if(!B){A([]);return}j(!0);try{const U=await c(W.trim());if(!H)return;A(U??[])}finally{H&&j(!1)}}})(),()=>{H=!1}},[v,W,B,c]),h.useEffect(()=>{if(!t){L("");return}const H=T.find(P=>u(P)===t);H&&L(f(H))},[t,T,u,f]);const Q=$||r;return l.jsxs("div",{ref:G,className:"relative w-full",children:[l.jsxs("button",{type:"button",disabled:s,"aria-invalid":a?"true":"false","aria-expanded":v,"aria-haspopup":"listbox",onClick:()=>S(H=>!H),className:N("flex h-9 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm shadow-sm transition-colors","focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1","disabled:cursor-not-allowed disabled:opacity-50",a&&"border-destructive focus:ring-destructive",x),children:[l.jsx("span",{className:N("truncate",!$&&"text-muted-foreground"),children:Q}),l.jsx(J.ChevronDown,{className:N("h-4 w-4 shrink-0 opacity-50 transition-transform",v&&"rotate-180")})]}),v&&l.jsxs("div",{className:N("absolute left-0 top-full z-50 mt-1 w-full rounded-md border border-border bg-popover shadow-card-sm",g),role:"listbox",children:[l.jsxs("div",{className:"flex items-center border-b border-border px-3",children:[l.jsx("input",{className:"flex h-9 w-full bg-transparent py-2 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",value:C,onChange:H=>k(H.target.value),placeholder:n,autoFocus:!0}),w&&l.jsx(J.Loader2,{className:"h-4 w-4 shrink-0 animate-spin text-muted-foreground"})]}),l.jsxs("div",{className:"max-h-60 overflow-y-auto p-1",children:[!B&&l.jsxs("p",{className:"py-2 text-center text-xs text-muted-foreground",children:["Escribe al menos ",i," caracteres"]}),B&&w&&l.jsx("p",{className:"py-2 text-center text-xs text-muted-foreground",children:m}),B&&!w&&T.length===0&&l.jsxs("div",{className:"flex flex-col items-center gap-2 py-3",children:[l.jsx("p",{className:"text-xs text-muted-foreground",children:d}),p&&y&&l.jsx("button",{type:"button",className:"text-xs font-medium text-primary hover:underline",onClick:y,children:p})]}),T.length>0&&l.jsx("ul",{children:T.map(H=>{const P=u(H),U=f(H),V=P===t;return l.jsx("li",{children:l.jsxs("button",{type:"button",role:"option","aria-selected":V,className:N("relative flex w-full cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors","hover:bg-accent hover:text-accent-foreground",V&&"bg-accent text-accent-foreground font-medium"),onClick:()=>{e(P),L(U),S(!1),k("")},children:[V&&l.jsx(J.Check,{className:"mr-2 h-4 w-4 shrink-0"}),l.jsx("span",{className:N(!V&&"ml-6"),children:U})]})},P)})})]})]})]})}const Vu=h.forwardRef(({className:t,decorative:e=!0,orientation:r="horizontal",...n},s)=>l.jsx("div",{ref:s,role:e?"none":"separator","aria-orientation":e?void 0:r,"data-orientation":r,className:N("shrink-0 bg-border",r==="horizontal"?"h-px w-full":"h-full w-px",t),...n}));Vu.displayName="Separator";const Fy=yu,Ly=vu,Vy=cs,$u=xu,Xa=h.forwardRef(({className:t,...e},r)=>l.jsx(as,{ref:r,className:N("fixed inset-0 isolate z-50 bg-black/10 backdrop-blur-[2px] transition-opacity duration-100","data-[state=closed]:opacity-0 data-[state=open]:opacity-100",t),...e}));Xa.displayName=as.displayName;const $y=Bn("fixed z-50 flex flex-col gap-4 bg-background p-4 text-sm ring-1 ring-foreground/10 shadow-card-lg outline-none transition-[opacity,transform] duration-100 data-[state=closed]:opacity-0 data-[state=open]:opacity-100",{variants:{side:{top:"inset-x-0 top-0 border-b border-border data-[state=closed]:-translate-y-6 data-[state=open]:translate-y-0",bottom:"inset-x-0 bottom-0 border-t border-border data-[state=closed]:translate-y-6 data-[state=open]:translate-y-0",left:"inset-y-0 left-0 h-full w-full max-w-sm border-r border-border data-[state=closed]:-translate-x-full data-[state=open]:translate-x-0",right:"inset-y-0 right-0 h-full w-full max-w-sm border-l border-border data-[state=closed]:translate-x-full data-[state=open]:translate-x-0"}},defaultVariants:{side:"right"}}),zu=h.forwardRef(({side:t="right",className:e,children:r,hideClose:n,...s},a)=>l.jsxs($u,{children:[l.jsx(Xa,{}),l.jsxs(is,{ref:a,className:N($y({side:t}),e),...s,children:[!n&&l.jsx(cs,{asChild:!0,children:l.jsxs(Le,{variant:"ghost",size:"icon-sm",className:"absolute right-2 top-2","aria-label":"Cerrar",children:[l.jsx(J.X,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Cerrar"})]})}),r]})]}));zu.displayName=is.displayName;const Wu=({className:t,...e})=>l.jsx("div",{className:N("flex flex-col gap-2",t),...e});Wu.displayName="SheetHeader";const Zu=({className:t,...e})=>l.jsx("div",{className:N("-mx-4 -mb-4 mt-auto flex flex-col-reverse gap-2 border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",t),...e});Zu.displayName="SheetFooter";const Bu=h.forwardRef(({className:t,...e},r)=>l.jsx(os,{ref:r,className:N("text-base font-medium leading-none text-foreground",t),...e}));Bu.displayName=os.displayName;const Uu=h.forwardRef(({className:t,...e},r)=>l.jsx(ls,{ref:r,className:N("text-sm text-muted-foreground",t),...e}));Uu.displayName=ls.displayName;function sa({className:t}){return l.jsx("div",{className:N("animate-pulse rounded-lg bg-muted/80",t)})}const Hu=h.forwardRef(({className:t,isInvalid:e,"aria-invalid":r,...n},s)=>{const a=e??(r===!0||r==="true");return l.jsx("textarea",{ref:s,"aria-invalid":a||void 0,className:N("min-h-20 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-sm text-foreground transition-[border-color,box-shadow,color,background-color] outline-none","placeholder:text-muted-foreground","focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50","disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50","dark:bg-input/30 dark:disabled:bg-input/80","resize-y",a&&"border-destructive focus-visible:border-destructive focus-visible:ring-destructive/20 dark:border-destructive/50 dark:focus-visible:ring-destructive/40",t),...n})});Hu.displayName="Textarea";const qu=h.createContext(null);function Ja(){const t=h.useContext(qu);if(!t)throw new Error("Tabs components must be used inside <Tabs>.");return t}function zy({children:t,className:e,defaultValue:r,onValueChange:n,orientation:s="horizontal",value:a,...i}){const o=h.useId(),[c,u]=h.useState(r),f=a!==void 0,d=f?a:c,m=h.useCallback(p=>{f||u(p),n?.(p)},[f,n]);return l.jsx(qu.Provider,{value:{baseId:o,onValueChange:m,orientation:s,value:d},children:l.jsx("div",{className:N("w-full",e),"data-orientation":s,...i,children:t})})}const Yu=h.forwardRef(({className:t,onKeyDown:e,...r},n)=>{const{onValueChange:s,orientation:a}=Ja();return l.jsx("div",{ref:n,role:"tablist","aria-orientation":a,className:N("inline-flex w-fit items-center gap-1 rounded-lg bg-muted p-1 text-muted-foreground ring-1 ring-foreground/10",a==="vertical"&&"flex-col items-stretch",t),onKeyDown:i=>{const o=a==="horizontal"?i.key==="ArrowRight":i.key==="ArrowDown",c=a==="horizontal"?i.key==="ArrowLeft":i.key==="ArrowUp",u=i.key==="Home"||i.key==="End";if(!o&&!c&&!u){e?.(i);return}const f=Array.from(i.currentTarget.querySelectorAll('[role="tab"]:not(:disabled)'));if(f.length===0){e?.(i);return}const d=f.findIndex(g=>g===document.activeElement);let m=d===-1?0:d;o&&(m=(d+1+f.length)%f.length),c&&(m=(d-1+f.length)%f.length),i.key==="Home"&&(m=0),i.key==="End"&&(m=f.length-1),i.preventDefault();const p=f[m];p?.focus();const y=p?.dataset.value;y&&s(y),e?.(i)},...r})});Yu.displayName="TabsList";const Gu=h.forwardRef(({children:t,className:e,value:r,...n},s)=>{const{baseId:a,onValueChange:i,orientation:o,value:c}=Ja(),u=r===c;return l.jsx("button",{ref:s,id:`${a}-trigger-${r}`,type:"button",role:"tab","aria-controls":`${a}-content-${r}`,"aria-selected":u,tabIndex:u?0:-1,"data-state":u?"active":"inactive","data-value":r,className:N("inline-flex h-8 items-center justify-center gap-1.5 rounded-md px-2.5 text-sm font-medium transition-[background-color,color,box-shadow,transform] outline-none","focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50","data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-card-sm","data-[state=inactive]:text-muted-foreground hover:text-foreground",o==="vertical"&&"justify-start",e),onClick:()=>i(r),...n,children:t})});Gu.displayName="TabsTrigger";const Xu=h.forwardRef(({className:t,forceMount:e=!1,value:r,...n},s)=>{const{baseId:a,value:i}=Ja(),o=r===i;return!o&&!e?null:l.jsx("div",{ref:s,id:`${a}-content-${r}`,role:"tabpanel","aria-labelledby":`${a}-trigger-${r}`,hidden:!o,tabIndex:0,"data-state":o?"active":"inactive",className:N("mt-4 outline-none focus-visible:ring-3 focus-visible:ring-ring/50",!o&&"hidden",t),...n})});Xu.displayName="TabsContent";function Wy(t){const e=h.useRef({value:t,previous:t});return h.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var ms="Switch",[Zy]=Un(ms),[By,Uy]=Zy(ms),Ju=h.forwardRef((t,e)=>{const{__scopeSwitch:r,name:n,checked:s,defaultChecked:a,required:i,disabled:o,value:c="on",onCheckedChange:u,form:f,...d}=t,[m,p]=h.useState(null),y=$e(e,C=>p(C)),g=h.useRef(!1),x=m?f||!!m.closest("form"):!0,[v,S]=Ta({prop:s,defaultProp:a??!1,onChange:u,caller:ms});return l.jsxs(By,{scope:r,checked:v,disabled:o,children:[l.jsx(_e.button,{type:"button",role:"switch","aria-checked":v,"aria-required":i,"data-state":td(v),"data-disabled":o?"":void 0,disabled:o,value:c,...d,ref:y,onClick:Re(t.onClick,C=>{S(k=>!k),x&&(g.current=C.isPropagationStopped(),g.current||C.stopPropagation())})}),x&&l.jsx(ed,{control:m,bubbles:!g.current,name:n,value:c,checked:v,required:i,disabled:o,form:f,style:{transform:"translateX(-100%)"}})]})});Ju.displayName=ms;var Ku="SwitchThumb",Qu=h.forwardRef((t,e)=>{const{__scopeSwitch:r,...n}=t,s=Uy(Ku,r);return l.jsx(_e.span,{"data-state":td(s.checked),"data-disabled":s.disabled?"":void 0,...n,ref:e})});Qu.displayName=Ku;var Hy="SwitchBubbleInput",ed=h.forwardRef(({__scopeSwitch:t,control:e,checked:r,bubbles:n=!0,...s},a)=>{const i=h.useRef(null),o=$e(i,a),c=Wy(r),u=kl(e);return h.useEffect(()=>{const f=i.current;if(!f)return;const d=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(d,"checked").set;if(c!==r&&p){const y=new Event("click",{bubbles:n});p.call(f,r),f.dispatchEvent(y)}},[c,r,n]),l.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:o,style:{...s.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});ed.displayName=Hy;function td(t){return t?"checked":"unchecked"}var qy=Ju,Yy=Qu;const tn=h.forwardRef(({checked:t,defaultChecked:e=!1,onChange:r,size:n="md",disabled:s=!1,label:a,className:i,ariaLabel:o,id:c},u)=>{const f=h.useId(),d=c??f;return l.jsxs("div",{className:N("flex items-center gap-2",i),children:[l.jsx(qy,{ref:u,id:d,checked:t,defaultChecked:e,onCheckedChange:r,disabled:s,"aria-label":o,className:N("peer inline-flex shrink-0 cursor-pointer items-center rounded-full border border-transparent transition-[background-color,box-shadow] outline-none","focus-visible:ring-3 focus-visible:ring-ring/50","disabled:cursor-not-allowed disabled:opacity-50","data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-muted/60",n==="sm"?"h-4 w-7":"h-5 w-9"),children:l.jsx(Yy,{className:N("pointer-events-none block rounded-full bg-background shadow-sm ring-1 ring-black/10 transition-transform dark:ring-white/20",n==="sm"?"h-3 w-3 translate-x-0.5 data-[state=checked]:translate-x-3":"h-4 w-4 translate-x-0.5 data-[state=checked]:translate-x-4")})}),a&&l.jsx("label",{htmlFor:d,className:N("text-sm font-medium text-foreground",s&&"cursor-not-allowed opacity-50"),children:a})]})});tn.displayName="Toggle";const Gy=tn;function Xy(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}const Jy=t=>{switch(t){case"success":return ev;case"info":return rv;case"warning":return tv;case"error":return nv;default:return null}},Ky=Array(12).fill(0),Qy=({visible:t,className:e})=>b.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},b.createElement("div",{className:"sonner-spinner"},Ky.map((r,n)=>b.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),ev=b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},b.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"})),tv=b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},b.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"})),rv=b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},b.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"})),nv=b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},b.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"})),sv=b.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"},b.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),b.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),av=()=>{const[t,e]=b.useState(document.hidden);return b.useEffect(()=>{const r=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),t};let aa=1;class iv{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{const r=this.subscribers.indexOf(e);this.subscribers.splice(r,1)}),this.publish=e=>{this.subscribers.forEach(r=>r(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var r;const{message:n,...s}=e,a=typeof e?.id=="number"||((r=e.id)==null?void 0:r.length)>0?e.id:aa++,i=this.toasts.find(c=>c.id===a),o=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),i?this.toasts=this.toasts.map(c=>c.id===a?(this.publish({...c,...e,id:a,title:n}),{...c,...e,id:a,dismissible:o,title:n}):c):this.addToast({title:n,...s,dismissible:o,id:a}),a},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:e,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(n=>n({id:r.id,dismiss:!0}))}),e),this.message=(e,r)=>this.create({...r,message:e}),this.error=(e,r)=>this.create({...r,message:e,type:"error"}),this.success=(e,r)=>this.create({...r,type:"success",message:e}),this.info=(e,r)=>this.create({...r,type:"info",message:e}),this.warning=(e,r)=>this.create({...r,type:"warning",message:e}),this.loading=(e,r)=>this.create({...r,type:"loading",message:e}),this.promise=(e,r)=>{if(!r)return;let n;r.loading!==void 0&&(n=this.create({...r,promise:e,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const s=Promise.resolve(e instanceof Function?e():e);let a=n!==void 0,i;const o=s.then(async u=>{if(i=["resolve",u],b.isValidElement(u))a=!1,this.create({id:n,type:"default",message:u});else if(lv(u)&&!u.ok){a=!1;const d=typeof r.error=="function"?await r.error(`HTTP error! status: ${u.status}`):r.error,m=typeof r.description=="function"?await r.description(`HTTP error! status: ${u.status}`):r.description,y=typeof d=="object"&&!b.isValidElement(d)?d:{message:d};this.create({id:n,type:"error",description:m,...y})}else if(u instanceof Error){a=!1;const d=typeof r.error=="function"?await r.error(u):r.error,m=typeof r.description=="function"?await r.description(u):r.description,y=typeof d=="object"&&!b.isValidElement(d)?d:{message:d};this.create({id:n,type:"error",description:m,...y})}else if(r.success!==void 0){a=!1;const d=typeof r.success=="function"?await r.success(u):r.success,m=typeof r.description=="function"?await r.description(u):r.description,y=typeof d=="object"&&!b.isValidElement(d)?d:{message:d};this.create({id:n,type:"success",description:m,...y})}}).catch(async u=>{if(i=["reject",u],r.error!==void 0){a=!1;const f=typeof r.error=="function"?await r.error(u):r.error,d=typeof r.description=="function"?await r.description(u):r.description,p=typeof f=="object"&&!b.isValidElement(f)?f:{message:f};this.create({id:n,type:"error",description:d,...p})}}).finally(()=>{a&&(this.dismiss(n),n=void 0),r.finally==null||r.finally.call(r)}),c=()=>new Promise((u,f)=>o.then(()=>i[0]==="reject"?f(i[1]):u(i[1])).catch(f));return typeof n!="string"&&typeof n!="number"?{unwrap:c}:Object.assign(n,{unwrap:c})},this.custom=(e,r)=>{const n=r?.id||aa++;return this.create({jsx:e(n),id:n,...r}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const De=new iv,ov=(t,e)=>{const r=e?.id||aa++;return De.addToast({title:t,...e,id:r}),r},lv=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",cv=ov,uv=()=>De.toasts,dv=()=>De.getActiveToasts(),fv=Object.assign(cv,{success:De.success,info:De.info,warning:De.warning,error:De.error,custom:De.custom,message:De.message,promise:De.promise,dismiss:De.dismiss,loading:De.loading},{getHistory:uv,getToasts:dv});Xy("[data-sonner-toaster][dir=ltr],html[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%)}[data-sonner-toaster][dir=rtl],html[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%)}[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:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[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);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[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 rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [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)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [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;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [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);background:var(--normal-bg);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-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[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}[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}[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,0)) translateX(var(--swipe-amount-x,0));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{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{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{from{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-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--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-sonner-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-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-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, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--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-sonner-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-sonner-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]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[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]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[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]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[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]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[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:first-child{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)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{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%)}");function yn(t){return t.label!==void 0}const hv=3,mv="24px",pv="16px",yo=4e3,gv=356,yv=14,vv=45,xv=200;function nt(...t){return t.filter(Boolean).join(" ")}function bv(t){const[e,r]=t.split("-"),n=[];return e&&n.push(e),r&&n.push(r),n}const wv=t=>{var e,r,n,s,a,i,o,c,u;const{invert:f,toast:d,unstyled:m,interacting:p,setHeights:y,visibleToasts:g,heights:x,index:v,toasts:S,expanded:C,removeToast:k,defaultRichColors:w,closeButton:j,style:T,cancelButtonStyle:A,actionButtonStyle:$,className:L="",descriptionClassName:W="",duration:B,position:G,gap:Q,expandByDefault:H,classNames:P,icons:U,closeButtonAriaLabel:V="Close toast"}=t,[ie,F]=b.useState(null),[D,ee]=b.useState(null),[z,oe]=b.useState(!1),[ce,ve]=b.useState(!1),[Te,le]=b.useState(!1),[vt,Yt]=b.useState(!1),[Gt,xt]=b.useState(!1),[Xt,ps]=b.useState(0),[bd,ri]=b.useState(0),Er=b.useRef(d.duration||B||yo),ni=b.useRef(null),ht=b.useRef(null),wd=v===0,kd=v+1<=g,Ae=d.type,Jt=d.dismissible!==!1,Sd=d.className||"",Nd=d.descriptionClassName||"",rn=b.useMemo(()=>x.findIndex(X=>X.toastId===d.id)||0,[x,d.id]),Cd=b.useMemo(()=>{var X;return(X=d.closeButton)!=null?X:j},[d.closeButton,j]),si=b.useMemo(()=>d.duration||B||yo,[d.duration,B]),gs=b.useRef(0),Kt=b.useRef(0),ai=b.useRef(0),Qt=b.useRef(null),[_d,Td]=G.split("-"),ii=b.useMemo(()=>x.reduce((X,xe,we)=>we>=rn?X:X+xe.height,0),[x,rn]),oi=av(),jd=d.invert||f,ys=Ae==="loading";Kt.current=b.useMemo(()=>rn*Q+ii,[rn,ii]),b.useEffect(()=>{Er.current=si},[si]),b.useEffect(()=>{oe(!0)},[]),b.useEffect(()=>{const X=ht.current;if(X){const xe=X.getBoundingClientRect().height;return ri(xe),y(we=>[{toastId:d.id,height:xe,position:d.position},...we]),()=>y(we=>we.filter(Me=>Me.toastId!==d.id))}},[y,d.id]),b.useLayoutEffect(()=>{if(!z)return;const X=ht.current,xe=X.style.height;X.style.height="auto";const we=X.getBoundingClientRect().height;X.style.height=xe,ri(we),y(Me=>Me.find(be=>be.toastId===d.id)?Me.map(be=>be.toastId===d.id?{...be,height:we}:be):[{toastId:d.id,height:we,position:d.position},...Me])},[z,d.title,d.description,y,d.id,d.jsx,d.action,d.cancel]);const bt=b.useCallback(()=>{ve(!0),ps(Kt.current),y(X=>X.filter(xe=>xe.toastId!==d.id)),setTimeout(()=>{k(d)},xv)},[d,k,y,Kt]);b.useEffect(()=>{if(d.promise&&Ae==="loading"||d.duration===1/0||d.type==="loading")return;let X;return C||p||oi?(()=>{if(ai.current<gs.current){const Me=new Date().getTime()-gs.current;Er.current=Er.current-Me}ai.current=new Date().getTime()})():Er.current!==1/0&&(gs.current=new Date().getTime(),X=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),bt()},Er.current)),()=>clearTimeout(X)},[C,p,d,Ae,oi,bt]),b.useEffect(()=>{d.delete&&(bt(),d.onDismiss==null||d.onDismiss.call(d,d))},[bt,d.delete]);function Ed(){var X;if(U?.loading){var xe;return b.createElement("div",{className:nt(P?.loader,d==null||(xe=d.classNames)==null?void 0:xe.loader,"sonner-loader"),"data-visible":Ae==="loading"},U.loading)}return b.createElement(Qy,{className:nt(P?.loader,d==null||(X=d.classNames)==null?void 0:X.loader),visible:Ae==="loading"})}const Od=d.icon||U?.[Ae]||Jy(Ae);var li,ci;return b.createElement("li",{tabIndex:0,ref:ht,className:nt(L,Sd,P?.toast,d==null||(e=d.classNames)==null?void 0:e.toast,P?.default,P?.[Ae],d==null||(r=d.classNames)==null?void 0:r[Ae]),"data-sonner-toast":"","data-rich-colors":(li=d.richColors)!=null?li:w,"data-styled":!(d.jsx||d.unstyled||m),"data-mounted":z,"data-promise":!!d.promise,"data-swiped":Gt,"data-removed":ce,"data-visible":kd,"data-y-position":_d,"data-x-position":Td,"data-index":v,"data-front":wd,"data-swiping":Te,"data-dismissible":Jt,"data-type":Ae,"data-invert":jd,"data-swipe-out":vt,"data-swipe-direction":D,"data-expanded":!!(C||H&&z),"data-testid":d.testId,style:{"--index":v,"--toasts-before":v,"--z-index":S.length-v,"--offset":`${ce?Xt:Kt.current}px`,"--initial-height":H?"auto":`${bd}px`,...T,...d.style},onDragEnd:()=>{le(!1),F(null),Qt.current=null},onPointerDown:X=>{X.button!==2&&(ys||!Jt||(ni.current=new Date,ps(Kt.current),X.target.setPointerCapture(X.pointerId),X.target.tagName!=="BUTTON"&&(le(!0),Qt.current={x:X.clientX,y:X.clientY})))},onPointerUp:()=>{var X,xe,we;if(vt||!Jt)return;Qt.current=null;const Me=Number(((X=ht.current)==null?void 0:X.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),nn=Number(((xe=ht.current)==null?void 0:xe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),be=new Date().getTime()-((we=ni.current)==null?void 0:we.getTime()),ze=ie==="x"?Me:nn,sn=Math.abs(ze)/be;if(Math.abs(ze)>=vv||sn>.11){ps(Kt.current),d.onDismiss==null||d.onDismiss.call(d,d),ee(ie==="x"?Me>0?"right":"left":nn>0?"down":"up"),bt(),Yt(!0);return}else{var He,qe;(He=ht.current)==null||He.style.setProperty("--swipe-amount-x","0px"),(qe=ht.current)==null||qe.style.setProperty("--swipe-amount-y","0px")}xt(!1),le(!1),F(null)},onPointerMove:X=>{var xe,we,Me;if(!Qt.current||!Jt||((xe=window.getSelection())==null?void 0:xe.toString().length)>0)return;const be=X.clientY-Qt.current.y,ze=X.clientX-Qt.current.x;var sn;const He=(sn=t.swipeDirections)!=null?sn:bv(G);!ie&&(Math.abs(ze)>1||Math.abs(be)>1)&&F(Math.abs(ze)>Math.abs(be)?"x":"y");let qe={x:0,y:0};const ui=Mt=>1/(1.5+Math.abs(Mt)/20);if(ie==="y"){if(He.includes("top")||He.includes("bottom"))if(He.includes("top")&&be<0||He.includes("bottom")&&be>0)qe.y=be;else{const Mt=be*ui(be);qe.y=Math.abs(Mt)<Math.abs(be)?Mt:be}}else if(ie==="x"&&(He.includes("left")||He.includes("right")))if(He.includes("left")&&ze<0||He.includes("right")&&ze>0)qe.x=ze;else{const Mt=ze*ui(ze);qe.x=Math.abs(Mt)<Math.abs(ze)?Mt:ze}(Math.abs(qe.x)>0||Math.abs(qe.y)>0)&&xt(!0),(we=ht.current)==null||we.style.setProperty("--swipe-amount-x",`${qe.x}px`),(Me=ht.current)==null||Me.style.setProperty("--swipe-amount-y",`${qe.y}px`)}},Cd&&!d.jsx&&Ae!=="loading"?b.createElement("button",{"aria-label":V,"data-disabled":ys,"data-close-button":!0,onClick:ys||!Jt?()=>{}:()=>{bt(),d.onDismiss==null||d.onDismiss.call(d,d)},className:nt(P?.closeButton,d==null||(n=d.classNames)==null?void 0:n.closeButton)},(ci=U?.close)!=null?ci:sv):null,(Ae||d.icon||d.promise)&&d.icon!==null&&(U?.[Ae]!==null||d.icon)?b.createElement("div",{"data-icon":"",className:nt(P?.icon,d==null||(s=d.classNames)==null?void 0:s.icon)},d.promise||d.type==="loading"&&!d.icon?d.icon||Ed():null,d.type!=="loading"?Od:null):null,b.createElement("div",{"data-content":"",className:nt(P?.content,d==null||(a=d.classNames)==null?void 0:a.content)},b.createElement("div",{"data-title":"",className:nt(P?.title,d==null||(i=d.classNames)==null?void 0:i.title)},d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title),d.description?b.createElement("div",{"data-description":"",className:nt(W,Nd,P?.description,d==null||(o=d.classNames)==null?void 0:o.description)},typeof d.description=="function"?d.description():d.description):null),b.isValidElement(d.cancel)?d.cancel:d.cancel&&yn(d.cancel)?b.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||A,onClick:X=>{yn(d.cancel)&&Jt&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,X),bt())},className:nt(P?.cancelButton,d==null||(c=d.classNames)==null?void 0:c.cancelButton)},d.cancel.label):null,b.isValidElement(d.action)?d.action:d.action&&yn(d.action)?b.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||$,onClick:X=>{yn(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,X),!X.defaultPrevented&&bt())},className:nt(P?.actionButton,d==null||(u=d.classNames)==null?void 0:u.actionButton)},d.action.label):null)};function vo(){if(typeof window>"u"||typeof document>"u")return"ltr";const t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function kv(t,e){const r={};return[t,e].forEach((n,s)=>{const a=s===1,i=a?"--mobile-offset":"--offset",o=a?pv:mv;function c(u){["top","right","bottom","left"].forEach(f=>{r[`${i}-${f}`]=typeof u=="number"?`${u}px`:u})}typeof n=="number"||typeof n=="string"?c(n):typeof n=="object"?["top","right","bottom","left"].forEach(u=>{n[u]===void 0?r[`${i}-${u}`]=o:r[`${i}-${u}`]=typeof n[u]=="number"?`${n[u]}px`:n[u]}):c(o)}),r}const Sv=b.forwardRef(function(e,r){const{id:n,invert:s,position:a="bottom-right",hotkey:i=["altKey","KeyT"],expand:o,closeButton:c,className:u,offset:f,mobileOffset:d,theme:m="light",richColors:p,duration:y,style:g,visibleToasts:x=hv,toastOptions:v,dir:S=vo(),gap:C=yv,icons:k,containerAriaLabel:w="Notifications"}=e,[j,T]=b.useState([]),A=b.useMemo(()=>n?j.filter(z=>z.toasterId===n):j.filter(z=>!z.toasterId),[j,n]),$=b.useMemo(()=>Array.from(new Set([a].concat(A.filter(z=>z.position).map(z=>z.position)))),[A,a]),[L,W]=b.useState([]),[B,G]=b.useState(!1),[Q,H]=b.useState(!1),[P,U]=b.useState(m!=="system"?m:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),V=b.useRef(null),ie=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),F=b.useRef(null),D=b.useRef(!1),ee=b.useCallback(z=>{T(oe=>{var ce;return(ce=oe.find(ve=>ve.id===z.id))!=null&&ce.delete||De.dismiss(z.id),oe.filter(({id:ve})=>ve!==z.id)})},[]);return b.useEffect(()=>De.subscribe(z=>{if(z.dismiss){requestAnimationFrame(()=>{T(oe=>oe.map(ce=>ce.id===z.id?{...ce,delete:!0}:ce))});return}setTimeout(()=>{ma.flushSync(()=>{T(oe=>{const ce=oe.findIndex(ve=>ve.id===z.id);return ce!==-1?[...oe.slice(0,ce),{...oe[ce],...z},...oe.slice(ce+1)]:[z,...oe]})})})}),[j]),b.useEffect(()=>{if(m!=="system"){U(m);return}if(m==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?U("dark"):U("light")),typeof window>"u")return;const z=window.matchMedia("(prefers-color-scheme: dark)");try{z.addEventListener("change",({matches:oe})=>{U(oe?"dark":"light")})}catch{z.addListener(({matches:ce})=>{try{U(ce?"dark":"light")}catch(ve){console.error(ve)}})}},[m]),b.useEffect(()=>{j.length<=1&&G(!1)},[j]),b.useEffect(()=>{const z=oe=>{var ce;if(i.every(le=>oe[le]||oe.code===le)){var Te;G(!0),(Te=V.current)==null||Te.focus()}oe.code==="Escape"&&(document.activeElement===V.current||(ce=V.current)!=null&&ce.contains(document.activeElement))&&G(!1)};return document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)},[i]),b.useEffect(()=>{if(V.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,D.current=!1)}},[V.current]),b.createElement("section",{ref:r,"aria-label":`${w} ${ie}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},$.map((z,oe)=>{var ce;const[ve,Te]=z.split("-");return A.length?b.createElement("ol",{key:z,dir:S==="auto"?vo():S,tabIndex:-1,ref:V,className:u,"data-sonner-toaster":!0,"data-sonner-theme":P,"data-y-position":ve,"data-x-position":Te,style:{"--front-toast-height":`${((ce=L[0])==null?void 0:ce.height)||0}px`,"--width":`${gv}px`,"--gap":`${C}px`,...g,...kv(f,d)},onBlur:le=>{D.current&&!le.currentTarget.contains(le.relatedTarget)&&(D.current=!1,F.current&&(F.current.focus({preventScroll:!0}),F.current=null))},onFocus:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||D.current||(D.current=!0,F.current=le.relatedTarget)},onMouseEnter:()=>G(!0),onMouseMove:()=>G(!0),onMouseLeave:()=>{Q||G(!1)},onDragEnd:()=>G(!1),onPointerDown:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||H(!0)},onPointerUp:()=>H(!1)},A.filter(le=>!le.position&&oe===0||le.position===z).map((le,vt)=>{var Yt,Gt;return b.createElement(wv,{key:le.id,icons:k,index:vt,toast:le,defaultRichColors:p,duration:(Yt=v?.duration)!=null?Yt:y,className:v?.className,descriptionClassName:v?.descriptionClassName,invert:s,visibleToasts:x,closeButton:(Gt=v?.closeButton)!=null?Gt:c,interacting:Q,position:z,style:v?.style,unstyled:v?.unstyled,classNames:v?.classNames,cancelButtonStyle:v?.cancelButtonStyle,actionButtonStyle:v?.actionButtonStyle,closeButtonAriaLabel:v?.closeButtonAriaLabel,removeToast:ee,toasts:A.filter(xt=>xt.position==le.position),heights:L.filter(xt=>xt.position==le.position),setHeights:W,expandByDefault:o,gap:C,expanded:B,swipeDirections:e.swipeDirections})})):null}))});function Nv({...t}){return l.jsx(Sv,{position:"bottom-right",richColors:!1,toastOptions:{classNames:{toast:"group toast rounded-xl bg-background text-foreground shadow-card-sm ring-1 ring-foreground/10",title:"text-sm font-medium",description:"text-sm text-muted-foreground",actionButton:"!h-8 !rounded-md !border-0 !bg-primary !px-2.5 !text-sm !font-medium !text-primary-foreground",cancelButton:"!h-8 !rounded-md !border !border-border !bg-background !px-2.5 !text-sm !font-medium !text-foreground hover:!bg-muted",error:"!bg-destructive/10 !text-foreground !ring-destructive/20",success:"!bg-primary/5 !text-foreground !ring-primary/15",warning:"!bg-amber-500/10 !text-foreground !ring-amber-500/20",info:"!bg-accent !text-accent-foreground !ring-foreground/10"}},...t})}const Cv=zt.Provider,_v=zt.Root,Tv=zt.Trigger,rd=b.forwardRef(({className:t,sideOffset:e=6,children:r,...n},s)=>l.jsx(zt.Portal,{children:l.jsxs(zt.Content,{ref:s,sideOffset:e,className:N("z-50 overflow-hidden rounded-md bg-foreground px-2.5 py-1 text-xs font-medium text-background shadow-card-sm","transition-[opacity,transform] duration-100","data-[state=closed]:opacity-0 data-[state=closed]:scale-95","data-[state=delayed-open]:opacity-100 data-[state=delayed-open]:scale-100",t),...n,children:[r,l.jsx(zt.Arrow,{className:"fill-foreground"})]})}));rd.displayName=zt.Content.displayName;const nd=({logo:t,children:e,footer:r,className:n})=>l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-gradient-to-br from-[--surface-1] via-[--surface-2] to-[--surface-1] px-4 py-12",children:l.jsxs("div",{className:N("w-full max-w-sm rounded-xl bg-[--surface-1] p-8","shadow-[var(--shadow-card-xl)] border border-[--border-1]","flex flex-col gap-6",n),children:[t&&l.jsx("div",{className:"flex justify-center",children:t.href?l.jsx("a",{href:t.href,className:"focus-visible:outline-none focus-visible:ring-2",children:l.jsx("img",{src:t.src,alt:t.alt,className:"h-10 w-auto"})}):l.jsx("img",{src:t.src,alt:t.alt,className:"h-10 w-auto"})}),l.jsx("div",{className:"flex flex-col gap-4",children:e}),r&&l.jsx("div",{className:"border-t border-[--border-1] pt-4 text-center text-xs text-[--text-2]",children:r})]})});nd.displayName="AuthLayout";function jv({items:t,className:e,separator:r,renderLink:n}){const s=r??l.jsx(J.ChevronRight,{className:"h-4 w-4 text-[color:var(--oniratec-label-secondary)]"});return l.jsx("nav",{"aria-label":"Breadcrumb",className:e,children:l.jsx("ol",{className:"flex flex-wrap items-center gap-2 text-sm",children:t.map((a,i)=>{const o=i===t.length-1,c=l.jsx("span",{className:N("transition-colors",o?"font-medium text-[color:var(--oniratec-label-primary)]":"text-[color:var(--oniratec-label-secondary)] hover:text-[color:var(--oniratec-label-primary)]"),children:a.label}),u="inline-flex items-center gap-1 rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--oniratec-focus)] focus-visible:ring-offset-2 focus-visible:ring-offset-[color:var(--oniratec-fill-primary)]";return l.jsxs("li",{className:"flex items-center gap-2",children:[o?l.jsx("span",{"aria-current":"page",children:c}):n?n({item:a,className:u,children:c}):a.href?l.jsx("a",{href:a.href,className:u,children:c}):l.jsx("button",{type:"button",onClick:a.onClick,className:u,children:c}),!o&&l.jsx("span",{"aria-hidden":"true",children:s})]},`${a.label}-${i}`)})})})}function Ev({open:t,onOpenChange:e,title:r,description:n,confirmLabel:s="Confirmar",cancelLabel:a="Cancelar",variant:i="default",onConfirm:o,loading:c=!1}){const u=async()=>{await o()};return l.jsx(bu,{open:t,onOpenChange:e,children:l.jsxs(Wa,{size:"sm",hideClose:!0,children:[l.jsxs(Za,{children:[l.jsx(Ua,{children:r}),n&&l.jsx(Ha,{children:n})]}),l.jsxs(Ba,{children:[l.jsx(Le,{variant:"secondary",onClick:()=>e(!1),disabled:c,children:a}),l.jsxs(Le,{variant:i==="destructive"?"destructive":"default",onClick:u,disabled:c,children:[c&&l.jsx(J.Loader2,{className:"h-4 w-4 animate-spin"}),s]})]})]})})}const xo="onira-sidebar-collapsed",Ov=({to:t,children:e,className:r,onClick:n})=>l.jsx("a",{href:t,className:r,onClick:n,children:e});function Dv({item:t,collapsed:e,LinkComponent:r,onMobileClose:n}){const s=r??Ov,a=t.icon;return l.jsxs(s,{to:t.to,end:t.end,className:N("group flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors","text-muted-foreground hover:bg-accent hover:text-accent-foreground","aria-[current=page]:bg-primary/10 aria-[current=page]:text-primary",e&&"justify-center px-2"),onClick:n,children:[a&&l.jsx(a,{className:N("h-4 w-4 shrink-0 transition-colors","group-[.active]:text-primary")}),!e&&l.jsx("span",{className:"flex-1 truncate",children:t.label}),!e&&t.badge!==void 0&&l.jsx(pa,{variant:"secondary",size:"sm",children:t.badge})]})}function bo({navSections:t,logo:e,appName:r,collapsed:n,LinkComponent:s,onMobileClose:a}){return l.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[l.jsxs("div",{className:N("flex h-14 items-center border-b border-border px-4 shrink-0",n?"justify-center px-2":"gap-2"),children:[e&&l.jsx("div",{className:"shrink-0",children:e}),!n&&r&&l.jsx("span",{className:"truncate text-sm font-semibold text-foreground",children:r})]}),l.jsx("nav",{className:"flex-1 overflow-y-auto px-2 py-3 space-y-4",children:t.map((i,o)=>l.jsxs("div",{className:"space-y-1",children:[!n&&i.title&&l.jsx("p",{className:"px-3 pb-1 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:i.title}),i.items.map(c=>l.jsx(Dv,{item:c,collapsed:n,LinkComponent:s,onMobileClose:a},c.to))]},o))})]})}function Rv({navSections:t,logo:e,appName:r,headerActions:n,children:s,LinkComponent:a}){const[i,o]=h.useState(()=>{try{return localStorage.getItem(xo)==="true"}catch{return!1}}),[c,u]=h.useState(!1),f=()=>{const d=!i;o(d);try{localStorage.setItem(xo,String(d))}catch{return}};return l.jsxs("div",{className:"flex h-screen overflow-hidden bg-background",children:[l.jsxs("aside",{className:N("hidden md:flex flex-col border-r border-border bg-card transition-all duration-200 relative",i?"w-14":"w-60"),children:[l.jsx(bo,{navSections:t,logo:e,appName:r,collapsed:i,LinkComponent:a}),l.jsx("button",{type:"button",onClick:f,className:N("absolute -right-3 top-16 z-10 flex h-6 w-6 items-center justify-center rounded-full border border-border bg-background text-muted-foreground shadow-card-sm transition-colors hover:bg-accent hover:text-accent-foreground"),"aria-label":i?"Expandir sidebar":"Colapsar sidebar",children:i?l.jsx(J.ChevronRight,{className:"h-3 w-3"}):l.jsx(J.ChevronLeft,{className:"h-3 w-3"})})]}),c&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 md:hidden",onClick:()=>u(!1)}),l.jsxs("div",{className:"fixed inset-y-0 left-0 z-50 w-72 bg-card shadow-card-xl md:hidden",children:[l.jsx("div",{className:"absolute right-3 top-3",children:l.jsx("button",{type:"button",onClick:()=>u(!1),className:"rounded-md p-1.5 text-muted-foreground hover:text-foreground",children:l.jsx(J.X,{className:"h-5 w-5"})})}),l.jsx(bo,{navSections:t,logo:e,appName:r,collapsed:!1,LinkComponent:a,onMobileClose:()=>u(!1)})]})]}),l.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[l.jsxs("header",{className:"flex h-14 shrink-0 items-center justify-between border-b border-border bg-card px-4 md:px-6",children:[l.jsx("button",{type:"button",className:"md:hidden rounded-md p-1.5 text-muted-foreground hover:text-foreground",onClick:()=>u(!0),"aria-label":"Abrir menú",children:l.jsx(J.Menu,{className:"h-5 w-5"})}),l.jsx("div",{className:"hidden md:block"}),n&&l.jsx("div",{className:"flex items-center gap-2",children:n})]}),l.jsx("main",{className:"flex-1 overflow-y-auto",children:s})]})]})}function wo(t){return t?Array.isArray(t)?t:[t]:[]}function Av(t,e){return t==null&&e==null?0:t==null?1:e==null?-1:typeof t=="number"&&typeof e=="number"?t-e:typeof t=="boolean"&&typeof e=="boolean"?Number(t)-Number(e):t instanceof Date&&e instanceof Date?t.getTime()-e.getTime():String(t).localeCompare(String(e),void 0,{numeric:!0,sensitivity:"base"})}function sd({columns:t,data:e,enableSorting:r=!0,sortState:n,defaultSortState:s=null,onSortChange:a,unsortedIcon:i="muted",sortMode:o="single",manualSorting:c=!1,emptyContent:u,loadingContent:f,errorContent:d,isLoading:m=!1}){const[p,y]=b.useState(s),g=n!==void 0?n:p,x=wo(g),v=b.useMemo(()=>new Map(t.map(w=>[w.key,w])),[t]),S=b.useMemo(()=>{if(c||!r||x.length===0)return e;const w=[...e];return w.sort((j,T)=>{for(const A of x){const $=v.get(A.columnId);if(!$)continue;const W=($.sortFn??((B,G)=>{const Q=$.sortValue?.(B)??B[$.key],H=$.sortValue?.(G)??G[$.key];return Av(Q,H)}))(j,T);if(W!==0)return A.direction==="asc"?W:-W}return 0}),w},[e,c,x,v,r]),C=w=>{n===void 0&&y(w),a?.(w)},k=(w,j)=>{if(!(r&&(w.sortable??!!(w.sortFn||w.sortValue))))return;const A=wo(g),$=A.find(W=>W.columnId===w.key),L=$?.direction==="asc"?"desc":$?.direction==="desc"?null:"asc";if(o==="multi"&&j){const W=A.filter(B=>B.columnId!==w.key);L&&W.push({columnId:w.key,direction:L}),C(W.length?W:null);return}if(!L){C(null);return}C({columnId:w.key,direction:L})};return l.jsx("div",{className:"oniratec-data-table",children:l.jsxs("table",{className:"oniratec-data-table__table",children:[l.jsx("thead",{className:"oniratec-data-table__head",children:l.jsx("tr",{className:"oniratec-data-table__head-row",children:t.map(w=>{const j=r&&(w.sortable??!!(w.sortFn||w.sortValue)),A=x.find(L=>L.columnId===w.key)?.direction,$=j?A==="asc"?"ascending":A==="desc"?"descending":"none":void 0;return l.jsx("th",{scope:"col","aria-sort":$,className:N("oniratec-data-table__th",w.headerClassName),children:j?l.jsxs("button",{type:"button",onClick:L=>k(w,L.shiftKey),className:"oniratec-data-table__sort-button",children:[l.jsx("span",{className:"flex-1",children:w.header}),l.jsxs("span",{className:N("oniratec-data-table__sort-icon",A&&"oniratec-data-table__sort-icon--active",!A&&i==="placeholder"&&"opacity-0",!A&&i==="hidden"&&"hidden"),"aria-hidden":"true",children:[A==="asc"&&l.jsx(J.ChevronUp,{className:"h-4 w-4"}),A==="desc"&&l.jsx(J.ChevronDown,{className:"h-4 w-4"}),!A&&i!=="hidden"&&l.jsx(J.ChevronsUpDown,{className:"h-4 w-4"})]})]}):w.header},w.key)})})}),l.jsx("tbody",{className:"oniratec-data-table__divider",children:d&&!m?l.jsx("tr",{children:l.jsx("td",{colSpan:t.length,className:"oniratec-data-table__empty",children:d})}):m?l.jsx("tr",{children:l.jsx("td",{colSpan:t.length,className:"oniratec-data-table__empty",children:f??"Cargando..."})}):S.length===0?l.jsx("tr",{children:l.jsx("td",{colSpan:t.length,className:"oniratec-data-table__empty",children:u??"No hay datos disponibles."})}):S.map((w,j)=>l.jsx("tr",{className:"oniratec-data-table__row",children:t.map(T=>l.jsx("td",{className:N("oniratec-data-table__td",T.className),children:T.render(w)},T.key))},j))})]})})}const Mv=[5,10,25,50],ad=({value:t,onChange:e,options:r=Mv})=>l.jsxs("div",{className:"flex items-center gap-2 text-[color:var(--oniratec-label-secondary)]",children:[l.jsx("span",{children:"Mostrar"}),l.jsxs(fs,{value:t.toString(),onValueChange:n=>{e(parseInt(n))},children:[l.jsx(Kr,{children:l.jsx(hs,{})}),l.jsx(Qr,{children:(r??[]).map(n=>l.jsx(en,{value:n.toString(),children:String(n)},n))})]}),l.jsx("span",{children:"por página"})]}),Iv=({page:t,pageSize:e,total:r,onPageChange:n,onPageSizeChange:s})=>{const a=Math.ceil(r/e);if(a<=1&&r<=e)return null;const i=t+1,o="rounded-md border border-[color:var(--border-1)] px-3 py-1 text-[color:var(--text-1)] transition-colors hover:bg-[color:color-mix(in srgb, var(--brand) 12%, transparent)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--focus)] disabled:opacity-50 disabled:cursor-not-allowed";return l.jsxs("div",{className:"mt-4 flex flex-wrap items-center justify-between gap-4 text-sm text-[color:var(--text-2)]",children:[l.jsxs("span",{children:["Página ",i," de ",a]}),l.jsx(ad,{value:e,onChange:s}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{disabled:t===0,onClick:()=>n(t-1),"aria-label":"Página anterior",className:o,children:"Anterior"}),l.jsx("button",{disabled:t+1>=a,onClick:()=>n(t+1),"aria-label":"Página siguiente",className:o,children:"Siguiente"})]})]})};function id({filters:t,value:e,onChange:r,onReset:n,resetLabel:s="Resetear filtros",showReset:a=!0,className:i,layout:o="inline",actions:c}){const u=(m,p)=>{r({...e,[m]:p})},f=a&&!!n,d=o==="stacked"?"grid gap-4":"grid gap-4 sm:grid-cols-2 lg:grid-cols-3";return l.jsxs("section",{className:N("rounded-xl border border-[color:var(--border-1)] bg-[color:var(--surface-2)] p-4 shadow-[var(--shadow-card-sm)]",i),children:[l.jsx("div",{className:d,children:t.map(m=>l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsxs("div",{className:"flex flex-col gap-1",children:[l.jsx("span",{className:"text-sm font-semibold text-[color:var(--text-1)]",children:m.label}),m.helperText&&l.jsx("span",{className:"text-xs text-[color:var(--text-2)]",children:m.helperText})]}),m.type==="text"&&l.jsx($r,{placeholder:m.placeholder,value:e[m.id]??"",onChange:p=>u(m.id,p.target.value),disabled:m.disabled}),m.type==="select"&&l.jsxs(fs,{value:e[m.id]??"",onValueChange:p=>u(m.id,p),disabled:m.disabled,children:[l.jsx(Kr,{children:l.jsx(hs,{placeholder:m.placeholder??"Seleccionar"})}),l.jsx(Qr,{children:m.options.map(p=>l.jsx(en,{value:p.value,children:p.label},p.value))})]}),m.type==="async-select"&&l.jsx(Ga,{value:e[m.id]??"",onValueChange:p=>u(m.id,p),placeholder:m.placeholder,searchPlaceholder:m.searchPlaceholder,minChars:m.minChars,debounceMs:m.debounceMs,fetcher:m.fetcher,getOptionLabel:m.getOptionLabel,getOptionValue:m.getOptionValue,emptyLabel:m.emptyLabel,loadingLabel:m.loadingLabel,emptyActionLabel:m.emptyActionLabel,onEmptyActionClick:m.onEmptyActionClick,disabled:m.disabled}),m.type==="toggle"&&l.jsx(tn,{checked:e[m.id]??!1,onChange:p=>u(m.id,p),disabled:m.disabled,ariaLabel:m.label,label:m.description}),m.type==="date"&&l.jsx(ns,{value:e[m.id]??null,onChange:p=>u(m.id,p??null),placeholder:m.placeholder,min:m.min,max:m.max,timeZone:m.timeZone,disabled:m.disabled})]},m.id))}),(f||c)&&l.jsxs("div",{className:"mt-4 flex flex-wrap items-center justify-between gap-3",children:[f&&l.jsx(Le,{type:"button",variant:"ghost",onClick:n,children:s}),c&&l.jsx("div",{className:"flex items-center gap-2",children:c})]})]})}function od({title:t="Filtros",description:e,children:r,isOpen:n,onOpenChange:s,onApply:a,applyLabel:i="Aplicar filtros",closeLabel:o="Cerrar",className:c}){const u=b.useId(),f=e?`${u}-description`:void 0,d=n,m=b.useCallback(p=>{s(p)},[s]);return b.useEffect(()=>{if(!d)return;const p=y=>{y.key==="Escape"&&m(!1)};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[d,m]),b.useEffect(()=>{if(!d)return;const p=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=p}},[d]),d?l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",children:l.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":u,"aria-describedby":f,className:N("w-full max-w-3xl rounded-2xl border border-[color:var(--border-1)] bg-[color:var(--surface-1)] p-6 shadow-[var(--shadow-card-lg)]",c),children:[l.jsxs("div",{className:"flex items-start justify-between gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx("h2",{id:u,className:"text-lg font-semibold text-[color:var(--text-1)]",children:t}),e&&l.jsx("p",{id:f,className:"text-sm text-[color:var(--text-2)]",children:e})]}),l.jsx("button",{type:"button",onClick:()=>m(!1),className:N("inline-flex h-9 w-9 items-center justify-center rounded-md","text-[color:var(--text-2)] transition-colors","hover:bg-[color:color-mix(in srgb, var(--brand) 12%, transparent)]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--focus)]"),"aria-label":o,children:l.jsx(J.X,{className:"h-4 w-4"})})]}),l.jsx("div",{className:"mt-6",children:r}),l.jsxs("div",{className:"mt-6 flex flex-wrap items-center justify-end gap-2",children:[l.jsx(Le,{type:"button",variant:"ghost",onClick:()=>m(!1),children:o}),l.jsx(Le,{type:"button",onClick:()=>{a?.(),m(!1)},children:i})]})]})}):null}const Pv=".csv,.xlsx";function Fv({title:t="Importar datos",description:e="Sube un fichero CSV o XLSX para ejecutar la importacion.",helperText:r="El sistema procesara cada fila de forma tolerante.",accept:n=Pv,className:s,actionLabel:a="Importar",disabled:i=!1,loading:o=!1,summary:c,onImport:u}){const[f,d]=b.useState([]),m=f[0]??null,p=b.useMemo(()=>c?`Resultado: ${c.created} creados, ${c.updated} actualizados, ${c.failed} fallidos`:null,[c]),y=async()=>{!m||i||o||await u(m)};return l.jsxs("section",{className:N("rounded-xl border border-slate-200 bg-white p-4 shadow-sm space-y-3",s),children:[l.jsxs("header",{className:"space-y-1",children:[l.jsx("h3",{className:"text-sm font-semibold text-slate-900",children:t}),l.jsx("p",{className:"text-sm text-slate-600",children:e})]}),l.jsx(us,{files:f,onFilesChange:d,multiple:!1,accept:n,helperText:r,allowDrop:!0,showPreview:!1,disabled:i||o}),p&&l.jsx("p",{className:"text-sm text-slate-700",children:p}),l.jsx("div",{className:"flex justify-end",children:l.jsx(Le,{type:"button",variant:"primary",onClick:()=>{y()},disabled:!m||i,loading:o,children:a})})]})}function Lv({title:t,value:e,delta:r,deltaLabel:n,icon:s,description:a,loading:i=!1,className:o}){const c=r!==void 0&&r>=0,u=r!==void 0&&r<0;return i?l.jsxs(zs,{className:N("p-6",o),children:[l.jsx(sa,{className:"mb-2 h-4 w-24"}),l.jsx(sa,{className:"h-8 w-32"})]}):l.jsxs(zs,{className:o,children:[l.jsx(Jo,{children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(Ko,{className:"text-sm font-medium text-muted-foreground",children:t}),s&&l.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-md bg-primary/10",children:l.jsx(s,{className:"h-4 w-4 text-primary"})})]})}),l.jsxs(Qo,{children:[l.jsx("div",{className:"text-2xl font-bold text-foreground",children:e}),(r!==void 0||a)&&l.jsxs("div",{className:"mt-1 flex items-center gap-1.5",children:[r!==void 0&&l.jsxs("span",{className:N("inline-flex items-center gap-0.5 text-xs font-medium",c&&"text-emerald-600",u&&"text-red-600"),children:[c?l.jsx(J.TrendingUp,{className:"h-3 w-3"}):l.jsx(J.TrendingDown,{className:"h-3 w-3"}),Math.abs(r),"%"]}),a&&l.jsx("p",{className:"text-xs text-muted-foreground",children:n??a})]})]})]})}function Vv({title:t,description:e,actions:r,className:n}){return l.jsxs("div",{className:N("flex items-start justify-between gap-4",n),children:[l.jsxs("div",{className:"flex flex-col gap-1",children:[l.jsx("h1",{className:"text-2xl font-semibold tracking-tight text-foreground",children:t}),e&&l.jsx("p",{className:"text-sm text-muted-foreground",children:e})]}),r&&l.jsx("div",{className:"flex shrink-0 items-center gap-2",children:r})]})}function $v({mode:t="light",theme:e="nova",children:r}){return b.useEffect(()=>{const n=document.documentElement;n.dataset.mode=t,n.dataset.theme=e,n.classList.toggle("dark",t==="dark"),n.style.colorScheme=t},[t,e]),r}var ne;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function r(s){throw new Error}t.assertNever=r,t.arrayToEnum=s=>{const a={};for(const i of s)a[i]=i;return a},t.getValidEnumValues=s=>{const a=t.objectKeys(s).filter(o=>typeof s[s[o]]!="number"),i={};for(const o of a)i[o]=s[o];return t.objectValues(i)},t.objectValues=s=>t.objectKeys(s).map(function(a){return s[a]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const a=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&a.push(i);return a},t.find=(s,a)=>{for(const i of s)if(a(i))return i},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,a=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}t.joinValues=n,t.jsonStringifyReplacer=(s,a)=>typeof a=="bigint"?a.toString():a})(ne||(ne={}));var ko;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(ko||(ko={}));const R=ne.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Nt=t=>{switch(typeof t){case"undefined":return R.undefined;case"string":return R.string;case"number":return Number.isNaN(t)?R.nan:R.number;case"boolean":return R.boolean;case"function":return R.function;case"bigint":return R.bigint;case"symbol":return R.symbol;case"object":return Array.isArray(t)?R.array:t===null?R.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?R.promise:typeof Map<"u"&&t instanceof Map?R.map:typeof Set<"u"&&t instanceof Set?R.set:typeof Date<"u"&&t instanceof Date?R.date:R.object;default:return R.unknown}},_=ne.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 yt extends Error{get errors(){return this.issues}constructor(e){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=e}format(e){const r=e||function(a){return a.message},n={_errors:[]},s=a=>{for(const i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let o=n,c=0;for(;c<i.path.length;){const u=i.path[c];c===i.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(r(i))):o[u]=o[u]||{_errors:[]},o=o[u],c++}}};return s(this),n}static assert(e){if(!(e instanceof yt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ne.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){const r={},n=[];for(const s of this.issues)if(s.path.length>0){const a=s.path[0];r[a]=r[a]||[],r[a].push(e(s))}else n.push(e(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}yt.create=t=>new yt(t);const ia=(t,e)=>{let r;switch(t.code){case _.invalid_type:t.received===R.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case _.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,ne.jsonStringifyReplacer)}`;break;case _.unrecognized_keys:r=`Unrecognized key(s) in object: ${ne.joinValues(t.keys,", ")}`;break;case _.invalid_union:r="Invalid input";break;case _.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${ne.joinValues(t.options)}`;break;case _.invalid_enum_value:r=`Invalid enum value. Expected ${ne.joinValues(t.options)}, received '${t.received}'`;break;case _.invalid_arguments:r="Invalid function arguments";break;case _.invalid_return_type:r="Invalid function return type";break;case _.invalid_date:r="Invalid date";break;case _.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:ne.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case _.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case _.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case _.custom:r="Invalid input";break;case _.invalid_intersection_types:r="Intersection results could not be merged";break;case _.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case _.not_finite:r="Number must be finite";break;default:r=e.defaultError,ne.assertNever(t)}return{message:r}};let zv=ia;function Wv(){return zv}const Zv=t=>{const{data:e,path:r,errorMaps:n,issueData:s}=t,a=[...r,...s.path||[]],i={...s,path:a};if(s.message!==void 0)return{...s,path:a,message:s.message};let o="";const c=n.filter(u=>!!u).slice().reverse();for(const u of c)o=u(i,{data:e,defaultError:o}).message;return{...s,path:a,message:o}};function O(t,e){const r=Wv(),n=Zv({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===ia?void 0:ia].filter(s=>!!s)});t.common.issues.push(n)}class Ve{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){const n=[];for(const s of r){if(s.status==="aborted")return q;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){const n=[];for(const s of r){const a=await s.key,i=await s.value;n.push({key:a,value:i})}return Ve.mergeObjectSync(e,n)}static mergeObjectSync(e,r){const n={};for(const s of r){const{key:a,value:i}=s;if(a.status==="aborted"||i.status==="aborted")return q;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||s.alwaysSet)&&(n[a.value]=i.value)}return{status:e.value,value:n}}}const q=Object.freeze({status:"aborted"}),Mr=t=>({status:"dirty",value:t}),Ue=t=>({status:"valid",value:t}),So=t=>t.status==="aborted",No=t=>t.status==="dirty",yr=t=>t.status==="valid",Ln=t=>typeof Promise<"u"&&t instanceof Promise;var M;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(M||(M={}));class Dt{constructor(e,r,n,s){this._cachedPath=[],this.parent=e,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 Co=(t,e)=>{if(yr(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new yt(t.common.issues);return this._error=r,this._error}}};function K(t){if(!t)return{};const{errorMap:e,invalid_type_error:r,required_error:n,description:s}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(i,o)=>{const{message:c}=t;return i.code==="invalid_enum_value"?{message:c??o.defaultError}:typeof o.data>"u"?{message:c??n??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:c??r??o.defaultError}},description:s}}class re{get description(){return this._def.description}_getType(e){return Nt(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Nt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ve,ctx:{common:e.parent.common,data:e.data,parsedType:Nt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(Ln(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){const r=this._parse(e);return Promise.resolve(r)}parse(e,r){const n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){const n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Nt(e)},s=this._parseSync({data:e,path:n.path,parent:n});return Co(n,s)}"~validate"(e){const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Nt(e)};if(!this["~standard"].async)try{const n=this._parseSync({data:e,path:[],parent:r});return yr(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>yr(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){const n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){const n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Nt(e)},s=this._parse({data:e,path:n.path,parent:n}),a=await(Ln(s)?s:Promise.resolve(s));return Co(n,a)}refine(e,r){const n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,a)=>{const i=e(s),o=()=>a.addIssue({code:_.custom,...n(s)});return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,r){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(e){return new xr({schema:this,typeName:Y.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Tt.create(this,this._def)}nullable(){return br.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ct.create(this)}promise(){return Wn.create(this,this._def)}or(e){return $n.create([this,e],this._def)}and(e){return zn.create(this,e,this._def)}transform(e){return new xr({...K(this._def),schema:this,typeName:Y.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new ca({...K(this._def),innerType:this,defaultValue:r,typeName:Y.ZodDefault})}brand(){return new fx({typeName:Y.ZodBranded,type:this,...K(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new ua({...K(this._def),innerType:this,catchValue:r,typeName:Y.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Ka.create(this,e)}readonly(){return da.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Bv=/^c[^\s-]{8,}$/i,Uv=/^[0-9a-z]+$/,Hv=/^[0-9A-HJKMNP-TV-Z]{26}$/i,qv=/^[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,Yv=/^[a-z0-9_-]{21}$/i,Gv=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Xv=/^[-+]?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)?)??$/,Jv=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Kv="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ls;const Qv=/^(?:(?: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])$/,ex=/^(?:(?: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])$/,tx=/^(([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]))$/,rx=/^(([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])$/,nx=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,sx=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ld="((\\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])))",ax=new RegExp(`^${ld}$`);function cd(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function ix(t){return new RegExp(`^${cd(t)}$`)}function ox(t){let e=`${ld}T${cd(t)}`;const r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function lx(t,e){return!!((e==="v4"||!e)&&Qv.test(t)||(e==="v6"||!e)&&tx.test(t))}function cx(t,e){if(!Gv.test(t))return!1;try{const[r]=t.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?.typ!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function ux(t,e){return!!((e==="v4"||!e)&&ex.test(t)||(e==="v6"||!e)&&rx.test(t))}class $t extends re{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==R.string){const a=this._getOrReturnCtx(e);return O(a,{code:_.invalid_type,expected:R.string,received:a.parsedType}),q}const n=new Ve;let s;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(s=this._getOrReturnCtx(e,s),O(s,{code:_.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")e.data.length>a.value&&(s=this._getOrReturnCtx(e,s),O(s,{code:_.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){const i=e.data.length>a.value,o=e.data.length<a.value;(i||o)&&(s=this._getOrReturnCtx(e,s),i?O(s,{code:_.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&O(s,{code:_.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")Jv.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"email",code:_.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")Ls||(Ls=new RegExp(Kv,"u")),Ls.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"emoji",code:_.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")qv.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"uuid",code:_.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")Yv.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"nanoid",code:_.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")Bv.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"cuid",code:_.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")Uv.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"cuid2",code:_.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")Hv.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"ulid",code:_.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),O(s,{validation:"url",code:_.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"regex",code:_.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(s=this._getOrReturnCtx(e,s),O(s,{code:_.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(s=this._getOrReturnCtx(e,s),O(s,{code:_.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(s=this._getOrReturnCtx(e,s),O(s,{code:_.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?ox(a).test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{code:_.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?ax.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{code:_.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?ix(a).test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{code:_.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?Xv.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"duration",code:_.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?lx(e.data,a.version)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"ip",code:_.invalid_string,message:a.message}),n.dirty()):a.kind==="jwt"?cx(e.data,a.alg)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"jwt",code:_.invalid_string,message:a.message}),n.dirty()):a.kind==="cidr"?ux(e.data,a.version)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"cidr",code:_.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?nx.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"base64",code:_.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?sx.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"base64url",code:_.invalid_string,message:a.message}),n.dirty()):ne.assertNever(a);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(s=>e.test(s),{validation:r,code:_.invalid_string,...M.errToObj(n)})}_addCheck(e){return new $t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...M.errToObj(e)})}url(e){return this._addCheck({kind:"url",...M.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...M.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...M.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...M.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...M.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...M.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...M.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...M.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...M.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...M.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...M.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...M.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...M.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...M.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...M.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...M.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...M.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...M.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...M.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...M.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...M.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...M.errToObj(r)})}nonempty(e){return this.min(1,M.errToObj(e))}trim(){return new $t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new $t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new $t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}$t.create=t=>new $t({checks:[],typeName:Y.ZodString,coerce:t?.coerce??!1,...K(t)});function dx(t,e){const r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,s=r>n?r:n,a=Number.parseInt(t.toFixed(s).replace(".","")),i=Number.parseInt(e.toFixed(s).replace(".",""));return a%i/10**s}class zr extends re{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==R.number){const a=this._getOrReturnCtx(e);return O(a,{code:_.invalid_type,expected:R.number,received:a.parsedType}),q}let n;const s=new Ve;for(const a of this._def.checks)a.kind==="int"?ne.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),O(n,{code:_.invalid_type,expected:"integer",received:"float",message:a.message}),s.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),O(n,{code:_.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),O(n,{code:_.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="multipleOf"?dx(e.data,a.value)!==0&&(n=this._getOrReturnCtx(e,n),O(n,{code:_.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),O(n,{code:_.not_finite,message:a.message}),s.dirty()):ne.assertNever(a);return{status:s.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,M.toString(r))}gt(e,r){return this.setLimit("min",e,!1,M.toString(r))}lte(e,r){return this.setLimit("max",e,!0,M.toString(r))}lt(e,r){return this.setLimit("max",e,!1,M.toString(r))}setLimit(e,r,n,s){return new zr({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:M.toString(s)}]})}_addCheck(e){return new zr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:M.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:M.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:M.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:M.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:M.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:M.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:M.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:M.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:M.toString(e)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ne.isInteger(e.value))}get isFinite(){let e=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"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}}zr.create=t=>new zr({checks:[],typeName:Y.ZodNumber,coerce:t?.coerce||!1,...K(t)});class Wr extends re{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==R.bigint)return this._getInvalidInput(e);let n;const s=new Ve;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),O(n,{code:_.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),O(n,{code:_.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),O(n,{code:_.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):ne.assertNever(a);return{status:s.value,value:e.data}}_getInvalidInput(e){const r=this._getOrReturnCtx(e);return O(r,{code:_.invalid_type,expected:R.bigint,received:r.parsedType}),q}gte(e,r){return this.setLimit("min",e,!0,M.toString(r))}gt(e,r){return this.setLimit("min",e,!1,M.toString(r))}lte(e,r){return this.setLimit("max",e,!0,M.toString(r))}lt(e,r){return this.setLimit("max",e,!1,M.toString(r))}setLimit(e,r,n,s){return new Wr({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:M.toString(s)}]})}_addCheck(e){return new Wr({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:M.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:M.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:M.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:M.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:M.toString(r)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}Wr.create=t=>new Wr({checks:[],typeName:Y.ZodBigInt,coerce:t?.coerce??!1,...K(t)});class _o extends re{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==R.boolean){const n=this._getOrReturnCtx(e);return O(n,{code:_.invalid_type,expected:R.boolean,received:n.parsedType}),q}return Ue(e.data)}}_o.create=t=>new _o({typeName:Y.ZodBoolean,coerce:t?.coerce||!1,...K(t)});class Vn extends re{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==R.date){const a=this._getOrReturnCtx(e);return O(a,{code:_.invalid_type,expected:R.date,received:a.parsedType}),q}if(Number.isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return O(a,{code:_.invalid_date}),q}const n=new Ve;let s;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(s=this._getOrReturnCtx(e,s),O(s,{code:_.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(s=this._getOrReturnCtx(e,s),O(s,{code:_.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):ne.assertNever(a);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Vn({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:M.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:M.toString(r)})}get minDate(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}}Vn.create=t=>new Vn({checks:[],coerce:t?.coerce||!1,typeName:Y.ZodDate,...K(t)});class To extends re{_parse(e){if(this._getType(e)!==R.symbol){const n=this._getOrReturnCtx(e);return O(n,{code:_.invalid_type,expected:R.symbol,received:n.parsedType}),q}return Ue(e.data)}}To.create=t=>new To({typeName:Y.ZodSymbol,...K(t)});class jo extends re{_parse(e){if(this._getType(e)!==R.undefined){const n=this._getOrReturnCtx(e);return O(n,{code:_.invalid_type,expected:R.undefined,received:n.parsedType}),q}return Ue(e.data)}}jo.create=t=>new jo({typeName:Y.ZodUndefined,...K(t)});class Eo extends re{_parse(e){if(this._getType(e)!==R.null){const n=this._getOrReturnCtx(e);return O(n,{code:_.invalid_type,expected:R.null,received:n.parsedType}),q}return Ue(e.data)}}Eo.create=t=>new Eo({typeName:Y.ZodNull,...K(t)});class oa extends re{constructor(){super(...arguments),this._any=!0}_parse(e){return Ue(e.data)}}oa.create=t=>new oa({typeName:Y.ZodAny,...K(t)});class Oo extends re{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ue(e.data)}}Oo.create=t=>new Oo({typeName:Y.ZodUnknown,...K(t)});class Rt extends re{_parse(e){const r=this._getOrReturnCtx(e);return O(r,{code:_.invalid_type,expected:R.never,received:r.parsedType}),q}}Rt.create=t=>new Rt({typeName:Y.ZodNever,...K(t)});class Do extends re{_parse(e){if(this._getType(e)!==R.undefined){const n=this._getOrReturnCtx(e);return O(n,{code:_.invalid_type,expected:R.void,received:n.parsedType}),q}return Ue(e.data)}}Do.create=t=>new Do({typeName:Y.ZodVoid,...K(t)});class ct extends re{_parse(e){const{ctx:r,status:n}=this._processInputParams(e),s=this._def;if(r.parsedType!==R.array)return O(r,{code:_.invalid_type,expected:R.array,received:r.parsedType}),q;if(s.exactLength!==null){const i=r.data.length>s.exactLength.value,o=r.data.length<s.exactLength.value;(i||o)&&(O(r,{code:i?_.too_big:_.too_small,minimum:o?s.exactLength.value:void 0,maximum:i?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&&(O(r,{code:_.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&&(O(r,{code:_.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((i,o)=>s.type._parseAsync(new Dt(r,i,r.path,o)))).then(i=>Ve.mergeArray(n,i));const a=[...r.data].map((i,o)=>s.type._parseSync(new Dt(r,i,r.path,o)));return Ve.mergeArray(n,a)}get element(){return this._def.type}min(e,r){return new ct({...this._def,minLength:{value:e,message:M.toString(r)}})}max(e,r){return new ct({...this._def,maxLength:{value:e,message:M.toString(r)}})}length(e,r){return new ct({...this._def,exactLength:{value:e,message:M.toString(r)}})}nonempty(e){return this.min(1,e)}}ct.create=(t,e)=>new ct({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Y.ZodArray,...K(e)});function or(t){if(t instanceof ye){const e={};for(const r in t.shape){const n=t.shape[r];e[r]=Tt.create(or(n))}return new ye({...t._def,shape:()=>e})}else return t instanceof ct?new ct({...t._def,type:or(t.element)}):t instanceof Tt?Tt.create(or(t.unwrap())):t instanceof br?br.create(or(t.unwrap())):t instanceof Ut?Ut.create(t.items.map(e=>or(e))):t}class ye extends re{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),r=ne.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==R.object){const u=this._getOrReturnCtx(e);return O(u,{code:_.invalid_type,expected:R.object,received:u.parsedType}),q}const{status:n,ctx:s}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof Rt&&this._def.unknownKeys==="strip"))for(const u in s.data)i.includes(u)||o.push(u);const c=[];for(const u of i){const f=a[u],d=s.data[u];c.push({key:{status:"valid",value:u},value:f._parse(new Dt(s,d,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof Rt){const u=this._def.unknownKeys;if(u==="passthrough")for(const f of o)c.push({key:{status:"valid",value:f},value:{status:"valid",value:s.data[f]}});else if(u==="strict")o.length>0&&(O(s,{code:_.unrecognized_keys,keys:o}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const f of o){const d=s.data[f];c.push({key:{status:"valid",value:f},value:u._parse(new Dt(s,d,s.path,f)),alwaysSet:f in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const u=[];for(const f of c){const d=await f.key,m=await f.value;u.push({key:d,value:m,alwaysSet:f.alwaysSet})}return u}).then(u=>Ve.mergeObjectSync(n,u)):Ve.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return M.errToObj,new ye({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{const s=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:M.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new ye({...this._def,unknownKeys:"strip"})}passthrough(){return new ye({...this._def,unknownKeys:"passthrough"})}extend(e){return new ye({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ye({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Y.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new ye({...this._def,catchall:e})}pick(e){const r={};for(const n of ne.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new ye({...this._def,shape:()=>r})}omit(e){const r={};for(const n of ne.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new ye({...this._def,shape:()=>r})}deepPartial(){return or(this)}partial(e){const r={};for(const n of ne.objectKeys(this.shape)){const s=this.shape[n];e&&!e[n]?r[n]=s:r[n]=s.optional()}return new ye({...this._def,shape:()=>r})}required(e){const r={};for(const n of ne.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof Tt;)a=a._def.innerType;r[n]=a}return new ye({...this._def,shape:()=>r})}keyof(){return ud(ne.objectKeys(this.shape))}}ye.create=(t,e)=>new ye({shape:()=>t,unknownKeys:"strip",catchall:Rt.create(),typeName:Y.ZodObject,...K(e)});ye.strictCreate=(t,e)=>new ye({shape:()=>t,unknownKeys:"strict",catchall:Rt.create(),typeName:Y.ZodObject,...K(e)});ye.lazycreate=(t,e)=>new ye({shape:t,unknownKeys:"strip",catchall:Rt.create(),typeName:Y.ZodObject,...K(e)});class $n extends re{_parse(e){const{ctx:r}=this._processInputParams(e),n=this._def.options;function s(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;const i=a.map(o=>new yt(o.ctx.common.issues));return O(r,{code:_.invalid_union,unionErrors:i}),q}if(r.common.async)return Promise.all(n.map(async a=>{const i={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}})).then(s);{let a;const i=[];for(const c of n){const u={...r,common:{...r.common,issues:[]},parent:null},f=c._parseSync({data:r.data,path:r.path,parent:u});if(f.status==="valid")return f;f.status==="dirty"&&!a&&(a={result:f,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(c=>new yt(c));return O(r,{code:_.invalid_union,unionErrors:o}),q}}get options(){return this._def.options}}$n.create=(t,e)=>new $n({options:t,typeName:Y.ZodUnion,...K(e)});function la(t,e){const r=Nt(t),n=Nt(e);if(t===e)return{valid:!0,data:t};if(r===R.object&&n===R.object){const s=ne.objectKeys(e),a=ne.objectKeys(t).filter(o=>s.indexOf(o)!==-1),i={...t,...e};for(const o of a){const c=la(t[o],e[o]);if(!c.valid)return{valid:!1};i[o]=c.data}return{valid:!0,data:i}}else if(r===R.array&&n===R.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let a=0;a<t.length;a++){const i=t[a],o=e[a],c=la(i,o);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return r===R.date&&n===R.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class zn extends re{_parse(e){const{status:r,ctx:n}=this._processInputParams(e),s=(a,i)=>{if(So(a)||So(i))return q;const o=la(a.value,i.value);return o.valid?((No(a)||No(i))&&r.dirty(),{status:r.value,value:o.data}):(O(n,{code:_.invalid_intersection_types}),q)};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(([a,i])=>s(a,i)):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}))}}zn.create=(t,e,r)=>new zn({left:t,right:e,typeName:Y.ZodIntersection,...K(r)});class Ut extends re{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==R.array)return O(n,{code:_.invalid_type,expected:R.array,received:n.parsedType}),q;if(n.data.length<this._def.items.length)return O(n,{code:_.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),q;!this._def.rest&&n.data.length>this._def.items.length&&(O(n,{code:_.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const a=[...n.data].map((i,o)=>{const c=this._def.items[o]||this._def.rest;return c?c._parse(new Dt(n,i,n.path,o)):null}).filter(i=>!!i);return n.common.async?Promise.all(a).then(i=>Ve.mergeArray(r,i)):Ve.mergeArray(r,a)}get items(){return this._def.items}rest(e){return new Ut({...this._def,rest:e})}}Ut.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ut({items:t,typeName:Y.ZodTuple,rest:null,...K(e)})};class Ro extends re{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==R.map)return O(n,{code:_.invalid_type,expected:R.map,received:n.parsedType}),q;const s=this._def.keyType,a=this._def.valueType,i=[...n.data.entries()].map(([o,c],u)=>({key:s._parse(new Dt(n,o,n.path,[u,"key"])),value:a._parse(new Dt(n,c,n.path,[u,"value"]))}));if(n.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const c of i){const u=await c.key,f=await c.value;if(u.status==="aborted"||f.status==="aborted")return q;(u.status==="dirty"||f.status==="dirty")&&r.dirty(),o.set(u.value,f.value)}return{status:r.value,value:o}})}else{const o=new Map;for(const c of i){const u=c.key,f=c.value;if(u.status==="aborted"||f.status==="aborted")return q;(u.status==="dirty"||f.status==="dirty")&&r.dirty(),o.set(u.value,f.value)}return{status:r.value,value:o}}}}Ro.create=(t,e,r)=>new Ro({valueType:e,keyType:t,typeName:Y.ZodMap,...K(r)});class Zr extends re{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==R.set)return O(n,{code:_.invalid_type,expected:R.set,received:n.parsedType}),q;const s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(O(n,{code:_.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&&(O(n,{code:_.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());const a=this._def.valueType;function i(c){const u=new Set;for(const f of c){if(f.status==="aborted")return q;f.status==="dirty"&&r.dirty(),u.add(f.value)}return{status:r.value,value:u}}const o=[...n.data.values()].map((c,u)=>a._parse(new Dt(n,c,n.path,u)));return n.common.async?Promise.all(o).then(c=>i(c)):i(o)}min(e,r){return new Zr({...this._def,minSize:{value:e,message:M.toString(r)}})}max(e,r){return new Zr({...this._def,maxSize:{value:e,message:M.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}Zr.create=(t,e)=>new Zr({valueType:t,minSize:null,maxSize:null,typeName:Y.ZodSet,...K(e)});class Ao extends re{get schema(){return this._def.getter()}_parse(e){const{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}Ao.create=(t,e)=>new Ao({getter:t,typeName:Y.ZodLazy,...K(e)});class Mo extends re{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return O(r,{received:r.data,code:_.invalid_literal,expected:this._def.value}),q}return{status:"valid",value:e.data}}get value(){return this._def.value}}Mo.create=(t,e)=>new Mo({value:t,typeName:Y.ZodLiteral,...K(e)});function ud(t,e){return new vr({values:t,typeName:Y.ZodEnum,...K(e)})}class vr extends re{_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),n=this._def.values;return O(r,{expected:ne.joinValues(n),received:r.parsedType,code:_.invalid_type}),q}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const r=this._getOrReturnCtx(e),n=this._def.values;return O(r,{received:r.data,code:_.invalid_enum_value,options:n}),q}return Ue(e.data)}get options(){return this._def.values}get enum(){const e={};for(const r of this._def.values)e[r]=r;return e}get Values(){const e={};for(const r of this._def.values)e[r]=r;return e}get Enum(){const e={};for(const r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return vr.create(e,{...this._def,...r})}exclude(e,r=this._def){return vr.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}}vr.create=ud;class Io extends re{_parse(e){const r=ne.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==R.string&&n.parsedType!==R.number){const s=ne.objectValues(r);return O(n,{expected:ne.joinValues(s),received:n.parsedType,code:_.invalid_type}),q}if(this._cache||(this._cache=new Set(ne.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const s=ne.objectValues(r);return O(n,{received:n.data,code:_.invalid_enum_value,options:s}),q}return Ue(e.data)}get enum(){return this._def.values}}Io.create=(t,e)=>new Io({values:t,typeName:Y.ZodNativeEnum,...K(e)});class Wn extends re{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==R.promise&&r.common.async===!1)return O(r,{code:_.invalid_type,expected:R.promise,received:r.parsedType}),q;const n=r.parsedType===R.promise?r.data:Promise.resolve(r.data);return Ue(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}}Wn.create=(t,e)=>new Wn({type:t,typeName:Y.ZodPromise,...K(e)});class xr extends re{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Y.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:r,ctx:n}=this._processInputParams(e),s=this._def.effect||null,a={addIssue:i=>{O(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),s.type==="preprocess"){const i=s.transform(n.data,a);if(n.common.async)return Promise.resolve(i).then(async o=>{if(r.value==="aborted")return q;const c=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return c.status==="aborted"?q:c.status==="dirty"||r.value==="dirty"?Mr(c.value):c});{if(r.value==="aborted")return q;const o=this._def.schema._parseSync({data:i,path:n.path,parent:n});return o.status==="aborted"?q:o.status==="dirty"||r.value==="dirty"?Mr(o.value):o}}if(s.type==="refinement"){const i=o=>{const c=s.refinement(o,a);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 o};if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?q:(o.status==="dirty"&&r.dirty(),i(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?q:(o.status==="dirty"&&r.dirty(),i(o.value).then(()=>({status:r.value,value:o.value}))))}if(s.type==="transform")if(n.common.async===!1){const i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!yr(i))return q;const o=s.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>yr(i)?Promise.resolve(s.transform(i.value,a)).then(o=>({status:r.value,value:o})):q);ne.assertNever(s)}}xr.create=(t,e,r)=>new xr({schema:t,typeName:Y.ZodEffects,effect:e,...K(r)});xr.createWithPreprocess=(t,e,r)=>new xr({schema:e,effect:{type:"preprocess",transform:t},typeName:Y.ZodEffects,...K(r)});class Tt extends re{_parse(e){return this._getType(e)===R.undefined?Ue(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Tt.create=(t,e)=>new Tt({innerType:t,typeName:Y.ZodOptional,...K(e)});class br extends re{_parse(e){return this._getType(e)===R.null?Ue(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}br.create=(t,e)=>new br({innerType:t,typeName:Y.ZodNullable,...K(e)});class ca extends re{_parse(e){const{ctx:r}=this._processInputParams(e);let n=r.data;return r.parsedType===R.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}ca.create=(t,e)=>new ca({innerType:t,typeName:Y.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...K(e)});class ua extends re{_parse(e){const{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Ln(s)?s.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new yt(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new yt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}ua.create=(t,e)=>new ua({innerType:t,typeName:Y.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...K(e)});class Po extends re{_parse(e){if(this._getType(e)!==R.nan){const n=this._getOrReturnCtx(e);return O(n,{code:_.invalid_type,expected:R.nan,received:n.parsedType}),q}return{status:"valid",value:e.data}}}Po.create=t=>new Po({typeName:Y.ZodNaN,...K(t)});class fx extends re{_parse(e){const{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class Ka extends re{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?q:a.status==="dirty"?(r.dirty(),Mr(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?q:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,r){return new Ka({in:e,out:r,typeName:Y.ZodPipeline})}}class da extends re{_parse(e){const r=this._def.innerType._parse(e),n=s=>(yr(s)&&(s.value=Object.freeze(s.value)),s);return Ln(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}}da.create=(t,e)=>new da({innerType:t,typeName:Y.ZodReadonly,...K(e)});var Y;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Y||(Y={}));const hx=oa.create;Rt.create;ct.create;const mx=ye.create;$n.create;zn.create;Ut.create;vr.create;Wn.create;Tt.create;br.create;function px(t){const e=[];for(const r of t.sections)for(const n of r.fields)Array.isArray(n)?e.push(...n):e.push(n);return e}function gx(t){const e={};for(const n of t.sections)for(const s of n.fields){const a=Array.isArray(s)?s:[s];for(const i of a)e[i.name]=i.schema??hx().optional()}let r=mx(e);return t.crossRules?.length&&(r=r.superRefine((n,s)=>{for(const a of t.crossRules)a(n,s)})),r}function yx(t,e){const r=t.defaultValues?.(e)??{},n=px(t),s={...r};for(const a of n)a.defaultValue!==void 0&&s[a.name]===void 0&&(s[a.name]=a.defaultValue);return s}var vx=t=>t.type==="checkbox",Ir=t=>t instanceof Date,Qa=t=>t==null;const dd=t=>typeof t=="object";var Ht=t=>!Qa(t)&&!Array.isArray(t)&&dd(t)&&!Ir(t),xx=t=>Ht(t)&&t.target?vx(t.target)?t.target.checked:t.target.value:t,bx=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,wx=(t,e)=>t.has(bx(e)),kx=t=>{const e=t.constructor&&t.constructor.prototype;return Ht(e)&&e.hasOwnProperty("isPrototypeOf")},Sx=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function fd(t){if(t instanceof Date)return new Date(t);const e=typeof FileList<"u"&&t instanceof FileList;if(Sx&&(t instanceof Blob||e))return t;const r=Array.isArray(t);if(!r&&!(Ht(t)&&kx(t)))return t;const n=r?[]:Object.create(Object.getPrototypeOf(t));for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[s]=fd(t[s]));return n}var hd=t=>/^\w*$/.test(t),fa=t=>t===void 0,Nx=t=>Array.isArray(t)?t.filter(Boolean):[],md=t=>Nx(t.replace(/["|']|\]/g,"").split(/\.|\[/)),Oe=(t,e,r)=>{if(!e||!Ht(t))return r;const n=(hd(e)?[e]:md(e)).reduce((s,a)=>Qa(s)?s:s[a],t);return fa(n)||n===t?fa(t[e])?r:t[e]:n},Vs=t=>typeof t=="boolean",vn=t=>typeof t=="function",Fo=(t,e,r)=>{let n=-1;const s=hd(e)?[e]:md(e),a=s.length,i=a-1;for(;++n<a;){const o=s[n];let c=r;if(n!==i){const u=t[o];c=Ht(u)||Array.isArray(u)?u:isNaN(+s[n+1])?{}:[]}if(o==="__proto__"||o==="constructor"||o==="prototype")return;t[o]=c,t=t[o]}};const Lo={BLUR:"blur",CHANGE:"change"},Vo={all:"all"},ei=b.createContext(null);ei.displayName="HookFormContext";const ti=()=>b.useContext(ei),Cx=t=>{const{children:e,...r}=t;return b.createElement(ei.Provider,{value:r},e)};var _x=(t,e,r,n=!0)=>{const s={defaultValues:e._defaultValues};for(const a in t)Object.defineProperty(s,a,{get:()=>{const i=a;return e._proxyFormState[i]!==Vo.all&&(e._proxyFormState[i]=!n||Vo.all),r&&(r[i]=!0),t[i]}});return s};const pd=typeof window<"u"?b.useLayoutEffect:b.useEffect;function Tx(t){const e=ti(),{control:r=e.control,disabled:n,name:s,exact:a}=t||{},[i,o]=b.useState(r._formState),c=b.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return pd(()=>r._subscribe({name:s,formState:c.current,exact:a,callback:u=>{!n&&o({...r._formState,...u})}}),[s,n,a]),b.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),b.useMemo(()=>_x(i,r,c.current,!1),[i,r])}var jx=t=>typeof t=="string",$o=(t,e,r,n,s)=>jx(t)?Oe(r,t,s):Array.isArray(t)?t.map(a=>Oe(r,a)):r,zo=t=>Qa(t)||!dd(t);function _n(t,e,r=new WeakSet){if(zo(t)||zo(e))return Object.is(t,e);if(Ir(t)&&Ir(e))return Object.is(t.getTime(),e.getTime());const n=Object.keys(t),s=Object.keys(e);if(n.length!==s.length)return!1;if(r.has(t)||r.has(e))return!0;r.add(t),r.add(e);for(const a of n){const i=t[a];if(!s.includes(a))return!1;if(a!=="ref"){const o=e[a];if(Ir(i)&&Ir(o)||Ht(i)&&Ht(o)||Array.isArray(i)&&Array.isArray(o)?!_n(i,o,r):!Object.is(i,o))return!1}}return!0}function gd(t){const e=ti(),{control:r=e.control,name:n,defaultValue:s,disabled:a,exact:i,compute:o}=t||{},c=b.useRef(s),u=b.useRef(o),f=b.useRef(void 0),d=b.useRef(r),m=b.useRef(n);u.current=o;const[p,y]=b.useState(()=>{const k=r._getWatch(n,c.current);return u.current?u.current(k):k}),g=b.useCallback(k=>{const w=$o(n,r._names,k||r._formValues,!1,c.current);return u.current?u.current(w):w},[r._formValues,r._names,n]),x=b.useCallback(k=>{if(!a){const w=$o(n,r._names,k||r._formValues,!1,c.current);if(u.current){const j=u.current(w);_n(j,f.current)||(y(j),f.current=j)}else y(w)}},[r._formValues,r._names,a,n]);pd(()=>((d.current!==r||!_n(m.current,n))&&(d.current=r,m.current=n,x()),r._subscribe({name:n,formState:{values:!0},exact:i,callback:k=>{x(k.values)}})),[r,i,n,x]),b.useEffect(()=>r._removeUnmounted());const v=d.current!==r,S=m.current,C=b.useMemo(()=>{if(a)return null;const k=!v&&!_n(S,n);return v||k?g():null},[a,v,n,S,g]);return C!==null?C:p}function Ex(t){const e=ti(),{name:r,disabled:n,control:s=e.control,shouldUnregister:a,defaultValue:i,exact:o=!0}=t,c=wx(s._names.array,r),u=b.useMemo(()=>Oe(s._formValues,r,Oe(s._defaultValues,r,i)),[s,r,i]),f=gd({control:s,name:r,defaultValue:u,exact:o}),d=Tx({control:s,name:r,exact:o}),m=b.useRef(t),p=b.useRef(void 0),y=b.useRef(s.register(r,{...t.rules,value:f,...Vs(t.disabled)?{disabled:t.disabled}:{}}));m.current=t;const g=b.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Oe(d.errors,r)},isDirty:{enumerable:!0,get:()=>!!Oe(d.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!Oe(d.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!Oe(d.validatingFields,r)},error:{enumerable:!0,get:()=>Oe(d.errors,r)}}),[d,r]),x=b.useCallback(k=>y.current.onChange({target:{value:xx(k),name:r},type:Lo.CHANGE}),[r]),v=b.useCallback(()=>y.current.onBlur({target:{value:Oe(s._formValues,r),name:r},type:Lo.BLUR}),[r,s._formValues]),S=b.useCallback(k=>{const w=Oe(s._fields,r);w&&w._f&&k&&(w._f.ref={focus:()=>vn(k.focus)&&k.focus(),select:()=>vn(k.select)&&k.select(),setCustomValidity:j=>vn(k.setCustomValidity)&&k.setCustomValidity(j),reportValidity:()=>vn(k.reportValidity)&&k.reportValidity()})},[s._fields,r]),C=b.useMemo(()=>({name:r,value:f,...Vs(n)||d.disabled?{disabled:d.disabled||n}:{},onChange:x,onBlur:v,ref:S}),[r,n,d.disabled,x,v,S,f]);return b.useEffect(()=>{const k=s._options.shouldUnregister||a,w=p.current;w&&w!==r&&!c&&s.unregister(w),s.register(r,{...m.current.rules,...Vs(m.current.disabled)?{disabled:m.current.disabled}:{}});const j=(T,A)=>{const $=Oe(s._fields,T);$&&$._f&&($._f.mount=A)};if(j(r,!0),k){const T=fd(Oe(s._options.defaultValues,r,m.current.defaultValue));Fo(s._defaultValues,r,T),fa(Oe(s._formValues,r))&&Fo(s._formValues,r,T)}return!c&&s.register(r),p.current=r,()=>{(c?k&&!s._state.action:k)?s.unregister(r):j(r,!1)}},[r,s,c,a]),b.useEffect(()=>{s._setDisabledField({disabled:n,name:r})},[n,r,s]),b.useMemo(()=>({field:C,formState:d,fieldState:g}),[C,d,g])}const Ox=t=>t.render(Ex(t));function Dx({form:t,field:e}){const[r,n]=b.useState(!1);return l.jsx(Ox,{control:t.control,name:e.name,render:({field:s,fieldState:{error:a}})=>{const i=u=>e.normalize?e.normalize(u):u,o=()=>{e.deps?.onChangeTrigger&&t.trigger(e.deps.onChangeTrigger)},c={className:e.className,error:a?.message,required:!e.schema?.isOptional?.()};switch(e.kind){case"custom":if(!e.render)throw new Error(`Field ${e.name} marked as custom but has no render function`);return l.jsx("div",{className:e.className,children:e.render({form:t})});case"input":return l.jsxs(st,{...c,children:[l.jsx(at,{children:e.label}),l.jsx(Xe,{children:l.jsx($r,{type:"text",placeholder:e.placeholder,value:s.value??"",onChange:u=>{s.onChange(i(u.target.value)),o()},onBlur:s.onBlur})}),l.jsx(Je,{})]});case"password":return l.jsxs(st,{...c,children:[l.jsx(at,{children:e.label}),l.jsx(Xe,{children:l.jsxs("div",{className:"relative flex w-full items-center",children:[l.jsx($r,{type:r?"text":"password",placeholder:e.placeholder,value:s.value??"",className:"pr-10",onChange:u=>{const f=u.target.value;s.onChange(i(f)),o()},onBlur:s.onBlur}),l.jsx(Le,{type:"button",variant:"ghost",className:"absolute right-3 flex items-center justify-center text-slate-400 hover:text-slate-600 focus:outline-none",onClick:()=>n(!r),tabIndex:-1,children:r?l.jsx(J.EyeOff,{className:"h-4 w-4"}):l.jsx(J.Eye,{className:"h-4 w-4"})})]})}),l.jsx(Je,{})]});case"textarea":return l.jsxs(st,{...c,children:[l.jsx(at,{children:e.label}),l.jsx(Xe,{children:l.jsx("textarea",{className:"oniratec-field__textarea",value:s.value??"",placeholder:e.placeholder,rows:4,onChange:u=>{s.onChange(i(u.target.value)),o()},onBlur:s.onBlur})}),l.jsx(Je,{})]});case"select":return l.jsxs(st,{...c,children:[l.jsx(at,{children:e.label}),l.jsx(Xe,{children:l.jsxs(fs,{value:s.value||void 0,onValueChange:u=>{s.onChange(i(u||void 0)),o()},children:[l.jsx(Kr,{children:l.jsx(hs,{})}),l.jsx(Qr,{children:(e.options??[]).map(u=>l.jsx(en,{value:String(u.value),children:u.label},u.value))})]})}),l.jsx(Je,{})]});case"asyncSelect":return l.jsxs(st,{...c,children:[l.jsx(at,{children:e.label}),l.jsx(Xe,{children:l.jsx(Ga,{value:s.value||void 0,onValueChange:u=>{s.onChange(i(u)),o()},placeholder:e.placeholder,searchPlaceholder:e.searchPlaceholder,minChars:e.minChars,debounceMs:e.debounceMs,fetcher:e.fetcher,getOptionValue:e.getOptionValue,getOptionLabel:e.getOptionLabel,emptyLabel:e.emptyLabel,emptyActionLabel:e.emptyActionLabel,onEmptyActionClick:e.onEmptyActionClick,hasError:!!a?.message})}),l.jsx(Je,{})]});case"toggle":return l.jsxs(st,{...c,children:[l.jsx(at,{children:e.label}),l.jsx(Xe,{children:l.jsx(tn,{checked:!!s.value,onChange:u=>{s.onChange(i(u)),o()}})}),l.jsx(Je,{})]});case"checkbox":return l.jsxs(st,{...c,children:[l.jsx(Xe,{children:l.jsxs("label",{className:"oniratec-checkbox",children:[l.jsx("input",{type:"checkbox",checked:!!s.value,onChange:u=>{s.onChange(i(u.target.checked)),o()},onBlur:s.onBlur}),l.jsx("span",{children:e.label})]})}),l.jsx(Je,{})]});case"date":return l.jsxs(st,{...c,children:[l.jsx(at,{children:e.label}),l.jsx(Xe,{children:l.jsx(ns,{value:s.value,onChange:u=>{s.onChange(i(u)),o()},placeholder:e.placeholder,min:e.min,max:e.max,timeZone:e.timeZone,isInvalid:!!a?.message})}),l.jsx(Je,{})]});case"fileUpload":{const u=Array.isArray(s.value)?s.value:[];return l.jsxs(st,{...c,children:[l.jsx(at,{children:e.label}),l.jsx(Xe,{children:l.jsx(us,{files:u,onFilesChange:f=>{s.onChange(i(f)),o()},accept:e.accept,multiple:e.multiple,helperText:e.helperText,allowDrop:e.allowDrop,placeholder:e.placeholder,defaultPreviewUrl:e.defaultPreviewUrl})}),l.jsx(Je,{})]})}}}})}function Rx(t){return Array.isArray(t)?t:[t]}function yd({config:t,form:e,onSubmitAction:r,handleErrors:n,submitLabel:s,maxWidthClass:a,children:i}){const o=gd({control:e.control});return l.jsx(Cx,{...e,children:l.jsxs("form",{onSubmit:e.handleSubmit(r,c=>n(c)),className:N("space-y-8",a),children:[t.sections.map((c,u)=>l.jsxs(b.Fragment,{children:[l.jsxs("section",{className:"space-y-4",children:[l.jsx("h3",{className:"oniratec-form__section-title",children:c.title}),l.jsx("div",{className:"space-y-4",children:c.fields.map((f,d)=>{const m=Rx(f).filter(g=>!g.hidden?.(o));if(!m.length)return null;const p=m.reduce((g,x)=>g+(x.colSpan??1),0),y=p>1?N("grid gap-4",p===2&&"grid-cols-2",p===3&&"grid-cols-3",p===4&&"grid-cols-4"):"";return l.jsx("div",{className:y,children:m.map(g=>l.jsx("div",{className:g.colSpan?`col-span-${g.colSpan}`:void 0,children:l.jsx(Dx,{form:e,field:g})},g.name))},d)})})]},c.title),u<t.sections.length-1&&l.jsx(b.Fragment,{children:l.jsx("hr",{className:"oniratec-form__separator"})})]},`fragment-${c.title}`)),i,l.jsx("div",{className:"oniratec-form__actions",children:l.jsx(Le,{type:"submit",loading:e.formState.isSubmitting,children:s})})]})})}function Ax(t){return l.jsx(yd,{...t})}const Mx=t=>t==="center"?"text-center":t==="right"?"text-right":"text-left",Ix=t=>{if(t)return typeof t=="number"?`w-[${t}px]`:t.startsWith("w-")?t:`w-[${t}]`},Px=t=>t?Array.isArray(t)?t:[t]:[];function vd(t){return{columns:t.columns.map(n=>{const s=Mx(n.align),a=Ix(n.width),i=[s,a,n.className].filter(Boolean).join(" "),o=[s,a,n.headerClassName].filter(Boolean).join(" ");return{key:n.id,header:n.header,render:n.cell??(c=>String(n.accessor?.(c)??"")),className:i||void 0,headerClassName:o||void 0,sortable:n.sortable??!!(n.sortFn||n.accessor),sortFn:n.sortFn,sortValue:n.accessor}}),getSortDirection:(n,s)=>Px(n).find(o=>o.columnId===s)?.direction??null}}function Fx(t,e,r){const{columns:n}=vd(t);return l.jsx(sd,{columns:n,data:e,...r})}const Lx=t=>t.reduce((e,r)=>r.type==="toggle"?(e[r.id]=r.value??!1,e):r.type==="date"?(e[r.id]=r.value??null,e):(e[r.id]=r.value??"",e),{});function Vx(t){const e=Lx(t.filters),r=(a,i,o)=>({...a,[i]:o}),n=()=>({...e}),s=a=>t.buildQueryParams?t.buildQueryParams(a):a;return{filters:t.filters,initialState:e,updateFilter:r,resetState:n,buildQueryParams:s}}function xd(t,e,r,n){return l.jsx(id,{filters:t.filters,value:e,onChange:r,onReset:n?.onReset,resetLabel:n?.resetLabel,showReset:n?.showReset,className:n?.className,layout:n?.layout,actions:n?.actions})}function $x(t,e,r,n){return l.jsx(od,{title:n.title,description:n.description,isOpen:n.isOpen,onOpenChange:n.onOpenChange,onApply:n.onApply,applyLabel:n.applyLabel,closeLabel:n.closeLabel,className:n.className,children:xd(t,e,r,n.panel)})}function zx(t,e,r){const n=new Set(t.filter(s=>s.type==="date").map(s=>s.id));return Object.entries(e).reduce((s,[a,i])=>i==null?(s[a]=void 0,s):n.has(a)&&i instanceof Date?(s[a]=eu(i,r?.timeZone)??void 0,s):(s[a]=i,s),{})}function Wx(...t){return Wo.twMerge(ha.clsx(t))}exports.Alert=tl;exports.AlertDescription=nl;exports.AlertTitle=rl;exports.AsyncSelect=Ga;exports.AuthLayout=nd;exports.Badge=pa;exports.Box=Qd;exports.Breadcrumbs=jv;exports.Button=Le;exports.Card=zs;exports.CardAction=lf;exports.CardContent=Qo;exports.CardDescription=of;exports.CardFooter=cf;exports.CardHeader=Jo;exports.CardTitle=Ko;exports.Checkbox=al;exports.ConfirmDialog=Ev;exports.DEFAULT_TIME_ZONE=In;exports.DashboardLayout=Rv;exports.DataTable=sd;exports.DatePicker=ns;exports.Dialog=bu;exports.DialogClose=wy;exports.DialogContent=Wa;exports.DialogDescription=Ha;exports.DialogFooter=Ba;exports.DialogHeader=Za;exports.DialogOverlay=za;exports.DialogPortal=wu;exports.DialogTitle=Ua;exports.DialogTrigger=by;exports.DropdownMenu=Sy;exports.DropdownMenuCheckboxItem=Nu;exports.DropdownMenuContent=ku;exports.DropdownMenuGroup=Cy;exports.DropdownMenuItem=Su;exports.DropdownMenuLabel=_u;exports.DropdownMenuPortal=_y;exports.DropdownMenuRadioGroup=jy;exports.DropdownMenuRadioItem=Cu;exports.DropdownMenuSeparator=Tu;exports.DropdownMenuShortcut=Ou;exports.DropdownMenuSub=Ty;exports.DropdownMenuSubContent=Eu;exports.DropdownMenuSubTrigger=ju;exports.DropdownMenuTrigger=Ny;exports.Field=st;exports.FieldControl=Xe;exports.FieldLabel=at;exports.FieldMessage=Je;exports.FilePicker=Dy;exports.FileUpload=us;exports.FiltersModal=od;exports.FiltersPanel=id;exports.FormFactoryRenderer=yd;exports.ImportFileCard=Fv;exports.Input=$r;exports.Kbd=Au;exports.KpiCard=Lv;exports.Logo=af;exports.NotFoundState=Ry;exports.PageHeader=Vv;exports.PageSizeSelector=ad;exports.Pagination=Iv;exports.PasswordInput=Ru;exports.PersonAvatar=Jd;exports.ProfileAvatar=Kd;exports.Progress=Mu;exports.RadioGroup=My;exports.RadioGroupItem=Pu;exports.Select=fs;exports.SelectContent=Qr;exports.SelectGroup=Iy;exports.SelectItem=en;exports.SelectLabel=Fu;exports.SelectScrollDownButton=Ya;exports.SelectScrollUpButton=qa;exports.SelectSeparator=Lu;exports.SelectTrigger=Kr;exports.SelectValue=hs;exports.Separator=Vu;exports.Sheet=Fy;exports.SheetClose=Vy;exports.SheetContent=zu;exports.SheetDescription=Uu;exports.SheetFooter=Zu;exports.SheetHeader=Wu;exports.SheetOverlay=Xa;exports.SheetPortal=$u;exports.SheetTitle=Bu;exports.SheetTrigger=Ly;exports.Skeleton=sa;exports.Switch=Gy;exports.Tabs=zy;exports.TabsContent=Xu;exports.TabsList=Yu;exports.TabsTrigger=Gu;exports.Textarea=Hu;exports.ThemeProvider=$v;exports.Toaster=Nv;exports.Toggle=tn;exports.Tooltip=_v;exports.TooltipContent=rd;exports.TooltipProvider=Cv;exports.TooltipTrigger=Tv;exports.alertVariants=el;exports.badgeVariants=sl;exports.buildDefaultValues=yx;exports.buildFiltersQueryParams=zx;exports.buildZodSchema=gx;exports.buttonVariants=Xo;exports.cn=Wx;exports.createFiltersFactory=Vx;exports.createTableFactory=vd;exports.isValidTimeZone=Pn;exports.renderFiltersModal=$x;exports.renderFiltersPanel=xd;exports.renderFormFactory=Ax;exports.renderTable=Fx;exports.resolveTimeZone=Jr;exports.setDefaultTimeZone=ny;exports.toDateTime=sy;exports.toISODate=eu;exports.toISODateTime=ay;exports.toast=fv;exports.useField=ds;
45
+ For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return h.useEffect(()=>{t&&(document.getElementById(t)||console.error(r))},[r,t]),null},vy="DialogDescriptionWarning",xy=({contentRef:t,descriptionId:e})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${gu(vy).contentName}}.`;return h.useEffect(()=>{const s=t.current?.getAttribute("aria-describedby");e&&s&&(document.getElementById(e)||console.warn(n))},[n,t,e]),null},yu=ru,vu=su,xu=iu,as=ou,is=lu,os=uu,ls=fu,cs=mu;const bu=yu,by=vu,wu=xu,wy=cs,za=h.forwardRef(({className:t,...e},r)=>l.jsx(as,{ref:r,className:N("fixed inset-0 isolate z-50 bg-black/10 backdrop-blur-[2px] transition-opacity duration-100","data-[state=closed]:opacity-0 data-[state=open]:opacity-100",t),...e}));za.displayName=as.displayName;const ky={sm:"sm:max-w-sm",md:"sm:max-w-md",lg:"sm:max-w-lg",xl:"sm:max-w-xl","2xl":"sm:max-w-2xl",full:"sm:max-w-full"},Wa=h.forwardRef(({className:t,children:e,hideClose:r,size:n="md",...s},a)=>l.jsxs(wu,{children:[l.jsx(za,{}),l.jsxs(is,{ref:a,className:N("fixed left-1/2 top-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-background p-4 text-sm","ring-1 ring-foreground/10 shadow-card-lg outline-none transition-[opacity,transform] duration-100",ky[n],"data-[state=closed]:opacity-0 data-[state=closed]:scale-95","data-[state=open]:opacity-100 data-[state=open]:scale-100",t),...s,children:[e,!r&&l.jsx(cs,{asChild:!0,children:l.jsxs(Le,{variant:"ghost",size:"icon-sm",className:"absolute right-2 top-2","aria-label":"Cerrar",children:[l.jsx(J.X,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Cerrar"})]})})]})]}));Wa.displayName=is.displayName;const Za=({className:t,...e})=>l.jsx("div",{className:N("flex flex-col gap-2",t),...e});Za.displayName="DialogHeader";const Ba=({className:t,...e})=>l.jsx("div",{className:N("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",t),...e});Ba.displayName="DialogFooter";const Ua=h.forwardRef(({className:t,...e},r)=>l.jsx(os,{ref:r,className:N("text-base font-medium leading-none text-foreground",t),...e}));Ua.displayName=os.displayName;const Ha=h.forwardRef(({className:t,...e},r)=>l.jsx(ls,{ref:r,className:N("text-sm text-muted-foreground",t),...e}));Ha.displayName=ls.displayName;const Sy=fe.Root,Ny=fe.Trigger,Cy=fe.Group,_y=fe.Portal,Ty=fe.Sub,jy=fe.RadioGroup,ku=h.forwardRef(({className:t,sideOffset:e=6,...r},n)=>l.jsx(fe.Portal,{children:l.jsx(fe.Content,{ref:n,sideOffset:e,className:N("z-50 min-w-[10rem] overflow-hidden rounded-lg bg-popover p-1 text-popover-foreground shadow-card-sm ring-1 ring-foreground/10 outline-none","transition-[opacity,transform] duration-100","data-[state=closed]:opacity-0 data-[state=closed]:scale-95","data-[state=open]:opacity-100 data-[state=open]:scale-100",t),...r})}));ku.displayName=fe.Content.displayName;const Su=h.forwardRef(({className:t,inset:e,icon:r,destructive:n,children:s,...a},i)=>l.jsxs(fe.Item,{ref:i,className:N("relative flex cursor-default select-none items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-none transition-colors","focus:bg-accent focus:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e&&"pl-8",n&&"text-destructive focus:bg-destructive/10 focus:text-destructive",t),...a,children:[r&&l.jsx("span",{className:"h-4 w-4 shrink-0 [&>svg]:h-4 [&>svg]:w-4",children:r}),s]}));Su.displayName=fe.Item.displayName;const Nu=h.forwardRef(({className:t,children:e,checked:r,...n},s)=>l.jsxs(fe.CheckboxItem,{ref:s,className:N("relative flex cursor-default select-none items-center gap-1.5 rounded-md py-1 pl-1.5 pr-8 text-sm outline-none transition-colors","focus:bg-accent focus:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:r,...n,children:[l.jsx("span",{className:"absolute right-2 flex h-4 w-4 items-center justify-center",children:l.jsx(fe.ItemIndicator,{children:l.jsx(J.Check,{className:"h-4 w-4"})})}),e]}));Nu.displayName=fe.CheckboxItem.displayName;const Cu=h.forwardRef(({className:t,children:e,...r},n)=>l.jsxs(fe.RadioItem,{ref:n,className:N("relative flex cursor-default select-none items-center gap-1.5 rounded-md py-1 pl-1.5 pr-8 text-sm outline-none transition-colors","focus:bg-accent focus:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...r,children:[l.jsx("span",{className:"absolute right-2 flex h-4 w-4 items-center justify-center",children:l.jsx(fe.ItemIndicator,{children:l.jsx(J.Circle,{className:"h-2.5 w-2.5 fill-current"})})}),e]}));Cu.displayName=fe.RadioItem.displayName;const _u=h.forwardRef(({className:t,inset:e,...r},n)=>l.jsx(fe.Label,{ref:n,className:N("px-1.5 py-1 text-xs font-medium text-muted-foreground",e&&"pl-8",t),...r}));_u.displayName=fe.Label.displayName;const Tu=h.forwardRef(({className:t,...e},r)=>l.jsx(fe.Separator,{ref:r,className:N("-mx-1 my-1 h-px bg-border",t),...e}));Tu.displayName=fe.Separator.displayName;const ju=h.forwardRef(({className:t,inset:e,children:r,...n},s)=>l.jsxs(fe.SubTrigger,{ref:s,className:N("flex cursor-default select-none items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-none transition-colors","focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",e&&"pl-8",t),...n,children:[r,l.jsx(J.ChevronRight,{className:"ml-auto h-4 w-4"})]}));ju.displayName=fe.SubTrigger.displayName;const Eu=h.forwardRef(({className:t,...e},r)=>l.jsx(fe.SubContent,{ref:r,className:N("z-50 min-w-[8rem] overflow-hidden rounded-lg bg-popover p-1 text-popover-foreground shadow-card-sm ring-1 ring-foreground/10 outline-none","transition-[opacity,transform] duration-100","data-[state=closed]:opacity-0 data-[state=closed]:scale-95","data-[state=open]:opacity-100 data-[state=open]:scale-100",t),...e}));Eu.displayName=fe.SubContent.displayName;const Ou=({className:t,...e})=>l.jsx("span",{className:N("ml-auto text-xs tracking-widest text-muted-foreground",t),...e});Ou.displayName="DropdownMenuShortcut";const Ey="Arrastra y suelta archivos aquí o selecciona desde tu dispositivo.",Oy=t=>{if(t===0)return"0 B";const e=1024,r=["B","KB","MB","GB","TB"],n=Math.floor(Math.log(t)/Math.log(e));return`${(t/Math.pow(e,n)).toFixed(n===0?0:1)} ${r[n]}`},ir=t=>`${t.name}-${t.size}-${t.lastModified}`,go=t=>t.type.startsWith("image/");function us({label:t,helperText:e,error:r,disabled:n=!1,multiple:s=!1,accept:a,files:i,defaultFiles:o=[],onFilesChange:c,id:u,name:f,allowDrop:d=!1,placeholder:m=Ey,showPreview:p=!0,previewMode:y="auto",maxPreviewItems:g=4,defaultPreviewUrl:x}){const v=b.useId(),S=u??v,C=e?`${S}-helper`:void 0,k=r?`${S}-error`:void 0,w=[C,k].filter(Boolean).join(" ")||void 0,j=b.useRef(null),[T,A]=b.useState(o),[$,L]=b.useState(!1),W=i!==void 0,B=W?i:T,G=F=>{const D=s?F:F.slice(0,1);W||A(D),c?.(D)},Q=F=>{if(!s)return F.slice(0,1);const D=new Map(B.map(ee=>[ir(ee),ee]));for(const ee of F)D.set(ir(ee),ee);return Array.from(D.values())},H=F=>{const D=Array.from(F.target.files??[]);G(s?Q(D):D),F.target.value=""},P=F=>{G(B.filter(D=>ir(D)!==ir(F)))},U=F=>{if(!d||n)return;F.preventDefault(),L(!1);const D=Array.from(F.dataTransfer.files??[]);D.length!==0&&G(s?Q(D):D)},V=b.useMemo(()=>{if(!p)return[];const F=B.slice(0,g);return y==="image"||y==="auto"&&F.some(ee=>go(ee))?F.filter(ee=>go(ee)).map(ee=>({key:ir(ee),file:ee,url:URL.createObjectURL(ee)})):[]},[B,g,y,p]);b.useEffect(()=>()=>{for(const F of V)URL.revokeObjectURL(F.url)},[V]);const ie=!!x&&B.length===0;return l.jsxs("div",{className:N("flex flex-col gap-2",n&&"pointer-events-none opacity-60"),children:[t&&l.jsx("label",{htmlFor:S,className:"text-sm font-medium text-foreground",children:t}),l.jsx("input",{ref:j,id:S,name:f,type:"file",className:"sr-only",disabled:n,multiple:s,accept:a,"aria-invalid":r?"true":void 0,"aria-describedby":w,onChange:H}),l.jsxs("button",{type:"button",disabled:n,className:N("flex min-h-44 flex-col items-center justify-center gap-3 rounded-xl border border-dashed border-border bg-card px-6 py-8 text-center","transition-[border-color,background-color,box-shadow,transform] hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px",d&&"cursor-pointer",$&&"border-ring bg-muted",r&&"border-destructive focus-visible:ring-destructive/20"),onClick:()=>j.current?.click(),onDragOver:F=>{!d||n||(F.preventDefault(),L(!0))},onDragLeave:()=>d&&L(!1),onDrop:U,children:[l.jsx(J.UploadCloud,{className:"h-8 w-8 text-muted-foreground"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-foreground",children:s?"Seleccionar archivos":"Seleccionar archivo"}),l.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:m}),a&&l.jsxs("p",{className:"mt-0.5 text-xs text-muted-foreground",children:["Acepta: ",a]})]})]}),ie&&l.jsx("div",{className:"mt-2 flex gap-2",children:l.jsx("div",{className:"h-16 w-16 overflow-hidden rounded-lg bg-muted ring-1 ring-foreground/10",children:l.jsx("img",{src:x,alt:"Logo actual",className:"h-full w-full object-cover"})})}),V.length>0&&l.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:V.map(F=>l.jsx("div",{className:"h-16 w-16 overflow-hidden rounded-lg bg-muted ring-1 ring-foreground/10",children:l.jsx("img",{src:F.url,alt:F.file.name,className:"h-full w-full object-cover"})},F.key))}),e&&!r&&l.jsx("p",{id:C,className:"text-xs text-muted-foreground",children:e}),r&&l.jsx("p",{id:k,className:"text-xs text-destructive",children:r}),B.length>0&&l.jsx("ul",{className:"mt-2 flex flex-col gap-1",children:B.map(F=>l.jsxs("li",{className:"flex items-center justify-between gap-2 rounded-lg bg-muted/40 px-3 py-2 ring-1 ring-foreground/10",children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l.jsx(J.FileIcon,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:F.name}),l.jsx("p",{className:"text-xs text-muted-foreground",children:Oy(F.size)})]})]}),l.jsx("button",{type:"button",className:"shrink-0 rounded-md p-1 text-muted-foreground transition-colors hover:bg-background hover:text-foreground focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50",onClick:()=>P(F),"aria-label":`Eliminar ${F.name}`,children:l.jsx(J.X,{className:"h-4 w-4"})})]},ir(F)))})]})}const Dy=us,Du=h.createContext(null);function ds(){const t=h.useContext(Du);if(!t)throw new Error("Field components must be used inside <Field>");return t}function st({className:t,error:e,required:r,...n}){const s=h.useId();return l.jsx(Du.Provider,{value:{id:s,error:e,required:r},children:l.jsx("div",{className:N("flex flex-col gap-1.5",t),...n})})}const Xe=b.forwardRef((t,e)=>{const{id:r,error:n}=ds();return l.jsx(Go,{ref:e,id:r,"aria-invalid":!!n,...t})});Xe.displayName="FieldControl";const at=h.forwardRef(({className:t,children:e,...r},n)=>{const{id:s,required:a}=ds();return l.jsxs("label",{ref:n,htmlFor:s,className:N("text-sm font-medium text-foreground leading-none",t),...r,children:[e,a&&l.jsx("span",{className:"ml-0.5 text-destructive",children:"*"})]})});at.displayName="FieldLabel";const Je=h.forwardRef(({className:t,children:e,...r},n)=>{const{error:s}=ds(),a=s??e;return a?l.jsx("p",{ref:n,className:N("text-xs",s?"text-destructive":"text-muted-foreground",t),...r,children:a}):null});Je.displayName="FieldMessage";const Ru=b.forwardRef(({className:t,containerClassName:e,isInvalid:r,...n},s)=>{const[a,i]=b.useState(!1);return l.jsxs("div",{className:N("relative",e),children:[l.jsx("input",{ref:s,type:a?"text":"password","aria-invalid":r||void 0,className:N("flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 pr-10 text-sm text-foreground shadow-sm transition-colors","placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1","disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-muted",r&&"border-destructive focus-visible:ring-destructive",t),...n}),l.jsx("button",{type:"button",className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",onClick:()=>i(o=>!o),children:a?l.jsx(J.EyeOff,{className:"h-4 w-4"}):l.jsx(J.EyeIcon,{className:"h-4 w-4"})})]})});Ru.displayName="PasswordInput";const $r=h.forwardRef(({className:t,isInvalid:e,"aria-invalid":r,...n},s)=>{const a=e??(r===!0||r==="true");return l.jsx("input",{ref:s,"aria-invalid":a||void 0,className:N("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-sm text-foreground transition-[border-color,box-shadow,color,background-color] outline-none","file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground","placeholder:text-muted-foreground","focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50","disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50","dark:bg-input/30 dark:disabled:bg-input/80",a&&"border-destructive focus-visible:border-destructive focus-visible:ring-destructive/20 dark:border-destructive/50 dark:focus-visible:ring-destructive/40",t),...n})});$r.displayName="Input";const Au=h.forwardRef(({className:t,...e},r)=>l.jsx("kbd",{ref:r,className:N("inline-flex min-h-6 items-center rounded-md border border-border bg-muted px-1.5 font-mono text-[11px] font-medium text-muted-foreground shadow-sm",t),...e}));Au.displayName="Kbd";const Ry=({lottieJson:t,title:e,description:r,actionLabel:n,onAction:s,fallbackIcon:a})=>l.jsxs("div",{className:"flex w-full flex-col items-center justify-center text-center",children:[t?l.jsx("div",{className:"mb-4 w-1/2",children:l.jsx(Rd,{animationData:t,loop:!0})}):a&&l.jsx("div",{className:"mb-4 text-[color:var(--oniratec-label-secondary)]",children:a}),l.jsx("h2",{className:"mb-2 text-lg font-semibold text-[color:var(--oniratec-label-primary)]",children:e}),r&&l.jsx("p",{className:"mb-6 max-w-md text-sm text-[color:var(--oniratec-label-secondary)]",children:r}),n&&s&&l.jsx(Le,{size:"md",onClick:s,children:n})]}),Mu=h.forwardRef(({className:t,indicatorClassName:e,max:r=100,value:n=0,...s},a)=>{const i=r>0?r:100,o=n==null?0:Math.min(Math.max(n,0),i),c=`${o/i*100}%`;return l.jsx("div",{ref:a,role:"progressbar","aria-valuemin":0,"aria-valuemax":i,"aria-valuenow":n==null?void 0:o,className:N("h-2 w-full overflow-hidden rounded-full bg-muted ring-1 ring-foreground/10",t),...s,children:l.jsx("div",{className:N("h-full rounded-full bg-primary transition-[width] duration-300",e),style:{width:c}})})});Mu.displayName="Progress";const Iu=h.createContext(null);function Ay(){const t=h.useContext(Iu);if(!t)throw new Error("RadioGroupItem must be used inside <RadioGroup>.");return t}function My({className:t,defaultValue:e,disabled:r,name:n,onValueChange:s,orientation:a="vertical",required:i,value:o,...c}){const u=h.useId(),[f,d]=h.useState(e),m=o!==void 0,p=m?o:f,y=h.useCallback(g=>{m||d(g),s?.(g)},[m,s]);return l.jsx(Iu.Provider,{value:{disabled:r,name:n??u,onValueChange:y,orientation:a,required:i,value:p},children:l.jsx("div",{role:"radiogroup","aria-required":i,"data-orientation":a,className:N("flex gap-3",a==="horizontal"?"flex-row flex-wrap items-center":"flex-col",t),...c})})}const Pu=h.forwardRef(({className:t,description:e,disabled:r,id:n,label:s,size:a="md",value:i,"aria-describedby":o,"aria-invalid":c,onChange:u,...f},d)=>{const m=h.useId(),p=n??m,y=e?`${p}-description`:void 0,g=c===!0||c==="true",x=Ay(),v=x.value===i,S=x.disabled||r;return l.jsxs("label",{htmlFor:p,className:N("inline-flex w-fit items-start gap-2.5 text-sm",S&&"cursor-not-allowed opacity-60",t),children:[l.jsx("input",{ref:d,id:p,type:"radio",name:x.name,value:i,checked:v,required:x.required,disabled:S,"aria-invalid":g||void 0,"aria-describedby":[o,y].filter(Boolean).join(" ")||void 0,className:"peer sr-only",onChange:C=>{C.target.checked&&x.onValueChange(i),u?.(C)},...f}),l.jsx("span",{className:N("flex shrink-0 items-center justify-center rounded-full border border-input bg-background text-primary transition-[background-color,border-color,box-shadow,color] outline-none","peer-focus-visible:border-ring peer-focus-visible:ring-3 peer-focus-visible:ring-ring/50","peer-disabled:border-input peer-disabled:bg-input/50","peer-checked:border-primary peer-checked:bg-primary/10 peer-checked:[&_span]:scale-100 peer-checked:[&_span]:opacity-100",g&&"border-destructive peer-focus-visible:border-destructive peer-focus-visible:ring-destructive/20",a==="sm"?"h-4 w-4":"h-5 w-5"),children:l.jsx("span",{className:N("rounded-full bg-primary opacity-0 transition-[opacity,transform]",a==="sm"?"h-2 w-2 scale-75":"h-2.5 w-2.5 scale-75")})}),(s||e)&&l.jsxs("span",{className:"grid gap-1 leading-tight",children:[s&&l.jsx("span",{className:"font-medium text-foreground",children:s}),e&&l.jsx("span",{id:y,className:"text-sm text-muted-foreground",children:e})]})]})});Pu.displayName="RadioGroupItem";const fs=pe.Root,Iy=pe.Group,hs=pe.Value,Kr=h.forwardRef(({className:t,hasError:e,children:r,...n},s)=>l.jsxs(pe.Trigger,{ref:s,"aria-invalid":e||void 0,className:N("flex h-8 w-full items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent px-2.5 py-1 pr-2 text-sm transition-[border-color,box-shadow,color,background-color] outline-none","data-[placeholder]:text-muted-foreground","focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50","disabled:cursor-not-allowed disabled:opacity-50","dark:bg-input/30 dark:hover:bg-input/50","[&>span]:line-clamp-1",e&&"border-destructive focus-visible:border-destructive focus-visible:ring-destructive/20 dark:border-destructive/50 dark:focus-visible:ring-destructive/40",t),...n,children:[r,l.jsx(pe.Icon,{asChild:!0,children:l.jsx(J.ChevronDown,{className:"h-4 w-4 shrink-0 text-muted-foreground"})})]}));Kr.displayName=pe.Trigger.displayName;const qa=h.forwardRef(({className:t,...e},r)=>l.jsx(pe.ScrollUpButton,{ref:r,className:N("flex cursor-default items-center justify-center bg-popover py-1",t),...e,children:l.jsx(J.ChevronUp,{className:"h-4 w-4"})}));qa.displayName=pe.ScrollUpButton.displayName;const Ya=h.forwardRef(({className:t,...e},r)=>l.jsx(pe.ScrollDownButton,{ref:r,className:N("flex cursor-default items-center justify-center bg-popover py-1",t),...e,children:l.jsx(J.ChevronDown,{className:"h-4 w-4"})}));Ya.displayName=pe.ScrollDownButton.displayName;const Qr=h.forwardRef(({className:t,children:e,position:r="popper",...n},s)=>l.jsx(pe.Portal,{children:l.jsxs(pe.Content,{ref:s,className:N("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-lg bg-popover text-popover-foreground shadow-card-sm ring-1 ring-foreground/10 outline-none","transition-[opacity,transform] duration-100","data-[state=closed]:opacity-0 data-[state=closed]:scale-95","data-[state=open]:opacity-100 data-[state=open]:scale-100",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",t),position:r,...n,children:[l.jsx(qa,{}),l.jsx(pe.Viewport,{className:N("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),l.jsx(Ya,{})]})}));Qr.displayName=pe.Content.displayName;const Fu=h.forwardRef(({className:t,...e},r)=>l.jsx(pe.Label,{ref:r,className:N("px-1.5 py-1 text-xs font-medium text-muted-foreground",t),...e}));Fu.displayName=pe.Label.displayName;const en=h.forwardRef(({className:t,children:e,...r},n)=>l.jsxs(pe.Item,{ref:n,className:N("relative flex w-full cursor-default select-none items-center gap-1.5 rounded-md py-1 pl-1.5 pr-8 text-sm outline-none transition-colors","focus:bg-accent focus:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...r,children:[l.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(pe.ItemIndicator,{children:l.jsx(J.Check,{className:"h-4 w-4"})})}),l.jsx(pe.ItemText,{children:e})]}));en.displayName=pe.Item.displayName;const Lu=h.forwardRef(({className:t,...e},r)=>l.jsx(pe.Separator,{ref:r,className:N("-mx-1 my-1 h-px bg-border",t),...e}));Lu.displayName=pe.Separator.displayName;function Py(t,e){const[r,n]=h.useState(t);return h.useEffect(()=>{const s=setTimeout(()=>n(t),e);return()=>clearTimeout(s)},[t,e]),r}function Ga({value:t,onValueChange:e,placeholder:r="Seleccionar",searchPlaceholder:n="Buscar...",disabled:s,hasError:a,minChars:i=2,debounceMs:o=300,fetcher:c,getOptionValue:u,getOptionLabel:f,emptyLabel:d="Sin resultados",loadingLabel:m="Buscando...",emptyActionLabel:p,onEmptyActionClick:y,contentClassName:g,triggerClassName:x}){const[v,S]=h.useState(!1),[C,k]=h.useState(""),[w,j]=h.useState(!1),[T,A]=h.useState([]),[$,L]=h.useState(""),W=Py(C,o),B=W.trim().length>=i,G=h.useRef(null);h.useEffect(()=>{const H=P=>{G.current&&(G.current.contains(P.target)||S(!1))};return document.addEventListener("mousedown",H),()=>document.removeEventListener("mousedown",H)},[]),h.useEffect(()=>{let H=!0;return(async()=>{if(v){if(!B){A([]);return}j(!0);try{const U=await c(W.trim());if(!H)return;A(U??[])}finally{H&&j(!1)}}})(),()=>{H=!1}},[v,W,B,c]),h.useEffect(()=>{if(!t){L("");return}const H=T.find(P=>u(P)===t);H&&L(f(H))},[t,T,u,f]);const Q=$||r;return l.jsxs("div",{ref:G,className:"relative w-full",children:[l.jsxs("button",{type:"button",disabled:s,"aria-invalid":a?"true":"false","aria-expanded":v,"aria-haspopup":"listbox",onClick:()=>S(H=>!H),className:N("flex h-9 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm shadow-sm transition-colors","focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1","disabled:cursor-not-allowed disabled:opacity-50",a&&"border-destructive focus:ring-destructive",x),children:[l.jsx("span",{className:N("truncate",!$&&"text-muted-foreground"),children:Q}),l.jsx(J.ChevronDown,{className:N("h-4 w-4 shrink-0 opacity-50 transition-transform",v&&"rotate-180")})]}),v&&l.jsxs("div",{className:N("absolute left-0 top-full z-50 mt-1 w-full rounded-md border border-border bg-popover shadow-card-sm",g),role:"listbox",children:[l.jsxs("div",{className:"flex items-center border-b border-border px-3",children:[l.jsx("input",{className:"flex h-9 w-full bg-transparent py-2 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",value:C,onChange:H=>k(H.target.value),placeholder:n,autoFocus:!0}),w&&l.jsx(J.Loader2,{className:"h-4 w-4 shrink-0 animate-spin text-muted-foreground"})]}),l.jsxs("div",{className:"max-h-60 overflow-y-auto p-1",children:[!B&&l.jsxs("p",{className:"py-2 text-center text-xs text-muted-foreground",children:["Escribe al menos ",i," caracteres"]}),B&&w&&l.jsx("p",{className:"py-2 text-center text-xs text-muted-foreground",children:m}),B&&!w&&T.length===0&&l.jsxs("div",{className:"flex flex-col items-center gap-2 py-3",children:[l.jsx("p",{className:"text-xs text-muted-foreground",children:d}),p&&y&&l.jsx("button",{type:"button",className:"text-xs font-medium text-primary hover:underline",onClick:y,children:p})]}),T.length>0&&l.jsx("ul",{children:T.map(H=>{const P=u(H),U=f(H),V=P===t;return l.jsx("li",{children:l.jsxs("button",{type:"button",role:"option","aria-selected":V,className:N("relative flex w-full cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors","hover:bg-accent hover:text-accent-foreground",V&&"bg-accent text-accent-foreground font-medium"),onClick:()=>{e(P),L(U),S(!1),k("")},children:[V&&l.jsx(J.Check,{className:"mr-2 h-4 w-4 shrink-0"}),l.jsx("span",{className:N(!V&&"ml-6"),children:U})]})},P)})})]})]})]})}const Vu=h.forwardRef(({className:t,decorative:e=!0,orientation:r="horizontal",...n},s)=>l.jsx("div",{ref:s,role:e?"none":"separator","aria-orientation":e?void 0:r,"data-orientation":r,className:N("shrink-0 bg-border",r==="horizontal"?"h-px w-full":"h-full w-px",t),...n}));Vu.displayName="Separator";const Fy=yu,Ly=vu,Vy=cs,$u=xu,Xa=h.forwardRef(({className:t,...e},r)=>l.jsx(as,{ref:r,className:N("fixed inset-0 isolate z-50 bg-black/10 backdrop-blur-[2px] transition-opacity duration-100","data-[state=closed]:opacity-0 data-[state=open]:opacity-100",t),...e}));Xa.displayName=as.displayName;const $y=Bn("fixed z-50 flex flex-col gap-4 bg-background p-4 text-sm ring-1 ring-foreground/10 shadow-card-lg outline-none transition-[opacity,transform] duration-100 data-[state=closed]:opacity-0 data-[state=open]:opacity-100",{variants:{side:{top:"inset-x-0 top-0 border-b border-border data-[state=closed]:-translate-y-6 data-[state=open]:translate-y-0",bottom:"inset-x-0 bottom-0 border-t border-border data-[state=closed]:translate-y-6 data-[state=open]:translate-y-0",left:"inset-y-0 left-0 h-full w-full max-w-sm border-r border-border data-[state=closed]:-translate-x-full data-[state=open]:translate-x-0",right:"inset-y-0 right-0 h-full w-full max-w-sm border-l border-border data-[state=closed]:translate-x-full data-[state=open]:translate-x-0"}},defaultVariants:{side:"right"}}),zu=h.forwardRef(({side:t="right",className:e,children:r,hideClose:n,...s},a)=>l.jsxs($u,{children:[l.jsx(Xa,{}),l.jsxs(is,{ref:a,className:N($y({side:t}),e),...s,children:[!n&&l.jsx(cs,{asChild:!0,children:l.jsxs(Le,{variant:"ghost",size:"icon-sm",className:"absolute right-2 top-2","aria-label":"Cerrar",children:[l.jsx(J.X,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Cerrar"})]})}),r]})]}));zu.displayName=is.displayName;const Wu=({className:t,...e})=>l.jsx("div",{className:N("flex flex-col gap-2",t),...e});Wu.displayName="SheetHeader";const Zu=({className:t,...e})=>l.jsx("div",{className:N("-mx-4 -mb-4 mt-auto flex flex-col-reverse gap-2 border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",t),...e});Zu.displayName="SheetFooter";const Bu=h.forwardRef(({className:t,...e},r)=>l.jsx(os,{ref:r,className:N("text-base font-medium leading-none text-foreground",t),...e}));Bu.displayName=os.displayName;const Uu=h.forwardRef(({className:t,...e},r)=>l.jsx(ls,{ref:r,className:N("text-sm text-muted-foreground",t),...e}));Uu.displayName=ls.displayName;function sa({className:t}){return l.jsx("div",{className:N("animate-pulse rounded-lg bg-muted/80",t)})}const Hu=h.forwardRef(({className:t,isInvalid:e,"aria-invalid":r,...n},s)=>{const a=e??(r===!0||r==="true");return l.jsx("textarea",{ref:s,"aria-invalid":a||void 0,className:N("min-h-20 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-sm text-foreground transition-[border-color,box-shadow,color,background-color] outline-none","placeholder:text-muted-foreground","focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50","disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50","dark:bg-input/30 dark:disabled:bg-input/80","resize-y",a&&"border-destructive focus-visible:border-destructive focus-visible:ring-destructive/20 dark:border-destructive/50 dark:focus-visible:ring-destructive/40",t),...n})});Hu.displayName="Textarea";const qu=h.createContext(null);function Ja(){const t=h.useContext(qu);if(!t)throw new Error("Tabs components must be used inside <Tabs>.");return t}function zy({children:t,className:e,defaultValue:r,onValueChange:n,orientation:s="horizontal",value:a,...i}){const o=h.useId(),[c,u]=h.useState(r),f=a!==void 0,d=f?a:c,m=h.useCallback(p=>{f||u(p),n?.(p)},[f,n]);return l.jsx(qu.Provider,{value:{baseId:o,onValueChange:m,orientation:s,value:d},children:l.jsx("div",{className:N("w-full",e),"data-orientation":s,...i,children:t})})}const Yu=h.forwardRef(({className:t,onKeyDown:e,...r},n)=>{const{onValueChange:s,orientation:a}=Ja();return l.jsx("div",{ref:n,role:"tablist","aria-orientation":a,className:N("inline-flex w-fit items-center gap-1 rounded-lg bg-muted p-1 text-muted-foreground ring-1 ring-foreground/10",a==="vertical"&&"flex-col items-stretch",t),onKeyDown:i=>{const o=a==="horizontal"?i.key==="ArrowRight":i.key==="ArrowDown",c=a==="horizontal"?i.key==="ArrowLeft":i.key==="ArrowUp",u=i.key==="Home"||i.key==="End";if(!o&&!c&&!u){e?.(i);return}const f=Array.from(i.currentTarget.querySelectorAll('[role="tab"]:not(:disabled)'));if(f.length===0){e?.(i);return}const d=f.findIndex(g=>g===document.activeElement);let m=d===-1?0:d;o&&(m=(d+1+f.length)%f.length),c&&(m=(d-1+f.length)%f.length),i.key==="Home"&&(m=0),i.key==="End"&&(m=f.length-1),i.preventDefault();const p=f[m];p?.focus();const y=p?.dataset.value;y&&s(y),e?.(i)},...r})});Yu.displayName="TabsList";const Gu=h.forwardRef(({children:t,className:e,value:r,...n},s)=>{const{baseId:a,onValueChange:i,orientation:o,value:c}=Ja(),u=r===c;return l.jsx("button",{ref:s,id:`${a}-trigger-${r}`,type:"button",role:"tab","aria-controls":`${a}-content-${r}`,"aria-selected":u,tabIndex:u?0:-1,"data-state":u?"active":"inactive","data-value":r,className:N("inline-flex h-8 items-center justify-center gap-1.5 rounded-md px-2.5 text-sm font-medium transition-[background-color,color,box-shadow,transform] outline-none","focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50","data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-card-sm","data-[state=inactive]:text-muted-foreground hover:text-foreground",o==="vertical"&&"justify-start",e),onClick:()=>i(r),...n,children:t})});Gu.displayName="TabsTrigger";const Xu=h.forwardRef(({className:t,forceMount:e=!1,value:r,...n},s)=>{const{baseId:a,value:i}=Ja(),o=r===i;return!o&&!e?null:l.jsx("div",{ref:s,id:`${a}-content-${r}`,role:"tabpanel","aria-labelledby":`${a}-trigger-${r}`,hidden:!o,tabIndex:0,"data-state":o?"active":"inactive",className:N("mt-4 outline-none focus-visible:ring-3 focus-visible:ring-ring/50",!o&&"hidden",t),...n})});Xu.displayName="TabsContent";function Wy(t){const e=h.useRef({value:t,previous:t});return h.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var ms="Switch",[Zy]=Un(ms),[By,Uy]=Zy(ms),Ju=h.forwardRef((t,e)=>{const{__scopeSwitch:r,name:n,checked:s,defaultChecked:a,required:i,disabled:o,value:c="on",onCheckedChange:u,form:f,...d}=t,[m,p]=h.useState(null),y=$e(e,C=>p(C)),g=h.useRef(!1),x=m?f||!!m.closest("form"):!0,[v,S]=Ta({prop:s,defaultProp:a??!1,onChange:u,caller:ms});return l.jsxs(By,{scope:r,checked:v,disabled:o,children:[l.jsx(_e.button,{type:"button",role:"switch","aria-checked":v,"aria-required":i,"data-state":td(v),"data-disabled":o?"":void 0,disabled:o,value:c,...d,ref:y,onClick:Re(t.onClick,C=>{S(k=>!k),x&&(g.current=C.isPropagationStopped(),g.current||C.stopPropagation())})}),x&&l.jsx(ed,{control:m,bubbles:!g.current,name:n,value:c,checked:v,required:i,disabled:o,form:f,style:{transform:"translateX(-100%)"}})]})});Ju.displayName=ms;var Ku="SwitchThumb",Qu=h.forwardRef((t,e)=>{const{__scopeSwitch:r,...n}=t,s=Uy(Ku,r);return l.jsx(_e.span,{"data-state":td(s.checked),"data-disabled":s.disabled?"":void 0,...n,ref:e})});Qu.displayName=Ku;var Hy="SwitchBubbleInput",ed=h.forwardRef(({__scopeSwitch:t,control:e,checked:r,bubbles:n=!0,...s},a)=>{const i=h.useRef(null),o=$e(i,a),c=Wy(r),u=kl(e);return h.useEffect(()=>{const f=i.current;if(!f)return;const d=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(d,"checked").set;if(c!==r&&p){const y=new Event("click",{bubbles:n});p.call(f,r),f.dispatchEvent(y)}},[c,r,n]),l.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:o,style:{...s.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});ed.displayName=Hy;function td(t){return t?"checked":"unchecked"}var qy=Ju,Yy=Qu;const tn=h.forwardRef(({checked:t,defaultChecked:e=!1,onChange:r,size:n="md",disabled:s=!1,label:a,className:i,ariaLabel:o,id:c},u)=>{const f=h.useId(),d=c??f;return l.jsxs("div",{className:N("flex items-center gap-2",i),children:[l.jsx(qy,{ref:u,id:d,checked:t,defaultChecked:e,onCheckedChange:r,disabled:s,"aria-label":o,className:N("peer inline-flex shrink-0 cursor-pointer items-center rounded-full border border-transparent transition-[background-color,box-shadow] outline-none","focus-visible:ring-3 focus-visible:ring-ring/50","disabled:cursor-not-allowed disabled:opacity-50","data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-muted/60",n==="sm"?"h-4 w-7":"h-5 w-9"),children:l.jsx(Yy,{className:N("pointer-events-none block rounded-full bg-background shadow-sm ring-1 ring-black/10 transition-transform dark:ring-white/20",n==="sm"?"h-3 w-3 translate-x-0.5 data-[state=checked]:translate-x-3":"h-4 w-4 translate-x-0.5 data-[state=checked]:translate-x-4")})}),a&&l.jsx("label",{htmlFor:d,className:N("text-sm font-medium text-foreground",s&&"cursor-not-allowed opacity-50"),children:a})]})});tn.displayName="Toggle";const Gy=tn;function Xy(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}const Jy=t=>{switch(t){case"success":return ev;case"info":return rv;case"warning":return tv;case"error":return nv;default:return null}},Ky=Array(12).fill(0),Qy=({visible:t,className:e})=>b.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},b.createElement("div",{className:"sonner-spinner"},Ky.map((r,n)=>b.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),ev=b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},b.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"})),tv=b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},b.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"})),rv=b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},b.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"})),nv=b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},b.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"})),sv=b.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"},b.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),b.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),av=()=>{const[t,e]=b.useState(document.hidden);return b.useEffect(()=>{const r=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),t};let aa=1;class iv{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{const r=this.subscribers.indexOf(e);this.subscribers.splice(r,1)}),this.publish=e=>{this.subscribers.forEach(r=>r(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var r;const{message:n,...s}=e,a=typeof e?.id=="number"||((r=e.id)==null?void 0:r.length)>0?e.id:aa++,i=this.toasts.find(c=>c.id===a),o=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),i?this.toasts=this.toasts.map(c=>c.id===a?(this.publish({...c,...e,id:a,title:n}),{...c,...e,id:a,dismissible:o,title:n}):c):this.addToast({title:n,...s,dismissible:o,id:a}),a},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:e,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(n=>n({id:r.id,dismiss:!0}))}),e),this.message=(e,r)=>this.create({...r,message:e}),this.error=(e,r)=>this.create({...r,message:e,type:"error"}),this.success=(e,r)=>this.create({...r,type:"success",message:e}),this.info=(e,r)=>this.create({...r,type:"info",message:e}),this.warning=(e,r)=>this.create({...r,type:"warning",message:e}),this.loading=(e,r)=>this.create({...r,type:"loading",message:e}),this.promise=(e,r)=>{if(!r)return;let n;r.loading!==void 0&&(n=this.create({...r,promise:e,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const s=Promise.resolve(e instanceof Function?e():e);let a=n!==void 0,i;const o=s.then(async u=>{if(i=["resolve",u],b.isValidElement(u))a=!1,this.create({id:n,type:"default",message:u});else if(lv(u)&&!u.ok){a=!1;const d=typeof r.error=="function"?await r.error(`HTTP error! status: ${u.status}`):r.error,m=typeof r.description=="function"?await r.description(`HTTP error! status: ${u.status}`):r.description,y=typeof d=="object"&&!b.isValidElement(d)?d:{message:d};this.create({id:n,type:"error",description:m,...y})}else if(u instanceof Error){a=!1;const d=typeof r.error=="function"?await r.error(u):r.error,m=typeof r.description=="function"?await r.description(u):r.description,y=typeof d=="object"&&!b.isValidElement(d)?d:{message:d};this.create({id:n,type:"error",description:m,...y})}else if(r.success!==void 0){a=!1;const d=typeof r.success=="function"?await r.success(u):r.success,m=typeof r.description=="function"?await r.description(u):r.description,y=typeof d=="object"&&!b.isValidElement(d)?d:{message:d};this.create({id:n,type:"success",description:m,...y})}}).catch(async u=>{if(i=["reject",u],r.error!==void 0){a=!1;const f=typeof r.error=="function"?await r.error(u):r.error,d=typeof r.description=="function"?await r.description(u):r.description,p=typeof f=="object"&&!b.isValidElement(f)?f:{message:f};this.create({id:n,type:"error",description:d,...p})}}).finally(()=>{a&&(this.dismiss(n),n=void 0),r.finally==null||r.finally.call(r)}),c=()=>new Promise((u,f)=>o.then(()=>i[0]==="reject"?f(i[1]):u(i[1])).catch(f));return typeof n!="string"&&typeof n!="number"?{unwrap:c}:Object.assign(n,{unwrap:c})},this.custom=(e,r)=>{const n=r?.id||aa++;return this.create({jsx:e(n),id:n,...r}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const De=new iv,ov=(t,e)=>{const r=e?.id||aa++;return De.addToast({title:t,...e,id:r}),r},lv=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",cv=ov,uv=()=>De.toasts,dv=()=>De.getActiveToasts(),fv=Object.assign(cv,{success:De.success,info:De.info,warning:De.warning,error:De.error,custom:De.custom,message:De.message,promise:De.promise,dismiss:De.dismiss,loading:De.loading},{getHistory:uv,getToasts:dv});Xy("[data-sonner-toaster][dir=ltr],html[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%)}[data-sonner-toaster][dir=rtl],html[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%)}[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:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[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);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[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 rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [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)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [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;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [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);background:var(--normal-bg);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-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[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}[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}[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,0)) translateX(var(--swipe-amount-x,0));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{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{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{from{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-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--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-sonner-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-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-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, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--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-sonner-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-sonner-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]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[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]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[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]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[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]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[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:first-child{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)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{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%)}");function yn(t){return t.label!==void 0}const hv=3,mv="24px",pv="16px",yo=4e3,gv=356,yv=14,vv=45,xv=200;function nt(...t){return t.filter(Boolean).join(" ")}function bv(t){const[e,r]=t.split("-"),n=[];return e&&n.push(e),r&&n.push(r),n}const wv=t=>{var e,r,n,s,a,i,o,c,u;const{invert:f,toast:d,unstyled:m,interacting:p,setHeights:y,visibleToasts:g,heights:x,index:v,toasts:S,expanded:C,removeToast:k,defaultRichColors:w,closeButton:j,style:T,cancelButtonStyle:A,actionButtonStyle:$,className:L="",descriptionClassName:W="",duration:B,position:G,gap:Q,expandByDefault:H,classNames:P,icons:U,closeButtonAriaLabel:V="Close toast"}=t,[ie,F]=b.useState(null),[D,ee]=b.useState(null),[z,oe]=b.useState(!1),[ce,ve]=b.useState(!1),[Te,le]=b.useState(!1),[vt,Yt]=b.useState(!1),[Gt,xt]=b.useState(!1),[Xt,ps]=b.useState(0),[bd,ri]=b.useState(0),Er=b.useRef(d.duration||B||yo),ni=b.useRef(null),ht=b.useRef(null),wd=v===0,kd=v+1<=g,Ae=d.type,Jt=d.dismissible!==!1,Sd=d.className||"",Nd=d.descriptionClassName||"",rn=b.useMemo(()=>x.findIndex(X=>X.toastId===d.id)||0,[x,d.id]),Cd=b.useMemo(()=>{var X;return(X=d.closeButton)!=null?X:j},[d.closeButton,j]),si=b.useMemo(()=>d.duration||B||yo,[d.duration,B]),gs=b.useRef(0),Kt=b.useRef(0),ai=b.useRef(0),Qt=b.useRef(null),[_d,Td]=G.split("-"),ii=b.useMemo(()=>x.reduce((X,xe,we)=>we>=rn?X:X+xe.height,0),[x,rn]),oi=av(),jd=d.invert||f,ys=Ae==="loading";Kt.current=b.useMemo(()=>rn*Q+ii,[rn,ii]),b.useEffect(()=>{Er.current=si},[si]),b.useEffect(()=>{oe(!0)},[]),b.useEffect(()=>{const X=ht.current;if(X){const xe=X.getBoundingClientRect().height;return ri(xe),y(we=>[{toastId:d.id,height:xe,position:d.position},...we]),()=>y(we=>we.filter(Me=>Me.toastId!==d.id))}},[y,d.id]),b.useLayoutEffect(()=>{if(!z)return;const X=ht.current,xe=X.style.height;X.style.height="auto";const we=X.getBoundingClientRect().height;X.style.height=xe,ri(we),y(Me=>Me.find(be=>be.toastId===d.id)?Me.map(be=>be.toastId===d.id?{...be,height:we}:be):[{toastId:d.id,height:we,position:d.position},...Me])},[z,d.title,d.description,y,d.id,d.jsx,d.action,d.cancel]);const bt=b.useCallback(()=>{ve(!0),ps(Kt.current),y(X=>X.filter(xe=>xe.toastId!==d.id)),setTimeout(()=>{k(d)},xv)},[d,k,y,Kt]);b.useEffect(()=>{if(d.promise&&Ae==="loading"||d.duration===1/0||d.type==="loading")return;let X;return C||p||oi?(()=>{if(ai.current<gs.current){const Me=new Date().getTime()-gs.current;Er.current=Er.current-Me}ai.current=new Date().getTime()})():Er.current!==1/0&&(gs.current=new Date().getTime(),X=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),bt()},Er.current)),()=>clearTimeout(X)},[C,p,d,Ae,oi,bt]),b.useEffect(()=>{d.delete&&(bt(),d.onDismiss==null||d.onDismiss.call(d,d))},[bt,d.delete]);function Ed(){var X;if(U?.loading){var xe;return b.createElement("div",{className:nt(P?.loader,d==null||(xe=d.classNames)==null?void 0:xe.loader,"sonner-loader"),"data-visible":Ae==="loading"},U.loading)}return b.createElement(Qy,{className:nt(P?.loader,d==null||(X=d.classNames)==null?void 0:X.loader),visible:Ae==="loading"})}const Od=d.icon||U?.[Ae]||Jy(Ae);var li,ci;return b.createElement("li",{tabIndex:0,ref:ht,className:nt(L,Sd,P?.toast,d==null||(e=d.classNames)==null?void 0:e.toast,P?.default,P?.[Ae],d==null||(r=d.classNames)==null?void 0:r[Ae]),"data-sonner-toast":"","data-rich-colors":(li=d.richColors)!=null?li:w,"data-styled":!(d.jsx||d.unstyled||m),"data-mounted":z,"data-promise":!!d.promise,"data-swiped":Gt,"data-removed":ce,"data-visible":kd,"data-y-position":_d,"data-x-position":Td,"data-index":v,"data-front":wd,"data-swiping":Te,"data-dismissible":Jt,"data-type":Ae,"data-invert":jd,"data-swipe-out":vt,"data-swipe-direction":D,"data-expanded":!!(C||H&&z),"data-testid":d.testId,style:{"--index":v,"--toasts-before":v,"--z-index":S.length-v,"--offset":`${ce?Xt:Kt.current}px`,"--initial-height":H?"auto":`${bd}px`,...T,...d.style},onDragEnd:()=>{le(!1),F(null),Qt.current=null},onPointerDown:X=>{X.button!==2&&(ys||!Jt||(ni.current=new Date,ps(Kt.current),X.target.setPointerCapture(X.pointerId),X.target.tagName!=="BUTTON"&&(le(!0),Qt.current={x:X.clientX,y:X.clientY})))},onPointerUp:()=>{var X,xe,we;if(vt||!Jt)return;Qt.current=null;const Me=Number(((X=ht.current)==null?void 0:X.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),nn=Number(((xe=ht.current)==null?void 0:xe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),be=new Date().getTime()-((we=ni.current)==null?void 0:we.getTime()),ze=ie==="x"?Me:nn,sn=Math.abs(ze)/be;if(Math.abs(ze)>=vv||sn>.11){ps(Kt.current),d.onDismiss==null||d.onDismiss.call(d,d),ee(ie==="x"?Me>0?"right":"left":nn>0?"down":"up"),bt(),Yt(!0);return}else{var He,qe;(He=ht.current)==null||He.style.setProperty("--swipe-amount-x","0px"),(qe=ht.current)==null||qe.style.setProperty("--swipe-amount-y","0px")}xt(!1),le(!1),F(null)},onPointerMove:X=>{var xe,we,Me;if(!Qt.current||!Jt||((xe=window.getSelection())==null?void 0:xe.toString().length)>0)return;const be=X.clientY-Qt.current.y,ze=X.clientX-Qt.current.x;var sn;const He=(sn=t.swipeDirections)!=null?sn:bv(G);!ie&&(Math.abs(ze)>1||Math.abs(be)>1)&&F(Math.abs(ze)>Math.abs(be)?"x":"y");let qe={x:0,y:0};const ui=Mt=>1/(1.5+Math.abs(Mt)/20);if(ie==="y"){if(He.includes("top")||He.includes("bottom"))if(He.includes("top")&&be<0||He.includes("bottom")&&be>0)qe.y=be;else{const Mt=be*ui(be);qe.y=Math.abs(Mt)<Math.abs(be)?Mt:be}}else if(ie==="x"&&(He.includes("left")||He.includes("right")))if(He.includes("left")&&ze<0||He.includes("right")&&ze>0)qe.x=ze;else{const Mt=ze*ui(ze);qe.x=Math.abs(Mt)<Math.abs(ze)?Mt:ze}(Math.abs(qe.x)>0||Math.abs(qe.y)>0)&&xt(!0),(we=ht.current)==null||we.style.setProperty("--swipe-amount-x",`${qe.x}px`),(Me=ht.current)==null||Me.style.setProperty("--swipe-amount-y",`${qe.y}px`)}},Cd&&!d.jsx&&Ae!=="loading"?b.createElement("button",{"aria-label":V,"data-disabled":ys,"data-close-button":!0,onClick:ys||!Jt?()=>{}:()=>{bt(),d.onDismiss==null||d.onDismiss.call(d,d)},className:nt(P?.closeButton,d==null||(n=d.classNames)==null?void 0:n.closeButton)},(ci=U?.close)!=null?ci:sv):null,(Ae||d.icon||d.promise)&&d.icon!==null&&(U?.[Ae]!==null||d.icon)?b.createElement("div",{"data-icon":"",className:nt(P?.icon,d==null||(s=d.classNames)==null?void 0:s.icon)},d.promise||d.type==="loading"&&!d.icon?d.icon||Ed():null,d.type!=="loading"?Od:null):null,b.createElement("div",{"data-content":"",className:nt(P?.content,d==null||(a=d.classNames)==null?void 0:a.content)},b.createElement("div",{"data-title":"",className:nt(P?.title,d==null||(i=d.classNames)==null?void 0:i.title)},d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title),d.description?b.createElement("div",{"data-description":"",className:nt(W,Nd,P?.description,d==null||(o=d.classNames)==null?void 0:o.description)},typeof d.description=="function"?d.description():d.description):null),b.isValidElement(d.cancel)?d.cancel:d.cancel&&yn(d.cancel)?b.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||A,onClick:X=>{yn(d.cancel)&&Jt&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,X),bt())},className:nt(P?.cancelButton,d==null||(c=d.classNames)==null?void 0:c.cancelButton)},d.cancel.label):null,b.isValidElement(d.action)?d.action:d.action&&yn(d.action)?b.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||$,onClick:X=>{yn(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,X),!X.defaultPrevented&&bt())},className:nt(P?.actionButton,d==null||(u=d.classNames)==null?void 0:u.actionButton)},d.action.label):null)};function vo(){if(typeof window>"u"||typeof document>"u")return"ltr";const t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function kv(t,e){const r={};return[t,e].forEach((n,s)=>{const a=s===1,i=a?"--mobile-offset":"--offset",o=a?pv:mv;function c(u){["top","right","bottom","left"].forEach(f=>{r[`${i}-${f}`]=typeof u=="number"?`${u}px`:u})}typeof n=="number"||typeof n=="string"?c(n):typeof n=="object"?["top","right","bottom","left"].forEach(u=>{n[u]===void 0?r[`${i}-${u}`]=o:r[`${i}-${u}`]=typeof n[u]=="number"?`${n[u]}px`:n[u]}):c(o)}),r}const Sv=b.forwardRef(function(e,r){const{id:n,invert:s,position:a="bottom-right",hotkey:i=["altKey","KeyT"],expand:o,closeButton:c,className:u,offset:f,mobileOffset:d,theme:m="light",richColors:p,duration:y,style:g,visibleToasts:x=hv,toastOptions:v,dir:S=vo(),gap:C=yv,icons:k,containerAriaLabel:w="Notifications"}=e,[j,T]=b.useState([]),A=b.useMemo(()=>n?j.filter(z=>z.toasterId===n):j.filter(z=>!z.toasterId),[j,n]),$=b.useMemo(()=>Array.from(new Set([a].concat(A.filter(z=>z.position).map(z=>z.position)))),[A,a]),[L,W]=b.useState([]),[B,G]=b.useState(!1),[Q,H]=b.useState(!1),[P,U]=b.useState(m!=="system"?m:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),V=b.useRef(null),ie=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),F=b.useRef(null),D=b.useRef(!1),ee=b.useCallback(z=>{T(oe=>{var ce;return(ce=oe.find(ve=>ve.id===z.id))!=null&&ce.delete||De.dismiss(z.id),oe.filter(({id:ve})=>ve!==z.id)})},[]);return b.useEffect(()=>De.subscribe(z=>{if(z.dismiss){requestAnimationFrame(()=>{T(oe=>oe.map(ce=>ce.id===z.id?{...ce,delete:!0}:ce))});return}setTimeout(()=>{ma.flushSync(()=>{T(oe=>{const ce=oe.findIndex(ve=>ve.id===z.id);return ce!==-1?[...oe.slice(0,ce),{...oe[ce],...z},...oe.slice(ce+1)]:[z,...oe]})})})}),[j]),b.useEffect(()=>{if(m!=="system"){U(m);return}if(m==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?U("dark"):U("light")),typeof window>"u")return;const z=window.matchMedia("(prefers-color-scheme: dark)");try{z.addEventListener("change",({matches:oe})=>{U(oe?"dark":"light")})}catch{z.addListener(({matches:ce})=>{try{U(ce?"dark":"light")}catch(ve){console.error(ve)}})}},[m]),b.useEffect(()=>{j.length<=1&&G(!1)},[j]),b.useEffect(()=>{const z=oe=>{var ce;if(i.every(le=>oe[le]||oe.code===le)){var Te;G(!0),(Te=V.current)==null||Te.focus()}oe.code==="Escape"&&(document.activeElement===V.current||(ce=V.current)!=null&&ce.contains(document.activeElement))&&G(!1)};return document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)},[i]),b.useEffect(()=>{if(V.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,D.current=!1)}},[V.current]),b.createElement("section",{ref:r,"aria-label":`${w} ${ie}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},$.map((z,oe)=>{var ce;const[ve,Te]=z.split("-");return A.length?b.createElement("ol",{key:z,dir:S==="auto"?vo():S,tabIndex:-1,ref:V,className:u,"data-sonner-toaster":!0,"data-sonner-theme":P,"data-y-position":ve,"data-x-position":Te,style:{"--front-toast-height":`${((ce=L[0])==null?void 0:ce.height)||0}px`,"--width":`${gv}px`,"--gap":`${C}px`,...g,...kv(f,d)},onBlur:le=>{D.current&&!le.currentTarget.contains(le.relatedTarget)&&(D.current=!1,F.current&&(F.current.focus({preventScroll:!0}),F.current=null))},onFocus:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||D.current||(D.current=!0,F.current=le.relatedTarget)},onMouseEnter:()=>G(!0),onMouseMove:()=>G(!0),onMouseLeave:()=>{Q||G(!1)},onDragEnd:()=>G(!1),onPointerDown:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||H(!0)},onPointerUp:()=>H(!1)},A.filter(le=>!le.position&&oe===0||le.position===z).map((le,vt)=>{var Yt,Gt;return b.createElement(wv,{key:le.id,icons:k,index:vt,toast:le,defaultRichColors:p,duration:(Yt=v?.duration)!=null?Yt:y,className:v?.className,descriptionClassName:v?.descriptionClassName,invert:s,visibleToasts:x,closeButton:(Gt=v?.closeButton)!=null?Gt:c,interacting:Q,position:z,style:v?.style,unstyled:v?.unstyled,classNames:v?.classNames,cancelButtonStyle:v?.cancelButtonStyle,actionButtonStyle:v?.actionButtonStyle,closeButtonAriaLabel:v?.closeButtonAriaLabel,removeToast:ee,toasts:A.filter(xt=>xt.position==le.position),heights:L.filter(xt=>xt.position==le.position),setHeights:W,expandByDefault:o,gap:C,expanded:B,swipeDirections:e.swipeDirections})})):null}))});function Nv({...t}){return l.jsx(Sv,{position:"bottom-right",richColors:!1,toastOptions:{classNames:{toast:"group toast rounded-xl bg-background text-foreground shadow-card-sm ring-1 ring-foreground/10",title:"text-sm font-medium",description:"text-sm text-muted-foreground",actionButton:"!h-8 !rounded-md !border-0 !bg-primary !px-2.5 !text-sm !font-medium !text-primary-foreground",cancelButton:"!h-8 !rounded-md !border !border-border !bg-background !px-2.5 !text-sm !font-medium !text-foreground hover:!bg-muted",error:"!bg-destructive/10 !text-foreground !ring-destructive/20",success:"!bg-primary/5 !text-foreground !ring-primary/15",warning:"!bg-amber-500/10 !text-foreground !ring-amber-500/20",info:"!bg-accent !text-accent-foreground !ring-foreground/10"}},...t})}const Cv=zt.Provider,_v=zt.Root,Tv=zt.Trigger,rd=b.forwardRef(({className:t,sideOffset:e=6,children:r,...n},s)=>l.jsx(zt.Portal,{children:l.jsxs(zt.Content,{ref:s,sideOffset:e,className:N("z-50 overflow-hidden rounded-md bg-foreground px-2.5 py-1 text-xs font-medium text-background shadow-card-sm","transition-[opacity,transform] duration-100","data-[state=closed]:opacity-0 data-[state=closed]:scale-95","data-[state=delayed-open]:opacity-100 data-[state=delayed-open]:scale-100",t),...n,children:[r,l.jsx(zt.Arrow,{className:"fill-foreground"})]})}));rd.displayName=zt.Content.displayName;const nd=({logo:t,children:e,footer:r,className:n})=>l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-gradient-to-br from-[--surface-1] via-[--surface-2] to-[--surface-1] px-4 py-12",children:l.jsxs("div",{className:N("w-full max-w-sm rounded-xl bg-[--surface-1] p-8","shadow-[var(--shadow-card-xl)] border border-[--border-1]","flex flex-col gap-6",n),children:[t&&l.jsx("div",{className:"flex justify-center",children:t.href?l.jsx("a",{href:t.href,className:"focus-visible:outline-none focus-visible:ring-2",children:l.jsx("img",{src:t.src,alt:t.alt,className:"h-10 w-auto"})}):l.jsx("img",{src:t.src,alt:t.alt,className:"h-10 w-auto"})}),l.jsx("div",{className:"flex flex-col gap-4",children:e}),r&&l.jsx("div",{className:"border-t border-[--border-1] pt-4 text-center text-xs text-[--text-2]",children:r})]})});nd.displayName="AuthLayout";function jv({items:t,className:e,separator:r,renderLink:n}){const s=r??l.jsx(J.ChevronRight,{className:"h-4 w-4 text-[color:var(--oniratec-label-secondary)]"});return l.jsx("nav",{"aria-label":"Breadcrumb",className:e,children:l.jsx("ol",{className:"flex flex-wrap items-center gap-2 text-sm",children:t.map((a,i)=>{const o=i===t.length-1,c=l.jsx("span",{className:N("transition-colors",o?"font-medium text-[color:var(--oniratec-label-primary)]":"text-[color:var(--oniratec-label-secondary)] hover:text-[color:var(--oniratec-label-primary)]"),children:a.label}),u="inline-flex items-center gap-1 rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--oniratec-focus)] focus-visible:ring-offset-2 focus-visible:ring-offset-[color:var(--oniratec-fill-primary)]";return l.jsxs("li",{className:"flex items-center gap-2",children:[o?l.jsx("span",{"aria-current":"page",children:c}):n?n({item:a,className:u,children:c}):a.href?l.jsx("a",{href:a.href,className:u,children:c}):l.jsx("button",{type:"button",onClick:a.onClick,className:u,children:c}),!o&&l.jsx("span",{"aria-hidden":"true",children:s})]},`${a.label}-${i}`)})})})}function Ev({open:t,onOpenChange:e,title:r,description:n,confirmLabel:s="Confirmar",cancelLabel:a="Cancelar",variant:i="default",onConfirm:o,loading:c=!1}){const u=async()=>{await o()};return l.jsx(bu,{open:t,onOpenChange:e,children:l.jsxs(Wa,{size:"sm",hideClose:!0,children:[l.jsxs(Za,{children:[l.jsx(Ua,{children:r}),n&&l.jsx(Ha,{children:n})]}),l.jsxs(Ba,{children:[l.jsx(Le,{variant:"secondary",onClick:()=>e(!1),disabled:c,children:a}),l.jsxs(Le,{variant:i==="destructive"?"destructive":"default",onClick:u,disabled:c,children:[c&&l.jsx(J.Loader2,{className:"h-4 w-4 animate-spin"}),s]})]})]})})}const xo="onira-sidebar-collapsed",Ov=({to:t,children:e,className:r,onClick:n})=>l.jsx("a",{href:t,className:r,onClick:n,children:e});function Dv({item:t,collapsed:e,LinkComponent:r,onMobileClose:n}){const s=r??Ov,a=t.icon;return l.jsxs(s,{to:t.to,end:t.end,className:N("group flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors","text-muted-foreground hover:bg-accent hover:text-accent-foreground","aria-[current=page]:bg-primary/10 aria-[current=page]:text-primary",e&&"justify-center px-2"),onClick:n,children:[a&&l.jsx(a,{className:N("h-4 w-4 shrink-0 transition-colors","group-[.active]:text-primary")}),!e&&l.jsx("span",{className:"flex-1 truncate",children:t.label}),!e&&t.badge!==void 0&&l.jsx(pa,{variant:"secondary",size:"sm",children:t.badge})]})}function bo({navSections:t,logo:e,appName:r,collapsed:n,LinkComponent:s,onMobileClose:a}){return l.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[l.jsxs("div",{className:N("flex h-14 items-center border-b border-border px-4 shrink-0",n?"justify-center px-2":"gap-2"),children:[e&&l.jsx("div",{className:"shrink-0",children:e}),!n&&r&&l.jsx("span",{className:"truncate text-sm font-semibold text-foreground",children:r})]}),l.jsx("nav",{className:"flex-1 overflow-y-auto px-2 py-3 space-y-4",children:t.map((i,o)=>l.jsxs("div",{className:"space-y-1",children:[!n&&i.title&&l.jsx("p",{className:"px-3 pb-1 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:i.title}),i.items.map(c=>l.jsx(Dv,{item:c,collapsed:n,LinkComponent:s,onMobileClose:a},c.to))]},o))})]})}function Rv({navSections:t,logo:e,appName:r,headerActions:n,children:s,LinkComponent:a}){const[i,o]=h.useState(()=>{try{return localStorage.getItem(xo)==="true"}catch{return!1}}),[c,u]=h.useState(!1),f=()=>{const d=!i;o(d);try{localStorage.setItem(xo,String(d))}catch{return}};return l.jsxs("div",{className:"flex h-screen overflow-hidden bg-background",children:[l.jsxs("aside",{className:N("hidden md:flex flex-col border-r border-border bg-card transition-all duration-200 relative",i?"w-14":"w-60"),children:[l.jsx(bo,{navSections:t,logo:e,appName:r,collapsed:i,LinkComponent:a}),l.jsx("button",{type:"button",onClick:f,className:N("absolute -right-3 top-16 z-10 flex h-6 w-6 items-center justify-center rounded-full border border-border bg-background text-muted-foreground shadow-card-sm transition-colors hover:bg-accent hover:text-accent-foreground"),"aria-label":i?"Expandir sidebar":"Colapsar sidebar",children:i?l.jsx(J.ChevronRight,{className:"h-3 w-3"}):l.jsx(J.ChevronLeft,{className:"h-3 w-3"})})]}),c&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 md:hidden",onClick:()=>u(!1)}),l.jsxs("div",{className:"fixed inset-y-0 left-0 z-50 w-72 bg-card shadow-card-xl md:hidden",children:[l.jsx("div",{className:"absolute right-3 top-3",children:l.jsx("button",{type:"button",onClick:()=>u(!1),className:"rounded-md p-1.5 text-muted-foreground hover:text-foreground",children:l.jsx(J.X,{className:"h-5 w-5"})})}),l.jsx(bo,{navSections:t,logo:e,appName:r,collapsed:!1,LinkComponent:a,onMobileClose:()=>u(!1)})]})]}),l.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[l.jsxs("header",{className:"flex h-14 shrink-0 items-center justify-between border-b border-border bg-card px-4 md:px-6",children:[l.jsx("button",{type:"button",className:"md:hidden rounded-md p-1.5 text-muted-foreground hover:text-foreground",onClick:()=>u(!0),"aria-label":"Abrir menú",children:l.jsx(J.Menu,{className:"h-5 w-5"})}),l.jsx("div",{className:"hidden md:block"}),n&&l.jsx("div",{className:"flex items-center gap-2",children:n})]}),l.jsx("main",{className:"flex-1 overflow-y-auto",children:s})]})]})}function wo(t){return t?Array.isArray(t)?t:[t]:[]}function Av(t,e){return t==null&&e==null?0:t==null?1:e==null?-1:typeof t=="number"&&typeof e=="number"?t-e:typeof t=="boolean"&&typeof e=="boolean"?Number(t)-Number(e):t instanceof Date&&e instanceof Date?t.getTime()-e.getTime():String(t).localeCompare(String(e),void 0,{numeric:!0,sensitivity:"base"})}function sd({columns:t,data:e,enableSorting:r=!0,sortState:n,defaultSortState:s=null,onSortChange:a,unsortedIcon:i="muted",sortMode:o="single",manualSorting:c=!1,emptyContent:u,loadingContent:f,errorContent:d,isLoading:m=!1}){const[p,y]=b.useState(s),g=n!==void 0?n:p,x=wo(g),v=b.useMemo(()=>new Map(t.map(w=>[w.key,w])),[t]),S=b.useMemo(()=>{if(c||!r||x.length===0)return e;const w=[...e];return w.sort((j,T)=>{for(const A of x){const $=v.get(A.columnId);if(!$)continue;const W=($.sortFn??((B,G)=>{const Q=$.sortValue?.(B)??B[$.key],H=$.sortValue?.(G)??G[$.key];return Av(Q,H)}))(j,T);if(W!==0)return A.direction==="asc"?W:-W}return 0}),w},[e,c,x,v,r]),C=w=>{n===void 0&&y(w),a?.(w)},k=(w,j)=>{if(!(r&&(w.sortable??!!(w.sortFn||w.sortValue))))return;const A=wo(g),$=A.find(W=>W.columnId===w.key),L=$?.direction==="asc"?"desc":$?.direction==="desc"?null:"asc";if(o==="multi"&&j){const W=A.filter(B=>B.columnId!==w.key);L&&W.push({columnId:w.key,direction:L}),C(W.length?W:null);return}if(!L){C(null);return}C({columnId:w.key,direction:L})};return l.jsx("div",{className:"oniratec-data-table",children:l.jsxs("table",{className:"oniratec-data-table__table",children:[l.jsx("thead",{className:"oniratec-data-table__head",children:l.jsx("tr",{className:"oniratec-data-table__head-row",children:t.map(w=>{const j=r&&(w.sortable??!!(w.sortFn||w.sortValue)),A=x.find(L=>L.columnId===w.key)?.direction,$=j?A==="asc"?"ascending":A==="desc"?"descending":"none":void 0;return l.jsx("th",{scope:"col","aria-sort":$,className:N("oniratec-data-table__th",w.headerClassName),children:j?l.jsxs("button",{type:"button",onClick:L=>k(w,L.shiftKey),className:"oniratec-data-table__sort-button",children:[l.jsx("span",{className:"flex-1",children:w.header}),l.jsxs("span",{className:N("oniratec-data-table__sort-icon",A&&"oniratec-data-table__sort-icon--active",!A&&i==="placeholder"&&"opacity-0",!A&&i==="hidden"&&"hidden"),"aria-hidden":"true",children:[A==="asc"&&l.jsx(J.ChevronUp,{className:"h-4 w-4"}),A==="desc"&&l.jsx(J.ChevronDown,{className:"h-4 w-4"}),!A&&i!=="hidden"&&l.jsx(J.ChevronsUpDown,{className:"h-4 w-4"})]})]}):w.header},w.key)})})}),l.jsx("tbody",{className:"oniratec-data-table__divider",children:d&&!m?l.jsx("tr",{children:l.jsx("td",{colSpan:t.length,className:"oniratec-data-table__empty",children:d})}):m?l.jsx("tr",{children:l.jsx("td",{colSpan:t.length,className:"oniratec-data-table__empty",children:f??"Cargando..."})}):S.length===0?l.jsx("tr",{children:l.jsx("td",{colSpan:t.length,className:"oniratec-data-table__empty",children:u??"No hay datos disponibles."})}):S.map((w,j)=>l.jsx("tr",{className:"oniratec-data-table__row",children:t.map(T=>l.jsx("td",{className:N("oniratec-data-table__td",T.className),children:T.render(w)},T.key))},j))})]})})}const Mv=[5,10,25,50],ad=({value:t,onChange:e,options:r=Mv})=>l.jsxs("div",{className:"flex items-center gap-2 text-[color:var(--oniratec-label-secondary)]",children:[l.jsx("span",{children:"Mostrar"}),l.jsxs(fs,{value:t.toString(),onValueChange:n=>{e(parseInt(n))},children:[l.jsx(Kr,{children:l.jsx(hs,{})}),l.jsx(Qr,{children:(r??[]).map(n=>l.jsx(en,{value:n.toString(),children:String(n)},n))})]}),l.jsx("span",{children:"por página"})]}),Iv=({page:t,pageSize:e,total:r,onPageChange:n,onPageSizeChange:s})=>{const a=Math.ceil(r/e);if(a<=1&&r<=e)return null;const i=t+1,o="rounded-md border border-[color:var(--border-1)] px-3 py-1 text-[color:var(--text-1)] transition-colors hover:bg-[color:color-mix(in srgb, var(--brand) 12%, transparent)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--focus)] disabled:opacity-50 disabled:cursor-not-allowed";return l.jsxs("div",{className:"mt-4 flex flex-wrap items-center justify-between gap-4 text-sm text-[color:var(--text-2)]",children:[l.jsxs("span",{children:["Página ",i," de ",a]}),l.jsx(ad,{value:e,onChange:s}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{disabled:t===0,onClick:()=>n(t-1),"aria-label":"Página anterior",className:o,children:"Anterior"}),l.jsx("button",{disabled:t+1>=a,onClick:()=>n(t+1),"aria-label":"Página siguiente",className:o,children:"Siguiente"})]})]})};function id({filters:t,value:e,onChange:r,onReset:n,resetLabel:s="Resetear filtros",showReset:a=!0,className:i,layout:o="inline",actions:c}){const u=(m,p)=>{r({...e,[m]:p})},f=a&&!!n,d=o==="stacked"?"grid gap-4":"grid gap-4 sm:grid-cols-2 lg:grid-cols-3";return l.jsxs("section",{className:N("rounded-xl border border-[color:var(--border-1)] bg-[color:var(--surface-2)] p-4 shadow-[var(--shadow-card-sm)]",i),children:[l.jsx("div",{className:d,children:t.map(m=>l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsxs("div",{className:"flex flex-col gap-1",children:[l.jsx("span",{className:"text-sm font-semibold text-[color:var(--text-1)]",children:m.label}),m.helperText&&l.jsx("span",{className:"text-xs text-[color:var(--text-2)]",children:m.helperText})]}),m.type==="text"&&l.jsx($r,{placeholder:m.placeholder,value:e[m.id]??"",onChange:p=>u(m.id,p.target.value),disabled:m.disabled}),m.type==="select"&&l.jsxs(fs,{value:e[m.id]??"",onValueChange:p=>u(m.id,p),disabled:m.disabled,children:[l.jsx(Kr,{children:l.jsx(hs,{placeholder:m.placeholder??"Seleccionar"})}),l.jsx(Qr,{children:m.options.map(p=>l.jsx(en,{value:p.value,children:p.label},p.value))})]}),m.type==="async-select"&&l.jsx(Ga,{value:e[m.id]??"",onValueChange:p=>u(m.id,p),placeholder:m.placeholder,searchPlaceholder:m.searchPlaceholder,minChars:m.minChars,debounceMs:m.debounceMs,fetcher:m.fetcher,getOptionLabel:m.getOptionLabel,getOptionValue:m.getOptionValue,emptyLabel:m.emptyLabel,loadingLabel:m.loadingLabel,emptyActionLabel:m.emptyActionLabel,onEmptyActionClick:m.onEmptyActionClick,disabled:m.disabled}),m.type==="toggle"&&l.jsx(tn,{checked:e[m.id]??!1,onChange:p=>u(m.id,p),disabled:m.disabled,ariaLabel:m.label,label:m.description}),m.type==="date"&&l.jsx(ns,{value:e[m.id]??null,onChange:p=>u(m.id,p??null),placeholder:m.placeholder,min:m.min,max:m.max,timeZone:m.timeZone,disabled:m.disabled})]},m.id))}),(f||c)&&l.jsxs("div",{className:"mt-4 flex flex-wrap items-center justify-between gap-3",children:[f&&l.jsx(Le,{type:"button",variant:"ghost",onClick:n,children:s}),c&&l.jsx("div",{className:"flex items-center gap-2",children:c})]})]})}function od({title:t="Filtros",description:e,children:r,isOpen:n,onOpenChange:s,onApply:a,applyLabel:i="Aplicar filtros",closeLabel:o="Cerrar",className:c}){const u=b.useId(),f=e?`${u}-description`:void 0,d=n,m=b.useCallback(p=>{s(p)},[s]);return b.useEffect(()=>{if(!d)return;const p=y=>{y.key==="Escape"&&m(!1)};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[d,m]),b.useEffect(()=>{if(!d)return;const p=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=p}},[d]),d?l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",children:l.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":u,"aria-describedby":f,className:N("w-full max-w-3xl rounded-2xl border border-[color:var(--border-1)] bg-[color:var(--surface-1)] p-6 shadow-[var(--shadow-card-lg)]",c),children:[l.jsxs("div",{className:"flex items-start justify-between gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx("h2",{id:u,className:"text-lg font-semibold text-[color:var(--text-1)]",children:t}),e&&l.jsx("p",{id:f,className:"text-sm text-[color:var(--text-2)]",children:e})]}),l.jsx("button",{type:"button",onClick:()=>m(!1),className:N("inline-flex h-9 w-9 items-center justify-center rounded-md","text-[color:var(--text-2)] transition-colors","hover:bg-[color:color-mix(in srgb, var(--brand) 12%, transparent)]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--focus)]"),"aria-label":o,children:l.jsx(J.X,{className:"h-4 w-4"})})]}),l.jsx("div",{className:"mt-6",children:r}),l.jsxs("div",{className:"mt-6 flex flex-wrap items-center justify-end gap-2",children:[l.jsx(Le,{type:"button",variant:"ghost",onClick:()=>m(!1),children:o}),l.jsx(Le,{type:"button",onClick:()=>{a?.(),m(!1)},children:i})]})]})}):null}const Pv=".csv,.xlsx";function Fv({title:t="Importar datos",description:e="Sube un fichero CSV o XLSX para ejecutar la importacion.",helperText:r="El sistema procesara cada fila de forma tolerante.",accept:n=Pv,className:s,actionLabel:a="Importar",disabled:i=!1,loading:o=!1,summary:c,onImport:u}){const[f,d]=b.useState([]),m=f[0]??null,p=b.useMemo(()=>c?`Resultado: ${c.created} creados, ${c.updated} actualizados, ${c.failed} fallidos`:null,[c]),y=async()=>{!m||i||o||await u(m)};return l.jsxs("section",{className:N("rounded-xl border border-slate-200 bg-white p-4 shadow-sm space-y-3",s),children:[l.jsxs("header",{className:"space-y-1",children:[l.jsx("h3",{className:"text-sm font-semibold text-slate-900",children:t}),l.jsx("p",{className:"text-sm text-slate-600",children:e})]}),l.jsx(us,{files:f,onFilesChange:d,multiple:!1,accept:n,helperText:r,allowDrop:!0,showPreview:!1,disabled:i||o}),p&&l.jsx("p",{className:"text-sm text-slate-700",children:p}),l.jsx("div",{className:"flex justify-end",children:l.jsx(Le,{type:"button",variant:"primary",onClick:()=>{y()},disabled:!m||i,loading:o,children:a})})]})}function Lv({title:t,value:e,delta:r,deltaLabel:n,icon:s,description:a,loading:i=!1,className:o}){const c=r!==void 0&&r>=0,u=r!==void 0&&r<0;return i?l.jsxs(zs,{className:N("p-6",o),children:[l.jsx(sa,{className:"mb-2 h-4 w-24"}),l.jsx(sa,{className:"h-8 w-32"})]}):l.jsxs(zs,{className:o,children:[l.jsx(Jo,{children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(Ko,{className:"text-sm font-medium text-muted-foreground",children:t}),s&&l.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-md bg-primary/10",children:l.jsx(s,{className:"h-4 w-4 text-primary"})})]})}),l.jsxs(Qo,{children:[l.jsx("div",{className:"text-2xl font-bold text-foreground",children:e}),(r!==void 0||a)&&l.jsxs("div",{className:"mt-1 flex items-center gap-1.5",children:[r!==void 0&&l.jsxs("span",{className:N("inline-flex items-center gap-0.5 text-xs font-medium",c&&"text-emerald-600",u&&"text-red-600"),children:[c?l.jsx(J.TrendingUp,{className:"h-3 w-3"}):l.jsx(J.TrendingDown,{className:"h-3 w-3"}),Math.abs(r),"%"]}),a&&l.jsx("p",{className:"text-xs text-muted-foreground",children:n??a})]})]})]})}function Vv({title:t,description:e,actions:r,className:n}){return l.jsxs("div",{className:N("flex items-start justify-between gap-4",n),children:[l.jsxs("div",{className:"flex flex-col gap-1",children:[l.jsx("h1",{className:"text-2xl font-semibold tracking-tight text-foreground",children:t}),e&&l.jsx("p",{className:"text-sm text-muted-foreground",children:e})]}),r&&l.jsx("div",{className:"flex shrink-0 items-center gap-2",children:r})]})}function $v({mode:t="light",theme:e="nova",children:r}){return b.useEffect(()=>{const n=document.documentElement;n.dataset.mode=t,n.dataset.theme=e,n.classList.toggle("dark",t==="dark"),n.style.colorScheme=t},[t,e]),r}var ne;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function r(s){throw new Error}t.assertNever=r,t.arrayToEnum=s=>{const a={};for(const i of s)a[i]=i;return a},t.getValidEnumValues=s=>{const a=t.objectKeys(s).filter(o=>typeof s[s[o]]!="number"),i={};for(const o of a)i[o]=s[o];return t.objectValues(i)},t.objectValues=s=>t.objectKeys(s).map(function(a){return s[a]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const a=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&a.push(i);return a},t.find=(s,a)=>{for(const i of s)if(a(i))return i},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,a=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}t.joinValues=n,t.jsonStringifyReplacer=(s,a)=>typeof a=="bigint"?a.toString():a})(ne||(ne={}));var ko;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(ko||(ko={}));const R=ne.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Nt=t=>{switch(typeof t){case"undefined":return R.undefined;case"string":return R.string;case"number":return Number.isNaN(t)?R.nan:R.number;case"boolean":return R.boolean;case"function":return R.function;case"bigint":return R.bigint;case"symbol":return R.symbol;case"object":return Array.isArray(t)?R.array:t===null?R.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?R.promise:typeof Map<"u"&&t instanceof Map?R.map:typeof Set<"u"&&t instanceof Set?R.set:typeof Date<"u"&&t instanceof Date?R.date:R.object;default:return R.unknown}},_=ne.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 yt extends Error{get errors(){return this.issues}constructor(e){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=e}format(e){const r=e||function(a){return a.message},n={_errors:[]},s=a=>{for(const i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let o=n,c=0;for(;c<i.path.length;){const u=i.path[c];c===i.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(r(i))):o[u]=o[u]||{_errors:[]},o=o[u],c++}}};return s(this),n}static assert(e){if(!(e instanceof yt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ne.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){const r={},n=[];for(const s of this.issues)if(s.path.length>0){const a=s.path[0];r[a]=r[a]||[],r[a].push(e(s))}else n.push(e(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}yt.create=t=>new yt(t);const ia=(t,e)=>{let r;switch(t.code){case _.invalid_type:t.received===R.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case _.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,ne.jsonStringifyReplacer)}`;break;case _.unrecognized_keys:r=`Unrecognized key(s) in object: ${ne.joinValues(t.keys,", ")}`;break;case _.invalid_union:r="Invalid input";break;case _.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${ne.joinValues(t.options)}`;break;case _.invalid_enum_value:r=`Invalid enum value. Expected ${ne.joinValues(t.options)}, received '${t.received}'`;break;case _.invalid_arguments:r="Invalid function arguments";break;case _.invalid_return_type:r="Invalid function return type";break;case _.invalid_date:r="Invalid date";break;case _.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:ne.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case _.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case _.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case _.custom:r="Invalid input";break;case _.invalid_intersection_types:r="Intersection results could not be merged";break;case _.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case _.not_finite:r="Number must be finite";break;default:r=e.defaultError,ne.assertNever(t)}return{message:r}};let zv=ia;function Wv(){return zv}const Zv=t=>{const{data:e,path:r,errorMaps:n,issueData:s}=t,a=[...r,...s.path||[]],i={...s,path:a};if(s.message!==void 0)return{...s,path:a,message:s.message};let o="";const c=n.filter(u=>!!u).slice().reverse();for(const u of c)o=u(i,{data:e,defaultError:o}).message;return{...s,path:a,message:o}};function O(t,e){const r=Wv(),n=Zv({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===ia?void 0:ia].filter(s=>!!s)});t.common.issues.push(n)}class Ve{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){const n=[];for(const s of r){if(s.status==="aborted")return q;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){const n=[];for(const s of r){const a=await s.key,i=await s.value;n.push({key:a,value:i})}return Ve.mergeObjectSync(e,n)}static mergeObjectSync(e,r){const n={};for(const s of r){const{key:a,value:i}=s;if(a.status==="aborted"||i.status==="aborted")return q;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||s.alwaysSet)&&(n[a.value]=i.value)}return{status:e.value,value:n}}}const q=Object.freeze({status:"aborted"}),Mr=t=>({status:"dirty",value:t}),Ue=t=>({status:"valid",value:t}),So=t=>t.status==="aborted",No=t=>t.status==="dirty",yr=t=>t.status==="valid",Ln=t=>typeof Promise<"u"&&t instanceof Promise;var M;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(M||(M={}));class Dt{constructor(e,r,n,s){this._cachedPath=[],this.parent=e,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 Co=(t,e)=>{if(yr(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new yt(t.common.issues);return this._error=r,this._error}}};function K(t){if(!t)return{};const{errorMap:e,invalid_type_error:r,required_error:n,description:s}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(i,o)=>{const{message:c}=t;return i.code==="invalid_enum_value"?{message:c??o.defaultError}:typeof o.data>"u"?{message:c??n??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:c??r??o.defaultError}},description:s}}class re{get description(){return this._def.description}_getType(e){return Nt(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Nt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ve,ctx:{common:e.parent.common,data:e.data,parsedType:Nt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(Ln(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){const r=this._parse(e);return Promise.resolve(r)}parse(e,r){const n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){const n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Nt(e)},s=this._parseSync({data:e,path:n.path,parent:n});return Co(n,s)}"~validate"(e){const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Nt(e)};if(!this["~standard"].async)try{const n=this._parseSync({data:e,path:[],parent:r});return yr(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>yr(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){const n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){const n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Nt(e)},s=this._parse({data:e,path:n.path,parent:n}),a=await(Ln(s)?s:Promise.resolve(s));return Co(n,a)}refine(e,r){const n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,a)=>{const i=e(s),o=()=>a.addIssue({code:_.custom,...n(s)});return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,r){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(e){return new xr({schema:this,typeName:Y.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Tt.create(this,this._def)}nullable(){return br.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ct.create(this)}promise(){return Wn.create(this,this._def)}or(e){return $n.create([this,e],this._def)}and(e){return zn.create(this,e,this._def)}transform(e){return new xr({...K(this._def),schema:this,typeName:Y.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new ca({...K(this._def),innerType:this,defaultValue:r,typeName:Y.ZodDefault})}brand(){return new fx({typeName:Y.ZodBranded,type:this,...K(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new ua({...K(this._def),innerType:this,catchValue:r,typeName:Y.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Ka.create(this,e)}readonly(){return da.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Bv=/^c[^\s-]{8,}$/i,Uv=/^[0-9a-z]+$/,Hv=/^[0-9A-HJKMNP-TV-Z]{26}$/i,qv=/^[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,Yv=/^[a-z0-9_-]{21}$/i,Gv=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Xv=/^[-+]?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)?)??$/,Jv=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Kv="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ls;const Qv=/^(?:(?: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])$/,ex=/^(?:(?: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])$/,tx=/^(([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]))$/,rx=/^(([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])$/,nx=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,sx=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ld="((\\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])))",ax=new RegExp(`^${ld}$`);function cd(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function ix(t){return new RegExp(`^${cd(t)}$`)}function ox(t){let e=`${ld}T${cd(t)}`;const r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function lx(t,e){return!!((e==="v4"||!e)&&Qv.test(t)||(e==="v6"||!e)&&tx.test(t))}function cx(t,e){if(!Gv.test(t))return!1;try{const[r]=t.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?.typ!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function ux(t,e){return!!((e==="v4"||!e)&&ex.test(t)||(e==="v6"||!e)&&rx.test(t))}class $t extends re{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==R.string){const a=this._getOrReturnCtx(e);return O(a,{code:_.invalid_type,expected:R.string,received:a.parsedType}),q}const n=new Ve;let s;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(s=this._getOrReturnCtx(e,s),O(s,{code:_.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")e.data.length>a.value&&(s=this._getOrReturnCtx(e,s),O(s,{code:_.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){const i=e.data.length>a.value,o=e.data.length<a.value;(i||o)&&(s=this._getOrReturnCtx(e,s),i?O(s,{code:_.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&O(s,{code:_.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")Jv.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"email",code:_.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")Ls||(Ls=new RegExp(Kv,"u")),Ls.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"emoji",code:_.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")qv.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"uuid",code:_.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")Yv.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"nanoid",code:_.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")Bv.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"cuid",code:_.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")Uv.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"cuid2",code:_.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")Hv.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"ulid",code:_.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),O(s,{validation:"url",code:_.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"regex",code:_.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(s=this._getOrReturnCtx(e,s),O(s,{code:_.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(s=this._getOrReturnCtx(e,s),O(s,{code:_.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(s=this._getOrReturnCtx(e,s),O(s,{code:_.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?ox(a).test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{code:_.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?ax.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{code:_.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?ix(a).test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{code:_.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?Xv.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"duration",code:_.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?lx(e.data,a.version)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"ip",code:_.invalid_string,message:a.message}),n.dirty()):a.kind==="jwt"?cx(e.data,a.alg)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"jwt",code:_.invalid_string,message:a.message}),n.dirty()):a.kind==="cidr"?ux(e.data,a.version)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"cidr",code:_.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?nx.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"base64",code:_.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?sx.test(e.data)||(s=this._getOrReturnCtx(e,s),O(s,{validation:"base64url",code:_.invalid_string,message:a.message}),n.dirty()):ne.assertNever(a);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(s=>e.test(s),{validation:r,code:_.invalid_string,...M.errToObj(n)})}_addCheck(e){return new $t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...M.errToObj(e)})}url(e){return this._addCheck({kind:"url",...M.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...M.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...M.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...M.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...M.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...M.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...M.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...M.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...M.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...M.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...M.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...M.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...M.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...M.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...M.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...M.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...M.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...M.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...M.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...M.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...M.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...M.errToObj(r)})}nonempty(e){return this.min(1,M.errToObj(e))}trim(){return new $t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new $t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new $t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}$t.create=t=>new $t({checks:[],typeName:Y.ZodString,coerce:t?.coerce??!1,...K(t)});function dx(t,e){const r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,s=r>n?r:n,a=Number.parseInt(t.toFixed(s).replace(".","")),i=Number.parseInt(e.toFixed(s).replace(".",""));return a%i/10**s}class zr extends re{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==R.number){const a=this._getOrReturnCtx(e);return O(a,{code:_.invalid_type,expected:R.number,received:a.parsedType}),q}let n;const s=new Ve;for(const a of this._def.checks)a.kind==="int"?ne.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),O(n,{code:_.invalid_type,expected:"integer",received:"float",message:a.message}),s.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),O(n,{code:_.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),O(n,{code:_.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="multipleOf"?dx(e.data,a.value)!==0&&(n=this._getOrReturnCtx(e,n),O(n,{code:_.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),O(n,{code:_.not_finite,message:a.message}),s.dirty()):ne.assertNever(a);return{status:s.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,M.toString(r))}gt(e,r){return this.setLimit("min",e,!1,M.toString(r))}lte(e,r){return this.setLimit("max",e,!0,M.toString(r))}lt(e,r){return this.setLimit("max",e,!1,M.toString(r))}setLimit(e,r,n,s){return new zr({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:M.toString(s)}]})}_addCheck(e){return new zr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:M.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:M.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:M.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:M.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:M.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:M.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:M.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:M.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:M.toString(e)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ne.isInteger(e.value))}get isFinite(){let e=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"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}}zr.create=t=>new zr({checks:[],typeName:Y.ZodNumber,coerce:t?.coerce||!1,...K(t)});class Wr extends re{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==R.bigint)return this._getInvalidInput(e);let n;const s=new Ve;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),O(n,{code:_.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),O(n,{code:_.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),O(n,{code:_.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):ne.assertNever(a);return{status:s.value,value:e.data}}_getInvalidInput(e){const r=this._getOrReturnCtx(e);return O(r,{code:_.invalid_type,expected:R.bigint,received:r.parsedType}),q}gte(e,r){return this.setLimit("min",e,!0,M.toString(r))}gt(e,r){return this.setLimit("min",e,!1,M.toString(r))}lte(e,r){return this.setLimit("max",e,!0,M.toString(r))}lt(e,r){return this.setLimit("max",e,!1,M.toString(r))}setLimit(e,r,n,s){return new Wr({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:M.toString(s)}]})}_addCheck(e){return new Wr({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:M.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:M.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:M.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:M.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:M.toString(r)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}Wr.create=t=>new Wr({checks:[],typeName:Y.ZodBigInt,coerce:t?.coerce??!1,...K(t)});class _o extends re{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==R.boolean){const n=this._getOrReturnCtx(e);return O(n,{code:_.invalid_type,expected:R.boolean,received:n.parsedType}),q}return Ue(e.data)}}_o.create=t=>new _o({typeName:Y.ZodBoolean,coerce:t?.coerce||!1,...K(t)});class Vn extends re{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==R.date){const a=this._getOrReturnCtx(e);return O(a,{code:_.invalid_type,expected:R.date,received:a.parsedType}),q}if(Number.isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return O(a,{code:_.invalid_date}),q}const n=new Ve;let s;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(s=this._getOrReturnCtx(e,s),O(s,{code:_.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(s=this._getOrReturnCtx(e,s),O(s,{code:_.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):ne.assertNever(a);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Vn({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:M.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:M.toString(r)})}get minDate(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}}Vn.create=t=>new Vn({checks:[],coerce:t?.coerce||!1,typeName:Y.ZodDate,...K(t)});class To extends re{_parse(e){if(this._getType(e)!==R.symbol){const n=this._getOrReturnCtx(e);return O(n,{code:_.invalid_type,expected:R.symbol,received:n.parsedType}),q}return Ue(e.data)}}To.create=t=>new To({typeName:Y.ZodSymbol,...K(t)});class jo extends re{_parse(e){if(this._getType(e)!==R.undefined){const n=this._getOrReturnCtx(e);return O(n,{code:_.invalid_type,expected:R.undefined,received:n.parsedType}),q}return Ue(e.data)}}jo.create=t=>new jo({typeName:Y.ZodUndefined,...K(t)});class Eo extends re{_parse(e){if(this._getType(e)!==R.null){const n=this._getOrReturnCtx(e);return O(n,{code:_.invalid_type,expected:R.null,received:n.parsedType}),q}return Ue(e.data)}}Eo.create=t=>new Eo({typeName:Y.ZodNull,...K(t)});class oa extends re{constructor(){super(...arguments),this._any=!0}_parse(e){return Ue(e.data)}}oa.create=t=>new oa({typeName:Y.ZodAny,...K(t)});class Oo extends re{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ue(e.data)}}Oo.create=t=>new Oo({typeName:Y.ZodUnknown,...K(t)});class Rt extends re{_parse(e){const r=this._getOrReturnCtx(e);return O(r,{code:_.invalid_type,expected:R.never,received:r.parsedType}),q}}Rt.create=t=>new Rt({typeName:Y.ZodNever,...K(t)});class Do extends re{_parse(e){if(this._getType(e)!==R.undefined){const n=this._getOrReturnCtx(e);return O(n,{code:_.invalid_type,expected:R.void,received:n.parsedType}),q}return Ue(e.data)}}Do.create=t=>new Do({typeName:Y.ZodVoid,...K(t)});class ct extends re{_parse(e){const{ctx:r,status:n}=this._processInputParams(e),s=this._def;if(r.parsedType!==R.array)return O(r,{code:_.invalid_type,expected:R.array,received:r.parsedType}),q;if(s.exactLength!==null){const i=r.data.length>s.exactLength.value,o=r.data.length<s.exactLength.value;(i||o)&&(O(r,{code:i?_.too_big:_.too_small,minimum:o?s.exactLength.value:void 0,maximum:i?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&&(O(r,{code:_.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&&(O(r,{code:_.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((i,o)=>s.type._parseAsync(new Dt(r,i,r.path,o)))).then(i=>Ve.mergeArray(n,i));const a=[...r.data].map((i,o)=>s.type._parseSync(new Dt(r,i,r.path,o)));return Ve.mergeArray(n,a)}get element(){return this._def.type}min(e,r){return new ct({...this._def,minLength:{value:e,message:M.toString(r)}})}max(e,r){return new ct({...this._def,maxLength:{value:e,message:M.toString(r)}})}length(e,r){return new ct({...this._def,exactLength:{value:e,message:M.toString(r)}})}nonempty(e){return this.min(1,e)}}ct.create=(t,e)=>new ct({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Y.ZodArray,...K(e)});function or(t){if(t instanceof ye){const e={};for(const r in t.shape){const n=t.shape[r];e[r]=Tt.create(or(n))}return new ye({...t._def,shape:()=>e})}else return t instanceof ct?new ct({...t._def,type:or(t.element)}):t instanceof Tt?Tt.create(or(t.unwrap())):t instanceof br?br.create(or(t.unwrap())):t instanceof Ut?Ut.create(t.items.map(e=>or(e))):t}class ye extends re{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),r=ne.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==R.object){const u=this._getOrReturnCtx(e);return O(u,{code:_.invalid_type,expected:R.object,received:u.parsedType}),q}const{status:n,ctx:s}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof Rt&&this._def.unknownKeys==="strip"))for(const u in s.data)i.includes(u)||o.push(u);const c=[];for(const u of i){const f=a[u],d=s.data[u];c.push({key:{status:"valid",value:u},value:f._parse(new Dt(s,d,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof Rt){const u=this._def.unknownKeys;if(u==="passthrough")for(const f of o)c.push({key:{status:"valid",value:f},value:{status:"valid",value:s.data[f]}});else if(u==="strict")o.length>0&&(O(s,{code:_.unrecognized_keys,keys:o}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const f of o){const d=s.data[f];c.push({key:{status:"valid",value:f},value:u._parse(new Dt(s,d,s.path,f)),alwaysSet:f in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const u=[];for(const f of c){const d=await f.key,m=await f.value;u.push({key:d,value:m,alwaysSet:f.alwaysSet})}return u}).then(u=>Ve.mergeObjectSync(n,u)):Ve.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return M.errToObj,new ye({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{const s=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:M.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new ye({...this._def,unknownKeys:"strip"})}passthrough(){return new ye({...this._def,unknownKeys:"passthrough"})}extend(e){return new ye({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ye({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Y.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new ye({...this._def,catchall:e})}pick(e){const r={};for(const n of ne.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new ye({...this._def,shape:()=>r})}omit(e){const r={};for(const n of ne.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new ye({...this._def,shape:()=>r})}deepPartial(){return or(this)}partial(e){const r={};for(const n of ne.objectKeys(this.shape)){const s=this.shape[n];e&&!e[n]?r[n]=s:r[n]=s.optional()}return new ye({...this._def,shape:()=>r})}required(e){const r={};for(const n of ne.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof Tt;)a=a._def.innerType;r[n]=a}return new ye({...this._def,shape:()=>r})}keyof(){return ud(ne.objectKeys(this.shape))}}ye.create=(t,e)=>new ye({shape:()=>t,unknownKeys:"strip",catchall:Rt.create(),typeName:Y.ZodObject,...K(e)});ye.strictCreate=(t,e)=>new ye({shape:()=>t,unknownKeys:"strict",catchall:Rt.create(),typeName:Y.ZodObject,...K(e)});ye.lazycreate=(t,e)=>new ye({shape:t,unknownKeys:"strip",catchall:Rt.create(),typeName:Y.ZodObject,...K(e)});class $n extends re{_parse(e){const{ctx:r}=this._processInputParams(e),n=this._def.options;function s(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;const i=a.map(o=>new yt(o.ctx.common.issues));return O(r,{code:_.invalid_union,unionErrors:i}),q}if(r.common.async)return Promise.all(n.map(async a=>{const i={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}})).then(s);{let a;const i=[];for(const c of n){const u={...r,common:{...r.common,issues:[]},parent:null},f=c._parseSync({data:r.data,path:r.path,parent:u});if(f.status==="valid")return f;f.status==="dirty"&&!a&&(a={result:f,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(c=>new yt(c));return O(r,{code:_.invalid_union,unionErrors:o}),q}}get options(){return this._def.options}}$n.create=(t,e)=>new $n({options:t,typeName:Y.ZodUnion,...K(e)});function la(t,e){const r=Nt(t),n=Nt(e);if(t===e)return{valid:!0,data:t};if(r===R.object&&n===R.object){const s=ne.objectKeys(e),a=ne.objectKeys(t).filter(o=>s.indexOf(o)!==-1),i={...t,...e};for(const o of a){const c=la(t[o],e[o]);if(!c.valid)return{valid:!1};i[o]=c.data}return{valid:!0,data:i}}else if(r===R.array&&n===R.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let a=0;a<t.length;a++){const i=t[a],o=e[a],c=la(i,o);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return r===R.date&&n===R.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class zn extends re{_parse(e){const{status:r,ctx:n}=this._processInputParams(e),s=(a,i)=>{if(So(a)||So(i))return q;const o=la(a.value,i.value);return o.valid?((No(a)||No(i))&&r.dirty(),{status:r.value,value:o.data}):(O(n,{code:_.invalid_intersection_types}),q)};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(([a,i])=>s(a,i)):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}))}}zn.create=(t,e,r)=>new zn({left:t,right:e,typeName:Y.ZodIntersection,...K(r)});class Ut extends re{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==R.array)return O(n,{code:_.invalid_type,expected:R.array,received:n.parsedType}),q;if(n.data.length<this._def.items.length)return O(n,{code:_.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),q;!this._def.rest&&n.data.length>this._def.items.length&&(O(n,{code:_.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const a=[...n.data].map((i,o)=>{const c=this._def.items[o]||this._def.rest;return c?c._parse(new Dt(n,i,n.path,o)):null}).filter(i=>!!i);return n.common.async?Promise.all(a).then(i=>Ve.mergeArray(r,i)):Ve.mergeArray(r,a)}get items(){return this._def.items}rest(e){return new Ut({...this._def,rest:e})}}Ut.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ut({items:t,typeName:Y.ZodTuple,rest:null,...K(e)})};class Ro extends re{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==R.map)return O(n,{code:_.invalid_type,expected:R.map,received:n.parsedType}),q;const s=this._def.keyType,a=this._def.valueType,i=[...n.data.entries()].map(([o,c],u)=>({key:s._parse(new Dt(n,o,n.path,[u,"key"])),value:a._parse(new Dt(n,c,n.path,[u,"value"]))}));if(n.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const c of i){const u=await c.key,f=await c.value;if(u.status==="aborted"||f.status==="aborted")return q;(u.status==="dirty"||f.status==="dirty")&&r.dirty(),o.set(u.value,f.value)}return{status:r.value,value:o}})}else{const o=new Map;for(const c of i){const u=c.key,f=c.value;if(u.status==="aborted"||f.status==="aborted")return q;(u.status==="dirty"||f.status==="dirty")&&r.dirty(),o.set(u.value,f.value)}return{status:r.value,value:o}}}}Ro.create=(t,e,r)=>new Ro({valueType:e,keyType:t,typeName:Y.ZodMap,...K(r)});class Zr extends re{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==R.set)return O(n,{code:_.invalid_type,expected:R.set,received:n.parsedType}),q;const s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(O(n,{code:_.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&&(O(n,{code:_.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());const a=this._def.valueType;function i(c){const u=new Set;for(const f of c){if(f.status==="aborted")return q;f.status==="dirty"&&r.dirty(),u.add(f.value)}return{status:r.value,value:u}}const o=[...n.data.values()].map((c,u)=>a._parse(new Dt(n,c,n.path,u)));return n.common.async?Promise.all(o).then(c=>i(c)):i(o)}min(e,r){return new Zr({...this._def,minSize:{value:e,message:M.toString(r)}})}max(e,r){return new Zr({...this._def,maxSize:{value:e,message:M.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}Zr.create=(t,e)=>new Zr({valueType:t,minSize:null,maxSize:null,typeName:Y.ZodSet,...K(e)});class Ao extends re{get schema(){return this._def.getter()}_parse(e){const{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}Ao.create=(t,e)=>new Ao({getter:t,typeName:Y.ZodLazy,...K(e)});class Mo extends re{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return O(r,{received:r.data,code:_.invalid_literal,expected:this._def.value}),q}return{status:"valid",value:e.data}}get value(){return this._def.value}}Mo.create=(t,e)=>new Mo({value:t,typeName:Y.ZodLiteral,...K(e)});function ud(t,e){return new vr({values:t,typeName:Y.ZodEnum,...K(e)})}class vr extends re{_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),n=this._def.values;return O(r,{expected:ne.joinValues(n),received:r.parsedType,code:_.invalid_type}),q}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const r=this._getOrReturnCtx(e),n=this._def.values;return O(r,{received:r.data,code:_.invalid_enum_value,options:n}),q}return Ue(e.data)}get options(){return this._def.values}get enum(){const e={};for(const r of this._def.values)e[r]=r;return e}get Values(){const e={};for(const r of this._def.values)e[r]=r;return e}get Enum(){const e={};for(const r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return vr.create(e,{...this._def,...r})}exclude(e,r=this._def){return vr.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}}vr.create=ud;class Io extends re{_parse(e){const r=ne.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==R.string&&n.parsedType!==R.number){const s=ne.objectValues(r);return O(n,{expected:ne.joinValues(s),received:n.parsedType,code:_.invalid_type}),q}if(this._cache||(this._cache=new Set(ne.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const s=ne.objectValues(r);return O(n,{received:n.data,code:_.invalid_enum_value,options:s}),q}return Ue(e.data)}get enum(){return this._def.values}}Io.create=(t,e)=>new Io({values:t,typeName:Y.ZodNativeEnum,...K(e)});class Wn extends re{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==R.promise&&r.common.async===!1)return O(r,{code:_.invalid_type,expected:R.promise,received:r.parsedType}),q;const n=r.parsedType===R.promise?r.data:Promise.resolve(r.data);return Ue(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}}Wn.create=(t,e)=>new Wn({type:t,typeName:Y.ZodPromise,...K(e)});class xr extends re{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Y.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:r,ctx:n}=this._processInputParams(e),s=this._def.effect||null,a={addIssue:i=>{O(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),s.type==="preprocess"){const i=s.transform(n.data,a);if(n.common.async)return Promise.resolve(i).then(async o=>{if(r.value==="aborted")return q;const c=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return c.status==="aborted"?q:c.status==="dirty"||r.value==="dirty"?Mr(c.value):c});{if(r.value==="aborted")return q;const o=this._def.schema._parseSync({data:i,path:n.path,parent:n});return o.status==="aborted"?q:o.status==="dirty"||r.value==="dirty"?Mr(o.value):o}}if(s.type==="refinement"){const i=o=>{const c=s.refinement(o,a);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 o};if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?q:(o.status==="dirty"&&r.dirty(),i(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?q:(o.status==="dirty"&&r.dirty(),i(o.value).then(()=>({status:r.value,value:o.value}))))}if(s.type==="transform")if(n.common.async===!1){const i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!yr(i))return q;const o=s.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>yr(i)?Promise.resolve(s.transform(i.value,a)).then(o=>({status:r.value,value:o})):q);ne.assertNever(s)}}xr.create=(t,e,r)=>new xr({schema:t,typeName:Y.ZodEffects,effect:e,...K(r)});xr.createWithPreprocess=(t,e,r)=>new xr({schema:e,effect:{type:"preprocess",transform:t},typeName:Y.ZodEffects,...K(r)});class Tt extends re{_parse(e){return this._getType(e)===R.undefined?Ue(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Tt.create=(t,e)=>new Tt({innerType:t,typeName:Y.ZodOptional,...K(e)});class br extends re{_parse(e){return this._getType(e)===R.null?Ue(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}br.create=(t,e)=>new br({innerType:t,typeName:Y.ZodNullable,...K(e)});class ca extends re{_parse(e){const{ctx:r}=this._processInputParams(e);let n=r.data;return r.parsedType===R.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}ca.create=(t,e)=>new ca({innerType:t,typeName:Y.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...K(e)});class ua extends re{_parse(e){const{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Ln(s)?s.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new yt(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new yt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}ua.create=(t,e)=>new ua({innerType:t,typeName:Y.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...K(e)});class Po extends re{_parse(e){if(this._getType(e)!==R.nan){const n=this._getOrReturnCtx(e);return O(n,{code:_.invalid_type,expected:R.nan,received:n.parsedType}),q}return{status:"valid",value:e.data}}}Po.create=t=>new Po({typeName:Y.ZodNaN,...K(t)});class fx extends re{_parse(e){const{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class Ka extends re{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?q:a.status==="dirty"?(r.dirty(),Mr(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?q:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,r){return new Ka({in:e,out:r,typeName:Y.ZodPipeline})}}class da extends re{_parse(e){const r=this._def.innerType._parse(e),n=s=>(yr(s)&&(s.value=Object.freeze(s.value)),s);return Ln(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}}da.create=(t,e)=>new da({innerType:t,typeName:Y.ZodReadonly,...K(e)});var Y;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Y||(Y={}));const hx=oa.create;Rt.create;ct.create;const mx=ye.create;$n.create;zn.create;Ut.create;vr.create;Wn.create;Tt.create;br.create;function px(t){const e=[];for(const r of t.sections)for(const n of r.fields)Array.isArray(n)?e.push(...n):e.push(n);return e}function gx(t){const e={};for(const n of t.sections)for(const s of n.fields){const a=Array.isArray(s)?s:[s];for(const i of a)e[i.name]=i.schema??hx().optional()}let r=mx(e);return t.crossRules?.length&&(r=r.superRefine((n,s)=>{for(const a of t.crossRules)a(n,s)})),r}function yx(t,e){const r=t.defaultValues?.(e)??{},n=px(t),s={...r};for(const a of n)a.defaultValue!==void 0&&s[a.name]===void 0&&(s[a.name]=a.defaultValue);return s}var vx=t=>t.type==="checkbox",Ir=t=>t instanceof Date,Qa=t=>t==null;const dd=t=>typeof t=="object";var Ht=t=>!Qa(t)&&!Array.isArray(t)&&dd(t)&&!Ir(t),xx=t=>Ht(t)&&t.target?vx(t.target)?t.target.checked:t.target.value:t,bx=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,wx=(t,e)=>t.has(bx(e)),kx=t=>{const e=t.constructor&&t.constructor.prototype;return Ht(e)&&e.hasOwnProperty("isPrototypeOf")},Sx=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function fd(t){if(t instanceof Date)return new Date(t);const e=typeof FileList<"u"&&t instanceof FileList;if(Sx&&(t instanceof Blob||e))return t;const r=Array.isArray(t);if(!r&&!(Ht(t)&&kx(t)))return t;const n=r?[]:Object.create(Object.getPrototypeOf(t));for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[s]=fd(t[s]));return n}var hd=t=>/^\w*$/.test(t),fa=t=>t===void 0,Nx=t=>Array.isArray(t)?t.filter(Boolean):[],md=t=>Nx(t.replace(/["|']|\]/g,"").split(/\.|\[/)),Oe=(t,e,r)=>{if(!e||!Ht(t))return r;const n=(hd(e)?[e]:md(e)).reduce((s,a)=>Qa(s)?s:s[a],t);return fa(n)||n===t?fa(t[e])?r:t[e]:n},Vs=t=>typeof t=="boolean",vn=t=>typeof t=="function",Fo=(t,e,r)=>{let n=-1;const s=hd(e)?[e]:md(e),a=s.length,i=a-1;for(;++n<a;){const o=s[n];let c=r;if(n!==i){const u=t[o];c=Ht(u)||Array.isArray(u)?u:isNaN(+s[n+1])?{}:[]}if(o==="__proto__"||o==="constructor"||o==="prototype")return;t[o]=c,t=t[o]}};const Lo={BLUR:"blur",CHANGE:"change"},Vo={all:"all"},ei=b.createContext(null);ei.displayName="HookFormContext";const ti=()=>b.useContext(ei),Cx=t=>{const{children:e,...r}=t;return b.createElement(ei.Provider,{value:r},e)};var _x=(t,e,r,n=!0)=>{const s={defaultValues:e._defaultValues};for(const a in t)Object.defineProperty(s,a,{get:()=>{const i=a;return e._proxyFormState[i]!==Vo.all&&(e._proxyFormState[i]=!n||Vo.all),r&&(r[i]=!0),t[i]}});return s};const pd=typeof window<"u"?b.useLayoutEffect:b.useEffect;function Tx(t){const e=ti(),{control:r=e.control,disabled:n,name:s,exact:a}=t||{},[i,o]=b.useState(r._formState),c=b.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return pd(()=>r._subscribe({name:s,formState:c.current,exact:a,callback:u=>{!n&&o({...r._formState,...u})}}),[s,n,a]),b.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),b.useMemo(()=>_x(i,r,c.current,!1),[i,r])}var jx=t=>typeof t=="string",$o=(t,e,r,n,s)=>jx(t)?Oe(r,t,s):Array.isArray(t)?t.map(a=>Oe(r,a)):r,zo=t=>Qa(t)||!dd(t);function _n(t,e,r=new WeakSet){if(zo(t)||zo(e))return Object.is(t,e);if(Ir(t)&&Ir(e))return Object.is(t.getTime(),e.getTime());const n=Object.keys(t),s=Object.keys(e);if(n.length!==s.length)return!1;if(r.has(t)||r.has(e))return!0;r.add(t),r.add(e);for(const a of n){const i=t[a];if(!s.includes(a))return!1;if(a!=="ref"){const o=e[a];if(Ir(i)&&Ir(o)||Ht(i)&&Ht(o)||Array.isArray(i)&&Array.isArray(o)?!_n(i,o,r):!Object.is(i,o))return!1}}return!0}function gd(t){const e=ti(),{control:r=e.control,name:n,defaultValue:s,disabled:a,exact:i,compute:o}=t||{},c=b.useRef(s),u=b.useRef(o),f=b.useRef(void 0),d=b.useRef(r),m=b.useRef(n);u.current=o;const[p,y]=b.useState(()=>{const k=r._getWatch(n,c.current);return u.current?u.current(k):k}),g=b.useCallback(k=>{const w=$o(n,r._names,k||r._formValues,!1,c.current);return u.current?u.current(w):w},[r._formValues,r._names,n]),x=b.useCallback(k=>{if(!a){const w=$o(n,r._names,k||r._formValues,!1,c.current);if(u.current){const j=u.current(w);_n(j,f.current)||(y(j),f.current=j)}else y(w)}},[r._formValues,r._names,a,n]);pd(()=>((d.current!==r||!_n(m.current,n))&&(d.current=r,m.current=n,x()),r._subscribe({name:n,formState:{values:!0},exact:i,callback:k=>{x(k.values)}})),[r,i,n,x]),b.useEffect(()=>r._removeUnmounted());const v=d.current!==r,S=m.current,C=b.useMemo(()=>{if(a)return null;const k=!v&&!_n(S,n);return v||k?g():null},[a,v,n,S,g]);return C!==null?C:p}function Ex(t){const e=ti(),{name:r,disabled:n,control:s=e.control,shouldUnregister:a,defaultValue:i,exact:o=!0}=t,c=wx(s._names.array,r),u=b.useMemo(()=>Oe(s._formValues,r,Oe(s._defaultValues,r,i)),[s,r,i]),f=gd({control:s,name:r,defaultValue:u,exact:o}),d=Tx({control:s,name:r,exact:o}),m=b.useRef(t),p=b.useRef(void 0),y=b.useRef(s.register(r,{...t.rules,value:f,...Vs(t.disabled)?{disabled:t.disabled}:{}}));m.current=t;const g=b.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Oe(d.errors,r)},isDirty:{enumerable:!0,get:()=>!!Oe(d.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!Oe(d.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!Oe(d.validatingFields,r)},error:{enumerable:!0,get:()=>Oe(d.errors,r)}}),[d,r]),x=b.useCallback(k=>y.current.onChange({target:{value:xx(k),name:r},type:Lo.CHANGE}),[r]),v=b.useCallback(()=>y.current.onBlur({target:{value:Oe(s._formValues,r),name:r},type:Lo.BLUR}),[r,s._formValues]),S=b.useCallback(k=>{const w=Oe(s._fields,r);w&&w._f&&k&&(w._f.ref={focus:()=>vn(k.focus)&&k.focus(),select:()=>vn(k.select)&&k.select(),setCustomValidity:j=>vn(k.setCustomValidity)&&k.setCustomValidity(j),reportValidity:()=>vn(k.reportValidity)&&k.reportValidity()})},[s._fields,r]),C=b.useMemo(()=>({name:r,value:f,...Vs(n)||d.disabled?{disabled:d.disabled||n}:{},onChange:x,onBlur:v,ref:S}),[r,n,d.disabled,x,v,S,f]);return b.useEffect(()=>{const k=s._options.shouldUnregister||a,w=p.current;w&&w!==r&&!c&&s.unregister(w),s.register(r,{...m.current.rules,...Vs(m.current.disabled)?{disabled:m.current.disabled}:{}});const j=(T,A)=>{const $=Oe(s._fields,T);$&&$._f&&($._f.mount=A)};if(j(r,!0),k){const T=fd(Oe(s._options.defaultValues,r,m.current.defaultValue));Fo(s._defaultValues,r,T),fa(Oe(s._formValues,r))&&Fo(s._formValues,r,T)}return!c&&s.register(r),p.current=r,()=>{(c?k&&!s._state.action:k)?s.unregister(r):j(r,!1)}},[r,s,c,a]),b.useEffect(()=>{s._setDisabledField({disabled:n,name:r})},[n,r,s]),b.useMemo(()=>({field:C,formState:d,fieldState:g}),[C,d,g])}const Ox=t=>t.render(Ex(t));function Dx({form:t,field:e}){const[r,n]=b.useState(!1);return l.jsx(Ox,{control:t.control,name:e.name,render:({field:s,fieldState:{error:a}})=>{const i=u=>e.normalize?e.normalize(u):u,o=()=>{e.deps?.onChangeTrigger&&t.trigger(e.deps.onChangeTrigger)},c={className:e.className,error:a?.message,required:!e.schema?.isOptional?.()};switch(e.kind){case"custom":if(!e.render)throw new Error(`Field ${e.name} marked as custom but has no render function`);return l.jsx("div",{className:e.className,children:e.render({form:t})});case"input":return l.jsxs(st,{...c,children:[l.jsxs(at,{children:[e.label,e.labelAddon]}),l.jsx(Xe,{children:l.jsx($r,{type:"text",placeholder:e.placeholder,value:s.value??"",onChange:u=>{s.onChange(i(u.target.value)),o()},onBlur:s.onBlur})}),l.jsx(Je,{})]});case"password":return l.jsxs(st,{...c,children:[l.jsxs(at,{children:[e.label,e.labelAddon]}),l.jsx(Xe,{children:l.jsxs("div",{className:"relative flex w-full items-center",children:[l.jsx($r,{type:r?"text":"password",placeholder:e.placeholder,value:s.value??"",className:"pr-10",onChange:u=>{const f=u.target.value;s.onChange(i(f)),o()},onBlur:s.onBlur}),l.jsx(Le,{type:"button",variant:"ghost",className:"absolute right-3 flex items-center justify-center text-slate-400 hover:text-slate-600 focus:outline-none",onClick:()=>n(!r),tabIndex:-1,children:r?l.jsx(J.EyeOff,{className:"h-4 w-4"}):l.jsx(J.Eye,{className:"h-4 w-4"})})]})}),l.jsx(Je,{})]});case"textarea":return l.jsxs(st,{...c,children:[l.jsxs(at,{children:[e.label,e.labelAddon]}),l.jsx(Xe,{children:l.jsx("textarea",{className:"oniratec-field__textarea",value:s.value??"",placeholder:e.placeholder,rows:4,onChange:u=>{s.onChange(i(u.target.value)),o()},onBlur:s.onBlur})}),l.jsx(Je,{})]});case"select":return l.jsxs(st,{...c,children:[l.jsxs(at,{children:[e.label,e.labelAddon]}),l.jsx(Xe,{children:l.jsxs(fs,{value:s.value||void 0,onValueChange:u=>{s.onChange(i(u||void 0)),o()},children:[l.jsx(Kr,{children:l.jsx(hs,{})}),l.jsx(Qr,{children:(e.options??[]).map(u=>l.jsx(en,{value:String(u.value),children:u.label},u.value))})]})}),l.jsx(Je,{})]});case"asyncSelect":return l.jsxs(st,{...c,children:[l.jsxs(at,{children:[e.label,e.labelAddon]}),l.jsx(Xe,{children:l.jsx(Ga,{value:s.value||void 0,onValueChange:u=>{s.onChange(i(u)),o()},placeholder:e.placeholder,searchPlaceholder:e.searchPlaceholder,minChars:e.minChars,debounceMs:e.debounceMs,fetcher:e.fetcher,getOptionValue:e.getOptionValue,getOptionLabel:e.getOptionLabel,emptyLabel:e.emptyLabel,emptyActionLabel:e.emptyActionLabel,onEmptyActionClick:e.onEmptyActionClick,hasError:!!a?.message})}),l.jsx(Je,{})]});case"toggle":return l.jsxs(st,{...c,children:[l.jsxs(at,{children:[e.label,e.labelAddon]}),l.jsx(Xe,{children:l.jsx(tn,{checked:!!s.value,onChange:u=>{s.onChange(i(u)),o()}})}),l.jsx(Je,{})]});case"checkbox":return l.jsxs(st,{...c,children:[l.jsx(Xe,{children:l.jsxs("label",{className:"oniratec-checkbox",children:[l.jsx("input",{type:"checkbox",checked:!!s.value,onChange:u=>{s.onChange(i(u.target.checked)),o()},onBlur:s.onBlur}),l.jsx("span",{children:e.label})]})}),l.jsx(Je,{})]});case"date":return l.jsxs(st,{...c,children:[l.jsxs(at,{children:[e.label,e.labelAddon]}),l.jsx(Xe,{children:l.jsx(ns,{value:s.value,onChange:u=>{s.onChange(i(u)),o()},placeholder:e.placeholder,min:e.min,max:e.max,timeZone:e.timeZone,isInvalid:!!a?.message})}),l.jsx(Je,{})]});case"fileUpload":{const u=Array.isArray(s.value)?s.value:[];return l.jsxs(st,{...c,children:[l.jsxs(at,{children:[e.label,e.labelAddon]}),l.jsx(Xe,{children:l.jsx(us,{files:u,onFilesChange:f=>{s.onChange(i(f)),o()},accept:e.accept,multiple:e.multiple,helperText:e.helperText,allowDrop:e.allowDrop,placeholder:e.placeholder,defaultPreviewUrl:e.defaultPreviewUrl})}),l.jsx(Je,{})]})}}}})}function Rx(t){return Array.isArray(t)?t:[t]}function yd({config:t,form:e,onSubmitAction:r,handleErrors:n,submitLabel:s,maxWidthClass:a,children:i}){const o=gd({control:e.control});return l.jsx(Cx,{...e,children:l.jsxs("form",{onSubmit:e.handleSubmit(r,c=>n(c)),className:N("space-y-8",a),children:[t.sections.map((c,u)=>l.jsxs(b.Fragment,{children:[l.jsxs("section",{className:"space-y-4",children:[l.jsx("h3",{className:"oniratec-form__section-title",children:c.title}),l.jsx("div",{className:"space-y-4",children:c.fields.map((f,d)=>{const m=Rx(f).filter(g=>!g.hidden?.(o));if(!m.length)return null;const p=m.reduce((g,x)=>g+(x.colSpan??1),0),y=p>1?N("grid gap-4",p===2&&"grid-cols-2",p===3&&"grid-cols-3",p===4&&"grid-cols-4"):"";return l.jsx("div",{className:y,children:m.map(g=>l.jsx("div",{className:g.colSpan?`col-span-${g.colSpan}`:void 0,children:l.jsx(Dx,{form:e,field:g})},g.name))},d)})})]},c.title),u<t.sections.length-1&&l.jsx(b.Fragment,{children:l.jsx("hr",{className:"oniratec-form__separator"})})]},`fragment-${c.title}`)),i,l.jsx("div",{className:"oniratec-form__actions",children:l.jsx(Le,{type:"submit",loading:e.formState.isSubmitting,children:s})})]})})}function Ax(t){return l.jsx(yd,{...t})}const Mx=t=>t==="center"?"text-center":t==="right"?"text-right":"text-left",Ix=t=>{if(t)return typeof t=="number"?`w-[${t}px]`:t.startsWith("w-")?t:`w-[${t}]`},Px=t=>t?Array.isArray(t)?t:[t]:[];function vd(t){return{columns:t.columns.map(n=>{const s=Mx(n.align),a=Ix(n.width),i=[s,a,n.className].filter(Boolean).join(" "),o=[s,a,n.headerClassName].filter(Boolean).join(" ");return{key:n.id,header:n.header,render:n.cell??(c=>String(n.accessor?.(c)??"")),className:i||void 0,headerClassName:o||void 0,sortable:n.sortable??!!(n.sortFn||n.accessor),sortFn:n.sortFn,sortValue:n.accessor}}),getSortDirection:(n,s)=>Px(n).find(o=>o.columnId===s)?.direction??null}}function Fx(t,e,r){const{columns:n}=vd(t);return l.jsx(sd,{columns:n,data:e,...r})}const Lx=t=>t.reduce((e,r)=>r.type==="toggle"?(e[r.id]=r.value??!1,e):r.type==="date"?(e[r.id]=r.value??null,e):(e[r.id]=r.value??"",e),{});function Vx(t){const e=Lx(t.filters),r=(a,i,o)=>({...a,[i]:o}),n=()=>({...e}),s=a=>t.buildQueryParams?t.buildQueryParams(a):a;return{filters:t.filters,initialState:e,updateFilter:r,resetState:n,buildQueryParams:s}}function xd(t,e,r,n){return l.jsx(id,{filters:t.filters,value:e,onChange:r,onReset:n?.onReset,resetLabel:n?.resetLabel,showReset:n?.showReset,className:n?.className,layout:n?.layout,actions:n?.actions})}function $x(t,e,r,n){return l.jsx(od,{title:n.title,description:n.description,isOpen:n.isOpen,onOpenChange:n.onOpenChange,onApply:n.onApply,applyLabel:n.applyLabel,closeLabel:n.closeLabel,className:n.className,children:xd(t,e,r,n.panel)})}function zx(t,e,r){const n=new Set(t.filter(s=>s.type==="date").map(s=>s.id));return Object.entries(e).reduce((s,[a,i])=>i==null?(s[a]=void 0,s):n.has(a)&&i instanceof Date?(s[a]=eu(i,r?.timeZone)??void 0,s):(s[a]=i,s),{})}function Wx(...t){return Wo.twMerge(ha.clsx(t))}exports.Alert=tl;exports.AlertDescription=nl;exports.AlertTitle=rl;exports.AsyncSelect=Ga;exports.AuthLayout=nd;exports.Badge=pa;exports.Box=Qd;exports.Breadcrumbs=jv;exports.Button=Le;exports.Card=zs;exports.CardAction=lf;exports.CardContent=Qo;exports.CardDescription=of;exports.CardFooter=cf;exports.CardHeader=Jo;exports.CardTitle=Ko;exports.Checkbox=al;exports.ConfirmDialog=Ev;exports.DEFAULT_TIME_ZONE=In;exports.DashboardLayout=Rv;exports.DataTable=sd;exports.DatePicker=ns;exports.Dialog=bu;exports.DialogClose=wy;exports.DialogContent=Wa;exports.DialogDescription=Ha;exports.DialogFooter=Ba;exports.DialogHeader=Za;exports.DialogOverlay=za;exports.DialogPortal=wu;exports.DialogTitle=Ua;exports.DialogTrigger=by;exports.DropdownMenu=Sy;exports.DropdownMenuCheckboxItem=Nu;exports.DropdownMenuContent=ku;exports.DropdownMenuGroup=Cy;exports.DropdownMenuItem=Su;exports.DropdownMenuLabel=_u;exports.DropdownMenuPortal=_y;exports.DropdownMenuRadioGroup=jy;exports.DropdownMenuRadioItem=Cu;exports.DropdownMenuSeparator=Tu;exports.DropdownMenuShortcut=Ou;exports.DropdownMenuSub=Ty;exports.DropdownMenuSubContent=Eu;exports.DropdownMenuSubTrigger=ju;exports.DropdownMenuTrigger=Ny;exports.Field=st;exports.FieldControl=Xe;exports.FieldLabel=at;exports.FieldMessage=Je;exports.FilePicker=Dy;exports.FileUpload=us;exports.FiltersModal=od;exports.FiltersPanel=id;exports.FormFactoryRenderer=yd;exports.ImportFileCard=Fv;exports.Input=$r;exports.Kbd=Au;exports.KpiCard=Lv;exports.Logo=af;exports.NotFoundState=Ry;exports.PageHeader=Vv;exports.PageSizeSelector=ad;exports.Pagination=Iv;exports.PasswordInput=Ru;exports.PersonAvatar=Jd;exports.ProfileAvatar=Kd;exports.Progress=Mu;exports.RadioGroup=My;exports.RadioGroupItem=Pu;exports.Select=fs;exports.SelectContent=Qr;exports.SelectGroup=Iy;exports.SelectItem=en;exports.SelectLabel=Fu;exports.SelectScrollDownButton=Ya;exports.SelectScrollUpButton=qa;exports.SelectSeparator=Lu;exports.SelectTrigger=Kr;exports.SelectValue=hs;exports.Separator=Vu;exports.Sheet=Fy;exports.SheetClose=Vy;exports.SheetContent=zu;exports.SheetDescription=Uu;exports.SheetFooter=Zu;exports.SheetHeader=Wu;exports.SheetOverlay=Xa;exports.SheetPortal=$u;exports.SheetTitle=Bu;exports.SheetTrigger=Ly;exports.Skeleton=sa;exports.Switch=Gy;exports.Tabs=zy;exports.TabsContent=Xu;exports.TabsList=Yu;exports.TabsTrigger=Gu;exports.Textarea=Hu;exports.ThemeProvider=$v;exports.Toaster=Nv;exports.Toggle=tn;exports.Tooltip=_v;exports.TooltipContent=rd;exports.TooltipProvider=Cv;exports.TooltipTrigger=Tv;exports.alertVariants=el;exports.badgeVariants=sl;exports.buildDefaultValues=yx;exports.buildFiltersQueryParams=zx;exports.buildZodSchema=gx;exports.buttonVariants=Xo;exports.cn=Wx;exports.createFiltersFactory=Vx;exports.createTableFactory=vd;exports.isValidTimeZone=Pn;exports.renderFiltersModal=$x;exports.renderFiltersPanel=xd;exports.renderFormFactory=Ax;exports.renderTable=Fx;exports.resolveTimeZone=Jr;exports.setDefaultTimeZone=ny;exports.toDateTime=sy;exports.toISODate=eu;exports.toISODateTime=ay;exports.toast=fv;exports.useField=ds;
46
46
  //# sourceMappingURL=index.cjs.map