react-semaphor 0.0.163 → 0.0.164
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{dashboard-plus-7_cFHh41.js → dashboard-plus-7iejGOYa.js} +1 -1
- package/dist/chunks/{dashboard-plus-iyU-0UK5.js → dashboard-plus-CX4nhe39.js} +1 -1
- package/dist/chunks/{index-4anwde0N.js → index-gxZdRnEK.js} +1 -1
- package/dist/chunks/{index-b_6Xe5Fs.js → index-wfFQDxUt.js} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +3 -3
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as X, b as B, j as i, Q as Nt, R as Et, U as V, V as zt, W as At, X as Ot, Y as Tt, Z as pe, _ as ke, $ as ui, J as di, O as cn, a0 as Os, a1 as Ts, a2 as Is, a3 as Fs, a4 as Ls, a5 as Ms, a6 as sr, a7 as gn, a8 as Vn, a9 as Ln, T as Hn, e as It, g as Un, aa as Ft, ab as Lt, f as je, ac as Mt, ad as Dt, ae as Pt, af as Mn, ag as We, G as C, ah as kn, ai as jn, aj as Ds, ak as Cn, w as hi, v as pi, t as Ve, al as Ps, r as Rs, N as fi, s as _s, am as Bs, B as qs, L as $n, S as Rt, z as Vs, n as ar, A as mi, u as Wn, an as Ge, ao as sn, ap as Hs, aq as Us, ar as $s, as as xi, at as gi, au as yi, av as bi, aw as ki, ax as Ws, ay as ji, az as lr, aA as Ks, aB as Ci, aC as Qs, aD as Js, aE as Gs, aF as Xs, aG as ft, aH as Ys, aI as Zs, aJ as Tn, aK as or, aL as ea, aM as na, aN as ta, aO as ra, aP as ia, aQ as tt, aR as sa, aS as cr, aT as aa, aU as ur, aV as la, aW as oa, aX as ca, aY as wi, l as ua, C as da, E as dr, d as ha, h as pa, i as fa, o as ma, aZ as xa, m as ga, a_ as ya, a$ as ba, b0 as ka, b1 as hr, b2 as ja, b3 as pr, b4 as fr, K as Ca, b5 as Si, b6 as wa, b7 as vi, b8 as Dn, b9 as Ni, ba as Sa, bb as va, bc as Na, bd as Ea, be as za, bf as Aa, bg as Ye, bh as ue, bi as de, bj as _t, bk as he, bl as Oa, bm as Ta, bn as Ia, bo as mr, bp as Fa, bq as La, br as Ma, bs as Da, bt as Pa } from "./index-
|
|
1
|
+
import { P as X, b as B, j as i, Q as Nt, R as Et, U as V, V as zt, W as At, X as Ot, Y as Tt, Z as pe, _ as ke, $ as ui, J as di, O as cn, a0 as Os, a1 as Ts, a2 as Is, a3 as Fs, a4 as Ls, a5 as Ms, a6 as sr, a7 as gn, a8 as Vn, a9 as Ln, T as Hn, e as It, g as Un, aa as Ft, ab as Lt, f as je, ac as Mt, ad as Dt, ae as Pt, af as Mn, ag as We, G as C, ah as kn, ai as jn, aj as Ds, ak as Cn, w as hi, v as pi, t as Ve, al as Ps, r as Rs, N as fi, s as _s, am as Bs, B as qs, L as $n, S as Rt, z as Vs, n as ar, A as mi, u as Wn, an as Ge, ao as sn, ap as Hs, aq as Us, ar as $s, as as xi, at as gi, au as yi, av as bi, aw as ki, ax as Ws, ay as ji, az as lr, aA as Ks, aB as Ci, aC as Qs, aD as Js, aE as Gs, aF as Xs, aG as ft, aH as Ys, aI as Zs, aJ as Tn, aK as or, aL as ea, aM as na, aN as ta, aO as ra, aP as ia, aQ as tt, aR as sa, aS as cr, aT as aa, aU as ur, aV as la, aW as oa, aX as ca, aY as wi, l as ua, C as da, E as dr, d as ha, h as pa, i as fa, o as ma, aZ as xa, m as ga, a_ as ya, a$ as ba, b0 as ka, b1 as hr, b2 as ja, b3 as pr, b4 as fr, K as Ca, b5 as Si, b6 as wa, b7 as vi, b8 as Dn, b9 as Ni, ba as Sa, bb as va, bc as Na, bd as Ea, be as za, bf as Aa, bg as Ye, bh as ue, bi as de, bj as _t, bk as he, bl as Oa, bm as Ta, bn as Ia, bo as mr, bp as Fa, bq as La, br as Ma, bs as Da, bt as Pa } from "./index-gxZdRnEK.js";
|
|
2
2
|
import He, { useState as G, useEffect as xe, useMemo as Ra, useRef as yn } from "react";
|
|
3
3
|
/**
|
|
4
4
|
* @license lucide-react v0.379.0 - ISC
|
|
@@ -8289,7 +8289,7 @@ const fa = /* @__PURE__ */ Uh(sl), Gw = ["lg", "md", "sm", "xs", "xxs"], Re = $$
|
|
|
8289
8289
|
selectedCard: null,
|
|
8290
8290
|
showFilters: !1,
|
|
8291
8291
|
//This should be false by default
|
|
8292
|
-
isDashboardEditing: !
|
|
8292
|
+
isDashboardEditing: !1,
|
|
8293
8293
|
// This should be false by defaultdashboard.
|
|
8294
8294
|
isVisualEditing: !1,
|
|
8295
8295
|
// This should be false by defaultdashboard.
|
|
@@ -85,7 +85,7 @@ __p += '`),ht&&(be+=`' +
|
|
|
85
85
|
function print() { __p += __j.call(arguments, '') }
|
|
86
86
|
`:`;
|
|
87
87
|
`)+be+`return __p
|
|
88
|
-
}`;var et=A1(function(){return vt(A,Te+"return "+be).apply(n,N)});if(et.source=be,Wg(et))throw et;return et}function f3(c){return yt(c).toLowerCase()}function h3(c){return yt(c).toUpperCase()}function p3(c,f,v){if(c=yt(c),c&&(v||f===n))return Hx(c);if(!c||!(f=Zn(f)))return c;var S=Hr(c),P=Hr(f),A=Wx(S,P),N=Bx(S,P)+1;return vi(S,A,N).join("")}function g3(c,f,v){if(c=yt(c),c&&(v||f===n))return c.slice(0,qx(c)+1);if(!c||!(f=Zn(f)))return c;var S=Hr(c),P=Bx(S,Hr(f))+1;return vi(S,0,P).join("")}function m3(c,f,v){if(c=yt(c),c&&(v||f===n))return c.replace(ps,"");if(!c||!(f=Zn(f)))return c;var S=Hr(c),P=Wx(S,Hr(f));return vi(S,P).join("")}function v3(c,f){var v=L,S=W;if(Ht(f)){var P="separator"in f?f.separator:P;v="length"in f?Qe(f.length):v,S="omission"in f?Zn(f.omission):S}c=yt(c);var A=c.length;if(Ra(c)){var N=Hr(c);A=N.length}if(v>=A)return c;var z=v-$a(S);if(z<1)return S;var G=N?vi(N,0,z).join(""):c.slice(0,z);if(P===n)return G+S;if(N&&(z+=G.length-z),Bg(P)){if(c.slice(z).search(P)){var he,pe=G;for(P.global||(P=sg(P.source,yt(Ae.exec(P))+"g")),P.lastIndex=0;he=P.exec(pe);)var be=he.index;G=G.slice(0,be===n?z:be)}}else if(c.indexOf(Zn(P),z)!=z){var Re=G.lastIndexOf(P);Re>-1&&(G=G.slice(0,Re))}return G+S}function b3(c){return c=yt(c),c&&To.test(c)?c.replace(wn,GT):c}var y3=Ia(function(c,f,v){return c+(v?" ":"")+f.toUpperCase()}),Gg=Iw("toUpperCase");function T1(c,f,v){return c=yt(c),f=v?n:f,f===n?HT(c)?XT(c):AT(c):c.match(f)||[]}var A1=rt(function(c,f){try{return Xn(c,n,f)}catch(v){return Wg(v)?v:new Ue(v)}}),x3=Lo(function(c,f){return wr(f,function(v){v=so(v),ko(c,v,Vg(c[v],c))}),c});function w3(c){var f=c==null?0:c.length,v=Le();return c=f?jt(c,function(S){if(typeof S[1]!="function")throw new _r(s);return[v(S[0]),S[1]]}):[],rt(function(S){for(var P=-1;++P<f;){var A=c[P];if(Xn(A[0],this,S))return Xn(A[1],this,S)}})}function _3(c){return G5(Cr(c,h))}function Yg(c){return function(){return c}}function S3(c,f){return c==null||c!==c?f:c}var C3=Nw(),E3=Nw(!0);function zn(c){return c}function Kg(c){return fw(typeof c=="function"?c:Cr(c,h))}function R3(c){return pw(Cr(c,h))}function $3(c,f){return gw(c,Cr(f,h))}var P3=rt(function(c,f){return function(v){return ac(v,c,f)}}),O3=rt(function(c,f){return function(v){return ac(c,v,f)}});function Xg(c,f,v){var S=ln(f),P=Pd(f,S);v==null&&!(Ht(f)&&(P.length||!S.length))&&(v=f,f=c,c=this,P=Pd(f,ln(f)));var A=!(Ht(v)&&"chain"in v)||!!v.chain,N=zo(c);return wr(P,function(z){var G=f[z];c[z]=G,N&&(c.prototype[z]=function(){var he=this.__chain__;if(A||he){var pe=c(this.__wrapped__),be=pe.__actions__=Nn(this.__actions__);return be.push({func:G,args:arguments,thisArg:c}),pe.__chain__=he,pe}return G.apply(c,di([this.value()],arguments))})}),c}function D3(){return hn._===this&&(hn._=n5),this}function Qg(){}function M3(c){return c=Qe(c),rt(function(f){return mw(f,c)})}var T3=Pg(jt),A3=Pg(Lx),I3=Pg(Jp);function I1(c){return kg(c)?eg(so(c)):uA(c)}function k3(c){return function(f){return c==null?n:ws(c,f)}}var N3=Fw(),L3=Fw(!0);function Zg(){return[]}function Jg(){return!1}function F3(){return{}}function z3(){return""}function j3(){return!0}function V3(c,f){if(c=Qe(c),c<1||c>Q)return[];var v=V,S=_n(c,V);f=Le(f),c-=V;for(var P=rg(S,f);++v<c;)f(v);return P}function H3(c){return Ye(c)?jt(c,so):Jn(c)?[c]:Nn(e1(yt(c)))}function W3(c){var f=++e5;return yt(c)+f}var B3=Id(function(c,f){return c+f},0),U3=Og("ceil"),q3=Id(function(c,f){return c/f},1),G3=Og("floor");function Y3(c){return c&&c.length?$d(c,zn,pg):n}function K3(c,f){return c&&c.length?$d(c,Le(f,2),pg):n}function X3(c){return jx(c,zn)}function Q3(c,f){return jx(c,Le(f,2))}function Z3(c){return c&&c.length?$d(c,zn,bg):n}function J3(c,f){return c&&c.length?$d(c,Le(f,2),bg):n}var eN=Id(function(c,f){return c*f},1),tN=Og("round"),nN=Id(function(c,f){return c-f},0);function rN(c){return c&&c.length?ng(c,zn):0}function oN(c,f){return c&&c.length?ng(c,Le(f,2)):0}return O.after=Rk,O.ary=d1,O.assign=h7,O.assignIn=E1,O.assignInWith=Gd,O.assignWith=p7,O.at=g7,O.before=f1,O.bind=Vg,O.bindAll=x3,O.bindKey=h1,O.castArray=Fk,O.chain=l1,O.chunk=GA,O.compact=YA,O.concat=KA,O.cond=w3,O.conforms=_3,O.constant=Yg,O.countBy=rk,O.create=m7,O.curry=p1,O.curryRight=g1,O.debounce=m1,O.defaults=v7,O.defaultsDeep=b7,O.defer=$k,O.delay=Pk,O.difference=XA,O.differenceBy=QA,O.differenceWith=ZA,O.drop=JA,O.dropRight=eI,O.dropRightWhile=tI,O.dropWhile=nI,O.fill=rI,O.filter=ik,O.flatMap=lk,O.flatMapDeep=ck,O.flatMapDepth=uk,O.flatten=o1,O.flattenDeep=oI,O.flattenDepth=iI,O.flip=Ok,O.flow=C3,O.flowRight=E3,O.fromPairs=sI,O.functions=E7,O.functionsIn=R7,O.groupBy=dk,O.initial=lI,O.intersection=cI,O.intersectionBy=uI,O.intersectionWith=dI,O.invert=P7,O.invertBy=O7,O.invokeMap=hk,O.iteratee=Kg,O.keyBy=pk,O.keys=ln,O.keysIn=Fn,O.map=Vd,O.mapKeys=M7,O.mapValues=T7,O.matches=R3,O.matchesProperty=$3,O.memoize=Wd,O.merge=A7,O.mergeWith=R1,O.method=P3,O.methodOf=O3,O.mixin=Xg,O.negate=Bd,O.nthArg=M3,O.omit=I7,O.omitBy=k7,O.once=Dk,O.orderBy=gk,O.over=T3,O.overArgs=Mk,O.overEvery=A3,O.overSome=I3,O.partial=Hg,O.partialRight=v1,O.partition=mk,O.pick=N7,O.pickBy=$1,O.property=I1,O.propertyOf=k3,O.pull=gI,O.pullAll=s1,O.pullAllBy=mI,O.pullAllWith=vI,O.pullAt=bI,O.range=N3,O.rangeRight=L3,O.rearg=Tk,O.reject=yk,O.remove=yI,O.rest=Ak,O.reverse=zg,O.sampleSize=wk,O.set=F7,O.setWith=z7,O.shuffle=_k,O.slice=xI,O.sortBy=Ek,O.sortedUniq=$I,O.sortedUniqBy=PI,O.split=l3,O.spread=Ik,O.tail=OI,O.take=DI,O.takeRight=MI,O.takeRightWhile=TI,O.takeWhile=AI,O.tap=YI,O.throttle=kk,O.thru=jd,O.toArray=_1,O.toPairs=P1,O.toPairsIn=O1,O.toPath=H3,O.toPlainObject=C1,O.transform=j7,O.unary=Nk,O.union=II,O.unionBy=kI,O.unionWith=NI,O.uniq=LI,O.uniqBy=FI,O.uniqWith=zI,O.unset=V7,O.unzip=jg,O.unzipWith=a1,O.update=H7,O.updateWith=W7,O.values=La,O.valuesIn=B7,O.without=jI,O.words=T1,O.wrap=Lk,O.xor=VI,O.xorBy=HI,O.xorWith=WI,O.zip=BI,O.zipObject=UI,O.zipObjectDeep=qI,O.zipWith=GI,O.entries=P1,O.entriesIn=O1,O.extend=E1,O.extendWith=Gd,Xg(O,O),O.add=B3,O.attempt=A1,O.camelCase=Y7,O.capitalize=D1,O.ceil=U3,O.clamp=U7,O.clone=zk,O.cloneDeep=Vk,O.cloneDeepWith=Hk,O.cloneWith=jk,O.conformsTo=Wk,O.deburr=M1,O.defaultTo=S3,O.divide=q3,O.endsWith=K7,O.eq=Br,O.escape=X7,O.escapeRegExp=Q7,O.every=ok,O.find=sk,O.findIndex=n1,O.findKey=y7,O.findLast=ak,O.findLastIndex=r1,O.findLastKey=x7,O.floor=G3,O.forEach=c1,O.forEachRight=u1,O.forIn=w7,O.forInRight=_7,O.forOwn=S7,O.forOwnRight=C7,O.get=Ug,O.gt=Bk,O.gte=Uk,O.has=$7,O.hasIn=qg,O.head=i1,O.identity=zn,O.includes=fk,O.indexOf=aI,O.inRange=q7,O.invoke=D7,O.isArguments=Cs,O.isArray=Ye,O.isArrayBuffer=qk,O.isArrayLike=Ln,O.isArrayLikeObject=Yt,O.isBoolean=Gk,O.isBuffer=bi,O.isDate=Yk,O.isElement=Kk,O.isEmpty=Xk,O.isEqual=Qk,O.isEqualWith=Zk,O.isError=Wg,O.isFinite=Jk,O.isFunction=zo,O.isInteger=b1,O.isLength=Ud,O.isMap=y1,O.isMatch=e7,O.isMatchWith=t7,O.isNaN=n7,O.isNative=r7,O.isNil=i7,O.isNull=o7,O.isNumber=x1,O.isObject=Ht,O.isObjectLike=Ut,O.isPlainObject=hc,O.isRegExp=Bg,O.isSafeInteger=s7,O.isSet=w1,O.isString=qd,O.isSymbol=Jn,O.isTypedArray=Na,O.isUndefined=a7,O.isWeakMap=l7,O.isWeakSet=c7,O.join=fI,O.kebabCase=Z7,O.last=Rr,O.lastIndexOf=hI,O.lowerCase=J7,O.lowerFirst=e3,O.lt=u7,O.lte=d7,O.max=Y3,O.maxBy=K3,O.mean=X3,O.meanBy=Q3,O.min=Z3,O.minBy=J3,O.stubArray=Zg,O.stubFalse=Jg,O.stubObject=F3,O.stubString=z3,O.stubTrue=j3,O.multiply=eN,O.nth=pI,O.noConflict=D3,O.noop=Qg,O.now=Hd,O.pad=t3,O.padEnd=n3,O.padStart=r3,O.parseInt=o3,O.random=G7,O.reduce=vk,O.reduceRight=bk,O.repeat=i3,O.replace=s3,O.result=L7,O.round=tN,O.runInContext=B,O.sample=xk,O.size=Sk,O.snakeCase=a3,O.some=Ck,O.sortedIndex=wI,O.sortedIndexBy=_I,O.sortedIndexOf=SI,O.sortedLastIndex=CI,O.sortedLastIndexBy=EI,O.sortedLastIndexOf=RI,O.startCase=c3,O.startsWith=u3,O.subtract=nN,O.sum=rN,O.sumBy=oN,O.template=d3,O.times=V3,O.toFinite=jo,O.toInteger=Qe,O.toLength=S1,O.toLower=f3,O.toNumber=$r,O.toSafeInteger=f7,O.toString=yt,O.toUpper=h3,O.trim=p3,O.trimEnd=g3,O.trimStart=m3,O.truncate=v3,O.unescape=b3,O.uniqueId=W3,O.upperCase=y3,O.upperFirst=Gg,O.each=c1,O.eachRight=u1,O.first=i1,Xg(O,function(){var c={};return oo(O,function(f,v){St.call(O.prototype,v)||(c[v]=f)}),c}(),{chain:!1}),O.VERSION=r,wr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(c){O[c].placeholder=O}),wr(["drop","take"],function(c,f){ut.prototype[c]=function(v){v=v===n?1:tn(Qe(v),0);var S=this.__filtered__&&!f?new ut(this):this.clone();return S.__filtered__?S.__takeCount__=_n(v,S.__takeCount__):S.__views__.push({size:_n(v,V),type:c+(S.__dir__<0?"Right":"")}),S},ut.prototype[c+"Right"]=function(v){return this.reverse()[c](v).reverse()}}),wr(["filter","map","takeWhile"],function(c,f){var v=f+1,S=v==X||v==J;ut.prototype[c]=function(P){var A=this.clone();return A.__iteratees__.push({iteratee:Le(P,3),type:v}),A.__filtered__=A.__filtered__||S,A}}),wr(["head","last"],function(c,f){var v="take"+(f?"Right":"");ut.prototype[c]=function(){return this[v](1).value()[0]}}),wr(["initial","tail"],function(c,f){var v="drop"+(f?"":"Right");ut.prototype[c]=function(){return this.__filtered__?new ut(this):this[v](1)}}),ut.prototype.compact=function(){return this.filter(zn)},ut.prototype.find=function(c){return this.filter(c).head()},ut.prototype.findLast=function(c){return this.reverse().find(c)},ut.prototype.invokeMap=rt(function(c,f){return typeof c=="function"?new ut(this):this.map(function(v){return ac(v,c,f)})}),ut.prototype.reject=function(c){return this.filter(Bd(Le(c)))},ut.prototype.slice=function(c,f){c=Qe(c);var v=this;return v.__filtered__&&(c>0||f<0)?new ut(v):(c<0?v=v.takeRight(-c):c&&(v=v.drop(c)),f!==n&&(f=Qe(f),v=f<0?v.dropRight(-f):v.take(f-c)),v)},ut.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},ut.prototype.toArray=function(){return this.take(V)},oo(ut.prototype,function(c,f){var v=/^(?:filter|find|map|reject)|While$/.test(f),S=/^(?:head|last)$/.test(f),P=O[S?"take"+(f=="last"?"Right":""):f],A=S||/^find/.test(f);P&&(O.prototype[f]=function(){var N=this.__wrapped__,z=S?[1]:arguments,G=N instanceof ut,he=z[0],pe=G||Ye(N),be=function(lt){var ht=P.apply(O,di([lt],z));return S&&Re?ht[0]:ht};pe&&v&&typeof he=="function"&&he.length!=1&&(G=pe=!1);var Re=this.__chain__,Te=!!this.__actions__.length,Fe=A&&!Re,et=G&&!Te;if(!A&&pe){N=et?N:new ut(this);var ze=c.apply(N,z);return ze.__actions__.push({func:jd,args:[be],thisArg:n}),new Sr(ze,Re)}return Fe&&et?c.apply(this,z):(ze=this.thru(be),Fe?S?ze.value()[0]:ze.value():ze)})}),wr(["pop","push","shift","sort","splice","unshift"],function(c){var f=fd[c],v=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",S=/^(?:pop|shift)$/.test(c);O.prototype[c]=function(){var P=arguments;if(S&&!this.__chain__){var A=this.value();return f.apply(Ye(A)?A:[],P)}return this[v](function(N){return f.apply(Ye(N)?N:[],P)})}}),oo(ut.prototype,function(c,f){var v=O[f];if(v){var S=v.name+"";St.call(Ma,S)||(Ma[S]=[]),Ma[S].push({name:f,func:v})}}),Ma[Ad(n,_).name]=[{name:"wrapper",func:n}],ut.prototype.clone=b5,ut.prototype.reverse=y5,ut.prototype.value=x5,O.prototype.at=KI,O.prototype.chain=XI,O.prototype.commit=QI,O.prototype.next=ZI,O.prototype.plant=ek,O.prototype.reverse=tk,O.prototype.toJSON=O.prototype.valueOf=O.prototype.value=nk,O.prototype.first=O.prototype.head,ec&&(O.prototype[ec]=JI),O},Pa=QT();ms?((ms.exports=Pa)._=Pa,Kp._=Pa):hn._=Pa}).call(Ns)})(ah,ah.exports);var Za=ah.exports;const Wi=Lu(Za),t_=["lg","md","sm","xs","xxs"],Ce=AE()(jE((e,t)=>({isSessionExpired:!1,currentBreakpoint:"lg",dashboard:{id:"",style:Rv},showContext:!1,selectedSheetId:null,selectedCardId:null,selectedFrameId:null,selectedCard:null,showFilters:!1,isDashboardEditing:!0,isVisualEditing:!1,showDashboardJSON:!1,filteringCards:[],actions:{setIsSessionExpired:n=>{e(()=>({isSessionExpired:n}))},setCardPython:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===o.selectedSheetId);i&&Za.forEach(i.frames,l=>{var d;const u=(d=l.cards)==null?void 0:d.find(h=>h.id===n);u&&(u.python=r)})})},addBaseQuery:n=>{e(r=>{var o;r.dashboard.baseQueries||(r.dashboard.baseQueries=[]),(o=r.dashboard.baseQueries)==null||o.push(n)})},removeBaseQuery:n=>{e(r=>{var i,s;const o=(i=r.dashboard.baseQueries)==null?void 0:i.findIndex(a=>a.id===n);o!=null&&o>-1&&((s=r.dashboard.baseQueries)==null||s.splice(o,1))})},setBaseQueries:n=>{e(r=>{r.dashboard.baseQueries=n})},setCurrentBreakpoint:n=>{e(()=>({currentBreakpoint:n}))},addFilteringCard:n=>{e(r=>{var o;(o=r.filteringCards)==null||o.push(n)})},removeFilteringCard:n=>{e(r=>{var i,s;const o=(i=r.filteringCards)==null?void 0:i.findIndex(a=>a.id===n.id);o!==void 0&&o>-1&&((s=r.filteringCards)==null||s.splice(o,1))})},setCustomCards:n=>{e(r=>{r.dashboard.customCards=n})},setAuthToken:n=>{e(()=>({authToken:n}))},setThemeStyle:n=>{e(()=>({themeStyle:n}))},setDashboard:n=>e({dashboard:n}),setBookmarkKey:n=>{e(()=>({bookmarkKey:n}))},setDashboardTheme:n=>{e(r=>{r.theme=n})},setSheets:n=>{e(r=>{r.dashboard&&(r.dashboard.sheets=n)})},setCardTitle:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(u=>u.id===n);s&&Za.forEach(s.frames,u=>{var h;const d=(h=u.cards)==null?void 0:h.find(p=>p.id===r);d&&(d.title=o)})})},setCardInfo:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===o.selectedSheetId);i&&Za.forEach(i.frames,l=>{var d;const u=(d=l.cards)==null?void 0:d.find(h=>h.id===n);u&&(u.info=r)})})},setCardDescription:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(u=>u.id===n);s&&Za.forEach(s.frames,u=>{var h;const d=(h=u.cards)==null?void 0:h.find(p=>p.id===r);d&&(d.description=o)})})},setCardSql:(n,r,o)=>{e(i=>{var a,l,u,d;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(h=>h.id===n);if(s){const h=(u=s.cards)==null?void 0:u.find(p=>p.id===r);h&&(h.sql=o,(d=i.onUpdateCard)==null||d.call(i,h,n))}})},setFrameCardData:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(u=>u.id===n);s&&Za.forEach(s.frames,u=>{var h;const d=(h=u.cards)==null?void 0:h.find(p=>p.id===r);d&&(d.data=o)})})},setSheetLayout:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layout=r)})},setSheetLayouts:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layouts=r)})},setShowContext:n=>{e(()=>({showContext:n}))},setShowFilters:n=>{e(()=>({showFilters:n}))},setFilterValues:n=>{e(()=>({filterValues:n}))},addOrUpdateFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1?r.filterValues.splice(o,1,n):r.filterValues.push(n)}else r.filterValues=[n]})},addOrUpdateFilterValues:n=>{e(r=>{r.filterValues?n.forEach(o=>{var s,a,l;const i=(s=r==null?void 0:r.filterValues)==null?void 0:s.findIndex(u=>u.filterId===o.filterId);i!==void 0&&i>-1?(a=r.filterValues)==null||a.splice(i,1,o):(l=r.filterValues)==null||l.push(o)}):r.filterValues=n})},removeFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.filter(i=>i.filterId!==n&&!i.filterId.startsWith(n));r.filterValues=o}})},replaceFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1&&r.filterValues.splice(o,1,n)}})},addFilter:n=>{e(r=>{var o;r.dashboard.filters?(o=r.dashboard.filters)==null||o.push(n):r.dashboard.filters=[n]})},removeFilter:n=>{e(r=>{var o,i;if(r.dashboard.filters){const s=(o=r.dashboard.filters)==null?void 0:o.findIndex(a=>a.id===n);console.log("index",s),s>-1&&((i=r.dashboard.filters)==null||i.splice(s,1))}})},updateFrameCard:(n,r,o)=>{e(i=>{var l,u,d,h,p;const s=(u=(l=i.dashboard)==null?void 0:l.sheets)==null?void 0:u.find(g=>g.id===n);if(!s)return;const a=(d=s==null?void 0:s.frames)==null?void 0:d.find(g=>g.id===r);if(a){const g=(h=a.cards)==null?void 0:h.findIndex(b=>b.id===o.id);g>-1&&((p=a.cards)==null||p.splice(g,1,o))}})},updateFilter:n=>{e(r=>{var o,i;if(r.dashboard.filters){const s=(o=r.dashboard.filters)==null?void 0:o.findIndex(a=>a.id===n.id);s>-1&&((i=r.dashboard.filters)==null||i.splice(s,1,n))}})},setIsDashboardEditing:n=>{e(()=>({isDashboardEditing:n}))},setShowDashboardJSON:n=>{e(()=>({showDashboardJSON:n}))},setIsVisualEditing:n=>{e(()=>({isVisualEditing:n}))},addFrame:(n,r)=>{e(o=>{var s,a,l,u,d;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(h=>h.id===n);if(i){i.frames||(i.frames=[]),(l=i.frames)==null||l.push(r);const h={i:r.id,x:0,y:1/0,w:20,h:7,minW:6,minH:2};(u=i.layout)==null||u.push(h),i!=null&&i.layouts||(i.layouts={}),t_.forEach(p=>{i.layouts[p]||(i.layouts[p]=[]),i.layouts[p].push(h)}),(d=o.onAddFrame)==null||d.call(o,r,n)}})},removeFrame:(n,r)=>{e(o=>{var s,a,l,u,d;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(h=>h.id===n);if(i){const h=(l=i.frames)==null?void 0:l.findIndex(p=>p.id===r);console.log(h),typeof h=="number"&&h>-1&&((u=i.frames)==null||u.splice(h,1),(d=i.layout)==null||d.splice(h,1),i.layouts=t_.reduce((p,g)=>{if(p&&p[g]){const b=p[g].findIndex(y=>y.i===r);typeof b=="number"&&b>-1&&p[g].splice(b,1)}return p},i.layouts))}})},updateFrame:(n,r)=>{e(o=>{var a,l,u,d;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(h=>h.id===n),s=(u=i==null?void 0:i.frames)==null?void 0:u.findIndex(h=>h.id===r.id);i&&((d=i.frames)==null||d.splice(s,1,r))})},updateCard:(n,r)=>{e(o=>{var a,l,u,d,h;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(p=>p.id===n),s=(u=i==null?void 0:i.cards)==null?void 0:u.findIndex(p=>p.id===r.id);i&&((d=i.cards)==null||d.splice(s,1,r),(h=o.onUpdateCard)==null||h.call(o,r,n))})},removeCard:(n,r)=>{e(o=>{var a,l,u,d,h,p;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(g=>g.id===n),s=(u=i==null?void 0:i.cards)==null?void 0:u.findIndex(g=>g.id===r.id);i&&((d=i.cards)==null||d.splice(s,1),(h=i.layout)==null||h.splice(s,1),(p=o.onRemoveCard)==null||p.call(o,r,n))})},setStyle:n=>{e(r=>{r.dashboard&&(r.dashboard.style=n)})},setSelectedCardId:(n,r)=>{e(o=>{var s,a,l;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(u=>u.id===n);i&&(((l=i.cards)==null?void 0:l.find(d=>d.id===r))?o.selectedCardId=r:o.selectedCardId=null)})},setSelectedFrameId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(a=>a.id===r.selectedSheetId))&&(r.selectedFrameId=n)})},setSelectedSheetId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(a=>a.id===n))&&(r.selectedSheetId=n)})},setOnSaveFunction:n=>{e(()=>({onSaveFunction:n}))},setOnAddCard:n=>{e(()=>({onAddCard:n}))},setOnUpdateCard:n=>{e(()=>({onUpdateCard:n}))},setOnRemoveCard:n=>{e(()=>({onRemoveCard:n}))},setOnEvent:n=>{e(()=>({onEvent:n}))},getDashboard:()=>t().dashboard,getSelectedSheet:()=>{var n,r;return(r=(n=t().dashboard)==null?void 0:n.sheets)==null?void 0:r.find(o=>o.id===t().selectedSheetId)},getSelectedFrame:()=>{var r,o,i;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(s=>s.id===t().selectedSheetId);return(i=n==null?void 0:n.frames)==null?void 0:i.find(s=>s.id===t().selectedFrameId)},getCard:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a)for(let l=0;l<a.length;l++){const u=(i=a[l].cards)==null?void 0:i.find(d=>d.id===n);if(u)return u}}},getSelectedSheetLayout:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layout},getSelectedSheetLayouts:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layouts},getStyle:()=>{var n;return(n=t().dashboard)==null?void 0:n.style},handleDataPointClickAction:(n,r)=>{R6({card:n,dataPoint:r,set:e,get:t})}}}))),Xi=()=>Ce(e=>e.actions);var zu=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(){}},El=typeof window>"u"||"Deno"in window;function Tr(){}function $6(e,t){return typeof e=="function"?e(t):e}function $v(e){return typeof e=="number"&&e>=0&&e!==1/0}function qE(e,t){return Math.max(e+(t||0)-Date.now(),0)}function n_(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==Zb(s,t.options))return!1}else if(!ou(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||typeof o<"u"&&o!==t.state.fetchStatus||i&&!i(t))}function r_(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(ru(t.options.mutationKey)!==ru(i))return!1}else if(!ou(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Zb(e,t){return((t==null?void 0:t.queryKeyHashFn)||ru)(e)}function ru(e){return JSON.stringify(e,(t,n)=>Ov(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function ou(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!ou(e[n],t[n])):!1}function GE(e,t){if(e===t)return e;const n=o_(e)&&o_(t);if(n||Ov(e)&&Ov(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),s=i.length,a=n?[]:{};let l=0;for(let u=0;u<s;u++){const d=n?u:i[u];!n&&e[d]===void 0&&t[d]===void 0&&r.includes(d)?(a[d]=void 0,l++):(a[d]=GE(e[d],t[d]),a[d]===e[d]&&e[d]!==void 0&&l++)}return o===s&&l===o?e:a}return t}function Pv(e,t){if(e&&!t||t&&!e)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function o_(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ov(e){if(!i_(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!i_(n)||!n.hasOwnProperty("isPrototypeOf"))}function i_(e){return Object.prototype.toString.call(e)==="[object Object]"}function P6(e){return new Promise(t=>{setTimeout(t,e)})}function Dv(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?GE(e,t):t}function O6(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function D6(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Ws,Pi,al,pE,M6=(pE=class extends zu{constructor(){super();Ie(this,Ws,void 0);Ie(this,Pi,void 0);Ie(this,al,void 0);Pe(this,al,t=>{if(!El&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){U(this,Pi)||this.setEventListener(U(this,al))}onUnsubscribe(){var t;this.hasListeners()||((t=U(this,Pi))==null||t.call(this),Pe(this,Pi,void 0))}setEventListener(t){var n;Pe(this,al,t),(n=U(this,Pi))==null||n.call(this),Pe(this,Pi,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){U(this,Ws)!==t&&(Pe(this,Ws,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof U(this,Ws)=="boolean"?U(this,Ws):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ws=new WeakMap,Pi=new WeakMap,al=new WeakMap,pE),lh=new M6,ll,Oi,cl,gE,T6=(gE=class extends zu{constructor(){super();Ie(this,ll,!0);Ie(this,Oi,void 0);Ie(this,cl,void 0);Pe(this,cl,t=>{if(!El&&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(){U(this,Oi)||this.setEventListener(U(this,cl))}onUnsubscribe(){var t;this.hasListeners()||((t=U(this,Oi))==null||t.call(this),Pe(this,Oi,void 0))}setEventListener(t){var n;Pe(this,cl,t),(n=U(this,Oi))==null||n.call(this),Pe(this,Oi,t(this.setOnline.bind(this)))}setOnline(t){U(this,ll)!==t&&(Pe(this,ll,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return U(this,ll)}},ll=new WeakMap,Oi=new WeakMap,cl=new WeakMap,gE),ch=new T6;function A6(e){return Math.min(1e3*2**e,3e4)}function qh(e){return(e??"online")==="online"?ch.isOnline():!0}var YE=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function lm(e){return e instanceof YE}function KE(e){let t=!1,n=0,r=!1,o,i,s;const a=new Promise((x,_)=>{i=x,s=_}),l=x=>{var _;r||(g(new YE(x)),(_=e.abort)==null||_.call(e))},u=()=>{t=!0},d=()=>{t=!1},h=()=>!lh.isFocused()||e.networkMode!=="always"&&!ch.isOnline(),p=x=>{var _;r||(r=!0,(_=e.onSuccess)==null||_.call(e,x),o==null||o(),i(x))},g=x=>{var _;r||(r=!0,(_=e.onError)==null||_.call(e,x),o==null||o(),s(x))},b=()=>new Promise(x=>{var _;o=w=>{const C=r||!h();return C&&x(w),C},(_=e.onPause)==null||_.call(e)}).then(()=>{var x;o=void 0,r||(x=e.onContinue)==null||x.call(e)}),y=()=>{if(r)return;let x;try{x=e.fn()}catch(_){x=Promise.reject(_)}Promise.resolve(x).then(p).catch(_=>{var M;if(r)return;const w=e.retry??(El?0:3),C=e.retryDelay??A6,R=typeof C=="function"?C(n,_):C,E=w===!0||typeof w=="number"&&n<w||typeof w=="function"&&w(n,_);if(t||!E){g(_);return}n++,(M=e.onFail)==null||M.call(e,n,_),P6(R).then(()=>{if(h())return b()}).then(()=>{t?g(_):y()})})};return qh(e.networkMode)?y():b().then(y),{promise:a,cancel:l,continue:()=>(o==null?void 0:o())?a:Promise.resolve(),cancelRetry:u,continueRetry:d}}function I6(){let e=[],t=0,n=p=>{p()},r=p=>{p()},o=p=>setTimeout(p,0);const i=p=>{o=p},s=p=>{let g;t++;try{g=p()}finally{t--,t||u()}return g},a=p=>{t?e.push(p):o(()=>{n(p)})},l=p=>(...g)=>{a(()=>{p(...g)})},u=()=>{const p=e;e=[],p.length&&o(()=>{r(()=>{p.forEach(g=>{n(g)})})})};return{batch:s,batchCalls:l,schedule:a,setNotifyFunction:p=>{n=p},setBatchNotifyFunction:p=>{r=p},setScheduler:i}}var vn=I6(),Bs,mE,XE=(mE=class{constructor(){Ie(this,Bs,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),$v(this.gcTime)&&Pe(this,Bs,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(El?1/0:5*60*1e3))}clearGcTimeout(){U(this,Bs)&&(clearTimeout(U(this,Bs)),Pe(this,Bs,void 0))}},Bs=new WeakMap,mE),ul,dl,Or,Di,Dr,cn,Eu,Us,fl,Wf,Yr,Uo,vE,k6=(vE=class extends XE{constructor(t){super();Ie(this,fl);Ie(this,Yr);Ie(this,ul,void 0);Ie(this,dl,void 0);Ie(this,Or,void 0);Ie(this,Di,void 0);Ie(this,Dr,void 0);Ie(this,cn,void 0);Ie(this,Eu,void 0);Ie(this,Us,void 0);Pe(this,Us,!1),Pe(this,Eu,t.defaultOptions),ot(this,fl,Wf).call(this,t.options),Pe(this,cn,[]),Pe(this,Or,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Pe(this,ul,t.state||N6(this.options)),this.state=U(this,ul),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!U(this,cn).length&&this.state.fetchStatus==="idle"&&U(this,Or).remove(this)}setData(t,n){const r=Dv(this.state.data,t,this.options);return ot(this,Yr,Uo).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){ot(this,Yr,Uo).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=U(this,Di);return(r=U(this,Dr))==null||r.cancel(t),n?n.then(Tr).catch(Tr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(U(this,ul))}isActive(){return U(this,cn).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||U(this,cn).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!qE(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=U(this,cn).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=U(this,Dr))==null||n.continue()}onOnline(){var n;const t=U(this,cn).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=U(this,Dr))==null||n.continue()}addObserver(t){U(this,cn).includes(t)||(U(this,cn).push(t),this.clearGcTimeout(),U(this,Or).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){U(this,cn).includes(t)&&(Pe(this,cn,U(this,cn).filter(n=>n!==t)),U(this,cn).length||(U(this,Dr)&&(U(this,Us)?U(this,Dr).cancel({revert:!0}):U(this,Dr).cancelRetry()),this.scheduleGc()),U(this,Or).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return U(this,cn).length}invalidate(){this.state.isInvalidated||ot(this,Yr,Uo).call(this,{type:"invalidate"})}fetch(t,n){var u,d,h,p;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(U(this,Di))return(u=U(this,Dr))==null||u.continueRetry(),U(this,Di)}if(t&&ot(this,fl,Wf).call(this,t),!this.options.queryFn){const g=U(this,cn).find(b=>b.options.queryFn);g&&ot(this,fl,Wf).call(this,g.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,o={queryKey:this.queryKey,meta:this.meta},i=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>(Pe(this,Us,!0),r.signal)})};i(o);const s=()=>this.options.queryFn?(Pe(this,Us,!1),this.options.persister?this.options.persister(this.options.queryFn,o,this):this.options.queryFn(o)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),a={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(a),(d=this.options.behavior)==null||d.onFetch(a,this),Pe(this,dl,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=a.fetchOptions)==null?void 0:h.meta))&&ot(this,Yr,Uo).call(this,{type:"fetch",meta:(p=a.fetchOptions)==null?void 0:p.meta});const l=g=>{var b,y,x,_;lm(g)&&g.silent||ot(this,Yr,Uo).call(this,{type:"error",error:g}),lm(g)||((y=(b=U(this,Or).config).onError)==null||y.call(b,g,this),(_=(x=U(this,Or).config).onSettled)==null||_.call(x,this.state.data,g,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return Pe(this,Dr,KE({fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:g=>{var b,y,x,_;if(typeof g>"u"){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),l(new Error(`${this.queryHash} data is undefined`));return}this.setData(g),(y=(b=U(this,Or).config).onSuccess)==null||y.call(b,g,this),(_=(x=U(this,Or).config).onSettled)==null||_.call(x,g,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(g,b)=>{ot(this,Yr,Uo).call(this,{type:"failed",failureCount:g,error:b})},onPause:()=>{ot(this,Yr,Uo).call(this,{type:"pause"})},onContinue:()=>{ot(this,Yr,Uo).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),Pe(this,Di,U(this,Dr).promise),U(this,Di)}},ul=new WeakMap,dl=new WeakMap,Or=new WeakMap,Di=new WeakMap,Dr=new WeakMap,cn=new WeakMap,Eu=new WeakMap,Us=new WeakMap,fl=new WeakSet,Wf=function(t){this.options={...U(this,Eu),...t},this.updateGcTime(this.options.gcTime)},Yr=new WeakSet,Uo=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:t.meta??null,fetchStatus:qh(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return lm(o)&&o.revert&&U(this,dl)?{...U(this,dl),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),vn.batch(()=>{U(this,cn).forEach(r=>{r.onQueryUpdate()}),U(this,Or).notify({query:this,type:"updated",action:t})})},vE);function N6(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var uo,bE,QE=(bE=class extends zu{constructor(t={}){super();Ie(this,uo,void 0);this.config=t,Pe(this,uo,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??Zb(o,n);let s=this.get(i);return s||(s=new k6({cache:this,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){U(this,uo).has(t.queryHash)||(U(this,uo).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=U(this,uo).get(t.queryHash);n&&(t.destroy(),n===t&&U(this,uo).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){vn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return U(this,uo).get(t)}getAll(){return[...U(this,uo).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>n_(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>n_(t,r)):n}notify(t){vn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){vn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){vn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},uo=new WeakMap,bE),fo,Ru,ir,hl,ho,Ri,yE,L6=(yE=class extends XE{constructor(t){super();Ie(this,ho);Ie(this,fo,void 0);Ie(this,Ru,void 0);Ie(this,ir,void 0);Ie(this,hl,void 0);this.mutationId=t.mutationId,Pe(this,Ru,t.defaultOptions),Pe(this,ir,t.mutationCache),Pe(this,fo,[]),this.state=t.state||F6(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...U(this,Ru),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){U(this,fo).includes(t)||(U(this,fo).push(t),this.clearGcTimeout(),U(this,ir).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Pe(this,fo,U(this,fo).filter(n=>n!==t)),this.scheduleGc(),U(this,ir).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){U(this,fo).length||(this.state.status==="pending"?this.scheduleGc():U(this,ir).remove(this))}continue(){var t;return((t=U(this,hl))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,a,l,u,d,h,p,g,b,y,x,_,w,C,R,E,M,D;const n=()=>(Pe(this,hl,KE({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(T,k)=>{ot(this,ho,Ri).call(this,{type:"failed",failureCount:T,error:k})},onPause:()=>{ot(this,ho,Ri).call(this,{type:"pause"})},onContinue:()=>{ot(this,ho,Ri).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),U(this,hl).promise),r=this.state.status==="pending";try{if(!r){ot(this,ho,Ri).call(this,{type:"pending",variables:t}),await((i=(o=U(this,ir).config).onMutate)==null?void 0:i.call(o,t,this));const k=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));k!==this.state.context&&ot(this,ho,Ri).call(this,{type:"pending",context:k,variables:t})}const T=await n();return await((u=(l=U(this,ir).config).onSuccess)==null?void 0:u.call(l,T,t,this.state.context,this)),await((h=(d=this.options).onSuccess)==null?void 0:h.call(d,T,t,this.state.context)),await((g=(p=U(this,ir).config).onSettled)==null?void 0:g.call(p,T,null,this.state.variables,this.state.context,this)),await((y=(b=this.options).onSettled)==null?void 0:y.call(b,T,null,t,this.state.context)),ot(this,ho,Ri).call(this,{type:"success",data:T}),T}catch(T){try{throw await((_=(x=U(this,ir).config).onError)==null?void 0:_.call(x,T,t,this.state.context,this)),await((C=(w=this.options).onError)==null?void 0:C.call(w,T,t,this.state.context)),await((E=(R=U(this,ir).config).onSettled)==null?void 0:E.call(R,void 0,T,this.state.variables,this.state.context,this)),await((D=(M=this.options).onSettled)==null?void 0:D.call(M,void 0,T,t,this.state.context)),T}finally{ot(this,ho,Ri).call(this,{type:"error",error:T})}}}},fo=new WeakMap,Ru=new WeakMap,ir=new WeakMap,hl=new WeakMap,ho=new WeakSet,Ri=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:!qh(this.options.networkMode),status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),vn.batch(()=>{U(this,fo).forEach(r=>{r.onMutationUpdate(t)}),U(this,ir).notify({mutation:this,type:"updated",action:t})})},yE);function F6(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Mr,$u,qs,xE,z6=(xE=class extends zu{constructor(t={}){super();Ie(this,Mr,void 0);Ie(this,$u,void 0);Ie(this,qs,void 0);this.config=t,Pe(this,Mr,[]),Pe(this,$u,0)}build(t,n,r){const o=new L6({mutationCache:this,mutationId:++Yd(this,$u)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){U(this,Mr).push(t),this.notify({type:"added",mutation:t})}remove(t){Pe(this,Mr,U(this,Mr).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){vn.batch(()=>{U(this,Mr).forEach(t=>{this.remove(t)})})}getAll(){return U(this,Mr)}find(t){const n={exact:!0,...t};return U(this,Mr).find(r=>r_(n,r))}findAll(t={}){return U(this,Mr).filter(n=>r_(t,n))}notify(t){vn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return Pe(this,qs,(U(this,qs)??Promise.resolve()).then(()=>{const t=U(this,Mr).filter(n=>n.state.isPaused);return vn.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(Tr)),Promise.resolve()))}).then(()=>{Pe(this,qs,void 0)})),U(this,qs)}},Mr=new WeakMap,$u=new WeakMap,qs=new WeakMap,xE);function j6(e){return{onFetch:(t,n)=>{const r=async()=>{var b,y,x,_,w;const o=t.options,i=(x=(y=(b=t.fetchOptions)==null?void 0:b.meta)==null?void 0:y.fetchMore)==null?void 0:x.direction,s=((_=t.state.data)==null?void 0:_.pages)||[],a=((w=t.state.data)==null?void 0:w.pageParams)||[],l={pages:[],pageParams:[]};let u=!1;const d=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(t.signal.aborted?u=!0:t.signal.addEventListener("abort",()=>{u=!0}),t.signal)})},h=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),p=async(C,R,E)=>{if(u)return Promise.reject();if(R==null&&C.pages.length)return Promise.resolve(C);const M={queryKey:t.queryKey,pageParam:R,direction:E?"backward":"forward",meta:t.options.meta};d(M);const D=await h(M),{maxPages:T}=t.options,k=E?D6:O6;return{pages:k(C.pages,D,T),pageParams:k(C.pageParams,R,T)}};let g;if(i&&s.length){const C=i==="backward",R=C?V6:s_,E={pages:s,pageParams:a},M=R(o,E);g=await p(E,M,C)}else{g=await p(l,a[0]??o.initialPageParam);const C=e??s.length;for(let R=1;R<C;R++){const E=s_(o,g);g=await p(g,E)}}return g};t.options.persister?t.fetchFn=()=>{var o,i;return(i=(o=t.options).persister)==null?void 0:i.call(o,r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=r}}}function s_(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function V6(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var nn,Mi,Ti,pl,gl,Ai,ml,vl,wE,H6=(wE=class{constructor(e={}){Ie(this,nn,void 0);Ie(this,Mi,void 0);Ie(this,Ti,void 0);Ie(this,pl,void 0);Ie(this,gl,void 0);Ie(this,Ai,void 0);Ie(this,ml,void 0);Ie(this,vl,void 0);Pe(this,nn,e.queryCache||new QE),Pe(this,Mi,e.mutationCache||new z6),Pe(this,Ti,e.defaultOptions||{}),Pe(this,pl,new Map),Pe(this,gl,new Map),Pe(this,Ai,0)}mount(){Yd(this,Ai)._++,U(this,Ai)===1&&(Pe(this,ml,lh.subscribe(()=>{lh.isFocused()&&(this.resumePausedMutations(),U(this,nn).onFocus())})),Pe(this,vl,ch.subscribe(()=>{ch.isOnline()&&(this.resumePausedMutations(),U(this,nn).onOnline())})))}unmount(){var e,t;Yd(this,Ai)._--,U(this,Ai)===0&&((e=U(this,ml))==null||e.call(this),Pe(this,ml,void 0),(t=U(this,vl))==null||t.call(this),Pe(this,vl,void 0))}isFetching(e){return U(this,nn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return U(this,Mi).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=U(this,nn).find({queryKey:e}))==null?void 0:t.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);return t!==void 0?Promise.resolve(t):this.fetchQuery(e)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=U(this,nn).find({queryKey:e}),o=r==null?void 0:r.state.data,i=$6(t,o);if(typeof i>"u")return;const s=this.defaultQueryOptions({queryKey:e});return U(this,nn).build(this,s).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return vn.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var t;return(t=U(this,nn).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=U(this,nn);vn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=U(this,nn),r={type:"active",...e};return vn.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=vn.batch(()=>U(this,nn).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Tr).catch(Tr)}invalidateQueries(e={},t={}){return vn.batch(()=>{if(U(this,nn).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=vn.batch(()=>U(this,nn).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(Tr)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Tr)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=U(this,nn).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Tr).catch(Tr)}fetchInfiniteQuery(e){return e.behavior=j6(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Tr).catch(Tr)}resumePausedMutations(){return U(this,Mi).resumePausedMutations()}getQueryCache(){return U(this,nn)}getMutationCache(){return U(this,Mi)}getDefaultOptions(){return U(this,Ti)}setDefaultOptions(e){Pe(this,Ti,e)}setQueryDefaults(e,t){U(this,pl).set(ru(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...U(this,pl).values()];let n={};return t.forEach(r=>{ou(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){U(this,gl).set(ru(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...U(this,gl).values()];let n={};return t.forEach(r=>{ou(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...U(this,Ti).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Zb(t.queryKey,t)),typeof t.refetchOnReconnect>"u"&&(t.refetchOnReconnect=t.networkMode!=="always"),typeof t.throwOnError>"u"&&(t.throwOnError=!!t.suspense),typeof t.networkMode>"u"&&t.persister&&(t.networkMode="offlineFirst"),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...U(this,Ti).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){U(this,nn).clear(),U(this,Mi).clear()}},nn=new WeakMap,Mi=new WeakMap,Ti=new WeakMap,pl=new WeakMap,gl=new WeakMap,Ai=new WeakMap,ml=new WeakMap,vl=new WeakMap,wE),Bn,It,Pu,In,Gs,bl,po,Ou,yl,xl,Ys,Ks,Ii,wl,Xs,Mc,Du,Mv,Mu,Tv,Tu,Av,Au,Iv,Iu,kv,ku,Nv,Nu,Lv,zh,ZE,_E,W6=(_E=class extends zu{constructor(t,n){super();Ie(this,Xs);Ie(this,Du);Ie(this,Mu);Ie(this,Tu);Ie(this,Au);Ie(this,Iu);Ie(this,ku);Ie(this,Nu);Ie(this,zh);Ie(this,Bn,void 0);Ie(this,It,void 0);Ie(this,Pu,void 0);Ie(this,In,void 0);Ie(this,Gs,void 0);Ie(this,bl,void 0);Ie(this,po,void 0);Ie(this,Ou,void 0);Ie(this,yl,void 0);Ie(this,xl,void 0);Ie(this,Ys,void 0);Ie(this,Ks,void 0);Ie(this,Ii,void 0);Ie(this,wl,new Set);this.options=n,Pe(this,Bn,t),Pe(this,po,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(U(this,It).addObserver(this),a_(U(this,It),this.options)?ot(this,Xs,Mc).call(this):this.updateResult(),ot(this,Au,Iv).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Fv(U(this,It),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Fv(U(this,It),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ot(this,Iu,kv).call(this),ot(this,ku,Nv).call(this),U(this,It).removeObserver(this)}setOptions(t,n){const r=this.options,o=U(this,It);if(this.options=U(this,Bn).defaultQueryOptions(t),Pv(r,this.options)||U(this,Bn).getQueryCache().notify({type:"observerOptionsUpdated",query:U(this,It),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),ot(this,Nu,Lv).call(this);const i=this.hasListeners();i&&l_(U(this,It),o,this.options,r)&&ot(this,Xs,Mc).call(this),this.updateResult(n),i&&(U(this,It)!==o||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&ot(this,Du,Mv).call(this);const s=ot(this,Mu,Tv).call(this);i&&(U(this,It)!==o||this.options.enabled!==r.enabled||s!==U(this,Ii))&&ot(this,Tu,Av).call(this,s)}getOptimisticResult(t){const n=U(this,Bn).getQueryCache().build(U(this,Bn),t),r=this.createResult(n,t);return U6(this,r)&&(Pe(this,In,r),Pe(this,bl,this.options),Pe(this,Gs,U(this,It).state)),r}getCurrentResult(){return U(this,In)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(U(this,wl).add(r),t[r])})}),n}getCurrentQuery(){return U(this,It)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=U(this,Bn).defaultQueryOptions(t),r=U(this,Bn).getQueryCache().build(U(this,Bn),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return ot(this,Xs,Mc).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),U(this,In)))}createResult(t,n){var M;const r=U(this,It),o=this.options,i=U(this,In),s=U(this,Gs),a=U(this,bl),u=t!==r?t.state:U(this,Pu),{state:d}=t;let{error:h,errorUpdatedAt:p,fetchStatus:g,status:b}=d,y=!1,x;if(n._optimisticResults){const D=this.hasListeners(),T=!D&&a_(t,n),k=D&&l_(t,r,n,o);(T||k)&&(g=qh(t.options.networkMode)?"fetching":"paused",d.dataUpdatedAt||(b="pending")),n._optimisticResults==="isRestoring"&&(g="idle")}if(n.select&&typeof d.data<"u")if(i&&d.data===(s==null?void 0:s.data)&&n.select===U(this,Ou))x=U(this,yl);else try{Pe(this,Ou,n.select),x=n.select(d.data),x=Dv(i==null?void 0:i.data,x,n),Pe(this,yl,x),Pe(this,po,null)}catch(D){Pe(this,po,D)}else x=d.data;if(typeof n.placeholderData<"u"&&typeof x>"u"&&b==="pending"){let D;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))D=i.data;else if(D=typeof n.placeholderData=="function"?n.placeholderData((M=U(this,xl))==null?void 0:M.state.data,U(this,xl)):n.placeholderData,n.select&&typeof D<"u")try{D=n.select(D),Pe(this,po,null)}catch(T){Pe(this,po,T)}typeof D<"u"&&(b="success",x=Dv(i==null?void 0:i.data,D,n),y=!0)}U(this,po)&&(h=U(this,po),x=U(this,yl),p=Date.now(),b="error");const _=g==="fetching",w=b==="pending",C=b==="error",R=w&&_;return{status:b,fetchStatus:g,isPending:w,isSuccess:b==="success",isError:C,isInitialLoading:R,isLoading:R,data:x,dataUpdatedAt:d.dataUpdatedAt,error:h,errorUpdatedAt:p,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:_,isRefetching:_&&!w,isLoadingError:C&&d.dataUpdatedAt===0,isPaused:g==="paused",isPlaceholderData:y,isRefetchError:C&&d.dataUpdatedAt!==0,isStale:Jb(t,n),refetch:this.refetch}}updateResult(t){const n=U(this,In),r=this.createResult(U(this,It),this.options);if(Pe(this,Gs,U(this,It).state),Pe(this,bl,this.options),U(this,Gs).data!==void 0&&Pe(this,xl,U(this,It)),Pv(r,n))return;Pe(this,In,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!U(this,wl).size)return!0;const l=new Set(a??U(this,wl));return this.options.throwOnError&&l.add("error"),Object.keys(U(this,In)).some(u=>{const d=u;return U(this,In)[d]!==n[d]&&l.has(d)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),ot(this,zh,ZE).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ot(this,Au,Iv).call(this)}},Bn=new WeakMap,It=new WeakMap,Pu=new WeakMap,In=new WeakMap,Gs=new WeakMap,bl=new WeakMap,po=new WeakMap,Ou=new WeakMap,yl=new WeakMap,xl=new WeakMap,Ys=new WeakMap,Ks=new WeakMap,Ii=new WeakMap,wl=new WeakMap,Xs=new WeakSet,Mc=function(t){ot(this,Nu,Lv).call(this);let n=U(this,It).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Tr)),n},Du=new WeakSet,Mv=function(){if(ot(this,Iu,kv).call(this),El||U(this,In).isStale||!$v(this.options.staleTime))return;const n=qE(U(this,In).dataUpdatedAt,this.options.staleTime)+1;Pe(this,Ys,setTimeout(()=>{U(this,In).isStale||this.updateResult()},n))},Mu=new WeakSet,Tv=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(U(this,It)):this.options.refetchInterval)??!1},Tu=new WeakSet,Av=function(t){ot(this,ku,Nv).call(this),Pe(this,Ii,t),!(El||this.options.enabled===!1||!$v(U(this,Ii))||U(this,Ii)===0)&&Pe(this,Ks,setInterval(()=>{(this.options.refetchIntervalInBackground||lh.isFocused())&&ot(this,Xs,Mc).call(this)},U(this,Ii)))},Au=new WeakSet,Iv=function(){ot(this,Du,Mv).call(this),ot(this,Tu,Av).call(this,ot(this,Mu,Tv).call(this))},Iu=new WeakSet,kv=function(){U(this,Ys)&&(clearTimeout(U(this,Ys)),Pe(this,Ys,void 0))},ku=new WeakSet,Nv=function(){U(this,Ks)&&(clearInterval(U(this,Ks)),Pe(this,Ks,void 0))},Nu=new WeakSet,Lv=function(){const t=U(this,Bn).getQueryCache().build(U(this,Bn),this.options);if(t===U(this,It))return;const n=U(this,It);Pe(this,It,t),Pe(this,Pu,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},zh=new WeakSet,ZE=function(t){vn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(U(this,In))}),U(this,Bn).getQueryCache().notify({query:U(this,It),type:"observerResultsUpdated"})})},_E);function B6(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function a_(e,t){return B6(e,t)||e.state.dataUpdatedAt>0&&Fv(e,t,t.refetchOnMount)}function Fv(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Jb(e,t)}return!1}function l_(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&Jb(e,n)}function Jb(e,t){return e.isStaleByTime(t.staleTime)}function U6(e,t){return!Pv(e.getCurrentResult(),t)}var JE=le.createContext(void 0),q6=e=>{const t=le.useContext(JE);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},G6=({client:e,children:t})=>(le.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),le.createElement(JE.Provider,{value:e},t)),eR=le.createContext(!1),Y6=()=>le.useContext(eR);eR.Provider;function K6(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var X6=le.createContext(K6()),Q6=()=>le.useContext(X6);function Z6(e,t){return typeof e=="function"?e(...t):!!e}var J6=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},e9=e=>{le.useEffect(()=>{e.clearReset()},[e])},t9=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&Z6(n,[e.error,r]),n9=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},r9=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,o9=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function i9(e,t,n){if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=q6(n),o=Y6(),i=Q6(),s=r.defaultQueryOptions(e);s._optimisticResults=o?"isRestoring":"optimistic",n9(s),J6(s,i),e9(i);const[a]=le.useState(()=>new t(r,s)),l=a.getOptimisticResult(s);if(le.useSyncExternalStore(le.useCallback(u=>{const d=o?()=>{}:a.subscribe(vn.batchCalls(u));return a.updateResult(),d},[a,o]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),le.useEffect(()=>{a.setOptions(s,{listeners:!1})},[s,a]),r9(s,l))throw o9(s,a,i);if(t9({result:l,errorResetBoundary:i,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw l.error;return s.notifyOnChangeProps?l:a.trackResult(l)}function ju(e,t){return i9(e,W6,t)}const s9={theme:"system",setTheme:()=>null},tR=m.createContext(s9);function a9({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[o,i]=m.useState(()=>localStorage.getItem(n)||t);m.useEffect(()=>{const a=window.document.documentElement;if(a.classList.remove("light","dark"),o==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";a.classList.add(l);return}a.classList.add(o)},[o]);const s={theme:o,setTheme:a=>{localStorage.setItem(n,a),i(a)}};return I.jsx(tR.Provider,{...r,value:s,children:e})}const nR=()=>{const e=m.useContext(tR);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};async function l9(e){return await(await fetch("https://semaphor.cloud/api/v1/dashboard",{headers:{Authorization:`Bearer ${e}`}})).json()}function rR(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function c_(e,t){const n=rR(e);return n==="dark"?Wi.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function c9({authToken:e,customStyle:t,currentTheme:n,onSave:r,onEvent:o}){const{data:i,refetch:s,isLoading:a,isError:l}=ju({queryKey:["dashboard",e==null?void 0:e.accessToken],queryFn:()=>l9(e==null?void 0:e.accessToken),enabled:!1}),{theme:u,setTheme:d}=nR(),{setDashboard:h,setSelectedSheetId:p,setStyle:g,setOnSaveFunction:b}=Ce(E=>E.actions);Ce(E=>E.actions.setCustomCards);const y=Ce(E=>E.actions.setFilterValues),x=Ce(E=>E.actions.setBookmarkKey),_=Ce(E=>E.actions.setAuthToken),w=Ce(E=>E.actions.setThemeStyle),C=Ce(E=>E.actions.setDashboardTheme),R=Ce(E=>E.actions.setOnEvent);return m.useEffect(()=>{if(u){const E=rR(u);C(E)}},[u,C]),m.useEffect(()=>{n&&d(n)},[n,d]),m.useEffect(()=>{const E=Wi.cloneDeep(Rv);if(t){const M=Wi.merge(E,t),D=c_(u,M);w(D),g(M)}else{const M=c_(u,E);w(M),g(Rv)}},[u,t,g,w]),m.useEffect(()=>{var k;if(!i||!i.dashboard)return;const E=i.dashboard,M=dD(E.id),D=JSON.parse(localStorage.getItem(M)||"[]"),T=D.find(L=>L.default===!0);if(T)h(T.template),x(T.name),T.filterValues&&y(T.filterValues);else{h(E);const L=D.find(W=>(W==null?void 0:W.name)==="Original");L?L.template=E:D.push({name:"Original",template:E,default:!1}),localStorage.setItem(M,JSON.stringify(D))}p((k=E.sheets)==null?void 0:k[0].id)},[i,h,p,y,x]),m.useEffect(()=>{r&&b(r),o&&R(o)},[r,b,o,R]),m.useEffect(()=>{e&&e.accessToken&&(_(e),s())},[e,s,_]),{isLoading:a,isError:l}}function e0({className:e,...t}){return I.jsx("div",{className:_e("animate-pulse rounded-md bg-muted",e),...t})}const t0=le.forwardRef(({className:e,...t},n)=>I.jsx("div",{ref:n,className:_e("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));t0.displayName="Card";const Gh=le.forwardRef(({className:e,...t},n)=>I.jsx("div",{ref:n,className:_e("flex flex-col space-y-1.5 p-6",e),...t}));Gh.displayName="CardHeader";const Vu=le.forwardRef(({className:e,...t},n)=>I.jsx("h3",{ref:n,className:_e("text-2xl font-semibold leading-none tracking-tight",e),...t}));Vu.displayName="CardTitle";const n0=le.forwardRef(({className:e,...t},n)=>I.jsx("p",{ref:n,className:_e("text-sm text-muted-foreground",e),...t}));n0.displayName="CardDescription";const Yh=le.forwardRef(({className:e,...t},n)=>I.jsx("div",{ref:n,className:_e("px-6 pt-0",e),...t}));Yh.displayName="CardContent";const r0=le.forwardRef(({className:e,...t},n)=>I.jsx("div",{ref:n,className:_e("flex items-center p-6 pt-0",e),...t}));r0.displayName="CardFooter";function oR({className:e,customStyle:t,onSave:n,onEvent:r,LoadingComponent:o,ErrorComponent:i,onChartElementClicked:s,id:a,authToken:l,currentTheme:u,version:d,customCards:h,...p}){Ce(_=>_.selectedSheetId);const g=Ce(_=>_.themeStyle),b=Ce(_=>_.isSessionExpired),{isLoading:y,isError:x}=c9({authToken:l,customStyle:t,currentTheme:u,onSave:n,onEvent:r});return y||!l?(r==null||r({type:"info",message:"Loading dashboard"}),o?I.jsx(o,{message:"loading"}):I.jsx("div",{className:"flex items-center gap-3",children:I.jsx(e0,{className:"h-1 w-full dark:h-[2px]"})})):x?(r==null||r({type:"error",message:"Error fetching dashboard"}),i?(console.log("Error fetching dashboard"),I.jsx(i,{})):I.jsx("div",{children:"Error"})):b?(r==null||r({type:"error",message:"Session Expired"}),I.jsx("div",{className:"flex h-full items-center justify-center",children:I.jsxs("div",{className:"space-y-4 rounded-md border border-muted p-10",children:[I.jsx(Vu,{children:"Session Expired"}),I.jsx("p",{className:"text-muted-foreground",children:"Your session has expired. Please refresh the page to continue."})]})})):I.jsx("div",{className:_e("flex h-full grow flex-col justify-between",g==null?void 0:g.dashboardPanel,e),role:"dashboard-panel",...p})}function ne(){return ne=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ne.apply(this,arguments)}function we(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function dn(e,t=[]){let n=[];function r(i,s){const a=m.createContext(s),l=n.length;n=[...n,s];function u(h){const{scope:p,children:g,...b}=h,y=(p==null?void 0:p[e][l])||a,x=m.useMemo(()=>b,Object.values(b));return m.createElement(y.Provider,{value:x},g)}function d(h,p){const g=(p==null?void 0:p[e][l])||a,b=m.useContext(g);if(b)return b;if(s!==void 0)return s;throw new Error(`\`${h}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,d]}const o=()=>{const i=n.map(s=>m.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,u9(o,...t)]}function u9(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const h=l(i)[`__scope${u}`];return{...a,...h}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function d9(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Kh(...e){return t=>e.forEach(n=>d9(n,t))}function Xe(...e){return m.useCallback(Kh(...e),e)}const ni=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(f9);if(i){const s=i.props.children,a=o.map(l=>l===i?m.Children.count(s)>1?m.Children.only(null):m.isValidElement(s)?s.props.children:null:l);return m.createElement(zv,ne({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(zv,ne({},r,{ref:t}),n)});ni.displayName="Slot";const zv=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...h9(r,n.props),ref:t?Kh(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});zv.displayName="SlotClone";const iR=({children:e})=>m.createElement(m.Fragment,null,e);function f9(e){return m.isValidElement(e)&&e.type===iR}function h9(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Xh(e){const t=e+"CollectionProvider",[n,r]=dn(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=g=>{const{scope:b,children:y}=g,x=m.useRef(null),_=m.useRef(new Map).current;return m.createElement(o,{scope:b,itemMap:_,collectionRef:x},y)},a=e+"CollectionSlot",l=m.forwardRef((g,b)=>{const{scope:y,children:x}=g,_=i(a,y),w=Xe(b,_.collectionRef);return m.createElement(ni,{ref:w},x)}),u=e+"CollectionItemSlot",d="data-radix-collection-item",h=m.forwardRef((g,b)=>{const{scope:y,children:x,..._}=g,w=m.useRef(null),C=Xe(b,w),R=i(u,y);return m.useEffect(()=>(R.itemMap.set(w,{ref:w,..._}),()=>void R.itemMap.delete(w))),m.createElement(ni,{[d]:"",ref:C},x)});function p(g){const b=i(e+"CollectionConsumer",g);return m.useCallback(()=>{const x=b.collectionRef.current;if(!x)return[];const _=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(b.itemMap.values()).sort((R,E)=>_.indexOf(R.ref.current)-_.indexOf(E.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:s,Slot:l,ItemSlot:h},p,r]}const Pn=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},p9=le.useId||(()=>{});let g9=0;function Yn(e){const[t,n]=le.useState(p9());return Pn(()=>{e||n(r=>r??String(g9++))},[e]),e||(t?`radix-${t}`:"")}const m9=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ke=m9.reduce((e,t)=>{const n=m.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?ni:t;return m.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),m.createElement(a,ne({},s,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function sR(e,t){e&&So.flushSync(()=>e.dispatchEvent(t))}function on(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function On({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=v9({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=on(n),l=m.useCallback(u=>{if(i){const h=typeof u=="function"?u(e):u;h!==e&&a(h)}else o(u)},[i,e,o,a]);return[s,l]}function v9({defaultProp:e,onChange:t}){const n=m.useState(e),[r]=n,o=m.useRef(r),i=on(t);return m.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const b9=m.createContext(void 0);function ha(e){const t=m.useContext(b9);return e||t||"ltr"}const cm="rovingFocusGroup.onEntryFocus",y9={bubbles:!1,cancelable:!0},o0="RovingFocusGroup",[jv,aR,x9]=Xh(o0),[w9,zl]=dn(o0,[x9]),[_9,S9]=w9(o0),C9=m.forwardRef((e,t)=>m.createElement(jv.Provider,{scope:e.__scopeRovingFocusGroup},m.createElement(jv.Slot,{scope:e.__scopeRovingFocusGroup},m.createElement(E9,ne({},e,{ref:t}))))),E9=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,...d}=e,h=m.useRef(null),p=Xe(t,h),g=ha(i),[b=null,y]=On({prop:s,defaultProp:a,onChange:l}),[x,_]=m.useState(!1),w=on(u),C=aR(n),R=m.useRef(!1),[E,M]=m.useState(0);return m.useEffect(()=>{const D=h.current;if(D)return D.addEventListener(cm,w),()=>D.removeEventListener(cm,w)},[w]),m.createElement(_9,{scope:n,orientation:r,dir:g,loop:o,currentTabStopId:b,onItemFocus:m.useCallback(D=>y(D),[y]),onItemShiftTab:m.useCallback(()=>_(!0),[]),onFocusableItemAdd:m.useCallback(()=>M(D=>D+1),[]),onFocusableItemRemove:m.useCallback(()=>M(D=>D-1),[])},m.createElement(ke.div,ne({tabIndex:x||E===0?-1:0,"data-orientation":r},d,{ref:p,style:{outline:"none",...e.style},onMouseDown:we(e.onMouseDown,()=>{R.current=!0}),onFocus:we(e.onFocus,D=>{const T=!R.current;if(D.target===D.currentTarget&&T&&!x){const k=new CustomEvent(cm,y9);if(D.currentTarget.dispatchEvent(k),!k.defaultPrevented){const L=C().filter(F=>F.focusable),W=L.find(F=>F.active),Y=L.find(F=>F.id===b),X=[W,Y,...L].filter(Boolean).map(F=>F.ref.current);lR(X)}}R.current=!1}),onBlur:we(e.onBlur,()=>_(!1))})))}),R9="RovingFocusGroupItem",$9=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=Yn(),l=i||a,u=S9(R9,n),d=u.currentTabStopId===l,h=aR(n),{onFocusableItemAdd:p,onFocusableItemRemove:g}=u;return m.useEffect(()=>{if(r)return p(),()=>g()},[r,p,g]),m.createElement(jv.ItemSlot,{scope:n,id:l,focusable:r,active:o},m.createElement(ke.span,ne({tabIndex:d?0:-1,"data-orientation":u.orientation},s,{ref:t,onMouseDown:we(e.onMouseDown,b=>{r?u.onItemFocus(l):b.preventDefault()}),onFocus:we(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:we(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){u.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const y=D9(b,u.orientation,u.dir);if(y!==void 0){b.preventDefault();let _=h().filter(w=>w.focusable).map(w=>w.ref.current);if(y==="last")_.reverse();else if(y==="prev"||y==="next"){y==="prev"&&_.reverse();const w=_.indexOf(b.currentTarget);_=u.loop?M9(_,w+1):_.slice(w+1)}setTimeout(()=>lR(_))}})})))}),P9={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function O9(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function D9(e,t,n){const r=O9(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return P9[r]}function lR(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function M9(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const i0=C9,s0=$9;function T9(e,t){return m.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const Zt=e=>{const{present:t,children:n}=e,r=A9(t),o=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),i=Xe(r.ref,o.ref);return typeof n=="function"||r.isPresent?m.cloneElement(o,{ref:i}):null};Zt.displayName="Presence";function A9(e){const[t,n]=m.useState(),r=m.useRef({}),o=m.useRef(e),i=m.useRef("none"),s=e?"mounted":"unmounted",[a,l]=T9(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const u=Zd(r.current);i.current=a==="mounted"?u:"none"},[a]),Pn(()=>{const u=r.current,d=o.current;if(d!==e){const p=i.current,g=Zd(u);e?l("MOUNT"):g==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&p!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Pn(()=>{if(t){const u=h=>{const g=Zd(r.current).includes(h.animationName);h.target===t&&g&&So.flushSync(()=>l("ANIMATION_END"))},d=h=>{h.target===t&&(i.current=Zd(r.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:m.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function Zd(e){return(e==null?void 0:e.animationName)||"none"}const cR="Tabs",[I9,Jre]=dn(cR,[zl]),uR=zl(),[k9,a0]=I9(cR),N9=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...u}=e,d=ha(a),[h,p]=On({prop:r,onChange:o,defaultProp:i});return m.createElement(k9,{scope:n,baseId:Yn(),value:h,onValueChange:p,orientation:s,dir:d,activationMode:l},m.createElement(ke.div,ne({dir:d,"data-orientation":s},u,{ref:t})))}),L9="TabsList",F9=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=a0(L9,n),s=uR(n);return m.createElement(i0,ne({asChild:!0},s,{orientation:i.orientation,dir:i.dir,loop:r}),m.createElement(ke.div,ne({role:"tablist","aria-orientation":i.orientation},o,{ref:t})))}),z9="TabsTrigger",j9=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=a0(z9,n),a=uR(n),l=dR(s.baseId,r),u=fR(s.baseId,r),d=r===s.value;return m.createElement(s0,ne({asChild:!0},a,{focusable:!o,active:d}),m.createElement(ke.button,ne({type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l},i,{ref:t,onMouseDown:we(e.onMouseDown,h=>{!o&&h.button===0&&h.ctrlKey===!1?s.onValueChange(r):h.preventDefault()}),onKeyDown:we(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&s.onValueChange(r)}),onFocus:we(e.onFocus,()=>{const h=s.activationMode!=="manual";!d&&!o&&h&&s.onValueChange(r)})})))}),V9="TabsContent",H9=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=a0(V9,n),l=dR(a.baseId,r),u=fR(a.baseId,r),d=r===a.value,h=m.useRef(d);return m.useEffect(()=>{const p=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(p)},[]),m.createElement(Zt,{present:o||d},({present:p})=>m.createElement(ke.div,ne({"data-state":d?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!p,id:u,tabIndex:0},s,{ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0}}),p&&i))});function dR(e,t){return`${e}-trigger-${t}`}function fR(e,t){return`${e}-content-${t}`}const W9=N9,hR=F9,pR=j9,gR=H9,mR=W9,vR=le.forwardRef(({className:e,...t},n)=>I.jsx(hR,{ref:n,className:_e("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));vR.displayName=hR.displayName;const bR=le.forwardRef(({className:e,...t},n)=>I.jsx(pR,{ref:n,className:_e("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}));bR.displayName=pR.displayName;const l0=le.forwardRef(({className:e,...t},n)=>I.jsx(gR,{ref:n,className:_e("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));l0.displayName=gR.displayName;var yR={exports:{}},Hu={},Vv={exports:{}};(function(e,t){(function(n,r){r(t)})(Ns,function(n){function r(te){return function(ie,ye,Z,De,Ne,Ve,qe){return te(ie,ye,qe)}}function o(te){return function(ie,ye,Z,De){if(!ie||!ye||typeof ie!="object"||typeof ye!="object")return te(ie,ye,Z,De);var Ne=De.get(ie),Ve=De.get(ye);if(Ne&&Ve)return Ne===ye&&Ve===ie;De.set(ie,ye),De.set(ye,ie);var qe=te(ie,ye,Z,De);return De.delete(ie),De.delete(ye),qe}}function i(te,K){var ie={};for(var ye in te)ie[ye]=te[ye];for(var ye in K)ie[ye]=K[ye];return ie}function s(te){return te.constructor===Object||te.constructor==null}function a(te){return typeof te.then=="function"}function l(te,K){return te===K||te!==te&&K!==K}var u="[object Arguments]",d="[object Boolean]",h="[object Date]",p="[object RegExp]",g="[object Map]",b="[object Number]",y="[object Object]",x="[object Set]",_="[object String]",w=Object.prototype.toString;function C(te){var K=te.areArraysEqual,ie=te.areDatesEqual,ye=te.areMapsEqual,Z=te.areObjectsEqual,De=te.areRegExpsEqual,Ne=te.areSetsEqual,Ve=te.createIsNestedEqual,qe=Ve(pt);function pt(dt,ft,Bt){if(dt===ft)return!0;if(!dt||!ft||typeof dt!="object"||typeof ft!="object")return dt!==dt&&ft!==ft;if(s(dt)&&s(ft))return Z(dt,ft,qe,Bt);var Vt=Array.isArray(dt),xn=Array.isArray(ft);if(Vt||xn)return Vt===xn&&K(dt,ft,qe,Bt);var Jt=w.call(dt);return Jt!==w.call(ft)?!1:Jt===h?ie(dt,ft,qe,Bt):Jt===p?De(dt,ft,qe,Bt):Jt===g?ye(dt,ft,qe,Bt):Jt===x?Ne(dt,ft,qe,Bt):Jt===y||Jt===u?a(dt)||a(ft)?!1:Z(dt,ft,qe,Bt):Jt===d||Jt===b||Jt===_?l(dt.valueOf(),ft.valueOf()):!1}return pt}function R(te,K,ie,ye){var Z=te.length;if(K.length!==Z)return!1;for(;Z-- >0;)if(!ie(te[Z],K[Z],Z,Z,te,K,ye))return!1;return!0}var E=o(R);function M(te,K){return l(te.valueOf(),K.valueOf())}function D(te,K,ie,ye){var Z=te.size===K.size;if(!Z)return!1;if(!te.size)return!0;var De={},Ne=0;return te.forEach(function(Ve,qe){if(Z){var pt=!1,dt=0;K.forEach(function(ft,Bt){!pt&&!De[dt]&&(pt=ie(qe,Bt,Ne,dt,te,K,ye)&&ie(Ve,ft,qe,Bt,te,K,ye))&&(De[dt]=!0),dt++}),Ne++,Z=pt}}),Z}var T=o(D),k="_owner",L=Object.prototype.hasOwnProperty;function W(te,K,ie,ye){var Z=Object.keys(te),De=Z.length;if(Object.keys(K).length!==De)return!1;for(var Ne;De-- >0;){if(Ne=Z[De],Ne===k){var Ve=!!te.$$typeof,qe=!!K.$$typeof;if((Ve||qe)&&Ve!==qe)return!1}if(!L.call(K,Ne)||!ie(te[Ne],K[Ne],Ne,Ne,te,K,ye))return!1}return!0}var Y=o(W);function ee(te,K){return te.source===K.source&&te.flags===K.flags}function X(te,K,ie,ye){var Z=te.size===K.size;if(!Z)return!1;if(!te.size)return!0;var De={};return te.forEach(function(Ne,Ve){if(Z){var qe=!1,pt=0;K.forEach(function(dt,ft){!qe&&!De[pt]&&(qe=ie(Ne,dt,Ve,ft,te,K,ye))&&(De[pt]=!0),pt++}),Z=qe}}),Z}var F=o(X),J=Object.freeze({areArraysEqual:R,areDatesEqual:M,areMapsEqual:D,areObjectsEqual:W,areRegExpsEqual:ee,areSetsEqual:X,createIsNestedEqual:r}),q=Object.freeze({areArraysEqual:E,areDatesEqual:M,areMapsEqual:T,areObjectsEqual:Y,areRegExpsEqual:ee,areSetsEqual:F,createIsNestedEqual:r}),Q=C(J);function ae(te,K){return Q(te,K,void 0)}var j=C(i(J,{createIsNestedEqual:function(){return l}}));function V(te,K){return j(te,K,void 0)}var oe=C(q);function ce(te,K){return oe(te,K,new WeakMap)}var ue=C(i(q,{createIsNestedEqual:function(){return l}}));function ge(te,K){return ue(te,K,new WeakMap)}function ve(te){return C(i(J,te(J)))}function fe(te){var K=C(i(q,te(q)));return function(ie,ye,Z){return Z===void 0&&(Z=new WeakMap),K(ie,ye,Z)}}n.circularDeepEqual=ce,n.circularShallowEqual=ge,n.createCustomCircularEqual=fe,n.createCustomEqual=ve,n.deepEqual=ae,n.sameValueZeroEqual=l,n.shallowEqual=V,Object.defineProperty(n,"__esModule",{value:!0})})})(Vv,Vv.exports);var c0=Vv.exports;const u0=Ub(uN);var at={},B9=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(at,"__esModule",{value:!0});at.bottom=d0;at.childrenEqual=Y9;at.cloneLayout=xR;at.cloneLayoutItem=Qs;at.collides=Qh;at.compact=_R;at.compactItem=SR;at.compactType=lL;at.correctBounds=CR;at.fastPositionEqual=X9;at.fastRGLPropsEqual=void 0;at.getAllCollisions=ER;at.getFirstCollision=zs;at.getLayoutItem=f0;at.getStatics=h0;at.modifyLayout=wR;at.moveElement=Ac;at.moveElementAwayFromCollision=Wv;at.noop=void 0;at.perc=Z9;at.resizeItemInDirection=oL;at.setTopLeft=sL;at.setTransform=iL;at.sortLayoutItems=y0;at.sortLayoutItemsByColRow=DR;at.sortLayoutItemsByRowCol=OR;at.synchronizeLayoutWithChildren=aL;at.validateLayout=MR;at.withLayoutItem=G9;var u_=c0,Tc=U9(m);function U9(e){return e&&e.__esModule?e:{default:e}}const q9=process.env.NODE_ENV==="production";function d0(e){let t=0,n;for(let r=0,o=e.length;r<o;r++)n=e[r].y+e[r].h,n>t&&(t=n);return t}function xR(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=Qs(e[n]);return t}function wR(e,t){const n=Array(e.length);for(let r=0,o=e.length;r<o;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function G9(e,t,n){let r=f0(e,t);return r?(r=n(Qs(r)),e=wR(e,r),[e,r]):[e,null]}function Qs(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 Y9(e,t){return(0,u_.deepEqual)(Tc.default.Children.map(e,n=>n==null?void 0:n.key),Tc.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,u_.deepEqual)(Tc.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),Tc.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}const K9=B9;at.fastRGLPropsEqual=K9;function X9(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function Qh(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 _R(e,t,n,r){const o=h0(e),i=y0(e,t),s=Array(e.length);for(let a=0,l=i.length;a<l;a++){let u=Qs(i[a]);u.static||(u=SR(o,u,t,n,i,r),o.push(u)),s[e.indexOf(i[a])]=u,u.moved=!1}return s}const Q9={x:"w",y:"h"};function Hv(e,t,n,r){const o=Q9[r];t[r]+=1;const i=e.map(s=>s.i).indexOf(t.i);for(let s=i+1;s<e.length;s++){const a=e[s];if(!a.static){if(a.y>t.y+t.h)break;Qh(t,a)&&Hv(e,a,n+t[o],r)}}t[r]=n}function SR(e,t,n,r,o,i){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(d0(e),t.y);t.y>0&&!zs(e,t);)t.y--;else if(a)for(;t.x>0&&!zs(e,t);)t.x--;let l;for(;(l=zs(e,t))&&!(n===null&&i);)if(a?Hv(o,t,l.x+l.w,"x"):Hv(o,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!zs(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function CR(e,t){const n=h0(e);for(let r=0,o=e.length;r<o;r++){const i=e[r];if(i.x+i.w>t.cols&&(i.x=t.cols-i.w),i.x<0&&(i.x=0,i.w=t.cols),!i.static)n.push(i);else for(;zs(n,i);)i.y++}return e}function f0(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function zs(e,t){for(let n=0,r=e.length;n<r;n++)if(Qh(e[n],t))return e[n]}function ER(e,t){return e.filter(n=>Qh(n,t))}function h0(e){return e.filter(t=>t.static)}function Ac(e,t,n,r,o,i,s,a,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;"Moving element ".concat(t.i," to [").concat(String(n),",").concat(String(r),"] from [").concat(t.x,",").concat(t.y,"]");const u=t.x,d=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let h=y0(e,s);(s==="vertical"&&typeof r=="number"?d>=r:s==="horizontal"&&typeof n=="number"?u>=n:!1)&&(h=h.reverse());const g=ER(h,t),b=g.length>0;if(b&&l)return xR(e);if(b&&i)return"Collision prevented on ".concat(t.i,", reverting."),t.x=u,t.y=d,t.moved=!1,e;for(let y=0,x=g.length;y<x;y++){const _=g[y];"Resolving collision between ".concat(t.i," at [").concat(t.x,",").concat(t.y,"] and ").concat(_.i," at [").concat(_.x,",").concat(_.y,"]"),!_.moved&&(_.static?e=Wv(e,_,t,o,s):e=Wv(e,t,_,o,s))}return e}function Wv(e,t,n,r,o,i){const s=o==="horizontal",a=o==="vertical",l=t.static;if(r){r=!1;const h={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=zs(e,h),g=p&&p.y+p.h>t.y,b=p&&t.x+t.w>p.x;if(p){if(g&&a)return Ac(e,n,void 0,t.y+1,r,l,o);if(g&&o==null)return t.y=n.y,n.y=n.y+n.h,e;if(b&&s)return Ac(e,t,n.x,void 0,r,l,o)}else return"Doing reverse collision on ".concat(n.i," up to [").concat(h.x,",").concat(h.y,"]."),Ac(e,n,s?h.x:void 0,a?h.y:void 0,r,l,o)}const u=s?n.x+1:void 0,d=a?n.y+1:void 0;return u==null&&d==null?e:Ac(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,o)}function Z9(e){return e*100+"%"}const RR=(e,t,n,r)=>e+n>r?t:n,$R=(e,t,n)=>e<0?t:n,PR=e=>Math.max(0,e),p0=e=>Math.max(0,e),g0=(e,t,n)=>{let{left:r,height:o,width:i}=t;const s=e.top-(o-e.height);return{left:r,width:i,height:$R(s,e.height,o),top:p0(s)}},m0=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{top:r,height:i,width:RR(e.left,e.width,s,n),left:PR(o)}},v0=(e,t,n)=>{let{top:r,height:o,width:i}=t;const s=e.left-(i-e.width);return{height:o,width:s<0?e.width:RR(e.left,e.width,i,n),top:p0(r),left:PR(s)}},b0=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{width:s,left:o,height:$R(r,e.height,i),top:p0(r)}},J9=function(){return g0(arguments.length<=0?void 0:arguments[0],m0(...arguments))},eL=function(){return g0(arguments.length<=0?void 0:arguments[0],v0(...arguments))},tL=function(){return b0(arguments.length<=0?void 0:arguments[0],m0(...arguments))},nL=function(){return b0(arguments.length<=0?void 0:arguments[0],v0(...arguments))},rL={n:g0,ne:J9,e:m0,se:tL,s:b0,sw:nL,w:v0,nw:eL};function oL(e,t,n,r){const o=rL[e];return o?o(t,{...t,...n},r):n}function iL(e){let{top:t,left:n,width:r,height:o}=e;const i="translate(".concat(n,"px,").concat(t,"px)");return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:"".concat(r,"px"),height:"".concat(o,"px"),position:"absolute"}}function sL(e){let{top:t,left:n,width:r,height:o}=e;return{top:"".concat(t,"px"),left:"".concat(n,"px"),width:"".concat(r,"px"),height:"".concat(o,"px"),position:"absolute"}}function y0(e,t){return t==="horizontal"?DR(e):t==="vertical"?OR(e):e}function OR(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 DR(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 aL(e,t,n,r,o){e=e||[];const i=[];Tc.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=f0(e,String(a.key)),u=a.props["data-grid"];l&&u==null?i.push(Qs(l)):u?(q9||MR([u],"ReactGridLayout.children"),i.push(Qs({...u,i:a.key}))):i.push(Qs({w:1,h:1,x:0,y:d0(i),i:String(a.key)}))});const s=CR(i,{cols:n});return o?s:_R(s,r,n)}function MR(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const n=["x","y","w","h"];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(let r=0,o=e.length;r<o;r++){const i=e[r];for(let s=0;s<n.length;s++)if(typeof i[n[s]]!="number")throw new Error("ReactGridLayout: "+t+"["+r+"]."+n[s]+" must be a number!")}}function lL(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const cL=()=>{};at.noop=cL;var Co={};Object.defineProperty(Co,"__esModule",{value:!0});Co.calcGridColWidth=Zh;Co.calcGridItemPosition=uL;Co.calcGridItemWHPx=Bv;Co.calcWH=fL;Co.calcXY=dL;Co.clamp=js;function Zh(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function Bv(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function uL(e,t,n,r,o,i){const{margin:s,containerPadding:a,rowHeight:l}=e,u=Zh(e),d={};return i&&i.resizing?(d.width=Math.round(i.resizing.width),d.height=Math.round(i.resizing.height)):(d.width=Bv(r,u,s[0]),d.height=Bv(o,l,s[1])),i&&i.dragging?(d.top=Math.round(i.dragging.top),d.left=Math.round(i.dragging.left)):i&&i.resizing&&typeof i.resizing.top=="number"&&typeof i.resizing.left=="number"?(d.top=Math.round(i.resizing.top),d.left=Math.round(i.resizing.left)):(d.top=Math.round((l+s[1])*n+a[1]),d.left=Math.round((u+s[0])*t+a[0])),d}function dL(e,t,n,r,o){const{margin:i,cols:s,rowHeight:a,maxRows:l}=e,u=Zh(e);let d=Math.round((n-i[0])/(u+i[0])),h=Math.round((t-i[1])/(a+i[1]));return d=js(d,0,s-r),h=js(h,0,l-o),{x:d,y:h}}function fL(e,t,n,r,o,i){const{margin:s,maxRows:a,cols:l,rowHeight:u}=e,d=Zh(e);let h=Math.round((t+s[0])/(d+s[0])),p=Math.round((n+s[1])/(u+s[1])),g=js(h,0,l-r),b=js(p,0,a-o);return["sw","w","nw"].indexOf(i)!==-1&&(g=js(h,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(b=js(p,0,a)),{w:g,h:b}}function js(e,t,n){return Math.max(Math.min(e,n),t)}var Jh={},Uv={exports:{}},um,d_;function x0(){if(d_)return um;d_=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return um=e,um}var dm,f_;function hL(){if(f_)return dm;f_=1;var e=x0();function t(){}function n(){}return n.resetWarningCache=t,dm=function(){function r(s,a,l,u,d,h){if(h!==e){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}r.isRequired=r;function o(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},dm}var Jd={exports:{}},xt={};/** @license React v16.13.1
|
|
88
|
+
}`;var et=A1(function(){return vt(A,Te+"return "+be).apply(n,N)});if(et.source=be,Wg(et))throw et;return et}function f3(c){return yt(c).toLowerCase()}function h3(c){return yt(c).toUpperCase()}function p3(c,f,v){if(c=yt(c),c&&(v||f===n))return Hx(c);if(!c||!(f=Zn(f)))return c;var S=Hr(c),P=Hr(f),A=Wx(S,P),N=Bx(S,P)+1;return vi(S,A,N).join("")}function g3(c,f,v){if(c=yt(c),c&&(v||f===n))return c.slice(0,qx(c)+1);if(!c||!(f=Zn(f)))return c;var S=Hr(c),P=Bx(S,Hr(f))+1;return vi(S,0,P).join("")}function m3(c,f,v){if(c=yt(c),c&&(v||f===n))return c.replace(ps,"");if(!c||!(f=Zn(f)))return c;var S=Hr(c),P=Wx(S,Hr(f));return vi(S,P).join("")}function v3(c,f){var v=L,S=W;if(Ht(f)){var P="separator"in f?f.separator:P;v="length"in f?Qe(f.length):v,S="omission"in f?Zn(f.omission):S}c=yt(c);var A=c.length;if(Ra(c)){var N=Hr(c);A=N.length}if(v>=A)return c;var z=v-$a(S);if(z<1)return S;var G=N?vi(N,0,z).join(""):c.slice(0,z);if(P===n)return G+S;if(N&&(z+=G.length-z),Bg(P)){if(c.slice(z).search(P)){var he,pe=G;for(P.global||(P=sg(P.source,yt(Ae.exec(P))+"g")),P.lastIndex=0;he=P.exec(pe);)var be=he.index;G=G.slice(0,be===n?z:be)}}else if(c.indexOf(Zn(P),z)!=z){var Re=G.lastIndexOf(P);Re>-1&&(G=G.slice(0,Re))}return G+S}function b3(c){return c=yt(c),c&&To.test(c)?c.replace(wn,GT):c}var y3=Ia(function(c,f,v){return c+(v?" ":"")+f.toUpperCase()}),Gg=Iw("toUpperCase");function T1(c,f,v){return c=yt(c),f=v?n:f,f===n?HT(c)?XT(c):AT(c):c.match(f)||[]}var A1=rt(function(c,f){try{return Xn(c,n,f)}catch(v){return Wg(v)?v:new Ue(v)}}),x3=Lo(function(c,f){return wr(f,function(v){v=so(v),ko(c,v,Vg(c[v],c))}),c});function w3(c){var f=c==null?0:c.length,v=Le();return c=f?jt(c,function(S){if(typeof S[1]!="function")throw new _r(s);return[v(S[0]),S[1]]}):[],rt(function(S){for(var P=-1;++P<f;){var A=c[P];if(Xn(A[0],this,S))return Xn(A[1],this,S)}})}function _3(c){return G5(Cr(c,h))}function Yg(c){return function(){return c}}function S3(c,f){return c==null||c!==c?f:c}var C3=Nw(),E3=Nw(!0);function zn(c){return c}function Kg(c){return fw(typeof c=="function"?c:Cr(c,h))}function R3(c){return pw(Cr(c,h))}function $3(c,f){return gw(c,Cr(f,h))}var P3=rt(function(c,f){return function(v){return ac(v,c,f)}}),O3=rt(function(c,f){return function(v){return ac(c,v,f)}});function Xg(c,f,v){var S=ln(f),P=Pd(f,S);v==null&&!(Ht(f)&&(P.length||!S.length))&&(v=f,f=c,c=this,P=Pd(f,ln(f)));var A=!(Ht(v)&&"chain"in v)||!!v.chain,N=zo(c);return wr(P,function(z){var G=f[z];c[z]=G,N&&(c.prototype[z]=function(){var he=this.__chain__;if(A||he){var pe=c(this.__wrapped__),be=pe.__actions__=Nn(this.__actions__);return be.push({func:G,args:arguments,thisArg:c}),pe.__chain__=he,pe}return G.apply(c,di([this.value()],arguments))})}),c}function D3(){return hn._===this&&(hn._=n5),this}function Qg(){}function M3(c){return c=Qe(c),rt(function(f){return mw(f,c)})}var T3=Pg(jt),A3=Pg(Lx),I3=Pg(Jp);function I1(c){return kg(c)?eg(so(c)):uA(c)}function k3(c){return function(f){return c==null?n:ws(c,f)}}var N3=Fw(),L3=Fw(!0);function Zg(){return[]}function Jg(){return!1}function F3(){return{}}function z3(){return""}function j3(){return!0}function V3(c,f){if(c=Qe(c),c<1||c>Q)return[];var v=V,S=_n(c,V);f=Le(f),c-=V;for(var P=rg(S,f);++v<c;)f(v);return P}function H3(c){return Ye(c)?jt(c,so):Jn(c)?[c]:Nn(e1(yt(c)))}function W3(c){var f=++e5;return yt(c)+f}var B3=Id(function(c,f){return c+f},0),U3=Og("ceil"),q3=Id(function(c,f){return c/f},1),G3=Og("floor");function Y3(c){return c&&c.length?$d(c,zn,pg):n}function K3(c,f){return c&&c.length?$d(c,Le(f,2),pg):n}function X3(c){return jx(c,zn)}function Q3(c,f){return jx(c,Le(f,2))}function Z3(c){return c&&c.length?$d(c,zn,bg):n}function J3(c,f){return c&&c.length?$d(c,Le(f,2),bg):n}var eN=Id(function(c,f){return c*f},1),tN=Og("round"),nN=Id(function(c,f){return c-f},0);function rN(c){return c&&c.length?ng(c,zn):0}function oN(c,f){return c&&c.length?ng(c,Le(f,2)):0}return O.after=Rk,O.ary=d1,O.assign=h7,O.assignIn=E1,O.assignInWith=Gd,O.assignWith=p7,O.at=g7,O.before=f1,O.bind=Vg,O.bindAll=x3,O.bindKey=h1,O.castArray=Fk,O.chain=l1,O.chunk=GA,O.compact=YA,O.concat=KA,O.cond=w3,O.conforms=_3,O.constant=Yg,O.countBy=rk,O.create=m7,O.curry=p1,O.curryRight=g1,O.debounce=m1,O.defaults=v7,O.defaultsDeep=b7,O.defer=$k,O.delay=Pk,O.difference=XA,O.differenceBy=QA,O.differenceWith=ZA,O.drop=JA,O.dropRight=eI,O.dropRightWhile=tI,O.dropWhile=nI,O.fill=rI,O.filter=ik,O.flatMap=lk,O.flatMapDeep=ck,O.flatMapDepth=uk,O.flatten=o1,O.flattenDeep=oI,O.flattenDepth=iI,O.flip=Ok,O.flow=C3,O.flowRight=E3,O.fromPairs=sI,O.functions=E7,O.functionsIn=R7,O.groupBy=dk,O.initial=lI,O.intersection=cI,O.intersectionBy=uI,O.intersectionWith=dI,O.invert=P7,O.invertBy=O7,O.invokeMap=hk,O.iteratee=Kg,O.keyBy=pk,O.keys=ln,O.keysIn=Fn,O.map=Vd,O.mapKeys=M7,O.mapValues=T7,O.matches=R3,O.matchesProperty=$3,O.memoize=Wd,O.merge=A7,O.mergeWith=R1,O.method=P3,O.methodOf=O3,O.mixin=Xg,O.negate=Bd,O.nthArg=M3,O.omit=I7,O.omitBy=k7,O.once=Dk,O.orderBy=gk,O.over=T3,O.overArgs=Mk,O.overEvery=A3,O.overSome=I3,O.partial=Hg,O.partialRight=v1,O.partition=mk,O.pick=N7,O.pickBy=$1,O.property=I1,O.propertyOf=k3,O.pull=gI,O.pullAll=s1,O.pullAllBy=mI,O.pullAllWith=vI,O.pullAt=bI,O.range=N3,O.rangeRight=L3,O.rearg=Tk,O.reject=yk,O.remove=yI,O.rest=Ak,O.reverse=zg,O.sampleSize=wk,O.set=F7,O.setWith=z7,O.shuffle=_k,O.slice=xI,O.sortBy=Ek,O.sortedUniq=$I,O.sortedUniqBy=PI,O.split=l3,O.spread=Ik,O.tail=OI,O.take=DI,O.takeRight=MI,O.takeRightWhile=TI,O.takeWhile=AI,O.tap=YI,O.throttle=kk,O.thru=jd,O.toArray=_1,O.toPairs=P1,O.toPairsIn=O1,O.toPath=H3,O.toPlainObject=C1,O.transform=j7,O.unary=Nk,O.union=II,O.unionBy=kI,O.unionWith=NI,O.uniq=LI,O.uniqBy=FI,O.uniqWith=zI,O.unset=V7,O.unzip=jg,O.unzipWith=a1,O.update=H7,O.updateWith=W7,O.values=La,O.valuesIn=B7,O.without=jI,O.words=T1,O.wrap=Lk,O.xor=VI,O.xorBy=HI,O.xorWith=WI,O.zip=BI,O.zipObject=UI,O.zipObjectDeep=qI,O.zipWith=GI,O.entries=P1,O.entriesIn=O1,O.extend=E1,O.extendWith=Gd,Xg(O,O),O.add=B3,O.attempt=A1,O.camelCase=Y7,O.capitalize=D1,O.ceil=U3,O.clamp=U7,O.clone=zk,O.cloneDeep=Vk,O.cloneDeepWith=Hk,O.cloneWith=jk,O.conformsTo=Wk,O.deburr=M1,O.defaultTo=S3,O.divide=q3,O.endsWith=K7,O.eq=Br,O.escape=X7,O.escapeRegExp=Q7,O.every=ok,O.find=sk,O.findIndex=n1,O.findKey=y7,O.findLast=ak,O.findLastIndex=r1,O.findLastKey=x7,O.floor=G3,O.forEach=c1,O.forEachRight=u1,O.forIn=w7,O.forInRight=_7,O.forOwn=S7,O.forOwnRight=C7,O.get=Ug,O.gt=Bk,O.gte=Uk,O.has=$7,O.hasIn=qg,O.head=i1,O.identity=zn,O.includes=fk,O.indexOf=aI,O.inRange=q7,O.invoke=D7,O.isArguments=Cs,O.isArray=Ye,O.isArrayBuffer=qk,O.isArrayLike=Ln,O.isArrayLikeObject=Yt,O.isBoolean=Gk,O.isBuffer=bi,O.isDate=Yk,O.isElement=Kk,O.isEmpty=Xk,O.isEqual=Qk,O.isEqualWith=Zk,O.isError=Wg,O.isFinite=Jk,O.isFunction=zo,O.isInteger=b1,O.isLength=Ud,O.isMap=y1,O.isMatch=e7,O.isMatchWith=t7,O.isNaN=n7,O.isNative=r7,O.isNil=i7,O.isNull=o7,O.isNumber=x1,O.isObject=Ht,O.isObjectLike=Ut,O.isPlainObject=hc,O.isRegExp=Bg,O.isSafeInteger=s7,O.isSet=w1,O.isString=qd,O.isSymbol=Jn,O.isTypedArray=Na,O.isUndefined=a7,O.isWeakMap=l7,O.isWeakSet=c7,O.join=fI,O.kebabCase=Z7,O.last=Rr,O.lastIndexOf=hI,O.lowerCase=J7,O.lowerFirst=e3,O.lt=u7,O.lte=d7,O.max=Y3,O.maxBy=K3,O.mean=X3,O.meanBy=Q3,O.min=Z3,O.minBy=J3,O.stubArray=Zg,O.stubFalse=Jg,O.stubObject=F3,O.stubString=z3,O.stubTrue=j3,O.multiply=eN,O.nth=pI,O.noConflict=D3,O.noop=Qg,O.now=Hd,O.pad=t3,O.padEnd=n3,O.padStart=r3,O.parseInt=o3,O.random=G7,O.reduce=vk,O.reduceRight=bk,O.repeat=i3,O.replace=s3,O.result=L7,O.round=tN,O.runInContext=B,O.sample=xk,O.size=Sk,O.snakeCase=a3,O.some=Ck,O.sortedIndex=wI,O.sortedIndexBy=_I,O.sortedIndexOf=SI,O.sortedLastIndex=CI,O.sortedLastIndexBy=EI,O.sortedLastIndexOf=RI,O.startCase=c3,O.startsWith=u3,O.subtract=nN,O.sum=rN,O.sumBy=oN,O.template=d3,O.times=V3,O.toFinite=jo,O.toInteger=Qe,O.toLength=S1,O.toLower=f3,O.toNumber=$r,O.toSafeInteger=f7,O.toString=yt,O.toUpper=h3,O.trim=p3,O.trimEnd=g3,O.trimStart=m3,O.truncate=v3,O.unescape=b3,O.uniqueId=W3,O.upperCase=y3,O.upperFirst=Gg,O.each=c1,O.eachRight=u1,O.first=i1,Xg(O,function(){var c={};return oo(O,function(f,v){St.call(O.prototype,v)||(c[v]=f)}),c}(),{chain:!1}),O.VERSION=r,wr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(c){O[c].placeholder=O}),wr(["drop","take"],function(c,f){ut.prototype[c]=function(v){v=v===n?1:tn(Qe(v),0);var S=this.__filtered__&&!f?new ut(this):this.clone();return S.__filtered__?S.__takeCount__=_n(v,S.__takeCount__):S.__views__.push({size:_n(v,V),type:c+(S.__dir__<0?"Right":"")}),S},ut.prototype[c+"Right"]=function(v){return this.reverse()[c](v).reverse()}}),wr(["filter","map","takeWhile"],function(c,f){var v=f+1,S=v==X||v==J;ut.prototype[c]=function(P){var A=this.clone();return A.__iteratees__.push({iteratee:Le(P,3),type:v}),A.__filtered__=A.__filtered__||S,A}}),wr(["head","last"],function(c,f){var v="take"+(f?"Right":"");ut.prototype[c]=function(){return this[v](1).value()[0]}}),wr(["initial","tail"],function(c,f){var v="drop"+(f?"":"Right");ut.prototype[c]=function(){return this.__filtered__?new ut(this):this[v](1)}}),ut.prototype.compact=function(){return this.filter(zn)},ut.prototype.find=function(c){return this.filter(c).head()},ut.prototype.findLast=function(c){return this.reverse().find(c)},ut.prototype.invokeMap=rt(function(c,f){return typeof c=="function"?new ut(this):this.map(function(v){return ac(v,c,f)})}),ut.prototype.reject=function(c){return this.filter(Bd(Le(c)))},ut.prototype.slice=function(c,f){c=Qe(c);var v=this;return v.__filtered__&&(c>0||f<0)?new ut(v):(c<0?v=v.takeRight(-c):c&&(v=v.drop(c)),f!==n&&(f=Qe(f),v=f<0?v.dropRight(-f):v.take(f-c)),v)},ut.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},ut.prototype.toArray=function(){return this.take(V)},oo(ut.prototype,function(c,f){var v=/^(?:filter|find|map|reject)|While$/.test(f),S=/^(?:head|last)$/.test(f),P=O[S?"take"+(f=="last"?"Right":""):f],A=S||/^find/.test(f);P&&(O.prototype[f]=function(){var N=this.__wrapped__,z=S?[1]:arguments,G=N instanceof ut,he=z[0],pe=G||Ye(N),be=function(lt){var ht=P.apply(O,di([lt],z));return S&&Re?ht[0]:ht};pe&&v&&typeof he=="function"&&he.length!=1&&(G=pe=!1);var Re=this.__chain__,Te=!!this.__actions__.length,Fe=A&&!Re,et=G&&!Te;if(!A&&pe){N=et?N:new ut(this);var ze=c.apply(N,z);return ze.__actions__.push({func:jd,args:[be],thisArg:n}),new Sr(ze,Re)}return Fe&&et?c.apply(this,z):(ze=this.thru(be),Fe?S?ze.value()[0]:ze.value():ze)})}),wr(["pop","push","shift","sort","splice","unshift"],function(c){var f=fd[c],v=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",S=/^(?:pop|shift)$/.test(c);O.prototype[c]=function(){var P=arguments;if(S&&!this.__chain__){var A=this.value();return f.apply(Ye(A)?A:[],P)}return this[v](function(N){return f.apply(Ye(N)?N:[],P)})}}),oo(ut.prototype,function(c,f){var v=O[f];if(v){var S=v.name+"";St.call(Ma,S)||(Ma[S]=[]),Ma[S].push({name:f,func:v})}}),Ma[Ad(n,_).name]=[{name:"wrapper",func:n}],ut.prototype.clone=b5,ut.prototype.reverse=y5,ut.prototype.value=x5,O.prototype.at=KI,O.prototype.chain=XI,O.prototype.commit=QI,O.prototype.next=ZI,O.prototype.plant=ek,O.prototype.reverse=tk,O.prototype.toJSON=O.prototype.valueOf=O.prototype.value=nk,O.prototype.first=O.prototype.head,ec&&(O.prototype[ec]=JI),O},Pa=QT();ms?((ms.exports=Pa)._=Pa,Kp._=Pa):hn._=Pa}).call(Ns)})(ah,ah.exports);var Za=ah.exports;const Wi=Lu(Za),t_=["lg","md","sm","xs","xxs"],Ce=AE()(jE((e,t)=>({isSessionExpired:!1,currentBreakpoint:"lg",dashboard:{id:"",style:Rv},showContext:!1,selectedSheetId:null,selectedCardId:null,selectedFrameId:null,selectedCard:null,showFilters:!1,isDashboardEditing:!1,isVisualEditing:!1,showDashboardJSON:!1,filteringCards:[],actions:{setIsSessionExpired:n=>{e(()=>({isSessionExpired:n}))},setCardPython:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===o.selectedSheetId);i&&Za.forEach(i.frames,l=>{var d;const u=(d=l.cards)==null?void 0:d.find(h=>h.id===n);u&&(u.python=r)})})},addBaseQuery:n=>{e(r=>{var o;r.dashboard.baseQueries||(r.dashboard.baseQueries=[]),(o=r.dashboard.baseQueries)==null||o.push(n)})},removeBaseQuery:n=>{e(r=>{var i,s;const o=(i=r.dashboard.baseQueries)==null?void 0:i.findIndex(a=>a.id===n);o!=null&&o>-1&&((s=r.dashboard.baseQueries)==null||s.splice(o,1))})},setBaseQueries:n=>{e(r=>{r.dashboard.baseQueries=n})},setCurrentBreakpoint:n=>{e(()=>({currentBreakpoint:n}))},addFilteringCard:n=>{e(r=>{var o;(o=r.filteringCards)==null||o.push(n)})},removeFilteringCard:n=>{e(r=>{var i,s;const o=(i=r.filteringCards)==null?void 0:i.findIndex(a=>a.id===n.id);o!==void 0&&o>-1&&((s=r.filteringCards)==null||s.splice(o,1))})},setCustomCards:n=>{e(r=>{r.dashboard.customCards=n})},setAuthToken:n=>{e(()=>({authToken:n}))},setThemeStyle:n=>{e(()=>({themeStyle:n}))},setDashboard:n=>e({dashboard:n}),setBookmarkKey:n=>{e(()=>({bookmarkKey:n}))},setDashboardTheme:n=>{e(r=>{r.theme=n})},setSheets:n=>{e(r=>{r.dashboard&&(r.dashboard.sheets=n)})},setCardTitle:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(u=>u.id===n);s&&Za.forEach(s.frames,u=>{var h;const d=(h=u.cards)==null?void 0:h.find(p=>p.id===r);d&&(d.title=o)})})},setCardInfo:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===o.selectedSheetId);i&&Za.forEach(i.frames,l=>{var d;const u=(d=l.cards)==null?void 0:d.find(h=>h.id===n);u&&(u.info=r)})})},setCardDescription:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(u=>u.id===n);s&&Za.forEach(s.frames,u=>{var h;const d=(h=u.cards)==null?void 0:h.find(p=>p.id===r);d&&(d.description=o)})})},setCardSql:(n,r,o)=>{e(i=>{var a,l,u,d;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(h=>h.id===n);if(s){const h=(u=s.cards)==null?void 0:u.find(p=>p.id===r);h&&(h.sql=o,(d=i.onUpdateCard)==null||d.call(i,h,n))}})},setFrameCardData:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(u=>u.id===n);s&&Za.forEach(s.frames,u=>{var h;const d=(h=u.cards)==null?void 0:h.find(p=>p.id===r);d&&(d.data=o)})})},setSheetLayout:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layout=r)})},setSheetLayouts:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layouts=r)})},setShowContext:n=>{e(()=>({showContext:n}))},setShowFilters:n=>{e(()=>({showFilters:n}))},setFilterValues:n=>{e(()=>({filterValues:n}))},addOrUpdateFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1?r.filterValues.splice(o,1,n):r.filterValues.push(n)}else r.filterValues=[n]})},addOrUpdateFilterValues:n=>{e(r=>{r.filterValues?n.forEach(o=>{var s,a,l;const i=(s=r==null?void 0:r.filterValues)==null?void 0:s.findIndex(u=>u.filterId===o.filterId);i!==void 0&&i>-1?(a=r.filterValues)==null||a.splice(i,1,o):(l=r.filterValues)==null||l.push(o)}):r.filterValues=n})},removeFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.filter(i=>i.filterId!==n&&!i.filterId.startsWith(n));r.filterValues=o}})},replaceFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1&&r.filterValues.splice(o,1,n)}})},addFilter:n=>{e(r=>{var o;r.dashboard.filters?(o=r.dashboard.filters)==null||o.push(n):r.dashboard.filters=[n]})},removeFilter:n=>{e(r=>{var o,i;if(r.dashboard.filters){const s=(o=r.dashboard.filters)==null?void 0:o.findIndex(a=>a.id===n);console.log("index",s),s>-1&&((i=r.dashboard.filters)==null||i.splice(s,1))}})},updateFrameCard:(n,r,o)=>{e(i=>{var l,u,d,h,p;const s=(u=(l=i.dashboard)==null?void 0:l.sheets)==null?void 0:u.find(g=>g.id===n);if(!s)return;const a=(d=s==null?void 0:s.frames)==null?void 0:d.find(g=>g.id===r);if(a){const g=(h=a.cards)==null?void 0:h.findIndex(b=>b.id===o.id);g>-1&&((p=a.cards)==null||p.splice(g,1,o))}})},updateFilter:n=>{e(r=>{var o,i;if(r.dashboard.filters){const s=(o=r.dashboard.filters)==null?void 0:o.findIndex(a=>a.id===n.id);s>-1&&((i=r.dashboard.filters)==null||i.splice(s,1,n))}})},setIsDashboardEditing:n=>{e(()=>({isDashboardEditing:n}))},setShowDashboardJSON:n=>{e(()=>({showDashboardJSON:n}))},setIsVisualEditing:n=>{e(()=>({isVisualEditing:n}))},addFrame:(n,r)=>{e(o=>{var s,a,l,u,d;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(h=>h.id===n);if(i){i.frames||(i.frames=[]),(l=i.frames)==null||l.push(r);const h={i:r.id,x:0,y:1/0,w:20,h:7,minW:6,minH:2};(u=i.layout)==null||u.push(h),i!=null&&i.layouts||(i.layouts={}),t_.forEach(p=>{i.layouts[p]||(i.layouts[p]=[]),i.layouts[p].push(h)}),(d=o.onAddFrame)==null||d.call(o,r,n)}})},removeFrame:(n,r)=>{e(o=>{var s,a,l,u,d;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(h=>h.id===n);if(i){const h=(l=i.frames)==null?void 0:l.findIndex(p=>p.id===r);console.log(h),typeof h=="number"&&h>-1&&((u=i.frames)==null||u.splice(h,1),(d=i.layout)==null||d.splice(h,1),i.layouts=t_.reduce((p,g)=>{if(p&&p[g]){const b=p[g].findIndex(y=>y.i===r);typeof b=="number"&&b>-1&&p[g].splice(b,1)}return p},i.layouts))}})},updateFrame:(n,r)=>{e(o=>{var a,l,u,d;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(h=>h.id===n),s=(u=i==null?void 0:i.frames)==null?void 0:u.findIndex(h=>h.id===r.id);i&&((d=i.frames)==null||d.splice(s,1,r))})},updateCard:(n,r)=>{e(o=>{var a,l,u,d,h;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(p=>p.id===n),s=(u=i==null?void 0:i.cards)==null?void 0:u.findIndex(p=>p.id===r.id);i&&((d=i.cards)==null||d.splice(s,1,r),(h=o.onUpdateCard)==null||h.call(o,r,n))})},removeCard:(n,r)=>{e(o=>{var a,l,u,d,h,p;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(g=>g.id===n),s=(u=i==null?void 0:i.cards)==null?void 0:u.findIndex(g=>g.id===r.id);i&&((d=i.cards)==null||d.splice(s,1),(h=i.layout)==null||h.splice(s,1),(p=o.onRemoveCard)==null||p.call(o,r,n))})},setStyle:n=>{e(r=>{r.dashboard&&(r.dashboard.style=n)})},setSelectedCardId:(n,r)=>{e(o=>{var s,a,l;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(u=>u.id===n);i&&(((l=i.cards)==null?void 0:l.find(d=>d.id===r))?o.selectedCardId=r:o.selectedCardId=null)})},setSelectedFrameId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(a=>a.id===r.selectedSheetId))&&(r.selectedFrameId=n)})},setSelectedSheetId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(a=>a.id===n))&&(r.selectedSheetId=n)})},setOnSaveFunction:n=>{e(()=>({onSaveFunction:n}))},setOnAddCard:n=>{e(()=>({onAddCard:n}))},setOnUpdateCard:n=>{e(()=>({onUpdateCard:n}))},setOnRemoveCard:n=>{e(()=>({onRemoveCard:n}))},setOnEvent:n=>{e(()=>({onEvent:n}))},getDashboard:()=>t().dashboard,getSelectedSheet:()=>{var n,r;return(r=(n=t().dashboard)==null?void 0:n.sheets)==null?void 0:r.find(o=>o.id===t().selectedSheetId)},getSelectedFrame:()=>{var r,o,i;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(s=>s.id===t().selectedSheetId);return(i=n==null?void 0:n.frames)==null?void 0:i.find(s=>s.id===t().selectedFrameId)},getCard:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a)for(let l=0;l<a.length;l++){const u=(i=a[l].cards)==null?void 0:i.find(d=>d.id===n);if(u)return u}}},getSelectedSheetLayout:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layout},getSelectedSheetLayouts:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layouts},getStyle:()=>{var n;return(n=t().dashboard)==null?void 0:n.style},handleDataPointClickAction:(n,r)=>{R6({card:n,dataPoint:r,set:e,get:t})}}}))),Xi=()=>Ce(e=>e.actions);var zu=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(){}},El=typeof window>"u"||"Deno"in window;function Tr(){}function $6(e,t){return typeof e=="function"?e(t):e}function $v(e){return typeof e=="number"&&e>=0&&e!==1/0}function qE(e,t){return Math.max(e+(t||0)-Date.now(),0)}function n_(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==Zb(s,t.options))return!1}else if(!ou(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||typeof o<"u"&&o!==t.state.fetchStatus||i&&!i(t))}function r_(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(ru(t.options.mutationKey)!==ru(i))return!1}else if(!ou(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Zb(e,t){return((t==null?void 0:t.queryKeyHashFn)||ru)(e)}function ru(e){return JSON.stringify(e,(t,n)=>Ov(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function ou(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!ou(e[n],t[n])):!1}function GE(e,t){if(e===t)return e;const n=o_(e)&&o_(t);if(n||Ov(e)&&Ov(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),s=i.length,a=n?[]:{};let l=0;for(let u=0;u<s;u++){const d=n?u:i[u];!n&&e[d]===void 0&&t[d]===void 0&&r.includes(d)?(a[d]=void 0,l++):(a[d]=GE(e[d],t[d]),a[d]===e[d]&&e[d]!==void 0&&l++)}return o===s&&l===o?e:a}return t}function Pv(e,t){if(e&&!t||t&&!e)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function o_(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ov(e){if(!i_(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!i_(n)||!n.hasOwnProperty("isPrototypeOf"))}function i_(e){return Object.prototype.toString.call(e)==="[object Object]"}function P6(e){return new Promise(t=>{setTimeout(t,e)})}function Dv(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?GE(e,t):t}function O6(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function D6(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Ws,Pi,al,pE,M6=(pE=class extends zu{constructor(){super();Ie(this,Ws,void 0);Ie(this,Pi,void 0);Ie(this,al,void 0);Pe(this,al,t=>{if(!El&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){U(this,Pi)||this.setEventListener(U(this,al))}onUnsubscribe(){var t;this.hasListeners()||((t=U(this,Pi))==null||t.call(this),Pe(this,Pi,void 0))}setEventListener(t){var n;Pe(this,al,t),(n=U(this,Pi))==null||n.call(this),Pe(this,Pi,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){U(this,Ws)!==t&&(Pe(this,Ws,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof U(this,Ws)=="boolean"?U(this,Ws):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ws=new WeakMap,Pi=new WeakMap,al=new WeakMap,pE),lh=new M6,ll,Oi,cl,gE,T6=(gE=class extends zu{constructor(){super();Ie(this,ll,!0);Ie(this,Oi,void 0);Ie(this,cl,void 0);Pe(this,cl,t=>{if(!El&&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(){U(this,Oi)||this.setEventListener(U(this,cl))}onUnsubscribe(){var t;this.hasListeners()||((t=U(this,Oi))==null||t.call(this),Pe(this,Oi,void 0))}setEventListener(t){var n;Pe(this,cl,t),(n=U(this,Oi))==null||n.call(this),Pe(this,Oi,t(this.setOnline.bind(this)))}setOnline(t){U(this,ll)!==t&&(Pe(this,ll,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return U(this,ll)}},ll=new WeakMap,Oi=new WeakMap,cl=new WeakMap,gE),ch=new T6;function A6(e){return Math.min(1e3*2**e,3e4)}function qh(e){return(e??"online")==="online"?ch.isOnline():!0}var YE=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function lm(e){return e instanceof YE}function KE(e){let t=!1,n=0,r=!1,o,i,s;const a=new Promise((x,_)=>{i=x,s=_}),l=x=>{var _;r||(g(new YE(x)),(_=e.abort)==null||_.call(e))},u=()=>{t=!0},d=()=>{t=!1},h=()=>!lh.isFocused()||e.networkMode!=="always"&&!ch.isOnline(),p=x=>{var _;r||(r=!0,(_=e.onSuccess)==null||_.call(e,x),o==null||o(),i(x))},g=x=>{var _;r||(r=!0,(_=e.onError)==null||_.call(e,x),o==null||o(),s(x))},b=()=>new Promise(x=>{var _;o=w=>{const C=r||!h();return C&&x(w),C},(_=e.onPause)==null||_.call(e)}).then(()=>{var x;o=void 0,r||(x=e.onContinue)==null||x.call(e)}),y=()=>{if(r)return;let x;try{x=e.fn()}catch(_){x=Promise.reject(_)}Promise.resolve(x).then(p).catch(_=>{var M;if(r)return;const w=e.retry??(El?0:3),C=e.retryDelay??A6,R=typeof C=="function"?C(n,_):C,E=w===!0||typeof w=="number"&&n<w||typeof w=="function"&&w(n,_);if(t||!E){g(_);return}n++,(M=e.onFail)==null||M.call(e,n,_),P6(R).then(()=>{if(h())return b()}).then(()=>{t?g(_):y()})})};return qh(e.networkMode)?y():b().then(y),{promise:a,cancel:l,continue:()=>(o==null?void 0:o())?a:Promise.resolve(),cancelRetry:u,continueRetry:d}}function I6(){let e=[],t=0,n=p=>{p()},r=p=>{p()},o=p=>setTimeout(p,0);const i=p=>{o=p},s=p=>{let g;t++;try{g=p()}finally{t--,t||u()}return g},a=p=>{t?e.push(p):o(()=>{n(p)})},l=p=>(...g)=>{a(()=>{p(...g)})},u=()=>{const p=e;e=[],p.length&&o(()=>{r(()=>{p.forEach(g=>{n(g)})})})};return{batch:s,batchCalls:l,schedule:a,setNotifyFunction:p=>{n=p},setBatchNotifyFunction:p=>{r=p},setScheduler:i}}var vn=I6(),Bs,mE,XE=(mE=class{constructor(){Ie(this,Bs,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),$v(this.gcTime)&&Pe(this,Bs,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(El?1/0:5*60*1e3))}clearGcTimeout(){U(this,Bs)&&(clearTimeout(U(this,Bs)),Pe(this,Bs,void 0))}},Bs=new WeakMap,mE),ul,dl,Or,Di,Dr,cn,Eu,Us,fl,Wf,Yr,Uo,vE,k6=(vE=class extends XE{constructor(t){super();Ie(this,fl);Ie(this,Yr);Ie(this,ul,void 0);Ie(this,dl,void 0);Ie(this,Or,void 0);Ie(this,Di,void 0);Ie(this,Dr,void 0);Ie(this,cn,void 0);Ie(this,Eu,void 0);Ie(this,Us,void 0);Pe(this,Us,!1),Pe(this,Eu,t.defaultOptions),ot(this,fl,Wf).call(this,t.options),Pe(this,cn,[]),Pe(this,Or,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Pe(this,ul,t.state||N6(this.options)),this.state=U(this,ul),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!U(this,cn).length&&this.state.fetchStatus==="idle"&&U(this,Or).remove(this)}setData(t,n){const r=Dv(this.state.data,t,this.options);return ot(this,Yr,Uo).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){ot(this,Yr,Uo).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=U(this,Di);return(r=U(this,Dr))==null||r.cancel(t),n?n.then(Tr).catch(Tr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(U(this,ul))}isActive(){return U(this,cn).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||U(this,cn).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!qE(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=U(this,cn).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=U(this,Dr))==null||n.continue()}onOnline(){var n;const t=U(this,cn).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=U(this,Dr))==null||n.continue()}addObserver(t){U(this,cn).includes(t)||(U(this,cn).push(t),this.clearGcTimeout(),U(this,Or).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){U(this,cn).includes(t)&&(Pe(this,cn,U(this,cn).filter(n=>n!==t)),U(this,cn).length||(U(this,Dr)&&(U(this,Us)?U(this,Dr).cancel({revert:!0}):U(this,Dr).cancelRetry()),this.scheduleGc()),U(this,Or).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return U(this,cn).length}invalidate(){this.state.isInvalidated||ot(this,Yr,Uo).call(this,{type:"invalidate"})}fetch(t,n){var u,d,h,p;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(U(this,Di))return(u=U(this,Dr))==null||u.continueRetry(),U(this,Di)}if(t&&ot(this,fl,Wf).call(this,t),!this.options.queryFn){const g=U(this,cn).find(b=>b.options.queryFn);g&&ot(this,fl,Wf).call(this,g.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,o={queryKey:this.queryKey,meta:this.meta},i=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>(Pe(this,Us,!0),r.signal)})};i(o);const s=()=>this.options.queryFn?(Pe(this,Us,!1),this.options.persister?this.options.persister(this.options.queryFn,o,this):this.options.queryFn(o)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),a={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(a),(d=this.options.behavior)==null||d.onFetch(a,this),Pe(this,dl,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=a.fetchOptions)==null?void 0:h.meta))&&ot(this,Yr,Uo).call(this,{type:"fetch",meta:(p=a.fetchOptions)==null?void 0:p.meta});const l=g=>{var b,y,x,_;lm(g)&&g.silent||ot(this,Yr,Uo).call(this,{type:"error",error:g}),lm(g)||((y=(b=U(this,Or).config).onError)==null||y.call(b,g,this),(_=(x=U(this,Or).config).onSettled)==null||_.call(x,this.state.data,g,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return Pe(this,Dr,KE({fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:g=>{var b,y,x,_;if(typeof g>"u"){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),l(new Error(`${this.queryHash} data is undefined`));return}this.setData(g),(y=(b=U(this,Or).config).onSuccess)==null||y.call(b,g,this),(_=(x=U(this,Or).config).onSettled)==null||_.call(x,g,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(g,b)=>{ot(this,Yr,Uo).call(this,{type:"failed",failureCount:g,error:b})},onPause:()=>{ot(this,Yr,Uo).call(this,{type:"pause"})},onContinue:()=>{ot(this,Yr,Uo).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),Pe(this,Di,U(this,Dr).promise),U(this,Di)}},ul=new WeakMap,dl=new WeakMap,Or=new WeakMap,Di=new WeakMap,Dr=new WeakMap,cn=new WeakMap,Eu=new WeakMap,Us=new WeakMap,fl=new WeakSet,Wf=function(t){this.options={...U(this,Eu),...t},this.updateGcTime(this.options.gcTime)},Yr=new WeakSet,Uo=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:t.meta??null,fetchStatus:qh(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return lm(o)&&o.revert&&U(this,dl)?{...U(this,dl),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),vn.batch(()=>{U(this,cn).forEach(r=>{r.onQueryUpdate()}),U(this,Or).notify({query:this,type:"updated",action:t})})},vE);function N6(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var uo,bE,QE=(bE=class extends zu{constructor(t={}){super();Ie(this,uo,void 0);this.config=t,Pe(this,uo,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??Zb(o,n);let s=this.get(i);return s||(s=new k6({cache:this,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){U(this,uo).has(t.queryHash)||(U(this,uo).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=U(this,uo).get(t.queryHash);n&&(t.destroy(),n===t&&U(this,uo).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){vn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return U(this,uo).get(t)}getAll(){return[...U(this,uo).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>n_(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>n_(t,r)):n}notify(t){vn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){vn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){vn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},uo=new WeakMap,bE),fo,Ru,ir,hl,ho,Ri,yE,L6=(yE=class extends XE{constructor(t){super();Ie(this,ho);Ie(this,fo,void 0);Ie(this,Ru,void 0);Ie(this,ir,void 0);Ie(this,hl,void 0);this.mutationId=t.mutationId,Pe(this,Ru,t.defaultOptions),Pe(this,ir,t.mutationCache),Pe(this,fo,[]),this.state=t.state||F6(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...U(this,Ru),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){U(this,fo).includes(t)||(U(this,fo).push(t),this.clearGcTimeout(),U(this,ir).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Pe(this,fo,U(this,fo).filter(n=>n!==t)),this.scheduleGc(),U(this,ir).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){U(this,fo).length||(this.state.status==="pending"?this.scheduleGc():U(this,ir).remove(this))}continue(){var t;return((t=U(this,hl))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,a,l,u,d,h,p,g,b,y,x,_,w,C,R,E,M,D;const n=()=>(Pe(this,hl,KE({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(T,k)=>{ot(this,ho,Ri).call(this,{type:"failed",failureCount:T,error:k})},onPause:()=>{ot(this,ho,Ri).call(this,{type:"pause"})},onContinue:()=>{ot(this,ho,Ri).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),U(this,hl).promise),r=this.state.status==="pending";try{if(!r){ot(this,ho,Ri).call(this,{type:"pending",variables:t}),await((i=(o=U(this,ir).config).onMutate)==null?void 0:i.call(o,t,this));const k=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));k!==this.state.context&&ot(this,ho,Ri).call(this,{type:"pending",context:k,variables:t})}const T=await n();return await((u=(l=U(this,ir).config).onSuccess)==null?void 0:u.call(l,T,t,this.state.context,this)),await((h=(d=this.options).onSuccess)==null?void 0:h.call(d,T,t,this.state.context)),await((g=(p=U(this,ir).config).onSettled)==null?void 0:g.call(p,T,null,this.state.variables,this.state.context,this)),await((y=(b=this.options).onSettled)==null?void 0:y.call(b,T,null,t,this.state.context)),ot(this,ho,Ri).call(this,{type:"success",data:T}),T}catch(T){try{throw await((_=(x=U(this,ir).config).onError)==null?void 0:_.call(x,T,t,this.state.context,this)),await((C=(w=this.options).onError)==null?void 0:C.call(w,T,t,this.state.context)),await((E=(R=U(this,ir).config).onSettled)==null?void 0:E.call(R,void 0,T,this.state.variables,this.state.context,this)),await((D=(M=this.options).onSettled)==null?void 0:D.call(M,void 0,T,t,this.state.context)),T}finally{ot(this,ho,Ri).call(this,{type:"error",error:T})}}}},fo=new WeakMap,Ru=new WeakMap,ir=new WeakMap,hl=new WeakMap,ho=new WeakSet,Ri=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:!qh(this.options.networkMode),status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),vn.batch(()=>{U(this,fo).forEach(r=>{r.onMutationUpdate(t)}),U(this,ir).notify({mutation:this,type:"updated",action:t})})},yE);function F6(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Mr,$u,qs,xE,z6=(xE=class extends zu{constructor(t={}){super();Ie(this,Mr,void 0);Ie(this,$u,void 0);Ie(this,qs,void 0);this.config=t,Pe(this,Mr,[]),Pe(this,$u,0)}build(t,n,r){const o=new L6({mutationCache:this,mutationId:++Yd(this,$u)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){U(this,Mr).push(t),this.notify({type:"added",mutation:t})}remove(t){Pe(this,Mr,U(this,Mr).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){vn.batch(()=>{U(this,Mr).forEach(t=>{this.remove(t)})})}getAll(){return U(this,Mr)}find(t){const n={exact:!0,...t};return U(this,Mr).find(r=>r_(n,r))}findAll(t={}){return U(this,Mr).filter(n=>r_(t,n))}notify(t){vn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return Pe(this,qs,(U(this,qs)??Promise.resolve()).then(()=>{const t=U(this,Mr).filter(n=>n.state.isPaused);return vn.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(Tr)),Promise.resolve()))}).then(()=>{Pe(this,qs,void 0)})),U(this,qs)}},Mr=new WeakMap,$u=new WeakMap,qs=new WeakMap,xE);function j6(e){return{onFetch:(t,n)=>{const r=async()=>{var b,y,x,_,w;const o=t.options,i=(x=(y=(b=t.fetchOptions)==null?void 0:b.meta)==null?void 0:y.fetchMore)==null?void 0:x.direction,s=((_=t.state.data)==null?void 0:_.pages)||[],a=((w=t.state.data)==null?void 0:w.pageParams)||[],l={pages:[],pageParams:[]};let u=!1;const d=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(t.signal.aborted?u=!0:t.signal.addEventListener("abort",()=>{u=!0}),t.signal)})},h=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),p=async(C,R,E)=>{if(u)return Promise.reject();if(R==null&&C.pages.length)return Promise.resolve(C);const M={queryKey:t.queryKey,pageParam:R,direction:E?"backward":"forward",meta:t.options.meta};d(M);const D=await h(M),{maxPages:T}=t.options,k=E?D6:O6;return{pages:k(C.pages,D,T),pageParams:k(C.pageParams,R,T)}};let g;if(i&&s.length){const C=i==="backward",R=C?V6:s_,E={pages:s,pageParams:a},M=R(o,E);g=await p(E,M,C)}else{g=await p(l,a[0]??o.initialPageParam);const C=e??s.length;for(let R=1;R<C;R++){const E=s_(o,g);g=await p(g,E)}}return g};t.options.persister?t.fetchFn=()=>{var o,i;return(i=(o=t.options).persister)==null?void 0:i.call(o,r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=r}}}function s_(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function V6(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var nn,Mi,Ti,pl,gl,Ai,ml,vl,wE,H6=(wE=class{constructor(e={}){Ie(this,nn,void 0);Ie(this,Mi,void 0);Ie(this,Ti,void 0);Ie(this,pl,void 0);Ie(this,gl,void 0);Ie(this,Ai,void 0);Ie(this,ml,void 0);Ie(this,vl,void 0);Pe(this,nn,e.queryCache||new QE),Pe(this,Mi,e.mutationCache||new z6),Pe(this,Ti,e.defaultOptions||{}),Pe(this,pl,new Map),Pe(this,gl,new Map),Pe(this,Ai,0)}mount(){Yd(this,Ai)._++,U(this,Ai)===1&&(Pe(this,ml,lh.subscribe(()=>{lh.isFocused()&&(this.resumePausedMutations(),U(this,nn).onFocus())})),Pe(this,vl,ch.subscribe(()=>{ch.isOnline()&&(this.resumePausedMutations(),U(this,nn).onOnline())})))}unmount(){var e,t;Yd(this,Ai)._--,U(this,Ai)===0&&((e=U(this,ml))==null||e.call(this),Pe(this,ml,void 0),(t=U(this,vl))==null||t.call(this),Pe(this,vl,void 0))}isFetching(e){return U(this,nn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return U(this,Mi).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=U(this,nn).find({queryKey:e}))==null?void 0:t.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);return t!==void 0?Promise.resolve(t):this.fetchQuery(e)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=U(this,nn).find({queryKey:e}),o=r==null?void 0:r.state.data,i=$6(t,o);if(typeof i>"u")return;const s=this.defaultQueryOptions({queryKey:e});return U(this,nn).build(this,s).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return vn.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var t;return(t=U(this,nn).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=U(this,nn);vn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=U(this,nn),r={type:"active",...e};return vn.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=vn.batch(()=>U(this,nn).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Tr).catch(Tr)}invalidateQueries(e={},t={}){return vn.batch(()=>{if(U(this,nn).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=vn.batch(()=>U(this,nn).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(Tr)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Tr)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=U(this,nn).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Tr).catch(Tr)}fetchInfiniteQuery(e){return e.behavior=j6(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Tr).catch(Tr)}resumePausedMutations(){return U(this,Mi).resumePausedMutations()}getQueryCache(){return U(this,nn)}getMutationCache(){return U(this,Mi)}getDefaultOptions(){return U(this,Ti)}setDefaultOptions(e){Pe(this,Ti,e)}setQueryDefaults(e,t){U(this,pl).set(ru(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...U(this,pl).values()];let n={};return t.forEach(r=>{ou(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){U(this,gl).set(ru(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...U(this,gl).values()];let n={};return t.forEach(r=>{ou(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...U(this,Ti).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Zb(t.queryKey,t)),typeof t.refetchOnReconnect>"u"&&(t.refetchOnReconnect=t.networkMode!=="always"),typeof t.throwOnError>"u"&&(t.throwOnError=!!t.suspense),typeof t.networkMode>"u"&&t.persister&&(t.networkMode="offlineFirst"),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...U(this,Ti).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){U(this,nn).clear(),U(this,Mi).clear()}},nn=new WeakMap,Mi=new WeakMap,Ti=new WeakMap,pl=new WeakMap,gl=new WeakMap,Ai=new WeakMap,ml=new WeakMap,vl=new WeakMap,wE),Bn,It,Pu,In,Gs,bl,po,Ou,yl,xl,Ys,Ks,Ii,wl,Xs,Mc,Du,Mv,Mu,Tv,Tu,Av,Au,Iv,Iu,kv,ku,Nv,Nu,Lv,zh,ZE,_E,W6=(_E=class extends zu{constructor(t,n){super();Ie(this,Xs);Ie(this,Du);Ie(this,Mu);Ie(this,Tu);Ie(this,Au);Ie(this,Iu);Ie(this,ku);Ie(this,Nu);Ie(this,zh);Ie(this,Bn,void 0);Ie(this,It,void 0);Ie(this,Pu,void 0);Ie(this,In,void 0);Ie(this,Gs,void 0);Ie(this,bl,void 0);Ie(this,po,void 0);Ie(this,Ou,void 0);Ie(this,yl,void 0);Ie(this,xl,void 0);Ie(this,Ys,void 0);Ie(this,Ks,void 0);Ie(this,Ii,void 0);Ie(this,wl,new Set);this.options=n,Pe(this,Bn,t),Pe(this,po,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(U(this,It).addObserver(this),a_(U(this,It),this.options)?ot(this,Xs,Mc).call(this):this.updateResult(),ot(this,Au,Iv).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Fv(U(this,It),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Fv(U(this,It),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ot(this,Iu,kv).call(this),ot(this,ku,Nv).call(this),U(this,It).removeObserver(this)}setOptions(t,n){const r=this.options,o=U(this,It);if(this.options=U(this,Bn).defaultQueryOptions(t),Pv(r,this.options)||U(this,Bn).getQueryCache().notify({type:"observerOptionsUpdated",query:U(this,It),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),ot(this,Nu,Lv).call(this);const i=this.hasListeners();i&&l_(U(this,It),o,this.options,r)&&ot(this,Xs,Mc).call(this),this.updateResult(n),i&&(U(this,It)!==o||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&ot(this,Du,Mv).call(this);const s=ot(this,Mu,Tv).call(this);i&&(U(this,It)!==o||this.options.enabled!==r.enabled||s!==U(this,Ii))&&ot(this,Tu,Av).call(this,s)}getOptimisticResult(t){const n=U(this,Bn).getQueryCache().build(U(this,Bn),t),r=this.createResult(n,t);return U6(this,r)&&(Pe(this,In,r),Pe(this,bl,this.options),Pe(this,Gs,U(this,It).state)),r}getCurrentResult(){return U(this,In)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(U(this,wl).add(r),t[r])})}),n}getCurrentQuery(){return U(this,It)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=U(this,Bn).defaultQueryOptions(t),r=U(this,Bn).getQueryCache().build(U(this,Bn),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return ot(this,Xs,Mc).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),U(this,In)))}createResult(t,n){var M;const r=U(this,It),o=this.options,i=U(this,In),s=U(this,Gs),a=U(this,bl),u=t!==r?t.state:U(this,Pu),{state:d}=t;let{error:h,errorUpdatedAt:p,fetchStatus:g,status:b}=d,y=!1,x;if(n._optimisticResults){const D=this.hasListeners(),T=!D&&a_(t,n),k=D&&l_(t,r,n,o);(T||k)&&(g=qh(t.options.networkMode)?"fetching":"paused",d.dataUpdatedAt||(b="pending")),n._optimisticResults==="isRestoring"&&(g="idle")}if(n.select&&typeof d.data<"u")if(i&&d.data===(s==null?void 0:s.data)&&n.select===U(this,Ou))x=U(this,yl);else try{Pe(this,Ou,n.select),x=n.select(d.data),x=Dv(i==null?void 0:i.data,x,n),Pe(this,yl,x),Pe(this,po,null)}catch(D){Pe(this,po,D)}else x=d.data;if(typeof n.placeholderData<"u"&&typeof x>"u"&&b==="pending"){let D;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))D=i.data;else if(D=typeof n.placeholderData=="function"?n.placeholderData((M=U(this,xl))==null?void 0:M.state.data,U(this,xl)):n.placeholderData,n.select&&typeof D<"u")try{D=n.select(D),Pe(this,po,null)}catch(T){Pe(this,po,T)}typeof D<"u"&&(b="success",x=Dv(i==null?void 0:i.data,D,n),y=!0)}U(this,po)&&(h=U(this,po),x=U(this,yl),p=Date.now(),b="error");const _=g==="fetching",w=b==="pending",C=b==="error",R=w&&_;return{status:b,fetchStatus:g,isPending:w,isSuccess:b==="success",isError:C,isInitialLoading:R,isLoading:R,data:x,dataUpdatedAt:d.dataUpdatedAt,error:h,errorUpdatedAt:p,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:_,isRefetching:_&&!w,isLoadingError:C&&d.dataUpdatedAt===0,isPaused:g==="paused",isPlaceholderData:y,isRefetchError:C&&d.dataUpdatedAt!==0,isStale:Jb(t,n),refetch:this.refetch}}updateResult(t){const n=U(this,In),r=this.createResult(U(this,It),this.options);if(Pe(this,Gs,U(this,It).state),Pe(this,bl,this.options),U(this,Gs).data!==void 0&&Pe(this,xl,U(this,It)),Pv(r,n))return;Pe(this,In,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!U(this,wl).size)return!0;const l=new Set(a??U(this,wl));return this.options.throwOnError&&l.add("error"),Object.keys(U(this,In)).some(u=>{const d=u;return U(this,In)[d]!==n[d]&&l.has(d)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),ot(this,zh,ZE).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ot(this,Au,Iv).call(this)}},Bn=new WeakMap,It=new WeakMap,Pu=new WeakMap,In=new WeakMap,Gs=new WeakMap,bl=new WeakMap,po=new WeakMap,Ou=new WeakMap,yl=new WeakMap,xl=new WeakMap,Ys=new WeakMap,Ks=new WeakMap,Ii=new WeakMap,wl=new WeakMap,Xs=new WeakSet,Mc=function(t){ot(this,Nu,Lv).call(this);let n=U(this,It).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Tr)),n},Du=new WeakSet,Mv=function(){if(ot(this,Iu,kv).call(this),El||U(this,In).isStale||!$v(this.options.staleTime))return;const n=qE(U(this,In).dataUpdatedAt,this.options.staleTime)+1;Pe(this,Ys,setTimeout(()=>{U(this,In).isStale||this.updateResult()},n))},Mu=new WeakSet,Tv=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(U(this,It)):this.options.refetchInterval)??!1},Tu=new WeakSet,Av=function(t){ot(this,ku,Nv).call(this),Pe(this,Ii,t),!(El||this.options.enabled===!1||!$v(U(this,Ii))||U(this,Ii)===0)&&Pe(this,Ks,setInterval(()=>{(this.options.refetchIntervalInBackground||lh.isFocused())&&ot(this,Xs,Mc).call(this)},U(this,Ii)))},Au=new WeakSet,Iv=function(){ot(this,Du,Mv).call(this),ot(this,Tu,Av).call(this,ot(this,Mu,Tv).call(this))},Iu=new WeakSet,kv=function(){U(this,Ys)&&(clearTimeout(U(this,Ys)),Pe(this,Ys,void 0))},ku=new WeakSet,Nv=function(){U(this,Ks)&&(clearInterval(U(this,Ks)),Pe(this,Ks,void 0))},Nu=new WeakSet,Lv=function(){const t=U(this,Bn).getQueryCache().build(U(this,Bn),this.options);if(t===U(this,It))return;const n=U(this,It);Pe(this,It,t),Pe(this,Pu,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},zh=new WeakSet,ZE=function(t){vn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(U(this,In))}),U(this,Bn).getQueryCache().notify({query:U(this,It),type:"observerResultsUpdated"})})},_E);function B6(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function a_(e,t){return B6(e,t)||e.state.dataUpdatedAt>0&&Fv(e,t,t.refetchOnMount)}function Fv(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Jb(e,t)}return!1}function l_(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&Jb(e,n)}function Jb(e,t){return e.isStaleByTime(t.staleTime)}function U6(e,t){return!Pv(e.getCurrentResult(),t)}var JE=le.createContext(void 0),q6=e=>{const t=le.useContext(JE);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},G6=({client:e,children:t})=>(le.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),le.createElement(JE.Provider,{value:e},t)),eR=le.createContext(!1),Y6=()=>le.useContext(eR);eR.Provider;function K6(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var X6=le.createContext(K6()),Q6=()=>le.useContext(X6);function Z6(e,t){return typeof e=="function"?e(...t):!!e}var J6=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},e9=e=>{le.useEffect(()=>{e.clearReset()},[e])},t9=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&Z6(n,[e.error,r]),n9=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},r9=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,o9=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function i9(e,t,n){if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=q6(n),o=Y6(),i=Q6(),s=r.defaultQueryOptions(e);s._optimisticResults=o?"isRestoring":"optimistic",n9(s),J6(s,i),e9(i);const[a]=le.useState(()=>new t(r,s)),l=a.getOptimisticResult(s);if(le.useSyncExternalStore(le.useCallback(u=>{const d=o?()=>{}:a.subscribe(vn.batchCalls(u));return a.updateResult(),d},[a,o]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),le.useEffect(()=>{a.setOptions(s,{listeners:!1})},[s,a]),r9(s,l))throw o9(s,a,i);if(t9({result:l,errorResetBoundary:i,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw l.error;return s.notifyOnChangeProps?l:a.trackResult(l)}function ju(e,t){return i9(e,W6,t)}const s9={theme:"system",setTheme:()=>null},tR=m.createContext(s9);function a9({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[o,i]=m.useState(()=>localStorage.getItem(n)||t);m.useEffect(()=>{const a=window.document.documentElement;if(a.classList.remove("light","dark"),o==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";a.classList.add(l);return}a.classList.add(o)},[o]);const s={theme:o,setTheme:a=>{localStorage.setItem(n,a),i(a)}};return I.jsx(tR.Provider,{...r,value:s,children:e})}const nR=()=>{const e=m.useContext(tR);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};async function l9(e){return await(await fetch("https://semaphor.cloud/api/v1/dashboard",{headers:{Authorization:`Bearer ${e}`}})).json()}function rR(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function c_(e,t){const n=rR(e);return n==="dark"?Wi.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function c9({authToken:e,customStyle:t,currentTheme:n,onSave:r,onEvent:o}){const{data:i,refetch:s,isLoading:a,isError:l}=ju({queryKey:["dashboard",e==null?void 0:e.accessToken],queryFn:()=>l9(e==null?void 0:e.accessToken),enabled:!1}),{theme:u,setTheme:d}=nR(),{setDashboard:h,setSelectedSheetId:p,setStyle:g,setOnSaveFunction:b}=Ce(E=>E.actions);Ce(E=>E.actions.setCustomCards);const y=Ce(E=>E.actions.setFilterValues),x=Ce(E=>E.actions.setBookmarkKey),_=Ce(E=>E.actions.setAuthToken),w=Ce(E=>E.actions.setThemeStyle),C=Ce(E=>E.actions.setDashboardTheme),R=Ce(E=>E.actions.setOnEvent);return m.useEffect(()=>{if(u){const E=rR(u);C(E)}},[u,C]),m.useEffect(()=>{n&&d(n)},[n,d]),m.useEffect(()=>{const E=Wi.cloneDeep(Rv);if(t){const M=Wi.merge(E,t),D=c_(u,M);w(D),g(M)}else{const M=c_(u,E);w(M),g(Rv)}},[u,t,g,w]),m.useEffect(()=>{var k;if(!i||!i.dashboard)return;const E=i.dashboard,M=dD(E.id),D=JSON.parse(localStorage.getItem(M)||"[]"),T=D.find(L=>L.default===!0);if(T)h(T.template),x(T.name),T.filterValues&&y(T.filterValues);else{h(E);const L=D.find(W=>(W==null?void 0:W.name)==="Original");L?L.template=E:D.push({name:"Original",template:E,default:!1}),localStorage.setItem(M,JSON.stringify(D))}p((k=E.sheets)==null?void 0:k[0].id)},[i,h,p,y,x]),m.useEffect(()=>{r&&b(r),o&&R(o)},[r,b,o,R]),m.useEffect(()=>{e&&e.accessToken&&(_(e),s())},[e,s,_]),{isLoading:a,isError:l}}function e0({className:e,...t}){return I.jsx("div",{className:_e("animate-pulse rounded-md bg-muted",e),...t})}const t0=le.forwardRef(({className:e,...t},n)=>I.jsx("div",{ref:n,className:_e("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));t0.displayName="Card";const Gh=le.forwardRef(({className:e,...t},n)=>I.jsx("div",{ref:n,className:_e("flex flex-col space-y-1.5 p-6",e),...t}));Gh.displayName="CardHeader";const Vu=le.forwardRef(({className:e,...t},n)=>I.jsx("h3",{ref:n,className:_e("text-2xl font-semibold leading-none tracking-tight",e),...t}));Vu.displayName="CardTitle";const n0=le.forwardRef(({className:e,...t},n)=>I.jsx("p",{ref:n,className:_e("text-sm text-muted-foreground",e),...t}));n0.displayName="CardDescription";const Yh=le.forwardRef(({className:e,...t},n)=>I.jsx("div",{ref:n,className:_e("px-6 pt-0",e),...t}));Yh.displayName="CardContent";const r0=le.forwardRef(({className:e,...t},n)=>I.jsx("div",{ref:n,className:_e("flex items-center p-6 pt-0",e),...t}));r0.displayName="CardFooter";function oR({className:e,customStyle:t,onSave:n,onEvent:r,LoadingComponent:o,ErrorComponent:i,onChartElementClicked:s,id:a,authToken:l,currentTheme:u,version:d,customCards:h,...p}){Ce(_=>_.selectedSheetId);const g=Ce(_=>_.themeStyle),b=Ce(_=>_.isSessionExpired),{isLoading:y,isError:x}=c9({authToken:l,customStyle:t,currentTheme:u,onSave:n,onEvent:r});return y||!l?(r==null||r({type:"info",message:"Loading dashboard"}),o?I.jsx(o,{message:"loading"}):I.jsx("div",{className:"flex items-center gap-3",children:I.jsx(e0,{className:"h-1 w-full dark:h-[2px]"})})):x?(r==null||r({type:"error",message:"Error fetching dashboard"}),i?(console.log("Error fetching dashboard"),I.jsx(i,{})):I.jsx("div",{children:"Error"})):b?(r==null||r({type:"error",message:"Session Expired"}),I.jsx("div",{className:"flex h-full items-center justify-center",children:I.jsxs("div",{className:"space-y-4 rounded-md border border-muted p-10",children:[I.jsx(Vu,{children:"Session Expired"}),I.jsx("p",{className:"text-muted-foreground",children:"Your session has expired. Please refresh the page to continue."})]})})):I.jsx("div",{className:_e("flex h-full grow flex-col justify-between",g==null?void 0:g.dashboardPanel,e),role:"dashboard-panel",...p})}function ne(){return ne=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ne.apply(this,arguments)}function we(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function dn(e,t=[]){let n=[];function r(i,s){const a=m.createContext(s),l=n.length;n=[...n,s];function u(h){const{scope:p,children:g,...b}=h,y=(p==null?void 0:p[e][l])||a,x=m.useMemo(()=>b,Object.values(b));return m.createElement(y.Provider,{value:x},g)}function d(h,p){const g=(p==null?void 0:p[e][l])||a,b=m.useContext(g);if(b)return b;if(s!==void 0)return s;throw new Error(`\`${h}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,d]}const o=()=>{const i=n.map(s=>m.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,u9(o,...t)]}function u9(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const h=l(i)[`__scope${u}`];return{...a,...h}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function d9(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Kh(...e){return t=>e.forEach(n=>d9(n,t))}function Xe(...e){return m.useCallback(Kh(...e),e)}const ni=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(f9);if(i){const s=i.props.children,a=o.map(l=>l===i?m.Children.count(s)>1?m.Children.only(null):m.isValidElement(s)?s.props.children:null:l);return m.createElement(zv,ne({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(zv,ne({},r,{ref:t}),n)});ni.displayName="Slot";const zv=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...h9(r,n.props),ref:t?Kh(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});zv.displayName="SlotClone";const iR=({children:e})=>m.createElement(m.Fragment,null,e);function f9(e){return m.isValidElement(e)&&e.type===iR}function h9(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Xh(e){const t=e+"CollectionProvider",[n,r]=dn(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=g=>{const{scope:b,children:y}=g,x=m.useRef(null),_=m.useRef(new Map).current;return m.createElement(o,{scope:b,itemMap:_,collectionRef:x},y)},a=e+"CollectionSlot",l=m.forwardRef((g,b)=>{const{scope:y,children:x}=g,_=i(a,y),w=Xe(b,_.collectionRef);return m.createElement(ni,{ref:w},x)}),u=e+"CollectionItemSlot",d="data-radix-collection-item",h=m.forwardRef((g,b)=>{const{scope:y,children:x,..._}=g,w=m.useRef(null),C=Xe(b,w),R=i(u,y);return m.useEffect(()=>(R.itemMap.set(w,{ref:w,..._}),()=>void R.itemMap.delete(w))),m.createElement(ni,{[d]:"",ref:C},x)});function p(g){const b=i(e+"CollectionConsumer",g);return m.useCallback(()=>{const x=b.collectionRef.current;if(!x)return[];const _=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(b.itemMap.values()).sort((R,E)=>_.indexOf(R.ref.current)-_.indexOf(E.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:s,Slot:l,ItemSlot:h},p,r]}const Pn=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},p9=le.useId||(()=>{});let g9=0;function Yn(e){const[t,n]=le.useState(p9());return Pn(()=>{e||n(r=>r??String(g9++))},[e]),e||(t?`radix-${t}`:"")}const m9=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ke=m9.reduce((e,t)=>{const n=m.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?ni:t;return m.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),m.createElement(a,ne({},s,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function sR(e,t){e&&So.flushSync(()=>e.dispatchEvent(t))}function on(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function On({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=v9({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=on(n),l=m.useCallback(u=>{if(i){const h=typeof u=="function"?u(e):u;h!==e&&a(h)}else o(u)},[i,e,o,a]);return[s,l]}function v9({defaultProp:e,onChange:t}){const n=m.useState(e),[r]=n,o=m.useRef(r),i=on(t);return m.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const b9=m.createContext(void 0);function ha(e){const t=m.useContext(b9);return e||t||"ltr"}const cm="rovingFocusGroup.onEntryFocus",y9={bubbles:!1,cancelable:!0},o0="RovingFocusGroup",[jv,aR,x9]=Xh(o0),[w9,zl]=dn(o0,[x9]),[_9,S9]=w9(o0),C9=m.forwardRef((e,t)=>m.createElement(jv.Provider,{scope:e.__scopeRovingFocusGroup},m.createElement(jv.Slot,{scope:e.__scopeRovingFocusGroup},m.createElement(E9,ne({},e,{ref:t}))))),E9=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,...d}=e,h=m.useRef(null),p=Xe(t,h),g=ha(i),[b=null,y]=On({prop:s,defaultProp:a,onChange:l}),[x,_]=m.useState(!1),w=on(u),C=aR(n),R=m.useRef(!1),[E,M]=m.useState(0);return m.useEffect(()=>{const D=h.current;if(D)return D.addEventListener(cm,w),()=>D.removeEventListener(cm,w)},[w]),m.createElement(_9,{scope:n,orientation:r,dir:g,loop:o,currentTabStopId:b,onItemFocus:m.useCallback(D=>y(D),[y]),onItemShiftTab:m.useCallback(()=>_(!0),[]),onFocusableItemAdd:m.useCallback(()=>M(D=>D+1),[]),onFocusableItemRemove:m.useCallback(()=>M(D=>D-1),[])},m.createElement(ke.div,ne({tabIndex:x||E===0?-1:0,"data-orientation":r},d,{ref:p,style:{outline:"none",...e.style},onMouseDown:we(e.onMouseDown,()=>{R.current=!0}),onFocus:we(e.onFocus,D=>{const T=!R.current;if(D.target===D.currentTarget&&T&&!x){const k=new CustomEvent(cm,y9);if(D.currentTarget.dispatchEvent(k),!k.defaultPrevented){const L=C().filter(F=>F.focusable),W=L.find(F=>F.active),Y=L.find(F=>F.id===b),X=[W,Y,...L].filter(Boolean).map(F=>F.ref.current);lR(X)}}R.current=!1}),onBlur:we(e.onBlur,()=>_(!1))})))}),R9="RovingFocusGroupItem",$9=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=Yn(),l=i||a,u=S9(R9,n),d=u.currentTabStopId===l,h=aR(n),{onFocusableItemAdd:p,onFocusableItemRemove:g}=u;return m.useEffect(()=>{if(r)return p(),()=>g()},[r,p,g]),m.createElement(jv.ItemSlot,{scope:n,id:l,focusable:r,active:o},m.createElement(ke.span,ne({tabIndex:d?0:-1,"data-orientation":u.orientation},s,{ref:t,onMouseDown:we(e.onMouseDown,b=>{r?u.onItemFocus(l):b.preventDefault()}),onFocus:we(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:we(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){u.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const y=D9(b,u.orientation,u.dir);if(y!==void 0){b.preventDefault();let _=h().filter(w=>w.focusable).map(w=>w.ref.current);if(y==="last")_.reverse();else if(y==="prev"||y==="next"){y==="prev"&&_.reverse();const w=_.indexOf(b.currentTarget);_=u.loop?M9(_,w+1):_.slice(w+1)}setTimeout(()=>lR(_))}})})))}),P9={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function O9(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function D9(e,t,n){const r=O9(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return P9[r]}function lR(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function M9(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const i0=C9,s0=$9;function T9(e,t){return m.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const Zt=e=>{const{present:t,children:n}=e,r=A9(t),o=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),i=Xe(r.ref,o.ref);return typeof n=="function"||r.isPresent?m.cloneElement(o,{ref:i}):null};Zt.displayName="Presence";function A9(e){const[t,n]=m.useState(),r=m.useRef({}),o=m.useRef(e),i=m.useRef("none"),s=e?"mounted":"unmounted",[a,l]=T9(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const u=Zd(r.current);i.current=a==="mounted"?u:"none"},[a]),Pn(()=>{const u=r.current,d=o.current;if(d!==e){const p=i.current,g=Zd(u);e?l("MOUNT"):g==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&p!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Pn(()=>{if(t){const u=h=>{const g=Zd(r.current).includes(h.animationName);h.target===t&&g&&So.flushSync(()=>l("ANIMATION_END"))},d=h=>{h.target===t&&(i.current=Zd(r.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:m.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function Zd(e){return(e==null?void 0:e.animationName)||"none"}const cR="Tabs",[I9,Jre]=dn(cR,[zl]),uR=zl(),[k9,a0]=I9(cR),N9=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...u}=e,d=ha(a),[h,p]=On({prop:r,onChange:o,defaultProp:i});return m.createElement(k9,{scope:n,baseId:Yn(),value:h,onValueChange:p,orientation:s,dir:d,activationMode:l},m.createElement(ke.div,ne({dir:d,"data-orientation":s},u,{ref:t})))}),L9="TabsList",F9=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=a0(L9,n),s=uR(n);return m.createElement(i0,ne({asChild:!0},s,{orientation:i.orientation,dir:i.dir,loop:r}),m.createElement(ke.div,ne({role:"tablist","aria-orientation":i.orientation},o,{ref:t})))}),z9="TabsTrigger",j9=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=a0(z9,n),a=uR(n),l=dR(s.baseId,r),u=fR(s.baseId,r),d=r===s.value;return m.createElement(s0,ne({asChild:!0},a,{focusable:!o,active:d}),m.createElement(ke.button,ne({type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l},i,{ref:t,onMouseDown:we(e.onMouseDown,h=>{!o&&h.button===0&&h.ctrlKey===!1?s.onValueChange(r):h.preventDefault()}),onKeyDown:we(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&s.onValueChange(r)}),onFocus:we(e.onFocus,()=>{const h=s.activationMode!=="manual";!d&&!o&&h&&s.onValueChange(r)})})))}),V9="TabsContent",H9=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=a0(V9,n),l=dR(a.baseId,r),u=fR(a.baseId,r),d=r===a.value,h=m.useRef(d);return m.useEffect(()=>{const p=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(p)},[]),m.createElement(Zt,{present:o||d},({present:p})=>m.createElement(ke.div,ne({"data-state":d?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!p,id:u,tabIndex:0},s,{ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0}}),p&&i))});function dR(e,t){return`${e}-trigger-${t}`}function fR(e,t){return`${e}-content-${t}`}const W9=N9,hR=F9,pR=j9,gR=H9,mR=W9,vR=le.forwardRef(({className:e,...t},n)=>I.jsx(hR,{ref:n,className:_e("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));vR.displayName=hR.displayName;const bR=le.forwardRef(({className:e,...t},n)=>I.jsx(pR,{ref:n,className:_e("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}));bR.displayName=pR.displayName;const l0=le.forwardRef(({className:e,...t},n)=>I.jsx(gR,{ref:n,className:_e("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));l0.displayName=gR.displayName;var yR={exports:{}},Hu={},Vv={exports:{}};(function(e,t){(function(n,r){r(t)})(Ns,function(n){function r(te){return function(ie,ye,Z,De,Ne,Ve,qe){return te(ie,ye,qe)}}function o(te){return function(ie,ye,Z,De){if(!ie||!ye||typeof ie!="object"||typeof ye!="object")return te(ie,ye,Z,De);var Ne=De.get(ie),Ve=De.get(ye);if(Ne&&Ve)return Ne===ye&&Ve===ie;De.set(ie,ye),De.set(ye,ie);var qe=te(ie,ye,Z,De);return De.delete(ie),De.delete(ye),qe}}function i(te,K){var ie={};for(var ye in te)ie[ye]=te[ye];for(var ye in K)ie[ye]=K[ye];return ie}function s(te){return te.constructor===Object||te.constructor==null}function a(te){return typeof te.then=="function"}function l(te,K){return te===K||te!==te&&K!==K}var u="[object Arguments]",d="[object Boolean]",h="[object Date]",p="[object RegExp]",g="[object Map]",b="[object Number]",y="[object Object]",x="[object Set]",_="[object String]",w=Object.prototype.toString;function C(te){var K=te.areArraysEqual,ie=te.areDatesEqual,ye=te.areMapsEqual,Z=te.areObjectsEqual,De=te.areRegExpsEqual,Ne=te.areSetsEqual,Ve=te.createIsNestedEqual,qe=Ve(pt);function pt(dt,ft,Bt){if(dt===ft)return!0;if(!dt||!ft||typeof dt!="object"||typeof ft!="object")return dt!==dt&&ft!==ft;if(s(dt)&&s(ft))return Z(dt,ft,qe,Bt);var Vt=Array.isArray(dt),xn=Array.isArray(ft);if(Vt||xn)return Vt===xn&&K(dt,ft,qe,Bt);var Jt=w.call(dt);return Jt!==w.call(ft)?!1:Jt===h?ie(dt,ft,qe,Bt):Jt===p?De(dt,ft,qe,Bt):Jt===g?ye(dt,ft,qe,Bt):Jt===x?Ne(dt,ft,qe,Bt):Jt===y||Jt===u?a(dt)||a(ft)?!1:Z(dt,ft,qe,Bt):Jt===d||Jt===b||Jt===_?l(dt.valueOf(),ft.valueOf()):!1}return pt}function R(te,K,ie,ye){var Z=te.length;if(K.length!==Z)return!1;for(;Z-- >0;)if(!ie(te[Z],K[Z],Z,Z,te,K,ye))return!1;return!0}var E=o(R);function M(te,K){return l(te.valueOf(),K.valueOf())}function D(te,K,ie,ye){var Z=te.size===K.size;if(!Z)return!1;if(!te.size)return!0;var De={},Ne=0;return te.forEach(function(Ve,qe){if(Z){var pt=!1,dt=0;K.forEach(function(ft,Bt){!pt&&!De[dt]&&(pt=ie(qe,Bt,Ne,dt,te,K,ye)&&ie(Ve,ft,qe,Bt,te,K,ye))&&(De[dt]=!0),dt++}),Ne++,Z=pt}}),Z}var T=o(D),k="_owner",L=Object.prototype.hasOwnProperty;function W(te,K,ie,ye){var Z=Object.keys(te),De=Z.length;if(Object.keys(K).length!==De)return!1;for(var Ne;De-- >0;){if(Ne=Z[De],Ne===k){var Ve=!!te.$$typeof,qe=!!K.$$typeof;if((Ve||qe)&&Ve!==qe)return!1}if(!L.call(K,Ne)||!ie(te[Ne],K[Ne],Ne,Ne,te,K,ye))return!1}return!0}var Y=o(W);function ee(te,K){return te.source===K.source&&te.flags===K.flags}function X(te,K,ie,ye){var Z=te.size===K.size;if(!Z)return!1;if(!te.size)return!0;var De={};return te.forEach(function(Ne,Ve){if(Z){var qe=!1,pt=0;K.forEach(function(dt,ft){!qe&&!De[pt]&&(qe=ie(Ne,dt,Ve,ft,te,K,ye))&&(De[pt]=!0),pt++}),Z=qe}}),Z}var F=o(X),J=Object.freeze({areArraysEqual:R,areDatesEqual:M,areMapsEqual:D,areObjectsEqual:W,areRegExpsEqual:ee,areSetsEqual:X,createIsNestedEqual:r}),q=Object.freeze({areArraysEqual:E,areDatesEqual:M,areMapsEqual:T,areObjectsEqual:Y,areRegExpsEqual:ee,areSetsEqual:F,createIsNestedEqual:r}),Q=C(J);function ae(te,K){return Q(te,K,void 0)}var j=C(i(J,{createIsNestedEqual:function(){return l}}));function V(te,K){return j(te,K,void 0)}var oe=C(q);function ce(te,K){return oe(te,K,new WeakMap)}var ue=C(i(q,{createIsNestedEqual:function(){return l}}));function ge(te,K){return ue(te,K,new WeakMap)}function ve(te){return C(i(J,te(J)))}function fe(te){var K=C(i(q,te(q)));return function(ie,ye,Z){return Z===void 0&&(Z=new WeakMap),K(ie,ye,Z)}}n.circularDeepEqual=ce,n.circularShallowEqual=ge,n.createCustomCircularEqual=fe,n.createCustomEqual=ve,n.deepEqual=ae,n.sameValueZeroEqual=l,n.shallowEqual=V,Object.defineProperty(n,"__esModule",{value:!0})})})(Vv,Vv.exports);var c0=Vv.exports;const u0=Ub(uN);var at={},B9=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(at,"__esModule",{value:!0});at.bottom=d0;at.childrenEqual=Y9;at.cloneLayout=xR;at.cloneLayoutItem=Qs;at.collides=Qh;at.compact=_R;at.compactItem=SR;at.compactType=lL;at.correctBounds=CR;at.fastPositionEqual=X9;at.fastRGLPropsEqual=void 0;at.getAllCollisions=ER;at.getFirstCollision=zs;at.getLayoutItem=f0;at.getStatics=h0;at.modifyLayout=wR;at.moveElement=Ac;at.moveElementAwayFromCollision=Wv;at.noop=void 0;at.perc=Z9;at.resizeItemInDirection=oL;at.setTopLeft=sL;at.setTransform=iL;at.sortLayoutItems=y0;at.sortLayoutItemsByColRow=DR;at.sortLayoutItemsByRowCol=OR;at.synchronizeLayoutWithChildren=aL;at.validateLayout=MR;at.withLayoutItem=G9;var u_=c0,Tc=U9(m);function U9(e){return e&&e.__esModule?e:{default:e}}const q9=process.env.NODE_ENV==="production";function d0(e){let t=0,n;for(let r=0,o=e.length;r<o;r++)n=e[r].y+e[r].h,n>t&&(t=n);return t}function xR(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=Qs(e[n]);return t}function wR(e,t){const n=Array(e.length);for(let r=0,o=e.length;r<o;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function G9(e,t,n){let r=f0(e,t);return r?(r=n(Qs(r)),e=wR(e,r),[e,r]):[e,null]}function Qs(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 Y9(e,t){return(0,u_.deepEqual)(Tc.default.Children.map(e,n=>n==null?void 0:n.key),Tc.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,u_.deepEqual)(Tc.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),Tc.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}const K9=B9;at.fastRGLPropsEqual=K9;function X9(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function Qh(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 _R(e,t,n,r){const o=h0(e),i=y0(e,t),s=Array(e.length);for(let a=0,l=i.length;a<l;a++){let u=Qs(i[a]);u.static||(u=SR(o,u,t,n,i,r),o.push(u)),s[e.indexOf(i[a])]=u,u.moved=!1}return s}const Q9={x:"w",y:"h"};function Hv(e,t,n,r){const o=Q9[r];t[r]+=1;const i=e.map(s=>s.i).indexOf(t.i);for(let s=i+1;s<e.length;s++){const a=e[s];if(!a.static){if(a.y>t.y+t.h)break;Qh(t,a)&&Hv(e,a,n+t[o],r)}}t[r]=n}function SR(e,t,n,r,o,i){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(d0(e),t.y);t.y>0&&!zs(e,t);)t.y--;else if(a)for(;t.x>0&&!zs(e,t);)t.x--;let l;for(;(l=zs(e,t))&&!(n===null&&i);)if(a?Hv(o,t,l.x+l.w,"x"):Hv(o,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!zs(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function CR(e,t){const n=h0(e);for(let r=0,o=e.length;r<o;r++){const i=e[r];if(i.x+i.w>t.cols&&(i.x=t.cols-i.w),i.x<0&&(i.x=0,i.w=t.cols),!i.static)n.push(i);else for(;zs(n,i);)i.y++}return e}function f0(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function zs(e,t){for(let n=0,r=e.length;n<r;n++)if(Qh(e[n],t))return e[n]}function ER(e,t){return e.filter(n=>Qh(n,t))}function h0(e){return e.filter(t=>t.static)}function Ac(e,t,n,r,o,i,s,a,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;"Moving element ".concat(t.i," to [").concat(String(n),",").concat(String(r),"] from [").concat(t.x,",").concat(t.y,"]");const u=t.x,d=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let h=y0(e,s);(s==="vertical"&&typeof r=="number"?d>=r:s==="horizontal"&&typeof n=="number"?u>=n:!1)&&(h=h.reverse());const g=ER(h,t),b=g.length>0;if(b&&l)return xR(e);if(b&&i)return"Collision prevented on ".concat(t.i,", reverting."),t.x=u,t.y=d,t.moved=!1,e;for(let y=0,x=g.length;y<x;y++){const _=g[y];"Resolving collision between ".concat(t.i," at [").concat(t.x,",").concat(t.y,"] and ").concat(_.i," at [").concat(_.x,",").concat(_.y,"]"),!_.moved&&(_.static?e=Wv(e,_,t,o,s):e=Wv(e,t,_,o,s))}return e}function Wv(e,t,n,r,o,i){const s=o==="horizontal",a=o==="vertical",l=t.static;if(r){r=!1;const h={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=zs(e,h),g=p&&p.y+p.h>t.y,b=p&&t.x+t.w>p.x;if(p){if(g&&a)return Ac(e,n,void 0,t.y+1,r,l,o);if(g&&o==null)return t.y=n.y,n.y=n.y+n.h,e;if(b&&s)return Ac(e,t,n.x,void 0,r,l,o)}else return"Doing reverse collision on ".concat(n.i," up to [").concat(h.x,",").concat(h.y,"]."),Ac(e,n,s?h.x:void 0,a?h.y:void 0,r,l,o)}const u=s?n.x+1:void 0,d=a?n.y+1:void 0;return u==null&&d==null?e:Ac(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,o)}function Z9(e){return e*100+"%"}const RR=(e,t,n,r)=>e+n>r?t:n,$R=(e,t,n)=>e<0?t:n,PR=e=>Math.max(0,e),p0=e=>Math.max(0,e),g0=(e,t,n)=>{let{left:r,height:o,width:i}=t;const s=e.top-(o-e.height);return{left:r,width:i,height:$R(s,e.height,o),top:p0(s)}},m0=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{top:r,height:i,width:RR(e.left,e.width,s,n),left:PR(o)}},v0=(e,t,n)=>{let{top:r,height:o,width:i}=t;const s=e.left-(i-e.width);return{height:o,width:s<0?e.width:RR(e.left,e.width,i,n),top:p0(r),left:PR(s)}},b0=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{width:s,left:o,height:$R(r,e.height,i),top:p0(r)}},J9=function(){return g0(arguments.length<=0?void 0:arguments[0],m0(...arguments))},eL=function(){return g0(arguments.length<=0?void 0:arguments[0],v0(...arguments))},tL=function(){return b0(arguments.length<=0?void 0:arguments[0],m0(...arguments))},nL=function(){return b0(arguments.length<=0?void 0:arguments[0],v0(...arguments))},rL={n:g0,ne:J9,e:m0,se:tL,s:b0,sw:nL,w:v0,nw:eL};function oL(e,t,n,r){const o=rL[e];return o?o(t,{...t,...n},r):n}function iL(e){let{top:t,left:n,width:r,height:o}=e;const i="translate(".concat(n,"px,").concat(t,"px)");return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:"".concat(r,"px"),height:"".concat(o,"px"),position:"absolute"}}function sL(e){let{top:t,left:n,width:r,height:o}=e;return{top:"".concat(t,"px"),left:"".concat(n,"px"),width:"".concat(r,"px"),height:"".concat(o,"px"),position:"absolute"}}function y0(e,t){return t==="horizontal"?DR(e):t==="vertical"?OR(e):e}function OR(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 DR(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 aL(e,t,n,r,o){e=e||[];const i=[];Tc.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=f0(e,String(a.key)),u=a.props["data-grid"];l&&u==null?i.push(Qs(l)):u?(q9||MR([u],"ReactGridLayout.children"),i.push(Qs({...u,i:a.key}))):i.push(Qs({w:1,h:1,x:0,y:d0(i),i:String(a.key)}))});const s=CR(i,{cols:n});return o?s:_R(s,r,n)}function MR(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const n=["x","y","w","h"];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(let r=0,o=e.length;r<o;r++){const i=e[r];for(let s=0;s<n.length;s++)if(typeof i[n[s]]!="number")throw new Error("ReactGridLayout: "+t+"["+r+"]."+n[s]+" must be a number!")}}function lL(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const cL=()=>{};at.noop=cL;var Co={};Object.defineProperty(Co,"__esModule",{value:!0});Co.calcGridColWidth=Zh;Co.calcGridItemPosition=uL;Co.calcGridItemWHPx=Bv;Co.calcWH=fL;Co.calcXY=dL;Co.clamp=js;function Zh(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function Bv(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function uL(e,t,n,r,o,i){const{margin:s,containerPadding:a,rowHeight:l}=e,u=Zh(e),d={};return i&&i.resizing?(d.width=Math.round(i.resizing.width),d.height=Math.round(i.resizing.height)):(d.width=Bv(r,u,s[0]),d.height=Bv(o,l,s[1])),i&&i.dragging?(d.top=Math.round(i.dragging.top),d.left=Math.round(i.dragging.left)):i&&i.resizing&&typeof i.resizing.top=="number"&&typeof i.resizing.left=="number"?(d.top=Math.round(i.resizing.top),d.left=Math.round(i.resizing.left)):(d.top=Math.round((l+s[1])*n+a[1]),d.left=Math.round((u+s[0])*t+a[0])),d}function dL(e,t,n,r,o){const{margin:i,cols:s,rowHeight:a,maxRows:l}=e,u=Zh(e);let d=Math.round((n-i[0])/(u+i[0])),h=Math.round((t-i[1])/(a+i[1]));return d=js(d,0,s-r),h=js(h,0,l-o),{x:d,y:h}}function fL(e,t,n,r,o,i){const{margin:s,maxRows:a,cols:l,rowHeight:u}=e,d=Zh(e);let h=Math.round((t+s[0])/(d+s[0])),p=Math.round((n+s[1])/(u+s[1])),g=js(h,0,l-r),b=js(p,0,a-o);return["sw","w","nw"].indexOf(i)!==-1&&(g=js(h,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(b=js(p,0,a)),{w:g,h:b}}function js(e,t,n){return Math.max(Math.min(e,n),t)}var Jh={},Uv={exports:{}},um,d_;function x0(){if(d_)return um;d_=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return um=e,um}var dm,f_;function hL(){if(f_)return dm;f_=1;var e=x0();function t(){}function n(){}return n.resetWarningCache=t,dm=function(){function r(s,a,l,u,d,h){if(h!==e){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}r.isRequired=r;function o(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},dm}var Jd={exports:{}},xt={};/** @license React v16.13.1
|
|
89
89
|
* react-is.development.js
|
|
90
90
|
*
|
|
91
91
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
package/dist/dashboard/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-wfFQDxUt.js");require("react");require("react-dom");exports.Dashboard=e.Dashboard;
|
package/dist/dashboard/index.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-wfFQDxUt.js"),d=require("./chunks/dashboard-plus-CX4nhe39.js"),I=require("react");require("react-dom");function N({card:t,footer:u,className:m,...c}){const{customCards:r}=e.useSemaphorContext(),h=I.useRef(null),{isError:p,isLoading:n,isFetching:i,cfg:x,visualKey:C,handleDatapointClick:f}=e.useDashboardCard(t),a=e.useDashboardStore(s=>s.themeStyle),l=e.useDashboardStore(s=>s.selectedSheetId),E=e.useDashboardStore(s=>s.selectedCardId),j=e.useDashboardStore(s=>s.isDashboardEditing),{setCardTitle:g,setCardDescription:D,setSelectedCardId:b}=e.useDashboardActions();function S(s){s.stopPropagation(),b(l,t.id)}function T(){if(r&&r.length>0){const s=r.find(o=>o.cardId===t.id);if(s&&s.replaceDefault){const o=s.content;if(o)return e.jsxRuntimeExports.jsx(o,{card:t})}}return t.type==="kpi"?t.data&&t.data.length>0&&e.jsxRuntimeExports.jsx(e.KPICard,{isLoading:n||i,card:t}):y}function R(){if(p)return e.jsxRuntimeExports.jsx("p",{className:"text-sm",children:"Oops! It seems like something went wrong. Please review your connection or filters."});if(t.type==="table"&&t.data&&t.data.length>0)return e.jsxRuntimeExports.jsxs(e.ScrollArea,{children:[e.jsxRuntimeExports.jsx(e.TableVisual,{card:t,data:t.data}),e.jsxRuntimeExports.jsx(e.ScrollBar,{orientation:"horizontal"})]});if(r&&r.length>0){const s=r.find(o=>o.cardId===t.id);if(s&&s.content){const o=s.content;return e.jsxRuntimeExports.jsx(o,{card:t})}}if(x)return e.jsxRuntimeExports.jsx(e.ChartJsVisual,{cfg:x,onDatapointClick:f},C)}function A(){if(r&&r.length>0){const s=r.find(o=>o.cardId===t.id);if(s&&s.footer){const o=s.footer;if(o)return e.jsxRuntimeExports.jsx(o,{card:t})}}return u||null}if(!t.id)return null;const y=e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs(e.CardHeader,{className:"pb-4",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxRuntimeExports.jsx(e.Editable,{text:t.title,onSave:s=>g(l,t.id,s),children:e.jsxRuntimeExports.jsx(e.CardTitle,{className:"text-base",children:t.title})}),t.refreshInterval&&e.jsxRuntimeExports.jsxs(e.Tooltip,{children:[e.jsxRuntimeExports.jsx(e.TooltipTrigger,{className:"pr-1",children:e.jsxRuntimeExports.jsx("div",{className:e.cn("h-2 w-2 rounded-full bg-green-500 transition-opacity",{"opacity-10":n||i})})}),e.jsxRuntimeExports.jsx(e.TooltipContent,{side:"right",align:"center",children:e.jsxRuntimeExports.jsx("p",{className:"text-xs",children:`Realtime (${t==null?void 0:t.refreshInterval})`})})]}),!t.refreshInterval&&(n||i)&&e.jsxRuntimeExports.jsx(e.LoaderCircle,{className:"h-4 w-4 animate-spin text-muted-foreground"})]}),e.jsxRuntimeExports.jsx(e.Editable,{text:(t==null?void 0:t.description)||"",onSave:s=>D(l,t.id,s),children:e.jsxRuntimeExports.jsxs(e.CardDescription,{children:[" ",t.description]})})]}),e.jsxRuntimeExports.jsx(e.CardContent,{className:"relative flex grow flex-col overflow-auto pb-0",children:R()}),e.jsxRuntimeExports.jsx(e.CardFooter,{children:A()})]});return e.jsxRuntimeExports.jsx(e.Card,{tabIndex:-1,ref:h,role:"dashboard-card",onClick:S,className:e.cn("relative flex h-full flex-col rounded-sm",{"border-dashed border-foreground/50":E===t.id&&j},a==null?void 0:a.dashboardCard,m),...c,children:T()})}exports.BOOLEAN_DATA_TYPES=e.BOOLEAN_DATA_TYPES;exports.DATE_DATA_TYPES=e.DATE_DATA_TYPES;exports.Dashboard=e.Dashboard;exports.DashboardWC=e.DashboardWC;exports.NUMBER_DATA_TYPES=e.NUMBER_DATA_TYPES;exports.SemaphorQueryClient=e.SemaphorQueryClient;exports.TEXT_DATA_TYPES=e.TEXT_DATA_TYPES;exports.cleanCard=e.cleanCard;exports.createSqlGenConfig=e.createSqlGenConfig;exports.fmt=e.fmt;exports.getBookmarkKey=e.getBookmarkKey;exports.getColumnDataType=e.getColumnDataType;exports.getDashbaordStateWithoutData=e.getDashbaordStateWithoutData;exports.getFilterValueType=e.getFilterValueType;exports.getQualifiedTableName=e.getQualifiedTableName;exports.getSql=e.getSql;exports.isColumnInSqlGen=e.isColumnInSqlGen;exports.resolveDataType=e.resolveDataType;exports.useCard=e.useCard;exports.useDashboardActions=e.useDashboardActions;exports.useDashboardStore=e.useDashboardStore;exports.useEditorActions=e.useEditorActions;exports.useEditorStore=e.useEditorStore;exports.SelectComponent=d.SelectComponent;exports.Surfboard=d.DashboardPlus;exports.useEditorAside=d.useEditorAside;exports.DashboardCard=N;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { u as _, a as k, b as n, c as w, j as s, C as F, E as f, d as P, T as R, e as B, f as h, g as L, L as q, h as K, i as O, k as Y, l as G, K as V, S as z, m as H, n as J, o as M } from "./chunks/index-
|
|
2
|
-
import { B as se, s as te, D as ae, q as oe, N as ne, I as re, r as ie, M as le, w as de, t as ue, O as ce, y as fe, J as he, x as Ce, A as xe, v as me, z as pe, F as ge, p as je, H as De, G as be } from "./chunks/index-
|
|
3
|
-
import { S as Te, D as Ee, u as Ie } from "./chunks/dashboard-plus-
|
|
1
|
+
import { u as _, a as k, b as n, c as w, j as s, C as F, E as f, d as P, T as R, e as B, f as h, g as L, L as q, h as K, i as O, k as Y, l as G, K as V, S as z, m as H, n as J, o as M } from "./chunks/index-gxZdRnEK.js";
|
|
2
|
+
import { B as se, s as te, D as ae, q as oe, N as ne, I as re, r as ie, M as le, w as de, t as ue, O as ce, y as fe, J as he, x as Ce, A as xe, v as me, z as pe, F as ge, p as je, H as De, G as be } from "./chunks/index-gxZdRnEK.js";
|
|
3
|
+
import { S as Te, D as Ee, u as Ie } from "./chunks/dashboard-plus-7iejGOYa.js";
|
|
4
4
|
import Q from "react";
|
|
5
5
|
import "react-dom";
|
|
6
6
|
function $({
|
package/dist/surfboard/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../chunks/dashboard-plus-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../chunks/dashboard-plus-CX4nhe39.js");require("../chunks/index-wfFQDxUt.js");require("react");require("react-dom");exports.Surfboard=r.DashboardPlus;
|
package/dist/surfboard/index.js
CHANGED