react-semaphor 0.0.231 → 0.0.232
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-25PFXna3.js → dashboard-plus-B20VN3pn.js} +1 -1
- package/dist/chunks/{dashboard-plus-wdDBOvP8.js → dashboard-plus-SLRbyBnR.js} +1 -1
- package/dist/chunks/{index-N9bg__00.js → index-DUw3t3sl.js} +1 -1
- package/dist/chunks/{index-4Pk6XZ_O.js → index-o98c3gXS.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 +4 -4
- 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 { O as T, b as k, j as e, P as Ss, Q as ks, R as w, U as ws, V as zs, W as Fs, X as Os, Y as Ms, Z as _, _ as he, $ as lt, J as it, M as Ae, a0 as Qt, a1 as Wt, a2 as Yt, a3 as Zt, a4 as Xt, a5 as ea, a6 as Js, a7 as $e, a8 as Ue, a9 as rs, T as Ts, e as ot, g as Ds, aa as Oe, ab as Me, f as Y, ac as Te, ad as De, ae as Pe, af as Le, ag as ee, ah as As, G as c, ai as Ls, aj as Es, ak as Is, w as ct, v as dt, t as ue, al as sa, r as ta, N as ht, s as aa, am as na, B as ra, an as mt, ao as la, S as Vs, z as ia, n as Us, ap as bs, A as ut, aq as ys, u as Qe, ar as me, as as be, at as Ke, au as xt, av as pt, aw as oa, ax as ca, ay as ft, az as da, aA as ha, aB as ma, aC as ua, aD as xa, aE as vs, aF as pa, aG as Be, aH as Ns, aI as Fe, aJ as Cs, aK as Qs, aL as fa, aM as ga, aN as ja, aO as ba, aP as ya, aQ as js, aR as va, aS as Ws, aT as Na, aU as Ys, aV as Ca, aW as Sa, aX as ka, c as wa, aY as gt, l as za, C as Fa, E as ts, d as Oa, h as Ma, aZ as Ta, i as Da, o as Aa, a_ as La, m as Ea, H as qs, a$ as Ia, b0 as jt, b1 as bt, b2 as as, b3 as yt, b4 as ns, b5 as Zs, b6 as os, b7 as cs, b8 as ds, K as Va, b9 as qa, ba as Ra, bb as vt, bc as Rs, bd as Ee, be as Nt, bf as _a, bg as Ha, bh as Ba, bi as $a, bj as Pa, bk as Xs, bl as Ka, bm as Ga, bn as Ja, bo as Ua, bp as Qa, bq as Wa, br as Ya, bs as Za, bt as Ce, bu as B, bv as $, bw as _s, bx as P, by as et, bz as Xa, bA as en, bB as sn, bC as tn, bD as an, bE as nn, bF as rn, bG as ln, bH as on, bI as cn } from "./index-
|
|
1
|
+
import { O as T, b as k, j as e, P as Ss, Q as ks, R as w, U as ws, V as zs, W as Fs, X as Os, Y as Ms, Z as _, _ as he, $ as lt, J as it, M as Ae, a0 as Qt, a1 as Wt, a2 as Yt, a3 as Zt, a4 as Xt, a5 as ea, a6 as Js, a7 as $e, a8 as Ue, a9 as rs, T as Ts, e as ot, g as Ds, aa as Oe, ab as Me, f as Y, ac as Te, ad as De, ae as Pe, af as Le, ag as ee, ah as As, G as c, ai as Ls, aj as Es, ak as Is, w as ct, v as dt, t as ue, al as sa, r as ta, N as ht, s as aa, am as na, B as ra, an as mt, ao as la, S as Vs, z as ia, n as Us, ap as bs, A as ut, aq as ys, u as Qe, ar as me, as as be, at as Ke, au as xt, av as pt, aw as oa, ax as ca, ay as ft, az as da, aA as ha, aB as ma, aC as ua, aD as xa, aE as vs, aF as pa, aG as Be, aH as Ns, aI as Fe, aJ as Cs, aK as Qs, aL as fa, aM as ga, aN as ja, aO as ba, aP as ya, aQ as js, aR as va, aS as Ws, aT as Na, aU as Ys, aV as Ca, aW as Sa, aX as ka, c as wa, aY as gt, l as za, C as Fa, E as ts, d as Oa, h as Ma, aZ as Ta, i as Da, o as Aa, a_ as La, m as Ea, H as qs, a$ as Ia, b0 as jt, b1 as bt, b2 as as, b3 as yt, b4 as ns, b5 as Zs, b6 as os, b7 as cs, b8 as ds, K as Va, b9 as qa, ba as Ra, bb as vt, bc as Rs, bd as Ee, be as Nt, bf as _a, bg as Ha, bh as Ba, bi as $a, bj as Pa, bk as Xs, bl as Ka, bm as Ga, bn as Ja, bo as Ua, bp as Qa, bq as Wa, br as Ya, bs as Za, bt as Ce, bu as B, bv as $, bw as _s, bx as P, by as et, bz as Xa, bA as en, bB as sn, bC as tn, bD as an, bE as nn, bF as rn, bG as ln, bH as on, bI as cn } from "./index-DUw3t3sl.js";
|
|
2
2
|
import * as st from "react";
|
|
3
3
|
import xe, { useState as M, useEffect as U, useMemo as dn, useRef as Ge } from "react";
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const e=require("./index-
|
|
1
|
+
"use strict";const e=require("./index-o98c3gXS.js"),b=require("react");function jt(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const s in t)if(s!=="default"){const n=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(r,s,n.get?n:{enumerable:!0,get:()=>t[s]})}}return r.default=t,Object.freeze(r)}const Be=jt(b);/**
|
|
2
2
|
* @license lucide-react v0.379.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -8583,7 +8583,7 @@ const Le = qT()(
|
|
|
8583
8583
|
selectedCard: null,
|
|
8584
8584
|
showFilters: !1,
|
|
8585
8585
|
//This should be false by default
|
|
8586
|
-
isDashboardEditing: !
|
|
8586
|
+
isDashboardEditing: !1,
|
|
8587
8587
|
// This should be false by defaultdashboard.
|
|
8588
8588
|
isVisualEditing: !1,
|
|
8589
8589
|
// This should be false by defaultdashboard.
|
|
@@ -85,7 +85,7 @@ __p += '`),Mt&&(Re+=`' +
|
|
|
85
85
|
function print() { __p += __j.call(arguments, '') }
|
|
86
86
|
`:`;
|
|
87
87
|
`)+Re+`return __p
|
|
88
|
-
}`;var yt=PR(function(){return jt(B,Ye+"return "+Re).apply(n,q)});if(yt.source=Re,Lb(yt))throw yt;return yt}function Kj(d){return Ut(d).toLowerCase()}function Xj(d){return Ut(d).toUpperCase()}function Qj(d,g,x){if(d=Ut(d),d&&(x||g===n))return NC(d);if(!d||!(g=Ur(g)))return d;var R=zo(d),M=zo(g),B=LC(R,M),q=FC(R,M)+1;return Os(R,B,q).join("")}function Jj(d,g,x){if(d=Ut(d),d&&(x||g===n))return d.slice(0,zC(d)+1);if(!d||!(g=Ur(g)))return d;var R=zo(d),M=FC(R,zo(g))+1;return Os(R,0,M).join("")}function Zj(d,g,x){if(d=Ut(d),d&&(x||g===n))return d.replace(Bn,"");if(!d||!(g=Ur(g)))return d;var R=zo(d),M=LC(R,zo(g));return Os(R,M).join("")}function ez(d,g){var x=k,R=F;if(wn(g)){var M="separator"in g?g.separator:M;x="length"in g?pt(g.length):x,R="omission"in g?Ur(g.omission):R}d=Ut(d);var B=d.length;if(Vl(d)){var q=zo(d);B=q.length}if(x>=B)return d;var Z=x-Hl(R);if(Z<1)return R;var ae=q?Os(q,0,Z).join(""):d.slice(0,Z);if(M===n)return ae+R;if(q&&(Z+=ae.length-Z),Fb(M)){if(d.slice(Z).search(M)){var xe,we=ae;for(M.global||(M=eb(M.source,Ut(qe.exec(M))+"g")),M.lastIndex=0;xe=M.exec(we);)var Re=xe.index;ae=ae.slice(0,Re===n?Z:Re)}}else if(d.indexOf(Ur(M),Z)!=Z){var je=ae.lastIndexOf(M);je>-1&&(ae=ae.slice(0,je))}return ae+R}function tz(d){return d=Ut(d),d&&On.test(d)?d.replace(Xt,T7):d}var nz=Xl(function(d,g,x){return d+(x?" ":"")+g.toUpperCase()}),Bb=OE("toUpperCase");function RR(d,g,x){return d=Ut(d),g=x?n:g,g===n?E7(d)?k7(d):m7(d):d.match(g)||[]}var PR=St(function(d,g){try{return Hr(d,n,g)}catch(x){return Lb(x)?x:new ct(x)}}),rz=zi(function(d,g){return yo(g,function(x){x=li(x),Fi(d,x,Ib(d[x],d))}),d});function oz(d){var g=d==null?0:d.length,x=Je();return d=g?yn(d,function(R){if(typeof R[1]!="function")throw new xo(s);return[x(R[0]),R[1]]}):[],St(function(R){for(var M=-1;++M<g;){var B=d[M];if(Hr(B[0],this,R))return Hr(B[1],this,R)}})}function iz(d){return T6(_o(d,f))}function Vb(d){return function(){return d}}function sz(d,g){return d==null||d!==d?g:d}var az=TE(),lz=TE(!0);function Or(d){return d}function Hb(d){return sE(typeof d=="function"?d:_o(d,f))}function cz(d){return lE(_o(d,f))}function uz(d,g){return cE(d,_o(g,f))}var dz=St(function(d,g){return function(x){return Nu(x,d,g)}}),fz=St(function(d,g){return function(x){return Nu(d,x,g)}});function Wb(d,g,x){var R=Hn(g),M=jh(g,R);x==null&&!(wn(g)&&(M.length||!R.length))&&(x=g,g=d,d=this,M=jh(g,Hn(g)));var B=!(wn(x)&&"chain"in x)||!!x.chain,q=Vi(d);return yo(M,function(Z){var ae=g[Z];d[Z]=ae,q&&(d.prototype[Z]=function(){var xe=this.__chain__;if(B||xe){var we=d(this.__wrapped__),Re=we.__actions__=Er(this.__actions__);return Re.push({func:ae,args:arguments,thisArg:d}),we.__chain__=xe,we}return ae.apply(d,_s([this.value()],arguments))})}),d}function hz(){return Gn._===this&&(Gn._=j7),this}function Ub(){}function pz(d){return d=pt(d),St(function(g){return uE(g,d)})}var gz=_b(yn),mz=_b(DC),vz=_b(Gv);function OR(d){return $b(d)?Yv(li(d)):G6(d)}function bz(d){return function(g){return d==null?n:Pa(d,g)}}var yz=AE(),xz=AE(!0);function qb(){return[]}function Gb(){return!1}function wz(){return{}}function _z(){return""}function Sz(){return!0}function Cz(d,g){if(d=pt(d),d<1||d>Y)return[];var x=V,R=rr(d,V);g=Je(g),d-=V;for(var M=Qv(R,g);++x<d;)g(x);return M}function Ez(d){return ut(d)?yn(d,li):qr(d)?[d]:Er(YE(Ut(d)))}function Rz(d){var g=++L7;return Ut(d)+g}var Pz=Uh(function(d,g){return d+g},0),Oz=Sb("ceil"),$z=Uh(function(d,g){return d/g},1),Tz=Sb("floor");function Dz(d){return d&&d.length?Fh(d,Or,lb):n}function Az(d,g){return d&&d.length?Fh(d,Je(g,2),lb):n}function kz(d){return MC(d,Or)}function Mz(d,g){return MC(d,Je(g,2))}function Iz(d){return d&&d.length?Fh(d,Or,fb):n}function Nz(d,g){return d&&d.length?Fh(d,Je(g,2),fb):n}var Lz=Uh(function(d,g){return d*g},1),Fz=Sb("round"),jz=Uh(function(d,g){return d-g},0);function zz(d){return d&&d.length?Xv(d,Or):0}function Bz(d,g){return d&&d.length?Xv(d,Je(g,2)):0}return j.after=c8,j.ary=iR,j.assign=X8,j.assignIn=yR,j.assignInWith=op,j.assignWith=Q8,j.at=J8,j.before=sR,j.bind=Ib,j.bindAll=rz,j.bindKey=aR,j.castArray=w8,j.chain=nR,j.chunk=T9,j.compact=D9,j.concat=A9,j.cond=oz,j.conforms=iz,j.constant=Vb,j.countBy=z4,j.create=Z8,j.curry=lR,j.curryRight=cR,j.debounce=uR,j.defaults=ej,j.defaultsDeep=tj,j.defer=u8,j.delay=d8,j.difference=k9,j.differenceBy=M9,j.differenceWith=I9,j.drop=N9,j.dropRight=L9,j.dropRightWhile=F9,j.dropWhile=j9,j.fill=z9,j.filter=V4,j.flatMap=U4,j.flatMapDeep=q4,j.flatMapDepth=G4,j.flatten=JE,j.flattenDeep=B9,j.flattenDepth=V9,j.flip=f8,j.flow=az,j.flowRight=lz,j.fromPairs=H9,j.functions=lj,j.functionsIn=cj,j.groupBy=Y4,j.initial=U9,j.intersection=q9,j.intersectionBy=G9,j.intersectionWith=Y9,j.invert=dj,j.invertBy=fj,j.invokeMap=X4,j.iteratee=Hb,j.keyBy=Q4,j.keys=Hn,j.keysIn=Pr,j.map=Jh,j.mapKeys=pj,j.mapValues=gj,j.matches=cz,j.matchesProperty=uz,j.memoize=ep,j.merge=mj,j.mergeWith=xR,j.method=dz,j.methodOf=fz,j.mixin=Wb,j.negate=tp,j.nthArg=pz,j.omit=vj,j.omitBy=bj,j.once=h8,j.orderBy=J4,j.over=gz,j.overArgs=p8,j.overEvery=mz,j.overSome=vz,j.partial=Nb,j.partialRight=dR,j.partition=Z4,j.pick=yj,j.pickBy=wR,j.property=OR,j.propertyOf=bz,j.pull=J9,j.pullAll=eR,j.pullAllBy=Z9,j.pullAllWith=e4,j.pullAt=t4,j.range=yz,j.rangeRight=xz,j.rearg=g8,j.reject=n8,j.remove=n4,j.rest=m8,j.reverse=kb,j.sampleSize=o8,j.set=wj,j.setWith=_j,j.shuffle=i8,j.slice=r4,j.sortBy=l8,j.sortedUniq=u4,j.sortedUniqBy=d4,j.split=Uj,j.spread=v8,j.tail=f4,j.take=h4,j.takeRight=p4,j.takeRightWhile=g4,j.takeWhile=m4,j.tap=D4,j.throttle=b8,j.thru=Qh,j.toArray=mR,j.toPairs=_R,j.toPairsIn=SR,j.toPath=Ez,j.toPlainObject=bR,j.transform=Sj,j.unary=y8,j.union=v4,j.unionBy=b4,j.unionWith=y4,j.uniq=x4,j.uniqBy=w4,j.uniqWith=_4,j.unset=Cj,j.unzip=Mb,j.unzipWith=tR,j.update=Ej,j.updateWith=Rj,j.values=Zl,j.valuesIn=Pj,j.without=S4,j.words=RR,j.wrap=x8,j.xor=C4,j.xorBy=E4,j.xorWith=R4,j.zip=P4,j.zipObject=O4,j.zipObjectDeep=$4,j.zipWith=T4,j.entries=_R,j.entriesIn=SR,j.extend=yR,j.extendWith=op,Wb(j,j),j.add=Pz,j.attempt=PR,j.camelCase=Dj,j.capitalize=CR,j.ceil=Oz,j.clamp=Oj,j.clone=_8,j.cloneDeep=C8,j.cloneDeepWith=E8,j.cloneWith=S8,j.conformsTo=R8,j.deburr=ER,j.defaultTo=sz,j.divide=$z,j.endsWith=Aj,j.eq=Vo,j.escape=kj,j.escapeRegExp=Mj,j.every=B4,j.find=H4,j.findIndex=XE,j.findKey=nj,j.findLast=W4,j.findLastIndex=QE,j.findLastKey=rj,j.floor=Tz,j.forEach=rR,j.forEachRight=oR,j.forIn=oj,j.forInRight=ij,j.forOwn=sj,j.forOwnRight=aj,j.get=jb,j.gt=P8,j.gte=O8,j.has=uj,j.hasIn=zb,j.head=ZE,j.identity=Or,j.includes=K4,j.indexOf=W9,j.inRange=$j,j.invoke=hj,j.isArguments=Ta,j.isArray=ut,j.isArrayBuffer=$8,j.isArrayLike=Rr,j.isArrayLikeObject=$n,j.isBoolean=T8,j.isBuffer=$s,j.isDate=D8,j.isElement=A8,j.isEmpty=k8,j.isEqual=M8,j.isEqualWith=I8,j.isError=Lb,j.isFinite=N8,j.isFunction=Vi,j.isInteger=fR,j.isLength=np,j.isMap=hR,j.isMatch=L8,j.isMatchWith=F8,j.isNaN=j8,j.isNative=z8,j.isNil=V8,j.isNull=B8,j.isNumber=pR,j.isObject=wn,j.isObjectLike=Sn,j.isPlainObject=Vu,j.isRegExp=Fb,j.isSafeInteger=H8,j.isSet=gR,j.isString=rp,j.isSymbol=qr,j.isTypedArray=Jl,j.isUndefined=W8,j.isWeakMap=U8,j.isWeakSet=q8,j.join=K9,j.kebabCase=Ij,j.last=Co,j.lastIndexOf=X9,j.lowerCase=Nj,j.lowerFirst=Lj,j.lt=G8,j.lte=Y8,j.max=Dz,j.maxBy=Az,j.mean=kz,j.meanBy=Mz,j.min=Iz,j.minBy=Nz,j.stubArray=qb,j.stubFalse=Gb,j.stubObject=wz,j.stubString=_z,j.stubTrue=Sz,j.multiply=Lz,j.nth=Q9,j.noConflict=hz,j.noop=Ub,j.now=Zh,j.pad=Fj,j.padEnd=jj,j.padStart=zj,j.parseInt=Bj,j.random=Tj,j.reduce=e8,j.reduceRight=t8,j.repeat=Vj,j.replace=Hj,j.result=xj,j.round=Fz,j.runInContext=oe,j.sample=r8,j.size=s8,j.snakeCase=Wj,j.some=a8,j.sortedIndex=o4,j.sortedIndexBy=i4,j.sortedIndexOf=s4,j.sortedLastIndex=a4,j.sortedLastIndexBy=l4,j.sortedLastIndexOf=c4,j.startCase=qj,j.startsWith=Gj,j.subtract=jz,j.sum=zz,j.sumBy=Bz,j.template=Yj,j.times=Cz,j.toFinite=Hi,j.toInteger=pt,j.toLength=vR,j.toLower=Kj,j.toNumber=Eo,j.toSafeInteger=K8,j.toString=Ut,j.toUpper=Xj,j.trim=Qj,j.trimEnd=Jj,j.trimStart=Zj,j.truncate=ez,j.unescape=tz,j.uniqueId=Rz,j.upperCase=nz,j.upperFirst=Bb,j.each=rR,j.eachRight=oR,j.first=ZE,Wb(j,function(){var d={};return si(j,function(g,x){Qt.call(j.prototype,x)||(d[x]=g)}),d}(),{chain:!1}),j.VERSION=r,yo(["bind","bindKey","curry","curryRight","partial","partialRight"],function(d){j[d].placeholder=j}),yo(["drop","take"],function(d,g){kt.prototype[d]=function(x){x=x===n?1:In(pt(x),0);var R=this.__filtered__&&!g?new kt(this):this.clone();return R.__filtered__?R.__takeCount__=rr(x,R.__takeCount__):R.__views__.push({size:rr(x,V),type:d+(R.__dir__<0?"Right":"")}),R},kt.prototype[d+"Right"]=function(x){return this.reverse()[d](x).reverse()}}),yo(["filter","map","takeWhile"],function(d,g){var x=g+1,R=x==te||x==J;kt.prototype[d]=function(M){var B=this.clone();return B.__iteratees__.push({iteratee:Je(M,3),type:x}),B.__filtered__=B.__filtered__||R,B}}),yo(["head","last"],function(d,g){var x="take"+(g?"Right":"");kt.prototype[d]=function(){return this[x](1).value()[0]}}),yo(["initial","tail"],function(d,g){var x="drop"+(g?"":"Right");kt.prototype[d]=function(){return this.__filtered__?new kt(this):this[x](1)}}),kt.prototype.compact=function(){return this.filter(Or)},kt.prototype.find=function(d){return this.filter(d).head()},kt.prototype.findLast=function(d){return this.reverse().find(d)},kt.prototype.invokeMap=St(function(d,g){return typeof d=="function"?new kt(this):this.map(function(x){return Nu(x,d,g)})}),kt.prototype.reject=function(d){return this.filter(tp(Je(d)))},kt.prototype.slice=function(d,g){d=pt(d);var x=this;return x.__filtered__&&(d>0||g<0)?new kt(x):(d<0?x=x.takeRight(-d):d&&(x=x.drop(d)),g!==n&&(g=pt(g),x=g<0?x.dropRight(-g):x.take(g-d)),x)},kt.prototype.takeRightWhile=function(d){return this.reverse().takeWhile(d).reverse()},kt.prototype.toArray=function(){return this.take(V)},si(kt.prototype,function(d,g){var x=/^(?:filter|find|map|reject)|While$/.test(g),R=/^(?:head|last)$/.test(g),M=j[R?"take"+(g=="last"?"Right":""):g],B=R||/^find/.test(g);M&&(j.prototype[g]=function(){var q=this.__wrapped__,Z=R?[1]:arguments,ae=q instanceof kt,xe=Z[0],we=ae||ut(q),Re=function(Ot){var Mt=M.apply(j,_s([Ot],Z));return R&&je?Mt[0]:Mt};we&&x&&typeof xe=="function"&&xe.length!=1&&(ae=we=!1);var je=this.__chain__,Ye=!!this.__actions__.length,et=B&&!je,yt=ae&&!Ye;if(!B&&we){q=yt?q:new kt(this);var tt=d.apply(q,Z);return tt.__actions__.push({func:Qh,args:[Re],thisArg:n}),new wo(tt,je)}return et&&yt?d.apply(this,Z):(tt=this.thru(Re),et?R?tt.value()[0]:tt.value():tt)})}),yo(["pop","push","shift","sort","splice","unshift"],function(d){var g=Sh[d],x=/^(?:push|sort|unshift)$/.test(d)?"tap":"thru",R=/^(?:pop|shift)$/.test(d);j.prototype[d]=function(){var M=arguments;if(R&&!this.__chain__){var B=this.value();return g.apply(ut(B)?B:[],M)}return this[x](function(q){return g.apply(ut(q)?q:[],M)})}}),si(kt.prototype,function(d,g){var x=j[g];if(x){var R=x.name+"";Qt.call(Gl,R)||(Gl[R]=[]),Gl[R].push({name:g,func:x})}}),Gl[Wh(n,y).name]=[{name:"wrapper",func:n}],kt.prototype.clone=t6,kt.prototype.reverse=n6,kt.prototype.value=r6,j.prototype.at=A4,j.prototype.chain=k4,j.prototype.commit=M4,j.prototype.next=I4,j.prototype.plant=L4,j.prototype.reverse=F4,j.prototype.toJSON=j.prototype.valueOf=j.prototype.value=j4,j.prototype.first=j.prototype.head,$u&&(j.prototype[$u]=N4),j},Wl=M7();_a?((_a.exports=Wl)._=Wl,Hv._=Wl):Gn._=Wl}).call(Ws)})(Mg,Mg.exports);var bc=Mg.exports;const al=Rl(bc);function YR({id:e,layouts:t,initialHeight:n,y:r,x:o,w:i,minH:s}){const a={i:e,x:o??0,y:r??1/0,w:i||20,h:n||35,minW:6,minH:s||10};return t||(t={}),iw.forEach(l=>{t!=null&&t[l]||(t={...t,[l]:[]});const c=t[l].reduce((u,f)=>Math.max(u,f.y+f.h),0);a.y=a.y===0?0:c,t[l].push(a)}),t}function KR(e,t){t&&iw.forEach(n=>{t!=null&&t[n]&&(t[n]=t[n].filter(r=>r.i!==e))})}const De=rD()(uD((e,t)=>({isSessionExpired:!1,currentBreakpoint:"lg",dashboard:{id:"",style:tx},showContext:!1,selectedSheetId:null,selectedCardId:null,selectedFrameId:null,selectedCard:null,showFilters:!1,isDashboardEditing:!0,isVisualEditing:!1,showDashboardJSON:!1,filteringCards:[],actions:{deleteSheet:n=>{e(r=>{var i,s,a,l;const o=(i=r.dashboard.sheets)==null?void 0:i.findIndex(c=>c.id===n);o!==void 0&&o>-1&&((s=r.dashboard.sheets)==null||s.splice(o,1),r.selectedSheetId=(l=(a=r.dashboard.sheets)==null?void 0:a[0])==null?void 0:l.id)})},addSheet:n=>{e(r=>{r.dashboard.sheets||(r.dashboard.sheets=[]);const o=r.dashboard.filters;let i={};o==null||o.forEach(a=>{iw.forEach(l=>{i!=null&&i[l]||(i={...i,[l]:[]});const c={i:a.id,x:0,y:0,w:10,h:8};i[l].push(c)})});const s={...n,layouts:i};r.dashboard.sheets.push(s)})},setGlobalStyle:n=>{e(r=>{r.dashboard.globalStyle=n})},setAIScopeTables:n=>{e(r=>{r.dashboard.aiScopeTables=n})},setIsSessionExpired:n=>{e(()=>({isSessionExpired:n}))},setCardPython:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===o.selectedSheetId);i&&bc.forEach(i.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(f=>f.id===n);c&&(c.python=r)})})},addBaseQuery:n=>{e(r=>{var o;r.dashboard.baseQueries||(r.dashboard.baseQueries=[]),(o=r.dashboard.baseQueries)==null||o.push(n)})},removeBaseQuery:n=>{e(r=>{var i,s;const o=(i=r.dashboard.baseQueries)==null?void 0:i.findIndex(a=>a.id===n);o!=null&&o>-1&&((s=r.dashboard.baseQueries)==null||s.splice(o,1))})},setBaseQueries:n=>{e(r=>{r.dashboard.baseQueries=n})},setCurrentBreakpoint:n=>{e(()=>({currentBreakpoint:n}))},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)})},setSheetTitle:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.title=r)})},setCardTitle:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&bc.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(p=>p.id===r);u&&(u.title=o)})})},setCardInfo:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===o.selectedSheetId);i&&bc.forEach(i.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(f=>f.id===n);c&&(c.info=r)})})},setCardDescription:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&bc.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(p=>p.id===r);u&&(u.description=o)})})},setCardSql:(n,r,o)=>{e(i=>{var a,l,c,u;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){const f=(c=s.cards)==null?void 0:c.find(p=>p.id===r);f&&(f.sql=o,(u=i.onUpdateCard)==null||u.call(i,f,n))}})},setFrameCardData:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&bc.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(p=>p.id===r);u&&(u.data=o)})})},setSheetLayout:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layout=r)})},setSheetLayouts:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layouts=r)})},setShowContext:n=>{e(()=>({showContext:n}))},setShowFilters:n=>{e(()=>({showFilters:n}))},setFilterValues:n=>{e(()=>({filterValues:n}))},addOrUpdateFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1?r.filterValues.splice(o,1,n):r.filterValues.push(n)}else r.filterValues=[n]})},addOrUpdateFilterValues:n=>{e(r=>{r.filterValues?n.forEach(o=>{var s,a,l;const i=(s=r==null?void 0:r.filterValues)==null?void 0:s.findIndex(c=>c.filterId===o.filterId);i!==void 0&&i>-1?(a=r.filterValues)==null||a.splice(i,1,o):(l=r.filterValues)==null||l.push(o)}):r.filterValues=n})},removeFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.filter(i=>i.filterId!==n&&!i.filterId.startsWith(n));r.filterValues=o}})},replaceFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1&&r.filterValues.splice(o,1,n)}})},addFilter:n=>{e(r=>{var i,s;r.dashboard.filters?(i=r.dashboard.filters)==null||i.push(n):r.dashboard.filters=[n];const o=(s=r.dashboard.sheets)==null?void 0:s.find(a=>a.id===r.selectedSheetId);YR({id:n.id,layouts:o==null?void 0:o.layouts,y:0,initialHeight:8,minH:7,w:10})})},removeFilter:n=>{e(r=>{var o,i,s;if(r.dashboard.filters){const a=(o=r.dashboard.filters)==null?void 0:o.findIndex(l=>l.id===n);if(a>-1){(i=r.dashboard.filters)==null||i.splice(a,1);const l=(s=r.dashboard.sheets)==null?void 0:s.find(c=>c.id===r.selectedSheetId);KR(n,l==null?void 0:l.layouts)}}})},updateFrameCard:(n,r,o)=>{e(i=>{var l,c,u,f,p;const s=(c=(l=i.dashboard)==null?void 0:l.sheets)==null?void 0:c.find(h=>h.id===n);if(!s)return;const a=(u=s==null?void 0:s.frames)==null?void 0:u.find(h=>h.id===r);if(a){const h=(f=a.cards)==null?void 0:f.findIndex(b=>b.id===o.id);h>-1&&((p=a.cards)==null||p.splice(h,1,o))}})},updateFilter:n=>{e(r=>{var o,i;if(r.dashboard.filters){const s=(o=r.dashboard.filters)==null?void 0:o.findIndex(a=>a.id===n.id);s>-1&&((i=r.dashboard.filters)==null||i.splice(s,1,n))}})},setIsDashboardEditing:n=>{e(()=>({isDashboardEditing:n}))},setShowDashboardJSON:n=>{e(()=>({showDashboardJSON:n}))},setIsVisualEditing:n=>{e(()=>({isVisualEditing:n}))},addFrame:(n,r,o)=>{e(i=>{var a,l,c,u;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){s.frames||(s.frames=[]),(c=s.frames)==null||c.push(r);let f=1/0,p=0;o==="start"&&(f=0),YR({id:r.id,layouts:s.layouts,minH:10,x:p,y:f}),(u=i.onAddFrame)==null||u.call(i,r,n)}})},removeFrame:(n,r)=>{e(o=>{var s,a,l,c,u;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(f=>f.id===n);if(i){const f=(l=i.frames)==null?void 0:l.findIndex(p=>p.id===r);console.log(f),typeof f=="number"&&f>-1&&((c=i.frames)==null||c.splice(f,1),(u=i.layout)==null||u.splice(f,1),KR(r,i.layouts))}})},updateFrame:(n,r)=>{e(o=>{var a,l,c,u;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n),s=(c=i==null?void 0:i.frames)==null?void 0:c.findIndex(f=>f.id===r.id);i&&((u=i.frames)==null||u.splice(s,1,r))})},updateCard:(n,r)=>{e(o=>{var a,l,c,u,f;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(p=>p.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(p=>p.id===r.id);i&&((u=i.cards)==null||u.splice(s,1,r),(f=o.onUpdateCard)==null||f.call(o,r,n))})},removeCard:(n,r)=>{e(o=>{var a,l,c,u,f,p;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(h=>h.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(h=>h.id===r.id);i&&((u=i.cards)==null||u.splice(s,1),(f=i.layout)==null||f.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(c=>c.id===n);i&&(((l=i.cards)==null?void 0:l.find(u=>u.id===r))?o.selectedCardId=r:o.selectedCardId=null)})},setSelectedFrameId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(a=>a.id===r.selectedSheetId))&&(r.selectedFrameId=n)})},setSelectedSheetId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(a=>a.id===n))&&(r.selectedSheetId=n)})},setOnSaveFunction:n=>{e(()=>({onSaveFunction:n}))},setOnAddCard:n=>{e(()=>({onAddCard:n}))},setOnUpdateCard:n=>{e(()=>({onUpdateCard:n}))},setOnRemoveCard:n=>{e(()=>({onRemoveCard:n}))},setOnEvent:n=>{e(()=>({onEvent:n}))},getDashboard:()=>t().dashboard,getSelectedSheet:()=>{var n,r;return(r=(n=t().dashboard)==null?void 0:n.sheets)==null?void 0:r.find(o=>o.id===t().selectedSheetId)},getCardFrame:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a){for(let l=0;l<a.length;l++)if((i=a[l].cards)==null?void 0:i.find(u=>u.id===n))return a[l]}}},getSelectedFrame:()=>{var r,o,i;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(s=>s.id===t().selectedSheetId);return(i=n==null?void 0:n.frames)==null?void 0:i.find(s=>s.id===t().selectedFrameId)},getCard:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a)for(let l=0;l<a.length;l++){const c=(i=a[l].cards)==null?void 0:i.find(u=>u.id===n);if(c)return c}}},getSelectedSheetLayout:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layout},getSelectedSheetLayouts:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layouts},getStyle:()=>{var n;return(n=t().dashboard)==null?void 0:n.style},getCardSheet(n){var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a){for(let l=0;l<a.length;l++)if((i=a[l].cards)==null?void 0:i.find(u=>u.id===n))return r[s]}}},handleDataPointClickAction:(n,r)=>{uV({card:n,dataPoint:r,set:e,get:t})}}}))),Br=()=>De(e=>e.actions);var Vf=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(){}},tu=typeof window>"u"||"Deno"in window;function To(){}function dV(e,t){return typeof e=="function"?e(t):e}function rx(e){return typeof e=="number"&&e>=0&&e!==1/0}function vD(e,t){return Math.max(e+(t||0)-Date.now(),0)}function XR(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==lw(s,t.options))return!1}else if(!Hd(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 QR(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Vd(t.options.mutationKey)!==Vd(i))return!1}else if(!Hd(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function lw(e,t){return((t==null?void 0:t.queryKeyHashFn)||Vd)(e)}function Vd(e){return JSON.stringify(e,(t,n)=>ix(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Hd(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Hd(e[n],t[n])):!1}function bD(e,t){if(e===t)return e;const n=JR(e)&&JR(t);if(n||ix(e)&&ix(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),s=i.length,a=n?[]:{};let l=0;for(let c=0;c<s;c++){const u=n?c:i[c];!n&&e[u]===void 0&&t[u]===void 0&&r.includes(u)?(a[u]=void 0,l++):(a[u]=bD(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return o===s&&l===o?e:a}return t}function ox(e,t){if(e&&!t||t&&!e)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function JR(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ix(e){if(!ZR(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!ZR(n)||!n.hasOwnProperty("isPrototypeOf"))}function ZR(e){return Object.prototype.toString.call(e)==="[object Object]"}function fV(e){return new Promise(t=>{setTimeout(t,e)})}function sx(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?bD(e,t):t}function hV(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function pV(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Za,Us,Nc,jT,gV=(jT=class extends Vf{constructor(){super();Xe(this,Za,void 0);Xe(this,Us,void 0);Xe(this,Nc,void 0);Ve(this,Nc,t=>{if(!tu&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){se(this,Us)||this.setEventListener(se(this,Nc))}onUnsubscribe(){var t;this.hasListeners()||((t=se(this,Us))==null||t.call(this),Ve(this,Us,void 0))}setEventListener(t){var n;Ve(this,Nc,t),(n=se(this,Us))==null||n.call(this),Ve(this,Us,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){se(this,Za)!==t&&(Ve(this,Za,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof se(this,Za)=="boolean"?se(this,Za):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Za=new WeakMap,Us=new WeakMap,Nc=new WeakMap,jT),Ig=new gV,Lc,qs,Fc,zT,mV=(zT=class extends Vf{constructor(){super();Xe(this,Lc,!0);Xe(this,qs,void 0);Xe(this,Fc,void 0);Ve(this,Fc,t=>{if(!tu&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){se(this,qs)||this.setEventListener(se(this,Fc))}onUnsubscribe(){var t;this.hasListeners()||((t=se(this,qs))==null||t.call(this),Ve(this,qs,void 0))}setEventListener(t){var n;Ve(this,Fc,t),(n=se(this,qs))==null||n.call(this),Ve(this,qs,t(this.setOnline.bind(this)))}setOnline(t){se(this,Lc)!==t&&(Ve(this,Lc,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return se(this,Lc)}},Lc=new WeakMap,qs=new WeakMap,Fc=new WeakMap,zT),Ng=new mV;function vV(e){return Math.min(1e3*2**e,3e4)}function Rm(e){return(e??"online")==="online"?Ng.isOnline():!0}var yD=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function n0(e){return e instanceof yD}function xD(e){let t=!1,n=0,r=!1,o,i,s;const a=new Promise((w,y)=>{i=w,s=y}),l=w=>{var y;r||(h(new yD(w)),(y=e.abort)==null||y.call(e))},c=()=>{t=!0},u=()=>{t=!1},f=()=>!Ig.isFocused()||e.networkMode!=="always"&&!Ng.isOnline(),p=w=>{var y;r||(r=!0,(y=e.onSuccess)==null||y.call(e,w),o==null||o(),i(w))},h=w=>{var y;r||(r=!0,(y=e.onError)==null||y.call(e,w),o==null||o(),s(w))},b=()=>new Promise(w=>{var y;o=_=>{const S=r||!f();return S&&w(_),S},(y=e.onPause)==null||y.call(e)}).then(()=>{var w;o=void 0,r||(w=e.onContinue)==null||w.call(e)}),v=()=>{if(r)return;let w;try{w=e.fn()}catch(y){w=Promise.reject(y)}Promise.resolve(w).then(p).catch(y=>{var O;if(r)return;const _=e.retry??(tu?0:3),S=e.retryDelay??vV,C=typeof S=="function"?S(n,y):S,E=_===!0||typeof _=="number"&&n<_||typeof _=="function"&&_(n,y);if(t||!E){h(y);return}n++,(O=e.onFail)==null||O.call(e,n,y),fV(C).then(()=>{if(f())return b()}).then(()=>{t?h(y):v()})})};return Rm(e.networkMode)?v():b().then(v),{promise:a,cancel:l,continue:()=>(o==null?void 0:o())?a:Promise.resolve(),cancelRetry:c,continueRetry:u}}function bV(){let e=[],t=0,n=p=>{p()},r=p=>{p()},o=p=>setTimeout(p,0);const i=p=>{o=p},s=p=>{let h;t++;try{h=p()}finally{t--,t||c()}return h},a=p=>{t?e.push(p):o(()=>{n(p)})},l=p=>(...h)=>{a(()=>{p(...h)})},c=()=>{const p=e;e=[],p.length&&o(()=>{r(()=>{p.forEach(h=>{n(h)})})})};return{batch:s,batchCalls:l,schedule:a,setNotifyFunction:p=>{n=p},setBatchNotifyFunction:p=>{r=p},setScheduler:i}}var Qn=bV(),el,BT,wD=(BT=class{constructor(){Xe(this,el,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),rx(this.gcTime)&&Ve(this,el,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(tu?1/0:5*60*1e3))}clearGcTimeout(){se(this,el)&&(clearTimeout(se(this,el)),Ve(this,el,void 0))}},el=new WeakMap,BT),jc,zc,Po,Gs,Oo,Wn,Of,tl,Bc,mg,Yo,Yi,VT,yV=(VT=class extends wD{constructor(t){super();Xe(this,Bc);Xe(this,Yo);Xe(this,jc,void 0);Xe(this,zc,void 0);Xe(this,Po,void 0);Xe(this,Gs,void 0);Xe(this,Oo,void 0);Xe(this,Wn,void 0);Xe(this,Of,void 0);Xe(this,tl,void 0);Ve(this,tl,!1),Ve(this,Of,t.defaultOptions),Ct(this,Bc,mg).call(this,t.options),Ve(this,Wn,[]),Ve(this,Po,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ve(this,jc,t.state||xV(this.options)),this.state=se(this,jc),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!se(this,Wn).length&&this.state.fetchStatus==="idle"&&se(this,Po).remove(this)}setData(t,n){const r=sx(this.state.data,t,this.options);return Ct(this,Yo,Yi).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Ct(this,Yo,Yi).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=se(this,Gs);return(r=se(this,Oo))==null||r.cancel(t),n?n.then(To).catch(To):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(se(this,jc))}isActive(){return se(this,Wn).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||se(this,Wn).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!vD(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=se(this,Wn).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=se(this,Oo))==null||n.continue()}onOnline(){var n;const t=se(this,Wn).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=se(this,Oo))==null||n.continue()}addObserver(t){se(this,Wn).includes(t)||(se(this,Wn).push(t),this.clearGcTimeout(),se(this,Po).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){se(this,Wn).includes(t)&&(Ve(this,Wn,se(this,Wn).filter(n=>n!==t)),se(this,Wn).length||(se(this,Oo)&&(se(this,tl)?se(this,Oo).cancel({revert:!0}):se(this,Oo).cancelRetry()),this.scheduleGc()),se(this,Po).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return se(this,Wn).length}invalidate(){this.state.isInvalidated||Ct(this,Yo,Yi).call(this,{type:"invalidate"})}fetch(t,n){var c,u,f,p;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(se(this,Gs))return(c=se(this,Oo))==null||c.continueRetry(),se(this,Gs)}if(t&&Ct(this,Bc,mg).call(this,t),!this.options.queryFn){const h=se(this,Wn).find(b=>b.options.queryFn);h&&Ct(this,Bc,mg).call(this,h.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=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(Ve(this,tl,!0),r.signal)})};i(o);const s=()=>this.options.queryFn?(Ve(this,tl,!1),this.options.persister?this.options.persister(this.options.queryFn,o,this):this.options.queryFn(o)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),a={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(a),(u=this.options.behavior)==null||u.onFetch(a,this),Ve(this,zc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=a.fetchOptions)==null?void 0:f.meta))&&Ct(this,Yo,Yi).call(this,{type:"fetch",meta:(p=a.fetchOptions)==null?void 0:p.meta});const l=h=>{var b,v,w,y;n0(h)&&h.silent||Ct(this,Yo,Yi).call(this,{type:"error",error:h}),n0(h)||((v=(b=se(this,Po).config).onError)==null||v.call(b,h,this),(y=(w=se(this,Po).config).onSettled)==null||y.call(w,this.state.data,h,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return Ve(this,Oo,xD({fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:h=>{var b,v,w,y;if(typeof h>"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(h),(v=(b=se(this,Po).config).onSuccess)==null||v.call(b,h,this),(y=(w=se(this,Po).config).onSettled)==null||y.call(w,h,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(h,b)=>{Ct(this,Yo,Yi).call(this,{type:"failed",failureCount:h,error:b})},onPause:()=>{Ct(this,Yo,Yi).call(this,{type:"pause"})},onContinue:()=>{Ct(this,Yo,Yi).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),Ve(this,Gs,se(this,Oo).promise),se(this,Gs)}},jc=new WeakMap,zc=new WeakMap,Po=new WeakMap,Gs=new WeakMap,Oo=new WeakMap,Wn=new WeakMap,Of=new WeakMap,tl=new WeakMap,Bc=new WeakSet,mg=function(t){this.options={...se(this,Of),...t},this.updateGcTime(this.options.gcTime)},Yo=new WeakSet,Yi=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:Rm(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 n0(o)&&o.revert&&se(this,zc)?{...se(this,zc),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Qn.batch(()=>{se(this,Wn).forEach(r=>{r.onQueryUpdate()}),se(this,Po).notify({query:this,type:"updated",action:t})})},VT);function xV(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var hi,HT,_D=(HT=class extends Vf{constructor(t={}){super();Xe(this,hi,void 0);this.config=t,Ve(this,hi,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??lw(o,n);let s=this.get(i);return s||(s=new yV({cache:this,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){se(this,hi).has(t.queryHash)||(se(this,hi).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=se(this,hi).get(t.queryHash);n&&(t.destroy(),n===t&&se(this,hi).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Qn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return se(this,hi).get(t)}getAll(){return[...se(this,hi).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>XR(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>XR(t,r)):n}notify(t){Qn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Qn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Qn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},hi=new WeakMap,HT),pi,$f,Zr,Vc,gi,Fs,WT,wV=(WT=class extends wD{constructor(t){super();Xe(this,gi);Xe(this,pi,void 0);Xe(this,$f,void 0);Xe(this,Zr,void 0);Xe(this,Vc,void 0);this.mutationId=t.mutationId,Ve(this,$f,t.defaultOptions),Ve(this,Zr,t.mutationCache),Ve(this,pi,[]),this.state=t.state||_V(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...se(this,$f),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){se(this,pi).includes(t)||(se(this,pi).push(t),this.clearGcTimeout(),se(this,Zr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ve(this,pi,se(this,pi).filter(n=>n!==t)),this.scheduleGc(),se(this,Zr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){se(this,pi).length||(this.state.status==="pending"?this.scheduleGc():se(this,Zr).remove(this))}continue(){var t;return((t=se(this,Vc))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,a,l,c,u,f,p,h,b,v,w,y,_,S,C,E,O,T;const n=()=>(Ve(this,Vc,xD({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(I,N)=>{Ct(this,gi,Fs).call(this,{type:"failed",failureCount:I,error:N})},onPause:()=>{Ct(this,gi,Fs).call(this,{type:"pause"})},onContinue:()=>{Ct(this,gi,Fs).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),se(this,Vc).promise),r=this.state.status==="pending";try{if(!r){Ct(this,gi,Fs).call(this,{type:"pending",variables:t}),await((i=(o=se(this,Zr).config).onMutate)==null?void 0:i.call(o,t,this));const N=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));N!==this.state.context&&Ct(this,gi,Fs).call(this,{type:"pending",context:N,variables:t})}const I=await n();return await((c=(l=se(this,Zr).config).onSuccess)==null?void 0:c.call(l,I,t,this.state.context,this)),await((f=(u=this.options).onSuccess)==null?void 0:f.call(u,I,t,this.state.context)),await((h=(p=se(this,Zr).config).onSettled)==null?void 0:h.call(p,I,null,this.state.variables,this.state.context,this)),await((v=(b=this.options).onSettled)==null?void 0:v.call(b,I,null,t,this.state.context)),Ct(this,gi,Fs).call(this,{type:"success",data:I}),I}catch(I){try{throw await((y=(w=se(this,Zr).config).onError)==null?void 0:y.call(w,I,t,this.state.context,this)),await((S=(_=this.options).onError)==null?void 0:S.call(_,I,t,this.state.context)),await((E=(C=se(this,Zr).config).onSettled)==null?void 0:E.call(C,void 0,I,this.state.variables,this.state.context,this)),await((T=(O=this.options).onSettled)==null?void 0:T.call(O,void 0,I,t,this.state.context)),I}finally{Ct(this,gi,Fs).call(this,{type:"error",error:I})}}}},pi=new WeakMap,$f=new WeakMap,Zr=new WeakMap,Vc=new WeakMap,gi=new WeakSet,Fs=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:!Rm(this.options.networkMode),status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Qn.batch(()=>{se(this,pi).forEach(r=>{r.onMutationUpdate(t)}),se(this,Zr).notify({mutation:this,type:"updated",action:t})})},WT);function _V(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var $o,Tf,nl,UT,SV=(UT=class extends Vf{constructor(t={}){super();Xe(this,$o,void 0);Xe(this,Tf,void 0);Xe(this,nl,void 0);this.config=t,Ve(this,$o,[]),Ve(this,Tf,0)}build(t,n,r){const o=new wV({mutationCache:this,mutationId:++ip(this,Tf)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){se(this,$o).push(t),this.notify({type:"added",mutation:t})}remove(t){Ve(this,$o,se(this,$o).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){Qn.batch(()=>{se(this,$o).forEach(t=>{this.remove(t)})})}getAll(){return se(this,$o)}find(t){const n={exact:!0,...t};return se(this,$o).find(r=>QR(n,r))}findAll(t={}){return se(this,$o).filter(n=>QR(t,n))}notify(t){Qn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return Ve(this,nl,(se(this,nl)??Promise.resolve()).then(()=>{const t=se(this,$o).filter(n=>n.state.isPaused);return Qn.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(To)),Promise.resolve()))}).then(()=>{Ve(this,nl,void 0)})),se(this,nl)}},$o=new WeakMap,Tf=new WeakMap,nl=new WeakMap,UT);function CV(e){return{onFetch:(t,n)=>{const r=async()=>{var b,v,w,y,_;const o=t.options,i=(w=(v=(b=t.fetchOptions)==null?void 0:b.meta)==null?void 0:v.fetchMore)==null?void 0:w.direction,s=((y=t.state.data)==null?void 0:y.pages)||[],a=((_=t.state.data)==null?void 0:_.pageParams)||[],l={pages:[],pageParams:[]};let c=!1;const u=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(t.signal.aborted?c=!0:t.signal.addEventListener("abort",()=>{c=!0}),t.signal)})},f=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),p=async(S,C,E)=>{if(c)return Promise.reject();if(C==null&&S.pages.length)return Promise.resolve(S);const O={queryKey:t.queryKey,pageParam:C,direction:E?"backward":"forward",meta:t.options.meta};u(O);const T=await f(O),{maxPages:I}=t.options,N=E?pV:hV;return{pages:N(S.pages,T,I),pageParams:N(S.pageParams,C,I)}};let h;if(i&&s.length){const S=i==="backward",C=S?EV:eP,E={pages:s,pageParams:a},O=C(o,E);h=await p(E,O,S)}else{h=await p(l,a[0]??o.initialPageParam);const S=e??s.length;for(let C=1;C<S;C++){const E=eP(o,h);h=await p(h,E)}}return h};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 eP(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function EV(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,Ys,Ks,Hc,Wc,Xs,Uc,qc,qT,RV=(qT=class{constructor(e={}){Xe(this,Nn,void 0);Xe(this,Ys,void 0);Xe(this,Ks,void 0);Xe(this,Hc,void 0);Xe(this,Wc,void 0);Xe(this,Xs,void 0);Xe(this,Uc,void 0);Xe(this,qc,void 0);Ve(this,Nn,e.queryCache||new _D),Ve(this,Ys,e.mutationCache||new SV),Ve(this,Ks,e.defaultOptions||{}),Ve(this,Hc,new Map),Ve(this,Wc,new Map),Ve(this,Xs,0)}mount(){ip(this,Xs)._++,se(this,Xs)===1&&(Ve(this,Uc,Ig.subscribe(()=>{Ig.isFocused()&&(this.resumePausedMutations(),se(this,Nn).onFocus())})),Ve(this,qc,Ng.subscribe(()=>{Ng.isOnline()&&(this.resumePausedMutations(),se(this,Nn).onOnline())})))}unmount(){var e,t;ip(this,Xs)._--,se(this,Xs)===0&&((e=se(this,Uc))==null||e.call(this),Ve(this,Uc,void 0),(t=se(this,qc))==null||t.call(this),Ve(this,qc,void 0))}isFetching(e){return se(this,Nn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return se(this,Ys).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=se(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=se(this,Nn).find({queryKey:e}),o=r==null?void 0:r.state.data,i=dV(t,o);if(typeof i>"u")return;const s=this.defaultQueryOptions({queryKey:e});return se(this,Nn).build(this,s).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return Qn.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var t;return(t=se(this,Nn).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=se(this,Nn);Qn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=se(this,Nn),r={type:"active",...e};return Qn.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=Qn.batch(()=>se(this,Nn).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(To).catch(To)}invalidateQueries(e={},t={}){return Qn.batch(()=>{if(se(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=Qn.batch(()=>se(this,Nn).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(To)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(To)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=se(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(To).catch(To)}fetchInfiniteQuery(e){return e.behavior=CV(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(To).catch(To)}resumePausedMutations(){return se(this,Ys).resumePausedMutations()}getQueryCache(){return se(this,Nn)}getMutationCache(){return se(this,Ys)}getDefaultOptions(){return se(this,Ks)}setDefaultOptions(e){Ve(this,Ks,e)}setQueryDefaults(e,t){se(this,Hc).set(Vd(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...se(this,Hc).values()];let n={};return t.forEach(r=>{Hd(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){se(this,Wc).set(Vd(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...se(this,Wc).values()];let n={};return t.forEach(r=>{Hd(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...se(this,Ks).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=lw(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:{...se(this,Ks).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){se(this,Nn).clear(),se(this,Ys).clear()}},Nn=new WeakMap,Ys=new WeakMap,Ks=new WeakMap,Hc=new WeakMap,Wc=new WeakMap,Xs=new WeakMap,Uc=new WeakMap,qc=new WeakMap,qT),Mr,fn,Df,vr,rl,Gc,mi,Af,Yc,Kc,ol,il,Qs,Xc,sl,pd,kf,ax,Mf,lx,If,cx,Nf,ux,Lf,dx,Ff,fx,jf,hx,xm,SD,GT,PV=(GT=class extends Vf{constructor(t,n){super();Xe(this,sl);Xe(this,kf);Xe(this,Mf);Xe(this,If);Xe(this,Nf);Xe(this,Lf);Xe(this,Ff);Xe(this,jf);Xe(this,xm);Xe(this,Mr,void 0);Xe(this,fn,void 0);Xe(this,Df,void 0);Xe(this,vr,void 0);Xe(this,rl,void 0);Xe(this,Gc,void 0);Xe(this,mi,void 0);Xe(this,Af,void 0);Xe(this,Yc,void 0);Xe(this,Kc,void 0);Xe(this,ol,void 0);Xe(this,il,void 0);Xe(this,Qs,void 0);Xe(this,Xc,new Set);this.options=n,Ve(this,Mr,t),Ve(this,mi,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(se(this,fn).addObserver(this),tP(se(this,fn),this.options)?Ct(this,sl,pd).call(this):this.updateResult(),Ct(this,Nf,ux).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return px(se(this,fn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return px(se(this,fn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ct(this,Lf,dx).call(this),Ct(this,Ff,fx).call(this),se(this,fn).removeObserver(this)}setOptions(t,n){const r=this.options,o=se(this,fn);if(this.options=se(this,Mr).defaultQueryOptions(t),ox(r,this.options)||se(this,Mr).getQueryCache().notify({type:"observerOptionsUpdated",query:se(this,fn),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),Ct(this,jf,hx).call(this);const i=this.hasListeners();i&&nP(se(this,fn),o,this.options,r)&&Ct(this,sl,pd).call(this),this.updateResult(n),i&&(se(this,fn)!==o||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&Ct(this,kf,ax).call(this);const s=Ct(this,Mf,lx).call(this);i&&(se(this,fn)!==o||this.options.enabled!==r.enabled||s!==se(this,Qs))&&Ct(this,If,cx).call(this,s)}getOptimisticResult(t){const n=se(this,Mr).getQueryCache().build(se(this,Mr),t),r=this.createResult(n,t);return $V(this,r)&&(Ve(this,vr,r),Ve(this,Gc,this.options),Ve(this,rl,se(this,fn).state)),r}getCurrentResult(){return se(this,vr)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(se(this,Xc).add(r),t[r])})}),n}getCurrentQuery(){return se(this,fn)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=se(this,Mr).defaultQueryOptions(t),r=se(this,Mr).getQueryCache().build(se(this,Mr),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Ct(this,sl,pd).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),se(this,vr)))}createResult(t,n){var O;const r=se(this,fn),o=this.options,i=se(this,vr),s=se(this,rl),a=se(this,Gc),c=t!==r?t.state:se(this,Df),{state:u}=t;let{error:f,errorUpdatedAt:p,fetchStatus:h,status:b}=u,v=!1,w;if(n._optimisticResults){const T=this.hasListeners(),I=!T&&tP(t,n),N=T&&nP(t,r,n,o);(I||N)&&(h=Rm(t.options.networkMode)?"fetching":"paused",u.dataUpdatedAt||(b="pending")),n._optimisticResults==="isRestoring"&&(h="idle")}if(n.select&&typeof u.data<"u")if(i&&u.data===(s==null?void 0:s.data)&&n.select===se(this,Af))w=se(this,Yc);else try{Ve(this,Af,n.select),w=n.select(u.data),w=sx(i==null?void 0:i.data,w,n),Ve(this,Yc,w),Ve(this,mi,null)}catch(T){Ve(this,mi,T)}else w=u.data;if(typeof n.placeholderData<"u"&&typeof w>"u"&&b==="pending"){let T;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))T=i.data;else if(T=typeof n.placeholderData=="function"?n.placeholderData((O=se(this,Kc))==null?void 0:O.state.data,se(this,Kc)):n.placeholderData,n.select&&typeof T<"u")try{T=n.select(T),Ve(this,mi,null)}catch(I){Ve(this,mi,I)}typeof T<"u"&&(b="success",w=sx(i==null?void 0:i.data,T,n),v=!0)}se(this,mi)&&(f=se(this,mi),w=se(this,Yc),p=Date.now(),b="error");const y=h==="fetching",_=b==="pending",S=b==="error",C=_&&y;return{status:b,fetchStatus:h,isPending:_,isSuccess:b==="success",isError:S,isInitialLoading:C,isLoading:C,data:w,dataUpdatedAt:u.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:y,isRefetching:y&&!_,isLoadingError:S&&u.dataUpdatedAt===0,isPaused:h==="paused",isPlaceholderData:v,isRefetchError:S&&u.dataUpdatedAt!==0,isStale:cw(t,n),refetch:this.refetch}}updateResult(t){const n=se(this,vr),r=this.createResult(se(this,fn),this.options);if(Ve(this,rl,se(this,fn).state),Ve(this,Gc,this.options),se(this,rl).data!==void 0&&Ve(this,Kc,se(this,fn)),ox(r,n))return;Ve(this,vr,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!se(this,Xc).size)return!0;const l=new Set(a??se(this,Xc));return this.options.throwOnError&&l.add("error"),Object.keys(se(this,vr)).some(c=>{const u=c;return se(this,vr)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),Ct(this,xm,SD).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ct(this,Nf,ux).call(this)}},Mr=new WeakMap,fn=new WeakMap,Df=new WeakMap,vr=new WeakMap,rl=new WeakMap,Gc=new WeakMap,mi=new WeakMap,Af=new WeakMap,Yc=new WeakMap,Kc=new WeakMap,ol=new WeakMap,il=new WeakMap,Qs=new WeakMap,Xc=new WeakMap,sl=new WeakSet,pd=function(t){Ct(this,jf,hx).call(this);let n=se(this,fn).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(To)),n},kf=new WeakSet,ax=function(){if(Ct(this,Lf,dx).call(this),tu||se(this,vr).isStale||!rx(this.options.staleTime))return;const n=vD(se(this,vr).dataUpdatedAt,this.options.staleTime)+1;Ve(this,ol,setTimeout(()=>{se(this,vr).isStale||this.updateResult()},n))},Mf=new WeakSet,lx=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(se(this,fn)):this.options.refetchInterval)??!1},If=new WeakSet,cx=function(t){Ct(this,Ff,fx).call(this),Ve(this,Qs,t),!(tu||this.options.enabled===!1||!rx(se(this,Qs))||se(this,Qs)===0)&&Ve(this,il,setInterval(()=>{(this.options.refetchIntervalInBackground||Ig.isFocused())&&Ct(this,sl,pd).call(this)},se(this,Qs)))},Nf=new WeakSet,ux=function(){Ct(this,kf,ax).call(this),Ct(this,If,cx).call(this,Ct(this,Mf,lx).call(this))},Lf=new WeakSet,dx=function(){se(this,ol)&&(clearTimeout(se(this,ol)),Ve(this,ol,void 0))},Ff=new WeakSet,fx=function(){se(this,il)&&(clearInterval(se(this,il)),Ve(this,il,void 0))},jf=new WeakSet,hx=function(){const t=se(this,Mr).getQueryCache().build(se(this,Mr),this.options);if(t===se(this,fn))return;const n=se(this,fn);Ve(this,fn,t),Ve(this,Df,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},xm=new WeakSet,SD=function(t){Qn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(se(this,vr))}),se(this,Mr).getQueryCache().notify({query:se(this,fn),type:"observerResultsUpdated"})})},GT);function OV(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function tP(e,t){return OV(e,t)||e.state.dataUpdatedAt>0&&px(e,t,t.refetchOnMount)}function px(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&cw(e,t)}return!1}function nP(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&cw(e,n)}function cw(e,t){return e.isStaleByTime(t.staleTime)}function $V(e,t){return!ox(e.getCurrentResult(),t)}var CD=L.createContext(void 0),ED=e=>{const t=L.useContext(CD);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},TV=({client:e,children:t})=>(L.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),L.createElement(CD.Provider,{value:e},t)),RD=L.createContext(!1),DV=()=>L.useContext(RD);RD.Provider;function AV(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var kV=L.createContext(AV()),MV=()=>L.useContext(kV);function IV(e,t){return typeof e=="function"?e(...t):!!e}var NV=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},LV=e=>{L.useEffect(()=>{e.clearReset()},[e])},FV=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&IV(n,[e.error,r]),jV=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},zV=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,BV=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function VV(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=ED(n),o=DV(),i=MV(),s=r.defaultQueryOptions(e);s._optimisticResults=o?"isRestoring":"optimistic",jV(s),NV(s,i),LV(i);const[a]=L.useState(()=>new t(r,s)),l=a.getOptimisticResult(s);if(L.useSyncExternalStore(L.useCallback(c=>{const u=o?()=>{}:a.subscribe(Qn.batchCalls(c));return a.updateResult(),u},[a,o]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),L.useEffect(()=>{a.setOptions(s,{listeners:!1})},[s,a]),zV(s,l))throw BV(s,a,i);if(FV({result:l,errorResetBoundary:i,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw l.error;return s.notifyOnChangeProps?l:a.trackResult(l)}function Hf(e,t){return VV(e,PV,t)}const HV={theme:"system",setTheme:()=>null},PD=m.createContext(HV);function WV({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 P.jsx(PD.Provider,{...r,value:s,children:e})}const OD=()=>{const e=m.useContext(PD);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};async function UV(e){return await(await fetch("https://semaphor.cloud/api/v1/dashboard",{headers:{Authorization:`Bearer ${e}`}})).json()}function $D(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function rP(e,t){const n=$D(e);return n==="dark"?al.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function qV({authToken:e,customStyle:t,currentTheme:n,onSave:r,onEvent:o}){const{data:i,refetch:s,isLoading:a,isError:l}=Hf({queryKey:["dashboard",e==null?void 0:e.accessToken],queryFn:()=>UV(e==null?void 0:e.accessToken),enabled:!1}),{theme:c,setTheme:u}=OD(),f=De(T=>T.dashboard.globalStyle),{setDashboard:p,setSelectedSheetId:h,setStyle:b,setOnSaveFunction:v}=De(T=>T.actions);De(T=>T.actions.setCustomCards);const w=De(T=>T.actions.setFilterValues),y=De(T=>T.actions.setBookmarkKey),_=De(T=>T.actions.setAuthToken),S=De(T=>T.actions.setThemeStyle),C=De(T=>T.actions.setDashboardTheme),E=De(T=>T.actions.setOnEvent);m.useEffect(()=>{if(c){const T=$D(c);C(T)}},[c,C]),m.useEffect(()=>{n&&u(n)},[n,u]);function O(){const T=al.cloneDeep(tx),I=al.merge(T,f);if(t){const N=al.merge(I,t),k=rP(c,N);S(k),b(N)}else{const N=rP(c,I);S(N),b(tx)}}return m.useEffect(()=>{i&&i.dashboard&&O()},[c,t,f]),m.useEffect(()=>{var F;if(!i||!i.dashboard)return;const T=i.dashboard,I=T3(T.id),N=JSON.parse(localStorage.getItem(I)||"[]"),k=N.find(z=>z.default===!0);if(k)p(k.template),O(),y(k.name),k.filterValues&&w(k.filterValues);else{p(T),O();const z=N.find(Q=>(Q==null?void 0:Q.name)==="Original");z?z.template=T:N.push({name:"Original",template:T,default:!1}),localStorage.setItem(I,JSON.stringify(N))}h((F=T.sheets)==null?void 0:F[0].id)},[i,p,h,w,y]),m.useEffect(()=>{r&&v(r),o&&E(o)},[r,v,o,E]),m.useEffect(()=>{e&&e.accessToken&&(_(e),s())},[e,s,_]),{isLoading:a,isError:l}}function Pm({className:e,...t}){return P.jsx("div",{className:_e("animate-pulse rounded-md bg-muted",e),...t})}const uw=L.forwardRef(({className:e,...t},n)=>P.jsx("div",{ref:n,className:_e("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));uw.displayName="Card";const Om=L.forwardRef(({className:e,...t},n)=>P.jsx("div",{ref:n,className:_e("flex flex-col space-y-1.5 p-6",e),...t}));Om.displayName="CardHeader";const Wf=L.forwardRef(({className:e,...t},n)=>P.jsx("h3",{ref:n,className:_e("text-2xl font-semibold leading-none tracking-tight",e),...t}));Wf.displayName="CardTitle";const dw=L.forwardRef(({className:e,...t},n)=>P.jsx("p",{ref:n,className:_e("text-sm text-muted-foreground",e),...t}));dw.displayName="CardDescription";const $m=L.forwardRef(({className:e,...t},n)=>P.jsx("div",{ref:n,className:_e("px-6 pt-0",e),...t}));$m.displayName="CardContent";const fw=L.forwardRef(({className:e,...t},n)=>P.jsx("div",{ref:n,className:_e("flex items-center p-6 pt-0",e),...t}));fw.displayName="CardFooter";function TD({className:e,customStyle:t,onSave:n,onEvent:r,LoadingComponent:o,ErrorComponent:i,onChartElementClicked:s,id:a,authToken:l,currentTheme:c,version:u,customCards:f,showAssistant:p,...h}){De(_=>_.selectedSheetId);const b=De(_=>_.themeStyle),v=De(_=>_.isSessionExpired),{isLoading:w,isError:y}=qV({authToken:l,customStyle:t,currentTheme:c,onSave:n,onEvent:r});return w||!l?(r==null||r({type:"info",message:"Loading dashboard"}),o?P.jsx(o,{message:"loading"}):P.jsx("div",{className:"flex items-center gap-3",children:P.jsx(Pm,{className:"h-1 w-full dark:h-[2px]"})})):y?(r==null||r({type:"error",message:"Error fetching dashboard"}),i?(console.log("Error fetching dashboard"),P.jsx(i,{})):P.jsx("div",{children:"Error"})):v?(r==null||r({type:"error",message:"Session Expired"}),P.jsx("div",{className:"flex h-full items-center justify-center",children:P.jsxs("div",{className:"space-y-4 rounded-md border border-muted p-10",children:[P.jsx(Wf,{children:"Session Expired"}),P.jsx("p",{className:"text-muted-foreground",children:"Please refresh your page to continue."})]})})):P.jsx("div",{className:_e("flex h-full flex-col justify-between",b==null?void 0:b.dashboardPanel,e),role:"dashboard-panel",...h})}function ce(){return ce=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},ce.apply(this,arguments)}function Me(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function er(e,t=[]){let n=[];function r(i,s){const a=m.createContext(s),l=n.length;n=[...n,s];function c(f){const{scope:p,children:h,...b}=f,v=(p==null?void 0:p[e][l])||a,w=m.useMemo(()=>b,Object.values(b));return m.createElement(v.Provider,{value:w},h)}function u(f,p){const h=(p==null?void 0:p[e][l])||a,b=m.useContext(h);if(b)return b;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const o=()=>{const i=n.map(s=>m.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,GV(o,...t)]}function GV(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const f=l(i)[`__scope${c}`];return{...a,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function YV(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function us(...e){return t=>e.forEach(n=>YV(n,t))}function _t(...e){return m.useCallback(us(...e),e)}const gx=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(XV);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(mx,ce({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(mx,ce({},r,{ref:t}),n)});gx.displayName="Slot";const mx=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...QV(r,n.props),ref:t?us(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});mx.displayName="SlotClone";const KV=({children:e})=>m.createElement(m.Fragment,null,e);function XV(e){return m.isValidElement(e)&&e.type===KV}function QV(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 Tm(e){const t=e+"CollectionProvider",[n,r]=er(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=h=>{const{scope:b,children:v}=h,w=m.useRef(null),y=m.useRef(new Map).current;return m.createElement(o,{scope:b,itemMap:y,collectionRef:w},v)},a=e+"CollectionSlot",l=m.forwardRef((h,b)=>{const{scope:v,children:w}=h,y=i(a,v),_=_t(b,y.collectionRef);return m.createElement(gx,{ref:_},w)}),c=e+"CollectionItemSlot",u="data-radix-collection-item",f=m.forwardRef((h,b)=>{const{scope:v,children:w,...y}=h,_=m.useRef(null),S=_t(b,_),C=i(c,v);return m.useEffect(()=>(C.itemMap.set(_,{ref:_,...y}),()=>void C.itemMap.delete(_))),m.createElement(gx,{[u]:"",ref:S},w)});function p(h){const b=i(e+"CollectionConsumer",h);return m.useCallback(()=>{const w=b.collectionRef.current;if(!w)return[];const y=Array.from(w.querySelectorAll(`[${u}]`));return Array.from(b.itemMap.values()).sort((C,E)=>y.indexOf(C.ref.current)-y.indexOf(E.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:s,Slot:l,ItemSlot:f},p,r]}const ur=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},JV=L.useId||(()=>{});let ZV=0;function Zo(e){const[t,n]=L.useState(JV());return ur(()=>{e||n(r=>r??String(ZV++))},[e]),e||(t?`radix-${t}`:"")}const DD=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(tH);if(i){const s=i.props.children,a=o.map(l=>l===i?m.Children.count(s)>1?m.Children.only(null):m.isValidElement(s)?s.props.children:null:l);return m.createElement(vx,ce({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(vx,ce({},r,{ref:t}),n)});DD.displayName="Slot";const vx=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...nH(r,n.props),ref:t?us(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});vx.displayName="SlotClone";const eH=({children:e})=>m.createElement(m.Fragment,null,e);function tH(e){return m.isValidElement(e)&&e.type===eH}function nH(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const rH=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Qe=rH.reduce((e,t)=>{const n=m.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?DD:t;return m.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),m.createElement(a,ce({},s,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function AD(e,t){e&&Sr.flushSync(()=>e.dispatchEvent(t))}function jn(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 wr({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=oH({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=jn(n),l=m.useCallback(c=>{if(i){const f=typeof c=="function"?c(e):c;f!==e&&a(f)}else o(c)},[i,e,o,a]);return[s,l]}function oH({defaultProp:e,onChange:t}){const n=m.useState(e),[r]=n,o=m.useRef(r),i=jn(t);return m.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const iH=m.createContext(void 0);function Pl(e){const t=m.useContext(iH);return e||t||"ltr"}const r0="rovingFocusGroup.onEntryFocus",sH={bubbles:!1,cancelable:!0},hw="RovingFocusGroup",[bx,kD,aH]=Tm(hw),[lH,mu]=er(hw,[aH]),[cH,uH]=lH(hw),dH=m.forwardRef((e,t)=>m.createElement(bx.Provider,{scope:e.__scopeRovingFocusGroup},m.createElement(bx.Slot,{scope:e.__scopeRovingFocusGroup},m.createElement(fH,ce({},e,{ref:t}))))),fH=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,...u}=e,f=m.useRef(null),p=_t(t,f),h=Pl(i),[b=null,v]=wr({prop:s,defaultProp:a,onChange:l}),[w,y]=m.useState(!1),_=jn(c),S=kD(n),C=m.useRef(!1),[E,O]=m.useState(0);return m.useEffect(()=>{const T=f.current;if(T)return T.addEventListener(r0,_),()=>T.removeEventListener(r0,_)},[_]),m.createElement(cH,{scope:n,orientation:r,dir:h,loop:o,currentTabStopId:b,onItemFocus:m.useCallback(T=>v(T),[v]),onItemShiftTab:m.useCallback(()=>y(!0),[]),onFocusableItemAdd:m.useCallback(()=>O(T=>T+1),[]),onFocusableItemRemove:m.useCallback(()=>O(T=>T-1),[])},m.createElement(Qe.div,ce({tabIndex:w||E===0?-1:0,"data-orientation":r},u,{ref:p,style:{outline:"none",...e.style},onMouseDown:Me(e.onMouseDown,()=>{C.current=!0}),onFocus:Me(e.onFocus,T=>{const I=!C.current;if(T.target===T.currentTarget&&I&&!w){const N=new CustomEvent(r0,sH);if(T.currentTarget.dispatchEvent(N),!N.defaultPrevented){const k=S().filter(H=>H.focusable),F=k.find(H=>H.active),z=k.find(H=>H.id===b),te=[F,z,...k].filter(Boolean).map(H=>H.ref.current);MD(te)}}C.current=!1}),onBlur:Me(e.onBlur,()=>y(!1))})))}),hH="RovingFocusGroupItem",pH=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=Zo(),l=i||a,c=uH(hH,n),u=c.currentTabStopId===l,f=kD(n),{onFocusableItemAdd:p,onFocusableItemRemove:h}=c;return m.useEffect(()=>{if(r)return p(),()=>h()},[r,p,h]),m.createElement(bx.ItemSlot,{scope:n,id:l,focusable:r,active:o},m.createElement(Qe.span,ce({tabIndex:u?0:-1,"data-orientation":c.orientation},s,{ref:t,onMouseDown:Me(e.onMouseDown,b=>{r?c.onItemFocus(l):b.preventDefault()}),onFocus:Me(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:Me(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){c.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const v=vH(b,c.orientation,c.dir);if(v!==void 0){b.preventDefault();let y=f().filter(_=>_.focusable).map(_=>_.ref.current);if(v==="last")y.reverse();else if(v==="prev"||v==="next"){v==="prev"&&y.reverse();const _=y.indexOf(b.currentTarget);y=c.loop?bH(y,_+1):y.slice(_+1)}setTimeout(()=>MD(y))}})})))}),gH={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function mH(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function vH(e,t,n){const r=mH(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return gH[r]}function MD(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function bH(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const pw=dH,gw=pH;function yH(e,t){return m.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const tr=e=>{const{present:t,children:n}=e,r=xH(t),o=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),i=_t(r.ref,o.ref);return typeof n=="function"||r.isPresent?m.cloneElement(o,{ref:i}):null};tr.displayName="Presence";function xH(e){const[t,n]=m.useState(),r=m.useRef({}),o=m.useRef(e),i=m.useRef("none"),s=e?"mounted":"unmounted",[a,l]=yH(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const c=cp(r.current);i.current=a==="mounted"?c:"none"},[a]),ur(()=>{const c=r.current,u=o.current;if(u!==e){const p=i.current,h=cp(c);e?l("MOUNT"):h==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&p!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),ur(()=>{if(t){const c=f=>{const h=cp(r.current).includes(f.animationName);f.target===t&&h&&Sr.flushSync(()=>l("ANIMATION_END"))},u=f=>{f.target===t&&(i.current=cp(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:m.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function cp(e){return(e==null?void 0:e.animationName)||"none"}const ID="Tabs",[wH,s1e]=er(ID,[mu]),ND=mu(),[_H,mw]=wH(ID),SH=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=Pl(a),[f,p]=wr({prop:r,onChange:o,defaultProp:i});return m.createElement(_H,{scope:n,baseId:Zo(),value:f,onValueChange:p,orientation:s,dir:u,activationMode:l},m.createElement(Qe.div,ce({dir:u,"data-orientation":s},c,{ref:t})))}),CH="TabsList",EH=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=mw(CH,n),s=ND(n);return m.createElement(pw,ce({asChild:!0},s,{orientation:i.orientation,dir:i.dir,loop:r}),m.createElement(Qe.div,ce({role:"tablist","aria-orientation":i.orientation},o,{ref:t})))}),RH="TabsTrigger",PH=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=mw(RH,n),a=ND(n),l=LD(s.baseId,r),c=FD(s.baseId,r),u=r===s.value;return m.createElement(gw,ce({asChild:!0},a,{focusable:!o,active:u}),m.createElement(Qe.button,ce({type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l},i,{ref:t,onMouseDown:Me(e.onMouseDown,f=>{!o&&f.button===0&&f.ctrlKey===!1?s.onValueChange(r):f.preventDefault()}),onKeyDown:Me(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&s.onValueChange(r)}),onFocus:Me(e.onFocus,()=>{const f=s.activationMode!=="manual";!u&&!o&&f&&s.onValueChange(r)})})))}),OH="TabsContent",$H=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=mw(OH,n),l=LD(a.baseId,r),c=FD(a.baseId,r),u=r===a.value,f=m.useRef(u);return m.useEffect(()=>{const p=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(p)},[]),m.createElement(tr,{present:o||u},({present:p})=>m.createElement(Qe.div,ce({"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!p,id:c,tabIndex:0},s,{ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0}}),p&&i))});function LD(e,t){return`${e}-trigger-${t}`}function FD(e,t){return`${e}-content-${t}`}const TH=SH,jD=EH,zD=PH,BD=$H,vw=TH,Dm=L.forwardRef(({className:e,...t},n)=>P.jsx(jD,{ref:n,className:_e("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Dm.displayName=jD.displayName;const Am=L.forwardRef(({className:e,...t},n)=>P.jsx(zD,{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}));Am.displayName=zD.displayName;const bw=L.forwardRef(({className:e,...t},n)=>P.jsx(BD,{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}));bw.displayName=BD.displayName;var VD={exports:{}},Uf={},yx={exports:{}};(function(e,t){(function(n,r){r(t)})(Ws,function(n){function r(ie){return function(le,ye,X,be,Se,Oe,$e){return ie(le,ye,$e)}}function o(ie){return function(le,ye,X,be){if(!le||!ye||typeof le!="object"||typeof ye!="object")return ie(le,ye,X,be);var Se=be.get(le),Oe=be.get(ye);if(Se&&Oe)return Se===ye&&Oe===le;be.set(le,ye),be.set(ye,le);var $e=ie(le,ye,X,be);return be.delete(le),be.delete(ye),$e}}function i(ie,re){var le={};for(var ye in ie)le[ye]=ie[ye];for(var ye in re)le[ye]=re[ye];return le}function s(ie){return ie.constructor===Object||ie.constructor==null}function a(ie){return typeof ie.then=="function"}function l(ie,re){return ie===re||ie!==ie&&re!==re}var c="[object Arguments]",u="[object Boolean]",f="[object Date]",p="[object RegExp]",h="[object Map]",b="[object Number]",v="[object Object]",w="[object Set]",y="[object String]",_=Object.prototype.toString;function S(ie){var re=ie.areArraysEqual,le=ie.areDatesEqual,ye=ie.areMapsEqual,X=ie.areObjectsEqual,be=ie.areRegExpsEqual,Se=ie.areSetsEqual,Oe=ie.createIsNestedEqual,$e=Oe(Ue);function Ue(Be,Ie,Ke){if(Be===Ie)return!0;if(!Be||!Ie||typeof Be!="object"||typeof Ie!="object")return Be!==Be&&Ie!==Ie;if(s(Be)&&s(Ie))return X(Be,Ie,$e,Ke);var lt=Array.isArray(Be),It=Array.isArray(Ie);if(lt||It)return lt===It&&re(Be,Ie,$e,Ke);var Dt=_.call(Be);return Dt!==_.call(Ie)?!1:Dt===f?le(Be,Ie,$e,Ke):Dt===p?be(Be,Ie,$e,Ke):Dt===h?ye(Be,Ie,$e,Ke):Dt===w?Se(Be,Ie,$e,Ke):Dt===v||Dt===c?a(Be)||a(Ie)?!1:X(Be,Ie,$e,Ke):Dt===u||Dt===b||Dt===y?l(Be.valueOf(),Ie.valueOf()):!1}return Ue}function C(ie,re,le,ye){var X=ie.length;if(re.length!==X)return!1;for(;X-- >0;)if(!le(ie[X],re[X],X,X,ie,re,ye))return!1;return!0}var E=o(C);function O(ie,re){return l(ie.valueOf(),re.valueOf())}function T(ie,re,le,ye){var X=ie.size===re.size;if(!X)return!1;if(!ie.size)return!0;var be={},Se=0;return ie.forEach(function(Oe,$e){if(X){var Ue=!1,Be=0;re.forEach(function(Ie,Ke){!Ue&&!be[Be]&&(Ue=le($e,Ke,Se,Be,ie,re,ye)&&le(Oe,Ie,$e,Ke,ie,re,ye))&&(be[Be]=!0),Be++}),Se++,X=Ue}}),X}var I=o(T),N="_owner",k=Object.prototype.hasOwnProperty;function F(ie,re,le,ye){var X=Object.keys(ie),be=X.length;if(Object.keys(re).length!==be)return!1;for(var Se;be-- >0;){if(Se=X[be],Se===N){var Oe=!!ie.$$typeof,$e=!!re.$$typeof;if((Oe||$e)&&Oe!==$e)return!1}if(!k.call(re,Se)||!le(ie[Se],re[Se],Se,Se,ie,re,ye))return!1}return!0}var z=o(F);function Q(ie,re){return ie.source===re.source&&ie.flags===re.flags}function te(ie,re,le,ye){var X=ie.size===re.size;if(!X)return!1;if(!ie.size)return!0;var be={};return ie.forEach(function(Se,Oe){if(X){var $e=!1,Ue=0;re.forEach(function(Be,Ie){!$e&&!be[Ue]&&($e=le(Se,Be,Oe,Ie,ie,re,ye))&&(be[Ue]=!0),Ue++}),X=$e}}),X}var H=o(te),J=Object.freeze({areArraysEqual:C,areDatesEqual:O,areMapsEqual:T,areObjectsEqual:F,areRegExpsEqual:Q,areSetsEqual:te,createIsNestedEqual:r}),K=Object.freeze({areArraysEqual:E,areDatesEqual:O,areMapsEqual:I,areObjectsEqual:z,areRegExpsEqual:Q,areSetsEqual:H,createIsNestedEqual:r}),Y=S(J);function W(ie,re){return Y(ie,re,void 0)}var $=S(i(J,{createIsNestedEqual:function(){return l}}));function V(ie,re){return $(ie,re,void 0)}var U=S(K);function D(ie,re){return U(ie,re,new WeakMap)}var ee=S(i(K,{createIsNestedEqual:function(){return l}}));function de(ie,re){return ee(ie,re,new WeakMap)}function ue(ie){return S(i(J,ie(J)))}function he(ie){var re=S(i(K,ie(K)));return function(le,ye,X){return X===void 0&&(X=new WeakMap),re(le,ye,X)}}n.circularDeepEqual=D,n.circularShallowEqual=de,n.createCustomCircularEqual=he,n.createCustomEqual=ue,n.deepEqual=W,n.sameValueZeroEqual=l,n.shallowEqual=V,Object.defineProperty(n,"__esModule",{value:!0})})})(yx,yx.exports);var yw=yx.exports;const xw=Z1(qz);var Pt={},DH=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(Pt,"__esModule",{value:!0});Pt.bottom=ww;Pt.childrenEqual=IH;Pt.cloneLayout=HD;Pt.cloneLayoutItem=ll;Pt.collides=km;Pt.compact=UD;Pt.compactItem=qD;Pt.compactType=KH;Pt.correctBounds=GD;Pt.fastPositionEqual=LH;Pt.fastRGLPropsEqual=void 0;Pt.getAllCollisions=YD;Pt.getFirstCollision=Ka;Pt.getLayoutItem=_w;Pt.getStatics=Sw;Pt.modifyLayout=WD;Pt.moveElement=md;Pt.moveElementAwayFromCollision=wx;Pt.noop=void 0;Pt.perc=jH;Pt.resizeItemInDirection=UH;Pt.setTopLeft=GH;Pt.setTransform=qH;Pt.sortLayoutItems=$w;Pt.sortLayoutItemsByColRow=ZD;Pt.sortLayoutItemsByRowCol=JD;Pt.synchronizeLayoutWithChildren=YH;Pt.validateLayout=eA;Pt.withLayoutItem=MH;var oP=yw,gd=AH(m);function AH(e){return e&&e.__esModule?e:{default:e}}const kH=process.env.NODE_ENV==="production";function ww(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 HD(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=ll(e[n]);return t}function WD(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 MH(e,t,n){let r=_w(e,t);return r?(r=n(ll(r)),e=WD(e,r),[e,r]):[e,null]}function ll(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 IH(e,t){return(0,oP.deepEqual)(gd.default.Children.map(e,n=>n==null?void 0:n.key),gd.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,oP.deepEqual)(gd.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),gd.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}const NH=DH;Pt.fastRGLPropsEqual=NH;function LH(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function km(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 UD(e,t,n,r){const o=Sw(e),i=$w(e,t),s=Array(e.length);for(let a=0,l=i.length;a<l;a++){let c=ll(i[a]);c.static||(c=qD(o,c,t,n,i,r),o.push(c)),s[e.indexOf(i[a])]=c,c.moved=!1}return s}const FH={x:"w",y:"h"};function xx(e,t,n,r){const o=FH[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;km(t,a)&&xx(e,a,n+t[o],r)}}t[r]=n}function qD(e,t,n,r,o,i){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(ww(e),t.y);t.y>0&&!Ka(e,t);)t.y--;else if(a)for(;t.x>0&&!Ka(e,t);)t.x--;let l;for(;(l=Ka(e,t))&&!(n===null&&i);)if(a?xx(o,t,l.x+l.w,"x"):xx(o,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!Ka(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function GD(e,t){const n=Sw(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(;Ka(n,i);)i.y++}return e}function _w(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function Ka(e,t){for(let n=0,r=e.length;n<r;n++)if(km(e[n],t))return e[n]}function YD(e,t){return e.filter(n=>km(n,t))}function Sw(e){return e.filter(t=>t.static)}function md(e,t,n,r,o,i,s,a,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;"Moving element ".concat(t.i," to [").concat(String(n),",").concat(String(r),"] from [").concat(t.x,",").concat(t.y,"]");const c=t.x,u=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let f=$w(e,s);(s==="vertical"&&typeof r=="number"?u>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(f=f.reverse());const h=YD(f,t),b=h.length>0;if(b&&l)return HD(e);if(b&&i)return"Collision prevented on ".concat(t.i,", reverting."),t.x=c,t.y=u,t.moved=!1,e;for(let v=0,w=h.length;v<w;v++){const y=h[v];"Resolving collision between ".concat(t.i," at [").concat(t.x,",").concat(t.y,"] and ").concat(y.i," at [").concat(y.x,",").concat(y.y,"]"),!y.moved&&(y.static?e=wx(e,y,t,o,s):e=wx(e,t,y,o,s))}return e}function wx(e,t,n,r,o,i){const s=o==="horizontal",a=o==="vertical",l=t.static;if(r){r=!1;const f={x:s?Math.max(t.x-n.w,0):n.x,y:a?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},p=Ka(e,f),h=p&&p.y+p.h>t.y,b=p&&t.x+t.w>p.x;if(p){if(h&&a)return md(e,n,void 0,t.y+1,r,l,o);if(h&&o==null)return t.y=n.y,n.y=n.y+n.h,e;if(b&&s)return md(e,t,n.x,void 0,r,l,o)}else return"Doing reverse collision on ".concat(n.i," up to [").concat(f.x,",").concat(f.y,"]."),md(e,n,s?f.x:void 0,a?f.y:void 0,r,l,o)}const c=s?n.x+1:void 0,u=a?n.y+1:void 0;return c==null&&u==null?e:md(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,o)}function jH(e){return e*100+"%"}const KD=(e,t,n,r)=>e+n>r?t:n,XD=(e,t,n)=>e<0?t:n,QD=e=>Math.max(0,e),Cw=e=>Math.max(0,e),Ew=(e,t,n)=>{let{left:r,height:o,width:i}=t;const s=e.top-(o-e.height);return{left:r,width:i,height:XD(s,e.height,o),top:Cw(s)}},Rw=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{top:r,height:i,width:KD(e.left,e.width,s,n),left:QD(o)}},Pw=(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:KD(e.left,e.width,i,n),top:Cw(r),left:QD(s)}},Ow=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{width:s,left:o,height:XD(r,e.height,i),top:Cw(r)}},zH=function(){return Ew(arguments.length<=0?void 0:arguments[0],Rw(...arguments))},BH=function(){return Ew(arguments.length<=0?void 0:arguments[0],Pw(...arguments))},VH=function(){return Ow(arguments.length<=0?void 0:arguments[0],Rw(...arguments))},HH=function(){return Ow(arguments.length<=0?void 0:arguments[0],Pw(...arguments))},WH={n:Ew,ne:zH,e:Rw,se:VH,s:Ow,sw:HH,w:Pw,nw:BH};function UH(e,t,n,r){const o=WH[e];return o?o(t,{...t,...n},r):n}function qH(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 GH(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 $w(e,t){return t==="horizontal"?ZD(e):t==="vertical"?JD(e):e}function JD(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 ZD(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 YH(e,t,n,r,o){e=e||[];const i=[];gd.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=_w(e,String(a.key)),c=a.props["data-grid"];l&&c==null?i.push(ll(l)):c?(kH||eA([c],"ReactGridLayout.children"),i.push(ll({...c,i:a.key}))):i.push(ll({w:1,h:1,x:0,y:ww(i),i:String(a.key)}))});const s=GD(i,{cols:n});return o?s:UD(s,r,n)}function eA(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 KH(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const XH=()=>{};Pt.noop=XH;var Oi={};Object.defineProperty(Oi,"__esModule",{value:!0});Oi.calcGridColWidth=Mm;Oi.calcGridItemPosition=QH;Oi.calcGridItemWHPx=_x;Oi.calcWH=ZH;Oi.calcXY=JH;Oi.clamp=Xa;function Mm(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function _x(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function QH(e,t,n,r,o,i){const{margin:s,containerPadding:a,rowHeight:l}=e,c=Mm(e),u={};return i&&i.resizing?(u.width=Math.round(i.resizing.width),u.height=Math.round(i.resizing.height)):(u.width=_x(r,c,s[0]),u.height=_x(o,l,s[1])),i&&i.dragging?(u.top=Math.round(i.dragging.top),u.left=Math.round(i.dragging.left)):i&&i.resizing&&typeof i.resizing.top=="number"&&typeof i.resizing.left=="number"?(u.top=Math.round(i.resizing.top),u.left=Math.round(i.resizing.left)):(u.top=Math.round((l+s[1])*n+a[1]),u.left=Math.round((c+s[0])*t+a[0])),u}function JH(e,t,n,r,o){const{margin:i,cols:s,rowHeight:a,maxRows:l}=e,c=Mm(e);let u=Math.round((n-i[0])/(c+i[0])),f=Math.round((t-i[1])/(a+i[1]));return u=Xa(u,0,s-r),f=Xa(f,0,l-o),{x:u,y:f}}function ZH(e,t,n,r,o,i){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,u=Mm(e);let f=Math.round((t+s[0])/(u+s[0])),p=Math.round((n+s[1])/(c+s[1])),h=Xa(f,0,l-r),b=Xa(p,0,a-o);return["sw","w","nw"].indexOf(i)!==-1&&(h=Xa(f,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(b=Xa(p,0,a)),{w:h,h:b}}function Xa(e,t,n){return Math.max(Math.min(e,n),t)}var Im={},Sx={exports:{}},o0,iP;function Tw(){if(iP)return o0;iP=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return o0=e,o0}var i0,sP;function eW(){if(sP)return i0;sP=1;var e=Tw();function t(){}function n(){}return n.resetWarningCache=t,i0=function(){function r(s,a,l,c,u,f){if(f!==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},i0}var up={exports:{}},qt={};/** @license React v16.13.1
|
|
88
|
+
}`;var yt=PR(function(){return jt(B,Ye+"return "+Re).apply(n,q)});if(yt.source=Re,Lb(yt))throw yt;return yt}function Kj(d){return Ut(d).toLowerCase()}function Xj(d){return Ut(d).toUpperCase()}function Qj(d,g,x){if(d=Ut(d),d&&(x||g===n))return NC(d);if(!d||!(g=Ur(g)))return d;var R=zo(d),M=zo(g),B=LC(R,M),q=FC(R,M)+1;return Os(R,B,q).join("")}function Jj(d,g,x){if(d=Ut(d),d&&(x||g===n))return d.slice(0,zC(d)+1);if(!d||!(g=Ur(g)))return d;var R=zo(d),M=FC(R,zo(g))+1;return Os(R,0,M).join("")}function Zj(d,g,x){if(d=Ut(d),d&&(x||g===n))return d.replace(Bn,"");if(!d||!(g=Ur(g)))return d;var R=zo(d),M=LC(R,zo(g));return Os(R,M).join("")}function ez(d,g){var x=k,R=F;if(wn(g)){var M="separator"in g?g.separator:M;x="length"in g?pt(g.length):x,R="omission"in g?Ur(g.omission):R}d=Ut(d);var B=d.length;if(Vl(d)){var q=zo(d);B=q.length}if(x>=B)return d;var Z=x-Hl(R);if(Z<1)return R;var ae=q?Os(q,0,Z).join(""):d.slice(0,Z);if(M===n)return ae+R;if(q&&(Z+=ae.length-Z),Fb(M)){if(d.slice(Z).search(M)){var xe,we=ae;for(M.global||(M=eb(M.source,Ut(qe.exec(M))+"g")),M.lastIndex=0;xe=M.exec(we);)var Re=xe.index;ae=ae.slice(0,Re===n?Z:Re)}}else if(d.indexOf(Ur(M),Z)!=Z){var je=ae.lastIndexOf(M);je>-1&&(ae=ae.slice(0,je))}return ae+R}function tz(d){return d=Ut(d),d&&On.test(d)?d.replace(Xt,T7):d}var nz=Xl(function(d,g,x){return d+(x?" ":"")+g.toUpperCase()}),Bb=OE("toUpperCase");function RR(d,g,x){return d=Ut(d),g=x?n:g,g===n?E7(d)?k7(d):m7(d):d.match(g)||[]}var PR=St(function(d,g){try{return Hr(d,n,g)}catch(x){return Lb(x)?x:new ct(x)}}),rz=zi(function(d,g){return yo(g,function(x){x=li(x),Fi(d,x,Ib(d[x],d))}),d});function oz(d){var g=d==null?0:d.length,x=Je();return d=g?yn(d,function(R){if(typeof R[1]!="function")throw new xo(s);return[x(R[0]),R[1]]}):[],St(function(R){for(var M=-1;++M<g;){var B=d[M];if(Hr(B[0],this,R))return Hr(B[1],this,R)}})}function iz(d){return T6(_o(d,f))}function Vb(d){return function(){return d}}function sz(d,g){return d==null||d!==d?g:d}var az=TE(),lz=TE(!0);function Or(d){return d}function Hb(d){return sE(typeof d=="function"?d:_o(d,f))}function cz(d){return lE(_o(d,f))}function uz(d,g){return cE(d,_o(g,f))}var dz=St(function(d,g){return function(x){return Nu(x,d,g)}}),fz=St(function(d,g){return function(x){return Nu(d,x,g)}});function Wb(d,g,x){var R=Hn(g),M=jh(g,R);x==null&&!(wn(g)&&(M.length||!R.length))&&(x=g,g=d,d=this,M=jh(g,Hn(g)));var B=!(wn(x)&&"chain"in x)||!!x.chain,q=Vi(d);return yo(M,function(Z){var ae=g[Z];d[Z]=ae,q&&(d.prototype[Z]=function(){var xe=this.__chain__;if(B||xe){var we=d(this.__wrapped__),Re=we.__actions__=Er(this.__actions__);return Re.push({func:ae,args:arguments,thisArg:d}),we.__chain__=xe,we}return ae.apply(d,_s([this.value()],arguments))})}),d}function hz(){return Gn._===this&&(Gn._=j7),this}function Ub(){}function pz(d){return d=pt(d),St(function(g){return uE(g,d)})}var gz=_b(yn),mz=_b(DC),vz=_b(Gv);function OR(d){return $b(d)?Yv(li(d)):G6(d)}function bz(d){return function(g){return d==null?n:Pa(d,g)}}var yz=AE(),xz=AE(!0);function qb(){return[]}function Gb(){return!1}function wz(){return{}}function _z(){return""}function Sz(){return!0}function Cz(d,g){if(d=pt(d),d<1||d>Y)return[];var x=V,R=rr(d,V);g=Je(g),d-=V;for(var M=Qv(R,g);++x<d;)g(x);return M}function Ez(d){return ut(d)?yn(d,li):qr(d)?[d]:Er(YE(Ut(d)))}function Rz(d){var g=++L7;return Ut(d)+g}var Pz=Uh(function(d,g){return d+g},0),Oz=Sb("ceil"),$z=Uh(function(d,g){return d/g},1),Tz=Sb("floor");function Dz(d){return d&&d.length?Fh(d,Or,lb):n}function Az(d,g){return d&&d.length?Fh(d,Je(g,2),lb):n}function kz(d){return MC(d,Or)}function Mz(d,g){return MC(d,Je(g,2))}function Iz(d){return d&&d.length?Fh(d,Or,fb):n}function Nz(d,g){return d&&d.length?Fh(d,Je(g,2),fb):n}var Lz=Uh(function(d,g){return d*g},1),Fz=Sb("round"),jz=Uh(function(d,g){return d-g},0);function zz(d){return d&&d.length?Xv(d,Or):0}function Bz(d,g){return d&&d.length?Xv(d,Je(g,2)):0}return j.after=c8,j.ary=iR,j.assign=X8,j.assignIn=yR,j.assignInWith=op,j.assignWith=Q8,j.at=J8,j.before=sR,j.bind=Ib,j.bindAll=rz,j.bindKey=aR,j.castArray=w8,j.chain=nR,j.chunk=T9,j.compact=D9,j.concat=A9,j.cond=oz,j.conforms=iz,j.constant=Vb,j.countBy=z4,j.create=Z8,j.curry=lR,j.curryRight=cR,j.debounce=uR,j.defaults=ej,j.defaultsDeep=tj,j.defer=u8,j.delay=d8,j.difference=k9,j.differenceBy=M9,j.differenceWith=I9,j.drop=N9,j.dropRight=L9,j.dropRightWhile=F9,j.dropWhile=j9,j.fill=z9,j.filter=V4,j.flatMap=U4,j.flatMapDeep=q4,j.flatMapDepth=G4,j.flatten=JE,j.flattenDeep=B9,j.flattenDepth=V9,j.flip=f8,j.flow=az,j.flowRight=lz,j.fromPairs=H9,j.functions=lj,j.functionsIn=cj,j.groupBy=Y4,j.initial=U9,j.intersection=q9,j.intersectionBy=G9,j.intersectionWith=Y9,j.invert=dj,j.invertBy=fj,j.invokeMap=X4,j.iteratee=Hb,j.keyBy=Q4,j.keys=Hn,j.keysIn=Pr,j.map=Jh,j.mapKeys=pj,j.mapValues=gj,j.matches=cz,j.matchesProperty=uz,j.memoize=ep,j.merge=mj,j.mergeWith=xR,j.method=dz,j.methodOf=fz,j.mixin=Wb,j.negate=tp,j.nthArg=pz,j.omit=vj,j.omitBy=bj,j.once=h8,j.orderBy=J4,j.over=gz,j.overArgs=p8,j.overEvery=mz,j.overSome=vz,j.partial=Nb,j.partialRight=dR,j.partition=Z4,j.pick=yj,j.pickBy=wR,j.property=OR,j.propertyOf=bz,j.pull=J9,j.pullAll=eR,j.pullAllBy=Z9,j.pullAllWith=e4,j.pullAt=t4,j.range=yz,j.rangeRight=xz,j.rearg=g8,j.reject=n8,j.remove=n4,j.rest=m8,j.reverse=kb,j.sampleSize=o8,j.set=wj,j.setWith=_j,j.shuffle=i8,j.slice=r4,j.sortBy=l8,j.sortedUniq=u4,j.sortedUniqBy=d4,j.split=Uj,j.spread=v8,j.tail=f4,j.take=h4,j.takeRight=p4,j.takeRightWhile=g4,j.takeWhile=m4,j.tap=D4,j.throttle=b8,j.thru=Qh,j.toArray=mR,j.toPairs=_R,j.toPairsIn=SR,j.toPath=Ez,j.toPlainObject=bR,j.transform=Sj,j.unary=y8,j.union=v4,j.unionBy=b4,j.unionWith=y4,j.uniq=x4,j.uniqBy=w4,j.uniqWith=_4,j.unset=Cj,j.unzip=Mb,j.unzipWith=tR,j.update=Ej,j.updateWith=Rj,j.values=Zl,j.valuesIn=Pj,j.without=S4,j.words=RR,j.wrap=x8,j.xor=C4,j.xorBy=E4,j.xorWith=R4,j.zip=P4,j.zipObject=O4,j.zipObjectDeep=$4,j.zipWith=T4,j.entries=_R,j.entriesIn=SR,j.extend=yR,j.extendWith=op,Wb(j,j),j.add=Pz,j.attempt=PR,j.camelCase=Dj,j.capitalize=CR,j.ceil=Oz,j.clamp=Oj,j.clone=_8,j.cloneDeep=C8,j.cloneDeepWith=E8,j.cloneWith=S8,j.conformsTo=R8,j.deburr=ER,j.defaultTo=sz,j.divide=$z,j.endsWith=Aj,j.eq=Vo,j.escape=kj,j.escapeRegExp=Mj,j.every=B4,j.find=H4,j.findIndex=XE,j.findKey=nj,j.findLast=W4,j.findLastIndex=QE,j.findLastKey=rj,j.floor=Tz,j.forEach=rR,j.forEachRight=oR,j.forIn=oj,j.forInRight=ij,j.forOwn=sj,j.forOwnRight=aj,j.get=jb,j.gt=P8,j.gte=O8,j.has=uj,j.hasIn=zb,j.head=ZE,j.identity=Or,j.includes=K4,j.indexOf=W9,j.inRange=$j,j.invoke=hj,j.isArguments=Ta,j.isArray=ut,j.isArrayBuffer=$8,j.isArrayLike=Rr,j.isArrayLikeObject=$n,j.isBoolean=T8,j.isBuffer=$s,j.isDate=D8,j.isElement=A8,j.isEmpty=k8,j.isEqual=M8,j.isEqualWith=I8,j.isError=Lb,j.isFinite=N8,j.isFunction=Vi,j.isInteger=fR,j.isLength=np,j.isMap=hR,j.isMatch=L8,j.isMatchWith=F8,j.isNaN=j8,j.isNative=z8,j.isNil=V8,j.isNull=B8,j.isNumber=pR,j.isObject=wn,j.isObjectLike=Sn,j.isPlainObject=Vu,j.isRegExp=Fb,j.isSafeInteger=H8,j.isSet=gR,j.isString=rp,j.isSymbol=qr,j.isTypedArray=Jl,j.isUndefined=W8,j.isWeakMap=U8,j.isWeakSet=q8,j.join=K9,j.kebabCase=Ij,j.last=Co,j.lastIndexOf=X9,j.lowerCase=Nj,j.lowerFirst=Lj,j.lt=G8,j.lte=Y8,j.max=Dz,j.maxBy=Az,j.mean=kz,j.meanBy=Mz,j.min=Iz,j.minBy=Nz,j.stubArray=qb,j.stubFalse=Gb,j.stubObject=wz,j.stubString=_z,j.stubTrue=Sz,j.multiply=Lz,j.nth=Q9,j.noConflict=hz,j.noop=Ub,j.now=Zh,j.pad=Fj,j.padEnd=jj,j.padStart=zj,j.parseInt=Bj,j.random=Tj,j.reduce=e8,j.reduceRight=t8,j.repeat=Vj,j.replace=Hj,j.result=xj,j.round=Fz,j.runInContext=oe,j.sample=r8,j.size=s8,j.snakeCase=Wj,j.some=a8,j.sortedIndex=o4,j.sortedIndexBy=i4,j.sortedIndexOf=s4,j.sortedLastIndex=a4,j.sortedLastIndexBy=l4,j.sortedLastIndexOf=c4,j.startCase=qj,j.startsWith=Gj,j.subtract=jz,j.sum=zz,j.sumBy=Bz,j.template=Yj,j.times=Cz,j.toFinite=Hi,j.toInteger=pt,j.toLength=vR,j.toLower=Kj,j.toNumber=Eo,j.toSafeInteger=K8,j.toString=Ut,j.toUpper=Xj,j.trim=Qj,j.trimEnd=Jj,j.trimStart=Zj,j.truncate=ez,j.unescape=tz,j.uniqueId=Rz,j.upperCase=nz,j.upperFirst=Bb,j.each=rR,j.eachRight=oR,j.first=ZE,Wb(j,function(){var d={};return si(j,function(g,x){Qt.call(j.prototype,x)||(d[x]=g)}),d}(),{chain:!1}),j.VERSION=r,yo(["bind","bindKey","curry","curryRight","partial","partialRight"],function(d){j[d].placeholder=j}),yo(["drop","take"],function(d,g){kt.prototype[d]=function(x){x=x===n?1:In(pt(x),0);var R=this.__filtered__&&!g?new kt(this):this.clone();return R.__filtered__?R.__takeCount__=rr(x,R.__takeCount__):R.__views__.push({size:rr(x,V),type:d+(R.__dir__<0?"Right":"")}),R},kt.prototype[d+"Right"]=function(x){return this.reverse()[d](x).reverse()}}),yo(["filter","map","takeWhile"],function(d,g){var x=g+1,R=x==te||x==J;kt.prototype[d]=function(M){var B=this.clone();return B.__iteratees__.push({iteratee:Je(M,3),type:x}),B.__filtered__=B.__filtered__||R,B}}),yo(["head","last"],function(d,g){var x="take"+(g?"Right":"");kt.prototype[d]=function(){return this[x](1).value()[0]}}),yo(["initial","tail"],function(d,g){var x="drop"+(g?"":"Right");kt.prototype[d]=function(){return this.__filtered__?new kt(this):this[x](1)}}),kt.prototype.compact=function(){return this.filter(Or)},kt.prototype.find=function(d){return this.filter(d).head()},kt.prototype.findLast=function(d){return this.reverse().find(d)},kt.prototype.invokeMap=St(function(d,g){return typeof d=="function"?new kt(this):this.map(function(x){return Nu(x,d,g)})}),kt.prototype.reject=function(d){return this.filter(tp(Je(d)))},kt.prototype.slice=function(d,g){d=pt(d);var x=this;return x.__filtered__&&(d>0||g<0)?new kt(x):(d<0?x=x.takeRight(-d):d&&(x=x.drop(d)),g!==n&&(g=pt(g),x=g<0?x.dropRight(-g):x.take(g-d)),x)},kt.prototype.takeRightWhile=function(d){return this.reverse().takeWhile(d).reverse()},kt.prototype.toArray=function(){return this.take(V)},si(kt.prototype,function(d,g){var x=/^(?:filter|find|map|reject)|While$/.test(g),R=/^(?:head|last)$/.test(g),M=j[R?"take"+(g=="last"?"Right":""):g],B=R||/^find/.test(g);M&&(j.prototype[g]=function(){var q=this.__wrapped__,Z=R?[1]:arguments,ae=q instanceof kt,xe=Z[0],we=ae||ut(q),Re=function(Ot){var Mt=M.apply(j,_s([Ot],Z));return R&&je?Mt[0]:Mt};we&&x&&typeof xe=="function"&&xe.length!=1&&(ae=we=!1);var je=this.__chain__,Ye=!!this.__actions__.length,et=B&&!je,yt=ae&&!Ye;if(!B&&we){q=yt?q:new kt(this);var tt=d.apply(q,Z);return tt.__actions__.push({func:Qh,args:[Re],thisArg:n}),new wo(tt,je)}return et&&yt?d.apply(this,Z):(tt=this.thru(Re),et?R?tt.value()[0]:tt.value():tt)})}),yo(["pop","push","shift","sort","splice","unshift"],function(d){var g=Sh[d],x=/^(?:push|sort|unshift)$/.test(d)?"tap":"thru",R=/^(?:pop|shift)$/.test(d);j.prototype[d]=function(){var M=arguments;if(R&&!this.__chain__){var B=this.value();return g.apply(ut(B)?B:[],M)}return this[x](function(q){return g.apply(ut(q)?q:[],M)})}}),si(kt.prototype,function(d,g){var x=j[g];if(x){var R=x.name+"";Qt.call(Gl,R)||(Gl[R]=[]),Gl[R].push({name:g,func:x})}}),Gl[Wh(n,y).name]=[{name:"wrapper",func:n}],kt.prototype.clone=t6,kt.prototype.reverse=n6,kt.prototype.value=r6,j.prototype.at=A4,j.prototype.chain=k4,j.prototype.commit=M4,j.prototype.next=I4,j.prototype.plant=L4,j.prototype.reverse=F4,j.prototype.toJSON=j.prototype.valueOf=j.prototype.value=j4,j.prototype.first=j.prototype.head,$u&&(j.prototype[$u]=N4),j},Wl=M7();_a?((_a.exports=Wl)._=Wl,Hv._=Wl):Gn._=Wl}).call(Ws)})(Mg,Mg.exports);var bc=Mg.exports;const al=Rl(bc);function YR({id:e,layouts:t,initialHeight:n,y:r,x:o,w:i,minH:s}){const a={i:e,x:o??0,y:r??1/0,w:i||20,h:n||35,minW:6,minH:s||10};return t||(t={}),iw.forEach(l=>{t!=null&&t[l]||(t={...t,[l]:[]});const c=t[l].reduce((u,f)=>Math.max(u,f.y+f.h),0);a.y=a.y===0?0:c,t[l].push(a)}),t}function KR(e,t){t&&iw.forEach(n=>{t!=null&&t[n]&&(t[n]=t[n].filter(r=>r.i!==e))})}const De=rD()(uD((e,t)=>({isSessionExpired:!1,currentBreakpoint:"lg",dashboard:{id:"",style:tx},showContext:!1,selectedSheetId:null,selectedCardId:null,selectedFrameId:null,selectedCard:null,showFilters:!1,isDashboardEditing:!1,isVisualEditing:!1,showDashboardJSON:!1,filteringCards:[],actions:{deleteSheet:n=>{e(r=>{var i,s,a,l;const o=(i=r.dashboard.sheets)==null?void 0:i.findIndex(c=>c.id===n);o!==void 0&&o>-1&&((s=r.dashboard.sheets)==null||s.splice(o,1),r.selectedSheetId=(l=(a=r.dashboard.sheets)==null?void 0:a[0])==null?void 0:l.id)})},addSheet:n=>{e(r=>{r.dashboard.sheets||(r.dashboard.sheets=[]);const o=r.dashboard.filters;let i={};o==null||o.forEach(a=>{iw.forEach(l=>{i!=null&&i[l]||(i={...i,[l]:[]});const c={i:a.id,x:0,y:0,w:10,h:8};i[l].push(c)})});const s={...n,layouts:i};r.dashboard.sheets.push(s)})},setGlobalStyle:n=>{e(r=>{r.dashboard.globalStyle=n})},setAIScopeTables:n=>{e(r=>{r.dashboard.aiScopeTables=n})},setIsSessionExpired:n=>{e(()=>({isSessionExpired:n}))},setCardPython:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===o.selectedSheetId);i&&bc.forEach(i.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(f=>f.id===n);c&&(c.python=r)})})},addBaseQuery:n=>{e(r=>{var o;r.dashboard.baseQueries||(r.dashboard.baseQueries=[]),(o=r.dashboard.baseQueries)==null||o.push(n)})},removeBaseQuery:n=>{e(r=>{var i,s;const o=(i=r.dashboard.baseQueries)==null?void 0:i.findIndex(a=>a.id===n);o!=null&&o>-1&&((s=r.dashboard.baseQueries)==null||s.splice(o,1))})},setBaseQueries:n=>{e(r=>{r.dashboard.baseQueries=n})},setCurrentBreakpoint:n=>{e(()=>({currentBreakpoint:n}))},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)})},setSheetTitle:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.title=r)})},setCardTitle:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&bc.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(p=>p.id===r);u&&(u.title=o)})})},setCardInfo:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===o.selectedSheetId);i&&bc.forEach(i.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(f=>f.id===n);c&&(c.info=r)})})},setCardDescription:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&bc.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(p=>p.id===r);u&&(u.description=o)})})},setCardSql:(n,r,o)=>{e(i=>{var a,l,c,u;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){const f=(c=s.cards)==null?void 0:c.find(p=>p.id===r);f&&(f.sql=o,(u=i.onUpdateCard)==null||u.call(i,f,n))}})},setFrameCardData:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&bc.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(p=>p.id===r);u&&(u.data=o)})})},setSheetLayout:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layout=r)})},setSheetLayouts:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layouts=r)})},setShowContext:n=>{e(()=>({showContext:n}))},setShowFilters:n=>{e(()=>({showFilters:n}))},setFilterValues:n=>{e(()=>({filterValues:n}))},addOrUpdateFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1?r.filterValues.splice(o,1,n):r.filterValues.push(n)}else r.filterValues=[n]})},addOrUpdateFilterValues:n=>{e(r=>{r.filterValues?n.forEach(o=>{var s,a,l;const i=(s=r==null?void 0:r.filterValues)==null?void 0:s.findIndex(c=>c.filterId===o.filterId);i!==void 0&&i>-1?(a=r.filterValues)==null||a.splice(i,1,o):(l=r.filterValues)==null||l.push(o)}):r.filterValues=n})},removeFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.filter(i=>i.filterId!==n&&!i.filterId.startsWith(n));r.filterValues=o}})},replaceFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1&&r.filterValues.splice(o,1,n)}})},addFilter:n=>{e(r=>{var i,s;r.dashboard.filters?(i=r.dashboard.filters)==null||i.push(n):r.dashboard.filters=[n];const o=(s=r.dashboard.sheets)==null?void 0:s.find(a=>a.id===r.selectedSheetId);YR({id:n.id,layouts:o==null?void 0:o.layouts,y:0,initialHeight:8,minH:7,w:10})})},removeFilter:n=>{e(r=>{var o,i,s;if(r.dashboard.filters){const a=(o=r.dashboard.filters)==null?void 0:o.findIndex(l=>l.id===n);if(a>-1){(i=r.dashboard.filters)==null||i.splice(a,1);const l=(s=r.dashboard.sheets)==null?void 0:s.find(c=>c.id===r.selectedSheetId);KR(n,l==null?void 0:l.layouts)}}})},updateFrameCard:(n,r,o)=>{e(i=>{var l,c,u,f,p;const s=(c=(l=i.dashboard)==null?void 0:l.sheets)==null?void 0:c.find(h=>h.id===n);if(!s)return;const a=(u=s==null?void 0:s.frames)==null?void 0:u.find(h=>h.id===r);if(a){const h=(f=a.cards)==null?void 0:f.findIndex(b=>b.id===o.id);h>-1&&((p=a.cards)==null||p.splice(h,1,o))}})},updateFilter:n=>{e(r=>{var o,i;if(r.dashboard.filters){const s=(o=r.dashboard.filters)==null?void 0:o.findIndex(a=>a.id===n.id);s>-1&&((i=r.dashboard.filters)==null||i.splice(s,1,n))}})},setIsDashboardEditing:n=>{e(()=>({isDashboardEditing:n}))},setShowDashboardJSON:n=>{e(()=>({showDashboardJSON:n}))},setIsVisualEditing:n=>{e(()=>({isVisualEditing:n}))},addFrame:(n,r,o)=>{e(i=>{var a,l,c,u;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){s.frames||(s.frames=[]),(c=s.frames)==null||c.push(r);let f=1/0,p=0;o==="start"&&(f=0),YR({id:r.id,layouts:s.layouts,minH:10,x:p,y:f}),(u=i.onAddFrame)==null||u.call(i,r,n)}})},removeFrame:(n,r)=>{e(o=>{var s,a,l,c,u;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(f=>f.id===n);if(i){const f=(l=i.frames)==null?void 0:l.findIndex(p=>p.id===r);console.log(f),typeof f=="number"&&f>-1&&((c=i.frames)==null||c.splice(f,1),(u=i.layout)==null||u.splice(f,1),KR(r,i.layouts))}})},updateFrame:(n,r)=>{e(o=>{var a,l,c,u;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n),s=(c=i==null?void 0:i.frames)==null?void 0:c.findIndex(f=>f.id===r.id);i&&((u=i.frames)==null||u.splice(s,1,r))})},updateCard:(n,r)=>{e(o=>{var a,l,c,u,f;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(p=>p.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(p=>p.id===r.id);i&&((u=i.cards)==null||u.splice(s,1,r),(f=o.onUpdateCard)==null||f.call(o,r,n))})},removeCard:(n,r)=>{e(o=>{var a,l,c,u,f,p;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(h=>h.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(h=>h.id===r.id);i&&((u=i.cards)==null||u.splice(s,1),(f=i.layout)==null||f.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(c=>c.id===n);i&&(((l=i.cards)==null?void 0:l.find(u=>u.id===r))?o.selectedCardId=r:o.selectedCardId=null)})},setSelectedFrameId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(a=>a.id===r.selectedSheetId))&&(r.selectedFrameId=n)})},setSelectedSheetId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(a=>a.id===n))&&(r.selectedSheetId=n)})},setOnSaveFunction:n=>{e(()=>({onSaveFunction:n}))},setOnAddCard:n=>{e(()=>({onAddCard:n}))},setOnUpdateCard:n=>{e(()=>({onUpdateCard:n}))},setOnRemoveCard:n=>{e(()=>({onRemoveCard:n}))},setOnEvent:n=>{e(()=>({onEvent:n}))},getDashboard:()=>t().dashboard,getSelectedSheet:()=>{var n,r;return(r=(n=t().dashboard)==null?void 0:n.sheets)==null?void 0:r.find(o=>o.id===t().selectedSheetId)},getCardFrame:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a){for(let l=0;l<a.length;l++)if((i=a[l].cards)==null?void 0:i.find(u=>u.id===n))return a[l]}}},getSelectedFrame:()=>{var r,o,i;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(s=>s.id===t().selectedSheetId);return(i=n==null?void 0:n.frames)==null?void 0:i.find(s=>s.id===t().selectedFrameId)},getCard:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a)for(let l=0;l<a.length;l++){const c=(i=a[l].cards)==null?void 0:i.find(u=>u.id===n);if(c)return c}}},getSelectedSheetLayout:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layout},getSelectedSheetLayouts:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layouts},getStyle:()=>{var n;return(n=t().dashboard)==null?void 0:n.style},getCardSheet(n){var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a){for(let l=0;l<a.length;l++)if((i=a[l].cards)==null?void 0:i.find(u=>u.id===n))return r[s]}}},handleDataPointClickAction:(n,r)=>{uV({card:n,dataPoint:r,set:e,get:t})}}}))),Br=()=>De(e=>e.actions);var Vf=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(){}},tu=typeof window>"u"||"Deno"in window;function To(){}function dV(e,t){return typeof e=="function"?e(t):e}function rx(e){return typeof e=="number"&&e>=0&&e!==1/0}function vD(e,t){return Math.max(e+(t||0)-Date.now(),0)}function XR(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==lw(s,t.options))return!1}else if(!Hd(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 QR(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Vd(t.options.mutationKey)!==Vd(i))return!1}else if(!Hd(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function lw(e,t){return((t==null?void 0:t.queryKeyHashFn)||Vd)(e)}function Vd(e){return JSON.stringify(e,(t,n)=>ix(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Hd(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Hd(e[n],t[n])):!1}function bD(e,t){if(e===t)return e;const n=JR(e)&&JR(t);if(n||ix(e)&&ix(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),s=i.length,a=n?[]:{};let l=0;for(let c=0;c<s;c++){const u=n?c:i[c];!n&&e[u]===void 0&&t[u]===void 0&&r.includes(u)?(a[u]=void 0,l++):(a[u]=bD(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return o===s&&l===o?e:a}return t}function ox(e,t){if(e&&!t||t&&!e)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function JR(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ix(e){if(!ZR(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!ZR(n)||!n.hasOwnProperty("isPrototypeOf"))}function ZR(e){return Object.prototype.toString.call(e)==="[object Object]"}function fV(e){return new Promise(t=>{setTimeout(t,e)})}function sx(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?bD(e,t):t}function hV(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function pV(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Za,Us,Nc,jT,gV=(jT=class extends Vf{constructor(){super();Xe(this,Za,void 0);Xe(this,Us,void 0);Xe(this,Nc,void 0);Ve(this,Nc,t=>{if(!tu&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){se(this,Us)||this.setEventListener(se(this,Nc))}onUnsubscribe(){var t;this.hasListeners()||((t=se(this,Us))==null||t.call(this),Ve(this,Us,void 0))}setEventListener(t){var n;Ve(this,Nc,t),(n=se(this,Us))==null||n.call(this),Ve(this,Us,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){se(this,Za)!==t&&(Ve(this,Za,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof se(this,Za)=="boolean"?se(this,Za):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Za=new WeakMap,Us=new WeakMap,Nc=new WeakMap,jT),Ig=new gV,Lc,qs,Fc,zT,mV=(zT=class extends Vf{constructor(){super();Xe(this,Lc,!0);Xe(this,qs,void 0);Xe(this,Fc,void 0);Ve(this,Fc,t=>{if(!tu&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){se(this,qs)||this.setEventListener(se(this,Fc))}onUnsubscribe(){var t;this.hasListeners()||((t=se(this,qs))==null||t.call(this),Ve(this,qs,void 0))}setEventListener(t){var n;Ve(this,Fc,t),(n=se(this,qs))==null||n.call(this),Ve(this,qs,t(this.setOnline.bind(this)))}setOnline(t){se(this,Lc)!==t&&(Ve(this,Lc,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return se(this,Lc)}},Lc=new WeakMap,qs=new WeakMap,Fc=new WeakMap,zT),Ng=new mV;function vV(e){return Math.min(1e3*2**e,3e4)}function Rm(e){return(e??"online")==="online"?Ng.isOnline():!0}var yD=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function n0(e){return e instanceof yD}function xD(e){let t=!1,n=0,r=!1,o,i,s;const a=new Promise((w,y)=>{i=w,s=y}),l=w=>{var y;r||(h(new yD(w)),(y=e.abort)==null||y.call(e))},c=()=>{t=!0},u=()=>{t=!1},f=()=>!Ig.isFocused()||e.networkMode!=="always"&&!Ng.isOnline(),p=w=>{var y;r||(r=!0,(y=e.onSuccess)==null||y.call(e,w),o==null||o(),i(w))},h=w=>{var y;r||(r=!0,(y=e.onError)==null||y.call(e,w),o==null||o(),s(w))},b=()=>new Promise(w=>{var y;o=_=>{const S=r||!f();return S&&w(_),S},(y=e.onPause)==null||y.call(e)}).then(()=>{var w;o=void 0,r||(w=e.onContinue)==null||w.call(e)}),v=()=>{if(r)return;let w;try{w=e.fn()}catch(y){w=Promise.reject(y)}Promise.resolve(w).then(p).catch(y=>{var O;if(r)return;const _=e.retry??(tu?0:3),S=e.retryDelay??vV,C=typeof S=="function"?S(n,y):S,E=_===!0||typeof _=="number"&&n<_||typeof _=="function"&&_(n,y);if(t||!E){h(y);return}n++,(O=e.onFail)==null||O.call(e,n,y),fV(C).then(()=>{if(f())return b()}).then(()=>{t?h(y):v()})})};return Rm(e.networkMode)?v():b().then(v),{promise:a,cancel:l,continue:()=>(o==null?void 0:o())?a:Promise.resolve(),cancelRetry:c,continueRetry:u}}function bV(){let e=[],t=0,n=p=>{p()},r=p=>{p()},o=p=>setTimeout(p,0);const i=p=>{o=p},s=p=>{let h;t++;try{h=p()}finally{t--,t||c()}return h},a=p=>{t?e.push(p):o(()=>{n(p)})},l=p=>(...h)=>{a(()=>{p(...h)})},c=()=>{const p=e;e=[],p.length&&o(()=>{r(()=>{p.forEach(h=>{n(h)})})})};return{batch:s,batchCalls:l,schedule:a,setNotifyFunction:p=>{n=p},setBatchNotifyFunction:p=>{r=p},setScheduler:i}}var Qn=bV(),el,BT,wD=(BT=class{constructor(){Xe(this,el,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),rx(this.gcTime)&&Ve(this,el,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(tu?1/0:5*60*1e3))}clearGcTimeout(){se(this,el)&&(clearTimeout(se(this,el)),Ve(this,el,void 0))}},el=new WeakMap,BT),jc,zc,Po,Gs,Oo,Wn,Of,tl,Bc,mg,Yo,Yi,VT,yV=(VT=class extends wD{constructor(t){super();Xe(this,Bc);Xe(this,Yo);Xe(this,jc,void 0);Xe(this,zc,void 0);Xe(this,Po,void 0);Xe(this,Gs,void 0);Xe(this,Oo,void 0);Xe(this,Wn,void 0);Xe(this,Of,void 0);Xe(this,tl,void 0);Ve(this,tl,!1),Ve(this,Of,t.defaultOptions),Ct(this,Bc,mg).call(this,t.options),Ve(this,Wn,[]),Ve(this,Po,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ve(this,jc,t.state||xV(this.options)),this.state=se(this,jc),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!se(this,Wn).length&&this.state.fetchStatus==="idle"&&se(this,Po).remove(this)}setData(t,n){const r=sx(this.state.data,t,this.options);return Ct(this,Yo,Yi).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Ct(this,Yo,Yi).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=se(this,Gs);return(r=se(this,Oo))==null||r.cancel(t),n?n.then(To).catch(To):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(se(this,jc))}isActive(){return se(this,Wn).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||se(this,Wn).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!vD(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=se(this,Wn).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=se(this,Oo))==null||n.continue()}onOnline(){var n;const t=se(this,Wn).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=se(this,Oo))==null||n.continue()}addObserver(t){se(this,Wn).includes(t)||(se(this,Wn).push(t),this.clearGcTimeout(),se(this,Po).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){se(this,Wn).includes(t)&&(Ve(this,Wn,se(this,Wn).filter(n=>n!==t)),se(this,Wn).length||(se(this,Oo)&&(se(this,tl)?se(this,Oo).cancel({revert:!0}):se(this,Oo).cancelRetry()),this.scheduleGc()),se(this,Po).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return se(this,Wn).length}invalidate(){this.state.isInvalidated||Ct(this,Yo,Yi).call(this,{type:"invalidate"})}fetch(t,n){var c,u,f,p;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(se(this,Gs))return(c=se(this,Oo))==null||c.continueRetry(),se(this,Gs)}if(t&&Ct(this,Bc,mg).call(this,t),!this.options.queryFn){const h=se(this,Wn).find(b=>b.options.queryFn);h&&Ct(this,Bc,mg).call(this,h.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=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(Ve(this,tl,!0),r.signal)})};i(o);const s=()=>this.options.queryFn?(Ve(this,tl,!1),this.options.persister?this.options.persister(this.options.queryFn,o,this):this.options.queryFn(o)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),a={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(a),(u=this.options.behavior)==null||u.onFetch(a,this),Ve(this,zc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=a.fetchOptions)==null?void 0:f.meta))&&Ct(this,Yo,Yi).call(this,{type:"fetch",meta:(p=a.fetchOptions)==null?void 0:p.meta});const l=h=>{var b,v,w,y;n0(h)&&h.silent||Ct(this,Yo,Yi).call(this,{type:"error",error:h}),n0(h)||((v=(b=se(this,Po).config).onError)==null||v.call(b,h,this),(y=(w=se(this,Po).config).onSettled)==null||y.call(w,this.state.data,h,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return Ve(this,Oo,xD({fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:h=>{var b,v,w,y;if(typeof h>"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(h),(v=(b=se(this,Po).config).onSuccess)==null||v.call(b,h,this),(y=(w=se(this,Po).config).onSettled)==null||y.call(w,h,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(h,b)=>{Ct(this,Yo,Yi).call(this,{type:"failed",failureCount:h,error:b})},onPause:()=>{Ct(this,Yo,Yi).call(this,{type:"pause"})},onContinue:()=>{Ct(this,Yo,Yi).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),Ve(this,Gs,se(this,Oo).promise),se(this,Gs)}},jc=new WeakMap,zc=new WeakMap,Po=new WeakMap,Gs=new WeakMap,Oo=new WeakMap,Wn=new WeakMap,Of=new WeakMap,tl=new WeakMap,Bc=new WeakSet,mg=function(t){this.options={...se(this,Of),...t},this.updateGcTime(this.options.gcTime)},Yo=new WeakSet,Yi=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:Rm(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 n0(o)&&o.revert&&se(this,zc)?{...se(this,zc),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Qn.batch(()=>{se(this,Wn).forEach(r=>{r.onQueryUpdate()}),se(this,Po).notify({query:this,type:"updated",action:t})})},VT);function xV(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var hi,HT,_D=(HT=class extends Vf{constructor(t={}){super();Xe(this,hi,void 0);this.config=t,Ve(this,hi,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??lw(o,n);let s=this.get(i);return s||(s=new yV({cache:this,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){se(this,hi).has(t.queryHash)||(se(this,hi).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=se(this,hi).get(t.queryHash);n&&(t.destroy(),n===t&&se(this,hi).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Qn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return se(this,hi).get(t)}getAll(){return[...se(this,hi).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>XR(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>XR(t,r)):n}notify(t){Qn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Qn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Qn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},hi=new WeakMap,HT),pi,$f,Zr,Vc,gi,Fs,WT,wV=(WT=class extends wD{constructor(t){super();Xe(this,gi);Xe(this,pi,void 0);Xe(this,$f,void 0);Xe(this,Zr,void 0);Xe(this,Vc,void 0);this.mutationId=t.mutationId,Ve(this,$f,t.defaultOptions),Ve(this,Zr,t.mutationCache),Ve(this,pi,[]),this.state=t.state||_V(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...se(this,$f),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){se(this,pi).includes(t)||(se(this,pi).push(t),this.clearGcTimeout(),se(this,Zr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ve(this,pi,se(this,pi).filter(n=>n!==t)),this.scheduleGc(),se(this,Zr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){se(this,pi).length||(this.state.status==="pending"?this.scheduleGc():se(this,Zr).remove(this))}continue(){var t;return((t=se(this,Vc))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,a,l,c,u,f,p,h,b,v,w,y,_,S,C,E,O,T;const n=()=>(Ve(this,Vc,xD({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(I,N)=>{Ct(this,gi,Fs).call(this,{type:"failed",failureCount:I,error:N})},onPause:()=>{Ct(this,gi,Fs).call(this,{type:"pause"})},onContinue:()=>{Ct(this,gi,Fs).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),se(this,Vc).promise),r=this.state.status==="pending";try{if(!r){Ct(this,gi,Fs).call(this,{type:"pending",variables:t}),await((i=(o=se(this,Zr).config).onMutate)==null?void 0:i.call(o,t,this));const N=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));N!==this.state.context&&Ct(this,gi,Fs).call(this,{type:"pending",context:N,variables:t})}const I=await n();return await((c=(l=se(this,Zr).config).onSuccess)==null?void 0:c.call(l,I,t,this.state.context,this)),await((f=(u=this.options).onSuccess)==null?void 0:f.call(u,I,t,this.state.context)),await((h=(p=se(this,Zr).config).onSettled)==null?void 0:h.call(p,I,null,this.state.variables,this.state.context,this)),await((v=(b=this.options).onSettled)==null?void 0:v.call(b,I,null,t,this.state.context)),Ct(this,gi,Fs).call(this,{type:"success",data:I}),I}catch(I){try{throw await((y=(w=se(this,Zr).config).onError)==null?void 0:y.call(w,I,t,this.state.context,this)),await((S=(_=this.options).onError)==null?void 0:S.call(_,I,t,this.state.context)),await((E=(C=se(this,Zr).config).onSettled)==null?void 0:E.call(C,void 0,I,this.state.variables,this.state.context,this)),await((T=(O=this.options).onSettled)==null?void 0:T.call(O,void 0,I,t,this.state.context)),I}finally{Ct(this,gi,Fs).call(this,{type:"error",error:I})}}}},pi=new WeakMap,$f=new WeakMap,Zr=new WeakMap,Vc=new WeakMap,gi=new WeakSet,Fs=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:!Rm(this.options.networkMode),status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Qn.batch(()=>{se(this,pi).forEach(r=>{r.onMutationUpdate(t)}),se(this,Zr).notify({mutation:this,type:"updated",action:t})})},WT);function _V(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var $o,Tf,nl,UT,SV=(UT=class extends Vf{constructor(t={}){super();Xe(this,$o,void 0);Xe(this,Tf,void 0);Xe(this,nl,void 0);this.config=t,Ve(this,$o,[]),Ve(this,Tf,0)}build(t,n,r){const o=new wV({mutationCache:this,mutationId:++ip(this,Tf)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){se(this,$o).push(t),this.notify({type:"added",mutation:t})}remove(t){Ve(this,$o,se(this,$o).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){Qn.batch(()=>{se(this,$o).forEach(t=>{this.remove(t)})})}getAll(){return se(this,$o)}find(t){const n={exact:!0,...t};return se(this,$o).find(r=>QR(n,r))}findAll(t={}){return se(this,$o).filter(n=>QR(t,n))}notify(t){Qn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return Ve(this,nl,(se(this,nl)??Promise.resolve()).then(()=>{const t=se(this,$o).filter(n=>n.state.isPaused);return Qn.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(To)),Promise.resolve()))}).then(()=>{Ve(this,nl,void 0)})),se(this,nl)}},$o=new WeakMap,Tf=new WeakMap,nl=new WeakMap,UT);function CV(e){return{onFetch:(t,n)=>{const r=async()=>{var b,v,w,y,_;const o=t.options,i=(w=(v=(b=t.fetchOptions)==null?void 0:b.meta)==null?void 0:v.fetchMore)==null?void 0:w.direction,s=((y=t.state.data)==null?void 0:y.pages)||[],a=((_=t.state.data)==null?void 0:_.pageParams)||[],l={pages:[],pageParams:[]};let c=!1;const u=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(t.signal.aborted?c=!0:t.signal.addEventListener("abort",()=>{c=!0}),t.signal)})},f=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),p=async(S,C,E)=>{if(c)return Promise.reject();if(C==null&&S.pages.length)return Promise.resolve(S);const O={queryKey:t.queryKey,pageParam:C,direction:E?"backward":"forward",meta:t.options.meta};u(O);const T=await f(O),{maxPages:I}=t.options,N=E?pV:hV;return{pages:N(S.pages,T,I),pageParams:N(S.pageParams,C,I)}};let h;if(i&&s.length){const S=i==="backward",C=S?EV:eP,E={pages:s,pageParams:a},O=C(o,E);h=await p(E,O,S)}else{h=await p(l,a[0]??o.initialPageParam);const S=e??s.length;for(let C=1;C<S;C++){const E=eP(o,h);h=await p(h,E)}}return h};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 eP(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function EV(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,Ys,Ks,Hc,Wc,Xs,Uc,qc,qT,RV=(qT=class{constructor(e={}){Xe(this,Nn,void 0);Xe(this,Ys,void 0);Xe(this,Ks,void 0);Xe(this,Hc,void 0);Xe(this,Wc,void 0);Xe(this,Xs,void 0);Xe(this,Uc,void 0);Xe(this,qc,void 0);Ve(this,Nn,e.queryCache||new _D),Ve(this,Ys,e.mutationCache||new SV),Ve(this,Ks,e.defaultOptions||{}),Ve(this,Hc,new Map),Ve(this,Wc,new Map),Ve(this,Xs,0)}mount(){ip(this,Xs)._++,se(this,Xs)===1&&(Ve(this,Uc,Ig.subscribe(()=>{Ig.isFocused()&&(this.resumePausedMutations(),se(this,Nn).onFocus())})),Ve(this,qc,Ng.subscribe(()=>{Ng.isOnline()&&(this.resumePausedMutations(),se(this,Nn).onOnline())})))}unmount(){var e,t;ip(this,Xs)._--,se(this,Xs)===0&&((e=se(this,Uc))==null||e.call(this),Ve(this,Uc,void 0),(t=se(this,qc))==null||t.call(this),Ve(this,qc,void 0))}isFetching(e){return se(this,Nn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return se(this,Ys).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=se(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=se(this,Nn).find({queryKey:e}),o=r==null?void 0:r.state.data,i=dV(t,o);if(typeof i>"u")return;const s=this.defaultQueryOptions({queryKey:e});return se(this,Nn).build(this,s).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return Qn.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var t;return(t=se(this,Nn).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=se(this,Nn);Qn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=se(this,Nn),r={type:"active",...e};return Qn.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=Qn.batch(()=>se(this,Nn).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(To).catch(To)}invalidateQueries(e={},t={}){return Qn.batch(()=>{if(se(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=Qn.batch(()=>se(this,Nn).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(To)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(To)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=se(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(To).catch(To)}fetchInfiniteQuery(e){return e.behavior=CV(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(To).catch(To)}resumePausedMutations(){return se(this,Ys).resumePausedMutations()}getQueryCache(){return se(this,Nn)}getMutationCache(){return se(this,Ys)}getDefaultOptions(){return se(this,Ks)}setDefaultOptions(e){Ve(this,Ks,e)}setQueryDefaults(e,t){se(this,Hc).set(Vd(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...se(this,Hc).values()];let n={};return t.forEach(r=>{Hd(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){se(this,Wc).set(Vd(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...se(this,Wc).values()];let n={};return t.forEach(r=>{Hd(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...se(this,Ks).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=lw(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:{...se(this,Ks).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){se(this,Nn).clear(),se(this,Ys).clear()}},Nn=new WeakMap,Ys=new WeakMap,Ks=new WeakMap,Hc=new WeakMap,Wc=new WeakMap,Xs=new WeakMap,Uc=new WeakMap,qc=new WeakMap,qT),Mr,fn,Df,vr,rl,Gc,mi,Af,Yc,Kc,ol,il,Qs,Xc,sl,pd,kf,ax,Mf,lx,If,cx,Nf,ux,Lf,dx,Ff,fx,jf,hx,xm,SD,GT,PV=(GT=class extends Vf{constructor(t,n){super();Xe(this,sl);Xe(this,kf);Xe(this,Mf);Xe(this,If);Xe(this,Nf);Xe(this,Lf);Xe(this,Ff);Xe(this,jf);Xe(this,xm);Xe(this,Mr,void 0);Xe(this,fn,void 0);Xe(this,Df,void 0);Xe(this,vr,void 0);Xe(this,rl,void 0);Xe(this,Gc,void 0);Xe(this,mi,void 0);Xe(this,Af,void 0);Xe(this,Yc,void 0);Xe(this,Kc,void 0);Xe(this,ol,void 0);Xe(this,il,void 0);Xe(this,Qs,void 0);Xe(this,Xc,new Set);this.options=n,Ve(this,Mr,t),Ve(this,mi,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(se(this,fn).addObserver(this),tP(se(this,fn),this.options)?Ct(this,sl,pd).call(this):this.updateResult(),Ct(this,Nf,ux).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return px(se(this,fn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return px(se(this,fn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ct(this,Lf,dx).call(this),Ct(this,Ff,fx).call(this),se(this,fn).removeObserver(this)}setOptions(t,n){const r=this.options,o=se(this,fn);if(this.options=se(this,Mr).defaultQueryOptions(t),ox(r,this.options)||se(this,Mr).getQueryCache().notify({type:"observerOptionsUpdated",query:se(this,fn),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),Ct(this,jf,hx).call(this);const i=this.hasListeners();i&&nP(se(this,fn),o,this.options,r)&&Ct(this,sl,pd).call(this),this.updateResult(n),i&&(se(this,fn)!==o||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&Ct(this,kf,ax).call(this);const s=Ct(this,Mf,lx).call(this);i&&(se(this,fn)!==o||this.options.enabled!==r.enabled||s!==se(this,Qs))&&Ct(this,If,cx).call(this,s)}getOptimisticResult(t){const n=se(this,Mr).getQueryCache().build(se(this,Mr),t),r=this.createResult(n,t);return $V(this,r)&&(Ve(this,vr,r),Ve(this,Gc,this.options),Ve(this,rl,se(this,fn).state)),r}getCurrentResult(){return se(this,vr)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(se(this,Xc).add(r),t[r])})}),n}getCurrentQuery(){return se(this,fn)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=se(this,Mr).defaultQueryOptions(t),r=se(this,Mr).getQueryCache().build(se(this,Mr),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Ct(this,sl,pd).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),se(this,vr)))}createResult(t,n){var O;const r=se(this,fn),o=this.options,i=se(this,vr),s=se(this,rl),a=se(this,Gc),c=t!==r?t.state:se(this,Df),{state:u}=t;let{error:f,errorUpdatedAt:p,fetchStatus:h,status:b}=u,v=!1,w;if(n._optimisticResults){const T=this.hasListeners(),I=!T&&tP(t,n),N=T&&nP(t,r,n,o);(I||N)&&(h=Rm(t.options.networkMode)?"fetching":"paused",u.dataUpdatedAt||(b="pending")),n._optimisticResults==="isRestoring"&&(h="idle")}if(n.select&&typeof u.data<"u")if(i&&u.data===(s==null?void 0:s.data)&&n.select===se(this,Af))w=se(this,Yc);else try{Ve(this,Af,n.select),w=n.select(u.data),w=sx(i==null?void 0:i.data,w,n),Ve(this,Yc,w),Ve(this,mi,null)}catch(T){Ve(this,mi,T)}else w=u.data;if(typeof n.placeholderData<"u"&&typeof w>"u"&&b==="pending"){let T;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))T=i.data;else if(T=typeof n.placeholderData=="function"?n.placeholderData((O=se(this,Kc))==null?void 0:O.state.data,se(this,Kc)):n.placeholderData,n.select&&typeof T<"u")try{T=n.select(T),Ve(this,mi,null)}catch(I){Ve(this,mi,I)}typeof T<"u"&&(b="success",w=sx(i==null?void 0:i.data,T,n),v=!0)}se(this,mi)&&(f=se(this,mi),w=se(this,Yc),p=Date.now(),b="error");const y=h==="fetching",_=b==="pending",S=b==="error",C=_&&y;return{status:b,fetchStatus:h,isPending:_,isSuccess:b==="success",isError:S,isInitialLoading:C,isLoading:C,data:w,dataUpdatedAt:u.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:y,isRefetching:y&&!_,isLoadingError:S&&u.dataUpdatedAt===0,isPaused:h==="paused",isPlaceholderData:v,isRefetchError:S&&u.dataUpdatedAt!==0,isStale:cw(t,n),refetch:this.refetch}}updateResult(t){const n=se(this,vr),r=this.createResult(se(this,fn),this.options);if(Ve(this,rl,se(this,fn).state),Ve(this,Gc,this.options),se(this,rl).data!==void 0&&Ve(this,Kc,se(this,fn)),ox(r,n))return;Ve(this,vr,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!se(this,Xc).size)return!0;const l=new Set(a??se(this,Xc));return this.options.throwOnError&&l.add("error"),Object.keys(se(this,vr)).some(c=>{const u=c;return se(this,vr)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),Ct(this,xm,SD).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ct(this,Nf,ux).call(this)}},Mr=new WeakMap,fn=new WeakMap,Df=new WeakMap,vr=new WeakMap,rl=new WeakMap,Gc=new WeakMap,mi=new WeakMap,Af=new WeakMap,Yc=new WeakMap,Kc=new WeakMap,ol=new WeakMap,il=new WeakMap,Qs=new WeakMap,Xc=new WeakMap,sl=new WeakSet,pd=function(t){Ct(this,jf,hx).call(this);let n=se(this,fn).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(To)),n},kf=new WeakSet,ax=function(){if(Ct(this,Lf,dx).call(this),tu||se(this,vr).isStale||!rx(this.options.staleTime))return;const n=vD(se(this,vr).dataUpdatedAt,this.options.staleTime)+1;Ve(this,ol,setTimeout(()=>{se(this,vr).isStale||this.updateResult()},n))},Mf=new WeakSet,lx=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(se(this,fn)):this.options.refetchInterval)??!1},If=new WeakSet,cx=function(t){Ct(this,Ff,fx).call(this),Ve(this,Qs,t),!(tu||this.options.enabled===!1||!rx(se(this,Qs))||se(this,Qs)===0)&&Ve(this,il,setInterval(()=>{(this.options.refetchIntervalInBackground||Ig.isFocused())&&Ct(this,sl,pd).call(this)},se(this,Qs)))},Nf=new WeakSet,ux=function(){Ct(this,kf,ax).call(this),Ct(this,If,cx).call(this,Ct(this,Mf,lx).call(this))},Lf=new WeakSet,dx=function(){se(this,ol)&&(clearTimeout(se(this,ol)),Ve(this,ol,void 0))},Ff=new WeakSet,fx=function(){se(this,il)&&(clearInterval(se(this,il)),Ve(this,il,void 0))},jf=new WeakSet,hx=function(){const t=se(this,Mr).getQueryCache().build(se(this,Mr),this.options);if(t===se(this,fn))return;const n=se(this,fn);Ve(this,fn,t),Ve(this,Df,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},xm=new WeakSet,SD=function(t){Qn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(se(this,vr))}),se(this,Mr).getQueryCache().notify({query:se(this,fn),type:"observerResultsUpdated"})})},GT);function OV(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function tP(e,t){return OV(e,t)||e.state.dataUpdatedAt>0&&px(e,t,t.refetchOnMount)}function px(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&cw(e,t)}return!1}function nP(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&cw(e,n)}function cw(e,t){return e.isStaleByTime(t.staleTime)}function $V(e,t){return!ox(e.getCurrentResult(),t)}var CD=L.createContext(void 0),ED=e=>{const t=L.useContext(CD);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},TV=({client:e,children:t})=>(L.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),L.createElement(CD.Provider,{value:e},t)),RD=L.createContext(!1),DV=()=>L.useContext(RD);RD.Provider;function AV(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var kV=L.createContext(AV()),MV=()=>L.useContext(kV);function IV(e,t){return typeof e=="function"?e(...t):!!e}var NV=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},LV=e=>{L.useEffect(()=>{e.clearReset()},[e])},FV=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&IV(n,[e.error,r]),jV=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},zV=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,BV=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function VV(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=ED(n),o=DV(),i=MV(),s=r.defaultQueryOptions(e);s._optimisticResults=o?"isRestoring":"optimistic",jV(s),NV(s,i),LV(i);const[a]=L.useState(()=>new t(r,s)),l=a.getOptimisticResult(s);if(L.useSyncExternalStore(L.useCallback(c=>{const u=o?()=>{}:a.subscribe(Qn.batchCalls(c));return a.updateResult(),u},[a,o]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),L.useEffect(()=>{a.setOptions(s,{listeners:!1})},[s,a]),zV(s,l))throw BV(s,a,i);if(FV({result:l,errorResetBoundary:i,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw l.error;return s.notifyOnChangeProps?l:a.trackResult(l)}function Hf(e,t){return VV(e,PV,t)}const HV={theme:"system",setTheme:()=>null},PD=m.createContext(HV);function WV({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 P.jsx(PD.Provider,{...r,value:s,children:e})}const OD=()=>{const e=m.useContext(PD);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};async function UV(e){return await(await fetch("https://semaphor.cloud/api/v1/dashboard",{headers:{Authorization:`Bearer ${e}`}})).json()}function $D(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function rP(e,t){const n=$D(e);return n==="dark"?al.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function qV({authToken:e,customStyle:t,currentTheme:n,onSave:r,onEvent:o}){const{data:i,refetch:s,isLoading:a,isError:l}=Hf({queryKey:["dashboard",e==null?void 0:e.accessToken],queryFn:()=>UV(e==null?void 0:e.accessToken),enabled:!1}),{theme:c,setTheme:u}=OD(),f=De(T=>T.dashboard.globalStyle),{setDashboard:p,setSelectedSheetId:h,setStyle:b,setOnSaveFunction:v}=De(T=>T.actions);De(T=>T.actions.setCustomCards);const w=De(T=>T.actions.setFilterValues),y=De(T=>T.actions.setBookmarkKey),_=De(T=>T.actions.setAuthToken),S=De(T=>T.actions.setThemeStyle),C=De(T=>T.actions.setDashboardTheme),E=De(T=>T.actions.setOnEvent);m.useEffect(()=>{if(c){const T=$D(c);C(T)}},[c,C]),m.useEffect(()=>{n&&u(n)},[n,u]);function O(){const T=al.cloneDeep(tx),I=al.merge(T,f);if(t){const N=al.merge(I,t),k=rP(c,N);S(k),b(N)}else{const N=rP(c,I);S(N),b(tx)}}return m.useEffect(()=>{i&&i.dashboard&&O()},[c,t,f]),m.useEffect(()=>{var F;if(!i||!i.dashboard)return;const T=i.dashboard,I=T3(T.id),N=JSON.parse(localStorage.getItem(I)||"[]"),k=N.find(z=>z.default===!0);if(k)p(k.template),O(),y(k.name),k.filterValues&&w(k.filterValues);else{p(T),O();const z=N.find(Q=>(Q==null?void 0:Q.name)==="Original");z?z.template=T:N.push({name:"Original",template:T,default:!1}),localStorage.setItem(I,JSON.stringify(N))}h((F=T.sheets)==null?void 0:F[0].id)},[i,p,h,w,y]),m.useEffect(()=>{r&&v(r),o&&E(o)},[r,v,o,E]),m.useEffect(()=>{e&&e.accessToken&&(_(e),s())},[e,s,_]),{isLoading:a,isError:l}}function Pm({className:e,...t}){return P.jsx("div",{className:_e("animate-pulse rounded-md bg-muted",e),...t})}const uw=L.forwardRef(({className:e,...t},n)=>P.jsx("div",{ref:n,className:_e("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));uw.displayName="Card";const Om=L.forwardRef(({className:e,...t},n)=>P.jsx("div",{ref:n,className:_e("flex flex-col space-y-1.5 p-6",e),...t}));Om.displayName="CardHeader";const Wf=L.forwardRef(({className:e,...t},n)=>P.jsx("h3",{ref:n,className:_e("text-2xl font-semibold leading-none tracking-tight",e),...t}));Wf.displayName="CardTitle";const dw=L.forwardRef(({className:e,...t},n)=>P.jsx("p",{ref:n,className:_e("text-sm text-muted-foreground",e),...t}));dw.displayName="CardDescription";const $m=L.forwardRef(({className:e,...t},n)=>P.jsx("div",{ref:n,className:_e("px-6 pt-0",e),...t}));$m.displayName="CardContent";const fw=L.forwardRef(({className:e,...t},n)=>P.jsx("div",{ref:n,className:_e("flex items-center p-6 pt-0",e),...t}));fw.displayName="CardFooter";function TD({className:e,customStyle:t,onSave:n,onEvent:r,LoadingComponent:o,ErrorComponent:i,onChartElementClicked:s,id:a,authToken:l,currentTheme:c,version:u,customCards:f,showAssistant:p,...h}){De(_=>_.selectedSheetId);const b=De(_=>_.themeStyle),v=De(_=>_.isSessionExpired),{isLoading:w,isError:y}=qV({authToken:l,customStyle:t,currentTheme:c,onSave:n,onEvent:r});return w||!l?(r==null||r({type:"info",message:"Loading dashboard"}),o?P.jsx(o,{message:"loading"}):P.jsx("div",{className:"flex items-center gap-3",children:P.jsx(Pm,{className:"h-1 w-full dark:h-[2px]"})})):y?(r==null||r({type:"error",message:"Error fetching dashboard"}),i?(console.log("Error fetching dashboard"),P.jsx(i,{})):P.jsx("div",{children:"Error"})):v?(r==null||r({type:"error",message:"Session Expired"}),P.jsx("div",{className:"flex h-full items-center justify-center",children:P.jsxs("div",{className:"space-y-4 rounded-md border border-muted p-10",children:[P.jsx(Wf,{children:"Session Expired"}),P.jsx("p",{className:"text-muted-foreground",children:"Please refresh your page to continue."})]})})):P.jsx("div",{className:_e("flex h-full flex-col justify-between",b==null?void 0:b.dashboardPanel,e),role:"dashboard-panel",...h})}function ce(){return ce=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},ce.apply(this,arguments)}function Me(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function er(e,t=[]){let n=[];function r(i,s){const a=m.createContext(s),l=n.length;n=[...n,s];function c(f){const{scope:p,children:h,...b}=f,v=(p==null?void 0:p[e][l])||a,w=m.useMemo(()=>b,Object.values(b));return m.createElement(v.Provider,{value:w},h)}function u(f,p){const h=(p==null?void 0:p[e][l])||a,b=m.useContext(h);if(b)return b;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const o=()=>{const i=n.map(s=>m.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,GV(o,...t)]}function GV(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const f=l(i)[`__scope${c}`];return{...a,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function YV(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function us(...e){return t=>e.forEach(n=>YV(n,t))}function _t(...e){return m.useCallback(us(...e),e)}const gx=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(XV);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(mx,ce({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(mx,ce({},r,{ref:t}),n)});gx.displayName="Slot";const mx=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...QV(r,n.props),ref:t?us(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});mx.displayName="SlotClone";const KV=({children:e})=>m.createElement(m.Fragment,null,e);function XV(e){return m.isValidElement(e)&&e.type===KV}function QV(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 Tm(e){const t=e+"CollectionProvider",[n,r]=er(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=h=>{const{scope:b,children:v}=h,w=m.useRef(null),y=m.useRef(new Map).current;return m.createElement(o,{scope:b,itemMap:y,collectionRef:w},v)},a=e+"CollectionSlot",l=m.forwardRef((h,b)=>{const{scope:v,children:w}=h,y=i(a,v),_=_t(b,y.collectionRef);return m.createElement(gx,{ref:_},w)}),c=e+"CollectionItemSlot",u="data-radix-collection-item",f=m.forwardRef((h,b)=>{const{scope:v,children:w,...y}=h,_=m.useRef(null),S=_t(b,_),C=i(c,v);return m.useEffect(()=>(C.itemMap.set(_,{ref:_,...y}),()=>void C.itemMap.delete(_))),m.createElement(gx,{[u]:"",ref:S},w)});function p(h){const b=i(e+"CollectionConsumer",h);return m.useCallback(()=>{const w=b.collectionRef.current;if(!w)return[];const y=Array.from(w.querySelectorAll(`[${u}]`));return Array.from(b.itemMap.values()).sort((C,E)=>y.indexOf(C.ref.current)-y.indexOf(E.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:s,Slot:l,ItemSlot:f},p,r]}const ur=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},JV=L.useId||(()=>{});let ZV=0;function Zo(e){const[t,n]=L.useState(JV());return ur(()=>{e||n(r=>r??String(ZV++))},[e]),e||(t?`radix-${t}`:"")}const DD=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(tH);if(i){const s=i.props.children,a=o.map(l=>l===i?m.Children.count(s)>1?m.Children.only(null):m.isValidElement(s)?s.props.children:null:l);return m.createElement(vx,ce({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(vx,ce({},r,{ref:t}),n)});DD.displayName="Slot";const vx=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...nH(r,n.props),ref:t?us(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});vx.displayName="SlotClone";const eH=({children:e})=>m.createElement(m.Fragment,null,e);function tH(e){return m.isValidElement(e)&&e.type===eH}function nH(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const rH=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Qe=rH.reduce((e,t)=>{const n=m.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?DD:t;return m.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),m.createElement(a,ce({},s,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function AD(e,t){e&&Sr.flushSync(()=>e.dispatchEvent(t))}function jn(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 wr({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=oH({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=jn(n),l=m.useCallback(c=>{if(i){const f=typeof c=="function"?c(e):c;f!==e&&a(f)}else o(c)},[i,e,o,a]);return[s,l]}function oH({defaultProp:e,onChange:t}){const n=m.useState(e),[r]=n,o=m.useRef(r),i=jn(t);return m.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const iH=m.createContext(void 0);function Pl(e){const t=m.useContext(iH);return e||t||"ltr"}const r0="rovingFocusGroup.onEntryFocus",sH={bubbles:!1,cancelable:!0},hw="RovingFocusGroup",[bx,kD,aH]=Tm(hw),[lH,mu]=er(hw,[aH]),[cH,uH]=lH(hw),dH=m.forwardRef((e,t)=>m.createElement(bx.Provider,{scope:e.__scopeRovingFocusGroup},m.createElement(bx.Slot,{scope:e.__scopeRovingFocusGroup},m.createElement(fH,ce({},e,{ref:t}))))),fH=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,...u}=e,f=m.useRef(null),p=_t(t,f),h=Pl(i),[b=null,v]=wr({prop:s,defaultProp:a,onChange:l}),[w,y]=m.useState(!1),_=jn(c),S=kD(n),C=m.useRef(!1),[E,O]=m.useState(0);return m.useEffect(()=>{const T=f.current;if(T)return T.addEventListener(r0,_),()=>T.removeEventListener(r0,_)},[_]),m.createElement(cH,{scope:n,orientation:r,dir:h,loop:o,currentTabStopId:b,onItemFocus:m.useCallback(T=>v(T),[v]),onItemShiftTab:m.useCallback(()=>y(!0),[]),onFocusableItemAdd:m.useCallback(()=>O(T=>T+1),[]),onFocusableItemRemove:m.useCallback(()=>O(T=>T-1),[])},m.createElement(Qe.div,ce({tabIndex:w||E===0?-1:0,"data-orientation":r},u,{ref:p,style:{outline:"none",...e.style},onMouseDown:Me(e.onMouseDown,()=>{C.current=!0}),onFocus:Me(e.onFocus,T=>{const I=!C.current;if(T.target===T.currentTarget&&I&&!w){const N=new CustomEvent(r0,sH);if(T.currentTarget.dispatchEvent(N),!N.defaultPrevented){const k=S().filter(H=>H.focusable),F=k.find(H=>H.active),z=k.find(H=>H.id===b),te=[F,z,...k].filter(Boolean).map(H=>H.ref.current);MD(te)}}C.current=!1}),onBlur:Me(e.onBlur,()=>y(!1))})))}),hH="RovingFocusGroupItem",pH=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=Zo(),l=i||a,c=uH(hH,n),u=c.currentTabStopId===l,f=kD(n),{onFocusableItemAdd:p,onFocusableItemRemove:h}=c;return m.useEffect(()=>{if(r)return p(),()=>h()},[r,p,h]),m.createElement(bx.ItemSlot,{scope:n,id:l,focusable:r,active:o},m.createElement(Qe.span,ce({tabIndex:u?0:-1,"data-orientation":c.orientation},s,{ref:t,onMouseDown:Me(e.onMouseDown,b=>{r?c.onItemFocus(l):b.preventDefault()}),onFocus:Me(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:Me(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){c.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const v=vH(b,c.orientation,c.dir);if(v!==void 0){b.preventDefault();let y=f().filter(_=>_.focusable).map(_=>_.ref.current);if(v==="last")y.reverse();else if(v==="prev"||v==="next"){v==="prev"&&y.reverse();const _=y.indexOf(b.currentTarget);y=c.loop?bH(y,_+1):y.slice(_+1)}setTimeout(()=>MD(y))}})})))}),gH={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function mH(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function vH(e,t,n){const r=mH(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return gH[r]}function MD(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function bH(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const pw=dH,gw=pH;function yH(e,t){return m.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const tr=e=>{const{present:t,children:n}=e,r=xH(t),o=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),i=_t(r.ref,o.ref);return typeof n=="function"||r.isPresent?m.cloneElement(o,{ref:i}):null};tr.displayName="Presence";function xH(e){const[t,n]=m.useState(),r=m.useRef({}),o=m.useRef(e),i=m.useRef("none"),s=e?"mounted":"unmounted",[a,l]=yH(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const c=cp(r.current);i.current=a==="mounted"?c:"none"},[a]),ur(()=>{const c=r.current,u=o.current;if(u!==e){const p=i.current,h=cp(c);e?l("MOUNT"):h==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&p!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),ur(()=>{if(t){const c=f=>{const h=cp(r.current).includes(f.animationName);f.target===t&&h&&Sr.flushSync(()=>l("ANIMATION_END"))},u=f=>{f.target===t&&(i.current=cp(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:m.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function cp(e){return(e==null?void 0:e.animationName)||"none"}const ID="Tabs",[wH,s1e]=er(ID,[mu]),ND=mu(),[_H,mw]=wH(ID),SH=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=Pl(a),[f,p]=wr({prop:r,onChange:o,defaultProp:i});return m.createElement(_H,{scope:n,baseId:Zo(),value:f,onValueChange:p,orientation:s,dir:u,activationMode:l},m.createElement(Qe.div,ce({dir:u,"data-orientation":s},c,{ref:t})))}),CH="TabsList",EH=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=mw(CH,n),s=ND(n);return m.createElement(pw,ce({asChild:!0},s,{orientation:i.orientation,dir:i.dir,loop:r}),m.createElement(Qe.div,ce({role:"tablist","aria-orientation":i.orientation},o,{ref:t})))}),RH="TabsTrigger",PH=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=mw(RH,n),a=ND(n),l=LD(s.baseId,r),c=FD(s.baseId,r),u=r===s.value;return m.createElement(gw,ce({asChild:!0},a,{focusable:!o,active:u}),m.createElement(Qe.button,ce({type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l},i,{ref:t,onMouseDown:Me(e.onMouseDown,f=>{!o&&f.button===0&&f.ctrlKey===!1?s.onValueChange(r):f.preventDefault()}),onKeyDown:Me(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&s.onValueChange(r)}),onFocus:Me(e.onFocus,()=>{const f=s.activationMode!=="manual";!u&&!o&&f&&s.onValueChange(r)})})))}),OH="TabsContent",$H=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=mw(OH,n),l=LD(a.baseId,r),c=FD(a.baseId,r),u=r===a.value,f=m.useRef(u);return m.useEffect(()=>{const p=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(p)},[]),m.createElement(tr,{present:o||u},({present:p})=>m.createElement(Qe.div,ce({"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!p,id:c,tabIndex:0},s,{ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0}}),p&&i))});function LD(e,t){return`${e}-trigger-${t}`}function FD(e,t){return`${e}-content-${t}`}const TH=SH,jD=EH,zD=PH,BD=$H,vw=TH,Dm=L.forwardRef(({className:e,...t},n)=>P.jsx(jD,{ref:n,className:_e("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Dm.displayName=jD.displayName;const Am=L.forwardRef(({className:e,...t},n)=>P.jsx(zD,{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}));Am.displayName=zD.displayName;const bw=L.forwardRef(({className:e,...t},n)=>P.jsx(BD,{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}));bw.displayName=BD.displayName;var VD={exports:{}},Uf={},yx={exports:{}};(function(e,t){(function(n,r){r(t)})(Ws,function(n){function r(ie){return function(le,ye,X,be,Se,Oe,$e){return ie(le,ye,$e)}}function o(ie){return function(le,ye,X,be){if(!le||!ye||typeof le!="object"||typeof ye!="object")return ie(le,ye,X,be);var Se=be.get(le),Oe=be.get(ye);if(Se&&Oe)return Se===ye&&Oe===le;be.set(le,ye),be.set(ye,le);var $e=ie(le,ye,X,be);return be.delete(le),be.delete(ye),$e}}function i(ie,re){var le={};for(var ye in ie)le[ye]=ie[ye];for(var ye in re)le[ye]=re[ye];return le}function s(ie){return ie.constructor===Object||ie.constructor==null}function a(ie){return typeof ie.then=="function"}function l(ie,re){return ie===re||ie!==ie&&re!==re}var c="[object Arguments]",u="[object Boolean]",f="[object Date]",p="[object RegExp]",h="[object Map]",b="[object Number]",v="[object Object]",w="[object Set]",y="[object String]",_=Object.prototype.toString;function S(ie){var re=ie.areArraysEqual,le=ie.areDatesEqual,ye=ie.areMapsEqual,X=ie.areObjectsEqual,be=ie.areRegExpsEqual,Se=ie.areSetsEqual,Oe=ie.createIsNestedEqual,$e=Oe(Ue);function Ue(Be,Ie,Ke){if(Be===Ie)return!0;if(!Be||!Ie||typeof Be!="object"||typeof Ie!="object")return Be!==Be&&Ie!==Ie;if(s(Be)&&s(Ie))return X(Be,Ie,$e,Ke);var lt=Array.isArray(Be),It=Array.isArray(Ie);if(lt||It)return lt===It&&re(Be,Ie,$e,Ke);var Dt=_.call(Be);return Dt!==_.call(Ie)?!1:Dt===f?le(Be,Ie,$e,Ke):Dt===p?be(Be,Ie,$e,Ke):Dt===h?ye(Be,Ie,$e,Ke):Dt===w?Se(Be,Ie,$e,Ke):Dt===v||Dt===c?a(Be)||a(Ie)?!1:X(Be,Ie,$e,Ke):Dt===u||Dt===b||Dt===y?l(Be.valueOf(),Ie.valueOf()):!1}return Ue}function C(ie,re,le,ye){var X=ie.length;if(re.length!==X)return!1;for(;X-- >0;)if(!le(ie[X],re[X],X,X,ie,re,ye))return!1;return!0}var E=o(C);function O(ie,re){return l(ie.valueOf(),re.valueOf())}function T(ie,re,le,ye){var X=ie.size===re.size;if(!X)return!1;if(!ie.size)return!0;var be={},Se=0;return ie.forEach(function(Oe,$e){if(X){var Ue=!1,Be=0;re.forEach(function(Ie,Ke){!Ue&&!be[Be]&&(Ue=le($e,Ke,Se,Be,ie,re,ye)&&le(Oe,Ie,$e,Ke,ie,re,ye))&&(be[Be]=!0),Be++}),Se++,X=Ue}}),X}var I=o(T),N="_owner",k=Object.prototype.hasOwnProperty;function F(ie,re,le,ye){var X=Object.keys(ie),be=X.length;if(Object.keys(re).length!==be)return!1;for(var Se;be-- >0;){if(Se=X[be],Se===N){var Oe=!!ie.$$typeof,$e=!!re.$$typeof;if((Oe||$e)&&Oe!==$e)return!1}if(!k.call(re,Se)||!le(ie[Se],re[Se],Se,Se,ie,re,ye))return!1}return!0}var z=o(F);function Q(ie,re){return ie.source===re.source&&ie.flags===re.flags}function te(ie,re,le,ye){var X=ie.size===re.size;if(!X)return!1;if(!ie.size)return!0;var be={};return ie.forEach(function(Se,Oe){if(X){var $e=!1,Ue=0;re.forEach(function(Be,Ie){!$e&&!be[Ue]&&($e=le(Se,Be,Oe,Ie,ie,re,ye))&&(be[Ue]=!0),Ue++}),X=$e}}),X}var H=o(te),J=Object.freeze({areArraysEqual:C,areDatesEqual:O,areMapsEqual:T,areObjectsEqual:F,areRegExpsEqual:Q,areSetsEqual:te,createIsNestedEqual:r}),K=Object.freeze({areArraysEqual:E,areDatesEqual:O,areMapsEqual:I,areObjectsEqual:z,areRegExpsEqual:Q,areSetsEqual:H,createIsNestedEqual:r}),Y=S(J);function W(ie,re){return Y(ie,re,void 0)}var $=S(i(J,{createIsNestedEqual:function(){return l}}));function V(ie,re){return $(ie,re,void 0)}var U=S(K);function D(ie,re){return U(ie,re,new WeakMap)}var ee=S(i(K,{createIsNestedEqual:function(){return l}}));function de(ie,re){return ee(ie,re,new WeakMap)}function ue(ie){return S(i(J,ie(J)))}function he(ie){var re=S(i(K,ie(K)));return function(le,ye,X){return X===void 0&&(X=new WeakMap),re(le,ye,X)}}n.circularDeepEqual=D,n.circularShallowEqual=de,n.createCustomCircularEqual=he,n.createCustomEqual=ue,n.deepEqual=W,n.sameValueZeroEqual=l,n.shallowEqual=V,Object.defineProperty(n,"__esModule",{value:!0})})})(yx,yx.exports);var yw=yx.exports;const xw=Z1(qz);var Pt={},DH=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(Pt,"__esModule",{value:!0});Pt.bottom=ww;Pt.childrenEqual=IH;Pt.cloneLayout=HD;Pt.cloneLayoutItem=ll;Pt.collides=km;Pt.compact=UD;Pt.compactItem=qD;Pt.compactType=KH;Pt.correctBounds=GD;Pt.fastPositionEqual=LH;Pt.fastRGLPropsEqual=void 0;Pt.getAllCollisions=YD;Pt.getFirstCollision=Ka;Pt.getLayoutItem=_w;Pt.getStatics=Sw;Pt.modifyLayout=WD;Pt.moveElement=md;Pt.moveElementAwayFromCollision=wx;Pt.noop=void 0;Pt.perc=jH;Pt.resizeItemInDirection=UH;Pt.setTopLeft=GH;Pt.setTransform=qH;Pt.sortLayoutItems=$w;Pt.sortLayoutItemsByColRow=ZD;Pt.sortLayoutItemsByRowCol=JD;Pt.synchronizeLayoutWithChildren=YH;Pt.validateLayout=eA;Pt.withLayoutItem=MH;var oP=yw,gd=AH(m);function AH(e){return e&&e.__esModule?e:{default:e}}const kH=process.env.NODE_ENV==="production";function ww(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 HD(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=ll(e[n]);return t}function WD(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 MH(e,t,n){let r=_w(e,t);return r?(r=n(ll(r)),e=WD(e,r),[e,r]):[e,null]}function ll(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 IH(e,t){return(0,oP.deepEqual)(gd.default.Children.map(e,n=>n==null?void 0:n.key),gd.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,oP.deepEqual)(gd.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),gd.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}const NH=DH;Pt.fastRGLPropsEqual=NH;function LH(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function km(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 UD(e,t,n,r){const o=Sw(e),i=$w(e,t),s=Array(e.length);for(let a=0,l=i.length;a<l;a++){let c=ll(i[a]);c.static||(c=qD(o,c,t,n,i,r),o.push(c)),s[e.indexOf(i[a])]=c,c.moved=!1}return s}const FH={x:"w",y:"h"};function xx(e,t,n,r){const o=FH[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;km(t,a)&&xx(e,a,n+t[o],r)}}t[r]=n}function qD(e,t,n,r,o,i){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(ww(e),t.y);t.y>0&&!Ka(e,t);)t.y--;else if(a)for(;t.x>0&&!Ka(e,t);)t.x--;let l;for(;(l=Ka(e,t))&&!(n===null&&i);)if(a?xx(o,t,l.x+l.w,"x"):xx(o,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!Ka(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function GD(e,t){const n=Sw(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(;Ka(n,i);)i.y++}return e}function _w(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function Ka(e,t){for(let n=0,r=e.length;n<r;n++)if(km(e[n],t))return e[n]}function YD(e,t){return e.filter(n=>km(n,t))}function Sw(e){return e.filter(t=>t.static)}function md(e,t,n,r,o,i,s,a,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;"Moving element ".concat(t.i," to [").concat(String(n),",").concat(String(r),"] from [").concat(t.x,",").concat(t.y,"]");const c=t.x,u=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let f=$w(e,s);(s==="vertical"&&typeof r=="number"?u>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(f=f.reverse());const h=YD(f,t),b=h.length>0;if(b&&l)return HD(e);if(b&&i)return"Collision prevented on ".concat(t.i,", reverting."),t.x=c,t.y=u,t.moved=!1,e;for(let v=0,w=h.length;v<w;v++){const y=h[v];"Resolving collision between ".concat(t.i," at [").concat(t.x,",").concat(t.y,"] and ").concat(y.i," at [").concat(y.x,",").concat(y.y,"]"),!y.moved&&(y.static?e=wx(e,y,t,o,s):e=wx(e,t,y,o,s))}return e}function wx(e,t,n,r,o,i){const s=o==="horizontal",a=o==="vertical",l=t.static;if(r){r=!1;const f={x:s?Math.max(t.x-n.w,0):n.x,y:a?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},p=Ka(e,f),h=p&&p.y+p.h>t.y,b=p&&t.x+t.w>p.x;if(p){if(h&&a)return md(e,n,void 0,t.y+1,r,l,o);if(h&&o==null)return t.y=n.y,n.y=n.y+n.h,e;if(b&&s)return md(e,t,n.x,void 0,r,l,o)}else return"Doing reverse collision on ".concat(n.i," up to [").concat(f.x,",").concat(f.y,"]."),md(e,n,s?f.x:void 0,a?f.y:void 0,r,l,o)}const c=s?n.x+1:void 0,u=a?n.y+1:void 0;return c==null&&u==null?e:md(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,o)}function jH(e){return e*100+"%"}const KD=(e,t,n,r)=>e+n>r?t:n,XD=(e,t,n)=>e<0?t:n,QD=e=>Math.max(0,e),Cw=e=>Math.max(0,e),Ew=(e,t,n)=>{let{left:r,height:o,width:i}=t;const s=e.top-(o-e.height);return{left:r,width:i,height:XD(s,e.height,o),top:Cw(s)}},Rw=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{top:r,height:i,width:KD(e.left,e.width,s,n),left:QD(o)}},Pw=(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:KD(e.left,e.width,i,n),top:Cw(r),left:QD(s)}},Ow=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{width:s,left:o,height:XD(r,e.height,i),top:Cw(r)}},zH=function(){return Ew(arguments.length<=0?void 0:arguments[0],Rw(...arguments))},BH=function(){return Ew(arguments.length<=0?void 0:arguments[0],Pw(...arguments))},VH=function(){return Ow(arguments.length<=0?void 0:arguments[0],Rw(...arguments))},HH=function(){return Ow(arguments.length<=0?void 0:arguments[0],Pw(...arguments))},WH={n:Ew,ne:zH,e:Rw,se:VH,s:Ow,sw:HH,w:Pw,nw:BH};function UH(e,t,n,r){const o=WH[e];return o?o(t,{...t,...n},r):n}function qH(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 GH(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 $w(e,t){return t==="horizontal"?ZD(e):t==="vertical"?JD(e):e}function JD(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 ZD(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 YH(e,t,n,r,o){e=e||[];const i=[];gd.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=_w(e,String(a.key)),c=a.props["data-grid"];l&&c==null?i.push(ll(l)):c?(kH||eA([c],"ReactGridLayout.children"),i.push(ll({...c,i:a.key}))):i.push(ll({w:1,h:1,x:0,y:ww(i),i:String(a.key)}))});const s=GD(i,{cols:n});return o?s:UD(s,r,n)}function eA(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 KH(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const XH=()=>{};Pt.noop=XH;var Oi={};Object.defineProperty(Oi,"__esModule",{value:!0});Oi.calcGridColWidth=Mm;Oi.calcGridItemPosition=QH;Oi.calcGridItemWHPx=_x;Oi.calcWH=ZH;Oi.calcXY=JH;Oi.clamp=Xa;function Mm(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function _x(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function QH(e,t,n,r,o,i){const{margin:s,containerPadding:a,rowHeight:l}=e,c=Mm(e),u={};return i&&i.resizing?(u.width=Math.round(i.resizing.width),u.height=Math.round(i.resizing.height)):(u.width=_x(r,c,s[0]),u.height=_x(o,l,s[1])),i&&i.dragging?(u.top=Math.round(i.dragging.top),u.left=Math.round(i.dragging.left)):i&&i.resizing&&typeof i.resizing.top=="number"&&typeof i.resizing.left=="number"?(u.top=Math.round(i.resizing.top),u.left=Math.round(i.resizing.left)):(u.top=Math.round((l+s[1])*n+a[1]),u.left=Math.round((c+s[0])*t+a[0])),u}function JH(e,t,n,r,o){const{margin:i,cols:s,rowHeight:a,maxRows:l}=e,c=Mm(e);let u=Math.round((n-i[0])/(c+i[0])),f=Math.round((t-i[1])/(a+i[1]));return u=Xa(u,0,s-r),f=Xa(f,0,l-o),{x:u,y:f}}function ZH(e,t,n,r,o,i){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,u=Mm(e);let f=Math.round((t+s[0])/(u+s[0])),p=Math.round((n+s[1])/(c+s[1])),h=Xa(f,0,l-r),b=Xa(p,0,a-o);return["sw","w","nw"].indexOf(i)!==-1&&(h=Xa(f,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(b=Xa(p,0,a)),{w:h,h:b}}function Xa(e,t,n){return Math.max(Math.min(e,n),t)}var Im={},Sx={exports:{}},o0,iP;function Tw(){if(iP)return o0;iP=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return o0=e,o0}var i0,sP;function eW(){if(sP)return i0;sP=1;var e=Tw();function t(){}function n(){}return n.resetWarningCache=t,i0=function(){function r(s,a,l,c,u,f){if(f!==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},i0}var up={exports:{}},qt={};/** @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-o98c3gXS.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-o98c3gXS.js"),n=require("./chunks/dashboard-plus-SLRbyBnR.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:i,isFetching:a,cfg:x,visualKey:C,handleDatapointClick:f}=e.useDashboardCard(t),l=e.useDashboardStore(s=>s.themeStyle),d=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(d,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:i||a,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(d,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":i||a})})}),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&&(i||a)&&e.jsxRuntimeExports.jsx(n.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(d,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},l==null?void 0:l.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=n.SelectComponent;exports.Surfboard=n.DashboardPlus;exports.useEditorAside=n.useEditorAside;exports.DashboardCard=N;
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { u as _, a as k, b as r, c as w, j as t, C as F, E as f, d as P, T as L, e as R, f as h, g as B, h as q, i as K, k as Y, l as G, K as O, S as V, m as z, n as H, o as J } from "./chunks/index-
|
|
2
|
-
import { B as se, s as ae, D as oe, q as re, N as ne, I as ie, r as le, L as de, w as ue, t as ce, M as fe, y as he, J as Ce, x as me, A as xe, v as pe, z as ge, F as je, p as De, H as be, G as Se } from "./chunks/index-
|
|
3
|
-
import { L as M } from "./chunks/dashboard-plus-
|
|
4
|
-
import { S as Ee, D as Ie, u as Ae } from "./chunks/dashboard-plus-
|
|
1
|
+
import { u as _, a as k, b as r, c as w, j as t, C as F, E as f, d as P, T as L, e as R, f as h, g as B, h as q, i as K, k as Y, l as G, K as O, S as V, m as z, n as H, o as J } from "./chunks/index-DUw3t3sl.js";
|
|
2
|
+
import { B as se, s as ae, D as oe, q as re, N as ne, I as ie, r as le, L as de, w as ue, t as ce, M as fe, y as he, J as Ce, x as me, A as xe, v as pe, z as ge, F as je, p as De, H as be, G as Se } from "./chunks/index-DUw3t3sl.js";
|
|
3
|
+
import { L as M } from "./chunks/dashboard-plus-B20VN3pn.js";
|
|
4
|
+
import { S as Ee, D as Ie, u as Ae } from "./chunks/dashboard-plus-B20VN3pn.js";
|
|
5
5
|
import Q from "react";
|
|
6
6
|
import "react-dom";
|
|
7
7
|
function Z({
|
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-SLRbyBnR.js");require("../chunks/index-o98c3gXS.js");require("react");require("react-dom");exports.Surfboard=r.DashboardPlus;
|
package/dist/surfboard/index.js
CHANGED