react-semaphor 0.0.320 → 0.0.321

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.
@@ -88,7 +88,7 @@ __p += '`),kt&&(Se+=`' +
88
88
  function print() { __p += __j.call(arguments, '') }
89
89
  `:`;
90
90
  `)+Se+`return __p
91
- }`;var gt=zT(function(){return Vt(V,He+"return "+Se).apply(n,X)});if(gt.source=Se,Jv(gt))throw gt;return gt}function aq(f){return qt(f).toLowerCase()}function lq(f){return qt(f).toUpperCase()}function cq(f,g,w){if(f=qt(f),f&&(w||g===n))return K2(f);if(!f||!(g=Si(g)))return f;var T=po(f),N=po(g),V=X2(T,N),X=Q2(T,N)+1;return ha(T,V,X).join("")}function uq(f,g,w){if(f=qt(f),f&&(w||g===n))return f.slice(0,Z2(f)+1);if(!f||!(g=Si(g)))return f;var T=po(f),N=Q2(T,po(g))+1;return ha(T,0,N).join("")}function dq(f,g,w){if(f=qt(f),f&&(w||g===n))return f.replace(mn,"");if(!f||!(g=Si(g)))return f;var T=po(f),N=X2(T,po(g));return ha(T,N).join("")}function fq(f,g){var w=F,T=j;if(Rn(g)){var N="separator"in g?g.separator:N;w="length"in g?ut(g.length):w,T="omission"in g?Si(g.omission):T}f=qt(f);var V=f.length;if(Bc(f)){var X=po(f);V=X.length}if(w>=V)return f;var re=w-Hc(T);if(re<1)return T;var ue=X?ha(X,0,re).join(""):f.slice(0,re);if(N===n)return ue+T;if(X&&(re+=ue.length-re),Zv(N)){if(f.slice(re).search(N)){var ve,xe=ue;for(N.global||(N=gv(N.source,qt(jt.exec(N))+"g")),N.lastIndex=0;ve=N.exec(xe);)var Se=ve.index;ue=ue.slice(0,Se===n?re:Se)}}else if(f.indexOf(Si(N),re)!=re){var Ie=ue.lastIndexOf(N);Ie>-1&&(ue=ue.slice(0,Ie))}return ue+T}function hq(f){return f=qt(f),f&&kr.test(f)?f.replace(Lo,HB):f}var pq=Kc(function(f,g,w){return f+(w?" ":"")+g.toUpperCase()}),nx=BP("toUpperCase");function $T(f,g,w){return f=qt(f),g=w?n:g,g===n?FB(f)?UB(f):TB(f):f.match(g)||[]}var zT=wt(function(f,g){try{return xi(f,n,g)}catch(w){return Jv(w)?w:new ot(w)}}),gq=Es(function(f,g){return Gi(g,function(w){w=$o(w),_s(f,w,Xv(f[w],f))}),f});function mq(f){var g=f==null?0:f.length,w=We();return f=g?En(f,function(T){if(typeof T[1]!="function")throw new qi(s);return[w(T[0]),T[1]]}):[],wt(function(T){for(var N=-1;++N<g;){var V=f[N];if(xi(V[0],this,T))return xi(V[1],this,T)}})}function bq(f){return HH(Ki(f,d))}function rx(f){return function(){return f}}function yq(f,g){return f==null||f!==f?g:f}var vq=VP(),xq=VP(!0);function ni(f){return f}function ix(f){return vP(typeof f=="function"?f:Ki(f,d))}function wq(f){return wP(Ki(f,d))}function Sq(f,g){return SP(f,Ki(g,d))}var _q=wt(function(f,g){return function(w){return Yd(w,f,g)}}),Cq=wt(function(f,g){return function(w){return Yd(f,w,g)}});function ox(f,g,w){var T=ir(g),N=mg(g,T);w==null&&!(Rn(g)&&(N.length||!T.length))&&(w=g,g=f,f=this,N=mg(g,ir(g)));var V=!(Rn(w)&&"chain"in w)||!!w.chain,X=Ps(f);return Gi(N,function(re){var ue=g[re];f[re]=ue,X&&(f.prototype[re]=function(){var ve=this.__chain__;if(V||ve){var xe=f(this.__wrapped__),Se=xe.__actions__=Zr(this.__actions__);return Se.push({func:ue,args:arguments,thisArg:f}),xe.__chain__=ve,xe}return ue.apply(f,aa([this.value()],arguments))})}),f}function Eq(){return ur._===this&&(ur._=QB),this}function sx(){}function Rq(f){return f=ut(f),wt(function(g){return _P(g,f)})}var Pq=Fv(En),Tq=Fv(W2),Mq=Fv(lv);function BT(f){return Wv(f)?cv($o(f)):oV(f)}function Oq(f){return function(g){return f==null?n:hl(f,g)}}var Dq=UP(),Aq=UP(!0);function ax(){return[]}function lx(){return!1}function Iq(){return{}}function kq(){return""}function Nq(){return!0}function Lq(f,g){if(f=ut(f),f<1||f>U)return[];var w=Q,T=xr(f,Q);g=We(g),f-=Q;for(var N=fv(T,g);++w<f;)g(w);return N}function Fq(f){return at(f)?En(f,$o):_i(f)?[f]:Zr(aT(qt(f)))}function jq(f){var g=++KB;return qt(f)+g}var $q=Sg(function(f,g){return f+g},0),zq=jv("ceil"),Bq=Sg(function(f,g){return f/g},1),Hq=jv("floor");function Vq(f){return f&&f.length?gg(f,ni,_v):n}function Wq(f,g){return f&&f.length?gg(f,We(g,2),_v):n}function Uq(f){return q2(f,ni)}function Gq(f,g){return q2(f,We(g,2))}function qq(f){return f&&f.length?gg(f,ni,Pv):n}function Yq(f,g){return f&&f.length?gg(f,We(g,2),Pv):n}var Kq=Sg(function(f,g){return f*g},1),Xq=jv("round"),Qq=Sg(function(f,g){return f-g},0);function Jq(f){return f&&f.length?dv(f,ni):0}function Zq(f,g){return f&&f.length?dv(f,We(g,2)):0}return z.after=wU,z.ary=yT,z.assign=lG,z.assignIn=AT,z.assignInWith=Ng,z.assignWith=cG,z.at=uG,z.before=vT,z.bind=Xv,z.bindAll=gq,z.bindKey=xT,z.castArray=IU,z.chain=gT,z.chunk=HV,z.compact=VV,z.concat=WV,z.cond=mq,z.conforms=bq,z.constant=rx,z.countBy=JW,z.create=dG,z.curry=wT,z.curryRight=ST,z.debounce=_T,z.defaults=fG,z.defaultsDeep=hG,z.defer=SU,z.delay=_U,z.difference=UV,z.differenceBy=GV,z.differenceWith=qV,z.drop=YV,z.dropRight=KV,z.dropRightWhile=XV,z.dropWhile=QV,z.fill=JV,z.filter=eU,z.flatMap=rU,z.flatMapDeep=iU,z.flatMapDepth=oU,z.flatten=dT,z.flattenDeep=ZV,z.flattenDepth=eW,z.flip=CU,z.flow=vq,z.flowRight=xq,z.fromPairs=tW,z.functions=xG,z.functionsIn=wG,z.groupBy=sU,z.initial=rW,z.intersection=iW,z.intersectionBy=oW,z.intersectionWith=sW,z.invert=_G,z.invertBy=CG,z.invokeMap=lU,z.iteratee=ix,z.keyBy=cU,z.keys=ir,z.keysIn=ti,z.map=Mg,z.mapKeys=RG,z.mapValues=PG,z.matches=wq,z.matchesProperty=Sq,z.memoize=Dg,z.merge=TG,z.mergeWith=IT,z.method=_q,z.methodOf=Cq,z.mixin=ox,z.negate=Ag,z.nthArg=Rq,z.omit=MG,z.omitBy=OG,z.once=EU,z.orderBy=uU,z.over=Pq,z.overArgs=RU,z.overEvery=Tq,z.overSome=Mq,z.partial=Qv,z.partialRight=CT,z.partition=dU,z.pick=DG,z.pickBy=kT,z.property=BT,z.propertyOf=Oq,z.pull=uW,z.pullAll=hT,z.pullAllBy=dW,z.pullAllWith=fW,z.pullAt=hW,z.range=Dq,z.rangeRight=Aq,z.rearg=PU,z.reject=pU,z.remove=pW,z.rest=TU,z.reverse=Yv,z.sampleSize=mU,z.set=IG,z.setWith=kG,z.shuffle=bU,z.slice=gW,z.sortBy=xU,z.sortedUniq=SW,z.sortedUniqBy=_W,z.split=rq,z.spread=MU,z.tail=CW,z.take=EW,z.takeRight=RW,z.takeRightWhile=PW,z.takeWhile=TW,z.tap=VW,z.throttle=OU,z.thru=Tg,z.toArray=MT,z.toPairs=NT,z.toPairsIn=LT,z.toPath=Fq,z.toPlainObject=DT,z.transform=NG,z.unary=DU,z.union=MW,z.unionBy=OW,z.unionWith=DW,z.uniq=AW,z.uniqBy=IW,z.uniqWith=kW,z.unset=LG,z.unzip=Kv,z.unzipWith=pT,z.update=FG,z.updateWith=jG,z.values=Jc,z.valuesIn=$G,z.without=NW,z.words=$T,z.wrap=AU,z.xor=LW,z.xorBy=FW,z.xorWith=jW,z.zip=$W,z.zipObject=zW,z.zipObjectDeep=BW,z.zipWith=HW,z.entries=NT,z.entriesIn=LT,z.extend=AT,z.extendWith=Ng,ox(z,z),z.add=$q,z.attempt=zT,z.camelCase=VG,z.capitalize=FT,z.ceil=zq,z.clamp=zG,z.clone=kU,z.cloneDeep=LU,z.cloneDeepWith=FU,z.cloneWith=NU,z.conformsTo=jU,z.deburr=jT,z.defaultTo=yq,z.divide=Bq,z.endsWith=WG,z.eq=mo,z.escape=UG,z.escapeRegExp=GG,z.every=ZW,z.find=tU,z.findIndex=cT,z.findKey=pG,z.findLast=nU,z.findLastIndex=uT,z.findLastKey=gG,z.floor=Hq,z.forEach=mT,z.forEachRight=bT,z.forIn=mG,z.forInRight=bG,z.forOwn=yG,z.forOwnRight=vG,z.get=ex,z.gt=$U,z.gte=zU,z.has=SG,z.hasIn=tx,z.head=fT,z.identity=ni,z.includes=aU,z.indexOf=nW,z.inRange=BG,z.invoke=EG,z.isArguments=ml,z.isArray=at,z.isArrayBuffer=BU,z.isArrayLike=ei,z.isArrayLikeObject=jn,z.isBoolean=HU,z.isBuffer=pa,z.isDate=VU,z.isElement=WU,z.isEmpty=UU,z.isEqual=GU,z.isEqualWith=qU,z.isError=Jv,z.isFinite=YU,z.isFunction=Ps,z.isInteger=ET,z.isLength=Ig,z.isMap=RT,z.isMatch=KU,z.isMatchWith=XU,z.isNaN=QU,z.isNative=JU,z.isNil=eG,z.isNull=ZU,z.isNumber=PT,z.isObject=Rn,z.isObjectLike=On,z.isPlainObject=ef,z.isRegExp=Zv,z.isSafeInteger=tG,z.isSet=TT,z.isString=kg,z.isSymbol=_i,z.isTypedArray=Qc,z.isUndefined=nG,z.isWeakMap=rG,z.isWeakSet=iG,z.join=aW,z.kebabCase=qG,z.last=Qi,z.lastIndexOf=lW,z.lowerCase=YG,z.lowerFirst=KG,z.lt=oG,z.lte=sG,z.max=Vq,z.maxBy=Wq,z.mean=Uq,z.meanBy=Gq,z.min=qq,z.minBy=Yq,z.stubArray=ax,z.stubFalse=lx,z.stubObject=Iq,z.stubString=kq,z.stubTrue=Nq,z.multiply=Kq,z.nth=cW,z.noConflict=Eq,z.noop=sx,z.now=Og,z.pad=XG,z.padEnd=QG,z.padStart=JG,z.parseInt=ZG,z.random=HG,z.reduce=fU,z.reduceRight=hU,z.repeat=eq,z.replace=tq,z.result=AG,z.round=Xq,z.runInContext=le,z.sample=gU,z.size=yU,z.snakeCase=nq,z.some=vU,z.sortedIndex=mW,z.sortedIndexBy=bW,z.sortedIndexOf=yW,z.sortedLastIndex=vW,z.sortedLastIndexBy=xW,z.sortedLastIndexOf=wW,z.startCase=iq,z.startsWith=oq,z.subtract=Qq,z.sum=Jq,z.sumBy=Zq,z.template=sq,z.times=Lq,z.toFinite=Ts,z.toInteger=ut,z.toLength=OT,z.toLower=aq,z.toNumber=Ji,z.toSafeInteger=aG,z.toString=qt,z.toUpper=lq,z.trim=cq,z.trimEnd=uq,z.trimStart=dq,z.truncate=fq,z.unescape=hq,z.uniqueId=jq,z.upperCase=pq,z.upperFirst=nx,z.each=mT,z.eachRight=bT,z.first=fT,ox(z,function(){var f={};return Fo(z,function(g,w){en.call(z.prototype,w)||(f[w]=g)}),f}(),{chain:!1}),z.VERSION=r,Gi(["bind","bindKey","curry","curryRight","partial","partialRight"],function(f){z[f].placeholder=z}),Gi(["drop","take"],function(f,g){At.prototype[f]=function(w){w=w===n?1:Jn(ut(w),0);var T=this.__filtered__&&!g?new At(this):this.clone();return T.__filtered__?T.__takeCount__=xr(w,T.__takeCount__):T.__views__.push({size:xr(w,Q),type:f+(T.__dir__<0?"Right":"")}),T},At.prototype[f+"Right"]=function(w){return this.reverse()[f](w).reverse()}}),Gi(["filter","map","takeWhile"],function(f,g){var w=g+1,T=w==H||w==W;At.prototype[f]=function(N){var V=this.clone();return V.__iteratees__.push({iteratee:We(N,3),type:w}),V.__filtered__=V.__filtered__||T,V}}),Gi(["head","last"],function(f,g){var w="take"+(g?"Right":"");At.prototype[f]=function(){return this[w](1).value()[0]}}),Gi(["initial","tail"],function(f,g){var w="drop"+(g?"":"Right");At.prototype[f]=function(){return this.__filtered__?new At(this):this[w](1)}}),At.prototype.compact=function(){return this.filter(ni)},At.prototype.find=function(f){return this.filter(f).head()},At.prototype.findLast=function(f){return this.reverse().find(f)},At.prototype.invokeMap=wt(function(f,g){return typeof f=="function"?new At(this):this.map(function(w){return Yd(w,f,g)})}),At.prototype.reject=function(f){return this.filter(Ag(We(f)))},At.prototype.slice=function(f,g){f=ut(f);var w=this;return w.__filtered__&&(f>0||g<0)?new At(w):(f<0?w=w.takeRight(-f):f&&(w=w.drop(f)),g!==n&&(g=ut(g),w=g<0?w.dropRight(-g):w.take(g-f)),w)},At.prototype.takeRightWhile=function(f){return this.reverse().takeWhile(f).reverse()},At.prototype.toArray=function(){return this.take(Q)},Fo(At.prototype,function(f,g){var w=/^(?:filter|find|map|reject)|While$/.test(g),T=/^(?:head|last)$/.test(g),N=z[T?"take"+(g=="last"?"Right":""):g],V=T||/^find/.test(g);N&&(z.prototype[g]=function(){var X=this.__wrapped__,re=T?[1]:arguments,ue=X instanceof At,ve=re[0],xe=ue||at(X),Se=function(Rt){var kt=N.apply(z,aa([Rt],re));return T&&Ie?kt[0]:kt};xe&&w&&typeof ve=="function"&&ve.length!=1&&(ue=xe=!1);var Ie=this.__chain__,He=!!this.__actions__.length,Ue=V&&!Ie,gt=ue&&!He;if(!V&&xe){X=gt?X:new At(this);var Ge=f.apply(X,re);return Ge.__actions__.push({func:Tg,args:[Se],thisArg:n}),new Yi(Ge,Ie)}return Ue&&gt?f.apply(this,re):(Ge=this.thru(Se),Ue?T?Ge.value()[0]:Ge.value():Ge)})}),Gi(["pop","push","shift","sort","splice","unshift"],function(f){var g=eg[f],w=/^(?:push|sort|unshift)$/.test(f)?"tap":"thru",T=/^(?:pop|shift)$/.test(f);z.prototype[f]=function(){var N=arguments;if(T&&!this.__chain__){var V=this.value();return g.apply(at(V)?V:[],N)}return this[w](function(X){return g.apply(at(X)?X:[],N)})}}),Fo(At.prototype,function(f,g){var w=z[g];if(w){var T=w.name+"";en.call(Gc,T)||(Gc[T]=[]),Gc[T].push({name:g,func:w})}}),Gc[wg(n,x).name]=[{name:"wrapper",func:n}],At.prototype.clone=hH,At.prototype.reverse=pH,At.prototype.value=gH,z.prototype.at=WW,z.prototype.chain=UW,z.prototype.commit=GW,z.prototype.next=qW,z.prototype.plant=KW,z.prototype.reverse=XW,z.prototype.toJSON=z.prototype.valueOf=z.prototype.value=QW,z.prototype.first=z.prototype.head,Bd&&(z.prototype[Bd]=YW),z},Vc=GB();ll?((ll.exports=Vc)._=Vc,iv._=Vc):ur._=Vc}).call(Ca)})(mb,mb.exports);var Of=mb.exports;const Xl=Pc(Of);function aM({id:e,layouts:t,initialHeight:n,y:r,x:i,w:o,minH:s}){const a={i:e,x:i??0,y:r??1/0,w:o||20,h:n||35,minW:6,minH:s||10},l=t?{...t}:{};return V_.forEach(c=>{l[c]||(l[c]=[]);const u=l[c].reduce((d,p)=>Math.max(d,p.y+p.h),0);a.y=a.y===1/0?u:a.y,l[c].push({...a})}),l}function lM(e,t){if(!t)return;const n={...t};return V_.forEach(r=>{n[r]&&(n[r]=n[r].filter(i=>i.i!==e))}),n}function G_(e){return ye.getState().dashboard.globalCacheConfig}const ye=Jk()(oN((e,t)=>({isSessionExpired:!1,currentBreakpoint:"lg",dashboard:{id:"",style:gb},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:gb},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 o,s,a,l,c,u,d,p;const i=(o=r.dashboard.sheets)==null?void 0:o.findIndex(h=>h.id===n);if(i!==void 0&&i>-1){(s=r.dashboard.sheets)==null||s.splice(i,1);const h=(a=r.dashboard.filters)==null?void 0:a.filter(b=>b.sheetId===n),m=(l=r.filterValues)==null?void 0:l.filter(b=>h==null?void 0:h.some(y=>y.id===b.filterId));r.filterValues=(c=r.filterValues)==null?void 0:c.filter(b=>!(m!=null&&m.some(y=>y.filterId===b.filterId))),r.dashboard.filters=(u=r.dashboard.filters)==null?void 0:u.filter(b=>b.sheetId!==n),r.selectedSheetId=(p=(d=r.dashboard.sheets)==null?void 0:d[0])==null?void 0:p.id}})},addSheet:n=>{e(r=>{r.dashboard.sheets||(r.dashboard.sheets=[]);const i=r.dashboard.filters;let o={};i==null||i.forEach(a=>{V_.forEach(l=>{o!=null&&o[l]||(o={...o,[l]:[]});const c={i:a.id,x:0,y:0,w:10,h:8};o[l].push(c)})});const s={...n,layouts:o};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(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===i.selectedSheetId);o&&Of.forEach(o.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(d=>d.id===n);c&&(c.python=r)})})},addBaseQuery:n=>{e(r=>{var i;r.dashboard.baseQueries||(r.dashboard.baseQueries=[]),(i=r.dashboard.baseQueries)==null||i.push(n)})},removeBaseQuery:n=>{e(r=>{var o,s;const i=(o=r.dashboard.baseQueries)==null?void 0:o.findIndex(a=>a.id===n);i!=null&&i>-1&&((s=r.dashboard.baseQueries)==null||s.splice(i,1))})},setBaseQueries:n=>{e(r=>{r.dashboard.baseQueries=n})},setCurrentBreakpoint:n=>{e(()=>({currentBreakpoint:n}))},setFilteringCards:n=>{e(()=>({filteringCards:n}))},addFilteringCard:n=>{e(r=>{var i;(i=r.filteringCards)==null||i.push(n)})},removeFilteringCard:n=>{e(r=>{var o,s;const i=(o=r.filteringCards)==null?void 0:o.findIndex(a=>a.id===n.id);i!==void 0&&i>-1&&((s=r.filteringCards)==null||s.splice(i,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(i=>{i.dashboard=n,i.filterValues=r})},setDashboardTheme:n=>{e(r=>{r.theme=n})},setSheets:n=>{e(r=>{r.dashboard&&(r.dashboard.sheets=n)})},setSheetTitle:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);o&&(o.title=r)})},setCardTitle:(n,r,i)=>{e(o=>{var a,l;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&Of.forEach(s.frames,c=>{var d;const u=(d=c.cards)==null?void 0:d.find(p=>p.id===r);u&&(u.title=i)})})},setCardInfo:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===i.selectedSheetId);o&&Of.forEach(o.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(d=>d.id===n);c&&(c.info=r)})})},setCardDescription:(n,r,i)=>{e(o=>{var a,l;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&Of.forEach(s.frames,c=>{var d;const u=(d=c.cards)==null?void 0:d.find(p=>p.id===r);u&&(u.description=i)})})},setCardSql:(n,r,i)=>{e(o=>{var a,l,c,u;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(d=>d.id===n);if(s){const d=(c=s.cards)==null?void 0:c.find(p=>p.id===r);d&&(d.sql=i,(u=o.onUpdateCard)==null||u.call(o,d,n))}})},setSheetLayout:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);o&&(o.layout=r)})},setSheetLayouts:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);o&&(o.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 i=r.filterValues.findIndex(o=>o.filterId===n.filterId);i>-1?r.filterValues.splice(i,1,n):r.filterValues.push(n)}else r.filterValues=[n]})},addOrUpdateFilterValues:n=>{e(r=>{r.filterValues?n.forEach(i=>{var s,a,l;const o=(s=r==null?void 0:r.filterValues)==null?void 0:s.findIndex(c=>c.filterId===i.filterId);o!==void 0&&o>-1?(a=r.filterValues)==null||a.splice(o,1,i):(l=r.filterValues)==null||l.push(i)}):r.filterValues=n})},removeFilterValue:n=>{e(r=>{if(r.filterValues){const i=r.filterValues.filter(o=>o.filterId!==n&&!o.filterId.startsWith(n));r.filterValues=i}})},replaceFilterValue:n=>{e(r=>{if(r.filterValues){const i=r.filterValues.findIndex(o=>o.filterId===n.filterId);i>-1&&r.filterValues.splice(i,1,n)}})},addFilter:n=>{e(r=>{var o,s;r.dashboard.filters?(o=r.dashboard.filters)==null||o.push(n):r.dashboard.filters=[n],(s=r.dashboard.sheets)==null||s.find(a=>a.id===r.selectedSheetId);const i=r.dashboard.sheets;i==null||i.forEach(a=>{aM({id:n.id,layouts:a.layouts,y:0,initialHeight:8,minH:7,w:10})})})},removeFilter:n=>{e(r=>{var i,o,s;if(r.dashboard.filters){const a=(i=r.dashboard.filters)==null?void 0:i.findIndex(l=>l.id===n);if(a>-1){(o=r.dashboard.filters)==null||o.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=>{const u=lM(n,c.layouts);c.layouts=u})}}})},updateFrameCard:(n,r,i)=>{e(o=>{var l,c,u,d,p;const s=(c=(l=o.dashboard)==null?void 0:l.sheets)==null?void 0:c.find(h=>h.id===n);if(!s)return;const a=(u=s==null?void 0:s.frames)==null?void 0:u.find(h=>h.id===r);if(a){const h=(d=a.cards)==null?void 0:d.findIndex(m=>m.id===i.id);h>-1&&((p=a.cards)==null||p.splice(h,1,i))}})},updateFilter:n=>{e(r=>{var i,o;if(r.dashboard.filters){const s=(i=r.dashboard.filters)==null?void 0:i.findIndex(a=>a.id===n.id);s>-1&&((o=r.dashboard.filters)==null||o.splice(s,1,n))}})},setIsDashboardEditing:n=>{e(()=>({isDashboardEditing:n}))},setShowDashboardJSON:n=>{e(()=>({showDashboardJSON:n}))},setIsVisualEditing:n=>{e(()=>({isVisualEditing:n}))},addFrame:(n,r,i)=>{e(o=>{var a,l,c,u;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(d=>d.id===n);if(s){s.frames||(s.frames=[]),(c=s.frames)==null||c.push(r);let d=1/0;const p=0;i==="start"&&(d=0);const h=aM({id:r.id,layouts:s.layouts,minH:10,x:p,y:d});s.layouts=h,(u=o.onAddFrame)==null||u.call(o,r,n)}})},removeFrame:(n,r)=>{e(i=>{var s,a,l,c,u;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(d=>d.id===n);if(o){const d=(l=o.frames)==null?void 0:l.findIndex(p=>p.id===r);console.log(d),typeof d=="number"&&d>-1&&((c=o.frames)==null||c.splice(d,1),(u=o.layout)==null||u.splice(d,1),lM(r,o.layouts))}})},updateFrame:(n,r)=>{e(i=>{var a,l,c,u,d;const o=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(p=>p.id===n),s=(c=o==null?void 0:o.frames)==null?void 0:c.findIndex(p=>p.id===r.id);o&&((u=o.frames)==null||u.splice(s,1,r)),(d=i.onAcceptChanges)==null||d.call(i,r,i.dashboard)})},updateCard:(n,r)=>{e(i=>{var a,l,c,u,d;const o=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(p=>p.id===n),s=(c=o==null?void 0:o.cards)==null?void 0:c.findIndex(p=>p.id===r.id);o&&((u=o.cards)==null||u.splice(s,1,r),(d=i.onUpdateCard)==null||d.call(i,r,n))})},removeCard:(n,r)=>{e(i=>{var a,l,c,u,d,p;const o=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(h=>h.id===n),s=(c=o==null?void 0:o.cards)==null?void 0:c.findIndex(h=>h.id===r.id);o&&((u=o.cards)==null||u.splice(s,1),(d=o.layout)==null||d.splice(s,1),(p=i.onRemoveCard)==null||p.call(i,r,n))})},setStyle:n=>{e(r=>{r.dashboard&&(r.dashboard.style=n)})},setSelectedCardId:(n,r)=>{e(i=>{var s,a,l;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===n);o&&(((l=o.cards)==null?void 0:l.find(u=>u.id===r))?i.selectedCardId=r:i.selectedCardId=null)})},setSelectedFrameId:n=>{e(r=>{var o,s;((s=(o=r.dashboard)==null?void 0:o.sheets)==null?void 0:s.find(a=>a.id===r.selectedSheetId))&&(r.selectedFrameId=n)})},setSelectedSheetId:n=>{e(r=>{var o,s;((s=(o=r.dashboard)==null?void 0:o.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(i=>i.id===t().selectedSheetId)},getCardFrame:n=>{var i,o;const r=(i=t().dashboard)==null?void 0:i.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((o=a[l].cards)==null?void 0:o.find(u=>u.id===n))return a[l]}}},getSelectedFrame:()=>{var r,i,o;const n=(i=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:i.find(s=>s.id===t().selectedSheetId);return(o=n==null?void 0:n.frames)==null?void 0:o.find(s=>s.id===t().selectedFrameId)},getCard:n=>{var i,o;const r=(i=t().dashboard)==null?void 0:i.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=(o=a[l].cards)==null?void 0:o.find(u=>u.id===n);if(c)return c}}},getSelectedSheetLayout:()=>{var r,i;const n=(i=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:i.find(o=>o.id===t().selectedSheetId);return n==null?void 0:n.layout},getSelectedSheetLayouts:()=>{var r,i;const n=(i=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:i.find(o=>o.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 i,o;const r=(i=t().dashboard)==null?void 0:i.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((o=a[l].cards)==null?void 0:o.find(u=>u.id===n))return r[s]}}},handleDataPointClickAction:(n,r)=>{TK({card:n,dataPoint:r,set:e,get:t})}}}))),gr=()=>ye(e=>e.actions),MK={theme:"system",setTheme:()=>null},fN=P.createContext(MK);function OK({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[i,o]=P.useState(()=>localStorage.getItem(n)||t);P.useEffect(()=>{const a=window.document.documentElement;if(a.classList.remove("light","dark"),i==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";a.classList.add(l);return}a.classList.add(i)},[i]);const s={theme:i,setTheme:a=>{localStorage.setItem(n,a),o(a)}};return v.jsx(fN.Provider,{...r,value:s,children:e})}const hN=()=>{const e=P.useContext(fN);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};var hp=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(){}},hc=typeof window>"u"||"Deno"in globalThis;function to(){}function DK(e,t){return typeof e=="function"?e(t):e}function S1(e){return typeof e=="number"&&e>=0&&e!==1/0}function pN(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Cu(e,t){return typeof e=="function"?e(t):e}function Co(e,t){return typeof e=="function"?e(t):e}function cM(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==q_(s,t.options))return!1}else if(!vh(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||i&&i!==t.state.fetchStatus||o&&!o(t))}function uM(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(yh(t.options.mutationKey)!==yh(o))return!1}else if(!vh(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function q_(e,t){return((t==null?void 0:t.queryKeyHashFn)||yh)(e)}function yh(e){return JSON.stringify(e,(t,n)=>E1(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function vh(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!vh(e[n],t[n])):!1}function _1(e,t){if(e===t)return e;const n=dM(e)&&dM(t);if(n||E1(e)&&E1(t)){const r=n?e:Object.keys(e),i=r.length,o=n?t:Object.keys(t),s=o.length,a=n?[]:{};let l=0;for(let c=0;c<s;c++){const u=n?c:o[c];(!n&&r.includes(u)||n)&&e[u]===void 0&&t[u]===void 0?(a[u]=void 0,l++):(a[u]=_1(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return i===s&&l===i?e:a}return t}function C1(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function dM(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function E1(e){if(!fM(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!fM(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function fM(e){return Object.prototype.toString.call(e)==="[object Object]"}function AK(e){return new Promise(t=>{setTimeout(t,e)})}function R1(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return _1(e,t)}catch(r){console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${r}`)}return _1(e,t)}return t}function IK(e){return e}function kK(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function NK(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var bb=Symbol();function gN(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===bb&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===bb?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Vl,Ra,Fu,Nk,LK=(Nk=class extends hp{constructor(){super();Ze(this,Vl);Ze(this,Ra);Ze(this,Fu);je(this,Fu,t=>{if(!hc&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){se(this,Ra)||this.setEventListener(se(this,Fu))}onUnsubscribe(){var t;this.hasListeners()||((t=se(this,Ra))==null||t.call(this),je(this,Ra,void 0))}setEventListener(t){var n;je(this,Fu,t),(n=se(this,Ra))==null||n.call(this),je(this,Ra,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){se(this,Vl)!==t&&(je(this,Vl,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof se(this,Vl)=="boolean"?se(this,Vl):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Vl=new WeakMap,Ra=new WeakMap,Fu=new WeakMap,Nk),Y_=new LK,ju,Pa,$u,Lk,FK=(Lk=class extends hp{constructor(){super();Ze(this,ju,!0);Ze(this,Pa);Ze(this,$u);je(this,$u,t=>{if(!hc&&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(){se(this,Pa)||this.setEventListener(se(this,$u))}onUnsubscribe(){var t;this.hasListeners()||((t=se(this,Pa))==null||t.call(this),je(this,Pa,void 0))}setEventListener(t){var n;je(this,$u,t),(n=se(this,Pa))==null||n.call(this),je(this,Pa,t(this.setOnline.bind(this)))}setOnline(t){se(this,ju)!==t&&(je(this,ju,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return se(this,ju)}},ju=new WeakMap,Pa=new WeakMap,$u=new WeakMap,Lk),yb=new FK;function P1(){let e,t;const n=new Promise((i,o)=>{e=i,t=o});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}function jK(e){return Math.min(1e3*2**e,3e4)}function mN(e){return(e??"online")==="online"?yb.isOnline():!0}var bN=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function yx(e){return e instanceof bN}function yN(e){let t=!1,n=0,r=!1,i;const o=P1(),s=b=>{var y;r||(p(new bN(b)),(y=e.abort)==null||y.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>Y_.isFocused()&&(e.networkMode==="always"||yb.isOnline())&&e.canRun(),u=()=>mN(e.networkMode)&&e.canRun(),d=b=>{var y;r||(r=!0,(y=e.onSuccess)==null||y.call(e,b),i==null||i(),o.resolve(b))},p=b=>{var y;r||(r=!0,(y=e.onError)==null||y.call(e,b),i==null||i(),o.reject(b))},h=()=>new Promise(b=>{var y;i=x=>{(r||c())&&b(x)},(y=e.onPause)==null||y.call(e)}).then(()=>{var b;i=void 0,r||(b=e.onContinue)==null||b.call(e)}),m=()=>{if(r)return;let b;const y=n===0?e.initialPromise:void 0;try{b=y??e.fn()}catch(x){b=Promise.reject(x)}Promise.resolve(b).then(d).catch(x=>{var M;if(r)return;const S=e.retry??(hc?0:3),_=e.retryDelay??jK,C=typeof _=="function"?_(n,x):_,R=S===!0||typeof S=="number"&&n<S||typeof S=="function"&&S(n,x);if(t||!R){p(x);return}n++,(M=e.onFail)==null||M.call(e,n,x),AK(C).then(()=>c()?void 0:h()).then(()=>{t?p(x):m()})})};return{promise:o,cancel:s,continue:()=>(i==null||i(),o),cancelRetry:a,continueRetry:l,canStart:u,start:()=>(u()?m():h().then(m),o)}}function $K(){let e=[],t=0,n=a=>{a()},r=a=>{a()},i=a=>setTimeout(a,0);const o=a=>{t?e.push(a):i(()=>{n(a)})},s=()=>{const a=e;e=[],a.length&&i(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||s()}return l},batchCalls:a=>(...l)=>{o(()=>{a(...l)})},schedule:o,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{i=a}}}var pr=$K(),Wl,Fk,vN=(Fk=class{constructor(){Ze(this,Wl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),S1(this.gcTime)&&je(this,Wl,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(hc?1/0:5*60*1e3))}clearGcTimeout(){se(this,Wl)&&(clearTimeout(se(this,Wl)),je(this,Wl,void 0))}},Wl=new WeakMap,Fk),zu,Bu,eo,Er,lp,Ul,So,ks,jk,zK=(jk=class extends vN{constructor(t){super();Ze(this,So);Ze(this,zu);Ze(this,Bu);Ze(this,eo);Ze(this,Er);Ze(this,lp);Ze(this,Ul);je(this,Ul,!1),je(this,lp,t.defaultOptions),this.setOptions(t.options),this.observers=[],je(this,eo,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,je(this,zu,BK(this.options)),this.state=t.state??se(this,zu),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=se(this,Er))==null?void 0:t.promise}setOptions(t){this.options={...se(this,lp),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&se(this,eo).remove(this)}setData(t,n){const r=R1(this.state.data,t,this.options);return Nt(this,So,ks).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Nt(this,So,ks).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=se(this,Er))==null?void 0:r.promise;return(i=se(this,Er))==null||i.cancel(t),n?n.then(to).catch(to):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(se(this,zu))}isActive(){return this.observers.some(t=>Co(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===bb||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!pN(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=se(this,Er))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=se(this,Er))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),se(this,eo).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(se(this,Er)&&(se(this,Ul)?se(this,Er).cancel({revert:!0}):se(this,Er).cancelRetry()),this.scheduleGc()),se(this,eo).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Nt(this,So,ks).call(this,{type:"invalidate"})}fetch(t,n){var l,c,u;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(se(this,Er))return se(this,Er).continueRetry(),se(this,Er).promise}if(t&&this.setOptions(t),!this.options.queryFn){const d=this.observers.find(p=>p.options.queryFn);d&&this.setOptions(d.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,i=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(je(this,Ul,!0),r.signal)})},o=()=>{const d=gN(this.options,n),p={queryKey:this.queryKey,meta:this.meta};return i(p),je(this,Ul,!1),this.options.persister?this.options.persister(d,p,this):d(p)},s={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:o};i(s),(l=this.options.behavior)==null||l.onFetch(s,this),je(this,Bu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=s.fetchOptions)==null?void 0:c.meta))&&Nt(this,So,ks).call(this,{type:"fetch",meta:(u=s.fetchOptions)==null?void 0:u.meta});const a=d=>{var p,h,m,b;yx(d)&&d.silent||Nt(this,So,ks).call(this,{type:"error",error:d}),yx(d)||((h=(p=se(this,eo).config).onError)==null||h.call(p,d,this),(b=(m=se(this,eo).config).onSettled)==null||b.call(m,this.state.data,d,this)),this.scheduleGc()};return je(this,Er,yN({initialPromise:n==null?void 0:n.initialPromise,fn:s.fetchFn,abort:r.abort.bind(r),onSuccess:d=>{var p,h,m,b;if(d===void 0){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}`),a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(d)}catch(y){a(y);return}(h=(p=se(this,eo).config).onSuccess)==null||h.call(p,d,this),(b=(m=se(this,eo).config).onSettled)==null||b.call(m,d,this.state.error,this),this.scheduleGc()},onError:a,onFail:(d,p)=>{Nt(this,So,ks).call(this,{type:"failed",failureCount:d,error:p})},onPause:()=>{Nt(this,So,ks).call(this,{type:"pause"})},onContinue:()=>{Nt(this,So,ks).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0})),se(this,Er).start()}},zu=new WeakMap,Bu=new WeakMap,eo=new WeakMap,Er=new WeakMap,lp=new WeakMap,Ul=new WeakMap,So=new WeakSet,ks=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,...xN(r.data,this.options),fetchMeta:t.meta??null};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 i=t.error;return yx(i)&&i.revert&&se(this,Bu)?{...se(this,Bu),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),pr.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),se(this,eo).notify({query:this,type:"updated",action:t})})},jk);function xN(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:mN(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function BK(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,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 Uo,$k,wN=($k=class extends hp{constructor(t={}){super();Ze(this,Uo);this.config=t,je(this,Uo,new Map)}build(t,n,r){const i=n.queryKey,o=n.queryHash??q_(i,n);let s=this.get(o);return s||(s=new zK({cache:this,queryKey:i,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(s)),s}add(t){se(this,Uo).has(t.queryHash)||(se(this,Uo).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=se(this,Uo).get(t.queryHash);n&&(t.destroy(),n===t&&se(this,Uo).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){pr.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return se(this,Uo).get(t)}getAll(){return[...se(this,Uo).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>cM(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>cM(t,r)):n}notify(t){pr.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){pr.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){pr.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Uo=new WeakMap,$k),Go,Br,Gl,qo,wa,zk,HK=(zk=class extends vN{constructor(t){super();Ze(this,qo);Ze(this,Go);Ze(this,Br);Ze(this,Gl);this.mutationId=t.mutationId,je(this,Br,t.mutationCache),je(this,Go,[]),this.state=t.state||VK(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){se(this,Go).includes(t)||(se(this,Go).push(t),this.clearGcTimeout(),se(this,Br).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){je(this,Go,se(this,Go).filter(n=>n!==t)),this.scheduleGc(),se(this,Br).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){se(this,Go).length||(this.state.status==="pending"?this.scheduleGc():se(this,Br).remove(this))}continue(){var t;return((t=se(this,Gl))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,s,a,l,c,u,d,p,h,m,b,y,x,S,_,C,R,M,D;je(this,Gl,yN({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(A,I)=>{Nt(this,qo,wa).call(this,{type:"failed",failureCount:A,error:I})},onPause:()=>{Nt(this,qo,wa).call(this,{type:"pause"})},onContinue:()=>{Nt(this,qo,wa).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>se(this,Br).canRun(this)}));const n=this.state.status==="pending",r=!se(this,Gl).canStart();try{if(!n){Nt(this,qo,wa).call(this,{type:"pending",variables:t,isPaused:r}),await((o=(i=se(this,Br).config).onMutate)==null?void 0:o.call(i,t,this));const I=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));I!==this.state.context&&Nt(this,qo,wa).call(this,{type:"pending",context:I,variables:t,isPaused:r})}const A=await se(this,Gl).start();return await((c=(l=se(this,Br).config).onSuccess)==null?void 0:c.call(l,A,t,this.state.context,this)),await((d=(u=this.options).onSuccess)==null?void 0:d.call(u,A,t,this.state.context)),await((h=(p=se(this,Br).config).onSettled)==null?void 0:h.call(p,A,null,this.state.variables,this.state.context,this)),await((b=(m=this.options).onSettled)==null?void 0:b.call(m,A,null,t,this.state.context)),Nt(this,qo,wa).call(this,{type:"success",data:A}),A}catch(A){try{throw await((x=(y=se(this,Br).config).onError)==null?void 0:x.call(y,A,t,this.state.context,this)),await((_=(S=this.options).onError)==null?void 0:_.call(S,A,t,this.state.context)),await((R=(C=se(this,Br).config).onSettled)==null?void 0:R.call(C,void 0,A,this.state.variables,this.state.context,this)),await((D=(M=this.options).onSettled)==null?void 0:D.call(M,void 0,A,t,this.state.context)),A}finally{Nt(this,qo,wa).call(this,{type:"error",error:A})}}finally{se(this,Br).runNext(this)}}},Go=new WeakMap,Br=new WeakMap,Gl=new WeakMap,qo=new WeakSet,wa=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:t.isPaused,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),pr.batch(()=>{se(this,Go).forEach(r=>{r.onMutationUpdate(t)}),se(this,Br).notify({mutation:this,type:"updated",action:t})})},zk);function VK(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Bs,_o,cp,Bk,WK=(Bk=class extends hp{constructor(t={}){super();Ze(this,Bs);Ze(this,_o);Ze(this,cp);this.config=t,je(this,Bs,new Set),je(this,_o,new Map),je(this,cp,0)}build(t,n,r){const i=new HK({mutationCache:this,mutationId:++Lg(this,cp)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){se(this,Bs).add(t);const n=$g(t);if(typeof n=="string"){const r=se(this,_o).get(n);r?r.push(t):se(this,_o).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(se(this,Bs).delete(t)){const n=$g(t);if(typeof n=="string"){const r=se(this,_o).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&se(this,_o).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=$g(t);if(typeof n=="string"){const r=se(this,_o).get(n),i=r==null?void 0:r.find(o=>o.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r;const n=$g(t);if(typeof n=="string"){const i=(r=se(this,_o).get(n))==null?void 0:r.find(o=>o!==t&&o.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){pr.batch(()=>{se(this,Bs).forEach(t=>{this.notify({type:"removed",mutation:t})}),se(this,Bs).clear(),se(this,_o).clear()})}getAll(){return Array.from(se(this,Bs))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>uM(n,r))}findAll(t={}){return this.getAll().filter(n=>uM(t,n))}notify(t){pr.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return pr.batch(()=>Promise.all(t.map(n=>n.continue().catch(to))))}},Bs=new WeakMap,_o=new WeakMap,cp=new WeakMap,Bk);function $g(e){var t;return(t=e.options.scope)==null?void 0:t.id}function hM(e){return{onFetch:(t,n)=>{var u,d,p,h,m;const r=t.options,i=(p=(d=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:p.direction,o=((h=t.state.data)==null?void 0:h.pages)||[],s=((m=t.state.data)==null?void 0:m.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let b=!1;const y=_=>{Object.defineProperty(_,"signal",{enumerable:!0,get:()=>(t.signal.aborted?b=!0:t.signal.addEventListener("abort",()=>{b=!0}),t.signal)})},x=gN(t.options,t.fetchOptions),S=async(_,C,R)=>{if(b)return Promise.reject();if(C==null&&_.pages.length)return Promise.resolve(_);const M={queryKey:t.queryKey,pageParam:C,direction:R?"backward":"forward",meta:t.options.meta};y(M);const D=await x(M),{maxPages:A}=t.options,I=R?NK:kK;return{pages:I(_.pages,D,A),pageParams:I(_.pageParams,C,A)}};if(i&&o.length){const _=i==="backward",C=_?UK:pM,R={pages:o,pageParams:s},M=C(r,R);a=await S(R,M,_)}else{const _=e??o.length;do{const C=l===0?s[0]??r.initialPageParam:pM(r,a);if(l>0&&C==null)break;a=await S(a,C),l++}while(l<_)}return a};t.options.persister?t.fetchFn=()=>{var b,y;return(y=(b=t.options).persister)==null?void 0:y.call(b,c,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function pM(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function UK(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Dn,Ta,Ma,Hu,Vu,Oa,Wu,Uu,Hk,GK=(Hk=class{constructor(e={}){Ze(this,Dn);Ze(this,Ta);Ze(this,Ma);Ze(this,Hu);Ze(this,Vu);Ze(this,Oa);Ze(this,Wu);Ze(this,Uu);je(this,Dn,e.queryCache||new wN),je(this,Ta,e.mutationCache||new WK),je(this,Ma,e.defaultOptions||{}),je(this,Hu,new Map),je(this,Vu,new Map),je(this,Oa,0)}mount(){Lg(this,Oa)._++,se(this,Oa)===1&&(je(this,Wu,Y_.subscribe(async e=>{e&&(await this.resumePausedMutations(),se(this,Dn).onFocus())})),je(this,Uu,yb.subscribe(async e=>{e&&(await this.resumePausedMutations(),se(this,Dn).onOnline())})))}unmount(){var e,t;Lg(this,Oa)._--,se(this,Oa)===0&&((e=se(this,Wu))==null||e.call(this),je(this,Wu,void 0),(t=se(this,Uu))==null||t.call(this),je(this,Uu,void 0))}isFetching(e){return se(this,Dn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return se(this,Ta).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=se(this,Dn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=se(this,Dn).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Cu(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return se(this,Dn).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=se(this,Dn).get(r.queryHash),o=i==null?void 0:i.state.data,s=DK(t,o);if(s!==void 0)return se(this,Dn).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return pr.batch(()=>se(this,Dn).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=se(this,Dn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=se(this,Dn);pr.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=se(this,Dn),r={type:"active",...e};return pr.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=pr.batch(()=>se(this,Dn).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(to).catch(to)}invalidateQueries(e,t={}){return pr.batch(()=>{if(se(this,Dn).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none")return Promise.resolve();const n={...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"};return this.refetchQueries(n,t)})}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=pr.batch(()=>se(this,Dn).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(to)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(to)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=se(this,Dn).build(this,t);return n.isStaleByTime(Cu(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(to).catch(to)}fetchInfiniteQuery(e){return e.behavior=hM(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(to).catch(to)}ensureInfiniteQueryData(e){return e.behavior=hM(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return yb.isOnline()?se(this,Ta).resumePausedMutations():Promise.resolve()}getQueryCache(){return se(this,Dn)}getMutationCache(){return se(this,Ta)}getDefaultOptions(){return se(this,Ma)}setDefaultOptions(e){je(this,Ma,e)}setQueryDefaults(e,t){se(this,Hu).set(yh(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...se(this,Hu).values()],n={};return t.forEach(r=>{vh(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){se(this,Vu).set(yh(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...se(this,Vu).values()];let n={};return t.forEach(r=>{vh(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...se(this,Ma).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=q_(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===bb&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...se(this,Ma).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){se(this,Dn).clear(),se(this,Ta).clear()}},Dn=new WeakMap,Ta=new WeakMap,Ma=new WeakMap,Hu=new WeakMap,Vu=new WeakMap,Oa=new WeakMap,Wu=new WeakMap,Uu=new WeakMap,Hk),ci,Lt,up,Hr,ql,Gu,Da,Yo,dp,qu,Yu,Yl,Kl,Aa,Ku,Qt,Df,T1,M1,O1,D1,A1,I1,k1,SN,Vk,qK=(Vk=class extends hp{constructor(t,n){super();Ze(this,Qt);Ze(this,ci);Ze(this,Lt);Ze(this,up);Ze(this,Hr);Ze(this,ql);Ze(this,Gu);Ze(this,Da);Ze(this,Yo);Ze(this,dp);Ze(this,qu);Ze(this,Yu);Ze(this,Yl);Ze(this,Kl);Ze(this,Aa);Ze(this,Ku,new Set);this.options=n,je(this,ci,t),je(this,Yo,null),je(this,Da,P1()),this.options.experimental_prefetchInRender||se(this,Da).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(se(this,Lt).addObserver(this),gM(se(this,Lt),this.options)?Nt(this,Qt,Df).call(this):this.updateResult(),Nt(this,Qt,D1).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return N1(se(this,Lt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return N1(se(this,Lt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Nt(this,Qt,A1).call(this),Nt(this,Qt,I1).call(this),se(this,Lt).removeObserver(this)}setOptions(t,n){const r=this.options,i=se(this,Lt);if(this.options=se(this,ci).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Co(this.options.enabled,se(this,Lt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Nt(this,Qt,k1).call(this),se(this,Lt).setOptions(this.options),r._defaulted&&!C1(this.options,r)&&se(this,ci).getQueryCache().notify({type:"observerOptionsUpdated",query:se(this,Lt),observer:this});const o=this.hasListeners();o&&mM(se(this,Lt),i,this.options,r)&&Nt(this,Qt,Df).call(this),this.updateResult(n),o&&(se(this,Lt)!==i||Co(this.options.enabled,se(this,Lt))!==Co(r.enabled,se(this,Lt))||Cu(this.options.staleTime,se(this,Lt))!==Cu(r.staleTime,se(this,Lt)))&&Nt(this,Qt,T1).call(this);const s=Nt(this,Qt,M1).call(this);o&&(se(this,Lt)!==i||Co(this.options.enabled,se(this,Lt))!==Co(r.enabled,se(this,Lt))||s!==se(this,Aa))&&Nt(this,Qt,O1).call(this,s)}getOptimisticResult(t){const n=se(this,ci).getQueryCache().build(se(this,ci),t),r=this.createResult(n,t);return KK(this,r)&&(je(this,Hr,r),je(this,Gu,this.options),je(this,ql,se(this,Lt).state)),r}getCurrentResult(){return se(this,Hr)}trackResult(t,n){const r={};return Object.keys(t).forEach(i=>{Object.defineProperty(r,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),n==null||n(i),t[i])})}),r}trackProp(t){se(this,Ku).add(t)}getCurrentQuery(){return se(this,Lt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=se(this,ci).defaultQueryOptions(t),r=se(this,ci).getQueryCache().build(se(this,ci),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Nt(this,Qt,Df).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),se(this,Hr)))}createResult(t,n){var A;const r=se(this,Lt),i=this.options,o=se(this,Hr),s=se(this,ql),a=se(this,Gu),c=t!==r?t.state:se(this,up),{state:u}=t;let d={...u},p=!1,h;if(n._optimisticResults){const I=this.hasListeners(),F=!I&&gM(t,n),j=I&&mM(t,r,n,i);(F||j)&&(d={...d,...xN(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:m,errorUpdatedAt:b,status:y}=d;if(n.select&&d.data!==void 0)if(o&&d.data===(s==null?void 0:s.data)&&n.select===se(this,dp))h=se(this,qu);else try{je(this,dp,n.select),h=n.select(d.data),h=R1(o==null?void 0:o.data,h,n),je(this,qu,h),je(this,Yo,null)}catch(I){je(this,Yo,I)}else h=d.data;if(n.placeholderData!==void 0&&h===void 0&&y==="pending"){let I;if(o!=null&&o.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))I=o.data;else if(I=typeof n.placeholderData=="function"?n.placeholderData((A=se(this,Yu))==null?void 0:A.state.data,se(this,Yu)):n.placeholderData,n.select&&I!==void 0)try{I=n.select(I),je(this,Yo,null)}catch(F){je(this,Yo,F)}I!==void 0&&(y="success",h=R1(o==null?void 0:o.data,I,n),p=!0)}se(this,Yo)&&(m=se(this,Yo),h=se(this,qu),b=Date.now(),y="error");const x=d.fetchStatus==="fetching",S=y==="pending",_=y==="error",C=S&&x,R=h!==void 0,D={status:y,fetchStatus:d.fetchStatus,isPending:S,isSuccess:y==="success",isError:_,isInitialLoading:C,isLoading:C,data:h,dataUpdatedAt:d.dataUpdatedAt,error:m,errorUpdatedAt:b,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:x,isRefetching:x&&!S,isLoadingError:_&&!R,isPaused:d.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:_&&R,isStale:K_(t,n),refetch:this.refetch,promise:se(this,Da)};if(this.options.experimental_prefetchInRender){const I=$=>{D.status==="error"?$.reject(D.error):D.data!==void 0&&$.resolve(D.data)},F=()=>{const $=je(this,Da,D.promise=P1());I($)},j=se(this,Da);switch(j.status){case"pending":t.queryHash===r.queryHash&&I(j);break;case"fulfilled":(D.status==="error"||D.data!==j.value)&&F();break;case"rejected":(D.status!=="error"||D.error!==j.reason)&&F();break}}return D}updateResult(t){const n=se(this,Hr),r=this.createResult(se(this,Lt),this.options);if(je(this,ql,se(this,Lt).state),je(this,Gu,this.options),se(this,ql).data!==void 0&&je(this,Yu,se(this,Lt)),C1(r,n))return;je(this,Hr,r);const i={},o=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!se(this,Ku).size)return!0;const l=new Set(a??se(this,Ku));return this.options.throwOnError&&l.add("error"),Object.keys(se(this,Hr)).some(c=>{const u=c;return se(this,Hr)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&o()&&(i.listeners=!0),Nt(this,Qt,SN).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Nt(this,Qt,D1).call(this)}},ci=new WeakMap,Lt=new WeakMap,up=new WeakMap,Hr=new WeakMap,ql=new WeakMap,Gu=new WeakMap,Da=new WeakMap,Yo=new WeakMap,dp=new WeakMap,qu=new WeakMap,Yu=new WeakMap,Yl=new WeakMap,Kl=new WeakMap,Aa=new WeakMap,Ku=new WeakMap,Qt=new WeakSet,Df=function(t){Nt(this,Qt,k1).call(this);let n=se(this,Lt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(to)),n},T1=function(){Nt(this,Qt,A1).call(this);const t=Cu(this.options.staleTime,se(this,Lt));if(hc||se(this,Hr).isStale||!S1(t))return;const r=pN(se(this,Hr).dataUpdatedAt,t)+1;je(this,Yl,setTimeout(()=>{se(this,Hr).isStale||this.updateResult()},r))},M1=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(se(this,Lt)):this.options.refetchInterval)??!1},O1=function(t){Nt(this,Qt,I1).call(this),je(this,Aa,t),!(hc||Co(this.options.enabled,se(this,Lt))===!1||!S1(se(this,Aa))||se(this,Aa)===0)&&je(this,Kl,setInterval(()=>{(this.options.refetchIntervalInBackground||Y_.isFocused())&&Nt(this,Qt,Df).call(this)},se(this,Aa)))},D1=function(){Nt(this,Qt,T1).call(this),Nt(this,Qt,O1).call(this,Nt(this,Qt,M1).call(this))},A1=function(){se(this,Yl)&&(clearTimeout(se(this,Yl)),je(this,Yl,void 0))},I1=function(){se(this,Kl)&&(clearInterval(se(this,Kl)),je(this,Kl,void 0))},k1=function(){const t=se(this,ci).getQueryCache().build(se(this,ci),this.options);if(t===se(this,Lt))return;const n=se(this,Lt);je(this,Lt,t),je(this,up,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},SN=function(t){pr.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(se(this,Hr))}),se(this,ci).getQueryCache().notify({query:se(this,Lt),type:"observerResultsUpdated"})})},Vk);function YK(e,t){return Co(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function gM(e,t){return YK(e,t)||e.state.data!==void 0&&N1(e,t,t.refetchOnMount)}function N1(e,t,n){if(Co(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&K_(e,t)}return!1}function mM(e,t,n,r){return(e!==t||Co(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&K_(e,n)}function K_(e,t){return Co(t.enabled,e)!==!1&&e.isStaleByTime(Cu(t.staleTime,e))}function KK(e,t){return!C1(e.getCurrentResult(),t)}var _N=E.createContext(void 0),X_=e=>{const t=E.useContext(_N);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},XK=({client:e,children:t})=>(E.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),v.jsx(_N.Provider,{value:e,children:t})),CN=E.createContext(!1),QK=()=>E.useContext(CN);CN.Provider;function JK(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var ZK=E.createContext(JK()),eX=()=>E.useContext(ZK);function tX(e,t){return typeof e=="function"?e(...t):!!e}function bM(){}var nX=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},rX=e=>{E.useEffect(()=>{e.clearReset()},[e])},iX=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&tX(n,[e.error,r]),oX=e=>{const t=e.staleTime;e.suspense&&(e.staleTime=typeof t=="function"?(...n)=>Math.max(t(...n),1e3):Math.max(t??1e3,1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},sX=(e,t)=>e.isLoading&&e.isFetching&&!t,aX=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,yM=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function lX(e,t,n){var d,p,h,m,b;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=X_(),i=QK(),o=eX(),s=r.defaultQueryOptions(e);(p=(d=r.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||p.call(d,s),s._optimisticResults=i?"isRestoring":"optimistic",oX(s),nX(s,o),rX(o);const a=!r.getQueryCache().get(s.queryHash),[l]=E.useState(()=>new t(r,s)),c=l.getOptimisticResult(s),u=!i&&e.subscribed!==!1;if(E.useSyncExternalStore(E.useCallback(y=>{const x=u?l.subscribe(pr.batchCalls(y)):bM;return l.updateResult(),x},[l,u]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),E.useEffect(()=>{l.setOptions(s,{listeners:!1})},[s,l]),aX(s,c))throw yM(s,l,o);if(iX({result:c,errorResetBoundary:o,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw c.error;if((m=(h=r.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||m.call(h,s,c),s.experimental_prefetchInRender&&!hc&&sX(c,i)){const y=a?yM(s,l,o):(b=r.getQueryCache().get(s.queryHash))==null?void 0:b.promise;y==null||y.catch(bM).finally(()=>{l.updateResult()})}return s.notifyOnChangeProps?c:l.trackResult(c)}function pp(e,t){return lX(e,qK)}function EN({children:e}){const{setIsSessionExpired:t}=gr(),n=new GK({queryCache:new wN({onError:r=>{console.error(`Something went wrong: ${r.message}`),r.message==="invalid token"&&t(!0)}}),defaultOptions:{queries:{gcTime:1e3*60*10,staleTime:1e3*60*5,refetchOnWindowFocus:!1,retry:1}}});return v.jsx(XK,{client:n,children:e})}const Tc=P.forwardRef(({children:e,className:t,...n},r)=>v.jsx("div",{className:be("semaphor-scope",t),ref:r,...n,children:e})),cX={id:"",authToken:void 0},RN=P.createContext(cX),PN=({children:e,dashboardProps:t})=>v.jsx(EN,{children:v.jsx(RN.Provider,{value:t,children:v.jsx(Tc,{style:{height:"100%"},children:e})})});function Hi(){const e=P.useContext(RN);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}function uX(){const{authToken:e,version:t}=Hi(),n=ye(a=>a.selectedLensId),{data:r,isLoading:i,isFetching:o,isError:s}=pp({queryKey:["dashboard",n,e==null?void 0:e.accessToken],queryFn:()=>qY(e==null?void 0:e.accessToken,{lensId:n,version:t})});return{data:r,isLoading:i,isFetching:o,isError:s}}function TN(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function vM(e,t){const n=TN(e);return n==="dark"?Xl.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function dX({customStyle:e,currentTheme:t,onSave:n,onEvent:r,defaultFilterValues:i,onFilterValuesChange:o}){const{authToken:s}=Hi(),a=ye(L=>L.selectedLensId),{data:l,isLoading:c,isFetching:u,isError:d}=uX(),[p,h]=P.useState(i||[]),{theme:m,setTheme:b}=hN(),y=ye(L=>L.dashboard.globalStyle),{setDashboard:x,setDashboardWithFilterValues:S,setSelectedSheetId:_,setStyle:C,setOnSaveFunction:R,setLenses:M,setSelectedLensId:D,setInitStore:A}=ye(L=>L.actions);ye(L=>L.actions.setCustomCards);const I=ye(L=>L.actions.setFilterValues),F=ye(L=>L.filterValues),j=ye(L=>L.actions.setThemeStyle),$=ye(L=>L.actions.setDashboardTheme),K=ye(L=>L.actions.setOnEvent);P.useEffect(()=>{s&&A()},[s,A]),P.useEffect(()=>{if(m){const L=TN(m);$(L)}},[m,$]),P.useEffect(()=>{t&&b(t)},[t,b]);const H=P.useCallback(()=>{const L=Xl.cloneDeep(gb),W=Xl.merge(L,y);if(e){const B=Xl.merge(W,e),U=vM(m,B);j(U),C(B)}else{const B=vM(m,W);j(B),C(gb)}},[m,e,y,j,C]);return P.useEffect(()=>{l&&l.dashboard&&H()},[m,e,y,H,l]),P.useEffect(()=>{var Q,G;function L(O,ee){const q=O.filters||[],oe=[];for(const J of ee){const Z=q.find(ae=>ae.id===J.filterId);Z&&oe.push({filterId:J.filterId,connectionType:Z.database==="NA"?"api":"database",name:Z.column,operation:Z.operation,valueType:_u(Z),values:J.values})}return oe}if(!l||!l.dashboard)return;const{dashboard:W,filterValues:B,defaultLensId:U,lenses:Y}=l,k=L(W,p||[]);S(W,B||k||[]),U&&D(U),Y&&M(Y),_(((G=(Q=W==null?void 0:W.sheets)==null?void 0:Q[0])==null?void 0:G.id)||null)},[l,x,_,I,a,M,S,D,p]),P.useEffect(()=>{o&&F&&o(F)},[F,o]),P.useEffect(()=>{n&&R(n),r&&K(r)},[n,R,r,K]),{isFetching:u,isLoading:c,isError:d}}function Eu({className:e,...t}){return v.jsx("div",{className:be("animate-pulse rounded-md bg-muted",e),...t})}const MN=E.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:be("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));MN.displayName="Card";const Ry=E.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:be("flex flex-col space-y-1.5 p-6",e),...t}));Ry.displayName="CardHeader";const Sd=E.forwardRef(({className:e,...t},n)=>v.jsx("h3",{ref:n,className:be("text-2xl font-semibold leading-none tracking-tight",e),...t}));Sd.displayName="CardTitle";const Q_=E.forwardRef(({className:e,...t},n)=>v.jsx("p",{ref:n,className:be("text-sm text-muted-foreground",e),...t}));Q_.displayName="CardDescription";const Py=E.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:be("px-6 pt-0",e),...t}));Py.displayName="CardContent";const ON=E.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:be("flex items-center p-6 pt-0",e),...t}));ON.displayName="CardFooter";function DN({className:e,customStyle:t,onSave:n,onEvent:r,LoadingComponent:i,ErrorComponent:o,onChartElementClicked:s,id:a,authToken:l,currentTheme:c,version:u,customCards:d,showAssistant:p,defaultFilterValues:h,onFilterValuesChange:m,...b}){ye(R=>R.selectedSheetId);const y=ye(R=>R.themeStyle),x=ye(R=>R.isSessionExpired),{isLoading:S,isError:_,isFetching:C}=dX({authToken:l,customStyle:t,currentTheme:c,onSave:n,onEvent:r,defaultFilterValues:h,onFilterValuesChange:m});return S||!l?(r==null||r({type:"info",message:"Loading dashboard"}),i?v.jsx(i,{message:"loading"}):v.jsx("div",{className:"flex items-center gap-3",children:v.jsx(Eu,{className:"h-1 w-full dark:h-[2px]"})})):_?(r==null||r({type:"error",message:"Error fetching dashboard"}),o?(console.log("Error fetching dashboard"),v.jsx(o,{})):v.jsx("div",{children:"Error"})):x?(r==null||r({type:"error",message:"Session Expired"}),v.jsx("div",{className:"flex h-full items-center justify-center",children:v.jsxs("div",{className:"space-y-4 rounded-md border border-muted p-10",children:[v.jsx(Sd,{children:"Session Expired"}),v.jsx("p",{className:"text-muted-foreground",children:"Please refresh your page to continue."})]})})):v.jsx("div",{className:be("flex h-full flex-col justify-between",y==null?void 0:y.dashboardPanel,e),style:{},role:"dashboard-panel",...b})}function Re(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function fX(e,t){const n=E.createContext(t),r=o=>{const{children:s,...a}=o,l=E.useMemo(()=>a,Object.values(a));return v.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function i(o){const s=E.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function er(e,t=[]){let n=[];function r(o,s){const a=E.createContext(s),l=n.length;n=[...n,s];const c=d=>{var x;const{scope:p,children:h,...m}=d,b=((x=p==null?void 0:p[e])==null?void 0:x[l])||a,y=E.useMemo(()=>m,Object.values(m));return v.jsx(b.Provider,{value:y,children:h})};c.displayName=o+"Provider";function u(d,p){var b;const h=((b=p==null?void 0:p[e])==null?void 0:b[l])||a,m=E.useContext(h);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${o}\``)}return[c,u]}const i=()=>{const o=n.map(s=>E.createContext(s));return function(a){const l=(a==null?void 0:a[e])||o;return E.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,hX(i,...t)]}function hX(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(o)[`__scope${c}`];return{...a,...d}},{});return E.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function xM(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ty(...e){return t=>{let n=!1;const r=e.map(i=>{const o=xM(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():xM(e[i],null)}}}}function rt(...e){return E.useCallback(Ty(...e),e)}var Js=E.forwardRef((e,t)=>{const{children:n,...r}=e,i=E.Children.toArray(n),o=i.find(pX);if(o){const s=o.props.children,a=i.map(l=>l===o?E.Children.count(s)>1?E.Children.only(null):E.isValidElement(s)?s.props.children:null:l);return v.jsx(L1,{...r,ref:t,children:E.isValidElement(s)?E.cloneElement(s,void 0,a):null})}return v.jsx(L1,{...r,ref:t,children:n})});Js.displayName="Slot";var L1=E.forwardRef((e,t)=>{const{children:n,...r}=e;if(E.isValidElement(n)){const i=mX(n);return E.cloneElement(n,{...gX(r,n.props),ref:t?Ty(t,i):i})}return E.Children.count(n)>1?E.Children.only(null):null});L1.displayName="SlotClone";var J_=({children:e})=>v.jsx(v.Fragment,{children:e});function pX(e){return E.isValidElement(e)&&e.type===J_}function gX(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{o(...a),i(...a)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function mX(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function My(e){const t=e+"CollectionProvider",[n,r]=er(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=h=>{const{scope:m,children:b}=h,y=P.useRef(null),x=P.useRef(new Map).current;return v.jsx(i,{scope:m,itemMap:x,collectionRef:y,children:b})};s.displayName=t;const a=e+"CollectionSlot",l=P.forwardRef((h,m)=>{const{scope:b,children:y}=h,x=o(a,b),S=rt(m,x.collectionRef);return v.jsx(Js,{ref:S,children:y})});l.displayName=a;const c=e+"CollectionItemSlot",u="data-radix-collection-item",d=P.forwardRef((h,m)=>{const{scope:b,children:y,...x}=h,S=P.useRef(null),_=rt(m,S),C=o(c,b);return P.useEffect(()=>(C.itemMap.set(S,{ref:S,...x}),()=>void C.itemMap.delete(S))),v.jsx(Js,{[u]:"",ref:_,children:y})});d.displayName=c;function p(h){const m=o(e+"CollectionConsumer",h);return P.useCallback(()=>{const y=m.collectionRef.current;if(!y)return[];const x=Array.from(y.querySelectorAll(`[${u}]`));return Array.from(m.itemMap.values()).sort((C,R)=>x.indexOf(C.ref.current)-x.indexOf(R.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:s,Slot:l,ItemSlot:d},p,r]}var mr=globalThis!=null&&globalThis.document?E.useLayoutEffect:()=>{},bX=E.useId||(()=>{}),yX=0;function Gn(e){const[t,n]=E.useState(bX());return mr(()=>{e||n(r=>r??String(yX++))},[e]),e||(t?`radix-${t}`:"")}var vX=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ne=vX.reduce((e,t)=>{const n=E.forwardRef((r,i)=>{const{asChild:o,...s}=r,a=o?Js:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(a,{...s,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function AN(e,t){e&&uc.flushSync(()=>e.dispatchEvent(t))}function Zn(e){const t=E.useRef(e);return E.useEffect(()=>{t.current=e}),E.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Ar({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=xX({defaultProp:t,onChange:n}),o=e!==void 0,s=o?e:r,a=Zn(n),l=E.useCallback(c=>{if(o){const d=typeof c=="function"?c(e):c;d!==e&&a(d)}else i(c)},[o,e,i,a]);return[s,l]}function xX({defaultProp:e,onChange:t}){const n=E.useState(e),[r]=n,i=E.useRef(r),o=Zn(t);return E.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}var wX=E.createContext(void 0);function Mc(e){const t=E.useContext(wX);return e||t||"ltr"}var vx="rovingFocusGroup.onEntryFocus",SX={bubbles:!1,cancelable:!0},Oy="RovingFocusGroup",[F1,IN,_X]=My(Oy),[CX,_d]=er(Oy,[_X]),[EX,RX]=CX(Oy),kN=E.forwardRef((e,t)=>v.jsx(F1.Provider,{scope:e.__scopeRovingFocusGroup,children:v.jsx(F1.Slot,{scope:e.__scopeRovingFocusGroup,children:v.jsx(PX,{...e,ref:t})})}));kN.displayName=Oy;var PX=E.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=e,p=E.useRef(null),h=rt(t,p),m=Mc(o),[b=null,y]=Ar({prop:s,defaultProp:a,onChange:l}),[x,S]=E.useState(!1),_=Zn(c),C=IN(n),R=E.useRef(!1),[M,D]=E.useState(0);return E.useEffect(()=>{const A=p.current;if(A)return A.addEventListener(vx,_),()=>A.removeEventListener(vx,_)},[_]),v.jsx(EX,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:b,onItemFocus:E.useCallback(A=>y(A),[y]),onItemShiftTab:E.useCallback(()=>S(!0),[]),onFocusableItemAdd:E.useCallback(()=>D(A=>A+1),[]),onFocusableItemRemove:E.useCallback(()=>D(A=>A-1),[]),children:v.jsx(Ne.div,{tabIndex:x||M===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:"none",...e.style},onMouseDown:Re(e.onMouseDown,()=>{R.current=!0}),onFocus:Re(e.onFocus,A=>{const I=!R.current;if(A.target===A.currentTarget&&I&&!x){const F=new CustomEvent(vx,SX);if(A.currentTarget.dispatchEvent(F),!F.defaultPrevented){const j=C().filter(W=>W.focusable),$=j.find(W=>W.active),K=j.find(W=>W.id===b),L=[$,K,...j].filter(Boolean).map(W=>W.ref.current);FN(L,u)}}R.current=!1}),onBlur:Re(e.onBlur,()=>S(!1))})})}),NN="RovingFocusGroupItem",LN=E.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,...s}=e,a=Gn(),l=o||a,c=RX(NN,n),u=c.currentTabStopId===l,d=IN(n),{onFocusableItemAdd:p,onFocusableItemRemove:h}=c;return E.useEffect(()=>{if(r)return p(),()=>h()},[r,p,h]),v.jsx(F1.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:v.jsx(Ne.span,{tabIndex:u?0:-1,"data-orientation":c.orientation,...s,ref:t,onMouseDown:Re(e.onMouseDown,m=>{r?c.onItemFocus(l):m.preventDefault()}),onFocus:Re(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:Re(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){c.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const b=OX(m,c.orientation,c.dir);if(b!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let x=d().filter(S=>S.focusable).map(S=>S.ref.current);if(b==="last")x.reverse();else if(b==="prev"||b==="next"){b==="prev"&&x.reverse();const S=x.indexOf(m.currentTarget);x=c.loop?DX(x,S+1):x.slice(S+1)}setTimeout(()=>FN(x))}})})})});LN.displayName=NN;var TX={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function MX(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function OX(e,t,n){const r=MX(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return TX[r]}function FN(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function DX(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Z_=kN,eC=LN;function AX(e,t){return E.useReducer((n,r)=>t[n][r]??n,e)}var qn=e=>{const{present:t,children:n}=e,r=IX(t),i=typeof n=="function"?n({present:r.isPresent}):E.Children.only(n),o=rt(r.ref,kX(i));return typeof n=="function"||r.isPresent?E.cloneElement(i,{ref:o}):null};qn.displayName="Presence";function IX(e){const[t,n]=E.useState(),r=E.useRef({}),i=E.useRef(e),o=E.useRef("none"),s=e?"mounted":"unmounted",[a,l]=AX(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return E.useEffect(()=>{const c=zg(r.current);o.current=a==="mounted"?c:"none"},[a]),mr(()=>{const c=r.current,u=i.current;if(u!==e){const p=o.current,h=zg(c);e?l("MOUNT"):h==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&p!==h?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),mr(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,d=h=>{const b=zg(r.current).includes(h.animationName);if(h.target===t&&b&&(l("ANIMATION_END"),!i.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},p=h=>{h.target===t&&(o.current=zg(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:E.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function zg(e){return(e==null?void 0:e.animationName)||"none"}function kX(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var tC="Tabs",[NX,CTe]=er(tC,[_d]),jN=_d(),[LX,nC]=NX(tC),$N=E.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=Mc(a),[d,p]=Ar({prop:r,onChange:i,defaultProp:o});return v.jsx(LX,{scope:n,baseId:Gn(),value:d,onValueChange:p,orientation:s,dir:u,activationMode:l,children:v.jsx(Ne.div,{dir:u,"data-orientation":s,...c,ref:t})})});$N.displayName=tC;var zN="TabsList",BN=E.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=nC(zN,n),s=jN(n);return v.jsx(Z_,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:r,children:v.jsx(Ne.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});BN.displayName=zN;var HN="TabsTrigger",VN=E.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,s=nC(HN,n),a=jN(n),l=GN(s.baseId,r),c=qN(s.baseId,r),u=r===s.value;return v.jsx(eC,{asChild:!0,...a,focusable:!i,active:u,children:v.jsx(Ne.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:l,...o,ref:t,onMouseDown:Re(e.onMouseDown,d=>{!i&&d.button===0&&d.ctrlKey===!1?s.onValueChange(r):d.preventDefault()}),onKeyDown:Re(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&s.onValueChange(r)}),onFocus:Re(e.onFocus,()=>{const d=s.activationMode!=="manual";!u&&!i&&d&&s.onValueChange(r)})})})});VN.displayName=HN;var WN="TabsContent",UN=E.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...s}=e,a=nC(WN,n),l=GN(a.baseId,r),c=qN(a.baseId,r),u=r===a.value,d=E.useRef(u);return E.useEffect(()=>{const p=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(p)},[]),v.jsx(qn,{present:i||u,children:({present:p})=>v.jsx(Ne.div,{"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!p,id:c,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:p&&o})})});UN.displayName=WN;function GN(e,t){return`${e}-trigger-${t}`}function qN(e,t){return`${e}-content-${t}`}var FX=$N,YN=BN,KN=VN,XN=UN;const rC=FX,Dy=E.forwardRef(({className:e,...t},n)=>v.jsx(YN,{ref:n,className:be("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Dy.displayName=YN.displayName;const Ay=E.forwardRef(({className:e,...t},n)=>v.jsx(KN,{ref:n,className:be("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}));Ay.displayName=KN.displayName;const iC=E.forwardRef(({className:e,...t},n)=>v.jsx(XN,{ref:n,className:be("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));iC.displayName=XN.displayName;var QN={exports:{}},gp={},j1={exports:{}};(function(e,t){(function(n,r){r(t)})(Ca,function(n){function r(Z){return function(ce,ge,ie,pe,de,Ee,De){return Z(ce,ge,De)}}function i(Z){return function(ce,ge,ie,pe){if(!ce||!ge||typeof ce!="object"||typeof ge!="object")return Z(ce,ge,ie,pe);var de=pe.get(ce),Ee=pe.get(ge);if(de&&Ee)return de===ge&&Ee===ce;pe.set(ce,ge),pe.set(ge,ce);var De=Z(ce,ge,ie,pe);return pe.delete(ce),pe.delete(ge),De}}function o(Z,ae){var ce={};for(var ge in Z)ce[ge]=Z[ge];for(var ge in ae)ce[ge]=ae[ge];return ce}function s(Z){return Z.constructor===Object||Z.constructor==null}function a(Z){return typeof Z.then=="function"}function l(Z,ae){return Z===ae||Z!==Z&&ae!==ae}var c="[object Arguments]",u="[object Boolean]",d="[object Date]",p="[object RegExp]",h="[object Map]",m="[object Number]",b="[object Object]",y="[object Set]",x="[object String]",S=Object.prototype.toString;function _(Z){var ae=Z.areArraysEqual,ce=Z.areDatesEqual,ge=Z.areMapsEqual,ie=Z.areObjectsEqual,pe=Z.areRegExpsEqual,de=Z.areSetsEqual,Ee=Z.createIsNestedEqual,De=Ee($e);function $e(Te,ze,yt){if(Te===ze)return!0;if(!Te||!ze||typeof Te!="object"||typeof ze!="object")return Te!==Te&&ze!==ze;if(s(Te)&&s(ze))return ie(Te,ze,De,yt);var Mt=Array.isArray(Te),gn=Array.isArray(ze);if(Mt||gn)return Mt===gn&&ae(Te,ze,De,yt);var Ot=S.call(Te);return Ot!==S.call(ze)?!1:Ot===d?ce(Te,ze,De,yt):Ot===p?pe(Te,ze,De,yt):Ot===h?ge(Te,ze,De,yt):Ot===y?de(Te,ze,De,yt):Ot===b||Ot===c?a(Te)||a(ze)?!1:ie(Te,ze,De,yt):Ot===u||Ot===m||Ot===x?l(Te.valueOf(),ze.valueOf()):!1}return $e}function C(Z,ae,ce,ge){var ie=Z.length;if(ae.length!==ie)return!1;for(;ie-- >0;)if(!ce(Z[ie],ae[ie],ie,ie,Z,ae,ge))return!1;return!0}var R=i(C);function M(Z,ae){return l(Z.valueOf(),ae.valueOf())}function D(Z,ae,ce,ge){var ie=Z.size===ae.size;if(!ie)return!1;if(!Z.size)return!0;var pe={},de=0;return Z.forEach(function(Ee,De){if(ie){var $e=!1,Te=0;ae.forEach(function(ze,yt){!$e&&!pe[Te]&&($e=ce(De,yt,de,Te,Z,ae,ge)&&ce(Ee,ze,De,yt,Z,ae,ge))&&(pe[Te]=!0),Te++}),de++,ie=$e}}),ie}var A=i(D),I="_owner",F=Object.prototype.hasOwnProperty;function j(Z,ae,ce,ge){var ie=Object.keys(Z),pe=ie.length;if(Object.keys(ae).length!==pe)return!1;for(var de;pe-- >0;){if(de=ie[pe],de===I){var Ee=!!Z.$$typeof,De=!!ae.$$typeof;if((Ee||De)&&Ee!==De)return!1}if(!F.call(ae,de)||!ce(Z[de],ae[de],de,de,Z,ae,ge))return!1}return!0}var $=i(j);function K(Z,ae){return Z.source===ae.source&&Z.flags===ae.flags}function H(Z,ae,ce,ge){var ie=Z.size===ae.size;if(!ie)return!1;if(!Z.size)return!0;var pe={};return Z.forEach(function(de,Ee){if(ie){var De=!1,$e=0;ae.forEach(function(Te,ze){!De&&!pe[$e]&&(De=ce(de,Te,Ee,ze,Z,ae,ge))&&(pe[$e]=!0),$e++}),ie=De}}),ie}var L=i(H),W=Object.freeze({areArraysEqual:C,areDatesEqual:M,areMapsEqual:D,areObjectsEqual:j,areRegExpsEqual:K,areSetsEqual:H,createIsNestedEqual:r}),B=Object.freeze({areArraysEqual:R,areDatesEqual:M,areMapsEqual:A,areObjectsEqual:$,areRegExpsEqual:K,areSetsEqual:L,createIsNestedEqual:r}),U=_(W);function Y(Z,ae){return U(Z,ae,void 0)}var k=_(o(W,{createIsNestedEqual:function(){return l}}));function Q(Z,ae){return k(Z,ae,void 0)}var G=_(B);function O(Z,ae){return G(Z,ae,new WeakMap)}var ee=_(o(B,{createIsNestedEqual:function(){return l}}));function q(Z,ae){return ee(Z,ae,new WeakMap)}function oe(Z){return _(o(W,Z(W)))}function J(Z){var ae=_(o(B,Z(B)));return function(ce,ge,ie){return ie===void 0&&(ie=new WeakMap),ae(ce,ge,ie)}}n.circularDeepEqual=O,n.circularShallowEqual=q,n.createCustomCircularEqual=J,n.createCustomEqual=oe,n.deepEqual=Y,n.sameValueZeroEqual=l,n.shallowEqual=Q,Object.defineProperty(n,"__esModule",{value:!0})})})(j1,j1.exports);var oC=j1.exports;const sC=L_(iY);var Ct={},jX=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(Ct,"__esModule",{value:!0});Ct.bottom=aC;Ct.childrenEqual=HX;Ct.cloneLayout=JN;Ct.cloneLayoutItem=Ql;Ct.collides=Iy;Ct.compact=e5;Ct.compactItem=t5;Ct.compactType=tQ;Ct.correctBounds=n5;Ct.fastPositionEqual=VX;Ct.fastRGLPropsEqual=void 0;Ct.getAllCollisions=r5;Ct.getFirstCollision=Ll;Ct.getLayoutItem=lC;Ct.getStatics=cC;Ct.modifyLayout=ZN;Ct.moveElement=If;Ct.moveElementAwayFromCollision=z1;Ct.noop=void 0;Ct.perc=UX;Ct.resizeItemInDirection=QX;Ct.setTopLeft=ZX;Ct.setTransform=JX;Ct.sortLayoutItems=gC;Ct.sortLayoutItemsByColRow=l5;Ct.sortLayoutItemsByRowCol=a5;Ct.synchronizeLayoutWithChildren=eQ;Ct.validateLayout=c5;Ct.withLayoutItem=BX;var wM=oC,Af=$X(P);function $X(e){return e&&e.__esModule?e:{default:e}}const zX=process.env.NODE_ENV==="production";function aC(e){let t=0,n;for(let r=0,i=e.length;r<i;r++)n=e[r].y+e[r].h,n>t&&(t=n);return t}function JN(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=Ql(e[n]);return t}function ZN(e,t){const n=Array(e.length);for(let r=0,i=e.length;r<i;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function BX(e,t,n){let r=lC(e,t);return r?(r=n(Ql(r)),e=ZN(e,r),[e,r]):[e,null]}function Ql(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 HX(e,t){return(0,wM.deepEqual)(Af.default.Children.map(e,n=>n==null?void 0:n.key),Af.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,wM.deepEqual)(Af.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),Af.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}Ct.fastRGLPropsEqual=jX;function VX(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function Iy(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 e5(e,t,n,r){const i=cC(e),o=gC(e,t),s=Array(e.length);for(let a=0,l=o.length;a<l;a++){let c=Ql(o[a]);c.static||(c=t5(i,c,t,n,o,r),i.push(c)),s[e.indexOf(o[a])]=c,c.moved=!1}return s}const WX={x:"w",y:"h"};function $1(e,t,n,r){const i=WX[r];t[r]+=1;const o=e.map(s=>s.i).indexOf(t.i);for(let s=o+1;s<e.length;s++){const a=e[s];if(!a.static){if(a.y>t.y+t.h)break;Iy(t,a)&&$1(e,a,n+t[i],r)}}t[r]=n}function t5(e,t,n,r,i,o){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(aC(e),t.y);t.y>0&&!Ll(e,t);)t.y--;else if(a)for(;t.x>0&&!Ll(e,t);)t.x--;let l;for(;(l=Ll(e,t))&&!(n===null&&o);)if(a?$1(i,t,l.x+l.w,"x"):$1(i,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!Ll(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function n5(e,t){const n=cC(e);for(let r=0,i=e.length;r<i;r++){const o=e[r];if(o.x+o.w>t.cols&&(o.x=t.cols-o.w),o.x<0&&(o.x=0,o.w=t.cols),!o.static)n.push(o);else for(;Ll(n,o);)o.y++}return e}function lC(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function Ll(e,t){for(let n=0,r=e.length;n<r;n++)if(Iy(e[n],t))return e[n]}function r5(e,t){return e.filter(n=>Iy(n,t))}function cC(e){return e.filter(t=>t.static)}function If(e,t,n,r,i,o,s,a,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;`${t.i}${String(n)}${String(r)}${t.x}${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 d=gC(e,s);(s==="vertical"&&typeof r=="number"?u>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(d=d.reverse());const h=r5(d,t),m=h.length>0;if(m&&l)return JN(e);if(m&&o)return`${t.i}`,t.x=c,t.y=u,t.moved=!1,e;for(let b=0,y=h.length;b<y;b++){const x=h[b];`${t.i}${t.x}${t.y}${x.i}${x.x}${x.y}`,!x.moved&&(x.static?e=z1(e,x,t,i,s):e=z1(e,t,x,i,s))}return e}function z1(e,t,n,r,i,o){const s=i==="horizontal",a=i==="vertical",l=t.static;if(r){r=!1;const d={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"},p=Ll(e,d),h=p&&p.y+p.h>t.y,m=p&&t.x+t.w>p.x;if(p){if(h&&a)return If(e,n,void 0,t.y+1,r,l,i);if(h&&i==null)return t.y=n.y,n.y=n.y+n.h,e;if(m&&s)return If(e,t,n.x,void 0,r,l,i)}else return`${n.i}${d.x}${d.y}`,If(e,n,s?d.x:void 0,a?d.y:void 0,r,l,i)}const c=s?n.x+1:void 0,u=a?n.y+1:void 0;return c==null&&u==null?e:If(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,i)}function UX(e){return e*100+"%"}const i5=(e,t,n,r)=>e+n>r?t:n,o5=(e,t,n)=>e<0?t:n,s5=e=>Math.max(0,e),uC=e=>Math.max(0,e),dC=(e,t,n)=>{let{left:r,height:i,width:o}=t;const s=e.top-(i-e.height);return{left:r,width:o,height:o5(s,e.height,i),top:uC(s)}},fC=(e,t,n)=>{let{top:r,left:i,height:o,width:s}=t;return{top:r,height:o,width:i5(e.left,e.width,s,n),left:s5(i)}},hC=(e,t,n)=>{let{top:r,height:i,width:o}=t;const s=e.left-(o-e.width);return{height:i,width:s<0?e.width:i5(e.left,e.width,o,n),top:uC(r),left:s5(s)}},pC=(e,t,n)=>{let{top:r,left:i,height:o,width:s}=t;return{width:s,left:i,height:o5(r,e.height,o),top:uC(r)}},GX=function(){return dC(arguments.length<=0?void 0:arguments[0],fC(...arguments))},qX=function(){return dC(arguments.length<=0?void 0:arguments[0],hC(...arguments))},YX=function(){return pC(arguments.length<=0?void 0:arguments[0],fC(...arguments))},KX=function(){return pC(arguments.length<=0?void 0:arguments[0],hC(...arguments))},XX={n:dC,ne:GX,e:fC,se:YX,s:pC,sw:KX,w:hC,nw:qX};function QX(e,t,n,r){const i=XX[e];return i?i(t,{...t,...n},r):n}function JX(e){let{top:t,left:n,width:r,height:i}=e;const o=`translate(${n}px,${t}px)`;return{transform:o,WebkitTransform:o,MozTransform:o,msTransform:o,OTransform:o,width:`${r}px`,height:`${i}px`,position:"absolute"}}function ZX(e){let{top:t,left:n,width:r,height:i}=e;return{top:`${t}px`,left:`${n}px`,width:`${r}px`,height:`${i}px`,position:"absolute"}}function gC(e,t){return t==="horizontal"?l5(e):t==="vertical"?a5(e):e}function a5(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 l5(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 eQ(e,t,n,r,i){e=e||[];const o=[];Af.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=lC(e,String(a.key)),c=a.props["data-grid"];l&&c==null?o.push(Ql(l)):c?(zX||c5([c],"ReactGridLayout.children"),o.push(Ql({...c,i:a.key}))):o.push(Ql({w:1,h:1,x:0,y:aC(o),i:String(a.key)}))});const s=n5(o,{cols:n});return i?s:e5(s,r,n)}function c5(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,i=e.length;r<i;r++){const o=e[r];for(let s=0;s<n.length;s++){const a=n[s],l=o[a];if(typeof l!="number"||Number.isNaN(l))throw new Error(`ReactGridLayout: ${t}[${r}].${a} must be a number! Received: ${l} (${typeof l})`)}if(typeof o.i<"u"&&typeof o.i!="string")throw new Error(`ReactGridLayout: ${t}[${r}].i must be a string! Received: ${o.i} (${typeof o.i})`)}}function tQ(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const nQ=()=>{};Ct.noop=nQ;var hs={};Object.defineProperty(hs,"__esModule",{value:!0});hs.calcGridColWidth=ky;hs.calcGridItemPosition=rQ;hs.calcGridItemWHPx=B1;hs.calcWH=oQ;hs.calcXY=iQ;hs.clamp=Fl;function ky(e){const{margin:t,containerPadding:n,containerWidth:r,cols:i}=e;return(r-t[0]*(i-1)-n[0]*2)/i}function B1(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function rQ(e,t,n,r,i,o){const{margin:s,containerPadding:a,rowHeight:l}=e,c=ky(e),u={};return o&&o.resizing?(u.width=Math.round(o.resizing.width),u.height=Math.round(o.resizing.height)):(u.width=B1(r,c,s[0]),u.height=B1(i,l,s[1])),o&&o.dragging?(u.top=Math.round(o.dragging.top),u.left=Math.round(o.dragging.left)):o&&o.resizing&&typeof o.resizing.top=="number"&&typeof o.resizing.left=="number"?(u.top=Math.round(o.resizing.top),u.left=Math.round(o.resizing.left)):(u.top=Math.round((l+s[1])*n+a[1]),u.left=Math.round((c+s[0])*t+a[0])),u}function iQ(e,t,n,r,i){const{margin:o,containerPadding:s,cols:a,rowHeight:l,maxRows:c}=e,u=ky(e);let d=Math.round((n-s[0])/(u+o[0])),p=Math.round((t-s[1])/(l+o[1]));return d=Fl(d,0,a-r),p=Fl(p,0,c-i),{x:d,y:p}}function oQ(e,t,n,r,i,o){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,u=ky(e);let d=Math.round((t+s[0])/(u+s[0])),p=Math.round((n+s[1])/(c+s[1])),h=Fl(d,0,l-r),m=Fl(p,0,a-i);return["sw","w","nw"].indexOf(o)!==-1&&(h=Fl(d,0,l)),["nw","n","ne"].indexOf(o)!==-1&&(m=Fl(p,0,a)),{w:h,h:m}}function Fl(e,t,n){return Math.max(Math.min(e,n),t)}var Ny={},H1={exports:{}},Bg={exports:{}},Yt={};/** @license React v16.13.1
91
+ }`;var gt=zT(function(){return Vt(V,He+"return "+Se).apply(n,X)});if(gt.source=Se,Jv(gt))throw gt;return gt}function aq(f){return qt(f).toLowerCase()}function lq(f){return qt(f).toUpperCase()}function cq(f,g,w){if(f=qt(f),f&&(w||g===n))return K2(f);if(!f||!(g=Si(g)))return f;var T=po(f),N=po(g),V=X2(T,N),X=Q2(T,N)+1;return ha(T,V,X).join("")}function uq(f,g,w){if(f=qt(f),f&&(w||g===n))return f.slice(0,Z2(f)+1);if(!f||!(g=Si(g)))return f;var T=po(f),N=Q2(T,po(g))+1;return ha(T,0,N).join("")}function dq(f,g,w){if(f=qt(f),f&&(w||g===n))return f.replace(mn,"");if(!f||!(g=Si(g)))return f;var T=po(f),N=X2(T,po(g));return ha(T,N).join("")}function fq(f,g){var w=F,T=j;if(Rn(g)){var N="separator"in g?g.separator:N;w="length"in g?ut(g.length):w,T="omission"in g?Si(g.omission):T}f=qt(f);var V=f.length;if(Bc(f)){var X=po(f);V=X.length}if(w>=V)return f;var re=w-Hc(T);if(re<1)return T;var ue=X?ha(X,0,re).join(""):f.slice(0,re);if(N===n)return ue+T;if(X&&(re+=ue.length-re),Zv(N)){if(f.slice(re).search(N)){var ve,xe=ue;for(N.global||(N=gv(N.source,qt(jt.exec(N))+"g")),N.lastIndex=0;ve=N.exec(xe);)var Se=ve.index;ue=ue.slice(0,Se===n?re:Se)}}else if(f.indexOf(Si(N),re)!=re){var Ie=ue.lastIndexOf(N);Ie>-1&&(ue=ue.slice(0,Ie))}return ue+T}function hq(f){return f=qt(f),f&&kr.test(f)?f.replace(Lo,HB):f}var pq=Kc(function(f,g,w){return f+(w?" ":"")+g.toUpperCase()}),nx=BP("toUpperCase");function $T(f,g,w){return f=qt(f),g=w?n:g,g===n?FB(f)?UB(f):TB(f):f.match(g)||[]}var zT=wt(function(f,g){try{return xi(f,n,g)}catch(w){return Jv(w)?w:new ot(w)}}),gq=Es(function(f,g){return Gi(g,function(w){w=$o(w),_s(f,w,Xv(f[w],f))}),f});function mq(f){var g=f==null?0:f.length,w=We();return f=g?En(f,function(T){if(typeof T[1]!="function")throw new qi(s);return[w(T[0]),T[1]]}):[],wt(function(T){for(var N=-1;++N<g;){var V=f[N];if(xi(V[0],this,T))return xi(V[1],this,T)}})}function bq(f){return HH(Ki(f,d))}function rx(f){return function(){return f}}function yq(f,g){return f==null||f!==f?g:f}var vq=VP(),xq=VP(!0);function ni(f){return f}function ix(f){return vP(typeof f=="function"?f:Ki(f,d))}function wq(f){return wP(Ki(f,d))}function Sq(f,g){return SP(f,Ki(g,d))}var _q=wt(function(f,g){return function(w){return Yd(w,f,g)}}),Cq=wt(function(f,g){return function(w){return Yd(f,w,g)}});function ox(f,g,w){var T=ir(g),N=mg(g,T);w==null&&!(Rn(g)&&(N.length||!T.length))&&(w=g,g=f,f=this,N=mg(g,ir(g)));var V=!(Rn(w)&&"chain"in w)||!!w.chain,X=Ps(f);return Gi(N,function(re){var ue=g[re];f[re]=ue,X&&(f.prototype[re]=function(){var ve=this.__chain__;if(V||ve){var xe=f(this.__wrapped__),Se=xe.__actions__=Zr(this.__actions__);return Se.push({func:ue,args:arguments,thisArg:f}),xe.__chain__=ve,xe}return ue.apply(f,aa([this.value()],arguments))})}),f}function Eq(){return ur._===this&&(ur._=QB),this}function sx(){}function Rq(f){return f=ut(f),wt(function(g){return _P(g,f)})}var Pq=Fv(En),Tq=Fv(W2),Mq=Fv(lv);function BT(f){return Wv(f)?cv($o(f)):oV(f)}function Oq(f){return function(g){return f==null?n:hl(f,g)}}var Dq=UP(),Aq=UP(!0);function ax(){return[]}function lx(){return!1}function Iq(){return{}}function kq(){return""}function Nq(){return!0}function Lq(f,g){if(f=ut(f),f<1||f>U)return[];var w=Q,T=xr(f,Q);g=We(g),f-=Q;for(var N=fv(T,g);++w<f;)g(w);return N}function Fq(f){return at(f)?En(f,$o):_i(f)?[f]:Zr(aT(qt(f)))}function jq(f){var g=++KB;return qt(f)+g}var $q=Sg(function(f,g){return f+g},0),zq=jv("ceil"),Bq=Sg(function(f,g){return f/g},1),Hq=jv("floor");function Vq(f){return f&&f.length?gg(f,ni,_v):n}function Wq(f,g){return f&&f.length?gg(f,We(g,2),_v):n}function Uq(f){return q2(f,ni)}function Gq(f,g){return q2(f,We(g,2))}function qq(f){return f&&f.length?gg(f,ni,Pv):n}function Yq(f,g){return f&&f.length?gg(f,We(g,2),Pv):n}var Kq=Sg(function(f,g){return f*g},1),Xq=jv("round"),Qq=Sg(function(f,g){return f-g},0);function Jq(f){return f&&f.length?dv(f,ni):0}function Zq(f,g){return f&&f.length?dv(f,We(g,2)):0}return z.after=wU,z.ary=yT,z.assign=lG,z.assignIn=AT,z.assignInWith=Ng,z.assignWith=cG,z.at=uG,z.before=vT,z.bind=Xv,z.bindAll=gq,z.bindKey=xT,z.castArray=IU,z.chain=gT,z.chunk=HV,z.compact=VV,z.concat=WV,z.cond=mq,z.conforms=bq,z.constant=rx,z.countBy=JW,z.create=dG,z.curry=wT,z.curryRight=ST,z.debounce=_T,z.defaults=fG,z.defaultsDeep=hG,z.defer=SU,z.delay=_U,z.difference=UV,z.differenceBy=GV,z.differenceWith=qV,z.drop=YV,z.dropRight=KV,z.dropRightWhile=XV,z.dropWhile=QV,z.fill=JV,z.filter=eU,z.flatMap=rU,z.flatMapDeep=iU,z.flatMapDepth=oU,z.flatten=dT,z.flattenDeep=ZV,z.flattenDepth=eW,z.flip=CU,z.flow=vq,z.flowRight=xq,z.fromPairs=tW,z.functions=xG,z.functionsIn=wG,z.groupBy=sU,z.initial=rW,z.intersection=iW,z.intersectionBy=oW,z.intersectionWith=sW,z.invert=_G,z.invertBy=CG,z.invokeMap=lU,z.iteratee=ix,z.keyBy=cU,z.keys=ir,z.keysIn=ti,z.map=Mg,z.mapKeys=RG,z.mapValues=PG,z.matches=wq,z.matchesProperty=Sq,z.memoize=Dg,z.merge=TG,z.mergeWith=IT,z.method=_q,z.methodOf=Cq,z.mixin=ox,z.negate=Ag,z.nthArg=Rq,z.omit=MG,z.omitBy=OG,z.once=EU,z.orderBy=uU,z.over=Pq,z.overArgs=RU,z.overEvery=Tq,z.overSome=Mq,z.partial=Qv,z.partialRight=CT,z.partition=dU,z.pick=DG,z.pickBy=kT,z.property=BT,z.propertyOf=Oq,z.pull=uW,z.pullAll=hT,z.pullAllBy=dW,z.pullAllWith=fW,z.pullAt=hW,z.range=Dq,z.rangeRight=Aq,z.rearg=PU,z.reject=pU,z.remove=pW,z.rest=TU,z.reverse=Yv,z.sampleSize=mU,z.set=IG,z.setWith=kG,z.shuffle=bU,z.slice=gW,z.sortBy=xU,z.sortedUniq=SW,z.sortedUniqBy=_W,z.split=rq,z.spread=MU,z.tail=CW,z.take=EW,z.takeRight=RW,z.takeRightWhile=PW,z.takeWhile=TW,z.tap=VW,z.throttle=OU,z.thru=Tg,z.toArray=MT,z.toPairs=NT,z.toPairsIn=LT,z.toPath=Fq,z.toPlainObject=DT,z.transform=NG,z.unary=DU,z.union=MW,z.unionBy=OW,z.unionWith=DW,z.uniq=AW,z.uniqBy=IW,z.uniqWith=kW,z.unset=LG,z.unzip=Kv,z.unzipWith=pT,z.update=FG,z.updateWith=jG,z.values=Jc,z.valuesIn=$G,z.without=NW,z.words=$T,z.wrap=AU,z.xor=LW,z.xorBy=FW,z.xorWith=jW,z.zip=$W,z.zipObject=zW,z.zipObjectDeep=BW,z.zipWith=HW,z.entries=NT,z.entriesIn=LT,z.extend=AT,z.extendWith=Ng,ox(z,z),z.add=$q,z.attempt=zT,z.camelCase=VG,z.capitalize=FT,z.ceil=zq,z.clamp=zG,z.clone=kU,z.cloneDeep=LU,z.cloneDeepWith=FU,z.cloneWith=NU,z.conformsTo=jU,z.deburr=jT,z.defaultTo=yq,z.divide=Bq,z.endsWith=WG,z.eq=mo,z.escape=UG,z.escapeRegExp=GG,z.every=ZW,z.find=tU,z.findIndex=cT,z.findKey=pG,z.findLast=nU,z.findLastIndex=uT,z.findLastKey=gG,z.floor=Hq,z.forEach=mT,z.forEachRight=bT,z.forIn=mG,z.forInRight=bG,z.forOwn=yG,z.forOwnRight=vG,z.get=ex,z.gt=$U,z.gte=zU,z.has=SG,z.hasIn=tx,z.head=fT,z.identity=ni,z.includes=aU,z.indexOf=nW,z.inRange=BG,z.invoke=EG,z.isArguments=ml,z.isArray=at,z.isArrayBuffer=BU,z.isArrayLike=ei,z.isArrayLikeObject=jn,z.isBoolean=HU,z.isBuffer=pa,z.isDate=VU,z.isElement=WU,z.isEmpty=UU,z.isEqual=GU,z.isEqualWith=qU,z.isError=Jv,z.isFinite=YU,z.isFunction=Ps,z.isInteger=ET,z.isLength=Ig,z.isMap=RT,z.isMatch=KU,z.isMatchWith=XU,z.isNaN=QU,z.isNative=JU,z.isNil=eG,z.isNull=ZU,z.isNumber=PT,z.isObject=Rn,z.isObjectLike=On,z.isPlainObject=ef,z.isRegExp=Zv,z.isSafeInteger=tG,z.isSet=TT,z.isString=kg,z.isSymbol=_i,z.isTypedArray=Qc,z.isUndefined=nG,z.isWeakMap=rG,z.isWeakSet=iG,z.join=aW,z.kebabCase=qG,z.last=Qi,z.lastIndexOf=lW,z.lowerCase=YG,z.lowerFirst=KG,z.lt=oG,z.lte=sG,z.max=Vq,z.maxBy=Wq,z.mean=Uq,z.meanBy=Gq,z.min=qq,z.minBy=Yq,z.stubArray=ax,z.stubFalse=lx,z.stubObject=Iq,z.stubString=kq,z.stubTrue=Nq,z.multiply=Kq,z.nth=cW,z.noConflict=Eq,z.noop=sx,z.now=Og,z.pad=XG,z.padEnd=QG,z.padStart=JG,z.parseInt=ZG,z.random=HG,z.reduce=fU,z.reduceRight=hU,z.repeat=eq,z.replace=tq,z.result=AG,z.round=Xq,z.runInContext=le,z.sample=gU,z.size=yU,z.snakeCase=nq,z.some=vU,z.sortedIndex=mW,z.sortedIndexBy=bW,z.sortedIndexOf=yW,z.sortedLastIndex=vW,z.sortedLastIndexBy=xW,z.sortedLastIndexOf=wW,z.startCase=iq,z.startsWith=oq,z.subtract=Qq,z.sum=Jq,z.sumBy=Zq,z.template=sq,z.times=Lq,z.toFinite=Ts,z.toInteger=ut,z.toLength=OT,z.toLower=aq,z.toNumber=Ji,z.toSafeInteger=aG,z.toString=qt,z.toUpper=lq,z.trim=cq,z.trimEnd=uq,z.trimStart=dq,z.truncate=fq,z.unescape=hq,z.uniqueId=jq,z.upperCase=pq,z.upperFirst=nx,z.each=mT,z.eachRight=bT,z.first=fT,ox(z,function(){var f={};return Fo(z,function(g,w){en.call(z.prototype,w)||(f[w]=g)}),f}(),{chain:!1}),z.VERSION=r,Gi(["bind","bindKey","curry","curryRight","partial","partialRight"],function(f){z[f].placeholder=z}),Gi(["drop","take"],function(f,g){At.prototype[f]=function(w){w=w===n?1:Jn(ut(w),0);var T=this.__filtered__&&!g?new At(this):this.clone();return T.__filtered__?T.__takeCount__=xr(w,T.__takeCount__):T.__views__.push({size:xr(w,Q),type:f+(T.__dir__<0?"Right":"")}),T},At.prototype[f+"Right"]=function(w){return this.reverse()[f](w).reverse()}}),Gi(["filter","map","takeWhile"],function(f,g){var w=g+1,T=w==H||w==W;At.prototype[f]=function(N){var V=this.clone();return V.__iteratees__.push({iteratee:We(N,3),type:w}),V.__filtered__=V.__filtered__||T,V}}),Gi(["head","last"],function(f,g){var w="take"+(g?"Right":"");At.prototype[f]=function(){return this[w](1).value()[0]}}),Gi(["initial","tail"],function(f,g){var w="drop"+(g?"":"Right");At.prototype[f]=function(){return this.__filtered__?new At(this):this[w](1)}}),At.prototype.compact=function(){return this.filter(ni)},At.prototype.find=function(f){return this.filter(f).head()},At.prototype.findLast=function(f){return this.reverse().find(f)},At.prototype.invokeMap=wt(function(f,g){return typeof f=="function"?new At(this):this.map(function(w){return Yd(w,f,g)})}),At.prototype.reject=function(f){return this.filter(Ag(We(f)))},At.prototype.slice=function(f,g){f=ut(f);var w=this;return w.__filtered__&&(f>0||g<0)?new At(w):(f<0?w=w.takeRight(-f):f&&(w=w.drop(f)),g!==n&&(g=ut(g),w=g<0?w.dropRight(-g):w.take(g-f)),w)},At.prototype.takeRightWhile=function(f){return this.reverse().takeWhile(f).reverse()},At.prototype.toArray=function(){return this.take(Q)},Fo(At.prototype,function(f,g){var w=/^(?:filter|find|map|reject)|While$/.test(g),T=/^(?:head|last)$/.test(g),N=z[T?"take"+(g=="last"?"Right":""):g],V=T||/^find/.test(g);N&&(z.prototype[g]=function(){var X=this.__wrapped__,re=T?[1]:arguments,ue=X instanceof At,ve=re[0],xe=ue||at(X),Se=function(Rt){var kt=N.apply(z,aa([Rt],re));return T&&Ie?kt[0]:kt};xe&&w&&typeof ve=="function"&&ve.length!=1&&(ue=xe=!1);var Ie=this.__chain__,He=!!this.__actions__.length,Ue=V&&!Ie,gt=ue&&!He;if(!V&&xe){X=gt?X:new At(this);var Ge=f.apply(X,re);return Ge.__actions__.push({func:Tg,args:[Se],thisArg:n}),new Yi(Ge,Ie)}return Ue&&gt?f.apply(this,re):(Ge=this.thru(Se),Ue?T?Ge.value()[0]:Ge.value():Ge)})}),Gi(["pop","push","shift","sort","splice","unshift"],function(f){var g=eg[f],w=/^(?:push|sort|unshift)$/.test(f)?"tap":"thru",T=/^(?:pop|shift)$/.test(f);z.prototype[f]=function(){var N=arguments;if(T&&!this.__chain__){var V=this.value();return g.apply(at(V)?V:[],N)}return this[w](function(X){return g.apply(at(X)?X:[],N)})}}),Fo(At.prototype,function(f,g){var w=z[g];if(w){var T=w.name+"";en.call(Gc,T)||(Gc[T]=[]),Gc[T].push({name:g,func:w})}}),Gc[wg(n,x).name]=[{name:"wrapper",func:n}],At.prototype.clone=hH,At.prototype.reverse=pH,At.prototype.value=gH,z.prototype.at=WW,z.prototype.chain=UW,z.prototype.commit=GW,z.prototype.next=qW,z.prototype.plant=KW,z.prototype.reverse=XW,z.prototype.toJSON=z.prototype.valueOf=z.prototype.value=QW,z.prototype.first=z.prototype.head,Bd&&(z.prototype[Bd]=YW),z},Vc=GB();ll?((ll.exports=Vc)._=Vc,iv._=Vc):ur._=Vc}).call(Ca)})(mb,mb.exports);var Of=mb.exports;const Xl=Pc(Of);function aM({id:e,layouts:t,initialHeight:n,y:r,x:i,w:o,minH:s}){const a={i:e,x:i??0,y:r??1/0,w:o||20,h:n||35,minW:6,minH:s||10},l=t?{...t}:{};return V_.forEach(c=>{l[c]||(l[c]=[]);const u=l[c].reduce((d,p)=>Math.max(d,p.y+p.h),0);a.y=a.y===1/0?u:a.y,l[c].push({...a})}),l}function lM(e,t){if(!t)return;const n={...t};return V_.forEach(r=>{n[r]&&(n[r]=n[r].filter(i=>i.i!==e))}),n}function G_(e){return ye.getState().dashboard.globalCacheConfig}const ye=Jk()(oN((e,t)=>({isSessionExpired:!1,currentBreakpoint:"lg",dashboard:{id:"",style:gb},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:gb},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 o,s,a,l,c,u,d,p;const i=(o=r.dashboard.sheets)==null?void 0:o.findIndex(h=>h.id===n);if(i!==void 0&&i>-1){(s=r.dashboard.sheets)==null||s.splice(i,1);const h=(a=r.dashboard.filters)==null?void 0:a.filter(b=>b.sheetId===n),m=(l=r.filterValues)==null?void 0:l.filter(b=>h==null?void 0:h.some(y=>y.id===b.filterId));r.filterValues=(c=r.filterValues)==null?void 0:c.filter(b=>!(m!=null&&m.some(y=>y.filterId===b.filterId))),r.dashboard.filters=(u=r.dashboard.filters)==null?void 0:u.filter(b=>b.sheetId!==n),r.selectedSheetId=(p=(d=r.dashboard.sheets)==null?void 0:d[0])==null?void 0:p.id}})},addSheet:n=>{e(r=>{r.dashboard.sheets||(r.dashboard.sheets=[]);const i=r.dashboard.filters;let o={};i==null||i.forEach(a=>{V_.forEach(l=>{o!=null&&o[l]||(o={...o,[l]:[]});const c={i:a.id,x:0,y:0,w:10,h:8};o[l].push(c)})});const s={...n,layouts:o};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(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===i.selectedSheetId);o&&Of.forEach(o.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(d=>d.id===n);c&&(c.python=r)})})},addBaseQuery:n=>{e(r=>{var i;r.dashboard.baseQueries||(r.dashboard.baseQueries=[]),(i=r.dashboard.baseQueries)==null||i.push(n)})},removeBaseQuery:n=>{e(r=>{var o,s;const i=(o=r.dashboard.baseQueries)==null?void 0:o.findIndex(a=>a.id===n);i!=null&&i>-1&&((s=r.dashboard.baseQueries)==null||s.splice(i,1))})},setBaseQueries:n=>{e(r=>{r.dashboard.baseQueries=n})},setCurrentBreakpoint:n=>{e(()=>({currentBreakpoint:n}))},setFilteringCards:n=>{e(()=>({filteringCards:n}))},addFilteringCard:n=>{e(r=>{var i;(i=r.filteringCards)==null||i.push(n)})},removeFilteringCard:n=>{e(r=>{var o,s;const i=(o=r.filteringCards)==null?void 0:o.findIndex(a=>a.id===n.id);i!==void 0&&i>-1&&((s=r.filteringCards)==null||s.splice(i,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(i=>{i.dashboard=n,i.filterValues=r})},setDashboardTheme:n=>{e(r=>{r.theme=n})},setSheets:n=>{e(r=>{r.dashboard&&(r.dashboard.sheets=n)})},setSheetTitle:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);o&&(o.title=r)})},setCardTitle:(n,r,i)=>{e(o=>{var a,l;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&Of.forEach(s.frames,c=>{var d;const u=(d=c.cards)==null?void 0:d.find(p=>p.id===r);u&&(u.title=i)})})},setCardInfo:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===i.selectedSheetId);o&&Of.forEach(o.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(d=>d.id===n);c&&(c.info=r)})})},setCardDescription:(n,r,i)=>{e(o=>{var a,l;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&Of.forEach(s.frames,c=>{var d;const u=(d=c.cards)==null?void 0:d.find(p=>p.id===r);u&&(u.description=i)})})},setCardSql:(n,r,i)=>{e(o=>{var a,l,c,u;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(d=>d.id===n);if(s){const d=(c=s.cards)==null?void 0:c.find(p=>p.id===r);d&&(d.sql=i,(u=o.onUpdateCard)==null||u.call(o,d,n))}})},setSheetLayout:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);o&&(o.layout=r)})},setSheetLayouts:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);o&&(o.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 i=r.filterValues.findIndex(o=>o.filterId===n.filterId);i>-1?r.filterValues.splice(i,1,n):r.filterValues.push(n)}else r.filterValues=[n]})},addOrUpdateFilterValues:n=>{e(r=>{r.filterValues?n.forEach(i=>{var s,a,l;const o=(s=r==null?void 0:r.filterValues)==null?void 0:s.findIndex(c=>c.filterId===i.filterId);o!==void 0&&o>-1?(a=r.filterValues)==null||a.splice(o,1,i):(l=r.filterValues)==null||l.push(i)}):r.filterValues=n})},removeFilterValue:n=>{e(r=>{if(r.filterValues){const i=r.filterValues.filter(o=>o.filterId!==n&&!o.filterId.startsWith(n));r.filterValues=i}})},replaceFilterValue:n=>{e(r=>{if(r.filterValues){const i=r.filterValues.findIndex(o=>o.filterId===n.filterId);i>-1&&r.filterValues.splice(i,1,n)}})},addFilter:n=>{e(r=>{var o,s;r.dashboard.filters?(o=r.dashboard.filters)==null||o.push(n):r.dashboard.filters=[n],(s=r.dashboard.sheets)==null||s.find(a=>a.id===r.selectedSheetId);const i=r.dashboard.sheets;i==null||i.forEach(a=>{aM({id:n.id,layouts:a.layouts,y:0,initialHeight:8,minH:7,w:10})})})},removeFilter:n=>{e(r=>{var i,o,s;if(r.dashboard.filters){const a=(i=r.dashboard.filters)==null?void 0:i.findIndex(l=>l.id===n);if(a>-1){(o=r.dashboard.filters)==null||o.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=>{const u=lM(n,c.layouts);c.layouts=u})}}})},updateFrameCard:(n,r,i)=>{e(o=>{var l,c,u,d,p;const s=(c=(l=o.dashboard)==null?void 0:l.sheets)==null?void 0:c.find(h=>h.id===n);if(!s)return;const a=(u=s==null?void 0:s.frames)==null?void 0:u.find(h=>h.id===r);if(a){const h=(d=a.cards)==null?void 0:d.findIndex(m=>m.id===i.id);h>-1&&((p=a.cards)==null||p.splice(h,1,i))}})},updateFilter:n=>{e(r=>{var i,o;if(r.dashboard.filters){const s=(i=r.dashboard.filters)==null?void 0:i.findIndex(a=>a.id===n.id);s>-1&&((o=r.dashboard.filters)==null||o.splice(s,1,n))}})},setIsDashboardEditing:n=>{e(()=>({isDashboardEditing:n}))},setShowDashboardJSON:n=>{e(()=>({showDashboardJSON:n}))},setIsVisualEditing:n=>{e(()=>({isVisualEditing:n}))},addFrame:(n,r,i)=>{e(o=>{var a,l,c,u;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(d=>d.id===n);if(s){s.frames||(s.frames=[]),(c=s.frames)==null||c.push(r);let d=1/0;const p=0;i==="start"&&(d=0);const h=aM({id:r.id,layouts:s.layouts,minH:10,x:p,y:d});s.layouts=h,(u=o.onAddFrame)==null||u.call(o,r,n)}})},removeFrame:(n,r)=>{e(i=>{var s,a,l,c,u;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(d=>d.id===n);if(o){const d=(l=o.frames)==null?void 0:l.findIndex(p=>p.id===r);console.log(d),typeof d=="number"&&d>-1&&((c=o.frames)==null||c.splice(d,1),(u=o.layout)==null||u.splice(d,1),lM(r,o.layouts))}})},updateFrame:(n,r)=>{e(i=>{var a,l,c,u,d;const o=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(p=>p.id===n),s=(c=o==null?void 0:o.frames)==null?void 0:c.findIndex(p=>p.id===r.id);o&&((u=o.frames)==null||u.splice(s,1,r)),(d=i.onAcceptChanges)==null||d.call(i,r,i.dashboard)})},updateCard:(n,r)=>{e(i=>{var a,l,c,u,d;const o=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(p=>p.id===n),s=(c=o==null?void 0:o.cards)==null?void 0:c.findIndex(p=>p.id===r.id);o&&((u=o.cards)==null||u.splice(s,1,r),(d=i.onUpdateCard)==null||d.call(i,r,n))})},removeCard:(n,r)=>{e(i=>{var a,l,c,u,d,p;const o=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(h=>h.id===n),s=(c=o==null?void 0:o.cards)==null?void 0:c.findIndex(h=>h.id===r.id);o&&((u=o.cards)==null||u.splice(s,1),(d=o.layout)==null||d.splice(s,1),(p=i.onRemoveCard)==null||p.call(i,r,n))})},setStyle:n=>{e(r=>{r.dashboard&&(r.dashboard.style=n)})},setSelectedCardId:(n,r)=>{e(i=>{var s,a,l;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===n);o&&(((l=o.cards)==null?void 0:l.find(u=>u.id===r))?i.selectedCardId=r:i.selectedCardId=null)})},setSelectedFrameId:n=>{e(r=>{var o,s;((s=(o=r.dashboard)==null?void 0:o.sheets)==null?void 0:s.find(a=>a.id===r.selectedSheetId))&&(r.selectedFrameId=n)})},setSelectedSheetId:n=>{e(r=>{var o,s;((s=(o=r.dashboard)==null?void 0:o.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(i=>i.id===t().selectedSheetId)},getCardFrame:n=>{var i,o;const r=(i=t().dashboard)==null?void 0:i.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((o=a[l].cards)==null?void 0:o.find(u=>u.id===n))return a[l]}}},getSelectedFrame:()=>{var r,i,o;const n=(i=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:i.find(s=>s.id===t().selectedSheetId);return(o=n==null?void 0:n.frames)==null?void 0:o.find(s=>s.id===t().selectedFrameId)},getCard:n=>{var i,o;const r=(i=t().dashboard)==null?void 0:i.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=(o=a[l].cards)==null?void 0:o.find(u=>u.id===n);if(c)return c}}},getSelectedSheetLayout:()=>{var r,i;const n=(i=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:i.find(o=>o.id===t().selectedSheetId);return n==null?void 0:n.layout},getSelectedSheetLayouts:()=>{var r,i;const n=(i=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:i.find(o=>o.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 i,o;const r=(i=t().dashboard)==null?void 0:i.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((o=a[l].cards)==null?void 0:o.find(u=>u.id===n))return r[s]}}},handleDataPointClickAction:(n,r)=>{TK({card:n,dataPoint:r,set:e,get:t})}}}))),gr=()=>ye(e=>e.actions),MK={theme:"system",setTheme:()=>null},fN=P.createContext(MK);function OK({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[i,o]=P.useState(()=>localStorage.getItem(n)||t);P.useEffect(()=>{const a=window.document.documentElement;if(a.classList.remove("light","dark"),i==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";a.classList.add(l);return}a.classList.add(i)},[i]);const s={theme:i,setTheme:a=>{localStorage.setItem(n,a),o(a)}};return v.jsx(fN.Provider,{...r,value:s,children:e})}const hN=()=>{const e=P.useContext(fN);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};var hp=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(){}},hc=typeof window>"u"||"Deno"in globalThis;function to(){}function DK(e,t){return typeof e=="function"?e(t):e}function S1(e){return typeof e=="number"&&e>=0&&e!==1/0}function pN(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Cu(e,t){return typeof e=="function"?e(t):e}function Co(e,t){return typeof e=="function"?e(t):e}function cM(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==q_(s,t.options))return!1}else if(!vh(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||i&&i!==t.state.fetchStatus||o&&!o(t))}function uM(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(yh(t.options.mutationKey)!==yh(o))return!1}else if(!vh(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function q_(e,t){return((t==null?void 0:t.queryKeyHashFn)||yh)(e)}function yh(e){return JSON.stringify(e,(t,n)=>E1(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function vh(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!vh(e[n],t[n])):!1}function _1(e,t){if(e===t)return e;const n=dM(e)&&dM(t);if(n||E1(e)&&E1(t)){const r=n?e:Object.keys(e),i=r.length,o=n?t:Object.keys(t),s=o.length,a=n?[]:{};let l=0;for(let c=0;c<s;c++){const u=n?c:o[c];(!n&&r.includes(u)||n)&&e[u]===void 0&&t[u]===void 0?(a[u]=void 0,l++):(a[u]=_1(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return i===s&&l===i?e:a}return t}function C1(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function dM(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function E1(e){if(!fM(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!fM(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function fM(e){return Object.prototype.toString.call(e)==="[object Object]"}function AK(e){return new Promise(t=>{setTimeout(t,e)})}function R1(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return _1(e,t)}catch(r){console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${r}`)}return _1(e,t)}return t}function IK(e){return e}function kK(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function NK(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var bb=Symbol();function gN(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===bb&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===bb?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Vl,Ra,Fu,Nk,LK=(Nk=class extends hp{constructor(){super();Ze(this,Vl);Ze(this,Ra);Ze(this,Fu);je(this,Fu,t=>{if(!hc&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){se(this,Ra)||this.setEventListener(se(this,Fu))}onUnsubscribe(){var t;this.hasListeners()||((t=se(this,Ra))==null||t.call(this),je(this,Ra,void 0))}setEventListener(t){var n;je(this,Fu,t),(n=se(this,Ra))==null||n.call(this),je(this,Ra,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){se(this,Vl)!==t&&(je(this,Vl,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof se(this,Vl)=="boolean"?se(this,Vl):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Vl=new WeakMap,Ra=new WeakMap,Fu=new WeakMap,Nk),Y_=new LK,ju,Pa,$u,Lk,FK=(Lk=class extends hp{constructor(){super();Ze(this,ju,!0);Ze(this,Pa);Ze(this,$u);je(this,$u,t=>{if(!hc&&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(){se(this,Pa)||this.setEventListener(se(this,$u))}onUnsubscribe(){var t;this.hasListeners()||((t=se(this,Pa))==null||t.call(this),je(this,Pa,void 0))}setEventListener(t){var n;je(this,$u,t),(n=se(this,Pa))==null||n.call(this),je(this,Pa,t(this.setOnline.bind(this)))}setOnline(t){se(this,ju)!==t&&(je(this,ju,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return se(this,ju)}},ju=new WeakMap,Pa=new WeakMap,$u=new WeakMap,Lk),yb=new FK;function P1(){let e,t;const n=new Promise((i,o)=>{e=i,t=o});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}function jK(e){return Math.min(1e3*2**e,3e4)}function mN(e){return(e??"online")==="online"?yb.isOnline():!0}var bN=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function yx(e){return e instanceof bN}function yN(e){let t=!1,n=0,r=!1,i;const o=P1(),s=b=>{var y;r||(p(new bN(b)),(y=e.abort)==null||y.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>Y_.isFocused()&&(e.networkMode==="always"||yb.isOnline())&&e.canRun(),u=()=>mN(e.networkMode)&&e.canRun(),d=b=>{var y;r||(r=!0,(y=e.onSuccess)==null||y.call(e,b),i==null||i(),o.resolve(b))},p=b=>{var y;r||(r=!0,(y=e.onError)==null||y.call(e,b),i==null||i(),o.reject(b))},h=()=>new Promise(b=>{var y;i=x=>{(r||c())&&b(x)},(y=e.onPause)==null||y.call(e)}).then(()=>{var b;i=void 0,r||(b=e.onContinue)==null||b.call(e)}),m=()=>{if(r)return;let b;const y=n===0?e.initialPromise:void 0;try{b=y??e.fn()}catch(x){b=Promise.reject(x)}Promise.resolve(b).then(d).catch(x=>{var M;if(r)return;const S=e.retry??(hc?0:3),_=e.retryDelay??jK,C=typeof _=="function"?_(n,x):_,R=S===!0||typeof S=="number"&&n<S||typeof S=="function"&&S(n,x);if(t||!R){p(x);return}n++,(M=e.onFail)==null||M.call(e,n,x),AK(C).then(()=>c()?void 0:h()).then(()=>{t?p(x):m()})})};return{promise:o,cancel:s,continue:()=>(i==null||i(),o),cancelRetry:a,continueRetry:l,canStart:u,start:()=>(u()?m():h().then(m),o)}}function $K(){let e=[],t=0,n=a=>{a()},r=a=>{a()},i=a=>setTimeout(a,0);const o=a=>{t?e.push(a):i(()=>{n(a)})},s=()=>{const a=e;e=[],a.length&&i(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||s()}return l},batchCalls:a=>(...l)=>{o(()=>{a(...l)})},schedule:o,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{i=a}}}var pr=$K(),Wl,Fk,vN=(Fk=class{constructor(){Ze(this,Wl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),S1(this.gcTime)&&je(this,Wl,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(hc?1/0:5*60*1e3))}clearGcTimeout(){se(this,Wl)&&(clearTimeout(se(this,Wl)),je(this,Wl,void 0))}},Wl=new WeakMap,Fk),zu,Bu,eo,Er,lp,Ul,So,ks,jk,zK=(jk=class extends vN{constructor(t){super();Ze(this,So);Ze(this,zu);Ze(this,Bu);Ze(this,eo);Ze(this,Er);Ze(this,lp);Ze(this,Ul);je(this,Ul,!1),je(this,lp,t.defaultOptions),this.setOptions(t.options),this.observers=[],je(this,eo,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,je(this,zu,BK(this.options)),this.state=t.state??se(this,zu),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=se(this,Er))==null?void 0:t.promise}setOptions(t){this.options={...se(this,lp),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&se(this,eo).remove(this)}setData(t,n){const r=R1(this.state.data,t,this.options);return Nt(this,So,ks).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Nt(this,So,ks).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=se(this,Er))==null?void 0:r.promise;return(i=se(this,Er))==null||i.cancel(t),n?n.then(to).catch(to):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(se(this,zu))}isActive(){return this.observers.some(t=>Co(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===bb||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!pN(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=se(this,Er))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=se(this,Er))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),se(this,eo).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(se(this,Er)&&(se(this,Ul)?se(this,Er).cancel({revert:!0}):se(this,Er).cancelRetry()),this.scheduleGc()),se(this,eo).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Nt(this,So,ks).call(this,{type:"invalidate"})}fetch(t,n){var l,c,u;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(se(this,Er))return se(this,Er).continueRetry(),se(this,Er).promise}if(t&&this.setOptions(t),!this.options.queryFn){const d=this.observers.find(p=>p.options.queryFn);d&&this.setOptions(d.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,i=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(je(this,Ul,!0),r.signal)})},o=()=>{const d=gN(this.options,n),p={queryKey:this.queryKey,meta:this.meta};return i(p),je(this,Ul,!1),this.options.persister?this.options.persister(d,p,this):d(p)},s={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:o};i(s),(l=this.options.behavior)==null||l.onFetch(s,this),je(this,Bu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=s.fetchOptions)==null?void 0:c.meta))&&Nt(this,So,ks).call(this,{type:"fetch",meta:(u=s.fetchOptions)==null?void 0:u.meta});const a=d=>{var p,h,m,b;yx(d)&&d.silent||Nt(this,So,ks).call(this,{type:"error",error:d}),yx(d)||((h=(p=se(this,eo).config).onError)==null||h.call(p,d,this),(b=(m=se(this,eo).config).onSettled)==null||b.call(m,this.state.data,d,this)),this.scheduleGc()};return je(this,Er,yN({initialPromise:n==null?void 0:n.initialPromise,fn:s.fetchFn,abort:r.abort.bind(r),onSuccess:d=>{var p,h,m,b;if(d===void 0){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}`),a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(d)}catch(y){a(y);return}(h=(p=se(this,eo).config).onSuccess)==null||h.call(p,d,this),(b=(m=se(this,eo).config).onSettled)==null||b.call(m,d,this.state.error,this),this.scheduleGc()},onError:a,onFail:(d,p)=>{Nt(this,So,ks).call(this,{type:"failed",failureCount:d,error:p})},onPause:()=>{Nt(this,So,ks).call(this,{type:"pause"})},onContinue:()=>{Nt(this,So,ks).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0})),se(this,Er).start()}},zu=new WeakMap,Bu=new WeakMap,eo=new WeakMap,Er=new WeakMap,lp=new WeakMap,Ul=new WeakMap,So=new WeakSet,ks=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,...xN(r.data,this.options),fetchMeta:t.meta??null};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 i=t.error;return yx(i)&&i.revert&&se(this,Bu)?{...se(this,Bu),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),pr.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),se(this,eo).notify({query:this,type:"updated",action:t})})},jk);function xN(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:mN(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function BK(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,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 Uo,$k,wN=($k=class extends hp{constructor(t={}){super();Ze(this,Uo);this.config=t,je(this,Uo,new Map)}build(t,n,r){const i=n.queryKey,o=n.queryHash??q_(i,n);let s=this.get(o);return s||(s=new zK({cache:this,queryKey:i,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(s)),s}add(t){se(this,Uo).has(t.queryHash)||(se(this,Uo).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=se(this,Uo).get(t.queryHash);n&&(t.destroy(),n===t&&se(this,Uo).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){pr.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return se(this,Uo).get(t)}getAll(){return[...se(this,Uo).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>cM(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>cM(t,r)):n}notify(t){pr.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){pr.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){pr.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Uo=new WeakMap,$k),Go,Br,Gl,qo,wa,zk,HK=(zk=class extends vN{constructor(t){super();Ze(this,qo);Ze(this,Go);Ze(this,Br);Ze(this,Gl);this.mutationId=t.mutationId,je(this,Br,t.mutationCache),je(this,Go,[]),this.state=t.state||VK(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){se(this,Go).includes(t)||(se(this,Go).push(t),this.clearGcTimeout(),se(this,Br).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){je(this,Go,se(this,Go).filter(n=>n!==t)),this.scheduleGc(),se(this,Br).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){se(this,Go).length||(this.state.status==="pending"?this.scheduleGc():se(this,Br).remove(this))}continue(){var t;return((t=se(this,Gl))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,s,a,l,c,u,d,p,h,m,b,y,x,S,_,C,R,M,D;je(this,Gl,yN({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(A,I)=>{Nt(this,qo,wa).call(this,{type:"failed",failureCount:A,error:I})},onPause:()=>{Nt(this,qo,wa).call(this,{type:"pause"})},onContinue:()=>{Nt(this,qo,wa).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>se(this,Br).canRun(this)}));const n=this.state.status==="pending",r=!se(this,Gl).canStart();try{if(!n){Nt(this,qo,wa).call(this,{type:"pending",variables:t,isPaused:r}),await((o=(i=se(this,Br).config).onMutate)==null?void 0:o.call(i,t,this));const I=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));I!==this.state.context&&Nt(this,qo,wa).call(this,{type:"pending",context:I,variables:t,isPaused:r})}const A=await se(this,Gl).start();return await((c=(l=se(this,Br).config).onSuccess)==null?void 0:c.call(l,A,t,this.state.context,this)),await((d=(u=this.options).onSuccess)==null?void 0:d.call(u,A,t,this.state.context)),await((h=(p=se(this,Br).config).onSettled)==null?void 0:h.call(p,A,null,this.state.variables,this.state.context,this)),await((b=(m=this.options).onSettled)==null?void 0:b.call(m,A,null,t,this.state.context)),Nt(this,qo,wa).call(this,{type:"success",data:A}),A}catch(A){try{throw await((x=(y=se(this,Br).config).onError)==null?void 0:x.call(y,A,t,this.state.context,this)),await((_=(S=this.options).onError)==null?void 0:_.call(S,A,t,this.state.context)),await((R=(C=se(this,Br).config).onSettled)==null?void 0:R.call(C,void 0,A,this.state.variables,this.state.context,this)),await((D=(M=this.options).onSettled)==null?void 0:D.call(M,void 0,A,t,this.state.context)),A}finally{Nt(this,qo,wa).call(this,{type:"error",error:A})}}finally{se(this,Br).runNext(this)}}},Go=new WeakMap,Br=new WeakMap,Gl=new WeakMap,qo=new WeakSet,wa=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:t.isPaused,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),pr.batch(()=>{se(this,Go).forEach(r=>{r.onMutationUpdate(t)}),se(this,Br).notify({mutation:this,type:"updated",action:t})})},zk);function VK(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Bs,_o,cp,Bk,WK=(Bk=class extends hp{constructor(t={}){super();Ze(this,Bs);Ze(this,_o);Ze(this,cp);this.config=t,je(this,Bs,new Set),je(this,_o,new Map),je(this,cp,0)}build(t,n,r){const i=new HK({mutationCache:this,mutationId:++Lg(this,cp)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){se(this,Bs).add(t);const n=$g(t);if(typeof n=="string"){const r=se(this,_o).get(n);r?r.push(t):se(this,_o).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(se(this,Bs).delete(t)){const n=$g(t);if(typeof n=="string"){const r=se(this,_o).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&se(this,_o).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=$g(t);if(typeof n=="string"){const r=se(this,_o).get(n),i=r==null?void 0:r.find(o=>o.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r;const n=$g(t);if(typeof n=="string"){const i=(r=se(this,_o).get(n))==null?void 0:r.find(o=>o!==t&&o.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){pr.batch(()=>{se(this,Bs).forEach(t=>{this.notify({type:"removed",mutation:t})}),se(this,Bs).clear(),se(this,_o).clear()})}getAll(){return Array.from(se(this,Bs))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>uM(n,r))}findAll(t={}){return this.getAll().filter(n=>uM(t,n))}notify(t){pr.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return pr.batch(()=>Promise.all(t.map(n=>n.continue().catch(to))))}},Bs=new WeakMap,_o=new WeakMap,cp=new WeakMap,Bk);function $g(e){var t;return(t=e.options.scope)==null?void 0:t.id}function hM(e){return{onFetch:(t,n)=>{var u,d,p,h,m;const r=t.options,i=(p=(d=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:p.direction,o=((h=t.state.data)==null?void 0:h.pages)||[],s=((m=t.state.data)==null?void 0:m.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let b=!1;const y=_=>{Object.defineProperty(_,"signal",{enumerable:!0,get:()=>(t.signal.aborted?b=!0:t.signal.addEventListener("abort",()=>{b=!0}),t.signal)})},x=gN(t.options,t.fetchOptions),S=async(_,C,R)=>{if(b)return Promise.reject();if(C==null&&_.pages.length)return Promise.resolve(_);const M={queryKey:t.queryKey,pageParam:C,direction:R?"backward":"forward",meta:t.options.meta};y(M);const D=await x(M),{maxPages:A}=t.options,I=R?NK:kK;return{pages:I(_.pages,D,A),pageParams:I(_.pageParams,C,A)}};if(i&&o.length){const _=i==="backward",C=_?UK:pM,R={pages:o,pageParams:s},M=C(r,R);a=await S(R,M,_)}else{const _=e??o.length;do{const C=l===0?s[0]??r.initialPageParam:pM(r,a);if(l>0&&C==null)break;a=await S(a,C),l++}while(l<_)}return a};t.options.persister?t.fetchFn=()=>{var b,y;return(y=(b=t.options).persister)==null?void 0:y.call(b,c,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function pM(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function UK(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Dn,Ta,Ma,Hu,Vu,Oa,Wu,Uu,Hk,GK=(Hk=class{constructor(e={}){Ze(this,Dn);Ze(this,Ta);Ze(this,Ma);Ze(this,Hu);Ze(this,Vu);Ze(this,Oa);Ze(this,Wu);Ze(this,Uu);je(this,Dn,e.queryCache||new wN),je(this,Ta,e.mutationCache||new WK),je(this,Ma,e.defaultOptions||{}),je(this,Hu,new Map),je(this,Vu,new Map),je(this,Oa,0)}mount(){Lg(this,Oa)._++,se(this,Oa)===1&&(je(this,Wu,Y_.subscribe(async e=>{e&&(await this.resumePausedMutations(),se(this,Dn).onFocus())})),je(this,Uu,yb.subscribe(async e=>{e&&(await this.resumePausedMutations(),se(this,Dn).onOnline())})))}unmount(){var e,t;Lg(this,Oa)._--,se(this,Oa)===0&&((e=se(this,Wu))==null||e.call(this),je(this,Wu,void 0),(t=se(this,Uu))==null||t.call(this),je(this,Uu,void 0))}isFetching(e){return se(this,Dn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return se(this,Ta).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=se(this,Dn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=se(this,Dn).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Cu(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return se(this,Dn).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=se(this,Dn).get(r.queryHash),o=i==null?void 0:i.state.data,s=DK(t,o);if(s!==void 0)return se(this,Dn).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return pr.batch(()=>se(this,Dn).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=se(this,Dn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=se(this,Dn);pr.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=se(this,Dn),r={type:"active",...e};return pr.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=pr.batch(()=>se(this,Dn).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(to).catch(to)}invalidateQueries(e,t={}){return pr.batch(()=>{if(se(this,Dn).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none")return Promise.resolve();const n={...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"};return this.refetchQueries(n,t)})}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=pr.batch(()=>se(this,Dn).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(to)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(to)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=se(this,Dn).build(this,t);return n.isStaleByTime(Cu(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(to).catch(to)}fetchInfiniteQuery(e){return e.behavior=hM(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(to).catch(to)}ensureInfiniteQueryData(e){return e.behavior=hM(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return yb.isOnline()?se(this,Ta).resumePausedMutations():Promise.resolve()}getQueryCache(){return se(this,Dn)}getMutationCache(){return se(this,Ta)}getDefaultOptions(){return se(this,Ma)}setDefaultOptions(e){je(this,Ma,e)}setQueryDefaults(e,t){se(this,Hu).set(yh(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...se(this,Hu).values()],n={};return t.forEach(r=>{vh(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){se(this,Vu).set(yh(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...se(this,Vu).values()];let n={};return t.forEach(r=>{vh(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...se(this,Ma).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=q_(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===bb&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...se(this,Ma).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){se(this,Dn).clear(),se(this,Ta).clear()}},Dn=new WeakMap,Ta=new WeakMap,Ma=new WeakMap,Hu=new WeakMap,Vu=new WeakMap,Oa=new WeakMap,Wu=new WeakMap,Uu=new WeakMap,Hk),ci,Lt,up,Hr,ql,Gu,Da,Yo,dp,qu,Yu,Yl,Kl,Aa,Ku,Qt,Df,T1,M1,O1,D1,A1,I1,k1,SN,Vk,qK=(Vk=class extends hp{constructor(t,n){super();Ze(this,Qt);Ze(this,ci);Ze(this,Lt);Ze(this,up);Ze(this,Hr);Ze(this,ql);Ze(this,Gu);Ze(this,Da);Ze(this,Yo);Ze(this,dp);Ze(this,qu);Ze(this,Yu);Ze(this,Yl);Ze(this,Kl);Ze(this,Aa);Ze(this,Ku,new Set);this.options=n,je(this,ci,t),je(this,Yo,null),je(this,Da,P1()),this.options.experimental_prefetchInRender||se(this,Da).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(se(this,Lt).addObserver(this),gM(se(this,Lt),this.options)?Nt(this,Qt,Df).call(this):this.updateResult(),Nt(this,Qt,D1).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return N1(se(this,Lt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return N1(se(this,Lt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Nt(this,Qt,A1).call(this),Nt(this,Qt,I1).call(this),se(this,Lt).removeObserver(this)}setOptions(t,n){const r=this.options,i=se(this,Lt);if(this.options=se(this,ci).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Co(this.options.enabled,se(this,Lt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Nt(this,Qt,k1).call(this),se(this,Lt).setOptions(this.options),r._defaulted&&!C1(this.options,r)&&se(this,ci).getQueryCache().notify({type:"observerOptionsUpdated",query:se(this,Lt),observer:this});const o=this.hasListeners();o&&mM(se(this,Lt),i,this.options,r)&&Nt(this,Qt,Df).call(this),this.updateResult(n),o&&(se(this,Lt)!==i||Co(this.options.enabled,se(this,Lt))!==Co(r.enabled,se(this,Lt))||Cu(this.options.staleTime,se(this,Lt))!==Cu(r.staleTime,se(this,Lt)))&&Nt(this,Qt,T1).call(this);const s=Nt(this,Qt,M1).call(this);o&&(se(this,Lt)!==i||Co(this.options.enabled,se(this,Lt))!==Co(r.enabled,se(this,Lt))||s!==se(this,Aa))&&Nt(this,Qt,O1).call(this,s)}getOptimisticResult(t){const n=se(this,ci).getQueryCache().build(se(this,ci),t),r=this.createResult(n,t);return KK(this,r)&&(je(this,Hr,r),je(this,Gu,this.options),je(this,ql,se(this,Lt).state)),r}getCurrentResult(){return se(this,Hr)}trackResult(t,n){const r={};return Object.keys(t).forEach(i=>{Object.defineProperty(r,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),n==null||n(i),t[i])})}),r}trackProp(t){se(this,Ku).add(t)}getCurrentQuery(){return se(this,Lt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=se(this,ci).defaultQueryOptions(t),r=se(this,ci).getQueryCache().build(se(this,ci),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Nt(this,Qt,Df).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),se(this,Hr)))}createResult(t,n){var A;const r=se(this,Lt),i=this.options,o=se(this,Hr),s=se(this,ql),a=se(this,Gu),c=t!==r?t.state:se(this,up),{state:u}=t;let d={...u},p=!1,h;if(n._optimisticResults){const I=this.hasListeners(),F=!I&&gM(t,n),j=I&&mM(t,r,n,i);(F||j)&&(d={...d,...xN(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:m,errorUpdatedAt:b,status:y}=d;if(n.select&&d.data!==void 0)if(o&&d.data===(s==null?void 0:s.data)&&n.select===se(this,dp))h=se(this,qu);else try{je(this,dp,n.select),h=n.select(d.data),h=R1(o==null?void 0:o.data,h,n),je(this,qu,h),je(this,Yo,null)}catch(I){je(this,Yo,I)}else h=d.data;if(n.placeholderData!==void 0&&h===void 0&&y==="pending"){let I;if(o!=null&&o.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))I=o.data;else if(I=typeof n.placeholderData=="function"?n.placeholderData((A=se(this,Yu))==null?void 0:A.state.data,se(this,Yu)):n.placeholderData,n.select&&I!==void 0)try{I=n.select(I),je(this,Yo,null)}catch(F){je(this,Yo,F)}I!==void 0&&(y="success",h=R1(o==null?void 0:o.data,I,n),p=!0)}se(this,Yo)&&(m=se(this,Yo),h=se(this,qu),b=Date.now(),y="error");const x=d.fetchStatus==="fetching",S=y==="pending",_=y==="error",C=S&&x,R=h!==void 0,D={status:y,fetchStatus:d.fetchStatus,isPending:S,isSuccess:y==="success",isError:_,isInitialLoading:C,isLoading:C,data:h,dataUpdatedAt:d.dataUpdatedAt,error:m,errorUpdatedAt:b,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:x,isRefetching:x&&!S,isLoadingError:_&&!R,isPaused:d.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:_&&R,isStale:K_(t,n),refetch:this.refetch,promise:se(this,Da)};if(this.options.experimental_prefetchInRender){const I=$=>{D.status==="error"?$.reject(D.error):D.data!==void 0&&$.resolve(D.data)},F=()=>{const $=je(this,Da,D.promise=P1());I($)},j=se(this,Da);switch(j.status){case"pending":t.queryHash===r.queryHash&&I(j);break;case"fulfilled":(D.status==="error"||D.data!==j.value)&&F();break;case"rejected":(D.status!=="error"||D.error!==j.reason)&&F();break}}return D}updateResult(t){const n=se(this,Hr),r=this.createResult(se(this,Lt),this.options);if(je(this,ql,se(this,Lt).state),je(this,Gu,this.options),se(this,ql).data!==void 0&&je(this,Yu,se(this,Lt)),C1(r,n))return;je(this,Hr,r);const i={},o=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!se(this,Ku).size)return!0;const l=new Set(a??se(this,Ku));return this.options.throwOnError&&l.add("error"),Object.keys(se(this,Hr)).some(c=>{const u=c;return se(this,Hr)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&o()&&(i.listeners=!0),Nt(this,Qt,SN).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Nt(this,Qt,D1).call(this)}},ci=new WeakMap,Lt=new WeakMap,up=new WeakMap,Hr=new WeakMap,ql=new WeakMap,Gu=new WeakMap,Da=new WeakMap,Yo=new WeakMap,dp=new WeakMap,qu=new WeakMap,Yu=new WeakMap,Yl=new WeakMap,Kl=new WeakMap,Aa=new WeakMap,Ku=new WeakMap,Qt=new WeakSet,Df=function(t){Nt(this,Qt,k1).call(this);let n=se(this,Lt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(to)),n},T1=function(){Nt(this,Qt,A1).call(this);const t=Cu(this.options.staleTime,se(this,Lt));if(hc||se(this,Hr).isStale||!S1(t))return;const r=pN(se(this,Hr).dataUpdatedAt,t)+1;je(this,Yl,setTimeout(()=>{se(this,Hr).isStale||this.updateResult()},r))},M1=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(se(this,Lt)):this.options.refetchInterval)??!1},O1=function(t){Nt(this,Qt,I1).call(this),je(this,Aa,t),!(hc||Co(this.options.enabled,se(this,Lt))===!1||!S1(se(this,Aa))||se(this,Aa)===0)&&je(this,Kl,setInterval(()=>{(this.options.refetchIntervalInBackground||Y_.isFocused())&&Nt(this,Qt,Df).call(this)},se(this,Aa)))},D1=function(){Nt(this,Qt,T1).call(this),Nt(this,Qt,O1).call(this,Nt(this,Qt,M1).call(this))},A1=function(){se(this,Yl)&&(clearTimeout(se(this,Yl)),je(this,Yl,void 0))},I1=function(){se(this,Kl)&&(clearInterval(se(this,Kl)),je(this,Kl,void 0))},k1=function(){const t=se(this,ci).getQueryCache().build(se(this,ci),this.options);if(t===se(this,Lt))return;const n=se(this,Lt);je(this,Lt,t),je(this,up,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},SN=function(t){pr.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(se(this,Hr))}),se(this,ci).getQueryCache().notify({query:se(this,Lt),type:"observerResultsUpdated"})})},Vk);function YK(e,t){return Co(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function gM(e,t){return YK(e,t)||e.state.data!==void 0&&N1(e,t,t.refetchOnMount)}function N1(e,t,n){if(Co(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&K_(e,t)}return!1}function mM(e,t,n,r){return(e!==t||Co(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&K_(e,n)}function K_(e,t){return Co(t.enabled,e)!==!1&&e.isStaleByTime(Cu(t.staleTime,e))}function KK(e,t){return!C1(e.getCurrentResult(),t)}var _N=E.createContext(void 0),X_=e=>{const t=E.useContext(_N);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},XK=({client:e,children:t})=>(E.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),v.jsx(_N.Provider,{value:e,children:t})),CN=E.createContext(!1),QK=()=>E.useContext(CN);CN.Provider;function JK(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var ZK=E.createContext(JK()),eX=()=>E.useContext(ZK);function tX(e,t){return typeof e=="function"?e(...t):!!e}function bM(){}var nX=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},rX=e=>{E.useEffect(()=>{e.clearReset()},[e])},iX=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&tX(n,[e.error,r]),oX=e=>{const t=e.staleTime;e.suspense&&(e.staleTime=typeof t=="function"?(...n)=>Math.max(t(...n),1e3):Math.max(t??1e3,1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},sX=(e,t)=>e.isLoading&&e.isFetching&&!t,aX=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,yM=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function lX(e,t,n){var d,p,h,m,b;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=X_(),i=QK(),o=eX(),s=r.defaultQueryOptions(e);(p=(d=r.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||p.call(d,s),s._optimisticResults=i?"isRestoring":"optimistic",oX(s),nX(s,o),rX(o);const a=!r.getQueryCache().get(s.queryHash),[l]=E.useState(()=>new t(r,s)),c=l.getOptimisticResult(s),u=!i&&e.subscribed!==!1;if(E.useSyncExternalStore(E.useCallback(y=>{const x=u?l.subscribe(pr.batchCalls(y)):bM;return l.updateResult(),x},[l,u]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),E.useEffect(()=>{l.setOptions(s,{listeners:!1})},[s,l]),aX(s,c))throw yM(s,l,o);if(iX({result:c,errorResetBoundary:o,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw c.error;if((m=(h=r.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||m.call(h,s,c),s.experimental_prefetchInRender&&!hc&&sX(c,i)){const y=a?yM(s,l,o):(b=r.getQueryCache().get(s.queryHash))==null?void 0:b.promise;y==null||y.catch(bM).finally(()=>{l.updateResult()})}return s.notifyOnChangeProps?c:l.trackResult(c)}function pp(e,t){return lX(e,qK)}function EN({children:e}){const{setIsSessionExpired:t}=gr(),n=new GK({queryCache:new wN({onError:r=>{console.error(`Something went wrong: ${r.message}`),r.message==="invalid token"&&t(!0)}}),defaultOptions:{queries:{gcTime:1e3*60*10,staleTime:1e3*60*5,refetchOnWindowFocus:!1,retry:1}}});return v.jsx(XK,{client:n,children:e})}const Tc=P.forwardRef(({children:e,className:t,...n},r)=>v.jsx("div",{className:be("semaphor-scope",t),ref:r,...n,children:e})),cX={id:"",authToken:void 0},RN=P.createContext(cX),PN=({children:e,dashboardProps:t})=>v.jsx(EN,{children:v.jsx(RN.Provider,{value:t,children:v.jsx(Tc,{style:{height:"100%"},children:e})})});function Hi(){const e=P.useContext(RN);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}function uX(){const{authToken:e,version:t}=Hi(),n=ye(a=>a.selectedLensId),{data:r,isLoading:i,isFetching:o,isError:s}=pp({queryKey:["dashboard",n,e==null?void 0:e.accessToken],queryFn:()=>qY(e==null?void 0:e.accessToken,{lensId:n,version:t})});return{data:r,isLoading:i,isFetching:o,isError:s}}function TN(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function vM(e,t){const n=TN(e);return n==="dark"?Xl.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function dX({customStyle:e,currentTheme:t,onSave:n,onEvent:r,defaultFilterValues:i,onFilterValuesChange:o}){const{authToken:s}=Hi(),a=ye(L=>L.selectedLensId),{data:l,isLoading:c,isFetching:u,isError:d}=uX(),[p,h]=P.useState(i||[]),{theme:m,setTheme:b}=hN(),y=ye(L=>L.dashboard.globalStyle),{setDashboard:x,setDashboardWithFilterValues:S,setSelectedSheetId:_,setStyle:C,setOnSaveFunction:R,setLenses:M,setSelectedLensId:D,setInitStore:A}=ye(L=>L.actions);ye(L=>L.actions.setCustomCards);const I=ye(L=>L.actions.setFilterValues),F=ye(L=>L.filterValues),j=ye(L=>L.actions.setThemeStyle),$=ye(L=>L.actions.setDashboardTheme),K=ye(L=>L.actions.setOnEvent);P.useEffect(()=>{s&&A()},[s,A]),P.useEffect(()=>{if(m){const L=TN(m);$(L)}},[m,$]),P.useEffect(()=>{t&&b(t)},[t,b]);const H=P.useCallback(()=>{const L=Xl.cloneDeep(gb),W=Xl.merge(L,y);if(e){const B=Xl.merge(W,e),U=vM(m,B);j(U),C(B)}else{const B=vM(m,W);j(B),C(gb)}},[m,e,y,j,C]);return P.useEffect(()=>{l&&l.dashboard&&H()},[m,e,y,H,l]),P.useEffect(()=>{var Q,G;function L(O,ee){const q=O.filters||[],oe=[];for(const J of ee){const Z=q.find(ae=>ae.id===J.filterId);Z&&oe.push({filterId:J.filterId,connectionType:Z.database==="NA"?"api":"database",name:Z.column,operation:Z.operation,valueType:_u(Z),values:J.values})}return oe}if(!l||!l.dashboard)return;const{dashboard:W,filterValues:B,defaultLensId:U,lenses:Y}=l,k=L(W,p||[]);S(W,((B==null?void 0:B.length)===0?k:B)||[]),U&&D(U),Y&&M(Y),_(((G=(Q=W==null?void 0:W.sheets)==null?void 0:Q[0])==null?void 0:G.id)||null)},[l,x,_,I,a,M,S,D,p]),P.useEffect(()=>{o&&F&&o(F)},[F,o]),P.useEffect(()=>{n&&R(n),r&&K(r)},[n,R,r,K]),{isFetching:u,isLoading:c,isError:d}}function Eu({className:e,...t}){return v.jsx("div",{className:be("animate-pulse rounded-md bg-muted",e),...t})}const MN=E.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:be("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));MN.displayName="Card";const Ry=E.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:be("flex flex-col space-y-1.5 p-6",e),...t}));Ry.displayName="CardHeader";const Sd=E.forwardRef(({className:e,...t},n)=>v.jsx("h3",{ref:n,className:be("text-2xl font-semibold leading-none tracking-tight",e),...t}));Sd.displayName="CardTitle";const Q_=E.forwardRef(({className:e,...t},n)=>v.jsx("p",{ref:n,className:be("text-sm text-muted-foreground",e),...t}));Q_.displayName="CardDescription";const Py=E.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:be("px-6 pt-0",e),...t}));Py.displayName="CardContent";const ON=E.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:be("flex items-center p-6 pt-0",e),...t}));ON.displayName="CardFooter";function DN({className:e,customStyle:t,onSave:n,onEvent:r,LoadingComponent:i,ErrorComponent:o,onChartElementClicked:s,id:a,authToken:l,currentTheme:c,version:u,customCards:d,showAssistant:p,defaultFilterValues:h,onFilterValuesChange:m,...b}){ye(R=>R.selectedSheetId);const y=ye(R=>R.themeStyle),x=ye(R=>R.isSessionExpired),{isLoading:S,isError:_,isFetching:C}=dX({authToken:l,customStyle:t,currentTheme:c,onSave:n,onEvent:r,defaultFilterValues:h,onFilterValuesChange:m});return S||!l?(r==null||r({type:"info",message:"Loading dashboard"}),i?v.jsx(i,{message:"loading"}):v.jsx("div",{className:"flex items-center gap-3",children:v.jsx(Eu,{className:"h-1 w-full dark:h-[2px]"})})):_?(r==null||r({type:"error",message:"Error fetching dashboard"}),o?(console.log("Error fetching dashboard"),v.jsx(o,{})):v.jsx("div",{children:"Error"})):x?(r==null||r({type:"error",message:"Session Expired"}),v.jsx("div",{className:"flex h-full items-center justify-center",children:v.jsxs("div",{className:"space-y-4 rounded-md border border-muted p-10",children:[v.jsx(Sd,{children:"Session Expired"}),v.jsx("p",{className:"text-muted-foreground",children:"Please refresh your page to continue."})]})})):v.jsx("div",{className:be("flex h-full flex-col justify-between",y==null?void 0:y.dashboardPanel,e),style:{},role:"dashboard-panel",...b})}function Re(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function fX(e,t){const n=E.createContext(t),r=o=>{const{children:s,...a}=o,l=E.useMemo(()=>a,Object.values(a));return v.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function i(o){const s=E.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function er(e,t=[]){let n=[];function r(o,s){const a=E.createContext(s),l=n.length;n=[...n,s];const c=d=>{var x;const{scope:p,children:h,...m}=d,b=((x=p==null?void 0:p[e])==null?void 0:x[l])||a,y=E.useMemo(()=>m,Object.values(m));return v.jsx(b.Provider,{value:y,children:h})};c.displayName=o+"Provider";function u(d,p){var b;const h=((b=p==null?void 0:p[e])==null?void 0:b[l])||a,m=E.useContext(h);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${o}\``)}return[c,u]}const i=()=>{const o=n.map(s=>E.createContext(s));return function(a){const l=(a==null?void 0:a[e])||o;return E.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,hX(i,...t)]}function hX(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(o)[`__scope${c}`];return{...a,...d}},{});return E.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function xM(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ty(...e){return t=>{let n=!1;const r=e.map(i=>{const o=xM(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():xM(e[i],null)}}}}function rt(...e){return E.useCallback(Ty(...e),e)}var Js=E.forwardRef((e,t)=>{const{children:n,...r}=e,i=E.Children.toArray(n),o=i.find(pX);if(o){const s=o.props.children,a=i.map(l=>l===o?E.Children.count(s)>1?E.Children.only(null):E.isValidElement(s)?s.props.children:null:l);return v.jsx(L1,{...r,ref:t,children:E.isValidElement(s)?E.cloneElement(s,void 0,a):null})}return v.jsx(L1,{...r,ref:t,children:n})});Js.displayName="Slot";var L1=E.forwardRef((e,t)=>{const{children:n,...r}=e;if(E.isValidElement(n)){const i=mX(n);return E.cloneElement(n,{...gX(r,n.props),ref:t?Ty(t,i):i})}return E.Children.count(n)>1?E.Children.only(null):null});L1.displayName="SlotClone";var J_=({children:e})=>v.jsx(v.Fragment,{children:e});function pX(e){return E.isValidElement(e)&&e.type===J_}function gX(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{o(...a),i(...a)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function mX(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function My(e){const t=e+"CollectionProvider",[n,r]=er(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=h=>{const{scope:m,children:b}=h,y=P.useRef(null),x=P.useRef(new Map).current;return v.jsx(i,{scope:m,itemMap:x,collectionRef:y,children:b})};s.displayName=t;const a=e+"CollectionSlot",l=P.forwardRef((h,m)=>{const{scope:b,children:y}=h,x=o(a,b),S=rt(m,x.collectionRef);return v.jsx(Js,{ref:S,children:y})});l.displayName=a;const c=e+"CollectionItemSlot",u="data-radix-collection-item",d=P.forwardRef((h,m)=>{const{scope:b,children:y,...x}=h,S=P.useRef(null),_=rt(m,S),C=o(c,b);return P.useEffect(()=>(C.itemMap.set(S,{ref:S,...x}),()=>void C.itemMap.delete(S))),v.jsx(Js,{[u]:"",ref:_,children:y})});d.displayName=c;function p(h){const m=o(e+"CollectionConsumer",h);return P.useCallback(()=>{const y=m.collectionRef.current;if(!y)return[];const x=Array.from(y.querySelectorAll(`[${u}]`));return Array.from(m.itemMap.values()).sort((C,R)=>x.indexOf(C.ref.current)-x.indexOf(R.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:s,Slot:l,ItemSlot:d},p,r]}var mr=globalThis!=null&&globalThis.document?E.useLayoutEffect:()=>{},bX=E.useId||(()=>{}),yX=0;function Gn(e){const[t,n]=E.useState(bX());return mr(()=>{e||n(r=>r??String(yX++))},[e]),e||(t?`radix-${t}`:"")}var vX=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ne=vX.reduce((e,t)=>{const n=E.forwardRef((r,i)=>{const{asChild:o,...s}=r,a=o?Js:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(a,{...s,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function AN(e,t){e&&uc.flushSync(()=>e.dispatchEvent(t))}function Zn(e){const t=E.useRef(e);return E.useEffect(()=>{t.current=e}),E.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Ar({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=xX({defaultProp:t,onChange:n}),o=e!==void 0,s=o?e:r,a=Zn(n),l=E.useCallback(c=>{if(o){const d=typeof c=="function"?c(e):c;d!==e&&a(d)}else i(c)},[o,e,i,a]);return[s,l]}function xX({defaultProp:e,onChange:t}){const n=E.useState(e),[r]=n,i=E.useRef(r),o=Zn(t);return E.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}var wX=E.createContext(void 0);function Mc(e){const t=E.useContext(wX);return e||t||"ltr"}var vx="rovingFocusGroup.onEntryFocus",SX={bubbles:!1,cancelable:!0},Oy="RovingFocusGroup",[F1,IN,_X]=My(Oy),[CX,_d]=er(Oy,[_X]),[EX,RX]=CX(Oy),kN=E.forwardRef((e,t)=>v.jsx(F1.Provider,{scope:e.__scopeRovingFocusGroup,children:v.jsx(F1.Slot,{scope:e.__scopeRovingFocusGroup,children:v.jsx(PX,{...e,ref:t})})}));kN.displayName=Oy;var PX=E.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=e,p=E.useRef(null),h=rt(t,p),m=Mc(o),[b=null,y]=Ar({prop:s,defaultProp:a,onChange:l}),[x,S]=E.useState(!1),_=Zn(c),C=IN(n),R=E.useRef(!1),[M,D]=E.useState(0);return E.useEffect(()=>{const A=p.current;if(A)return A.addEventListener(vx,_),()=>A.removeEventListener(vx,_)},[_]),v.jsx(EX,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:b,onItemFocus:E.useCallback(A=>y(A),[y]),onItemShiftTab:E.useCallback(()=>S(!0),[]),onFocusableItemAdd:E.useCallback(()=>D(A=>A+1),[]),onFocusableItemRemove:E.useCallback(()=>D(A=>A-1),[]),children:v.jsx(Ne.div,{tabIndex:x||M===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:"none",...e.style},onMouseDown:Re(e.onMouseDown,()=>{R.current=!0}),onFocus:Re(e.onFocus,A=>{const I=!R.current;if(A.target===A.currentTarget&&I&&!x){const F=new CustomEvent(vx,SX);if(A.currentTarget.dispatchEvent(F),!F.defaultPrevented){const j=C().filter(W=>W.focusable),$=j.find(W=>W.active),K=j.find(W=>W.id===b),L=[$,K,...j].filter(Boolean).map(W=>W.ref.current);FN(L,u)}}R.current=!1}),onBlur:Re(e.onBlur,()=>S(!1))})})}),NN="RovingFocusGroupItem",LN=E.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,...s}=e,a=Gn(),l=o||a,c=RX(NN,n),u=c.currentTabStopId===l,d=IN(n),{onFocusableItemAdd:p,onFocusableItemRemove:h}=c;return E.useEffect(()=>{if(r)return p(),()=>h()},[r,p,h]),v.jsx(F1.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:v.jsx(Ne.span,{tabIndex:u?0:-1,"data-orientation":c.orientation,...s,ref:t,onMouseDown:Re(e.onMouseDown,m=>{r?c.onItemFocus(l):m.preventDefault()}),onFocus:Re(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:Re(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){c.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const b=OX(m,c.orientation,c.dir);if(b!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let x=d().filter(S=>S.focusable).map(S=>S.ref.current);if(b==="last")x.reverse();else if(b==="prev"||b==="next"){b==="prev"&&x.reverse();const S=x.indexOf(m.currentTarget);x=c.loop?DX(x,S+1):x.slice(S+1)}setTimeout(()=>FN(x))}})})})});LN.displayName=NN;var TX={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function MX(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function OX(e,t,n){const r=MX(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return TX[r]}function FN(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function DX(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Z_=kN,eC=LN;function AX(e,t){return E.useReducer((n,r)=>t[n][r]??n,e)}var qn=e=>{const{present:t,children:n}=e,r=IX(t),i=typeof n=="function"?n({present:r.isPresent}):E.Children.only(n),o=rt(r.ref,kX(i));return typeof n=="function"||r.isPresent?E.cloneElement(i,{ref:o}):null};qn.displayName="Presence";function IX(e){const[t,n]=E.useState(),r=E.useRef({}),i=E.useRef(e),o=E.useRef("none"),s=e?"mounted":"unmounted",[a,l]=AX(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return E.useEffect(()=>{const c=zg(r.current);o.current=a==="mounted"?c:"none"},[a]),mr(()=>{const c=r.current,u=i.current;if(u!==e){const p=o.current,h=zg(c);e?l("MOUNT"):h==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&p!==h?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),mr(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,d=h=>{const b=zg(r.current).includes(h.animationName);if(h.target===t&&b&&(l("ANIMATION_END"),!i.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},p=h=>{h.target===t&&(o.current=zg(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:E.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function zg(e){return(e==null?void 0:e.animationName)||"none"}function kX(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var tC="Tabs",[NX,CTe]=er(tC,[_d]),jN=_d(),[LX,nC]=NX(tC),$N=E.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=Mc(a),[d,p]=Ar({prop:r,onChange:i,defaultProp:o});return v.jsx(LX,{scope:n,baseId:Gn(),value:d,onValueChange:p,orientation:s,dir:u,activationMode:l,children:v.jsx(Ne.div,{dir:u,"data-orientation":s,...c,ref:t})})});$N.displayName=tC;var zN="TabsList",BN=E.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=nC(zN,n),s=jN(n);return v.jsx(Z_,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:r,children:v.jsx(Ne.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});BN.displayName=zN;var HN="TabsTrigger",VN=E.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,s=nC(HN,n),a=jN(n),l=GN(s.baseId,r),c=qN(s.baseId,r),u=r===s.value;return v.jsx(eC,{asChild:!0,...a,focusable:!i,active:u,children:v.jsx(Ne.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:l,...o,ref:t,onMouseDown:Re(e.onMouseDown,d=>{!i&&d.button===0&&d.ctrlKey===!1?s.onValueChange(r):d.preventDefault()}),onKeyDown:Re(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&s.onValueChange(r)}),onFocus:Re(e.onFocus,()=>{const d=s.activationMode!=="manual";!u&&!i&&d&&s.onValueChange(r)})})})});VN.displayName=HN;var WN="TabsContent",UN=E.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...s}=e,a=nC(WN,n),l=GN(a.baseId,r),c=qN(a.baseId,r),u=r===a.value,d=E.useRef(u);return E.useEffect(()=>{const p=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(p)},[]),v.jsx(qn,{present:i||u,children:({present:p})=>v.jsx(Ne.div,{"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!p,id:c,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:p&&o})})});UN.displayName=WN;function GN(e,t){return`${e}-trigger-${t}`}function qN(e,t){return`${e}-content-${t}`}var FX=$N,YN=BN,KN=VN,XN=UN;const rC=FX,Dy=E.forwardRef(({className:e,...t},n)=>v.jsx(YN,{ref:n,className:be("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Dy.displayName=YN.displayName;const Ay=E.forwardRef(({className:e,...t},n)=>v.jsx(KN,{ref:n,className:be("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}));Ay.displayName=KN.displayName;const iC=E.forwardRef(({className:e,...t},n)=>v.jsx(XN,{ref:n,className:be("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));iC.displayName=XN.displayName;var QN={exports:{}},gp={},j1={exports:{}};(function(e,t){(function(n,r){r(t)})(Ca,function(n){function r(Z){return function(ce,ge,ie,pe,de,Ee,De){return Z(ce,ge,De)}}function i(Z){return function(ce,ge,ie,pe){if(!ce||!ge||typeof ce!="object"||typeof ge!="object")return Z(ce,ge,ie,pe);var de=pe.get(ce),Ee=pe.get(ge);if(de&&Ee)return de===ge&&Ee===ce;pe.set(ce,ge),pe.set(ge,ce);var De=Z(ce,ge,ie,pe);return pe.delete(ce),pe.delete(ge),De}}function o(Z,ae){var ce={};for(var ge in Z)ce[ge]=Z[ge];for(var ge in ae)ce[ge]=ae[ge];return ce}function s(Z){return Z.constructor===Object||Z.constructor==null}function a(Z){return typeof Z.then=="function"}function l(Z,ae){return Z===ae||Z!==Z&&ae!==ae}var c="[object Arguments]",u="[object Boolean]",d="[object Date]",p="[object RegExp]",h="[object Map]",m="[object Number]",b="[object Object]",y="[object Set]",x="[object String]",S=Object.prototype.toString;function _(Z){var ae=Z.areArraysEqual,ce=Z.areDatesEqual,ge=Z.areMapsEqual,ie=Z.areObjectsEqual,pe=Z.areRegExpsEqual,de=Z.areSetsEqual,Ee=Z.createIsNestedEqual,De=Ee($e);function $e(Te,ze,yt){if(Te===ze)return!0;if(!Te||!ze||typeof Te!="object"||typeof ze!="object")return Te!==Te&&ze!==ze;if(s(Te)&&s(ze))return ie(Te,ze,De,yt);var Mt=Array.isArray(Te),gn=Array.isArray(ze);if(Mt||gn)return Mt===gn&&ae(Te,ze,De,yt);var Ot=S.call(Te);return Ot!==S.call(ze)?!1:Ot===d?ce(Te,ze,De,yt):Ot===p?pe(Te,ze,De,yt):Ot===h?ge(Te,ze,De,yt):Ot===y?de(Te,ze,De,yt):Ot===b||Ot===c?a(Te)||a(ze)?!1:ie(Te,ze,De,yt):Ot===u||Ot===m||Ot===x?l(Te.valueOf(),ze.valueOf()):!1}return $e}function C(Z,ae,ce,ge){var ie=Z.length;if(ae.length!==ie)return!1;for(;ie-- >0;)if(!ce(Z[ie],ae[ie],ie,ie,Z,ae,ge))return!1;return!0}var R=i(C);function M(Z,ae){return l(Z.valueOf(),ae.valueOf())}function D(Z,ae,ce,ge){var ie=Z.size===ae.size;if(!ie)return!1;if(!Z.size)return!0;var pe={},de=0;return Z.forEach(function(Ee,De){if(ie){var $e=!1,Te=0;ae.forEach(function(ze,yt){!$e&&!pe[Te]&&($e=ce(De,yt,de,Te,Z,ae,ge)&&ce(Ee,ze,De,yt,Z,ae,ge))&&(pe[Te]=!0),Te++}),de++,ie=$e}}),ie}var A=i(D),I="_owner",F=Object.prototype.hasOwnProperty;function j(Z,ae,ce,ge){var ie=Object.keys(Z),pe=ie.length;if(Object.keys(ae).length!==pe)return!1;for(var de;pe-- >0;){if(de=ie[pe],de===I){var Ee=!!Z.$$typeof,De=!!ae.$$typeof;if((Ee||De)&&Ee!==De)return!1}if(!F.call(ae,de)||!ce(Z[de],ae[de],de,de,Z,ae,ge))return!1}return!0}var $=i(j);function K(Z,ae){return Z.source===ae.source&&Z.flags===ae.flags}function H(Z,ae,ce,ge){var ie=Z.size===ae.size;if(!ie)return!1;if(!Z.size)return!0;var pe={};return Z.forEach(function(de,Ee){if(ie){var De=!1,$e=0;ae.forEach(function(Te,ze){!De&&!pe[$e]&&(De=ce(de,Te,Ee,ze,Z,ae,ge))&&(pe[$e]=!0),$e++}),ie=De}}),ie}var L=i(H),W=Object.freeze({areArraysEqual:C,areDatesEqual:M,areMapsEqual:D,areObjectsEqual:j,areRegExpsEqual:K,areSetsEqual:H,createIsNestedEqual:r}),B=Object.freeze({areArraysEqual:R,areDatesEqual:M,areMapsEqual:A,areObjectsEqual:$,areRegExpsEqual:K,areSetsEqual:L,createIsNestedEqual:r}),U=_(W);function Y(Z,ae){return U(Z,ae,void 0)}var k=_(o(W,{createIsNestedEqual:function(){return l}}));function Q(Z,ae){return k(Z,ae,void 0)}var G=_(B);function O(Z,ae){return G(Z,ae,new WeakMap)}var ee=_(o(B,{createIsNestedEqual:function(){return l}}));function q(Z,ae){return ee(Z,ae,new WeakMap)}function oe(Z){return _(o(W,Z(W)))}function J(Z){var ae=_(o(B,Z(B)));return function(ce,ge,ie){return ie===void 0&&(ie=new WeakMap),ae(ce,ge,ie)}}n.circularDeepEqual=O,n.circularShallowEqual=q,n.createCustomCircularEqual=J,n.createCustomEqual=oe,n.deepEqual=Y,n.sameValueZeroEqual=l,n.shallowEqual=Q,Object.defineProperty(n,"__esModule",{value:!0})})})(j1,j1.exports);var oC=j1.exports;const sC=L_(iY);var Ct={},jX=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(Ct,"__esModule",{value:!0});Ct.bottom=aC;Ct.childrenEqual=HX;Ct.cloneLayout=JN;Ct.cloneLayoutItem=Ql;Ct.collides=Iy;Ct.compact=e5;Ct.compactItem=t5;Ct.compactType=tQ;Ct.correctBounds=n5;Ct.fastPositionEqual=VX;Ct.fastRGLPropsEqual=void 0;Ct.getAllCollisions=r5;Ct.getFirstCollision=Ll;Ct.getLayoutItem=lC;Ct.getStatics=cC;Ct.modifyLayout=ZN;Ct.moveElement=If;Ct.moveElementAwayFromCollision=z1;Ct.noop=void 0;Ct.perc=UX;Ct.resizeItemInDirection=QX;Ct.setTopLeft=ZX;Ct.setTransform=JX;Ct.sortLayoutItems=gC;Ct.sortLayoutItemsByColRow=l5;Ct.sortLayoutItemsByRowCol=a5;Ct.synchronizeLayoutWithChildren=eQ;Ct.validateLayout=c5;Ct.withLayoutItem=BX;var wM=oC,Af=$X(P);function $X(e){return e&&e.__esModule?e:{default:e}}const zX=process.env.NODE_ENV==="production";function aC(e){let t=0,n;for(let r=0,i=e.length;r<i;r++)n=e[r].y+e[r].h,n>t&&(t=n);return t}function JN(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=Ql(e[n]);return t}function ZN(e,t){const n=Array(e.length);for(let r=0,i=e.length;r<i;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function BX(e,t,n){let r=lC(e,t);return r?(r=n(Ql(r)),e=ZN(e,r),[e,r]):[e,null]}function Ql(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 HX(e,t){return(0,wM.deepEqual)(Af.default.Children.map(e,n=>n==null?void 0:n.key),Af.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,wM.deepEqual)(Af.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),Af.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}Ct.fastRGLPropsEqual=jX;function VX(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function Iy(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 e5(e,t,n,r){const i=cC(e),o=gC(e,t),s=Array(e.length);for(let a=0,l=o.length;a<l;a++){let c=Ql(o[a]);c.static||(c=t5(i,c,t,n,o,r),i.push(c)),s[e.indexOf(o[a])]=c,c.moved=!1}return s}const WX={x:"w",y:"h"};function $1(e,t,n,r){const i=WX[r];t[r]+=1;const o=e.map(s=>s.i).indexOf(t.i);for(let s=o+1;s<e.length;s++){const a=e[s];if(!a.static){if(a.y>t.y+t.h)break;Iy(t,a)&&$1(e,a,n+t[i],r)}}t[r]=n}function t5(e,t,n,r,i,o){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(aC(e),t.y);t.y>0&&!Ll(e,t);)t.y--;else if(a)for(;t.x>0&&!Ll(e,t);)t.x--;let l;for(;(l=Ll(e,t))&&!(n===null&&o);)if(a?$1(i,t,l.x+l.w,"x"):$1(i,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!Ll(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function n5(e,t){const n=cC(e);for(let r=0,i=e.length;r<i;r++){const o=e[r];if(o.x+o.w>t.cols&&(o.x=t.cols-o.w),o.x<0&&(o.x=0,o.w=t.cols),!o.static)n.push(o);else for(;Ll(n,o);)o.y++}return e}function lC(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function Ll(e,t){for(let n=0,r=e.length;n<r;n++)if(Iy(e[n],t))return e[n]}function r5(e,t){return e.filter(n=>Iy(n,t))}function cC(e){return e.filter(t=>t.static)}function If(e,t,n,r,i,o,s,a,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;`${t.i}${String(n)}${String(r)}${t.x}${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 d=gC(e,s);(s==="vertical"&&typeof r=="number"?u>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(d=d.reverse());const h=r5(d,t),m=h.length>0;if(m&&l)return JN(e);if(m&&o)return`${t.i}`,t.x=c,t.y=u,t.moved=!1,e;for(let b=0,y=h.length;b<y;b++){const x=h[b];`${t.i}${t.x}${t.y}${x.i}${x.x}${x.y}`,!x.moved&&(x.static?e=z1(e,x,t,i,s):e=z1(e,t,x,i,s))}return e}function z1(e,t,n,r,i,o){const s=i==="horizontal",a=i==="vertical",l=t.static;if(r){r=!1;const d={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"},p=Ll(e,d),h=p&&p.y+p.h>t.y,m=p&&t.x+t.w>p.x;if(p){if(h&&a)return If(e,n,void 0,t.y+1,r,l,i);if(h&&i==null)return t.y=n.y,n.y=n.y+n.h,e;if(m&&s)return If(e,t,n.x,void 0,r,l,i)}else return`${n.i}${d.x}${d.y}`,If(e,n,s?d.x:void 0,a?d.y:void 0,r,l,i)}const c=s?n.x+1:void 0,u=a?n.y+1:void 0;return c==null&&u==null?e:If(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,i)}function UX(e){return e*100+"%"}const i5=(e,t,n,r)=>e+n>r?t:n,o5=(e,t,n)=>e<0?t:n,s5=e=>Math.max(0,e),uC=e=>Math.max(0,e),dC=(e,t,n)=>{let{left:r,height:i,width:o}=t;const s=e.top-(i-e.height);return{left:r,width:o,height:o5(s,e.height,i),top:uC(s)}},fC=(e,t,n)=>{let{top:r,left:i,height:o,width:s}=t;return{top:r,height:o,width:i5(e.left,e.width,s,n),left:s5(i)}},hC=(e,t,n)=>{let{top:r,height:i,width:o}=t;const s=e.left-(o-e.width);return{height:i,width:s<0?e.width:i5(e.left,e.width,o,n),top:uC(r),left:s5(s)}},pC=(e,t,n)=>{let{top:r,left:i,height:o,width:s}=t;return{width:s,left:i,height:o5(r,e.height,o),top:uC(r)}},GX=function(){return dC(arguments.length<=0?void 0:arguments[0],fC(...arguments))},qX=function(){return dC(arguments.length<=0?void 0:arguments[0],hC(...arguments))},YX=function(){return pC(arguments.length<=0?void 0:arguments[0],fC(...arguments))},KX=function(){return pC(arguments.length<=0?void 0:arguments[0],hC(...arguments))},XX={n:dC,ne:GX,e:fC,se:YX,s:pC,sw:KX,w:hC,nw:qX};function QX(e,t,n,r){const i=XX[e];return i?i(t,{...t,...n},r):n}function JX(e){let{top:t,left:n,width:r,height:i}=e;const o=`translate(${n}px,${t}px)`;return{transform:o,WebkitTransform:o,MozTransform:o,msTransform:o,OTransform:o,width:`${r}px`,height:`${i}px`,position:"absolute"}}function ZX(e){let{top:t,left:n,width:r,height:i}=e;return{top:`${t}px`,left:`${n}px`,width:`${r}px`,height:`${i}px`,position:"absolute"}}function gC(e,t){return t==="horizontal"?l5(e):t==="vertical"?a5(e):e}function a5(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 l5(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 eQ(e,t,n,r,i){e=e||[];const o=[];Af.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=lC(e,String(a.key)),c=a.props["data-grid"];l&&c==null?o.push(Ql(l)):c?(zX||c5([c],"ReactGridLayout.children"),o.push(Ql({...c,i:a.key}))):o.push(Ql({w:1,h:1,x:0,y:aC(o),i:String(a.key)}))});const s=n5(o,{cols:n});return i?s:e5(s,r,n)}function c5(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,i=e.length;r<i;r++){const o=e[r];for(let s=0;s<n.length;s++){const a=n[s],l=o[a];if(typeof l!="number"||Number.isNaN(l))throw new Error(`ReactGridLayout: ${t}[${r}].${a} must be a number! Received: ${l} (${typeof l})`)}if(typeof o.i<"u"&&typeof o.i!="string")throw new Error(`ReactGridLayout: ${t}[${r}].i must be a string! Received: ${o.i} (${typeof o.i})`)}}function tQ(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const nQ=()=>{};Ct.noop=nQ;var hs={};Object.defineProperty(hs,"__esModule",{value:!0});hs.calcGridColWidth=ky;hs.calcGridItemPosition=rQ;hs.calcGridItemWHPx=B1;hs.calcWH=oQ;hs.calcXY=iQ;hs.clamp=Fl;function ky(e){const{margin:t,containerPadding:n,containerWidth:r,cols:i}=e;return(r-t[0]*(i-1)-n[0]*2)/i}function B1(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function rQ(e,t,n,r,i,o){const{margin:s,containerPadding:a,rowHeight:l}=e,c=ky(e),u={};return o&&o.resizing?(u.width=Math.round(o.resizing.width),u.height=Math.round(o.resizing.height)):(u.width=B1(r,c,s[0]),u.height=B1(i,l,s[1])),o&&o.dragging?(u.top=Math.round(o.dragging.top),u.left=Math.round(o.dragging.left)):o&&o.resizing&&typeof o.resizing.top=="number"&&typeof o.resizing.left=="number"?(u.top=Math.round(o.resizing.top),u.left=Math.round(o.resizing.left)):(u.top=Math.round((l+s[1])*n+a[1]),u.left=Math.round((c+s[0])*t+a[0])),u}function iQ(e,t,n,r,i){const{margin:o,containerPadding:s,cols:a,rowHeight:l,maxRows:c}=e,u=ky(e);let d=Math.round((n-s[0])/(u+o[0])),p=Math.round((t-s[1])/(l+o[1]));return d=Fl(d,0,a-r),p=Fl(p,0,c-i),{x:d,y:p}}function oQ(e,t,n,r,i,o){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,u=ky(e);let d=Math.round((t+s[0])/(u+s[0])),p=Math.round((n+s[1])/(c+s[1])),h=Fl(d,0,l-r),m=Fl(p,0,a-i);return["sw","w","nw"].indexOf(o)!==-1&&(h=Fl(d,0,l)),["nw","n","ne"].indexOf(o)!==-1&&(m=Fl(p,0,a)),{w:h,h:m}}function Fl(e,t,n){return Math.max(Math.min(e,n),t)}var Ny={},H1={exports:{}},Bg={exports:{}},Yt={};/** @license React v16.13.1
92
92
  * react-is.production.min.js
93
93
  *
94
94
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -11139,7 +11139,10 @@ function mK({
11139
11139
  defaultLensId: W,
11140
11140
  lenses: q
11141
11141
  } = l, I = N(V, p || []);
11142
- S(V, z || I || []), W && O(W), q && M(q), _(((U = (X = V == null ? void 0 : V.sheets) == null ? void 0 : X[0]) == null ? void 0 : U.id) || null);
11142
+ S(
11143
+ V,
11144
+ ((z == null ? void 0 : z.length) === 0 ? I : z) || []
11145
+ ), W && O(W), q && M(q), _(((U = (X = V == null ? void 0 : V.sheets) == null ? void 0 : X[0]) == null ? void 0 : U.id) || null);
11143
11146
  }, [
11144
11147
  l,
11145
11148
  x,