react-semaphor 0.0.285 → 0.0.286

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.
@@ -85,7 +85,7 @@ __p += '`),It&&(Pe+=`' +
85
85
  function print() { __p += __j.call(arguments, '') }
86
86
  `:`;
87
87
  `)+Pe+`return __p
88
- }`;var xt=IR(function(){return zt(V,Ye+"return "+Pe).apply(n,Y)});if(xt.source=Pe,Ub(xt))throw xt;return xt}function bz(d){return Gt(d).toLowerCase()}function yz(d){return Gt(d).toUpperCase()}function xz(d,g,x){if(d=Gt(d),d&&(x||g===n))return WS(d);if(!d||!(g=Ur(g)))return d;var P=zo(d),k=zo(g),V=US(P,k),Y=GS(P,k)+1;return As(P,V,Y).join("")}function wz(d,g,x){if(d=Gt(d),d&&(x||g===n))return d.slice(0,YS(d)+1);if(!d||!(g=Ur(g)))return d;var P=zo(d),k=GS(P,zo(g))+1;return As(P,0,k).join("")}function _z(d,g,x){if(d=Gt(d),d&&(x||g===n))return d.replace(Vn,"");if(!d||!(g=Ur(g)))return d;var P=zo(d),k=US(P,zo(g));return As(P,k).join("")}function Cz(d,g){var x=L,P=j;if(wn(g)){var k="separator"in g?g.separator:k;x="length"in g?pt(g.length):x,P="omission"in g?Ur(g.omission):P}d=Gt(d);var V=d.length;if(Wl(d)){var Y=zo(d);V=Y.length}if(x>=V)return d;var ne=x-Ul(P);if(ne<1)return P;var le=Y?As(Y,0,ne).join(""):d.slice(0,ne);if(k===n)return le+P;if(Y&&(ne+=le.length-ne),Gb(k)){if(d.slice(ne).search(k)){var we,_e=le;for(k.global||(k=lb(k.source,Gt(Ge.exec(k))+"g")),k.lastIndex=0;we=k.exec(_e);)var Pe=we.index;le=le.slice(0,Pe===n?ne:Pe)}}else if(d.indexOf(Ur(k),ne)!=ne){var je=le.lastIndexOf(k);je>-1&&(le=le.slice(0,je))}return le+P}function Sz(d){return d=Gt(d),d&&$n.test(d)?d.replace(Qt,Z7):d}var Ez=Jl(function(d,g,x){return d+(x?" ":"")+g.toUpperCase()}),Kb=NE("toUpperCase");function MR(d,g,x){return d=Gt(d),g=x?n:g,g===n?Y7(d)?n6(d):j7(d):d.match(g)||[]}var IR=St(function(d,g){try{return Hr(d,n,g)}catch(x){return Ub(x)?x:new ct(x)}}),Rz=Hi(function(d,g){return yo(g,function(x){x=ci(x),Bi(d,x,Hb(d[x],d))}),d});function Pz(d){var g=d==null?0:d.length,x=Je();return d=g?yn(d,function(P){if(typeof P[1]!="function")throw new xo(s);return[x(P[0]),P[1]]}):[],St(function(P){for(var k=-1;++k<g;){var V=d[k];if(Hr(V[0],this,P))return Hr(V[1],this,P)}})}function Oz(d){return Z6(_o(d,f))}function Xb(d){return function(){return d}}function $z(d,g){return d==null||d!==d?g:d}var Tz=FE(),Dz=FE(!0);function $r(d){return d}function Qb(d){return pE(typeof d=="function"?d:_o(d,f))}function Az(d){return mE(_o(d,f))}function kz(d,g){return vE(d,_o(g,f))}var Mz=St(function(d,g){return function(x){return Fu(x,d,g)}}),Iz=St(function(d,g){return function(x){return Fu(d,x,g)}});function Jb(d,g,x){var P=Wn(g),k=Uh(g,P);x==null&&!(wn(g)&&(k.length||!P.length))&&(x=g,g=d,d=this,k=Uh(g,Wn(g)));var V=!(wn(x)&&"chain"in x)||!!x.chain,Y=Ui(d);return yo(k,function(ne){var le=g[ne];d[ne]=le,Y&&(d.prototype[ne]=function(){var we=this.__chain__;if(V||we){var _e=d(this.__wrapped__),Pe=_e.__actions__=Rr(this.__actions__);return Pe.push({func:le,args:arguments,thisArg:d}),_e.__chain__=we,_e}return le.apply(d,Rs([this.value()],arguments))})}),d}function Nz(){return qn._===this&&(qn._=l6),this}function Zb(){}function Lz(d){return d=pt(d),St(function(g){return bE(g,d)})}var Fz=Tb(yn),jz=Tb(jS),zz=Tb(tb);function NR(d){return Lb(d)?nb(ci(d)):m9(d)}function Bz(d){return function(g){return d==null?n:Oa(d,g)}}var Vz=zE(),Hz=zE(!0);function e0(){return[]}function t0(){return!1}function Wz(){return{}}function Uz(){return""}function Gz(){return!0}function qz(d,g){if(d=pt(d),d<1||d>K)return[];var x=H,P=or(d,H);g=Je(g),d-=H;for(var k=ib(P,g);++x<d;)g(x);return k}function Yz(d){return ut(d)?yn(d,ci):Gr(d)?[d]:Rr(nR(Gt(d)))}function Kz(d){var g=++s6;return Gt(d)+g}var Xz=Qh(function(d,g){return d+g},0),Qz=Db("ceil"),Jz=Qh(function(d,g){return d/g},1),Zz=Db("floor");function eB(d){return d&&d.length?Wh(d,$r,mb):n}function tB(d,g){return d&&d.length?Wh(d,Je(g,2),mb):n}function nB(d){return VS(d,$r)}function rB(d,g){return VS(d,Je(g,2))}function oB(d){return d&&d.length?Wh(d,$r,xb):n}function iB(d,g){return d&&d.length?Wh(d,Je(g,2),xb):n}var sB=Qh(function(d,g){return d*g},1),aB=Db("round"),lB=Qh(function(d,g){return d-g},0);function cB(d){return d&&d.length?ob(d,$r):0}function uB(d,g){return d&&d.length?ob(d,Je(g,2)):0}return z.after=A8,z.ary=hR,z.assign=yj,z.assignIn=PR,z.assignInWith=up,z.assignWith=xj,z.at=wj,z.before=pR,z.bind=Hb,z.bindAll=Rz,z.bindKey=gR,z.castArray=W8,z.chain=uR,z.chunk=Z9,z.compact=e4,z.concat=t4,z.cond=Pz,z.conforms=Oz,z.constant=Xb,z.countBy=c8,z.create=_j,z.curry=mR,z.curryRight=vR,z.debounce=bR,z.defaults=Cj,z.defaultsDeep=Sj,z.defer=k8,z.delay=M8,z.difference=n4,z.differenceBy=r4,z.differenceWith=o4,z.drop=i4,z.dropRight=s4,z.dropRightWhile=a4,z.dropWhile=l4,z.fill=c4,z.filter=d8,z.flatMap=p8,z.flatMapDeep=g8,z.flatMapDepth=m8,z.flatten=sR,z.flattenDeep=u4,z.flattenDepth=d4,z.flip=I8,z.flow=Tz,z.flowRight=Dz,z.fromPairs=f4,z.functions=Dj,z.functionsIn=Aj,z.groupBy=v8,z.initial=p4,z.intersection=g4,z.intersectionBy=m4,z.intersectionWith=v4,z.invert=Mj,z.invertBy=Ij,z.invokeMap=y8,z.iteratee=Qb,z.keyBy=x8,z.keys=Wn,z.keysIn=Or,z.map=op,z.mapKeys=Lj,z.mapValues=Fj,z.matches=Az,z.matchesProperty=kz,z.memoize=sp,z.merge=jj,z.mergeWith=OR,z.method=Mz,z.methodOf=Iz,z.mixin=Jb,z.negate=ap,z.nthArg=Lz,z.omit=zj,z.omitBy=Bj,z.once=N8,z.orderBy=w8,z.over=Fz,z.overArgs=L8,z.overEvery=jz,z.overSome=zz,z.partial=Wb,z.partialRight=yR,z.partition=_8,z.pick=Vj,z.pickBy=$R,z.property=NR,z.propertyOf=Bz,z.pull=w4,z.pullAll=lR,z.pullAllBy=_4,z.pullAllWith=C4,z.pullAt=S4,z.range=Vz,z.rangeRight=Hz,z.rearg=F8,z.reject=E8,z.remove=E4,z.rest=j8,z.reverse=Bb,z.sampleSize=P8,z.set=Wj,z.setWith=Uj,z.shuffle=O8,z.slice=R4,z.sortBy=D8,z.sortedUniq=k4,z.sortedUniqBy=M4,z.split=pz,z.spread=z8,z.tail=I4,z.take=N4,z.takeRight=L4,z.takeRightWhile=F4,z.takeWhile=j4,z.tap=e8,z.throttle=B8,z.thru=rp,z.toArray=SR,z.toPairs=TR,z.toPairsIn=DR,z.toPath=Yz,z.toPlainObject=RR,z.transform=Gj,z.unary=V8,z.union=z4,z.unionBy=B4,z.unionWith=V4,z.uniq=H4,z.uniqBy=W4,z.uniqWith=U4,z.unset=qj,z.unzip=Vb,z.unzipWith=cR,z.update=Yj,z.updateWith=Kj,z.values=tc,z.valuesIn=Xj,z.without=G4,z.words=MR,z.wrap=H8,z.xor=q4,z.xorBy=Y4,z.xorWith=K4,z.zip=X4,z.zipObject=Q4,z.zipObjectDeep=J4,z.zipWith=Z4,z.entries=TR,z.entriesIn=DR,z.extend=PR,z.extendWith=up,Jb(z,z),z.add=Xz,z.attempt=IR,z.camelCase=ez,z.capitalize=AR,z.ceil=Qz,z.clamp=Qj,z.clone=U8,z.cloneDeep=q8,z.cloneDeepWith=Y8,z.cloneWith=G8,z.conformsTo=K8,z.deburr=kR,z.defaultTo=$z,z.divide=Jz,z.endsWith=tz,z.eq=Vo,z.escape=nz,z.escapeRegExp=rz,z.every=u8,z.find=f8,z.findIndex=oR,z.findKey=Ej,z.findLast=h8,z.findLastIndex=iR,z.findLastKey=Rj,z.floor=Zz,z.forEach=dR,z.forEachRight=fR,z.forIn=Pj,z.forInRight=Oj,z.forOwn=$j,z.forOwnRight=Tj,z.get=qb,z.gt=X8,z.gte=Q8,z.has=kj,z.hasIn=Yb,z.head=aR,z.identity=$r,z.includes=b8,z.indexOf=h4,z.inRange=Jj,z.invoke=Nj,z.isArguments=Da,z.isArray=ut,z.isArrayBuffer=J8,z.isArrayLike=Pr,z.isArrayLikeObject=Tn,z.isBoolean=Z8,z.isBuffer=ks,z.isDate=ej,z.isElement=tj,z.isEmpty=nj,z.isEqual=rj,z.isEqualWith=oj,z.isError=Ub,z.isFinite=ij,z.isFunction=Ui,z.isInteger=xR,z.isLength=lp,z.isMap=wR,z.isMatch=sj,z.isMatchWith=aj,z.isNaN=lj,z.isNative=cj,z.isNil=dj,z.isNull=uj,z.isNumber=_R,z.isObject=wn,z.isObjectLike=En,z.isPlainObject=Wu,z.isRegExp=Gb,z.isSafeInteger=fj,z.isSet=CR,z.isString=cp,z.isSymbol=Gr,z.isTypedArray=ec,z.isUndefined=hj,z.isWeakMap=pj,z.isWeakSet=gj,z.join=b4,z.kebabCase=oz,z.last=So,z.lastIndexOf=y4,z.lowerCase=iz,z.lowerFirst=sz,z.lt=mj,z.lte=vj,z.max=eB,z.maxBy=tB,z.mean=nB,z.meanBy=rB,z.min=oB,z.minBy=iB,z.stubArray=e0,z.stubFalse=t0,z.stubObject=Wz,z.stubString=Uz,z.stubTrue=Gz,z.multiply=sB,z.nth=x4,z.noConflict=Nz,z.noop=Zb,z.now=ip,z.pad=az,z.padEnd=lz,z.padStart=cz,z.parseInt=uz,z.random=Zj,z.reduce=C8,z.reduceRight=S8,z.repeat=dz,z.replace=fz,z.result=Hj,z.round=aB,z.runInContext=se,z.sample=R8,z.size=$8,z.snakeCase=hz,z.some=T8,z.sortedIndex=P4,z.sortedIndexBy=O4,z.sortedIndexOf=$4,z.sortedLastIndex=T4,z.sortedLastIndexBy=D4,z.sortedLastIndexOf=A4,z.startCase=gz,z.startsWith=mz,z.subtract=lB,z.sum=cB,z.sumBy=uB,z.template=vz,z.times=qz,z.toFinite=Gi,z.toInteger=pt,z.toLength=ER,z.toLower=bz,z.toNumber=Eo,z.toSafeInteger=bj,z.toString=Gt,z.toUpper=yz,z.trim=xz,z.trimEnd=wz,z.trimStart=_z,z.truncate=Cz,z.unescape=Sz,z.uniqueId=Kz,z.upperCase=Ez,z.upperFirst=Kb,z.each=dR,z.eachRight=fR,z.first=aR,Jb(z,function(){var d={};return ai(z,function(g,x){Jt.call(z.prototype,x)||(d[x]=g)}),d}(),{chain:!1}),z.VERSION=r,yo(["bind","bindKey","curry","curryRight","partial","partialRight"],function(d){z[d].placeholder=z}),yo(["drop","take"],function(d,g){Mt.prototype[d]=function(x){x=x===n?1:Ln(pt(x),0);var P=this.__filtered__&&!g?new Mt(this):this.clone();return P.__filtered__?P.__takeCount__=or(x,P.__takeCount__):P.__views__.push({size:or(x,H),type:d+(P.__dir__<0?"Right":"")}),P},Mt.prototype[d+"Right"]=function(x){return this.reverse()[d](x).reverse()}}),yo(["filter","map","takeWhile"],function(d,g){var x=g+1,P=x==q||x==Q;Mt.prototype[d]=function(k){var V=this.clone();return V.__iteratees__.push({iteratee:Je(k,3),type:x}),V.__filtered__=V.__filtered__||P,V}}),yo(["head","last"],function(d,g){var x="take"+(g?"Right":"");Mt.prototype[d]=function(){return this[x](1).value()[0]}}),yo(["initial","tail"],function(d,g){var x="drop"+(g?"":"Right");Mt.prototype[d]=function(){return this.__filtered__?new Mt(this):this[x](1)}}),Mt.prototype.compact=function(){return this.filter($r)},Mt.prototype.find=function(d){return this.filter(d).head()},Mt.prototype.findLast=function(d){return this.reverse().find(d)},Mt.prototype.invokeMap=St(function(d,g){return typeof d=="function"?new Mt(this):this.map(function(x){return Fu(x,d,g)})}),Mt.prototype.reject=function(d){return this.filter(ap(Je(d)))},Mt.prototype.slice=function(d,g){d=pt(d);var x=this;return x.__filtered__&&(d>0||g<0)?new Mt(x):(d<0?x=x.takeRight(-d):d&&(x=x.drop(d)),g!==n&&(g=pt(g),x=g<0?x.dropRight(-g):x.take(g-d)),x)},Mt.prototype.takeRightWhile=function(d){return this.reverse().takeWhile(d).reverse()},Mt.prototype.toArray=function(){return this.take(H)},ai(Mt.prototype,function(d,g){var x=/^(?:filter|find|map|reject)|While$/.test(g),P=/^(?:head|last)$/.test(g),k=z[P?"take"+(g=="last"?"Right":""):g],V=P||/^find/.test(g);k&&(z.prototype[g]=function(){var Y=this.__wrapped__,ne=P?[1]:arguments,le=Y instanceof Mt,we=ne[0],_e=le||ut(Y),Pe=function($t){var It=k.apply(z,Rs([$t],ne));return P&&je?It[0]:It};_e&&x&&typeof we=="function"&&we.length!=1&&(le=_e=!1);var je=this.__chain__,Ye=!!this.__actions__.length,et=V&&!je,xt=le&&!Ye;if(!V&&_e){Y=xt?Y:new Mt(this);var tt=d.apply(Y,ne);return tt.__actions__.push({func:rp,args:[Pe],thisArg:n}),new wo(tt,je)}return et&&xt?d.apply(this,ne):(tt=this.thru(Pe),et?P?tt.value()[0]:tt.value():tt)})}),yo(["pop","push","shift","sort","splice","unshift"],function(d){var g=$h[d],x=/^(?:push|sort|unshift)$/.test(d)?"tap":"thru",P=/^(?:pop|shift)$/.test(d);z.prototype[d]=function(){var k=arguments;if(P&&!this.__chain__){var V=this.value();return g.apply(ut(V)?V:[],k)}return this[x](function(Y){return g.apply(ut(Y)?Y:[],k)})}}),ai(Mt.prototype,function(d,g){var x=z[g];if(x){var P=x.name+"";Jt.call(Kl,P)||(Kl[P]=[]),Kl[P].push({name:g,func:x})}}),Kl[Xh(n,y).name]=[{name:"wrapper",func:n}],Mt.prototype.clone=S6,Mt.prototype.reverse=E6,Mt.prototype.value=R6,z.prototype.at=t8,z.prototype.chain=n8,z.prototype.commit=r8,z.prototype.next=o8,z.prototype.plant=s8,z.prototype.reverse=a8,z.prototype.toJSON=z.prototype.valueOf=z.prototype.value=l8,z.prototype.first=z.prototype.head,Du&&(z.prototype[Du]=i8),z},Gl=r6();Ca?((Ca.exports=Gl)._=Gl,Qv._=Gl):qn._=Gl}).call(Gs)})(jg,jg.exports);var xc=jg.exports;const ll=Pl(xc);function nP({id:e,layouts:t,initialHeight:n,y:r,x:o,w:i,minH:s}){const a={i:e,x:o??0,y:r??1/0,w:i||20,h:n||35,minW:6,minH:s||10};return t||(t={}),hw.forEach(l=>{t!=null&&t[l]||(t={...t,[l]:[]});const c=t[l].reduce((u,f)=>Math.max(u,f.y+f.h),0);a.y=a.y===0?0:c,t[l].push(a)}),t}function rP(e,t){t&&hw.forEach(n=>{t!=null&&t[n]&&(t[n]=t[n].filter(r=>r.i!==e))})}function Tm(e){return Ce.getState().dashboard.globalCacheConfig}const Ce=dD()(bD((e,t)=>({isSessionExpired:!1,currentBreakpoint:"lg",dashboard:{id:"",style:Fg},showContext:!1,selectedSheetId:null,selectedCardId:null,selectedFrameId:null,selectedCard:null,showFilters:!1,isDashboardEditing:!1,isVisualEditing:!1,showDashboardJSON:!1,filteringCards:[],actions:{setInitStore:()=>{e(n=>{n.isSessionExpired=!1,n.currentBreakpoint="lg",n.dashboard={id:"",style:Fg},n.showContext=!1,n.selectedSheetId=null,n.selectedCardId=null,n.selectedFrameId=null,n.selectedCard=null,n.showFilters=!1,n.isDashboardEditing=!1,n.isVisualEditing=!1,n.showDashboardJSON=!1,n.filteringCards=[],n.selectedLensId=void 0,n.filterValues=void 0})},setGlobalCacheConfig:n=>{e(r=>{r.dashboard.globalCacheConfig=n})},setLenses:n=>{e(r=>{r.lenses=n})},setSelectedLensId:n=>{e(r=>{r.selectedLensId=n})},deleteSheet:n=>{e(r=>{var i,s,a,l;const o=(i=r.dashboard.sheets)==null?void 0:i.findIndex(c=>c.id===n);o!==void 0&&o>-1&&((s=r.dashboard.sheets)==null||s.splice(o,1),r.selectedSheetId=(l=(a=r.dashboard.sheets)==null?void 0:a[0])==null?void 0:l.id)})},addSheet:n=>{e(r=>{r.dashboard.sheets||(r.dashboard.sheets=[]);const o=r.dashboard.filters;let i={};o==null||o.forEach(a=>{hw.forEach(l=>{i!=null&&i[l]||(i={...i,[l]:[]});const c={i:a.id,x:0,y:0,w:10,h:8};i[l].push(c)})});const s={...n,layouts:i};r.dashboard.sheets.push(s)})},setGlobalStyle:n=>{e(r=>{r.dashboard.globalStyle=n})},setAIScopeTables:n=>{e(r=>{r.dashboard.aiScopeTables=n})},setIsSessionExpired:n=>{e(()=>({isSessionExpired:n}))},setCardPython:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===o.selectedSheetId);i&&xc.forEach(i.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(f=>f.id===n);c&&(c.python=r)})})},addBaseQuery:n=>{e(r=>{var o;r.dashboard.baseQueries||(r.dashboard.baseQueries=[]),(o=r.dashboard.baseQueries)==null||o.push(n)})},removeBaseQuery:n=>{e(r=>{var i,s;const o=(i=r.dashboard.baseQueries)==null?void 0:i.findIndex(a=>a.id===n);o!=null&&o>-1&&((s=r.dashboard.baseQueries)==null||s.splice(o,1))})},setBaseQueries:n=>{e(r=>{r.dashboard.baseQueries=n})},setCurrentBreakpoint:n=>{e(()=>({currentBreakpoint:n}))},setFilteringCards:n=>{e(()=>({filteringCards:n}))},addFilteringCard:n=>{e(r=>{var o;(o=r.filteringCards)==null||o.push(n)})},removeFilteringCard:n=>{e(r=>{var i,s;const o=(i=r.filteringCards)==null?void 0:i.findIndex(a=>a.id===n.id);o!==void 0&&o>-1&&((s=r.filteringCards)==null||s.splice(o,1))})},setCustomCards:n=>{e(r=>{r.dashboard.customCards=n})},setAuthToken:n=>{e(()=>({authToken:n}))},setThemeStyle:n=>{e(()=>({themeStyle:n}))},setDashboard:n=>e({dashboard:n}),setDashboardWithFilterValues:(n,r)=>{e(o=>{o.dashboard=n,o.filterValues=r})},setDashboardTheme:n=>{e(r=>{r.theme=n})},setSheets:n=>{e(r=>{r.dashboard&&(r.dashboard.sheets=n)})},setSheetTitle:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.title=r)})},setCardTitle:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&xc.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(h=>h.id===r);u&&(u.title=o)})})},setCardInfo:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===o.selectedSheetId);i&&xc.forEach(i.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(f=>f.id===n);c&&(c.info=r)})})},setCardDescription:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&xc.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(h=>h.id===r);u&&(u.description=o)})})},setCardSql:(n,r,o)=>{e(i=>{var a,l,c,u;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){const f=(c=s.cards)==null?void 0:c.find(h=>h.id===r);f&&(f.sql=o,(u=i.onUpdateCard)==null||u.call(i,f,n))}})},setFrameCardData:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&xc.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(h=>h.id===r);u&&(u.data=o)})})},setSheetLayout:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layout=r)})},setSheetLayouts:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layouts=r)})},setShowContext:n=>{e(()=>({showContext:n}))},setShowFilters:n=>{e(()=>({showFilters:n}))},setFilterValues:n=>{e(()=>({filterValues:n}))},addOrUpdateFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1?r.filterValues.splice(o,1,n):r.filterValues.push(n)}else r.filterValues=[n]})},addOrUpdateFilterValues:n=>{e(r=>{r.filterValues?n.forEach(o=>{var s,a,l;const i=(s=r==null?void 0:r.filterValues)==null?void 0:s.findIndex(c=>c.filterId===o.filterId);i!==void 0&&i>-1?(a=r.filterValues)==null||a.splice(i,1,o):(l=r.filterValues)==null||l.push(o)}):r.filterValues=n})},removeFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.filter(i=>i.filterId!==n&&!i.filterId.startsWith(n));r.filterValues=o}})},replaceFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1&&r.filterValues.splice(o,1,n)}})},addFilter:n=>{e(r=>{var i,s;r.dashboard.filters?(i=r.dashboard.filters)==null||i.push(n):r.dashboard.filters=[n],(s=r.dashboard.sheets)==null||s.find(a=>a.id===r.selectedSheetId);const o=r.dashboard.sheets;o==null||o.forEach(a=>{nP({id:n.id,layouts:a.layouts,y:0,initialHeight:8,minH:7,w:10})})})},removeFilter:n=>{e(r=>{var o,i,s;if(r.dashboard.filters){const a=(o=r.dashboard.filters)==null?void 0:o.findIndex(l=>l.id===n);if(a>-1){(i=r.dashboard.filters)==null||i.splice(a,1),(s=r.dashboard.sheets)==null||s.find(c=>c.id===r.selectedSheetId);const l=r.dashboard.sheets;l==null||l.forEach(c=>{rP(n,c.layouts)})}}})},updateFrameCard:(n,r,o)=>{e(i=>{var l,c,u,f,h;const s=(c=(l=i.dashboard)==null?void 0:l.sheets)==null?void 0:c.find(p=>p.id===n);if(!s)return;const a=(u=s==null?void 0:s.frames)==null?void 0:u.find(p=>p.id===r);if(a){const p=(f=a.cards)==null?void 0:f.findIndex(v=>v.id===o.id);p>-1&&((h=a.cards)==null||h.splice(p,1,o))}})},updateFilter:n=>{e(r=>{var o,i;if(r.dashboard.filters){const s=(o=r.dashboard.filters)==null?void 0:o.findIndex(a=>a.id===n.id);s>-1&&((i=r.dashboard.filters)==null||i.splice(s,1,n))}})},setIsDashboardEditing:n=>{e(()=>({isDashboardEditing:n}))},setShowDashboardJSON:n=>{e(()=>({showDashboardJSON:n}))},setIsVisualEditing:n=>{e(()=>({isVisualEditing:n}))},addFrame:(n,r,o)=>{e(i=>{var a,l,c,u;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){s.frames||(s.frames=[]),(c=s.frames)==null||c.push(r);let f=1/0;const h=0;o==="start"&&(f=0),nP({id:r.id,layouts:s.layouts,minH:10,x:h,y:f}),(u=i.onAddFrame)==null||u.call(i,r,n)}})},removeFrame:(n,r)=>{e(o=>{var s,a,l,c,u;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(f=>f.id===n);if(i){const f=(l=i.frames)==null?void 0:l.findIndex(h=>h.id===r);console.log(f),typeof f=="number"&&f>-1&&((c=i.frames)==null||c.splice(f,1),(u=i.layout)==null||u.splice(f,1),rP(r,i.layouts))}})},updateFrame:(n,r)=>{e(o=>{var a,l,c,u,f;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(h=>h.id===n),s=(c=i==null?void 0:i.frames)==null?void 0:c.findIndex(h=>h.id===r.id);i&&((u=i.frames)==null||u.splice(s,1,r)),(f=o.onAcceptChanges)==null||f.call(o,r,o.dashboard)})},updateCard:(n,r)=>{e(o=>{var a,l,c,u,f;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(h=>h.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(h=>h.id===r.id);i&&((u=i.cards)==null||u.splice(s,1,r),(f=o.onUpdateCard)==null||f.call(o,r,n))})},removeCard:(n,r)=>{e(o=>{var a,l,c,u,f,h;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(p=>p.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(p=>p.id===r.id);i&&((u=i.cards)==null||u.splice(s,1),(f=i.layout)==null||f.splice(s,1),(h=o.onRemoveCard)==null||h.call(o,r,n))})},setStyle:n=>{e(r=>{r.dashboard&&(r.dashboard.style=n)})},setSelectedCardId:(n,r)=>{e(o=>{var s,a,l;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===n);i&&(((l=i.cards)==null?void 0:l.find(u=>u.id===r))?o.selectedCardId=r:o.selectedCardId=null)})},setSelectedFrameId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(a=>a.id===r.selectedSheetId))&&(r.selectedFrameId=n)})},setSelectedSheetId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(a=>a.id===n))&&(r.selectedSheetId=n)})},setOnSaveFunction:n=>{e(()=>({onSaveFunction:n}))},setOnAddCard:n=>{e(()=>({onAddCard:n}))},setOnAcceptChanges:n=>{e(()=>({onAcceptChanges:n}))},setOnUpdateCard:n=>{e(()=>({onUpdateCard:n}))},setOnRemoveCard:n=>{e(()=>({onRemoveCard:n}))},setOnEvent:n=>{e(()=>({onEvent:n}))},getDashboard:()=>t().dashboard,getSelectedSheet:()=>{var n,r;return(r=(n=t().dashboard)==null?void 0:n.sheets)==null?void 0:r.find(o=>o.id===t().selectedSheetId)},getCardFrame:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a){for(let l=0;l<a.length;l++)if((i=a[l].cards)==null?void 0:i.find(u=>u.id===n))return a[l]}}},getSelectedFrame:()=>{var r,o,i;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(s=>s.id===t().selectedSheetId);return(i=n==null?void 0:n.frames)==null?void 0:i.find(s=>s.id===t().selectedFrameId)},getCard:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a)for(let l=0;l<a.length;l++){const c=(i=a[l].cards)==null?void 0:i.find(u=>u.id===n);if(c)return c}}},getSelectedSheetLayout:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layout},getSelectedSheetLayouts:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layouts},getStyle:()=>{var n;return(n=t().dashboard)==null?void 0:n.style},getCardSheet(n){var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a){for(let l=0;l<a.length;l++)if((i=a[l].cards)==null?void 0:i.find(u=>u.id===n))return r[s]}}},handleDataPointClickAction:(n,r)=>{FV({card:n,dataPoint:r,set:e,get:t})}}}))),ur=()=>Ce(e=>e.actions),jV={theme:"system",setTheme:()=>null},ED=m.createContext(jV);function zV({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[o,i]=m.useState(()=>localStorage.getItem(n)||t);m.useEffect(()=>{const a=window.document.documentElement;if(a.classList.remove("light","dark"),o==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";a.classList.add(l);return}a.classList.add(o)},[o]);const s={theme:o,setTheme:a=>{localStorage.setItem(n,a),i(a)}};return E.jsx(ED.Provider,{...r,value:s,children:e})}const RD=()=>{const e=m.useContext(ED);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};var Gf=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},nu=typeof window>"u"||"Deno"in window;function To(){}function BV(e,t){return typeof e=="function"?e(t):e}function dx(e){return typeof e=="number"&&e>=0&&e!==1/0}function PD(e,t){return Math.max(e+(t||0)-Date.now(),0)}function oP(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==mw(s,t.options))return!1}else if(!Kd(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||typeof o<"u"&&o!==t.state.fetchStatus||i&&!i(t))}function iP(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Yd(t.options.mutationKey)!==Yd(i))return!1}else if(!Kd(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function mw(e,t){return((t==null?void 0:t.queryKeyHashFn)||Yd)(e)}function Yd(e){return JSON.stringify(e,(t,n)=>hx(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Kd(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Kd(e[n],t[n])):!1}function OD(e,t){if(e===t)return e;const n=sP(e)&&sP(t);if(n||hx(e)&&hx(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),s=i.length,a=n?[]:{};let l=0;for(let c=0;c<s;c++){const u=n?c:i[c];!n&&e[u]===void 0&&t[u]===void 0&&r.includes(u)?(a[u]=void 0,l++):(a[u]=OD(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return o===s&&l===o?e:a}return t}function fx(e,t){if(e&&!t||t&&!e)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function sP(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function hx(e){if(!aP(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!aP(n)||!n.hasOwnProperty("isPrototypeOf"))}function aP(e){return Object.prototype.toString.call(e)==="[object Object]"}function VV(e){return new Promise(t=>{setTimeout(t,e)})}function px(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?OD(e,t):t}function HV(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function WV(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var el,qs,Lc,qT,UV=(qT=class extends Gf{constructor(){super();Xe(this,el,void 0);Xe(this,qs,void 0);Xe(this,Lc,void 0);Ve(this,Lc,t=>{if(!nu&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){ae(this,qs)||this.setEventListener(ae(this,Lc))}onUnsubscribe(){var t;this.hasListeners()||((t=ae(this,qs))==null||t.call(this),Ve(this,qs,void 0))}setEventListener(t){var n;Ve(this,Lc,t),(n=ae(this,qs))==null||n.call(this),Ve(this,qs,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){ae(this,el)!==t&&(Ve(this,el,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof ae(this,el)=="boolean"?ae(this,el):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},el=new WeakMap,qs=new WeakMap,Lc=new WeakMap,qT),zg=new UV,Fc,Ys,jc,YT,GV=(YT=class extends Gf{constructor(){super();Xe(this,Fc,!0);Xe(this,Ys,void 0);Xe(this,jc,void 0);Ve(this,jc,t=>{if(!nu&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){ae(this,Ys)||this.setEventListener(ae(this,jc))}onUnsubscribe(){var t;this.hasListeners()||((t=ae(this,Ys))==null||t.call(this),Ve(this,Ys,void 0))}setEventListener(t){var n;Ve(this,jc,t),(n=ae(this,Ys))==null||n.call(this),Ve(this,Ys,t(this.setOnline.bind(this)))}setOnline(t){ae(this,Fc)!==t&&(Ve(this,Fc,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return ae(this,Fc)}},Fc=new WeakMap,Ys=new WeakMap,jc=new WeakMap,YT),Bg=new GV;function qV(e){return Math.min(1e3*2**e,3e4)}function Dm(e){return(e??"online")==="online"?Bg.isOnline():!0}var $D=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function u0(e){return e instanceof $D}function TD(e){let t=!1,n=0,r=!1,o,i,s;const a=new Promise((w,y)=>{i=w,s=y}),l=w=>{var y;r||(p(new $D(w)),(y=e.abort)==null||y.call(e))},c=()=>{t=!0},u=()=>{t=!1},f=()=>!zg.isFocused()||e.networkMode!=="always"&&!Bg.isOnline(),h=w=>{var y;r||(r=!0,(y=e.onSuccess)==null||y.call(e,w),o==null||o(),i(w))},p=w=>{var y;r||(r=!0,(y=e.onError)==null||y.call(e,w),o==null||o(),s(w))},v=()=>new Promise(w=>{var y;o=_=>{const C=r||!f();return C&&w(_),C},(y=e.onPause)==null||y.call(e)}).then(()=>{var w;o=void 0,r||(w=e.onContinue)==null||w.call(e)}),b=()=>{if(r)return;let w;try{w=e.fn()}catch(y){w=Promise.reject(y)}Promise.resolve(w).then(h).catch(y=>{var $;if(r)return;const _=e.retry??(nu?0:3),C=e.retryDelay??qV,R=typeof C=="function"?C(n,y):C,S=_===!0||typeof _=="number"&&n<_||typeof _=="function"&&_(n,y);if(t||!S){p(y);return}n++,($=e.onFail)==null||$.call(e,n,y),VV(R).then(()=>{if(f())return v()}).then(()=>{t?p(y):b()})})};return Dm(e.networkMode)?b():v().then(b),{promise:a,cancel:l,continue:()=>(o==null?void 0:o())?a:Promise.resolve(),cancelRetry:c,continueRetry:u}}function YV(){let e=[],t=0,n=h=>{h()},r=h=>{h()},o=h=>setTimeout(h,0);const i=h=>{o=h},s=h=>{let p;t++;try{p=h()}finally{t--,t||c()}return p},a=h=>{t?e.push(h):o(()=>{n(h)})},l=h=>(...p)=>{a(()=>{h(...p)})},c=()=>{const h=e;e=[],h.length&&o(()=>{r(()=>{h.forEach(p=>{n(p)})})})};return{batch:s,batchCalls:l,schedule:a,setNotifyFunction:h=>{n=h},setBatchNotifyFunction:h=>{r=h},setScheduler:i}}var Qn=YV(),tl,KT,DD=(KT=class{constructor(){Xe(this,tl,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),dx(this.gcTime)&&Ve(this,tl,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(nu?1/0:5*60*1e3))}clearGcTimeout(){ae(this,tl)&&(clearTimeout(ae(this,tl)),Ve(this,tl,void 0))}},tl=new WeakMap,KT),zc,Bc,Po,Ks,Oo,Un,Mf,nl,Vc,wg,Yo,Qi,XT,KV=(XT=class extends DD{constructor(t){super();Xe(this,Vc);Xe(this,Yo);Xe(this,zc,void 0);Xe(this,Bc,void 0);Xe(this,Po,void 0);Xe(this,Ks,void 0);Xe(this,Oo,void 0);Xe(this,Un,void 0);Xe(this,Mf,void 0);Xe(this,nl,void 0);Ve(this,nl,!1),Ve(this,Mf,t.defaultOptions),Et(this,Vc,wg).call(this,t.options),Ve(this,Un,[]),Ve(this,Po,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ve(this,zc,t.state||XV(this.options)),this.state=ae(this,zc),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!ae(this,Un).length&&this.state.fetchStatus==="idle"&&ae(this,Po).remove(this)}setData(t,n){const r=px(this.state.data,t,this.options);return Et(this,Yo,Qi).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Et(this,Yo,Qi).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=ae(this,Ks);return(r=ae(this,Oo))==null||r.cancel(t),n?n.then(To).catch(To):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(ae(this,zc))}isActive(){return ae(this,Un).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||ae(this,Un).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!PD(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=ae(this,Un).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=ae(this,Oo))==null||n.continue()}onOnline(){var n;const t=ae(this,Un).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=ae(this,Oo))==null||n.continue()}addObserver(t){ae(this,Un).includes(t)||(ae(this,Un).push(t),this.clearGcTimeout(),ae(this,Po).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){ae(this,Un).includes(t)&&(Ve(this,Un,ae(this,Un).filter(n=>n!==t)),ae(this,Un).length||(ae(this,Oo)&&(ae(this,nl)?ae(this,Oo).cancel({revert:!0}):ae(this,Oo).cancelRetry()),this.scheduleGc()),ae(this,Po).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return ae(this,Un).length}invalidate(){this.state.isInvalidated||Et(this,Yo,Qi).call(this,{type:"invalidate"})}fetch(t,n){var c,u,f,h;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(ae(this,Ks))return(c=ae(this,Oo))==null||c.continueRetry(),ae(this,Ks)}if(t&&Et(this,Vc,wg).call(this,t),!this.options.queryFn){const p=ae(this,Un).find(v=>v.options.queryFn);p&&Et(this,Vc,wg).call(this,p.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,o={queryKey:this.queryKey,meta:this.meta},i=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(Ve(this,nl,!0),r.signal)})};i(o);const s=()=>this.options.queryFn?(Ve(this,nl,!1),this.options.persister?this.options.persister(this.options.queryFn,o,this):this.options.queryFn(o)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),a={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(a),(u=this.options.behavior)==null||u.onFetch(a,this),Ve(this,Bc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=a.fetchOptions)==null?void 0:f.meta))&&Et(this,Yo,Qi).call(this,{type:"fetch",meta:(h=a.fetchOptions)==null?void 0:h.meta});const l=p=>{var v,b,w,y;u0(p)&&p.silent||Et(this,Yo,Qi).call(this,{type:"error",error:p}),u0(p)||((b=(v=ae(this,Po).config).onError)==null||b.call(v,p,this),(y=(w=ae(this,Po).config).onSettled)==null||y.call(w,this.state.data,p,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return Ve(this,Oo,TD({fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:p=>{var v,b,w,y;if(typeof p>"u"){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),l(new Error(`${this.queryHash} data is undefined`));return}this.setData(p),(b=(v=ae(this,Po).config).onSuccess)==null||b.call(v,p,this),(y=(w=ae(this,Po).config).onSettled)==null||y.call(w,p,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(p,v)=>{Et(this,Yo,Qi).call(this,{type:"failed",failureCount:p,error:v})},onPause:()=>{Et(this,Yo,Qi).call(this,{type:"pause"})},onContinue:()=>{Et(this,Yo,Qi).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),Ve(this,Ks,ae(this,Oo).promise),ae(this,Ks)}},zc=new WeakMap,Bc=new WeakMap,Po=new WeakMap,Ks=new WeakMap,Oo=new WeakMap,Un=new WeakMap,Mf=new WeakMap,nl=new WeakMap,Vc=new WeakSet,wg=function(t){this.options={...ae(this,Mf),...t},this.updateGcTime(this.options.gcTime)},Yo=new WeakSet,Qi=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:t.meta??null,fetchStatus:Dm(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return u0(o)&&o.revert&&ae(this,Bc)?{...ae(this,Bc),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Qn.batch(()=>{ae(this,Un).forEach(r=>{r.onQueryUpdate()}),ae(this,Po).notify({query:this,type:"updated",action:t})})},XT);function XV(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var mi,QT,AD=(QT=class extends Gf{constructor(t={}){super();Xe(this,mi,void 0);this.config=t,Ve(this,mi,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??mw(o,n);let s=this.get(i);return s||(s=new KV({cache:this,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){ae(this,mi).has(t.queryHash)||(ae(this,mi).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=ae(this,mi).get(t.queryHash);n&&(t.destroy(),n===t&&ae(this,mi).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Qn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return ae(this,mi).get(t)}getAll(){return[...ae(this,mi).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>oP(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>oP(t,r)):n}notify(t){Qn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Qn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Qn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},mi=new WeakMap,QT),vi,If,Zr,Hc,bi,Vs,JT,QV=(JT=class extends DD{constructor(t){super();Xe(this,bi);Xe(this,vi,void 0);Xe(this,If,void 0);Xe(this,Zr,void 0);Xe(this,Hc,void 0);this.mutationId=t.mutationId,Ve(this,If,t.defaultOptions),Ve(this,Zr,t.mutationCache),Ve(this,vi,[]),this.state=t.state||JV(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...ae(this,If),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){ae(this,vi).includes(t)||(ae(this,vi).push(t),this.clearGcTimeout(),ae(this,Zr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ve(this,vi,ae(this,vi).filter(n=>n!==t)),this.scheduleGc(),ae(this,Zr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){ae(this,vi).length||(this.state.status==="pending"?this.scheduleGc():ae(this,Zr).remove(this))}continue(){var t;return((t=ae(this,Hc))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,a,l,c,u,f,h,p,v,b,w,y,_,C,R,S,$,O;const n=()=>(Ve(this,Hc,TD({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(D,I)=>{Et(this,bi,Vs).call(this,{type:"failed",failureCount:D,error:I})},onPause:()=>{Et(this,bi,Vs).call(this,{type:"pause"})},onContinue:()=>{Et(this,bi,Vs).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),ae(this,Hc).promise),r=this.state.status==="pending";try{if(!r){Et(this,bi,Vs).call(this,{type:"pending",variables:t}),await((i=(o=ae(this,Zr).config).onMutate)==null?void 0:i.call(o,t,this));const I=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));I!==this.state.context&&Et(this,bi,Vs).call(this,{type:"pending",context:I,variables:t})}const D=await n();return await((c=(l=ae(this,Zr).config).onSuccess)==null?void 0:c.call(l,D,t,this.state.context,this)),await((f=(u=this.options).onSuccess)==null?void 0:f.call(u,D,t,this.state.context)),await((p=(h=ae(this,Zr).config).onSettled)==null?void 0:p.call(h,D,null,this.state.variables,this.state.context,this)),await((b=(v=this.options).onSettled)==null?void 0:b.call(v,D,null,t,this.state.context)),Et(this,bi,Vs).call(this,{type:"success",data:D}),D}catch(D){try{throw await((y=(w=ae(this,Zr).config).onError)==null?void 0:y.call(w,D,t,this.state.context,this)),await((C=(_=this.options).onError)==null?void 0:C.call(_,D,t,this.state.context)),await((S=(R=ae(this,Zr).config).onSettled)==null?void 0:S.call(R,void 0,D,this.state.variables,this.state.context,this)),await((O=($=this.options).onSettled)==null?void 0:O.call($,void 0,D,t,this.state.context)),D}finally{Et(this,bi,Vs).call(this,{type:"error",error:D})}}}},vi=new WeakMap,If=new WeakMap,Zr=new WeakMap,Hc=new WeakMap,bi=new WeakSet,Vs=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!Dm(this.options.networkMode),status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Qn.batch(()=>{ae(this,vi).forEach(r=>{r.onMutationUpdate(t)}),ae(this,Zr).notify({mutation:this,type:"updated",action:t})})},JT);function JV(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var $o,Nf,rl,ZT,ZV=(ZT=class extends Gf{constructor(t={}){super();Xe(this,$o,void 0);Xe(this,Nf,void 0);Xe(this,rl,void 0);this.config=t,Ve(this,$o,[]),Ve(this,Nf,0)}build(t,n,r){const o=new QV({mutationCache:this,mutationId:++dp(this,Nf)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){ae(this,$o).push(t),this.notify({type:"added",mutation:t})}remove(t){Ve(this,$o,ae(this,$o).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){Qn.batch(()=>{ae(this,$o).forEach(t=>{this.remove(t)})})}getAll(){return ae(this,$o)}find(t){const n={exact:!0,...t};return ae(this,$o).find(r=>iP(n,r))}findAll(t={}){return ae(this,$o).filter(n=>iP(t,n))}notify(t){Qn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return Ve(this,rl,(ae(this,rl)??Promise.resolve()).then(()=>{const t=ae(this,$o).filter(n=>n.state.isPaused);return Qn.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(To)),Promise.resolve()))}).then(()=>{Ve(this,rl,void 0)})),ae(this,rl)}},$o=new WeakMap,Nf=new WeakMap,rl=new WeakMap,ZT);function eH(e){return{onFetch:(t,n)=>{const r=async()=>{var v,b,w,y,_;const o=t.options,i=(w=(b=(v=t.fetchOptions)==null?void 0:v.meta)==null?void 0:b.fetchMore)==null?void 0:w.direction,s=((y=t.state.data)==null?void 0:y.pages)||[],a=((_=t.state.data)==null?void 0:_.pageParams)||[],l={pages:[],pageParams:[]};let c=!1;const u=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(t.signal.aborted?c=!0:t.signal.addEventListener("abort",()=>{c=!0}),t.signal)})},f=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),h=async(C,R,S)=>{if(c)return Promise.reject();if(R==null&&C.pages.length)return Promise.resolve(C);const $={queryKey:t.queryKey,pageParam:R,direction:S?"backward":"forward",meta:t.options.meta};u($);const O=await f($),{maxPages:D}=t.options,I=S?WV:HV;return{pages:I(C.pages,O,D),pageParams:I(C.pageParams,R,D)}};let p;if(i&&s.length){const C=i==="backward",R=C?tH:lP,S={pages:s,pageParams:a},$=R(o,S);p=await h(S,$,C)}else{p=await h(l,a[0]??o.initialPageParam);const C=e??s.length;for(let R=1;R<C;R++){const S=lP(o,p);p=await h(p,S)}}return p};t.options.persister?t.fetchFn=()=>{var o,i;return(i=(o=t.options).persister)==null?void 0:i.call(o,r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=r}}}function lP(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function tH(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var Fn,Xs,Qs,Wc,Uc,Js,Gc,qc,eD,nH=(eD=class{constructor(e={}){Xe(this,Fn,void 0);Xe(this,Xs,void 0);Xe(this,Qs,void 0);Xe(this,Wc,void 0);Xe(this,Uc,void 0);Xe(this,Js,void 0);Xe(this,Gc,void 0);Xe(this,qc,void 0);Ve(this,Fn,e.queryCache||new AD),Ve(this,Xs,e.mutationCache||new ZV),Ve(this,Qs,e.defaultOptions||{}),Ve(this,Wc,new Map),Ve(this,Uc,new Map),Ve(this,Js,0)}mount(){dp(this,Js)._++,ae(this,Js)===1&&(Ve(this,Gc,zg.subscribe(()=>{zg.isFocused()&&(this.resumePausedMutations(),ae(this,Fn).onFocus())})),Ve(this,qc,Bg.subscribe(()=>{Bg.isOnline()&&(this.resumePausedMutations(),ae(this,Fn).onOnline())})))}unmount(){var e,t;dp(this,Js)._--,ae(this,Js)===0&&((e=ae(this,Gc))==null||e.call(this),Ve(this,Gc,void 0),(t=ae(this,qc))==null||t.call(this),Ve(this,qc,void 0))}isFetching(e){return ae(this,Fn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return ae(this,Xs).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=ae(this,Fn).find({queryKey:e}))==null?void 0:t.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);return t!==void 0?Promise.resolve(t):this.fetchQuery(e)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=ae(this,Fn).find({queryKey:e}),o=r==null?void 0:r.state.data,i=BV(t,o);if(typeof i>"u")return;const s=this.defaultQueryOptions({queryKey:e});return ae(this,Fn).build(this,s).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return Qn.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var t;return(t=ae(this,Fn).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=ae(this,Fn);Qn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=ae(this,Fn),r={type:"active",...e};return Qn.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=Qn.batch(()=>ae(this,Fn).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(To).catch(To)}invalidateQueries(e={},t={}){return Qn.batch(()=>{if(ae(this,Fn).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=Qn.batch(()=>ae(this,Fn).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(To)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(To)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=ae(this,Fn).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(To).catch(To)}fetchInfiniteQuery(e){return e.behavior=eH(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(To).catch(To)}resumePausedMutations(){return ae(this,Xs).resumePausedMutations()}getQueryCache(){return ae(this,Fn)}getMutationCache(){return ae(this,Xs)}getDefaultOptions(){return ae(this,Qs)}setDefaultOptions(e){Ve(this,Qs,e)}setQueryDefaults(e,t){ae(this,Wc).set(Yd(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...ae(this,Wc).values()];let n={};return t.forEach(r=>{Kd(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){ae(this,Uc).set(Yd(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...ae(this,Uc).values()];let n={};return t.forEach(r=>{Kd(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...ae(this,Qs).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=mw(t.queryKey,t)),typeof t.refetchOnReconnect>"u"&&(t.refetchOnReconnect=t.networkMode!=="always"),typeof t.throwOnError>"u"&&(t.throwOnError=!!t.suspense),typeof t.networkMode>"u"&&t.persister&&(t.networkMode="offlineFirst"),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...ae(this,Qs).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){ae(this,Fn).clear(),ae(this,Xs).clear()}},Fn=new WeakMap,Xs=new WeakMap,Qs=new WeakMap,Wc=new WeakMap,Uc=new WeakMap,Js=new WeakMap,Gc=new WeakMap,qc=new WeakMap,eD),Ir,fn,Lf,yr,ol,Yc,yi,Ff,Kc,Xc,il,sl,Zs,Qc,al,vd,jf,gx,zf,mx,Bf,vx,Vf,bx,Hf,yx,Wf,xx,Uf,wx,Cm,kD,tD,rH=(tD=class extends Gf{constructor(t,n){super();Xe(this,al);Xe(this,jf);Xe(this,zf);Xe(this,Bf);Xe(this,Vf);Xe(this,Hf);Xe(this,Wf);Xe(this,Uf);Xe(this,Cm);Xe(this,Ir,void 0);Xe(this,fn,void 0);Xe(this,Lf,void 0);Xe(this,yr,void 0);Xe(this,ol,void 0);Xe(this,Yc,void 0);Xe(this,yi,void 0);Xe(this,Ff,void 0);Xe(this,Kc,void 0);Xe(this,Xc,void 0);Xe(this,il,void 0);Xe(this,sl,void 0);Xe(this,Zs,void 0);Xe(this,Qc,new Set);this.options=n,Ve(this,Ir,t),Ve(this,yi,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(ae(this,fn).addObserver(this),cP(ae(this,fn),this.options)?Et(this,al,vd).call(this):this.updateResult(),Et(this,Vf,bx).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return _x(ae(this,fn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return _x(ae(this,fn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Et(this,Hf,yx).call(this),Et(this,Wf,xx).call(this),ae(this,fn).removeObserver(this)}setOptions(t,n){const r=this.options,o=ae(this,fn);if(this.options=ae(this,Ir).defaultQueryOptions(t),fx(r,this.options)||ae(this,Ir).getQueryCache().notify({type:"observerOptionsUpdated",query:ae(this,fn),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),Et(this,Uf,wx).call(this);const i=this.hasListeners();i&&uP(ae(this,fn),o,this.options,r)&&Et(this,al,vd).call(this),this.updateResult(n),i&&(ae(this,fn)!==o||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&Et(this,jf,gx).call(this);const s=Et(this,zf,mx).call(this);i&&(ae(this,fn)!==o||this.options.enabled!==r.enabled||s!==ae(this,Zs))&&Et(this,Bf,vx).call(this,s)}getOptimisticResult(t){const n=ae(this,Ir).getQueryCache().build(ae(this,Ir),t),r=this.createResult(n,t);return iH(this,r)&&(Ve(this,yr,r),Ve(this,Yc,this.options),Ve(this,ol,ae(this,fn).state)),r}getCurrentResult(){return ae(this,yr)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(ae(this,Qc).add(r),t[r])})}),n}getCurrentQuery(){return ae(this,fn)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=ae(this,Ir).defaultQueryOptions(t),r=ae(this,Ir).getQueryCache().build(ae(this,Ir),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Et(this,al,vd).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),ae(this,yr)))}createResult(t,n){var $;const r=ae(this,fn),o=this.options,i=ae(this,yr),s=ae(this,ol),a=ae(this,Yc),c=t!==r?t.state:ae(this,Lf),{state:u}=t;let{error:f,errorUpdatedAt:h,fetchStatus:p,status:v}=u,b=!1,w;if(n._optimisticResults){const O=this.hasListeners(),D=!O&&cP(t,n),I=O&&uP(t,r,n,o);(D||I)&&(p=Dm(t.options.networkMode)?"fetching":"paused",u.dataUpdatedAt||(v="pending")),n._optimisticResults==="isRestoring"&&(p="idle")}if(n.select&&typeof u.data<"u")if(i&&u.data===(s==null?void 0:s.data)&&n.select===ae(this,Ff))w=ae(this,Kc);else try{Ve(this,Ff,n.select),w=n.select(u.data),w=px(i==null?void 0:i.data,w,n),Ve(this,Kc,w),Ve(this,yi,null)}catch(O){Ve(this,yi,O)}else w=u.data;if(typeof n.placeholderData<"u"&&typeof w>"u"&&v==="pending"){let O;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))O=i.data;else if(O=typeof n.placeholderData=="function"?n.placeholderData(($=ae(this,Xc))==null?void 0:$.state.data,ae(this,Xc)):n.placeholderData,n.select&&typeof O<"u")try{O=n.select(O),Ve(this,yi,null)}catch(D){Ve(this,yi,D)}typeof O<"u"&&(v="success",w=px(i==null?void 0:i.data,O,n),b=!0)}ae(this,yi)&&(f=ae(this,yi),w=ae(this,Kc),h=Date.now(),v="error");const y=p==="fetching",_=v==="pending",C=v==="error",R=_&&y;return{status:v,fetchStatus:p,isPending:_,isSuccess:v==="success",isError:C,isInitialLoading:R,isLoading:R,data:w,dataUpdatedAt:u.dataUpdatedAt,error:f,errorUpdatedAt:h,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:y,isRefetching:y&&!_,isLoadingError:C&&u.dataUpdatedAt===0,isPaused:p==="paused",isPlaceholderData:b,isRefetchError:C&&u.dataUpdatedAt!==0,isStale:vw(t,n),refetch:this.refetch}}updateResult(t){const n=ae(this,yr),r=this.createResult(ae(this,fn),this.options);if(Ve(this,ol,ae(this,fn).state),Ve(this,Yc,this.options),ae(this,ol).data!==void 0&&Ve(this,Xc,ae(this,fn)),fx(r,n))return;Ve(this,yr,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!ae(this,Qc).size)return!0;const l=new Set(a??ae(this,Qc));return this.options.throwOnError&&l.add("error"),Object.keys(ae(this,yr)).some(c=>{const u=c;return ae(this,yr)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),Et(this,Cm,kD).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Et(this,Vf,bx).call(this)}},Ir=new WeakMap,fn=new WeakMap,Lf=new WeakMap,yr=new WeakMap,ol=new WeakMap,Yc=new WeakMap,yi=new WeakMap,Ff=new WeakMap,Kc=new WeakMap,Xc=new WeakMap,il=new WeakMap,sl=new WeakMap,Zs=new WeakMap,Qc=new WeakMap,al=new WeakSet,vd=function(t){Et(this,Uf,wx).call(this);let n=ae(this,fn).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(To)),n},jf=new WeakSet,gx=function(){if(Et(this,Hf,yx).call(this),nu||ae(this,yr).isStale||!dx(this.options.staleTime))return;const n=PD(ae(this,yr).dataUpdatedAt,this.options.staleTime)+1;Ve(this,il,setTimeout(()=>{ae(this,yr).isStale||this.updateResult()},n))},zf=new WeakSet,mx=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(ae(this,fn)):this.options.refetchInterval)??!1},Bf=new WeakSet,vx=function(t){Et(this,Wf,xx).call(this),Ve(this,Zs,t),!(nu||this.options.enabled===!1||!dx(ae(this,Zs))||ae(this,Zs)===0)&&Ve(this,sl,setInterval(()=>{(this.options.refetchIntervalInBackground||zg.isFocused())&&Et(this,al,vd).call(this)},ae(this,Zs)))},Vf=new WeakSet,bx=function(){Et(this,jf,gx).call(this),Et(this,Bf,vx).call(this,Et(this,zf,mx).call(this))},Hf=new WeakSet,yx=function(){ae(this,il)&&(clearTimeout(ae(this,il)),Ve(this,il,void 0))},Wf=new WeakSet,xx=function(){ae(this,sl)&&(clearInterval(ae(this,sl)),Ve(this,sl,void 0))},Uf=new WeakSet,wx=function(){const t=ae(this,Ir).getQueryCache().build(ae(this,Ir),this.options);if(t===ae(this,fn))return;const n=ae(this,fn);Ve(this,fn,t),Ve(this,Lf,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Cm=new WeakSet,kD=function(t){Qn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(ae(this,yr))}),ae(this,Ir).getQueryCache().notify({query:ae(this,fn),type:"observerResultsUpdated"})})},tD);function oH(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function cP(e,t){return oH(e,t)||e.state.dataUpdatedAt>0&&_x(e,t,t.refetchOnMount)}function _x(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&vw(e,t)}return!1}function uP(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&vw(e,n)}function vw(e,t){return e.isStaleByTime(t.staleTime)}function iH(e,t){return!fx(e.getCurrentResult(),t)}var MD=N.createContext(void 0),ID=e=>{const t=N.useContext(MD);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},sH=({client:e,children:t})=>(N.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),N.createElement(MD.Provider,{value:e},t)),ND=N.createContext(!1),aH=()=>N.useContext(ND);ND.Provider;function lH(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var cH=N.createContext(lH()),uH=()=>N.useContext(cH);function dH(e,t){return typeof e=="function"?e(...t):!!e}var fH=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},hH=e=>{N.useEffect(()=>{e.clearReset()},[e])},pH=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&dH(n,[e.error,r]),gH=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},mH=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,vH=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function bH(e,t,n){if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=ID(n),o=aH(),i=uH(),s=r.defaultQueryOptions(e);s._optimisticResults=o?"isRestoring":"optimistic",gH(s),fH(s,i),hH(i);const[a]=N.useState(()=>new t(r,s)),l=a.getOptimisticResult(s);if(N.useSyncExternalStore(N.useCallback(c=>{const u=o?()=>{}:a.subscribe(Qn.batchCalls(c));return a.updateResult(),u},[a,o]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),N.useEffect(()=>{a.setOptions(s,{listeners:!1})},[s,a]),mH(s,l))throw vH(s,a,i);if(pH({result:l,errorResetBoundary:i,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw l.error;return s.notifyOnChangeProps?l:a.trackResult(l)}function Am(e,t){return bH(e,rH,t)}function LD({children:e}){const{setIsSessionExpired:t}=ur(),n=new nH({queryCache:new AD({onError:r=>{console.error(`Something went wrong: ${r.message}`),r.message==="invalid token"&&t(!0)}}),defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}});return E.jsx(sH,{client:n,children:e})}const Ol=m.forwardRef(({children:e,className:t,...n},r)=>E.jsx("div",{className:xe("semaphor-scope",t),ref:r,...n,children:e})),yH={id:"",authToken:void 0},FD=m.createContext(yH),jD=({children:e,dashboardProps:t})=>E.jsx(LD,{children:E.jsx(FD.Provider,{value:t,children:E.jsx(Ol,{style:{height:"100%"},children:e})})});function ni(){const e=m.useContext(FD);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}function xH(){const{authToken:e,version:t}=ni(),n=Ce(a=>a.selectedLensId),{data:r,isLoading:o,isFetching:i,isError:s}=Am({queryKey:["dashboard",n,e==null?void 0:e.accessToken],queryFn:()=>rV(e==null?void 0:e.accessToken,{lensId:n,version:t})});return{data:r,isLoading:o,isFetching:i,isError:s}}function zD(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function dP(e,t){const n=zD(e);return n==="dark"?ll.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function wH({customStyle:e,currentTheme:t,onSave:n,onEvent:r,defaultFilterValues:o,onFilterValuesChange:i}){const{authToken:s}=ni(),a=Ce(F=>F.selectedLensId),{data:l,isLoading:c,isFetching:u,isError:f}=xH(),[h,p]=m.useState(o||[]),{theme:v,setTheme:b}=RD(),w=Ce(F=>F.dashboard.globalStyle),{setDashboard:y,setDashboardWithFilterValues:_,setSelectedSheetId:C,setStyle:R,setOnSaveFunction:S,setLenses:$,setSelectedLensId:O,setInitStore:D}=Ce(F=>F.actions);Ce(F=>F.actions.setCustomCards);const I=Ce(F=>F.actions.setFilterValues),L=Ce(F=>F.filterValues),j=Ce(F=>F.actions.setThemeStyle),B=Ce(F=>F.actions.setDashboardTheme),te=Ce(F=>F.actions.setOnEvent);m.useEffect(()=>{s&&D()},[s,D]),m.useEffect(()=>{if(v){const F=zD(v);B(F)}},[v,B]),m.useEffect(()=>{t&&b(t)},[t,b]);const q=m.useCallback(()=>{const F=ll.cloneDeep(Fg),Q=ll.merge(F,w);if(e){const G=ll.merge(Q,e),K=dP(v,G);j(K),R(G)}else{const G=dP(v,Q);j(G),R(Fg)}},[v,e,w,j,R]);return m.useEffect(()=>{l&&l.dashboard&&q()},[v,e,w,q,l]),m.useEffect(()=>{var H,U;console.log("running filter values hook in the use dashboard");function F(M,re){const ce=M.filters||[],ue=[];for(const he of re){const J=ce.find(ee=>ee.id===he.filterId);J&&ue.push({filterId:he.filterId,connectionType:J.database==="NA"?"api":"database",name:J.column,operation:J.operation,valueType:Gd(J),values:he.values})}return ue}if(!l||!l.dashboard)return;const{dashboard:Q,filterValues:G,defaultLensId:K,lenses:W}=l,T=F(Q,h||[]);_(Q,G||T||[]),K&&O(K),W&&$(W),C(((U=(H=Q==null?void 0:Q.sheets)==null?void 0:H[0])==null?void 0:U.id)||null)},[l,y,C,I,a,$,_,O,h]),m.useEffect(()=>{i&&L&&i(L)},[L,i]),m.useEffect(()=>{n&&S(n),r&&te(r)},[n,S,r,te]),{isFetching:u,isLoading:c,isError:f}}function km({className:e,...t}){return E.jsx("div",{className:xe("animate-pulse rounded-md bg-muted",e),...t})}const bw=N.forwardRef(({className:e,...t},n)=>E.jsx("div",{ref:n,className:xe("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));bw.displayName="Card";const Mm=N.forwardRef(({className:e,...t},n)=>E.jsx("div",{ref:n,className:xe("flex flex-col space-y-1.5 p-6",e),...t}));Mm.displayName="CardHeader";const bu=N.forwardRef(({className:e,...t},n)=>E.jsx("h3",{ref:n,className:xe("text-2xl font-semibold leading-none tracking-tight",e),...t}));bu.displayName="CardTitle";const yw=N.forwardRef(({className:e,...t},n)=>E.jsx("p",{ref:n,className:xe("text-sm text-muted-foreground",e),...t}));yw.displayName="CardDescription";const Im=N.forwardRef(({className:e,...t},n)=>E.jsx("div",{ref:n,className:xe("px-6 pt-0",e),...t}));Im.displayName="CardContent";const xw=N.forwardRef(({className:e,...t},n)=>E.jsx("div",{ref:n,className:xe("flex items-center p-6 pt-0",e),...t}));xw.displayName="CardFooter";function BD({className:e,customStyle:t,onSave:n,onEvent:r,LoadingComponent:o,ErrorComponent:i,onChartElementClicked:s,id:a,authToken:l,currentTheme:c,version:u,customCards:f,showAssistant:h,defaultFilterValues:p,onFilterValuesChange:v,...b}){Ce(S=>S.selectedSheetId);const w=Ce(S=>S.themeStyle),y=Ce(S=>S.isSessionExpired),{isLoading:_,isError:C,isFetching:R}=wH({authToken:l,customStyle:t,currentTheme:c,onSave:n,onEvent:r,defaultFilterValues:p,onFilterValuesChange:v});return _||!l?(r==null||r({type:"info",message:"Loading dashboard"}),o?E.jsx(o,{message:"loading"}):E.jsx("div",{className:"flex items-center gap-3",children:E.jsx(km,{className:"h-1 w-full dark:h-[2px]"})})):C?(r==null||r({type:"error",message:"Error fetching dashboard"}),i?(console.log("Error fetching dashboard"),E.jsx(i,{})):E.jsx("div",{children:"Error"})):y?(r==null||r({type:"error",message:"Session Expired"}),E.jsx("div",{className:"flex h-full items-center justify-center",children:E.jsxs("div",{className:"space-y-4 rounded-md border border-muted p-10",children:[E.jsx(bu,{children:"Session Expired"}),E.jsx("p",{className:"text-muted-foreground",children:"Please refresh your page to continue."})]})})):E.jsx("div",{className:xe("flex h-full flex-col justify-between",w==null?void 0:w.dashboardPanel,e),style:{},role:"dashboard-panel",...b})}function de(){return de=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},de.apply(this,arguments)}function Me(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function tr(e,t=[]){let n=[];function r(i,s){const a=m.createContext(s),l=n.length;n=[...n,s];function c(f){const{scope:h,children:p,...v}=f,b=(h==null?void 0:h[e][l])||a,w=m.useMemo(()=>v,Object.values(v));return m.createElement(b.Provider,{value:w},p)}function u(f,h){const p=(h==null?void 0:h[e][l])||a,v=m.useContext(p);if(v)return v;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const o=()=>{const i=n.map(s=>m.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,_H(o,...t)]}function _H(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const f=l(i)[`__scope${c}`];return{...a,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function CH(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function ps(...e){return t=>e.forEach(n=>CH(n,t))}function Ct(...e){return m.useCallback(ps(...e),e)}const Cx=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(EH);if(i){const s=i.props.children,a=o.map(l=>l===i?m.Children.count(s)>1?m.Children.only(null):m.isValidElement(s)?s.props.children:null:l);return m.createElement(Sx,de({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(Sx,de({},r,{ref:t}),n)});Cx.displayName="Slot";const Sx=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...RH(r,n.props),ref:t?ps(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});Sx.displayName="SlotClone";const SH=({children:e})=>m.createElement(m.Fragment,null,e);function EH(e){return m.isValidElement(e)&&e.type===SH}function RH(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)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Nm(e){const t=e+"CollectionProvider",[n,r]=tr(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=p=>{const{scope:v,children:b}=p,w=m.useRef(null),y=m.useRef(new Map).current;return m.createElement(o,{scope:v,itemMap:y,collectionRef:w},b)},a=e+"CollectionSlot",l=m.forwardRef((p,v)=>{const{scope:b,children:w}=p,y=i(a,b),_=Ct(v,y.collectionRef);return m.createElement(Cx,{ref:_},w)}),c=e+"CollectionItemSlot",u="data-radix-collection-item",f=m.forwardRef((p,v)=>{const{scope:b,children:w,...y}=p,_=m.useRef(null),C=Ct(v,_),R=i(c,b);return m.useEffect(()=>(R.itemMap.set(_,{ref:_,...y}),()=>void R.itemMap.delete(_))),m.createElement(Cx,{[u]:"",ref:C},w)});function h(p){const v=i(e+"CollectionConsumer",p);return m.useCallback(()=>{const w=v.collectionRef.current;if(!w)return[];const y=Array.from(w.querySelectorAll(`[${u}]`));return Array.from(v.itemMap.values()).sort((R,S)=>y.indexOf(R.ref.current)-y.indexOf(S.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:l,ItemSlot:f},h,r]}const dr=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},PH=N.useId||(()=>{});let OH=0;function Zo(e){const[t,n]=N.useState(PH());return dr(()=>{e||n(r=>r??String(OH++))},[e]),e||(t?`radix-${t}`:"")}const VD=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(TH);if(i){const s=i.props.children,a=o.map(l=>l===i?m.Children.count(s)>1?m.Children.only(null):m.isValidElement(s)?s.props.children:null:l);return m.createElement(Ex,de({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(Ex,de({},r,{ref:t}),n)});VD.displayName="Slot";const Ex=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...DH(r,n.props),ref:t?ps(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});Ex.displayName="SlotClone";const $H=({children:e})=>m.createElement(m.Fragment,null,e);function TH(e){return m.isValidElement(e)&&e.type===$H}function DH(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)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const AH=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Qe=AH.reduce((e,t)=>{const n=m.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?VD:t;return m.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),m.createElement(a,de({},s,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function HD(e,t){e&&fr.flushSync(()=>e.dispatchEvent(t))}function zn(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function Cr({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=kH({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=zn(n),l=m.useCallback(c=>{if(i){const f=typeof c=="function"?c(e):c;f!==e&&a(f)}else o(c)},[i,e,o,a]);return[s,l]}function kH({defaultProp:e,onChange:t}){const n=m.useState(e),[r]=n,o=m.useRef(r),i=zn(t);return m.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const MH=m.createContext(void 0);function $l(e){const t=m.useContext(MH);return e||t||"ltr"}const d0="rovingFocusGroup.onEntryFocus",IH={bubbles:!1,cancelable:!0},ww="RovingFocusGroup",[Rx,WD,NH]=Nm(ww),[LH,yu]=tr(ww,[NH]),[FH,jH]=LH(ww),zH=m.forwardRef((e,t)=>m.createElement(Rx.Provider,{scope:e.__scopeRovingFocusGroup},m.createElement(Rx.Slot,{scope:e.__scopeRovingFocusGroup},m.createElement(BH,de({},e,{ref:t}))))),BH=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,...u}=e,f=m.useRef(null),h=Ct(t,f),p=$l(i),[v=null,b]=Cr({prop:s,defaultProp:a,onChange:l}),[w,y]=m.useState(!1),_=zn(c),C=WD(n),R=m.useRef(!1),[S,$]=m.useState(0);return m.useEffect(()=>{const O=f.current;if(O)return O.addEventListener(d0,_),()=>O.removeEventListener(d0,_)},[_]),m.createElement(FH,{scope:n,orientation:r,dir:p,loop:o,currentTabStopId:v,onItemFocus:m.useCallback(O=>b(O),[b]),onItemShiftTab:m.useCallback(()=>y(!0),[]),onFocusableItemAdd:m.useCallback(()=>$(O=>O+1),[]),onFocusableItemRemove:m.useCallback(()=>$(O=>O-1),[])},m.createElement(Qe.div,de({tabIndex:w||S===0?-1:0,"data-orientation":r},u,{ref:h,style:{outline:"none",...e.style},onMouseDown:Me(e.onMouseDown,()=>{R.current=!0}),onFocus:Me(e.onFocus,O=>{const D=!R.current;if(O.target===O.currentTarget&&D&&!w){const I=new CustomEvent(d0,IH);if(O.currentTarget.dispatchEvent(I),!I.defaultPrevented){const L=C().filter(F=>F.focusable),j=L.find(F=>F.active),B=L.find(F=>F.id===v),q=[j,B,...L].filter(Boolean).map(F=>F.ref.current);UD(q)}}R.current=!1}),onBlur:Me(e.onBlur,()=>y(!1))})))}),VH="RovingFocusGroupItem",HH=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=Zo(),l=i||a,c=jH(VH,n),u=c.currentTabStopId===l,f=WD(n),{onFocusableItemAdd:h,onFocusableItemRemove:p}=c;return m.useEffect(()=>{if(r)return h(),()=>p()},[r,h,p]),m.createElement(Rx.ItemSlot,{scope:n,id:l,focusable:r,active:o},m.createElement(Qe.span,de({tabIndex:u?0:-1,"data-orientation":c.orientation},s,{ref:t,onMouseDown:Me(e.onMouseDown,v=>{r?c.onItemFocus(l):v.preventDefault()}),onFocus:Me(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:Me(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){c.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const b=GH(v,c.orientation,c.dir);if(b!==void 0){v.preventDefault();let y=f().filter(_=>_.focusable).map(_=>_.ref.current);if(b==="last")y.reverse();else if(b==="prev"||b==="next"){b==="prev"&&y.reverse();const _=y.indexOf(v.currentTarget);y=c.loop?qH(y,_+1):y.slice(_+1)}setTimeout(()=>UD(y))}})})))}),WH={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function UH(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function GH(e,t,n){const r=UH(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return WH[r]}function UD(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function qH(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const _w=zH,Cw=HH;function YH(e,t){return m.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const nr=e=>{const{present:t,children:n}=e,r=KH(t),o=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),i=Ct(r.ref,o.ref);return typeof n=="function"||r.isPresent?m.cloneElement(o,{ref:i}):null};nr.displayName="Presence";function KH(e){const[t,n]=m.useState(),r=m.useRef({}),o=m.useRef(e),i=m.useRef("none"),s=e?"mounted":"unmounted",[a,l]=YH(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const c=gp(r.current);i.current=a==="mounted"?c:"none"},[a]),dr(()=>{const c=r.current,u=o.current;if(u!==e){const h=i.current,p=gp(c);e?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&h!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),dr(()=>{if(t){const c=f=>{const p=gp(r.current).includes(f.animationName);f.target===t&&p&&fr.flushSync(()=>l("ANIMATION_END"))},u=f=>{f.target===t&&(i.current=gp(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:m.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function gp(e){return(e==null?void 0:e.animationName)||"none"}const GD="Tabs",[XH,D1e]=tr(GD,[yu]),qD=yu(),[QH,Sw]=XH(GD),JH=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=$l(a),[f,h]=Cr({prop:r,onChange:o,defaultProp:i});return m.createElement(QH,{scope:n,baseId:Zo(),value:f,onValueChange:h,orientation:s,dir:u,activationMode:l},m.createElement(Qe.div,de({dir:u,"data-orientation":s},c,{ref:t})))}),ZH="TabsList",eW=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=Sw(ZH,n),s=qD(n);return m.createElement(_w,de({asChild:!0},s,{orientation:i.orientation,dir:i.dir,loop:r}),m.createElement(Qe.div,de({role:"tablist","aria-orientation":i.orientation},o,{ref:t})))}),tW="TabsTrigger",nW=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=Sw(tW,n),a=qD(n),l=YD(s.baseId,r),c=KD(s.baseId,r),u=r===s.value;return m.createElement(Cw,de({asChild:!0},a,{focusable:!o,active:u}),m.createElement(Qe.button,de({type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l},i,{ref:t,onMouseDown:Me(e.onMouseDown,f=>{!o&&f.button===0&&f.ctrlKey===!1?s.onValueChange(r):f.preventDefault()}),onKeyDown:Me(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&s.onValueChange(r)}),onFocus:Me(e.onFocus,()=>{const f=s.activationMode!=="manual";!u&&!o&&f&&s.onValueChange(r)})})))}),rW="TabsContent",oW=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=Sw(rW,n),l=YD(a.baseId,r),c=KD(a.baseId,r),u=r===a.value,f=m.useRef(u);return m.useEffect(()=>{const h=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(h)},[]),m.createElement(nr,{present:o||u},({present:h})=>m.createElement(Qe.div,de({"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!h,id:c,tabIndex:0},s,{ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0}}),h&&i))});function YD(e,t){return`${e}-trigger-${t}`}function KD(e,t){return`${e}-content-${t}`}const iW=JH,XD=eW,QD=nW,JD=oW,Ew=iW,Lm=N.forwardRef(({className:e,...t},n)=>E.jsx(XD,{ref:n,className:xe("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Lm.displayName=XD.displayName;const Fm=N.forwardRef(({className:e,...t},n)=>E.jsx(QD,{ref:n,className:xe("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));Fm.displayName=QD.displayName;const Rw=N.forwardRef(({className:e,...t},n)=>E.jsx(JD,{ref:n,className:xe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Rw.displayName=JD.displayName;var ZD={exports:{}},qf={},Px={exports:{}};(function(e,t){(function(n,r){r(t)})(Gs,function(n){function r(J){return function(ie,me,Z,be,Se,$e,Te){return J(ie,me,Te)}}function o(J){return function(ie,me,Z,be){if(!ie||!me||typeof ie!="object"||typeof me!="object")return J(ie,me,Z,be);var Se=be.get(ie),$e=be.get(me);if(Se&&$e)return Se===me&&$e===ie;be.set(ie,me),be.set(me,ie);var Te=J(ie,me,Z,be);return be.delete(ie),be.delete(me),Te}}function i(J,ee){var ie={};for(var me in J)ie[me]=J[me];for(var me in ee)ie[me]=ee[me];return ie}function s(J){return J.constructor===Object||J.constructor==null}function a(J){return typeof J.then=="function"}function l(J,ee){return J===ee||J!==J&&ee!==ee}var c="[object Arguments]",u="[object Boolean]",f="[object Date]",h="[object RegExp]",p="[object Map]",v="[object Number]",b="[object Object]",w="[object Set]",y="[object String]",_=Object.prototype.toString;function C(J){var ee=J.areArraysEqual,ie=J.areDatesEqual,me=J.areMapsEqual,Z=J.areObjectsEqual,be=J.areRegExpsEqual,Se=J.areSetsEqual,$e=J.createIsNestedEqual,Te=$e(Ue);function Ue(Be,Ie,Ke){if(Be===Ie)return!0;if(!Be||!Ie||typeof Be!="object"||typeof Ie!="object")return Be!==Be&&Ie!==Ie;if(s(Be)&&s(Ie))return Z(Be,Ie,Te,Ke);var lt=Array.isArray(Be),Nt=Array.isArray(Ie);if(lt||Nt)return lt===Nt&&ee(Be,Ie,Te,Ke);var At=_.call(Be);return At!==_.call(Ie)?!1:At===f?ie(Be,Ie,Te,Ke):At===h?be(Be,Ie,Te,Ke):At===p?me(Be,Ie,Te,Ke):At===w?Se(Be,Ie,Te,Ke):At===b||At===c?a(Be)||a(Ie)?!1:Z(Be,Ie,Te,Ke):At===u||At===v||At===y?l(Be.valueOf(),Ie.valueOf()):!1}return Ue}function R(J,ee,ie,me){var Z=J.length;if(ee.length!==Z)return!1;for(;Z-- >0;)if(!ie(J[Z],ee[Z],Z,Z,J,ee,me))return!1;return!0}var S=o(R);function $(J,ee){return l(J.valueOf(),ee.valueOf())}function O(J,ee,ie,me){var Z=J.size===ee.size;if(!Z)return!1;if(!J.size)return!0;var be={},Se=0;return J.forEach(function($e,Te){if(Z){var Ue=!1,Be=0;ee.forEach(function(Ie,Ke){!Ue&&!be[Be]&&(Ue=ie(Te,Ke,Se,Be,J,ee,me)&&ie($e,Ie,Te,Ke,J,ee,me))&&(be[Be]=!0),Be++}),Se++,Z=Ue}}),Z}var D=o(O),I="_owner",L=Object.prototype.hasOwnProperty;function j(J,ee,ie,me){var Z=Object.keys(J),be=Z.length;if(Object.keys(ee).length!==be)return!1;for(var Se;be-- >0;){if(Se=Z[be],Se===I){var $e=!!J.$$typeof,Te=!!ee.$$typeof;if(($e||Te)&&$e!==Te)return!1}if(!L.call(ee,Se)||!ie(J[Se],ee[Se],Se,Se,J,ee,me))return!1}return!0}var B=o(j);function te(J,ee){return J.source===ee.source&&J.flags===ee.flags}function q(J,ee,ie,me){var Z=J.size===ee.size;if(!Z)return!1;if(!J.size)return!0;var be={};return J.forEach(function(Se,$e){if(Z){var Te=!1,Ue=0;ee.forEach(function(Be,Ie){!Te&&!be[Ue]&&(Te=ie(Se,Be,$e,Ie,J,ee,me))&&(be[Ue]=!0),Ue++}),Z=Te}}),Z}var F=o(q),Q=Object.freeze({areArraysEqual:R,areDatesEqual:$,areMapsEqual:O,areObjectsEqual:j,areRegExpsEqual:te,areSetsEqual:q,createIsNestedEqual:r}),G=Object.freeze({areArraysEqual:S,areDatesEqual:$,areMapsEqual:D,areObjectsEqual:B,areRegExpsEqual:te,areSetsEqual:F,createIsNestedEqual:r}),K=C(Q);function W(J,ee){return K(J,ee,void 0)}var T=C(i(Q,{createIsNestedEqual:function(){return l}}));function H(J,ee){return T(J,ee,void 0)}var U=C(G);function M(J,ee){return U(J,ee,new WeakMap)}var re=C(i(G,{createIsNestedEqual:function(){return l}}));function ce(J,ee){return re(J,ee,new WeakMap)}function ue(J){return C(i(Q,J(Q)))}function he(J){var ee=C(i(G,J(G)));return function(ie,me,Z){return Z===void 0&&(Z=new WeakMap),ee(ie,me,Z)}}n.circularDeepEqual=M,n.circularShallowEqual=ce,n.createCustomCircularEqual=he,n.createCustomEqual=ue,n.deepEqual=W,n.sameValueZeroEqual=l,n.shallowEqual=H,Object.defineProperty(n,"__esModule",{value:!0})})})(Px,Px.exports);var Pw=Px.exports;const Ow=aw(gB);var Ot={},sW=function(t,n,r){return t===n?!0:t.className===n.className&&r(t.style,n.style)&&t.width===n.width&&t.autoSize===n.autoSize&&t.cols===n.cols&&t.draggableCancel===n.draggableCancel&&t.draggableHandle===n.draggableHandle&&r(t.verticalCompact,n.verticalCompact)&&r(t.compactType,n.compactType)&&r(t.layout,n.layout)&&r(t.margin,n.margin)&&r(t.containerPadding,n.containerPadding)&&t.rowHeight===n.rowHeight&&t.maxRows===n.maxRows&&t.isBounded===n.isBounded&&t.isDraggable===n.isDraggable&&t.isResizable===n.isResizable&&t.allowOverlap===n.allowOverlap&&t.preventCollision===n.preventCollision&&t.useCSSTransforms===n.useCSSTransforms&&t.transformScale===n.transformScale&&t.isDroppable===n.isDroppable&&r(t.resizeHandles,n.resizeHandles)&&r(t.resizeHandle,n.resizeHandle)&&t.onLayoutChange===n.onLayoutChange&&t.onDragStart===n.onDragStart&&t.onDrag===n.onDrag&&t.onDragStop===n.onDragStop&&t.onResizeStart===n.onResizeStart&&t.onResize===n.onResize&&t.onResizeStop===n.onResizeStop&&t.onDrop===n.onDrop&&r(t.droppingItem,n.droppingItem)&&r(t.innerRef,n.innerRef)};Object.defineProperty(Ot,"__esModule",{value:!0});Ot.bottom=$w;Ot.childrenEqual=uW;Ot.cloneLayout=eA;Ot.cloneLayoutItem=cl;Ot.collides=jm;Ot.compact=nA;Ot.compactItem=rA;Ot.compactType=SW;Ot.correctBounds=oA;Ot.fastPositionEqual=fW;Ot.fastRGLPropsEqual=void 0;Ot.getAllCollisions=iA;Ot.getFirstCollision=Xa;Ot.getLayoutItem=Tw;Ot.getStatics=Dw;Ot.modifyLayout=tA;Ot.moveElement=yd;Ot.moveElementAwayFromCollision=$x;Ot.noop=void 0;Ot.perc=pW;Ot.resizeItemInDirection=xW;Ot.setTopLeft=_W;Ot.setTransform=wW;Ot.sortLayoutItems=Lw;Ot.sortLayoutItemsByColRow=uA;Ot.sortLayoutItemsByRowCol=cA;Ot.synchronizeLayoutWithChildren=CW;Ot.validateLayout=dA;Ot.withLayoutItem=cW;var fP=Pw,bd=aW(m);function aW(e){return e&&e.__esModule?e:{default:e}}const lW=process.env.NODE_ENV==="production";function $w(e){let t=0,n;for(let r=0,o=e.length;r<o;r++)n=e[r].y+e[r].h,n>t&&(t=n);return t}function eA(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=cl(e[n]);return t}function tA(e,t){const n=Array(e.length);for(let r=0,o=e.length;r<o;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function cW(e,t,n){let r=Tw(e,t);return r?(r=n(cl(r)),e=tA(e,r),[e,r]):[e,null]}function cl(e){return{w:e.w,h:e.h,x:e.x,y:e.y,i:e.i,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,isBounded:e.isBounded}}function uW(e,t){return(0,fP.deepEqual)(bd.default.Children.map(e,n=>n==null?void 0:n.key),bd.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,fP.deepEqual)(bd.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),bd.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}const dW=sW;Ot.fastRGLPropsEqual=dW;function fW(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function jm(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function nA(e,t,n,r){const o=Dw(e),i=Lw(e,t),s=Array(e.length);for(let a=0,l=i.length;a<l;a++){let c=cl(i[a]);c.static||(c=rA(o,c,t,n,i,r),o.push(c)),s[e.indexOf(i[a])]=c,c.moved=!1}return s}const hW={x:"w",y:"h"};function Ox(e,t,n,r){const o=hW[r];t[r]+=1;const i=e.map(s=>s.i).indexOf(t.i);for(let s=i+1;s<e.length;s++){const a=e[s];if(!a.static){if(a.y>t.y+t.h)break;jm(t,a)&&Ox(e,a,n+t[o],r)}}t[r]=n}function rA(e,t,n,r,o,i){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min($w(e),t.y);t.y>0&&!Xa(e,t);)t.y--;else if(a)for(;t.x>0&&!Xa(e,t);)t.x--;let l;for(;(l=Xa(e,t))&&!(n===null&&i);)if(a?Ox(o,t,l.x+l.w,"x"):Ox(o,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!Xa(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function oA(e,t){const n=Dw(e);for(let r=0,o=e.length;r<o;r++){const i=e[r];if(i.x+i.w>t.cols&&(i.x=t.cols-i.w),i.x<0&&(i.x=0,i.w=t.cols),!i.static)n.push(i);else for(;Xa(n,i);)i.y++}return e}function Tw(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function Xa(e,t){for(let n=0,r=e.length;n<r;n++)if(jm(e[n],t))return e[n]}function iA(e,t){return e.filter(n=>jm(n,t))}function Dw(e){return e.filter(t=>t.static)}function yd(e,t,n,r,o,i,s,a,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;"Moving element ".concat(t.i," to [").concat(String(n),",").concat(String(r),"] from [").concat(t.x,",").concat(t.y,"]");const c=t.x,u=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let f=Lw(e,s);(s==="vertical"&&typeof r=="number"?u>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(f=f.reverse());const p=iA(f,t),v=p.length>0;if(v&&l)return eA(e);if(v&&i)return"Collision prevented on ".concat(t.i,", reverting."),t.x=c,t.y=u,t.moved=!1,e;for(let b=0,w=p.length;b<w;b++){const y=p[b];"Resolving collision between ".concat(t.i," at [").concat(t.x,",").concat(t.y,"] and ").concat(y.i," at [").concat(y.x,",").concat(y.y,"]"),!y.moved&&(y.static?e=$x(e,y,t,o,s):e=$x(e,t,y,o,s))}return e}function $x(e,t,n,r,o,i){const s=o==="horizontal",a=o==="vertical",l=t.static;if(r){r=!1;const f={x:s?Math.max(t.x-n.w,0):n.x,y:a?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},h=Xa(e,f),p=h&&h.y+h.h>t.y,v=h&&t.x+t.w>h.x;if(h){if(p&&a)return yd(e,n,void 0,t.y+1,r,l,o);if(p&&o==null)return t.y=n.y,n.y=n.y+n.h,e;if(v&&s)return yd(e,t,n.x,void 0,r,l,o)}else return"Doing reverse collision on ".concat(n.i," up to [").concat(f.x,",").concat(f.y,"]."),yd(e,n,s?f.x:void 0,a?f.y:void 0,r,l,o)}const c=s?n.x+1:void 0,u=a?n.y+1:void 0;return c==null&&u==null?e:yd(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,o)}function pW(e){return e*100+"%"}const sA=(e,t,n,r)=>e+n>r?t:n,aA=(e,t,n)=>e<0?t:n,lA=e=>Math.max(0,e),Aw=e=>Math.max(0,e),kw=(e,t,n)=>{let{left:r,height:o,width:i}=t;const s=e.top-(o-e.height);return{left:r,width:i,height:aA(s,e.height,o),top:Aw(s)}},Mw=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{top:r,height:i,width:sA(e.left,e.width,s,n),left:lA(o)}},Iw=(e,t,n)=>{let{top:r,height:o,width:i}=t;const s=e.left-(i-e.width);return{height:o,width:s<0?e.width:sA(e.left,e.width,i,n),top:Aw(r),left:lA(s)}},Nw=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{width:s,left:o,height:aA(r,e.height,i),top:Aw(r)}},gW=function(){return kw(arguments.length<=0?void 0:arguments[0],Mw(...arguments))},mW=function(){return kw(arguments.length<=0?void 0:arguments[0],Iw(...arguments))},vW=function(){return Nw(arguments.length<=0?void 0:arguments[0],Mw(...arguments))},bW=function(){return Nw(arguments.length<=0?void 0:arguments[0],Iw(...arguments))},yW={n:kw,ne:gW,e:Mw,se:vW,s:Nw,sw:bW,w:Iw,nw:mW};function xW(e,t,n,r){const o=yW[e];return o?o(t,{...t,...n},r):n}function wW(e){let{top:t,left:n,width:r,height:o}=e;const i="translate(".concat(n,"px,").concat(t,"px)");return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:"".concat(r,"px"),height:"".concat(o,"px"),position:"absolute"}}function _W(e){let{top:t,left:n,width:r,height:o}=e;return{top:"".concat(t,"px"),left:"".concat(n,"px"),width:"".concat(r,"px"),height:"".concat(o,"px"),position:"absolute"}}function Lw(e,t){return t==="horizontal"?uA(e):t==="vertical"?cA(e):e}function cA(e){return e.slice(0).sort(function(t,n){return t.y>n.y||t.y===n.y&&t.x>n.x?1:t.y===n.y&&t.x===n.x?0:-1})}function uA(e){return e.slice(0).sort(function(t,n){return t.x>n.x||t.x===n.x&&t.y>n.y?1:-1})}function CW(e,t,n,r,o){e=e||[];const i=[];bd.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=Tw(e,String(a.key)),c=a.props["data-grid"];l&&c==null?i.push(cl(l)):c?(lW||dA([c],"ReactGridLayout.children"),i.push(cl({...c,i:a.key}))):i.push(cl({w:1,h:1,x:0,y:$w(i),i:String(a.key)}))});const s=oA(i,{cols:n});return o?s:nA(s,r,n)}function dA(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const n=["x","y","w","h"];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(let r=0,o=e.length;r<o;r++){const i=e[r];for(let s=0;s<n.length;s++)if(typeof i[n[s]]!="number")throw new Error("ReactGridLayout: "+t+"["+r+"]."+n[s]+" must be a number!")}}function SW(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const EW=()=>{};Ot.noop=EW;var Di={};Object.defineProperty(Di,"__esModule",{value:!0});Di.calcGridColWidth=zm;Di.calcGridItemPosition=RW;Di.calcGridItemWHPx=Tx;Di.calcWH=OW;Di.calcXY=PW;Di.clamp=Qa;function zm(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function Tx(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function RW(e,t,n,r,o,i){const{margin:s,containerPadding:a,rowHeight:l}=e,c=zm(e),u={};return i&&i.resizing?(u.width=Math.round(i.resizing.width),u.height=Math.round(i.resizing.height)):(u.width=Tx(r,c,s[0]),u.height=Tx(o,l,s[1])),i&&i.dragging?(u.top=Math.round(i.dragging.top),u.left=Math.round(i.dragging.left)):i&&i.resizing&&typeof i.resizing.top=="number"&&typeof i.resizing.left=="number"?(u.top=Math.round(i.resizing.top),u.left=Math.round(i.resizing.left)):(u.top=Math.round((l+s[1])*n+a[1]),u.left=Math.round((c+s[0])*t+a[0])),u}function PW(e,t,n,r,o){const{margin:i,cols:s,rowHeight:a,maxRows:l}=e,c=zm(e);let u=Math.round((n-i[0])/(c+i[0])),f=Math.round((t-i[1])/(a+i[1]));return u=Qa(u,0,s-r),f=Qa(f,0,l-o),{x:u,y:f}}function OW(e,t,n,r,o,i){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,u=zm(e);let f=Math.round((t+s[0])/(u+s[0])),h=Math.round((n+s[1])/(c+s[1])),p=Qa(f,0,l-r),v=Qa(h,0,a-o);return["sw","w","nw"].indexOf(i)!==-1&&(p=Qa(f,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(v=Qa(h,0,a)),{w:p,h:v}}function Qa(e,t,n){return Math.max(Math.min(e,n),t)}var Bm={},Dx={exports:{}},f0,hP;function Fw(){if(hP)return f0;hP=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return f0=e,f0}var h0,pP;function $W(){if(pP)return h0;pP=1;var e=Fw();function t(){}function n(){}return n.resetWarningCache=t,h0=function(){function r(s,a,l,c,u,f){if(f!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function o(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},h0}var mp={exports:{}},qt={};/** @license React v16.13.1
88
+ }`;var xt=IR(function(){return zt(V,Ye+"return "+Pe).apply(n,Y)});if(xt.source=Pe,Ub(xt))throw xt;return xt}function bz(d){return Gt(d).toLowerCase()}function yz(d){return Gt(d).toUpperCase()}function xz(d,g,x){if(d=Gt(d),d&&(x||g===n))return WS(d);if(!d||!(g=Ur(g)))return d;var P=zo(d),k=zo(g),V=US(P,k),Y=GS(P,k)+1;return As(P,V,Y).join("")}function wz(d,g,x){if(d=Gt(d),d&&(x||g===n))return d.slice(0,YS(d)+1);if(!d||!(g=Ur(g)))return d;var P=zo(d),k=GS(P,zo(g))+1;return As(P,0,k).join("")}function _z(d,g,x){if(d=Gt(d),d&&(x||g===n))return d.replace(Vn,"");if(!d||!(g=Ur(g)))return d;var P=zo(d),k=US(P,zo(g));return As(P,k).join("")}function Cz(d,g){var x=L,P=j;if(wn(g)){var k="separator"in g?g.separator:k;x="length"in g?pt(g.length):x,P="omission"in g?Ur(g.omission):P}d=Gt(d);var V=d.length;if(Wl(d)){var Y=zo(d);V=Y.length}if(x>=V)return d;var ne=x-Ul(P);if(ne<1)return P;var le=Y?As(Y,0,ne).join(""):d.slice(0,ne);if(k===n)return le+P;if(Y&&(ne+=le.length-ne),Gb(k)){if(d.slice(ne).search(k)){var we,_e=le;for(k.global||(k=lb(k.source,Gt(Ge.exec(k))+"g")),k.lastIndex=0;we=k.exec(_e);)var Pe=we.index;le=le.slice(0,Pe===n?ne:Pe)}}else if(d.indexOf(Ur(k),ne)!=ne){var je=le.lastIndexOf(k);je>-1&&(le=le.slice(0,je))}return le+P}function Sz(d){return d=Gt(d),d&&$n.test(d)?d.replace(Qt,Z7):d}var Ez=Jl(function(d,g,x){return d+(x?" ":"")+g.toUpperCase()}),Kb=NE("toUpperCase");function MR(d,g,x){return d=Gt(d),g=x?n:g,g===n?Y7(d)?n6(d):j7(d):d.match(g)||[]}var IR=St(function(d,g){try{return Hr(d,n,g)}catch(x){return Ub(x)?x:new ct(x)}}),Rz=Hi(function(d,g){return yo(g,function(x){x=ci(x),Bi(d,x,Hb(d[x],d))}),d});function Pz(d){var g=d==null?0:d.length,x=Je();return d=g?yn(d,function(P){if(typeof P[1]!="function")throw new xo(s);return[x(P[0]),P[1]]}):[],St(function(P){for(var k=-1;++k<g;){var V=d[k];if(Hr(V[0],this,P))return Hr(V[1],this,P)}})}function Oz(d){return Z6(_o(d,f))}function Xb(d){return function(){return d}}function $z(d,g){return d==null||d!==d?g:d}var Tz=FE(),Dz=FE(!0);function $r(d){return d}function Qb(d){return pE(typeof d=="function"?d:_o(d,f))}function Az(d){return mE(_o(d,f))}function kz(d,g){return vE(d,_o(g,f))}var Mz=St(function(d,g){return function(x){return Fu(x,d,g)}}),Iz=St(function(d,g){return function(x){return Fu(d,x,g)}});function Jb(d,g,x){var P=Wn(g),k=Uh(g,P);x==null&&!(wn(g)&&(k.length||!P.length))&&(x=g,g=d,d=this,k=Uh(g,Wn(g)));var V=!(wn(x)&&"chain"in x)||!!x.chain,Y=Ui(d);return yo(k,function(ne){var le=g[ne];d[ne]=le,Y&&(d.prototype[ne]=function(){var we=this.__chain__;if(V||we){var _e=d(this.__wrapped__),Pe=_e.__actions__=Rr(this.__actions__);return Pe.push({func:le,args:arguments,thisArg:d}),_e.__chain__=we,_e}return le.apply(d,Rs([this.value()],arguments))})}),d}function Nz(){return qn._===this&&(qn._=l6),this}function Zb(){}function Lz(d){return d=pt(d),St(function(g){return bE(g,d)})}var Fz=Tb(yn),jz=Tb(jS),zz=Tb(tb);function NR(d){return Lb(d)?nb(ci(d)):m9(d)}function Bz(d){return function(g){return d==null?n:Oa(d,g)}}var Vz=zE(),Hz=zE(!0);function e0(){return[]}function t0(){return!1}function Wz(){return{}}function Uz(){return""}function Gz(){return!0}function qz(d,g){if(d=pt(d),d<1||d>K)return[];var x=H,P=or(d,H);g=Je(g),d-=H;for(var k=ib(P,g);++x<d;)g(x);return k}function Yz(d){return ut(d)?yn(d,ci):Gr(d)?[d]:Rr(nR(Gt(d)))}function Kz(d){var g=++s6;return Gt(d)+g}var Xz=Qh(function(d,g){return d+g},0),Qz=Db("ceil"),Jz=Qh(function(d,g){return d/g},1),Zz=Db("floor");function eB(d){return d&&d.length?Wh(d,$r,mb):n}function tB(d,g){return d&&d.length?Wh(d,Je(g,2),mb):n}function nB(d){return VS(d,$r)}function rB(d,g){return VS(d,Je(g,2))}function oB(d){return d&&d.length?Wh(d,$r,xb):n}function iB(d,g){return d&&d.length?Wh(d,Je(g,2),xb):n}var sB=Qh(function(d,g){return d*g},1),aB=Db("round"),lB=Qh(function(d,g){return d-g},0);function cB(d){return d&&d.length?ob(d,$r):0}function uB(d,g){return d&&d.length?ob(d,Je(g,2)):0}return z.after=A8,z.ary=hR,z.assign=yj,z.assignIn=PR,z.assignInWith=up,z.assignWith=xj,z.at=wj,z.before=pR,z.bind=Hb,z.bindAll=Rz,z.bindKey=gR,z.castArray=W8,z.chain=uR,z.chunk=Z9,z.compact=e4,z.concat=t4,z.cond=Pz,z.conforms=Oz,z.constant=Xb,z.countBy=c8,z.create=_j,z.curry=mR,z.curryRight=vR,z.debounce=bR,z.defaults=Cj,z.defaultsDeep=Sj,z.defer=k8,z.delay=M8,z.difference=n4,z.differenceBy=r4,z.differenceWith=o4,z.drop=i4,z.dropRight=s4,z.dropRightWhile=a4,z.dropWhile=l4,z.fill=c4,z.filter=d8,z.flatMap=p8,z.flatMapDeep=g8,z.flatMapDepth=m8,z.flatten=sR,z.flattenDeep=u4,z.flattenDepth=d4,z.flip=I8,z.flow=Tz,z.flowRight=Dz,z.fromPairs=f4,z.functions=Dj,z.functionsIn=Aj,z.groupBy=v8,z.initial=p4,z.intersection=g4,z.intersectionBy=m4,z.intersectionWith=v4,z.invert=Mj,z.invertBy=Ij,z.invokeMap=y8,z.iteratee=Qb,z.keyBy=x8,z.keys=Wn,z.keysIn=Or,z.map=op,z.mapKeys=Lj,z.mapValues=Fj,z.matches=Az,z.matchesProperty=kz,z.memoize=sp,z.merge=jj,z.mergeWith=OR,z.method=Mz,z.methodOf=Iz,z.mixin=Jb,z.negate=ap,z.nthArg=Lz,z.omit=zj,z.omitBy=Bj,z.once=N8,z.orderBy=w8,z.over=Fz,z.overArgs=L8,z.overEvery=jz,z.overSome=zz,z.partial=Wb,z.partialRight=yR,z.partition=_8,z.pick=Vj,z.pickBy=$R,z.property=NR,z.propertyOf=Bz,z.pull=w4,z.pullAll=lR,z.pullAllBy=_4,z.pullAllWith=C4,z.pullAt=S4,z.range=Vz,z.rangeRight=Hz,z.rearg=F8,z.reject=E8,z.remove=E4,z.rest=j8,z.reverse=Bb,z.sampleSize=P8,z.set=Wj,z.setWith=Uj,z.shuffle=O8,z.slice=R4,z.sortBy=D8,z.sortedUniq=k4,z.sortedUniqBy=M4,z.split=pz,z.spread=z8,z.tail=I4,z.take=N4,z.takeRight=L4,z.takeRightWhile=F4,z.takeWhile=j4,z.tap=e8,z.throttle=B8,z.thru=rp,z.toArray=SR,z.toPairs=TR,z.toPairsIn=DR,z.toPath=Yz,z.toPlainObject=RR,z.transform=Gj,z.unary=V8,z.union=z4,z.unionBy=B4,z.unionWith=V4,z.uniq=H4,z.uniqBy=W4,z.uniqWith=U4,z.unset=qj,z.unzip=Vb,z.unzipWith=cR,z.update=Yj,z.updateWith=Kj,z.values=tc,z.valuesIn=Xj,z.without=G4,z.words=MR,z.wrap=H8,z.xor=q4,z.xorBy=Y4,z.xorWith=K4,z.zip=X4,z.zipObject=Q4,z.zipObjectDeep=J4,z.zipWith=Z4,z.entries=TR,z.entriesIn=DR,z.extend=PR,z.extendWith=up,Jb(z,z),z.add=Xz,z.attempt=IR,z.camelCase=ez,z.capitalize=AR,z.ceil=Qz,z.clamp=Qj,z.clone=U8,z.cloneDeep=q8,z.cloneDeepWith=Y8,z.cloneWith=G8,z.conformsTo=K8,z.deburr=kR,z.defaultTo=$z,z.divide=Jz,z.endsWith=tz,z.eq=Vo,z.escape=nz,z.escapeRegExp=rz,z.every=u8,z.find=f8,z.findIndex=oR,z.findKey=Ej,z.findLast=h8,z.findLastIndex=iR,z.findLastKey=Rj,z.floor=Zz,z.forEach=dR,z.forEachRight=fR,z.forIn=Pj,z.forInRight=Oj,z.forOwn=$j,z.forOwnRight=Tj,z.get=qb,z.gt=X8,z.gte=Q8,z.has=kj,z.hasIn=Yb,z.head=aR,z.identity=$r,z.includes=b8,z.indexOf=h4,z.inRange=Jj,z.invoke=Nj,z.isArguments=Da,z.isArray=ut,z.isArrayBuffer=J8,z.isArrayLike=Pr,z.isArrayLikeObject=Tn,z.isBoolean=Z8,z.isBuffer=ks,z.isDate=ej,z.isElement=tj,z.isEmpty=nj,z.isEqual=rj,z.isEqualWith=oj,z.isError=Ub,z.isFinite=ij,z.isFunction=Ui,z.isInteger=xR,z.isLength=lp,z.isMap=wR,z.isMatch=sj,z.isMatchWith=aj,z.isNaN=lj,z.isNative=cj,z.isNil=dj,z.isNull=uj,z.isNumber=_R,z.isObject=wn,z.isObjectLike=En,z.isPlainObject=Wu,z.isRegExp=Gb,z.isSafeInteger=fj,z.isSet=CR,z.isString=cp,z.isSymbol=Gr,z.isTypedArray=ec,z.isUndefined=hj,z.isWeakMap=pj,z.isWeakSet=gj,z.join=b4,z.kebabCase=oz,z.last=So,z.lastIndexOf=y4,z.lowerCase=iz,z.lowerFirst=sz,z.lt=mj,z.lte=vj,z.max=eB,z.maxBy=tB,z.mean=nB,z.meanBy=rB,z.min=oB,z.minBy=iB,z.stubArray=e0,z.stubFalse=t0,z.stubObject=Wz,z.stubString=Uz,z.stubTrue=Gz,z.multiply=sB,z.nth=x4,z.noConflict=Nz,z.noop=Zb,z.now=ip,z.pad=az,z.padEnd=lz,z.padStart=cz,z.parseInt=uz,z.random=Zj,z.reduce=C8,z.reduceRight=S8,z.repeat=dz,z.replace=fz,z.result=Hj,z.round=aB,z.runInContext=se,z.sample=R8,z.size=$8,z.snakeCase=hz,z.some=T8,z.sortedIndex=P4,z.sortedIndexBy=O4,z.sortedIndexOf=$4,z.sortedLastIndex=T4,z.sortedLastIndexBy=D4,z.sortedLastIndexOf=A4,z.startCase=gz,z.startsWith=mz,z.subtract=lB,z.sum=cB,z.sumBy=uB,z.template=vz,z.times=qz,z.toFinite=Gi,z.toInteger=pt,z.toLength=ER,z.toLower=bz,z.toNumber=Eo,z.toSafeInteger=bj,z.toString=Gt,z.toUpper=yz,z.trim=xz,z.trimEnd=wz,z.trimStart=_z,z.truncate=Cz,z.unescape=Sz,z.uniqueId=Kz,z.upperCase=Ez,z.upperFirst=Kb,z.each=dR,z.eachRight=fR,z.first=aR,Jb(z,function(){var d={};return ai(z,function(g,x){Jt.call(z.prototype,x)||(d[x]=g)}),d}(),{chain:!1}),z.VERSION=r,yo(["bind","bindKey","curry","curryRight","partial","partialRight"],function(d){z[d].placeholder=z}),yo(["drop","take"],function(d,g){Mt.prototype[d]=function(x){x=x===n?1:Ln(pt(x),0);var P=this.__filtered__&&!g?new Mt(this):this.clone();return P.__filtered__?P.__takeCount__=or(x,P.__takeCount__):P.__views__.push({size:or(x,H),type:d+(P.__dir__<0?"Right":"")}),P},Mt.prototype[d+"Right"]=function(x){return this.reverse()[d](x).reverse()}}),yo(["filter","map","takeWhile"],function(d,g){var x=g+1,P=x==q||x==Q;Mt.prototype[d]=function(k){var V=this.clone();return V.__iteratees__.push({iteratee:Je(k,3),type:x}),V.__filtered__=V.__filtered__||P,V}}),yo(["head","last"],function(d,g){var x="take"+(g?"Right":"");Mt.prototype[d]=function(){return this[x](1).value()[0]}}),yo(["initial","tail"],function(d,g){var x="drop"+(g?"":"Right");Mt.prototype[d]=function(){return this.__filtered__?new Mt(this):this[x](1)}}),Mt.prototype.compact=function(){return this.filter($r)},Mt.prototype.find=function(d){return this.filter(d).head()},Mt.prototype.findLast=function(d){return this.reverse().find(d)},Mt.prototype.invokeMap=St(function(d,g){return typeof d=="function"?new Mt(this):this.map(function(x){return Fu(x,d,g)})}),Mt.prototype.reject=function(d){return this.filter(ap(Je(d)))},Mt.prototype.slice=function(d,g){d=pt(d);var x=this;return x.__filtered__&&(d>0||g<0)?new Mt(x):(d<0?x=x.takeRight(-d):d&&(x=x.drop(d)),g!==n&&(g=pt(g),x=g<0?x.dropRight(-g):x.take(g-d)),x)},Mt.prototype.takeRightWhile=function(d){return this.reverse().takeWhile(d).reverse()},Mt.prototype.toArray=function(){return this.take(H)},ai(Mt.prototype,function(d,g){var x=/^(?:filter|find|map|reject)|While$/.test(g),P=/^(?:head|last)$/.test(g),k=z[P?"take"+(g=="last"?"Right":""):g],V=P||/^find/.test(g);k&&(z.prototype[g]=function(){var Y=this.__wrapped__,ne=P?[1]:arguments,le=Y instanceof Mt,we=ne[0],_e=le||ut(Y),Pe=function($t){var It=k.apply(z,Rs([$t],ne));return P&&je?It[0]:It};_e&&x&&typeof we=="function"&&we.length!=1&&(le=_e=!1);var je=this.__chain__,Ye=!!this.__actions__.length,et=V&&!je,xt=le&&!Ye;if(!V&&_e){Y=xt?Y:new Mt(this);var tt=d.apply(Y,ne);return tt.__actions__.push({func:rp,args:[Pe],thisArg:n}),new wo(tt,je)}return et&&xt?d.apply(this,ne):(tt=this.thru(Pe),et?P?tt.value()[0]:tt.value():tt)})}),yo(["pop","push","shift","sort","splice","unshift"],function(d){var g=$h[d],x=/^(?:push|sort|unshift)$/.test(d)?"tap":"thru",P=/^(?:pop|shift)$/.test(d);z.prototype[d]=function(){var k=arguments;if(P&&!this.__chain__){var V=this.value();return g.apply(ut(V)?V:[],k)}return this[x](function(Y){return g.apply(ut(Y)?Y:[],k)})}}),ai(Mt.prototype,function(d,g){var x=z[g];if(x){var P=x.name+"";Jt.call(Kl,P)||(Kl[P]=[]),Kl[P].push({name:g,func:x})}}),Kl[Xh(n,y).name]=[{name:"wrapper",func:n}],Mt.prototype.clone=S6,Mt.prototype.reverse=E6,Mt.prototype.value=R6,z.prototype.at=t8,z.prototype.chain=n8,z.prototype.commit=r8,z.prototype.next=o8,z.prototype.plant=s8,z.prototype.reverse=a8,z.prototype.toJSON=z.prototype.valueOf=z.prototype.value=l8,z.prototype.first=z.prototype.head,Du&&(z.prototype[Du]=i8),z},Gl=r6();Ca?((Ca.exports=Gl)._=Gl,Qv._=Gl):qn._=Gl}).call(Gs)})(jg,jg.exports);var xc=jg.exports;const ll=Pl(xc);function nP({id:e,layouts:t,initialHeight:n,y:r,x:o,w:i,minH:s}){const a={i:e,x:o??0,y:r??1/0,w:i||20,h:n||35,minW:6,minH:s||10};return t||(t={}),hw.forEach(l=>{t!=null&&t[l]||(t={...t,[l]:[]});const c=t[l].reduce((u,f)=>Math.max(u,f.y+f.h),0);a.y=a.y===0?0:c,t[l].push(a)}),t}function rP(e,t){t&&hw.forEach(n=>{t!=null&&t[n]&&(t[n]=t[n].filter(r=>r.i!==e))})}function Tm(e){return Ce.getState().dashboard.globalCacheConfig}const Ce=dD()(bD((e,t)=>({isSessionExpired:!1,currentBreakpoint:"lg",dashboard:{id:"",style:Fg},showContext:!1,selectedSheetId:null,selectedCardId:null,selectedFrameId:null,selectedCard:null,showFilters:!1,isDashboardEditing:!1,isVisualEditing:!1,showDashboardJSON:!1,filteringCards:[],actions:{setInitStore:()=>{e(n=>{n.isSessionExpired=!1,n.currentBreakpoint="lg",n.dashboard={id:"",style:Fg},n.showContext=!1,n.selectedSheetId=null,n.selectedCardId=null,n.selectedFrameId=null,n.selectedCard=null,n.showFilters=!1,n.isDashboardEditing=!1,n.isVisualEditing=!1,n.showDashboardJSON=!1,n.filteringCards=[],n.selectedLensId=void 0,n.filterValues=void 0})},setGlobalCacheConfig:n=>{e(r=>{r.dashboard.globalCacheConfig=n})},setLenses:n=>{e(r=>{r.lenses=n})},setSelectedLensId:n=>{e(r=>{r.selectedLensId=n})},deleteSheet:n=>{e(r=>{var i,s,a,l;const o=(i=r.dashboard.sheets)==null?void 0:i.findIndex(c=>c.id===n);o!==void 0&&o>-1&&((s=r.dashboard.sheets)==null||s.splice(o,1),r.selectedSheetId=(l=(a=r.dashboard.sheets)==null?void 0:a[0])==null?void 0:l.id)})},addSheet:n=>{e(r=>{r.dashboard.sheets||(r.dashboard.sheets=[]);const o=r.dashboard.filters;let i={};o==null||o.forEach(a=>{hw.forEach(l=>{i!=null&&i[l]||(i={...i,[l]:[]});const c={i:a.id,x:0,y:0,w:10,h:8};i[l].push(c)})});const s={...n,layouts:i};r.dashboard.sheets.push(s)})},setGlobalStyle:n=>{e(r=>{r.dashboard.globalStyle=n})},setAIScopeTables:n=>{e(r=>{r.dashboard.aiScopeTables=n})},setIsSessionExpired:n=>{e(()=>({isSessionExpired:n}))},setCardPython:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===o.selectedSheetId);i&&xc.forEach(i.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(f=>f.id===n);c&&(c.python=r)})})},addBaseQuery:n=>{e(r=>{var o;r.dashboard.baseQueries||(r.dashboard.baseQueries=[]),(o=r.dashboard.baseQueries)==null||o.push(n)})},removeBaseQuery:n=>{e(r=>{var i,s;const o=(i=r.dashboard.baseQueries)==null?void 0:i.findIndex(a=>a.id===n);o!=null&&o>-1&&((s=r.dashboard.baseQueries)==null||s.splice(o,1))})},setBaseQueries:n=>{e(r=>{r.dashboard.baseQueries=n})},setCurrentBreakpoint:n=>{e(()=>({currentBreakpoint:n}))},setFilteringCards:n=>{e(()=>({filteringCards:n}))},addFilteringCard:n=>{e(r=>{var o;(o=r.filteringCards)==null||o.push(n)})},removeFilteringCard:n=>{e(r=>{var i,s;const o=(i=r.filteringCards)==null?void 0:i.findIndex(a=>a.id===n.id);o!==void 0&&o>-1&&((s=r.filteringCards)==null||s.splice(o,1))})},setCustomCards:n=>{e(r=>{r.dashboard.customCards=n})},setAuthToken:n=>{e(()=>({authToken:n}))},setThemeStyle:n=>{e(()=>({themeStyle:n}))},setDashboard:n=>e({dashboard:n}),setDashboardWithFilterValues:(n,r)=>{e(o=>{o.dashboard=n,o.filterValues=r})},setDashboardTheme:n=>{e(r=>{r.theme=n})},setSheets:n=>{e(r=>{r.dashboard&&(r.dashboard.sheets=n)})},setSheetTitle:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.title=r)})},setCardTitle:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&xc.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(h=>h.id===r);u&&(u.title=o)})})},setCardInfo:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===o.selectedSheetId);i&&xc.forEach(i.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(f=>f.id===n);c&&(c.info=r)})})},setCardDescription:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&xc.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(h=>h.id===r);u&&(u.description=o)})})},setCardSql:(n,r,o)=>{e(i=>{var a,l,c,u;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){const f=(c=s.cards)==null?void 0:c.find(h=>h.id===r);f&&(f.sql=o,(u=i.onUpdateCard)==null||u.call(i,f,n))}})},setFrameCardData:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&xc.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(h=>h.id===r);u&&(u.data=o)})})},setSheetLayout:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layout=r)})},setSheetLayouts:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layouts=r)})},setShowContext:n=>{e(()=>({showContext:n}))},setShowFilters:n=>{e(()=>({showFilters:n}))},setFilterValues:n=>{e(()=>({filterValues:n}))},addOrUpdateFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1?r.filterValues.splice(o,1,n):r.filterValues.push(n)}else r.filterValues=[n]})},addOrUpdateFilterValues:n=>{e(r=>{r.filterValues?n.forEach(o=>{var s,a,l;const i=(s=r==null?void 0:r.filterValues)==null?void 0:s.findIndex(c=>c.filterId===o.filterId);i!==void 0&&i>-1?(a=r.filterValues)==null||a.splice(i,1,o):(l=r.filterValues)==null||l.push(o)}):r.filterValues=n})},removeFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.filter(i=>i.filterId!==n&&!i.filterId.startsWith(n));r.filterValues=o}})},replaceFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1&&r.filterValues.splice(o,1,n)}})},addFilter:n=>{e(r=>{var i,s;r.dashboard.filters?(i=r.dashboard.filters)==null||i.push(n):r.dashboard.filters=[n],(s=r.dashboard.sheets)==null||s.find(a=>a.id===r.selectedSheetId);const o=r.dashboard.sheets;o==null||o.forEach(a=>{nP({id:n.id,layouts:a.layouts,y:0,initialHeight:8,minH:7,w:10})})})},removeFilter:n=>{e(r=>{var o,i,s;if(r.dashboard.filters){const a=(o=r.dashboard.filters)==null?void 0:o.findIndex(l=>l.id===n);if(a>-1){(i=r.dashboard.filters)==null||i.splice(a,1),(s=r.dashboard.sheets)==null||s.find(c=>c.id===r.selectedSheetId);const l=r.dashboard.sheets;l==null||l.forEach(c=>{rP(n,c.layouts)})}}})},updateFrameCard:(n,r,o)=>{e(i=>{var l,c,u,f,h;const s=(c=(l=i.dashboard)==null?void 0:l.sheets)==null?void 0:c.find(p=>p.id===n);if(!s)return;const a=(u=s==null?void 0:s.frames)==null?void 0:u.find(p=>p.id===r);if(a){const p=(f=a.cards)==null?void 0:f.findIndex(v=>v.id===o.id);p>-1&&((h=a.cards)==null||h.splice(p,1,o))}})},updateFilter:n=>{e(r=>{var o,i;if(r.dashboard.filters){const s=(o=r.dashboard.filters)==null?void 0:o.findIndex(a=>a.id===n.id);s>-1&&((i=r.dashboard.filters)==null||i.splice(s,1,n))}})},setIsDashboardEditing:n=>{e(()=>({isDashboardEditing:n}))},setShowDashboardJSON:n=>{e(()=>({showDashboardJSON:n}))},setIsVisualEditing:n=>{e(()=>({isVisualEditing:n}))},addFrame:(n,r,o)=>{e(i=>{var a,l,c,u;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){s.frames||(s.frames=[]),(c=s.frames)==null||c.push(r);let f=1/0;const h=0;o==="start"&&(f=0),nP({id:r.id,layouts:s.layouts,minH:10,x:h,y:f}),(u=i.onAddFrame)==null||u.call(i,r,n)}})},removeFrame:(n,r)=>{e(o=>{var s,a,l,c,u;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(f=>f.id===n);if(i){const f=(l=i.frames)==null?void 0:l.findIndex(h=>h.id===r);console.log(f),typeof f=="number"&&f>-1&&((c=i.frames)==null||c.splice(f,1),(u=i.layout)==null||u.splice(f,1),rP(r,i.layouts))}})},updateFrame:(n,r)=>{e(o=>{var a,l,c,u,f;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(h=>h.id===n),s=(c=i==null?void 0:i.frames)==null?void 0:c.findIndex(h=>h.id===r.id);i&&((u=i.frames)==null||u.splice(s,1,r)),(f=o.onAcceptChanges)==null||f.call(o,r,o.dashboard)})},updateCard:(n,r)=>{e(o=>{var a,l,c,u,f;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(h=>h.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(h=>h.id===r.id);i&&((u=i.cards)==null||u.splice(s,1,r),(f=o.onUpdateCard)==null||f.call(o,r,n))})},removeCard:(n,r)=>{e(o=>{var a,l,c,u,f,h;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(p=>p.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(p=>p.id===r.id);i&&((u=i.cards)==null||u.splice(s,1),(f=i.layout)==null||f.splice(s,1),(h=o.onRemoveCard)==null||h.call(o,r,n))})},setStyle:n=>{e(r=>{r.dashboard&&(r.dashboard.style=n)})},setSelectedCardId:(n,r)=>{e(o=>{var s,a,l;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===n);i&&(((l=i.cards)==null?void 0:l.find(u=>u.id===r))?o.selectedCardId=r:o.selectedCardId=null)})},setSelectedFrameId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(a=>a.id===r.selectedSheetId))&&(r.selectedFrameId=n)})},setSelectedSheetId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(a=>a.id===n))&&(r.selectedSheetId=n)})},setOnSaveFunction:n=>{e(()=>({onSaveFunction:n}))},setOnAddCard:n=>{e(()=>({onAddCard:n}))},setOnAcceptChanges:n=>{e(()=>({onAcceptChanges:n}))},setOnUpdateCard:n=>{e(()=>({onUpdateCard:n}))},setOnRemoveCard:n=>{e(()=>({onRemoveCard:n}))},setOnEvent:n=>{e(()=>({onEvent:n}))},getDashboard:()=>t().dashboard,getSelectedSheet:()=>{var n,r;return(r=(n=t().dashboard)==null?void 0:n.sheets)==null?void 0:r.find(o=>o.id===t().selectedSheetId)},getCardFrame:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a){for(let l=0;l<a.length;l++)if((i=a[l].cards)==null?void 0:i.find(u=>u.id===n))return a[l]}}},getSelectedFrame:()=>{var r,o,i;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(s=>s.id===t().selectedSheetId);return(i=n==null?void 0:n.frames)==null?void 0:i.find(s=>s.id===t().selectedFrameId)},getCard:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a)for(let l=0;l<a.length;l++){const c=(i=a[l].cards)==null?void 0:i.find(u=>u.id===n);if(c)return c}}},getSelectedSheetLayout:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layout},getSelectedSheetLayouts:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layouts},getStyle:()=>{var n;return(n=t().dashboard)==null?void 0:n.style},getCardSheet(n){var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a){for(let l=0;l<a.length;l++)if((i=a[l].cards)==null?void 0:i.find(u=>u.id===n))return r[s]}}},handleDataPointClickAction:(n,r)=>{FV({card:n,dataPoint:r,set:e,get:t})}}}))),ur=()=>Ce(e=>e.actions),jV={theme:"system",setTheme:()=>null},ED=m.createContext(jV);function zV({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[o,i]=m.useState(()=>localStorage.getItem(n)||t);m.useEffect(()=>{const a=window.document.documentElement;if(a.classList.remove("light","dark"),o==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";a.classList.add(l);return}a.classList.add(o)},[o]);const s={theme:o,setTheme:a=>{localStorage.setItem(n,a),i(a)}};return E.jsx(ED.Provider,{...r,value:s,children:e})}const RD=()=>{const e=m.useContext(ED);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};var Gf=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},nu=typeof window>"u"||"Deno"in window;function To(){}function BV(e,t){return typeof e=="function"?e(t):e}function dx(e){return typeof e=="number"&&e>=0&&e!==1/0}function PD(e,t){return Math.max(e+(t||0)-Date.now(),0)}function oP(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==mw(s,t.options))return!1}else if(!Kd(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||typeof o<"u"&&o!==t.state.fetchStatus||i&&!i(t))}function iP(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Yd(t.options.mutationKey)!==Yd(i))return!1}else if(!Kd(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function mw(e,t){return((t==null?void 0:t.queryKeyHashFn)||Yd)(e)}function Yd(e){return JSON.stringify(e,(t,n)=>hx(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Kd(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Kd(e[n],t[n])):!1}function OD(e,t){if(e===t)return e;const n=sP(e)&&sP(t);if(n||hx(e)&&hx(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),s=i.length,a=n?[]:{};let l=0;for(let c=0;c<s;c++){const u=n?c:i[c];!n&&e[u]===void 0&&t[u]===void 0&&r.includes(u)?(a[u]=void 0,l++):(a[u]=OD(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return o===s&&l===o?e:a}return t}function fx(e,t){if(e&&!t||t&&!e)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function sP(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function hx(e){if(!aP(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!aP(n)||!n.hasOwnProperty("isPrototypeOf"))}function aP(e){return Object.prototype.toString.call(e)==="[object Object]"}function VV(e){return new Promise(t=>{setTimeout(t,e)})}function px(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?OD(e,t):t}function HV(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function WV(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var el,qs,Lc,qT,UV=(qT=class extends Gf{constructor(){super();Xe(this,el,void 0);Xe(this,qs,void 0);Xe(this,Lc,void 0);Ve(this,Lc,t=>{if(!nu&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){ae(this,qs)||this.setEventListener(ae(this,Lc))}onUnsubscribe(){var t;this.hasListeners()||((t=ae(this,qs))==null||t.call(this),Ve(this,qs,void 0))}setEventListener(t){var n;Ve(this,Lc,t),(n=ae(this,qs))==null||n.call(this),Ve(this,qs,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){ae(this,el)!==t&&(Ve(this,el,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof ae(this,el)=="boolean"?ae(this,el):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},el=new WeakMap,qs=new WeakMap,Lc=new WeakMap,qT),zg=new UV,Fc,Ys,jc,YT,GV=(YT=class extends Gf{constructor(){super();Xe(this,Fc,!0);Xe(this,Ys,void 0);Xe(this,jc,void 0);Ve(this,jc,t=>{if(!nu&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){ae(this,Ys)||this.setEventListener(ae(this,jc))}onUnsubscribe(){var t;this.hasListeners()||((t=ae(this,Ys))==null||t.call(this),Ve(this,Ys,void 0))}setEventListener(t){var n;Ve(this,jc,t),(n=ae(this,Ys))==null||n.call(this),Ve(this,Ys,t(this.setOnline.bind(this)))}setOnline(t){ae(this,Fc)!==t&&(Ve(this,Fc,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return ae(this,Fc)}},Fc=new WeakMap,Ys=new WeakMap,jc=new WeakMap,YT),Bg=new GV;function qV(e){return Math.min(1e3*2**e,3e4)}function Dm(e){return(e??"online")==="online"?Bg.isOnline():!0}var $D=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function u0(e){return e instanceof $D}function TD(e){let t=!1,n=0,r=!1,o,i,s;const a=new Promise((w,y)=>{i=w,s=y}),l=w=>{var y;r||(p(new $D(w)),(y=e.abort)==null||y.call(e))},c=()=>{t=!0},u=()=>{t=!1},f=()=>!zg.isFocused()||e.networkMode!=="always"&&!Bg.isOnline(),h=w=>{var y;r||(r=!0,(y=e.onSuccess)==null||y.call(e,w),o==null||o(),i(w))},p=w=>{var y;r||(r=!0,(y=e.onError)==null||y.call(e,w),o==null||o(),s(w))},v=()=>new Promise(w=>{var y;o=_=>{const C=r||!f();return C&&w(_),C},(y=e.onPause)==null||y.call(e)}).then(()=>{var w;o=void 0,r||(w=e.onContinue)==null||w.call(e)}),b=()=>{if(r)return;let w;try{w=e.fn()}catch(y){w=Promise.reject(y)}Promise.resolve(w).then(h).catch(y=>{var $;if(r)return;const _=e.retry??(nu?0:3),C=e.retryDelay??qV,R=typeof C=="function"?C(n,y):C,S=_===!0||typeof _=="number"&&n<_||typeof _=="function"&&_(n,y);if(t||!S){p(y);return}n++,($=e.onFail)==null||$.call(e,n,y),VV(R).then(()=>{if(f())return v()}).then(()=>{t?p(y):b()})})};return Dm(e.networkMode)?b():v().then(b),{promise:a,cancel:l,continue:()=>(o==null?void 0:o())?a:Promise.resolve(),cancelRetry:c,continueRetry:u}}function YV(){let e=[],t=0,n=h=>{h()},r=h=>{h()},o=h=>setTimeout(h,0);const i=h=>{o=h},s=h=>{let p;t++;try{p=h()}finally{t--,t||c()}return p},a=h=>{t?e.push(h):o(()=>{n(h)})},l=h=>(...p)=>{a(()=>{h(...p)})},c=()=>{const h=e;e=[],h.length&&o(()=>{r(()=>{h.forEach(p=>{n(p)})})})};return{batch:s,batchCalls:l,schedule:a,setNotifyFunction:h=>{n=h},setBatchNotifyFunction:h=>{r=h},setScheduler:i}}var Qn=YV(),tl,KT,DD=(KT=class{constructor(){Xe(this,tl,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),dx(this.gcTime)&&Ve(this,tl,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(nu?1/0:5*60*1e3))}clearGcTimeout(){ae(this,tl)&&(clearTimeout(ae(this,tl)),Ve(this,tl,void 0))}},tl=new WeakMap,KT),zc,Bc,Po,Ks,Oo,Un,Mf,nl,Vc,wg,Yo,Qi,XT,KV=(XT=class extends DD{constructor(t){super();Xe(this,Vc);Xe(this,Yo);Xe(this,zc,void 0);Xe(this,Bc,void 0);Xe(this,Po,void 0);Xe(this,Ks,void 0);Xe(this,Oo,void 0);Xe(this,Un,void 0);Xe(this,Mf,void 0);Xe(this,nl,void 0);Ve(this,nl,!1),Ve(this,Mf,t.defaultOptions),Et(this,Vc,wg).call(this,t.options),Ve(this,Un,[]),Ve(this,Po,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ve(this,zc,t.state||XV(this.options)),this.state=ae(this,zc),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!ae(this,Un).length&&this.state.fetchStatus==="idle"&&ae(this,Po).remove(this)}setData(t,n){const r=px(this.state.data,t,this.options);return Et(this,Yo,Qi).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Et(this,Yo,Qi).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=ae(this,Ks);return(r=ae(this,Oo))==null||r.cancel(t),n?n.then(To).catch(To):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(ae(this,zc))}isActive(){return ae(this,Un).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||ae(this,Un).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!PD(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=ae(this,Un).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=ae(this,Oo))==null||n.continue()}onOnline(){var n;const t=ae(this,Un).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=ae(this,Oo))==null||n.continue()}addObserver(t){ae(this,Un).includes(t)||(ae(this,Un).push(t),this.clearGcTimeout(),ae(this,Po).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){ae(this,Un).includes(t)&&(Ve(this,Un,ae(this,Un).filter(n=>n!==t)),ae(this,Un).length||(ae(this,Oo)&&(ae(this,nl)?ae(this,Oo).cancel({revert:!0}):ae(this,Oo).cancelRetry()),this.scheduleGc()),ae(this,Po).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return ae(this,Un).length}invalidate(){this.state.isInvalidated||Et(this,Yo,Qi).call(this,{type:"invalidate"})}fetch(t,n){var c,u,f,h;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(ae(this,Ks))return(c=ae(this,Oo))==null||c.continueRetry(),ae(this,Ks)}if(t&&Et(this,Vc,wg).call(this,t),!this.options.queryFn){const p=ae(this,Un).find(v=>v.options.queryFn);p&&Et(this,Vc,wg).call(this,p.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,o={queryKey:this.queryKey,meta:this.meta},i=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(Ve(this,nl,!0),r.signal)})};i(o);const s=()=>this.options.queryFn?(Ve(this,nl,!1),this.options.persister?this.options.persister(this.options.queryFn,o,this):this.options.queryFn(o)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),a={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(a),(u=this.options.behavior)==null||u.onFetch(a,this),Ve(this,Bc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=a.fetchOptions)==null?void 0:f.meta))&&Et(this,Yo,Qi).call(this,{type:"fetch",meta:(h=a.fetchOptions)==null?void 0:h.meta});const l=p=>{var v,b,w,y;u0(p)&&p.silent||Et(this,Yo,Qi).call(this,{type:"error",error:p}),u0(p)||((b=(v=ae(this,Po).config).onError)==null||b.call(v,p,this),(y=(w=ae(this,Po).config).onSettled)==null||y.call(w,this.state.data,p,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return Ve(this,Oo,TD({fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:p=>{var v,b,w,y;if(typeof p>"u"){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),l(new Error(`${this.queryHash} data is undefined`));return}this.setData(p),(b=(v=ae(this,Po).config).onSuccess)==null||b.call(v,p,this),(y=(w=ae(this,Po).config).onSettled)==null||y.call(w,p,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(p,v)=>{Et(this,Yo,Qi).call(this,{type:"failed",failureCount:p,error:v})},onPause:()=>{Et(this,Yo,Qi).call(this,{type:"pause"})},onContinue:()=>{Et(this,Yo,Qi).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),Ve(this,Ks,ae(this,Oo).promise),ae(this,Ks)}},zc=new WeakMap,Bc=new WeakMap,Po=new WeakMap,Ks=new WeakMap,Oo=new WeakMap,Un=new WeakMap,Mf=new WeakMap,nl=new WeakMap,Vc=new WeakSet,wg=function(t){this.options={...ae(this,Mf),...t},this.updateGcTime(this.options.gcTime)},Yo=new WeakSet,Qi=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:t.meta??null,fetchStatus:Dm(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return u0(o)&&o.revert&&ae(this,Bc)?{...ae(this,Bc),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Qn.batch(()=>{ae(this,Un).forEach(r=>{r.onQueryUpdate()}),ae(this,Po).notify({query:this,type:"updated",action:t})})},XT);function XV(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var mi,QT,AD=(QT=class extends Gf{constructor(t={}){super();Xe(this,mi,void 0);this.config=t,Ve(this,mi,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??mw(o,n);let s=this.get(i);return s||(s=new KV({cache:this,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){ae(this,mi).has(t.queryHash)||(ae(this,mi).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=ae(this,mi).get(t.queryHash);n&&(t.destroy(),n===t&&ae(this,mi).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Qn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return ae(this,mi).get(t)}getAll(){return[...ae(this,mi).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>oP(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>oP(t,r)):n}notify(t){Qn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Qn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Qn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},mi=new WeakMap,QT),vi,If,Zr,Hc,bi,Vs,JT,QV=(JT=class extends DD{constructor(t){super();Xe(this,bi);Xe(this,vi,void 0);Xe(this,If,void 0);Xe(this,Zr,void 0);Xe(this,Hc,void 0);this.mutationId=t.mutationId,Ve(this,If,t.defaultOptions),Ve(this,Zr,t.mutationCache),Ve(this,vi,[]),this.state=t.state||JV(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...ae(this,If),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){ae(this,vi).includes(t)||(ae(this,vi).push(t),this.clearGcTimeout(),ae(this,Zr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ve(this,vi,ae(this,vi).filter(n=>n!==t)),this.scheduleGc(),ae(this,Zr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){ae(this,vi).length||(this.state.status==="pending"?this.scheduleGc():ae(this,Zr).remove(this))}continue(){var t;return((t=ae(this,Hc))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,a,l,c,u,f,h,p,v,b,w,y,_,C,R,S,$,O;const n=()=>(Ve(this,Hc,TD({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(D,I)=>{Et(this,bi,Vs).call(this,{type:"failed",failureCount:D,error:I})},onPause:()=>{Et(this,bi,Vs).call(this,{type:"pause"})},onContinue:()=>{Et(this,bi,Vs).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),ae(this,Hc).promise),r=this.state.status==="pending";try{if(!r){Et(this,bi,Vs).call(this,{type:"pending",variables:t}),await((i=(o=ae(this,Zr).config).onMutate)==null?void 0:i.call(o,t,this));const I=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));I!==this.state.context&&Et(this,bi,Vs).call(this,{type:"pending",context:I,variables:t})}const D=await n();return await((c=(l=ae(this,Zr).config).onSuccess)==null?void 0:c.call(l,D,t,this.state.context,this)),await((f=(u=this.options).onSuccess)==null?void 0:f.call(u,D,t,this.state.context)),await((p=(h=ae(this,Zr).config).onSettled)==null?void 0:p.call(h,D,null,this.state.variables,this.state.context,this)),await((b=(v=this.options).onSettled)==null?void 0:b.call(v,D,null,t,this.state.context)),Et(this,bi,Vs).call(this,{type:"success",data:D}),D}catch(D){try{throw await((y=(w=ae(this,Zr).config).onError)==null?void 0:y.call(w,D,t,this.state.context,this)),await((C=(_=this.options).onError)==null?void 0:C.call(_,D,t,this.state.context)),await((S=(R=ae(this,Zr).config).onSettled)==null?void 0:S.call(R,void 0,D,this.state.variables,this.state.context,this)),await((O=($=this.options).onSettled)==null?void 0:O.call($,void 0,D,t,this.state.context)),D}finally{Et(this,bi,Vs).call(this,{type:"error",error:D})}}}},vi=new WeakMap,If=new WeakMap,Zr=new WeakMap,Hc=new WeakMap,bi=new WeakSet,Vs=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!Dm(this.options.networkMode),status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Qn.batch(()=>{ae(this,vi).forEach(r=>{r.onMutationUpdate(t)}),ae(this,Zr).notify({mutation:this,type:"updated",action:t})})},JT);function JV(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var $o,Nf,rl,ZT,ZV=(ZT=class extends Gf{constructor(t={}){super();Xe(this,$o,void 0);Xe(this,Nf,void 0);Xe(this,rl,void 0);this.config=t,Ve(this,$o,[]),Ve(this,Nf,0)}build(t,n,r){const o=new QV({mutationCache:this,mutationId:++dp(this,Nf)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){ae(this,$o).push(t),this.notify({type:"added",mutation:t})}remove(t){Ve(this,$o,ae(this,$o).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){Qn.batch(()=>{ae(this,$o).forEach(t=>{this.remove(t)})})}getAll(){return ae(this,$o)}find(t){const n={exact:!0,...t};return ae(this,$o).find(r=>iP(n,r))}findAll(t={}){return ae(this,$o).filter(n=>iP(t,n))}notify(t){Qn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return Ve(this,rl,(ae(this,rl)??Promise.resolve()).then(()=>{const t=ae(this,$o).filter(n=>n.state.isPaused);return Qn.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(To)),Promise.resolve()))}).then(()=>{Ve(this,rl,void 0)})),ae(this,rl)}},$o=new WeakMap,Nf=new WeakMap,rl=new WeakMap,ZT);function eH(e){return{onFetch:(t,n)=>{const r=async()=>{var v,b,w,y,_;const o=t.options,i=(w=(b=(v=t.fetchOptions)==null?void 0:v.meta)==null?void 0:b.fetchMore)==null?void 0:w.direction,s=((y=t.state.data)==null?void 0:y.pages)||[],a=((_=t.state.data)==null?void 0:_.pageParams)||[],l={pages:[],pageParams:[]};let c=!1;const u=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(t.signal.aborted?c=!0:t.signal.addEventListener("abort",()=>{c=!0}),t.signal)})},f=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),h=async(C,R,S)=>{if(c)return Promise.reject();if(R==null&&C.pages.length)return Promise.resolve(C);const $={queryKey:t.queryKey,pageParam:R,direction:S?"backward":"forward",meta:t.options.meta};u($);const O=await f($),{maxPages:D}=t.options,I=S?WV:HV;return{pages:I(C.pages,O,D),pageParams:I(C.pageParams,R,D)}};let p;if(i&&s.length){const C=i==="backward",R=C?tH:lP,S={pages:s,pageParams:a},$=R(o,S);p=await h(S,$,C)}else{p=await h(l,a[0]??o.initialPageParam);const C=e??s.length;for(let R=1;R<C;R++){const S=lP(o,p);p=await h(p,S)}}return p};t.options.persister?t.fetchFn=()=>{var o,i;return(i=(o=t.options).persister)==null?void 0:i.call(o,r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=r}}}function lP(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function tH(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var Fn,Xs,Qs,Wc,Uc,Js,Gc,qc,eD,nH=(eD=class{constructor(e={}){Xe(this,Fn,void 0);Xe(this,Xs,void 0);Xe(this,Qs,void 0);Xe(this,Wc,void 0);Xe(this,Uc,void 0);Xe(this,Js,void 0);Xe(this,Gc,void 0);Xe(this,qc,void 0);Ve(this,Fn,e.queryCache||new AD),Ve(this,Xs,e.mutationCache||new ZV),Ve(this,Qs,e.defaultOptions||{}),Ve(this,Wc,new Map),Ve(this,Uc,new Map),Ve(this,Js,0)}mount(){dp(this,Js)._++,ae(this,Js)===1&&(Ve(this,Gc,zg.subscribe(()=>{zg.isFocused()&&(this.resumePausedMutations(),ae(this,Fn).onFocus())})),Ve(this,qc,Bg.subscribe(()=>{Bg.isOnline()&&(this.resumePausedMutations(),ae(this,Fn).onOnline())})))}unmount(){var e,t;dp(this,Js)._--,ae(this,Js)===0&&((e=ae(this,Gc))==null||e.call(this),Ve(this,Gc,void 0),(t=ae(this,qc))==null||t.call(this),Ve(this,qc,void 0))}isFetching(e){return ae(this,Fn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return ae(this,Xs).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=ae(this,Fn).find({queryKey:e}))==null?void 0:t.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);return t!==void 0?Promise.resolve(t):this.fetchQuery(e)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=ae(this,Fn).find({queryKey:e}),o=r==null?void 0:r.state.data,i=BV(t,o);if(typeof i>"u")return;const s=this.defaultQueryOptions({queryKey:e});return ae(this,Fn).build(this,s).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return Qn.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var t;return(t=ae(this,Fn).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=ae(this,Fn);Qn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=ae(this,Fn),r={type:"active",...e};return Qn.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=Qn.batch(()=>ae(this,Fn).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(To).catch(To)}invalidateQueries(e={},t={}){return Qn.batch(()=>{if(ae(this,Fn).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=Qn.batch(()=>ae(this,Fn).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(To)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(To)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=ae(this,Fn).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(To).catch(To)}fetchInfiniteQuery(e){return e.behavior=eH(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(To).catch(To)}resumePausedMutations(){return ae(this,Xs).resumePausedMutations()}getQueryCache(){return ae(this,Fn)}getMutationCache(){return ae(this,Xs)}getDefaultOptions(){return ae(this,Qs)}setDefaultOptions(e){Ve(this,Qs,e)}setQueryDefaults(e,t){ae(this,Wc).set(Yd(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...ae(this,Wc).values()];let n={};return t.forEach(r=>{Kd(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){ae(this,Uc).set(Yd(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...ae(this,Uc).values()];let n={};return t.forEach(r=>{Kd(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...ae(this,Qs).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=mw(t.queryKey,t)),typeof t.refetchOnReconnect>"u"&&(t.refetchOnReconnect=t.networkMode!=="always"),typeof t.throwOnError>"u"&&(t.throwOnError=!!t.suspense),typeof t.networkMode>"u"&&t.persister&&(t.networkMode="offlineFirst"),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...ae(this,Qs).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){ae(this,Fn).clear(),ae(this,Xs).clear()}},Fn=new WeakMap,Xs=new WeakMap,Qs=new WeakMap,Wc=new WeakMap,Uc=new WeakMap,Js=new WeakMap,Gc=new WeakMap,qc=new WeakMap,eD),Ir,fn,Lf,yr,ol,Yc,yi,Ff,Kc,Xc,il,sl,Zs,Qc,al,vd,jf,gx,zf,mx,Bf,vx,Vf,bx,Hf,yx,Wf,xx,Uf,wx,Cm,kD,tD,rH=(tD=class extends Gf{constructor(t,n){super();Xe(this,al);Xe(this,jf);Xe(this,zf);Xe(this,Bf);Xe(this,Vf);Xe(this,Hf);Xe(this,Wf);Xe(this,Uf);Xe(this,Cm);Xe(this,Ir,void 0);Xe(this,fn,void 0);Xe(this,Lf,void 0);Xe(this,yr,void 0);Xe(this,ol,void 0);Xe(this,Yc,void 0);Xe(this,yi,void 0);Xe(this,Ff,void 0);Xe(this,Kc,void 0);Xe(this,Xc,void 0);Xe(this,il,void 0);Xe(this,sl,void 0);Xe(this,Zs,void 0);Xe(this,Qc,new Set);this.options=n,Ve(this,Ir,t),Ve(this,yi,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(ae(this,fn).addObserver(this),cP(ae(this,fn),this.options)?Et(this,al,vd).call(this):this.updateResult(),Et(this,Vf,bx).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return _x(ae(this,fn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return _x(ae(this,fn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Et(this,Hf,yx).call(this),Et(this,Wf,xx).call(this),ae(this,fn).removeObserver(this)}setOptions(t,n){const r=this.options,o=ae(this,fn);if(this.options=ae(this,Ir).defaultQueryOptions(t),fx(r,this.options)||ae(this,Ir).getQueryCache().notify({type:"observerOptionsUpdated",query:ae(this,fn),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),Et(this,Uf,wx).call(this);const i=this.hasListeners();i&&uP(ae(this,fn),o,this.options,r)&&Et(this,al,vd).call(this),this.updateResult(n),i&&(ae(this,fn)!==o||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&Et(this,jf,gx).call(this);const s=Et(this,zf,mx).call(this);i&&(ae(this,fn)!==o||this.options.enabled!==r.enabled||s!==ae(this,Zs))&&Et(this,Bf,vx).call(this,s)}getOptimisticResult(t){const n=ae(this,Ir).getQueryCache().build(ae(this,Ir),t),r=this.createResult(n,t);return iH(this,r)&&(Ve(this,yr,r),Ve(this,Yc,this.options),Ve(this,ol,ae(this,fn).state)),r}getCurrentResult(){return ae(this,yr)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(ae(this,Qc).add(r),t[r])})}),n}getCurrentQuery(){return ae(this,fn)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=ae(this,Ir).defaultQueryOptions(t),r=ae(this,Ir).getQueryCache().build(ae(this,Ir),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Et(this,al,vd).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),ae(this,yr)))}createResult(t,n){var $;const r=ae(this,fn),o=this.options,i=ae(this,yr),s=ae(this,ol),a=ae(this,Yc),c=t!==r?t.state:ae(this,Lf),{state:u}=t;let{error:f,errorUpdatedAt:h,fetchStatus:p,status:v}=u,b=!1,w;if(n._optimisticResults){const O=this.hasListeners(),D=!O&&cP(t,n),I=O&&uP(t,r,n,o);(D||I)&&(p=Dm(t.options.networkMode)?"fetching":"paused",u.dataUpdatedAt||(v="pending")),n._optimisticResults==="isRestoring"&&(p="idle")}if(n.select&&typeof u.data<"u")if(i&&u.data===(s==null?void 0:s.data)&&n.select===ae(this,Ff))w=ae(this,Kc);else try{Ve(this,Ff,n.select),w=n.select(u.data),w=px(i==null?void 0:i.data,w,n),Ve(this,Kc,w),Ve(this,yi,null)}catch(O){Ve(this,yi,O)}else w=u.data;if(typeof n.placeholderData<"u"&&typeof w>"u"&&v==="pending"){let O;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))O=i.data;else if(O=typeof n.placeholderData=="function"?n.placeholderData(($=ae(this,Xc))==null?void 0:$.state.data,ae(this,Xc)):n.placeholderData,n.select&&typeof O<"u")try{O=n.select(O),Ve(this,yi,null)}catch(D){Ve(this,yi,D)}typeof O<"u"&&(v="success",w=px(i==null?void 0:i.data,O,n),b=!0)}ae(this,yi)&&(f=ae(this,yi),w=ae(this,Kc),h=Date.now(),v="error");const y=p==="fetching",_=v==="pending",C=v==="error",R=_&&y;return{status:v,fetchStatus:p,isPending:_,isSuccess:v==="success",isError:C,isInitialLoading:R,isLoading:R,data:w,dataUpdatedAt:u.dataUpdatedAt,error:f,errorUpdatedAt:h,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:y,isRefetching:y&&!_,isLoadingError:C&&u.dataUpdatedAt===0,isPaused:p==="paused",isPlaceholderData:b,isRefetchError:C&&u.dataUpdatedAt!==0,isStale:vw(t,n),refetch:this.refetch}}updateResult(t){const n=ae(this,yr),r=this.createResult(ae(this,fn),this.options);if(Ve(this,ol,ae(this,fn).state),Ve(this,Yc,this.options),ae(this,ol).data!==void 0&&Ve(this,Xc,ae(this,fn)),fx(r,n))return;Ve(this,yr,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!ae(this,Qc).size)return!0;const l=new Set(a??ae(this,Qc));return this.options.throwOnError&&l.add("error"),Object.keys(ae(this,yr)).some(c=>{const u=c;return ae(this,yr)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),Et(this,Cm,kD).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Et(this,Vf,bx).call(this)}},Ir=new WeakMap,fn=new WeakMap,Lf=new WeakMap,yr=new WeakMap,ol=new WeakMap,Yc=new WeakMap,yi=new WeakMap,Ff=new WeakMap,Kc=new WeakMap,Xc=new WeakMap,il=new WeakMap,sl=new WeakMap,Zs=new WeakMap,Qc=new WeakMap,al=new WeakSet,vd=function(t){Et(this,Uf,wx).call(this);let n=ae(this,fn).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(To)),n},jf=new WeakSet,gx=function(){if(Et(this,Hf,yx).call(this),nu||ae(this,yr).isStale||!dx(this.options.staleTime))return;const n=PD(ae(this,yr).dataUpdatedAt,this.options.staleTime)+1;Ve(this,il,setTimeout(()=>{ae(this,yr).isStale||this.updateResult()},n))},zf=new WeakSet,mx=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(ae(this,fn)):this.options.refetchInterval)??!1},Bf=new WeakSet,vx=function(t){Et(this,Wf,xx).call(this),Ve(this,Zs,t),!(nu||this.options.enabled===!1||!dx(ae(this,Zs))||ae(this,Zs)===0)&&Ve(this,sl,setInterval(()=>{(this.options.refetchIntervalInBackground||zg.isFocused())&&Et(this,al,vd).call(this)},ae(this,Zs)))},Vf=new WeakSet,bx=function(){Et(this,jf,gx).call(this),Et(this,Bf,vx).call(this,Et(this,zf,mx).call(this))},Hf=new WeakSet,yx=function(){ae(this,il)&&(clearTimeout(ae(this,il)),Ve(this,il,void 0))},Wf=new WeakSet,xx=function(){ae(this,sl)&&(clearInterval(ae(this,sl)),Ve(this,sl,void 0))},Uf=new WeakSet,wx=function(){const t=ae(this,Ir).getQueryCache().build(ae(this,Ir),this.options);if(t===ae(this,fn))return;const n=ae(this,fn);Ve(this,fn,t),Ve(this,Lf,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Cm=new WeakSet,kD=function(t){Qn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(ae(this,yr))}),ae(this,Ir).getQueryCache().notify({query:ae(this,fn),type:"observerResultsUpdated"})})},tD);function oH(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function cP(e,t){return oH(e,t)||e.state.dataUpdatedAt>0&&_x(e,t,t.refetchOnMount)}function _x(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&vw(e,t)}return!1}function uP(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&vw(e,n)}function vw(e,t){return e.isStaleByTime(t.staleTime)}function iH(e,t){return!fx(e.getCurrentResult(),t)}var MD=N.createContext(void 0),ID=e=>{const t=N.useContext(MD);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},sH=({client:e,children:t})=>(N.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),N.createElement(MD.Provider,{value:e},t)),ND=N.createContext(!1),aH=()=>N.useContext(ND);ND.Provider;function lH(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var cH=N.createContext(lH()),uH=()=>N.useContext(cH);function dH(e,t){return typeof e=="function"?e(...t):!!e}var fH=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},hH=e=>{N.useEffect(()=>{e.clearReset()},[e])},pH=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&dH(n,[e.error,r]),gH=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},mH=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,vH=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function bH(e,t,n){if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=ID(n),o=aH(),i=uH(),s=r.defaultQueryOptions(e);s._optimisticResults=o?"isRestoring":"optimistic",gH(s),fH(s,i),hH(i);const[a]=N.useState(()=>new t(r,s)),l=a.getOptimisticResult(s);if(N.useSyncExternalStore(N.useCallback(c=>{const u=o?()=>{}:a.subscribe(Qn.batchCalls(c));return a.updateResult(),u},[a,o]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),N.useEffect(()=>{a.setOptions(s,{listeners:!1})},[s,a]),mH(s,l))throw vH(s,a,i);if(pH({result:l,errorResetBoundary:i,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw l.error;return s.notifyOnChangeProps?l:a.trackResult(l)}function Am(e,t){return bH(e,rH,t)}function LD({children:e}){const{setIsSessionExpired:t}=ur(),n=new nH({queryCache:new AD({onError:r=>{console.error(`Something went wrong: ${r.message}`),r.message==="invalid token"&&t(!0)}}),defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}});return E.jsx(sH,{client:n,children:e})}const Ol=m.forwardRef(({children:e,className:t,...n},r)=>E.jsx("div",{className:xe("semaphor-scope",t),ref:r,...n,children:e})),yH={id:"",authToken:void 0},FD=m.createContext(yH),jD=({children:e,dashboardProps:t})=>E.jsx(LD,{children:E.jsx(FD.Provider,{value:t,children:E.jsx(Ol,{style:{height:"100%"},children:e})})});function ni(){const e=m.useContext(FD);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}function xH(){const{authToken:e,version:t}=ni(),n=Ce(a=>a.selectedLensId),{data:r,isLoading:o,isFetching:i,isError:s}=Am({queryKey:["dashboard",n,e==null?void 0:e.accessToken],queryFn:()=>rV(e==null?void 0:e.accessToken,{lensId:n,version:t})});return{data:r,isLoading:o,isFetching:i,isError:s}}function zD(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function dP(e,t){const n=zD(e);return n==="dark"?ll.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function wH({customStyle:e,currentTheme:t,onSave:n,onEvent:r,defaultFilterValues:o,onFilterValuesChange:i}){const{authToken:s}=ni(),a=Ce(F=>F.selectedLensId),{data:l,isLoading:c,isFetching:u,isError:f}=xH(),[h,p]=m.useState(o||[]),{theme:v,setTheme:b}=RD(),w=Ce(F=>F.dashboard.globalStyle),{setDashboard:y,setDashboardWithFilterValues:_,setSelectedSheetId:C,setStyle:R,setOnSaveFunction:S,setLenses:$,setSelectedLensId:O,setInitStore:D}=Ce(F=>F.actions);Ce(F=>F.actions.setCustomCards);const I=Ce(F=>F.actions.setFilterValues),L=Ce(F=>F.filterValues),j=Ce(F=>F.actions.setThemeStyle),B=Ce(F=>F.actions.setDashboardTheme),te=Ce(F=>F.actions.setOnEvent);m.useEffect(()=>{s&&D()},[s,D]),m.useEffect(()=>{if(v){const F=zD(v);B(F)}},[v,B]),m.useEffect(()=>{t&&b(t)},[t,b]);const q=m.useCallback(()=>{const F=ll.cloneDeep(Fg),Q=ll.merge(F,w);if(e){const G=ll.merge(Q,e),K=dP(v,G);j(K),R(G)}else{const G=dP(v,Q);j(G),R(Fg)}},[v,e,w,j,R]);return m.useEffect(()=>{l&&l.dashboard&&q()},[v,e,w,q,l]),m.useEffect(()=>{var H,U;function F(M,re){const ce=M.filters||[],ue=[];for(const he of re){const J=ce.find(ee=>ee.id===he.filterId);J&&ue.push({filterId:he.filterId,connectionType:J.database==="NA"?"api":"database",name:J.column,operation:J.operation,valueType:Gd(J),values:he.values})}return ue}if(!l||!l.dashboard)return;const{dashboard:Q,filterValues:G,defaultLensId:K,lenses:W}=l,T=F(Q,h||[]);_(Q,G||T||[]),K&&O(K),W&&$(W),C(((U=(H=Q==null?void 0:Q.sheets)==null?void 0:H[0])==null?void 0:U.id)||null)},[l,y,C,I,a,$,_,O,h]),m.useEffect(()=>{i&&L&&i(L)},[L,i]),m.useEffect(()=>{n&&S(n),r&&te(r)},[n,S,r,te]),{isFetching:u,isLoading:c,isError:f}}function km({className:e,...t}){return E.jsx("div",{className:xe("animate-pulse rounded-md bg-muted",e),...t})}const bw=N.forwardRef(({className:e,...t},n)=>E.jsx("div",{ref:n,className:xe("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));bw.displayName="Card";const Mm=N.forwardRef(({className:e,...t},n)=>E.jsx("div",{ref:n,className:xe("flex flex-col space-y-1.5 p-6",e),...t}));Mm.displayName="CardHeader";const bu=N.forwardRef(({className:e,...t},n)=>E.jsx("h3",{ref:n,className:xe("text-2xl font-semibold leading-none tracking-tight",e),...t}));bu.displayName="CardTitle";const yw=N.forwardRef(({className:e,...t},n)=>E.jsx("p",{ref:n,className:xe("text-sm text-muted-foreground",e),...t}));yw.displayName="CardDescription";const Im=N.forwardRef(({className:e,...t},n)=>E.jsx("div",{ref:n,className:xe("px-6 pt-0",e),...t}));Im.displayName="CardContent";const xw=N.forwardRef(({className:e,...t},n)=>E.jsx("div",{ref:n,className:xe("flex items-center p-6 pt-0",e),...t}));xw.displayName="CardFooter";function BD({className:e,customStyle:t,onSave:n,onEvent:r,LoadingComponent:o,ErrorComponent:i,onChartElementClicked:s,id:a,authToken:l,currentTheme:c,version:u,customCards:f,showAssistant:h,defaultFilterValues:p,onFilterValuesChange:v,...b}){Ce(S=>S.selectedSheetId);const w=Ce(S=>S.themeStyle),y=Ce(S=>S.isSessionExpired),{isLoading:_,isError:C,isFetching:R}=wH({authToken:l,customStyle:t,currentTheme:c,onSave:n,onEvent:r,defaultFilterValues:p,onFilterValuesChange:v});return _||!l?(r==null||r({type:"info",message:"Loading dashboard"}),o?E.jsx(o,{message:"loading"}):E.jsx("div",{className:"flex items-center gap-3",children:E.jsx(km,{className:"h-1 w-full dark:h-[2px]"})})):C?(r==null||r({type:"error",message:"Error fetching dashboard"}),i?(console.log("Error fetching dashboard"),E.jsx(i,{})):E.jsx("div",{children:"Error"})):y?(r==null||r({type:"error",message:"Session Expired"}),E.jsx("div",{className:"flex h-full items-center justify-center",children:E.jsxs("div",{className:"space-y-4 rounded-md border border-muted p-10",children:[E.jsx(bu,{children:"Session Expired"}),E.jsx("p",{className:"text-muted-foreground",children:"Please refresh your page to continue."})]})})):E.jsx("div",{className:xe("flex h-full flex-col justify-between",w==null?void 0:w.dashboardPanel,e),style:{},role:"dashboard-panel",...b})}function de(){return de=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},de.apply(this,arguments)}function Me(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function tr(e,t=[]){let n=[];function r(i,s){const a=m.createContext(s),l=n.length;n=[...n,s];function c(f){const{scope:h,children:p,...v}=f,b=(h==null?void 0:h[e][l])||a,w=m.useMemo(()=>v,Object.values(v));return m.createElement(b.Provider,{value:w},p)}function u(f,h){const p=(h==null?void 0:h[e][l])||a,v=m.useContext(p);if(v)return v;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const o=()=>{const i=n.map(s=>m.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,_H(o,...t)]}function _H(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const f=l(i)[`__scope${c}`];return{...a,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function CH(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function ps(...e){return t=>e.forEach(n=>CH(n,t))}function Ct(...e){return m.useCallback(ps(...e),e)}const Cx=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(EH);if(i){const s=i.props.children,a=o.map(l=>l===i?m.Children.count(s)>1?m.Children.only(null):m.isValidElement(s)?s.props.children:null:l);return m.createElement(Sx,de({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(Sx,de({},r,{ref:t}),n)});Cx.displayName="Slot";const Sx=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...RH(r,n.props),ref:t?ps(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});Sx.displayName="SlotClone";const SH=({children:e})=>m.createElement(m.Fragment,null,e);function EH(e){return m.isValidElement(e)&&e.type===SH}function RH(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)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Nm(e){const t=e+"CollectionProvider",[n,r]=tr(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=p=>{const{scope:v,children:b}=p,w=m.useRef(null),y=m.useRef(new Map).current;return m.createElement(o,{scope:v,itemMap:y,collectionRef:w},b)},a=e+"CollectionSlot",l=m.forwardRef((p,v)=>{const{scope:b,children:w}=p,y=i(a,b),_=Ct(v,y.collectionRef);return m.createElement(Cx,{ref:_},w)}),c=e+"CollectionItemSlot",u="data-radix-collection-item",f=m.forwardRef((p,v)=>{const{scope:b,children:w,...y}=p,_=m.useRef(null),C=Ct(v,_),R=i(c,b);return m.useEffect(()=>(R.itemMap.set(_,{ref:_,...y}),()=>void R.itemMap.delete(_))),m.createElement(Cx,{[u]:"",ref:C},w)});function h(p){const v=i(e+"CollectionConsumer",p);return m.useCallback(()=>{const w=v.collectionRef.current;if(!w)return[];const y=Array.from(w.querySelectorAll(`[${u}]`));return Array.from(v.itemMap.values()).sort((R,S)=>y.indexOf(R.ref.current)-y.indexOf(S.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:l,ItemSlot:f},h,r]}const dr=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},PH=N.useId||(()=>{});let OH=0;function Zo(e){const[t,n]=N.useState(PH());return dr(()=>{e||n(r=>r??String(OH++))},[e]),e||(t?`radix-${t}`:"")}const VD=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(TH);if(i){const s=i.props.children,a=o.map(l=>l===i?m.Children.count(s)>1?m.Children.only(null):m.isValidElement(s)?s.props.children:null:l);return m.createElement(Ex,de({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(Ex,de({},r,{ref:t}),n)});VD.displayName="Slot";const Ex=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...DH(r,n.props),ref:t?ps(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});Ex.displayName="SlotClone";const $H=({children:e})=>m.createElement(m.Fragment,null,e);function TH(e){return m.isValidElement(e)&&e.type===$H}function DH(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)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const AH=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Qe=AH.reduce((e,t)=>{const n=m.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?VD:t;return m.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),m.createElement(a,de({},s,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function HD(e,t){e&&fr.flushSync(()=>e.dispatchEvent(t))}function zn(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function Cr({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=kH({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=zn(n),l=m.useCallback(c=>{if(i){const f=typeof c=="function"?c(e):c;f!==e&&a(f)}else o(c)},[i,e,o,a]);return[s,l]}function kH({defaultProp:e,onChange:t}){const n=m.useState(e),[r]=n,o=m.useRef(r),i=zn(t);return m.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const MH=m.createContext(void 0);function $l(e){const t=m.useContext(MH);return e||t||"ltr"}const d0="rovingFocusGroup.onEntryFocus",IH={bubbles:!1,cancelable:!0},ww="RovingFocusGroup",[Rx,WD,NH]=Nm(ww),[LH,yu]=tr(ww,[NH]),[FH,jH]=LH(ww),zH=m.forwardRef((e,t)=>m.createElement(Rx.Provider,{scope:e.__scopeRovingFocusGroup},m.createElement(Rx.Slot,{scope:e.__scopeRovingFocusGroup},m.createElement(BH,de({},e,{ref:t}))))),BH=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,...u}=e,f=m.useRef(null),h=Ct(t,f),p=$l(i),[v=null,b]=Cr({prop:s,defaultProp:a,onChange:l}),[w,y]=m.useState(!1),_=zn(c),C=WD(n),R=m.useRef(!1),[S,$]=m.useState(0);return m.useEffect(()=>{const O=f.current;if(O)return O.addEventListener(d0,_),()=>O.removeEventListener(d0,_)},[_]),m.createElement(FH,{scope:n,orientation:r,dir:p,loop:o,currentTabStopId:v,onItemFocus:m.useCallback(O=>b(O),[b]),onItemShiftTab:m.useCallback(()=>y(!0),[]),onFocusableItemAdd:m.useCallback(()=>$(O=>O+1),[]),onFocusableItemRemove:m.useCallback(()=>$(O=>O-1),[])},m.createElement(Qe.div,de({tabIndex:w||S===0?-1:0,"data-orientation":r},u,{ref:h,style:{outline:"none",...e.style},onMouseDown:Me(e.onMouseDown,()=>{R.current=!0}),onFocus:Me(e.onFocus,O=>{const D=!R.current;if(O.target===O.currentTarget&&D&&!w){const I=new CustomEvent(d0,IH);if(O.currentTarget.dispatchEvent(I),!I.defaultPrevented){const L=C().filter(F=>F.focusable),j=L.find(F=>F.active),B=L.find(F=>F.id===v),q=[j,B,...L].filter(Boolean).map(F=>F.ref.current);UD(q)}}R.current=!1}),onBlur:Me(e.onBlur,()=>y(!1))})))}),VH="RovingFocusGroupItem",HH=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=Zo(),l=i||a,c=jH(VH,n),u=c.currentTabStopId===l,f=WD(n),{onFocusableItemAdd:h,onFocusableItemRemove:p}=c;return m.useEffect(()=>{if(r)return h(),()=>p()},[r,h,p]),m.createElement(Rx.ItemSlot,{scope:n,id:l,focusable:r,active:o},m.createElement(Qe.span,de({tabIndex:u?0:-1,"data-orientation":c.orientation},s,{ref:t,onMouseDown:Me(e.onMouseDown,v=>{r?c.onItemFocus(l):v.preventDefault()}),onFocus:Me(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:Me(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){c.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const b=GH(v,c.orientation,c.dir);if(b!==void 0){v.preventDefault();let y=f().filter(_=>_.focusable).map(_=>_.ref.current);if(b==="last")y.reverse();else if(b==="prev"||b==="next"){b==="prev"&&y.reverse();const _=y.indexOf(v.currentTarget);y=c.loop?qH(y,_+1):y.slice(_+1)}setTimeout(()=>UD(y))}})})))}),WH={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function UH(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function GH(e,t,n){const r=UH(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return WH[r]}function UD(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function qH(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const _w=zH,Cw=HH;function YH(e,t){return m.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const nr=e=>{const{present:t,children:n}=e,r=KH(t),o=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),i=Ct(r.ref,o.ref);return typeof n=="function"||r.isPresent?m.cloneElement(o,{ref:i}):null};nr.displayName="Presence";function KH(e){const[t,n]=m.useState(),r=m.useRef({}),o=m.useRef(e),i=m.useRef("none"),s=e?"mounted":"unmounted",[a,l]=YH(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const c=gp(r.current);i.current=a==="mounted"?c:"none"},[a]),dr(()=>{const c=r.current,u=o.current;if(u!==e){const h=i.current,p=gp(c);e?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&h!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),dr(()=>{if(t){const c=f=>{const p=gp(r.current).includes(f.animationName);f.target===t&&p&&fr.flushSync(()=>l("ANIMATION_END"))},u=f=>{f.target===t&&(i.current=gp(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:m.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function gp(e){return(e==null?void 0:e.animationName)||"none"}const GD="Tabs",[XH,D1e]=tr(GD,[yu]),qD=yu(),[QH,Sw]=XH(GD),JH=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=$l(a),[f,h]=Cr({prop:r,onChange:o,defaultProp:i});return m.createElement(QH,{scope:n,baseId:Zo(),value:f,onValueChange:h,orientation:s,dir:u,activationMode:l},m.createElement(Qe.div,de({dir:u,"data-orientation":s},c,{ref:t})))}),ZH="TabsList",eW=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=Sw(ZH,n),s=qD(n);return m.createElement(_w,de({asChild:!0},s,{orientation:i.orientation,dir:i.dir,loop:r}),m.createElement(Qe.div,de({role:"tablist","aria-orientation":i.orientation},o,{ref:t})))}),tW="TabsTrigger",nW=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=Sw(tW,n),a=qD(n),l=YD(s.baseId,r),c=KD(s.baseId,r),u=r===s.value;return m.createElement(Cw,de({asChild:!0},a,{focusable:!o,active:u}),m.createElement(Qe.button,de({type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l},i,{ref:t,onMouseDown:Me(e.onMouseDown,f=>{!o&&f.button===0&&f.ctrlKey===!1?s.onValueChange(r):f.preventDefault()}),onKeyDown:Me(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&s.onValueChange(r)}),onFocus:Me(e.onFocus,()=>{const f=s.activationMode!=="manual";!u&&!o&&f&&s.onValueChange(r)})})))}),rW="TabsContent",oW=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=Sw(rW,n),l=YD(a.baseId,r),c=KD(a.baseId,r),u=r===a.value,f=m.useRef(u);return m.useEffect(()=>{const h=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(h)},[]),m.createElement(nr,{present:o||u},({present:h})=>m.createElement(Qe.div,de({"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!h,id:c,tabIndex:0},s,{ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0}}),h&&i))});function YD(e,t){return`${e}-trigger-${t}`}function KD(e,t){return`${e}-content-${t}`}const iW=JH,XD=eW,QD=nW,JD=oW,Ew=iW,Lm=N.forwardRef(({className:e,...t},n)=>E.jsx(XD,{ref:n,className:xe("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Lm.displayName=XD.displayName;const Fm=N.forwardRef(({className:e,...t},n)=>E.jsx(QD,{ref:n,className:xe("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));Fm.displayName=QD.displayName;const Rw=N.forwardRef(({className:e,...t},n)=>E.jsx(JD,{ref:n,className:xe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Rw.displayName=JD.displayName;var ZD={exports:{}},qf={},Px={exports:{}};(function(e,t){(function(n,r){r(t)})(Gs,function(n){function r(J){return function(ie,me,Z,be,Se,$e,Te){return J(ie,me,Te)}}function o(J){return function(ie,me,Z,be){if(!ie||!me||typeof ie!="object"||typeof me!="object")return J(ie,me,Z,be);var Se=be.get(ie),$e=be.get(me);if(Se&&$e)return Se===me&&$e===ie;be.set(ie,me),be.set(me,ie);var Te=J(ie,me,Z,be);return be.delete(ie),be.delete(me),Te}}function i(J,ee){var ie={};for(var me in J)ie[me]=J[me];for(var me in ee)ie[me]=ee[me];return ie}function s(J){return J.constructor===Object||J.constructor==null}function a(J){return typeof J.then=="function"}function l(J,ee){return J===ee||J!==J&&ee!==ee}var c="[object Arguments]",u="[object Boolean]",f="[object Date]",h="[object RegExp]",p="[object Map]",v="[object Number]",b="[object Object]",w="[object Set]",y="[object String]",_=Object.prototype.toString;function C(J){var ee=J.areArraysEqual,ie=J.areDatesEqual,me=J.areMapsEqual,Z=J.areObjectsEqual,be=J.areRegExpsEqual,Se=J.areSetsEqual,$e=J.createIsNestedEqual,Te=$e(Ue);function Ue(Be,Ie,Ke){if(Be===Ie)return!0;if(!Be||!Ie||typeof Be!="object"||typeof Ie!="object")return Be!==Be&&Ie!==Ie;if(s(Be)&&s(Ie))return Z(Be,Ie,Te,Ke);var lt=Array.isArray(Be),Nt=Array.isArray(Ie);if(lt||Nt)return lt===Nt&&ee(Be,Ie,Te,Ke);var At=_.call(Be);return At!==_.call(Ie)?!1:At===f?ie(Be,Ie,Te,Ke):At===h?be(Be,Ie,Te,Ke):At===p?me(Be,Ie,Te,Ke):At===w?Se(Be,Ie,Te,Ke):At===b||At===c?a(Be)||a(Ie)?!1:Z(Be,Ie,Te,Ke):At===u||At===v||At===y?l(Be.valueOf(),Ie.valueOf()):!1}return Ue}function R(J,ee,ie,me){var Z=J.length;if(ee.length!==Z)return!1;for(;Z-- >0;)if(!ie(J[Z],ee[Z],Z,Z,J,ee,me))return!1;return!0}var S=o(R);function $(J,ee){return l(J.valueOf(),ee.valueOf())}function O(J,ee,ie,me){var Z=J.size===ee.size;if(!Z)return!1;if(!J.size)return!0;var be={},Se=0;return J.forEach(function($e,Te){if(Z){var Ue=!1,Be=0;ee.forEach(function(Ie,Ke){!Ue&&!be[Be]&&(Ue=ie(Te,Ke,Se,Be,J,ee,me)&&ie($e,Ie,Te,Ke,J,ee,me))&&(be[Be]=!0),Be++}),Se++,Z=Ue}}),Z}var D=o(O),I="_owner",L=Object.prototype.hasOwnProperty;function j(J,ee,ie,me){var Z=Object.keys(J),be=Z.length;if(Object.keys(ee).length!==be)return!1;for(var Se;be-- >0;){if(Se=Z[be],Se===I){var $e=!!J.$$typeof,Te=!!ee.$$typeof;if(($e||Te)&&$e!==Te)return!1}if(!L.call(ee,Se)||!ie(J[Se],ee[Se],Se,Se,J,ee,me))return!1}return!0}var B=o(j);function te(J,ee){return J.source===ee.source&&J.flags===ee.flags}function q(J,ee,ie,me){var Z=J.size===ee.size;if(!Z)return!1;if(!J.size)return!0;var be={};return J.forEach(function(Se,$e){if(Z){var Te=!1,Ue=0;ee.forEach(function(Be,Ie){!Te&&!be[Ue]&&(Te=ie(Se,Be,$e,Ie,J,ee,me))&&(be[Ue]=!0),Ue++}),Z=Te}}),Z}var F=o(q),Q=Object.freeze({areArraysEqual:R,areDatesEqual:$,areMapsEqual:O,areObjectsEqual:j,areRegExpsEqual:te,areSetsEqual:q,createIsNestedEqual:r}),G=Object.freeze({areArraysEqual:S,areDatesEqual:$,areMapsEqual:D,areObjectsEqual:B,areRegExpsEqual:te,areSetsEqual:F,createIsNestedEqual:r}),K=C(Q);function W(J,ee){return K(J,ee,void 0)}var T=C(i(Q,{createIsNestedEqual:function(){return l}}));function H(J,ee){return T(J,ee,void 0)}var U=C(G);function M(J,ee){return U(J,ee,new WeakMap)}var re=C(i(G,{createIsNestedEqual:function(){return l}}));function ce(J,ee){return re(J,ee,new WeakMap)}function ue(J){return C(i(Q,J(Q)))}function he(J){var ee=C(i(G,J(G)));return function(ie,me,Z){return Z===void 0&&(Z=new WeakMap),ee(ie,me,Z)}}n.circularDeepEqual=M,n.circularShallowEqual=ce,n.createCustomCircularEqual=he,n.createCustomEqual=ue,n.deepEqual=W,n.sameValueZeroEqual=l,n.shallowEqual=H,Object.defineProperty(n,"__esModule",{value:!0})})})(Px,Px.exports);var Pw=Px.exports;const Ow=aw(gB);var Ot={},sW=function(t,n,r){return t===n?!0:t.className===n.className&&r(t.style,n.style)&&t.width===n.width&&t.autoSize===n.autoSize&&t.cols===n.cols&&t.draggableCancel===n.draggableCancel&&t.draggableHandle===n.draggableHandle&&r(t.verticalCompact,n.verticalCompact)&&r(t.compactType,n.compactType)&&r(t.layout,n.layout)&&r(t.margin,n.margin)&&r(t.containerPadding,n.containerPadding)&&t.rowHeight===n.rowHeight&&t.maxRows===n.maxRows&&t.isBounded===n.isBounded&&t.isDraggable===n.isDraggable&&t.isResizable===n.isResizable&&t.allowOverlap===n.allowOverlap&&t.preventCollision===n.preventCollision&&t.useCSSTransforms===n.useCSSTransforms&&t.transformScale===n.transformScale&&t.isDroppable===n.isDroppable&&r(t.resizeHandles,n.resizeHandles)&&r(t.resizeHandle,n.resizeHandle)&&t.onLayoutChange===n.onLayoutChange&&t.onDragStart===n.onDragStart&&t.onDrag===n.onDrag&&t.onDragStop===n.onDragStop&&t.onResizeStart===n.onResizeStart&&t.onResize===n.onResize&&t.onResizeStop===n.onResizeStop&&t.onDrop===n.onDrop&&r(t.droppingItem,n.droppingItem)&&r(t.innerRef,n.innerRef)};Object.defineProperty(Ot,"__esModule",{value:!0});Ot.bottom=$w;Ot.childrenEqual=uW;Ot.cloneLayout=eA;Ot.cloneLayoutItem=cl;Ot.collides=jm;Ot.compact=nA;Ot.compactItem=rA;Ot.compactType=SW;Ot.correctBounds=oA;Ot.fastPositionEqual=fW;Ot.fastRGLPropsEqual=void 0;Ot.getAllCollisions=iA;Ot.getFirstCollision=Xa;Ot.getLayoutItem=Tw;Ot.getStatics=Dw;Ot.modifyLayout=tA;Ot.moveElement=yd;Ot.moveElementAwayFromCollision=$x;Ot.noop=void 0;Ot.perc=pW;Ot.resizeItemInDirection=xW;Ot.setTopLeft=_W;Ot.setTransform=wW;Ot.sortLayoutItems=Lw;Ot.sortLayoutItemsByColRow=uA;Ot.sortLayoutItemsByRowCol=cA;Ot.synchronizeLayoutWithChildren=CW;Ot.validateLayout=dA;Ot.withLayoutItem=cW;var fP=Pw,bd=aW(m);function aW(e){return e&&e.__esModule?e:{default:e}}const lW=process.env.NODE_ENV==="production";function $w(e){let t=0,n;for(let r=0,o=e.length;r<o;r++)n=e[r].y+e[r].h,n>t&&(t=n);return t}function eA(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=cl(e[n]);return t}function tA(e,t){const n=Array(e.length);for(let r=0,o=e.length;r<o;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function cW(e,t,n){let r=Tw(e,t);return r?(r=n(cl(r)),e=tA(e,r),[e,r]):[e,null]}function cl(e){return{w:e.w,h:e.h,x:e.x,y:e.y,i:e.i,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,isBounded:e.isBounded}}function uW(e,t){return(0,fP.deepEqual)(bd.default.Children.map(e,n=>n==null?void 0:n.key),bd.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,fP.deepEqual)(bd.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),bd.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}const dW=sW;Ot.fastRGLPropsEqual=dW;function fW(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function jm(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function nA(e,t,n,r){const o=Dw(e),i=Lw(e,t),s=Array(e.length);for(let a=0,l=i.length;a<l;a++){let c=cl(i[a]);c.static||(c=rA(o,c,t,n,i,r),o.push(c)),s[e.indexOf(i[a])]=c,c.moved=!1}return s}const hW={x:"w",y:"h"};function Ox(e,t,n,r){const o=hW[r];t[r]+=1;const i=e.map(s=>s.i).indexOf(t.i);for(let s=i+1;s<e.length;s++){const a=e[s];if(!a.static){if(a.y>t.y+t.h)break;jm(t,a)&&Ox(e,a,n+t[o],r)}}t[r]=n}function rA(e,t,n,r,o,i){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min($w(e),t.y);t.y>0&&!Xa(e,t);)t.y--;else if(a)for(;t.x>0&&!Xa(e,t);)t.x--;let l;for(;(l=Xa(e,t))&&!(n===null&&i);)if(a?Ox(o,t,l.x+l.w,"x"):Ox(o,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!Xa(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function oA(e,t){const n=Dw(e);for(let r=0,o=e.length;r<o;r++){const i=e[r];if(i.x+i.w>t.cols&&(i.x=t.cols-i.w),i.x<0&&(i.x=0,i.w=t.cols),!i.static)n.push(i);else for(;Xa(n,i);)i.y++}return e}function Tw(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function Xa(e,t){for(let n=0,r=e.length;n<r;n++)if(jm(e[n],t))return e[n]}function iA(e,t){return e.filter(n=>jm(n,t))}function Dw(e){return e.filter(t=>t.static)}function yd(e,t,n,r,o,i,s,a,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;"Moving element ".concat(t.i," to [").concat(String(n),",").concat(String(r),"] from [").concat(t.x,",").concat(t.y,"]");const c=t.x,u=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let f=Lw(e,s);(s==="vertical"&&typeof r=="number"?u>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(f=f.reverse());const p=iA(f,t),v=p.length>0;if(v&&l)return eA(e);if(v&&i)return"Collision prevented on ".concat(t.i,", reverting."),t.x=c,t.y=u,t.moved=!1,e;for(let b=0,w=p.length;b<w;b++){const y=p[b];"Resolving collision between ".concat(t.i," at [").concat(t.x,",").concat(t.y,"] and ").concat(y.i," at [").concat(y.x,",").concat(y.y,"]"),!y.moved&&(y.static?e=$x(e,y,t,o,s):e=$x(e,t,y,o,s))}return e}function $x(e,t,n,r,o,i){const s=o==="horizontal",a=o==="vertical",l=t.static;if(r){r=!1;const f={x:s?Math.max(t.x-n.w,0):n.x,y:a?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},h=Xa(e,f),p=h&&h.y+h.h>t.y,v=h&&t.x+t.w>h.x;if(h){if(p&&a)return yd(e,n,void 0,t.y+1,r,l,o);if(p&&o==null)return t.y=n.y,n.y=n.y+n.h,e;if(v&&s)return yd(e,t,n.x,void 0,r,l,o)}else return"Doing reverse collision on ".concat(n.i," up to [").concat(f.x,",").concat(f.y,"]."),yd(e,n,s?f.x:void 0,a?f.y:void 0,r,l,o)}const c=s?n.x+1:void 0,u=a?n.y+1:void 0;return c==null&&u==null?e:yd(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,o)}function pW(e){return e*100+"%"}const sA=(e,t,n,r)=>e+n>r?t:n,aA=(e,t,n)=>e<0?t:n,lA=e=>Math.max(0,e),Aw=e=>Math.max(0,e),kw=(e,t,n)=>{let{left:r,height:o,width:i}=t;const s=e.top-(o-e.height);return{left:r,width:i,height:aA(s,e.height,o),top:Aw(s)}},Mw=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{top:r,height:i,width:sA(e.left,e.width,s,n),left:lA(o)}},Iw=(e,t,n)=>{let{top:r,height:o,width:i}=t;const s=e.left-(i-e.width);return{height:o,width:s<0?e.width:sA(e.left,e.width,i,n),top:Aw(r),left:lA(s)}},Nw=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{width:s,left:o,height:aA(r,e.height,i),top:Aw(r)}},gW=function(){return kw(arguments.length<=0?void 0:arguments[0],Mw(...arguments))},mW=function(){return kw(arguments.length<=0?void 0:arguments[0],Iw(...arguments))},vW=function(){return Nw(arguments.length<=0?void 0:arguments[0],Mw(...arguments))},bW=function(){return Nw(arguments.length<=0?void 0:arguments[0],Iw(...arguments))},yW={n:kw,ne:gW,e:Mw,se:vW,s:Nw,sw:bW,w:Iw,nw:mW};function xW(e,t,n,r){const o=yW[e];return o?o(t,{...t,...n},r):n}function wW(e){let{top:t,left:n,width:r,height:o}=e;const i="translate(".concat(n,"px,").concat(t,"px)");return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:"".concat(r,"px"),height:"".concat(o,"px"),position:"absolute"}}function _W(e){let{top:t,left:n,width:r,height:o}=e;return{top:"".concat(t,"px"),left:"".concat(n,"px"),width:"".concat(r,"px"),height:"".concat(o,"px"),position:"absolute"}}function Lw(e,t){return t==="horizontal"?uA(e):t==="vertical"?cA(e):e}function cA(e){return e.slice(0).sort(function(t,n){return t.y>n.y||t.y===n.y&&t.x>n.x?1:t.y===n.y&&t.x===n.x?0:-1})}function uA(e){return e.slice(0).sort(function(t,n){return t.x>n.x||t.x===n.x&&t.y>n.y?1:-1})}function CW(e,t,n,r,o){e=e||[];const i=[];bd.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=Tw(e,String(a.key)),c=a.props["data-grid"];l&&c==null?i.push(cl(l)):c?(lW||dA([c],"ReactGridLayout.children"),i.push(cl({...c,i:a.key}))):i.push(cl({w:1,h:1,x:0,y:$w(i),i:String(a.key)}))});const s=oA(i,{cols:n});return o?s:nA(s,r,n)}function dA(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const n=["x","y","w","h"];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(let r=0,o=e.length;r<o;r++){const i=e[r];for(let s=0;s<n.length;s++)if(typeof i[n[s]]!="number")throw new Error("ReactGridLayout: "+t+"["+r+"]."+n[s]+" must be a number!")}}function SW(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const EW=()=>{};Ot.noop=EW;var Di={};Object.defineProperty(Di,"__esModule",{value:!0});Di.calcGridColWidth=zm;Di.calcGridItemPosition=RW;Di.calcGridItemWHPx=Tx;Di.calcWH=OW;Di.calcXY=PW;Di.clamp=Qa;function zm(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function Tx(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function RW(e,t,n,r,o,i){const{margin:s,containerPadding:a,rowHeight:l}=e,c=zm(e),u={};return i&&i.resizing?(u.width=Math.round(i.resizing.width),u.height=Math.round(i.resizing.height)):(u.width=Tx(r,c,s[0]),u.height=Tx(o,l,s[1])),i&&i.dragging?(u.top=Math.round(i.dragging.top),u.left=Math.round(i.dragging.left)):i&&i.resizing&&typeof i.resizing.top=="number"&&typeof i.resizing.left=="number"?(u.top=Math.round(i.resizing.top),u.left=Math.round(i.resizing.left)):(u.top=Math.round((l+s[1])*n+a[1]),u.left=Math.round((c+s[0])*t+a[0])),u}function PW(e,t,n,r,o){const{margin:i,cols:s,rowHeight:a,maxRows:l}=e,c=zm(e);let u=Math.round((n-i[0])/(c+i[0])),f=Math.round((t-i[1])/(a+i[1]));return u=Qa(u,0,s-r),f=Qa(f,0,l-o),{x:u,y:f}}function OW(e,t,n,r,o,i){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,u=zm(e);let f=Math.round((t+s[0])/(u+s[0])),h=Math.round((n+s[1])/(c+s[1])),p=Qa(f,0,l-r),v=Qa(h,0,a-o);return["sw","w","nw"].indexOf(i)!==-1&&(p=Qa(f,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(v=Qa(h,0,a)),{w:p,h:v}}function Qa(e,t,n){return Math.max(Math.min(e,n),t)}var Bm={},Dx={exports:{}},f0,hP;function Fw(){if(hP)return f0;hP=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return f0=e,f0}var h0,pP;function $W(){if(pP)return h0;pP=1;var e=Fw();function t(){}function n(){}return n.resetWarningCache=t,h0=function(){function r(s,a,l,c,u,f){if(f!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function o(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},h0}var mp={exports:{}},qt={};/** @license React v16.13.1
89
89
  * react-is.development.js
90
90
  *
91
91
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -106,7 +106,7 @@ object-assign
106
106
  */var p0,bP;function AW(){if(bP)return p0;bP=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function o(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var s={},a=0;a<10;a++)s["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(s).map(function(u){return s[u]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return p0=o()?Object.assign:function(i,s){for(var a,l=r(i),c,u=1;u<arguments.length;u++){a=Object(arguments[u]);for(var f in a)t.call(a,f)&&(l[f]=a[f]);if(e){c=e(a);for(var h=0;h<c.length;h++)n.call(a,c[h])&&(l[c[h]]=a[c[h]])}}return l},p0}var g0,yP;function hA(){return yP||(yP=1,g0=Function.call.bind(Object.prototype.hasOwnProperty)),g0}var m0,xP;function kW(){if(xP)return m0;xP=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Fw(),n={},r=hA();e=function(i){var s="Warning: "+i;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}}function o(i,s,a,l,c){if(process.env.NODE_ENV!=="production"){for(var u in i)if(r(i,u)){var f;try{if(typeof i[u]!="function"){var h=Error((l||"React class")+": "+a+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}f=i[u](s,u,l,a,null,t)}catch(v){f=v}if(f&&!(f instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in n)){n[f.message]=!0;var p=c?c():"";e("Failed "+a+" type: "+f.message+(p??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},m0=o,m0}var v0,wP;function MW(){if(wP)return v0;wP=1;var e=fA(),t=AW(),n=Fw(),r=hA(),o=kW(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function s(){return null}return v0=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function f(T){var H=T&&(c&&T[c]||T[u]);if(typeof H=="function")return H}var h="<<anonymous>>",p={array:y("array"),bigint:y("bigint"),bool:y("boolean"),func:y("function"),number:y("number"),object:y("object"),string:y("string"),symbol:y("symbol"),any:_(),arrayOf:C,element:R(),elementType:S(),instanceOf:$,node:L(),objectOf:D,oneOf:O,oneOfType:I,shape:B,exact:te};function v(T,H){return T===H?T!==0||1/T===1/H:T!==T&&H!==H}function b(T,H){this.message=T,this.data=H&&typeof H=="object"?H:{},this.stack=""}b.prototype=Error.prototype;function w(T){if(process.env.NODE_ENV!=="production")var H={},U=0;function M(ce,ue,he,J,ee,ie,me){if(J=J||h,ie=ie||he,me!==n){if(l){var Z=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw Z.name="Invariant Violation",Z}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var be=J+":"+he;!H[be]&&U<3&&(i("You are manually calling a React.PropTypes validation function for the `"+ie+"` prop on `"+J+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),H[be]=!0,U++)}}return ue[he]==null?ce?ue[he]===null?new b("The "+ee+" `"+ie+"` is marked as required "+("in `"+J+"`, but its value is `null`.")):new b("The "+ee+" `"+ie+"` is marked as required in "+("`"+J+"`, but its value is `undefined`.")):null:T(ue,he,J,ee,ie)}var re=M.bind(null,!1);return re.isRequired=M.bind(null,!0),re}function y(T){function H(U,M,re,ce,ue,he){var J=U[M],ee=Q(J);if(ee!==T){var ie=G(J);return new b("Invalid "+ce+" `"+ue+"` of type "+("`"+ie+"` supplied to `"+re+"`, expected ")+("`"+T+"`."),{expectedType:T})}return null}return w(H)}function _(){return w(s)}function C(T){function H(U,M,re,ce,ue){if(typeof T!="function")return new b("Property `"+ue+"` of component `"+re+"` has invalid PropType notation inside arrayOf.");var he=U[M];if(!Array.isArray(he)){var J=Q(he);return new b("Invalid "+ce+" `"+ue+"` of type "+("`"+J+"` supplied to `"+re+"`, expected an array."))}for(var ee=0;ee<he.length;ee++){var ie=T(he,ee,re,ce,ue+"["+ee+"]",n);if(ie instanceof Error)return ie}return null}return w(H)}function R(){function T(H,U,M,re,ce){var ue=H[U];if(!a(ue)){var he=Q(ue);return new b("Invalid "+re+" `"+ce+"` of type "+("`"+he+"` supplied to `"+M+"`, expected a single ReactElement."))}return null}return w(T)}function S(){function T(H,U,M,re,ce){var ue=H[U];if(!e.isValidElementType(ue)){var he=Q(ue);return new b("Invalid "+re+" `"+ce+"` of type "+("`"+he+"` supplied to `"+M+"`, expected a single ReactElement type."))}return null}return w(T)}function $(T){function H(U,M,re,ce,ue){if(!(U[M]instanceof T)){var he=T.name||h,J=W(U[M]);return new b("Invalid "+ce+" `"+ue+"` of type "+("`"+J+"` supplied to `"+re+"`, expected ")+("instance of `"+he+"`."))}return null}return w(H)}function O(T){if(!Array.isArray(T))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):i("Invalid argument supplied to oneOf, expected an array.")),s;function H(U,M,re,ce,ue){for(var he=U[M],J=0;J<T.length;J++)if(v(he,T[J]))return null;var ee=JSON.stringify(T,function(me,Z){var be=G(Z);return be==="symbol"?String(Z):Z});return new b("Invalid "+ce+" `"+ue+"` of value `"+String(he)+"` "+("supplied to `"+re+"`, expected one of "+ee+"."))}return w(H)}function D(T){function H(U,M,re,ce,ue){if(typeof T!="function")return new b("Property `"+ue+"` of component `"+re+"` has invalid PropType notation inside objectOf.");var he=U[M],J=Q(he);if(J!=="object")return new b("Invalid "+ce+" `"+ue+"` of type "+("`"+J+"` supplied to `"+re+"`, expected an object."));for(var ee in he)if(r(he,ee)){var ie=T(he,ee,re,ce,ue+"."+ee,n);if(ie instanceof Error)return ie}return null}return w(H)}function I(T){if(!Array.isArray(T))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var H=0;H<T.length;H++){var U=T[H];if(typeof U!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+K(U)+" at index "+H+"."),s}function M(re,ce,ue,he,J){for(var ee=[],ie=0;ie<T.length;ie++){var me=T[ie],Z=me(re,ce,ue,he,J,n);if(Z==null)return null;Z.data&&r(Z.data,"expectedType")&&ee.push(Z.data.expectedType)}var be=ee.length>0?", expected one of type ["+ee.join(", ")+"]":"";return new b("Invalid "+he+" `"+J+"` supplied to "+("`"+ue+"`"+be+"."))}return w(M)}function L(){function T(H,U,M,re,ce){return q(H[U])?null:new b("Invalid "+re+" `"+ce+"` supplied to "+("`"+M+"`, expected a ReactNode."))}return w(T)}function j(T,H,U,M,re){return new b((T||"React class")+": "+H+" type `"+U+"."+M+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+re+"`.")}function B(T){function H(U,M,re,ce,ue){var he=U[M],J=Q(he);if(J!=="object")return new b("Invalid "+ce+" `"+ue+"` of type `"+J+"` "+("supplied to `"+re+"`, expected `object`."));for(var ee in T){var ie=T[ee];if(typeof ie!="function")return j(re,ce,ue,ee,G(ie));var me=ie(he,ee,re,ce,ue+"."+ee,n);if(me)return me}return null}return w(H)}function te(T){function H(U,M,re,ce,ue){var he=U[M],J=Q(he);if(J!=="object")return new b("Invalid "+ce+" `"+ue+"` of type `"+J+"` "+("supplied to `"+re+"`, expected `object`."));var ee=t({},U[M],T);for(var ie in ee){var me=T[ie];if(r(T,ie)&&typeof me!="function")return j(re,ce,ue,ie,G(me));if(!me)return new b("Invalid "+ce+" `"+ue+"` key `"+ie+"` supplied to `"+re+"`.\nBad object: "+JSON.stringify(U[M],null," ")+`
107
107
  Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Z=me(he,ie,re,ce,ue+"."+ie,n);if(Z)return Z}return null}return w(H)}function q(T){switch(typeof T){case"number":case"string":case"undefined":return!0;case"boolean":return!T;case"object":if(Array.isArray(T))return T.every(q);if(T===null||a(T))return!0;var H=f(T);if(H){var U=H.call(T),M;if(H!==T.entries){for(;!(M=U.next()).done;)if(!q(M.value))return!1}else for(;!(M=U.next()).done;){var re=M.value;if(re&&!q(re[1]))return!1}}else return!1;return!0;default:return!1}}function F(T,H){return T==="symbol"?!0:H?H["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&H instanceof Symbol:!1}function Q(T){var H=typeof T;return Array.isArray(T)?"array":T instanceof RegExp?"object":F(H,T)?"symbol":H}function G(T){if(typeof T>"u"||T===null)return""+T;var H=Q(T);if(H==="object"){if(T instanceof Date)return"date";if(T instanceof RegExp)return"regexp"}return H}function K(T){var H=G(T);switch(H){case"array":case"object":return"an "+H;case"boolean":case"date":case"regexp":return"a "+H;default:return H}}function W(T){return!T.constructor||!T.constructor.name?h:T.constructor.name}return p.checkPropTypes=o,p.resetWarningCache=o.resetWarningCache,p.PropTypes=p,p},v0}if(process.env.NODE_ENV!=="production"){var IW=fA(),NW=!0;Dx.exports=MW()(IW.isElement,NW)}else Dx.exports=$W()();var ba=Dx.exports,Vm={exports:{}},pA={};function gA(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=gA(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function _P(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=gA(e))&&(r&&(r+=" "),r+=t);return r}const LW=Object.freeze(Object.defineProperty({__proto__:null,clsx:_P,default:_P},Symbol.toStringTag,{value:"Module"})),FW=aw(LW);var On={},Ai={};Object.defineProperty(Ai,"__esModule",{value:!0});Ai.dontSetMe=HW;Ai.findInArray=jW;Ai.int=VW;Ai.isFunction=zW;Ai.isNum=BW;function jW(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function zW(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function BW(e){return typeof e=="number"&&!isNaN(e)}function VW(e){return parseInt(e,10)}function HW(e,t,n){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(n," - do not set this, set it on the child."))}var Tl={};Object.defineProperty(Tl,"__esModule",{value:!0});Tl.browserPrefixToKey=vA;Tl.browserPrefixToStyle=WW;Tl.default=void 0;Tl.getPrefix=mA;const b0=["Moz","Webkit","O","ms"];function mA(){var e;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const n=(e=window.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.style;if(!n||t in n)return"";for(let r=0;r<b0.length;r++)if(vA(t,b0[r])in n)return b0[r];return""}function vA(e,t){return t?"".concat(t).concat(UW(e)):e}function WW(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function UW(e){let t="",n=!0;for(let r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):e[r]==="-"?n=!0:t+=e[r];return t}Tl.default=mA();Object.defineProperty(On,"__esModule",{value:!0});On.addClassName=xA;On.addEvent=YW;On.addUserSelectStyles=iU;On.createCSSTransform=tU;On.createSVGTransform=nU;On.getTouch=rU;On.getTouchIdentifier=oU;On.getTranslation=jw;On.innerHeight=JW;On.innerWidth=ZW;On.matchesSelector=yA;On.matchesSelectorAndParentsTo=qW;On.offsetXYFromParent=eU;On.outerHeight=XW;On.outerWidth=QW;On.removeClassName=wA;On.removeEvent=KW;On.removeUserSelectStyles=sU;var lo=Ai,CP=GW(Tl);function bA(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(bA=function(r){return r?n:t})(e)}function GW(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=bA(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}let vp="";function yA(e,t){return vp||(vp=(0,lo.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,lo.isFunction)(e[n])})),(0,lo.isFunction)(e[vp])?e[vp](t):!1}function qW(e,t,n){let r=e;do{if(yA(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function YW(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,o):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n}function KW(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,o):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null}function XW(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,lo.int)(n.borderTopWidth),t+=(0,lo.int)(n.borderBottomWidth),t}function QW(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,lo.int)(n.borderLeftWidth),t+=(0,lo.int)(n.borderRightWidth),t}function JW(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,lo.int)(n.paddingTop),t-=(0,lo.int)(n.paddingBottom),t}function ZW(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,lo.int)(n.paddingLeft),t-=(0,lo.int)(n.paddingRight),t}function eU(e,t,n){const o=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),i=(e.clientX+t.scrollLeft-o.left)/n,s=(e.clientY+t.scrollTop-o.top)/n;return{x:i,y:s}}function tU(e,t){const n=jw(e,t,"px");return{[(0,CP.browserPrefixToKey)("transform",CP.default)]:n}}function nU(e,t){return jw(e,t,"")}function jw(e,t,n){let{x:r,y:o}=e,i="translate(".concat(r).concat(n,",").concat(o).concat(n,")");if(t){const s="".concat(typeof t.x=="string"?t.x:t.x+n),a="".concat(typeof t.y=="string"?t.y:t.y+n);i="translate(".concat(s,", ").concat(a,")")+i}return i}function rU(e,t){return e.targetTouches&&(0,lo.findInArray)(e.targetTouches,n=>t===n.identifier)||e.changedTouches&&(0,lo.findInArray)(e.changedTouches,n=>t===n.identifier)}function oU(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function iU(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
108
108
  `,t.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
109
- `,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&xA(e.body,"react-draggable-transparent-selection")}function sU(e){if(e)try{if(e.body&&wA(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&t.type!=="Caret"&&t.removeAllRanges()}}catch{}}function xA(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function wA(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var ki={};Object.defineProperty(ki,"__esModule",{value:!0});ki.canDragX=cU;ki.canDragY=uU;ki.createCoreData=fU;ki.createDraggableData=hU;ki.getBoundPosition=aU;ki.getControlPosition=dU;ki.snapToGrid=lU;var Kr=Ai,Sc=On;function aU(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:pU(r);const o=zw(e);if(typeof r=="string"){const{ownerDocument:i}=o,s=i.defaultView;let a;if(r==="parent"?a=o.parentNode:a=i.querySelector(r),!(a instanceof s.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=a,c=s.getComputedStyle(o),u=s.getComputedStyle(l);r={left:-o.offsetLeft+(0,Kr.int)(u.paddingLeft)+(0,Kr.int)(c.marginLeft),top:-o.offsetTop+(0,Kr.int)(u.paddingTop)+(0,Kr.int)(c.marginTop),right:(0,Sc.innerWidth)(l)-(0,Sc.outerWidth)(o)-o.offsetLeft+(0,Kr.int)(u.paddingRight)-(0,Kr.int)(c.marginRight),bottom:(0,Sc.innerHeight)(l)-(0,Sc.outerHeight)(o)-o.offsetTop+(0,Kr.int)(u.paddingBottom)-(0,Kr.int)(c.marginBottom)}}return(0,Kr.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,Kr.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,Kr.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,Kr.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function lU(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]}function cU(e){return e.props.axis==="both"||e.props.axis==="x"}function uU(e){return e.props.axis==="both"||e.props.axis==="y"}function dU(e,t,n){const r=typeof t=="number"?(0,Sc.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const o=zw(n),i=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,Sc.offsetXYFromParent)(r||e,i,n.props.scale)}function fU(e,t,n){const r=!(0,Kr.isNum)(e.lastX),o=zw(e);return r?{node:o,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:o,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function hU(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function pU(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function zw(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var Hm={},Wm={};Object.defineProperty(Wm,"__esModule",{value:!0});Wm.default=gU;function gU(){}Object.defineProperty(Hm,"__esModule",{value:!0});Hm.default=void 0;var y0=vU(m),Tr=Bw(ba),mU=Bw(fr),sr=On,Ns=ki,x0=Ai,Ku=Bw(Wm);function Bw(e){return e&&e.__esModule?e:{default:e}}function _A(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(_A=function(r){return r?n:t})(e)}function vU(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=_A(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function br(e,t,n){return t=bU(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bU(e){var t=yU(e,"string");return typeof t=="symbol"?t:String(t)}function yU(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const Uo={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let Ls=Uo.mouse,Um=class extends y0.Component{constructor(){super(...arguments),br(this,"dragging",!1),br(this,"lastX",NaN),br(this,"lastY",NaN),br(this,"touchIdentifier",null),br(this,"mounted",!1),br(this,"handleDragStart",t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&typeof t.button=="number"&&t.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:r}=n;if(this.props.disabled||!(t.target instanceof r.defaultView.Node)||this.props.handle&&!(0,sr.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,sr.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const o=(0,sr.getTouchIdentifier)(t);this.touchIdentifier=o;const i=(0,Ns.getControlPosition)(t,o,this);if(i==null)return;const{x:s,y:a}=i,l=(0,Ns.createCoreData)(this,s,a);(0,Ku.default)("DraggableCore: handleDragStart: %j",l),(0,Ku.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,sr.addUserSelectStyles)(r),this.dragging=!0,this.lastX=s,this.lastY=a,(0,sr.addEvent)(r,Ls.move,this.handleDrag),(0,sr.addEvent)(r,Ls.stop,this.handleDragStop))}),br(this,"handleDrag",t=>{const n=(0,Ns.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let a=r-this.lastX,l=o-this.lastY;if([a,l]=(0,Ns.snapToGrid)(this.props.grid,a,l),!a&&!l)return;r=this.lastX+a,o=this.lastY+l}const i=(0,Ns.createCoreData)(this,r,o);if((0,Ku.default)("DraggableCore: handleDrag: %j",i),this.props.onDrag(t,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const l=document.createEvent("MouseEvents");l.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(l)}return}this.lastX=r,this.lastY=o}),br(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,Ns.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX||0,c=o-this.lastY||0;[l,c]=(0,Ns.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,o=this.lastY+c}const i=(0,Ns.createCoreData)(this,r,o);if(this.props.onStop(t,i)===!1||this.mounted===!1)return!1;const a=this.findDOMNode();a&&this.props.enableUserSelectHack&&(0,sr.removeUserSelectStyles)(a.ownerDocument),(0,Ku.default)("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&((0,Ku.default)("DraggableCore: Removing handlers"),(0,sr.removeEvent)(a.ownerDocument,Ls.move,this.handleDrag),(0,sr.removeEvent)(a.ownerDocument,Ls.stop,this.handleDragStop))}),br(this,"onMouseDown",t=>(Ls=Uo.mouse,this.handleDragStart(t))),br(this,"onMouseUp",t=>(Ls=Uo.mouse,this.handleDragStop(t))),br(this,"onTouchStart",t=>(Ls=Uo.touch,this.handleDragStart(t))),br(this,"onTouchEnd",t=>(Ls=Uo.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,sr.addEvent)(t,Uo.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,sr.removeEvent)(n,Uo.mouse.move,this.handleDrag),(0,sr.removeEvent)(n,Uo.touch.move,this.handleDrag),(0,sr.removeEvent)(n,Uo.mouse.stop,this.handleDragStop),(0,sr.removeEvent)(n,Uo.touch.stop,this.handleDragStop),(0,sr.removeEvent)(t,Uo.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,sr.removeUserSelectStyles)(n)}}findDOMNode(){var t,n;return(t=this.props)!==null&&t!==void 0&&t.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:mU.default.findDOMNode(this)}render(){return y0.cloneElement(y0.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Hm.default=Um;br(Um,"displayName","DraggableCore");br(Um,"propTypes",{allowAnyClick:Tr.default.bool,children:Tr.default.node.isRequired,disabled:Tr.default.bool,enableUserSelectHack:Tr.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:Tr.default.arrayOf(Tr.default.number),handle:Tr.default.string,cancel:Tr.default.string,nodeRef:Tr.default.object,onStart:Tr.default.func,onDrag:Tr.default.func,onStop:Tr.default.func,onMouseDown:Tr.default.func,scale:Tr.default.number,className:x0.dontSetMe,style:x0.dontSetMe,transform:x0.dontSetMe});br(Um,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1});(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),e.default=void 0;var t=h(m),n=u(ba),r=u(fr),o=u(FW),i=On,s=ki,a=Ai,l=u(Hm),c=u(Wm);function u(_){return _&&_.__esModule?_:{default:_}}function f(_){if(typeof WeakMap!="function")return null;var C=new WeakMap,R=new WeakMap;return(f=function(S){return S?R:C})(_)}function h(_,C){if(!C&&_&&_.__esModule)return _;if(_===null||typeof _!="object"&&typeof _!="function")return{default:_};var R=f(C);if(R&&R.has(_))return R.get(_);var S={},$=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var O in _)if(O!=="default"&&Object.prototype.hasOwnProperty.call(_,O)){var D=$?Object.getOwnPropertyDescriptor(_,O):null;D&&(D.get||D.set)?Object.defineProperty(S,O,D):S[O]=_[O]}return S.default=_,R&&R.set(_,S),S}function p(){return p=Object.assign?Object.assign.bind():function(_){for(var C=1;C<arguments.length;C++){var R=arguments[C];for(var S in R)Object.prototype.hasOwnProperty.call(R,S)&&(_[S]=R[S])}return _},p.apply(this,arguments)}function v(_,C,R){return C=b(C),C in _?Object.defineProperty(_,C,{value:R,enumerable:!0,configurable:!0,writable:!0}):_[C]=R,_}function b(_){var C=w(_,"string");return typeof C=="symbol"?C:String(C)}function w(_,C){if(typeof _!="object"||_===null)return _;var R=_[Symbol.toPrimitive];if(R!==void 0){var S=R.call(_,C||"default");if(typeof S!="object")return S;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(_)}class y extends t.Component{static getDerivedStateFromProps(C,R){let{position:S}=C,{prevPropsPosition:$}=R;return S&&(!$||S.x!==$.x||S.y!==$.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:S,prevPropsPosition:$}),{x:S.x,y:S.y,prevPropsPosition:{...S}}):null}constructor(C){super(C),v(this,"onDragStart",(R,S)=>{if((0,c.default)("Draggable: onDragStart: %j",S),this.props.onStart(R,(0,s.createDraggableData)(this,S))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),v(this,"onDrag",(R,S)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",S);const $=(0,s.createDraggableData)(this,S),O={x:$.x,y:$.y,slackX:0,slackY:0};if(this.props.bounds){const{x:I,y:L}=O;O.x+=this.state.slackX,O.y+=this.state.slackY;const[j,B]=(0,s.getBoundPosition)(this,O.x,O.y);O.x=j,O.y=B,O.slackX=this.state.slackX+(I-O.x),O.slackY=this.state.slackY+(L-O.y),$.x=O.x,$.y=O.y,$.deltaX=O.x-this.state.x,$.deltaY=O.y-this.state.y}if(this.props.onDrag(R,$)===!1)return!1;this.setState(O)}),v(this,"onDragStop",(R,S)=>{if(!this.state.dragging||this.props.onStop(R,(0,s.createDraggableData)(this,S))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",S);const O={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:I,y:L}=this.props.position;O.x=I,O.y=L}this.setState(O)}),this.state={dragging:!1,dragged:!1,x:C.position?C.position.x:C.defaultPosition.x,y:C.position?C.position.y:C.defaultPosition.y,prevPropsPosition:{...C.position},slackX:0,slackY:0,isElementSVG:!1},C.position&&!(C.onDrag||C.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var C,R;return(C=(R=this.props)===null||R===void 0||(R=R.nodeRef)===null||R===void 0?void 0:R.current)!==null&&C!==void 0?C:r.default.findDOMNode(this)}render(){const{axis:C,bounds:R,children:S,defaultPosition:$,defaultClassName:O,defaultClassNameDragging:D,defaultClassNameDragged:I,position:L,positionOffset:j,scale:B,...te}=this.props;let q={},F=null;const G=!!!L||this.state.dragging,K=L||$,W={x:(0,s.canDragX)(this)&&G?this.state.x:K.x,y:(0,s.canDragY)(this)&&G?this.state.y:K.y};this.state.isElementSVG?F=(0,i.createSVGTransform)(W,j):q=(0,i.createCSSTransform)(W,j);const T=(0,o.default)(S.props.className||"",O,{[D]:this.state.dragging,[I]:this.state.dragged});return t.createElement(l.default,p({},te,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(S),{className:T,style:{...S.props.style,...q},transform:F}))}}e.default=y,v(y,"displayName","Draggable"),v(y,"propTypes",{...l.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:a.dontSetMe,style:a.dontSetMe,transform:a.dontSetMe}),v(y,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(pA);const{default:CA,DraggableCore:xU}=pA;Vm.exports=CA;Vm.exports.default=CA;Vm.exports.DraggableCore=xU;var SA=Vm.exports,Gm={exports:{}},Yf={},Vw={};Vw.__esModule=!0;Vw.cloneElement=RU;var wU=_U(m);function _U(e){return e&&e.__esModule?e:{default:e}}function SP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function EP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SP(Object(n),!0).forEach(function(r){CU(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function CU(e,t,n){return t=SU(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SU(e){var t=EU(e,"string");return typeof t=="symbol"?t:String(t)}function EU(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function RU(e,t){return t.style&&e.props.style&&(t.style=EP(EP({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),wU.default.cloneElement(e,t)}var Kf={};Kf.__esModule=!0;Kf.resizableProps=void 0;var mt=PU(ba);function PU(e){return e&&e.__esModule?e:{default:e}}var OU={axis:mt.default.oneOf(["both","x","y","none"]),className:mt.default.string,children:mt.default.element.isRequired,draggableOpts:mt.default.shape({allowAnyClick:mt.default.bool,cancel:mt.default.string,children:mt.default.node,disabled:mt.default.bool,enableUserSelectHack:mt.default.bool,offsetParent:mt.default.node,grid:mt.default.arrayOf(mt.default.number),handle:mt.default.string,nodeRef:mt.default.object,onStart:mt.default.func,onDrag:mt.default.func,onStop:mt.default.func,onMouseDown:mt.default.func,scale:mt.default.number}),height:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="y"){var i;return(i=mt.default.number).isRequired.apply(i,n)}return mt.default.number.apply(mt.default,n)},handle:mt.default.oneOfType([mt.default.node,mt.default.func]),handleSize:mt.default.arrayOf(mt.default.number),lockAspectRatio:mt.default.bool,maxConstraints:mt.default.arrayOf(mt.default.number),minConstraints:mt.default.arrayOf(mt.default.number),onResizeStop:mt.default.func,onResizeStart:mt.default.func,onResize:mt.default.func,resizeHandles:mt.default.arrayOf(mt.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:mt.default.number,width:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="x"){var i;return(i=mt.default.number).isRequired.apply(i,n)}return mt.default.number.apply(mt.default,n)}};Kf.resizableProps=OU;Yf.__esModule=!0;Yf.default=void 0;var Xu=kU(m),$U=SA,TU=Vw,DU=Kf,AU=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function EA(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(EA=function(o){return o?n:t})(e)}function kU(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=EA(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Ax(){return Ax=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ax.apply(this,arguments)}function MU(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function RP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function w0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RP(Object(n),!0).forEach(function(r){IU(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function IU(e,t,n){return t=NU(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NU(e){var t=LU(e,"string");return typeof t=="symbol"?t:String(t)}function LU(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function FU(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,kx(e,t)}function kx(e,t){return kx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},kx(e,t)}var Hw=function(e){FU(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=e.call.apply(e,[this].concat(i))||this,r.handleRefs={},r.lastHandleRect=null,r.slack=null,r}var n=t.prototype;return n.componentWillUnmount=function(){this.resetData()},n.resetData=function(){this.lastHandleRect=this.slack=null},n.runConstraints=function(o,i){var s=this.props,a=s.minConstraints,l=s.maxConstraints,c=s.lockAspectRatio;if(!a&&!l&&!c)return[o,i];if(c){var u=this.props.width/this.props.height,f=o-this.props.width,h=i-this.props.height;Math.abs(f)>Math.abs(h*u)?i=o/u:o=i*u}var p=o,v=i,b=this.slack||[0,0],w=b[0],y=b[1];return o+=w,i+=y,a&&(o=Math.max(a[0],o),i=Math.max(a[1],i)),l&&(o=Math.min(l[0],o),i=Math.min(l[1],i)),this.slack=[w+(p-o),y+(v-i)],[o,i]},n.resizeHandler=function(o,i){var s=this;return function(a,l){var c=l.node,u=l.deltaX,f=l.deltaY;o==="onResizeStart"&&s.resetData();var h=(s.props.axis==="both"||s.props.axis==="x")&&i!=="n"&&i!=="s",p=(s.props.axis==="both"||s.props.axis==="y")&&i!=="e"&&i!=="w";if(!(!h&&!p)){var v=i[0],b=i[i.length-1],w=c.getBoundingClientRect();if(s.lastHandleRect!=null){if(b==="w"){var y=w.left-s.lastHandleRect.left;u+=y}if(v==="n"){var _=w.top-s.lastHandleRect.top;f+=_}}s.lastHandleRect=w,b==="w"&&(u=-u),v==="n"&&(f=-f);var C=s.props.width+(h?u/s.props.transformScale:0),R=s.props.height+(p?f/s.props.transformScale:0),S=s.runConstraints(C,R);C=S[0],R=S[1];var $=C!==s.props.width||R!==s.props.height,O=typeof s.props[o]=="function"?s.props[o]:null,D=o==="onResize"&&!$;O&&!D&&(a.persist==null||a.persist(),O(a,{node:c,size:{width:C,height:R},handle:i})),o==="onResizeStop"&&s.resetData()}}},n.renderResizeHandle=function(o,i){var s=this.props.handle;if(!s)return Xu.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+o,ref:i});if(typeof s=="function")return s(o,i);var a=typeof s.type=="string",l=w0({ref:i},a?{}:{handleAxis:o});return Xu.cloneElement(s,l)},n.render=function(){var o=this,i=this.props,s=i.children,a=i.className,l=i.draggableOpts;i.width,i.height,i.handle,i.handleSize,i.lockAspectRatio,i.axis,i.minConstraints,i.maxConstraints,i.onResize,i.onResizeStop,i.onResizeStart;var c=i.resizeHandles;i.transformScale;var u=MU(i,AU);return(0,TU.cloneElement)(s,w0(w0({},u),{},{className:(a?a+" ":"")+"react-resizable",children:[].concat(s.props.children,c.map(function(f){var h,p=(h=o.handleRefs[f])!=null?h:o.handleRefs[f]=Xu.createRef();return Xu.createElement($U.DraggableCore,Ax({},l,{nodeRef:p,key:"resizableHandle-"+f,onStop:o.resizeHandler("onResizeStop",f),onStart:o.resizeHandler("onResizeStart",f),onDrag:o.resizeHandler("onResize",f)}),o.renderResizeHandle(f,p))}))}))},t}(Xu.Component);Yf.default=Hw;Hw.propTypes=DU.resizableProps;Hw.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var qm={};qm.__esModule=!0;qm.default=void 0;var _0=HU(m),jU=RA(ba),zU=RA(Yf),BU=Kf,VU=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function RA(e){return e&&e.__esModule?e:{default:e}}function PA(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(PA=function(o){return o?n:t})(e)}function HU(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=PA(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Mx(){return Mx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mx.apply(this,arguments)}function PP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Vg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?PP(Object(n),!0).forEach(function(r){WU(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function WU(e,t,n){return t=UU(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UU(e){var t=GU(e,"string");return typeof t=="symbol"?t:String(t)}function GU(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qU(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function YU(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Ix(e,t)}function Ix(e,t){return Ix=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Ix(e,t)}var OA=function(e){YU(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=e.call.apply(e,[this].concat(i))||this,r.state={width:r.props.width,height:r.props.height,propsWidth:r.props.width,propsHeight:r.props.height},r.onResize=function(a,l){var c=l.size;r.props.onResize?(a.persist==null||a.persist(),r.setState(c,function(){return r.props.onResize&&r.props.onResize(a,l)})):r.setState(c)},r}t.getDerivedStateFromProps=function(o,i){return i.propsWidth!==o.width||i.propsHeight!==o.height?{width:o.width,height:o.height,propsWidth:o.width,propsHeight:o.height}:null};var n=t.prototype;return n.render=function(){var o=this.props,i=o.handle,s=o.handleSize;o.onResize;var a=o.onResizeStart,l=o.onResizeStop,c=o.draggableOpts,u=o.minConstraints,f=o.maxConstraints,h=o.lockAspectRatio,p=o.axis;o.width,o.height;var v=o.resizeHandles,b=o.style,w=o.transformScale,y=qU(o,VU);return _0.createElement(zU.default,{axis:p,draggableOpts:c,handle:i,handleSize:s,height:this.state.height,lockAspectRatio:h,maxConstraints:f,minConstraints:u,onResizeStart:a,onResize:this.onResize,onResizeStop:l,resizeHandles:v,transformScale:w,width:this.state.width},_0.createElement("div",Mx({},y,{style:Vg(Vg({},b),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(_0.Component);qm.default=OA;OA.propTypes=Vg(Vg({},BU.resizableProps),{},{children:jU.default.element});Gm.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};Gm.exports.Resizable=Yf.default;Gm.exports.ResizableBox=qm.default;var KU=Gm.exports,cs={};Object.defineProperty(cs,"__esModule",{value:!0});cs.resizeHandleType=cs.resizeHandleAxesType=cs.default=void 0;var _t=$A(ba),XU=$A(m);function $A(e){return e&&e.__esModule?e:{default:e}}const TA=_t.default.arrayOf(_t.default.oneOf(["s","w","e","n","sw","nw","se","ne"]));cs.resizeHandleAxesType=TA;const DA=_t.default.oneOfType([_t.default.node,_t.default.func]);cs.resizeHandleType=DA;var QU={className:_t.default.string,style:_t.default.object,width:_t.default.number,autoSize:_t.default.bool,cols:_t.default.number,draggableCancel:_t.default.string,draggableHandle:_t.default.string,verticalCompact:function(e){e.verticalCompact===!1&&process.env.NODE_ENV!=="production"&&console.warn('`verticalCompact` on <ReactGridLayout> is deprecated and will be removed soon. Use `compactType`: "horizontal" | "vertical" | null.')},compactType:_t.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&Ot.validateLayout(t,"layout")},margin:_t.default.arrayOf(_t.default.number),containerPadding:_t.default.arrayOf(_t.default.number),rowHeight:_t.default.number,maxRows:_t.default.number,isBounded:_t.default.bool,isDraggable:_t.default.bool,isResizable:_t.default.bool,allowOverlap:_t.default.bool,preventCollision:_t.default.bool,useCSSTransforms:_t.default.bool,transformScale:_t.default.number,isDroppable:_t.default.bool,resizeHandles:TA,resizeHandle:DA,onLayoutChange:_t.default.func,onDragStart:_t.default.func,onDrag:_t.default.func,onDragStop:_t.default.func,onResizeStart:_t.default.func,onResize:_t.default.func,onResizeStop:_t.default.func,onDrop:_t.default.func,droppingItem:_t.default.shape({i:_t.default.string.isRequired,w:_t.default.number.isRequired,h:_t.default.number.isRequired}),children:function(e,t){const n=e[t],r={};XU.default.Children.forEach(n,function(o){if((o==null?void 0:o.key)!=null){if(r[o.key])throw new Error('Duplicate child key "'+o.key+'" found! This will cause problems in ReactGridLayout.');r[o.key]=!0}})},innerRef:_t.default.any};cs.default=QU;Object.defineProperty(Bm,"__esModule",{value:!0});Bm.default=void 0;var nc=Ww(m),Bt=Ww(ba),JU=SA,ZU=KU,rc=Ot,Kn=Di,OP=cs,eG=Ww(Ow);function Ww(e){return e&&e.__esModule?e:{default:e}}function di(e,t,n){return t=tG(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tG(e){var t=nG(e,"string");return typeof t=="symbol"?t:String(t)}function nG(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class Uw extends nc.default.Component{constructor(){super(...arguments),di(this,"state",{resizing:null,dragging:null,className:""}),di(this,"elementRef",nc.default.createRef()),di(this,"onDragStart",(t,n)=>{let{node:r}=n;const{onDragStart:o,transformScale:i}=this.props;if(!o)return;const s={top:0,left:0},{offsetParent:a}=r;if(!a)return;const l=a.getBoundingClientRect(),c=r.getBoundingClientRect(),u=c.left/i,f=l.left/i,h=c.top/i,p=l.top/i;s.left=u-f+a.scrollLeft,s.top=h-p+a.scrollTop,this.setState({dragging:s});const{x:v,y:b}=(0,Kn.calcXY)(this.getPositionParams(),s.top,s.left,this.props.w,this.props.h);return o.call(this,this.props.i,v,b,{e:t,node:r,newPosition:s})}),di(this,"onDrag",(t,n)=>{let{node:r,deltaX:o,deltaY:i}=n;const{onDrag:s}=this.props;if(!s)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let a=this.state.dragging.top+i,l=this.state.dragging.left+o;const{isBounded:c,i:u,w:f,h,containerWidth:p}=this.props,v=this.getPositionParams();if(c){const{offsetParent:_}=r;if(_){const{margin:C,rowHeight:R}=this.props,S=_.clientHeight-(0,Kn.calcGridItemWHPx)(h,R,C[1]);a=(0,Kn.clamp)(a,0,S);const $=(0,Kn.calcGridColWidth)(v),O=p-(0,Kn.calcGridItemWHPx)(f,$,C[0]);l=(0,Kn.clamp)(l,0,O)}}const b={top:a,left:l};this.setState({dragging:b});const{x:w,y}=(0,Kn.calcXY)(v,a,l,f,h);return s.call(this,u,w,y,{e:t,node:r,newPosition:b})}),di(this,"onDragStop",(t,n)=>{let{node:r}=n;const{onDragStop:o}=this.props;if(!o)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:i,h:s,i:a}=this.props,{left:l,top:c}=this.state.dragging,u={top:c,left:l};this.setState({dragging:null});const{x:f,y:h}=(0,Kn.calcXY)(this.getPositionParams(),c,l,i,s);return o.call(this,a,f,h,{e:t,node:r,newPosition:u})}),di(this,"onResizeStop",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStop")),di(this,"onResizeStart",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStart")),di(this,"onResize",(t,n,r)=>this.onResizeHandler(t,n,r,"onResize"))}shouldComponentUpdate(t,n){if(this.props.children!==t.children||this.props.droppingPosition!==t.droppingPosition)return!0;const r=(0,Kn.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),o=(0,Kn.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,n);return!(0,rc.fastPositionEqual)(r,o)||this.props.useCSSTransforms!==t.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(t){this.moveDroppingItem(t)}moveDroppingItem(t){const{droppingPosition:n}=this.props;if(!n)return;const r=this.elementRef.current;if(!r)return;const o=t.droppingPosition||{left:0,top:0},{dragging:i}=this.state,s=i&&n.left!==o.left||n.top!==o.top;if(!i)this.onDragStart(n.e,{node:r,deltaX:n.left,deltaY:n.top});else if(s){const a=n.left-i.left,l=n.top-i.top;this.onDrag(n.e,{node:r,deltaX:a,deltaY:l})}}getPositionParams(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:t.cols,containerPadding:t.containerPadding,containerWidth:t.containerWidth,margin:t.margin,maxRows:t.maxRows,rowHeight:t.rowHeight}}createStyle(t){const{usePercentages:n,containerWidth:r,useCSSTransforms:o}=this.props;let i;return o?i=(0,rc.setTransform)(t):(i=(0,rc.setTopLeft)(t),n&&(i.left=(0,rc.perc)(t.left/r),i.width=(0,rc.perc)(t.width/r))),i}mixinDraggable(t,n){return nc.default.createElement(JU.DraggableCore,{disabled:!n,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},t)}curryResizeHandler(t,n){return(r,o)=>n(r,o,t)}mixinResizable(t,n,r){const{cols:o,minW:i,minH:s,maxW:a,maxH:l,transformScale:c,resizeHandles:u,resizeHandle:f}=this.props,h=this.getPositionParams(),p=(0,Kn.calcGridItemPosition)(h,0,0,o,0).width,v=(0,Kn.calcGridItemPosition)(h,0,0,i,s),b=(0,Kn.calcGridItemPosition)(h,0,0,a,l),w=[v.width,v.height],y=[Math.min(b.width,p),Math.min(b.height,1/0)];return nc.default.createElement(ZU.Resizable,{draggableOpts:{disabled:!r},className:r?void 0:"react-resizable-hide",width:n.width,height:n.height,minConstraints:w,maxConstraints:y,onResizeStop:this.curryResizeHandler(n,this.onResizeStop),onResizeStart:this.curryResizeHandler(n,this.onResizeStart),onResize:this.curryResizeHandler(n,this.onResize),transformScale:c,resizeHandles:u,handle:f},t)}onResizeHandler(t,n,r,o){let{node:i,size:s,handle:a}=n;const l=this.props[o];if(!l)return;const{x:c,y:u,i:f,maxH:h,minH:p,containerWidth:v}=this.props,{minW:b,maxW:w}=this.props;let y=s;i&&(y=(0,rc.resizeItemInDirection)(a,r,s,v),this.setState({resizing:o==="onResizeStop"?null:y}));let{w:_,h:C}=(0,Kn.calcWH)(this.getPositionParams(),y.width,y.height,c,u,a);_=(0,Kn.clamp)(_,Math.max(b,1),w),C=(0,Kn.clamp)(C,p,h),l.call(this,f,_,C,{e:t,node:i,size:y,handle:a})}render(){const{x:t,y:n,w:r,h:o,isDraggable:i,isResizable:s,droppingPosition:a,useCSSTransforms:l}=this.props,c=(0,Kn.calcGridItemPosition)(this.getPositionParams(),t,n,r,o,this.state),u=nc.default.Children.only(this.props.children);let f=nc.default.cloneElement(u,{ref:this.elementRef,className:(0,eG.default)("react-grid-item",u.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":i,"react-draggable-dragging":!!this.state.dragging,dropping:!!a,cssTransforms:l}),style:{...this.props.style,...u.props.style,...this.createStyle(c)}});return f=this.mixinResizable(f,c,s),f=this.mixinDraggable(f,i),f}}Bm.default=Uw;di(Uw,"propTypes",{children:Bt.default.element,cols:Bt.default.number.isRequired,containerWidth:Bt.default.number.isRequired,rowHeight:Bt.default.number.isRequired,margin:Bt.default.array.isRequired,maxRows:Bt.default.number.isRequired,containerPadding:Bt.default.array.isRequired,x:Bt.default.number.isRequired,y:Bt.default.number.isRequired,w:Bt.default.number.isRequired,h:Bt.default.number.isRequired,minW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minWidth not Number");if(n>e.w||n>e.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxWidth not Number");if(n<e.w||n<e.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minHeight not Number");if(n>e.h||n>e.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxHeight not Number");if(n<e.h||n<e.minH)return new Error("maxHeight smaller than item height/minHeight")},i:Bt.default.string.isRequired,resizeHandles:OP.resizeHandleAxesType,resizeHandle:OP.resizeHandleType,onDragStop:Bt.default.func,onDragStart:Bt.default.func,onDrag:Bt.default.func,onResizeStop:Bt.default.func,onResizeStart:Bt.default.func,onResize:Bt.default.func,isDraggable:Bt.default.bool.isRequired,isResizable:Bt.default.bool.isRequired,isBounded:Bt.default.bool.isRequired,static:Bt.default.bool,useCSSTransforms:Bt.default.bool.isRequired,transformScale:Bt.default.number,className:Bt.default.string,handle:Bt.default.string,cancel:Bt.default.string,droppingPosition:Bt.default.shape({e:Bt.default.object.isRequired,left:Bt.default.number.isRequired,top:Bt.default.number.isRequired})});di(Uw,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1});Object.defineProperty(qf,"__esModule",{value:!0});qf.default=void 0;var Aa=sG(m),C0=Pw,rG=Gw(Ow),it=Ot,oG=Di,$P=Gw(Bm),iG=Gw(cs);function Gw(e){return e&&e.__esModule?e:{default:e}}function AA(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(AA=function(r){return r?n:t})(e)}function sG(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=AA(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function ar(e,t,n){return t=aG(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aG(e){var t=lG(e,"string");return typeof t=="symbol"?t:String(t)}function lG(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const TP="react-grid-layout";let kA=!1;try{kA=/firefox/i.test(navigator.userAgent)}catch{}class Ym extends Aa.Component{constructor(){super(...arguments),ar(this,"state",{activeDrag:null,layout:(0,it.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,it.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),ar(this,"dragEnterCounter",0),ar(this,"onDragStart",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a}=this.state,l=(0,it.getLayoutItem)(a,t);if(l)return this.setState({oldDragItem:(0,it.cloneLayoutItem)(l),oldLayout:a}),this.props.onDragStart(a,l,l,null,i,s)}),ar(this,"onDrag",(t,n,r,o)=>{let{e:i,node:s}=o;const{oldDragItem:a}=this.state;let{layout:l}=this.state;const{cols:c,allowOverlap:u,preventCollision:f}=this.props,h=(0,it.getLayoutItem)(l,t);if(!h)return;const p={w:h.w,h:h.h,x:h.x,y:h.y,placeholder:!0,i:t},v=!0;l=(0,it.moveElement)(l,h,n,r,v,f,(0,it.compactType)(this.props),c,u),this.props.onDrag(l,a,h,p,i,s),this.setState({layout:u?l:(0,it.compact)(l,(0,it.compactType)(this.props),c),activeDrag:p})}),ar(this,"onDragStop",(t,n,r,o)=>{let{e:i,node:s}=o;if(!this.state.activeDrag)return;const{oldDragItem:a}=this.state;let{layout:l}=this.state;const{cols:c,preventCollision:u,allowOverlap:f}=this.props,h=(0,it.getLayoutItem)(l,t);if(!h)return;const p=!0;l=(0,it.moveElement)(l,h,n,r,p,u,(0,it.compactType)(this.props),c,f);const v=f?l:(0,it.compact)(l,(0,it.compactType)(this.props),c);this.props.onDragStop(v,a,h,null,i,s);const{oldLayout:b}=this.state;this.setState({activeDrag:null,layout:v,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(v,b)}),ar(this,"onResizeStart",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a}=this.state,l=(0,it.getLayoutItem)(a,t);l&&(this.setState({oldResizeItem:(0,it.cloneLayoutItem)(l),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(a,l,l,null,i,s))}),ar(this,"onResize",(t,n,r,o)=>{let{e:i,node:s,size:a,handle:l}=o;const{oldResizeItem:c}=this.state;let{layout:u}=this.state;const{cols:f,preventCollision:h,allowOverlap:p}=this.props;let v=!1,b,w,y;const[_,C]=(0,it.withLayoutItem)(u,t,S=>{let $;return w=S.x,y=S.y,["sw","w","nw","n","ne"].indexOf(l)!==-1&&(["sw","nw","w"].indexOf(l)!==-1&&(w=S.x+(S.w-n),n=S.x!==w&&w<0?S.w:n,w=w<0?0:w),["ne","n","nw"].indexOf(l)!==-1&&(y=S.y+(S.h-r),r=S.y!==y&&y<0?S.h:r,y=y<0?0:y),v=!0),h&&!p&&($=(0,it.getAllCollisions)(u,{...S,w:n,h:r,x:w,y}).filter(D=>D.i!==S.i).length>0,$&&(y=S.y,r=S.h,w=S.x,n=S.w,v=!1)),S.w=n,S.h=r,S});if(!C)return;b=_,v&&(b=(0,it.moveElement)(_,C,w,y,!0,this.props.preventCollision,(0,it.compactType)(this.props),f,p));const R={w:C.w,h:C.h,x:C.x,y:C.y,static:!0,i:t};this.props.onResize(b,c,C,R,i,s),this.setState({layout:p?b:(0,it.compact)(b,(0,it.compactType)(this.props),f),activeDrag:R})}),ar(this,"onResizeStop",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a,oldResizeItem:l}=this.state,{cols:c,allowOverlap:u}=this.props,f=(0,it.getLayoutItem)(a,t),h=u?a:(0,it.compact)(a,(0,it.compactType)(this.props),c);this.props.onResizeStop(h,l,f,null,i,s);const{oldLayout:p}=this.state;this.setState({activeDrag:null,layout:h,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(h,p)}),ar(this,"onDragOver",t=>{var n;if(t.preventDefault(),t.stopPropagation(),kA&&!((n=t.nativeEvent.target)!==null&&n!==void 0&&n.classList.contains(TP)))return!1;const{droppingItem:r,onDropDragOver:o,margin:i,cols:s,rowHeight:a,maxRows:l,width:c,containerPadding:u,transformScale:f}=this.props,h=o==null?void 0:o(t);if(h===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const p={...r,...h},{layout:v}=this.state,{layerX:b,layerY:w}=t.nativeEvent,y={left:b/f,top:w/f,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:_,top:C}=this.state.droppingPosition;(_!=b||C!=w)&&this.setState({droppingPosition:y})}}else{const _={cols:s,margin:i,maxRows:l,rowHeight:a,containerWidth:c,containerPadding:u||i},C=(0,oG.calcXY)(_,w,b,p.w,p.h);this.setState({droppingDOMNode:Aa.createElement("div",{key:p.i}),droppingPosition:y,layout:[...v,{...p,x:C.x,y:C.y,static:!1,isDraggable:!0}]})}}),ar(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:n}=this.props,{layout:r}=this.state,o=(0,it.compact)(r.filter(i=>i.i!==t.i),(0,it.compactType)(this.props),n,this.props.allowOverlap);this.setState({layout:o,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),ar(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),ar(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),ar(this,"onDrop",t=>{t.preventDefault(),t.stopPropagation();const{droppingItem:n}=this.props,{layout:r}=this.state,o=r.find(i=>i.i===n.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(r,o,t)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(t,n){let r;return n.activeDrag?null:(!(0,C0.deepEqual)(t.layout,n.propsLayout)||t.compactType!==n.compactType?r=t.layout:(0,it.childrenEqual)(t.children,n.children)||(r=n.layout),r?{layout:(0,it.synchronizeLayoutWithChildren)(r,t.children,t.cols,(0,it.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,n){return this.props.children!==t.children||!(0,it.fastRGLPropsEqual)(this.props,t,C0.deepEqual)||this.state.activeDrag!==n.activeDrag||this.state.mounted!==n.mounted||this.state.droppingPosition!==n.droppingPosition}componentDidUpdate(t,n){if(!this.state.activeDrag){const r=this.state.layout,o=n.layout;this.onLayoutMaybeChanged(r,o)}}containerHeight(){if(!this.props.autoSize)return;const t=(0,it.bottom)(this.state.layout),n=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return t*this.props.rowHeight+(t-1)*this.props.margin[1]+n*2+"px"}onLayoutMaybeChanged(t,n){n||(n=this.state.layout),(0,C0.deepEqual)(n,t)||this.props.onLayoutChange(t)}placeholder(){const{activeDrag:t}=this.state;if(!t)return null;const{width:n,cols:r,margin:o,containerPadding:i,rowHeight:s,maxRows:a,useCSSTransforms:l,transformScale:c}=this.props;return Aa.createElement($P.default,{w:t.w,h:t.h,x:t.x,y:t.y,i:t.i,className:"react-grid-placeholder ".concat(this.state.resizing?"placeholder-resizing":""),containerWidth:n,cols:r,margin:o,containerPadding:i||o,maxRows:a,rowHeight:s,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:l,transformScale:c},Aa.createElement("div",null))}processGridItem(t,n){if(!t||!t.key)return;const r=(0,it.getLayoutItem)(this.state.layout,String(t.key));if(!r)return null;const{width:o,cols:i,margin:s,containerPadding:a,rowHeight:l,maxRows:c,isDraggable:u,isResizable:f,isBounded:h,useCSSTransforms:p,transformScale:v,draggableCancel:b,draggableHandle:w,resizeHandles:y,resizeHandle:_}=this.props,{mounted:C,droppingPosition:R}=this.state,S=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&u,$=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&f,O=r.resizeHandles||y,D=S&&h&&r.isBounded!==!1;return Aa.createElement($P.default,{containerWidth:o,cols:i,margin:s,containerPadding:a||s,maxRows:c,rowHeight:l,cancel:b,handle:w,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:S,isResizable:$,isBounded:D,useCSSTransforms:p&&C,usePercentages:!C,transformScale:v,w:r.w,h:r.h,x:r.x,y:r.y,i:r.i,minH:r.minH,minW:r.minW,maxH:r.maxH,maxW:r.maxW,static:r.static,droppingPosition:n?R:void 0,resizeHandles:O,resizeHandle:_},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:o}=this.props,i=(0,rG.default)(TP,t),s={height:this.containerHeight(),...n};return Aa.createElement("div",{ref:o,className:i,style:s,onDrop:r?this.onDrop:it.noop,onDragLeave:r?this.onDragLeave:it.noop,onDragEnter:r?this.onDragEnter:it.noop,onDragOver:r?this.onDragOver:it.noop},Aa.Children.map(this.props.children,a=>this.processGridItem(a)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}qf.default=Ym;ar(Ym,"displayName","ReactGridLayout");ar(Ym,"propTypes",iG.default);ar(Ym,"defaultProps",{autoSize:!0,cols:12,className:"",style:{},draggableHandle:"",draggableCancel:"",containerPadding:null,rowHeight:150,maxRows:1/0,layout:[],margin:[10,10],isBounded:!1,isDraggable:!0,isResizable:!0,allowOverlap:!1,isDroppable:!1,useCSSTransforms:!0,transformScale:1,verticalCompact:!0,compactType:"vertical",preventCollision:!1,droppingItem:{i:"__dropping-elem__",h:1,w:1},resizeHandles:["se"],onLayoutChange:it.noop,onDragStart:it.noop,onDrag:it.noop,onDragStop:it.noop,onResizeStart:it.noop,onResize:it.noop,onResizeStop:it.noop,onDrop:it.noop,onDropDragOver:it.noop});var Km={},Dl={};Object.defineProperty(Dl,"__esModule",{value:!0});Dl.findOrGenerateResponsiveLayout=dG;Dl.getBreakpointFromWidth=cG;Dl.getColsFromBreakpoint=uG;Dl.sortBreakpoints=qw;var bp=Ot;function cG(e,t){const n=qw(e);let r=n[0];for(let o=1,i=n.length;o<i;o++){const s=n[o];t>e[s]&&(r=s)}return r}function uG(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function dG(e,t,n,r,o,i){if(e[n])return(0,bp.cloneLayout)(e[n]);let s=e[r];const a=qw(t),l=a.slice(a.indexOf(n));for(let c=0,u=l.length;c<u;c++){const f=l[c];if(e[f]){s=e[f];break}}return s=(0,bp.cloneLayout)(s||[]),(0,bp.compact)((0,bp.correctBounds)(s,{cols:o}),i,o)}function qw(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(Km,"__esModule",{value:!0});Km.default=void 0;var DP=hG(m),Dr=MA(ba),S0=Pw,Oc=Ot,ka=Dl,fG=MA(qf);function MA(e){return e&&e.__esModule?e:{default:e}}function IA(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(IA=function(r){return r?n:t})(e)}function hG(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=IA(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Nx(){return Nx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Nx.apply(this,arguments)}function Hg(e,t,n){return t=pG(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pG(e){var t=gG(e,"string");return typeof t=="symbol"?t:String(t)}function gG(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const AP=e=>Object.prototype.toString.call(e);function yp(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class Yw extends DP.Component{constructor(){super(...arguments),Hg(this,"state",this.generateInitialState()),Hg(this,"onLayoutChange",t=>{this.props.onLayoutChange(t,{...this.props.layouts,[this.state.breakpoint]:t})})}generateInitialState(){const{width:t,breakpoints:n,layouts:r,cols:o}=this.props,i=(0,ka.getBreakpointFromWidth)(n,t),s=(0,ka.getColsFromBreakpoint)(i,o),a=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,ka.findOrGenerateResponsiveLayout)(r,n,i,i,s,a),breakpoint:i,cols:s}}static getDerivedStateFromProps(t,n){if(!(0,S0.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:o}=n;return{layout:(0,ka.findOrGenerateResponsiveLayout)(t.layouts,t.breakpoints,r,r,o,t.compactType),layouts:t.layouts}}return null}componentDidUpdate(t){(this.props.width!=t.width||this.props.breakpoint!==t.breakpoint||!(0,S0.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,S0.deepEqual)(this.props.cols,t.cols))&&this.onWidthChange(t)}onWidthChange(t){const{breakpoints:n,cols:r,layouts:o,compactType:i}=this.props,s=this.props.breakpoint||(0,ka.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),a=this.state.breakpoint,l=(0,ka.getColsFromBreakpoint)(s,r),c={...o};if(a!==s||t.breakpoints!==n||t.cols!==r){a in c||(c[a]=(0,Oc.cloneLayout)(this.state.layout));let h=(0,ka.findOrGenerateResponsiveLayout)(c,n,s,a,l,i);h=(0,Oc.synchronizeLayoutWithChildren)(h,this.props.children,l,i,this.props.allowOverlap),c[s]=h,this.props.onLayoutChange(h,c),this.props.onBreakpointChange(s,l),this.setState({breakpoint:s,layout:h,cols:l})}const u=yp(this.props.margin,s),f=yp(this.props.containerPadding,s);this.props.onWidthChange(this.props.width,u,l,f)}render(){const{breakpoint:t,breakpoints:n,cols:r,layouts:o,margin:i,containerPadding:s,onBreakpointChange:a,onLayoutChange:l,onWidthChange:c,...u}=this.props;return DP.createElement(fG.default,Nx({},u,{margin:yp(i,this.state.breakpoint),containerPadding:yp(s,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}Km.default=Yw;Hg(Yw,"propTypes",{breakpoint:Dr.default.string,breakpoints:Dr.default.object,allowOverlap:Dr.default.bool,cols:Dr.default.object,margin:Dr.default.oneOfType([Dr.default.array,Dr.default.object]),containerPadding:Dr.default.oneOfType([Dr.default.array,Dr.default.object]),layouts(e,t){if(AP(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+AP(e[t]));Object.keys(e[t]).forEach(n=>{if(!(n in e.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,Oc.validateLayout)(e.layouts[n],"layouts."+n)})},width:Dr.default.number.isRequired,onBreakpointChange:Dr.default.func,onLayoutChange:Dr.default.func,onWidthChange:Dr.default.func});Hg(Yw,"defaultProps",{breakpoints:{lg:1200,md:996,sm:768,xs:480,xxs:0},cols:{lg:12,md:10,sm:6,xs:4,xxs:2},containerPadding:{lg:null,md:null,sm:null,xs:null,xxs:null},layouts:{},margin:[10,10],allowOverlap:!1,onBreakpointChange:Oc.noop,onLayoutChange:Oc.noop,onWidthChange:Oc.noop});var Kw={},NA=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(o,i){return o[0]===n?(r=i,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),o=this.__entries__[r];return o&&o[1]},t.prototype.set=function(n,r){var o=e(this.__entries__,n);~o?this.__entries__[o][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,o=e(r,n);~o&&r.splice(o,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var o=0,i=this.__entries__;o<i.length;o++){var s=i[o];n.call(r,s[1],s[0])}},t}()}(),Lx=typeof window<"u"&&typeof document<"u"&&window.document===document,Wg=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),mG=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Wg):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),vG=2;function bG(e,t){var n=!1,r=!1,o=0;function i(){n&&(n=!1,e()),r&&a()}function s(){mG(i)}function a(){var l=Date.now();if(n){if(l-o<vG)return;r=!0}else n=!0,r=!1,setTimeout(s,t);o=l}return a}var yG=20,xG=["top","right","bottom","left","width","height","size","weight"],wG=typeof MutationObserver<"u",_G=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=bG(this.refresh.bind(this),yG)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,r=n.indexOf(t);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!Lx||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),wG?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!Lx||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,o=xG.some(function(i){return!!~r.indexOf(i)});o&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),LA=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e},ru=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||Wg},FA=Xm(0,0,0,0);function Ug(e){return parseFloat(e)||0}function kP(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,o){var i=e["border-"+o+"-width"];return r+Ug(i)},0)}function CG(e){for(var t=["top","right","bottom","left"],n={},r=0,o=t;r<o.length;r++){var i=o[r],s=e["padding-"+i];n[i]=Ug(s)}return n}function SG(e){var t=e.getBBox();return Xm(0,0,t.width,t.height)}function EG(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return FA;var r=ru(e).getComputedStyle(e),o=CG(r),i=o.left+o.right,s=o.top+o.bottom,a=Ug(r.width),l=Ug(r.height);if(r.boxSizing==="border-box"&&(Math.round(a+i)!==t&&(a-=kP(r,"left","right")+i),Math.round(l+s)!==n&&(l-=kP(r,"top","bottom")+s)),!PG(e)){var c=Math.round(a+i)-t,u=Math.round(l+s)-n;Math.abs(c)!==1&&(a-=c),Math.abs(u)!==1&&(l-=u)}return Xm(o.left,o.top,a,l)}var RG=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof ru(e).SVGGraphicsElement}:function(e){return e instanceof ru(e).SVGElement&&typeof e.getBBox=="function"}}();function PG(e){return e===ru(e).document.documentElement}function OG(e){return Lx?RG(e)?SG(e):EG(e):FA}function $G(e){var t=e.x,n=e.y,r=e.width,o=e.height,i=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,s=Object.create(i.prototype);return LA(s,{x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:o+n,left:t}),s}function Xm(e,t,n,r){return{x:e,y:t,width:n,height:r}}var TG=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Xm(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=OG(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),DG=function(){function e(t,n){var r=$G(n);LA(this,{target:t,contentRect:r})}return e}(),AG=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new NA,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=r}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof ru(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new TG(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof ru(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new DG(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),jA=typeof WeakMap<"u"?new WeakMap:new NA,zA=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=_G.getInstance(),r=new AG(t,n,this);jA.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){zA.prototype[e]=function(){var t;return(t=jA.get(this))[e].apply(t,arguments)}});var kG=function(){return typeof Wg.ResizeObserver<"u"?Wg.ResizeObserver:zA}();const MG=Object.freeze(Object.defineProperty({__proto__:null,default:kG},Symbol.toStringTag,{value:"Module"})),IG=aw(MG);Object.defineProperty(Kw,"__esModule",{value:!0});Kw.default=HG;var xp=jG(m),NG=Xw(ba),LG=Xw(IG),FG=Xw(Ow);function Xw(e){return e&&e.__esModule?e:{default:e}}function BA(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(BA=function(r){return r?n:t})(e)}function jG(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=BA(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Fx(){return Fx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fx.apply(this,arguments)}function oc(e,t,n){return t=zG(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zG(e){var t=BG(e,"string");return typeof t=="symbol"?t:String(t)}function BG(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const VG="react-grid-layout";function HG(e){var t;return t=class extends xp.Component{constructor(){super(...arguments),oc(this,"state",{width:1280}),oc(this,"elementRef",xp.createRef()),oc(this,"mounted",!1),oc(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new LG.default(o=>{if(this.elementRef.current instanceof HTMLElement){const s=o[0].contentRect.width;this.setState({width:s})}});const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.observe(r)}componentWillUnmount(){this.mounted=!1;const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.unobserve(r),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:r,...o}=this.props;return r&&!this.mounted?xp.createElement("div",{className:(0,FG.default)(this.props.className,VG),style:this.props.style,ref:this.elementRef}):xp.createElement(e,Fx({innerRef:this.elementRef},o,this.state))}},oc(t,"defaultProps",{measureBeforeMount:!1}),oc(t,"propTypes",{measureBeforeMount:NG.default.bool}),t}(function(e){e.exports=qf.default,e.exports.utils=Ot,e.exports.calculateUtils=Di,e.exports.Responsive=Km.default,e.exports.Responsive.utils=Dl,e.exports.WidthProvider=Kw.default})(ZD);var MP=ZD.exports;function Ci({children:e,className:t,text:n,onSave:r,type:o="input"}){const[i,s]=m.useState(!1),[a,l]=m.useState(n),c=Ce(h=>h.isDashboardEditing),u=h=>{h.stopPropagation(),c&&s(!0)};function f(){return o==="textarea"?E.jsx("textarea",{className:xe(" grow px-2 py-1 text-sm bg-background outline-[0.5px] outline-dashed outline-primary/50 rounded-sm",t),onChange:h=>l(h.target.value),value:a,autoFocus:!0,onBlur:()=>s(!1),onKeyDown:h=>{h.key==="Enter"&&h.shiftKey||(h.key==="Enter"||h.key==="Tab")&&(s(!1),r(a))}}):E.jsx("input",{onMouseDown:h=>h.stopPropagation(),type:"text",className:xe("px-2 py-1 text-sm bg-background outline-[0.5px] outline-dashed outline-primary/50 rounded-sm",t),onChange:h=>l(h.target.value),value:a,autoFocus:!0,onBlur:()=>s(!1),onKeyDown:h=>{(h.key==="Enter"||h.key==="Tab")&&(s(!1),r(a))}})}return E.jsx("div",{className:"flex",role:"editable",onDoubleClick:u,children:i?f():e})}/*!
109
+ `,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&xA(e.body,"react-draggable-transparent-selection")}function sU(e){if(e)try{if(e.body&&wA(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&t.type!=="Caret"&&t.removeAllRanges()}}catch{}}function xA(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function wA(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var ki={};Object.defineProperty(ki,"__esModule",{value:!0});ki.canDragX=cU;ki.canDragY=uU;ki.createCoreData=fU;ki.createDraggableData=hU;ki.getBoundPosition=aU;ki.getControlPosition=dU;ki.snapToGrid=lU;var Kr=Ai,Sc=On;function aU(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:pU(r);const o=zw(e);if(typeof r=="string"){const{ownerDocument:i}=o,s=i.defaultView;let a;if(r==="parent"?a=o.parentNode:a=i.querySelector(r),!(a instanceof s.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=a,c=s.getComputedStyle(o),u=s.getComputedStyle(l);r={left:-o.offsetLeft+(0,Kr.int)(u.paddingLeft)+(0,Kr.int)(c.marginLeft),top:-o.offsetTop+(0,Kr.int)(u.paddingTop)+(0,Kr.int)(c.marginTop),right:(0,Sc.innerWidth)(l)-(0,Sc.outerWidth)(o)-o.offsetLeft+(0,Kr.int)(u.paddingRight)-(0,Kr.int)(c.marginRight),bottom:(0,Sc.innerHeight)(l)-(0,Sc.outerHeight)(o)-o.offsetTop+(0,Kr.int)(u.paddingBottom)-(0,Kr.int)(c.marginBottom)}}return(0,Kr.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,Kr.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,Kr.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,Kr.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function lU(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]}function cU(e){return e.props.axis==="both"||e.props.axis==="x"}function uU(e){return e.props.axis==="both"||e.props.axis==="y"}function dU(e,t,n){const r=typeof t=="number"?(0,Sc.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const o=zw(n),i=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,Sc.offsetXYFromParent)(r||e,i,n.props.scale)}function fU(e,t,n){const r=!(0,Kr.isNum)(e.lastX),o=zw(e);return r?{node:o,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:o,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function hU(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function pU(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function zw(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var Hm={},Wm={};Object.defineProperty(Wm,"__esModule",{value:!0});Wm.default=gU;function gU(){}Object.defineProperty(Hm,"__esModule",{value:!0});Hm.default=void 0;var y0=vU(m),Tr=Bw(ba),mU=Bw(fr),sr=On,Ns=ki,x0=Ai,Ku=Bw(Wm);function Bw(e){return e&&e.__esModule?e:{default:e}}function _A(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(_A=function(r){return r?n:t})(e)}function vU(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=_A(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function br(e,t,n){return t=bU(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bU(e){var t=yU(e,"string");return typeof t=="symbol"?t:String(t)}function yU(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const Uo={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let Ls=Uo.mouse,Um=class extends y0.Component{constructor(){super(...arguments),br(this,"dragging",!1),br(this,"lastX",NaN),br(this,"lastY",NaN),br(this,"touchIdentifier",null),br(this,"mounted",!1),br(this,"handleDragStart",t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&typeof t.button=="number"&&t.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:r}=n;if(this.props.disabled||!(t.target instanceof r.defaultView.Node)||this.props.handle&&!(0,sr.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,sr.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const o=(0,sr.getTouchIdentifier)(t);this.touchIdentifier=o;const i=(0,Ns.getControlPosition)(t,o,this);if(i==null)return;const{x:s,y:a}=i,l=(0,Ns.createCoreData)(this,s,a);(0,Ku.default)("DraggableCore: handleDragStart: %j",l),(0,Ku.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,sr.addUserSelectStyles)(r),this.dragging=!0,this.lastX=s,this.lastY=a,(0,sr.addEvent)(r,Ls.move,this.handleDrag),(0,sr.addEvent)(r,Ls.stop,this.handleDragStop))}),br(this,"handleDrag",t=>{const n=(0,Ns.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let a=r-this.lastX,l=o-this.lastY;if([a,l]=(0,Ns.snapToGrid)(this.props.grid,a,l),!a&&!l)return;r=this.lastX+a,o=this.lastY+l}const i=(0,Ns.createCoreData)(this,r,o);if((0,Ku.default)("DraggableCore: handleDrag: %j",i),this.props.onDrag(t,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const l=document.createEvent("MouseEvents");l.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(l)}return}this.lastX=r,this.lastY=o}),br(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,Ns.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX||0,c=o-this.lastY||0;[l,c]=(0,Ns.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,o=this.lastY+c}const i=(0,Ns.createCoreData)(this,r,o);if(this.props.onStop(t,i)===!1||this.mounted===!1)return!1;const a=this.findDOMNode();a&&this.props.enableUserSelectHack&&(0,sr.removeUserSelectStyles)(a.ownerDocument),(0,Ku.default)("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&((0,Ku.default)("DraggableCore: Removing handlers"),(0,sr.removeEvent)(a.ownerDocument,Ls.move,this.handleDrag),(0,sr.removeEvent)(a.ownerDocument,Ls.stop,this.handleDragStop))}),br(this,"onMouseDown",t=>(Ls=Uo.mouse,this.handleDragStart(t))),br(this,"onMouseUp",t=>(Ls=Uo.mouse,this.handleDragStop(t))),br(this,"onTouchStart",t=>(Ls=Uo.touch,this.handleDragStart(t))),br(this,"onTouchEnd",t=>(Ls=Uo.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,sr.addEvent)(t,Uo.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,sr.removeEvent)(n,Uo.mouse.move,this.handleDrag),(0,sr.removeEvent)(n,Uo.touch.move,this.handleDrag),(0,sr.removeEvent)(n,Uo.mouse.stop,this.handleDragStop),(0,sr.removeEvent)(n,Uo.touch.stop,this.handleDragStop),(0,sr.removeEvent)(t,Uo.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,sr.removeUserSelectStyles)(n)}}findDOMNode(){var t,n;return(t=this.props)!==null&&t!==void 0&&t.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:mU.default.findDOMNode(this)}render(){return y0.cloneElement(y0.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Hm.default=Um;br(Um,"displayName","DraggableCore");br(Um,"propTypes",{allowAnyClick:Tr.default.bool,children:Tr.default.node.isRequired,disabled:Tr.default.bool,enableUserSelectHack:Tr.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:Tr.default.arrayOf(Tr.default.number),handle:Tr.default.string,cancel:Tr.default.string,nodeRef:Tr.default.object,onStart:Tr.default.func,onDrag:Tr.default.func,onStop:Tr.default.func,onMouseDown:Tr.default.func,scale:Tr.default.number,className:x0.dontSetMe,style:x0.dontSetMe,transform:x0.dontSetMe});br(Um,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1});(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),e.default=void 0;var t=h(m),n=u(ba),r=u(fr),o=u(FW),i=On,s=ki,a=Ai,l=u(Hm),c=u(Wm);function u(_){return _&&_.__esModule?_:{default:_}}function f(_){if(typeof WeakMap!="function")return null;var C=new WeakMap,R=new WeakMap;return(f=function(S){return S?R:C})(_)}function h(_,C){if(!C&&_&&_.__esModule)return _;if(_===null||typeof _!="object"&&typeof _!="function")return{default:_};var R=f(C);if(R&&R.has(_))return R.get(_);var S={},$=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var O in _)if(O!=="default"&&Object.prototype.hasOwnProperty.call(_,O)){var D=$?Object.getOwnPropertyDescriptor(_,O):null;D&&(D.get||D.set)?Object.defineProperty(S,O,D):S[O]=_[O]}return S.default=_,R&&R.set(_,S),S}function p(){return p=Object.assign?Object.assign.bind():function(_){for(var C=1;C<arguments.length;C++){var R=arguments[C];for(var S in R)Object.prototype.hasOwnProperty.call(R,S)&&(_[S]=R[S])}return _},p.apply(this,arguments)}function v(_,C,R){return C=b(C),C in _?Object.defineProperty(_,C,{value:R,enumerable:!0,configurable:!0,writable:!0}):_[C]=R,_}function b(_){var C=w(_,"string");return typeof C=="symbol"?C:String(C)}function w(_,C){if(typeof _!="object"||_===null)return _;var R=_[Symbol.toPrimitive];if(R!==void 0){var S=R.call(_,C||"default");if(typeof S!="object")return S;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(_)}class y extends t.Component{static getDerivedStateFromProps(C,R){let{position:S}=C,{prevPropsPosition:$}=R;return S&&(!$||S.x!==$.x||S.y!==$.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:S,prevPropsPosition:$}),{x:S.x,y:S.y,prevPropsPosition:{...S}}):null}constructor(C){super(C),v(this,"onDragStart",(R,S)=>{if((0,c.default)("Draggable: onDragStart: %j",S),this.props.onStart(R,(0,s.createDraggableData)(this,S))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),v(this,"onDrag",(R,S)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",S);const $=(0,s.createDraggableData)(this,S),O={x:$.x,y:$.y,slackX:0,slackY:0};if(this.props.bounds){const{x:I,y:L}=O;O.x+=this.state.slackX,O.y+=this.state.slackY;const[j,B]=(0,s.getBoundPosition)(this,O.x,O.y);O.x=j,O.y=B,O.slackX=this.state.slackX+(I-O.x),O.slackY=this.state.slackY+(L-O.y),$.x=O.x,$.y=O.y,$.deltaX=O.x-this.state.x,$.deltaY=O.y-this.state.y}if(this.props.onDrag(R,$)===!1)return!1;this.setState(O)}),v(this,"onDragStop",(R,S)=>{if(!this.state.dragging||this.props.onStop(R,(0,s.createDraggableData)(this,S))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",S);const O={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:I,y:L}=this.props.position;O.x=I,O.y=L}this.setState(O)}),this.state={dragging:!1,dragged:!1,x:C.position?C.position.x:C.defaultPosition.x,y:C.position?C.position.y:C.defaultPosition.y,prevPropsPosition:{...C.position},slackX:0,slackY:0,isElementSVG:!1},C.position&&!(C.onDrag||C.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var C,R;return(C=(R=this.props)===null||R===void 0||(R=R.nodeRef)===null||R===void 0?void 0:R.current)!==null&&C!==void 0?C:r.default.findDOMNode(this)}render(){const{axis:C,bounds:R,children:S,defaultPosition:$,defaultClassName:O,defaultClassNameDragging:D,defaultClassNameDragged:I,position:L,positionOffset:j,scale:B,...te}=this.props;let q={},F=null;const G=!!!L||this.state.dragging,K=L||$,W={x:(0,s.canDragX)(this)&&G?this.state.x:K.x,y:(0,s.canDragY)(this)&&G?this.state.y:K.y};this.state.isElementSVG?F=(0,i.createSVGTransform)(W,j):q=(0,i.createCSSTransform)(W,j);const T=(0,o.default)(S.props.className||"",O,{[D]:this.state.dragging,[I]:this.state.dragged});return t.createElement(l.default,p({},te,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(S),{className:T,style:{...S.props.style,...q},transform:F}))}}e.default=y,v(y,"displayName","Draggable"),v(y,"propTypes",{...l.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:a.dontSetMe,style:a.dontSetMe,transform:a.dontSetMe}),v(y,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(pA);const{default:CA,DraggableCore:xU}=pA;Vm.exports=CA;Vm.exports.default=CA;Vm.exports.DraggableCore=xU;var SA=Vm.exports,Gm={exports:{}},Yf={},Vw={};Vw.__esModule=!0;Vw.cloneElement=RU;var wU=_U(m);function _U(e){return e&&e.__esModule?e:{default:e}}function SP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function EP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SP(Object(n),!0).forEach(function(r){CU(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function CU(e,t,n){return t=SU(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SU(e){var t=EU(e,"string");return typeof t=="symbol"?t:String(t)}function EU(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function RU(e,t){return t.style&&e.props.style&&(t.style=EP(EP({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),wU.default.cloneElement(e,t)}var Kf={};Kf.__esModule=!0;Kf.resizableProps=void 0;var mt=PU(ba);function PU(e){return e&&e.__esModule?e:{default:e}}var OU={axis:mt.default.oneOf(["both","x","y","none"]),className:mt.default.string,children:mt.default.element.isRequired,draggableOpts:mt.default.shape({allowAnyClick:mt.default.bool,cancel:mt.default.string,children:mt.default.node,disabled:mt.default.bool,enableUserSelectHack:mt.default.bool,offsetParent:mt.default.node,grid:mt.default.arrayOf(mt.default.number),handle:mt.default.string,nodeRef:mt.default.object,onStart:mt.default.func,onDrag:mt.default.func,onStop:mt.default.func,onMouseDown:mt.default.func,scale:mt.default.number}),height:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="y"){var i;return(i=mt.default.number).isRequired.apply(i,n)}return mt.default.number.apply(mt.default,n)},handle:mt.default.oneOfType([mt.default.node,mt.default.func]),handleSize:mt.default.arrayOf(mt.default.number),lockAspectRatio:mt.default.bool,maxConstraints:mt.default.arrayOf(mt.default.number),minConstraints:mt.default.arrayOf(mt.default.number),onResizeStop:mt.default.func,onResizeStart:mt.default.func,onResize:mt.default.func,resizeHandles:mt.default.arrayOf(mt.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:mt.default.number,width:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="x"){var i;return(i=mt.default.number).isRequired.apply(i,n)}return mt.default.number.apply(mt.default,n)}};Kf.resizableProps=OU;Yf.__esModule=!0;Yf.default=void 0;var Xu=kU(m),$U=SA,TU=Vw,DU=Kf,AU=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function EA(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(EA=function(o){return o?n:t})(e)}function kU(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=EA(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Ax(){return Ax=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ax.apply(this,arguments)}function MU(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function RP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function w0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RP(Object(n),!0).forEach(function(r){IU(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function IU(e,t,n){return t=NU(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NU(e){var t=LU(e,"string");return typeof t=="symbol"?t:String(t)}function LU(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function FU(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,kx(e,t)}function kx(e,t){return kx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},kx(e,t)}var Hw=function(e){FU(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=e.call.apply(e,[this].concat(i))||this,r.handleRefs={},r.lastHandleRect=null,r.slack=null,r}var n=t.prototype;return n.componentWillUnmount=function(){this.resetData()},n.resetData=function(){this.lastHandleRect=this.slack=null},n.runConstraints=function(o,i){var s=this.props,a=s.minConstraints,l=s.maxConstraints,c=s.lockAspectRatio;if(!a&&!l&&!c)return[o,i];if(c){var u=this.props.width/this.props.height,f=o-this.props.width,h=i-this.props.height;Math.abs(f)>Math.abs(h*u)?i=o/u:o=i*u}var p=o,v=i,b=this.slack||[0,0],w=b[0],y=b[1];return o+=w,i+=y,a&&(o=Math.max(a[0],o),i=Math.max(a[1],i)),l&&(o=Math.min(l[0],o),i=Math.min(l[1],i)),this.slack=[w+(p-o),y+(v-i)],[o,i]},n.resizeHandler=function(o,i){var s=this;return function(a,l){var c=l.node,u=l.deltaX,f=l.deltaY;o==="onResizeStart"&&s.resetData();var h=(s.props.axis==="both"||s.props.axis==="x")&&i!=="n"&&i!=="s",p=(s.props.axis==="both"||s.props.axis==="y")&&i!=="e"&&i!=="w";if(!(!h&&!p)){var v=i[0],b=i[i.length-1],w=c.getBoundingClientRect();if(s.lastHandleRect!=null){if(b==="w"){var y=w.left-s.lastHandleRect.left;u+=y}if(v==="n"){var _=w.top-s.lastHandleRect.top;f+=_}}s.lastHandleRect=w,b==="w"&&(u=-u),v==="n"&&(f=-f);var C=s.props.width+(h?u/s.props.transformScale:0),R=s.props.height+(p?f/s.props.transformScale:0),S=s.runConstraints(C,R);C=S[0],R=S[1];var $=C!==s.props.width||R!==s.props.height,O=typeof s.props[o]=="function"?s.props[o]:null,D=o==="onResize"&&!$;O&&!D&&(a.persist==null||a.persist(),O(a,{node:c,size:{width:C,height:R},handle:i})),o==="onResizeStop"&&s.resetData()}}},n.renderResizeHandle=function(o,i){var s=this.props.handle;if(!s)return Xu.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+o,ref:i});if(typeof s=="function")return s(o,i);var a=typeof s.type=="string",l=w0({ref:i},a?{}:{handleAxis:o});return Xu.cloneElement(s,l)},n.render=function(){var o=this,i=this.props,s=i.children,a=i.className,l=i.draggableOpts;i.width,i.height,i.handle,i.handleSize,i.lockAspectRatio,i.axis,i.minConstraints,i.maxConstraints,i.onResize,i.onResizeStop,i.onResizeStart;var c=i.resizeHandles;i.transformScale;var u=MU(i,AU);return(0,TU.cloneElement)(s,w0(w0({},u),{},{className:(a?a+" ":"")+"react-resizable",children:[].concat(s.props.children,c.map(function(f){var h,p=(h=o.handleRefs[f])!=null?h:o.handleRefs[f]=Xu.createRef();return Xu.createElement($U.DraggableCore,Ax({},l,{nodeRef:p,key:"resizableHandle-"+f,onStop:o.resizeHandler("onResizeStop",f),onStart:o.resizeHandler("onResizeStart",f),onDrag:o.resizeHandler("onResize",f)}),o.renderResizeHandle(f,p))}))}))},t}(Xu.Component);Yf.default=Hw;Hw.propTypes=DU.resizableProps;Hw.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var qm={};qm.__esModule=!0;qm.default=void 0;var _0=HU(m),jU=RA(ba),zU=RA(Yf),BU=Kf,VU=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function RA(e){return e&&e.__esModule?e:{default:e}}function PA(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(PA=function(o){return o?n:t})(e)}function HU(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=PA(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Mx(){return Mx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mx.apply(this,arguments)}function PP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Vg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?PP(Object(n),!0).forEach(function(r){WU(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function WU(e,t,n){return t=UU(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UU(e){var t=GU(e,"string");return typeof t=="symbol"?t:String(t)}function GU(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qU(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function YU(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Ix(e,t)}function Ix(e,t){return Ix=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Ix(e,t)}var OA=function(e){YU(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=e.call.apply(e,[this].concat(i))||this,r.state={width:r.props.width,height:r.props.height,propsWidth:r.props.width,propsHeight:r.props.height},r.onResize=function(a,l){var c=l.size;r.props.onResize?(a.persist==null||a.persist(),r.setState(c,function(){return r.props.onResize&&r.props.onResize(a,l)})):r.setState(c)},r}t.getDerivedStateFromProps=function(o,i){return i.propsWidth!==o.width||i.propsHeight!==o.height?{width:o.width,height:o.height,propsWidth:o.width,propsHeight:o.height}:null};var n=t.prototype;return n.render=function(){var o=this.props,i=o.handle,s=o.handleSize;o.onResize;var a=o.onResizeStart,l=o.onResizeStop,c=o.draggableOpts,u=o.minConstraints,f=o.maxConstraints,h=o.lockAspectRatio,p=o.axis;o.width,o.height;var v=o.resizeHandles,b=o.style,w=o.transformScale,y=qU(o,VU);return _0.createElement(zU.default,{axis:p,draggableOpts:c,handle:i,handleSize:s,height:this.state.height,lockAspectRatio:h,maxConstraints:f,minConstraints:u,onResizeStart:a,onResize:this.onResize,onResizeStop:l,resizeHandles:v,transformScale:w,width:this.state.width},_0.createElement("div",Mx({},y,{style:Vg(Vg({},b),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(_0.Component);qm.default=OA;OA.propTypes=Vg(Vg({},BU.resizableProps),{},{children:jU.default.element});Gm.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};Gm.exports.Resizable=Yf.default;Gm.exports.ResizableBox=qm.default;var KU=Gm.exports,cs={};Object.defineProperty(cs,"__esModule",{value:!0});cs.resizeHandleType=cs.resizeHandleAxesType=cs.default=void 0;var _t=$A(ba),XU=$A(m);function $A(e){return e&&e.__esModule?e:{default:e}}const TA=_t.default.arrayOf(_t.default.oneOf(["s","w","e","n","sw","nw","se","ne"]));cs.resizeHandleAxesType=TA;const DA=_t.default.oneOfType([_t.default.node,_t.default.func]);cs.resizeHandleType=DA;var QU={className:_t.default.string,style:_t.default.object,width:_t.default.number,autoSize:_t.default.bool,cols:_t.default.number,draggableCancel:_t.default.string,draggableHandle:_t.default.string,verticalCompact:function(e){e.verticalCompact===!1&&process.env.NODE_ENV!=="production"&&console.warn('`verticalCompact` on <ReactGridLayout> is deprecated and will be removed soon. Use `compactType`: "horizontal" | "vertical" | null.')},compactType:_t.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&Ot.validateLayout(t,"layout")},margin:_t.default.arrayOf(_t.default.number),containerPadding:_t.default.arrayOf(_t.default.number),rowHeight:_t.default.number,maxRows:_t.default.number,isBounded:_t.default.bool,isDraggable:_t.default.bool,isResizable:_t.default.bool,allowOverlap:_t.default.bool,preventCollision:_t.default.bool,useCSSTransforms:_t.default.bool,transformScale:_t.default.number,isDroppable:_t.default.bool,resizeHandles:TA,resizeHandle:DA,onLayoutChange:_t.default.func,onDragStart:_t.default.func,onDrag:_t.default.func,onDragStop:_t.default.func,onResizeStart:_t.default.func,onResize:_t.default.func,onResizeStop:_t.default.func,onDrop:_t.default.func,droppingItem:_t.default.shape({i:_t.default.string.isRequired,w:_t.default.number.isRequired,h:_t.default.number.isRequired}),children:function(e,t){const n=e[t],r={};XU.default.Children.forEach(n,function(o){if((o==null?void 0:o.key)!=null){if(r[o.key])throw new Error('Duplicate child key "'+o.key+'" found! This will cause problems in ReactGridLayout.');r[o.key]=!0}})},innerRef:_t.default.any};cs.default=QU;Object.defineProperty(Bm,"__esModule",{value:!0});Bm.default=void 0;var nc=Ww(m),Bt=Ww(ba),JU=SA,ZU=KU,rc=Ot,Kn=Di,OP=cs,eG=Ww(Ow);function Ww(e){return e&&e.__esModule?e:{default:e}}function di(e,t,n){return t=tG(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tG(e){var t=nG(e,"string");return typeof t=="symbol"?t:String(t)}function nG(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class Uw extends nc.default.Component{constructor(){super(...arguments),di(this,"state",{resizing:null,dragging:null,className:""}),di(this,"elementRef",nc.default.createRef()),di(this,"onDragStart",(t,n)=>{let{node:r}=n;const{onDragStart:o,transformScale:i}=this.props;if(!o)return;const s={top:0,left:0},{offsetParent:a}=r;if(!a)return;const l=a.getBoundingClientRect(),c=r.getBoundingClientRect(),u=c.left/i,f=l.left/i,h=c.top/i,p=l.top/i;s.left=u-f+a.scrollLeft,s.top=h-p+a.scrollTop,this.setState({dragging:s});const{x:v,y:b}=(0,Kn.calcXY)(this.getPositionParams(),s.top,s.left,this.props.w,this.props.h);return o.call(this,this.props.i,v,b,{e:t,node:r,newPosition:s})}),di(this,"onDrag",(t,n)=>{let{node:r,deltaX:o,deltaY:i}=n;const{onDrag:s}=this.props;if(!s)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let a=this.state.dragging.top+i,l=this.state.dragging.left+o;const{isBounded:c,i:u,w:f,h,containerWidth:p}=this.props,v=this.getPositionParams();if(c){const{offsetParent:_}=r;if(_){const{margin:C,rowHeight:R}=this.props,S=_.clientHeight-(0,Kn.calcGridItemWHPx)(h,R,C[1]);a=(0,Kn.clamp)(a,0,S);const $=(0,Kn.calcGridColWidth)(v),O=p-(0,Kn.calcGridItemWHPx)(f,$,C[0]);l=(0,Kn.clamp)(l,0,O)}}const b={top:a,left:l};this.setState({dragging:b});const{x:w,y}=(0,Kn.calcXY)(v,a,l,f,h);return s.call(this,u,w,y,{e:t,node:r,newPosition:b})}),di(this,"onDragStop",(t,n)=>{let{node:r}=n;const{onDragStop:o}=this.props;if(!o)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:i,h:s,i:a}=this.props,{left:l,top:c}=this.state.dragging,u={top:c,left:l};this.setState({dragging:null});const{x:f,y:h}=(0,Kn.calcXY)(this.getPositionParams(),c,l,i,s);return o.call(this,a,f,h,{e:t,node:r,newPosition:u})}),di(this,"onResizeStop",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStop")),di(this,"onResizeStart",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStart")),di(this,"onResize",(t,n,r)=>this.onResizeHandler(t,n,r,"onResize"))}shouldComponentUpdate(t,n){if(this.props.children!==t.children||this.props.droppingPosition!==t.droppingPosition)return!0;const r=(0,Kn.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),o=(0,Kn.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,n);return!(0,rc.fastPositionEqual)(r,o)||this.props.useCSSTransforms!==t.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(t){this.moveDroppingItem(t)}moveDroppingItem(t){const{droppingPosition:n}=this.props;if(!n)return;const r=this.elementRef.current;if(!r)return;const o=t.droppingPosition||{left:0,top:0},{dragging:i}=this.state,s=i&&n.left!==o.left||n.top!==o.top;if(!i)this.onDragStart(n.e,{node:r,deltaX:n.left,deltaY:n.top});else if(s){const a=n.left-i.left,l=n.top-i.top;this.onDrag(n.e,{node:r,deltaX:a,deltaY:l})}}getPositionParams(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:t.cols,containerPadding:t.containerPadding,containerWidth:t.containerWidth,margin:t.margin,maxRows:t.maxRows,rowHeight:t.rowHeight}}createStyle(t){const{usePercentages:n,containerWidth:r,useCSSTransforms:o}=this.props;let i;return o?i=(0,rc.setTransform)(t):(i=(0,rc.setTopLeft)(t),n&&(i.left=(0,rc.perc)(t.left/r),i.width=(0,rc.perc)(t.width/r))),i}mixinDraggable(t,n){return nc.default.createElement(JU.DraggableCore,{disabled:!n,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},t)}curryResizeHandler(t,n){return(r,o)=>n(r,o,t)}mixinResizable(t,n,r){const{cols:o,minW:i,minH:s,maxW:a,maxH:l,transformScale:c,resizeHandles:u,resizeHandle:f}=this.props,h=this.getPositionParams(),p=(0,Kn.calcGridItemPosition)(h,0,0,o,0).width,v=(0,Kn.calcGridItemPosition)(h,0,0,i,s),b=(0,Kn.calcGridItemPosition)(h,0,0,a,l),w=[v.width,v.height],y=[Math.min(b.width,p),Math.min(b.height,1/0)];return nc.default.createElement(ZU.Resizable,{draggableOpts:{disabled:!r},className:r?void 0:"react-resizable-hide",width:n.width,height:n.height,minConstraints:w,maxConstraints:y,onResizeStop:this.curryResizeHandler(n,this.onResizeStop),onResizeStart:this.curryResizeHandler(n,this.onResizeStart),onResize:this.curryResizeHandler(n,this.onResize),transformScale:c,resizeHandles:u,handle:f},t)}onResizeHandler(t,n,r,o){let{node:i,size:s,handle:a}=n;const l=this.props[o];if(!l)return;const{x:c,y:u,i:f,maxH:h,minH:p,containerWidth:v}=this.props,{minW:b,maxW:w}=this.props;let y=s;i&&(y=(0,rc.resizeItemInDirection)(a,r,s,v),this.setState({resizing:o==="onResizeStop"?null:y}));let{w:_,h:C}=(0,Kn.calcWH)(this.getPositionParams(),y.width,y.height,c,u,a);_=(0,Kn.clamp)(_,Math.max(b,1),w),C=(0,Kn.clamp)(C,p,h),l.call(this,f,_,C,{e:t,node:i,size:y,handle:a})}render(){const{x:t,y:n,w:r,h:o,isDraggable:i,isResizable:s,droppingPosition:a,useCSSTransforms:l}=this.props,c=(0,Kn.calcGridItemPosition)(this.getPositionParams(),t,n,r,o,this.state),u=nc.default.Children.only(this.props.children);let f=nc.default.cloneElement(u,{ref:this.elementRef,className:(0,eG.default)("react-grid-item",u.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":i,"react-draggable-dragging":!!this.state.dragging,dropping:!!a,cssTransforms:l}),style:{...this.props.style,...u.props.style,...this.createStyle(c)}});return f=this.mixinResizable(f,c,s),f=this.mixinDraggable(f,i),f}}Bm.default=Uw;di(Uw,"propTypes",{children:Bt.default.element,cols:Bt.default.number.isRequired,containerWidth:Bt.default.number.isRequired,rowHeight:Bt.default.number.isRequired,margin:Bt.default.array.isRequired,maxRows:Bt.default.number.isRequired,containerPadding:Bt.default.array.isRequired,x:Bt.default.number.isRequired,y:Bt.default.number.isRequired,w:Bt.default.number.isRequired,h:Bt.default.number.isRequired,minW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minWidth not Number");if(n>e.w||n>e.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxWidth not Number");if(n<e.w||n<e.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minHeight not Number");if(n>e.h||n>e.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxHeight not Number");if(n<e.h||n<e.minH)return new Error("maxHeight smaller than item height/minHeight")},i:Bt.default.string.isRequired,resizeHandles:OP.resizeHandleAxesType,resizeHandle:OP.resizeHandleType,onDragStop:Bt.default.func,onDragStart:Bt.default.func,onDrag:Bt.default.func,onResizeStop:Bt.default.func,onResizeStart:Bt.default.func,onResize:Bt.default.func,isDraggable:Bt.default.bool.isRequired,isResizable:Bt.default.bool.isRequired,isBounded:Bt.default.bool.isRequired,static:Bt.default.bool,useCSSTransforms:Bt.default.bool.isRequired,transformScale:Bt.default.number,className:Bt.default.string,handle:Bt.default.string,cancel:Bt.default.string,droppingPosition:Bt.default.shape({e:Bt.default.object.isRequired,left:Bt.default.number.isRequired,top:Bt.default.number.isRequired})});di(Uw,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1});Object.defineProperty(qf,"__esModule",{value:!0});qf.default=void 0;var Aa=sG(m),C0=Pw,rG=Gw(Ow),it=Ot,oG=Di,$P=Gw(Bm),iG=Gw(cs);function Gw(e){return e&&e.__esModule?e:{default:e}}function AA(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(AA=function(r){return r?n:t})(e)}function sG(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=AA(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function ar(e,t,n){return t=aG(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aG(e){var t=lG(e,"string");return typeof t=="symbol"?t:String(t)}function lG(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const TP="react-grid-layout";let kA=!1;try{kA=/firefox/i.test(navigator.userAgent)}catch{}class Ym extends Aa.Component{constructor(){super(...arguments),ar(this,"state",{activeDrag:null,layout:(0,it.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,it.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),ar(this,"dragEnterCounter",0),ar(this,"onDragStart",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a}=this.state,l=(0,it.getLayoutItem)(a,t);if(l)return this.setState({oldDragItem:(0,it.cloneLayoutItem)(l),oldLayout:a}),this.props.onDragStart(a,l,l,null,i,s)}),ar(this,"onDrag",(t,n,r,o)=>{let{e:i,node:s}=o;const{oldDragItem:a}=this.state;let{layout:l}=this.state;const{cols:c,allowOverlap:u,preventCollision:f}=this.props,h=(0,it.getLayoutItem)(l,t);if(!h)return;const p={w:h.w,h:h.h,x:h.x,y:h.y,placeholder:!0,i:t},v=!0;l=(0,it.moveElement)(l,h,n,r,v,f,(0,it.compactType)(this.props),c,u),this.props.onDrag(l,a,h,p,i,s),this.setState({layout:u?l:(0,it.compact)(l,(0,it.compactType)(this.props),c),activeDrag:p})}),ar(this,"onDragStop",(t,n,r,o)=>{let{e:i,node:s}=o;if(!this.state.activeDrag)return;const{oldDragItem:a}=this.state;let{layout:l}=this.state;const{cols:c,preventCollision:u,allowOverlap:f}=this.props,h=(0,it.getLayoutItem)(l,t);if(!h)return;const p=!0;l=(0,it.moveElement)(l,h,n,r,p,u,(0,it.compactType)(this.props),c,f);const v=f?l:(0,it.compact)(l,(0,it.compactType)(this.props),c);this.props.onDragStop(v,a,h,null,i,s);const{oldLayout:b}=this.state;this.setState({activeDrag:null,layout:v,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(v,b)}),ar(this,"onResizeStart",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a}=this.state,l=(0,it.getLayoutItem)(a,t);l&&(this.setState({oldResizeItem:(0,it.cloneLayoutItem)(l),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(a,l,l,null,i,s))}),ar(this,"onResize",(t,n,r,o)=>{let{e:i,node:s,size:a,handle:l}=o;const{oldResizeItem:c}=this.state;let{layout:u}=this.state;const{cols:f,preventCollision:h,allowOverlap:p}=this.props;let v=!1,b,w,y;const[_,C]=(0,it.withLayoutItem)(u,t,S=>{let $;return w=S.x,y=S.y,["sw","w","nw","n","ne"].indexOf(l)!==-1&&(["sw","nw","w"].indexOf(l)!==-1&&(w=S.x+(S.w-n),n=S.x!==w&&w<0?S.w:n,w=w<0?0:w),["ne","n","nw"].indexOf(l)!==-1&&(y=S.y+(S.h-r),r=S.y!==y&&y<0?S.h:r,y=y<0?0:y),v=!0),h&&!p&&($=(0,it.getAllCollisions)(u,{...S,w:n,h:r,x:w,y}).filter(D=>D.i!==S.i).length>0,$&&(y=S.y,r=S.h,w=S.x,n=S.w,v=!1)),S.w=n,S.h=r,S});if(!C)return;b=_,v&&(b=(0,it.moveElement)(_,C,w,y,!0,this.props.preventCollision,(0,it.compactType)(this.props),f,p));const R={w:C.w,h:C.h,x:C.x,y:C.y,static:!0,i:t};this.props.onResize(b,c,C,R,i,s),this.setState({layout:p?b:(0,it.compact)(b,(0,it.compactType)(this.props),f),activeDrag:R})}),ar(this,"onResizeStop",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a,oldResizeItem:l}=this.state,{cols:c,allowOverlap:u}=this.props,f=(0,it.getLayoutItem)(a,t),h=u?a:(0,it.compact)(a,(0,it.compactType)(this.props),c);this.props.onResizeStop(h,l,f,null,i,s);const{oldLayout:p}=this.state;this.setState({activeDrag:null,layout:h,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(h,p)}),ar(this,"onDragOver",t=>{var n;if(t.preventDefault(),t.stopPropagation(),kA&&!((n=t.nativeEvent.target)!==null&&n!==void 0&&n.classList.contains(TP)))return!1;const{droppingItem:r,onDropDragOver:o,margin:i,cols:s,rowHeight:a,maxRows:l,width:c,containerPadding:u,transformScale:f}=this.props,h=o==null?void 0:o(t);if(h===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const p={...r,...h},{layout:v}=this.state,{layerX:b,layerY:w}=t.nativeEvent,y={left:b/f,top:w/f,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:_,top:C}=this.state.droppingPosition;(_!=b||C!=w)&&this.setState({droppingPosition:y})}}else{const _={cols:s,margin:i,maxRows:l,rowHeight:a,containerWidth:c,containerPadding:u||i},C=(0,oG.calcXY)(_,w,b,p.w,p.h);this.setState({droppingDOMNode:Aa.createElement("div",{key:p.i}),droppingPosition:y,layout:[...v,{...p,x:C.x,y:C.y,static:!1,isDraggable:!0}]})}}),ar(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:n}=this.props,{layout:r}=this.state,o=(0,it.compact)(r.filter(i=>i.i!==t.i),(0,it.compactType)(this.props),n,this.props.allowOverlap);this.setState({layout:o,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),ar(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),ar(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),ar(this,"onDrop",t=>{t.preventDefault(),t.stopPropagation();const{droppingItem:n}=this.props,{layout:r}=this.state,o=r.find(i=>i.i===n.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(r,o,t)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(t,n){let r;return n.activeDrag?null:(!(0,C0.deepEqual)(t.layout,n.propsLayout)||t.compactType!==n.compactType?r=t.layout:(0,it.childrenEqual)(t.children,n.children)||(r=n.layout),r?{layout:(0,it.synchronizeLayoutWithChildren)(r,t.children,t.cols,(0,it.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,n){return this.props.children!==t.children||!(0,it.fastRGLPropsEqual)(this.props,t,C0.deepEqual)||this.state.activeDrag!==n.activeDrag||this.state.mounted!==n.mounted||this.state.droppingPosition!==n.droppingPosition}componentDidUpdate(t,n){if(!this.state.activeDrag){const r=this.state.layout,o=n.layout;this.onLayoutMaybeChanged(r,o)}}containerHeight(){if(!this.props.autoSize)return;const t=(0,it.bottom)(this.state.layout),n=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return t*this.props.rowHeight+(t-1)*this.props.margin[1]+n*2+"px"}onLayoutMaybeChanged(t,n){n||(n=this.state.layout),(0,C0.deepEqual)(n,t)||this.props.onLayoutChange(t)}placeholder(){const{activeDrag:t}=this.state;if(!t)return null;const{width:n,cols:r,margin:o,containerPadding:i,rowHeight:s,maxRows:a,useCSSTransforms:l,transformScale:c}=this.props;return Aa.createElement($P.default,{w:t.w,h:t.h,x:t.x,y:t.y,i:t.i,className:"react-grid-placeholder ".concat(this.state.resizing?"placeholder-resizing":""),containerWidth:n,cols:r,margin:o,containerPadding:i||o,maxRows:a,rowHeight:s,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:l,transformScale:c},Aa.createElement("div",null))}processGridItem(t,n){if(!t||!t.key)return;const r=(0,it.getLayoutItem)(this.state.layout,String(t.key));if(!r)return null;const{width:o,cols:i,margin:s,containerPadding:a,rowHeight:l,maxRows:c,isDraggable:u,isResizable:f,isBounded:h,useCSSTransforms:p,transformScale:v,draggableCancel:b,draggableHandle:w,resizeHandles:y,resizeHandle:_}=this.props,{mounted:C,droppingPosition:R}=this.state,S=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&u,$=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&f,O=r.resizeHandles||y,D=S&&h&&r.isBounded!==!1;return Aa.createElement($P.default,{containerWidth:o,cols:i,margin:s,containerPadding:a||s,maxRows:c,rowHeight:l,cancel:b,handle:w,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:S,isResizable:$,isBounded:D,useCSSTransforms:p&&C,usePercentages:!C,transformScale:v,w:r.w,h:r.h,x:r.x,y:r.y,i:r.i,minH:r.minH,minW:r.minW,maxH:r.maxH,maxW:r.maxW,static:r.static,droppingPosition:n?R:void 0,resizeHandles:O,resizeHandle:_},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:o}=this.props,i=(0,rG.default)(TP,t),s={height:this.containerHeight(),...n};return Aa.createElement("div",{ref:o,className:i,style:s,onDrop:r?this.onDrop:it.noop,onDragLeave:r?this.onDragLeave:it.noop,onDragEnter:r?this.onDragEnter:it.noop,onDragOver:r?this.onDragOver:it.noop},Aa.Children.map(this.props.children,a=>this.processGridItem(a)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}qf.default=Ym;ar(Ym,"displayName","ReactGridLayout");ar(Ym,"propTypes",iG.default);ar(Ym,"defaultProps",{autoSize:!0,cols:12,className:"",style:{},draggableHandle:"",draggableCancel:"",containerPadding:null,rowHeight:150,maxRows:1/0,layout:[],margin:[10,10],isBounded:!1,isDraggable:!0,isResizable:!0,allowOverlap:!1,isDroppable:!1,useCSSTransforms:!0,transformScale:1,verticalCompact:!0,compactType:"vertical",preventCollision:!1,droppingItem:{i:"__dropping-elem__",h:1,w:1},resizeHandles:["se"],onLayoutChange:it.noop,onDragStart:it.noop,onDrag:it.noop,onDragStop:it.noop,onResizeStart:it.noop,onResize:it.noop,onResizeStop:it.noop,onDrop:it.noop,onDropDragOver:it.noop});var Km={},Dl={};Object.defineProperty(Dl,"__esModule",{value:!0});Dl.findOrGenerateResponsiveLayout=dG;Dl.getBreakpointFromWidth=cG;Dl.getColsFromBreakpoint=uG;Dl.sortBreakpoints=qw;var bp=Ot;function cG(e,t){const n=qw(e);let r=n[0];for(let o=1,i=n.length;o<i;o++){const s=n[o];t>e[s]&&(r=s)}return r}function uG(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function dG(e,t,n,r,o,i){if(e[n])return(0,bp.cloneLayout)(e[n]);let s=e[r];const a=qw(t),l=a.slice(a.indexOf(n));for(let c=0,u=l.length;c<u;c++){const f=l[c];if(e[f]){s=e[f];break}}return s=(0,bp.cloneLayout)(s||[]),(0,bp.compact)((0,bp.correctBounds)(s,{cols:o}),i,o)}function qw(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(Km,"__esModule",{value:!0});Km.default=void 0;var DP=hG(m),Dr=MA(ba),S0=Pw,Oc=Ot,ka=Dl,fG=MA(qf);function MA(e){return e&&e.__esModule?e:{default:e}}function IA(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(IA=function(r){return r?n:t})(e)}function hG(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=IA(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Nx(){return Nx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Nx.apply(this,arguments)}function Hg(e,t,n){return t=pG(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pG(e){var t=gG(e,"string");return typeof t=="symbol"?t:String(t)}function gG(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const AP=e=>Object.prototype.toString.call(e);function yp(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class Yw extends DP.Component{constructor(){super(...arguments),Hg(this,"state",this.generateInitialState()),Hg(this,"onLayoutChange",t=>{this.props.onLayoutChange(t,{...this.props.layouts,[this.state.breakpoint]:t})})}generateInitialState(){const{width:t,breakpoints:n,layouts:r,cols:o}=this.props,i=(0,ka.getBreakpointFromWidth)(n,t),s=(0,ka.getColsFromBreakpoint)(i,o),a=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,ka.findOrGenerateResponsiveLayout)(r,n,i,i,s,a),breakpoint:i,cols:s}}static getDerivedStateFromProps(t,n){if(!(0,S0.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:o}=n;return{layout:(0,ka.findOrGenerateResponsiveLayout)(t.layouts,t.breakpoints,r,r,o,t.compactType),layouts:t.layouts}}return null}componentDidUpdate(t){(this.props.width!=t.width||this.props.breakpoint!==t.breakpoint||!(0,S0.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,S0.deepEqual)(this.props.cols,t.cols))&&this.onWidthChange(t)}onWidthChange(t){const{breakpoints:n,cols:r,layouts:o,compactType:i}=this.props,s=this.props.breakpoint||(0,ka.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),a=this.state.breakpoint,l=(0,ka.getColsFromBreakpoint)(s,r),c={...o};if(a!==s||t.breakpoints!==n||t.cols!==r){a in c||(c[a]=(0,Oc.cloneLayout)(this.state.layout));let h=(0,ka.findOrGenerateResponsiveLayout)(c,n,s,a,l,i);h=(0,Oc.synchronizeLayoutWithChildren)(h,this.props.children,l,i,this.props.allowOverlap),c[s]=h,this.props.onLayoutChange(h,c),this.props.onBreakpointChange(s,l),this.setState({breakpoint:s,layout:h,cols:l})}const u=yp(this.props.margin,s),f=yp(this.props.containerPadding,s);this.props.onWidthChange(this.props.width,u,l,f)}render(){const{breakpoint:t,breakpoints:n,cols:r,layouts:o,margin:i,containerPadding:s,onBreakpointChange:a,onLayoutChange:l,onWidthChange:c,...u}=this.props;return DP.createElement(fG.default,Nx({},u,{margin:yp(i,this.state.breakpoint),containerPadding:yp(s,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}Km.default=Yw;Hg(Yw,"propTypes",{breakpoint:Dr.default.string,breakpoints:Dr.default.object,allowOverlap:Dr.default.bool,cols:Dr.default.object,margin:Dr.default.oneOfType([Dr.default.array,Dr.default.object]),containerPadding:Dr.default.oneOfType([Dr.default.array,Dr.default.object]),layouts(e,t){if(AP(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+AP(e[t]));Object.keys(e[t]).forEach(n=>{if(!(n in e.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,Oc.validateLayout)(e.layouts[n],"layouts."+n)})},width:Dr.default.number.isRequired,onBreakpointChange:Dr.default.func,onLayoutChange:Dr.default.func,onWidthChange:Dr.default.func});Hg(Yw,"defaultProps",{breakpoints:{lg:1200,md:996,sm:768,xs:480,xxs:0},cols:{lg:12,md:10,sm:6,xs:4,xxs:2},containerPadding:{lg:null,md:null,sm:null,xs:null,xxs:null},layouts:{},margin:[10,10],allowOverlap:!1,onBreakpointChange:Oc.noop,onLayoutChange:Oc.noop,onWidthChange:Oc.noop});var Kw={},NA=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(o,i){return o[0]===n?(r=i,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),o=this.__entries__[r];return o&&o[1]},t.prototype.set=function(n,r){var o=e(this.__entries__,n);~o?this.__entries__[o][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,o=e(r,n);~o&&r.splice(o,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var o=0,i=this.__entries__;o<i.length;o++){var s=i[o];n.call(r,s[1],s[0])}},t}()}(),Lx=typeof window<"u"&&typeof document<"u"&&window.document===document,Wg=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),mG=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Wg):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),vG=2;function bG(e,t){var n=!1,r=!1,o=0;function i(){n&&(n=!1,e()),r&&a()}function s(){mG(i)}function a(){var l=Date.now();if(n){if(l-o<vG)return;r=!0}else n=!0,r=!1,setTimeout(s,t);o=l}return a}var yG=20,xG=["top","right","bottom","left","width","height","size","weight"],wG=typeof MutationObserver<"u",_G=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=bG(this.refresh.bind(this),yG)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,r=n.indexOf(t);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!Lx||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),wG?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!Lx||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,o=xG.some(function(i){return!!~r.indexOf(i)});o&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),LA=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e},ru=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||Wg},FA=Xm(0,0,0,0);function Ug(e){return parseFloat(e)||0}function kP(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,o){var i=e["border-"+o+"-width"];return r+Ug(i)},0)}function CG(e){for(var t=["top","right","bottom","left"],n={},r=0,o=t;r<o.length;r++){var i=o[r],s=e["padding-"+i];n[i]=Ug(s)}return n}function SG(e){var t=e.getBBox();return Xm(0,0,t.width,t.height)}function EG(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return FA;var r=ru(e).getComputedStyle(e),o=CG(r),i=o.left+o.right,s=o.top+o.bottom,a=Ug(r.width),l=Ug(r.height);if(r.boxSizing==="border-box"&&(Math.round(a+i)!==t&&(a-=kP(r,"left","right")+i),Math.round(l+s)!==n&&(l-=kP(r,"top","bottom")+s)),!PG(e)){var c=Math.round(a+i)-t,u=Math.round(l+s)-n;Math.abs(c)!==1&&(a-=c),Math.abs(u)!==1&&(l-=u)}return Xm(o.left,o.top,a,l)}var RG=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof ru(e).SVGGraphicsElement}:function(e){return e instanceof ru(e).SVGElement&&typeof e.getBBox=="function"}}();function PG(e){return e===ru(e).document.documentElement}function OG(e){return Lx?RG(e)?SG(e):EG(e):FA}function $G(e){var t=e.x,n=e.y,r=e.width,o=e.height,i=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,s=Object.create(i.prototype);return LA(s,{x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:o+n,left:t}),s}function Xm(e,t,n,r){return{x:e,y:t,width:n,height:r}}var TG=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Xm(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=OG(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),DG=function(){function e(t,n){var r=$G(n);LA(this,{target:t,contentRect:r})}return e}(),AG=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new NA,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=r}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof ru(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new TG(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof ru(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new DG(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),jA=typeof WeakMap<"u"?new WeakMap:new NA,zA=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=_G.getInstance(),r=new AG(t,n,this);jA.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){zA.prototype[e]=function(){var t;return(t=jA.get(this))[e].apply(t,arguments)}});var kG=function(){return typeof Wg.ResizeObserver<"u"?Wg.ResizeObserver:zA}();const MG=Object.freeze(Object.defineProperty({__proto__:null,default:kG},Symbol.toStringTag,{value:"Module"})),IG=aw(MG);Object.defineProperty(Kw,"__esModule",{value:!0});Kw.default=HG;var xp=jG(m),NG=Xw(ba),LG=Xw(IG),FG=Xw(Ow);function Xw(e){return e&&e.__esModule?e:{default:e}}function BA(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(BA=function(r){return r?n:t})(e)}function jG(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=BA(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Fx(){return Fx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fx.apply(this,arguments)}function oc(e,t,n){return t=zG(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zG(e){var t=BG(e,"string");return typeof t=="symbol"?t:String(t)}function BG(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const VG="react-grid-layout";function HG(e){var t;return t=class extends xp.Component{constructor(){super(...arguments),oc(this,"state",{width:1280}),oc(this,"elementRef",xp.createRef()),oc(this,"mounted",!1),oc(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new LG.default(o=>{if(this.elementRef.current instanceof HTMLElement){const s=o[0].contentRect.width;this.setState({width:s})}});const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.observe(r)}componentWillUnmount(){this.mounted=!1;const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.unobserve(r),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:r,...o}=this.props;return r&&!this.mounted?xp.createElement("div",{className:(0,FG.default)(this.props.className,VG),style:this.props.style,ref:this.elementRef}):xp.createElement(e,Fx({innerRef:this.elementRef},o,this.state))}},oc(t,"defaultProps",{measureBeforeMount:!1}),oc(t,"propTypes",{measureBeforeMount:NG.default.bool}),t}(function(e){e.exports=qf.default,e.exports.utils=Ot,e.exports.calculateUtils=Di,e.exports.Responsive=Km.default,e.exports.Responsive.utils=Dl,e.exports.WidthProvider=Kw.default})(ZD);var MP=ZD.exports;function Ci({children:e,className:t,text:n,onSave:r,type:o="input"}){const[i,s]=m.useState(!1),[a,l]=m.useState(n),c=Ce(h=>h.isDashboardEditing),u=h=>{h.stopPropagation(),c&&s(!0)};function f(){return o==="textarea"?E.jsx("textarea",{className:xe("grow rounded-sm bg-background px-2 py-1 text-sm outline-dashed outline-[0.5px] outline-primary/50",t),onChange:h=>l(h.target.value),value:a,autoFocus:!0,onBlur:()=>s(!1),onKeyDown:h=>{h.stopPropagation(),!(h.key==="Enter"&&h.shiftKey)&&(h.key==="Enter"||h.key==="Tab")&&(s(!1),r(a))}}):E.jsx("input",{onMouseDown:h=>h.stopPropagation(),type:"text",className:xe("rounded-sm bg-background px-2 py-1 text-sm outline-dashed outline-[0.5px] outline-primary/50",t),onChange:h=>l(h.target.value),value:a,autoFocus:!0,onBlur:()=>s(!1),onKeyDown:h=>{h.stopPropagation(),(h.key==="Enter"||h.key==="Tab")&&(s(!1),r(a))}})}return E.jsx("div",{className:"flex",role:"editable",onDoubleClick:u,children:i?f():e})}/*!
110
110
  * @kurkle/color v0.3.2
111
111
  * https://github.com/kurkle/color#readme
112
112
  * (c) 2023 Jukka Kurkela
@@ -403,7 +403,7 @@ Check the top-level render call using <`+fe+">.")}return oe}}function oi(A,oe){{
403
403
  */var Kae=typeof document<"u"?N.useLayoutEffect:N.useEffect;function Xae(e){var t=N.useReducer(function(){return{}},{})[1],n=um({},e,{onChange:function(s,a){a?fr.flushSync(t):t(),e.onChange==null||e.onChange(s,a)}}),r=N.useState(function(){return new qae(n)}),o=r[0];return o.setOptions(n),N.useEffect(function(){return o._didMount()},[]),Kae(function(){return o._willUpdate()}),o}function Qae(e){return Xae(um({observeElementRect:Hae,observeElementOffset:Wae,scrollToFn:Gae},e))}var Jae=Object.defineProperty,Zae=(e,t,n)=>t in e?Jae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fy=(e,t,n)=>(Zae(e,typeof t!="symbol"?t+"":t,n),n);let ele=class{constructor(){fy(this,"current",this.detect()),fy(this,"handoffState","pending"),fy(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},hl=new ele,Bn=(e,t)=>{hl.isServer?m.useEffect(e,t):m.useLayoutEffect(e,t)};function Ri(e){let t=m.useRef(e);return Bn(()=>{t.current=e},[e]),t}function bC(e,t){let[n,r]=m.useState(e),o=Ri(e);return Bn(()=>r(o.current),[o,r,...t]),n}let Rt=function(e){let t=Ri(e);return m.useCallback((...n)=>t.current(...n),[t])};function tle(e,t,n){let[r,o]=m.useState(n),i=e!==void 0,s=m.useRef(i),a=m.useRef(!1),l=m.useRef(!1);return i&&!s.current&&!a.current?(a.current=!0,s.current=i,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!i&&s.current&&!l.current&&(l.current=!0,s.current=i,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[i?e:r,Rt(c=>(i||o(c),t==null?void 0:t(c)))]}function nle(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function Cl(){let e=[],t={addEventListener(n,r,o,i){return n.addEventListener(r,o,i),t.add(()=>n.removeEventListener(r,o,i))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return nle(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,o){let i=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:o}),this.add(()=>{Object.assign(n.style,{[r]:i})})},group(n){let r=Cl();return n(r),this.add(()=>r.dispose())},add(n){return e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let o of e.splice(r,1))o()}},dispose(){for(let n of e.splice(0))n()}};return t}function gh(){let[e]=m.useState(Cl);return m.useEffect(()=>()=>e.dispose(),[e]),e}function rle(){let e=typeof document>"u";return"useSyncExternalStore"in N?(t=>t.useSyncExternalStore)(N)(()=>()=>{},()=>!1,()=>!e):!1}function yC(){let e=rle(),[t,n]=N.useState(hl.isHandoffComplete);return t&&hl.isHandoffComplete===!1&&n(!1),N.useEffect(()=>{t!==!0&&n(!0)},[t]),N.useEffect(()=>hl.handoff(),[]),e?!1:t}var i2;let mh=(i2=m.useId)!=null?i2:function(){let e=yC(),[t,n]=m.useState(e?()=>hl.nextId():null);return Bn(()=>{t===null&&n(hl.nextId())},[t]),t!=null?""+t:void 0};function Zn(e,t,...n){if(e in t){let o=t[e];return typeof o=="function"?o(...n):o}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Zn),r}function xC(e){return hl.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let s2=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var ole=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(ole||{}),ile=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(ile||{}),sle=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(sle||{}),$N=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))($N||{});function ale(e,t=0){var n;return e===((n=xC(e))==null?void 0:n.body)?!1:Zn(t,{0(){return e.matches(s2)},1(){let r=e;for(;r!==null;){if(r.matches(s2))return!0;r=r.parentElement}return!1}})}var lle=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(lle||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function cle(e,t=n=>n){return e.slice().sort((n,r)=>{let o=t(n),i=t(r);if(o===null||i===null)return 0;let s=o.compareDocumentPosition(i);return s&Node.DOCUMENT_POSITION_FOLLOWING?-1:s&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function ule(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function dle(){return/Android/gi.test(window.navigator.userAgent)}function TN(){return ule()||dle()}function Jp(e,t,n){let r=Ri(t);m.useEffect(()=>{function o(i){r.current(i)}return document.addEventListener(e,o,n),()=>document.removeEventListener(e,o,n)},[e,n])}function fle(e,t,n){let r=Ri(t);m.useEffect(()=>{function o(i){r.current(i)}return window.addEventListener(e,o,n),()=>window.removeEventListener(e,o,n)},[e,n])}function hle(e,t,n=!0){let r=m.useRef(!1);m.useEffect(()=>{requestAnimationFrame(()=>{r.current=n})},[n]);function o(s,a){if(!r.current||s.defaultPrevented)return;let l=a(s);if(l===null||!l.getRootNode().contains(l)||!l.isConnected)return;let c=function u(f){return typeof f=="function"?u(f()):Array.isArray(f)||f instanceof Set?f:[f]}(e);for(let u of c){if(u===null)continue;let f=u instanceof HTMLElement?u:u.current;if(f!=null&&f.contains(l)||s.composed&&s.composedPath().includes(f))return}return!ale(l,$N.Loose)&&l.tabIndex!==-1&&s.preventDefault(),t(s,l)}let i=m.useRef(null);Jp("pointerdown",s=>{var a,l;r.current&&(i.current=((l=(a=s.composedPath)==null?void 0:a.call(s))==null?void 0:l[0])||s.target)},!0),Jp("mousedown",s=>{var a,l;r.current&&(i.current=((l=(a=s.composedPath)==null?void 0:a.call(s))==null?void 0:l[0])||s.target)},!0),Jp("click",s=>{TN()||i.current&&(o(s,()=>i.current),i.current=null)},!0),Jp("touchend",s=>o(s,()=>s.target instanceof HTMLElement?s.target:null),!0),fle("blur",s=>o(s,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function ple(...e){return m.useMemo(()=>xC(...e),[...e])}function a2(e){var t;if(e.type)return e.type;let n=(t=e.as)!=null?t:"button";if(typeof n=="string"&&n.toLowerCase()==="button")return"button"}function gle(e,t){let[n,r]=m.useState(()=>a2(e));return Bn(()=>{r(a2(e))},[e.type,e.as]),Bn(()=>{n||t.current&&t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&r("button")},[n,t]),n}let mle=Symbol();function Il(...e){let t=m.useRef(e);m.useEffect(()=>{t.current=e},[e]);let n=Rt(r=>{for(let o of t.current)o!=null&&(typeof o=="function"?o(r):o.current=r)});return e.every(r=>r==null||(r==null?void 0:r[mle]))?void 0:n}function l2(e){return[e.screenX,e.screenY]}function vle(){let e=m.useRef([-1,-1]);return{wasMoved(t){let n=l2(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=l2(t)}}}function ble({container:e,accept:t,walk:n,enabled:r=!0}){let o=m.useRef(t),i=m.useRef(n);m.useEffect(()=>{o.current=t,i.current=n},[t,n]),Bn(()=>{if(!e||!r)return;let s=xC(e);if(!s)return;let a=o.current,l=i.current,c=Object.assign(f=>a(f),{acceptNode:a}),u=s.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,c,!1);for(;u.nextNode();)l(u.currentNode)},[e,r,o,i])}function c2(e,t){let n=m.useRef([]),r=Rt(e);m.useEffect(()=>{let o=[...n.current];for(let[i,s]of t.entries())if(n.current[i]!==s){let a=r(t,o);return n.current=t,a}},[r,...t])}function fm(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}var hm=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(hm||{}),ia=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(ia||{});function bs({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:s,mergeRefs:a}){a=a??yle;let l=DN(t,e);if(i)return Zp(l,n,r,s,a);let c=o??0;if(c&2){let{static:u=!1,...f}=l;if(u)return Zp(f,n,r,s,a)}if(c&1){let{unmount:u=!0,...f}=l;return Zn(u?0:1,{0(){return null},1(){return Zp({...f,hidden:!0,style:{display:"none"}},n,r,s,a)}})}return Zp(l,n,r,s,a)}function Zp(e,t={},n,r,o){let{as:i=n,children:s,refName:a="ref",...l}=hy(e,["unmount","static"]),c=e.ref!==void 0?{[a]:e.ref}:{},u=typeof s=="function"?s(t):s;"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(t));let f={};if(t){let h=!1,p=[];for(let[v,b]of Object.entries(t))typeof b=="boolean"&&(h=!0),b===!0&&p.push(v);h&&(f["data-headlessui-state"]=p.join(" "))}if(i===m.Fragment&&Object.keys(O1(l)).length>0){if(!m.isValidElement(u)||Array.isArray(u)&&u.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(l).map(b=>` - ${b}`).join(`
404
404
  `),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(b=>` - ${b}`).join(`
405
405
  `)].join(`
406
- `));let h=u.props,p=typeof(h==null?void 0:h.className)=="function"?(...b)=>fm(h==null?void 0:h.className(...b),l.className):fm(h==null?void 0:h.className,l.className),v=p?{className:p}:{};return m.cloneElement(u,Object.assign({},DN(u.props,O1(hy(l,["ref"]))),f,c,{ref:o(u.ref,c.ref)},v))}return m.createElement(i,Object.assign({},hy(l,["ref"]),i!==m.Fragment&&c,i!==m.Fragment&&f),u)}function yle(...e){return e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function DN(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map(r=>[r,void 0])));for(let r in n)Object.assign(t,{[r](o,...i){let s=n[r];for(let a of s){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;a(o,...i)}}});return t}function Ii(e){var t;return Object.assign(m.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function O1(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function hy(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}let xle="div";var AN=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(AN||{});function wle(e,t){var n;let{features:r=1,...o}=e,i={ref:t,"aria-hidden":(r&2)===2?!0:(n=o["aria-hidden"])!=null?n:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return bs({ourProps:i,theirProps:o,slot:{},defaultTag:xle,name:"Hidden"})}let _le=Ii(wle),wC=m.createContext(null);wC.displayName="OpenClosedContext";var so=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(so||{});function _C(){return m.useContext(wC)}function kN({value:e,children:t}){return m.createElement(wC.Provider,{value:e},t)}function Cle(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let qa=[];Cle(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&qa[0]!==t.target&&(qa.unshift(t.target),qa=qa.filter(n=>n!=null&&n.isConnected),qa.splice(10))}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function Sle(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&Ele(n)?!1:r}function Ele(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}function Rle(e){throw new Error("Unexpected object: "+e)}var jn=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(jn||{});function u2(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),o=r??-1;switch(e.focus){case 0:{for(let i=0;i<n.length;++i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 1:{for(let i=o-1;i>=0;--i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 2:{for(let i=o+1;i<n.length;++i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 3:{for(let i=n.length-1;i>=0;--i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 4:{for(let i=0;i<n.length;++i)if(t.resolveId(n[i],i,n)===e.id)return i;return r}case 5:return null;default:Rle(e)}}function MN(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))NN(n,IN(t,r),o);return n}function IN(e,t){return e?e+"["+t+"]":t}function NN(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())NN(e,IN(t,r.toString()),o);else n instanceof Date?e.push([t,n.toISOString()]):typeof n=="boolean"?e.push([t,n?"1":"0"]):typeof n=="string"?e.push([t,n]):typeof n=="number"?e.push([t,`${n}`]):n==null?e.push([t,""]):MN(n,t,e)}var eo=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(eo||{}),Ple=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Ple||{}),Ole=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(Ole||{}),$le=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))($le||{}),Tle=(e=>(e[e.OpenCombobox=0]="OpenCombobox",e[e.CloseCombobox=1]="CloseCombobox",e[e.GoToOption=2]="GoToOption",e[e.RegisterOption=3]="RegisterOption",e[e.UnregisterOption=4]="UnregisterOption",e[e.RegisterLabel=5]="RegisterLabel",e[e.SetActivationTrigger=6]="SetActivationTrigger",e[e.UpdateVirtualOptions=7]="UpdateVirtualOptions",e))(Tle||{});function py(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=t(e.options.slice()),o=r.length>0&&r[0].dataRef.current.order!==null?r.sort((s,a)=>s.dataRef.current.order-a.dataRef.current.order):cle(r,s=>s.dataRef.current.domRef.current),i=n?o.indexOf(n):null;return i===-1&&(i=null),{options:o,activeOptionIndex:i}}let Dle={1(e){var t;return(t=e.dataRef.current)!=null&&t.disabled||e.comboboxState===1?e:{...e,activeOptionIndex:null,comboboxState:1}},0(e){var t,n;if((t=e.dataRef.current)!=null&&t.disabled||e.comboboxState===0)return e;if((n=e.dataRef.current)!=null&&n.value){let r=e.dataRef.current.calculateIndex(e.dataRef.current.value);if(r!==-1)return{...e,activeOptionIndex:r,comboboxState:0}}return{...e,comboboxState:0}},2(e,t){var n,r,o,i,s;if((n=e.dataRef.current)!=null&&n.disabled||(r=e.dataRef.current)!=null&&r.optionsRef.current&&!((o=e.dataRef.current)!=null&&o.optionsPropsRef.current.static)&&e.comboboxState===1)return e;if(e.virtual){let u=t.focus===jn.Specific?t.idx:u2(t,{resolveItems:()=>e.virtual.options,resolveActiveIndex:()=>{var h,p;return(p=(h=e.activeOptionIndex)!=null?h:e.virtual.options.findIndex(v=>!e.virtual.disabled(v)))!=null?p:null},resolveDisabled:e.virtual.disabled,resolveId(){throw new Error("Function not implemented.")}}),f=(i=t.trigger)!=null?i:2;return e.activeOptionIndex===u&&e.activationTrigger===f?e:{...e,activeOptionIndex:u,activationTrigger:f}}let a=py(e);if(a.activeOptionIndex===null){let u=a.options.findIndex(f=>!f.dataRef.current.disabled);u!==-1&&(a.activeOptionIndex=u)}let l=t.focus===jn.Specific?t.idx:u2(t,{resolveItems:()=>a.options,resolveActiveIndex:()=>a.activeOptionIndex,resolveId:u=>u.id,resolveDisabled:u=>u.dataRef.current.disabled}),c=(s=t.trigger)!=null?s:2;return e.activeOptionIndex===l&&e.activationTrigger===c?e:{...e,...a,activeOptionIndex:l,activationTrigger:c}},3:(e,t)=>{var n,r,o;if((n=e.dataRef.current)!=null&&n.virtual)return{...e,options:[...e.options,t.payload]};let i=t.payload,s=py(e,l=>(l.push(i),l));e.activeOptionIndex===null&&(r=e.dataRef.current)!=null&&r.isSelected(t.payload.dataRef.current.value)&&(s.activeOptionIndex=s.options.indexOf(i));let a={...e,...s,activationTrigger:2};return(o=e.dataRef.current)!=null&&o.__demoMode&&e.dataRef.current.value===void 0&&(a.activeOptionIndex=0),a},4:(e,t)=>{var n;if((n=e.dataRef.current)!=null&&n.virtual)return{...e,options:e.options.filter(o=>o.id!==t.id)};let r=py(e,o=>{let i=o.findIndex(s=>s.id===t.id);return i!==-1&&o.splice(i,1),o});return{...e,...r,activationTrigger:2}},5:(e,t)=>e.labelId===t.id?e:{...e,labelId:t.id},6:(e,t)=>e.activationTrigger===t.trigger?e:{...e,activationTrigger:t.trigger},7:(e,t)=>{var n;if(((n=e.virtual)==null?void 0:n.options)===t.options)return e;let r=e.activeOptionIndex;if(e.activeOptionIndex!==null){let o=t.options.indexOf(e.virtual.options[e.activeOptionIndex]);o!==-1?r=o:r=null}return{...e,activeOptionIndex:r,virtual:Object.assign({},e.virtual,{options:t.options})}}},CC=m.createContext(null);CC.displayName="ComboboxActionsContext";function vh(e){let t=m.useContext(CC);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,vh),n}return t}let LN=m.createContext(null);function Ale(e){var t;let n=Nl("VirtualProvider"),[r,o]=m.useMemo(()=>{let l=n.optionsRef.current;if(!l)return[0,0];let c=window.getComputedStyle(l);return[parseFloat(c.paddingBlockStart||c.paddingTop),parseFloat(c.paddingBlockEnd||c.paddingBottom)]},[n.optionsRef.current]),i=Qae({scrollPaddingStart:r,scrollPaddingEnd:o,count:n.virtual.options.length,estimateSize(){return 40},getScrollElement(){var l;return(l=n.optionsRef.current)!=null?l:null},overscan:12}),[s,a]=m.useState(0);return Bn(()=>{a(l=>l+1)},[(t=n.virtual)==null?void 0:t.options]),m.createElement(LN.Provider,{value:i},m.createElement("div",{style:{position:"relative",width:"100%",height:`${i.getTotalSize()}px`},ref:l=>{if(l){if(typeof process<"u"&&process.env.JEST_WORKER_ID!==void 0||n.activationTrigger===0)return;n.activeOptionIndex!==null&&n.virtual.options.length>n.activeOptionIndex&&i.scrollToIndex(n.activeOptionIndex)}}},i.getVirtualItems().map(l=>{var c;return m.createElement(m.Fragment,{key:l.key},m.cloneElement((c=e.children)==null?void 0:c.call(e,{option:n.virtual.options[l.index],open:n.comboboxState===0}),{key:`${s}-${l.key}`,"data-index":l.index,"aria-setsize":n.virtual.options.length,"aria-posinset":l.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${l.start}px)`,overflowAnchor:"none"}}))})))}let SC=m.createContext(null);SC.displayName="ComboboxDataContext";function Nl(e){let t=m.useContext(SC);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Nl),n}return t}function kle(e,t){return Zn(t.type,Dle,e,t)}let Mle=m.Fragment;function Ile(e,t){let{value:n,defaultValue:r,onChange:o,form:i,name:s,by:a=null,disabled:l=!1,__demoMode:c=!1,nullable:u=!1,multiple:f=!1,immediate:h=!1,virtual:p=null,...v}=e,b=!1,w=null,[y=f?[]:void 0,_]=tle(n,o,r),[C,R]=m.useReducer(kle,{dataRef:m.createRef(),comboboxState:c?0:1,options:[],virtual:null,activeOptionIndex:null,activationTrigger:2,labelId:null}),S=m.useRef(!1),$=m.useRef({static:!1,hold:!1}),O=m.useRef(null),D=m.useRef(null),I=m.useRef(null),L=m.useRef(null),j=Rt(typeof a=="string"?(ee,ie)=>{let me=a;return(ee==null?void 0:ee[me])===(ie==null?void 0:ie[me])}:a??((ee,ie)=>ee===ie)),B=Rt(ee=>C.options.findIndex(ie=>j(ie.dataRef.current.value,ee))),te=m.useCallback(ee=>Zn(F.mode,{1:()=>y.some(ie=>j(ie,ee)),0:()=>j(y,ee)}),[y]),q=Rt(ee=>C.activeOptionIndex===B(ee)),F=m.useMemo(()=>({...C,immediate:b,optionsPropsRef:$,labelRef:O,inputRef:D,buttonRef:I,optionsRef:L,value:y,defaultValue:r,disabled:l,mode:f?1:0,virtual:C.virtual,get activeOptionIndex(){if(S.current&&C.activeOptionIndex===null&&C.options.length>0){let ee=C.options.findIndex(ie=>!ie.dataRef.current.disabled);if(ee!==-1)return ee}return C.activeOptionIndex},calculateIndex:B,compare:j,isSelected:te,isActive:q,nullable:u,__demoMode:c}),[y,r,l,f,u,c,C,w]);Bn(()=>{},[w,void 0]),Bn(()=>{C.dataRef.current=F},[F]),hle([F.buttonRef,F.inputRef,F.optionsRef],()=>ce.closeCombobox(),F.comboboxState===0);let Q=m.useMemo(()=>{var ee,ie,me;return{open:F.comboboxState===0,disabled:l,activeIndex:F.activeOptionIndex,activeOption:F.activeOptionIndex===null?null:F.virtual?F.virtual.options[(ee=F.activeOptionIndex)!=null?ee:0]:(me=(ie=F.options[F.activeOptionIndex])==null?void 0:ie.dataRef.current.value)!=null?me:null,value:y}},[F,l,y]),G=Rt(()=>{if(F.activeOptionIndex!==null){if(F.virtual)M(F.virtual.options[F.activeOptionIndex]);else{let{dataRef:ee}=F.options[F.activeOptionIndex];M(ee.current.value)}ce.goToOption(jn.Specific,F.activeOptionIndex)}}),K=Rt(()=>{R({type:0}),S.current=!0}),W=Rt(()=>{R({type:1}),S.current=!1}),T=Rt((ee,ie,me)=>(S.current=!1,ee===jn.Specific?R({type:2,focus:jn.Specific,idx:ie,trigger:me}):R({type:2,focus:ee,trigger:me}))),H=Rt((ee,ie)=>(R({type:3,payload:{id:ee,dataRef:ie}}),()=>{F.isActive(ie.current.value)&&(S.current=!0),R({type:4,id:ee})})),U=Rt(ee=>(R({type:5,id:ee}),()=>R({type:5,id:null}))),M=Rt(ee=>Zn(F.mode,{0(){return _==null?void 0:_(ee)},1(){let ie=F.value.slice(),me=ie.findIndex(Z=>j(Z,ee));return me===-1?ie.push(ee):ie.splice(me,1),_==null?void 0:_(ie)}})),re=Rt(ee=>{R({type:6,trigger:ee})}),ce=m.useMemo(()=>({onChange:M,registerOption:H,registerLabel:U,goToOption:T,closeCombobox:W,openCombobox:K,setActivationTrigger:re,selectActiveOption:G}),[]),ue=t===null?{}:{ref:t},he=m.useRef(null),J=gh();return m.useEffect(()=>{he.current&&r!==void 0&&J.addEventListener(he.current,"reset",()=>{_==null||_(r)})},[he,_]),m.createElement(CC.Provider,{value:ce},m.createElement(SC.Provider,{value:F},m.createElement(kN,{value:Zn(F.comboboxState,{0:so.Open,1:so.Closed})},s!=null&&y!=null&&MN({[s]:y}).map(([ee,ie],me)=>m.createElement(_le,{features:AN.Hidden,ref:me===0?Z=>{var be;he.current=(be=Z==null?void 0:Z.closest("form"))!=null?be:null}:void 0,...O1({key:ee,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:i,name:ee,value:ie})})),bs({ourProps:ue,theirProps:v,slot:Q,defaultTag:Mle,name:"Combobox"}))))}let Nle="input";function Lle(e,t){var n,r,o,i,s;let a=mh(),{id:l=`headlessui-combobox-input-${a}`,onChange:c,displayValue:u,type:f="text",...h}=e,p=Nl("Combobox.Input"),v=vh("Combobox.Input"),b=Il(p.inputRef,t),w=ple(p.inputRef),y=m.useRef(!1),_=gh(),C=Rt(()=>{v.onChange(null),p.optionsRef.current&&(p.optionsRef.current.scrollTop=0),v.goToOption(jn.Nothing)}),R=function(){var F;return typeof u=="function"&&p.value!==void 0?(F=u(p.value))!=null?F:"":typeof p.value=="string"?p.value:""}();c2(([F,Q],[G,K])=>{if(y.current)return;let W=p.inputRef.current;W&&((K===0&&Q===1||F!==G)&&(W.value=F),requestAnimationFrame(()=>{if(y.current||!W||(w==null?void 0:w.activeElement)!==W)return;let{selectionStart:T,selectionEnd:H}=W;Math.abs((H??0)-(T??0))===0&&T===0&&W.setSelectionRange(W.value.length,W.value.length)}))},[R,p.comboboxState,w]),c2(([F],[Q])=>{if(F===0&&Q===1){if(y.current)return;let G=p.inputRef.current;if(!G)return;let K=G.value,{selectionStart:W,selectionEnd:T,selectionDirection:H}=G;G.value="",G.value=K,H!==null?G.setSelectionRange(W,T,H):G.setSelectionRange(W,T)}},[p.comboboxState]);let S=m.useRef(!1),$=Rt(()=>{S.current=!0}),O=Rt(()=>{_.nextFrame(()=>{S.current=!1})}),D=Rt(F=>{switch(y.current=!0,F.key){case eo.Enter:if(y.current=!1,p.comboboxState!==0||S.current)return;if(F.preventDefault(),F.stopPropagation(),p.activeOptionIndex===null){v.closeCombobox();return}v.selectActiveOption(),p.mode===0&&v.closeCombobox();break;case eo.ArrowDown:return y.current=!1,F.preventDefault(),F.stopPropagation(),Zn(p.comboboxState,{0:()=>v.goToOption(jn.Next),1:()=>v.openCombobox()});case eo.ArrowUp:return y.current=!1,F.preventDefault(),F.stopPropagation(),Zn(p.comboboxState,{0:()=>v.goToOption(jn.Previous),1:()=>{v.openCombobox(),_.nextFrame(()=>{p.value||v.goToOption(jn.Last)})}});case eo.Home:if(F.shiftKey)break;return y.current=!1,F.preventDefault(),F.stopPropagation(),v.goToOption(jn.First);case eo.PageUp:return y.current=!1,F.preventDefault(),F.stopPropagation(),v.goToOption(jn.First);case eo.End:if(F.shiftKey)break;return y.current=!1,F.preventDefault(),F.stopPropagation(),v.goToOption(jn.Last);case eo.PageDown:return y.current=!1,F.preventDefault(),F.stopPropagation(),v.goToOption(jn.Last);case eo.Escape:return y.current=!1,p.comboboxState!==0?void 0:(F.preventDefault(),p.optionsRef.current&&!p.optionsPropsRef.current.static&&F.stopPropagation(),p.nullable&&p.mode===0&&p.value===null&&C(),v.closeCombobox());case eo.Tab:if(y.current=!1,p.comboboxState!==0)return;p.mode===0&&p.activationTrigger!==1&&v.selectActiveOption(),v.closeCombobox();break}}),I=Rt(F=>{c==null||c(F),p.nullable&&p.mode===0&&F.target.value===""&&C(),v.openCombobox()}),L=Rt(F=>{var Q,G,K;let W=(Q=F.relatedTarget)!=null?Q:qa.find(T=>T!==F.currentTarget);if(y.current=!1,!((G=p.optionsRef.current)!=null&&G.contains(W))&&!((K=p.buttonRef.current)!=null&&K.contains(W))&&p.comboboxState===0)return F.preventDefault(),p.mode===0&&(p.nullable&&p.value===null?C():p.activationTrigger!==1&&v.selectActiveOption()),v.closeCombobox()}),j=Rt(F=>{var Q,G,K;let W=(Q=F.relatedTarget)!=null?Q:qa.find(T=>T!==F.currentTarget);(G=p.buttonRef.current)!=null&&G.contains(W)||(K=p.optionsRef.current)!=null&&K.contains(W)||p.disabled||p.immediate&&p.comboboxState!==0&&(v.openCombobox(),_.nextFrame(()=>{v.setActivationTrigger(1)}))}),B=bC(()=>{if(p.labelId)return[p.labelId].join(" ")},[p.labelId]),te=m.useMemo(()=>({open:p.comboboxState===0,disabled:p.disabled}),[p]),q={ref:b,id:l,role:"combobox",type:f,"aria-controls":(n=p.optionsRef.current)==null?void 0:n.id,"aria-expanded":p.comboboxState===0,"aria-activedescendant":p.activeOptionIndex===null?void 0:p.virtual?(r=p.options.find(F=>{var Q;return!((Q=p.virtual)!=null&&Q.disabled(F.dataRef.current.value))&&p.compare(F.dataRef.current.value,p.virtual.options[p.activeOptionIndex])}))==null?void 0:r.id:(o=p.options[p.activeOptionIndex])==null?void 0:o.id,"aria-labelledby":B,"aria-autocomplete":"list",defaultValue:(s=(i=e.defaultValue)!=null?i:p.defaultValue!==void 0?u==null?void 0:u(p.defaultValue):null)!=null?s:p.defaultValue,disabled:p.disabled,onCompositionStart:$,onCompositionEnd:O,onKeyDown:D,onChange:I,onFocus:j,onBlur:L};return bs({ourProps:q,theirProps:h,slot:te,defaultTag:Nle,name:"Combobox.Input"})}let Fle="button";function jle(e,t){var n;let r=Nl("Combobox.Button"),o=vh("Combobox.Button"),i=Il(r.buttonRef,t),s=mh(),{id:a=`headlessui-combobox-button-${s}`,...l}=e,c=gh(),u=Rt(b=>{switch(b.key){case eo.ArrowDown:return b.preventDefault(),b.stopPropagation(),r.comboboxState===1&&o.openCombobox(),c.nextFrame(()=>{var w;return(w=r.inputRef.current)==null?void 0:w.focus({preventScroll:!0})});case eo.ArrowUp:return b.preventDefault(),b.stopPropagation(),r.comboboxState===1&&(o.openCombobox(),c.nextFrame(()=>{r.value||o.goToOption(jn.Last)})),c.nextFrame(()=>{var w;return(w=r.inputRef.current)==null?void 0:w.focus({preventScroll:!0})});case eo.Escape:return r.comboboxState!==0?void 0:(b.preventDefault(),r.optionsRef.current&&!r.optionsPropsRef.current.static&&b.stopPropagation(),o.closeCombobox(),c.nextFrame(()=>{var w;return(w=r.inputRef.current)==null?void 0:w.focus({preventScroll:!0})}));default:return}}),f=Rt(b=>{if(Sle(b.currentTarget))return b.preventDefault();r.comboboxState===0?o.closeCombobox():(b.preventDefault(),o.openCombobox()),c.nextFrame(()=>{var w;return(w=r.inputRef.current)==null?void 0:w.focus({preventScroll:!0})})}),h=bC(()=>{if(r.labelId)return[r.labelId,a].join(" ")},[r.labelId,a]),p=m.useMemo(()=>({open:r.comboboxState===0,disabled:r.disabled,value:r.value}),[r]),v={ref:i,id:a,type:gle(e,r.buttonRef),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":(n=r.optionsRef.current)==null?void 0:n.id,"aria-expanded":r.comboboxState===0,"aria-labelledby":h,disabled:r.disabled,onClick:f,onKeyDown:u};return bs({ourProps:v,theirProps:l,slot:p,defaultTag:Fle,name:"Combobox.Button"})}let zle="label";function Ble(e,t){let n=mh(),{id:r=`headlessui-combobox-label-${n}`,...o}=e,i=Nl("Combobox.Label"),s=vh("Combobox.Label"),a=Il(i.labelRef,t);Bn(()=>s.registerLabel(r),[r]);let l=Rt(()=>{var u;return(u=i.inputRef.current)==null?void 0:u.focus({preventScroll:!0})}),c=m.useMemo(()=>({open:i.comboboxState===0,disabled:i.disabled}),[i]);return bs({ourProps:{ref:a,id:r,onClick:l},theirProps:o,slot:c,defaultTag:zle,name:"Combobox.Label"})}let Vle="ul",Hle=hm.RenderStrategy|hm.Static;function Wle(e,t){let n=mh(),{id:r=`headlessui-combobox-options-${n}`,hold:o=!1,...i}=e,s=Nl("Combobox.Options"),a=Il(s.optionsRef,t),l=_C(),c=l!==null?(l&so.Open)===so.Open:s.comboboxState===0;Bn(()=>{var p;s.optionsPropsRef.current.static=(p=e.static)!=null?p:!1},[s.optionsPropsRef,e.static]),Bn(()=>{s.optionsPropsRef.current.hold=o},[s.optionsPropsRef,o]),ble({container:s.optionsRef.current,enabled:s.comboboxState===0,accept(p){return p.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:p.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(p){p.setAttribute("role","none")}});let u=bC(()=>{var p,v;return(v=s.labelId)!=null?v:(p=s.buttonRef.current)==null?void 0:p.id},[s.labelId,s.buttonRef.current]),f=m.useMemo(()=>({open:s.comboboxState===0,option:void 0}),[s]),h={"aria-labelledby":u,role:"listbox","aria-multiselectable":s.mode===1?!0:void 0,id:r,ref:a};return s.virtual&&s.comboboxState===0&&Object.assign(i,{children:m.createElement(Ale,null,i.children)}),bs({ourProps:h,theirProps:i,slot:f,defaultTag:Vle,features:Hle,visible:c,name:"Combobox.Options"})}let Ule="li";function Gle(e,t){var n;let r=mh(),{id:o=`headlessui-combobox-option-${r}`,disabled:i=!1,value:s,order:a=null,...l}=e,c=Nl("Combobox.Option"),u=vh("Combobox.Option"),f=c.virtual?c.activeOptionIndex===c.calculateIndex(s):c.activeOptionIndex===null?!1:((n=c.options[c.activeOptionIndex])==null?void 0:n.id)===o,h=c.isSelected(s),p=m.useRef(null),v=Ri({disabled:i,value:s,domRef:p,order:a}),b=m.useContext(LN),w=Il(t,p,b?b.measureElement:null),y=Rt(()=>u.onChange(s));Bn(()=>u.registerOption(o,v),[v,o]);let _=m.useRef(!(c.virtual||c.__demoMode));Bn(()=>{if(!c.virtual||!c.__demoMode)return;let L=Cl();return L.requestAnimationFrame(()=>{_.current=!0}),L.dispose},[c.virtual,c.__demoMode]),Bn(()=>{if(!_.current||c.comboboxState!==0||!f||c.activationTrigger===0)return;let L=Cl();return L.requestAnimationFrame(()=>{var j,B;(B=(j=p.current)==null?void 0:j.scrollIntoView)==null||B.call(j,{block:"nearest"})}),L.dispose},[p,f,c.comboboxState,c.activationTrigger,c.activeOptionIndex]);let C=Rt(L=>{var j;if(i||(j=c.virtual)!=null&&j.disabled(s))return L.preventDefault();y(),TN()||requestAnimationFrame(()=>{var B;return(B=c.inputRef.current)==null?void 0:B.focus({preventScroll:!0})}),c.mode===0&&requestAnimationFrame(()=>u.closeCombobox())}),R=Rt(()=>{var L;if(i||(L=c.virtual)!=null&&L.disabled(s))return u.goToOption(jn.Nothing);let j=c.calculateIndex(s);u.goToOption(jn.Specific,j)}),S=vle(),$=Rt(L=>S.update(L)),O=Rt(L=>{var j;if(!S.wasMoved(L)||i||(j=c.virtual)!=null&&j.disabled(s)||f)return;let B=c.calculateIndex(s);u.goToOption(jn.Specific,B,0)}),D=Rt(L=>{var j;S.wasMoved(L)&&(i||(j=c.virtual)!=null&&j.disabled(s)||f&&(c.optionsPropsRef.current.hold||u.goToOption(jn.Nothing)))}),I=m.useMemo(()=>({active:f,selected:h,disabled:i}),[f,h,i]);return bs({ourProps:{id:o,ref:w,role:"option",tabIndex:i===!0?void 0:-1,"aria-disabled":i===!0?!0:void 0,"aria-selected":h,disabled:void 0,onClick:C,onFocus:R,onPointerEnter:$,onMouseEnter:$,onPointerMove:O,onMouseMove:O,onPointerLeave:D,onMouseLeave:D},theirProps:l,slot:I,defaultTag:Ule,name:"Combobox.Option"})}let qle=Ii(Ile),Yle=Ii(jle),Kle=Ii(Lle),Xle=Ii(Ble),Qle=Ii(Wle),Jle=Ii(Gle),fc=Object.assign(qle,{Input:Kle,Button:Yle,Label:Xle,Options:Qle,Option:Jle});function EC(){let e=m.useRef(!1);return Bn(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function Zle(e=0){let[t,n]=m.useState(e),r=EC(),o=m.useCallback(l=>{r.current&&n(c=>c|l)},[t,r]),i=m.useCallback(l=>!!(t&l),[t]),s=m.useCallback(l=>{r.current&&n(c=>c&~l)},[n,r]),a=m.useCallback(l=>{r.current&&n(c=>c^l)},[n]);return{flags:t,addFlag:o,hasFlag:i,removeFlag:s,toggleFlag:a}}function ece(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function gy(e,...t){e&&t.length>0&&e.classList.add(...t)}function my(e,...t){e&&t.length>0&&e.classList.remove(...t)}function tce(e,t){let n=Cl();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:o}=getComputedStyle(e),[i,s]=[r,o].map(l=>{let[c=0]=l.split(",").filter(Boolean).map(u=>u.includes("ms")?parseFloat(u):parseFloat(u)*1e3).sort((u,f)=>f-u);return c}),a=i+s;if(a!==0){n.group(c=>{c.setTimeout(()=>{t(),c.dispose()},a),c.addEventListener(e,"transitionrun",u=>{u.target===u.currentTarget&&c.dispose()})});let l=n.addEventListener(e,"transitionend",c=>{c.target===c.currentTarget&&(t(),l())})}else t();return n.add(()=>t()),n.dispose}function nce(e,t,n,r){let o=n?"enter":"leave",i=Cl(),s=r!==void 0?ece(r):()=>{};o==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let a=Zn(o,{enter:()=>t.enter,leave:()=>t.leave}),l=Zn(o,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),c=Zn(o,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return my(e,...t.base,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),gy(e,...t.base,...a,...c),i.nextFrame(()=>{my(e,...t.base,...a,...c),gy(e,...t.base,...a,...l),tce(e,()=>(my(e,...t.base,...a),gy(e,...t.base,...t.entered),s()))}),i.dispose}function rce({immediate:e,container:t,direction:n,classes:r,onStart:o,onStop:i}){let s=EC(),a=gh(),l=Ri(n);Bn(()=>{e&&(l.current="enter")},[e]),Bn(()=>{let c=Cl();a.add(c.dispose);let u=t.current;if(u&&l.current!=="idle"&&s.current)return c.dispose(),o.current(l.current),c.add(nce(u,r.current,l.current==="enter",()=>{c.dispose(),i.current(l.current)})),c.dispose},[n])}function js(e=""){return e.split(/\s+/).filter(t=>t.length>1)}let Pv=m.createContext(null);Pv.displayName="TransitionContext";var oce=(e=>(e.Visible="visible",e.Hidden="hidden",e))(oce||{});function ice(){let e=m.useContext(Pv);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function sce(){let e=m.useContext(Ov);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Ov=m.createContext(null);Ov.displayName="NestingContext";function $v(e){return"children"in e?$v(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function FN(e,t){let n=Ri(e),r=m.useRef([]),o=EC(),i=gh(),s=Rt((p,v=ia.Hidden)=>{let b=r.current.findIndex(({el:w})=>w===p);b!==-1&&(Zn(v,{[ia.Unmount](){r.current.splice(b,1)},[ia.Hidden](){r.current[b].state="hidden"}}),i.microTask(()=>{var w;!$v(r)&&o.current&&((w=n.current)==null||w.call(n))}))}),a=Rt(p=>{let v=r.current.find(({el:b})=>b===p);return v?v.state!=="visible"&&(v.state="visible"):r.current.push({el:p,state:"visible"}),()=>s(p,ia.Unmount)}),l=m.useRef([]),c=m.useRef(Promise.resolve()),u=m.useRef({enter:[],leave:[],idle:[]}),f=Rt((p,v,b)=>{l.current.splice(0),t&&(t.chains.current[v]=t.chains.current[v].filter(([w])=>w!==p)),t==null||t.chains.current[v].push([p,new Promise(w=>{l.current.push(w)})]),t==null||t.chains.current[v].push([p,new Promise(w=>{Promise.all(u.current[v].map(([y,_])=>_)).then(()=>w())})]),v==="enter"?c.current=c.current.then(()=>t==null?void 0:t.wait.current).then(()=>b(v)):b(v)}),h=Rt((p,v,b)=>{Promise.all(u.current[v].splice(0).map(([w,y])=>y)).then(()=>{var w;(w=l.current.shift())==null||w()}).then(()=>b(v))});return m.useMemo(()=>({children:r,register:a,unregister:s,onStart:f,onStop:h,wait:c,chains:u}),[a,s,r,f,h,u,c])}function ace(){}let lce=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function d2(e){var t;let n={};for(let r of lce)n[r]=(t=e[r])!=null?t:ace;return n}function cce(e){let t=m.useRef(d2(e));return m.useEffect(()=>{t.current=d2(e)},[e]),t}let uce="div",jN=hm.RenderStrategy;function dce(e,t){var n,r;let{beforeEnter:o,afterEnter:i,beforeLeave:s,afterLeave:a,enter:l,enterFrom:c,enterTo:u,entered:f,leave:h,leaveFrom:p,leaveTo:v,...b}=e,w=m.useRef(null),y=Il(w,t),_=(n=b.unmount)==null||n?ia.Unmount:ia.Hidden,{show:C,appear:R,initial:S}=ice(),[$,O]=m.useState(C?"visible":"hidden"),D=sce(),{register:I,unregister:L}=D;m.useEffect(()=>I(w),[I,w]),m.useEffect(()=>{if(_===ia.Hidden&&w.current){if(C&&$!=="visible"){O("visible");return}return Zn($,{hidden:()=>L(w),visible:()=>I(w)})}},[$,w,I,L,C,_]);let j=Ri({base:js(b.className),enter:js(l),enterFrom:js(c),enterTo:js(u),entered:js(f),leave:js(h),leaveFrom:js(p),leaveTo:js(v)}),B=cce({beforeEnter:o,afterEnter:i,beforeLeave:s,afterLeave:a}),te=yC();m.useEffect(()=>{if(te&&$==="visible"&&w.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[w,$,te]);let q=S&&!R,F=R&&C&&S,Q=!te||q?"idle":C?"enter":"leave",G=Zle(0),K=Rt(re=>Zn(re,{enter:()=>{G.addFlag(so.Opening),B.current.beforeEnter()},leave:()=>{G.addFlag(so.Closing),B.current.beforeLeave()},idle:()=>{}})),W=Rt(re=>Zn(re,{enter:()=>{G.removeFlag(so.Opening),B.current.afterEnter()},leave:()=>{G.removeFlag(so.Closing),B.current.afterLeave()},idle:()=>{}})),T=FN(()=>{O("hidden"),L(w)},D),H=m.useRef(!1);rce({immediate:F,container:w,classes:j,direction:Q,onStart:Ri(re=>{H.current=!0,T.onStart(w,re,K)}),onStop:Ri(re=>{H.current=!1,T.onStop(w,re,W),re==="leave"&&!$v(T)&&(O("hidden"),L(w))})});let U=b,M={ref:y};return F?U={...U,className:fm(b.className,...j.current.enter,...j.current.enterFrom)}:H.current&&(U.className=fm(b.className,(r=w.current)==null?void 0:r.className),U.className===""&&delete U.className),m.createElement(Ov.Provider,{value:T},m.createElement(kN,{value:Zn($,{visible:so.Open,hidden:so.Closed})|G.flags},bs({ourProps:M,theirProps:U,defaultTag:uce,features:jN,visible:$==="visible",name:"Transition.Child"})))}function fce(e,t){let{show:n,appear:r=!1,unmount:o=!0,...i}=e,s=m.useRef(null),a=Il(s,t);yC();let l=_C();if(n===void 0&&l!==null&&(n=(l&so.Open)===so.Open),![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,u]=m.useState(n?"visible":"hidden"),f=FN(()=>{u("hidden")}),[h,p]=m.useState(!0),v=m.useRef([n]);Bn(()=>{h!==!1&&v.current[v.current.length-1]!==n&&(v.current.push(n),p(!1))},[v,n]);let b=m.useMemo(()=>({show:n,appear:r,initial:h}),[n,r,h]);m.useEffect(()=>{if(n)u("visible");else if(!$v(f))u("hidden");else{let C=s.current;if(!C)return;let R=C.getBoundingClientRect();R.x===0&&R.y===0&&R.width===0&&R.height===0&&u("hidden")}},[n,f]);let w={unmount:o},y=Rt(()=>{var C;h&&p(!1),(C=e.beforeEnter)==null||C.call(e)}),_=Rt(()=>{var C;h&&p(!1),(C=e.beforeLeave)==null||C.call(e)});return m.createElement(Ov.Provider,{value:f},m.createElement(Pv.Provider,{value:b},bs({ourProps:{...w,as:m.Fragment,children:m.createElement(zN,{ref:a,...w,...i,beforeEnter:y,beforeLeave:_})},theirProps:{},defaultTag:m.Fragment,features:jN,visible:c==="visible",name:"Transition"})))}function hce(e,t){let n=m.useContext(Pv)!==null,r=_C()!==null;return m.createElement(m.Fragment,null,!n&&r?m.createElement($1,{ref:t,...e}):m.createElement(zN,{ref:t,...e}))}let $1=Ii(fce),zN=Ii(dce),pce=Ii(hce),gce=Object.assign($1,{Child:pce,Root:$1});function mce(e){const t=/(>=|<=|>|<|=)/,n=e.match(t);if(n){const r=n[0],[o,i]=e.split(r);return{operation:r,value:i.trim()}}else return null}function vce(e,t,n){const r=`SELECT ${n}, COUNT(*) FROM ${t} {{ filters | where }} GROUP BY ${n} ORDER BY ${n} ASC LIMIT 50`,o=`SELECT min(${n}) as min, max(${n}) as max FROM ${t} {{ filters | where }}`;return vu.includes(e)?o:r}function bce({filter:e}){const[t,n]=m.useState([]),[r,o]=m.useState(""),[i,s]=m.useState(""),a=m.useRef(null);ni();const l=Ce(O=>O.filterValues),c=Ce(O=>O.selectedSheetId),u=Ce(O=>O.actions.addOrUpdateFilterValue),f=Ce(O=>O.actions.removeFilterValue),{data:h,isLoading:p,isFetching:v,isError:b,refetch:w}=PN(e),y=m.useMemo(()=>{var O;return(O=h==null?void 0:h.records)==null?void 0:O.map(D=>{let I=e.column.split(".").slice(-1)[0].replace(/"/g,"");return D[I]===void 0&&(I=I.toLowerCase()),{id:D[I],value:D[I]}})},[h,e.column]);m.useEffect(()=>{if(l){const O=l.find(D=>D.filterId===e.id);if(!O){n([]);return}if(O.operation==="in"){const D=y==null?void 0:y.filter(I=>O.values.includes(I.value));D&&n(D)}else o(`${O.operation} ${O.values[0]}`)}},[h,c,l]),m.useEffect(()=>{if(l&&!l.find(D=>D.filterId===e.id)){n([]);return}},[l,e.id]);function _(O){const D=mce(O[0].toString());if(!(D!=null&&D.value)||!(D!=null&&D.operation))return;const I={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:Gd(e),name:e.column,operation:D.operation,values:[Number(D.value)]};u(I)}function C(O){if(Array.isArray(O)||(O=[O]),console.log("onComboBoxChange",O),O.length===1&&y.find(I=>I.value===O[0].value)===void 0){_(O);return}if(n(O),O.length===0){f(e.id);return}const D={filterId:e.id,connectionType:e.database==="NA"?"api":"database",name:e.column,valueType:Gd(e),operation:e.operation,values:O.map(I=>I.value)};u(D)}function R(){var O;o(""),f(e.id),console.log(e.id),(O=a.current)==null||O.click()}if(p)return E.jsx("div",{children:E.jsx(km,{className:"h-8 w-full bg-foreground/10"})});if(b)return E.jsx("div",{className:"flex h-8 w-full items-center bg-muted px-2 text-sm",children:"Error"});let S=[];tu.includes(e.dataType)?S=y:S=i===""?y:y==null?void 0:y.filter(O=>O.value.toLowerCase().replace(/\s+/g,"").includes(i.toLowerCase().replace(/\s+/g,"")));const $=e.type==="single";return E.jsx("div",{className:"w-full",children:E.jsx(fc,{value:t,multiple:!$,onChange:C,children:E.jsxs("div",{className:"relative",children:[E.jsxs("div",{className:"relative w-full cursor-default overflow-hidden rounded-sm border bg-background text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-background/75 focus-visible:ring-offset-2 sm:text-sm",children:[E.jsx(fc.Input,{className:"flex h-8 w-full rounded border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50",displayValue:O=>O.map(I=>I.value).join(", ")||r,onChange:O=>{o(O.target.value),s(O.target.value)}}),E.jsx(fc.Button,{ref:a,className:"absolute inset-y-0 right-0 flex items-center bg-background pl-1 pr-2",children:E.jsx(CJ,{className:"h-5 w-5 text-gray-400","aria-hidden":"true"})})]}),E.jsx(gce,{as:m.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",afterLeave:()=>s(""),children:E.jsxs(fc.Options,{className:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-sm border bg-background py-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-none sm:text-sm",children:[tu.includes(e.dataType)&&E.jsxs(fc.Option,{value:r,className:"flex items-center justify-between gap-2 px-3 py-2",children:[E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx("span",{className:"font-thin",children:"#"}),E.jsx("span",{children:r})]}),r&&E.jsx(_r,{variant:"link",className:"h-4 w-3 cursor-pointer text-foreground/50 hover:text-foreground/100",onClick:O=>{O.stopPropagation(),R()},children:"Clear"})]},"custom"),(S==null?void 0:S.length)===0&&i!==""?E.jsx("div",{className:"relative cursor-default select-none px-4 py-2 text-gray-700",children:"Nothing found."}):S==null?void 0:S.map(O=>E.jsx(fc.Option,{className:({active:D})=>`relative cursor-default select-none border-b border-muted py-2 pl-10 pr-4 ${D?"bg-muted":"text-foreground-900"}`,value:O,children:({selected:D,active:I})=>E.jsxs("div",{className:"",children:[E.jsx("span",{className:`block ${D?"font-medium":"font-normal"}`,children:typeof O.value=="boolean"?O.value?"True":"False":O.value}),D?E.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 text-foreground",children:E.jsx(qk,{className:"h-5 w-5","aria-hidden":"true"})}):null]})},O.value))]})})]})})})}const RC=N.forwardRef(({className:e,...t},n)=>E.jsx("textarea",{className:xe("flex min-h-[80px] 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 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));RC.displayName="Textarea";const BN="Radio",[yce,VN]=tr(BN),[xce,wce]=yce(BN),_ce=m.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:i,disabled:s,value:a="on",onCheck:l,...c}=e,[u,f]=m.useState(null),h=Ct(t,b=>f(b)),p=m.useRef(!1),v=u?!!u.closest("form"):!0;return m.createElement(xce,{scope:n,checked:o,disabled:s},m.createElement(Qe.button,de({type:"button",role:"radio","aria-checked":o,"data-state":HN(o),"data-disabled":s?"":void 0,disabled:s,value:a},c,{ref:h,onClick:Me(e.onClick,b=>{o||l==null||l(),v&&(p.current=b.isPropagationStopped(),p.current||b.stopPropagation())})})),v&&m.createElement(Ece,{control:u,bubbles:!p.current,name:r,value:a,checked:o,required:i,disabled:s,style:{transform:"translateX(-100%)"}}))}),Cce="RadioIndicator",Sce=m.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,i=wce(Cce,n);return m.createElement(nr,{present:r||i.checked},m.createElement(Qe.span,de({"data-state":HN(i.checked),"data-disabled":i.disabled?"":void 0},o,{ref:t})))}),Ece=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),s=fv(n),a=av(t);return m.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const h=new Event("click",{bubbles:r});f.call(l,n),l.dispatchEvent(h)}},[s,n,r]),m.createElement("input",de({type:"radio","aria-hidden":!0,defaultChecked:n},o,{tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function HN(e){return e?"checked":"unchecked"}const Rce=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],WN="RadioGroup",[Pce,q1e]=tr(WN,[yu,VN]),UN=yu(),GN=VN(),[Oce,$ce]=Pce(WN),Tce=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:i,required:s=!1,disabled:a=!1,orientation:l,dir:c,loop:u=!0,onValueChange:f,...h}=e,p=UN(n),v=$l(c),[b,w]=Cr({prop:i,defaultProp:o,onChange:f});return m.createElement(Oce,{scope:n,name:r,required:s,disabled:a,value:b,onValueChange:w},m.createElement(_w,de({asChild:!0},p,{orientation:l,dir:v,loop:u}),m.createElement(Qe.div,de({role:"radiogroup","aria-required":s,"aria-orientation":l,"data-disabled":a?"":void 0,dir:v},h,{ref:t}))))}),Dce="RadioGroupItem",Ace=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,i=$ce(Dce,n),s=i.disabled||r,a=UN(n),l=GN(n),c=m.useRef(null),u=Ct(t,c),f=i.value===o.value,h=m.useRef(!1);return m.useEffect(()=>{const p=b=>{Rce.includes(b.key)&&(h.current=!0)},v=()=>h.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",v),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",v)}},[]),m.createElement(Cw,de({asChild:!0},a,{focusable:!s,active:f}),m.createElement(_ce,de({disabled:s,required:i.required,checked:f},l,o,{name:i.name,ref:u,onCheck:()=>i.onValueChange(o.value),onKeyDown:Me(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:Me(o.onFocus,()=>{var p;h.current&&((p=c.current)===null||p===void 0||p.click())})})))}),kce=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=GN(n);return m.createElement(Sce,de({},o,r,{ref:t}))}),qN=Tce,YN=Ace,Mce=kce,PC=N.forwardRef(({className:e,...t},n)=>E.jsx(qN,{className:xe("grid gap-2",e),...t,ref:n}));PC.displayName=qN.displayName;const pm=N.forwardRef(({className:e,...t},n)=>E.jsx(YN,{ref:n,className:xe("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:E.jsx(Mce,{className:"flex items-center justify-center",children:E.jsx(m_,{className:"h-2.5 w-2.5 fill-current text-current"})})}));pm.displayName=YN.displayName;const KN="Checkbox",[Ice,Y1e]=tr(KN),[Nce,Lce]=Ice(KN),Fce=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:c,...u}=e,[f,h]=m.useState(null),p=Ct(t,C=>h(C)),v=m.useRef(!1),b=f?!!f.closest("form"):!0,[w=!1,y]=Cr({prop:o,defaultProp:i,onChange:c}),_=m.useRef(w);return m.useEffect(()=>{const C=f==null?void 0:f.form;if(C){const R=()=>y(_.current);return C.addEventListener("reset",R),()=>C.removeEventListener("reset",R)}},[f,y]),m.createElement(Nce,{scope:n,state:w,disabled:a},m.createElement(Qe.button,de({type:"button",role:"checkbox","aria-checked":pl(w)?"mixed":w,"aria-required":s,"data-state":XN(w),"data-disabled":a?"":void 0,disabled:a,value:l},u,{ref:p,onKeyDown:Me(e.onKeyDown,C=>{C.key==="Enter"&&C.preventDefault()}),onClick:Me(e.onClick,C=>{y(R=>pl(R)?!0:!R),b&&(v.current=C.isPropagationStopped(),v.current||C.stopPropagation())})})),b&&m.createElement(Bce,{control:f,bubbles:!v.current,name:r,value:l,checked:w,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),jce="CheckboxIndicator",zce=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,i=Lce(jce,n);return m.createElement(nr,{present:r||pl(i.state)||i.state===!0},m.createElement(Qe.span,de({"data-state":XN(i.state),"data-disabled":i.disabled?"":void 0},o,{ref:t,style:{pointerEvents:"none",...e.style}})))}),Bce=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),s=fv(n),a=av(t);return m.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const h=new Event("click",{bubbles:r});l.indeterminate=pl(n),f.call(l,pl(n)?!1:n),l.dispatchEvent(h)}},[s,n,r]),m.createElement("input",de({type:"checkbox","aria-hidden":!0,defaultChecked:pl(n)?!1:n},o,{tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function pl(e){return e==="indeterminate"}function XN(e){return pl(e)?"indeterminate":e?"checked":"unchecked"}const QN=Fce,Vce=zce,OC=N.forwardRef(({className:e,...t},n)=>E.jsx(QN,{ref:n,className:xe("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:E.jsx(Vce,{className:xe("flex items-center justify-center text-current"),children:E.jsx(Zf,{className:"h-4 w-4"})})}));OC.displayName=QN.displayName;function Hce({label:e,onCheckedChange:t,checked:n}){return E.jsxs("div",{className:"flex items-center space-x-2",children:[E.jsx(OC,{onCheckedChange:t,id:"terms",checked:n}),E.jsx("label",{htmlFor:"terms",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:e})]})}function Wce({filter:e}){const[t,n]=m.useState(e.sql),[r,o]=m.useState(!1),i=Ce(f=>f.selectedSheetId),{updateFilter:s}=ur();function a(){const f={...e,sql:t};s(f),o(!1)}function l(f){console.log("operation",f);const h={...e,operation:f};s(h)}function c(f){const h={...e,type:f};s(h)}function u(f){if(!i)return;const h={...e,sheetId:f?i:void 0};s(h)}return E.jsxs(xv,{open:r,onOpenChange:o,children:[E.jsx(wv,{children:E.jsx(y_,{className:"invisible h-3 w-3 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"})}),E.jsxs(ch,{onMouseDown:f=>f.stopPropagation(),onDoubleClick:f=>f.stopPropagation(),className:"z-50 m-2 w-full min-w-[350px] space-y-4",children:[E.jsxs("div",{className:"space-y-2",children:[E.jsxs("div",{className:"flex items-center gap-3",children:[E.jsx("h4",{className:"font-medium leading-none",children:"Customize Filter"}),E.jsx("p",{className:"rounded-md bg-muted px-2 py-1 text-xs text-muted-foreground",children:e.column})]}),E.jsx("p",{className:"text-sm text-muted-foreground",children:"Customize the filter operation and SQL"})]}),E.jsx(uh,{}),E.jsxs("div",{className:"space-y-2",children:[E.jsx(_n,{children:"Type"}),E.jsxs(PC,{onValueChange:c,value:e.type||"multiple",className:"flex gap-3",defaultValue:"x",children:[E.jsxs("div",{className:"flex items-center space-x-2",children:[E.jsx(pm,{value:"multiple",id:"r1"}),E.jsx("label",{className:"text-sm",htmlFor:"r1",children:"Multiple"})]}),E.jsxs("div",{className:"flex items-center space-x-2",children:[E.jsx(pm,{value:"single",id:"r2"}),E.jsx("label",{className:"text-sm",htmlFor:"r2",children:"Single"})]})]})]}),E.jsxs("div",{className:"grid grid-cols-6 gap-4 text-sm",children:[E.jsxs("div",{className:"col-span-2 space-y-1",children:[E.jsx(_n,{children:"Table Column"}),E.jsx(_n,{className:"block rounded-md bg-muted p-2 font-mono text-xs",children:e.column})]}),E.jsxs("div",{className:"col-span-2 space-y-1",children:[E.jsx(_n,{children:"Data Type"}),E.jsx(_n,{className:"block rounded-md bg-muted p-2 font-mono text-xs",children:e.dataType})]}),E.jsxs("div",{className:"col-span-2 space-y-1",children:[E.jsx(_n,{className:"text-sm",children:"Filter Operation"}),E.jsx(Uce,{updateFilterOperation:l,value:e.operation})]})]}),E.jsxs("div",{className:"flex grow flex-col space-y-1",role:"container",children:[E.jsx(_n,{className:"text-sm",children:"Values SQL"}),E.jsx(RC,{value:t,onChange:f=>n(f.target.value),className:`min-w-full grow resize font-mono text-xs ${Pd}`})]}),E.jsx("div",{children:E.jsx(Hce,{label:"Local to sheet",onCheckedChange:u,checked:!!e.sheetId})}),E.jsx("div",{className:"flex justify-end gap-2",children:E.jsxs(_r,{onClick:a,size:"sm",variant:"outline",children:[E.jsx(Zf,{className:"mr-2 size-4"}),"Accept"]})})]})]})}function Uce({value:e,updateFilterOperation:t}){return E.jsxs(ts,{defaultValue:"in",value:e,onValueChange:n=>t(n),children:[E.jsx(pi,{className:"h-8 w-[180px] focus:ring-0 focus:ring-offset-0",children:E.jsx(ns,{placeholder:"Operation"})}),E.jsxs(gi,{children:[E.jsx(An,{value:"=",children:"Equals"}),E.jsx(An,{value:"in",children:"Contains"}),E.jsx(An,{value:"like",children:"Like"})]})]})}function JN({filter:e}){const t=Ce(i=>i.isDashboardEditing),{removeFilterValue:n,removeFilter:r,updateFilter:o}=ur();return E.jsx(Ci,{className:"my-1",text:e.title||e.column,onSave:i=>o({...e,title:i}),children:E.jsxs("div",{className:"group mb-1 flex grow items-center justify-between",children:[E.jsxs("div",{className:"flex grow items-center gap-2",children:[E.jsx(_n,{className:"inline-block text-sm",children:e.title}),t&&E.jsx(Wce,{filter:e})]}),E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx("div",{onClick:()=>n(e.id),className:"invisible cursor-pointer text-xs text-muted-foreground hover:text-foreground hover:underline group-hover:visible",children:E.jsx(v_,{className:"size-3.5"})}),t&&E.jsx(uM,{onClick:()=>{n(e.id),r(e.id)},className:"invisible h-3 w-3 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"})]})]})})}var Gce=e=>{switch(e){case"success":return Kce;case"info":return Qce;case"warning":return Xce;case"error":return Jce;default:return null}},qce=Array(12).fill(0),Yce=({visible:e})=>m.createElement("div",{className:"sonner-loading-wrapper","data-visible":e},m.createElement("div",{className:"sonner-spinner"},qce.map((t,n)=>m.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),Kce=m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},m.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Xce=m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},m.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Qce=m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},m.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Jce=m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},m.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Zce=()=>{let[e,t]=m.useState(document.hidden);return m.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},T1=1,eue=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,o=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:T1++,i=this.toasts.find(a=>a.id===o),s=e.dismissible===void 0?!0:e.dismissible;return i?this.toasts=this.toasts.map(a=>a.id===o?(this.publish({...a,...e,id:o,title:n}),{...a,...e,id:o,dismissible:s,title:n}):a):this.addToast({title:n,...r,dismissible:s,id:o}),o},this.dismiss=e=>(e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),o=n!==void 0;return r.then(async i=>{if(nue(i)&&!i.ok){o=!1;let s=typeof t.error=="function"?await t.error(`HTTP error! status: ${i.status}`):t.error,a=typeof t.description=="function"?await t.description(`HTTP error! status: ${i.status}`):t.description;this.create({id:n,type:"error",message:s,description:a})}else if(t.success!==void 0){o=!1;let s=typeof t.success=="function"?await t.success(i):t.success,a=typeof t.description=="function"?await t.description(i):t.description;this.create({id:n,type:"success",message:s,description:a})}}).catch(async i=>{if(t.error!==void 0){o=!1;let s=typeof t.error=="function"?await t.error(i):t.error,a=typeof t.description=="function"?await t.description(i):t.description;this.create({id:n,type:"error",message:s,description:a})}}).finally(()=>{var i;o&&(this.dismiss(n),n=void 0),(i=t.finally)==null||i.call(t)}),n},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||T1++;return this.create({jsx:e(n),id:n,...t}),n},this.subscribers=[],this.toasts=[]}},to=new eue,tue=(e,t)=>{let n=(t==null?void 0:t.id)||T1++;return to.addToast({title:e,...t,id:n}),n},nue=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",rue=tue,oue=()=>to.toasts,ZN=Object.assign(rue,{success:to.success,info:to.info,warning:to.warning,error:to.error,custom:to.custom,message:to.message,promise:to.promise,dismiss:to.dismiss,loading:to.loading},{getHistory:oue});function iue(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}iue(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-bottom))}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;background:var(--gray1);color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:0;right:0;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
406
+ `));let h=u.props,p=typeof(h==null?void 0:h.className)=="function"?(...b)=>fm(h==null?void 0:h.className(...b),l.className):fm(h==null?void 0:h.className,l.className),v=p?{className:p}:{};return m.cloneElement(u,Object.assign({},DN(u.props,O1(hy(l,["ref"]))),f,c,{ref:o(u.ref,c.ref)},v))}return m.createElement(i,Object.assign({},hy(l,["ref"]),i!==m.Fragment&&c,i!==m.Fragment&&f),u)}function yle(...e){return e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function DN(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map(r=>[r,void 0])));for(let r in n)Object.assign(t,{[r](o,...i){let s=n[r];for(let a of s){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;a(o,...i)}}});return t}function Ii(e){var t;return Object.assign(m.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function O1(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function hy(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}let xle="div";var AN=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(AN||{});function wle(e,t){var n;let{features:r=1,...o}=e,i={ref:t,"aria-hidden":(r&2)===2?!0:(n=o["aria-hidden"])!=null?n:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return bs({ourProps:i,theirProps:o,slot:{},defaultTag:xle,name:"Hidden"})}let _le=Ii(wle),wC=m.createContext(null);wC.displayName="OpenClosedContext";var so=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(so||{});function _C(){return m.useContext(wC)}function kN({value:e,children:t}){return m.createElement(wC.Provider,{value:e},t)}function Cle(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let qa=[];Cle(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&qa[0]!==t.target&&(qa.unshift(t.target),qa=qa.filter(n=>n!=null&&n.isConnected),qa.splice(10))}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function Sle(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&Ele(n)?!1:r}function Ele(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}function Rle(e){throw new Error("Unexpected object: "+e)}var jn=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(jn||{});function u2(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),o=r??-1;switch(e.focus){case 0:{for(let i=0;i<n.length;++i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 1:{for(let i=o-1;i>=0;--i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 2:{for(let i=o+1;i<n.length;++i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 3:{for(let i=n.length-1;i>=0;--i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 4:{for(let i=0;i<n.length;++i)if(t.resolveId(n[i],i,n)===e.id)return i;return r}case 5:return null;default:Rle(e)}}function MN(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))NN(n,IN(t,r),o);return n}function IN(e,t){return e?e+"["+t+"]":t}function NN(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())NN(e,IN(t,r.toString()),o);else n instanceof Date?e.push([t,n.toISOString()]):typeof n=="boolean"?e.push([t,n?"1":"0"]):typeof n=="string"?e.push([t,n]):typeof n=="number"?e.push([t,`${n}`]):n==null?e.push([t,""]):MN(n,t,e)}var eo=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(eo||{}),Ple=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Ple||{}),Ole=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(Ole||{}),$le=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))($le||{}),Tle=(e=>(e[e.OpenCombobox=0]="OpenCombobox",e[e.CloseCombobox=1]="CloseCombobox",e[e.GoToOption=2]="GoToOption",e[e.RegisterOption=3]="RegisterOption",e[e.UnregisterOption=4]="UnregisterOption",e[e.RegisterLabel=5]="RegisterLabel",e[e.SetActivationTrigger=6]="SetActivationTrigger",e[e.UpdateVirtualOptions=7]="UpdateVirtualOptions",e))(Tle||{});function py(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=t(e.options.slice()),o=r.length>0&&r[0].dataRef.current.order!==null?r.sort((s,a)=>s.dataRef.current.order-a.dataRef.current.order):cle(r,s=>s.dataRef.current.domRef.current),i=n?o.indexOf(n):null;return i===-1&&(i=null),{options:o,activeOptionIndex:i}}let Dle={1(e){var t;return(t=e.dataRef.current)!=null&&t.disabled||e.comboboxState===1?e:{...e,activeOptionIndex:null,comboboxState:1}},0(e){var t,n;if((t=e.dataRef.current)!=null&&t.disabled||e.comboboxState===0)return e;if((n=e.dataRef.current)!=null&&n.value){let r=e.dataRef.current.calculateIndex(e.dataRef.current.value);if(r!==-1)return{...e,activeOptionIndex:r,comboboxState:0}}return{...e,comboboxState:0}},2(e,t){var n,r,o,i,s;if((n=e.dataRef.current)!=null&&n.disabled||(r=e.dataRef.current)!=null&&r.optionsRef.current&&!((o=e.dataRef.current)!=null&&o.optionsPropsRef.current.static)&&e.comboboxState===1)return e;if(e.virtual){let u=t.focus===jn.Specific?t.idx:u2(t,{resolveItems:()=>e.virtual.options,resolveActiveIndex:()=>{var h,p;return(p=(h=e.activeOptionIndex)!=null?h:e.virtual.options.findIndex(v=>!e.virtual.disabled(v)))!=null?p:null},resolveDisabled:e.virtual.disabled,resolveId(){throw new Error("Function not implemented.")}}),f=(i=t.trigger)!=null?i:2;return e.activeOptionIndex===u&&e.activationTrigger===f?e:{...e,activeOptionIndex:u,activationTrigger:f}}let a=py(e);if(a.activeOptionIndex===null){let u=a.options.findIndex(f=>!f.dataRef.current.disabled);u!==-1&&(a.activeOptionIndex=u)}let l=t.focus===jn.Specific?t.idx:u2(t,{resolveItems:()=>a.options,resolveActiveIndex:()=>a.activeOptionIndex,resolveId:u=>u.id,resolveDisabled:u=>u.dataRef.current.disabled}),c=(s=t.trigger)!=null?s:2;return e.activeOptionIndex===l&&e.activationTrigger===c?e:{...e,...a,activeOptionIndex:l,activationTrigger:c}},3:(e,t)=>{var n,r,o;if((n=e.dataRef.current)!=null&&n.virtual)return{...e,options:[...e.options,t.payload]};let i=t.payload,s=py(e,l=>(l.push(i),l));e.activeOptionIndex===null&&(r=e.dataRef.current)!=null&&r.isSelected(t.payload.dataRef.current.value)&&(s.activeOptionIndex=s.options.indexOf(i));let a={...e,...s,activationTrigger:2};return(o=e.dataRef.current)!=null&&o.__demoMode&&e.dataRef.current.value===void 0&&(a.activeOptionIndex=0),a},4:(e,t)=>{var n;if((n=e.dataRef.current)!=null&&n.virtual)return{...e,options:e.options.filter(o=>o.id!==t.id)};let r=py(e,o=>{let i=o.findIndex(s=>s.id===t.id);return i!==-1&&o.splice(i,1),o});return{...e,...r,activationTrigger:2}},5:(e,t)=>e.labelId===t.id?e:{...e,labelId:t.id},6:(e,t)=>e.activationTrigger===t.trigger?e:{...e,activationTrigger:t.trigger},7:(e,t)=>{var n;if(((n=e.virtual)==null?void 0:n.options)===t.options)return e;let r=e.activeOptionIndex;if(e.activeOptionIndex!==null){let o=t.options.indexOf(e.virtual.options[e.activeOptionIndex]);o!==-1?r=o:r=null}return{...e,activeOptionIndex:r,virtual:Object.assign({},e.virtual,{options:t.options})}}},CC=m.createContext(null);CC.displayName="ComboboxActionsContext";function vh(e){let t=m.useContext(CC);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,vh),n}return t}let LN=m.createContext(null);function Ale(e){var t;let n=Nl("VirtualProvider"),[r,o]=m.useMemo(()=>{let l=n.optionsRef.current;if(!l)return[0,0];let c=window.getComputedStyle(l);return[parseFloat(c.paddingBlockStart||c.paddingTop),parseFloat(c.paddingBlockEnd||c.paddingBottom)]},[n.optionsRef.current]),i=Qae({scrollPaddingStart:r,scrollPaddingEnd:o,count:n.virtual.options.length,estimateSize(){return 40},getScrollElement(){var l;return(l=n.optionsRef.current)!=null?l:null},overscan:12}),[s,a]=m.useState(0);return Bn(()=>{a(l=>l+1)},[(t=n.virtual)==null?void 0:t.options]),m.createElement(LN.Provider,{value:i},m.createElement("div",{style:{position:"relative",width:"100%",height:`${i.getTotalSize()}px`},ref:l=>{if(l){if(typeof process<"u"&&process.env.JEST_WORKER_ID!==void 0||n.activationTrigger===0)return;n.activeOptionIndex!==null&&n.virtual.options.length>n.activeOptionIndex&&i.scrollToIndex(n.activeOptionIndex)}}},i.getVirtualItems().map(l=>{var c;return m.createElement(m.Fragment,{key:l.key},m.cloneElement((c=e.children)==null?void 0:c.call(e,{option:n.virtual.options[l.index],open:n.comboboxState===0}),{key:`${s}-${l.key}`,"data-index":l.index,"aria-setsize":n.virtual.options.length,"aria-posinset":l.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${l.start}px)`,overflowAnchor:"none"}}))})))}let SC=m.createContext(null);SC.displayName="ComboboxDataContext";function Nl(e){let t=m.useContext(SC);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Nl),n}return t}function kle(e,t){return Zn(t.type,Dle,e,t)}let Mle=m.Fragment;function Ile(e,t){let{value:n,defaultValue:r,onChange:o,form:i,name:s,by:a=null,disabled:l=!1,__demoMode:c=!1,nullable:u=!1,multiple:f=!1,immediate:h=!1,virtual:p=null,...v}=e,b=!1,w=null,[y=f?[]:void 0,_]=tle(n,o,r),[C,R]=m.useReducer(kle,{dataRef:m.createRef(),comboboxState:c?0:1,options:[],virtual:null,activeOptionIndex:null,activationTrigger:2,labelId:null}),S=m.useRef(!1),$=m.useRef({static:!1,hold:!1}),O=m.useRef(null),D=m.useRef(null),I=m.useRef(null),L=m.useRef(null),j=Rt(typeof a=="string"?(ee,ie)=>{let me=a;return(ee==null?void 0:ee[me])===(ie==null?void 0:ie[me])}:a??((ee,ie)=>ee===ie)),B=Rt(ee=>C.options.findIndex(ie=>j(ie.dataRef.current.value,ee))),te=m.useCallback(ee=>Zn(F.mode,{1:()=>y.some(ie=>j(ie,ee)),0:()=>j(y,ee)}),[y]),q=Rt(ee=>C.activeOptionIndex===B(ee)),F=m.useMemo(()=>({...C,immediate:b,optionsPropsRef:$,labelRef:O,inputRef:D,buttonRef:I,optionsRef:L,value:y,defaultValue:r,disabled:l,mode:f?1:0,virtual:C.virtual,get activeOptionIndex(){if(S.current&&C.activeOptionIndex===null&&C.options.length>0){let ee=C.options.findIndex(ie=>!ie.dataRef.current.disabled);if(ee!==-1)return ee}return C.activeOptionIndex},calculateIndex:B,compare:j,isSelected:te,isActive:q,nullable:u,__demoMode:c}),[y,r,l,f,u,c,C,w]);Bn(()=>{},[w,void 0]),Bn(()=>{C.dataRef.current=F},[F]),hle([F.buttonRef,F.inputRef,F.optionsRef],()=>ce.closeCombobox(),F.comboboxState===0);let Q=m.useMemo(()=>{var ee,ie,me;return{open:F.comboboxState===0,disabled:l,activeIndex:F.activeOptionIndex,activeOption:F.activeOptionIndex===null?null:F.virtual?F.virtual.options[(ee=F.activeOptionIndex)!=null?ee:0]:(me=(ie=F.options[F.activeOptionIndex])==null?void 0:ie.dataRef.current.value)!=null?me:null,value:y}},[F,l,y]),G=Rt(()=>{if(F.activeOptionIndex!==null){if(F.virtual)M(F.virtual.options[F.activeOptionIndex]);else{let{dataRef:ee}=F.options[F.activeOptionIndex];M(ee.current.value)}ce.goToOption(jn.Specific,F.activeOptionIndex)}}),K=Rt(()=>{R({type:0}),S.current=!0}),W=Rt(()=>{R({type:1}),S.current=!1}),T=Rt((ee,ie,me)=>(S.current=!1,ee===jn.Specific?R({type:2,focus:jn.Specific,idx:ie,trigger:me}):R({type:2,focus:ee,trigger:me}))),H=Rt((ee,ie)=>(R({type:3,payload:{id:ee,dataRef:ie}}),()=>{F.isActive(ie.current.value)&&(S.current=!0),R({type:4,id:ee})})),U=Rt(ee=>(R({type:5,id:ee}),()=>R({type:5,id:null}))),M=Rt(ee=>Zn(F.mode,{0(){return _==null?void 0:_(ee)},1(){let ie=F.value.slice(),me=ie.findIndex(Z=>j(Z,ee));return me===-1?ie.push(ee):ie.splice(me,1),_==null?void 0:_(ie)}})),re=Rt(ee=>{R({type:6,trigger:ee})}),ce=m.useMemo(()=>({onChange:M,registerOption:H,registerLabel:U,goToOption:T,closeCombobox:W,openCombobox:K,setActivationTrigger:re,selectActiveOption:G}),[]),ue=t===null?{}:{ref:t},he=m.useRef(null),J=gh();return m.useEffect(()=>{he.current&&r!==void 0&&J.addEventListener(he.current,"reset",()=>{_==null||_(r)})},[he,_]),m.createElement(CC.Provider,{value:ce},m.createElement(SC.Provider,{value:F},m.createElement(kN,{value:Zn(F.comboboxState,{0:so.Open,1:so.Closed})},s!=null&&y!=null&&MN({[s]:y}).map(([ee,ie],me)=>m.createElement(_le,{features:AN.Hidden,ref:me===0?Z=>{var be;he.current=(be=Z==null?void 0:Z.closest("form"))!=null?be:null}:void 0,...O1({key:ee,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:i,name:ee,value:ie})})),bs({ourProps:ue,theirProps:v,slot:Q,defaultTag:Mle,name:"Combobox"}))))}let Nle="input";function Lle(e,t){var n,r,o,i,s;let a=mh(),{id:l=`headlessui-combobox-input-${a}`,onChange:c,displayValue:u,type:f="text",...h}=e,p=Nl("Combobox.Input"),v=vh("Combobox.Input"),b=Il(p.inputRef,t),w=ple(p.inputRef),y=m.useRef(!1),_=gh(),C=Rt(()=>{v.onChange(null),p.optionsRef.current&&(p.optionsRef.current.scrollTop=0),v.goToOption(jn.Nothing)}),R=function(){var F;return typeof u=="function"&&p.value!==void 0?(F=u(p.value))!=null?F:"":typeof p.value=="string"?p.value:""}();c2(([F,Q],[G,K])=>{if(y.current)return;let W=p.inputRef.current;W&&((K===0&&Q===1||F!==G)&&(W.value=F),requestAnimationFrame(()=>{if(y.current||!W||(w==null?void 0:w.activeElement)!==W)return;let{selectionStart:T,selectionEnd:H}=W;Math.abs((H??0)-(T??0))===0&&T===0&&W.setSelectionRange(W.value.length,W.value.length)}))},[R,p.comboboxState,w]),c2(([F],[Q])=>{if(F===0&&Q===1){if(y.current)return;let G=p.inputRef.current;if(!G)return;let K=G.value,{selectionStart:W,selectionEnd:T,selectionDirection:H}=G;G.value="",G.value=K,H!==null?G.setSelectionRange(W,T,H):G.setSelectionRange(W,T)}},[p.comboboxState]);let S=m.useRef(!1),$=Rt(()=>{S.current=!0}),O=Rt(()=>{_.nextFrame(()=>{S.current=!1})}),D=Rt(F=>{switch(y.current=!0,F.key){case eo.Enter:if(y.current=!1,p.comboboxState!==0||S.current)return;if(F.preventDefault(),F.stopPropagation(),p.activeOptionIndex===null){v.closeCombobox();return}v.selectActiveOption(),p.mode===0&&v.closeCombobox();break;case eo.ArrowDown:return y.current=!1,F.preventDefault(),F.stopPropagation(),Zn(p.comboboxState,{0:()=>v.goToOption(jn.Next),1:()=>v.openCombobox()});case eo.ArrowUp:return y.current=!1,F.preventDefault(),F.stopPropagation(),Zn(p.comboboxState,{0:()=>v.goToOption(jn.Previous),1:()=>{v.openCombobox(),_.nextFrame(()=>{p.value||v.goToOption(jn.Last)})}});case eo.Home:if(F.shiftKey)break;return y.current=!1,F.preventDefault(),F.stopPropagation(),v.goToOption(jn.First);case eo.PageUp:return y.current=!1,F.preventDefault(),F.stopPropagation(),v.goToOption(jn.First);case eo.End:if(F.shiftKey)break;return y.current=!1,F.preventDefault(),F.stopPropagation(),v.goToOption(jn.Last);case eo.PageDown:return y.current=!1,F.preventDefault(),F.stopPropagation(),v.goToOption(jn.Last);case eo.Escape:return y.current=!1,p.comboboxState!==0?void 0:(F.preventDefault(),p.optionsRef.current&&!p.optionsPropsRef.current.static&&F.stopPropagation(),p.nullable&&p.mode===0&&p.value===null&&C(),v.closeCombobox());case eo.Tab:if(y.current=!1,p.comboboxState!==0)return;p.mode===0&&p.activationTrigger!==1&&v.selectActiveOption(),v.closeCombobox();break}}),I=Rt(F=>{c==null||c(F),p.nullable&&p.mode===0&&F.target.value===""&&C(),v.openCombobox()}),L=Rt(F=>{var Q,G,K;let W=(Q=F.relatedTarget)!=null?Q:qa.find(T=>T!==F.currentTarget);if(y.current=!1,!((G=p.optionsRef.current)!=null&&G.contains(W))&&!((K=p.buttonRef.current)!=null&&K.contains(W))&&p.comboboxState===0)return F.preventDefault(),p.mode===0&&(p.nullable&&p.value===null?C():p.activationTrigger!==1&&v.selectActiveOption()),v.closeCombobox()}),j=Rt(F=>{var Q,G,K;let W=(Q=F.relatedTarget)!=null?Q:qa.find(T=>T!==F.currentTarget);(G=p.buttonRef.current)!=null&&G.contains(W)||(K=p.optionsRef.current)!=null&&K.contains(W)||p.disabled||p.immediate&&p.comboboxState!==0&&(v.openCombobox(),_.nextFrame(()=>{v.setActivationTrigger(1)}))}),B=bC(()=>{if(p.labelId)return[p.labelId].join(" ")},[p.labelId]),te=m.useMemo(()=>({open:p.comboboxState===0,disabled:p.disabled}),[p]),q={ref:b,id:l,role:"combobox",type:f,"aria-controls":(n=p.optionsRef.current)==null?void 0:n.id,"aria-expanded":p.comboboxState===0,"aria-activedescendant":p.activeOptionIndex===null?void 0:p.virtual?(r=p.options.find(F=>{var Q;return!((Q=p.virtual)!=null&&Q.disabled(F.dataRef.current.value))&&p.compare(F.dataRef.current.value,p.virtual.options[p.activeOptionIndex])}))==null?void 0:r.id:(o=p.options[p.activeOptionIndex])==null?void 0:o.id,"aria-labelledby":B,"aria-autocomplete":"list",defaultValue:(s=(i=e.defaultValue)!=null?i:p.defaultValue!==void 0?u==null?void 0:u(p.defaultValue):null)!=null?s:p.defaultValue,disabled:p.disabled,onCompositionStart:$,onCompositionEnd:O,onKeyDown:D,onChange:I,onFocus:j,onBlur:L};return bs({ourProps:q,theirProps:h,slot:te,defaultTag:Nle,name:"Combobox.Input"})}let Fle="button";function jle(e,t){var n;let r=Nl("Combobox.Button"),o=vh("Combobox.Button"),i=Il(r.buttonRef,t),s=mh(),{id:a=`headlessui-combobox-button-${s}`,...l}=e,c=gh(),u=Rt(b=>{switch(b.key){case eo.ArrowDown:return b.preventDefault(),b.stopPropagation(),r.comboboxState===1&&o.openCombobox(),c.nextFrame(()=>{var w;return(w=r.inputRef.current)==null?void 0:w.focus({preventScroll:!0})});case eo.ArrowUp:return b.preventDefault(),b.stopPropagation(),r.comboboxState===1&&(o.openCombobox(),c.nextFrame(()=>{r.value||o.goToOption(jn.Last)})),c.nextFrame(()=>{var w;return(w=r.inputRef.current)==null?void 0:w.focus({preventScroll:!0})});case eo.Escape:return r.comboboxState!==0?void 0:(b.preventDefault(),r.optionsRef.current&&!r.optionsPropsRef.current.static&&b.stopPropagation(),o.closeCombobox(),c.nextFrame(()=>{var w;return(w=r.inputRef.current)==null?void 0:w.focus({preventScroll:!0})}));default:return}}),f=Rt(b=>{if(Sle(b.currentTarget))return b.preventDefault();r.comboboxState===0?o.closeCombobox():(b.preventDefault(),o.openCombobox()),c.nextFrame(()=>{var w;return(w=r.inputRef.current)==null?void 0:w.focus({preventScroll:!0})})}),h=bC(()=>{if(r.labelId)return[r.labelId,a].join(" ")},[r.labelId,a]),p=m.useMemo(()=>({open:r.comboboxState===0,disabled:r.disabled,value:r.value}),[r]),v={ref:i,id:a,type:gle(e,r.buttonRef),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":(n=r.optionsRef.current)==null?void 0:n.id,"aria-expanded":r.comboboxState===0,"aria-labelledby":h,disabled:r.disabled,onClick:f,onKeyDown:u};return bs({ourProps:v,theirProps:l,slot:p,defaultTag:Fle,name:"Combobox.Button"})}let zle="label";function Ble(e,t){let n=mh(),{id:r=`headlessui-combobox-label-${n}`,...o}=e,i=Nl("Combobox.Label"),s=vh("Combobox.Label"),a=Il(i.labelRef,t);Bn(()=>s.registerLabel(r),[r]);let l=Rt(()=>{var u;return(u=i.inputRef.current)==null?void 0:u.focus({preventScroll:!0})}),c=m.useMemo(()=>({open:i.comboboxState===0,disabled:i.disabled}),[i]);return bs({ourProps:{ref:a,id:r,onClick:l},theirProps:o,slot:c,defaultTag:zle,name:"Combobox.Label"})}let Vle="ul",Hle=hm.RenderStrategy|hm.Static;function Wle(e,t){let n=mh(),{id:r=`headlessui-combobox-options-${n}`,hold:o=!1,...i}=e,s=Nl("Combobox.Options"),a=Il(s.optionsRef,t),l=_C(),c=l!==null?(l&so.Open)===so.Open:s.comboboxState===0;Bn(()=>{var p;s.optionsPropsRef.current.static=(p=e.static)!=null?p:!1},[s.optionsPropsRef,e.static]),Bn(()=>{s.optionsPropsRef.current.hold=o},[s.optionsPropsRef,o]),ble({container:s.optionsRef.current,enabled:s.comboboxState===0,accept(p){return p.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:p.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(p){p.setAttribute("role","none")}});let u=bC(()=>{var p,v;return(v=s.labelId)!=null?v:(p=s.buttonRef.current)==null?void 0:p.id},[s.labelId,s.buttonRef.current]),f=m.useMemo(()=>({open:s.comboboxState===0,option:void 0}),[s]),h={"aria-labelledby":u,role:"listbox","aria-multiselectable":s.mode===1?!0:void 0,id:r,ref:a};return s.virtual&&s.comboboxState===0&&Object.assign(i,{children:m.createElement(Ale,null,i.children)}),bs({ourProps:h,theirProps:i,slot:f,defaultTag:Vle,features:Hle,visible:c,name:"Combobox.Options"})}let Ule="li";function Gle(e,t){var n;let r=mh(),{id:o=`headlessui-combobox-option-${r}`,disabled:i=!1,value:s,order:a=null,...l}=e,c=Nl("Combobox.Option"),u=vh("Combobox.Option"),f=c.virtual?c.activeOptionIndex===c.calculateIndex(s):c.activeOptionIndex===null?!1:((n=c.options[c.activeOptionIndex])==null?void 0:n.id)===o,h=c.isSelected(s),p=m.useRef(null),v=Ri({disabled:i,value:s,domRef:p,order:a}),b=m.useContext(LN),w=Il(t,p,b?b.measureElement:null),y=Rt(()=>u.onChange(s));Bn(()=>u.registerOption(o,v),[v,o]);let _=m.useRef(!(c.virtual||c.__demoMode));Bn(()=>{if(!c.virtual||!c.__demoMode)return;let L=Cl();return L.requestAnimationFrame(()=>{_.current=!0}),L.dispose},[c.virtual,c.__demoMode]),Bn(()=>{if(!_.current||c.comboboxState!==0||!f||c.activationTrigger===0)return;let L=Cl();return L.requestAnimationFrame(()=>{var j,B;(B=(j=p.current)==null?void 0:j.scrollIntoView)==null||B.call(j,{block:"nearest"})}),L.dispose},[p,f,c.comboboxState,c.activationTrigger,c.activeOptionIndex]);let C=Rt(L=>{var j;if(i||(j=c.virtual)!=null&&j.disabled(s))return L.preventDefault();y(),TN()||requestAnimationFrame(()=>{var B;return(B=c.inputRef.current)==null?void 0:B.focus({preventScroll:!0})}),c.mode===0&&requestAnimationFrame(()=>u.closeCombobox())}),R=Rt(()=>{var L;if(i||(L=c.virtual)!=null&&L.disabled(s))return u.goToOption(jn.Nothing);let j=c.calculateIndex(s);u.goToOption(jn.Specific,j)}),S=vle(),$=Rt(L=>S.update(L)),O=Rt(L=>{var j;if(!S.wasMoved(L)||i||(j=c.virtual)!=null&&j.disabled(s)||f)return;let B=c.calculateIndex(s);u.goToOption(jn.Specific,B,0)}),D=Rt(L=>{var j;S.wasMoved(L)&&(i||(j=c.virtual)!=null&&j.disabled(s)||f&&(c.optionsPropsRef.current.hold||u.goToOption(jn.Nothing)))}),I=m.useMemo(()=>({active:f,selected:h,disabled:i}),[f,h,i]);return bs({ourProps:{id:o,ref:w,role:"option",tabIndex:i===!0?void 0:-1,"aria-disabled":i===!0?!0:void 0,"aria-selected":h,disabled:void 0,onClick:C,onFocus:R,onPointerEnter:$,onMouseEnter:$,onPointerMove:O,onMouseMove:O,onPointerLeave:D,onMouseLeave:D},theirProps:l,slot:I,defaultTag:Ule,name:"Combobox.Option"})}let qle=Ii(Ile),Yle=Ii(jle),Kle=Ii(Lle),Xle=Ii(Ble),Qle=Ii(Wle),Jle=Ii(Gle),fc=Object.assign(qle,{Input:Kle,Button:Yle,Label:Xle,Options:Qle,Option:Jle});function EC(){let e=m.useRef(!1);return Bn(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function Zle(e=0){let[t,n]=m.useState(e),r=EC(),o=m.useCallback(l=>{r.current&&n(c=>c|l)},[t,r]),i=m.useCallback(l=>!!(t&l),[t]),s=m.useCallback(l=>{r.current&&n(c=>c&~l)},[n,r]),a=m.useCallback(l=>{r.current&&n(c=>c^l)},[n]);return{flags:t,addFlag:o,hasFlag:i,removeFlag:s,toggleFlag:a}}function ece(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function gy(e,...t){e&&t.length>0&&e.classList.add(...t)}function my(e,...t){e&&t.length>0&&e.classList.remove(...t)}function tce(e,t){let n=Cl();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:o}=getComputedStyle(e),[i,s]=[r,o].map(l=>{let[c=0]=l.split(",").filter(Boolean).map(u=>u.includes("ms")?parseFloat(u):parseFloat(u)*1e3).sort((u,f)=>f-u);return c}),a=i+s;if(a!==0){n.group(c=>{c.setTimeout(()=>{t(),c.dispose()},a),c.addEventListener(e,"transitionrun",u=>{u.target===u.currentTarget&&c.dispose()})});let l=n.addEventListener(e,"transitionend",c=>{c.target===c.currentTarget&&(t(),l())})}else t();return n.add(()=>t()),n.dispose}function nce(e,t,n,r){let o=n?"enter":"leave",i=Cl(),s=r!==void 0?ece(r):()=>{};o==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let a=Zn(o,{enter:()=>t.enter,leave:()=>t.leave}),l=Zn(o,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),c=Zn(o,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return my(e,...t.base,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),gy(e,...t.base,...a,...c),i.nextFrame(()=>{my(e,...t.base,...a,...c),gy(e,...t.base,...a,...l),tce(e,()=>(my(e,...t.base,...a),gy(e,...t.base,...t.entered),s()))}),i.dispose}function rce({immediate:e,container:t,direction:n,classes:r,onStart:o,onStop:i}){let s=EC(),a=gh(),l=Ri(n);Bn(()=>{e&&(l.current="enter")},[e]),Bn(()=>{let c=Cl();a.add(c.dispose);let u=t.current;if(u&&l.current!=="idle"&&s.current)return c.dispose(),o.current(l.current),c.add(nce(u,r.current,l.current==="enter",()=>{c.dispose(),i.current(l.current)})),c.dispose},[n])}function js(e=""){return e.split(/\s+/).filter(t=>t.length>1)}let Pv=m.createContext(null);Pv.displayName="TransitionContext";var oce=(e=>(e.Visible="visible",e.Hidden="hidden",e))(oce||{});function ice(){let e=m.useContext(Pv);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function sce(){let e=m.useContext(Ov);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Ov=m.createContext(null);Ov.displayName="NestingContext";function $v(e){return"children"in e?$v(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function FN(e,t){let n=Ri(e),r=m.useRef([]),o=EC(),i=gh(),s=Rt((p,v=ia.Hidden)=>{let b=r.current.findIndex(({el:w})=>w===p);b!==-1&&(Zn(v,{[ia.Unmount](){r.current.splice(b,1)},[ia.Hidden](){r.current[b].state="hidden"}}),i.microTask(()=>{var w;!$v(r)&&o.current&&((w=n.current)==null||w.call(n))}))}),a=Rt(p=>{let v=r.current.find(({el:b})=>b===p);return v?v.state!=="visible"&&(v.state="visible"):r.current.push({el:p,state:"visible"}),()=>s(p,ia.Unmount)}),l=m.useRef([]),c=m.useRef(Promise.resolve()),u=m.useRef({enter:[],leave:[],idle:[]}),f=Rt((p,v,b)=>{l.current.splice(0),t&&(t.chains.current[v]=t.chains.current[v].filter(([w])=>w!==p)),t==null||t.chains.current[v].push([p,new Promise(w=>{l.current.push(w)})]),t==null||t.chains.current[v].push([p,new Promise(w=>{Promise.all(u.current[v].map(([y,_])=>_)).then(()=>w())})]),v==="enter"?c.current=c.current.then(()=>t==null?void 0:t.wait.current).then(()=>b(v)):b(v)}),h=Rt((p,v,b)=>{Promise.all(u.current[v].splice(0).map(([w,y])=>y)).then(()=>{var w;(w=l.current.shift())==null||w()}).then(()=>b(v))});return m.useMemo(()=>({children:r,register:a,unregister:s,onStart:f,onStop:h,wait:c,chains:u}),[a,s,r,f,h,u,c])}function ace(){}let lce=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function d2(e){var t;let n={};for(let r of lce)n[r]=(t=e[r])!=null?t:ace;return n}function cce(e){let t=m.useRef(d2(e));return m.useEffect(()=>{t.current=d2(e)},[e]),t}let uce="div",jN=hm.RenderStrategy;function dce(e,t){var n,r;let{beforeEnter:o,afterEnter:i,beforeLeave:s,afterLeave:a,enter:l,enterFrom:c,enterTo:u,entered:f,leave:h,leaveFrom:p,leaveTo:v,...b}=e,w=m.useRef(null),y=Il(w,t),_=(n=b.unmount)==null||n?ia.Unmount:ia.Hidden,{show:C,appear:R,initial:S}=ice(),[$,O]=m.useState(C?"visible":"hidden"),D=sce(),{register:I,unregister:L}=D;m.useEffect(()=>I(w),[I,w]),m.useEffect(()=>{if(_===ia.Hidden&&w.current){if(C&&$!=="visible"){O("visible");return}return Zn($,{hidden:()=>L(w),visible:()=>I(w)})}},[$,w,I,L,C,_]);let j=Ri({base:js(b.className),enter:js(l),enterFrom:js(c),enterTo:js(u),entered:js(f),leave:js(h),leaveFrom:js(p),leaveTo:js(v)}),B=cce({beforeEnter:o,afterEnter:i,beforeLeave:s,afterLeave:a}),te=yC();m.useEffect(()=>{if(te&&$==="visible"&&w.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[w,$,te]);let q=S&&!R,F=R&&C&&S,Q=!te||q?"idle":C?"enter":"leave",G=Zle(0),K=Rt(re=>Zn(re,{enter:()=>{G.addFlag(so.Opening),B.current.beforeEnter()},leave:()=>{G.addFlag(so.Closing),B.current.beforeLeave()},idle:()=>{}})),W=Rt(re=>Zn(re,{enter:()=>{G.removeFlag(so.Opening),B.current.afterEnter()},leave:()=>{G.removeFlag(so.Closing),B.current.afterLeave()},idle:()=>{}})),T=FN(()=>{O("hidden"),L(w)},D),H=m.useRef(!1);rce({immediate:F,container:w,classes:j,direction:Q,onStart:Ri(re=>{H.current=!0,T.onStart(w,re,K)}),onStop:Ri(re=>{H.current=!1,T.onStop(w,re,W),re==="leave"&&!$v(T)&&(O("hidden"),L(w))})});let U=b,M={ref:y};return F?U={...U,className:fm(b.className,...j.current.enter,...j.current.enterFrom)}:H.current&&(U.className=fm(b.className,(r=w.current)==null?void 0:r.className),U.className===""&&delete U.className),m.createElement(Ov.Provider,{value:T},m.createElement(kN,{value:Zn($,{visible:so.Open,hidden:so.Closed})|G.flags},bs({ourProps:M,theirProps:U,defaultTag:uce,features:jN,visible:$==="visible",name:"Transition.Child"})))}function fce(e,t){let{show:n,appear:r=!1,unmount:o=!0,...i}=e,s=m.useRef(null),a=Il(s,t);yC();let l=_C();if(n===void 0&&l!==null&&(n=(l&so.Open)===so.Open),![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,u]=m.useState(n?"visible":"hidden"),f=FN(()=>{u("hidden")}),[h,p]=m.useState(!0),v=m.useRef([n]);Bn(()=>{h!==!1&&v.current[v.current.length-1]!==n&&(v.current.push(n),p(!1))},[v,n]);let b=m.useMemo(()=>({show:n,appear:r,initial:h}),[n,r,h]);m.useEffect(()=>{if(n)u("visible");else if(!$v(f))u("hidden");else{let C=s.current;if(!C)return;let R=C.getBoundingClientRect();R.x===0&&R.y===0&&R.width===0&&R.height===0&&u("hidden")}},[n,f]);let w={unmount:o},y=Rt(()=>{var C;h&&p(!1),(C=e.beforeEnter)==null||C.call(e)}),_=Rt(()=>{var C;h&&p(!1),(C=e.beforeLeave)==null||C.call(e)});return m.createElement(Ov.Provider,{value:f},m.createElement(Pv.Provider,{value:b},bs({ourProps:{...w,as:m.Fragment,children:m.createElement(zN,{ref:a,...w,...i,beforeEnter:y,beforeLeave:_})},theirProps:{},defaultTag:m.Fragment,features:jN,visible:c==="visible",name:"Transition"})))}function hce(e,t){let n=m.useContext(Pv)!==null,r=_C()!==null;return m.createElement(m.Fragment,null,!n&&r?m.createElement($1,{ref:t,...e}):m.createElement(zN,{ref:t,...e}))}let $1=Ii(fce),zN=Ii(dce),pce=Ii(hce),gce=Object.assign($1,{Child:pce,Root:$1});function mce(e){const t=/(>=|<=|>|<|=)/,n=e.match(t);if(n){const r=n[0],[o,i]=e.split(r);return{operation:r,value:i.trim()}}else return null}function vce(e,t,n){const r=`SELECT ${n}, COUNT(*) FROM ${t} {{ filters | where }} GROUP BY ${n} ORDER BY ${n} ASC LIMIT 50`,o=`SELECT min(${n}) as min, max(${n}) as max FROM ${t} {{ filters | where }}`;return vu.includes(e)?o:r}function bce({filter:e}){const[t,n]=m.useState([]),[r,o]=m.useState(""),[i,s]=m.useState(""),a=m.useRef(null);ni();const l=Ce(O=>O.filterValues),c=Ce(O=>O.selectedSheetId),u=Ce(O=>O.actions.addOrUpdateFilterValue),f=Ce(O=>O.actions.removeFilterValue),{data:h,isLoading:p,isFetching:v,isError:b,refetch:w}=PN(e),y=m.useMemo(()=>{var O;return(O=h==null?void 0:h.records)==null?void 0:O.map(D=>{let I=e.column.split(".").slice(-1)[0].replace(/"/g,"");return D[I]===void 0&&(I=I.toLowerCase()),{id:D[I],value:D[I]}})},[h,e.column]);m.useEffect(()=>{if(l){const O=l.find(D=>D.filterId===e.id);if(!O){n([]);return}if(O.operation==="in"){const D=y==null?void 0:y.filter(I=>O.values.includes(I.value));D&&n(D)}else o(`${O.operation} ${O.values[0]}`)}},[h,c,l]),m.useEffect(()=>{if(l&&!l.find(D=>D.filterId===e.id)){n([]);return}},[l,e.id]);function _(O){const D=mce(O[0].toString());if(!(D!=null&&D.value)||!(D!=null&&D.operation))return;const I={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:Gd(e),name:e.column,operation:D.operation,values:[Number(D.value)]};u(I)}function C(O){if(Array.isArray(O)||(O=[O]),console.log("onComboBoxChange",O),O.length===1&&y.find(I=>I.value===O[0].value)===void 0){_(O);return}if(n(O),O.length===0){f(e.id);return}const D={filterId:e.id,connectionType:e.database==="NA"?"api":"database",name:e.column,valueType:Gd(e),operation:e.operation,values:O.map(I=>I.value)};u(D)}function R(){var O;o(""),f(e.id),console.log(e.id),(O=a.current)==null||O.click()}if(p)return E.jsx("div",{children:E.jsx(km,{className:"h-8 w-full bg-foreground/10"})});if(b)return E.jsx("div",{className:"flex h-8 w-full items-center bg-muted px-2 text-sm",children:"Error"});let S=[];tu.includes(e.dataType)?S=y:S=i===""?y:y==null?void 0:y.filter(O=>O.value.toLowerCase().replace(/\s+/g,"").includes(i.toLowerCase().replace(/\s+/g,"")));const $=e.type==="single";return E.jsx("div",{className:"w-full",children:E.jsx(fc,{value:t,multiple:!$,onChange:C,children:E.jsxs("div",{className:"relative",children:[E.jsxs("div",{className:"relative w-full cursor-default overflow-hidden rounded-sm border bg-background text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-background/75 focus-visible:ring-offset-2 sm:text-sm",children:[E.jsx(fc.Input,{className:"flex h-8 w-full rounded border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50",displayValue:O=>O.map(I=>I.value).join(", ")||r,onChange:O=>{o(O.target.value),s(O.target.value)}}),E.jsx(fc.Button,{ref:a,className:"absolute inset-y-0 right-0 flex items-center bg-background pl-1 pr-2",children:E.jsx(CJ,{className:"h-5 w-5 text-gray-400","aria-hidden":"true"})})]}),E.jsx(gce,{as:m.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",afterLeave:()=>s(""),children:E.jsxs(fc.Options,{className:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-sm border bg-background py-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-none sm:text-sm",children:[tu.includes(e.dataType)&&E.jsxs(fc.Option,{value:r,className:"flex items-center justify-between gap-2 px-3 py-2",children:[E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx("span",{className:"font-thin",children:"#"}),E.jsx("span",{children:r})]}),r&&E.jsx(_r,{variant:"link",className:"h-4 w-3 cursor-pointer text-foreground/50 hover:text-foreground/100",onClick:O=>{O.stopPropagation(),R()},children:"Clear"})]},"custom"),(S==null?void 0:S.length)===0&&i!==""?E.jsx("div",{className:"relative cursor-default select-none px-4 py-2 text-gray-700",children:"Nothing found."}):S==null?void 0:S.map(O=>E.jsx(fc.Option,{className:({active:D})=>`relative cursor-default select-none border-b border-muted py-2 pl-10 pr-4 ${D?"bg-muted":"text-foreground-900"}`,value:O,children:({selected:D,active:I})=>E.jsxs("div",{className:"",children:[E.jsx("span",{className:`block ${D?"font-medium":"font-normal"}`,children:typeof O.value=="boolean"?O.value?"True":"False":O.value}),D?E.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 text-foreground",children:E.jsx(qk,{className:"h-5 w-5","aria-hidden":"true"})}):null]})},O.value))]})})]})})})}const RC=N.forwardRef(({className:e,...t},n)=>E.jsx("textarea",{className:xe("flex min-h-[80px] 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 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));RC.displayName="Textarea";const BN="Radio",[yce,VN]=tr(BN),[xce,wce]=yce(BN),_ce=m.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:i,disabled:s,value:a="on",onCheck:l,...c}=e,[u,f]=m.useState(null),h=Ct(t,b=>f(b)),p=m.useRef(!1),v=u?!!u.closest("form"):!0;return m.createElement(xce,{scope:n,checked:o,disabled:s},m.createElement(Qe.button,de({type:"button",role:"radio","aria-checked":o,"data-state":HN(o),"data-disabled":s?"":void 0,disabled:s,value:a},c,{ref:h,onClick:Me(e.onClick,b=>{o||l==null||l(),v&&(p.current=b.isPropagationStopped(),p.current||b.stopPropagation())})})),v&&m.createElement(Ece,{control:u,bubbles:!p.current,name:r,value:a,checked:o,required:i,disabled:s,style:{transform:"translateX(-100%)"}}))}),Cce="RadioIndicator",Sce=m.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,i=wce(Cce,n);return m.createElement(nr,{present:r||i.checked},m.createElement(Qe.span,de({"data-state":HN(i.checked),"data-disabled":i.disabled?"":void 0},o,{ref:t})))}),Ece=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),s=fv(n),a=av(t);return m.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const h=new Event("click",{bubbles:r});f.call(l,n),l.dispatchEvent(h)}},[s,n,r]),m.createElement("input",de({type:"radio","aria-hidden":!0,defaultChecked:n},o,{tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function HN(e){return e?"checked":"unchecked"}const Rce=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],WN="RadioGroup",[Pce,q1e]=tr(WN,[yu,VN]),UN=yu(),GN=VN(),[Oce,$ce]=Pce(WN),Tce=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:i,required:s=!1,disabled:a=!1,orientation:l,dir:c,loop:u=!0,onValueChange:f,...h}=e,p=UN(n),v=$l(c),[b,w]=Cr({prop:i,defaultProp:o,onChange:f});return m.createElement(Oce,{scope:n,name:r,required:s,disabled:a,value:b,onValueChange:w},m.createElement(_w,de({asChild:!0},p,{orientation:l,dir:v,loop:u}),m.createElement(Qe.div,de({role:"radiogroup","aria-required":s,"aria-orientation":l,"data-disabled":a?"":void 0,dir:v},h,{ref:t}))))}),Dce="RadioGroupItem",Ace=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,i=$ce(Dce,n),s=i.disabled||r,a=UN(n),l=GN(n),c=m.useRef(null),u=Ct(t,c),f=i.value===o.value,h=m.useRef(!1);return m.useEffect(()=>{const p=b=>{Rce.includes(b.key)&&(h.current=!0)},v=()=>h.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",v),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",v)}},[]),m.createElement(Cw,de({asChild:!0},a,{focusable:!s,active:f}),m.createElement(_ce,de({disabled:s,required:i.required,checked:f},l,o,{name:i.name,ref:u,onCheck:()=>i.onValueChange(o.value),onKeyDown:Me(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:Me(o.onFocus,()=>{var p;h.current&&((p=c.current)===null||p===void 0||p.click())})})))}),kce=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=GN(n);return m.createElement(Sce,de({},o,r,{ref:t}))}),qN=Tce,YN=Ace,Mce=kce,PC=N.forwardRef(({className:e,...t},n)=>E.jsx(qN,{className:xe("grid gap-2",e),...t,ref:n}));PC.displayName=qN.displayName;const pm=N.forwardRef(({className:e,...t},n)=>E.jsx(YN,{ref:n,className:xe("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:E.jsx(Mce,{className:"flex items-center justify-center",children:E.jsx(m_,{className:"h-2.5 w-2.5 fill-current text-current"})})}));pm.displayName=YN.displayName;const KN="Checkbox",[Ice,Y1e]=tr(KN),[Nce,Lce]=Ice(KN),Fce=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:c,...u}=e,[f,h]=m.useState(null),p=Ct(t,C=>h(C)),v=m.useRef(!1),b=f?!!f.closest("form"):!0,[w=!1,y]=Cr({prop:o,defaultProp:i,onChange:c}),_=m.useRef(w);return m.useEffect(()=>{const C=f==null?void 0:f.form;if(C){const R=()=>y(_.current);return C.addEventListener("reset",R),()=>C.removeEventListener("reset",R)}},[f,y]),m.createElement(Nce,{scope:n,state:w,disabled:a},m.createElement(Qe.button,de({type:"button",role:"checkbox","aria-checked":pl(w)?"mixed":w,"aria-required":s,"data-state":XN(w),"data-disabled":a?"":void 0,disabled:a,value:l},u,{ref:p,onKeyDown:Me(e.onKeyDown,C=>{C.key==="Enter"&&C.preventDefault()}),onClick:Me(e.onClick,C=>{y(R=>pl(R)?!0:!R),b&&(v.current=C.isPropagationStopped(),v.current||C.stopPropagation())})})),b&&m.createElement(Bce,{control:f,bubbles:!v.current,name:r,value:l,checked:w,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),jce="CheckboxIndicator",zce=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,i=Lce(jce,n);return m.createElement(nr,{present:r||pl(i.state)||i.state===!0},m.createElement(Qe.span,de({"data-state":XN(i.state),"data-disabled":i.disabled?"":void 0},o,{ref:t,style:{pointerEvents:"none",...e.style}})))}),Bce=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),s=fv(n),a=av(t);return m.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const h=new Event("click",{bubbles:r});l.indeterminate=pl(n),f.call(l,pl(n)?!1:n),l.dispatchEvent(h)}},[s,n,r]),m.createElement("input",de({type:"checkbox","aria-hidden":!0,defaultChecked:pl(n)?!1:n},o,{tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function pl(e){return e==="indeterminate"}function XN(e){return pl(e)?"indeterminate":e?"checked":"unchecked"}const QN=Fce,Vce=zce,OC=N.forwardRef(({className:e,...t},n)=>E.jsx(QN,{ref:n,className:xe("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:E.jsx(Vce,{className:xe("flex items-center justify-center text-current"),children:E.jsx(Zf,{className:"h-4 w-4"})})}));OC.displayName=QN.displayName;function Hce({label:e,onCheckedChange:t,checked:n}){return E.jsxs("div",{className:"flex items-center space-x-2",children:[E.jsx(OC,{onCheckedChange:t,id:"terms",checked:n}),E.jsx("label",{htmlFor:"terms",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:e})]})}function Wce({filter:e}){const[t,n]=m.useState(e.sql),[r,o]=m.useState(!1),i=Ce(f=>f.selectedSheetId),{updateFilter:s}=ur();function a(){const f={...e,sql:t};s(f),o(!1)}function l(f){console.log("operation",f);const h={...e,operation:f};s(h)}function c(f){const h={...e,type:f};s(h)}function u(f){if(!i)return;const h={...e,sheetId:f?i:void 0};s(h)}return E.jsxs(xv,{open:r,onOpenChange:o,children:[E.jsx(wv,{children:E.jsx(y_,{className:"invisible h-3 w-3 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"})}),E.jsxs(ch,{onMouseDown:f=>f.stopPropagation(),onDoubleClick:f=>f.stopPropagation(),className:"z-50 m-2 w-full min-w-[350px] space-y-4",children:[E.jsxs("div",{className:"space-y-2",children:[E.jsxs("div",{className:"flex items-center gap-3",children:[E.jsx("h4",{className:"font-medium leading-none",children:"Customize Filter"}),E.jsx("p",{className:"rounded-md bg-muted px-2 py-1 text-xs text-muted-foreground",children:e.column})]}),E.jsx("p",{className:"text-sm text-muted-foreground",children:"Customize the filter operation and SQL"})]}),E.jsx(uh,{}),E.jsxs("div",{className:"space-y-2",children:[E.jsx(_n,{children:"Type"}),E.jsxs(PC,{onValueChange:c,value:e.type||"multiple",className:"flex gap-3",defaultValue:"x",children:[E.jsxs("div",{className:"flex items-center space-x-2",children:[E.jsx(pm,{value:"multiple",id:"r1"}),E.jsx("label",{className:"text-sm",htmlFor:"r1",children:"Multiple"})]}),E.jsxs("div",{className:"flex items-center space-x-2",children:[E.jsx(pm,{value:"single",id:"r2"}),E.jsx("label",{className:"text-sm",htmlFor:"r2",children:"Single"})]})]})]}),E.jsxs("div",{className:"grid grid-cols-6 gap-4 text-sm",children:[E.jsxs("div",{className:"col-span-2 space-y-1",children:[E.jsx(_n,{children:"Table Column"}),E.jsx(_n,{className:"block rounded-md bg-muted p-2 font-mono text-xs",children:e.column})]}),E.jsxs("div",{className:"col-span-2 space-y-1",children:[E.jsx(_n,{children:"Data Type"}),E.jsx(_n,{className:"block rounded-md bg-muted p-2 font-mono text-xs",children:e.dataType})]}),E.jsxs("div",{className:"col-span-2 space-y-1",children:[E.jsx(_n,{className:"text-sm",children:"Filter Operation"}),E.jsx(Uce,{updateFilterOperation:l,value:e.operation})]})]}),E.jsxs("div",{className:"flex grow flex-col space-y-1",role:"container",children:[E.jsx(_n,{className:"text-sm",children:"Values SQL"}),E.jsx(RC,{onKeyDown:f=>{f.stopPropagation()},value:t,onChange:f=>n(f.target.value),className:`min-w-full grow resize font-mono text-xs ${Pd}`})]}),E.jsx("div",{children:E.jsx(Hce,{label:"Local to sheet",onCheckedChange:u,checked:!!e.sheetId})}),E.jsx("div",{className:"flex justify-end gap-2",children:E.jsxs(_r,{onClick:a,size:"sm",variant:"outline",children:[E.jsx(Zf,{className:"mr-2 size-4"}),"Accept"]})})]})]})}function Uce({value:e,updateFilterOperation:t}){return E.jsxs(ts,{defaultValue:"in",value:e,onValueChange:n=>t(n),children:[E.jsx(pi,{className:"h-8 w-[180px] focus:ring-0 focus:ring-offset-0",children:E.jsx(ns,{placeholder:"Operation"})}),E.jsxs(gi,{children:[E.jsx(An,{value:"=",children:"Equals"}),E.jsx(An,{value:"in",children:"Contains"}),E.jsx(An,{value:"like",children:"Like"})]})]})}function JN({filter:e}){const t=Ce(i=>i.isDashboardEditing),{removeFilterValue:n,removeFilter:r,updateFilter:o}=ur();return E.jsx(Ci,{className:"my-1",text:e.title||e.column,onSave:i=>o({...e,title:i}),children:E.jsxs("div",{className:"group mb-1 flex grow items-center justify-between",children:[E.jsxs("div",{className:"flex grow items-center gap-2",children:[E.jsx(_n,{className:"inline-block text-sm",children:e.title}),t&&E.jsx(Wce,{filter:e})]}),E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx("div",{onClick:()=>n(e.id),className:"invisible cursor-pointer text-xs text-muted-foreground hover:text-foreground hover:underline group-hover:visible",children:E.jsx(v_,{className:"size-3.5"})}),t&&E.jsx(uM,{onClick:()=>{n(e.id),r(e.id)},className:"invisible h-3 w-3 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"})]})]})})}var Gce=e=>{switch(e){case"success":return Kce;case"info":return Qce;case"warning":return Xce;case"error":return Jce;default:return null}},qce=Array(12).fill(0),Yce=({visible:e})=>m.createElement("div",{className:"sonner-loading-wrapper","data-visible":e},m.createElement("div",{className:"sonner-spinner"},qce.map((t,n)=>m.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),Kce=m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},m.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Xce=m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},m.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Qce=m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},m.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Jce=m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},m.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Zce=()=>{let[e,t]=m.useState(document.hidden);return m.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},T1=1,eue=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,o=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:T1++,i=this.toasts.find(a=>a.id===o),s=e.dismissible===void 0?!0:e.dismissible;return i?this.toasts=this.toasts.map(a=>a.id===o?(this.publish({...a,...e,id:o,title:n}),{...a,...e,id:o,dismissible:s,title:n}):a):this.addToast({title:n,...r,dismissible:s,id:o}),o},this.dismiss=e=>(e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),o=n!==void 0;return r.then(async i=>{if(nue(i)&&!i.ok){o=!1;let s=typeof t.error=="function"?await t.error(`HTTP error! status: ${i.status}`):t.error,a=typeof t.description=="function"?await t.description(`HTTP error! status: ${i.status}`):t.description;this.create({id:n,type:"error",message:s,description:a})}else if(t.success!==void 0){o=!1;let s=typeof t.success=="function"?await t.success(i):t.success,a=typeof t.description=="function"?await t.description(i):t.description;this.create({id:n,type:"success",message:s,description:a})}}).catch(async i=>{if(t.error!==void 0){o=!1;let s=typeof t.error=="function"?await t.error(i):t.error,a=typeof t.description=="function"?await t.description(i):t.description;this.create({id:n,type:"error",message:s,description:a})}}).finally(()=>{var i;o&&(this.dismiss(n),n=void 0),(i=t.finally)==null||i.call(t)}),n},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||T1++;return this.create({jsx:e(n),id:n,...t}),n},this.subscribers=[],this.toasts=[]}},to=new eue,tue=(e,t)=>{let n=(t==null?void 0:t.id)||T1++;return to.addToast({title:e,...t,id:n}),n},nue=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",rue=tue,oue=()=>to.toasts,ZN=Object.assign(rue,{success:to.success,info:to.info,warning:to.warning,error:to.error,custom:to.custom,message:to.message,promise:to.promise,dismiss:to.dismiss,loading:to.loading},{getHistory:oue});function iue(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}iue(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-bottom))}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;background:var(--gray1);color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:0;right:0;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
407
407
  `);function eg(e){return e.label!==void 0}var sue=3,aue="32px",lue=4e3,cue=356,uue=14,due=20,fue=200;function hue(...e){return e.filter(Boolean).join(" ")}var pue=e=>{var t,n,r,o,i,s,a,l,c,u;let{invert:f,toast:h,unstyled:p,interacting:v,setHeights:b,visibleToasts:w,heights:y,index:_,toasts:C,expanded:R,removeToast:S,defaultRichColors:$,closeButton:O,style:D,cancelButtonStyle:I,actionButtonStyle:L,className:j="",descriptionClassName:B="",duration:te,position:q,gap:F,loadingIcon:Q,expandByDefault:G,classNames:K,icons:W,closeButtonAriaLabel:T="Close toast",pauseWhenPageIsHidden:H,cn:U}=e,[M,re]=m.useState(!1),[ce,ue]=m.useState(!1),[he,J]=m.useState(!1),[ee,ie]=m.useState(!1),[me,Z]=m.useState(0),[be,Se]=m.useState(0),$e=m.useRef(null),Te=m.useRef(null),Ue=_===0,Be=_+1<=w,Ie=h.type,Ke=h.dismissible!==!1,lt=h.className||"",Nt=h.descriptionClassName||"",At=m.useMemo(()=>y.findIndex(nt=>nt.toastId===h.id)||0,[y,h.id]),Wt=m.useMemo(()=>{var nt;return(nt=h.closeButton)!=null?nt:O},[h.closeButton,O]),pe=m.useMemo(()=>h.duration||te||lue,[h.duration,te]),Re=m.useRef(0),Le=m.useRef(0),qe=m.useRef(0),Ze=m.useRef(null),[Ut,en]=q.split("-"),Xt=m.useMemo(()=>y.reduce((nt,ht,kt)=>kt>=At?nt:nt+ht.height,0),[y,At]),vn=Zce(),cn=h.invert||f,Ft=Ie==="loading";Le.current=m.useMemo(()=>At*F+Xt,[At,Xt]),m.useEffect(()=>{re(!0)},[]),m.useLayoutEffect(()=>{if(!M)return;let nt=Te.current,ht=nt.style.height;nt.style.height="auto";let kt=nt.getBoundingClientRect().height;nt.style.height=ht,Se(kt),b(Qt=>Qt.find(yt=>yt.toastId===h.id)?Qt.map(yt=>yt.toastId===h.id?{...yt,height:kt}:yt):[{toastId:h.id,height:kt,position:h.position},...Qt])},[M,h.title,h.description,b,h.id]);let nn=m.useCallback(()=>{ue(!0),Z(Le.current),b(nt=>nt.filter(ht=>ht.toastId!==h.id)),setTimeout(()=>{S(h)},fue)},[h,S,b,Le]);m.useEffect(()=>{if(h.promise&&Ie==="loading"||h.duration===1/0||h.type==="loading")return;let nt,ht=pe;return R||v||H&&vn?(()=>{if(qe.current<Re.current){let kt=new Date().getTime()-Re.current;ht=ht-kt}qe.current=new Date().getTime()})():ht!==1/0&&(Re.current=new Date().getTime(),nt=setTimeout(()=>{var kt;(kt=h.onAutoClose)==null||kt.call(h,h),nn()},ht)),()=>clearTimeout(nt)},[R,v,G,h,pe,nn,h.promise,Ie,H,vn]),m.useEffect(()=>{let nt=Te.current;if(nt){let ht=nt.getBoundingClientRect().height;return Se(ht),b(kt=>[{toastId:h.id,height:ht,position:h.position},...kt]),()=>b(kt=>kt.filter(Qt=>Qt.toastId!==h.id))}},[b,h.id]),m.useEffect(()=>{h.delete&&nn()},[nn,h.delete]);function xn(){return W!=null&&W.loading?m.createElement("div",{className:"sonner-loader","data-visible":Ie==="loading"},W.loading):Q?m.createElement("div",{className:"sonner-loader","data-visible":Ie==="loading"},Q):m.createElement(Yce,{visible:Ie==="loading"})}return m.createElement("li",{"aria-live":h.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:Te,className:U(j,lt,K==null?void 0:K.toast,(t=h==null?void 0:h.classNames)==null?void 0:t.toast,K==null?void 0:K.default,K==null?void 0:K[Ie],(n=h==null?void 0:h.classNames)==null?void 0:n[Ie]),"data-sonner-toast":"","data-rich-colors":(r=h.richColors)!=null?r:$,"data-styled":!(h.jsx||h.unstyled||p),"data-mounted":M,"data-promise":!!h.promise,"data-removed":ce,"data-visible":Be,"data-y-position":Ut,"data-x-position":en,"data-index":_,"data-front":Ue,"data-swiping":he,"data-dismissible":Ke,"data-type":Ie,"data-invert":cn,"data-swipe-out":ee,"data-expanded":!!(R||G&&M),style:{"--index":_,"--toasts-before":_,"--z-index":C.length-_,"--offset":`${ce?me:Le.current}px`,"--initial-height":G?"auto":`${be}px`,...D,...h.style},onPointerDown:nt=>{Ft||!Ke||($e.current=new Date,Z(Le.current),nt.target.setPointerCapture(nt.pointerId),nt.target.tagName!=="BUTTON"&&(J(!0),Ze.current={x:nt.clientX,y:nt.clientY}))},onPointerUp:()=>{var nt,ht,kt,Qt;if(ee||!Ke)return;Ze.current=null;let yt=Number(((nt=Te.current)==null?void 0:nt.style.getPropertyValue("--swipe-amount").replace("px",""))||0),$n=new Date().getTime()-((ht=$e.current)==null?void 0:ht.getTime()),Fo=Math.abs(yt)/$n;if(Math.abs(yt)>=due||Fo>.11){Z(Le.current),(kt=h.onDismiss)==null||kt.call(h,h),nn(),ie(!0);return}(Qt=Te.current)==null||Qt.style.setProperty("--swipe-amount","0px"),J(!1)},onPointerMove:nt=>{var ht;if(!Ze.current||!Ke)return;let kt=nt.clientY-Ze.current.y,Qt=nt.clientX-Ze.current.x,yt=(Ut==="top"?Math.min:Math.max)(0,kt),$n=nt.pointerType==="touch"?10:2;Math.abs(yt)>$n?(ht=Te.current)==null||ht.style.setProperty("--swipe-amount",`${kt}px`):Math.abs(Qt)>$n&&(Ze.current=null)}},Wt&&!h.jsx?m.createElement("button",{"aria-label":T,"data-disabled":Ft,"data-close-button":!0,onClick:Ft||!Ke?()=>{}:()=>{var nt;nn(),(nt=h.onDismiss)==null||nt.call(h,h)},className:U(K==null?void 0:K.closeButton,(o=h==null?void 0:h.classNames)==null?void 0:o.closeButton)},m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},m.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),m.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,h.jsx||m.isValidElement(h.title)?h.jsx||h.title:m.createElement(m.Fragment,null,Ie||h.icon||h.promise?m.createElement("div",{"data-icon":"",className:U(K==null?void 0:K.icon,(i=h==null?void 0:h.classNames)==null?void 0:i.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||xn():null,h.type!=="loading"?h.icon||(W==null?void 0:W[Ie])||Gce(Ie):null):null,m.createElement("div",{"data-content":"",className:U(K==null?void 0:K.content,(s=h==null?void 0:h.classNames)==null?void 0:s.content)},m.createElement("div",{"data-title":"",className:U(K==null?void 0:K.title,(a=h==null?void 0:h.classNames)==null?void 0:a.title)},h.title),h.description?m.createElement("div",{"data-description":"",className:U(B,Nt,K==null?void 0:K.description,(l=h==null?void 0:h.classNames)==null?void 0:l.description)},h.description):null),m.isValidElement(h.cancel)?h.cancel:h.cancel&&eg(h.cancel)?m.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||I,onClick:nt=>{var ht,kt;eg(h.cancel)&&Ke&&((kt=(ht=h.cancel).onClick)==null||kt.call(ht,nt),nn())},className:U(K==null?void 0:K.cancelButton,(c=h==null?void 0:h.classNames)==null?void 0:c.cancelButton)},h.cancel.label):null,m.isValidElement(h.action)?h.action:h.action&&eg(h.action)?m.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||L,onClick:nt=>{var ht,kt;eg(h.action)&&(nt.defaultPrevented||((kt=(ht=h.action).onClick)==null||kt.call(ht,nt),nn()))},className:U(K==null?void 0:K.actionButton,(u=h==null?void 0:h.classNames)==null?void 0:u.actionButton)},h.action.label):null))};function f2(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}var gue=e=>{let{invert:t,position:n="bottom-right",hotkey:r=["altKey","KeyT"],expand:o,closeButton:i,className:s,offset:a,theme:l="light",richColors:c,duration:u,style:f,visibleToasts:h=sue,toastOptions:p,dir:v=f2(),gap:b=uue,loadingIcon:w,icons:y,containerAriaLabel:_="Notifications",pauseWhenPageIsHidden:C,cn:R=hue}=e,[S,$]=m.useState([]),O=m.useMemo(()=>Array.from(new Set([n].concat(S.filter(H=>H.position).map(H=>H.position)))),[S,n]),[D,I]=m.useState([]),[L,j]=m.useState(!1),[B,te]=m.useState(!1),[q,F]=m.useState(l!=="system"?l:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Q=m.useRef(null),G=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),K=m.useRef(null),W=m.useRef(!1),T=m.useCallback(H=>{var U;(U=S.find(M=>M.id===H.id))!=null&&U.delete||to.dismiss(H.id),$(M=>M.filter(({id:re})=>re!==H.id))},[S]);return m.useEffect(()=>to.subscribe(H=>{if(H.dismiss){$(U=>U.map(M=>M.id===H.id?{...M,delete:!0}:M));return}setTimeout(()=>{fr.flushSync(()=>{$(U=>{let M=U.findIndex(re=>re.id===H.id);return M!==-1?[...U.slice(0,M),{...U[M],...H},...U.slice(M+1)]:[H,...U]})})})}),[]),m.useEffect(()=>{if(l!=="system"){F(l);return}l==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?F("dark"):F("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:H})=>{F(H?"dark":"light")})},[l]),m.useEffect(()=>{S.length<=1&&j(!1)},[S]),m.useEffect(()=>{let H=U=>{var M,re;r.every(ce=>U[ce]||U.code===ce)&&(j(!0),(M=Q.current)==null||M.focus()),U.code==="Escape"&&(document.activeElement===Q.current||(re=Q.current)!=null&&re.contains(document.activeElement))&&j(!1)};return document.addEventListener("keydown",H),()=>document.removeEventListener("keydown",H)},[r]),m.useEffect(()=>{if(Q.current)return()=>{K.current&&(K.current.focus({preventScroll:!0}),K.current=null,W.current=!1)}},[Q.current]),S.length?m.createElement("section",{"aria-label":`${_} ${G}`,tabIndex:-1},O.map((H,U)=>{var M;let[re,ce]=H.split("-");return m.createElement("ol",{key:H,dir:v==="auto"?f2():v,tabIndex:-1,ref:Q,className:s,"data-sonner-toaster":!0,"data-theme":q,"data-y-position":re,"data-x-position":ce,style:{"--front-toast-height":`${((M=D[0])==null?void 0:M.height)||0}px`,"--offset":typeof a=="number"?`${a}px`:a||aue,"--width":`${cue}px`,"--gap":`${b}px`,...f},onBlur:ue=>{W.current&&!ue.currentTarget.contains(ue.relatedTarget)&&(W.current=!1,K.current&&(K.current.focus({preventScroll:!0}),K.current=null))},onFocus:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||W.current||(W.current=!0,K.current=ue.relatedTarget)},onMouseEnter:()=>j(!0),onMouseMove:()=>j(!0),onMouseLeave:()=>{B||j(!1)},onPointerDown:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||te(!0)},onPointerUp:()=>te(!1)},S.filter(ue=>!ue.position&&U===0||ue.position===H).map((ue,he)=>{var J,ee;return m.createElement(pue,{key:ue.id,icons:y,index:he,toast:ue,defaultRichColors:c,duration:(J=p==null?void 0:p.duration)!=null?J:u,className:p==null?void 0:p.className,descriptionClassName:p==null?void 0:p.descriptionClassName,invert:t,visibleToasts:h,closeButton:(ee=p==null?void 0:p.closeButton)!=null?ee:i,interacting:B,position:H,style:p==null?void 0:p.style,unstyled:p==null?void 0:p.unstyled,classNames:p==null?void 0:p.classNames,cancelButtonStyle:p==null?void 0:p.cancelButtonStyle,actionButtonStyle:p==null?void 0:p.actionButtonStyle,removeToast:T,toasts:S.filter(ie=>ie.position==ue.position),heights:D.filter(ie=>ie.position==ue.position),setHeights:I,expandByDefault:o,gap:b,loadingIcon:w,expanded:L,pauseWhenPageIsHidden:C,cn:R})}))})):null};function mue(){const{getSelectedFrame:e,addFrame:t,setSelectedFrameId:n}=ur(),r=Ce(l=>l.dashboard.sheets),i=Ce(l=>l.selectedSheetId)??(r==null?void 0:r[0].id),s=Ce(l=>l.isDashboardEditing),a=Ce(l=>l.isVisualEditing);m.useEffect(()=>{if(!s||a)return;async function l(f){const h=f.ctrlKey||f.metaKey;h&&f.key==="c"?(await c(),ZN.success("Card copied to clipboard"),f.preventDefault()):h&&f.key==="v"&&(await u(),f.preventDefault())}async function c(){try{const f=e();f&&await navigator.clipboard.writeText(JSON.stringify(f))}catch(f){console.error("Failed to copy text:",f)}}async function u(){if(!i)return null;try{const f=await navigator.clipboard.readText();try{const h=JSON.parse(f);if(h&&h.id){h.id=fa();const p=h.activeCardId;h.cards.forEach(v=>{const b=v.id;v.id=fa(),b===p&&(h.activeCardId=v.id,v.title=`${v.title} (Copy)`)}),t(i,h),n(h.id)}}catch(h){console.error("Failed to parse clipboard contents: ",h)}return f}catch(f){return console.error("Failed to paste text:",f),null}}return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[t,e,n,i,s,a])}const vue=MP.WidthProvider(MP.Responsive),$C=e=>vu.includes(e.dataType)?E.jsx(jae,{filter:e}):E.jsx(bce,{filter:e});function bue(){var S,$;const e=Ce(O=>O.isDashboardEditing);Ce(O=>O.currentBreakpoint);const t=Ce(O=>O.themeStyle);m.useState([]);const n=Ce(O=>O.selectedSheetId);Ce(O=>O.selectedLensId);const r=(S=Ce(O=>{var D,I;return(I=(D=O.dashboard)==null?void 0:D.sheets)==null?void 0:I.filter(L=>L.id===n)}))==null?void 0:S[0].layouts,o=Ce(O=>O.dashboard.filters),i=Ce(O=>{var D,I,L;return(L=(I=(D=O.dashboard)==null?void 0:D.sheets)==null?void 0:I.find(j=>j.id===n))==null?void 0:L.frames}),{getSelectedSheet:s,getSelectedSheetLayout:a,getSelectedSheetLayouts:l,setSheetLayout:c,setSheetLayouts:u,setCurrentBreakpoint:f,removeFilter:h,updateFilter:p,removeFilterValue:v}=Ce(O=>O.actions),b=s();mue();const w=m.useCallback(O=>{f(O)},[f]),y=m.useCallback((O,D)=>{b!=null&&b.id&&u(b.id,D)},[b==null?void 0:b.id,u]);if(!n)return null;const _=(O,D)=>E.jsx(e5,{className:"after:content-none",ref:D,handleAxis:O});function C(){const O=o==null?void 0:o.filter(D=>D.sheetId===n||!D.sheetId);return O==null?void 0:O.map(D=>{var I,L;return D.location==="frame"?null:E.jsxs("div",{style:{borderRadius:(L=(I=t==null?void 0:t.chart)==null?void 0:I.options)==null?void 0:L.borderRadius},className:xe("z-50 flex w-full flex-col rounded-md border bg-background px-3 py-2"),children:[E.jsx(JN,{filter:D}),$C(D)]},D.id)})}function R(){return i==null?void 0:i.map(O=>E.jsx("div",{role:"dashboard-frame-container",className:xe("group overflow-hidden",t==null?void 0:t.dashboardCardContainer),children:E.jsx(Xoe,{frame:O})},O.id))}return E.jsx(E.Fragment,{children:E.jsxs(vue,{margin:[10,10],isDraggable:e,resizeHandles:e?["sw","nw","ne","se","e","w"]:[],className:xe(($=t==null?void 0:t.gridLayout)==null?void 0:$.className),layouts:r,cols:{lg:48,md:36,sm:24,xs:12,xxs:6},rowHeight:1,onBreakpointChange:w,onLayoutChange:y,resizeHandle:_,children:[C(),R()]})})}const e5=m.forwardRef(({className:e,handleAxis:t,...n},r)=>(Ce(o=>o.themeStyle),E.jsx("div",{ref:r,className:xe(`react-resizable-handle z-10 react-resizable-handle-${t} absolute border-foreground/40`,{"border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-r-0":t==="nw","border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-l-0":t==="ne","border-foreground/40 group-hover:border-2 group-hover:border-r-0 group-hover:border-t-0":t==="sw","border-foreground/40 group-hover:border-2 group-hover:border-l-0 group-hover:border-t-0":t==="se","border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-l-0 group-hover:border-t-0":t==="e","border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-r-0 group-hover:border-t-0":t==="w"},e),...n})));e5.displayName="ResizeHandle";let yue=(e,t=21)=>(n=t)=>{let r="",o=n;for(;o--;)r+=e[Math.random()*e.length|0];return r};var Su={exports:{}};const xue=typeof Buffer<"u",h2=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,p2=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function t5(e,t,n){n==null&&t!==null&&typeof t=="object"&&(n=t,t=void 0),xue&&Buffer.isBuffer(e)&&(e=e.toString()),e&&e.charCodeAt(0)===65279&&(e=e.slice(1));const r=JSON.parse(e,t);if(r===null||typeof r!="object")return r;const o=n&&n.protoAction||"error",i=n&&n.constructorAction||"error";if(o==="ignore"&&i==="ignore")return r;if(o!=="ignore"&&i!=="ignore"){if(h2.test(e)===!1&&p2.test(e)===!1)return r}else if(o!=="ignore"&&i==="ignore"){if(h2.test(e)===!1)return r}else if(p2.test(e)===!1)return r;return n5(r,{protoAction:o,constructorAction:i,safe:n&&n.safe})}function n5(e,{protoAction:t="error",constructorAction:n="error",safe:r}={}){let o=[e];for(;o.length;){const i=o;o=[];for(const s of i){if(t!=="ignore"&&Object.prototype.hasOwnProperty.call(s,"__proto__")){if(r===!0)return null;if(t==="error")throw new SyntaxError("Object contains forbidden prototype property");delete s.__proto__}if(n!=="ignore"&&Object.prototype.hasOwnProperty.call(s,"constructor")&&Object.prototype.hasOwnProperty.call(s.constructor,"prototype")){if(r===!0)return null;if(n==="error")throw new SyntaxError("Object contains forbidden prototype property");delete s.constructor}for(const a in s){const l=s[a];l&&typeof l=="object"&&o.push(l)}}}return e}function TC(e,t,n){const r=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return t5(e,t,n)}finally{Error.stackTraceLimit=r}}function wue(e,t){const n=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return t5(e,t,{safe:!0})}catch{return null}finally{Error.stackTraceLimit=n}}Su.exports=TC;Su.exports.default=TC;Su.exports.parse=TC;Su.exports.safeParse=wue;Su.exports.scan=n5;var _ue=Su.exports;const g2=Pl(_ue);var r5=yue("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",7);function Cue(e){const t=["ROOT"];let n=-1,r=null;function o(l,c,u){switch(l){case'"':{n=c,t.pop(),t.push(u),t.push("INSIDE_STRING");break}case"f":case"t":case"n":{n=c,r=c,t.pop(),t.push(u),t.push("INSIDE_LITERAL");break}case"-":{t.pop(),t.push(u),t.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=c,t.pop(),t.push(u),t.push("INSIDE_NUMBER");break}case"{":{n=c,t.pop(),t.push(u),t.push("INSIDE_OBJECT_START");break}case"[":{n=c,t.pop(),t.push(u),t.push("INSIDE_ARRAY_START");break}}}function i(l,c){switch(l){case",":{t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{n=c,t.pop();break}}}function s(l,c){switch(l){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=c,t.pop();break}}}for(let l=0;l<e.length;l++){const c=e[l];switch(t[t.length-1]){case"ROOT":o(c,l,"FINISH");break;case"INSIDE_OBJECT_START":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}case"}":{n=l,t.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}}break}case"INSIDE_OBJECT_KEY":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY");break}}break}case"INSIDE_OBJECT_AFTER_KEY":{switch(c){case":":{t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE");break}}break}case"INSIDE_OBJECT_BEFORE_VALUE":{o(c,l,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{i(c,l);break}case"INSIDE_STRING":{switch(c){case'"':{t.pop(),n=l;break}case"\\":{t.push("INSIDE_STRING_ESCAPE");break}default:n=l}break}case"INSIDE_ARRAY_START":{switch(c){case"]":{n=l,t.pop();break}default:{n=l,o(c,l,"INSIDE_ARRAY_AFTER_VALUE");break}}break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(c){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=l,t.pop();break}default:{n=l;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{o(c,l,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{t.pop(),n=l;break}case"INSIDE_NUMBER":{switch(c){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=l;break}case"e":case"E":case"-":case".":break;case",":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(c,l),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&i(c,l);break}case"}":{t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&i(c,l);break}case"]":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(c,l);break}default:{t.pop();break}}break}case"INSIDE_LITERAL":{const f=e.substring(r,l+1);!"false".startsWith(f)&&!"true".startsWith(f)&&!"null".startsWith(f)?(t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?i(c,l):t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(c,l)):n=l;break}}}let a=e.slice(0,n+1);for(let l=t.length-1;l>=0;l--)switch(t[l]){case"INSIDE_STRING":{a+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{a+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{a+="]";break}case"INSIDE_LITERAL":{const u=e.substring(r,e.length);"true".startsWith(u)?a+="true".slice(u.length):"false".startsWith(u)?a+="false".slice(u.length):"null".startsWith(u)&&(a+="null".slice(u.length))}}return a}function Sue(e){if(e!=null)try{return g2.parse(e)}catch{try{const n=Cue(e);return g2.parse(n)}catch{}}}var uf={code:"0",name:"text",parse:e=>{if(typeof e!="string")throw new Error('"text" parts expect a string value.');return{type:"text",value:e}}},df={code:"1",name:"function_call",parse:e=>{if(e==null||typeof e!="object"||!("function_call"in e)||typeof e.function_call!="object"||e.function_call==null||!("name"in e.function_call)||!("arguments"in e.function_call)||typeof e.function_call.name!="string"||typeof e.function_call.arguments!="string")throw new Error('"function_call" parts expect an object with a "function_call" property.');return{type:"function_call",value:e}}},ff={code:"2",name:"data",parse:e=>{if(!Array.isArray(e))throw new Error('"data" parts expect an array value.');return{type:"data",value:e}}},hf={code:"3",name:"error",parse:e=>{if(typeof e!="string")throw new Error('"error" parts expect a string value.');return{type:"error",value:e}}},pf={code:"4",name:"assistant_message",parse:e=>{if(e==null||typeof e!="object"||!("id"in e)||!("role"in e)||!("content"in e)||typeof e.id!="string"||typeof e.role!="string"||e.role!=="assistant"||!Array.isArray(e.content)||!e.content.every(t=>t!=null&&typeof t=="object"&&"type"in t&&t.type==="text"&&"text"in t&&t.text!=null&&typeof t.text=="object"&&"value"in t.text&&typeof t.text.value=="string"))throw new Error('"assistant_message" parts expect an object with an "id", "role", and "content" property.');return{type:"assistant_message",value:e}}},gf={code:"5",name:"assistant_control_data",parse:e=>{if(e==null||typeof e!="object"||!("threadId"in e)||!("messageId"in e)||typeof e.threadId!="string"||typeof e.messageId!="string")throw new Error('"assistant_control_data" parts expect an object with a "threadId" and "messageId" property.');return{type:"assistant_control_data",value:{threadId:e.threadId,messageId:e.messageId}}}},mf={code:"6",name:"data_message",parse:e=>{if(e==null||typeof e!="object"||!("role"in e)||!("data"in e)||typeof e.role!="string"||e.role!=="data")throw new Error('"data_message" parts expect an object with a "role" and "data" property.');return{type:"data_message",value:e}}},vf={code:"7",name:"tool_calls",parse:e=>{if(e==null||typeof e!="object"||!("tool_calls"in e)||typeof e.tool_calls!="object"||e.tool_calls==null||!Array.isArray(e.tool_calls)||e.tool_calls.some(t=>t==null||typeof t!="object"||!("id"in t)||typeof t.id!="string"||!("type"in t)||typeof t.type!="string"||!("function"in t)||t.function==null||typeof t.function!="object"||!("arguments"in t.function)||typeof t.function.name!="string"||typeof t.function.arguments!="string"))throw new Error('"tool_calls" parts expect an object with a ToolCallPayload.');return{type:"tool_calls",value:e}}},bf={code:"8",name:"message_annotations",parse:e=>{if(!Array.isArray(e))throw new Error('"message_annotations" parts expect an array value.');return{type:"message_annotations",value:e}}},yf={code:"9",name:"tool_call",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("toolName"in e)||typeof e.toolName!="string"||!("args"in e)||typeof e.args!="object")throw new Error('"tool_call" parts expect an object with a "toolCallId", "toolName", and "args" property.');return{type:"tool_call",value:e}}},xf={code:"a",name:"tool_result",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("result"in e))throw new Error('"tool_result" parts expect an object with a "toolCallId" and a "result" property.');return{type:"tool_result",value:e}}},wf={code:"b",name:"tool_call_streaming_start",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("toolName"in e)||typeof e.toolName!="string")throw new Error('"tool_call_streaming_start" parts expect an object with a "toolCallId" and "toolName" property.');return{type:"tool_call_streaming_start",value:e}}},_f={code:"c",name:"tool_call_delta",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("argsTextDelta"in e)||typeof e.argsTextDelta!="string")throw new Error('"tool_call_delta" parts expect an object with a "toolCallId" and "argsTextDelta" property.');return{type:"tool_call_delta",value:e}}},Cf={code:"d",name:"finish_message",parse:e=>{if(e==null||typeof e!="object"||!("finishReason"in e)||typeof e.finishReason!="string"||!("usage"in e)||e.usage==null||typeof e.usage!="object"||!("promptTokens"in e.usage)||!("completionTokens"in e.usage))throw new Error('"finish_message" parts expect an object with a "finishReason" and "usage" property.');return typeof e.usage.promptTokens!="number"&&(e.usage.promptTokens=Number.NaN),typeof e.usage.completionTokens!="number"&&(e.usage.completionTokens=Number.NaN),{type:"finish_message",value:e}}},Eue=[uf,df,ff,hf,pf,gf,mf,vf,bf,yf,xf,wf,_f,Cf],Rue={[uf.code]:uf,[df.code]:df,[ff.code]:ff,[hf.code]:hf,[pf.code]:pf,[gf.code]:gf,[mf.code]:mf,[vf.code]:vf,[bf.code]:bf,[yf.code]:yf,[xf.code]:xf,[wf.code]:wf,[_f.code]:_f,[Cf.code]:Cf};uf.name+"",uf.code,df.name+"",df.code,ff.name+"",ff.code,hf.name+"",hf.code,pf.name+"",pf.code,gf.name+"",gf.code,mf.name+"",mf.code,vf.name+"",vf.code,bf.name+"",bf.code,yf.name+"",yf.code,xf.name+"",xf.code,wf.name+"",wf.code,_f.name+"",_f.code,Cf.name+"",Cf.code;var Pue=Eue.map(e=>e.code),o5=e=>{const t=e.indexOf(":");if(t===-1)throw new Error("Failed to parse stream string. No separator found.");const n=e.slice(0,t);if(!Pue.includes(n))throw new Error(`Failed to parse stream string. Invalid code ${n}.`);const r=n,o=e.slice(t+1),i=JSON.parse(o);return Rue[r].parse(i)},Oue=10;function $ue(e,t){const n=new Uint8Array(t);let r=0;for(const o of e)n.set(o,r),r+=o.length;return e.length=0,n}async function*Tue(e,{isAborted:t}={}){const n=new TextDecoder,r=[];let o=0;for(;;){const{value:i}=await e.read();if(i&&(r.push(i),o+=i.length,i[i.length-1]!==Oue))continue;if(r.length===0)break;const s=$ue(r,o);o=0;const a=n.decode(s,{stream:!0}).split(`
408
408
  `).filter(l=>l!=="").map(o5);for(const l of a)yield l;if(t!=null&&t()){e.cancel();break}}}function tg(e,t){return!e||!t||!t.length?e:{...e,annotations:[...t]}}async function Due({reader:e,abortControllerRef:t,update:n,onToolCall:r,onFinish:o,generateId:i=r5,getCurrentDate:s=()=>new Date}){var a;const l=s(),c={data:[]};let u;const f={};let h={completionTokens:NaN,promptTokens:NaN,totalTokens:NaN},p="unknown";for await(const{type:v,value:b}of Tue(e,{isAborted:()=>(t==null?void 0:t.current)===null})){if(v==="text"&&(c.text?c.text={...c.text,content:(c.text.content||"")+b}:c.text={id:i(),role:"assistant",content:b,createdAt:l}),v==="finish_message"){const{completionTokens:R,promptTokens:S}=b.usage;p=b.finishReason,h={completionTokens:R,promptTokens:S,totalTokens:R+S}}if(v==="tool_call_streaming_start")c.text==null&&(c.text={id:i(),role:"assistant",content:"",createdAt:l}),c.text.toolInvocations==null&&(c.text.toolInvocations=[]),f[b.toolCallId]={text:"",toolName:b.toolName,prefixMapIndex:c.text.toolInvocations.length},c.text.toolInvocations.push({state:"partial-call",toolCallId:b.toolCallId,toolName:b.toolName,args:void 0});else if(v==="tool_call_delta"){const R=f[b.toolCallId];R.text+=b.argsTextDelta,c.text.toolInvocations[R.prefixMapIndex]={state:"partial-call",toolCallId:b.toolCallId,toolName:R.toolName,args:Sue(R.text)},c.text.internalUpdateId=i()}else if(v==="tool_call"){if(f[b.toolCallId]!=null?c.text.toolInvocations[f[b.toolCallId].prefixMapIndex]={state:"call",...b}:(c.text==null&&(c.text={id:i(),role:"assistant",content:"",createdAt:l}),c.text.toolInvocations==null&&(c.text.toolInvocations=[]),c.text.toolInvocations.push({state:"call",...b})),c.text.internalUpdateId=i(),r){const R=await r({toolCall:b});R!=null&&(c.text.toolInvocations[c.text.toolInvocations.length-1]={state:"result",...b,result:R})}}else if(v==="tool_result"){const R=(a=c.text)==null?void 0:a.toolInvocations;if(R==null)throw new Error("tool_result must be preceded by a tool_call");const S=R.findIndex($=>$.toolCallId===b.toolCallId);if(S===-1)throw new Error("tool_result must be preceded by a tool_call with the same toolCallId");R[S]={...R[S],state:"result",...b}}let w=null;v==="function_call"&&(c.function_call={id:i(),role:"assistant",content:"",function_call:b.function_call,name:b.function_call.name,createdAt:l},w=c.function_call);let y=null;v==="tool_calls"&&(c.tool_calls={id:i(),role:"assistant",content:"",tool_calls:b.tool_calls,createdAt:l},y=c.tool_calls),v==="data"&&c.data.push(...b);let _=c.text;v==="message_annotations"&&(u?u.push(...b):u=[...b],w=tg(c.function_call,u),y=tg(c.tool_calls,u),_=tg(c.text,u)),u!=null&&u.length&&["text","function_call","tool_calls"].forEach(S=>{c[S]&&(c[S].annotations=[...u])});const C=[w,y,_].filter(Boolean).map(R=>({...tg(R,u)}));n(C,[...c.data])}return o==null||o({prefixMap:c,finishReason:p,usage:h}),{messages:[c.text,c.function_call,c.tool_calls].filter(Boolean),data:c.data}}var Aue=()=>fetch;async function kue({api:e,body:t,streamProtocol:n="data",credentials:r,headers:o,abortController:i,restoreMessagesOnFailure:s,onResponse:a,onUpdate:l,onFinish:c,onToolCall:u,generateId:f,fetch:h=Aue()}){var p,v;const b=await h(e,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",...o},signal:(p=i==null?void 0:i())==null?void 0:p.signal,credentials:r}).catch(y=>{throw s(),y});if(a)try{await a(b)}catch(y){throw y}if(!b.ok)throw s(),new Error((v=await b.text())!=null?v:"Failed to fetch the chat response.");if(!b.body)throw new Error("The response body is empty.");const w=b.body.getReader();switch(n){case"text":{const y=Mue(),_={id:f(),createdAt:new Date,role:"assistant",content:""};for(;;){const{done:C,value:R}=await w.read();if(C)break;if(_.content+=y(R),l([{..._}],[]),(i==null?void 0:i())===null){w.cancel();break}}return c==null||c(_,{usage:{completionTokens:NaN,promptTokens:NaN,totalTokens:NaN},finishReason:"unknown"}),{messages:[_],data:[]}}case"data":return await Due({reader:w,abortControllerRef:i!=null?{current:i()}:void 0,update:l,onToolCall:u,onFinish({prefixMap:y,finishReason:_,usage:C}){c&&y.text!=null&&c(y.text,{usage:C,finishReason:_})},generateId:f});default:{const y=n;throw new Error(`Unknown stream protocol: ${y}`)}}}function Mue(e){const t=new TextDecoder;return e?function(n){return t.decode(n,{stream:!0}).split(`
409
409
  `).filter(o=>o!=="").map(o5).filter(Boolean)}:function(n){return n?t.decode(n,{stream:!0}):""}}async function Iue({getStreamedResponse:e,experimental_onFunctionCall:t,experimental_onToolCall:n,updateChatRequest:r,getCurrentMessages:o}){for(;;){const i=await e();if("messages"in i){let s=!1;for(const a of i.messages)if(!((a.function_call===void 0||typeof a.function_call=="string")&&(a.tool_calls===void 0||typeof a.tool_calls=="string"))){if(s=!0,t){const l=a.function_call;if(typeof l!="object"){console.warn("experimental_onFunctionCall should not be defined when using tools");continue}const c=await t(o(),l);if(c===void 0){s=!1;break}r(c)}if(n){const l=a.tool_calls;if(!Array.isArray(l)||l.some(u=>typeof u!="object")){console.warn("experimental_onToolCall should not be defined when using tools");continue}const c=await n(o(),l);if(c===void 0){s=!1;break}r(c)}}if(!s)break}else{let s=function(l){for(const c of l.messages){if(c.tool_calls!==void 0)for(const u of c.tool_calls)typeof u=="object"&&u.function.arguments&&typeof u.function.arguments!="string"&&(u.function.arguments=JSON.stringify(u.function.arguments));c.function_call!==void 0&&typeof c.function_call=="object"&&c.function_call.arguments&&typeof c.function_call.arguments!="string"&&(c.function_call.arguments=JSON.stringify(c.function_call.arguments))}};const a=i;if((a.function_call===void 0||typeof a.function_call=="string")&&(a.tool_calls===void 0||typeof a.tool_calls=="string"))break;if(t){const l=a.function_call;if(typeof l!="object"){console.warn("experimental_onFunctionCall should not be defined when using tools");continue}const c=await t(o(),l);if(c===void 0)break;s(c),r(c)}if(n){const l=a.tool_calls;if(typeof l!="object"){console.warn("experimental_onToolCall should not be defined when using functions");continue}const c=await n(o(),l);if(c===void 0)break;s(c),r(c)}}}}var Nue=cw();const sa=()=>{},Nr=sa(),vy=Object,jt=e=>e===Nr,xi=e=>typeof e=="function",va=(e,t)=>({...e,...t}),Lue=e=>xi(e.then),ng=new WeakMap;let Fue=0;const Sf=e=>{const t=typeof e,n=e&&e.constructor,r=n==Date;let o,i;if(vy(e)===e&&!r&&n!=RegExp){if(o=ng.get(e),o)return o;if(o=++Fue+"~",ng.set(e,o),n==Array){for(o="@",i=0;i<e.length;i++)o+=Sf(e[i])+",";ng.set(e,o)}if(n==vy){o="#";const s=vy.keys(e).sort();for(;!jt(i=s.pop());)jt(e[i])||(o+=i+":"+Sf(e[i])+",");ng.set(e,o)}}else o=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return o},os=new WeakMap,by={},rg={},DC="undefined",Tv=typeof window!=DC,D1=typeof document!=DC,jue=()=>Tv&&typeof window.requestAnimationFrame!=DC,i5=(e,t)=>{const n=os.get(e);return[()=>!jt(t)&&e.get(t)||by,r=>{if(!jt(t)){const o=e.get(t);t in rg||(rg[t]=o),n[5](t,va(o,r),o||by)}},n[6],()=>!jt(t)&&t in rg?rg[t]:!jt(t)&&e.get(t)||by]};let A1=!0;const zue=()=>A1,[k1,M1]=Tv&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[sa,sa],Bue=()=>{const e=D1&&document.visibilityState;return jt(e)||e!=="hidden"},Vue=e=>(D1&&document.addEventListener("visibilitychange",e),k1("focus",e),()=>{D1&&document.removeEventListener("visibilitychange",e),M1("focus",e)}),Hue=e=>{const t=()=>{A1=!0,e()},n=()=>{A1=!1};return k1("online",t),k1("offline",n),()=>{M1("online",t),M1("offline",n)}},Wue={isOnline:zue,isVisible:Bue},Uue={initFocus:Vue,initReconnect:Hue},m2=!m.useId,Ef=!Tv||"Deno"in window,Gue=e=>jue()?window.requestAnimationFrame(e):setTimeout(e,1),yy=Ef?m.useEffect:m.useLayoutEffect,xy=typeof navigator<"u"&&navigator.connection,v2=!Ef&&xy&&(["slow-2g","2g"].includes(xy.effectiveType)||xy.saveData),AC=e=>{if(xi(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?Sf(e):"",[e,t]};let que=0;const I1=()=>++que,s5=0,a5=1,l5=2,Yue=3;var hd={__proto__:null,ERROR_REVALIDATE_EVENT:Yue,FOCUS_EVENT:s5,MUTATE_EVENT:l5,RECONNECT_EVENT:a5};async function c5(...e){const[t,n,r,o]=e,i=va({populateCache:!0,throwOnError:!0},typeof o=="boolean"?{revalidate:o}:o||{});let s=i.populateCache;const a=i.rollbackOnError;let l=i.optimisticData;const c=h=>typeof a=="function"?a(h):a!==!1,u=i.throwOnError;if(xi(n)){const h=n,p=[],v=t.keys();for(const b of v)!/^\$(inf|sub)\$/.test(b)&&h(t.get(b)._k)&&p.push(b);return Promise.all(p.map(f))}return f(n);async function f(h){const[p]=AC(h);if(!p)return;const[v,b]=i5(t,p),[w,y,_,C]=os.get(t),R=()=>{const te=w[p];return(xi(i.revalidate)?i.revalidate(v().data,h):i.revalidate!==!1)&&(delete _[p],delete C[p],te&&te[0])?te[0](l5).then(()=>v().data):v().data};if(e.length<3)return R();let S=r,$;const O=I1();y[p]=[O,0];const D=!jt(l),I=v(),L=I.data,j=I._c,B=jt(j)?L:j;if(D&&(l=xi(l)?l(B,L):l,b({data:l,_c:B})),xi(S))try{S=S(B)}catch(te){$=te}if(S&&Lue(S))if(S=await S.catch(te=>{$=te}),O!==y[p][0]){if($)throw $;return S}else $&&D&&c($)&&(s=!0,b({data:B,_c:Nr}));if(s&&!$)if(xi(s)){const te=s(S,B);b({data:te,error:Nr,_c:Nr})}else b({data:S,error:Nr,_c:Nr});if(y[p][1]=I1(),Promise.resolve(R()).then(()=>{b({_c:Nr})}),$){if(u)throw $;return}return S}}const b2=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},Kue=(e,t)=>{if(!os.has(e)){const n=va(Uue,t),r={},o=c5.bind(Nr,e);let i=sa;const s={},a=(u,f)=>{const h=s[u]||[];return s[u]=h,h.push(f),()=>h.splice(h.indexOf(f),1)},l=(u,f,h)=>{e.set(u,f);const p=s[u];if(p)for(const v of p)v(f,h)},c=()=>{if(!os.has(e)&&(os.set(e,[r,{},{},{},o,l,a]),!Ef)){const u=n.initFocus(setTimeout.bind(Nr,b2.bind(Nr,r,s5))),f=n.initReconnect(setTimeout.bind(Nr,b2.bind(Nr,r,a5)));i=()=>{u&&u(),f&&f(),os.delete(e)}}};return c(),[e,o,c,i]}return[e,os.get(e)[4]]},Xue=(e,t,n,r,o)=>{const i=n.errorRetryCount,s=o.retryCount,a=~~((Math.random()+.5)*(1<<(s<8?s:8)))*n.errorRetryInterval;!jt(i)&&s>i||setTimeout(r,a,o)},Que=(e,t)=>Sf(e)==Sf(t),[u5,Jue]=Kue(new Map),Zue=va({onLoadingSlow:sa,onSuccess:sa,onError:sa,onErrorRetry:Xue,onDiscarded:sa,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:v2?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:v2?5e3:3e3,compare:Que,isPaused:()=>!1,cache:u5,mutate:Jue,fallback:{}},Wue),ede=(e,t)=>{const n=va(e,t);if(t){const{use:r,fallback:o}=e,{use:i,fallback:s}=t;r&&i&&(n.use=r.concat(i)),o&&s&&(n.fallback=va(o,s))}return n},tde=m.createContext({}),nde="$inf$",d5=Tv&&window.__SWR_DEVTOOLS_USE__,rde=d5?window.__SWR_DEVTOOLS_USE__:[],ode=()=>{d5&&(window.__SWR_DEVTOOLS_REACT__=m)},ide=e=>xi(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],sde=()=>va(Zue,m.useContext(tde)),ade=e=>(t,n,r)=>e(t,n&&((...i)=>{const[s]=AC(t),[,,,a]=os.get(u5);if(s.startsWith(nde))return n(...i);const l=a[s];return jt(l)?n(...i):(delete a[s],l)}),r),lde=rde.concat(ade),cde=e=>function(...n){const r=sde(),[o,i,s]=ide(n),a=ede(r,s);let l=e;const{use:c}=a,u=(c||[]).concat(lde);for(let f=u.length;f--;)l=u[f](l);return l(o,i||a.fetcher||null,a)},ude=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const o=r.indexOf(n);o>=0&&(r[o]=r[r.length-1],r.pop())}};ode();const y2=m.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e)}),wy={dedupe:!0},dde=(e,t,n)=>{const{cache:r,compare:o,suspense:i,fallbackData:s,revalidateOnMount:a,revalidateIfStale:l,refreshInterval:c,refreshWhenHidden:u,refreshWhenOffline:f,keepPreviousData:h}=n,[p,v,b,w]=os.get(r),[y,_]=AC(e),C=m.useRef(!1),R=m.useRef(!1),S=m.useRef(y),$=m.useRef(t),O=m.useRef(n),D=()=>O.current,I=()=>D().isVisible()&&D().isOnline(),[L,j,B,te]=i5(r,y),q=m.useRef({}).current,F=jt(s)?n.fallback[y]:s,Q=(Z,be)=>{for(const Se in q){const $e=Se;if($e==="data"){if(!o(Z[$e],be[$e])&&(!jt(Z[$e])||!o(ce,be[$e])))return!1}else if(be[$e]!==Z[$e])return!1}return!0},G=m.useMemo(()=>{const Z=!y||!t?!1:jt(a)?D().isPaused()||i?!1:jt(l)?!0:l:a,be=Ie=>{const Ke=va(Ie);return delete Ke._k,Z?{isValidating:!0,isLoading:!0,...Ke}:Ke},Se=L(),$e=te(),Te=be(Se),Ue=Se===$e?Te:be($e);let Be=Te;return[()=>{const Ie=be(L());return Q(Ie,Be)?(Be.data=Ie.data,Be.isLoading=Ie.isLoading,Be.isValidating=Ie.isValidating,Be.error=Ie.error,Be):(Be=Ie,Ie)},()=>Ue]},[r,y]),K=Nue.useSyncExternalStore(m.useCallback(Z=>B(y,(be,Se)=>{Q(Se,be)||Z()}),[r,y]),G[0],G[1]),W=!C.current,T=p[y]&&p[y].length>0,H=K.data,U=jt(H)?F:H,M=K.error,re=m.useRef(U),ce=h?jt(H)?re.current:H:U,ue=T&&!jt(M)?!1:W&&!jt(a)?a:D().isPaused()?!1:i?jt(U)?!1:l:jt(U)||l,he=!!(y&&t&&W&&ue),J=jt(K.isValidating)?he:K.isValidating,ee=jt(K.isLoading)?he:K.isLoading,ie=m.useCallback(async Z=>{const be=$.current;if(!y||!be||R.current||D().isPaused())return!1;let Se,$e,Te=!0;const Ue=Z||{},Be=!b[y]||!Ue.dedupe,Ie=()=>m2?!R.current&&y===S.current&&C.current:y===S.current,Ke={isValidating:!1,isLoading:!1},lt=()=>{j(Ke)},Nt=()=>{const Wt=b[y];Wt&&Wt[1]===$e&&delete b[y]},At={isValidating:!0};jt(L().data)&&(At.isLoading=!0);try{if(Be&&(j(At),n.loadingTimeout&&jt(L().data)&&setTimeout(()=>{Te&&Ie()&&D().onLoadingSlow(y,n)},n.loadingTimeout),b[y]=[be(_),I1()]),[Se,$e]=b[y],Se=await Se,Be&&setTimeout(Nt,n.dedupingInterval),!b[y]||b[y][1]!==$e)return Be&&Ie()&&D().onDiscarded(y),!1;Ke.error=Nr;const Wt=v[y];if(!jt(Wt)&&($e<=Wt[0]||$e<=Wt[1]||Wt[1]===0))return lt(),Be&&Ie()&&D().onDiscarded(y),!1;const pe=L().data;Ke.data=o(pe,Se)?pe:Se,Be&&Ie()&&D().onSuccess(Se,y,n)}catch(Wt){Nt();const pe=D(),{shouldRetryOnError:Re}=pe;pe.isPaused()||(Ke.error=Wt,Be&&Ie()&&(pe.onError(Wt,y,pe),(Re===!0||xi(Re)&&Re(Wt))&&(!D().revalidateOnFocus||!D().revalidateOnReconnect||I())&&pe.onErrorRetry(Wt,y,pe,Le=>{const qe=p[y];qe&&qe[0]&&qe[0](hd.ERROR_REVALIDATE_EVENT,Le)},{retryCount:(Ue.retryCount||0)+1,dedupe:!0})))}return Te=!1,lt(),!0},[y,r]),me=m.useCallback((...Z)=>c5(r,S.current,...Z),[]);if(yy(()=>{$.current=t,O.current=n,jt(H)||(re.current=H)}),yy(()=>{if(!y)return;const Z=ie.bind(Nr,wy);let be=0;const $e=ude(y,p,(Te,Ue={})=>{if(Te==hd.FOCUS_EVENT){const Be=Date.now();D().revalidateOnFocus&&Be>be&&I()&&(be=Be+D().focusThrottleInterval,Z())}else if(Te==hd.RECONNECT_EVENT)D().revalidateOnReconnect&&I()&&Z();else{if(Te==hd.MUTATE_EVENT)return ie();if(Te==hd.ERROR_REVALIDATE_EVENT)return ie(Ue)}});return R.current=!1,S.current=y,C.current=!0,j({_k:_}),ue&&(jt(U)||Ef?Z():Gue(Z)),()=>{R.current=!0,$e()}},[y]),yy(()=>{let Z;function be(){const $e=xi(c)?c(L().data):c;$e&&Z!==-1&&(Z=setTimeout(Se,$e))}function Se(){!L().error&&(u||D().isVisible())&&(f||D().isOnline())?ie(wy).then(be):be()}return be(),()=>{Z&&(clearTimeout(Z),Z=-1)}},[c,u,f,y]),m.useDebugValue(ce),i&&jt(U)&&y){if(!m2&&Ef)throw new Error("Fallback data is required when using suspense in SSR.");$.current=t,O.current=n,R.current=!1;const Z=w[y];if(!jt(Z)){const be=me(Z);y2(be)}if(jt(M)){const be=ie(wy);jt(ce)||(be.status="fulfilled",be.value=!0),y2(be)}else throw M}return{mutate:me,get data(){return q.data=!0,ce},get error(){return q.error=!0,M},get isValidating(){return q.isValidating=!0,J},get isLoading(){return q.isLoading=!0,ee}}},og=cde(dde);var fde=async(e,t,n,r,o,i,s,a,l,c,u,f,h,p,v,b,w)=>{var y;const _=s.current;n(t.messages,!1);const C=p?t.messages:t.messages.map(({role:R,content:S,experimental_attachments:$,name:O,data:D,annotations:I,toolInvocations:L,function_call:j,tool_calls:B,tool_call_id:te})=>({role:R,content:S,...$!==void 0&&{experimental_attachments:$},...O!==void 0&&{name:O},...D!==void 0&&{data:D},...I!==void 0&&{annotations:I},...L!==void 0&&{toolInvocations:L},tool_call_id:te,...j!==void 0&&{function_call:j},...B!==void 0&&{tool_calls:B}}));return await kue({api:e,body:(y=v==null?void 0:v({messages:t.messages,requestData:t.data,requestBody:t.body}))!=null?y:{messages:C,data:t.data,...i.current.body,...t.body,...t.functions!==void 0&&{functions:t.functions},...t.function_call!==void 0&&{function_call:t.function_call},...t.tools!==void 0&&{tools:t.tools},...t.tool_choice!==void 0&&{tool_choice:t.tool_choice}},streamProtocol:c,credentials:i.current.credentials,headers:{...i.current.headers,...t.headers},abortController:()=>a.current,restoreMessagesOnFailure(){w||n(_,!1)},onResponse:f,onUpdate(R,S){n([...t.messages,...R],!1),r([...o||[],...S||[]],!1)},onToolCall:h,onFinish:u,generateId:l,fetch:b})};function hde({api:e="/api/chat",id:t,initialMessages:n,initialInput:r="",sendExtraMessageFields:o,experimental_onFunctionCall:i,experimental_onToolCall:s,onToolCall:a,experimental_prepareRequestBody:l,experimental_maxAutomaticRoundtrips:c=0,maxAutomaticRoundtrips:u=c,maxToolRoundtrips:f=u,streamMode:h,streamProtocol:p,onResponse:v,onFinish:b,onError:w,credentials:y,headers:_,body:C,generateId:R=r5,fetch:S,keepLastMessageOnError:$=!1}={}){h&&(p??(p=h==="text"?"text":void 0));const O=m.useId(),D=t??O,I=typeof e=="string"?[e,D]:D,[L]=m.useState([]),{data:j,mutate:B}=og([I,"messages"],null,{fallbackData:n??L}),{data:te=!1,mutate:q}=og([I,"loading"],null),{data:F,mutate:Q}=og([I,"streamData"],null),{data:G=void 0,mutate:K}=og([I,"error"],null),W=m.useRef(j||[]);m.useEffect(()=>{W.current=j||[]},[j]);const T=m.useRef(null),H=m.useRef({credentials:y,headers:_,body:C});m.useEffect(()=>{H.current={credentials:y,headers:_,body:C}},[y,_,C]);const U=m.useCallback(async Z=>{const be=W.current.length;try{q(!0),K(void 0);const Te=new AbortController;T.current=Te,await Iue({getStreamedResponse:()=>fde(e,Z,B,Q,F,H,W,T,R,p,b,v,a,o,l,S,$),experimental_onFunctionCall:i,experimental_onToolCall:s,updateChatRequest:Ue=>{Z=Ue},getCurrentMessages:()=>W.current}),T.current=null}catch(Te){if(Te.name==="AbortError")return T.current=null,null;w&&Te instanceof Error&&w(Te),K(Te)}finally{q(!1)}const Se=W.current,$e=Se[Se.length-1];Se.length>be&&$e!=null&&f>0&&x2($e)&&pde(Se)<=f&&await U({messages:Se})},[B,q,e,H,v,b,w,K,Q,F,p,o,i,s,l,a,f,W,T,R,S,$]),M=m.useCallback(async(Z,{options:be,functions:Se,function_call:$e,tools:Te,tool_choice:Ue,data:Be,headers:Ie,body:Ke}={})=>{Z.id||(Z.id=R());const lt={headers:Ie??(be==null?void 0:be.headers),body:Ke??(be==null?void 0:be.body)},Nt={messages:W.current.concat(Z),options:lt,headers:lt.headers,body:lt.body,data:Be,...Se!==void 0&&{functions:Se},...$e!==void 0&&{function_call:$e},...Te!==void 0&&{tools:Te},...Ue!==void 0&&{tool_choice:Ue}};return U(Nt)},[U,R]),re=m.useCallback(async({options:Z,functions:be,function_call:Se,tools:$e,tool_choice:Te,data:Ue,headers:Be,body:Ie}={})=>{if(W.current.length===0)return null;const Ke={headers:Be??(Z==null?void 0:Z.headers),body:Ie??(Z==null?void 0:Z.body)};if(W.current[W.current.length-1].role==="assistant"){const At={messages:W.current.slice(0,-1),options:Ke,headers:Ke.headers,body:Ke.body,data:Ue,...be!==void 0&&{functions:be},...Se!==void 0&&{function_call:Se},...$e!==void 0&&{tools:$e},...Te!==void 0&&{tool_choice:Te}};return U(At)}const Nt={messages:W.current,options:Ke,headers:Ke.headers,body:Ke.body,data:Ue,...be!==void 0&&{functions:be},...Se!==void 0&&{function_call:Se},...$e!==void 0&&{tools:$e},...Te!==void 0&&{tool_choice:Te}};return U(Nt)},[U]),ce=m.useCallback(()=>{T.current&&(T.current.abort(),T.current=null)},[]),ue=m.useCallback(Z=>{typeof Z=="function"&&(Z=Z(W.current)),B(Z,!1),W.current=Z},[B]),[he,J]=m.useState(r),ee=m.useCallback(async(Z,be={},Se)=>{var $e,Te,Ue,Be,Ie;if(($e=Z==null?void 0:Z.preventDefault)==null||$e.call(Z),!he&&!be.allowEmptySubmit)return;Se&&(H.current={...H.current,...Se});const Ke=[],lt=be.experimental_attachments;if(lt)if(lt instanceof FileList)for(const pe of Array.from(lt)){const{name:Re,type:Le}=pe,qe=await new Promise((Ze,Ut)=>{const en=new FileReader;en.onload=Xt=>{var vn;Ze((vn=Xt.target)==null?void 0:vn.result)},en.onerror=Xt=>Ut(Xt),en.readAsDataURL(pe)});Ke.push({name:Re,contentType:Le,url:qe})}else if(Array.isArray(lt))for(const pe of lt){const{name:Re,url:Le,contentType:qe}=pe;Ke.push({name:Re,contentType:qe,url:Le})}else throw new Error("Invalid attachments type");const Nt={headers:(Ue=be.headers)!=null?Ue:(Te=be.options)==null?void 0:Te.headers,body:(Ie=be.body)!=null?Ie:(Be=be.options)==null?void 0:Be.body},Wt={messages:!he&&be.allowEmptySubmit?W.current:W.current.concat({id:R(),createdAt:new Date,role:"user",content:he,experimental_attachments:Ke.length>0?Ke:void 0}),options:Nt,headers:Nt.headers,body:Nt.body,data:be.data};U(Wt),J("")},[he,R,U]),ie=Z=>{J(Z.target.value)},me=({toolCallId:Z,result:be})=>{const Se=W.current.map((Te,Ue,Be)=>Ue===Be.length-1&&Te.role==="assistant"&&Te.toolInvocations?{...Te,toolInvocations:Te.toolInvocations.map(Ie=>Ie.toolCallId===Z?{...Ie,result:be}:Ie)}:Te);B(Se,!1);const $e=Se[Se.length-1];x2($e)&&U({messages:Se})};return{messages:j||[],error:G,append:M,reload:re,stop:ce,setMessages:ue,input:he,setInput:J,handleInputChange:ie,handleSubmit:ee,isLoading:te,data:F,addToolResult:me,experimental_addToolResult:me}}function x2(e){return e.role==="assistant"&&e.toolInvocations&&e.toolInvocations.length>0&&e.toolInvocations.every(t=>"result"in t)}function pde(e){let t=0;for(let n=e.length-1;n>=0&&e[n].role==="assistant";n--)t++;return t}const f5="Switch",[gde,K1e]=tr(f5),[mde,vde]=gde(f5),bde=m.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:c,...u}=e,[f,h]=m.useState(null),p=Ct(t,_=>h(_)),v=m.useRef(!1),b=f?!!f.closest("form"):!0,[w=!1,y]=Cr({prop:o,defaultProp:i,onChange:c});return m.createElement(mde,{scope:n,checked:w,disabled:a},m.createElement(Qe.button,de({type:"button",role:"switch","aria-checked":w,"aria-required":s,"data-state":h5(w),"data-disabled":a?"":void 0,disabled:a,value:l},u,{ref:p,onClick:Me(e.onClick,_=>{y(C=>!C),b&&(v.current=_.isPropagationStopped(),v.current||_.stopPropagation())})})),b&&m.createElement(wde,{control:f,bubbles:!v.current,name:r,value:l,checked:w,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),yde="SwitchThumb",xde=m.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=vde(yde,n);return m.createElement(Qe.span,de({"data-state":h5(o.checked),"data-disabled":o.disabled?"":void 0},r,{ref:t}))}),wde=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),s=fv(n),a=av(t);return m.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const h=new Event("click",{bubbles:r});f.call(l,n),l.dispatchEvent(h)}},[s,n,r]),m.createElement("input",de({type:"checkbox","aria-hidden":!0,defaultChecked:n},o,{tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function h5(e){return e?"checked":"unchecked"}const Dv=bde,p5=xde,g5=N.forwardRef(({className:e,...t},n)=>E.jsx(Dv,{className:xe("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:E.jsx(p5,{className:xe("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));g5.displayName=Dv.displayName;const _de=N.forwardRef(({className:e,...t},n)=>E.jsx(Dv,{className:xe("peer inline-flex h-4 w-8 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:E.jsx(p5,{className:xe("pointer-events-none block h-3 w-3 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));_de.displayName=Dv.displayName;function Cde(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Sde=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ede=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Rde={};function w2(e,t){return((t||Rde).jsx?Ede:Sde).test(e)}const Pde=/[ \t\n\f\r]/g;function Ode(e){return typeof e=="object"?e.type==="text"?_2(e.value):!1:_2(e)}function _2(e){return e.replace(Pde,"")===""}class bh{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}bh.prototype.property={};bh.prototype.normal={};bh.prototype.space=null;function m5(e,t){const n={},r={};let o=-1;for(;++o<e.length;)Object.assign(n,e[o].property),Object.assign(r,e[o].normal);return new bh(n,r,t)}function N1(e){return e.toLowerCase()}class Lo{constructor(t,n){this.property=t,this.attribute=n}}Lo.prototype.space=null;Lo.prototype.boolean=!1;Lo.prototype.booleanish=!1;Lo.prototype.overloadedBoolean=!1;Lo.prototype.number=!1;Lo.prototype.commaSeparated=!1;Lo.prototype.spaceSeparated=!1;Lo.prototype.commaOrSpaceSeparated=!1;Lo.prototype.mustUseProperty=!1;Lo.prototype.defined=!1;let $de=0;const vt=Ll(),Mn=Ll(),v5=Ll(),De=Ll(),sn=Ll(),kc=Ll(),Xr=Ll();function Ll(){return 2**++$de}const L1=Object.freeze(Object.defineProperty({__proto__:null,boolean:vt,booleanish:Mn,commaOrSpaceSeparated:Xr,commaSeparated:kc,number:De,overloadedBoolean:v5,spaceSeparated:sn},Symbol.toStringTag,{value:"Module"})),_y=Object.keys(L1);class kC extends Lo{constructor(t,n,r,o){let i=-1;if(super(t,n),C2(this,"space",o),typeof r=="number")for(;++i<_y.length;){const s=_y[i];C2(this,_y[i],(r&L1[s])===L1[s])}}}kC.prototype.defined=!0;function C2(e,t,n){n&&(e[t]=n)}const Tde={}.hasOwnProperty;function Eu(e){const t={},n={};let r;for(r in e.properties)if(Tde.call(e.properties,r)){const o=e.properties[r],i=new kC(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[N1(r)]=r,n[N1(i.attribute)]=r}return new bh(t,n,e.space)}const b5=Eu({space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),y5=Eu({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function x5(e,t){return t in e?e[t]:t}function w5(e,t){return x5(e,t.toLowerCase())}const _5=Eu({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:w5,properties:{xmlns:null,xmlnsXLink:null}}),C5=Eu({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:Mn,ariaAutoComplete:null,ariaBusy:Mn,ariaChecked:Mn,ariaColCount:De,ariaColIndex:De,ariaColSpan:De,ariaControls:sn,ariaCurrent:null,ariaDescribedBy:sn,ariaDetails:null,ariaDisabled:Mn,ariaDropEffect:sn,ariaErrorMessage:null,ariaExpanded:Mn,ariaFlowTo:sn,ariaGrabbed:Mn,ariaHasPopup:null,ariaHidden:Mn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:sn,ariaLevel:De,ariaLive:null,ariaModal:Mn,ariaMultiLine:Mn,ariaMultiSelectable:Mn,ariaOrientation:null,ariaOwns:sn,ariaPlaceholder:null,ariaPosInSet:De,ariaPressed:Mn,ariaReadOnly:Mn,ariaRelevant:null,ariaRequired:Mn,ariaRoleDescription:sn,ariaRowCount:De,ariaRowIndex:De,ariaRowSpan:De,ariaSelected:Mn,ariaSetSize:De,ariaSort:null,ariaValueMax:De,ariaValueMin:De,ariaValueNow:De,ariaValueText:null,role:null}}),Dde=Eu({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:w5,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:kc,acceptCharset:sn,accessKey:sn,action:null,allow:null,allowFullScreen:vt,allowPaymentRequest:vt,allowUserMedia:vt,alt:null,as:null,async:vt,autoCapitalize:null,autoComplete:sn,autoFocus:vt,autoPlay:vt,blocking:sn,capture:null,charSet:null,checked:vt,cite:null,className:sn,cols:De,colSpan:null,content:null,contentEditable:Mn,controls:vt,controlsList:sn,coords:De|kc,crossOrigin:null,data:null,dateTime:null,decoding:null,default:vt,defer:vt,dir:null,dirName:null,disabled:vt,download:v5,draggable:Mn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:vt,formTarget:null,headers:sn,height:De,hidden:vt,high:De,href:null,hrefLang:null,htmlFor:sn,httpEquiv:sn,id:null,imageSizes:null,imageSrcSet:null,inert:vt,inputMode:null,integrity:null,is:null,isMap:vt,itemId:null,itemProp:sn,itemRef:sn,itemScope:vt,itemType:sn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:vt,low:De,manifest:null,max:null,maxLength:De,media:null,method:null,min:null,minLength:De,multiple:vt,muted:vt,name:null,nonce:null,noModule:vt,noValidate:vt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:vt,optimum:De,pattern:null,ping:sn,placeholder:null,playsInline:vt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:vt,referrerPolicy:null,rel:sn,required:vt,reversed:vt,rows:De,rowSpan:De,sandbox:sn,scope:null,scoped:vt,seamless:vt,selected:vt,shadowRootDelegatesFocus:vt,shadowRootMode:null,shape:null,size:De,sizes:null,slot:null,span:De,spellCheck:Mn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:De,step:null,style:null,tabIndex:De,target:null,title:null,translate:null,type:null,typeMustMatch:vt,useMap:null,value:Mn,width:De,wrap:null,align:null,aLink:null,archive:sn,axis:null,background:null,bgColor:null,border:De,borderColor:null,bottomMargin:De,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:vt,declare:vt,event:null,face:null,frame:null,frameBorder:null,hSpace:De,leftMargin:De,link:null,longDesc:null,lowSrc:null,marginHeight:De,marginWidth:De,noResize:vt,noHref:vt,noShade:vt,noWrap:vt,object:null,profile:null,prompt:null,rev:null,rightMargin:De,rules:null,scheme:null,scrolling:Mn,standby:null,summary:null,text:null,topMargin:De,valueType:null,version:null,vAlign:null,vLink:null,vSpace:De,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:vt,disableRemotePlayback:vt,prefix:null,property:null,results:De,security:null,unselectable:null}}),Ade=Eu({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:x5,properties:{about:Xr,accentHeight:De,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:De,amplitude:De,arabicForm:null,ascent:De,attributeName:null,attributeType:null,azimuth:De,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:De,by:null,calcMode:null,capHeight:De,className:sn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:De,diffuseConstant:De,direction:null,display:null,dur:null,divisor:De,dominantBaseline:null,download:vt,dx:null,dy:null,edgeMode:null,editable:null,elevation:De,enableBackground:null,end:null,event:null,exponent:De,externalResourcesRequired:null,fill:null,fillOpacity:De,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:kc,g2:kc,glyphName:kc,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:De,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:De,horizOriginX:De,horizOriginY:De,id:null,ideographic:De,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:De,k:De,k1:De,k2:De,k3:De,k4:De,kernelMatrix:Xr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:De,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:De,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:De,overlineThickness:De,paintOrder:null,panose1:null,path:null,pathLength:De,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:sn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:De,pointsAtY:De,pointsAtZ:De,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Xr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Xr,rev:Xr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Xr,requiredFeatures:Xr,requiredFonts:Xr,requiredFormats:Xr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:De,specularExponent:De,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:De,strikethroughThickness:De,string:null,stroke:null,strokeDashArray:Xr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:De,strokeOpacity:De,strokeWidth:null,style:null,surfaceScale:De,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Xr,tabIndex:De,tableValues:null,target:null,targetX:De,targetY:De,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Xr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:De,underlineThickness:De,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:De,values:null,vAlphabetic:De,vMathematical:De,vectorEffect:null,vHanging:De,vIdeographic:De,version:null,vertAdvY:De,vertOriginX:De,vertOriginY:De,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:De,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),kde=/^data[-\w.:]+$/i,S2=/-[a-z]/g,Mde=/[A-Z]/g;function Ide(e,t){const n=N1(t);let r=t,o=Lo;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&kde.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(S2,Lde);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!S2.test(i)){let s=i.replace(Mde,Nde);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}o=kC}return new o(r,t)}function Nde(e){return"-"+e.toLowerCase()}function Lde(e){return e.charAt(1).toUpperCase()}const Fde={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},jde=m5([y5,b5,_5,C5,Dde],"html"),MC=m5([y5,b5,_5,C5,Ade],"svg");function zde(e){return e.join(" ").trim()}var S5={},E2=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Bde=/\n/g,Vde=/^\s*/,Hde=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Wde=/^:\s*/,Ude=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Gde=/^[;\s]*/,qde=/^\s+|\s+$/g,Yde=`