@boxcustodia/library 2.0.0-alpha.3 → 2.0.0-alpha.4
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 +1 -1
- package/dist/index.es.js +2 -2
- package/dist/theme.css +4 -0
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -132,7 +132,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
132
132
|
`)+we+`return __p
|
|
133
133
|
}`;var Ze=aC(function(){return mt(B,ke+"return "+we).apply(n,Y)});if(Ze.source=we,Rg(Ze))throw Ze;return Ze}function d6(l){return vt(l).toLowerCase()}function f6(l){return vt(l).toUpperCase()}function p6(l,d,g){if(l=vt(l),l&&(g||d===n))return g0(l);if(!l||!(d=rr(d)))return l;var C=Nr(l),M=Nr(d),B=v0(C,M),Y=b0(C,M)+1;return si(C,B,Y).join("")}function m6(l,d,g){if(l=vt(l),l&&(g||d===n))return l.slice(0,x0(l)+1);if(!l||!(d=rr(d)))return l;var C=Nr(l),M=b0(C,Nr(d))+1;return si(C,0,M).join("")}function h6(l,d,g){if(l=vt(l),l&&(g||d===n))return l.replace(_a,"");if(!l||!(d=rr(d)))return l;var C=Nr(l),M=v0(C,Nr(d));return si(C,M).join("")}function g6(l,d){var g=U,C=A;if(Wt(d)){var M="separator"in d?d.separator:M;g="length"in d?Xe(d.length):g,C="omission"in d?rr(d.omission):C}l=vt(l);var B=l.length;if(Ts(l)){var Y=Nr(l);B=Y.length}if(g>=B)return l;var ne=g-_s(C);if(ne<1)return C;var ae=Y?si(Y,0,ne).join(""):l.slice(0,ne);if(M===n)return ae+C;if(Y&&(ne+=ae.length-ne),Sg(M)){if(l.slice(ne).search(M)){var be,ye=ae;for(M.global||(M=Bh(M.source,vt(Lw.exec(M))+"g")),M.lastIndex=0;be=M.exec(ye);)var we=be.index;ae=ae.slice(0,we===n?ne:we)}}else if(l.indexOf(rr(M),ne)!=ne){var _e=ae.lastIndexOf(M);_e>-1&&(ae=ae.slice(0,_e))}return ae+C}function v6(l){return l=vt(l),l&&Rn.test(l)?l.replace(Ft,U3):l}var b6=Is(function(l,d,g){return l+(g?" ":"")+d.toUpperCase()}),_g=lE("toUpperCase");function sC(l,d,g){return l=vt(l),d=g?n:d,d===n?B3(l)?Y3(l):M3(l):l.match(d)||[]}var aC=Qe(function(l,d){try{return tr(l,n,d)}catch(g){return Rg(g)?g:new We(g)}}),y6=wo(function(l,d){return hr(d,function(g){g=eo(g),yo(l,g,Eg(l[g],l))}),l});function x6(l){var d=l==null?0:l.length,g=qe();return l=d?Lt(l,function(C){if(typeof C[1]!="function")throw new gr(s);return[g(C[0]),C[1]]}):[],Qe(function(C){for(var M=-1;++M<d;){var B=l[M];if(tr(B[0],this,C))return tr(B[1],this,C)}})}function w6(l){return UL(br(l,p))}function Og(l){return function(){return l}}function E6(l,d){return l==null||l!==l?d:l}var C6=cE(),R6=cE(!0);function Gn(l){return l}function $g(l){return j0(typeof l=="function"?l:br(l,p))}function S6(l){return V0(br(l,p))}function P6(l,d){return K0(l,br(d,p))}var T6=Qe(function(l,d){return function(g){return Fa(g,l,d)}}),_6=Qe(function(l,d){return function(g){return Fa(l,g,d)}});function Dg(l,d,g){var C=En(d),M=gf(d,C);g==null&&!(Wt(d)&&(M.length||!C.length))&&(g=d,d=l,l=this,M=gf(d,En(d)));var B=!(Wt(g)&&"chain"in g)||!!g.chain,Y=Co(l);return hr(M,function(ne){var ae=d[ne];l[ne]=ae,Y&&(l.prototype[ne]=function(){var be=this.__chain__;if(B||be){var ye=l(this.__wrapped__),we=ye.__actions__=Wn(this.__actions__);return we.push({func:ae,args:arguments,thisArg:l}),ye.__chain__=be,ye}return ae.apply(l,ei([this.value()],arguments))})}),l}function O6(){return Sn._===this&&(Sn._=tL),this}function Mg(){}function $6(l){return l=Xe(l),Qe(function(d){return H0(d,l)})}var D6=ug(Lt),M6=ug(d0),A6=ug(Nh);function lC(l){return gg(l)?Ih(eo(l)):uq(l)}function N6(l){return function(d){return l==null?n:Ki(l,d)}}var I6=fE(),k6=fE(!0);function Ag(){return[]}function Ng(){return!1}function F6(){return{}}function L6(){return""}function q6(){return!0}function j6(l,d){if(l=Xe(l),l<1||l>q)return[];var g=te,C=Mn(l,te);d=qe(d),l-=te;for(var M=Lh(C,d);++g<l;)d(g);return M}function B6(l){return ze(l)?Lt(l,eo):or(l)?[l]:Wn(_E(vt(l)))}function V6(l){var d=++J3;return vt(l)+d}var K6=Ef(function(l,d){return l+d},0),H6=cg("ceil"),W6=Ef(function(l,d){return l/d},1),U6=cg("floor");function z6(l){return l&&l.length?hf(l,Gn,Yh):n}function G6(l,d){return l&&l.length?hf(l,qe(d,2),Yh):n}function Y6(l){return m0(l,Gn)}function X6(l,d){return m0(l,qe(d,2))}function Z6(l){return l&&l.length?hf(l,Gn,Jh):n}function Q6(l,d){return l&&l.length?hf(l,qe(d,2),Jh):n}var J6=Ef(function(l,d){return l*d},1),eV=cg("round"),tV=Ef(function(l,d){return l-d},0);function nV(l){return l&&l.length?Fh(l,Gn):0}function rV(l,d){return l&&l.length?Fh(l,qe(d,2)):0}return L.after=S5,L.ary=qE,L.assign=fB,L.assignIn=JE,L.assignInWith=If,L.assignWith=pB,L.at=mB,L.before=jE,L.bind=Eg,L.bindAll=y6,L.bindKey=BE,L.castArray=F5,L.chain=kE,L.chunk=Uq,L.compact=zq,L.concat=Gq,L.cond=x6,L.conforms=w6,L.constant=Og,L.countBy=n5,L.create=hB,L.curry=VE,L.curryRight=KE,L.debounce=HE,L.defaults=gB,L.defaultsDeep=vB,L.defer=P5,L.delay=T5,L.difference=Yq,L.differenceBy=Xq,L.differenceWith=Zq,L.drop=Qq,L.dropRight=Jq,L.dropRightWhile=ej,L.dropWhile=tj,L.fill=nj,L.filter=o5,L.flatMap=a5,L.flatMapDeep=l5,L.flatMapDepth=u5,L.flatten=ME,L.flattenDeep=rj,L.flattenDepth=oj,L.flip=_5,L.flow=C6,L.flowRight=R6,L.fromPairs=ij,L.functions=RB,L.functionsIn=SB,L.groupBy=c5,L.initial=aj,L.intersection=lj,L.intersectionBy=uj,L.intersectionWith=cj,L.invert=TB,L.invertBy=_B,L.invokeMap=f5,L.iteratee=$g,L.keyBy=p5,L.keys=En,L.keysIn=zn,L.map=Of,L.mapKeys=$B,L.mapValues=DB,L.matches=S6,L.matchesProperty=P6,L.memoize=Df,L.merge=MB,L.mergeWith=eC,L.method=T6,L.methodOf=_6,L.mixin=Dg,L.negate=Mf,L.nthArg=$6,L.omit=AB,L.omitBy=NB,L.once=O5,L.orderBy=m5,L.over=D6,L.overArgs=$5,L.overEvery=M6,L.overSome=A6,L.partial=Cg,L.partialRight=WE,L.partition=h5,L.pick=IB,L.pickBy=tC,L.property=lC,L.propertyOf=N6,L.pull=mj,L.pullAll=NE,L.pullAllBy=hj,L.pullAllWith=gj,L.pullAt=vj,L.range=I6,L.rangeRight=k6,L.rearg=D5,L.reject=b5,L.remove=bj,L.rest=M5,L.reverse=xg,L.sampleSize=x5,L.set=FB,L.setWith=LB,L.shuffle=w5,L.slice=yj,L.sortBy=R5,L.sortedUniq=Pj,L.sortedUniqBy=Tj,L.split=a6,L.spread=A5,L.tail=_j,L.take=Oj,L.takeRight=$j,L.takeRightWhile=Dj,L.takeWhile=Mj,L.tap=zj,L.throttle=N5,L.thru=_f,L.toArray=XE,L.toPairs=nC,L.toPairsIn=rC,L.toPath=B6,L.toPlainObject=QE,L.transform=qB,L.unary=I5,L.union=Aj,L.unionBy=Nj,L.unionWith=Ij,L.uniq=kj,L.uniqBy=Fj,L.uniqWith=Lj,L.unset=jB,L.unzip=wg,L.unzipWith=IE,L.update=BB,L.updateWith=VB,L.values=Ls,L.valuesIn=KB,L.without=qj,L.words=sC,L.wrap=k5,L.xor=jj,L.xorBy=Bj,L.xorWith=Vj,L.zip=Kj,L.zipObject=Hj,L.zipObjectDeep=Wj,L.zipWith=Uj,L.entries=nC,L.entriesIn=rC,L.extend=JE,L.extendWith=If,Dg(L,L),L.add=K6,L.attempt=aC,L.camelCase=zB,L.capitalize=oC,L.ceil=H6,L.clamp=HB,L.clone=L5,L.cloneDeep=j5,L.cloneDeepWith=B5,L.cloneWith=q5,L.conformsTo=V5,L.deburr=iC,L.defaultTo=E6,L.divide=W6,L.endsWith=GB,L.eq=kr,L.escape=YB,L.escapeRegExp=XB,L.every=r5,L.find=i5,L.findIndex=$E,L.findKey=bB,L.findLast=s5,L.findLastIndex=DE,L.findLastKey=yB,L.floor=U6,L.forEach=FE,L.forEachRight=LE,L.forIn=xB,L.forInRight=wB,L.forOwn=EB,L.forOwnRight=CB,L.get=Pg,L.gt=K5,L.gte=H5,L.has=PB,L.hasIn=Tg,L.head=AE,L.identity=Gn,L.includes=d5,L.indexOf=sj,L.inRange=WB,L.invoke=OB,L.isArguments=Ui,L.isArray=ze,L.isArrayBuffer=W5,L.isArrayLike=Un,L.isArrayLikeObject=en,L.isBoolean=U5,L.isBuffer=ai,L.isDate=z5,L.isElement=G5,L.isEmpty=Y5,L.isEqual=X5,L.isEqualWith=Z5,L.isError=Rg,L.isFinite=Q5,L.isFunction=Co,L.isInteger=UE,L.isLength=Af,L.isMap=zE,L.isMatch=J5,L.isMatchWith=eB,L.isNaN=tB,L.isNative=nB,L.isNil=oB,L.isNull=rB,L.isNumber=GE,L.isObject=Wt,L.isObjectLike=Xt,L.isPlainObject=Ka,L.isRegExp=Sg,L.isSafeInteger=iB,L.isSet=YE,L.isString=Nf,L.isSymbol=or,L.isTypedArray=Fs,L.isUndefined=sB,L.isWeakMap=aB,L.isWeakSet=lB,L.join=dj,L.kebabCase=ZB,L.last=xr,L.lastIndexOf=fj,L.lowerCase=QB,L.lowerFirst=JB,L.lt=uB,L.lte=cB,L.max=z6,L.maxBy=G6,L.mean=Y6,L.meanBy=X6,L.min=Z6,L.minBy=Q6,L.stubArray=Ag,L.stubFalse=Ng,L.stubObject=F6,L.stubString=L6,L.stubTrue=q6,L.multiply=J6,L.nth=pj,L.noConflict=O6,L.noop=Mg,L.now=$f,L.pad=e6,L.padEnd=t6,L.padStart=n6,L.parseInt=r6,L.random=UB,L.reduce=g5,L.reduceRight=v5,L.repeat=o6,L.replace=i6,L.result=kB,L.round=eV,L.runInContext=oe,L.sample=y5,L.size=E5,L.snakeCase=s6,L.some=C5,L.sortedIndex=xj,L.sortedIndexBy=wj,L.sortedIndexOf=Ej,L.sortedLastIndex=Cj,L.sortedLastIndexBy=Rj,L.sortedLastIndexOf=Sj,L.startCase=l6,L.startsWith=u6,L.subtract=tV,L.sum=nV,L.sumBy=rV,L.template=c6,L.times=j6,L.toFinite=Ro,L.toInteger=Xe,L.toLength=ZE,L.toLower=d6,L.toNumber=wr,L.toSafeInteger=dB,L.toString=vt,L.toUpper=f6,L.trim=p6,L.trimEnd=m6,L.trimStart=h6,L.truncate=g6,L.unescape=v6,L.uniqueId=V6,L.upperCase=b6,L.upperFirst=_g,L.each=FE,L.eachRight=LE,L.first=AE,Dg(L,(function(){var l={};return Qr(L,function(d,g){Et.call(L.prototype,g)||(l[g]=d)}),l})(),{chain:!1}),L.VERSION=r,hr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(l){L[l].placeholder=L}),hr(["drop","take"],function(l,d){ot.prototype[l]=function(g){g=g===n?1:gn(Xe(g),0);var C=this.__filtered__&&!d?new ot(this):this.clone();return C.__filtered__?C.__takeCount__=Mn(g,C.__takeCount__):C.__views__.push({size:Mn(g,te),type:l+(C.__dir__<0?"Right":"")}),C},ot.prototype[l+"Right"]=function(g){return this.reverse()[l](g).reverse()}}),hr(["filter","map","takeWhile"],function(l,d){var g=d+1,C=g==N||g==I;ot.prototype[l]=function(M){var B=this.clone();return B.__iteratees__.push({iteratee:qe(M,3),type:g}),B.__filtered__=B.__filtered__||C,B}}),hr(["head","last"],function(l,d){var g="take"+(d?"Right":"");ot.prototype[l]=function(){return this[g](1).value()[0]}}),hr(["initial","tail"],function(l,d){var g="drop"+(d?"":"Right");ot.prototype[l]=function(){return this.__filtered__?new ot(this):this[g](1)}}),ot.prototype.compact=function(){return this.filter(Gn)},ot.prototype.find=function(l){return this.filter(l).head()},ot.prototype.findLast=function(l){return this.reverse().find(l)},ot.prototype.invokeMap=Qe(function(l,d){return typeof l=="function"?new ot(this):this.map(function(g){return Fa(g,l,d)})}),ot.prototype.reject=function(l){return this.filter(Mf(qe(l)))},ot.prototype.slice=function(l,d){l=Xe(l);var g=this;return g.__filtered__&&(l>0||d<0)?new ot(g):(l<0?g=g.takeRight(-l):l&&(g=g.drop(l)),d!==n&&(d=Xe(d),g=d<0?g.dropRight(-d):g.take(d-l)),g)},ot.prototype.takeRightWhile=function(l){return this.reverse().takeWhile(l).reverse()},ot.prototype.toArray=function(){return this.take(te)},Qr(ot.prototype,function(l,d){var g=/^(?:filter|find|map|reject)|While$/.test(d),C=/^(?:head|last)$/.test(d),M=L[C?"take"+(d=="last"?"Right":""):d],B=C||/^find/.test(d);M&&(L.prototype[d]=function(){var Y=this.__wrapped__,ne=C?[1]:arguments,ae=Y instanceof ot,be=ne[0],ye=ae||ze(Y),we=function(rt){var at=M.apply(L,ei([rt],ne));return C&&_e?at[0]:at};ye&&g&&typeof be=="function"&&be.length!=1&&(ae=ye=!1);var _e=this.__chain__,ke=!!this.__actions__.length,Be=B&&!_e,Ze=ae&&!ke;if(!B&&ye){Y=Ze?Y:new ot(this);var Ve=l.apply(Y,ne);return Ve.__actions__.push({func:_f,args:[we],thisArg:n}),new vr(Ve,_e)}return Be&&Ze?l.apply(this,ne):(Ve=this.thru(we),Be?C?Ve.value()[0]:Ve.value():Ve)})}),hr(["pop","push","shift","sort","splice","unshift"],function(l){var d=Jd[l],g=/^(?:push|sort|unshift)$/.test(l)?"tap":"thru",C=/^(?:pop|shift)$/.test(l);L.prototype[l]=function(){var M=arguments;if(C&&!this.__chain__){var B=this.value();return d.apply(ze(B)?B:[],M)}return this[g](function(Y){return d.apply(ze(Y)?Y:[],M)})}}),Qr(ot.prototype,function(l,d){var g=L[d];if(g){var C=g.name+"";Et.call(Ms,C)||(Ms[C]=[]),Ms[C].push({name:d,func:g})}}),Ms[wf(n,x).name]=[{name:"wrapper",func:n}],ot.prototype.clone=vL,ot.prototype.reverse=bL,ot.prototype.value=yL,L.prototype.at=Gj,L.prototype.chain=Yj,L.prototype.commit=Xj,L.prototype.next=Zj,L.prototype.plant=Jj,L.prototype.reverse=e5,L.prototype.toJSON=L.prototype.valueOf=L.prototype.value=t5,L.prototype.first=L.prototype.head,$a&&(L.prototype[$a]=Qj),L}),Os=X3();Li?((Li.exports=Os)._=Os,$h._=Os):Sn._=Os}).call(_re)})(jc,jc.exports)),jc.exports}var _t=Ore();const $re=({view:e,setView:t,value:n,previousMonth:r,nextMonth:o,previousYear:i,nextYear:s,previousDecade:a,nextDecade:u,goBackProps:c,goNextProps:f,changeViewProps:p})=>{const m=e==="month",b=e==="year",y=e==="decade",v=()=>{if(y)return a();if(b)return i();r()},E=()=>{if(y)return u();if(b)return s();o()},x=()=>{if(m)return t("year");if(b)return t("decade")},R=()=>y?P():b?Cn(n,"yyyy"):Cn(n,"MMMM yyyy",{locale:Tre}),P=()=>{if(!n)return"";const S=XM({start:uA(n),end:ZM(n)}),T=_t.first(S),_=_t.last(S);return`${Cn(T,"yyyy")} - ${Cn(_,"yyyy")}`},O=D.useMemo(R,[n,e]);return w.jsx(w.Fragment,{children:w.jsxs("div",{className:"flex items-center justify-between","data-slot":"calendar-navigation",children:[w.jsxs(Tn,{onClick:v,size:"icon",variant:"ghost",className:"border w-6 opacity-50 hover:opacity-100","data-slot":"calendar-navigation-back",...c,children:[w.jsx(ky,{className:"h-4 w-4","data-slot":"calendar-navigation-back-icon"}),w.jsx("span",{className:"sr-only",children:"Ir a anterior"})]}),w.jsx("button",{onClick:x,disabled:y,...p,type:"button",className:me("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:O}),w.jsxs(Tn,{onClick:E,size:"icon",variant:"ghost",className:"border w-6 opacity-50 hover:opacity-100","data-slot":"calendar-navigation-next",...f,children:[w.jsx(gd,{className:"h-4 w-4","data-slot":"calendar-navigation-next-icon"}),w.jsx("span",{className:"sr-only",children:"Ir a siguiente"})]})]})})};function Gc(e){return!!(e&&typeof e=="object"&&"start"in e&&"end"in e)}function Dre(e,t){return{selectMultipleDate:o=>{if(!e)return t([o]);const i=_t.findIndex(e,a=>ss(a,o));if(i===-1)return t([...e,o]);const s=[...e.slice(0,i),...e.slice(i+1)];t(s)},isMultipleSelected:o=>_t.isArray(e)&&e.some(i=>ss(i,o))}}function Mre(e,t,n){const r=u=>{if(e?.start){const{start:f,end:p}=e;if(Yte(u,f)||f&&p){t({start:u,end:void 0});return}if(o(f,u))return;t({start:f,end:u})}else t({start:u,end:void 0})},o=(u,c)=>!n||!u||!c?!1:YM({start:Ri(u),end:c}).some(m=>n(m));return{selectRangeDate:r,isInRange:u=>{if(!Gc(e)||!e)return!1;const{start:c,end:f}=e;return c&&!f?ss(u,c):!c||!f?!1:Gne(u,{start:Ri(c),end:Ri(f)})},isFirstDayFromRange:u=>!e||!Gc(e)||!e.start?!1:ss(u,e.start),isLastDayFromRange:u=>!e||!Gc(e)||!e.end?!1:ss(u,e.end)}}function Are(e,t){return{selectSingleDate:o=>{t(o)},isSingleSelected:o=>ps(e)&&ss(o,e)}}const cA=D.createContext({defaultStartDate:new Date,mode:"single",isSingleMode:!1,isRangeMode:!1,selected:null,selectDate:()=>{},isSelected:()=>!1,isFirstDayFromRange:()=>!1,isLastDayFromRange:()=>!1,isInRange:()=>!1});function Nre(e){const{mode:t,value:n,defaultValue:r,onChange:o,disabled:i}=e,s=t==="single",a=t==="range",u=t==="multiple",[c=null,f]=Kt({prop:n,onChange:o,defaultProp:r}),{selectSingleDate:p,isSingleSelected:m}=Are(ps(c)?c:void 0,f),{selectRangeDate:b,isInRange:y,...v}=Mre(Gc(c)?c:void 0,f,i),{selectMultipleDate:E,isMultipleSelected:x}=Dre(_t.isArray(c)?c:void 0,f),R=S=>{if(s)return p(S);if(a)return b(S);if(u)return E(S)},P=S=>s?m(S):a?y(S):u?x(S):!1;return{defaultStartDate:ps(c)?c:_t.isArray(c)?c[0]:Gc(c)&&c.start?c.start:new Date,isSingleMode:s,isRangeMode:a,selected:c,isSelected:P,selectDate:R,isInRange:y,mode:t,...v}}const Ire=({day:e,navigationDate:t,className:n,...r})=>{const{isSelected:o,mode:i,selected:s,isRangeMode:a,selectDate:u,isFirstDayFromRange:c,isLastDayFromRange:f}=D.useContext(cA),p=D.useMemo(()=>o(e),[e,s]),m=!p&&!Une(e,t),b=!p&&zee(e);return w.jsx("button",{...r,onClick:()=>u(e),type:"button","data-slot":"calendar-day","data-state-mode":i,"data-state-today":zne(e)||void 0,"data-state-selected":p||void 0,"data-state-different-month":m||void 0,"data-state-weekend":b||void 0,"data-state-range-mode":a||void 0,"data-state-first-day":c(e)||void 0,"data-state-last-day":f(e)||void 0,"data-state-in-range":a&&p||void 0,className:me("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",n),children:w.jsx("time",{dateTime:Cn(e,"yyyy-MM-dd"),children:Cn(e,"d")})})},kre=({value:e,onChange:t})=>{const n=()=>XM({start:uA(e),end:ZM(e)}),r=i=>{const s=Xne(e,parseInt(Cn(i,"yyyy")));t(s)},o=D.useMemo(n,[e]);return w.jsx("div",{className:"grid grid-cols-3 grow","data-slot":"calendar-decade-view",children:o.map((i,s)=>w.jsx(Tn,{onClick:()=>r(i),className:"h-full rounded-none",type:"button",variant:"ghost","data-slot":"calendar-decade-view-year",children:Cn(i,"yyyy")},s))})},Sb=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],dA=["Lunes","Martes","Miercoles","Jueves","Viernes","Sabado","Domingo"],Fre=e=>w.jsx("div",{...e,className:me("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:dA.map(t=>w.jsx("abbr",{"aria-label":t,"data-slot":"calendar-week-day",children:_t.at(t,0)},t))}),Lre=({navigationDate:e,disabled:t,weekDaysClassName:n,weekDaysProps:r,dayClassName:o,dayProps:i})=>{const s=()=>YM({start:Ko(e,{weekStartsOn:1}),end:tte(Jee(e),{weekStartsOn:1})}),a=D.useMemo(s,[e]);return w.jsxs(w.Fragment,{children:[w.jsx(Fre,{className:n,...r}),w.jsx("div",{className:"grid grid-cols-7 mt-2 text-sm","data-slot":"calendar-month-view",children:a.map((u,c)=>w.jsx(Ire,{day:u,className:o,...i,navigationDate:e,disabled:t?.(u)},c))})]})},qre=({value:e,onChange:t})=>{const n=r=>{const o=Yne(e,r);t(o)};return w.jsx("div",{className:"grid grid-cols-3 grow","data-slot":"calendar-year-view",children:Sb.map(r=>w.jsx(Tn,{type:"button",className:"h-full rounded",onClick:()=>n(Sb.indexOf(r)),variant:"ghost","data-slot":"calendar-year-view-month",children:w.jsx("abbr",{"aria-label":`${r} ${Cn(e,"yyyy")}`,children:r})},r))})};function jre(e=Sv()){const[t,n]=D.useState({month:Cn(e||Sv(),"MM"),year:Cn(e||Sv(),"yyyy")}),r=D.useMemo(()=>Hne(`${t.month}-${t.year}`,"MM-yyyy",new Date),[t]),o=m=>{n({...t,month:Cn(m,"MM")})},i=m=>{n({...t,year:Cn(m,"yyyy")})};return{navigationDate:r,setMonth:o,setYear:i,previousMonth:()=>{const m=Eb(r,-1);n({month:Cn(m,"MM"),year:Cn(m,"yyyy")})},nextMonth:()=>{const m=Eb(r,1);n({month:Cn(m,"MM"),year:Cn(m,"yyyy")})},previousYear:()=>{const m=fp(r,-1);i(m)},nextYear:()=>{const m=fp(r,1);i(m)},previousDecade:()=>{const m=fp(r,-10);i(m)},nextDecade:()=>{const m=fp(r,10);i(m)}}}const fA=e=>{const{disabled:t,initialView:n="month",view:r,onChangeView:o,initialDate:i,goBackProps:s,goNextProps:a,changeViewProps:u}=e,c=Nre(e),{defaultStartDate:f}=c,{navigationDate:p,setMonth:m,setYear:b,...y}=jre(i||f),[v=n,E]=Kt({prop:r,onChange:x=>o?.(x,p),defaultProp:n});return w.jsx(cA.Provider,{value:c,children:w.jsxs("div",{"data-slot":"calendar",className:me("w-60 min-h-64 flex flex-col border rounded-md p-2",e.className),children:[w.jsx($re,{view:v,setView:E,value:p,goBackProps:s,goNextProps:a,changeViewProps:u,...y}),v==="month"&&w.jsx(Lre,{...e.monthViewProps,navigationDate:p,disabled:t}),v==="year"&&w.jsx(qre,{value:p,onChange:x=>{m(x),E("month")}}),v==="decade"&&w.jsx(kre,{value:p,onChange:x=>{b(x),E("year")}})]})})},Bre=({className:e,...t})=>w.jsx("div",{className:me("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t,"data-slot":"card"}),Vre=({className:e,...t})=>w.jsx("div",{className:me("flex flex-col space-y-1 p-6",e),...t,"data-slot":"card-header"}),Kre=({className:e,...t})=>w.jsx("h3",{className:me("text-2xl font-semibold leading-none tracking-tight",e),...t,"data-slot":"card-title"}),Hre=({className:e,...t})=>w.jsx("p",{className:me("text-sm text-muted-foreground",e),...t,"data-slot":"card-description"}),Wre=({className:e,...t})=>w.jsx("div",{className:me("p-6 pt-0",e),...t,"data-slot":"card-content"}),Ure=({className:e,...t})=>w.jsx("div",{className:me("flex items-center p-6 pt-0",e),...t,"data-slot":"card-footer"}),zre=({as:e="div",inline:t=!1,className:n,...r})=>w.jsx(e,{className:me(t?"inline-flex":"flex","items-center justify-center",n),...r,"data-slot":"center"});function fx({controlled:e,default:t,name:n,state:r="value"}){const{current:o}=h.useRef(e!==void 0),[i,s]=h.useState(t),a=o?e:i;if(process.env.NODE_ENV!=="production"){h.useEffect(()=>{o!==(e!==void 0)&&Wp([`A component is changing the ${o?"":"un"}controlled ${r} state of ${n} to be ${o?"un":""}controlled.`,"Elements should not switch from uncontrolled to controlled (or vice versa).",`Decide between using a controlled or uncontrolled ${n} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.","More info: https://fb.me/react-controlled-components"].join(`
|
|
134
134
|
`))},[r,n,e]);const{current:c}=h.useRef(t);h.useEffect(()=>{!o&&cT(c)!==cT(t)&&Wp([`A component is changing the default ${r} state of an uncontrolled ${n} after being initialized. To suppress this warning opt to use a controlled ${n}.`].join(`
|
|
135
|
-
`))},[t])}const u=h.useCallback(c=>{o||s(c)},[]);return[a,u]}function cT(e){let t=0;const n=new WeakMap;try{return JSON.stringify(e,function(i,s){if(!(i==="_owner"&&this!=null&&typeof this=="object"&&"$$typeof"in this)){if(typeof s=="bigint")return`__bigint__:${s}`;if(s!==null&&typeof s=="object"){const a=n.get(s);if(a!==void 0)return`__object__:${a}`;n.set(s,t),t+=1}return s}})??`__top__:${typeof e}`}catch{return"__unserializable__"}}let dT=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.indeterminate="data-indeterminate",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({}),fT=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const Gre={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Bc={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Yre={disabled:!1,...Bc},Ym={valid(e){return e===null?null:e?{[fT.valid]:""}:{[fT.invalid]:""}}};function pA(e){return h.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[dT.checked]:""}:{[dT.unchecked]:""}},...Ym}),[e.indeterminate])}const mA=h.createContext({invalid:void 0,name:void 0,validityData:{state:Gre,errors:[],error:"",value:"",initialValue:null},setValidityData:At,disabled:void 0,touched:Bc.touched,setTouched:At,dirty:Bc.dirty,setDirty:At,filled:Bc.filled,setFilled:At,focused:Bc.focused,setFocused:At,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:Yre,markedDirtyRef:{current:!1},registerFieldControl:At,validation:{getValidationProps:(e=yn)=>e,getInputValidationProps:(e=yn)=>e,inputRef:{current:null},commit:async()=>{}}});process.env.NODE_ENV!=="production"&&(mA.displayName="FieldRootContext");function _d(e=!0){const t=h.useContext(mA);if(t.setValidityData===At&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.":zt(28));return t}function px(e,t){const{enabled:n=!0,getValue:r,id:o,value:i}=t,{registerFieldControl:s}=_d(),a=h.useRef(null);a.current||(a.current=Symbol()),Le(()=>{const u=a.current;if(!(!u||!n))return s(u,{controlRef:e,getValue:r,id:o,value:i}),()=>{s(u,void 0)}},[e,n,r,o,s,i])}const hA=h.createContext({disabled:!1});process.env.NODE_ENV!=="production"&&(hA.displayName="FieldItemContext");function Xre(){return h.useContext(hA)}const gA=h.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:At,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});process.env.NODE_ENV!=="production"&&(gA.displayName="FormContext");function mx(){return h.useContext(gA)}const vA=h.createContext({controlId:void 0,registerControlId:At,labelId:void 0,setLabelId:At,messageIds:[],setMessageIds:At,getDescriptionProps:e=>e});process.env.NODE_ENV!=="production"&&(vA.displayName="LabelableContext");function Xm(){return h.useContext(vA)}function bA(e,t,n,r=!0,o){const[i,s]=h.useState(),a=$r(o?`${o}-label`:void 0),u=e??t??i;return Le(()=>{const c=e||t||!r?void 0:Zre(n.current,a);i!==c&&s(c)}),u}function Zre(e,t){const n=Qre(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function Qre(e){if(!e)return;const t=e.parentElement;if(t&&t.tagName==="LABEL")return t;const n=e.id;if(n){const o=e.nextElementSibling;if(o&&o.htmlFor===n)return o}const r=e.labels;return r&&r[0]}const hx=h.createContext(void 0);process.env.NODE_ENV!=="production"&&(hx.displayName="CheckboxGroupContext");function Jre(e=!0){const t=h.useContext(hx);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: CheckboxGroupContext is missing. CheckboxGroup parts must be placed within <CheckboxGroup>.":zt(3));return t}const gx=h.createContext(void 0);process.env.NODE_ENV!=="production"&&(gx.displayName="CheckboxRootContext");function eoe(){const e=h.useContext(gx);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: CheckboxRootContext is missing. Checkbox parts must be placed within <Checkbox.Root>.":zt(14));return e}const yA="data-parent",vx=h.forwardRef(function(t,n){const{checked:r,className:o,defaultChecked:i=!1,"aria-labelledby":s,disabled:a=!1,form:u,id:c,indeterminate:f=!1,inputRef:p,name:m,onCheckedChange:b,parent:y=!1,readOnly:v=!1,render:E,required:x=!1,uncheckedValue:R,value:P,nativeButton:O=!1,style:S,...T}=t,{clearErrors:_}=mx(),{disabled:$,name:V,setDirty:U,setFilled:A,setFocused:H,setTouched:F,state:N,validationMode:j,validityData:I,shouldValidateOnChange:k,validation:q}=_d(),z=Xre(),{labelId:W,controlId:te,registerControlId:X,getDescriptionProps:Q}=Xm(),re=Jre(),ce=re?.parent,se=ce&&re.allValues,ee=$||z.disabled||re?.disabled||a,de=V??m,K=P??de,ue=$r(),le=$r();let Z=te;se?Z=y?le:`${ce.id}-${K}`:c&&(Z=c);let xe={};se&&(y?xe=re.parent.getParentProps():K&&(xe=re.parent.getChildProps(K)));const Re=He(b),{checked:Ae=r,indeterminate:Se=f,onCheckedChange:Oe,...Ye}=xe,Fe=re?.value,G=re?.setValue,J=re?.defaultValue,ie=h.useRef(null),fe=Hn(()=>Symbol("checkbox-control")),pe=h.useRef(!1),{getButtonProps:ge,buttonRef:Ee}=ga({disabled:ee,native:O}),Pe=re?.validation??q,[Ne,st]=fx({controlled:K&&Fe&&!y?Fe.includes(K):Ae,default:K&&J&&!y?J.includes(K):i,name:"Checkbox",state:"checked"});Le(()=>{X!==At&&(pe.current=!0,X(fe.current,Z))},[Z,re,X,y,fe]),h.useEffect(()=>{const tt=fe.current;return()=>{!pe.current||X===At||(pe.current=!1,X(tt,void 0))}},[X,fe]),px(ie,{enabled:!re,id:ue,value:Ne});const ut=h.useRef(null),wt=la(p,ut,Pe.inputRef),dt=bA(s,W,ut,!O,Z??void 0);Le(()=>{ut.current&&(ut.current.indeterminate=Se,Ne&&A(!0))},[Ne,Se,A]),Nm(Ne,()=>{re&&!y||(_(de),A(Ne),U(Ne!==I.initialValue),k()?Pe.commit(Ne):Pe.commit(Ne,!0))});const Nt=pa({checked:Ne,disabled:ee,form:u,name:y?void 0:de,id:O?void 0:Z??void 0,required:x,ref:wt,style:de?W_:pd,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(tt){if(tt.nativeEvent.defaultPrevented)return;if(v){tt.preventDefault();return}const Jt=tt.currentTarget.checked,Ft=pt(Sm,tt.nativeEvent);if(Oe?.(Jt,Ft),Re(Jt,Ft),!Ft.isCanceled&&(st(Jt),K&&Fe&&G&&!y&&!se)){const Dn=Jt?[...Fe,K]:Fe.filter(Rn=>Rn!==K);G(Dn,Ft)}},onFocus(){ie.current?.focus()}},P!==void 0?{value:(re?Ne&&P:P)||""}:yn,Q,re?Pe.getValidationProps:Pe.getInputValidationProps),Yt=se?!!Ae:Ne,un=se&&Se||f;h.useEffect(()=>{if(!ce||!K)return;const tt=ce.disabledStatesRef.current;return tt.set(K,ee),()=>{tt.delete(K)}},[ce,ee,K]);const mn=h.useMemo(()=>({...N,checked:Yt,disabled:ee,readOnly:v,required:x,indeterminate:un}),[N,Yt,ee,v,x,un]),$n=pA(mn),nt=lt("span",t,{state:mn,ref:[Ee,ie,n,re?.registerControlRef],props:[{id:O?Z??void 0:ue,role:"checkbox","aria-checked":Se?"mixed":Ne,"aria-readonly":v||void 0,"aria-required":x||void 0,"aria-labelledby":dt,[yA]:y?"":void 0,onFocus(){H(!0)},onBlur(){const tt=ut.current;tt&&(F(!0),H(!1),j==="onBlur"&&Pe.commit(re?Fe:tt.checked))},onClick(tt){v||ee||(tt.preventDefault(),ut.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:tt.shiftKey,ctrlKey:tt.ctrlKey,altKey:tt.altKey,metaKey:tt.metaKey})))}},Q,Pe.getValidationProps,T,Ye,ge],stateAttributesMapping:$n});return w.jsxs(gx.Provider,{value:mn,children:[nt,!Ne&&!re&&de&&!y&&R!==void 0&&w.jsx("input",{type:"hidden",form:u,name:de,value:R}),w.jsx("input",{...Nt,suppressHydrationWarning:!0})]})});process.env.NODE_ENV!=="production"&&(vx.displayName="CheckboxRoot");const bx=h.forwardRef(function(t,n){const{render:r,className:o,style:i,keepMounted:s=!1,...a}=t,u=eoe(),c=u.checked||u.indeterminate,{mounted:f,transitionStatus:p,setMounted:m}=yy(c),b=h.useRef(null),y={...u,transitionStatus:p};ma({open:c,ref:b,onComplete(){c||m(!1)}});const v=pA(u),E=h.useMemo(()=>({...v,...xs,...Ym}),[v]),x=s||f,R=lt("span",t,{ref:[n,b],state:y,stateAttributesMapping:E,props:a});return x?R:null});process.env.NODE_ENV!=="production"&&(bx.displayName="CheckboxIndicator");const toe=Object.freeze(Object.defineProperty({__proto__:null,Indicator:bx,Root:vx},Symbol.toStringTag,{value:"Module"}));function noe(e){return lt(e.defaultTagName??"div",e,e)}const yx=h.createContext(void 0);process.env.NODE_ENV!=="production"&&(yx.displayName="TooltipRootContext");function Ea(e){const t=h.useContext(yx);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: TooltipRootContext is missing. Tooltip parts must be placed within <Tooltip.Root>.":zt(72));return t}const roe={...VO,disabled:je(e=>e.disabled),instantType:je(e=>e.instantType),isInstantPhase:je(e=>e.isInstantPhase),trackCursorAxis:je(e=>e.trackCursorAxis),disableHoverablePopup:je(e=>e.disableHoverablePopup),lastOpenChangeReason:je(e=>e.openChangeReason),closeOnClick:je(e=>e.closeOnClick),closeDelay:je(e=>e.closeDelay),hasViewport:je(e=>e.hasViewport)};class Zm extends Mm{constructor(t){super({...ooe(),...t},{popupRef:h.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new Am},roe)}setOpen=(t,n)=>{const r=n.reason,o=r===Cr,i=t&&r===wp,s=!t&&(r===Jc||r===iy);if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(t,n),n.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(t,n);const a=()=>{const u={open:t,openChangeReason:r};i?u.instantType="focus":s?u.instantType="dismiss":r===Cr&&(u.instantType=void 0);const c=n.trigger?.id??null;(c||t)&&(u.activeTriggerId=c,u.activeTriggerElement=n.trigger??null),this.update(u)};o?er.flushSync(a):a()};static useStore(t,n){const r=Hn(()=>new Zm(n)).current,o=t??r,i=HO({popupStore:o,onOpenChange:o.setOpen});return o.state.floatingRootContext=i,o}}function ooe(){return{...BO(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,hasViewport:!1}}const xx=kO(function(t){const{disabled:n=!1,defaultOpen:r=!1,open:o,disableHoverablePopup:i=!1,trackCursorAxis:s="none",actionsRef:a,onOpenChange:u,onOpenChangeComplete:c,handle:f,triggerId:p,defaultTriggerId:m=null,children:b}=t,y=Zm.useStore(f?.store,{open:r,openProp:o,activeTriggerId:m,triggerIdProp:p});sV(()=>{o===void 0&&y.state.open===!1&&r===!0&&y.update({open:!0,activeTriggerId:m})}),y.useControlledProp("openProp",o),y.useControlledProp("triggerIdProp",p),y.useContextCallback("onOpenChange",u),y.useContextCallback("onOpenChangeComplete",c);const v=y.useState("open"),E=!n&&v,x=y.useState("activeTriggerId"),R=y.useState("payload");y.useSyncedValues({trackCursorAxis:s,disableHoverablePopup:i}),Le(()=>{v&&n&&y.setOpen(!1,pt(jV))},[v,n,y]),y.useSyncedValue("disabled",n),qO(y);const{forceUnmount:P,transitionStatus:O}=jO(E,y),S=y.select("floatingRootContext"),T=y.useState("isInstantPhase"),_=y.useState("instantType"),$=y.useState("lastOpenChangeReason"),V=h.useRef(null);Le(()=>{O==="ending"&&$===Sm||O!=="ending"&&T?(_!=="delay"&&(V.current=_),y.set("instantType","delay")):V.current!==null&&(y.set("instantType",V.current),V.current=null)},[O,T,$,_,y]),Le(()=>{E&&x==null&&y.set("payload",void 0)},[y,x,E]);const U=h.useCallback(()=>{y.setOpen(!1,ioe(y,os))},[y]);h.useImperativeHandle(a,()=>({unmount:P,close:U}),[P,U]);const A=vO(S,{enabled:!n,referencePress:()=>y.select("closeOnClick")}),H=q7(S,{enabled:!n&&s!=="none",axis:s==="none"?void 0:s}),{getReferenceProps:F,getFloatingProps:N,getTriggerProps:j}=Ey([A,H]),I=h.useMemo(()=>F(),[F]),k=h.useMemo(()=>j(),[j]),q=h.useMemo(()=>N(),[N]);return y.useSyncedValues({activeTriggerProps:I,inactiveTriggerProps:k,popupProps:q}),w.jsx(yx.Provider,{value:y,children:typeof b=="function"?b({payload:R}):b})});process.env.NODE_ENV!=="production"&&(xx.displayName="TooltipRoot");function ioe(e,t){const n=pt(t);return n.preventUnmountOnClose=()=>{e.set("preventUnmountingOnClose",!0)},n}const wx=h.createContext(void 0);process.env.NODE_ENV!=="production"&&(wx.displayName="TooltipProviderContext");function soe(){return h.useContext(wx)}let aoe=(function(e){return e[e.popupOpen=YO.popupOpen]="popupOpen",e.triggerDisabled="data-trigger-disabled",e})({});const loe=600,Ex=e8(function(t,n){const{className:r,render:o,handle:i,payload:s,disabled:a,delay:u,closeOnClick:c=!0,closeDelay:f,id:p,style:m,...b}=t,y=Ea(!0),v=i?.store??y;if(!v)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Tooltip.Trigger> must be either used within a <Tooltip.Root> component or provided with a handle.":zt(82));const E=$r(p),x=v.useState("isTriggerActive",E),R=v.useState("isOpenedByTrigger",E),P=v.useState("floatingRootContext"),O=h.useRef(null),S=u??loe,T=f??0,{registerTrigger:_,isMountedByThisTrigger:$}=LO(E,O,v,{payload:s,closeOnClick:c,closeDelay:T}),V=soe(),{delayRef:U,isInstantPhase:A,hasProvider:H}=VV(P,{open:R});v.useSyncedValue("isInstantPhase",A);const F=v.useState("disabled"),N=a??F,j=v.useState("trackCursorAxis"),I=v.useState("disableHoverablePopup"),k=v8(P,{enabled:!N,mouseOnly:!0,move:!1,handleClose:!I&&j!=="both"?E8():null,restMs(){const X=V?.delay,Q=typeof U.current=="object"?U.current.open:void 0;let re=S;return H&&(Q!==0?re=u??X??S:re=0),re},delay(){const X=typeof U.current=="object"?U.current.close:void 0;let Q=T;return f==null&&H&&(Q=X),{close:Q}},triggerElementRef:O,isActiveTrigger:x,isClosing:()=>v.select("transitionStatus")==="ending"}),q=m8(P,{enabled:!N}).reference,z={open:R},W=v.useState("triggerProps",$);return lt("button",t,{state:z,ref:[n,_,O],props:[k,q,W,{onPointerDown(){v.set("closeOnClick",c)},id:E,[aoe.triggerDisabled]:N?"":void 0},b],stateAttributesMapping:XO})});process.env.NODE_ENV!=="production"&&(Ex.displayName="TooltipTrigger");const Cx=h.createContext(void 0);process.env.NODE_ENV!=="production"&&(Cx.displayName="TooltipPortalContext");function uoe(){const e=h.useContext(Cx);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Tooltip.Portal> is missing.":zt(70));return e}const Rx=h.forwardRef(function(t,n){const{children:r,container:o,className:i,render:s,style:a,...u}=t,{portalNode:c,portalSubtree:f}=pO({container:o,ref:n,componentProps:t,elementProps:u});return!f&&!c?null:w.jsxs(h.Fragment,{children:[f,c&&er.createPortal(r,c)]})});process.env.NODE_ENV!=="production"&&(Rx.displayName="FloatingPortalLite");const Sx=h.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t;return Ea().useState("mounted")||r?w.jsx(Cx.Provider,{value:r,children:w.jsx(Rx,{ref:n,...o})}):null});process.env.NODE_ENV!=="production"&&(Sx.displayName="TooltipPortal");const Px=h.createContext(void 0);process.env.NODE_ENV!=="production"&&(Px.displayName="TooltipPositionerContext");function Tx(){const e=h.useContext(Px);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: TooltipPositionerContext is missing. TooltipPositioner parts must be placed within <Tooltip.Positioner>.":zt(71));return e}const xA=h.createContext(void 0);process.env.NODE_ENV!=="production"&&(xA.displayName="DirectionContext");function wA(){return h.useContext(xA)?.direction??"ltr"}const coe=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:u}=t,{element:c,padding:f=0,offsetParent:p="real"}=mo(e,t)||{};if(c==null)return{};const m=ly(f),b={x:n,y:r},y=_m(o),v=Tm(y),E=await s.getDimensions(c),x=y==="y",R=x?"top":"left",P=x?"bottom":"right",O=x?"clientHeight":"clientWidth",S=i.reference[v]+i.reference[y]-b[y]-i.floating[v],T=b[y]-i.reference[y],_=p==="real"?await s.getOffsetParent?.(c):a.floating;let $=a.floating[O]||i.floating[v];(!$||!await s.isElement?.(_))&&($=a.floating[O]||i.floating[v]);const V=S/2-T/2,U=$/2-E[v]/2-1,A=Math.min(m[R],U),H=Math.min(m[P],U),F=A,N=$-E[v]-H,j=$/2-E[v]/2+V,I=kp(F,j,N),k=!u.arrow&&Uo(o)!=null&&j!==I&&i.reference[v]/2-(j<F?A:H)-E[v]/2<0,q=k?j<F?j-F:j-N:0;return{[y]:b[y]+q,data:{[y]:I,centerOffset:j-I-q,...k&&{alignmentOffset:q}},reset:k}}}),doe=(e,t)=>({...coe(e),options:[e,t]}),foe={name:"hide",async fn(e){const{width:t,height:n,x:r,y:o}=e.rects.reference,i=t===0&&n===0&&r===0&&o===0;return{data:{referenceHidden:(await MO().fn(e)).data?.referenceHidden||i}}}},_p={sideX:"left",sideY:"top"},poe={name:"adaptiveOrigin",async fn(e){const{x:t,y:n,rects:{floating:r},elements:{floating:o},platform:i,strategy:s,placement:a}=e,u=Vt(o),c=u.getComputedStyle(o);if(!(c.transitionDuration!=="0s"&&c.transitionDuration!==""))return{x:t,y:n,data:_p};const p=await i.getOffsetParent?.(o);let m={width:0,height:0};if(s==="fixed"&&u?.visualViewport)m={width:u.visualViewport.width,height:u.visualViewport.height};else if(p===u){const R=ct(o);m={width:R.documentElement.clientWidth,height:R.documentElement.clientHeight}}else await i.isElement?.(p)&&(m=await i.getDimensions(p));const b=Qn(a);let y=t,v=n;b==="left"&&(y=m.width-(t+r.width)),b==="top"&&(v=m.height-(n+r.height));const E=b==="left"?"right":_p.sideX,x=b==="top"?"bottom":_p.sideY;return{x:y,y:v,data:{sideX:E,sideY:x}}}};function EA(e,t,n){const r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[t]}function pT(e,t,n){const{rects:r,placement:o}=e;return{side:EA(t,Qn(o),n),align:Uo(o)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function CA(e){const{anchor:t,positionMethod:n="absolute",side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,collisionBoundary:a,collisionPadding:u=5,sticky:c=!1,arrowPadding:f=5,disableAnchorTracking:p=!1,keepMounted:m=!1,floatingRootContext:b,mounted:y,collisionAvoidance:v,shiftCrossAxis:E=!1,nodeId:x,adaptiveOrigin:R,lazyFlip:P=!1,externalTree:O}=e,[S,T]=h.useState(null);!y&&S!==null&&T(null);const _=v.side||"flip",$=v.align||"flip",V=v.fallbackAxisSide||"end",U=typeof t=="function"?t:void 0,A=He(U),H=U?A:t,F=cr(t),N=cr(y),I=wA()==="rtl",k=S||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":I?"left":"right","inline-start":I?"right":"left"}[r],q=i==="center"?k:`${k}-${i}`;let z=u;const W=1,te=r==="bottom"?W:0,X=r==="top"?W:0,Q=r==="right"?W:0,re=r==="left"?W:0;typeof z=="number"?z={top:z+te,right:z+re,bottom:z+X,left:z+Q}:z&&(z={top:(z.top||0)+te,right:(z.right||0)+re,bottom:(z.bottom||0)+X,left:(z.left||0)+Q});const ce={boundary:a==="clipping-ancestors"?"clippingAncestors":a,padding:z},se=h.useRef(null),ee=cr(o),de=cr(s),le=[TO(nt=>{const tt=pT(nt,r,I),Jt=typeof ee.current=="function"?ee.current(tt):ee.current,Ft=typeof de.current=="function"?de.current(tt):de.current;return{mainAxis:Jt,crossAxis:Ft,alignmentAxis:Ft}},[typeof o!="function"?o:0,typeof s!="function"?s:0,I,r])],Z=$==="none"&&_!=="shift",xe=!Z&&(c||E||_==="shift"),Re=_==="none"?null:$O({...ce,padding:{top:z.top+W,right:z.right+W,bottom:z.bottom+W,left:z.left+W},mainAxis:!E&&_==="flip",crossAxis:$==="flip"?"alignment":!1,fallbackAxisSideDirection:V}),Ae=Z?null:_O(nt=>{const tt=ct(nt.elements.floating).documentElement;return{...ce,rootBoundary:E?{x:0,y:0,width:tt.clientWidth,height:tt.clientHeight}:void 0,mainAxis:$!=="none",crossAxis:xe,limiter:c||E?void 0:OO(Jt=>{if(!se.current)return{};const{width:Ft,height:Dn}=se.current.getBoundingClientRect(),Rn=Pr(Qn(Jt.placement)),Ar=Rn==="y"?Ft:Dn,Zr=Rn==="y"?z.left+z.right:z.top+z.bottom;return{offset:Ar/2+Zr/2}})}},[ce,c,E,z,$]);_==="shift"||$==="shift"||i==="center"?le.push(Ae,Re):le.push(Re,Ae),le.push(DO({...ce,apply({elements:{floating:nt},availableWidth:tt,availableHeight:Jt,rects:Ft}){if(!N.current)return;const Dn=nt.style;Dn.setProperty("--available-width",`${tt}px`),Dn.setProperty("--available-height",`${Jt}px`);const Rn=Vt(nt).devicePixelRatio||1,{x:Ar,y:Zr,width:Zo,height:Ce}=Ft.reference,Ni=(Math.round((Ar+Zo)*Rn)-Math.round(Ar*Rn))/Rn,Ii=(Math.round((Zr+Ce)*Rn)-Math.round(Zr*Rn))/Rn;Dn.setProperty("--anchor-width",`${Ni}px`),Dn.setProperty("--anchor-height",`${Ii}px`)}}),doe(()=>({element:se.current||ct(se.current).createElement("div"),padding:f,offsetParent:"floating"}),[f]),{name:"transformOrigin",fn(nt){const{elements:tt,middlewareData:Jt,placement:Ft,rects:Dn,y:Rn}=nt,Ar=Qn(Ft),Zr=Pr(Ar),Zo=se.current,Ce=Jt.arrow?.x||0,Ni=Jt.arrow?.y||0,Ii=Zo?.clientWidth||0,Qo=Zo?.clientHeight||0,ki=Ce+Ii/2,Ud=Ni+Qo/2,_a=Math.abs(Jt.shift?.y||0),wh=Dn.reference.height/2,Fi=typeof o=="function"?o(pT(nt,r,I)):o,Eh=_a>Fi,Ch={top:`${ki}px calc(100% + ${Fi}px)`,bottom:`${ki}px ${-Fi}px`,left:`calc(100% + ${Fi}px) ${Ud}px`,right:`${-Fi}px ${Ud}px`}[Ar],Rh=`${ki}px ${Dn.reference.y+wh-Rn}px`;return tt.floating.style.setProperty("--transform-origin",xe&&Zr==="y"&&Eh?Rh:Ch),{}}},foe,R),Le(()=>{!y&&b&&b.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[y,b]);const Se=h.useMemo(()=>({elementResize:!p&&typeof ResizeObserver<"u",layoutShift:!p&&typeof IntersectionObserver<"u"}),[p]),{refs:Oe,elements:Ye,x:Fe,y:G,middlewareData:J,update:ie,placement:fe,context:pe,isPositioned:ge,floatingStyles:Ee}=p8({rootContext:b,open:m?y:void 0,placement:q,middleware:le,strategy:n,whileElementsMounted:m?void 0:(...nt)=>Gv(...nt,Se),nodeId:x,externalTree:O}),{sideX:Pe,sideY:Ne}=J.adaptiveOrigin||_p,st=ge?n:"fixed",ut=h.useMemo(()=>{const nt=R?{position:st,[Pe]:Fe,[Ne]:G}:{position:st,...Ee};return ge||(nt.opacity=0),nt},[R,st,Pe,Fe,Ne,G,Ee,ge]),wt=h.useRef(null);Le(()=>{if(!y)return;const nt=F.current,tt=typeof nt=="function"?nt():nt,Ft=(mT(tt)?tt.current:tt)||null||null;Ft!==wt.current&&(Oe.setPositionReference(Ft),wt.current=Ft)},[y,Oe,H,F]),h.useEffect(()=>{if(!y)return;const nt=F.current;typeof nt!="function"&&mT(nt)&&nt.current!==wt.current&&(Oe.setPositionReference(nt.current),wt.current=nt.current)},[y,Oe,H,F]),h.useEffect(()=>{if(m&&y&&Ye.domReference&&Ye.floating)return Gv(Ye.domReference,Ye.floating,ie,Se)},[m,y,Ye,ie,Se]);const dt=Qn(fe),Nt=EA(r,dt,I),Yt=Uo(fe)||"center",un=!!J.hide?.referenceHidden;Le(()=>{P&&y&&ge&&T(dt)},[P,y,ge,dt]);const mn=h.useMemo(()=>({position:"absolute",top:J.arrow?.y,left:J.arrow?.x}),[J.arrow]),$n=J.arrow?.centerOffset!==0;return h.useMemo(()=>({positionerStyles:ut,arrowStyles:mn,arrowRef:se,arrowUncentered:$n,side:Nt,align:Yt,physicalSide:dt,anchorHidden:un,refs:Oe,context:pe,isPositioned:ge,update:ie}),[ut,mn,se,$n,Nt,Yt,dt,un,Oe,pe,ge,ie])}function mT(e){return e!=null&&"current"in e}function RA(e){return e==="starting"?AV:yn}function SA(e,t,{styles:n,transitionStatus:r,props:o,refs:i,hidden:s,inert:a=!1}){const u={...n};return a&&(u.pointerEvents="none"),lt("div",e,{state:t,ref:i,props:[{role:"presentation",hidden:s,style:u},RA(r),o],stateAttributesMapping:ha})}const _x=h.forwardRef(function(t,n){const{render:r,className:o,anchor:i,positionMethod:s="absolute",side:a="top",align:u="center",sideOffset:c=0,alignOffset:f=0,collisionBoundary:p="clipping-ancestors",collisionPadding:m=5,arrowPadding:b=5,sticky:y=!1,disableAnchorTracking:v=!1,collisionAvoidance:E=q_,style:x,...R}=t,P=Ea(),O=uoe(),S=P.useState("open"),T=P.useState("mounted"),_=P.useState("trackCursorAxis"),$=P.useState("disableHoverablePopup"),V=P.useState("floatingRootContext"),U=P.useState("instantType"),A=P.useState("transitionStatus"),H=P.useState("hasViewport"),F=CA({anchor:i,positionMethod:s,floatingRootContext:V,mounted:T,side:a,sideOffset:c,align:u,alignOffset:f,collisionBoundary:p,collisionPadding:m,sticky:y,arrowPadding:b,disableAnchorTracking:v,keepMounted:O,collisionAvoidance:E,adaptiveOrigin:H?poe:void 0}),N=h.useMemo(()=>({open:S,side:F.side,align:F.align,anchorHidden:F.anchorHidden,instant:_!=="none"?"tracking-cursor":U}),[S,F.side,F.align,F.anchorHidden,_,U]),j=SA(t,N,{styles:F.positionerStyles,transitionStatus:A,props:R,refs:[n,P.useStateSetter("positionerElement")],hidden:!T,inert:!S||_==="both"||$});return w.jsx(Px.Provider,{value:F,children:j})});process.env.NODE_ENV!=="production"&&(_x.displayName="TooltipPositioner");const moe={...ha,...xs},Ox=h.forwardRef(function(t,n){const{className:r,render:o,style:i,...s}=t,a=Ea(),{side:u,align:c}=Tx(),f=a.useState("open"),p=a.useState("instantType"),m=a.useState("transitionStatus"),b=a.useState("popupProps"),y=a.useState("floatingRootContext");ma({open:f,ref:a.context.popupRef,onComplete(){f&&a.context.onOpenChangeComplete?.(!0)}});const v=a.useState("disabled"),E=a.useState("closeDelay");return h8(y,{enabled:!v,closeDelay:E}),lt("div",t,{state:{open:f,side:u,align:c,instant:p,transitionStatus:m},ref:[n,a.context.popupRef,a.useStateSetter("popupElement")],props:[b,RA(m),s],stateAttributesMapping:moe})});process.env.NODE_ENV!=="production"&&(Ox.displayName="TooltipPopup");const $x=h.forwardRef(function(t,n){const{className:r,render:o,style:i,...s}=t,a=Ea(),u=a.useState("open"),c=a.useState("instantType"),{arrowRef:f,side:p,align:m,arrowUncentered:b,arrowStyles:y}=Tx();return lt("div",t,{state:{open:u,side:p,align:m,uncentered:b,instant:c},ref:[n,f],props:[{style:y,"aria-hidden":!0},s],stateAttributesMapping:ha})});process.env.NODE_ENV!=="production"&&($x.displayName="TooltipArrow");const Dx=function(t){const{delay:n,closeDelay:r,timeout:o=400}=t,i=h.useMemo(()=>({delay:n,closeDelay:r}),[n,r]),s=h.useMemo(()=>({open:n,close:r}),[n,r]);return w.jsx(wx.Provider,{value:i,children:w.jsx(BV,{delay:s,timeoutMs:o,children:t.children})})};process.env.NODE_ENV!=="production"&&(Dx.displayName="TooltipProvider");let hoe=(function(e){return e.popupWidth="--popup-width",e.popupHeight="--popup-height",e})({});function goe(e){const[t,n]=h.useState({current:e,previous:null});return e!==t.current&&n({current:e,previous:t.current}),t.previous}function hT(e){const t=Jn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Bt(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r;return(ua(n)!==i||ua(r)!==s)&&(n=i,r=s),{width:n,height:r}}const voe=()=>!0;function boe(e){const{popupElement:t,positionerElement:n,content:r,mounted:o,enabled:i=voe,onMeasureLayout:s,onMeasureLayoutComplete:a,side:u,direction:c}=e,f=xy(t,!0,!1),p=fd(),m=h.useRef(null),b=h.useRef(null),y=h.useRef(!0),v=h.useRef(At),E=He(s),x=He(a),R=h.useMemo(()=>{let P=u==="top",O=u==="left";return c==="rtl"?(P=P||u==="inline-end",O=O||u==="inline-end"):(P=P||u==="inline-start",O=O||u==="inline-start"),P?{position:"absolute",[u==="top"?"bottom":"top"]:"0",[O?"right":"left"]:"0"}:yn},[u,c]);Le(()=>{if(!o||!i()||typeof ResizeObserver!="function"){v.current=At,y.current=!0,m.current=null,b.current=null;return}if(!t||!n)return;v.current=gT(t,R);const P=new ResizeObserver(F=>{const N=F[0];N&&(b.current={width:Math.ceil(N.borderBoxSize[0].inlineSize),height:Math.ceil(N.borderBoxSize[0].blockSize)})});P.observe(t),pp(t,"auto");const O=Op(t,"position","static"),S=Op(t,"transform","none"),T=Op(t,"scale","1"),_=gT(n,{"--available-width":"max-content","--available-height":"max-content"});function $(){O(),S(),_()}function V(){$(),T()}if(E?.(),y.current||m.current===null){Ac(n,"max-content");const F=hT(t);return m.current=F,Ac(n,F),V(),x?.(null,F),y.current=!1,()=>{P.disconnect(),v.current(),v.current=At}}pp(t,"auto"),Ac(n,"max-content");const U=m.current??b.current,A=hT(t);if(m.current=A,!U)return Ac(n,A),V(),x?.(null,A),()=>{P.disconnect(),p.cancel(),v.current(),v.current=At};pp(t,U),V(),x?.(U,A),Ac(n,A);const H=new AbortController;return p.request(()=>{pp(t,A),f(()=>{t.style.setProperty("--popup-width","auto"),t.style.setProperty("--popup-height","auto")},H.signal)}),()=>{P.disconnect(),H.abort(),p.cancel(),v.current(),v.current=At}},[r,t,n,f,p,i,o,E,x,R])}function Op(e,t,n){const r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,r)}}function gT(e,t){const n=[];for(const[r,o]of Object.entries(t))n.push(Op(e,r,o));return n.length?()=>{n.forEach(r=>r())}:At}function pp(e,t){const n=t==="auto"?"auto":`${t.width}px`,r=t==="auto"?"auto":`${t.height}px`;e.style.setProperty("--popup-width",n),e.style.setProperty("--popup-height",r)}function Ac(e,t){const n=t==="max-content"?"max-content":`${t.width}px`,r=t==="max-content"?"max-content":`${t.height}px`;e.style.setProperty("--positioner-width",n),e.style.setProperty("--positioner-height",r)}function yoe(e){const{store:t,side:n,cssVars:r,children:o}=e,i=wA(),s=t.useState("activeTriggerElement"),a=t.useState("activeTriggerId"),u=t.useState("open"),c=t.useState("payload"),f=t.useState("mounted"),p=t.useState("popupElement"),m=t.useState("positionerElement"),b=goe(u?s:null),y=Eoe(a,c),v=h.useRef(null),[E,x]=h.useState(null),[R,P]=h.useState(null),O=h.useRef(null),S=h.useRef(null),T=xy(O,!0,!1),_=fd(),[$,V]=h.useState(null),[U,A]=h.useState(!1);Le(()=>(t.set("hasViewport",!0),()=>{t.set("hasViewport",!1)}),[t]);const H=He(()=>{O.current?.style.setProperty("animation","none"),O.current?.style.setProperty("transition","none"),S.current?.style.setProperty("display","none")}),F=He(q=>{O.current?.style.removeProperty("animation"),O.current?.style.removeProperty("transition"),S.current?.style.removeProperty("display"),q&&V(q)}),N=h.useRef(null);Le(()=>{if(s&&b&&s!==b&&N.current!==s&&v.current){x(v.current),A(!0);const q=woe(b,s);P(q),_.request(()=>{er.flushSync(()=>{A(!1)}),T(()=>{x(null),V(null),v.current=null})}),N.current=s}},[s,b,E,T,_]),Le(()=>{const q=O.current;if(!q)return;const z=ct(q).createElement("div");for(const W of Array.from(q.childNodes))z.appendChild(W.cloneNode(!0));v.current=z});const j=E!=null;let I;j?I=w.jsxs(h.Fragment,{children:[w.jsx("div",{"data-previous":!0,inert:Oy(!0),ref:S,style:{...$?{[r.popupWidth]:`${$.width}px`,[r.popupHeight]:`${$.height}px`}:null,position:"absolute"},"data-ending-style":U?void 0:""},"previous"),w.jsx("div",{"data-current":!0,ref:O,"data-starting-style":U?"":void 0,children:o},y)]}):I=w.jsx("div",{"data-current":!0,ref:O,children:o},y),Le(()=>{const q=S.current;!q||!E||q.replaceChildren(...Array.from(E.childNodes))},[E]),boe({popupElement:p,positionerElement:m,mounted:f,content:c,onMeasureLayout:H,onMeasureLayoutComplete:F,side:n,direction:i});const k={activationDirection:xoe(R),transitioning:j};return{children:I,state:k}}function xoe(e){if(e)return`${vT(e.horizontal,5,"right","left")} ${vT(e.vertical,5,"down","up")}`}function vT(e,t,n,r){return e>t?n:e<-t?r:""}function woe(e,t){const n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),o={x:n.left+n.width/2,y:n.top+n.height/2},i={x:r.left+r.width/2,y:r.top+r.height/2};return{horizontal:i.x-o.x,vertical:i.y-o.y}}function Eoe(e,t){const[n,r]=h.useState(0),o=h.useRef(e),i=h.useRef(t),s=h.useRef(!1);return Le(()=>{const a=o.current,u=i.current,c=e!==a,f=t!==u;c?(r(p=>p+1),s.current=!f):s.current&&f&&(r(p=>p+1),s.current=!1),o.current=e,i.current=t},[e,t]),`${e??"current"}-${n}`}const Coe={activationDirection:e=>e?{"data-activation-direction":e}:null},PA=h.forwardRef(function(t,n){const{render:r,className:o,style:i,children:s,...a}=t,u=Ea(),c=Tx(),f=u.useState("instantType"),{children:p,state:m}=yoe({store:u,side:c.side,cssVars:hoe,children:s}),b={activationDirection:m.activationDirection,transitioning:m.transitioning,instant:f};return lt("div",t,{state:b,ref:n,props:[a,{children:p}],stateAttributesMapping:Coe})});process.env.NODE_ENV!=="production"&&(PA.displayName="TooltipViewport");class TA{constructor(){this.store=new Zm}open(t){const n=t?this.store.context.triggerElements.getById(t):void 0;if(t&&!n)throw new Error(process.env.NODE_ENV!=="production"?`Base UI: TooltipHandle.open: No trigger found with id "${t}".`:zt(81,t));this.store.setOpen(!0,pt(os,void 0,n))}close(){this.store.setOpen(!1,pt(os,void 0,void 0))}get isOpen(){return this.store.state.open}}function Roe(){return new TA}const Soe=Object.freeze(Object.defineProperty({__proto__:null,Arrow:$x,Handle:TA,Popup:Ox,Portal:Sx,Positioner:_x,Provider:Dx,Root:xx,Trigger:Ex,Viewport:PA,createHandle:Roe},Symbol.toStringTag,{value:"Module"}));function Poe(e){return w.jsx("svg",{width:"20",height:"10",viewBox:"0 0 20 10",fill:"none",...e,children:w.jsx("path",{d:"M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V10H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z",fill:"currentColor"})})}function _A(e){return w.jsx(Dx,{...e})}function OA(e){return w.jsx(xx,{...e})}function $A({className:e,...t}){return w.jsx(Ex,{"data-slot":"tooltip-trigger",className:me(e),...t})}function DA({className:e,...t}){return w.jsx(Ox,{"data-slot":"tooltip-popup",className:me("z-50 flex origin-[var(--transform-origin)] flex-col rounded-md bg-popover px-2.5 py-1.5 text-xs text-popover-foreground drop-shadow-md","transition-[scale,opacity] duration-150 ease-out","data-starting-style:scale-98 data-starting-style:opacity-0","data-ending-style:scale-98 data-ending-style:opacity-0","data-instant:duration-0",e),...t})}function MA({className:e,...t}){return w.jsx($x,{"data-slot":"tooltip-arrow",className:me("flex text-popover","data-[side=bottom]:top-[-8px]","data-[side=left]:right-[-13px] data-[side=left]:rotate-90","data-[side=right]:left-[-13px] data-[side=right]:-rotate-90","data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180",e),...t,children:w.jsx(Poe,{})})}function AA({content:e,children:t,open:n,defaultOpen:r,onOpenChange:o,side:i="top",align:s,offset:a=10,delay:u,closeDelay:c,className:f,arrowClassName:p,...m}){return w.jsxs(OA,{open:n,defaultOpen:r,onOpenChange:o,children:[w.jsx($A,{delay:u,closeDelay:c,render:t,...m}),w.jsx(Sx,{children:w.jsx(_x,{side:i,align:s,sideOffset:a,children:w.jsxs(DA,{className:f,children:[w.jsx(MA,{className:p}),e]})})})]})}function Od({className:e,render:t,required:n,tooltip:r,children:o,...i}){const s=n||r?w.jsxs(w.Fragment,{children:[o,n&&w.jsx("span",{"aria-hidden":!0,className:"text-error",children:"*"}),r&&w.jsx(AA,{content:r,children:w.jsx("button",{type:"button","aria-label":"More information",className:"inline-flex cursor-default items-center text-muted-foreground hover:text-foreground transition-all ml-1",children:w.jsx(D$,{className:"size-3.5"})})})]}):o,a={className:me("inline-flex items-center font-medium text-sm leading-none","peer-data-disabled:cursor-not-allowed peer-data-disabled:opacity-70",e),"data-slot":"label",children:s};return noe({defaultTagName:"label",props:pa(a,i),render:t})}function NA({className:e,...t}){return w.jsx(vx,{className:me("peer relative inline-flex size-4.5 shrink-0 items-center justify-center rounded-[.25rem] border border-input bg-background not-dark:bg-clip-padding shadow-xs/5 outline-none ring-ring transition-shadow","before:pointer-events-none before:absolute before:inset-0 before:rounded-[3px]","not-data-disabled:not-data-checked:not-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)]","focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-offset-background","aria-invalid:border-destructive/36 focus-visible:aria-invalid:border-destructive/64 focus-visible:aria-invalid:ring-destructive/48","data-disabled:cursor-not-allowed data-disabled:opacity-64","sm:size-4","dark:not-data-disabled:not-data-checked:not-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)]","[[data-disabled],[data-checked],[aria-invalid]]:shadow-none",e),"data-slot":"checkbox",...t})}function IA({className:e,...t}){return w.jsx(bx,{className:me("absolute -inset-px flex items-center justify-center rounded-[.25rem] text-primary-foreground","data-unchecked:hidden data-checked:bg-primary data-indeterminate:text-foreground",e),"data-slot":"checkbox-indicator",render:(n,r)=>w.jsx("span",{...n,children:r.indeterminate?w.jsx("svg",{"aria-hidden":"true",className:"size-3.5 sm:size-3",fill:"none",height:"24",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"3",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("path",{d:"M5.252 12h13.496"})}):w.jsx("svg",{"aria-hidden":"true",className:"size-3.5 sm:size-3",fill:"none",height:"24",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"3",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("path",{d:"M5.252 12.7 10.2 18.63 18.748 5.37"})})}),...t})}function Toe({children:e,className:t,id:n,indicatorProps:r,...o}){const i=D.useId(),s=n??i;return w.jsxs("div",{className:"flex select-none items-center gap-x-2",children:[w.jsx(NA,{id:s,className:t,...o,children:w.jsx(IA,{...r})}),e&&w.jsx(Od,{htmlFor:s,children:e})]})}const bT=[];function _oe(e){const{allValues:t=bT,value:n=bT,onValueChange:r}=e,o=h.useRef(n),i=h.useRef(new Map),[s,a]=h.useState("mixed"),u=$r(),c=n.length===t.length,f=n.length!==t.length&&n.length>0,p=He(r),m=h.useCallback(()=>({id:u,indeterminate:f,checked:c,"aria-controls":t.map(y=>`${u}-${y}`).join(" "),onCheckedChange(y,v){const E=o.current,x=t.filter(O=>i.current.get(O)&&E.includes(O)),R=t.filter(O=>!i.current.get(O)||i.current.get(O)&&E.includes(O));if(E.length===R.length||E.length===0){n.length===R.length?p(x,v):p(R,v);return}s==="mixed"?(p(R,v),a("on")):s==="on"?(p(x,v),a("off")):s==="off"&&(p(E,v),a("mixed"))}}),[t,c,u,f,p,s,n.length]),b=h.useCallback(y=>({checked:n.includes(y),onCheckedChange(v,E){const x=n.slice();v?x.push(y):x.splice(x.indexOf(y),1),o.current=x,p(x,E),a("mixed")}}),[p,n]);return h.useMemo(()=>({id:u,indeterminate:f,getParentProps:m,getChildProps:b,disabledStatesRef:i}),[u,f,m,b])}function Ooe(e,t,n=(r,o)=>r===o){return e.length===t.length&&e.every((r,o)=>n(r,t[o]))}const kA=h.forwardRef(function(t,n){const{allValues:r,className:o,defaultValue:i,disabled:s=!1,id:a,onValueChange:u,render:c,value:f,style:p,...m}=t,{disabled:b,name:y,state:v,validation:E,setFilled:x,setDirty:R,shouldValidateOnChange:P,validityData:O}=_d(),{labelId:S,getDescriptionProps:T}=Xm(),{clearErrors:_}=mx(),$=b||s,V=h.useMemo(()=>{if(f===void 0)return i??[]},[f,i]),[U,A]=fx({controlled:f,default:V,name:"CheckboxGroup",state:"value"}),H=He((te,X)=>{u?.(te,X),!X.isCanceled&&A(te)}),F=_oe({allValues:r,value:U,onValueChange:H}),N=$r(a),j=h.useRef(null),I=h.useCallback(te=>{j.current==null&&te!=null&&!te.hasAttribute(yA)&&(j.current=te)},[]);px(j,{enabled:!!y,id:N,value:U});const k=U??fC;Nm(k,()=>{y&&_(y);const te=Array.isArray(O.initialValue)?O.initialValue:fC;x(k.length>0),R(!Ooe(k,te)),P()?E.commit(k):E.commit(k,!0)});const q={...v,disabled:$},z=h.useMemo(()=>({allValues:r,value:U,defaultValue:V,setValue:H,parent:F,disabled:$,validation:E,registerControlRef:I}),[r,U,V,H,F,$,E,I]),W=lt("div",t,{state:q,ref:n,props:[{role:"group","aria-labelledby":S},T,m],stateAttributesMapping:Ym});return w.jsx(hx.Provider,{value:z,children:W})});process.env.NODE_ENV!=="production"&&(kA.displayName="CheckboxGroup");function $oe({className:e,...t}){return w.jsx(kA,{className:me("flex flex-col items-start gap-3",e),"data-slot":"checkbox-group",...t})}function Doe({items:e=[],valueKey:t="value",labelKey:n="label",placeholder:r="Seleccionar",searchPlaceholder:o="Buscar...",emptyMessage:i="No se encontraron resultado",searchProps:s,className:a,triggerProps:u,itemProps:c,itemClassName:f,contentProps:p,contentClassName:m,value:b,onChange:y,defaultValue:v,renderOption:E=P=>P?.[n],commandProps:x,...R}){const[P,O]=Kt({prop:R.open,onChange:R.onOpenChange,defaultProp:R.defaultOpen||!1}),[S,T]=Kt({prop:b,onChange:U=>{if(!y)return;const A=e.find(H=>H[t]===U);y?.(A?.[t],A)},defaultProp:v}),[_,$]=Kt({prop:R?.search,defaultProp:R?.searchDefaultValue||"",onChange:R?.onSearchChange}),V=h.useMemo(()=>e.find(U=>U[t]===S),[S]);return w.jsxs(jd,{open:P,onOpenChange:O,"data-slot":"combobox",children:[w.jsx(Bd,{asChild:!0,"data-slot":"combobox-trigger",children:w.jsxs(Tn,{...R,...u,variant:"outline",role:"combobox","aria-expanded":P,className:me("font-normal w-full items-center justify-between border-input px-3 hover:bg-background",a),children:[w.jsx("span",{className:"truncate",children:V?E(V):r}),w.jsx(Gp,{className:"ml-2 h-4 w-4 shrink-0 opacity-50","data-slot":"combobox-trigger-icon"})]})}),w.jsx(Vd,{...p,className:me("p-1",m),asChild:!0,matchTriggerWidth:!0,"data-slot":"combobox-content",children:w.jsxs(Rd,{...x,children:[w.jsx(Vm,{value:_,onValueChange:$,placeholder:o,autoFocus:!0,"data-slot":"combobox-input",...s}),w.jsx(Hm,{"data-slot":"combobox-empty",children:i}),w.jsx(Km,{"data-slot":"combobox-list",children:e.map(U=>D.createElement(nd,{className:f,"data-slot":"combobox-item",...c,key:U[t],value:U[t],onSelect:()=>{const A=U[t];T(A===S?"":A),O(!1)}},E(U)))})]})})]})}const Moe="dd/MM/yyyy",Nc=e=>ps(e)?Cn(e,Moe):"",Aoe=e=>{const t=e.trim();if(!t)return null;const n=/^(\d{1,2})\/(\d{1,2})\/(\d{1,4})$/.exec(t);if(!n)return null;const[,r,o,i]=n,s=Number(r),a=Number(o),u=i;let c=Number(u);if(Number.isNaN(s)||Number.isNaN(a)||Number.isNaN(c)||(u.length<=2&&(c=2e3+c),s<1||s>31||a<1||a>12))return null;const f=new Date(c,a-1,s);return f.getFullYear()!==c||f.getMonth()!==a-1||f.getDate()!==s?null:f},Noe=(e,t)=>{const n=(t.lastKey==="Backspace"||t.lastKey==="Delete")&&e.length<t.previousValue.length,r=e.includes("/"),o=e.trim().endsWith("/");if((e.match(/\//g)??[]).length>=2){const E=e.split("/"),x=(E[0]??"").replace(/\D/g,"").slice(0,2),R=(E[1]??"").replace(/\D/g,"").slice(0,2),P=(E[2]??"").replace(/\D/g,"").slice(0,4);return!x&&!R&&!P?"":`${x}/${R}/${P}`}const s=e.replace(/\D/g,"").slice(0,8);if(!s)return"";if(s.length<=2){let E=s;if(s.length===1&&(r||o)&&!n){let x=Number(E);Number.isNaN(x)&&(x=1),x<1&&(x=1),x>31&&(x=31),E=x.toString().padStart(2,"0"),E+="/"}else if(s.length===2&&!n){let x=Number(E);Number.isNaN(x)&&(x=1),x<1&&(x=1),x>31&&(x=31),E=x.toString().padStart(2,"0"),E+="/"}return E}const a=s.slice(0,2);let u=Number(a);Number.isNaN(u)&&(u=1),u<1&&(u=1),u>31&&(u=31);const c=u.toString().padStart(2,"0"),f=s.slice(2,4),p=s.slice(4);let m="";if(f.length===0)m="";else if(f.length===1&&p.length===0){const E=o&&!n&&f.length===1;if(f==="0"||f==="1")if(E){let x=Number(f);Number.isNaN(x)&&(x=1),x<1&&(x=1),x>12&&(x=12),m=x.toString().padStart(2,"0")}else m=f;else{let x=Number(f);Number.isNaN(x)&&(x=1),x<1&&(x=1),x>12&&(x=12),m=x.toString().padStart(2,"0")}}else{let E=Number(f);Number.isNaN(E)&&(E=1),E<1&&(E=1),E>12&&(E=12),m=E.toString().padStart(2,"0")}const b=`${c}/${m}`,y=!p&&m.length===2&&!n;return p?`${b}/${p}`:y?`${b}/`:b},Ioe=e=>{const{date:t,onDateChange:n,disabledDate:r}=e,[o,i]=D.useState(""),s=D.useRef(null),a=D.useRef("");D.useEffect(()=>{const y=Nc(t??null);i(y),a.current=y},[t]);const u=()=>{const y=o.trim();if(!y){n(null),i(""),a.current="";return}const v=Aoe(y);if(!v){n(null),i(""),a.current="";return}if(r?.(v)){const x=Nc(t??null);i(x),a.current=x;return}n(v);const E=Nc(v);i(E),a.current=E};return{inputValue:o,handleChange:y=>{const v=y.target.value,E={lastKey:s.current,previousValue:a.current},x=Noe(v,E);i(x),a.current=x},handleBlur:()=>{u()},handleKeyDown:y=>{if(s.current=y.key,y.key==="Enter"){y.preventDefault(),u();return}if(y.key==="Escape"){y.preventDefault();const v=Nc(t??null);i(v),a.current=v}},clear:()=>{n(null),i(""),a.current=""},setFromExternalDate:y=>{n(y);const v=Nc(y??null);i(v),a.current=v}}},koe=(e={})=>{const{disabled:t}=e,[n,r]=D.useState(!1),o=D.useRef(null),i=D.useCallback(s=>{if(!t){if(s.key===" "||s.key==="Spacebar"){s.preventDefault(),r(!0);return}s.key==="Escape"&&(r(!1),requestAnimationFrame(()=>{o.current?.focus()}))}},[t]);return{open:n,setOpen:r,handleInputKeyDown:i,inputRef:o}},Foe=e=>{const{placeholder:t,value:n,onChange:r,defaultValue:o,autoComplete:i,className:s,disabledDate:a,renderFooter:u,disabled:c,hideFooter:f,onBlur:p,...m}=e,[b,y]=Kt({prop:n,onChange:N=>r?.(N??null),defaultProp:o??null}),{inputValue:v,handleChange:E,handleBlur:x,handleKeyDown:R,clear:P,setFromExternalDate:O}=Ioe({date:b??null,onDateChange:N=>y(N),disabledDate:a}),{open:S,setOpen:T,handleInputKeyDown:_,inputRef:$}=koe({disabled:c}),V=N=>{R(N),_(N)},U=()=>{O(null),P()},A=()=>{const N=new Date;a?.(N)||O(N)},H=()=>w.jsxs("span",{className:"flex w-full p-1 justify-between",children:[w.jsx(Tn,{variant:"ghost",onClick:U,children:"Borrar"}),w.jsx(Tn,{variant:"ghost",onClick:A,disabled:a?.(new Date),children:"Hoy"})]}),F=()=>f?null:u?u({mode:"single",value:b,clear:U,selectToday:A,setValue:N=>{const j=N&&ps(N)?N:null;y(j),O(j)}}):H();return w.jsxs(jd,{"data-slot":"date-picker",open:S,onOpenChange:T,children:[w.jsxs("div",{className:me("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",!b&&"text-muted-foreground",s,"field-error"),onClick:N=>{N.target===N.currentTarget&&$.current?.focus()},children:[w.jsx("input",{type:"text",value:v,onChange:E,onBlur:N=>{x(),p?.(N)},onKeyDown:V,placeholder:t??"DD/MM/YYYY",autoComplete:i??"off",disabled:c,className:"flex-1 min-w-0 bg-transparent outline-none text-start truncate pt-px","aria-label":t,ref:$,...m}),w.jsx(Bd,{asChild:!0,"data-slot":"date-picker-trigger",children:w.jsxs("button",{type:"button",disabled:c,className:"flex shrink-0 items-center justify-center text-muted-foreground hover:text-foreground p-1",children:[w.jsx(QK,{"data-slot":"date-picker-icon"}),w.jsx("span",{className:"sr-only",children:"Seleccionar fecha"})]})})]}),w.jsxs(Vd,{className:"w-auto p-0",align:"start","data-slot":"date-picker-content",children:[w.jsx(fA,{className:"border-none",mode:"single",value:b,onChange:N=>{if(!ps(N)){O(null);return}a?.(N)||(O(N),T(!1))},disabled:a}),w.jsx("div",{className:"p-2","data-slot":"date-picker-footer",children:F()})]})]})},FA=e=>{const{className:t,orientation:n="horizontal"}=e;return w.jsx("hr",{...e,"aria-orientation":n,className:me("shrink-0 bg-input",n==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),"data-slot":"divider"})},Loe=({onDrop:e,onError:t,allowedExtensions:n=[],maxFileSize:r=5*1024*1024,maxFiles:o=1/0})=>{const[i,s]=D.useState(!1),a=D.useCallback(m=>{m.preventDefault(),m.stopPropagation()},[]),u=D.useCallback(m=>{m.preventDefault(),m.stopPropagation(),s(!0)},[]),c=D.useCallback(m=>{m.preventDefault(),m.stopPropagation(),s(!1)},[]),f=m=>{const[b=[],y=[],v=[]]=m.reduce(([E,x,R],P)=>n.length>0&&!n.includes(P.type)?(E.push(P),R.push({file:P,errorMessage:"Extensión no permitida",errorCode:"INVALID_EXTENSION"}),[E,x,R]):P.size>r?(E.push(P),R.push({file:P,errorMessage:"Archivo demasiado grande",errorCode:"FILE_TOO_LARGE"}),[E,x,R]):o&&o<x.length+1?(E.push(P),R.push({file:P,errorMessage:"Límite de archivos excedido",errorCode:"MAX_FILES_EXCEEDED"}),[E,x,R]):(x.push(P),[E,x,R]),[[],[],[]]);return v.length>0&&t&&t(v),[b,y,v]},p=D.useCallback(m=>{m.preventDefault(),m.stopPropagation(),s(!1);const b=Array.from(m.dataTransfer.files),[y=[],v=[]]=f(b);e(v,y)},[n,r,o,e,t]);return{isDragActive:i,validateFiles:f,dropzoneProps:{onDragOver:a,onDragEnter:u,onDragLeave:c,onDrop:p}}},LA=D.createContext(null),Mx=()=>{const e=D.useContext(LA);if(!e)throw new Error("useUploadContext must be used within a UploadContextProvider");return e},qA=({onFileAdd:e,onFileRemove:t,onChangeFiles:n,files:r,maxFiles:o=1,allowedExtensions:i=[],maxFileSize:s=5*1024*1024,multiple:a,children:u,onError:c,...f})=>{const[p=[],m]=Kt({defaultProp:[],prop:r,onChange:n}),[b,y]=D.useState([]),{isDragActive:v,validateFiles:E,dropzoneProps:x}=Loe({onDrop:(O,S)=>{m([...p,...O]),y(T=>[...T,...S]),e?.(O)},allowedExtensions:i,maxFileSize:s,maxFiles:o,onError:c}),R=O=>{const[S=[],T=[]]=E(O);if(o===1||!a){m(T.slice(0,1)),y([...S,...T.slice(1)]),e?.(T.slice(0,1));return}const _=o-p.length;if(_<=0){y(U=>[...U,...T]),e?.([]);return}const $=T.slice(0,_),V=T.slice(_);m([...p,...$]),y(U=>[...U,...S,...V]),e?.($)},P=(O,S)=>{S==="accepted"?m(p.filter((T,_)=>_!==O)):y(T=>T.filter((_,$)=>$!==O)),t?.(O,S)};return w.jsx(LA.Provider,{value:{files:p,rejectedFiles:b,handleFileAdd:R,handleFileRemove:P,inputProps:{accept:i.join(","),multiple:a},isDragActive:v,dropzoneProps:x},children:w.jsx("div",{...f,"data-slot":"upload",children:u})})},jA=({asChild:e,...t})=>{const{handleFileAdd:n,inputProps:r,dropzoneProps:o,isDragActive:i}=Mx(),s=D.useRef(null),a=e?km:"button";return w.jsxs(w.Fragment,{children:[w.jsx(a,{"data-slot":"upload-trigger",...t,...o,"data-drag-active":i||!1,onClick:u=>{t.onClick?.(u),s.current?.click()}}),w.jsx("input",{type:"file",className:"hidden","data-slot":"upload-input",...r,ref:s,onChange:u=>n(Array.from(u.target.files||[]))})]})},BA=({className:e,...t})=>w.jsx("div",{...t,className:me("mt-2 space-y-2",e),"data-slot":"upload-content"}),VA=({files:e,handleFileRemove:t,fileType:n,children:r,renderFile:o,...i})=>e.length===0?null:w.jsxs("div",{className:"mt-2 space-y-2",...i,"data-slot":"upload-files-list",children:[r,e.map((s,a)=>o?o(s,()=>t(a,n)):w.jsx(WA,{file:s,onRemove:()=>t(a,n)},s.name))]}),KA=e=>{const{files:t,handleFileRemove:n}=Mx();return w.jsx(VA,{"data-slot":"upload-accepted-files",files:t,handleFileRemove:n,fileType:"accepted",...e})},HA=e=>{const{rejectedFiles:t,handleFileRemove:n}=Mx();return w.jsx(VA,{"data-slot":"upload-rejected-files",files:t,handleFileRemove:n,fileType:"rejected",...e})},WA=({file:e,onRemove:t,className:n,renderIcon:r,...o})=>w.jsxs("div",{className:me("flex items-center gap-2 mb-2",n),...o,"data-slot":"upload-item",children:[r?.(e),e.name,w.jsx(Tn,{variant:"ghost",size:"icon",type:"button",className:"h-6 w-6",onClick:t,"data-slot":"upload-item-remove",children:w.jsx(vd,{"data-slot":"upload-item-remove-icon"})})]}),qoe=({onFileAdd:e,onFileRemove:t,onChangeFiles:n=()=>{},files:r,maxFiles:o=1,allowedExtensions:i=[],maxFileSize:s=5*1024*1024,multiple:a,renderAcceptedFile:u,renderRejectedFile:c,showRejected:f=!1,className:p,icon:m=gH,iconSize:b=40,onError:y,...v})=>{const E=D.useMemo(()=>i.map(x=>x.split("/")?.[1]).join(", "),[i]);return w.jsxs(qA,{onFileAdd:e,onFileRemove:t,files:r,onChangeFiles:n,maxFiles:o,allowedExtensions:i,maxFileSize:s,multiple:a?!0:void 0,className:me("w-full",p),onError:y,...v,children:[w.jsx(jA,{asChild:!0,children:w.jsxs("div",{className:me("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:[w.jsx(m,{className:"text-muted-foreground pointer-events-none",style:{width:b,height:b}}),w.jsxs("div",{className:"text-center text-muted-foreground pointer-events-none",children:[w.jsx("p",{children:"Arrastra y suelta archivos aquí o haz clic para seleccionar"}),i.length>0&&w.jsxs("p",{className:"text-sm",children:["Tipos permitidos: ",E]}),w.jsxs("p",{className:"text-sm",children:["Tamaño máximo: ",Math.floor(s/1024/1024),"MB"]})]})]})}),w.jsxs(BA,{children:[w.jsx(KA,{renderFile:u}),f&&w.jsx(HA,{renderFile:c})]})]})},cn={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"},joe={IMAGES:[cn.JPEG,cn.JPG,cn.PNG,cn.GIF,cn.WEBP,cn.SVG],DOCUMENTS:[cn.PDF,cn.DOC,cn.DOCX,cn.XLS,cn.XLSX,cn.PPT,cn.PPTX],COMPRESSED:[cn.ZIP,cn.RAR],AUDIO:[cn.MP3,cn.WAV],VIDEO:[cn.MP4,cn.WEBM]},Boe=Oi([],{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"}}),UA=({className:e,size:t,weight:n,as:r,...o})=>{const i=r||"h2";return w.jsx(i,{className:me(Boe({size:t,weight:n}),e),...o,"data-slot":"heading","data-size":t,"data-weight":n})},Voe=({icon:e=w.jsx(EH,{className:"w-12 h-12"}),title:t="No hay resultados",description:n,className:r,children:o,...i})=>w.jsxs("div",{className:me("flex flex-col gap-2 justify-center items-center",r),"data-slot":"empty-state",...i,children:[w.jsx("div",{className:"text-muted-foreground","data-slot":"empty-state-icon",children:e}),w.jsx(UA,{className:"empty:hidden","data-slot":"empty-state-title",children:t}),w.jsx("p",{className:"py-1 text-sm text-center text-muted-foreground empty:hidden","data-slot":"empty-state-description",children:n}),o]}),Koe=({label:e,labelClassName:t,labelProps:n,error:r,errorClassName:o,errorProps:i,children:s,className:a,...u})=>w.jsxs("div",{...u,className:me("flex flex-col gap-1",a),"data-slot":"field",children:[w.jsx(Od,{className:me("empty:hidden",t),...n,"data-slot":"field-label",children:e}),s,w.jsx("p",{"data-slot":"field-error",className:me("text-sm font-medium text-error empty:hidden",o),...i,children:r})]});var $d=e=>e.type==="checkbox",ts=e=>e instanceof Date,Xn=e=>e==null;const zA=e=>typeof e=="object";var pn=e=>!Xn(e)&&!Array.isArray(e)&&zA(e)&&!ts(e),GA=e=>pn(e)&&e.target?$d(e.target)?e.target.checked:e.target.value:e,Hoe=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,YA=(e,t)=>e.has(Hoe(t)),Woe=e=>{const t=e.constructor&&e.constructor.prototype;return pn(t)&&t.hasOwnProperty("isPrototypeOf")},Ax=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function bn(e){let t;const n=Array.isArray(e),r=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(Ax&&(e instanceof Blob||r))&&(n||pn(e)))if(t=n?[]:Object.create(Object.getPrototypeOf(e)),!n&&!Woe(e))t=e;else for(const o in e)e.hasOwnProperty(o)&&(t[o]=bn(e[o]));else return e;return t}var Qm=e=>/^\w*$/.test(e),Zt=e=>e===void 0,Nx=e=>Array.isArray(e)?e.filter(Boolean):[],Ix=e=>Nx(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Te=(e,t,n)=>{if(!t||!pn(e))return n;const r=(Qm(t)?[t]:Ix(t)).reduce((o,i)=>Xn(o)?o:o[i],e);return Zt(r)||r===e?Zt(e[t])?n:e[t]:r},lr=e=>typeof e=="boolean",Ct=(e,t,n)=>{let r=-1;const o=Qm(t)?[t]:Ix(t),i=o.length,s=i-1;for(;++r<i;){const a=o[r];let u=n;if(r!==s){const c=e[a];u=pn(c)||Array.isArray(c)?c:isNaN(+o[r+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=u,e=e[a]}};const im={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Vr={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},No={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},kx=D.createContext(null);kx.displayName="HookFormContext";const Dd=()=>D.useContext(kx),Uoe=e=>{const{children:t,...n}=e;return D.createElement(kx.Provider,{value:n},t)};var XA=(e,t,n,r=!0)=>{const o={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(o,i,{get:()=>{const s=i;return t._proxyFormState[s]!==Vr.all&&(t._proxyFormState[s]=!r||Vr.all),n&&(n[s]=!0),e[s]}});return o};const Fx=typeof window<"u"?D.useLayoutEffect:D.useEffect;function zoe(e){const t=Dd(),{control:n=t.control,disabled:r,name:o,exact:i}=e||{},[s,a]=D.useState(n._formState),u=D.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Fx(()=>n._subscribe({name:o,formState:u.current,exact:i,callback:c=>{!r&&a({...n._formState,...c})}}),[o,r,i]),D.useEffect(()=>{u.current.isValid&&n._setValid(!0)},[n]),D.useMemo(()=>XA(s,n,u.current,!1),[s,n])}var dr=e=>typeof e=="string",Pb=(e,t,n,r,o)=>dr(e)?(r&&t.watch.add(e),Te(n,e,o)):Array.isArray(e)?e.map(i=>(r&&t.watch.add(i),Te(n,i))):(r&&(t.watchAll=!0),n),Tb=e=>Xn(e)||!zA(e);function Kr(e,t,n=new WeakSet){if(Tb(e)||Tb(t))return Object.is(e,t);if(ts(e)&&ts(t))return e.getTime()===t.getTime();const r=Object.keys(e),o=Object.keys(t);if(r.length!==o.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const i of r){const s=e[i];if(!o.includes(i))return!1;if(i!=="ref"){const a=t[i];if(ts(s)&&ts(a)||pn(s)&&pn(a)||Array.isArray(s)&&Array.isArray(a)?!Kr(s,a,n):!Object.is(s,a))return!1}}return!0}function Goe(e){const t=Dd(),{control:n=t.control,name:r,defaultValue:o,disabled:i,exact:s,compute:a}=e||{},u=D.useRef(o),c=D.useRef(a),f=D.useRef(void 0),p=D.useRef(n),m=D.useRef(r);c.current=a;const[b,y]=D.useState(()=>{const O=n._getWatch(r,u.current);return c.current?c.current(O):O}),v=D.useCallback(O=>{const S=Pb(r,n._names,O||n._formValues,!1,u.current);return c.current?c.current(S):S},[n._formValues,n._names,r]),E=D.useCallback(O=>{if(!i){const S=Pb(r,n._names,O||n._formValues,!1,u.current);if(c.current){const T=c.current(S);Kr(T,f.current)||(y(T),f.current=T)}else y(S)}},[n._formValues,n._names,i,r]);Fx(()=>((p.current!==n||!Kr(m.current,r))&&(p.current=n,m.current=r,E()),n._subscribe({name:r,formState:{values:!0},exact:s,callback:O=>{E(O.values)}})),[n,s,r,E]),D.useEffect(()=>n._removeUnmounted());const x=p.current!==n,R=m.current,P=D.useMemo(()=>{if(i)return null;const O=!x&&!Kr(R,r);return x||O?v():null},[i,x,r,R,v]);return P!==null?P:b}function Yoe(e){const t=Dd(),{name:n,disabled:r,control:o=t.control,shouldUnregister:i,defaultValue:s,exact:a=!0}=e,u=YA(o._names.array,n),c=D.useMemo(()=>Te(o._formValues,n,Te(o._defaultValues,n,s)),[o,n,s]),f=Goe({control:o,name:n,defaultValue:c,exact:a}),p=zoe({control:o,name:n,exact:a}),m=D.useRef(e),b=D.useRef(void 0),y=D.useRef(o.register(n,{...e.rules,value:f,...lr(e.disabled)?{disabled:e.disabled}:{}}));m.current=e;const v=D.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Te(p.errors,n)},isDirty:{enumerable:!0,get:()=>!!Te(p.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Te(p.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Te(p.validatingFields,n)},error:{enumerable:!0,get:()=>Te(p.errors,n)}}),[p,n]),E=D.useCallback(O=>y.current.onChange({target:{value:GA(O),name:n},type:im.CHANGE}),[n]),x=D.useCallback(()=>y.current.onBlur({target:{value:Te(o._formValues,n),name:n},type:im.BLUR}),[n,o._formValues]),R=D.useCallback(O=>{const S=Te(o._fields,n);S&&O&&(S._f.ref={focus:()=>O.focus&&O.focus(),select:()=>O.select&&O.select(),setCustomValidity:T=>O.setCustomValidity(T),reportValidity:()=>O.reportValidity()})},[o._fields,n]),P=D.useMemo(()=>({name:n,value:f,...lr(r)||p.disabled?{disabled:p.disabled||r}:{},onChange:E,onBlur:x,ref:R}),[n,r,p.disabled,E,x,R,f]);return D.useEffect(()=>{const O=o._options.shouldUnregister||i,S=b.current;S&&S!==n&&!u&&o.unregister(S),o.register(n,{...m.current.rules,...lr(m.current.disabled)?{disabled:m.current.disabled}:{}});const T=(_,$)=>{const V=Te(o._fields,_);V&&V._f&&(V._f.mount=$)};if(T(n,!0),O){const _=bn(Te(o._options.defaultValues,n,m.current.defaultValue));Ct(o._defaultValues,n,_),Zt(Te(o._formValues,n))&&Ct(o._formValues,n,_)}return!u&&o.register(n),b.current=n,()=>{(u?O&&!o._state.action:O)?o.unregister(n):T(n,!1)}},[n,o,u,i]),D.useEffect(()=>{o._setDisabledField({disabled:r,name:n})},[r,n,o]),D.useMemo(()=>({field:P,formState:p,fieldState:v}),[P,p,v])}const Xoe=e=>e.render(Yoe(e));var Lx=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},Yc=e=>Array.isArray(e)?e:[e],yT=()=>{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 ZA(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const o=e[r],i=t[r];if(o&&pn(o)&&i){const s=ZA(o,i);pn(s)&&(n[r]=s)}else e[r]&&(n[r]=i)}return n}var Vn=e=>pn(e)&&!Object.keys(e).length,qx=e=>e.type==="file",Hr=e=>typeof e=="function",sm=e=>{if(!Ax)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},QA=e=>e.type==="select-multiple",jx=e=>e.type==="radio",Zoe=e=>jx(e)||$d(e),Pv=e=>sm(e)&&e.isConnected;function Qoe(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=Zt(e)?r++:e[t[r++]];return e}function Joe(e){for(const t in e)if(e.hasOwnProperty(t)&&!Zt(e[t]))return!1;return!0}function dn(e,t){const n=Array.isArray(t)?t:Qm(t)?[t]:Ix(t),r=n.length===1?e:Qoe(e,n),o=n.length-1,i=n[o];return r&&delete r[i],o!==0&&(pn(r)&&Vn(r)||Array.isArray(r)&&Joe(r))&&dn(e,n.slice(0,-1)),e}var eie=e=>{for(const t in e)if(Hr(e[t]))return!0;return!1};function JA(e){return Array.isArray(e)||pn(e)&&!eie(e)}function _b(e,t={}){for(const n in e){const r=e[n];JA(r)?(t[n]=Array.isArray(r)?[]:{},_b(r,t[n])):Zt(r)||(t[n]=!0)}return t}function Zs(e,t,n){n||(n=_b(t));for(const r in e){const o=e[r];if(JA(o))Zt(t)||Tb(n[r])?n[r]=_b(o,Array.isArray(o)?[]:{}):Zs(o,Xn(t)?{}:t[r],n[r]);else{const i=t[r];n[r]=!Kr(o,i)}}return n}const xT={value:!1,isValid:!1},wT={value:!0,isValid:!0};var eN=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Zt(e[0].attributes.value)?Zt(e[0].value)||e[0].value===""?wT:{value:e[0].value,isValid:!0}:wT:xT}return xT},tN=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Zt(e)?e:t?e===""?NaN:e&&+e:n&&dr(e)?new Date(e):r?r(e):e;const ET={isValid:!1,value:null};var nN=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,ET):ET;function CT(e){const t=e.ref;return qx(t)?t.files:jx(t)?nN(e.refs).value:QA(t)?[...t.selectedOptions].map(({value:n})=>n):$d(t)?eN(e.refs).value:tN(Zt(t.value)?e.ref.value:t.value,e)}var tie=(e,t,n,r)=>{const o={};for(const i of e){const s=Te(t,i);s&&Ct(o,i,s._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},am=e=>e instanceof RegExp,Ic=e=>Zt(e)?e:am(e)?e.source:pn(e)?am(e.value)?e.value.source:e.value:e,RT=e=>({isOnSubmit:!e||e===Vr.onSubmit,isOnBlur:e===Vr.onBlur,isOnChange:e===Vr.onChange,isOnAll:e===Vr.all,isOnTouch:e===Vr.onTouched});const ST="AsyncFunction";var nie=e=>!!e&&!!e.validate&&!!(Hr(e.validate)&&e.validate.constructor.name===ST||pn(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===ST)),rie=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),PT=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Xc=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const i=Te(e,o);if(i){const{_f:s,...a}=i;if(s){if(s.refs&&s.refs[0]&&t(s.refs[0],o)&&!r)return!0;if(s.ref&&t(s.ref,s.name)&&!r)return!0;if(Xc(a,t))break}else if(pn(a)&&Xc(a,t))break}}};function TT(e,t,n){const r=Te(e,n);if(r||Qm(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const i=o.join("."),s=Te(t,i),a=Te(e,i);if(s&&!Array.isArray(s)&&n!==i)return{name:n};if(a&&a.type)return{name:i,error:a};if(a&&a.root&&a.root.type)return{name:`${i}.root`,error:a.root};o.pop()}return{name:n}}var oie=(e,t,n,r)=>{n(e);const{name:o,...i}=e;return Vn(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(s=>t[s]===(!r||Vr.all))},iie=(e,t,n)=>!e||!t||e===t||Yc(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),sie=(e,t,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:(n?r.isOnChange:o.isOnChange)?e:!0,aie=(e,t)=>!Nx(Te(e,t)).length&&dn(e,t),lie=(e,t,n)=>{const r=Yc(Te(e,n));return Ct(r,"root",t[n]),Ct(e,n,r),e};function _T(e,t,n="validate"){if(dr(e)||Array.isArray(e)&&e.every(dr)||lr(e)&&!e)return{type:n,message:dr(e)?e:"",ref:t}}var Ws=e=>pn(e)&&!am(e)?e:{value:e,message:""},OT=async(e,t,n,r,o,i)=>{const{ref:s,refs:a,required:u,maxLength:c,minLength:f,min:p,max:m,pattern:b,validate:y,name:v,valueAsNumber:E,mount:x}=e._f,R=Te(n,v);if(!x||t.has(v))return{};const P=a?a[0]:s,O=H=>{o&&P.reportValidity&&(P.setCustomValidity(lr(H)?"":H||""),P.reportValidity())},S={},T=jx(s),_=$d(s),$=T||_,V=(E||qx(s))&&Zt(s.value)&&Zt(R)||sm(s)&&s.value===""||R===""||Array.isArray(R)&&!R.length,U=Lx.bind(null,v,r,S),A=(H,F,N,j=No.maxLength,I=No.minLength)=>{const k=H?F:N;S[v]={type:H?j:I,message:k,ref:s,...U(H?j:I,k)}};if(i?!Array.isArray(R)||!R.length:u&&(!$&&(V||Xn(R))||lr(R)&&!R||_&&!eN(a).isValid||T&&!nN(a).isValid)){const{value:H,message:F}=dr(u)?{value:!!u,message:u}:Ws(u);if(H&&(S[v]={type:No.required,message:F,ref:P,...U(No.required,F)},!r))return O(F),S}if(!V&&(!Xn(p)||!Xn(m))){let H,F;const N=Ws(m),j=Ws(p);if(!Xn(R)&&!isNaN(R)){const I=s.valueAsNumber||R&&+R;Xn(N.value)||(H=I>N.value),Xn(j.value)||(F=I<j.value)}else{const I=s.valueAsDate||new Date(R),k=W=>new Date(new Date().toDateString()+" "+W),q=s.type=="time",z=s.type=="week";dr(N.value)&&R&&(H=q?k(R)>k(N.value):z?R>N.value:I>new Date(N.value)),dr(j.value)&&R&&(F=q?k(R)<k(j.value):z?R<j.value:I<new Date(j.value))}if((H||F)&&(A(!!H,N.message,j.message,No.max,No.min),!r))return O(S[v].message),S}if((c||f)&&!V&&(dr(R)||i&&Array.isArray(R))){const H=Ws(c),F=Ws(f),N=!Xn(H.value)&&R.length>+H.value,j=!Xn(F.value)&&R.length<+F.value;if((N||j)&&(A(N,H.message,F.message),!r))return O(S[v].message),S}if(b&&!V&&dr(R)){const{value:H,message:F}=Ws(b);if(am(H)&&!R.match(H)&&(S[v]={type:No.pattern,message:F,ref:s,...U(No.pattern,F)},!r))return O(F),S}if(y){if(Hr(y)){const H=await y(R,n),F=_T(H,P);if(F&&(S[v]={...F,...U(No.validate,F.message)},!r))return O(F.message),S}else if(pn(y)){let H={};for(const F in y){if(!Vn(H)&&!r)break;const N=_T(await y[F](R,n),P,F);N&&(H={...N,...U(F,N.message)},O(N.message),r&&(S[v]=H))}if(!Vn(H)&&(S[v]={ref:P,...H},!r))return S}}return O(!0),S};const uie={mode:Vr.onSubmit,reValidateMode:Vr.onChange,shouldFocusError:!0};function cie(e={}){let t={...uie,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Hr(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},o=pn(t.defaultValues)||pn(t.values)?bn(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:bn(o),s={action:!1,mount:!1,watch:!1},a={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},u,c=0;const f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let p={...f};const m={array:yT(),state:yT()},b=t.criteriaMode===Vr.all,y=G=>J=>{clearTimeout(c),c=setTimeout(G,J)},v=async G=>{if(!t.disabled&&(f.isValid||p.isValid||G)){const J=t.resolver?Vn((await _()).errors):await V(r,!0);J!==n.isValid&&m.state.next({isValid:J})}},E=(G,J)=>{!t.disabled&&(f.isValidating||f.validatingFields||p.isValidating||p.validatingFields)&&((G||Array.from(a.mount)).forEach(ie=>{ie&&(J?Ct(n.validatingFields,ie,J):dn(n.validatingFields,ie))}),m.state.next({validatingFields:n.validatingFields,isValidating:!Vn(n.validatingFields)}))},x=(G,J=[],ie,fe,pe=!0,ge=!0)=>{if(fe&&ie&&!t.disabled){if(s.action=!0,ge&&Array.isArray(Te(r,G))){const Ee=ie(Te(r,G),fe.argA,fe.argB);pe&&Ct(r,G,Ee)}if(ge&&Array.isArray(Te(n.errors,G))){const Ee=ie(Te(n.errors,G),fe.argA,fe.argB);pe&&Ct(n.errors,G,Ee),aie(n.errors,G)}if((f.touchedFields||p.touchedFields)&&ge&&Array.isArray(Te(n.touchedFields,G))){const Ee=ie(Te(n.touchedFields,G),fe.argA,fe.argB);pe&&Ct(n.touchedFields,G,Ee)}(f.dirtyFields||p.dirtyFields)&&(n.dirtyFields=Zs(o,i)),m.state.next({name:G,isDirty:A(G,J),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Ct(i,G,J)},R=(G,J)=>{Ct(n.errors,G,J),m.state.next({errors:n.errors})},P=G=>{n.errors=G,m.state.next({errors:n.errors,isValid:!1})},O=(G,J,ie,fe)=>{const pe=Te(r,G);if(pe){const ge=Te(i,G,Zt(ie)?Te(o,G):ie);Zt(ge)||fe&&fe.defaultChecked||J?Ct(i,G,J?ge:CT(pe._f)):N(G,ge),s.mount&&!s.action&&v()}},S=(G,J,ie,fe,pe)=>{let ge=!1,Ee=!1;const Pe={name:G};if(!t.disabled){if(!ie||fe){(f.isDirty||p.isDirty)&&(Ee=n.isDirty,n.isDirty=Pe.isDirty=A(),ge=Ee!==Pe.isDirty);const Ne=Kr(Te(o,G),J);Ee=!!Te(n.dirtyFields,G),Ne?dn(n.dirtyFields,G):Ct(n.dirtyFields,G,!0),Pe.dirtyFields=n.dirtyFields,ge=ge||(f.dirtyFields||p.dirtyFields)&&Ee!==!Ne}if(ie){const Ne=Te(n.touchedFields,G);Ne||(Ct(n.touchedFields,G,ie),Pe.touchedFields=n.touchedFields,ge=ge||(f.touchedFields||p.touchedFields)&&Ne!==ie)}ge&&pe&&m.state.next(Pe)}return ge?Pe:{}},T=(G,J,ie,fe)=>{const pe=Te(n.errors,G),ge=(f.isValid||p.isValid)&&lr(J)&&n.isValid!==J;if(t.delayError&&ie?(u=y(()=>R(G,ie)),u(t.delayError)):(clearTimeout(c),u=null,ie?Ct(n.errors,G,ie):dn(n.errors,G)),(ie?!Kr(pe,ie):pe)||!Vn(fe)||ge){const Ee={...fe,...ge&&lr(J)?{isValid:J}:{},errors:n.errors,name:G};n={...n,...Ee},m.state.next(Ee)}},_=async G=>{E(G,!0);const J=await t.resolver(i,t.context,tie(G||a.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return E(G),J},$=async G=>{const{errors:J}=await _(G);if(G)for(const ie of G){const fe=Te(J,ie);fe?Ct(n.errors,ie,fe):dn(n.errors,ie)}else n.errors=J;return J},V=async(G,J,ie={valid:!0})=>{for(const fe in G){const pe=G[fe];if(pe){const{_f:ge,...Ee}=pe;if(ge){const Pe=a.array.has(ge.name),Ne=pe._f&&nie(pe._f);Ne&&f.validatingFields&&E([ge.name],!0);const st=await OT(pe,a.disabled,i,b,t.shouldUseNativeValidation&&!J,Pe);if(Ne&&f.validatingFields&&E([ge.name]),st[ge.name]&&(ie.valid=!1,J))break;!J&&(Te(st,ge.name)?Pe?lie(n.errors,st,ge.name):Ct(n.errors,ge.name,st[ge.name]):dn(n.errors,ge.name))}!Vn(Ee)&&await V(Ee,J,ie)}}return ie.valid},U=()=>{for(const G of a.unMount){const J=Te(r,G);J&&(J._f.refs?J._f.refs.every(ie=>!Pv(ie)):!Pv(J._f.ref))&&ee(G)}a.unMount=new Set},A=(G,J)=>!t.disabled&&(G&&J&&Ct(i,G,J),!Kr(W(),o)),H=(G,J,ie)=>Pb(G,a,{...s.mount?i:Zt(J)?o:dr(G)?{[G]:J}:J},ie,J),F=G=>Nx(Te(s.mount?i:o,G,t.shouldUnregister?Te(o,G,[]):[])),N=(G,J,ie={})=>{const fe=Te(r,G);let pe=J;if(fe){const ge=fe._f;ge&&(!ge.disabled&&Ct(i,G,tN(J,ge)),pe=sm(ge.ref)&&Xn(J)?"":J,QA(ge.ref)?[...ge.ref.options].forEach(Ee=>Ee.selected=pe.includes(Ee.value)):ge.refs?$d(ge.ref)?ge.refs.forEach(Ee=>{(!Ee.defaultChecked||!Ee.disabled)&&(Array.isArray(pe)?Ee.checked=!!pe.find(Pe=>Pe===Ee.value):Ee.checked=pe===Ee.value||!!pe)}):ge.refs.forEach(Ee=>Ee.checked=Ee.value===pe):qx(ge.ref)?ge.ref.value="":(ge.ref.value=pe,ge.ref.type||m.state.next({name:G,values:bn(i)})))}(ie.shouldDirty||ie.shouldTouch)&&S(G,pe,ie.shouldTouch,ie.shouldDirty,!0),ie.shouldValidate&&z(G)},j=(G,J,ie)=>{for(const fe in J){if(!J.hasOwnProperty(fe))return;const pe=J[fe],ge=G+"."+fe,Ee=Te(r,ge);(a.array.has(G)||pn(pe)||Ee&&!Ee._f)&&!ts(pe)?j(ge,pe,ie):N(ge,pe,ie)}},I=(G,J,ie={})=>{const fe=Te(r,G),pe=a.array.has(G),ge=bn(J);Ct(i,G,ge),pe?(m.array.next({name:G,values:bn(i)}),(f.isDirty||f.dirtyFields||p.isDirty||p.dirtyFields)&&ie.shouldDirty&&m.state.next({name:G,dirtyFields:Zs(o,i),isDirty:A(G,ge)})):fe&&!fe._f&&!Xn(ge)?j(G,ge,ie):N(G,ge,ie),PT(G,a)&&m.state.next({...n,name:G}),m.state.next({name:s.mount?G:void 0,values:bn(i)})},k=async G=>{s.mount=!0;const J=G.target;let ie=J.name,fe=!0;const pe=Te(r,ie),ge=Ne=>{fe=Number.isNaN(Ne)||ts(Ne)&&isNaN(Ne.getTime())||Kr(Ne,Te(i,ie,Ne))},Ee=RT(t.mode),Pe=RT(t.reValidateMode);if(pe){let Ne,st;const ut=J.type?CT(pe._f):GA(G),wt=G.type===im.BLUR||G.type===im.FOCUS_OUT,dt=!rie(pe._f)&&!t.resolver&&!Te(n.errors,ie)&&!pe._f.deps||sie(wt,Te(n.touchedFields,ie),n.isSubmitted,Pe,Ee),Nt=PT(ie,a,wt);Ct(i,ie,ut),wt?(!J||!J.readOnly)&&(pe._f.onBlur&&pe._f.onBlur(G),u&&u(0)):pe._f.onChange&&pe._f.onChange(G);const Yt=S(ie,ut,wt),un=!Vn(Yt)||Nt;if(!wt&&m.state.next({name:ie,type:G.type,values:bn(i)}),dt)return(f.isValid||p.isValid)&&(t.mode==="onBlur"?wt&&v():wt||v()),un&&m.state.next({name:ie,...Nt?{}:Yt});if(!wt&&Nt&&m.state.next({...n}),t.resolver){const{errors:mn}=await _([ie]);if(ge(ut),fe){const $n=TT(n.errors,r,ie),nt=TT(mn,r,$n.name||ie);Ne=nt.error,ie=nt.name,st=Vn(mn)}}else E([ie],!0),Ne=(await OT(pe,a.disabled,i,b,t.shouldUseNativeValidation))[ie],E([ie]),ge(ut),fe&&(Ne?st=!1:(f.isValid||p.isValid)&&(st=await V(r,!0)));fe&&(pe._f.deps&&(!Array.isArray(pe._f.deps)||pe._f.deps.length>0)&&z(pe._f.deps),T(ie,st,Ne,Yt))}},q=(G,J)=>{if(Te(n.errors,J)&&G.focus)return G.focus(),1},z=async(G,J={})=>{let ie,fe;const pe=Yc(G);if(t.resolver){const ge=await $(Zt(G)?G:pe);ie=Vn(ge),fe=G?!pe.some(Ee=>Te(ge,Ee)):ie}else G?(fe=(await Promise.all(pe.map(async ge=>{const Ee=Te(r,ge);return await V(Ee&&Ee._f?{[ge]:Ee}:Ee)}))).every(Boolean),!(!fe&&!n.isValid)&&v()):fe=ie=await V(r);return m.state.next({...!dr(G)||(f.isValid||p.isValid)&&ie!==n.isValid?{}:{name:G},...t.resolver||!G?{isValid:ie}:{},errors:n.errors}),J.shouldFocus&&!fe&&Xc(r,q,G?pe:a.mount),fe},W=(G,J)=>{let ie={...s.mount?i:o};return J&&(ie=ZA(J.dirtyFields?n.dirtyFields:n.touchedFields,ie)),Zt(G)?ie:dr(G)?Te(ie,G):G.map(fe=>Te(ie,fe))},te=(G,J)=>({invalid:!!Te((J||n).errors,G),isDirty:!!Te((J||n).dirtyFields,G),error:Te((J||n).errors,G),isValidating:!!Te(n.validatingFields,G),isTouched:!!Te((J||n).touchedFields,G)}),X=G=>{G&&Yc(G).forEach(J=>dn(n.errors,J)),m.state.next({errors:G?n.errors:{}})},Q=(G,J,ie)=>{const fe=(Te(r,G,{_f:{}})._f||{}).ref,pe=Te(n.errors,G)||{},{ref:ge,message:Ee,type:Pe,...Ne}=pe;Ct(n.errors,G,{...Ne,...J,ref:fe}),m.state.next({name:G,errors:n.errors,isValid:!1}),ie&&ie.shouldFocus&&fe&&fe.focus&&fe.focus()},re=(G,J)=>Hr(G)?m.state.subscribe({next:ie=>"values"in ie&&G(H(void 0,J),ie)}):H(G,J,!0),ce=G=>m.state.subscribe({next:J=>{iie(G.name,J.name,G.exact)&&oie(J,G.formState||f,Oe,G.reRenderRoot)&&G.callback({values:{...i},...n,...J,defaultValues:o})}}).unsubscribe,se=G=>(s.mount=!0,p={...p,...G.formState},ce({...G,formState:p})),ee=(G,J={})=>{for(const ie of G?Yc(G):a.mount)a.mount.delete(ie),a.array.delete(ie),J.keepValue||(dn(r,ie),dn(i,ie)),!J.keepError&&dn(n.errors,ie),!J.keepDirty&&dn(n.dirtyFields,ie),!J.keepTouched&&dn(n.touchedFields,ie),!J.keepIsValidating&&dn(n.validatingFields,ie),!t.shouldUnregister&&!J.keepDefaultValue&&dn(o,ie);m.state.next({values:bn(i)}),m.state.next({...n,...J.keepDirty?{isDirty:A()}:{}}),!J.keepIsValid&&v()},de=({disabled:G,name:J})=>{(lr(G)&&s.mount||G||a.disabled.has(J))&&(G?a.disabled.add(J):a.disabled.delete(J))},K=(G,J={})=>{let ie=Te(r,G);const fe=lr(J.disabled)||lr(t.disabled);return Ct(r,G,{...ie||{},_f:{...ie&&ie._f?ie._f:{ref:{name:G}},name:G,mount:!0,...J}}),a.mount.add(G),ie?de({disabled:lr(J.disabled)?J.disabled:t.disabled,name:G}):O(G,!0,J.value),{...fe?{disabled:J.disabled||t.disabled}:{},...t.progressive?{required:!!J.required,min:Ic(J.min),max:Ic(J.max),minLength:Ic(J.minLength),maxLength:Ic(J.maxLength),pattern:Ic(J.pattern)}:{},name:G,onChange:k,onBlur:k,ref:pe=>{if(pe){K(G,J),ie=Te(r,G);const ge=Zt(pe.value)&&pe.querySelectorAll&&pe.querySelectorAll("input,select,textarea")[0]||pe,Ee=Zoe(ge),Pe=ie._f.refs||[];if(Ee?Pe.find(Ne=>Ne===ge):ge===ie._f.ref)return;Ct(r,G,{_f:{...ie._f,...Ee?{refs:[...Pe.filter(Pv),ge,...Array.isArray(Te(o,G))?[{}]:[]],ref:{type:ge.type,name:G}}:{ref:ge}}}),O(G,!1,void 0,ge)}else ie=Te(r,G,{}),ie._f&&(ie._f.mount=!1),(t.shouldUnregister||J.shouldUnregister)&&!(YA(a.array,G)&&s.action)&&a.unMount.add(G)}}},ue=()=>t.shouldFocusError&&Xc(r,q,a.mount),le=G=>{lr(G)&&(m.state.next({disabled:G}),Xc(r,(J,ie)=>{const fe=Te(r,ie);fe&&(J.disabled=fe._f.disabled||G,Array.isArray(fe._f.refs)&&fe._f.refs.forEach(pe=>{pe.disabled=fe._f.disabled||G}))},0,!1))},Z=(G,J)=>async ie=>{let fe;ie&&(ie.preventDefault&&ie.preventDefault(),ie.persist&&ie.persist());let pe=bn(i);if(m.state.next({isSubmitting:!0}),t.resolver){const{errors:ge,values:Ee}=await _();n.errors=ge,pe=bn(Ee)}else await V(r);if(a.disabled.size)for(const ge of a.disabled)dn(pe,ge);if(dn(n.errors,"root"),Vn(n.errors)){m.state.next({errors:{}});try{await G(pe,ie)}catch(ge){fe=ge}}else J&&await J({...n.errors},ie),ue(),setTimeout(ue);if(m.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Vn(n.errors)&&!fe,submitCount:n.submitCount+1,errors:n.errors}),fe)throw fe},xe=(G,J={})=>{Te(r,G)&&(Zt(J.defaultValue)?I(G,bn(Te(o,G))):(I(G,J.defaultValue),Ct(o,G,bn(J.defaultValue))),J.keepTouched||dn(n.touchedFields,G),J.keepDirty||(dn(n.dirtyFields,G),n.isDirty=J.defaultValue?A(G,bn(Te(o,G))):A()),J.keepError||(dn(n.errors,G),f.isValid&&v()),m.state.next({...n}))},Re=(G,J={})=>{const ie=G?bn(G):o,fe=bn(ie),pe=Vn(G),ge=pe?o:fe;if(J.keepDefaultValues||(o=ie),!J.keepValues){if(J.keepDirtyValues){const Ee=new Set([...a.mount,...Object.keys(Zs(o,i))]);for(const Pe of Array.from(Ee))Te(n.dirtyFields,Pe)?Ct(ge,Pe,Te(i,Pe)):I(Pe,Te(ge,Pe))}else{if(Ax&&Zt(G))for(const Ee of a.mount){const Pe=Te(r,Ee);if(Pe&&Pe._f){const Ne=Array.isArray(Pe._f.refs)?Pe._f.refs[0]:Pe._f.ref;if(sm(Ne)){const st=Ne.closest("form");if(st){st.reset();break}}}}if(J.keepFieldsRef)for(const Ee of a.mount)I(Ee,Te(ge,Ee));else r={}}i=t.shouldUnregister?J.keepDefaultValues?bn(o):{}:bn(ge),m.array.next({values:{...ge}}),m.state.next({values:{...ge}})}a={mount:J.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!f.isValid||!!J.keepIsValid||!!J.keepDirtyValues||!t.shouldUnregister&&!Vn(ge),s.watch=!!t.shouldUnregister,s.action=!1,J.keepErrors||(n.errors={}),m.state.next({submitCount:J.keepSubmitCount?n.submitCount:0,isDirty:pe?!1:J.keepDirty?n.isDirty:!!(J.keepDefaultValues&&!Kr(G,o)),isSubmitted:J.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:pe?{}:J.keepDirtyValues?J.keepDefaultValues&&i?Zs(o,i):n.dirtyFields:J.keepDefaultValues&&G?Zs(o,G):J.keepDirty?n.dirtyFields:{},touchedFields:J.keepTouched?n.touchedFields:{},errors:J.keepErrors?n.errors:{},isSubmitSuccessful:J.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},Ae=(G,J)=>Re(Hr(G)?G(i):G,J),Se=(G,J={})=>{const ie=Te(r,G),fe=ie&&ie._f;if(fe){const pe=fe.refs?fe.refs[0]:fe.ref;pe.focus&&(pe.focus(),J.shouldSelect&&Hr(pe.select)&&pe.select())}},Oe=G=>{n={...n,...G}},Fe={control:{register:K,unregister:ee,getFieldState:te,handleSubmit:Z,setError:Q,_subscribe:ce,_runSchema:_,_focusError:ue,_getWatch:H,_getDirty:A,_setValid:v,_setFieldArray:x,_setDisabledField:de,_setErrors:P,_getFieldArray:F,_reset:Re,_resetDefaultValues:()=>Hr(t.defaultValues)&&t.defaultValues().then(G=>{Ae(G,t.resetOptions),m.state.next({isLoading:!1})}),_removeUnmounted:U,_disableForm:le,_subjects:m,_proxyFormState:f,get _fields(){return r},get _formValues(){return i},get _state(){return s},set _state(G){s=G},get _defaultValues(){return o},get _names(){return a},set _names(G){a=G},get _formState(){return n},get _options(){return t},set _options(G){t={...t,...G}}},subscribe:se,trigger:z,register:K,handleSubmit:Z,watch:re,setValue:I,getValues:W,reset:Ae,resetField:xe,clearErrors:X,unregister:ee,setError:Q,setFocus:Se,getFieldState:te};return{...Fe,formControl:Fe}}function die(e={}){const t=D.useRef(void 0),n=D.useRef(void 0),[r,o]=D.useState({isDirty:!1,isValidating:!1,isLoading:Hr(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:Hr(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!Hr(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:s,...a}=cie(e);t.current={...a,formState:r}}const i=t.current.control;return i._options=e,Fx(()=>{const s=i._subscribe({formState:i._proxyFormState,callback:()=>o({...i._formState}),reRenderRoot:!0});return o(a=>({...a,isReady:!0})),i._formState.isReady=!0,s},[i]),D.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),D.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),D.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),D.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),D.useEffect(()=>{if(i._proxyFormState.isDirty){const s=i._getDirty();s!==r.isDirty&&i._subjects.state.next({isDirty:s})}},[i,r.isDirty]),D.useEffect(()=>{var s;e.values&&!Kr(e.values,n.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),!((s=i._options.resetOptions)===null||s===void 0)&&s.keepIsValid||i._setValid(),n.current=e.values,o(a=>({...a}))):i._resetDefaultValues()},[i,e.values]),D.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=XA(r,i),t.current}const[fie,pie]=Sd(),[mie,hie]=Sd(),Md=()=>{const e=mie(),t=fie(),{getFieldState:n,formState:r}=Dd();if(!e)throw new Error("useFormField should be used within <FormField>");const o=n(e.name,r),{id:i}=t;return{id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...o}},gie=({onSubmit:e,id:t,form:n,children:r,className:o})=>w.jsx(Uoe,{...n,children:w.jsx("form",{id:t,onSubmit:n.handleSubmit(e),className:o,"data-slot":"form",children:r})}),vie=({name:e,label:t,description:n,className:r,render:o,itemProps:i,labelProps:s,controlProps:a,descriptionProps:u,messageProps:c})=>{const{control:f}=Dd();return w.jsx(hie,{value:{name:e},children:w.jsx(Xoe,{name:e,control:f,render:({field:p,fieldState:m})=>w.jsxs(rN,{className:r,...i,children:[t&&w.jsx(oN,{...s,children:t}),w.jsx(iN,{...a,children:_t.isFunction(o)?o(p):h.createElement(o,p)}),n&&w.jsx(sN,{...u,children:n}),w.jsx(aN,{...c,children:m.error?.message})]})})})},rN=({className:e,...t})=>{const n=h.useId();return w.jsx(pie,{value:{id:n},children:w.jsx("div",{className:me("flex flex-col gap-2",e),"data-slot":"form-item",...t})})},oN=({className:e,...t})=>{const{error:n,formItemId:r}=Md();return w.jsx(Od,{className:me(n&&"text-error",e),htmlFor:r,...t})},iN=({className:e,...t})=>{const{error:n,formItemId:r,formDescriptionId:o,formMessageId:i}=Md();return w.jsx(km,{id:r,"aria-describedby":n?`${o} ${i}`:`${o}`,"aria-invalid":!!n,className:me("group",e),...t})},sN=({className:e,...t})=>{const{formDescriptionId:n}=Md();return w.jsx("p",{id:n,className:me("text-sm text-muted-foreground",e),"data-slot":"form-description",...t})},aN=({className:e,children:t,...n})=>{const{error:r,formMessageId:o}=Md(),i=r?String(r?.message):t;return i?w.jsx("p",{id:o,className:me("text-sm font-medium text-error",e),"data-slot":"form-message",...n,children:i}):null},$T=(e,t,n)=>{if(e&&"reportValidity"in e){const r=Te(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},Ob=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?$T(r.ref,n,e):r&&r.refs&&r.refs.forEach(o=>$T(o,n,e))}},DT=(e,t)=>{t.shouldUseNativeValidation&&Ob(e,t);const n={};for(const r in e){const o=Te(t.fields,r),i=Object.assign(e[r]||{},{ref:o&&o.ref});if(bie(t.names||Object.keys(e),r)){const s=Object.assign({},Te(n,r));Ct(s,"root",i),Ct(n,r,s)}else Ct(n,r,i)}return n},bie=(e,t)=>{const n=MT(t);return e.some(r=>MT(r).match(`^${n}\\.\\d+`))};function MT(e){return e.replace(/\]|\[/g,"")}function lN(e,t,n){function r(a,u){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:u,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,u);const c=s.prototype,f=Object.keys(c);for(let p=0;p<f.length;p++){const m=f[p];m in a||(a[m]=c[m].bind(a))}}const o=n?.Parent??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function s(a){var u;const c=n?.Parent?new i:this;r(c,a),(u=c._zod).deferred??(u.deferred=[]);for(const f of c._zod.deferred)f();return c}return Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}class yie extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const xie={};function uN(e){return xie}function wie(e,t){return typeof t=="bigint"?t.toString():t}const cN="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function mp(e){return typeof e=="string"?e:e?.message}function dN(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const o=mp(e.inst?._zod.def?.error?.(e))??mp(t?.error?.(e))??mp(n.customError?.(e))??mp(n.localeError?.(e))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}const fN=(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,wie,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Eie=lN("$ZodError",fN),pN=lN("$ZodError",fN,{Parent:Error}),Cie=e=>(t,n,r,o)=>{const i=r?Object.assign(r,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new yie;if(s.issues.length){const a=new(o?.Err??e)(s.issues.map(u=>dN(u,i,uN())));throw cN(a,o?.callee),a}return s.value},Rie=Cie(pN),Sie=e=>async(t,n,r,o)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){const a=new(o?.Err??e)(s.issues.map(u=>dN(u,i,uN())));throw cN(a,o?.callee),a}return s.value},Pie=Sie(pN);function AT(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}function Tie(e,t){for(var n={};e.length;){var r=e[0],o=r.code,i=r.message,s=r.path.join(".");if(!n[s])if("unionErrors"in r){var a=r.unionErrors[0].errors[0];n[s]={message:a.message,type:a.code}}else n[s]={message:i,type:o};if("unionErrors"in r&&r.unionErrors.forEach(function(f){return f.errors.forEach(function(p){return e.push(p)})}),t){var u=n[s].types,c=u&&u[r.code];n[s]=Lx(s,t,n,o,c?[].concat(c,r.message):r.message)}e.shift()}return n}function _ie(e,t){for(var n={};e.length;){var r=e[0],o=r.code,i=r.message,s=r.path.join(".");if(!n[s])if(r.code==="invalid_union"&&r.errors.length>0){var a=r.errors[0][0];n[s]={message:a.message,type:a.code}}else n[s]={message:i,type:o};if(r.code==="invalid_union"&&r.errors.forEach(function(f){return f.forEach(function(p){return e.push(p)})}),t){var u=n[s].types,c=u&&u[r.code];n[s]=Lx(s,t,n,o,c?[].concat(c,r.message):r.message)}e.shift()}return n}function Oie(e,t,n){if(n===void 0&&(n={}),(function(r){return"_def"in r&&typeof r._def=="object"&&"typeName"in r._def})(e))return function(r,o,i){try{return Promise.resolve(AT(function(){return Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(s){return i.shouldUseNativeValidation&&Ob({},i),{errors:{},values:n.raw?Object.assign({},r):s}})},function(s){if((function(a){return Array.isArray(a?.issues)})(s))return{values:{},errors:DT(Tie(s.errors,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw s}))}catch(s){return Promise.reject(s)}};if((function(r){return"_zod"in r&&typeof r._zod=="object"})(e))return function(r,o,i){try{return Promise.resolve(AT(function(){return Promise.resolve((n.mode==="sync"?Rie:Pie)(e,r,t)).then(function(s){return i.shouldUseNativeValidation&&Ob({},i),{errors:{},values:n.raw?Object.assign({},r):s}})},function(s){if((function(a){return a instanceof Eie})(s))return{values:{},errors:DT(_ie(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 $ie(e,t){return die({...t,resolver:Oie(e)})}const Jm=h.createContext(void 0);process.env.NODE_ENV!=="production"&&(Jm.displayName="ToastContext");function eh(){const e=h.useContext(Jm);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: useToastManager must be used within <Toast.Provider>.":zt(73));return e}let NT=0;function mN(e){return NT+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${NT}`}function Tv(e,t){if(typeof e=="string")return{description:e};if(typeof e=="function"){const n=e(t);return typeof n=="string"?{description:n}:n}return e}const hp=W9(e=>e.toasts,e=>{const t=new Map;let n=0,r=0;return e.forEach((o,i)=>{const s=o.transitionStatus==="ending";t.set(o.id,{value:o,domIndex:i,visibleIndex:s?-1:n,offsetY:r}),r+=o.height||0,s||(n+=1)}),t}),no={toasts:je(e=>e.toasts),isEmpty:je(e=>e.toasts.length===0),toast:je(hp,(e,t)=>e.get(t)?.value),toastIndex:je(hp,(e,t)=>e.get(t)?.domIndex??-1),toastOffsetY:je(hp,(e,t)=>e.get(t)?.offsetY??0),toastVisibleIndex:je(hp,(e,t)=>e.get(t)?.visibleIndex??-1),hovering:je(e=>e.hovering),focused:je(e=>e.focused),expanded:je(e=>e.hovering||e.focused),expandedOrOutOfFocus:je(e=>e.hovering||e.focused||!e.isWindowFocused),prevFocusElement:je(e=>e.prevFocusElement)};class Die extends Mm{timers=new Map;areTimersPaused=!1;constructor(t){super(t,{},no)}setFocused(t){this.set("focused",t)}setHovering(t){this.set("hovering",t)}setIsWindowFocused(t){this.set("isWindowFocused",t)}setPrevFocusElement(t){this.set("prevFocusElement",t)}setViewport=t=>{this.set("viewport",t)};disposeEffect=()=>()=>{this.timers.forEach(t=>{t.timeout?.clear()}),this.timers.clear()};removeToast(t,n={}){const r=no.toastIndex(this.state,t);if(r===-1)return;const o=this.state.toasts[r];n.skipOnRemove||o?.onRemove?.();const i=[...this.state.toasts];i.splice(r,1),this.setToasts(i)}addToast=t=>{const{timeout:n,limit:r}=this.state,o=t.id||mN("toast");if(t.id){const c=no.toast(this.state,t.id);if(c)if(c.transitionStatus==="ending")this.removeToast(t.id,{skipOnRemove:!0});else{const{id:f,transitionStatus:p,...m}=t;return this.updateToastInternal(t.id,m,{resetTimer:!0,markUpdated:!0}),t.id}}const i={...t,id:o,updateKey:0,transitionStatus:"starting"},s=[i,...this.state.toasts],a=s.filter(c=>c.transitionStatus!=="ending");if(a.length>r){const c=a.length-r,f=a.slice(-c),p=new Set(f.map(m=>m.id));this.setToasts(s.map(m=>{const b=p.has(m.id);return m.limited!==b?{...m,limited:b}:m}))}else this.setToasts(s.map(c=>c.limited?{...c,limited:!1}:c));const u=i.timeout??n;return i.type!=="loading"&&u>0&&this.scheduleTimer(o,u,()=>this.closeToast(o)),no.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),o};updateToast=(t,n)=>{this.updateToastInternal(t,n,{markUpdated:!0})};updateToastInternal=(t,n,r={})=>{const{timeout:o,toasts:i}=this.state,s=no.toast(this.state,t)??null;if(!s||s.transitionStatus==="ending")return;const a={...s,...n,...r.markUpdated&&{updateKey:(s.updateKey??0)+1}};this.setToasts(i.map(v=>v.id===t?a:v));const u=a.timeout??o,c=s?.timeout??o,f=Object.hasOwn(n,"timeout"),p=a.transitionStatus!=="ending"&&a.type!=="loading"&&u>0,m=this.timers.has(t),b=c!==u,y=s?.type==="loading";if(!p&&m){this.timers.get(t)?.timeout?.clear(),this.timers.delete(t);return}if(p&&(!m||b||f||y||r.resetTimer)){const v=this.timers.get(t);v&&(v.timeout?.clear(),this.timers.delete(t)),this.scheduleTimer(t,u,()=>this.closeToast(t)),no.expandedOrOutOfFocus(this.state)&&this.pauseTimers()}};closeToast=t=>{const n=t===void 0,{limit:r,toasts:o}=this.state;let i;if(n)i=o,this.timers.forEach(c=>{c.timeout?.clear()}),this.timers.clear();else{const c=no.toast(this.state,t);if(!c)return;i=[c];const f=this.timers.get(t);f?.timeout&&(f.timeout.clear(),this.timers.delete(t))}let s=0;const u={toasts:o.map(c=>{if(n||c.id===t)return{...c,transitionStatus:"ending",height:0};if(c.transitionStatus==="ending")return c;const f=s>=r;return s+=1,c.limited!==f?{...c,limited:f}:c})};(n||o.length===1)&&(u.hovering=!1,u.focused=!1),this.update(u),i.forEach(c=>{c.transitionStatus!=="ending"&&c.onClose?.()}),this.handleFocusManagement(t)};promiseToast=(t,n)=>{const r=Tv(n.loading),o=this.addToast({...r,type:"loading"}),i=t.then(s=>{const a=Tv(n.success,s);return this.updateToast(o,{...a,type:"success",timeout:a.timeout}),s}).catch(s=>{const a=Tv(n.error,s);return this.updateToast(o,{...a,type:"error",timeout:a.timeout}),Promise.reject(s)});return{}.hasOwnProperty.call(n,"setPromise")&&n.setPromise(i),i};pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(t=>{if(t.timeout){t.timeout.clear();const n=Date.now()-t.start,r=t.delay-n;t.remaining=r>0?r:0}}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((t,n)=>{t.remaining=t.remaining>0?t.remaining:t.delay,t.timeout??=fr.create(),t.timeout.start(t.remaining,()=>{this.timers.delete(n),t.callback()}),t.start=Date.now()}))}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=t=>{if(t.pointerType!=="touch")return;const n=nn(t);Ke(this.state.viewport,n)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))};scheduleTimer(t,n,r){const o=Date.now(),i=!no.expandedOrOutOfFocus(this.state),s=i?fr.create():void 0;s?.start(n,()=>{this.timers.delete(t),r()}),this.timers.set(t,{timeout:s,start:i?o:0,delay:n,remaining:n,callback:r})}setToasts(t){const n={toasts:t};t.length===0&&(n.hovering=!1,n.focused=!1),this.update(n)}handleFocusManagement(t){const n=Zn(ct(this.state.viewport));if(!this.state.viewport||!Ke(this.state.viewport,n)||!Ip(n))return;if(t===void 0){this.restoreFocusToPrevElement();return}const r=no.toasts(this.state),o=no.toastIndex(this.state,t);let i=null,s=o+1;for(;s<r.length;){if(r[s].transitionStatus!=="ending"){i=r[s];break}s+=1}if(!i)for(s=o-1;s>=0;){if(r[s].transitionStatus!=="ending"){i=r[s];break}s-=1}i?i.ref?.current?.focus():this.restoreFocusToPrevElement()}}const Bx=function(t){const{children:n,timeout:r=5e3,limit:o=3,toastManager:i}=t,s=Hn(()=>new Die({timeout:r,limit:o,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return Rm(s.disposeEffect),h.useEffect(function(){return i?i[" subscribe"](({action:c,options:f})=>{const p=f.id;c==="promise"&&f.promise?s.promiseToast(f.promise,f):c==="update"&&p?s.updateToast(p,f):c==="close"?s.closeToast(p):s.addToast(f)}):void 0},[s,r,i]),s.useSyncedValues({timeout:r,limit:o}),w.jsx(Jm.Provider,{value:s,children:n})};process.env.NODE_ENV!=="production"&&(Bx.displayName="ToastProvider");let Mie=(function(e){return e.frontmostHeight="--toast-frontmost-height",e})({});const Vx=h.forwardRef(function(t,n){const{render:r,className:o,style:i,children:s,...a}=t,u=eh(),c=po(),f=h.useRef(!1),p=h.useRef(!1),m=h.useRef(!1),b=u.useState("isEmpty"),y=u.useState("toasts"),v=u.useState("focused"),E=u.useState("expanded"),x=u.useState("prevFocusElement"),R=y[0]?.height??0,P=h.useMemo(()=>y.some(k=>k.transitionStatus==="ending"),[y]);h.useEffect(()=>{const k=u.state.viewport;if(!k)return;function q(W){b||W.key==="F6"&&nn(W)!==k&&(W.preventDefault(),u.setPrevFocusElement(Zn(ct(k))),k?.focus({preventScroll:!0}),u.pauseTimers(),u.setFocused(!0))}const z=Vt(k);return Ge(z,"keydown",q)},[u,b]),h.useEffect(()=>{const k=u.state.viewport;if(!k||b)return;const q=Vt(k);function z(te){nn(te)===q&&(u.setIsWindowFocused(!1),u.pauseTimers())}function W(te){if(te.relatedTarget)return;const X=nn(te),Q=Zn(ct(k));(X===q||!Ke(k,X)||!Ip(Q))&&u.resumeTimers(),c.start(0,()=>u.setIsWindowFocused(!0))}return zr(Ge(q,"blur",z,!0),Ge(q,"focus",W,!0))},[u,c,b]),h.useEffect(()=>{const k=u.state.viewport;if(!k||b)return;const q=ct(k);return Ge(q,"pointerdown",u.handleDocumentPointerDown,!0)},[b,u]);function O(k){const q=u.state.viewport;q&&(f.current=!0,k.relatedTarget===q?y[0]?.ref?.current?.focus():u.restoreFocusToPrevElement())}function S(k){k.key==="Tab"&&k.shiftKey&&nn(k.nativeEvent)===u.state.viewport&&(k.preventDefault(),u.restoreFocusToPrevElement(),u.resumeTimers())}function T(){const k=u.state.toasts.some(q=>q.transitionStatus==="ending");!u.state.isWindowFocused||k||m.current||!p.current||(u.resumeTimers(),u.setHovering(!1),p.current=!1)}h.useEffect(T,[P,u]);function _(){u.pauseTimers(),u.setHovering(!0),p.current=!1}function $(){P||m.current?p.current=!0:(u.resumeTimers(),u.setHovering(!1))}function V(k){k.pointerType==="touch"&&(m.current=!0)}function U(k){k.pointerType==="touch"&&(m.current=!1,T())}function A(){if(f.current){f.current=!1;return}v||Ip(Zn(ct(u.state.viewport)))&&(u.setFocused(!0),u.pauseTimers())}function H(k){!v||Ke(u.state.viewport,k.relatedTarget)||(u.setFocused(!1),u.resumeTimers())}const F={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:_,onMouseMove:_,onMouseLeave:$,onFocus:A,onBlur:H,onKeyDown:S,onClick:A,onPointerDown:V,onPointerUp:U,onPointerCancel:U},N={expanded:E},j=lt("div",t,{ref:[n,u.setViewport],state:N,props:[F,{style:{[Mie.frontmostHeight]:R?`${R}px`:void 0}},a,{children:w.jsxs(h.Fragment,{children:[!b&&x&&w.jsx(Ei,{onFocus:O}),s,!b&&x&&w.jsx(Ei,{onFocus:O})]})}]}),I=h.useMemo(()=>y.filter(k=>k.priority==="high"),[y]);return w.jsxs(h.Fragment,{children:[!b&&x&&w.jsx(Ei,{onFocus:O}),j,!v&&I.length>0&&w.jsx("div",{style:pd,children:I.map(k=>w.jsxs("div",{role:"alert","aria-atomic":!0,children:[w.jsx("div",{children:k.title}),w.jsx("div",{children:k.description})]},k.id))})]})});process.env.NODE_ENV!=="production"&&(Vx.displayName="ToastViewport");const Kx=h.createContext(void 0);process.env.NODE_ENV!=="production"&&(Kx.displayName="ToastRootContext");function Ad(){const e=h.useContext(Kx);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ToastRootContext is missing. Toast parts must be used within <Toast.Root>.":zt(66));return e}let gi=(function(e){return e.index="--toast-index",e.offsetY="--toast-offset-y",e.height="--toast-height",e.swipeMovementX="--toast-swipe-movement-x",e.swipeMovementY="--toast-swipe-movement-y",e})({});const Aie={...xs,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},kc=40,Nie=10,fi=.5,Iie=1,kie=`${kV},${FV}`;function IT(e,t,n){switch(e){case"up":return-n;case"down":return n;case"left":return-t;case"right":return t;default:return 0}}function Fie(e){const n=Vt(e).getComputedStyle(e).transform;let r=0,o=0,i=1;if(n&&n!=="none"){const s=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(s){const a=s[1].split(", ").map(parseFloat);a.length===6?(r=a[4],o=a[5],i=Math.sqrt(a[0]*a[0]+a[1]*a[1])):a.length===16&&(r=a[12],o=a[13],i=a[0])}}return{x:r,y:o,scale:i}}const Hx=h.forwardRef(function(t,n){const{toast:r,render:o,className:i,swipeDirection:s=["down","right"],style:a,...u}=t,c=r.positionerProps?.anchor!==void 0;let f=[];c||(f=Array.isArray(s)?s:[s]);const p=f.length>0,m=eh(),[b,y]=h.useState(void 0),[v,E]=h.useState(!1),[x,R]=h.useState(!1),[P,O]=h.useState(!1),[S,T]=h.useState({x:0,y:0}),[_,$]=h.useState({x:0,y:0,scale:1}),[V,U]=h.useState(),[A,H]=h.useState(),[F,N]=h.useState(null),j=h.useRef(null),I=h.useRef({x:0,y:0}),k=h.useRef({x:0,y:0,scale:1}),q=h.useRef(void 0),z=h.useRef(0),W=h.useRef(!1),te=h.useRef({x:0,y:0}),X=h.useRef(!1),Q=m.useState("toastIndex",r.id),re=m.useState("toastVisibleIndex",r.id),ce=m.useState("toastOffsetY",r.id),se=m.useState("focused"),ee=m.useState("expanded");ma({open:r.transitionStatus!=="ending",ref:j,onComplete(){r.transitionStatus==="ending"&&m.removeToast(r.id)}});const de=He((J=!1)=>{const ie=j.current;if(!ie)return;const fe=ie.style.height;ie.style.height="auto";const pe=ie.offsetHeight;ie.style.height=fe;function ge(){m.updateToastInternal(r.id,{ref:j,height:pe,...r.transitionStatus==="starting"?{transitionStatus:void 0}:{}})}J?er.flushSync(ge):ge()});Le(de,[de]);function K(J,ie){let fe=J,pe=ie;return!f.includes("left")&&!f.includes("right")?fe=J>0?J**fi:-(Math.abs(J)**fi):(!f.includes("right")&&J>0&&(fe=J**fi),!f.includes("left")&&J<0&&(fe=-(Math.abs(J)**fi))),!f.includes("up")&&!f.includes("down")?pe=ie>0?ie**fi:-(Math.abs(ie)**fi):(!f.includes("down")&&ie>0&&(pe=ie**fi),!f.includes("up")&&ie<0&&(pe=-(Math.abs(ie)**fi))),{x:fe,y:pe}}function ue(J){if(J.button!==0)return;J.pointerType==="touch"&&m.pauseTimers();const ie=nn(J.nativeEvent);if(!(ie&&ie.closest(`button,a,input,textarea,[role="button"],${kie}`))){if(W.current=!1,q.current=void 0,z.current=0,I.current={x:J.clientX,y:J.clientY},te.current=I.current,j.current){const pe=Fie(j.current);k.current=pe,$(pe),T({x:pe.x,y:pe.y})}m.setHovering(!0),E(!0),R(!1),N(null),X.current=!0,j.current?.setPointerCapture(J.pointerId)}}function le(J){if(!v)return;J.preventDefault(),X.current&&(I.current={x:J.clientX,y:J.clientY},X.current=!1);const{clientY:ie,clientX:fe,movementX:pe,movementY:ge}=J;(ge<0&&ie>te.current.y||ge>0&&ie<te.current.y)&&(te.current={x:te.current.x,y:ie}),(pe<0&&fe>te.current.x||pe>0&&fe<te.current.x)&&(te.current={x:fe,y:te.current.y});const Ee=fe-I.current.x,Pe=ie-I.current.y,Ne=ie-te.current.y,st=fe-te.current.x;if(!x&&Math.sqrt(Ee*Ee+Pe*Pe)>=Iie&&(R(!0),F===null)){const un=f.includes("left")||f.includes("right"),mn=f.includes("up")||f.includes("down");if(un&&mn){const $n=Math.abs(Ee),nt=Math.abs(Pe);N($n>nt?"horizontal":"vertical")}}let ut;if(!q.current)F==="vertical"?Pe>0?ut="down":Pe<0&&(ut="up"):F==="horizontal"?Ee>0?ut="right":Ee<0&&(ut="left"):Math.abs(Ee)>=Math.abs(Pe)?ut=Ee>0?"right":"left":ut=Pe>0?"down":"up",ut&&f.includes(ut)&&(q.current=ut,z.current=IT(ut,Ee,Pe),y(ut));else{const Yt=q.current,un=IT(Yt,st,Ne);un>kc?(W.current=!1,y(Yt)):!(f.includes("left")&&f.includes("right"))&&!(f.includes("up")&&f.includes("down"))&&z.current-un>=Nie&&(W.current=!0)}const wt=K(Ee,Pe);let dt=k.current.x,Nt=k.current.y;F==="horizontal"?(f.includes("left")||f.includes("right"))&&(dt+=wt.x):(F==="vertical"||(f.includes("left")||f.includes("right"))&&(dt+=wt.x),(f.includes("up")||f.includes("down"))&&(Nt+=wt.y)),T({x:dt,y:Nt})}function Z(J){if(!v)return;if(E(!1),R(!1),N(null),j.current?.releasePointerCapture(J.pointerId),W.current){T({x:_.x,y:_.y}),y(void 0);return}let ie=!1;const fe=S.x-_.x,pe=S.y-_.y;let ge;for(const Ee of f){switch(Ee){case"right":fe>kc&&(ie=!0,ge="right");break;case"left":fe<-kc&&(ie=!0,ge="left");break;case"down":pe>kc&&(ie=!0,ge="down");break;case"up":pe<-kc&&(ie=!0,ge="up");break}if(ie)break}ie?(y(ge),O(!0),m.closeToast(r.id)):(T({x:_.x,y:_.y}),y(void 0))}function xe(){v&&(E(!1),R(!1),N(null),T({x:_.x,y:_.y}),y(void 0))}function Re(J){if(J.key==="Escape"){if(!j.current||!Ke(j.current,Zn(ct(j.current))))return;m.closeToast(r.id)}}h.useEffect(()=>{if(!p)return;const J=j.current;if(!J)return;function ie(fe){Ke(J,nn(fe))&&fe.preventDefault()}return Ge(J,"touchmove",ie,{passive:!1})},[p]);function Ae(){if(!v&&S.x===_.x&&S.y===_.y&&!P)return{[gi.swipeMovementX]:"0px",[gi.swipeMovementY]:"0px"};const J=S.x-_.x,ie=S.y-_.y;return{transition:v?"none":void 0,transform:v?`translateX(${S.x}px) translateY(${S.y}px) scale(${_.scale})`:void 0,[gi.swipeMovementX]:`${J}px`,[gi.swipeMovementY]:`${ie}px`}}const Se=r.priority==="high",Oe={role:Se?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":V,"aria-describedby":A,"aria-hidden":Se&&!se?!0:void 0,onPointerDown:p?ue:void 0,onPointerMove:p?le:void 0,onPointerUp:p?Z:void 0,onPointerCancel:p?xe:void 0,onKeyDown:Re,inert:Oy(r.limited),style:{...Ae(),[gi.index]:r.transitionStatus==="ending"?Q:re,[gi.offsetY]:`${ce}px`,[gi.height]:r.height?`${r.height}px`:void 0}},Ye=h.useMemo(()=>({rootRef:j,toast:r,titleId:V,setTitleId:U,descriptionId:A,setDescriptionId:H,swiping:v,swipeDirection:b,recalculateHeight:de,index:Q,visibleIndex:re,expanded:ee}),[r,V,A,v,b,de,Q,re,ee]),Fe={transitionStatus:r.transitionStatus,expanded:ee,limited:r.limited||!1,type:r.type,swiping:Ye.swiping,swipeDirection:Ye.swipeDirection},G=lt("div",t,{ref:[n,Ye.rootRef],state:Fe,stateAttributesMapping:Aie,props:[Oe,u]});return w.jsx(Kx.Provider,{value:Ye,children:G})});process.env.NODE_ENV!=="production"&&(Hx.displayName="ToastRoot");const Wx=h.forwardRef(function(t,n){const{render:r,className:o,style:i,...s}=t,{visibleIndex:a,expanded:u,recalculateHeight:c}=Ad(),f=h.useRef(null);Le(()=>{const y=f.current;if(!y||(c(),typeof ResizeObserver!="function"||typeof MutationObserver!="function"))return;const v=new ResizeObserver(()=>c(!0)),E=new MutationObserver(()=>c(!0));return v.observe(y),E.observe(y,{childList:!0,subtree:!0,characterData:!0}),()=>{v.disconnect(),E.disconnect()}},[c]);const p=a>0;return lt("div",t,{ref:[n,f],state:{expanded:u,behind:p},props:s})});process.env.NODE_ENV!=="production"&&(Wx.displayName="ToastContent");const Ux=h.forwardRef(function(t,n){const{render:r,className:o,style:i,id:s,children:a,...u}=t,{toast:c,setDescriptionId:f}=Ad(),p=a??c.description,m=!!p,b=ys(s);Le(()=>{if(m)return f(b),()=>{f(void 0)}},[m,b,f]);const y={type:c.type},v=lt("p",t,{ref:n,state:y,props:{...u,id:b,children:p}});return m?v:null});process.env.NODE_ENV!=="production"&&(Ux.displayName="ToastDescription");const zx=h.forwardRef(function(t,n){const{render:r,className:o,style:i,id:s,children:a,...u}=t,{toast:c,setTitleId:f}=Ad(),p=a??c.title,m=!!p,b=ys(s);Le(()=>{if(m)return f(b),()=>{f(void 0)}},[m,b,f]);const y={type:c.type},v=lt("h2",t,{ref:n,state:y,props:{...u,id:b,children:p}});return m?v:null});process.env.NODE_ENV!=="production"&&(zx.displayName="ToastTitle");const Gx=h.forwardRef(function(t,n){const{render:r,className:o,style:i,disabled:s,nativeButton:a=!0,...u}=t,c=eh(),{toast:f}=Ad(),p=c.useState("expanded"),[m,b]=h.useState(!1),{getButtonProps:y,buttonRef:v}=ga({disabled:s,native:a}),E={type:f.type};return lt("button",t,{ref:[n,v],state:E,props:[{"aria-hidden":!p&&!m,onClick(){c.closeToast(f.id)},onFocus(){b(!0)},onBlur(){b(!1)}},u,y]})});process.env.NODE_ENV!=="production"&&(Gx.displayName="ToastClose");const hN=h.forwardRef(function(t,n){const{render:r,className:o,style:i,disabled:s,nativeButton:a=!0,...u}=t,{toast:c}=Ad(),f=c.actionProps?.children??u.children,p=!!f,{getButtonProps:m,buttonRef:b}=ga({disabled:s,native:a}),y={type:c.type},v=lt("button",t,{ref:[n,b],state:y,props:[u,c.actionProps,m,{children:f}]});return p?v:null});process.env.NODE_ENV!=="production"&&(hN.displayName="ToastAction");const gN=Rx,Yx=h.createContext(void 0);process.env.NODE_ENV!=="production"&&(Yx.displayName="ToastPositionerContext");function Lie(){const e=h.useContext(Yx);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ToastPositionerContext is missing. ToastPositioner parts must be placed within <Toast.Positioner>.":zt(84));return e}const vN=h.forwardRef(function(t,n){const{toast:r,...o}=t,i=eh(),s=r.positionerProps??yn,{render:a,className:u,anchor:c=s.anchor,positionMethod:f=s.positionMethod??"absolute",side:p=s.side??"top",align:m=s.align??"center",sideOffset:b=s.sideOffset??0,alignOffset:y=s.alignOffset??0,collisionBoundary:v=s.collisionBoundary??"clipping-ancestors",collisionPadding:E=s.collisionPadding??5,arrowPadding:x=s.arrowPadding??5,sticky:R=s.sticky??!1,disableAnchorTracking:P=s.disableAnchorTracking??!1,collisionAvoidance:O=s.collisionAvoidance??q_,style:S,...T}=o,[_,$]=h.useState(null),V=i.useState("toastIndex",r.id),U=i.useState("toastVisibleIndex",r.id),A=et(c)?c:null,H=KO({open:!0,onOpenChange:At,elements:{floating:_,reference:A}}),F=CA({anchor:A,positionMethod:f,floatingRootContext:H,mounted:!0,side:p,sideOffset:b,align:m,alignOffset:y,collisionBoundary:v,collisionPadding:E,sticky:R,arrowPadding:x,disableAnchorTracking:P,keepMounted:!0,collisionAvoidance:O}),N=h.useMemo(()=>({side:F.side,align:F.align,anchorHidden:F.anchorHidden}),[F.side,F.align,F.anchorHidden]),j=SA(t,N,{styles:{...F.positionerStyles,[gi.index]:r.transitionStatus==="ending"?V:U},transitionStatus:r.transitionStatus,props:T,refs:[n,$]});return w.jsx(Yx.Provider,{value:F,children:j})});process.env.NODE_ENV!=="production"&&(vN.displayName="ToastPositioner");const bN=h.forwardRef(function(t,n){const{className:r,render:o,style:i,...s}=t,{arrowRef:a,side:u,align:c,arrowUncentered:f,arrowStyles:p}=Lie();return lt("div",t,{state:{side:u,align:c,uncentered:f},ref:[n,a],props:[{style:p,"aria-hidden":!0},s]})});process.env.NODE_ENV!=="production"&&(bN.displayName="ToastArrow");function Xx(){const e=h.useContext(Jm);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: useToastManager must be used within <Toast.Provider>.":zt(73));const t=e.useState("toasts");return h.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function yN(){const e=new Set;function t(n){e.forEach(r=>r(n))}return{" subscribe":function(r){return e.add(r),()=>{e.delete(r)}},add(n){const r=n.id||mN("toast"),o={...n,id:r,transitionStatus:"starting"};return t({action:"add",options:o}),r},close(n){t({action:"close",options:{id:n}})},update(n,r){t({action:"update",options:{...r,id:n}})},promise(n,r){let o=n;return t({action:"promise",options:{...r,promise:n,setPromise(i){o=i}}}),o}}}const qie=Object.freeze(Object.defineProperty({__proto__:null,Action:hN,Arrow:bN,Close:Gx,Content:Wx,Description:Ux,Portal:gN,Positioner:vN,Provider:Bx,Root:Hx,Title:zx,Viewport:Vx,createToastManager:yN,useToastManager:Xx},Symbol.toStringTag,{value:"Module"})),th={default:{icon:null,ringClass:"ring-input",titleClass:"",bgClass:""},success:{icon:cH,ringClass:"ring-success",titleClass:"text-success",bgClass:"bg-success/5"},error:{icon:fH,ringClass:"ring-error",titleClass:"text-error",bgClass:"bg-error/5"},warning:{icon:_H,ringClass:"ring-warning",titleClass:"text-warning",bgClass:"bg-warning/5"},info:{icon:D$,ringClass:"ring-info",titleClass:"text-info",bgClass:"bg-info/5"}};function xN({variant:e="default"}={}){return me("rounded-xl ring-1 bg-clip-padding p-4 shadow-lg bg-background",th[e].ringClass)}function Zx(e){return{...e,close:t=>e.close(t),add:t=>{if(t.id){const n=e.toasts;if(n){const r=n.find(o=>o.id===t.id);if(r&&r.transitionStatus!=="ending")return e.update(t.id,{bump:!1}),requestAnimationFrame(()=>{e.update(t.id,{bump:!0,...t.timeout!==void 0&&{timeout:t.timeout}})}),t.id;if(r&&r.transitionStatus==="ending")return t.id}}return e.add({...t})},update:(t,n)=>e.update(t,{...n}),promise:(t,n)=>e.promise(t,{loading:{...n.loading},success:typeof n.success=="function"?r=>({...n.success(r)}):{...n.success},error:typeof n.error=="function"?r=>({...n.error(r)}):{...n.error}})}}function wN(){const e=Xx();return{...Zx(e),toasts:e.toasts}}function jie(){return Zx(yN())}let vi=null;function Fc(e){return typeof e=="string"?{title:e}:e}const Bie=Object.assign(e=>vi?.add({...Fc(e)}),{success:e=>vi?.add({variant:"success",...Fc(e)}),error:e=>vi?.add({variant:"error",...Fc(e)}),warning:e=>vi?.add({variant:"warning",...Fc(e)}),info:e=>vi?.add({variant:"info",...Fc(e)}),promise:(e,t)=>vi?.promise(e,t)});function Vie(){const e=Xx();return vi=D.useMemo(()=>Zx(e),[e]),D.useEffect(()=>()=>{vi=null},[]),null}function EN({children:e,toastManager:t,container:n}){return w.jsxs(Bx,{toastManager:t,children:[w.jsx(Vie,{}),e,w.jsx(gN,{container:n,children:w.jsx(Vx,{className:"fixed top-auto right-4 bottom-4 z-50 mx-auto flex w-[calc(100%-2rem)] sm:right-8 sm:bottom-8 sm:w-[340px]",children:w.jsx(Kie,{})})})]})}function Kie(){const{toasts:e}=wN();return e.map(t=>w.jsxs(Hx,{toast:t,"data-slot":"toast",className:me("absolute right-0 bottom-0 left-auto z-[calc(1000-var(--toast-index))] mr-0 h-[var(--height)] w-full origin-bottom select-none",xN({variant:t.variant}),"[--gap:0.75rem] [--height:var(--toast-frontmost-height,var(--toast-height))] [--offset-y:calc(var(--toast-offset-y)*-1+calc(var(--toast-index)*var(--gap)*-1)+var(--toast-swipe-movement-y))] [--peek:0.75rem] [--scale:calc(max(0,1-(var(--toast-index)*0.1)))] [--shrink:calc(1-var(--scale))]","[transform:translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)-(var(--toast-index)*var(--peek))-(var(--shrink)*var(--height))))_scale(var(--scale))] [transition:transform_0.5s_cubic-bezier(0.22,1,0.36,1),opacity_0.5s,height_0.15s]","after:absolute after:top-full after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-['']","data-[ending-style]:opacity-0 data-[expanded]:h-[var(--toast-height)] data-[expanded]:[transform:translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--offset-y)))] data-[limited]:opacity-0 data-[starting-style]:[transform:translateY(150%)]","data-[ending-style]:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))] data-[expanded]:data-[ending-style]:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]","data-[ending-style]:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))] data-[expanded]:data-[ending-style]:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]","data-[ending-style]:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))] data-[expanded]:data-[ending-style]:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]","data-[ending-style]:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))] data-[expanded]:data-[ending-style]:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]","[&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:[transform:translateY(150%)]",t.bump&&"animate-toast-bump"),children:[w.jsx(Hie,{variant:t.variant}),w.jsxs(Wx,{className:"isolate flex flex-col gap-1 transition-opacity [transition-duration:250ms] data-[behind]:pointer-events-none data-[behind]:opacity-0 data-[expanded]:pointer-events-auto data-[expanded]:opacity-100",children:[t.content??w.jsxs("div",{className:"flex items-start gap-2",children:[w.jsx(Wie,{variant:t.variant}),w.jsxs("div",{className:"flex flex-col gap-1 overflow-hidden",children:[w.jsx(zx,{"data-slot":"toast-title",className:me("text-[0.975rem] leading-5 font-medium text-foreground",th[t.variant??"default"].titleClass)}),w.jsx(Ux,{"data-slot":"toast-description",className:"text-[0.925rem] leading-5 text-muted-foreground"}),!!t.actions?.length&&w.jsx("div",{className:"mt-2 flex min-w-0 flex-nowrap gap-2 overflow-x-auto p-px",children:t.actions.map((n,r)=>w.jsx(Tn,{...n},r))})]})]}),w.jsx(Gx,{className:"absolute top-2 right-2 flex h-4 w-4 items-center justify-center rounded border-none bg-transparent text-current/50 hover:bg-foreground/10 hover:text-current","aria-label":"Close",children:w.jsx(vd,{className:"h-3 w-3"})})]})]},t.id))}function Hie({variant:e}){const t=e?th[e].bgClass:"";return w.jsx("div",{className:me("absolute inset-0 rounded-[11px] bg-background/90",t)})}function Wie({variant:e}){if(!e||e==="default")return null;const{icon:t,titleClass:n}=th[e];return t?w.jsx(t,{"data-slot":"toast-icon",className:me("mt-0.5 h-4 w-4 shrink-0",n)}):null}function Uie({children:e,tooltipDelay:t,...n}){return w.jsx(_A,{delay:t,children:w.jsx(EN,{...n,children:e})})}const CN=({value:e,onChange:t,defaultValue:n="",...r})=>{const o=Im("Input",r),[i="",s]=Kt({prop:e,onChange:t,defaultProp:n}),a=u=>{s(u.target.value)};return w.jsx("input",{"data-slot":"input",autoComplete:"off",...o,value:i,onChange:a,className:me("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)})};function zie({className:e,...t}){return w.jsx("kbd",{className:me("pointer-events-none inline-flex h-5 min-w-5 select-none items-center justify-center gap-1 rounded bg-muted px-1 font-medium font-sans text-muted-foreground text-xs [&_svg:not([class*='size-'])]:size-3",e),"data-slot":"kbd",...t})}function Gie({className:e,...t}){return w.jsx("kbd",{className:me("inline-flex items-center gap-1",e),"data-slot":"kbd-group",...t})}const Yie=Oi("animate-spin",{variants:{variant:{primary:"text-primary",secondary:"text-secondary",ghost:"text-muted-foreground",error:"text-error",success:"text-success",warning:"text-warning",info:"text-info"},size:{xs:"size-3",sm:"size-4",default:"size-7",lg:"size-10",xl:"size-14"}},defaultVariants:{variant:"primary",size:"default"}}),Xie=({center:e,containerClassName:t,variant:n,size:r,...o})=>w.jsx("div",{className:me(t,e&&"fixed inset-0 grid place-items-center"),"data-slot":"loader",children:w.jsx(nb,{"data-slot":"loader-icon",...o,className:me(Yie({variant:n,size:r}),o.className)})});function Zie(e){const[t=[],n]=D.useState(e);return[t,{insertAt:(m,b)=>{n((y=[])=>{const v=[...y];return v.splice(m,0,b),v})},removeAt:m=>{n((b=[])=>{const y=[...b];return y.splice(m,1),y})},updateAt:(m,b)=>{n((y=[])=>{const v=[...y];return v[m]=b,v})},clear:()=>n([]),reset:()=>n(e),push:m=>n((b=[])=>[...b,m]),set:m=>n(m),pop:()=>{n((m=[])=>{const b=[...m];return b.pop(),b})},update:(m,b)=>{n((y=[])=>{const v=[...y],E=_t.findIndex(v,m);return E===-1||(v[E]=_t.isFunction(b)?b(v[E]):b),v})}}]}function Qie({fn:e,dependencies:t=[],onError:n,onSuccess:r,onFinish:o}){const[i,s]=D.useState(!0),[a,u]=D.useState(null),[c,f]=D.useState(null),p=D.useCallback(()=>{s(!0),u(null),f(null),e().then(m=>{r?.(m),f(m)}).catch(m=>{n?.(m),u(m)}).finally(()=>{o?.(),s(!1)})},t);return D.useEffect(()=>{p()},[p]),{loading:i,error:a,data:c,refetch:p}}const Jie=(e,t=!0)=>{const n=D.useRef(null),r=o=>{n.current&&!n.current.contains(o.target)&&e()};return D.useEffect(()=>{if(t)return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r)}},[t]),n};function ese(){const[e,t]=D.useState(null),n=D.useCallback(async r=>{if(!navigator?.clipboard)return!1;try{return await navigator.clipboard.writeText(r),t(r),!0}catch(o){return console.error(o),t(null),!1}},[]);return[e,n]}function tse(e,t){const n=D.useRef(null);return D.useCallback((...r)=>{n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{e(...r)},t)},[e,t])}function nse(e,t){const[n,r]=D.useState(e);return D.useEffect(()=>{const o=setTimeout(()=>{r(e)},t);return()=>clearTimeout(o)},[e,t]),n}function rse(e=!1,t){const{onOpen:n,onClose:r}=t||{},[o,i]=D.useState(e),s=D.useCallback(()=>{i(c=>c||(n?.(),!0))},[n]),a=D.useCallback(()=>{i(c=>c&&(r?.(),!1))},[r]),u=D.useCallback(()=>{o?a():s()},[a,s,o]);return[o,{open:s,close:a,toggle:u}]}function ose(e){D.useEffect(()=>{typeof e=="string"&&e.trim().length>0&&(document.title=e.trim())},[e])}function RN(e,t,n){const r=D.useRef(null);return D.useEffect(()=>{const o=r.current??document;return o.addEventListener(e,t,n),()=>{o.removeEventListener(e,t,n)}},[e,t,n]),r}const ise=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")}},sse=(e,t)=>{const{mainKey:n,isShift:r,isCtrl:o,isAlt:i,isMeta:s}=ise(t);return e.key.toLowerCase()===n&&e.shiftKey===r&&e.ctrlKey===o&&e.altKey===i&&e.metaKey===s},ase=e=>e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable,lse=(e,t)=>t&&ase(e.target),use=(e,t,n,r,o)=>i=>{if(!o||lse(i,r))return;(Array.isArray(e)?e:[e]).some(u=>sse(i,u))&&(n&&i.preventDefault(),t(i))};function SN(e,t,n={}){const{eventName:r="keydown",preventDefault:o=!0,ignoreInputFields:i=!0,watch:s=!0}=n,a=D.useCallback(use(e,t,o,i,s),[e,t,o,i,s]);return RN(r,a)}function cse(e){const[t,n]=D.useState(!1),r=D.useRef(null);return D.useEffect(()=>{const o=a=>{n(!0),e?.onHoverStart?.(a)},i=a=>{n(!1),e?.onHoverEnd?.(a)},s=r.current;if(s)return s.addEventListener("mouseover",o),s.addEventListener("mouseout",i),()=>{s.removeEventListener("mouseover",o),s.removeEventListener("mouseout",i)}},[e]),{ref:r,isHovering:t}}function dse({onVisible:e,root:t=null,rootMargin:n="0px",threshold:r=0}={}){const[o,i]=D.useState(!1),s=D.useRef(null),a=D.useCallback(([u])=>{const c=u.isIntersecting;i(c)},[e]);return D.useEffect(()=>{if(s.current==null)return;const u=new IntersectionObserver(a,{root:t,rootMargin:n,threshold:r});return u.observe(s.current),()=>{s.current!=null&&u.unobserve(s.current)}},[s,t,n,r,a]),D.useEffect(()=>{o&&e?.()},[o]),{ref:s,isVisible:o}}function fse(e,t){const n=()=>{try{const a=localStorage.getItem(e);return a?JSON.parse(a):t!==void 0?t:void 0}catch(a){return console.error(`Error parsing localStorage key "${e}":`,a),t!==void 0?t:void 0}},[r,o]=D.useState(n);return D.useEffect(()=>{try{r!==void 0?localStorage.setItem(e,JSON.stringify(r)):localStorage.removeItem(e)}catch(a){console.error(`Error setting localStorage key "${e}":`,a)}},[e,r]),[r,a=>{o(a)},()=>{try{localStorage.removeItem(e),o(t!==void 0?t:void 0)}catch(a){console.error(`Error removing localStorage key "${e}":`,a)}}]}const pse=e=>{const[t,n]=D.useState(!1);return D.useEffect(()=>{const r=window.matchMedia(e),o=()=>n(r.matches);return o(),r.addEventListener("change",o),()=>{r.removeEventListener("change",o)}},[e]),t};function mse(e){_t.isFunction(e)||console.error(`useMemoizedFn expected parameter is a function, got ${typeof e}`);const t=D.useRef(e);t.current=D.useMemo(()=>e,[e]);const n=D.useRef(null);return n.current||(n.current=function(...r){return t.current.apply(this,r)}),n.current}const hse=e=>{const[t,n]=D.useState(!1),[r,o]=D.useState(null),[i,s]=D.useState(null);return{mutate:D.useCallback(async(...u)=>{n(!0),o(null),s(null);try{const c=await e.fn(...u);return e.onSuccess?.(c),s(c),c}catch(c){const f=c;throw e.onError?.(f),o(f),f}finally{e.onFinish?.(),n(!1)}},[e]),loading:t,error:r,data:i}};function gse(e){const[t,n]=D.useState(e),r=D.useCallback(()=>n(e),[e]),o=D.useCallback(i=>{n(s=>{if(_t.isFunction(i)){const a=i(s);return _t.isObject(a)?{...s,...a}:s}else if(_t.isObject(i))return{...s,...i};return s})},[]);return[t,o,r]}function Qx({totalItems:e,pageSize:t,initialCurrentPage:n=1,onChange:r}){const[o,i]=D.useState(n),s=Math.ceil(e/t),a=o===s,u=o===1,c=(o-1)*t+1,f=Math.min(o*t,e),p=()=>{if(a)return;const v=Math.min(o+1,s);y(v)},m=()=>{if(u)return;const v=Math.max(o-1,1);y(v)},b=v=>{if(v===1&&u||v===s&&a)return;const E=Math.max(1,v),x=Math.min(E,s);y(x)},y=v=>{i(v),r?.({currentPage:v,pageSize:t})};return{next:p,prev:m,goTo:b,currentPage:o,maxPage:s,isFirstPage:u,isLastPage:a,range:{start:c,end:f}}}function vse(e){const t=()=>document.getElementById(e),n=()=>{const o=document.createElement("div");return o.id=e,o},r=D.useMemo(()=>{const o=t();return o||n()},[e]);return D.useEffect(()=>(document.getElementById(e)||document.body.appendChild(r),()=>{const o=document.getElementById(e);o&&document.body.removeChild(o)}),[e,r]),{render:o=>Wr.createPortal(o,r)}}function bse({shouldPrevent:e,message:t="Es posible que no se guarden los cambios hayas hecho."}){const n=r=>{if(e)return r.preventDefault(),r.returnValue=t,t};D.useEffect(()=>(window.addEventListener("beforeunload",n),()=>window.removeEventListener("beforeunload",n)),[t,e])}const wi="...",PN=({siblingCount:e=1,...t})=>{const n=Qx(t),{currentPage:r,maxPage:o}=n,{totalItems:i,pageSize:s}=t,a=()=>{const p=2+3*e,m=1;if(p>=o)return _t.range(m,o+1);const b=Math.max(r-e,1),y=Math.min(r+e,o),v=b>2,E=y<o-2;if(v&&E){const x=_t.range(b,y+1);return[m,wi,...x,wi,o]}if(E)return[..._t.range(m,p+1),wi,o];if(v){const x=_t.range(o-p+1,o+1);return[m,wi,...x]}},u=D.useMemo(a,[i,s,r,e]);return{...n,paginationRange:u??[]}};function yse(e){const[t,n]=D.useState(new Set),r=D.useCallback(f=>t.has(f),[t]),o=D.useCallback(f=>{n(p=>new Set([...p,f]))},[]),i=D.useCallback(f=>{n(p=>{const m=new Set(p);return m.delete(f),m})},[]),s=D.useCallback(f=>{n(p=>{const m=new Set(p);return m.has(f)?m.delete(f):m.add(f),m})},[]),a=D.useCallback(f=>{n(new Set(f))},[]),u=D.useCallback(()=>{n(f=>f.size===e.length?new Set:new Set(e))},[e]),c=D.useCallback(()=>n(new Set),[]);return{isAllSelected:t.size===e.length,isSomeSelected:t.size>0&&t.size<e.length,isNoneSelected:t.size===0,isSelected:r,selected:[...t],setSelected:a,select:o,unselect:i,toggle:s,toggleAll:u,clear:c}}function xse(e,t){const[n,r]=D.useState(0),o=t??e.length,i=()=>{r(c=>c>=o-1?c:c+1)},s=()=>{r(c=>c<=0?c:c-1)},a=c=>{r(c)},u=c=>{const f=_t.findIndex(e,c);f!==-1&&a(f)};return{currentStepIndex:n,step:e[n],steps:e,isFirstStep:n===0,isLastStep:n===o-1,goTo:a,next:i,back:s,findAndGo:u}}function TN(e=!1){const[t,n]=D.useState(e);return[t,o=>{n(o===void 0?!t:o)}]}const wse=/input|select|textarea|button|object/,_N="a, input, select, textarea, button, object, [tabindex]";function Ese(e){return process.env.NODE_ENV==="test"?!1:e.style.display==="none"}function Cse(e){if(e.getAttribute("aria-hidden")||e.getAttribute("hidden")||e.getAttribute("type")==="hidden")return!1;let n=e;for(;n&&!(n===document.body||n.nodeType===11);){if(Ese(n))return!1;n=n.parentNode}return!0}function ON(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function $b(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(ON(e));return(wse.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&Cse(e)}function $N(e){const t=ON(e);return(Number.isNaN(t)||t>=0)&&$b(e)}function Rse(e){return Array.from(e.querySelectorAll(_N)).filter($N)}function Sse(e,t){const n=Rse(e);if(!n.length){t.preventDefault();return}const r=n[t.shiftKey?0:n.length-1],o=e.getRootNode();let i=r===o.activeElement||e===o.activeElement;const s=o.activeElement;if(s.tagName==="INPUT"&&s.getAttribute("type")==="radio"&&(i=n.filter(f=>f.getAttribute("type")==="radio"&&f.getAttribute("name")===s.getAttribute("name")).includes(r)),!i)return;t.preventDefault();const u=n[t.shiftKey?n.length-1:0];u&&u.focus()}function Pse(e=!0){const t=D.useRef(null),n=o=>{let i=o.querySelector("[data-autofocus]");if(!i){const s=Array.from(o.querySelectorAll(_N));i=s.find($N)||s.find($b)||null,!i&&$b(o)&&(i=o)}i&&i.focus({preventScroll:!0})},r=D.useCallback(o=>{e&&o!==null&&t.current!==o&&(o?(setTimeout(()=>{o.getRootNode()&&n(o)}),t.current=o):t.current=null)},[e]);return D.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>n(t.current));const o=i=>{i.key==="Tab"&&t.current&&Sse(t.current,i)};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[e]),r}function Tse(e){const t=_se(e),n=h.forwardRef((r,o)=>{const{children:i,...s}=r,a=h.Children.toArray(i),u=a.find($se);if(u){const c=u.props.children,f=a.map(p=>p===u?h.Children.count(c)>1?h.Children.only(null):h.isValidElement(c)?c.props.children:null:p);return w.jsx(t,{...s,ref:o,children:h.isValidElement(c)?h.cloneElement(c,void 0,f):null})}return w.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function _se(e){const t=h.forwardRef((n,r)=>{const{children:o,...i}=n;if(h.isValidElement(o)){const s=Mse(o),a=Dse(i,o.props);return o.type!==h.Fragment&&(a.ref=r?Ht(r,s):s),h.cloneElement(o,a)}return h.Children.count(o)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ose=Symbol("radix.slottable");function $se(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ose}function Dse(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const u=i(...a);return o(...a),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Mse(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ase=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Nse=Ase.reduce((e,t)=>{const n=Tse(`Primitive.${t}`),r=h.forwardRef((o,i)=>{const{asChild:s,...a}=o,u=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(u,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function kT(e){const t=Ise(e),n=h.forwardRef((r,o)=>{const{children:i,...s}=r,a=h.Children.toArray(i),u=a.find(Fse);if(u){const c=u.props.children,f=a.map(p=>p===u?h.Children.count(c)>1?h.Children.only(null):h.isValidElement(c)?c.props.children:null:p);return w.jsx(t,{...s,ref:o,children:h.isValidElement(c)?h.cloneElement(c,void 0,f):null})}return w.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function Ise(e){const t=h.forwardRef((n,r)=>{const{children:o,...i}=n;if(h.isValidElement(o)){const s=qse(o),a=Lse(i,o.props);return o.type!==h.Fragment&&(a.ref=r?Ht(r,s):s),h.cloneElement(o,a)}return h.Children.count(o)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var kse=Symbol("radix.slottable");function Fse(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===kse}function Lse(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const u=i(...a);return o(...a),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function qse(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Jx(e){const t=e+"CollectionProvider",[n,r]=Go(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=v=>{const{scope:E,children:x}=v,R=D.useRef(null),P=D.useRef(new Map).current;return w.jsx(o,{scope:E,itemMap:P,collectionRef:R,children:x})};s.displayName=t;const a=e+"CollectionSlot",u=kT(a),c=D.forwardRef((v,E)=>{const{scope:x,children:R}=v,P=i(a,x),O=it(E,P.collectionRef);return w.jsx(u,{ref:O,children:R})});c.displayName=a;const f=e+"CollectionItemSlot",p="data-radix-collection-item",m=kT(f),b=D.forwardRef((v,E)=>{const{scope:x,children:R,...P}=v,O=D.useRef(null),S=it(E,O),T=i(f,x);return D.useEffect(()=>(T.itemMap.set(O,{ref:O,...P}),()=>{T.itemMap.delete(O)})),w.jsx(m,{[p]:"",ref:S,children:R})});b.displayName=f;function y(v){const E=i(e+"CollectionConsumer",v);return D.useCallback(()=>{const R=E.collectionRef.current;if(!R)return[];const P=Array.from(R.querySelectorAll(`[${p}]`));return Array.from(E.itemMap.values()).sort((T,_)=>P.indexOf(T.ref.current)-P.indexOf(_.ref.current))},[E.collectionRef,E.itemMap])}return[{Provider:s,Slot:c,ItemSlot:b},y,r]}var jse=h.createContext(void 0);function ew(e){const t=h.useContext(jse);return e||t||"ltr"}function Bse(e){const t=Vse(e),n=h.forwardRef((r,o)=>{const{children:i,...s}=r,a=h.Children.toArray(i),u=a.find(Hse);if(u){const c=u.props.children,f=a.map(p=>p===u?h.Children.count(c)>1?h.Children.only(null):h.isValidElement(c)?c.props.children:null:p);return w.jsx(t,{...s,ref:o,children:h.isValidElement(c)?h.cloneElement(c,void 0,f):null})}return w.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function Vse(e){const t=h.forwardRef((n,r)=>{const{children:o,...i}=n;if(h.isValidElement(o)){const s=Use(o),a=Wse(i,o.props);return o.type!==h.Fragment&&(a.ref=r?Ht(r,s):s),h.cloneElement(o,a)}return h.Children.count(o)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Kse=Symbol("radix.slottable");function Hse(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Kse}function Wse(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const u=i(...a);return o(...a),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Use(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var zse=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Gse=zse.reduce((e,t)=>{const n=Bse(`Primitive.${t}`),r=h.forwardRef((o,i)=>{const{asChild:s,...a}=o,u=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(u,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Yse="Arrow",DN=h.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return w.jsx(Gse.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:w.jsx("polygon",{points:"0,0 30,0 15,10"})})});DN.displayName=Yse;var Xse=DN;function Zse(e){const t=Qse(e),n=h.forwardRef((r,o)=>{const{children:i,...s}=r,a=h.Children.toArray(i),u=a.find(eae);if(u){const c=u.props.children,f=a.map(p=>p===u?h.Children.count(c)>1?h.Children.only(null):h.isValidElement(c)?c.props.children:null:p);return w.jsx(t,{...s,ref:o,children:h.isValidElement(c)?h.cloneElement(c,void 0,f):null})}return w.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function Qse(e){const t=h.forwardRef((n,r)=>{const{children:o,...i}=n;if(h.isValidElement(o)){const s=nae(o),a=tae(i,o.props);return o.type!==h.Fragment&&(a.ref=r?Ht(r,s):s),h.cloneElement(o,a)}return h.Children.count(o)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Jse=Symbol("radix.slottable");function eae(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Jse}function tae(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const u=i(...a);return o(...a),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function nae(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var rae=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],MN=rae.reduce((e,t)=>{const n=Zse(`Primitive.${t}`),r=h.forwardRef((o,i)=>{const{asChild:s,...a}=o,u=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(u,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function oae(e){const[t,n]=h.useState(void 0);return xn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const u=i.borderBoxSize,c=Array.isArray(u)?u[0]:u;s=c.inlineSize,a=c.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var tw="Popper",[AN,Ca]=Go(tw),[iae,NN]=AN(tw),IN=e=>{const{__scopePopper:t,children:n}=e,[r,o]=h.useState(null);return w.jsx(iae,{scope:t,anchor:r,onAnchorChange:o,children:n})};IN.displayName=tw;var kN="PopperAnchor",FN=h.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=NN(kN,n),s=h.useRef(null),a=it(t,s),u=h.useRef(null);return h.useEffect(()=>{const c=u.current;u.current=r?.current||s.current,c!==u.current&&i.onAnchorChange(u.current)}),r?null:w.jsx(MN.div,{...o,ref:a})});FN.displayName=kN;var nw="PopperContent",[sae,aae]=AN(nw),LN=h.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:u=!0,collisionBoundary:c=[],collisionPadding:f=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:b="optimized",onPlaced:y,...v}=e,E=NN(nw,n),[x,R]=h.useState(null),P=it(t,ee=>R(ee)),[O,S]=h.useState(null),T=oae(O),_=T?.width??0,$=T?.height??0,V=r+(i!=="center"?"-"+i:""),U=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},A=Array.isArray(c)?c:[c],H=A.length>0,F={padding:U,boundary:A.filter(uae),altBoundary:H},{refs:N,floatingStyles:j,placement:I,isPositioned:k,middlewareData:q}=PO({strategy:"fixed",placement:V,whileElementsMounted:(...ee)=>Gv(...ee,{animationFrame:b==="always"}),elements:{reference:E.anchor},middleware:[TO({mainAxis:o+$,alignmentAxis:s}),u&&_O({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?OO():void 0,...F}),u&&$O({...F}),DO({...F,apply:({elements:ee,rects:de,availableWidth:K,availableHeight:ue})=>{const{width:le,height:Z}=de.reference,xe=ee.floating.style;xe.setProperty("--radix-popper-available-width",`${K}px`),xe.setProperty("--radix-popper-available-height",`${ue}px`),xe.setProperty("--radix-popper-anchor-width",`${le}px`),xe.setProperty("--radix-popper-anchor-height",`${Z}px`)}}),O&&S9({element:O,padding:a}),cae({arrowWidth:_,arrowHeight:$}),m&&MO({strategy:"referenceHidden",...F})]}),[z,W]=BN(I),te=_n(y);xn(()=>{k&&te?.()},[k,te]);const X=q.arrow?.x,Q=q.arrow?.y,re=q.arrow?.centerOffset!==0,[ce,se]=h.useState();return xn(()=>{x&&se(window.getComputedStyle(x).zIndex)},[x]),w.jsx("div",{ref:N.setFloating,"data-radix-popper-content-wrapper":"",style:{...j,transform:k?j.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ce,"--radix-popper-transform-origin":[q.transformOrigin?.x,q.transformOrigin?.y].join(" "),...q.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:w.jsx(sae,{scope:n,placedSide:z,onArrowChange:S,arrowX:X,arrowY:Q,shouldHideArrow:re,children:w.jsx(MN.div,{"data-side":z,"data-align":W,...v,ref:P,style:{...v.style,animation:k?void 0:"none"}})})})});LN.displayName=nw;var qN="PopperArrow",lae={top:"bottom",right:"left",bottom:"top",left:"right"},jN=h.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=aae(qN,r),s=lae[i.placedSide];return w.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:w.jsx(Xse,{...o,ref:n,style:{...o.style,display:"block"}})})});jN.displayName=qN;function uae(e){return e!==null}var cae=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,s=o.arrow?.centerOffset!==0,a=s?0:e.arrowWidth,u=s?0:e.arrowHeight,[c,f]=BN(n),p={start:"0%",center:"50%",end:"100%"}[f],m=(o.arrow?.x??0)+a/2,b=(o.arrow?.y??0)+u/2;let y="",v="";return c==="bottom"?(y=s?p:`${m}px`,v=`${-u}px`):c==="top"?(y=s?p:`${m}px`,v=`${r.floating.height+u}px`):c==="right"?(y=`${-u}px`,v=s?p:`${b}px`):c==="left"&&(y=`${r.floating.width+u}px`,v=s?p:`${b}px`),{data:{x:y,y:v}}}});function BN(e){const[t,n="center"]=e.split("-");return[t,n]}var nh=IN,rh=FN,rw=LN,ow=jN;function VN(e){const t=dae(e),n=h.forwardRef((r,o)=>{const{children:i,...s}=r,a=h.Children.toArray(i),u=a.find(pae);if(u){const c=u.props.children,f=a.map(p=>p===u?h.Children.count(c)>1?h.Children.only(null):h.isValidElement(c)?c.props.children:null:p);return w.jsx(t,{...s,ref:o,children:h.isValidElement(c)?h.cloneElement(c,void 0,f):null})}return w.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function dae(e){const t=h.forwardRef((n,r)=>{const{children:o,...i}=n;if(h.isValidElement(o)){const s=hae(o),a=mae(i,o.props);return o.type!==h.Fragment&&(a.ref=r?Ht(r,s):s),h.cloneElement(o,a)}return h.Children.count(o)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var fae=Symbol("radix.slottable");function pae(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===fae}function mae(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const u=i(...a);return o(...a),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function hae(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var gae=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Nd=gae.reduce((e,t)=>{const n=VN(`Primitive.${t}`),r=h.forwardRef((o,i)=>{const{asChild:s,...a}=o,u=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(u,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function vae(e,t){e&&er.flushSync(()=>e.dispatchEvent(t))}function bae(e){const t=yae(e),n=h.forwardRef((r,o)=>{const{children:i,...s}=r,a=h.Children.toArray(i),u=a.find(wae);if(u){const c=u.props.children,f=a.map(p=>p===u?h.Children.count(c)>1?h.Children.only(null):h.isValidElement(c)?c.props.children:null:p);return w.jsx(t,{...s,ref:o,children:h.isValidElement(c)?h.cloneElement(c,void 0,f):null})}return w.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function yae(e){const t=h.forwardRef((n,r)=>{const{children:o,...i}=n;if(h.isValidElement(o)){const s=Cae(o),a=Eae(i,o.props);return o.type!==h.Fragment&&(a.ref=r?Ht(r,s):s),h.cloneElement(o,a)}return h.Children.count(o)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var xae=Symbol("radix.slottable");function wae(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===xae}function Eae(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const u=i(...a);return o(...a),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Cae(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Rae=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],KN=Rae.reduce((e,t)=>{const n=bae(`Primitive.${t}`),r=h.forwardRef((o,i)=>{const{asChild:s,...a}=o,u=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(u,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),_v="rovingFocusGroup.onEntryFocus",Sae={bubbles:!1,cancelable:!0},Id="RovingFocusGroup",[Db,HN,Pae]=Jx(Id),[Tae,WN]=Go(Id,[Pae]),[_ae,Oae]=Tae(Id),UN=h.forwardRef((e,t)=>w.jsx(Db.Provider,{scope:e.__scopeRovingFocusGroup,children:w.jsx(Db.Slot,{scope:e.__scopeRovingFocusGroup,children:w.jsx($ae,{...e,ref:t})})}));UN.displayName=Id;var $ae=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:u,onEntryFocus:c,preventScrollOnEntryFocus:f=!1,...p}=e,m=h.useRef(null),b=it(t,m),y=ew(i),[v,E]=Kt({prop:s,defaultProp:a??null,onChange:u,caller:Id}),[x,R]=h.useState(!1),P=_n(c),O=HN(n),S=h.useRef(!1),[T,_]=h.useState(0);return h.useEffect(()=>{const $=m.current;if($)return $.addEventListener(_v,P),()=>$.removeEventListener(_v,P)},[P]),w.jsx(_ae,{scope:n,orientation:r,dir:y,loop:o,currentTabStopId:v,onItemFocus:h.useCallback($=>E($),[E]),onItemShiftTab:h.useCallback(()=>R(!0),[]),onFocusableItemAdd:h.useCallback(()=>_($=>$+1),[]),onFocusableItemRemove:h.useCallback(()=>_($=>$-1),[]),children:w.jsx(KN.div,{tabIndex:x||T===0?-1:0,"data-orientation":r,...p,ref:b,style:{outline:"none",...e.style},onMouseDown:Ie(e.onMouseDown,()=>{S.current=!0}),onFocus:Ie(e.onFocus,$=>{const V=!S.current;if($.target===$.currentTarget&&V&&!x){const U=new CustomEvent(_v,Sae);if($.currentTarget.dispatchEvent(U),!U.defaultPrevented){const A=O().filter(I=>I.focusable),H=A.find(I=>I.active),F=A.find(I=>I.id===v),j=[H,F,...A].filter(Boolean).map(I=>I.ref.current);YN(j,f)}}S.current=!1}),onBlur:Ie(e.onBlur,()=>R(!1))})})}),zN="RovingFocusGroupItem",GN=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,children:s,...a}=e,u=an(),c=i||u,f=Oae(zN,n),p=f.currentTabStopId===c,m=HN(n),{onFocusableItemAdd:b,onFocusableItemRemove:y,currentTabStopId:v}=f;return h.useEffect(()=>{if(r)return b(),()=>y()},[r,b,y]),w.jsx(Db.ItemSlot,{scope:n,id:c,focusable:r,active:o,children:w.jsx(KN.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...a,ref:t,onMouseDown:Ie(e.onMouseDown,E=>{r?f.onItemFocus(c):E.preventDefault()}),onFocus:Ie(e.onFocus,()=>f.onItemFocus(c)),onKeyDown:Ie(e.onKeyDown,E=>{if(E.key==="Tab"&&E.shiftKey){f.onItemShiftTab();return}if(E.target!==E.currentTarget)return;const x=Aae(E,f.orientation,f.dir);if(x!==void 0){if(E.metaKey||E.ctrlKey||E.altKey||E.shiftKey)return;E.preventDefault();let P=m().filter(O=>O.focusable).map(O=>O.ref.current);if(x==="last")P.reverse();else if(x==="prev"||x==="next"){x==="prev"&&P.reverse();const O=P.indexOf(E.currentTarget);P=f.loop?Nae(P,O+1):P.slice(O+1)}setTimeout(()=>YN(P))}}),children:typeof s=="function"?s({isCurrentTabStop:p,hasTabStop:v!=null}):s})})});GN.displayName=zN;var Dae={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Mae(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Aae(e,t,n){const r=Mae(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Dae[r]}function YN(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Nae(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Iae=UN,kae=GN,Mb=["Enter"," "],Fae=["ArrowDown","PageUp","Home"],XN=["ArrowUp","PageDown","End"],Lae=[...Fae,...XN],qae={ltr:[...Mb,"ArrowRight"],rtl:[...Mb,"ArrowLeft"]},jae={ltr:["ArrowLeft"],rtl:["ArrowRight"]},kd="Menu",[ad,Bae,Vae]=Jx(kd),[Rs,ZN]=Go(kd,[Vae,Ca,WN]),Fd=Ca(),QN=WN(),[JN,$i]=Rs(kd),[Kae,Ld]=Rs(kd),eI=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,a=Fd(t),[u,c]=h.useState(null),f=h.useRef(!1),p=_n(i),m=ew(o);return h.useEffect(()=>{const b=()=>{f.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>f.current=!1;return document.addEventListener("keydown",b,{capture:!0}),()=>{document.removeEventListener("keydown",b,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),w.jsx(nh,{...a,children:w.jsx(JN,{scope:t,open:n,onOpenChange:p,content:u,onContentChange:c,children:w.jsx(Kae,{scope:t,onClose:h.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:f,dir:m,modal:s,children:r})})})};eI.displayName=kd;var Hae="MenuAnchor",iw=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Fd(n);return w.jsx(rh,{...o,...r,ref:t})});iw.displayName=Hae;var sw="MenuPortal",[Wae,tI]=Rs(sw,{forceMount:void 0}),nI=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=$i(sw,t);return w.jsx(Wae,{scope:t,forceMount:n,children:w.jsx(Gr,{present:n||i.open,children:w.jsx(xd,{asChild:!0,container:o,children:r})})})};nI.displayName=sw;var Or="MenuContent",[Uae,aw]=Rs(Or),rI=h.forwardRef((e,t)=>{const n=tI(Or,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=$i(Or,e.__scopeMenu),s=Ld(Or,e.__scopeMenu);return w.jsx(ad.Provider,{scope:e.__scopeMenu,children:w.jsx(Gr,{present:r||i.open,children:w.jsx(ad.Slot,{scope:e.__scopeMenu,children:s.modal?w.jsx(zae,{...o,ref:t}):w.jsx(Gae,{...o,ref:t})})})})}),zae=h.forwardRef((e,t)=>{const n=$i(Or,e.__scopeMenu),r=h.useRef(null),o=it(t,r);return h.useEffect(()=>{const i=r.current;if(i)return Ed(i)},[]),w.jsx(lw,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ie(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Gae=h.forwardRef((e,t)=>{const n=$i(Or,e.__scopeMenu);return w.jsx(lw,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Yae=VN("MenuContent.ScrollLock"),lw=h.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:u,onEscapeKeyDown:c,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:b,disableOutsideScroll:y,...v}=e,E=$i(Or,n),x=Ld(Or,n),R=Fd(n),P=QN(n),O=Bae(n),[S,T]=h.useState(null),_=h.useRef(null),$=it(t,_,E.onContentChange),V=h.useRef(0),U=h.useRef(""),A=h.useRef(0),H=h.useRef(null),F=h.useRef("right"),N=h.useRef(0),j=y?ya:h.Fragment,I=y?{as:Yae,allowPinchZoom:!0}:void 0,k=z=>{const W=U.current+z,te=O().filter(ee=>!ee.disabled),X=document.activeElement,Q=te.find(ee=>ee.ref.current===X)?.textValue,re=te.map(ee=>ee.textValue),ce=ale(re,W,Q),se=te.find(ee=>ee.textValue===ce)?.ref.current;(function ee(de){U.current=de,window.clearTimeout(V.current),de!==""&&(V.current=window.setTimeout(()=>ee(""),1e3))})(W),se&&setTimeout(()=>se.focus())};h.useEffect(()=>()=>window.clearTimeout(V.current),[]),Fm();const q=h.useCallback(z=>F.current===H.current?.side&&ule(z,H.current?.area),[]);return w.jsx(Uae,{scope:n,searchRef:U,onItemEnter:h.useCallback(z=>{q(z)&&z.preventDefault()},[q]),onItemLeave:h.useCallback(z=>{q(z)||(_.current?.focus(),T(null))},[q]),onTriggerLeave:h.useCallback(z=>{q(z)&&z.preventDefault()},[q]),pointerGraceTimerRef:A,onPointerGraceIntentChange:h.useCallback(z=>{H.current=z},[]),children:w.jsx(j,{...I,children:w.jsx(yd,{asChild:!0,trapped:o,onMountAutoFocus:Ie(i,z=>{z.preventDefault(),_.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:w.jsx(bd,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:b,children:w.jsx(Iae,{asChild:!0,...P,dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:S,onCurrentTabStopIdChange:T,onEntryFocus:Ie(u,z=>{x.isUsingKeyboardRef.current||z.preventDefault()}),preventScrollOnEntryFocus:!0,children:w.jsx(rw,{role:"menu","aria-orientation":"vertical","data-state":xI(E.open),"data-radix-menu-content":"",dir:x.dir,...R,...v,ref:$,style:{outline:"none",...v.style},onKeyDown:Ie(v.onKeyDown,z=>{const te=z.target.closest("[data-radix-menu-content]")===z.currentTarget,X=z.ctrlKey||z.altKey||z.metaKey,Q=z.key.length===1;te&&(z.key==="Tab"&&z.preventDefault(),!X&&Q&&k(z.key));const re=_.current;if(z.target!==re||!Lae.includes(z.key))return;z.preventDefault();const se=O().filter(ee=>!ee.disabled).map(ee=>ee.ref.current);XN.includes(z.key)&&se.reverse(),ile(se)}),onBlur:Ie(e.onBlur,z=>{z.currentTarget.contains(z.target)||(window.clearTimeout(V.current),U.current="")}),onPointerMove:Ie(e.onPointerMove,ld(z=>{const W=z.target,te=N.current!==z.clientX;if(z.currentTarget.contains(W)&&te){const X=z.clientX>N.current?"right":"left";F.current=X,N.current=z.clientX}}))})})})})})})});rI.displayName=Or;var Xae="MenuGroup",uw=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return w.jsx(Nd.div,{role:"group",...r,ref:t})});uw.displayName=Xae;var Zae="MenuLabel",oI=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return w.jsx(Nd.div,{...r,ref:t})});oI.displayName=Zae;var lm="MenuItem",FT="menu.itemSelect",oh=h.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=h.useRef(null),s=Ld(lm,e.__scopeMenu),a=aw(lm,e.__scopeMenu),u=it(t,i),c=h.useRef(!1),f=()=>{const p=i.current;if(!n&&p){const m=new CustomEvent(FT,{bubbles:!0,cancelable:!0});p.addEventListener(FT,b=>r?.(b),{once:!0}),vae(p,m),m.defaultPrevented?c.current=!1:s.onClose()}};return w.jsx(iI,{...o,ref:u,disabled:n,onClick:Ie(e.onClick,f),onPointerDown:p=>{e.onPointerDown?.(p),c.current=!0},onPointerUp:Ie(e.onPointerUp,p=>{c.current||p.currentTarget?.click()}),onKeyDown:Ie(e.onKeyDown,p=>{const m=a.searchRef.current!=="";n||m&&p.key===" "||Mb.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});oh.displayName=lm;var iI=h.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=aw(lm,n),a=QN(n),u=h.useRef(null),c=it(t,u),[f,p]=h.useState(!1),[m,b]=h.useState("");return h.useEffect(()=>{const y=u.current;y&&b((y.textContent??"").trim())},[i.children]),w.jsx(ad.ItemSlot,{scope:n,disabled:r,textValue:o??m,children:w.jsx(kae,{asChild:!0,...a,focusable:!r,children:w.jsx(Nd.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:c,onPointerMove:Ie(e.onPointerMove,ld(y=>{r?s.onItemLeave(y):(s.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ie(e.onPointerLeave,ld(y=>s.onItemLeave(y))),onFocus:Ie(e.onFocus,()=>p(!0)),onBlur:Ie(e.onBlur,()=>p(!1))})})})}),Qae="MenuCheckboxItem",sI=h.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return w.jsx(dI,{scope:e.__scopeMenu,checked:n,children:w.jsx(oh,{role:"menuitemcheckbox","aria-checked":um(n)?"mixed":n,...o,ref:t,"data-state":fw(n),onSelect:Ie(o.onSelect,()=>r?.(um(n)?!0:!n),{checkForDefaultPrevented:!1})})})});sI.displayName=Qae;var aI="MenuRadioGroup",[Jae,ele]=Rs(aI,{value:void 0,onValueChange:()=>{}}),lI=h.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=_n(r);return w.jsx(Jae,{scope:e.__scopeMenu,value:n,onValueChange:i,children:w.jsx(uw,{...o,ref:t})})});lI.displayName=aI;var uI="MenuRadioItem",cI=h.forwardRef((e,t)=>{const{value:n,...r}=e,o=ele(uI,e.__scopeMenu),i=n===o.value;return w.jsx(dI,{scope:e.__scopeMenu,checked:i,children:w.jsx(oh,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":fw(i),onSelect:Ie(r.onSelect,()=>o.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});cI.displayName=uI;var cw="MenuItemIndicator",[dI,tle]=Rs(cw,{checked:!1}),fI=h.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=tle(cw,n);return w.jsx(Gr,{present:r||um(i.checked)||i.checked===!0,children:w.jsx(Nd.span,{...o,ref:t,"data-state":fw(i.checked)})})});fI.displayName=cw;var nle="MenuSeparator",pI=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return w.jsx(Nd.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});pI.displayName=nle;var rle="MenuArrow",mI=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Fd(n);return w.jsx(ow,{...o,...r,ref:t})});mI.displayName=rle;var dw="MenuSub",[ole,hI]=Rs(dw),gI=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:o}=e,i=$i(dw,t),s=Fd(t),[a,u]=h.useState(null),[c,f]=h.useState(null),p=_n(o);return h.useEffect(()=>(i.open===!1&&p(!1),()=>p(!1)),[i.open,p]),w.jsx(nh,{...s,children:w.jsx(JN,{scope:t,open:r,onOpenChange:p,content:c,onContentChange:f,children:w.jsx(ole,{scope:t,contentId:an(),triggerId:an(),trigger:a,onTriggerChange:u,children:n})})})};gI.displayName=dw;var Vc="MenuSubTrigger",vI=h.forwardRef((e,t)=>{const n=$i(Vc,e.__scopeMenu),r=Ld(Vc,e.__scopeMenu),o=hI(Vc,e.__scopeMenu),i=aw(Vc,e.__scopeMenu),s=h.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:u}=i,c={__scopeMenu:e.__scopeMenu},f=h.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return h.useEffect(()=>f,[f]),h.useEffect(()=>{const p=a.current;return()=>{window.clearTimeout(p),u(null)}},[a,u]),w.jsx(iw,{asChild:!0,...c,children:w.jsx(iI,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":xI(n.open),...e,ref:Ht(t,o.onTriggerChange),onClick:p=>{e.onClick?.(p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ie(e.onPointerMove,ld(p=>{i.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:Ie(e.onPointerLeave,ld(p=>{f();const m=n.content?.getBoundingClientRect();if(m){const b=n.content?.dataset.side,y=b==="right",v=y?-5:5,E=m[y?"left":"right"],x=m[y?"right":"left"];i.onPointerGraceIntentChange({area:[{x:p.clientX+v,y:p.clientY},{x:E,y:m.top},{x,y:m.top},{x,y:m.bottom},{x:E,y:m.bottom}],side:b}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(p),p.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:Ie(e.onKeyDown,p=>{const m=i.searchRef.current!=="";e.disabled||m&&p.key===" "||qae[r.dir].includes(p.key)&&(n.onOpenChange(!0),n.content?.focus(),p.preventDefault())})})})});vI.displayName=Vc;var bI="MenuSubContent",yI=h.forwardRef((e,t)=>{const n=tI(Or,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=$i(Or,e.__scopeMenu),s=Ld(Or,e.__scopeMenu),a=hI(bI,e.__scopeMenu),u=h.useRef(null),c=it(t,u);return w.jsx(ad.Provider,{scope:e.__scopeMenu,children:w.jsx(Gr,{present:r||i.open,children:w.jsx(ad.Slot,{scope:e.__scopeMenu,children:w.jsx(lw,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:c,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{s.isUsingKeyboardRef.current&&u.current?.focus(),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:Ie(e.onFocusOutside,f=>{f.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Ie(e.onEscapeKeyDown,f=>{s.onClose(),f.preventDefault()}),onKeyDown:Ie(e.onKeyDown,f=>{const p=f.currentTarget.contains(f.target),m=jae[s.dir].includes(f.key);p&&m&&(i.onOpenChange(!1),a.trigger?.focus(),f.preventDefault())})})})})})});yI.displayName=bI;function xI(e){return e?"open":"closed"}function um(e){return e==="indeterminate"}function fw(e){return um(e)?"indeterminate":e?"checked":"unchecked"}function ile(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function sle(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function ale(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=sle(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const u=s.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function lle(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i],u=t[s],c=a.x,f=a.y,p=u.x,m=u.y;f>r!=m>r&&n<(p-c)*(r-f)/(m-f)+c&&(o=!o)}return o}function ule(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return lle(n,t)}function ld(e){return t=>t.pointerType==="mouse"?e(t):void 0}var cle=eI,dle=iw,fle=nI,ple=rI,mle=uw,hle=oI,gle=oh,vle=sI,ble=lI,yle=cI,xle=fI,wle=pI,Ele=mI,Cle=gI,Rle=vI,Sle=yI,ih="DropdownMenu",[Ple]=Go(ih,[ZN]),Fn=ZN(),[Tle,wI]=Ple(ih),EI=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,u=Fn(t),c=h.useRef(null),[f,p]=Kt({prop:o,defaultProp:i??!1,onChange:s,caller:ih});return w.jsx(Tle,{scope:t,triggerId:an(),triggerRef:c,contentId:an(),open:f,onOpenChange:p,onOpenToggle:h.useCallback(()=>p(m=>!m),[p]),modal:a,children:w.jsx(cle,{...u,open:f,onOpenChange:p,dir:r,modal:a,children:n})})};EI.displayName=ih;var CI="DropdownMenuTrigger",RI=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=wI(CI,n),s=Fn(n);return w.jsx(dle,{asChild:!0,...s,children:w.jsx(Nse.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":r?"":void 0,disabled:r,...o,ref:Ht(t,i.triggerRef),onPointerDown:Ie(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:Ie(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});RI.displayName=CI;var _le="DropdownMenuPortal",SI=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Fn(t);return w.jsx(fle,{...r,...n})};SI.displayName=_le;var PI="DropdownMenuContent",TI=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=wI(PI,n),i=Fn(n),s=h.useRef(!1);return w.jsx(ple,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...r,ref:t,onCloseAutoFocus:Ie(e.onCloseAutoFocus,a=>{s.current||o.triggerRef.current?.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:Ie(e.onInteractOutside,a=>{const u=a.detail.originalEvent,c=u.button===0&&u.ctrlKey===!0,f=u.button===2||c;(!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)"}})});TI.displayName=PI;var Ole="DropdownMenuGroup",_I=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Fn(n);return w.jsx(mle,{...o,...r,ref:t})});_I.displayName=Ole;var $le="DropdownMenuLabel",OI=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Fn(n);return w.jsx(hle,{...o,...r,ref:t})});OI.displayName=$le;var Dle="DropdownMenuItem",$I=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Fn(n);return w.jsx(gle,{...o,...r,ref:t})});$I.displayName=Dle;var Mle="DropdownMenuCheckboxItem",DI=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Fn(n);return w.jsx(vle,{...o,...r,ref:t})});DI.displayName=Mle;var Ale="DropdownMenuRadioGroup",MI=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Fn(n);return w.jsx(ble,{...o,...r,ref:t})});MI.displayName=Ale;var Nle="DropdownMenuRadioItem",AI=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Fn(n);return w.jsx(yle,{...o,...r,ref:t})});AI.displayName=Nle;var Ile="DropdownMenuItemIndicator",NI=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Fn(n);return w.jsx(xle,{...o,...r,ref:t})});NI.displayName=Ile;var kle="DropdownMenuSeparator",II=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Fn(n);return w.jsx(wle,{...o,...r,ref:t})});II.displayName=kle;var Fle="DropdownMenuArrow",Lle=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Fn(n);return w.jsx(Ele,{...o,...r,ref:t})});Lle.displayName=Fle;var qle=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:o,defaultOpen:i}=e,s=Fn(t),[a,u]=Kt({prop:r,defaultProp:i??!1,onChange:o,caller:"DropdownMenuSub"});return w.jsx(Cle,{...s,open:a,onOpenChange:u,children:n})},jle="DropdownMenuSubTrigger",kI=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Fn(n);return w.jsx(Rle,{...o,...r,ref:t})});kI.displayName=jle;var Ble="DropdownMenuSubContent",FI=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Fn(n);return w.jsx(Sle,{...o,...r,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)"}})});FI.displayName=Ble;var Vle=EI,Kle=RI,LI=SI,Hle=TI,Wle=_I,Ule=OI,zle=$I,Gle=DI,Yle=MI,Xle=AI,qI=NI,Zle=II,Qle=qle,Jle=kI,eue=FI;const jI=e=>w.jsx(Vle,{"data-slot":"menu",...e}),BI=e=>w.jsx(Kle,{"data-slot":"menu-trigger",...e}),tue=e=>w.jsx(Wle,{"data-slot":"menu-group",...e}),nue=e=>w.jsx(LI,{"data-slot":"menu-portal",...e}),VI=e=>w.jsx(Qle,{"data-slot":"menu-sub",...e}),rue=e=>w.jsx(Yle,{"data-slot":"menu-radio-group",...e}),KI=({className:e,inset:t,children:n,...r})=>w.jsxs(Jle,{"data-slot":"menu-sub-trigger",className:me("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),...r,children:[n,w.jsx(gd,{className:"ml-auto h-4 w-4"})]}),HI=({className:e,...t})=>w.jsx(eue,{"data-slot":"menu-sub-content",className:me("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}),WI=({className:e,sideOffset:t=4,...n})=>w.jsx(LI,{"data-slot":"menu-portal",children:w.jsx(Hle,{"data-slot":"menu-content",sideOffset:t,className:me("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),...n})}),UI=({className:e,inset:t,...n})=>w.jsx(zle,{"data-slot":"menu-item",className:me("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),...n}),zI=({className:e,children:t,checked:n,...r})=>w.jsxs(Gle,{"data-slot":"menu-checkbox-item",className:me("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:n,...r,children:[w.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:w.jsx(qI,{children:w.jsx(tb,{className:"h-4 w-4"})})}),t]}),GI=({className:e,children:t,...n})=>w.jsxs(Xle,{"data-slot":"menu-radio-item",className:me("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),...n,children:[w.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:w.jsx(qI,{children:w.jsx(mH,{className:"h-2 w-2 fill-current"})})}),t]}),YI=({className:e,inset:t,...n})=>w.jsx(Ule,{"data-slot":"menu-label",className:me("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}),XI=({className:e,...t})=>w.jsx(Zle,{"data-slot":"menu-separator",className:me("-mx-1 my-1 h-px bg-muted",e),...t}),ZI=({className:e,keys:t,handler:n,options:r={},...o})=>(SN(t,n,r),w.jsx("span",{"data-slot":"menu-shortcut",className:me("ml-auto text-xs tracking-widest opacity-60",e),...o})),QI=(e,t)=>{switch(e.type){case"item":return w.jsxs(UI,{...e,children:[e.label," ",t]});case"checkbox":return w.jsxs(zI,{...e,children:[e.label," ",t]});case"radio":return w.jsxs(GI,{...e,children:[e.label," ",t]});case"label":return w.jsxs(YI,{...e,children:[e.label," "]});case"separator":return w.jsx(XI,{...e});case"submenu":return w.jsxs(VI,{children:[w.jsx(KI,{...e,children:e.label}),w.jsx(HI,{children:e.items?.map((n,r)=>w.jsx(D.Fragment,{children:QI(n)},r))})]});default:return null}},oue=({trigger:e,items:t,contentProps:n,side:r="bottom",offset:o})=>w.jsxs(jI,{children:[w.jsx(BI,{asChild:!0,children:e}),w.jsx(WI,{side:r,sideOffset:o,...n,children:t.map(({shortcut:i,onShortcut:s,shortcutOptions:a,...u},c)=>w.jsx(D.Fragment,{children:QI(u,i&&w.jsx(ZI,{keys:i,handler:f=>s?.(f),options:a,children:i}))},c))})]}),JI=Oi("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"}}),Ab=({className:e,color:t,variant:n,rounded:r,icon:o,closable:i,onClose:s,children:a,...u})=>{const c=!!t&&(n==="outline"||n==="borderless"),f=!!t&&!n;return w.jsxs("div",{"data-slot":"tag",className:me(JI({variant:n,rounded:r}),c&&"bg-white",f&&" text-white",!!o&&"pl-1.5",!!i&&"pr-1.5",e),style:{...c&&{color:t,borderColor:t},...f&&{borderColor:t,backgroundColor:t}},...u,children:[o,a,i&&w.jsx("button",{type:"button","data-slot":"tag-close",className:"z-10 h-4 w-4 cursor-pointer",onClick:p=>{p.stopPropagation(),s()},children:w.jsx(vd,{"data-slot":"tag-close-icon"})}),w.jsx("span",{"data-slot":"tag-overlay",className:"w-full h-full absolute top-0 left-0",style:{...c&&{opacity:.13,backgroundColor:t}}})]})};function ek(e){const t=iue(e),n=h.forwardRef((r,o)=>{const{children:i,...s}=r,a=h.Children.toArray(i),u=a.find(aue);if(u){const c=u.props.children,f=a.map(p=>p===u?h.Children.count(c)>1?h.Children.only(null):h.isValidElement(c)?c.props.children:null:p);return w.jsx(t,{...s,ref:o,children:h.isValidElement(c)?h.cloneElement(c,void 0,f):null})}return w.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function iue(e){const t=h.forwardRef((n,r)=>{const{children:o,...i}=n;if(h.isValidElement(o)){const s=uue(o),a=lue(i,o.props);return o.type!==h.Fragment&&(a.ref=r?Ht(r,s):s),h.cloneElement(o,a)}return h.Children.count(o)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var sue=Symbol("radix.slottable");function aue(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===sue}function lue(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const u=i(...a);return o(...a),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function uue(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var cue=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],tk=cue.reduce((e,t)=>{const n=ek(`Primitive.${t}`),r=h.forwardRef((o,i)=>{const{asChild:s,...a}=o,u=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(u,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),sh="Popover",[nk]=Go(sh,[Ca]),qd=Ca(),[due,Di]=nk(sh),rk=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,a=qd(t),u=h.useRef(null),[c,f]=h.useState(!1),[p,m]=Kt({prop:r,defaultProp:o??!1,onChange:i,caller:sh});return w.jsx(nh,{...a,children:w.jsx(due,{scope:t,contentId:an(),triggerRef:u,open:p,onOpenChange:m,onOpenToggle:h.useCallback(()=>m(b=>!b),[m]),hasCustomAnchor:c,onCustomAnchorAdd:h.useCallback(()=>f(!0),[]),onCustomAnchorRemove:h.useCallback(()=>f(!1),[]),modal:s,children:n})})};rk.displayName=sh;var ok="PopoverAnchor",fue=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Di(ok,n),i=qd(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:a}=o;return h.useEffect(()=>(s(),()=>a()),[s,a]),w.jsx(rh,{...i,...r,ref:t})});fue.displayName=ok;var ik="PopoverTrigger",sk=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Di(ik,n),i=qd(n),s=it(t,o.triggerRef),a=w.jsx(tk.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":dk(o.open),...r,ref:s,onClick:Ie(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:w.jsx(rh,{asChild:!0,...i,children:a})});sk.displayName=ik;var pw="PopoverPortal",[pue,mue]=nk(pw,{forceMount:void 0}),ak=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=Di(pw,t);return w.jsx(pue,{scope:t,forceMount:n,children:w.jsx(Gr,{present:n||i.open,children:w.jsx(xd,{asChild:!0,container:o,children:r})})})};ak.displayName=pw;var da="PopoverContent",lk=h.forwardRef((e,t)=>{const n=mue(da,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=Di(da,e.__scopePopover);return w.jsx(Gr,{present:r||i.open,children:i.modal?w.jsx(gue,{...o,ref:t}):w.jsx(vue,{...o,ref:t})})});lk.displayName=da;var hue=ek("PopoverContent.RemoveScroll"),gue=h.forwardRef((e,t)=>{const n=Di(da,e.__scopePopover),r=h.useRef(null),o=it(t,r),i=h.useRef(!1);return h.useEffect(()=>{const s=r.current;if(s)return Ed(s)},[]),w.jsx(ya,{as:hue,allowPinchZoom:!0,children:w.jsx(uk,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ie(e.onCloseAutoFocus,s=>{s.preventDefault(),i.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Ie(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,u=a.button===0&&a.ctrlKey===!0,c=a.button===2||u;i.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Ie(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),vue=h.forwardRef((e,t)=>{const n=Di(da,e.__scopePopover),r=h.useRef(!1),o=h.useRef(!1);return w.jsx(uk,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(r.current||n.triggerRef.current?.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;n.triggerRef.current?.contains(s)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),uk=h.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:u,onFocusOutside:c,onInteractOutside:f,...p}=e,m=Di(da,n),b=qd(n);return Fm(),w.jsx(yd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:w.jsx(bd,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:f,onEscapeKeyDown:a,onPointerDownOutside:u,onFocusOutside:c,onDismiss:()=>m.onOpenChange(!1),children:w.jsx(rw,{"data-state":dk(m.open),role:"dialog",id:m.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)"}})})})}),ck="PopoverClose",bue=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Di(ck,n);return w.jsx(tk.button,{type:"button",...r,ref:t,onClick:Ie(e.onClick,()=>o.onOpenChange(!1))})});bue.displayName=ck;var yue="PopoverArrow",xue=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=qd(n);return w.jsx(ow,{...o,...r,ref:t})});xue.displayName=yue;function dk(e){return e?"open":"closed"}var wue=rk,Eue=sk,Cue=ak,Rue=lk;const jd=e=>w.jsx(wue,{"data-slot":"popover",...e}),Bd=e=>w.jsx(Eue,{"data-slot":"popover-trigger",...e}),Vd=({className:e,align:t="center",sideOffset:n=4,matchTriggerWidth:r=!1,style:o,focus:i=!0,...s})=>w.jsx(Cue,{children:w.jsx(Rue,{"data-slot":"popover-content",align:t,sideOffset:n,onOpenAutoFocus:a=>{!i&&a.preventDefault(),s?.onOpenAutoFocus?.(a)},className:me("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,...r&&{width:"var(--radix-popper-anchor-width)"}},...s})}),Sue=e=>{const{trigger:t,children:n,rootProps:r,triggerProps:o,contentProps:i,triggerAsChild:s=!0,matchTriggerWidth:a,triggerClassName:u,contentClassName:c,side:f="bottom",offset:p}=Im("Popover",e,{triggerAsChild:!0,side:"bottom"});return w.jsxs(jd,{...r,children:[w.jsx(Bd,{asChild:s,className:u,...o,children:t}),w.jsx(Vd,{className:c,matchTriggerWidth:a,side:f,sideOffset:p,...i,children:n})]})},LT=Oi("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"}}),Pue=({valueKey:e,values:t,setValues:n,items:r,maxCount:o,setIsPopoverOpen:i})=>{const s=m=>{if(m.key==="Enter")i(!0);else if(m.key==="Backspace"&&!m.currentTarget.value){const b=[...t];b.pop(),n?.(b)}},a=m=>{const b=t.includes(m)?t.filter(y=>y!==m):[...t,m];n?.(b)},u=()=>{n?.([])};return{handleInputKeyDown:s,toggleOption:a,handleClear:u,handleTogglePopover:()=>{i(m=>!m)},clearExtraOptions:()=>{const m=t.slice(0,o);n?.(m)},toggleAll:()=>{const m=r.filter(b=>!b.disabled);if(t.length===m.length)u();else{const b=m.map(y=>y[e]);n?.(b)}}}},Tue=({items:e=[],value:t,valueKey:n="value",labelKey:r="label",onChange:o,variant:i,defaultValue:s=[],placeholder:a="Seleccionar",maxCount:u=3,className:c,renderOption:f=E=>E[r],withCheckbox:p=!1,showSearch:m=!0,showSelectAll:b=!0,rootProps:y,...v})=>{const[E=[],x]=Kt({prop:t,onChange:o,defaultProp:s}),[R,P]=Kt({prop:v.open,onChange:v.onOpenChange,defaultProp:v.defaultOpen||!1}),O=h.useMemo(()=>e.filter(A=>!A.disabled),[e]),{handleInputKeyDown:S,toggleOption:T,handleClear:_,handleTogglePopover:$,clearExtraOptions:V,toggleAll:U}=Pue({valueKey:n,values:E,setValues:x,items:e,maxCount:u,setIsPopoverOpen:P});return w.jsxs(jd,{open:R,onOpenChange:P,"data-slot":"multi-select",...y,children:[w.jsx(Bd,{asChild:!0,"data-slot":"multi-select-trigger",children:w.jsx(Tn,{...v,onClick:$,className:me("flex w-full p-1 rounded-md border border-input min-h-10 h-auto items-center justify-between bg-inherit hover:bg-inherit",c),children:E.length>0?w.jsxs("div",{className:"flex justify-between items-center w-full",children:[w.jsxs("div",{className:"flex flex-wrap items-center","data-slot":"multi-select-tags",children:[E.slice(0,u).map(A=>{const H=e.find(N=>N[n]===A),F=H?.icon;return w.jsxs(Ab,{"data-slot":"multi-select-tag",className:me(LT({variant:i})),closable:!0,onClose:()=>T(A),children:[F&&w.jsx(F,{className:"h-4 w-4 mr-2"}),H&&f?.(H)]},A)}),E.length>u&&w.jsx(Ab,{"data-slot":"multi-select-tag",className:me(LT({variant:i})),closable:!0,onClose:V,children:`+ ${E.length-u} más`})]}),w.jsxs("div",{className:"flex items-center justify-between",children:[w.jsx(vd,{"data-slot":"multi-select-clear",className:"h-4 mx-2 cursor-pointer text-muted-foreground",onClick:A=>{A.stopPropagation(),_()}}),w.jsx(FA,{"data-slot":"multi-select-divider",orientation:"vertical",className:"flex min-h-6 h-full"}),w.jsx(Gp,{"data-slot":"multi-select-trigger-icon",className:"h-4 mx-2 cursor-pointer text-muted-foreground"})]})]}):w.jsxs("div",{className:"flex items-center justify-between w-full mx-auto","data-slot":"multi-select-trigger-empty",children:[w.jsx("span",{className:"text-sm text-foreground font-normal mx-2","data-slot":"multi-select-placeholder",children:a}),w.jsx(Gp,{"data-slot":"multi-select-trigger-icon",className:"h-4 cursor-pointer text-muted-foreground mx-2"})]})})}),w.jsx(Vd,{"data-slot":"multi-select-content",className:"p-0",matchTriggerWidth:!0,align:"start",asChild:!0,onEscapeKeyDown:()=>P(!1),children:w.jsxs(Rd,{children:[m&&w.jsx(Vm,{"data-slot":"multi-select-input",placeholder:"Buscar...",onKeyDown:S}),w.jsxs(Km,{"data-slot":"multi-select-list",children:[w.jsx(Hm,{"data-slot":"multi-select-empty",children:"No results found."}),w.jsxs(sM,{"data-slot":"multi-select-group",children:[b&&w.jsxs(nd,{"data-slot":"multi-select-item",onSelect:U,className:me("cursor-pointer",!p&&E.length===O.length&&"bg-accent text-accent-foreground"),children:[p&&w.jsx("div",{className:me("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",E.length===O.length?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:w.jsx(tb,{className:"h-4 w-4"})}),w.jsx("span",{children:"(Seleccionar todo)"})]},"all"),e.map(A=>{const H=E.includes(A[n]);return w.jsxs(nd,{"data-slot":"multi-select-item",onSelect:()=>!A.disabled&&T(A[n]),className:me(A.disabled?"!bg-neutral-50 !text-neutral-400":"cursor-pointer",!p&&H&&"!bg-accent !text-accent-foreground"),children:[p&&w.jsx("div",{className:me("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",H?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:w.jsx(tb,{className:"h-4 w-4"})}),A.icon&&w.jsx(A.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),w.jsx("span",{children:f?.(A)})]},A[n])})]})]})]})})]})},_ue=({value:e,onChange:t,defaultValue:n,className:r,min:o,max:i,...s})=>{const[a,u]=Kt({prop:e,onChange:t,defaultProp:n}),c=a??o??0,f=y=>{const v=parseInt(y.target.value,10);u(v)},p=()=>{if(_t.isUndefined(a)&&_t.isNumber(o))return u(o??0);const y=c+1;(_t.isUndefined(i)||y<=i)&&u(y)},m=()=>{if(_t.isUndefined(a)&&_t.isNumber(i))return u(i??0);const y=c-1;(_t.isUndefined(o)||y>=o)&&u(y)},b=()=>{const y=_t.isNumber(o)&&c<o,v=_t.isNumber(i)&&c>i;y?u(o):v&&u(i)};return w.jsxs("div",{className:"relative w-full","data-slot":"number-input-container",children:[w.jsx("input",{...s,type:"number",value:a,onChange:f,onBlur:b,min:o,max:i,className:me("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",r),"data-slot":"number-input"}),w.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:[w.jsx(Tn,{variant:"ghost",size:"icon",onClick:p,className:"h-4 w-4 grow rounded-sm","data-testid":"increment-trigger","data-slot":"number-input-increment",children:w.jsx($$,{"data-slot":"number-input-increment-icon"})}),w.jsx(Tn,{variant:"ghost",size:"icon",onClick:m,className:"h-4 w-4 grow rounded-sm","data-testid":"decrement-trigger","data-slot":"number-input-decrement",children:w.jsx(O$,{"data-slot":"number-input-decrement-icon"})})]})]})},Us=({isActive:e=!1,...t})=>w.jsx("button",{...t,"data-slot":"pagination-option","data-active":e,"data-dots":t.children===wi,className:me("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)}),Oue=({optionProps:e,className:t,containerProps:n,...r})=>{const{paginationRange:o,currentPage:i,goTo:s,maxPage:a,next:u,prev:c,isLastPage:f,isFirstPage:p}=PN(r);return w.jsxs("div",{...n,className:me("flex items-end select-none h-10",n?.className,t),"data-slot":"pagination",children:[w.jsxs(Us,{...e,disabled:p,onClick:()=>s(1),className:me("rounded-l-md",e?.className),children:[w.jsx(iH,{"data-slot":"pagination-option-icon"}),w.jsx("span",{className:"sr-only",children:"Ir a primera página"})]}),w.jsxs(Us,{...e,onClick:c,disabled:p,children:[w.jsx(ky,{"data-slot":"pagination-option-icon"}),w.jsx("span",{className:"sr-only",children:"Ir a página anterior"})]}),o.map(m=>w.jsx(w.Fragment,{children:m===wi?w.jsx(Us,{className:me("pointer-events-none",e?.className),children:wi},m):D.createElement(Us,{...e,isActive:m===i,onClick:()=>s(m),key:m},m,w.jsxs("span",{className:"sr-only",children:["Ir a la página ",m]}))})),w.jsxs(Us,{...e,onClick:u,disabled:f,children:[w.jsx(gd,{"data-slot":"pagination-option-icon"}),w.jsx("span",{className:"sr-only",children:"Ir a próxima página"})]}),w.jsxs(Us,{...e,disabled:f,onClick:()=>s(a),className:me("rounded-r-md",e?.className),children:[w.jsx(aH,{"data-slot":"pagination-option-icon"}),w.jsx("span",{className:"sr-only",children:"Ir a última página"})]})]})},$ue=({className:e,containerClassName:t,showIcon:n=w.jsx(xH,{className:"h-4 w-4"}),hideIcon:r=w.jsx(bH,{className:"h-4 w-4"}),onShow:o,onHide:i,toggleable:s=!0,...a})=>{const[u,c]=TN(!1),f=()=>{c(),u?i?.():o?.()};return w.jsxs("div",{className:me("relative",t),"data-slot":"password",children:[w.jsx(CN,{...a,type:u?"text":"password",className:me("pr-10","[&::-ms-reveal]:hidden [&::-ms-clear]:hidden",e)}),w.jsx("button",{"data-slot":"password-toggle",type:"button",onClick:f,disabled:!s,className:me("absolute right-3 top-1/2 -translate-y-1/2 text-gray-500",s?"hover:text-gray-700":"opacity-50 cursor-not-allowed"),children:u?r:n})]})},qT=new Map;function Due(e,t){const n=JSON.stringify({locale:e,options:t}),r=qT.get(n);if(r)return r;const o=new Intl.NumberFormat(e,t);return qT.set(n,o),o}function jT(e,t,n){return e==null?"":Due(t,n).format(e)}function Mue(e,t,n){return e==null?"":n?jT(e,t,n):jT(e/100,t,{style:"percent"})}const mw=h.createContext(void 0);process.env.NODE_ENV!=="production"&&(mw.displayName="ProgressRootContext");function ah(){const e=h.useContext(mw);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ProgressRootContext is missing. Progress parts must be placed within <Progress.Root>.":zt(51));return e}let Ov=(function(e){return e.complete="data-complete",e.indeterminate="data-indeterminate",e.progressing="data-progressing",e})({});const Kd={status(e){return e==="progressing"?{[Ov.progressing]:""}:e==="complete"?{[Ov.complete]:""}:e==="indeterminate"?{[Ov.indeterminate]:""}:null}};function Aue(e,t){return t==null?"indeterminate progress":e||`${t}%`}const fk=h.forwardRef(function(t,n){const{format:r,getAriaValueText:o=Aue,locale:i,max:s=100,min:a=0,value:u,render:c,className:f,children:p,style:m,...b}=t,[y,v]=h.useState(),E=cr(r);let x="indeterminate";Number.isFinite(u)&&(x=u===s?"complete":"progressing");const R=Mue(u,i,E.current),P=h.useMemo(()=>({status:x}),[x]),O={"aria-labelledby":y,"aria-valuemax":s,"aria-valuemin":a,"aria-valuenow":u??void 0,"aria-valuetext":o(R,u),role:"progressbar",children:w.jsxs(h.Fragment,{children:[p,w.jsx("span",{role:"presentation",style:pd,children:"x"})]})},S=h.useMemo(()=>({formattedValue:R,max:s,min:a,setLabelId:v,state:P,status:x,value:u}),[R,s,a,v,P,x,u]),T=lt("div",t,{state:P,ref:n,props:[O,b],stateAttributesMapping:Kd});return w.jsx(mw.Provider,{value:S,children:T})});process.env.NODE_ENV!=="production"&&(fk.displayName="ProgressRoot");const pk=h.forwardRef(function(t,n){const{render:r,className:o,style:i,...s}=t,{state:a}=ah();return lt("div",t,{state:a,ref:n,props:s,stateAttributesMapping:Kd})});process.env.NODE_ENV!=="production"&&(pk.displayName="ProgressTrack");function Nue(e,t,n){return(e-t)*100/(n-t)}const mk=h.forwardRef(function(t,n){const{render:r,className:o,style:i,...s}=t,{max:a,min:u,value:c,state:f}=ah(),p=Number.isFinite(c)&&c!==null?Nue(c,u,a):null,m=h.useCallback(()=>p==null?{}:{insetInlineStart:0,height:"inherit",width:`${p}%`},[p]);return lt("div",t,{state:f,ref:n,props:[{style:m()},s],stateAttributesMapping:Kd})});process.env.NODE_ENV!=="production"&&(mk.displayName="ProgressIndicator");const hk=h.forwardRef(function(t,n){const{className:r,render:o,children:i,style:s,...a}=t,{value:u,formattedValue:c,state:f}=ah(),p=u==null?"indeterminate":c,m=u==null?null:c;return lt("span",t,{state:f,ref:n,props:[{"aria-hidden":!0,children:typeof i=="function"?i(p,u):m},a],stateAttributesMapping:Kd})});process.env.NODE_ENV!=="production"&&(hk.displayName="ProgressValue");function Iue(e,t){const n=$r(e);return Le(()=>(t(n),()=>{t(void 0)}),[n,t]),n}const gk=h.forwardRef(function(t,n){const{render:r,className:o,style:i,id:s,...a}=t,{setLabelId:u,state:c}=ah(),f=Iue(s,u);return lt("span",t,{state:c,ref:n,props:[{id:f,role:"presentation"},a],stateAttributesMapping:Kd})});process.env.NODE_ENV!=="production"&&(gk.displayName="ProgressLabel");const kue=Oi("block w-full overflow-hidden rounded-full bg-input",{variants:{size:{sm:"h-1",md:"h-1.5",lg:"h-2.5"}},defaultVariants:{size:"md"}}),Fue=Oi("transition-all duration-500",{variants:{variant:{default:"bg-primary",success:"bg-success",error:"bg-error",warning:"bg-warning",info:"bg-info"}},defaultVariants:{variant:"default"}});function vk({className:e,...t}){return w.jsx(fk,{className:me("flex w-full flex-col gap-2",e),"data-slot":"progress",...t})}function Lue({className:e,...t}){return w.jsx(gk,{className:me("font-medium text-sm",e),"data-slot":"progress-label",...t})}function bk({className:e,size:t,...n}){return w.jsx(pk,{className:me(kue({size:t}),e),"data-slot":"progress-track",...n})}function yk({className:e,variant:t,...n}){return w.jsx(mk,{className:me(Fue({variant:t}),e),"data-slot":"progress-indicator",...n})}function que({className:e,...t}){return w.jsx(hk,{className:me("text-sm tabular-nums",e),"data-slot":"progress-value",...t})}function jue({size:e,variant:t,className:n,trackProps:r,indicatorProps:o,...i}){return w.jsx(vk,{className:n,...i,children:w.jsx(bk,{size:e,...r,children:w.jsx(yk,{variant:t,...o})})})}const Bue=({items:e=[],valueKey:t="value",labelKey:n="label",value:r,onChange:o,defaultValue:i,renderOption:s=v=>v?.[n],triggerProps:a,contentClassName:u,contentProps:c,itemClassName:f,itemProps:p,className:m,placeholder:b="Seleccionar",...y})=>{const[v,E]=Kt({prop:r,onChange:x=>{if(!o)return;const R=e.find(P=>P[t]===x);o?.(x,R)},defaultProp:i});return w.jsxs(Xk,{...y,onValueChange:E,value:v,children:[w.jsx(Jk,{className:m,...a,children:w.jsx(Qk,{placeholder:b})}),w.jsx(n4,{className:u,...c,children:w.jsx(Zk,{children:e.map((x,R)=>D.createElement(o4,{...p,className:f,key:R,disabled:x?.disabled,value:x[t]},s?.(x)))})})]})};function BT(e,[t,n]){return Math.min(n,Math.max(t,e))}function xk(e){const t=Vue(e),n=h.forwardRef((r,o)=>{const{children:i,...s}=r,a=h.Children.toArray(i),u=a.find(Hue);if(u){const c=u.props.children,f=a.map(p=>p===u?h.Children.count(c)>1?h.Children.only(null):h.isValidElement(c)?c.props.children:null:p);return w.jsx(t,{...s,ref:o,children:h.isValidElement(c)?h.cloneElement(c,void 0,f):null})}return w.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function Vue(e){const t=h.forwardRef((n,r)=>{const{children:o,...i}=n;if(h.isValidElement(o)){const s=Uue(o),a=Wue(i,o.props);return o.type!==h.Fragment&&(a.ref=r?Ht(r,s):s),h.cloneElement(o,a)}return h.Children.count(o)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Kue=Symbol("radix.slottable");function Hue(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Kue}function Wue(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const u=i(...a);return o(...a),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Uue(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var zue=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],pr=zue.reduce((e,t)=>{const n=xk(`Primitive.${t}`),r=h.forwardRef((o,i)=>{const{asChild:s,...a}=o,u=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(u,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Gue(e){const t=h.useRef({value:e,previous:e});return h.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Yue(e){const t=Xue(e),n=h.forwardRef((r,o)=>{const{children:i,...s}=r,a=h.Children.toArray(i),u=a.find(Que);if(u){const c=u.props.children,f=a.map(p=>p===u?h.Children.count(c)>1?h.Children.only(null):h.isValidElement(c)?c.props.children:null:p);return w.jsx(t,{...s,ref:o,children:h.isValidElement(c)?h.cloneElement(c,void 0,f):null})}return w.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function Xue(e){const t=h.forwardRef((n,r)=>{const{children:o,...i}=n;if(h.isValidElement(o)){const s=ece(o),a=Jue(i,o.props);return o.type!==h.Fragment&&(a.ref=r?Ht(r,s):s),h.cloneElement(o,a)}return h.Children.count(o)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Zue=Symbol("radix.slottable");function Que(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Zue}function Jue(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const u=i(...a);return o(...a),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function ece(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var tce=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],nce=tce.reduce((e,t)=>{const n=Yue(`Primitive.${t}`),r=h.forwardRef((o,i)=>{const{asChild:s,...a}=o,u=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(u,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),wk=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"}),rce="VisuallyHidden",oce=h.forwardRef((e,t)=>w.jsx(nce.span,{...e,ref:t,style:{...wk,...e.style}}));oce.displayName=rce;var ice=[" ","Enter","ArrowUp","ArrowDown"],sce=[" ","Enter"],ms="Select",[lh,uh,ace]=Jx(ms),[Ra]=Go(ms,[ace,Ca]),ch=Ca(),[lce,Mi]=Ra(ms),[uce,cce]=Ra(ms),Ek=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:u,dir:c,name:f,autoComplete:p,disabled:m,required:b,form:y}=e,v=ch(t),[E,x]=h.useState(null),[R,P]=h.useState(null),[O,S]=h.useState(!1),T=ew(c),[_,$]=Kt({prop:r,defaultProp:o??!1,onChange:i,caller:ms}),[V,U]=Kt({prop:s,defaultProp:a,onChange:u,caller:ms}),A=h.useRef(null),H=E?y||!!E.closest("form"):!0,[F,N]=h.useState(new Set),j=Array.from(F).map(I=>I.props.value).join(";");return w.jsx(nh,{...v,children:w.jsxs(lce,{required:b,scope:t,trigger:E,onTriggerChange:x,valueNode:R,onValueNodeChange:P,valueNodeHasChildren:O,onValueNodeHasChildrenChange:S,contentId:an(),value:V,onValueChange:U,open:_,onOpenChange:$,dir:T,triggerPointerDownPosRef:A,disabled:m,children:[w.jsx(lh.Provider,{scope:t,children:w.jsx(uce,{scope:e.__scopeSelect,onNativeOptionAdd:h.useCallback(I=>{N(k=>new Set(k).add(I))},[]),onNativeOptionRemove:h.useCallback(I=>{N(k=>{const q=new Set(k);return q.delete(I),q})},[]),children:n})}),H?w.jsxs(Uk,{"aria-hidden":!0,required:b,tabIndex:-1,name:f,autoComplete:p,value:V,onChange:I=>U(I.target.value),disabled:m,form:y,children:[V===void 0?w.jsx("option",{value:""}):null,Array.from(F)]},j):null]})})};Ek.displayName=ms;var Ck="SelectTrigger",Rk=h.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=ch(n),s=Mi(Ck,n),a=s.disabled||r,u=it(t,s.onTriggerChange),c=uh(n),f=h.useRef("touch"),[p,m,b]=Gk(v=>{const E=c().filter(P=>!P.disabled),x=E.find(P=>P.value===s.value),R=Yk(E,v,x);R!==void 0&&s.onValueChange(R.value)}),y=v=>{a||(s.onOpenChange(!0),b()),v&&(s.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return w.jsx(rh,{asChild:!0,...i,children:w.jsx(pr.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:a,"data-disabled":a?"":void 0,"data-placeholder":zk(s.value)?"":void 0,...o,ref:u,onClick:Ie(o.onClick,v=>{v.currentTarget.focus(),f.current!=="mouse"&&y(v)}),onPointerDown:Ie(o.onPointerDown,v=>{f.current=v.pointerType;const E=v.target;E.hasPointerCapture(v.pointerId)&&E.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(y(v),v.preventDefault())}),onKeyDown:Ie(o.onKeyDown,v=>{const E=p.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&m(v.key),!(E&&v.key===" ")&&ice.includes(v.key)&&(y(),v.preventDefault())})})})});Rk.displayName=Ck;var Sk="SelectValue",Pk=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=e,u=Mi(Sk,n),{onValueNodeHasChildrenChange:c}=u,f=i!==void 0,p=it(t,u.onValueNodeChange);return xn(()=>{c(f)},[c,f]),w.jsx(pr.span,{...a,ref:p,style:{pointerEvents:"none"},children:zk(u.value)?w.jsx(w.Fragment,{children:s}):i})});Pk.displayName=Sk;var dce="SelectIcon",Tk=h.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return w.jsx(pr.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});Tk.displayName=dce;var fce="SelectPortal",_k=e=>w.jsx(xd,{asChild:!0,...e});_k.displayName=fce;var hs="SelectContent",Ok=h.forwardRef((e,t)=>{const n=Mi(hs,e.__scopeSelect),[r,o]=h.useState();if(xn(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?er.createPortal(w.jsx($k,{scope:e.__scopeSelect,children:w.jsx(lh.Slot,{scope:e.__scopeSelect,children:w.jsx("div",{children:e.children})})}),i):null}return w.jsx(Dk,{...e,ref:t})});Ok.displayName=hs;var qr=10,[$k,Ai]=Ra(hs),pce="SelectContentImpl",mce=xk("SelectContent.RemoveScroll"),Dk=h.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:u,align:c,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:b,sticky:y,hideWhenDetached:v,avoidCollisions:E,...x}=e,R=Mi(hs,n),[P,O]=h.useState(null),[S,T]=h.useState(null),_=it(t,ee=>O(ee)),[$,V]=h.useState(null),[U,A]=h.useState(null),H=uh(n),[F,N]=h.useState(!1),j=h.useRef(!1);h.useEffect(()=>{if(P)return Ed(P)},[P]),Fm();const I=h.useCallback(ee=>{const[de,...K]=H().map(Z=>Z.ref.current),[ue]=K.slice(-1),le=document.activeElement;for(const Z of ee)if(Z===le||(Z?.scrollIntoView({block:"nearest"}),Z===de&&S&&(S.scrollTop=0),Z===ue&&S&&(S.scrollTop=S.scrollHeight),Z?.focus(),document.activeElement!==le))return},[H,S]),k=h.useCallback(()=>I([$,P]),[I,$,P]);h.useEffect(()=>{F&&k()},[F,k]);const{onOpenChange:q,triggerPointerDownPosRef:z}=R;h.useEffect(()=>{if(P){let ee={x:0,y:0};const de=ue=>{ee={x:Math.abs(Math.round(ue.pageX)-(z.current?.x??0)),y:Math.abs(Math.round(ue.pageY)-(z.current?.y??0))}},K=ue=>{ee.x<=10&&ee.y<=10?ue.preventDefault():P.contains(ue.target)||q(!1),document.removeEventListener("pointermove",de),z.current=null};return z.current!==null&&(document.addEventListener("pointermove",de),document.addEventListener("pointerup",K,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",de),document.removeEventListener("pointerup",K,{capture:!0})}}},[P,q,z]),h.useEffect(()=>{const ee=()=>q(!1);return window.addEventListener("blur",ee),window.addEventListener("resize",ee),()=>{window.removeEventListener("blur",ee),window.removeEventListener("resize",ee)}},[q]);const[W,te]=Gk(ee=>{const de=H().filter(le=>!le.disabled),K=de.find(le=>le.ref.current===document.activeElement),ue=Yk(de,ee,K);ue&&setTimeout(()=>ue.ref.current.focus())}),X=h.useCallback((ee,de,K)=>{const ue=!j.current&&!K;(R.value!==void 0&&R.value===de||ue)&&(V(ee),ue&&(j.current=!0))},[R.value]),Q=h.useCallback(()=>P?.focus(),[P]),re=h.useCallback((ee,de,K)=>{const ue=!j.current&&!K;(R.value!==void 0&&R.value===de||ue)&&A(ee)},[R.value]),ce=r==="popper"?Nb:Mk,se=ce===Nb?{side:a,sideOffset:u,align:c,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:b,sticky:y,hideWhenDetached:v,avoidCollisions:E}:{};return w.jsx($k,{scope:n,content:P,viewport:S,onViewportChange:T,itemRefCallback:X,selectedItem:$,onItemLeave:Q,itemTextRefCallback:re,focusSelectedItem:k,selectedItemText:U,position:r,isPositioned:F,searchRef:W,children:w.jsx(ya,{as:mce,allowPinchZoom:!0,children:w.jsx(yd,{asChild:!0,trapped:R.open,onMountAutoFocus:ee=>{ee.preventDefault()},onUnmountAutoFocus:Ie(o,ee=>{R.trigger?.focus({preventScroll:!0}),ee.preventDefault()}),children:w.jsx(bd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:ee=>ee.preventDefault(),onDismiss:()=>R.onOpenChange(!1),children:w.jsx(ce,{role:"listbox",id:R.contentId,"data-state":R.open?"open":"closed",dir:R.dir,onContextMenu:ee=>ee.preventDefault(),...x,...se,onPlaced:()=>N(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:Ie(x.onKeyDown,ee=>{const de=ee.ctrlKey||ee.altKey||ee.metaKey;if(ee.key==="Tab"&&ee.preventDefault(),!de&&ee.key.length===1&&te(ee.key),["ArrowUp","ArrowDown","Home","End"].includes(ee.key)){let ue=H().filter(le=>!le.disabled).map(le=>le.ref.current);if(["ArrowUp","End"].includes(ee.key)&&(ue=ue.slice().reverse()),["ArrowUp","ArrowDown"].includes(ee.key)){const le=ee.target,Z=ue.indexOf(le);ue=ue.slice(Z+1)}setTimeout(()=>I(ue)),ee.preventDefault()}})})})})})})});Dk.displayName=pce;var hce="SelectItemAlignedPosition",Mk=h.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=Mi(hs,n),s=Ai(hs,n),[a,u]=h.useState(null),[c,f]=h.useState(null),p=it(t,_=>f(_)),m=uh(n),b=h.useRef(!1),y=h.useRef(!0),{viewport:v,selectedItem:E,selectedItemText:x,focusSelectedItem:R}=s,P=h.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&v&&E&&x){const _=i.trigger.getBoundingClientRect(),$=c.getBoundingClientRect(),V=i.valueNode.getBoundingClientRect(),U=x.getBoundingClientRect();if(i.dir!=="rtl"){const le=U.left-$.left,Z=V.left-le,xe=_.left-Z,Re=_.width+xe,Ae=Math.max(Re,$.width),Se=window.innerWidth-qr,Oe=BT(Z,[qr,Math.max(qr,Se-Ae)]);a.style.minWidth=Re+"px",a.style.left=Oe+"px"}else{const le=$.right-U.right,Z=window.innerWidth-V.right-le,xe=window.innerWidth-_.right-Z,Re=_.width+xe,Ae=Math.max(Re,$.width),Se=window.innerWidth-qr,Oe=BT(Z,[qr,Math.max(qr,Se-Ae)]);a.style.minWidth=Re+"px",a.style.right=Oe+"px"}const A=m(),H=window.innerHeight-qr*2,F=v.scrollHeight,N=window.getComputedStyle(c),j=parseInt(N.borderTopWidth,10),I=parseInt(N.paddingTop,10),k=parseInt(N.borderBottomWidth,10),q=parseInt(N.paddingBottom,10),z=j+I+F+q+k,W=Math.min(E.offsetHeight*5,z),te=window.getComputedStyle(v),X=parseInt(te.paddingTop,10),Q=parseInt(te.paddingBottom,10),re=_.top+_.height/2-qr,ce=H-re,se=E.offsetHeight/2,ee=E.offsetTop+se,de=j+I+ee,K=z-de;if(de<=re){const le=A.length>0&&E===A[A.length-1].ref.current;a.style.bottom="0px";const Z=c.clientHeight-v.offsetTop-v.offsetHeight,xe=Math.max(ce,se+(le?Q:0)+Z+k),Re=de+xe;a.style.height=Re+"px"}else{const le=A.length>0&&E===A[0].ref.current;a.style.top="0px";const xe=Math.max(re,j+v.offsetTop+(le?X:0)+se)+K;a.style.height=xe+"px",v.scrollTop=de-re+v.offsetTop}a.style.margin=`${qr}px 0`,a.style.minHeight=W+"px",a.style.maxHeight=H+"px",r?.(),requestAnimationFrame(()=>b.current=!0)}},[m,i.trigger,i.valueNode,a,c,v,E,x,i.dir,r]);xn(()=>P(),[P]);const[O,S]=h.useState();xn(()=>{c&&S(window.getComputedStyle(c).zIndex)},[c]);const T=h.useCallback(_=>{_&&y.current===!0&&(P(),R?.(),y.current=!1)},[P,R]);return w.jsx(vce,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:b,onScrollButtonChange:T,children:w.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:O},children:w.jsx(pr.div,{...o,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Mk.displayName=hce;var gce="SelectPopperPosition",Nb=h.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=qr,...i}=e,s=ch(n);return w.jsx(rw,{...s,...i,ref:t,align:r,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)"}})});Nb.displayName=gce;var[vce,hw]=Ra(hs,{}),Ib="SelectViewport",Ak=h.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=Ai(Ib,n),s=hw(Ib,n),a=it(t,i.onViewportChange),u=h.useRef(0);return w.jsxs(w.Fragment,{children:[w.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:r}),w.jsx(lh.Slot,{scope:n,children:w.jsx(pr.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Ie(o.onScroll,c=>{const f=c.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:m}=s;if(m?.current&&p){const b=Math.abs(u.current-f.scrollTop);if(b>0){const y=window.innerHeight-qr*2,v=parseFloat(p.style.minHeight),E=parseFloat(p.style.height),x=Math.max(v,E);if(x<y){const R=x+b,P=Math.min(y,R),O=R-P;p.style.height=P+"px",p.style.bottom==="0px"&&(f.scrollTop=O>0?O:0,p.style.justifyContent="flex-end")}}}u.current=f.scrollTop})})})]})});Ak.displayName=Ib;var Nk="SelectGroup",[bce,yce]=Ra(Nk),Ik=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=an();return w.jsx(bce,{scope:n,id:o,children:w.jsx(pr.div,{role:"group","aria-labelledby":o,...r,ref:t})})});Ik.displayName=Nk;var kk="SelectLabel",Fk=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=yce(kk,n);return w.jsx(pr.div,{id:o.id,...r,ref:t})});Fk.displayName=kk;var cm="SelectItem",[xce,Lk]=Ra(cm),qk=h.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,a=Mi(cm,n),u=Ai(cm,n),c=a.value===r,[f,p]=h.useState(i??""),[m,b]=h.useState(!1),y=it(t,R=>u.itemRefCallback?.(R,r,o)),v=an(),E=h.useRef("touch"),x=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")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 w.jsx(xce,{scope:n,value:r,disabled:o,textId:v,isSelected:c,onItemTextChange:h.useCallback(R=>{p(P=>P||(R?.textContent??"").trim())},[]),children:w.jsx(lh.ItemSlot,{scope:n,value:r,disabled:o,textValue:f,children:w.jsx(pr.div,{role:"option","aria-labelledby":v,"data-highlighted":m?"":void 0,"aria-selected":c&&m,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:y,onFocus:Ie(s.onFocus,()=>b(!0)),onBlur:Ie(s.onBlur,()=>b(!1)),onClick:Ie(s.onClick,()=>{E.current!=="mouse"&&x()}),onPointerUp:Ie(s.onPointerUp,()=>{E.current==="mouse"&&x()}),onPointerDown:Ie(s.onPointerDown,R=>{E.current=R.pointerType}),onPointerMove:Ie(s.onPointerMove,R=>{E.current=R.pointerType,o?u.onItemLeave?.():E.current==="mouse"&&R.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ie(s.onPointerLeave,R=>{R.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:Ie(s.onKeyDown,R=>{u.searchRef?.current!==""&&R.key===" "||(sce.includes(R.key)&&x(),R.key===" "&&R.preventDefault())})})})})});qk.displayName=cm;var Kc="SelectItemText",jk=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=Mi(Kc,n),a=Ai(Kc,n),u=Lk(Kc,n),c=cce(Kc,n),[f,p]=h.useState(null),m=it(t,x=>p(x),u.onItemTextChange,x=>a.itemTextRefCallback?.(x,u.value,u.disabled)),b=f?.textContent,y=h.useMemo(()=>w.jsx("option",{value:u.value,disabled:u.disabled,children:b},u.value),[u.disabled,u.value,b]),{onNativeOptionAdd:v,onNativeOptionRemove:E}=c;return xn(()=>(v(y),()=>E(y)),[v,E,y]),w.jsxs(w.Fragment,{children:[w.jsx(pr.span,{id:u.textId,...i,ref:m}),u.isSelected&&s.valueNode&&!s.valueNodeHasChildren?er.createPortal(i.children,s.valueNode):null]})});jk.displayName=Kc;var Bk="SelectItemIndicator",wce=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Lk(Bk,n).isSelected?w.jsx(pr.span,{"aria-hidden":!0,...r,ref:t}):null});wce.displayName=Bk;var kb="SelectScrollUpButton",Vk=h.forwardRef((e,t)=>{const n=Ai(kb,e.__scopeSelect),r=hw(kb,e.__scopeSelect),[o,i]=h.useState(!1),s=it(t,r.onScrollButtonChange);return xn(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=u.scrollTop>0;i(c)};const u=n.viewport;return a(),u.addEventListener("scroll",a),()=>u.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?w.jsx(Hk,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:u}=n;a&&u&&(a.scrollTop=a.scrollTop-u.offsetHeight)}}):null});Vk.displayName=kb;var Fb="SelectScrollDownButton",Kk=h.forwardRef((e,t)=>{const n=Ai(Fb,e.__scopeSelect),r=hw(Fb,e.__scopeSelect),[o,i]=h.useState(!1),s=it(t,r.onScrollButtonChange);return xn(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=u.scrollHeight-u.clientHeight,f=Math.ceil(u.scrollTop)<c;i(f)};const u=n.viewport;return a(),u.addEventListener("scroll",a),()=>u.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?w.jsx(Hk,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:u}=n;a&&u&&(a.scrollTop=a.scrollTop+u.offsetHeight)}}):null});Kk.displayName=Fb;var Hk=h.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=Ai("SelectScrollButton",n),s=h.useRef(null),a=uh(n),u=h.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return h.useEffect(()=>()=>u(),[u]),xn(()=>{a().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),w.jsx(pr.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:Ie(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:Ie(o.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:Ie(o.onPointerLeave,()=>{u()})})}),Ece="SelectSeparator",Wk=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return w.jsx(pr.div,{"aria-hidden":!0,...r,ref:t})});Wk.displayName=Ece;var Lb="SelectArrow",Cce=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=ch(n),i=Mi(Lb,n),s=Ai(Lb,n);return i.open&&s.position==="popper"?w.jsx(ow,{...o,...r,ref:t}):null});Cce.displayName=Lb;var Rce="SelectBubbleInput",Uk=h.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=h.useRef(null),i=it(r,o),s=Gue(t);return h.useEffect(()=>{const a=o.current;if(!a)return;const u=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(u,"value").set;if(s!==t&&f){const p=new Event("change",{bubbles:!0});f.call(a,t),a.dispatchEvent(p)}},[s,t]),w.jsx(pr.select,{...n,style:{...wk,...n.style},ref:i,defaultValue:t})});Uk.displayName=Rce;function zk(e){return e===""||e===void 0}function Gk(e){const t=_n(e),n=h.useRef(""),r=h.useRef(0),o=h.useCallback(s=>{const a=n.current+s;t(a),(function u(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>u(""),1e3))})(a)},[t]),i=h.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function Yk(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=Sce(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const u=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function Sce(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Pce=Ek,Tce=Rk,_ce=Pk,Oce=Tk,$ce=_k,Dce=Ok,Mce=Ak,Ace=Ik,Nce=Fk,Ice=qk,kce=jk,Fce=Vk,Lce=Kk,qce=Wk;const Xk=e=>w.jsx(Pce,{"data-slot":"select",...e}),Zk=({heading:e,children:t,...n})=>w.jsxs(Ace,{"data-slot":"select-group",...n,children:[e&&w.jsx(r4,{children:e}),t]}),Qk=e=>w.jsx(_ce,{"data-slot":"select-value",...e}),Jk=({className:e,children:t,...n})=>w.jsxs(Tce,{"data-slot":"select-trigger",className:me("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),...n,children:[t,w.jsx(Oce,{asChild:!0,"data-slot":"select-trigger-icon",children:w.jsx(Gp,{className:"h-4 w-4 shrink-0 opacity-50"})})]}),e4=({className:e,...t})=>w.jsx(Fce,{"data-slot":"select-scroll-up",className:me("flex cursor-default items-center justify-center py-1",e),...t,children:w.jsx($$,{className:"h-4 w-4"})}),t4=({className:e,...t})=>w.jsx(Lce,{"data-slot":"select-scroll-down",className:me("flex cursor-default items-center justify-center py-1",e),...t,children:w.jsx(O$,{className:"h-4 w-4"})}),n4=({className:e,children:t,position:n="popper",...r})=>w.jsx($ce,{children:w.jsxs(Dce,{"data-slot":"select-content",className:me("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",n==="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:n,...r,children:[w.jsx(e4,{}),w.jsx(Mce,{"data-slot":"select-viewport",className:me("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),w.jsx(t4,{})]})}),r4=({className:e,...t})=>w.jsx(Nce,{"data-slot":"select-label",className:me("py-1.5 px-2 text-sm font-semibold",e),...t}),o4=({className:e,children:t,...n})=>w.jsx(Ice,{"data-slot":"select-item",className:me("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),...n,children:w.jsx(kce,{"data-slot":"select-item-text",children:t})}),jce=({className:e,...t})=>w.jsx(qce,{"data-slot":"select-separator",className:me("-mx-1 my-1 h-px bg-muted",e),...t}),Bce=({when:e,...t})=>w.jsx(Gr,{present:e,children:w.jsx(km,{...t,"data-state":e?"open":"closed","data-slot":"show"})});function Vce({className:e,...t}){return w.jsx("div",{className:me("animate-skeleton rounded-sm [--skeleton-highlight:--alpha(var(--color-white)/64%)] [background:linear-gradient(120deg,transparent_40%,var(--skeleton-highlight),transparent_60%)_var(--color-muted)_0_0/200%_100%_fixed] dark:[--skeleton-highlight:--alpha(var(--color-white)/4%)]",e),"data-slot":"skeleton",...t})}const Kce=({as:e="div",inline:t=!1,direction:n="horizontal",reverse:r=!1,justify:o,align:i,gap:s=8,wrap:a,grow:u=!1,className:c,style:f,...p})=>{const m=`${n==="vertical"?"column":"row"}${r?"-reverse":""}`;return w.jsx(e,{className:me(t?"inline-flex":"flex",u&&"flex-1",c),style:{flexDirection:m,justifyContent:o,alignItems:i,gap:s,flexWrap:a,...f},"data-slot":"stack",...p})},[i4,Hce]=Sd();function Wce({items:e=[],current:t,onChange:n,className:r,classNameList:o,classNameItem:i,classNameButton:s,classNameIndicator:a,classNameContent:u}){return w.jsxs(s4,{className:r,current:t,onChange:n,children:[w.jsx(a4,{className:o,children:e?.map((c,f)=>w.jsx(l4,{value:f,title:c?.title,indicator:c?.indicator,classNameItem:i,classNameButton:s,classNameIndicator:a},f))}),e?.map((c,f)=>w.jsx(u4,{className:u,value:f,children:c?.content},f))]})}function s4({current:e,onChange:t,className:n,...r}){const[o=0,i]=Kt({prop:e,onChange:t,defaultProp:0});return w.jsx(Hce,{value:{activeStep:o,setActiveStep:i},children:w.jsx("div",{"data-slot":"stepper",className:me("flex flex-col items-center w-full transition-all ease-in delay-150",n),...r})})}function a4({children:e,className:t,...n}){return w.jsx("ul",{"data-slot":"stepper-list",className:me("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),...n,children:e})}function l4({disabled:e,value:t,title:n,indicator:r,classNameItem:o,classNameButton:i,classNameIndicator:s}){const{activeStep:a,setActiveStep:u}=i4();return w.jsx("li",{"data-slot":"stepper-trigger",className:me("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 ${a>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:w.jsxs("button",{onClick:()=>!e&&u(t),className:me("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",a>=t?"text-primary":"text-gray-500",e&&"cursor-not-allowed",i),children:[w.jsx("span",{"data-slot":"stepper-trigger-indicator",className:me("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",a>t&&"bg-primary border-primary text-primary-foreground",a===t&&"bg-gray-100 text-primary border-primary",a<t&&"bg-white text-gray-500 border-input",e&&"text-gray-300",s),children:a>t?"✓":r||t+1}),n]})})}function u4({value:e,className:t="w-full",...n}){const{activeStep:r}=i4();return r===e?w.jsx("div",{"data-slot":"stepper-content",className:t,...n}):null}const gw=h.createContext(void 0);process.env.NODE_ENV!=="production"&&(gw.displayName="SwitchRootContext");function Uce(){const e=h.useContext(gw);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: SwitchRootContext is missing. Switch parts must be placed within <Switch.Root>.":zt(63));return e}let VT=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const c4={...Ym,checked(e){return e?{[VT.checked]:""}:{[VT.unchecked]:""}}};function zce(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:o,registerControlId:i}=Xm(),s=$r(t),a=n?o:void 0,u=Hn(()=>Symbol("labelable-control")),c=h.useRef(!1),f=h.useRef(t!=null),p=He(()=>{!c.current||i===At||(c.current=!1,i(u.current,void 0))});return Le(()=>{if(i===At)return;let m;if(n){const b=r?.current;et(b)&&b.closest("label")!=null?m=t??null:m=a??s}else if(t!=null)f.current=!0,m=t;else if(f.current)m=s;else{p();return}if(m===void 0){p();return}c.current=!0,i(u.current,m)},[t,r,a,i,n,s,u,p]),h.useEffect(()=>p,[p]),o??s}const d4=h.forwardRef(function(t,n){const{checked:r,className:o,defaultChecked:i,"aria-labelledby":s,form:a,id:u,inputRef:c,name:f,nativeButton:p=!1,onCheckedChange:m,readOnly:b=!1,required:y=!1,disabled:v=!1,render:E,uncheckedValue:x,value:R,style:P,...O}=t,{clearErrors:S}=mx(),{state:T,setTouched:_,setDirty:$,validityData:V,setFilled:U,setFocused:A,shouldValidateOnChange:H,validationMode:F,disabled:N,name:j,validation:I}=_d(),{labelId:k}=Xm(),q=N||v,z=j??f,W=He(m),te=h.useRef(null),X=la(te,c,I.inputRef),Q=h.useRef(null),re=$r(),ce=zce({id:u,implicit:!1,controlRef:Q}),se=p?void 0:ce,[ee,de]=fx({controlled:r,default:!!i,name:"Switch",state:"checked"});px(Q,{id:re,value:ee}),Le(()=>{te.current&&U(te.current.checked)},[te,U]),Nm(ee,()=>{S(z),$(ee!==V.initialValue),U(ee),H()?I.commit(ee):I.commit(ee,!0)});const{getButtonProps:K,buttonRef:ue}=ga({disabled:q,native:p}),le=bA(s,k,te,!p,se),Z={id:p?ce:re,role:"switch","aria-checked":ee,"aria-readonly":b||void 0,"aria-required":y||void 0,"aria-labelledby":le,onFocus(){q||A(!0)},onBlur(){const Se=te.current;!Se||q||(_(!0),A(!1),F==="onBlur"&&I.commit(Se.checked))},onClick(Se){b||q||(Se.preventDefault(),te.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:Se.shiftKey,ctrlKey:Se.ctrlKey,altKey:Se.altKey,metaKey:Se.metaKey})))}},xe=h.useMemo(()=>pa({checked:ee,disabled:q,form:a,id:se,name:z,required:y,style:z?W_:pd,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:X,onChange(Se){if(Se.nativeEvent.defaultPrevented)return;if(b){Se.preventDefault();return}const Oe=Se.currentTarget.checked,Ye=pt(Sm,Se.nativeEvent);W?.(Oe,Ye),!Ye.isCanceled&&de(Oe)},onFocus(){Q.current?.focus()}},I.getInputValidationProps,R!==void 0?{value:R}:yn),[ee,q,a,X,se,z,W,b,y,de,I,R]),Re=h.useMemo(()=>({...T,checked:ee,disabled:q,readOnly:b,required:y}),[T,ee,q,b,y]),Ae=lt("span",t,{state:Re,ref:[n,Q,ue],props:[Z,I.getValidationProps,O,K],stateAttributesMapping:c4});return w.jsxs(gw.Provider,{value:Re,children:[Ae,!ee&&z&&x!==void 0&&w.jsx("input",{type:"hidden",form:a,name:z,value:x}),w.jsx("input",{...xe,suppressHydrationWarning:!0})]})});process.env.NODE_ENV!=="production"&&(d4.displayName="SwitchRoot");const f4=h.forwardRef(function(t,n){const{render:r,className:o,style:i,...s}=t,{state:a}=_d(),u=Uce(),c={...a,...u};return lt("span",t,{state:c,ref:n,stateAttributesMapping:c4,props:s})});process.env.NODE_ENV!=="production"&&(f4.displayName="SwitchThumb");function p4({className:e,...t}){return w.jsx(d4,{className:me("peer inline-flex h-[calc(var(--thumb-size)+2px)] w-[calc(var(--thumb-size)*2-2px)] shrink-0 items-center rounded-full p-px outline-none transition-[background-color,box-shadow] duration-200","[--thumb-size:--spacing(5)] sm:[--thumb-size:--spacing(4)]","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background","data-checked:bg-primary data-unchecked:bg-input","data-disabled:cursor-not-allowed data-disabled:opacity-64",e),"data-slot":"switch",...t})}function m4({className:e,...t}){return w.jsx(f4,{className:me("pointer-events-none block aspect-square h-full rounded-(--thumb-size) bg-background shadow-sm/5 will-change-transform","origin-left [transition:translate_.15s,border-radius_.15s,scale_.1s_.1s,transform-origin_.15s]","data-checked:origin-[var(--thumb-size)_50%] data-checked:translate-x-[calc(var(--thumb-size)-4px)]","in-[[role=switch]:active,[data-slot=label]:active,[data-slot=field-label]:active]:not-data-disabled:scale-x-110","in-[[role=switch]:active,[data-slot=label]:active,[data-slot=field-label]:active]:rounded-[var(--thumb-size)/calc(var(--thumb-size)*1.1)]",e),"data-slot":"switch-thumb",...t})}function Gce({children:e,className:t,id:n,thumbProps:r,...o}){const i=D.useId(),s=n??i;return w.jsxs("div",{className:"flex select-none items-center gap-x-2",children:[w.jsx(p4,{id:s,className:t,...o,children:w.jsx(m4,{...r})}),e&&w.jsx(Od,{htmlFor:s,children:e})]})}const h4=({className:e,containerClassName:t,containerProps:n,...r})=>w.jsx("div",{"data-slot":"table-container",className:me("relative w-full overflow-auto rounded-md border",t),...n,children:w.jsx("table",{"data-slot":"table",className:me("w-full caption-bottom text-sm",e),...r})}),g4=({className:e,...t})=>w.jsx("thead",{"data-slot":"table-header",className:me("[&_tr]:border-b",e),...t}),v4=({className:e,...t})=>w.jsx("tbody",{"data-slot":"table-body",className:me("[&_tr:last-child]:border-0",e),...t}),Yce=({className:e,...t})=>w.jsx("tfoot",{"data-slot":"table-footer",className:me("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}),qb=({className:e,...t})=>w.jsx("tr",{"data-slot":"table-row",className:me("border-b transition-colors hover:bg-muted data-[selected=true]:bg-muted",e),...t}),b4=({className:e,...t})=>w.jsx("th",{"data-slot":"table-head",className:me("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}),y4=({className:e,...t})=>w.jsx("td",{"data-slot":"table-cell",className:me("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}),Xce=({className:e,...t})=>w.jsx("caption",{"data-slot":"table-caption",className:me("mt-4 text-sm text-muted-foreground",e),...t}),Zce=({data:e=[],columns:t=[],onRowClick:n,onDoubleClick:r,selected:o,theadClassName:i,theadProps:s,tbodyClassName:a,tbodyProps:u,trClassName:c,trProps:f,thClassName:p,thProps:m,tdClassName:b,tdProps:y,...v})=>w.jsxs(h4,{...v,className:me(v?.className),children:[w.jsx(g4,{...s,className:me(s?.className,i),children:w.jsx(qb,{...f,className:me(f?.className,c),children:t.map((E,x)=>w.jsx(b4,{...m,className:me(m?.className,p),style:{width:E.width},children:_t.isFunction(E.header)?E.header?.():E.header},x))})}),w.jsx(v4,{...u,className:me(u?.className,a),children:e.map((E,x)=>w.jsx(qb,{...f,"data-selected":o?.(E),className:me(f?.className,c),children:t.map((R,P)=>w.jsx(y4,{...y,onClick:O=>{y?.onClick?.(O),n?.(E)},onDoubleClick:()=>r?.(E),className:me(y?.className,b),children:R.cell?.(E,P)||E[R.key]},P))},x))})]}),$p=[10,25,50],Qce=({containerClassName:e,containerProps:t,selectClassName:n,selectProps:r,sizes:o=$p,...i})=>{const[s=$p[0],a]=Kt({onChange:i?.setPageSize,prop:i?.pageSize,defaultProp:$p[0]}),{range:u,next:c,prev:f,isFirstPage:p,isLastPage:m,goTo:b}=Qx({...i,pageSize:s}),y=v=>{const{value:E}=v.target,x=Number(E);a(x),b(1)};return w.jsxs("div",{"data-slot":"table-pagination",...t,className:me("flex justify-center items-center gap-x-4 bg-background border border-[#D9D9D9] rounded-2xl py-2",e),children:[o&&w.jsx("select",{"data-slot":"table-pagination-size-trigger",...r,value:s,onChange:y,className:me("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",n),children:o.map((v,E)=>w.jsx("option",{value:v,"data-slot":"table-pagination-size-option",children:v},E))}),w.jsxs("span",{"data-slot":"table-pagination-range",children:[u.start," - ",u.end," de ",i.totalItems]}),w.jsxs("div",{className:"flex gap-2",children:[w.jsx(Tn,{"data-slot":"table-pagination-prev",size:"icon",variant:"ghost",disabled:p,onClick:f,children:w.jsx(ky,{"data-slot":"table-pagination-prev-icon"})}),w.jsx(Tn,{"data-slot":"table-pagination-next",size:"icon",variant:"ghost",disabled:m,onClick:c,children:w.jsx(gd,{"data-slot":"table-pagination-next-icon"})})]})]})},[dh,Jce]=Sd(),ede=({children:e,value:t,onChange:n,defaultValue:r,variant:o="default",...i})=>{const[s="",a]=Kt({prop:t,onChange:n,defaultProp:r}),[u,c]=D.useState(null);return w.jsx(Jce,{value:{activeTab:s,setActiveTab:a,setTargetRef:c,targetRef:u,variant:o},children:w.jsx("div",{"data-slot":"tabs",...i,children:e})})},tde=({children:e,className:t,indicatorClassName:n})=>{const{targetRef:r}=dh();return w.jsxs("div",{"data-slot":"tabs-list",className:me("relative mb-4",t),children:[w.jsx("div",{"data-slot":"tabs-content",className:"flex",children:e}),w.jsx(ode,{targetRef:r,indicatorClassName:n})]})},nde=({value:e,className:t,...n})=>{const{activeTab:r,setActiveTab:o,setTargetRef:i,variant:s}=dh(),a=r===e;return w.jsx("button",{"data-slot":"tabs-trigger",...n,type:"button",ref:u=>{a&&i(u)},onClick:()=>o(e),"data-tab":e,"data-selected":a,"aria-selected":a,className:me("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)})},rde=({value:e,...t})=>{const{activeTab:n}=dh();return n===e?w.jsx("div",{"data-slot":"tabs-content",...t}):null},ode=({targetRef:e,indicatorClassName:t})=>{const n=D.useRef(null),r=n?.current,o=D.useRef(null),{variant:i}=dh(),s=()=>{if(!e||!r)return;const a=e.offsetLeft,u=e.offsetWidth;r.style.width=u+"px",r.style.left=a+"px"};return D.useEffect(()=>{if(e)return s(),o.current=new ResizeObserver(s),o.current.observe(e),()=>{o.current?.disconnect()}},[e]),w.jsx("div",{"data-slot":"tabs-indicator",ref:n,className:me("transition-all duration-300 absolute rounded bg-primary",i==="background"?"inset-0 -z-10 h-full top-0":"top-full h-[3px]",t)})},ide=({className:e,...t})=>w.jsx("textarea",{...t,onChange:n=>t.onChange?.(n.target.value),"data-slot":"textarea",className:me("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)}),sde={done:"var(--color-primary)",pending:"#cdcdcd",error:"var(--color-error)"},ade=({items:e,classNameContainer:t,containerProps:n,...r})=>w.jsx(x4,{className:t,...n,children:e.map((o,i)=>w.jsx(w4,{icon:o.icon,color:o.color,status:o.status,...r,children:o.content},i))}),x4=e=>w.jsx("ul",{"data-slot":"timeline",...e,className:me("relative flex justify-center flex-col border-input",e.className)}),w4=({icon:e,status:t,color:n,classNameItemDot:r,classNameItemContainerDot:o,classNameItemContent:i,itemsProps:s,children:a,...u})=>w.jsxs("li",{"data-slot":"timeline-item",className:me("rounded-lg w-full px-2 gap-1 grid hover:bg-muted transition-colors ease-in grid-cols-[minmax(auto,20px)_1fr]",u.className),...u,children:[w.jsx(E4,{icon:e,status:t,color:n,classNameDot:r,classNameContainerDot:o}),w.jsx(C4,{className:i,...s,children:a})]}),E4=({icon:e,status:t="pending",color:n,classNameDot:r,classNameContainerDot:o})=>w.jsx("div",{"data-slot":"timeline-item-dot",className:me("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:w.jsx("div",{"data-slot":"timeline-item-dot-icon",className:me("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",r),style:{backgroundColor:n||sde?.[t]},children:e})}),C4=e=>w.jsx("div",{"data-slot":"timeline-item-content",...e,className:me("grow px-2 pb-4 pt-2",e.className)}),lde=D.createContext(null);D.createContext(null);D.createContext(null);D.createContext(null);D.createContext(null);D.createContext({});D.createContext(null);D.createContext(null);const sn=typeof document<"u"?D.useLayoutEffect:()=>{};var $v;const ude=($v=D.useInsertionEffect)!==null&&$v!==void 0?$v:sn;function Kn(e){const t=D.useRef(null);return ude(()=>{t.current=e},[e]),D.useCallback((...n)=>{const r=t.current;return r?.(...n)},[])}function cde(e){let[t,n]=D.useState(e),r=D.useRef(null),o=Kn(()=>{if(!r.current)return;let s=r.current.next();if(s.done){r.current=null;return}t===s.value?o():n(s.value)});sn(()=>{r.current&&o()});let i=Kn(s=>{r.current=s(t),o()});return[t,i]}const dm={prefix:String(Math.round(Math.random()*1e10)),current:0},R4=D.createContext(dm),dde=D.createContext(!1);let fde=!!(typeof window<"u"&&window.document&&window.document.createElement),Dv=new WeakMap;function pde(e=!1){let t=D.useContext(R4),n=D.useRef(null);if(n.current===null&&!e){var r,o;let i=(o=D.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)===null||o===void 0||(r=o.ReactCurrentOwner)===null||r===void 0?void 0:r.current;if(i){let s=Dv.get(i);s==null?Dv.set(i,{id:t.current,state:i.memoizedState}):i.memoizedState!==s.state&&(t.current=s.id,Dv.delete(i))}n.current=++t.current}return n.current}function mde(e){let t=D.useContext(R4);t===dm&&!fde&&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 n=pde(!!e),r=t===dm&&process.env.NODE_ENV==="test"?"react-aria":`react-aria${t.prefix}`;return e||`${r}-${n}`}function hde(e){let t=D.useId(),[n]=D.useState(Hd()),r=n||process.env.NODE_ENV==="test"?"react-aria":`react-aria${dm.prefix}`;return e||`${r}-${t}`}const gde=typeof D.useId=="function"?hde:mde;function vde(){return!1}function bde(){return!0}function yde(e){return()=>{}}function Hd(){return typeof D.useSyncExternalStore=="function"?D.useSyncExternalStore(yde,vde,bde):D.useContext(dde)}let xde=!!(typeof window<"u"&&window.document&&window.document.createElement),oa=new Map,Hc;typeof FinalizationRegistry<"u"&&(Hc=new FinalizationRegistry(e=>{oa.delete(e)}));function Ho(e){let[t,n]=D.useState(e),r=D.useRef(null),o=gde(t),i=D.useRef(null);if(Hc&&Hc.register(i,o),xde){const s=oa.get(o);s&&!s.includes(r)?s.push(r):oa.set(o,[r])}return sn(()=>{let s=o;return()=>{Hc&&Hc.unregister(i),oa.delete(s)}},[o]),D.useEffect(()=>{let s=r.current;return s&&n(s),()=>{s&&(r.current=null)}}),o}function wde(e,t){if(e===t)return e;let n=oa.get(e);if(n)return n.forEach(o=>o.current=t),t;let r=oa.get(t);return r?(r.forEach(o=>o.current=e),e):t}function Ede(e=[]){let t=Ho(),[n,r]=cde(t),o=D.useCallback(()=>{r(function*(){yield t,yield document.getElementById(t)?t:void 0})},[t,r]);return sn(o,[t,o,...e]),n}function fh(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}const xt=e=>{var t;return(t=e?.ownerDocument)!==null&&t!==void 0?t:document},Tr=e=>e&&"window"in e&&e.window===e?e:xt(e).defaultView||window;function Cde(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function Rde(e){return Cde(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let Sde=!1;function ph(){return Sde}function qt(e,t){if(!ph())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let n=t;for(;n!==null;){if(n===e)return!0;n.tagName==="SLOT"&&n.assignedSlot?n=n.assignedSlot.parentNode:Rde(n)?n=n.host:n=n.parentNode}return!1}const Nn=(e=document)=>{var t;if(!ph())return e.activeElement;let n=e.activeElement;for(;n&&"shadowRoot"in n&&(!((t=n.shadowRoot)===null||t===void 0)&&t.activeElement);)n=n.shadowRoot.activeElement;return n};function ht(e){return ph()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}class Pde{get currentNode(){return this._currentNode}set currentNode(t){if(!qt(this.root,t))throw new Error("Cannot set currentNode to a node that is not contained by the root node.");const n=[];let r=t,o=t;for(this._currentNode=t;r&&r!==this.root;)if(r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const s=r,a=this._doc.createTreeWalker(s,this.whatToShow,{acceptNode:this._acceptNode});n.push(a),a.currentNode=o,this._currentSetFor.add(a),r=o=s.host}else r=r.parentNode;const i=this._doc.createTreeWalker(this.root,this.whatToShow,{acceptNode:this._acceptNode});n.push(i),i.currentNode=o,this._currentSetFor.add(i),this._walkerStack=n}get doc(){return this._doc}firstChild(){let t=this.currentNode,n=this.nextNode();return qt(t,n)?(n&&(this.currentNode=n),n):(this.currentNode=t,null)}lastChild(){let n=this._walkerStack[0].lastChild();return n&&(this.currentNode=n),n}nextNode(){const t=this._walkerStack[0].nextNode();if(t){if(t.shadowRoot){var n;let o;if(typeof this.filter=="function"?o=this.filter(t):!((n=this.filter)===null||n===void 0)&&n.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 r=this.nextNode();return r&&(this.currentNode=r),r}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 n=t.previousNode();if(n){if(n.shadowRoot){var r;let i;if(typeof this.filter=="function"?i=this.filter(n):!((r=this.filter)===null||r===void 0)&&r.acceptNode&&(i=this.filter.acceptNode(n)),i===NodeFilter.FILTER_ACCEPT)return n&&(this.currentNode=n),n;let s=this.lastChild();return s&&(this.currentNode=s),s}return n&&(this.currentNode=n),n}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,n,r,o){this._walkerStack=[],this._currentSetFor=new Set,this._acceptNode=s=>{if(s.nodeType===Node.ELEMENT_NODE){const u=s.shadowRoot;if(u){const c=this._doc.createTreeWalker(u,this.whatToShow,{acceptNode:this._acceptNode});return this._walkerStack.unshift(c),NodeFilter.FILTER_ACCEPT}else{var a;if(typeof this.filter=="function")return this.filter(s);if(!((a=this.filter)===null||a===void 0)&&a.acceptNode)return this.filter.acceptNode(s);if(this.filter===null)return NodeFilter.FILTER_ACCEPT}}return NodeFilter.FILTER_SKIP},this._doc=t,this.root=n,this.filter=o??null,this.whatToShow=r??NodeFilter.SHOW_ALL,this._currentNode=n,this._walkerStack.unshift(t.createTreeWalker(n,r,this._acceptNode));const i=n.shadowRoot;if(i){const s=this._doc.createTreeWalker(i,this.whatToShow,{acceptNode:this._acceptNode});this._walkerStack.unshift(s)}}}function Tde(e,t,n,r){return ph()?new Pde(e,t,n,r):e.createTreeWalker(t,n,r)}function wn(...e){let t={...e[0]};for(let n=1;n<e.length;n++){let r=e[n];for(let o in r){let i=t[o],s=r[o];typeof i=="function"&&typeof s=="function"&&o[0]==="o"&&o[1]==="n"&&o.charCodeAt(2)>=65&&o.charCodeAt(2)<=90?t[o]=fh(i,s):(o==="className"||o==="UNSAFE_className")&&typeof i=="string"&&typeof s=="string"?t[o]=Ny(i,s):o==="id"&&i&&s?t.id=wde(i,s):t[o]=s!==void 0?s:i}}return t}function _de(...e){return e.length===1&&e[0]?e[0]:t=>{let n=!1;const r=e.map(o=>{const i=KT(o,t);return n||(n=typeof i=="function"),i});if(n)return()=>{r.forEach((o,i)=>{typeof o=="function"?o():KT(e[i],null)})}}}function KT(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}const Ode=new Set(["id"]),$de=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),Dde=new Set(["href","hrefLang","target","rel","download","ping","referrerPolicy"]),Mde=new Set(["dir","lang","hidden","inert","translate"]),HT=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"]),Ade=/^(data-.*)$/;function Sa(e,t={}){let{labelable:n,isLink:r,global:o,events:i=o,propNames:s}=t,a={};for(const u in e)Object.prototype.hasOwnProperty.call(e,u)&&(Ode.has(u)||n&&$de.has(u)||r&&Dde.has(u)||o&&Mde.has(u)||i&&HT.has(u)||u.endsWith("Capture")&&HT.has(u.slice(0,-7))||s?.has(u)||Ade.test(u))&&(a[u]=e[u]);return a}function Wo(e){if(Nde())e.focus({preventScroll:!0});else{let t=Ide(e);e.focus(),kde(t)}}let gp=null;function Nde(){if(gp==null){gp=!1;try{document.createElement("div").focus({get preventScroll(){return gp=!0,!0}})}catch{}}return gp}function Ide(e){let t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function kde(e){for(let{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}function mh(e){var t;if(typeof window>"u"||window.navigator==null)return!1;let n=(t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands;return Array.isArray(n)&&n.some(r=>e.test(r.brand))||e.test(window.navigator.userAgent)}function vw(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 Xo(e){if(process.env.NODE_ENV==="test")return e;let t=null;return()=>(t==null&&(t=e()),t)}const gs=Xo(function(){return vw(/^Mac/i)}),Fde=Xo(function(){return vw(/^iPhone/i)}),S4=Xo(function(){return vw(/^iPad/i)||gs()&&navigator.maxTouchPoints>1}),bw=Xo(function(){return Fde()||S4()}),Lde=Xo(function(){return gs()||bw()}),qde=Xo(function(){return mh(/AppleWebKit/i)&&!yw()}),yw=Xo(function(){return mh(/Chrome/i)}),xw=Xo(function(){return mh(/Android/i)}),jde=Xo(function(){return mh(/Firefox/i)}),Bde=D.createContext({isNative:!0,open:Kde,useHref:e=>e});function ww(){return D.useContext(Bde)}function vs(e,t,n=!0){var r,o;let{metaKey:i,ctrlKey:s,altKey:a,shiftKey:u}=t;jde()&&(!((o=window.event)===null||o===void 0||(r=o.type)===null||r===void 0)&&r.startsWith("key"))&&e.target==="_blank"&&(gs()?i=!0:s=!0);let c=qde()&&gs()&&!S4()&&process.env.NODE_ENV!=="test"?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:i,ctrlKey:s,altKey:a,shiftKey:u}):new MouseEvent("click",{metaKey:i,ctrlKey:s,altKey:a,shiftKey:u,bubbles:!0,cancelable:!0});vs.isOpening=n,Wo(e),e.dispatchEvent(c),vs.isOpening=!1}vs.isOpening=!1;function Vde(e,t){if(e instanceof HTMLAnchorElement)t(e);else if(e.hasAttribute("data-href")){let n=document.createElement("a");n.href=e.getAttribute("data-href"),e.hasAttribute("data-target")&&(n.target=e.getAttribute("data-target")),e.hasAttribute("data-rel")&&(n.rel=e.getAttribute("data-rel")),e.hasAttribute("data-download")&&(n.download=e.getAttribute("data-download")),e.hasAttribute("data-ping")&&(n.ping=e.getAttribute("data-ping")),e.hasAttribute("data-referrer-policy")&&(n.referrerPolicy=e.getAttribute("data-referrer-policy")),e.appendChild(n),t(n),e.removeChild(n)}}function Kde(e,t){Vde(e,n=>vs(n,t))}function Hde(e){let t=ww();var n;const r=t.useHref((n=e.href)!==null&&n!==void 0?n:"");return{"data-href":e.href?r:void 0,"data-target":e.target,"data-rel":e.rel,"data-download":e.download,"data-ping":e.ping,"data-referrer-policy":e.referrerPolicy}}let yi=new Map,jb=new Set;function WT(){if(typeof window>"u")return;function e(r){return"propertyName"in r}let t=r=>{if(!e(r)||!r.target)return;let o=yi.get(r.target);o||(o=new Set,yi.set(r.target,o),r.target.addEventListener("transitioncancel",n,{once:!0})),o.add(r.propertyName)},n=r=>{if(!e(r)||!r.target)return;let o=yi.get(r.target);if(o&&(o.delete(r.propertyName),o.size===0&&(r.target.removeEventListener("transitioncancel",n),yi.delete(r.target)),yi.size===0)){for(let i of jb)i();jb.clear()}};document.body.addEventListener("transitionrun",t),document.body.addEventListener("transitionend",n)}typeof document<"u"&&(document.readyState!=="loading"?WT():document.addEventListener("DOMContentLoaded",WT));function Wde(){for(const[e]of yi)"isConnected"in e&&!e.isConnected&&yi.delete(e)}function P4(e){requestAnimationFrame(()=>{Wde(),yi.size===0?e():jb.add(e)})}function hh(){let e=D.useRef(new Map),t=D.useCallback((o,i,s,a)=>{let u=a?.once?(...c)=>{e.current.delete(s),s(...c)}:s;e.current.set(s,{type:i,eventTarget:o,fn:u,options:a}),o.addEventListener(i,u,a)},[]),n=D.useCallback((o,i,s,a)=>{var u;let c=((u=e.current.get(s))===null||u===void 0?void 0:u.fn)||s;o.removeEventListener(i,c,a),e.current.delete(s)},[]),r=D.useCallback(()=>{e.current.forEach((o,i)=>{n(o.eventTarget,o.type,i,o.options)})},[n]);return D.useEffect(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function Ude(e,t){let{id:n,"aria-label":r,"aria-labelledby":o}=e;return n=Ho(n),o&&r?o=[...new Set([n,...o.trim().split(/\s+/)])].join(" "):o&&(o=o.trim().split(/\s+/).join(" ")),!r&&!o&&t&&(r=t),{id:n,"aria-label":r,"aria-labelledby":o}}function gh(e){const t=D.useRef(null),n=D.useRef(void 0),r=D.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 D.useMemo(()=>({get current(){return t.current},set current(o){t.current=o,n.current&&(n.current(),n.current=void 0),o!=null&&(n.current=r(o))}}),[r])}function zde(e,t){const n=D.useRef(!0),r=D.useRef(null);D.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[]),D.useEffect(()=>{let o=r.current;n.current?n.current=!1:(!o||t.some((i,s)=>!Object.is(i,o[s])))&&e(),r.current=t},t)}function UT(e,t){const n=D.useRef(!0),r=D.useRef(null);sn(()=>(n.current=!0,()=>{n.current=!1}),[]),sn(()=>{n.current?n.current=!1:(!r.current||t.some((o,i)=>!Object.is(o,r[i])))&&e(),r.current=t},t)}function T4(e,t){sn(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref&&(e.ref.current=null)}})}function ud(e,t){if(!e)return!1;let n=window.getComputedStyle(e),r=/(auto|scroll)/.test(n.overflow+n.overflowX+n.overflowY);return r&&t&&(r=e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth),r}function es(e,t){let n=e;for(ud(n,t)&&(n=n.parentElement);n&&!ud(n,t);)n=n.parentElement;return n||document.scrollingElement||document.documentElement}function Gde(e,t){const n=[];for(;e&&e!==document.documentElement;)ud(e,t)&&n.push(e),e=e.parentElement;return n}function Qs(e){return gs()?e.metaKey:e.ctrlKey}let Yde=0;const Mv=new Map;function _4(e){let[t,n]=D.useState();return sn(()=>{if(!e)return;let r=Mv.get(e);if(r)n(r.element.id);else{let o=`react-aria-description-${Yde++}`;n(o);let i=document.createElement("div");i.id=o,i.style.display="none",i.textContent=e,document.body.appendChild(i),r={refCount:0,element:i},Mv.set(e,r)}return r.refCount++,()=>{r&&--r.refCount===0&&(r.element.remove(),Mv.delete(e))}},[e]),{"aria-describedby":e?t:void 0}}function vp(e,t,n,r){let o=Kn(n),i=n==null;D.useEffect(()=>{if(i||!e.current)return;let s=e.current;return s.addEventListener(t,o,r),()=>{s.removeEventListener(t,o,r)}},[e,t,r,i,o])}function O4(e,t){let n=zT(e,t,"left"),r=zT(e,t,"top"),o=t.offsetWidth,i=t.offsetHeight,s=e.scrollLeft,a=e.scrollTop,{borderTopWidth:u,borderLeftWidth:c,scrollPaddingTop:f,scrollPaddingRight:p,scrollPaddingBottom:m,scrollPaddingLeft:b}=getComputedStyle(e),{scrollMarginTop:y,scrollMarginRight:v,scrollMarginBottom:E,scrollMarginLeft:x}=getComputedStyle(t),R=s+parseInt(c,10),P=a+parseInt(u,10),O=R+e.clientWidth,S=P+e.clientHeight,T=parseInt(f,10)||0,_=parseInt(m,10)||0,$=parseInt(p,10)||0,V=parseInt(b,10)||0,U=parseInt(y,10)||0,A=parseInt(E,10)||0,H=parseInt(v,10)||0,F=parseInt(x,10)||0,N=n-F,j=n+o+H,I=r-U,k=r+i+A,q=s+parseInt(c,10)+V,z=O-$,W=a+parseInt(u,10)+T,te=S-_;if((N>q||j<z)&&(N<=s+V?s=N-parseInt(c,10)-V:j>O-$&&(s+=j-O+$)),(I>W||k<te)&&(I<=P+T?a=I-parseInt(u,10)-T:k>S-_&&(a+=k-S+_)),process.env.NODE_ENV==="test"){e.scrollLeft=s,e.scrollTop=a;return}e.scrollTo({left:s,top:a})}function zT(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){o-=e[r];break}t=t.offsetParent}return o}function bi(e,t){if(e&&document.contains(e)){let s=document.scrollingElement||document.documentElement;if(!(window.getComputedStyle(s).overflow==="hidden")&&!yw()){var n;let{left:u,top:c}=e.getBoundingClientRect();e==null||(n=e.scrollIntoView)===null||n===void 0||n.call(e,{block:"nearest"});let{left:f,top:p}=e.getBoundingClientRect();if(Math.abs(u-f)>1||Math.abs(c-p)>1){var r,o,i;t==null||(o=t.containingElement)===null||o===void 0||(r=o.scrollIntoView)===null||r===void 0||r.call(o,{block:"center",inline:"center"}),(i=e.scrollIntoView)===null||i===void 0||i.call(e,{block:"nearest"})}}else{let u=Gde(e);for(let c of u)O4(c,e)}}}function Bb(e){return e.pointerType===""&&e.isTrusted?!0:xw()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Xde(e){return!xw()&&e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"}function Zde(e,t){let{collection:n,onLoadMore:r,scrollOffset:o=1}=e,i=D.useRef(null),s=Kn(a=>{for(let u of a)u.isIntersecting&&r&&r()});sn(()=>(t.current&&(i.current=new IntersectionObserver(s,{root:es(t?.current),rootMargin:`0px ${100*o}% ${100*o}% ${100*o}%`}),i.current.observe(t.current)),()=>{i.current&&i.current.disconnect()}),[n,s,t,o])}function Qde(e){const t=D.version.split(".");return parseInt(t[0],10)>=19?e:e?"true":void 0}const Jde="react-aria-clear-focus",efe="react-aria-focus",tfe=typeof Element<"u"&&"checkVisibility"in Element.prototype;function nfe(e){const t=Tr(e);if(!(e instanceof t.HTMLElement)&&!(e instanceof t.SVGElement))return!1;let{display:n,visibility:r}=e.style,o=n!=="none"&&r!=="hidden"&&r!=="collapse";if(o){const{getComputedStyle:i}=e.ownerDocument.defaultView;let{display:s,visibility:a}=i(e);o=s!=="none"&&a!=="hidden"&&a!=="collapse"}return o}function rfe(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 Ew(e,t){return tfe?e.checkVisibility({visibilityProperty:!0})&&!e.closest("[data-react-aria-prevent-focus]"):e.nodeName!=="#comment"&&nfe(e)&&rfe(e,t)&&(!e.parentElement||Ew(e.parentElement,e))}const Cw=["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"],ofe=Cw.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";Cw.push('[tabindex]:not([tabindex="-1"]):not([disabled])');const ife=Cw.join(':not([hidden]):not([tabindex="-1"]),');function $4(e){return e.matches(ofe)&&Ew(e)&&!D4(e)}function sfe(e){return e.matches(ife)&&Ew(e)&&!D4(e)}function D4(e){let t=e;for(;t!=null;){if(t instanceof t.ownerDocument.defaultView.HTMLElement&&t.inert)return!0;t=t.parentElement}return!1}function Rw(e,t,n){let[r,o]=D.useState(e||t),i=D.useRef(e!==void 0),s=e!==void 0;D.useEffect(()=>{let c=i.current;c!==s&&process.env.NODE_ENV!=="production"&&console.warn(`WARN: A component changed from ${c?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}.`),i.current=s},[s]);let a=s?e:r,u=D.useCallback((c,...f)=>{let p=(m,...b)=>{n&&(Object.is(a,m)||n(m,...b)),s||(a=m)};typeof c=="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,...y)=>{let v=c(s?a:b,...y);return p(v,...f),s?b:v})):(s||o(c),p(c,...f))},[s,a,n]);return[a,u]}const M4=Symbol("default");function A4({values:e,children:t}){for(let[n,r]of e)t=D.createElement(n.Provider,{value:r},t);return t}function Pa(e){let{className:t,style:n,children:r,defaultClassName:o,defaultChildren:i,defaultStyle:s,values:a}=e;return D.useMemo(()=>{let u,c,f;return typeof t=="function"?u=t({...a,defaultClassName:o}):u=t,typeof n=="function"?c=n({...a,defaultStyle:s||{}}):c=n,typeof r=="function"?f=r({...a,defaultChildren:i}):r==null?f=i:f=r,{className:u??o,style:c||s?{...s,...c}:void 0,children:f??i,"data-rac":""}},[t,n,r,o,i,s,a])}function N4(e,t){return n=>t(typeof e=="function"?e(n):e,n)}function afe(e,t){let n=D.useContext(e);if(t===null)return null;if(n&&typeof n=="object"&&"slots"in n&&n.slots){let r=t||M4;if(!n.slots[r]){let o=new Intl.ListFormat().format(Object.keys(n.slots).map(s=>`"${s}"`)),i=t?`Invalid slot "${t}".`:"A slot prop is required.";throw new Error(`${i} Valid slot names are ${o}.`)}return n.slots[r]}return n}function I4(e,t,n){let r=afe(n,e.slot)||{},{ref:o,...i}=r,s=gh(D.useMemo(()=>_de(t,o),[t,o])),a=wn(i,e);return"style"in i&&i.style&&"style"in e&&e.style&&(typeof i.style=="function"||typeof e.style=="function"?a.style=u=>{let c=typeof i.style=="function"?i.style(u):i.style,f={...u.defaultStyle,...c},p=typeof e.style=="function"?e.style({...u,defaultStyle:f}):e.style;return{...f,...p}}:a.style={...i.style,...e.style}),[a,s]}const k4=7e3;let ro=null;function Vb(e,t="assertive",n=k4){ro?ro.announce(e,t,n):(ro=new lfe,(typeof IS_REACT_ACT_ENVIRONMENT=="boolean"?IS_REACT_ACT_ENVIRONMENT:typeof jest<"u")?ro.announce(e,t,n):setTimeout(()=>{ro?.isAttached()&&ro?.announce(e,t,n)},100))}class lfe{isAttached(){var t;return(t=this.node)===null||t===void 0?void 0:t.isConnected}createLog(t){let n=document.createElement("div");return n.setAttribute("role","log"),n.setAttribute("aria-live",t),n.setAttribute("aria-relevant","additions"),n}destroy(){this.node&&(document.body.removeChild(this.node),this.node=null)}announce(t,n="assertive",r=k4){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,n==="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()},r)}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 ufe=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),cfe=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function dfe(e){if(Intl.Locale){let n=new Intl.Locale(e).maximize(),r=typeof n.getTextInfo=="function"?n.getTextInfo():n.textInfo;if(r)return r.direction==="rtl";if(n.script)return ufe.has(n.script)}let t=e.split("-")[0];return cfe.has(t)}const ffe=Symbol.for("react-aria.i18n.locale");function F4(){let e=typeof window<"u"&&window[ffe]||typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:dfe(e)?"rtl":"ltr"}}let Kb=F4(),Wc=new Set;function GT(){Kb=F4();for(let e of Wc)e(Kb)}function pfe(){let e=Hd(),[t,n]=D.useState(Kb);return D.useEffect(()=>(Wc.size===0&&window.addEventListener("languagechange",GT),Wc.add(n),()=>{Wc.delete(n),Wc.size===0&&window.removeEventListener("languagechange",GT)}),[]),e?{locale:"en-US",direction:"ltr"}:t}const mfe=D.createContext(null);function Wd(){let e=pfe();return D.useContext(mfe)||e}const hfe=Symbol.for("react-aria.i18n.locale"),gfe=Symbol.for("react-aria.i18n.strings");let zs;class vh{getStringForLocale(t,n){let o=this.getStringsForLocale(n)[t];if(!o)throw new Error(`Could not find intl message ${t} in ${n} locale`);return o}getStringsForLocale(t){let n=this.strings[t];return n||(n=vfe(t,this.strings,this.defaultLocale),this.strings[t]=n),n}static getGlobalDictionaryForPackage(t){if(typeof window>"u")return null;let n=window[hfe];if(zs===void 0){let o=window[gfe];if(!o)return null;zs={};for(let i in o)zs[i]=new vh({[n]:o[i]},n)}let r=zs?.[t];if(!r)throw new Error(`Strings for package "${t}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);return r}constructor(t,n="en-US"){this.strings=Object.fromEntries(Object.entries(t).filter(([,r])=>r)),this.defaultLocale=n}}function vfe(e,t,n="en-US"){if(t[e])return t[e];let r=bfe(e);if(t[r])return t[r];for(let o in t)if(o.startsWith(r+"-"))return t[o];return t[n]}function bfe(e){return Intl.Locale?new Intl.Locale(e).language:e.split("-")[0]}const YT=new Map,XT=new Map;class yfe{format(t,n){let r=this.strings.getStringForLocale(t,this.locale);return typeof r=="function"?r(n,this):r}plural(t,n,r="cardinal"){let o=n["="+t];if(o)return typeof o=="function"?o():o;let i=this.locale+":"+r,s=YT.get(i);s||(s=new Intl.PluralRules(this.locale,{type:r}),YT.set(i,s));let a=s.select(t);return o=n[a]||n.other,typeof o=="function"?o():o}number(t){let n=XT.get(this.locale);return n||(n=new Intl.NumberFormat(this.locale),XT.set(this.locale,n)),n.format(t)}select(t,n){let r=t[n]||t.other;return typeof r=="function"?r():r}constructor(t,n){this.locale=t,this.strings=n}}const ZT=new WeakMap;function xfe(e){let t=ZT.get(e);return t||(t=new vh(e),ZT.set(e,t)),t}function wfe(e,t){return t&&vh.getGlobalDictionaryForPackage(t)||xfe(e)}function bh(e,t){let{locale:n}=Wd(),r=wfe(e,t);return D.useMemo(()=>new yfe(n,r),[n,r])}function Efe(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Cfe(e,t,n){Efe(e,t),t.set(e,n)}let Av=new Map;function L4(e){let{locale:t}=Wd(),n=t+(e?Object.entries(e).sort((o,i)=>o[0]<i[0]?-1:1).join():"");if(Av.has(n))return Av.get(n);let r=new Intl.Collator(t,e);return Av.set(n,r),r}function Sw(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function q4(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function j4(e){let t=D.useRef({isFocused:!1,observer:null});sn(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=Kn(r=>{e?.(r)});return D.useCallback(r=>{if(r.target instanceof HTMLButtonElement||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLSelectElement){t.current.isFocused=!0;let o=r.target,i=s=>{if(t.current.isFocused=!1,o.disabled){let a=Sw(s);n(a)}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 a=o===document.activeElement?null:document.activeElement;o.dispatchEvent(new FocusEvent("blur",{relatedTarget:a})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:a}))}}),t.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[n])}let fm=!1;function QT(e){for(;e&&!$4(e);)e=e.parentElement;let t=Tr(e),n=t.document.activeElement;if(!n||n===e)return;fm=!0;let r=!1,o=f=>{(f.target===n||r)&&f.stopImmediatePropagation()},i=f=>{(f.target===n||r)&&(f.stopImmediatePropagation(),!e&&!r&&(r=!0,Wo(n),u()))},s=f=>{(f.target===e||r)&&f.stopImmediatePropagation()},a=f=>{(f.target===e||r)&&(f.stopImmediatePropagation(),r||(r=!0,Wo(n),u()))};t.addEventListener("blur",o,!0),t.addEventListener("focusout",i,!0),t.addEventListener("focusin",a,!0),t.addEventListener("focus",s,!0);let u=()=>{cancelAnimationFrame(c),t.removeEventListener("blur",o,!0),t.removeEventListener("focusout",i,!0),t.removeEventListener("focusin",a,!0),t.removeEventListener("focus",s,!0),fm=!1,r=!1},c=requestAnimationFrame(u);return u}let Js="default",Hb="",Dp=new WeakMap;function JT(e){if(bw()){if(Js==="default"){const t=xt(e);Hb=t.documentElement.style.webkitUserSelect,t.documentElement.style.webkitUserSelect="none"}Js="disabled"}else if(e instanceof HTMLElement||e instanceof SVGElement){let t="userSelect"in e.style?"userSelect":"webkitUserSelect";Dp.set(e,e.style[t]),e.style[t]="none"}}function Nv(e){if(bw()){if(Js!=="disabled")return;Js="restoring",setTimeout(()=>{P4(()=>{if(Js==="restoring"){const t=xt(e);t.documentElement.style.webkitUserSelect==="none"&&(t.documentElement.style.webkitUserSelect=Hb||""),Hb="",Js="default"}})},300)}else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&Dp.has(e)){let t=Dp.get(e),n="userSelect"in e.style?"userSelect":"webkitUserSelect";e.style[n]==="none"&&(e.style[n]=t),e.getAttribute("style")===""&&e.removeAttribute("style"),Dp.delete(e)}}const B4=D.createContext({register:()=>{}});B4.displayName="PressResponderContext";function Rfe(e,t){return t.get?t.get.call(e):t.value}function V4(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function Sfe(e,t){var n=V4(e,t,"get");return Rfe(e,n)}function Pfe(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}function e_(e,t,n){var r=V4(e,t,"set");return Pfe(e,r,n),n}function Tfe(e){let t=D.useContext(B4);if(t){let{register:n,...r}=t;e=wn(r,e),n()}return T4(t,e.ref),e}var bp=new WeakMap;class yp{continuePropagation(){e_(this,bp,!1)}get shouldStopPropagation(){return Sfe(this,bp)}constructor(t,n,r,o){Cfe(this,bp,{writable:!0,value:void 0}),e_(this,bp,!0);var i;let s=(i=o?.target)!==null&&i!==void 0?i:r.currentTarget;const a=s?.getBoundingClientRect();let u,c=0,f,p=null;r.clientX!=null&&r.clientY!=null&&(f=r.clientX,p=r.clientY),a&&(f!=null&&p!=null?(u=f-a.left,c=p-a.top):(u=a.width/2,c=a.height/2)),this.type=t,this.pointerType=n,this.target=r.currentTarget,this.shiftKey=r.shiftKey,this.metaKey=r.metaKey,this.ctrlKey=r.ctrlKey,this.altKey=r.altKey,this.x=u,this.y=c}}const t_=Symbol("linkClicked"),n_="react-aria-pressable-style",r_="data-react-aria-pressable";function Pw(e){let{onPress:t,onPressChange:n,onPressStart:r,onPressEnd:o,onPressUp:i,onClick:s,isDisabled:a,isPressed:u,preventFocusOnPress:c,shouldCancelOnPointerExit:f,allowTextSelectionOnPress:p,ref:m,...b}=Tfe(e),[y,v]=D.useState(!1),E=D.useRef({isPressed:!1,ignoreEmulatedMouseEvents:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null,disposables:[]}),{addGlobalListener:x,removeAllGlobalListeners:R}=hh(),P=Kn((A,H)=>{let F=E.current;if(a||F.didFirePressStart)return!1;let N=!0;if(F.isTriggeringEvent=!0,r){let j=new yp("pressstart",H,A);r(j),N=j.shouldStopPropagation}return n&&n(!0),F.isTriggeringEvent=!1,F.didFirePressStart=!0,v(!0),N}),O=Kn((A,H,F=!0)=>{let N=E.current;if(!N.didFirePressStart)return!1;N.didFirePressStart=!1,N.isTriggeringEvent=!0;let j=!0;if(o){let I=new yp("pressend",H,A);o(I),j=I.shouldStopPropagation}if(n&&n(!1),v(!1),t&&F&&!a){let I=new yp("press",H,A);t(I),j&&(j=I.shouldStopPropagation)}return N.isTriggeringEvent=!1,j}),S=Kn((A,H)=>{let F=E.current;if(a)return!1;if(i){F.isTriggeringEvent=!0;let N=new yp("pressup",H,A);return i(N),F.isTriggeringEvent=!1,N.shouldStopPropagation}return!0}),T=Kn(A=>{let H=E.current;if(H.isPressed&&H.target){H.didFirePressStart&&H.pointerType!=null&&O(Xi(H.target,A),H.pointerType,!1),H.isPressed=!1,H.isOverTarget=!1,H.activePointerId=null,H.pointerType=null,R(),p||Nv(H.target);for(let F of H.disposables)F();H.disposables=[]}}),_=Kn(A=>{f&&T(A)}),$=Kn(A=>{a||s?.(A)}),V=Kn((A,H)=>{if(!a&&s){let F=new MouseEvent("click",A);q4(F,H),s(Sw(F))}}),U=D.useMemo(()=>{let A=E.current,H={onKeyDown(N){if(Iv(N.nativeEvent,N.currentTarget)&&qt(N.currentTarget,ht(N.nativeEvent))){var j;s_(ht(N.nativeEvent),N.key)&&N.preventDefault();let I=!0;if(!A.isPressed&&!N.repeat){A.target=N.currentTarget,A.isPressed=!0,A.pointerType="keyboard",I=P(N,"keyboard");let k=N.currentTarget,q=z=>{Iv(z,k)&&!z.repeat&&qt(k,ht(z))&&A.target&&S(Xi(A.target,z),"keyboard")};x(xt(N.currentTarget),"keyup",fh(q,F),!0)}I&&N.stopPropagation(),N.metaKey&&gs()&&((j=A.metaKeyEvents)===null||j===void 0||j.set(N.key,N.nativeEvent))}else N.key==="Meta"&&(A.metaKeyEvents=new Map)},onClick(N){if(!(N&&!qt(N.currentTarget,ht(N.nativeEvent)))&&N&&N.button===0&&!A.isTriggeringEvent&&!vs.isOpening){let j=!0;if(a&&N.preventDefault(),!A.ignoreEmulatedMouseEvents&&!A.isPressed&&(A.pointerType==="virtual"||Bb(N.nativeEvent))){let I=P(N,"virtual"),k=S(N,"virtual"),q=O(N,"virtual");$(N),j=I&&k&&q}else if(A.isPressed&&A.pointerType!=="keyboard"){let I=A.pointerType||N.nativeEvent.pointerType||"virtual",k=S(Xi(N.currentTarget,N),I),q=O(Xi(N.currentTarget,N),I,!0);j=k&&q,A.isOverTarget=!1,$(N),T(N)}A.ignoreEmulatedMouseEvents=!1,j&&N.stopPropagation()}}},F=N=>{var j;if(A.isPressed&&A.target&&Iv(N,A.target)){var I;s_(ht(N),N.key)&&N.preventDefault();let q=ht(N),z=qt(A.target,ht(N));O(Xi(A.target,N),"keyboard",z),z&&V(N,A.target),R(),N.key!=="Enter"&&Tw(A.target)&&qt(A.target,q)&&!N[t_]&&(N[t_]=!0,vs(A.target,N,!1)),A.isPressed=!1,(I=A.metaKeyEvents)===null||I===void 0||I.delete(N.key)}else if(N.key==="Meta"&&(!((j=A.metaKeyEvents)===null||j===void 0)&&j.size)){var k;let q=A.metaKeyEvents;A.metaKeyEvents=void 0;for(let z of q.values())(k=A.target)===null||k===void 0||k.dispatchEvent(new KeyboardEvent("keyup",z))}};if(typeof PointerEvent<"u"){H.onPointerDown=I=>{if(I.button!==0||!qt(I.currentTarget,ht(I.nativeEvent)))return;if(Xde(I.nativeEvent)){A.pointerType="virtual";return}A.pointerType=I.pointerType;let k=!0;if(!A.isPressed){A.isPressed=!0,A.isOverTarget=!0,A.activePointerId=I.pointerId,A.target=I.currentTarget,p||JT(A.target),k=P(I,A.pointerType);let q=ht(I.nativeEvent);"releasePointerCapture"in q&&q.releasePointerCapture(I.pointerId),x(xt(I.currentTarget),"pointerup",N,!1),x(xt(I.currentTarget),"pointercancel",j,!1)}k&&I.stopPropagation()},H.onMouseDown=I=>{if(qt(I.currentTarget,ht(I.nativeEvent))&&I.button===0){if(c){let k=QT(I.target);k&&A.disposables.push(k)}I.stopPropagation()}},H.onPointerUp=I=>{!qt(I.currentTarget,ht(I.nativeEvent))||A.pointerType==="virtual"||I.button===0&&!A.isPressed&&S(I,A.pointerType||I.pointerType)},H.onPointerEnter=I=>{I.pointerId===A.activePointerId&&A.target&&!A.isOverTarget&&A.pointerType!=null&&(A.isOverTarget=!0,P(Xi(A.target,I),A.pointerType))},H.onPointerLeave=I=>{I.pointerId===A.activePointerId&&A.target&&A.isOverTarget&&A.pointerType!=null&&(A.isOverTarget=!1,O(Xi(A.target,I),A.pointerType,!1),_(I))};let N=I=>{if(I.pointerId===A.activePointerId&&A.isPressed&&I.button===0&&A.target){if(qt(A.target,ht(I))&&A.pointerType!=null){let k=!1,q=setTimeout(()=>{A.isPressed&&A.target instanceof HTMLElement&&(k?T(I):(Wo(A.target),A.target.click()))},80);x(I.currentTarget,"click",()=>k=!0,!0),A.disposables.push(()=>clearTimeout(q))}else T(I);A.isOverTarget=!1}},j=I=>{T(I)};H.onDragStart=I=>{qt(I.currentTarget,ht(I.nativeEvent))&&T(I)}}else if(process.env.NODE_ENV==="test"){H.onMouseDown=I=>{if(I.button!==0||!qt(I.currentTarget,ht(I.nativeEvent)))return;if(A.ignoreEmulatedMouseEvents){I.stopPropagation();return}if(A.isPressed=!0,A.isOverTarget=!0,A.target=I.currentTarget,A.pointerType=Bb(I.nativeEvent)?"virtual":"mouse",Wr.flushSync(()=>P(I,A.pointerType))&&I.stopPropagation(),c){let q=QT(I.target);q&&A.disposables.push(q)}x(xt(I.currentTarget),"mouseup",N,!1)},H.onMouseEnter=I=>{if(!qt(I.currentTarget,ht(I.nativeEvent)))return;let k=!0;A.isPressed&&!A.ignoreEmulatedMouseEvents&&A.pointerType!=null&&(A.isOverTarget=!0,k=P(I,A.pointerType)),k&&I.stopPropagation()},H.onMouseLeave=I=>{if(!qt(I.currentTarget,ht(I.nativeEvent)))return;let k=!0;A.isPressed&&!A.ignoreEmulatedMouseEvents&&A.pointerType!=null&&(A.isOverTarget=!1,k=O(I,A.pointerType,!1),_(I)),k&&I.stopPropagation()},H.onMouseUp=I=>{qt(I.currentTarget,ht(I.nativeEvent))&&!A.ignoreEmulatedMouseEvents&&I.button===0&&!A.isPressed&&S(I,A.pointerType||"mouse")};let N=I=>{if(I.button===0){if(A.ignoreEmulatedMouseEvents){A.ignoreEmulatedMouseEvents=!1;return}A.target&&A.target.contains(I.target)&&A.pointerType!=null||T(I),A.isOverTarget=!1}};H.onTouchStart=I=>{if(!qt(I.currentTarget,ht(I.nativeEvent)))return;let k=_fe(I.nativeEvent);if(!k)return;A.activePointerId=k.identifier,A.ignoreEmulatedMouseEvents=!0,A.isOverTarget=!0,A.isPressed=!0,A.target=I.currentTarget,A.pointerType="touch",p||JT(A.target),P(pi(A.target,I),A.pointerType)&&I.stopPropagation(),x(Tr(I.currentTarget),"scroll",j,!0)},H.onTouchMove=I=>{if(!qt(I.currentTarget,ht(I.nativeEvent)))return;if(!A.isPressed){I.stopPropagation();return}let k=o_(I.nativeEvent,A.activePointerId),q=!0;k&&i_(k,I.currentTarget)?!A.isOverTarget&&A.pointerType!=null&&(A.isOverTarget=!0,q=P(pi(A.target,I),A.pointerType)):A.isOverTarget&&A.pointerType!=null&&(A.isOverTarget=!1,q=O(pi(A.target,I),A.pointerType,!1),_(pi(A.target,I))),q&&I.stopPropagation()},H.onTouchEnd=I=>{if(!qt(I.currentTarget,ht(I.nativeEvent)))return;if(!A.isPressed){I.stopPropagation();return}let k=o_(I.nativeEvent,A.activePointerId),q=!0;k&&i_(k,I.currentTarget)&&A.pointerType!=null?(S(pi(A.target,I),A.pointerType),q=O(pi(A.target,I),A.pointerType),V(I.nativeEvent,A.target)):A.isOverTarget&&A.pointerType!=null&&(q=O(pi(A.target,I),A.pointerType,!1)),q&&I.stopPropagation(),A.isPressed=!1,A.activePointerId=null,A.isOverTarget=!1,A.ignoreEmulatedMouseEvents=!0,A.target&&!p&&Nv(A.target),R()},H.onTouchCancel=I=>{qt(I.currentTarget,ht(I.nativeEvent))&&(I.stopPropagation(),A.isPressed&&T(pi(A.target,I)))};let j=I=>{A.isPressed&&qt(ht(I),A.target)&&T({currentTarget:A.target,shiftKey:!1,ctrlKey:!1,metaKey:!1,altKey:!1})};H.onDragStart=I=>{qt(I.currentTarget,ht(I.nativeEvent))&&T(I)}}return H},[x,a,c,R,p,T,_,O,P,S,$,V]);return D.useEffect(()=>{if(!m||process.env.NODE_ENV==="test")return;const A=xt(m.current);if(!A||!A.head||A.getElementById(n_))return;const H=A.createElement("style");H.id=n_,H.textContent=`
|
|
135
|
+
`))},[t])}const u=h.useCallback(c=>{o||s(c)},[]);return[a,u]}function cT(e){let t=0;const n=new WeakMap;try{return JSON.stringify(e,function(i,s){if(!(i==="_owner"&&this!=null&&typeof this=="object"&&"$$typeof"in this)){if(typeof s=="bigint")return`__bigint__:${s}`;if(s!==null&&typeof s=="object"){const a=n.get(s);if(a!==void 0)return`__object__:${a}`;n.set(s,t),t+=1}return s}})??`__top__:${typeof e}`}catch{return"__unserializable__"}}let dT=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.indeterminate="data-indeterminate",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({}),fT=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const Gre={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Bc={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Yre={disabled:!1,...Bc},Ym={valid(e){return e===null?null:e?{[fT.valid]:""}:{[fT.invalid]:""}}};function pA(e){return h.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[dT.checked]:""}:{[dT.unchecked]:""}},...Ym}),[e.indeterminate])}const mA=h.createContext({invalid:void 0,name:void 0,validityData:{state:Gre,errors:[],error:"",value:"",initialValue:null},setValidityData:At,disabled:void 0,touched:Bc.touched,setTouched:At,dirty:Bc.dirty,setDirty:At,filled:Bc.filled,setFilled:At,focused:Bc.focused,setFocused:At,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:Yre,markedDirtyRef:{current:!1},registerFieldControl:At,validation:{getValidationProps:(e=yn)=>e,getInputValidationProps:(e=yn)=>e,inputRef:{current:null},commit:async()=>{}}});process.env.NODE_ENV!=="production"&&(mA.displayName="FieldRootContext");function _d(e=!0){const t=h.useContext(mA);if(t.setValidityData===At&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.":zt(28));return t}function px(e,t){const{enabled:n=!0,getValue:r,id:o,value:i}=t,{registerFieldControl:s}=_d(),a=h.useRef(null);a.current||(a.current=Symbol()),Le(()=>{const u=a.current;if(!(!u||!n))return s(u,{controlRef:e,getValue:r,id:o,value:i}),()=>{s(u,void 0)}},[e,n,r,o,s,i])}const hA=h.createContext({disabled:!1});process.env.NODE_ENV!=="production"&&(hA.displayName="FieldItemContext");function Xre(){return h.useContext(hA)}const gA=h.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:At,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});process.env.NODE_ENV!=="production"&&(gA.displayName="FormContext");function mx(){return h.useContext(gA)}const vA=h.createContext({controlId:void 0,registerControlId:At,labelId:void 0,setLabelId:At,messageIds:[],setMessageIds:At,getDescriptionProps:e=>e});process.env.NODE_ENV!=="production"&&(vA.displayName="LabelableContext");function Xm(){return h.useContext(vA)}function bA(e,t,n,r=!0,o){const[i,s]=h.useState(),a=$r(o?`${o}-label`:void 0),u=e??t??i;return Le(()=>{const c=e||t||!r?void 0:Zre(n.current,a);i!==c&&s(c)}),u}function Zre(e,t){const n=Qre(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function Qre(e){if(!e)return;const t=e.parentElement;if(t&&t.tagName==="LABEL")return t;const n=e.id;if(n){const o=e.nextElementSibling;if(o&&o.htmlFor===n)return o}const r=e.labels;return r&&r[0]}const hx=h.createContext(void 0);process.env.NODE_ENV!=="production"&&(hx.displayName="CheckboxGroupContext");function Jre(e=!0){const t=h.useContext(hx);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: CheckboxGroupContext is missing. CheckboxGroup parts must be placed within <CheckboxGroup>.":zt(3));return t}const gx=h.createContext(void 0);process.env.NODE_ENV!=="production"&&(gx.displayName="CheckboxRootContext");function eoe(){const e=h.useContext(gx);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: CheckboxRootContext is missing. Checkbox parts must be placed within <Checkbox.Root>.":zt(14));return e}const yA="data-parent",vx=h.forwardRef(function(t,n){const{checked:r,className:o,defaultChecked:i=!1,"aria-labelledby":s,disabled:a=!1,form:u,id:c,indeterminate:f=!1,inputRef:p,name:m,onCheckedChange:b,parent:y=!1,readOnly:v=!1,render:E,required:x=!1,uncheckedValue:R,value:P,nativeButton:O=!1,style:S,...T}=t,{clearErrors:_}=mx(),{disabled:$,name:V,setDirty:U,setFilled:A,setFocused:H,setTouched:F,state:N,validationMode:j,validityData:I,shouldValidateOnChange:k,validation:q}=_d(),z=Xre(),{labelId:W,controlId:te,registerControlId:X,getDescriptionProps:Q}=Xm(),re=Jre(),ce=re?.parent,se=ce&&re.allValues,ee=$||z.disabled||re?.disabled||a,de=V??m,K=P??de,ue=$r(),le=$r();let Z=te;se?Z=y?le:`${ce.id}-${K}`:c&&(Z=c);let xe={};se&&(y?xe=re.parent.getParentProps():K&&(xe=re.parent.getChildProps(K)));const Re=He(b),{checked:Ae=r,indeterminate:Se=f,onCheckedChange:Oe,...Ye}=xe,Fe=re?.value,G=re?.setValue,J=re?.defaultValue,ie=h.useRef(null),fe=Hn(()=>Symbol("checkbox-control")),pe=h.useRef(!1),{getButtonProps:ge,buttonRef:Ee}=ga({disabled:ee,native:O}),Pe=re?.validation??q,[Ne,st]=fx({controlled:K&&Fe&&!y?Fe.includes(K):Ae,default:K&&J&&!y?J.includes(K):i,name:"Checkbox",state:"checked"});Le(()=>{X!==At&&(pe.current=!0,X(fe.current,Z))},[Z,re,X,y,fe]),h.useEffect(()=>{const tt=fe.current;return()=>{!pe.current||X===At||(pe.current=!1,X(tt,void 0))}},[X,fe]),px(ie,{enabled:!re,id:ue,value:Ne});const ut=h.useRef(null),wt=la(p,ut,Pe.inputRef),dt=bA(s,W,ut,!O,Z??void 0);Le(()=>{ut.current&&(ut.current.indeterminate=Se,Ne&&A(!0))},[Ne,Se,A]),Nm(Ne,()=>{re&&!y||(_(de),A(Ne),U(Ne!==I.initialValue),k()?Pe.commit(Ne):Pe.commit(Ne,!0))});const Nt=pa({checked:Ne,disabled:ee,form:u,name:y?void 0:de,id:O?void 0:Z??void 0,required:x,ref:wt,style:de?W_:pd,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(tt){if(tt.nativeEvent.defaultPrevented)return;if(v){tt.preventDefault();return}const Jt=tt.currentTarget.checked,Ft=pt(Sm,tt.nativeEvent);if(Oe?.(Jt,Ft),Re(Jt,Ft),!Ft.isCanceled&&(st(Jt),K&&Fe&&G&&!y&&!se)){const Dn=Jt?[...Fe,K]:Fe.filter(Rn=>Rn!==K);G(Dn,Ft)}},onFocus(){ie.current?.focus()}},P!==void 0?{value:(re?Ne&&P:P)||""}:yn,Q,re?Pe.getValidationProps:Pe.getInputValidationProps),Yt=se?!!Ae:Ne,un=se&&Se||f;h.useEffect(()=>{if(!ce||!K)return;const tt=ce.disabledStatesRef.current;return tt.set(K,ee),()=>{tt.delete(K)}},[ce,ee,K]);const mn=h.useMemo(()=>({...N,checked:Yt,disabled:ee,readOnly:v,required:x,indeterminate:un}),[N,Yt,ee,v,x,un]),$n=pA(mn),nt=lt("span",t,{state:mn,ref:[Ee,ie,n,re?.registerControlRef],props:[{id:O?Z??void 0:ue,role:"checkbox","aria-checked":Se?"mixed":Ne,"aria-readonly":v||void 0,"aria-required":x||void 0,"aria-labelledby":dt,[yA]:y?"":void 0,onFocus(){H(!0)},onBlur(){const tt=ut.current;tt&&(F(!0),H(!1),j==="onBlur"&&Pe.commit(re?Fe:tt.checked))},onClick(tt){v||ee||(tt.preventDefault(),ut.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:tt.shiftKey,ctrlKey:tt.ctrlKey,altKey:tt.altKey,metaKey:tt.metaKey})))}},Q,Pe.getValidationProps,T,Ye,ge],stateAttributesMapping:$n});return w.jsxs(gx.Provider,{value:mn,children:[nt,!Ne&&!re&&de&&!y&&R!==void 0&&w.jsx("input",{type:"hidden",form:u,name:de,value:R}),w.jsx("input",{...Nt,suppressHydrationWarning:!0})]})});process.env.NODE_ENV!=="production"&&(vx.displayName="CheckboxRoot");const bx=h.forwardRef(function(t,n){const{render:r,className:o,style:i,keepMounted:s=!1,...a}=t,u=eoe(),c=u.checked||u.indeterminate,{mounted:f,transitionStatus:p,setMounted:m}=yy(c),b=h.useRef(null),y={...u,transitionStatus:p};ma({open:c,ref:b,onComplete(){c||m(!1)}});const v=pA(u),E=h.useMemo(()=>({...v,...xs,...Ym}),[v]),x=s||f,R=lt("span",t,{ref:[n,b],state:y,stateAttributesMapping:E,props:a});return x?R:null});process.env.NODE_ENV!=="production"&&(bx.displayName="CheckboxIndicator");const toe=Object.freeze(Object.defineProperty({__proto__:null,Indicator:bx,Root:vx},Symbol.toStringTag,{value:"Module"}));function noe(e){return lt(e.defaultTagName??"div",e,e)}const yx=h.createContext(void 0);process.env.NODE_ENV!=="production"&&(yx.displayName="TooltipRootContext");function Ea(e){const t=h.useContext(yx);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: TooltipRootContext is missing. Tooltip parts must be placed within <Tooltip.Root>.":zt(72));return t}const roe={...VO,disabled:je(e=>e.disabled),instantType:je(e=>e.instantType),isInstantPhase:je(e=>e.isInstantPhase),trackCursorAxis:je(e=>e.trackCursorAxis),disableHoverablePopup:je(e=>e.disableHoverablePopup),lastOpenChangeReason:je(e=>e.openChangeReason),closeOnClick:je(e=>e.closeOnClick),closeDelay:je(e=>e.closeDelay),hasViewport:je(e=>e.hasViewport)};class Zm extends Mm{constructor(t){super({...ooe(),...t},{popupRef:h.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new Am},roe)}setOpen=(t,n)=>{const r=n.reason,o=r===Cr,i=t&&r===wp,s=!t&&(r===Jc||r===iy);if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(t,n),n.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(t,n);const a=()=>{const u={open:t,openChangeReason:r};i?u.instantType="focus":s?u.instantType="dismiss":r===Cr&&(u.instantType=void 0);const c=n.trigger?.id??null;(c||t)&&(u.activeTriggerId=c,u.activeTriggerElement=n.trigger??null),this.update(u)};o?er.flushSync(a):a()};static useStore(t,n){const r=Hn(()=>new Zm(n)).current,o=t??r,i=HO({popupStore:o,onOpenChange:o.setOpen});return o.state.floatingRootContext=i,o}}function ooe(){return{...BO(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,hasViewport:!1}}const xx=kO(function(t){const{disabled:n=!1,defaultOpen:r=!1,open:o,disableHoverablePopup:i=!1,trackCursorAxis:s="none",actionsRef:a,onOpenChange:u,onOpenChangeComplete:c,handle:f,triggerId:p,defaultTriggerId:m=null,children:b}=t,y=Zm.useStore(f?.store,{open:r,openProp:o,activeTriggerId:m,triggerIdProp:p});sV(()=>{o===void 0&&y.state.open===!1&&r===!0&&y.update({open:!0,activeTriggerId:m})}),y.useControlledProp("openProp",o),y.useControlledProp("triggerIdProp",p),y.useContextCallback("onOpenChange",u),y.useContextCallback("onOpenChangeComplete",c);const v=y.useState("open"),E=!n&&v,x=y.useState("activeTriggerId"),R=y.useState("payload");y.useSyncedValues({trackCursorAxis:s,disableHoverablePopup:i}),Le(()=>{v&&n&&y.setOpen(!1,pt(jV))},[v,n,y]),y.useSyncedValue("disabled",n),qO(y);const{forceUnmount:P,transitionStatus:O}=jO(E,y),S=y.select("floatingRootContext"),T=y.useState("isInstantPhase"),_=y.useState("instantType"),$=y.useState("lastOpenChangeReason"),V=h.useRef(null);Le(()=>{O==="ending"&&$===Sm||O!=="ending"&&T?(_!=="delay"&&(V.current=_),y.set("instantType","delay")):V.current!==null&&(y.set("instantType",V.current),V.current=null)},[O,T,$,_,y]),Le(()=>{E&&x==null&&y.set("payload",void 0)},[y,x,E]);const U=h.useCallback(()=>{y.setOpen(!1,ioe(y,os))},[y]);h.useImperativeHandle(a,()=>({unmount:P,close:U}),[P,U]);const A=vO(S,{enabled:!n,referencePress:()=>y.select("closeOnClick")}),H=q7(S,{enabled:!n&&s!=="none",axis:s==="none"?void 0:s}),{getReferenceProps:F,getFloatingProps:N,getTriggerProps:j}=Ey([A,H]),I=h.useMemo(()=>F(),[F]),k=h.useMemo(()=>j(),[j]),q=h.useMemo(()=>N(),[N]);return y.useSyncedValues({activeTriggerProps:I,inactiveTriggerProps:k,popupProps:q}),w.jsx(yx.Provider,{value:y,children:typeof b=="function"?b({payload:R}):b})});process.env.NODE_ENV!=="production"&&(xx.displayName="TooltipRoot");function ioe(e,t){const n=pt(t);return n.preventUnmountOnClose=()=>{e.set("preventUnmountingOnClose",!0)},n}const wx=h.createContext(void 0);process.env.NODE_ENV!=="production"&&(wx.displayName="TooltipProviderContext");function soe(){return h.useContext(wx)}let aoe=(function(e){return e[e.popupOpen=YO.popupOpen]="popupOpen",e.triggerDisabled="data-trigger-disabled",e})({});const loe=600,Ex=e8(function(t,n){const{className:r,render:o,handle:i,payload:s,disabled:a,delay:u,closeOnClick:c=!0,closeDelay:f,id:p,style:m,...b}=t,y=Ea(!0),v=i?.store??y;if(!v)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Tooltip.Trigger> must be either used within a <Tooltip.Root> component or provided with a handle.":zt(82));const E=$r(p),x=v.useState("isTriggerActive",E),R=v.useState("isOpenedByTrigger",E),P=v.useState("floatingRootContext"),O=h.useRef(null),S=u??loe,T=f??0,{registerTrigger:_,isMountedByThisTrigger:$}=LO(E,O,v,{payload:s,closeOnClick:c,closeDelay:T}),V=soe(),{delayRef:U,isInstantPhase:A,hasProvider:H}=VV(P,{open:R});v.useSyncedValue("isInstantPhase",A);const F=v.useState("disabled"),N=a??F,j=v.useState("trackCursorAxis"),I=v.useState("disableHoverablePopup"),k=v8(P,{enabled:!N,mouseOnly:!0,move:!1,handleClose:!I&&j!=="both"?E8():null,restMs(){const X=V?.delay,Q=typeof U.current=="object"?U.current.open:void 0;let re=S;return H&&(Q!==0?re=u??X??S:re=0),re},delay(){const X=typeof U.current=="object"?U.current.close:void 0;let Q=T;return f==null&&H&&(Q=X),{close:Q}},triggerElementRef:O,isActiveTrigger:x,isClosing:()=>v.select("transitionStatus")==="ending"}),q=m8(P,{enabled:!N}).reference,z={open:R},W=v.useState("triggerProps",$);return lt("button",t,{state:z,ref:[n,_,O],props:[k,q,W,{onPointerDown(){v.set("closeOnClick",c)},id:E,[aoe.triggerDisabled]:N?"":void 0},b],stateAttributesMapping:XO})});process.env.NODE_ENV!=="production"&&(Ex.displayName="TooltipTrigger");const Cx=h.createContext(void 0);process.env.NODE_ENV!=="production"&&(Cx.displayName="TooltipPortalContext");function uoe(){const e=h.useContext(Cx);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Tooltip.Portal> is missing.":zt(70));return e}const Rx=h.forwardRef(function(t,n){const{children:r,container:o,className:i,render:s,style:a,...u}=t,{portalNode:c,portalSubtree:f}=pO({container:o,ref:n,componentProps:t,elementProps:u});return!f&&!c?null:w.jsxs(h.Fragment,{children:[f,c&&er.createPortal(r,c)]})});process.env.NODE_ENV!=="production"&&(Rx.displayName="FloatingPortalLite");const Sx=h.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t;return Ea().useState("mounted")||r?w.jsx(Cx.Provider,{value:r,children:w.jsx(Rx,{ref:n,...o})}):null});process.env.NODE_ENV!=="production"&&(Sx.displayName="TooltipPortal");const Px=h.createContext(void 0);process.env.NODE_ENV!=="production"&&(Px.displayName="TooltipPositionerContext");function Tx(){const e=h.useContext(Px);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: TooltipPositionerContext is missing. TooltipPositioner parts must be placed within <Tooltip.Positioner>.":zt(71));return e}const xA=h.createContext(void 0);process.env.NODE_ENV!=="production"&&(xA.displayName="DirectionContext");function wA(){return h.useContext(xA)?.direction??"ltr"}const coe=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:u}=t,{element:c,padding:f=0,offsetParent:p="real"}=mo(e,t)||{};if(c==null)return{};const m=ly(f),b={x:n,y:r},y=_m(o),v=Tm(y),E=await s.getDimensions(c),x=y==="y",R=x?"top":"left",P=x?"bottom":"right",O=x?"clientHeight":"clientWidth",S=i.reference[v]+i.reference[y]-b[y]-i.floating[v],T=b[y]-i.reference[y],_=p==="real"?await s.getOffsetParent?.(c):a.floating;let $=a.floating[O]||i.floating[v];(!$||!await s.isElement?.(_))&&($=a.floating[O]||i.floating[v]);const V=S/2-T/2,U=$/2-E[v]/2-1,A=Math.min(m[R],U),H=Math.min(m[P],U),F=A,N=$-E[v]-H,j=$/2-E[v]/2+V,I=kp(F,j,N),k=!u.arrow&&Uo(o)!=null&&j!==I&&i.reference[v]/2-(j<F?A:H)-E[v]/2<0,q=k?j<F?j-F:j-N:0;return{[y]:b[y]+q,data:{[y]:I,centerOffset:j-I-q,...k&&{alignmentOffset:q}},reset:k}}}),doe=(e,t)=>({...coe(e),options:[e,t]}),foe={name:"hide",async fn(e){const{width:t,height:n,x:r,y:o}=e.rects.reference,i=t===0&&n===0&&r===0&&o===0;return{data:{referenceHidden:(await MO().fn(e)).data?.referenceHidden||i}}}},_p={sideX:"left",sideY:"top"},poe={name:"adaptiveOrigin",async fn(e){const{x:t,y:n,rects:{floating:r},elements:{floating:o},platform:i,strategy:s,placement:a}=e,u=Vt(o),c=u.getComputedStyle(o);if(!(c.transitionDuration!=="0s"&&c.transitionDuration!==""))return{x:t,y:n,data:_p};const p=await i.getOffsetParent?.(o);let m={width:0,height:0};if(s==="fixed"&&u?.visualViewport)m={width:u.visualViewport.width,height:u.visualViewport.height};else if(p===u){const R=ct(o);m={width:R.documentElement.clientWidth,height:R.documentElement.clientHeight}}else await i.isElement?.(p)&&(m=await i.getDimensions(p));const b=Qn(a);let y=t,v=n;b==="left"&&(y=m.width-(t+r.width)),b==="top"&&(v=m.height-(n+r.height));const E=b==="left"?"right":_p.sideX,x=b==="top"?"bottom":_p.sideY;return{x:y,y:v,data:{sideX:E,sideY:x}}}};function EA(e,t,n){const r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[t]}function pT(e,t,n){const{rects:r,placement:o}=e;return{side:EA(t,Qn(o),n),align:Uo(o)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function CA(e){const{anchor:t,positionMethod:n="absolute",side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,collisionBoundary:a,collisionPadding:u=5,sticky:c=!1,arrowPadding:f=5,disableAnchorTracking:p=!1,keepMounted:m=!1,floatingRootContext:b,mounted:y,collisionAvoidance:v,shiftCrossAxis:E=!1,nodeId:x,adaptiveOrigin:R,lazyFlip:P=!1,externalTree:O}=e,[S,T]=h.useState(null);!y&&S!==null&&T(null);const _=v.side||"flip",$=v.align||"flip",V=v.fallbackAxisSide||"end",U=typeof t=="function"?t:void 0,A=He(U),H=U?A:t,F=cr(t),N=cr(y),I=wA()==="rtl",k=S||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":I?"left":"right","inline-start":I?"right":"left"}[r],q=i==="center"?k:`${k}-${i}`;let z=u;const W=1,te=r==="bottom"?W:0,X=r==="top"?W:0,Q=r==="right"?W:0,re=r==="left"?W:0;typeof z=="number"?z={top:z+te,right:z+re,bottom:z+X,left:z+Q}:z&&(z={top:(z.top||0)+te,right:(z.right||0)+re,bottom:(z.bottom||0)+X,left:(z.left||0)+Q});const ce={boundary:a==="clipping-ancestors"?"clippingAncestors":a,padding:z},se=h.useRef(null),ee=cr(o),de=cr(s),le=[TO(nt=>{const tt=pT(nt,r,I),Jt=typeof ee.current=="function"?ee.current(tt):ee.current,Ft=typeof de.current=="function"?de.current(tt):de.current;return{mainAxis:Jt,crossAxis:Ft,alignmentAxis:Ft}},[typeof o!="function"?o:0,typeof s!="function"?s:0,I,r])],Z=$==="none"&&_!=="shift",xe=!Z&&(c||E||_==="shift"),Re=_==="none"?null:$O({...ce,padding:{top:z.top+W,right:z.right+W,bottom:z.bottom+W,left:z.left+W},mainAxis:!E&&_==="flip",crossAxis:$==="flip"?"alignment":!1,fallbackAxisSideDirection:V}),Ae=Z?null:_O(nt=>{const tt=ct(nt.elements.floating).documentElement;return{...ce,rootBoundary:E?{x:0,y:0,width:tt.clientWidth,height:tt.clientHeight}:void 0,mainAxis:$!=="none",crossAxis:xe,limiter:c||E?void 0:OO(Jt=>{if(!se.current)return{};const{width:Ft,height:Dn}=se.current.getBoundingClientRect(),Rn=Pr(Qn(Jt.placement)),Ar=Rn==="y"?Ft:Dn,Zr=Rn==="y"?z.left+z.right:z.top+z.bottom;return{offset:Ar/2+Zr/2}})}},[ce,c,E,z,$]);_==="shift"||$==="shift"||i==="center"?le.push(Ae,Re):le.push(Re,Ae),le.push(DO({...ce,apply({elements:{floating:nt},availableWidth:tt,availableHeight:Jt,rects:Ft}){if(!N.current)return;const Dn=nt.style;Dn.setProperty("--available-width",`${tt}px`),Dn.setProperty("--available-height",`${Jt}px`);const Rn=Vt(nt).devicePixelRatio||1,{x:Ar,y:Zr,width:Zo,height:Ce}=Ft.reference,Ni=(Math.round((Ar+Zo)*Rn)-Math.round(Ar*Rn))/Rn,Ii=(Math.round((Zr+Ce)*Rn)-Math.round(Zr*Rn))/Rn;Dn.setProperty("--anchor-width",`${Ni}px`),Dn.setProperty("--anchor-height",`${Ii}px`)}}),doe(()=>({element:se.current||ct(se.current).createElement("div"),padding:f,offsetParent:"floating"}),[f]),{name:"transformOrigin",fn(nt){const{elements:tt,middlewareData:Jt,placement:Ft,rects:Dn,y:Rn}=nt,Ar=Qn(Ft),Zr=Pr(Ar),Zo=se.current,Ce=Jt.arrow?.x||0,Ni=Jt.arrow?.y||0,Ii=Zo?.clientWidth||0,Qo=Zo?.clientHeight||0,ki=Ce+Ii/2,Ud=Ni+Qo/2,_a=Math.abs(Jt.shift?.y||0),wh=Dn.reference.height/2,Fi=typeof o=="function"?o(pT(nt,r,I)):o,Eh=_a>Fi,Ch={top:`${ki}px calc(100% + ${Fi}px)`,bottom:`${ki}px ${-Fi}px`,left:`calc(100% + ${Fi}px) ${Ud}px`,right:`${-Fi}px ${Ud}px`}[Ar],Rh=`${ki}px ${Dn.reference.y+wh-Rn}px`;return tt.floating.style.setProperty("--transform-origin",xe&&Zr==="y"&&Eh?Rh:Ch),{}}},foe,R),Le(()=>{!y&&b&&b.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[y,b]);const Se=h.useMemo(()=>({elementResize:!p&&typeof ResizeObserver<"u",layoutShift:!p&&typeof IntersectionObserver<"u"}),[p]),{refs:Oe,elements:Ye,x:Fe,y:G,middlewareData:J,update:ie,placement:fe,context:pe,isPositioned:ge,floatingStyles:Ee}=p8({rootContext:b,open:m?y:void 0,placement:q,middleware:le,strategy:n,whileElementsMounted:m?void 0:(...nt)=>Gv(...nt,Se),nodeId:x,externalTree:O}),{sideX:Pe,sideY:Ne}=J.adaptiveOrigin||_p,st=ge?n:"fixed",ut=h.useMemo(()=>{const nt=R?{position:st,[Pe]:Fe,[Ne]:G}:{position:st,...Ee};return ge||(nt.opacity=0),nt},[R,st,Pe,Fe,Ne,G,Ee,ge]),wt=h.useRef(null);Le(()=>{if(!y)return;const nt=F.current,tt=typeof nt=="function"?nt():nt,Ft=(mT(tt)?tt.current:tt)||null||null;Ft!==wt.current&&(Oe.setPositionReference(Ft),wt.current=Ft)},[y,Oe,H,F]),h.useEffect(()=>{if(!y)return;const nt=F.current;typeof nt!="function"&&mT(nt)&&nt.current!==wt.current&&(Oe.setPositionReference(nt.current),wt.current=nt.current)},[y,Oe,H,F]),h.useEffect(()=>{if(m&&y&&Ye.domReference&&Ye.floating)return Gv(Ye.domReference,Ye.floating,ie,Se)},[m,y,Ye,ie,Se]);const dt=Qn(fe),Nt=EA(r,dt,I),Yt=Uo(fe)||"center",un=!!J.hide?.referenceHidden;Le(()=>{P&&y&&ge&&T(dt)},[P,y,ge,dt]);const mn=h.useMemo(()=>({position:"absolute",top:J.arrow?.y,left:J.arrow?.x}),[J.arrow]),$n=J.arrow?.centerOffset!==0;return h.useMemo(()=>({positionerStyles:ut,arrowStyles:mn,arrowRef:se,arrowUncentered:$n,side:Nt,align:Yt,physicalSide:dt,anchorHidden:un,refs:Oe,context:pe,isPositioned:ge,update:ie}),[ut,mn,se,$n,Nt,Yt,dt,un,Oe,pe,ge,ie])}function mT(e){return e!=null&&"current"in e}function RA(e){return e==="starting"?AV:yn}function SA(e,t,{styles:n,transitionStatus:r,props:o,refs:i,hidden:s,inert:a=!1}){const u={...n};return a&&(u.pointerEvents="none"),lt("div",e,{state:t,ref:i,props:[{role:"presentation",hidden:s,style:u},RA(r),o],stateAttributesMapping:ha})}const _x=h.forwardRef(function(t,n){const{render:r,className:o,anchor:i,positionMethod:s="absolute",side:a="top",align:u="center",sideOffset:c=0,alignOffset:f=0,collisionBoundary:p="clipping-ancestors",collisionPadding:m=5,arrowPadding:b=5,sticky:y=!1,disableAnchorTracking:v=!1,collisionAvoidance:E=q_,style:x,...R}=t,P=Ea(),O=uoe(),S=P.useState("open"),T=P.useState("mounted"),_=P.useState("trackCursorAxis"),$=P.useState("disableHoverablePopup"),V=P.useState("floatingRootContext"),U=P.useState("instantType"),A=P.useState("transitionStatus"),H=P.useState("hasViewport"),F=CA({anchor:i,positionMethod:s,floatingRootContext:V,mounted:T,side:a,sideOffset:c,align:u,alignOffset:f,collisionBoundary:p,collisionPadding:m,sticky:y,arrowPadding:b,disableAnchorTracking:v,keepMounted:O,collisionAvoidance:E,adaptiveOrigin:H?poe:void 0}),N=h.useMemo(()=>({open:S,side:F.side,align:F.align,anchorHidden:F.anchorHidden,instant:_!=="none"?"tracking-cursor":U}),[S,F.side,F.align,F.anchorHidden,_,U]),j=SA(t,N,{styles:F.positionerStyles,transitionStatus:A,props:R,refs:[n,P.useStateSetter("positionerElement")],hidden:!T,inert:!S||_==="both"||$});return w.jsx(Px.Provider,{value:F,children:j})});process.env.NODE_ENV!=="production"&&(_x.displayName="TooltipPositioner");const moe={...ha,...xs},Ox=h.forwardRef(function(t,n){const{className:r,render:o,style:i,...s}=t,a=Ea(),{side:u,align:c}=Tx(),f=a.useState("open"),p=a.useState("instantType"),m=a.useState("transitionStatus"),b=a.useState("popupProps"),y=a.useState("floatingRootContext");ma({open:f,ref:a.context.popupRef,onComplete(){f&&a.context.onOpenChangeComplete?.(!0)}});const v=a.useState("disabled"),E=a.useState("closeDelay");return h8(y,{enabled:!v,closeDelay:E}),lt("div",t,{state:{open:f,side:u,align:c,instant:p,transitionStatus:m},ref:[n,a.context.popupRef,a.useStateSetter("popupElement")],props:[b,RA(m),s],stateAttributesMapping:moe})});process.env.NODE_ENV!=="production"&&(Ox.displayName="TooltipPopup");const $x=h.forwardRef(function(t,n){const{className:r,render:o,style:i,...s}=t,a=Ea(),u=a.useState("open"),c=a.useState("instantType"),{arrowRef:f,side:p,align:m,arrowUncentered:b,arrowStyles:y}=Tx();return lt("div",t,{state:{open:u,side:p,align:m,uncentered:b,instant:c},ref:[n,f],props:[{style:y,"aria-hidden":!0},s],stateAttributesMapping:ha})});process.env.NODE_ENV!=="production"&&($x.displayName="TooltipArrow");const Dx=function(t){const{delay:n,closeDelay:r,timeout:o=400}=t,i=h.useMemo(()=>({delay:n,closeDelay:r}),[n,r]),s=h.useMemo(()=>({open:n,close:r}),[n,r]);return w.jsx(wx.Provider,{value:i,children:w.jsx(BV,{delay:s,timeoutMs:o,children:t.children})})};process.env.NODE_ENV!=="production"&&(Dx.displayName="TooltipProvider");let hoe=(function(e){return e.popupWidth="--popup-width",e.popupHeight="--popup-height",e})({});function goe(e){const[t,n]=h.useState({current:e,previous:null});return e!==t.current&&n({current:e,previous:t.current}),t.previous}function hT(e){const t=Jn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Bt(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r;return(ua(n)!==i||ua(r)!==s)&&(n=i,r=s),{width:n,height:r}}const voe=()=>!0;function boe(e){const{popupElement:t,positionerElement:n,content:r,mounted:o,enabled:i=voe,onMeasureLayout:s,onMeasureLayoutComplete:a,side:u,direction:c}=e,f=xy(t,!0,!1),p=fd(),m=h.useRef(null),b=h.useRef(null),y=h.useRef(!0),v=h.useRef(At),E=He(s),x=He(a),R=h.useMemo(()=>{let P=u==="top",O=u==="left";return c==="rtl"?(P=P||u==="inline-end",O=O||u==="inline-end"):(P=P||u==="inline-start",O=O||u==="inline-start"),P?{position:"absolute",[u==="top"?"bottom":"top"]:"0",[O?"right":"left"]:"0"}:yn},[u,c]);Le(()=>{if(!o||!i()||typeof ResizeObserver!="function"){v.current=At,y.current=!0,m.current=null,b.current=null;return}if(!t||!n)return;v.current=gT(t,R);const P=new ResizeObserver(F=>{const N=F[0];N&&(b.current={width:Math.ceil(N.borderBoxSize[0].inlineSize),height:Math.ceil(N.borderBoxSize[0].blockSize)})});P.observe(t),pp(t,"auto");const O=Op(t,"position","static"),S=Op(t,"transform","none"),T=Op(t,"scale","1"),_=gT(n,{"--available-width":"max-content","--available-height":"max-content"});function $(){O(),S(),_()}function V(){$(),T()}if(E?.(),y.current||m.current===null){Ac(n,"max-content");const F=hT(t);return m.current=F,Ac(n,F),V(),x?.(null,F),y.current=!1,()=>{P.disconnect(),v.current(),v.current=At}}pp(t,"auto"),Ac(n,"max-content");const U=m.current??b.current,A=hT(t);if(m.current=A,!U)return Ac(n,A),V(),x?.(null,A),()=>{P.disconnect(),p.cancel(),v.current(),v.current=At};pp(t,U),V(),x?.(U,A),Ac(n,A);const H=new AbortController;return p.request(()=>{pp(t,A),f(()=>{t.style.setProperty("--popup-width","auto"),t.style.setProperty("--popup-height","auto")},H.signal)}),()=>{P.disconnect(),H.abort(),p.cancel(),v.current(),v.current=At}},[r,t,n,f,p,i,o,E,x,R])}function Op(e,t,n){const r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,r)}}function gT(e,t){const n=[];for(const[r,o]of Object.entries(t))n.push(Op(e,r,o));return n.length?()=>{n.forEach(r=>r())}:At}function pp(e,t){const n=t==="auto"?"auto":`${t.width}px`,r=t==="auto"?"auto":`${t.height}px`;e.style.setProperty("--popup-width",n),e.style.setProperty("--popup-height",r)}function Ac(e,t){const n=t==="max-content"?"max-content":`${t.width}px`,r=t==="max-content"?"max-content":`${t.height}px`;e.style.setProperty("--positioner-width",n),e.style.setProperty("--positioner-height",r)}function yoe(e){const{store:t,side:n,cssVars:r,children:o}=e,i=wA(),s=t.useState("activeTriggerElement"),a=t.useState("activeTriggerId"),u=t.useState("open"),c=t.useState("payload"),f=t.useState("mounted"),p=t.useState("popupElement"),m=t.useState("positionerElement"),b=goe(u?s:null),y=Eoe(a,c),v=h.useRef(null),[E,x]=h.useState(null),[R,P]=h.useState(null),O=h.useRef(null),S=h.useRef(null),T=xy(O,!0,!1),_=fd(),[$,V]=h.useState(null),[U,A]=h.useState(!1);Le(()=>(t.set("hasViewport",!0),()=>{t.set("hasViewport",!1)}),[t]);const H=He(()=>{O.current?.style.setProperty("animation","none"),O.current?.style.setProperty("transition","none"),S.current?.style.setProperty("display","none")}),F=He(q=>{O.current?.style.removeProperty("animation"),O.current?.style.removeProperty("transition"),S.current?.style.removeProperty("display"),q&&V(q)}),N=h.useRef(null);Le(()=>{if(s&&b&&s!==b&&N.current!==s&&v.current){x(v.current),A(!0);const q=woe(b,s);P(q),_.request(()=>{er.flushSync(()=>{A(!1)}),T(()=>{x(null),V(null),v.current=null})}),N.current=s}},[s,b,E,T,_]),Le(()=>{const q=O.current;if(!q)return;const z=ct(q).createElement("div");for(const W of Array.from(q.childNodes))z.appendChild(W.cloneNode(!0));v.current=z});const j=E!=null;let I;j?I=w.jsxs(h.Fragment,{children:[w.jsx("div",{"data-previous":!0,inert:Oy(!0),ref:S,style:{...$?{[r.popupWidth]:`${$.width}px`,[r.popupHeight]:`${$.height}px`}:null,position:"absolute"},"data-ending-style":U?void 0:""},"previous"),w.jsx("div",{"data-current":!0,ref:O,"data-starting-style":U?"":void 0,children:o},y)]}):I=w.jsx("div",{"data-current":!0,ref:O,children:o},y),Le(()=>{const q=S.current;!q||!E||q.replaceChildren(...Array.from(E.childNodes))},[E]),boe({popupElement:p,positionerElement:m,mounted:f,content:c,onMeasureLayout:H,onMeasureLayoutComplete:F,side:n,direction:i});const k={activationDirection:xoe(R),transitioning:j};return{children:I,state:k}}function xoe(e){if(e)return`${vT(e.horizontal,5,"right","left")} ${vT(e.vertical,5,"down","up")}`}function vT(e,t,n,r){return e>t?n:e<-t?r:""}function woe(e,t){const n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),o={x:n.left+n.width/2,y:n.top+n.height/2},i={x:r.left+r.width/2,y:r.top+r.height/2};return{horizontal:i.x-o.x,vertical:i.y-o.y}}function Eoe(e,t){const[n,r]=h.useState(0),o=h.useRef(e),i=h.useRef(t),s=h.useRef(!1);return Le(()=>{const a=o.current,u=i.current,c=e!==a,f=t!==u;c?(r(p=>p+1),s.current=!f):s.current&&f&&(r(p=>p+1),s.current=!1),o.current=e,i.current=t},[e,t]),`${e??"current"}-${n}`}const Coe={activationDirection:e=>e?{"data-activation-direction":e}:null},PA=h.forwardRef(function(t,n){const{render:r,className:o,style:i,children:s,...a}=t,u=Ea(),c=Tx(),f=u.useState("instantType"),{children:p,state:m}=yoe({store:u,side:c.side,cssVars:hoe,children:s}),b={activationDirection:m.activationDirection,transitioning:m.transitioning,instant:f};return lt("div",t,{state:b,ref:n,props:[a,{children:p}],stateAttributesMapping:Coe})});process.env.NODE_ENV!=="production"&&(PA.displayName="TooltipViewport");class TA{constructor(){this.store=new Zm}open(t){const n=t?this.store.context.triggerElements.getById(t):void 0;if(t&&!n)throw new Error(process.env.NODE_ENV!=="production"?`Base UI: TooltipHandle.open: No trigger found with id "${t}".`:zt(81,t));this.store.setOpen(!0,pt(os,void 0,n))}close(){this.store.setOpen(!1,pt(os,void 0,void 0))}get isOpen(){return this.store.state.open}}function Roe(){return new TA}const Soe=Object.freeze(Object.defineProperty({__proto__:null,Arrow:$x,Handle:TA,Popup:Ox,Portal:Sx,Positioner:_x,Provider:Dx,Root:xx,Trigger:Ex,Viewport:PA,createHandle:Roe},Symbol.toStringTag,{value:"Module"}));function Poe(e){return w.jsx("svg",{width:"20",height:"10",viewBox:"0 0 20 10",fill:"none",...e,children:w.jsx("path",{d:"M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V10H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z",fill:"currentColor"})})}function _A(e){return w.jsx(Dx,{...e})}function OA(e){return w.jsx(xx,{...e})}function $A({className:e,...t}){return w.jsx(Ex,{"data-slot":"tooltip-trigger",className:me(e),...t})}function DA({className:e,...t}){return w.jsx(Ox,{"data-slot":"tooltip-popup",className:me("flex origin-[var(--transform-origin)] flex-col rounded-md bg-popover px-2.5 py-1.5 text-xs text-popover-foreground drop-shadow-md","transition-[scale,opacity] duration-150 ease-out","data-starting-style:scale-98 data-starting-style:opacity-0","data-ending-style:scale-98 data-ending-style:opacity-0","data-instant:duration-0",e),...t})}function MA({className:e,...t}){return w.jsx($x,{"data-slot":"tooltip-arrow",className:me("flex text-popover","data-[side=bottom]:top-[-8px]","data-[side=left]:right-[-13px] data-[side=left]:rotate-90","data-[side=right]:left-[-13px] data-[side=right]:-rotate-90","data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180",e),...t,children:w.jsx(Poe,{})})}function AA({content:e,children:t,open:n,defaultOpen:r,onOpenChange:o,side:i="top",align:s,offset:a=10,delay:u,closeDelay:c,className:f,arrowClassName:p,...m}){return w.jsxs(OA,{open:n,defaultOpen:r,onOpenChange:o,children:[w.jsx($A,{delay:u,closeDelay:c,render:t,...m}),w.jsx(Sx,{children:w.jsx(_x,{side:i,align:s,sideOffset:a,children:w.jsxs(DA,{className:f,children:[w.jsx(MA,{className:p}),e]})})})]})}function Od({className:e,render:t,required:n,tooltip:r,children:o,...i}){const s=n||r?w.jsxs(w.Fragment,{children:[o,n&&w.jsx("span",{"aria-hidden":!0,className:"text-error",children:"*"}),r&&w.jsx(AA,{content:r,children:w.jsx("button",{type:"button","aria-label":"More information",className:"inline-flex cursor-default items-center text-muted-foreground hover:text-foreground transition-all ml-1",children:w.jsx(D$,{className:"size-3.5"})})})]}):o,a={className:me("inline-flex items-center font-medium text-sm leading-none","peer-data-disabled:cursor-not-allowed peer-data-disabled:opacity-70",e),"data-slot":"label",children:s};return noe({defaultTagName:"label",props:pa(a,i),render:t})}function NA({className:e,...t}){return w.jsx(vx,{className:me("peer relative inline-flex size-4.5 shrink-0 items-center justify-center rounded-[.25rem] border border-input bg-background not-dark:bg-clip-padding shadow-xs/5 outline-none ring-ring transition-shadow","before:pointer-events-none before:absolute before:inset-0 before:rounded-[3px]","not-data-disabled:not-data-checked:not-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)]","focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-offset-background","aria-invalid:border-destructive/36 focus-visible:aria-invalid:border-destructive/64 focus-visible:aria-invalid:ring-destructive/48","data-disabled:cursor-not-allowed data-disabled:opacity-64","sm:size-4","dark:not-data-disabled:not-data-checked:not-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)]","[[data-disabled],[data-checked],[aria-invalid]]:shadow-none",e),"data-slot":"checkbox",...t})}function IA({className:e,...t}){return w.jsx(bx,{className:me("absolute -inset-px flex items-center justify-center rounded-[.25rem] text-primary-foreground","data-unchecked:hidden data-checked:bg-primary data-indeterminate:text-foreground",e),"data-slot":"checkbox-indicator",render:(n,r)=>w.jsx("span",{...n,children:r.indeterminate?w.jsx("svg",{"aria-hidden":"true",className:"size-3.5 sm:size-3",fill:"none",height:"24",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"3",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("path",{d:"M5.252 12h13.496"})}):w.jsx("svg",{"aria-hidden":"true",className:"size-3.5 sm:size-3",fill:"none",height:"24",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"3",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("path",{d:"M5.252 12.7 10.2 18.63 18.748 5.37"})})}),...t})}function Toe({children:e,className:t,id:n,indicatorProps:r,...o}){const i=D.useId(),s=n??i;return w.jsxs("div",{className:"flex select-none items-center gap-x-2",children:[w.jsx(NA,{id:s,className:t,...o,children:w.jsx(IA,{...r})}),e&&w.jsx(Od,{htmlFor:s,children:e})]})}const bT=[];function _oe(e){const{allValues:t=bT,value:n=bT,onValueChange:r}=e,o=h.useRef(n),i=h.useRef(new Map),[s,a]=h.useState("mixed"),u=$r(),c=n.length===t.length,f=n.length!==t.length&&n.length>0,p=He(r),m=h.useCallback(()=>({id:u,indeterminate:f,checked:c,"aria-controls":t.map(y=>`${u}-${y}`).join(" "),onCheckedChange(y,v){const E=o.current,x=t.filter(O=>i.current.get(O)&&E.includes(O)),R=t.filter(O=>!i.current.get(O)||i.current.get(O)&&E.includes(O));if(E.length===R.length||E.length===0){n.length===R.length?p(x,v):p(R,v);return}s==="mixed"?(p(R,v),a("on")):s==="on"?(p(x,v),a("off")):s==="off"&&(p(E,v),a("mixed"))}}),[t,c,u,f,p,s,n.length]),b=h.useCallback(y=>({checked:n.includes(y),onCheckedChange(v,E){const x=n.slice();v?x.push(y):x.splice(x.indexOf(y),1),o.current=x,p(x,E),a("mixed")}}),[p,n]);return h.useMemo(()=>({id:u,indeterminate:f,getParentProps:m,getChildProps:b,disabledStatesRef:i}),[u,f,m,b])}function Ooe(e,t,n=(r,o)=>r===o){return e.length===t.length&&e.every((r,o)=>n(r,t[o]))}const kA=h.forwardRef(function(t,n){const{allValues:r,className:o,defaultValue:i,disabled:s=!1,id:a,onValueChange:u,render:c,value:f,style:p,...m}=t,{disabled:b,name:y,state:v,validation:E,setFilled:x,setDirty:R,shouldValidateOnChange:P,validityData:O}=_d(),{labelId:S,getDescriptionProps:T}=Xm(),{clearErrors:_}=mx(),$=b||s,V=h.useMemo(()=>{if(f===void 0)return i??[]},[f,i]),[U,A]=fx({controlled:f,default:V,name:"CheckboxGroup",state:"value"}),H=He((te,X)=>{u?.(te,X),!X.isCanceled&&A(te)}),F=_oe({allValues:r,value:U,onValueChange:H}),N=$r(a),j=h.useRef(null),I=h.useCallback(te=>{j.current==null&&te!=null&&!te.hasAttribute(yA)&&(j.current=te)},[]);px(j,{enabled:!!y,id:N,value:U});const k=U??fC;Nm(k,()=>{y&&_(y);const te=Array.isArray(O.initialValue)?O.initialValue:fC;x(k.length>0),R(!Ooe(k,te)),P()?E.commit(k):E.commit(k,!0)});const q={...v,disabled:$},z=h.useMemo(()=>({allValues:r,value:U,defaultValue:V,setValue:H,parent:F,disabled:$,validation:E,registerControlRef:I}),[r,U,V,H,F,$,E,I]),W=lt("div",t,{state:q,ref:n,props:[{role:"group","aria-labelledby":S},T,m],stateAttributesMapping:Ym});return w.jsx(hx.Provider,{value:z,children:W})});process.env.NODE_ENV!=="production"&&(kA.displayName="CheckboxGroup");function $oe({className:e,...t}){return w.jsx(kA,{className:me("flex flex-col items-start gap-3",e),"data-slot":"checkbox-group",...t})}function Doe({items:e=[],valueKey:t="value",labelKey:n="label",placeholder:r="Seleccionar",searchPlaceholder:o="Buscar...",emptyMessage:i="No se encontraron resultado",searchProps:s,className:a,triggerProps:u,itemProps:c,itemClassName:f,contentProps:p,contentClassName:m,value:b,onChange:y,defaultValue:v,renderOption:E=P=>P?.[n],commandProps:x,...R}){const[P,O]=Kt({prop:R.open,onChange:R.onOpenChange,defaultProp:R.defaultOpen||!1}),[S,T]=Kt({prop:b,onChange:U=>{if(!y)return;const A=e.find(H=>H[t]===U);y?.(A?.[t],A)},defaultProp:v}),[_,$]=Kt({prop:R?.search,defaultProp:R?.searchDefaultValue||"",onChange:R?.onSearchChange}),V=h.useMemo(()=>e.find(U=>U[t]===S),[S]);return w.jsxs(jd,{open:P,onOpenChange:O,"data-slot":"combobox",children:[w.jsx(Bd,{asChild:!0,"data-slot":"combobox-trigger",children:w.jsxs(Tn,{...R,...u,variant:"outline",role:"combobox","aria-expanded":P,className:me("font-normal w-full items-center justify-between border-input px-3 hover:bg-background",a),children:[w.jsx("span",{className:"truncate",children:V?E(V):r}),w.jsx(Gp,{className:"ml-2 h-4 w-4 shrink-0 opacity-50","data-slot":"combobox-trigger-icon"})]})}),w.jsx(Vd,{...p,className:me("p-1",m),asChild:!0,matchTriggerWidth:!0,"data-slot":"combobox-content",children:w.jsxs(Rd,{...x,children:[w.jsx(Vm,{value:_,onValueChange:$,placeholder:o,autoFocus:!0,"data-slot":"combobox-input",...s}),w.jsx(Hm,{"data-slot":"combobox-empty",children:i}),w.jsx(Km,{"data-slot":"combobox-list",children:e.map(U=>D.createElement(nd,{className:f,"data-slot":"combobox-item",...c,key:U[t],value:U[t],onSelect:()=>{const A=U[t];T(A===S?"":A),O(!1)}},E(U)))})]})})]})}const Moe="dd/MM/yyyy",Nc=e=>ps(e)?Cn(e,Moe):"",Aoe=e=>{const t=e.trim();if(!t)return null;const n=/^(\d{1,2})\/(\d{1,2})\/(\d{1,4})$/.exec(t);if(!n)return null;const[,r,o,i]=n,s=Number(r),a=Number(o),u=i;let c=Number(u);if(Number.isNaN(s)||Number.isNaN(a)||Number.isNaN(c)||(u.length<=2&&(c=2e3+c),s<1||s>31||a<1||a>12))return null;const f=new Date(c,a-1,s);return f.getFullYear()!==c||f.getMonth()!==a-1||f.getDate()!==s?null:f},Noe=(e,t)=>{const n=(t.lastKey==="Backspace"||t.lastKey==="Delete")&&e.length<t.previousValue.length,r=e.includes("/"),o=e.trim().endsWith("/");if((e.match(/\//g)??[]).length>=2){const E=e.split("/"),x=(E[0]??"").replace(/\D/g,"").slice(0,2),R=(E[1]??"").replace(/\D/g,"").slice(0,2),P=(E[2]??"").replace(/\D/g,"").slice(0,4);return!x&&!R&&!P?"":`${x}/${R}/${P}`}const s=e.replace(/\D/g,"").slice(0,8);if(!s)return"";if(s.length<=2){let E=s;if(s.length===1&&(r||o)&&!n){let x=Number(E);Number.isNaN(x)&&(x=1),x<1&&(x=1),x>31&&(x=31),E=x.toString().padStart(2,"0"),E+="/"}else if(s.length===2&&!n){let x=Number(E);Number.isNaN(x)&&(x=1),x<1&&(x=1),x>31&&(x=31),E=x.toString().padStart(2,"0"),E+="/"}return E}const a=s.slice(0,2);let u=Number(a);Number.isNaN(u)&&(u=1),u<1&&(u=1),u>31&&(u=31);const c=u.toString().padStart(2,"0"),f=s.slice(2,4),p=s.slice(4);let m="";if(f.length===0)m="";else if(f.length===1&&p.length===0){const E=o&&!n&&f.length===1;if(f==="0"||f==="1")if(E){let x=Number(f);Number.isNaN(x)&&(x=1),x<1&&(x=1),x>12&&(x=12),m=x.toString().padStart(2,"0")}else m=f;else{let x=Number(f);Number.isNaN(x)&&(x=1),x<1&&(x=1),x>12&&(x=12),m=x.toString().padStart(2,"0")}}else{let E=Number(f);Number.isNaN(E)&&(E=1),E<1&&(E=1),E>12&&(E=12),m=E.toString().padStart(2,"0")}const b=`${c}/${m}`,y=!p&&m.length===2&&!n;return p?`${b}/${p}`:y?`${b}/`:b},Ioe=e=>{const{date:t,onDateChange:n,disabledDate:r}=e,[o,i]=D.useState(""),s=D.useRef(null),a=D.useRef("");D.useEffect(()=>{const y=Nc(t??null);i(y),a.current=y},[t]);const u=()=>{const y=o.trim();if(!y){n(null),i(""),a.current="";return}const v=Aoe(y);if(!v){n(null),i(""),a.current="";return}if(r?.(v)){const x=Nc(t??null);i(x),a.current=x;return}n(v);const E=Nc(v);i(E),a.current=E};return{inputValue:o,handleChange:y=>{const v=y.target.value,E={lastKey:s.current,previousValue:a.current},x=Noe(v,E);i(x),a.current=x},handleBlur:()=>{u()},handleKeyDown:y=>{if(s.current=y.key,y.key==="Enter"){y.preventDefault(),u();return}if(y.key==="Escape"){y.preventDefault();const v=Nc(t??null);i(v),a.current=v}},clear:()=>{n(null),i(""),a.current=""},setFromExternalDate:y=>{n(y);const v=Nc(y??null);i(v),a.current=v}}},koe=(e={})=>{const{disabled:t}=e,[n,r]=D.useState(!1),o=D.useRef(null),i=D.useCallback(s=>{if(!t){if(s.key===" "||s.key==="Spacebar"){s.preventDefault(),r(!0);return}s.key==="Escape"&&(r(!1),requestAnimationFrame(()=>{o.current?.focus()}))}},[t]);return{open:n,setOpen:r,handleInputKeyDown:i,inputRef:o}},Foe=e=>{const{placeholder:t,value:n,onChange:r,defaultValue:o,autoComplete:i,className:s,disabledDate:a,renderFooter:u,disabled:c,hideFooter:f,onBlur:p,...m}=e,[b,y]=Kt({prop:n,onChange:N=>r?.(N??null),defaultProp:o??null}),{inputValue:v,handleChange:E,handleBlur:x,handleKeyDown:R,clear:P,setFromExternalDate:O}=Ioe({date:b??null,onDateChange:N=>y(N),disabledDate:a}),{open:S,setOpen:T,handleInputKeyDown:_,inputRef:$}=koe({disabled:c}),V=N=>{R(N),_(N)},U=()=>{O(null),P()},A=()=>{const N=new Date;a?.(N)||O(N)},H=()=>w.jsxs("span",{className:"flex w-full p-1 justify-between",children:[w.jsx(Tn,{variant:"ghost",onClick:U,children:"Borrar"}),w.jsx(Tn,{variant:"ghost",onClick:A,disabled:a?.(new Date),children:"Hoy"})]}),F=()=>f?null:u?u({mode:"single",value:b,clear:U,selectToday:A,setValue:N=>{const j=N&&ps(N)?N:null;y(j),O(j)}}):H();return w.jsxs(jd,{"data-slot":"date-picker",open:S,onOpenChange:T,children:[w.jsxs("div",{className:me("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",!b&&"text-muted-foreground",s,"field-error"),onClick:N=>{N.target===N.currentTarget&&$.current?.focus()},children:[w.jsx("input",{type:"text",value:v,onChange:E,onBlur:N=>{x(),p?.(N)},onKeyDown:V,placeholder:t??"DD/MM/YYYY",autoComplete:i??"off",disabled:c,className:"flex-1 min-w-0 bg-transparent outline-none text-start truncate pt-px","aria-label":t,ref:$,...m}),w.jsx(Bd,{asChild:!0,"data-slot":"date-picker-trigger",children:w.jsxs("button",{type:"button",disabled:c,className:"flex shrink-0 items-center justify-center text-muted-foreground hover:text-foreground p-1",children:[w.jsx(QK,{"data-slot":"date-picker-icon"}),w.jsx("span",{className:"sr-only",children:"Seleccionar fecha"})]})})]}),w.jsxs(Vd,{className:"w-auto p-0",align:"start","data-slot":"date-picker-content",children:[w.jsx(fA,{className:"border-none",mode:"single",value:b,onChange:N=>{if(!ps(N)){O(null);return}a?.(N)||(O(N),T(!1))},disabled:a}),w.jsx("div",{className:"p-2","data-slot":"date-picker-footer",children:F()})]})]})},FA=e=>{const{className:t,orientation:n="horizontal"}=e;return w.jsx("hr",{...e,"aria-orientation":n,className:me("shrink-0 bg-input",n==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),"data-slot":"divider"})},Loe=({onDrop:e,onError:t,allowedExtensions:n=[],maxFileSize:r=5*1024*1024,maxFiles:o=1/0})=>{const[i,s]=D.useState(!1),a=D.useCallback(m=>{m.preventDefault(),m.stopPropagation()},[]),u=D.useCallback(m=>{m.preventDefault(),m.stopPropagation(),s(!0)},[]),c=D.useCallback(m=>{m.preventDefault(),m.stopPropagation(),s(!1)},[]),f=m=>{const[b=[],y=[],v=[]]=m.reduce(([E,x,R],P)=>n.length>0&&!n.includes(P.type)?(E.push(P),R.push({file:P,errorMessage:"Extensión no permitida",errorCode:"INVALID_EXTENSION"}),[E,x,R]):P.size>r?(E.push(P),R.push({file:P,errorMessage:"Archivo demasiado grande",errorCode:"FILE_TOO_LARGE"}),[E,x,R]):o&&o<x.length+1?(E.push(P),R.push({file:P,errorMessage:"Límite de archivos excedido",errorCode:"MAX_FILES_EXCEEDED"}),[E,x,R]):(x.push(P),[E,x,R]),[[],[],[]]);return v.length>0&&t&&t(v),[b,y,v]},p=D.useCallback(m=>{m.preventDefault(),m.stopPropagation(),s(!1);const b=Array.from(m.dataTransfer.files),[y=[],v=[]]=f(b);e(v,y)},[n,r,o,e,t]);return{isDragActive:i,validateFiles:f,dropzoneProps:{onDragOver:a,onDragEnter:u,onDragLeave:c,onDrop:p}}},LA=D.createContext(null),Mx=()=>{const e=D.useContext(LA);if(!e)throw new Error("useUploadContext must be used within a UploadContextProvider");return e},qA=({onFileAdd:e,onFileRemove:t,onChangeFiles:n,files:r,maxFiles:o=1,allowedExtensions:i=[],maxFileSize:s=5*1024*1024,multiple:a,children:u,onError:c,...f})=>{const[p=[],m]=Kt({defaultProp:[],prop:r,onChange:n}),[b,y]=D.useState([]),{isDragActive:v,validateFiles:E,dropzoneProps:x}=Loe({onDrop:(O,S)=>{m([...p,...O]),y(T=>[...T,...S]),e?.(O)},allowedExtensions:i,maxFileSize:s,maxFiles:o,onError:c}),R=O=>{const[S=[],T=[]]=E(O);if(o===1||!a){m(T.slice(0,1)),y([...S,...T.slice(1)]),e?.(T.slice(0,1));return}const _=o-p.length;if(_<=0){y(U=>[...U,...T]),e?.([]);return}const $=T.slice(0,_),V=T.slice(_);m([...p,...$]),y(U=>[...U,...S,...V]),e?.($)},P=(O,S)=>{S==="accepted"?m(p.filter((T,_)=>_!==O)):y(T=>T.filter((_,$)=>$!==O)),t?.(O,S)};return w.jsx(LA.Provider,{value:{files:p,rejectedFiles:b,handleFileAdd:R,handleFileRemove:P,inputProps:{accept:i.join(","),multiple:a},isDragActive:v,dropzoneProps:x},children:w.jsx("div",{...f,"data-slot":"upload",children:u})})},jA=({asChild:e,...t})=>{const{handleFileAdd:n,inputProps:r,dropzoneProps:o,isDragActive:i}=Mx(),s=D.useRef(null),a=e?km:"button";return w.jsxs(w.Fragment,{children:[w.jsx(a,{"data-slot":"upload-trigger",...t,...o,"data-drag-active":i||!1,onClick:u=>{t.onClick?.(u),s.current?.click()}}),w.jsx("input",{type:"file",className:"hidden","data-slot":"upload-input",...r,ref:s,onChange:u=>n(Array.from(u.target.files||[]))})]})},BA=({className:e,...t})=>w.jsx("div",{...t,className:me("mt-2 space-y-2",e),"data-slot":"upload-content"}),VA=({files:e,handleFileRemove:t,fileType:n,children:r,renderFile:o,...i})=>e.length===0?null:w.jsxs("div",{className:"mt-2 space-y-2",...i,"data-slot":"upload-files-list",children:[r,e.map((s,a)=>o?o(s,()=>t(a,n)):w.jsx(WA,{file:s,onRemove:()=>t(a,n)},s.name))]}),KA=e=>{const{files:t,handleFileRemove:n}=Mx();return w.jsx(VA,{"data-slot":"upload-accepted-files",files:t,handleFileRemove:n,fileType:"accepted",...e})},HA=e=>{const{rejectedFiles:t,handleFileRemove:n}=Mx();return w.jsx(VA,{"data-slot":"upload-rejected-files",files:t,handleFileRemove:n,fileType:"rejected",...e})},WA=({file:e,onRemove:t,className:n,renderIcon:r,...o})=>w.jsxs("div",{className:me("flex items-center gap-2 mb-2",n),...o,"data-slot":"upload-item",children:[r?.(e),e.name,w.jsx(Tn,{variant:"ghost",size:"icon",type:"button",className:"h-6 w-6",onClick:t,"data-slot":"upload-item-remove",children:w.jsx(vd,{"data-slot":"upload-item-remove-icon"})})]}),qoe=({onFileAdd:e,onFileRemove:t,onChangeFiles:n=()=>{},files:r,maxFiles:o=1,allowedExtensions:i=[],maxFileSize:s=5*1024*1024,multiple:a,renderAcceptedFile:u,renderRejectedFile:c,showRejected:f=!1,className:p,icon:m=gH,iconSize:b=40,onError:y,...v})=>{const E=D.useMemo(()=>i.map(x=>x.split("/")?.[1]).join(", "),[i]);return w.jsxs(qA,{onFileAdd:e,onFileRemove:t,files:r,onChangeFiles:n,maxFiles:o,allowedExtensions:i,maxFileSize:s,multiple:a?!0:void 0,className:me("w-full",p),onError:y,...v,children:[w.jsx(jA,{asChild:!0,children:w.jsxs("div",{className:me("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:[w.jsx(m,{className:"text-muted-foreground pointer-events-none",style:{width:b,height:b}}),w.jsxs("div",{className:"text-center text-muted-foreground pointer-events-none",children:[w.jsx("p",{children:"Arrastra y suelta archivos aquí o haz clic para seleccionar"}),i.length>0&&w.jsxs("p",{className:"text-sm",children:["Tipos permitidos: ",E]}),w.jsxs("p",{className:"text-sm",children:["Tamaño máximo: ",Math.floor(s/1024/1024),"MB"]})]})]})}),w.jsxs(BA,{children:[w.jsx(KA,{renderFile:u}),f&&w.jsx(HA,{renderFile:c})]})]})},cn={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"},joe={IMAGES:[cn.JPEG,cn.JPG,cn.PNG,cn.GIF,cn.WEBP,cn.SVG],DOCUMENTS:[cn.PDF,cn.DOC,cn.DOCX,cn.XLS,cn.XLSX,cn.PPT,cn.PPTX],COMPRESSED:[cn.ZIP,cn.RAR],AUDIO:[cn.MP3,cn.WAV],VIDEO:[cn.MP4,cn.WEBM]},Boe=Oi([],{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"}}),UA=({className:e,size:t,weight:n,as:r,...o})=>{const i=r||"h2";return w.jsx(i,{className:me(Boe({size:t,weight:n}),e),...o,"data-slot":"heading","data-size":t,"data-weight":n})},Voe=({icon:e=w.jsx(EH,{className:"w-12 h-12"}),title:t="No hay resultados",description:n,className:r,children:o,...i})=>w.jsxs("div",{className:me("flex flex-col gap-2 justify-center items-center",r),"data-slot":"empty-state",...i,children:[w.jsx("div",{className:"text-muted-foreground","data-slot":"empty-state-icon",children:e}),w.jsx(UA,{className:"empty:hidden","data-slot":"empty-state-title",children:t}),w.jsx("p",{className:"py-1 text-sm text-center text-muted-foreground empty:hidden","data-slot":"empty-state-description",children:n}),o]}),Koe=({label:e,labelClassName:t,labelProps:n,error:r,errorClassName:o,errorProps:i,children:s,className:a,...u})=>w.jsxs("div",{...u,className:me("flex flex-col gap-1",a),"data-slot":"field",children:[w.jsx(Od,{className:me("empty:hidden",t),...n,"data-slot":"field-label",children:e}),s,w.jsx("p",{"data-slot":"field-error",className:me("text-sm font-medium text-error empty:hidden",o),...i,children:r})]});var $d=e=>e.type==="checkbox",ts=e=>e instanceof Date,Xn=e=>e==null;const zA=e=>typeof e=="object";var pn=e=>!Xn(e)&&!Array.isArray(e)&&zA(e)&&!ts(e),GA=e=>pn(e)&&e.target?$d(e.target)?e.target.checked:e.target.value:e,Hoe=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,YA=(e,t)=>e.has(Hoe(t)),Woe=e=>{const t=e.constructor&&e.constructor.prototype;return pn(t)&&t.hasOwnProperty("isPrototypeOf")},Ax=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function bn(e){let t;const n=Array.isArray(e),r=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(Ax&&(e instanceof Blob||r))&&(n||pn(e)))if(t=n?[]:Object.create(Object.getPrototypeOf(e)),!n&&!Woe(e))t=e;else for(const o in e)e.hasOwnProperty(o)&&(t[o]=bn(e[o]));else return e;return t}var Qm=e=>/^\w*$/.test(e),Zt=e=>e===void 0,Nx=e=>Array.isArray(e)?e.filter(Boolean):[],Ix=e=>Nx(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Te=(e,t,n)=>{if(!t||!pn(e))return n;const r=(Qm(t)?[t]:Ix(t)).reduce((o,i)=>Xn(o)?o:o[i],e);return Zt(r)||r===e?Zt(e[t])?n:e[t]:r},lr=e=>typeof e=="boolean",Ct=(e,t,n)=>{let r=-1;const o=Qm(t)?[t]:Ix(t),i=o.length,s=i-1;for(;++r<i;){const a=o[r];let u=n;if(r!==s){const c=e[a];u=pn(c)||Array.isArray(c)?c:isNaN(+o[r+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=u,e=e[a]}};const im={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Vr={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},No={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},kx=D.createContext(null);kx.displayName="HookFormContext";const Dd=()=>D.useContext(kx),Uoe=e=>{const{children:t,...n}=e;return D.createElement(kx.Provider,{value:n},t)};var XA=(e,t,n,r=!0)=>{const o={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(o,i,{get:()=>{const s=i;return t._proxyFormState[s]!==Vr.all&&(t._proxyFormState[s]=!r||Vr.all),n&&(n[s]=!0),e[s]}});return o};const Fx=typeof window<"u"?D.useLayoutEffect:D.useEffect;function zoe(e){const t=Dd(),{control:n=t.control,disabled:r,name:o,exact:i}=e||{},[s,a]=D.useState(n._formState),u=D.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Fx(()=>n._subscribe({name:o,formState:u.current,exact:i,callback:c=>{!r&&a({...n._formState,...c})}}),[o,r,i]),D.useEffect(()=>{u.current.isValid&&n._setValid(!0)},[n]),D.useMemo(()=>XA(s,n,u.current,!1),[s,n])}var dr=e=>typeof e=="string",Pb=(e,t,n,r,o)=>dr(e)?(r&&t.watch.add(e),Te(n,e,o)):Array.isArray(e)?e.map(i=>(r&&t.watch.add(i),Te(n,i))):(r&&(t.watchAll=!0),n),Tb=e=>Xn(e)||!zA(e);function Kr(e,t,n=new WeakSet){if(Tb(e)||Tb(t))return Object.is(e,t);if(ts(e)&&ts(t))return e.getTime()===t.getTime();const r=Object.keys(e),o=Object.keys(t);if(r.length!==o.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const i of r){const s=e[i];if(!o.includes(i))return!1;if(i!=="ref"){const a=t[i];if(ts(s)&&ts(a)||pn(s)&&pn(a)||Array.isArray(s)&&Array.isArray(a)?!Kr(s,a,n):!Object.is(s,a))return!1}}return!0}function Goe(e){const t=Dd(),{control:n=t.control,name:r,defaultValue:o,disabled:i,exact:s,compute:a}=e||{},u=D.useRef(o),c=D.useRef(a),f=D.useRef(void 0),p=D.useRef(n),m=D.useRef(r);c.current=a;const[b,y]=D.useState(()=>{const O=n._getWatch(r,u.current);return c.current?c.current(O):O}),v=D.useCallback(O=>{const S=Pb(r,n._names,O||n._formValues,!1,u.current);return c.current?c.current(S):S},[n._formValues,n._names,r]),E=D.useCallback(O=>{if(!i){const S=Pb(r,n._names,O||n._formValues,!1,u.current);if(c.current){const T=c.current(S);Kr(T,f.current)||(y(T),f.current=T)}else y(S)}},[n._formValues,n._names,i,r]);Fx(()=>((p.current!==n||!Kr(m.current,r))&&(p.current=n,m.current=r,E()),n._subscribe({name:r,formState:{values:!0},exact:s,callback:O=>{E(O.values)}})),[n,s,r,E]),D.useEffect(()=>n._removeUnmounted());const x=p.current!==n,R=m.current,P=D.useMemo(()=>{if(i)return null;const O=!x&&!Kr(R,r);return x||O?v():null},[i,x,r,R,v]);return P!==null?P:b}function Yoe(e){const t=Dd(),{name:n,disabled:r,control:o=t.control,shouldUnregister:i,defaultValue:s,exact:a=!0}=e,u=YA(o._names.array,n),c=D.useMemo(()=>Te(o._formValues,n,Te(o._defaultValues,n,s)),[o,n,s]),f=Goe({control:o,name:n,defaultValue:c,exact:a}),p=zoe({control:o,name:n,exact:a}),m=D.useRef(e),b=D.useRef(void 0),y=D.useRef(o.register(n,{...e.rules,value:f,...lr(e.disabled)?{disabled:e.disabled}:{}}));m.current=e;const v=D.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Te(p.errors,n)},isDirty:{enumerable:!0,get:()=>!!Te(p.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Te(p.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Te(p.validatingFields,n)},error:{enumerable:!0,get:()=>Te(p.errors,n)}}),[p,n]),E=D.useCallback(O=>y.current.onChange({target:{value:GA(O),name:n},type:im.CHANGE}),[n]),x=D.useCallback(()=>y.current.onBlur({target:{value:Te(o._formValues,n),name:n},type:im.BLUR}),[n,o._formValues]),R=D.useCallback(O=>{const S=Te(o._fields,n);S&&O&&(S._f.ref={focus:()=>O.focus&&O.focus(),select:()=>O.select&&O.select(),setCustomValidity:T=>O.setCustomValidity(T),reportValidity:()=>O.reportValidity()})},[o._fields,n]),P=D.useMemo(()=>({name:n,value:f,...lr(r)||p.disabled?{disabled:p.disabled||r}:{},onChange:E,onBlur:x,ref:R}),[n,r,p.disabled,E,x,R,f]);return D.useEffect(()=>{const O=o._options.shouldUnregister||i,S=b.current;S&&S!==n&&!u&&o.unregister(S),o.register(n,{...m.current.rules,...lr(m.current.disabled)?{disabled:m.current.disabled}:{}});const T=(_,$)=>{const V=Te(o._fields,_);V&&V._f&&(V._f.mount=$)};if(T(n,!0),O){const _=bn(Te(o._options.defaultValues,n,m.current.defaultValue));Ct(o._defaultValues,n,_),Zt(Te(o._formValues,n))&&Ct(o._formValues,n,_)}return!u&&o.register(n),b.current=n,()=>{(u?O&&!o._state.action:O)?o.unregister(n):T(n,!1)}},[n,o,u,i]),D.useEffect(()=>{o._setDisabledField({disabled:r,name:n})},[r,n,o]),D.useMemo(()=>({field:P,formState:p,fieldState:v}),[P,p,v])}const Xoe=e=>e.render(Yoe(e));var Lx=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},Yc=e=>Array.isArray(e)?e:[e],yT=()=>{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 ZA(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const o=e[r],i=t[r];if(o&&pn(o)&&i){const s=ZA(o,i);pn(s)&&(n[r]=s)}else e[r]&&(n[r]=i)}return n}var Vn=e=>pn(e)&&!Object.keys(e).length,qx=e=>e.type==="file",Hr=e=>typeof e=="function",sm=e=>{if(!Ax)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},QA=e=>e.type==="select-multiple",jx=e=>e.type==="radio",Zoe=e=>jx(e)||$d(e),Pv=e=>sm(e)&&e.isConnected;function Qoe(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=Zt(e)?r++:e[t[r++]];return e}function Joe(e){for(const t in e)if(e.hasOwnProperty(t)&&!Zt(e[t]))return!1;return!0}function dn(e,t){const n=Array.isArray(t)?t:Qm(t)?[t]:Ix(t),r=n.length===1?e:Qoe(e,n),o=n.length-1,i=n[o];return r&&delete r[i],o!==0&&(pn(r)&&Vn(r)||Array.isArray(r)&&Joe(r))&&dn(e,n.slice(0,-1)),e}var eie=e=>{for(const t in e)if(Hr(e[t]))return!0;return!1};function JA(e){return Array.isArray(e)||pn(e)&&!eie(e)}function _b(e,t={}){for(const n in e){const r=e[n];JA(r)?(t[n]=Array.isArray(r)?[]:{},_b(r,t[n])):Zt(r)||(t[n]=!0)}return t}function Zs(e,t,n){n||(n=_b(t));for(const r in e){const o=e[r];if(JA(o))Zt(t)||Tb(n[r])?n[r]=_b(o,Array.isArray(o)?[]:{}):Zs(o,Xn(t)?{}:t[r],n[r]);else{const i=t[r];n[r]=!Kr(o,i)}}return n}const xT={value:!1,isValid:!1},wT={value:!0,isValid:!0};var eN=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Zt(e[0].attributes.value)?Zt(e[0].value)||e[0].value===""?wT:{value:e[0].value,isValid:!0}:wT:xT}return xT},tN=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Zt(e)?e:t?e===""?NaN:e&&+e:n&&dr(e)?new Date(e):r?r(e):e;const ET={isValid:!1,value:null};var nN=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,ET):ET;function CT(e){const t=e.ref;return qx(t)?t.files:jx(t)?nN(e.refs).value:QA(t)?[...t.selectedOptions].map(({value:n})=>n):$d(t)?eN(e.refs).value:tN(Zt(t.value)?e.ref.value:t.value,e)}var tie=(e,t,n,r)=>{const o={};for(const i of e){const s=Te(t,i);s&&Ct(o,i,s._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},am=e=>e instanceof RegExp,Ic=e=>Zt(e)?e:am(e)?e.source:pn(e)?am(e.value)?e.value.source:e.value:e,RT=e=>({isOnSubmit:!e||e===Vr.onSubmit,isOnBlur:e===Vr.onBlur,isOnChange:e===Vr.onChange,isOnAll:e===Vr.all,isOnTouch:e===Vr.onTouched});const ST="AsyncFunction";var nie=e=>!!e&&!!e.validate&&!!(Hr(e.validate)&&e.validate.constructor.name===ST||pn(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===ST)),rie=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),PT=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Xc=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const i=Te(e,o);if(i){const{_f:s,...a}=i;if(s){if(s.refs&&s.refs[0]&&t(s.refs[0],o)&&!r)return!0;if(s.ref&&t(s.ref,s.name)&&!r)return!0;if(Xc(a,t))break}else if(pn(a)&&Xc(a,t))break}}};function TT(e,t,n){const r=Te(e,n);if(r||Qm(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const i=o.join("."),s=Te(t,i),a=Te(e,i);if(s&&!Array.isArray(s)&&n!==i)return{name:n};if(a&&a.type)return{name:i,error:a};if(a&&a.root&&a.root.type)return{name:`${i}.root`,error:a.root};o.pop()}return{name:n}}var oie=(e,t,n,r)=>{n(e);const{name:o,...i}=e;return Vn(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(s=>t[s]===(!r||Vr.all))},iie=(e,t,n)=>!e||!t||e===t||Yc(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),sie=(e,t,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:(n?r.isOnChange:o.isOnChange)?e:!0,aie=(e,t)=>!Nx(Te(e,t)).length&&dn(e,t),lie=(e,t,n)=>{const r=Yc(Te(e,n));return Ct(r,"root",t[n]),Ct(e,n,r),e};function _T(e,t,n="validate"){if(dr(e)||Array.isArray(e)&&e.every(dr)||lr(e)&&!e)return{type:n,message:dr(e)?e:"",ref:t}}var Ws=e=>pn(e)&&!am(e)?e:{value:e,message:""},OT=async(e,t,n,r,o,i)=>{const{ref:s,refs:a,required:u,maxLength:c,minLength:f,min:p,max:m,pattern:b,validate:y,name:v,valueAsNumber:E,mount:x}=e._f,R=Te(n,v);if(!x||t.has(v))return{};const P=a?a[0]:s,O=H=>{o&&P.reportValidity&&(P.setCustomValidity(lr(H)?"":H||""),P.reportValidity())},S={},T=jx(s),_=$d(s),$=T||_,V=(E||qx(s))&&Zt(s.value)&&Zt(R)||sm(s)&&s.value===""||R===""||Array.isArray(R)&&!R.length,U=Lx.bind(null,v,r,S),A=(H,F,N,j=No.maxLength,I=No.minLength)=>{const k=H?F:N;S[v]={type:H?j:I,message:k,ref:s,...U(H?j:I,k)}};if(i?!Array.isArray(R)||!R.length:u&&(!$&&(V||Xn(R))||lr(R)&&!R||_&&!eN(a).isValid||T&&!nN(a).isValid)){const{value:H,message:F}=dr(u)?{value:!!u,message:u}:Ws(u);if(H&&(S[v]={type:No.required,message:F,ref:P,...U(No.required,F)},!r))return O(F),S}if(!V&&(!Xn(p)||!Xn(m))){let H,F;const N=Ws(m),j=Ws(p);if(!Xn(R)&&!isNaN(R)){const I=s.valueAsNumber||R&&+R;Xn(N.value)||(H=I>N.value),Xn(j.value)||(F=I<j.value)}else{const I=s.valueAsDate||new Date(R),k=W=>new Date(new Date().toDateString()+" "+W),q=s.type=="time",z=s.type=="week";dr(N.value)&&R&&(H=q?k(R)>k(N.value):z?R>N.value:I>new Date(N.value)),dr(j.value)&&R&&(F=q?k(R)<k(j.value):z?R<j.value:I<new Date(j.value))}if((H||F)&&(A(!!H,N.message,j.message,No.max,No.min),!r))return O(S[v].message),S}if((c||f)&&!V&&(dr(R)||i&&Array.isArray(R))){const H=Ws(c),F=Ws(f),N=!Xn(H.value)&&R.length>+H.value,j=!Xn(F.value)&&R.length<+F.value;if((N||j)&&(A(N,H.message,F.message),!r))return O(S[v].message),S}if(b&&!V&&dr(R)){const{value:H,message:F}=Ws(b);if(am(H)&&!R.match(H)&&(S[v]={type:No.pattern,message:F,ref:s,...U(No.pattern,F)},!r))return O(F),S}if(y){if(Hr(y)){const H=await y(R,n),F=_T(H,P);if(F&&(S[v]={...F,...U(No.validate,F.message)},!r))return O(F.message),S}else if(pn(y)){let H={};for(const F in y){if(!Vn(H)&&!r)break;const N=_T(await y[F](R,n),P,F);N&&(H={...N,...U(F,N.message)},O(N.message),r&&(S[v]=H))}if(!Vn(H)&&(S[v]={ref:P,...H},!r))return S}}return O(!0),S};const uie={mode:Vr.onSubmit,reValidateMode:Vr.onChange,shouldFocusError:!0};function cie(e={}){let t={...uie,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Hr(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},o=pn(t.defaultValues)||pn(t.values)?bn(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:bn(o),s={action:!1,mount:!1,watch:!1},a={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},u,c=0;const f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let p={...f};const m={array:yT(),state:yT()},b=t.criteriaMode===Vr.all,y=G=>J=>{clearTimeout(c),c=setTimeout(G,J)},v=async G=>{if(!t.disabled&&(f.isValid||p.isValid||G)){const J=t.resolver?Vn((await _()).errors):await V(r,!0);J!==n.isValid&&m.state.next({isValid:J})}},E=(G,J)=>{!t.disabled&&(f.isValidating||f.validatingFields||p.isValidating||p.validatingFields)&&((G||Array.from(a.mount)).forEach(ie=>{ie&&(J?Ct(n.validatingFields,ie,J):dn(n.validatingFields,ie))}),m.state.next({validatingFields:n.validatingFields,isValidating:!Vn(n.validatingFields)}))},x=(G,J=[],ie,fe,pe=!0,ge=!0)=>{if(fe&&ie&&!t.disabled){if(s.action=!0,ge&&Array.isArray(Te(r,G))){const Ee=ie(Te(r,G),fe.argA,fe.argB);pe&&Ct(r,G,Ee)}if(ge&&Array.isArray(Te(n.errors,G))){const Ee=ie(Te(n.errors,G),fe.argA,fe.argB);pe&&Ct(n.errors,G,Ee),aie(n.errors,G)}if((f.touchedFields||p.touchedFields)&&ge&&Array.isArray(Te(n.touchedFields,G))){const Ee=ie(Te(n.touchedFields,G),fe.argA,fe.argB);pe&&Ct(n.touchedFields,G,Ee)}(f.dirtyFields||p.dirtyFields)&&(n.dirtyFields=Zs(o,i)),m.state.next({name:G,isDirty:A(G,J),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Ct(i,G,J)},R=(G,J)=>{Ct(n.errors,G,J),m.state.next({errors:n.errors})},P=G=>{n.errors=G,m.state.next({errors:n.errors,isValid:!1})},O=(G,J,ie,fe)=>{const pe=Te(r,G);if(pe){const ge=Te(i,G,Zt(ie)?Te(o,G):ie);Zt(ge)||fe&&fe.defaultChecked||J?Ct(i,G,J?ge:CT(pe._f)):N(G,ge),s.mount&&!s.action&&v()}},S=(G,J,ie,fe,pe)=>{let ge=!1,Ee=!1;const Pe={name:G};if(!t.disabled){if(!ie||fe){(f.isDirty||p.isDirty)&&(Ee=n.isDirty,n.isDirty=Pe.isDirty=A(),ge=Ee!==Pe.isDirty);const Ne=Kr(Te(o,G),J);Ee=!!Te(n.dirtyFields,G),Ne?dn(n.dirtyFields,G):Ct(n.dirtyFields,G,!0),Pe.dirtyFields=n.dirtyFields,ge=ge||(f.dirtyFields||p.dirtyFields)&&Ee!==!Ne}if(ie){const Ne=Te(n.touchedFields,G);Ne||(Ct(n.touchedFields,G,ie),Pe.touchedFields=n.touchedFields,ge=ge||(f.touchedFields||p.touchedFields)&&Ne!==ie)}ge&&pe&&m.state.next(Pe)}return ge?Pe:{}},T=(G,J,ie,fe)=>{const pe=Te(n.errors,G),ge=(f.isValid||p.isValid)&&lr(J)&&n.isValid!==J;if(t.delayError&&ie?(u=y(()=>R(G,ie)),u(t.delayError)):(clearTimeout(c),u=null,ie?Ct(n.errors,G,ie):dn(n.errors,G)),(ie?!Kr(pe,ie):pe)||!Vn(fe)||ge){const Ee={...fe,...ge&&lr(J)?{isValid:J}:{},errors:n.errors,name:G};n={...n,...Ee},m.state.next(Ee)}},_=async G=>{E(G,!0);const J=await t.resolver(i,t.context,tie(G||a.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return E(G),J},$=async G=>{const{errors:J}=await _(G);if(G)for(const ie of G){const fe=Te(J,ie);fe?Ct(n.errors,ie,fe):dn(n.errors,ie)}else n.errors=J;return J},V=async(G,J,ie={valid:!0})=>{for(const fe in G){const pe=G[fe];if(pe){const{_f:ge,...Ee}=pe;if(ge){const Pe=a.array.has(ge.name),Ne=pe._f&&nie(pe._f);Ne&&f.validatingFields&&E([ge.name],!0);const st=await OT(pe,a.disabled,i,b,t.shouldUseNativeValidation&&!J,Pe);if(Ne&&f.validatingFields&&E([ge.name]),st[ge.name]&&(ie.valid=!1,J))break;!J&&(Te(st,ge.name)?Pe?lie(n.errors,st,ge.name):Ct(n.errors,ge.name,st[ge.name]):dn(n.errors,ge.name))}!Vn(Ee)&&await V(Ee,J,ie)}}return ie.valid},U=()=>{for(const G of a.unMount){const J=Te(r,G);J&&(J._f.refs?J._f.refs.every(ie=>!Pv(ie)):!Pv(J._f.ref))&&ee(G)}a.unMount=new Set},A=(G,J)=>!t.disabled&&(G&&J&&Ct(i,G,J),!Kr(W(),o)),H=(G,J,ie)=>Pb(G,a,{...s.mount?i:Zt(J)?o:dr(G)?{[G]:J}:J},ie,J),F=G=>Nx(Te(s.mount?i:o,G,t.shouldUnregister?Te(o,G,[]):[])),N=(G,J,ie={})=>{const fe=Te(r,G);let pe=J;if(fe){const ge=fe._f;ge&&(!ge.disabled&&Ct(i,G,tN(J,ge)),pe=sm(ge.ref)&&Xn(J)?"":J,QA(ge.ref)?[...ge.ref.options].forEach(Ee=>Ee.selected=pe.includes(Ee.value)):ge.refs?$d(ge.ref)?ge.refs.forEach(Ee=>{(!Ee.defaultChecked||!Ee.disabled)&&(Array.isArray(pe)?Ee.checked=!!pe.find(Pe=>Pe===Ee.value):Ee.checked=pe===Ee.value||!!pe)}):ge.refs.forEach(Ee=>Ee.checked=Ee.value===pe):qx(ge.ref)?ge.ref.value="":(ge.ref.value=pe,ge.ref.type||m.state.next({name:G,values:bn(i)})))}(ie.shouldDirty||ie.shouldTouch)&&S(G,pe,ie.shouldTouch,ie.shouldDirty,!0),ie.shouldValidate&&z(G)},j=(G,J,ie)=>{for(const fe in J){if(!J.hasOwnProperty(fe))return;const pe=J[fe],ge=G+"."+fe,Ee=Te(r,ge);(a.array.has(G)||pn(pe)||Ee&&!Ee._f)&&!ts(pe)?j(ge,pe,ie):N(ge,pe,ie)}},I=(G,J,ie={})=>{const fe=Te(r,G),pe=a.array.has(G),ge=bn(J);Ct(i,G,ge),pe?(m.array.next({name:G,values:bn(i)}),(f.isDirty||f.dirtyFields||p.isDirty||p.dirtyFields)&&ie.shouldDirty&&m.state.next({name:G,dirtyFields:Zs(o,i),isDirty:A(G,ge)})):fe&&!fe._f&&!Xn(ge)?j(G,ge,ie):N(G,ge,ie),PT(G,a)&&m.state.next({...n,name:G}),m.state.next({name:s.mount?G:void 0,values:bn(i)})},k=async G=>{s.mount=!0;const J=G.target;let ie=J.name,fe=!0;const pe=Te(r,ie),ge=Ne=>{fe=Number.isNaN(Ne)||ts(Ne)&&isNaN(Ne.getTime())||Kr(Ne,Te(i,ie,Ne))},Ee=RT(t.mode),Pe=RT(t.reValidateMode);if(pe){let Ne,st;const ut=J.type?CT(pe._f):GA(G),wt=G.type===im.BLUR||G.type===im.FOCUS_OUT,dt=!rie(pe._f)&&!t.resolver&&!Te(n.errors,ie)&&!pe._f.deps||sie(wt,Te(n.touchedFields,ie),n.isSubmitted,Pe,Ee),Nt=PT(ie,a,wt);Ct(i,ie,ut),wt?(!J||!J.readOnly)&&(pe._f.onBlur&&pe._f.onBlur(G),u&&u(0)):pe._f.onChange&&pe._f.onChange(G);const Yt=S(ie,ut,wt),un=!Vn(Yt)||Nt;if(!wt&&m.state.next({name:ie,type:G.type,values:bn(i)}),dt)return(f.isValid||p.isValid)&&(t.mode==="onBlur"?wt&&v():wt||v()),un&&m.state.next({name:ie,...Nt?{}:Yt});if(!wt&&Nt&&m.state.next({...n}),t.resolver){const{errors:mn}=await _([ie]);if(ge(ut),fe){const $n=TT(n.errors,r,ie),nt=TT(mn,r,$n.name||ie);Ne=nt.error,ie=nt.name,st=Vn(mn)}}else E([ie],!0),Ne=(await OT(pe,a.disabled,i,b,t.shouldUseNativeValidation))[ie],E([ie]),ge(ut),fe&&(Ne?st=!1:(f.isValid||p.isValid)&&(st=await V(r,!0)));fe&&(pe._f.deps&&(!Array.isArray(pe._f.deps)||pe._f.deps.length>0)&&z(pe._f.deps),T(ie,st,Ne,Yt))}},q=(G,J)=>{if(Te(n.errors,J)&&G.focus)return G.focus(),1},z=async(G,J={})=>{let ie,fe;const pe=Yc(G);if(t.resolver){const ge=await $(Zt(G)?G:pe);ie=Vn(ge),fe=G?!pe.some(Ee=>Te(ge,Ee)):ie}else G?(fe=(await Promise.all(pe.map(async ge=>{const Ee=Te(r,ge);return await V(Ee&&Ee._f?{[ge]:Ee}:Ee)}))).every(Boolean),!(!fe&&!n.isValid)&&v()):fe=ie=await V(r);return m.state.next({...!dr(G)||(f.isValid||p.isValid)&&ie!==n.isValid?{}:{name:G},...t.resolver||!G?{isValid:ie}:{},errors:n.errors}),J.shouldFocus&&!fe&&Xc(r,q,G?pe:a.mount),fe},W=(G,J)=>{let ie={...s.mount?i:o};return J&&(ie=ZA(J.dirtyFields?n.dirtyFields:n.touchedFields,ie)),Zt(G)?ie:dr(G)?Te(ie,G):G.map(fe=>Te(ie,fe))},te=(G,J)=>({invalid:!!Te((J||n).errors,G),isDirty:!!Te((J||n).dirtyFields,G),error:Te((J||n).errors,G),isValidating:!!Te(n.validatingFields,G),isTouched:!!Te((J||n).touchedFields,G)}),X=G=>{G&&Yc(G).forEach(J=>dn(n.errors,J)),m.state.next({errors:G?n.errors:{}})},Q=(G,J,ie)=>{const fe=(Te(r,G,{_f:{}})._f||{}).ref,pe=Te(n.errors,G)||{},{ref:ge,message:Ee,type:Pe,...Ne}=pe;Ct(n.errors,G,{...Ne,...J,ref:fe}),m.state.next({name:G,errors:n.errors,isValid:!1}),ie&&ie.shouldFocus&&fe&&fe.focus&&fe.focus()},re=(G,J)=>Hr(G)?m.state.subscribe({next:ie=>"values"in ie&&G(H(void 0,J),ie)}):H(G,J,!0),ce=G=>m.state.subscribe({next:J=>{iie(G.name,J.name,G.exact)&&oie(J,G.formState||f,Oe,G.reRenderRoot)&&G.callback({values:{...i},...n,...J,defaultValues:o})}}).unsubscribe,se=G=>(s.mount=!0,p={...p,...G.formState},ce({...G,formState:p})),ee=(G,J={})=>{for(const ie of G?Yc(G):a.mount)a.mount.delete(ie),a.array.delete(ie),J.keepValue||(dn(r,ie),dn(i,ie)),!J.keepError&&dn(n.errors,ie),!J.keepDirty&&dn(n.dirtyFields,ie),!J.keepTouched&&dn(n.touchedFields,ie),!J.keepIsValidating&&dn(n.validatingFields,ie),!t.shouldUnregister&&!J.keepDefaultValue&&dn(o,ie);m.state.next({values:bn(i)}),m.state.next({...n,...J.keepDirty?{isDirty:A()}:{}}),!J.keepIsValid&&v()},de=({disabled:G,name:J})=>{(lr(G)&&s.mount||G||a.disabled.has(J))&&(G?a.disabled.add(J):a.disabled.delete(J))},K=(G,J={})=>{let ie=Te(r,G);const fe=lr(J.disabled)||lr(t.disabled);return Ct(r,G,{...ie||{},_f:{...ie&&ie._f?ie._f:{ref:{name:G}},name:G,mount:!0,...J}}),a.mount.add(G),ie?de({disabled:lr(J.disabled)?J.disabled:t.disabled,name:G}):O(G,!0,J.value),{...fe?{disabled:J.disabled||t.disabled}:{},...t.progressive?{required:!!J.required,min:Ic(J.min),max:Ic(J.max),minLength:Ic(J.minLength),maxLength:Ic(J.maxLength),pattern:Ic(J.pattern)}:{},name:G,onChange:k,onBlur:k,ref:pe=>{if(pe){K(G,J),ie=Te(r,G);const ge=Zt(pe.value)&&pe.querySelectorAll&&pe.querySelectorAll("input,select,textarea")[0]||pe,Ee=Zoe(ge),Pe=ie._f.refs||[];if(Ee?Pe.find(Ne=>Ne===ge):ge===ie._f.ref)return;Ct(r,G,{_f:{...ie._f,...Ee?{refs:[...Pe.filter(Pv),ge,...Array.isArray(Te(o,G))?[{}]:[]],ref:{type:ge.type,name:G}}:{ref:ge}}}),O(G,!1,void 0,ge)}else ie=Te(r,G,{}),ie._f&&(ie._f.mount=!1),(t.shouldUnregister||J.shouldUnregister)&&!(YA(a.array,G)&&s.action)&&a.unMount.add(G)}}},ue=()=>t.shouldFocusError&&Xc(r,q,a.mount),le=G=>{lr(G)&&(m.state.next({disabled:G}),Xc(r,(J,ie)=>{const fe=Te(r,ie);fe&&(J.disabled=fe._f.disabled||G,Array.isArray(fe._f.refs)&&fe._f.refs.forEach(pe=>{pe.disabled=fe._f.disabled||G}))},0,!1))},Z=(G,J)=>async ie=>{let fe;ie&&(ie.preventDefault&&ie.preventDefault(),ie.persist&&ie.persist());let pe=bn(i);if(m.state.next({isSubmitting:!0}),t.resolver){const{errors:ge,values:Ee}=await _();n.errors=ge,pe=bn(Ee)}else await V(r);if(a.disabled.size)for(const ge of a.disabled)dn(pe,ge);if(dn(n.errors,"root"),Vn(n.errors)){m.state.next({errors:{}});try{await G(pe,ie)}catch(ge){fe=ge}}else J&&await J({...n.errors},ie),ue(),setTimeout(ue);if(m.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Vn(n.errors)&&!fe,submitCount:n.submitCount+1,errors:n.errors}),fe)throw fe},xe=(G,J={})=>{Te(r,G)&&(Zt(J.defaultValue)?I(G,bn(Te(o,G))):(I(G,J.defaultValue),Ct(o,G,bn(J.defaultValue))),J.keepTouched||dn(n.touchedFields,G),J.keepDirty||(dn(n.dirtyFields,G),n.isDirty=J.defaultValue?A(G,bn(Te(o,G))):A()),J.keepError||(dn(n.errors,G),f.isValid&&v()),m.state.next({...n}))},Re=(G,J={})=>{const ie=G?bn(G):o,fe=bn(ie),pe=Vn(G),ge=pe?o:fe;if(J.keepDefaultValues||(o=ie),!J.keepValues){if(J.keepDirtyValues){const Ee=new Set([...a.mount,...Object.keys(Zs(o,i))]);for(const Pe of Array.from(Ee))Te(n.dirtyFields,Pe)?Ct(ge,Pe,Te(i,Pe)):I(Pe,Te(ge,Pe))}else{if(Ax&&Zt(G))for(const Ee of a.mount){const Pe=Te(r,Ee);if(Pe&&Pe._f){const Ne=Array.isArray(Pe._f.refs)?Pe._f.refs[0]:Pe._f.ref;if(sm(Ne)){const st=Ne.closest("form");if(st){st.reset();break}}}}if(J.keepFieldsRef)for(const Ee of a.mount)I(Ee,Te(ge,Ee));else r={}}i=t.shouldUnregister?J.keepDefaultValues?bn(o):{}:bn(ge),m.array.next({values:{...ge}}),m.state.next({values:{...ge}})}a={mount:J.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!f.isValid||!!J.keepIsValid||!!J.keepDirtyValues||!t.shouldUnregister&&!Vn(ge),s.watch=!!t.shouldUnregister,s.action=!1,J.keepErrors||(n.errors={}),m.state.next({submitCount:J.keepSubmitCount?n.submitCount:0,isDirty:pe?!1:J.keepDirty?n.isDirty:!!(J.keepDefaultValues&&!Kr(G,o)),isSubmitted:J.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:pe?{}:J.keepDirtyValues?J.keepDefaultValues&&i?Zs(o,i):n.dirtyFields:J.keepDefaultValues&&G?Zs(o,G):J.keepDirty?n.dirtyFields:{},touchedFields:J.keepTouched?n.touchedFields:{},errors:J.keepErrors?n.errors:{},isSubmitSuccessful:J.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},Ae=(G,J)=>Re(Hr(G)?G(i):G,J),Se=(G,J={})=>{const ie=Te(r,G),fe=ie&&ie._f;if(fe){const pe=fe.refs?fe.refs[0]:fe.ref;pe.focus&&(pe.focus(),J.shouldSelect&&Hr(pe.select)&&pe.select())}},Oe=G=>{n={...n,...G}},Fe={control:{register:K,unregister:ee,getFieldState:te,handleSubmit:Z,setError:Q,_subscribe:ce,_runSchema:_,_focusError:ue,_getWatch:H,_getDirty:A,_setValid:v,_setFieldArray:x,_setDisabledField:de,_setErrors:P,_getFieldArray:F,_reset:Re,_resetDefaultValues:()=>Hr(t.defaultValues)&&t.defaultValues().then(G=>{Ae(G,t.resetOptions),m.state.next({isLoading:!1})}),_removeUnmounted:U,_disableForm:le,_subjects:m,_proxyFormState:f,get _fields(){return r},get _formValues(){return i},get _state(){return s},set _state(G){s=G},get _defaultValues(){return o},get _names(){return a},set _names(G){a=G},get _formState(){return n},get _options(){return t},set _options(G){t={...t,...G}}},subscribe:se,trigger:z,register:K,handleSubmit:Z,watch:re,setValue:I,getValues:W,reset:Ae,resetField:xe,clearErrors:X,unregister:ee,setError:Q,setFocus:Se,getFieldState:te};return{...Fe,formControl:Fe}}function die(e={}){const t=D.useRef(void 0),n=D.useRef(void 0),[r,o]=D.useState({isDirty:!1,isValidating:!1,isLoading:Hr(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:Hr(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!Hr(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:s,...a}=cie(e);t.current={...a,formState:r}}const i=t.current.control;return i._options=e,Fx(()=>{const s=i._subscribe({formState:i._proxyFormState,callback:()=>o({...i._formState}),reRenderRoot:!0});return o(a=>({...a,isReady:!0})),i._formState.isReady=!0,s},[i]),D.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),D.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),D.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),D.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),D.useEffect(()=>{if(i._proxyFormState.isDirty){const s=i._getDirty();s!==r.isDirty&&i._subjects.state.next({isDirty:s})}},[i,r.isDirty]),D.useEffect(()=>{var s;e.values&&!Kr(e.values,n.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),!((s=i._options.resetOptions)===null||s===void 0)&&s.keepIsValid||i._setValid(),n.current=e.values,o(a=>({...a}))):i._resetDefaultValues()},[i,e.values]),D.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=XA(r,i),t.current}const[fie,pie]=Sd(),[mie,hie]=Sd(),Md=()=>{const e=mie(),t=fie(),{getFieldState:n,formState:r}=Dd();if(!e)throw new Error("useFormField should be used within <FormField>");const o=n(e.name,r),{id:i}=t;return{id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...o}},gie=({onSubmit:e,id:t,form:n,children:r,className:o})=>w.jsx(Uoe,{...n,children:w.jsx("form",{id:t,onSubmit:n.handleSubmit(e),className:o,"data-slot":"form",children:r})}),vie=({name:e,label:t,description:n,className:r,render:o,itemProps:i,labelProps:s,controlProps:a,descriptionProps:u,messageProps:c})=>{const{control:f}=Dd();return w.jsx(hie,{value:{name:e},children:w.jsx(Xoe,{name:e,control:f,render:({field:p,fieldState:m})=>w.jsxs(rN,{className:r,...i,children:[t&&w.jsx(oN,{...s,children:t}),w.jsx(iN,{...a,children:_t.isFunction(o)?o(p):h.createElement(o,p)}),n&&w.jsx(sN,{...u,children:n}),w.jsx(aN,{...c,children:m.error?.message})]})})})},rN=({className:e,...t})=>{const n=h.useId();return w.jsx(pie,{value:{id:n},children:w.jsx("div",{className:me("flex flex-col gap-2",e),"data-slot":"form-item",...t})})},oN=({className:e,...t})=>{const{error:n,formItemId:r}=Md();return w.jsx(Od,{className:me(n&&"text-error",e),htmlFor:r,...t})},iN=({className:e,...t})=>{const{error:n,formItemId:r,formDescriptionId:o,formMessageId:i}=Md();return w.jsx(km,{id:r,"aria-describedby":n?`${o} ${i}`:`${o}`,"aria-invalid":!!n,className:me("group",e),...t})},sN=({className:e,...t})=>{const{formDescriptionId:n}=Md();return w.jsx("p",{id:n,className:me("text-sm text-muted-foreground",e),"data-slot":"form-description",...t})},aN=({className:e,children:t,...n})=>{const{error:r,formMessageId:o}=Md(),i=r?String(r?.message):t;return i?w.jsx("p",{id:o,className:me("text-sm font-medium text-error",e),"data-slot":"form-message",...n,children:i}):null},$T=(e,t,n)=>{if(e&&"reportValidity"in e){const r=Te(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},Ob=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?$T(r.ref,n,e):r&&r.refs&&r.refs.forEach(o=>$T(o,n,e))}},DT=(e,t)=>{t.shouldUseNativeValidation&&Ob(e,t);const n={};for(const r in e){const o=Te(t.fields,r),i=Object.assign(e[r]||{},{ref:o&&o.ref});if(bie(t.names||Object.keys(e),r)){const s=Object.assign({},Te(n,r));Ct(s,"root",i),Ct(n,r,s)}else Ct(n,r,i)}return n},bie=(e,t)=>{const n=MT(t);return e.some(r=>MT(r).match(`^${n}\\.\\d+`))};function MT(e){return e.replace(/\]|\[/g,"")}function lN(e,t,n){function r(a,u){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:u,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,u);const c=s.prototype,f=Object.keys(c);for(let p=0;p<f.length;p++){const m=f[p];m in a||(a[m]=c[m].bind(a))}}const o=n?.Parent??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function s(a){var u;const c=n?.Parent?new i:this;r(c,a),(u=c._zod).deferred??(u.deferred=[]);for(const f of c._zod.deferred)f();return c}return Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}class yie extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const xie={};function uN(e){return xie}function wie(e,t){return typeof t=="bigint"?t.toString():t}const cN="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function mp(e){return typeof e=="string"?e:e?.message}function dN(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const o=mp(e.inst?._zod.def?.error?.(e))??mp(t?.error?.(e))??mp(n.customError?.(e))??mp(n.localeError?.(e))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}const fN=(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,wie,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Eie=lN("$ZodError",fN),pN=lN("$ZodError",fN,{Parent:Error}),Cie=e=>(t,n,r,o)=>{const i=r?Object.assign(r,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new yie;if(s.issues.length){const a=new(o?.Err??e)(s.issues.map(u=>dN(u,i,uN())));throw cN(a,o?.callee),a}return s.value},Rie=Cie(pN),Sie=e=>async(t,n,r,o)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){const a=new(o?.Err??e)(s.issues.map(u=>dN(u,i,uN())));throw cN(a,o?.callee),a}return s.value},Pie=Sie(pN);function AT(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}function Tie(e,t){for(var n={};e.length;){var r=e[0],o=r.code,i=r.message,s=r.path.join(".");if(!n[s])if("unionErrors"in r){var a=r.unionErrors[0].errors[0];n[s]={message:a.message,type:a.code}}else n[s]={message:i,type:o};if("unionErrors"in r&&r.unionErrors.forEach(function(f){return f.errors.forEach(function(p){return e.push(p)})}),t){var u=n[s].types,c=u&&u[r.code];n[s]=Lx(s,t,n,o,c?[].concat(c,r.message):r.message)}e.shift()}return n}function _ie(e,t){for(var n={};e.length;){var r=e[0],o=r.code,i=r.message,s=r.path.join(".");if(!n[s])if(r.code==="invalid_union"&&r.errors.length>0){var a=r.errors[0][0];n[s]={message:a.message,type:a.code}}else n[s]={message:i,type:o};if(r.code==="invalid_union"&&r.errors.forEach(function(f){return f.forEach(function(p){return e.push(p)})}),t){var u=n[s].types,c=u&&u[r.code];n[s]=Lx(s,t,n,o,c?[].concat(c,r.message):r.message)}e.shift()}return n}function Oie(e,t,n){if(n===void 0&&(n={}),(function(r){return"_def"in r&&typeof r._def=="object"&&"typeName"in r._def})(e))return function(r,o,i){try{return Promise.resolve(AT(function(){return Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(s){return i.shouldUseNativeValidation&&Ob({},i),{errors:{},values:n.raw?Object.assign({},r):s}})},function(s){if((function(a){return Array.isArray(a?.issues)})(s))return{values:{},errors:DT(Tie(s.errors,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw s}))}catch(s){return Promise.reject(s)}};if((function(r){return"_zod"in r&&typeof r._zod=="object"})(e))return function(r,o,i){try{return Promise.resolve(AT(function(){return Promise.resolve((n.mode==="sync"?Rie:Pie)(e,r,t)).then(function(s){return i.shouldUseNativeValidation&&Ob({},i),{errors:{},values:n.raw?Object.assign({},r):s}})},function(s){if((function(a){return a instanceof Eie})(s))return{values:{},errors:DT(_ie(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 $ie(e,t){return die({...t,resolver:Oie(e)})}const Jm=h.createContext(void 0);process.env.NODE_ENV!=="production"&&(Jm.displayName="ToastContext");function eh(){const e=h.useContext(Jm);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: useToastManager must be used within <Toast.Provider>.":zt(73));return e}let NT=0;function mN(e){return NT+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${NT}`}function Tv(e,t){if(typeof e=="string")return{description:e};if(typeof e=="function"){const n=e(t);return typeof n=="string"?{description:n}:n}return e}const hp=W9(e=>e.toasts,e=>{const t=new Map;let n=0,r=0;return e.forEach((o,i)=>{const s=o.transitionStatus==="ending";t.set(o.id,{value:o,domIndex:i,visibleIndex:s?-1:n,offsetY:r}),r+=o.height||0,s||(n+=1)}),t}),no={toasts:je(e=>e.toasts),isEmpty:je(e=>e.toasts.length===0),toast:je(hp,(e,t)=>e.get(t)?.value),toastIndex:je(hp,(e,t)=>e.get(t)?.domIndex??-1),toastOffsetY:je(hp,(e,t)=>e.get(t)?.offsetY??0),toastVisibleIndex:je(hp,(e,t)=>e.get(t)?.visibleIndex??-1),hovering:je(e=>e.hovering),focused:je(e=>e.focused),expanded:je(e=>e.hovering||e.focused),expandedOrOutOfFocus:je(e=>e.hovering||e.focused||!e.isWindowFocused),prevFocusElement:je(e=>e.prevFocusElement)};class Die extends Mm{timers=new Map;areTimersPaused=!1;constructor(t){super(t,{},no)}setFocused(t){this.set("focused",t)}setHovering(t){this.set("hovering",t)}setIsWindowFocused(t){this.set("isWindowFocused",t)}setPrevFocusElement(t){this.set("prevFocusElement",t)}setViewport=t=>{this.set("viewport",t)};disposeEffect=()=>()=>{this.timers.forEach(t=>{t.timeout?.clear()}),this.timers.clear()};removeToast(t,n={}){const r=no.toastIndex(this.state,t);if(r===-1)return;const o=this.state.toasts[r];n.skipOnRemove||o?.onRemove?.();const i=[...this.state.toasts];i.splice(r,1),this.setToasts(i)}addToast=t=>{const{timeout:n,limit:r}=this.state,o=t.id||mN("toast");if(t.id){const c=no.toast(this.state,t.id);if(c)if(c.transitionStatus==="ending")this.removeToast(t.id,{skipOnRemove:!0});else{const{id:f,transitionStatus:p,...m}=t;return this.updateToastInternal(t.id,m,{resetTimer:!0,markUpdated:!0}),t.id}}const i={...t,id:o,updateKey:0,transitionStatus:"starting"},s=[i,...this.state.toasts],a=s.filter(c=>c.transitionStatus!=="ending");if(a.length>r){const c=a.length-r,f=a.slice(-c),p=new Set(f.map(m=>m.id));this.setToasts(s.map(m=>{const b=p.has(m.id);return m.limited!==b?{...m,limited:b}:m}))}else this.setToasts(s.map(c=>c.limited?{...c,limited:!1}:c));const u=i.timeout??n;return i.type!=="loading"&&u>0&&this.scheduleTimer(o,u,()=>this.closeToast(o)),no.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),o};updateToast=(t,n)=>{this.updateToastInternal(t,n,{markUpdated:!0})};updateToastInternal=(t,n,r={})=>{const{timeout:o,toasts:i}=this.state,s=no.toast(this.state,t)??null;if(!s||s.transitionStatus==="ending")return;const a={...s,...n,...r.markUpdated&&{updateKey:(s.updateKey??0)+1}};this.setToasts(i.map(v=>v.id===t?a:v));const u=a.timeout??o,c=s?.timeout??o,f=Object.hasOwn(n,"timeout"),p=a.transitionStatus!=="ending"&&a.type!=="loading"&&u>0,m=this.timers.has(t),b=c!==u,y=s?.type==="loading";if(!p&&m){this.timers.get(t)?.timeout?.clear(),this.timers.delete(t);return}if(p&&(!m||b||f||y||r.resetTimer)){const v=this.timers.get(t);v&&(v.timeout?.clear(),this.timers.delete(t)),this.scheduleTimer(t,u,()=>this.closeToast(t)),no.expandedOrOutOfFocus(this.state)&&this.pauseTimers()}};closeToast=t=>{const n=t===void 0,{limit:r,toasts:o}=this.state;let i;if(n)i=o,this.timers.forEach(c=>{c.timeout?.clear()}),this.timers.clear();else{const c=no.toast(this.state,t);if(!c)return;i=[c];const f=this.timers.get(t);f?.timeout&&(f.timeout.clear(),this.timers.delete(t))}let s=0;const u={toasts:o.map(c=>{if(n||c.id===t)return{...c,transitionStatus:"ending",height:0};if(c.transitionStatus==="ending")return c;const f=s>=r;return s+=1,c.limited!==f?{...c,limited:f}:c})};(n||o.length===1)&&(u.hovering=!1,u.focused=!1),this.update(u),i.forEach(c=>{c.transitionStatus!=="ending"&&c.onClose?.()}),this.handleFocusManagement(t)};promiseToast=(t,n)=>{const r=Tv(n.loading),o=this.addToast({...r,type:"loading"}),i=t.then(s=>{const a=Tv(n.success,s);return this.updateToast(o,{...a,type:"success",timeout:a.timeout}),s}).catch(s=>{const a=Tv(n.error,s);return this.updateToast(o,{...a,type:"error",timeout:a.timeout}),Promise.reject(s)});return{}.hasOwnProperty.call(n,"setPromise")&&n.setPromise(i),i};pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(t=>{if(t.timeout){t.timeout.clear();const n=Date.now()-t.start,r=t.delay-n;t.remaining=r>0?r:0}}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((t,n)=>{t.remaining=t.remaining>0?t.remaining:t.delay,t.timeout??=fr.create(),t.timeout.start(t.remaining,()=>{this.timers.delete(n),t.callback()}),t.start=Date.now()}))}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=t=>{if(t.pointerType!=="touch")return;const n=nn(t);Ke(this.state.viewport,n)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))};scheduleTimer(t,n,r){const o=Date.now(),i=!no.expandedOrOutOfFocus(this.state),s=i?fr.create():void 0;s?.start(n,()=>{this.timers.delete(t),r()}),this.timers.set(t,{timeout:s,start:i?o:0,delay:n,remaining:n,callback:r})}setToasts(t){const n={toasts:t};t.length===0&&(n.hovering=!1,n.focused=!1),this.update(n)}handleFocusManagement(t){const n=Zn(ct(this.state.viewport));if(!this.state.viewport||!Ke(this.state.viewport,n)||!Ip(n))return;if(t===void 0){this.restoreFocusToPrevElement();return}const r=no.toasts(this.state),o=no.toastIndex(this.state,t);let i=null,s=o+1;for(;s<r.length;){if(r[s].transitionStatus!=="ending"){i=r[s];break}s+=1}if(!i)for(s=o-1;s>=0;){if(r[s].transitionStatus!=="ending"){i=r[s];break}s-=1}i?i.ref?.current?.focus():this.restoreFocusToPrevElement()}}const Bx=function(t){const{children:n,timeout:r=5e3,limit:o=3,toastManager:i}=t,s=Hn(()=>new Die({timeout:r,limit:o,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return Rm(s.disposeEffect),h.useEffect(function(){return i?i[" subscribe"](({action:c,options:f})=>{const p=f.id;c==="promise"&&f.promise?s.promiseToast(f.promise,f):c==="update"&&p?s.updateToast(p,f):c==="close"?s.closeToast(p):s.addToast(f)}):void 0},[s,r,i]),s.useSyncedValues({timeout:r,limit:o}),w.jsx(Jm.Provider,{value:s,children:n})};process.env.NODE_ENV!=="production"&&(Bx.displayName="ToastProvider");let Mie=(function(e){return e.frontmostHeight="--toast-frontmost-height",e})({});const Vx=h.forwardRef(function(t,n){const{render:r,className:o,style:i,children:s,...a}=t,u=eh(),c=po(),f=h.useRef(!1),p=h.useRef(!1),m=h.useRef(!1),b=u.useState("isEmpty"),y=u.useState("toasts"),v=u.useState("focused"),E=u.useState("expanded"),x=u.useState("prevFocusElement"),R=y[0]?.height??0,P=h.useMemo(()=>y.some(k=>k.transitionStatus==="ending"),[y]);h.useEffect(()=>{const k=u.state.viewport;if(!k)return;function q(W){b||W.key==="F6"&&nn(W)!==k&&(W.preventDefault(),u.setPrevFocusElement(Zn(ct(k))),k?.focus({preventScroll:!0}),u.pauseTimers(),u.setFocused(!0))}const z=Vt(k);return Ge(z,"keydown",q)},[u,b]),h.useEffect(()=>{const k=u.state.viewport;if(!k||b)return;const q=Vt(k);function z(te){nn(te)===q&&(u.setIsWindowFocused(!1),u.pauseTimers())}function W(te){if(te.relatedTarget)return;const X=nn(te),Q=Zn(ct(k));(X===q||!Ke(k,X)||!Ip(Q))&&u.resumeTimers(),c.start(0,()=>u.setIsWindowFocused(!0))}return zr(Ge(q,"blur",z,!0),Ge(q,"focus",W,!0))},[u,c,b]),h.useEffect(()=>{const k=u.state.viewport;if(!k||b)return;const q=ct(k);return Ge(q,"pointerdown",u.handleDocumentPointerDown,!0)},[b,u]);function O(k){const q=u.state.viewport;q&&(f.current=!0,k.relatedTarget===q?y[0]?.ref?.current?.focus():u.restoreFocusToPrevElement())}function S(k){k.key==="Tab"&&k.shiftKey&&nn(k.nativeEvent)===u.state.viewport&&(k.preventDefault(),u.restoreFocusToPrevElement(),u.resumeTimers())}function T(){const k=u.state.toasts.some(q=>q.transitionStatus==="ending");!u.state.isWindowFocused||k||m.current||!p.current||(u.resumeTimers(),u.setHovering(!1),p.current=!1)}h.useEffect(T,[P,u]);function _(){u.pauseTimers(),u.setHovering(!0),p.current=!1}function $(){P||m.current?p.current=!0:(u.resumeTimers(),u.setHovering(!1))}function V(k){k.pointerType==="touch"&&(m.current=!0)}function U(k){k.pointerType==="touch"&&(m.current=!1,T())}function A(){if(f.current){f.current=!1;return}v||Ip(Zn(ct(u.state.viewport)))&&(u.setFocused(!0),u.pauseTimers())}function H(k){!v||Ke(u.state.viewport,k.relatedTarget)||(u.setFocused(!1),u.resumeTimers())}const F={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:_,onMouseMove:_,onMouseLeave:$,onFocus:A,onBlur:H,onKeyDown:S,onClick:A,onPointerDown:V,onPointerUp:U,onPointerCancel:U},N={expanded:E},j=lt("div",t,{ref:[n,u.setViewport],state:N,props:[F,{style:{[Mie.frontmostHeight]:R?`${R}px`:void 0}},a,{children:w.jsxs(h.Fragment,{children:[!b&&x&&w.jsx(Ei,{onFocus:O}),s,!b&&x&&w.jsx(Ei,{onFocus:O})]})}]}),I=h.useMemo(()=>y.filter(k=>k.priority==="high"),[y]);return w.jsxs(h.Fragment,{children:[!b&&x&&w.jsx(Ei,{onFocus:O}),j,!v&&I.length>0&&w.jsx("div",{style:pd,children:I.map(k=>w.jsxs("div",{role:"alert","aria-atomic":!0,children:[w.jsx("div",{children:k.title}),w.jsx("div",{children:k.description})]},k.id))})]})});process.env.NODE_ENV!=="production"&&(Vx.displayName="ToastViewport");const Kx=h.createContext(void 0);process.env.NODE_ENV!=="production"&&(Kx.displayName="ToastRootContext");function Ad(){const e=h.useContext(Kx);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ToastRootContext is missing. Toast parts must be used within <Toast.Root>.":zt(66));return e}let gi=(function(e){return e.index="--toast-index",e.offsetY="--toast-offset-y",e.height="--toast-height",e.swipeMovementX="--toast-swipe-movement-x",e.swipeMovementY="--toast-swipe-movement-y",e})({});const Aie={...xs,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},kc=40,Nie=10,fi=.5,Iie=1,kie=`${kV},${FV}`;function IT(e,t,n){switch(e){case"up":return-n;case"down":return n;case"left":return-t;case"right":return t;default:return 0}}function Fie(e){const n=Vt(e).getComputedStyle(e).transform;let r=0,o=0,i=1;if(n&&n!=="none"){const s=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(s){const a=s[1].split(", ").map(parseFloat);a.length===6?(r=a[4],o=a[5],i=Math.sqrt(a[0]*a[0]+a[1]*a[1])):a.length===16&&(r=a[12],o=a[13],i=a[0])}}return{x:r,y:o,scale:i}}const Hx=h.forwardRef(function(t,n){const{toast:r,render:o,className:i,swipeDirection:s=["down","right"],style:a,...u}=t,c=r.positionerProps?.anchor!==void 0;let f=[];c||(f=Array.isArray(s)?s:[s]);const p=f.length>0,m=eh(),[b,y]=h.useState(void 0),[v,E]=h.useState(!1),[x,R]=h.useState(!1),[P,O]=h.useState(!1),[S,T]=h.useState({x:0,y:0}),[_,$]=h.useState({x:0,y:0,scale:1}),[V,U]=h.useState(),[A,H]=h.useState(),[F,N]=h.useState(null),j=h.useRef(null),I=h.useRef({x:0,y:0}),k=h.useRef({x:0,y:0,scale:1}),q=h.useRef(void 0),z=h.useRef(0),W=h.useRef(!1),te=h.useRef({x:0,y:0}),X=h.useRef(!1),Q=m.useState("toastIndex",r.id),re=m.useState("toastVisibleIndex",r.id),ce=m.useState("toastOffsetY",r.id),se=m.useState("focused"),ee=m.useState("expanded");ma({open:r.transitionStatus!=="ending",ref:j,onComplete(){r.transitionStatus==="ending"&&m.removeToast(r.id)}});const de=He((J=!1)=>{const ie=j.current;if(!ie)return;const fe=ie.style.height;ie.style.height="auto";const pe=ie.offsetHeight;ie.style.height=fe;function ge(){m.updateToastInternal(r.id,{ref:j,height:pe,...r.transitionStatus==="starting"?{transitionStatus:void 0}:{}})}J?er.flushSync(ge):ge()});Le(de,[de]);function K(J,ie){let fe=J,pe=ie;return!f.includes("left")&&!f.includes("right")?fe=J>0?J**fi:-(Math.abs(J)**fi):(!f.includes("right")&&J>0&&(fe=J**fi),!f.includes("left")&&J<0&&(fe=-(Math.abs(J)**fi))),!f.includes("up")&&!f.includes("down")?pe=ie>0?ie**fi:-(Math.abs(ie)**fi):(!f.includes("down")&&ie>0&&(pe=ie**fi),!f.includes("up")&&ie<0&&(pe=-(Math.abs(ie)**fi))),{x:fe,y:pe}}function ue(J){if(J.button!==0)return;J.pointerType==="touch"&&m.pauseTimers();const ie=nn(J.nativeEvent);if(!(ie&&ie.closest(`button,a,input,textarea,[role="button"],${kie}`))){if(W.current=!1,q.current=void 0,z.current=0,I.current={x:J.clientX,y:J.clientY},te.current=I.current,j.current){const pe=Fie(j.current);k.current=pe,$(pe),T({x:pe.x,y:pe.y})}m.setHovering(!0),E(!0),R(!1),N(null),X.current=!0,j.current?.setPointerCapture(J.pointerId)}}function le(J){if(!v)return;J.preventDefault(),X.current&&(I.current={x:J.clientX,y:J.clientY},X.current=!1);const{clientY:ie,clientX:fe,movementX:pe,movementY:ge}=J;(ge<0&&ie>te.current.y||ge>0&&ie<te.current.y)&&(te.current={x:te.current.x,y:ie}),(pe<0&&fe>te.current.x||pe>0&&fe<te.current.x)&&(te.current={x:fe,y:te.current.y});const Ee=fe-I.current.x,Pe=ie-I.current.y,Ne=ie-te.current.y,st=fe-te.current.x;if(!x&&Math.sqrt(Ee*Ee+Pe*Pe)>=Iie&&(R(!0),F===null)){const un=f.includes("left")||f.includes("right"),mn=f.includes("up")||f.includes("down");if(un&&mn){const $n=Math.abs(Ee),nt=Math.abs(Pe);N($n>nt?"horizontal":"vertical")}}let ut;if(!q.current)F==="vertical"?Pe>0?ut="down":Pe<0&&(ut="up"):F==="horizontal"?Ee>0?ut="right":Ee<0&&(ut="left"):Math.abs(Ee)>=Math.abs(Pe)?ut=Ee>0?"right":"left":ut=Pe>0?"down":"up",ut&&f.includes(ut)&&(q.current=ut,z.current=IT(ut,Ee,Pe),y(ut));else{const Yt=q.current,un=IT(Yt,st,Ne);un>kc?(W.current=!1,y(Yt)):!(f.includes("left")&&f.includes("right"))&&!(f.includes("up")&&f.includes("down"))&&z.current-un>=Nie&&(W.current=!0)}const wt=K(Ee,Pe);let dt=k.current.x,Nt=k.current.y;F==="horizontal"?(f.includes("left")||f.includes("right"))&&(dt+=wt.x):(F==="vertical"||(f.includes("left")||f.includes("right"))&&(dt+=wt.x),(f.includes("up")||f.includes("down"))&&(Nt+=wt.y)),T({x:dt,y:Nt})}function Z(J){if(!v)return;if(E(!1),R(!1),N(null),j.current?.releasePointerCapture(J.pointerId),W.current){T({x:_.x,y:_.y}),y(void 0);return}let ie=!1;const fe=S.x-_.x,pe=S.y-_.y;let ge;for(const Ee of f){switch(Ee){case"right":fe>kc&&(ie=!0,ge="right");break;case"left":fe<-kc&&(ie=!0,ge="left");break;case"down":pe>kc&&(ie=!0,ge="down");break;case"up":pe<-kc&&(ie=!0,ge="up");break}if(ie)break}ie?(y(ge),O(!0),m.closeToast(r.id)):(T({x:_.x,y:_.y}),y(void 0))}function xe(){v&&(E(!1),R(!1),N(null),T({x:_.x,y:_.y}),y(void 0))}function Re(J){if(J.key==="Escape"){if(!j.current||!Ke(j.current,Zn(ct(j.current))))return;m.closeToast(r.id)}}h.useEffect(()=>{if(!p)return;const J=j.current;if(!J)return;function ie(fe){Ke(J,nn(fe))&&fe.preventDefault()}return Ge(J,"touchmove",ie,{passive:!1})},[p]);function Ae(){if(!v&&S.x===_.x&&S.y===_.y&&!P)return{[gi.swipeMovementX]:"0px",[gi.swipeMovementY]:"0px"};const J=S.x-_.x,ie=S.y-_.y;return{transition:v?"none":void 0,transform:v?`translateX(${S.x}px) translateY(${S.y}px) scale(${_.scale})`:void 0,[gi.swipeMovementX]:`${J}px`,[gi.swipeMovementY]:`${ie}px`}}const Se=r.priority==="high",Oe={role:Se?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":V,"aria-describedby":A,"aria-hidden":Se&&!se?!0:void 0,onPointerDown:p?ue:void 0,onPointerMove:p?le:void 0,onPointerUp:p?Z:void 0,onPointerCancel:p?xe:void 0,onKeyDown:Re,inert:Oy(r.limited),style:{...Ae(),[gi.index]:r.transitionStatus==="ending"?Q:re,[gi.offsetY]:`${ce}px`,[gi.height]:r.height?`${r.height}px`:void 0}},Ye=h.useMemo(()=>({rootRef:j,toast:r,titleId:V,setTitleId:U,descriptionId:A,setDescriptionId:H,swiping:v,swipeDirection:b,recalculateHeight:de,index:Q,visibleIndex:re,expanded:ee}),[r,V,A,v,b,de,Q,re,ee]),Fe={transitionStatus:r.transitionStatus,expanded:ee,limited:r.limited||!1,type:r.type,swiping:Ye.swiping,swipeDirection:Ye.swipeDirection},G=lt("div",t,{ref:[n,Ye.rootRef],state:Fe,stateAttributesMapping:Aie,props:[Oe,u]});return w.jsx(Kx.Provider,{value:Ye,children:G})});process.env.NODE_ENV!=="production"&&(Hx.displayName="ToastRoot");const Wx=h.forwardRef(function(t,n){const{render:r,className:o,style:i,...s}=t,{visibleIndex:a,expanded:u,recalculateHeight:c}=Ad(),f=h.useRef(null);Le(()=>{const y=f.current;if(!y||(c(),typeof ResizeObserver!="function"||typeof MutationObserver!="function"))return;const v=new ResizeObserver(()=>c(!0)),E=new MutationObserver(()=>c(!0));return v.observe(y),E.observe(y,{childList:!0,subtree:!0,characterData:!0}),()=>{v.disconnect(),E.disconnect()}},[c]);const p=a>0;return lt("div",t,{ref:[n,f],state:{expanded:u,behind:p},props:s})});process.env.NODE_ENV!=="production"&&(Wx.displayName="ToastContent");const Ux=h.forwardRef(function(t,n){const{render:r,className:o,style:i,id:s,children:a,...u}=t,{toast:c,setDescriptionId:f}=Ad(),p=a??c.description,m=!!p,b=ys(s);Le(()=>{if(m)return f(b),()=>{f(void 0)}},[m,b,f]);const y={type:c.type},v=lt("p",t,{ref:n,state:y,props:{...u,id:b,children:p}});return m?v:null});process.env.NODE_ENV!=="production"&&(Ux.displayName="ToastDescription");const zx=h.forwardRef(function(t,n){const{render:r,className:o,style:i,id:s,children:a,...u}=t,{toast:c,setTitleId:f}=Ad(),p=a??c.title,m=!!p,b=ys(s);Le(()=>{if(m)return f(b),()=>{f(void 0)}},[m,b,f]);const y={type:c.type},v=lt("h2",t,{ref:n,state:y,props:{...u,id:b,children:p}});return m?v:null});process.env.NODE_ENV!=="production"&&(zx.displayName="ToastTitle");const Gx=h.forwardRef(function(t,n){const{render:r,className:o,style:i,disabled:s,nativeButton:a=!0,...u}=t,c=eh(),{toast:f}=Ad(),p=c.useState("expanded"),[m,b]=h.useState(!1),{getButtonProps:y,buttonRef:v}=ga({disabled:s,native:a}),E={type:f.type};return lt("button",t,{ref:[n,v],state:E,props:[{"aria-hidden":!p&&!m,onClick(){c.closeToast(f.id)},onFocus(){b(!0)},onBlur(){b(!1)}},u,y]})});process.env.NODE_ENV!=="production"&&(Gx.displayName="ToastClose");const hN=h.forwardRef(function(t,n){const{render:r,className:o,style:i,disabled:s,nativeButton:a=!0,...u}=t,{toast:c}=Ad(),f=c.actionProps?.children??u.children,p=!!f,{getButtonProps:m,buttonRef:b}=ga({disabled:s,native:a}),y={type:c.type},v=lt("button",t,{ref:[n,b],state:y,props:[u,c.actionProps,m,{children:f}]});return p?v:null});process.env.NODE_ENV!=="production"&&(hN.displayName="ToastAction");const gN=Rx,Yx=h.createContext(void 0);process.env.NODE_ENV!=="production"&&(Yx.displayName="ToastPositionerContext");function Lie(){const e=h.useContext(Yx);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ToastPositionerContext is missing. ToastPositioner parts must be placed within <Toast.Positioner>.":zt(84));return e}const vN=h.forwardRef(function(t,n){const{toast:r,...o}=t,i=eh(),s=r.positionerProps??yn,{render:a,className:u,anchor:c=s.anchor,positionMethod:f=s.positionMethod??"absolute",side:p=s.side??"top",align:m=s.align??"center",sideOffset:b=s.sideOffset??0,alignOffset:y=s.alignOffset??0,collisionBoundary:v=s.collisionBoundary??"clipping-ancestors",collisionPadding:E=s.collisionPadding??5,arrowPadding:x=s.arrowPadding??5,sticky:R=s.sticky??!1,disableAnchorTracking:P=s.disableAnchorTracking??!1,collisionAvoidance:O=s.collisionAvoidance??q_,style:S,...T}=o,[_,$]=h.useState(null),V=i.useState("toastIndex",r.id),U=i.useState("toastVisibleIndex",r.id),A=et(c)?c:null,H=KO({open:!0,onOpenChange:At,elements:{floating:_,reference:A}}),F=CA({anchor:A,positionMethod:f,floatingRootContext:H,mounted:!0,side:p,sideOffset:b,align:m,alignOffset:y,collisionBoundary:v,collisionPadding:E,sticky:R,arrowPadding:x,disableAnchorTracking:P,keepMounted:!0,collisionAvoidance:O}),N=h.useMemo(()=>({side:F.side,align:F.align,anchorHidden:F.anchorHidden}),[F.side,F.align,F.anchorHidden]),j=SA(t,N,{styles:{...F.positionerStyles,[gi.index]:r.transitionStatus==="ending"?V:U},transitionStatus:r.transitionStatus,props:T,refs:[n,$]});return w.jsx(Yx.Provider,{value:F,children:j})});process.env.NODE_ENV!=="production"&&(vN.displayName="ToastPositioner");const bN=h.forwardRef(function(t,n){const{className:r,render:o,style:i,...s}=t,{arrowRef:a,side:u,align:c,arrowUncentered:f,arrowStyles:p}=Lie();return lt("div",t,{state:{side:u,align:c,uncentered:f},ref:[n,a],props:[{style:p,"aria-hidden":!0},s]})});process.env.NODE_ENV!=="production"&&(bN.displayName="ToastArrow");function Xx(){const e=h.useContext(Jm);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: useToastManager must be used within <Toast.Provider>.":zt(73));const t=e.useState("toasts");return h.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function yN(){const e=new Set;function t(n){e.forEach(r=>r(n))}return{" subscribe":function(r){return e.add(r),()=>{e.delete(r)}},add(n){const r=n.id||mN("toast"),o={...n,id:r,transitionStatus:"starting"};return t({action:"add",options:o}),r},close(n){t({action:"close",options:{id:n}})},update(n,r){t({action:"update",options:{...r,id:n}})},promise(n,r){let o=n;return t({action:"promise",options:{...r,promise:n,setPromise(i){o=i}}}),o}}}const qie=Object.freeze(Object.defineProperty({__proto__:null,Action:hN,Arrow:bN,Close:Gx,Content:Wx,Description:Ux,Portal:gN,Positioner:vN,Provider:Bx,Root:Hx,Title:zx,Viewport:Vx,createToastManager:yN,useToastManager:Xx},Symbol.toStringTag,{value:"Module"})),th={default:{icon:null,ringClass:"ring-input",titleClass:"",bgClass:""},success:{icon:cH,ringClass:"ring-success",titleClass:"text-success",bgClass:"bg-success/5"},error:{icon:fH,ringClass:"ring-error",titleClass:"text-error",bgClass:"bg-error/5"},warning:{icon:_H,ringClass:"ring-warning",titleClass:"text-warning",bgClass:"bg-warning/5"},info:{icon:D$,ringClass:"ring-info",titleClass:"text-info",bgClass:"bg-info/5"}};function xN({variant:e="default"}={}){return me("rounded-xl ring-1 bg-clip-padding p-4 shadow-lg bg-background",th[e].ringClass)}function Zx(e){return{...e,close:t=>e.close(t),add:t=>{if(t.id){const n=e.toasts;if(n){const r=n.find(o=>o.id===t.id);if(r&&r.transitionStatus!=="ending")return e.update(t.id,{bump:!1}),requestAnimationFrame(()=>{e.update(t.id,{bump:!0,...t.timeout!==void 0&&{timeout:t.timeout}})}),t.id;if(r&&r.transitionStatus==="ending")return t.id}}return e.add({...t})},update:(t,n)=>e.update(t,{...n}),promise:(t,n)=>e.promise(t,{loading:{...n.loading},success:typeof n.success=="function"?r=>({...n.success(r)}):{...n.success},error:typeof n.error=="function"?r=>({...n.error(r)}):{...n.error}})}}function wN(){const e=Xx();return{...Zx(e),toasts:e.toasts}}function jie(){return Zx(yN())}let vi=null;function Fc(e){return typeof e=="string"?{title:e}:e}const Bie=Object.assign(e=>vi?.add({...Fc(e)}),{success:e=>vi?.add({variant:"success",...Fc(e)}),error:e=>vi?.add({variant:"error",...Fc(e)}),warning:e=>vi?.add({variant:"warning",...Fc(e)}),info:e=>vi?.add({variant:"info",...Fc(e)}),promise:(e,t)=>vi?.promise(e,t)});function Vie(){const e=Xx();return vi=D.useMemo(()=>Zx(e),[e]),D.useEffect(()=>()=>{vi=null},[]),null}function EN({children:e,toastManager:t,container:n}){return w.jsxs(Bx,{toastManager:t,children:[w.jsx(Vie,{}),e,w.jsx(gN,{container:n,children:w.jsx(Vx,{className:"fixed top-auto right-4 bottom-4 mx-auto flex w-[calc(100%-2rem)] sm:right-8 sm:bottom-8 sm:w-[340px]",children:w.jsx(Kie,{})})})]})}function Kie(){const{toasts:e}=wN();return e.map(t=>w.jsxs(Hx,{toast:t,"data-slot":"toast",className:me("absolute right-0 bottom-0 left-auto z-[calc(1000-var(--toast-index))] mr-0 h-[var(--height)] w-full origin-bottom select-none",xN({variant:t.variant}),"[--gap:0.75rem] [--height:var(--toast-frontmost-height,var(--toast-height))] [--offset-y:calc(var(--toast-offset-y)*-1+calc(var(--toast-index)*var(--gap)*-1)+var(--toast-swipe-movement-y))] [--peek:0.75rem] [--scale:calc(max(0,1-(var(--toast-index)*0.1)))] [--shrink:calc(1-var(--scale))]","[transform:translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)-(var(--toast-index)*var(--peek))-(var(--shrink)*var(--height))))_scale(var(--scale))] [transition:transform_0.5s_cubic-bezier(0.22,1,0.36,1),opacity_0.5s,height_0.15s]","after:absolute after:top-full after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-['']","data-[ending-style]:opacity-0 data-[expanded]:h-[var(--toast-height)] data-[expanded]:[transform:translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--offset-y)))] data-[limited]:opacity-0 data-[starting-style]:[transform:translateY(150%)]","data-[ending-style]:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))] data-[expanded]:data-[ending-style]:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]","data-[ending-style]:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))] data-[expanded]:data-[ending-style]:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]","data-[ending-style]:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))] data-[expanded]:data-[ending-style]:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]","data-[ending-style]:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))] data-[expanded]:data-[ending-style]:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]","[&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:[transform:translateY(150%)]",t.bump&&"animate-toast-bump"),children:[w.jsx(Hie,{variant:t.variant}),w.jsxs(Wx,{className:"isolate flex flex-col gap-1 transition-opacity [transition-duration:250ms] data-[behind]:pointer-events-none data-[behind]:opacity-0 data-[expanded]:pointer-events-auto data-[expanded]:opacity-100",children:[t.content??w.jsxs("div",{className:"flex items-start gap-2",children:[w.jsx(Wie,{variant:t.variant}),w.jsxs("div",{className:"flex flex-col gap-1 overflow-hidden",children:[w.jsx(zx,{"data-slot":"toast-title",className:me("text-[0.975rem] leading-5 font-medium text-foreground",th[t.variant??"default"].titleClass)}),w.jsx(Ux,{"data-slot":"toast-description",className:"text-[0.925rem] leading-5 text-muted-foreground"}),!!t.actions?.length&&w.jsx("div",{className:"mt-2 flex min-w-0 flex-nowrap gap-2 overflow-x-auto p-px",children:t.actions.map((n,r)=>w.jsx(Tn,{...n},r))})]})]}),w.jsx(Gx,{className:"absolute top-2 right-2 flex h-4 w-4 items-center justify-center rounded border-none bg-transparent text-current/50 hover:bg-foreground/10 hover:text-current","aria-label":"Close",children:w.jsx(vd,{className:"h-3 w-3"})})]})]},t.id))}function Hie({variant:e}){const t=e?th[e].bgClass:"";return w.jsx("div",{className:me("absolute inset-0 rounded-[11px] bg-background/90",t)})}function Wie({variant:e}){if(!e||e==="default")return null;const{icon:t,titleClass:n}=th[e];return t?w.jsx(t,{"data-slot":"toast-icon",className:me("mt-0.5 h-4 w-4 shrink-0",n)}):null}function Uie({children:e,tooltipDelay:t,...n}){return w.jsx(_A,{delay:t,children:w.jsx(EN,{...n,children:e})})}const CN=({value:e,onChange:t,defaultValue:n="",...r})=>{const o=Im("Input",r),[i="",s]=Kt({prop:e,onChange:t,defaultProp:n}),a=u=>{s(u.target.value)};return w.jsx("input",{"data-slot":"input",autoComplete:"off",...o,value:i,onChange:a,className:me("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)})};function zie({className:e,...t}){return w.jsx("kbd",{className:me("pointer-events-none inline-flex h-5 min-w-5 select-none items-center justify-center gap-1 rounded bg-muted px-1 font-medium font-sans text-muted-foreground text-xs [&_svg:not([class*='size-'])]:size-3",e),"data-slot":"kbd",...t})}function Gie({className:e,...t}){return w.jsx("kbd",{className:me("inline-flex items-center gap-1",e),"data-slot":"kbd-group",...t})}const Yie=Oi("animate-spin",{variants:{variant:{primary:"text-primary",secondary:"text-secondary",ghost:"text-muted-foreground",error:"text-error",success:"text-success",warning:"text-warning",info:"text-info"},size:{xs:"size-3",sm:"size-4",default:"size-7",lg:"size-10",xl:"size-14"}},defaultVariants:{variant:"primary",size:"default"}}),Xie=({center:e,containerClassName:t,variant:n,size:r,...o})=>w.jsx("div",{className:me(t,e&&"fixed inset-0 grid place-items-center"),"data-slot":"loader",children:w.jsx(nb,{"data-slot":"loader-icon",...o,className:me(Yie({variant:n,size:r}),o.className)})});function Zie(e){const[t=[],n]=D.useState(e);return[t,{insertAt:(m,b)=>{n((y=[])=>{const v=[...y];return v.splice(m,0,b),v})},removeAt:m=>{n((b=[])=>{const y=[...b];return y.splice(m,1),y})},updateAt:(m,b)=>{n((y=[])=>{const v=[...y];return v[m]=b,v})},clear:()=>n([]),reset:()=>n(e),push:m=>n((b=[])=>[...b,m]),set:m=>n(m),pop:()=>{n((m=[])=>{const b=[...m];return b.pop(),b})},update:(m,b)=>{n((y=[])=>{const v=[...y],E=_t.findIndex(v,m);return E===-1||(v[E]=_t.isFunction(b)?b(v[E]):b),v})}}]}function Qie({fn:e,dependencies:t=[],onError:n,onSuccess:r,onFinish:o}){const[i,s]=D.useState(!0),[a,u]=D.useState(null),[c,f]=D.useState(null),p=D.useCallback(()=>{s(!0),u(null),f(null),e().then(m=>{r?.(m),f(m)}).catch(m=>{n?.(m),u(m)}).finally(()=>{o?.(),s(!1)})},t);return D.useEffect(()=>{p()},[p]),{loading:i,error:a,data:c,refetch:p}}const Jie=(e,t=!0)=>{const n=D.useRef(null),r=o=>{n.current&&!n.current.contains(o.target)&&e()};return D.useEffect(()=>{if(t)return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r)}},[t]),n};function ese(){const[e,t]=D.useState(null),n=D.useCallback(async r=>{if(!navigator?.clipboard)return!1;try{return await navigator.clipboard.writeText(r),t(r),!0}catch(o){return console.error(o),t(null),!1}},[]);return[e,n]}function tse(e,t){const n=D.useRef(null);return D.useCallback((...r)=>{n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{e(...r)},t)},[e,t])}function nse(e,t){const[n,r]=D.useState(e);return D.useEffect(()=>{const o=setTimeout(()=>{r(e)},t);return()=>clearTimeout(o)},[e,t]),n}function rse(e=!1,t){const{onOpen:n,onClose:r}=t||{},[o,i]=D.useState(e),s=D.useCallback(()=>{i(c=>c||(n?.(),!0))},[n]),a=D.useCallback(()=>{i(c=>c&&(r?.(),!1))},[r]),u=D.useCallback(()=>{o?a():s()},[a,s,o]);return[o,{open:s,close:a,toggle:u}]}function ose(e){D.useEffect(()=>{typeof e=="string"&&e.trim().length>0&&(document.title=e.trim())},[e])}function RN(e,t,n){const r=D.useRef(null);return D.useEffect(()=>{const o=r.current??document;return o.addEventListener(e,t,n),()=>{o.removeEventListener(e,t,n)}},[e,t,n]),r}const ise=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")}},sse=(e,t)=>{const{mainKey:n,isShift:r,isCtrl:o,isAlt:i,isMeta:s}=ise(t);return e.key.toLowerCase()===n&&e.shiftKey===r&&e.ctrlKey===o&&e.altKey===i&&e.metaKey===s},ase=e=>e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable,lse=(e,t)=>t&&ase(e.target),use=(e,t,n,r,o)=>i=>{if(!o||lse(i,r))return;(Array.isArray(e)?e:[e]).some(u=>sse(i,u))&&(n&&i.preventDefault(),t(i))};function SN(e,t,n={}){const{eventName:r="keydown",preventDefault:o=!0,ignoreInputFields:i=!0,watch:s=!0}=n,a=D.useCallback(use(e,t,o,i,s),[e,t,o,i,s]);return RN(r,a)}function cse(e){const[t,n]=D.useState(!1),r=D.useRef(null);return D.useEffect(()=>{const o=a=>{n(!0),e?.onHoverStart?.(a)},i=a=>{n(!1),e?.onHoverEnd?.(a)},s=r.current;if(s)return s.addEventListener("mouseover",o),s.addEventListener("mouseout",i),()=>{s.removeEventListener("mouseover",o),s.removeEventListener("mouseout",i)}},[e]),{ref:r,isHovering:t}}function dse({onVisible:e,root:t=null,rootMargin:n="0px",threshold:r=0}={}){const[o,i]=D.useState(!1),s=D.useRef(null),a=D.useCallback(([u])=>{const c=u.isIntersecting;i(c)},[e]);return D.useEffect(()=>{if(s.current==null)return;const u=new IntersectionObserver(a,{root:t,rootMargin:n,threshold:r});return u.observe(s.current),()=>{s.current!=null&&u.unobserve(s.current)}},[s,t,n,r,a]),D.useEffect(()=>{o&&e?.()},[o]),{ref:s,isVisible:o}}function fse(e,t){const n=()=>{try{const a=localStorage.getItem(e);return a?JSON.parse(a):t!==void 0?t:void 0}catch(a){return console.error(`Error parsing localStorage key "${e}":`,a),t!==void 0?t:void 0}},[r,o]=D.useState(n);return D.useEffect(()=>{try{r!==void 0?localStorage.setItem(e,JSON.stringify(r)):localStorage.removeItem(e)}catch(a){console.error(`Error setting localStorage key "${e}":`,a)}},[e,r]),[r,a=>{o(a)},()=>{try{localStorage.removeItem(e),o(t!==void 0?t:void 0)}catch(a){console.error(`Error removing localStorage key "${e}":`,a)}}]}const pse=e=>{const[t,n]=D.useState(!1);return D.useEffect(()=>{const r=window.matchMedia(e),o=()=>n(r.matches);return o(),r.addEventListener("change",o),()=>{r.removeEventListener("change",o)}},[e]),t};function mse(e){_t.isFunction(e)||console.error(`useMemoizedFn expected parameter is a function, got ${typeof e}`);const t=D.useRef(e);t.current=D.useMemo(()=>e,[e]);const n=D.useRef(null);return n.current||(n.current=function(...r){return t.current.apply(this,r)}),n.current}const hse=e=>{const[t,n]=D.useState(!1),[r,o]=D.useState(null),[i,s]=D.useState(null);return{mutate:D.useCallback(async(...u)=>{n(!0),o(null),s(null);try{const c=await e.fn(...u);return e.onSuccess?.(c),s(c),c}catch(c){const f=c;throw e.onError?.(f),o(f),f}finally{e.onFinish?.(),n(!1)}},[e]),loading:t,error:r,data:i}};function gse(e){const[t,n]=D.useState(e),r=D.useCallback(()=>n(e),[e]),o=D.useCallback(i=>{n(s=>{if(_t.isFunction(i)){const a=i(s);return _t.isObject(a)?{...s,...a}:s}else if(_t.isObject(i))return{...s,...i};return s})},[]);return[t,o,r]}function Qx({totalItems:e,pageSize:t,initialCurrentPage:n=1,onChange:r}){const[o,i]=D.useState(n),s=Math.ceil(e/t),a=o===s,u=o===1,c=(o-1)*t+1,f=Math.min(o*t,e),p=()=>{if(a)return;const v=Math.min(o+1,s);y(v)},m=()=>{if(u)return;const v=Math.max(o-1,1);y(v)},b=v=>{if(v===1&&u||v===s&&a)return;const E=Math.max(1,v),x=Math.min(E,s);y(x)},y=v=>{i(v),r?.({currentPage:v,pageSize:t})};return{next:p,prev:m,goTo:b,currentPage:o,maxPage:s,isFirstPage:u,isLastPage:a,range:{start:c,end:f}}}function vse(e){const t=()=>document.getElementById(e),n=()=>{const o=document.createElement("div");return o.id=e,o},r=D.useMemo(()=>{const o=t();return o||n()},[e]);return D.useEffect(()=>(document.getElementById(e)||document.body.appendChild(r),()=>{const o=document.getElementById(e);o&&document.body.removeChild(o)}),[e,r]),{render:o=>Wr.createPortal(o,r)}}function bse({shouldPrevent:e,message:t="Es posible que no se guarden los cambios hayas hecho."}){const n=r=>{if(e)return r.preventDefault(),r.returnValue=t,t};D.useEffect(()=>(window.addEventListener("beforeunload",n),()=>window.removeEventListener("beforeunload",n)),[t,e])}const wi="...",PN=({siblingCount:e=1,...t})=>{const n=Qx(t),{currentPage:r,maxPage:o}=n,{totalItems:i,pageSize:s}=t,a=()=>{const p=2+3*e,m=1;if(p>=o)return _t.range(m,o+1);const b=Math.max(r-e,1),y=Math.min(r+e,o),v=b>2,E=y<o-2;if(v&&E){const x=_t.range(b,y+1);return[m,wi,...x,wi,o]}if(E)return[..._t.range(m,p+1),wi,o];if(v){const x=_t.range(o-p+1,o+1);return[m,wi,...x]}},u=D.useMemo(a,[i,s,r,e]);return{...n,paginationRange:u??[]}};function yse(e){const[t,n]=D.useState(new Set),r=D.useCallback(f=>t.has(f),[t]),o=D.useCallback(f=>{n(p=>new Set([...p,f]))},[]),i=D.useCallback(f=>{n(p=>{const m=new Set(p);return m.delete(f),m})},[]),s=D.useCallback(f=>{n(p=>{const m=new Set(p);return m.has(f)?m.delete(f):m.add(f),m})},[]),a=D.useCallback(f=>{n(new Set(f))},[]),u=D.useCallback(()=>{n(f=>f.size===e.length?new Set:new Set(e))},[e]),c=D.useCallback(()=>n(new Set),[]);return{isAllSelected:t.size===e.length,isSomeSelected:t.size>0&&t.size<e.length,isNoneSelected:t.size===0,isSelected:r,selected:[...t],setSelected:a,select:o,unselect:i,toggle:s,toggleAll:u,clear:c}}function xse(e,t){const[n,r]=D.useState(0),o=t??e.length,i=()=>{r(c=>c>=o-1?c:c+1)},s=()=>{r(c=>c<=0?c:c-1)},a=c=>{r(c)},u=c=>{const f=_t.findIndex(e,c);f!==-1&&a(f)};return{currentStepIndex:n,step:e[n],steps:e,isFirstStep:n===0,isLastStep:n===o-1,goTo:a,next:i,back:s,findAndGo:u}}function TN(e=!1){const[t,n]=D.useState(e);return[t,o=>{n(o===void 0?!t:o)}]}const wse=/input|select|textarea|button|object/,_N="a, input, select, textarea, button, object, [tabindex]";function Ese(e){return process.env.NODE_ENV==="test"?!1:e.style.display==="none"}function Cse(e){if(e.getAttribute("aria-hidden")||e.getAttribute("hidden")||e.getAttribute("type")==="hidden")return!1;let n=e;for(;n&&!(n===document.body||n.nodeType===11);){if(Ese(n))return!1;n=n.parentNode}return!0}function ON(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function $b(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(ON(e));return(wse.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&Cse(e)}function $N(e){const t=ON(e);return(Number.isNaN(t)||t>=0)&&$b(e)}function Rse(e){return Array.from(e.querySelectorAll(_N)).filter($N)}function Sse(e,t){const n=Rse(e);if(!n.length){t.preventDefault();return}const r=n[t.shiftKey?0:n.length-1],o=e.getRootNode();let i=r===o.activeElement||e===o.activeElement;const s=o.activeElement;if(s.tagName==="INPUT"&&s.getAttribute("type")==="radio"&&(i=n.filter(f=>f.getAttribute("type")==="radio"&&f.getAttribute("name")===s.getAttribute("name")).includes(r)),!i)return;t.preventDefault();const u=n[t.shiftKey?n.length-1:0];u&&u.focus()}function Pse(e=!0){const t=D.useRef(null),n=o=>{let i=o.querySelector("[data-autofocus]");if(!i){const s=Array.from(o.querySelectorAll(_N));i=s.find($N)||s.find($b)||null,!i&&$b(o)&&(i=o)}i&&i.focus({preventScroll:!0})},r=D.useCallback(o=>{e&&o!==null&&t.current!==o&&(o?(setTimeout(()=>{o.getRootNode()&&n(o)}),t.current=o):t.current=null)},[e]);return D.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>n(t.current));const o=i=>{i.key==="Tab"&&t.current&&Sse(t.current,i)};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[e]),r}function Tse(e){const t=_se(e),n=h.forwardRef((r,o)=>{const{children:i,...s}=r,a=h.Children.toArray(i),u=a.find($se);if(u){const c=u.props.children,f=a.map(p=>p===u?h.Children.count(c)>1?h.Children.only(null):h.isValidElement(c)?c.props.children:null:p);return w.jsx(t,{...s,ref:o,children:h.isValidElement(c)?h.cloneElement(c,void 0,f):null})}return w.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function _se(e){const t=h.forwardRef((n,r)=>{const{children:o,...i}=n;if(h.isValidElement(o)){const s=Mse(o),a=Dse(i,o.props);return o.type!==h.Fragment&&(a.ref=r?Ht(r,s):s),h.cloneElement(o,a)}return h.Children.count(o)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ose=Symbol("radix.slottable");function $se(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ose}function Dse(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const u=i(...a);return o(...a),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Mse(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ase=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Nse=Ase.reduce((e,t)=>{const n=Tse(`Primitive.${t}`),r=h.forwardRef((o,i)=>{const{asChild:s,...a}=o,u=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(u,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function kT(e){const t=Ise(e),n=h.forwardRef((r,o)=>{const{children:i,...s}=r,a=h.Children.toArray(i),u=a.find(Fse);if(u){const c=u.props.children,f=a.map(p=>p===u?h.Children.count(c)>1?h.Children.only(null):h.isValidElement(c)?c.props.children:null:p);return w.jsx(t,{...s,ref:o,children:h.isValidElement(c)?h.cloneElement(c,void 0,f):null})}return w.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function Ise(e){const t=h.forwardRef((n,r)=>{const{children:o,...i}=n;if(h.isValidElement(o)){const s=qse(o),a=Lse(i,o.props);return o.type!==h.Fragment&&(a.ref=r?Ht(r,s):s),h.cloneElement(o,a)}return h.Children.count(o)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var kse=Symbol("radix.slottable");function Fse(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===kse}function Lse(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const u=i(...a);return o(...a),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function qse(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Jx(e){const t=e+"CollectionProvider",[n,r]=Go(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=v=>{const{scope:E,children:x}=v,R=D.useRef(null),P=D.useRef(new Map).current;return w.jsx(o,{scope:E,itemMap:P,collectionRef:R,children:x})};s.displayName=t;const a=e+"CollectionSlot",u=kT(a),c=D.forwardRef((v,E)=>{const{scope:x,children:R}=v,P=i(a,x),O=it(E,P.collectionRef);return w.jsx(u,{ref:O,children:R})});c.displayName=a;const f=e+"CollectionItemSlot",p="data-radix-collection-item",m=kT(f),b=D.forwardRef((v,E)=>{const{scope:x,children:R,...P}=v,O=D.useRef(null),S=it(E,O),T=i(f,x);return D.useEffect(()=>(T.itemMap.set(O,{ref:O,...P}),()=>{T.itemMap.delete(O)})),w.jsx(m,{[p]:"",ref:S,children:R})});b.displayName=f;function y(v){const E=i(e+"CollectionConsumer",v);return D.useCallback(()=>{const R=E.collectionRef.current;if(!R)return[];const P=Array.from(R.querySelectorAll(`[${p}]`));return Array.from(E.itemMap.values()).sort((T,_)=>P.indexOf(T.ref.current)-P.indexOf(_.ref.current))},[E.collectionRef,E.itemMap])}return[{Provider:s,Slot:c,ItemSlot:b},y,r]}var jse=h.createContext(void 0);function ew(e){const t=h.useContext(jse);return e||t||"ltr"}function Bse(e){const t=Vse(e),n=h.forwardRef((r,o)=>{const{children:i,...s}=r,a=h.Children.toArray(i),u=a.find(Hse);if(u){const c=u.props.children,f=a.map(p=>p===u?h.Children.count(c)>1?h.Children.only(null):h.isValidElement(c)?c.props.children:null:p);return w.jsx(t,{...s,ref:o,children:h.isValidElement(c)?h.cloneElement(c,void 0,f):null})}return w.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function Vse(e){const t=h.forwardRef((n,r)=>{const{children:o,...i}=n;if(h.isValidElement(o)){const s=Use(o),a=Wse(i,o.props);return o.type!==h.Fragment&&(a.ref=r?Ht(r,s):s),h.cloneElement(o,a)}return h.Children.count(o)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Kse=Symbol("radix.slottable");function Hse(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Kse}function Wse(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const u=i(...a);return o(...a),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Use(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var zse=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Gse=zse.reduce((e,t)=>{const n=Bse(`Primitive.${t}`),r=h.forwardRef((o,i)=>{const{asChild:s,...a}=o,u=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(u,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Yse="Arrow",DN=h.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return w.jsx(Gse.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:w.jsx("polygon",{points:"0,0 30,0 15,10"})})});DN.displayName=Yse;var Xse=DN;function Zse(e){const t=Qse(e),n=h.forwardRef((r,o)=>{const{children:i,...s}=r,a=h.Children.toArray(i),u=a.find(eae);if(u){const c=u.props.children,f=a.map(p=>p===u?h.Children.count(c)>1?h.Children.only(null):h.isValidElement(c)?c.props.children:null:p);return w.jsx(t,{...s,ref:o,children:h.isValidElement(c)?h.cloneElement(c,void 0,f):null})}return w.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function Qse(e){const t=h.forwardRef((n,r)=>{const{children:o,...i}=n;if(h.isValidElement(o)){const s=nae(o),a=tae(i,o.props);return o.type!==h.Fragment&&(a.ref=r?Ht(r,s):s),h.cloneElement(o,a)}return h.Children.count(o)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Jse=Symbol("radix.slottable");function eae(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Jse}function tae(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const u=i(...a);return o(...a),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function nae(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var rae=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],MN=rae.reduce((e,t)=>{const n=Zse(`Primitive.${t}`),r=h.forwardRef((o,i)=>{const{asChild:s,...a}=o,u=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(u,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function oae(e){const[t,n]=h.useState(void 0);return xn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const u=i.borderBoxSize,c=Array.isArray(u)?u[0]:u;s=c.inlineSize,a=c.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var tw="Popper",[AN,Ca]=Go(tw),[iae,NN]=AN(tw),IN=e=>{const{__scopePopper:t,children:n}=e,[r,o]=h.useState(null);return w.jsx(iae,{scope:t,anchor:r,onAnchorChange:o,children:n})};IN.displayName=tw;var kN="PopperAnchor",FN=h.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=NN(kN,n),s=h.useRef(null),a=it(t,s),u=h.useRef(null);return h.useEffect(()=>{const c=u.current;u.current=r?.current||s.current,c!==u.current&&i.onAnchorChange(u.current)}),r?null:w.jsx(MN.div,{...o,ref:a})});FN.displayName=kN;var nw="PopperContent",[sae,aae]=AN(nw),LN=h.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:u=!0,collisionBoundary:c=[],collisionPadding:f=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:b="optimized",onPlaced:y,...v}=e,E=NN(nw,n),[x,R]=h.useState(null),P=it(t,ee=>R(ee)),[O,S]=h.useState(null),T=oae(O),_=T?.width??0,$=T?.height??0,V=r+(i!=="center"?"-"+i:""),U=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},A=Array.isArray(c)?c:[c],H=A.length>0,F={padding:U,boundary:A.filter(uae),altBoundary:H},{refs:N,floatingStyles:j,placement:I,isPositioned:k,middlewareData:q}=PO({strategy:"fixed",placement:V,whileElementsMounted:(...ee)=>Gv(...ee,{animationFrame:b==="always"}),elements:{reference:E.anchor},middleware:[TO({mainAxis:o+$,alignmentAxis:s}),u&&_O({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?OO():void 0,...F}),u&&$O({...F}),DO({...F,apply:({elements:ee,rects:de,availableWidth:K,availableHeight:ue})=>{const{width:le,height:Z}=de.reference,xe=ee.floating.style;xe.setProperty("--radix-popper-available-width",`${K}px`),xe.setProperty("--radix-popper-available-height",`${ue}px`),xe.setProperty("--radix-popper-anchor-width",`${le}px`),xe.setProperty("--radix-popper-anchor-height",`${Z}px`)}}),O&&S9({element:O,padding:a}),cae({arrowWidth:_,arrowHeight:$}),m&&MO({strategy:"referenceHidden",...F})]}),[z,W]=BN(I),te=_n(y);xn(()=>{k&&te?.()},[k,te]);const X=q.arrow?.x,Q=q.arrow?.y,re=q.arrow?.centerOffset!==0,[ce,se]=h.useState();return xn(()=>{x&&se(window.getComputedStyle(x).zIndex)},[x]),w.jsx("div",{ref:N.setFloating,"data-radix-popper-content-wrapper":"",style:{...j,transform:k?j.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ce,"--radix-popper-transform-origin":[q.transformOrigin?.x,q.transformOrigin?.y].join(" "),...q.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:w.jsx(sae,{scope:n,placedSide:z,onArrowChange:S,arrowX:X,arrowY:Q,shouldHideArrow:re,children:w.jsx(MN.div,{"data-side":z,"data-align":W,...v,ref:P,style:{...v.style,animation:k?void 0:"none"}})})})});LN.displayName=nw;var qN="PopperArrow",lae={top:"bottom",right:"left",bottom:"top",left:"right"},jN=h.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=aae(qN,r),s=lae[i.placedSide];return w.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:w.jsx(Xse,{...o,ref:n,style:{...o.style,display:"block"}})})});jN.displayName=qN;function uae(e){return e!==null}var cae=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,s=o.arrow?.centerOffset!==0,a=s?0:e.arrowWidth,u=s?0:e.arrowHeight,[c,f]=BN(n),p={start:"0%",center:"50%",end:"100%"}[f],m=(o.arrow?.x??0)+a/2,b=(o.arrow?.y??0)+u/2;let y="",v="";return c==="bottom"?(y=s?p:`${m}px`,v=`${-u}px`):c==="top"?(y=s?p:`${m}px`,v=`${r.floating.height+u}px`):c==="right"?(y=`${-u}px`,v=s?p:`${b}px`):c==="left"&&(y=`${r.floating.width+u}px`,v=s?p:`${b}px`),{data:{x:y,y:v}}}});function BN(e){const[t,n="center"]=e.split("-");return[t,n]}var nh=IN,rh=FN,rw=LN,ow=jN;function VN(e){const t=dae(e),n=h.forwardRef((r,o)=>{const{children:i,...s}=r,a=h.Children.toArray(i),u=a.find(pae);if(u){const c=u.props.children,f=a.map(p=>p===u?h.Children.count(c)>1?h.Children.only(null):h.isValidElement(c)?c.props.children:null:p);return w.jsx(t,{...s,ref:o,children:h.isValidElement(c)?h.cloneElement(c,void 0,f):null})}return w.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function dae(e){const t=h.forwardRef((n,r)=>{const{children:o,...i}=n;if(h.isValidElement(o)){const s=hae(o),a=mae(i,o.props);return o.type!==h.Fragment&&(a.ref=r?Ht(r,s):s),h.cloneElement(o,a)}return h.Children.count(o)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var fae=Symbol("radix.slottable");function pae(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===fae}function mae(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const u=i(...a);return o(...a),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function hae(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var gae=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Nd=gae.reduce((e,t)=>{const n=VN(`Primitive.${t}`),r=h.forwardRef((o,i)=>{const{asChild:s,...a}=o,u=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(u,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function vae(e,t){e&&er.flushSync(()=>e.dispatchEvent(t))}function bae(e){const t=yae(e),n=h.forwardRef((r,o)=>{const{children:i,...s}=r,a=h.Children.toArray(i),u=a.find(wae);if(u){const c=u.props.children,f=a.map(p=>p===u?h.Children.count(c)>1?h.Children.only(null):h.isValidElement(c)?c.props.children:null:p);return w.jsx(t,{...s,ref:o,children:h.isValidElement(c)?h.cloneElement(c,void 0,f):null})}return w.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function yae(e){const t=h.forwardRef((n,r)=>{const{children:o,...i}=n;if(h.isValidElement(o)){const s=Cae(o),a=Eae(i,o.props);return o.type!==h.Fragment&&(a.ref=r?Ht(r,s):s),h.cloneElement(o,a)}return h.Children.count(o)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var xae=Symbol("radix.slottable");function wae(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===xae}function Eae(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const u=i(...a);return o(...a),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Cae(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Rae=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],KN=Rae.reduce((e,t)=>{const n=bae(`Primitive.${t}`),r=h.forwardRef((o,i)=>{const{asChild:s,...a}=o,u=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(u,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),_v="rovingFocusGroup.onEntryFocus",Sae={bubbles:!1,cancelable:!0},Id="RovingFocusGroup",[Db,HN,Pae]=Jx(Id),[Tae,WN]=Go(Id,[Pae]),[_ae,Oae]=Tae(Id),UN=h.forwardRef((e,t)=>w.jsx(Db.Provider,{scope:e.__scopeRovingFocusGroup,children:w.jsx(Db.Slot,{scope:e.__scopeRovingFocusGroup,children:w.jsx($ae,{...e,ref:t})})}));UN.displayName=Id;var $ae=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:u,onEntryFocus:c,preventScrollOnEntryFocus:f=!1,...p}=e,m=h.useRef(null),b=it(t,m),y=ew(i),[v,E]=Kt({prop:s,defaultProp:a??null,onChange:u,caller:Id}),[x,R]=h.useState(!1),P=_n(c),O=HN(n),S=h.useRef(!1),[T,_]=h.useState(0);return h.useEffect(()=>{const $=m.current;if($)return $.addEventListener(_v,P),()=>$.removeEventListener(_v,P)},[P]),w.jsx(_ae,{scope:n,orientation:r,dir:y,loop:o,currentTabStopId:v,onItemFocus:h.useCallback($=>E($),[E]),onItemShiftTab:h.useCallback(()=>R(!0),[]),onFocusableItemAdd:h.useCallback(()=>_($=>$+1),[]),onFocusableItemRemove:h.useCallback(()=>_($=>$-1),[]),children:w.jsx(KN.div,{tabIndex:x||T===0?-1:0,"data-orientation":r,...p,ref:b,style:{outline:"none",...e.style},onMouseDown:Ie(e.onMouseDown,()=>{S.current=!0}),onFocus:Ie(e.onFocus,$=>{const V=!S.current;if($.target===$.currentTarget&&V&&!x){const U=new CustomEvent(_v,Sae);if($.currentTarget.dispatchEvent(U),!U.defaultPrevented){const A=O().filter(I=>I.focusable),H=A.find(I=>I.active),F=A.find(I=>I.id===v),j=[H,F,...A].filter(Boolean).map(I=>I.ref.current);YN(j,f)}}S.current=!1}),onBlur:Ie(e.onBlur,()=>R(!1))})})}),zN="RovingFocusGroupItem",GN=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,children:s,...a}=e,u=an(),c=i||u,f=Oae(zN,n),p=f.currentTabStopId===c,m=HN(n),{onFocusableItemAdd:b,onFocusableItemRemove:y,currentTabStopId:v}=f;return h.useEffect(()=>{if(r)return b(),()=>y()},[r,b,y]),w.jsx(Db.ItemSlot,{scope:n,id:c,focusable:r,active:o,children:w.jsx(KN.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...a,ref:t,onMouseDown:Ie(e.onMouseDown,E=>{r?f.onItemFocus(c):E.preventDefault()}),onFocus:Ie(e.onFocus,()=>f.onItemFocus(c)),onKeyDown:Ie(e.onKeyDown,E=>{if(E.key==="Tab"&&E.shiftKey){f.onItemShiftTab();return}if(E.target!==E.currentTarget)return;const x=Aae(E,f.orientation,f.dir);if(x!==void 0){if(E.metaKey||E.ctrlKey||E.altKey||E.shiftKey)return;E.preventDefault();let P=m().filter(O=>O.focusable).map(O=>O.ref.current);if(x==="last")P.reverse();else if(x==="prev"||x==="next"){x==="prev"&&P.reverse();const O=P.indexOf(E.currentTarget);P=f.loop?Nae(P,O+1):P.slice(O+1)}setTimeout(()=>YN(P))}}),children:typeof s=="function"?s({isCurrentTabStop:p,hasTabStop:v!=null}):s})})});GN.displayName=zN;var Dae={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Mae(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Aae(e,t,n){const r=Mae(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Dae[r]}function YN(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Nae(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Iae=UN,kae=GN,Mb=["Enter"," "],Fae=["ArrowDown","PageUp","Home"],XN=["ArrowUp","PageDown","End"],Lae=[...Fae,...XN],qae={ltr:[...Mb,"ArrowRight"],rtl:[...Mb,"ArrowLeft"]},jae={ltr:["ArrowLeft"],rtl:["ArrowRight"]},kd="Menu",[ad,Bae,Vae]=Jx(kd),[Rs,ZN]=Go(kd,[Vae,Ca,WN]),Fd=Ca(),QN=WN(),[JN,$i]=Rs(kd),[Kae,Ld]=Rs(kd),eI=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,a=Fd(t),[u,c]=h.useState(null),f=h.useRef(!1),p=_n(i),m=ew(o);return h.useEffect(()=>{const b=()=>{f.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>f.current=!1;return document.addEventListener("keydown",b,{capture:!0}),()=>{document.removeEventListener("keydown",b,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),w.jsx(nh,{...a,children:w.jsx(JN,{scope:t,open:n,onOpenChange:p,content:u,onContentChange:c,children:w.jsx(Kae,{scope:t,onClose:h.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:f,dir:m,modal:s,children:r})})})};eI.displayName=kd;var Hae="MenuAnchor",iw=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Fd(n);return w.jsx(rh,{...o,...r,ref:t})});iw.displayName=Hae;var sw="MenuPortal",[Wae,tI]=Rs(sw,{forceMount:void 0}),nI=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=$i(sw,t);return w.jsx(Wae,{scope:t,forceMount:n,children:w.jsx(Gr,{present:n||i.open,children:w.jsx(xd,{asChild:!0,container:o,children:r})})})};nI.displayName=sw;var Or="MenuContent",[Uae,aw]=Rs(Or),rI=h.forwardRef((e,t)=>{const n=tI(Or,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=$i(Or,e.__scopeMenu),s=Ld(Or,e.__scopeMenu);return w.jsx(ad.Provider,{scope:e.__scopeMenu,children:w.jsx(Gr,{present:r||i.open,children:w.jsx(ad.Slot,{scope:e.__scopeMenu,children:s.modal?w.jsx(zae,{...o,ref:t}):w.jsx(Gae,{...o,ref:t})})})})}),zae=h.forwardRef((e,t)=>{const n=$i(Or,e.__scopeMenu),r=h.useRef(null),o=it(t,r);return h.useEffect(()=>{const i=r.current;if(i)return Ed(i)},[]),w.jsx(lw,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ie(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Gae=h.forwardRef((e,t)=>{const n=$i(Or,e.__scopeMenu);return w.jsx(lw,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Yae=VN("MenuContent.ScrollLock"),lw=h.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:u,onEscapeKeyDown:c,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:b,disableOutsideScroll:y,...v}=e,E=$i(Or,n),x=Ld(Or,n),R=Fd(n),P=QN(n),O=Bae(n),[S,T]=h.useState(null),_=h.useRef(null),$=it(t,_,E.onContentChange),V=h.useRef(0),U=h.useRef(""),A=h.useRef(0),H=h.useRef(null),F=h.useRef("right"),N=h.useRef(0),j=y?ya:h.Fragment,I=y?{as:Yae,allowPinchZoom:!0}:void 0,k=z=>{const W=U.current+z,te=O().filter(ee=>!ee.disabled),X=document.activeElement,Q=te.find(ee=>ee.ref.current===X)?.textValue,re=te.map(ee=>ee.textValue),ce=ale(re,W,Q),se=te.find(ee=>ee.textValue===ce)?.ref.current;(function ee(de){U.current=de,window.clearTimeout(V.current),de!==""&&(V.current=window.setTimeout(()=>ee(""),1e3))})(W),se&&setTimeout(()=>se.focus())};h.useEffect(()=>()=>window.clearTimeout(V.current),[]),Fm();const q=h.useCallback(z=>F.current===H.current?.side&&ule(z,H.current?.area),[]);return w.jsx(Uae,{scope:n,searchRef:U,onItemEnter:h.useCallback(z=>{q(z)&&z.preventDefault()},[q]),onItemLeave:h.useCallback(z=>{q(z)||(_.current?.focus(),T(null))},[q]),onTriggerLeave:h.useCallback(z=>{q(z)&&z.preventDefault()},[q]),pointerGraceTimerRef:A,onPointerGraceIntentChange:h.useCallback(z=>{H.current=z},[]),children:w.jsx(j,{...I,children:w.jsx(yd,{asChild:!0,trapped:o,onMountAutoFocus:Ie(i,z=>{z.preventDefault(),_.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:w.jsx(bd,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:b,children:w.jsx(Iae,{asChild:!0,...P,dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:S,onCurrentTabStopIdChange:T,onEntryFocus:Ie(u,z=>{x.isUsingKeyboardRef.current||z.preventDefault()}),preventScrollOnEntryFocus:!0,children:w.jsx(rw,{role:"menu","aria-orientation":"vertical","data-state":xI(E.open),"data-radix-menu-content":"",dir:x.dir,...R,...v,ref:$,style:{outline:"none",...v.style},onKeyDown:Ie(v.onKeyDown,z=>{const te=z.target.closest("[data-radix-menu-content]")===z.currentTarget,X=z.ctrlKey||z.altKey||z.metaKey,Q=z.key.length===1;te&&(z.key==="Tab"&&z.preventDefault(),!X&&Q&&k(z.key));const re=_.current;if(z.target!==re||!Lae.includes(z.key))return;z.preventDefault();const se=O().filter(ee=>!ee.disabled).map(ee=>ee.ref.current);XN.includes(z.key)&&se.reverse(),ile(se)}),onBlur:Ie(e.onBlur,z=>{z.currentTarget.contains(z.target)||(window.clearTimeout(V.current),U.current="")}),onPointerMove:Ie(e.onPointerMove,ld(z=>{const W=z.target,te=N.current!==z.clientX;if(z.currentTarget.contains(W)&&te){const X=z.clientX>N.current?"right":"left";F.current=X,N.current=z.clientX}}))})})})})})})});rI.displayName=Or;var Xae="MenuGroup",uw=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return w.jsx(Nd.div,{role:"group",...r,ref:t})});uw.displayName=Xae;var Zae="MenuLabel",oI=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return w.jsx(Nd.div,{...r,ref:t})});oI.displayName=Zae;var lm="MenuItem",FT="menu.itemSelect",oh=h.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=h.useRef(null),s=Ld(lm,e.__scopeMenu),a=aw(lm,e.__scopeMenu),u=it(t,i),c=h.useRef(!1),f=()=>{const p=i.current;if(!n&&p){const m=new CustomEvent(FT,{bubbles:!0,cancelable:!0});p.addEventListener(FT,b=>r?.(b),{once:!0}),vae(p,m),m.defaultPrevented?c.current=!1:s.onClose()}};return w.jsx(iI,{...o,ref:u,disabled:n,onClick:Ie(e.onClick,f),onPointerDown:p=>{e.onPointerDown?.(p),c.current=!0},onPointerUp:Ie(e.onPointerUp,p=>{c.current||p.currentTarget?.click()}),onKeyDown:Ie(e.onKeyDown,p=>{const m=a.searchRef.current!=="";n||m&&p.key===" "||Mb.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});oh.displayName=lm;var iI=h.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=aw(lm,n),a=QN(n),u=h.useRef(null),c=it(t,u),[f,p]=h.useState(!1),[m,b]=h.useState("");return h.useEffect(()=>{const y=u.current;y&&b((y.textContent??"").trim())},[i.children]),w.jsx(ad.ItemSlot,{scope:n,disabled:r,textValue:o??m,children:w.jsx(kae,{asChild:!0,...a,focusable:!r,children:w.jsx(Nd.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:c,onPointerMove:Ie(e.onPointerMove,ld(y=>{r?s.onItemLeave(y):(s.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ie(e.onPointerLeave,ld(y=>s.onItemLeave(y))),onFocus:Ie(e.onFocus,()=>p(!0)),onBlur:Ie(e.onBlur,()=>p(!1))})})})}),Qae="MenuCheckboxItem",sI=h.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return w.jsx(dI,{scope:e.__scopeMenu,checked:n,children:w.jsx(oh,{role:"menuitemcheckbox","aria-checked":um(n)?"mixed":n,...o,ref:t,"data-state":fw(n),onSelect:Ie(o.onSelect,()=>r?.(um(n)?!0:!n),{checkForDefaultPrevented:!1})})})});sI.displayName=Qae;var aI="MenuRadioGroup",[Jae,ele]=Rs(aI,{value:void 0,onValueChange:()=>{}}),lI=h.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=_n(r);return w.jsx(Jae,{scope:e.__scopeMenu,value:n,onValueChange:i,children:w.jsx(uw,{...o,ref:t})})});lI.displayName=aI;var uI="MenuRadioItem",cI=h.forwardRef((e,t)=>{const{value:n,...r}=e,o=ele(uI,e.__scopeMenu),i=n===o.value;return w.jsx(dI,{scope:e.__scopeMenu,checked:i,children:w.jsx(oh,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":fw(i),onSelect:Ie(r.onSelect,()=>o.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});cI.displayName=uI;var cw="MenuItemIndicator",[dI,tle]=Rs(cw,{checked:!1}),fI=h.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=tle(cw,n);return w.jsx(Gr,{present:r||um(i.checked)||i.checked===!0,children:w.jsx(Nd.span,{...o,ref:t,"data-state":fw(i.checked)})})});fI.displayName=cw;var nle="MenuSeparator",pI=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return w.jsx(Nd.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});pI.displayName=nle;var rle="MenuArrow",mI=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Fd(n);return w.jsx(ow,{...o,...r,ref:t})});mI.displayName=rle;var dw="MenuSub",[ole,hI]=Rs(dw),gI=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:o}=e,i=$i(dw,t),s=Fd(t),[a,u]=h.useState(null),[c,f]=h.useState(null),p=_n(o);return h.useEffect(()=>(i.open===!1&&p(!1),()=>p(!1)),[i.open,p]),w.jsx(nh,{...s,children:w.jsx(JN,{scope:t,open:r,onOpenChange:p,content:c,onContentChange:f,children:w.jsx(ole,{scope:t,contentId:an(),triggerId:an(),trigger:a,onTriggerChange:u,children:n})})})};gI.displayName=dw;var Vc="MenuSubTrigger",vI=h.forwardRef((e,t)=>{const n=$i(Vc,e.__scopeMenu),r=Ld(Vc,e.__scopeMenu),o=hI(Vc,e.__scopeMenu),i=aw(Vc,e.__scopeMenu),s=h.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:u}=i,c={__scopeMenu:e.__scopeMenu},f=h.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return h.useEffect(()=>f,[f]),h.useEffect(()=>{const p=a.current;return()=>{window.clearTimeout(p),u(null)}},[a,u]),w.jsx(iw,{asChild:!0,...c,children:w.jsx(iI,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":xI(n.open),...e,ref:Ht(t,o.onTriggerChange),onClick:p=>{e.onClick?.(p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ie(e.onPointerMove,ld(p=>{i.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:Ie(e.onPointerLeave,ld(p=>{f();const m=n.content?.getBoundingClientRect();if(m){const b=n.content?.dataset.side,y=b==="right",v=y?-5:5,E=m[y?"left":"right"],x=m[y?"right":"left"];i.onPointerGraceIntentChange({area:[{x:p.clientX+v,y:p.clientY},{x:E,y:m.top},{x,y:m.top},{x,y:m.bottom},{x:E,y:m.bottom}],side:b}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(p),p.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:Ie(e.onKeyDown,p=>{const m=i.searchRef.current!=="";e.disabled||m&&p.key===" "||qae[r.dir].includes(p.key)&&(n.onOpenChange(!0),n.content?.focus(),p.preventDefault())})})})});vI.displayName=Vc;var bI="MenuSubContent",yI=h.forwardRef((e,t)=>{const n=tI(Or,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=$i(Or,e.__scopeMenu),s=Ld(Or,e.__scopeMenu),a=hI(bI,e.__scopeMenu),u=h.useRef(null),c=it(t,u);return w.jsx(ad.Provider,{scope:e.__scopeMenu,children:w.jsx(Gr,{present:r||i.open,children:w.jsx(ad.Slot,{scope:e.__scopeMenu,children:w.jsx(lw,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:c,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{s.isUsingKeyboardRef.current&&u.current?.focus(),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:Ie(e.onFocusOutside,f=>{f.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Ie(e.onEscapeKeyDown,f=>{s.onClose(),f.preventDefault()}),onKeyDown:Ie(e.onKeyDown,f=>{const p=f.currentTarget.contains(f.target),m=jae[s.dir].includes(f.key);p&&m&&(i.onOpenChange(!1),a.trigger?.focus(),f.preventDefault())})})})})})});yI.displayName=bI;function xI(e){return e?"open":"closed"}function um(e){return e==="indeterminate"}function fw(e){return um(e)?"indeterminate":e?"checked":"unchecked"}function ile(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function sle(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function ale(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=sle(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const u=s.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function lle(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i],u=t[s],c=a.x,f=a.y,p=u.x,m=u.y;f>r!=m>r&&n<(p-c)*(r-f)/(m-f)+c&&(o=!o)}return o}function ule(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return lle(n,t)}function ld(e){return t=>t.pointerType==="mouse"?e(t):void 0}var cle=eI,dle=iw,fle=nI,ple=rI,mle=uw,hle=oI,gle=oh,vle=sI,ble=lI,yle=cI,xle=fI,wle=pI,Ele=mI,Cle=gI,Rle=vI,Sle=yI,ih="DropdownMenu",[Ple]=Go(ih,[ZN]),Fn=ZN(),[Tle,wI]=Ple(ih),EI=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,u=Fn(t),c=h.useRef(null),[f,p]=Kt({prop:o,defaultProp:i??!1,onChange:s,caller:ih});return w.jsx(Tle,{scope:t,triggerId:an(),triggerRef:c,contentId:an(),open:f,onOpenChange:p,onOpenToggle:h.useCallback(()=>p(m=>!m),[p]),modal:a,children:w.jsx(cle,{...u,open:f,onOpenChange:p,dir:r,modal:a,children:n})})};EI.displayName=ih;var CI="DropdownMenuTrigger",RI=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=wI(CI,n),s=Fn(n);return w.jsx(dle,{asChild:!0,...s,children:w.jsx(Nse.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":r?"":void 0,disabled:r,...o,ref:Ht(t,i.triggerRef),onPointerDown:Ie(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:Ie(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});RI.displayName=CI;var _le="DropdownMenuPortal",SI=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Fn(t);return w.jsx(fle,{...r,...n})};SI.displayName=_le;var PI="DropdownMenuContent",TI=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=wI(PI,n),i=Fn(n),s=h.useRef(!1);return w.jsx(ple,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...r,ref:t,onCloseAutoFocus:Ie(e.onCloseAutoFocus,a=>{s.current||o.triggerRef.current?.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:Ie(e.onInteractOutside,a=>{const u=a.detail.originalEvent,c=u.button===0&&u.ctrlKey===!0,f=u.button===2||c;(!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)"}})});TI.displayName=PI;var Ole="DropdownMenuGroup",_I=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Fn(n);return w.jsx(mle,{...o,...r,ref:t})});_I.displayName=Ole;var $le="DropdownMenuLabel",OI=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Fn(n);return w.jsx(hle,{...o,...r,ref:t})});OI.displayName=$le;var Dle="DropdownMenuItem",$I=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Fn(n);return w.jsx(gle,{...o,...r,ref:t})});$I.displayName=Dle;var Mle="DropdownMenuCheckboxItem",DI=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Fn(n);return w.jsx(vle,{...o,...r,ref:t})});DI.displayName=Mle;var Ale="DropdownMenuRadioGroup",MI=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Fn(n);return w.jsx(ble,{...o,...r,ref:t})});MI.displayName=Ale;var Nle="DropdownMenuRadioItem",AI=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Fn(n);return w.jsx(yle,{...o,...r,ref:t})});AI.displayName=Nle;var Ile="DropdownMenuItemIndicator",NI=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Fn(n);return w.jsx(xle,{...o,...r,ref:t})});NI.displayName=Ile;var kle="DropdownMenuSeparator",II=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Fn(n);return w.jsx(wle,{...o,...r,ref:t})});II.displayName=kle;var Fle="DropdownMenuArrow",Lle=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Fn(n);return w.jsx(Ele,{...o,...r,ref:t})});Lle.displayName=Fle;var qle=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:o,defaultOpen:i}=e,s=Fn(t),[a,u]=Kt({prop:r,defaultProp:i??!1,onChange:o,caller:"DropdownMenuSub"});return w.jsx(Cle,{...s,open:a,onOpenChange:u,children:n})},jle="DropdownMenuSubTrigger",kI=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Fn(n);return w.jsx(Rle,{...o,...r,ref:t})});kI.displayName=jle;var Ble="DropdownMenuSubContent",FI=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Fn(n);return w.jsx(Sle,{...o,...r,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)"}})});FI.displayName=Ble;var Vle=EI,Kle=RI,LI=SI,Hle=TI,Wle=_I,Ule=OI,zle=$I,Gle=DI,Yle=MI,Xle=AI,qI=NI,Zle=II,Qle=qle,Jle=kI,eue=FI;const jI=e=>w.jsx(Vle,{"data-slot":"menu",...e}),BI=e=>w.jsx(Kle,{"data-slot":"menu-trigger",...e}),tue=e=>w.jsx(Wle,{"data-slot":"menu-group",...e}),nue=e=>w.jsx(LI,{"data-slot":"menu-portal",...e}),VI=e=>w.jsx(Qle,{"data-slot":"menu-sub",...e}),rue=e=>w.jsx(Yle,{"data-slot":"menu-radio-group",...e}),KI=({className:e,inset:t,children:n,...r})=>w.jsxs(Jle,{"data-slot":"menu-sub-trigger",className:me("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),...r,children:[n,w.jsx(gd,{className:"ml-auto h-4 w-4"})]}),HI=({className:e,...t})=>w.jsx(eue,{"data-slot":"menu-sub-content",className:me("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}),WI=({className:e,sideOffset:t=4,...n})=>w.jsx(LI,{"data-slot":"menu-portal",children:w.jsx(Hle,{"data-slot":"menu-content",sideOffset:t,className:me("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),...n})}),UI=({className:e,inset:t,...n})=>w.jsx(zle,{"data-slot":"menu-item",className:me("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),...n}),zI=({className:e,children:t,checked:n,...r})=>w.jsxs(Gle,{"data-slot":"menu-checkbox-item",className:me("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:n,...r,children:[w.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:w.jsx(qI,{children:w.jsx(tb,{className:"h-4 w-4"})})}),t]}),GI=({className:e,children:t,...n})=>w.jsxs(Xle,{"data-slot":"menu-radio-item",className:me("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),...n,children:[w.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:w.jsx(qI,{children:w.jsx(mH,{className:"h-2 w-2 fill-current"})})}),t]}),YI=({className:e,inset:t,...n})=>w.jsx(Ule,{"data-slot":"menu-label",className:me("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}),XI=({className:e,...t})=>w.jsx(Zle,{"data-slot":"menu-separator",className:me("-mx-1 my-1 h-px bg-muted",e),...t}),ZI=({className:e,keys:t,handler:n,options:r={},...o})=>(SN(t,n,r),w.jsx("span",{"data-slot":"menu-shortcut",className:me("ml-auto text-xs tracking-widest opacity-60",e),...o})),QI=(e,t)=>{switch(e.type){case"item":return w.jsxs(UI,{...e,children:[e.label," ",t]});case"checkbox":return w.jsxs(zI,{...e,children:[e.label," ",t]});case"radio":return w.jsxs(GI,{...e,children:[e.label," ",t]});case"label":return w.jsxs(YI,{...e,children:[e.label," "]});case"separator":return w.jsx(XI,{...e});case"submenu":return w.jsxs(VI,{children:[w.jsx(KI,{...e,children:e.label}),w.jsx(HI,{children:e.items?.map((n,r)=>w.jsx(D.Fragment,{children:QI(n)},r))})]});default:return null}},oue=({trigger:e,items:t,contentProps:n,side:r="bottom",offset:o})=>w.jsxs(jI,{children:[w.jsx(BI,{asChild:!0,children:e}),w.jsx(WI,{side:r,sideOffset:o,...n,children:t.map(({shortcut:i,onShortcut:s,shortcutOptions:a,...u},c)=>w.jsx(D.Fragment,{children:QI(u,i&&w.jsx(ZI,{keys:i,handler:f=>s?.(f),options:a,children:i}))},c))})]}),JI=Oi("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"}}),Ab=({className:e,color:t,variant:n,rounded:r,icon:o,closable:i,onClose:s,children:a,...u})=>{const c=!!t&&(n==="outline"||n==="borderless"),f=!!t&&!n;return w.jsxs("div",{"data-slot":"tag",className:me(JI({variant:n,rounded:r}),c&&"bg-white",f&&" text-white",!!o&&"pl-1.5",!!i&&"pr-1.5",e),style:{...c&&{color:t,borderColor:t},...f&&{borderColor:t,backgroundColor:t}},...u,children:[o,a,i&&w.jsx("button",{type:"button","data-slot":"tag-close",className:"z-10 h-4 w-4 cursor-pointer",onClick:p=>{p.stopPropagation(),s()},children:w.jsx(vd,{"data-slot":"tag-close-icon"})}),w.jsx("span",{"data-slot":"tag-overlay",className:"w-full h-full absolute top-0 left-0",style:{...c&&{opacity:.13,backgroundColor:t}}})]})};function ek(e){const t=iue(e),n=h.forwardRef((r,o)=>{const{children:i,...s}=r,a=h.Children.toArray(i),u=a.find(aue);if(u){const c=u.props.children,f=a.map(p=>p===u?h.Children.count(c)>1?h.Children.only(null):h.isValidElement(c)?c.props.children:null:p);return w.jsx(t,{...s,ref:o,children:h.isValidElement(c)?h.cloneElement(c,void 0,f):null})}return w.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function iue(e){const t=h.forwardRef((n,r)=>{const{children:o,...i}=n;if(h.isValidElement(o)){const s=uue(o),a=lue(i,o.props);return o.type!==h.Fragment&&(a.ref=r?Ht(r,s):s),h.cloneElement(o,a)}return h.Children.count(o)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var sue=Symbol("radix.slottable");function aue(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===sue}function lue(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const u=i(...a);return o(...a),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function uue(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var cue=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],tk=cue.reduce((e,t)=>{const n=ek(`Primitive.${t}`),r=h.forwardRef((o,i)=>{const{asChild:s,...a}=o,u=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(u,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),sh="Popover",[nk]=Go(sh,[Ca]),qd=Ca(),[due,Di]=nk(sh),rk=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,a=qd(t),u=h.useRef(null),[c,f]=h.useState(!1),[p,m]=Kt({prop:r,defaultProp:o??!1,onChange:i,caller:sh});return w.jsx(nh,{...a,children:w.jsx(due,{scope:t,contentId:an(),triggerRef:u,open:p,onOpenChange:m,onOpenToggle:h.useCallback(()=>m(b=>!b),[m]),hasCustomAnchor:c,onCustomAnchorAdd:h.useCallback(()=>f(!0),[]),onCustomAnchorRemove:h.useCallback(()=>f(!1),[]),modal:s,children:n})})};rk.displayName=sh;var ok="PopoverAnchor",fue=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Di(ok,n),i=qd(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:a}=o;return h.useEffect(()=>(s(),()=>a()),[s,a]),w.jsx(rh,{...i,...r,ref:t})});fue.displayName=ok;var ik="PopoverTrigger",sk=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Di(ik,n),i=qd(n),s=it(t,o.triggerRef),a=w.jsx(tk.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":dk(o.open),...r,ref:s,onClick:Ie(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:w.jsx(rh,{asChild:!0,...i,children:a})});sk.displayName=ik;var pw="PopoverPortal",[pue,mue]=nk(pw,{forceMount:void 0}),ak=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=Di(pw,t);return w.jsx(pue,{scope:t,forceMount:n,children:w.jsx(Gr,{present:n||i.open,children:w.jsx(xd,{asChild:!0,container:o,children:r})})})};ak.displayName=pw;var da="PopoverContent",lk=h.forwardRef((e,t)=>{const n=mue(da,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=Di(da,e.__scopePopover);return w.jsx(Gr,{present:r||i.open,children:i.modal?w.jsx(gue,{...o,ref:t}):w.jsx(vue,{...o,ref:t})})});lk.displayName=da;var hue=ek("PopoverContent.RemoveScroll"),gue=h.forwardRef((e,t)=>{const n=Di(da,e.__scopePopover),r=h.useRef(null),o=it(t,r),i=h.useRef(!1);return h.useEffect(()=>{const s=r.current;if(s)return Ed(s)},[]),w.jsx(ya,{as:hue,allowPinchZoom:!0,children:w.jsx(uk,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ie(e.onCloseAutoFocus,s=>{s.preventDefault(),i.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Ie(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,u=a.button===0&&a.ctrlKey===!0,c=a.button===2||u;i.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Ie(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),vue=h.forwardRef((e,t)=>{const n=Di(da,e.__scopePopover),r=h.useRef(!1),o=h.useRef(!1);return w.jsx(uk,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(r.current||n.triggerRef.current?.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;n.triggerRef.current?.contains(s)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),uk=h.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:u,onFocusOutside:c,onInteractOutside:f,...p}=e,m=Di(da,n),b=qd(n);return Fm(),w.jsx(yd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:w.jsx(bd,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:f,onEscapeKeyDown:a,onPointerDownOutside:u,onFocusOutside:c,onDismiss:()=>m.onOpenChange(!1),children:w.jsx(rw,{"data-state":dk(m.open),role:"dialog",id:m.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)"}})})})}),ck="PopoverClose",bue=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Di(ck,n);return w.jsx(tk.button,{type:"button",...r,ref:t,onClick:Ie(e.onClick,()=>o.onOpenChange(!1))})});bue.displayName=ck;var yue="PopoverArrow",xue=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=qd(n);return w.jsx(ow,{...o,...r,ref:t})});xue.displayName=yue;function dk(e){return e?"open":"closed"}var wue=rk,Eue=sk,Cue=ak,Rue=lk;const jd=e=>w.jsx(wue,{"data-slot":"popover",...e}),Bd=e=>w.jsx(Eue,{"data-slot":"popover-trigger",...e}),Vd=({className:e,align:t="center",sideOffset:n=4,matchTriggerWidth:r=!1,style:o,focus:i=!0,...s})=>w.jsx(Cue,{children:w.jsx(Rue,{"data-slot":"popover-content",align:t,sideOffset:n,onOpenAutoFocus:a=>{!i&&a.preventDefault(),s?.onOpenAutoFocus?.(a)},className:me("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,...r&&{width:"var(--radix-popper-anchor-width)"}},...s})}),Sue=e=>{const{trigger:t,children:n,rootProps:r,triggerProps:o,contentProps:i,triggerAsChild:s=!0,matchTriggerWidth:a,triggerClassName:u,contentClassName:c,side:f="bottom",offset:p}=Im("Popover",e,{triggerAsChild:!0,side:"bottom"});return w.jsxs(jd,{...r,children:[w.jsx(Bd,{asChild:s,className:u,...o,children:t}),w.jsx(Vd,{className:c,matchTriggerWidth:a,side:f,sideOffset:p,...i,children:n})]})},LT=Oi("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"}}),Pue=({valueKey:e,values:t,setValues:n,items:r,maxCount:o,setIsPopoverOpen:i})=>{const s=m=>{if(m.key==="Enter")i(!0);else if(m.key==="Backspace"&&!m.currentTarget.value){const b=[...t];b.pop(),n?.(b)}},a=m=>{const b=t.includes(m)?t.filter(y=>y!==m):[...t,m];n?.(b)},u=()=>{n?.([])};return{handleInputKeyDown:s,toggleOption:a,handleClear:u,handleTogglePopover:()=>{i(m=>!m)},clearExtraOptions:()=>{const m=t.slice(0,o);n?.(m)},toggleAll:()=>{const m=r.filter(b=>!b.disabled);if(t.length===m.length)u();else{const b=m.map(y=>y[e]);n?.(b)}}}},Tue=({items:e=[],value:t,valueKey:n="value",labelKey:r="label",onChange:o,variant:i,defaultValue:s=[],placeholder:a="Seleccionar",maxCount:u=3,className:c,renderOption:f=E=>E[r],withCheckbox:p=!1,showSearch:m=!0,showSelectAll:b=!0,rootProps:y,...v})=>{const[E=[],x]=Kt({prop:t,onChange:o,defaultProp:s}),[R,P]=Kt({prop:v.open,onChange:v.onOpenChange,defaultProp:v.defaultOpen||!1}),O=h.useMemo(()=>e.filter(A=>!A.disabled),[e]),{handleInputKeyDown:S,toggleOption:T,handleClear:_,handleTogglePopover:$,clearExtraOptions:V,toggleAll:U}=Pue({valueKey:n,values:E,setValues:x,items:e,maxCount:u,setIsPopoverOpen:P});return w.jsxs(jd,{open:R,onOpenChange:P,"data-slot":"multi-select",...y,children:[w.jsx(Bd,{asChild:!0,"data-slot":"multi-select-trigger",children:w.jsx(Tn,{...v,onClick:$,className:me("flex w-full p-1 rounded-md border border-input min-h-10 h-auto items-center justify-between bg-inherit hover:bg-inherit",c),children:E.length>0?w.jsxs("div",{className:"flex justify-between items-center w-full",children:[w.jsxs("div",{className:"flex flex-wrap items-center","data-slot":"multi-select-tags",children:[E.slice(0,u).map(A=>{const H=e.find(N=>N[n]===A),F=H?.icon;return w.jsxs(Ab,{"data-slot":"multi-select-tag",className:me(LT({variant:i})),closable:!0,onClose:()=>T(A),children:[F&&w.jsx(F,{className:"h-4 w-4 mr-2"}),H&&f?.(H)]},A)}),E.length>u&&w.jsx(Ab,{"data-slot":"multi-select-tag",className:me(LT({variant:i})),closable:!0,onClose:V,children:`+ ${E.length-u} más`})]}),w.jsxs("div",{className:"flex items-center justify-between",children:[w.jsx(vd,{"data-slot":"multi-select-clear",className:"h-4 mx-2 cursor-pointer text-muted-foreground",onClick:A=>{A.stopPropagation(),_()}}),w.jsx(FA,{"data-slot":"multi-select-divider",orientation:"vertical",className:"flex min-h-6 h-full"}),w.jsx(Gp,{"data-slot":"multi-select-trigger-icon",className:"h-4 mx-2 cursor-pointer text-muted-foreground"})]})]}):w.jsxs("div",{className:"flex items-center justify-between w-full mx-auto","data-slot":"multi-select-trigger-empty",children:[w.jsx("span",{className:"text-sm text-foreground font-normal mx-2","data-slot":"multi-select-placeholder",children:a}),w.jsx(Gp,{"data-slot":"multi-select-trigger-icon",className:"h-4 cursor-pointer text-muted-foreground mx-2"})]})})}),w.jsx(Vd,{"data-slot":"multi-select-content",className:"p-0",matchTriggerWidth:!0,align:"start",asChild:!0,onEscapeKeyDown:()=>P(!1),children:w.jsxs(Rd,{children:[m&&w.jsx(Vm,{"data-slot":"multi-select-input",placeholder:"Buscar...",onKeyDown:S}),w.jsxs(Km,{"data-slot":"multi-select-list",children:[w.jsx(Hm,{"data-slot":"multi-select-empty",children:"No results found."}),w.jsxs(sM,{"data-slot":"multi-select-group",children:[b&&w.jsxs(nd,{"data-slot":"multi-select-item",onSelect:U,className:me("cursor-pointer",!p&&E.length===O.length&&"bg-accent text-accent-foreground"),children:[p&&w.jsx("div",{className:me("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",E.length===O.length?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:w.jsx(tb,{className:"h-4 w-4"})}),w.jsx("span",{children:"(Seleccionar todo)"})]},"all"),e.map(A=>{const H=E.includes(A[n]);return w.jsxs(nd,{"data-slot":"multi-select-item",onSelect:()=>!A.disabled&&T(A[n]),className:me(A.disabled?"!bg-neutral-50 !text-neutral-400":"cursor-pointer",!p&&H&&"!bg-accent !text-accent-foreground"),children:[p&&w.jsx("div",{className:me("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",H?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:w.jsx(tb,{className:"h-4 w-4"})}),A.icon&&w.jsx(A.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),w.jsx("span",{children:f?.(A)})]},A[n])})]})]})]})})]})},_ue=({value:e,onChange:t,defaultValue:n,className:r,min:o,max:i,...s})=>{const[a,u]=Kt({prop:e,onChange:t,defaultProp:n}),c=a??o??0,f=y=>{const v=parseInt(y.target.value,10);u(v)},p=()=>{if(_t.isUndefined(a)&&_t.isNumber(o))return u(o??0);const y=c+1;(_t.isUndefined(i)||y<=i)&&u(y)},m=()=>{if(_t.isUndefined(a)&&_t.isNumber(i))return u(i??0);const y=c-1;(_t.isUndefined(o)||y>=o)&&u(y)},b=()=>{const y=_t.isNumber(o)&&c<o,v=_t.isNumber(i)&&c>i;y?u(o):v&&u(i)};return w.jsxs("div",{className:"relative w-full","data-slot":"number-input-container",children:[w.jsx("input",{...s,type:"number",value:a,onChange:f,onBlur:b,min:o,max:i,className:me("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",r),"data-slot":"number-input"}),w.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:[w.jsx(Tn,{variant:"ghost",size:"icon",onClick:p,className:"h-4 w-4 grow rounded-sm","data-testid":"increment-trigger","data-slot":"number-input-increment",children:w.jsx($$,{"data-slot":"number-input-increment-icon"})}),w.jsx(Tn,{variant:"ghost",size:"icon",onClick:m,className:"h-4 w-4 grow rounded-sm","data-testid":"decrement-trigger","data-slot":"number-input-decrement",children:w.jsx(O$,{"data-slot":"number-input-decrement-icon"})})]})]})},Us=({isActive:e=!1,...t})=>w.jsx("button",{...t,"data-slot":"pagination-option","data-active":e,"data-dots":t.children===wi,className:me("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)}),Oue=({optionProps:e,className:t,containerProps:n,...r})=>{const{paginationRange:o,currentPage:i,goTo:s,maxPage:a,next:u,prev:c,isLastPage:f,isFirstPage:p}=PN(r);return w.jsxs("div",{...n,className:me("flex items-end select-none h-10",n?.className,t),"data-slot":"pagination",children:[w.jsxs(Us,{...e,disabled:p,onClick:()=>s(1),className:me("rounded-l-md",e?.className),children:[w.jsx(iH,{"data-slot":"pagination-option-icon"}),w.jsx("span",{className:"sr-only",children:"Ir a primera página"})]}),w.jsxs(Us,{...e,onClick:c,disabled:p,children:[w.jsx(ky,{"data-slot":"pagination-option-icon"}),w.jsx("span",{className:"sr-only",children:"Ir a página anterior"})]}),o.map(m=>w.jsx(w.Fragment,{children:m===wi?w.jsx(Us,{className:me("pointer-events-none",e?.className),children:wi},m):D.createElement(Us,{...e,isActive:m===i,onClick:()=>s(m),key:m},m,w.jsxs("span",{className:"sr-only",children:["Ir a la página ",m]}))})),w.jsxs(Us,{...e,onClick:u,disabled:f,children:[w.jsx(gd,{"data-slot":"pagination-option-icon"}),w.jsx("span",{className:"sr-only",children:"Ir a próxima página"})]}),w.jsxs(Us,{...e,disabled:f,onClick:()=>s(a),className:me("rounded-r-md",e?.className),children:[w.jsx(aH,{"data-slot":"pagination-option-icon"}),w.jsx("span",{className:"sr-only",children:"Ir a última página"})]})]})},$ue=({className:e,containerClassName:t,showIcon:n=w.jsx(xH,{className:"h-4 w-4"}),hideIcon:r=w.jsx(bH,{className:"h-4 w-4"}),onShow:o,onHide:i,toggleable:s=!0,...a})=>{const[u,c]=TN(!1),f=()=>{c(),u?i?.():o?.()};return w.jsxs("div",{className:me("relative",t),"data-slot":"password",children:[w.jsx(CN,{...a,type:u?"text":"password",className:me("pr-10","[&::-ms-reveal]:hidden [&::-ms-clear]:hidden",e)}),w.jsx("button",{"data-slot":"password-toggle",type:"button",onClick:f,disabled:!s,className:me("absolute right-3 top-1/2 -translate-y-1/2 text-gray-500",s?"hover:text-gray-700":"opacity-50 cursor-not-allowed"),children:u?r:n})]})},qT=new Map;function Due(e,t){const n=JSON.stringify({locale:e,options:t}),r=qT.get(n);if(r)return r;const o=new Intl.NumberFormat(e,t);return qT.set(n,o),o}function jT(e,t,n){return e==null?"":Due(t,n).format(e)}function Mue(e,t,n){return e==null?"":n?jT(e,t,n):jT(e/100,t,{style:"percent"})}const mw=h.createContext(void 0);process.env.NODE_ENV!=="production"&&(mw.displayName="ProgressRootContext");function ah(){const e=h.useContext(mw);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ProgressRootContext is missing. Progress parts must be placed within <Progress.Root>.":zt(51));return e}let Ov=(function(e){return e.complete="data-complete",e.indeterminate="data-indeterminate",e.progressing="data-progressing",e})({});const Kd={status(e){return e==="progressing"?{[Ov.progressing]:""}:e==="complete"?{[Ov.complete]:""}:e==="indeterminate"?{[Ov.indeterminate]:""}:null}};function Aue(e,t){return t==null?"indeterminate progress":e||`${t}%`}const fk=h.forwardRef(function(t,n){const{format:r,getAriaValueText:o=Aue,locale:i,max:s=100,min:a=0,value:u,render:c,className:f,children:p,style:m,...b}=t,[y,v]=h.useState(),E=cr(r);let x="indeterminate";Number.isFinite(u)&&(x=u===s?"complete":"progressing");const R=Mue(u,i,E.current),P=h.useMemo(()=>({status:x}),[x]),O={"aria-labelledby":y,"aria-valuemax":s,"aria-valuemin":a,"aria-valuenow":u??void 0,"aria-valuetext":o(R,u),role:"progressbar",children:w.jsxs(h.Fragment,{children:[p,w.jsx("span",{role:"presentation",style:pd,children:"x"})]})},S=h.useMemo(()=>({formattedValue:R,max:s,min:a,setLabelId:v,state:P,status:x,value:u}),[R,s,a,v,P,x,u]),T=lt("div",t,{state:P,ref:n,props:[O,b],stateAttributesMapping:Kd});return w.jsx(mw.Provider,{value:S,children:T})});process.env.NODE_ENV!=="production"&&(fk.displayName="ProgressRoot");const pk=h.forwardRef(function(t,n){const{render:r,className:o,style:i,...s}=t,{state:a}=ah();return lt("div",t,{state:a,ref:n,props:s,stateAttributesMapping:Kd})});process.env.NODE_ENV!=="production"&&(pk.displayName="ProgressTrack");function Nue(e,t,n){return(e-t)*100/(n-t)}const mk=h.forwardRef(function(t,n){const{render:r,className:o,style:i,...s}=t,{max:a,min:u,value:c,state:f}=ah(),p=Number.isFinite(c)&&c!==null?Nue(c,u,a):null,m=h.useCallback(()=>p==null?{}:{insetInlineStart:0,height:"inherit",width:`${p}%`},[p]);return lt("div",t,{state:f,ref:n,props:[{style:m()},s],stateAttributesMapping:Kd})});process.env.NODE_ENV!=="production"&&(mk.displayName="ProgressIndicator");const hk=h.forwardRef(function(t,n){const{className:r,render:o,children:i,style:s,...a}=t,{value:u,formattedValue:c,state:f}=ah(),p=u==null?"indeterminate":c,m=u==null?null:c;return lt("span",t,{state:f,ref:n,props:[{"aria-hidden":!0,children:typeof i=="function"?i(p,u):m},a],stateAttributesMapping:Kd})});process.env.NODE_ENV!=="production"&&(hk.displayName="ProgressValue");function Iue(e,t){const n=$r(e);return Le(()=>(t(n),()=>{t(void 0)}),[n,t]),n}const gk=h.forwardRef(function(t,n){const{render:r,className:o,style:i,id:s,...a}=t,{setLabelId:u,state:c}=ah(),f=Iue(s,u);return lt("span",t,{state:c,ref:n,props:[{id:f,role:"presentation"},a],stateAttributesMapping:Kd})});process.env.NODE_ENV!=="production"&&(gk.displayName="ProgressLabel");const kue=Oi("block w-full overflow-hidden rounded-full bg-input",{variants:{size:{sm:"h-1",md:"h-1.5",lg:"h-2.5"}},defaultVariants:{size:"md"}}),Fue=Oi("transition-all duration-500",{variants:{variant:{default:"bg-primary",success:"bg-success",error:"bg-error",warning:"bg-warning",info:"bg-info"}},defaultVariants:{variant:"default"}});function vk({className:e,...t}){return w.jsx(fk,{className:me("flex w-full flex-col gap-2",e),"data-slot":"progress",...t})}function Lue({className:e,...t}){return w.jsx(gk,{className:me("font-medium text-sm",e),"data-slot":"progress-label",...t})}function bk({className:e,size:t,...n}){return w.jsx(pk,{className:me(kue({size:t}),e),"data-slot":"progress-track",...n})}function yk({className:e,variant:t,...n}){return w.jsx(mk,{className:me(Fue({variant:t}),e),"data-slot":"progress-indicator",...n})}function que({className:e,...t}){return w.jsx(hk,{className:me("text-sm tabular-nums",e),"data-slot":"progress-value",...t})}function jue({size:e,variant:t,className:n,trackProps:r,indicatorProps:o,...i}){return w.jsx(vk,{className:n,...i,children:w.jsx(bk,{size:e,...r,children:w.jsx(yk,{variant:t,...o})})})}const Bue=({items:e=[],valueKey:t="value",labelKey:n="label",value:r,onChange:o,defaultValue:i,renderOption:s=v=>v?.[n],triggerProps:a,contentClassName:u,contentProps:c,itemClassName:f,itemProps:p,className:m,placeholder:b="Seleccionar",...y})=>{const[v,E]=Kt({prop:r,onChange:x=>{if(!o)return;const R=e.find(P=>P[t]===x);o?.(x,R)},defaultProp:i});return w.jsxs(Xk,{...y,onValueChange:E,value:v,children:[w.jsx(Jk,{className:m,...a,children:w.jsx(Qk,{placeholder:b})}),w.jsx(n4,{className:u,...c,children:w.jsx(Zk,{children:e.map((x,R)=>D.createElement(o4,{...p,className:f,key:R,disabled:x?.disabled,value:x[t]},s?.(x)))})})]})};function BT(e,[t,n]){return Math.min(n,Math.max(t,e))}function xk(e){const t=Vue(e),n=h.forwardRef((r,o)=>{const{children:i,...s}=r,a=h.Children.toArray(i),u=a.find(Hue);if(u){const c=u.props.children,f=a.map(p=>p===u?h.Children.count(c)>1?h.Children.only(null):h.isValidElement(c)?c.props.children:null:p);return w.jsx(t,{...s,ref:o,children:h.isValidElement(c)?h.cloneElement(c,void 0,f):null})}return w.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function Vue(e){const t=h.forwardRef((n,r)=>{const{children:o,...i}=n;if(h.isValidElement(o)){const s=Uue(o),a=Wue(i,o.props);return o.type!==h.Fragment&&(a.ref=r?Ht(r,s):s),h.cloneElement(o,a)}return h.Children.count(o)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Kue=Symbol("radix.slottable");function Hue(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Kue}function Wue(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const u=i(...a);return o(...a),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Uue(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var zue=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],pr=zue.reduce((e,t)=>{const n=xk(`Primitive.${t}`),r=h.forwardRef((o,i)=>{const{asChild:s,...a}=o,u=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(u,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Gue(e){const t=h.useRef({value:e,previous:e});return h.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Yue(e){const t=Xue(e),n=h.forwardRef((r,o)=>{const{children:i,...s}=r,a=h.Children.toArray(i),u=a.find(Que);if(u){const c=u.props.children,f=a.map(p=>p===u?h.Children.count(c)>1?h.Children.only(null):h.isValidElement(c)?c.props.children:null:p);return w.jsx(t,{...s,ref:o,children:h.isValidElement(c)?h.cloneElement(c,void 0,f):null})}return w.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function Xue(e){const t=h.forwardRef((n,r)=>{const{children:o,...i}=n;if(h.isValidElement(o)){const s=ece(o),a=Jue(i,o.props);return o.type!==h.Fragment&&(a.ref=r?Ht(r,s):s),h.cloneElement(o,a)}return h.Children.count(o)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Zue=Symbol("radix.slottable");function Que(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Zue}function Jue(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const u=i(...a);return o(...a),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function ece(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var tce=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],nce=tce.reduce((e,t)=>{const n=Yue(`Primitive.${t}`),r=h.forwardRef((o,i)=>{const{asChild:s,...a}=o,u=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(u,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),wk=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"}),rce="VisuallyHidden",oce=h.forwardRef((e,t)=>w.jsx(nce.span,{...e,ref:t,style:{...wk,...e.style}}));oce.displayName=rce;var ice=[" ","Enter","ArrowUp","ArrowDown"],sce=[" ","Enter"],ms="Select",[lh,uh,ace]=Jx(ms),[Ra]=Go(ms,[ace,Ca]),ch=Ca(),[lce,Mi]=Ra(ms),[uce,cce]=Ra(ms),Ek=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:u,dir:c,name:f,autoComplete:p,disabled:m,required:b,form:y}=e,v=ch(t),[E,x]=h.useState(null),[R,P]=h.useState(null),[O,S]=h.useState(!1),T=ew(c),[_,$]=Kt({prop:r,defaultProp:o??!1,onChange:i,caller:ms}),[V,U]=Kt({prop:s,defaultProp:a,onChange:u,caller:ms}),A=h.useRef(null),H=E?y||!!E.closest("form"):!0,[F,N]=h.useState(new Set),j=Array.from(F).map(I=>I.props.value).join(";");return w.jsx(nh,{...v,children:w.jsxs(lce,{required:b,scope:t,trigger:E,onTriggerChange:x,valueNode:R,onValueNodeChange:P,valueNodeHasChildren:O,onValueNodeHasChildrenChange:S,contentId:an(),value:V,onValueChange:U,open:_,onOpenChange:$,dir:T,triggerPointerDownPosRef:A,disabled:m,children:[w.jsx(lh.Provider,{scope:t,children:w.jsx(uce,{scope:e.__scopeSelect,onNativeOptionAdd:h.useCallback(I=>{N(k=>new Set(k).add(I))},[]),onNativeOptionRemove:h.useCallback(I=>{N(k=>{const q=new Set(k);return q.delete(I),q})},[]),children:n})}),H?w.jsxs(Uk,{"aria-hidden":!0,required:b,tabIndex:-1,name:f,autoComplete:p,value:V,onChange:I=>U(I.target.value),disabled:m,form:y,children:[V===void 0?w.jsx("option",{value:""}):null,Array.from(F)]},j):null]})})};Ek.displayName=ms;var Ck="SelectTrigger",Rk=h.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=ch(n),s=Mi(Ck,n),a=s.disabled||r,u=it(t,s.onTriggerChange),c=uh(n),f=h.useRef("touch"),[p,m,b]=Gk(v=>{const E=c().filter(P=>!P.disabled),x=E.find(P=>P.value===s.value),R=Yk(E,v,x);R!==void 0&&s.onValueChange(R.value)}),y=v=>{a||(s.onOpenChange(!0),b()),v&&(s.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return w.jsx(rh,{asChild:!0,...i,children:w.jsx(pr.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:a,"data-disabled":a?"":void 0,"data-placeholder":zk(s.value)?"":void 0,...o,ref:u,onClick:Ie(o.onClick,v=>{v.currentTarget.focus(),f.current!=="mouse"&&y(v)}),onPointerDown:Ie(o.onPointerDown,v=>{f.current=v.pointerType;const E=v.target;E.hasPointerCapture(v.pointerId)&&E.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(y(v),v.preventDefault())}),onKeyDown:Ie(o.onKeyDown,v=>{const E=p.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&m(v.key),!(E&&v.key===" ")&&ice.includes(v.key)&&(y(),v.preventDefault())})})})});Rk.displayName=Ck;var Sk="SelectValue",Pk=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=e,u=Mi(Sk,n),{onValueNodeHasChildrenChange:c}=u,f=i!==void 0,p=it(t,u.onValueNodeChange);return xn(()=>{c(f)},[c,f]),w.jsx(pr.span,{...a,ref:p,style:{pointerEvents:"none"},children:zk(u.value)?w.jsx(w.Fragment,{children:s}):i})});Pk.displayName=Sk;var dce="SelectIcon",Tk=h.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return w.jsx(pr.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});Tk.displayName=dce;var fce="SelectPortal",_k=e=>w.jsx(xd,{asChild:!0,...e});_k.displayName=fce;var hs="SelectContent",Ok=h.forwardRef((e,t)=>{const n=Mi(hs,e.__scopeSelect),[r,o]=h.useState();if(xn(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?er.createPortal(w.jsx($k,{scope:e.__scopeSelect,children:w.jsx(lh.Slot,{scope:e.__scopeSelect,children:w.jsx("div",{children:e.children})})}),i):null}return w.jsx(Dk,{...e,ref:t})});Ok.displayName=hs;var qr=10,[$k,Ai]=Ra(hs),pce="SelectContentImpl",mce=xk("SelectContent.RemoveScroll"),Dk=h.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:u,align:c,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:b,sticky:y,hideWhenDetached:v,avoidCollisions:E,...x}=e,R=Mi(hs,n),[P,O]=h.useState(null),[S,T]=h.useState(null),_=it(t,ee=>O(ee)),[$,V]=h.useState(null),[U,A]=h.useState(null),H=uh(n),[F,N]=h.useState(!1),j=h.useRef(!1);h.useEffect(()=>{if(P)return Ed(P)},[P]),Fm();const I=h.useCallback(ee=>{const[de,...K]=H().map(Z=>Z.ref.current),[ue]=K.slice(-1),le=document.activeElement;for(const Z of ee)if(Z===le||(Z?.scrollIntoView({block:"nearest"}),Z===de&&S&&(S.scrollTop=0),Z===ue&&S&&(S.scrollTop=S.scrollHeight),Z?.focus(),document.activeElement!==le))return},[H,S]),k=h.useCallback(()=>I([$,P]),[I,$,P]);h.useEffect(()=>{F&&k()},[F,k]);const{onOpenChange:q,triggerPointerDownPosRef:z}=R;h.useEffect(()=>{if(P){let ee={x:0,y:0};const de=ue=>{ee={x:Math.abs(Math.round(ue.pageX)-(z.current?.x??0)),y:Math.abs(Math.round(ue.pageY)-(z.current?.y??0))}},K=ue=>{ee.x<=10&&ee.y<=10?ue.preventDefault():P.contains(ue.target)||q(!1),document.removeEventListener("pointermove",de),z.current=null};return z.current!==null&&(document.addEventListener("pointermove",de),document.addEventListener("pointerup",K,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",de),document.removeEventListener("pointerup",K,{capture:!0})}}},[P,q,z]),h.useEffect(()=>{const ee=()=>q(!1);return window.addEventListener("blur",ee),window.addEventListener("resize",ee),()=>{window.removeEventListener("blur",ee),window.removeEventListener("resize",ee)}},[q]);const[W,te]=Gk(ee=>{const de=H().filter(le=>!le.disabled),K=de.find(le=>le.ref.current===document.activeElement),ue=Yk(de,ee,K);ue&&setTimeout(()=>ue.ref.current.focus())}),X=h.useCallback((ee,de,K)=>{const ue=!j.current&&!K;(R.value!==void 0&&R.value===de||ue)&&(V(ee),ue&&(j.current=!0))},[R.value]),Q=h.useCallback(()=>P?.focus(),[P]),re=h.useCallback((ee,de,K)=>{const ue=!j.current&&!K;(R.value!==void 0&&R.value===de||ue)&&A(ee)},[R.value]),ce=r==="popper"?Nb:Mk,se=ce===Nb?{side:a,sideOffset:u,align:c,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:b,sticky:y,hideWhenDetached:v,avoidCollisions:E}:{};return w.jsx($k,{scope:n,content:P,viewport:S,onViewportChange:T,itemRefCallback:X,selectedItem:$,onItemLeave:Q,itemTextRefCallback:re,focusSelectedItem:k,selectedItemText:U,position:r,isPositioned:F,searchRef:W,children:w.jsx(ya,{as:mce,allowPinchZoom:!0,children:w.jsx(yd,{asChild:!0,trapped:R.open,onMountAutoFocus:ee=>{ee.preventDefault()},onUnmountAutoFocus:Ie(o,ee=>{R.trigger?.focus({preventScroll:!0}),ee.preventDefault()}),children:w.jsx(bd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:ee=>ee.preventDefault(),onDismiss:()=>R.onOpenChange(!1),children:w.jsx(ce,{role:"listbox",id:R.contentId,"data-state":R.open?"open":"closed",dir:R.dir,onContextMenu:ee=>ee.preventDefault(),...x,...se,onPlaced:()=>N(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:Ie(x.onKeyDown,ee=>{const de=ee.ctrlKey||ee.altKey||ee.metaKey;if(ee.key==="Tab"&&ee.preventDefault(),!de&&ee.key.length===1&&te(ee.key),["ArrowUp","ArrowDown","Home","End"].includes(ee.key)){let ue=H().filter(le=>!le.disabled).map(le=>le.ref.current);if(["ArrowUp","End"].includes(ee.key)&&(ue=ue.slice().reverse()),["ArrowUp","ArrowDown"].includes(ee.key)){const le=ee.target,Z=ue.indexOf(le);ue=ue.slice(Z+1)}setTimeout(()=>I(ue)),ee.preventDefault()}})})})})})})});Dk.displayName=pce;var hce="SelectItemAlignedPosition",Mk=h.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=Mi(hs,n),s=Ai(hs,n),[a,u]=h.useState(null),[c,f]=h.useState(null),p=it(t,_=>f(_)),m=uh(n),b=h.useRef(!1),y=h.useRef(!0),{viewport:v,selectedItem:E,selectedItemText:x,focusSelectedItem:R}=s,P=h.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&v&&E&&x){const _=i.trigger.getBoundingClientRect(),$=c.getBoundingClientRect(),V=i.valueNode.getBoundingClientRect(),U=x.getBoundingClientRect();if(i.dir!=="rtl"){const le=U.left-$.left,Z=V.left-le,xe=_.left-Z,Re=_.width+xe,Ae=Math.max(Re,$.width),Se=window.innerWidth-qr,Oe=BT(Z,[qr,Math.max(qr,Se-Ae)]);a.style.minWidth=Re+"px",a.style.left=Oe+"px"}else{const le=$.right-U.right,Z=window.innerWidth-V.right-le,xe=window.innerWidth-_.right-Z,Re=_.width+xe,Ae=Math.max(Re,$.width),Se=window.innerWidth-qr,Oe=BT(Z,[qr,Math.max(qr,Se-Ae)]);a.style.minWidth=Re+"px",a.style.right=Oe+"px"}const A=m(),H=window.innerHeight-qr*2,F=v.scrollHeight,N=window.getComputedStyle(c),j=parseInt(N.borderTopWidth,10),I=parseInt(N.paddingTop,10),k=parseInt(N.borderBottomWidth,10),q=parseInt(N.paddingBottom,10),z=j+I+F+q+k,W=Math.min(E.offsetHeight*5,z),te=window.getComputedStyle(v),X=parseInt(te.paddingTop,10),Q=parseInt(te.paddingBottom,10),re=_.top+_.height/2-qr,ce=H-re,se=E.offsetHeight/2,ee=E.offsetTop+se,de=j+I+ee,K=z-de;if(de<=re){const le=A.length>0&&E===A[A.length-1].ref.current;a.style.bottom="0px";const Z=c.clientHeight-v.offsetTop-v.offsetHeight,xe=Math.max(ce,se+(le?Q:0)+Z+k),Re=de+xe;a.style.height=Re+"px"}else{const le=A.length>0&&E===A[0].ref.current;a.style.top="0px";const xe=Math.max(re,j+v.offsetTop+(le?X:0)+se)+K;a.style.height=xe+"px",v.scrollTop=de-re+v.offsetTop}a.style.margin=`${qr}px 0`,a.style.minHeight=W+"px",a.style.maxHeight=H+"px",r?.(),requestAnimationFrame(()=>b.current=!0)}},[m,i.trigger,i.valueNode,a,c,v,E,x,i.dir,r]);xn(()=>P(),[P]);const[O,S]=h.useState();xn(()=>{c&&S(window.getComputedStyle(c).zIndex)},[c]);const T=h.useCallback(_=>{_&&y.current===!0&&(P(),R?.(),y.current=!1)},[P,R]);return w.jsx(vce,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:b,onScrollButtonChange:T,children:w.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:O},children:w.jsx(pr.div,{...o,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Mk.displayName=hce;var gce="SelectPopperPosition",Nb=h.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=qr,...i}=e,s=ch(n);return w.jsx(rw,{...s,...i,ref:t,align:r,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)"}})});Nb.displayName=gce;var[vce,hw]=Ra(hs,{}),Ib="SelectViewport",Ak=h.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=Ai(Ib,n),s=hw(Ib,n),a=it(t,i.onViewportChange),u=h.useRef(0);return w.jsxs(w.Fragment,{children:[w.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:r}),w.jsx(lh.Slot,{scope:n,children:w.jsx(pr.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Ie(o.onScroll,c=>{const f=c.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:m}=s;if(m?.current&&p){const b=Math.abs(u.current-f.scrollTop);if(b>0){const y=window.innerHeight-qr*2,v=parseFloat(p.style.minHeight),E=parseFloat(p.style.height),x=Math.max(v,E);if(x<y){const R=x+b,P=Math.min(y,R),O=R-P;p.style.height=P+"px",p.style.bottom==="0px"&&(f.scrollTop=O>0?O:0,p.style.justifyContent="flex-end")}}}u.current=f.scrollTop})})})]})});Ak.displayName=Ib;var Nk="SelectGroup",[bce,yce]=Ra(Nk),Ik=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=an();return w.jsx(bce,{scope:n,id:o,children:w.jsx(pr.div,{role:"group","aria-labelledby":o,...r,ref:t})})});Ik.displayName=Nk;var kk="SelectLabel",Fk=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=yce(kk,n);return w.jsx(pr.div,{id:o.id,...r,ref:t})});Fk.displayName=kk;var cm="SelectItem",[xce,Lk]=Ra(cm),qk=h.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,a=Mi(cm,n),u=Ai(cm,n),c=a.value===r,[f,p]=h.useState(i??""),[m,b]=h.useState(!1),y=it(t,R=>u.itemRefCallback?.(R,r,o)),v=an(),E=h.useRef("touch"),x=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")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 w.jsx(xce,{scope:n,value:r,disabled:o,textId:v,isSelected:c,onItemTextChange:h.useCallback(R=>{p(P=>P||(R?.textContent??"").trim())},[]),children:w.jsx(lh.ItemSlot,{scope:n,value:r,disabled:o,textValue:f,children:w.jsx(pr.div,{role:"option","aria-labelledby":v,"data-highlighted":m?"":void 0,"aria-selected":c&&m,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:y,onFocus:Ie(s.onFocus,()=>b(!0)),onBlur:Ie(s.onBlur,()=>b(!1)),onClick:Ie(s.onClick,()=>{E.current!=="mouse"&&x()}),onPointerUp:Ie(s.onPointerUp,()=>{E.current==="mouse"&&x()}),onPointerDown:Ie(s.onPointerDown,R=>{E.current=R.pointerType}),onPointerMove:Ie(s.onPointerMove,R=>{E.current=R.pointerType,o?u.onItemLeave?.():E.current==="mouse"&&R.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ie(s.onPointerLeave,R=>{R.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:Ie(s.onKeyDown,R=>{u.searchRef?.current!==""&&R.key===" "||(sce.includes(R.key)&&x(),R.key===" "&&R.preventDefault())})})})})});qk.displayName=cm;var Kc="SelectItemText",jk=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=Mi(Kc,n),a=Ai(Kc,n),u=Lk(Kc,n),c=cce(Kc,n),[f,p]=h.useState(null),m=it(t,x=>p(x),u.onItemTextChange,x=>a.itemTextRefCallback?.(x,u.value,u.disabled)),b=f?.textContent,y=h.useMemo(()=>w.jsx("option",{value:u.value,disabled:u.disabled,children:b},u.value),[u.disabled,u.value,b]),{onNativeOptionAdd:v,onNativeOptionRemove:E}=c;return xn(()=>(v(y),()=>E(y)),[v,E,y]),w.jsxs(w.Fragment,{children:[w.jsx(pr.span,{id:u.textId,...i,ref:m}),u.isSelected&&s.valueNode&&!s.valueNodeHasChildren?er.createPortal(i.children,s.valueNode):null]})});jk.displayName=Kc;var Bk="SelectItemIndicator",wce=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Lk(Bk,n).isSelected?w.jsx(pr.span,{"aria-hidden":!0,...r,ref:t}):null});wce.displayName=Bk;var kb="SelectScrollUpButton",Vk=h.forwardRef((e,t)=>{const n=Ai(kb,e.__scopeSelect),r=hw(kb,e.__scopeSelect),[o,i]=h.useState(!1),s=it(t,r.onScrollButtonChange);return xn(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=u.scrollTop>0;i(c)};const u=n.viewport;return a(),u.addEventListener("scroll",a),()=>u.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?w.jsx(Hk,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:u}=n;a&&u&&(a.scrollTop=a.scrollTop-u.offsetHeight)}}):null});Vk.displayName=kb;var Fb="SelectScrollDownButton",Kk=h.forwardRef((e,t)=>{const n=Ai(Fb,e.__scopeSelect),r=hw(Fb,e.__scopeSelect),[o,i]=h.useState(!1),s=it(t,r.onScrollButtonChange);return xn(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=u.scrollHeight-u.clientHeight,f=Math.ceil(u.scrollTop)<c;i(f)};const u=n.viewport;return a(),u.addEventListener("scroll",a),()=>u.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?w.jsx(Hk,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:u}=n;a&&u&&(a.scrollTop=a.scrollTop+u.offsetHeight)}}):null});Kk.displayName=Fb;var Hk=h.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=Ai("SelectScrollButton",n),s=h.useRef(null),a=uh(n),u=h.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return h.useEffect(()=>()=>u(),[u]),xn(()=>{a().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),w.jsx(pr.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:Ie(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:Ie(o.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:Ie(o.onPointerLeave,()=>{u()})})}),Ece="SelectSeparator",Wk=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return w.jsx(pr.div,{"aria-hidden":!0,...r,ref:t})});Wk.displayName=Ece;var Lb="SelectArrow",Cce=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=ch(n),i=Mi(Lb,n),s=Ai(Lb,n);return i.open&&s.position==="popper"?w.jsx(ow,{...o,...r,ref:t}):null});Cce.displayName=Lb;var Rce="SelectBubbleInput",Uk=h.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=h.useRef(null),i=it(r,o),s=Gue(t);return h.useEffect(()=>{const a=o.current;if(!a)return;const u=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(u,"value").set;if(s!==t&&f){const p=new Event("change",{bubbles:!0});f.call(a,t),a.dispatchEvent(p)}},[s,t]),w.jsx(pr.select,{...n,style:{...wk,...n.style},ref:i,defaultValue:t})});Uk.displayName=Rce;function zk(e){return e===""||e===void 0}function Gk(e){const t=_n(e),n=h.useRef(""),r=h.useRef(0),o=h.useCallback(s=>{const a=n.current+s;t(a),(function u(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>u(""),1e3))})(a)},[t]),i=h.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function Yk(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=Sce(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const u=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function Sce(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Pce=Ek,Tce=Rk,_ce=Pk,Oce=Tk,$ce=_k,Dce=Ok,Mce=Ak,Ace=Ik,Nce=Fk,Ice=qk,kce=jk,Fce=Vk,Lce=Kk,qce=Wk;const Xk=e=>w.jsx(Pce,{"data-slot":"select",...e}),Zk=({heading:e,children:t,...n})=>w.jsxs(Ace,{"data-slot":"select-group",...n,children:[e&&w.jsx(r4,{children:e}),t]}),Qk=e=>w.jsx(_ce,{"data-slot":"select-value",...e}),Jk=({className:e,children:t,...n})=>w.jsxs(Tce,{"data-slot":"select-trigger",className:me("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),...n,children:[t,w.jsx(Oce,{asChild:!0,"data-slot":"select-trigger-icon",children:w.jsx(Gp,{className:"h-4 w-4 shrink-0 opacity-50"})})]}),e4=({className:e,...t})=>w.jsx(Fce,{"data-slot":"select-scroll-up",className:me("flex cursor-default items-center justify-center py-1",e),...t,children:w.jsx($$,{className:"h-4 w-4"})}),t4=({className:e,...t})=>w.jsx(Lce,{"data-slot":"select-scroll-down",className:me("flex cursor-default items-center justify-center py-1",e),...t,children:w.jsx(O$,{className:"h-4 w-4"})}),n4=({className:e,children:t,position:n="popper",...r})=>w.jsx($ce,{children:w.jsxs(Dce,{"data-slot":"select-content",className:me("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",n==="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:n,...r,children:[w.jsx(e4,{}),w.jsx(Mce,{"data-slot":"select-viewport",className:me("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),w.jsx(t4,{})]})}),r4=({className:e,...t})=>w.jsx(Nce,{"data-slot":"select-label",className:me("py-1.5 px-2 text-sm font-semibold",e),...t}),o4=({className:e,children:t,...n})=>w.jsx(Ice,{"data-slot":"select-item",className:me("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),...n,children:w.jsx(kce,{"data-slot":"select-item-text",children:t})}),jce=({className:e,...t})=>w.jsx(qce,{"data-slot":"select-separator",className:me("-mx-1 my-1 h-px bg-muted",e),...t}),Bce=({when:e,...t})=>w.jsx(Gr,{present:e,children:w.jsx(km,{...t,"data-state":e?"open":"closed","data-slot":"show"})});function Vce({className:e,...t}){return w.jsx("div",{className:me("animate-skeleton rounded-sm [--skeleton-highlight:--alpha(var(--color-white)/64%)] [background:linear-gradient(120deg,transparent_40%,var(--skeleton-highlight),transparent_60%)_var(--color-muted)_0_0/200%_100%_fixed] dark:[--skeleton-highlight:--alpha(var(--color-white)/4%)]",e),"data-slot":"skeleton",...t})}const Kce=({as:e="div",inline:t=!1,direction:n="horizontal",reverse:r=!1,justify:o,align:i,gap:s=8,wrap:a,grow:u=!1,className:c,style:f,...p})=>{const m=`${n==="vertical"?"column":"row"}${r?"-reverse":""}`;return w.jsx(e,{className:me(t?"inline-flex":"flex",u&&"flex-1",c),style:{flexDirection:m,justifyContent:o,alignItems:i,gap:s,flexWrap:a,...f},"data-slot":"stack",...p})},[i4,Hce]=Sd();function Wce({items:e=[],current:t,onChange:n,className:r,classNameList:o,classNameItem:i,classNameButton:s,classNameIndicator:a,classNameContent:u}){return w.jsxs(s4,{className:r,current:t,onChange:n,children:[w.jsx(a4,{className:o,children:e?.map((c,f)=>w.jsx(l4,{value:f,title:c?.title,indicator:c?.indicator,classNameItem:i,classNameButton:s,classNameIndicator:a},f))}),e?.map((c,f)=>w.jsx(u4,{className:u,value:f,children:c?.content},f))]})}function s4({current:e,onChange:t,className:n,...r}){const[o=0,i]=Kt({prop:e,onChange:t,defaultProp:0});return w.jsx(Hce,{value:{activeStep:o,setActiveStep:i},children:w.jsx("div",{"data-slot":"stepper",className:me("flex flex-col items-center w-full transition-all ease-in delay-150",n),...r})})}function a4({children:e,className:t,...n}){return w.jsx("ul",{"data-slot":"stepper-list",className:me("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),...n,children:e})}function l4({disabled:e,value:t,title:n,indicator:r,classNameItem:o,classNameButton:i,classNameIndicator:s}){const{activeStep:a,setActiveStep:u}=i4();return w.jsx("li",{"data-slot":"stepper-trigger",className:me("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 ${a>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:w.jsxs("button",{onClick:()=>!e&&u(t),className:me("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",a>=t?"text-primary":"text-gray-500",e&&"cursor-not-allowed",i),children:[w.jsx("span",{"data-slot":"stepper-trigger-indicator",className:me("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",a>t&&"bg-primary border-primary text-primary-foreground",a===t&&"bg-gray-100 text-primary border-primary",a<t&&"bg-white text-gray-500 border-input",e&&"text-gray-300",s),children:a>t?"✓":r||t+1}),n]})})}function u4({value:e,className:t="w-full",...n}){const{activeStep:r}=i4();return r===e?w.jsx("div",{"data-slot":"stepper-content",className:t,...n}):null}const gw=h.createContext(void 0);process.env.NODE_ENV!=="production"&&(gw.displayName="SwitchRootContext");function Uce(){const e=h.useContext(gw);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: SwitchRootContext is missing. Switch parts must be placed within <Switch.Root>.":zt(63));return e}let VT=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const c4={...Ym,checked(e){return e?{[VT.checked]:""}:{[VT.unchecked]:""}}};function zce(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:o,registerControlId:i}=Xm(),s=$r(t),a=n?o:void 0,u=Hn(()=>Symbol("labelable-control")),c=h.useRef(!1),f=h.useRef(t!=null),p=He(()=>{!c.current||i===At||(c.current=!1,i(u.current,void 0))});return Le(()=>{if(i===At)return;let m;if(n){const b=r?.current;et(b)&&b.closest("label")!=null?m=t??null:m=a??s}else if(t!=null)f.current=!0,m=t;else if(f.current)m=s;else{p();return}if(m===void 0){p();return}c.current=!0,i(u.current,m)},[t,r,a,i,n,s,u,p]),h.useEffect(()=>p,[p]),o??s}const d4=h.forwardRef(function(t,n){const{checked:r,className:o,defaultChecked:i,"aria-labelledby":s,form:a,id:u,inputRef:c,name:f,nativeButton:p=!1,onCheckedChange:m,readOnly:b=!1,required:y=!1,disabled:v=!1,render:E,uncheckedValue:x,value:R,style:P,...O}=t,{clearErrors:S}=mx(),{state:T,setTouched:_,setDirty:$,validityData:V,setFilled:U,setFocused:A,shouldValidateOnChange:H,validationMode:F,disabled:N,name:j,validation:I}=_d(),{labelId:k}=Xm(),q=N||v,z=j??f,W=He(m),te=h.useRef(null),X=la(te,c,I.inputRef),Q=h.useRef(null),re=$r(),ce=zce({id:u,implicit:!1,controlRef:Q}),se=p?void 0:ce,[ee,de]=fx({controlled:r,default:!!i,name:"Switch",state:"checked"});px(Q,{id:re,value:ee}),Le(()=>{te.current&&U(te.current.checked)},[te,U]),Nm(ee,()=>{S(z),$(ee!==V.initialValue),U(ee),H()?I.commit(ee):I.commit(ee,!0)});const{getButtonProps:K,buttonRef:ue}=ga({disabled:q,native:p}),le=bA(s,k,te,!p,se),Z={id:p?ce:re,role:"switch","aria-checked":ee,"aria-readonly":b||void 0,"aria-required":y||void 0,"aria-labelledby":le,onFocus(){q||A(!0)},onBlur(){const Se=te.current;!Se||q||(_(!0),A(!1),F==="onBlur"&&I.commit(Se.checked))},onClick(Se){b||q||(Se.preventDefault(),te.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:Se.shiftKey,ctrlKey:Se.ctrlKey,altKey:Se.altKey,metaKey:Se.metaKey})))}},xe=h.useMemo(()=>pa({checked:ee,disabled:q,form:a,id:se,name:z,required:y,style:z?W_:pd,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:X,onChange(Se){if(Se.nativeEvent.defaultPrevented)return;if(b){Se.preventDefault();return}const Oe=Se.currentTarget.checked,Ye=pt(Sm,Se.nativeEvent);W?.(Oe,Ye),!Ye.isCanceled&&de(Oe)},onFocus(){Q.current?.focus()}},I.getInputValidationProps,R!==void 0?{value:R}:yn),[ee,q,a,X,se,z,W,b,y,de,I,R]),Re=h.useMemo(()=>({...T,checked:ee,disabled:q,readOnly:b,required:y}),[T,ee,q,b,y]),Ae=lt("span",t,{state:Re,ref:[n,Q,ue],props:[Z,I.getValidationProps,O,K],stateAttributesMapping:c4});return w.jsxs(gw.Provider,{value:Re,children:[Ae,!ee&&z&&x!==void 0&&w.jsx("input",{type:"hidden",form:a,name:z,value:x}),w.jsx("input",{...xe,suppressHydrationWarning:!0})]})});process.env.NODE_ENV!=="production"&&(d4.displayName="SwitchRoot");const f4=h.forwardRef(function(t,n){const{render:r,className:o,style:i,...s}=t,{state:a}=_d(),u=Uce(),c={...a,...u};return lt("span",t,{state:c,ref:n,stateAttributesMapping:c4,props:s})});process.env.NODE_ENV!=="production"&&(f4.displayName="SwitchThumb");function p4({className:e,...t}){return w.jsx(d4,{className:me("peer inline-flex h-[calc(var(--thumb-size)+2px)] w-[calc(var(--thumb-size)*2-2px)] shrink-0 items-center rounded-full p-px outline-none transition-[background-color,box-shadow] duration-200","[--thumb-size:--spacing(5)] sm:[--thumb-size:--spacing(4)]","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background","data-checked:bg-primary data-unchecked:bg-input","data-disabled:cursor-not-allowed data-disabled:opacity-64",e),"data-slot":"switch",...t})}function m4({className:e,...t}){return w.jsx(f4,{className:me("pointer-events-none block aspect-square h-full rounded-(--thumb-size) bg-background shadow-sm/5 will-change-transform","origin-left [transition:translate_.15s,border-radius_.15s,scale_.1s_.1s,transform-origin_.15s]","data-checked:origin-[var(--thumb-size)_50%] data-checked:translate-x-[calc(var(--thumb-size)-4px)]","in-[[role=switch]:active,[data-slot=label]:active,[data-slot=field-label]:active]:not-data-disabled:scale-x-110","in-[[role=switch]:active,[data-slot=label]:active,[data-slot=field-label]:active]:rounded-[var(--thumb-size)/calc(var(--thumb-size)*1.1)]",e),"data-slot":"switch-thumb",...t})}function Gce({children:e,className:t,id:n,thumbProps:r,...o}){const i=D.useId(),s=n??i;return w.jsxs("div",{className:"flex select-none items-center gap-x-2",children:[w.jsx(p4,{id:s,className:t,...o,children:w.jsx(m4,{...r})}),e&&w.jsx(Od,{htmlFor:s,children:e})]})}const h4=({className:e,containerClassName:t,containerProps:n,...r})=>w.jsx("div",{"data-slot":"table-container",className:me("relative w-full overflow-auto rounded-md border",t),...n,children:w.jsx("table",{"data-slot":"table",className:me("w-full caption-bottom text-sm",e),...r})}),g4=({className:e,...t})=>w.jsx("thead",{"data-slot":"table-header",className:me("[&_tr]:border-b",e),...t}),v4=({className:e,...t})=>w.jsx("tbody",{"data-slot":"table-body",className:me("[&_tr:last-child]:border-0",e),...t}),Yce=({className:e,...t})=>w.jsx("tfoot",{"data-slot":"table-footer",className:me("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}),qb=({className:e,...t})=>w.jsx("tr",{"data-slot":"table-row",className:me("border-b transition-colors hover:bg-muted data-[selected=true]:bg-muted",e),...t}),b4=({className:e,...t})=>w.jsx("th",{"data-slot":"table-head",className:me("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}),y4=({className:e,...t})=>w.jsx("td",{"data-slot":"table-cell",className:me("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}),Xce=({className:e,...t})=>w.jsx("caption",{"data-slot":"table-caption",className:me("mt-4 text-sm text-muted-foreground",e),...t}),Zce=({data:e=[],columns:t=[],onRowClick:n,onDoubleClick:r,selected:o,theadClassName:i,theadProps:s,tbodyClassName:a,tbodyProps:u,trClassName:c,trProps:f,thClassName:p,thProps:m,tdClassName:b,tdProps:y,...v})=>w.jsxs(h4,{...v,className:me(v?.className),children:[w.jsx(g4,{...s,className:me(s?.className,i),children:w.jsx(qb,{...f,className:me(f?.className,c),children:t.map((E,x)=>w.jsx(b4,{...m,className:me(m?.className,p),style:{width:E.width},children:_t.isFunction(E.header)?E.header?.():E.header},x))})}),w.jsx(v4,{...u,className:me(u?.className,a),children:e.map((E,x)=>w.jsx(qb,{...f,"data-selected":o?.(E),className:me(f?.className,c),children:t.map((R,P)=>w.jsx(y4,{...y,onClick:O=>{y?.onClick?.(O),n?.(E)},onDoubleClick:()=>r?.(E),className:me(y?.className,b),children:R.cell?.(E,P)||E[R.key]},P))},x))})]}),$p=[10,25,50],Qce=({containerClassName:e,containerProps:t,selectClassName:n,selectProps:r,sizes:o=$p,...i})=>{const[s=$p[0],a]=Kt({onChange:i?.setPageSize,prop:i?.pageSize,defaultProp:$p[0]}),{range:u,next:c,prev:f,isFirstPage:p,isLastPage:m,goTo:b}=Qx({...i,pageSize:s}),y=v=>{const{value:E}=v.target,x=Number(E);a(x),b(1)};return w.jsxs("div",{"data-slot":"table-pagination",...t,className:me("flex justify-center items-center gap-x-4 bg-background border border-[#D9D9D9] rounded-2xl py-2",e),children:[o&&w.jsx("select",{"data-slot":"table-pagination-size-trigger",...r,value:s,onChange:y,className:me("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",n),children:o.map((v,E)=>w.jsx("option",{value:v,"data-slot":"table-pagination-size-option",children:v},E))}),w.jsxs("span",{"data-slot":"table-pagination-range",children:[u.start," - ",u.end," de ",i.totalItems]}),w.jsxs("div",{className:"flex gap-2",children:[w.jsx(Tn,{"data-slot":"table-pagination-prev",size:"icon",variant:"ghost",disabled:p,onClick:f,children:w.jsx(ky,{"data-slot":"table-pagination-prev-icon"})}),w.jsx(Tn,{"data-slot":"table-pagination-next",size:"icon",variant:"ghost",disabled:m,onClick:c,children:w.jsx(gd,{"data-slot":"table-pagination-next-icon"})})]})]})},[dh,Jce]=Sd(),ede=({children:e,value:t,onChange:n,defaultValue:r,variant:o="default",...i})=>{const[s="",a]=Kt({prop:t,onChange:n,defaultProp:r}),[u,c]=D.useState(null);return w.jsx(Jce,{value:{activeTab:s,setActiveTab:a,setTargetRef:c,targetRef:u,variant:o},children:w.jsx("div",{"data-slot":"tabs",...i,children:e})})},tde=({children:e,className:t,indicatorClassName:n})=>{const{targetRef:r}=dh();return w.jsxs("div",{"data-slot":"tabs-list",className:me("relative mb-4",t),children:[w.jsx("div",{"data-slot":"tabs-content",className:"flex",children:e}),w.jsx(ode,{targetRef:r,indicatorClassName:n})]})},nde=({value:e,className:t,...n})=>{const{activeTab:r,setActiveTab:o,setTargetRef:i,variant:s}=dh(),a=r===e;return w.jsx("button",{"data-slot":"tabs-trigger",...n,type:"button",ref:u=>{a&&i(u)},onClick:()=>o(e),"data-tab":e,"data-selected":a,"aria-selected":a,className:me("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)})},rde=({value:e,...t})=>{const{activeTab:n}=dh();return n===e?w.jsx("div",{"data-slot":"tabs-content",...t}):null},ode=({targetRef:e,indicatorClassName:t})=>{const n=D.useRef(null),r=n?.current,o=D.useRef(null),{variant:i}=dh(),s=()=>{if(!e||!r)return;const a=e.offsetLeft,u=e.offsetWidth;r.style.width=u+"px",r.style.left=a+"px"};return D.useEffect(()=>{if(e)return s(),o.current=new ResizeObserver(s),o.current.observe(e),()=>{o.current?.disconnect()}},[e]),w.jsx("div",{"data-slot":"tabs-indicator",ref:n,className:me("transition-all duration-300 absolute rounded bg-primary",i==="background"?"inset-0 -z-10 h-full top-0":"top-full h-[3px]",t)})},ide=({className:e,...t})=>w.jsx("textarea",{...t,onChange:n=>t.onChange?.(n.target.value),"data-slot":"textarea",className:me("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)}),sde={done:"var(--color-primary)",pending:"#cdcdcd",error:"var(--color-error)"},ade=({items:e,classNameContainer:t,containerProps:n,...r})=>w.jsx(x4,{className:t,...n,children:e.map((o,i)=>w.jsx(w4,{icon:o.icon,color:o.color,status:o.status,...r,children:o.content},i))}),x4=e=>w.jsx("ul",{"data-slot":"timeline",...e,className:me("relative flex justify-center flex-col border-input",e.className)}),w4=({icon:e,status:t,color:n,classNameItemDot:r,classNameItemContainerDot:o,classNameItemContent:i,itemsProps:s,children:a,...u})=>w.jsxs("li",{"data-slot":"timeline-item",className:me("rounded-lg w-full px-2 gap-1 grid hover:bg-muted transition-colors ease-in grid-cols-[minmax(auto,20px)_1fr]",u.className),...u,children:[w.jsx(E4,{icon:e,status:t,color:n,classNameDot:r,classNameContainerDot:o}),w.jsx(C4,{className:i,...s,children:a})]}),E4=({icon:e,status:t="pending",color:n,classNameDot:r,classNameContainerDot:o})=>w.jsx("div",{"data-slot":"timeline-item-dot",className:me("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:w.jsx("div",{"data-slot":"timeline-item-dot-icon",className:me("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",r),style:{backgroundColor:n||sde?.[t]},children:e})}),C4=e=>w.jsx("div",{"data-slot":"timeline-item-content",...e,className:me("grow px-2 pb-4 pt-2",e.className)}),lde=D.createContext(null);D.createContext(null);D.createContext(null);D.createContext(null);D.createContext(null);D.createContext({});D.createContext(null);D.createContext(null);const sn=typeof document<"u"?D.useLayoutEffect:()=>{};var $v;const ude=($v=D.useInsertionEffect)!==null&&$v!==void 0?$v:sn;function Kn(e){const t=D.useRef(null);return ude(()=>{t.current=e},[e]),D.useCallback((...n)=>{const r=t.current;return r?.(...n)},[])}function cde(e){let[t,n]=D.useState(e),r=D.useRef(null),o=Kn(()=>{if(!r.current)return;let s=r.current.next();if(s.done){r.current=null;return}t===s.value?o():n(s.value)});sn(()=>{r.current&&o()});let i=Kn(s=>{r.current=s(t),o()});return[t,i]}const dm={prefix:String(Math.round(Math.random()*1e10)),current:0},R4=D.createContext(dm),dde=D.createContext(!1);let fde=!!(typeof window<"u"&&window.document&&window.document.createElement),Dv=new WeakMap;function pde(e=!1){let t=D.useContext(R4),n=D.useRef(null);if(n.current===null&&!e){var r,o;let i=(o=D.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)===null||o===void 0||(r=o.ReactCurrentOwner)===null||r===void 0?void 0:r.current;if(i){let s=Dv.get(i);s==null?Dv.set(i,{id:t.current,state:i.memoizedState}):i.memoizedState!==s.state&&(t.current=s.id,Dv.delete(i))}n.current=++t.current}return n.current}function mde(e){let t=D.useContext(R4);t===dm&&!fde&&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 n=pde(!!e),r=t===dm&&process.env.NODE_ENV==="test"?"react-aria":`react-aria${t.prefix}`;return e||`${r}-${n}`}function hde(e){let t=D.useId(),[n]=D.useState(Hd()),r=n||process.env.NODE_ENV==="test"?"react-aria":`react-aria${dm.prefix}`;return e||`${r}-${t}`}const gde=typeof D.useId=="function"?hde:mde;function vde(){return!1}function bde(){return!0}function yde(e){return()=>{}}function Hd(){return typeof D.useSyncExternalStore=="function"?D.useSyncExternalStore(yde,vde,bde):D.useContext(dde)}let xde=!!(typeof window<"u"&&window.document&&window.document.createElement),oa=new Map,Hc;typeof FinalizationRegistry<"u"&&(Hc=new FinalizationRegistry(e=>{oa.delete(e)}));function Ho(e){let[t,n]=D.useState(e),r=D.useRef(null),o=gde(t),i=D.useRef(null);if(Hc&&Hc.register(i,o),xde){const s=oa.get(o);s&&!s.includes(r)?s.push(r):oa.set(o,[r])}return sn(()=>{let s=o;return()=>{Hc&&Hc.unregister(i),oa.delete(s)}},[o]),D.useEffect(()=>{let s=r.current;return s&&n(s),()=>{s&&(r.current=null)}}),o}function wde(e,t){if(e===t)return e;let n=oa.get(e);if(n)return n.forEach(o=>o.current=t),t;let r=oa.get(t);return r?(r.forEach(o=>o.current=e),e):t}function Ede(e=[]){let t=Ho(),[n,r]=cde(t),o=D.useCallback(()=>{r(function*(){yield t,yield document.getElementById(t)?t:void 0})},[t,r]);return sn(o,[t,o,...e]),n}function fh(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}const xt=e=>{var t;return(t=e?.ownerDocument)!==null&&t!==void 0?t:document},Tr=e=>e&&"window"in e&&e.window===e?e:xt(e).defaultView||window;function Cde(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function Rde(e){return Cde(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let Sde=!1;function ph(){return Sde}function qt(e,t){if(!ph())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let n=t;for(;n!==null;){if(n===e)return!0;n.tagName==="SLOT"&&n.assignedSlot?n=n.assignedSlot.parentNode:Rde(n)?n=n.host:n=n.parentNode}return!1}const Nn=(e=document)=>{var t;if(!ph())return e.activeElement;let n=e.activeElement;for(;n&&"shadowRoot"in n&&(!((t=n.shadowRoot)===null||t===void 0)&&t.activeElement);)n=n.shadowRoot.activeElement;return n};function ht(e){return ph()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}class Pde{get currentNode(){return this._currentNode}set currentNode(t){if(!qt(this.root,t))throw new Error("Cannot set currentNode to a node that is not contained by the root node.");const n=[];let r=t,o=t;for(this._currentNode=t;r&&r!==this.root;)if(r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const s=r,a=this._doc.createTreeWalker(s,this.whatToShow,{acceptNode:this._acceptNode});n.push(a),a.currentNode=o,this._currentSetFor.add(a),r=o=s.host}else r=r.parentNode;const i=this._doc.createTreeWalker(this.root,this.whatToShow,{acceptNode:this._acceptNode});n.push(i),i.currentNode=o,this._currentSetFor.add(i),this._walkerStack=n}get doc(){return this._doc}firstChild(){let t=this.currentNode,n=this.nextNode();return qt(t,n)?(n&&(this.currentNode=n),n):(this.currentNode=t,null)}lastChild(){let n=this._walkerStack[0].lastChild();return n&&(this.currentNode=n),n}nextNode(){const t=this._walkerStack[0].nextNode();if(t){if(t.shadowRoot){var n;let o;if(typeof this.filter=="function"?o=this.filter(t):!((n=this.filter)===null||n===void 0)&&n.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 r=this.nextNode();return r&&(this.currentNode=r),r}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 n=t.previousNode();if(n){if(n.shadowRoot){var r;let i;if(typeof this.filter=="function"?i=this.filter(n):!((r=this.filter)===null||r===void 0)&&r.acceptNode&&(i=this.filter.acceptNode(n)),i===NodeFilter.FILTER_ACCEPT)return n&&(this.currentNode=n),n;let s=this.lastChild();return s&&(this.currentNode=s),s}return n&&(this.currentNode=n),n}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,n,r,o){this._walkerStack=[],this._currentSetFor=new Set,this._acceptNode=s=>{if(s.nodeType===Node.ELEMENT_NODE){const u=s.shadowRoot;if(u){const c=this._doc.createTreeWalker(u,this.whatToShow,{acceptNode:this._acceptNode});return this._walkerStack.unshift(c),NodeFilter.FILTER_ACCEPT}else{var a;if(typeof this.filter=="function")return this.filter(s);if(!((a=this.filter)===null||a===void 0)&&a.acceptNode)return this.filter.acceptNode(s);if(this.filter===null)return NodeFilter.FILTER_ACCEPT}}return NodeFilter.FILTER_SKIP},this._doc=t,this.root=n,this.filter=o??null,this.whatToShow=r??NodeFilter.SHOW_ALL,this._currentNode=n,this._walkerStack.unshift(t.createTreeWalker(n,r,this._acceptNode));const i=n.shadowRoot;if(i){const s=this._doc.createTreeWalker(i,this.whatToShow,{acceptNode:this._acceptNode});this._walkerStack.unshift(s)}}}function Tde(e,t,n,r){return ph()?new Pde(e,t,n,r):e.createTreeWalker(t,n,r)}function wn(...e){let t={...e[0]};for(let n=1;n<e.length;n++){let r=e[n];for(let o in r){let i=t[o],s=r[o];typeof i=="function"&&typeof s=="function"&&o[0]==="o"&&o[1]==="n"&&o.charCodeAt(2)>=65&&o.charCodeAt(2)<=90?t[o]=fh(i,s):(o==="className"||o==="UNSAFE_className")&&typeof i=="string"&&typeof s=="string"?t[o]=Ny(i,s):o==="id"&&i&&s?t.id=wde(i,s):t[o]=s!==void 0?s:i}}return t}function _de(...e){return e.length===1&&e[0]?e[0]:t=>{let n=!1;const r=e.map(o=>{const i=KT(o,t);return n||(n=typeof i=="function"),i});if(n)return()=>{r.forEach((o,i)=>{typeof o=="function"?o():KT(e[i],null)})}}}function KT(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}const Ode=new Set(["id"]),$de=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),Dde=new Set(["href","hrefLang","target","rel","download","ping","referrerPolicy"]),Mde=new Set(["dir","lang","hidden","inert","translate"]),HT=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"]),Ade=/^(data-.*)$/;function Sa(e,t={}){let{labelable:n,isLink:r,global:o,events:i=o,propNames:s}=t,a={};for(const u in e)Object.prototype.hasOwnProperty.call(e,u)&&(Ode.has(u)||n&&$de.has(u)||r&&Dde.has(u)||o&&Mde.has(u)||i&&HT.has(u)||u.endsWith("Capture")&&HT.has(u.slice(0,-7))||s?.has(u)||Ade.test(u))&&(a[u]=e[u]);return a}function Wo(e){if(Nde())e.focus({preventScroll:!0});else{let t=Ide(e);e.focus(),kde(t)}}let gp=null;function Nde(){if(gp==null){gp=!1;try{document.createElement("div").focus({get preventScroll(){return gp=!0,!0}})}catch{}}return gp}function Ide(e){let t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function kde(e){for(let{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}function mh(e){var t;if(typeof window>"u"||window.navigator==null)return!1;let n=(t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands;return Array.isArray(n)&&n.some(r=>e.test(r.brand))||e.test(window.navigator.userAgent)}function vw(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 Xo(e){if(process.env.NODE_ENV==="test")return e;let t=null;return()=>(t==null&&(t=e()),t)}const gs=Xo(function(){return vw(/^Mac/i)}),Fde=Xo(function(){return vw(/^iPhone/i)}),S4=Xo(function(){return vw(/^iPad/i)||gs()&&navigator.maxTouchPoints>1}),bw=Xo(function(){return Fde()||S4()}),Lde=Xo(function(){return gs()||bw()}),qde=Xo(function(){return mh(/AppleWebKit/i)&&!yw()}),yw=Xo(function(){return mh(/Chrome/i)}),xw=Xo(function(){return mh(/Android/i)}),jde=Xo(function(){return mh(/Firefox/i)}),Bde=D.createContext({isNative:!0,open:Kde,useHref:e=>e});function ww(){return D.useContext(Bde)}function vs(e,t,n=!0){var r,o;let{metaKey:i,ctrlKey:s,altKey:a,shiftKey:u}=t;jde()&&(!((o=window.event)===null||o===void 0||(r=o.type)===null||r===void 0)&&r.startsWith("key"))&&e.target==="_blank"&&(gs()?i=!0:s=!0);let c=qde()&&gs()&&!S4()&&process.env.NODE_ENV!=="test"?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:i,ctrlKey:s,altKey:a,shiftKey:u}):new MouseEvent("click",{metaKey:i,ctrlKey:s,altKey:a,shiftKey:u,bubbles:!0,cancelable:!0});vs.isOpening=n,Wo(e),e.dispatchEvent(c),vs.isOpening=!1}vs.isOpening=!1;function Vde(e,t){if(e instanceof HTMLAnchorElement)t(e);else if(e.hasAttribute("data-href")){let n=document.createElement("a");n.href=e.getAttribute("data-href"),e.hasAttribute("data-target")&&(n.target=e.getAttribute("data-target")),e.hasAttribute("data-rel")&&(n.rel=e.getAttribute("data-rel")),e.hasAttribute("data-download")&&(n.download=e.getAttribute("data-download")),e.hasAttribute("data-ping")&&(n.ping=e.getAttribute("data-ping")),e.hasAttribute("data-referrer-policy")&&(n.referrerPolicy=e.getAttribute("data-referrer-policy")),e.appendChild(n),t(n),e.removeChild(n)}}function Kde(e,t){Vde(e,n=>vs(n,t))}function Hde(e){let t=ww();var n;const r=t.useHref((n=e.href)!==null&&n!==void 0?n:"");return{"data-href":e.href?r:void 0,"data-target":e.target,"data-rel":e.rel,"data-download":e.download,"data-ping":e.ping,"data-referrer-policy":e.referrerPolicy}}let yi=new Map,jb=new Set;function WT(){if(typeof window>"u")return;function e(r){return"propertyName"in r}let t=r=>{if(!e(r)||!r.target)return;let o=yi.get(r.target);o||(o=new Set,yi.set(r.target,o),r.target.addEventListener("transitioncancel",n,{once:!0})),o.add(r.propertyName)},n=r=>{if(!e(r)||!r.target)return;let o=yi.get(r.target);if(o&&(o.delete(r.propertyName),o.size===0&&(r.target.removeEventListener("transitioncancel",n),yi.delete(r.target)),yi.size===0)){for(let i of jb)i();jb.clear()}};document.body.addEventListener("transitionrun",t),document.body.addEventListener("transitionend",n)}typeof document<"u"&&(document.readyState!=="loading"?WT():document.addEventListener("DOMContentLoaded",WT));function Wde(){for(const[e]of yi)"isConnected"in e&&!e.isConnected&&yi.delete(e)}function P4(e){requestAnimationFrame(()=>{Wde(),yi.size===0?e():jb.add(e)})}function hh(){let e=D.useRef(new Map),t=D.useCallback((o,i,s,a)=>{let u=a?.once?(...c)=>{e.current.delete(s),s(...c)}:s;e.current.set(s,{type:i,eventTarget:o,fn:u,options:a}),o.addEventListener(i,u,a)},[]),n=D.useCallback((o,i,s,a)=>{var u;let c=((u=e.current.get(s))===null||u===void 0?void 0:u.fn)||s;o.removeEventListener(i,c,a),e.current.delete(s)},[]),r=D.useCallback(()=>{e.current.forEach((o,i)=>{n(o.eventTarget,o.type,i,o.options)})},[n]);return D.useEffect(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function Ude(e,t){let{id:n,"aria-label":r,"aria-labelledby":o}=e;return n=Ho(n),o&&r?o=[...new Set([n,...o.trim().split(/\s+/)])].join(" "):o&&(o=o.trim().split(/\s+/).join(" ")),!r&&!o&&t&&(r=t),{id:n,"aria-label":r,"aria-labelledby":o}}function gh(e){const t=D.useRef(null),n=D.useRef(void 0),r=D.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 D.useMemo(()=>({get current(){return t.current},set current(o){t.current=o,n.current&&(n.current(),n.current=void 0),o!=null&&(n.current=r(o))}}),[r])}function zde(e,t){const n=D.useRef(!0),r=D.useRef(null);D.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[]),D.useEffect(()=>{let o=r.current;n.current?n.current=!1:(!o||t.some((i,s)=>!Object.is(i,o[s])))&&e(),r.current=t},t)}function UT(e,t){const n=D.useRef(!0),r=D.useRef(null);sn(()=>(n.current=!0,()=>{n.current=!1}),[]),sn(()=>{n.current?n.current=!1:(!r.current||t.some((o,i)=>!Object.is(o,r[i])))&&e(),r.current=t},t)}function T4(e,t){sn(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref&&(e.ref.current=null)}})}function ud(e,t){if(!e)return!1;let n=window.getComputedStyle(e),r=/(auto|scroll)/.test(n.overflow+n.overflowX+n.overflowY);return r&&t&&(r=e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth),r}function es(e,t){let n=e;for(ud(n,t)&&(n=n.parentElement);n&&!ud(n,t);)n=n.parentElement;return n||document.scrollingElement||document.documentElement}function Gde(e,t){const n=[];for(;e&&e!==document.documentElement;)ud(e,t)&&n.push(e),e=e.parentElement;return n}function Qs(e){return gs()?e.metaKey:e.ctrlKey}let Yde=0;const Mv=new Map;function _4(e){let[t,n]=D.useState();return sn(()=>{if(!e)return;let r=Mv.get(e);if(r)n(r.element.id);else{let o=`react-aria-description-${Yde++}`;n(o);let i=document.createElement("div");i.id=o,i.style.display="none",i.textContent=e,document.body.appendChild(i),r={refCount:0,element:i},Mv.set(e,r)}return r.refCount++,()=>{r&&--r.refCount===0&&(r.element.remove(),Mv.delete(e))}},[e]),{"aria-describedby":e?t:void 0}}function vp(e,t,n,r){let o=Kn(n),i=n==null;D.useEffect(()=>{if(i||!e.current)return;let s=e.current;return s.addEventListener(t,o,r),()=>{s.removeEventListener(t,o,r)}},[e,t,r,i,o])}function O4(e,t){let n=zT(e,t,"left"),r=zT(e,t,"top"),o=t.offsetWidth,i=t.offsetHeight,s=e.scrollLeft,a=e.scrollTop,{borderTopWidth:u,borderLeftWidth:c,scrollPaddingTop:f,scrollPaddingRight:p,scrollPaddingBottom:m,scrollPaddingLeft:b}=getComputedStyle(e),{scrollMarginTop:y,scrollMarginRight:v,scrollMarginBottom:E,scrollMarginLeft:x}=getComputedStyle(t),R=s+parseInt(c,10),P=a+parseInt(u,10),O=R+e.clientWidth,S=P+e.clientHeight,T=parseInt(f,10)||0,_=parseInt(m,10)||0,$=parseInt(p,10)||0,V=parseInt(b,10)||0,U=parseInt(y,10)||0,A=parseInt(E,10)||0,H=parseInt(v,10)||0,F=parseInt(x,10)||0,N=n-F,j=n+o+H,I=r-U,k=r+i+A,q=s+parseInt(c,10)+V,z=O-$,W=a+parseInt(u,10)+T,te=S-_;if((N>q||j<z)&&(N<=s+V?s=N-parseInt(c,10)-V:j>O-$&&(s+=j-O+$)),(I>W||k<te)&&(I<=P+T?a=I-parseInt(u,10)-T:k>S-_&&(a+=k-S+_)),process.env.NODE_ENV==="test"){e.scrollLeft=s,e.scrollTop=a;return}e.scrollTo({left:s,top:a})}function zT(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){o-=e[r];break}t=t.offsetParent}return o}function bi(e,t){if(e&&document.contains(e)){let s=document.scrollingElement||document.documentElement;if(!(window.getComputedStyle(s).overflow==="hidden")&&!yw()){var n;let{left:u,top:c}=e.getBoundingClientRect();e==null||(n=e.scrollIntoView)===null||n===void 0||n.call(e,{block:"nearest"});let{left:f,top:p}=e.getBoundingClientRect();if(Math.abs(u-f)>1||Math.abs(c-p)>1){var r,o,i;t==null||(o=t.containingElement)===null||o===void 0||(r=o.scrollIntoView)===null||r===void 0||r.call(o,{block:"center",inline:"center"}),(i=e.scrollIntoView)===null||i===void 0||i.call(e,{block:"nearest"})}}else{let u=Gde(e);for(let c of u)O4(c,e)}}}function Bb(e){return e.pointerType===""&&e.isTrusted?!0:xw()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Xde(e){return!xw()&&e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"}function Zde(e,t){let{collection:n,onLoadMore:r,scrollOffset:o=1}=e,i=D.useRef(null),s=Kn(a=>{for(let u of a)u.isIntersecting&&r&&r()});sn(()=>(t.current&&(i.current=new IntersectionObserver(s,{root:es(t?.current),rootMargin:`0px ${100*o}% ${100*o}% ${100*o}%`}),i.current.observe(t.current)),()=>{i.current&&i.current.disconnect()}),[n,s,t,o])}function Qde(e){const t=D.version.split(".");return parseInt(t[0],10)>=19?e:e?"true":void 0}const Jde="react-aria-clear-focus",efe="react-aria-focus",tfe=typeof Element<"u"&&"checkVisibility"in Element.prototype;function nfe(e){const t=Tr(e);if(!(e instanceof t.HTMLElement)&&!(e instanceof t.SVGElement))return!1;let{display:n,visibility:r}=e.style,o=n!=="none"&&r!=="hidden"&&r!=="collapse";if(o){const{getComputedStyle:i}=e.ownerDocument.defaultView;let{display:s,visibility:a}=i(e);o=s!=="none"&&a!=="hidden"&&a!=="collapse"}return o}function rfe(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 Ew(e,t){return tfe?e.checkVisibility({visibilityProperty:!0})&&!e.closest("[data-react-aria-prevent-focus]"):e.nodeName!=="#comment"&&nfe(e)&&rfe(e,t)&&(!e.parentElement||Ew(e.parentElement,e))}const Cw=["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"],ofe=Cw.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";Cw.push('[tabindex]:not([tabindex="-1"]):not([disabled])');const ife=Cw.join(':not([hidden]):not([tabindex="-1"]),');function $4(e){return e.matches(ofe)&&Ew(e)&&!D4(e)}function sfe(e){return e.matches(ife)&&Ew(e)&&!D4(e)}function D4(e){let t=e;for(;t!=null;){if(t instanceof t.ownerDocument.defaultView.HTMLElement&&t.inert)return!0;t=t.parentElement}return!1}function Rw(e,t,n){let[r,o]=D.useState(e||t),i=D.useRef(e!==void 0),s=e!==void 0;D.useEffect(()=>{let c=i.current;c!==s&&process.env.NODE_ENV!=="production"&&console.warn(`WARN: A component changed from ${c?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}.`),i.current=s},[s]);let a=s?e:r,u=D.useCallback((c,...f)=>{let p=(m,...b)=>{n&&(Object.is(a,m)||n(m,...b)),s||(a=m)};typeof c=="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,...y)=>{let v=c(s?a:b,...y);return p(v,...f),s?b:v})):(s||o(c),p(c,...f))},[s,a,n]);return[a,u]}const M4=Symbol("default");function A4({values:e,children:t}){for(let[n,r]of e)t=D.createElement(n.Provider,{value:r},t);return t}function Pa(e){let{className:t,style:n,children:r,defaultClassName:o,defaultChildren:i,defaultStyle:s,values:a}=e;return D.useMemo(()=>{let u,c,f;return typeof t=="function"?u=t({...a,defaultClassName:o}):u=t,typeof n=="function"?c=n({...a,defaultStyle:s||{}}):c=n,typeof r=="function"?f=r({...a,defaultChildren:i}):r==null?f=i:f=r,{className:u??o,style:c||s?{...s,...c}:void 0,children:f??i,"data-rac":""}},[t,n,r,o,i,s,a])}function N4(e,t){return n=>t(typeof e=="function"?e(n):e,n)}function afe(e,t){let n=D.useContext(e);if(t===null)return null;if(n&&typeof n=="object"&&"slots"in n&&n.slots){let r=t||M4;if(!n.slots[r]){let o=new Intl.ListFormat().format(Object.keys(n.slots).map(s=>`"${s}"`)),i=t?`Invalid slot "${t}".`:"A slot prop is required.";throw new Error(`${i} Valid slot names are ${o}.`)}return n.slots[r]}return n}function I4(e,t,n){let r=afe(n,e.slot)||{},{ref:o,...i}=r,s=gh(D.useMemo(()=>_de(t,o),[t,o])),a=wn(i,e);return"style"in i&&i.style&&"style"in e&&e.style&&(typeof i.style=="function"||typeof e.style=="function"?a.style=u=>{let c=typeof i.style=="function"?i.style(u):i.style,f={...u.defaultStyle,...c},p=typeof e.style=="function"?e.style({...u,defaultStyle:f}):e.style;return{...f,...p}}:a.style={...i.style,...e.style}),[a,s]}const k4=7e3;let ro=null;function Vb(e,t="assertive",n=k4){ro?ro.announce(e,t,n):(ro=new lfe,(typeof IS_REACT_ACT_ENVIRONMENT=="boolean"?IS_REACT_ACT_ENVIRONMENT:typeof jest<"u")?ro.announce(e,t,n):setTimeout(()=>{ro?.isAttached()&&ro?.announce(e,t,n)},100))}class lfe{isAttached(){var t;return(t=this.node)===null||t===void 0?void 0:t.isConnected}createLog(t){let n=document.createElement("div");return n.setAttribute("role","log"),n.setAttribute("aria-live",t),n.setAttribute("aria-relevant","additions"),n}destroy(){this.node&&(document.body.removeChild(this.node),this.node=null)}announce(t,n="assertive",r=k4){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,n==="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()},r)}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 ufe=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),cfe=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function dfe(e){if(Intl.Locale){let n=new Intl.Locale(e).maximize(),r=typeof n.getTextInfo=="function"?n.getTextInfo():n.textInfo;if(r)return r.direction==="rtl";if(n.script)return ufe.has(n.script)}let t=e.split("-")[0];return cfe.has(t)}const ffe=Symbol.for("react-aria.i18n.locale");function F4(){let e=typeof window<"u"&&window[ffe]||typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:dfe(e)?"rtl":"ltr"}}let Kb=F4(),Wc=new Set;function GT(){Kb=F4();for(let e of Wc)e(Kb)}function pfe(){let e=Hd(),[t,n]=D.useState(Kb);return D.useEffect(()=>(Wc.size===0&&window.addEventListener("languagechange",GT),Wc.add(n),()=>{Wc.delete(n),Wc.size===0&&window.removeEventListener("languagechange",GT)}),[]),e?{locale:"en-US",direction:"ltr"}:t}const mfe=D.createContext(null);function Wd(){let e=pfe();return D.useContext(mfe)||e}const hfe=Symbol.for("react-aria.i18n.locale"),gfe=Symbol.for("react-aria.i18n.strings");let zs;class vh{getStringForLocale(t,n){let o=this.getStringsForLocale(n)[t];if(!o)throw new Error(`Could not find intl message ${t} in ${n} locale`);return o}getStringsForLocale(t){let n=this.strings[t];return n||(n=vfe(t,this.strings,this.defaultLocale),this.strings[t]=n),n}static getGlobalDictionaryForPackage(t){if(typeof window>"u")return null;let n=window[hfe];if(zs===void 0){let o=window[gfe];if(!o)return null;zs={};for(let i in o)zs[i]=new vh({[n]:o[i]},n)}let r=zs?.[t];if(!r)throw new Error(`Strings for package "${t}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);return r}constructor(t,n="en-US"){this.strings=Object.fromEntries(Object.entries(t).filter(([,r])=>r)),this.defaultLocale=n}}function vfe(e,t,n="en-US"){if(t[e])return t[e];let r=bfe(e);if(t[r])return t[r];for(let o in t)if(o.startsWith(r+"-"))return t[o];return t[n]}function bfe(e){return Intl.Locale?new Intl.Locale(e).language:e.split("-")[0]}const YT=new Map,XT=new Map;class yfe{format(t,n){let r=this.strings.getStringForLocale(t,this.locale);return typeof r=="function"?r(n,this):r}plural(t,n,r="cardinal"){let o=n["="+t];if(o)return typeof o=="function"?o():o;let i=this.locale+":"+r,s=YT.get(i);s||(s=new Intl.PluralRules(this.locale,{type:r}),YT.set(i,s));let a=s.select(t);return o=n[a]||n.other,typeof o=="function"?o():o}number(t){let n=XT.get(this.locale);return n||(n=new Intl.NumberFormat(this.locale),XT.set(this.locale,n)),n.format(t)}select(t,n){let r=t[n]||t.other;return typeof r=="function"?r():r}constructor(t,n){this.locale=t,this.strings=n}}const ZT=new WeakMap;function xfe(e){let t=ZT.get(e);return t||(t=new vh(e),ZT.set(e,t)),t}function wfe(e,t){return t&&vh.getGlobalDictionaryForPackage(t)||xfe(e)}function bh(e,t){let{locale:n}=Wd(),r=wfe(e,t);return D.useMemo(()=>new yfe(n,r),[n,r])}function Efe(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Cfe(e,t,n){Efe(e,t),t.set(e,n)}let Av=new Map;function L4(e){let{locale:t}=Wd(),n=t+(e?Object.entries(e).sort((o,i)=>o[0]<i[0]?-1:1).join():"");if(Av.has(n))return Av.get(n);let r=new Intl.Collator(t,e);return Av.set(n,r),r}function Sw(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function q4(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function j4(e){let t=D.useRef({isFocused:!1,observer:null});sn(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=Kn(r=>{e?.(r)});return D.useCallback(r=>{if(r.target instanceof HTMLButtonElement||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLSelectElement){t.current.isFocused=!0;let o=r.target,i=s=>{if(t.current.isFocused=!1,o.disabled){let a=Sw(s);n(a)}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 a=o===document.activeElement?null:document.activeElement;o.dispatchEvent(new FocusEvent("blur",{relatedTarget:a})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:a}))}}),t.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[n])}let fm=!1;function QT(e){for(;e&&!$4(e);)e=e.parentElement;let t=Tr(e),n=t.document.activeElement;if(!n||n===e)return;fm=!0;let r=!1,o=f=>{(f.target===n||r)&&f.stopImmediatePropagation()},i=f=>{(f.target===n||r)&&(f.stopImmediatePropagation(),!e&&!r&&(r=!0,Wo(n),u()))},s=f=>{(f.target===e||r)&&f.stopImmediatePropagation()},a=f=>{(f.target===e||r)&&(f.stopImmediatePropagation(),r||(r=!0,Wo(n),u()))};t.addEventListener("blur",o,!0),t.addEventListener("focusout",i,!0),t.addEventListener("focusin",a,!0),t.addEventListener("focus",s,!0);let u=()=>{cancelAnimationFrame(c),t.removeEventListener("blur",o,!0),t.removeEventListener("focusout",i,!0),t.removeEventListener("focusin",a,!0),t.removeEventListener("focus",s,!0),fm=!1,r=!1},c=requestAnimationFrame(u);return u}let Js="default",Hb="",Dp=new WeakMap;function JT(e){if(bw()){if(Js==="default"){const t=xt(e);Hb=t.documentElement.style.webkitUserSelect,t.documentElement.style.webkitUserSelect="none"}Js="disabled"}else if(e instanceof HTMLElement||e instanceof SVGElement){let t="userSelect"in e.style?"userSelect":"webkitUserSelect";Dp.set(e,e.style[t]),e.style[t]="none"}}function Nv(e){if(bw()){if(Js!=="disabled")return;Js="restoring",setTimeout(()=>{P4(()=>{if(Js==="restoring"){const t=xt(e);t.documentElement.style.webkitUserSelect==="none"&&(t.documentElement.style.webkitUserSelect=Hb||""),Hb="",Js="default"}})},300)}else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&Dp.has(e)){let t=Dp.get(e),n="userSelect"in e.style?"userSelect":"webkitUserSelect";e.style[n]==="none"&&(e.style[n]=t),e.getAttribute("style")===""&&e.removeAttribute("style"),Dp.delete(e)}}const B4=D.createContext({register:()=>{}});B4.displayName="PressResponderContext";function Rfe(e,t){return t.get?t.get.call(e):t.value}function V4(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function Sfe(e,t){var n=V4(e,t,"get");return Rfe(e,n)}function Pfe(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}function e_(e,t,n){var r=V4(e,t,"set");return Pfe(e,r,n),n}function Tfe(e){let t=D.useContext(B4);if(t){let{register:n,...r}=t;e=wn(r,e),n()}return T4(t,e.ref),e}var bp=new WeakMap;class yp{continuePropagation(){e_(this,bp,!1)}get shouldStopPropagation(){return Sfe(this,bp)}constructor(t,n,r,o){Cfe(this,bp,{writable:!0,value:void 0}),e_(this,bp,!0);var i;let s=(i=o?.target)!==null&&i!==void 0?i:r.currentTarget;const a=s?.getBoundingClientRect();let u,c=0,f,p=null;r.clientX!=null&&r.clientY!=null&&(f=r.clientX,p=r.clientY),a&&(f!=null&&p!=null?(u=f-a.left,c=p-a.top):(u=a.width/2,c=a.height/2)),this.type=t,this.pointerType=n,this.target=r.currentTarget,this.shiftKey=r.shiftKey,this.metaKey=r.metaKey,this.ctrlKey=r.ctrlKey,this.altKey=r.altKey,this.x=u,this.y=c}}const t_=Symbol("linkClicked"),n_="react-aria-pressable-style",r_="data-react-aria-pressable";function Pw(e){let{onPress:t,onPressChange:n,onPressStart:r,onPressEnd:o,onPressUp:i,onClick:s,isDisabled:a,isPressed:u,preventFocusOnPress:c,shouldCancelOnPointerExit:f,allowTextSelectionOnPress:p,ref:m,...b}=Tfe(e),[y,v]=D.useState(!1),E=D.useRef({isPressed:!1,ignoreEmulatedMouseEvents:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null,disposables:[]}),{addGlobalListener:x,removeAllGlobalListeners:R}=hh(),P=Kn((A,H)=>{let F=E.current;if(a||F.didFirePressStart)return!1;let N=!0;if(F.isTriggeringEvent=!0,r){let j=new yp("pressstart",H,A);r(j),N=j.shouldStopPropagation}return n&&n(!0),F.isTriggeringEvent=!1,F.didFirePressStart=!0,v(!0),N}),O=Kn((A,H,F=!0)=>{let N=E.current;if(!N.didFirePressStart)return!1;N.didFirePressStart=!1,N.isTriggeringEvent=!0;let j=!0;if(o){let I=new yp("pressend",H,A);o(I),j=I.shouldStopPropagation}if(n&&n(!1),v(!1),t&&F&&!a){let I=new yp("press",H,A);t(I),j&&(j=I.shouldStopPropagation)}return N.isTriggeringEvent=!1,j}),S=Kn((A,H)=>{let F=E.current;if(a)return!1;if(i){F.isTriggeringEvent=!0;let N=new yp("pressup",H,A);return i(N),F.isTriggeringEvent=!1,N.shouldStopPropagation}return!0}),T=Kn(A=>{let H=E.current;if(H.isPressed&&H.target){H.didFirePressStart&&H.pointerType!=null&&O(Xi(H.target,A),H.pointerType,!1),H.isPressed=!1,H.isOverTarget=!1,H.activePointerId=null,H.pointerType=null,R(),p||Nv(H.target);for(let F of H.disposables)F();H.disposables=[]}}),_=Kn(A=>{f&&T(A)}),$=Kn(A=>{a||s?.(A)}),V=Kn((A,H)=>{if(!a&&s){let F=new MouseEvent("click",A);q4(F,H),s(Sw(F))}}),U=D.useMemo(()=>{let A=E.current,H={onKeyDown(N){if(Iv(N.nativeEvent,N.currentTarget)&&qt(N.currentTarget,ht(N.nativeEvent))){var j;s_(ht(N.nativeEvent),N.key)&&N.preventDefault();let I=!0;if(!A.isPressed&&!N.repeat){A.target=N.currentTarget,A.isPressed=!0,A.pointerType="keyboard",I=P(N,"keyboard");let k=N.currentTarget,q=z=>{Iv(z,k)&&!z.repeat&&qt(k,ht(z))&&A.target&&S(Xi(A.target,z),"keyboard")};x(xt(N.currentTarget),"keyup",fh(q,F),!0)}I&&N.stopPropagation(),N.metaKey&&gs()&&((j=A.metaKeyEvents)===null||j===void 0||j.set(N.key,N.nativeEvent))}else N.key==="Meta"&&(A.metaKeyEvents=new Map)},onClick(N){if(!(N&&!qt(N.currentTarget,ht(N.nativeEvent)))&&N&&N.button===0&&!A.isTriggeringEvent&&!vs.isOpening){let j=!0;if(a&&N.preventDefault(),!A.ignoreEmulatedMouseEvents&&!A.isPressed&&(A.pointerType==="virtual"||Bb(N.nativeEvent))){let I=P(N,"virtual"),k=S(N,"virtual"),q=O(N,"virtual");$(N),j=I&&k&&q}else if(A.isPressed&&A.pointerType!=="keyboard"){let I=A.pointerType||N.nativeEvent.pointerType||"virtual",k=S(Xi(N.currentTarget,N),I),q=O(Xi(N.currentTarget,N),I,!0);j=k&&q,A.isOverTarget=!1,$(N),T(N)}A.ignoreEmulatedMouseEvents=!1,j&&N.stopPropagation()}}},F=N=>{var j;if(A.isPressed&&A.target&&Iv(N,A.target)){var I;s_(ht(N),N.key)&&N.preventDefault();let q=ht(N),z=qt(A.target,ht(N));O(Xi(A.target,N),"keyboard",z),z&&V(N,A.target),R(),N.key!=="Enter"&&Tw(A.target)&&qt(A.target,q)&&!N[t_]&&(N[t_]=!0,vs(A.target,N,!1)),A.isPressed=!1,(I=A.metaKeyEvents)===null||I===void 0||I.delete(N.key)}else if(N.key==="Meta"&&(!((j=A.metaKeyEvents)===null||j===void 0)&&j.size)){var k;let q=A.metaKeyEvents;A.metaKeyEvents=void 0;for(let z of q.values())(k=A.target)===null||k===void 0||k.dispatchEvent(new KeyboardEvent("keyup",z))}};if(typeof PointerEvent<"u"){H.onPointerDown=I=>{if(I.button!==0||!qt(I.currentTarget,ht(I.nativeEvent)))return;if(Xde(I.nativeEvent)){A.pointerType="virtual";return}A.pointerType=I.pointerType;let k=!0;if(!A.isPressed){A.isPressed=!0,A.isOverTarget=!0,A.activePointerId=I.pointerId,A.target=I.currentTarget,p||JT(A.target),k=P(I,A.pointerType);let q=ht(I.nativeEvent);"releasePointerCapture"in q&&q.releasePointerCapture(I.pointerId),x(xt(I.currentTarget),"pointerup",N,!1),x(xt(I.currentTarget),"pointercancel",j,!1)}k&&I.stopPropagation()},H.onMouseDown=I=>{if(qt(I.currentTarget,ht(I.nativeEvent))&&I.button===0){if(c){let k=QT(I.target);k&&A.disposables.push(k)}I.stopPropagation()}},H.onPointerUp=I=>{!qt(I.currentTarget,ht(I.nativeEvent))||A.pointerType==="virtual"||I.button===0&&!A.isPressed&&S(I,A.pointerType||I.pointerType)},H.onPointerEnter=I=>{I.pointerId===A.activePointerId&&A.target&&!A.isOverTarget&&A.pointerType!=null&&(A.isOverTarget=!0,P(Xi(A.target,I),A.pointerType))},H.onPointerLeave=I=>{I.pointerId===A.activePointerId&&A.target&&A.isOverTarget&&A.pointerType!=null&&(A.isOverTarget=!1,O(Xi(A.target,I),A.pointerType,!1),_(I))};let N=I=>{if(I.pointerId===A.activePointerId&&A.isPressed&&I.button===0&&A.target){if(qt(A.target,ht(I))&&A.pointerType!=null){let k=!1,q=setTimeout(()=>{A.isPressed&&A.target instanceof HTMLElement&&(k?T(I):(Wo(A.target),A.target.click()))},80);x(I.currentTarget,"click",()=>k=!0,!0),A.disposables.push(()=>clearTimeout(q))}else T(I);A.isOverTarget=!1}},j=I=>{T(I)};H.onDragStart=I=>{qt(I.currentTarget,ht(I.nativeEvent))&&T(I)}}else if(process.env.NODE_ENV==="test"){H.onMouseDown=I=>{if(I.button!==0||!qt(I.currentTarget,ht(I.nativeEvent)))return;if(A.ignoreEmulatedMouseEvents){I.stopPropagation();return}if(A.isPressed=!0,A.isOverTarget=!0,A.target=I.currentTarget,A.pointerType=Bb(I.nativeEvent)?"virtual":"mouse",Wr.flushSync(()=>P(I,A.pointerType))&&I.stopPropagation(),c){let q=QT(I.target);q&&A.disposables.push(q)}x(xt(I.currentTarget),"mouseup",N,!1)},H.onMouseEnter=I=>{if(!qt(I.currentTarget,ht(I.nativeEvent)))return;let k=!0;A.isPressed&&!A.ignoreEmulatedMouseEvents&&A.pointerType!=null&&(A.isOverTarget=!0,k=P(I,A.pointerType)),k&&I.stopPropagation()},H.onMouseLeave=I=>{if(!qt(I.currentTarget,ht(I.nativeEvent)))return;let k=!0;A.isPressed&&!A.ignoreEmulatedMouseEvents&&A.pointerType!=null&&(A.isOverTarget=!1,k=O(I,A.pointerType,!1),_(I)),k&&I.stopPropagation()},H.onMouseUp=I=>{qt(I.currentTarget,ht(I.nativeEvent))&&!A.ignoreEmulatedMouseEvents&&I.button===0&&!A.isPressed&&S(I,A.pointerType||"mouse")};let N=I=>{if(I.button===0){if(A.ignoreEmulatedMouseEvents){A.ignoreEmulatedMouseEvents=!1;return}A.target&&A.target.contains(I.target)&&A.pointerType!=null||T(I),A.isOverTarget=!1}};H.onTouchStart=I=>{if(!qt(I.currentTarget,ht(I.nativeEvent)))return;let k=_fe(I.nativeEvent);if(!k)return;A.activePointerId=k.identifier,A.ignoreEmulatedMouseEvents=!0,A.isOverTarget=!0,A.isPressed=!0,A.target=I.currentTarget,A.pointerType="touch",p||JT(A.target),P(pi(A.target,I),A.pointerType)&&I.stopPropagation(),x(Tr(I.currentTarget),"scroll",j,!0)},H.onTouchMove=I=>{if(!qt(I.currentTarget,ht(I.nativeEvent)))return;if(!A.isPressed){I.stopPropagation();return}let k=o_(I.nativeEvent,A.activePointerId),q=!0;k&&i_(k,I.currentTarget)?!A.isOverTarget&&A.pointerType!=null&&(A.isOverTarget=!0,q=P(pi(A.target,I),A.pointerType)):A.isOverTarget&&A.pointerType!=null&&(A.isOverTarget=!1,q=O(pi(A.target,I),A.pointerType,!1),_(pi(A.target,I))),q&&I.stopPropagation()},H.onTouchEnd=I=>{if(!qt(I.currentTarget,ht(I.nativeEvent)))return;if(!A.isPressed){I.stopPropagation();return}let k=o_(I.nativeEvent,A.activePointerId),q=!0;k&&i_(k,I.currentTarget)&&A.pointerType!=null?(S(pi(A.target,I),A.pointerType),q=O(pi(A.target,I),A.pointerType),V(I.nativeEvent,A.target)):A.isOverTarget&&A.pointerType!=null&&(q=O(pi(A.target,I),A.pointerType,!1)),q&&I.stopPropagation(),A.isPressed=!1,A.activePointerId=null,A.isOverTarget=!1,A.ignoreEmulatedMouseEvents=!0,A.target&&!p&&Nv(A.target),R()},H.onTouchCancel=I=>{qt(I.currentTarget,ht(I.nativeEvent))&&(I.stopPropagation(),A.isPressed&&T(pi(A.target,I)))};let j=I=>{A.isPressed&&qt(ht(I),A.target)&&T({currentTarget:A.target,shiftKey:!1,ctrlKey:!1,metaKey:!1,altKey:!1})};H.onDragStart=I=>{qt(I.currentTarget,ht(I.nativeEvent))&&T(I)}}return H},[x,a,c,R,p,T,_,O,P,S,$,V]);return D.useEffect(()=>{if(!m||process.env.NODE_ENV==="test")return;const A=xt(m.current);if(!A||!A.head||A.getElementById(n_))return;const H=A.createElement("style");H.id=n_,H.textContent=`
|
|
136
136
|
@layer {
|
|
137
137
|
[${r_}] {
|
|
138
138
|
touch-action: pan-x pan-y pinch-zoom;
|