react-semaphor 0.0.556 → 0.0.557
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-CMRkKcEa.js → dashboard-plus-CCV5mAgn.js} +1 -1
- package/dist/chunks/{dashboard-plus-CugPXbBA.js → dashboard-plus-CZggRVns.js} +1 -1
- package/dist/chunks/{index-HP6jGs2r.js → index-CL8DpfKu.js} +1 -1
- package/dist/chunks/{index-JjE2lTjE.js → index-IrFoACqT.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 +2 -2
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var rt=t=>{throw TypeError(t)};var ps=(t,a,n)=>a.has(t)||rt("Cannot "+n);var re=(t,a,n)=>(ps(t,a,"read from private field"),n?n.call(t):a.get(t)),Fe=(t,a,n)=>a.has(t)?rt("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(t):a.set(t,n),Be=(t,a,n,r)=>(ps(t,a,"write to private field"),r?r.call(t,n):a.set(t,n),n),ze=(t,a,n)=>(ps(t,a,"access private method"),n);const e=require("react/jsx-runtime"),s=require("./index-
|
|
1
|
+
"use strict";var rt=t=>{throw TypeError(t)};var ps=(t,a,n)=>a.has(t)||rt("Cannot "+n);var re=(t,a,n)=>(ps(t,a,"read from private field"),n?n.call(t):a.get(t)),Fe=(t,a,n)=>a.has(t)?rt("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(t):a.set(t,n),Be=(t,a,n,r)=>(ps(t,a,"write to private field"),r?r.call(t,n):a.set(t,n),n),ze=(t,a,n)=>(ps(t,a,"access private method"),n);const e=require("react/jsx-runtime"),s=require("./index-IrFoACqT.js"),M=require("react");require("react-dom");function On(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(a,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return a.default=t,Object.freeze(a)}const ue=On(M);var Ne,Ce,de,je,ye,es,Ss,St,Rn=(St=class extends s.Subscribable{constructor(a,n){super();Fe(this,ye);Fe(this,Ne);Fe(this,Ce);Fe(this,de);Fe(this,je);Be(this,Ne,a),this.setOptions(n),this.bindMethods(),ze(this,ye,es).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(a){var r;const n=this.options;this.options=re(this,Ne).defaultMutationOptions(a),s.shallowEqualObjects(this.options,n)||re(this,Ne).getMutationCache().notify({type:"observerOptionsUpdated",mutation:re(this,de),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&s.hashKey(n.mutationKey)!==s.hashKey(this.options.mutationKey)?this.reset():((r=re(this,de))==null?void 0:r.state.status)==="pending"&&re(this,de).setOptions(this.options)}onUnsubscribe(){var a;this.hasListeners()||(a=re(this,de))==null||a.removeObserver(this)}onMutationUpdate(a){ze(this,ye,es).call(this),ze(this,ye,Ss).call(this,a)}getCurrentResult(){return re(this,Ce)}reset(){var a;(a=re(this,de))==null||a.removeObserver(this),Be(this,de,void 0),ze(this,ye,es).call(this),ze(this,ye,Ss).call(this)}mutate(a,n){var r;return Be(this,je,n),(r=re(this,de))==null||r.removeObserver(this),Be(this,de,re(this,Ne).getMutationCache().build(re(this,Ne),this.options)),re(this,de).addObserver(this),re(this,de).execute(a)}},Ne=new WeakMap,Ce=new WeakMap,de=new WeakMap,je=new WeakMap,ye=new WeakSet,es=function(){var n;const a=((n=re(this,de))==null?void 0:n.state)??s.getDefaultState();Be(this,Ce,{...a,isPending:a.status==="pending",isSuccess:a.status==="success",isError:a.status==="error",isIdle:a.status==="idle",mutate:this.mutate,reset:this.reset})},Ss=function(a){s.notifyManager.batch(()=>{var n,r,o,i,c,l,d,u;if(re(this,je)&&this.hasListeners()){const m=re(this,Ce).variables,h=re(this,Ce).context;(a==null?void 0:a.type)==="success"?((r=(n=re(this,je)).onSuccess)==null||r.call(n,a.data,m,h),(i=(o=re(this,je)).onSettled)==null||i.call(o,a.data,null,m,h)):(a==null?void 0:a.type)==="error"&&((l=(c=re(this,je)).onError)==null||l.call(c,a.error,m,h),(u=(d=re(this,je)).onSettled)==null||u.call(d,void 0,a.error,m,h))}this.listeners.forEach(m=>{m(re(this,Ce))})})},St);function Ae(t,a){const n=s.useQueryClient(),[r]=ue.useState(()=>new Rn(n,t));ue.useEffect(()=>{r.setOptions(t)},[r,t]);const o=ue.useSyncExternalStore(ue.useCallback(c=>r.subscribe(s.notifyManager.batchCalls(c)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=ue.useCallback((c,l)=>{r.mutate(c,l).catch(s.noop)},[r]);if(o.error&&s.shouldThrowError(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:i,mutateAsync:o.mutate}}/**
|
|
2
2
|
* @license lucide-react v0.453.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -4,7 +4,7 @@ var ar = (t) => {
|
|
|
4
4
|
var Fa = (t, a, n) => a.has(t) || ar("Cannot " + n);
|
|
5
5
|
var we = (t, a, n) => (Fa(t, a, "read from private field"), n ? n.call(t) : a.get(t)), an = (t, a, n) => a.has(t) ? ar("Cannot add the same private member more than once") : a instanceof WeakSet ? a.add(t) : a.set(t, n), sn = (t, a, n, r) => (Fa(t, a, "write to private field"), r ? r.call(t, n) : a.set(t, n), n), rn = (t, a, n) => (Fa(t, a, "access private method"), n);
|
|
6
6
|
import { jsxs as s, jsx as e, Fragment as ae } from "react/jsx-runtime";
|
|
7
|
-
import { E as Ti, F as Oi, G as sr, H as Ei, I as zr, J as Ge, K as Ii, L as Ai, M as H, N as is, w as K, A as xt, O as Oe, P as Fn, Q as Fr, R as j, T as Le, U as Ln, V as _n, W as Pn, X as Vn, Y as Q, Z as je, _ as Na, $ as jn, a0 as Un, a1 as ce, a2 as Bn, a3 as Lr, a4 as ln, a5 as Ri, a6 as rr, a7 as _r, a8 as G, a9 as os, aa as Me, ab as zi, ac as ge, ad as ye, ae as ve, af as xe, ag as Vt, ah as jt, ai as ne, aj as Pr, ak as st, al as rt, am as Fi, an as Jt, ao as kt, ap as Lt, aq as Ue, ar as qe, as as Ye, at as ft, au as cs, av as $n, aw as qn, ax as Vr, ay as bt, az as on, aA as mn, aB as lt, aC as Ne, aD as We, aE as ds, aF as Li, aG as da, aH as jr, aI as mt, aJ as Ur, aK as cn, aL as us, aM as Br, aN as Re, aO as oe, aP as Ce, aQ as hn, aR as it, aS as pn, aT as _i, aU as _t, aV as nt, aW as Yn, aX as Ca, aY as wn, aZ as ms, a_ as Sn, a$ as ot, b0 as Kt, b1 as Gn, b2 as Hn, b3 as $r, b4 as Wt, b5 as hs, b6 as ps, b7 as fs, b8 as gs, b9 as fn, ba as Jn, bb as qr, bc as ys, bd as wa, be as vs, bf as Pi, bg as xs, bh as Vi, bi as ji, bj as Qt, bk as Zt, bl as Fe, bm as Et, bn as Yr, C as se, bo as Gt, B as M, bp as Gr, bq as Hr, br as Jr, bs as Kr, bt as Wr, bu as Qr, bv as Zr, bw as Xr, bx as Ui, by as Bi, bz as ua, bA as bs, bB as $i, bC as qi, bD as Yi, bE as el, bF as Ns, bG as gn, bH as Kn, bI as Wn, bJ as Qn, bK as Zn, bL as Ut, bM as yn, bN as kn, v as ct, bO as tl, m as nl, l as al, f as et, bP as Gi, g as ht, bQ as Hi, h as Ht, j as pt, k as Ji, bR as Ki, bS as Wi, bT as At, bU as It, bV as sl, bW as Qi, e as rl, bX as Dn, bY as Dt, bZ as Zi, b_ as Ga, b$ as Cs, c0 as Xn, c1 as yt, c2 as ll, r as ma, q as lr, c3 as ze, c4 as la, c5 as il, c6 as Xi, c7 as eo, c8 as to, c9 as ol, ca as no, cb as Sa, cc as ao, cd as ha, ce as so, cf as Ha, cg as Mt, ch as Ve, ci as Tt, cj as ro, ck as lo, cl as io, cm as oo, cn as co, co as La, cp as uo, cq as ir, cr as mo, cs as or, ct as ho, cu as po, cv as fo, cw as go, cx as ws, cy as yo, cz as cl, cA as Ss, cB as dl, cC as ia, cD as ul, cE as vo, cF as xo, cG as bo, cH as ml, cI as No, cJ as ea, cK as ks, cL as hl, cM as Co, cN as wo, cO as So, cP as pl, cQ as Ds, cR as fl, cS as ko, cT as cr, cU as ka, cV as Da, cW as Ma, cX as Do, cY as Mo, cZ as To, c_ as Nt, c$ as Se, d0 as ke, d1 as De, d2 as Oo, d3 as Eo, d4 as Io, d5 as Ao, s as Ro, d6 as dr, d7 as gl, d8 as zo, d9 as Fo, da as Lo, db as yl, dc as Ms, dd as vn, de as Ts, df as Rt, dg as _o, dh as ta, di as vl, dj as Po, dk as Vo, dl as jo, dm as Uo, dn as Bo, dp as ur, dq as $o, dr as qo, ds as Yo, dt as Go, du as Ho, dv as Jo, dw as Ko, dx as xl, dy as Wo, dz as Qo, dA as Zo, dB as Xo, dC as ec, dD as bl, dE as _a, dF as mr, dG as tc, dH as nc, dI as Ja, dJ as tt, dK as Ta, dL as ac, dM as sc, dN as hr, dO as Nl, dP as Os, dQ as rc, dR as lc, dS as Mn, dT as Ka, dU as ic, dV as oc, dW as pr, dX as Wa, dY as Qa, dZ as pa, d_ as dn, d$ as Tn, e0 as cc, e1 as dc, e2 as Cl, e3 as uc, e4 as mc, S as hc, e5 as pc, e6 as fc, e7 as gc } from "./index-
|
|
7
|
+
import { E as Ti, F as Oi, G as sr, H as Ei, I as zr, J as Ge, K as Ii, L as Ai, M as H, N as is, w as K, A as xt, O as Oe, P as Fn, Q as Fr, R as j, T as Le, U as Ln, V as _n, W as Pn, X as Vn, Y as Q, Z as je, _ as Na, $ as jn, a0 as Un, a1 as ce, a2 as Bn, a3 as Lr, a4 as ln, a5 as Ri, a6 as rr, a7 as _r, a8 as G, a9 as os, aa as Me, ab as zi, ac as ge, ad as ye, ae as ve, af as xe, ag as Vt, ah as jt, ai as ne, aj as Pr, ak as st, al as rt, am as Fi, an as Jt, ao as kt, ap as Lt, aq as Ue, ar as qe, as as Ye, at as ft, au as cs, av as $n, aw as qn, ax as Vr, ay as bt, az as on, aA as mn, aB as lt, aC as Ne, aD as We, aE as ds, aF as Li, aG as da, aH as jr, aI as mt, aJ as Ur, aK as cn, aL as us, aM as Br, aN as Re, aO as oe, aP as Ce, aQ as hn, aR as it, aS as pn, aT as _i, aU as _t, aV as nt, aW as Yn, aX as Ca, aY as wn, aZ as ms, a_ as Sn, a$ as ot, b0 as Kt, b1 as Gn, b2 as Hn, b3 as $r, b4 as Wt, b5 as hs, b6 as ps, b7 as fs, b8 as gs, b9 as fn, ba as Jn, bb as qr, bc as ys, bd as wa, be as vs, bf as Pi, bg as xs, bh as Vi, bi as ji, bj as Qt, bk as Zt, bl as Fe, bm as Et, bn as Yr, C as se, bo as Gt, B as M, bp as Gr, bq as Hr, br as Jr, bs as Kr, bt as Wr, bu as Qr, bv as Zr, bw as Xr, bx as Ui, by as Bi, bz as ua, bA as bs, bB as $i, bC as qi, bD as Yi, bE as el, bF as Ns, bG as gn, bH as Kn, bI as Wn, bJ as Qn, bK as Zn, bL as Ut, bM as yn, bN as kn, v as ct, bO as tl, m as nl, l as al, f as et, bP as Gi, g as ht, bQ as Hi, h as Ht, j as pt, k as Ji, bR as Ki, bS as Wi, bT as At, bU as It, bV as sl, bW as Qi, e as rl, bX as Dn, bY as Dt, bZ as Zi, b_ as Ga, b$ as Cs, c0 as Xn, c1 as yt, c2 as ll, r as ma, q as lr, c3 as ze, c4 as la, c5 as il, c6 as Xi, c7 as eo, c8 as to, c9 as ol, ca as no, cb as Sa, cc as ao, cd as ha, ce as so, cf as Ha, cg as Mt, ch as Ve, ci as Tt, cj as ro, ck as lo, cl as io, cm as oo, cn as co, co as La, cp as uo, cq as ir, cr as mo, cs as or, ct as ho, cu as po, cv as fo, cw as go, cx as ws, cy as yo, cz as cl, cA as Ss, cB as dl, cC as ia, cD as ul, cE as vo, cF as xo, cG as bo, cH as ml, cI as No, cJ as ea, cK as ks, cL as hl, cM as Co, cN as wo, cO as So, cP as pl, cQ as Ds, cR as fl, cS as ko, cT as cr, cU as ka, cV as Da, cW as Ma, cX as Do, cY as Mo, cZ as To, c_ as Nt, c$ as Se, d0 as ke, d1 as De, d2 as Oo, d3 as Eo, d4 as Io, d5 as Ao, s as Ro, d6 as dr, d7 as gl, d8 as zo, d9 as Fo, da as Lo, db as yl, dc as Ms, dd as vn, de as Ts, df as Rt, dg as _o, dh as ta, di as vl, dj as Po, dk as Vo, dl as jo, dm as Uo, dn as Bo, dp as ur, dq as $o, dr as qo, ds as Yo, dt as Go, du as Ho, dv as Jo, dw as Ko, dx as xl, dy as Wo, dz as Qo, dA as Zo, dB as Xo, dC as ec, dD as bl, dE as _a, dF as mr, dG as tc, dH as nc, dI as Ja, dJ as tt, dK as Ta, dL as ac, dM as sc, dN as hr, dO as Nl, dP as Os, dQ as rc, dR as lc, dS as Mn, dT as Ka, dU as ic, dV as oc, dW as pr, dX as Wa, dY as Qa, dZ as pa, d_ as dn, d$ as Tn, e0 as cc, e1 as dc, e2 as Cl, e3 as uc, e4 as mc, S as hc, e5 as pc, e6 as fc, e7 as gc } from "./index-CL8DpfKu.js";
|
|
8
8
|
import * as He from "react";
|
|
9
9
|
import Ie, { useState as V, useCallback as me, useEffect as Te, useRef as at, useMemo as $e, Suspense as wl, useContext as yc } from "react";
|
|
10
10
|
import "react-dom";
|
|
@@ -7695,7 +7695,7 @@ const si = Fn(({ children: e, className: t, ...n }, r) => /* @__PURE__ */ p("div
|
|
|
7695
7695
|
tokenProps: r
|
|
7696
7696
|
};
|
|
7697
7697
|
}, [t]);
|
|
7698
|
-
return /* @__PURE__ */ p(oY, { children: /* @__PURE__ */ p(t5.Provider, { value: n, children: /* @__PURE__ */ p(si, { style: { height: "100%" }, children: e }) }) });
|
|
7698
|
+
return /* @__PURE__ */ p(oY, { children: /* @__PURE__ */ p(t5.Provider, { value: n, children: /* @__PURE__ */ p(si, { style: { height: "100%", width: "100%" }, children: e }) }) });
|
|
7699
7699
|
};
|
|
7700
7700
|
function Rr() {
|
|
7701
7701
|
const e = vt(t5);
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
*/var TN;function tY(){return TN||(TN=1,process.env.NODE_ENV!=="production"&&function(){function e(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=R,n=R0,r=typeof Object.is=="function"?Object.is:e,o=n.useSyncExternalStore,i=t.useRef,s=t.useEffect,a=t.useMemo,l=t.useDebugValue;zv.useSyncExternalStoreWithSelector=function(c,u,d,h,p){var g=i(null);if(g.current===null){var m={hasValue:!1,value:null};g.current=m}else m=g.current;g=a(function(){function y(E){if(!v){if(v=!0,x=E,E=h(E),p!==void 0&&m.hasValue){var C=m.value;if(p(C,E))return S=C}return S=E}if(C=S,r(x,E))return C;var k=h(E);return p!==void 0&&p(C,k)?(x=E,C):(x=E,S=k)}var v=!1,x,S,_=d===void 0?null:d;return[function(){return y(u())},_===null?void 0:function(){return y(_())}]},[u,d,h,p]);var b=o(c,g[0],g[1]);return s(function(){m.hasValue=!0,m.value=b},[b]),l(b),b},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),zv}process.env.NODE_ENV==="production"?d1.exports=eY():d1.exports=tY();var nY=d1.exports;const rY=Pa(nY),Kj={},{useDebugValue:oY}=R,{useSyncExternalStoreWithSelector:iY}=rY;let jN=!1;const sY=e=>e;function aY(e,t=sY,n){(Kj?"production":void 0)!=="production"&&n&&!jN&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),jN=!0);const r=iY(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return oY(r),r}const ON=e=>{(Kj?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?Qq(e):e,n=(r,o)=>aY(t,r,o);return Object.assign(n,t),n},Es=e=>e?ON(e):ON;var Xj=Symbol.for("immer-nothing"),FN=Symbol.for("immer-draftable"),io=Symbol.for("immer-state"),lY=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function jr(e,...t){if(process.env.NODE_ENV!=="production"){const n=lY[e],r=typeof n=="function"?n.apply(null,t):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Pu=Object.getPrototypeOf;function Du(e){return!!e&&!!e[io]}function zl(e){var t;return e?Qj(e)||Array.isArray(e)||!!e[FN]||!!((t=e.constructor)!=null&&t[FN])||N0(e)||M0(e):!1}var cY=Object.prototype.constructor.toString();function Qj(e){if(!e||typeof e!="object")return!1;const t=Pu(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===cY}function Yg(e,t){k0(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function k0(e){const t=e[io];return t?t.type_:Array.isArray(e)?1:N0(e)?2:M0(e)?3:0}function h1(e,t){return k0(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Zj(e,t,n){const r=k0(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function uY(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function N0(e){return e instanceof Map}function M0(e){return e instanceof Set}function tl(e){return e.copy_||e.base_}function p1(e,t){if(N0(e))return new Map(e);if(M0(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=Qj(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[io];let o=Reflect.ownKeys(r);for(let i=0;i<o.length;i++){const s=o[i],a=r[s];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(r[s]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[s]})}return Object.create(Pu(e),r)}else{const r=Pu(e);if(r!==null&&n)return{...e};const o=Object.create(r);return Object.assign(o,e)}}function yE(e,t=!1){return P0(e)||Du(e)||!zl(e)||(k0(e)>1&&(e.set=e.add=e.clear=e.delete=dY),Object.freeze(e),t&&Object.entries(e).forEach(([n,r])=>yE(r,!0))),e}function dY(){jr(2)}function P0(e){return Object.isFrozen(e)}var fY={};function Bl(e){const t=fY[e];return t||jr(0,e),t}var Kf;function Jj(){return Kf}function hY(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function LN(e,t){t&&(Bl("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function m1(e){g1(e),e.drafts_.forEach(pY),e.drafts_=null}function g1(e){e===Kf&&(Kf=e.parent_)}function $N(e){return Kf=hY(Kf,e)}function pY(e){const t=e[io];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function zN(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[io].modified_&&(m1(t),jr(4)),zl(e)&&(e=Kg(t,e),t.parent_||Xg(t,e)),t.patches_&&Bl("Patches").generateReplacementPatches_(n[io].base_,e,t.patches_,t.inversePatches_)):e=Kg(t,n,[]),m1(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Xj?e:void 0}function Kg(e,t,n){if(P0(t))return t;const r=t[io];if(!r)return Yg(t,(o,i)=>BN(e,r,t,o,i,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return Xg(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const o=r.copy_;let i=o,s=!1;r.type_===3&&(i=new Set(o),o.clear(),s=!0),Yg(i,(a,l)=>BN(e,r,o,a,l,n,s)),Xg(e,o,!1),n&&e.patches_&&Bl("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function BN(e,t,n,r,o,i,s){if(process.env.NODE_ENV!=="production"&&o===n&&jr(5),Du(o)){const a=i&&t&&t.type_!==3&&!h1(t.assigned_,r)?i.concat(r):void 0,l=Kg(e,o,a);if(Zj(n,r,l),Du(l))e.canAutoFreeze_=!1;else return}else s&&n.add(o);if(zl(o)&&!P0(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Kg(e,o),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,r)&&Xg(e,o)}}function Xg(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&yE(t,n)}function mY(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:Jj(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=vE;n&&(o=[r],i=Xf);const{revoke:s,proxy:a}=Proxy.revocable(o,i);return r.draft_=a,r.revoke_=s,a}var vE={get(e,t){if(t===io)return e;const n=tl(e);if(!h1(n,t))return gY(e,n,t);const r=n[t];return e.finalized_||!zl(r)?r:r===Bv(e.base_,t)?(Vv(e),e.copy_[t]=y1(r,e)):r},has(e,t){return t in tl(e)},ownKeys(e){return Reflect.ownKeys(tl(e))},set(e,t,n){const r=eO(tl(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const o=Bv(tl(e),t),i=o==null?void 0:o[io];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(uY(n,o)&&(n!==void 0||h1(e.base_,t)))return!0;Vv(e),b1(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Bv(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Vv(e),b1(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=tl(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){jr(11)},getPrototypeOf(e){return Pu(e.base_)},setPrototypeOf(){jr(12)}},Xf={};Yg(vE,(e,t)=>{Xf[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Xf.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&jr(13),Xf.set.call(this,e,t,void 0)};Xf.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&jr(14),vE.set.call(this,e[0],t,n,e[0])};function Bv(e,t){const n=e[io];return(n?tl(n):e)[t]}function gY(e,t,n){var o;const r=eO(t,n);return r?"value"in r?r.value:(o=r.get)==null?void 0:o.call(e.draft_):void 0}function eO(e,t){if(!(t in e))return;let n=Pu(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Pu(n)}}function b1(e){e.modified_||(e.modified_=!0,e.parent_&&b1(e.parent_))}function Vv(e){e.copy_||(e.copy_=p1(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var bY=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const i=n;n=t;const s=this;return function(l=i,...c){return s.produce(l,u=>n.call(this,u,...c))}}typeof n!="function"&&jr(6),r!==void 0&&typeof r!="function"&&jr(7);let o;if(zl(t)){const i=$N(this),s=y1(t,void 0);let a=!0;try{o=n(s),a=!1}finally{a?m1(i):g1(i)}return LN(i,r),zN(o,i)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===Xj&&(o=void 0),this.autoFreeze_&&yE(o,!0),r){const i=[],s=[];Bl("Patches").generateReplacementPatches_(t,o,i,s),r(i,s)}return o}else jr(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...a)=>this.produceWithPatches(s,l=>t(l,...a));let r,o;return[this.produce(t,n,(s,a)=>{r=s,o=a}),r,o]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){zl(e)||jr(8),Du(e)&&(e=yY(e));const t=$N(this),n=y1(e,void 0);return n[io].isManual_=!0,g1(t),n}finishDraft(e,t){const n=e&&e[io];(!n||!n.isManual_)&&jr(9);const{scope_:r}=n;return LN(r,t),zN(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const o=t[n];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}n>-1&&(t=t.slice(n+1));const r=Bl("Patches").applyPatches_;return Du(e)?r(e,t):this.produce(e,o=>r(o,t))}};function y1(e,t){const n=N0(e)?Bl("MapSet").proxyMap_(e,t):M0(e)?Bl("MapSet").proxySet_(e,t):mY(e,t);return(t?t.scope_:Jj()).drafts_.push(n),n}function yY(e){return Du(e)||jr(10,e),tO(e)}function tO(e){if(!zl(e)||P0(e))return e;const t=e[io];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=p1(e,t.scope_.immer_.useStrictShallowCopy_)}else n=p1(e,!0);return Yg(n,(r,o)=>{Zj(n,r,tO(o))}),t&&(t.finalized_=!1),n}var so=new bY,vY=so.produce;so.produceWithPatches.bind(so);so.setAutoFreeze.bind(so);so.setUseStrictShallowCopy.bind(so);so.applyPatches.bind(so);so.createDraft.bind(so);so.finishDraft.bind(so);const xY=e=>(t,n,r)=>(r.setState=(o,i,...s)=>{const a=typeof o=="function"?vY(o):o;return t(a,i,...s)},e(r.setState,n,r)),Jh=xY;var v1,lm=rn;if(process.env.NODE_ENV==="production")v1=lm.createRoot,lm.hydrateRoot;else{var VN=lm.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;v1=function(e,t){VN.usingClientEntryPoint=!0;try{return lm.createRoot(e,t)}finally{VN.usingClientEntryPoint=!1}}}var nO={},rO={},xE={exports:{}},tt=String,oO=function(){return{isColorSupported:!1,reset:tt,bold:tt,dim:tt,italic:tt,underline:tt,inverse:tt,hidden:tt,strikethrough:tt,black:tt,red:tt,green:tt,yellow:tt,blue:tt,magenta:tt,cyan:tt,white:tt,gray:tt,bgBlack:tt,bgRed:tt,bgGreen:tt,bgYellow:tt,bgBlue:tt,bgMagenta:tt,bgCyan:tt,bgWhite:tt,blackBright:tt,redBright:tt,greenBright:tt,yellowBright:tt,blueBright:tt,magentaBright:tt,cyanBright:tt,whiteBright:tt,bgBlackBright:tt,bgRedBright:tt,bgGreenBright:tt,bgYellowBright:tt,bgBlueBright:tt,bgMagentaBright:tt,bgCyanBright:tt,bgWhiteBright:tt}};xE.exports=oO();xE.exports.createColors=oO;var wY=xE.exports;(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,c){for(var u in c)Object.defineProperty(l,u,{enumerable:!0,get:c[u]})}t(e,{dim:function(){return s},default:function(){return a}});const n=r(wY);function r(l){return l&&l.__esModule?l:{default:l}}let o=new Set;function i(l,c,u){typeof process<"u"&&process.env.JEST_WORKER_ID||u&&o.has(u)||(u&&o.add(u),console.warn(""),c.forEach(d=>console.warn(l,"-",d)))}function s(l){return n.default.dim(l)}const a={info(l,c){i(n.default.bold(n.default.cyan("info")),...Array.isArray(l)?[l]:[c,l])},warn(l,c){i(n.default.bold(n.default.yellow("warn")),...Array.isArray(l)?[l]:[c,l])},risk(l,c){i(n.default.bold(n.default.magenta("risk")),...Array.isArray(l)?[l]:[c,l])}}})(rO);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});const t=n(rO);function n(i){return i&&i.__esModule?i:{default:i}}function r({version:i,from:s,to:a}){t.default.warn(`${s}-color-renamed`,[`As of Tailwind CSS ${i}, \`${s}\` has been renamed to \`${a}\`.`,"Update your configuration file to silence this warning."])}const o={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},get lightBlue(){return r({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return r({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return r({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return r({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return r({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}})(nO);let Hv=nO;var CY=(Hv.__esModule?Hv:{default:Hv}).default;const Mt=Pa(CY),Qg=!1,wE=`import pandas as pd
|
|
34
34
|
df = pd.DataFrame(data) # 'data' contains the query result
|
|
35
35
|
result = df.to_dict('records') # must return 'result' as [dict] type
|
|
36
|
-
`,iO=["_forecast"],Zg="dm",Qf=[{locale:"en-US",currency:"USD",currencyName:"US Dollar"},{locale:"en-GB",currency:"GBP",currencyName:"British Pound"},{locale:"en-CA",currency:"CAD",currencyName:"Canadian Dollar"},{locale:"en-AU",currency:"AUD",currencyName:"Australian Dollar"},{locale:"en-IN",currency:"INR",currencyName:"Indian Rupee"},{locale:"ja-JP",currency:"JPY",currencyName:"Japanese Yen"},{locale:"de-DE",currency:"EUR",currencyName:"Germany (Eurozone)"},{locale:"fr-FR",currency:"EUR",currencyName:"France (Eurozone)"},{locale:"es-ES",currency:"EUR",currencyName:"Spain (Eurozone)"},{locale:"it-IT",currency:"EUR",currencyName:"Italy (Eurozone)"},{locale:"fi-FI",currency:"EUR",currencyName:"Finland (Eurozone)"},{locale:"nl-NL",currency:"EUR",currencyName:"Netherlands (Eurozone)"},{locale:"zh-CN",currency:"CNY",currencyName:"Chinese Yuan"},{locale:"ru-RU",currency:"RUB",currencyName:"Russian Ruble"},{locale:"pt-BR",currency:"BRL",currencyName:"Brazilian Real"},{locale:"ko-KR",currency:"KRW",currencyName:"South Korean Won"},{locale:"ar-SA",currency:"SAR",currencyName:"Saudi Riyal"},{locale:"sv-SE",currency:"SEK",currencyName:"Swedish Krona"},{locale:"no-NO",currency:"NOK",currencyName:"Norwegian Krone"},{locale:"da-DK",currency:"DKK",currencyName:"Danish Krone"},{locale:"pl-PL",currency:"PLN",currencyName:"Polish Zloty"},{locale:"tr-TR",currency:"TRY",currencyName:"Turkish Lira"},{locale:"he-IL",currency:"ILS",currencyName:"Israeli Shekel"},{locale:"th-TH",currency:"THB",currencyName:"Thai Baht"},{locale:"vi-VN",currency:"VND",currencyName:"Vietnamese Dong"},{locale:"id-ID",currency:"IDR",currencyName:"Indonesian Rupiah"},{locale:"mx-MX",currency:"MXN",currencyName:"Mexican Peso"},{locale:"za-ZA",currency:"ZAR",currencyName:"South African Rand"},{locale:"sg-SG",currency:"SGD",currencyName:"Singapore Dollar"},{locale:"hk-HK",currency:"HKD",currencyName:"Hong Kong Dollar"},{locale:"ch-CH",currency:"CHF",currencyName:"Swiss Franc"},{locale:"my-MY",currency:"MYR",currencyName:"Malaysian Ringgit"},{locale:"ph-PH",currency:"PHP",currencyName:"Philippine Peso"},{locale:"eg-EG",currency:"EGP",currencyName:"Egyptian Pound"},{locale:"nz-NZ",currency:"NZD",currencyName:"New Zealand Dollar"}],SY=[{label:"English",locales:[{code:"en-US",name:"US English"},{code:"en-GB",name:"British English"},{code:"en-AU",name:"Australian English"},{code:"en-CA",name:"Canadian English"}]},{label:"French",locales:[{code:"fr-FR",name:"France French"},{code:"fr-CA",name:"Canadian French"}]},{label:"Spanish",locales:[{code:"es-ES",name:"Spain Spanish"},{code:"es-MX",name:"Mexican Spanish"},{code:"es-419",name:"Latin American Spanish"}]},{label:"German",locales:[{code:"de-DE",name:"Germany German"},{code:"de-CH",name:"Swiss German"}]},{label:"Chinese",locales:[{code:"zh-CN",name:"Simplified Chinese (China)"},{code:"zh-TW",name:"Traditional Chinese (Taiwan)"},{code:"zh-HK",name:"Hong Kong Chinese"}]},{label:"Japanese",locales:[{code:"ja-JP",name:"Japanese"}]},{label:"Arabic",locales:[{code:"ar-EG",name:"Egypt Arabic"},{code:"ar-SA",name:"Saudi Arabia Arabic"}]},{label:"Russian",locales:[{code:"ru-RU",name:"Russian"}]},{label:"Portuguese",locales:[{code:"pt-PT",name:"Portugal Portuguese"},{code:"pt-BR",name:"Brazil Portuguese"}]},{label:"Indian Languages",locales:[{code:"hi-IN",name:"Hindi (India)"},{code:"ta-IN",name:"Tamil (India)"}]},{label:"Korean",locales:[{code:"ko-KR",name:"Korean"}]},{label:"Italian",locales:[{code:"it-IT",name:"Italian (Italy)"}]},{label:"Dutch",locales:[{code:"nl-NL",name:"Dutch (Netherlands)"}]},{label:"Swedish",locales:[{code:"sv-SE",name:"Swedish (Sweden)"}]},{label:"Turkish",locales:[{code:"tr-TR",name:"Turkish (Turkey)"}]},{label:"Hebrew",locales:[{code:"he-IL",name:"Hebrew (Israel)"}]},{label:"Thai",locales:[{code:"th-TH",name:"Thai (Thailand)"}]},{label:"Polish",locales:[{code:"pl-PL",name:"Polish (Poland)"}]},{label:"Greek",locales:[{code:"el-GR",name:"Greek (Greece)"}]},{label:"Norwegian",locales:[{code:"no-NO",name:"Norwegian (Norway)"}]}],CE=["lg","md","sm","xs","xxs"],Jg={default:{dashboardPanel:"",dashboardTabsContainer:"",gridLayout:{className:""},chart:{font:{family:"Open Sans, Arial, sans-serif"},dataset:{backgroundColor:[Mt.teal[500],Mt.teal[300],Mt.gray[700],Mt.gray[500],Mt.gray[300]],borderColor:[Mt.teal[500],Mt.teal[300],Mt.gray[700],Mt.gray[500],Mt.gray[300]]},options:{interaction:{mode:"index"},plugins:{datalabels:{display:!1,color:x1},title:{display:!0},tooltip:{backgroundColor:"#fff",bodyColor:"#000",borderWidth:.25,titleColor:"#000",borderColor:"rgb(128,131,139)",cornerRadius:4,usePointStyle:!0,pointStyle:"rectRounded",boxPadding:4},legend:{position:"top",align:"center",maxHeight:0,labels:{useBorderRadius:!0,borderRadius:2}}},scales:{y:{grid:{display:!0},title:{display:!0,text:""},beginAtZero:!0,ticks:{precision:0}},x:{grid:{display:!0},title:{display:!0}}},layout:{padding:{top:-40}},borderRadius:2,responsive:!0,maintainAspectRatio:!1}}},dark:{chart:{dataset:{datalables:{color:x1},backgroundColor:[Mt.teal[500],Mt.teal[300],Mt.gray[700],Mt.gray[500],Mt.gray[300]],borderColor:[Mt.teal[500],Mt.teal[300],Mt.gray[700],Mt.gray[500],Mt.gray[300]]},options:{plugins:{tooltip:{backgroundColor:"#000",bodyColor:"#fff",borderWidth:.25,titleColor:"#fff",borderColor:"rgb(128,131,139)",cornerRadius:2,boxPadding:4}},datalabels:{display:!1},scales:{x:{grid:{display:!0,color:Mt.slate[800]}},y:{grid:{display:!0,color:Mt.slate[800]}}}}}}};function x1(e){var r,o,i,s,a,l;const t=(a=(s=(i=(o=(r=e==null?void 0:e.chart)==null?void 0:r.config)==null?void 0:o._config)==null?void 0:i.options)==null?void 0:s.plugins)==null?void 0:a.datalabels;let n=(l=e==null?void 0:e.dataset)==null?void 0:l.backgroundColor;return(t==null?void 0:t.align)==="end"&&(t==null?void 0:t.anchor)==="end"&&(n=Zf()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=Zf()),Au(n)}function Zf(){return oe.getState().theme==="dark"?"#000000":"#FFFFFF"}function Au(e){let t=0,n=0,r=0,o=0;const i=u=>{if(!u)return Mt.gray[500];const d=u.replace("#",""),h=parseInt(d.substring(0,2),16),p=parseInt(d.substring(2,4),16),g=parseInt(d.substring(4,6),16);t+=h,n+=p,r+=g,o++};Array.isArray(e)?e.forEach(u=>{i(u)}):i(e);const s=t/o,a=n/o,l=r/o;return(s*299+a*587+l*114)/1e3>=180?"black":"white"}const EY=["text","nullable(string)","name","enum","varchar","nvarchar","nvarchar2","char","character","longtext","nchar","char varying","nchar varying","character varying","string"],_Y=["number","integer","int","int64","bigint","smallint","tinyint","byteint","numeric","decimal","dec","double","real","double precision","float","float4","float8","float64"],RY=["date","datetime","time","timestamp","timestamp without time zone","timestamp_ns"],kY=["boolean"];function SE(e){return e.match(/[A-Z]/)?`"${e}"`:e}function D0(e){return EY.includes(e.toLowerCase())||/varchar/i.test(e)}function ep(e){return _Y.includes(e.toLowerCase())||/int|decimal|float|double/i.test(e)}function ic(e){return RY.includes(e.toLowerCase())||/date|time|timestamp/i.test(e)}function EE(e){return kY.includes(e.toLowerCase())||/boolean/i.test(e)}function NY(e,t,n,r,o,i){const{measures:s,dimensions:a}=e,l=s==null?void 0:s.map(h=>`${h.calc}(${h.name}) as ${h.calc}_${h.name.replace(/"/g,"")}`).join(", "),c=(a==null?void 0:a.join(", "))||"";let u="";const d=r?`${Zg}.${r}`:_E({schemaName:t,tableName:n,connectionType:o,databaseName:i});if(l&&c)return u=`SELECT ${c}, COUNT(*) as count, ${l} FROM ${d} GROUP BY ${c} ORDER BY ${c} DESC LIMIT 100`,u;if(!l&&c)return u=`SELECT ${c}, COUNT(*) as count FROM ${d} GROUP BY ${c} ORDER BY ${c} DESC LIMIT 100`,u;if(l&&!c)return u=`SELECT ${l} FROM ${d} LIMIT 100`,u}function MY(e,t,n="AVG"){var i,s,a,l;let r={};const o=SE(e.column_name);return D0(e.data_type)&&(((i=t.dimensions)==null?void 0:i.includes(o))?r={...t,dimensions:(s=t.dimensions)==null?void 0:s.filter(u=>u!==o)}:r={...t,dimensions:[...t.dimensions||[],o]}),ep(e.data_type)&&(((a=t.measures)==null?void 0:a.some(u=>u.name===o&&u.calc===n))?r={...t,measures:(l=t.measures)==null?void 0:l.filter(u=>!(u.name===o&&u.calc===n))}:r={...t,measures:[...t.measures||[],{name:o,calc:n||"SUM"}]}),r}function nu(e){return D0(e.dataType)?"string":ep(e.dataType)?"number":ic(e.dataType)?"date":EE(e.dataType)?"boolean":"string"}function PY(e){let t;const n=e.data_type.toLowerCase();return D0(n)?t="T":ep(n)?t="#":ic(n)?t="D":EE(n)?t="B":t="?",t}function DY(e,t){const{dimensions:n,measures:r}=t,o=n==null?void 0:n.includes(e.column_name),i=r==null?void 0:r.some(s=>s.name===e.column_name);return o||i}function sO(e){return e?e!=null&&e.startsWith(`${Zg}.`)?e:`${Zg}.${e}`:""}function aO({schemaName:e,tableName:t,modelName:n,connectionType:r,databaseName:o}){let i=_E({schemaName:e,tableName:t,connectionType:r,databaseName:o});n&&(i=sO(n));let s=i;return(l=>/[A-Z]/.test(l))(t)&&(s=s.split(".").map(c=>`"${c}"`).join(".")),s}function _E({schemaName:e,tableName:t,connectionType:n,databaseName:r}){return t==="api"||e===SE("NA")||n==="S3"||n==="API"?t:n==="S3Tables"?`${r}.${e}.${t}`:e?`${e}.${t}`:`${t}`}const AY=e=>{const t=new Date(e);return!isNaN(t.getTime())},IY=e=>!isNaN(Number(e))&&!isNaN(parseFloat(e)),A0=e=>{let t;return typeof e=="number"?t="number":typeof e=="string"?AY(e)?t="date":IY(e)?t="number":t="string":typeof e=="boolean"?t="boolean":e instanceof Date?t="date":t="unknown",t};function TY({get:e,dataPoint:t,card:n}){var h;const{addOrUpdateFilterValue:r,addFilteringCard:o,removeFilterValues:i,replaceFilterValue:s,removeFilteringCard:a}=e().actions,l=e().filteringCards,{columnName:c,columnValue:u}=t,d={filterId:n.id,connectionId:n==null?void 0:n.connectionId,tableName:n.lastSelectedTable,name:c,expression:(h=n.preferences)==null?void 0:h.filterOnClickField,valueType:A0(u),operation:"=",values:[u]};if(l!=null&&l.find(p=>p.id===n.id)){const p=n.id;if(u==null){a(n),i(p);return}else s(d)}o(n),r(d)}function HN({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},l=t?{...t}:{};return CE.forEach(c=>{l[c]||(l[c]=[]);const u=l[c].reduce((d,h)=>Math.max(d,h.y+h.h),0);a.y=a.y===1/0?u:a.y,l[c].push({...a})}),l}function WN(e,t){if(!t)return;const n={...t};return CE.forEach(r=>{n[r]&&(n[r]=n[r].filter(o=>o.i!==e))}),n}function lO(e){const t=oe.getState().dashboard.globalCacheConfig,{card:n,filter:r}=e;return t}const oe=Es()(Jh((e,t)=>({isSessionExpired:!1,currentBreakpoint:"lg",dashboard:{id:"",style:Jg},showContext:!1,selectedSheetId:null,selectedCardId:null,selectedFrameId:null,selectedCard:null,showFilters:!1,isDashboardEditing:!1,isVisualEditing:!1,showDashboardJSON:!1,filteringCards:[],isDashboardPanelOpen:!1,actions:{setInitStore:()=>{e(n=>{n.isSessionExpired=!1,n.currentBreakpoint="lg",n.dashboard={id:"",style:Jg},n.showContext=!1,n.selectedSheetId=null,n.selectedCardId=null,n.selectedFrameId=null,n.selectedCard=null,n.showFilters=!1,n.isDashboardEditing=!1,n.isVisualEditing=!1,n.showDashboardJSON=!1,n.filteringCards=[],n.selectedLensId=void 0,n.filterValues=void 0})},setAiContext:n=>{e(r=>{r.dashboard.aiContext=n})},setHandleOpenAssistantProfile:n=>{e(r=>{r.handleOpenAssistantProfile=n})},setFilterMode:(n,r)=>{const o=r==="exclude"?"not in":"in";e(i=>{var a,l,c;const s=(a=i.dashboard.filters)==null?void 0:a.find(u=>u.id===n);s&&(s.operation=o,i.dashboard.filters=(l=i.dashboard.filters)==null?void 0:l.map(u=>u.id===n?s:u),i.filterValues&&i.filterValues.length>0&&(i.filterValues=(c=i.filterValues)==null?void 0:c.map(u=>u.filterId===n?{...u,operation:o}:u)))})},updateEmailSettings:n=>{e(r=>{r.dashboard.emailSettings=n})},setDefaultFilterValues:n=>{e(r=>{r.dashboard.defaultFilterValues=n})},setIsDownloadingPdf:n=>{e(r=>{r.isDownloadingPdf=n})},setGlobalCacheConfig:n=>{e(r=>{r.dashboard.globalCacheConfig=n})},setLenses:n=>{e(r=>{r.lenses=n})},setSelectedLensId:n=>{e(r=>{r.selectedLensId=n})},deleteSheet:n=>{e(r=>{var i,s,a,l,c,u,d,h;const o=(i=r.dashboard.sheets)==null?void 0:i.findIndex(p=>p.id===n);if(o!==void 0&&o>-1){(s=r.dashboard.sheets)==null||s.splice(o,1);const p=(a=r.dashboard.filters)==null?void 0:a.filter(m=>m.sheetId===n),g=(l=r.filterValues)==null?void 0:l.filter(m=>p==null?void 0:p.some(b=>b.id===m.filterId));r.filterValues=(c=r.filterValues)==null?void 0:c.filter(m=>!(g!=null&&g.some(b=>b.filterId===m.filterId))),r.dashboard.filters=(u=r.dashboard.filters)==null?void 0:u.filter(m=>m.sheetId!==n),r.selectedSheetId=(h=(d=r.dashboard.sheets)==null?void 0:d[0])==null?void 0:h.id}})},addSheet:n=>{e(r=>{r.dashboard.sheets||(r.dashboard.sheets=[]);const o=r.dashboard.filters;let i={};o==null||o.forEach(a=>{CE.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})},addToAIScope:n=>{e(r=>{const{connectionId:o,connectionType:i,databaseName:s,schemaName:a,tableName:l,datamodelName:c,datamodelId:u}=n,d={connectionId:o||"",connectionType:i||"",databaseName:s||"",schemaName:a||"",tableName:l||"",datamodelName:c||"",datamodelId:u||""};let p=[...r.dashboard.aiScopeTables||[],d];p=p.filter((g,m,b)=>b.findIndex(y=>y.tableName===g.tableName&&y.datamodelName===g.datamodelName)===m),r.dashboard.aiScopeTables=p})},removeFromAIScope:n=>{e(r=>{const{connectionId:o,tableName:i,datamodelName:s}=n,a=r.dashboard.aiScopeTables||[];if(s){const l=a.filter(c=>!(c.datamodelName===s&&c.connectionId===o));r.dashboard.aiScopeTables=l}else if(i){const l=a.filter(c=>!(c.tableName===i&&c.connectionId===o));r.dashboard.aiScopeTables=l}})},setIsSessionExpired:n=>{e(()=>({isSessionExpired:n}))},setCardPython:(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===o.selectedSheetId);i&&((l=i==null?void 0:i.frames)==null||l.forEach(c=>{var d;const u=(d=c.cards)==null?void 0:d.find(h=>h.id===n);u&&(u.python=r)}))})},addBaseQuery:n=>{e(r=>{var o;r.dashboard.baseQueries||(r.dashboard.baseQueries=[]),(o=r.dashboard.baseQueries)==null||o.push(n)})},removeBaseQuery:n=>{e(r=>{var i,s;const o=(i=r.dashboard.baseQueries)==null?void 0:i.findIndex(a=>a.id===n);o!=null&&o>-1&&((s=r.dashboard.baseQueries)==null||s.splice(o,1))})},setBaseQueries:n=>{e(r=>{r.dashboard.baseQueries=n})},setCurrentBreakpoint:n=>{e(()=>({currentBreakpoint:n}))},setFilteringCards:n=>{e(()=>({filteringCards:n}))},addFilteringCard:n=>{e(r=>{var o;(o=r.filteringCards)==null||o.push(n)})},removeFilteringCard:n=>{e(r=>{var i,s;const o=(i=r.filteringCards)==null?void 0:i.findIndex(a=>a.id===n.id);o!==void 0&&o>-1&&((s=r.filteringCards)==null||s.splice(o,1))})},setCustomCards:n=>{e(r=>{r.dashboard.customCards=n})},setAuthToken:n=>{e(()=>({authToken:n}))},setThemeStyle:n=>{e(()=>({themeStyle:n}))},setDashboard:n=>e({dashboard:n}),setDashboardWithFilterValues:(n,r)=>{e(o=>{o.dashboard=n,o.filterValues=r})},setDashboardTheme:n=>{e(r=>{r.theme=n})},setSheets:n=>{e(r=>{r.dashboard&&(r.dashboard.sheets=n)})},setSheetTitle:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.title=r)})},setCardTitle:(n,r,o)=>{e(i=>{var a,l,c;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(u=>u.id===n);s&&((c=s==null?void 0:s.frames)==null||c.forEach(u=>{var h;const d=(h=u.cards)==null?void 0:h.find(p=>p.id===r);d&&(d.title=o)}))})},setCardInfo:(n,r)=>{e(o=>{var s,a,l;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===o.selectedSheetId);i&&((l=i==null?void 0:i.frames)==null||l.forEach(c=>{var d;const u=(d=c.cards)==null?void 0:d.find(h=>h.id===n);u&&(u.info=r)}))})},setCardDescription:(n,r,o)=>{e(i=>{var a,l,c;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(u=>u.id===n);s&&((c=s==null?void 0:s.frames)==null||c.forEach(u=>{var h;const d=(h=u.cards)==null?void 0:h.find(p=>p.id===r);d&&(d.description=o)}))})},setCardSql:(n,r,o)=>{e(i=>{var a,l,c,u;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(d=>d.id===n);if(s){const d=(c=s.cards)==null?void 0:c.find(h=>h.id===r);d&&(d.sql=o,(u=i.onUpdateCard)==null||u.call(i,d,n))}})},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,c;const i=(s=r==null?void 0:r.filterValues)==null?void 0:s.findIndex(u=>u.filterId===o.filterId);if(o.values.length===0){r.filterValues=(a=r.filterValues)==null?void 0:a.filter(u=>u.filterId!==o.filterId);return}i!==void 0&&i>-1?(l=r.filterValues)==null||l.splice(i,1,o):(c=r.filterValues)==null||c.push(o)}):r.filterValues=n})},removeFilterValues:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.filter(i=>i.filterId!==n&&!i.filterId.startsWith(n));r.filterValues=o}})},replaceFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1&&r.filterValues.splice(o,1,n)}})},addFilter:n=>{e(r=>{var i,s;r.dashboard.filters?(i=r.dashboard.filters)==null||i.push(n):r.dashboard.filters=[n],(s=r.dashboard.sheets)==null||s.find(a=>a.id===r.selectedSheetId);const o=r.dashboard.sheets;o==null||o.forEach(a=>{HN({id:n.id,layouts:a.layouts,y:0,initialHeight:8,minH:7,w:10})})})},removeFilter:n=>{e(r=>{var o,i,s;if(r.dashboard.filters){const a=(o=r.dashboard.filters)==null?void 0:o.findIndex(l=>l.id===n);if(a>-1){(i=r.dashboard.filters)==null||i.splice(a,1),(s=r.dashboard.sheets)==null||s.find(c=>c.id===r.selectedSheetId);const l=r.dashboard.sheets;l==null||l.forEach(c=>{const u=WN(n,c.layouts);c.layouts=u})}}})},updateCurrentDashboardCard:n=>{e(r=>{var a,l,c,u,d;const o=(l=(a=r.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(h=>h.id===r.selectedSheetId),i=(c=o==null?void 0:o.frames)==null?void 0:c.find(h=>h.id===r.selectedFrameId),s=(u=i==null?void 0:i.cards)==null?void 0:u.findIndex(h=>h.id===n.id);typeof s=="number"&&s>=0&&((d=i==null?void 0:i.cards)==null||d.splice(s,1,n))})},updateFrameCard:(n,r,o)=>{e(i=>{var l,c,u,d,h;const s=(c=(l=i.dashboard)==null?void 0:l.sheets)==null?void 0:c.find(p=>p.id===n);if(!s)return;const a=(u=s==null?void 0:s.frames)==null?void 0:u.find(p=>p.id===r);if(a){const p=(d=a.cards)==null?void 0:d.findIndex(g=>g.id===o.id);p>-1&&((h=a.cards)==null||h.splice(p,1,o))}})},updateFilter:n=>{e(r=>{var o,i;if(r.dashboard.filters){const s=(o=r.dashboard.filters)==null?void 0:o.findIndex(a=>a.id===n.id);s>-1&&((i=r.dashboard.filters)==null||i.splice(s,1,n))}})},updateFilterId:(n,r)=>{e(o=>{var a,l;const i=(a=o.dashboard.filters)==null?void 0:a.find(c=>c.id===n),s=(l=o.dashboard.filters)==null?void 0:l.some(c=>c.id===r);i&&!s&&(i.id=r)})},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(d=>d.id===n);if(s){s.frames||(s.frames=[]),(c=s.frames)==null||c.push(r);let d=1/0;const h=0;o==="start"&&(d=0);const p=HN({id:r.id,layouts:s.layouts,minH:10,x:h,y:d});s.layouts=p,(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(d=>d.id===n);if(i){const d=(l=i.frames)==null?void 0:l.findIndex(h=>h.id===r);console.log(d),typeof d=="number"&&d>-1&&((c=i.frames)==null||c.splice(d,1),(u=i.layout)==null||u.splice(d,1),WN(r,i.layouts))}})},updateFrame:(n,r)=>{e(o=>{var a,l,c,u,d;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(h=>h.id===n),s=(c=i==null?void 0:i.frames)==null?void 0:c.findIndex(h=>h.id===r.id);i&&((u=i.frames)==null||u.splice(s,1,r)),(d=o.onAcceptChanges)==null||d.call(o,r,o.dashboard)})},updateCard:(n,r)=>{e(o=>{var a,l,c,u,d;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(h=>h.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(h=>h.id===r.id);i&&((u=i.cards)==null||u.splice(s,1,r),(d=o.onUpdateCard)==null||d.call(o,r,n))})},removeCard:(n,r)=>{e(o=>{var a,l,c,u,d,h;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(p=>p.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(p=>p.id===r.id);i&&((u=i.cards)==null||u.splice(s,1),(d=i.layout)==null||d.splice(s,1),(h=o.onRemoveCard)==null||h.call(o,r,n))})},setStyle:n=>{e(r=>{r.dashboard&&(r.dashboard.style=n)})},setSelectedCardId:(n,r)=>{e(o=>{var s,a,l;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===n);i&&(((l=i.cards)==null?void 0:l.find(u=>u.id===r))?o.selectedCardId=r:o.selectedCardId=null)})},setSelectedFrameId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(a=>a.id===r.selectedSheetId))&&(r.selectedFrameId=n)})},setSelectedSheetId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(a=>a.id===n))&&(r.selectedSheetId=n)})},setOnSaveFunction:n=>{e(()=>({onSaveFunction:n}))},setOnAddCard:n=>{e(()=>({onAddCard:n}))},setOnAcceptChanges:n=>{e(()=>({onAcceptChanges:n}))},setOnUpdateCard:n=>{e(()=>({onUpdateCard:n}))},setOnRemoveCard:n=>{e(()=>({onRemoveCard:n}))},setOnEvent:n=>{e(()=>({onEvent:n}))},getDashboard:()=>t().dashboard,getSelectedSheet:()=>{var n,r;return(r=(n=t().dashboard)==null?void 0:n.sheets)==null?void 0:r.find(o=>o.id===t().selectedSheetId)},getCardFrame:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a){for(let l=0;l<a.length;l++)if((i=a[l].cards)==null?void 0:i.find(u=>u.id===n))return a[l]}}},getSelectedFrame:()=>{var r,o,i;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(s=>s.id===t().selectedSheetId);return(i=n==null?void 0:n.frames)==null?void 0:i.find(s=>s.id===t().selectedFrameId)},getCard:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a)for(let l=0;l<a.length;l++){const c=(i=a[l].cards)==null?void 0:i.find(u=>u.id===n);if(c)return c}}},getSelectedSheetLayout:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layout},getSelectedSheetLayouts:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layouts},getStyle:()=>{var n;return(n=t().dashboard)==null?void 0:n.style},getCardSheet(n){var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a){for(let l=0;l<a.length;l++)if((i=a[l].cards)==null?void 0:i.find(u=>u.id===n))return r[s]}}},handleDataPointClickAction:(n,r)=>{TY({card:n,dataPoint:r,get:t})},setIsDashboardPanelOpen:n=>{e(()=>({isDashboardPanelOpen:n}))}}}))),cO=()=>oe(t=>{var i,s,a,l,c;const n=(s=(i=t.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(u=>u.id===t.selectedSheetId),r=(a=n==null?void 0:n.frames)==null?void 0:a.find(u=>u.id===t.selectedFrameId);return((l=r==null?void 0:r.cards)==null?void 0:l.find(u=>u.id===(r==null?void 0:r.activeCardId)))||((c=r==null?void 0:r.cards)==null?void 0:c[0])}),uO=()=>{var n;const e=oe(r=>{var o,i;return(i=(o=r.dashboard)==null?void 0:o.sheets)==null?void 0:i.find(s=>s.id===r.selectedSheetId)});return(((n=e==null?void 0:e.frames)==null?void 0:n.map(r=>{var o;return(o=r.cards)==null?void 0:o.find(i=>i.id===r.activeCardId)}))||[]).filter(r=>r!==void 0)},dO=()=>{var t,n,r;const e=cO();return{metricFields:((t=e==null?void 0:e.config)==null?void 0:t.metricColumns)||[],groupByFields:((n=e==null?void 0:e.config)==null?void 0:n.groupByColumns)||[],pivotByFields:((r=e==null?void 0:e.config)==null?void 0:r.pivotByColumns)||[]}},on=()=>oe(e=>e.actions);async function jY(e,t){const n=t.slice(0,16),r=new TextEncoder,o=await window.crypto.subtle.importKey("raw",r.encode(n),{name:"PBKDF2"},!1,["deriveKey"]),i=await window.crypto.subtle.deriveKey({name:"PBKDF2",salt:r.encode(n),iterations:1e5,hash:"SHA-256"},o,{name:"AES-GCM",length:256},!1,["encrypt"]),s=window.crypto.getRandomValues(new Uint8Array(12)),a=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:s},i,r.encode(e)),l=new Uint8Array(s.length+a.byteLength);return l.set(s,0),l.set(new Uint8Array(a),s.length),{payload:btoa(String.fromCharCode(...l))}}async function fO(e,t){const n=t.slice(0,16),r=new TextEncoder,o=new TextDecoder,i=await window.crypto.subtle.importKey("raw",r.encode(n),{name:"PBKDF2"},!1,["deriveKey"]),s=await window.crypto.subtle.deriveKey({name:"PBKDF2",salt:r.encode(n),iterations:1e5,hash:"SHA-256"},i,{name:"AES-GCM",length:256},!1,["decrypt"]),a=Uint8Array.from(atob(e),h=>h.charCodeAt(0)),l=a.slice(0,12),c=a.slice(a.length-16),u=a.slice(12,a.length-16),d=new Uint8Array(u.length+c.length);d.set(u),d.set(c,u.length);try{const h=await window.crypto.subtle.decrypt({name:"AES-GCM",iv:l},s,d);return{decryptedData:o.decode(h)}}catch(h){throw new Error(`Decryption failed: ${h}`)}}function re(...e){return qq($l(e))}const OY=e=>Object.keys(e).length===0;async function br(e,t,n={}){try{const r=new URLSearchParams(n).toString(),o=`${e}?${r}`,i=await fetch(o,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(!i.ok){const a=await i.json();throw new Error((a==null?void 0:a.error)||`HTTP error! status: ${i.status}`)}return await i.json()}catch(r){throw console.error("Error during fetch:",r),r}}async function hO(e,t,n={}){try{const r=JSON.stringify(n),o=await jY(r,t),i=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(o)});if(!i.ok)return i.json().then(a=>{throw console.log(a.detail||"Unknown error occurred"),new Error((a==null?void 0:a.error)||`HTTP error! status: ${i.status}`)});const s=await i.json();if(s.payload){const a=await fO(s.payload,t);return JSON.parse(a.decryptedData)}return s}catch(r){throw console.error("Error during fetch:",r),r}}async function pO(e,t,n={},r="POST"){try{const o=await fetch(e,{method:r,headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(n)});return o.ok?await o.json():o.json().then(s=>{throw console.log(s.detail||"Unknown error occurred"),new Error((s==null?void 0:s.error)||`HTTP error! status: ${o.status}`)})}catch(o){throw console.error("Error during fetch:",o),o}}function FY(e){if(!e)return{tenantId:"",endUserId:""};const t=Zh(e);return{tenantId:t==null?void 0:t.tenantId,endUserId:t==null?void 0:t.endUserId}}function LY(e){return e?Zh(e).assistantProfileId:void 0}function $Y(e){if(!e)return;const t=Zh(e);if(t.params&&t.params.currencyFormat)return t.params.currencyFormat}function mO(e){return e?Zh(e).params:void 0}function RE(e){return e.charAt(0).toUpperCase()+e.slice(1)}function kE(e){return e.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substring(1).toLowerCase())}function NE(e){return e.replace(/[_-]+/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase())}const Nr="focus:ring-1 focus:ring-offset-0 focus-visible:ring-1 focus-visible:ring-offset-0",ps="focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0 focus:ring-0 focus:ring-ring focus:ring-offset-0";async function zY(){var o,i;const e=(i=(o=oe.getState())==null?void 0:o.authToken)==null?void 0:i.accessToken;if(!e)return;const n=await fetch("https://semaphor.cloud/api/v1/invalidate-token",{method:"POST",headers:{Authorization:`Bearer ${e}`}});if(!n.ok)throw new Error("Failed to invalidate token");const r=await n.json();return console.log("invalidateToken",r),r}async function BY(e,t={}){if(!e)return null;let n="https://semaphor.cloud/api/v1/dashboard";const r=Object.fromEntries(Object.entries(t).filter(([a,l])=>l!==void 0)),o=new URLSearchParams(r).toString();o&&(n+=`?${o}`);let s=await(await fetch(n,{headers:{Authorization:`Bearer ${e}`}})).json();if("payload"in s){const a=await fO(atob(s.payload),e);s=JSON.parse(a.decryptedData)}return s}async function VY(e){return e?await(await fetch("https://semaphor.cloud/api/v1/plugins",{headers:{Authorization:`Bearer ${e}`}})).json():null}const I0=e=>/boolean/i.test(e)?"boolean":/date|timestamp/i.test(e)?"date":/int|decimal|float|double|num/i.test(e)?"number":/json/i.test(e)?"json":/geo|geography|geometry/i.test(e)?"geo":"string";var eb={exports:{}};eb.exports;(function(e,t){var n=200,r="__lodash_hash_undefined__",o=800,i=16,s=9007199254740991,a="[object Arguments]",l="[object Array]",c="[object AsyncFunction]",u="[object Boolean]",d="[object Date]",h="[object Error]",p="[object Function]",g="[object GeneratorFunction]",m="[object Map]",b="[object Number]",y="[object Null]",v="[object Object]",x="[object Proxy]",S="[object RegExp]",_="[object Set]",E="[object String]",C="[object Undefined]",k="[object WeakMap]",N="[object ArrayBuffer]",M="[object DataView]",A="[object Float32Array]",P="[object Float64Array]",j="[object Int8Array]",F="[object Int16Array]",I="[object Int32Array]",O="[object Uint8Array]",$="[object Uint8ClampedArray]",B="[object Uint16Array]",z="[object Uint32Array]",T=/[\\^$.*+?()[\]{}|]/g,W=/^\[object .+?Constructor\]$/,L=/^(?:0|[1-9]\d*)$/,D={};D[A]=D[P]=D[j]=D[F]=D[I]=D[O]=D[$]=D[B]=D[z]=!0,D[a]=D[l]=D[N]=D[u]=D[M]=D[d]=D[h]=D[p]=D[m]=D[b]=D[v]=D[S]=D[_]=D[E]=D[k]=!1;var H=typeof ls=="object"&&ls&&ls.Object===Object&&ls,V=typeof self=="object"&&self&&self.Object===Object&&self,q=H||V||Function("return this")(),U=t&&!t.nodeType&&t,Y=U&&!0&&e&&!e.nodeType&&e,K=Y&&Y.exports===U,Z=K&&H.process,ee=function(){try{var G=Y&&Y.require&&Y.require("util").types;return G||Z&&Z.binding&&Z.binding("util")}catch{}}(),Q=ee&&ee.isTypedArray;function ie(G,J,se){switch(se.length){case 0:return G.call(J);case 1:return G.call(J,se[0]);case 2:return G.call(J,se[0],se[1]);case 3:return G.call(J,se[0],se[1],se[2])}return G.apply(J,se)}function te(G,J){for(var se=-1,Ne=Array(G);++se<G;)Ne[se]=J(se);return Ne}function le(G){return function(J){return G(J)}}function ue(G,J){return G==null?void 0:G[J]}function Re(G,J){return function(se){return G(J(se))}}var be=Array.prototype,we=Function.prototype,Pe=Object.prototype,Ye=q["__core-js_shared__"],_t=we.toString,me=Pe.hasOwnProperty,je=function(){var G=/[^.]+$/.exec(Ye&&Ye.keys&&Ye.keys.IE_PROTO||"");return G?"Symbol(src)_1."+G:""}(),Ae=Pe.toString,ne=_t.call(Object),ce=RegExp("^"+_t.call(me).replace(T,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ke=K?q.Buffer:void 0,De=q.Symbol,Ue=q.Uint8Array;ke&&ke.allocUnsafe;var jt=Re(Object.getPrototypeOf,Object),kn=Object.create,gn=Pe.propertyIsEnumerable,ge=be.splice,bn=De?De.toStringTag:void 0,Ot=function(){try{var G=kv(Object,"defineProperty");return G({},"",{}),G}catch{}}(),uo=ke?ke.isBuffer:void 0,On=Math.max,Sc=Date.now,Va=kv(q,"Map"),Wi=kv(Object,"create"),an=function(){function G(){}return function(J){if(!Ua(J))return{};if(kn)return kn(J);G.prototype=J;var se=new G;return G.prototype=void 0,se}}();function Rt(G){var J=-1,se=G==null?0:G.length;for(this.clear();++J<se;){var Ne=G[J];this.set(Ne[0],Ne[1])}}function Fn(){this.__data__=Wi?Wi(null):{},this.size=0}function Ie(G){var J=this.has(G)&&delete this.__data__[G];return this.size-=J?1:0,J}function Ge(G){var J=this.__data__;if(Wi){var se=J[G];return se===r?void 0:se}return me.call(J,G)?J[G]:void 0}function rt(G){var J=this.__data__;return Wi?J[G]!==void 0:me.call(J,G)}function Jt(G,J){var se=this.__data__;return this.size+=this.has(G)?0:1,se[G]=Wi&&J===void 0?r:J,this}Rt.prototype.clear=Fn,Rt.prototype.delete=Ie,Rt.prototype.get=Ge,Rt.prototype.has=rt,Rt.prototype.set=Jt;function Ft(G){var J=-1,se=G==null?0:G.length;for(this.clear();++J<se;){var Ne=G[J];this.set(Ne[0],Ne[1])}}function Lt(){this.__data__=[],this.size=0}function Dn(G){var J=this.__data__,se=rm(J,G);if(se<0)return!1;var Ne=J.length-1;return se==Ne?J.pop():ge.call(J,se,1),--this.size,!0}function en(G){var J=this.__data__,se=rm(J,G);return se<0?void 0:J[se][1]}function yn(G){return rm(this.__data__,G)>-1}function Ha(G,J){var se=this.__data__,Ne=rm(se,G);return Ne<0?(++this.size,se.push([G,J])):se[Ne][1]=J,this}Ft.prototype.clear=Lt,Ft.prototype.delete=Dn,Ft.prototype.get=en,Ft.prototype.has=yn,Ft.prototype.set=Ha;function fo(G){var J=-1,se=G==null?0:G.length;for(this.clear();++J<se;){var Ne=G[J];this.set(Ne[0],Ne[1])}}function ri(){this.size=0,this.__data__={hash:new Rt,map:new(Va||Ft),string:new Rt}}function Wa(G){var J=im(this,G).delete(G);return this.size-=J?1:0,J}function Id(G){return im(this,G).get(G)}function kG(G){return im(this,G).has(G)}function NG(G,J){var se=im(this,G),Ne=se.size;return se.set(G,J),this.size+=se.size==Ne?0:1,this}fo.prototype.clear=ri,fo.prototype.delete=Wa,fo.prototype.get=Id,fo.prototype.has=kG,fo.prototype.set=NG;function Ec(G){var J=this.__data__=new Ft(G);this.size=J.size}function MG(){this.__data__=new Ft,this.size=0}function PG(G){var J=this.__data__,se=J.delete(G);return this.size=J.size,se}function DG(G){return this.__data__.get(G)}function AG(G){return this.__data__.has(G)}function IG(G,J){var se=this.__data__;if(se instanceof Ft){var Ne=se.__data__;if(!Va||Ne.length<n-1)return Ne.push([G,J]),this.size=++se.size,this;se=this.__data__=new fo(Ne)}return se.set(G,J),this.size=se.size,this}Ec.prototype.clear=MG,Ec.prototype.delete=PG,Ec.prototype.get=DG,Ec.prototype.has=AG,Ec.prototype.set=IG;function TG(G,J){var se=Pv(G),Ne=!se&&Mv(G),mt=!se&&!Ne&&xN(G),Bt=!se&&!Ne&&!mt&&CN(G),tn=se||Ne||mt||Bt,xt=tn?te(G.length,String):[],nn=xt.length;for(var Do in G)tn&&(Do=="length"||mt&&(Do=="offset"||Do=="parent")||Bt&&(Do=="buffer"||Do=="byteLength"||Do=="byteOffset")||yN(Do,nn))||xt.push(Do);return xt}function _v(G,J,se){(se!==void 0&&!sm(G[J],se)||se===void 0&&!(J in G))&&Rv(G,J,se)}function jG(G,J,se){var Ne=G[J];(!(me.call(G,J)&&sm(Ne,se))||se===void 0&&!(J in G))&&Rv(G,J,se)}function rm(G,J){for(var se=G.length;se--;)if(sm(G[se][0],J))return se;return-1}function Rv(G,J,se){J=="__proto__"&&Ot?Ot(G,J,{configurable:!0,enumerable:!0,value:se,writable:!0}):G[J]=se}var OG=KG();function om(G){return G==null?G===void 0?C:y:bn&&bn in Object(G)?XG(G):nq(G)}function gN(G){return Td(G)&&om(G)==a}function FG(G){if(!Ua(G)||eq(G))return!1;var J=Av(G)?ce:W;return J.test(sq(G))}function LG(G){return Td(G)&&wN(G.length)&&!!D[om(G)]}function $G(G){if(!Ua(G))return tq(G);var J=vN(G),se=[];for(var Ne in G)Ne=="constructor"&&(J||!me.call(G,Ne))||se.push(Ne);return se}function bN(G,J,se,Ne,mt){G!==J&&OG(J,function(Bt,tn){if(mt||(mt=new Ec),Ua(Bt))zG(G,J,tn,se,bN,Ne,mt);else{var xt=Ne?Ne(Nv(G,tn),Bt,tn+"",G,J,mt):void 0;xt===void 0&&(xt=Bt),_v(G,tn,xt)}},SN)}function zG(G,J,se,Ne,mt,Bt,tn){var xt=Nv(G,se),nn=Nv(J,se),Do=tn.get(nn);if(Do){_v(G,se,Do);return}var Ur=Bt?Bt(xt,nn,se+"",G,J,tn):void 0,jd=Ur===void 0;if(jd){var Iv=Pv(nn),Tv=!Iv&&xN(nn),_N=!Iv&&!Tv&&CN(nn);Ur=nn,Iv||Tv||_N?Pv(xt)?Ur=xt:aq(xt)?Ur=GG(xt):Tv?(jd=!1,Ur=HG(nn)):_N?(jd=!1,Ur=UG(nn)):Ur=[]:lq(nn)||Mv(nn)?(Ur=xt,Mv(xt)?Ur=cq(xt):(!Ua(xt)||Av(xt))&&(Ur=QG(nn))):jd=!1}jd&&(tn.set(nn,Ur),mt(Ur,nn,Ne,Bt,tn),tn.delete(nn)),_v(G,se,Ur)}function BG(G,J){return oq(rq(G,J,EN),G+"")}var VG=Ot?function(G,J){return Ot(G,"toString",{configurable:!0,enumerable:!1,value:dq(J),writable:!0})}:EN;function HG(G,J){return G.slice()}function WG(G){var J=new G.constructor(G.byteLength);return new Ue(J).set(new Ue(G)),J}function UG(G,J){var se=WG(G.buffer);return new G.constructor(se,G.byteOffset,G.length)}function GG(G,J){var se=-1,Ne=G.length;for(J||(J=Array(Ne));++se<Ne;)J[se]=G[se];return J}function qG(G,J,se,Ne){var mt=!se;se||(se={});for(var Bt=-1,tn=J.length;++Bt<tn;){var xt=J[Bt],nn=void 0;nn===void 0&&(nn=G[xt]),mt?Rv(se,xt,nn):jG(se,xt,nn)}return se}function YG(G){return BG(function(J,se){var Ne=-1,mt=se.length,Bt=mt>1?se[mt-1]:void 0,tn=mt>2?se[2]:void 0;for(Bt=G.length>3&&typeof Bt=="function"?(mt--,Bt):void 0,tn&&ZG(se[0],se[1],tn)&&(Bt=mt<3?void 0:Bt,mt=1),J=Object(J);++Ne<mt;){var xt=se[Ne];xt&&G(J,xt,Ne,Bt)}return J})}function KG(G){return function(J,se,Ne){for(var mt=-1,Bt=Object(J),tn=Ne(J),xt=tn.length;xt--;){var nn=tn[++mt];if(se(Bt[nn],nn,Bt)===!1)break}return J}}function im(G,J){var se=G.__data__;return JG(J)?se[typeof J=="string"?"string":"hash"]:se.map}function kv(G,J){var se=ue(G,J);return FG(se)?se:void 0}function XG(G){var J=me.call(G,bn),se=G[bn];try{G[bn]=void 0;var Ne=!0}catch{}var mt=Ae.call(G);return Ne&&(J?G[bn]=se:delete G[bn]),mt}function QG(G){return typeof G.constructor=="function"&&!vN(G)?an(jt(G)):{}}function yN(G,J){var se=typeof G;return J=J??s,!!J&&(se=="number"||se!="symbol"&&L.test(G))&&G>-1&&G%1==0&&G<J}function ZG(G,J,se){if(!Ua(se))return!1;var Ne=typeof J;return(Ne=="number"?Dv(se)&&yN(J,se.length):Ne=="string"&&J in se)?sm(se[J],G):!1}function JG(G){var J=typeof G;return J=="string"||J=="number"||J=="symbol"||J=="boolean"?G!=="__proto__":G===null}function eq(G){return!!je&&je in G}function vN(G){var J=G&&G.constructor,se=typeof J=="function"&&J.prototype||Pe;return G===se}function tq(G){var J=[];if(G!=null)for(var se in Object(G))J.push(se);return J}function nq(G){return Ae.call(G)}function rq(G,J,se){return J=On(J===void 0?G.length-1:J,0),function(){for(var Ne=arguments,mt=-1,Bt=On(Ne.length-J,0),tn=Array(Bt);++mt<Bt;)tn[mt]=Ne[J+mt];mt=-1;for(var xt=Array(J+1);++mt<J;)xt[mt]=Ne[mt];return xt[J]=se(tn),ie(G,this,xt)}}function Nv(G,J){if(!(J==="constructor"&&typeof G[J]=="function")&&J!="__proto__")return G[J]}var oq=iq(VG);function iq(G){var J=0,se=0;return function(){var Ne=Sc(),mt=i-(Ne-se);if(se=Ne,mt>0){if(++J>=o)return arguments[0]}else J=0;return G.apply(void 0,arguments)}}function sq(G){if(G!=null){try{return _t.call(G)}catch{}try{return G+""}catch{}}return""}function sm(G,J){return G===J||G!==G&&J!==J}var Mv=gN(function(){return arguments}())?gN:function(G){return Td(G)&&me.call(G,"callee")&&!gn.call(G,"callee")},Pv=Array.isArray;function Dv(G){return G!=null&&wN(G.length)&&!Av(G)}function aq(G){return Td(G)&&Dv(G)}var xN=uo||fq;function Av(G){if(!Ua(G))return!1;var J=om(G);return J==p||J==g||J==c||J==x}function wN(G){return typeof G=="number"&&G>-1&&G%1==0&&G<=s}function Ua(G){var J=typeof G;return G!=null&&(J=="object"||J=="function")}function Td(G){return G!=null&&typeof G=="object"}function lq(G){if(!Td(G)||om(G)!=v)return!1;var J=jt(G);if(J===null)return!0;var se=me.call(J,"constructor")&&J.constructor;return typeof se=="function"&&se instanceof se&&_t.call(se)==ne}var CN=Q?le(Q):LG;function cq(G){return qG(G,SN(G))}function SN(G){return Dv(G)?TG(G):$G(G)}var uq=YG(function(G,J,se){bN(G,J,se)});function dq(G){return function(){return G}}function EN(G){return G}function fq(){return!1}e.exports=uq})(eb,eb.exports);var HY=eb.exports;const Jf=Pa(HY),WY={theme:"system",setTheme:()=>null},gO=R.createContext(WY);function UY({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[o,i]=R.useState(()=>localStorage.getItem(n)||t);R.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 f.jsx(gO.Provider,{...r,value:s,children:e})}const bO=()=>{const e=R.useContext(gO);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};var sc=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(){}},Vl=typeof window>"u"||"Deno"in globalThis;function bo(){}function GY(e,t){return typeof e=="function"?e(t):e}function w1(e){return typeof e=="number"&&e>=0&&e!==1/0}function yO(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ru(e,t){return typeof e=="function"?e(t):e}function Fo(e,t){return typeof e=="function"?e(t):e}function UN(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==ME(s,t.options))return!1}else if(!eh(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||o&&o!==t.state.fetchStatus||i&&!i(t))}function GN(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Iu(t.options.mutationKey)!==Iu(i))return!1}else if(!eh(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function ME(e,t){return((t==null?void 0:t.queryKeyHashFn)||Iu)(e)}function Iu(e){return JSON.stringify(e,(t,n)=>C1(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function eh(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!eh(e[n],t[n])):!1}function tb(e,t){if(e===t)return e;const n=qN(e)&&qN(t);if(n||C1(e)&&C1(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&&r.includes(u)||n)&&e[u]===void 0&&t[u]===void 0?(a[u]=void 0,l++):(a[u]=tb(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return o===s&&l===o?e:a}return t}function nb(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function qN(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function C1(e){if(!YN(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!YN(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function YN(e){return Object.prototype.toString.call(e)==="[object Object]"}function qY(e){return new Promise(t=>{setTimeout(t,e)})}function S1(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return tb(e,t)}catch(r){console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${r}`)}return tb(e,t)}return t}function YY(e){return e}function KY(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function XY(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var rb=Symbol();function vO(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===rb&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===rb?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var gl,Gs,mu,Ij,QY=(Ij=class extends sc{constructor(){super();Me(this,gl);Me(this,Gs);Me(this,mu);xe(this,mu,t=>{if(!Vl&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){X(this,Gs)||this.setEventListener(X(this,mu))}onUnsubscribe(){var t;this.hasListeners()||((t=X(this,Gs))==null||t.call(this),xe(this,Gs,void 0))}setEventListener(t){var n;xe(this,mu,t),(n=X(this,Gs))==null||n.call(this),xe(this,Gs,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){X(this,gl)!==t&&(xe(this,gl,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof X(this,gl)=="boolean"?X(this,gl):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},gl=new WeakMap,Gs=new WeakMap,mu=new WeakMap,Ij),PE=new QY,gu,qs,bu,Tj,ZY=(Tj=class extends sc{constructor(){super();Me(this,gu,!0);Me(this,qs);Me(this,bu);xe(this,bu,t=>{if(!Vl&&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(){X(this,qs)||this.setEventListener(X(this,bu))}onUnsubscribe(){var t;this.hasListeners()||((t=X(this,qs))==null||t.call(this),xe(this,qs,void 0))}setEventListener(t){var n;xe(this,bu,t),(n=X(this,qs))==null||n.call(this),xe(this,qs,t(this.setOnline.bind(this)))}setOnline(t){X(this,gu)!==t&&(xe(this,gu,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return X(this,gu)}},gu=new WeakMap,qs=new WeakMap,bu=new WeakMap,Tj),ob=new ZY;function E1(){let e,t;const n=new Promise((o,i)=>{e=o,t=i});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function JY(e){return Math.min(1e3*2**e,3e4)}function xO(e){return(e??"online")==="online"?ob.isOnline():!0}var wO=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Wv(e){return e instanceof wO}function CO(e){let t=!1,n=0,r=!1,o;const i=E1(),s=m=>{var b;r||(h(new wO(m)),(b=e.abort)==null||b.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>PE.isFocused()&&(e.networkMode==="always"||ob.isOnline())&&e.canRun(),u=()=>xO(e.networkMode)&&e.canRun(),d=m=>{var b;r||(r=!0,(b=e.onSuccess)==null||b.call(e,m),o==null||o(),i.resolve(m))},h=m=>{var b;r||(r=!0,(b=e.onError)==null||b.call(e,m),o==null||o(),i.reject(m))},p=()=>new Promise(m=>{var b;o=y=>{(r||c())&&m(y)},(b=e.onPause)==null||b.call(e)}).then(()=>{var m;o=void 0,r||(m=e.onContinue)==null||m.call(e)}),g=()=>{if(r)return;let m;const b=n===0?e.initialPromise:void 0;try{m=b??e.fn()}catch(y){m=Promise.reject(y)}Promise.resolve(m).then(d).catch(y=>{var E;if(r)return;const v=e.retry??(Vl?0:3),x=e.retryDelay??JY,S=typeof x=="function"?x(n,y):x,_=v===!0||typeof v=="number"&&n<v||typeof v=="function"&&v(n,y);if(t||!_){h(y);return}n++,(E=e.onFail)==null||E.call(e,n,y),qY(S).then(()=>c()?void 0:p()).then(()=>{t?h(y):g()})})};return{promise:i,cancel:s,continue:()=>(o==null||o(),i),cancelRetry:a,continueRetry:l,canStart:u,start:()=>(u()?g():p().then(g),i)}}function eK(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=a=>setTimeout(a,0);const i=a=>{t?e.push(a):o(()=>{n(a)})},s=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||s()}return l},batchCalls:a=>(...l)=>{i(()=>{a(...l)})},schedule:i,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var pn=eK(),bl,jj,SO=(jj=class{constructor(){Me(this,bl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),w1(this.gcTime)&&xe(this,bl,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Vl?1/0:5*60*1e3))}clearGcTimeout(){X(this,bl)&&(clearTimeout(X(this,bl)),xe(this,bl,void 0))}},bl=new WeakMap,jj),yu,vu,po,yl,Yn,Uh,vl,jo,Xi,Oj,tK=(Oj=class extends SO{constructor(t){super();Me(this,jo);Me(this,yu);Me(this,vu);Me(this,po);Me(this,yl);Me(this,Yn);Me(this,Uh);Me(this,vl);xe(this,vl,!1),xe(this,Uh,t.defaultOptions),this.setOptions(t.options),this.observers=[],xe(this,yl,t.client),xe(this,po,X(this,yl).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,xe(this,yu,nK(this.options)),this.state=t.state??X(this,yu),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=X(this,Yn))==null?void 0:t.promise}setOptions(t){this.options={...X(this,Uh),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&X(this,po).remove(this)}setData(t,n){const r=S1(this.state.data,t,this.options);return He(this,jo,Xi).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){He(this,jo,Xi).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=X(this,Yn))==null?void 0:r.promise;return(o=X(this,Yn))==null||o.cancel(t),n?n.then(bo).catch(bo):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(X(this,yu))}isActive(){return this.observers.some(t=>Fo(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===rb||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!yO(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=X(this,Yn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=X(this,Yn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),X(this,po).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(X(this,Yn)&&(X(this,vl)?X(this,Yn).cancel({revert:!0}):X(this,Yn).cancelRetry()),this.scheduleGc()),X(this,po).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||He(this,jo,Xi).call(this,{type:"invalidate"})}fetch(t,n){var l,c,u;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(X(this,Yn))return X(this,Yn).continueRetry(),X(this,Yn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const d=this.observers.find(h=>h.options.queryFn);d&&this.setOptions(d.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,o=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(xe(this,vl,!0),r.signal)})},i=()=>{const d=vO(this.options,n),h={client:X(this,yl),queryKey:this.queryKey,meta:this.meta};return o(h),xe(this,vl,!1),this.options.persister?this.options.persister(d,h,this):d(h)},s={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:X(this,yl),state:this.state,fetchFn:i};o(s),(l=this.options.behavior)==null||l.onFetch(s,this),xe(this,vu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=s.fetchOptions)==null?void 0:c.meta))&&He(this,jo,Xi).call(this,{type:"fetch",meta:(u=s.fetchOptions)==null?void 0:u.meta});const a=d=>{var h,p,g,m;Wv(d)&&d.silent||He(this,jo,Xi).call(this,{type:"error",error:d}),Wv(d)||((p=(h=X(this,po).config).onError)==null||p.call(h,d,this),(m=(g=X(this,po).config).onSettled)==null||m.call(g,this.state.data,d,this)),this.scheduleGc()};return xe(this,Yn,CO({initialPromise:n==null?void 0:n.initialPromise,fn:s.fetchFn,abort:r.abort.bind(r),onSuccess:d=>{var h,p,g,m;if(d===void 0){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(d)}catch(b){a(b);return}(p=(h=X(this,po).config).onSuccess)==null||p.call(h,d,this),(m=(g=X(this,po).config).onSettled)==null||m.call(g,d,this.state.error,this),this.scheduleGc()},onError:a,onFail:(d,h)=>{He(this,jo,Xi).call(this,{type:"failed",failureCount:d,error:h})},onPause:()=>{He(this,jo,Xi).call(this,{type:"pause"})},onContinue:()=>{He(this,jo,Xi).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0})),X(this,Yn).start()}},yu=new WeakMap,vu=new WeakMap,po=new WeakMap,yl=new WeakMap,Yn=new WeakMap,Uh=new WeakMap,vl=new WeakMap,jo=new WeakSet,Xi=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,...EO(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return Wv(o)&&o.revert&&X(this,vu)?{...X(this,vu),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),pn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),X(this,po).notify({query:this,type:"updated",action:t})})},Oj);function EO(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:xO(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function nK(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var ai,Fj,_O=(Fj=class extends sc{constructor(t={}){super();Me(this,ai);this.config=t,xe(this,ai,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??ME(o,n);let s=this.get(i);return s||(s=new tK({client:t,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){X(this,ai).has(t.queryHash)||(X(this,ai).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=X(this,ai).get(t.queryHash);n&&(t.destroy(),n===t&&X(this,ai).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){pn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return X(this,ai).get(t)}getAll(){return[...X(this,ai).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>UN(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>UN(t,r)):n}notify(t){pn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){pn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){pn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},ai=new WeakMap,Fj),li,cr,xl,ci,$s,Lj,rK=(Lj=class extends SO{constructor(t){super();Me(this,ci);Me(this,li);Me(this,cr);Me(this,xl);this.mutationId=t.mutationId,xe(this,cr,t.mutationCache),xe(this,li,[]),this.state=t.state||RO(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){X(this,li).includes(t)||(X(this,li).push(t),this.clearGcTimeout(),X(this,cr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){xe(this,li,X(this,li).filter(n=>n!==t)),this.scheduleGc(),X(this,cr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){X(this,li).length||(this.state.status==="pending"?this.scheduleGc():X(this,cr).remove(this))}continue(){var t;return((t=X(this,xl))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,a,l,c,u,d,h,p,g,m,b,y,v,x,S,_,E,C;xe(this,xl,CO({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(k,N)=>{He(this,ci,$s).call(this,{type:"failed",failureCount:k,error:N})},onPause:()=>{He(this,ci,$s).call(this,{type:"pause"})},onContinue:()=>{He(this,ci,$s).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>X(this,cr).canRun(this)}));const n=this.state.status==="pending",r=!X(this,xl).canStart();try{if(!n){He(this,ci,$s).call(this,{type:"pending",variables:t,isPaused:r}),await((i=(o=X(this,cr).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&&He(this,ci,$s).call(this,{type:"pending",context:N,variables:t,isPaused:r})}const k=await X(this,xl).start();return await((c=(l=X(this,cr).config).onSuccess)==null?void 0:c.call(l,k,t,this.state.context,this)),await((d=(u=this.options).onSuccess)==null?void 0:d.call(u,k,t,this.state.context)),await((p=(h=X(this,cr).config).onSettled)==null?void 0:p.call(h,k,null,this.state.variables,this.state.context,this)),await((m=(g=this.options).onSettled)==null?void 0:m.call(g,k,null,t,this.state.context)),He(this,ci,$s).call(this,{type:"success",data:k}),k}catch(k){try{throw await((y=(b=X(this,cr).config).onError)==null?void 0:y.call(b,k,t,this.state.context,this)),await((x=(v=this.options).onError)==null?void 0:x.call(v,k,t,this.state.context)),await((_=(S=X(this,cr).config).onSettled)==null?void 0:_.call(S,void 0,k,this.state.variables,this.state.context,this)),await((C=(E=this.options).onSettled)==null?void 0:C.call(E,void 0,k,t,this.state.context)),k}finally{He(this,ci,$s).call(this,{type:"error",error:k})}}finally{X(this,cr).runNext(this)}}},li=new WeakMap,cr=new WeakMap,xl=new WeakMap,ci=new WeakSet,$s=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),pn.batch(()=>{X(this,li).forEach(r=>{r.onMutationUpdate(t)}),X(this,cr).notify({mutation:this,type:"updated",action:t})})},Lj);function RO(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ns,Oo,Gh,$j,oK=($j=class extends sc{constructor(t={}){super();Me(this,ns);Me(this,Oo);Me(this,Gh);this.config=t,xe(this,ns,new Set),xe(this,Oo,new Map),xe(this,Gh,0)}build(t,n,r){const o=new rK({mutationCache:this,mutationId:++am(this,Gh)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){X(this,ns).add(t);const n=cm(t);if(typeof n=="string"){const r=X(this,Oo).get(n);r?r.push(t):X(this,Oo).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(X(this,ns).delete(t)){const n=cm(t);if(typeof n=="string"){const r=X(this,Oo).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&X(this,Oo).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=cm(t);if(typeof n=="string"){const r=X(this,Oo).get(n),o=r==null?void 0:r.find(i=>i.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=cm(t);if(typeof n=="string"){const o=(r=X(this,Oo).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){pn.batch(()=>{X(this,ns).forEach(t=>{this.notify({type:"removed",mutation:t})}),X(this,ns).clear(),X(this,Oo).clear()})}getAll(){return Array.from(X(this,ns))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>GN(n,r))}findAll(t={}){return this.getAll().filter(n=>GN(t,n))}notify(t){pn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return pn.batch(()=>Promise.all(t.map(n=>n.continue().catch(bo))))}},ns=new WeakMap,Oo=new WeakMap,Gh=new WeakMap,$j);function cm(e){var t;return(t=e.options.scope)==null?void 0:t.id}function KN(e){return{onFetch:(t,n)=>{var u,d,h,p,g;const r=t.options,o=(h=(d=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:h.direction,i=((p=t.state.data)==null?void 0:p.pages)||[],s=((g=t.state.data)==null?void 0:g.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let m=!1;const b=x=>{Object.defineProperty(x,"signal",{enumerable:!0,get:()=>(t.signal.aborted?m=!0:t.signal.addEventListener("abort",()=>{m=!0}),t.signal)})},y=vO(t.options,t.fetchOptions),v=async(x,S,_)=>{if(m)return Promise.reject();if(S==null&&x.pages.length)return Promise.resolve(x);const E={client:t.client,queryKey:t.queryKey,pageParam:S,direction:_?"backward":"forward",meta:t.options.meta};b(E);const C=await y(E),{maxPages:k}=t.options,N=_?XY:KY;return{pages:N(x.pages,C,k),pageParams:N(x.pageParams,S,k)}};if(o&&i.length){const x=o==="backward",S=x?iK:XN,_={pages:i,pageParams:s},E=S(r,_);a=await v(_,E,x)}else{const x=e??i.length;do{const S=l===0?s[0]??r.initialPageParam:XN(r,a);if(l>0&&S==null)break;a=await v(a,S),l++}while(l<x)}return a};t.options.persister?t.fetchFn=()=>{var m,b;return(b=(m=t.options).persister)==null?void 0:b.call(m,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function XN(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function iK(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var ln,Ys,Ks,xu,wu,Xs,Cu,Su,zj,sK=(zj=class{constructor(e={}){Me(this,ln);Me(this,Ys);Me(this,Ks);Me(this,xu);Me(this,wu);Me(this,Xs);Me(this,Cu);Me(this,Su);xe(this,ln,e.queryCache||new _O),xe(this,Ys,e.mutationCache||new oK),xe(this,Ks,e.defaultOptions||{}),xe(this,xu,new Map),xe(this,wu,new Map),xe(this,Xs,0)}mount(){am(this,Xs)._++,X(this,Xs)===1&&(xe(this,Cu,PE.subscribe(async e=>{e&&(await this.resumePausedMutations(),X(this,ln).onFocus())})),xe(this,Su,ob.subscribe(async e=>{e&&(await this.resumePausedMutations(),X(this,ln).onOnline())})))}unmount(){var e,t;am(this,Xs)._--,X(this,Xs)===0&&((e=X(this,Cu))==null||e.call(this),xe(this,Cu,void 0),(t=X(this,Su))==null||t.call(this),xe(this,Su,void 0))}isFetching(e){return X(this,ln).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return X(this,Ys).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=X(this,ln).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=X(this,ln).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(ru(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return X(this,ln).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=X(this,ln).get(r.queryHash),i=o==null?void 0:o.state.data,s=GY(t,i);if(s!==void 0)return X(this,ln).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return pn.batch(()=>X(this,ln).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=X(this,ln).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=X(this,ln);pn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=X(this,ln);return pn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=pn.batch(()=>X(this,ln).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(bo).catch(bo)}invalidateQueries(e,t={}){return pn.batch(()=>(X(this,ln).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=pn.batch(()=>X(this,ln).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(bo)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(bo)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=X(this,ln).build(this,t);return n.isStaleByTime(ru(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(bo).catch(bo)}fetchInfiniteQuery(e){return e.behavior=KN(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(bo).catch(bo)}ensureInfiniteQueryData(e){return e.behavior=KN(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ob.isOnline()?X(this,Ys).resumePausedMutations():Promise.resolve()}getQueryCache(){return X(this,ln)}getMutationCache(){return X(this,Ys)}getDefaultOptions(){return X(this,Ks)}setDefaultOptions(e){xe(this,Ks,e)}setQueryDefaults(e,t){X(this,xu).set(Iu(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...X(this,xu).values()],n={};return t.forEach(r=>{eh(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){X(this,wu).set(Iu(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...X(this,wu).values()],n={};return t.forEach(r=>{eh(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...X(this,Ks).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=ME(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===rb&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...X(this,Ks).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){X(this,ln).clear(),X(this,Ys).clear()}},ln=new WeakMap,Ys=new WeakMap,Ks=new WeakMap,xu=new WeakMap,wu=new WeakMap,Xs=new WeakMap,Cu=new WeakMap,Su=new WeakMap,zj),Ar,ft,qh,ur,wl,Eu,Qs,ui,Yh,_u,Ru,Cl,Sl,Zs,ku,It,nf,_1,R1,k1,N1,M1,P1,D1,kO,Bj,DE=(Bj=class extends sc{constructor(t,n){super();Me(this,It);Me(this,Ar);Me(this,ft);Me(this,qh);Me(this,ur);Me(this,wl);Me(this,Eu);Me(this,Qs);Me(this,ui);Me(this,Yh);Me(this,_u);Me(this,Ru);Me(this,Cl);Me(this,Sl);Me(this,Zs);Me(this,ku,new Set);this.options=n,xe(this,Ar,t),xe(this,ui,null),xe(this,Qs,E1()),this.options.experimental_prefetchInRender||X(this,Qs).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(X(this,ft).addObserver(this),QN(X(this,ft),this.options)?He(this,It,nf).call(this):this.updateResult(),He(this,It,N1).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return A1(X(this,ft),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return A1(X(this,ft),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,He(this,It,M1).call(this),He(this,It,P1).call(this),X(this,ft).removeObserver(this)}setOptions(t,n){const r=this.options,o=X(this,ft);if(this.options=X(this,Ar).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Fo(this.options.enabled,X(this,ft))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");He(this,It,D1).call(this),X(this,ft).setOptions(this.options),r._defaulted&&!nb(this.options,r)&&X(this,Ar).getQueryCache().notify({type:"observerOptionsUpdated",query:X(this,ft),observer:this});const i=this.hasListeners();i&&ZN(X(this,ft),o,this.options,r)&&He(this,It,nf).call(this),this.updateResult(n),i&&(X(this,ft)!==o||Fo(this.options.enabled,X(this,ft))!==Fo(r.enabled,X(this,ft))||ru(this.options.staleTime,X(this,ft))!==ru(r.staleTime,X(this,ft)))&&He(this,It,_1).call(this);const s=He(this,It,R1).call(this);i&&(X(this,ft)!==o||Fo(this.options.enabled,X(this,ft))!==Fo(r.enabled,X(this,ft))||s!==X(this,Zs))&&He(this,It,k1).call(this,s)}getOptimisticResult(t){const n=X(this,Ar).getQueryCache().build(X(this,Ar),t),r=this.createResult(n,t);return lK(this,r)&&(xe(this,ur,r),xe(this,Eu,this.options),xe(this,wl,X(this,ft).state)),r}getCurrentResult(){return X(this,ur)}trackResult(t,n){const r={};return Object.keys(t).forEach(o=>{Object.defineProperty(r,o,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(o),n==null||n(o),t[o])})}),r}trackProp(t){X(this,ku).add(t)}getCurrentQuery(){return X(this,ft)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=X(this,Ar).defaultQueryOptions(t),r=X(this,Ar).getQueryCache().build(X(this,Ar),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return He(this,It,nf).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),X(this,ur)))}createResult(t,n){var k;const r=X(this,ft),o=this.options,i=X(this,ur),s=X(this,wl),a=X(this,Eu),c=t!==r?t.state:X(this,qh),{state:u}=t;let d={...u},h=!1,p;if(n._optimisticResults){const N=this.hasListeners(),M=!N&&QN(t,n),A=N&&ZN(t,r,n,o);(M||A)&&(d={...d,...EO(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:g,errorUpdatedAt:m,status:b}=d;if(n.select&&d.data!==void 0)if(i&&d.data===(s==null?void 0:s.data)&&n.select===X(this,Yh))p=X(this,_u);else try{xe(this,Yh,n.select),p=n.select(d.data),p=S1(i==null?void 0:i.data,p,n),xe(this,_u,p),xe(this,ui,null)}catch(N){xe(this,ui,N)}else p=d.data;if(n.placeholderData!==void 0&&p===void 0&&b==="pending"){let N;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))N=i.data;else if(N=typeof n.placeholderData=="function"?n.placeholderData((k=X(this,Ru))==null?void 0:k.state.data,X(this,Ru)):n.placeholderData,n.select&&N!==void 0)try{N=n.select(N),xe(this,ui,null)}catch(M){xe(this,ui,M)}N!==void 0&&(b="success",p=S1(i==null?void 0:i.data,N,n),h=!0)}X(this,ui)&&(g=X(this,ui),p=X(this,_u),m=Date.now(),b="error");const y=d.fetchStatus==="fetching",v=b==="pending",x=b==="error",S=v&&y,_=p!==void 0,C={status:b,fetchStatus:d.fetchStatus,isPending:v,isSuccess:b==="success",isError:x,isInitialLoading:S,isLoading:S,data:p,dataUpdatedAt:d.dataUpdatedAt,error:g,errorUpdatedAt:m,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:y,isRefetching:y&&!v,isLoadingError:x&&!_,isPaused:d.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:x&&_,isStale:AE(t,n),refetch:this.refetch,promise:X(this,Qs)};if(this.options.experimental_prefetchInRender){const N=P=>{C.status==="error"?P.reject(C.error):C.data!==void 0&&P.resolve(C.data)},M=()=>{const P=xe(this,Qs,C.promise=E1());N(P)},A=X(this,Qs);switch(A.status){case"pending":t.queryHash===r.queryHash&&N(A);break;case"fulfilled":(C.status==="error"||C.data!==A.value)&&M();break;case"rejected":(C.status!=="error"||C.error!==A.reason)&&M();break}}return C}updateResult(t){const n=X(this,ur),r=this.createResult(X(this,ft),this.options);if(xe(this,wl,X(this,ft).state),xe(this,Eu,this.options),X(this,wl).data!==void 0&&xe(this,Ru,X(this,ft)),nb(r,n))return;xe(this,ur,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!X(this,ku).size)return!0;const l=new Set(a??X(this,ku));return this.options.throwOnError&&l.add("error"),Object.keys(X(this,ur)).some(c=>{const u=c;return X(this,ur)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),He(this,It,kO).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&He(this,It,N1).call(this)}},Ar=new WeakMap,ft=new WeakMap,qh=new WeakMap,ur=new WeakMap,wl=new WeakMap,Eu=new WeakMap,Qs=new WeakMap,ui=new WeakMap,Yh=new WeakMap,_u=new WeakMap,Ru=new WeakMap,Cl=new WeakMap,Sl=new WeakMap,Zs=new WeakMap,ku=new WeakMap,It=new WeakSet,nf=function(t){He(this,It,D1).call(this);let n=X(this,ft).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(bo)),n},_1=function(){He(this,It,M1).call(this);const t=ru(this.options.staleTime,X(this,ft));if(Vl||X(this,ur).isStale||!w1(t))return;const r=yO(X(this,ur).dataUpdatedAt,t)+1;xe(this,Cl,setTimeout(()=>{X(this,ur).isStale||this.updateResult()},r))},R1=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(X(this,ft)):this.options.refetchInterval)??!1},k1=function(t){He(this,It,P1).call(this),xe(this,Zs,t),!(Vl||Fo(this.options.enabled,X(this,ft))===!1||!w1(X(this,Zs))||X(this,Zs)===0)&&xe(this,Sl,setInterval(()=>{(this.options.refetchIntervalInBackground||PE.isFocused())&&He(this,It,nf).call(this)},X(this,Zs)))},N1=function(){He(this,It,_1).call(this),He(this,It,k1).call(this,He(this,It,R1).call(this))},M1=function(){X(this,Cl)&&(clearTimeout(X(this,Cl)),xe(this,Cl,void 0))},P1=function(){X(this,Sl)&&(clearInterval(X(this,Sl)),xe(this,Sl,void 0))},D1=function(){const t=X(this,Ar).getQueryCache().build(X(this,Ar),this.options);if(t===X(this,ft))return;const n=X(this,ft);xe(this,ft,t),xe(this,qh,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},kO=function(t){pn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(X(this,ur))}),X(this,Ar).getQueryCache().notify({query:X(this,ft),type:"observerResultsUpdated"})})},Bj);function aK(e,t){return Fo(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function QN(e,t){return aK(e,t)||e.state.data!==void 0&&A1(e,t,t.refetchOnMount)}function A1(e,t,n){if(Fo(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&AE(e,t)}return!1}function ZN(e,t,n,r){return(e!==t||Fo(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&AE(e,n)}function AE(e,t){return Fo(t.enabled,e)!==!1&&e.isStaleByTime(ru(t.staleTime,e))}function lK(e,t){return!nb(e.getCurrentResult(),t)}function JN(e,t){return e.filter(n=>!t.includes(n))}function cK(e,t,n){const r=e.slice(0);return r[t]=n,r}var El,mo,Nu,Mu,go,Js,Kh,Xh,Qh,Wn,I1,T1,j1,O1,F1,Vj,uK=(Vj=class extends sc{constructor(t,n,r){super();Me(this,Wn);Me(this,El);Me(this,mo);Me(this,Nu);Me(this,Mu);Me(this,go);Me(this,Js);Me(this,Kh);Me(this,Xh);Me(this,Qh,[]);xe(this,El,t),xe(this,Mu,r),xe(this,Nu,[]),xe(this,go,[]),xe(this,mo,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&X(this,go).forEach(t=>{t.subscribe(n=>{He(this,Wn,O1).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,X(this,go).forEach(t=>{t.destroy()})}setQueries(t,n,r){if(xe(this,Nu,t),xe(this,Mu,n),process.env.NODE_ENV!=="production"){const o=t.map(i=>X(this,El).defaultQueryOptions(i).queryHash);new Set(o).size!==o.length&&console.warn("[QueriesObserver]: Duplicate Queries found. This might result in unexpected behavior.")}pn.batch(()=>{const o=X(this,go),i=He(this,Wn,j1).call(this,X(this,Nu));xe(this,Qh,i),i.forEach(c=>c.observer.setOptions(c.defaultedQueryOptions,r));const s=i.map(c=>c.observer),a=s.map(c=>c.getCurrentResult()),l=s.some((c,u)=>c!==o[u]);o.length===s.length&&!l||(xe(this,go,s),xe(this,mo,a),this.hasListeners()&&(JN(o,s).forEach(c=>{c.destroy()}),JN(s,o).forEach(c=>{c.subscribe(u=>{He(this,Wn,O1).call(this,c,u)})}),He(this,Wn,F1).call(this)))})}getCurrentResult(){return X(this,mo)}getQueries(){return X(this,go).map(t=>t.getCurrentQuery())}getObservers(){return X(this,go)}getOptimisticResult(t,n){const r=He(this,Wn,j1).call(this,t),o=r.map(i=>i.observer.getOptimisticResult(i.defaultedQueryOptions));return[o,i=>He(this,Wn,T1).call(this,i??o,n),()=>He(this,Wn,I1).call(this,o,r)]}},El=new WeakMap,mo=new WeakMap,Nu=new WeakMap,Mu=new WeakMap,go=new WeakMap,Js=new WeakMap,Kh=new WeakMap,Xh=new WeakMap,Qh=new WeakMap,Wn=new WeakSet,I1=function(t,n){return n.map((r,o)=>{const i=t[o];return r.defaultedQueryOptions.notifyOnChangeProps?i:r.observer.trackResult(i,s=>{n.forEach(a=>{a.observer.trackProp(s)})})})},T1=function(t,n){return n?((!X(this,Js)||X(this,mo)!==X(this,Xh)||n!==X(this,Kh))&&(xe(this,Kh,n),xe(this,Xh,X(this,mo)),xe(this,Js,tb(X(this,Js),n(t)))),X(this,Js)):t},j1=function(t){const n=new Map(X(this,go).map(o=>[o.options.queryHash,o])),r=[];return t.forEach(o=>{const i=X(this,El).defaultQueryOptions(o),s=n.get(i.queryHash);s?r.push({defaultedQueryOptions:i,observer:s}):r.push({defaultedQueryOptions:i,observer:new DE(X(this,El),i)})}),r},O1=function(t,n){const r=X(this,go).indexOf(t);r!==-1&&(xe(this,mo,cK(X(this,mo),r,n)),He(this,Wn,F1).call(this))},F1=function(){var t;if(this.hasListeners()){const n=X(this,Js),r=He(this,Wn,I1).call(this,X(this,mo),X(this,Qh)),o=He(this,Wn,T1).call(this,r,(t=X(this,Mu))==null?void 0:t.combine);n!==o&&pn.batch(()=>{this.listeners.forEach(i=>{i(X(this,mo))})})}},Vj),IE=w.createContext(void 0),tp=e=>{const t=w.useContext(IE);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},dK=({client:e,children:t})=>(w.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),f.jsx(IE.Provider,{value:e,children:t})),NO=w.createContext(!1),MO=()=>w.useContext(NO);NO.Provider;function fK(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var hK=w.createContext(fK()),PO=()=>w.useContext(hK);function DO(e,t){return typeof e=="function"?e(...t):!!e}function ib(){}var AO=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},IO=e=>{w.useEffect(()=>{e.clearReset()},[e])},TO=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||DO(n,[e.error,r])),jO=e=>{const t=e.staleTime;e.suspense&&(e.staleTime=typeof t=="function"?(...n)=>Math.max(t(...n),1e3):Math.max(t??1e3,1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},OO=(e,t)=>e.isLoading&&e.isFetching&&!t,L1=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,sb=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function pK({queries:e,...t},n){const r=tp(),o=MO(),i=PO(),s=w.useMemo(()=>e.map(m=>{const b=r.defaultQueryOptions(m);return b._optimisticResults=o?"isRestoring":"optimistic",b}),[e,r,o]);s.forEach(m=>{jO(m),AO(m,i)}),IO(i);const[a]=w.useState(()=>new uK(r,s,t)),[l,c,u]=a.getOptimisticResult(s,t.combine),d=!o&&t.subscribed!==!1;w.useSyncExternalStore(w.useCallback(m=>d?a.subscribe(pn.batchCalls(m)):ib,[a,d]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),w.useEffect(()=>{a.setQueries(s,t,{listeners:!1})},[s,t,a]);const p=l.some((m,b)=>L1(s[b],m))?l.flatMap((m,b)=>{const y=s[b];if(y){const v=new DE(r,y);if(L1(y,m))return sb(y,v,i);OO(m,o)&&sb(y,v,i)}return[]}):[];if(p.length>0)throw Promise.all(p);const g=l.find((m,b)=>{const y=s[b];return y&&TO({result:m,errorResetBoundary:i,throwOnError:y.throwOnError,query:r.getQueryCache().get(y.queryHash),suspense:y.suspense})});if(g!=null&&g.error)throw g.error;return c(u())}function mK(e,t,n){var d,h,p,g,m;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=tp(),o=MO(),i=PO(),s=r.defaultQueryOptions(e);(h=(d=r.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||h.call(d,s),process.env.NODE_ENV!=="production"&&(s.queryFn||console.error(`[${s.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),s._optimisticResults=o?"isRestoring":"optimistic",jO(s),AO(s,i),IO(i);const a=!r.getQueryCache().get(s.queryHash),[l]=w.useState(()=>new t(r,s)),c=l.getOptimisticResult(s),u=!o&&e.subscribed!==!1;if(w.useSyncExternalStore(w.useCallback(b=>{const y=u?l.subscribe(pn.batchCalls(b)):ib;return l.updateResult(),y},[l,u]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),w.useEffect(()=>{l.setOptions(s,{listeners:!1})},[s,l]),L1(s,c))throw sb(s,l,i);if(TO({result:c,errorResetBoundary:i,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash),suspense:s.suspense}))throw c.error;if((g=(p=r.getDefaultOptions().queries)==null?void 0:p._experimental_afterQuery)==null||g.call(p,s,c),s.experimental_prefetchInRender&&!Vl&&OO(c,o)){const b=a?sb(s,l,i):(m=r.getQueryCache().get(s.queryHash))==null?void 0:m.promise;b==null||b.catch(ib).finally(()=>{l.updateResult()})}return s.notifyOnChangeProps?c:l.trackResult(c)}function Tn(e,t){return mK(e,DE)}function gK(){const e=R.useContext(IE);if(e&&e.isSemaphorClient)return e}function FO({children:e}){const{setIsSessionExpired:t}=on(),n=gK(),[r]=R.useState(()=>{const o=new sK({queryCache:new _O({onError:i=>{i instanceof Error?(console.error(`Something went wrong: ${i.message}`),i.message==="invalid token"&&t(!0)):console.error("Something went wrong:",i)}}),defaultOptions:{queries:{gcTime:36e5,staleTime:3e5,refetchOnWindowFocus:!1,retry:1}}});return o.isSemaphorClient=!0,o});return n?f.jsx(f.Fragment,{children:e}):f.jsx(dK,{client:r,children:e})}const Qo=R.forwardRef(({children:e,className:t,...n},r)=>f.jsx("div",{className:re("semaphor-scope",t),ref:r,...n,children:e})),bK={id:"",authToken:void 0,tokenProps:{}},TE=R.createContext(bK),LO=({children:e,dashboardProps:t})=>{const n=R.useMemo(()=>{let r={};const o=t.authToken;return o&&(r=Zh(o.accessToken)),{...t,tokenProps:r}},[t]);return f.jsx(FO,{children:f.jsx(TE.Provider,{value:n,children:f.jsx(Qo,{style:{height:"100%"},children:e})})})};function ir(){const e=R.useContext(TE);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}const sd=Es()(Jh(e=>({selectedDashboard:null,selectedVisual:null,lastSelectedDashboard:null,lastSelectedVisual:null,actions:{selectDashboard:t=>{e(n=>{var r;((r=n.selectedDashboard)==null?void 0:r.id)!==t.id&&(n.lastSelectedDashboard=n.selectedDashboard,n.selectedDashboard=t)})},selectVisual:t=>{e(n=>{n.lastSelectedVisual=n.selectedVisual,n.selectedVisual=t})},clearSelectedDashboard:()=>{e(t=>{t.lastSelectedDashboard=t.selectedDashboard,t.selectedDashboard=null})},clearSelectedVisual:()=>{e(t=>{t.lastSelectedVisual=t.selectedVisual,t.selectedVisual=null})}}}))),yK=()=>sd(e=>e.selectedVisual),vK=()=>sd(e=>e.actions),xK=e=>sd(t=>{var n;return((n=t.selectedDashboard)==null?void 0:n.id)===e}),wK=e=>sd(t=>{var n;return((n=t.selectedVisual)==null?void 0:n.id)===e});function CK(){const e=sd(c=>c.selectedDashboard),{authToken:t,version:n}=ir(),r=oe(c=>c.selectedLensId);function o(){if(!(t!=null&&t.accessToken))return!1}const{data:i,isLoading:s,isFetching:a,isError:l}=Tn({queryKey:["dashboard",r,t==null?void 0:t.accessToken,e==null?void 0:e.id],queryFn:()=>BY(t==null?void 0:t.accessToken,{lensId:r,version:n,dashboardId:e==null?void 0:e.id}),enabled:o()});return{data:i,isLoading:s,isFetching:a,isError:l}}function SK(){const{authToken:e}=ir(),t=oe(r=>r.authToken),{setAuthToken:n}=on();return R.useEffect(()=>{e&&(e==null?void 0:e.toString())!==(t==null?void 0:t.toString())&&n(e)},[e,t,n]),e}const $O=(e,t)=>{const n={};if(e===null||t===null)return t;const r=new Set([...Object.keys(e),...Object.keys(t)]);for(const o of r){if(!(o in e)&&o in t){n[o]=t[o];continue}if(o in e&&!(o in t)){n[o]=void 0;continue}const i=e[o],s=t[o];if(!$1(i,s))if(Array.isArray(i)&&Array.isArray(s))n[o]=s;else if(eM(i)&&eM(s)){const a=$O(i,s);Object.keys(a).length>0&&(n[o]=a)}else n[o]=s}return n},$1=(e,t)=>{if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((o,i)=>$1(o,t[i]));const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(o=>$1(e[o],t[o]))}return!1},eM=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),th=e=>{if(e===null||typeof e!="object")return e;if(e instanceof Date)return new Date(e);if(e instanceof RegExp)return new RegExp(e);if(Array.isArray(e))return e.map(n=>th(n));const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=th(e[n]));return t};function zO(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function tM(e,t){const n=zO(e);return n==="dark"?Jf({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function EK({customStyle:e,currentTheme:t,onSave:n,onEvent:r,defaultFilterValues:o,selectedSheetId:i,onFilterValuesChange:s}){const{authToken:a}=ir();SK();const l=oe(O=>O.selectedLensId),{data:c,isLoading:u,isFetching:d,isError:h}=CK(),[p,g]=R.useState(o||[]),{theme:m,setTheme:b}=bO(),y=oe(O=>O.dashboard.globalStyle),{setDashboard:v,setDashboardWithFilterValues:x,setSelectedSheetId:S,setStyle:_,setOnSaveFunction:E,setLenses:C,setSelectedLensId:k,setInitStore:N}=on();oe(O=>O.actions.setCustomCards);const M=oe(O=>O.actions.setFilterValues),A=oe(O=>O.filterValues),P=oe(O=>O.actions.setThemeStyle),j=oe(O=>O.actions.setDashboardTheme),F=oe(O=>O.actions.setOnEvent);R.useEffect(()=>{a&&N()},[a,N]),R.useEffect(()=>{if(m){const O=zO(m);j(O)}},[m,j]),R.useEffect(()=>{t&&b(t)},[t,b]);const I=R.useCallback(()=>{const O=th(Jg),$=Jf(O,y);if(e){const B=Jf($,e),z=tM(m,B);P(z),_(B)}else{const B=tM(m,$);P(B),_(Jg)}},[m,e,y,P,_]);return R.useEffect(()=>{c&&c.dashboard&&I()},[m,e,y,I,c]),R.useEffect(()=>{var L,D;function O(H,V){const q=H.filters||[],U=[];for(const Y of V){const K=q.find(Z=>Z.id===Y.filterId);K&&U.push({filterId:Y.filterId,connectionType:K.database==="NA"?"api":"database",name:K.column,operation:K.operation,valueType:nu(K),values:Y.values})}return U}if(!c||!c.dashboard)return;const{dashboard:$,filterValues:B,defaultLensId:z,lenses:T}=c;function W(){var V;if(B&&(B==null?void 0:B.length)>0)return B;const H=O($,p||[]);return H&&(H==null?void 0:H.length)>0?H:$.defaultFilterValues&&((V=$.defaultFilterValues)==null?void 0:V.length)>0?$.defaultFilterValues:[]}x($,W()),T&&C(T),z&&k(z),S(i||((D=(L=$==null?void 0:$.sheets)==null?void 0:L[0])==null?void 0:D.id)||null)},[c,v,S,M,l,C,x,k,p,i]),R.useEffect(()=>{s&&A&&s(A)},[A,s]),R.useEffect(()=>{n&&E(n),r&&F(r)},[n,E,r,F]),{isFetching:d,isLoading:u,isError:h}}function ms({className:e,...t}){return f.jsx("div",{className:re("animate-pulse rounded-md bg-muted",e),...t})}const ab=w.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:re("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));ab.displayName="Card";const Tu=w.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:re("flex flex-col space-y-1.5 p-6",e),...t}));Tu.displayName="CardHeader";const fa=w.forwardRef(({className:e,...t},n)=>f.jsx("h3",{ref:n,className:re("text-2xl font-semibold leading-none tracking-tight",e),...t}));fa.displayName="CardTitle";const jE=w.forwardRef(({className:e,...t},n)=>f.jsx("p",{ref:n,className:re("text-sm text-muted-foreground",e),...t}));jE.displayName="CardDescription";const nh=w.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:re("px-6 pt-0",e),...t}));nh.displayName="CardContent";const BO=w.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:re("flex items-center p-6 pt-0",e),...t}));BO.displayName="CardFooter";function VO({className:e,customStyle:t,onSave:n,onEvent:r,LoadingComponent:o,ErrorComponent:i,onChartElementClicked:s,id:a,authToken:l,currentTheme:c,version:u,customCards:d,showAssistant:h,defaultFilterValues:p,onFilterValuesChange:g,selectedSheetId:m,eventHandlers:b,...y}){const{placeholders:v}=ir(),x=oe(C=>C.themeStyle),S=oe(C=>C.isSessionExpired),{isLoading:_,isError:E}=EK({customStyle:t,currentTheme:c,onSave:n,onEvent:r,defaultFilterValues:p,onFilterValuesChange:g,selectedSheetId:m});return _||!l?(r==null||r({type:"info",message:"Loading dashboard"}),o?f.jsx(o,{message:"loading"}):f.jsx("div",{className:"flex items-center gap-3",children:f.jsx(ms,{className:"h-1 w-full dark:h-[2px]"})})):E?(r==null||r({type:"error",message:"Error fetching dashboard"}),i?(console.log("Error fetching dashboard"),f.jsx(i,{})):f.jsx("div",{children:"Error"})):S?(r==null||r({type:"error",message:"Session Expired"}),v!=null&&v.SessionExpired?f.jsx("div",{className:"flex h-full items-center justify-center",children:f.jsx("div",{children:v.SessionExpired})}):f.jsx("div",{className:"flex h-full items-center justify-center",children:f.jsxs("div",{className:"space-y-4 rounded-md border border-muted p-10",children:[f.jsx(fa,{children:"Session Expired"}),f.jsx("p",{className:"text-muted-foreground",children:"Please refresh your page to continue"})]})})):f.jsx("div",{className:re("isolate flex grow flex-col",x==null?void 0:x.dashboardPanel,e),style:{},"data-role":"dashboard-panel",...y})}function fe(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 _K(e,t){const n=w.createContext(t),r=i=>{const{children:s,...a}=i,l=w.useMemo(()=>a,Object.values(a));return f.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function o(i){const s=w.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function Pn(e,t=[]){let n=[];function r(i,s){const a=w.createContext(s),l=n.length;n=[...n,s];const c=d=>{var y;const{scope:h,children:p,...g}=d,m=((y=h==null?void 0:h[e])==null?void 0:y[l])||a,b=w.useMemo(()=>g,Object.values(g));return f.jsx(m.Provider,{value:b,children:p})};c.displayName=i+"Provider";function u(d,h){var m;const p=((m=h==null?void 0:h[e])==null?void 0:m[l])||a,g=w.useContext(p);if(g)return g;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[c,u]}const o=()=>{const i=n.map(s=>w.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return w.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,RK(o,...t)]}function RK(...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 d=l(i)[`__scope${c}`];return{...a,...d}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function nM(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function vr(...e){return t=>{let n=!1;const r=e.map(o=>{const i=nM(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():nM(e[o],null)}}}}function Ve(...e){return w.useCallback(vr(...e),e)}var z1=w.forwardRef((e,t)=>{const{children:n,...r}=e,o=w.Children.toArray(n),i=o.find(NK);if(i){const s=i.props.children,a=o.map(l=>l===i?w.Children.count(s)>1?w.Children.only(null):w.isValidElement(s)?s.props.children:null:l);return f.jsx(B1,{...r,ref:t,children:w.isValidElement(s)?w.cloneElement(s,void 0,a):null})}return f.jsx(B1,{...r,ref:t,children:n})});z1.displayName="Slot";var B1=w.forwardRef((e,t)=>{const{children:n,...r}=e;if(w.isValidElement(n)){const o=PK(n),i=MK(r,n.props);return n.type!==w.Fragment&&(i.ref=t?vr(t,o):o),w.cloneElement(n,i)}return w.Children.count(n)>1?w.Children.only(null):null});B1.displayName="SlotClone";var kK=({children:e})=>f.jsx(f.Fragment,{children:e});function NK(e){return w.isValidElement(e)&&e.type===kK}function MK(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 PK(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function T0(e){const t=e+"CollectionProvider",[n,r]=Pn(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=p=>{const{scope:g,children:m}=p,b=R.useRef(null),y=R.useRef(new Map).current;return f.jsx(o,{scope:g,itemMap:y,collectionRef:b,children:m})};s.displayName=t;const a=e+"CollectionSlot",l=R.forwardRef((p,g)=>{const{scope:m,children:b}=p,y=i(a,m),v=Ve(g,y.collectionRef);return f.jsx(z1,{ref:v,children:b})});l.displayName=a;const c=e+"CollectionItemSlot",u="data-radix-collection-item",d=R.forwardRef((p,g)=>{const{scope:m,children:b,...y}=p,v=R.useRef(null),x=Ve(g,v),S=i(c,m);return R.useEffect(()=>(S.itemMap.set(v,{ref:v,...y}),()=>void S.itemMap.delete(v))),f.jsx(z1,{[u]:"",ref:x,children:b})});d.displayName=c;function h(p){const g=i(e+"CollectionConsumer",p);return R.useCallback(()=>{const b=g.collectionRef.current;if(!b)return[];const y=Array.from(b.querySelectorAll(`[${u}]`));return Array.from(g.itemMap.values()).sort((S,_)=>y.indexOf(S.ref.current)-y.indexOf(_.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:s,Slot:l,ItemSlot:d},h,r]}var Vn=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{},DK=w.useId||(()=>{}),AK=0;function _n(e){const[t,n]=w.useState(DK());return Vn(()=>{n(r=>r??String(AK++))},[e]),t?`radix-${t}`:""}var HO=w.forwardRef((e,t)=>{const{children:n,...r}=e,o=w.Children.toArray(n),i=o.find(TK);if(i){const s=i.props.children,a=o.map(l=>l===i?w.Children.count(s)>1?w.Children.only(null):w.isValidElement(s)?s.props.children:null:l);return f.jsx(V1,{...r,ref:t,children:w.isValidElement(s)?w.cloneElement(s,void 0,a):null})}return f.jsx(V1,{...r,ref:t,children:n})});HO.displayName="Slot";var V1=w.forwardRef((e,t)=>{const{children:n,...r}=e;if(w.isValidElement(n)){const o=OK(n),i=jK(r,n.props);return n.type!==w.Fragment&&(i.ref=t?vr(t,o):o),w.cloneElement(n,i)}return w.Children.count(n)>1?w.Children.only(null):null});V1.displayName="SlotClone";var IK=({children:e})=>f.jsx(f.Fragment,{children:e});function TK(e){return w.isValidElement(e)&&e.type===IK}function jK(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 OK(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var FK=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],_e=FK.reduce((e,t)=>{const n=w.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?HO:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),f.jsx(a,{...s,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function WO(e,t){e&&vs.flushSync(()=>e.dispatchEvent(t))}function Mn(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function or({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=LK({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=Mn(n),l=w.useCallback(c=>{if(i){const d=typeof c=="function"?c(e):c;d!==e&&a(d)}else o(c)},[i,e,o,a]);return[s,l]}function LK({defaultProp:e,onChange:t}){const n=w.useState(e),[r]=n,o=w.useRef(r),i=Mn(t);return w.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}var $K=w.createContext(void 0);function ac(e){const t=w.useContext($K);return e||t||"ltr"}var Uv="rovingFocusGroup.onEntryFocus",zK={bubbles:!1,cancelable:!0},j0="RovingFocusGroup",[H1,UO,BK]=T0(j0),[VK,ad]=Pn(j0,[BK]),[HK,WK]=VK(j0),GO=w.forwardRef((e,t)=>f.jsx(H1.Provider,{scope:e.__scopeRovingFocusGroup,children:f.jsx(H1.Slot,{scope:e.__scopeRovingFocusGroup,children:f.jsx(UK,{...e,ref:t})})}));GO.displayName=j0;var UK=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=e,h=w.useRef(null),p=Ve(t,h),g=ac(i),[m=null,b]=or({prop:s,defaultProp:a,onChange:l}),[y,v]=w.useState(!1),x=Mn(c),S=UO(n),_=w.useRef(!1),[E,C]=w.useState(0);return w.useEffect(()=>{const k=h.current;if(k)return k.addEventListener(Uv,x),()=>k.removeEventListener(Uv,x)},[x]),f.jsx(HK,{scope:n,orientation:r,dir:g,loop:o,currentTabStopId:m,onItemFocus:w.useCallback(k=>b(k),[b]),onItemShiftTab:w.useCallback(()=>v(!0),[]),onFocusableItemAdd:w.useCallback(()=>C(k=>k+1),[]),onFocusableItemRemove:w.useCallback(()=>C(k=>k-1),[]),children:f.jsx(_e.div,{tabIndex:y||E===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:"none",...e.style},onMouseDown:fe(e.onMouseDown,()=>{_.current=!0}),onFocus:fe(e.onFocus,k=>{const N=!_.current;if(k.target===k.currentTarget&&N&&!y){const M=new CustomEvent(Uv,zK);if(k.currentTarget.dispatchEvent(M),!M.defaultPrevented){const A=S().filter(O=>O.focusable),P=A.find(O=>O.active),j=A.find(O=>O.id===m),I=[P,j,...A].filter(Boolean).map(O=>O.ref.current);KO(I,u)}}_.current=!1}),onBlur:fe(e.onBlur,()=>v(!1))})})}),qO="RovingFocusGroupItem",YO=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=_n(),l=i||a,c=WK(qO,n),u=c.currentTabStopId===l,d=UO(n),{onFocusableItemAdd:h,onFocusableItemRemove:p}=c;return w.useEffect(()=>{if(r)return h(),()=>p()},[r,h,p]),f.jsx(H1.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:f.jsx(_e.span,{tabIndex:u?0:-1,"data-orientation":c.orientation,...s,ref:t,onMouseDown:fe(e.onMouseDown,g=>{r?c.onItemFocus(l):g.preventDefault()}),onFocus:fe(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:fe(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){c.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const m=YK(g,c.orientation,c.dir);if(m!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let y=d().filter(v=>v.focusable).map(v=>v.ref.current);if(m==="last")y.reverse();else if(m==="prev"||m==="next"){m==="prev"&&y.reverse();const v=y.indexOf(g.currentTarget);y=c.loop?KK(y,v+1):y.slice(v+1)}setTimeout(()=>KO(y))}})})})});YO.displayName=qO;var GK={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function qK(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function YK(e,t,n){const r=qK(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return GK[r]}function KO(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function KK(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var OE=GO,FE=YO;function XK(e,t){return w.useReducer((n,r)=>t[n][r]??n,e)}var fn=e=>{const{present:t,children:n}=e,r=QK(t),o=typeof n=="function"?n({present:r.isPresent}):w.Children.only(n),i=Ve(r.ref,ZK(o));return typeof n=="function"||r.isPresent?w.cloneElement(o,{ref:i}):null};fn.displayName="Presence";function QK(e){const[t,n]=w.useState(),r=w.useRef({}),o=w.useRef(e),i=w.useRef("none"),s=e?"mounted":"unmounted",[a,l]=XK(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const c=um(r.current);i.current=a==="mounted"?c:"none"},[a]),Vn(()=>{const c=r.current,u=o.current;if(u!==e){const h=i.current,p=um(c);e?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&h!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Vn(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,d=p=>{const m=um(r.current).includes(p.animationName);if(p.target===t&&m&&(l("ANIMATION_END"),!o.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},h=p=>{p.target===t&&(i.current=um(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:w.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function um(e){return(e==null?void 0:e.animationName)||"none"}function ZK(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var LE="Tabs",[JK,DLe]=Pn(LE,[ad]),XO=ad(),[eX,$E]=JK(LE),QO=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=ac(a),[d,h]=or({prop:r,onChange:o,defaultProp:i});return f.jsx(eX,{scope:n,baseId:_n(),value:d,onValueChange:h,orientation:s,dir:u,activationMode:l,children:f.jsx(_e.div,{dir:u,"data-orientation":s,...c,ref:t})})});QO.displayName=LE;var ZO="TabsList",JO=w.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=$E(ZO,n),s=XO(n);return f.jsx(OE,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:r,children:f.jsx(_e.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});JO.displayName=ZO;var e5="TabsTrigger",t5=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=$E(e5,n),a=XO(n),l=o5(s.baseId,r),c=i5(s.baseId,r),u=r===s.value;return f.jsx(FE,{asChild:!0,...a,focusable:!o,active:u,children:f.jsx(_e.button,{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:fe(e.onMouseDown,d=>{!o&&d.button===0&&d.ctrlKey===!1?s.onValueChange(r):d.preventDefault()}),onKeyDown:fe(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&s.onValueChange(r)}),onFocus:fe(e.onFocus,()=>{const d=s.activationMode!=="manual";!u&&!o&&d&&s.onValueChange(r)})})})});t5.displayName=e5;var n5="TabsContent",r5=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=$E(n5,n),l=o5(a.baseId,r),c=i5(a.baseId,r),u=r===a.value,d=w.useRef(u);return w.useEffect(()=>{const h=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(h)},[]),f.jsx(fn,{present:o||u,children:({present:h})=>f.jsx(_e.div,{"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!h,id:c,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:h&&i})})});r5.displayName=n5;function o5(e,t){return`${e}-trigger-${t}`}function i5(e,t){return`${e}-content-${t}`}var tX=QO,s5=JO,a5=t5,l5=r5;const ld=tX,lc=w.forwardRef(({className:e,...t},n)=>f.jsx(s5,{ref:n,className:re("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));lc.displayName=s5.displayName;const Jr=w.forwardRef(({className:e,...t},n)=>f.jsx(a5,{ref:n,className:re("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}));Jr.displayName=a5.displayName;const mi=w.forwardRef(({className:e,...t},n)=>f.jsx(l5,{ref:n,className:re("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));mi.displayName=l5.displayName;var c5={exports:{}},np={},W1={exports:{}};(function(e,t){(function(n,r){r(t)})(ls,function(n){function r(Y){return function(Z,ee,Q,ie,te,le,ue){return Y(Z,ee,ue)}}function o(Y){return function(Z,ee,Q,ie){if(!Z||!ee||typeof Z!="object"||typeof ee!="object")return Y(Z,ee,Q,ie);var te=ie.get(Z),le=ie.get(ee);if(te&&le)return te===ee&&le===Z;ie.set(Z,ee),ie.set(ee,Z);var ue=Y(Z,ee,Q,ie);return ie.delete(Z),ie.delete(ee),ue}}function i(Y,K){var Z={};for(var ee in Y)Z[ee]=Y[ee];for(var ee in K)Z[ee]=K[ee];return Z}function s(Y){return Y.constructor===Object||Y.constructor==null}function a(Y){return typeof Y.then=="function"}function l(Y,K){return Y===K||Y!==Y&&K!==K}var c="[object Arguments]",u="[object Boolean]",d="[object Date]",h="[object RegExp]",p="[object Map]",g="[object Number]",m="[object Object]",b="[object Set]",y="[object String]",v=Object.prototype.toString;function x(Y){var K=Y.areArraysEqual,Z=Y.areDatesEqual,ee=Y.areMapsEqual,Q=Y.areObjectsEqual,ie=Y.areRegExpsEqual,te=Y.areSetsEqual,le=Y.createIsNestedEqual,ue=le(Re);function Re(be,we,Pe){if(be===we)return!0;if(!be||!we||typeof be!="object"||typeof we!="object")return be!==be&&we!==we;if(s(be)&&s(we))return Q(be,we,ue,Pe);var Ye=Array.isArray(be),_t=Array.isArray(we);if(Ye||_t)return Ye===_t&&K(be,we,ue,Pe);var me=v.call(be);return me!==v.call(we)?!1:me===d?Z(be,we,ue,Pe):me===h?ie(be,we,ue,Pe):me===p?ee(be,we,ue,Pe):me===b?te(be,we,ue,Pe):me===m||me===c?a(be)||a(we)?!1:Q(be,we,ue,Pe):me===u||me===g||me===y?l(be.valueOf(),we.valueOf()):!1}return Re}function S(Y,K,Z,ee){var Q=Y.length;if(K.length!==Q)return!1;for(;Q-- >0;)if(!Z(Y[Q],K[Q],Q,Q,Y,K,ee))return!1;return!0}var _=o(S);function E(Y,K){return l(Y.valueOf(),K.valueOf())}function C(Y,K,Z,ee){var Q=Y.size===K.size;if(!Q)return!1;if(!Y.size)return!0;var ie={},te=0;return Y.forEach(function(le,ue){if(Q){var Re=!1,be=0;K.forEach(function(we,Pe){!Re&&!ie[be]&&(Re=Z(ue,Pe,te,be,Y,K,ee)&&Z(le,we,ue,Pe,Y,K,ee))&&(ie[be]=!0),be++}),te++,Q=Re}}),Q}var k=o(C),N="_owner",M=Object.prototype.hasOwnProperty;function A(Y,K,Z,ee){var Q=Object.keys(Y),ie=Q.length;if(Object.keys(K).length!==ie)return!1;for(var te;ie-- >0;){if(te=Q[ie],te===N){var le=!!Y.$$typeof,ue=!!K.$$typeof;if((le||ue)&&le!==ue)return!1}if(!M.call(K,te)||!Z(Y[te],K[te],te,te,Y,K,ee))return!1}return!0}var P=o(A);function j(Y,K){return Y.source===K.source&&Y.flags===K.flags}function F(Y,K,Z,ee){var Q=Y.size===K.size;if(!Q)return!1;if(!Y.size)return!0;var ie={};return Y.forEach(function(te,le){if(Q){var ue=!1,Re=0;K.forEach(function(be,we){!ue&&!ie[Re]&&(ue=Z(te,be,le,we,Y,K,ee))&&(ie[Re]=!0),Re++}),Q=ue}}),Q}var I=o(F),O=Object.freeze({areArraysEqual:S,areDatesEqual:E,areMapsEqual:C,areObjectsEqual:A,areRegExpsEqual:j,areSetsEqual:F,createIsNestedEqual:r}),$=Object.freeze({areArraysEqual:_,areDatesEqual:E,areMapsEqual:k,areObjectsEqual:P,areRegExpsEqual:j,areSetsEqual:I,createIsNestedEqual:r}),B=x(O);function z(Y,K){return B(Y,K,void 0)}var T=x(i(O,{createIsNestedEqual:function(){return l}}));function W(Y,K){return T(Y,K,void 0)}var L=x($);function D(Y,K){return L(Y,K,new WeakMap)}var H=x(i($,{createIsNestedEqual:function(){return l}}));function V(Y,K){return H(Y,K,new WeakMap)}function q(Y){return x(i(O,Y(O)))}function U(Y){var K=x(i($,Y($)));return function(Z,ee,Q){return Q===void 0&&(Q=new WeakMap),K(Z,ee,Q)}}n.circularDeepEqual=D,n.circularShallowEqual=V,n.createCustomCircularEqual=U,n.createCustomEqual=q,n.deepEqual=z,n.sameValueZeroEqual=l,n.shallowEqual=W,Object.defineProperty(n,"__esModule",{value:!0})})})(W1,W1.exports);var zE=W1.exports;const BE=bE(mq);var lt={},nX=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(lt,"__esModule",{value:!0});lt.bottom=VE;lt.childrenEqual=sX;lt.cloneLayout=u5;lt.cloneLayoutItem=_l;lt.collides=O0;lt.compact=f5;lt.compactItem=h5;lt.compactType=vX;lt.correctBounds=p5;lt.fastPositionEqual=aX;lt.fastRGLPropsEqual=void 0;lt.getAllCollisions=m5;lt.getFirstCollision=cl;lt.getLayoutItem=HE;lt.getStatics=WE;lt.modifyLayout=d5;lt.moveElement=of;lt.moveElementAwayFromCollision=G1;lt.noop=void 0;lt.perc=cX;lt.resizeItemInDirection=mX;lt.setTopLeft=bX;lt.setTransform=gX;lt.sortLayoutItems=XE;lt.sortLayoutItemsByColRow=x5;lt.sortLayoutItemsByRowCol=v5;lt.synchronizeLayoutWithChildren=yX;lt.validateLayout=w5;lt.withLayoutItem=iX;var rM=zE,rf=rX(R);function rX(e){return e&&e.__esModule?e:{default:e}}const oX=process.env.NODE_ENV==="production";function VE(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 u5(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=_l(e[n]);return t}function d5(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 iX(e,t,n){let r=HE(e,t);return r?(r=n(_l(r)),e=d5(e,r),[e,r]):[e,null]}function _l(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 sX(e,t){return(0,rM.deepEqual)(rf.default.Children.map(e,n=>n==null?void 0:n.key),rf.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,rM.deepEqual)(rf.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),rf.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}lt.fastRGLPropsEqual=nX;function aX(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function O0(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 f5(e,t,n,r){const o=WE(e),i=XE(e,t),s=Array(e.length);for(let a=0,l=i.length;a<l;a++){let c=_l(i[a]);c.static||(c=h5(o,c,t,n,i,r),o.push(c)),s[e.indexOf(i[a])]=c,c.moved=!1}return s}const lX={x:"w",y:"h"};function U1(e,t,n,r){const o=lX[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;O0(t,a)&&U1(e,a,n+t[o],r)}}t[r]=n}function h5(e,t,n,r,o,i){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(VE(e),t.y);t.y>0&&!cl(e,t);)t.y--;else if(a)for(;t.x>0&&!cl(e,t);)t.x--;let l;for(;(l=cl(e,t))&&!(n===null&&i);)if(a?U1(o,t,l.x+l.w,"x"):U1(o,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!cl(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function p5(e,t){const n=WE(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(;cl(n,i);)i.y++}return e}function HE(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function cl(e,t){for(let n=0,r=e.length;n<r;n++)if(O0(e[n],t))return e[n]}function m5(e,t){return e.filter(n=>O0(n,t))}function WE(e){return e.filter(t=>t.static)}function of(e,t,n,r,o,i,s,a,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;`${t.i}${String(n)}${String(r)}${t.x}${t.y}`;const c=t.x,u=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let d=XE(e,s);(s==="vertical"&&typeof r=="number"?u>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(d=d.reverse());const p=m5(d,t),g=p.length>0;if(g&&l)return u5(e);if(g&&i)return`${t.i}`,t.x=c,t.y=u,t.moved=!1,e;for(let m=0,b=p.length;m<b;m++){const y=p[m];`${t.i}${t.x}${t.y}${y.i}${y.x}${y.y}`,!y.moved&&(y.static?e=G1(e,y,t,o,s):e=G1(e,t,y,o,s))}return e}function G1(e,t,n,r,o,i){const s=o==="horizontal",a=o==="vertical",l=t.static;if(r){r=!1;const d={x:s?Math.max(t.x-n.w,0):n.x,y:a?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},h=cl(e,d),p=h&&h.y+h.h>t.y,g=h&&t.x+t.w>h.x;if(h){if(p&&a)return of(e,n,void 0,t.y+1,r,l,o);if(p&&o==null)return t.y=n.y,n.y=n.y+n.h,e;if(g&&s)return of(e,t,n.x,void 0,r,l,o)}else return`${n.i}${d.x}${d.y}`,of(e,n,s?d.x:void 0,a?d.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:of(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,o)}function cX(e){return e*100+"%"}const g5=(e,t,n,r)=>e+n>r?t:n,b5=(e,t,n)=>e<0?t:n,y5=e=>Math.max(0,e),UE=e=>Math.max(0,e),GE=(e,t,n)=>{let{left:r,height:o,width:i}=t;const s=e.top-(o-e.height);return{left:r,width:i,height:b5(s,e.height,o),top:UE(s)}},qE=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{top:r,height:i,width:g5(e.left,e.width,s,n),left:y5(o)}},YE=(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:g5(e.left,e.width,i,n),top:UE(r),left:y5(s)}},KE=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{width:s,left:o,height:b5(r,e.height,i),top:UE(r)}},uX=function(){return GE(arguments.length<=0?void 0:arguments[0],qE(...arguments))},dX=function(){return GE(arguments.length<=0?void 0:arguments[0],YE(...arguments))},fX=function(){return KE(arguments.length<=0?void 0:arguments[0],qE(...arguments))},hX=function(){return KE(arguments.length<=0?void 0:arguments[0],YE(...arguments))},pX={n:GE,ne:uX,e:qE,se:fX,s:KE,sw:hX,w:YE,nw:dX};function mX(e,t,n,r){const o=pX[e];return o?o(t,{...t,...n},r):n}function gX(e){let{top:t,left:n,width:r,height:o}=e;const i=`translate(${n}px,${t}px)`;return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:`${r}px`,height:`${o}px`,position:"absolute"}}function bX(e){let{top:t,left:n,width:r,height:o}=e;return{top:`${t}px`,left:`${n}px`,width:`${r}px`,height:`${o}px`,position:"absolute"}}function XE(e,t){return t==="horizontal"?x5(e):t==="vertical"?v5(e):e}function v5(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 x5(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 yX(e,t,n,r,o){e=e||[];const i=[];rf.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=HE(e,String(a.key)),c=a.props["data-grid"];l&&c==null?i.push(_l(l)):c?(oX||w5([c],"ReactGridLayout.children"),i.push(_l({...c,i:a.key}))):i.push(_l({w:1,h:1,x:0,y:VE(i),i:String(a.key)}))});const s=p5(i,{cols:n});return o?s:f5(s,r,n)}function w5(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++){const a=n[s],l=i[a];if(typeof l!="number"||Number.isNaN(l))throw new Error(`ReactGridLayout: ${t}[${r}].${a} must be a number! Received: ${l} (${typeof l})`)}if(typeof i.i<"u"&&typeof i.i!="string")throw new Error(`ReactGridLayout: ${t}[${r}].i must be a string! Received: ${i.i} (${typeof i.i})`)}}function vX(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const xX=()=>{};lt.noop=xX;var ji={};Object.defineProperty(ji,"__esModule",{value:!0});ji.calcGridColWidth=F0;ji.calcGridItemPosition=wX;ji.calcGridItemWHPx=q1;ji.calcWH=SX;ji.calcXY=CX;ji.clamp=ul;function F0(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function q1(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function wX(e,t,n,r,o,i){const{margin:s,containerPadding:a,rowHeight:l}=e,c=F0(e),u={};return i&&i.resizing?(u.width=Math.round(i.resizing.width),u.height=Math.round(i.resizing.height)):(u.width=q1(r,c,s[0]),u.height=q1(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 CX(e,t,n,r,o){const{margin:i,containerPadding:s,cols:a,rowHeight:l,maxRows:c}=e,u=F0(e);let d=Math.round((n-s[0])/(u+i[0])),h=Math.round((t-s[1])/(l+i[1]));return d=ul(d,0,a-r),h=ul(h,0,c-o),{x:d,y:h}}function SX(e,t,n,r,o,i){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,u=F0(e);let d=Math.round((t+s[0])/(u+s[0])),h=Math.round((n+s[1])/(c+s[1])),p=ul(d,0,l-r),g=ul(h,0,a-o);return["sw","w","nw"].indexOf(i)!==-1&&(p=ul(d,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(g=ul(h,0,a)),{w:p,h:g}}function ul(e,t,n){return Math.max(Math.min(e,n),t)}var L0={},Y1={exports:{}},dm={exports:{}},kt={};/** @license React v16.13.1
|
|
36
|
+
`,iO=["_forecast"],Zg="dm",Qf=[{locale:"en-US",currency:"USD",currencyName:"US Dollar"},{locale:"en-GB",currency:"GBP",currencyName:"British Pound"},{locale:"en-CA",currency:"CAD",currencyName:"Canadian Dollar"},{locale:"en-AU",currency:"AUD",currencyName:"Australian Dollar"},{locale:"en-IN",currency:"INR",currencyName:"Indian Rupee"},{locale:"ja-JP",currency:"JPY",currencyName:"Japanese Yen"},{locale:"de-DE",currency:"EUR",currencyName:"Germany (Eurozone)"},{locale:"fr-FR",currency:"EUR",currencyName:"France (Eurozone)"},{locale:"es-ES",currency:"EUR",currencyName:"Spain (Eurozone)"},{locale:"it-IT",currency:"EUR",currencyName:"Italy (Eurozone)"},{locale:"fi-FI",currency:"EUR",currencyName:"Finland (Eurozone)"},{locale:"nl-NL",currency:"EUR",currencyName:"Netherlands (Eurozone)"},{locale:"zh-CN",currency:"CNY",currencyName:"Chinese Yuan"},{locale:"ru-RU",currency:"RUB",currencyName:"Russian Ruble"},{locale:"pt-BR",currency:"BRL",currencyName:"Brazilian Real"},{locale:"ko-KR",currency:"KRW",currencyName:"South Korean Won"},{locale:"ar-SA",currency:"SAR",currencyName:"Saudi Riyal"},{locale:"sv-SE",currency:"SEK",currencyName:"Swedish Krona"},{locale:"no-NO",currency:"NOK",currencyName:"Norwegian Krone"},{locale:"da-DK",currency:"DKK",currencyName:"Danish Krone"},{locale:"pl-PL",currency:"PLN",currencyName:"Polish Zloty"},{locale:"tr-TR",currency:"TRY",currencyName:"Turkish Lira"},{locale:"he-IL",currency:"ILS",currencyName:"Israeli Shekel"},{locale:"th-TH",currency:"THB",currencyName:"Thai Baht"},{locale:"vi-VN",currency:"VND",currencyName:"Vietnamese Dong"},{locale:"id-ID",currency:"IDR",currencyName:"Indonesian Rupiah"},{locale:"mx-MX",currency:"MXN",currencyName:"Mexican Peso"},{locale:"za-ZA",currency:"ZAR",currencyName:"South African Rand"},{locale:"sg-SG",currency:"SGD",currencyName:"Singapore Dollar"},{locale:"hk-HK",currency:"HKD",currencyName:"Hong Kong Dollar"},{locale:"ch-CH",currency:"CHF",currencyName:"Swiss Franc"},{locale:"my-MY",currency:"MYR",currencyName:"Malaysian Ringgit"},{locale:"ph-PH",currency:"PHP",currencyName:"Philippine Peso"},{locale:"eg-EG",currency:"EGP",currencyName:"Egyptian Pound"},{locale:"nz-NZ",currency:"NZD",currencyName:"New Zealand Dollar"}],SY=[{label:"English",locales:[{code:"en-US",name:"US English"},{code:"en-GB",name:"British English"},{code:"en-AU",name:"Australian English"},{code:"en-CA",name:"Canadian English"}]},{label:"French",locales:[{code:"fr-FR",name:"France French"},{code:"fr-CA",name:"Canadian French"}]},{label:"Spanish",locales:[{code:"es-ES",name:"Spain Spanish"},{code:"es-MX",name:"Mexican Spanish"},{code:"es-419",name:"Latin American Spanish"}]},{label:"German",locales:[{code:"de-DE",name:"Germany German"},{code:"de-CH",name:"Swiss German"}]},{label:"Chinese",locales:[{code:"zh-CN",name:"Simplified Chinese (China)"},{code:"zh-TW",name:"Traditional Chinese (Taiwan)"},{code:"zh-HK",name:"Hong Kong Chinese"}]},{label:"Japanese",locales:[{code:"ja-JP",name:"Japanese"}]},{label:"Arabic",locales:[{code:"ar-EG",name:"Egypt Arabic"},{code:"ar-SA",name:"Saudi Arabia Arabic"}]},{label:"Russian",locales:[{code:"ru-RU",name:"Russian"}]},{label:"Portuguese",locales:[{code:"pt-PT",name:"Portugal Portuguese"},{code:"pt-BR",name:"Brazil Portuguese"}]},{label:"Indian Languages",locales:[{code:"hi-IN",name:"Hindi (India)"},{code:"ta-IN",name:"Tamil (India)"}]},{label:"Korean",locales:[{code:"ko-KR",name:"Korean"}]},{label:"Italian",locales:[{code:"it-IT",name:"Italian (Italy)"}]},{label:"Dutch",locales:[{code:"nl-NL",name:"Dutch (Netherlands)"}]},{label:"Swedish",locales:[{code:"sv-SE",name:"Swedish (Sweden)"}]},{label:"Turkish",locales:[{code:"tr-TR",name:"Turkish (Turkey)"}]},{label:"Hebrew",locales:[{code:"he-IL",name:"Hebrew (Israel)"}]},{label:"Thai",locales:[{code:"th-TH",name:"Thai (Thailand)"}]},{label:"Polish",locales:[{code:"pl-PL",name:"Polish (Poland)"}]},{label:"Greek",locales:[{code:"el-GR",name:"Greek (Greece)"}]},{label:"Norwegian",locales:[{code:"no-NO",name:"Norwegian (Norway)"}]}],CE=["lg","md","sm","xs","xxs"],Jg={default:{dashboardPanel:"",dashboardTabsContainer:"",gridLayout:{className:""},chart:{font:{family:"Open Sans, Arial, sans-serif"},dataset:{backgroundColor:[Mt.teal[500],Mt.teal[300],Mt.gray[700],Mt.gray[500],Mt.gray[300]],borderColor:[Mt.teal[500],Mt.teal[300],Mt.gray[700],Mt.gray[500],Mt.gray[300]]},options:{interaction:{mode:"index"},plugins:{datalabels:{display:!1,color:x1},title:{display:!0},tooltip:{backgroundColor:"#fff",bodyColor:"#000",borderWidth:.25,titleColor:"#000",borderColor:"rgb(128,131,139)",cornerRadius:4,usePointStyle:!0,pointStyle:"rectRounded",boxPadding:4},legend:{position:"top",align:"center",maxHeight:0,labels:{useBorderRadius:!0,borderRadius:2}}},scales:{y:{grid:{display:!0},title:{display:!0,text:""},beginAtZero:!0,ticks:{precision:0}},x:{grid:{display:!0},title:{display:!0}}},layout:{padding:{top:-40}},borderRadius:2,responsive:!0,maintainAspectRatio:!1}}},dark:{chart:{dataset:{datalables:{color:x1},backgroundColor:[Mt.teal[500],Mt.teal[300],Mt.gray[700],Mt.gray[500],Mt.gray[300]],borderColor:[Mt.teal[500],Mt.teal[300],Mt.gray[700],Mt.gray[500],Mt.gray[300]]},options:{plugins:{tooltip:{backgroundColor:"#000",bodyColor:"#fff",borderWidth:.25,titleColor:"#fff",borderColor:"rgb(128,131,139)",cornerRadius:2,boxPadding:4}},datalabels:{display:!1},scales:{x:{grid:{display:!0,color:Mt.slate[800]}},y:{grid:{display:!0,color:Mt.slate[800]}}}}}}};function x1(e){var r,o,i,s,a,l;const t=(a=(s=(i=(o=(r=e==null?void 0:e.chart)==null?void 0:r.config)==null?void 0:o._config)==null?void 0:i.options)==null?void 0:s.plugins)==null?void 0:a.datalabels;let n=(l=e==null?void 0:e.dataset)==null?void 0:l.backgroundColor;return(t==null?void 0:t.align)==="end"&&(t==null?void 0:t.anchor)==="end"&&(n=Zf()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=Zf()),Au(n)}function Zf(){return oe.getState().theme==="dark"?"#000000":"#FFFFFF"}function Au(e){let t=0,n=0,r=0,o=0;const i=u=>{if(!u)return Mt.gray[500];const d=u.replace("#",""),h=parseInt(d.substring(0,2),16),p=parseInt(d.substring(2,4),16),g=parseInt(d.substring(4,6),16);t+=h,n+=p,r+=g,o++};Array.isArray(e)?e.forEach(u=>{i(u)}):i(e);const s=t/o,a=n/o,l=r/o;return(s*299+a*587+l*114)/1e3>=180?"black":"white"}const EY=["text","nullable(string)","name","enum","varchar","nvarchar","nvarchar2","char","character","longtext","nchar","char varying","nchar varying","character varying","string"],_Y=["number","integer","int","int64","bigint","smallint","tinyint","byteint","numeric","decimal","dec","double","real","double precision","float","float4","float8","float64"],RY=["date","datetime","time","timestamp","timestamp without time zone","timestamp_ns"],kY=["boolean"];function SE(e){return e.match(/[A-Z]/)?`"${e}"`:e}function D0(e){return EY.includes(e.toLowerCase())||/varchar/i.test(e)}function ep(e){return _Y.includes(e.toLowerCase())||/int|decimal|float|double/i.test(e)}function ic(e){return RY.includes(e.toLowerCase())||/date|time|timestamp/i.test(e)}function EE(e){return kY.includes(e.toLowerCase())||/boolean/i.test(e)}function NY(e,t,n,r,o,i){const{measures:s,dimensions:a}=e,l=s==null?void 0:s.map(h=>`${h.calc}(${h.name}) as ${h.calc}_${h.name.replace(/"/g,"")}`).join(", "),c=(a==null?void 0:a.join(", "))||"";let u="";const d=r?`${Zg}.${r}`:_E({schemaName:t,tableName:n,connectionType:o,databaseName:i});if(l&&c)return u=`SELECT ${c}, COUNT(*) as count, ${l} FROM ${d} GROUP BY ${c} ORDER BY ${c} DESC LIMIT 100`,u;if(!l&&c)return u=`SELECT ${c}, COUNT(*) as count FROM ${d} GROUP BY ${c} ORDER BY ${c} DESC LIMIT 100`,u;if(l&&!c)return u=`SELECT ${l} FROM ${d} LIMIT 100`,u}function MY(e,t,n="AVG"){var i,s,a,l;let r={};const o=SE(e.column_name);return D0(e.data_type)&&(((i=t.dimensions)==null?void 0:i.includes(o))?r={...t,dimensions:(s=t.dimensions)==null?void 0:s.filter(u=>u!==o)}:r={...t,dimensions:[...t.dimensions||[],o]}),ep(e.data_type)&&(((a=t.measures)==null?void 0:a.some(u=>u.name===o&&u.calc===n))?r={...t,measures:(l=t.measures)==null?void 0:l.filter(u=>!(u.name===o&&u.calc===n))}:r={...t,measures:[...t.measures||[],{name:o,calc:n||"SUM"}]}),r}function nu(e){return D0(e.dataType)?"string":ep(e.dataType)?"number":ic(e.dataType)?"date":EE(e.dataType)?"boolean":"string"}function PY(e){let t;const n=e.data_type.toLowerCase();return D0(n)?t="T":ep(n)?t="#":ic(n)?t="D":EE(n)?t="B":t="?",t}function DY(e,t){const{dimensions:n,measures:r}=t,o=n==null?void 0:n.includes(e.column_name),i=r==null?void 0:r.some(s=>s.name===e.column_name);return o||i}function sO(e){return e?e!=null&&e.startsWith(`${Zg}.`)?e:`${Zg}.${e}`:""}function aO({schemaName:e,tableName:t,modelName:n,connectionType:r,databaseName:o}){let i=_E({schemaName:e,tableName:t,connectionType:r,databaseName:o});n&&(i=sO(n));let s=i;return(l=>/[A-Z]/.test(l))(t)&&(s=s.split(".").map(c=>`"${c}"`).join(".")),s}function _E({schemaName:e,tableName:t,connectionType:n,databaseName:r}){return t==="api"||e===SE("NA")||n==="S3"||n==="API"?t:n==="S3Tables"?`${r}.${e}.${t}`:e?`${e}.${t}`:`${t}`}const AY=e=>{const t=new Date(e);return!isNaN(t.getTime())},IY=e=>!isNaN(Number(e))&&!isNaN(parseFloat(e)),A0=e=>{let t;return typeof e=="number"?t="number":typeof e=="string"?AY(e)?t="date":IY(e)?t="number":t="string":typeof e=="boolean"?t="boolean":e instanceof Date?t="date":t="unknown",t};function TY({get:e,dataPoint:t,card:n}){var h;const{addOrUpdateFilterValue:r,addFilteringCard:o,removeFilterValues:i,replaceFilterValue:s,removeFilteringCard:a}=e().actions,l=e().filteringCards,{columnName:c,columnValue:u}=t,d={filterId:n.id,connectionId:n==null?void 0:n.connectionId,tableName:n.lastSelectedTable,name:c,expression:(h=n.preferences)==null?void 0:h.filterOnClickField,valueType:A0(u),operation:"=",values:[u]};if(l!=null&&l.find(p=>p.id===n.id)){const p=n.id;if(u==null){a(n),i(p);return}else s(d)}o(n),r(d)}function HN({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},l=t?{...t}:{};return CE.forEach(c=>{l[c]||(l[c]=[]);const u=l[c].reduce((d,h)=>Math.max(d,h.y+h.h),0);a.y=a.y===1/0?u:a.y,l[c].push({...a})}),l}function WN(e,t){if(!t)return;const n={...t};return CE.forEach(r=>{n[r]&&(n[r]=n[r].filter(o=>o.i!==e))}),n}function lO(e){const t=oe.getState().dashboard.globalCacheConfig,{card:n,filter:r}=e;return t}const oe=Es()(Jh((e,t)=>({isSessionExpired:!1,currentBreakpoint:"lg",dashboard:{id:"",style:Jg},showContext:!1,selectedSheetId:null,selectedCardId:null,selectedFrameId:null,selectedCard:null,showFilters:!1,isDashboardEditing:!1,isVisualEditing:!1,showDashboardJSON:!1,filteringCards:[],isDashboardPanelOpen:!1,actions:{setInitStore:()=>{e(n=>{n.isSessionExpired=!1,n.currentBreakpoint="lg",n.dashboard={id:"",style:Jg},n.showContext=!1,n.selectedSheetId=null,n.selectedCardId=null,n.selectedFrameId=null,n.selectedCard=null,n.showFilters=!1,n.isDashboardEditing=!1,n.isVisualEditing=!1,n.showDashboardJSON=!1,n.filteringCards=[],n.selectedLensId=void 0,n.filterValues=void 0})},setAiContext:n=>{e(r=>{r.dashboard.aiContext=n})},setHandleOpenAssistantProfile:n=>{e(r=>{r.handleOpenAssistantProfile=n})},setFilterMode:(n,r)=>{const o=r==="exclude"?"not in":"in";e(i=>{var a,l,c;const s=(a=i.dashboard.filters)==null?void 0:a.find(u=>u.id===n);s&&(s.operation=o,i.dashboard.filters=(l=i.dashboard.filters)==null?void 0:l.map(u=>u.id===n?s:u),i.filterValues&&i.filterValues.length>0&&(i.filterValues=(c=i.filterValues)==null?void 0:c.map(u=>u.filterId===n?{...u,operation:o}:u)))})},updateEmailSettings:n=>{e(r=>{r.dashboard.emailSettings=n})},setDefaultFilterValues:n=>{e(r=>{r.dashboard.defaultFilterValues=n})},setIsDownloadingPdf:n=>{e(r=>{r.isDownloadingPdf=n})},setGlobalCacheConfig:n=>{e(r=>{r.dashboard.globalCacheConfig=n})},setLenses:n=>{e(r=>{r.lenses=n})},setSelectedLensId:n=>{e(r=>{r.selectedLensId=n})},deleteSheet:n=>{e(r=>{var i,s,a,l,c,u,d,h;const o=(i=r.dashboard.sheets)==null?void 0:i.findIndex(p=>p.id===n);if(o!==void 0&&o>-1){(s=r.dashboard.sheets)==null||s.splice(o,1);const p=(a=r.dashboard.filters)==null?void 0:a.filter(m=>m.sheetId===n),g=(l=r.filterValues)==null?void 0:l.filter(m=>p==null?void 0:p.some(b=>b.id===m.filterId));r.filterValues=(c=r.filterValues)==null?void 0:c.filter(m=>!(g!=null&&g.some(b=>b.filterId===m.filterId))),r.dashboard.filters=(u=r.dashboard.filters)==null?void 0:u.filter(m=>m.sheetId!==n),r.selectedSheetId=(h=(d=r.dashboard.sheets)==null?void 0:d[0])==null?void 0:h.id}})},addSheet:n=>{e(r=>{r.dashboard.sheets||(r.dashboard.sheets=[]);const o=r.dashboard.filters;let i={};o==null||o.forEach(a=>{CE.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})},addToAIScope:n=>{e(r=>{const{connectionId:o,connectionType:i,databaseName:s,schemaName:a,tableName:l,datamodelName:c,datamodelId:u}=n,d={connectionId:o||"",connectionType:i||"",databaseName:s||"",schemaName:a||"",tableName:l||"",datamodelName:c||"",datamodelId:u||""};let p=[...r.dashboard.aiScopeTables||[],d];p=p.filter((g,m,b)=>b.findIndex(y=>y.tableName===g.tableName&&y.datamodelName===g.datamodelName)===m),r.dashboard.aiScopeTables=p})},removeFromAIScope:n=>{e(r=>{const{connectionId:o,tableName:i,datamodelName:s}=n,a=r.dashboard.aiScopeTables||[];if(s){const l=a.filter(c=>!(c.datamodelName===s&&c.connectionId===o));r.dashboard.aiScopeTables=l}else if(i){const l=a.filter(c=>!(c.tableName===i&&c.connectionId===o));r.dashboard.aiScopeTables=l}})},setIsSessionExpired:n=>{e(()=>({isSessionExpired:n}))},setCardPython:(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===o.selectedSheetId);i&&((l=i==null?void 0:i.frames)==null||l.forEach(c=>{var d;const u=(d=c.cards)==null?void 0:d.find(h=>h.id===n);u&&(u.python=r)}))})},addBaseQuery:n=>{e(r=>{var o;r.dashboard.baseQueries||(r.dashboard.baseQueries=[]),(o=r.dashboard.baseQueries)==null||o.push(n)})},removeBaseQuery:n=>{e(r=>{var i,s;const o=(i=r.dashboard.baseQueries)==null?void 0:i.findIndex(a=>a.id===n);o!=null&&o>-1&&((s=r.dashboard.baseQueries)==null||s.splice(o,1))})},setBaseQueries:n=>{e(r=>{r.dashboard.baseQueries=n})},setCurrentBreakpoint:n=>{e(()=>({currentBreakpoint:n}))},setFilteringCards:n=>{e(()=>({filteringCards:n}))},addFilteringCard:n=>{e(r=>{var o;(o=r.filteringCards)==null||o.push(n)})},removeFilteringCard:n=>{e(r=>{var i,s;const o=(i=r.filteringCards)==null?void 0:i.findIndex(a=>a.id===n.id);o!==void 0&&o>-1&&((s=r.filteringCards)==null||s.splice(o,1))})},setCustomCards:n=>{e(r=>{r.dashboard.customCards=n})},setAuthToken:n=>{e(()=>({authToken:n}))},setThemeStyle:n=>{e(()=>({themeStyle:n}))},setDashboard:n=>e({dashboard:n}),setDashboardWithFilterValues:(n,r)=>{e(o=>{o.dashboard=n,o.filterValues=r})},setDashboardTheme:n=>{e(r=>{r.theme=n})},setSheets:n=>{e(r=>{r.dashboard&&(r.dashboard.sheets=n)})},setSheetTitle:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.title=r)})},setCardTitle:(n,r,o)=>{e(i=>{var a,l,c;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(u=>u.id===n);s&&((c=s==null?void 0:s.frames)==null||c.forEach(u=>{var h;const d=(h=u.cards)==null?void 0:h.find(p=>p.id===r);d&&(d.title=o)}))})},setCardInfo:(n,r)=>{e(o=>{var s,a,l;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===o.selectedSheetId);i&&((l=i==null?void 0:i.frames)==null||l.forEach(c=>{var d;const u=(d=c.cards)==null?void 0:d.find(h=>h.id===n);u&&(u.info=r)}))})},setCardDescription:(n,r,o)=>{e(i=>{var a,l,c;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(u=>u.id===n);s&&((c=s==null?void 0:s.frames)==null||c.forEach(u=>{var h;const d=(h=u.cards)==null?void 0:h.find(p=>p.id===r);d&&(d.description=o)}))})},setCardSql:(n,r,o)=>{e(i=>{var a,l,c,u;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(d=>d.id===n);if(s){const d=(c=s.cards)==null?void 0:c.find(h=>h.id===r);d&&(d.sql=o,(u=i.onUpdateCard)==null||u.call(i,d,n))}})},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,c;const i=(s=r==null?void 0:r.filterValues)==null?void 0:s.findIndex(u=>u.filterId===o.filterId);if(o.values.length===0){r.filterValues=(a=r.filterValues)==null?void 0:a.filter(u=>u.filterId!==o.filterId);return}i!==void 0&&i>-1?(l=r.filterValues)==null||l.splice(i,1,o):(c=r.filterValues)==null||c.push(o)}):r.filterValues=n})},removeFilterValues:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.filter(i=>i.filterId!==n&&!i.filterId.startsWith(n));r.filterValues=o}})},replaceFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1&&r.filterValues.splice(o,1,n)}})},addFilter:n=>{e(r=>{var i,s;r.dashboard.filters?(i=r.dashboard.filters)==null||i.push(n):r.dashboard.filters=[n],(s=r.dashboard.sheets)==null||s.find(a=>a.id===r.selectedSheetId);const o=r.dashboard.sheets;o==null||o.forEach(a=>{HN({id:n.id,layouts:a.layouts,y:0,initialHeight:8,minH:7,w:10})})})},removeFilter:n=>{e(r=>{var o,i,s;if(r.dashboard.filters){const a=(o=r.dashboard.filters)==null?void 0:o.findIndex(l=>l.id===n);if(a>-1){(i=r.dashboard.filters)==null||i.splice(a,1),(s=r.dashboard.sheets)==null||s.find(c=>c.id===r.selectedSheetId);const l=r.dashboard.sheets;l==null||l.forEach(c=>{const u=WN(n,c.layouts);c.layouts=u})}}})},updateCurrentDashboardCard:n=>{e(r=>{var a,l,c,u,d;const o=(l=(a=r.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(h=>h.id===r.selectedSheetId),i=(c=o==null?void 0:o.frames)==null?void 0:c.find(h=>h.id===r.selectedFrameId),s=(u=i==null?void 0:i.cards)==null?void 0:u.findIndex(h=>h.id===n.id);typeof s=="number"&&s>=0&&((d=i==null?void 0:i.cards)==null||d.splice(s,1,n))})},updateFrameCard:(n,r,o)=>{e(i=>{var l,c,u,d,h;const s=(c=(l=i.dashboard)==null?void 0:l.sheets)==null?void 0:c.find(p=>p.id===n);if(!s)return;const a=(u=s==null?void 0:s.frames)==null?void 0:u.find(p=>p.id===r);if(a){const p=(d=a.cards)==null?void 0:d.findIndex(g=>g.id===o.id);p>-1&&((h=a.cards)==null||h.splice(p,1,o))}})},updateFilter:n=>{e(r=>{var o,i;if(r.dashboard.filters){const s=(o=r.dashboard.filters)==null?void 0:o.findIndex(a=>a.id===n.id);s>-1&&((i=r.dashboard.filters)==null||i.splice(s,1,n))}})},updateFilterId:(n,r)=>{e(o=>{var a,l;const i=(a=o.dashboard.filters)==null?void 0:a.find(c=>c.id===n),s=(l=o.dashboard.filters)==null?void 0:l.some(c=>c.id===r);i&&!s&&(i.id=r)})},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(d=>d.id===n);if(s){s.frames||(s.frames=[]),(c=s.frames)==null||c.push(r);let d=1/0;const h=0;o==="start"&&(d=0);const p=HN({id:r.id,layouts:s.layouts,minH:10,x:h,y:d});s.layouts=p,(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(d=>d.id===n);if(i){const d=(l=i.frames)==null?void 0:l.findIndex(h=>h.id===r);console.log(d),typeof d=="number"&&d>-1&&((c=i.frames)==null||c.splice(d,1),(u=i.layout)==null||u.splice(d,1),WN(r,i.layouts))}})},updateFrame:(n,r)=>{e(o=>{var a,l,c,u,d;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(h=>h.id===n),s=(c=i==null?void 0:i.frames)==null?void 0:c.findIndex(h=>h.id===r.id);i&&((u=i.frames)==null||u.splice(s,1,r)),(d=o.onAcceptChanges)==null||d.call(o,r,o.dashboard)})},updateCard:(n,r)=>{e(o=>{var a,l,c,u,d;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(h=>h.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(h=>h.id===r.id);i&&((u=i.cards)==null||u.splice(s,1,r),(d=o.onUpdateCard)==null||d.call(o,r,n))})},removeCard:(n,r)=>{e(o=>{var a,l,c,u,d,h;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(p=>p.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(p=>p.id===r.id);i&&((u=i.cards)==null||u.splice(s,1),(d=i.layout)==null||d.splice(s,1),(h=o.onRemoveCard)==null||h.call(o,r,n))})},setStyle:n=>{e(r=>{r.dashboard&&(r.dashboard.style=n)})},setSelectedCardId:(n,r)=>{e(o=>{var s,a,l;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===n);i&&(((l=i.cards)==null?void 0:l.find(u=>u.id===r))?o.selectedCardId=r:o.selectedCardId=null)})},setSelectedFrameId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(a=>a.id===r.selectedSheetId))&&(r.selectedFrameId=n)})},setSelectedSheetId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(a=>a.id===n))&&(r.selectedSheetId=n)})},setOnSaveFunction:n=>{e(()=>({onSaveFunction:n}))},setOnAddCard:n=>{e(()=>({onAddCard:n}))},setOnAcceptChanges:n=>{e(()=>({onAcceptChanges:n}))},setOnUpdateCard:n=>{e(()=>({onUpdateCard:n}))},setOnRemoveCard:n=>{e(()=>({onRemoveCard:n}))},setOnEvent:n=>{e(()=>({onEvent:n}))},getDashboard:()=>t().dashboard,getSelectedSheet:()=>{var n,r;return(r=(n=t().dashboard)==null?void 0:n.sheets)==null?void 0:r.find(o=>o.id===t().selectedSheetId)},getCardFrame:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a){for(let l=0;l<a.length;l++)if((i=a[l].cards)==null?void 0:i.find(u=>u.id===n))return a[l]}}},getSelectedFrame:()=>{var r,o,i;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(s=>s.id===t().selectedSheetId);return(i=n==null?void 0:n.frames)==null?void 0:i.find(s=>s.id===t().selectedFrameId)},getCard:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a)for(let l=0;l<a.length;l++){const c=(i=a[l].cards)==null?void 0:i.find(u=>u.id===n);if(c)return c}}},getSelectedSheetLayout:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layout},getSelectedSheetLayouts:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layouts},getStyle:()=>{var n;return(n=t().dashboard)==null?void 0:n.style},getCardSheet(n){var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a){for(let l=0;l<a.length;l++)if((i=a[l].cards)==null?void 0:i.find(u=>u.id===n))return r[s]}}},handleDataPointClickAction:(n,r)=>{TY({card:n,dataPoint:r,get:t})},setIsDashboardPanelOpen:n=>{e(()=>({isDashboardPanelOpen:n}))}}}))),cO=()=>oe(t=>{var i,s,a,l,c;const n=(s=(i=t.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(u=>u.id===t.selectedSheetId),r=(a=n==null?void 0:n.frames)==null?void 0:a.find(u=>u.id===t.selectedFrameId);return((l=r==null?void 0:r.cards)==null?void 0:l.find(u=>u.id===(r==null?void 0:r.activeCardId)))||((c=r==null?void 0:r.cards)==null?void 0:c[0])}),uO=()=>{var n;const e=oe(r=>{var o,i;return(i=(o=r.dashboard)==null?void 0:o.sheets)==null?void 0:i.find(s=>s.id===r.selectedSheetId)});return(((n=e==null?void 0:e.frames)==null?void 0:n.map(r=>{var o;return(o=r.cards)==null?void 0:o.find(i=>i.id===r.activeCardId)}))||[]).filter(r=>r!==void 0)},dO=()=>{var t,n,r;const e=cO();return{metricFields:((t=e==null?void 0:e.config)==null?void 0:t.metricColumns)||[],groupByFields:((n=e==null?void 0:e.config)==null?void 0:n.groupByColumns)||[],pivotByFields:((r=e==null?void 0:e.config)==null?void 0:r.pivotByColumns)||[]}},on=()=>oe(e=>e.actions);async function jY(e,t){const n=t.slice(0,16),r=new TextEncoder,o=await window.crypto.subtle.importKey("raw",r.encode(n),{name:"PBKDF2"},!1,["deriveKey"]),i=await window.crypto.subtle.deriveKey({name:"PBKDF2",salt:r.encode(n),iterations:1e5,hash:"SHA-256"},o,{name:"AES-GCM",length:256},!1,["encrypt"]),s=window.crypto.getRandomValues(new Uint8Array(12)),a=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:s},i,r.encode(e)),l=new Uint8Array(s.length+a.byteLength);return l.set(s,0),l.set(new Uint8Array(a),s.length),{payload:btoa(String.fromCharCode(...l))}}async function fO(e,t){const n=t.slice(0,16),r=new TextEncoder,o=new TextDecoder,i=await window.crypto.subtle.importKey("raw",r.encode(n),{name:"PBKDF2"},!1,["deriveKey"]),s=await window.crypto.subtle.deriveKey({name:"PBKDF2",salt:r.encode(n),iterations:1e5,hash:"SHA-256"},i,{name:"AES-GCM",length:256},!1,["decrypt"]),a=Uint8Array.from(atob(e),h=>h.charCodeAt(0)),l=a.slice(0,12),c=a.slice(a.length-16),u=a.slice(12,a.length-16),d=new Uint8Array(u.length+c.length);d.set(u),d.set(c,u.length);try{const h=await window.crypto.subtle.decrypt({name:"AES-GCM",iv:l},s,d);return{decryptedData:o.decode(h)}}catch(h){throw new Error(`Decryption failed: ${h}`)}}function re(...e){return qq($l(e))}const OY=e=>Object.keys(e).length===0;async function br(e,t,n={}){try{const r=new URLSearchParams(n).toString(),o=`${e}?${r}`,i=await fetch(o,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(!i.ok){const a=await i.json();throw new Error((a==null?void 0:a.error)||`HTTP error! status: ${i.status}`)}return await i.json()}catch(r){throw console.error("Error during fetch:",r),r}}async function hO(e,t,n={}){try{const r=JSON.stringify(n),o=await jY(r,t),i=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(o)});if(!i.ok)return i.json().then(a=>{throw console.log(a.detail||"Unknown error occurred"),new Error((a==null?void 0:a.error)||`HTTP error! status: ${i.status}`)});const s=await i.json();if(s.payload){const a=await fO(s.payload,t);return JSON.parse(a.decryptedData)}return s}catch(r){throw console.error("Error during fetch:",r),r}}async function pO(e,t,n={},r="POST"){try{const o=await fetch(e,{method:r,headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(n)});return o.ok?await o.json():o.json().then(s=>{throw console.log(s.detail||"Unknown error occurred"),new Error((s==null?void 0:s.error)||`HTTP error! status: ${o.status}`)})}catch(o){throw console.error("Error during fetch:",o),o}}function FY(e){if(!e)return{tenantId:"",endUserId:""};const t=Zh(e);return{tenantId:t==null?void 0:t.tenantId,endUserId:t==null?void 0:t.endUserId}}function LY(e){return e?Zh(e).assistantProfileId:void 0}function $Y(e){if(!e)return;const t=Zh(e);if(t.params&&t.params.currencyFormat)return t.params.currencyFormat}function mO(e){return e?Zh(e).params:void 0}function RE(e){return e.charAt(0).toUpperCase()+e.slice(1)}function kE(e){return e.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substring(1).toLowerCase())}function NE(e){return e.replace(/[_-]+/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase())}const Nr="focus:ring-1 focus:ring-offset-0 focus-visible:ring-1 focus-visible:ring-offset-0",ps="focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0 focus:ring-0 focus:ring-ring focus:ring-offset-0";async function zY(){var o,i;const e=(i=(o=oe.getState())==null?void 0:o.authToken)==null?void 0:i.accessToken;if(!e)return;const n=await fetch("https://semaphor.cloud/api/v1/invalidate-token",{method:"POST",headers:{Authorization:`Bearer ${e}`}});if(!n.ok)throw new Error("Failed to invalidate token");const r=await n.json();return console.log("invalidateToken",r),r}async function BY(e,t={}){if(!e)return null;let n="https://semaphor.cloud/api/v1/dashboard";const r=Object.fromEntries(Object.entries(t).filter(([a,l])=>l!==void 0)),o=new URLSearchParams(r).toString();o&&(n+=`?${o}`);let s=await(await fetch(n,{headers:{Authorization:`Bearer ${e}`}})).json();if("payload"in s){const a=await fO(atob(s.payload),e);s=JSON.parse(a.decryptedData)}return s}async function VY(e){return e?await(await fetch("https://semaphor.cloud/api/v1/plugins",{headers:{Authorization:`Bearer ${e}`}})).json():null}const I0=e=>/boolean/i.test(e)?"boolean":/date|timestamp/i.test(e)?"date":/int|decimal|float|double|num/i.test(e)?"number":/json/i.test(e)?"json":/geo|geography|geometry/i.test(e)?"geo":"string";var eb={exports:{}};eb.exports;(function(e,t){var n=200,r="__lodash_hash_undefined__",o=800,i=16,s=9007199254740991,a="[object Arguments]",l="[object Array]",c="[object AsyncFunction]",u="[object Boolean]",d="[object Date]",h="[object Error]",p="[object Function]",g="[object GeneratorFunction]",m="[object Map]",b="[object Number]",y="[object Null]",v="[object Object]",x="[object Proxy]",S="[object RegExp]",_="[object Set]",E="[object String]",C="[object Undefined]",k="[object WeakMap]",N="[object ArrayBuffer]",M="[object DataView]",A="[object Float32Array]",P="[object Float64Array]",j="[object Int8Array]",F="[object Int16Array]",I="[object Int32Array]",O="[object Uint8Array]",$="[object Uint8ClampedArray]",B="[object Uint16Array]",z="[object Uint32Array]",T=/[\\^$.*+?()[\]{}|]/g,W=/^\[object .+?Constructor\]$/,L=/^(?:0|[1-9]\d*)$/,D={};D[A]=D[P]=D[j]=D[F]=D[I]=D[O]=D[$]=D[B]=D[z]=!0,D[a]=D[l]=D[N]=D[u]=D[M]=D[d]=D[h]=D[p]=D[m]=D[b]=D[v]=D[S]=D[_]=D[E]=D[k]=!1;var H=typeof ls=="object"&&ls&&ls.Object===Object&&ls,V=typeof self=="object"&&self&&self.Object===Object&&self,q=H||V||Function("return this")(),U=t&&!t.nodeType&&t,Y=U&&!0&&e&&!e.nodeType&&e,K=Y&&Y.exports===U,Z=K&&H.process,ee=function(){try{var G=Y&&Y.require&&Y.require("util").types;return G||Z&&Z.binding&&Z.binding("util")}catch{}}(),Q=ee&&ee.isTypedArray;function ie(G,J,se){switch(se.length){case 0:return G.call(J);case 1:return G.call(J,se[0]);case 2:return G.call(J,se[0],se[1]);case 3:return G.call(J,se[0],se[1],se[2])}return G.apply(J,se)}function te(G,J){for(var se=-1,Ne=Array(G);++se<G;)Ne[se]=J(se);return Ne}function le(G){return function(J){return G(J)}}function ue(G,J){return G==null?void 0:G[J]}function Re(G,J){return function(se){return G(J(se))}}var be=Array.prototype,we=Function.prototype,Pe=Object.prototype,Ye=q["__core-js_shared__"],_t=we.toString,me=Pe.hasOwnProperty,je=function(){var G=/[^.]+$/.exec(Ye&&Ye.keys&&Ye.keys.IE_PROTO||"");return G?"Symbol(src)_1."+G:""}(),Ae=Pe.toString,ne=_t.call(Object),ce=RegExp("^"+_t.call(me).replace(T,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ke=K?q.Buffer:void 0,De=q.Symbol,Ue=q.Uint8Array;ke&&ke.allocUnsafe;var jt=Re(Object.getPrototypeOf,Object),kn=Object.create,gn=Pe.propertyIsEnumerable,ge=be.splice,bn=De?De.toStringTag:void 0,Ot=function(){try{var G=kv(Object,"defineProperty");return G({},"",{}),G}catch{}}(),uo=ke?ke.isBuffer:void 0,On=Math.max,Sc=Date.now,Va=kv(q,"Map"),Wi=kv(Object,"create"),an=function(){function G(){}return function(J){if(!Ua(J))return{};if(kn)return kn(J);G.prototype=J;var se=new G;return G.prototype=void 0,se}}();function Rt(G){var J=-1,se=G==null?0:G.length;for(this.clear();++J<se;){var Ne=G[J];this.set(Ne[0],Ne[1])}}function Fn(){this.__data__=Wi?Wi(null):{},this.size=0}function Ie(G){var J=this.has(G)&&delete this.__data__[G];return this.size-=J?1:0,J}function Ge(G){var J=this.__data__;if(Wi){var se=J[G];return se===r?void 0:se}return me.call(J,G)?J[G]:void 0}function rt(G){var J=this.__data__;return Wi?J[G]!==void 0:me.call(J,G)}function Jt(G,J){var se=this.__data__;return this.size+=this.has(G)?0:1,se[G]=Wi&&J===void 0?r:J,this}Rt.prototype.clear=Fn,Rt.prototype.delete=Ie,Rt.prototype.get=Ge,Rt.prototype.has=rt,Rt.prototype.set=Jt;function Ft(G){var J=-1,se=G==null?0:G.length;for(this.clear();++J<se;){var Ne=G[J];this.set(Ne[0],Ne[1])}}function Lt(){this.__data__=[],this.size=0}function Dn(G){var J=this.__data__,se=rm(J,G);if(se<0)return!1;var Ne=J.length-1;return se==Ne?J.pop():ge.call(J,se,1),--this.size,!0}function en(G){var J=this.__data__,se=rm(J,G);return se<0?void 0:J[se][1]}function yn(G){return rm(this.__data__,G)>-1}function Ha(G,J){var se=this.__data__,Ne=rm(se,G);return Ne<0?(++this.size,se.push([G,J])):se[Ne][1]=J,this}Ft.prototype.clear=Lt,Ft.prototype.delete=Dn,Ft.prototype.get=en,Ft.prototype.has=yn,Ft.prototype.set=Ha;function fo(G){var J=-1,se=G==null?0:G.length;for(this.clear();++J<se;){var Ne=G[J];this.set(Ne[0],Ne[1])}}function ri(){this.size=0,this.__data__={hash:new Rt,map:new(Va||Ft),string:new Rt}}function Wa(G){var J=im(this,G).delete(G);return this.size-=J?1:0,J}function Id(G){return im(this,G).get(G)}function kG(G){return im(this,G).has(G)}function NG(G,J){var se=im(this,G),Ne=se.size;return se.set(G,J),this.size+=se.size==Ne?0:1,this}fo.prototype.clear=ri,fo.prototype.delete=Wa,fo.prototype.get=Id,fo.prototype.has=kG,fo.prototype.set=NG;function Ec(G){var J=this.__data__=new Ft(G);this.size=J.size}function MG(){this.__data__=new Ft,this.size=0}function PG(G){var J=this.__data__,se=J.delete(G);return this.size=J.size,se}function DG(G){return this.__data__.get(G)}function AG(G){return this.__data__.has(G)}function IG(G,J){var se=this.__data__;if(se instanceof Ft){var Ne=se.__data__;if(!Va||Ne.length<n-1)return Ne.push([G,J]),this.size=++se.size,this;se=this.__data__=new fo(Ne)}return se.set(G,J),this.size=se.size,this}Ec.prototype.clear=MG,Ec.prototype.delete=PG,Ec.prototype.get=DG,Ec.prototype.has=AG,Ec.prototype.set=IG;function TG(G,J){var se=Pv(G),Ne=!se&&Mv(G),mt=!se&&!Ne&&xN(G),Bt=!se&&!Ne&&!mt&&CN(G),tn=se||Ne||mt||Bt,xt=tn?te(G.length,String):[],nn=xt.length;for(var Do in G)tn&&(Do=="length"||mt&&(Do=="offset"||Do=="parent")||Bt&&(Do=="buffer"||Do=="byteLength"||Do=="byteOffset")||yN(Do,nn))||xt.push(Do);return xt}function _v(G,J,se){(se!==void 0&&!sm(G[J],se)||se===void 0&&!(J in G))&&Rv(G,J,se)}function jG(G,J,se){var Ne=G[J];(!(me.call(G,J)&&sm(Ne,se))||se===void 0&&!(J in G))&&Rv(G,J,se)}function rm(G,J){for(var se=G.length;se--;)if(sm(G[se][0],J))return se;return-1}function Rv(G,J,se){J=="__proto__"&&Ot?Ot(G,J,{configurable:!0,enumerable:!0,value:se,writable:!0}):G[J]=se}var OG=KG();function om(G){return G==null?G===void 0?C:y:bn&&bn in Object(G)?XG(G):nq(G)}function gN(G){return Td(G)&&om(G)==a}function FG(G){if(!Ua(G)||eq(G))return!1;var J=Av(G)?ce:W;return J.test(sq(G))}function LG(G){return Td(G)&&wN(G.length)&&!!D[om(G)]}function $G(G){if(!Ua(G))return tq(G);var J=vN(G),se=[];for(var Ne in G)Ne=="constructor"&&(J||!me.call(G,Ne))||se.push(Ne);return se}function bN(G,J,se,Ne,mt){G!==J&&OG(J,function(Bt,tn){if(mt||(mt=new Ec),Ua(Bt))zG(G,J,tn,se,bN,Ne,mt);else{var xt=Ne?Ne(Nv(G,tn),Bt,tn+"",G,J,mt):void 0;xt===void 0&&(xt=Bt),_v(G,tn,xt)}},SN)}function zG(G,J,se,Ne,mt,Bt,tn){var xt=Nv(G,se),nn=Nv(J,se),Do=tn.get(nn);if(Do){_v(G,se,Do);return}var Ur=Bt?Bt(xt,nn,se+"",G,J,tn):void 0,jd=Ur===void 0;if(jd){var Iv=Pv(nn),Tv=!Iv&&xN(nn),_N=!Iv&&!Tv&&CN(nn);Ur=nn,Iv||Tv||_N?Pv(xt)?Ur=xt:aq(xt)?Ur=GG(xt):Tv?(jd=!1,Ur=HG(nn)):_N?(jd=!1,Ur=UG(nn)):Ur=[]:lq(nn)||Mv(nn)?(Ur=xt,Mv(xt)?Ur=cq(xt):(!Ua(xt)||Av(xt))&&(Ur=QG(nn))):jd=!1}jd&&(tn.set(nn,Ur),mt(Ur,nn,Ne,Bt,tn),tn.delete(nn)),_v(G,se,Ur)}function BG(G,J){return oq(rq(G,J,EN),G+"")}var VG=Ot?function(G,J){return Ot(G,"toString",{configurable:!0,enumerable:!1,value:dq(J),writable:!0})}:EN;function HG(G,J){return G.slice()}function WG(G){var J=new G.constructor(G.byteLength);return new Ue(J).set(new Ue(G)),J}function UG(G,J){var se=WG(G.buffer);return new G.constructor(se,G.byteOffset,G.length)}function GG(G,J){var se=-1,Ne=G.length;for(J||(J=Array(Ne));++se<Ne;)J[se]=G[se];return J}function qG(G,J,se,Ne){var mt=!se;se||(se={});for(var Bt=-1,tn=J.length;++Bt<tn;){var xt=J[Bt],nn=void 0;nn===void 0&&(nn=G[xt]),mt?Rv(se,xt,nn):jG(se,xt,nn)}return se}function YG(G){return BG(function(J,se){var Ne=-1,mt=se.length,Bt=mt>1?se[mt-1]:void 0,tn=mt>2?se[2]:void 0;for(Bt=G.length>3&&typeof Bt=="function"?(mt--,Bt):void 0,tn&&ZG(se[0],se[1],tn)&&(Bt=mt<3?void 0:Bt,mt=1),J=Object(J);++Ne<mt;){var xt=se[Ne];xt&&G(J,xt,Ne,Bt)}return J})}function KG(G){return function(J,se,Ne){for(var mt=-1,Bt=Object(J),tn=Ne(J),xt=tn.length;xt--;){var nn=tn[++mt];if(se(Bt[nn],nn,Bt)===!1)break}return J}}function im(G,J){var se=G.__data__;return JG(J)?se[typeof J=="string"?"string":"hash"]:se.map}function kv(G,J){var se=ue(G,J);return FG(se)?se:void 0}function XG(G){var J=me.call(G,bn),se=G[bn];try{G[bn]=void 0;var Ne=!0}catch{}var mt=Ae.call(G);return Ne&&(J?G[bn]=se:delete G[bn]),mt}function QG(G){return typeof G.constructor=="function"&&!vN(G)?an(jt(G)):{}}function yN(G,J){var se=typeof G;return J=J??s,!!J&&(se=="number"||se!="symbol"&&L.test(G))&&G>-1&&G%1==0&&G<J}function ZG(G,J,se){if(!Ua(se))return!1;var Ne=typeof J;return(Ne=="number"?Dv(se)&&yN(J,se.length):Ne=="string"&&J in se)?sm(se[J],G):!1}function JG(G){var J=typeof G;return J=="string"||J=="number"||J=="symbol"||J=="boolean"?G!=="__proto__":G===null}function eq(G){return!!je&&je in G}function vN(G){var J=G&&G.constructor,se=typeof J=="function"&&J.prototype||Pe;return G===se}function tq(G){var J=[];if(G!=null)for(var se in Object(G))J.push(se);return J}function nq(G){return Ae.call(G)}function rq(G,J,se){return J=On(J===void 0?G.length-1:J,0),function(){for(var Ne=arguments,mt=-1,Bt=On(Ne.length-J,0),tn=Array(Bt);++mt<Bt;)tn[mt]=Ne[J+mt];mt=-1;for(var xt=Array(J+1);++mt<J;)xt[mt]=Ne[mt];return xt[J]=se(tn),ie(G,this,xt)}}function Nv(G,J){if(!(J==="constructor"&&typeof G[J]=="function")&&J!="__proto__")return G[J]}var oq=iq(VG);function iq(G){var J=0,se=0;return function(){var Ne=Sc(),mt=i-(Ne-se);if(se=Ne,mt>0){if(++J>=o)return arguments[0]}else J=0;return G.apply(void 0,arguments)}}function sq(G){if(G!=null){try{return _t.call(G)}catch{}try{return G+""}catch{}}return""}function sm(G,J){return G===J||G!==G&&J!==J}var Mv=gN(function(){return arguments}())?gN:function(G){return Td(G)&&me.call(G,"callee")&&!gn.call(G,"callee")},Pv=Array.isArray;function Dv(G){return G!=null&&wN(G.length)&&!Av(G)}function aq(G){return Td(G)&&Dv(G)}var xN=uo||fq;function Av(G){if(!Ua(G))return!1;var J=om(G);return J==p||J==g||J==c||J==x}function wN(G){return typeof G=="number"&&G>-1&&G%1==0&&G<=s}function Ua(G){var J=typeof G;return G!=null&&(J=="object"||J=="function")}function Td(G){return G!=null&&typeof G=="object"}function lq(G){if(!Td(G)||om(G)!=v)return!1;var J=jt(G);if(J===null)return!0;var se=me.call(J,"constructor")&&J.constructor;return typeof se=="function"&&se instanceof se&&_t.call(se)==ne}var CN=Q?le(Q):LG;function cq(G){return qG(G,SN(G))}function SN(G){return Dv(G)?TG(G):$G(G)}var uq=YG(function(G,J,se){bN(G,J,se)});function dq(G){return function(){return G}}function EN(G){return G}function fq(){return!1}e.exports=uq})(eb,eb.exports);var HY=eb.exports;const Jf=Pa(HY),WY={theme:"system",setTheme:()=>null},gO=R.createContext(WY);function UY({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[o,i]=R.useState(()=>localStorage.getItem(n)||t);R.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 f.jsx(gO.Provider,{...r,value:s,children:e})}const bO=()=>{const e=R.useContext(gO);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};var sc=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(){}},Vl=typeof window>"u"||"Deno"in globalThis;function bo(){}function GY(e,t){return typeof e=="function"?e(t):e}function w1(e){return typeof e=="number"&&e>=0&&e!==1/0}function yO(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ru(e,t){return typeof e=="function"?e(t):e}function Fo(e,t){return typeof e=="function"?e(t):e}function UN(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==ME(s,t.options))return!1}else if(!eh(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||o&&o!==t.state.fetchStatus||i&&!i(t))}function GN(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Iu(t.options.mutationKey)!==Iu(i))return!1}else if(!eh(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function ME(e,t){return((t==null?void 0:t.queryKeyHashFn)||Iu)(e)}function Iu(e){return JSON.stringify(e,(t,n)=>C1(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function eh(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!eh(e[n],t[n])):!1}function tb(e,t){if(e===t)return e;const n=qN(e)&&qN(t);if(n||C1(e)&&C1(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&&r.includes(u)||n)&&e[u]===void 0&&t[u]===void 0?(a[u]=void 0,l++):(a[u]=tb(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return o===s&&l===o?e:a}return t}function nb(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function qN(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function C1(e){if(!YN(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!YN(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function YN(e){return Object.prototype.toString.call(e)==="[object Object]"}function qY(e){return new Promise(t=>{setTimeout(t,e)})}function S1(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return tb(e,t)}catch(r){console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${r}`)}return tb(e,t)}return t}function YY(e){return e}function KY(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function XY(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var rb=Symbol();function vO(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===rb&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===rb?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var gl,Gs,mu,Ij,QY=(Ij=class extends sc{constructor(){super();Me(this,gl);Me(this,Gs);Me(this,mu);xe(this,mu,t=>{if(!Vl&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){X(this,Gs)||this.setEventListener(X(this,mu))}onUnsubscribe(){var t;this.hasListeners()||((t=X(this,Gs))==null||t.call(this),xe(this,Gs,void 0))}setEventListener(t){var n;xe(this,mu,t),(n=X(this,Gs))==null||n.call(this),xe(this,Gs,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){X(this,gl)!==t&&(xe(this,gl,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof X(this,gl)=="boolean"?X(this,gl):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},gl=new WeakMap,Gs=new WeakMap,mu=new WeakMap,Ij),PE=new QY,gu,qs,bu,Tj,ZY=(Tj=class extends sc{constructor(){super();Me(this,gu,!0);Me(this,qs);Me(this,bu);xe(this,bu,t=>{if(!Vl&&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(){X(this,qs)||this.setEventListener(X(this,bu))}onUnsubscribe(){var t;this.hasListeners()||((t=X(this,qs))==null||t.call(this),xe(this,qs,void 0))}setEventListener(t){var n;xe(this,bu,t),(n=X(this,qs))==null||n.call(this),xe(this,qs,t(this.setOnline.bind(this)))}setOnline(t){X(this,gu)!==t&&(xe(this,gu,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return X(this,gu)}},gu=new WeakMap,qs=new WeakMap,bu=new WeakMap,Tj),ob=new ZY;function E1(){let e,t;const n=new Promise((o,i)=>{e=o,t=i});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function JY(e){return Math.min(1e3*2**e,3e4)}function xO(e){return(e??"online")==="online"?ob.isOnline():!0}var wO=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Wv(e){return e instanceof wO}function CO(e){let t=!1,n=0,r=!1,o;const i=E1(),s=m=>{var b;r||(h(new wO(m)),(b=e.abort)==null||b.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>PE.isFocused()&&(e.networkMode==="always"||ob.isOnline())&&e.canRun(),u=()=>xO(e.networkMode)&&e.canRun(),d=m=>{var b;r||(r=!0,(b=e.onSuccess)==null||b.call(e,m),o==null||o(),i.resolve(m))},h=m=>{var b;r||(r=!0,(b=e.onError)==null||b.call(e,m),o==null||o(),i.reject(m))},p=()=>new Promise(m=>{var b;o=y=>{(r||c())&&m(y)},(b=e.onPause)==null||b.call(e)}).then(()=>{var m;o=void 0,r||(m=e.onContinue)==null||m.call(e)}),g=()=>{if(r)return;let m;const b=n===0?e.initialPromise:void 0;try{m=b??e.fn()}catch(y){m=Promise.reject(y)}Promise.resolve(m).then(d).catch(y=>{var E;if(r)return;const v=e.retry??(Vl?0:3),x=e.retryDelay??JY,S=typeof x=="function"?x(n,y):x,_=v===!0||typeof v=="number"&&n<v||typeof v=="function"&&v(n,y);if(t||!_){h(y);return}n++,(E=e.onFail)==null||E.call(e,n,y),qY(S).then(()=>c()?void 0:p()).then(()=>{t?h(y):g()})})};return{promise:i,cancel:s,continue:()=>(o==null||o(),i),cancelRetry:a,continueRetry:l,canStart:u,start:()=>(u()?g():p().then(g),i)}}function eK(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=a=>setTimeout(a,0);const i=a=>{t?e.push(a):o(()=>{n(a)})},s=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||s()}return l},batchCalls:a=>(...l)=>{i(()=>{a(...l)})},schedule:i,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var pn=eK(),bl,jj,SO=(jj=class{constructor(){Me(this,bl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),w1(this.gcTime)&&xe(this,bl,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Vl?1/0:5*60*1e3))}clearGcTimeout(){X(this,bl)&&(clearTimeout(X(this,bl)),xe(this,bl,void 0))}},bl=new WeakMap,jj),yu,vu,po,yl,Yn,Uh,vl,jo,Xi,Oj,tK=(Oj=class extends SO{constructor(t){super();Me(this,jo);Me(this,yu);Me(this,vu);Me(this,po);Me(this,yl);Me(this,Yn);Me(this,Uh);Me(this,vl);xe(this,vl,!1),xe(this,Uh,t.defaultOptions),this.setOptions(t.options),this.observers=[],xe(this,yl,t.client),xe(this,po,X(this,yl).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,xe(this,yu,nK(this.options)),this.state=t.state??X(this,yu),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=X(this,Yn))==null?void 0:t.promise}setOptions(t){this.options={...X(this,Uh),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&X(this,po).remove(this)}setData(t,n){const r=S1(this.state.data,t,this.options);return He(this,jo,Xi).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){He(this,jo,Xi).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=X(this,Yn))==null?void 0:r.promise;return(o=X(this,Yn))==null||o.cancel(t),n?n.then(bo).catch(bo):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(X(this,yu))}isActive(){return this.observers.some(t=>Fo(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===rb||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!yO(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=X(this,Yn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=X(this,Yn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),X(this,po).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(X(this,Yn)&&(X(this,vl)?X(this,Yn).cancel({revert:!0}):X(this,Yn).cancelRetry()),this.scheduleGc()),X(this,po).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||He(this,jo,Xi).call(this,{type:"invalidate"})}fetch(t,n){var l,c,u;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(X(this,Yn))return X(this,Yn).continueRetry(),X(this,Yn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const d=this.observers.find(h=>h.options.queryFn);d&&this.setOptions(d.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,o=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(xe(this,vl,!0),r.signal)})},i=()=>{const d=vO(this.options,n),h={client:X(this,yl),queryKey:this.queryKey,meta:this.meta};return o(h),xe(this,vl,!1),this.options.persister?this.options.persister(d,h,this):d(h)},s={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:X(this,yl),state:this.state,fetchFn:i};o(s),(l=this.options.behavior)==null||l.onFetch(s,this),xe(this,vu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=s.fetchOptions)==null?void 0:c.meta))&&He(this,jo,Xi).call(this,{type:"fetch",meta:(u=s.fetchOptions)==null?void 0:u.meta});const a=d=>{var h,p,g,m;Wv(d)&&d.silent||He(this,jo,Xi).call(this,{type:"error",error:d}),Wv(d)||((p=(h=X(this,po).config).onError)==null||p.call(h,d,this),(m=(g=X(this,po).config).onSettled)==null||m.call(g,this.state.data,d,this)),this.scheduleGc()};return xe(this,Yn,CO({initialPromise:n==null?void 0:n.initialPromise,fn:s.fetchFn,abort:r.abort.bind(r),onSuccess:d=>{var h,p,g,m;if(d===void 0){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(d)}catch(b){a(b);return}(p=(h=X(this,po).config).onSuccess)==null||p.call(h,d,this),(m=(g=X(this,po).config).onSettled)==null||m.call(g,d,this.state.error,this),this.scheduleGc()},onError:a,onFail:(d,h)=>{He(this,jo,Xi).call(this,{type:"failed",failureCount:d,error:h})},onPause:()=>{He(this,jo,Xi).call(this,{type:"pause"})},onContinue:()=>{He(this,jo,Xi).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0})),X(this,Yn).start()}},yu=new WeakMap,vu=new WeakMap,po=new WeakMap,yl=new WeakMap,Yn=new WeakMap,Uh=new WeakMap,vl=new WeakMap,jo=new WeakSet,Xi=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,...EO(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return Wv(o)&&o.revert&&X(this,vu)?{...X(this,vu),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),pn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),X(this,po).notify({query:this,type:"updated",action:t})})},Oj);function EO(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:xO(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function nK(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var ai,Fj,_O=(Fj=class extends sc{constructor(t={}){super();Me(this,ai);this.config=t,xe(this,ai,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??ME(o,n);let s=this.get(i);return s||(s=new tK({client:t,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){X(this,ai).has(t.queryHash)||(X(this,ai).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=X(this,ai).get(t.queryHash);n&&(t.destroy(),n===t&&X(this,ai).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){pn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return X(this,ai).get(t)}getAll(){return[...X(this,ai).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>UN(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>UN(t,r)):n}notify(t){pn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){pn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){pn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},ai=new WeakMap,Fj),li,cr,xl,ci,$s,Lj,rK=(Lj=class extends SO{constructor(t){super();Me(this,ci);Me(this,li);Me(this,cr);Me(this,xl);this.mutationId=t.mutationId,xe(this,cr,t.mutationCache),xe(this,li,[]),this.state=t.state||RO(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){X(this,li).includes(t)||(X(this,li).push(t),this.clearGcTimeout(),X(this,cr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){xe(this,li,X(this,li).filter(n=>n!==t)),this.scheduleGc(),X(this,cr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){X(this,li).length||(this.state.status==="pending"?this.scheduleGc():X(this,cr).remove(this))}continue(){var t;return((t=X(this,xl))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,a,l,c,u,d,h,p,g,m,b,y,v,x,S,_,E,C;xe(this,xl,CO({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(k,N)=>{He(this,ci,$s).call(this,{type:"failed",failureCount:k,error:N})},onPause:()=>{He(this,ci,$s).call(this,{type:"pause"})},onContinue:()=>{He(this,ci,$s).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>X(this,cr).canRun(this)}));const n=this.state.status==="pending",r=!X(this,xl).canStart();try{if(!n){He(this,ci,$s).call(this,{type:"pending",variables:t,isPaused:r}),await((i=(o=X(this,cr).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&&He(this,ci,$s).call(this,{type:"pending",context:N,variables:t,isPaused:r})}const k=await X(this,xl).start();return await((c=(l=X(this,cr).config).onSuccess)==null?void 0:c.call(l,k,t,this.state.context,this)),await((d=(u=this.options).onSuccess)==null?void 0:d.call(u,k,t,this.state.context)),await((p=(h=X(this,cr).config).onSettled)==null?void 0:p.call(h,k,null,this.state.variables,this.state.context,this)),await((m=(g=this.options).onSettled)==null?void 0:m.call(g,k,null,t,this.state.context)),He(this,ci,$s).call(this,{type:"success",data:k}),k}catch(k){try{throw await((y=(b=X(this,cr).config).onError)==null?void 0:y.call(b,k,t,this.state.context,this)),await((x=(v=this.options).onError)==null?void 0:x.call(v,k,t,this.state.context)),await((_=(S=X(this,cr).config).onSettled)==null?void 0:_.call(S,void 0,k,this.state.variables,this.state.context,this)),await((C=(E=this.options).onSettled)==null?void 0:C.call(E,void 0,k,t,this.state.context)),k}finally{He(this,ci,$s).call(this,{type:"error",error:k})}}finally{X(this,cr).runNext(this)}}},li=new WeakMap,cr=new WeakMap,xl=new WeakMap,ci=new WeakSet,$s=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),pn.batch(()=>{X(this,li).forEach(r=>{r.onMutationUpdate(t)}),X(this,cr).notify({mutation:this,type:"updated",action:t})})},Lj);function RO(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ns,Oo,Gh,$j,oK=($j=class extends sc{constructor(t={}){super();Me(this,ns);Me(this,Oo);Me(this,Gh);this.config=t,xe(this,ns,new Set),xe(this,Oo,new Map),xe(this,Gh,0)}build(t,n,r){const o=new rK({mutationCache:this,mutationId:++am(this,Gh)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){X(this,ns).add(t);const n=cm(t);if(typeof n=="string"){const r=X(this,Oo).get(n);r?r.push(t):X(this,Oo).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(X(this,ns).delete(t)){const n=cm(t);if(typeof n=="string"){const r=X(this,Oo).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&X(this,Oo).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=cm(t);if(typeof n=="string"){const r=X(this,Oo).get(n),o=r==null?void 0:r.find(i=>i.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=cm(t);if(typeof n=="string"){const o=(r=X(this,Oo).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){pn.batch(()=>{X(this,ns).forEach(t=>{this.notify({type:"removed",mutation:t})}),X(this,ns).clear(),X(this,Oo).clear()})}getAll(){return Array.from(X(this,ns))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>GN(n,r))}findAll(t={}){return this.getAll().filter(n=>GN(t,n))}notify(t){pn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return pn.batch(()=>Promise.all(t.map(n=>n.continue().catch(bo))))}},ns=new WeakMap,Oo=new WeakMap,Gh=new WeakMap,$j);function cm(e){var t;return(t=e.options.scope)==null?void 0:t.id}function KN(e){return{onFetch:(t,n)=>{var u,d,h,p,g;const r=t.options,o=(h=(d=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:h.direction,i=((p=t.state.data)==null?void 0:p.pages)||[],s=((g=t.state.data)==null?void 0:g.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let m=!1;const b=x=>{Object.defineProperty(x,"signal",{enumerable:!0,get:()=>(t.signal.aborted?m=!0:t.signal.addEventListener("abort",()=>{m=!0}),t.signal)})},y=vO(t.options,t.fetchOptions),v=async(x,S,_)=>{if(m)return Promise.reject();if(S==null&&x.pages.length)return Promise.resolve(x);const E={client:t.client,queryKey:t.queryKey,pageParam:S,direction:_?"backward":"forward",meta:t.options.meta};b(E);const C=await y(E),{maxPages:k}=t.options,N=_?XY:KY;return{pages:N(x.pages,C,k),pageParams:N(x.pageParams,S,k)}};if(o&&i.length){const x=o==="backward",S=x?iK:XN,_={pages:i,pageParams:s},E=S(r,_);a=await v(_,E,x)}else{const x=e??i.length;do{const S=l===0?s[0]??r.initialPageParam:XN(r,a);if(l>0&&S==null)break;a=await v(a,S),l++}while(l<x)}return a};t.options.persister?t.fetchFn=()=>{var m,b;return(b=(m=t.options).persister)==null?void 0:b.call(m,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function XN(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function iK(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var ln,Ys,Ks,xu,wu,Xs,Cu,Su,zj,sK=(zj=class{constructor(e={}){Me(this,ln);Me(this,Ys);Me(this,Ks);Me(this,xu);Me(this,wu);Me(this,Xs);Me(this,Cu);Me(this,Su);xe(this,ln,e.queryCache||new _O),xe(this,Ys,e.mutationCache||new oK),xe(this,Ks,e.defaultOptions||{}),xe(this,xu,new Map),xe(this,wu,new Map),xe(this,Xs,0)}mount(){am(this,Xs)._++,X(this,Xs)===1&&(xe(this,Cu,PE.subscribe(async e=>{e&&(await this.resumePausedMutations(),X(this,ln).onFocus())})),xe(this,Su,ob.subscribe(async e=>{e&&(await this.resumePausedMutations(),X(this,ln).onOnline())})))}unmount(){var e,t;am(this,Xs)._--,X(this,Xs)===0&&((e=X(this,Cu))==null||e.call(this),xe(this,Cu,void 0),(t=X(this,Su))==null||t.call(this),xe(this,Su,void 0))}isFetching(e){return X(this,ln).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return X(this,Ys).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=X(this,ln).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=X(this,ln).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(ru(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return X(this,ln).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=X(this,ln).get(r.queryHash),i=o==null?void 0:o.state.data,s=GY(t,i);if(s!==void 0)return X(this,ln).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return pn.batch(()=>X(this,ln).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=X(this,ln).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=X(this,ln);pn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=X(this,ln);return pn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=pn.batch(()=>X(this,ln).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(bo).catch(bo)}invalidateQueries(e,t={}){return pn.batch(()=>(X(this,ln).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=pn.batch(()=>X(this,ln).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(bo)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(bo)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=X(this,ln).build(this,t);return n.isStaleByTime(ru(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(bo).catch(bo)}fetchInfiniteQuery(e){return e.behavior=KN(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(bo).catch(bo)}ensureInfiniteQueryData(e){return e.behavior=KN(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ob.isOnline()?X(this,Ys).resumePausedMutations():Promise.resolve()}getQueryCache(){return X(this,ln)}getMutationCache(){return X(this,Ys)}getDefaultOptions(){return X(this,Ks)}setDefaultOptions(e){xe(this,Ks,e)}setQueryDefaults(e,t){X(this,xu).set(Iu(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...X(this,xu).values()],n={};return t.forEach(r=>{eh(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){X(this,wu).set(Iu(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...X(this,wu).values()],n={};return t.forEach(r=>{eh(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...X(this,Ks).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=ME(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===rb&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...X(this,Ks).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){X(this,ln).clear(),X(this,Ys).clear()}},ln=new WeakMap,Ys=new WeakMap,Ks=new WeakMap,xu=new WeakMap,wu=new WeakMap,Xs=new WeakMap,Cu=new WeakMap,Su=new WeakMap,zj),Ar,ft,qh,ur,wl,Eu,Qs,ui,Yh,_u,Ru,Cl,Sl,Zs,ku,It,nf,_1,R1,k1,N1,M1,P1,D1,kO,Bj,DE=(Bj=class extends sc{constructor(t,n){super();Me(this,It);Me(this,Ar);Me(this,ft);Me(this,qh);Me(this,ur);Me(this,wl);Me(this,Eu);Me(this,Qs);Me(this,ui);Me(this,Yh);Me(this,_u);Me(this,Ru);Me(this,Cl);Me(this,Sl);Me(this,Zs);Me(this,ku,new Set);this.options=n,xe(this,Ar,t),xe(this,ui,null),xe(this,Qs,E1()),this.options.experimental_prefetchInRender||X(this,Qs).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(X(this,ft).addObserver(this),QN(X(this,ft),this.options)?He(this,It,nf).call(this):this.updateResult(),He(this,It,N1).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return A1(X(this,ft),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return A1(X(this,ft),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,He(this,It,M1).call(this),He(this,It,P1).call(this),X(this,ft).removeObserver(this)}setOptions(t,n){const r=this.options,o=X(this,ft);if(this.options=X(this,Ar).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Fo(this.options.enabled,X(this,ft))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");He(this,It,D1).call(this),X(this,ft).setOptions(this.options),r._defaulted&&!nb(this.options,r)&&X(this,Ar).getQueryCache().notify({type:"observerOptionsUpdated",query:X(this,ft),observer:this});const i=this.hasListeners();i&&ZN(X(this,ft),o,this.options,r)&&He(this,It,nf).call(this),this.updateResult(n),i&&(X(this,ft)!==o||Fo(this.options.enabled,X(this,ft))!==Fo(r.enabled,X(this,ft))||ru(this.options.staleTime,X(this,ft))!==ru(r.staleTime,X(this,ft)))&&He(this,It,_1).call(this);const s=He(this,It,R1).call(this);i&&(X(this,ft)!==o||Fo(this.options.enabled,X(this,ft))!==Fo(r.enabled,X(this,ft))||s!==X(this,Zs))&&He(this,It,k1).call(this,s)}getOptimisticResult(t){const n=X(this,Ar).getQueryCache().build(X(this,Ar),t),r=this.createResult(n,t);return lK(this,r)&&(xe(this,ur,r),xe(this,Eu,this.options),xe(this,wl,X(this,ft).state)),r}getCurrentResult(){return X(this,ur)}trackResult(t,n){const r={};return Object.keys(t).forEach(o=>{Object.defineProperty(r,o,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(o),n==null||n(o),t[o])})}),r}trackProp(t){X(this,ku).add(t)}getCurrentQuery(){return X(this,ft)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=X(this,Ar).defaultQueryOptions(t),r=X(this,Ar).getQueryCache().build(X(this,Ar),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return He(this,It,nf).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),X(this,ur)))}createResult(t,n){var k;const r=X(this,ft),o=this.options,i=X(this,ur),s=X(this,wl),a=X(this,Eu),c=t!==r?t.state:X(this,qh),{state:u}=t;let d={...u},h=!1,p;if(n._optimisticResults){const N=this.hasListeners(),M=!N&&QN(t,n),A=N&&ZN(t,r,n,o);(M||A)&&(d={...d,...EO(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:g,errorUpdatedAt:m,status:b}=d;if(n.select&&d.data!==void 0)if(i&&d.data===(s==null?void 0:s.data)&&n.select===X(this,Yh))p=X(this,_u);else try{xe(this,Yh,n.select),p=n.select(d.data),p=S1(i==null?void 0:i.data,p,n),xe(this,_u,p),xe(this,ui,null)}catch(N){xe(this,ui,N)}else p=d.data;if(n.placeholderData!==void 0&&p===void 0&&b==="pending"){let N;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))N=i.data;else if(N=typeof n.placeholderData=="function"?n.placeholderData((k=X(this,Ru))==null?void 0:k.state.data,X(this,Ru)):n.placeholderData,n.select&&N!==void 0)try{N=n.select(N),xe(this,ui,null)}catch(M){xe(this,ui,M)}N!==void 0&&(b="success",p=S1(i==null?void 0:i.data,N,n),h=!0)}X(this,ui)&&(g=X(this,ui),p=X(this,_u),m=Date.now(),b="error");const y=d.fetchStatus==="fetching",v=b==="pending",x=b==="error",S=v&&y,_=p!==void 0,C={status:b,fetchStatus:d.fetchStatus,isPending:v,isSuccess:b==="success",isError:x,isInitialLoading:S,isLoading:S,data:p,dataUpdatedAt:d.dataUpdatedAt,error:g,errorUpdatedAt:m,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:y,isRefetching:y&&!v,isLoadingError:x&&!_,isPaused:d.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:x&&_,isStale:AE(t,n),refetch:this.refetch,promise:X(this,Qs)};if(this.options.experimental_prefetchInRender){const N=P=>{C.status==="error"?P.reject(C.error):C.data!==void 0&&P.resolve(C.data)},M=()=>{const P=xe(this,Qs,C.promise=E1());N(P)},A=X(this,Qs);switch(A.status){case"pending":t.queryHash===r.queryHash&&N(A);break;case"fulfilled":(C.status==="error"||C.data!==A.value)&&M();break;case"rejected":(C.status!=="error"||C.error!==A.reason)&&M();break}}return C}updateResult(t){const n=X(this,ur),r=this.createResult(X(this,ft),this.options);if(xe(this,wl,X(this,ft).state),xe(this,Eu,this.options),X(this,wl).data!==void 0&&xe(this,Ru,X(this,ft)),nb(r,n))return;xe(this,ur,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!X(this,ku).size)return!0;const l=new Set(a??X(this,ku));return this.options.throwOnError&&l.add("error"),Object.keys(X(this,ur)).some(c=>{const u=c;return X(this,ur)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),He(this,It,kO).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&He(this,It,N1).call(this)}},Ar=new WeakMap,ft=new WeakMap,qh=new WeakMap,ur=new WeakMap,wl=new WeakMap,Eu=new WeakMap,Qs=new WeakMap,ui=new WeakMap,Yh=new WeakMap,_u=new WeakMap,Ru=new WeakMap,Cl=new WeakMap,Sl=new WeakMap,Zs=new WeakMap,ku=new WeakMap,It=new WeakSet,nf=function(t){He(this,It,D1).call(this);let n=X(this,ft).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(bo)),n},_1=function(){He(this,It,M1).call(this);const t=ru(this.options.staleTime,X(this,ft));if(Vl||X(this,ur).isStale||!w1(t))return;const r=yO(X(this,ur).dataUpdatedAt,t)+1;xe(this,Cl,setTimeout(()=>{X(this,ur).isStale||this.updateResult()},r))},R1=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(X(this,ft)):this.options.refetchInterval)??!1},k1=function(t){He(this,It,P1).call(this),xe(this,Zs,t),!(Vl||Fo(this.options.enabled,X(this,ft))===!1||!w1(X(this,Zs))||X(this,Zs)===0)&&xe(this,Sl,setInterval(()=>{(this.options.refetchIntervalInBackground||PE.isFocused())&&He(this,It,nf).call(this)},X(this,Zs)))},N1=function(){He(this,It,_1).call(this),He(this,It,k1).call(this,He(this,It,R1).call(this))},M1=function(){X(this,Cl)&&(clearTimeout(X(this,Cl)),xe(this,Cl,void 0))},P1=function(){X(this,Sl)&&(clearInterval(X(this,Sl)),xe(this,Sl,void 0))},D1=function(){const t=X(this,Ar).getQueryCache().build(X(this,Ar),this.options);if(t===X(this,ft))return;const n=X(this,ft);xe(this,ft,t),xe(this,qh,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},kO=function(t){pn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(X(this,ur))}),X(this,Ar).getQueryCache().notify({query:X(this,ft),type:"observerResultsUpdated"})})},Bj);function aK(e,t){return Fo(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function QN(e,t){return aK(e,t)||e.state.data!==void 0&&A1(e,t,t.refetchOnMount)}function A1(e,t,n){if(Fo(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&AE(e,t)}return!1}function ZN(e,t,n,r){return(e!==t||Fo(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&AE(e,n)}function AE(e,t){return Fo(t.enabled,e)!==!1&&e.isStaleByTime(ru(t.staleTime,e))}function lK(e,t){return!nb(e.getCurrentResult(),t)}function JN(e,t){return e.filter(n=>!t.includes(n))}function cK(e,t,n){const r=e.slice(0);return r[t]=n,r}var El,mo,Nu,Mu,go,Js,Kh,Xh,Qh,Wn,I1,T1,j1,O1,F1,Vj,uK=(Vj=class extends sc{constructor(t,n,r){super();Me(this,Wn);Me(this,El);Me(this,mo);Me(this,Nu);Me(this,Mu);Me(this,go);Me(this,Js);Me(this,Kh);Me(this,Xh);Me(this,Qh,[]);xe(this,El,t),xe(this,Mu,r),xe(this,Nu,[]),xe(this,go,[]),xe(this,mo,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&X(this,go).forEach(t=>{t.subscribe(n=>{He(this,Wn,O1).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,X(this,go).forEach(t=>{t.destroy()})}setQueries(t,n,r){if(xe(this,Nu,t),xe(this,Mu,n),process.env.NODE_ENV!=="production"){const o=t.map(i=>X(this,El).defaultQueryOptions(i).queryHash);new Set(o).size!==o.length&&console.warn("[QueriesObserver]: Duplicate Queries found. This might result in unexpected behavior.")}pn.batch(()=>{const o=X(this,go),i=He(this,Wn,j1).call(this,X(this,Nu));xe(this,Qh,i),i.forEach(c=>c.observer.setOptions(c.defaultedQueryOptions,r));const s=i.map(c=>c.observer),a=s.map(c=>c.getCurrentResult()),l=s.some((c,u)=>c!==o[u]);o.length===s.length&&!l||(xe(this,go,s),xe(this,mo,a),this.hasListeners()&&(JN(o,s).forEach(c=>{c.destroy()}),JN(s,o).forEach(c=>{c.subscribe(u=>{He(this,Wn,O1).call(this,c,u)})}),He(this,Wn,F1).call(this)))})}getCurrentResult(){return X(this,mo)}getQueries(){return X(this,go).map(t=>t.getCurrentQuery())}getObservers(){return X(this,go)}getOptimisticResult(t,n){const r=He(this,Wn,j1).call(this,t),o=r.map(i=>i.observer.getOptimisticResult(i.defaultedQueryOptions));return[o,i=>He(this,Wn,T1).call(this,i??o,n),()=>He(this,Wn,I1).call(this,o,r)]}},El=new WeakMap,mo=new WeakMap,Nu=new WeakMap,Mu=new WeakMap,go=new WeakMap,Js=new WeakMap,Kh=new WeakMap,Xh=new WeakMap,Qh=new WeakMap,Wn=new WeakSet,I1=function(t,n){return n.map((r,o)=>{const i=t[o];return r.defaultedQueryOptions.notifyOnChangeProps?i:r.observer.trackResult(i,s=>{n.forEach(a=>{a.observer.trackProp(s)})})})},T1=function(t,n){return n?((!X(this,Js)||X(this,mo)!==X(this,Xh)||n!==X(this,Kh))&&(xe(this,Kh,n),xe(this,Xh,X(this,mo)),xe(this,Js,tb(X(this,Js),n(t)))),X(this,Js)):t},j1=function(t){const n=new Map(X(this,go).map(o=>[o.options.queryHash,o])),r=[];return t.forEach(o=>{const i=X(this,El).defaultQueryOptions(o),s=n.get(i.queryHash);s?r.push({defaultedQueryOptions:i,observer:s}):r.push({defaultedQueryOptions:i,observer:new DE(X(this,El),i)})}),r},O1=function(t,n){const r=X(this,go).indexOf(t);r!==-1&&(xe(this,mo,cK(X(this,mo),r,n)),He(this,Wn,F1).call(this))},F1=function(){var t;if(this.hasListeners()){const n=X(this,Js),r=He(this,Wn,I1).call(this,X(this,mo),X(this,Qh)),o=He(this,Wn,T1).call(this,r,(t=X(this,Mu))==null?void 0:t.combine);n!==o&&pn.batch(()=>{this.listeners.forEach(i=>{i(X(this,mo))})})}},Vj),IE=w.createContext(void 0),tp=e=>{const t=w.useContext(IE);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},dK=({client:e,children:t})=>(w.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),f.jsx(IE.Provider,{value:e,children:t})),NO=w.createContext(!1),MO=()=>w.useContext(NO);NO.Provider;function fK(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var hK=w.createContext(fK()),PO=()=>w.useContext(hK);function DO(e,t){return typeof e=="function"?e(...t):!!e}function ib(){}var AO=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},IO=e=>{w.useEffect(()=>{e.clearReset()},[e])},TO=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||DO(n,[e.error,r])),jO=e=>{const t=e.staleTime;e.suspense&&(e.staleTime=typeof t=="function"?(...n)=>Math.max(t(...n),1e3):Math.max(t??1e3,1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},OO=(e,t)=>e.isLoading&&e.isFetching&&!t,L1=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,sb=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function pK({queries:e,...t},n){const r=tp(),o=MO(),i=PO(),s=w.useMemo(()=>e.map(m=>{const b=r.defaultQueryOptions(m);return b._optimisticResults=o?"isRestoring":"optimistic",b}),[e,r,o]);s.forEach(m=>{jO(m),AO(m,i)}),IO(i);const[a]=w.useState(()=>new uK(r,s,t)),[l,c,u]=a.getOptimisticResult(s,t.combine),d=!o&&t.subscribed!==!1;w.useSyncExternalStore(w.useCallback(m=>d?a.subscribe(pn.batchCalls(m)):ib,[a,d]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),w.useEffect(()=>{a.setQueries(s,t,{listeners:!1})},[s,t,a]);const p=l.some((m,b)=>L1(s[b],m))?l.flatMap((m,b)=>{const y=s[b];if(y){const v=new DE(r,y);if(L1(y,m))return sb(y,v,i);OO(m,o)&&sb(y,v,i)}return[]}):[];if(p.length>0)throw Promise.all(p);const g=l.find((m,b)=>{const y=s[b];return y&&TO({result:m,errorResetBoundary:i,throwOnError:y.throwOnError,query:r.getQueryCache().get(y.queryHash),suspense:y.suspense})});if(g!=null&&g.error)throw g.error;return c(u())}function mK(e,t,n){var d,h,p,g,m;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=tp(),o=MO(),i=PO(),s=r.defaultQueryOptions(e);(h=(d=r.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||h.call(d,s),process.env.NODE_ENV!=="production"&&(s.queryFn||console.error(`[${s.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),s._optimisticResults=o?"isRestoring":"optimistic",jO(s),AO(s,i),IO(i);const a=!r.getQueryCache().get(s.queryHash),[l]=w.useState(()=>new t(r,s)),c=l.getOptimisticResult(s),u=!o&&e.subscribed!==!1;if(w.useSyncExternalStore(w.useCallback(b=>{const y=u?l.subscribe(pn.batchCalls(b)):ib;return l.updateResult(),y},[l,u]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),w.useEffect(()=>{l.setOptions(s,{listeners:!1})},[s,l]),L1(s,c))throw sb(s,l,i);if(TO({result:c,errorResetBoundary:i,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash),suspense:s.suspense}))throw c.error;if((g=(p=r.getDefaultOptions().queries)==null?void 0:p._experimental_afterQuery)==null||g.call(p,s,c),s.experimental_prefetchInRender&&!Vl&&OO(c,o)){const b=a?sb(s,l,i):(m=r.getQueryCache().get(s.queryHash))==null?void 0:m.promise;b==null||b.catch(ib).finally(()=>{l.updateResult()})}return s.notifyOnChangeProps?c:l.trackResult(c)}function Tn(e,t){return mK(e,DE)}function gK(){const e=R.useContext(IE);if(e&&e.isSemaphorClient)return e}function FO({children:e}){const{setIsSessionExpired:t}=on(),n=gK(),[r]=R.useState(()=>{const o=new sK({queryCache:new _O({onError:i=>{i instanceof Error?(console.error(`Something went wrong: ${i.message}`),i.message==="invalid token"&&t(!0)):console.error("Something went wrong:",i)}}),defaultOptions:{queries:{gcTime:36e5,staleTime:3e5,refetchOnWindowFocus:!1,retry:1}}});return o.isSemaphorClient=!0,o});return n?f.jsx(f.Fragment,{children:e}):f.jsx(dK,{client:r,children:e})}const Qo=R.forwardRef(({children:e,className:t,...n},r)=>f.jsx("div",{className:re("semaphor-scope",t),ref:r,...n,children:e})),bK={id:"",authToken:void 0,tokenProps:{}},TE=R.createContext(bK),LO=({children:e,dashboardProps:t})=>{const n=R.useMemo(()=>{let r={};const o=t.authToken;return o&&(r=Zh(o.accessToken)),{...t,tokenProps:r}},[t]);return f.jsx(FO,{children:f.jsx(TE.Provider,{value:n,children:f.jsx(Qo,{style:{height:"100%",width:"100%"},children:e})})})};function ir(){const e=R.useContext(TE);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}const sd=Es()(Jh(e=>({selectedDashboard:null,selectedVisual:null,lastSelectedDashboard:null,lastSelectedVisual:null,actions:{selectDashboard:t=>{e(n=>{var r;((r=n.selectedDashboard)==null?void 0:r.id)!==t.id&&(n.lastSelectedDashboard=n.selectedDashboard,n.selectedDashboard=t)})},selectVisual:t=>{e(n=>{n.lastSelectedVisual=n.selectedVisual,n.selectedVisual=t})},clearSelectedDashboard:()=>{e(t=>{t.lastSelectedDashboard=t.selectedDashboard,t.selectedDashboard=null})},clearSelectedVisual:()=>{e(t=>{t.lastSelectedVisual=t.selectedVisual,t.selectedVisual=null})}}}))),yK=()=>sd(e=>e.selectedVisual),vK=()=>sd(e=>e.actions),xK=e=>sd(t=>{var n;return((n=t.selectedDashboard)==null?void 0:n.id)===e}),wK=e=>sd(t=>{var n;return((n=t.selectedVisual)==null?void 0:n.id)===e});function CK(){const e=sd(c=>c.selectedDashboard),{authToken:t,version:n}=ir(),r=oe(c=>c.selectedLensId);function o(){if(!(t!=null&&t.accessToken))return!1}const{data:i,isLoading:s,isFetching:a,isError:l}=Tn({queryKey:["dashboard",r,t==null?void 0:t.accessToken,e==null?void 0:e.id],queryFn:()=>BY(t==null?void 0:t.accessToken,{lensId:r,version:n,dashboardId:e==null?void 0:e.id}),enabled:o()});return{data:i,isLoading:s,isFetching:a,isError:l}}function SK(){const{authToken:e}=ir(),t=oe(r=>r.authToken),{setAuthToken:n}=on();return R.useEffect(()=>{e&&(e==null?void 0:e.toString())!==(t==null?void 0:t.toString())&&n(e)},[e,t,n]),e}const $O=(e,t)=>{const n={};if(e===null||t===null)return t;const r=new Set([...Object.keys(e),...Object.keys(t)]);for(const o of r){if(!(o in e)&&o in t){n[o]=t[o];continue}if(o in e&&!(o in t)){n[o]=void 0;continue}const i=e[o],s=t[o];if(!$1(i,s))if(Array.isArray(i)&&Array.isArray(s))n[o]=s;else if(eM(i)&&eM(s)){const a=$O(i,s);Object.keys(a).length>0&&(n[o]=a)}else n[o]=s}return n},$1=(e,t)=>{if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((o,i)=>$1(o,t[i]));const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(o=>$1(e[o],t[o]))}return!1},eM=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),th=e=>{if(e===null||typeof e!="object")return e;if(e instanceof Date)return new Date(e);if(e instanceof RegExp)return new RegExp(e);if(Array.isArray(e))return e.map(n=>th(n));const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=th(e[n]));return t};function zO(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function tM(e,t){const n=zO(e);return n==="dark"?Jf({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function EK({customStyle:e,currentTheme:t,onSave:n,onEvent:r,defaultFilterValues:o,selectedSheetId:i,onFilterValuesChange:s}){const{authToken:a}=ir();SK();const l=oe(O=>O.selectedLensId),{data:c,isLoading:u,isFetching:d,isError:h}=CK(),[p,g]=R.useState(o||[]),{theme:m,setTheme:b}=bO(),y=oe(O=>O.dashboard.globalStyle),{setDashboard:v,setDashboardWithFilterValues:x,setSelectedSheetId:S,setStyle:_,setOnSaveFunction:E,setLenses:C,setSelectedLensId:k,setInitStore:N}=on();oe(O=>O.actions.setCustomCards);const M=oe(O=>O.actions.setFilterValues),A=oe(O=>O.filterValues),P=oe(O=>O.actions.setThemeStyle),j=oe(O=>O.actions.setDashboardTheme),F=oe(O=>O.actions.setOnEvent);R.useEffect(()=>{a&&N()},[a,N]),R.useEffect(()=>{if(m){const O=zO(m);j(O)}},[m,j]),R.useEffect(()=>{t&&b(t)},[t,b]);const I=R.useCallback(()=>{const O=th(Jg),$=Jf(O,y);if(e){const B=Jf($,e),z=tM(m,B);P(z),_(B)}else{const B=tM(m,$);P(B),_(Jg)}},[m,e,y,P,_]);return R.useEffect(()=>{c&&c.dashboard&&I()},[m,e,y,I,c]),R.useEffect(()=>{var L,D;function O(H,V){const q=H.filters||[],U=[];for(const Y of V){const K=q.find(Z=>Z.id===Y.filterId);K&&U.push({filterId:Y.filterId,connectionType:K.database==="NA"?"api":"database",name:K.column,operation:K.operation,valueType:nu(K),values:Y.values})}return U}if(!c||!c.dashboard)return;const{dashboard:$,filterValues:B,defaultLensId:z,lenses:T}=c;function W(){var V;if(B&&(B==null?void 0:B.length)>0)return B;const H=O($,p||[]);return H&&(H==null?void 0:H.length)>0?H:$.defaultFilterValues&&((V=$.defaultFilterValues)==null?void 0:V.length)>0?$.defaultFilterValues:[]}x($,W()),T&&C(T),z&&k(z),S(i||((D=(L=$==null?void 0:$.sheets)==null?void 0:L[0])==null?void 0:D.id)||null)},[c,v,S,M,l,C,x,k,p,i]),R.useEffect(()=>{s&&A&&s(A)},[A,s]),R.useEffect(()=>{n&&E(n),r&&F(r)},[n,E,r,F]),{isFetching:d,isLoading:u,isError:h}}function ms({className:e,...t}){return f.jsx("div",{className:re("animate-pulse rounded-md bg-muted",e),...t})}const ab=w.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:re("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));ab.displayName="Card";const Tu=w.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:re("flex flex-col space-y-1.5 p-6",e),...t}));Tu.displayName="CardHeader";const fa=w.forwardRef(({className:e,...t},n)=>f.jsx("h3",{ref:n,className:re("text-2xl font-semibold leading-none tracking-tight",e),...t}));fa.displayName="CardTitle";const jE=w.forwardRef(({className:e,...t},n)=>f.jsx("p",{ref:n,className:re("text-sm text-muted-foreground",e),...t}));jE.displayName="CardDescription";const nh=w.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:re("px-6 pt-0",e),...t}));nh.displayName="CardContent";const BO=w.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:re("flex items-center p-6 pt-0",e),...t}));BO.displayName="CardFooter";function VO({className:e,customStyle:t,onSave:n,onEvent:r,LoadingComponent:o,ErrorComponent:i,onChartElementClicked:s,id:a,authToken:l,currentTheme:c,version:u,customCards:d,showAssistant:h,defaultFilterValues:p,onFilterValuesChange:g,selectedSheetId:m,eventHandlers:b,...y}){const{placeholders:v}=ir(),x=oe(C=>C.themeStyle),S=oe(C=>C.isSessionExpired),{isLoading:_,isError:E}=EK({customStyle:t,currentTheme:c,onSave:n,onEvent:r,defaultFilterValues:p,onFilterValuesChange:g,selectedSheetId:m});return _||!l?(r==null||r({type:"info",message:"Loading dashboard"}),o?f.jsx(o,{message:"loading"}):f.jsx("div",{className:"flex items-center gap-3",children:f.jsx(ms,{className:"h-1 w-full dark:h-[2px]"})})):E?(r==null||r({type:"error",message:"Error fetching dashboard"}),i?(console.log("Error fetching dashboard"),f.jsx(i,{})):f.jsx("div",{children:"Error"})):S?(r==null||r({type:"error",message:"Session Expired"}),v!=null&&v.SessionExpired?f.jsx("div",{className:"flex h-full items-center justify-center",children:f.jsx("div",{children:v.SessionExpired})}):f.jsx("div",{className:"flex h-full items-center justify-center",children:f.jsxs("div",{className:"space-y-4 rounded-md border border-muted p-10",children:[f.jsx(fa,{children:"Session Expired"}),f.jsx("p",{className:"text-muted-foreground",children:"Please refresh your page to continue"})]})})):f.jsx("div",{className:re("isolate flex grow flex-col",x==null?void 0:x.dashboardPanel,e),style:{},"data-role":"dashboard-panel",...y})}function fe(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 _K(e,t){const n=w.createContext(t),r=i=>{const{children:s,...a}=i,l=w.useMemo(()=>a,Object.values(a));return f.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function o(i){const s=w.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function Pn(e,t=[]){let n=[];function r(i,s){const a=w.createContext(s),l=n.length;n=[...n,s];const c=d=>{var y;const{scope:h,children:p,...g}=d,m=((y=h==null?void 0:h[e])==null?void 0:y[l])||a,b=w.useMemo(()=>g,Object.values(g));return f.jsx(m.Provider,{value:b,children:p})};c.displayName=i+"Provider";function u(d,h){var m;const p=((m=h==null?void 0:h[e])==null?void 0:m[l])||a,g=w.useContext(p);if(g)return g;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[c,u]}const o=()=>{const i=n.map(s=>w.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return w.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,RK(o,...t)]}function RK(...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 d=l(i)[`__scope${c}`];return{...a,...d}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function nM(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function vr(...e){return t=>{let n=!1;const r=e.map(o=>{const i=nM(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():nM(e[o],null)}}}}function Ve(...e){return w.useCallback(vr(...e),e)}var z1=w.forwardRef((e,t)=>{const{children:n,...r}=e,o=w.Children.toArray(n),i=o.find(NK);if(i){const s=i.props.children,a=o.map(l=>l===i?w.Children.count(s)>1?w.Children.only(null):w.isValidElement(s)?s.props.children:null:l);return f.jsx(B1,{...r,ref:t,children:w.isValidElement(s)?w.cloneElement(s,void 0,a):null})}return f.jsx(B1,{...r,ref:t,children:n})});z1.displayName="Slot";var B1=w.forwardRef((e,t)=>{const{children:n,...r}=e;if(w.isValidElement(n)){const o=PK(n),i=MK(r,n.props);return n.type!==w.Fragment&&(i.ref=t?vr(t,o):o),w.cloneElement(n,i)}return w.Children.count(n)>1?w.Children.only(null):null});B1.displayName="SlotClone";var kK=({children:e})=>f.jsx(f.Fragment,{children:e});function NK(e){return w.isValidElement(e)&&e.type===kK}function MK(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 PK(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function T0(e){const t=e+"CollectionProvider",[n,r]=Pn(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=p=>{const{scope:g,children:m}=p,b=R.useRef(null),y=R.useRef(new Map).current;return f.jsx(o,{scope:g,itemMap:y,collectionRef:b,children:m})};s.displayName=t;const a=e+"CollectionSlot",l=R.forwardRef((p,g)=>{const{scope:m,children:b}=p,y=i(a,m),v=Ve(g,y.collectionRef);return f.jsx(z1,{ref:v,children:b})});l.displayName=a;const c=e+"CollectionItemSlot",u="data-radix-collection-item",d=R.forwardRef((p,g)=>{const{scope:m,children:b,...y}=p,v=R.useRef(null),x=Ve(g,v),S=i(c,m);return R.useEffect(()=>(S.itemMap.set(v,{ref:v,...y}),()=>void S.itemMap.delete(v))),f.jsx(z1,{[u]:"",ref:x,children:b})});d.displayName=c;function h(p){const g=i(e+"CollectionConsumer",p);return R.useCallback(()=>{const b=g.collectionRef.current;if(!b)return[];const y=Array.from(b.querySelectorAll(`[${u}]`));return Array.from(g.itemMap.values()).sort((S,_)=>y.indexOf(S.ref.current)-y.indexOf(_.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:s,Slot:l,ItemSlot:d},h,r]}var Vn=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{},DK=w.useId||(()=>{}),AK=0;function _n(e){const[t,n]=w.useState(DK());return Vn(()=>{n(r=>r??String(AK++))},[e]),t?`radix-${t}`:""}var HO=w.forwardRef((e,t)=>{const{children:n,...r}=e,o=w.Children.toArray(n),i=o.find(TK);if(i){const s=i.props.children,a=o.map(l=>l===i?w.Children.count(s)>1?w.Children.only(null):w.isValidElement(s)?s.props.children:null:l);return f.jsx(V1,{...r,ref:t,children:w.isValidElement(s)?w.cloneElement(s,void 0,a):null})}return f.jsx(V1,{...r,ref:t,children:n})});HO.displayName="Slot";var V1=w.forwardRef((e,t)=>{const{children:n,...r}=e;if(w.isValidElement(n)){const o=OK(n),i=jK(r,n.props);return n.type!==w.Fragment&&(i.ref=t?vr(t,o):o),w.cloneElement(n,i)}return w.Children.count(n)>1?w.Children.only(null):null});V1.displayName="SlotClone";var IK=({children:e})=>f.jsx(f.Fragment,{children:e});function TK(e){return w.isValidElement(e)&&e.type===IK}function jK(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 OK(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var FK=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],_e=FK.reduce((e,t)=>{const n=w.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?HO:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),f.jsx(a,{...s,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function WO(e,t){e&&vs.flushSync(()=>e.dispatchEvent(t))}function Mn(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function or({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=LK({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=Mn(n),l=w.useCallback(c=>{if(i){const d=typeof c=="function"?c(e):c;d!==e&&a(d)}else o(c)},[i,e,o,a]);return[s,l]}function LK({defaultProp:e,onChange:t}){const n=w.useState(e),[r]=n,o=w.useRef(r),i=Mn(t);return w.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}var $K=w.createContext(void 0);function ac(e){const t=w.useContext($K);return e||t||"ltr"}var Uv="rovingFocusGroup.onEntryFocus",zK={bubbles:!1,cancelable:!0},j0="RovingFocusGroup",[H1,UO,BK]=T0(j0),[VK,ad]=Pn(j0,[BK]),[HK,WK]=VK(j0),GO=w.forwardRef((e,t)=>f.jsx(H1.Provider,{scope:e.__scopeRovingFocusGroup,children:f.jsx(H1.Slot,{scope:e.__scopeRovingFocusGroup,children:f.jsx(UK,{...e,ref:t})})}));GO.displayName=j0;var UK=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=e,h=w.useRef(null),p=Ve(t,h),g=ac(i),[m=null,b]=or({prop:s,defaultProp:a,onChange:l}),[y,v]=w.useState(!1),x=Mn(c),S=UO(n),_=w.useRef(!1),[E,C]=w.useState(0);return w.useEffect(()=>{const k=h.current;if(k)return k.addEventListener(Uv,x),()=>k.removeEventListener(Uv,x)},[x]),f.jsx(HK,{scope:n,orientation:r,dir:g,loop:o,currentTabStopId:m,onItemFocus:w.useCallback(k=>b(k),[b]),onItemShiftTab:w.useCallback(()=>v(!0),[]),onFocusableItemAdd:w.useCallback(()=>C(k=>k+1),[]),onFocusableItemRemove:w.useCallback(()=>C(k=>k-1),[]),children:f.jsx(_e.div,{tabIndex:y||E===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:"none",...e.style},onMouseDown:fe(e.onMouseDown,()=>{_.current=!0}),onFocus:fe(e.onFocus,k=>{const N=!_.current;if(k.target===k.currentTarget&&N&&!y){const M=new CustomEvent(Uv,zK);if(k.currentTarget.dispatchEvent(M),!M.defaultPrevented){const A=S().filter(O=>O.focusable),P=A.find(O=>O.active),j=A.find(O=>O.id===m),I=[P,j,...A].filter(Boolean).map(O=>O.ref.current);KO(I,u)}}_.current=!1}),onBlur:fe(e.onBlur,()=>v(!1))})})}),qO="RovingFocusGroupItem",YO=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=_n(),l=i||a,c=WK(qO,n),u=c.currentTabStopId===l,d=UO(n),{onFocusableItemAdd:h,onFocusableItemRemove:p}=c;return w.useEffect(()=>{if(r)return h(),()=>p()},[r,h,p]),f.jsx(H1.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:f.jsx(_e.span,{tabIndex:u?0:-1,"data-orientation":c.orientation,...s,ref:t,onMouseDown:fe(e.onMouseDown,g=>{r?c.onItemFocus(l):g.preventDefault()}),onFocus:fe(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:fe(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){c.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const m=YK(g,c.orientation,c.dir);if(m!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let y=d().filter(v=>v.focusable).map(v=>v.ref.current);if(m==="last")y.reverse();else if(m==="prev"||m==="next"){m==="prev"&&y.reverse();const v=y.indexOf(g.currentTarget);y=c.loop?KK(y,v+1):y.slice(v+1)}setTimeout(()=>KO(y))}})})})});YO.displayName=qO;var GK={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function qK(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function YK(e,t,n){const r=qK(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return GK[r]}function KO(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function KK(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var OE=GO,FE=YO;function XK(e,t){return w.useReducer((n,r)=>t[n][r]??n,e)}var fn=e=>{const{present:t,children:n}=e,r=QK(t),o=typeof n=="function"?n({present:r.isPresent}):w.Children.only(n),i=Ve(r.ref,ZK(o));return typeof n=="function"||r.isPresent?w.cloneElement(o,{ref:i}):null};fn.displayName="Presence";function QK(e){const[t,n]=w.useState(),r=w.useRef({}),o=w.useRef(e),i=w.useRef("none"),s=e?"mounted":"unmounted",[a,l]=XK(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const c=um(r.current);i.current=a==="mounted"?c:"none"},[a]),Vn(()=>{const c=r.current,u=o.current;if(u!==e){const h=i.current,p=um(c);e?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&h!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Vn(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,d=p=>{const m=um(r.current).includes(p.animationName);if(p.target===t&&m&&(l("ANIMATION_END"),!o.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},h=p=>{p.target===t&&(i.current=um(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:w.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function um(e){return(e==null?void 0:e.animationName)||"none"}function ZK(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var LE="Tabs",[JK,DLe]=Pn(LE,[ad]),XO=ad(),[eX,$E]=JK(LE),QO=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=ac(a),[d,h]=or({prop:r,onChange:o,defaultProp:i});return f.jsx(eX,{scope:n,baseId:_n(),value:d,onValueChange:h,orientation:s,dir:u,activationMode:l,children:f.jsx(_e.div,{dir:u,"data-orientation":s,...c,ref:t})})});QO.displayName=LE;var ZO="TabsList",JO=w.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=$E(ZO,n),s=XO(n);return f.jsx(OE,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:r,children:f.jsx(_e.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});JO.displayName=ZO;var e5="TabsTrigger",t5=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=$E(e5,n),a=XO(n),l=o5(s.baseId,r),c=i5(s.baseId,r),u=r===s.value;return f.jsx(FE,{asChild:!0,...a,focusable:!o,active:u,children:f.jsx(_e.button,{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:fe(e.onMouseDown,d=>{!o&&d.button===0&&d.ctrlKey===!1?s.onValueChange(r):d.preventDefault()}),onKeyDown:fe(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&s.onValueChange(r)}),onFocus:fe(e.onFocus,()=>{const d=s.activationMode!=="manual";!u&&!o&&d&&s.onValueChange(r)})})})});t5.displayName=e5;var n5="TabsContent",r5=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=$E(n5,n),l=o5(a.baseId,r),c=i5(a.baseId,r),u=r===a.value,d=w.useRef(u);return w.useEffect(()=>{const h=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(h)},[]),f.jsx(fn,{present:o||u,children:({present:h})=>f.jsx(_e.div,{"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!h,id:c,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:h&&i})})});r5.displayName=n5;function o5(e,t){return`${e}-trigger-${t}`}function i5(e,t){return`${e}-content-${t}`}var tX=QO,s5=JO,a5=t5,l5=r5;const ld=tX,lc=w.forwardRef(({className:e,...t},n)=>f.jsx(s5,{ref:n,className:re("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));lc.displayName=s5.displayName;const Jr=w.forwardRef(({className:e,...t},n)=>f.jsx(a5,{ref:n,className:re("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}));Jr.displayName=a5.displayName;const mi=w.forwardRef(({className:e,...t},n)=>f.jsx(l5,{ref:n,className:re("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));mi.displayName=l5.displayName;var c5={exports:{}},np={},W1={exports:{}};(function(e,t){(function(n,r){r(t)})(ls,function(n){function r(Y){return function(Z,ee,Q,ie,te,le,ue){return Y(Z,ee,ue)}}function o(Y){return function(Z,ee,Q,ie){if(!Z||!ee||typeof Z!="object"||typeof ee!="object")return Y(Z,ee,Q,ie);var te=ie.get(Z),le=ie.get(ee);if(te&&le)return te===ee&&le===Z;ie.set(Z,ee),ie.set(ee,Z);var ue=Y(Z,ee,Q,ie);return ie.delete(Z),ie.delete(ee),ue}}function i(Y,K){var Z={};for(var ee in Y)Z[ee]=Y[ee];for(var ee in K)Z[ee]=K[ee];return Z}function s(Y){return Y.constructor===Object||Y.constructor==null}function a(Y){return typeof Y.then=="function"}function l(Y,K){return Y===K||Y!==Y&&K!==K}var c="[object Arguments]",u="[object Boolean]",d="[object Date]",h="[object RegExp]",p="[object Map]",g="[object Number]",m="[object Object]",b="[object Set]",y="[object String]",v=Object.prototype.toString;function x(Y){var K=Y.areArraysEqual,Z=Y.areDatesEqual,ee=Y.areMapsEqual,Q=Y.areObjectsEqual,ie=Y.areRegExpsEqual,te=Y.areSetsEqual,le=Y.createIsNestedEqual,ue=le(Re);function Re(be,we,Pe){if(be===we)return!0;if(!be||!we||typeof be!="object"||typeof we!="object")return be!==be&&we!==we;if(s(be)&&s(we))return Q(be,we,ue,Pe);var Ye=Array.isArray(be),_t=Array.isArray(we);if(Ye||_t)return Ye===_t&&K(be,we,ue,Pe);var me=v.call(be);return me!==v.call(we)?!1:me===d?Z(be,we,ue,Pe):me===h?ie(be,we,ue,Pe):me===p?ee(be,we,ue,Pe):me===b?te(be,we,ue,Pe):me===m||me===c?a(be)||a(we)?!1:Q(be,we,ue,Pe):me===u||me===g||me===y?l(be.valueOf(),we.valueOf()):!1}return Re}function S(Y,K,Z,ee){var Q=Y.length;if(K.length!==Q)return!1;for(;Q-- >0;)if(!Z(Y[Q],K[Q],Q,Q,Y,K,ee))return!1;return!0}var _=o(S);function E(Y,K){return l(Y.valueOf(),K.valueOf())}function C(Y,K,Z,ee){var Q=Y.size===K.size;if(!Q)return!1;if(!Y.size)return!0;var ie={},te=0;return Y.forEach(function(le,ue){if(Q){var Re=!1,be=0;K.forEach(function(we,Pe){!Re&&!ie[be]&&(Re=Z(ue,Pe,te,be,Y,K,ee)&&Z(le,we,ue,Pe,Y,K,ee))&&(ie[be]=!0),be++}),te++,Q=Re}}),Q}var k=o(C),N="_owner",M=Object.prototype.hasOwnProperty;function A(Y,K,Z,ee){var Q=Object.keys(Y),ie=Q.length;if(Object.keys(K).length!==ie)return!1;for(var te;ie-- >0;){if(te=Q[ie],te===N){var le=!!Y.$$typeof,ue=!!K.$$typeof;if((le||ue)&&le!==ue)return!1}if(!M.call(K,te)||!Z(Y[te],K[te],te,te,Y,K,ee))return!1}return!0}var P=o(A);function j(Y,K){return Y.source===K.source&&Y.flags===K.flags}function F(Y,K,Z,ee){var Q=Y.size===K.size;if(!Q)return!1;if(!Y.size)return!0;var ie={};return Y.forEach(function(te,le){if(Q){var ue=!1,Re=0;K.forEach(function(be,we){!ue&&!ie[Re]&&(ue=Z(te,be,le,we,Y,K,ee))&&(ie[Re]=!0),Re++}),Q=ue}}),Q}var I=o(F),O=Object.freeze({areArraysEqual:S,areDatesEqual:E,areMapsEqual:C,areObjectsEqual:A,areRegExpsEqual:j,areSetsEqual:F,createIsNestedEqual:r}),$=Object.freeze({areArraysEqual:_,areDatesEqual:E,areMapsEqual:k,areObjectsEqual:P,areRegExpsEqual:j,areSetsEqual:I,createIsNestedEqual:r}),B=x(O);function z(Y,K){return B(Y,K,void 0)}var T=x(i(O,{createIsNestedEqual:function(){return l}}));function W(Y,K){return T(Y,K,void 0)}var L=x($);function D(Y,K){return L(Y,K,new WeakMap)}var H=x(i($,{createIsNestedEqual:function(){return l}}));function V(Y,K){return H(Y,K,new WeakMap)}function q(Y){return x(i(O,Y(O)))}function U(Y){var K=x(i($,Y($)));return function(Z,ee,Q){return Q===void 0&&(Q=new WeakMap),K(Z,ee,Q)}}n.circularDeepEqual=D,n.circularShallowEqual=V,n.createCustomCircularEqual=U,n.createCustomEqual=q,n.deepEqual=z,n.sameValueZeroEqual=l,n.shallowEqual=W,Object.defineProperty(n,"__esModule",{value:!0})})})(W1,W1.exports);var zE=W1.exports;const BE=bE(mq);var lt={},nX=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(lt,"__esModule",{value:!0});lt.bottom=VE;lt.childrenEqual=sX;lt.cloneLayout=u5;lt.cloneLayoutItem=_l;lt.collides=O0;lt.compact=f5;lt.compactItem=h5;lt.compactType=vX;lt.correctBounds=p5;lt.fastPositionEqual=aX;lt.fastRGLPropsEqual=void 0;lt.getAllCollisions=m5;lt.getFirstCollision=cl;lt.getLayoutItem=HE;lt.getStatics=WE;lt.modifyLayout=d5;lt.moveElement=of;lt.moveElementAwayFromCollision=G1;lt.noop=void 0;lt.perc=cX;lt.resizeItemInDirection=mX;lt.setTopLeft=bX;lt.setTransform=gX;lt.sortLayoutItems=XE;lt.sortLayoutItemsByColRow=x5;lt.sortLayoutItemsByRowCol=v5;lt.synchronizeLayoutWithChildren=yX;lt.validateLayout=w5;lt.withLayoutItem=iX;var rM=zE,rf=rX(R);function rX(e){return e&&e.__esModule?e:{default:e}}const oX=process.env.NODE_ENV==="production";function VE(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 u5(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=_l(e[n]);return t}function d5(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 iX(e,t,n){let r=HE(e,t);return r?(r=n(_l(r)),e=d5(e,r),[e,r]):[e,null]}function _l(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 sX(e,t){return(0,rM.deepEqual)(rf.default.Children.map(e,n=>n==null?void 0:n.key),rf.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,rM.deepEqual)(rf.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),rf.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}lt.fastRGLPropsEqual=nX;function aX(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function O0(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 f5(e,t,n,r){const o=WE(e),i=XE(e,t),s=Array(e.length);for(let a=0,l=i.length;a<l;a++){let c=_l(i[a]);c.static||(c=h5(o,c,t,n,i,r),o.push(c)),s[e.indexOf(i[a])]=c,c.moved=!1}return s}const lX={x:"w",y:"h"};function U1(e,t,n,r){const o=lX[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;O0(t,a)&&U1(e,a,n+t[o],r)}}t[r]=n}function h5(e,t,n,r,o,i){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(VE(e),t.y);t.y>0&&!cl(e,t);)t.y--;else if(a)for(;t.x>0&&!cl(e,t);)t.x--;let l;for(;(l=cl(e,t))&&!(n===null&&i);)if(a?U1(o,t,l.x+l.w,"x"):U1(o,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!cl(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function p5(e,t){const n=WE(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(;cl(n,i);)i.y++}return e}function HE(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function cl(e,t){for(let n=0,r=e.length;n<r;n++)if(O0(e[n],t))return e[n]}function m5(e,t){return e.filter(n=>O0(n,t))}function WE(e){return e.filter(t=>t.static)}function of(e,t,n,r,o,i,s,a,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;`${t.i}${String(n)}${String(r)}${t.x}${t.y}`;const c=t.x,u=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let d=XE(e,s);(s==="vertical"&&typeof r=="number"?u>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(d=d.reverse());const p=m5(d,t),g=p.length>0;if(g&&l)return u5(e);if(g&&i)return`${t.i}`,t.x=c,t.y=u,t.moved=!1,e;for(let m=0,b=p.length;m<b;m++){const y=p[m];`${t.i}${t.x}${t.y}${y.i}${y.x}${y.y}`,!y.moved&&(y.static?e=G1(e,y,t,o,s):e=G1(e,t,y,o,s))}return e}function G1(e,t,n,r,o,i){const s=o==="horizontal",a=o==="vertical",l=t.static;if(r){r=!1;const d={x:s?Math.max(t.x-n.w,0):n.x,y:a?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},h=cl(e,d),p=h&&h.y+h.h>t.y,g=h&&t.x+t.w>h.x;if(h){if(p&&a)return of(e,n,void 0,t.y+1,r,l,o);if(p&&o==null)return t.y=n.y,n.y=n.y+n.h,e;if(g&&s)return of(e,t,n.x,void 0,r,l,o)}else return`${n.i}${d.x}${d.y}`,of(e,n,s?d.x:void 0,a?d.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:of(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,o)}function cX(e){return e*100+"%"}const g5=(e,t,n,r)=>e+n>r?t:n,b5=(e,t,n)=>e<0?t:n,y5=e=>Math.max(0,e),UE=e=>Math.max(0,e),GE=(e,t,n)=>{let{left:r,height:o,width:i}=t;const s=e.top-(o-e.height);return{left:r,width:i,height:b5(s,e.height,o),top:UE(s)}},qE=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{top:r,height:i,width:g5(e.left,e.width,s,n),left:y5(o)}},YE=(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:g5(e.left,e.width,i,n),top:UE(r),left:y5(s)}},KE=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{width:s,left:o,height:b5(r,e.height,i),top:UE(r)}},uX=function(){return GE(arguments.length<=0?void 0:arguments[0],qE(...arguments))},dX=function(){return GE(arguments.length<=0?void 0:arguments[0],YE(...arguments))},fX=function(){return KE(arguments.length<=0?void 0:arguments[0],qE(...arguments))},hX=function(){return KE(arguments.length<=0?void 0:arguments[0],YE(...arguments))},pX={n:GE,ne:uX,e:qE,se:fX,s:KE,sw:hX,w:YE,nw:dX};function mX(e,t,n,r){const o=pX[e];return o?o(t,{...t,...n},r):n}function gX(e){let{top:t,left:n,width:r,height:o}=e;const i=`translate(${n}px,${t}px)`;return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:`${r}px`,height:`${o}px`,position:"absolute"}}function bX(e){let{top:t,left:n,width:r,height:o}=e;return{top:`${t}px`,left:`${n}px`,width:`${r}px`,height:`${o}px`,position:"absolute"}}function XE(e,t){return t==="horizontal"?x5(e):t==="vertical"?v5(e):e}function v5(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 x5(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 yX(e,t,n,r,o){e=e||[];const i=[];rf.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=HE(e,String(a.key)),c=a.props["data-grid"];l&&c==null?i.push(_l(l)):c?(oX||w5([c],"ReactGridLayout.children"),i.push(_l({...c,i:a.key}))):i.push(_l({w:1,h:1,x:0,y:VE(i),i:String(a.key)}))});const s=p5(i,{cols:n});return o?s:f5(s,r,n)}function w5(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++){const a=n[s],l=i[a];if(typeof l!="number"||Number.isNaN(l))throw new Error(`ReactGridLayout: ${t}[${r}].${a} must be a number! Received: ${l} (${typeof l})`)}if(typeof i.i<"u"&&typeof i.i!="string")throw new Error(`ReactGridLayout: ${t}[${r}].i must be a string! Received: ${i.i} (${typeof i.i})`)}}function vX(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const xX=()=>{};lt.noop=xX;var ji={};Object.defineProperty(ji,"__esModule",{value:!0});ji.calcGridColWidth=F0;ji.calcGridItemPosition=wX;ji.calcGridItemWHPx=q1;ji.calcWH=SX;ji.calcXY=CX;ji.clamp=ul;function F0(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function q1(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function wX(e,t,n,r,o,i){const{margin:s,containerPadding:a,rowHeight:l}=e,c=F0(e),u={};return i&&i.resizing?(u.width=Math.round(i.resizing.width),u.height=Math.round(i.resizing.height)):(u.width=q1(r,c,s[0]),u.height=q1(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 CX(e,t,n,r,o){const{margin:i,containerPadding:s,cols:a,rowHeight:l,maxRows:c}=e,u=F0(e);let d=Math.round((n-s[0])/(u+i[0])),h=Math.round((t-s[1])/(l+i[1]));return d=ul(d,0,a-r),h=ul(h,0,c-o),{x:d,y:h}}function SX(e,t,n,r,o,i){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,u=F0(e);let d=Math.round((t+s[0])/(u+s[0])),h=Math.round((n+s[1])/(c+s[1])),p=ul(d,0,l-r),g=ul(h,0,a-o);return["sw","w","nw"].indexOf(i)!==-1&&(p=ul(d,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(g=ul(h,0,a)),{w:p,h:g}}function ul(e,t,n){return Math.max(Math.min(e,n),t)}var L0={},Y1={exports:{}},dm={exports:{}},kt={};/** @license React v16.13.1
|
|
37
37
|
* react-is.production.min.js
|
|
38
38
|
*
|
|
39
39
|
* 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-IrFoACqT.js"),r=require("../types/index.cjs");exports.Dashboard=e.Dashboard;exports.EMPTY_SELECTION=r.EMPTY_SELECTION;
|
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-IrFoACqT.js"),t=require("./types/index.cjs"),a=require("./chunks/dashboard-plus-CCV5mAgn.js");require("react/jsx-runtime");require("react");require("react-dom");const r=["MM-DD-YYYY","YYYY-MM-DD","MM/DD/YYYY","DD/MM/YYYY","MMMM DD, YYYY","MMM DD, YYYY","DD MMM YYYY","Week of MMM DD, YYYY","Week of MMMM DD, YYYY","YYYY-WW","MMM YYYY","MMMM YYYY","YYYY-MM","MM/YYYY","YYYY MMM","Q1 YYYY","YYYY Q1","1st Quarter YYYY","YYYY-Q1","Quarter 1, YYYY","YYYY","YY","custom"];exports.Dashboard=e.Dashboard;exports.DashboardWC=e.DashboardWC;exports.SemaphorContextProvider=e.SemaphorContextProvider;exports.SemaphorDataProvider=e.SemaphorQueryClient;exports.SemaphorQueryClient=e.SemaphorQueryClient;exports.createSqlGenConfig=e.createSqlGenConfig;exports.fmt=e.fmt;exports.getColumnDataType=e.getColumnDataType;exports.getFilterValueType=e.getFilterValueType;exports.getFormattedTableNameForQuery=e.getFormattedTableNameForQuery;exports.getQualifiedTableName=e.getQualifiedTableName;exports.getSql=e.getSql;exports.invalidateToken=e.invalidateToken;exports.isBooleanDataType=e.isBooleanDataType;exports.isColumnInSqlGen=e.isColumnInSqlGen;exports.isDateDataType=e.isDateDataType;exports.isNumberDataType=e.isNumberDataType;exports.isTextDataType=e.isTextDataType;exports.resolveDataType=e.resolveDataType;exports.resolveDatamodelName=e.resolveDatamodelName;exports.useCard=e.useCard;exports.useCurrentActiveCard=e.useCurrentActiveCard;exports.useCurrentCardConfig=e.useCurrentCardConfig;exports.useCurrentSheetActiveCards=e.useCurrentSheetActiveCards;exports.useDashboardActions=e.useDashboardActions;exports.useDashboardStore=e.useDashboardStore;exports.useDataColumns=e.useDataColumns;exports.useDateFilterHook=e.useDateFilterHook;exports.useEditorActions=e.useEditorActions;exports.useEditorAside=e.useEditorAside;exports.useEditorStore=e.useEditorStore;exports.useTextFilterHook=e.useTextFilterHook;exports.EMPTY_SELECTION=t.EMPTY_SELECTION;exports.ResourceManagementPanel=a.ResourceManagementPanel;exports.ScheduleDashboard=a.ScheduleDashboard;exports.SelectComponent=a.SelectComponent;exports.Surfboard=a.DashboardPlus;exports.cleanCard=a.cleanCard;exports.downloadPdf=a.downloadPdf;exports.getDashbaordStateWithoutData=a.getDashbaordStateWithoutData;exports.DATE_FORMAT_VALUES=r;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { D as r, d as M, S as D, b as u, b as i, m as d, f as n, o as l, n as m, q as p, s as C, l as S, i as T, k as c, p as h, j as b, h as f, g, t as y, r as A, c as v, x, z as E, y as Q, A as k, w as F, e as W, u as N, C as P, v as q, B as R, a as _ } from "./chunks/index-
|
|
1
|
+
import { D as r, d as M, S as D, b as u, b as i, m as d, f as n, o as l, n as m, q as p, s as C, l as S, i as T, k as c, p as h, j as b, h as f, g, t as y, r as A, c as v, x, z as E, y as Q, A as k, w as F, e as W, u as N, C as P, v as q, B as R, a as _ } from "./chunks/index-CL8DpfKu.js";
|
|
2
2
|
import { EMPTY_SELECTION as B } from "./types/index.js";
|
|
3
|
-
import { R as H, S as I, a as L, D as O, c as V, d as j, g as z } from "./chunks/dashboard-plus-
|
|
3
|
+
import { R as H, S as I, a as L, D as O, c as V, d as j, g as z } from "./chunks/dashboard-plus-CZggRVns.js";
|
|
4
4
|
import "react/jsx-runtime";
|
|
5
5
|
import "react";
|
|
6
6
|
import "react-dom";
|
package/dist/surfboard/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/dashboard-plus-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/dashboard-plus-CCV5mAgn.js"),r=require("../types/index.cjs");exports.Surfboard=e.DashboardPlus;exports.EMPTY_SELECTION=r.EMPTY_SELECTION;
|
package/dist/surfboard/index.js
CHANGED