@boxcustodia/library 1.9.2 → 1.9.3

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.js CHANGED
@@ -123,7 +123,7 @@ __p += '`),Ge&&(ge+=`' +
123
123
  function print() { __p += __j.call(arguments, '') }
124
124
  `:`;
125
125
  `)+ge+`return __p
126
- }`;var qe=Ux(function(){return Xe(I,$e+"return "+ge).apply(r,B)});if(qe.source=ge,Mm(qe))throw qe;return qe}function X2(a){return Je(a).toLowerCase()}function Z2(a){return Je(a).toUpperCase()}function Q2(a,u,m){if(a=Je(a),a&&(m||u===r))return ty(a);if(!a||!(u=yr(u)))return a;var E=Ur(a),$=Ur(u),I=ry(E,$),B=ny(E,$)+1;return fo(E,I,B).join("")}function J2(a,u,m){if(a=Je(a),a&&(m||u===r))return a.slice(0,iy(a)+1);if(!a||!(u=yr(u)))return a;var E=Ur(a),$=ny(E,Ur(u))+1;return fo(E,0,$).join("")}function eL(a,u,m){if(a=Je(a),a&&(m||u===r))return a.replace(Mp,"");if(!a||!(u=yr(u)))return a;var E=Ur(a),$=ry(E,Ur(u));return fo(E,$).join("")}function tL(a,u){var m=J,E=N;if(Et(u)){var $="separator"in u?u.separator:$;m="length"in u?Fe(u.length):m,E="omission"in u?yr(u.omission):E}a=Je(a);var I=a.length;if(Ti(a)){var B=Ur(a);I=B.length}if(m>=I)return a;var z=m-$i(E);if(z<1)return E;var ee=B?fo(B,0,z).join(""):a.slice(0,z);if($===r)return ee+E;if(B&&(z+=ee.length-z),Om($)){if(a.slice(z).search($)){var me,he=ee;for($.global||($=Yp($.source,Je(Cb.exec($))+"g")),$.lastIndex=0;me=$.exec(he);)var ge=me.index;ee=ee.slice(0,ge===r?z:ge)}}else if(a.indexOf(yr($),z)!=z){var Re=ee.lastIndexOf($);Re>-1&&(ee=ee.slice(0,Re))}return ee+E}function rL(a){return a=Je(a),a&&Pp.test(a)?a.replace(Mc,DN):a}var nL=ki(function(a,u,m){return a+(m?" ":"")+u.toUpperCase()}),km=zy("toUpperCase");function Hx(a,u,m){return a=Je(a),u=m?r:u,u===r?SN(a)?NN(a):gN(a):a.match(u)||[]}var Ux=je(function(a,u){try{return gr(a,r,u)}catch(m){return Mm(m)?m:new ke(m)}}),oL=An(function(a,u){return Dr(u,function(m){m=dn(m),Tn(a,m,Am(a[m],a))}),a});function iL(a){var u=a==null?0:a.length,m=Me();return a=u?bt(a,function(E){if(typeof E[1]!="function")throw new Mr(s);return[m(E[0]),E[1]]}):[],je(function(E){for(var $=-1;++$<u;){var I=a[$];if(gr(I[0],this,E))return gr(I[1],this,E)}})}function aL(a){return DI(Nr(a,p))}function Lm(a){return function(){return a}}function sL(a,u){return a==null||a!==a?u:a}var lL=Yy(),uL=Yy(!0);function mr(a){return a}function Fm(a){return Py(typeof a=="function"?a:Nr(a,p))}function cL(a){return _y(Nr(a,p))}function dL(a,u){return Ty(a,Nr(u,p))}var fL=je(function(a,u){return function(m){return Na(m,a,u)}}),pL=je(function(a,u){return function(m){return Na(a,m,u)}});function qm(a,u,m){var E=Ut(u),$=rd(u,E);m==null&&!(Et(u)&&($.length||!E.length))&&(m=u,u=a,a=this,$=rd(u,Ut(u)));var I=!(Et(m)&&"chain"in m)||!!m.chain,B=Mn(a);return Dr($,function(z){var ee=u[z];a[z]=ee,B&&(a.prototype[z]=function(){var me=this.__chain__;if(I||me){var he=a(this.__wrapped__),ge=he.__actions__=dr(this.__actions__);return ge.push({func:ee,args:arguments,thisArg:a}),he.__chain__=me,he}return ee.apply(a,io([this.value()],arguments))})}),a}function mL(){return Gt._===this&&(Gt._=jN),this}function jm(){}function hL(a){return a=Fe(a),je(function(u){return $y(u,a)})}var vL=gm(bt),gL=gm(Xb),bL=gm(Vp);function zx(a){return Rm(a)?Kp(dn(a)):GI(a)}function yL(a){return function(u){return a==null?r:Wo(a,u)}}var xL=Zy(),wL=Zy(!0);function Bm(){return[]}function Vm(){return!1}function EL(){return{}}function CL(){return""}function RL(){return!0}function PL(a,u){if(a=Fe(a),a<1||a>j)return[];var m=ie,E=Qt(a,ie);u=Me(u),a-=ie;for(var $=Up(E,u);++m<a;)u(m);return $}function SL(a){return Le(a)?bt(a,dn):xr(a)?[a]:dr(px(Je(a)))}function _L(a){var u=++FN;return Je(a)+u}var TL=ld(function(a,u){return a+u},0),$L=bm("ceil"),AL=ld(function(a,u){return a/u},1),DL=bm("floor");function ML(a){return a&&a.length?td(a,mr,nm):r}function OL(a,u){return a&&a.length?td(a,Me(u,2),nm):r}function NL(a){return Jb(a,mr)}function IL(a,u){return Jb(a,Me(u,2))}function kL(a){return a&&a.length?td(a,mr,sm):r}function LL(a,u){return a&&a.length?td(a,Me(u,2),sm):r}var FL=ld(function(a,u){return a*u},1),qL=bm("round"),jL=ld(function(a,u){return a-u},0);function BL(a){return a&&a.length?Hp(a,mr):0}function VL(a,u){return a&&a.length?Hp(a,Me(u,2)):0}return O.after=c3,O.ary=Rx,O.assign=Z3,O.assignIn=Fx,O.assignInWith=wd,O.assignWith=Q3,O.at=J3,O.before=Px,O.bind=Am,O.bindAll=oL,O.bindKey=Sx,O.castArray=E3,O.chain=wx,O.chunk=Dk,O.compact=Mk,O.concat=Ok,O.cond=iL,O.conforms=aL,O.constant=Lm,O.countBy=B4,O.create=e2,O.curry=_x,O.curryRight=Tx,O.debounce=$x,O.defaults=t2,O.defaultsDeep=r2,O.defer=d3,O.delay=f3,O.difference=Nk,O.differenceBy=Ik,O.differenceWith=kk,O.drop=Lk,O.dropRight=Fk,O.dropRightWhile=qk,O.dropWhile=jk,O.fill=Bk,O.filter=K4,O.flatMap=U4,O.flatMapDeep=z4,O.flatMapDepth=G4,O.flatten=gx,O.flattenDeep=Vk,O.flattenDepth=Kk,O.flip=p3,O.flow=lL,O.flowRight=uL,O.fromPairs=Wk,O.functions=u2,O.functionsIn=c2,O.groupBy=Y4,O.initial=Uk,O.intersection=zk,O.intersectionBy=Gk,O.intersectionWith=Yk,O.invert=f2,O.invertBy=p2,O.invokeMap=Z4,O.iteratee=Fm,O.keyBy=Q4,O.keys=Ut,O.keysIn=pr,O.map=hd,O.mapKeys=h2,O.mapValues=v2,O.matches=cL,O.matchesProperty=dL,O.memoize=gd,O.merge=g2,O.mergeWith=qx,O.method=fL,O.methodOf=pL,O.mixin=qm,O.negate=bd,O.nthArg=hL,O.omit=b2,O.omitBy=y2,O.once=m3,O.orderBy=J4,O.over=vL,O.overArgs=h3,O.overEvery=gL,O.overSome=bL,O.partial=Dm,O.partialRight=Ax,O.partition=e3,O.pick=x2,O.pickBy=jx,O.property=zx,O.propertyOf=yL,O.pull=Jk,O.pullAll=yx,O.pullAllBy=e4,O.pullAllWith=t4,O.pullAt=r4,O.range=xL,O.rangeRight=wL,O.rearg=v3,O.reject=n3,O.remove=n4,O.rest=g3,O.reverse=Tm,O.sampleSize=i3,O.set=E2,O.setWith=C2,O.shuffle=a3,O.slice=o4,O.sortBy=u3,O.sortedUniq=d4,O.sortedUniqBy=f4,O.split=U2,O.spread=b3,O.tail=p4,O.take=m4,O.takeRight=h4,O.takeRightWhile=v4,O.takeWhile=g4,O.tap=M4,O.throttle=y3,O.thru=md,O.toArray=Ix,O.toPairs=Bx,O.toPairsIn=Vx,O.toPath=SL,O.toPlainObject=Lx,O.transform=R2,O.unary=x3,O.union=b4,O.unionBy=y4,O.unionWith=x4,O.uniq=w4,O.uniqBy=E4,O.uniqWith=C4,O.unset=P2,O.unzip=$m,O.unzipWith=xx,O.update=S2,O.updateWith=_2,O.values=qi,O.valuesIn=T2,O.without=R4,O.words=Hx,O.wrap=w3,O.xor=P4,O.xorBy=S4,O.xorWith=_4,O.zip=T4,O.zipObject=$4,O.zipObjectDeep=A4,O.zipWith=D4,O.entries=Bx,O.entriesIn=Vx,O.extend=Fx,O.extendWith=wd,qm(O,O),O.add=TL,O.attempt=Ux,O.camelCase=M2,O.capitalize=Kx,O.ceil=$L,O.clamp=$2,O.clone=C3,O.cloneDeep=P3,O.cloneDeepWith=S3,O.cloneWith=R3,O.conformsTo=_3,O.deburr=Wx,O.defaultTo=sL,O.divide=AL,O.endsWith=O2,O.eq=Gr,O.escape=N2,O.escapeRegExp=I2,O.every=V4,O.find=W4,O.findIndex=hx,O.findKey=n2,O.findLast=H4,O.findLastIndex=vx,O.findLastKey=o2,O.floor=DL,O.forEach=Ex,O.forEachRight=Cx,O.forIn=i2,O.forInRight=a2,O.forOwn=s2,O.forOwnRight=l2,O.get=Nm,O.gt=T3,O.gte=$3,O.has=d2,O.hasIn=Im,O.head=bx,O.identity=mr,O.includes=X4,O.indexOf=Hk,O.inRange=A2,O.invoke=m2,O.isArguments=zo,O.isArray=Le,O.isArrayBuffer=A3,O.isArrayLike=fr,O.isArrayLikeObject=$t,O.isBoolean=D3,O.isBuffer=po,O.isDate=M3,O.isElement=O3,O.isEmpty=N3,O.isEqual=I3,O.isEqualWith=k3,O.isError=Mm,O.isFinite=L3,O.isFunction=Mn,O.isInteger=Dx,O.isLength=yd,O.isMap=Mx,O.isMatch=F3,O.isMatchWith=q3,O.isNaN=j3,O.isNative=B3,O.isNil=K3,O.isNull=V3,O.isNumber=Ox,O.isObject=Et,O.isObjectLike=Pt,O.isPlainObject=ja,O.isRegExp=Om,O.isSafeInteger=W3,O.isSet=Nx,O.isString=xd,O.isSymbol=xr,O.isTypedArray=Fi,O.isUndefined=H3,O.isWeakMap=U3,O.isWeakSet=z3,O.join=Xk,O.kebabCase=k2,O.last=kr,O.lastIndexOf=Zk,O.lowerCase=L2,O.lowerFirst=F2,O.lt=G3,O.lte=Y3,O.max=ML,O.maxBy=OL,O.mean=NL,O.meanBy=IL,O.min=kL,O.minBy=LL,O.stubArray=Bm,O.stubFalse=Vm,O.stubObject=EL,O.stubString=CL,O.stubTrue=RL,O.multiply=FL,O.nth=Qk,O.noConflict=mL,O.noop=jm,O.now=vd,O.pad=q2,O.padEnd=j2,O.padStart=B2,O.parseInt=V2,O.random=D2,O.reduce=t3,O.reduceRight=r3,O.repeat=K2,O.replace=W2,O.result=w2,O.round=qL,O.runInContext=Q,O.sample=o3,O.size=s3,O.snakeCase=H2,O.some=l3,O.sortedIndex=i4,O.sortedIndexBy=a4,O.sortedIndexOf=s4,O.sortedLastIndex=l4,O.sortedLastIndexBy=u4,O.sortedLastIndexOf=c4,O.startCase=z2,O.startsWith=G2,O.subtract=jL,O.sum=BL,O.sumBy=VL,O.template=Y2,O.times=PL,O.toFinite=On,O.toInteger=Fe,O.toLength=kx,O.toLower=X2,O.toNumber=Lr,O.toSafeInteger=X3,O.toString=Je,O.toUpper=Z2,O.trim=Q2,O.trimEnd=J2,O.trimStart=eL,O.truncate=tL,O.unescape=rL,O.uniqueId=_L,O.upperCase=nL,O.upperFirst=km,O.each=Ex,O.eachRight=Cx,O.first=bx,qm(O,(function(){var a={};return un(O,function(u,m){nt.call(O.prototype,m)||(a[m]=u)}),a})(),{chain:!1}),O.VERSION=n,Dr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(a){O[a].placeholder=O}),Dr(["drop","take"],function(a,u){He.prototype[a]=function(m){m=m===r?1:jt(Fe(m),0);var E=this.__filtered__&&!u?new He(this):this.clone();return E.__filtered__?E.__takeCount__=Qt(m,E.__takeCount__):E.__views__.push({size:Qt(m,ie),type:a+(E.__dir__<0?"Right":"")}),E},He.prototype[a+"Right"]=function(m){return this.reverse()[a](m).reverse()}}),Dr(["filter","map","takeWhile"],function(a,u){var m=u+1,E=m==L||m==k;He.prototype[a]=function($){var I=this.clone();return I.__iteratees__.push({iteratee:Me($,3),type:m}),I.__filtered__=I.__filtered__||E,I}}),Dr(["head","last"],function(a,u){var m="take"+(u?"Right":"");He.prototype[a]=function(){return this[m](1).value()[0]}}),Dr(["initial","tail"],function(a,u){var m="drop"+(u?"":"Right");He.prototype[a]=function(){return this.__filtered__?new He(this):this[m](1)}}),He.prototype.compact=function(){return this.filter(mr)},He.prototype.find=function(a){return this.filter(a).head()},He.prototype.findLast=function(a){return this.reverse().find(a)},He.prototype.invokeMap=je(function(a,u){return typeof a=="function"?new He(this):this.map(function(m){return Na(m,a,u)})}),He.prototype.reject=function(a){return this.filter(bd(Me(a)))},He.prototype.slice=function(a,u){a=Fe(a);var m=this;return m.__filtered__&&(a>0||u<0)?new He(m):(a<0?m=m.takeRight(-a):a&&(m=m.drop(a)),u!==r&&(u=Fe(u),m=u<0?m.dropRight(-u):m.take(u-a)),m)},He.prototype.takeRightWhile=function(a){return this.reverse().takeWhile(a).reverse()},He.prototype.toArray=function(){return this.take(ie)},un(He.prototype,function(a,u){var m=/^(?:filter|find|map|reject)|While$/.test(u),E=/^(?:head|last)$/.test(u),$=O[E?"take"+(u=="last"?"Right":""):u],I=E||/^find/.test(u);$&&(O.prototype[u]=function(){var B=this.__wrapped__,z=E?[1]:arguments,ee=B instanceof He,me=z[0],he=ee||Le(B),ge=function(We){var Ge=$.apply(O,io([We],z));return E&&Re?Ge[0]:Ge};he&&m&&typeof me=="function"&&me.length!=1&&(ee=he=!1);var Re=this.__chain__,$e=!!this.__actions__.length,Oe=I&&!Re,qe=ee&&!$e;if(!I&&he){B=qe?B:new He(this);var Ne=a.apply(B,z);return Ne.__actions__.push({func:md,args:[ge],thisArg:r}),new Or(Ne,Re)}return Oe&&qe?a.apply(this,z):(Ne=this.thru(ge),Oe?E?Ne.value()[0]:Ne.value():Ne)})}),Dr(["pop","push","shift","sort","splice","unshift"],function(a){var u=jc[a],m=/^(?:push|sort|unshift)$/.test(a)?"tap":"thru",E=/^(?:pop|shift)$/.test(a);O.prototype[a]=function(){var $=arguments;if(E&&!this.__chain__){var I=this.value();return u.apply(Le(I)?I:[],$)}return this[m](function(B){return u.apply(Le(B)?B:[],$)})}}),un(He.prototype,function(a,u){var m=O[u];if(m){var E=m.name+"";nt.call(Oi,E)||(Oi[E]=[]),Oi[E].push({name:u,func:m})}}),Oi[sd(r,x).name]=[{name:"wrapper",func:r}],He.prototype.clone=rI,He.prototype.reverse=nI,He.prototype.value=oI,O.prototype.at=O4,O.prototype.chain=N4,O.prototype.commit=I4,O.prototype.next=k4,O.prototype.plant=F4,O.prototype.reverse=q4,O.prototype.toJSON=O.prototype.valueOf=O.prototype.value=j4,O.prototype.first=O.prototype.head,_a&&(O.prototype[_a]=L4),O}),Ai=IN();qo?((qo.exports=Ai)._=Ai,Fp._=Ai):Gt._=Ai}).call(Dz)})(Mu,Mu.exports)),Mu.exports}var lt=Mz();const Oz=({view:e,setView:t,value:r,previousMonth:n,nextMonth:o,previousYear:i,nextYear:s,previousDecade:l,nextDecade:c,goBackProps:d,goNextProps:f,changeViewProps:p})=>{const h=e==="month",b=e==="year",w=e==="decade",y=()=>{if(w)return l();if(b)return i();n()},C=()=>{if(w)return c();if(b)return s();o()},x=()=>{if(h)return t("year");if(b)return t("decade")},P=()=>w?S():b?zt(r,"yyyy"):zt(r,"MMMM yyyy",{locale:Az}),S=()=>{if(!r)return"";const _=zS({start:a_(r),end:GS(r)}),T=lt.first(_),A=lt.last(_);return`${zt(T,"yyyy")} - ${zt(A,"yyyy")}`},D=R.useMemo(P,[r,e]);return g.jsx(g.Fragment,{children:g.jsxs("div",{className:"flex items-center justify-between","data-slot":"calendar-navigation",children:[g.jsxs(tr,{onClick:y,size:"icon",variant:"ghost",className:"border w-6 opacity-50 hover:opacity-100","data-slot":"calendar-navigation-back",...d,children:[g.jsx(zv,{className:"h-4 w-4","data-slot":"calendar-navigation-back-icon"}),g.jsx("span",{className:"sr-only",children:"Ir a anterior"})]}),g.jsx("button",{onClick:x,disabled:w,...p,type:"button",className:le("font-semibold pb-px text-gray-900 text-lg text-blue-bell select-none min-w-[60%] capitalize",p?.className),"data-slot":"calendar-navigation-label",children:D}),g.jsxs(tr,{onClick:C,size:"icon",variant:"ghost",className:"border w-6 opacity-50 hover:opacity-100","data-slot":"calendar-navigation-next",...f,children:[g.jsx(ic,{className:"h-4 w-4","data-slot":"calendar-navigation-next-icon"}),g.jsx("span",{className:"sr-only",children:"Ir a siguiente"})]})]})})};function Fu(e){return!!(e&&typeof e=="object"&&"start"in e&&"end"in e)}function Nz(e,t){return{selectMultipleDate:o=>{if(!e)return t([o]);const i=lt.findIndex(e,l=>ai(l,o));if(i===-1)return t([...e,o]);const s=[...e.slice(0,i),...e.slice(i+1)];t(s)},isMultipleSelected:o=>lt.isArray(e)&&e.some(i=>ai(i,o))}}function Iz(e,t,r){const n=c=>{if(e?.start){const{start:f,end:p}=e;if(QH(c,f)||f&&p){t({start:c,end:void 0});return}if(o(f,c))return;t({start:f,end:c})}else t({start:c,end:void 0})},o=(c,d)=>!r||!c||!d?!1:US({start:Po(c),end:d}).some(h=>r(h));return{selectRangeDate:n,isInRange:c=>{if(!Fu(e)||!e)return!1;const{start:d,end:f}=e;return d&&!f?ai(c,d):!d||!f?!1:ZU(c,{start:Po(d),end:Po(f)})},isFirstDayFromRange:c=>!e||!Fu(e)||!e.start?!1:ai(c,e.start),isLastDayFromRange:c=>!e||!Fu(e)||!e.end?!1:ai(c,e.end)}}function kz(e,t){return{selectSingleDate:o=>{t(o)},isSingleSelected:o=>fi(e)&&ai(o,e)}}const s_=R.createContext({defaultStartDate:new Date,mode:"single",isSingleMode:!1,isRangeMode:!1,selected:null,selectDate:()=>{},isSelected:()=>!1,isFirstDayFromRange:()=>!1,isLastDayFromRange:()=>!1,isInRange:()=>!1});function Lz(e){const{mode:t,value:r,defaultValue:n,onChange:o,disabled:i}=e,s=t==="single",l=t==="range",c=t==="multiple",[d=null,f]=ut({prop:r,onChange:o,defaultProp:n}),{selectSingleDate:p,isSingleSelected:h}=kz(fi(d)?d:void 0,f),{selectRangeDate:b,isInRange:w,...y}=Iz(Fu(d)?d:void 0,f,i),{selectMultipleDate:C,isMultipleSelected:x}=Nz(lt.isArray(d)?d:void 0,f),P=_=>{if(s)return p(_);if(l)return b(_);if(c)return C(_)},S=_=>s?h(_):l?w(_):c?x(_):!1;return{defaultStartDate:fi(d)?d:lt.isArray(d)?d[0]:Fu(d)&&d.start?d.start:new Date,isSingleMode:s,isRangeMode:l,selected:d,isSelected:S,selectDate:P,isInRange:w,mode:t,...y}}const Fz=({day:e,navigationDate:t,className:r,...n})=>{const{isSelected:o,mode:i,selected:s,isRangeMode:l,selectDate:c,isFirstDayFromRange:d,isLastDayFromRange:f}=R.useContext(s_),p=R.useMemo(()=>o(e),[e,s]),h=!p&&!YU(e,t),b=!p&&XW(e);return g.jsx("button",{...n,onClick:()=>c(e),type:"button","data-slot":"calendar-day","data-state-mode":i,"data-state-today":XU(e)||void 0,"data-state-selected":p||void 0,"data-state-different-month":h||void 0,"data-state-weekend":b||void 0,"data-state-range-mode":l||void 0,"data-state-first-day":d(e)||void 0,"data-state-last-day":f(e)||void 0,"data-state-in-range":l&&p||void 0,className:le("mx-auto flex pt-px rounded-md items-center justify-center w-full aspect-square hover:bg-accent","data-[state-today]:text-error","data-[state-selected]:bg-primary data-[state-selected]:!text-primary-foreground data-[state-selected]:hover:bg-primary/80","data-[state-different-month]:opacity-50 data-[state-weekend=true]:opacity-50","data-[state-in-range]:not-data-[state-first-day]:not-data-[state-last-day]:rounded-none","data-[state-first-day]:rounded-l-full","data-[state-last-day]:rounded-r-full",r),children:g.jsx("time",{dateTime:zt(e,"yyyy-MM-dd"),children:zt(e,"d")})})},qz=({value:e,onChange:t})=>{const r=()=>zS({start:a_(e),end:GS(e)}),n=i=>{const s=JU(e,parseInt(zt(i,"yyyy")));t(s)},o=R.useMemo(r,[e]);return g.jsx("div",{className:"grid grid-cols-3 grow","data-slot":"calendar-decade-view",children:o.map((i,s)=>g.jsx(tr,{onClick:()=>n(i),className:"h-full rounded-none",type:"button",variant:"ghost","data-slot":"calendar-decade-view-year",children:zt(i,"yyyy")},s))})},ov=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],l_=["Lunes","Martes","Miercoles","Jueves","Viernes","Sabado","Domingo"],jz=e=>g.jsx("div",{...e,className:le("grid grid-cols-7 font-semibold mt-2 text-xs leading-6 text-center py-1 bg-blue-bell/40 select-none",e.className),"data-slot":"calendar-week-days",children:l_.map(t=>g.jsx("abbr",{"aria-label":t,"data-slot":"calendar-week-day",children:lt.at(t,0)},t))}),Bz=({navigationDate:e,disabled:t,weekDaysClassName:r,weekDaysProps:n,dayClassName:o,dayProps:i})=>{const s=()=>US({start:Yn(e,{weekStartsOn:1}),end:oH(rH(e),{weekStartsOn:1})}),l=R.useMemo(s,[e]);return g.jsxs(g.Fragment,{children:[g.jsx(jz,{className:r,...n}),g.jsx("div",{className:"grid grid-cols-7 mt-2 text-sm","data-slot":"calendar-month-view",children:l.map((c,d)=>g.jsx(Fz,{day:c,className:o,...i,navigationDate:e,disabled:t?.(c)},d))})]})},Vz=({value:e,onChange:t})=>{const r=n=>{const o=QU(e,n);t(o)};return g.jsx("div",{className:"grid grid-cols-3 grow","data-slot":"calendar-year-view",children:ov.map(n=>g.jsx(tr,{type:"button",className:"h-full rounded",onClick:()=>r(ov.indexOf(n)),variant:"ghost","data-slot":"calendar-year-view-month",children:g.jsx("abbr",{"aria-label":`${n} ${zt(e,"yyyy")}`,children:n})},n))})};function Kz(e=gh()){const[t,r]=R.useState({month:zt(e||gh(),"MM"),year:zt(e||gh(),"yyyy")}),n=R.useMemo(()=>zU(`${t.month}-${t.year}`,"MM-yyyy",new Date),[t]),o=h=>{r({...t,month:zt(h,"MM")})},i=h=>{r({...t,year:zt(h,"yyyy")})};return{navigationDate:n,setMonth:o,setYear:i,previousMonth:()=>{const h=tv(n,-1);r({month:zt(h,"MM"),year:zt(h,"yyyy")})},nextMonth:()=>{const h=tv(n,1);r({month:zt(h,"MM"),year:zt(h,"yyyy")})},previousYear:()=>{const h=qd(n,-1);i(h)},nextYear:()=>{const h=qd(n,1);i(h)},previousDecade:()=>{const h=qd(n,-10);i(h)},nextDecade:()=>{const h=qd(n,10);i(h)}}}const u_=e=>{const{disabled:t,initialView:r="month",view:n,onChangeView:o,initialDate:i,goBackProps:s,goNextProps:l,changeViewProps:c}=e,d=Lz(e),{defaultStartDate:f}=d,{navigationDate:p,setMonth:h,setYear:b,...w}=Kz(i||f),[y=r,C]=ut({prop:n,onChange:x=>o?.(x,p),defaultProp:r});return g.jsx(s_.Provider,{value:d,children:g.jsxs("div",{"data-slot":"calendar",className:le("w-60 min-h-64 flex flex-col border rounded-md p-2",e.className),children:[g.jsx(Oz,{view:y,setView:C,value:p,goBackProps:s,goNextProps:l,changeViewProps:c,...w}),y==="month"&&g.jsx(Bz,{...e.monthViewProps,navigationDate:p,disabled:t}),y==="year"&&g.jsx(Vz,{value:p,onChange:x=>{h(x),C("month")}}),y==="decade"&&g.jsx(qz,{value:p,onChange:x=>{b(x),C("year")}})]})})},Wz=({className:e,...t})=>g.jsx("div",{className:le("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t,"data-slot":"card"}),Hz=({className:e,...t})=>g.jsx("div",{className:le("flex flex-col space-y-1 p-6",e),...t,"data-slot":"card-header"}),Uz=({className:e,...t})=>g.jsx("h3",{className:le("text-2xl font-semibold leading-none tracking-tight",e),...t,"data-slot":"card-title"}),zz=({className:e,...t})=>g.jsx("p",{className:le("text-sm text-muted-foreground",e),...t,"data-slot":"card-description"}),Gz=({className:e,...t})=>g.jsx("div",{className:le("p-6 pt-0",e),...t,"data-slot":"card-content"}),Yz=({className:e,...t})=>g.jsx("div",{className:le("flex items-center p-6 pt-0",e),...t,"data-slot":"card-footer"}),Xz=({className:e,...t})=>g.jsx("div",{className:le("flex items-center justify-center",e),...t,"data-slot":"center"}),pc=({className:e,...t})=>g.jsx("label",{className:le("text-sm font-medium select-none leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),"data-slot":"label",...t}),iv=({when:e,...t})=>g.jsx(Tr,{present:e,children:g.jsx(sc,{...t,"data-state":e?"open":"closed","data-slot":"show"})}),Zz=({checked:e,onChange:t,defaultChecked:r=!1,indeterminate:n,defaultIndeterminate:o=!1,onIndeterminateChange:i,className:s,size:l=16,children:c,containerClassName:d,containerProps:f,...p})=>{const h=R.useId(),b=R.useRef(null),[w,y]=ut({defaultProp:r,prop:e,onChange:t}),[C,x]=ut({defaultProp:o,prop:n,onChange:i});R.useEffect(()=>{b.current&&(b.current.indeterminate=C)},[C]);const P=_=>{_.stopPropagation(),!p.disabled&&(C?(x(!1),y(!0)):y(T=>!T))},S=C?"indeterminate":w?"checked":"unchecked",D=p.id??h;return g.jsxs("div",{...f,className:le("flex gap-x-2 items-center",d),"data-slot":"checkbox",children:[g.jsxs("button",{disabled:p.disabled,onClick:P,"data-state":S,type:"button",style:{width:l,height:l},className:le("peer aspect-square flex gap-2 shrink-0 rounded-(--radius-checkbox) border border-(--color-checkbox) ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","transition-colors","data-[state=checked]:bg-(--color-checkbox) data-[state=checked]:text-primary-foreground data-[state=checked]:border-transparent","data-[state=indeterminate]:bg-(--color-checkbox) data-[state=indeterminate]:text-primary-foreground data-[state=indeterminate]:border-transparent","data-[state=unchecked]:bg-background data-[state=unchecked]:text-muted-foreground data-[state=unchecked]:border-input",s),"data-slot":"checkbox-trigger",children:[g.jsx(iv,{when:C,children:g.jsx(m5,{className:le("pt-[2px] w-full h-full opacity-0","open:fade-in-0 open:zoom-in-50 open:opacity-100 open:duration-200","closed:fade-out-0 closed:zoom-out-50 closed:opacity-0")})}),g.jsx(iv,{when:!C&&!!w,children:g.jsx(of,{className:le("pt-[2px] w-full h-full opacity-0","open:fade-in-0 open:zoom-in-50 open:opacity-100 open:duration-200","closed:fade-out-0 closed:zoom-out-50 closed:opacity-0")})}),g.jsx("input",{...p,ref:b,id:D,tabIndex:-1,checked:w,onChange:_=>y(_.currentTarget.checked),type:"checkbox",className:"sr-only","aria-hidden":!0})]}),c&&g.jsx(pc,{htmlFor:D,"data-slot":"checkbox-label",children:c})]})};function Qz({items:e=[],valueKey:t="value",labelKey:r="label",placeholder:n="Seleccionar",searchPlaceholder:o="Buscar...",emptyMessage:i="No se encontraron resultado",searchProps:s,className:l,triggerProps:c,itemProps:d,itemClassName:f,contentProps:p,contentClassName:h,value:b,onChange:w,defaultValue:y,renderOption:C=S=>S?.[r],commandProps:x,...P}){const[S,D]=ut({prop:P.open,onChange:P.onOpenChange,defaultProp:P.defaultOpen||!1}),[_,T]=ut({prop:b,onChange:J=>{if(!w)return;const N=e.find(K=>K[t]===J);w?.(N?.[t],N)},defaultProp:y}),[A,M]=ut({prop:P?.search,defaultProp:P?.searchDefaultValue||"",onChange:P?.onSearchChange}),U=v.useMemo(()=>e.find(J=>J[t]===_),[_]);return g.jsxs(Sc,{open:S,onOpenChange:D,"data-slot":"combobox",children:[g.jsx(_c,{asChild:!0,"data-slot":"combobox-trigger",children:g.jsxs(tr,{...P,...c,variant:"outline",role:"combobox","aria-expanded":S,className:le("font-normal w-full items-center justify-between border-input px-3 hover:bg-background",l),children:[g.jsx("span",{className:"truncate",children:U?C(U):n}),g.jsx(af,{className:"ml-2 h-4 w-4 shrink-0 opacity-50","data-slot":"combobox-trigger-icon"})]})}),g.jsx(Tc,{...p,className:le("p-1",h),asChild:!0,matchTriggerWidth:!0,"data-slot":"combobox-content",children:g.jsxs(uc,{...x,children:[g.jsx(Uf,{value:A,onValueChange:M,placeholder:o,autoFocus:!0,"data-slot":"combobox-input",...s}),g.jsx(Gf,{"data-slot":"combobox-empty",children:i}),g.jsx(zf,{"data-slot":"combobox-list",children:e.map(J=>R.createElement(Ku,{className:f,"data-slot":"combobox-item",...d,key:J[t],value:J[t],onSelect:()=>{const N=J[t];T(N===_?"":N),D(!1)}},C(J)))})]})})]})}const Jz="dd/MM/yyyy",Tu=e=>fi(e)?zt(e,Jz):"",eG=e=>{const t=e.trim();if(!t)return null;const r=/^(\d{1,2})\/(\d{1,2})\/(\d{1,4})$/.exec(t);if(!r)return null;const[,n,o,i]=r,s=Number(n),l=Number(o),c=i;let d=Number(c);if(Number.isNaN(s)||Number.isNaN(l)||Number.isNaN(d)||(c.length<=2&&(d=2e3+d),s<1||s>31||l<1||l>12))return null;const f=new Date(d,l-1,s);return f.getFullYear()!==d||f.getMonth()!==l-1||f.getDate()!==s?null:f},tG=(e,t)=>{const r=(t.lastKey==="Backspace"||t.lastKey==="Delete")&&e.length<t.previousValue.length,n=e.includes("/"),o=e.trim().endsWith("/");if((e.match(/\//g)??[]).length>=2){const C=e.split("/"),x=(C[0]??"").replace(/\D/g,"").slice(0,2),P=(C[1]??"").replace(/\D/g,"").slice(0,2),S=(C[2]??"").replace(/\D/g,"").slice(0,4);return!x&&!P&&!S?"":`${x}/${P}/${S}`}const s=e.replace(/\D/g,"").slice(0,8);if(!s)return"";if(s.length<=2){let C=s;if(s.length===1&&(n||o)&&!r){let x=Number(C);Number.isNaN(x)&&(x=1),x<1&&(x=1),x>31&&(x=31),C=x.toString().padStart(2,"0"),C+="/"}else if(s.length===2&&!r){let x=Number(C);Number.isNaN(x)&&(x=1),x<1&&(x=1),x>31&&(x=31),C=x.toString().padStart(2,"0"),C+="/"}return C}const l=s.slice(0,2);let c=Number(l);Number.isNaN(c)&&(c=1),c<1&&(c=1),c>31&&(c=31);const d=c.toString().padStart(2,"0"),f=s.slice(2,4),p=s.slice(4);let h="";if(f.length===0)h="";else if(f.length===1&&p.length===0){const C=o&&!r&&f.length===1;if(f==="0"||f==="1")if(C){let x=Number(f);Number.isNaN(x)&&(x=1),x<1&&(x=1),x>12&&(x=12),h=x.toString().padStart(2,"0")}else h=f;else{let x=Number(f);Number.isNaN(x)&&(x=1),x<1&&(x=1),x>12&&(x=12),h=x.toString().padStart(2,"0")}}else{let C=Number(f);Number.isNaN(C)&&(C=1),C<1&&(C=1),C>12&&(C=12),h=C.toString().padStart(2,"0")}const b=`${d}/${h}`,w=!p&&h.length===2&&!r;return p?`${b}/${p}`:w?`${b}/`:b},rG=e=>{const{date:t,onDateChange:r,disabledDate:n}=e,[o,i]=R.useState(""),s=R.useRef(null),l=R.useRef("");R.useEffect(()=>{const w=Tu(t??null);i(w),l.current=w},[t]);const c=()=>{const w=o.trim();if(!w){r(null),i(""),l.current="";return}const y=eG(w);if(!y||n?.(y)){const x=Tu(t??null);i(x),l.current=x;return}r(y);const C=Tu(y);i(C),l.current=C};return{inputValue:o,handleChange:w=>{const y=w.target.value,C={lastKey:s.current,previousValue:l.current},x=tG(y,C);i(x),l.current=x},handleBlur:()=>{c()},handleKeyDown:w=>{if(s.current=w.key,w.key==="Enter"){w.preventDefault(),c();return}if(w.key==="Escape"){w.preventDefault();const y=Tu(t??null);i(y),l.current=y}},clear:()=>{r(null),i(""),l.current=""},setFromExternalDate:w=>{r(w);const y=Tu(w??null);i(y),l.current=y}}},nG=(e={})=>{const{disabled:t}=e,[r,n]=R.useState(!1),o=R.useRef(null),i=R.useCallback(s=>{if(!t){if(s.key===" "||s.key==="Spacebar"){s.preventDefault(),n(!0);return}s.key==="Escape"&&(n(!1),requestAnimationFrame(()=>{o.current?.focus()}))}},[t]);return{open:r,setOpen:n,handleInputKeyDown:i,inputRef:o}},oG=e=>{const{placeholder:t,value:r,onChange:n,defaultValue:o,className:i,disabledDate:s,renderFooter:l,disabled:c,hideFooter:d,...f}=e,[p,h]=ut({prop:r,onChange:K=>n?.(K??null),defaultProp:o??null}),{inputValue:b,handleChange:w,handleBlur:y,handleKeyDown:C,clear:x,setFromExternalDate:P}=rG({date:p??null,onDateChange:K=>h(K),disabledDate:s}),{open:S,setOpen:D,handleInputKeyDown:_,inputRef:T}=nG({disabled:c}),A=K=>{C(K),_(K)},M=()=>{P(null),x()},U=()=>{const K=new Date;s?.(K)||P(K)},J=()=>g.jsxs("span",{className:"flex w-full p-1 justify-between",children:[g.jsx(tr,{variant:"ghost",onClick:M,children:"Borrar"}),g.jsx(tr,{variant:"ghost",onClick:U,disabled:s?.(new Date),children:"Hoy"})]}),N=()=>d?null:l?l({mode:"single",value:p,clear:M,selectToday:U,setValue:K=>{const W=K&&fi(K)?K:null;h(W),P(W)}}):J();return g.jsxs(Sc,{"data-slot":"date-picker",open:S,onOpenChange:D,children:[g.jsxs("div",{className:le("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 items-center text-sm ring-offset-background placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",!p&&"text-muted-foreground",i,"field-error"),onClick:K=>{K.target===K.currentTarget&&T.current?.focus()},children:[g.jsx("input",{type:"text",value:b,onChange:w,onBlur:y,onKeyDown:A,placeholder:t,disabled:c,className:"flex-1 bg-transparent outline-none text-start truncate pt-px","aria-label":t,ref:T,...f}),g.jsx(_c,{asChild:!0,"data-slot":"date-picker-trigger",children:g.jsxs("button",{type:"button",disabled:c,className:"flex items-center justify-center text-muted-foreground hover:text-foreground p-1",children:[g.jsx(qj,{"data-slot":"date-picker-icon"}),g.jsx("span",{className:"sr-only",children:"Seleccionar fecha"})]})})]}),g.jsxs(Tc,{className:"w-auto p-0",align:"start","data-slot":"date-picker-content",children:[g.jsx(u_,{className:"border-none",mode:"single",value:p,onChange:K=>{if(!fi(K)){P(null);return}s?.(K)||(P(K),D(!1))},disabled:s}),g.jsx("div",{className:"p-2","data-slot":"date-picker-footer",children:N()})]})]})},c_=e=>{const{className:t,orientation:r="horizontal"}=e;return g.jsx("hr",{...e,"aria-orientation":r,className:le("shrink-0 bg-input",r==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),"data-slot":"divider"})},iG=({onDrop:e,onError:t,allowedExtensions:r=[],maxFileSize:n=5*1024*1024,maxFiles:o=1/0})=>{const[i,s]=R.useState(!1),l=R.useCallback(h=>{h.preventDefault(),h.stopPropagation()},[]),c=R.useCallback(h=>{h.preventDefault(),h.stopPropagation(),s(!0)},[]),d=R.useCallback(h=>{h.preventDefault(),h.stopPropagation(),s(!1)},[]),f=h=>{const[b=[],w=[],y=[]]=h.reduce(([C,x,P],S)=>r.length>0&&!r.includes(S.type)?(C.push(S),P.push({file:S,errorMessage:"Extensión no permitida",errorCode:"INVALID_EXTENSION"}),[C,x,P]):S.size>n?(C.push(S),P.push({file:S,errorMessage:"Archivo demasiado grande",errorCode:"FILE_TOO_LARGE"}),[C,x,P]):o&&o<x.length+1?(C.push(S),P.push({file:S,errorMessage:"Límite de archivos excedido",errorCode:"MAX_FILES_EXCEEDED"}),[C,x,P]):(x.push(S),[C,x,P]),[[],[],[]]);return y.length>0&&t&&t(y),[b,w,y]},p=R.useCallback(h=>{h.preventDefault(),h.stopPropagation(),s(!1);const b=Array.from(h.dataTransfer.files),[w=[],y=[]]=f(b);e(y,w)},[r,n,o,e,t]);return{isDragActive:i,validateFiles:f,dropzoneProps:{onDragOver:l,onDragEnter:c,onDragLeave:d,onDrop:p}}},d_=R.createContext(null),wg=()=>{const e=R.useContext(d_);if(!e)throw new Error("useUploadContext must be used within a UploadContextProvider");return e},f_=({onFileAdd:e,onFileRemove:t,onChangeFiles:r,files:n,maxFiles:o=1,allowedExtensions:i=[],maxFileSize:s=5*1024*1024,multiple:l,children:c,onError:d,...f})=>{const[p=[],h]=ut({defaultProp:[],prop:n,onChange:r}),[b,w]=R.useState([]),{isDragActive:y,validateFiles:C,dropzoneProps:x}=iG({onDrop:(D,_)=>{h([...p,...D]),w(T=>[...T,..._]),e?.(D)},allowedExtensions:i,maxFileSize:s,maxFiles:o,onError:d}),P=D=>{const[_=[],T=[]]=C(D);if(o===1||!l){h(T.slice(0,1)),w([..._,...T.slice(1)]),e?.(T.slice(0,1));return}const A=o-p.length;if(A<=0){w(J=>[...J,...T]),e?.([]);return}const M=T.slice(0,A),U=T.slice(A);h([...p,...M]),w(J=>[...J,..._,...U]),e?.(M)},S=(D,_)=>{_==="accepted"?h(p.filter((T,A)=>A!==D)):w(T=>T.filter((A,M)=>M!==D)),t?.(D,_)};return g.jsx(d_.Provider,{value:{files:p,rejectedFiles:b,handleFileAdd:P,handleFileRemove:S,inputProps:{accept:i.join(","),multiple:l},isDragActive:y,dropzoneProps:x},children:g.jsx("div",{...f,"data-slot":"upload",children:c})})},p_=({asChild:e,...t})=>{const{handleFileAdd:r,inputProps:n,dropzoneProps:o,isDragActive:i}=wg(),s=R.useRef(null),l=e?sc:"button";return g.jsxs(g.Fragment,{children:[g.jsx(l,{"data-slot":"upload-trigger",...t,...o,"data-drag-active":i||!1,onClick:c=>{t.onClick?.(c),s.current?.click()}}),g.jsx("input",{type:"file",className:"hidden","data-slot":"upload-input",...n,ref:s,onChange:c=>r(Array.from(c.target.files||[]))})]})},m_=({className:e,...t})=>g.jsx("div",{...t,className:le("mt-2 space-y-2",e),"data-slot":"upload-content"}),h_=({files:e,handleFileRemove:t,fileType:r,children:n,renderFile:o,...i})=>e.length===0?null:g.jsxs("div",{className:"mt-2 space-y-2",...i,"data-slot":"upload-files-list",children:[n,e.map((s,l)=>o?o(s,()=>t(l,r)):g.jsx(b_,{file:s,onRemove:()=>t(l,r)},s.name))]}),v_=e=>{const{files:t,handleFileRemove:r}=wg();return g.jsx(h_,{"data-slot":"upload-accepted-files",files:t,handleFileRemove:r,fileType:"accepted",...e})},g_=e=>{const{rejectedFiles:t,handleFileRemove:r}=wg();return g.jsx(h_,{"data-slot":"upload-rejected-files",files:t,handleFileRemove:r,fileType:"rejected",...e})},b_=({file:e,onRemove:t,className:r,renderIcon:n,...o})=>g.jsxs("div",{className:le("flex items-center gap-2 mb-2",r),...o,"data-slot":"upload-item",children:[n?.(e),e.name,g.jsx(tr,{variant:"ghost",size:"icon",type:"button",className:"h-6 w-6",onClick:t,"data-slot":"upload-item-remove",children:g.jsx(jf,{"data-slot":"upload-item-remove-icon"})})]}),aG=({onFileAdd:e,onFileRemove:t,onChangeFiles:r=()=>{},files:n,maxFiles:o=1,allowedExtensions:i=[],maxFileSize:s=5*1024*1024,multiple:l,renderAcceptedFile:c,renderRejectedFile:d,showRejected:f=!1,className:p,icon:h=i5,iconSize:b=40,onError:w,...y})=>{const C=R.useMemo(()=>i.map(x=>x.split("/")?.[1]).join(", "),[i]);return g.jsxs(f_,{onFileAdd:e,onFileRemove:t,files:n,onChangeFiles:r,maxFiles:o,allowedExtensions:i,maxFileSize:s,multiple:l?!0:void 0,className:le("w-full",p),onError:w,...y,children:[g.jsx(p_,{asChild:!0,children:g.jsxs("div",{className:le("w-full min-h-[150px] border-2 border-dashed rounded-lg border-muted p-4","hover:bg-muted/50 data-[drag-active=true]:border-primary data-[drag-active=true]:bg-primary/10","transition-colors flex flex-col items-center justify-center gap-4","pointer-events-auto"),children:[g.jsx(h,{className:"text-muted-foreground pointer-events-none",style:{width:b,height:b}}),g.jsxs("div",{className:"text-center text-muted-foreground pointer-events-none",children:[g.jsx("p",{children:"Arrastra y suelta archivos aquí o haz clic para seleccionar"}),i.length>0&&g.jsxs("p",{className:"text-sm",children:["Tipos permitidos: ",C]}),g.jsxs("p",{className:"text-sm",children:["Tamaño máximo: ",Math.floor(s/1024/1024),"MB"]})]})]})}),g.jsxs(m_,{children:[g.jsx(v_,{renderFile:c}),f&&g.jsx(g_,{renderFile:d})]})]})},It={JPEG:"image/jpeg",JPG:"image/jpg",PNG:"image/png",GIF:"image/gif",WEBP:"image/webp",SVG:"image/svg+xml",PDF:"application/pdf",DOC:"application/msword",DOCX:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",XLS:"application/vnd.ms-excel",XLSX:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",PPT:"application/vnd.ms-powerpoint",PPTX:"application/vnd.openxmlformats-officedocument.presentationml.presentation",TXT:"text/plain",CSV:"text/csv",ZIP:"application/zip",RAR:"application/x-rar-compressed",MP3:"audio/mpeg",WAV:"audio/wav",MP4:"video/mp4",WEBM:"video/webm",JSON:"application/json",XML:"application/xml"},sG={IMAGES:[It.JPEG,It.JPG,It.PNG,It.GIF,It.WEBP,It.SVG],DOCUMENTS:[It.PDF,It.DOC,It.DOCX,It.XLS,It.XLSX,It.PPT,It.PPTX],COMPRESSED:[It.ZIP,It.RAR],AUDIO:[It.MP3,It.WAV],VIDEO:[It.MP4,It.WEBM]},lG=eo([],{variants:{size:{sm:"text-[14px]",md:"text-[16px]",lg:"text-[18px]",xl:"text-[20px]","2xl":"text-[24px]","3xl":"text-[28px]","4xl":"text-[32px]","5xl":"text-[36px]","6xl":"text-[40px]"},weight:{normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"}},defaultVariants:{size:"xl",weight:"semibold"}}),y_=({className:e,size:t,weight:r,as:n,...o})=>{const i=n||"h2";return g.jsx(i,{className:le(lG({size:t,weight:r}),e),...o,"data-slot":"heading","data-size":t,"data-weight":r})},uG=({icon:e=g.jsx(d5,{className:"w-12 h-12"}),title:t="No hay resultados",description:r,className:n,children:o,...i})=>g.jsxs("div",{className:le("flex flex-col gap-2 justify-center items-center",n),"data-slot":"empty-state",...i,children:[g.jsx("div",{className:"text-muted-foreground","data-slot":"empty-state-icon",children:e}),g.jsx(y_,{className:"empty:hidden","data-slot":"empty-state-title",children:t}),g.jsx("p",{className:"py-1 text-sm text-center text-muted-foreground empty:hidden","data-slot":"empty-state-description",children:r}),o]}),cG=({label:e,labelClassName:t,labelProps:r,error:n,errorClassName:o,errorProps:i,children:s,className:l,...c})=>g.jsxs("div",{...c,className:le("flex flex-col gap-1",l),"data-slot":"field",children:[g.jsx(pc,{className:le("empty:hidden",t),...r,"data-slot":"field-label",children:e}),s,g.jsx("p",{"data-slot":"field-error",className:le("text-sm font-medium text-error empty:hidden",o),...i,children:n})]});var mc=e=>e.type==="checkbox",ri=e=>e instanceof Date,vr=e=>e==null;const x_=e=>typeof e=="object";var Ft=e=>!vr(e)&&!Array.isArray(e)&&x_(e)&&!ri(e),w_=e=>Ft(e)&&e.target?mc(e.target)?e.target.checked:e.target.value:e,dG=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,E_=(e,t)=>e.has(dG(t)),fG=e=>{const t=e.constructor&&e.constructor.prototype;return Ft(t)&&t.hasOwnProperty("isPrototypeOf")},Eg=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Vt(e){let t;const r=Array.isArray(e),n=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(Eg&&(e instanceof Blob||n))&&(r||Ft(e)))if(t=r?[]:Object.create(Object.getPrototypeOf(e)),!r&&!fG(e))t=e;else for(const o in e)e.hasOwnProperty(o)&&(t[o]=Vt(e[o]));else return e;return t}var Jf=e=>/^\w*$/.test(e),St=e=>e===void 0,Cg=e=>Array.isArray(e)?e.filter(Boolean):[],Rg=e=>Cg(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Ce=(e,t,r)=>{if(!t||!Ft(e))return r;const n=(Jf(t)?[t]:Rg(t)).reduce((o,i)=>vr(o)?o:o[i],e);return St(n)||n===e?St(e[t])?r:e[t]:n},Rr=e=>typeof e=="boolean",ot=(e,t,r)=>{let n=-1;const o=Jf(t)?[t]:Rg(t),i=o.length,s=i-1;for(;++n<i;){const l=o[n];let c=r;if(n!==s){const d=e[l];c=Ft(d)||Array.isArray(d)?d:isNaN(+o[n+1])?{}:[]}if(l==="__proto__"||l==="constructor"||l==="prototype")return;e[l]=c,e=e[l]}};const bf={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Jr={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Kn={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Pg=R.createContext(null);Pg.displayName="HookFormContext";const hc=()=>R.useContext(Pg),pG=e=>{const{children:t,...r}=e;return R.createElement(Pg.Provider,{value:r},t)};var C_=(e,t,r,n=!0)=>{const o={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(o,i,{get:()=>{const s=i;return t._proxyFormState[s]!==Jr.all&&(t._proxyFormState[s]=!n||Jr.all),r&&(r[s]=!0),e[s]}});return o};const Sg=typeof window<"u"?R.useLayoutEffect:R.useEffect;function mG(e){const t=hc(),{control:r=t.control,disabled:n,name:o,exact:i}=e||{},[s,l]=R.useState(r._formState),c=R.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Sg(()=>r._subscribe({name:o,formState:c.current,exact:i,callback:d=>{!n&&l({...r._formState,...d})}}),[o,n,i]),R.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),R.useMemo(()=>C_(s,r,c.current,!1),[s,r])}var Sr=e=>typeof e=="string",av=(e,t,r,n,o)=>Sr(e)?(n&&t.watch.add(e),Ce(r,e,o)):Array.isArray(e)?e.map(i=>(n&&t.watch.add(i),Ce(r,i))):(n&&(t.watchAll=!0),r),sv=e=>vr(e)||!x_(e);function en(e,t,r=new WeakSet){if(sv(e)||sv(t))return Object.is(e,t);if(ri(e)&&ri(t))return e.getTime()===t.getTime();const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const i of n){const s=e[i];if(!o.includes(i))return!1;if(i!=="ref"){const l=t[i];if(ri(s)&&ri(l)||Ft(s)&&Ft(l)||Array.isArray(s)&&Array.isArray(l)?!en(s,l,r):!Object.is(s,l))return!1}}return!0}function hG(e){const t=hc(),{control:r=t.control,name:n,defaultValue:o,disabled:i,exact:s,compute:l}=e||{},c=R.useRef(o),d=R.useRef(l),f=R.useRef(void 0),p=R.useRef(r),h=R.useRef(n);d.current=l;const[b,w]=R.useState(()=>{const D=r._getWatch(n,c.current);return d.current?d.current(D):D}),y=R.useCallback(D=>{const _=av(n,r._names,D||r._formValues,!1,c.current);return d.current?d.current(_):_},[r._formValues,r._names,n]),C=R.useCallback(D=>{if(!i){const _=av(n,r._names,D||r._formValues,!1,c.current);if(d.current){const T=d.current(_);en(T,f.current)||(w(T),f.current=T)}else w(_)}},[r._formValues,r._names,i,n]);Sg(()=>((p.current!==r||!en(h.current,n))&&(p.current=r,h.current=n,C()),r._subscribe({name:n,formState:{values:!0},exact:s,callback:D=>{C(D.values)}})),[r,s,n,C]),R.useEffect(()=>r._removeUnmounted());const x=p.current!==r,P=h.current,S=R.useMemo(()=>{if(i)return null;const D=!x&&!en(P,n);return x||D?y():null},[i,x,n,P,y]);return S!==null?S:b}function vG(e){const t=hc(),{name:r,disabled:n,control:o=t.control,shouldUnregister:i,defaultValue:s,exact:l=!0}=e,c=E_(o._names.array,r),d=R.useMemo(()=>Ce(o._formValues,r,Ce(o._defaultValues,r,s)),[o,r,s]),f=hG({control:o,name:r,defaultValue:d,exact:l}),p=mG({control:o,name:r,exact:l}),h=R.useRef(e),b=R.useRef(void 0),w=R.useRef(o.register(r,{...e.rules,value:f,...Rr(e.disabled)?{disabled:e.disabled}:{}}));h.current=e;const y=R.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Ce(p.errors,r)},isDirty:{enumerable:!0,get:()=>!!Ce(p.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!Ce(p.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!Ce(p.validatingFields,r)},error:{enumerable:!0,get:()=>Ce(p.errors,r)}}),[p,r]),C=R.useCallback(D=>w.current.onChange({target:{value:w_(D),name:r},type:bf.CHANGE}),[r]),x=R.useCallback(()=>w.current.onBlur({target:{value:Ce(o._formValues,r),name:r},type:bf.BLUR}),[r,o._formValues]),P=R.useCallback(D=>{const _=Ce(o._fields,r);_&&D&&(_._f.ref={focus:()=>D.focus&&D.focus(),select:()=>D.select&&D.select(),setCustomValidity:T=>D.setCustomValidity(T),reportValidity:()=>D.reportValidity()})},[o._fields,r]),S=R.useMemo(()=>({name:r,value:f,...Rr(n)||p.disabled?{disabled:p.disabled||n}:{},onChange:C,onBlur:x,ref:P}),[r,n,p.disabled,C,x,P,f]);return R.useEffect(()=>{const D=o._options.shouldUnregister||i,_=b.current;_&&_!==r&&!c&&o.unregister(_),o.register(r,{...h.current.rules,...Rr(h.current.disabled)?{disabled:h.current.disabled}:{}});const T=(A,M)=>{const U=Ce(o._fields,A);U&&U._f&&(U._f.mount=M)};if(T(r,!0),D){const A=Vt(Ce(o._options.defaultValues,r,h.current.defaultValue));ot(o._defaultValues,r,A),St(Ce(o._formValues,r))&&ot(o._formValues,r,A)}return!c&&o.register(r),b.current=r,()=>{(c?D&&!o._state.action:D)?o.unregister(r):T(r,!1)}},[r,o,c,i]),R.useEffect(()=>{o._setDisabledField({disabled:n,name:r})},[n,r,o]),R.useMemo(()=>({field:S,formState:p,fieldState:y}),[S,p,y])}const gG=e=>e.render(vG(e));var _g=(e,t,r,n,o)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:o||!0}}:{},qu=e=>Array.isArray(e)?e:[e],sR=()=>{let e=[];return{get observers(){return e},next:o=>{for(const i of e)i.next&&i.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(i=>i!==o)}}),unsubscribe:()=>{e=[]}}};function R_(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const o=e[n],i=t[n];if(o&&Ft(o)&&i){const s=R_(o,i);Ft(s)&&(r[n]=s)}else e[n]&&(r[n]=i)}return r}var lr=e=>Ft(e)&&!Object.keys(e).length,Tg=e=>e.type==="file",tn=e=>typeof e=="function",yf=e=>{if(!Eg)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},P_=e=>e.type==="select-multiple",$g=e=>e.type==="radio",bG=e=>$g(e)||mc(e),bh=e=>yf(e)&&e.isConnected;function yG(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=St(e)?n++:e[t[n++]];return e}function xG(e){for(const t in e)if(e.hasOwnProperty(t)&&!St(e[t]))return!1;return!0}function kt(e,t){const r=Array.isArray(t)?t:Jf(t)?[t]:Rg(t),n=r.length===1?e:yG(e,r),o=r.length-1,i=r[o];return n&&delete n[i],o!==0&&(Ft(n)&&lr(n)||Array.isArray(n)&&xG(n))&&kt(e,r.slice(0,-1)),e}var wG=e=>{for(const t in e)if(tn(e[t]))return!0;return!1};function S_(e){return Array.isArray(e)||Ft(e)&&!wG(e)}function lv(e,t={}){for(const r in e){const n=e[r];S_(n)?(t[r]=Array.isArray(n)?[]:{},lv(n,t[r])):St(n)||(t[r]=!0)}return t}function Qi(e,t,r){r||(r=lv(t));for(const n in e){const o=e[n];if(S_(o))St(t)||sv(r[n])?r[n]=lv(o,Array.isArray(o)?[]:{}):Qi(o,vr(t)?{}:t[n],r[n]);else{const i=t[n];r[n]=!en(o,i)}}return r}const lR={value:!1,isValid:!1},uR={value:!0,isValid:!0};var __=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!St(e[0].attributes.value)?St(e[0].value)||e[0].value===""?uR:{value:e[0].value,isValid:!0}:uR:lR}return lR},T_=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>St(e)?e:t?e===""?NaN:e&&+e:r&&Sr(e)?new Date(e):n?n(e):e;const cR={isValid:!1,value:null};var $_=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,cR):cR;function dR(e){const t=e.ref;return Tg(t)?t.files:$g(t)?$_(e.refs).value:P_(t)?[...t.selectedOptions].map(({value:r})=>r):mc(t)?__(e.refs).value:T_(St(t.value)?e.ref.value:t.value,e)}var EG=(e,t,r,n)=>{const o={};for(const i of e){const s=Ce(t,i);s&&ot(o,i,s._f)}return{criteriaMode:r,names:[...e],fields:o,shouldUseNativeValidation:n}},xf=e=>e instanceof RegExp,$u=e=>St(e)?e:xf(e)?e.source:Ft(e)?xf(e.value)?e.value.source:e.value:e,fR=e=>({isOnSubmit:!e||e===Jr.onSubmit,isOnBlur:e===Jr.onBlur,isOnChange:e===Jr.onChange,isOnAll:e===Jr.all,isOnTouch:e===Jr.onTouched});const pR="AsyncFunction";var CG=e=>!!e&&!!e.validate&&!!(tn(e.validate)&&e.validate.constructor.name===pR||Ft(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===pR)),RG=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),mR=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const ju=(e,t,r,n)=>{for(const o of r||Object.keys(e)){const i=Ce(e,o);if(i){const{_f:s,...l}=i;if(s){if(s.refs&&s.refs[0]&&t(s.refs[0],o)&&!n)return!0;if(s.ref&&t(s.ref,s.name)&&!n)return!0;if(ju(l,t))break}else if(Ft(l)&&ju(l,t))break}}};function hR(e,t,r){const n=Ce(e,r);if(n||Jf(r))return{error:n,name:r};const o=r.split(".");for(;o.length;){const i=o.join("."),s=Ce(t,i),l=Ce(e,i);if(s&&!Array.isArray(s)&&r!==i)return{name:r};if(l&&l.type)return{name:i,error:l};if(l&&l.root&&l.root.type)return{name:`${i}.root`,error:l.root};o.pop()}return{name:r}}var PG=(e,t,r,n)=>{r(e);const{name:o,...i}=e;return lr(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(s=>t[s]===(!n||Jr.all))},SG=(e,t,r)=>!e||!t||e===t||qu(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),_G=(e,t,r,n,o)=>o.isOnAll?!1:!r&&o.isOnTouch?!(t||e):(r?n.isOnBlur:o.isOnBlur)?!e:(r?n.isOnChange:o.isOnChange)?e:!0,TG=(e,t)=>!Cg(Ce(e,t)).length&&kt(e,t),$G=(e,t,r)=>{const n=qu(Ce(e,r));return ot(n,"root",t[r]),ot(e,r,n),e};function vR(e,t,r="validate"){if(Sr(e)||Array.isArray(e)&&e.every(Sr)||Rr(e)&&!e)return{type:r,message:Sr(e)?e:"",ref:t}}var Ui=e=>Ft(e)&&!xf(e)?e:{value:e,message:""},gR=async(e,t,r,n,o,i)=>{const{ref:s,refs:l,required:c,maxLength:d,minLength:f,min:p,max:h,pattern:b,validate:w,name:y,valueAsNumber:C,mount:x}=e._f,P=Ce(r,y);if(!x||t.has(y))return{};const S=l?l[0]:s,D=K=>{o&&S.reportValidity&&(S.setCustomValidity(Rr(K)?"":K||""),S.reportValidity())},_={},T=$g(s),A=mc(s),M=T||A,U=(C||Tg(s))&&St(s.value)&&St(P)||yf(s)&&s.value===""||P===""||Array.isArray(P)&&!P.length,J=_g.bind(null,y,n,_),N=(K,W,L,G=Kn.maxLength,k=Kn.minLength)=>{const F=K?W:L;_[y]={type:K?G:k,message:F,ref:s,...J(K?G:k,F)}};if(i?!Array.isArray(P)||!P.length:c&&(!M&&(U||vr(P))||Rr(P)&&!P||A&&!__(l).isValid||T&&!$_(l).isValid)){const{value:K,message:W}=Sr(c)?{value:!!c,message:c}:Ui(c);if(K&&(_[y]={type:Kn.required,message:W,ref:S,...J(Kn.required,W)},!n))return D(W),_}if(!U&&(!vr(p)||!vr(h))){let K,W;const L=Ui(h),G=Ui(p);if(!vr(P)&&!isNaN(P)){const k=s.valueAsNumber||P&&+P;vr(L.value)||(K=k>L.value),vr(G.value)||(W=k<G.value)}else{const k=s.valueAsDate||new Date(P),F=V=>new Date(new Date().toDateString()+" "+V),j=s.type=="time",re=s.type=="week";Sr(L.value)&&P&&(K=j?F(P)>F(L.value):re?P>L.value:k>new Date(L.value)),Sr(G.value)&&P&&(W=j?F(P)<F(G.value):re?P<G.value:k<new Date(G.value))}if((K||W)&&(N(!!K,L.message,G.message,Kn.max,Kn.min),!n))return D(_[y].message),_}if((d||f)&&!U&&(Sr(P)||i&&Array.isArray(P))){const K=Ui(d),W=Ui(f),L=!vr(K.value)&&P.length>+K.value,G=!vr(W.value)&&P.length<+W.value;if((L||G)&&(N(L,K.message,W.message),!n))return D(_[y].message),_}if(b&&!U&&Sr(P)){const{value:K,message:W}=Ui(b);if(xf(K)&&!P.match(K)&&(_[y]={type:Kn.pattern,message:W,ref:s,...J(Kn.pattern,W)},!n))return D(W),_}if(w){if(tn(w)){const K=await w(P,r),W=vR(K,S);if(W&&(_[y]={...W,...J(Kn.validate,W.message)},!n))return D(W.message),_}else if(Ft(w)){let K={};for(const W in w){if(!lr(K)&&!n)break;const L=vR(await w[W](P,r),S,W);L&&(K={...L,...J(W,L.message)},D(L.message),n&&(_[y]=K))}if(!lr(K)&&(_[y]={ref:S,...K},!n))return _}}return D(!0),_};const AG={mode:Jr.onSubmit,reValidateMode:Jr.onChange,shouldFocusError:!0};function DG(e={}){let t={...AG,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:tn(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},o=Ft(t.defaultValues)||Ft(t.values)?Vt(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:Vt(o),s={action:!1,mount:!1,watch:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,d=0;const f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let p={...f};const h={array:sR(),state:sR()},b=t.criteriaMode===Jr.all,w=H=>ne=>{clearTimeout(d),d=setTimeout(H,ne)},y=async H=>{if(!t.disabled&&(f.isValid||p.isValid||H)){const ne=t.resolver?lr((await A()).errors):await U(n,!0);ne!==r.isValid&&h.state.next({isValid:ne})}},C=(H,ne)=>{!t.disabled&&(f.isValidating||f.validatingFields||p.isValidating||p.validatingFields)&&((H||Array.from(l.mount)).forEach(de=>{de&&(ne?ot(r.validatingFields,de,ne):kt(r.validatingFields,de))}),h.state.next({validatingFields:r.validatingFields,isValidating:!lr(r.validatingFields)}))},x=(H,ne=[],de,Ee,xe=!0,be=!0)=>{if(Ee&&de&&!t.disabled){if(s.action=!0,be&&Array.isArray(Ce(n,H))){const Ae=de(Ce(n,H),Ee.argA,Ee.argB);xe&&ot(n,H,Ae)}if(be&&Array.isArray(Ce(r.errors,H))){const Ae=de(Ce(r.errors,H),Ee.argA,Ee.argB);xe&&ot(r.errors,H,Ae),TG(r.errors,H)}if((f.touchedFields||p.touchedFields)&&be&&Array.isArray(Ce(r.touchedFields,H))){const Ae=de(Ce(r.touchedFields,H),Ee.argA,Ee.argB);xe&&ot(r.touchedFields,H,Ae)}(f.dirtyFields||p.dirtyFields)&&(r.dirtyFields=Qi(o,i)),h.state.next({name:H,isDirty:N(H,ne),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else ot(i,H,ne)},P=(H,ne)=>{ot(r.errors,H,ne),h.state.next({errors:r.errors})},S=H=>{r.errors=H,h.state.next({errors:r.errors,isValid:!1})},D=(H,ne,de,Ee)=>{const xe=Ce(n,H);if(xe){const be=Ce(i,H,St(de)?Ce(o,H):de);St(be)||Ee&&Ee.defaultChecked||ne?ot(i,H,ne?be:dR(xe._f)):L(H,be),s.mount&&!s.action&&y()}},_=(H,ne,de,Ee,xe)=>{let be=!1,Ae=!1;const Ke={name:H};if(!t.disabled){if(!de||Ee){(f.isDirty||p.isDirty)&&(Ae=r.isDirty,r.isDirty=Ke.isDirty=N(),be=Ae!==Ke.isDirty);const ze=en(Ce(o,H),ne);Ae=!!Ce(r.dirtyFields,H),ze?kt(r.dirtyFields,H):ot(r.dirtyFields,H,!0),Ke.dirtyFields=r.dirtyFields,be=be||(f.dirtyFields||p.dirtyFields)&&Ae!==!ze}if(de){const ze=Ce(r.touchedFields,H);ze||(ot(r.touchedFields,H,de),Ke.touchedFields=r.touchedFields,be=be||(f.touchedFields||p.touchedFields)&&ze!==de)}be&&xe&&h.state.next(Ke)}return be?Ke:{}},T=(H,ne,de,Ee)=>{const xe=Ce(r.errors,H),be=(f.isValid||p.isValid)&&Rr(ne)&&r.isValid!==ne;if(t.delayError&&de?(c=w(()=>P(H,de)),c(t.delayError)):(clearTimeout(d),c=null,de?ot(r.errors,H,de):kt(r.errors,H)),(de?!en(xe,de):xe)||!lr(Ee)||be){const Ae={...Ee,...be&&Rr(ne)?{isValid:ne}:{},errors:r.errors,name:H};r={...r,...Ae},h.state.next(Ae)}},A=async H=>{C(H,!0);const ne=await t.resolver(i,t.context,EG(H||l.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return C(H),ne},M=async H=>{const{errors:ne}=await A(H);if(H)for(const de of H){const Ee=Ce(ne,de);Ee?ot(r.errors,de,Ee):kt(r.errors,de)}else r.errors=ne;return ne},U=async(H,ne,de={valid:!0})=>{for(const Ee in H){const xe=H[Ee];if(xe){const{_f:be,...Ae}=xe;if(be){const Ke=l.array.has(be.name),ze=xe._f&&CG(xe._f);ze&&f.validatingFields&&C([be.name],!0);const Ht=await gR(xe,l.disabled,i,b,t.shouldUseNativeValidation&&!ne,Ke);if(ze&&f.validatingFields&&C([be.name]),Ht[be.name]&&(de.valid=!1,ne))break;!ne&&(Ce(Ht,be.name)?Ke?$G(r.errors,Ht,be.name):ot(r.errors,be.name,Ht[be.name]):kt(r.errors,be.name))}!lr(Ae)&&await U(Ae,ne,de)}}return de.valid},J=()=>{for(const H of l.unMount){const ne=Ce(n,H);ne&&(ne._f.refs?ne._f.refs.every(de=>!bh(de)):!bh(ne._f.ref))&&te(H)}l.unMount=new Set},N=(H,ne)=>!t.disabled&&(H&&ne&&ot(i,H,ne),!en(V(),o)),K=(H,ne,de)=>av(H,l,{...s.mount?i:St(ne)?o:Sr(H)?{[H]:ne}:ne},de,ne),W=H=>Cg(Ce(s.mount?i:o,H,t.shouldUnregister?Ce(o,H,[]):[])),L=(H,ne,de={})=>{const Ee=Ce(n,H);let xe=ne;if(Ee){const be=Ee._f;be&&(!be.disabled&&ot(i,H,T_(ne,be)),xe=yf(be.ref)&&vr(ne)?"":ne,P_(be.ref)?[...be.ref.options].forEach(Ae=>Ae.selected=xe.includes(Ae.value)):be.refs?mc(be.ref)?be.refs.forEach(Ae=>{(!Ae.defaultChecked||!Ae.disabled)&&(Array.isArray(xe)?Ae.checked=!!xe.find(Ke=>Ke===Ae.value):Ae.checked=xe===Ae.value||!!xe)}):be.refs.forEach(Ae=>Ae.checked=Ae.value===xe):Tg(be.ref)?be.ref.value="":(be.ref.value=xe,be.ref.type||h.state.next({name:H,values:Vt(i)})))}(de.shouldDirty||de.shouldTouch)&&_(H,xe,de.shouldTouch,de.shouldDirty,!0),de.shouldValidate&&re(H)},G=(H,ne,de)=>{for(const Ee in ne){if(!ne.hasOwnProperty(Ee))return;const xe=ne[Ee],be=H+"."+Ee,Ae=Ce(n,be);(l.array.has(H)||Ft(xe)||Ae&&!Ae._f)&&!ri(xe)?G(be,xe,de):L(be,xe,de)}},k=(H,ne,de={})=>{const Ee=Ce(n,H),xe=l.array.has(H),be=Vt(ne);ot(i,H,be),xe?(h.array.next({name:H,values:Vt(i)}),(f.isDirty||f.dirtyFields||p.isDirty||p.dirtyFields)&&de.shouldDirty&&h.state.next({name:H,dirtyFields:Qi(o,i),isDirty:N(H,be)})):Ee&&!Ee._f&&!vr(be)?G(H,be,de):L(H,be,de),mR(H,l)&&h.state.next({...r,name:H}),h.state.next({name:s.mount?H:void 0,values:Vt(i)})},F=async H=>{s.mount=!0;const ne=H.target;let de=ne.name,Ee=!0;const xe=Ce(n,de),be=ze=>{Ee=Number.isNaN(ze)||ri(ze)&&isNaN(ze.getTime())||en(ze,Ce(i,de,ze))},Ae=fR(t.mode),Ke=fR(t.reValidateMode);if(xe){let ze,Ht;const ln=ne.type?dR(xe._f):w_(H),cr=H.type===bf.BLUR||H.type===bf.FOCUS_OUT,ko=!RG(xe._f)&&!t.resolver&&!Ce(r.errors,de)&&!xe._f.deps||_G(cr,Ce(r.touchedFields,de),r.isSubmitted,Ke,Ae),Rn=mR(de,l,cr);ot(i,de,ln),cr?(!ne||!ne.readOnly)&&(xe._f.onBlur&&xe._f.onBlur(H),c&&c(0)):xe._f.onChange&&xe._f.onChange(H);const Pn=_(de,ln,cr),Lo=!lr(Pn)||Rn;if(!cr&&h.state.next({name:de,type:H.type,values:Vt(i)}),ko)return(f.isValid||p.isValid)&&(t.mode==="onBlur"?cr&&y():cr||y()),Lo&&h.state.next({name:de,...Rn?{}:Pn});if(!cr&&Rn&&h.state.next({...r}),t.resolver){const{errors:no}=await A([de]);if(be(ln),Ee){const Fo=hR(r.errors,n,de),Ri=hR(no,n,Fo.name||de);ze=Ri.error,de=Ri.name,Ht=lr(no)}}else C([de],!0),ze=(await gR(xe,l.disabled,i,b,t.shouldUseNativeValidation))[de],C([de]),be(ln),Ee&&(ze?Ht=!1:(f.isValid||p.isValid)&&(Ht=await U(n,!0)));Ee&&(xe._f.deps&&(!Array.isArray(xe._f.deps)||xe._f.deps.length>0)&&re(xe._f.deps),T(de,Ht,ze,Pn))}},j=(H,ne)=>{if(Ce(r.errors,ne)&&H.focus)return H.focus(),1},re=async(H,ne={})=>{let de,Ee;const xe=qu(H);if(t.resolver){const be=await M(St(H)?H:xe);de=lr(be),Ee=H?!xe.some(Ae=>Ce(be,Ae)):de}else H?(Ee=(await Promise.all(xe.map(async be=>{const Ae=Ce(n,be);return await U(Ae&&Ae._f?{[be]:Ae}:Ae)}))).every(Boolean),!(!Ee&&!r.isValid)&&y()):Ee=de=await U(n);return h.state.next({...!Sr(H)||(f.isValid||p.isValid)&&de!==r.isValid?{}:{name:H},...t.resolver||!H?{isValid:de}:{},errors:r.errors}),ne.shouldFocus&&!Ee&&ju(n,j,H?xe:l.mount),Ee},V=(H,ne)=>{let de={...s.mount?i:o};return ne&&(de=R_(ne.dirtyFields?r.dirtyFields:r.touchedFields,de)),St(H)?de:Sr(H)?Ce(de,H):H.map(Ee=>Ce(de,Ee))},ie=(H,ne)=>({invalid:!!Ce((ne||r).errors,H),isDirty:!!Ce((ne||r).dirtyFields,H),error:Ce((ne||r).errors,H),isValidating:!!Ce(r.validatingFields,H),isTouched:!!Ce((ne||r).touchedFields,H)}),Y=H=>{H&&qu(H).forEach(ne=>kt(r.errors,ne)),h.state.next({errors:H?r.errors:{}})},X=(H,ne,de)=>{const Ee=(Ce(n,H,{_f:{}})._f||{}).ref,xe=Ce(r.errors,H)||{},{ref:be,message:Ae,type:Ke,...ze}=xe;ot(r.errors,H,{...ze,...ne,ref:Ee}),h.state.next({name:H,errors:r.errors,isValid:!1}),de&&de.shouldFocus&&Ee&&Ee.focus&&Ee.focus()},ce=(H,ne)=>tn(H)?h.state.subscribe({next:de=>"values"in de&&H(K(void 0,ne),de)}):K(H,ne,!0),ue=H=>h.state.subscribe({next:ne=>{SG(H.name,ne.name,H.exact)&&PG(ne,H.formState||f,mt,H.reRenderRoot)&&H.callback({values:{...i},...r,...ne,defaultValues:o})}}).unsubscribe,pe=H=>(s.mount=!0,p={...p,...H.formState},ue({...H,formState:p})),te=(H,ne={})=>{for(const de of H?qu(H):l.mount)l.mount.delete(de),l.array.delete(de),ne.keepValue||(kt(n,de),kt(i,de)),!ne.keepError&&kt(r.errors,de),!ne.keepDirty&&kt(r.dirtyFields,de),!ne.keepTouched&&kt(r.touchedFields,de),!ne.keepIsValidating&&kt(r.validatingFields,de),!t.shouldUnregister&&!ne.keepDefaultValue&&kt(o,de);h.state.next({values:Vt(i)}),h.state.next({...r,...ne.keepDirty?{isDirty:N()}:{}}),!ne.keepIsValid&&y()},ve=({disabled:H,name:ne})=>{(Rr(H)&&s.mount||H||l.disabled.has(ne))&&(H?l.disabled.add(ne):l.disabled.delete(ne))},q=(H,ne={})=>{let de=Ce(n,H);const Ee=Rr(ne.disabled)||Rr(t.disabled);return ot(n,H,{...de||{},_f:{...de&&de._f?de._f:{ref:{name:H}},name:H,mount:!0,...ne}}),l.mount.add(H),de?ve({disabled:Rr(ne.disabled)?ne.disabled:t.disabled,name:H}):D(H,!0,ne.value),{...Ee?{disabled:ne.disabled||t.disabled}:{},...t.progressive?{required:!!ne.required,min:$u(ne.min),max:$u(ne.max),minLength:$u(ne.minLength),maxLength:$u(ne.maxLength),pattern:$u(ne.pattern)}:{},name:H,onChange:F,onBlur:F,ref:xe=>{if(xe){q(H,ne),de=Ce(n,H);const be=St(xe.value)&&xe.querySelectorAll&&xe.querySelectorAll("input,select,textarea")[0]||xe,Ae=bG(be),Ke=de._f.refs||[];if(Ae?Ke.find(ze=>ze===be):be===de._f.ref)return;ot(n,H,{_f:{...de._f,...Ae?{refs:[...Ke.filter(bh),be,...Array.isArray(Ce(o,H))?[{}]:[]],ref:{type:be.type,name:H}}:{ref:be}}}),D(H,!1,void 0,be)}else de=Ce(n,H,{}),de._f&&(de._f.mount=!1),(t.shouldUnregister||ne.shouldUnregister)&&!(E_(l.array,H)&&s.action)&&l.unMount.add(H)}}},ae=()=>t.shouldFocusError&&ju(n,j,l.mount),oe=H=>{Rr(H)&&(h.state.next({disabled:H}),ju(n,(ne,de)=>{const Ee=Ce(n,de);Ee&&(ne.disabled=Ee._f.disabled||H,Array.isArray(Ee._f.refs)&&Ee._f.refs.forEach(xe=>{xe.disabled=Ee._f.disabled||H}))},0,!1))},Z=(H,ne)=>async de=>{let Ee;de&&(de.preventDefault&&de.preventDefault(),de.persist&&de.persist());let xe=Vt(i);if(h.state.next({isSubmitting:!0}),t.resolver){const{errors:be,values:Ae}=await A();r.errors=be,xe=Vt(Ae)}else await U(n);if(l.disabled.size)for(const be of l.disabled)kt(xe,be);if(kt(r.errors,"root"),lr(r.errors)){h.state.next({errors:{}});try{await H(xe,de)}catch(be){Ee=be}}else ne&&await ne({...r.errors},de),ae(),setTimeout(ae);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:lr(r.errors)&&!Ee,submitCount:r.submitCount+1,errors:r.errors}),Ee)throw Ee},we=(H,ne={})=>{Ce(n,H)&&(St(ne.defaultValue)?k(H,Vt(Ce(o,H))):(k(H,ne.defaultValue),ot(o,H,Vt(ne.defaultValue))),ne.keepTouched||kt(r.touchedFields,H),ne.keepDirty||(kt(r.dirtyFields,H),r.isDirty=ne.defaultValue?N(H,Vt(Ce(o,H))):N()),ne.keepError||(kt(r.errors,H),f.isValid&&y()),h.state.next({...r}))},De=(H,ne={})=>{const de=H?Vt(H):o,Ee=Vt(de),xe=lr(H),be=xe?o:Ee;if(ne.keepDefaultValues||(o=de),!ne.keepValues){if(ne.keepDirtyValues){const Ae=new Set([...l.mount,...Object.keys(Qi(o,i))]);for(const Ke of Array.from(Ae))Ce(r.dirtyFields,Ke)?ot(be,Ke,Ce(i,Ke)):k(Ke,Ce(be,Ke))}else{if(Eg&&St(H))for(const Ae of l.mount){const Ke=Ce(n,Ae);if(Ke&&Ke._f){const ze=Array.isArray(Ke._f.refs)?Ke._f.refs[0]:Ke._f.ref;if(yf(ze)){const Ht=ze.closest("form");if(Ht){Ht.reset();break}}}}if(ne.keepFieldsRef)for(const Ae of l.mount)k(Ae,Ce(be,Ae));else n={}}i=t.shouldUnregister?ne.keepDefaultValues?Vt(o):{}:Vt(be),h.array.next({values:{...be}}),h.state.next({values:{...be}})}l={mount:ne.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!f.isValid||!!ne.keepIsValid||!!ne.keepDirtyValues||!t.shouldUnregister&&!lr(be),s.watch=!!t.shouldUnregister,s.action=!1,ne.keepErrors||(r.errors={}),h.state.next({submitCount:ne.keepSubmitCount?r.submitCount:0,isDirty:xe?!1:ne.keepDirty?r.isDirty:!!(ne.keepDefaultValues&&!en(H,o)),isSubmitted:ne.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:xe?{}:ne.keepDirtyValues?ne.keepDefaultValues&&i?Qi(o,i):r.dirtyFields:ne.keepDefaultValues&&H?Qi(o,H):ne.keepDirty?r.dirtyFields:{},touchedFields:ne.keepTouched?r.touchedFields:{},errors:ne.keepErrors?r.errors:{},isSubmitSuccessful:ne.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},Ue=(H,ne)=>De(tn(H)?H(i):H,ne),wt=(H,ne={})=>{const de=Ce(n,H),Ee=de&&de._f;if(Ee){const xe=Ee.refs?Ee.refs[0]:Ee.ref;xe.focus&&(xe.focus(),ne.shouldSelect&&tn(xe.select)&&xe.select())}},mt=H=>{r={...r,...H}},Ci={control:{register:q,unregister:te,getFieldState:ie,handleSubmit:Z,setError:X,_subscribe:ue,_runSchema:A,_focusError:ae,_getWatch:K,_getDirty:N,_setValid:y,_setFieldArray:x,_setDisabledField:ve,_setErrors:S,_getFieldArray:W,_reset:De,_resetDefaultValues:()=>tn(t.defaultValues)&&t.defaultValues().then(H=>{Ue(H,t.resetOptions),h.state.next({isLoading:!1})}),_removeUnmounted:J,_disableForm:oe,_subjects:h,_proxyFormState:f,get _fields(){return n},get _formValues(){return i},get _state(){return s},set _state(H){s=H},get _defaultValues(){return o},get _names(){return l},set _names(H){l=H},get _formState(){return r},get _options(){return t},set _options(H){t={...t,...H}}},subscribe:pe,trigger:re,register:q,handleSubmit:Z,watch:ce,setValue:k,getValues:V,reset:Ue,resetField:we,clearErrors:Y,unregister:te,setError:X,setFocus:wt,getFieldState:ie};return{...Ci,formControl:Ci}}function MG(e={}){const t=R.useRef(void 0),r=R.useRef(void 0),[n,o]=R.useState({isDirty:!1,isValidating:!1,isLoading:tn(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:tn(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!tn(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:s,...l}=DG(e);t.current={...l,formState:n}}const i=t.current.control;return i._options=e,Sg(()=>{const s=i._subscribe({formState:i._proxyFormState,callback:()=>o({...i._formState}),reRenderRoot:!0});return o(l=>({...l,isReady:!0})),i._formState.isReady=!0,s},[i]),R.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),R.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),R.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),R.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),R.useEffect(()=>{if(i._proxyFormState.isDirty){const s=i._getDirty();s!==n.isDirty&&i._subjects.state.next({isDirty:s})}},[i,n.isDirty]),R.useEffect(()=>{var s;e.values&&!en(e.values,r.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),!((s=i._options.resetOptions)===null||s===void 0)&&s.keepIsValid||i._setValid(),r.current=e.values,o(l=>({...l}))):i._resetDefaultValues()},[i,e.values]),R.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=C_(n,i),t.current}const[OG,NG]=cc(),[IG,kG]=cc(),vc=()=>{const e=IG(),t=OG(),{getFieldState:r,formState:n}=hc();if(!e)throw new Error("useFormField should be used within <FormField>");const o=r(e.name,n),{id:i}=t;return{id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...o}},LG=({onSubmit:e,id:t,form:r,children:n,className:o})=>g.jsx(pG,{...r,children:g.jsx("form",{id:t,onSubmit:r.handleSubmit(e),className:o,"data-slot":"form",children:n})}),FG=({name:e,label:t,description:r,className:n,render:o,itemProps:i,labelProps:s,controlProps:l,descriptionProps:c,messageProps:d})=>{const{control:f}=hc();return g.jsx(kG,{value:{name:e},children:g.jsx(gG,{name:e,control:f,render:({field:p,fieldState:h})=>g.jsxs(A_,{className:n,...i,children:[t&&g.jsx(D_,{...s,children:t}),g.jsx(M_,{...l,children:lt.isFunction(o)?o(p):v.createElement(o,p)}),r&&g.jsx(O_,{...c,children:r}),g.jsx(N_,{...d,children:h.error?.message})]})})})},A_=({className:e,...t})=>{const r=v.useId();return g.jsx(NG,{value:{id:r},children:g.jsx("div",{className:le("flex flex-col gap-2",e),"data-slot":"form-item",...t})})},D_=({className:e,...t})=>{const{error:r,formItemId:n}=vc();return g.jsx(pc,{className:le(r&&"text-error",e),htmlFor:n,...t})},M_=({className:e,...t})=>{const{error:r,formItemId:n,formDescriptionId:o,formMessageId:i}=vc();return g.jsx(sc,{id:n,"aria-describedby":r?`${o} ${i}`:`${o}`,"aria-invalid":!!r,className:le("group",e),...t})},O_=({className:e,...t})=>{const{formDescriptionId:r}=vc();return g.jsx("p",{id:r,className:le("text-sm text-muted-foreground",e),"data-slot":"form-description",...t})},N_=({className:e,children:t,...r})=>{const{error:n,formMessageId:o}=vc(),i=n?String(n?.message):t;return i?g.jsx("p",{id:o,className:le("text-sm font-medium text-error",e),"data-slot":"form-message",...r,children:i}):null},bR=(e,t,r)=>{if(e&&"reportValidity"in e){const n=Ce(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},uv=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?bR(n.ref,r,e):n&&n.refs&&n.refs.forEach(o=>bR(o,r,e))}},yR=(e,t)=>{t.shouldUseNativeValidation&&uv(e,t);const r={};for(const n in e){const o=Ce(t.fields,n),i=Object.assign(e[n]||{},{ref:o&&o.ref});if(qG(t.names||Object.keys(e),n)){const s=Object.assign({},Ce(r,n));ot(s,"root",i),ot(r,n,s)}else ot(r,n,i)}return r},qG=(e,t)=>{const r=xR(t);return e.some(n=>xR(n).match(`^${r}\\.\\d+`))};function xR(e){return e.replace(/\]|\[/g,"")}function I_(e,t,r){function n(l,c){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:c,constr:s,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,c);const d=s.prototype,f=Object.keys(d);for(let p=0;p<f.length;p++){const h=f[p];h in l||(l[h]=d[h].bind(l))}}const o=r?.Parent??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function s(l){var c;const d=r?.Parent?new i:this;n(d,l),(c=d._zod).deferred??(c.deferred=[]);for(const f of d._zod.deferred)f();return d}return Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}class jG extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const BG={};function k_(e){return BG}function VG(e,t){return typeof t=="bigint"?t.toString():t}const L_="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function jd(e){return typeof e=="string"?e:e?.message}function F_(e,t,r){const n={...e,path:e.path??[]};if(!e.message){const o=jd(e.inst?._zod.def?.error?.(e))??jd(t?.error?.(e))??jd(r.customError?.(e))??jd(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}const q_=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,VG,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},KG=I_("$ZodError",q_),j_=I_("$ZodError",q_,{Parent:Error}),WG=e=>(t,r,n,o)=>{const i=n?Object.assign(n,{async:!1}):{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new jG;if(s.issues.length){const l=new(o?.Err??e)(s.issues.map(c=>F_(c,i,k_())));throw L_(l,o?.callee),l}return s.value},HG=WG(j_),UG=e=>async(t,r,n,o)=>{const i=n?Object.assign(n,{async:!0}):{async:!0};let s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){const l=new(o?.Err??e)(s.issues.map(c=>F_(c,i,k_())));throw L_(l,o?.callee),l}return s.value},zG=UG(j_);function wR(e,t){try{var r=e()}catch(n){return t(n)}return r&&r.then?r.then(void 0,t):r}function GG(e,t){for(var r={};e.length;){var n=e[0],o=n.code,i=n.message,s=n.path.join(".");if(!r[s])if("unionErrors"in n){var l=n.unionErrors[0].errors[0];r[s]={message:l.message,type:l.code}}else r[s]={message:i,type:o};if("unionErrors"in n&&n.unionErrors.forEach(function(f){return f.errors.forEach(function(p){return e.push(p)})}),t){var c=r[s].types,d=c&&c[n.code];r[s]=_g(s,t,r,o,d?[].concat(d,n.message):n.message)}e.shift()}return r}function YG(e,t){for(var r={};e.length;){var n=e[0],o=n.code,i=n.message,s=n.path.join(".");if(!r[s])if(n.code==="invalid_union"&&n.errors.length>0){var l=n.errors[0][0];r[s]={message:l.message,type:l.code}}else r[s]={message:i,type:o};if(n.code==="invalid_union"&&n.errors.forEach(function(f){return f.forEach(function(p){return e.push(p)})}),t){var c=r[s].types,d=c&&c[n.code];r[s]=_g(s,t,r,o,d?[].concat(d,n.message):n.message)}e.shift()}return r}function XG(e,t,r){if(r===void 0&&(r={}),(function(n){return"_def"in n&&typeof n._def=="object"&&"typeName"in n._def})(e))return function(n,o,i){try{return Promise.resolve(wR(function(){return Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(s){return i.shouldUseNativeValidation&&uv({},i),{errors:{},values:r.raw?Object.assign({},n):s}})},function(s){if((function(l){return Array.isArray(l?.issues)})(s))return{values:{},errors:yR(GG(s.errors,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw s}))}catch(s){return Promise.reject(s)}};if((function(n){return"_zod"in n&&typeof n._zod=="object"})(e))return function(n,o,i){try{return Promise.resolve(wR(function(){return Promise.resolve((r.mode==="sync"?HG:zG)(e,n,t)).then(function(s){return i.shouldUseNativeValidation&&uv({},i),{errors:{},values:r.raw?Object.assign({},n):s}})},function(s){if((function(l){return l instanceof KG})(s))return{values:{},errors:yR(YG(s.issues,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw s}))}catch(s){return Promise.reject(s)}};throw new Error("Invalid input: not a Zod schema")}function ZG(e,t){return MG({...t,resolver:XG(e)})}const B_=({value:e,onChange:t,defaultValue:r="",...n})=>{const o=ac("Input",n),[i="",s]=ut({prop:e,onChange:t,defaultProp:r}),l=c=>{s(c.target.value)};return g.jsx("input",{"data-slot":"input",autoComplete:"off",...o,value:i,onChange:l,className:le("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","file:border-0 file:bg-transparent file:text-sm file:font-medium",o.className)})},QG=eo(["inline-flex select-none items-center gap-1 rounded border bg-muted px-1.5 font-medium text-muted-foreground"],{variants:{variant:{default:"border-transparent bg-secondary text-secondary-foreground",secondary:"border-transparent bg-primary text-primary-foreground",error:"border-transparent bg-error text-error-foreground",outline:"text-foreground"},size:{default:"px-1.5 py-0.5 text-xs",sm:"px-2 py-0.5 text-sm",lg:"px-4 py-1 text-lg"}},defaultVariants:{variant:"default",size:"default"}}),JG=({variant:e,size:t,className:r,...n})=>g.jsx("kbd",{className:le(QG({variant:e,size:t}),r),...n,"data-slot":"kbd"}),eY=({className:e,...t})=>g.jsx("kbd",{"data-slot":"kbd-group",className:le("inline-flex items-center gap-1",e),...t}),tY=eo("animate-spin",{variants:{variant:{primary:"text-primary",secondary:"text-secondary",ghost:"text-muted-foreground",error:"text-error",success:"text-success"},size:{sm:"w-4 h-4",default:"w-7 h-7",lg:"w-10 h-10"}},defaultVariants:{variant:"primary",size:"default"}}),rY=({center:e,containerClassName:t,variant:r,size:n,...o})=>g.jsx("div",{className:le(t,e&&"fixed inset-0 grid place-items-center"),"data-slot":"loader",children:g.jsx(sf,{"data-slot":"loader-icon",...o,className:le(tY({variant:r,size:n}),o.className)})});function nY(e){const[t=[],r]=R.useState(e);return[t,{insertAt:(h,b)=>{r((w=[])=>{const y=[...w];return y.splice(h,0,b),y})},removeAt:h=>{r((b=[])=>{const w=[...b];return w.splice(h,1),w})},updateAt:(h,b)=>{r((w=[])=>{const y=[...w];return y[h]=b,y})},clear:()=>r([]),reset:()=>r(e),push:h=>r((b=[])=>[...b,h]),set:h=>r(h),pop:()=>{r((h=[])=>{const b=[...h];return b.pop(),b})},update:(h,b)=>{r((w=[])=>{const y=[...w],C=lt.findIndex(y,h);return C===-1||(y[C]=lt.isFunction(b)?b(y[C]):b),y})}}]}function oY({fn:e,dependencies:t=[],onError:r,onSuccess:n,onFinish:o}){const[i,s]=R.useState(!0),[l,c]=R.useState(null),[d,f]=R.useState(null),p=R.useCallback(()=>{s(!0),c(null),f(null),e().then(h=>{n?.(h),f(h)}).catch(h=>{r?.(h),c(h)}).finally(()=>{o?.(),s(!1)})},t);return R.useEffect(()=>{p()},[p]),{loading:i,error:l,data:d,refetch:p}}const iY=(e,t=!0)=>{const r=R.useRef(null),n=o=>{r.current&&!r.current.contains(o.target)&&e()};return R.useEffect(()=>{if(t)return document.addEventListener("mousedown",n),()=>{document.removeEventListener("mousedown",n)}},[t]),r};function aY(){const[e,t]=R.useState(null),r=R.useCallback(async n=>{if(!navigator?.clipboard)return!1;try{return await navigator.clipboard.writeText(n),t(n),!0}catch(o){return console.error(o),t(null),!1}},[]);return[e,r]}function sY(e,t){const r=R.useRef(null);return R.useCallback((...n)=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{e(...n)},t)},[e,t])}function lY(e,t){const[r,n]=R.useState(e);return R.useEffect(()=>{const o=setTimeout(()=>{n(e)},t);return()=>clearTimeout(o)},[e,t]),r}function uY(e=!1,t){const{onOpen:r,onClose:n}=t||{},[o,i]=R.useState(e),s=R.useCallback(()=>{i(d=>d||(r?.(),!0))},[r]),l=R.useCallback(()=>{i(d=>d&&(n?.(),!1))},[n]),c=R.useCallback(()=>{o?l():s()},[l,s,o]);return[o,{open:s,close:l,toggle:c}]}function cY(e){R.useEffect(()=>{typeof e=="string"&&e.trim().length>0&&(document.title=e.trim())},[e])}function V_(e,t,r){const n=R.useRef(null);return R.useEffect(()=>{const o=n.current??document;return o.addEventListener(e,t,r),()=>{o.removeEventListener(e,t,r)}},[e,t,r]),n}const dY=e=>{const t=e.toLowerCase().split("+");return{mainKey:t.pop(),isShift:t.includes("shift"),isCtrl:t.includes("ctrl"),isAlt:t.includes("alt"),isMeta:t.includes("meta")}},fY=(e,t)=>{const{mainKey:r,isShift:n,isCtrl:o,isAlt:i,isMeta:s}=dY(t);return e.key.toLowerCase()===r&&e.shiftKey===n&&e.ctrlKey===o&&e.altKey===i&&e.metaKey===s},pY=e=>e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable,mY=(e,t)=>t&&pY(e.target),hY=(e,t,r,n,o)=>i=>{if(!o||mY(i,n))return;(Array.isArray(e)?e:[e]).some(c=>fY(i,c))&&(r&&i.preventDefault(),t(i))};function K_(e,t,r={}){const{eventName:n="keydown",preventDefault:o=!0,ignoreInputFields:i=!0,watch:s=!0}=r,l=R.useCallback(hY(e,t,o,i,s),[e,t,o,i,s]);return V_(n,l)}function vY(e){const[t,r]=R.useState(!1),n=R.useRef(null);return R.useEffect(()=>{const o=l=>{r(!0),e?.onHoverStart?.(l)},i=l=>{r(!1),e?.onHoverEnd?.(l)},s=n.current;if(s)return s.addEventListener("mouseover",o),s.addEventListener("mouseout",i),()=>{s.removeEventListener("mouseover",o),s.removeEventListener("mouseout",i)}},[e]),{ref:n,isHovering:t}}function gY({onVisible:e,root:t=null,rootMargin:r="0px",threshold:n=0}={}){const[o,i]=R.useState(!1),s=R.useRef(null),l=R.useCallback(([c])=>{const d=c.isIntersecting;i(d)},[e]);return R.useEffect(()=>{if(s.current==null)return;const c=new IntersectionObserver(l,{root:t,rootMargin:r,threshold:n});return c.observe(s.current),()=>{s.current!=null&&c.unobserve(s.current)}},[s,t,r,n,l]),R.useEffect(()=>{o&&e?.()},[o]),{ref:s,isVisible:o}}function bY(e,t){const r=()=>{try{const l=localStorage.getItem(e);return l?JSON.parse(l):t!==void 0?t:void 0}catch(l){return console.error(`Error parsing localStorage key "${e}":`,l),t!==void 0?t:void 0}},[n,o]=R.useState(r);return R.useEffect(()=>{try{n!==void 0?localStorage.setItem(e,JSON.stringify(n)):localStorage.removeItem(e)}catch(l){console.error(`Error setting localStorage key "${e}":`,l)}},[e,n]),[n,l=>{o(l)},()=>{try{localStorage.removeItem(e),o(t!==void 0?t:void 0)}catch(l){console.error(`Error removing localStorage key "${e}":`,l)}}]}const yY=e=>{const[t,r]=R.useState(!1);return R.useEffect(()=>{const n=window.matchMedia(e),o=()=>r(n.matches);return o(),n.addEventListener("change",o),()=>{n.removeEventListener("change",o)}},[e]),t};function xY(e){lt.isFunction(e)||console.error(`useMemoizedFn expected parameter is a function, got ${typeof e}`);const t=R.useRef(e);t.current=R.useMemo(()=>e,[e]);const r=R.useRef(null);return r.current||(r.current=function(...n){return t.current.apply(this,n)}),r.current}const wY=e=>{const[t,r]=R.useState(!1),[n,o]=R.useState(null),[i,s]=R.useState(null);return{mutate:R.useCallback(async(...c)=>{r(!0),o(null),s(null);try{const d=await e.fn(...c);return e.onSuccess?.(d),s(d),d}catch(d){const f=d;throw e.onError?.(f),o(f),f}finally{e.onFinish?.(),r(!1)}},[e]),loading:t,error:n,data:i}};function EY(e){const[t,r]=R.useState(e),n=R.useCallback(()=>r(e),[e]),o=R.useCallback(i=>{r(s=>{if(lt.isFunction(i)){const l=i(s);return lt.isObject(l)?{...s,...l}:s}else if(lt.isObject(i))return{...s,...i};return s})},[]);return[t,o,n]}function Ag({totalItems:e,pageSize:t,initialCurrentPage:r=1,onChange:n}){const[o,i]=R.useState(r),s=Math.ceil(e/t),l=o===s,c=o===1,d=(o-1)*t+1,f=Math.min(o*t,e),p=()=>{if(l)return;const y=Math.min(o+1,s);w(y)},h=()=>{if(c)return;const y=Math.max(o-1,1);w(y)},b=y=>{if(y===1&&c||y===s&&l)return;const C=Math.max(1,y),x=Math.min(C,s);w(x)},w=y=>{i(y),n?.({currentPage:y,pageSize:t})};return{next:p,prev:h,goTo:b,currentPage:o,maxPage:s,isFirstPage:c,isLastPage:l,range:{start:d,end:f}}}function CY(e){const t=()=>document.getElementById(e),r=()=>{const o=document.createElement("div");return o.id=e,o},n=R.useMemo(()=>{const o=t();return o||r()},[e]);return R.useEffect(()=>(document.getElementById(e)||document.body.appendChild(n),()=>{const o=document.getElementById(e);o&&document.body.removeChild(o)}),[e,n]),{render:o=>rn.createPortal(o,n)}}function RY({shouldPrevent:e,message:t="Es posible que no se guarden los cambios hayas hecho."}){const r=n=>{if(e)return n.preventDefault(),n.returnValue=t,t};R.useEffect(()=>(window.addEventListener("beforeunload",r),()=>window.removeEventListener("beforeunload",r)),[t,e])}const Co="...",W_=({siblingCount:e=1,...t})=>{const r=Ag(t),{currentPage:n,maxPage:o}=r,{totalItems:i,pageSize:s}=t,l=()=>{const p=2+3*e,h=1;if(p>=o)return lt.range(h,o+1);const b=Math.max(n-e,1),w=Math.min(n+e,o),y=b>2,C=w<o-2;if(y&&C){const x=lt.range(b,w+1);return[h,Co,...x,Co,o]}if(C)return[...lt.range(h,p+1),Co,o];if(y){const x=lt.range(o-p+1,o+1);return[h,Co,...x]}},c=R.useMemo(l,[i,s,n,e]);return{...r,paginationRange:c??[]}};function PY(e){const[t,r]=R.useState(new Set),n=R.useCallback(f=>t.has(f),[t]),o=R.useCallback(f=>{r(p=>new Set([...p,f]))},[]),i=R.useCallback(f=>{r(p=>{const h=new Set(p);return h.delete(f),h})},[]),s=R.useCallback(f=>{r(p=>{const h=new Set(p);return h.has(f)?h.delete(f):h.add(f),h})},[]),l=R.useCallback(f=>{r(new Set(f))},[]),c=R.useCallback(()=>{r(f=>f.size===e.length?new Set:new Set(e))},[e]),d=R.useCallback(()=>r(new Set),[]);return{isAllSelected:t.size===e.length,isSomeSelected:t.size>0&&t.size<e.length,isNoneSelected:t.size===0,isSelected:n,selected:[...t],setSelected:l,select:o,unselect:i,toggle:s,toggleAll:c,clear:d}}function SY(e,t){const[r,n]=R.useState(0),o=t??e.length,i=()=>{n(d=>d>=o-1?d:d+1)},s=()=>{n(d=>d<=0?d:d-1)},l=d=>{n(d)},c=d=>{const f=lt.findIndex(e,d);f!==-1&&l(f)};return{currentStepIndex:r,step:e[r],steps:e,isFirstStep:r===0,isLastStep:r===o-1,goTo:l,next:i,back:s,findAndGo:c}}function H_(e=!1){const[t,r]=R.useState(e);return[t,o=>{r(o===void 0?!t:o)}]}const _Y=/input|select|textarea|button|object/,U_="a, input, select, textarea, button, object, [tabindex]";function TY(e){return process.env.NODE_ENV==="test"?!1:e.style.display==="none"}function $Y(e){if(e.getAttribute("aria-hidden")||e.getAttribute("hidden")||e.getAttribute("type")==="hidden")return!1;let r=e;for(;r&&!(r===document.body||r.nodeType===11);){if(TY(r))return!1;r=r.parentNode}return!0}function z_(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function cv(e){const t=e.nodeName.toLowerCase(),r=!Number.isNaN(z_(e));return(_Y.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||r)&&$Y(e)}function G_(e){const t=z_(e);return(Number.isNaN(t)||t>=0)&&cv(e)}function AY(e){return Array.from(e.querySelectorAll(U_)).filter(G_)}function DY(e,t){const r=AY(e);if(!r.length){t.preventDefault();return}const n=r[t.shiftKey?0:r.length-1],o=e.getRootNode();let i=n===o.activeElement||e===o.activeElement;const s=o.activeElement;if(s.tagName==="INPUT"&&s.getAttribute("type")==="radio"&&(i=r.filter(f=>f.getAttribute("type")==="radio"&&f.getAttribute("name")===s.getAttribute("name")).includes(n)),!i)return;t.preventDefault();const c=r[t.shiftKey?r.length-1:0];c&&c.focus()}function MY(e=!0){const t=R.useRef(null),r=o=>{let i=o.querySelector("[data-autofocus]");if(!i){const s=Array.from(o.querySelectorAll(U_));i=s.find(G_)||s.find(cv)||null,!i&&cv(o)&&(i=o)}i&&i.focus({preventScroll:!0})},n=R.useCallback(o=>{e&&o!==null&&t.current!==o&&(o?(setTimeout(()=>{o.getRootNode()&&r(o)}),t.current=o):t.current=null)},[e]);return R.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>r(t.current));const o=i=>{i.key==="Tab"&&t.current&&DY(t.current,i)};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[e]),n}function OY(e){const t=NY(e),r=v.forwardRef((n,o)=>{const{children:i,...s}=n,l=v.Children.toArray(i),c=l.find(kY);if(c){const d=c.props.children,f=l.map(p=>p===c?v.Children.count(d)>1?v.Children.only(null):v.isValidElement(d)?d.props.children:null:p);return g.jsx(t,{...s,ref:o,children:v.isValidElement(d)?v.cloneElement(d,void 0,f):null})}return g.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}function NY(e){const t=v.forwardRef((r,n)=>{const{children:o,...i}=r;if(v.isValidElement(o)){const s=FY(o),l=LY(i,o.props);return o.type!==v.Fragment&&(l.ref=n?gt(n,s):s),v.cloneElement(o,l)}return v.Children.count(o)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var IY=Symbol("radix.slottable");function kY(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===IY}function LY(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function FY(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var qY=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],jY=qY.reduce((e,t)=>{const r=OY(`Primitive.${t}`),n=v.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function ER(e){const t=BY(e),r=v.forwardRef((n,o)=>{const{children:i,...s}=n,l=v.Children.toArray(i),c=l.find(KY);if(c){const d=c.props.children,f=l.map(p=>p===c?v.Children.count(d)>1?v.Children.only(null):v.isValidElement(d)?d.props.children:null:p);return g.jsx(t,{...s,ref:o,children:v.isValidElement(d)?v.cloneElement(d,void 0,f):null})}return g.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}function BY(e){const t=v.forwardRef((r,n)=>{const{children:o,...i}=r;if(v.isValidElement(o)){const s=HY(o),l=WY(i,o.props);return o.type!==v.Fragment&&(l.ref=n?gt(n,s):s),v.cloneElement(o,l)}return v.Children.count(o)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var VY=Symbol("radix.slottable");function KY(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===VY}function WY(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function HY(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Dg(e){const t=e+"CollectionProvider",[r,n]=wn(t),[o,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=y=>{const{scope:C,children:x}=y,P=R.useRef(null),S=R.useRef(new Map).current;return g.jsx(o,{scope:C,itemMap:S,collectionRef:P,children:x})};s.displayName=t;const l=e+"CollectionSlot",c=ER(l),d=R.forwardRef((y,C)=>{const{scope:x,children:P}=y,S=i(l,x),D=Ve(C,S.collectionRef);return g.jsx(c,{ref:D,children:P})});d.displayName=l;const f=e+"CollectionItemSlot",p="data-radix-collection-item",h=ER(f),b=R.forwardRef((y,C)=>{const{scope:x,children:P,...S}=y,D=R.useRef(null),_=Ve(C,D),T=i(f,x);return R.useEffect(()=>(T.itemMap.set(D,{ref:D,...S}),()=>{T.itemMap.delete(D)})),g.jsx(h,{[p]:"",ref:_,children:P})});b.displayName=f;function w(y){const C=i(e+"CollectionConsumer",y);return R.useCallback(()=>{const P=C.collectionRef.current;if(!P)return[];const S=Array.from(P.querySelectorAll(`[${p}]`));return Array.from(C.itemMap.values()).sort((T,A)=>S.indexOf(T.ref.current)-S.indexOf(A.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:s,Slot:d,ItemSlot:b},w,n]}var UY=v.createContext(void 0);function Mg(e){const t=v.useContext(UY);return e||t||"ltr"}const zY=["top","right","bottom","left"],_o=Math.min,Pr=Math.max,wf=Math.round,Bd=Math.floor,yn=e=>({x:e,y:e}),GY={left:"right",right:"left",bottom:"top",top:"bottom"},YY={start:"end",end:"start"};function dv(e,t,r){return Pr(e,_o(t,r))}function Xn(e,t){return typeof e=="function"?e(t):e}function Zn(e){return e.split("-")[0]}function ya(e){return e.split("-")[1]}function Og(e){return e==="x"?"y":"x"}function Ng(e){return e==="y"?"height":"width"}function To(e){return["top","bottom"].includes(Zn(e))?"y":"x"}function Ig(e){return Og(To(e))}function XY(e,t,r){r===void 0&&(r=!1);const n=ya(e),o=Ig(e),i=Ng(o);let s=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Ef(s)),[s,Ef(s)]}function ZY(e){const t=Ef(e);return[fv(e),t,fv(t)]}function fv(e){return e.replace(/start|end/g,t=>YY[t])}function QY(e,t,r){const n=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return r?t?o:n:t?n:o;case"left":case"right":return t?i:s;default:return[]}}function JY(e,t,r,n){const o=ya(e);let i=QY(Zn(e),r==="start",n);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(fv)))),i}function Ef(e){return e.replace(/left|right|bottom|top/g,t=>GY[t])}function eX(e){return{top:0,right:0,bottom:0,left:0,...e}}function Y_(e){return typeof e!="number"?eX(e):{top:e,right:e,bottom:e,left:e}}function Cf(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function CR(e,t,r){let{reference:n,floating:o}=e;const i=To(t),s=Ig(t),l=Ng(s),c=Zn(t),d=i==="y",f=n.x+n.width/2-o.width/2,p=n.y+n.height/2-o.height/2,h=n[l]/2-o[l]/2;let b;switch(c){case"top":b={x:f,y:n.y-o.height};break;case"bottom":b={x:f,y:n.y+n.height};break;case"right":b={x:n.x+n.width,y:p};break;case"left":b={x:n.x-o.width,y:p};break;default:b={x:n.x,y:n.y}}switch(ya(t)){case"start":b[s]-=h*(r&&d?-1:1);break;case"end":b[s]+=h*(r&&d?-1:1);break}return b}const tX=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:s}=r,l=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let d=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:p}=CR(d,n,c),h=n,b={},w=0;for(let y=0;y<l.length;y++){const{name:C,fn:x}=l[y],{x:P,y:S,data:D,reset:_}=await x({x:f,y:p,initialPlacement:n,placement:h,strategy:o,middlewareData:b,rects:d,platform:s,elements:{reference:e,floating:t}});f=P??f,p=S??p,b={...b,[C]:{...b[C],...D}},_&&w<=50&&(w++,typeof _=="object"&&(_.placement&&(h=_.placement),_.rects&&(d=_.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):_.rects),{x:f,y:p}=CR(d,h,c)),y=-1)}return{x:f,y:p,placement:h,strategy:o,middlewareData:b}};async function Gu(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:i,rects:s,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:p="floating",altBoundary:h=!1,padding:b=0}=Xn(t,e),w=Y_(b),C=l[h?p==="floating"?"reference":"floating":p],x=Cf(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(C)))==null||r?C:C.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:d,rootBoundary:f,strategy:c})),P=p==="floating"?{x:n,y:o,width:s.floating.width,height:s.floating.height}:s.reference,S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),D=await(i.isElement==null?void 0:i.isElement(S))?await(i.getScale==null?void 0:i.getScale(S))||{x:1,y:1}:{x:1,y:1},_=Cf(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:P,offsetParent:S,strategy:c}):P);return{top:(x.top-_.top+w.top)/D.y,bottom:(_.bottom-x.bottom+w.bottom)/D.y,left:(x.left-_.left+w.left)/D.x,right:(_.right-x.right+w.right)/D.x}}const rX=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:i,platform:s,elements:l,middlewareData:c}=t,{element:d,padding:f=0}=Xn(e,t)||{};if(d==null)return{};const p=Y_(f),h={x:r,y:n},b=Ig(o),w=Ng(b),y=await s.getDimensions(d),C=b==="y",x=C?"top":"left",P=C?"bottom":"right",S=C?"clientHeight":"clientWidth",D=i.reference[w]+i.reference[b]-h[b]-i.floating[w],_=h[b]-i.reference[b],T=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let A=T?T[S]:0;(!A||!await(s.isElement==null?void 0:s.isElement(T)))&&(A=l.floating[S]||i.floating[w]);const M=D/2-_/2,U=A/2-y[w]/2-1,J=_o(p[x],U),N=_o(p[P],U),K=J,W=A-y[w]-N,L=A/2-y[w]/2+M,G=dv(K,L,W),k=!c.arrow&&ya(o)!=null&&L!==G&&i.reference[w]/2-(L<K?J:N)-y[w]/2<0,F=k?L<K?L-K:L-W:0;return{[b]:h[b]+F,data:{[b]:G,centerOffset:L-G-F,...k&&{alignmentOffset:F}},reset:k}}}),nX=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:i,rects:s,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:h,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:y=!0,...C}=Xn(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const x=Zn(o),P=To(l),S=Zn(l)===l,D=await(c.isRTL==null?void 0:c.isRTL(d.floating)),_=h||(S||!y?[Ef(l)]:ZY(l)),T=w!=="none";!h&&T&&_.push(...JY(l,y,w,D));const A=[l,..._],M=await Gu(t,C),U=[];let J=((n=i.flip)==null?void 0:n.overflows)||[];if(f&&U.push(M[x]),p){const L=XY(o,s,D);U.push(M[L[0]],M[L[1]])}if(J=[...J,{placement:o,overflows:U}],!U.every(L=>L<=0)){var N,K;const L=(((N=i.flip)==null?void 0:N.index)||0)+1,G=A[L];if(G)return{data:{index:L,overflows:J},reset:{placement:G}};let k=(K=J.filter(F=>F.overflows[0]<=0).sort((F,j)=>F.overflows[1]-j.overflows[1])[0])==null?void 0:K.placement;if(!k)switch(b){case"bestFit":{var W;const F=(W=J.filter(j=>{if(T){const re=To(j.placement);return re===P||re==="y"}return!0}).map(j=>[j.placement,j.overflows.filter(re=>re>0).reduce((re,V)=>re+V,0)]).sort((j,re)=>j[1]-re[1])[0])==null?void 0:W[0];F&&(k=F);break}case"initialPlacement":k=l;break}if(o!==k)return{reset:{placement:k}}}return{}}}};function RR(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function PR(e){return zY.some(t=>e[t]>=0)}const oX=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=Xn(e,t);switch(n){case"referenceHidden":{const i=await Gu(t,{...o,elementContext:"reference"}),s=RR(i,r.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:PR(s)}}}case"escaped":{const i=await Gu(t,{...o,altBoundary:!0}),s=RR(i,r.floating);return{data:{escapedOffsets:s,escaped:PR(s)}}}default:return{}}}}};async function iX(e,t){const{placement:r,platform:n,elements:o}=e,i=await(n.isRTL==null?void 0:n.isRTL(o.floating)),s=Zn(r),l=ya(r),c=To(r)==="y",d=["left","top"].includes(s)?-1:1,f=i&&c?-1:1,p=Xn(t,e);let{mainAxis:h,crossAxis:b,alignmentAxis:w}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof w=="number"&&(b=l==="end"?w*-1:w),c?{x:b*f,y:h*d}:{x:h*d,y:b*f}}const aX=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:i,placement:s,middlewareData:l}=t,c=await iX(t,e);return s===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:s}}}}},sX=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:C=>{let{x,y:P}=C;return{x,y:P}}},...c}=Xn(e,t),d={x:r,y:n},f=await Gu(t,c),p=To(Zn(o)),h=Og(p);let b=d[h],w=d[p];if(i){const C=h==="y"?"top":"left",x=h==="y"?"bottom":"right",P=b+f[C],S=b-f[x];b=dv(P,b,S)}if(s){const C=p==="y"?"top":"left",x=p==="y"?"bottom":"right",P=w+f[C],S=w-f[x];w=dv(P,w,S)}const y=l.fn({...t,[h]:b,[p]:w});return{...y,data:{x:y.x-r,y:y.y-n,enabled:{[h]:i,[p]:s}}}}}},lX=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:i,middlewareData:s}=t,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=Xn(e,t),f={x:r,y:n},p=To(o),h=Og(p);let b=f[h],w=f[p];const y=Xn(l,t),C=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(c){const S=h==="y"?"height":"width",D=i.reference[h]-i.floating[S]+C.mainAxis,_=i.reference[h]+i.reference[S]-C.mainAxis;b<D?b=D:b>_&&(b=_)}if(d){var x,P;const S=h==="y"?"width":"height",D=["top","left"].includes(Zn(o)),_=i.reference[p]-i.floating[S]+(D&&((x=s.offset)==null?void 0:x[p])||0)+(D?0:C.crossAxis),T=i.reference[p]+i.reference[S]+(D?0:((P=s.offset)==null?void 0:P[p])||0)-(D?C.crossAxis:0);w<_?w=_:w>T&&(w=T)}return{[h]:b,[p]:w}}}},uX=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:i,platform:s,elements:l}=t,{apply:c=()=>{},...d}=Xn(e,t),f=await Gu(t,d),p=Zn(o),h=ya(o),b=To(o)==="y",{width:w,height:y}=i.floating;let C,x;p==="top"||p==="bottom"?(C=p,x=h===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(x=p,C=h==="end"?"top":"bottom");const P=y-f.top-f.bottom,S=w-f.left-f.right,D=_o(y-f[C],P),_=_o(w-f[x],S),T=!t.middlewareData.shift;let A=D,M=_;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(M=S),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(A=P),T&&!h){const J=Pr(f.left,0),N=Pr(f.right,0),K=Pr(f.top,0),W=Pr(f.bottom,0);b?M=w-2*(J!==0||N!==0?J+N:Pr(f.left,f.right)):A=y-2*(K!==0||W!==0?K+W:Pr(f.top,f.bottom))}await c({...t,availableWidth:M,availableHeight:A});const U=await s.getDimensions(l.floating);return w!==U.width||y!==U.height?{reset:{rects:!0}}:{}}}};function ep(){return typeof window<"u"}function xa(e){return X_(e)?(e.nodeName||"").toLowerCase():"#document"}function _r(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Cn(e){var t;return(t=(X_(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function X_(e){return ep()?e instanceof Node||e instanceof _r(e).Node:!1}function nn(e){return ep()?e instanceof Element||e instanceof _r(e).Element:!1}function xn(e){return ep()?e instanceof HTMLElement||e instanceof _r(e).HTMLElement:!1}function SR(e){return!ep()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof _r(e).ShadowRoot}function gc(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=on(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(o)}function cX(e){return["table","td","th"].includes(xa(e))}function tp(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function kg(e){const t=Lg(),r=nn(e)?on(e):e;return["transform","translate","scale","rotate","perspective"].some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function dX(e){let t=$o(e);for(;xn(t)&&!la(t);){if(kg(t))return t;if(tp(t))return null;t=$o(t)}return null}function Lg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function la(e){return["html","body","#document"].includes(xa(e))}function on(e){return _r(e).getComputedStyle(e)}function rp(e){return nn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function $o(e){if(xa(e)==="html")return e;const t=e.assignedSlot||e.parentNode||SR(e)&&e.host||Cn(e);return SR(t)?t.host:t}function Z_(e){const t=$o(e);return la(t)?e.ownerDocument?e.ownerDocument.body:e.body:xn(t)&&gc(t)?t:Z_(t)}function Yu(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=Z_(e),i=o===((n=e.ownerDocument)==null?void 0:n.body),s=_r(o);if(i){const l=pv(s);return t.concat(s,s.visualViewport||[],gc(o)?o:[],l&&r?Yu(l):[])}return t.concat(o,Yu(o,[],r))}function pv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Q_(e){const t=on(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=xn(e),i=o?e.offsetWidth:r,s=o?e.offsetHeight:n,l=wf(r)!==i||wf(n)!==s;return l&&(r=i,n=s),{width:r,height:n,$:l}}function Fg(e){return nn(e)?e:e.contextElement}function oa(e){const t=Fg(e);if(!xn(t))return yn(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:i}=Q_(t);let s=(i?wf(r.width):r.width)/n,l=(i?wf(r.height):r.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const fX=yn(0);function J_(e){const t=_r(e);return!Lg()||!t.visualViewport?fX:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function pX(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==_r(e)?!1:t}function pi(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),i=Fg(e);let s=yn(1);t&&(n?nn(n)&&(s=oa(n)):s=oa(e));const l=pX(i,r,n)?J_(i):yn(0);let c=(o.left+l.x)/s.x,d=(o.top+l.y)/s.y,f=o.width/s.x,p=o.height/s.y;if(i){const h=_r(i),b=n&&nn(n)?_r(n):n;let w=h,y=pv(w);for(;y&&n&&b!==w;){const C=oa(y),x=y.getBoundingClientRect(),P=on(y),S=x.left+(y.clientLeft+parseFloat(P.paddingLeft))*C.x,D=x.top+(y.clientTop+parseFloat(P.paddingTop))*C.y;c*=C.x,d*=C.y,f*=C.x,p*=C.y,c+=S,d+=D,w=_r(y),y=pv(w)}}return Cf({width:f,height:p,x:c,y:d})}function qg(e,t){const r=rp(e).scrollLeft;return t?t.left+r:pi(Cn(e)).left+r}function eT(e,t,r){r===void 0&&(r=!1);const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-(r?0:qg(e,n)),i=n.top+t.scrollTop;return{x:o,y:i}}function mX(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const i=o==="fixed",s=Cn(n),l=t?tp(t.floating):!1;if(n===s||l&&i)return r;let c={scrollLeft:0,scrollTop:0},d=yn(1);const f=yn(0),p=xn(n);if((p||!p&&!i)&&((xa(n)!=="body"||gc(s))&&(c=rp(n)),xn(n))){const b=pi(n);d=oa(n),f.x=b.x+n.clientLeft,f.y=b.y+n.clientTop}const h=s&&!p&&!i?eT(s,c,!0):yn(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-c.scrollLeft*d.x+f.x+h.x,y:r.y*d.y-c.scrollTop*d.y+f.y+h.y}}function hX(e){return Array.from(e.getClientRects())}function vX(e){const t=Cn(e),r=rp(e),n=e.ownerDocument.body,o=Pr(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=Pr(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+qg(e);const l=-r.scrollTop;return on(n).direction==="rtl"&&(s+=Pr(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:s,y:l}}function gX(e,t){const r=_r(e),n=Cn(e),o=r.visualViewport;let i=n.clientWidth,s=n.clientHeight,l=0,c=0;if(o){i=o.width,s=o.height;const d=Lg();(!d||d&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}return{width:i,height:s,x:l,y:c}}function bX(e,t){const r=pi(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=xn(e)?oa(e):yn(1),s=e.clientWidth*i.x,l=e.clientHeight*i.y,c=o*i.x,d=n*i.y;return{width:s,height:l,x:c,y:d}}function _R(e,t,r){let n;if(t==="viewport")n=gX(e,r);else if(t==="document")n=vX(Cn(e));else if(nn(t))n=bX(t,r);else{const o=J_(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Cf(n)}function tT(e,t){const r=$o(e);return r===t||!nn(r)||la(r)?!1:on(r).position==="fixed"||tT(r,t)}function yX(e,t){const r=t.get(e);if(r)return r;let n=Yu(e,[],!1).filter(l=>nn(l)&&xa(l)!=="body"),o=null;const i=on(e).position==="fixed";let s=i?$o(e):e;for(;nn(s)&&!la(s);){const l=on(s),c=kg(s);!c&&l.position==="fixed"&&(o=null),(i?!c&&!o:!c&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||gc(s)&&!c&&tT(e,s))?n=n.filter(f=>f!==s):o=l,s=$o(s)}return t.set(e,n),n}function xX(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const s=[...r==="clippingAncestors"?tp(t)?[]:yX(t,this._c):[].concat(r),n],l=s[0],c=s.reduce((d,f)=>{const p=_R(t,f,o);return d.top=Pr(p.top,d.top),d.right=_o(p.right,d.right),d.bottom=_o(p.bottom,d.bottom),d.left=Pr(p.left,d.left),d},_R(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function wX(e){const{width:t,height:r}=Q_(e);return{width:t,height:r}}function EX(e,t,r){const n=xn(t),o=Cn(t),i=r==="fixed",s=pi(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=yn(0);if(n||!n&&!i)if((xa(t)!=="body"||gc(o))&&(l=rp(t)),n){const h=pi(t,!0,i,t);c.x=h.x+t.clientLeft,c.y=h.y+t.clientTop}else o&&(c.x=qg(o));const d=o&&!n&&!i?eT(o,l):yn(0),f=s.left+l.scrollLeft-c.x-d.x,p=s.top+l.scrollTop-c.y-d.y;return{x:f,y:p,width:s.width,height:s.height}}function yh(e){return on(e).position==="static"}function TR(e,t){if(!xn(e)||on(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Cn(e)===r&&(r=r.ownerDocument.body),r}function rT(e,t){const r=_r(e);if(tp(e))return r;if(!xn(e)){let o=$o(e);for(;o&&!la(o);){if(nn(o)&&!yh(o))return o;o=$o(o)}return r}let n=TR(e,t);for(;n&&cX(n)&&yh(n);)n=TR(n,t);return n&&la(n)&&yh(n)&&!kg(n)?r:n||dX(e)||r}const CX=async function(e){const t=this.getOffsetParent||rT,r=this.getDimensions,n=await r(e.floating);return{reference:EX(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function RX(e){return on(e).direction==="rtl"}const PX={convertOffsetParentRelativeRectToViewportRelativeRect:mX,getDocumentElement:Cn,getClippingRect:xX,getOffsetParent:rT,getElementRects:CX,getClientRects:hX,getDimensions:wX,getScale:oa,isElement:nn,isRTL:RX};function nT(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function SX(e,t){let r=null,n;const o=Cn(e);function i(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function s(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const d=e.getBoundingClientRect(),{left:f,top:p,width:h,height:b}=d;if(l||t(),!h||!b)return;const w=Bd(p),y=Bd(o.clientWidth-(f+h)),C=Bd(o.clientHeight-(p+b)),x=Bd(f),S={rootMargin:-w+"px "+-y+"px "+-C+"px "+-x+"px",threshold:Pr(0,_o(1,c))||1};let D=!0;function _(T){const A=T[0].intersectionRatio;if(A!==c){if(!D)return s();A?s(!1,A):n=setTimeout(()=>{s(!1,1e-7)},1e3)}A===1&&!nT(d,e.getBoundingClientRect())&&s(),D=!1}try{r=new IntersectionObserver(_,{...S,root:o.ownerDocument})}catch{r=new IntersectionObserver(_,S)}r.observe(e)}return s(!0),i}function _X(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,d=Fg(e),f=o||i?[...d?Yu(d):[],...Yu(t)]:[];f.forEach(x=>{o&&x.addEventListener("scroll",r,{passive:!0}),i&&x.addEventListener("resize",r)});const p=d&&l?SX(d,r):null;let h=-1,b=null;s&&(b=new ResizeObserver(x=>{let[P]=x;P&&P.target===d&&b&&(b.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var S;(S=b)==null||S.observe(t)})),r()}),d&&!c&&b.observe(d),b.observe(t));let w,y=c?pi(e):null;c&&C();function C(){const x=pi(e);y&&!nT(y,x)&&r(),y=x,w=requestAnimationFrame(C)}return r(),()=>{var x;f.forEach(P=>{o&&P.removeEventListener("scroll",r),i&&P.removeEventListener("resize",r)}),p?.(),(x=b)==null||x.disconnect(),b=null,c&&cancelAnimationFrame(w)}}const TX=aX,$X=sX,AX=nX,DX=uX,MX=oX,$R=rX,OX=lX,NX=(e,t,r)=>{const n=new Map,o={platform:PX,...r},i={...o.platform,_c:n};return tX(e,t,{...o,platform:i})};var Qd=typeof document<"u"?R.useLayoutEffect:R.useEffect;function Rf(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!Rf(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const i=o[n];if(!(i==="_owner"&&e.$$typeof)&&!Rf(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function oT(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function AR(e,t){const r=oT(e);return Math.round(t*r)/r}function xh(e){const t=v.useRef(e);return Qd(()=>{t.current=e}),t}function IX(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[f,p]=v.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[h,b]=v.useState(n);Rf(h,n)||b(n);const[w,y]=v.useState(null),[C,x]=v.useState(null),P=v.useCallback(j=>{j!==T.current&&(T.current=j,y(j))},[]),S=v.useCallback(j=>{j!==A.current&&(A.current=j,x(j))},[]),D=i||w,_=s||C,T=v.useRef(null),A=v.useRef(null),M=v.useRef(f),U=c!=null,J=xh(c),N=xh(o),K=xh(d),W=v.useCallback(()=>{if(!T.current||!A.current)return;const j={placement:t,strategy:r,middleware:h};N.current&&(j.platform=N.current),NX(T.current,A.current,j).then(re=>{const V={...re,isPositioned:K.current!==!1};L.current&&!Rf(M.current,V)&&(M.current=V,da.flushSync(()=>{p(V)}))})},[h,t,r,N,K]);Qd(()=>{d===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,p(j=>({...j,isPositioned:!1})))},[d]);const L=v.useRef(!1);Qd(()=>(L.current=!0,()=>{L.current=!1}),[]),Qd(()=>{if(D&&(T.current=D),_&&(A.current=_),D&&_){if(J.current)return J.current(D,_,W);W()}},[D,_,W,J,U]);const G=v.useMemo(()=>({reference:T,floating:A,setReference:P,setFloating:S}),[P,S]),k=v.useMemo(()=>({reference:D,floating:_}),[D,_]),F=v.useMemo(()=>{const j={position:r,left:0,top:0};if(!k.floating)return j;const re=AR(k.floating,f.x),V=AR(k.floating,f.y);return l?{...j,transform:"translate("+re+"px, "+V+"px)",...oT(k.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:re,top:V}},[r,l,k.floating,f.x,f.y]);return v.useMemo(()=>({...f,update:W,refs:G,elements:k,floatingStyles:F}),[f,W,G,k,F])}const kX=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?$R({element:n.current,padding:o}).fn(r):{}:n?$R({element:n,padding:o}).fn(r):{}}}},LX=(e,t)=>({...TX(e),options:[e,t]}),FX=(e,t)=>({...$X(e),options:[e,t]}),qX=(e,t)=>({...OX(e),options:[e,t]}),jX=(e,t)=>({...AX(e),options:[e,t]}),BX=(e,t)=>({...DX(e),options:[e,t]}),VX=(e,t)=>({...MX(e),options:[e,t]}),KX=(e,t)=>({...kX(e),options:[e,t]});function WX(e){const t=HX(e),r=v.forwardRef((n,o)=>{const{children:i,...s}=n,l=v.Children.toArray(i),c=l.find(zX);if(c){const d=c.props.children,f=l.map(p=>p===c?v.Children.count(d)>1?v.Children.only(null):v.isValidElement(d)?d.props.children:null:p);return g.jsx(t,{...s,ref:o,children:v.isValidElement(d)?v.cloneElement(d,void 0,f):null})}return g.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}function HX(e){const t=v.forwardRef((r,n)=>{const{children:o,...i}=r;if(v.isValidElement(o)){const s=YX(o),l=GX(i,o.props);return o.type!==v.Fragment&&(l.ref=n?gt(n,s):s),v.cloneElement(o,l)}return v.Children.count(o)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var UX=Symbol("radix.slottable");function zX(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===UX}function GX(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function YX(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var XX=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ZX=XX.reduce((e,t)=>{const r=WX(`Primitive.${t}`),n=v.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),QX="Arrow",iT=v.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...i}=e;return g.jsx(ZX.svg,{...i,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});iT.displayName=QX;var JX=iT;function eZ(e){const t=tZ(e),r=v.forwardRef((n,o)=>{const{children:i,...s}=n,l=v.Children.toArray(i),c=l.find(nZ);if(c){const d=c.props.children,f=l.map(p=>p===c?v.Children.count(d)>1?v.Children.only(null):v.isValidElement(d)?d.props.children:null:p);return g.jsx(t,{...s,ref:o,children:v.isValidElement(d)?v.cloneElement(d,void 0,f):null})}return g.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}function tZ(e){const t=v.forwardRef((r,n)=>{const{children:o,...i}=r;if(v.isValidElement(o)){const s=iZ(o),l=oZ(i,o.props);return o.type!==v.Fragment&&(l.ref=n?gt(n,s):s),v.cloneElement(o,l)}return v.Children.count(o)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var rZ=Symbol("radix.slottable");function nZ(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===rZ}function oZ(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function iZ(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var aZ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],aT=aZ.reduce((e,t)=>{const r=eZ(`Primitive.${t}`),n=v.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function sZ(e){const[t,r]=v.useState(void 0);return Kt(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,l;if("borderBoxSize"in i){const c=i.borderBoxSize,d=Array.isArray(c)?c[0]:c;s=d.inlineSize,l=d.blockSize}else s=e.offsetWidth,l=e.offsetHeight;r({width:s,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var jg="Popper",[sT,Do]=wn(jg),[lZ,lT]=sT(jg),uT=e=>{const{__scopePopper:t,children:r}=e,[n,o]=v.useState(null);return g.jsx(lZ,{scope:t,anchor:n,onAnchorChange:o,children:r})};uT.displayName=jg;var cT="PopperAnchor",dT=v.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,i=lT(cT,r),s=v.useRef(null),l=Ve(t,s),c=v.useRef(null);return v.useEffect(()=>{const d=c.current;c.current=n?.current||s.current,d!==c.current&&i.onAnchorChange(c.current)}),n?null:g.jsx(aT.div,{...o,ref:l})});dT.displayName=cT;var Bg="PopperContent",[uZ,cZ]=sT(Bg),fT=v.forwardRef((e,t)=>{const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:p="partial",hideWhenDetached:h=!1,updatePositionStrategy:b="optimized",onPlaced:w,...y}=e,C=lT(Bg,r),[x,P]=v.useState(null),S=Ve(t,te=>P(te)),[D,_]=v.useState(null),T=sZ(D),A=T?.width??0,M=T?.height??0,U=n+(i!=="center"?"-"+i:""),J=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},N=Array.isArray(d)?d:[d],K=N.length>0,W={padding:J,boundary:N.filter(fZ),altBoundary:K},{refs:L,floatingStyles:G,placement:k,isPositioned:F,middlewareData:j}=IX({strategy:"fixed",placement:U,whileElementsMounted:(...te)=>_X(...te,{animationFrame:b==="always"}),elements:{reference:C.anchor},middleware:[LX({mainAxis:o+M,alignmentAxis:s}),c&&FX({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?qX():void 0,...W}),c&&jX({...W}),BX({...W,apply:({elements:te,rects:ve,availableWidth:q,availableHeight:ae})=>{const{width:oe,height:Z}=ve.reference,we=te.floating.style;we.setProperty("--radix-popper-available-width",`${q}px`),we.setProperty("--radix-popper-available-height",`${ae}px`),we.setProperty("--radix-popper-anchor-width",`${oe}px`),we.setProperty("--radix-popper-anchor-height",`${Z}px`)}}),D&&KX({element:D,padding:l}),pZ({arrowWidth:A,arrowHeight:M}),h&&VX({strategy:"referenceHidden",...W})]}),[re,V]=hT(k),ie=Xt(w);Kt(()=>{F&&ie?.()},[F,ie]);const Y=j.arrow?.x,X=j.arrow?.y,ce=j.arrow?.centerOffset!==0,[ue,pe]=v.useState();return Kt(()=>{x&&pe(window.getComputedStyle(x).zIndex)},[x]),g.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:F?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ue,"--radix-popper-transform-origin":[j.transformOrigin?.x,j.transformOrigin?.y].join(" "),...j.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:g.jsx(uZ,{scope:r,placedSide:re,onArrowChange:_,arrowX:Y,arrowY:X,shouldHideArrow:ce,children:g.jsx(aT.div,{"data-side":re,"data-align":V,...y,ref:S,style:{...y.style,animation:F?void 0:"none"}})})})});fT.displayName=Bg;var pT="PopperArrow",dZ={top:"bottom",right:"left",bottom:"top",left:"right"},mT=v.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,i=cZ(pT,n),s=dZ[i.placedSide];return g.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:g.jsx(JX,{...o,ref:r,style:{...o.style,display:"block"}})})});mT.displayName=pT;function fZ(e){return e!==null}var pZ=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:o}=t,s=o.arrow?.centerOffset!==0,l=s?0:e.arrowWidth,c=s?0:e.arrowHeight,[d,f]=hT(r),p={start:"0%",center:"50%",end:"100%"}[f],h=(o.arrow?.x??0)+l/2,b=(o.arrow?.y??0)+c/2;let w="",y="";return d==="bottom"?(w=s?p:`${h}px`,y=`${-c}px`):d==="top"?(w=s?p:`${h}px`,y=`${n.floating.height+c}px`):d==="right"?(w=`${-c}px`,y=s?p:`${b}px`):d==="left"&&(w=`${n.floating.width+c}px`,y=s?p:`${b}px`),{data:{x:w,y}}}});function hT(e){const[t,r="center"]=e.split("-");return[t,r]}var bc=uT,yc=dT,np=fT,op=mT;function vT(e){const t=mZ(e),r=v.forwardRef((n,o)=>{const{children:i,...s}=n,l=v.Children.toArray(i),c=l.find(vZ);if(c){const d=c.props.children,f=l.map(p=>p===c?v.Children.count(d)>1?v.Children.only(null):v.isValidElement(d)?d.props.children:null:p);return g.jsx(t,{...s,ref:o,children:v.isValidElement(d)?v.cloneElement(d,void 0,f):null})}return g.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}function mZ(e){const t=v.forwardRef((r,n)=>{const{children:o,...i}=r;if(v.isValidElement(o)){const s=bZ(o),l=gZ(i,o.props);return o.type!==v.Fragment&&(l.ref=n?gt(n,s):s),v.cloneElement(o,l)}return v.Children.count(o)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var hZ=Symbol("radix.slottable");function vZ(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===hZ}function gZ(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function bZ(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var yZ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],xc=yZ.reduce((e,t)=>{const r=vT(`Primitive.${t}`),n=v.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function xZ(e,t){e&&da.flushSync(()=>e.dispatchEvent(t))}function wZ(e){const t=EZ(e),r=v.forwardRef((n,o)=>{const{children:i,...s}=n,l=v.Children.toArray(i),c=l.find(RZ);if(c){const d=c.props.children,f=l.map(p=>p===c?v.Children.count(d)>1?v.Children.only(null):v.isValidElement(d)?d.props.children:null:p);return g.jsx(t,{...s,ref:o,children:v.isValidElement(d)?v.cloneElement(d,void 0,f):null})}return g.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}function EZ(e){const t=v.forwardRef((r,n)=>{const{children:o,...i}=r;if(v.isValidElement(o)){const s=SZ(o),l=PZ(i,o.props);return o.type!==v.Fragment&&(l.ref=n?gt(n,s):s),v.cloneElement(o,l)}return v.Children.count(o)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var CZ=Symbol("radix.slottable");function RZ(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===CZ}function PZ(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function SZ(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var _Z=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],gT=_Z.reduce((e,t)=>{const r=wZ(`Primitive.${t}`),n=v.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),wh="rovingFocusGroup.onEntryFocus",TZ={bubbles:!1,cancelable:!0},wc="RovingFocusGroup",[mv,bT,$Z]=Dg(wc),[AZ,yT]=wn(wc,[$Z]),[DZ,MZ]=AZ(wc),xT=v.forwardRef((e,t)=>g.jsx(mv.Provider,{scope:e.__scopeRovingFocusGroup,children:g.jsx(mv.Slot,{scope:e.__scopeRovingFocusGroup,children:g.jsx(OZ,{...e,ref:t})})}));xT.displayName=wc;var OZ=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...p}=e,h=v.useRef(null),b=Ve(t,h),w=Mg(i),[y,C]=ut({prop:s,defaultProp:l??null,onChange:c,caller:wc}),[x,P]=v.useState(!1),S=Xt(d),D=bT(r),_=v.useRef(!1),[T,A]=v.useState(0);return v.useEffect(()=>{const M=h.current;if(M)return M.addEventListener(wh,S),()=>M.removeEventListener(wh,S)},[S]),g.jsx(DZ,{scope:r,orientation:n,dir:w,loop:o,currentTabStopId:y,onItemFocus:v.useCallback(M=>C(M),[C]),onItemShiftTab:v.useCallback(()=>P(!0),[]),onFocusableItemAdd:v.useCallback(()=>A(M=>M+1),[]),onFocusableItemRemove:v.useCallback(()=>A(M=>M-1),[]),children:g.jsx(gT.div,{tabIndex:x||T===0?-1:0,"data-orientation":n,...p,ref:b,style:{outline:"none",...e.style},onMouseDown:Se(e.onMouseDown,()=>{_.current=!0}),onFocus:Se(e.onFocus,M=>{const U=!_.current;if(M.target===M.currentTarget&&U&&!x){const J=new CustomEvent(wh,TZ);if(M.currentTarget.dispatchEvent(J),!J.defaultPrevented){const N=D().filter(k=>k.focusable),K=N.find(k=>k.active),W=N.find(k=>k.id===y),G=[K,W,...N].filter(Boolean).map(k=>k.ref.current);CT(G,f)}}_.current=!1}),onBlur:Se(e.onBlur,()=>P(!1))})})}),wT="RovingFocusGroupItem",ET=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:o=!1,tabStopId:i,children:s,...l}=e,c=_t(),d=i||c,f=MZ(wT,r),p=f.currentTabStopId===d,h=bT(r),{onFocusableItemAdd:b,onFocusableItemRemove:w,currentTabStopId:y}=f;return v.useEffect(()=>{if(n)return b(),()=>w()},[n,b,w]),g.jsx(mv.ItemSlot,{scope:r,id:d,focusable:n,active:o,children:g.jsx(gT.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...l,ref:t,onMouseDown:Se(e.onMouseDown,C=>{n?f.onItemFocus(d):C.preventDefault()}),onFocus:Se(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:Se(e.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){f.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const x=kZ(C,f.orientation,f.dir);if(x!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let S=h().filter(D=>D.focusable).map(D=>D.ref.current);if(x==="last")S.reverse();else if(x==="prev"||x==="next"){x==="prev"&&S.reverse();const D=S.indexOf(C.currentTarget);S=f.loop?LZ(S,D+1):S.slice(D+1)}setTimeout(()=>CT(S))}}),children:typeof s=="function"?s({isCurrentTabStop:p,hasTabStop:y!=null}):s})})});ET.displayName=wT;var NZ={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function IZ(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function kZ(e,t,r){const n=IZ(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return NZ[n]}function CT(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function LZ(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var FZ=xT,qZ=ET,hv=["Enter"," "],jZ=["ArrowDown","PageUp","Home"],RT=["ArrowUp","PageDown","End"],BZ=[...jZ,...RT],VZ={ltr:[...hv,"ArrowRight"],rtl:[...hv,"ArrowLeft"]},KZ={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ec="Menu",[Xu,WZ,HZ]=Dg(Ec),[Ei,PT]=wn(Ec,[HZ,Do,yT]),Cc=Do(),ST=yT(),[_T,Mo]=Ei(Ec),[UZ,Rc]=Ei(Ec),TT=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:o,onOpenChange:i,modal:s=!0}=e,l=Cc(t),[c,d]=v.useState(null),f=v.useRef(!1),p=Xt(i),h=Mg(o);return v.useEffect(()=>{const b=()=>{f.current=!0,document.addEventListener("pointerdown",w,{capture:!0,once:!0}),document.addEventListener("pointermove",w,{capture:!0,once:!0})},w=()=>f.current=!1;return document.addEventListener("keydown",b,{capture:!0}),()=>{document.removeEventListener("keydown",b,{capture:!0}),document.removeEventListener("pointerdown",w,{capture:!0}),document.removeEventListener("pointermove",w,{capture:!0})}},[]),g.jsx(bc,{...l,children:g.jsx(_T,{scope:t,open:r,onOpenChange:p,content:c,onContentChange:d,children:g.jsx(UZ,{scope:t,onClose:v.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:f,dir:h,modal:s,children:n})})})};TT.displayName=Ec;var zZ="MenuAnchor",Vg=v.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,o=Cc(r);return g.jsx(yc,{...o,...n,ref:t})});Vg.displayName=zZ;var Kg="MenuPortal",[GZ,$T]=Ei(Kg,{forceMount:void 0}),AT=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:o}=e,i=Mo(Kg,t);return g.jsx(GZ,{scope:t,forceMount:r,children:g.jsx(Tr,{present:r||i.open,children:g.jsx(ha,{asChild:!0,container:o,children:n})})})};AT.displayName=Kg;var Kr="MenuContent",[YZ,Wg]=Ei(Kr),DT=v.forwardRef((e,t)=>{const r=$T(Kr,e.__scopeMenu),{forceMount:n=r.forceMount,...o}=e,i=Mo(Kr,e.__scopeMenu),s=Rc(Kr,e.__scopeMenu);return g.jsx(Xu.Provider,{scope:e.__scopeMenu,children:g.jsx(Tr,{present:n||i.open,children:g.jsx(Xu.Slot,{scope:e.__scopeMenu,children:s.modal?g.jsx(XZ,{...o,ref:t}):g.jsx(ZZ,{...o,ref:t})})})})}),XZ=v.forwardRef((e,t)=>{const r=Mo(Kr,e.__scopeMenu),n=v.useRef(null),o=Ve(t,n);return v.useEffect(()=>{const i=n.current;if(i)return oc(i)},[]),g.jsx(Hg,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Se(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),ZZ=v.forwardRef((e,t)=>{const r=Mo(Kr,e.__scopeMenu);return g.jsx(Hg,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),QZ=vT("MenuContent.ScrollLock"),Hg=v.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:h,onDismiss:b,disableOutsideScroll:w,...y}=e,C=Mo(Kr,r),x=Rc(Kr,r),P=Cc(r),S=ST(r),D=WZ(r),[_,T]=v.useState(null),A=v.useRef(null),M=Ve(t,A,C.onContentChange),U=v.useRef(0),J=v.useRef(""),N=v.useRef(0),K=v.useRef(null),W=v.useRef("right"),L=v.useRef(0),G=w?va:v.Fragment,k=w?{as:QZ,allowPinchZoom:!0}:void 0,F=re=>{const V=J.current+re,ie=D().filter(te=>!te.disabled),Y=document.activeElement,X=ie.find(te=>te.ref.current===Y)?.textValue,ce=ie.map(te=>te.textValue),ue=cQ(ce,V,X),pe=ie.find(te=>te.textValue===ue)?.ref.current;(function te(ve){J.current=ve,window.clearTimeout(U.current),ve!==""&&(U.current=window.setTimeout(()=>te(""),1e3))})(V),pe&&setTimeout(()=>pe.focus())};v.useEffect(()=>()=>window.clearTimeout(U.current),[]),Lf();const j=v.useCallback(re=>W.current===K.current?.side&&fQ(re,K.current?.area),[]);return g.jsx(YZ,{scope:r,searchRef:J,onItemEnter:v.useCallback(re=>{j(re)&&re.preventDefault()},[j]),onItemLeave:v.useCallback(re=>{j(re)||(A.current?.focus(),T(null))},[j]),onTriggerLeave:v.useCallback(re=>{j(re)&&re.preventDefault()},[j]),pointerGraceTimerRef:N,onPointerGraceIntentChange:v.useCallback(re=>{K.current=re},[]),children:g.jsx(G,{...k,children:g.jsx(rc,{asChild:!0,trapped:o,onMountAutoFocus:Se(i,re=>{re.preventDefault(),A.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:g.jsx(ma,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:h,onDismiss:b,children:g.jsx(FZ,{asChild:!0,...S,dir:x.dir,orientation:"vertical",loop:n,currentTabStopId:_,onCurrentTabStopIdChange:T,onEntryFocus:Se(c,re=>{x.isUsingKeyboardRef.current||re.preventDefault()}),preventScrollOnEntryFocus:!0,children:g.jsx(np,{role:"menu","aria-orientation":"vertical","data-state":GT(C.open),"data-radix-menu-content":"",dir:x.dir,...P,...y,ref:M,style:{outline:"none",...y.style},onKeyDown:Se(y.onKeyDown,re=>{const ie=re.target.closest("[data-radix-menu-content]")===re.currentTarget,Y=re.ctrlKey||re.altKey||re.metaKey,X=re.key.length===1;ie&&(re.key==="Tab"&&re.preventDefault(),!Y&&X&&F(re.key));const ce=A.current;if(re.target!==ce||!BZ.includes(re.key))return;re.preventDefault();const pe=D().filter(te=>!te.disabled).map(te=>te.ref.current);RT.includes(re.key)&&pe.reverse(),lQ(pe)}),onBlur:Se(e.onBlur,re=>{re.currentTarget.contains(re.target)||(window.clearTimeout(U.current),J.current="")}),onPointerMove:Se(e.onPointerMove,Zu(re=>{const V=re.target,ie=L.current!==re.clientX;if(re.currentTarget.contains(V)&&ie){const Y=re.clientX>L.current?"right":"left";W.current=Y,L.current=re.clientX}}))})})})})})})});DT.displayName=Kr;var JZ="MenuGroup",Ug=v.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return g.jsx(xc.div,{role:"group",...n,ref:t})});Ug.displayName=JZ;var eQ="MenuLabel",MT=v.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return g.jsx(xc.div,{...n,ref:t})});MT.displayName=eQ;var Pf="MenuItem",DR="menu.itemSelect",ip=v.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...o}=e,i=v.useRef(null),s=Rc(Pf,e.__scopeMenu),l=Wg(Pf,e.__scopeMenu),c=Ve(t,i),d=v.useRef(!1),f=()=>{const p=i.current;if(!r&&p){const h=new CustomEvent(DR,{bubbles:!0,cancelable:!0});p.addEventListener(DR,b=>n?.(b),{once:!0}),xZ(p,h),h.defaultPrevented?d.current=!1:s.onClose()}};return g.jsx(OT,{...o,ref:c,disabled:r,onClick:Se(e.onClick,f),onPointerDown:p=>{e.onPointerDown?.(p),d.current=!0},onPointerUp:Se(e.onPointerUp,p=>{d.current||p.currentTarget?.click()}),onKeyDown:Se(e.onKeyDown,p=>{const h=l.searchRef.current!=="";r||h&&p.key===" "||hv.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});ip.displayName=Pf;var OT=v.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:o,...i}=e,s=Wg(Pf,r),l=ST(r),c=v.useRef(null),d=Ve(t,c),[f,p]=v.useState(!1),[h,b]=v.useState("");return v.useEffect(()=>{const w=c.current;w&&b((w.textContent??"").trim())},[i.children]),g.jsx(Xu.ItemSlot,{scope:r,disabled:n,textValue:o??h,children:g.jsx(qZ,{asChild:!0,...l,focusable:!n,children:g.jsx(xc.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...i,ref:d,onPointerMove:Se(e.onPointerMove,Zu(w=>{n?s.onItemLeave(w):(s.onItemEnter(w),w.defaultPrevented||w.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Se(e.onPointerLeave,Zu(w=>s.onItemLeave(w))),onFocus:Se(e.onFocus,()=>p(!0)),onBlur:Se(e.onBlur,()=>p(!1))})})})}),tQ="MenuCheckboxItem",NT=v.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...o}=e;return g.jsx(qT,{scope:e.__scopeMenu,checked:r,children:g.jsx(ip,{role:"menuitemcheckbox","aria-checked":Sf(r)?"mixed":r,...o,ref:t,"data-state":Yg(r),onSelect:Se(o.onSelect,()=>n?.(Sf(r)?!0:!r),{checkForDefaultPrevented:!1})})})});NT.displayName=tQ;var IT="MenuRadioGroup",[rQ,nQ]=Ei(IT,{value:void 0,onValueChange:()=>{}}),kT=v.forwardRef((e,t)=>{const{value:r,onValueChange:n,...o}=e,i=Xt(n);return g.jsx(rQ,{scope:e.__scopeMenu,value:r,onValueChange:i,children:g.jsx(Ug,{...o,ref:t})})});kT.displayName=IT;var LT="MenuRadioItem",FT=v.forwardRef((e,t)=>{const{value:r,...n}=e,o=nQ(LT,e.__scopeMenu),i=r===o.value;return g.jsx(qT,{scope:e.__scopeMenu,checked:i,children:g.jsx(ip,{role:"menuitemradio","aria-checked":i,...n,ref:t,"data-state":Yg(i),onSelect:Se(n.onSelect,()=>o.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});FT.displayName=LT;var zg="MenuItemIndicator",[qT,oQ]=Ei(zg,{checked:!1}),jT=v.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...o}=e,i=oQ(zg,r);return g.jsx(Tr,{present:n||Sf(i.checked)||i.checked===!0,children:g.jsx(xc.span,{...o,ref:t,"data-state":Yg(i.checked)})})});jT.displayName=zg;var iQ="MenuSeparator",BT=v.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return g.jsx(xc.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});BT.displayName=iQ;var aQ="MenuArrow",VT=v.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,o=Cc(r);return g.jsx(op,{...o,...n,ref:t})});VT.displayName=aQ;var Gg="MenuSub",[sQ,KT]=Ei(Gg),WT=e=>{const{__scopeMenu:t,children:r,open:n=!1,onOpenChange:o}=e,i=Mo(Gg,t),s=Cc(t),[l,c]=v.useState(null),[d,f]=v.useState(null),p=Xt(o);return v.useEffect(()=>(i.open===!1&&p(!1),()=>p(!1)),[i.open,p]),g.jsx(bc,{...s,children:g.jsx(_T,{scope:t,open:n,onOpenChange:p,content:d,onContentChange:f,children:g.jsx(sQ,{scope:t,contentId:_t(),triggerId:_t(),trigger:l,onTriggerChange:c,children:r})})})};WT.displayName=Gg;var Ou="MenuSubTrigger",HT=v.forwardRef((e,t)=>{const r=Mo(Ou,e.__scopeMenu),n=Rc(Ou,e.__scopeMenu),o=KT(Ou,e.__scopeMenu),i=Wg(Ou,e.__scopeMenu),s=v.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=i,d={__scopeMenu:e.__scopeMenu},f=v.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return v.useEffect(()=>f,[f]),v.useEffect(()=>{const p=l.current;return()=>{window.clearTimeout(p),c(null)}},[l,c]),g.jsx(Vg,{asChild:!0,...d,children:g.jsx(OT,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":o.contentId,"data-state":GT(r.open),...e,ref:gt(t,o.onTriggerChange),onClick:p=>{e.onClick?.(p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:Se(e.onPointerMove,Zu(p=>{i.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!r.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{r.onOpenChange(!0),f()},100))})),onPointerLeave:Se(e.onPointerLeave,Zu(p=>{f();const h=r.content?.getBoundingClientRect();if(h){const b=r.content?.dataset.side,w=b==="right",y=w?-5:5,C=h[w?"left":"right"],x=h[w?"right":"left"];i.onPointerGraceIntentChange({area:[{x:p.clientX+y,y:p.clientY},{x:C,y:h.top},{x,y:h.top},{x,y:h.bottom},{x:C,y:h.bottom}],side:b}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(p),p.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:Se(e.onKeyDown,p=>{const h=i.searchRef.current!=="";e.disabled||h&&p.key===" "||VZ[n.dir].includes(p.key)&&(r.onOpenChange(!0),r.content?.focus(),p.preventDefault())})})})});HT.displayName=Ou;var UT="MenuSubContent",zT=v.forwardRef((e,t)=>{const r=$T(Kr,e.__scopeMenu),{forceMount:n=r.forceMount,...o}=e,i=Mo(Kr,e.__scopeMenu),s=Rc(Kr,e.__scopeMenu),l=KT(UT,e.__scopeMenu),c=v.useRef(null),d=Ve(t,c);return g.jsx(Xu.Provider,{scope:e.__scopeMenu,children:g.jsx(Tr,{present:n||i.open,children:g.jsx(Xu.Slot,{scope:e.__scopeMenu,children:g.jsx(Hg,{id:l.contentId,"aria-labelledby":l.triggerId,...o,ref:d,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{s.isUsingKeyboardRef.current&&c.current?.focus(),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:Se(e.onFocusOutside,f=>{f.target!==l.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Se(e.onEscapeKeyDown,f=>{s.onClose(),f.preventDefault()}),onKeyDown:Se(e.onKeyDown,f=>{const p=f.currentTarget.contains(f.target),h=KZ[s.dir].includes(f.key);p&&h&&(i.onOpenChange(!1),l.trigger?.focus(),f.preventDefault())})})})})})});zT.displayName=UT;function GT(e){return e?"open":"closed"}function Sf(e){return e==="indeterminate"}function Yg(e){return Sf(e)?"indeterminate":e?"checked":"unchecked"}function lQ(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function uQ(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function cQ(e,t,r){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let s=uQ(e,Math.max(i,0));o.length===1&&(s=s.filter(d=>d!==r));const c=s.find(d=>d.toLowerCase().startsWith(o.toLowerCase()));return c!==r?c:void 0}function dQ(e,t){const{x:r,y:n}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const l=t[i],c=t[s],d=l.x,f=l.y,p=c.x,h=c.y;f>n!=h>n&&r<(p-d)*(n-f)/(h-f)+d&&(o=!o)}return o}function fQ(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return dQ(r,t)}function Zu(e){return t=>t.pointerType==="mouse"?e(t):void 0}var pQ=TT,mQ=Vg,hQ=AT,vQ=DT,gQ=Ug,bQ=MT,yQ=ip,xQ=NT,wQ=kT,EQ=FT,CQ=jT,RQ=BT,PQ=VT,SQ=WT,_Q=HT,TQ=zT,ap="DropdownMenu",[$Q]=wn(ap,[PT]),nr=PT(),[AQ,YT]=$Q(ap),XT=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:o,defaultOpen:i,onOpenChange:s,modal:l=!0}=e,c=nr(t),d=v.useRef(null),[f,p]=ut({prop:o,defaultProp:i??!1,onChange:s,caller:ap});return g.jsx(AQ,{scope:t,triggerId:_t(),triggerRef:d,contentId:_t(),open:f,onOpenChange:p,onOpenToggle:v.useCallback(()=>p(h=>!h),[p]),modal:l,children:g.jsx(pQ,{...c,open:f,onOpenChange:p,dir:n,modal:l,children:r})})};XT.displayName=ap;var ZT="DropdownMenuTrigger",QT=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...o}=e,i=YT(ZT,r),s=nr(r);return g.jsx(mQ,{asChild:!0,...s,children:g.jsx(jY.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...o,ref:gt(t,i.triggerRef),onPointerDown:Se(e.onPointerDown,l=>{!n&&l.button===0&&l.ctrlKey===!1&&(i.onOpenToggle(),i.open||l.preventDefault())}),onKeyDown:Se(e.onKeyDown,l=>{n||(["Enter"," "].includes(l.key)&&i.onOpenToggle(),l.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});QT.displayName=ZT;var DQ="DropdownMenuPortal",JT=e=>{const{__scopeDropdownMenu:t,...r}=e,n=nr(t);return g.jsx(hQ,{...n,...r})};JT.displayName=DQ;var e$="DropdownMenuContent",t$=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=YT(e$,r),i=nr(r),s=v.useRef(!1);return g.jsx(vQ,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...n,ref:t,onCloseAutoFocus:Se(e.onCloseAutoFocus,l=>{s.current||o.triggerRef.current?.focus(),s.current=!1,l.preventDefault()}),onInteractOutside:Se(e.onInteractOutside,l=>{const c=l.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,f=c.button===2||d;(!o.modal||f)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});t$.displayName=e$;var MQ="DropdownMenuGroup",r$=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=nr(r);return g.jsx(gQ,{...o,...n,ref:t})});r$.displayName=MQ;var OQ="DropdownMenuLabel",n$=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=nr(r);return g.jsx(bQ,{...o,...n,ref:t})});n$.displayName=OQ;var NQ="DropdownMenuItem",o$=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=nr(r);return g.jsx(yQ,{...o,...n,ref:t})});o$.displayName=NQ;var IQ="DropdownMenuCheckboxItem",i$=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=nr(r);return g.jsx(xQ,{...o,...n,ref:t})});i$.displayName=IQ;var kQ="DropdownMenuRadioGroup",a$=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=nr(r);return g.jsx(wQ,{...o,...n,ref:t})});a$.displayName=kQ;var LQ="DropdownMenuRadioItem",s$=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=nr(r);return g.jsx(EQ,{...o,...n,ref:t})});s$.displayName=LQ;var FQ="DropdownMenuItemIndicator",l$=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=nr(r);return g.jsx(CQ,{...o,...n,ref:t})});l$.displayName=FQ;var qQ="DropdownMenuSeparator",u$=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=nr(r);return g.jsx(RQ,{...o,...n,ref:t})});u$.displayName=qQ;var jQ="DropdownMenuArrow",BQ=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=nr(r);return g.jsx(PQ,{...o,...n,ref:t})});BQ.displayName=jQ;var VQ=e=>{const{__scopeDropdownMenu:t,children:r,open:n,onOpenChange:o,defaultOpen:i}=e,s=nr(t),[l,c]=ut({prop:n,defaultProp:i??!1,onChange:o,caller:"DropdownMenuSub"});return g.jsx(SQ,{...s,open:l,onOpenChange:c,children:r})},KQ="DropdownMenuSubTrigger",c$=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=nr(r);return g.jsx(_Q,{...o,...n,ref:t})});c$.displayName=KQ;var WQ="DropdownMenuSubContent",d$=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=nr(r);return g.jsx(TQ,{...o,...n,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});d$.displayName=WQ;var HQ=XT,UQ=QT,f$=JT,zQ=t$,GQ=r$,YQ=n$,XQ=o$,ZQ=i$,QQ=a$,JQ=s$,p$=l$,eJ=u$,tJ=VQ,rJ=c$,nJ=d$;const m$=e=>g.jsx(HQ,{"data-slot":"menu",...e}),h$=e=>g.jsx(UQ,{"data-slot":"menu-trigger",...e}),oJ=e=>g.jsx(GQ,{"data-slot":"menu-group",...e}),iJ=e=>g.jsx(f$,{"data-slot":"menu-portal",...e}),v$=e=>g.jsx(tJ,{"data-slot":"menu-sub",...e}),aJ=e=>g.jsx(QQ,{"data-slot":"menu-radio-group",...e}),g$=({className:e,inset:t,children:r,...n})=>g.jsxs(rJ,{"data-slot":"menu-sub-trigger",className:le("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state='open']:bg-accent",t&&"pl-8",e),...n,children:[r,g.jsx(ic,{className:"ml-auto h-4 w-4"})]}),b$=({className:e,...t})=>g.jsx(nJ,{"data-slot":"menu-sub-content",className:le("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state='open']:animate-in data-[state='closed']:animate-out data-[state='closed']:fade-out-0 data-[state='open']:fade-in-0 data-[state='closed']:zoom-out-95 data-[state='open']:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}),y$=({className:e,sideOffset:t=4,...r})=>g.jsx(f$,{"data-slot":"menu-portal",children:g.jsx(zQ,{"data-slot":"menu-content",sideOffset:t,className:le("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state='open']:animate-in data-[state='closed']:animate-out data-[state='closed']:fade-out-0 data-[state='open']:fade-in-0 data-[state='closed']:zoom-out-95 data-[state='open']:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}),x$=({className:e,inset:t,...r})=>g.jsx(XQ,{"data-slot":"menu-item",className:le("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...r}),w$=({className:e,children:t,checked:r,...n})=>g.jsxs(ZQ,{"data-slot":"menu-checkbox-item",className:le("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...n,children:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(p$,{children:g.jsx(of,{className:"h-4 w-4"})})}),t]}),E$=({className:e,children:t,...r})=>g.jsxs(JQ,{"data-slot":"menu-radio-item",className:le("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(p$,{children:g.jsx(n5,{className:"h-2 w-2 fill-current"})})}),t]}),C$=({className:e,inset:t,...r})=>g.jsx(YQ,{"data-slot":"menu-label",className:le("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}),R$=({className:e,...t})=>g.jsx(eJ,{"data-slot":"menu-separator",className:le("-mx-1 my-1 h-px bg-muted",e),...t}),P$=({className:e,keys:t,handler:r,options:n={},...o})=>(K_(t,r,n),g.jsx("span",{"data-slot":"menu-shortcut",className:le("ml-auto text-xs tracking-widest opacity-60",e),...o})),S$=(e,t)=>{switch(e.type){case"item":return g.jsxs(x$,{...e,children:[e.label," ",t]});case"checkbox":return g.jsxs(w$,{...e,children:[e.label," ",t]});case"radio":return g.jsxs(E$,{...e,children:[e.label," ",t]});case"label":return g.jsxs(C$,{...e,children:[e.label," "]});case"separator":return g.jsx(R$,{...e});case"submenu":return g.jsxs(v$,{children:[g.jsx(g$,{...e,children:e.label}),g.jsx(b$,{children:e.items?.map((r,n)=>g.jsx(R.Fragment,{children:S$(r)},n))})]});default:return null}},sJ=({trigger:e,items:t,contentProps:r,side:n="bottom",offset:o})=>g.jsxs(m$,{children:[g.jsx(h$,{asChild:!0,children:e}),g.jsx(y$,{side:n,sideOffset:o,...r,children:t.map(({shortcut:i,onShortcut:s,shortcutOptions:l,...c},d)=>g.jsx(R.Fragment,{children:S$(c,i&&g.jsx(P$,{keys:i,handler:f=>s?.(f),options:l,children:i}))},d))})]}),_$=eo("inline-flex items-center relative overflow-hidden bg-gray-100 gap-1 px-2.5 py-0.5 text-xs font-normal transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{rounded:{default:"rounded-(--radius-tag)",full:"rounded-full",square:"rounded-sm"},variant:{primary:"bg-primary border-primary text-primary-foreground hover:bg-primary/80",secondary:"bg-secondary border-secondary !text-secondary-foreground hover:bg-secondary/80",error:"bg-error border-error text-error-foreground hover:bg-error/80",success:"bg-success border-success text-success-foreground hover:bg-success/80",outline:"border border-foreground text-foreground",borderless:"text-foreground"}},defaultVariants:{rounded:"default",variant:"primary"}}),vv=({className:e,color:t,variant:r,rounded:n,icon:o,closable:i,onClose:s,children:l,...c})=>{const d=!!t&&(r==="outline"||r==="borderless"),f=!!t&&!r;return g.jsxs("div",{"data-slot":"tag",className:le(_$({variant:r,rounded:n}),d&&"bg-white",f&&" text-white",!!o&&"pl-1.5",!!i&&"pr-1.5",e),style:{...d&&{color:t,borderColor:t},...f&&{borderColor:t,backgroundColor:t}},...c,children:[o,l,i&&g.jsx("button",{type:"button","data-slot":"tag-close",className:"z-10 h-4 w-4 cursor-pointer",onClick:p=>{p.stopPropagation(),s()},children:g.jsx(jf,{"data-slot":"tag-close-icon"})}),g.jsx("span",{"data-slot":"tag-overlay",className:"w-full h-full absolute top-0 left-0",style:{...d&&{opacity:.13,backgroundColor:t}}})]})};function T$(e){const t=lJ(e),r=v.forwardRef((n,o)=>{const{children:i,...s}=n,l=v.Children.toArray(i),c=l.find(cJ);if(c){const d=c.props.children,f=l.map(p=>p===c?v.Children.count(d)>1?v.Children.only(null):v.isValidElement(d)?d.props.children:null:p);return g.jsx(t,{...s,ref:o,children:v.isValidElement(d)?v.cloneElement(d,void 0,f):null})}return g.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}function lJ(e){const t=v.forwardRef((r,n)=>{const{children:o,...i}=r;if(v.isValidElement(o)){const s=fJ(o),l=dJ(i,o.props);return o.type!==v.Fragment&&(l.ref=n?gt(n,s):s),v.cloneElement(o,l)}return v.Children.count(o)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var uJ=Symbol("radix.slottable");function cJ(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===uJ}function dJ(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function fJ(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var pJ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$$=pJ.reduce((e,t)=>{const r=T$(`Primitive.${t}`),n=v.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),sp="Popover",[A$]=wn(sp,[Do]),Pc=Do(),[mJ,Oo]=A$(sp),D$=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,l=Pc(t),c=v.useRef(null),[d,f]=v.useState(!1),[p,h]=ut({prop:n,defaultProp:o??!1,onChange:i,caller:sp});return g.jsx(bc,{...l,children:g.jsx(mJ,{scope:t,contentId:_t(),triggerRef:c,open:p,onOpenChange:h,onOpenToggle:v.useCallback(()=>h(b=>!b),[h]),hasCustomAnchor:d,onCustomAnchorAdd:v.useCallback(()=>f(!0),[]),onCustomAnchorRemove:v.useCallback(()=>f(!1),[]),modal:s,children:r})})};D$.displayName=sp;var M$="PopoverAnchor",hJ=v.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Oo(M$,r),i=Pc(r),{onCustomAnchorAdd:s,onCustomAnchorRemove:l}=o;return v.useEffect(()=>(s(),()=>l()),[s,l]),g.jsx(yc,{...i,...n,ref:t})});hJ.displayName=M$;var O$="PopoverTrigger",N$=v.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Oo(O$,r),i=Pc(r),s=Ve(t,o.triggerRef),l=g.jsx($$.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":q$(o.open),...n,ref:s,onClick:Se(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:g.jsx(yc,{asChild:!0,...i,children:l})});N$.displayName=O$;var Xg="PopoverPortal",[vJ,gJ]=A$(Xg,{forceMount:void 0}),I$=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,i=Oo(Xg,t);return g.jsx(vJ,{scope:t,forceMount:r,children:g.jsx(Tr,{present:r||i.open,children:g.jsx(ha,{asChild:!0,container:o,children:n})})})};I$.displayName=Xg;var ua="PopoverContent",k$=v.forwardRef((e,t)=>{const r=gJ(ua,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,i=Oo(ua,e.__scopePopover);return g.jsx(Tr,{present:n||i.open,children:i.modal?g.jsx(yJ,{...o,ref:t}):g.jsx(xJ,{...o,ref:t})})});k$.displayName=ua;var bJ=T$("PopoverContent.RemoveScroll"),yJ=v.forwardRef((e,t)=>{const r=Oo(ua,e.__scopePopover),n=v.useRef(null),o=Ve(t,n),i=v.useRef(!1);return v.useEffect(()=>{const s=n.current;if(s)return oc(s)},[]),g.jsx(va,{as:bJ,allowPinchZoom:!0,children:g.jsx(L$,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Se(e.onCloseAutoFocus,s=>{s.preventDefault(),i.current||r.triggerRef.current?.focus()}),onPointerDownOutside:Se(e.onPointerDownOutside,s=>{const l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:Se(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),xJ=v.forwardRef((e,t)=>{const r=Oo(ua,e.__scopePopover),n=v.useRef(!1),o=v.useRef(!1);return g.jsx(L$,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(n.current||r.triggerRef.current?.focus(),i.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;r.triggerRef.current?.contains(s)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),L$=v.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,...p}=e,h=Oo(ua,r),b=Pc(r);return Lf(),g.jsx(rc,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:g.jsx(ma,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:f,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>h.onOpenChange(!1),children:g.jsx(np,{"data-state":q$(h.open),role:"dialog",id:h.contentId,...b,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),F$="PopoverClose",wJ=v.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Oo(F$,r);return g.jsx($$.button,{type:"button",...n,ref:t,onClick:Se(e.onClick,()=>o.onOpenChange(!1))})});wJ.displayName=F$;var EJ="PopoverArrow",CJ=v.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Pc(r);return g.jsx(op,{...o,...n,ref:t})});CJ.displayName=EJ;function q$(e){return e?"open":"closed"}var RJ=D$,PJ=N$,SJ=I$,_J=k$;const Sc=e=>g.jsx(RJ,{"data-slot":"popover",...e}),_c=e=>g.jsx(PJ,{"data-slot":"popover-trigger",...e}),Tc=({className:e,align:t="center",sideOffset:r=4,matchTriggerWidth:n=!1,style:o,focus:i=!0,...s})=>g.jsx(SJ,{children:g.jsx(_J,{"data-slot":"popover-content",align:t,sideOffset:r,onOpenAutoFocus:l=>{!i&&l.preventDefault(),s?.onOpenAutoFocus?.(l)},className:le("z-50 w-72 p-4 rounded-md border bg-popover text-popover-foreground shadow-md outline-none open:animate-in closed:animate-out closed:fade-out-0 open:fade-in-0 closed:zoom-out-95 open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),style:{...o,...n&&{width:"var(--radix-popper-anchor-width)"}},...s})}),TJ=e=>{const{trigger:t,children:r,rootProps:n,triggerProps:o,contentProps:i,triggerAsChild:s=!0,matchTriggerWidth:l,triggerClassName:c,contentClassName:d,side:f="bottom",offset:p}=ac("Popover",e,{triggerAsChild:!0,side:"bottom"});return g.jsxs(Sc,{...n,children:[g.jsx(_c,{asChild:s,className:c,...o,children:t}),g.jsx(Tc,{className:d,matchTriggerWidth:l,side:f,sideOffset:p,...i,children:r})]})},MR=eo("m-1 transition ease-in-out delay-150 duration-300",{variants:{variant:{default:"border-foreground/10 border text-foreground bg-card hover:bg-card/80",primary:"border-foreground/10 border text-foreground bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-foreground/60 border bg-secondary text-secondary-foreground hover:bg-secondary/80",error:"border-transparent bg-error text-error-foreground hover:bg-error/80"}},defaultVariants:{variant:"default"}}),$J=({valueKey:e,values:t,setValues:r,items:n,maxCount:o,setIsPopoverOpen:i})=>{const s=h=>{if(h.key==="Enter")i(!0);else if(h.key==="Backspace"&&!h.currentTarget.value){const b=[...t];b.pop(),r?.(b)}},l=h=>{const b=t.includes(h)?t.filter(w=>w!==h):[...t,h];r?.(b)},c=()=>{r?.([])};return{handleInputKeyDown:s,toggleOption:l,handleClear:c,handleTogglePopover:()=>{i(h=>!h)},clearExtraOptions:()=>{const h=t.slice(0,o);r?.(h)},toggleAll:()=>{const h=n.filter(b=>!b.disabled);if(t.length===h.length)c();else{const b=h.map(w=>w[e]);r?.(b)}}}},AJ=({items:e=[],value:t,valueKey:r="value",labelKey:n="label",onChange:o,variant:i,defaultValue:s=[],placeholder:l="Seleccionar",maxCount:c=3,className:d,renderOption:f=C=>C[n],withCheckbox:p=!1,showSearch:h=!0,showSelectAll:b=!0,rootProps:w,...y})=>{const[C=[],x]=ut({prop:t,onChange:o,defaultProp:s}),[P,S]=ut({prop:y.open,onChange:y.onOpenChange,defaultProp:y.defaultOpen||!1}),D=v.useMemo(()=>e.filter(N=>!N.disabled),[e]),{handleInputKeyDown:_,toggleOption:T,handleClear:A,handleTogglePopover:M,clearExtraOptions:U,toggleAll:J}=$J({valueKey:r,values:C,setValues:x,items:e,maxCount:c,setIsPopoverOpen:S});return g.jsxs(Sc,{open:P,onOpenChange:S,"data-slot":"multi-select",...w,children:[g.jsx(_c,{asChild:!0,"data-slot":"multi-select-trigger",children:g.jsx(tr,{...y,onClick:M,className:le("flex w-full p-1 rounded-md border border-input min-h-10 h-auto items-center justify-between bg-inherit hover:bg-inherit",d),children:C.length>0?g.jsxs("div",{className:"flex justify-between items-center w-full",children:[g.jsxs("div",{className:"flex flex-wrap items-center","data-slot":"multi-select-tags",children:[C.slice(0,c).map(N=>{const K=e.find(L=>L[r]===N),W=K?.icon;return g.jsxs(vv,{"data-slot":"multi-select-tag",className:le(MR({variant:i})),closable:!0,onClose:()=>T(N),children:[W&&g.jsx(W,{className:"h-4 w-4 mr-2"}),K&&f?.(K)]},N)}),C.length>c&&g.jsx(vv,{"data-slot":"multi-select-tag",className:le(MR({variant:i})),closable:!0,onClose:U,children:`+ ${C.length-c} más`})]}),g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsx(jf,{"data-slot":"multi-select-clear",className:"h-4 mx-2 cursor-pointer text-muted-foreground",onClick:N=>{N.stopPropagation(),A()}}),g.jsx(c_,{"data-slot":"multi-select-divider",orientation:"vertical",className:"flex min-h-6 h-full"}),g.jsx(af,{"data-slot":"multi-select-trigger-icon",className:"h-4 mx-2 cursor-pointer text-muted-foreground"})]})]}):g.jsxs("div",{className:"flex items-center justify-between w-full mx-auto","data-slot":"multi-select-trigger-empty",children:[g.jsx("span",{className:"text-sm text-foreground font-normal mx-2","data-slot":"multi-select-placeholder",children:l}),g.jsx(af,{"data-slot":"multi-select-trigger-icon",className:"h-4 cursor-pointer text-muted-foreground mx-2"})]})})}),g.jsx(Tc,{"data-slot":"multi-select-content",className:"p-0",matchTriggerWidth:!0,align:"start",asChild:!0,onEscapeKeyDown:()=>S(!1),children:g.jsxs(uc,{children:[h&&g.jsx(Uf,{"data-slot":"multi-select-input",placeholder:"Buscar...",onKeyDown:_}),g.jsxs(zf,{"data-slot":"multi-select-list",children:[g.jsx(Gf,{"data-slot":"multi-select-empty",children:"No results found."}),g.jsxs(sS,{"data-slot":"multi-select-group",children:[b&&g.jsxs(Ku,{"data-slot":"multi-select-item",onSelect:J,className:le("cursor-pointer",!p&&C.length===D.length&&"bg-accent text-accent-foreground"),children:[p&&g.jsx("div",{className:le("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",C.length===D.length?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:g.jsx(of,{className:"h-4 w-4"})}),g.jsx("span",{children:"(Seleccionar todo)"})]},"all"),e.map(N=>{const K=C.includes(N[r]);return g.jsxs(Ku,{"data-slot":"multi-select-item",onSelect:()=>!N.disabled&&T(N[r]),className:le(N.disabled?"!bg-neutral-50 !text-neutral-400":"cursor-pointer",!p&&K&&"!bg-accent !text-accent-foreground"),children:[p&&g.jsx("div",{className:le("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",K?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:g.jsx(of,{className:"h-4 w-4"})}),N.icon&&g.jsx(N.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),g.jsx("span",{children:f?.(N)})]},N[r])})]})]})]})})]})},DJ=({value:e,onChange:t,defaultValue:r,className:n,min:o,max:i,...s})=>{const[l,c]=ut({prop:e,onChange:t,defaultProp:r}),d=l??o??0,f=w=>{const y=parseInt(w.target.value,10);c(y)},p=()=>{if(lt.isUndefined(l)&&lt.isNumber(o))return c(o??0);const w=d+1;(lt.isUndefined(i)||w<=i)&&c(w)},h=()=>{if(lt.isUndefined(l)&&lt.isNumber(i))return c(i??0);const w=d-1;(lt.isUndefined(o)||w>=o)&&c(w)},b=()=>{const w=lt.isNumber(o)&&d<o,y=lt.isNumber(i)&&d>i;w?c(o):y&&c(i)};return g.jsxs("div",{className:"relative w-full","data-slot":"number-input-container",children:[g.jsx("input",{...s,type:"number",value:l,onChange:f,onBlur:b,min:o,max:i,className:le("numberInput","h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","file:border-0 file:bg-transparent file:text-sm file:font-medium",n),"data-slot":"number-input"}),g.jsxs("div",{className:"absolute right-0 top-0 h-full w-6 py-1 gap-px justify-center items-center flex flex-col border-l border-input overflow-hidden",children:[g.jsx(tr,{variant:"ghost",size:"icon",onClick:p,className:"h-4 w-4 grow rounded-sm","data-testid":"increment-trigger","data-slot":"number-input-increment",children:g.jsx(EP,{"data-slot":"number-input-increment-icon"})}),g.jsx(tr,{variant:"ghost",size:"icon",onClick:h,className:"h-4 w-4 grow rounded-sm","data-testid":"decrement-trigger","data-slot":"number-input-decrement",children:g.jsx(wP,{"data-slot":"number-input-decrement-icon"})})]})]})},zi=({isActive:e=!1,...t})=>g.jsx("button",{...t,"data-slot":"pagination-option","data-active":e,"data-dots":t.children===Co,className:le("transition-colors border py-2 px-4 w-[50px] h-full data-[active=false]:hover:bg-accent","data-[active=true]:bg-primary data-[active=true]:text-primary-foreground data-[active=true]:border-transparent data-[active=true]:hover:bg-primary/90",t.className)}),MJ=({optionProps:e,className:t,containerProps:r,...n})=>{const{paginationRange:o,currentPage:i,goTo:s,maxPage:l,next:c,prev:d,isLastPage:f,isFirstPage:p}=W_(n);return g.jsxs("div",{...r,className:le("flex items-end select-none h-10",r?.className,t),"data-slot":"pagination",children:[g.jsxs(zi,{...e,disabled:p,onClick:()=>s(1),className:le("rounded-l-md",e?.className),children:[g.jsx(Uj,{"data-slot":"pagination-option-icon"}),g.jsx("span",{className:"sr-only",children:"Ir a primera página"})]}),g.jsxs(zi,{...e,onClick:d,disabled:p,children:[g.jsx(zv,{"data-slot":"pagination-option-icon"}),g.jsx("span",{className:"sr-only",children:"Ir a página anterior"})]}),o.map(h=>g.jsx(g.Fragment,{children:h===Co?g.jsx(zi,{className:le("pointer-events-none",e?.className),children:Co},h):R.createElement(zi,{...e,isActive:h===i,onClick:()=>s(h),key:h},h,g.jsxs("span",{className:"sr-only",children:["Ir a la página ",h]}))})),g.jsxs(zi,{...e,onClick:c,disabled:f,children:[g.jsx(ic,{"data-slot":"pagination-option-icon"}),g.jsx("span",{className:"sr-only",children:"Ir a próxima página"})]}),g.jsxs(zi,{...e,disabled:f,onClick:()=>s(l),className:le("rounded-r-md",e?.className),children:[g.jsx(Gj,{"data-slot":"pagination-option-icon"}),g.jsx("span",{className:"sr-only",children:"Ir a última página"})]})]})},OJ=({className:e,containerClassName:t,showIcon:r=g.jsx(u5,{className:"h-4 w-4"}),hideIcon:n=g.jsx(s5,{className:"h-4 w-4"}),onShow:o,onHide:i,toggleable:s=!0,...l})=>{const[c,d]=H_(!1),f=()=>{d(),c?i?.():o?.()};return g.jsxs("div",{className:le("relative",t),"data-slot":"password",children:[g.jsx(B_,{...l,type:c?"text":"password",className:le("pr-10","[&::-ms-reveal]:hidden [&::-ms-clear]:hidden",e)}),g.jsx("button",{"data-slot":"password-toggle",type:"button",onClick:f,disabled:!s,className:le("absolute right-3 top-1/2 -translate-y-1/2 text-gray-500",s?"hover:text-gray-700":"opacity-50 cursor-not-allowed"),children:c?n:r})]})},NJ=({items:e=[],valueKey:t="value",labelKey:r="label",value:n,onChange:o,defaultValue:i,renderOption:s=y=>y?.[r],triggerProps:l,contentClassName:c,contentProps:d,itemClassName:f,itemProps:p,className:h,placeholder:b="Seleccionar",...w})=>{const[y,C]=ut({prop:n,onChange:x=>{if(!o)return;const P=e.find(S=>S[t]===x);o?.(x,P)},defaultProp:i});return g.jsxs(gA,{...w,onValueChange:C,value:y,children:[g.jsx(xA,{className:h,...l,children:g.jsx(yA,{placeholder:b})}),g.jsx(CA,{className:c,...d,children:g.jsx(bA,{children:e.map((x,P)=>R.createElement(PA,{...p,className:f,key:P,disabled:x?.disabled,value:x[t]},s?.(x)))})})]})};function OR(e,[t,r]){return Math.min(r,Math.max(t,e))}function j$(e){const t=IJ(e),r=v.forwardRef((n,o)=>{const{children:i,...s}=n,l=v.Children.toArray(i),c=l.find(LJ);if(c){const d=c.props.children,f=l.map(p=>p===c?v.Children.count(d)>1?v.Children.only(null):v.isValidElement(d)?d.props.children:null:p);return g.jsx(t,{...s,ref:o,children:v.isValidElement(d)?v.cloneElement(d,void 0,f):null})}return g.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}function IJ(e){const t=v.forwardRef((r,n)=>{const{children:o,...i}=r;if(v.isValidElement(o)){const s=qJ(o),l=FJ(i,o.props);return o.type!==v.Fragment&&(l.ref=n?gt(n,s):s),v.cloneElement(o,l)}return v.Children.count(o)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var kJ=Symbol("radix.slottable");function LJ(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===kJ}function FJ(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function qJ(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var jJ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$r=jJ.reduce((e,t)=>{const r=j$(`Primitive.${t}`),n=v.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function BJ(e){const t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function VJ(e){const t=KJ(e),r=v.forwardRef((n,o)=>{const{children:i,...s}=n,l=v.Children.toArray(i),c=l.find(HJ);if(c){const d=c.props.children,f=l.map(p=>p===c?v.Children.count(d)>1?v.Children.only(null):v.isValidElement(d)?d.props.children:null:p);return g.jsx(t,{...s,ref:o,children:v.isValidElement(d)?v.cloneElement(d,void 0,f):null})}return g.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}function KJ(e){const t=v.forwardRef((r,n)=>{const{children:o,...i}=r;if(v.isValidElement(o)){const s=zJ(o),l=UJ(i,o.props);return o.type!==v.Fragment&&(l.ref=n?gt(n,s):s),v.cloneElement(o,l)}return v.Children.count(o)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var WJ=Symbol("radix.slottable");function HJ(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===WJ}function UJ(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function zJ(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var GJ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],YJ=GJ.reduce((e,t)=>{const r=VJ(`Primitive.${t}`),n=v.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),B$=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),XJ="VisuallyHidden",V$=v.forwardRef((e,t)=>g.jsx(YJ.span,{...e,ref:t,style:{...B$,...e.style}}));V$.displayName=XJ;var ZJ=V$,QJ=[" ","Enter","ArrowUp","ArrowDown"],JJ=[" ","Enter"],mi="Select",[lp,up,eee]=Dg(mi),[wa]=wn(mi,[eee,Do]),cp=Do(),[tee,No]=wa(mi),[ree,nee]=wa(mi),K$=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:o,onOpenChange:i,value:s,defaultValue:l,onValueChange:c,dir:d,name:f,autoComplete:p,disabled:h,required:b,form:w}=e,y=cp(t),[C,x]=v.useState(null),[P,S]=v.useState(null),[D,_]=v.useState(!1),T=Mg(d),[A,M]=ut({prop:n,defaultProp:o??!1,onChange:i,caller:mi}),[U,J]=ut({prop:s,defaultProp:l,onChange:c,caller:mi}),N=v.useRef(null),K=C?w||!!C.closest("form"):!0,[W,L]=v.useState(new Set),G=Array.from(W).map(k=>k.props.value).join(";");return g.jsx(bc,{...y,children:g.jsxs(tee,{required:b,scope:t,trigger:C,onTriggerChange:x,valueNode:P,onValueNodeChange:S,valueNodeHasChildren:D,onValueNodeHasChildrenChange:_,contentId:_t(),value:U,onValueChange:J,open:A,onOpenChange:M,dir:T,triggerPointerDownPosRef:N,disabled:h,children:[g.jsx(lp.Provider,{scope:t,children:g.jsx(ree,{scope:e.__scopeSelect,onNativeOptionAdd:v.useCallback(k=>{L(F=>new Set(F).add(k))},[]),onNativeOptionRemove:v.useCallback(k=>{L(F=>{const j=new Set(F);return j.delete(k),j})},[]),children:r})}),K?g.jsxs(pA,{"aria-hidden":!0,required:b,tabIndex:-1,name:f,autoComplete:p,value:U,onChange:k=>J(k.target.value),disabled:h,form:w,children:[U===void 0?g.jsx("option",{value:""}):null,Array.from(W)]},G):null]})})};K$.displayName=mi;var W$="SelectTrigger",H$=v.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...o}=e,i=cp(r),s=No(W$,r),l=s.disabled||n,c=Ve(t,s.onTriggerChange),d=up(r),f=v.useRef("touch"),[p,h,b]=hA(y=>{const C=d().filter(S=>!S.disabled),x=C.find(S=>S.value===s.value),P=vA(C,y,x);P!==void 0&&s.onValueChange(P.value)}),w=y=>{l||(s.onOpenChange(!0),b()),y&&(s.triggerPointerDownPosRef.current={x:Math.round(y.pageX),y:Math.round(y.pageY)})};return g.jsx(yc,{asChild:!0,...i,children:g.jsx($r.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":mA(s.value)?"":void 0,...o,ref:c,onClick:Se(o.onClick,y=>{y.currentTarget.focus(),f.current!=="mouse"&&w(y)}),onPointerDown:Se(o.onPointerDown,y=>{f.current=y.pointerType;const C=y.target;C.hasPointerCapture(y.pointerId)&&C.releasePointerCapture(y.pointerId),y.button===0&&y.ctrlKey===!1&&y.pointerType==="mouse"&&(w(y),y.preventDefault())}),onKeyDown:Se(o.onKeyDown,y=>{const C=p.current!=="";!(y.ctrlKey||y.altKey||y.metaKey)&&y.key.length===1&&h(y.key),!(C&&y.key===" ")&&QJ.includes(y.key)&&(w(),y.preventDefault())})})})});H$.displayName=W$;var U$="SelectValue",z$=v.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,children:i,placeholder:s="",...l}=e,c=No(U$,r),{onValueNodeHasChildrenChange:d}=c,f=i!==void 0,p=Ve(t,c.onValueNodeChange);return Kt(()=>{d(f)},[d,f]),g.jsx($r.span,{...l,ref:p,style:{pointerEvents:"none"},children:mA(c.value)?g.jsx(g.Fragment,{children:s}):i})});z$.displayName=U$;var oee="SelectIcon",G$=v.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...o}=e;return g.jsx($r.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});G$.displayName=oee;var iee="SelectPortal",Y$=e=>g.jsx(ha,{asChild:!0,...e});Y$.displayName=iee;var hi="SelectContent",X$=v.forwardRef((e,t)=>{const r=No(hi,e.__scopeSelect),[n,o]=v.useState();if(Kt(()=>{o(new DocumentFragment)},[]),!r.open){const i=n;return i?da.createPortal(g.jsx(Z$,{scope:e.__scopeSelect,children:g.jsx(lp.Slot,{scope:e.__scopeSelect,children:g.jsx("div",{children:e.children})})}),i):null}return g.jsx(Q$,{...e,ref:t})});X$.displayName=hi;var Xr=10,[Z$,Io]=wa(hi),aee="SelectContentImpl",see=j$("SelectContent.RemoveScroll"),Q$=v.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:c,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:h,collisionPadding:b,sticky:w,hideWhenDetached:y,avoidCollisions:C,...x}=e,P=No(hi,r),[S,D]=v.useState(null),[_,T]=v.useState(null),A=Ve(t,te=>D(te)),[M,U]=v.useState(null),[J,N]=v.useState(null),K=up(r),[W,L]=v.useState(!1),G=v.useRef(!1);v.useEffect(()=>{if(S)return oc(S)},[S]),Lf();const k=v.useCallback(te=>{const[ve,...q]=K().map(Z=>Z.ref.current),[ae]=q.slice(-1),oe=document.activeElement;for(const Z of te)if(Z===oe||(Z?.scrollIntoView({block:"nearest"}),Z===ve&&_&&(_.scrollTop=0),Z===ae&&_&&(_.scrollTop=_.scrollHeight),Z?.focus(),document.activeElement!==oe))return},[K,_]),F=v.useCallback(()=>k([M,S]),[k,M,S]);v.useEffect(()=>{W&&F()},[W,F]);const{onOpenChange:j,triggerPointerDownPosRef:re}=P;v.useEffect(()=>{if(S){let te={x:0,y:0};const ve=ae=>{te={x:Math.abs(Math.round(ae.pageX)-(re.current?.x??0)),y:Math.abs(Math.round(ae.pageY)-(re.current?.y??0))}},q=ae=>{te.x<=10&&te.y<=10?ae.preventDefault():S.contains(ae.target)||j(!1),document.removeEventListener("pointermove",ve),re.current=null};return re.current!==null&&(document.addEventListener("pointermove",ve),document.addEventListener("pointerup",q,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ve),document.removeEventListener("pointerup",q,{capture:!0})}}},[S,j,re]),v.useEffect(()=>{const te=()=>j(!1);return window.addEventListener("blur",te),window.addEventListener("resize",te),()=>{window.removeEventListener("blur",te),window.removeEventListener("resize",te)}},[j]);const[V,ie]=hA(te=>{const ve=K().filter(oe=>!oe.disabled),q=ve.find(oe=>oe.ref.current===document.activeElement),ae=vA(ve,te,q);ae&&setTimeout(()=>ae.ref.current.focus())}),Y=v.useCallback((te,ve,q)=>{const ae=!G.current&&!q;(P.value!==void 0&&P.value===ve||ae)&&(U(te),ae&&(G.current=!0))},[P.value]),X=v.useCallback(()=>S?.focus(),[S]),ce=v.useCallback((te,ve,q)=>{const ae=!G.current&&!q;(P.value!==void 0&&P.value===ve||ae)&&N(te)},[P.value]),ue=n==="popper"?gv:J$,pe=ue===gv?{side:l,sideOffset:c,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:h,collisionPadding:b,sticky:w,hideWhenDetached:y,avoidCollisions:C}:{};return g.jsx(Z$,{scope:r,content:S,viewport:_,onViewportChange:T,itemRefCallback:Y,selectedItem:M,onItemLeave:X,itemTextRefCallback:ce,focusSelectedItem:F,selectedItemText:J,position:n,isPositioned:W,searchRef:V,children:g.jsx(va,{as:see,allowPinchZoom:!0,children:g.jsx(rc,{asChild:!0,trapped:P.open,onMountAutoFocus:te=>{te.preventDefault()},onUnmountAutoFocus:Se(o,te=>{P.trigger?.focus({preventScroll:!0}),te.preventDefault()}),children:g.jsx(ma,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:te=>te.preventDefault(),onDismiss:()=>P.onOpenChange(!1),children:g.jsx(ue,{role:"listbox",id:P.contentId,"data-state":P.open?"open":"closed",dir:P.dir,onContextMenu:te=>te.preventDefault(),...x,...pe,onPlaced:()=>L(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:Se(x.onKeyDown,te=>{const ve=te.ctrlKey||te.altKey||te.metaKey;if(te.key==="Tab"&&te.preventDefault(),!ve&&te.key.length===1&&ie(te.key),["ArrowUp","ArrowDown","Home","End"].includes(te.key)){let ae=K().filter(oe=>!oe.disabled).map(oe=>oe.ref.current);if(["ArrowUp","End"].includes(te.key)&&(ae=ae.slice().reverse()),["ArrowUp","ArrowDown"].includes(te.key)){const oe=te.target,Z=ae.indexOf(oe);ae=ae.slice(Z+1)}setTimeout(()=>k(ae)),te.preventDefault()}})})})})})})});Q$.displayName=aee;var lee="SelectItemAlignedPosition",J$=v.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...o}=e,i=No(hi,r),s=Io(hi,r),[l,c]=v.useState(null),[d,f]=v.useState(null),p=Ve(t,A=>f(A)),h=up(r),b=v.useRef(!1),w=v.useRef(!0),{viewport:y,selectedItem:C,selectedItemText:x,focusSelectedItem:P}=s,S=v.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&d&&y&&C&&x){const A=i.trigger.getBoundingClientRect(),M=d.getBoundingClientRect(),U=i.valueNode.getBoundingClientRect(),J=x.getBoundingClientRect();if(i.dir!=="rtl"){const oe=J.left-M.left,Z=U.left-oe,we=A.left-Z,De=A.width+we,Ue=Math.max(De,M.width),wt=window.innerWidth-Xr,mt=OR(Z,[Xr,Math.max(Xr,wt-Ue)]);l.style.minWidth=De+"px",l.style.left=mt+"px"}else{const oe=M.right-J.right,Z=window.innerWidth-U.right-oe,we=window.innerWidth-A.right-Z,De=A.width+we,Ue=Math.max(De,M.width),wt=window.innerWidth-Xr,mt=OR(Z,[Xr,Math.max(Xr,wt-Ue)]);l.style.minWidth=De+"px",l.style.right=mt+"px"}const N=h(),K=window.innerHeight-Xr*2,W=y.scrollHeight,L=window.getComputedStyle(d),G=parseInt(L.borderTopWidth,10),k=parseInt(L.paddingTop,10),F=parseInt(L.borderBottomWidth,10),j=parseInt(L.paddingBottom,10),re=G+k+W+j+F,V=Math.min(C.offsetHeight*5,re),ie=window.getComputedStyle(y),Y=parseInt(ie.paddingTop,10),X=parseInt(ie.paddingBottom,10),ce=A.top+A.height/2-Xr,ue=K-ce,pe=C.offsetHeight/2,te=C.offsetTop+pe,ve=G+k+te,q=re-ve;if(ve<=ce){const oe=N.length>0&&C===N[N.length-1].ref.current;l.style.bottom="0px";const Z=d.clientHeight-y.offsetTop-y.offsetHeight,we=Math.max(ue,pe+(oe?X:0)+Z+F),De=ve+we;l.style.height=De+"px"}else{const oe=N.length>0&&C===N[0].ref.current;l.style.top="0px";const we=Math.max(ce,G+y.offsetTop+(oe?Y:0)+pe)+q;l.style.height=we+"px",y.scrollTop=ve-ce+y.offsetTop}l.style.margin=`${Xr}px 0`,l.style.minHeight=V+"px",l.style.maxHeight=K+"px",n?.(),requestAnimationFrame(()=>b.current=!0)}},[h,i.trigger,i.valueNode,l,d,y,C,x,i.dir,n]);Kt(()=>S(),[S]);const[D,_]=v.useState();Kt(()=>{d&&_(window.getComputedStyle(d).zIndex)},[d]);const T=v.useCallback(A=>{A&&w.current===!0&&(S(),P?.(),w.current=!1)},[S,P]);return g.jsx(cee,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:b,onScrollButtonChange:T,children:g.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:D},children:g.jsx($r.div,{...o,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});J$.displayName=lee;var uee="SelectPopperPosition",gv=v.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=Xr,...i}=e,s=cp(r);return g.jsx(np,{...s,...i,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});gv.displayName=uee;var[cee,Zg]=wa(hi,{}),bv="SelectViewport",eA=v.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...o}=e,i=Io(bv,r),s=Zg(bv,r),l=Ve(t,i.onViewportChange),c=v.useRef(0);return g.jsxs(g.Fragment,{children:[g.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),g.jsx(lp.Slot,{scope:r,children:g.jsx($r.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Se(o.onScroll,d=>{const f=d.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:h}=s;if(h?.current&&p){const b=Math.abs(c.current-f.scrollTop);if(b>0){const w=window.innerHeight-Xr*2,y=parseFloat(p.style.minHeight),C=parseFloat(p.style.height),x=Math.max(y,C);if(x<w){const P=x+b,S=Math.min(w,P),D=P-S;p.style.height=S+"px",p.style.bottom==="0px"&&(f.scrollTop=D>0?D:0,p.style.justifyContent="flex-end")}}}c.current=f.scrollTop})})})]})});eA.displayName=bv;var tA="SelectGroup",[dee,fee]=wa(tA),rA=v.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=_t();return g.jsx(dee,{scope:r,id:o,children:g.jsx($r.div,{role:"group","aria-labelledby":o,...n,ref:t})})});rA.displayName=tA;var nA="SelectLabel",oA=v.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=fee(nA,r);return g.jsx($r.div,{id:o.id,...n,ref:t})});oA.displayName=nA;var _f="SelectItem",[pee,iA]=wa(_f),aA=v.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:o=!1,textValue:i,...s}=e,l=No(_f,r),c=Io(_f,r),d=l.value===n,[f,p]=v.useState(i??""),[h,b]=v.useState(!1),w=Ve(t,P=>c.itemRefCallback?.(P,n,o)),y=_t(),C=v.useRef("touch"),x=()=>{o||(l.onValueChange(n),l.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return g.jsx(pee,{scope:r,value:n,disabled:o,textId:y,isSelected:d,onItemTextChange:v.useCallback(P=>{p(S=>S||(P?.textContent??"").trim())},[]),children:g.jsx(lp.ItemSlot,{scope:r,value:n,disabled:o,textValue:f,children:g.jsx($r.div,{role:"option","aria-labelledby":y,"data-highlighted":h?"":void 0,"aria-selected":d&&h,"data-state":d?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:w,onFocus:Se(s.onFocus,()=>b(!0)),onBlur:Se(s.onBlur,()=>b(!1)),onClick:Se(s.onClick,()=>{C.current!=="mouse"&&x()}),onPointerUp:Se(s.onPointerUp,()=>{C.current==="mouse"&&x()}),onPointerDown:Se(s.onPointerDown,P=>{C.current=P.pointerType}),onPointerMove:Se(s.onPointerMove,P=>{C.current=P.pointerType,o?c.onItemLeave?.():C.current==="mouse"&&P.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Se(s.onPointerLeave,P=>{P.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:Se(s.onKeyDown,P=>{c.searchRef?.current!==""&&P.key===" "||(JJ.includes(P.key)&&x(),P.key===" "&&P.preventDefault())})})})})});aA.displayName=_f;var Nu="SelectItemText",sA=v.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,...i}=e,s=No(Nu,r),l=Io(Nu,r),c=iA(Nu,r),d=nee(Nu,r),[f,p]=v.useState(null),h=Ve(t,x=>p(x),c.onItemTextChange,x=>l.itemTextRefCallback?.(x,c.value,c.disabled)),b=f?.textContent,w=v.useMemo(()=>g.jsx("option",{value:c.value,disabled:c.disabled,children:b},c.value),[c.disabled,c.value,b]),{onNativeOptionAdd:y,onNativeOptionRemove:C}=d;return Kt(()=>(y(w),()=>C(w)),[y,C,w]),g.jsxs(g.Fragment,{children:[g.jsx($r.span,{id:c.textId,...i,ref:h}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren?da.createPortal(i.children,s.valueNode):null]})});sA.displayName=Nu;var lA="SelectItemIndicator",mee=v.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return iA(lA,r).isSelected?g.jsx($r.span,{"aria-hidden":!0,...n,ref:t}):null});mee.displayName=lA;var yv="SelectScrollUpButton",uA=v.forwardRef((e,t)=>{const r=Io(yv,e.__scopeSelect),n=Zg(yv,e.__scopeSelect),[o,i]=v.useState(!1),s=Ve(t,n.onScrollButtonChange);return Kt(()=>{if(r.viewport&&r.isPositioned){let l=function(){const d=c.scrollTop>0;i(d)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?g.jsx(dA,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});uA.displayName=yv;var xv="SelectScrollDownButton",cA=v.forwardRef((e,t)=>{const r=Io(xv,e.__scopeSelect),n=Zg(xv,e.__scopeSelect),[o,i]=v.useState(!1),s=Ve(t,n.onScrollButtonChange);return Kt(()=>{if(r.viewport&&r.isPositioned){let l=function(){const d=c.scrollHeight-c.clientHeight,f=Math.ceil(c.scrollTop)<d;i(f)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?g.jsx(dA,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});cA.displayName=xv;var dA=v.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...o}=e,i=Io("SelectScrollButton",r),s=v.useRef(null),l=up(r),c=v.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return v.useEffect(()=>()=>c(),[c]),Kt(()=>{l().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),g.jsx($r.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:Se(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(n,50))}),onPointerMove:Se(o.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(n,50))}),onPointerLeave:Se(o.onPointerLeave,()=>{c()})})}),hee="SelectSeparator",fA=v.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return g.jsx($r.div,{"aria-hidden":!0,...n,ref:t})});fA.displayName=hee;var wv="SelectArrow",vee=v.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=cp(r),i=No(wv,r),s=Io(wv,r);return i.open&&s.position==="popper"?g.jsx(op,{...o,...n,ref:t}):null});vee.displayName=wv;var gee="SelectBubbleInput",pA=v.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const o=v.useRef(null),i=Ve(n,o),s=BJ(t);return v.useEffect(()=>{const l=o.current;if(!l)return;const c=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(c,"value").set;if(s!==t&&f){const p=new Event("change",{bubbles:!0});f.call(l,t),l.dispatchEvent(p)}},[s,t]),g.jsx($r.select,{...r,style:{...B$,...r.style},ref:i,defaultValue:t})});pA.displayName=gee;function mA(e){return e===""||e===void 0}function hA(e){const t=Xt(e),r=v.useRef(""),n=v.useRef(0),o=v.useCallback(s=>{const l=r.current+s;t(l),(function c(d){r.current=d,window.clearTimeout(n.current),d!==""&&(n.current=window.setTimeout(()=>c(""),1e3))})(l)},[t]),i=v.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,i]}function vA(e,t,r){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let s=bee(e,Math.max(i,0));o.length===1&&(s=s.filter(d=>d!==r));const c=s.find(d=>d.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==r?c:void 0}function bee(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var yee=K$,xee=H$,wee=z$,Eee=G$,Cee=Y$,Ree=X$,Pee=eA,See=rA,_ee=oA,Tee=aA,$ee=sA,Aee=uA,Dee=cA,Mee=fA;const gA=e=>g.jsx(yee,{"data-slot":"select",...e}),bA=({heading:e,children:t,...r})=>g.jsxs(See,{"data-slot":"select-group",...r,children:[e&&g.jsx(RA,{children:e}),t]}),yA=e=>g.jsx(wee,{"data-slot":"select-value",...e}),xA=({className:e,children:t,...r})=>g.jsxs(xee,{"data-slot":"select-trigger",className:le("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,g.jsx(Eee,{asChild:!0,"data-slot":"select-trigger-icon",children:g.jsx(af,{className:"h-4 w-4 shrink-0 opacity-50"})})]}),wA=({className:e,...t})=>g.jsx(Aee,{"data-slot":"select-scroll-up",className:le("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(EP,{className:"h-4 w-4"})}),EA=({className:e,...t})=>g.jsx(Dee,{"data-slot":"select-scroll-down",className:le("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(wP,{className:"h-4 w-4"})}),CA=({className:e,children:t,position:r="popper",...n})=>g.jsx(Cee,{children:g.jsxs(Ree,{"data-slot":"select-content",className:le("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md open:animate-in closed:animate-out closed:fade-out-0 open:fade-in-0 closed:zoom-out-95 open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[g.jsx(wA,{}),g.jsx(Pee,{"data-slot":"select-viewport",className:le("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),g.jsx(EA,{})]})}),RA=({className:e,...t})=>g.jsx(_ee,{"data-slot":"select-label",className:le("py-1.5 px-2 text-sm font-semibold",e),...t}),PA=({className:e,children:t,...r})=>g.jsx(Tee,{"data-slot":"select-item",className:le("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 px-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:g.jsx($ee,{"data-slot":"select-item-text",children:t})}),Oee=({className:e,...t})=>g.jsx(Mee,{"data-slot":"select-separator",className:le("-mx-1 my-1 h-px bg-muted",e),...t}),Nee=({isCircle:e,width:t,height:r,isLoading:n=!1,...o})=>{const i={width:t,height:r,...o.style};return!n&&o.children?o.children:g.jsx("div",{"data-slot":"skeleton",...o,className:le("[&>*]:opacity-0 w-fit","rounded w-full animate-pulse bg-muted min-h-[1.5em]",e&&"rounded-[50%] aspect-square",o.className),style:i})},Iee=({inline:e=!1,justify:t,align:r,direction:n="horizontal",gap:o=8,style:i,...s})=>{const l={display:e?"inline-flex":"flex",flexDirection:n==="vertical"?"column":"row",justifyContent:t,alignItems:r,gap:o};return g.jsx("div",{style:{...l,...i},...s,"data-slot":"stack"})},[SA,kee]=cc();function Lee({items:e=[],current:t,onChange:r,className:n,classNameList:o,classNameItem:i,classNameButton:s,classNameIndicator:l,classNameContent:c}){return g.jsxs(_A,{className:n,current:t,onChange:r,children:[g.jsx(TA,{className:o,children:e?.map((d,f)=>g.jsx($A,{value:f,title:d?.title,indicator:d?.indicator,classNameItem:i,classNameButton:s,classNameIndicator:l},f))}),e?.map((d,f)=>g.jsx(AA,{className:c,value:f,children:d?.content},f))]})}function _A({current:e,onChange:t,className:r,...n}){const[o=0,i]=ut({prop:e,onChange:t,defaultProp:0});return g.jsx(kee,{value:{activeStep:o,setActiveStep:i},children:g.jsx("div",{"data-slot":"stepper",className:le("flex flex-col items-center w-full transition-all ease-in delay-150",r),...n})})}function TA({children:e,className:t,...r}){return g.jsx("ul",{"data-slot":"stepper-list",className:le("flex flex-col sm:flex-row sm:gap-0 gap-4 items-center w-full text-xs font-medium text-gray-900 sm:text-base mb-8",t),...r,children:e})}function $A({disabled:e,value:t,title:r,indicator:n,classNameItem:o,classNameButton:i,classNameIndicator:s}){const{activeStep:l,setActiveStep:c}=SA();return g.jsx("li",{"data-slot":"stepper-trigger",className:le("flex relative text-primary transition-all ease-in delay-150","last:w-full last:sm:w-auto last:after:hidden",`w-full after:content-[''] sm:after:w-full after:h-full after:w-0.5 sm:after:h-0.5 ${l>t?"after:bg-primary":"after:bg-gray-300"} after:inline-block after:absolute after:top-5 sm:after:top-5 after:left-4 sm:after:left-10`,o),children:g.jsxs("button",{onClick:()=>!e&&c(t),className:le("z-10 flex items-center justify-center sm:flex-col gap-3 flex-row whitespace-nowrap cursor-pointer group transition-color ease-in delay-150",l>=t?"text-primary":"text-gray-500",e&&"cursor-not-allowed",i),children:[g.jsx("span",{"data-slot":"stepper-trigger-indicator",className:le("flex items-center transition-all overflow-hidden ease-in justify-center group-hover:scale-105 sm:w-10 sm:h-10 mx-auto text-sm border-2 rounded-full w-8 h-8",l>t&&"bg-primary border-primary text-primary-foreground",l===t&&"bg-gray-100 text-primary border-primary",l<t&&"bg-white text-gray-500 border-input",e&&"text-gray-300",s),children:l>t?"✓":n||t+1}),r]})})}function AA({value:e,className:t="w-full",...r}){const{activeStep:n}=SA();return n===e?g.jsx("div",{"data-slot":"stepper-content",className:t,...r}):null}const Fee=({className:e,children:t,containerProps:r,containerClassName:n,...o})=>{const i=R.useId(),[s=!1,l]=ut({prop:o.checked,onChange:o.onChange,defaultProp:o.defaultChecked}),c=()=>!o.disabled&&l(p=>!p),d=s?"checked":"unchecked",f=o.id??i;return g.jsxs("div",{"data-slot":"switch",...r,className:le("flex gap-x-2 items-center",n),children:[g.jsxs("button",{"data-slot":"switch-trigger",disabled:o.disabled,onClick:c,"data-state":d,type:"button",className:le("peer w-11 h-6 bg-input rounded-full border-2 border-transparent transition-colors","data-[state=checked]:bg-primary",e),children:[g.jsx("div",{"data-state":d,className:le("w-5 h-5 pointers-event-none bg-primary-foreground rounded-full transition-all","transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")}),g.jsx("input",{...o,id:f,checked:s,onChange:p=>l(p.currentTarget.checked),type:"checkbox",className:"sr-only","aria-hidden":!0})]}),t&&g.jsx(pc,{htmlFor:f,children:t})]})},DA=({className:e,containerClassName:t,containerProps:r,...n})=>g.jsx("div",{"data-slot":"table-container",className:le("relative w-full overflow-auto rounded-md border",t),...r,children:g.jsx("table",{"data-slot":"table",className:le("w-full caption-bottom text-sm",e),...n})}),MA=({className:e,...t})=>g.jsx("thead",{"data-slot":"table-header",className:le("[&_tr]:border-b",e),...t}),OA=({className:e,...t})=>g.jsx("tbody",{"data-slot":"table-body",className:le("[&_tr:last-child]:border-0",e),...t}),qee=({className:e,...t})=>g.jsx("tfoot",{"data-slot":"table-footer",className:le("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}),Ev=({className:e,...t})=>g.jsx("tr",{"data-slot":"table-row",className:le("border-b transition-colors hover:bg-muted data-[selected=true]:bg-muted",e),...t}),NA=({className:e,...t})=>g.jsx("th",{"data-slot":"table-head",className:le("h-12 px-4 text-left align-middle font-medium text-muted-foreground sticky top-0 bg-background [&:has([role=checkbox])]:pr-0",e),...t}),IA=({className:e,...t})=>g.jsx("td",{"data-slot":"table-cell",className:le("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}),jee=({className:e,...t})=>g.jsx("caption",{"data-slot":"table-caption",className:le("mt-4 text-sm text-muted-foreground",e),...t}),Bee=({data:e=[],columns:t=[],onRowClick:r,onDoubleClick:n,selected:o,theadClassName:i,theadProps:s,tbodyClassName:l,tbodyProps:c,trClassName:d,trProps:f,thClassName:p,thProps:h,tdClassName:b,tdProps:w,...y})=>g.jsxs(DA,{...y,className:le(y?.className),children:[g.jsx(MA,{...s,className:le(s?.className,i),children:g.jsx(Ev,{...f,className:le(f?.className,d),children:t.map((C,x)=>g.jsx(NA,{...h,className:le(h?.className,p),style:{width:C.width},children:lt.isFunction(C.header)?C.header?.():C.header},x))})}),g.jsx(OA,{...c,className:le(c?.className,l),children:e.map((C,x)=>g.jsx(Ev,{...f,"data-selected":o?.(C),className:le(f?.className,d),children:t.map((P,S)=>g.jsx(IA,{...w,onClick:D=>{w?.onClick?.(D),r?.(C)},onDoubleClick:()=>n?.(C),className:le(w?.className,b),children:P.cell?.(C,S)||C[P.key]},S))},x))})]}),Jd=[10,25,50],Vee=({containerClassName:e,containerProps:t,selectClassName:r,selectProps:n,sizes:o=Jd,...i})=>{const[s=Jd[0],l]=ut({onChange:i?.setPageSize,prop:i?.pageSize,defaultProp:Jd[0]}),{range:c,next:d,prev:f,isFirstPage:p,isLastPage:h,goTo:b}=Ag({...i,pageSize:s}),w=y=>{const{value:C}=y.target,x=Number(C);l(x),b(1)};return g.jsxs("div",{"data-slot":"table-pagination",...t,className:le("flex justify-center items-center gap-x-4 bg-background border border-[#D9D9D9] rounded-2xl py-2",e),children:[o&&g.jsx("select",{"data-slot":"table-pagination-size-trigger",...n,value:s,onChange:w,className:le("border border-input rounded-md w-fit min-w-[3rem] bg-background p-2 ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",r),children:o.map((y,C)=>g.jsx("option",{value:y,"data-slot":"table-pagination-size-option",children:y},C))}),g.jsxs("span",{"data-slot":"table-pagination-range",children:[c.start," - ",c.end," de ",i.totalItems]}),g.jsxs("div",{className:"flex gap-2",children:[g.jsx(tr,{"data-slot":"table-pagination-prev",size:"icon",variant:"ghost",disabled:p,onClick:f,children:g.jsx(zv,{"data-slot":"table-pagination-prev-icon"})}),g.jsx(tr,{"data-slot":"table-pagination-next",size:"icon",variant:"ghost",disabled:h,onClick:d,children:g.jsx(ic,{"data-slot":"table-pagination-next-icon"})})]})]})},[dp,Kee]=cc(),Wee=({children:e,value:t,onChange:r,defaultValue:n,variant:o="default",...i})=>{const[s="",l]=ut({prop:t,onChange:r,defaultProp:n}),[c,d]=R.useState(null);return g.jsx(Kee,{value:{activeTab:s,setActiveTab:l,setTargetRef:d,targetRef:c,variant:o},children:g.jsx("div",{"data-slot":"tabs",...i,children:e})})},Hee=({children:e,className:t,indicatorClassName:r})=>{const{targetRef:n}=dp();return g.jsxs("div",{"data-slot":"tabs-list",className:le("relative mb-4",t),children:[g.jsx("div",{"data-slot":"tabs-content",className:"flex",children:e}),g.jsx(Gee,{targetRef:n,indicatorClassName:r})]})},Uee=({value:e,className:t,...r})=>{const{activeTab:n,setActiveTab:o,setTargetRef:i,variant:s}=dp(),l=n===e;return g.jsx("button",{"data-slot":"tabs-trigger",...r,type:"button",ref:c=>{l&&i(c)},onClick:()=>o(e),"data-tab":e,"data-selected":l,"aria-selected":l,className:le("px-2 py-2 cursor-pointer w-full min-w-[100px] text-center rounded-t font-semibold select-none",s==="background"?"hover:bg-transparent aria-selected:text-primary-foreground rounded":"hover:bg-accent hover:text-accent-foreground",t)})},zee=({value:e,...t})=>{const{activeTab:r}=dp();return r===e?g.jsx("div",{"data-slot":"tabs-content",...t}):null},Gee=({targetRef:e,indicatorClassName:t})=>{const r=R.useRef(null),n=r?.current,o=R.useRef(null),{variant:i}=dp(),s=()=>{if(!e||!n)return;const l=e.offsetLeft,c=e.offsetWidth;n.style.width=c+"px",n.style.left=l+"px"};return R.useEffect(()=>{if(e)return s(),o.current=new ResizeObserver(s),o.current.observe(e),()=>{o.current?.disconnect()}},[e]),g.jsx("div",{"data-slot":"tabs-indicator",ref:r,className:le("transition-all duration-300 absolute rounded bg-primary",i==="background"?"inset-0 -z-10 h-full top-0":"top-full h-[3px]",t)})},Yee=({className:e,...t})=>g.jsx("textarea",{...t,onChange:r=>t.onChange?.(r.target.value),"data-slot":"textarea",className:le("min-h-[60px] w-full rounded-md px-3 py-2 text-sm placeholder:text-muted-foreground","border border-input bg-background","ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e)}),Xee={done:"var(--color-primary)",pending:"#cdcdcd",error:"var(--color-error)"},Zee=({items:e,classNameContainer:t,containerProps:r,...n})=>g.jsx(kA,{className:t,...r,children:e.map((o,i)=>g.jsx(LA,{icon:o.icon,color:o.color,status:o.status,...n,children:o.content},i))}),kA=e=>g.jsx("ul",{"data-slot":"timeline",...e,className:le("relative flex justify-center flex-col border-input",e.className)}),LA=({icon:e,status:t,color:r,classNameItemDot:n,classNameItemContainerDot:o,classNameItemContent:i,itemsProps:s,children:l,...c})=>g.jsxs("li",{"data-slot":"timeline-item",className:le("rounded-lg w-full px-2 gap-1 grid hover:bg-muted transition-colors ease-in grid-cols-[minmax(auto,20px)_1fr]",c.className),...c,children:[g.jsx(FA,{icon:e,status:t,color:r,classNameDot:n,classNameContainerDot:o}),g.jsx(qA,{className:i,...s,children:l})]}),FA=({icon:e,status:t="pending",color:r,classNameDot:n,classNameContainerDot:o})=>g.jsx("div",{"data-slot":"timeline-item-dot",className:le("relative pb-6 last:after:hidden after:absolute after:top-0 after:bottom-0 after:left-1/2 after:w-px after:-translate-x-1/2 after:bg-gray-200",o),children:g.jsx("div",{"data-slot":"timeline-item-dot-icon",className:le("relative z-10 flex text-white items-center justify-center rounded-full left-1/2 -translate-x-1/2",e?"aspect-square p-1.5 min-h-7 min-w-7 top-2":"size-2 top-4",n),style:{backgroundColor:r||Xee?.[t]},children:e})}),qA=e=>g.jsx("div",{"data-slot":"timeline-item-content",...e,className:le("grow px-2 pb-4 pt-2",e.className)}),Qee=eo(["flex justify-between items-center transition-all","text-primary-foreground","pointer-events-auto relative w-full rounded-xl p-3 shadow-lg"],{variants:{variant:{info:"bg-primary text-primary-foreground",error:"bg-error text-error-foreground",success:"bg-success text-success-foreground",loading:"bg-background text-foreground"}},defaultVariants:{variant:"info"}}),Jee=eo("",{variants:{variant:{info:"text-primary-foreground",error:"text-error-foreground",success:"text-success-foreground",loading:"text-foreground animate-spin"}},defaultVariants:{variant:"info"}}),jA=({title:e,description:t,type:r,iconClassName:n,...o})=>{const i=VA[r];return g.jsxs("div",{...o,"data-slot":"toast",className:le(Qee({variant:r}),o.className),children:[g.jsx("div",{className:le("p-1 text-primary-foreground pr-2",n),children:g.jsx(i,{size:22,className:le(Jee({variant:r})),"data-slot":"toast-icon"})}),g.jsxs("div",{className:"grid gap-1 grow","data-slot":"toast-content",children:[e&&g.jsx("h4",{...o.titleProps,className:le("text-sm font-semibold",o.titleClassName),"data-slot":"toast-title",children:e}),g.jsx("div",{...o.descriptionProps,className:le("text-sm font-normal opacity-90 p-0 overflow-hidden",o.descriptionClassName),"data-slot":"toast-description",children:t})]})]})},NR=e=>{let t;const r=new Set,n=(d,f)=>{const p=typeof d=="function"?d(t):d;if(!Object.is(p,t)){const h=t;t=f??(typeof p!="object"||p===null)?p:Object.assign({},t,p),r.forEach(b=>b(t,h))}},o=()=>t,l={setState:n,getState:o,getInitialState:()=>c,subscribe:d=>(r.add(d),()=>r.delete(d))},c=t=e(n,o,l);return l},ete=(e=>e?NR(e):NR),tte=e=>e;function rte(e,t=tte){const r=R.useSyncExternalStore(e.subscribe,R.useCallback(()=>t(e.getState()),[e,t]),R.useCallback(()=>t(e.getInitialState()),[e,t]));return R.useDebugValue(r),r}const IR=e=>{const t=ete(e),r=n=>rte(t,n);return Object.assign(r,t),r},nte=(e=>e?IR(e):IR);let ote=0;const BA=3e3,kR=(e,t,r=BA)=>{setTimeout(()=>e(t),r)},Qg=nte((e,t)=>({toasts:[],addToast:r=>{const n=++ote,o={...r,id:n};return e(i=>({toasts:[...i.toasts,o]})),r.type!=="loading"&&kR(t().removeToast,n,r?.duration||BA),n},removeToast:r=>{e(n=>({toasts:n.toasts.filter(o=>o.id!==r)}))},updateToast:(r,n)=>{e(o=>({toasts:o.toasts.map(i=>i.id===r?{...i,...n}:i)})),n.type!=="loading"&&kR(t().removeToast,r)},promise:async(r,n)=>{const o=t().addToast({type:"loading",description:n.loading});try{const i=await r;return t().updateToast(o,{type:"success",description:typeof n.success=="function"?n.success(i):n.success}),i}catch(i){const s=typeof n.error=="function"?n.error(i):n.error;return t().updateToast(o,{type:"error",description:s}),Promise.reject(i)}}})),ite=({iconClassName:e="",...t})=>{const r=Qg(n=>n.toasts);return g.jsxs(g.Fragment,{children:[t.children,g.jsx(ng,{className:"empty:hidden fixed z-100 pr-2 pb-2 bottom-0 right-0 space-y-2 max-w-[300px] w-full",children:r.map(n=>{const o=R.createRef();return g.jsx(Kf,{classNames:"toast",timeout:500,nodeRef:o,children:g.jsx(jA,{...n,iconClassName:e,ref:o})},n.id)})})]})},Jg=Qg.getState(),ate=e=>Jg.addToast(e),Eh=(e,t)=>{const n=typeof e=="string"?{description:e,type:t}:{...e,type:t};return Jg.addToast(n)},ste=Object.assign(ate,{info:e=>Eh(e,"info"),success:e=>Eh(e,"success"),error:e=>Eh(e,"error"),promise:(e,t)=>Jg.promise(e,t)}),VA={info:Zj,success:Jj,error:t5,loading:sf};function lte(e){const t=ute(e),r=v.forwardRef((n,o)=>{const{children:i,...s}=n,l=v.Children.toArray(i),c=l.find(dte);if(c){const d=c.props.children,f=l.map(p=>p===c?v.Children.count(d)>1?v.Children.only(null):v.isValidElement(d)?d.props.children:null:p);return g.jsx(t,{...s,ref:o,children:v.isValidElement(d)?v.cloneElement(d,void 0,f):null})}return g.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}function ute(e){const t=v.forwardRef((r,n)=>{const{children:o,...i}=r;if(v.isValidElement(o)){const s=pte(o),l=fte(i,o.props);return o.type!==v.Fragment&&(l.ref=n?gt(n,s):s),v.cloneElement(o,l)}return v.Children.count(o)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var KA=Symbol("radix.slottable");function cte(e){const t=({children:r})=>g.jsx(g.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=KA,t}function dte(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===KA}function fte(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function pte(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var mte=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],hte=mte.reduce((e,t)=>{const r=lte(`Primitive.${t}`),n=v.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),[fp]=wn("Tooltip",[Do]),pp=Do(),WA="TooltipProvider",vte=700,Cv="tooltip.open",[gte,eb]=fp(WA),HA=e=>{const{__scopeTooltip:t,delayDuration:r=vte,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:i}=e,s=v.useRef(!0),l=v.useRef(!1),c=v.useRef(0);return v.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),g.jsx(gte,{scope:t,isOpenDelayedRef:s,delayDuration:r,onOpen:v.useCallback(()=>{window.clearTimeout(c.current),s.current=!1},[]),onClose:v.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.current=!0,n)},[n]),isPointerInTransitRef:l,onPointerInTransitChange:v.useCallback(d=>{l.current=d},[]),disableHoverableContent:o,children:i})};HA.displayName=WA;var Qu="Tooltip",[bte,$c]=fp(Qu),UA=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:o,onOpenChange:i,disableHoverableContent:s,delayDuration:l}=e,c=eb(Qu,e.__scopeTooltip),d=pp(t),[f,p]=v.useState(null),h=_t(),b=v.useRef(0),w=s??c.disableHoverableContent,y=l??c.delayDuration,C=v.useRef(!1),[x,P]=ut({prop:n,defaultProp:o??!1,onChange:A=>{A?(c.onOpen(),document.dispatchEvent(new CustomEvent(Cv))):c.onClose(),i?.(A)},caller:Qu}),S=v.useMemo(()=>x?C.current?"delayed-open":"instant-open":"closed",[x]),D=v.useCallback(()=>{window.clearTimeout(b.current),b.current=0,C.current=!1,P(!0)},[P]),_=v.useCallback(()=>{window.clearTimeout(b.current),b.current=0,P(!1)},[P]),T=v.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{C.current=!0,P(!0),b.current=0},y)},[y,P]);return v.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]),g.jsx(bc,{...d,children:g.jsx(bte,{scope:t,contentId:h,open:x,stateAttribute:S,trigger:f,onTriggerChange:p,onTriggerEnter:v.useCallback(()=>{c.isOpenDelayedRef.current?T():D()},[c.isOpenDelayedRef,T,D]),onTriggerLeave:v.useCallback(()=>{w?_():(window.clearTimeout(b.current),b.current=0)},[_,w]),onOpen:D,onClose:_,disableHoverableContent:w,children:r})})};UA.displayName=Qu;var Rv="TooltipTrigger",zA=v.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=$c(Rv,r),i=eb(Rv,r),s=pp(r),l=v.useRef(null),c=Ve(t,l,o.onTriggerChange),d=v.useRef(!1),f=v.useRef(!1),p=v.useCallback(()=>d.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),g.jsx(yc,{asChild:!0,...s,children:g.jsx(hte.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...n,ref:c,onPointerMove:Se(e.onPointerMove,h=>{h.pointerType!=="touch"&&!f.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:Se(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:Se(e.onPointerDown,()=>{o.open&&o.onClose(),d.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:Se(e.onFocus,()=>{d.current||o.onOpen()}),onBlur:Se(e.onBlur,o.onClose),onClick:Se(e.onClick,o.onClose)})})});zA.displayName=Rv;var tb="TooltipPortal",[yte,xte]=fp(tb,{forceMount:void 0}),GA=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:o}=e,i=$c(tb,t);return g.jsx(yte,{scope:t,forceMount:r,children:g.jsx(Tr,{present:r||i.open,children:g.jsx(ha,{asChild:!0,container:o,children:n})})})};GA.displayName=tb;var ca="TooltipContent",YA=v.forwardRef((e,t)=>{const r=xte(ca,e.__scopeTooltip),{forceMount:n=r.forceMount,side:o="top",...i}=e,s=$c(ca,e.__scopeTooltip);return g.jsx(Tr,{present:n||s.open,children:s.disableHoverableContent?g.jsx(XA,{side:o,...i,ref:t}):g.jsx(wte,{side:o,...i,ref:t})})}),wte=v.forwardRef((e,t)=>{const r=$c(ca,e.__scopeTooltip),n=eb(ca,e.__scopeTooltip),o=v.useRef(null),i=Ve(t,o),[s,l]=v.useState(null),{trigger:c,onClose:d}=r,f=o.current,{onPointerInTransitChange:p}=n,h=v.useCallback(()=>{l(null),p(!1)},[p]),b=v.useCallback((w,y)=>{const C=w.currentTarget,x={x:w.clientX,y:w.clientY},P=Pte(x,C.getBoundingClientRect()),S=Ste(x,P),D=_te(y.getBoundingClientRect()),_=$te([...S,...D]);l(_),p(!0)},[p]);return v.useEffect(()=>()=>h(),[h]),v.useEffect(()=>{if(c&&f){const w=C=>b(C,f),y=C=>b(C,c);return c.addEventListener("pointerleave",w),f.addEventListener("pointerleave",y),()=>{c.removeEventListener("pointerleave",w),f.removeEventListener("pointerleave",y)}}},[c,f,b,h]),v.useEffect(()=>{if(s){const w=y=>{const C=y.target,x={x:y.clientX,y:y.clientY},P=c?.contains(C)||f?.contains(C),S=!Tte(x,s);P?h():S&&(h(),d())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[c,f,s,d,h]),g.jsx(XA,{...e,ref:i})}),[Ete,Cte]=fp(Qu,{isInside:!1}),Rte=cte("TooltipContent"),XA=v.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...l}=e,c=$c(ca,r),d=pp(r),{onClose:f}=c;return v.useEffect(()=>(document.addEventListener(Cv,f),()=>document.removeEventListener(Cv,f)),[f]),v.useEffect(()=>{if(c.trigger){const p=h=>{h.target?.contains(c.trigger)&&f()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[c.trigger,f]),g.jsx(ma,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:p=>p.preventDefault(),onDismiss:f,children:g.jsxs(np,{"data-state":c.stateAttribute,...d,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[g.jsx(Rte,{children:n}),g.jsx(Ete,{scope:r,isInside:!0,children:g.jsx(ZJ,{id:c.contentId,role:"tooltip",children:o||n})})]})})});YA.displayName=ca;var ZA="TooltipArrow",QA=v.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=pp(r);return Cte(ZA,r).isInside?null:g.jsx(op,{...o,...n,ref:t})});QA.displayName=ZA;function Pte(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(r,n,o,i)){case i:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function Ste(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function _te(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}function Tte(e,t){const{x:r,y:n}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const l=t[i],c=t[s],d=l.x,f=l.y,p=c.x,h=c.y;f>n!=h>n&&r<(p-d)*(n-f)/(h-f)+d&&(o=!o)}return o}function $te(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),Ate(t)}function Ate(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const o=e[n];for(;r.length>=2;){const i=r[r.length-1],s=r[r.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))r.pop();else break}r.push(o)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var Dte=HA,Mte=UA,Ote=zA,Nte=GA,Ite=YA,kte=QA;const JA=({delayDuration:e=0,...t})=>g.jsx(Dte,{"data-slot":"tooltip-provider",delayDuration:e,...t}),eD=({...e})=>g.jsx(JA,{children:g.jsx(Mte,{"data-slot":"tooltip",...e})}),tD=({...e})=>g.jsx(Ote,{"data-slot":"tooltip-trigger",...e}),rD=({className:e,sideOffset:t=0,children:r,arrowClassName:n,...o})=>g.jsx(Nte,{children:g.jsxs(Ite,{"data-slot":"tooltip-content",sideOffset:t,className:le("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...o,children:[r,g.jsx(kte,{className:le("bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]",n)})]})}),Lte=({label:e,open:t,defaultOpen:r,onOpenChange:n,...o})=>{const{className:i,...s}=ac("Tooltip",o,{side:"top"});return g.jsxs(eD,{open:t,defaultOpen:r,onOpenChange:n,children:[g.jsx(tD,{asChild:!0,"data-slot":"tooltip-trigger",children:g.jsx(sc,{...s})}),g.jsx(rD,{"data-slot":"tooltip-content",side:s.side,sideOffset:s.offset,className:i,arrowClassName:s.arrowClassName,children:e})]})},Fte=R.createContext(null);R.createContext(null);R.createContext(null);R.createContext(null);R.createContext(null);R.createContext({});R.createContext(null);R.createContext(null);const Ot=typeof document<"u"?R.useLayoutEffect:()=>{};var Ch;const qte=(Ch=R.useInsertionEffect)!==null&&Ch!==void 0?Ch:Ot;function ur(e){const t=R.useRef(null);return qte(()=>{t.current=e},[e]),R.useCallback((...r)=>{const n=t.current;return n?.(...r)},[])}function jte(e){let[t,r]=R.useState(e),n=R.useRef(null),o=ur(()=>{if(!n.current)return;let s=n.current.next();if(s.done){n.current=null;return}t===s.value?o():r(s.value)});Ot(()=>{n.current&&o()});let i=ur(s=>{n.current=s(t),o()});return[t,i]}const Tf={prefix:String(Math.round(Math.random()*1e10)),current:0},nD=R.createContext(Tf),Bte=R.createContext(!1);let Vte=!!(typeof window<"u"&&window.document&&window.document.createElement),Rh=new WeakMap;function Kte(e=!1){let t=R.useContext(nD),r=R.useRef(null);if(r.current===null&&!e){var n,o;let i=(o=R.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)===null||o===void 0||(n=o.ReactCurrentOwner)===null||n===void 0?void 0:n.current;if(i){let s=Rh.get(i);s==null?Rh.set(i,{id:t.current,state:i.memoizedState}):i.memoizedState!==s.state&&(t.current=s.id,Rh.delete(i))}r.current=++t.current}return r.current}function Wte(e){let t=R.useContext(nD);t===Tf&&!Vte&&process.env.NODE_ENV!=="production"&&console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");let r=Kte(!!e),n=t===Tf&&process.env.NODE_ENV==="test"?"react-aria":`react-aria${t.prefix}`;return e||`${n}-${r}`}function Hte(e){let t=R.useId(),[r]=R.useState(Ac()),n=r||process.env.NODE_ENV==="test"?"react-aria":`react-aria${Tf.prefix}`;return e||`${n}-${t}`}const Ute=typeof R.useId=="function"?Hte:Wte;function zte(){return!1}function Gte(){return!0}function Yte(e){return()=>{}}function Ac(){return typeof R.useSyncExternalStore=="function"?R.useSyncExternalStore(Yte,zte,Gte):R.useContext(Bte)}let Xte=!!(typeof window<"u"&&window.document&&window.document.createElement),ia=new Map,Iu;typeof FinalizationRegistry<"u"&&(Iu=new FinalizationRegistry(e=>{ia.delete(e)}));function Qn(e){let[t,r]=R.useState(e),n=R.useRef(null),o=Ute(t),i=R.useRef(null);if(Iu&&Iu.register(i,o),Xte){const s=ia.get(o);s&&!s.includes(n)?s.push(n):ia.set(o,[n])}return Ot(()=>{let s=o;return()=>{Iu&&Iu.unregister(i),ia.delete(s)}},[o]),R.useEffect(()=>{let s=n.current;return s&&r(s),()=>{s&&(n.current=null)}}),o}function Zte(e,t){if(e===t)return e;let r=ia.get(e);if(r)return r.forEach(o=>o.current=t),t;let n=ia.get(t);return n?(n.forEach(o=>o.current=e),e):t}function Qte(e=[]){let t=Qn(),[r,n]=jte(t),o=R.useCallback(()=>{n(function*(){yield t,yield document.getElementById(t)?t:void 0})},[t,n]);return Ot(o,[t,o,...e]),r}function mp(...e){return(...t)=>{for(let r of e)typeof r=="function"&&r(...t)}}const rt=e=>{var t;return(t=e?.ownerDocument)!==null&&t!==void 0?t:document},Br=e=>e&&"window"in e&&e.window===e?e:rt(e).defaultView||window;function Jte(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function ere(e){return Jte(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let tre=!1;function hp(){return tre}function yt(e,t){if(!hp())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let r=t;for(;r!==null;){if(r===e)return!0;r.tagName==="SLOT"&&r.assignedSlot?r=r.assignedSlot.parentNode:ere(r)?r=r.host:r=r.parentNode}return!1}const er=(e=document)=>{var t;if(!hp())return e.activeElement;let r=e.activeElement;for(;r&&"shadowRoot"in r&&(!((t=r.shadowRoot)===null||t===void 0)&&t.activeElement);)r=r.shadowRoot.activeElement;return r};function Ze(e){return hp()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}class rre{get currentNode(){return this._currentNode}set currentNode(t){if(!yt(this.root,t))throw new Error("Cannot set currentNode to a node that is not contained by the root node.");const r=[];let n=t,o=t;for(this._currentNode=t;n&&n!==this.root;)if(n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const s=n,l=this._doc.createTreeWalker(s,this.whatToShow,{acceptNode:this._acceptNode});r.push(l),l.currentNode=o,this._currentSetFor.add(l),n=o=s.host}else n=n.parentNode;const i=this._doc.createTreeWalker(this.root,this.whatToShow,{acceptNode:this._acceptNode});r.push(i),i.currentNode=o,this._currentSetFor.add(i),this._walkerStack=r}get doc(){return this._doc}firstChild(){let t=this.currentNode,r=this.nextNode();return yt(t,r)?(r&&(this.currentNode=r),r):(this.currentNode=t,null)}lastChild(){let r=this._walkerStack[0].lastChild();return r&&(this.currentNode=r),r}nextNode(){const t=this._walkerStack[0].nextNode();if(t){if(t.shadowRoot){var r;let o;if(typeof this.filter=="function"?o=this.filter(t):!((r=this.filter)===null||r===void 0)&&r.acceptNode&&(o=this.filter.acceptNode(t)),o===NodeFilter.FILTER_ACCEPT)return this.currentNode=t,t;let i=this.nextNode();return i&&(this.currentNode=i),i}return t&&(this.currentNode=t),t}else if(this._walkerStack.length>1){this._walkerStack.shift();let n=this.nextNode();return n&&(this.currentNode=n),n}else return null}previousNode(){const t=this._walkerStack[0];if(t.currentNode===t.root){if(this._currentSetFor.has(t))if(this._currentSetFor.delete(t),this._walkerStack.length>1){this._walkerStack.shift();let o=this.previousNode();return o&&(this.currentNode=o),o}else return null;return null}const r=t.previousNode();if(r){if(r.shadowRoot){var n;let i;if(typeof this.filter=="function"?i=this.filter(r):!((n=this.filter)===null||n===void 0)&&n.acceptNode&&(i=this.filter.acceptNode(r)),i===NodeFilter.FILTER_ACCEPT)return r&&(this.currentNode=r),r;let s=this.lastChild();return s&&(this.currentNode=s),s}return r&&(this.currentNode=r),r}else if(this._walkerStack.length>1){this._walkerStack.shift();let o=this.previousNode();return o&&(this.currentNode=o),o}else return null}nextSibling(){return null}previousSibling(){return null}parentNode(){return null}constructor(t,r,n,o){this._walkerStack=[],this._currentSetFor=new Set,this._acceptNode=s=>{if(s.nodeType===Node.ELEMENT_NODE){const c=s.shadowRoot;if(c){const d=this._doc.createTreeWalker(c,this.whatToShow,{acceptNode:this._acceptNode});return this._walkerStack.unshift(d),NodeFilter.FILTER_ACCEPT}else{var l;if(typeof this.filter=="function")return this.filter(s);if(!((l=this.filter)===null||l===void 0)&&l.acceptNode)return this.filter.acceptNode(s);if(this.filter===null)return NodeFilter.FILTER_ACCEPT}}return NodeFilter.FILTER_SKIP},this._doc=t,this.root=r,this.filter=o??null,this.whatToShow=n??NodeFilter.SHOW_ALL,this._currentNode=r,this._walkerStack.unshift(t.createTreeWalker(r,n,this._acceptNode));const i=r.shadowRoot;if(i){const s=this._doc.createTreeWalker(i,this.whatToShow,{acceptNode:this._acceptNode});this._walkerStack.unshift(s)}}}function nre(e,t,r,n){return hp()?new rre(e,t,r,n):e.createTreeWalker(t,r,n)}function Wt(...e){let t={...e[0]};for(let r=1;r<e.length;r++){let n=e[r];for(let o in n){let i=t[o],s=n[o];typeof i=="function"&&typeof s=="function"&&o[0]==="o"&&o[1]==="n"&&o.charCodeAt(2)>=65&&o.charCodeAt(2)<=90?t[o]=mp(i,s):(o==="className"||o==="UNSAFE_className")&&typeof i=="string"&&typeof s=="string"?t[o]=Vv(i,s):o==="id"&&i&&s?t.id=Zte(i,s):t[o]=s!==void 0?s:i}}return t}function ore(...e){return e.length===1&&e[0]?e[0]:t=>{let r=!1;const n=e.map(o=>{const i=LR(o,t);return r||(r=typeof i=="function"),i});if(r)return()=>{n.forEach((o,i)=>{typeof o=="function"?o():LR(e[i],null)})}}}function LR(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}const ire=new Set(["id"]),are=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),sre=new Set(["href","hrefLang","target","rel","download","ping","referrerPolicy"]),lre=new Set(["dir","lang","hidden","inert","translate"]),FR=new Set(["onClick","onAuxClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onGotPointerCapture","onLostPointerCapture","onScroll","onWheel","onAnimationStart","onAnimationEnd","onAnimationIteration","onTransitionCancel","onTransitionEnd","onTransitionRun","onTransitionStart"]),ure=/^(data-.*)$/;function Ea(e,t={}){let{labelable:r,isLink:n,global:o,events:i=o,propNames:s}=t,l={};for(const c in e)Object.prototype.hasOwnProperty.call(e,c)&&(ire.has(c)||r&&are.has(c)||n&&sre.has(c)||o&&lre.has(c)||i&&FR.has(c)||c.endsWith("Capture")&&FR.has(c.slice(0,-7))||s?.has(c)||ure.test(c))&&(l[c]=e[c]);return l}function Jn(e){if(cre())e.focus({preventScroll:!0});else{let t=dre(e);e.focus(),fre(t)}}let Vd=null;function cre(){if(Vd==null){Vd=!1;try{document.createElement("div").focus({get preventScroll(){return Vd=!0,!0}})}catch{}}return Vd}function dre(e){let t=e.parentNode,r=[],n=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==n;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&r.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return n instanceof HTMLElement&&r.push({element:n,scrollTop:n.scrollTop,scrollLeft:n.scrollLeft}),r}function fre(e){for(let{element:t,scrollTop:r,scrollLeft:n}of e)t.scrollTop=r,t.scrollLeft=n}function vp(e){var t;if(typeof window>"u"||window.navigator==null)return!1;let r=(t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands;return Array.isArray(r)&&r.some(n=>e.test(n.brand))||e.test(window.navigator.userAgent)}function rb(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function ro(e){if(process.env.NODE_ENV==="test")return e;let t=null;return()=>(t==null&&(t=e()),t)}const vi=ro(function(){return rb(/^Mac/i)}),pre=ro(function(){return rb(/^iPhone/i)}),oD=ro(function(){return rb(/^iPad/i)||vi()&&navigator.maxTouchPoints>1}),nb=ro(function(){return pre()||oD()}),mre=ro(function(){return vi()||nb()}),hre=ro(function(){return vp(/AppleWebKit/i)&&!ob()}),ob=ro(function(){return vp(/Chrome/i)}),ib=ro(function(){return vp(/Android/i)}),vre=ro(function(){return vp(/Firefox/i)}),gre=R.createContext({isNative:!0,open:yre,useHref:e=>e});function ab(){return R.useContext(gre)}function gi(e,t,r=!0){var n,o;let{metaKey:i,ctrlKey:s,altKey:l,shiftKey:c}=t;vre()&&(!((o=window.event)===null||o===void 0||(n=o.type)===null||n===void 0)&&n.startsWith("key"))&&e.target==="_blank"&&(vi()?i=!0:s=!0);let d=hre()&&vi()&&!oD()&&process.env.NODE_ENV!=="test"?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:i,ctrlKey:s,altKey:l,shiftKey:c}):new MouseEvent("click",{metaKey:i,ctrlKey:s,altKey:l,shiftKey:c,bubbles:!0,cancelable:!0});gi.isOpening=r,Jn(e),e.dispatchEvent(d),gi.isOpening=!1}gi.isOpening=!1;function bre(e,t){if(e instanceof HTMLAnchorElement)t(e);else if(e.hasAttribute("data-href")){let r=document.createElement("a");r.href=e.getAttribute("data-href"),e.hasAttribute("data-target")&&(r.target=e.getAttribute("data-target")),e.hasAttribute("data-rel")&&(r.rel=e.getAttribute("data-rel")),e.hasAttribute("data-download")&&(r.download=e.getAttribute("data-download")),e.hasAttribute("data-ping")&&(r.ping=e.getAttribute("data-ping")),e.hasAttribute("data-referrer-policy")&&(r.referrerPolicy=e.getAttribute("data-referrer-policy")),e.appendChild(r),t(r),e.removeChild(r)}}function yre(e,t){bre(e,r=>gi(r,t))}function xre(e){let t=ab();var r;const n=t.useHref((r=e.href)!==null&&r!==void 0?r:"");return{"data-href":e.href?n:void 0,"data-target":e.target,"data-rel":e.rel,"data-download":e.download,"data-ping":e.ping,"data-referrer-policy":e.referrerPolicy}}let Eo=new Map,Pv=new Set;function qR(){if(typeof window>"u")return;function e(n){return"propertyName"in n}let t=n=>{if(!e(n)||!n.target)return;let o=Eo.get(n.target);o||(o=new Set,Eo.set(n.target,o),n.target.addEventListener("transitioncancel",r,{once:!0})),o.add(n.propertyName)},r=n=>{if(!e(n)||!n.target)return;let o=Eo.get(n.target);if(o&&(o.delete(n.propertyName),o.size===0&&(n.target.removeEventListener("transitioncancel",r),Eo.delete(n.target)),Eo.size===0)){for(let i of Pv)i();Pv.clear()}};document.body.addEventListener("transitionrun",t),document.body.addEventListener("transitionend",r)}typeof document<"u"&&(document.readyState!=="loading"?qR():document.addEventListener("DOMContentLoaded",qR));function wre(){for(const[e]of Eo)"isConnected"in e&&!e.isConnected&&Eo.delete(e)}function iD(e){requestAnimationFrame(()=>{wre(),Eo.size===0?e():Pv.add(e)})}function gp(){let e=R.useRef(new Map),t=R.useCallback((o,i,s,l)=>{let c=l?.once?(...d)=>{e.current.delete(s),s(...d)}:s;e.current.set(s,{type:i,eventTarget:o,fn:c,options:l}),o.addEventListener(i,c,l)},[]),r=R.useCallback((o,i,s,l)=>{var c;let d=((c=e.current.get(s))===null||c===void 0?void 0:c.fn)||s;o.removeEventListener(i,d,l),e.current.delete(s)},[]),n=R.useCallback(()=>{e.current.forEach((o,i)=>{r(o.eventTarget,o.type,i,o.options)})},[r]);return R.useEffect(()=>n,[n]),{addGlobalListener:t,removeGlobalListener:r,removeAllGlobalListeners:n}}function Ere(e,t){let{id:r,"aria-label":n,"aria-labelledby":o}=e;return r=Qn(r),o&&n?o=[...new Set([r,...o.trim().split(/\s+/)])].join(" "):o&&(o=o.trim().split(/\s+/).join(" ")),!n&&!o&&t&&(n=t),{id:r,"aria-label":n,"aria-labelledby":o}}function bp(e){const t=R.useRef(null),r=R.useRef(void 0),n=R.useCallback(o=>{if(typeof e=="function"){const i=e,s=i(o);return()=>{typeof s=="function"?s():i(null)}}else if(e)return e.current=o,()=>{e.current=null}},[e]);return R.useMemo(()=>({get current(){return t.current},set current(o){t.current=o,r.current&&(r.current(),r.current=void 0),o!=null&&(r.current=n(o))}}),[n])}function Cre(e,t){const r=R.useRef(!0),n=R.useRef(null);R.useEffect(()=>(r.current=!0,()=>{r.current=!1}),[]),R.useEffect(()=>{let o=n.current;r.current?r.current=!1:(!o||t.some((i,s)=>!Object.is(i,o[s])))&&e(),n.current=t},t)}function jR(e,t){const r=R.useRef(!0),n=R.useRef(null);Ot(()=>(r.current=!0,()=>{r.current=!1}),[]),Ot(()=>{r.current?r.current=!1:(!n.current||t.some((o,i)=>!Object.is(o,n[i])))&&e(),n.current=t},t)}function aD(e,t){Ot(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref&&(e.ref.current=null)}})}function Ju(e,t){if(!e)return!1;let r=window.getComputedStyle(e),n=/(auto|scroll)/.test(r.overflow+r.overflowX+r.overflowY);return n&&t&&(n=e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth),n}function ei(e,t){let r=e;for(Ju(r,t)&&(r=r.parentElement);r&&!Ju(r,t);)r=r.parentElement;return r||document.scrollingElement||document.documentElement}function Rre(e,t){const r=[];for(;e&&e!==document.documentElement;)Ju(e,t)&&r.push(e),e=e.parentElement;return r}function Ji(e){return vi()?e.metaKey:e.ctrlKey}let Pre=0;const Ph=new Map;function sD(e){let[t,r]=R.useState();return Ot(()=>{if(!e)return;let n=Ph.get(e);if(n)r(n.element.id);else{let o=`react-aria-description-${Pre++}`;r(o);let i=document.createElement("div");i.id=o,i.style.display="none",i.textContent=e,document.body.appendChild(i),n={refCount:0,element:i},Ph.set(e,n)}return n.refCount++,()=>{n&&--n.refCount===0&&(n.element.remove(),Ph.delete(e))}},[e]),{"aria-describedby":e?t:void 0}}function Kd(e,t,r,n){let o=ur(r),i=r==null;R.useEffect(()=>{if(i||!e.current)return;let s=e.current;return s.addEventListener(t,o,n),()=>{s.removeEventListener(t,o,n)}},[e,t,n,i,o])}function lD(e,t){let r=BR(e,t,"left"),n=BR(e,t,"top"),o=t.offsetWidth,i=t.offsetHeight,s=e.scrollLeft,l=e.scrollTop,{borderTopWidth:c,borderLeftWidth:d,scrollPaddingTop:f,scrollPaddingRight:p,scrollPaddingBottom:h,scrollPaddingLeft:b}=getComputedStyle(e),{scrollMarginTop:w,scrollMarginRight:y,scrollMarginBottom:C,scrollMarginLeft:x}=getComputedStyle(t),P=s+parseInt(d,10),S=l+parseInt(c,10),D=P+e.clientWidth,_=S+e.clientHeight,T=parseInt(f,10)||0,A=parseInt(h,10)||0,M=parseInt(p,10)||0,U=parseInt(b,10)||0,J=parseInt(w,10)||0,N=parseInt(C,10)||0,K=parseInt(y,10)||0,W=parseInt(x,10)||0,L=r-W,G=r+o+K,k=n-J,F=n+i+N,j=s+parseInt(d,10)+U,re=D-M,V=l+parseInt(c,10)+T,ie=_-A;if((L>j||G<re)&&(L<=s+U?s=L-parseInt(d,10)-U:G>D-M&&(s+=G-D+M)),(k>V||F<ie)&&(k<=S+T?l=k-parseInt(c,10)-T:F>_-A&&(l+=F-_+A)),process.env.NODE_ENV==="test"){e.scrollLeft=s,e.scrollTop=l;return}e.scrollTo({left:s,top:l})}function BR(e,t,r){const n=r==="left"?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[n],t.offsetParent!==e);){if(t.offsetParent.contains(e)){o-=e[n];break}t=t.offsetParent}return o}function wo(e,t){if(e&&document.contains(e)){let s=document.scrollingElement||document.documentElement;if(!(window.getComputedStyle(s).overflow==="hidden")&&!ob()){var r;let{left:c,top:d}=e.getBoundingClientRect();e==null||(r=e.scrollIntoView)===null||r===void 0||r.call(e,{block:"nearest"});let{left:f,top:p}=e.getBoundingClientRect();if(Math.abs(c-f)>1||Math.abs(d-p)>1){var n,o,i;t==null||(o=t.containingElement)===null||o===void 0||(n=o.scrollIntoView)===null||n===void 0||n.call(o,{block:"center",inline:"center"}),(i=e.scrollIntoView)===null||i===void 0||i.call(e,{block:"nearest"})}}else{let c=Rre(e);for(let d of c)lD(d,e)}}}function Sv(e){return e.pointerType===""&&e.isTrusted?!0:ib()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Sre(e){return!ib()&&e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"}function _re(e,t){let{collection:r,onLoadMore:n,scrollOffset:o=1}=e,i=R.useRef(null),s=ur(l=>{for(let c of l)c.isIntersecting&&n&&n()});Ot(()=>(t.current&&(i.current=new IntersectionObserver(s,{root:ei(t?.current),rootMargin:`0px ${100*o}% ${100*o}% ${100*o}%`}),i.current.observe(t.current)),()=>{i.current&&i.current.disconnect()}),[r,s,t,o])}function Tre(e){const t=R.version.split(".");return parseInt(t[0],10)>=19?e:e?"true":void 0}const $re="react-aria-clear-focus",Are="react-aria-focus",Dre=typeof Element<"u"&&"checkVisibility"in Element.prototype;function Mre(e){const t=Br(e);if(!(e instanceof t.HTMLElement)&&!(e instanceof t.SVGElement))return!1;let{display:r,visibility:n}=e.style,o=r!=="none"&&n!=="hidden"&&n!=="collapse";if(o){const{getComputedStyle:i}=e.ownerDocument.defaultView;let{display:s,visibility:l}=i(e);o=s!=="none"&&l!=="hidden"&&l!=="collapse"}return o}function Ore(e,t){return!e.hasAttribute("hidden")&&!e.hasAttribute("data-react-aria-prevent-focus")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function sb(e,t){return Dre?e.checkVisibility({visibilityProperty:!0})&&!e.closest("[data-react-aria-prevent-focus]"):e.nodeName!=="#comment"&&Mre(e)&&Ore(e,t)&&(!e.parentElement||sb(e.parentElement,e))}const lb=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable^="false"])',"permission"],Nre=lb.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";lb.push('[tabindex]:not([tabindex="-1"]):not([disabled])');const Ire=lb.join(':not([hidden]):not([tabindex="-1"]),');function uD(e){return e.matches(Nre)&&sb(e)&&!cD(e)}function kre(e){return e.matches(Ire)&&sb(e)&&!cD(e)}function cD(e){let t=e;for(;t!=null;){if(t instanceof t.ownerDocument.defaultView.HTMLElement&&t.inert)return!0;t=t.parentElement}return!1}function ub(e,t,r){let[n,o]=R.useState(e||t),i=R.useRef(e!==void 0),s=e!==void 0;R.useEffect(()=>{let d=i.current;d!==s&&process.env.NODE_ENV!=="production"&&console.warn(`WARN: A component changed from ${d?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}.`),i.current=s},[s]);let l=s?e:n,c=R.useCallback((d,...f)=>{let p=(h,...b)=>{r&&(Object.is(l,h)||r(h,...b)),s||(l=h)};typeof d=="function"?(process.env.NODE_ENV!=="production"&&console.warn("We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320"),o((b,...w)=>{let y=d(s?l:b,...w);return p(y,...f),s?b:y})):(s||o(d),p(d,...f))},[s,l,r]);return[l,c]}const dD=Symbol("default");function fD({values:e,children:t}){for(let[r,n]of e)t=R.createElement(r.Provider,{value:n},t);return t}function Ca(e){let{className:t,style:r,children:n,defaultClassName:o,defaultChildren:i,defaultStyle:s,values:l}=e;return R.useMemo(()=>{let c,d,f;return typeof t=="function"?c=t({...l,defaultClassName:o}):c=t,typeof r=="function"?d=r({...l,defaultStyle:s||{}}):d=r,typeof n=="function"?f=n({...l,defaultChildren:i}):n==null?f=i:f=n,{className:c??o,style:d||s?{...s,...d}:void 0,children:f??i,"data-rac":""}},[t,r,n,o,i,s,l])}function pD(e,t){return r=>t(typeof e=="function"?e(r):e,r)}function Lre(e,t){let r=R.useContext(e);if(t===null)return null;if(r&&typeof r=="object"&&"slots"in r&&r.slots){let n=t||dD;if(!r.slots[n]){let o=new Intl.ListFormat().format(Object.keys(r.slots).map(s=>`"${s}"`)),i=t?`Invalid slot "${t}".`:"A slot prop is required.";throw new Error(`${i} Valid slot names are ${o}.`)}return r.slots[n]}return r}function mD(e,t,r){let n=Lre(r,e.slot)||{},{ref:o,...i}=n,s=bp(R.useMemo(()=>ore(t,o),[t,o])),l=Wt(i,e);return"style"in i&&i.style&&"style"in e&&e.style&&(typeof i.style=="function"||typeof e.style=="function"?l.style=c=>{let d=typeof i.style=="function"?i.style(c):i.style,f={...c.defaultStyle,...d},p=typeof e.style=="function"?e.style({...c,defaultStyle:f}):e.style;return{...f,...p}}:l.style={...i.style,...e.style}),[l,s]}const hD=7e3;let pn=null;function _v(e,t="assertive",r=hD){pn?pn.announce(e,t,r):(pn=new Fre,(typeof IS_REACT_ACT_ENVIRONMENT=="boolean"?IS_REACT_ACT_ENVIRONMENT:typeof jest<"u")?pn.announce(e,t,r):setTimeout(()=>{pn?.isAttached()&&pn?.announce(e,t,r)},100))}class Fre{isAttached(){var t;return(t=this.node)===null||t===void 0?void 0:t.isConnected}createLog(t){let r=document.createElement("div");return r.setAttribute("role","log"),r.setAttribute("aria-live",t),r.setAttribute("aria-relevant","additions"),r}destroy(){this.node&&(document.body.removeChild(this.node),this.node=null)}announce(t,r="assertive",n=hD){var o,i;if(!this.node)return;let s=document.createElement("div");typeof t=="object"?(s.setAttribute("role","img"),s.setAttribute("aria-labelledby",t["aria-labelledby"])):s.textContent=t,r==="assertive"?(o=this.assertiveLog)===null||o===void 0||o.appendChild(s):(i=this.politeLog)===null||i===void 0||i.appendChild(s),t!==""&&setTimeout(()=>{s.remove()},n)}clear(t){this.node&&((!t||t==="assertive")&&this.assertiveLog&&(this.assertiveLog.innerHTML=""),(!t||t==="polite")&&this.politeLog&&(this.politeLog.innerHTML=""))}constructor(){this.node=null,this.assertiveLog=null,this.politeLog=null,typeof document<"u"&&(this.node=document.createElement("div"),this.node.dataset.liveAnnouncer="true",Object.assign(this.node.style,{border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"}),this.assertiveLog=this.createLog("assertive"),this.node.appendChild(this.assertiveLog),this.politeLog=this.createLog("polite"),this.node.appendChild(this.politeLog),document.body.prepend(this.node))}}const qre=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),jre=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function Bre(e){if(Intl.Locale){let r=new Intl.Locale(e).maximize(),n=typeof r.getTextInfo=="function"?r.getTextInfo():r.textInfo;if(n)return n.direction==="rtl";if(r.script)return qre.has(r.script)}let t=e.split("-")[0];return jre.has(t)}const Vre=Symbol.for("react-aria.i18n.locale");function vD(){let e=typeof window<"u"&&window[Vre]||typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:Bre(e)?"rtl":"ltr"}}let Tv=vD(),ku=new Set;function VR(){Tv=vD();for(let e of ku)e(Tv)}function Kre(){let e=Ac(),[t,r]=R.useState(Tv);return R.useEffect(()=>(ku.size===0&&window.addEventListener("languagechange",VR),ku.add(r),()=>{ku.delete(r),ku.size===0&&window.removeEventListener("languagechange",VR)}),[]),e?{locale:"en-US",direction:"ltr"}:t}const Wre=R.createContext(null);function Dc(){let e=Kre();return R.useContext(Wre)||e}const Hre=Symbol.for("react-aria.i18n.locale"),Ure=Symbol.for("react-aria.i18n.strings");let Gi;class yp{getStringForLocale(t,r){let o=this.getStringsForLocale(r)[t];if(!o)throw new Error(`Could not find intl message ${t} in ${r} locale`);return o}getStringsForLocale(t){let r=this.strings[t];return r||(r=zre(t,this.strings,this.defaultLocale),this.strings[t]=r),r}static getGlobalDictionaryForPackage(t){if(typeof window>"u")return null;let r=window[Hre];if(Gi===void 0){let o=window[Ure];if(!o)return null;Gi={};for(let i in o)Gi[i]=new yp({[r]:o[i]},r)}let n=Gi?.[t];if(!n)throw new Error(`Strings for package "${t}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);return n}constructor(t,r="en-US"){this.strings=Object.fromEntries(Object.entries(t).filter(([,n])=>n)),this.defaultLocale=r}}function zre(e,t,r="en-US"){if(t[e])return t[e];let n=Gre(e);if(t[n])return t[n];for(let o in t)if(o.startsWith(n+"-"))return t[o];return t[r]}function Gre(e){return Intl.Locale?new Intl.Locale(e).language:e.split("-")[0]}const KR=new Map,WR=new Map;class Yre{format(t,r){let n=this.strings.getStringForLocale(t,this.locale);return typeof n=="function"?n(r,this):n}plural(t,r,n="cardinal"){let o=r["="+t];if(o)return typeof o=="function"?o():o;let i=this.locale+":"+n,s=KR.get(i);s||(s=new Intl.PluralRules(this.locale,{type:n}),KR.set(i,s));let l=s.select(t);return o=r[l]||r.other,typeof o=="function"?o():o}number(t){let r=WR.get(this.locale);return r||(r=new Intl.NumberFormat(this.locale),WR.set(this.locale,r)),r.format(t)}select(t,r){let n=t[r]||t.other;return typeof n=="function"?n():n}constructor(t,r){this.locale=t,this.strings=r}}const HR=new WeakMap;function Xre(e){let t=HR.get(e);return t||(t=new yp(e),HR.set(e,t)),t}function Zre(e,t){return t&&yp.getGlobalDictionaryForPackage(t)||Xre(e)}function xp(e,t){let{locale:r}=Dc(),n=Zre(e,t);return R.useMemo(()=>new Yre(r,n),[r,n])}function Qre(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Jre(e,t,r){Qre(e,t),t.set(e,r)}let Sh=new Map;function gD(e){let{locale:t}=Dc(),r=t+(e?Object.entries(e).sort((o,i)=>o[0]<i[0]?-1:1).join():"");if(Sh.has(r))return Sh.get(r);let n=new Intl.Collator(t,e);return Sh.set(r,n),n}function cb(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function bD(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function yD(e){let t=R.useRef({isFocused:!1,observer:null});Ot(()=>{const n=t.current;return()=>{n.observer&&(n.observer.disconnect(),n.observer=null)}},[]);let r=ur(n=>{e?.(n)});return R.useCallback(n=>{if(n.target instanceof HTMLButtonElement||n.target instanceof HTMLInputElement||n.target instanceof HTMLTextAreaElement||n.target instanceof HTMLSelectElement){t.current.isFocused=!0;let o=n.target,i=s=>{if(t.current.isFocused=!1,o.disabled){let l=cb(s);r(l)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};o.addEventListener("focusout",i,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&o.disabled){var s;(s=t.current.observer)===null||s===void 0||s.disconnect();let l=o===document.activeElement?null:document.activeElement;o.dispatchEvent(new FocusEvent("blur",{relatedTarget:l})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:l}))}}),t.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[r])}let $f=!1;function UR(e){for(;e&&!uD(e);)e=e.parentElement;let t=Br(e),r=t.document.activeElement;if(!r||r===e)return;$f=!0;let n=!1,o=f=>{(f.target===r||n)&&f.stopImmediatePropagation()},i=f=>{(f.target===r||n)&&(f.stopImmediatePropagation(),!e&&!n&&(n=!0,Jn(r),c()))},s=f=>{(f.target===e||n)&&f.stopImmediatePropagation()},l=f=>{(f.target===e||n)&&(f.stopImmediatePropagation(),n||(n=!0,Jn(r),c()))};t.addEventListener("blur",o,!0),t.addEventListener("focusout",i,!0),t.addEventListener("focusin",l,!0),t.addEventListener("focus",s,!0);let c=()=>{cancelAnimationFrame(d),t.removeEventListener("blur",o,!0),t.removeEventListener("focusout",i,!0),t.removeEventListener("focusin",l,!0),t.removeEventListener("focus",s,!0),$f=!1,n=!1},d=requestAnimationFrame(c);return c}let ea="default",$v="",ef=new WeakMap;function zR(e){if(nb()){if(ea==="default"){const t=rt(e);$v=t.documentElement.style.webkitUserSelect,t.documentElement.style.webkitUserSelect="none"}ea="disabled"}else if(e instanceof HTMLElement||e instanceof SVGElement){let t="userSelect"in e.style?"userSelect":"webkitUserSelect";ef.set(e,e.style[t]),e.style[t]="none"}}function _h(e){if(nb()){if(ea!=="disabled")return;ea="restoring",setTimeout(()=>{iD(()=>{if(ea==="restoring"){const t=rt(e);t.documentElement.style.webkitUserSelect==="none"&&(t.documentElement.style.webkitUserSelect=$v||""),$v="",ea="default"}})},300)}else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&ef.has(e)){let t=ef.get(e),r="userSelect"in e.style?"userSelect":"webkitUserSelect";e.style[r]==="none"&&(e.style[r]=t),e.getAttribute("style")===""&&e.removeAttribute("style"),ef.delete(e)}}const xD=R.createContext({register:()=>{}});xD.displayName="PressResponderContext";function ene(e,t){return t.get?t.get.call(e):t.value}function wD(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}function tne(e,t){var r=wD(e,t,"get");return ene(e,r)}function rne(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}function GR(e,t,r){var n=wD(e,t,"set");return rne(e,n,r),r}function nne(e){let t=R.useContext(xD);if(t){let{register:r,...n}=t;e=Wt(n,e),r()}return aD(t,e.ref),e}var Wd=new WeakMap;class Hd{continuePropagation(){GR(this,Wd,!1)}get shouldStopPropagation(){return tne(this,Wd)}constructor(t,r,n,o){Jre(this,Wd,{writable:!0,value:void 0}),GR(this,Wd,!0);var i;let s=(i=o?.target)!==null&&i!==void 0?i:n.currentTarget;const l=s?.getBoundingClientRect();let c,d=0,f,p=null;n.clientX!=null&&n.clientY!=null&&(f=n.clientX,p=n.clientY),l&&(f!=null&&p!=null?(c=f-l.left,d=p-l.top):(c=l.width/2,d=l.height/2)),this.type=t,this.pointerType=r,this.target=n.currentTarget,this.shiftKey=n.shiftKey,this.metaKey=n.metaKey,this.ctrlKey=n.ctrlKey,this.altKey=n.altKey,this.x=c,this.y=d}}const YR=Symbol("linkClicked"),XR="react-aria-pressable-style",ZR="data-react-aria-pressable";function db(e){let{onPress:t,onPressChange:r,onPressStart:n,onPressEnd:o,onPressUp:i,onClick:s,isDisabled:l,isPressed:c,preventFocusOnPress:d,shouldCancelOnPointerExit:f,allowTextSelectionOnPress:p,ref:h,...b}=nne(e),[w,y]=R.useState(!1),C=R.useRef({isPressed:!1,ignoreEmulatedMouseEvents:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null,disposables:[]}),{addGlobalListener:x,removeAllGlobalListeners:P}=gp(),S=ur((N,K)=>{let W=C.current;if(l||W.didFirePressStart)return!1;let L=!0;if(W.isTriggeringEvent=!0,n){let G=new Hd("pressstart",K,N);n(G),L=G.shouldStopPropagation}return r&&r(!0),W.isTriggeringEvent=!1,W.didFirePressStart=!0,y(!0),L}),D=ur((N,K,W=!0)=>{let L=C.current;if(!L.didFirePressStart)return!1;L.didFirePressStart=!1,L.isTriggeringEvent=!0;let G=!0;if(o){let k=new Hd("pressend",K,N);o(k),G=k.shouldStopPropagation}if(r&&r(!1),y(!1),t&&W&&!l){let k=new Hd("press",K,N);t(k),G&&(G=k.shouldStopPropagation)}return L.isTriggeringEvent=!1,G}),_=ur((N,K)=>{let W=C.current;if(l)return!1;if(i){W.isTriggeringEvent=!0;let L=new Hd("pressup",K,N);return i(L),W.isTriggeringEvent=!1,L.shouldStopPropagation}return!0}),T=ur(N=>{let K=C.current;if(K.isPressed&&K.target){K.didFirePressStart&&K.pointerType!=null&&D(Xo(K.target,N),K.pointerType,!1),K.isPressed=!1,K.isOverTarget=!1,K.activePointerId=null,K.pointerType=null,P(),p||_h(K.target);for(let W of K.disposables)W();K.disposables=[]}}),A=ur(N=>{f&&T(N)}),M=ur(N=>{l||s?.(N)}),U=ur((N,K)=>{if(!l&&s){let W=new MouseEvent("click",N);bD(W,K),s(cb(W))}}),J=R.useMemo(()=>{let N=C.current,K={onKeyDown(L){if(Th(L.nativeEvent,L.currentTarget)&&yt(L.currentTarget,Ze(L.nativeEvent))){var G;e1(Ze(L.nativeEvent),L.key)&&L.preventDefault();let k=!0;if(!N.isPressed&&!L.repeat){N.target=L.currentTarget,N.isPressed=!0,N.pointerType="keyboard",k=S(L,"keyboard");let F=L.currentTarget,j=re=>{Th(re,F)&&!re.repeat&&yt(F,Ze(re))&&N.target&&_(Xo(N.target,re),"keyboard")};x(rt(L.currentTarget),"keyup",mp(j,W),!0)}k&&L.stopPropagation(),L.metaKey&&vi()&&((G=N.metaKeyEvents)===null||G===void 0||G.set(L.key,L.nativeEvent))}else L.key==="Meta"&&(N.metaKeyEvents=new Map)},onClick(L){if(!(L&&!yt(L.currentTarget,Ze(L.nativeEvent)))&&L&&L.button===0&&!N.isTriggeringEvent&&!gi.isOpening){let G=!0;if(l&&L.preventDefault(),!N.ignoreEmulatedMouseEvents&&!N.isPressed&&(N.pointerType==="virtual"||Sv(L.nativeEvent))){let k=S(L,"virtual"),F=_(L,"virtual"),j=D(L,"virtual");M(L),G=k&&F&&j}else if(N.isPressed&&N.pointerType!=="keyboard"){let k=N.pointerType||L.nativeEvent.pointerType||"virtual",F=_(Xo(L.currentTarget,L),k),j=D(Xo(L.currentTarget,L),k,!0);G=F&&j,N.isOverTarget=!1,M(L),T(L)}N.ignoreEmulatedMouseEvents=!1,G&&L.stopPropagation()}}},W=L=>{var G;if(N.isPressed&&N.target&&Th(L,N.target)){var k;e1(Ze(L),L.key)&&L.preventDefault();let j=Ze(L),re=yt(N.target,Ze(L));D(Xo(N.target,L),"keyboard",re),re&&U(L,N.target),P(),L.key!=="Enter"&&fb(N.target)&&yt(N.target,j)&&!L[YR]&&(L[YR]=!0,gi(N.target,L,!1)),N.isPressed=!1,(k=N.metaKeyEvents)===null||k===void 0||k.delete(L.key)}else if(L.key==="Meta"&&(!((G=N.metaKeyEvents)===null||G===void 0)&&G.size)){var F;let j=N.metaKeyEvents;N.metaKeyEvents=void 0;for(let re of j.values())(F=N.target)===null||F===void 0||F.dispatchEvent(new KeyboardEvent("keyup",re))}};if(typeof PointerEvent<"u"){K.onPointerDown=k=>{if(k.button!==0||!yt(k.currentTarget,Ze(k.nativeEvent)))return;if(Sre(k.nativeEvent)){N.pointerType="virtual";return}N.pointerType=k.pointerType;let F=!0;if(!N.isPressed){N.isPressed=!0,N.isOverTarget=!0,N.activePointerId=k.pointerId,N.target=k.currentTarget,p||zR(N.target),F=S(k,N.pointerType);let j=Ze(k.nativeEvent);"releasePointerCapture"in j&&j.releasePointerCapture(k.pointerId),x(rt(k.currentTarget),"pointerup",L,!1),x(rt(k.currentTarget),"pointercancel",G,!1)}F&&k.stopPropagation()},K.onMouseDown=k=>{if(yt(k.currentTarget,Ze(k.nativeEvent))&&k.button===0){if(d){let F=UR(k.target);F&&N.disposables.push(F)}k.stopPropagation()}},K.onPointerUp=k=>{!yt(k.currentTarget,Ze(k.nativeEvent))||N.pointerType==="virtual"||k.button===0&&!N.isPressed&&_(k,N.pointerType||k.pointerType)},K.onPointerEnter=k=>{k.pointerId===N.activePointerId&&N.target&&!N.isOverTarget&&N.pointerType!=null&&(N.isOverTarget=!0,S(Xo(N.target,k),N.pointerType))},K.onPointerLeave=k=>{k.pointerId===N.activePointerId&&N.target&&N.isOverTarget&&N.pointerType!=null&&(N.isOverTarget=!1,D(Xo(N.target,k),N.pointerType,!1),A(k))};let L=k=>{if(k.pointerId===N.activePointerId&&N.isPressed&&k.button===0&&N.target){if(yt(N.target,Ze(k))&&N.pointerType!=null){let F=!1,j=setTimeout(()=>{N.isPressed&&N.target instanceof HTMLElement&&(F?T(k):(Jn(N.target),N.target.click()))},80);x(k.currentTarget,"click",()=>F=!0,!0),N.disposables.push(()=>clearTimeout(j))}else T(k);N.isOverTarget=!1}},G=k=>{T(k)};K.onDragStart=k=>{yt(k.currentTarget,Ze(k.nativeEvent))&&T(k)}}else if(process.env.NODE_ENV==="test"){K.onMouseDown=k=>{if(k.button!==0||!yt(k.currentTarget,Ze(k.nativeEvent)))return;if(N.ignoreEmulatedMouseEvents){k.stopPropagation();return}if(N.isPressed=!0,N.isOverTarget=!0,N.target=k.currentTarget,N.pointerType=Sv(k.nativeEvent)?"virtual":"mouse",rn.flushSync(()=>S(k,N.pointerType))&&k.stopPropagation(),d){let j=UR(k.target);j&&N.disposables.push(j)}x(rt(k.currentTarget),"mouseup",L,!1)},K.onMouseEnter=k=>{if(!yt(k.currentTarget,Ze(k.nativeEvent)))return;let F=!0;N.isPressed&&!N.ignoreEmulatedMouseEvents&&N.pointerType!=null&&(N.isOverTarget=!0,F=S(k,N.pointerType)),F&&k.stopPropagation()},K.onMouseLeave=k=>{if(!yt(k.currentTarget,Ze(k.nativeEvent)))return;let F=!0;N.isPressed&&!N.ignoreEmulatedMouseEvents&&N.pointerType!=null&&(N.isOverTarget=!1,F=D(k,N.pointerType,!1),A(k)),F&&k.stopPropagation()},K.onMouseUp=k=>{yt(k.currentTarget,Ze(k.nativeEvent))&&!N.ignoreEmulatedMouseEvents&&k.button===0&&!N.isPressed&&_(k,N.pointerType||"mouse")};let L=k=>{if(k.button===0){if(N.ignoreEmulatedMouseEvents){N.ignoreEmulatedMouseEvents=!1;return}N.target&&N.target.contains(k.target)&&N.pointerType!=null||T(k),N.isOverTarget=!1}};K.onTouchStart=k=>{if(!yt(k.currentTarget,Ze(k.nativeEvent)))return;let F=one(k.nativeEvent);if(!F)return;N.activePointerId=F.identifier,N.ignoreEmulatedMouseEvents=!0,N.isOverTarget=!0,N.isPressed=!0,N.target=k.currentTarget,N.pointerType="touch",p||zR(N.target),S(bo(N.target,k),N.pointerType)&&k.stopPropagation(),x(Br(k.currentTarget),"scroll",G,!0)},K.onTouchMove=k=>{if(!yt(k.currentTarget,Ze(k.nativeEvent)))return;if(!N.isPressed){k.stopPropagation();return}let F=QR(k.nativeEvent,N.activePointerId),j=!0;F&&JR(F,k.currentTarget)?!N.isOverTarget&&N.pointerType!=null&&(N.isOverTarget=!0,j=S(bo(N.target,k),N.pointerType)):N.isOverTarget&&N.pointerType!=null&&(N.isOverTarget=!1,j=D(bo(N.target,k),N.pointerType,!1),A(bo(N.target,k))),j&&k.stopPropagation()},K.onTouchEnd=k=>{if(!yt(k.currentTarget,Ze(k.nativeEvent)))return;if(!N.isPressed){k.stopPropagation();return}let F=QR(k.nativeEvent,N.activePointerId),j=!0;F&&JR(F,k.currentTarget)&&N.pointerType!=null?(_(bo(N.target,k),N.pointerType),j=D(bo(N.target,k),N.pointerType),U(k.nativeEvent,N.target)):N.isOverTarget&&N.pointerType!=null&&(j=D(bo(N.target,k),N.pointerType,!1)),j&&k.stopPropagation(),N.isPressed=!1,N.activePointerId=null,N.isOverTarget=!1,N.ignoreEmulatedMouseEvents=!0,N.target&&!p&&_h(N.target),P()},K.onTouchCancel=k=>{yt(k.currentTarget,Ze(k.nativeEvent))&&(k.stopPropagation(),N.isPressed&&T(bo(N.target,k)))};let G=k=>{N.isPressed&&yt(Ze(k),N.target)&&T({currentTarget:N.target,shiftKey:!1,ctrlKey:!1,metaKey:!1,altKey:!1})};K.onDragStart=k=>{yt(k.currentTarget,Ze(k.nativeEvent))&&T(k)}}return K},[x,l,d,P,p,T,A,D,S,_,M,U]);return R.useEffect(()=>{if(!h||process.env.NODE_ENV==="test")return;const N=rt(h.current);if(!N||!N.head||N.getElementById(XR))return;const K=N.createElement("style");K.id=XR,K.textContent=`
126
+ }`;var qe=Ux(function(){return Xe(I,$e+"return "+ge).apply(r,B)});if(qe.source=ge,Mm(qe))throw qe;return qe}function X2(a){return Je(a).toLowerCase()}function Z2(a){return Je(a).toUpperCase()}function Q2(a,u,m){if(a=Je(a),a&&(m||u===r))return ty(a);if(!a||!(u=yr(u)))return a;var E=Ur(a),$=Ur(u),I=ry(E,$),B=ny(E,$)+1;return fo(E,I,B).join("")}function J2(a,u,m){if(a=Je(a),a&&(m||u===r))return a.slice(0,iy(a)+1);if(!a||!(u=yr(u)))return a;var E=Ur(a),$=ny(E,Ur(u))+1;return fo(E,0,$).join("")}function eL(a,u,m){if(a=Je(a),a&&(m||u===r))return a.replace(Mp,"");if(!a||!(u=yr(u)))return a;var E=Ur(a),$=ry(E,Ur(u));return fo(E,$).join("")}function tL(a,u){var m=J,E=N;if(Et(u)){var $="separator"in u?u.separator:$;m="length"in u?Fe(u.length):m,E="omission"in u?yr(u.omission):E}a=Je(a);var I=a.length;if(Ti(a)){var B=Ur(a);I=B.length}if(m>=I)return a;var z=m-$i(E);if(z<1)return E;var ee=B?fo(B,0,z).join(""):a.slice(0,z);if($===r)return ee+E;if(B&&(z+=ee.length-z),Om($)){if(a.slice(z).search($)){var me,he=ee;for($.global||($=Yp($.source,Je(Cb.exec($))+"g")),$.lastIndex=0;me=$.exec(he);)var ge=me.index;ee=ee.slice(0,ge===r?z:ge)}}else if(a.indexOf(yr($),z)!=z){var Re=ee.lastIndexOf($);Re>-1&&(ee=ee.slice(0,Re))}return ee+E}function rL(a){return a=Je(a),a&&Pp.test(a)?a.replace(Mc,DN):a}var nL=ki(function(a,u,m){return a+(m?" ":"")+u.toUpperCase()}),km=zy("toUpperCase");function Hx(a,u,m){return a=Je(a),u=m?r:u,u===r?SN(a)?NN(a):gN(a):a.match(u)||[]}var Ux=je(function(a,u){try{return gr(a,r,u)}catch(m){return Mm(m)?m:new ke(m)}}),oL=An(function(a,u){return Dr(u,function(m){m=dn(m),Tn(a,m,Am(a[m],a))}),a});function iL(a){var u=a==null?0:a.length,m=Me();return a=u?bt(a,function(E){if(typeof E[1]!="function")throw new Mr(s);return[m(E[0]),E[1]]}):[],je(function(E){for(var $=-1;++$<u;){var I=a[$];if(gr(I[0],this,E))return gr(I[1],this,E)}})}function aL(a){return DI(Nr(a,p))}function Lm(a){return function(){return a}}function sL(a,u){return a==null||a!==a?u:a}var lL=Yy(),uL=Yy(!0);function mr(a){return a}function Fm(a){return Py(typeof a=="function"?a:Nr(a,p))}function cL(a){return _y(Nr(a,p))}function dL(a,u){return Ty(a,Nr(u,p))}var fL=je(function(a,u){return function(m){return Na(m,a,u)}}),pL=je(function(a,u){return function(m){return Na(a,m,u)}});function qm(a,u,m){var E=Ut(u),$=rd(u,E);m==null&&!(Et(u)&&($.length||!E.length))&&(m=u,u=a,a=this,$=rd(u,Ut(u)));var I=!(Et(m)&&"chain"in m)||!!m.chain,B=Mn(a);return Dr($,function(z){var ee=u[z];a[z]=ee,B&&(a.prototype[z]=function(){var me=this.__chain__;if(I||me){var he=a(this.__wrapped__),ge=he.__actions__=dr(this.__actions__);return ge.push({func:ee,args:arguments,thisArg:a}),he.__chain__=me,he}return ee.apply(a,io([this.value()],arguments))})}),a}function mL(){return Gt._===this&&(Gt._=jN),this}function jm(){}function hL(a){return a=Fe(a),je(function(u){return $y(u,a)})}var vL=gm(bt),gL=gm(Xb),bL=gm(Vp);function zx(a){return Rm(a)?Kp(dn(a)):GI(a)}function yL(a){return function(u){return a==null?r:Wo(a,u)}}var xL=Zy(),wL=Zy(!0);function Bm(){return[]}function Vm(){return!1}function EL(){return{}}function CL(){return""}function RL(){return!0}function PL(a,u){if(a=Fe(a),a<1||a>j)return[];var m=ie,E=Qt(a,ie);u=Me(u),a-=ie;for(var $=Up(E,u);++m<a;)u(m);return $}function SL(a){return Le(a)?bt(a,dn):xr(a)?[a]:dr(px(Je(a)))}function _L(a){var u=++FN;return Je(a)+u}var TL=ld(function(a,u){return a+u},0),$L=bm("ceil"),AL=ld(function(a,u){return a/u},1),DL=bm("floor");function ML(a){return a&&a.length?td(a,mr,nm):r}function OL(a,u){return a&&a.length?td(a,Me(u,2),nm):r}function NL(a){return Jb(a,mr)}function IL(a,u){return Jb(a,Me(u,2))}function kL(a){return a&&a.length?td(a,mr,sm):r}function LL(a,u){return a&&a.length?td(a,Me(u,2),sm):r}var FL=ld(function(a,u){return a*u},1),qL=bm("round"),jL=ld(function(a,u){return a-u},0);function BL(a){return a&&a.length?Hp(a,mr):0}function VL(a,u){return a&&a.length?Hp(a,Me(u,2)):0}return O.after=c3,O.ary=Rx,O.assign=Z3,O.assignIn=Fx,O.assignInWith=wd,O.assignWith=Q3,O.at=J3,O.before=Px,O.bind=Am,O.bindAll=oL,O.bindKey=Sx,O.castArray=E3,O.chain=wx,O.chunk=Dk,O.compact=Mk,O.concat=Ok,O.cond=iL,O.conforms=aL,O.constant=Lm,O.countBy=B4,O.create=e2,O.curry=_x,O.curryRight=Tx,O.debounce=$x,O.defaults=t2,O.defaultsDeep=r2,O.defer=d3,O.delay=f3,O.difference=Nk,O.differenceBy=Ik,O.differenceWith=kk,O.drop=Lk,O.dropRight=Fk,O.dropRightWhile=qk,O.dropWhile=jk,O.fill=Bk,O.filter=K4,O.flatMap=U4,O.flatMapDeep=z4,O.flatMapDepth=G4,O.flatten=gx,O.flattenDeep=Vk,O.flattenDepth=Kk,O.flip=p3,O.flow=lL,O.flowRight=uL,O.fromPairs=Wk,O.functions=u2,O.functionsIn=c2,O.groupBy=Y4,O.initial=Uk,O.intersection=zk,O.intersectionBy=Gk,O.intersectionWith=Yk,O.invert=f2,O.invertBy=p2,O.invokeMap=Z4,O.iteratee=Fm,O.keyBy=Q4,O.keys=Ut,O.keysIn=pr,O.map=hd,O.mapKeys=h2,O.mapValues=v2,O.matches=cL,O.matchesProperty=dL,O.memoize=gd,O.merge=g2,O.mergeWith=qx,O.method=fL,O.methodOf=pL,O.mixin=qm,O.negate=bd,O.nthArg=hL,O.omit=b2,O.omitBy=y2,O.once=m3,O.orderBy=J4,O.over=vL,O.overArgs=h3,O.overEvery=gL,O.overSome=bL,O.partial=Dm,O.partialRight=Ax,O.partition=e3,O.pick=x2,O.pickBy=jx,O.property=zx,O.propertyOf=yL,O.pull=Jk,O.pullAll=yx,O.pullAllBy=e4,O.pullAllWith=t4,O.pullAt=r4,O.range=xL,O.rangeRight=wL,O.rearg=v3,O.reject=n3,O.remove=n4,O.rest=g3,O.reverse=Tm,O.sampleSize=i3,O.set=E2,O.setWith=C2,O.shuffle=a3,O.slice=o4,O.sortBy=u3,O.sortedUniq=d4,O.sortedUniqBy=f4,O.split=U2,O.spread=b3,O.tail=p4,O.take=m4,O.takeRight=h4,O.takeRightWhile=v4,O.takeWhile=g4,O.tap=M4,O.throttle=y3,O.thru=md,O.toArray=Ix,O.toPairs=Bx,O.toPairsIn=Vx,O.toPath=SL,O.toPlainObject=Lx,O.transform=R2,O.unary=x3,O.union=b4,O.unionBy=y4,O.unionWith=x4,O.uniq=w4,O.uniqBy=E4,O.uniqWith=C4,O.unset=P2,O.unzip=$m,O.unzipWith=xx,O.update=S2,O.updateWith=_2,O.values=qi,O.valuesIn=T2,O.without=R4,O.words=Hx,O.wrap=w3,O.xor=P4,O.xorBy=S4,O.xorWith=_4,O.zip=T4,O.zipObject=$4,O.zipObjectDeep=A4,O.zipWith=D4,O.entries=Bx,O.entriesIn=Vx,O.extend=Fx,O.extendWith=wd,qm(O,O),O.add=TL,O.attempt=Ux,O.camelCase=M2,O.capitalize=Kx,O.ceil=$L,O.clamp=$2,O.clone=C3,O.cloneDeep=P3,O.cloneDeepWith=S3,O.cloneWith=R3,O.conformsTo=_3,O.deburr=Wx,O.defaultTo=sL,O.divide=AL,O.endsWith=O2,O.eq=Gr,O.escape=N2,O.escapeRegExp=I2,O.every=V4,O.find=W4,O.findIndex=hx,O.findKey=n2,O.findLast=H4,O.findLastIndex=vx,O.findLastKey=o2,O.floor=DL,O.forEach=Ex,O.forEachRight=Cx,O.forIn=i2,O.forInRight=a2,O.forOwn=s2,O.forOwnRight=l2,O.get=Nm,O.gt=T3,O.gte=$3,O.has=d2,O.hasIn=Im,O.head=bx,O.identity=mr,O.includes=X4,O.indexOf=Hk,O.inRange=A2,O.invoke=m2,O.isArguments=zo,O.isArray=Le,O.isArrayBuffer=A3,O.isArrayLike=fr,O.isArrayLikeObject=$t,O.isBoolean=D3,O.isBuffer=po,O.isDate=M3,O.isElement=O3,O.isEmpty=N3,O.isEqual=I3,O.isEqualWith=k3,O.isError=Mm,O.isFinite=L3,O.isFunction=Mn,O.isInteger=Dx,O.isLength=yd,O.isMap=Mx,O.isMatch=F3,O.isMatchWith=q3,O.isNaN=j3,O.isNative=B3,O.isNil=K3,O.isNull=V3,O.isNumber=Ox,O.isObject=Et,O.isObjectLike=Pt,O.isPlainObject=ja,O.isRegExp=Om,O.isSafeInteger=W3,O.isSet=Nx,O.isString=xd,O.isSymbol=xr,O.isTypedArray=Fi,O.isUndefined=H3,O.isWeakMap=U3,O.isWeakSet=z3,O.join=Xk,O.kebabCase=k2,O.last=kr,O.lastIndexOf=Zk,O.lowerCase=L2,O.lowerFirst=F2,O.lt=G3,O.lte=Y3,O.max=ML,O.maxBy=OL,O.mean=NL,O.meanBy=IL,O.min=kL,O.minBy=LL,O.stubArray=Bm,O.stubFalse=Vm,O.stubObject=EL,O.stubString=CL,O.stubTrue=RL,O.multiply=FL,O.nth=Qk,O.noConflict=mL,O.noop=jm,O.now=vd,O.pad=q2,O.padEnd=j2,O.padStart=B2,O.parseInt=V2,O.random=D2,O.reduce=t3,O.reduceRight=r3,O.repeat=K2,O.replace=W2,O.result=w2,O.round=qL,O.runInContext=Q,O.sample=o3,O.size=s3,O.snakeCase=H2,O.some=l3,O.sortedIndex=i4,O.sortedIndexBy=a4,O.sortedIndexOf=s4,O.sortedLastIndex=l4,O.sortedLastIndexBy=u4,O.sortedLastIndexOf=c4,O.startCase=z2,O.startsWith=G2,O.subtract=jL,O.sum=BL,O.sumBy=VL,O.template=Y2,O.times=PL,O.toFinite=On,O.toInteger=Fe,O.toLength=kx,O.toLower=X2,O.toNumber=Lr,O.toSafeInteger=X3,O.toString=Je,O.toUpper=Z2,O.trim=Q2,O.trimEnd=J2,O.trimStart=eL,O.truncate=tL,O.unescape=rL,O.uniqueId=_L,O.upperCase=nL,O.upperFirst=km,O.each=Ex,O.eachRight=Cx,O.first=bx,qm(O,(function(){var a={};return un(O,function(u,m){nt.call(O.prototype,m)||(a[m]=u)}),a})(),{chain:!1}),O.VERSION=n,Dr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(a){O[a].placeholder=O}),Dr(["drop","take"],function(a,u){He.prototype[a]=function(m){m=m===r?1:jt(Fe(m),0);var E=this.__filtered__&&!u?new He(this):this.clone();return E.__filtered__?E.__takeCount__=Qt(m,E.__takeCount__):E.__views__.push({size:Qt(m,ie),type:a+(E.__dir__<0?"Right":"")}),E},He.prototype[a+"Right"]=function(m){return this.reverse()[a](m).reverse()}}),Dr(["filter","map","takeWhile"],function(a,u){var m=u+1,E=m==L||m==k;He.prototype[a]=function($){var I=this.clone();return I.__iteratees__.push({iteratee:Me($,3),type:m}),I.__filtered__=I.__filtered__||E,I}}),Dr(["head","last"],function(a,u){var m="take"+(u?"Right":"");He.prototype[a]=function(){return this[m](1).value()[0]}}),Dr(["initial","tail"],function(a,u){var m="drop"+(u?"":"Right");He.prototype[a]=function(){return this.__filtered__?new He(this):this[m](1)}}),He.prototype.compact=function(){return this.filter(mr)},He.prototype.find=function(a){return this.filter(a).head()},He.prototype.findLast=function(a){return this.reverse().find(a)},He.prototype.invokeMap=je(function(a,u){return typeof a=="function"?new He(this):this.map(function(m){return Na(m,a,u)})}),He.prototype.reject=function(a){return this.filter(bd(Me(a)))},He.prototype.slice=function(a,u){a=Fe(a);var m=this;return m.__filtered__&&(a>0||u<0)?new He(m):(a<0?m=m.takeRight(-a):a&&(m=m.drop(a)),u!==r&&(u=Fe(u),m=u<0?m.dropRight(-u):m.take(u-a)),m)},He.prototype.takeRightWhile=function(a){return this.reverse().takeWhile(a).reverse()},He.prototype.toArray=function(){return this.take(ie)},un(He.prototype,function(a,u){var m=/^(?:filter|find|map|reject)|While$/.test(u),E=/^(?:head|last)$/.test(u),$=O[E?"take"+(u=="last"?"Right":""):u],I=E||/^find/.test(u);$&&(O.prototype[u]=function(){var B=this.__wrapped__,z=E?[1]:arguments,ee=B instanceof He,me=z[0],he=ee||Le(B),ge=function(We){var Ge=$.apply(O,io([We],z));return E&&Re?Ge[0]:Ge};he&&m&&typeof me=="function"&&me.length!=1&&(ee=he=!1);var Re=this.__chain__,$e=!!this.__actions__.length,Oe=I&&!Re,qe=ee&&!$e;if(!I&&he){B=qe?B:new He(this);var Ne=a.apply(B,z);return Ne.__actions__.push({func:md,args:[ge],thisArg:r}),new Or(Ne,Re)}return Oe&&qe?a.apply(this,z):(Ne=this.thru(ge),Oe?E?Ne.value()[0]:Ne.value():Ne)})}),Dr(["pop","push","shift","sort","splice","unshift"],function(a){var u=jc[a],m=/^(?:push|sort|unshift)$/.test(a)?"tap":"thru",E=/^(?:pop|shift)$/.test(a);O.prototype[a]=function(){var $=arguments;if(E&&!this.__chain__){var I=this.value();return u.apply(Le(I)?I:[],$)}return this[m](function(B){return u.apply(Le(B)?B:[],$)})}}),un(He.prototype,function(a,u){var m=O[u];if(m){var E=m.name+"";nt.call(Oi,E)||(Oi[E]=[]),Oi[E].push({name:u,func:m})}}),Oi[sd(r,x).name]=[{name:"wrapper",func:r}],He.prototype.clone=rI,He.prototype.reverse=nI,He.prototype.value=oI,O.prototype.at=O4,O.prototype.chain=N4,O.prototype.commit=I4,O.prototype.next=k4,O.prototype.plant=F4,O.prototype.reverse=q4,O.prototype.toJSON=O.prototype.valueOf=O.prototype.value=j4,O.prototype.first=O.prototype.head,_a&&(O.prototype[_a]=L4),O}),Ai=IN();qo?((qo.exports=Ai)._=Ai,Fp._=Ai):Gt._=Ai}).call(Dz)})(Mu,Mu.exports)),Mu.exports}var lt=Mz();const Oz=({view:e,setView:t,value:r,previousMonth:n,nextMonth:o,previousYear:i,nextYear:s,previousDecade:l,nextDecade:c,goBackProps:d,goNextProps:f,changeViewProps:p})=>{const h=e==="month",b=e==="year",w=e==="decade",y=()=>{if(w)return l();if(b)return i();n()},C=()=>{if(w)return c();if(b)return s();o()},x=()=>{if(h)return t("year");if(b)return t("decade")},P=()=>w?S():b?zt(r,"yyyy"):zt(r,"MMMM yyyy",{locale:Az}),S=()=>{if(!r)return"";const _=zS({start:a_(r),end:GS(r)}),T=lt.first(_),A=lt.last(_);return`${zt(T,"yyyy")} - ${zt(A,"yyyy")}`},D=R.useMemo(P,[r,e]);return g.jsx(g.Fragment,{children:g.jsxs("div",{className:"flex items-center justify-between","data-slot":"calendar-navigation",children:[g.jsxs(tr,{onClick:y,size:"icon",variant:"ghost",className:"border w-6 opacity-50 hover:opacity-100","data-slot":"calendar-navigation-back",...d,children:[g.jsx(zv,{className:"h-4 w-4","data-slot":"calendar-navigation-back-icon"}),g.jsx("span",{className:"sr-only",children:"Ir a anterior"})]}),g.jsx("button",{onClick:x,disabled:w,...p,type:"button",className:le("font-semibold pb-px text-gray-900 text-lg text-blue-bell select-none min-w-[60%] capitalize",p?.className),"data-slot":"calendar-navigation-label",children:D}),g.jsxs(tr,{onClick:C,size:"icon",variant:"ghost",className:"border w-6 opacity-50 hover:opacity-100","data-slot":"calendar-navigation-next",...f,children:[g.jsx(ic,{className:"h-4 w-4","data-slot":"calendar-navigation-next-icon"}),g.jsx("span",{className:"sr-only",children:"Ir a siguiente"})]})]})})};function Fu(e){return!!(e&&typeof e=="object"&&"start"in e&&"end"in e)}function Nz(e,t){return{selectMultipleDate:o=>{if(!e)return t([o]);const i=lt.findIndex(e,l=>ai(l,o));if(i===-1)return t([...e,o]);const s=[...e.slice(0,i),...e.slice(i+1)];t(s)},isMultipleSelected:o=>lt.isArray(e)&&e.some(i=>ai(i,o))}}function Iz(e,t,r){const n=c=>{if(e?.start){const{start:f,end:p}=e;if(QH(c,f)||f&&p){t({start:c,end:void 0});return}if(o(f,c))return;t({start:f,end:c})}else t({start:c,end:void 0})},o=(c,d)=>!r||!c||!d?!1:US({start:Po(c),end:d}).some(h=>r(h));return{selectRangeDate:n,isInRange:c=>{if(!Fu(e)||!e)return!1;const{start:d,end:f}=e;return d&&!f?ai(c,d):!d||!f?!1:ZU(c,{start:Po(d),end:Po(f)})},isFirstDayFromRange:c=>!e||!Fu(e)||!e.start?!1:ai(c,e.start),isLastDayFromRange:c=>!e||!Fu(e)||!e.end?!1:ai(c,e.end)}}function kz(e,t){return{selectSingleDate:o=>{t(o)},isSingleSelected:o=>fi(e)&&ai(o,e)}}const s_=R.createContext({defaultStartDate:new Date,mode:"single",isSingleMode:!1,isRangeMode:!1,selected:null,selectDate:()=>{},isSelected:()=>!1,isFirstDayFromRange:()=>!1,isLastDayFromRange:()=>!1,isInRange:()=>!1});function Lz(e){const{mode:t,value:r,defaultValue:n,onChange:o,disabled:i}=e,s=t==="single",l=t==="range",c=t==="multiple",[d=null,f]=ut({prop:r,onChange:o,defaultProp:n}),{selectSingleDate:p,isSingleSelected:h}=kz(fi(d)?d:void 0,f),{selectRangeDate:b,isInRange:w,...y}=Iz(Fu(d)?d:void 0,f,i),{selectMultipleDate:C,isMultipleSelected:x}=Nz(lt.isArray(d)?d:void 0,f),P=_=>{if(s)return p(_);if(l)return b(_);if(c)return C(_)},S=_=>s?h(_):l?w(_):c?x(_):!1;return{defaultStartDate:fi(d)?d:lt.isArray(d)?d[0]:Fu(d)&&d.start?d.start:new Date,isSingleMode:s,isRangeMode:l,selected:d,isSelected:S,selectDate:P,isInRange:w,mode:t,...y}}const Fz=({day:e,navigationDate:t,className:r,...n})=>{const{isSelected:o,mode:i,selected:s,isRangeMode:l,selectDate:c,isFirstDayFromRange:d,isLastDayFromRange:f}=R.useContext(s_),p=R.useMemo(()=>o(e),[e,s]),h=!p&&!YU(e,t),b=!p&&XW(e);return g.jsx("button",{...n,onClick:()=>c(e),type:"button","data-slot":"calendar-day","data-state-mode":i,"data-state-today":XU(e)||void 0,"data-state-selected":p||void 0,"data-state-different-month":h||void 0,"data-state-weekend":b||void 0,"data-state-range-mode":l||void 0,"data-state-first-day":d(e)||void 0,"data-state-last-day":f(e)||void 0,"data-state-in-range":l&&p||void 0,className:le("mx-auto flex pt-px rounded-md items-center justify-center w-full aspect-square hover:bg-accent","data-[state-today]:text-error","data-[state-selected]:bg-primary data-[state-selected]:!text-primary-foreground data-[state-selected]:hover:bg-primary/80","data-[state-different-month]:opacity-50 data-[state-weekend=true]:opacity-50","data-[state-in-range]:not-data-[state-first-day]:not-data-[state-last-day]:rounded-none","data-[state-first-day]:rounded-l-full","data-[state-last-day]:rounded-r-full",r),children:g.jsx("time",{dateTime:zt(e,"yyyy-MM-dd"),children:zt(e,"d")})})},qz=({value:e,onChange:t})=>{const r=()=>zS({start:a_(e),end:GS(e)}),n=i=>{const s=JU(e,parseInt(zt(i,"yyyy")));t(s)},o=R.useMemo(r,[e]);return g.jsx("div",{className:"grid grid-cols-3 grow","data-slot":"calendar-decade-view",children:o.map((i,s)=>g.jsx(tr,{onClick:()=>n(i),className:"h-full rounded-none",type:"button",variant:"ghost","data-slot":"calendar-decade-view-year",children:zt(i,"yyyy")},s))})},ov=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],l_=["Lunes","Martes","Miercoles","Jueves","Viernes","Sabado","Domingo"],jz=e=>g.jsx("div",{...e,className:le("grid grid-cols-7 font-semibold mt-2 text-xs leading-6 text-center py-1 bg-blue-bell/40 select-none",e.className),"data-slot":"calendar-week-days",children:l_.map(t=>g.jsx("abbr",{"aria-label":t,"data-slot":"calendar-week-day",children:lt.at(t,0)},t))}),Bz=({navigationDate:e,disabled:t,weekDaysClassName:r,weekDaysProps:n,dayClassName:o,dayProps:i})=>{const s=()=>US({start:Yn(e,{weekStartsOn:1}),end:oH(rH(e),{weekStartsOn:1})}),l=R.useMemo(s,[e]);return g.jsxs(g.Fragment,{children:[g.jsx(jz,{className:r,...n}),g.jsx("div",{className:"grid grid-cols-7 mt-2 text-sm","data-slot":"calendar-month-view",children:l.map((c,d)=>g.jsx(Fz,{day:c,className:o,...i,navigationDate:e,disabled:t?.(c)},d))})]})},Vz=({value:e,onChange:t})=>{const r=n=>{const o=QU(e,n);t(o)};return g.jsx("div",{className:"grid grid-cols-3 grow","data-slot":"calendar-year-view",children:ov.map(n=>g.jsx(tr,{type:"button",className:"h-full rounded",onClick:()=>r(ov.indexOf(n)),variant:"ghost","data-slot":"calendar-year-view-month",children:g.jsx("abbr",{"aria-label":`${n} ${zt(e,"yyyy")}`,children:n})},n))})};function Kz(e=gh()){const[t,r]=R.useState({month:zt(e||gh(),"MM"),year:zt(e||gh(),"yyyy")}),n=R.useMemo(()=>zU(`${t.month}-${t.year}`,"MM-yyyy",new Date),[t]),o=h=>{r({...t,month:zt(h,"MM")})},i=h=>{r({...t,year:zt(h,"yyyy")})};return{navigationDate:n,setMonth:o,setYear:i,previousMonth:()=>{const h=tv(n,-1);r({month:zt(h,"MM"),year:zt(h,"yyyy")})},nextMonth:()=>{const h=tv(n,1);r({month:zt(h,"MM"),year:zt(h,"yyyy")})},previousYear:()=>{const h=qd(n,-1);i(h)},nextYear:()=>{const h=qd(n,1);i(h)},previousDecade:()=>{const h=qd(n,-10);i(h)},nextDecade:()=>{const h=qd(n,10);i(h)}}}const u_=e=>{const{disabled:t,initialView:r="month",view:n,onChangeView:o,initialDate:i,goBackProps:s,goNextProps:l,changeViewProps:c}=e,d=Lz(e),{defaultStartDate:f}=d,{navigationDate:p,setMonth:h,setYear:b,...w}=Kz(i||f),[y=r,C]=ut({prop:n,onChange:x=>o?.(x,p),defaultProp:r});return g.jsx(s_.Provider,{value:d,children:g.jsxs("div",{"data-slot":"calendar",className:le("w-60 min-h-64 flex flex-col border rounded-md p-2",e.className),children:[g.jsx(Oz,{view:y,setView:C,value:p,goBackProps:s,goNextProps:l,changeViewProps:c,...w}),y==="month"&&g.jsx(Bz,{...e.monthViewProps,navigationDate:p,disabled:t}),y==="year"&&g.jsx(Vz,{value:p,onChange:x=>{h(x),C("month")}}),y==="decade"&&g.jsx(qz,{value:p,onChange:x=>{b(x),C("year")}})]})})},Wz=({className:e,...t})=>g.jsx("div",{className:le("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t,"data-slot":"card"}),Hz=({className:e,...t})=>g.jsx("div",{className:le("flex flex-col space-y-1 p-6",e),...t,"data-slot":"card-header"}),Uz=({className:e,...t})=>g.jsx("h3",{className:le("text-2xl font-semibold leading-none tracking-tight",e),...t,"data-slot":"card-title"}),zz=({className:e,...t})=>g.jsx("p",{className:le("text-sm text-muted-foreground",e),...t,"data-slot":"card-description"}),Gz=({className:e,...t})=>g.jsx("div",{className:le("p-6 pt-0",e),...t,"data-slot":"card-content"}),Yz=({className:e,...t})=>g.jsx("div",{className:le("flex items-center p-6 pt-0",e),...t,"data-slot":"card-footer"}),Xz=({className:e,...t})=>g.jsx("div",{className:le("flex items-center justify-center",e),...t,"data-slot":"center"}),pc=({className:e,...t})=>g.jsx("label",{className:le("text-sm font-medium select-none leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),"data-slot":"label",...t}),iv=({when:e,...t})=>g.jsx(Tr,{present:e,children:g.jsx(sc,{...t,"data-state":e?"open":"closed","data-slot":"show"})}),Zz=({checked:e,onChange:t,defaultChecked:r=!1,indeterminate:n,defaultIndeterminate:o=!1,onIndeterminateChange:i,className:s,size:l=16,children:c,containerClassName:d,containerProps:f,...p})=>{const h=R.useId(),b=R.useRef(null),[w,y]=ut({defaultProp:r,prop:e,onChange:t}),[C,x]=ut({defaultProp:o,prop:n,onChange:i});R.useEffect(()=>{b.current&&(b.current.indeterminate=C)},[C]);const P=_=>{_.stopPropagation(),!p.disabled&&(C?(x(!1),y(!0)):y(T=>!T))},S=C?"indeterminate":w?"checked":"unchecked",D=p.id??h;return g.jsxs("div",{...f,className:le("flex gap-x-2 items-center",d),"data-slot":"checkbox",children:[g.jsxs("button",{disabled:p.disabled,onClick:P,"data-state":S,type:"button",style:{width:l,height:l},className:le("peer aspect-square flex gap-2 shrink-0 rounded-(--radius-checkbox) border border-(--color-checkbox) ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","transition-colors","data-[state=checked]:bg-(--color-checkbox) data-[state=checked]:text-primary-foreground data-[state=checked]:border-transparent","data-[state=indeterminate]:bg-(--color-checkbox) data-[state=indeterminate]:text-primary-foreground data-[state=indeterminate]:border-transparent","data-[state=unchecked]:bg-background data-[state=unchecked]:text-muted-foreground data-[state=unchecked]:border-input",s),"data-slot":"checkbox-trigger",children:[g.jsx(iv,{when:C,children:g.jsx(m5,{className:le("pt-[2px] w-full h-full opacity-0","open:fade-in-0 open:zoom-in-50 open:opacity-100 open:duration-200","closed:fade-out-0 closed:zoom-out-50 closed:opacity-0")})}),g.jsx(iv,{when:!C&&!!w,children:g.jsx(of,{className:le("pt-[2px] w-full h-full opacity-0","open:fade-in-0 open:zoom-in-50 open:opacity-100 open:duration-200","closed:fade-out-0 closed:zoom-out-50 closed:opacity-0")})}),g.jsx("input",{...p,ref:b,id:D,tabIndex:-1,checked:w,onChange:_=>y(_.currentTarget.checked),type:"checkbox",className:"sr-only","aria-hidden":!0})]}),c&&g.jsx(pc,{htmlFor:D,"data-slot":"checkbox-label",children:c})]})};function Qz({items:e=[],valueKey:t="value",labelKey:r="label",placeholder:n="Seleccionar",searchPlaceholder:o="Buscar...",emptyMessage:i="No se encontraron resultado",searchProps:s,className:l,triggerProps:c,itemProps:d,itemClassName:f,contentProps:p,contentClassName:h,value:b,onChange:w,defaultValue:y,renderOption:C=S=>S?.[r],commandProps:x,...P}){const[S,D]=ut({prop:P.open,onChange:P.onOpenChange,defaultProp:P.defaultOpen||!1}),[_,T]=ut({prop:b,onChange:J=>{if(!w)return;const N=e.find(K=>K[t]===J);w?.(N?.[t],N)},defaultProp:y}),[A,M]=ut({prop:P?.search,defaultProp:P?.searchDefaultValue||"",onChange:P?.onSearchChange}),U=v.useMemo(()=>e.find(J=>J[t]===_),[_]);return g.jsxs(Sc,{open:S,onOpenChange:D,"data-slot":"combobox",children:[g.jsx(_c,{asChild:!0,"data-slot":"combobox-trigger",children:g.jsxs(tr,{...P,...c,variant:"outline",role:"combobox","aria-expanded":S,className:le("font-normal w-full items-center justify-between border-input px-3 hover:bg-background",l),children:[g.jsx("span",{className:"truncate",children:U?C(U):n}),g.jsx(af,{className:"ml-2 h-4 w-4 shrink-0 opacity-50","data-slot":"combobox-trigger-icon"})]})}),g.jsx(Tc,{...p,className:le("p-1",h),asChild:!0,matchTriggerWidth:!0,"data-slot":"combobox-content",children:g.jsxs(uc,{...x,children:[g.jsx(Uf,{value:A,onValueChange:M,placeholder:o,autoFocus:!0,"data-slot":"combobox-input",...s}),g.jsx(Gf,{"data-slot":"combobox-empty",children:i}),g.jsx(zf,{"data-slot":"combobox-list",children:e.map(J=>R.createElement(Ku,{className:f,"data-slot":"combobox-item",...d,key:J[t],value:J[t],onSelect:()=>{const N=J[t];T(N===_?"":N),D(!1)}},C(J)))})]})})]})}const Jz="dd/MM/yyyy",Tu=e=>fi(e)?zt(e,Jz):"",eG=e=>{const t=e.trim();if(!t)return null;const r=/^(\d{1,2})\/(\d{1,2})\/(\d{1,4})$/.exec(t);if(!r)return null;const[,n,o,i]=r,s=Number(n),l=Number(o),c=i;let d=Number(c);if(Number.isNaN(s)||Number.isNaN(l)||Number.isNaN(d)||(c.length<=2&&(d=2e3+d),s<1||s>31||l<1||l>12))return null;const f=new Date(d,l-1,s);return f.getFullYear()!==d||f.getMonth()!==l-1||f.getDate()!==s?null:f},tG=(e,t)=>{const r=(t.lastKey==="Backspace"||t.lastKey==="Delete")&&e.length<t.previousValue.length,n=e.includes("/"),o=e.trim().endsWith("/");if((e.match(/\//g)??[]).length>=2){const C=e.split("/"),x=(C[0]??"").replace(/\D/g,"").slice(0,2),P=(C[1]??"").replace(/\D/g,"").slice(0,2),S=(C[2]??"").replace(/\D/g,"").slice(0,4);return!x&&!P&&!S?"":`${x}/${P}/${S}`}const s=e.replace(/\D/g,"").slice(0,8);if(!s)return"";if(s.length<=2){let C=s;if(s.length===1&&(n||o)&&!r){let x=Number(C);Number.isNaN(x)&&(x=1),x<1&&(x=1),x>31&&(x=31),C=x.toString().padStart(2,"0"),C+="/"}else if(s.length===2&&!r){let x=Number(C);Number.isNaN(x)&&(x=1),x<1&&(x=1),x>31&&(x=31),C=x.toString().padStart(2,"0"),C+="/"}return C}const l=s.slice(0,2);let c=Number(l);Number.isNaN(c)&&(c=1),c<1&&(c=1),c>31&&(c=31);const d=c.toString().padStart(2,"0"),f=s.slice(2,4),p=s.slice(4);let h="";if(f.length===0)h="";else if(f.length===1&&p.length===0){const C=o&&!r&&f.length===1;if(f==="0"||f==="1")if(C){let x=Number(f);Number.isNaN(x)&&(x=1),x<1&&(x=1),x>12&&(x=12),h=x.toString().padStart(2,"0")}else h=f;else{let x=Number(f);Number.isNaN(x)&&(x=1),x<1&&(x=1),x>12&&(x=12),h=x.toString().padStart(2,"0")}}else{let C=Number(f);Number.isNaN(C)&&(C=1),C<1&&(C=1),C>12&&(C=12),h=C.toString().padStart(2,"0")}const b=`${d}/${h}`,w=!p&&h.length===2&&!r;return p?`${b}/${p}`:w?`${b}/`:b},rG=e=>{const{date:t,onDateChange:r,disabledDate:n}=e,[o,i]=R.useState(""),s=R.useRef(null),l=R.useRef("");R.useEffect(()=>{const w=Tu(t??null);i(w),l.current=w},[t]);const c=()=>{const w=o.trim();if(!w){r(null),i(""),l.current="";return}const y=eG(w);if(!y){r(null),i(""),l.current="";return}if(n?.(y)){const x=Tu(t??null);i(x),l.current=x;return}r(y);const C=Tu(y);i(C),l.current=C};return{inputValue:o,handleChange:w=>{const y=w.target.value,C={lastKey:s.current,previousValue:l.current},x=tG(y,C);i(x),l.current=x},handleBlur:()=>{c()},handleKeyDown:w=>{if(s.current=w.key,w.key==="Enter"){w.preventDefault(),c();return}if(w.key==="Escape"){w.preventDefault();const y=Tu(t??null);i(y),l.current=y}},clear:()=>{r(null),i(""),l.current=""},setFromExternalDate:w=>{r(w);const y=Tu(w??null);i(y),l.current=y}}},nG=(e={})=>{const{disabled:t}=e,[r,n]=R.useState(!1),o=R.useRef(null),i=R.useCallback(s=>{if(!t){if(s.key===" "||s.key==="Spacebar"){s.preventDefault(),n(!0);return}s.key==="Escape"&&(n(!1),requestAnimationFrame(()=>{o.current?.focus()}))}},[t]);return{open:r,setOpen:n,handleInputKeyDown:i,inputRef:o}},oG=e=>{const{placeholder:t,value:r,onChange:n,defaultValue:o,className:i,disabledDate:s,renderFooter:l,disabled:c,hideFooter:d,...f}=e,[p,h]=ut({prop:r,onChange:K=>n?.(K??null),defaultProp:o??null}),{inputValue:b,handleChange:w,handleBlur:y,handleKeyDown:C,clear:x,setFromExternalDate:P}=rG({date:p??null,onDateChange:K=>h(K),disabledDate:s}),{open:S,setOpen:D,handleInputKeyDown:_,inputRef:T}=nG({disabled:c}),A=K=>{C(K),_(K)},M=()=>{P(null),x()},U=()=>{const K=new Date;s?.(K)||P(K)},J=()=>g.jsxs("span",{className:"flex w-full p-1 justify-between",children:[g.jsx(tr,{variant:"ghost",onClick:M,children:"Borrar"}),g.jsx(tr,{variant:"ghost",onClick:U,disabled:s?.(new Date),children:"Hoy"})]}),N=()=>d?null:l?l({mode:"single",value:p,clear:M,selectToday:U,setValue:K=>{const W=K&&fi(K)?K:null;h(W),P(W)}}):J();return g.jsxs(Sc,{"data-slot":"date-picker",open:S,onOpenChange:D,children:[g.jsxs("div",{className:le("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 items-center text-sm ring-offset-background placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",!p&&"text-muted-foreground",i,"field-error"),onClick:K=>{K.target===K.currentTarget&&T.current?.focus()},children:[g.jsx("input",{type:"text",value:b,onChange:w,onBlur:y,onKeyDown:A,placeholder:t??"dd/mm/yyyy",disabled:c,className:"flex-1 bg-transparent outline-none text-start truncate pt-px","aria-label":t,ref:T,...f}),g.jsx(_c,{asChild:!0,"data-slot":"date-picker-trigger",children:g.jsxs("button",{type:"button",disabled:c,className:"flex items-center justify-center text-muted-foreground hover:text-foreground p-1",children:[g.jsx(qj,{"data-slot":"date-picker-icon"}),g.jsx("span",{className:"sr-only",children:"Seleccionar fecha"})]})})]}),g.jsxs(Tc,{className:"w-auto p-0",align:"start","data-slot":"date-picker-content",children:[g.jsx(u_,{className:"border-none",mode:"single",value:p,onChange:K=>{if(!fi(K)){P(null);return}s?.(K)||(P(K),D(!1))},disabled:s}),g.jsx("div",{className:"p-2","data-slot":"date-picker-footer",children:N()})]})]})},c_=e=>{const{className:t,orientation:r="horizontal"}=e;return g.jsx("hr",{...e,"aria-orientation":r,className:le("shrink-0 bg-input",r==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),"data-slot":"divider"})},iG=({onDrop:e,onError:t,allowedExtensions:r=[],maxFileSize:n=5*1024*1024,maxFiles:o=1/0})=>{const[i,s]=R.useState(!1),l=R.useCallback(h=>{h.preventDefault(),h.stopPropagation()},[]),c=R.useCallback(h=>{h.preventDefault(),h.stopPropagation(),s(!0)},[]),d=R.useCallback(h=>{h.preventDefault(),h.stopPropagation(),s(!1)},[]),f=h=>{const[b=[],w=[],y=[]]=h.reduce(([C,x,P],S)=>r.length>0&&!r.includes(S.type)?(C.push(S),P.push({file:S,errorMessage:"Extensión no permitida",errorCode:"INVALID_EXTENSION"}),[C,x,P]):S.size>n?(C.push(S),P.push({file:S,errorMessage:"Archivo demasiado grande",errorCode:"FILE_TOO_LARGE"}),[C,x,P]):o&&o<x.length+1?(C.push(S),P.push({file:S,errorMessage:"Límite de archivos excedido",errorCode:"MAX_FILES_EXCEEDED"}),[C,x,P]):(x.push(S),[C,x,P]),[[],[],[]]);return y.length>0&&t&&t(y),[b,w,y]},p=R.useCallback(h=>{h.preventDefault(),h.stopPropagation(),s(!1);const b=Array.from(h.dataTransfer.files),[w=[],y=[]]=f(b);e(y,w)},[r,n,o,e,t]);return{isDragActive:i,validateFiles:f,dropzoneProps:{onDragOver:l,onDragEnter:c,onDragLeave:d,onDrop:p}}},d_=R.createContext(null),wg=()=>{const e=R.useContext(d_);if(!e)throw new Error("useUploadContext must be used within a UploadContextProvider");return e},f_=({onFileAdd:e,onFileRemove:t,onChangeFiles:r,files:n,maxFiles:o=1,allowedExtensions:i=[],maxFileSize:s=5*1024*1024,multiple:l,children:c,onError:d,...f})=>{const[p=[],h]=ut({defaultProp:[],prop:n,onChange:r}),[b,w]=R.useState([]),{isDragActive:y,validateFiles:C,dropzoneProps:x}=iG({onDrop:(D,_)=>{h([...p,...D]),w(T=>[...T,..._]),e?.(D)},allowedExtensions:i,maxFileSize:s,maxFiles:o,onError:d}),P=D=>{const[_=[],T=[]]=C(D);if(o===1||!l){h(T.slice(0,1)),w([..._,...T.slice(1)]),e?.(T.slice(0,1));return}const A=o-p.length;if(A<=0){w(J=>[...J,...T]),e?.([]);return}const M=T.slice(0,A),U=T.slice(A);h([...p,...M]),w(J=>[...J,..._,...U]),e?.(M)},S=(D,_)=>{_==="accepted"?h(p.filter((T,A)=>A!==D)):w(T=>T.filter((A,M)=>M!==D)),t?.(D,_)};return g.jsx(d_.Provider,{value:{files:p,rejectedFiles:b,handleFileAdd:P,handleFileRemove:S,inputProps:{accept:i.join(","),multiple:l},isDragActive:y,dropzoneProps:x},children:g.jsx("div",{...f,"data-slot":"upload",children:c})})},p_=({asChild:e,...t})=>{const{handleFileAdd:r,inputProps:n,dropzoneProps:o,isDragActive:i}=wg(),s=R.useRef(null),l=e?sc:"button";return g.jsxs(g.Fragment,{children:[g.jsx(l,{"data-slot":"upload-trigger",...t,...o,"data-drag-active":i||!1,onClick:c=>{t.onClick?.(c),s.current?.click()}}),g.jsx("input",{type:"file",className:"hidden","data-slot":"upload-input",...n,ref:s,onChange:c=>r(Array.from(c.target.files||[]))})]})},m_=({className:e,...t})=>g.jsx("div",{...t,className:le("mt-2 space-y-2",e),"data-slot":"upload-content"}),h_=({files:e,handleFileRemove:t,fileType:r,children:n,renderFile:o,...i})=>e.length===0?null:g.jsxs("div",{className:"mt-2 space-y-2",...i,"data-slot":"upload-files-list",children:[n,e.map((s,l)=>o?o(s,()=>t(l,r)):g.jsx(b_,{file:s,onRemove:()=>t(l,r)},s.name))]}),v_=e=>{const{files:t,handleFileRemove:r}=wg();return g.jsx(h_,{"data-slot":"upload-accepted-files",files:t,handleFileRemove:r,fileType:"accepted",...e})},g_=e=>{const{rejectedFiles:t,handleFileRemove:r}=wg();return g.jsx(h_,{"data-slot":"upload-rejected-files",files:t,handleFileRemove:r,fileType:"rejected",...e})},b_=({file:e,onRemove:t,className:r,renderIcon:n,...o})=>g.jsxs("div",{className:le("flex items-center gap-2 mb-2",r),...o,"data-slot":"upload-item",children:[n?.(e),e.name,g.jsx(tr,{variant:"ghost",size:"icon",type:"button",className:"h-6 w-6",onClick:t,"data-slot":"upload-item-remove",children:g.jsx(jf,{"data-slot":"upload-item-remove-icon"})})]}),aG=({onFileAdd:e,onFileRemove:t,onChangeFiles:r=()=>{},files:n,maxFiles:o=1,allowedExtensions:i=[],maxFileSize:s=5*1024*1024,multiple:l,renderAcceptedFile:c,renderRejectedFile:d,showRejected:f=!1,className:p,icon:h=i5,iconSize:b=40,onError:w,...y})=>{const C=R.useMemo(()=>i.map(x=>x.split("/")?.[1]).join(", "),[i]);return g.jsxs(f_,{onFileAdd:e,onFileRemove:t,files:n,onChangeFiles:r,maxFiles:o,allowedExtensions:i,maxFileSize:s,multiple:l?!0:void 0,className:le("w-full",p),onError:w,...y,children:[g.jsx(p_,{asChild:!0,children:g.jsxs("div",{className:le("w-full min-h-[150px] border-2 border-dashed rounded-lg border-muted p-4","hover:bg-muted/50 data-[drag-active=true]:border-primary data-[drag-active=true]:bg-primary/10","transition-colors flex flex-col items-center justify-center gap-4","pointer-events-auto"),children:[g.jsx(h,{className:"text-muted-foreground pointer-events-none",style:{width:b,height:b}}),g.jsxs("div",{className:"text-center text-muted-foreground pointer-events-none",children:[g.jsx("p",{children:"Arrastra y suelta archivos aquí o haz clic para seleccionar"}),i.length>0&&g.jsxs("p",{className:"text-sm",children:["Tipos permitidos: ",C]}),g.jsxs("p",{className:"text-sm",children:["Tamaño máximo: ",Math.floor(s/1024/1024),"MB"]})]})]})}),g.jsxs(m_,{children:[g.jsx(v_,{renderFile:c}),f&&g.jsx(g_,{renderFile:d})]})]})},It={JPEG:"image/jpeg",JPG:"image/jpg",PNG:"image/png",GIF:"image/gif",WEBP:"image/webp",SVG:"image/svg+xml",PDF:"application/pdf",DOC:"application/msword",DOCX:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",XLS:"application/vnd.ms-excel",XLSX:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",PPT:"application/vnd.ms-powerpoint",PPTX:"application/vnd.openxmlformats-officedocument.presentationml.presentation",TXT:"text/plain",CSV:"text/csv",ZIP:"application/zip",RAR:"application/x-rar-compressed",MP3:"audio/mpeg",WAV:"audio/wav",MP4:"video/mp4",WEBM:"video/webm",JSON:"application/json",XML:"application/xml"},sG={IMAGES:[It.JPEG,It.JPG,It.PNG,It.GIF,It.WEBP,It.SVG],DOCUMENTS:[It.PDF,It.DOC,It.DOCX,It.XLS,It.XLSX,It.PPT,It.PPTX],COMPRESSED:[It.ZIP,It.RAR],AUDIO:[It.MP3,It.WAV],VIDEO:[It.MP4,It.WEBM]},lG=eo([],{variants:{size:{sm:"text-[14px]",md:"text-[16px]",lg:"text-[18px]",xl:"text-[20px]","2xl":"text-[24px]","3xl":"text-[28px]","4xl":"text-[32px]","5xl":"text-[36px]","6xl":"text-[40px]"},weight:{normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"}},defaultVariants:{size:"xl",weight:"semibold"}}),y_=({className:e,size:t,weight:r,as:n,...o})=>{const i=n||"h2";return g.jsx(i,{className:le(lG({size:t,weight:r}),e),...o,"data-slot":"heading","data-size":t,"data-weight":r})},uG=({icon:e=g.jsx(d5,{className:"w-12 h-12"}),title:t="No hay resultados",description:r,className:n,children:o,...i})=>g.jsxs("div",{className:le("flex flex-col gap-2 justify-center items-center",n),"data-slot":"empty-state",...i,children:[g.jsx("div",{className:"text-muted-foreground","data-slot":"empty-state-icon",children:e}),g.jsx(y_,{className:"empty:hidden","data-slot":"empty-state-title",children:t}),g.jsx("p",{className:"py-1 text-sm text-center text-muted-foreground empty:hidden","data-slot":"empty-state-description",children:r}),o]}),cG=({label:e,labelClassName:t,labelProps:r,error:n,errorClassName:o,errorProps:i,children:s,className:l,...c})=>g.jsxs("div",{...c,className:le("flex flex-col gap-1",l),"data-slot":"field",children:[g.jsx(pc,{className:le("empty:hidden",t),...r,"data-slot":"field-label",children:e}),s,g.jsx("p",{"data-slot":"field-error",className:le("text-sm font-medium text-error empty:hidden",o),...i,children:n})]});var mc=e=>e.type==="checkbox",ri=e=>e instanceof Date,vr=e=>e==null;const x_=e=>typeof e=="object";var Ft=e=>!vr(e)&&!Array.isArray(e)&&x_(e)&&!ri(e),w_=e=>Ft(e)&&e.target?mc(e.target)?e.target.checked:e.target.value:e,dG=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,E_=(e,t)=>e.has(dG(t)),fG=e=>{const t=e.constructor&&e.constructor.prototype;return Ft(t)&&t.hasOwnProperty("isPrototypeOf")},Eg=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Vt(e){let t;const r=Array.isArray(e),n=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(Eg&&(e instanceof Blob||n))&&(r||Ft(e)))if(t=r?[]:Object.create(Object.getPrototypeOf(e)),!r&&!fG(e))t=e;else for(const o in e)e.hasOwnProperty(o)&&(t[o]=Vt(e[o]));else return e;return t}var Jf=e=>/^\w*$/.test(e),St=e=>e===void 0,Cg=e=>Array.isArray(e)?e.filter(Boolean):[],Rg=e=>Cg(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Ce=(e,t,r)=>{if(!t||!Ft(e))return r;const n=(Jf(t)?[t]:Rg(t)).reduce((o,i)=>vr(o)?o:o[i],e);return St(n)||n===e?St(e[t])?r:e[t]:n},Rr=e=>typeof e=="boolean",ot=(e,t,r)=>{let n=-1;const o=Jf(t)?[t]:Rg(t),i=o.length,s=i-1;for(;++n<i;){const l=o[n];let c=r;if(n!==s){const d=e[l];c=Ft(d)||Array.isArray(d)?d:isNaN(+o[n+1])?{}:[]}if(l==="__proto__"||l==="constructor"||l==="prototype")return;e[l]=c,e=e[l]}};const bf={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Jr={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Kn={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Pg=R.createContext(null);Pg.displayName="HookFormContext";const hc=()=>R.useContext(Pg),pG=e=>{const{children:t,...r}=e;return R.createElement(Pg.Provider,{value:r},t)};var C_=(e,t,r,n=!0)=>{const o={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(o,i,{get:()=>{const s=i;return t._proxyFormState[s]!==Jr.all&&(t._proxyFormState[s]=!n||Jr.all),r&&(r[s]=!0),e[s]}});return o};const Sg=typeof window<"u"?R.useLayoutEffect:R.useEffect;function mG(e){const t=hc(),{control:r=t.control,disabled:n,name:o,exact:i}=e||{},[s,l]=R.useState(r._formState),c=R.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Sg(()=>r._subscribe({name:o,formState:c.current,exact:i,callback:d=>{!n&&l({...r._formState,...d})}}),[o,n,i]),R.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),R.useMemo(()=>C_(s,r,c.current,!1),[s,r])}var Sr=e=>typeof e=="string",av=(e,t,r,n,o)=>Sr(e)?(n&&t.watch.add(e),Ce(r,e,o)):Array.isArray(e)?e.map(i=>(n&&t.watch.add(i),Ce(r,i))):(n&&(t.watchAll=!0),r),sv=e=>vr(e)||!x_(e);function en(e,t,r=new WeakSet){if(sv(e)||sv(t))return Object.is(e,t);if(ri(e)&&ri(t))return e.getTime()===t.getTime();const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const i of n){const s=e[i];if(!o.includes(i))return!1;if(i!=="ref"){const l=t[i];if(ri(s)&&ri(l)||Ft(s)&&Ft(l)||Array.isArray(s)&&Array.isArray(l)?!en(s,l,r):!Object.is(s,l))return!1}}return!0}function hG(e){const t=hc(),{control:r=t.control,name:n,defaultValue:o,disabled:i,exact:s,compute:l}=e||{},c=R.useRef(o),d=R.useRef(l),f=R.useRef(void 0),p=R.useRef(r),h=R.useRef(n);d.current=l;const[b,w]=R.useState(()=>{const D=r._getWatch(n,c.current);return d.current?d.current(D):D}),y=R.useCallback(D=>{const _=av(n,r._names,D||r._formValues,!1,c.current);return d.current?d.current(_):_},[r._formValues,r._names,n]),C=R.useCallback(D=>{if(!i){const _=av(n,r._names,D||r._formValues,!1,c.current);if(d.current){const T=d.current(_);en(T,f.current)||(w(T),f.current=T)}else w(_)}},[r._formValues,r._names,i,n]);Sg(()=>((p.current!==r||!en(h.current,n))&&(p.current=r,h.current=n,C()),r._subscribe({name:n,formState:{values:!0},exact:s,callback:D=>{C(D.values)}})),[r,s,n,C]),R.useEffect(()=>r._removeUnmounted());const x=p.current!==r,P=h.current,S=R.useMemo(()=>{if(i)return null;const D=!x&&!en(P,n);return x||D?y():null},[i,x,n,P,y]);return S!==null?S:b}function vG(e){const t=hc(),{name:r,disabled:n,control:o=t.control,shouldUnregister:i,defaultValue:s,exact:l=!0}=e,c=E_(o._names.array,r),d=R.useMemo(()=>Ce(o._formValues,r,Ce(o._defaultValues,r,s)),[o,r,s]),f=hG({control:o,name:r,defaultValue:d,exact:l}),p=mG({control:o,name:r,exact:l}),h=R.useRef(e),b=R.useRef(void 0),w=R.useRef(o.register(r,{...e.rules,value:f,...Rr(e.disabled)?{disabled:e.disabled}:{}}));h.current=e;const y=R.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Ce(p.errors,r)},isDirty:{enumerable:!0,get:()=>!!Ce(p.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!Ce(p.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!Ce(p.validatingFields,r)},error:{enumerable:!0,get:()=>Ce(p.errors,r)}}),[p,r]),C=R.useCallback(D=>w.current.onChange({target:{value:w_(D),name:r},type:bf.CHANGE}),[r]),x=R.useCallback(()=>w.current.onBlur({target:{value:Ce(o._formValues,r),name:r},type:bf.BLUR}),[r,o._formValues]),P=R.useCallback(D=>{const _=Ce(o._fields,r);_&&D&&(_._f.ref={focus:()=>D.focus&&D.focus(),select:()=>D.select&&D.select(),setCustomValidity:T=>D.setCustomValidity(T),reportValidity:()=>D.reportValidity()})},[o._fields,r]),S=R.useMemo(()=>({name:r,value:f,...Rr(n)||p.disabled?{disabled:p.disabled||n}:{},onChange:C,onBlur:x,ref:P}),[r,n,p.disabled,C,x,P,f]);return R.useEffect(()=>{const D=o._options.shouldUnregister||i,_=b.current;_&&_!==r&&!c&&o.unregister(_),o.register(r,{...h.current.rules,...Rr(h.current.disabled)?{disabled:h.current.disabled}:{}});const T=(A,M)=>{const U=Ce(o._fields,A);U&&U._f&&(U._f.mount=M)};if(T(r,!0),D){const A=Vt(Ce(o._options.defaultValues,r,h.current.defaultValue));ot(o._defaultValues,r,A),St(Ce(o._formValues,r))&&ot(o._formValues,r,A)}return!c&&o.register(r),b.current=r,()=>{(c?D&&!o._state.action:D)?o.unregister(r):T(r,!1)}},[r,o,c,i]),R.useEffect(()=>{o._setDisabledField({disabled:n,name:r})},[n,r,o]),R.useMemo(()=>({field:S,formState:p,fieldState:y}),[S,p,y])}const gG=e=>e.render(vG(e));var _g=(e,t,r,n,o)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:o||!0}}:{},qu=e=>Array.isArray(e)?e:[e],sR=()=>{let e=[];return{get observers(){return e},next:o=>{for(const i of e)i.next&&i.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(i=>i!==o)}}),unsubscribe:()=>{e=[]}}};function R_(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const o=e[n],i=t[n];if(o&&Ft(o)&&i){const s=R_(o,i);Ft(s)&&(r[n]=s)}else e[n]&&(r[n]=i)}return r}var lr=e=>Ft(e)&&!Object.keys(e).length,Tg=e=>e.type==="file",tn=e=>typeof e=="function",yf=e=>{if(!Eg)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},P_=e=>e.type==="select-multiple",$g=e=>e.type==="radio",bG=e=>$g(e)||mc(e),bh=e=>yf(e)&&e.isConnected;function yG(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=St(e)?n++:e[t[n++]];return e}function xG(e){for(const t in e)if(e.hasOwnProperty(t)&&!St(e[t]))return!1;return!0}function kt(e,t){const r=Array.isArray(t)?t:Jf(t)?[t]:Rg(t),n=r.length===1?e:yG(e,r),o=r.length-1,i=r[o];return n&&delete n[i],o!==0&&(Ft(n)&&lr(n)||Array.isArray(n)&&xG(n))&&kt(e,r.slice(0,-1)),e}var wG=e=>{for(const t in e)if(tn(e[t]))return!0;return!1};function S_(e){return Array.isArray(e)||Ft(e)&&!wG(e)}function lv(e,t={}){for(const r in e){const n=e[r];S_(n)?(t[r]=Array.isArray(n)?[]:{},lv(n,t[r])):St(n)||(t[r]=!0)}return t}function Qi(e,t,r){r||(r=lv(t));for(const n in e){const o=e[n];if(S_(o))St(t)||sv(r[n])?r[n]=lv(o,Array.isArray(o)?[]:{}):Qi(o,vr(t)?{}:t[n],r[n]);else{const i=t[n];r[n]=!en(o,i)}}return r}const lR={value:!1,isValid:!1},uR={value:!0,isValid:!0};var __=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!St(e[0].attributes.value)?St(e[0].value)||e[0].value===""?uR:{value:e[0].value,isValid:!0}:uR:lR}return lR},T_=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>St(e)?e:t?e===""?NaN:e&&+e:r&&Sr(e)?new Date(e):n?n(e):e;const cR={isValid:!1,value:null};var $_=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,cR):cR;function dR(e){const t=e.ref;return Tg(t)?t.files:$g(t)?$_(e.refs).value:P_(t)?[...t.selectedOptions].map(({value:r})=>r):mc(t)?__(e.refs).value:T_(St(t.value)?e.ref.value:t.value,e)}var EG=(e,t,r,n)=>{const o={};for(const i of e){const s=Ce(t,i);s&&ot(o,i,s._f)}return{criteriaMode:r,names:[...e],fields:o,shouldUseNativeValidation:n}},xf=e=>e instanceof RegExp,$u=e=>St(e)?e:xf(e)?e.source:Ft(e)?xf(e.value)?e.value.source:e.value:e,fR=e=>({isOnSubmit:!e||e===Jr.onSubmit,isOnBlur:e===Jr.onBlur,isOnChange:e===Jr.onChange,isOnAll:e===Jr.all,isOnTouch:e===Jr.onTouched});const pR="AsyncFunction";var CG=e=>!!e&&!!e.validate&&!!(tn(e.validate)&&e.validate.constructor.name===pR||Ft(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===pR)),RG=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),mR=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const ju=(e,t,r,n)=>{for(const o of r||Object.keys(e)){const i=Ce(e,o);if(i){const{_f:s,...l}=i;if(s){if(s.refs&&s.refs[0]&&t(s.refs[0],o)&&!n)return!0;if(s.ref&&t(s.ref,s.name)&&!n)return!0;if(ju(l,t))break}else if(Ft(l)&&ju(l,t))break}}};function hR(e,t,r){const n=Ce(e,r);if(n||Jf(r))return{error:n,name:r};const o=r.split(".");for(;o.length;){const i=o.join("."),s=Ce(t,i),l=Ce(e,i);if(s&&!Array.isArray(s)&&r!==i)return{name:r};if(l&&l.type)return{name:i,error:l};if(l&&l.root&&l.root.type)return{name:`${i}.root`,error:l.root};o.pop()}return{name:r}}var PG=(e,t,r,n)=>{r(e);const{name:o,...i}=e;return lr(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(s=>t[s]===(!n||Jr.all))},SG=(e,t,r)=>!e||!t||e===t||qu(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),_G=(e,t,r,n,o)=>o.isOnAll?!1:!r&&o.isOnTouch?!(t||e):(r?n.isOnBlur:o.isOnBlur)?!e:(r?n.isOnChange:o.isOnChange)?e:!0,TG=(e,t)=>!Cg(Ce(e,t)).length&&kt(e,t),$G=(e,t,r)=>{const n=qu(Ce(e,r));return ot(n,"root",t[r]),ot(e,r,n),e};function vR(e,t,r="validate"){if(Sr(e)||Array.isArray(e)&&e.every(Sr)||Rr(e)&&!e)return{type:r,message:Sr(e)?e:"",ref:t}}var Ui=e=>Ft(e)&&!xf(e)?e:{value:e,message:""},gR=async(e,t,r,n,o,i)=>{const{ref:s,refs:l,required:c,maxLength:d,minLength:f,min:p,max:h,pattern:b,validate:w,name:y,valueAsNumber:C,mount:x}=e._f,P=Ce(r,y);if(!x||t.has(y))return{};const S=l?l[0]:s,D=K=>{o&&S.reportValidity&&(S.setCustomValidity(Rr(K)?"":K||""),S.reportValidity())},_={},T=$g(s),A=mc(s),M=T||A,U=(C||Tg(s))&&St(s.value)&&St(P)||yf(s)&&s.value===""||P===""||Array.isArray(P)&&!P.length,J=_g.bind(null,y,n,_),N=(K,W,L,G=Kn.maxLength,k=Kn.minLength)=>{const F=K?W:L;_[y]={type:K?G:k,message:F,ref:s,...J(K?G:k,F)}};if(i?!Array.isArray(P)||!P.length:c&&(!M&&(U||vr(P))||Rr(P)&&!P||A&&!__(l).isValid||T&&!$_(l).isValid)){const{value:K,message:W}=Sr(c)?{value:!!c,message:c}:Ui(c);if(K&&(_[y]={type:Kn.required,message:W,ref:S,...J(Kn.required,W)},!n))return D(W),_}if(!U&&(!vr(p)||!vr(h))){let K,W;const L=Ui(h),G=Ui(p);if(!vr(P)&&!isNaN(P)){const k=s.valueAsNumber||P&&+P;vr(L.value)||(K=k>L.value),vr(G.value)||(W=k<G.value)}else{const k=s.valueAsDate||new Date(P),F=V=>new Date(new Date().toDateString()+" "+V),j=s.type=="time",re=s.type=="week";Sr(L.value)&&P&&(K=j?F(P)>F(L.value):re?P>L.value:k>new Date(L.value)),Sr(G.value)&&P&&(W=j?F(P)<F(G.value):re?P<G.value:k<new Date(G.value))}if((K||W)&&(N(!!K,L.message,G.message,Kn.max,Kn.min),!n))return D(_[y].message),_}if((d||f)&&!U&&(Sr(P)||i&&Array.isArray(P))){const K=Ui(d),W=Ui(f),L=!vr(K.value)&&P.length>+K.value,G=!vr(W.value)&&P.length<+W.value;if((L||G)&&(N(L,K.message,W.message),!n))return D(_[y].message),_}if(b&&!U&&Sr(P)){const{value:K,message:W}=Ui(b);if(xf(K)&&!P.match(K)&&(_[y]={type:Kn.pattern,message:W,ref:s,...J(Kn.pattern,W)},!n))return D(W),_}if(w){if(tn(w)){const K=await w(P,r),W=vR(K,S);if(W&&(_[y]={...W,...J(Kn.validate,W.message)},!n))return D(W.message),_}else if(Ft(w)){let K={};for(const W in w){if(!lr(K)&&!n)break;const L=vR(await w[W](P,r),S,W);L&&(K={...L,...J(W,L.message)},D(L.message),n&&(_[y]=K))}if(!lr(K)&&(_[y]={ref:S,...K},!n))return _}}return D(!0),_};const AG={mode:Jr.onSubmit,reValidateMode:Jr.onChange,shouldFocusError:!0};function DG(e={}){let t={...AG,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:tn(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},o=Ft(t.defaultValues)||Ft(t.values)?Vt(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:Vt(o),s={action:!1,mount:!1,watch:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,d=0;const f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let p={...f};const h={array:sR(),state:sR()},b=t.criteriaMode===Jr.all,w=H=>ne=>{clearTimeout(d),d=setTimeout(H,ne)},y=async H=>{if(!t.disabled&&(f.isValid||p.isValid||H)){const ne=t.resolver?lr((await A()).errors):await U(n,!0);ne!==r.isValid&&h.state.next({isValid:ne})}},C=(H,ne)=>{!t.disabled&&(f.isValidating||f.validatingFields||p.isValidating||p.validatingFields)&&((H||Array.from(l.mount)).forEach(de=>{de&&(ne?ot(r.validatingFields,de,ne):kt(r.validatingFields,de))}),h.state.next({validatingFields:r.validatingFields,isValidating:!lr(r.validatingFields)}))},x=(H,ne=[],de,Ee,xe=!0,be=!0)=>{if(Ee&&de&&!t.disabled){if(s.action=!0,be&&Array.isArray(Ce(n,H))){const Ae=de(Ce(n,H),Ee.argA,Ee.argB);xe&&ot(n,H,Ae)}if(be&&Array.isArray(Ce(r.errors,H))){const Ae=de(Ce(r.errors,H),Ee.argA,Ee.argB);xe&&ot(r.errors,H,Ae),TG(r.errors,H)}if((f.touchedFields||p.touchedFields)&&be&&Array.isArray(Ce(r.touchedFields,H))){const Ae=de(Ce(r.touchedFields,H),Ee.argA,Ee.argB);xe&&ot(r.touchedFields,H,Ae)}(f.dirtyFields||p.dirtyFields)&&(r.dirtyFields=Qi(o,i)),h.state.next({name:H,isDirty:N(H,ne),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else ot(i,H,ne)},P=(H,ne)=>{ot(r.errors,H,ne),h.state.next({errors:r.errors})},S=H=>{r.errors=H,h.state.next({errors:r.errors,isValid:!1})},D=(H,ne,de,Ee)=>{const xe=Ce(n,H);if(xe){const be=Ce(i,H,St(de)?Ce(o,H):de);St(be)||Ee&&Ee.defaultChecked||ne?ot(i,H,ne?be:dR(xe._f)):L(H,be),s.mount&&!s.action&&y()}},_=(H,ne,de,Ee,xe)=>{let be=!1,Ae=!1;const Ke={name:H};if(!t.disabled){if(!de||Ee){(f.isDirty||p.isDirty)&&(Ae=r.isDirty,r.isDirty=Ke.isDirty=N(),be=Ae!==Ke.isDirty);const ze=en(Ce(o,H),ne);Ae=!!Ce(r.dirtyFields,H),ze?kt(r.dirtyFields,H):ot(r.dirtyFields,H,!0),Ke.dirtyFields=r.dirtyFields,be=be||(f.dirtyFields||p.dirtyFields)&&Ae!==!ze}if(de){const ze=Ce(r.touchedFields,H);ze||(ot(r.touchedFields,H,de),Ke.touchedFields=r.touchedFields,be=be||(f.touchedFields||p.touchedFields)&&ze!==de)}be&&xe&&h.state.next(Ke)}return be?Ke:{}},T=(H,ne,de,Ee)=>{const xe=Ce(r.errors,H),be=(f.isValid||p.isValid)&&Rr(ne)&&r.isValid!==ne;if(t.delayError&&de?(c=w(()=>P(H,de)),c(t.delayError)):(clearTimeout(d),c=null,de?ot(r.errors,H,de):kt(r.errors,H)),(de?!en(xe,de):xe)||!lr(Ee)||be){const Ae={...Ee,...be&&Rr(ne)?{isValid:ne}:{},errors:r.errors,name:H};r={...r,...Ae},h.state.next(Ae)}},A=async H=>{C(H,!0);const ne=await t.resolver(i,t.context,EG(H||l.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return C(H),ne},M=async H=>{const{errors:ne}=await A(H);if(H)for(const de of H){const Ee=Ce(ne,de);Ee?ot(r.errors,de,Ee):kt(r.errors,de)}else r.errors=ne;return ne},U=async(H,ne,de={valid:!0})=>{for(const Ee in H){const xe=H[Ee];if(xe){const{_f:be,...Ae}=xe;if(be){const Ke=l.array.has(be.name),ze=xe._f&&CG(xe._f);ze&&f.validatingFields&&C([be.name],!0);const Ht=await gR(xe,l.disabled,i,b,t.shouldUseNativeValidation&&!ne,Ke);if(ze&&f.validatingFields&&C([be.name]),Ht[be.name]&&(de.valid=!1,ne))break;!ne&&(Ce(Ht,be.name)?Ke?$G(r.errors,Ht,be.name):ot(r.errors,be.name,Ht[be.name]):kt(r.errors,be.name))}!lr(Ae)&&await U(Ae,ne,de)}}return de.valid},J=()=>{for(const H of l.unMount){const ne=Ce(n,H);ne&&(ne._f.refs?ne._f.refs.every(de=>!bh(de)):!bh(ne._f.ref))&&te(H)}l.unMount=new Set},N=(H,ne)=>!t.disabled&&(H&&ne&&ot(i,H,ne),!en(V(),o)),K=(H,ne,de)=>av(H,l,{...s.mount?i:St(ne)?o:Sr(H)?{[H]:ne}:ne},de,ne),W=H=>Cg(Ce(s.mount?i:o,H,t.shouldUnregister?Ce(o,H,[]):[])),L=(H,ne,de={})=>{const Ee=Ce(n,H);let xe=ne;if(Ee){const be=Ee._f;be&&(!be.disabled&&ot(i,H,T_(ne,be)),xe=yf(be.ref)&&vr(ne)?"":ne,P_(be.ref)?[...be.ref.options].forEach(Ae=>Ae.selected=xe.includes(Ae.value)):be.refs?mc(be.ref)?be.refs.forEach(Ae=>{(!Ae.defaultChecked||!Ae.disabled)&&(Array.isArray(xe)?Ae.checked=!!xe.find(Ke=>Ke===Ae.value):Ae.checked=xe===Ae.value||!!xe)}):be.refs.forEach(Ae=>Ae.checked=Ae.value===xe):Tg(be.ref)?be.ref.value="":(be.ref.value=xe,be.ref.type||h.state.next({name:H,values:Vt(i)})))}(de.shouldDirty||de.shouldTouch)&&_(H,xe,de.shouldTouch,de.shouldDirty,!0),de.shouldValidate&&re(H)},G=(H,ne,de)=>{for(const Ee in ne){if(!ne.hasOwnProperty(Ee))return;const xe=ne[Ee],be=H+"."+Ee,Ae=Ce(n,be);(l.array.has(H)||Ft(xe)||Ae&&!Ae._f)&&!ri(xe)?G(be,xe,de):L(be,xe,de)}},k=(H,ne,de={})=>{const Ee=Ce(n,H),xe=l.array.has(H),be=Vt(ne);ot(i,H,be),xe?(h.array.next({name:H,values:Vt(i)}),(f.isDirty||f.dirtyFields||p.isDirty||p.dirtyFields)&&de.shouldDirty&&h.state.next({name:H,dirtyFields:Qi(o,i),isDirty:N(H,be)})):Ee&&!Ee._f&&!vr(be)?G(H,be,de):L(H,be,de),mR(H,l)&&h.state.next({...r,name:H}),h.state.next({name:s.mount?H:void 0,values:Vt(i)})},F=async H=>{s.mount=!0;const ne=H.target;let de=ne.name,Ee=!0;const xe=Ce(n,de),be=ze=>{Ee=Number.isNaN(ze)||ri(ze)&&isNaN(ze.getTime())||en(ze,Ce(i,de,ze))},Ae=fR(t.mode),Ke=fR(t.reValidateMode);if(xe){let ze,Ht;const ln=ne.type?dR(xe._f):w_(H),cr=H.type===bf.BLUR||H.type===bf.FOCUS_OUT,ko=!RG(xe._f)&&!t.resolver&&!Ce(r.errors,de)&&!xe._f.deps||_G(cr,Ce(r.touchedFields,de),r.isSubmitted,Ke,Ae),Rn=mR(de,l,cr);ot(i,de,ln),cr?(!ne||!ne.readOnly)&&(xe._f.onBlur&&xe._f.onBlur(H),c&&c(0)):xe._f.onChange&&xe._f.onChange(H);const Pn=_(de,ln,cr),Lo=!lr(Pn)||Rn;if(!cr&&h.state.next({name:de,type:H.type,values:Vt(i)}),ko)return(f.isValid||p.isValid)&&(t.mode==="onBlur"?cr&&y():cr||y()),Lo&&h.state.next({name:de,...Rn?{}:Pn});if(!cr&&Rn&&h.state.next({...r}),t.resolver){const{errors:no}=await A([de]);if(be(ln),Ee){const Fo=hR(r.errors,n,de),Ri=hR(no,n,Fo.name||de);ze=Ri.error,de=Ri.name,Ht=lr(no)}}else C([de],!0),ze=(await gR(xe,l.disabled,i,b,t.shouldUseNativeValidation))[de],C([de]),be(ln),Ee&&(ze?Ht=!1:(f.isValid||p.isValid)&&(Ht=await U(n,!0)));Ee&&(xe._f.deps&&(!Array.isArray(xe._f.deps)||xe._f.deps.length>0)&&re(xe._f.deps),T(de,Ht,ze,Pn))}},j=(H,ne)=>{if(Ce(r.errors,ne)&&H.focus)return H.focus(),1},re=async(H,ne={})=>{let de,Ee;const xe=qu(H);if(t.resolver){const be=await M(St(H)?H:xe);de=lr(be),Ee=H?!xe.some(Ae=>Ce(be,Ae)):de}else H?(Ee=(await Promise.all(xe.map(async be=>{const Ae=Ce(n,be);return await U(Ae&&Ae._f?{[be]:Ae}:Ae)}))).every(Boolean),!(!Ee&&!r.isValid)&&y()):Ee=de=await U(n);return h.state.next({...!Sr(H)||(f.isValid||p.isValid)&&de!==r.isValid?{}:{name:H},...t.resolver||!H?{isValid:de}:{},errors:r.errors}),ne.shouldFocus&&!Ee&&ju(n,j,H?xe:l.mount),Ee},V=(H,ne)=>{let de={...s.mount?i:o};return ne&&(de=R_(ne.dirtyFields?r.dirtyFields:r.touchedFields,de)),St(H)?de:Sr(H)?Ce(de,H):H.map(Ee=>Ce(de,Ee))},ie=(H,ne)=>({invalid:!!Ce((ne||r).errors,H),isDirty:!!Ce((ne||r).dirtyFields,H),error:Ce((ne||r).errors,H),isValidating:!!Ce(r.validatingFields,H),isTouched:!!Ce((ne||r).touchedFields,H)}),Y=H=>{H&&qu(H).forEach(ne=>kt(r.errors,ne)),h.state.next({errors:H?r.errors:{}})},X=(H,ne,de)=>{const Ee=(Ce(n,H,{_f:{}})._f||{}).ref,xe=Ce(r.errors,H)||{},{ref:be,message:Ae,type:Ke,...ze}=xe;ot(r.errors,H,{...ze,...ne,ref:Ee}),h.state.next({name:H,errors:r.errors,isValid:!1}),de&&de.shouldFocus&&Ee&&Ee.focus&&Ee.focus()},ce=(H,ne)=>tn(H)?h.state.subscribe({next:de=>"values"in de&&H(K(void 0,ne),de)}):K(H,ne,!0),ue=H=>h.state.subscribe({next:ne=>{SG(H.name,ne.name,H.exact)&&PG(ne,H.formState||f,mt,H.reRenderRoot)&&H.callback({values:{...i},...r,...ne,defaultValues:o})}}).unsubscribe,pe=H=>(s.mount=!0,p={...p,...H.formState},ue({...H,formState:p})),te=(H,ne={})=>{for(const de of H?qu(H):l.mount)l.mount.delete(de),l.array.delete(de),ne.keepValue||(kt(n,de),kt(i,de)),!ne.keepError&&kt(r.errors,de),!ne.keepDirty&&kt(r.dirtyFields,de),!ne.keepTouched&&kt(r.touchedFields,de),!ne.keepIsValidating&&kt(r.validatingFields,de),!t.shouldUnregister&&!ne.keepDefaultValue&&kt(o,de);h.state.next({values:Vt(i)}),h.state.next({...r,...ne.keepDirty?{isDirty:N()}:{}}),!ne.keepIsValid&&y()},ve=({disabled:H,name:ne})=>{(Rr(H)&&s.mount||H||l.disabled.has(ne))&&(H?l.disabled.add(ne):l.disabled.delete(ne))},q=(H,ne={})=>{let de=Ce(n,H);const Ee=Rr(ne.disabled)||Rr(t.disabled);return ot(n,H,{...de||{},_f:{...de&&de._f?de._f:{ref:{name:H}},name:H,mount:!0,...ne}}),l.mount.add(H),de?ve({disabled:Rr(ne.disabled)?ne.disabled:t.disabled,name:H}):D(H,!0,ne.value),{...Ee?{disabled:ne.disabled||t.disabled}:{},...t.progressive?{required:!!ne.required,min:$u(ne.min),max:$u(ne.max),minLength:$u(ne.minLength),maxLength:$u(ne.maxLength),pattern:$u(ne.pattern)}:{},name:H,onChange:F,onBlur:F,ref:xe=>{if(xe){q(H,ne),de=Ce(n,H);const be=St(xe.value)&&xe.querySelectorAll&&xe.querySelectorAll("input,select,textarea")[0]||xe,Ae=bG(be),Ke=de._f.refs||[];if(Ae?Ke.find(ze=>ze===be):be===de._f.ref)return;ot(n,H,{_f:{...de._f,...Ae?{refs:[...Ke.filter(bh),be,...Array.isArray(Ce(o,H))?[{}]:[]],ref:{type:be.type,name:H}}:{ref:be}}}),D(H,!1,void 0,be)}else de=Ce(n,H,{}),de._f&&(de._f.mount=!1),(t.shouldUnregister||ne.shouldUnregister)&&!(E_(l.array,H)&&s.action)&&l.unMount.add(H)}}},ae=()=>t.shouldFocusError&&ju(n,j,l.mount),oe=H=>{Rr(H)&&(h.state.next({disabled:H}),ju(n,(ne,de)=>{const Ee=Ce(n,de);Ee&&(ne.disabled=Ee._f.disabled||H,Array.isArray(Ee._f.refs)&&Ee._f.refs.forEach(xe=>{xe.disabled=Ee._f.disabled||H}))},0,!1))},Z=(H,ne)=>async de=>{let Ee;de&&(de.preventDefault&&de.preventDefault(),de.persist&&de.persist());let xe=Vt(i);if(h.state.next({isSubmitting:!0}),t.resolver){const{errors:be,values:Ae}=await A();r.errors=be,xe=Vt(Ae)}else await U(n);if(l.disabled.size)for(const be of l.disabled)kt(xe,be);if(kt(r.errors,"root"),lr(r.errors)){h.state.next({errors:{}});try{await H(xe,de)}catch(be){Ee=be}}else ne&&await ne({...r.errors},de),ae(),setTimeout(ae);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:lr(r.errors)&&!Ee,submitCount:r.submitCount+1,errors:r.errors}),Ee)throw Ee},we=(H,ne={})=>{Ce(n,H)&&(St(ne.defaultValue)?k(H,Vt(Ce(o,H))):(k(H,ne.defaultValue),ot(o,H,Vt(ne.defaultValue))),ne.keepTouched||kt(r.touchedFields,H),ne.keepDirty||(kt(r.dirtyFields,H),r.isDirty=ne.defaultValue?N(H,Vt(Ce(o,H))):N()),ne.keepError||(kt(r.errors,H),f.isValid&&y()),h.state.next({...r}))},De=(H,ne={})=>{const de=H?Vt(H):o,Ee=Vt(de),xe=lr(H),be=xe?o:Ee;if(ne.keepDefaultValues||(o=de),!ne.keepValues){if(ne.keepDirtyValues){const Ae=new Set([...l.mount,...Object.keys(Qi(o,i))]);for(const Ke of Array.from(Ae))Ce(r.dirtyFields,Ke)?ot(be,Ke,Ce(i,Ke)):k(Ke,Ce(be,Ke))}else{if(Eg&&St(H))for(const Ae of l.mount){const Ke=Ce(n,Ae);if(Ke&&Ke._f){const ze=Array.isArray(Ke._f.refs)?Ke._f.refs[0]:Ke._f.ref;if(yf(ze)){const Ht=ze.closest("form");if(Ht){Ht.reset();break}}}}if(ne.keepFieldsRef)for(const Ae of l.mount)k(Ae,Ce(be,Ae));else n={}}i=t.shouldUnregister?ne.keepDefaultValues?Vt(o):{}:Vt(be),h.array.next({values:{...be}}),h.state.next({values:{...be}})}l={mount:ne.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!f.isValid||!!ne.keepIsValid||!!ne.keepDirtyValues||!t.shouldUnregister&&!lr(be),s.watch=!!t.shouldUnregister,s.action=!1,ne.keepErrors||(r.errors={}),h.state.next({submitCount:ne.keepSubmitCount?r.submitCount:0,isDirty:xe?!1:ne.keepDirty?r.isDirty:!!(ne.keepDefaultValues&&!en(H,o)),isSubmitted:ne.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:xe?{}:ne.keepDirtyValues?ne.keepDefaultValues&&i?Qi(o,i):r.dirtyFields:ne.keepDefaultValues&&H?Qi(o,H):ne.keepDirty?r.dirtyFields:{},touchedFields:ne.keepTouched?r.touchedFields:{},errors:ne.keepErrors?r.errors:{},isSubmitSuccessful:ne.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},Ue=(H,ne)=>De(tn(H)?H(i):H,ne),wt=(H,ne={})=>{const de=Ce(n,H),Ee=de&&de._f;if(Ee){const xe=Ee.refs?Ee.refs[0]:Ee.ref;xe.focus&&(xe.focus(),ne.shouldSelect&&tn(xe.select)&&xe.select())}},mt=H=>{r={...r,...H}},Ci={control:{register:q,unregister:te,getFieldState:ie,handleSubmit:Z,setError:X,_subscribe:ue,_runSchema:A,_focusError:ae,_getWatch:K,_getDirty:N,_setValid:y,_setFieldArray:x,_setDisabledField:ve,_setErrors:S,_getFieldArray:W,_reset:De,_resetDefaultValues:()=>tn(t.defaultValues)&&t.defaultValues().then(H=>{Ue(H,t.resetOptions),h.state.next({isLoading:!1})}),_removeUnmounted:J,_disableForm:oe,_subjects:h,_proxyFormState:f,get _fields(){return n},get _formValues(){return i},get _state(){return s},set _state(H){s=H},get _defaultValues(){return o},get _names(){return l},set _names(H){l=H},get _formState(){return r},get _options(){return t},set _options(H){t={...t,...H}}},subscribe:pe,trigger:re,register:q,handleSubmit:Z,watch:ce,setValue:k,getValues:V,reset:Ue,resetField:we,clearErrors:Y,unregister:te,setError:X,setFocus:wt,getFieldState:ie};return{...Ci,formControl:Ci}}function MG(e={}){const t=R.useRef(void 0),r=R.useRef(void 0),[n,o]=R.useState({isDirty:!1,isValidating:!1,isLoading:tn(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:tn(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!tn(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:s,...l}=DG(e);t.current={...l,formState:n}}const i=t.current.control;return i._options=e,Sg(()=>{const s=i._subscribe({formState:i._proxyFormState,callback:()=>o({...i._formState}),reRenderRoot:!0});return o(l=>({...l,isReady:!0})),i._formState.isReady=!0,s},[i]),R.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),R.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),R.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),R.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),R.useEffect(()=>{if(i._proxyFormState.isDirty){const s=i._getDirty();s!==n.isDirty&&i._subjects.state.next({isDirty:s})}},[i,n.isDirty]),R.useEffect(()=>{var s;e.values&&!en(e.values,r.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),!((s=i._options.resetOptions)===null||s===void 0)&&s.keepIsValid||i._setValid(),r.current=e.values,o(l=>({...l}))):i._resetDefaultValues()},[i,e.values]),R.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=C_(n,i),t.current}const[OG,NG]=cc(),[IG,kG]=cc(),vc=()=>{const e=IG(),t=OG(),{getFieldState:r,formState:n}=hc();if(!e)throw new Error("useFormField should be used within <FormField>");const o=r(e.name,n),{id:i}=t;return{id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...o}},LG=({onSubmit:e,id:t,form:r,children:n,className:o})=>g.jsx(pG,{...r,children:g.jsx("form",{id:t,onSubmit:r.handleSubmit(e),className:o,"data-slot":"form",children:n})}),FG=({name:e,label:t,description:r,className:n,render:o,itemProps:i,labelProps:s,controlProps:l,descriptionProps:c,messageProps:d})=>{const{control:f}=hc();return g.jsx(kG,{value:{name:e},children:g.jsx(gG,{name:e,control:f,render:({field:p,fieldState:h})=>g.jsxs(A_,{className:n,...i,children:[t&&g.jsx(D_,{...s,children:t}),g.jsx(M_,{...l,children:lt.isFunction(o)?o(p):v.createElement(o,p)}),r&&g.jsx(O_,{...c,children:r}),g.jsx(N_,{...d,children:h.error?.message})]})})})},A_=({className:e,...t})=>{const r=v.useId();return g.jsx(NG,{value:{id:r},children:g.jsx("div",{className:le("flex flex-col gap-2",e),"data-slot":"form-item",...t})})},D_=({className:e,...t})=>{const{error:r,formItemId:n}=vc();return g.jsx(pc,{className:le(r&&"text-error",e),htmlFor:n,...t})},M_=({className:e,...t})=>{const{error:r,formItemId:n,formDescriptionId:o,formMessageId:i}=vc();return g.jsx(sc,{id:n,"aria-describedby":r?`${o} ${i}`:`${o}`,"aria-invalid":!!r,className:le("group",e),...t})},O_=({className:e,...t})=>{const{formDescriptionId:r}=vc();return g.jsx("p",{id:r,className:le("text-sm text-muted-foreground",e),"data-slot":"form-description",...t})},N_=({className:e,children:t,...r})=>{const{error:n,formMessageId:o}=vc(),i=n?String(n?.message):t;return i?g.jsx("p",{id:o,className:le("text-sm font-medium text-error",e),"data-slot":"form-message",...r,children:i}):null},bR=(e,t,r)=>{if(e&&"reportValidity"in e){const n=Ce(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},uv=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?bR(n.ref,r,e):n&&n.refs&&n.refs.forEach(o=>bR(o,r,e))}},yR=(e,t)=>{t.shouldUseNativeValidation&&uv(e,t);const r={};for(const n in e){const o=Ce(t.fields,n),i=Object.assign(e[n]||{},{ref:o&&o.ref});if(qG(t.names||Object.keys(e),n)){const s=Object.assign({},Ce(r,n));ot(s,"root",i),ot(r,n,s)}else ot(r,n,i)}return r},qG=(e,t)=>{const r=xR(t);return e.some(n=>xR(n).match(`^${r}\\.\\d+`))};function xR(e){return e.replace(/\]|\[/g,"")}function I_(e,t,r){function n(l,c){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:c,constr:s,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,c);const d=s.prototype,f=Object.keys(d);for(let p=0;p<f.length;p++){const h=f[p];h in l||(l[h]=d[h].bind(l))}}const o=r?.Parent??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function s(l){var c;const d=r?.Parent?new i:this;n(d,l),(c=d._zod).deferred??(c.deferred=[]);for(const f of d._zod.deferred)f();return d}return Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}class jG extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const BG={};function k_(e){return BG}function VG(e,t){return typeof t=="bigint"?t.toString():t}const L_="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function jd(e){return typeof e=="string"?e:e?.message}function F_(e,t,r){const n={...e,path:e.path??[]};if(!e.message){const o=jd(e.inst?._zod.def?.error?.(e))??jd(t?.error?.(e))??jd(r.customError?.(e))??jd(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}const q_=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,VG,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},KG=I_("$ZodError",q_),j_=I_("$ZodError",q_,{Parent:Error}),WG=e=>(t,r,n,o)=>{const i=n?Object.assign(n,{async:!1}):{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new jG;if(s.issues.length){const l=new(o?.Err??e)(s.issues.map(c=>F_(c,i,k_())));throw L_(l,o?.callee),l}return s.value},HG=WG(j_),UG=e=>async(t,r,n,o)=>{const i=n?Object.assign(n,{async:!0}):{async:!0};let s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){const l=new(o?.Err??e)(s.issues.map(c=>F_(c,i,k_())));throw L_(l,o?.callee),l}return s.value},zG=UG(j_);function wR(e,t){try{var r=e()}catch(n){return t(n)}return r&&r.then?r.then(void 0,t):r}function GG(e,t){for(var r={};e.length;){var n=e[0],o=n.code,i=n.message,s=n.path.join(".");if(!r[s])if("unionErrors"in n){var l=n.unionErrors[0].errors[0];r[s]={message:l.message,type:l.code}}else r[s]={message:i,type:o};if("unionErrors"in n&&n.unionErrors.forEach(function(f){return f.errors.forEach(function(p){return e.push(p)})}),t){var c=r[s].types,d=c&&c[n.code];r[s]=_g(s,t,r,o,d?[].concat(d,n.message):n.message)}e.shift()}return r}function YG(e,t){for(var r={};e.length;){var n=e[0],o=n.code,i=n.message,s=n.path.join(".");if(!r[s])if(n.code==="invalid_union"&&n.errors.length>0){var l=n.errors[0][0];r[s]={message:l.message,type:l.code}}else r[s]={message:i,type:o};if(n.code==="invalid_union"&&n.errors.forEach(function(f){return f.forEach(function(p){return e.push(p)})}),t){var c=r[s].types,d=c&&c[n.code];r[s]=_g(s,t,r,o,d?[].concat(d,n.message):n.message)}e.shift()}return r}function XG(e,t,r){if(r===void 0&&(r={}),(function(n){return"_def"in n&&typeof n._def=="object"&&"typeName"in n._def})(e))return function(n,o,i){try{return Promise.resolve(wR(function(){return Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(s){return i.shouldUseNativeValidation&&uv({},i),{errors:{},values:r.raw?Object.assign({},n):s}})},function(s){if((function(l){return Array.isArray(l?.issues)})(s))return{values:{},errors:yR(GG(s.errors,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw s}))}catch(s){return Promise.reject(s)}};if((function(n){return"_zod"in n&&typeof n._zod=="object"})(e))return function(n,o,i){try{return Promise.resolve(wR(function(){return Promise.resolve((r.mode==="sync"?HG:zG)(e,n,t)).then(function(s){return i.shouldUseNativeValidation&&uv({},i),{errors:{},values:r.raw?Object.assign({},n):s}})},function(s){if((function(l){return l instanceof KG})(s))return{values:{},errors:yR(YG(s.issues,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw s}))}catch(s){return Promise.reject(s)}};throw new Error("Invalid input: not a Zod schema")}function ZG(e,t){return MG({...t,resolver:XG(e)})}const B_=({value:e,onChange:t,defaultValue:r="",...n})=>{const o=ac("Input",n),[i="",s]=ut({prop:e,onChange:t,defaultProp:r}),l=c=>{s(c.target.value)};return g.jsx("input",{"data-slot":"input",autoComplete:"off",...o,value:i,onChange:l,className:le("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","file:border-0 file:bg-transparent file:text-sm file:font-medium",o.className)})},QG=eo(["inline-flex select-none items-center gap-1 rounded border bg-muted px-1.5 font-medium text-muted-foreground"],{variants:{variant:{default:"border-transparent bg-secondary text-secondary-foreground",secondary:"border-transparent bg-primary text-primary-foreground",error:"border-transparent bg-error text-error-foreground",outline:"text-foreground"},size:{default:"px-1.5 py-0.5 text-xs",sm:"px-2 py-0.5 text-sm",lg:"px-4 py-1 text-lg"}},defaultVariants:{variant:"default",size:"default"}}),JG=({variant:e,size:t,className:r,...n})=>g.jsx("kbd",{className:le(QG({variant:e,size:t}),r),...n,"data-slot":"kbd"}),eY=({className:e,...t})=>g.jsx("kbd",{"data-slot":"kbd-group",className:le("inline-flex items-center gap-1",e),...t}),tY=eo("animate-spin",{variants:{variant:{primary:"text-primary",secondary:"text-secondary",ghost:"text-muted-foreground",error:"text-error",success:"text-success"},size:{sm:"w-4 h-4",default:"w-7 h-7",lg:"w-10 h-10"}},defaultVariants:{variant:"primary",size:"default"}}),rY=({center:e,containerClassName:t,variant:r,size:n,...o})=>g.jsx("div",{className:le(t,e&&"fixed inset-0 grid place-items-center"),"data-slot":"loader",children:g.jsx(sf,{"data-slot":"loader-icon",...o,className:le(tY({variant:r,size:n}),o.className)})});function nY(e){const[t=[],r]=R.useState(e);return[t,{insertAt:(h,b)=>{r((w=[])=>{const y=[...w];return y.splice(h,0,b),y})},removeAt:h=>{r((b=[])=>{const w=[...b];return w.splice(h,1),w})},updateAt:(h,b)=>{r((w=[])=>{const y=[...w];return y[h]=b,y})},clear:()=>r([]),reset:()=>r(e),push:h=>r((b=[])=>[...b,h]),set:h=>r(h),pop:()=>{r((h=[])=>{const b=[...h];return b.pop(),b})},update:(h,b)=>{r((w=[])=>{const y=[...w],C=lt.findIndex(y,h);return C===-1||(y[C]=lt.isFunction(b)?b(y[C]):b),y})}}]}function oY({fn:e,dependencies:t=[],onError:r,onSuccess:n,onFinish:o}){const[i,s]=R.useState(!0),[l,c]=R.useState(null),[d,f]=R.useState(null),p=R.useCallback(()=>{s(!0),c(null),f(null),e().then(h=>{n?.(h),f(h)}).catch(h=>{r?.(h),c(h)}).finally(()=>{o?.(),s(!1)})},t);return R.useEffect(()=>{p()},[p]),{loading:i,error:l,data:d,refetch:p}}const iY=(e,t=!0)=>{const r=R.useRef(null),n=o=>{r.current&&!r.current.contains(o.target)&&e()};return R.useEffect(()=>{if(t)return document.addEventListener("mousedown",n),()=>{document.removeEventListener("mousedown",n)}},[t]),r};function aY(){const[e,t]=R.useState(null),r=R.useCallback(async n=>{if(!navigator?.clipboard)return!1;try{return await navigator.clipboard.writeText(n),t(n),!0}catch(o){return console.error(o),t(null),!1}},[]);return[e,r]}function sY(e,t){const r=R.useRef(null);return R.useCallback((...n)=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{e(...n)},t)},[e,t])}function lY(e,t){const[r,n]=R.useState(e);return R.useEffect(()=>{const o=setTimeout(()=>{n(e)},t);return()=>clearTimeout(o)},[e,t]),r}function uY(e=!1,t){const{onOpen:r,onClose:n}=t||{},[o,i]=R.useState(e),s=R.useCallback(()=>{i(d=>d||(r?.(),!0))},[r]),l=R.useCallback(()=>{i(d=>d&&(n?.(),!1))},[n]),c=R.useCallback(()=>{o?l():s()},[l,s,o]);return[o,{open:s,close:l,toggle:c}]}function cY(e){R.useEffect(()=>{typeof e=="string"&&e.trim().length>0&&(document.title=e.trim())},[e])}function V_(e,t,r){const n=R.useRef(null);return R.useEffect(()=>{const o=n.current??document;return o.addEventListener(e,t,r),()=>{o.removeEventListener(e,t,r)}},[e,t,r]),n}const dY=e=>{const t=e.toLowerCase().split("+");return{mainKey:t.pop(),isShift:t.includes("shift"),isCtrl:t.includes("ctrl"),isAlt:t.includes("alt"),isMeta:t.includes("meta")}},fY=(e,t)=>{const{mainKey:r,isShift:n,isCtrl:o,isAlt:i,isMeta:s}=dY(t);return e.key.toLowerCase()===r&&e.shiftKey===n&&e.ctrlKey===o&&e.altKey===i&&e.metaKey===s},pY=e=>e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable,mY=(e,t)=>t&&pY(e.target),hY=(e,t,r,n,o)=>i=>{if(!o||mY(i,n))return;(Array.isArray(e)?e:[e]).some(c=>fY(i,c))&&(r&&i.preventDefault(),t(i))};function K_(e,t,r={}){const{eventName:n="keydown",preventDefault:o=!0,ignoreInputFields:i=!0,watch:s=!0}=r,l=R.useCallback(hY(e,t,o,i,s),[e,t,o,i,s]);return V_(n,l)}function vY(e){const[t,r]=R.useState(!1),n=R.useRef(null);return R.useEffect(()=>{const o=l=>{r(!0),e?.onHoverStart?.(l)},i=l=>{r(!1),e?.onHoverEnd?.(l)},s=n.current;if(s)return s.addEventListener("mouseover",o),s.addEventListener("mouseout",i),()=>{s.removeEventListener("mouseover",o),s.removeEventListener("mouseout",i)}},[e]),{ref:n,isHovering:t}}function gY({onVisible:e,root:t=null,rootMargin:r="0px",threshold:n=0}={}){const[o,i]=R.useState(!1),s=R.useRef(null),l=R.useCallback(([c])=>{const d=c.isIntersecting;i(d)},[e]);return R.useEffect(()=>{if(s.current==null)return;const c=new IntersectionObserver(l,{root:t,rootMargin:r,threshold:n});return c.observe(s.current),()=>{s.current!=null&&c.unobserve(s.current)}},[s,t,r,n,l]),R.useEffect(()=>{o&&e?.()},[o]),{ref:s,isVisible:o}}function bY(e,t){const r=()=>{try{const l=localStorage.getItem(e);return l?JSON.parse(l):t!==void 0?t:void 0}catch(l){return console.error(`Error parsing localStorage key "${e}":`,l),t!==void 0?t:void 0}},[n,o]=R.useState(r);return R.useEffect(()=>{try{n!==void 0?localStorage.setItem(e,JSON.stringify(n)):localStorage.removeItem(e)}catch(l){console.error(`Error setting localStorage key "${e}":`,l)}},[e,n]),[n,l=>{o(l)},()=>{try{localStorage.removeItem(e),o(t!==void 0?t:void 0)}catch(l){console.error(`Error removing localStorage key "${e}":`,l)}}]}const yY=e=>{const[t,r]=R.useState(!1);return R.useEffect(()=>{const n=window.matchMedia(e),o=()=>r(n.matches);return o(),n.addEventListener("change",o),()=>{n.removeEventListener("change",o)}},[e]),t};function xY(e){lt.isFunction(e)||console.error(`useMemoizedFn expected parameter is a function, got ${typeof e}`);const t=R.useRef(e);t.current=R.useMemo(()=>e,[e]);const r=R.useRef(null);return r.current||(r.current=function(...n){return t.current.apply(this,n)}),r.current}const wY=e=>{const[t,r]=R.useState(!1),[n,o]=R.useState(null),[i,s]=R.useState(null);return{mutate:R.useCallback(async(...c)=>{r(!0),o(null),s(null);try{const d=await e.fn(...c);return e.onSuccess?.(d),s(d),d}catch(d){const f=d;throw e.onError?.(f),o(f),f}finally{e.onFinish?.(),r(!1)}},[e]),loading:t,error:n,data:i}};function EY(e){const[t,r]=R.useState(e),n=R.useCallback(()=>r(e),[e]),o=R.useCallback(i=>{r(s=>{if(lt.isFunction(i)){const l=i(s);return lt.isObject(l)?{...s,...l}:s}else if(lt.isObject(i))return{...s,...i};return s})},[]);return[t,o,n]}function Ag({totalItems:e,pageSize:t,initialCurrentPage:r=1,onChange:n}){const[o,i]=R.useState(r),s=Math.ceil(e/t),l=o===s,c=o===1,d=(o-1)*t+1,f=Math.min(o*t,e),p=()=>{if(l)return;const y=Math.min(o+1,s);w(y)},h=()=>{if(c)return;const y=Math.max(o-1,1);w(y)},b=y=>{if(y===1&&c||y===s&&l)return;const C=Math.max(1,y),x=Math.min(C,s);w(x)},w=y=>{i(y),n?.({currentPage:y,pageSize:t})};return{next:p,prev:h,goTo:b,currentPage:o,maxPage:s,isFirstPage:c,isLastPage:l,range:{start:d,end:f}}}function CY(e){const t=()=>document.getElementById(e),r=()=>{const o=document.createElement("div");return o.id=e,o},n=R.useMemo(()=>{const o=t();return o||r()},[e]);return R.useEffect(()=>(document.getElementById(e)||document.body.appendChild(n),()=>{const o=document.getElementById(e);o&&document.body.removeChild(o)}),[e,n]),{render:o=>rn.createPortal(o,n)}}function RY({shouldPrevent:e,message:t="Es posible que no se guarden los cambios hayas hecho."}){const r=n=>{if(e)return n.preventDefault(),n.returnValue=t,t};R.useEffect(()=>(window.addEventListener("beforeunload",r),()=>window.removeEventListener("beforeunload",r)),[t,e])}const Co="...",W_=({siblingCount:e=1,...t})=>{const r=Ag(t),{currentPage:n,maxPage:o}=r,{totalItems:i,pageSize:s}=t,l=()=>{const p=2+3*e,h=1;if(p>=o)return lt.range(h,o+1);const b=Math.max(n-e,1),w=Math.min(n+e,o),y=b>2,C=w<o-2;if(y&&C){const x=lt.range(b,w+1);return[h,Co,...x,Co,o]}if(C)return[...lt.range(h,p+1),Co,o];if(y){const x=lt.range(o-p+1,o+1);return[h,Co,...x]}},c=R.useMemo(l,[i,s,n,e]);return{...r,paginationRange:c??[]}};function PY(e){const[t,r]=R.useState(new Set),n=R.useCallback(f=>t.has(f),[t]),o=R.useCallback(f=>{r(p=>new Set([...p,f]))},[]),i=R.useCallback(f=>{r(p=>{const h=new Set(p);return h.delete(f),h})},[]),s=R.useCallback(f=>{r(p=>{const h=new Set(p);return h.has(f)?h.delete(f):h.add(f),h})},[]),l=R.useCallback(f=>{r(new Set(f))},[]),c=R.useCallback(()=>{r(f=>f.size===e.length?new Set:new Set(e))},[e]),d=R.useCallback(()=>r(new Set),[]);return{isAllSelected:t.size===e.length,isSomeSelected:t.size>0&&t.size<e.length,isNoneSelected:t.size===0,isSelected:n,selected:[...t],setSelected:l,select:o,unselect:i,toggle:s,toggleAll:c,clear:d}}function SY(e,t){const[r,n]=R.useState(0),o=t??e.length,i=()=>{n(d=>d>=o-1?d:d+1)},s=()=>{n(d=>d<=0?d:d-1)},l=d=>{n(d)},c=d=>{const f=lt.findIndex(e,d);f!==-1&&l(f)};return{currentStepIndex:r,step:e[r],steps:e,isFirstStep:r===0,isLastStep:r===o-1,goTo:l,next:i,back:s,findAndGo:c}}function H_(e=!1){const[t,r]=R.useState(e);return[t,o=>{r(o===void 0?!t:o)}]}const _Y=/input|select|textarea|button|object/,U_="a, input, select, textarea, button, object, [tabindex]";function TY(e){return process.env.NODE_ENV==="test"?!1:e.style.display==="none"}function $Y(e){if(e.getAttribute("aria-hidden")||e.getAttribute("hidden")||e.getAttribute("type")==="hidden")return!1;let r=e;for(;r&&!(r===document.body||r.nodeType===11);){if(TY(r))return!1;r=r.parentNode}return!0}function z_(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function cv(e){const t=e.nodeName.toLowerCase(),r=!Number.isNaN(z_(e));return(_Y.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||r)&&$Y(e)}function G_(e){const t=z_(e);return(Number.isNaN(t)||t>=0)&&cv(e)}function AY(e){return Array.from(e.querySelectorAll(U_)).filter(G_)}function DY(e,t){const r=AY(e);if(!r.length){t.preventDefault();return}const n=r[t.shiftKey?0:r.length-1],o=e.getRootNode();let i=n===o.activeElement||e===o.activeElement;const s=o.activeElement;if(s.tagName==="INPUT"&&s.getAttribute("type")==="radio"&&(i=r.filter(f=>f.getAttribute("type")==="radio"&&f.getAttribute("name")===s.getAttribute("name")).includes(n)),!i)return;t.preventDefault();const c=r[t.shiftKey?r.length-1:0];c&&c.focus()}function MY(e=!0){const t=R.useRef(null),r=o=>{let i=o.querySelector("[data-autofocus]");if(!i){const s=Array.from(o.querySelectorAll(U_));i=s.find(G_)||s.find(cv)||null,!i&&cv(o)&&(i=o)}i&&i.focus({preventScroll:!0})},n=R.useCallback(o=>{e&&o!==null&&t.current!==o&&(o?(setTimeout(()=>{o.getRootNode()&&r(o)}),t.current=o):t.current=null)},[e]);return R.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>r(t.current));const o=i=>{i.key==="Tab"&&t.current&&DY(t.current,i)};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[e]),n}function OY(e){const t=NY(e),r=v.forwardRef((n,o)=>{const{children:i,...s}=n,l=v.Children.toArray(i),c=l.find(kY);if(c){const d=c.props.children,f=l.map(p=>p===c?v.Children.count(d)>1?v.Children.only(null):v.isValidElement(d)?d.props.children:null:p);return g.jsx(t,{...s,ref:o,children:v.isValidElement(d)?v.cloneElement(d,void 0,f):null})}return g.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}function NY(e){const t=v.forwardRef((r,n)=>{const{children:o,...i}=r;if(v.isValidElement(o)){const s=FY(o),l=LY(i,o.props);return o.type!==v.Fragment&&(l.ref=n?gt(n,s):s),v.cloneElement(o,l)}return v.Children.count(o)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var IY=Symbol("radix.slottable");function kY(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===IY}function LY(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function FY(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var qY=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],jY=qY.reduce((e,t)=>{const r=OY(`Primitive.${t}`),n=v.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function ER(e){const t=BY(e),r=v.forwardRef((n,o)=>{const{children:i,...s}=n,l=v.Children.toArray(i),c=l.find(KY);if(c){const d=c.props.children,f=l.map(p=>p===c?v.Children.count(d)>1?v.Children.only(null):v.isValidElement(d)?d.props.children:null:p);return g.jsx(t,{...s,ref:o,children:v.isValidElement(d)?v.cloneElement(d,void 0,f):null})}return g.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}function BY(e){const t=v.forwardRef((r,n)=>{const{children:o,...i}=r;if(v.isValidElement(o)){const s=HY(o),l=WY(i,o.props);return o.type!==v.Fragment&&(l.ref=n?gt(n,s):s),v.cloneElement(o,l)}return v.Children.count(o)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var VY=Symbol("radix.slottable");function KY(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===VY}function WY(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function HY(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Dg(e){const t=e+"CollectionProvider",[r,n]=wn(t),[o,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=y=>{const{scope:C,children:x}=y,P=R.useRef(null),S=R.useRef(new Map).current;return g.jsx(o,{scope:C,itemMap:S,collectionRef:P,children:x})};s.displayName=t;const l=e+"CollectionSlot",c=ER(l),d=R.forwardRef((y,C)=>{const{scope:x,children:P}=y,S=i(l,x),D=Ve(C,S.collectionRef);return g.jsx(c,{ref:D,children:P})});d.displayName=l;const f=e+"CollectionItemSlot",p="data-radix-collection-item",h=ER(f),b=R.forwardRef((y,C)=>{const{scope:x,children:P,...S}=y,D=R.useRef(null),_=Ve(C,D),T=i(f,x);return R.useEffect(()=>(T.itemMap.set(D,{ref:D,...S}),()=>{T.itemMap.delete(D)})),g.jsx(h,{[p]:"",ref:_,children:P})});b.displayName=f;function w(y){const C=i(e+"CollectionConsumer",y);return R.useCallback(()=>{const P=C.collectionRef.current;if(!P)return[];const S=Array.from(P.querySelectorAll(`[${p}]`));return Array.from(C.itemMap.values()).sort((T,A)=>S.indexOf(T.ref.current)-S.indexOf(A.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:s,Slot:d,ItemSlot:b},w,n]}var UY=v.createContext(void 0);function Mg(e){const t=v.useContext(UY);return e||t||"ltr"}const zY=["top","right","bottom","left"],_o=Math.min,Pr=Math.max,wf=Math.round,Bd=Math.floor,yn=e=>({x:e,y:e}),GY={left:"right",right:"left",bottom:"top",top:"bottom"},YY={start:"end",end:"start"};function dv(e,t,r){return Pr(e,_o(t,r))}function Xn(e,t){return typeof e=="function"?e(t):e}function Zn(e){return e.split("-")[0]}function ya(e){return e.split("-")[1]}function Og(e){return e==="x"?"y":"x"}function Ng(e){return e==="y"?"height":"width"}function To(e){return["top","bottom"].includes(Zn(e))?"y":"x"}function Ig(e){return Og(To(e))}function XY(e,t,r){r===void 0&&(r=!1);const n=ya(e),o=Ig(e),i=Ng(o);let s=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Ef(s)),[s,Ef(s)]}function ZY(e){const t=Ef(e);return[fv(e),t,fv(t)]}function fv(e){return e.replace(/start|end/g,t=>YY[t])}function QY(e,t,r){const n=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return r?t?o:n:t?n:o;case"left":case"right":return t?i:s;default:return[]}}function JY(e,t,r,n){const o=ya(e);let i=QY(Zn(e),r==="start",n);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(fv)))),i}function Ef(e){return e.replace(/left|right|bottom|top/g,t=>GY[t])}function eX(e){return{top:0,right:0,bottom:0,left:0,...e}}function Y_(e){return typeof e!="number"?eX(e):{top:e,right:e,bottom:e,left:e}}function Cf(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function CR(e,t,r){let{reference:n,floating:o}=e;const i=To(t),s=Ig(t),l=Ng(s),c=Zn(t),d=i==="y",f=n.x+n.width/2-o.width/2,p=n.y+n.height/2-o.height/2,h=n[l]/2-o[l]/2;let b;switch(c){case"top":b={x:f,y:n.y-o.height};break;case"bottom":b={x:f,y:n.y+n.height};break;case"right":b={x:n.x+n.width,y:p};break;case"left":b={x:n.x-o.width,y:p};break;default:b={x:n.x,y:n.y}}switch(ya(t)){case"start":b[s]-=h*(r&&d?-1:1);break;case"end":b[s]+=h*(r&&d?-1:1);break}return b}const tX=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:s}=r,l=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let d=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:p}=CR(d,n,c),h=n,b={},w=0;for(let y=0;y<l.length;y++){const{name:C,fn:x}=l[y],{x:P,y:S,data:D,reset:_}=await x({x:f,y:p,initialPlacement:n,placement:h,strategy:o,middlewareData:b,rects:d,platform:s,elements:{reference:e,floating:t}});f=P??f,p=S??p,b={...b,[C]:{...b[C],...D}},_&&w<=50&&(w++,typeof _=="object"&&(_.placement&&(h=_.placement),_.rects&&(d=_.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):_.rects),{x:f,y:p}=CR(d,h,c)),y=-1)}return{x:f,y:p,placement:h,strategy:o,middlewareData:b}};async function Gu(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:i,rects:s,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:p="floating",altBoundary:h=!1,padding:b=0}=Xn(t,e),w=Y_(b),C=l[h?p==="floating"?"reference":"floating":p],x=Cf(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(C)))==null||r?C:C.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:d,rootBoundary:f,strategy:c})),P=p==="floating"?{x:n,y:o,width:s.floating.width,height:s.floating.height}:s.reference,S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),D=await(i.isElement==null?void 0:i.isElement(S))?await(i.getScale==null?void 0:i.getScale(S))||{x:1,y:1}:{x:1,y:1},_=Cf(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:P,offsetParent:S,strategy:c}):P);return{top:(x.top-_.top+w.top)/D.y,bottom:(_.bottom-x.bottom+w.bottom)/D.y,left:(x.left-_.left+w.left)/D.x,right:(_.right-x.right+w.right)/D.x}}const rX=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:i,platform:s,elements:l,middlewareData:c}=t,{element:d,padding:f=0}=Xn(e,t)||{};if(d==null)return{};const p=Y_(f),h={x:r,y:n},b=Ig(o),w=Ng(b),y=await s.getDimensions(d),C=b==="y",x=C?"top":"left",P=C?"bottom":"right",S=C?"clientHeight":"clientWidth",D=i.reference[w]+i.reference[b]-h[b]-i.floating[w],_=h[b]-i.reference[b],T=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let A=T?T[S]:0;(!A||!await(s.isElement==null?void 0:s.isElement(T)))&&(A=l.floating[S]||i.floating[w]);const M=D/2-_/2,U=A/2-y[w]/2-1,J=_o(p[x],U),N=_o(p[P],U),K=J,W=A-y[w]-N,L=A/2-y[w]/2+M,G=dv(K,L,W),k=!c.arrow&&ya(o)!=null&&L!==G&&i.reference[w]/2-(L<K?J:N)-y[w]/2<0,F=k?L<K?L-K:L-W:0;return{[b]:h[b]+F,data:{[b]:G,centerOffset:L-G-F,...k&&{alignmentOffset:F}},reset:k}}}),nX=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:i,rects:s,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:h,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:y=!0,...C}=Xn(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const x=Zn(o),P=To(l),S=Zn(l)===l,D=await(c.isRTL==null?void 0:c.isRTL(d.floating)),_=h||(S||!y?[Ef(l)]:ZY(l)),T=w!=="none";!h&&T&&_.push(...JY(l,y,w,D));const A=[l,..._],M=await Gu(t,C),U=[];let J=((n=i.flip)==null?void 0:n.overflows)||[];if(f&&U.push(M[x]),p){const L=XY(o,s,D);U.push(M[L[0]],M[L[1]])}if(J=[...J,{placement:o,overflows:U}],!U.every(L=>L<=0)){var N,K;const L=(((N=i.flip)==null?void 0:N.index)||0)+1,G=A[L];if(G)return{data:{index:L,overflows:J},reset:{placement:G}};let k=(K=J.filter(F=>F.overflows[0]<=0).sort((F,j)=>F.overflows[1]-j.overflows[1])[0])==null?void 0:K.placement;if(!k)switch(b){case"bestFit":{var W;const F=(W=J.filter(j=>{if(T){const re=To(j.placement);return re===P||re==="y"}return!0}).map(j=>[j.placement,j.overflows.filter(re=>re>0).reduce((re,V)=>re+V,0)]).sort((j,re)=>j[1]-re[1])[0])==null?void 0:W[0];F&&(k=F);break}case"initialPlacement":k=l;break}if(o!==k)return{reset:{placement:k}}}return{}}}};function RR(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function PR(e){return zY.some(t=>e[t]>=0)}const oX=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=Xn(e,t);switch(n){case"referenceHidden":{const i=await Gu(t,{...o,elementContext:"reference"}),s=RR(i,r.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:PR(s)}}}case"escaped":{const i=await Gu(t,{...o,altBoundary:!0}),s=RR(i,r.floating);return{data:{escapedOffsets:s,escaped:PR(s)}}}default:return{}}}}};async function iX(e,t){const{placement:r,platform:n,elements:o}=e,i=await(n.isRTL==null?void 0:n.isRTL(o.floating)),s=Zn(r),l=ya(r),c=To(r)==="y",d=["left","top"].includes(s)?-1:1,f=i&&c?-1:1,p=Xn(t,e);let{mainAxis:h,crossAxis:b,alignmentAxis:w}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof w=="number"&&(b=l==="end"?w*-1:w),c?{x:b*f,y:h*d}:{x:h*d,y:b*f}}const aX=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:i,placement:s,middlewareData:l}=t,c=await iX(t,e);return s===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:s}}}}},sX=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:C=>{let{x,y:P}=C;return{x,y:P}}},...c}=Xn(e,t),d={x:r,y:n},f=await Gu(t,c),p=To(Zn(o)),h=Og(p);let b=d[h],w=d[p];if(i){const C=h==="y"?"top":"left",x=h==="y"?"bottom":"right",P=b+f[C],S=b-f[x];b=dv(P,b,S)}if(s){const C=p==="y"?"top":"left",x=p==="y"?"bottom":"right",P=w+f[C],S=w-f[x];w=dv(P,w,S)}const y=l.fn({...t,[h]:b,[p]:w});return{...y,data:{x:y.x-r,y:y.y-n,enabled:{[h]:i,[p]:s}}}}}},lX=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:i,middlewareData:s}=t,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=Xn(e,t),f={x:r,y:n},p=To(o),h=Og(p);let b=f[h],w=f[p];const y=Xn(l,t),C=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(c){const S=h==="y"?"height":"width",D=i.reference[h]-i.floating[S]+C.mainAxis,_=i.reference[h]+i.reference[S]-C.mainAxis;b<D?b=D:b>_&&(b=_)}if(d){var x,P;const S=h==="y"?"width":"height",D=["top","left"].includes(Zn(o)),_=i.reference[p]-i.floating[S]+(D&&((x=s.offset)==null?void 0:x[p])||0)+(D?0:C.crossAxis),T=i.reference[p]+i.reference[S]+(D?0:((P=s.offset)==null?void 0:P[p])||0)-(D?C.crossAxis:0);w<_?w=_:w>T&&(w=T)}return{[h]:b,[p]:w}}}},uX=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:i,platform:s,elements:l}=t,{apply:c=()=>{},...d}=Xn(e,t),f=await Gu(t,d),p=Zn(o),h=ya(o),b=To(o)==="y",{width:w,height:y}=i.floating;let C,x;p==="top"||p==="bottom"?(C=p,x=h===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(x=p,C=h==="end"?"top":"bottom");const P=y-f.top-f.bottom,S=w-f.left-f.right,D=_o(y-f[C],P),_=_o(w-f[x],S),T=!t.middlewareData.shift;let A=D,M=_;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(M=S),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(A=P),T&&!h){const J=Pr(f.left,0),N=Pr(f.right,0),K=Pr(f.top,0),W=Pr(f.bottom,0);b?M=w-2*(J!==0||N!==0?J+N:Pr(f.left,f.right)):A=y-2*(K!==0||W!==0?K+W:Pr(f.top,f.bottom))}await c({...t,availableWidth:M,availableHeight:A});const U=await s.getDimensions(l.floating);return w!==U.width||y!==U.height?{reset:{rects:!0}}:{}}}};function ep(){return typeof window<"u"}function xa(e){return X_(e)?(e.nodeName||"").toLowerCase():"#document"}function _r(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Cn(e){var t;return(t=(X_(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function X_(e){return ep()?e instanceof Node||e instanceof _r(e).Node:!1}function nn(e){return ep()?e instanceof Element||e instanceof _r(e).Element:!1}function xn(e){return ep()?e instanceof HTMLElement||e instanceof _r(e).HTMLElement:!1}function SR(e){return!ep()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof _r(e).ShadowRoot}function gc(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=on(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(o)}function cX(e){return["table","td","th"].includes(xa(e))}function tp(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function kg(e){const t=Lg(),r=nn(e)?on(e):e;return["transform","translate","scale","rotate","perspective"].some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function dX(e){let t=$o(e);for(;xn(t)&&!la(t);){if(kg(t))return t;if(tp(t))return null;t=$o(t)}return null}function Lg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function la(e){return["html","body","#document"].includes(xa(e))}function on(e){return _r(e).getComputedStyle(e)}function rp(e){return nn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function $o(e){if(xa(e)==="html")return e;const t=e.assignedSlot||e.parentNode||SR(e)&&e.host||Cn(e);return SR(t)?t.host:t}function Z_(e){const t=$o(e);return la(t)?e.ownerDocument?e.ownerDocument.body:e.body:xn(t)&&gc(t)?t:Z_(t)}function Yu(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=Z_(e),i=o===((n=e.ownerDocument)==null?void 0:n.body),s=_r(o);if(i){const l=pv(s);return t.concat(s,s.visualViewport||[],gc(o)?o:[],l&&r?Yu(l):[])}return t.concat(o,Yu(o,[],r))}function pv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Q_(e){const t=on(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=xn(e),i=o?e.offsetWidth:r,s=o?e.offsetHeight:n,l=wf(r)!==i||wf(n)!==s;return l&&(r=i,n=s),{width:r,height:n,$:l}}function Fg(e){return nn(e)?e:e.contextElement}function oa(e){const t=Fg(e);if(!xn(t))return yn(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:i}=Q_(t);let s=(i?wf(r.width):r.width)/n,l=(i?wf(r.height):r.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const fX=yn(0);function J_(e){const t=_r(e);return!Lg()||!t.visualViewport?fX:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function pX(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==_r(e)?!1:t}function pi(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),i=Fg(e);let s=yn(1);t&&(n?nn(n)&&(s=oa(n)):s=oa(e));const l=pX(i,r,n)?J_(i):yn(0);let c=(o.left+l.x)/s.x,d=(o.top+l.y)/s.y,f=o.width/s.x,p=o.height/s.y;if(i){const h=_r(i),b=n&&nn(n)?_r(n):n;let w=h,y=pv(w);for(;y&&n&&b!==w;){const C=oa(y),x=y.getBoundingClientRect(),P=on(y),S=x.left+(y.clientLeft+parseFloat(P.paddingLeft))*C.x,D=x.top+(y.clientTop+parseFloat(P.paddingTop))*C.y;c*=C.x,d*=C.y,f*=C.x,p*=C.y,c+=S,d+=D,w=_r(y),y=pv(w)}}return Cf({width:f,height:p,x:c,y:d})}function qg(e,t){const r=rp(e).scrollLeft;return t?t.left+r:pi(Cn(e)).left+r}function eT(e,t,r){r===void 0&&(r=!1);const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-(r?0:qg(e,n)),i=n.top+t.scrollTop;return{x:o,y:i}}function mX(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const i=o==="fixed",s=Cn(n),l=t?tp(t.floating):!1;if(n===s||l&&i)return r;let c={scrollLeft:0,scrollTop:0},d=yn(1);const f=yn(0),p=xn(n);if((p||!p&&!i)&&((xa(n)!=="body"||gc(s))&&(c=rp(n)),xn(n))){const b=pi(n);d=oa(n),f.x=b.x+n.clientLeft,f.y=b.y+n.clientTop}const h=s&&!p&&!i?eT(s,c,!0):yn(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-c.scrollLeft*d.x+f.x+h.x,y:r.y*d.y-c.scrollTop*d.y+f.y+h.y}}function hX(e){return Array.from(e.getClientRects())}function vX(e){const t=Cn(e),r=rp(e),n=e.ownerDocument.body,o=Pr(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=Pr(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+qg(e);const l=-r.scrollTop;return on(n).direction==="rtl"&&(s+=Pr(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:s,y:l}}function gX(e,t){const r=_r(e),n=Cn(e),o=r.visualViewport;let i=n.clientWidth,s=n.clientHeight,l=0,c=0;if(o){i=o.width,s=o.height;const d=Lg();(!d||d&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}return{width:i,height:s,x:l,y:c}}function bX(e,t){const r=pi(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=xn(e)?oa(e):yn(1),s=e.clientWidth*i.x,l=e.clientHeight*i.y,c=o*i.x,d=n*i.y;return{width:s,height:l,x:c,y:d}}function _R(e,t,r){let n;if(t==="viewport")n=gX(e,r);else if(t==="document")n=vX(Cn(e));else if(nn(t))n=bX(t,r);else{const o=J_(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Cf(n)}function tT(e,t){const r=$o(e);return r===t||!nn(r)||la(r)?!1:on(r).position==="fixed"||tT(r,t)}function yX(e,t){const r=t.get(e);if(r)return r;let n=Yu(e,[],!1).filter(l=>nn(l)&&xa(l)!=="body"),o=null;const i=on(e).position==="fixed";let s=i?$o(e):e;for(;nn(s)&&!la(s);){const l=on(s),c=kg(s);!c&&l.position==="fixed"&&(o=null),(i?!c&&!o:!c&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||gc(s)&&!c&&tT(e,s))?n=n.filter(f=>f!==s):o=l,s=$o(s)}return t.set(e,n),n}function xX(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const s=[...r==="clippingAncestors"?tp(t)?[]:yX(t,this._c):[].concat(r),n],l=s[0],c=s.reduce((d,f)=>{const p=_R(t,f,o);return d.top=Pr(p.top,d.top),d.right=_o(p.right,d.right),d.bottom=_o(p.bottom,d.bottom),d.left=Pr(p.left,d.left),d},_R(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function wX(e){const{width:t,height:r}=Q_(e);return{width:t,height:r}}function EX(e,t,r){const n=xn(t),o=Cn(t),i=r==="fixed",s=pi(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=yn(0);if(n||!n&&!i)if((xa(t)!=="body"||gc(o))&&(l=rp(t)),n){const h=pi(t,!0,i,t);c.x=h.x+t.clientLeft,c.y=h.y+t.clientTop}else o&&(c.x=qg(o));const d=o&&!n&&!i?eT(o,l):yn(0),f=s.left+l.scrollLeft-c.x-d.x,p=s.top+l.scrollTop-c.y-d.y;return{x:f,y:p,width:s.width,height:s.height}}function yh(e){return on(e).position==="static"}function TR(e,t){if(!xn(e)||on(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Cn(e)===r&&(r=r.ownerDocument.body),r}function rT(e,t){const r=_r(e);if(tp(e))return r;if(!xn(e)){let o=$o(e);for(;o&&!la(o);){if(nn(o)&&!yh(o))return o;o=$o(o)}return r}let n=TR(e,t);for(;n&&cX(n)&&yh(n);)n=TR(n,t);return n&&la(n)&&yh(n)&&!kg(n)?r:n||dX(e)||r}const CX=async function(e){const t=this.getOffsetParent||rT,r=this.getDimensions,n=await r(e.floating);return{reference:EX(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function RX(e){return on(e).direction==="rtl"}const PX={convertOffsetParentRelativeRectToViewportRelativeRect:mX,getDocumentElement:Cn,getClippingRect:xX,getOffsetParent:rT,getElementRects:CX,getClientRects:hX,getDimensions:wX,getScale:oa,isElement:nn,isRTL:RX};function nT(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function SX(e,t){let r=null,n;const o=Cn(e);function i(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function s(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const d=e.getBoundingClientRect(),{left:f,top:p,width:h,height:b}=d;if(l||t(),!h||!b)return;const w=Bd(p),y=Bd(o.clientWidth-(f+h)),C=Bd(o.clientHeight-(p+b)),x=Bd(f),S={rootMargin:-w+"px "+-y+"px "+-C+"px "+-x+"px",threshold:Pr(0,_o(1,c))||1};let D=!0;function _(T){const A=T[0].intersectionRatio;if(A!==c){if(!D)return s();A?s(!1,A):n=setTimeout(()=>{s(!1,1e-7)},1e3)}A===1&&!nT(d,e.getBoundingClientRect())&&s(),D=!1}try{r=new IntersectionObserver(_,{...S,root:o.ownerDocument})}catch{r=new IntersectionObserver(_,S)}r.observe(e)}return s(!0),i}function _X(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,d=Fg(e),f=o||i?[...d?Yu(d):[],...Yu(t)]:[];f.forEach(x=>{o&&x.addEventListener("scroll",r,{passive:!0}),i&&x.addEventListener("resize",r)});const p=d&&l?SX(d,r):null;let h=-1,b=null;s&&(b=new ResizeObserver(x=>{let[P]=x;P&&P.target===d&&b&&(b.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var S;(S=b)==null||S.observe(t)})),r()}),d&&!c&&b.observe(d),b.observe(t));let w,y=c?pi(e):null;c&&C();function C(){const x=pi(e);y&&!nT(y,x)&&r(),y=x,w=requestAnimationFrame(C)}return r(),()=>{var x;f.forEach(P=>{o&&P.removeEventListener("scroll",r),i&&P.removeEventListener("resize",r)}),p?.(),(x=b)==null||x.disconnect(),b=null,c&&cancelAnimationFrame(w)}}const TX=aX,$X=sX,AX=nX,DX=uX,MX=oX,$R=rX,OX=lX,NX=(e,t,r)=>{const n=new Map,o={platform:PX,...r},i={...o.platform,_c:n};return tX(e,t,{...o,platform:i})};var Qd=typeof document<"u"?R.useLayoutEffect:R.useEffect;function Rf(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!Rf(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const i=o[n];if(!(i==="_owner"&&e.$$typeof)&&!Rf(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function oT(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function AR(e,t){const r=oT(e);return Math.round(t*r)/r}function xh(e){const t=v.useRef(e);return Qd(()=>{t.current=e}),t}function IX(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[f,p]=v.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[h,b]=v.useState(n);Rf(h,n)||b(n);const[w,y]=v.useState(null),[C,x]=v.useState(null),P=v.useCallback(j=>{j!==T.current&&(T.current=j,y(j))},[]),S=v.useCallback(j=>{j!==A.current&&(A.current=j,x(j))},[]),D=i||w,_=s||C,T=v.useRef(null),A=v.useRef(null),M=v.useRef(f),U=c!=null,J=xh(c),N=xh(o),K=xh(d),W=v.useCallback(()=>{if(!T.current||!A.current)return;const j={placement:t,strategy:r,middleware:h};N.current&&(j.platform=N.current),NX(T.current,A.current,j).then(re=>{const V={...re,isPositioned:K.current!==!1};L.current&&!Rf(M.current,V)&&(M.current=V,da.flushSync(()=>{p(V)}))})},[h,t,r,N,K]);Qd(()=>{d===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,p(j=>({...j,isPositioned:!1})))},[d]);const L=v.useRef(!1);Qd(()=>(L.current=!0,()=>{L.current=!1}),[]),Qd(()=>{if(D&&(T.current=D),_&&(A.current=_),D&&_){if(J.current)return J.current(D,_,W);W()}},[D,_,W,J,U]);const G=v.useMemo(()=>({reference:T,floating:A,setReference:P,setFloating:S}),[P,S]),k=v.useMemo(()=>({reference:D,floating:_}),[D,_]),F=v.useMemo(()=>{const j={position:r,left:0,top:0};if(!k.floating)return j;const re=AR(k.floating,f.x),V=AR(k.floating,f.y);return l?{...j,transform:"translate("+re+"px, "+V+"px)",...oT(k.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:re,top:V}},[r,l,k.floating,f.x,f.y]);return v.useMemo(()=>({...f,update:W,refs:G,elements:k,floatingStyles:F}),[f,W,G,k,F])}const kX=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?$R({element:n.current,padding:o}).fn(r):{}:n?$R({element:n,padding:o}).fn(r):{}}}},LX=(e,t)=>({...TX(e),options:[e,t]}),FX=(e,t)=>({...$X(e),options:[e,t]}),qX=(e,t)=>({...OX(e),options:[e,t]}),jX=(e,t)=>({...AX(e),options:[e,t]}),BX=(e,t)=>({...DX(e),options:[e,t]}),VX=(e,t)=>({...MX(e),options:[e,t]}),KX=(e,t)=>({...kX(e),options:[e,t]});function WX(e){const t=HX(e),r=v.forwardRef((n,o)=>{const{children:i,...s}=n,l=v.Children.toArray(i),c=l.find(zX);if(c){const d=c.props.children,f=l.map(p=>p===c?v.Children.count(d)>1?v.Children.only(null):v.isValidElement(d)?d.props.children:null:p);return g.jsx(t,{...s,ref:o,children:v.isValidElement(d)?v.cloneElement(d,void 0,f):null})}return g.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}function HX(e){const t=v.forwardRef((r,n)=>{const{children:o,...i}=r;if(v.isValidElement(o)){const s=YX(o),l=GX(i,o.props);return o.type!==v.Fragment&&(l.ref=n?gt(n,s):s),v.cloneElement(o,l)}return v.Children.count(o)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var UX=Symbol("radix.slottable");function zX(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===UX}function GX(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function YX(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var XX=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ZX=XX.reduce((e,t)=>{const r=WX(`Primitive.${t}`),n=v.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),QX="Arrow",iT=v.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...i}=e;return g.jsx(ZX.svg,{...i,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});iT.displayName=QX;var JX=iT;function eZ(e){const t=tZ(e),r=v.forwardRef((n,o)=>{const{children:i,...s}=n,l=v.Children.toArray(i),c=l.find(nZ);if(c){const d=c.props.children,f=l.map(p=>p===c?v.Children.count(d)>1?v.Children.only(null):v.isValidElement(d)?d.props.children:null:p);return g.jsx(t,{...s,ref:o,children:v.isValidElement(d)?v.cloneElement(d,void 0,f):null})}return g.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}function tZ(e){const t=v.forwardRef((r,n)=>{const{children:o,...i}=r;if(v.isValidElement(o)){const s=iZ(o),l=oZ(i,o.props);return o.type!==v.Fragment&&(l.ref=n?gt(n,s):s),v.cloneElement(o,l)}return v.Children.count(o)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var rZ=Symbol("radix.slottable");function nZ(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===rZ}function oZ(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function iZ(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var aZ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],aT=aZ.reduce((e,t)=>{const r=eZ(`Primitive.${t}`),n=v.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function sZ(e){const[t,r]=v.useState(void 0);return Kt(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,l;if("borderBoxSize"in i){const c=i.borderBoxSize,d=Array.isArray(c)?c[0]:c;s=d.inlineSize,l=d.blockSize}else s=e.offsetWidth,l=e.offsetHeight;r({width:s,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var jg="Popper",[sT,Do]=wn(jg),[lZ,lT]=sT(jg),uT=e=>{const{__scopePopper:t,children:r}=e,[n,o]=v.useState(null);return g.jsx(lZ,{scope:t,anchor:n,onAnchorChange:o,children:r})};uT.displayName=jg;var cT="PopperAnchor",dT=v.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,i=lT(cT,r),s=v.useRef(null),l=Ve(t,s),c=v.useRef(null);return v.useEffect(()=>{const d=c.current;c.current=n?.current||s.current,d!==c.current&&i.onAnchorChange(c.current)}),n?null:g.jsx(aT.div,{...o,ref:l})});dT.displayName=cT;var Bg="PopperContent",[uZ,cZ]=sT(Bg),fT=v.forwardRef((e,t)=>{const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:p="partial",hideWhenDetached:h=!1,updatePositionStrategy:b="optimized",onPlaced:w,...y}=e,C=lT(Bg,r),[x,P]=v.useState(null),S=Ve(t,te=>P(te)),[D,_]=v.useState(null),T=sZ(D),A=T?.width??0,M=T?.height??0,U=n+(i!=="center"?"-"+i:""),J=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},N=Array.isArray(d)?d:[d],K=N.length>0,W={padding:J,boundary:N.filter(fZ),altBoundary:K},{refs:L,floatingStyles:G,placement:k,isPositioned:F,middlewareData:j}=IX({strategy:"fixed",placement:U,whileElementsMounted:(...te)=>_X(...te,{animationFrame:b==="always"}),elements:{reference:C.anchor},middleware:[LX({mainAxis:o+M,alignmentAxis:s}),c&&FX({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?qX():void 0,...W}),c&&jX({...W}),BX({...W,apply:({elements:te,rects:ve,availableWidth:q,availableHeight:ae})=>{const{width:oe,height:Z}=ve.reference,we=te.floating.style;we.setProperty("--radix-popper-available-width",`${q}px`),we.setProperty("--radix-popper-available-height",`${ae}px`),we.setProperty("--radix-popper-anchor-width",`${oe}px`),we.setProperty("--radix-popper-anchor-height",`${Z}px`)}}),D&&KX({element:D,padding:l}),pZ({arrowWidth:A,arrowHeight:M}),h&&VX({strategy:"referenceHidden",...W})]}),[re,V]=hT(k),ie=Xt(w);Kt(()=>{F&&ie?.()},[F,ie]);const Y=j.arrow?.x,X=j.arrow?.y,ce=j.arrow?.centerOffset!==0,[ue,pe]=v.useState();return Kt(()=>{x&&pe(window.getComputedStyle(x).zIndex)},[x]),g.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:F?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ue,"--radix-popper-transform-origin":[j.transformOrigin?.x,j.transformOrigin?.y].join(" "),...j.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:g.jsx(uZ,{scope:r,placedSide:re,onArrowChange:_,arrowX:Y,arrowY:X,shouldHideArrow:ce,children:g.jsx(aT.div,{"data-side":re,"data-align":V,...y,ref:S,style:{...y.style,animation:F?void 0:"none"}})})})});fT.displayName=Bg;var pT="PopperArrow",dZ={top:"bottom",right:"left",bottom:"top",left:"right"},mT=v.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,i=cZ(pT,n),s=dZ[i.placedSide];return g.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:g.jsx(JX,{...o,ref:r,style:{...o.style,display:"block"}})})});mT.displayName=pT;function fZ(e){return e!==null}var pZ=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:o}=t,s=o.arrow?.centerOffset!==0,l=s?0:e.arrowWidth,c=s?0:e.arrowHeight,[d,f]=hT(r),p={start:"0%",center:"50%",end:"100%"}[f],h=(o.arrow?.x??0)+l/2,b=(o.arrow?.y??0)+c/2;let w="",y="";return d==="bottom"?(w=s?p:`${h}px`,y=`${-c}px`):d==="top"?(w=s?p:`${h}px`,y=`${n.floating.height+c}px`):d==="right"?(w=`${-c}px`,y=s?p:`${b}px`):d==="left"&&(w=`${n.floating.width+c}px`,y=s?p:`${b}px`),{data:{x:w,y}}}});function hT(e){const[t,r="center"]=e.split("-");return[t,r]}var bc=uT,yc=dT,np=fT,op=mT;function vT(e){const t=mZ(e),r=v.forwardRef((n,o)=>{const{children:i,...s}=n,l=v.Children.toArray(i),c=l.find(vZ);if(c){const d=c.props.children,f=l.map(p=>p===c?v.Children.count(d)>1?v.Children.only(null):v.isValidElement(d)?d.props.children:null:p);return g.jsx(t,{...s,ref:o,children:v.isValidElement(d)?v.cloneElement(d,void 0,f):null})}return g.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}function mZ(e){const t=v.forwardRef((r,n)=>{const{children:o,...i}=r;if(v.isValidElement(o)){const s=bZ(o),l=gZ(i,o.props);return o.type!==v.Fragment&&(l.ref=n?gt(n,s):s),v.cloneElement(o,l)}return v.Children.count(o)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var hZ=Symbol("radix.slottable");function vZ(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===hZ}function gZ(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function bZ(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var yZ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],xc=yZ.reduce((e,t)=>{const r=vT(`Primitive.${t}`),n=v.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function xZ(e,t){e&&da.flushSync(()=>e.dispatchEvent(t))}function wZ(e){const t=EZ(e),r=v.forwardRef((n,o)=>{const{children:i,...s}=n,l=v.Children.toArray(i),c=l.find(RZ);if(c){const d=c.props.children,f=l.map(p=>p===c?v.Children.count(d)>1?v.Children.only(null):v.isValidElement(d)?d.props.children:null:p);return g.jsx(t,{...s,ref:o,children:v.isValidElement(d)?v.cloneElement(d,void 0,f):null})}return g.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}function EZ(e){const t=v.forwardRef((r,n)=>{const{children:o,...i}=r;if(v.isValidElement(o)){const s=SZ(o),l=PZ(i,o.props);return o.type!==v.Fragment&&(l.ref=n?gt(n,s):s),v.cloneElement(o,l)}return v.Children.count(o)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var CZ=Symbol("radix.slottable");function RZ(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===CZ}function PZ(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function SZ(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var _Z=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],gT=_Z.reduce((e,t)=>{const r=wZ(`Primitive.${t}`),n=v.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),wh="rovingFocusGroup.onEntryFocus",TZ={bubbles:!1,cancelable:!0},wc="RovingFocusGroup",[mv,bT,$Z]=Dg(wc),[AZ,yT]=wn(wc,[$Z]),[DZ,MZ]=AZ(wc),xT=v.forwardRef((e,t)=>g.jsx(mv.Provider,{scope:e.__scopeRovingFocusGroup,children:g.jsx(mv.Slot,{scope:e.__scopeRovingFocusGroup,children:g.jsx(OZ,{...e,ref:t})})}));xT.displayName=wc;var OZ=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...p}=e,h=v.useRef(null),b=Ve(t,h),w=Mg(i),[y,C]=ut({prop:s,defaultProp:l??null,onChange:c,caller:wc}),[x,P]=v.useState(!1),S=Xt(d),D=bT(r),_=v.useRef(!1),[T,A]=v.useState(0);return v.useEffect(()=>{const M=h.current;if(M)return M.addEventListener(wh,S),()=>M.removeEventListener(wh,S)},[S]),g.jsx(DZ,{scope:r,orientation:n,dir:w,loop:o,currentTabStopId:y,onItemFocus:v.useCallback(M=>C(M),[C]),onItemShiftTab:v.useCallback(()=>P(!0),[]),onFocusableItemAdd:v.useCallback(()=>A(M=>M+1),[]),onFocusableItemRemove:v.useCallback(()=>A(M=>M-1),[]),children:g.jsx(gT.div,{tabIndex:x||T===0?-1:0,"data-orientation":n,...p,ref:b,style:{outline:"none",...e.style},onMouseDown:Se(e.onMouseDown,()=>{_.current=!0}),onFocus:Se(e.onFocus,M=>{const U=!_.current;if(M.target===M.currentTarget&&U&&!x){const J=new CustomEvent(wh,TZ);if(M.currentTarget.dispatchEvent(J),!J.defaultPrevented){const N=D().filter(k=>k.focusable),K=N.find(k=>k.active),W=N.find(k=>k.id===y),G=[K,W,...N].filter(Boolean).map(k=>k.ref.current);CT(G,f)}}_.current=!1}),onBlur:Se(e.onBlur,()=>P(!1))})})}),wT="RovingFocusGroupItem",ET=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:o=!1,tabStopId:i,children:s,...l}=e,c=_t(),d=i||c,f=MZ(wT,r),p=f.currentTabStopId===d,h=bT(r),{onFocusableItemAdd:b,onFocusableItemRemove:w,currentTabStopId:y}=f;return v.useEffect(()=>{if(n)return b(),()=>w()},[n,b,w]),g.jsx(mv.ItemSlot,{scope:r,id:d,focusable:n,active:o,children:g.jsx(gT.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...l,ref:t,onMouseDown:Se(e.onMouseDown,C=>{n?f.onItemFocus(d):C.preventDefault()}),onFocus:Se(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:Se(e.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){f.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const x=kZ(C,f.orientation,f.dir);if(x!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let S=h().filter(D=>D.focusable).map(D=>D.ref.current);if(x==="last")S.reverse();else if(x==="prev"||x==="next"){x==="prev"&&S.reverse();const D=S.indexOf(C.currentTarget);S=f.loop?LZ(S,D+1):S.slice(D+1)}setTimeout(()=>CT(S))}}),children:typeof s=="function"?s({isCurrentTabStop:p,hasTabStop:y!=null}):s})})});ET.displayName=wT;var NZ={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function IZ(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function kZ(e,t,r){const n=IZ(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return NZ[n]}function CT(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function LZ(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var FZ=xT,qZ=ET,hv=["Enter"," "],jZ=["ArrowDown","PageUp","Home"],RT=["ArrowUp","PageDown","End"],BZ=[...jZ,...RT],VZ={ltr:[...hv,"ArrowRight"],rtl:[...hv,"ArrowLeft"]},KZ={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ec="Menu",[Xu,WZ,HZ]=Dg(Ec),[Ei,PT]=wn(Ec,[HZ,Do,yT]),Cc=Do(),ST=yT(),[_T,Mo]=Ei(Ec),[UZ,Rc]=Ei(Ec),TT=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:o,onOpenChange:i,modal:s=!0}=e,l=Cc(t),[c,d]=v.useState(null),f=v.useRef(!1),p=Xt(i),h=Mg(o);return v.useEffect(()=>{const b=()=>{f.current=!0,document.addEventListener("pointerdown",w,{capture:!0,once:!0}),document.addEventListener("pointermove",w,{capture:!0,once:!0})},w=()=>f.current=!1;return document.addEventListener("keydown",b,{capture:!0}),()=>{document.removeEventListener("keydown",b,{capture:!0}),document.removeEventListener("pointerdown",w,{capture:!0}),document.removeEventListener("pointermove",w,{capture:!0})}},[]),g.jsx(bc,{...l,children:g.jsx(_T,{scope:t,open:r,onOpenChange:p,content:c,onContentChange:d,children:g.jsx(UZ,{scope:t,onClose:v.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:f,dir:h,modal:s,children:n})})})};TT.displayName=Ec;var zZ="MenuAnchor",Vg=v.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,o=Cc(r);return g.jsx(yc,{...o,...n,ref:t})});Vg.displayName=zZ;var Kg="MenuPortal",[GZ,$T]=Ei(Kg,{forceMount:void 0}),AT=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:o}=e,i=Mo(Kg,t);return g.jsx(GZ,{scope:t,forceMount:r,children:g.jsx(Tr,{present:r||i.open,children:g.jsx(ha,{asChild:!0,container:o,children:n})})})};AT.displayName=Kg;var Kr="MenuContent",[YZ,Wg]=Ei(Kr),DT=v.forwardRef((e,t)=>{const r=$T(Kr,e.__scopeMenu),{forceMount:n=r.forceMount,...o}=e,i=Mo(Kr,e.__scopeMenu),s=Rc(Kr,e.__scopeMenu);return g.jsx(Xu.Provider,{scope:e.__scopeMenu,children:g.jsx(Tr,{present:n||i.open,children:g.jsx(Xu.Slot,{scope:e.__scopeMenu,children:s.modal?g.jsx(XZ,{...o,ref:t}):g.jsx(ZZ,{...o,ref:t})})})})}),XZ=v.forwardRef((e,t)=>{const r=Mo(Kr,e.__scopeMenu),n=v.useRef(null),o=Ve(t,n);return v.useEffect(()=>{const i=n.current;if(i)return oc(i)},[]),g.jsx(Hg,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Se(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),ZZ=v.forwardRef((e,t)=>{const r=Mo(Kr,e.__scopeMenu);return g.jsx(Hg,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),QZ=vT("MenuContent.ScrollLock"),Hg=v.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:h,onDismiss:b,disableOutsideScroll:w,...y}=e,C=Mo(Kr,r),x=Rc(Kr,r),P=Cc(r),S=ST(r),D=WZ(r),[_,T]=v.useState(null),A=v.useRef(null),M=Ve(t,A,C.onContentChange),U=v.useRef(0),J=v.useRef(""),N=v.useRef(0),K=v.useRef(null),W=v.useRef("right"),L=v.useRef(0),G=w?va:v.Fragment,k=w?{as:QZ,allowPinchZoom:!0}:void 0,F=re=>{const V=J.current+re,ie=D().filter(te=>!te.disabled),Y=document.activeElement,X=ie.find(te=>te.ref.current===Y)?.textValue,ce=ie.map(te=>te.textValue),ue=cQ(ce,V,X),pe=ie.find(te=>te.textValue===ue)?.ref.current;(function te(ve){J.current=ve,window.clearTimeout(U.current),ve!==""&&(U.current=window.setTimeout(()=>te(""),1e3))})(V),pe&&setTimeout(()=>pe.focus())};v.useEffect(()=>()=>window.clearTimeout(U.current),[]),Lf();const j=v.useCallback(re=>W.current===K.current?.side&&fQ(re,K.current?.area),[]);return g.jsx(YZ,{scope:r,searchRef:J,onItemEnter:v.useCallback(re=>{j(re)&&re.preventDefault()},[j]),onItemLeave:v.useCallback(re=>{j(re)||(A.current?.focus(),T(null))},[j]),onTriggerLeave:v.useCallback(re=>{j(re)&&re.preventDefault()},[j]),pointerGraceTimerRef:N,onPointerGraceIntentChange:v.useCallback(re=>{K.current=re},[]),children:g.jsx(G,{...k,children:g.jsx(rc,{asChild:!0,trapped:o,onMountAutoFocus:Se(i,re=>{re.preventDefault(),A.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:g.jsx(ma,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:h,onDismiss:b,children:g.jsx(FZ,{asChild:!0,...S,dir:x.dir,orientation:"vertical",loop:n,currentTabStopId:_,onCurrentTabStopIdChange:T,onEntryFocus:Se(c,re=>{x.isUsingKeyboardRef.current||re.preventDefault()}),preventScrollOnEntryFocus:!0,children:g.jsx(np,{role:"menu","aria-orientation":"vertical","data-state":GT(C.open),"data-radix-menu-content":"",dir:x.dir,...P,...y,ref:M,style:{outline:"none",...y.style},onKeyDown:Se(y.onKeyDown,re=>{const ie=re.target.closest("[data-radix-menu-content]")===re.currentTarget,Y=re.ctrlKey||re.altKey||re.metaKey,X=re.key.length===1;ie&&(re.key==="Tab"&&re.preventDefault(),!Y&&X&&F(re.key));const ce=A.current;if(re.target!==ce||!BZ.includes(re.key))return;re.preventDefault();const pe=D().filter(te=>!te.disabled).map(te=>te.ref.current);RT.includes(re.key)&&pe.reverse(),lQ(pe)}),onBlur:Se(e.onBlur,re=>{re.currentTarget.contains(re.target)||(window.clearTimeout(U.current),J.current="")}),onPointerMove:Se(e.onPointerMove,Zu(re=>{const V=re.target,ie=L.current!==re.clientX;if(re.currentTarget.contains(V)&&ie){const Y=re.clientX>L.current?"right":"left";W.current=Y,L.current=re.clientX}}))})})})})})})});DT.displayName=Kr;var JZ="MenuGroup",Ug=v.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return g.jsx(xc.div,{role:"group",...n,ref:t})});Ug.displayName=JZ;var eQ="MenuLabel",MT=v.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return g.jsx(xc.div,{...n,ref:t})});MT.displayName=eQ;var Pf="MenuItem",DR="menu.itemSelect",ip=v.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...o}=e,i=v.useRef(null),s=Rc(Pf,e.__scopeMenu),l=Wg(Pf,e.__scopeMenu),c=Ve(t,i),d=v.useRef(!1),f=()=>{const p=i.current;if(!r&&p){const h=new CustomEvent(DR,{bubbles:!0,cancelable:!0});p.addEventListener(DR,b=>n?.(b),{once:!0}),xZ(p,h),h.defaultPrevented?d.current=!1:s.onClose()}};return g.jsx(OT,{...o,ref:c,disabled:r,onClick:Se(e.onClick,f),onPointerDown:p=>{e.onPointerDown?.(p),d.current=!0},onPointerUp:Se(e.onPointerUp,p=>{d.current||p.currentTarget?.click()}),onKeyDown:Se(e.onKeyDown,p=>{const h=l.searchRef.current!=="";r||h&&p.key===" "||hv.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});ip.displayName=Pf;var OT=v.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:o,...i}=e,s=Wg(Pf,r),l=ST(r),c=v.useRef(null),d=Ve(t,c),[f,p]=v.useState(!1),[h,b]=v.useState("");return v.useEffect(()=>{const w=c.current;w&&b((w.textContent??"").trim())},[i.children]),g.jsx(Xu.ItemSlot,{scope:r,disabled:n,textValue:o??h,children:g.jsx(qZ,{asChild:!0,...l,focusable:!n,children:g.jsx(xc.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...i,ref:d,onPointerMove:Se(e.onPointerMove,Zu(w=>{n?s.onItemLeave(w):(s.onItemEnter(w),w.defaultPrevented||w.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Se(e.onPointerLeave,Zu(w=>s.onItemLeave(w))),onFocus:Se(e.onFocus,()=>p(!0)),onBlur:Se(e.onBlur,()=>p(!1))})})})}),tQ="MenuCheckboxItem",NT=v.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...o}=e;return g.jsx(qT,{scope:e.__scopeMenu,checked:r,children:g.jsx(ip,{role:"menuitemcheckbox","aria-checked":Sf(r)?"mixed":r,...o,ref:t,"data-state":Yg(r),onSelect:Se(o.onSelect,()=>n?.(Sf(r)?!0:!r),{checkForDefaultPrevented:!1})})})});NT.displayName=tQ;var IT="MenuRadioGroup",[rQ,nQ]=Ei(IT,{value:void 0,onValueChange:()=>{}}),kT=v.forwardRef((e,t)=>{const{value:r,onValueChange:n,...o}=e,i=Xt(n);return g.jsx(rQ,{scope:e.__scopeMenu,value:r,onValueChange:i,children:g.jsx(Ug,{...o,ref:t})})});kT.displayName=IT;var LT="MenuRadioItem",FT=v.forwardRef((e,t)=>{const{value:r,...n}=e,o=nQ(LT,e.__scopeMenu),i=r===o.value;return g.jsx(qT,{scope:e.__scopeMenu,checked:i,children:g.jsx(ip,{role:"menuitemradio","aria-checked":i,...n,ref:t,"data-state":Yg(i),onSelect:Se(n.onSelect,()=>o.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});FT.displayName=LT;var zg="MenuItemIndicator",[qT,oQ]=Ei(zg,{checked:!1}),jT=v.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...o}=e,i=oQ(zg,r);return g.jsx(Tr,{present:n||Sf(i.checked)||i.checked===!0,children:g.jsx(xc.span,{...o,ref:t,"data-state":Yg(i.checked)})})});jT.displayName=zg;var iQ="MenuSeparator",BT=v.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return g.jsx(xc.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});BT.displayName=iQ;var aQ="MenuArrow",VT=v.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,o=Cc(r);return g.jsx(op,{...o,...n,ref:t})});VT.displayName=aQ;var Gg="MenuSub",[sQ,KT]=Ei(Gg),WT=e=>{const{__scopeMenu:t,children:r,open:n=!1,onOpenChange:o}=e,i=Mo(Gg,t),s=Cc(t),[l,c]=v.useState(null),[d,f]=v.useState(null),p=Xt(o);return v.useEffect(()=>(i.open===!1&&p(!1),()=>p(!1)),[i.open,p]),g.jsx(bc,{...s,children:g.jsx(_T,{scope:t,open:n,onOpenChange:p,content:d,onContentChange:f,children:g.jsx(sQ,{scope:t,contentId:_t(),triggerId:_t(),trigger:l,onTriggerChange:c,children:r})})})};WT.displayName=Gg;var Ou="MenuSubTrigger",HT=v.forwardRef((e,t)=>{const r=Mo(Ou,e.__scopeMenu),n=Rc(Ou,e.__scopeMenu),o=KT(Ou,e.__scopeMenu),i=Wg(Ou,e.__scopeMenu),s=v.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=i,d={__scopeMenu:e.__scopeMenu},f=v.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return v.useEffect(()=>f,[f]),v.useEffect(()=>{const p=l.current;return()=>{window.clearTimeout(p),c(null)}},[l,c]),g.jsx(Vg,{asChild:!0,...d,children:g.jsx(OT,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":o.contentId,"data-state":GT(r.open),...e,ref:gt(t,o.onTriggerChange),onClick:p=>{e.onClick?.(p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:Se(e.onPointerMove,Zu(p=>{i.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!r.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{r.onOpenChange(!0),f()},100))})),onPointerLeave:Se(e.onPointerLeave,Zu(p=>{f();const h=r.content?.getBoundingClientRect();if(h){const b=r.content?.dataset.side,w=b==="right",y=w?-5:5,C=h[w?"left":"right"],x=h[w?"right":"left"];i.onPointerGraceIntentChange({area:[{x:p.clientX+y,y:p.clientY},{x:C,y:h.top},{x,y:h.top},{x,y:h.bottom},{x:C,y:h.bottom}],side:b}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(p),p.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:Se(e.onKeyDown,p=>{const h=i.searchRef.current!=="";e.disabled||h&&p.key===" "||VZ[n.dir].includes(p.key)&&(r.onOpenChange(!0),r.content?.focus(),p.preventDefault())})})})});HT.displayName=Ou;var UT="MenuSubContent",zT=v.forwardRef((e,t)=>{const r=$T(Kr,e.__scopeMenu),{forceMount:n=r.forceMount,...o}=e,i=Mo(Kr,e.__scopeMenu),s=Rc(Kr,e.__scopeMenu),l=KT(UT,e.__scopeMenu),c=v.useRef(null),d=Ve(t,c);return g.jsx(Xu.Provider,{scope:e.__scopeMenu,children:g.jsx(Tr,{present:n||i.open,children:g.jsx(Xu.Slot,{scope:e.__scopeMenu,children:g.jsx(Hg,{id:l.contentId,"aria-labelledby":l.triggerId,...o,ref:d,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{s.isUsingKeyboardRef.current&&c.current?.focus(),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:Se(e.onFocusOutside,f=>{f.target!==l.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Se(e.onEscapeKeyDown,f=>{s.onClose(),f.preventDefault()}),onKeyDown:Se(e.onKeyDown,f=>{const p=f.currentTarget.contains(f.target),h=KZ[s.dir].includes(f.key);p&&h&&(i.onOpenChange(!1),l.trigger?.focus(),f.preventDefault())})})})})})});zT.displayName=UT;function GT(e){return e?"open":"closed"}function Sf(e){return e==="indeterminate"}function Yg(e){return Sf(e)?"indeterminate":e?"checked":"unchecked"}function lQ(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function uQ(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function cQ(e,t,r){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let s=uQ(e,Math.max(i,0));o.length===1&&(s=s.filter(d=>d!==r));const c=s.find(d=>d.toLowerCase().startsWith(o.toLowerCase()));return c!==r?c:void 0}function dQ(e,t){const{x:r,y:n}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const l=t[i],c=t[s],d=l.x,f=l.y,p=c.x,h=c.y;f>n!=h>n&&r<(p-d)*(n-f)/(h-f)+d&&(o=!o)}return o}function fQ(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return dQ(r,t)}function Zu(e){return t=>t.pointerType==="mouse"?e(t):void 0}var pQ=TT,mQ=Vg,hQ=AT,vQ=DT,gQ=Ug,bQ=MT,yQ=ip,xQ=NT,wQ=kT,EQ=FT,CQ=jT,RQ=BT,PQ=VT,SQ=WT,_Q=HT,TQ=zT,ap="DropdownMenu",[$Q]=wn(ap,[PT]),nr=PT(),[AQ,YT]=$Q(ap),XT=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:o,defaultOpen:i,onOpenChange:s,modal:l=!0}=e,c=nr(t),d=v.useRef(null),[f,p]=ut({prop:o,defaultProp:i??!1,onChange:s,caller:ap});return g.jsx(AQ,{scope:t,triggerId:_t(),triggerRef:d,contentId:_t(),open:f,onOpenChange:p,onOpenToggle:v.useCallback(()=>p(h=>!h),[p]),modal:l,children:g.jsx(pQ,{...c,open:f,onOpenChange:p,dir:n,modal:l,children:r})})};XT.displayName=ap;var ZT="DropdownMenuTrigger",QT=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...o}=e,i=YT(ZT,r),s=nr(r);return g.jsx(mQ,{asChild:!0,...s,children:g.jsx(jY.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...o,ref:gt(t,i.triggerRef),onPointerDown:Se(e.onPointerDown,l=>{!n&&l.button===0&&l.ctrlKey===!1&&(i.onOpenToggle(),i.open||l.preventDefault())}),onKeyDown:Se(e.onKeyDown,l=>{n||(["Enter"," "].includes(l.key)&&i.onOpenToggle(),l.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});QT.displayName=ZT;var DQ="DropdownMenuPortal",JT=e=>{const{__scopeDropdownMenu:t,...r}=e,n=nr(t);return g.jsx(hQ,{...n,...r})};JT.displayName=DQ;var e$="DropdownMenuContent",t$=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=YT(e$,r),i=nr(r),s=v.useRef(!1);return g.jsx(vQ,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...n,ref:t,onCloseAutoFocus:Se(e.onCloseAutoFocus,l=>{s.current||o.triggerRef.current?.focus(),s.current=!1,l.preventDefault()}),onInteractOutside:Se(e.onInteractOutside,l=>{const c=l.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,f=c.button===2||d;(!o.modal||f)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});t$.displayName=e$;var MQ="DropdownMenuGroup",r$=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=nr(r);return g.jsx(gQ,{...o,...n,ref:t})});r$.displayName=MQ;var OQ="DropdownMenuLabel",n$=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=nr(r);return g.jsx(bQ,{...o,...n,ref:t})});n$.displayName=OQ;var NQ="DropdownMenuItem",o$=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=nr(r);return g.jsx(yQ,{...o,...n,ref:t})});o$.displayName=NQ;var IQ="DropdownMenuCheckboxItem",i$=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=nr(r);return g.jsx(xQ,{...o,...n,ref:t})});i$.displayName=IQ;var kQ="DropdownMenuRadioGroup",a$=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=nr(r);return g.jsx(wQ,{...o,...n,ref:t})});a$.displayName=kQ;var LQ="DropdownMenuRadioItem",s$=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=nr(r);return g.jsx(EQ,{...o,...n,ref:t})});s$.displayName=LQ;var FQ="DropdownMenuItemIndicator",l$=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=nr(r);return g.jsx(CQ,{...o,...n,ref:t})});l$.displayName=FQ;var qQ="DropdownMenuSeparator",u$=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=nr(r);return g.jsx(RQ,{...o,...n,ref:t})});u$.displayName=qQ;var jQ="DropdownMenuArrow",BQ=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=nr(r);return g.jsx(PQ,{...o,...n,ref:t})});BQ.displayName=jQ;var VQ=e=>{const{__scopeDropdownMenu:t,children:r,open:n,onOpenChange:o,defaultOpen:i}=e,s=nr(t),[l,c]=ut({prop:n,defaultProp:i??!1,onChange:o,caller:"DropdownMenuSub"});return g.jsx(SQ,{...s,open:l,onOpenChange:c,children:r})},KQ="DropdownMenuSubTrigger",c$=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=nr(r);return g.jsx(_Q,{...o,...n,ref:t})});c$.displayName=KQ;var WQ="DropdownMenuSubContent",d$=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=nr(r);return g.jsx(TQ,{...o,...n,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});d$.displayName=WQ;var HQ=XT,UQ=QT,f$=JT,zQ=t$,GQ=r$,YQ=n$,XQ=o$,ZQ=i$,QQ=a$,JQ=s$,p$=l$,eJ=u$,tJ=VQ,rJ=c$,nJ=d$;const m$=e=>g.jsx(HQ,{"data-slot":"menu",...e}),h$=e=>g.jsx(UQ,{"data-slot":"menu-trigger",...e}),oJ=e=>g.jsx(GQ,{"data-slot":"menu-group",...e}),iJ=e=>g.jsx(f$,{"data-slot":"menu-portal",...e}),v$=e=>g.jsx(tJ,{"data-slot":"menu-sub",...e}),aJ=e=>g.jsx(QQ,{"data-slot":"menu-radio-group",...e}),g$=({className:e,inset:t,children:r,...n})=>g.jsxs(rJ,{"data-slot":"menu-sub-trigger",className:le("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state='open']:bg-accent",t&&"pl-8",e),...n,children:[r,g.jsx(ic,{className:"ml-auto h-4 w-4"})]}),b$=({className:e,...t})=>g.jsx(nJ,{"data-slot":"menu-sub-content",className:le("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state='open']:animate-in data-[state='closed']:animate-out data-[state='closed']:fade-out-0 data-[state='open']:fade-in-0 data-[state='closed']:zoom-out-95 data-[state='open']:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}),y$=({className:e,sideOffset:t=4,...r})=>g.jsx(f$,{"data-slot":"menu-portal",children:g.jsx(zQ,{"data-slot":"menu-content",sideOffset:t,className:le("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state='open']:animate-in data-[state='closed']:animate-out data-[state='closed']:fade-out-0 data-[state='open']:fade-in-0 data-[state='closed']:zoom-out-95 data-[state='open']:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}),x$=({className:e,inset:t,...r})=>g.jsx(XQ,{"data-slot":"menu-item",className:le("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...r}),w$=({className:e,children:t,checked:r,...n})=>g.jsxs(ZQ,{"data-slot":"menu-checkbox-item",className:le("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...n,children:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(p$,{children:g.jsx(of,{className:"h-4 w-4"})})}),t]}),E$=({className:e,children:t,...r})=>g.jsxs(JQ,{"data-slot":"menu-radio-item",className:le("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(p$,{children:g.jsx(n5,{className:"h-2 w-2 fill-current"})})}),t]}),C$=({className:e,inset:t,...r})=>g.jsx(YQ,{"data-slot":"menu-label",className:le("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}),R$=({className:e,...t})=>g.jsx(eJ,{"data-slot":"menu-separator",className:le("-mx-1 my-1 h-px bg-muted",e),...t}),P$=({className:e,keys:t,handler:r,options:n={},...o})=>(K_(t,r,n),g.jsx("span",{"data-slot":"menu-shortcut",className:le("ml-auto text-xs tracking-widest opacity-60",e),...o})),S$=(e,t)=>{switch(e.type){case"item":return g.jsxs(x$,{...e,children:[e.label," ",t]});case"checkbox":return g.jsxs(w$,{...e,children:[e.label," ",t]});case"radio":return g.jsxs(E$,{...e,children:[e.label," ",t]});case"label":return g.jsxs(C$,{...e,children:[e.label," "]});case"separator":return g.jsx(R$,{...e});case"submenu":return g.jsxs(v$,{children:[g.jsx(g$,{...e,children:e.label}),g.jsx(b$,{children:e.items?.map((r,n)=>g.jsx(R.Fragment,{children:S$(r)},n))})]});default:return null}},sJ=({trigger:e,items:t,contentProps:r,side:n="bottom",offset:o})=>g.jsxs(m$,{children:[g.jsx(h$,{asChild:!0,children:e}),g.jsx(y$,{side:n,sideOffset:o,...r,children:t.map(({shortcut:i,onShortcut:s,shortcutOptions:l,...c},d)=>g.jsx(R.Fragment,{children:S$(c,i&&g.jsx(P$,{keys:i,handler:f=>s?.(f),options:l,children:i}))},d))})]}),_$=eo("inline-flex items-center relative overflow-hidden bg-gray-100 gap-1 px-2.5 py-0.5 text-xs font-normal transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{rounded:{default:"rounded-(--radius-tag)",full:"rounded-full",square:"rounded-sm"},variant:{primary:"bg-primary border-primary text-primary-foreground hover:bg-primary/80",secondary:"bg-secondary border-secondary !text-secondary-foreground hover:bg-secondary/80",error:"bg-error border-error text-error-foreground hover:bg-error/80",success:"bg-success border-success text-success-foreground hover:bg-success/80",outline:"border border-foreground text-foreground",borderless:"text-foreground"}},defaultVariants:{rounded:"default",variant:"primary"}}),vv=({className:e,color:t,variant:r,rounded:n,icon:o,closable:i,onClose:s,children:l,...c})=>{const d=!!t&&(r==="outline"||r==="borderless"),f=!!t&&!r;return g.jsxs("div",{"data-slot":"tag",className:le(_$({variant:r,rounded:n}),d&&"bg-white",f&&" text-white",!!o&&"pl-1.5",!!i&&"pr-1.5",e),style:{...d&&{color:t,borderColor:t},...f&&{borderColor:t,backgroundColor:t}},...c,children:[o,l,i&&g.jsx("button",{type:"button","data-slot":"tag-close",className:"z-10 h-4 w-4 cursor-pointer",onClick:p=>{p.stopPropagation(),s()},children:g.jsx(jf,{"data-slot":"tag-close-icon"})}),g.jsx("span",{"data-slot":"tag-overlay",className:"w-full h-full absolute top-0 left-0",style:{...d&&{opacity:.13,backgroundColor:t}}})]})};function T$(e){const t=lJ(e),r=v.forwardRef((n,o)=>{const{children:i,...s}=n,l=v.Children.toArray(i),c=l.find(cJ);if(c){const d=c.props.children,f=l.map(p=>p===c?v.Children.count(d)>1?v.Children.only(null):v.isValidElement(d)?d.props.children:null:p);return g.jsx(t,{...s,ref:o,children:v.isValidElement(d)?v.cloneElement(d,void 0,f):null})}return g.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}function lJ(e){const t=v.forwardRef((r,n)=>{const{children:o,...i}=r;if(v.isValidElement(o)){const s=fJ(o),l=dJ(i,o.props);return o.type!==v.Fragment&&(l.ref=n?gt(n,s):s),v.cloneElement(o,l)}return v.Children.count(o)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var uJ=Symbol("radix.slottable");function cJ(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===uJ}function dJ(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function fJ(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var pJ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$$=pJ.reduce((e,t)=>{const r=T$(`Primitive.${t}`),n=v.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),sp="Popover",[A$]=wn(sp,[Do]),Pc=Do(),[mJ,Oo]=A$(sp),D$=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,l=Pc(t),c=v.useRef(null),[d,f]=v.useState(!1),[p,h]=ut({prop:n,defaultProp:o??!1,onChange:i,caller:sp});return g.jsx(bc,{...l,children:g.jsx(mJ,{scope:t,contentId:_t(),triggerRef:c,open:p,onOpenChange:h,onOpenToggle:v.useCallback(()=>h(b=>!b),[h]),hasCustomAnchor:d,onCustomAnchorAdd:v.useCallback(()=>f(!0),[]),onCustomAnchorRemove:v.useCallback(()=>f(!1),[]),modal:s,children:r})})};D$.displayName=sp;var M$="PopoverAnchor",hJ=v.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Oo(M$,r),i=Pc(r),{onCustomAnchorAdd:s,onCustomAnchorRemove:l}=o;return v.useEffect(()=>(s(),()=>l()),[s,l]),g.jsx(yc,{...i,...n,ref:t})});hJ.displayName=M$;var O$="PopoverTrigger",N$=v.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Oo(O$,r),i=Pc(r),s=Ve(t,o.triggerRef),l=g.jsx($$.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":q$(o.open),...n,ref:s,onClick:Se(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:g.jsx(yc,{asChild:!0,...i,children:l})});N$.displayName=O$;var Xg="PopoverPortal",[vJ,gJ]=A$(Xg,{forceMount:void 0}),I$=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,i=Oo(Xg,t);return g.jsx(vJ,{scope:t,forceMount:r,children:g.jsx(Tr,{present:r||i.open,children:g.jsx(ha,{asChild:!0,container:o,children:n})})})};I$.displayName=Xg;var ua="PopoverContent",k$=v.forwardRef((e,t)=>{const r=gJ(ua,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,i=Oo(ua,e.__scopePopover);return g.jsx(Tr,{present:n||i.open,children:i.modal?g.jsx(yJ,{...o,ref:t}):g.jsx(xJ,{...o,ref:t})})});k$.displayName=ua;var bJ=T$("PopoverContent.RemoveScroll"),yJ=v.forwardRef((e,t)=>{const r=Oo(ua,e.__scopePopover),n=v.useRef(null),o=Ve(t,n),i=v.useRef(!1);return v.useEffect(()=>{const s=n.current;if(s)return oc(s)},[]),g.jsx(va,{as:bJ,allowPinchZoom:!0,children:g.jsx(L$,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Se(e.onCloseAutoFocus,s=>{s.preventDefault(),i.current||r.triggerRef.current?.focus()}),onPointerDownOutside:Se(e.onPointerDownOutside,s=>{const l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:Se(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),xJ=v.forwardRef((e,t)=>{const r=Oo(ua,e.__scopePopover),n=v.useRef(!1),o=v.useRef(!1);return g.jsx(L$,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(n.current||r.triggerRef.current?.focus(),i.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;r.triggerRef.current?.contains(s)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),L$=v.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,...p}=e,h=Oo(ua,r),b=Pc(r);return Lf(),g.jsx(rc,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:g.jsx(ma,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:f,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>h.onOpenChange(!1),children:g.jsx(np,{"data-state":q$(h.open),role:"dialog",id:h.contentId,...b,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),F$="PopoverClose",wJ=v.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Oo(F$,r);return g.jsx($$.button,{type:"button",...n,ref:t,onClick:Se(e.onClick,()=>o.onOpenChange(!1))})});wJ.displayName=F$;var EJ="PopoverArrow",CJ=v.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Pc(r);return g.jsx(op,{...o,...n,ref:t})});CJ.displayName=EJ;function q$(e){return e?"open":"closed"}var RJ=D$,PJ=N$,SJ=I$,_J=k$;const Sc=e=>g.jsx(RJ,{"data-slot":"popover",...e}),_c=e=>g.jsx(PJ,{"data-slot":"popover-trigger",...e}),Tc=({className:e,align:t="center",sideOffset:r=4,matchTriggerWidth:n=!1,style:o,focus:i=!0,...s})=>g.jsx(SJ,{children:g.jsx(_J,{"data-slot":"popover-content",align:t,sideOffset:r,onOpenAutoFocus:l=>{!i&&l.preventDefault(),s?.onOpenAutoFocus?.(l)},className:le("z-50 w-72 p-4 rounded-md border bg-popover text-popover-foreground shadow-md outline-none open:animate-in closed:animate-out closed:fade-out-0 open:fade-in-0 closed:zoom-out-95 open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),style:{...o,...n&&{width:"var(--radix-popper-anchor-width)"}},...s})}),TJ=e=>{const{trigger:t,children:r,rootProps:n,triggerProps:o,contentProps:i,triggerAsChild:s=!0,matchTriggerWidth:l,triggerClassName:c,contentClassName:d,side:f="bottom",offset:p}=ac("Popover",e,{triggerAsChild:!0,side:"bottom"});return g.jsxs(Sc,{...n,children:[g.jsx(_c,{asChild:s,className:c,...o,children:t}),g.jsx(Tc,{className:d,matchTriggerWidth:l,side:f,sideOffset:p,...i,children:r})]})},MR=eo("m-1 transition ease-in-out delay-150 duration-300",{variants:{variant:{default:"border-foreground/10 border text-foreground bg-card hover:bg-card/80",primary:"border-foreground/10 border text-foreground bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-foreground/60 border bg-secondary text-secondary-foreground hover:bg-secondary/80",error:"border-transparent bg-error text-error-foreground hover:bg-error/80"}},defaultVariants:{variant:"default"}}),$J=({valueKey:e,values:t,setValues:r,items:n,maxCount:o,setIsPopoverOpen:i})=>{const s=h=>{if(h.key==="Enter")i(!0);else if(h.key==="Backspace"&&!h.currentTarget.value){const b=[...t];b.pop(),r?.(b)}},l=h=>{const b=t.includes(h)?t.filter(w=>w!==h):[...t,h];r?.(b)},c=()=>{r?.([])};return{handleInputKeyDown:s,toggleOption:l,handleClear:c,handleTogglePopover:()=>{i(h=>!h)},clearExtraOptions:()=>{const h=t.slice(0,o);r?.(h)},toggleAll:()=>{const h=n.filter(b=>!b.disabled);if(t.length===h.length)c();else{const b=h.map(w=>w[e]);r?.(b)}}}},AJ=({items:e=[],value:t,valueKey:r="value",labelKey:n="label",onChange:o,variant:i,defaultValue:s=[],placeholder:l="Seleccionar",maxCount:c=3,className:d,renderOption:f=C=>C[n],withCheckbox:p=!1,showSearch:h=!0,showSelectAll:b=!0,rootProps:w,...y})=>{const[C=[],x]=ut({prop:t,onChange:o,defaultProp:s}),[P,S]=ut({prop:y.open,onChange:y.onOpenChange,defaultProp:y.defaultOpen||!1}),D=v.useMemo(()=>e.filter(N=>!N.disabled),[e]),{handleInputKeyDown:_,toggleOption:T,handleClear:A,handleTogglePopover:M,clearExtraOptions:U,toggleAll:J}=$J({valueKey:r,values:C,setValues:x,items:e,maxCount:c,setIsPopoverOpen:S});return g.jsxs(Sc,{open:P,onOpenChange:S,"data-slot":"multi-select",...w,children:[g.jsx(_c,{asChild:!0,"data-slot":"multi-select-trigger",children:g.jsx(tr,{...y,onClick:M,className:le("flex w-full p-1 rounded-md border border-input min-h-10 h-auto items-center justify-between bg-inherit hover:bg-inherit",d),children:C.length>0?g.jsxs("div",{className:"flex justify-between items-center w-full",children:[g.jsxs("div",{className:"flex flex-wrap items-center","data-slot":"multi-select-tags",children:[C.slice(0,c).map(N=>{const K=e.find(L=>L[r]===N),W=K?.icon;return g.jsxs(vv,{"data-slot":"multi-select-tag",className:le(MR({variant:i})),closable:!0,onClose:()=>T(N),children:[W&&g.jsx(W,{className:"h-4 w-4 mr-2"}),K&&f?.(K)]},N)}),C.length>c&&g.jsx(vv,{"data-slot":"multi-select-tag",className:le(MR({variant:i})),closable:!0,onClose:U,children:`+ ${C.length-c} más`})]}),g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsx(jf,{"data-slot":"multi-select-clear",className:"h-4 mx-2 cursor-pointer text-muted-foreground",onClick:N=>{N.stopPropagation(),A()}}),g.jsx(c_,{"data-slot":"multi-select-divider",orientation:"vertical",className:"flex min-h-6 h-full"}),g.jsx(af,{"data-slot":"multi-select-trigger-icon",className:"h-4 mx-2 cursor-pointer text-muted-foreground"})]})]}):g.jsxs("div",{className:"flex items-center justify-between w-full mx-auto","data-slot":"multi-select-trigger-empty",children:[g.jsx("span",{className:"text-sm text-foreground font-normal mx-2","data-slot":"multi-select-placeholder",children:l}),g.jsx(af,{"data-slot":"multi-select-trigger-icon",className:"h-4 cursor-pointer text-muted-foreground mx-2"})]})})}),g.jsx(Tc,{"data-slot":"multi-select-content",className:"p-0",matchTriggerWidth:!0,align:"start",asChild:!0,onEscapeKeyDown:()=>S(!1),children:g.jsxs(uc,{children:[h&&g.jsx(Uf,{"data-slot":"multi-select-input",placeholder:"Buscar...",onKeyDown:_}),g.jsxs(zf,{"data-slot":"multi-select-list",children:[g.jsx(Gf,{"data-slot":"multi-select-empty",children:"No results found."}),g.jsxs(sS,{"data-slot":"multi-select-group",children:[b&&g.jsxs(Ku,{"data-slot":"multi-select-item",onSelect:J,className:le("cursor-pointer",!p&&C.length===D.length&&"bg-accent text-accent-foreground"),children:[p&&g.jsx("div",{className:le("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",C.length===D.length?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:g.jsx(of,{className:"h-4 w-4"})}),g.jsx("span",{children:"(Seleccionar todo)"})]},"all"),e.map(N=>{const K=C.includes(N[r]);return g.jsxs(Ku,{"data-slot":"multi-select-item",onSelect:()=>!N.disabled&&T(N[r]),className:le(N.disabled?"!bg-neutral-50 !text-neutral-400":"cursor-pointer",!p&&K&&"!bg-accent !text-accent-foreground"),children:[p&&g.jsx("div",{className:le("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",K?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:g.jsx(of,{className:"h-4 w-4"})}),N.icon&&g.jsx(N.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),g.jsx("span",{children:f?.(N)})]},N[r])})]})]})]})})]})},DJ=({value:e,onChange:t,defaultValue:r,className:n,min:o,max:i,...s})=>{const[l,c]=ut({prop:e,onChange:t,defaultProp:r}),d=l??o??0,f=w=>{const y=parseInt(w.target.value,10);c(y)},p=()=>{if(lt.isUndefined(l)&&lt.isNumber(o))return c(o??0);const w=d+1;(lt.isUndefined(i)||w<=i)&&c(w)},h=()=>{if(lt.isUndefined(l)&&lt.isNumber(i))return c(i??0);const w=d-1;(lt.isUndefined(o)||w>=o)&&c(w)},b=()=>{const w=lt.isNumber(o)&&d<o,y=lt.isNumber(i)&&d>i;w?c(o):y&&c(i)};return g.jsxs("div",{className:"relative w-full","data-slot":"number-input-container",children:[g.jsx("input",{...s,type:"number",value:l,onChange:f,onBlur:b,min:o,max:i,className:le("numberInput","h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","file:border-0 file:bg-transparent file:text-sm file:font-medium",n),"data-slot":"number-input"}),g.jsxs("div",{className:"absolute right-0 top-0 h-full w-6 py-1 gap-px justify-center items-center flex flex-col border-l border-input overflow-hidden",children:[g.jsx(tr,{variant:"ghost",size:"icon",onClick:p,className:"h-4 w-4 grow rounded-sm","data-testid":"increment-trigger","data-slot":"number-input-increment",children:g.jsx(EP,{"data-slot":"number-input-increment-icon"})}),g.jsx(tr,{variant:"ghost",size:"icon",onClick:h,className:"h-4 w-4 grow rounded-sm","data-testid":"decrement-trigger","data-slot":"number-input-decrement",children:g.jsx(wP,{"data-slot":"number-input-decrement-icon"})})]})]})},zi=({isActive:e=!1,...t})=>g.jsx("button",{...t,"data-slot":"pagination-option","data-active":e,"data-dots":t.children===Co,className:le("transition-colors border py-2 px-4 w-[50px] h-full data-[active=false]:hover:bg-accent","data-[active=true]:bg-primary data-[active=true]:text-primary-foreground data-[active=true]:border-transparent data-[active=true]:hover:bg-primary/90",t.className)}),MJ=({optionProps:e,className:t,containerProps:r,...n})=>{const{paginationRange:o,currentPage:i,goTo:s,maxPage:l,next:c,prev:d,isLastPage:f,isFirstPage:p}=W_(n);return g.jsxs("div",{...r,className:le("flex items-end select-none h-10",r?.className,t),"data-slot":"pagination",children:[g.jsxs(zi,{...e,disabled:p,onClick:()=>s(1),className:le("rounded-l-md",e?.className),children:[g.jsx(Uj,{"data-slot":"pagination-option-icon"}),g.jsx("span",{className:"sr-only",children:"Ir a primera página"})]}),g.jsxs(zi,{...e,onClick:d,disabled:p,children:[g.jsx(zv,{"data-slot":"pagination-option-icon"}),g.jsx("span",{className:"sr-only",children:"Ir a página anterior"})]}),o.map(h=>g.jsx(g.Fragment,{children:h===Co?g.jsx(zi,{className:le("pointer-events-none",e?.className),children:Co},h):R.createElement(zi,{...e,isActive:h===i,onClick:()=>s(h),key:h},h,g.jsxs("span",{className:"sr-only",children:["Ir a la página ",h]}))})),g.jsxs(zi,{...e,onClick:c,disabled:f,children:[g.jsx(ic,{"data-slot":"pagination-option-icon"}),g.jsx("span",{className:"sr-only",children:"Ir a próxima página"})]}),g.jsxs(zi,{...e,disabled:f,onClick:()=>s(l),className:le("rounded-r-md",e?.className),children:[g.jsx(Gj,{"data-slot":"pagination-option-icon"}),g.jsx("span",{className:"sr-only",children:"Ir a última página"})]})]})},OJ=({className:e,containerClassName:t,showIcon:r=g.jsx(u5,{className:"h-4 w-4"}),hideIcon:n=g.jsx(s5,{className:"h-4 w-4"}),onShow:o,onHide:i,toggleable:s=!0,...l})=>{const[c,d]=H_(!1),f=()=>{d(),c?i?.():o?.()};return g.jsxs("div",{className:le("relative",t),"data-slot":"password",children:[g.jsx(B_,{...l,type:c?"text":"password",className:le("pr-10","[&::-ms-reveal]:hidden [&::-ms-clear]:hidden",e)}),g.jsx("button",{"data-slot":"password-toggle",type:"button",onClick:f,disabled:!s,className:le("absolute right-3 top-1/2 -translate-y-1/2 text-gray-500",s?"hover:text-gray-700":"opacity-50 cursor-not-allowed"),children:c?n:r})]})},NJ=({items:e=[],valueKey:t="value",labelKey:r="label",value:n,onChange:o,defaultValue:i,renderOption:s=y=>y?.[r],triggerProps:l,contentClassName:c,contentProps:d,itemClassName:f,itemProps:p,className:h,placeholder:b="Seleccionar",...w})=>{const[y,C]=ut({prop:n,onChange:x=>{if(!o)return;const P=e.find(S=>S[t]===x);o?.(x,P)},defaultProp:i});return g.jsxs(gA,{...w,onValueChange:C,value:y,children:[g.jsx(xA,{className:h,...l,children:g.jsx(yA,{placeholder:b})}),g.jsx(CA,{className:c,...d,children:g.jsx(bA,{children:e.map((x,P)=>R.createElement(PA,{...p,className:f,key:P,disabled:x?.disabled,value:x[t]},s?.(x)))})})]})};function OR(e,[t,r]){return Math.min(r,Math.max(t,e))}function j$(e){const t=IJ(e),r=v.forwardRef((n,o)=>{const{children:i,...s}=n,l=v.Children.toArray(i),c=l.find(LJ);if(c){const d=c.props.children,f=l.map(p=>p===c?v.Children.count(d)>1?v.Children.only(null):v.isValidElement(d)?d.props.children:null:p);return g.jsx(t,{...s,ref:o,children:v.isValidElement(d)?v.cloneElement(d,void 0,f):null})}return g.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}function IJ(e){const t=v.forwardRef((r,n)=>{const{children:o,...i}=r;if(v.isValidElement(o)){const s=qJ(o),l=FJ(i,o.props);return o.type!==v.Fragment&&(l.ref=n?gt(n,s):s),v.cloneElement(o,l)}return v.Children.count(o)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var kJ=Symbol("radix.slottable");function LJ(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===kJ}function FJ(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function qJ(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var jJ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$r=jJ.reduce((e,t)=>{const r=j$(`Primitive.${t}`),n=v.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function BJ(e){const t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function VJ(e){const t=KJ(e),r=v.forwardRef((n,o)=>{const{children:i,...s}=n,l=v.Children.toArray(i),c=l.find(HJ);if(c){const d=c.props.children,f=l.map(p=>p===c?v.Children.count(d)>1?v.Children.only(null):v.isValidElement(d)?d.props.children:null:p);return g.jsx(t,{...s,ref:o,children:v.isValidElement(d)?v.cloneElement(d,void 0,f):null})}return g.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}function KJ(e){const t=v.forwardRef((r,n)=>{const{children:o,...i}=r;if(v.isValidElement(o)){const s=zJ(o),l=UJ(i,o.props);return o.type!==v.Fragment&&(l.ref=n?gt(n,s):s),v.cloneElement(o,l)}return v.Children.count(o)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var WJ=Symbol("radix.slottable");function HJ(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===WJ}function UJ(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function zJ(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var GJ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],YJ=GJ.reduce((e,t)=>{const r=VJ(`Primitive.${t}`),n=v.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),B$=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),XJ="VisuallyHidden",V$=v.forwardRef((e,t)=>g.jsx(YJ.span,{...e,ref:t,style:{...B$,...e.style}}));V$.displayName=XJ;var ZJ=V$,QJ=[" ","Enter","ArrowUp","ArrowDown"],JJ=[" ","Enter"],mi="Select",[lp,up,eee]=Dg(mi),[wa]=wn(mi,[eee,Do]),cp=Do(),[tee,No]=wa(mi),[ree,nee]=wa(mi),K$=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:o,onOpenChange:i,value:s,defaultValue:l,onValueChange:c,dir:d,name:f,autoComplete:p,disabled:h,required:b,form:w}=e,y=cp(t),[C,x]=v.useState(null),[P,S]=v.useState(null),[D,_]=v.useState(!1),T=Mg(d),[A,M]=ut({prop:n,defaultProp:o??!1,onChange:i,caller:mi}),[U,J]=ut({prop:s,defaultProp:l,onChange:c,caller:mi}),N=v.useRef(null),K=C?w||!!C.closest("form"):!0,[W,L]=v.useState(new Set),G=Array.from(W).map(k=>k.props.value).join(";");return g.jsx(bc,{...y,children:g.jsxs(tee,{required:b,scope:t,trigger:C,onTriggerChange:x,valueNode:P,onValueNodeChange:S,valueNodeHasChildren:D,onValueNodeHasChildrenChange:_,contentId:_t(),value:U,onValueChange:J,open:A,onOpenChange:M,dir:T,triggerPointerDownPosRef:N,disabled:h,children:[g.jsx(lp.Provider,{scope:t,children:g.jsx(ree,{scope:e.__scopeSelect,onNativeOptionAdd:v.useCallback(k=>{L(F=>new Set(F).add(k))},[]),onNativeOptionRemove:v.useCallback(k=>{L(F=>{const j=new Set(F);return j.delete(k),j})},[]),children:r})}),K?g.jsxs(pA,{"aria-hidden":!0,required:b,tabIndex:-1,name:f,autoComplete:p,value:U,onChange:k=>J(k.target.value),disabled:h,form:w,children:[U===void 0?g.jsx("option",{value:""}):null,Array.from(W)]},G):null]})})};K$.displayName=mi;var W$="SelectTrigger",H$=v.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...o}=e,i=cp(r),s=No(W$,r),l=s.disabled||n,c=Ve(t,s.onTriggerChange),d=up(r),f=v.useRef("touch"),[p,h,b]=hA(y=>{const C=d().filter(S=>!S.disabled),x=C.find(S=>S.value===s.value),P=vA(C,y,x);P!==void 0&&s.onValueChange(P.value)}),w=y=>{l||(s.onOpenChange(!0),b()),y&&(s.triggerPointerDownPosRef.current={x:Math.round(y.pageX),y:Math.round(y.pageY)})};return g.jsx(yc,{asChild:!0,...i,children:g.jsx($r.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":mA(s.value)?"":void 0,...o,ref:c,onClick:Se(o.onClick,y=>{y.currentTarget.focus(),f.current!=="mouse"&&w(y)}),onPointerDown:Se(o.onPointerDown,y=>{f.current=y.pointerType;const C=y.target;C.hasPointerCapture(y.pointerId)&&C.releasePointerCapture(y.pointerId),y.button===0&&y.ctrlKey===!1&&y.pointerType==="mouse"&&(w(y),y.preventDefault())}),onKeyDown:Se(o.onKeyDown,y=>{const C=p.current!=="";!(y.ctrlKey||y.altKey||y.metaKey)&&y.key.length===1&&h(y.key),!(C&&y.key===" ")&&QJ.includes(y.key)&&(w(),y.preventDefault())})})})});H$.displayName=W$;var U$="SelectValue",z$=v.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,children:i,placeholder:s="",...l}=e,c=No(U$,r),{onValueNodeHasChildrenChange:d}=c,f=i!==void 0,p=Ve(t,c.onValueNodeChange);return Kt(()=>{d(f)},[d,f]),g.jsx($r.span,{...l,ref:p,style:{pointerEvents:"none"},children:mA(c.value)?g.jsx(g.Fragment,{children:s}):i})});z$.displayName=U$;var oee="SelectIcon",G$=v.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...o}=e;return g.jsx($r.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});G$.displayName=oee;var iee="SelectPortal",Y$=e=>g.jsx(ha,{asChild:!0,...e});Y$.displayName=iee;var hi="SelectContent",X$=v.forwardRef((e,t)=>{const r=No(hi,e.__scopeSelect),[n,o]=v.useState();if(Kt(()=>{o(new DocumentFragment)},[]),!r.open){const i=n;return i?da.createPortal(g.jsx(Z$,{scope:e.__scopeSelect,children:g.jsx(lp.Slot,{scope:e.__scopeSelect,children:g.jsx("div",{children:e.children})})}),i):null}return g.jsx(Q$,{...e,ref:t})});X$.displayName=hi;var Xr=10,[Z$,Io]=wa(hi),aee="SelectContentImpl",see=j$("SelectContent.RemoveScroll"),Q$=v.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:c,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:h,collisionPadding:b,sticky:w,hideWhenDetached:y,avoidCollisions:C,...x}=e,P=No(hi,r),[S,D]=v.useState(null),[_,T]=v.useState(null),A=Ve(t,te=>D(te)),[M,U]=v.useState(null),[J,N]=v.useState(null),K=up(r),[W,L]=v.useState(!1),G=v.useRef(!1);v.useEffect(()=>{if(S)return oc(S)},[S]),Lf();const k=v.useCallback(te=>{const[ve,...q]=K().map(Z=>Z.ref.current),[ae]=q.slice(-1),oe=document.activeElement;for(const Z of te)if(Z===oe||(Z?.scrollIntoView({block:"nearest"}),Z===ve&&_&&(_.scrollTop=0),Z===ae&&_&&(_.scrollTop=_.scrollHeight),Z?.focus(),document.activeElement!==oe))return},[K,_]),F=v.useCallback(()=>k([M,S]),[k,M,S]);v.useEffect(()=>{W&&F()},[W,F]);const{onOpenChange:j,triggerPointerDownPosRef:re}=P;v.useEffect(()=>{if(S){let te={x:0,y:0};const ve=ae=>{te={x:Math.abs(Math.round(ae.pageX)-(re.current?.x??0)),y:Math.abs(Math.round(ae.pageY)-(re.current?.y??0))}},q=ae=>{te.x<=10&&te.y<=10?ae.preventDefault():S.contains(ae.target)||j(!1),document.removeEventListener("pointermove",ve),re.current=null};return re.current!==null&&(document.addEventListener("pointermove",ve),document.addEventListener("pointerup",q,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ve),document.removeEventListener("pointerup",q,{capture:!0})}}},[S,j,re]),v.useEffect(()=>{const te=()=>j(!1);return window.addEventListener("blur",te),window.addEventListener("resize",te),()=>{window.removeEventListener("blur",te),window.removeEventListener("resize",te)}},[j]);const[V,ie]=hA(te=>{const ve=K().filter(oe=>!oe.disabled),q=ve.find(oe=>oe.ref.current===document.activeElement),ae=vA(ve,te,q);ae&&setTimeout(()=>ae.ref.current.focus())}),Y=v.useCallback((te,ve,q)=>{const ae=!G.current&&!q;(P.value!==void 0&&P.value===ve||ae)&&(U(te),ae&&(G.current=!0))},[P.value]),X=v.useCallback(()=>S?.focus(),[S]),ce=v.useCallback((te,ve,q)=>{const ae=!G.current&&!q;(P.value!==void 0&&P.value===ve||ae)&&N(te)},[P.value]),ue=n==="popper"?gv:J$,pe=ue===gv?{side:l,sideOffset:c,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:h,collisionPadding:b,sticky:w,hideWhenDetached:y,avoidCollisions:C}:{};return g.jsx(Z$,{scope:r,content:S,viewport:_,onViewportChange:T,itemRefCallback:Y,selectedItem:M,onItemLeave:X,itemTextRefCallback:ce,focusSelectedItem:F,selectedItemText:J,position:n,isPositioned:W,searchRef:V,children:g.jsx(va,{as:see,allowPinchZoom:!0,children:g.jsx(rc,{asChild:!0,trapped:P.open,onMountAutoFocus:te=>{te.preventDefault()},onUnmountAutoFocus:Se(o,te=>{P.trigger?.focus({preventScroll:!0}),te.preventDefault()}),children:g.jsx(ma,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:te=>te.preventDefault(),onDismiss:()=>P.onOpenChange(!1),children:g.jsx(ue,{role:"listbox",id:P.contentId,"data-state":P.open?"open":"closed",dir:P.dir,onContextMenu:te=>te.preventDefault(),...x,...pe,onPlaced:()=>L(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:Se(x.onKeyDown,te=>{const ve=te.ctrlKey||te.altKey||te.metaKey;if(te.key==="Tab"&&te.preventDefault(),!ve&&te.key.length===1&&ie(te.key),["ArrowUp","ArrowDown","Home","End"].includes(te.key)){let ae=K().filter(oe=>!oe.disabled).map(oe=>oe.ref.current);if(["ArrowUp","End"].includes(te.key)&&(ae=ae.slice().reverse()),["ArrowUp","ArrowDown"].includes(te.key)){const oe=te.target,Z=ae.indexOf(oe);ae=ae.slice(Z+1)}setTimeout(()=>k(ae)),te.preventDefault()}})})})})})})});Q$.displayName=aee;var lee="SelectItemAlignedPosition",J$=v.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...o}=e,i=No(hi,r),s=Io(hi,r),[l,c]=v.useState(null),[d,f]=v.useState(null),p=Ve(t,A=>f(A)),h=up(r),b=v.useRef(!1),w=v.useRef(!0),{viewport:y,selectedItem:C,selectedItemText:x,focusSelectedItem:P}=s,S=v.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&d&&y&&C&&x){const A=i.trigger.getBoundingClientRect(),M=d.getBoundingClientRect(),U=i.valueNode.getBoundingClientRect(),J=x.getBoundingClientRect();if(i.dir!=="rtl"){const oe=J.left-M.left,Z=U.left-oe,we=A.left-Z,De=A.width+we,Ue=Math.max(De,M.width),wt=window.innerWidth-Xr,mt=OR(Z,[Xr,Math.max(Xr,wt-Ue)]);l.style.minWidth=De+"px",l.style.left=mt+"px"}else{const oe=M.right-J.right,Z=window.innerWidth-U.right-oe,we=window.innerWidth-A.right-Z,De=A.width+we,Ue=Math.max(De,M.width),wt=window.innerWidth-Xr,mt=OR(Z,[Xr,Math.max(Xr,wt-Ue)]);l.style.minWidth=De+"px",l.style.right=mt+"px"}const N=h(),K=window.innerHeight-Xr*2,W=y.scrollHeight,L=window.getComputedStyle(d),G=parseInt(L.borderTopWidth,10),k=parseInt(L.paddingTop,10),F=parseInt(L.borderBottomWidth,10),j=parseInt(L.paddingBottom,10),re=G+k+W+j+F,V=Math.min(C.offsetHeight*5,re),ie=window.getComputedStyle(y),Y=parseInt(ie.paddingTop,10),X=parseInt(ie.paddingBottom,10),ce=A.top+A.height/2-Xr,ue=K-ce,pe=C.offsetHeight/2,te=C.offsetTop+pe,ve=G+k+te,q=re-ve;if(ve<=ce){const oe=N.length>0&&C===N[N.length-1].ref.current;l.style.bottom="0px";const Z=d.clientHeight-y.offsetTop-y.offsetHeight,we=Math.max(ue,pe+(oe?X:0)+Z+F),De=ve+we;l.style.height=De+"px"}else{const oe=N.length>0&&C===N[0].ref.current;l.style.top="0px";const we=Math.max(ce,G+y.offsetTop+(oe?Y:0)+pe)+q;l.style.height=we+"px",y.scrollTop=ve-ce+y.offsetTop}l.style.margin=`${Xr}px 0`,l.style.minHeight=V+"px",l.style.maxHeight=K+"px",n?.(),requestAnimationFrame(()=>b.current=!0)}},[h,i.trigger,i.valueNode,l,d,y,C,x,i.dir,n]);Kt(()=>S(),[S]);const[D,_]=v.useState();Kt(()=>{d&&_(window.getComputedStyle(d).zIndex)},[d]);const T=v.useCallback(A=>{A&&w.current===!0&&(S(),P?.(),w.current=!1)},[S,P]);return g.jsx(cee,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:b,onScrollButtonChange:T,children:g.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:D},children:g.jsx($r.div,{...o,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});J$.displayName=lee;var uee="SelectPopperPosition",gv=v.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=Xr,...i}=e,s=cp(r);return g.jsx(np,{...s,...i,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});gv.displayName=uee;var[cee,Zg]=wa(hi,{}),bv="SelectViewport",eA=v.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...o}=e,i=Io(bv,r),s=Zg(bv,r),l=Ve(t,i.onViewportChange),c=v.useRef(0);return g.jsxs(g.Fragment,{children:[g.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),g.jsx(lp.Slot,{scope:r,children:g.jsx($r.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Se(o.onScroll,d=>{const f=d.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:h}=s;if(h?.current&&p){const b=Math.abs(c.current-f.scrollTop);if(b>0){const w=window.innerHeight-Xr*2,y=parseFloat(p.style.minHeight),C=parseFloat(p.style.height),x=Math.max(y,C);if(x<w){const P=x+b,S=Math.min(w,P),D=P-S;p.style.height=S+"px",p.style.bottom==="0px"&&(f.scrollTop=D>0?D:0,p.style.justifyContent="flex-end")}}}c.current=f.scrollTop})})})]})});eA.displayName=bv;var tA="SelectGroup",[dee,fee]=wa(tA),rA=v.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=_t();return g.jsx(dee,{scope:r,id:o,children:g.jsx($r.div,{role:"group","aria-labelledby":o,...n,ref:t})})});rA.displayName=tA;var nA="SelectLabel",oA=v.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=fee(nA,r);return g.jsx($r.div,{id:o.id,...n,ref:t})});oA.displayName=nA;var _f="SelectItem",[pee,iA]=wa(_f),aA=v.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:o=!1,textValue:i,...s}=e,l=No(_f,r),c=Io(_f,r),d=l.value===n,[f,p]=v.useState(i??""),[h,b]=v.useState(!1),w=Ve(t,P=>c.itemRefCallback?.(P,n,o)),y=_t(),C=v.useRef("touch"),x=()=>{o||(l.onValueChange(n),l.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return g.jsx(pee,{scope:r,value:n,disabled:o,textId:y,isSelected:d,onItemTextChange:v.useCallback(P=>{p(S=>S||(P?.textContent??"").trim())},[]),children:g.jsx(lp.ItemSlot,{scope:r,value:n,disabled:o,textValue:f,children:g.jsx($r.div,{role:"option","aria-labelledby":y,"data-highlighted":h?"":void 0,"aria-selected":d&&h,"data-state":d?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:w,onFocus:Se(s.onFocus,()=>b(!0)),onBlur:Se(s.onBlur,()=>b(!1)),onClick:Se(s.onClick,()=>{C.current!=="mouse"&&x()}),onPointerUp:Se(s.onPointerUp,()=>{C.current==="mouse"&&x()}),onPointerDown:Se(s.onPointerDown,P=>{C.current=P.pointerType}),onPointerMove:Se(s.onPointerMove,P=>{C.current=P.pointerType,o?c.onItemLeave?.():C.current==="mouse"&&P.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Se(s.onPointerLeave,P=>{P.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:Se(s.onKeyDown,P=>{c.searchRef?.current!==""&&P.key===" "||(JJ.includes(P.key)&&x(),P.key===" "&&P.preventDefault())})})})})});aA.displayName=_f;var Nu="SelectItemText",sA=v.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,...i}=e,s=No(Nu,r),l=Io(Nu,r),c=iA(Nu,r),d=nee(Nu,r),[f,p]=v.useState(null),h=Ve(t,x=>p(x),c.onItemTextChange,x=>l.itemTextRefCallback?.(x,c.value,c.disabled)),b=f?.textContent,w=v.useMemo(()=>g.jsx("option",{value:c.value,disabled:c.disabled,children:b},c.value),[c.disabled,c.value,b]),{onNativeOptionAdd:y,onNativeOptionRemove:C}=d;return Kt(()=>(y(w),()=>C(w)),[y,C,w]),g.jsxs(g.Fragment,{children:[g.jsx($r.span,{id:c.textId,...i,ref:h}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren?da.createPortal(i.children,s.valueNode):null]})});sA.displayName=Nu;var lA="SelectItemIndicator",mee=v.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return iA(lA,r).isSelected?g.jsx($r.span,{"aria-hidden":!0,...n,ref:t}):null});mee.displayName=lA;var yv="SelectScrollUpButton",uA=v.forwardRef((e,t)=>{const r=Io(yv,e.__scopeSelect),n=Zg(yv,e.__scopeSelect),[o,i]=v.useState(!1),s=Ve(t,n.onScrollButtonChange);return Kt(()=>{if(r.viewport&&r.isPositioned){let l=function(){const d=c.scrollTop>0;i(d)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?g.jsx(dA,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});uA.displayName=yv;var xv="SelectScrollDownButton",cA=v.forwardRef((e,t)=>{const r=Io(xv,e.__scopeSelect),n=Zg(xv,e.__scopeSelect),[o,i]=v.useState(!1),s=Ve(t,n.onScrollButtonChange);return Kt(()=>{if(r.viewport&&r.isPositioned){let l=function(){const d=c.scrollHeight-c.clientHeight,f=Math.ceil(c.scrollTop)<d;i(f)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?g.jsx(dA,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});cA.displayName=xv;var dA=v.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...o}=e,i=Io("SelectScrollButton",r),s=v.useRef(null),l=up(r),c=v.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return v.useEffect(()=>()=>c(),[c]),Kt(()=>{l().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),g.jsx($r.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:Se(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(n,50))}),onPointerMove:Se(o.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(n,50))}),onPointerLeave:Se(o.onPointerLeave,()=>{c()})})}),hee="SelectSeparator",fA=v.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return g.jsx($r.div,{"aria-hidden":!0,...n,ref:t})});fA.displayName=hee;var wv="SelectArrow",vee=v.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=cp(r),i=No(wv,r),s=Io(wv,r);return i.open&&s.position==="popper"?g.jsx(op,{...o,...n,ref:t}):null});vee.displayName=wv;var gee="SelectBubbleInput",pA=v.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const o=v.useRef(null),i=Ve(n,o),s=BJ(t);return v.useEffect(()=>{const l=o.current;if(!l)return;const c=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(c,"value").set;if(s!==t&&f){const p=new Event("change",{bubbles:!0});f.call(l,t),l.dispatchEvent(p)}},[s,t]),g.jsx($r.select,{...r,style:{...B$,...r.style},ref:i,defaultValue:t})});pA.displayName=gee;function mA(e){return e===""||e===void 0}function hA(e){const t=Xt(e),r=v.useRef(""),n=v.useRef(0),o=v.useCallback(s=>{const l=r.current+s;t(l),(function c(d){r.current=d,window.clearTimeout(n.current),d!==""&&(n.current=window.setTimeout(()=>c(""),1e3))})(l)},[t]),i=v.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,i]}function vA(e,t,r){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let s=bee(e,Math.max(i,0));o.length===1&&(s=s.filter(d=>d!==r));const c=s.find(d=>d.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==r?c:void 0}function bee(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var yee=K$,xee=H$,wee=z$,Eee=G$,Cee=Y$,Ree=X$,Pee=eA,See=rA,_ee=oA,Tee=aA,$ee=sA,Aee=uA,Dee=cA,Mee=fA;const gA=e=>g.jsx(yee,{"data-slot":"select",...e}),bA=({heading:e,children:t,...r})=>g.jsxs(See,{"data-slot":"select-group",...r,children:[e&&g.jsx(RA,{children:e}),t]}),yA=e=>g.jsx(wee,{"data-slot":"select-value",...e}),xA=({className:e,children:t,...r})=>g.jsxs(xee,{"data-slot":"select-trigger",className:le("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,g.jsx(Eee,{asChild:!0,"data-slot":"select-trigger-icon",children:g.jsx(af,{className:"h-4 w-4 shrink-0 opacity-50"})})]}),wA=({className:e,...t})=>g.jsx(Aee,{"data-slot":"select-scroll-up",className:le("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(EP,{className:"h-4 w-4"})}),EA=({className:e,...t})=>g.jsx(Dee,{"data-slot":"select-scroll-down",className:le("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(wP,{className:"h-4 w-4"})}),CA=({className:e,children:t,position:r="popper",...n})=>g.jsx(Cee,{children:g.jsxs(Ree,{"data-slot":"select-content",className:le("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md open:animate-in closed:animate-out closed:fade-out-0 open:fade-in-0 closed:zoom-out-95 open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[g.jsx(wA,{}),g.jsx(Pee,{"data-slot":"select-viewport",className:le("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),g.jsx(EA,{})]})}),RA=({className:e,...t})=>g.jsx(_ee,{"data-slot":"select-label",className:le("py-1.5 px-2 text-sm font-semibold",e),...t}),PA=({className:e,children:t,...r})=>g.jsx(Tee,{"data-slot":"select-item",className:le("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 px-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:g.jsx($ee,{"data-slot":"select-item-text",children:t})}),Oee=({className:e,...t})=>g.jsx(Mee,{"data-slot":"select-separator",className:le("-mx-1 my-1 h-px bg-muted",e),...t}),Nee=({isCircle:e,width:t,height:r,isLoading:n=!1,...o})=>{const i={width:t,height:r,...o.style};return!n&&o.children?o.children:g.jsx("div",{"data-slot":"skeleton",...o,className:le("[&>*]:opacity-0 w-fit","rounded w-full animate-pulse bg-muted min-h-[1.5em]",e&&"rounded-[50%] aspect-square",o.className),style:i})},Iee=({inline:e=!1,justify:t,align:r,direction:n="horizontal",gap:o=8,style:i,...s})=>{const l={display:e?"inline-flex":"flex",flexDirection:n==="vertical"?"column":"row",justifyContent:t,alignItems:r,gap:o};return g.jsx("div",{style:{...l,...i},...s,"data-slot":"stack"})},[SA,kee]=cc();function Lee({items:e=[],current:t,onChange:r,className:n,classNameList:o,classNameItem:i,classNameButton:s,classNameIndicator:l,classNameContent:c}){return g.jsxs(_A,{className:n,current:t,onChange:r,children:[g.jsx(TA,{className:o,children:e?.map((d,f)=>g.jsx($A,{value:f,title:d?.title,indicator:d?.indicator,classNameItem:i,classNameButton:s,classNameIndicator:l},f))}),e?.map((d,f)=>g.jsx(AA,{className:c,value:f,children:d?.content},f))]})}function _A({current:e,onChange:t,className:r,...n}){const[o=0,i]=ut({prop:e,onChange:t,defaultProp:0});return g.jsx(kee,{value:{activeStep:o,setActiveStep:i},children:g.jsx("div",{"data-slot":"stepper",className:le("flex flex-col items-center w-full transition-all ease-in delay-150",r),...n})})}function TA({children:e,className:t,...r}){return g.jsx("ul",{"data-slot":"stepper-list",className:le("flex flex-col sm:flex-row sm:gap-0 gap-4 items-center w-full text-xs font-medium text-gray-900 sm:text-base mb-8",t),...r,children:e})}function $A({disabled:e,value:t,title:r,indicator:n,classNameItem:o,classNameButton:i,classNameIndicator:s}){const{activeStep:l,setActiveStep:c}=SA();return g.jsx("li",{"data-slot":"stepper-trigger",className:le("flex relative text-primary transition-all ease-in delay-150","last:w-full last:sm:w-auto last:after:hidden",`w-full after:content-[''] sm:after:w-full after:h-full after:w-0.5 sm:after:h-0.5 ${l>t?"after:bg-primary":"after:bg-gray-300"} after:inline-block after:absolute after:top-5 sm:after:top-5 after:left-4 sm:after:left-10`,o),children:g.jsxs("button",{onClick:()=>!e&&c(t),className:le("z-10 flex items-center justify-center sm:flex-col gap-3 flex-row whitespace-nowrap cursor-pointer group transition-color ease-in delay-150",l>=t?"text-primary":"text-gray-500",e&&"cursor-not-allowed",i),children:[g.jsx("span",{"data-slot":"stepper-trigger-indicator",className:le("flex items-center transition-all overflow-hidden ease-in justify-center group-hover:scale-105 sm:w-10 sm:h-10 mx-auto text-sm border-2 rounded-full w-8 h-8",l>t&&"bg-primary border-primary text-primary-foreground",l===t&&"bg-gray-100 text-primary border-primary",l<t&&"bg-white text-gray-500 border-input",e&&"text-gray-300",s),children:l>t?"✓":n||t+1}),r]})})}function AA({value:e,className:t="w-full",...r}){const{activeStep:n}=SA();return n===e?g.jsx("div",{"data-slot":"stepper-content",className:t,...r}):null}const Fee=({className:e,children:t,containerProps:r,containerClassName:n,...o})=>{const i=R.useId(),[s=!1,l]=ut({prop:o.checked,onChange:o.onChange,defaultProp:o.defaultChecked}),c=()=>!o.disabled&&l(p=>!p),d=s?"checked":"unchecked",f=o.id??i;return g.jsxs("div",{"data-slot":"switch",...r,className:le("flex gap-x-2 items-center",n),children:[g.jsxs("button",{"data-slot":"switch-trigger",disabled:o.disabled,onClick:c,"data-state":d,type:"button",className:le("peer w-11 h-6 bg-input rounded-full border-2 border-transparent transition-colors","data-[state=checked]:bg-primary",e),children:[g.jsx("div",{"data-state":d,className:le("w-5 h-5 pointers-event-none bg-primary-foreground rounded-full transition-all","transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")}),g.jsx("input",{...o,id:f,checked:s,onChange:p=>l(p.currentTarget.checked),type:"checkbox",className:"sr-only","aria-hidden":!0})]}),t&&g.jsx(pc,{htmlFor:f,children:t})]})},DA=({className:e,containerClassName:t,containerProps:r,...n})=>g.jsx("div",{"data-slot":"table-container",className:le("relative w-full overflow-auto rounded-md border",t),...r,children:g.jsx("table",{"data-slot":"table",className:le("w-full caption-bottom text-sm",e),...n})}),MA=({className:e,...t})=>g.jsx("thead",{"data-slot":"table-header",className:le("[&_tr]:border-b",e),...t}),OA=({className:e,...t})=>g.jsx("tbody",{"data-slot":"table-body",className:le("[&_tr:last-child]:border-0",e),...t}),qee=({className:e,...t})=>g.jsx("tfoot",{"data-slot":"table-footer",className:le("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}),Ev=({className:e,...t})=>g.jsx("tr",{"data-slot":"table-row",className:le("border-b transition-colors hover:bg-muted data-[selected=true]:bg-muted",e),...t}),NA=({className:e,...t})=>g.jsx("th",{"data-slot":"table-head",className:le("h-12 px-4 text-left align-middle font-medium text-muted-foreground sticky top-0 bg-background [&:has([role=checkbox])]:pr-0",e),...t}),IA=({className:e,...t})=>g.jsx("td",{"data-slot":"table-cell",className:le("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}),jee=({className:e,...t})=>g.jsx("caption",{"data-slot":"table-caption",className:le("mt-4 text-sm text-muted-foreground",e),...t}),Bee=({data:e=[],columns:t=[],onRowClick:r,onDoubleClick:n,selected:o,theadClassName:i,theadProps:s,tbodyClassName:l,tbodyProps:c,trClassName:d,trProps:f,thClassName:p,thProps:h,tdClassName:b,tdProps:w,...y})=>g.jsxs(DA,{...y,className:le(y?.className),children:[g.jsx(MA,{...s,className:le(s?.className,i),children:g.jsx(Ev,{...f,className:le(f?.className,d),children:t.map((C,x)=>g.jsx(NA,{...h,className:le(h?.className,p),style:{width:C.width},children:lt.isFunction(C.header)?C.header?.():C.header},x))})}),g.jsx(OA,{...c,className:le(c?.className,l),children:e.map((C,x)=>g.jsx(Ev,{...f,"data-selected":o?.(C),className:le(f?.className,d),children:t.map((P,S)=>g.jsx(IA,{...w,onClick:D=>{w?.onClick?.(D),r?.(C)},onDoubleClick:()=>n?.(C),className:le(w?.className,b),children:P.cell?.(C,S)||C[P.key]},S))},x))})]}),Jd=[10,25,50],Vee=({containerClassName:e,containerProps:t,selectClassName:r,selectProps:n,sizes:o=Jd,...i})=>{const[s=Jd[0],l]=ut({onChange:i?.setPageSize,prop:i?.pageSize,defaultProp:Jd[0]}),{range:c,next:d,prev:f,isFirstPage:p,isLastPage:h,goTo:b}=Ag({...i,pageSize:s}),w=y=>{const{value:C}=y.target,x=Number(C);l(x),b(1)};return g.jsxs("div",{"data-slot":"table-pagination",...t,className:le("flex justify-center items-center gap-x-4 bg-background border border-[#D9D9D9] rounded-2xl py-2",e),children:[o&&g.jsx("select",{"data-slot":"table-pagination-size-trigger",...n,value:s,onChange:w,className:le("border border-input rounded-md w-fit min-w-[3rem] bg-background p-2 ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",r),children:o.map((y,C)=>g.jsx("option",{value:y,"data-slot":"table-pagination-size-option",children:y},C))}),g.jsxs("span",{"data-slot":"table-pagination-range",children:[c.start," - ",c.end," de ",i.totalItems]}),g.jsxs("div",{className:"flex gap-2",children:[g.jsx(tr,{"data-slot":"table-pagination-prev",size:"icon",variant:"ghost",disabled:p,onClick:f,children:g.jsx(zv,{"data-slot":"table-pagination-prev-icon"})}),g.jsx(tr,{"data-slot":"table-pagination-next",size:"icon",variant:"ghost",disabled:h,onClick:d,children:g.jsx(ic,{"data-slot":"table-pagination-next-icon"})})]})]})},[dp,Kee]=cc(),Wee=({children:e,value:t,onChange:r,defaultValue:n,variant:o="default",...i})=>{const[s="",l]=ut({prop:t,onChange:r,defaultProp:n}),[c,d]=R.useState(null);return g.jsx(Kee,{value:{activeTab:s,setActiveTab:l,setTargetRef:d,targetRef:c,variant:o},children:g.jsx("div",{"data-slot":"tabs",...i,children:e})})},Hee=({children:e,className:t,indicatorClassName:r})=>{const{targetRef:n}=dp();return g.jsxs("div",{"data-slot":"tabs-list",className:le("relative mb-4",t),children:[g.jsx("div",{"data-slot":"tabs-content",className:"flex",children:e}),g.jsx(Gee,{targetRef:n,indicatorClassName:r})]})},Uee=({value:e,className:t,...r})=>{const{activeTab:n,setActiveTab:o,setTargetRef:i,variant:s}=dp(),l=n===e;return g.jsx("button",{"data-slot":"tabs-trigger",...r,type:"button",ref:c=>{l&&i(c)},onClick:()=>o(e),"data-tab":e,"data-selected":l,"aria-selected":l,className:le("px-2 py-2 cursor-pointer w-full min-w-[100px] text-center rounded-t font-semibold select-none",s==="background"?"hover:bg-transparent aria-selected:text-primary-foreground rounded":"hover:bg-accent hover:text-accent-foreground",t)})},zee=({value:e,...t})=>{const{activeTab:r}=dp();return r===e?g.jsx("div",{"data-slot":"tabs-content",...t}):null},Gee=({targetRef:e,indicatorClassName:t})=>{const r=R.useRef(null),n=r?.current,o=R.useRef(null),{variant:i}=dp(),s=()=>{if(!e||!n)return;const l=e.offsetLeft,c=e.offsetWidth;n.style.width=c+"px",n.style.left=l+"px"};return R.useEffect(()=>{if(e)return s(),o.current=new ResizeObserver(s),o.current.observe(e),()=>{o.current?.disconnect()}},[e]),g.jsx("div",{"data-slot":"tabs-indicator",ref:r,className:le("transition-all duration-300 absolute rounded bg-primary",i==="background"?"inset-0 -z-10 h-full top-0":"top-full h-[3px]",t)})},Yee=({className:e,...t})=>g.jsx("textarea",{...t,onChange:r=>t.onChange?.(r.target.value),"data-slot":"textarea",className:le("min-h-[60px] w-full rounded-md px-3 py-2 text-sm placeholder:text-muted-foreground","border border-input bg-background","ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e)}),Xee={done:"var(--color-primary)",pending:"#cdcdcd",error:"var(--color-error)"},Zee=({items:e,classNameContainer:t,containerProps:r,...n})=>g.jsx(kA,{className:t,...r,children:e.map((o,i)=>g.jsx(LA,{icon:o.icon,color:o.color,status:o.status,...n,children:o.content},i))}),kA=e=>g.jsx("ul",{"data-slot":"timeline",...e,className:le("relative flex justify-center flex-col border-input",e.className)}),LA=({icon:e,status:t,color:r,classNameItemDot:n,classNameItemContainerDot:o,classNameItemContent:i,itemsProps:s,children:l,...c})=>g.jsxs("li",{"data-slot":"timeline-item",className:le("rounded-lg w-full px-2 gap-1 grid hover:bg-muted transition-colors ease-in grid-cols-[minmax(auto,20px)_1fr]",c.className),...c,children:[g.jsx(FA,{icon:e,status:t,color:r,classNameDot:n,classNameContainerDot:o}),g.jsx(qA,{className:i,...s,children:l})]}),FA=({icon:e,status:t="pending",color:r,classNameDot:n,classNameContainerDot:o})=>g.jsx("div",{"data-slot":"timeline-item-dot",className:le("relative pb-6 last:after:hidden after:absolute after:top-0 after:bottom-0 after:left-1/2 after:w-px after:-translate-x-1/2 after:bg-gray-200",o),children:g.jsx("div",{"data-slot":"timeline-item-dot-icon",className:le("relative z-10 flex text-white items-center justify-center rounded-full left-1/2 -translate-x-1/2",e?"aspect-square p-1.5 min-h-7 min-w-7 top-2":"size-2 top-4",n),style:{backgroundColor:r||Xee?.[t]},children:e})}),qA=e=>g.jsx("div",{"data-slot":"timeline-item-content",...e,className:le("grow px-2 pb-4 pt-2",e.className)}),Qee=eo(["flex justify-between items-center transition-all","text-primary-foreground","pointer-events-auto relative w-full rounded-xl p-3 shadow-lg"],{variants:{variant:{info:"bg-primary text-primary-foreground",error:"bg-error text-error-foreground",success:"bg-success text-success-foreground",loading:"bg-background text-foreground"}},defaultVariants:{variant:"info"}}),Jee=eo("",{variants:{variant:{info:"text-primary-foreground",error:"text-error-foreground",success:"text-success-foreground",loading:"text-foreground animate-spin"}},defaultVariants:{variant:"info"}}),jA=({title:e,description:t,type:r,iconClassName:n,...o})=>{const i=VA[r];return g.jsxs("div",{...o,"data-slot":"toast",className:le(Qee({variant:r}),o.className),children:[g.jsx("div",{className:le("p-1 text-primary-foreground pr-2",n),children:g.jsx(i,{size:22,className:le(Jee({variant:r})),"data-slot":"toast-icon"})}),g.jsxs("div",{className:"grid gap-1 grow","data-slot":"toast-content",children:[e&&g.jsx("h4",{...o.titleProps,className:le("text-sm font-semibold",o.titleClassName),"data-slot":"toast-title",children:e}),g.jsx("div",{...o.descriptionProps,className:le("text-sm font-normal opacity-90 p-0 overflow-hidden",o.descriptionClassName),"data-slot":"toast-description",children:t})]})]})},NR=e=>{let t;const r=new Set,n=(d,f)=>{const p=typeof d=="function"?d(t):d;if(!Object.is(p,t)){const h=t;t=f??(typeof p!="object"||p===null)?p:Object.assign({},t,p),r.forEach(b=>b(t,h))}},o=()=>t,l={setState:n,getState:o,getInitialState:()=>c,subscribe:d=>(r.add(d),()=>r.delete(d))},c=t=e(n,o,l);return l},ete=(e=>e?NR(e):NR),tte=e=>e;function rte(e,t=tte){const r=R.useSyncExternalStore(e.subscribe,R.useCallback(()=>t(e.getState()),[e,t]),R.useCallback(()=>t(e.getInitialState()),[e,t]));return R.useDebugValue(r),r}const IR=e=>{const t=ete(e),r=n=>rte(t,n);return Object.assign(r,t),r},nte=(e=>e?IR(e):IR);let ote=0;const BA=3e3,kR=(e,t,r=BA)=>{setTimeout(()=>e(t),r)},Qg=nte((e,t)=>({toasts:[],addToast:r=>{const n=++ote,o={...r,id:n};return e(i=>({toasts:[...i.toasts,o]})),r.type!=="loading"&&kR(t().removeToast,n,r?.duration||BA),n},removeToast:r=>{e(n=>({toasts:n.toasts.filter(o=>o.id!==r)}))},updateToast:(r,n)=>{e(o=>({toasts:o.toasts.map(i=>i.id===r?{...i,...n}:i)})),n.type!=="loading"&&kR(t().removeToast,r)},promise:async(r,n)=>{const o=t().addToast({type:"loading",description:n.loading});try{const i=await r;return t().updateToast(o,{type:"success",description:typeof n.success=="function"?n.success(i):n.success}),i}catch(i){const s=typeof n.error=="function"?n.error(i):n.error;return t().updateToast(o,{type:"error",description:s}),Promise.reject(i)}}})),ite=({iconClassName:e="",...t})=>{const r=Qg(n=>n.toasts);return g.jsxs(g.Fragment,{children:[t.children,g.jsx(ng,{className:"empty:hidden fixed z-100 pr-2 pb-2 bottom-0 right-0 space-y-2 max-w-[300px] w-full",children:r.map(n=>{const o=R.createRef();return g.jsx(Kf,{classNames:"toast",timeout:500,nodeRef:o,children:g.jsx(jA,{...n,iconClassName:e,ref:o})},n.id)})})]})},Jg=Qg.getState(),ate=e=>Jg.addToast(e),Eh=(e,t)=>{const n=typeof e=="string"?{description:e,type:t}:{...e,type:t};return Jg.addToast(n)},ste=Object.assign(ate,{info:e=>Eh(e,"info"),success:e=>Eh(e,"success"),error:e=>Eh(e,"error"),promise:(e,t)=>Jg.promise(e,t)}),VA={info:Zj,success:Jj,error:t5,loading:sf};function lte(e){const t=ute(e),r=v.forwardRef((n,o)=>{const{children:i,...s}=n,l=v.Children.toArray(i),c=l.find(dte);if(c){const d=c.props.children,f=l.map(p=>p===c?v.Children.count(d)>1?v.Children.only(null):v.isValidElement(d)?d.props.children:null:p);return g.jsx(t,{...s,ref:o,children:v.isValidElement(d)?v.cloneElement(d,void 0,f):null})}return g.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}function ute(e){const t=v.forwardRef((r,n)=>{const{children:o,...i}=r;if(v.isValidElement(o)){const s=pte(o),l=fte(i,o.props);return o.type!==v.Fragment&&(l.ref=n?gt(n,s):s),v.cloneElement(o,l)}return v.Children.count(o)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var KA=Symbol("radix.slottable");function cte(e){const t=({children:r})=>g.jsx(g.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=KA,t}function dte(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===KA}function fte(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function pte(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var mte=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],hte=mte.reduce((e,t)=>{const r=lte(`Primitive.${t}`),n=v.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),[fp]=wn("Tooltip",[Do]),pp=Do(),WA="TooltipProvider",vte=700,Cv="tooltip.open",[gte,eb]=fp(WA),HA=e=>{const{__scopeTooltip:t,delayDuration:r=vte,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:i}=e,s=v.useRef(!0),l=v.useRef(!1),c=v.useRef(0);return v.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),g.jsx(gte,{scope:t,isOpenDelayedRef:s,delayDuration:r,onOpen:v.useCallback(()=>{window.clearTimeout(c.current),s.current=!1},[]),onClose:v.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.current=!0,n)},[n]),isPointerInTransitRef:l,onPointerInTransitChange:v.useCallback(d=>{l.current=d},[]),disableHoverableContent:o,children:i})};HA.displayName=WA;var Qu="Tooltip",[bte,$c]=fp(Qu),UA=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:o,onOpenChange:i,disableHoverableContent:s,delayDuration:l}=e,c=eb(Qu,e.__scopeTooltip),d=pp(t),[f,p]=v.useState(null),h=_t(),b=v.useRef(0),w=s??c.disableHoverableContent,y=l??c.delayDuration,C=v.useRef(!1),[x,P]=ut({prop:n,defaultProp:o??!1,onChange:A=>{A?(c.onOpen(),document.dispatchEvent(new CustomEvent(Cv))):c.onClose(),i?.(A)},caller:Qu}),S=v.useMemo(()=>x?C.current?"delayed-open":"instant-open":"closed",[x]),D=v.useCallback(()=>{window.clearTimeout(b.current),b.current=0,C.current=!1,P(!0)},[P]),_=v.useCallback(()=>{window.clearTimeout(b.current),b.current=0,P(!1)},[P]),T=v.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{C.current=!0,P(!0),b.current=0},y)},[y,P]);return v.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]),g.jsx(bc,{...d,children:g.jsx(bte,{scope:t,contentId:h,open:x,stateAttribute:S,trigger:f,onTriggerChange:p,onTriggerEnter:v.useCallback(()=>{c.isOpenDelayedRef.current?T():D()},[c.isOpenDelayedRef,T,D]),onTriggerLeave:v.useCallback(()=>{w?_():(window.clearTimeout(b.current),b.current=0)},[_,w]),onOpen:D,onClose:_,disableHoverableContent:w,children:r})})};UA.displayName=Qu;var Rv="TooltipTrigger",zA=v.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=$c(Rv,r),i=eb(Rv,r),s=pp(r),l=v.useRef(null),c=Ve(t,l,o.onTriggerChange),d=v.useRef(!1),f=v.useRef(!1),p=v.useCallback(()=>d.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),g.jsx(yc,{asChild:!0,...s,children:g.jsx(hte.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...n,ref:c,onPointerMove:Se(e.onPointerMove,h=>{h.pointerType!=="touch"&&!f.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:Se(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:Se(e.onPointerDown,()=>{o.open&&o.onClose(),d.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:Se(e.onFocus,()=>{d.current||o.onOpen()}),onBlur:Se(e.onBlur,o.onClose),onClick:Se(e.onClick,o.onClose)})})});zA.displayName=Rv;var tb="TooltipPortal",[yte,xte]=fp(tb,{forceMount:void 0}),GA=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:o}=e,i=$c(tb,t);return g.jsx(yte,{scope:t,forceMount:r,children:g.jsx(Tr,{present:r||i.open,children:g.jsx(ha,{asChild:!0,container:o,children:n})})})};GA.displayName=tb;var ca="TooltipContent",YA=v.forwardRef((e,t)=>{const r=xte(ca,e.__scopeTooltip),{forceMount:n=r.forceMount,side:o="top",...i}=e,s=$c(ca,e.__scopeTooltip);return g.jsx(Tr,{present:n||s.open,children:s.disableHoverableContent?g.jsx(XA,{side:o,...i,ref:t}):g.jsx(wte,{side:o,...i,ref:t})})}),wte=v.forwardRef((e,t)=>{const r=$c(ca,e.__scopeTooltip),n=eb(ca,e.__scopeTooltip),o=v.useRef(null),i=Ve(t,o),[s,l]=v.useState(null),{trigger:c,onClose:d}=r,f=o.current,{onPointerInTransitChange:p}=n,h=v.useCallback(()=>{l(null),p(!1)},[p]),b=v.useCallback((w,y)=>{const C=w.currentTarget,x={x:w.clientX,y:w.clientY},P=Pte(x,C.getBoundingClientRect()),S=Ste(x,P),D=_te(y.getBoundingClientRect()),_=$te([...S,...D]);l(_),p(!0)},[p]);return v.useEffect(()=>()=>h(),[h]),v.useEffect(()=>{if(c&&f){const w=C=>b(C,f),y=C=>b(C,c);return c.addEventListener("pointerleave",w),f.addEventListener("pointerleave",y),()=>{c.removeEventListener("pointerleave",w),f.removeEventListener("pointerleave",y)}}},[c,f,b,h]),v.useEffect(()=>{if(s){const w=y=>{const C=y.target,x={x:y.clientX,y:y.clientY},P=c?.contains(C)||f?.contains(C),S=!Tte(x,s);P?h():S&&(h(),d())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[c,f,s,d,h]),g.jsx(XA,{...e,ref:i})}),[Ete,Cte]=fp(Qu,{isInside:!1}),Rte=cte("TooltipContent"),XA=v.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...l}=e,c=$c(ca,r),d=pp(r),{onClose:f}=c;return v.useEffect(()=>(document.addEventListener(Cv,f),()=>document.removeEventListener(Cv,f)),[f]),v.useEffect(()=>{if(c.trigger){const p=h=>{h.target?.contains(c.trigger)&&f()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[c.trigger,f]),g.jsx(ma,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:p=>p.preventDefault(),onDismiss:f,children:g.jsxs(np,{"data-state":c.stateAttribute,...d,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[g.jsx(Rte,{children:n}),g.jsx(Ete,{scope:r,isInside:!0,children:g.jsx(ZJ,{id:c.contentId,role:"tooltip",children:o||n})})]})})});YA.displayName=ca;var ZA="TooltipArrow",QA=v.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=pp(r);return Cte(ZA,r).isInside?null:g.jsx(op,{...o,...n,ref:t})});QA.displayName=ZA;function Pte(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(r,n,o,i)){case i:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function Ste(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function _te(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}function Tte(e,t){const{x:r,y:n}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const l=t[i],c=t[s],d=l.x,f=l.y,p=c.x,h=c.y;f>n!=h>n&&r<(p-d)*(n-f)/(h-f)+d&&(o=!o)}return o}function $te(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),Ate(t)}function Ate(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const o=e[n];for(;r.length>=2;){const i=r[r.length-1],s=r[r.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))r.pop();else break}r.push(o)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var Dte=HA,Mte=UA,Ote=zA,Nte=GA,Ite=YA,kte=QA;const JA=({delayDuration:e=0,...t})=>g.jsx(Dte,{"data-slot":"tooltip-provider",delayDuration:e,...t}),eD=({...e})=>g.jsx(JA,{children:g.jsx(Mte,{"data-slot":"tooltip",...e})}),tD=({...e})=>g.jsx(Ote,{"data-slot":"tooltip-trigger",...e}),rD=({className:e,sideOffset:t=0,children:r,arrowClassName:n,...o})=>g.jsx(Nte,{children:g.jsxs(Ite,{"data-slot":"tooltip-content",sideOffset:t,className:le("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...o,children:[r,g.jsx(kte,{className:le("bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]",n)})]})}),Lte=({label:e,open:t,defaultOpen:r,onOpenChange:n,...o})=>{const{className:i,...s}=ac("Tooltip",o,{side:"top"});return g.jsxs(eD,{open:t,defaultOpen:r,onOpenChange:n,children:[g.jsx(tD,{asChild:!0,"data-slot":"tooltip-trigger",children:g.jsx(sc,{...s})}),g.jsx(rD,{"data-slot":"tooltip-content",side:s.side,sideOffset:s.offset,className:i,arrowClassName:s.arrowClassName,children:e})]})},Fte=R.createContext(null);R.createContext(null);R.createContext(null);R.createContext(null);R.createContext(null);R.createContext({});R.createContext(null);R.createContext(null);const Ot=typeof document<"u"?R.useLayoutEffect:()=>{};var Ch;const qte=(Ch=R.useInsertionEffect)!==null&&Ch!==void 0?Ch:Ot;function ur(e){const t=R.useRef(null);return qte(()=>{t.current=e},[e]),R.useCallback((...r)=>{const n=t.current;return n?.(...r)},[])}function jte(e){let[t,r]=R.useState(e),n=R.useRef(null),o=ur(()=>{if(!n.current)return;let s=n.current.next();if(s.done){n.current=null;return}t===s.value?o():r(s.value)});Ot(()=>{n.current&&o()});let i=ur(s=>{n.current=s(t),o()});return[t,i]}const Tf={prefix:String(Math.round(Math.random()*1e10)),current:0},nD=R.createContext(Tf),Bte=R.createContext(!1);let Vte=!!(typeof window<"u"&&window.document&&window.document.createElement),Rh=new WeakMap;function Kte(e=!1){let t=R.useContext(nD),r=R.useRef(null);if(r.current===null&&!e){var n,o;let i=(o=R.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)===null||o===void 0||(n=o.ReactCurrentOwner)===null||n===void 0?void 0:n.current;if(i){let s=Rh.get(i);s==null?Rh.set(i,{id:t.current,state:i.memoizedState}):i.memoizedState!==s.state&&(t.current=s.id,Rh.delete(i))}r.current=++t.current}return r.current}function Wte(e){let t=R.useContext(nD);t===Tf&&!Vte&&process.env.NODE_ENV!=="production"&&console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");let r=Kte(!!e),n=t===Tf&&process.env.NODE_ENV==="test"?"react-aria":`react-aria${t.prefix}`;return e||`${n}-${r}`}function Hte(e){let t=R.useId(),[r]=R.useState(Ac()),n=r||process.env.NODE_ENV==="test"?"react-aria":`react-aria${Tf.prefix}`;return e||`${n}-${t}`}const Ute=typeof R.useId=="function"?Hte:Wte;function zte(){return!1}function Gte(){return!0}function Yte(e){return()=>{}}function Ac(){return typeof R.useSyncExternalStore=="function"?R.useSyncExternalStore(Yte,zte,Gte):R.useContext(Bte)}let Xte=!!(typeof window<"u"&&window.document&&window.document.createElement),ia=new Map,Iu;typeof FinalizationRegistry<"u"&&(Iu=new FinalizationRegistry(e=>{ia.delete(e)}));function Qn(e){let[t,r]=R.useState(e),n=R.useRef(null),o=Ute(t),i=R.useRef(null);if(Iu&&Iu.register(i,o),Xte){const s=ia.get(o);s&&!s.includes(n)?s.push(n):ia.set(o,[n])}return Ot(()=>{let s=o;return()=>{Iu&&Iu.unregister(i),ia.delete(s)}},[o]),R.useEffect(()=>{let s=n.current;return s&&r(s),()=>{s&&(n.current=null)}}),o}function Zte(e,t){if(e===t)return e;let r=ia.get(e);if(r)return r.forEach(o=>o.current=t),t;let n=ia.get(t);return n?(n.forEach(o=>o.current=e),e):t}function Qte(e=[]){let t=Qn(),[r,n]=jte(t),o=R.useCallback(()=>{n(function*(){yield t,yield document.getElementById(t)?t:void 0})},[t,n]);return Ot(o,[t,o,...e]),r}function mp(...e){return(...t)=>{for(let r of e)typeof r=="function"&&r(...t)}}const rt=e=>{var t;return(t=e?.ownerDocument)!==null&&t!==void 0?t:document},Br=e=>e&&"window"in e&&e.window===e?e:rt(e).defaultView||window;function Jte(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function ere(e){return Jte(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let tre=!1;function hp(){return tre}function yt(e,t){if(!hp())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let r=t;for(;r!==null;){if(r===e)return!0;r.tagName==="SLOT"&&r.assignedSlot?r=r.assignedSlot.parentNode:ere(r)?r=r.host:r=r.parentNode}return!1}const er=(e=document)=>{var t;if(!hp())return e.activeElement;let r=e.activeElement;for(;r&&"shadowRoot"in r&&(!((t=r.shadowRoot)===null||t===void 0)&&t.activeElement);)r=r.shadowRoot.activeElement;return r};function Ze(e){return hp()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}class rre{get currentNode(){return this._currentNode}set currentNode(t){if(!yt(this.root,t))throw new Error("Cannot set currentNode to a node that is not contained by the root node.");const r=[];let n=t,o=t;for(this._currentNode=t;n&&n!==this.root;)if(n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const s=n,l=this._doc.createTreeWalker(s,this.whatToShow,{acceptNode:this._acceptNode});r.push(l),l.currentNode=o,this._currentSetFor.add(l),n=o=s.host}else n=n.parentNode;const i=this._doc.createTreeWalker(this.root,this.whatToShow,{acceptNode:this._acceptNode});r.push(i),i.currentNode=o,this._currentSetFor.add(i),this._walkerStack=r}get doc(){return this._doc}firstChild(){let t=this.currentNode,r=this.nextNode();return yt(t,r)?(r&&(this.currentNode=r),r):(this.currentNode=t,null)}lastChild(){let r=this._walkerStack[0].lastChild();return r&&(this.currentNode=r),r}nextNode(){const t=this._walkerStack[0].nextNode();if(t){if(t.shadowRoot){var r;let o;if(typeof this.filter=="function"?o=this.filter(t):!((r=this.filter)===null||r===void 0)&&r.acceptNode&&(o=this.filter.acceptNode(t)),o===NodeFilter.FILTER_ACCEPT)return this.currentNode=t,t;let i=this.nextNode();return i&&(this.currentNode=i),i}return t&&(this.currentNode=t),t}else if(this._walkerStack.length>1){this._walkerStack.shift();let n=this.nextNode();return n&&(this.currentNode=n),n}else return null}previousNode(){const t=this._walkerStack[0];if(t.currentNode===t.root){if(this._currentSetFor.has(t))if(this._currentSetFor.delete(t),this._walkerStack.length>1){this._walkerStack.shift();let o=this.previousNode();return o&&(this.currentNode=o),o}else return null;return null}const r=t.previousNode();if(r){if(r.shadowRoot){var n;let i;if(typeof this.filter=="function"?i=this.filter(r):!((n=this.filter)===null||n===void 0)&&n.acceptNode&&(i=this.filter.acceptNode(r)),i===NodeFilter.FILTER_ACCEPT)return r&&(this.currentNode=r),r;let s=this.lastChild();return s&&(this.currentNode=s),s}return r&&(this.currentNode=r),r}else if(this._walkerStack.length>1){this._walkerStack.shift();let o=this.previousNode();return o&&(this.currentNode=o),o}else return null}nextSibling(){return null}previousSibling(){return null}parentNode(){return null}constructor(t,r,n,o){this._walkerStack=[],this._currentSetFor=new Set,this._acceptNode=s=>{if(s.nodeType===Node.ELEMENT_NODE){const c=s.shadowRoot;if(c){const d=this._doc.createTreeWalker(c,this.whatToShow,{acceptNode:this._acceptNode});return this._walkerStack.unshift(d),NodeFilter.FILTER_ACCEPT}else{var l;if(typeof this.filter=="function")return this.filter(s);if(!((l=this.filter)===null||l===void 0)&&l.acceptNode)return this.filter.acceptNode(s);if(this.filter===null)return NodeFilter.FILTER_ACCEPT}}return NodeFilter.FILTER_SKIP},this._doc=t,this.root=r,this.filter=o??null,this.whatToShow=n??NodeFilter.SHOW_ALL,this._currentNode=r,this._walkerStack.unshift(t.createTreeWalker(r,n,this._acceptNode));const i=r.shadowRoot;if(i){const s=this._doc.createTreeWalker(i,this.whatToShow,{acceptNode:this._acceptNode});this._walkerStack.unshift(s)}}}function nre(e,t,r,n){return hp()?new rre(e,t,r,n):e.createTreeWalker(t,r,n)}function Wt(...e){let t={...e[0]};for(let r=1;r<e.length;r++){let n=e[r];for(let o in n){let i=t[o],s=n[o];typeof i=="function"&&typeof s=="function"&&o[0]==="o"&&o[1]==="n"&&o.charCodeAt(2)>=65&&o.charCodeAt(2)<=90?t[o]=mp(i,s):(o==="className"||o==="UNSAFE_className")&&typeof i=="string"&&typeof s=="string"?t[o]=Vv(i,s):o==="id"&&i&&s?t.id=Zte(i,s):t[o]=s!==void 0?s:i}}return t}function ore(...e){return e.length===1&&e[0]?e[0]:t=>{let r=!1;const n=e.map(o=>{const i=LR(o,t);return r||(r=typeof i=="function"),i});if(r)return()=>{n.forEach((o,i)=>{typeof o=="function"?o():LR(e[i],null)})}}}function LR(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}const ire=new Set(["id"]),are=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),sre=new Set(["href","hrefLang","target","rel","download","ping","referrerPolicy"]),lre=new Set(["dir","lang","hidden","inert","translate"]),FR=new Set(["onClick","onAuxClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onGotPointerCapture","onLostPointerCapture","onScroll","onWheel","onAnimationStart","onAnimationEnd","onAnimationIteration","onTransitionCancel","onTransitionEnd","onTransitionRun","onTransitionStart"]),ure=/^(data-.*)$/;function Ea(e,t={}){let{labelable:r,isLink:n,global:o,events:i=o,propNames:s}=t,l={};for(const c in e)Object.prototype.hasOwnProperty.call(e,c)&&(ire.has(c)||r&&are.has(c)||n&&sre.has(c)||o&&lre.has(c)||i&&FR.has(c)||c.endsWith("Capture")&&FR.has(c.slice(0,-7))||s?.has(c)||ure.test(c))&&(l[c]=e[c]);return l}function Jn(e){if(cre())e.focus({preventScroll:!0});else{let t=dre(e);e.focus(),fre(t)}}let Vd=null;function cre(){if(Vd==null){Vd=!1;try{document.createElement("div").focus({get preventScroll(){return Vd=!0,!0}})}catch{}}return Vd}function dre(e){let t=e.parentNode,r=[],n=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==n;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&r.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return n instanceof HTMLElement&&r.push({element:n,scrollTop:n.scrollTop,scrollLeft:n.scrollLeft}),r}function fre(e){for(let{element:t,scrollTop:r,scrollLeft:n}of e)t.scrollTop=r,t.scrollLeft=n}function vp(e){var t;if(typeof window>"u"||window.navigator==null)return!1;let r=(t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands;return Array.isArray(r)&&r.some(n=>e.test(n.brand))||e.test(window.navigator.userAgent)}function rb(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function ro(e){if(process.env.NODE_ENV==="test")return e;let t=null;return()=>(t==null&&(t=e()),t)}const vi=ro(function(){return rb(/^Mac/i)}),pre=ro(function(){return rb(/^iPhone/i)}),oD=ro(function(){return rb(/^iPad/i)||vi()&&navigator.maxTouchPoints>1}),nb=ro(function(){return pre()||oD()}),mre=ro(function(){return vi()||nb()}),hre=ro(function(){return vp(/AppleWebKit/i)&&!ob()}),ob=ro(function(){return vp(/Chrome/i)}),ib=ro(function(){return vp(/Android/i)}),vre=ro(function(){return vp(/Firefox/i)}),gre=R.createContext({isNative:!0,open:yre,useHref:e=>e});function ab(){return R.useContext(gre)}function gi(e,t,r=!0){var n,o;let{metaKey:i,ctrlKey:s,altKey:l,shiftKey:c}=t;vre()&&(!((o=window.event)===null||o===void 0||(n=o.type)===null||n===void 0)&&n.startsWith("key"))&&e.target==="_blank"&&(vi()?i=!0:s=!0);let d=hre()&&vi()&&!oD()&&process.env.NODE_ENV!=="test"?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:i,ctrlKey:s,altKey:l,shiftKey:c}):new MouseEvent("click",{metaKey:i,ctrlKey:s,altKey:l,shiftKey:c,bubbles:!0,cancelable:!0});gi.isOpening=r,Jn(e),e.dispatchEvent(d),gi.isOpening=!1}gi.isOpening=!1;function bre(e,t){if(e instanceof HTMLAnchorElement)t(e);else if(e.hasAttribute("data-href")){let r=document.createElement("a");r.href=e.getAttribute("data-href"),e.hasAttribute("data-target")&&(r.target=e.getAttribute("data-target")),e.hasAttribute("data-rel")&&(r.rel=e.getAttribute("data-rel")),e.hasAttribute("data-download")&&(r.download=e.getAttribute("data-download")),e.hasAttribute("data-ping")&&(r.ping=e.getAttribute("data-ping")),e.hasAttribute("data-referrer-policy")&&(r.referrerPolicy=e.getAttribute("data-referrer-policy")),e.appendChild(r),t(r),e.removeChild(r)}}function yre(e,t){bre(e,r=>gi(r,t))}function xre(e){let t=ab();var r;const n=t.useHref((r=e.href)!==null&&r!==void 0?r:"");return{"data-href":e.href?n:void 0,"data-target":e.target,"data-rel":e.rel,"data-download":e.download,"data-ping":e.ping,"data-referrer-policy":e.referrerPolicy}}let Eo=new Map,Pv=new Set;function qR(){if(typeof window>"u")return;function e(n){return"propertyName"in n}let t=n=>{if(!e(n)||!n.target)return;let o=Eo.get(n.target);o||(o=new Set,Eo.set(n.target,o),n.target.addEventListener("transitioncancel",r,{once:!0})),o.add(n.propertyName)},r=n=>{if(!e(n)||!n.target)return;let o=Eo.get(n.target);if(o&&(o.delete(n.propertyName),o.size===0&&(n.target.removeEventListener("transitioncancel",r),Eo.delete(n.target)),Eo.size===0)){for(let i of Pv)i();Pv.clear()}};document.body.addEventListener("transitionrun",t),document.body.addEventListener("transitionend",r)}typeof document<"u"&&(document.readyState!=="loading"?qR():document.addEventListener("DOMContentLoaded",qR));function wre(){for(const[e]of Eo)"isConnected"in e&&!e.isConnected&&Eo.delete(e)}function iD(e){requestAnimationFrame(()=>{wre(),Eo.size===0?e():Pv.add(e)})}function gp(){let e=R.useRef(new Map),t=R.useCallback((o,i,s,l)=>{let c=l?.once?(...d)=>{e.current.delete(s),s(...d)}:s;e.current.set(s,{type:i,eventTarget:o,fn:c,options:l}),o.addEventListener(i,c,l)},[]),r=R.useCallback((o,i,s,l)=>{var c;let d=((c=e.current.get(s))===null||c===void 0?void 0:c.fn)||s;o.removeEventListener(i,d,l),e.current.delete(s)},[]),n=R.useCallback(()=>{e.current.forEach((o,i)=>{r(o.eventTarget,o.type,i,o.options)})},[r]);return R.useEffect(()=>n,[n]),{addGlobalListener:t,removeGlobalListener:r,removeAllGlobalListeners:n}}function Ere(e,t){let{id:r,"aria-label":n,"aria-labelledby":o}=e;return r=Qn(r),o&&n?o=[...new Set([r,...o.trim().split(/\s+/)])].join(" "):o&&(o=o.trim().split(/\s+/).join(" ")),!n&&!o&&t&&(n=t),{id:r,"aria-label":n,"aria-labelledby":o}}function bp(e){const t=R.useRef(null),r=R.useRef(void 0),n=R.useCallback(o=>{if(typeof e=="function"){const i=e,s=i(o);return()=>{typeof s=="function"?s():i(null)}}else if(e)return e.current=o,()=>{e.current=null}},[e]);return R.useMemo(()=>({get current(){return t.current},set current(o){t.current=o,r.current&&(r.current(),r.current=void 0),o!=null&&(r.current=n(o))}}),[n])}function Cre(e,t){const r=R.useRef(!0),n=R.useRef(null);R.useEffect(()=>(r.current=!0,()=>{r.current=!1}),[]),R.useEffect(()=>{let o=n.current;r.current?r.current=!1:(!o||t.some((i,s)=>!Object.is(i,o[s])))&&e(),n.current=t},t)}function jR(e,t){const r=R.useRef(!0),n=R.useRef(null);Ot(()=>(r.current=!0,()=>{r.current=!1}),[]),Ot(()=>{r.current?r.current=!1:(!n.current||t.some((o,i)=>!Object.is(o,n[i])))&&e(),n.current=t},t)}function aD(e,t){Ot(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref&&(e.ref.current=null)}})}function Ju(e,t){if(!e)return!1;let r=window.getComputedStyle(e),n=/(auto|scroll)/.test(r.overflow+r.overflowX+r.overflowY);return n&&t&&(n=e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth),n}function ei(e,t){let r=e;for(Ju(r,t)&&(r=r.parentElement);r&&!Ju(r,t);)r=r.parentElement;return r||document.scrollingElement||document.documentElement}function Rre(e,t){const r=[];for(;e&&e!==document.documentElement;)Ju(e,t)&&r.push(e),e=e.parentElement;return r}function Ji(e){return vi()?e.metaKey:e.ctrlKey}let Pre=0;const Ph=new Map;function sD(e){let[t,r]=R.useState();return Ot(()=>{if(!e)return;let n=Ph.get(e);if(n)r(n.element.id);else{let o=`react-aria-description-${Pre++}`;r(o);let i=document.createElement("div");i.id=o,i.style.display="none",i.textContent=e,document.body.appendChild(i),n={refCount:0,element:i},Ph.set(e,n)}return n.refCount++,()=>{n&&--n.refCount===0&&(n.element.remove(),Ph.delete(e))}},[e]),{"aria-describedby":e?t:void 0}}function Kd(e,t,r,n){let o=ur(r),i=r==null;R.useEffect(()=>{if(i||!e.current)return;let s=e.current;return s.addEventListener(t,o,n),()=>{s.removeEventListener(t,o,n)}},[e,t,n,i,o])}function lD(e,t){let r=BR(e,t,"left"),n=BR(e,t,"top"),o=t.offsetWidth,i=t.offsetHeight,s=e.scrollLeft,l=e.scrollTop,{borderTopWidth:c,borderLeftWidth:d,scrollPaddingTop:f,scrollPaddingRight:p,scrollPaddingBottom:h,scrollPaddingLeft:b}=getComputedStyle(e),{scrollMarginTop:w,scrollMarginRight:y,scrollMarginBottom:C,scrollMarginLeft:x}=getComputedStyle(t),P=s+parseInt(d,10),S=l+parseInt(c,10),D=P+e.clientWidth,_=S+e.clientHeight,T=parseInt(f,10)||0,A=parseInt(h,10)||0,M=parseInt(p,10)||0,U=parseInt(b,10)||0,J=parseInt(w,10)||0,N=parseInt(C,10)||0,K=parseInt(y,10)||0,W=parseInt(x,10)||0,L=r-W,G=r+o+K,k=n-J,F=n+i+N,j=s+parseInt(d,10)+U,re=D-M,V=l+parseInt(c,10)+T,ie=_-A;if((L>j||G<re)&&(L<=s+U?s=L-parseInt(d,10)-U:G>D-M&&(s+=G-D+M)),(k>V||F<ie)&&(k<=S+T?l=k-parseInt(c,10)-T:F>_-A&&(l+=F-_+A)),process.env.NODE_ENV==="test"){e.scrollLeft=s,e.scrollTop=l;return}e.scrollTo({left:s,top:l})}function BR(e,t,r){const n=r==="left"?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[n],t.offsetParent!==e);){if(t.offsetParent.contains(e)){o-=e[n];break}t=t.offsetParent}return o}function wo(e,t){if(e&&document.contains(e)){let s=document.scrollingElement||document.documentElement;if(!(window.getComputedStyle(s).overflow==="hidden")&&!ob()){var r;let{left:c,top:d}=e.getBoundingClientRect();e==null||(r=e.scrollIntoView)===null||r===void 0||r.call(e,{block:"nearest"});let{left:f,top:p}=e.getBoundingClientRect();if(Math.abs(c-f)>1||Math.abs(d-p)>1){var n,o,i;t==null||(o=t.containingElement)===null||o===void 0||(n=o.scrollIntoView)===null||n===void 0||n.call(o,{block:"center",inline:"center"}),(i=e.scrollIntoView)===null||i===void 0||i.call(e,{block:"nearest"})}}else{let c=Rre(e);for(let d of c)lD(d,e)}}}function Sv(e){return e.pointerType===""&&e.isTrusted?!0:ib()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Sre(e){return!ib()&&e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"}function _re(e,t){let{collection:r,onLoadMore:n,scrollOffset:o=1}=e,i=R.useRef(null),s=ur(l=>{for(let c of l)c.isIntersecting&&n&&n()});Ot(()=>(t.current&&(i.current=new IntersectionObserver(s,{root:ei(t?.current),rootMargin:`0px ${100*o}% ${100*o}% ${100*o}%`}),i.current.observe(t.current)),()=>{i.current&&i.current.disconnect()}),[r,s,t,o])}function Tre(e){const t=R.version.split(".");return parseInt(t[0],10)>=19?e:e?"true":void 0}const $re="react-aria-clear-focus",Are="react-aria-focus",Dre=typeof Element<"u"&&"checkVisibility"in Element.prototype;function Mre(e){const t=Br(e);if(!(e instanceof t.HTMLElement)&&!(e instanceof t.SVGElement))return!1;let{display:r,visibility:n}=e.style,o=r!=="none"&&n!=="hidden"&&n!=="collapse";if(o){const{getComputedStyle:i}=e.ownerDocument.defaultView;let{display:s,visibility:l}=i(e);o=s!=="none"&&l!=="hidden"&&l!=="collapse"}return o}function Ore(e,t){return!e.hasAttribute("hidden")&&!e.hasAttribute("data-react-aria-prevent-focus")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function sb(e,t){return Dre?e.checkVisibility({visibilityProperty:!0})&&!e.closest("[data-react-aria-prevent-focus]"):e.nodeName!=="#comment"&&Mre(e)&&Ore(e,t)&&(!e.parentElement||sb(e.parentElement,e))}const lb=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable^="false"])',"permission"],Nre=lb.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";lb.push('[tabindex]:not([tabindex="-1"]):not([disabled])');const Ire=lb.join(':not([hidden]):not([tabindex="-1"]),');function uD(e){return e.matches(Nre)&&sb(e)&&!cD(e)}function kre(e){return e.matches(Ire)&&sb(e)&&!cD(e)}function cD(e){let t=e;for(;t!=null;){if(t instanceof t.ownerDocument.defaultView.HTMLElement&&t.inert)return!0;t=t.parentElement}return!1}function ub(e,t,r){let[n,o]=R.useState(e||t),i=R.useRef(e!==void 0),s=e!==void 0;R.useEffect(()=>{let d=i.current;d!==s&&process.env.NODE_ENV!=="production"&&console.warn(`WARN: A component changed from ${d?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}.`),i.current=s},[s]);let l=s?e:n,c=R.useCallback((d,...f)=>{let p=(h,...b)=>{r&&(Object.is(l,h)||r(h,...b)),s||(l=h)};typeof d=="function"?(process.env.NODE_ENV!=="production"&&console.warn("We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320"),o((b,...w)=>{let y=d(s?l:b,...w);return p(y,...f),s?b:y})):(s||o(d),p(d,...f))},[s,l,r]);return[l,c]}const dD=Symbol("default");function fD({values:e,children:t}){for(let[r,n]of e)t=R.createElement(r.Provider,{value:n},t);return t}function Ca(e){let{className:t,style:r,children:n,defaultClassName:o,defaultChildren:i,defaultStyle:s,values:l}=e;return R.useMemo(()=>{let c,d,f;return typeof t=="function"?c=t({...l,defaultClassName:o}):c=t,typeof r=="function"?d=r({...l,defaultStyle:s||{}}):d=r,typeof n=="function"?f=n({...l,defaultChildren:i}):n==null?f=i:f=n,{className:c??o,style:d||s?{...s,...d}:void 0,children:f??i,"data-rac":""}},[t,r,n,o,i,s,l])}function pD(e,t){return r=>t(typeof e=="function"?e(r):e,r)}function Lre(e,t){let r=R.useContext(e);if(t===null)return null;if(r&&typeof r=="object"&&"slots"in r&&r.slots){let n=t||dD;if(!r.slots[n]){let o=new Intl.ListFormat().format(Object.keys(r.slots).map(s=>`"${s}"`)),i=t?`Invalid slot "${t}".`:"A slot prop is required.";throw new Error(`${i} Valid slot names are ${o}.`)}return r.slots[n]}return r}function mD(e,t,r){let n=Lre(r,e.slot)||{},{ref:o,...i}=n,s=bp(R.useMemo(()=>ore(t,o),[t,o])),l=Wt(i,e);return"style"in i&&i.style&&"style"in e&&e.style&&(typeof i.style=="function"||typeof e.style=="function"?l.style=c=>{let d=typeof i.style=="function"?i.style(c):i.style,f={...c.defaultStyle,...d},p=typeof e.style=="function"?e.style({...c,defaultStyle:f}):e.style;return{...f,...p}}:l.style={...i.style,...e.style}),[l,s]}const hD=7e3;let pn=null;function _v(e,t="assertive",r=hD){pn?pn.announce(e,t,r):(pn=new Fre,(typeof IS_REACT_ACT_ENVIRONMENT=="boolean"?IS_REACT_ACT_ENVIRONMENT:typeof jest<"u")?pn.announce(e,t,r):setTimeout(()=>{pn?.isAttached()&&pn?.announce(e,t,r)},100))}class Fre{isAttached(){var t;return(t=this.node)===null||t===void 0?void 0:t.isConnected}createLog(t){let r=document.createElement("div");return r.setAttribute("role","log"),r.setAttribute("aria-live",t),r.setAttribute("aria-relevant","additions"),r}destroy(){this.node&&(document.body.removeChild(this.node),this.node=null)}announce(t,r="assertive",n=hD){var o,i;if(!this.node)return;let s=document.createElement("div");typeof t=="object"?(s.setAttribute("role","img"),s.setAttribute("aria-labelledby",t["aria-labelledby"])):s.textContent=t,r==="assertive"?(o=this.assertiveLog)===null||o===void 0||o.appendChild(s):(i=this.politeLog)===null||i===void 0||i.appendChild(s),t!==""&&setTimeout(()=>{s.remove()},n)}clear(t){this.node&&((!t||t==="assertive")&&this.assertiveLog&&(this.assertiveLog.innerHTML=""),(!t||t==="polite")&&this.politeLog&&(this.politeLog.innerHTML=""))}constructor(){this.node=null,this.assertiveLog=null,this.politeLog=null,typeof document<"u"&&(this.node=document.createElement("div"),this.node.dataset.liveAnnouncer="true",Object.assign(this.node.style,{border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"}),this.assertiveLog=this.createLog("assertive"),this.node.appendChild(this.assertiveLog),this.politeLog=this.createLog("polite"),this.node.appendChild(this.politeLog),document.body.prepend(this.node))}}const qre=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),jre=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function Bre(e){if(Intl.Locale){let r=new Intl.Locale(e).maximize(),n=typeof r.getTextInfo=="function"?r.getTextInfo():r.textInfo;if(n)return n.direction==="rtl";if(r.script)return qre.has(r.script)}let t=e.split("-")[0];return jre.has(t)}const Vre=Symbol.for("react-aria.i18n.locale");function vD(){let e=typeof window<"u"&&window[Vre]||typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:Bre(e)?"rtl":"ltr"}}let Tv=vD(),ku=new Set;function VR(){Tv=vD();for(let e of ku)e(Tv)}function Kre(){let e=Ac(),[t,r]=R.useState(Tv);return R.useEffect(()=>(ku.size===0&&window.addEventListener("languagechange",VR),ku.add(r),()=>{ku.delete(r),ku.size===0&&window.removeEventListener("languagechange",VR)}),[]),e?{locale:"en-US",direction:"ltr"}:t}const Wre=R.createContext(null);function Dc(){let e=Kre();return R.useContext(Wre)||e}const Hre=Symbol.for("react-aria.i18n.locale"),Ure=Symbol.for("react-aria.i18n.strings");let Gi;class yp{getStringForLocale(t,r){let o=this.getStringsForLocale(r)[t];if(!o)throw new Error(`Could not find intl message ${t} in ${r} locale`);return o}getStringsForLocale(t){let r=this.strings[t];return r||(r=zre(t,this.strings,this.defaultLocale),this.strings[t]=r),r}static getGlobalDictionaryForPackage(t){if(typeof window>"u")return null;let r=window[Hre];if(Gi===void 0){let o=window[Ure];if(!o)return null;Gi={};for(let i in o)Gi[i]=new yp({[r]:o[i]},r)}let n=Gi?.[t];if(!n)throw new Error(`Strings for package "${t}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);return n}constructor(t,r="en-US"){this.strings=Object.fromEntries(Object.entries(t).filter(([,n])=>n)),this.defaultLocale=r}}function zre(e,t,r="en-US"){if(t[e])return t[e];let n=Gre(e);if(t[n])return t[n];for(let o in t)if(o.startsWith(n+"-"))return t[o];return t[r]}function Gre(e){return Intl.Locale?new Intl.Locale(e).language:e.split("-")[0]}const KR=new Map,WR=new Map;class Yre{format(t,r){let n=this.strings.getStringForLocale(t,this.locale);return typeof n=="function"?n(r,this):n}plural(t,r,n="cardinal"){let o=r["="+t];if(o)return typeof o=="function"?o():o;let i=this.locale+":"+n,s=KR.get(i);s||(s=new Intl.PluralRules(this.locale,{type:n}),KR.set(i,s));let l=s.select(t);return o=r[l]||r.other,typeof o=="function"?o():o}number(t){let r=WR.get(this.locale);return r||(r=new Intl.NumberFormat(this.locale),WR.set(this.locale,r)),r.format(t)}select(t,r){let n=t[r]||t.other;return typeof n=="function"?n():n}constructor(t,r){this.locale=t,this.strings=r}}const HR=new WeakMap;function Xre(e){let t=HR.get(e);return t||(t=new yp(e),HR.set(e,t)),t}function Zre(e,t){return t&&yp.getGlobalDictionaryForPackage(t)||Xre(e)}function xp(e,t){let{locale:r}=Dc(),n=Zre(e,t);return R.useMemo(()=>new Yre(r,n),[r,n])}function Qre(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Jre(e,t,r){Qre(e,t),t.set(e,r)}let Sh=new Map;function gD(e){let{locale:t}=Dc(),r=t+(e?Object.entries(e).sort((o,i)=>o[0]<i[0]?-1:1).join():"");if(Sh.has(r))return Sh.get(r);let n=new Intl.Collator(t,e);return Sh.set(r,n),n}function cb(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function bD(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function yD(e){let t=R.useRef({isFocused:!1,observer:null});Ot(()=>{const n=t.current;return()=>{n.observer&&(n.observer.disconnect(),n.observer=null)}},[]);let r=ur(n=>{e?.(n)});return R.useCallback(n=>{if(n.target instanceof HTMLButtonElement||n.target instanceof HTMLInputElement||n.target instanceof HTMLTextAreaElement||n.target instanceof HTMLSelectElement){t.current.isFocused=!0;let o=n.target,i=s=>{if(t.current.isFocused=!1,o.disabled){let l=cb(s);r(l)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};o.addEventListener("focusout",i,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&o.disabled){var s;(s=t.current.observer)===null||s===void 0||s.disconnect();let l=o===document.activeElement?null:document.activeElement;o.dispatchEvent(new FocusEvent("blur",{relatedTarget:l})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:l}))}}),t.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[r])}let $f=!1;function UR(e){for(;e&&!uD(e);)e=e.parentElement;let t=Br(e),r=t.document.activeElement;if(!r||r===e)return;$f=!0;let n=!1,o=f=>{(f.target===r||n)&&f.stopImmediatePropagation()},i=f=>{(f.target===r||n)&&(f.stopImmediatePropagation(),!e&&!n&&(n=!0,Jn(r),c()))},s=f=>{(f.target===e||n)&&f.stopImmediatePropagation()},l=f=>{(f.target===e||n)&&(f.stopImmediatePropagation(),n||(n=!0,Jn(r),c()))};t.addEventListener("blur",o,!0),t.addEventListener("focusout",i,!0),t.addEventListener("focusin",l,!0),t.addEventListener("focus",s,!0);let c=()=>{cancelAnimationFrame(d),t.removeEventListener("blur",o,!0),t.removeEventListener("focusout",i,!0),t.removeEventListener("focusin",l,!0),t.removeEventListener("focus",s,!0),$f=!1,n=!1},d=requestAnimationFrame(c);return c}let ea="default",$v="",ef=new WeakMap;function zR(e){if(nb()){if(ea==="default"){const t=rt(e);$v=t.documentElement.style.webkitUserSelect,t.documentElement.style.webkitUserSelect="none"}ea="disabled"}else if(e instanceof HTMLElement||e instanceof SVGElement){let t="userSelect"in e.style?"userSelect":"webkitUserSelect";ef.set(e,e.style[t]),e.style[t]="none"}}function _h(e){if(nb()){if(ea!=="disabled")return;ea="restoring",setTimeout(()=>{iD(()=>{if(ea==="restoring"){const t=rt(e);t.documentElement.style.webkitUserSelect==="none"&&(t.documentElement.style.webkitUserSelect=$v||""),$v="",ea="default"}})},300)}else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&ef.has(e)){let t=ef.get(e),r="userSelect"in e.style?"userSelect":"webkitUserSelect";e.style[r]==="none"&&(e.style[r]=t),e.getAttribute("style")===""&&e.removeAttribute("style"),ef.delete(e)}}const xD=R.createContext({register:()=>{}});xD.displayName="PressResponderContext";function ene(e,t){return t.get?t.get.call(e):t.value}function wD(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}function tne(e,t){var r=wD(e,t,"get");return ene(e,r)}function rne(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}function GR(e,t,r){var n=wD(e,t,"set");return rne(e,n,r),r}function nne(e){let t=R.useContext(xD);if(t){let{register:r,...n}=t;e=Wt(n,e),r()}return aD(t,e.ref),e}var Wd=new WeakMap;class Hd{continuePropagation(){GR(this,Wd,!1)}get shouldStopPropagation(){return tne(this,Wd)}constructor(t,r,n,o){Jre(this,Wd,{writable:!0,value:void 0}),GR(this,Wd,!0);var i;let s=(i=o?.target)!==null&&i!==void 0?i:n.currentTarget;const l=s?.getBoundingClientRect();let c,d=0,f,p=null;n.clientX!=null&&n.clientY!=null&&(f=n.clientX,p=n.clientY),l&&(f!=null&&p!=null?(c=f-l.left,d=p-l.top):(c=l.width/2,d=l.height/2)),this.type=t,this.pointerType=r,this.target=n.currentTarget,this.shiftKey=n.shiftKey,this.metaKey=n.metaKey,this.ctrlKey=n.ctrlKey,this.altKey=n.altKey,this.x=c,this.y=d}}const YR=Symbol("linkClicked"),XR="react-aria-pressable-style",ZR="data-react-aria-pressable";function db(e){let{onPress:t,onPressChange:r,onPressStart:n,onPressEnd:o,onPressUp:i,onClick:s,isDisabled:l,isPressed:c,preventFocusOnPress:d,shouldCancelOnPointerExit:f,allowTextSelectionOnPress:p,ref:h,...b}=nne(e),[w,y]=R.useState(!1),C=R.useRef({isPressed:!1,ignoreEmulatedMouseEvents:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null,disposables:[]}),{addGlobalListener:x,removeAllGlobalListeners:P}=gp(),S=ur((N,K)=>{let W=C.current;if(l||W.didFirePressStart)return!1;let L=!0;if(W.isTriggeringEvent=!0,n){let G=new Hd("pressstart",K,N);n(G),L=G.shouldStopPropagation}return r&&r(!0),W.isTriggeringEvent=!1,W.didFirePressStart=!0,y(!0),L}),D=ur((N,K,W=!0)=>{let L=C.current;if(!L.didFirePressStart)return!1;L.didFirePressStart=!1,L.isTriggeringEvent=!0;let G=!0;if(o){let k=new Hd("pressend",K,N);o(k),G=k.shouldStopPropagation}if(r&&r(!1),y(!1),t&&W&&!l){let k=new Hd("press",K,N);t(k),G&&(G=k.shouldStopPropagation)}return L.isTriggeringEvent=!1,G}),_=ur((N,K)=>{let W=C.current;if(l)return!1;if(i){W.isTriggeringEvent=!0;let L=new Hd("pressup",K,N);return i(L),W.isTriggeringEvent=!1,L.shouldStopPropagation}return!0}),T=ur(N=>{let K=C.current;if(K.isPressed&&K.target){K.didFirePressStart&&K.pointerType!=null&&D(Xo(K.target,N),K.pointerType,!1),K.isPressed=!1,K.isOverTarget=!1,K.activePointerId=null,K.pointerType=null,P(),p||_h(K.target);for(let W of K.disposables)W();K.disposables=[]}}),A=ur(N=>{f&&T(N)}),M=ur(N=>{l||s?.(N)}),U=ur((N,K)=>{if(!l&&s){let W=new MouseEvent("click",N);bD(W,K),s(cb(W))}}),J=R.useMemo(()=>{let N=C.current,K={onKeyDown(L){if(Th(L.nativeEvent,L.currentTarget)&&yt(L.currentTarget,Ze(L.nativeEvent))){var G;e1(Ze(L.nativeEvent),L.key)&&L.preventDefault();let k=!0;if(!N.isPressed&&!L.repeat){N.target=L.currentTarget,N.isPressed=!0,N.pointerType="keyboard",k=S(L,"keyboard");let F=L.currentTarget,j=re=>{Th(re,F)&&!re.repeat&&yt(F,Ze(re))&&N.target&&_(Xo(N.target,re),"keyboard")};x(rt(L.currentTarget),"keyup",mp(j,W),!0)}k&&L.stopPropagation(),L.metaKey&&vi()&&((G=N.metaKeyEvents)===null||G===void 0||G.set(L.key,L.nativeEvent))}else L.key==="Meta"&&(N.metaKeyEvents=new Map)},onClick(L){if(!(L&&!yt(L.currentTarget,Ze(L.nativeEvent)))&&L&&L.button===0&&!N.isTriggeringEvent&&!gi.isOpening){let G=!0;if(l&&L.preventDefault(),!N.ignoreEmulatedMouseEvents&&!N.isPressed&&(N.pointerType==="virtual"||Sv(L.nativeEvent))){let k=S(L,"virtual"),F=_(L,"virtual"),j=D(L,"virtual");M(L),G=k&&F&&j}else if(N.isPressed&&N.pointerType!=="keyboard"){let k=N.pointerType||L.nativeEvent.pointerType||"virtual",F=_(Xo(L.currentTarget,L),k),j=D(Xo(L.currentTarget,L),k,!0);G=F&&j,N.isOverTarget=!1,M(L),T(L)}N.ignoreEmulatedMouseEvents=!1,G&&L.stopPropagation()}}},W=L=>{var G;if(N.isPressed&&N.target&&Th(L,N.target)){var k;e1(Ze(L),L.key)&&L.preventDefault();let j=Ze(L),re=yt(N.target,Ze(L));D(Xo(N.target,L),"keyboard",re),re&&U(L,N.target),P(),L.key!=="Enter"&&fb(N.target)&&yt(N.target,j)&&!L[YR]&&(L[YR]=!0,gi(N.target,L,!1)),N.isPressed=!1,(k=N.metaKeyEvents)===null||k===void 0||k.delete(L.key)}else if(L.key==="Meta"&&(!((G=N.metaKeyEvents)===null||G===void 0)&&G.size)){var F;let j=N.metaKeyEvents;N.metaKeyEvents=void 0;for(let re of j.values())(F=N.target)===null||F===void 0||F.dispatchEvent(new KeyboardEvent("keyup",re))}};if(typeof PointerEvent<"u"){K.onPointerDown=k=>{if(k.button!==0||!yt(k.currentTarget,Ze(k.nativeEvent)))return;if(Sre(k.nativeEvent)){N.pointerType="virtual";return}N.pointerType=k.pointerType;let F=!0;if(!N.isPressed){N.isPressed=!0,N.isOverTarget=!0,N.activePointerId=k.pointerId,N.target=k.currentTarget,p||zR(N.target),F=S(k,N.pointerType);let j=Ze(k.nativeEvent);"releasePointerCapture"in j&&j.releasePointerCapture(k.pointerId),x(rt(k.currentTarget),"pointerup",L,!1),x(rt(k.currentTarget),"pointercancel",G,!1)}F&&k.stopPropagation()},K.onMouseDown=k=>{if(yt(k.currentTarget,Ze(k.nativeEvent))&&k.button===0){if(d){let F=UR(k.target);F&&N.disposables.push(F)}k.stopPropagation()}},K.onPointerUp=k=>{!yt(k.currentTarget,Ze(k.nativeEvent))||N.pointerType==="virtual"||k.button===0&&!N.isPressed&&_(k,N.pointerType||k.pointerType)},K.onPointerEnter=k=>{k.pointerId===N.activePointerId&&N.target&&!N.isOverTarget&&N.pointerType!=null&&(N.isOverTarget=!0,S(Xo(N.target,k),N.pointerType))},K.onPointerLeave=k=>{k.pointerId===N.activePointerId&&N.target&&N.isOverTarget&&N.pointerType!=null&&(N.isOverTarget=!1,D(Xo(N.target,k),N.pointerType,!1),A(k))};let L=k=>{if(k.pointerId===N.activePointerId&&N.isPressed&&k.button===0&&N.target){if(yt(N.target,Ze(k))&&N.pointerType!=null){let F=!1,j=setTimeout(()=>{N.isPressed&&N.target instanceof HTMLElement&&(F?T(k):(Jn(N.target),N.target.click()))},80);x(k.currentTarget,"click",()=>F=!0,!0),N.disposables.push(()=>clearTimeout(j))}else T(k);N.isOverTarget=!1}},G=k=>{T(k)};K.onDragStart=k=>{yt(k.currentTarget,Ze(k.nativeEvent))&&T(k)}}else if(process.env.NODE_ENV==="test"){K.onMouseDown=k=>{if(k.button!==0||!yt(k.currentTarget,Ze(k.nativeEvent)))return;if(N.ignoreEmulatedMouseEvents){k.stopPropagation();return}if(N.isPressed=!0,N.isOverTarget=!0,N.target=k.currentTarget,N.pointerType=Sv(k.nativeEvent)?"virtual":"mouse",rn.flushSync(()=>S(k,N.pointerType))&&k.stopPropagation(),d){let j=UR(k.target);j&&N.disposables.push(j)}x(rt(k.currentTarget),"mouseup",L,!1)},K.onMouseEnter=k=>{if(!yt(k.currentTarget,Ze(k.nativeEvent)))return;let F=!0;N.isPressed&&!N.ignoreEmulatedMouseEvents&&N.pointerType!=null&&(N.isOverTarget=!0,F=S(k,N.pointerType)),F&&k.stopPropagation()},K.onMouseLeave=k=>{if(!yt(k.currentTarget,Ze(k.nativeEvent)))return;let F=!0;N.isPressed&&!N.ignoreEmulatedMouseEvents&&N.pointerType!=null&&(N.isOverTarget=!1,F=D(k,N.pointerType,!1),A(k)),F&&k.stopPropagation()},K.onMouseUp=k=>{yt(k.currentTarget,Ze(k.nativeEvent))&&!N.ignoreEmulatedMouseEvents&&k.button===0&&!N.isPressed&&_(k,N.pointerType||"mouse")};let L=k=>{if(k.button===0){if(N.ignoreEmulatedMouseEvents){N.ignoreEmulatedMouseEvents=!1;return}N.target&&N.target.contains(k.target)&&N.pointerType!=null||T(k),N.isOverTarget=!1}};K.onTouchStart=k=>{if(!yt(k.currentTarget,Ze(k.nativeEvent)))return;let F=one(k.nativeEvent);if(!F)return;N.activePointerId=F.identifier,N.ignoreEmulatedMouseEvents=!0,N.isOverTarget=!0,N.isPressed=!0,N.target=k.currentTarget,N.pointerType="touch",p||zR(N.target),S(bo(N.target,k),N.pointerType)&&k.stopPropagation(),x(Br(k.currentTarget),"scroll",G,!0)},K.onTouchMove=k=>{if(!yt(k.currentTarget,Ze(k.nativeEvent)))return;if(!N.isPressed){k.stopPropagation();return}let F=QR(k.nativeEvent,N.activePointerId),j=!0;F&&JR(F,k.currentTarget)?!N.isOverTarget&&N.pointerType!=null&&(N.isOverTarget=!0,j=S(bo(N.target,k),N.pointerType)):N.isOverTarget&&N.pointerType!=null&&(N.isOverTarget=!1,j=D(bo(N.target,k),N.pointerType,!1),A(bo(N.target,k))),j&&k.stopPropagation()},K.onTouchEnd=k=>{if(!yt(k.currentTarget,Ze(k.nativeEvent)))return;if(!N.isPressed){k.stopPropagation();return}let F=QR(k.nativeEvent,N.activePointerId),j=!0;F&&JR(F,k.currentTarget)&&N.pointerType!=null?(_(bo(N.target,k),N.pointerType),j=D(bo(N.target,k),N.pointerType),U(k.nativeEvent,N.target)):N.isOverTarget&&N.pointerType!=null&&(j=D(bo(N.target,k),N.pointerType,!1)),j&&k.stopPropagation(),N.isPressed=!1,N.activePointerId=null,N.isOverTarget=!1,N.ignoreEmulatedMouseEvents=!0,N.target&&!p&&_h(N.target),P()},K.onTouchCancel=k=>{yt(k.currentTarget,Ze(k.nativeEvent))&&(k.stopPropagation(),N.isPressed&&T(bo(N.target,k)))};let G=k=>{N.isPressed&&yt(Ze(k),N.target)&&T({currentTarget:N.target,shiftKey:!1,ctrlKey:!1,metaKey:!1,altKey:!1})};K.onDragStart=k=>{yt(k.currentTarget,Ze(k.nativeEvent))&&T(k)}}return K},[x,l,d,P,p,T,A,D,S,_,M,U]);return R.useEffect(()=>{if(!h||process.env.NODE_ENV==="test")return;const N=rt(h.current);if(!N||!N.head||N.getElementById(XR))return;const K=N.createElement("style");K.id=XR,K.textContent=`
127
127
  @layer {
128
128
  [${ZR}] {
129
129
  touch-action: pan-x pan-y pinch-zoom;