react-semaphor 0.0.129 → 0.0.131

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.
@@ -1,7 +1,7 @@
1
1
  var Yi = Object.defineProperty;
2
2
  var Xi = (e, t, n) => t in e ? Yi(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var Kr = (e, t, n) => (Xi(e, typeof t != "symbol" ? t + "" : t, n), n);
4
- import { d as In, s as Gn, m as Vn, c as z, g as Zi, a as D, b as v, e as U, o as Dt, i as E, S as R, f as G, h as I, j as ze, k as F, l as Ji, n as Et, p as or, q as j, r as es, t as bn, F as qo, u as Mo, v as V, $ as ct, w as xn, x as jn, y as Be, z as Se, A as ke, I as ts, B as ir, C as M, D as en, E as Br, G as ns, H as Ct, J as Ht, K as Rr, L as J, P as rs, M as os, N as is, O as Mn, Q as ss, R as ls, T as as, U as Pn, V as cs, W as us } from "./index-jyE0UTAE.js";
4
+ import { d as In, s as Gn, m as Vn, c as z, g as Zi, a as D, b as v, e as U, o as Dt, i as E, S as R, f as G, h as I, j as ze, k as F, l as Ji, n as Et, p as or, q as j, r as es, t as bn, F as qo, u as Mo, v as V, $ as ct, w as xn, x as jn, y as Be, z as Se, A as ke, I as ts, B as ir, C as M, D as en, E as Br, G as ns, H as Ct, J as Ht, K as Rr, L as J, P as rs, M as os, N as is, O as Mn, Q as ss, R as ls, T as as, U as Pn, V as cs, W as us } from "./index-EdZOjrhg.js";
5
5
  import "react";
6
6
  import "react-dom";
7
7
  var Po = {
@@ -8562,7 +8562,7 @@ var Xve = (e, t = !1) => {
8562
8562
  const t = Wz(() => {
8563
8563
  const [n] = K(this, Vc), [r] = K(this, Hc), [i] = K(this, Wc), [o] = K(this, Uc), [s] = K(this, Bc);
8564
8564
  let a;
8565
- K(this, qc) ? a = K(this, qc) : (a = Dz(() => import("./2DAFLIRC-q0QZvyUX.js")), Te(this, qc, a)), BB(K(this, $f));
8565
+ K(this, qc) ? a = K(this, qc) : (a = Dz(() => import("./2DAFLIRC-46C5OmFB.js")), Te(this, qc, a)), BB(K(this, $f));
8566
8566
  const l = this;
8567
8567
  return $z(a, Rz({
8568
8568
  get queryFlavor() {
@@ -8681,14 +8681,7 @@ function qB(e, t) {
8681
8681
  ),
8682
8682
  enabled: !!(r != null && r.accessToken)
8683
8683
  // Only fetch if authToken is present
8684
- });
8685
- console.log(
8686
- "connectionsData",
8687
- m,
8688
- "selectedConnectionId",
8689
- i
8690
- );
8691
- const w = m == null ? void 0 : m.connections.find(
8684
+ }), w = m == null ? void 0 : m.connections.find(
8692
8685
  (U) => U.id === i
8693
8686
  ), _ = (w == null ? void 0 : w.type) === "API" || (w == null ? void 0 : w.type) === "S3", {
8694
8687
  data: S,
@@ -12567,7 +12560,7 @@ const Zs = /* @__PURE__ */ Rf(hc), vE = ["lg", "md", "sm", "xs", "xxs"], pe = Fk
12567
12560
  selectedCard: null,
12568
12561
  showFilters: !1,
12569
12562
  //This shpu;d be false by default
12570
- isDashboardEditing: !0,
12563
+ isDashboardEditing: !1,
12571
12564
  // This should be false by defaultdashboard.
12572
12565
  isVisualEditing: !1,
12573
12566
  // This should be false by defaultdashboard.
@@ -1,4 +1,4 @@
1
- import { a7 as t, a6 as r, Z as d, a2 as D, a1 as i, a0 as T, _ as l, a5 as u, a3 as A, am as n, an as E, a4 as h, ap as S, aa as b, a8 as m, aq as _, ac as C, ao as p, ab as g, ae as c, a9 as P, ad as Y, ah as f, af as y, X as q, Y as N, aj as O, ai as k, al as B, ag as v, ak as F } from "./index-jyE0UTAE.js";
1
+ import { a7 as t, a6 as r, Z as d, a2 as D, a1 as i, a0 as T, _ as l, a5 as u, a3 as A, am as n, an as E, a4 as h, ap as S, aa as b, a8 as m, aq as _, ac as C, ao as p, ab as g, ae as c, a9 as P, ad as Y, ah as f, af as y, X as q, Y as N, aj as O, ai as k, al as B, ag as v, ak as F } from "./index-EdZOjrhg.js";
2
2
  import "react";
3
3
  import "react-dom";
4
4
  export {
@@ -56,7 +56,7 @@ Check the top-level render call using <`+fe+">.")}return te}}function bs(T,te){{
56
56
  *
57
57
  * This source code is licensed under the MIT license found in the
58
58
  * LICENSE file in the root directory of this source tree.
59
- */var aE;function jF(){if(aE)return Wb;aE=1;var e=b,t=iE();function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return Wb.useSyncExternalStoreWithSelector=function(c,u,d,h,p){var m=i(null);if(m.current===null){var v={hasValue:!1,value:null};m.current=v}else v=m.current;m=a(function(){function w(P){if(!C){if(C=!0,_=P,P=h(P),p!==void 0&&v.hasValue){var D=v.value;if(p(D,P))return k=D}return k=P}if(D=k,r(_,P))return D;var M=h(P);return p!==void 0&&p(D,M)?D:(_=P,k=M)}var C=!1,_,k,E=d===void 0?null:d;return[function(){return w(u())},E===null?void 0:function(){return w(E())}]},[u,d,h,p]);var y=o(c,m[0],m[1]);return s(function(){v.hasValue=!0,v.value=y},[y]),l(y),y},Wb}process.env.NODE_ENV==="production"?Bb.exports=jF():Bb.exports=RF();var zF=Bb.exports;const BF=Gd(zF);var lE={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:VF}=b,{useSyncExternalStoreWithSelector:HF}=BF;let cE=!1;function qF(e,t=e.getState,n){(lE?"production":void 0)!=="production"&&n&&!cE&&(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"),cE=!0);const r=HF(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return VF(r),r}const uE=e=>{(lE?"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"?NF(e):e,n=(r,o)=>qF(t,r,o);return Object.assign(n,t),n},dE=e=>e?uE(e):uE;var fE=Symbol.for("immer-nothing"),hE=Symbol.for("immer-draftable"),po=Symbol.for("immer-state"),WF=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 Gr(e,...t){if(process.env.NODE_ENV!=="production"){const n=WF[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 Kc=Object.getPrototypeOf;function Yc(e){return!!e&&!!e[po]}function Ol(e){var t;return e?pE(e)||Array.isArray(e)||!!e[hE]||!!((t=e.constructor)!=null&&t[hE])||Qp(e)||Zp(e):!1}var UF=Object.prototype.constructor.toString();function pE(e){if(!e||typeof e!="object")return!1;const t=Kc(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)===UF}function Jd(e,t){Xp(e)===0?Object.entries(e).forEach(([n,r])=>{t(n,r,e)}):e.forEach((n,r)=>t(r,n,e))}function Xp(e){const t=e[po];return t?t.type_:Array.isArray(e)?1:Qp(e)?2:Zp(e)?3:0}function Ub(e,t){return Xp(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function gE(e,t,n){const r=Xp(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function GF(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Qp(e){return e instanceof Map}function Zp(e){return e instanceof Set}function Pl(e){return e.copy_||e.base_}function Gb(e,t){if(Qp(e))return new Map(e);if(Zp(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&pE(e))return Kc(e)?{...e}:Object.assign(Object.create(null),e);const n=Object.getOwnPropertyDescriptors(e);delete n[po];let r=Reflect.ownKeys(n);for(let o=0;o<r.length;o++){const i=r[o],s=n[i];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(n[i]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[i]})}return Object.create(Kc(e),n)}function Kb(e,t=!1){return Jp(e)||Yc(e)||!Ol(e)||(Xp(e)>1&&(e.set=e.add=e.clear=e.delete=KF),Object.freeze(e),t&&Jd(e,(n,r)=>Kb(r,!0))),e}function KF(){Gr(2)}function Jp(e){return Object.isFrozen(e)}var YF={};function Dl(e){const t=YF[e];return t||Gr(0,e),t}var ef;function mE(){return ef}function XF(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function vE(e,t){t&&(Dl("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Yb(e){Xb(e),e.drafts_.forEach(QF),e.drafts_=null}function Xb(e){e===ef&&(ef=e.parent_)}function bE(e){return ef=XF(ef,e)}function QF(e){const t=e[po];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function yE(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[po].modified_&&(Yb(t),Gr(4)),Ol(e)&&(e=eg(t,e),t.parent_||tg(t,e)),t.patches_&&Dl("Patches").generateReplacementPatches_(n[po].base_,e,t.patches_,t.inversePatches_)):e=eg(t,n,[]),Yb(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==fE?e:void 0}function eg(e,t,n){if(Jp(t))return t;const r=t[po];if(!r)return Jd(t,(o,i)=>xE(e,r,t,o,i,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return tg(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),Jd(i,(a,l)=>xE(e,r,o,a,l,n,s)),tg(e,o,!1),n&&e.patches_&&Dl("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function xE(e,t,n,r,o,i,s){if(process.env.NODE_ENV!=="production"&&o===n&&Gr(5),Yc(o)){const a=i&&t&&t.type_!==3&&!Ub(t.assigned_,r)?i.concat(r):void 0,l=eg(e,o,a);if(gE(n,r,l),Yc(l))e.canAutoFreeze_=!1;else return}else s&&n.add(o);if(Ol(o)&&!Jp(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;eg(e,o),(!t||!t.scope_.parent_)&&tg(e,o)}}function tg(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Kb(t,n)}function ZF(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:mE(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=Qb;n&&(o=[r],i=tf);const{revoke:s,proxy:a}=Proxy.revocable(o,i);return r.draft_=a,r.revoke_=s,a}var Qb={get(e,t){if(t===po)return e;const n=Pl(e);if(!Ub(n,t))return JF(e,n,t);const r=n[t];return e.finalized_||!Ol(r)?r:r===Zb(e.base_,t)?(ey(e),e.copy_[t]=ty(r,e)):r},has(e,t){return t in Pl(e)},ownKeys(e){return Reflect.ownKeys(Pl(e))},set(e,t,n){const r=wE(Pl(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const o=Zb(Pl(e),t),i=o==null?void 0:o[po];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(GF(n,o)&&(n!==void 0||Ub(e.base_,t)))return!0;ey(e),Jb(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 Zb(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,ey(e),Jb(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Pl(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Gr(11)},getPrototypeOf(e){return Kc(e.base_)},setPrototypeOf(){Gr(12)}},tf={};Jd(Qb,(e,t)=>{tf[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),tf.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&Gr(13),tf.set.call(this,e,t,void 0)},tf.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&Gr(14),Qb.set.call(this,e[0],t,n,e[0])};function Zb(e,t){const n=e[po];return(n?Pl(n):e)[t]}function JF(e,t,n){var o;const r=wE(t,n);return r?"value"in r?r.value:(o=r.get)==null?void 0:o.call(e.draft_):void 0}function wE(e,t){if(!(t in e))return;let n=Kc(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Kc(n)}}function Jb(e){e.modified_||(e.modified_=!0,e.parent_&&Jb(e.parent_))}function ey(e){e.copy_||(e.copy_=Gb(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var eR=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"&&Gr(6),r!==void 0&&typeof r!="function"&&Gr(7);let o;if(Ol(t)){const i=bE(this),s=ty(t,void 0);let a=!0;try{o=n(s),a=!1}finally{a?Yb(i):Xb(i)}return vE(i,r),yE(o,i)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===fE&&(o=void 0),this.autoFreeze_&&Kb(o,!0),r){const i=[],s=[];Dl("Patches").generateReplacementPatches_(t,o,i,s),r(i,s)}return o}else Gr(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){Ol(e)||Gr(8),Yc(e)&&(e=tR(e));const t=bE(this),n=ty(e,void 0);return n[po].isManual_=!0,Xb(t),n}finishDraft(e,t){const n=e&&e[po];(!n||!n.isManual_)&&Gr(9);const{scope_:r}=n;return vE(r,t),yE(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=Dl("Patches").applyPatches_;return Yc(e)?r(e,t):this.produce(e,o=>r(o,t))}};function ty(e,t){const n=Qp(e)?Dl("MapSet").proxyMap_(e,t):Zp(e)?Dl("MapSet").proxySet_(e,t):ZF(e,t);return(t?t.scope_:mE()).drafts_.push(n),n}function tR(e){return Yc(e)||Gr(10,e),SE(e)}function SE(e){if(!Ol(e)||Jp(e))return e;const t=e[po];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Gb(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Gb(e,!0);return Jd(n,(r,o)=>{gE(n,r,SE(o))}),t&&(t.finalized_=!1),n}var go=new eR,nR=go.produce;go.produceWithPatches.bind(go),go.setAutoFreeze.bind(go),go.setUseStrictShallowCopy.bind(go),go.applyPatches.bind(go),go.createDraft.bind(go),go.finishDraft.bind(go);const CE=e=>(t,n,r)=>(r.setState=(o,i,...s)=>{const a=typeof o=="function"?nR(o):o;return t(a,i,...s)},e(r.setState,n,r));var ng,rg=Jt;if(process.env.NODE_ENV==="production")ng=rg.createRoot,rg.hydrateRoot;else{var _E=rg.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;ng=function(e,t){_E.usingClientEntryPoint=!0;try{return rg.createRoot(e,t)}finally{_E.usingClientEntryPoint=!1}}}function EE(e,t,n){const r={count:0},o=a=>{const l=b.useRef(r.count);return b.useEffect(()=>{l.current+=1,l.current===r.count+1&&(l.current-=1,t.setState(a))}),null};if(o.displayName=`((${e})) devtool`,typeof document>"u")return;if(!n){let a=document.getElementById(`simple-zustand-devtools-${e}`);a||(a=document.createElement("div"),a.id=`simple-zustand-devtools-${e}`),document.body.appendChild(a),n=a}const i=ng(n),s=a=>{a&&(i.render(b.createElement(o,Object.assign({},a))),r.count+=1)};s(t.getState()),t.subscribe(s)}var kE={},OE={},ny={exports:{}},On=String,PE=function(){return{isColorSupported:!1,reset:On,bold:On,dim:On,italic:On,underline:On,inverse:On,hidden:On,strikethrough:On,black:On,red:On,green:On,yellow:On,blue:On,magenta:On,cyan:On,white:On,gray:On,bgBlack:On,bgRed:On,bgGreen:On,bgYellow:On,bgBlue:On,bgMagenta:On,bgCyan:On,bgWhite:On}};ny.exports=PE(),ny.exports.createColors=PE;var rR=ny.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(rR);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])}}})(OE),function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});const t=n(OE);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}}}(kE);let ry=kE;var oR=(ry.__esModule?ry:{default:ry}).default;const bn=Gd(oR),oy={default:{dashboardPanel:"",dashboardTabsContainer:"",gridLayout:{className:""},chart:{font:{family:"Open Sans, Arial, sans-serif"},dataset:{backgroundColor:[bn.blue[500],bn.teal[500],bn.amber[500],bn.red[500],bn.indigo[500],bn.green[500]],borderColor:[bn.blue[500],bn.teal[500],bn.amber[500],bn.red[500],bn.indigo[500],bn.green[500]]},options:{interaction:{mode:"index"},plugins:{datalabels:{display:!1,color:DE},title:{display:!0},tooltip:{backgroundColor:"#fff",bodyColor:"#000",borderWidth:.25,titleColor:"#000",borderColor:"rgb(128,131,139)",cornerRadius:2,boxPadding:4},legend:{position:"top",align:"center",maxHeight:0}},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:1,responsive:!0,maintainAspectRatio:!1}}},dark:{chart:{dataset:{backgroundColor:[bn.blue[500],bn.teal[500],bn.amber[500],bn.red[500],bn.indigo[500],bn.green[500]],borderColor:[bn.blue[500],bn.teal[500],bn.amber[500],bn.red[500],bn.indigo[500],bn.green[500]],datalables:{color:DE}},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:bn.slate[800]}},y:{grid:{display:!0,color:bn.slate[800]}}}}}}};function DE(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=og()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=og()),ig(n)}function og(){return me.getState().theme==="dark"?"#000000":"#FFFFFF"}function ig(e){let t=0,n=0,r=0,o=0;const i=u=>{const d=u.replace("#",""),h=parseInt(d.substring(0,2),16),p=parseInt(d.substring(2,4),16),m=parseInt(d.substring(4,6),16);t+=h,n+=p,r+=m,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"}var nf=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(){}},Xc=typeof window>"u"||"Deno"in window;function Ho(){}function iR(e,t){return typeof e=="function"?e(t):e}function iy(e){return typeof e=="number"&&e>=0&&e!==1/0}function ME(e,t){return Math.max(e+(t||0)-Date.now(),0)}function $E(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==sy(s,t.options))return!1}else if(!of(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||typeof o<"u"&&o!==t.state.fetchStatus||i&&!i(t))}function TE(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(rf(t.options.mutationKey)!==rf(i))return!1}else if(!of(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function sy(e,t){return((t==null?void 0:t.queryKeyHashFn)||rf)(e)}function rf(e){return JSON.stringify(e,(t,n)=>ly(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function of(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!of(e[n],t[n])):!1}function AE(e,t){if(e===t)return e;const n=IE(e)&&IE(t);if(n||ly(e)&&ly(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),s=i.length,a=n?[]:{};let l=0;for(let c=0;c<s;c++){const u=n?c:i[c];!n&&e[u]===void 0&&t[u]===void 0&&r.includes(u)?(a[u]=void 0,l++):(a[u]=AE(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return o===s&&l===o?e:a}return t}function ay(e,t){if(e&&!t||t&&!e)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function IE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ly(e){if(!NE(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!NE(n)||!n.hasOwnProperty("isPrototypeOf"))}function NE(e){return Object.prototype.toString.call(e)==="[object Object]"}function sR(e){return new Promise(t=>{setTimeout(t,e)})}function cy(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?AE(e,t):t}function aR(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function lR(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var cR=(f8=class extends nf{constructor(){super();Ge(this,Oc,void 0);Ge(this,rl,void 0);Ge(this,fd,void 0);je(this,fd,t=>{if(!Xc&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){ee(this,rl)||this.setEventListener(ee(this,fd))}onUnsubscribe(){var t;this.hasListeners()||((t=ee(this,rl))==null||t.call(this),je(this,rl,void 0))}setEventListener(t){var n;je(this,fd,t),(n=ee(this,rl))==null||n.call(this),je(this,rl,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){ee(this,Oc)!==t&&(je(this,Oc,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof ee(this,Oc)=="boolean"?ee(this,Oc):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Oc=new WeakMap,rl=new WeakMap,fd=new WeakMap,f8),sg=new cR,uR=(h8=class extends nf{constructor(){super();Ge(this,hd,!0);Ge(this,ol,void 0);Ge(this,pd,void 0);je(this,pd,t=>{if(!Xc&&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(){ee(this,ol)||this.setEventListener(ee(this,pd))}onUnsubscribe(){var t;this.hasListeners()||((t=ee(this,ol))==null||t.call(this),je(this,ol,void 0))}setEventListener(t){var n;je(this,pd,t),(n=ee(this,ol))==null||n.call(this),je(this,ol,t(this.setOnline.bind(this)))}setOnline(t){ee(this,hd)!==t&&(je(this,hd,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return ee(this,hd)}},hd=new WeakMap,ol=new WeakMap,pd=new WeakMap,h8),sf=new uR;function dR(e){return Math.min(1e3*2**e,3e4)}function ag(e){return(e??"online")==="online"?sf.isOnline():!0}var LE=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function uy(e){return e instanceof LE}function FE(e){let t=!1,n=0,r=!1,o,i,s;const a=new Promise((y,w)=>{i=y,s=w}),l=y=>{var w;r||(p(new LE(y)),(w=e.abort)==null||w.call(e))},c=()=>{t=!0},u=()=>{t=!1},d=()=>!sg.isFocused()||e.networkMode!=="always"&&!sf.isOnline(),h=y=>{var w;r||(r=!0,(w=e.onSuccess)==null||w.call(e,y),o==null||o(),i(y))},p=y=>{var w;r||(r=!0,(w=e.onError)==null||w.call(e,y),o==null||o(),s(y))},m=()=>new Promise(y=>{var w;o=C=>{const _=r||!d();return _&&y(C),_},(w=e.onPause)==null||w.call(e)}).then(()=>{var y;o=void 0,r||(y=e.onContinue)==null||y.call(e)}),v=()=>{if(r)return;let y;try{y=e.fn()}catch(w){y=Promise.reject(w)}Promise.resolve(y).then(h).catch(w=>{var P;if(r)return;const C=e.retry??(Xc?0:3),_=e.retryDelay??dR,k=typeof _=="function"?_(n,w):_,E=C===!0||typeof C=="number"&&n<C||typeof C=="function"&&C(n,w);if(t||!E){p(w);return}n++,(P=e.onFail)==null||P.call(e,n,w),sR(k).then(()=>{if(d())return m()}).then(()=>{t?p(w):v()})})};return ag(e.networkMode)?v():m().then(v),{promise:a,cancel:l,continue:()=>(o==null?void 0:o())?a:Promise.resolve(),cancelRetry:c,continueRetry:u}}function fR(){let e=[],t=0,n=h=>{h()},r=h=>{h()},o=h=>setTimeout(h,0);const i=h=>{o=h},s=h=>{let p;t++;try{p=h()}finally{t--,t||c()}return p},a=h=>{t?e.push(h):o(()=>{n(h)})},l=h=>(...p)=>{a(()=>{h(...p)})},c=()=>{const h=e;e=[],h.length&&o(()=>{r(()=>{h.forEach(p=>{n(p)})})})};return{batch:s,batchCalls:l,schedule:a,setNotifyFunction:h=>{n=h},setBatchNotifyFunction:h=>{r=h},setScheduler:i}}var br=fR(),RE=(p8=class{constructor(){Ge(this,Pc,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),iy(this.gcTime)&&je(this,Pc,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Xc?1/0:5*60*1e3))}clearGcTimeout(){ee(this,Pc)&&(clearTimeout(ee(this,Pc)),je(this,Pc,void 0))}},Pc=new WeakMap,p8),hR=(g8=class extends RE{constructor(t){super();Ge(this,vd);Ge(this,Ni);Ge(this,gd,void 0);Ge(this,md,void 0);Ge(this,si,void 0);Ge(this,il,void 0);Ge(this,ai,void 0);Ge(this,gr,void 0);Ge(this,pp,void 0);Ge(this,Dc,void 0);je(this,Dc,!1),je(this,pp,t.defaultOptions),Bt(this,vd,Nb).call(this,t.options),je(this,gr,[]),je(this,si,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,je(this,gd,t.state||pR(this.options)),this.state=ee(this,gd),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!ee(this,gr).length&&this.state.fetchStatus==="idle"&&ee(this,si).remove(this)}setData(t,n){const r=cy(this.state.data,t,this.options);return Bt(this,Ni,ga).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Bt(this,Ni,ga).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=ee(this,il);return(r=ee(this,ai))==null||r.cancel(t),n?n.then(Ho).catch(Ho):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(ee(this,gd))}isActive(){return ee(this,gr).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||ee(this,gr).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!ME(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=ee(this,gr).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=ee(this,ai))==null||n.continue()}onOnline(){var n;const t=ee(this,gr).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=ee(this,ai))==null||n.continue()}addObserver(t){ee(this,gr).includes(t)||(ee(this,gr).push(t),this.clearGcTimeout(),ee(this,si).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){ee(this,gr).includes(t)&&(je(this,gr,ee(this,gr).filter(n=>n!==t)),ee(this,gr).length||(ee(this,ai)&&(ee(this,Dc)?ee(this,ai).cancel({revert:!0}):ee(this,ai).cancelRetry()),this.scheduleGc()),ee(this,si).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return ee(this,gr).length}invalidate(){this.state.isInvalidated||Bt(this,Ni,ga).call(this,{type:"invalidate"})}fetch(t,n){var c,u,d,h;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(ee(this,il))return(c=ee(this,ai))==null||c.continueRetry(),ee(this,il)}if(t&&Bt(this,vd,Nb).call(this,t),!this.options.queryFn){const p=ee(this,gr).find(m=>m.options.queryFn);p&&Bt(this,vd,Nb).call(this,p.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,o={queryKey:this.queryKey,meta:this.meta},i=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(je(this,Dc,!0),r.signal)})};i(o);const s=()=>this.options.queryFn?(je(this,Dc,!1),this.options.persister?this.options.persister(this.options.queryFn,o,this):this.options.queryFn(o)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),a={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(a),(u=this.options.behavior)==null||u.onFetch(a,this),je(this,md,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=a.fetchOptions)==null?void 0:d.meta))&&Bt(this,Ni,ga).call(this,{type:"fetch",meta:(h=a.fetchOptions)==null?void 0:h.meta});const l=p=>{var m,v,y,w;uy(p)&&p.silent||Bt(this,Ni,ga).call(this,{type:"error",error:p}),uy(p)||((v=(m=ee(this,si).config).onError)==null||v.call(m,p,this),(w=(y=ee(this,si).config).onSettled)==null||w.call(y,this.state.data,p,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return je(this,ai,FE({fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:p=>{var m,v,y,w;if(typeof p>"u"){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),l(new Error(`${this.queryHash} data is undefined`));return}this.setData(p),(v=(m=ee(this,si).config).onSuccess)==null||v.call(m,p,this),(w=(y=ee(this,si).config).onSettled)==null||w.call(y,p,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(p,m)=>{Bt(this,Ni,ga).call(this,{type:"failed",failureCount:p,error:m})},onPause:()=>{Bt(this,Ni,ga).call(this,{type:"pause"})},onContinue:()=>{Bt(this,Ni,ga).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),je(this,il,ee(this,ai).promise),ee(this,il)}},gd=new WeakMap,md=new WeakMap,si=new WeakMap,il=new WeakMap,ai=new WeakMap,gr=new WeakMap,pp=new WeakMap,Dc=new WeakMap,vd=new WeakSet,Nb=function(t){this.options={...ee(this,pp),...t},this.updateGcTime(this.options.gcTime)},Ni=new WeakSet,ga=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:t.meta??null,fetchStatus:ag(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return uy(o)&&o.revert&&ee(this,md)?{...ee(this,md),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),br.batch(()=>{ee(this,gr).forEach(r=>{r.onQueryUpdate()}),ee(this,si).notify({query:this,type:"updated",action:t})})},g8);function pR(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var gR=(m8=class extends nf{constructor(t={}){super();Ge(this,fs,void 0);this.config=t,je(this,fs,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??sy(o,n);let s=this.get(i);return s||(s=new hR({cache:this,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){ee(this,fs).has(t.queryHash)||(ee(this,fs).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=ee(this,fs).get(t.queryHash);n&&(t.destroy(),n===t&&ee(this,fs).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){br.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return ee(this,fs).get(t)}getAll(){return[...ee(this,fs).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>$E(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>$E(t,r)):n}notify(t){br.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){br.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){br.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},fs=new WeakMap,m8),mR=(v8=class extends RE{constructor(t){super();Ge(this,ps);Ge(this,hs,void 0);Ge(this,gp,void 0);Ge(this,Lo,void 0);Ge(this,bd,void 0);this.mutationId=t.mutationId,je(this,gp,t.defaultOptions),je(this,Lo,t.mutationCache),je(this,hs,[]),this.state=t.state||vR(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...ee(this,gp),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){ee(this,hs).includes(t)||(ee(this,hs).push(t),this.clearGcTimeout(),ee(this,Lo).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){je(this,hs,ee(this,hs).filter(n=>n!==t)),this.scheduleGc(),ee(this,Lo).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){ee(this,hs).length||(this.state.status==="pending"?this.scheduleGc():ee(this,Lo).remove(this))}continue(){var t;return((t=ee(this,bd))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,a,l,c,u,d,h,p,m,v,y,w,C,_,k,E,P,D;const n=()=>(je(this,bd,FE({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(M,I)=>{Bt(this,ps,_l).call(this,{type:"failed",failureCount:M,error:I})},onPause:()=>{Bt(this,ps,_l).call(this,{type:"pause"})},onContinue:()=>{Bt(this,ps,_l).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),ee(this,bd).promise),r=this.state.status==="pending";try{if(!r){Bt(this,ps,_l).call(this,{type:"pending",variables:t}),await((i=(o=ee(this,Lo).config).onMutate)==null?void 0:i.call(o,t,this));const I=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));I!==this.state.context&&Bt(this,ps,_l).call(this,{type:"pending",context:I,variables:t})}const M=await n();return await((c=(l=ee(this,Lo).config).onSuccess)==null?void 0:c.call(l,M,t,this.state.context,this)),await((d=(u=this.options).onSuccess)==null?void 0:d.call(u,M,t,this.state.context)),await((p=(h=ee(this,Lo).config).onSettled)==null?void 0:p.call(h,M,null,this.state.variables,this.state.context,this)),await((v=(m=this.options).onSettled)==null?void 0:v.call(m,M,null,t,this.state.context)),Bt(this,ps,_l).call(this,{type:"success",data:M}),M}catch(M){try{throw await((w=(y=ee(this,Lo).config).onError)==null?void 0:w.call(y,M,t,this.state.context,this)),await((_=(C=this.options).onError)==null?void 0:_.call(C,M,t,this.state.context)),await((E=(k=ee(this,Lo).config).onSettled)==null?void 0:E.call(k,void 0,M,this.state.variables,this.state.context,this)),await((D=(P=this.options).onSettled)==null?void 0:D.call(P,void 0,M,t,this.state.context)),M}finally{Bt(this,ps,_l).call(this,{type:"error",error:M})}}}},hs=new WeakMap,gp=new WeakMap,Lo=new WeakMap,bd=new WeakMap,ps=new WeakSet,_l=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:!ag(this.options.networkMode),status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),br.batch(()=>{ee(this,hs).forEach(r=>{r.onMutationUpdate(t)}),ee(this,Lo).notify({mutation:this,type:"updated",action:t})})},v8);function vR(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var bR=(b8=class extends nf{constructor(t={}){super();Ge(this,li,void 0);Ge(this,mp,void 0);Ge(this,Mc,void 0);this.config=t,je(this,li,[]),je(this,mp,0)}build(t,n,r){const o=new mR({mutationCache:this,mutationId:++Ib(this,mp)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){ee(this,li).push(t),this.notify({type:"added",mutation:t})}remove(t){je(this,li,ee(this,li).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){br.batch(()=>{ee(this,li).forEach(t=>{this.remove(t)})})}getAll(){return ee(this,li)}find(t){const n={exact:!0,...t};return ee(this,li).find(r=>TE(n,r))}findAll(t={}){return ee(this,li).filter(n=>TE(t,n))}notify(t){br.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return je(this,Mc,(ee(this,Mc)??Promise.resolve()).then(()=>{const t=ee(this,li).filter(n=>n.state.isPaused);return br.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(Ho)),Promise.resolve()))}).then(()=>{je(this,Mc,void 0)})),ee(this,Mc)}},li=new WeakMap,mp=new WeakMap,Mc=new WeakMap,b8);function yR(e){return{onFetch:(t,n)=>{const r=async()=>{var m,v,y,w,C;const o=t.options,i=(y=(v=(m=t.fetchOptions)==null?void 0:m.meta)==null?void 0:v.fetchMore)==null?void 0:y.direction,s=((w=t.state.data)==null?void 0:w.pages)||[],a=((C=t.state.data)==null?void 0:C.pageParams)||[],l={pages:[],pageParams:[]};let c=!1;const u=_=>{Object.defineProperty(_,"signal",{enumerable:!0,get:()=>(t.signal.aborted?c=!0:t.signal.addEventListener("abort",()=>{c=!0}),t.signal)})},d=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),h=async(_,k,E)=>{if(c)return Promise.reject();if(k==null&&_.pages.length)return Promise.resolve(_);const P={queryKey:t.queryKey,pageParam:k,direction:E?"backward":"forward",meta:t.options.meta};u(P);const D=await d(P),{maxPages:M}=t.options,I=E?lR:aR;return{pages:I(_.pages,D,M),pageParams:I(_.pageParams,k,M)}};let p;if(i&&s.length){const _=i==="backward",k=_?xR:jE,E={pages:s,pageParams:a},P=k(o,E);p=await h(E,P,_)}else{p=await h(l,a[0]??o.initialPageParam);const _=e??s.length;for(let k=1;k<_;k++){const E=jE(o,p);p=await h(p,E)}}return p};t.options.persister?t.fetchFn=()=>{var o,i;return(i=(o=t.options).persister)==null?void 0:i.call(o,r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=r}}}function jE(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function xR(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var wR=(y8=class{constructor(e={}){Ge(this,cr,void 0);Ge(this,sl,void 0);Ge(this,al,void 0);Ge(this,yd,void 0);Ge(this,xd,void 0);Ge(this,ll,void 0);Ge(this,wd,void 0);Ge(this,Sd,void 0);je(this,cr,e.queryCache||new gR),je(this,sl,e.mutationCache||new bR),je(this,al,e.defaultOptions||{}),je(this,yd,new Map),je(this,xd,new Map),je(this,ll,0)}mount(){Ib(this,ll)._++,ee(this,ll)===1&&(je(this,wd,sg.subscribe(()=>{sg.isFocused()&&(this.resumePausedMutations(),ee(this,cr).onFocus())})),je(this,Sd,sf.subscribe(()=>{sf.isOnline()&&(this.resumePausedMutations(),ee(this,cr).onOnline())})))}unmount(){var e,t;Ib(this,ll)._--,ee(this,ll)===0&&((e=ee(this,wd))==null||e.call(this),je(this,wd,void 0),(t=ee(this,Sd))==null||t.call(this),je(this,Sd,void 0))}isFetching(e){return ee(this,cr).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return ee(this,sl).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=ee(this,cr).find({queryKey:e}))==null?void 0:t.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);return t!==void 0?Promise.resolve(t):this.fetchQuery(e)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=ee(this,cr).find({queryKey:e}),o=r==null?void 0:r.state.data,i=iR(t,o);if(typeof i>"u")return;const s=this.defaultQueryOptions({queryKey:e});return ee(this,cr).build(this,s).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return br.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var t;return(t=ee(this,cr).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=ee(this,cr);br.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=ee(this,cr),r={type:"active",...e};return br.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=br.batch(()=>ee(this,cr).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Ho).catch(Ho)}invalidateQueries(e={},t={}){return br.batch(()=>{if(ee(this,cr).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=br.batch(()=>ee(this,cr).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(Ho)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Ho)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=ee(this,cr).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ho).catch(Ho)}fetchInfiniteQuery(e){return e.behavior=yR(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ho).catch(Ho)}resumePausedMutations(){return ee(this,sl).resumePausedMutations()}getQueryCache(){return ee(this,cr)}getMutationCache(){return ee(this,sl)}getDefaultOptions(){return ee(this,al)}setDefaultOptions(e){je(this,al,e)}setQueryDefaults(e,t){ee(this,yd).set(rf(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...ee(this,yd).values()];let n={};return t.forEach(r=>{of(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){ee(this,xd).set(rf(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...ee(this,xd).values()];let n={};return t.forEach(r=>{of(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...ee(this,al).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=sy(t.queryKey,t)),typeof t.refetchOnReconnect>"u"&&(t.refetchOnReconnect=t.networkMode!=="always"),typeof t.throwOnError>"u"&&(t.throwOnError=!!t.suspense),typeof t.networkMode>"u"&&t.persister&&(t.networkMode="offlineFirst"),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...ee(this,al).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){ee(this,cr).clear(),ee(this,sl).clear()}},cr=new WeakMap,sl=new WeakMap,al=new WeakMap,yd=new WeakMap,xd=new WeakMap,ll=new WeakMap,wd=new WeakMap,Sd=new WeakMap,y8),SR=(x8=class extends nf{constructor(t,n){super();Ge(this,Ic);Ge(this,yp);Ge(this,xp);Ge(this,wp);Ge(this,Sp);Ge(this,Cp);Ge(this,_p);Ge(this,Ep);Ge(this,Uv);Ge(this,ao,void 0);Ge(this,Tn,void 0);Ge(this,vp,void 0);Ge(this,Vr,void 0);Ge(this,$c,void 0);Ge(this,Cd,void 0);Ge(this,gs,void 0);Ge(this,bp,void 0);Ge(this,_d,void 0);Ge(this,Ed,void 0);Ge(this,Tc,void 0);Ge(this,Ac,void 0);Ge(this,cl,void 0);Ge(this,kd,new Set);this.options=n,je(this,ao,t),je(this,gs,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(ee(this,Tn).addObserver(this),zE(ee(this,Tn),this.options)?Bt(this,Ic,Up).call(this):this.updateResult(),Bt(this,Sp,z2).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return dy(ee(this,Tn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return dy(ee(this,Tn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Bt(this,Cp,B2).call(this),Bt(this,_p,V2).call(this),ee(this,Tn).removeObserver(this)}setOptions(t,n){const r=this.options,o=ee(this,Tn);if(this.options=ee(this,ao).defaultQueryOptions(t),ay(r,this.options)||ee(this,ao).getQueryCache().notify({type:"observerOptionsUpdated",query:ee(this,Tn),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),Bt(this,Ep,H2).call(this);const i=this.hasListeners();i&&BE(ee(this,Tn),o,this.options,r)&&Bt(this,Ic,Up).call(this),this.updateResult(n),i&&(ee(this,Tn)!==o||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&Bt(this,yp,F2).call(this);const s=Bt(this,xp,R2).call(this);i&&(ee(this,Tn)!==o||this.options.enabled!==r.enabled||s!==ee(this,cl))&&Bt(this,wp,j2).call(this,s)}getOptimisticResult(t){const n=ee(this,ao).getQueryCache().build(ee(this,ao),t),r=this.createResult(n,t);return _R(this,r)&&(je(this,Vr,r),je(this,Cd,this.options),je(this,$c,ee(this,Tn).state)),r}getCurrentResult(){return ee(this,Vr)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(ee(this,kd).add(r),t[r])})}),n}getCurrentQuery(){return ee(this,Tn)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=ee(this,ao).defaultQueryOptions(t),r=ee(this,ao).getQueryCache().build(ee(this,ao),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Bt(this,Ic,Up).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),ee(this,Vr)))}createResult(t,n){var P;const r=ee(this,Tn),o=this.options,i=ee(this,Vr),s=ee(this,$c),a=ee(this,Cd),c=t!==r?t.state:ee(this,vp),{state:u}=t;let{error:d,errorUpdatedAt:h,fetchStatus:p,status:m}=u,v=!1,y;if(n._optimisticResults){const D=this.hasListeners(),M=!D&&zE(t,n),I=D&&BE(t,r,n,o);(M||I)&&(p=ag(t.options.networkMode)?"fetching":"paused",u.dataUpdatedAt||(m="pending")),n._optimisticResults==="isRestoring"&&(p="idle")}if(n.select&&typeof u.data<"u")if(i&&u.data===(s==null?void 0:s.data)&&n.select===ee(this,bp))y=ee(this,_d);else try{je(this,bp,n.select),y=n.select(u.data),y=cy(i==null?void 0:i.data,y,n),je(this,_d,y),je(this,gs,null)}catch(D){je(this,gs,D)}else y=u.data;if(typeof n.placeholderData<"u"&&typeof y>"u"&&m==="pending"){let D;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))D=i.data;else if(D=typeof n.placeholderData=="function"?n.placeholderData((P=ee(this,Ed))==null?void 0:P.state.data,ee(this,Ed)):n.placeholderData,n.select&&typeof D<"u")try{D=n.select(D),je(this,gs,null)}catch(M){je(this,gs,M)}typeof D<"u"&&(m="success",y=cy(i==null?void 0:i.data,D,n),v=!0)}ee(this,gs)&&(d=ee(this,gs),y=ee(this,_d),h=Date.now(),m="error");const w=p==="fetching",C=m==="pending",_=m==="error",k=C&&w;return{status:m,fetchStatus:p,isPending:C,isSuccess:m==="success",isError:_,isInitialLoading:k,isLoading:k,data:y,dataUpdatedAt:u.dataUpdatedAt,error:d,errorUpdatedAt:h,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:w,isRefetching:w&&!C,isLoadingError:_&&u.dataUpdatedAt===0,isPaused:p==="paused",isPlaceholderData:v,isRefetchError:_&&u.dataUpdatedAt!==0,isStale:fy(t,n),refetch:this.refetch}}updateResult(t){const n=ee(this,Vr),r=this.createResult(ee(this,Tn),this.options);if(je(this,$c,ee(this,Tn).state),je(this,Cd,this.options),ee(this,$c).data!==void 0&&je(this,Ed,ee(this,Tn)),ay(r,n))return;je(this,Vr,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!ee(this,kd).size)return!0;const l=new Set(a??ee(this,kd));return this.options.throwOnError&&l.add("error"),Object.keys(ee(this,Vr)).some(c=>{const u=c;return ee(this,Vr)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),Bt(this,Uv,GL).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Bt(this,Sp,z2).call(this)}},ao=new WeakMap,Tn=new WeakMap,vp=new WeakMap,Vr=new WeakMap,$c=new WeakMap,Cd=new WeakMap,gs=new WeakMap,bp=new WeakMap,_d=new WeakMap,Ed=new WeakMap,Tc=new WeakMap,Ac=new WeakMap,cl=new WeakMap,kd=new WeakMap,Ic=new WeakSet,Up=function(t){Bt(this,Ep,H2).call(this);let n=ee(this,Tn).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Ho)),n},yp=new WeakSet,F2=function(){if(Bt(this,Cp,B2).call(this),Xc||ee(this,Vr).isStale||!iy(this.options.staleTime))return;const n=ME(ee(this,Vr).dataUpdatedAt,this.options.staleTime)+1;je(this,Tc,setTimeout(()=>{ee(this,Vr).isStale||this.updateResult()},n))},xp=new WeakSet,R2=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(ee(this,Tn)):this.options.refetchInterval)??!1},wp=new WeakSet,j2=function(t){Bt(this,_p,V2).call(this),je(this,cl,t),!(Xc||this.options.enabled===!1||!iy(ee(this,cl))||ee(this,cl)===0)&&je(this,Ac,setInterval(()=>{(this.options.refetchIntervalInBackground||sg.isFocused())&&Bt(this,Ic,Up).call(this)},ee(this,cl)))},Sp=new WeakSet,z2=function(){Bt(this,yp,F2).call(this),Bt(this,wp,j2).call(this,Bt(this,xp,R2).call(this))},Cp=new WeakSet,B2=function(){ee(this,Tc)&&(clearTimeout(ee(this,Tc)),je(this,Tc,void 0))},_p=new WeakSet,V2=function(){ee(this,Ac)&&(clearInterval(ee(this,Ac)),je(this,Ac,void 0))},Ep=new WeakSet,H2=function(){const t=ee(this,ao).getQueryCache().build(ee(this,ao),this.options);if(t===ee(this,Tn))return;const n=ee(this,Tn);je(this,Tn,t),je(this,vp,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Uv=new WeakSet,GL=function(t){br.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(ee(this,Vr))}),ee(this,ao).getQueryCache().notify({query:ee(this,Tn),type:"observerResultsUpdated"})})},x8);function CR(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function zE(e,t){return CR(e,t)||e.state.dataUpdatedAt>0&&dy(e,t,t.refetchOnMount)}function dy(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&fy(e,t)}return!1}function BE(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&fy(e,n)}function fy(e,t){return e.isStaleByTime(t.staleTime)}function _R(e,t){return!ay(e.getCurrentResult(),t)}var VE=he.createContext(void 0),HE=e=>{const t=he.useContext(VE);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},ER=({client:e,children:t})=>(he.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),he.createElement(VE.Provider,{value:e},t)),qE=he.createContext(!1),kR=()=>he.useContext(qE);qE.Provider;function OR(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var PR=he.createContext(OR()),DR=()=>he.useContext(PR);function MR(e,t){return typeof e=="function"?e(...t):!!e}var $R=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},TR=e=>{he.useEffect(()=>{e.clearReset()},[e])},AR=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&MR(n,[e.error,r]),IR=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},NR=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,LR=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function FR(e,t,n){if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=HE(n),o=kR(),i=DR(),s=r.defaultQueryOptions(e);s._optimisticResults=o?"isRestoring":"optimistic",IR(s),$R(s,i),TR(i);const[a]=he.useState(()=>new t(r,s)),l=a.getOptimisticResult(s);if(he.useSyncExternalStore(he.useCallback(c=>{const u=o?()=>{}:a.subscribe(br.batchCalls(c));return a.updateResult(),u},[a,o]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),he.useEffect(()=>{a.setOptions(s,{listeners:!1})},[s,a]),NR(s,l))throw LR(s,a,i);if(AR({result:l,errorResetBoundary:i,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw l.error;return s.notifyOnChangeProps?l:a.trackResult(l)}function yi(e,t){return FR(e,SR,t)}let lg;const RR=new Uint8Array(16);function jR(){if(!lg&&(lg=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!lg))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return lg(RR)}const yr=[];for(let e=0;e<256;++e)yr.push((e+256).toString(16).slice(1));function zR(e,t=0){return yr[e[t+0]]+yr[e[t+1]]+yr[e[t+2]]+yr[e[t+3]]+"-"+yr[e[t+4]]+yr[e[t+5]]+"-"+yr[e[t+6]]+yr[e[t+7]]+"-"+yr[e[t+8]]+yr[e[t+9]]+"-"+yr[e[t+10]]+yr[e[t+11]]+yr[e[t+12]]+yr[e[t+13]]+yr[e[t+14]]+yr[e[t+15]]}const WE={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function ya(e,t,n){if(WE.randomUUID&&!t&&!e)return WE.randomUUID();e=e||{};const r=e.random||(e.rng||jR)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let o=0;o<16;++o)t[n+o]=r[o];return t}return zR(r)}const be=dE()(CE((e,t)=>({isShowingVisual:!0,runSql:!1,sqlGen:{},sql:"",isSqlRunning:!1,queryResultColumns:[],showFilters:!1,applyFilters:!1,filterValues:[{filterId:"sample-filter-id",valueType:"string",name:"",operation:"in",values:[""]}],card:{id:ya(),title:"Editor Card",description:"Description",type:"bar",data:[]},frame:{id:ya(),cards:[],activeCardId:""},actions:{setNumberFormat:(n,r,o,i)=>{e(s=>{var a;s.card.preferences={...(a=s.card)==null?void 0:a.preferences,formatNumber:{format:n,currency:r,locale:o,suffix:i,enabled:!0}}})},setQueryError:n=>{e(r=>{r.queryError=n})},setQueryResultColumns:n=>{e(r=>{r.queryResultColumns=n})},setCardPreferences:n=>{e(r=>{r.card.preferences=n})},setFilterOnClickColumnIndex:n=>{e(r=>{r.card.preferences={...r.card.preferences,filterOnClickColumnIndex:n}})},setFilterOnClickField:n=>{e(r=>{r.card.preferences={...r.card.preferences,filterOnClick:!0,filterOnClickField:n}})},setCardRefreshInterval:n=>{e(r=>{r.card.refreshInterval=n})},setIsShowingVisual:n=>{e({isShowingVisual:n})},setRunSql:n=>{e({runSql:n})},setIsSqlRunning:n=>{e({isSqlRunning:n})},setFrame:n=>{e({frame:n})},setCard:n=>{e({card:n})},setCardType:n=>{e(r=>{r.card.type=n})},setCardSql:n=>{e(r=>{r.card.sql=n})},setCardPython:n=>{e(r=>{r.card.python=n})},setPythonStdOut:n=>{e(r=>{r.pythonStdOut=n})},setCardCustomCfg:n=>{e(r=>{r.card.customCfg=n})},setCardCfg:n=>{e(r=>{r.card.cfg=n})},setShowFilters:n=>{e(r=>{r.showFilters=n})},setApplyFilters:n=>{e(r=>{r.applyFilters=n})},setFilterValues:n=>{e(r=>{r.filterValues=n})},setSqlGen:n=>{e(r=>{r.sqlGen=n})},setSqlGenMeasure:(n,r)=>{e(o=>{o.sqlGen.measures=[...o.sqlGen.measures||[],{name:n,calc:r}]})},setSqlGenDimension:n=>{e(r=>{r.sqlGen.dimensions=[...r.sqlGen.dimensions||[],n]})},setCardData:n=>{e(r=>{r.card.data=n})},setSelectedConnectionId:n=>{var r,o;e(i=>{i.selectedConnectionId=n,i.card.connectionId=n}),(o=(r=t()).onConnectionChange)==null||o.call(r,n)},setSelectedDatabaseName:n=>{var r,o;e(i=>{i.selectedDatabaseName=n,i.card.lastSelectedDatabase=n}),(o=(r=t()).onDatabaseChange)==null||o.call(r,n)},setSelectedSchemaName:n=>{var r,o;e(i=>{i.selectedSchemaName=n,i.card.lastSelectedSchema=n}),(o=(r=t()).onSchemaChange)==null||o.call(r,n)},setSelectedTableName:n=>{var r,o;e(i=>{i.selectedTableName=n,i.card.lastSelectedTable=n}),(o=(r=t()).onTableChange)==null||o.call(r,n)},setCurrentColumns:n=>{e(r=>{r.currentColumns=n})},setOnConnectionChange:n=>{e({onConnectionChange:n})},setOnDatabaseChange:n=>{e({onDatabaseChange:n})},setOnSchemaChange:n=>{e({onSchemaChange:n})},setOnTableChange:n=>{e({onTableChange:n})},setOnSave:n=>{e({onSave:n})},setOnClose:n=>{e({onClose:n})}}}))),BR=()=>be(e=>e.actions);process.env.NODE_ENV==="development"&&EE("EditorStore",be);function UE({children:e}){const t=new wR;return x.jsx(ER,{client:t,children:e})}var Ot={context:void 0,registry:void 0};function af(e){Ot.context=e}var VR=(e,t)=>e===t,qo=Symbol("solid-proxy"),Qc=Symbol("solid-track"),cg={equals:VR},GE=JE,ks=1,ug=2,KE={owned:null,cleanups:null,context:null,owner:null},hy={},Qt=null,py=null,dn=null,Or=null,Os=null,dg=0;function Ps(e,t){const n=dn,r=Qt,o=e.length===0,i=t===void 0?r:t,s=o?KE:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e(()=>Fn(()=>gg(s)));Qt=s,dn=null;try{return zi(a,!0)}finally{dn=n,Qt=r}}function qe(e,t){t=t?Object.assign({},cg,t):cg;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),ZE(n,o));return[QE.bind(n),r]}function gy(e,t,n){const r=fg(e,t,!0,ks);Zc(r)}function at(e,t,n){const r=fg(e,t,!1,ks);Zc(r)}function ht(e,t,n){GE=ZR;const r=fg(e,t,!1,ks);(!n||!n.render)&&(r.user=!0),Os?Os.push(r):Zc(r)}function Me(e,t,n){n=n?Object.assign({},cg,n):cg;const r=fg(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Zc(r),QE.bind(r)}function HR(e){return e&&typeof e=="object"&&"then"in e}function qR(e,t,n){let r,o,i;arguments.length===2&&typeof t=="object"||arguments.length===1?(r=!0,o=e,i=t||{}):(r=e,o=t,i=n||{});let s=null,a=hy,l=null,c=!1,u="initialValue"in i,d=typeof r=="function"&&Me(r);const h=new Set,[p,m]=(i.storage||qe)(i.initialValue),[v,y]=qe(void 0),[w,C]=qe(void 0,{equals:!1}),[_,k]=qe(u?"ready":"unresolved");if(Ot.context){l=`${Ot.context.id}${Ot.context.count++}`;let I;i.ssrLoadFrom==="initial"?a=i.initialValue:Ot.load&&(I=Ot.load(l))&&(a=I)}function E(I,F,R,B){return s===I&&(s=null,B!==void 0&&(u=!0),(I===a||F===a)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(B,{value:F})),a=hy,P(F,R)),F}function P(I,F){zi(()=>{F===void 0&&m(()=>I),k(F!==void 0?"errored":u?"ready":"unresolved"),y(F);for(const R of h.keys())R.decrement();h.clear()},!1)}function D(){const I=YR,F=p(),R=v();if(R!==void 0&&!s)throw R;return dn&&!dn.user&&I&&gy(()=>{w(),s&&(I.resolved||h.has(I)||(I.increment(),h.add(I)))}),F}function M(I=!0){if(I!==!1&&c)return;c=!1;const F=d?d():r;if(F==null||F===!1){E(s,Fn(p));return}const R=a!==hy?a:Fn(()=>o(F,{value:p(),refetching:I}));return HR(R)?(s=R,"value"in R?(R.status==="success"?E(s,R.value,void 0,F):E(s,void 0,void 0,F),R):(c=!0,queueMicrotask(()=>c=!1),zi(()=>{k(u?"refreshing":"pending"),C()},!1),R.then(B=>E(R,B,void 0,F),B=>E(R,void 0,t5(B),F)))):(E(s,R,void 0,F),R)}return Object.defineProperties(D,{state:{get:()=>_()},error:{get:()=>v()},loading:{get(){const I=_();return I==="pending"||I==="refreshing"}},latest:{get(){if(!u)return D();const I=v();if(I&&!s)throw I;return p()}}}),d?gy(()=>M(!1)):M(!1),[D,{refetch:M,mutate:m}]}function YE(e){return zi(e,!1)}function Fn(e){if(dn===null)return e();const t=dn;dn=null;try{return e()}finally{dn=t}}function xi(e,t,n){const r=Array.isArray(e);let o,i=n&&n.defer;return s=>{let a;if(r){a=Array(e.length);for(let c=0;c<e.length;c++)a[c]=e[c]()}else a=e();if(i){i=!1;return}const l=Fn(()=>t(a,o,s));return o=a,l}}function Ml(e){ht(()=>Fn(e))}function pt(e){return Qt===null||(Qt.cleanups===null?Qt.cleanups=[e]:Qt.cleanups.push(e)),e}function my(){return dn}function XE(){return Qt}function WR(e,t){const n=Qt,r=dn;Qt=e,dn=null;try{return zi(t,!0)}catch(o){by(o)}finally{Qt=n,dn=r}}function UR(e){const t=dn,n=Qt;return Promise.resolve().then(()=>{dn=t,Qt=n;let r;return zi(e,!1),dn=Qt=null,r?r.done:void 0})}var[GR,u2e]=qe(!1);function KR(){return[GR,UR]}function Kr(e,t){const n=Symbol("context");return{id:n,Provider:JR(n),defaultValue:e}}function Yr(e){return Qt&&Qt.context&&Qt.context[e.id]!==void 0?Qt.context[e.id]:e.defaultValue}function vy(e){const t=Me(e),n=Me(()=>yy(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}var YR;function QE(){if(this.sources&&this.state)if(this.state===ks)Zc(this);else{const e=Or;Or=null,zi(()=>pg(this),!1),Or=e}if(dn){const e=this.observers?this.observers.length:0;dn.sources?(dn.sources.push(this),dn.sourceSlots.push(e)):(dn.sources=[this],dn.sourceSlots=[e]),this.observers?(this.observers.push(dn),this.observerSlots.push(dn.sources.length-1)):(this.observers=[dn],this.observerSlots=[dn.sources.length-1])}return this.value}function ZE(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&zi(()=>{for(let o=0;o<e.observers.length;o+=1){const i=e.observers[o],s=py&&py.running;s&&py.disposed.has(i),(s?!i.tState:!i.state)&&(i.pure?Or.push(i):Os.push(i),i.observers&&e5(i)),s||(i.state=ks)}if(Or.length>1e6)throw Or=[],new Error},!1)),t}function Zc(e){if(!e.fn)return;gg(e);const t=dg;XR(e,e.value,t)}function XR(e,t,n){let r;const o=Qt,i=dn;dn=Qt=e;try{r=e.fn(t)}catch(s){return e.pure&&(e.state=ks,e.owned&&e.owned.forEach(gg),e.owned=null),e.updatedAt=n+1,by(s)}finally{dn=i,Qt=o}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?ZE(e,r):e.value=r,e.updatedAt=n)}function fg(e,t,n,r=ks,o){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:Qt,context:Qt?Qt.context:null,pure:n};return Qt===null||Qt!==KE&&(Qt.owned?Qt.owned.push(i):Qt.owned=[i]),i}function hg(e){if(e.state===0)return;if(e.state===ug)return pg(e);if(e.suspense&&Fn(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<dg);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===ks)Zc(e);else if(e.state===ug){const r=Or;Or=null,zi(()=>pg(e,t[0]),!1),Or=r}}function zi(e,t){if(Or)return e();let n=!1;t||(Or=[]),Os?n=!0:Os=[],dg++;try{const r=e();return QR(n),r}catch(r){n||(Os=null),Or=null,by(r)}}function QR(e){if(Or&&(JE(Or),Or=null),e)return;const t=Os;Os=null,t.length&&zi(()=>GE(t),!1)}function JE(e){for(let t=0;t<e.length;t++)hg(e[t])}function ZR(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:hg(r)}if(Ot.context){if(Ot.count){Ot.effects||(Ot.effects=[]),Ot.effects.push(...e.slice(0,n));return}else Ot.effects&&(e=[...Ot.effects,...e],n+=Ot.effects.length,delete Ot.effects);af()}for(t=0;t<n;t++)hg(e[t])}function pg(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const r=e.sources[n];if(r.sources){const o=r.state;o===ks?r!==t&&(!r.updatedAt||r.updatedAt<dg)&&hg(r):o===ug&&pg(r,t)}}}function e5(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=ug,n.pure?Or.push(n):Os.push(n),n.observers&&e5(n))}}function gg(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),r=e.sourceSlots.pop(),o=n.observers;if(o&&o.length){const i=o.pop(),s=n.observerSlots.pop();r<o.length&&(i.sourceSlots[s]=r,o[r]=i,n.observerSlots[r]=s)}}if(e.owned){for(t=e.owned.length-1;t>=0;t--)gg(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function t5(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function by(e,t=Qt){throw t5(e)}function yy(e){if(typeof e=="function"&&!e.length)return yy(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=yy(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function JR(e,t){return function(r){let o;return at(()=>o=Fn(()=>(Qt.context={...Qt.context,[e]:r.value},vy(()=>r.children))),void 0),o}}var xy=Symbol("fallback");function mg(e){for(let t=0;t<e.length;t++)e[t]()}function e6(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return pt(()=>mg(i)),()=>{let l=e()||[],c,u;return l[Qc],Fn(()=>{let h=l.length,p,m,v,y,w,C,_,k,E;if(h===0)s!==0&&(mg(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[xy],o[0]=Ps(P=>(i[0]=P,n.fallback())),s=1);else if(s===0){for(o=new Array(h),u=0;u<h;u++)r[u]=l[u],o[u]=Ps(d);s=h}else{for(v=new Array(h),y=new Array(h),a&&(w=new Array(h)),C=0,_=Math.min(s,h);C<_&&r[C]===l[C];C++);for(_=s-1,k=h-1;_>=C&&k>=C&&r[_]===l[k];_--,k--)v[k]=o[_],y[k]=i[_],a&&(w[k]=a[_]);for(p=new Map,m=new Array(k+1),u=k;u>=C;u--)E=l[u],c=p.get(E),m[u]=c===void 0?-1:c,p.set(E,u);for(c=C;c<=_;c++)E=r[c],u=p.get(E),u!==void 0&&u!==-1?(v[u]=o[c],y[u]=i[c],a&&(w[u]=a[c]),u=m[u],p.set(E,u)):i[c]();for(u=C;u<h;u++)u in v?(o[u]=v[u],i[u]=y[u],a&&(a[u]=w[u],a[u](u))):o[u]=Ps(d);o=o.slice(0,s=h),r=l.slice(0)}return o});function d(h){if(i[u]=h,a){const[p,m]=qe(u);return a[u]=m,t(l[u],p)}return t(l[u])}}}function t6(e,t,n={}){let r=[],o=[],i=[],s=[],a=0,l;return pt(()=>mg(i)),()=>{const c=e()||[];return c[Qc],Fn(()=>{if(c.length===0)return a!==0&&(mg(i),i=[],r=[],o=[],a=0,s=[]),n.fallback&&(r=[xy],o[0]=Ps(d=>(i[0]=d,n.fallback())),a=1),o;for(r[0]===xy&&(i[0](),i=[],r=[],o=[],a=0),l=0;l<c.length;l++)l<r.length&&r[l]!==c[l]?s[l](()=>c[l]):l>=r.length&&(o[l]=Ps(u));for(;l<r.length;l++)i[l]();return a=s.length=i.length=c.length,r=c.slice(0),o=o.slice(0,a)});function u(d){i[l]=d;const[h,p]=qe(c[l]);return s[l]=p,t(h,l)}}}function Q(e,t){return Fn(()=>e(t||{}))}function vg(){return!0}var wy={get(e,t,n){return t===qo?n:e.get(t)},has(e,t){return t===qo?!0:e.has(t)},set:vg,deleteProperty:vg,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:vg,deleteProperty:vg}},ownKeys(e){return e.keys()}};function Sy(e){return(e=typeof e=="function"?e():e)?e:{}}function n6(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function Pt(...e){let t=!1;for(let i=0;i<e.length;i++){const s=e[i];t=t||!!s&&qo in s,e[i]=typeof s=="function"?(t=!0,Me(s)):s}if(t)return new Proxy({get(i){for(let s=e.length-1;s>=0;s--){const a=Sy(e[s])[i];if(a!==void 0)return a}},has(i){for(let s=e.length-1;s>=0;s--)if(i in Sy(e[s]))return!0;return!1},keys(){const i=[];for(let s=0;s<e.length;s++)i.push(...Object.keys(Sy(e[s])));return[...new Set(i)]}},wy);const n={},r={},o=new Set;for(let i=e.length-1;i>=0;i--){const s=e[i];if(!s)continue;const a=Object.getOwnPropertyNames(s);for(let l=0,c=a.length;l<c;l++){const u=a[l];if(u==="__proto__"||u==="constructor")continue;const d=Object.getOwnPropertyDescriptor(s,u);if(!o.has(u))d.get?(o.add(u),Object.defineProperty(n,u,{enumerable:!0,configurable:!0,get:n6.bind(r[u]=[d.get.bind(s)])})):(d.value!==void 0&&o.add(u),n[u]=d.value);else{const h=r[u];h?d.get?h.push(d.get.bind(s)):d.value!==void 0&&h.push(()=>d.value):n[u]===void 0&&(n[u]=d.value)}}}return n}function rn(e,...t){if(qo in e){const o=new Set(t.length>1?t.flat():t[0]),i=t.map(s=>new Proxy({get(a){return s.includes(a)?e[a]:void 0},has(a){return s.includes(a)&&a in e},keys(){return s.filter(a=>a in e)}},wy));return i.push(new Proxy({get(s){return o.has(s)?void 0:e[s]},has(s){return o.has(s)?!1:s in e},keys(){return Object.keys(e).filter(s=>!o.has(s))}},wy)),i}const n={},r=t.map(()=>({}));for(const o of Object.getOwnPropertyNames(e)){const i=Object.getOwnPropertyDescriptor(e,o),s=!i.get&&!i.set&&i.enumerable&&i.writable&&i.configurable;let a=!1,l=0;for(const c of t)c.includes(o)&&(a=!0,s?r[l][o]=i.value:Object.defineProperty(r[l],o,i)),++l;a||(s?n[o]=i.value:Object.defineProperty(n,o,i))}return[...r,n]}function r6(e){let t,n;const r=o=>{const i=Ot.context;if(i){const[a,l]=qe();Ot.count||(Ot.count=0),Ot.count++,(n||(n=e())).then(c=>{af(i),Ot.count--,l(()=>c.default),af()}),t=a}else if(!t){const[a]=qR(()=>(n||(n=e())).then(l=>l.default));t=a}let s;return Me(()=>(s=t())&&Fn(()=>{if(!i)return s(o);const a=Ot.context;af(i);const l=s(o);return af(a),l}))};return r.preload=()=>n||((n=e()).then(o=>t=()=>o.default),n),r}var o6=0;function wi(){const e=Ot.context;return e?`${e.id}${e.count++}`:`cl-${o6++}`}var n5=e=>`Stale read from <${e}>.`;function r5(e){const t="fallback"in e&&{fallback:()=>e.fallback};return Me(e6(()=>e.each,e.children,t||void 0))}function i6(e){const t="fallback"in e&&{fallback:()=>e.fallback};return Me(t6(()=>e.each,e.children,t||void 0))}function ut(e){const t=e.keyed,n=Me(()=>e.when,void 0,{equals:(r,o)=>t?r===o:!r==!o});return Me(()=>{const r=n();if(r){const o=e.children;return typeof o=="function"&&o.length>0?Fn(()=>o(t?r:()=>{if(!Fn(n))throw n5("Show");return e.when})):o}return e.fallback},void 0,void 0)}function s6(e){let t=!1;const n=(i,s)=>i[0]===s[0]&&(t?i[1]===s[1]:!i[1]==!s[1])&&i[2]===s[2],r=vy(()=>e.children),o=Me(()=>{let i=r();Array.isArray(i)||(i=[i]);for(let s=0;s<i.length;s++){const a=i[s].when;if(a)return t=!!i[s].keyed,[s,a,i[s]]}return[-1]},void 0,{equals:n});return Me(()=>{const[i,s,a]=o();if(i<0)return e.fallback;const l=a.children;return typeof l=="function"&&l.length>0?Fn(()=>l(t?s:()=>{if(Fn(o)[0]!==i)throw n5("Match");return a.when})):l},void 0,void 0)}function Cy(e){return e}var a6=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],l6=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...a6]),c6=new Set(["innerHTML","textContent","innerText","children"]),u6=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),d6=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function f6(e,t){const n=d6[e];return typeof n=="object"?n[t]?n.$:void 0:n}var h6=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),p6=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),g6={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function m6(e,t,n){let r=n.length,o=t.length,i=r,s=0,a=0,l=t[o-1].nextSibling,c=null;for(;s<o||a<i;){if(t[s]===n[a]){s++,a++;continue}for(;t[o-1]===n[i-1];)o--,i--;if(o===s){const u=i<r?a?n[a-1].nextSibling:n[i-a]:l;for(;a<i;)e.insertBefore(n[a++],u)}else if(i===a)for(;s<o;)(!c||!c.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[i-1]&&n[a]===t[o-1]){const u=t[--o].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--i],u),t[o]=n[i]}else{if(!c){c=new Map;let d=a;for(;d<i;)c.set(n[d],d++)}const u=c.get(t[s]);if(u!=null)if(a<u&&u<i){let d=s,h=1,p;for(;++d<o&&d<i&&!((p=c.get(t[d]))==null||p!==u+h);)h++;if(h>u-a){const m=t[s];for(;a<u;)e.insertBefore(n[a++],m)}else e.replaceChild(n[a++],t[s++])}else s++;else t[s++].remove()}}}var o5="_$DX_DELEGATE";function v6(e,t,n,r={}){let o;return Ps(i=>{o=i,t===document?e():ke(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{o(),t.textContent=""}}function Ye(e,t,n){let r;const o=()=>{const s=document.createElement("template");return s.innerHTML=e,n?s.content.firstChild.firstChild:s.content.firstChild},i=t?()=>Fn(()=>document.importNode(r||(r=o()),!0)):()=>(r||(r=o())).cloneNode(!0);return i.cloneNode=i,i}function lf(e,t=window.document){const n=t[o5]||(t[o5]=new Set);for(let r=0,o=e.length;r<o;r++){const i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,_6))}}function Te(e,t,n){Ot.context||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function b6(e,t,n,r){Ot.context||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function Le(e,t){Ot.context||(t==null?e.removeAttribute("class"):e.className=t)}function i5(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const o=n[0];e.addEventListener(t,n[0]=i=>o.call(e,n[1],i))}else e.addEventListener(t,n)}function y6(e,t,n={}){const r=Object.keys(t||{}),o=Object.keys(n);let i,s;for(i=0,s=o.length;i<s;i++){const a=o[i];!a||a==="undefined"||t[a]||(s5(e,a,!1),delete n[a])}for(i=0,s=r.length;i<s;i++){const a=r[i],l=!!t[a];!a||a==="undefined"||n[a]===l||!l||(s5(e,a,!0),n[a]=l)}return n}function x6(e,t,n){if(!t)return n?Te(e,"style"):t;const r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let o,i;for(i in n)t[i]==null&&r.removeProperty(i),delete n[i];for(i in t)o=t[i],o!==n[i]&&(r.setProperty(i,o),n[i]=o);return n}function bg(e,t={},n,r){const o={};return r||at(()=>o.children=Jc(e,t.children,o.children)),at(()=>t.ref&&t.ref(e)),at(()=>w6(e,t,n,!0,o,!0)),o}function cf(e,t,n){return Fn(()=>e(t,n))}function ke(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return Jc(e,t,r,n);at(o=>Jc(e,t(),o,n),r)}function w6(e,t,n,r,o={},i=!1){t||(t={});for(const s in o)if(!(s in t)){if(s==="children")continue;o[s]=a5(e,s,null,o[s],n,i)}for(const s in t){if(s==="children"){r||Jc(e,t.children);continue}const a=t[s];o[s]=a5(e,s,a,o[s],n,i)}}function S6(e){let t,n;return!Ot.context||!(t=Ot.registry.get(n=E6()))?e():(Ot.completed&&Ot.completed.add(t),Ot.registry.delete(n),t)}function C6(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function s5(e,t,n){const r=t.trim().split(/\s+/);for(let o=0,i=r.length;o<i;o++)e.classList.toggle(r[o],n)}function a5(e,t,n,r,o,i){let s,a,l,c,u;if(t==="style")return x6(e,n,r);if(t==="classList")return y6(e,n,r);if(n===r)return r;if(t==="ref")i||n(e);else if(t.slice(0,3)==="on:"){const d=t.slice(3);r&&e.removeEventListener(d,r),n&&e.addEventListener(d,n)}else if(t.slice(0,10)==="oncapture:"){const d=t.slice(10);r&&e.removeEventListener(d,r,!0),n&&e.addEventListener(d,n,!0)}else if(t.slice(0,2)==="on"){const d=t.slice(2).toLowerCase(),h=h6.has(d);if(!h&&r){const p=Array.isArray(r)?r[0]:r;e.removeEventListener(d,p)}(h||n)&&(i5(e,d,n,h),h&&lf([d]))}else if(t.slice(0,5)==="attr:")Te(e,t.slice(5),n);else if((u=t.slice(0,5)==="prop:")||(l=c6.has(t))||!o&&((c=f6(t,e.tagName))||(a=l6.has(t)))||(s=e.nodeName.includes("-"))){if(u)t=t.slice(5),a=!0;else if(Ot.context)return n;t==="class"||t==="className"?Le(e,n):s&&!a&&!l?e[C6(t)]=n:e[c||t]=n}else{const d=o&&t.indexOf(":")>-1&&g6[t.split(":")[0]];d?b6(e,d,t,n):Te(e,u6[t]||t,n)}return n}function _6(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return n||document}}),Ot.registry&&!Ot.done&&(Ot.done=_$HY.done=!0);n;){const r=n[t];if(r&&!n.disabled){const o=n[`${t}Data`];if(o!==void 0?r.call(n,o,e):r.call(n,e),e.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function Jc(e,t,n,r,o){if(Ot.context){!n&&(n=[...e.childNodes]);let a=[];for(let l=0;l<n.length;l++){const c=n[l];c.nodeType===8&&c.data.slice(0,2)==="!$"?c.remove():a.push(c)}n=a}for(;typeof n=="function";)n=n();if(t===n)return n;const i=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,i==="string"||i==="number"){if(Ot.context)return n;if(i==="number"&&(t=t.toString()),s){let a=n[0];a&&a.nodeType===3?a.data=t:a=document.createTextNode(t),n=eu(e,n,r,a)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||i==="boolean"){if(Ot.context)return n;n=eu(e,n,r)}else{if(i==="function")return at(()=>{let a=t();for(;typeof a=="function";)a=a();n=Jc(e,a,n,r)}),()=>n;if(Array.isArray(t)){const a=[],l=n&&Array.isArray(n);if(_y(a,t,n,o))return at(()=>n=Jc(e,a,n,r,!0)),()=>n;if(Ot.context){if(!a.length)return n;if(r===void 0)return[...e.childNodes];let c=a[0],u=[c];for(;(c=c.nextSibling)!==r;)u.push(c);return n=u}if(a.length===0){if(n=eu(e,n,r),s)return n}else l?n.length===0?l5(e,a,r):m6(e,n,a):(n&&eu(e),l5(e,a));n=a}else if(t.nodeType){if(Ot.context&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=eu(e,n,r,t);eu(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function _y(e,t,n,r){let o=!1;for(let i=0,s=t.length;i<s;i++){let a=t[i],l=n&&n[i],c;if(!(a==null||a===!0||a===!1))if((c=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=_y(e,a,l)||o;else if(c==="function")if(r){for(;typeof a=="function";)a=a();o=_y(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||o}else e.push(a),o=!0;else{const u=String(a);l&&l.nodeType===3&&l.data===u?e.push(l):e.push(document.createTextNode(u))}}return o}function l5(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function eu(e,t,n,r){if(n===void 0)return e.textContent="";const o=r||document.createTextNode("");if(t.length){let i=!1;for(let s=t.length-1;s>=0;s--){const a=t[s];if(o!==a){const l=a.parentNode===e;!i&&!s?l?e.replaceChild(o,a):e.insertBefore(o,n):l&&a.remove()}else i=!0}}else e.insertBefore(o,n);return[o]}function E6(){const e=Ot.context;return`${e.id}${e.count++}`}var k6="http://www.w3.org/2000/svg";function c5(e,t=!1){return t?document.createElementNS(k6,e):document.createElement(e)}function O6(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=XE();let i,s=!!Ot.context;return ht(()=>{s&&(XE().user=s=!1),i||(i=WR(o,()=>Me(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[l,c]=qe(!1),u=()=>c(!0);Ps(d=>ke(a,()=>l()?d():i(),null)),pt(u)}else{const l=c5(e.isSVG?"g":"div",e.isSVG),c=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return n.parentNode},configurable:!0}),ke(c,i),a.appendChild(l),e.ref&&e.ref(l),pt(()=>a.removeChild(l))}},void 0,{render:!s}),n}function Ey(e){const[t,n]=rn(e,["component"]),r=Me(()=>t.component);return Me(()=>{const o=r();switch(typeof o){case"function":return Fn(()=>o(n));case"string":const i=p6.has(o),s=Ot.context?S6():c5(o,i);return bg(s,n,i),s}})}var P6=function(){function e(){this.keyToValue=new Map,this.valueToKey=new Map}return e.prototype.set=function(t,n){this.keyToValue.set(t,n),this.valueToKey.set(n,t)},e.prototype.getByKey=function(t){return this.keyToValue.get(t)},e.prototype.getByValue=function(t){return this.valueToKey.get(t)},e.prototype.clear=function(){this.keyToValue.clear(),this.valueToKey.clear()},e}(),u5=function(){function e(t){this.generateIdentifier=t,this.kv=new P6}return e.prototype.register=function(t,n){this.kv.getByValue(t)||(n||(n=this.generateIdentifier(t)),this.kv.set(n,t))},e.prototype.clear=function(){this.kv.clear()},e.prototype.getIdentifier=function(t){return this.kv.getByValue(t)},e.prototype.getValue=function(t){return this.kv.getByKey(t)},e}(),D6=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),M6=function(e){D6(t,e);function t(){var n=e.call(this,function(r){return r.name})||this;return n.classToAllowedProps=new Map,n}return t.prototype.register=function(n,r){typeof r=="object"?(r.allowProps&&this.classToAllowedProps.set(n,r.allowProps),e.prototype.register.call(this,n,r.identifier)):e.prototype.register.call(this,n,r)},t.prototype.getAllowedProps=function(n){return this.classToAllowedProps.get(n)},t}(u5),$6=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,i=[],s;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return i};function T6(e){if("values"in Object)return Object.values(e);var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t}function A6(e,t){var n=T6(e);if("find"in n)return n.find(t);for(var r=n,o=0;o<r.length;o++){var i=r[o];if(t(i))return i}}function tu(e,t){Object.entries(e).forEach(function(n){var r=$6(n,2),o=r[0],i=r[1];return t(i,o)})}function yg(e,t){return e.indexOf(t)!==-1}function d5(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(t(r))return r}}var I6=function(){function e(){this.transfomers={}}return e.prototype.register=function(t){this.transfomers[t.name]=t},e.prototype.findApplicable=function(t){return A6(this.transfomers,function(n){return n.isApplicable(t)})},e.prototype.findByName=function(t){return this.transfomers[t]},e}(),N6=function(e){return Object.prototype.toString.call(e).slice(8,-1)},f5=function(e){return typeof e>"u"},L6=function(e){return e===null},uf=function(e){return typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype},ky=function(e){return uf(e)&&Object.keys(e).length===0},xa=function(e){return Array.isArray(e)},F6=function(e){return typeof e=="string"},R6=function(e){return typeof e=="number"&&!isNaN(e)},j6=function(e){return typeof e=="boolean"},z6=function(e){return e instanceof RegExp},df=function(e){return e instanceof Map},ff=function(e){return e instanceof Set},h5=function(e){return N6(e)==="Symbol"},B6=function(e){return e instanceof Date&&!isNaN(e.valueOf())},V6=function(e){return e instanceof Error},p5=function(e){return typeof e=="number"&&isNaN(e)},H6=function(e){return j6(e)||L6(e)||f5(e)||R6(e)||F6(e)||h5(e)},q6=function(e){return typeof e=="bigint"},W6=function(e){return e===1/0||e===-1/0},U6=function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},G6=function(e){return e instanceof URL},g5=function(e){return e.replace(/\./g,"\\.")},Oy=function(e){return e.map(String).map(g5).join(".")},hf=function(e){for(var t=[],n="",r=0;r<e.length;r++){var o=e.charAt(r),i=o==="\\"&&e.charAt(r+1)===".";if(i){n+=".",r++;continue}var s=o===".";if(s){t.push(n),n="";continue}n+=o}var a=n;return t.push(a),t},Py=function(){return Py=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},Py.apply(this,arguments)},Dy=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,i=[],s;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return i},My=function(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e};function Bi(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var m5=[Bi(f5,"undefined",function(){return null},function(){}),Bi(q6,"bigint",function(e){return e.toString()},function(e){return typeof BigInt<"u"?BigInt(e):e}),Bi(B6,"Date",function(e){return e.toISOString()},function(e){return new Date(e)}),Bi(V6,"Error",function(e,t){var n={name:e.name,message:e.message};return t.allowedErrorProps.forEach(function(r){n[r]=e[r]}),n},function(e,t){var n=new Error(e.message);return n.name=e.name,n.stack=e.stack,t.allowedErrorProps.forEach(function(r){n[r]=e[r]}),n}),Bi(z6,"regexp",function(e){return""+e},function(e){var t=e.slice(1,e.lastIndexOf("/")),n=e.slice(e.lastIndexOf("/")+1);return new RegExp(t,n)}),Bi(ff,"set",function(e){return My([],Dy(e.values()))},function(e){return new Set(e)}),Bi(df,"map",function(e){return My([],Dy(e.entries()))},function(e){return new Map(e)}),Bi(function(e){return p5(e)||W6(e)},"number",function(e){return p5(e)?"NaN":e>0?"Infinity":"-Infinity"},Number),Bi(function(e){return e===0&&1/e===-1/0},"number",function(){return"-0"},Number),Bi(G6,"URL",function(e){return e.toString()},function(e){return new URL(e)})];function xg(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var v5=xg(function(e,t){if(h5(e)){var n=!!t.symbolRegistry.getIdentifier(e);return n}return!1},function(e,t){var n=t.symbolRegistry.getIdentifier(e);return["symbol",n]},function(e){return e.description},function(e,t,n){var r=n.symbolRegistry.getValue(t[1]);if(!r)throw new Error("Trying to deserialize unknown symbol");return r}),K6=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce(function(e,t){return e[t.name]=t,e},{}),b5=xg(U6,function(e){return["typed-array",e.constructor.name]},function(e){return My([],Dy(e))},function(e,t){var n=K6[t[1]];if(!n)throw new Error("Trying to deserialize unknown typed array");return new n(e)});function y5(e,t){if(e!=null&&e.constructor){var n=!!t.classRegistry.getIdentifier(e.constructor);return n}return!1}var x5=xg(y5,function(e,t){var n=t.classRegistry.getIdentifier(e.constructor);return["class",n]},function(e,t){var n=t.classRegistry.getAllowedProps(e.constructor);if(!n)return Py({},e);var r={};return n.forEach(function(o){r[o]=e[o]}),r},function(e,t,n){var r=n.classRegistry.getValue(t[1]);if(!r)throw new Error("Trying to deserialize unknown class - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564");return Object.assign(Object.create(r.prototype),e)}),w5=xg(function(e,t){return!!t.customTransformerRegistry.findApplicable(e)},function(e,t){var n=t.customTransformerRegistry.findApplicable(e);return["custom",n.name]},function(e,t){var n=t.customTransformerRegistry.findApplicable(e);return n.serialize(e)},function(e,t,n){var r=n.customTransformerRegistry.findByName(t[1]);if(!r)throw new Error("Trying to deserialize unknown custom value");return r.deserialize(e)}),Y6=[x5,v5,w5,b5],S5=function(e,t){var n=d5(Y6,function(o){return o.isApplicable(e,t)});if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};var r=d5(m5,function(o){return o.isApplicable(e,t)});if(r)return{value:r.transform(e,t),type:r.annotation}},C5={};m5.forEach(function(e){C5[e.annotation]=e});var X6=function(e,t,n){if(xa(t))switch(t[0]){case"symbol":return v5.untransform(e,t,n);case"class":return x5.untransform(e,t,n);case"custom":return w5.untransform(e,t,n);case"typed-array":return b5.untransform(e,t,n);default:throw new Error("Unknown transformation: "+t)}else{var r=C5[t];if(!r)throw new Error("Unknown transformation: "+t);return r.untransform(e,n)}},nu=function(e,t){for(var n=e.keys();t>0;)n.next(),t--;return n.next().value};function _5(e){if(yg(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(yg(e,"prototype"))throw new Error("prototype is not allowed as a property");if(yg(e,"constructor"))throw new Error("constructor is not allowed as a property")}var Q6=function(e,t){_5(t);for(var n=0;n<t.length;n++){var r=t[n];if(ff(e))e=nu(e,+r);else if(df(e)){var o=+r,i=+t[++n]==0?"key":"value",s=nu(e,o);switch(i){case"key":e=s;break;case"value":e=e.get(s);break}}else e=e[r]}return e},$y=function(e,t,n){if(_5(t),t.length===0)return n(e);for(var r=e,o=0;o<t.length-1;o++){var i=t[o];if(xa(r)){var s=+i;r=r[s]}else if(uf(r))r=r[i];else if(ff(r)){var a=+i;r=nu(r,a)}else if(df(r)){var l=o===t.length-2;if(l)break;var a=+i,c=+t[++o]==0?"key":"value",u=nu(r,a);switch(c){case"key":r=u;break;case"value":r=r.get(u);break}}}var d=t[t.length-1];if(xa(r)?r[+d]=n(r[+d]):uf(r)&&(r[d]=n(r[d])),ff(r)){var h=nu(r,+d),p=n(h);h!==p&&(r.delete(h),r.add(p))}if(df(r)){var a=+t[t.length-2],m=nu(r,a),c=+d==0?"key":"value";switch(c){case"key":{var v=n(m);r.set(v,r.get(m)),v!==m&&r.delete(m);break}case"value":{r.set(m,n(r.get(m)));break}}}return e},Ds=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,i=[],s;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return i},wa=function(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e};function Ty(e,t,n){if(n===void 0&&(n=[]),!!e){if(!xa(e)){tu(e,function(s,a){return Ty(s,t,wa(wa([],Ds(n)),Ds(hf(a))))});return}var r=Ds(e,2),o=r[0],i=r[1];i&&tu(i,function(s,a){Ty(s,t,wa(wa([],Ds(n)),Ds(hf(a))))}),t(o,n)}}function Z6(e,t,n){return Ty(t,function(r,o){e=$y(e,o,function(i){return X6(i,r,n)})}),e}function J6(e,t){function n(s,a){var l=Q6(e,hf(a));s.map(hf).forEach(function(c){e=$y(e,c,function(){return l})})}if(xa(t)){var r=Ds(t,2),o=r[0],i=r[1];o.forEach(function(s){e=$y(e,hf(s),function(){return e})}),i&&tu(i,n)}else tu(t,n);return e}var ej=function(e,t){return uf(e)||xa(e)||df(e)||ff(e)||y5(e,t)};function tj(e,t,n){var r=n.get(e);r?r.push(t):n.set(e,[t])}function nj(e,t){var n={},r=void 0;return e.forEach(function(o){if(!(o.length<=1)){t||(o=o.map(function(l){return l.map(String)}).sort(function(l,c){return l.length-c.length}));var i=Ds(o),s=i[0],a=i.slice(1);s.length===0?r=a.map(Oy):n[Oy(s)]=a.map(Oy)}}),r?ky(n)?[r]:[r,n]:ky(n)?void 0:n}var E5=function(e,t,n,r,o,i,s){var a;o===void 0&&(o=[]),i===void 0&&(i=[]),s===void 0&&(s=new Map);var l=H6(e);if(!l){tj(e,o,t);var c=s.get(e);if(c)return r?{transformedValue:null}:c}if(!ej(e,n)){var u=S5(e,n),d=u?{transformedValue:u.value,annotations:[u.type]}:{transformedValue:e};return l||s.set(e,d),d}if(yg(i,e))return{transformedValue:null};var h=S5(e,n),p=(a=h==null?void 0:h.value)!==null&&a!==void 0?a:e,m=xa(p)?[]:{},v={};tu(p,function(w,C){var _=E5(w,t,n,r,wa(wa([],Ds(o)),[C]),wa(wa([],Ds(i)),[e]),s);m[C]=_.transformedValue,xa(_.annotations)?v[C]=_.annotations:uf(_.annotations)&&tu(_.annotations,function(k,E){v[g5(C)+"."+E]=k})});var y=ky(v)?{transformedValue:m,annotations:h?[h.type]:void 0}:{transformedValue:m,annotations:h?[h.type,v]:v};return l||s.set(e,y),y};function k5(e){return Object.prototype.toString.call(e).slice(8,-1)}function rj(e){if(k5(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function O5(e){return k5(e)==="Array"}function oj(e,t,n,r,o){const i={}.propertyIsEnumerable.call(r,t)?"enumerable":"nonenumerable";i==="enumerable"&&(e[t]=n),o&&i==="nonenumerable"&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}function Ay(e,t={}){if(O5(e))return e.map(o=>Ay(o,t));if(!rj(e))return e;const n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertySymbols(e);return[...n,...r].reduce((o,i)=>{if(O5(t.props)&&!t.props.includes(i))return o;const s=e[i],a=Ay(s,t);return oj(o,i,a,e,t.nonenumerable),o},{})}var $l=function(){return $l=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},$l.apply(this,arguments)},ij=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,i=[],s;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return i},sj=function(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e},P5=function(){function e(t){var n=t===void 0?{}:t,r=n.dedupe,o=r===void 0?!1:r;this.classRegistry=new M6,this.symbolRegistry=new u5(function(i){var s;return(s=i.description)!==null&&s!==void 0?s:""}),this.customTransformerRegistry=new I6,this.allowedErrorProps=[],this.dedupe=o}return e.prototype.serialize=function(t){var n=new Map,r=E5(t,n,this,this.dedupe),o={json:r.transformedValue};r.annotations&&(o.meta=$l($l({},o.meta),{values:r.annotations}));var i=nj(n,this.dedupe);return i&&(o.meta=$l($l({},o.meta),{referentialEqualities:i})),o},e.prototype.deserialize=function(t){var n=t.json,r=t.meta,o=Ay(n);return r!=null&&r.values&&(o=Z6(o,r.values,this)),r!=null&&r.referentialEqualities&&(o=J6(o,r.referentialEqualities)),o},e.prototype.stringify=function(t){return JSON.stringify(this.serialize(t))},e.prototype.parse=function(t){return this.deserialize(JSON.parse(t))},e.prototype.registerClass=function(t,n){this.classRegistry.register(t,n)},e.prototype.registerSymbol=function(t,n){this.symbolRegistry.register(t,n)},e.prototype.registerCustom=function(t,n){this.customTransformerRegistry.register($l({name:n},t))},e.prototype.allowErrorProps=function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];(t=this.allowedErrorProps).push.apply(t,sj([],ij(n)))},e.defaultInstance=new e,e.serialize=e.defaultInstance.serialize.bind(e.defaultInstance),e.deserialize=e.defaultInstance.deserialize.bind(e.defaultInstance),e.stringify=e.defaultInstance.stringify.bind(e.defaultInstance),e.parse=e.defaultInstance.parse.bind(e.defaultInstance),e.registerClass=e.defaultInstance.registerClass.bind(e.defaultInstance),e.registerSymbol=e.defaultInstance.registerSymbol.bind(e.defaultInstance),e.registerCustom=e.defaultInstance.registerCustom.bind(e.defaultInstance),e.allowErrorProps=e.defaultInstance.allowErrorProps.bind(e.defaultInstance),e}(),aj=P5.serialize,lj=P5.stringify;function ru(e){return e.state.fetchStatus==="fetching"?"fetching":e.getObserversCount()?e.state.fetchStatus==="paused"?"paused":e.isStale()?"stale":"fresh":"inactive"}function cj(e,t){return`${e}${t.charAt(0).toUpperCase()+t.slice(1)}`}function uj({queryState:e,observerCount:t,isStale:n}){return e.fetchStatus==="fetching"?"blue":t?e.fetchStatus==="paused"?"purple":n?"yellow":"green":"gray"}function ou({status:e,isPaused:t}){return t?"purple":e==="error"?"red":e==="pending"?"yellow":e==="success"?"green":"gray"}function dj(e){return e==="fresh"?"green":e==="stale"?"yellow":e==="paused"?"purple":e==="inactive"?"gray":"blue"}var wg=(e,t=!1)=>{const{json:n}=aj(e);return JSON.stringify(n,null,t?2:void 0)},Sg=e=>e.state.fetchStatus!=="idle"?0:e.getObserversCount()?e.isStale()?2:1:3,fj=(e,t)=>e.queryHash.localeCompare(t.queryHash),D5=(e,t)=>e.state.dataUpdatedAt<t.state.dataUpdatedAt?1:-1,hj=(e,t)=>Sg(e)===Sg(t)?D5(e,t):Sg(e)>Sg(t)?1:-1,Iy={status:hj,"query hash":fj,"last updated":D5},Cg=e=>e.state.isPaused?0:e.state.status==="error"?2:e.state.status==="pending"?1:3,M5=(e,t)=>e.state.submittedAt<t.state.submittedAt?1:-1,pj=(e,t)=>Cg(e)===Cg(t)?M5(e,t):Cg(e)>Cg(t)?1:-1,Ny={status:pj,"last updated":M5},$5=e=>e*parseFloat(getComputedStyle(document.documentElement).fontSize),gj=()=>{const[e,t]=qe("dark");return Ml(()=>{const n=window.matchMedia("(prefers-color-scheme: dark)");t(n.matches?"dark":"light");const r=o=>{t(o.matches?"dark":"light")};n.addEventListener("change",r),pt(()=>n.removeEventListener("change",r))}),e},Tl=(e,t,n)=>{if(t.length===0)return n;if(e instanceof Map){const r=new Map(e);if(t.length===1)return r.set(t[0],n),r;const[o,...i]=t;return r.set(o,Tl(r.get(o),i,n)),r}if(e instanceof Set){const r=Tl(Array.from(e),t,n);return new Set(r)}if(Array.isArray(e)){const r=[...e];if(t.length===1)return r[t[0]]=n,r;const[o,...i]=t;return r[o]=Tl(r[o],i,n),r}if(e instanceof Object){const r={...e};if(t.length===1)return r[t[0]]=n,r;const[o,...i]=t;return r[o]=Tl(r[o],i,n),r}return e},pf=(e,t)=>{if(e instanceof Map){const n=new Map(e);if(t.length===1)return n.delete(t[0]),n;const[r,...o]=t;return n.set(r,pf(n.get(r),o)),n}if(e instanceof Set){const n=pf(Array.from(e),t);return new Set(n)}if(Array.isArray(e)){const n=[...e];if(t.length===1)return n.filter((i,s)=>s.toString()!==t[0]);const[r,...o]=t;return n[r]=pf(n[r],o),n}if(e instanceof Object){const n={...e};if(t.length===1)return delete n[t[0]],n;const[r,...o]=t;return n[r]=pf(n[r],o),n}return e},mj=e=>{if(!e||document.querySelector("#_goober"))return;const n=document.createElement("style"),r=document.createTextNode("");n.appendChild(r),n.id="_goober",n.setAttribute("nonce",e),document.head.appendChild(n)},vj=(w8=class{constructor(e){Ge(this,Od,void 0);Ge(this,kp,void 0);Ge(this,Op,void 0);Ge(this,Pp,void 0);Ge(this,Nc,!1);Ge(this,Dp,void 0);Ge(this,Pd,void 0);Ge(this,Dd,void 0);Ge(this,Md,void 0);Ge(this,$d,void 0);Ge(this,Td,void 0);Ge(this,Mp,void 0);const{client:t,queryFlavor:n,version:r,onlineManager:o,buttonPosition:i,position:s,initialIsOpen:a,errorTypes:l,styleNonce:c}=e;je(this,Od,qe(t)),je(this,Op,n),je(this,Pp,r),je(this,kp,o),je(this,Dp,c),je(this,Pd,qe(i)),je(this,Dd,qe(s)),je(this,Md,qe(a)),je(this,$d,qe(l))}setButtonPosition(e){ee(this,Pd)[1](e)}setPosition(e){ee(this,Dd)[1](e)}setInitialIsOpen(e){ee(this,Md)[1](e)}setErrorTypes(e){ee(this,$d)[1](e)}setClient(e){ee(this,Od)[1](e)}mount(e){if(ee(this,Nc))throw new Error("Devtools is already mounted");const t=v6(()=>{const[n]=ee(this,Pd),[r]=ee(this,Dd),[o]=ee(this,Md),[i]=ee(this,$d),[s]=ee(this,Od);let a;ee(this,Td)?a=ee(this,Td):(a=r6(()=>Promise.resolve().then(()=>Zbe)),je(this,Td,a)),mj(ee(this,Dp));const l=this;return Q(a,Pt({get queryFlavor(){return ee(l,Op)},get version(){return ee(l,Pp)},get onlineManager(){return ee(l,kp)}},{get client(){return s()},get buttonPosition(){return n()},get position(){return r()},get initialIsOpen(){return o()},get errorTypes(){return i()}}))},e);je(this,Nc,!0),je(this,Mp,t)}unmount(){var e;if(!ee(this,Nc))throw new Error("Devtools is not mounted");(e=ee(this,Mp))==null||e.call(this),je(this,Nc,!1)}},Od=new WeakMap,kp=new WeakMap,Op=new WeakMap,Pp=new WeakMap,Nc=new WeakMap,Dp=new WeakMap,Pd=new WeakMap,Dd=new WeakMap,Md=new WeakMap,$d=new WeakMap,Td=new WeakMap,Mp=new WeakMap,w8);function bj(e){const t=HE(),n=e.client||t,r=he.useRef(null),{buttonPosition:o,position:i,initialIsOpen:s,errorTypes:a,styleNonce:l}=e,[c]=he.useState(new vj({client:n,queryFlavor:"React Query",version:"5",onlineManager:sf,buttonPosition:o,position:i,initialIsOpen:s,errorTypes:a,styleNonce:l}));return he.useEffect(()=>{c.setClient(n)},[n,c]),he.useEffect(()=>{o&&c.setButtonPosition(o)},[o,c]),he.useEffect(()=>{i&&c.setPosition(i)},[i,c]),he.useEffect(()=>{c.setInitialIsOpen(s||!1)},[s,c]),he.useEffect(()=>{c.setErrorTypes(a||[])},[a,c]),he.useEffect(()=>(r.current&&c.mount(r.current),()=>{c.unmount()}),[c]),he.createElement("div",{className:"tsqd-parent-container",ref:r})}var yj=process.env.NODE_ENV!=="development"?function(){return null}:bj;const xj={id:"",authToken:void 0},T5=b.createContext(xj),A5=({children:e,dashboardProps:t})=>x.jsxs(UE,{children:[x.jsx(T5.Provider,{value:t,children:e}),x.jsx(yj,{initialIsOpen:!1})]});function Vi(){const e=b.useContext(T5);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}function I5(e,t){var xe;let n=b.useMemo(()=>[],[]);const r=Vi().authToken||e,o=be(K=>K.selectedConnectionId),i=be(K=>K.selectedDatabaseName),s=be(K=>K.selectedSchemaName),a=be(K=>K.selectedTableName),l=be(K=>K.actions.setCurrentColumns),c=be(K=>K.actions.setSelectedConnectionId),u=be(K=>K.actions.setSelectedDatabaseName),d=be(K=>K.actions.setSelectedSchemaName),h=be(K=>K.actions.setSelectedTableName),p=be(K=>K.actions.setCardSql),{data:m,isLoading:v,isError:y}=yi({queryKey:["connections"],queryFn:()=>Gc("https://semaphor.cloud/api/v1/connections",(r==null?void 0:r.accessToken)||""),enabled:!!(r!=null&&r.accessToken)});console.log("connectionsData",m,"selectedConnectionId",o);const w=m==null?void 0:m.connections.find(K=>K.id===o),C=(w==null?void 0:w.type)==="API"||(w==null?void 0:w.type)==="S3",{data:_,isLoading:k,isFetching:E,isError:P,refetch:D}=yi({queryKey:[o],queryFn:()=>Gc("https://semaphor.cloud/api/v1/databases",(r==null?void 0:r.accessToken)||"",{connection_id:o}),enabled:!!o&&!C}),{data:M,isLoading:I,isFetching:F,isError:R,refetch:B}=yi({queryKey:[o,i],queryFn:()=>Gc("https://semaphor.cloud/api/v1/schemas",(r==null?void 0:r.accessToken)||"",{connection_id:o,database_name:i}),enabled:!!o&&!!i&&!C}),{data:ie,isLoading:q,isFetching:z,isError:X,refetch:U}=yi({queryKey:[o,i,s],queryFn:()=>Gc("https://semaphor.cloud/api/v1/tables",(r==null?void 0:r.accessToken)||"",{connection_id:o,database_name:i,schema_name:s}),enabled:!!o&&!!i&&!!s&&!C}),{data:Z,isLoading:G,isFetching:$,isError:H}=yi({queryKey:[o,i,s,a],queryFn:()=>Gc("https://semaphor.cloud/api/v1/columns",(r==null?void 0:r.accessToken)||"",{connection_id:o,database_name:i,schema_name:s,table_name:a}),enabled:!!o&&!!i&&!!s&&!!a||C});b.useEffect(()=>{l(n)},[Z,l,n]),b.useEffect(()=>{var K;C&&(u("NA"),d("NA"),h((K=w==null?void 0:w.type)==null?void 0:K.toLowerCase()))},[C,p,h,d,u,w]);const re=C?(xe=w==null?void 0:w.type)==null?void 0:xe.toLowerCase():a||"",N=C?"":s||"";function V(K){d(K),h("")}function ue(K){u(K),d(""),h("")}function ce(K){c(K)}_&&_.databases.length>0,M&&M.schemas.length>0,Z&&Z.columns.length>0&&(n=Z.columns.map(K=>({...K,data_type:K.data_type.toLowerCase()}))),P&&(n=[]),(H||y)&&(n=[]);const pe=m==null?void 0:m.connections.map(K=>({id:K.id,name:K.name,type:K.type})),se=_==null?void 0:_.databases.map(K=>({id:K.database_name,name:K.database_name})),ne=M==null?void 0:M.schemas.map(K=>({id:K.schema_name,name:K.schema_name})),le=ie==null?void 0:ie.tables.map(K=>({id:K.table_name,name:K.table_name}));return{connectionItems:pe,isConnectionsLoading:v,isConnectionsError:y,databaseItems:se,isDatabasesLoadingOrFetching:k||E,isDatabaseError:P,schemaItems:ne,isSchemaLoadingOrFetching:I||F,isSchemaError:R,tableItems:le,isTableLoadingOrFetching:q||z,isTableError:X,columns:n,isColumnsLoadingOrFetching:G||$,isColumnsError:H,isAPIConnection:C,tableName:re,schemaName:N,handleConnectionChange:ce,handleDatabaseChange:ue,handleSchemaChange:V}}const wj=e=>{const t=new Date(e);return!isNaN(t.getTime())},Sj=e=>!isNaN(Number(e))&&!isNaN(parseFloat(e)),_g=e=>{let t;return typeof e=="number"?t="number":typeof e=="string"?wj(e)?t="date":Sj(e)?t="number":t="string":typeof e=="boolean"?t="boolean":e instanceof Date?t="date":t="unknown",t};function Cj({get:e,dataPoint:t,card:n}){var h;const{addOrUpdateFilterValue:r,addFilteringCard:o,removeFilterValue: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:_g(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)}var Eg={exports:{}};/**
59
+ */var aE;function jF(){if(aE)return Wb;aE=1;var e=b,t=iE();function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return Wb.useSyncExternalStoreWithSelector=function(c,u,d,h,p){var m=i(null);if(m.current===null){var v={hasValue:!1,value:null};m.current=v}else v=m.current;m=a(function(){function w(P){if(!C){if(C=!0,_=P,P=h(P),p!==void 0&&v.hasValue){var D=v.value;if(p(D,P))return k=D}return k=P}if(D=k,r(_,P))return D;var M=h(P);return p!==void 0&&p(D,M)?D:(_=P,k=M)}var C=!1,_,k,E=d===void 0?null:d;return[function(){return w(u())},E===null?void 0:function(){return w(E())}]},[u,d,h,p]);var y=o(c,m[0],m[1]);return s(function(){v.hasValue=!0,v.value=y},[y]),l(y),y},Wb}process.env.NODE_ENV==="production"?Bb.exports=jF():Bb.exports=RF();var zF=Bb.exports;const BF=Gd(zF);var lE={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:VF}=b,{useSyncExternalStoreWithSelector:HF}=BF;let cE=!1;function qF(e,t=e.getState,n){(lE?"production":void 0)!=="production"&&n&&!cE&&(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"),cE=!0);const r=HF(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return VF(r),r}const uE=e=>{(lE?"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"?NF(e):e,n=(r,o)=>qF(t,r,o);return Object.assign(n,t),n},dE=e=>e?uE(e):uE;var fE=Symbol.for("immer-nothing"),hE=Symbol.for("immer-draftable"),po=Symbol.for("immer-state"),WF=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 Gr(e,...t){if(process.env.NODE_ENV!=="production"){const n=WF[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 Kc=Object.getPrototypeOf;function Yc(e){return!!e&&!!e[po]}function Ol(e){var t;return e?pE(e)||Array.isArray(e)||!!e[hE]||!!((t=e.constructor)!=null&&t[hE])||Qp(e)||Zp(e):!1}var UF=Object.prototype.constructor.toString();function pE(e){if(!e||typeof e!="object")return!1;const t=Kc(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)===UF}function Jd(e,t){Xp(e)===0?Object.entries(e).forEach(([n,r])=>{t(n,r,e)}):e.forEach((n,r)=>t(r,n,e))}function Xp(e){const t=e[po];return t?t.type_:Array.isArray(e)?1:Qp(e)?2:Zp(e)?3:0}function Ub(e,t){return Xp(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function gE(e,t,n){const r=Xp(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function GF(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Qp(e){return e instanceof Map}function Zp(e){return e instanceof Set}function Pl(e){return e.copy_||e.base_}function Gb(e,t){if(Qp(e))return new Map(e);if(Zp(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&pE(e))return Kc(e)?{...e}:Object.assign(Object.create(null),e);const n=Object.getOwnPropertyDescriptors(e);delete n[po];let r=Reflect.ownKeys(n);for(let o=0;o<r.length;o++){const i=r[o],s=n[i];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(n[i]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[i]})}return Object.create(Kc(e),n)}function Kb(e,t=!1){return Jp(e)||Yc(e)||!Ol(e)||(Xp(e)>1&&(e.set=e.add=e.clear=e.delete=KF),Object.freeze(e),t&&Jd(e,(n,r)=>Kb(r,!0))),e}function KF(){Gr(2)}function Jp(e){return Object.isFrozen(e)}var YF={};function Dl(e){const t=YF[e];return t||Gr(0,e),t}var ef;function mE(){return ef}function XF(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function vE(e,t){t&&(Dl("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Yb(e){Xb(e),e.drafts_.forEach(QF),e.drafts_=null}function Xb(e){e===ef&&(ef=e.parent_)}function bE(e){return ef=XF(ef,e)}function QF(e){const t=e[po];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function yE(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[po].modified_&&(Yb(t),Gr(4)),Ol(e)&&(e=eg(t,e),t.parent_||tg(t,e)),t.patches_&&Dl("Patches").generateReplacementPatches_(n[po].base_,e,t.patches_,t.inversePatches_)):e=eg(t,n,[]),Yb(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==fE?e:void 0}function eg(e,t,n){if(Jp(t))return t;const r=t[po];if(!r)return Jd(t,(o,i)=>xE(e,r,t,o,i,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return tg(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),Jd(i,(a,l)=>xE(e,r,o,a,l,n,s)),tg(e,o,!1),n&&e.patches_&&Dl("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function xE(e,t,n,r,o,i,s){if(process.env.NODE_ENV!=="production"&&o===n&&Gr(5),Yc(o)){const a=i&&t&&t.type_!==3&&!Ub(t.assigned_,r)?i.concat(r):void 0,l=eg(e,o,a);if(gE(n,r,l),Yc(l))e.canAutoFreeze_=!1;else return}else s&&n.add(o);if(Ol(o)&&!Jp(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;eg(e,o),(!t||!t.scope_.parent_)&&tg(e,o)}}function tg(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Kb(t,n)}function ZF(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:mE(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=Qb;n&&(o=[r],i=tf);const{revoke:s,proxy:a}=Proxy.revocable(o,i);return r.draft_=a,r.revoke_=s,a}var Qb={get(e,t){if(t===po)return e;const n=Pl(e);if(!Ub(n,t))return JF(e,n,t);const r=n[t];return e.finalized_||!Ol(r)?r:r===Zb(e.base_,t)?(ey(e),e.copy_[t]=ty(r,e)):r},has(e,t){return t in Pl(e)},ownKeys(e){return Reflect.ownKeys(Pl(e))},set(e,t,n){const r=wE(Pl(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const o=Zb(Pl(e),t),i=o==null?void 0:o[po];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(GF(n,o)&&(n!==void 0||Ub(e.base_,t)))return!0;ey(e),Jb(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 Zb(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,ey(e),Jb(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Pl(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Gr(11)},getPrototypeOf(e){return Kc(e.base_)},setPrototypeOf(){Gr(12)}},tf={};Jd(Qb,(e,t)=>{tf[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),tf.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&Gr(13),tf.set.call(this,e,t,void 0)},tf.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&Gr(14),Qb.set.call(this,e[0],t,n,e[0])};function Zb(e,t){const n=e[po];return(n?Pl(n):e)[t]}function JF(e,t,n){var o;const r=wE(t,n);return r?"value"in r?r.value:(o=r.get)==null?void 0:o.call(e.draft_):void 0}function wE(e,t){if(!(t in e))return;let n=Kc(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Kc(n)}}function Jb(e){e.modified_||(e.modified_=!0,e.parent_&&Jb(e.parent_))}function ey(e){e.copy_||(e.copy_=Gb(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var eR=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"&&Gr(6),r!==void 0&&typeof r!="function"&&Gr(7);let o;if(Ol(t)){const i=bE(this),s=ty(t,void 0);let a=!0;try{o=n(s),a=!1}finally{a?Yb(i):Xb(i)}return vE(i,r),yE(o,i)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===fE&&(o=void 0),this.autoFreeze_&&Kb(o,!0),r){const i=[],s=[];Dl("Patches").generateReplacementPatches_(t,o,i,s),r(i,s)}return o}else Gr(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){Ol(e)||Gr(8),Yc(e)&&(e=tR(e));const t=bE(this),n=ty(e,void 0);return n[po].isManual_=!0,Xb(t),n}finishDraft(e,t){const n=e&&e[po];(!n||!n.isManual_)&&Gr(9);const{scope_:r}=n;return vE(r,t),yE(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=Dl("Patches").applyPatches_;return Yc(e)?r(e,t):this.produce(e,o=>r(o,t))}};function ty(e,t){const n=Qp(e)?Dl("MapSet").proxyMap_(e,t):Zp(e)?Dl("MapSet").proxySet_(e,t):ZF(e,t);return(t?t.scope_:mE()).drafts_.push(n),n}function tR(e){return Yc(e)||Gr(10,e),SE(e)}function SE(e){if(!Ol(e)||Jp(e))return e;const t=e[po];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Gb(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Gb(e,!0);return Jd(n,(r,o)=>{gE(n,r,SE(o))}),t&&(t.finalized_=!1),n}var go=new eR,nR=go.produce;go.produceWithPatches.bind(go),go.setAutoFreeze.bind(go),go.setUseStrictShallowCopy.bind(go),go.applyPatches.bind(go),go.createDraft.bind(go),go.finishDraft.bind(go);const CE=e=>(t,n,r)=>(r.setState=(o,i,...s)=>{const a=typeof o=="function"?nR(o):o;return t(a,i,...s)},e(r.setState,n,r));var ng,rg=Jt;if(process.env.NODE_ENV==="production")ng=rg.createRoot,rg.hydrateRoot;else{var _E=rg.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;ng=function(e,t){_E.usingClientEntryPoint=!0;try{return rg.createRoot(e,t)}finally{_E.usingClientEntryPoint=!1}}}function EE(e,t,n){const r={count:0},o=a=>{const l=b.useRef(r.count);return b.useEffect(()=>{l.current+=1,l.current===r.count+1&&(l.current-=1,t.setState(a))}),null};if(o.displayName=`((${e})) devtool`,typeof document>"u")return;if(!n){let a=document.getElementById(`simple-zustand-devtools-${e}`);a||(a=document.createElement("div"),a.id=`simple-zustand-devtools-${e}`),document.body.appendChild(a),n=a}const i=ng(n),s=a=>{a&&(i.render(b.createElement(o,Object.assign({},a))),r.count+=1)};s(t.getState()),t.subscribe(s)}var kE={},OE={},ny={exports:{}},On=String,PE=function(){return{isColorSupported:!1,reset:On,bold:On,dim:On,italic:On,underline:On,inverse:On,hidden:On,strikethrough:On,black:On,red:On,green:On,yellow:On,blue:On,magenta:On,cyan:On,white:On,gray:On,bgBlack:On,bgRed:On,bgGreen:On,bgYellow:On,bgBlue:On,bgMagenta:On,bgCyan:On,bgWhite:On}};ny.exports=PE(),ny.exports.createColors=PE;var rR=ny.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(rR);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])}}})(OE),function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});const t=n(OE);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}}}(kE);let ry=kE;var oR=(ry.__esModule?ry:{default:ry}).default;const bn=Gd(oR),oy={default:{dashboardPanel:"",dashboardTabsContainer:"",gridLayout:{className:""},chart:{font:{family:"Open Sans, Arial, sans-serif"},dataset:{backgroundColor:[bn.blue[500],bn.teal[500],bn.amber[500],bn.red[500],bn.indigo[500],bn.green[500]],borderColor:[bn.blue[500],bn.teal[500],bn.amber[500],bn.red[500],bn.indigo[500],bn.green[500]]},options:{interaction:{mode:"index"},plugins:{datalabels:{display:!1,color:DE},title:{display:!0},tooltip:{backgroundColor:"#fff",bodyColor:"#000",borderWidth:.25,titleColor:"#000",borderColor:"rgb(128,131,139)",cornerRadius:2,boxPadding:4},legend:{position:"top",align:"center",maxHeight:0}},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:1,responsive:!0,maintainAspectRatio:!1}}},dark:{chart:{dataset:{backgroundColor:[bn.blue[500],bn.teal[500],bn.amber[500],bn.red[500],bn.indigo[500],bn.green[500]],borderColor:[bn.blue[500],bn.teal[500],bn.amber[500],bn.red[500],bn.indigo[500],bn.green[500]],datalables:{color:DE}},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:bn.slate[800]}},y:{grid:{display:!0,color:bn.slate[800]}}}}}}};function DE(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=og()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=og()),ig(n)}function og(){return me.getState().theme==="dark"?"#000000":"#FFFFFF"}function ig(e){let t=0,n=0,r=0,o=0;const i=u=>{const d=u.replace("#",""),h=parseInt(d.substring(0,2),16),p=parseInt(d.substring(2,4),16),m=parseInt(d.substring(4,6),16);t+=h,n+=p,r+=m,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"}var nf=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(){}},Xc=typeof window>"u"||"Deno"in window;function Ho(){}function iR(e,t){return typeof e=="function"?e(t):e}function iy(e){return typeof e=="number"&&e>=0&&e!==1/0}function ME(e,t){return Math.max(e+(t||0)-Date.now(),0)}function $E(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==sy(s,t.options))return!1}else if(!of(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||typeof o<"u"&&o!==t.state.fetchStatus||i&&!i(t))}function TE(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(rf(t.options.mutationKey)!==rf(i))return!1}else if(!of(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function sy(e,t){return((t==null?void 0:t.queryKeyHashFn)||rf)(e)}function rf(e){return JSON.stringify(e,(t,n)=>ly(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function of(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!of(e[n],t[n])):!1}function AE(e,t){if(e===t)return e;const n=IE(e)&&IE(t);if(n||ly(e)&&ly(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),s=i.length,a=n?[]:{};let l=0;for(let c=0;c<s;c++){const u=n?c:i[c];!n&&e[u]===void 0&&t[u]===void 0&&r.includes(u)?(a[u]=void 0,l++):(a[u]=AE(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return o===s&&l===o?e:a}return t}function ay(e,t){if(e&&!t||t&&!e)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function IE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ly(e){if(!NE(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!NE(n)||!n.hasOwnProperty("isPrototypeOf"))}function NE(e){return Object.prototype.toString.call(e)==="[object Object]"}function sR(e){return new Promise(t=>{setTimeout(t,e)})}function cy(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?AE(e,t):t}function aR(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function lR(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var cR=(f8=class extends nf{constructor(){super();Ge(this,Oc,void 0);Ge(this,rl,void 0);Ge(this,fd,void 0);je(this,fd,t=>{if(!Xc&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){ee(this,rl)||this.setEventListener(ee(this,fd))}onUnsubscribe(){var t;this.hasListeners()||((t=ee(this,rl))==null||t.call(this),je(this,rl,void 0))}setEventListener(t){var n;je(this,fd,t),(n=ee(this,rl))==null||n.call(this),je(this,rl,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){ee(this,Oc)!==t&&(je(this,Oc,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof ee(this,Oc)=="boolean"?ee(this,Oc):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Oc=new WeakMap,rl=new WeakMap,fd=new WeakMap,f8),sg=new cR,uR=(h8=class extends nf{constructor(){super();Ge(this,hd,!0);Ge(this,ol,void 0);Ge(this,pd,void 0);je(this,pd,t=>{if(!Xc&&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(){ee(this,ol)||this.setEventListener(ee(this,pd))}onUnsubscribe(){var t;this.hasListeners()||((t=ee(this,ol))==null||t.call(this),je(this,ol,void 0))}setEventListener(t){var n;je(this,pd,t),(n=ee(this,ol))==null||n.call(this),je(this,ol,t(this.setOnline.bind(this)))}setOnline(t){ee(this,hd)!==t&&(je(this,hd,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return ee(this,hd)}},hd=new WeakMap,ol=new WeakMap,pd=new WeakMap,h8),sf=new uR;function dR(e){return Math.min(1e3*2**e,3e4)}function ag(e){return(e??"online")==="online"?sf.isOnline():!0}var LE=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function uy(e){return e instanceof LE}function FE(e){let t=!1,n=0,r=!1,o,i,s;const a=new Promise((y,w)=>{i=y,s=w}),l=y=>{var w;r||(p(new LE(y)),(w=e.abort)==null||w.call(e))},c=()=>{t=!0},u=()=>{t=!1},d=()=>!sg.isFocused()||e.networkMode!=="always"&&!sf.isOnline(),h=y=>{var w;r||(r=!0,(w=e.onSuccess)==null||w.call(e,y),o==null||o(),i(y))},p=y=>{var w;r||(r=!0,(w=e.onError)==null||w.call(e,y),o==null||o(),s(y))},m=()=>new Promise(y=>{var w;o=C=>{const _=r||!d();return _&&y(C),_},(w=e.onPause)==null||w.call(e)}).then(()=>{var y;o=void 0,r||(y=e.onContinue)==null||y.call(e)}),v=()=>{if(r)return;let y;try{y=e.fn()}catch(w){y=Promise.reject(w)}Promise.resolve(y).then(h).catch(w=>{var P;if(r)return;const C=e.retry??(Xc?0:3),_=e.retryDelay??dR,k=typeof _=="function"?_(n,w):_,E=C===!0||typeof C=="number"&&n<C||typeof C=="function"&&C(n,w);if(t||!E){p(w);return}n++,(P=e.onFail)==null||P.call(e,n,w),sR(k).then(()=>{if(d())return m()}).then(()=>{t?p(w):v()})})};return ag(e.networkMode)?v():m().then(v),{promise:a,cancel:l,continue:()=>(o==null?void 0:o())?a:Promise.resolve(),cancelRetry:c,continueRetry:u}}function fR(){let e=[],t=0,n=h=>{h()},r=h=>{h()},o=h=>setTimeout(h,0);const i=h=>{o=h},s=h=>{let p;t++;try{p=h()}finally{t--,t||c()}return p},a=h=>{t?e.push(h):o(()=>{n(h)})},l=h=>(...p)=>{a(()=>{h(...p)})},c=()=>{const h=e;e=[],h.length&&o(()=>{r(()=>{h.forEach(p=>{n(p)})})})};return{batch:s,batchCalls:l,schedule:a,setNotifyFunction:h=>{n=h},setBatchNotifyFunction:h=>{r=h},setScheduler:i}}var br=fR(),RE=(p8=class{constructor(){Ge(this,Pc,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),iy(this.gcTime)&&je(this,Pc,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Xc?1/0:5*60*1e3))}clearGcTimeout(){ee(this,Pc)&&(clearTimeout(ee(this,Pc)),je(this,Pc,void 0))}},Pc=new WeakMap,p8),hR=(g8=class extends RE{constructor(t){super();Ge(this,vd);Ge(this,Ni);Ge(this,gd,void 0);Ge(this,md,void 0);Ge(this,si,void 0);Ge(this,il,void 0);Ge(this,ai,void 0);Ge(this,gr,void 0);Ge(this,pp,void 0);Ge(this,Dc,void 0);je(this,Dc,!1),je(this,pp,t.defaultOptions),Bt(this,vd,Nb).call(this,t.options),je(this,gr,[]),je(this,si,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,je(this,gd,t.state||pR(this.options)),this.state=ee(this,gd),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!ee(this,gr).length&&this.state.fetchStatus==="idle"&&ee(this,si).remove(this)}setData(t,n){const r=cy(this.state.data,t,this.options);return Bt(this,Ni,ga).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Bt(this,Ni,ga).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=ee(this,il);return(r=ee(this,ai))==null||r.cancel(t),n?n.then(Ho).catch(Ho):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(ee(this,gd))}isActive(){return ee(this,gr).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||ee(this,gr).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!ME(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=ee(this,gr).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=ee(this,ai))==null||n.continue()}onOnline(){var n;const t=ee(this,gr).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=ee(this,ai))==null||n.continue()}addObserver(t){ee(this,gr).includes(t)||(ee(this,gr).push(t),this.clearGcTimeout(),ee(this,si).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){ee(this,gr).includes(t)&&(je(this,gr,ee(this,gr).filter(n=>n!==t)),ee(this,gr).length||(ee(this,ai)&&(ee(this,Dc)?ee(this,ai).cancel({revert:!0}):ee(this,ai).cancelRetry()),this.scheduleGc()),ee(this,si).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return ee(this,gr).length}invalidate(){this.state.isInvalidated||Bt(this,Ni,ga).call(this,{type:"invalidate"})}fetch(t,n){var c,u,d,h;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(ee(this,il))return(c=ee(this,ai))==null||c.continueRetry(),ee(this,il)}if(t&&Bt(this,vd,Nb).call(this,t),!this.options.queryFn){const p=ee(this,gr).find(m=>m.options.queryFn);p&&Bt(this,vd,Nb).call(this,p.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,o={queryKey:this.queryKey,meta:this.meta},i=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(je(this,Dc,!0),r.signal)})};i(o);const s=()=>this.options.queryFn?(je(this,Dc,!1),this.options.persister?this.options.persister(this.options.queryFn,o,this):this.options.queryFn(o)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),a={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(a),(u=this.options.behavior)==null||u.onFetch(a,this),je(this,md,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=a.fetchOptions)==null?void 0:d.meta))&&Bt(this,Ni,ga).call(this,{type:"fetch",meta:(h=a.fetchOptions)==null?void 0:h.meta});const l=p=>{var m,v,y,w;uy(p)&&p.silent||Bt(this,Ni,ga).call(this,{type:"error",error:p}),uy(p)||((v=(m=ee(this,si).config).onError)==null||v.call(m,p,this),(w=(y=ee(this,si).config).onSettled)==null||w.call(y,this.state.data,p,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return je(this,ai,FE({fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:p=>{var m,v,y,w;if(typeof p>"u"){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),l(new Error(`${this.queryHash} data is undefined`));return}this.setData(p),(v=(m=ee(this,si).config).onSuccess)==null||v.call(m,p,this),(w=(y=ee(this,si).config).onSettled)==null||w.call(y,p,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(p,m)=>{Bt(this,Ni,ga).call(this,{type:"failed",failureCount:p,error:m})},onPause:()=>{Bt(this,Ni,ga).call(this,{type:"pause"})},onContinue:()=>{Bt(this,Ni,ga).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),je(this,il,ee(this,ai).promise),ee(this,il)}},gd=new WeakMap,md=new WeakMap,si=new WeakMap,il=new WeakMap,ai=new WeakMap,gr=new WeakMap,pp=new WeakMap,Dc=new WeakMap,vd=new WeakSet,Nb=function(t){this.options={...ee(this,pp),...t},this.updateGcTime(this.options.gcTime)},Ni=new WeakSet,ga=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:t.meta??null,fetchStatus:ag(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return uy(o)&&o.revert&&ee(this,md)?{...ee(this,md),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),br.batch(()=>{ee(this,gr).forEach(r=>{r.onQueryUpdate()}),ee(this,si).notify({query:this,type:"updated",action:t})})},g8);function pR(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var gR=(m8=class extends nf{constructor(t={}){super();Ge(this,fs,void 0);this.config=t,je(this,fs,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??sy(o,n);let s=this.get(i);return s||(s=new hR({cache:this,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){ee(this,fs).has(t.queryHash)||(ee(this,fs).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=ee(this,fs).get(t.queryHash);n&&(t.destroy(),n===t&&ee(this,fs).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){br.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return ee(this,fs).get(t)}getAll(){return[...ee(this,fs).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>$E(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>$E(t,r)):n}notify(t){br.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){br.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){br.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},fs=new WeakMap,m8),mR=(v8=class extends RE{constructor(t){super();Ge(this,ps);Ge(this,hs,void 0);Ge(this,gp,void 0);Ge(this,Lo,void 0);Ge(this,bd,void 0);this.mutationId=t.mutationId,je(this,gp,t.defaultOptions),je(this,Lo,t.mutationCache),je(this,hs,[]),this.state=t.state||vR(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...ee(this,gp),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){ee(this,hs).includes(t)||(ee(this,hs).push(t),this.clearGcTimeout(),ee(this,Lo).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){je(this,hs,ee(this,hs).filter(n=>n!==t)),this.scheduleGc(),ee(this,Lo).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){ee(this,hs).length||(this.state.status==="pending"?this.scheduleGc():ee(this,Lo).remove(this))}continue(){var t;return((t=ee(this,bd))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,a,l,c,u,d,h,p,m,v,y,w,C,_,k,E,P,D;const n=()=>(je(this,bd,FE({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(M,I)=>{Bt(this,ps,_l).call(this,{type:"failed",failureCount:M,error:I})},onPause:()=>{Bt(this,ps,_l).call(this,{type:"pause"})},onContinue:()=>{Bt(this,ps,_l).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),ee(this,bd).promise),r=this.state.status==="pending";try{if(!r){Bt(this,ps,_l).call(this,{type:"pending",variables:t}),await((i=(o=ee(this,Lo).config).onMutate)==null?void 0:i.call(o,t,this));const I=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));I!==this.state.context&&Bt(this,ps,_l).call(this,{type:"pending",context:I,variables:t})}const M=await n();return await((c=(l=ee(this,Lo).config).onSuccess)==null?void 0:c.call(l,M,t,this.state.context,this)),await((d=(u=this.options).onSuccess)==null?void 0:d.call(u,M,t,this.state.context)),await((p=(h=ee(this,Lo).config).onSettled)==null?void 0:p.call(h,M,null,this.state.variables,this.state.context,this)),await((v=(m=this.options).onSettled)==null?void 0:v.call(m,M,null,t,this.state.context)),Bt(this,ps,_l).call(this,{type:"success",data:M}),M}catch(M){try{throw await((w=(y=ee(this,Lo).config).onError)==null?void 0:w.call(y,M,t,this.state.context,this)),await((_=(C=this.options).onError)==null?void 0:_.call(C,M,t,this.state.context)),await((E=(k=ee(this,Lo).config).onSettled)==null?void 0:E.call(k,void 0,M,this.state.variables,this.state.context,this)),await((D=(P=this.options).onSettled)==null?void 0:D.call(P,void 0,M,t,this.state.context)),M}finally{Bt(this,ps,_l).call(this,{type:"error",error:M})}}}},hs=new WeakMap,gp=new WeakMap,Lo=new WeakMap,bd=new WeakMap,ps=new WeakSet,_l=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:!ag(this.options.networkMode),status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),br.batch(()=>{ee(this,hs).forEach(r=>{r.onMutationUpdate(t)}),ee(this,Lo).notify({mutation:this,type:"updated",action:t})})},v8);function vR(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var bR=(b8=class extends nf{constructor(t={}){super();Ge(this,li,void 0);Ge(this,mp,void 0);Ge(this,Mc,void 0);this.config=t,je(this,li,[]),je(this,mp,0)}build(t,n,r){const o=new mR({mutationCache:this,mutationId:++Ib(this,mp)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){ee(this,li).push(t),this.notify({type:"added",mutation:t})}remove(t){je(this,li,ee(this,li).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){br.batch(()=>{ee(this,li).forEach(t=>{this.remove(t)})})}getAll(){return ee(this,li)}find(t){const n={exact:!0,...t};return ee(this,li).find(r=>TE(n,r))}findAll(t={}){return ee(this,li).filter(n=>TE(t,n))}notify(t){br.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return je(this,Mc,(ee(this,Mc)??Promise.resolve()).then(()=>{const t=ee(this,li).filter(n=>n.state.isPaused);return br.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(Ho)),Promise.resolve()))}).then(()=>{je(this,Mc,void 0)})),ee(this,Mc)}},li=new WeakMap,mp=new WeakMap,Mc=new WeakMap,b8);function yR(e){return{onFetch:(t,n)=>{const r=async()=>{var m,v,y,w,C;const o=t.options,i=(y=(v=(m=t.fetchOptions)==null?void 0:m.meta)==null?void 0:v.fetchMore)==null?void 0:y.direction,s=((w=t.state.data)==null?void 0:w.pages)||[],a=((C=t.state.data)==null?void 0:C.pageParams)||[],l={pages:[],pageParams:[]};let c=!1;const u=_=>{Object.defineProperty(_,"signal",{enumerable:!0,get:()=>(t.signal.aborted?c=!0:t.signal.addEventListener("abort",()=>{c=!0}),t.signal)})},d=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),h=async(_,k,E)=>{if(c)return Promise.reject();if(k==null&&_.pages.length)return Promise.resolve(_);const P={queryKey:t.queryKey,pageParam:k,direction:E?"backward":"forward",meta:t.options.meta};u(P);const D=await d(P),{maxPages:M}=t.options,I=E?lR:aR;return{pages:I(_.pages,D,M),pageParams:I(_.pageParams,k,M)}};let p;if(i&&s.length){const _=i==="backward",k=_?xR:jE,E={pages:s,pageParams:a},P=k(o,E);p=await h(E,P,_)}else{p=await h(l,a[0]??o.initialPageParam);const _=e??s.length;for(let k=1;k<_;k++){const E=jE(o,p);p=await h(p,E)}}return p};t.options.persister?t.fetchFn=()=>{var o,i;return(i=(o=t.options).persister)==null?void 0:i.call(o,r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=r}}}function jE(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function xR(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var wR=(y8=class{constructor(e={}){Ge(this,cr,void 0);Ge(this,sl,void 0);Ge(this,al,void 0);Ge(this,yd,void 0);Ge(this,xd,void 0);Ge(this,ll,void 0);Ge(this,wd,void 0);Ge(this,Sd,void 0);je(this,cr,e.queryCache||new gR),je(this,sl,e.mutationCache||new bR),je(this,al,e.defaultOptions||{}),je(this,yd,new Map),je(this,xd,new Map),je(this,ll,0)}mount(){Ib(this,ll)._++,ee(this,ll)===1&&(je(this,wd,sg.subscribe(()=>{sg.isFocused()&&(this.resumePausedMutations(),ee(this,cr).onFocus())})),je(this,Sd,sf.subscribe(()=>{sf.isOnline()&&(this.resumePausedMutations(),ee(this,cr).onOnline())})))}unmount(){var e,t;Ib(this,ll)._--,ee(this,ll)===0&&((e=ee(this,wd))==null||e.call(this),je(this,wd,void 0),(t=ee(this,Sd))==null||t.call(this),je(this,Sd,void 0))}isFetching(e){return ee(this,cr).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return ee(this,sl).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=ee(this,cr).find({queryKey:e}))==null?void 0:t.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);return t!==void 0?Promise.resolve(t):this.fetchQuery(e)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=ee(this,cr).find({queryKey:e}),o=r==null?void 0:r.state.data,i=iR(t,o);if(typeof i>"u")return;const s=this.defaultQueryOptions({queryKey:e});return ee(this,cr).build(this,s).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return br.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var t;return(t=ee(this,cr).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=ee(this,cr);br.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=ee(this,cr),r={type:"active",...e};return br.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=br.batch(()=>ee(this,cr).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Ho).catch(Ho)}invalidateQueries(e={},t={}){return br.batch(()=>{if(ee(this,cr).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=br.batch(()=>ee(this,cr).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(Ho)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Ho)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=ee(this,cr).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ho).catch(Ho)}fetchInfiniteQuery(e){return e.behavior=yR(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ho).catch(Ho)}resumePausedMutations(){return ee(this,sl).resumePausedMutations()}getQueryCache(){return ee(this,cr)}getMutationCache(){return ee(this,sl)}getDefaultOptions(){return ee(this,al)}setDefaultOptions(e){je(this,al,e)}setQueryDefaults(e,t){ee(this,yd).set(rf(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...ee(this,yd).values()];let n={};return t.forEach(r=>{of(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){ee(this,xd).set(rf(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...ee(this,xd).values()];let n={};return t.forEach(r=>{of(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...ee(this,al).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=sy(t.queryKey,t)),typeof t.refetchOnReconnect>"u"&&(t.refetchOnReconnect=t.networkMode!=="always"),typeof t.throwOnError>"u"&&(t.throwOnError=!!t.suspense),typeof t.networkMode>"u"&&t.persister&&(t.networkMode="offlineFirst"),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...ee(this,al).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){ee(this,cr).clear(),ee(this,sl).clear()}},cr=new WeakMap,sl=new WeakMap,al=new WeakMap,yd=new WeakMap,xd=new WeakMap,ll=new WeakMap,wd=new WeakMap,Sd=new WeakMap,y8),SR=(x8=class extends nf{constructor(t,n){super();Ge(this,Ic);Ge(this,yp);Ge(this,xp);Ge(this,wp);Ge(this,Sp);Ge(this,Cp);Ge(this,_p);Ge(this,Ep);Ge(this,Uv);Ge(this,ao,void 0);Ge(this,Tn,void 0);Ge(this,vp,void 0);Ge(this,Vr,void 0);Ge(this,$c,void 0);Ge(this,Cd,void 0);Ge(this,gs,void 0);Ge(this,bp,void 0);Ge(this,_d,void 0);Ge(this,Ed,void 0);Ge(this,Tc,void 0);Ge(this,Ac,void 0);Ge(this,cl,void 0);Ge(this,kd,new Set);this.options=n,je(this,ao,t),je(this,gs,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(ee(this,Tn).addObserver(this),zE(ee(this,Tn),this.options)?Bt(this,Ic,Up).call(this):this.updateResult(),Bt(this,Sp,z2).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return dy(ee(this,Tn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return dy(ee(this,Tn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Bt(this,Cp,B2).call(this),Bt(this,_p,V2).call(this),ee(this,Tn).removeObserver(this)}setOptions(t,n){const r=this.options,o=ee(this,Tn);if(this.options=ee(this,ao).defaultQueryOptions(t),ay(r,this.options)||ee(this,ao).getQueryCache().notify({type:"observerOptionsUpdated",query:ee(this,Tn),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),Bt(this,Ep,H2).call(this);const i=this.hasListeners();i&&BE(ee(this,Tn),o,this.options,r)&&Bt(this,Ic,Up).call(this),this.updateResult(n),i&&(ee(this,Tn)!==o||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&Bt(this,yp,F2).call(this);const s=Bt(this,xp,R2).call(this);i&&(ee(this,Tn)!==o||this.options.enabled!==r.enabled||s!==ee(this,cl))&&Bt(this,wp,j2).call(this,s)}getOptimisticResult(t){const n=ee(this,ao).getQueryCache().build(ee(this,ao),t),r=this.createResult(n,t);return _R(this,r)&&(je(this,Vr,r),je(this,Cd,this.options),je(this,$c,ee(this,Tn).state)),r}getCurrentResult(){return ee(this,Vr)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(ee(this,kd).add(r),t[r])})}),n}getCurrentQuery(){return ee(this,Tn)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=ee(this,ao).defaultQueryOptions(t),r=ee(this,ao).getQueryCache().build(ee(this,ao),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Bt(this,Ic,Up).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),ee(this,Vr)))}createResult(t,n){var P;const r=ee(this,Tn),o=this.options,i=ee(this,Vr),s=ee(this,$c),a=ee(this,Cd),c=t!==r?t.state:ee(this,vp),{state:u}=t;let{error:d,errorUpdatedAt:h,fetchStatus:p,status:m}=u,v=!1,y;if(n._optimisticResults){const D=this.hasListeners(),M=!D&&zE(t,n),I=D&&BE(t,r,n,o);(M||I)&&(p=ag(t.options.networkMode)?"fetching":"paused",u.dataUpdatedAt||(m="pending")),n._optimisticResults==="isRestoring"&&(p="idle")}if(n.select&&typeof u.data<"u")if(i&&u.data===(s==null?void 0:s.data)&&n.select===ee(this,bp))y=ee(this,_d);else try{je(this,bp,n.select),y=n.select(u.data),y=cy(i==null?void 0:i.data,y,n),je(this,_d,y),je(this,gs,null)}catch(D){je(this,gs,D)}else y=u.data;if(typeof n.placeholderData<"u"&&typeof y>"u"&&m==="pending"){let D;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))D=i.data;else if(D=typeof n.placeholderData=="function"?n.placeholderData((P=ee(this,Ed))==null?void 0:P.state.data,ee(this,Ed)):n.placeholderData,n.select&&typeof D<"u")try{D=n.select(D),je(this,gs,null)}catch(M){je(this,gs,M)}typeof D<"u"&&(m="success",y=cy(i==null?void 0:i.data,D,n),v=!0)}ee(this,gs)&&(d=ee(this,gs),y=ee(this,_d),h=Date.now(),m="error");const w=p==="fetching",C=m==="pending",_=m==="error",k=C&&w;return{status:m,fetchStatus:p,isPending:C,isSuccess:m==="success",isError:_,isInitialLoading:k,isLoading:k,data:y,dataUpdatedAt:u.dataUpdatedAt,error:d,errorUpdatedAt:h,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:w,isRefetching:w&&!C,isLoadingError:_&&u.dataUpdatedAt===0,isPaused:p==="paused",isPlaceholderData:v,isRefetchError:_&&u.dataUpdatedAt!==0,isStale:fy(t,n),refetch:this.refetch}}updateResult(t){const n=ee(this,Vr),r=this.createResult(ee(this,Tn),this.options);if(je(this,$c,ee(this,Tn).state),je(this,Cd,this.options),ee(this,$c).data!==void 0&&je(this,Ed,ee(this,Tn)),ay(r,n))return;je(this,Vr,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!ee(this,kd).size)return!0;const l=new Set(a??ee(this,kd));return this.options.throwOnError&&l.add("error"),Object.keys(ee(this,Vr)).some(c=>{const u=c;return ee(this,Vr)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),Bt(this,Uv,GL).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Bt(this,Sp,z2).call(this)}},ao=new WeakMap,Tn=new WeakMap,vp=new WeakMap,Vr=new WeakMap,$c=new WeakMap,Cd=new WeakMap,gs=new WeakMap,bp=new WeakMap,_d=new WeakMap,Ed=new WeakMap,Tc=new WeakMap,Ac=new WeakMap,cl=new WeakMap,kd=new WeakMap,Ic=new WeakSet,Up=function(t){Bt(this,Ep,H2).call(this);let n=ee(this,Tn).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Ho)),n},yp=new WeakSet,F2=function(){if(Bt(this,Cp,B2).call(this),Xc||ee(this,Vr).isStale||!iy(this.options.staleTime))return;const n=ME(ee(this,Vr).dataUpdatedAt,this.options.staleTime)+1;je(this,Tc,setTimeout(()=>{ee(this,Vr).isStale||this.updateResult()},n))},xp=new WeakSet,R2=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(ee(this,Tn)):this.options.refetchInterval)??!1},wp=new WeakSet,j2=function(t){Bt(this,_p,V2).call(this),je(this,cl,t),!(Xc||this.options.enabled===!1||!iy(ee(this,cl))||ee(this,cl)===0)&&je(this,Ac,setInterval(()=>{(this.options.refetchIntervalInBackground||sg.isFocused())&&Bt(this,Ic,Up).call(this)},ee(this,cl)))},Sp=new WeakSet,z2=function(){Bt(this,yp,F2).call(this),Bt(this,wp,j2).call(this,Bt(this,xp,R2).call(this))},Cp=new WeakSet,B2=function(){ee(this,Tc)&&(clearTimeout(ee(this,Tc)),je(this,Tc,void 0))},_p=new WeakSet,V2=function(){ee(this,Ac)&&(clearInterval(ee(this,Ac)),je(this,Ac,void 0))},Ep=new WeakSet,H2=function(){const t=ee(this,ao).getQueryCache().build(ee(this,ao),this.options);if(t===ee(this,Tn))return;const n=ee(this,Tn);je(this,Tn,t),je(this,vp,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Uv=new WeakSet,GL=function(t){br.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(ee(this,Vr))}),ee(this,ao).getQueryCache().notify({query:ee(this,Tn),type:"observerResultsUpdated"})})},x8);function CR(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function zE(e,t){return CR(e,t)||e.state.dataUpdatedAt>0&&dy(e,t,t.refetchOnMount)}function dy(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&fy(e,t)}return!1}function BE(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&fy(e,n)}function fy(e,t){return e.isStaleByTime(t.staleTime)}function _R(e,t){return!ay(e.getCurrentResult(),t)}var VE=he.createContext(void 0),HE=e=>{const t=he.useContext(VE);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},ER=({client:e,children:t})=>(he.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),he.createElement(VE.Provider,{value:e},t)),qE=he.createContext(!1),kR=()=>he.useContext(qE);qE.Provider;function OR(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var PR=he.createContext(OR()),DR=()=>he.useContext(PR);function MR(e,t){return typeof e=="function"?e(...t):!!e}var $R=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},TR=e=>{he.useEffect(()=>{e.clearReset()},[e])},AR=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&MR(n,[e.error,r]),IR=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},NR=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,LR=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function FR(e,t,n){if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=HE(n),o=kR(),i=DR(),s=r.defaultQueryOptions(e);s._optimisticResults=o?"isRestoring":"optimistic",IR(s),$R(s,i),TR(i);const[a]=he.useState(()=>new t(r,s)),l=a.getOptimisticResult(s);if(he.useSyncExternalStore(he.useCallback(c=>{const u=o?()=>{}:a.subscribe(br.batchCalls(c));return a.updateResult(),u},[a,o]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),he.useEffect(()=>{a.setOptions(s,{listeners:!1})},[s,a]),NR(s,l))throw LR(s,a,i);if(AR({result:l,errorResetBoundary:i,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw l.error;return s.notifyOnChangeProps?l:a.trackResult(l)}function yi(e,t){return FR(e,SR,t)}let lg;const RR=new Uint8Array(16);function jR(){if(!lg&&(lg=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!lg))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return lg(RR)}const yr=[];for(let e=0;e<256;++e)yr.push((e+256).toString(16).slice(1));function zR(e,t=0){return yr[e[t+0]]+yr[e[t+1]]+yr[e[t+2]]+yr[e[t+3]]+"-"+yr[e[t+4]]+yr[e[t+5]]+"-"+yr[e[t+6]]+yr[e[t+7]]+"-"+yr[e[t+8]]+yr[e[t+9]]+"-"+yr[e[t+10]]+yr[e[t+11]]+yr[e[t+12]]+yr[e[t+13]]+yr[e[t+14]]+yr[e[t+15]]}const WE={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function ya(e,t,n){if(WE.randomUUID&&!t&&!e)return WE.randomUUID();e=e||{};const r=e.random||(e.rng||jR)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let o=0;o<16;++o)t[n+o]=r[o];return t}return zR(r)}const be=dE()(CE((e,t)=>({isShowingVisual:!0,runSql:!1,sqlGen:{},sql:"",isSqlRunning:!1,queryResultColumns:[],showFilters:!1,applyFilters:!1,filterValues:[{filterId:"sample-filter-id",valueType:"string",name:"",operation:"in",values:[""]}],card:{id:ya(),title:"Editor Card",description:"Description",type:"bar",data:[]},frame:{id:ya(),cards:[],activeCardId:""},actions:{setNumberFormat:(n,r,o,i)=>{e(s=>{var a;s.card.preferences={...(a=s.card)==null?void 0:a.preferences,formatNumber:{format:n,currency:r,locale:o,suffix:i,enabled:!0}}})},setQueryError:n=>{e(r=>{r.queryError=n})},setQueryResultColumns:n=>{e(r=>{r.queryResultColumns=n})},setCardPreferences:n=>{e(r=>{r.card.preferences=n})},setFilterOnClickColumnIndex:n=>{e(r=>{r.card.preferences={...r.card.preferences,filterOnClickColumnIndex:n}})},setFilterOnClickField:n=>{e(r=>{r.card.preferences={...r.card.preferences,filterOnClick:!0,filterOnClickField:n}})},setCardRefreshInterval:n=>{e(r=>{r.card.refreshInterval=n})},setIsShowingVisual:n=>{e({isShowingVisual:n})},setRunSql:n=>{e({runSql:n})},setIsSqlRunning:n=>{e({isSqlRunning:n})},setFrame:n=>{e({frame:n})},setCard:n=>{e({card:n})},setCardType:n=>{e(r=>{r.card.type=n})},setCardSql:n=>{e(r=>{r.card.sql=n})},setCardPython:n=>{e(r=>{r.card.python=n})},setPythonStdOut:n=>{e(r=>{r.pythonStdOut=n})},setCardCustomCfg:n=>{e(r=>{r.card.customCfg=n})},setCardCfg:n=>{e(r=>{r.card.cfg=n})},setShowFilters:n=>{e(r=>{r.showFilters=n})},setApplyFilters:n=>{e(r=>{r.applyFilters=n})},setFilterValues:n=>{e(r=>{r.filterValues=n})},setSqlGen:n=>{e(r=>{r.sqlGen=n})},setSqlGenMeasure:(n,r)=>{e(o=>{o.sqlGen.measures=[...o.sqlGen.measures||[],{name:n,calc:r}]})},setSqlGenDimension:n=>{e(r=>{r.sqlGen.dimensions=[...r.sqlGen.dimensions||[],n]})},setCardData:n=>{e(r=>{r.card.data=n})},setSelectedConnectionId:n=>{var r,o;e(i=>{i.selectedConnectionId=n,i.card.connectionId=n}),(o=(r=t()).onConnectionChange)==null||o.call(r,n)},setSelectedDatabaseName:n=>{var r,o;e(i=>{i.selectedDatabaseName=n,i.card.lastSelectedDatabase=n}),(o=(r=t()).onDatabaseChange)==null||o.call(r,n)},setSelectedSchemaName:n=>{var r,o;e(i=>{i.selectedSchemaName=n,i.card.lastSelectedSchema=n}),(o=(r=t()).onSchemaChange)==null||o.call(r,n)},setSelectedTableName:n=>{var r,o;e(i=>{i.selectedTableName=n,i.card.lastSelectedTable=n}),(o=(r=t()).onTableChange)==null||o.call(r,n)},setCurrentColumns:n=>{e(r=>{r.currentColumns=n})},setOnConnectionChange:n=>{e({onConnectionChange:n})},setOnDatabaseChange:n=>{e({onDatabaseChange:n})},setOnSchemaChange:n=>{e({onSchemaChange:n})},setOnTableChange:n=>{e({onTableChange:n})},setOnSave:n=>{e({onSave:n})},setOnClose:n=>{e({onClose:n})}}}))),BR=()=>be(e=>e.actions);process.env.NODE_ENV==="development"&&EE("EditorStore",be);function UE({children:e}){const t=new wR;return x.jsx(ER,{client:t,children:e})}var Ot={context:void 0,registry:void 0};function af(e){Ot.context=e}var VR=(e,t)=>e===t,qo=Symbol("solid-proxy"),Qc=Symbol("solid-track"),cg={equals:VR},GE=JE,ks=1,ug=2,KE={owned:null,cleanups:null,context:null,owner:null},hy={},Qt=null,py=null,dn=null,Or=null,Os=null,dg=0;function Ps(e,t){const n=dn,r=Qt,o=e.length===0,i=t===void 0?r:t,s=o?KE:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e(()=>Fn(()=>gg(s)));Qt=s,dn=null;try{return zi(a,!0)}finally{dn=n,Qt=r}}function qe(e,t){t=t?Object.assign({},cg,t):cg;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),ZE(n,o));return[QE.bind(n),r]}function gy(e,t,n){const r=fg(e,t,!0,ks);Zc(r)}function at(e,t,n){const r=fg(e,t,!1,ks);Zc(r)}function ht(e,t,n){GE=ZR;const r=fg(e,t,!1,ks);(!n||!n.render)&&(r.user=!0),Os?Os.push(r):Zc(r)}function Me(e,t,n){n=n?Object.assign({},cg,n):cg;const r=fg(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Zc(r),QE.bind(r)}function HR(e){return e&&typeof e=="object"&&"then"in e}function qR(e,t,n){let r,o,i;arguments.length===2&&typeof t=="object"||arguments.length===1?(r=!0,o=e,i=t||{}):(r=e,o=t,i=n||{});let s=null,a=hy,l=null,c=!1,u="initialValue"in i,d=typeof r=="function"&&Me(r);const h=new Set,[p,m]=(i.storage||qe)(i.initialValue),[v,y]=qe(void 0),[w,C]=qe(void 0,{equals:!1}),[_,k]=qe(u?"ready":"unresolved");if(Ot.context){l=`${Ot.context.id}${Ot.context.count++}`;let I;i.ssrLoadFrom==="initial"?a=i.initialValue:Ot.load&&(I=Ot.load(l))&&(a=I)}function E(I,F,R,B){return s===I&&(s=null,B!==void 0&&(u=!0),(I===a||F===a)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(B,{value:F})),a=hy,P(F,R)),F}function P(I,F){zi(()=>{F===void 0&&m(()=>I),k(F!==void 0?"errored":u?"ready":"unresolved"),y(F);for(const R of h.keys())R.decrement();h.clear()},!1)}function D(){const I=YR,F=p(),R=v();if(R!==void 0&&!s)throw R;return dn&&!dn.user&&I&&gy(()=>{w(),s&&(I.resolved||h.has(I)||(I.increment(),h.add(I)))}),F}function M(I=!0){if(I!==!1&&c)return;c=!1;const F=d?d():r;if(F==null||F===!1){E(s,Fn(p));return}const R=a!==hy?a:Fn(()=>o(F,{value:p(),refetching:I}));return HR(R)?(s=R,"value"in R?(R.status==="success"?E(s,R.value,void 0,F):E(s,void 0,void 0,F),R):(c=!0,queueMicrotask(()=>c=!1),zi(()=>{k(u?"refreshing":"pending"),C()},!1),R.then(B=>E(R,B,void 0,F),B=>E(R,void 0,t5(B),F)))):(E(s,R,void 0,F),R)}return Object.defineProperties(D,{state:{get:()=>_()},error:{get:()=>v()},loading:{get(){const I=_();return I==="pending"||I==="refreshing"}},latest:{get(){if(!u)return D();const I=v();if(I&&!s)throw I;return p()}}}),d?gy(()=>M(!1)):M(!1),[D,{refetch:M,mutate:m}]}function YE(e){return zi(e,!1)}function Fn(e){if(dn===null)return e();const t=dn;dn=null;try{return e()}finally{dn=t}}function xi(e,t,n){const r=Array.isArray(e);let o,i=n&&n.defer;return s=>{let a;if(r){a=Array(e.length);for(let c=0;c<e.length;c++)a[c]=e[c]()}else a=e();if(i){i=!1;return}const l=Fn(()=>t(a,o,s));return o=a,l}}function Ml(e){ht(()=>Fn(e))}function pt(e){return Qt===null||(Qt.cleanups===null?Qt.cleanups=[e]:Qt.cleanups.push(e)),e}function my(){return dn}function XE(){return Qt}function WR(e,t){const n=Qt,r=dn;Qt=e,dn=null;try{return zi(t,!0)}catch(o){by(o)}finally{Qt=n,dn=r}}function UR(e){const t=dn,n=Qt;return Promise.resolve().then(()=>{dn=t,Qt=n;let r;return zi(e,!1),dn=Qt=null,r?r.done:void 0})}var[GR,u2e]=qe(!1);function KR(){return[GR,UR]}function Kr(e,t){const n=Symbol("context");return{id:n,Provider:JR(n),defaultValue:e}}function Yr(e){return Qt&&Qt.context&&Qt.context[e.id]!==void 0?Qt.context[e.id]:e.defaultValue}function vy(e){const t=Me(e),n=Me(()=>yy(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}var YR;function QE(){if(this.sources&&this.state)if(this.state===ks)Zc(this);else{const e=Or;Or=null,zi(()=>pg(this),!1),Or=e}if(dn){const e=this.observers?this.observers.length:0;dn.sources?(dn.sources.push(this),dn.sourceSlots.push(e)):(dn.sources=[this],dn.sourceSlots=[e]),this.observers?(this.observers.push(dn),this.observerSlots.push(dn.sources.length-1)):(this.observers=[dn],this.observerSlots=[dn.sources.length-1])}return this.value}function ZE(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&zi(()=>{for(let o=0;o<e.observers.length;o+=1){const i=e.observers[o],s=py&&py.running;s&&py.disposed.has(i),(s?!i.tState:!i.state)&&(i.pure?Or.push(i):Os.push(i),i.observers&&e5(i)),s||(i.state=ks)}if(Or.length>1e6)throw Or=[],new Error},!1)),t}function Zc(e){if(!e.fn)return;gg(e);const t=dg;XR(e,e.value,t)}function XR(e,t,n){let r;const o=Qt,i=dn;dn=Qt=e;try{r=e.fn(t)}catch(s){return e.pure&&(e.state=ks,e.owned&&e.owned.forEach(gg),e.owned=null),e.updatedAt=n+1,by(s)}finally{dn=i,Qt=o}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?ZE(e,r):e.value=r,e.updatedAt=n)}function fg(e,t,n,r=ks,o){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:Qt,context:Qt?Qt.context:null,pure:n};return Qt===null||Qt!==KE&&(Qt.owned?Qt.owned.push(i):Qt.owned=[i]),i}function hg(e){if(e.state===0)return;if(e.state===ug)return pg(e);if(e.suspense&&Fn(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<dg);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===ks)Zc(e);else if(e.state===ug){const r=Or;Or=null,zi(()=>pg(e,t[0]),!1),Or=r}}function zi(e,t){if(Or)return e();let n=!1;t||(Or=[]),Os?n=!0:Os=[],dg++;try{const r=e();return QR(n),r}catch(r){n||(Os=null),Or=null,by(r)}}function QR(e){if(Or&&(JE(Or),Or=null),e)return;const t=Os;Os=null,t.length&&zi(()=>GE(t),!1)}function JE(e){for(let t=0;t<e.length;t++)hg(e[t])}function ZR(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:hg(r)}if(Ot.context){if(Ot.count){Ot.effects||(Ot.effects=[]),Ot.effects.push(...e.slice(0,n));return}else Ot.effects&&(e=[...Ot.effects,...e],n+=Ot.effects.length,delete Ot.effects);af()}for(t=0;t<n;t++)hg(e[t])}function pg(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const r=e.sources[n];if(r.sources){const o=r.state;o===ks?r!==t&&(!r.updatedAt||r.updatedAt<dg)&&hg(r):o===ug&&pg(r,t)}}}function e5(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=ug,n.pure?Or.push(n):Os.push(n),n.observers&&e5(n))}}function gg(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),r=e.sourceSlots.pop(),o=n.observers;if(o&&o.length){const i=o.pop(),s=n.observerSlots.pop();r<o.length&&(i.sourceSlots[s]=r,o[r]=i,n.observerSlots[r]=s)}}if(e.owned){for(t=e.owned.length-1;t>=0;t--)gg(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function t5(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function by(e,t=Qt){throw t5(e)}function yy(e){if(typeof e=="function"&&!e.length)return yy(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=yy(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function JR(e,t){return function(r){let o;return at(()=>o=Fn(()=>(Qt.context={...Qt.context,[e]:r.value},vy(()=>r.children))),void 0),o}}var xy=Symbol("fallback");function mg(e){for(let t=0;t<e.length;t++)e[t]()}function e6(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return pt(()=>mg(i)),()=>{let l=e()||[],c,u;return l[Qc],Fn(()=>{let h=l.length,p,m,v,y,w,C,_,k,E;if(h===0)s!==0&&(mg(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[xy],o[0]=Ps(P=>(i[0]=P,n.fallback())),s=1);else if(s===0){for(o=new Array(h),u=0;u<h;u++)r[u]=l[u],o[u]=Ps(d);s=h}else{for(v=new Array(h),y=new Array(h),a&&(w=new Array(h)),C=0,_=Math.min(s,h);C<_&&r[C]===l[C];C++);for(_=s-1,k=h-1;_>=C&&k>=C&&r[_]===l[k];_--,k--)v[k]=o[_],y[k]=i[_],a&&(w[k]=a[_]);for(p=new Map,m=new Array(k+1),u=k;u>=C;u--)E=l[u],c=p.get(E),m[u]=c===void 0?-1:c,p.set(E,u);for(c=C;c<=_;c++)E=r[c],u=p.get(E),u!==void 0&&u!==-1?(v[u]=o[c],y[u]=i[c],a&&(w[u]=a[c]),u=m[u],p.set(E,u)):i[c]();for(u=C;u<h;u++)u in v?(o[u]=v[u],i[u]=y[u],a&&(a[u]=w[u],a[u](u))):o[u]=Ps(d);o=o.slice(0,s=h),r=l.slice(0)}return o});function d(h){if(i[u]=h,a){const[p,m]=qe(u);return a[u]=m,t(l[u],p)}return t(l[u])}}}function t6(e,t,n={}){let r=[],o=[],i=[],s=[],a=0,l;return pt(()=>mg(i)),()=>{const c=e()||[];return c[Qc],Fn(()=>{if(c.length===0)return a!==0&&(mg(i),i=[],r=[],o=[],a=0,s=[]),n.fallback&&(r=[xy],o[0]=Ps(d=>(i[0]=d,n.fallback())),a=1),o;for(r[0]===xy&&(i[0](),i=[],r=[],o=[],a=0),l=0;l<c.length;l++)l<r.length&&r[l]!==c[l]?s[l](()=>c[l]):l>=r.length&&(o[l]=Ps(u));for(;l<r.length;l++)i[l]();return a=s.length=i.length=c.length,r=c.slice(0),o=o.slice(0,a)});function u(d){i[l]=d;const[h,p]=qe(c[l]);return s[l]=p,t(h,l)}}}function Q(e,t){return Fn(()=>e(t||{}))}function vg(){return!0}var wy={get(e,t,n){return t===qo?n:e.get(t)},has(e,t){return t===qo?!0:e.has(t)},set:vg,deleteProperty:vg,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:vg,deleteProperty:vg}},ownKeys(e){return e.keys()}};function Sy(e){return(e=typeof e=="function"?e():e)?e:{}}function n6(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function Pt(...e){let t=!1;for(let i=0;i<e.length;i++){const s=e[i];t=t||!!s&&qo in s,e[i]=typeof s=="function"?(t=!0,Me(s)):s}if(t)return new Proxy({get(i){for(let s=e.length-1;s>=0;s--){const a=Sy(e[s])[i];if(a!==void 0)return a}},has(i){for(let s=e.length-1;s>=0;s--)if(i in Sy(e[s]))return!0;return!1},keys(){const i=[];for(let s=0;s<e.length;s++)i.push(...Object.keys(Sy(e[s])));return[...new Set(i)]}},wy);const n={},r={},o=new Set;for(let i=e.length-1;i>=0;i--){const s=e[i];if(!s)continue;const a=Object.getOwnPropertyNames(s);for(let l=0,c=a.length;l<c;l++){const u=a[l];if(u==="__proto__"||u==="constructor")continue;const d=Object.getOwnPropertyDescriptor(s,u);if(!o.has(u))d.get?(o.add(u),Object.defineProperty(n,u,{enumerable:!0,configurable:!0,get:n6.bind(r[u]=[d.get.bind(s)])})):(d.value!==void 0&&o.add(u),n[u]=d.value);else{const h=r[u];h?d.get?h.push(d.get.bind(s)):d.value!==void 0&&h.push(()=>d.value):n[u]===void 0&&(n[u]=d.value)}}}return n}function rn(e,...t){if(qo in e){const o=new Set(t.length>1?t.flat():t[0]),i=t.map(s=>new Proxy({get(a){return s.includes(a)?e[a]:void 0},has(a){return s.includes(a)&&a in e},keys(){return s.filter(a=>a in e)}},wy));return i.push(new Proxy({get(s){return o.has(s)?void 0:e[s]},has(s){return o.has(s)?!1:s in e},keys(){return Object.keys(e).filter(s=>!o.has(s))}},wy)),i}const n={},r=t.map(()=>({}));for(const o of Object.getOwnPropertyNames(e)){const i=Object.getOwnPropertyDescriptor(e,o),s=!i.get&&!i.set&&i.enumerable&&i.writable&&i.configurable;let a=!1,l=0;for(const c of t)c.includes(o)&&(a=!0,s?r[l][o]=i.value:Object.defineProperty(r[l],o,i)),++l;a||(s?n[o]=i.value:Object.defineProperty(n,o,i))}return[...r,n]}function r6(e){let t,n;const r=o=>{const i=Ot.context;if(i){const[a,l]=qe();Ot.count||(Ot.count=0),Ot.count++,(n||(n=e())).then(c=>{af(i),Ot.count--,l(()=>c.default),af()}),t=a}else if(!t){const[a]=qR(()=>(n||(n=e())).then(l=>l.default));t=a}let s;return Me(()=>(s=t())&&Fn(()=>{if(!i)return s(o);const a=Ot.context;af(i);const l=s(o);return af(a),l}))};return r.preload=()=>n||((n=e()).then(o=>t=()=>o.default),n),r}var o6=0;function wi(){const e=Ot.context;return e?`${e.id}${e.count++}`:`cl-${o6++}`}var n5=e=>`Stale read from <${e}>.`;function r5(e){const t="fallback"in e&&{fallback:()=>e.fallback};return Me(e6(()=>e.each,e.children,t||void 0))}function i6(e){const t="fallback"in e&&{fallback:()=>e.fallback};return Me(t6(()=>e.each,e.children,t||void 0))}function ut(e){const t=e.keyed,n=Me(()=>e.when,void 0,{equals:(r,o)=>t?r===o:!r==!o});return Me(()=>{const r=n();if(r){const o=e.children;return typeof o=="function"&&o.length>0?Fn(()=>o(t?r:()=>{if(!Fn(n))throw n5("Show");return e.when})):o}return e.fallback},void 0,void 0)}function s6(e){let t=!1;const n=(i,s)=>i[0]===s[0]&&(t?i[1]===s[1]:!i[1]==!s[1])&&i[2]===s[2],r=vy(()=>e.children),o=Me(()=>{let i=r();Array.isArray(i)||(i=[i]);for(let s=0;s<i.length;s++){const a=i[s].when;if(a)return t=!!i[s].keyed,[s,a,i[s]]}return[-1]},void 0,{equals:n});return Me(()=>{const[i,s,a]=o();if(i<0)return e.fallback;const l=a.children;return typeof l=="function"&&l.length>0?Fn(()=>l(t?s:()=>{if(Fn(o)[0]!==i)throw n5("Match");return a.when})):l},void 0,void 0)}function Cy(e){return e}var a6=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],l6=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...a6]),c6=new Set(["innerHTML","textContent","innerText","children"]),u6=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),d6=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function f6(e,t){const n=d6[e];return typeof n=="object"?n[t]?n.$:void 0:n}var h6=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),p6=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),g6={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function m6(e,t,n){let r=n.length,o=t.length,i=r,s=0,a=0,l=t[o-1].nextSibling,c=null;for(;s<o||a<i;){if(t[s]===n[a]){s++,a++;continue}for(;t[o-1]===n[i-1];)o--,i--;if(o===s){const u=i<r?a?n[a-1].nextSibling:n[i-a]:l;for(;a<i;)e.insertBefore(n[a++],u)}else if(i===a)for(;s<o;)(!c||!c.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[i-1]&&n[a]===t[o-1]){const u=t[--o].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--i],u),t[o]=n[i]}else{if(!c){c=new Map;let d=a;for(;d<i;)c.set(n[d],d++)}const u=c.get(t[s]);if(u!=null)if(a<u&&u<i){let d=s,h=1,p;for(;++d<o&&d<i&&!((p=c.get(t[d]))==null||p!==u+h);)h++;if(h>u-a){const m=t[s];for(;a<u;)e.insertBefore(n[a++],m)}else e.replaceChild(n[a++],t[s++])}else s++;else t[s++].remove()}}}var o5="_$DX_DELEGATE";function v6(e,t,n,r={}){let o;return Ps(i=>{o=i,t===document?e():ke(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{o(),t.textContent=""}}function Ye(e,t,n){let r;const o=()=>{const s=document.createElement("template");return s.innerHTML=e,n?s.content.firstChild.firstChild:s.content.firstChild},i=t?()=>Fn(()=>document.importNode(r||(r=o()),!0)):()=>(r||(r=o())).cloneNode(!0);return i.cloneNode=i,i}function lf(e,t=window.document){const n=t[o5]||(t[o5]=new Set);for(let r=0,o=e.length;r<o;r++){const i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,_6))}}function Te(e,t,n){Ot.context||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function b6(e,t,n,r){Ot.context||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function Le(e,t){Ot.context||(t==null?e.removeAttribute("class"):e.className=t)}function i5(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const o=n[0];e.addEventListener(t,n[0]=i=>o.call(e,n[1],i))}else e.addEventListener(t,n)}function y6(e,t,n={}){const r=Object.keys(t||{}),o=Object.keys(n);let i,s;for(i=0,s=o.length;i<s;i++){const a=o[i];!a||a==="undefined"||t[a]||(s5(e,a,!1),delete n[a])}for(i=0,s=r.length;i<s;i++){const a=r[i],l=!!t[a];!a||a==="undefined"||n[a]===l||!l||(s5(e,a,!0),n[a]=l)}return n}function x6(e,t,n){if(!t)return n?Te(e,"style"):t;const r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let o,i;for(i in n)t[i]==null&&r.removeProperty(i),delete n[i];for(i in t)o=t[i],o!==n[i]&&(r.setProperty(i,o),n[i]=o);return n}function bg(e,t={},n,r){const o={};return r||at(()=>o.children=Jc(e,t.children,o.children)),at(()=>t.ref&&t.ref(e)),at(()=>w6(e,t,n,!0,o,!0)),o}function cf(e,t,n){return Fn(()=>e(t,n))}function ke(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return Jc(e,t,r,n);at(o=>Jc(e,t(),o,n),r)}function w6(e,t,n,r,o={},i=!1){t||(t={});for(const s in o)if(!(s in t)){if(s==="children")continue;o[s]=a5(e,s,null,o[s],n,i)}for(const s in t){if(s==="children"){r||Jc(e,t.children);continue}const a=t[s];o[s]=a5(e,s,a,o[s],n,i)}}function S6(e){let t,n;return!Ot.context||!(t=Ot.registry.get(n=E6()))?e():(Ot.completed&&Ot.completed.add(t),Ot.registry.delete(n),t)}function C6(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function s5(e,t,n){const r=t.trim().split(/\s+/);for(let o=0,i=r.length;o<i;o++)e.classList.toggle(r[o],n)}function a5(e,t,n,r,o,i){let s,a,l,c,u;if(t==="style")return x6(e,n,r);if(t==="classList")return y6(e,n,r);if(n===r)return r;if(t==="ref")i||n(e);else if(t.slice(0,3)==="on:"){const d=t.slice(3);r&&e.removeEventListener(d,r),n&&e.addEventListener(d,n)}else if(t.slice(0,10)==="oncapture:"){const d=t.slice(10);r&&e.removeEventListener(d,r,!0),n&&e.addEventListener(d,n,!0)}else if(t.slice(0,2)==="on"){const d=t.slice(2).toLowerCase(),h=h6.has(d);if(!h&&r){const p=Array.isArray(r)?r[0]:r;e.removeEventListener(d,p)}(h||n)&&(i5(e,d,n,h),h&&lf([d]))}else if(t.slice(0,5)==="attr:")Te(e,t.slice(5),n);else if((u=t.slice(0,5)==="prop:")||(l=c6.has(t))||!o&&((c=f6(t,e.tagName))||(a=l6.has(t)))||(s=e.nodeName.includes("-"))){if(u)t=t.slice(5),a=!0;else if(Ot.context)return n;t==="class"||t==="className"?Le(e,n):s&&!a&&!l?e[C6(t)]=n:e[c||t]=n}else{const d=o&&t.indexOf(":")>-1&&g6[t.split(":")[0]];d?b6(e,d,t,n):Te(e,u6[t]||t,n)}return n}function _6(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return n||document}}),Ot.registry&&!Ot.done&&(Ot.done=_$HY.done=!0);n;){const r=n[t];if(r&&!n.disabled){const o=n[`${t}Data`];if(o!==void 0?r.call(n,o,e):r.call(n,e),e.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function Jc(e,t,n,r,o){if(Ot.context){!n&&(n=[...e.childNodes]);let a=[];for(let l=0;l<n.length;l++){const c=n[l];c.nodeType===8&&c.data.slice(0,2)==="!$"?c.remove():a.push(c)}n=a}for(;typeof n=="function";)n=n();if(t===n)return n;const i=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,i==="string"||i==="number"){if(Ot.context)return n;if(i==="number"&&(t=t.toString()),s){let a=n[0];a&&a.nodeType===3?a.data=t:a=document.createTextNode(t),n=eu(e,n,r,a)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||i==="boolean"){if(Ot.context)return n;n=eu(e,n,r)}else{if(i==="function")return at(()=>{let a=t();for(;typeof a=="function";)a=a();n=Jc(e,a,n,r)}),()=>n;if(Array.isArray(t)){const a=[],l=n&&Array.isArray(n);if(_y(a,t,n,o))return at(()=>n=Jc(e,a,n,r,!0)),()=>n;if(Ot.context){if(!a.length)return n;if(r===void 0)return[...e.childNodes];let c=a[0],u=[c];for(;(c=c.nextSibling)!==r;)u.push(c);return n=u}if(a.length===0){if(n=eu(e,n,r),s)return n}else l?n.length===0?l5(e,a,r):m6(e,n,a):(n&&eu(e),l5(e,a));n=a}else if(t.nodeType){if(Ot.context&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=eu(e,n,r,t);eu(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function _y(e,t,n,r){let o=!1;for(let i=0,s=t.length;i<s;i++){let a=t[i],l=n&&n[i],c;if(!(a==null||a===!0||a===!1))if((c=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=_y(e,a,l)||o;else if(c==="function")if(r){for(;typeof a=="function";)a=a();o=_y(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||o}else e.push(a),o=!0;else{const u=String(a);l&&l.nodeType===3&&l.data===u?e.push(l):e.push(document.createTextNode(u))}}return o}function l5(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function eu(e,t,n,r){if(n===void 0)return e.textContent="";const o=r||document.createTextNode("");if(t.length){let i=!1;for(let s=t.length-1;s>=0;s--){const a=t[s];if(o!==a){const l=a.parentNode===e;!i&&!s?l?e.replaceChild(o,a):e.insertBefore(o,n):l&&a.remove()}else i=!0}}else e.insertBefore(o,n);return[o]}function E6(){const e=Ot.context;return`${e.id}${e.count++}`}var k6="http://www.w3.org/2000/svg";function c5(e,t=!1){return t?document.createElementNS(k6,e):document.createElement(e)}function O6(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=XE();let i,s=!!Ot.context;return ht(()=>{s&&(XE().user=s=!1),i||(i=WR(o,()=>Me(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[l,c]=qe(!1),u=()=>c(!0);Ps(d=>ke(a,()=>l()?d():i(),null)),pt(u)}else{const l=c5(e.isSVG?"g":"div",e.isSVG),c=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return n.parentNode},configurable:!0}),ke(c,i),a.appendChild(l),e.ref&&e.ref(l),pt(()=>a.removeChild(l))}},void 0,{render:!s}),n}function Ey(e){const[t,n]=rn(e,["component"]),r=Me(()=>t.component);return Me(()=>{const o=r();switch(typeof o){case"function":return Fn(()=>o(n));case"string":const i=p6.has(o),s=Ot.context?S6():c5(o,i);return bg(s,n,i),s}})}var P6=function(){function e(){this.keyToValue=new Map,this.valueToKey=new Map}return e.prototype.set=function(t,n){this.keyToValue.set(t,n),this.valueToKey.set(n,t)},e.prototype.getByKey=function(t){return this.keyToValue.get(t)},e.prototype.getByValue=function(t){return this.valueToKey.get(t)},e.prototype.clear=function(){this.keyToValue.clear(),this.valueToKey.clear()},e}(),u5=function(){function e(t){this.generateIdentifier=t,this.kv=new P6}return e.prototype.register=function(t,n){this.kv.getByValue(t)||(n||(n=this.generateIdentifier(t)),this.kv.set(n,t))},e.prototype.clear=function(){this.kv.clear()},e.prototype.getIdentifier=function(t){return this.kv.getByValue(t)},e.prototype.getValue=function(t){return this.kv.getByKey(t)},e}(),D6=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),M6=function(e){D6(t,e);function t(){var n=e.call(this,function(r){return r.name})||this;return n.classToAllowedProps=new Map,n}return t.prototype.register=function(n,r){typeof r=="object"?(r.allowProps&&this.classToAllowedProps.set(n,r.allowProps),e.prototype.register.call(this,n,r.identifier)):e.prototype.register.call(this,n,r)},t.prototype.getAllowedProps=function(n){return this.classToAllowedProps.get(n)},t}(u5),$6=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,i=[],s;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return i};function T6(e){if("values"in Object)return Object.values(e);var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t}function A6(e,t){var n=T6(e);if("find"in n)return n.find(t);for(var r=n,o=0;o<r.length;o++){var i=r[o];if(t(i))return i}}function tu(e,t){Object.entries(e).forEach(function(n){var r=$6(n,2),o=r[0],i=r[1];return t(i,o)})}function yg(e,t){return e.indexOf(t)!==-1}function d5(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(t(r))return r}}var I6=function(){function e(){this.transfomers={}}return e.prototype.register=function(t){this.transfomers[t.name]=t},e.prototype.findApplicable=function(t){return A6(this.transfomers,function(n){return n.isApplicable(t)})},e.prototype.findByName=function(t){return this.transfomers[t]},e}(),N6=function(e){return Object.prototype.toString.call(e).slice(8,-1)},f5=function(e){return typeof e>"u"},L6=function(e){return e===null},uf=function(e){return typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype},ky=function(e){return uf(e)&&Object.keys(e).length===0},xa=function(e){return Array.isArray(e)},F6=function(e){return typeof e=="string"},R6=function(e){return typeof e=="number"&&!isNaN(e)},j6=function(e){return typeof e=="boolean"},z6=function(e){return e instanceof RegExp},df=function(e){return e instanceof Map},ff=function(e){return e instanceof Set},h5=function(e){return N6(e)==="Symbol"},B6=function(e){return e instanceof Date&&!isNaN(e.valueOf())},V6=function(e){return e instanceof Error},p5=function(e){return typeof e=="number"&&isNaN(e)},H6=function(e){return j6(e)||L6(e)||f5(e)||R6(e)||F6(e)||h5(e)},q6=function(e){return typeof e=="bigint"},W6=function(e){return e===1/0||e===-1/0},U6=function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},G6=function(e){return e instanceof URL},g5=function(e){return e.replace(/\./g,"\\.")},Oy=function(e){return e.map(String).map(g5).join(".")},hf=function(e){for(var t=[],n="",r=0;r<e.length;r++){var o=e.charAt(r),i=o==="\\"&&e.charAt(r+1)===".";if(i){n+=".",r++;continue}var s=o===".";if(s){t.push(n),n="";continue}n+=o}var a=n;return t.push(a),t},Py=function(){return Py=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},Py.apply(this,arguments)},Dy=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,i=[],s;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return i},My=function(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e};function Bi(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var m5=[Bi(f5,"undefined",function(){return null},function(){}),Bi(q6,"bigint",function(e){return e.toString()},function(e){return typeof BigInt<"u"?BigInt(e):e}),Bi(B6,"Date",function(e){return e.toISOString()},function(e){return new Date(e)}),Bi(V6,"Error",function(e,t){var n={name:e.name,message:e.message};return t.allowedErrorProps.forEach(function(r){n[r]=e[r]}),n},function(e,t){var n=new Error(e.message);return n.name=e.name,n.stack=e.stack,t.allowedErrorProps.forEach(function(r){n[r]=e[r]}),n}),Bi(z6,"regexp",function(e){return""+e},function(e){var t=e.slice(1,e.lastIndexOf("/")),n=e.slice(e.lastIndexOf("/")+1);return new RegExp(t,n)}),Bi(ff,"set",function(e){return My([],Dy(e.values()))},function(e){return new Set(e)}),Bi(df,"map",function(e){return My([],Dy(e.entries()))},function(e){return new Map(e)}),Bi(function(e){return p5(e)||W6(e)},"number",function(e){return p5(e)?"NaN":e>0?"Infinity":"-Infinity"},Number),Bi(function(e){return e===0&&1/e===-1/0},"number",function(){return"-0"},Number),Bi(G6,"URL",function(e){return e.toString()},function(e){return new URL(e)})];function xg(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var v5=xg(function(e,t){if(h5(e)){var n=!!t.symbolRegistry.getIdentifier(e);return n}return!1},function(e,t){var n=t.symbolRegistry.getIdentifier(e);return["symbol",n]},function(e){return e.description},function(e,t,n){var r=n.symbolRegistry.getValue(t[1]);if(!r)throw new Error("Trying to deserialize unknown symbol");return r}),K6=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce(function(e,t){return e[t.name]=t,e},{}),b5=xg(U6,function(e){return["typed-array",e.constructor.name]},function(e){return My([],Dy(e))},function(e,t){var n=K6[t[1]];if(!n)throw new Error("Trying to deserialize unknown typed array");return new n(e)});function y5(e,t){if(e!=null&&e.constructor){var n=!!t.classRegistry.getIdentifier(e.constructor);return n}return!1}var x5=xg(y5,function(e,t){var n=t.classRegistry.getIdentifier(e.constructor);return["class",n]},function(e,t){var n=t.classRegistry.getAllowedProps(e.constructor);if(!n)return Py({},e);var r={};return n.forEach(function(o){r[o]=e[o]}),r},function(e,t,n){var r=n.classRegistry.getValue(t[1]);if(!r)throw new Error("Trying to deserialize unknown class - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564");return Object.assign(Object.create(r.prototype),e)}),w5=xg(function(e,t){return!!t.customTransformerRegistry.findApplicable(e)},function(e,t){var n=t.customTransformerRegistry.findApplicable(e);return["custom",n.name]},function(e,t){var n=t.customTransformerRegistry.findApplicable(e);return n.serialize(e)},function(e,t,n){var r=n.customTransformerRegistry.findByName(t[1]);if(!r)throw new Error("Trying to deserialize unknown custom value");return r.deserialize(e)}),Y6=[x5,v5,w5,b5],S5=function(e,t){var n=d5(Y6,function(o){return o.isApplicable(e,t)});if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};var r=d5(m5,function(o){return o.isApplicable(e,t)});if(r)return{value:r.transform(e,t),type:r.annotation}},C5={};m5.forEach(function(e){C5[e.annotation]=e});var X6=function(e,t,n){if(xa(t))switch(t[0]){case"symbol":return v5.untransform(e,t,n);case"class":return x5.untransform(e,t,n);case"custom":return w5.untransform(e,t,n);case"typed-array":return b5.untransform(e,t,n);default:throw new Error("Unknown transformation: "+t)}else{var r=C5[t];if(!r)throw new Error("Unknown transformation: "+t);return r.untransform(e,n)}},nu=function(e,t){for(var n=e.keys();t>0;)n.next(),t--;return n.next().value};function _5(e){if(yg(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(yg(e,"prototype"))throw new Error("prototype is not allowed as a property");if(yg(e,"constructor"))throw new Error("constructor is not allowed as a property")}var Q6=function(e,t){_5(t);for(var n=0;n<t.length;n++){var r=t[n];if(ff(e))e=nu(e,+r);else if(df(e)){var o=+r,i=+t[++n]==0?"key":"value",s=nu(e,o);switch(i){case"key":e=s;break;case"value":e=e.get(s);break}}else e=e[r]}return e},$y=function(e,t,n){if(_5(t),t.length===0)return n(e);for(var r=e,o=0;o<t.length-1;o++){var i=t[o];if(xa(r)){var s=+i;r=r[s]}else if(uf(r))r=r[i];else if(ff(r)){var a=+i;r=nu(r,a)}else if(df(r)){var l=o===t.length-2;if(l)break;var a=+i,c=+t[++o]==0?"key":"value",u=nu(r,a);switch(c){case"key":r=u;break;case"value":r=r.get(u);break}}}var d=t[t.length-1];if(xa(r)?r[+d]=n(r[+d]):uf(r)&&(r[d]=n(r[d])),ff(r)){var h=nu(r,+d),p=n(h);h!==p&&(r.delete(h),r.add(p))}if(df(r)){var a=+t[t.length-2],m=nu(r,a),c=+d==0?"key":"value";switch(c){case"key":{var v=n(m);r.set(v,r.get(m)),v!==m&&r.delete(m);break}case"value":{r.set(m,n(r.get(m)));break}}}return e},Ds=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,i=[],s;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return i},wa=function(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e};function Ty(e,t,n){if(n===void 0&&(n=[]),!!e){if(!xa(e)){tu(e,function(s,a){return Ty(s,t,wa(wa([],Ds(n)),Ds(hf(a))))});return}var r=Ds(e,2),o=r[0],i=r[1];i&&tu(i,function(s,a){Ty(s,t,wa(wa([],Ds(n)),Ds(hf(a))))}),t(o,n)}}function Z6(e,t,n){return Ty(t,function(r,o){e=$y(e,o,function(i){return X6(i,r,n)})}),e}function J6(e,t){function n(s,a){var l=Q6(e,hf(a));s.map(hf).forEach(function(c){e=$y(e,c,function(){return l})})}if(xa(t)){var r=Ds(t,2),o=r[0],i=r[1];o.forEach(function(s){e=$y(e,hf(s),function(){return e})}),i&&tu(i,n)}else tu(t,n);return e}var ej=function(e,t){return uf(e)||xa(e)||df(e)||ff(e)||y5(e,t)};function tj(e,t,n){var r=n.get(e);r?r.push(t):n.set(e,[t])}function nj(e,t){var n={},r=void 0;return e.forEach(function(o){if(!(o.length<=1)){t||(o=o.map(function(l){return l.map(String)}).sort(function(l,c){return l.length-c.length}));var i=Ds(o),s=i[0],a=i.slice(1);s.length===0?r=a.map(Oy):n[Oy(s)]=a.map(Oy)}}),r?ky(n)?[r]:[r,n]:ky(n)?void 0:n}var E5=function(e,t,n,r,o,i,s){var a;o===void 0&&(o=[]),i===void 0&&(i=[]),s===void 0&&(s=new Map);var l=H6(e);if(!l){tj(e,o,t);var c=s.get(e);if(c)return r?{transformedValue:null}:c}if(!ej(e,n)){var u=S5(e,n),d=u?{transformedValue:u.value,annotations:[u.type]}:{transformedValue:e};return l||s.set(e,d),d}if(yg(i,e))return{transformedValue:null};var h=S5(e,n),p=(a=h==null?void 0:h.value)!==null&&a!==void 0?a:e,m=xa(p)?[]:{},v={};tu(p,function(w,C){var _=E5(w,t,n,r,wa(wa([],Ds(o)),[C]),wa(wa([],Ds(i)),[e]),s);m[C]=_.transformedValue,xa(_.annotations)?v[C]=_.annotations:uf(_.annotations)&&tu(_.annotations,function(k,E){v[g5(C)+"."+E]=k})});var y=ky(v)?{transformedValue:m,annotations:h?[h.type]:void 0}:{transformedValue:m,annotations:h?[h.type,v]:v};return l||s.set(e,y),y};function k5(e){return Object.prototype.toString.call(e).slice(8,-1)}function rj(e){if(k5(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function O5(e){return k5(e)==="Array"}function oj(e,t,n,r,o){const i={}.propertyIsEnumerable.call(r,t)?"enumerable":"nonenumerable";i==="enumerable"&&(e[t]=n),o&&i==="nonenumerable"&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}function Ay(e,t={}){if(O5(e))return e.map(o=>Ay(o,t));if(!rj(e))return e;const n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertySymbols(e);return[...n,...r].reduce((o,i)=>{if(O5(t.props)&&!t.props.includes(i))return o;const s=e[i],a=Ay(s,t);return oj(o,i,a,e,t.nonenumerable),o},{})}var $l=function(){return $l=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},$l.apply(this,arguments)},ij=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,i=[],s;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return i},sj=function(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e},P5=function(){function e(t){var n=t===void 0?{}:t,r=n.dedupe,o=r===void 0?!1:r;this.classRegistry=new M6,this.symbolRegistry=new u5(function(i){var s;return(s=i.description)!==null&&s!==void 0?s:""}),this.customTransformerRegistry=new I6,this.allowedErrorProps=[],this.dedupe=o}return e.prototype.serialize=function(t){var n=new Map,r=E5(t,n,this,this.dedupe),o={json:r.transformedValue};r.annotations&&(o.meta=$l($l({},o.meta),{values:r.annotations}));var i=nj(n,this.dedupe);return i&&(o.meta=$l($l({},o.meta),{referentialEqualities:i})),o},e.prototype.deserialize=function(t){var n=t.json,r=t.meta,o=Ay(n);return r!=null&&r.values&&(o=Z6(o,r.values,this)),r!=null&&r.referentialEqualities&&(o=J6(o,r.referentialEqualities)),o},e.prototype.stringify=function(t){return JSON.stringify(this.serialize(t))},e.prototype.parse=function(t){return this.deserialize(JSON.parse(t))},e.prototype.registerClass=function(t,n){this.classRegistry.register(t,n)},e.prototype.registerSymbol=function(t,n){this.symbolRegistry.register(t,n)},e.prototype.registerCustom=function(t,n){this.customTransformerRegistry.register($l({name:n},t))},e.prototype.allowErrorProps=function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];(t=this.allowedErrorProps).push.apply(t,sj([],ij(n)))},e.defaultInstance=new e,e.serialize=e.defaultInstance.serialize.bind(e.defaultInstance),e.deserialize=e.defaultInstance.deserialize.bind(e.defaultInstance),e.stringify=e.defaultInstance.stringify.bind(e.defaultInstance),e.parse=e.defaultInstance.parse.bind(e.defaultInstance),e.registerClass=e.defaultInstance.registerClass.bind(e.defaultInstance),e.registerSymbol=e.defaultInstance.registerSymbol.bind(e.defaultInstance),e.registerCustom=e.defaultInstance.registerCustom.bind(e.defaultInstance),e.allowErrorProps=e.defaultInstance.allowErrorProps.bind(e.defaultInstance),e}(),aj=P5.serialize,lj=P5.stringify;function ru(e){return e.state.fetchStatus==="fetching"?"fetching":e.getObserversCount()?e.state.fetchStatus==="paused"?"paused":e.isStale()?"stale":"fresh":"inactive"}function cj(e,t){return`${e}${t.charAt(0).toUpperCase()+t.slice(1)}`}function uj({queryState:e,observerCount:t,isStale:n}){return e.fetchStatus==="fetching"?"blue":t?e.fetchStatus==="paused"?"purple":n?"yellow":"green":"gray"}function ou({status:e,isPaused:t}){return t?"purple":e==="error"?"red":e==="pending"?"yellow":e==="success"?"green":"gray"}function dj(e){return e==="fresh"?"green":e==="stale"?"yellow":e==="paused"?"purple":e==="inactive"?"gray":"blue"}var wg=(e,t=!1)=>{const{json:n}=aj(e);return JSON.stringify(n,null,t?2:void 0)},Sg=e=>e.state.fetchStatus!=="idle"?0:e.getObserversCount()?e.isStale()?2:1:3,fj=(e,t)=>e.queryHash.localeCompare(t.queryHash),D5=(e,t)=>e.state.dataUpdatedAt<t.state.dataUpdatedAt?1:-1,hj=(e,t)=>Sg(e)===Sg(t)?D5(e,t):Sg(e)>Sg(t)?1:-1,Iy={status:hj,"query hash":fj,"last updated":D5},Cg=e=>e.state.isPaused?0:e.state.status==="error"?2:e.state.status==="pending"?1:3,M5=(e,t)=>e.state.submittedAt<t.state.submittedAt?1:-1,pj=(e,t)=>Cg(e)===Cg(t)?M5(e,t):Cg(e)>Cg(t)?1:-1,Ny={status:pj,"last updated":M5},$5=e=>e*parseFloat(getComputedStyle(document.documentElement).fontSize),gj=()=>{const[e,t]=qe("dark");return Ml(()=>{const n=window.matchMedia("(prefers-color-scheme: dark)");t(n.matches?"dark":"light");const r=o=>{t(o.matches?"dark":"light")};n.addEventListener("change",r),pt(()=>n.removeEventListener("change",r))}),e},Tl=(e,t,n)=>{if(t.length===0)return n;if(e instanceof Map){const r=new Map(e);if(t.length===1)return r.set(t[0],n),r;const[o,...i]=t;return r.set(o,Tl(r.get(o),i,n)),r}if(e instanceof Set){const r=Tl(Array.from(e),t,n);return new Set(r)}if(Array.isArray(e)){const r=[...e];if(t.length===1)return r[t[0]]=n,r;const[o,...i]=t;return r[o]=Tl(r[o],i,n),r}if(e instanceof Object){const r={...e};if(t.length===1)return r[t[0]]=n,r;const[o,...i]=t;return r[o]=Tl(r[o],i,n),r}return e},pf=(e,t)=>{if(e instanceof Map){const n=new Map(e);if(t.length===1)return n.delete(t[0]),n;const[r,...o]=t;return n.set(r,pf(n.get(r),o)),n}if(e instanceof Set){const n=pf(Array.from(e),t);return new Set(n)}if(Array.isArray(e)){const n=[...e];if(t.length===1)return n.filter((i,s)=>s.toString()!==t[0]);const[r,...o]=t;return n[r]=pf(n[r],o),n}if(e instanceof Object){const n={...e};if(t.length===1)return delete n[t[0]],n;const[r,...o]=t;return n[r]=pf(n[r],o),n}return e},mj=e=>{if(!e||document.querySelector("#_goober"))return;const n=document.createElement("style"),r=document.createTextNode("");n.appendChild(r),n.id="_goober",n.setAttribute("nonce",e),document.head.appendChild(n)},vj=(w8=class{constructor(e){Ge(this,Od,void 0);Ge(this,kp,void 0);Ge(this,Op,void 0);Ge(this,Pp,void 0);Ge(this,Nc,!1);Ge(this,Dp,void 0);Ge(this,Pd,void 0);Ge(this,Dd,void 0);Ge(this,Md,void 0);Ge(this,$d,void 0);Ge(this,Td,void 0);Ge(this,Mp,void 0);const{client:t,queryFlavor:n,version:r,onlineManager:o,buttonPosition:i,position:s,initialIsOpen:a,errorTypes:l,styleNonce:c}=e;je(this,Od,qe(t)),je(this,Op,n),je(this,Pp,r),je(this,kp,o),je(this,Dp,c),je(this,Pd,qe(i)),je(this,Dd,qe(s)),je(this,Md,qe(a)),je(this,$d,qe(l))}setButtonPosition(e){ee(this,Pd)[1](e)}setPosition(e){ee(this,Dd)[1](e)}setInitialIsOpen(e){ee(this,Md)[1](e)}setErrorTypes(e){ee(this,$d)[1](e)}setClient(e){ee(this,Od)[1](e)}mount(e){if(ee(this,Nc))throw new Error("Devtools is already mounted");const t=v6(()=>{const[n]=ee(this,Pd),[r]=ee(this,Dd),[o]=ee(this,Md),[i]=ee(this,$d),[s]=ee(this,Od);let a;ee(this,Td)?a=ee(this,Td):(a=r6(()=>Promise.resolve().then(()=>Zbe)),je(this,Td,a)),mj(ee(this,Dp));const l=this;return Q(a,Pt({get queryFlavor(){return ee(l,Op)},get version(){return ee(l,Pp)},get onlineManager(){return ee(l,kp)}},{get client(){return s()},get buttonPosition(){return n()},get position(){return r()},get initialIsOpen(){return o()},get errorTypes(){return i()}}))},e);je(this,Nc,!0),je(this,Mp,t)}unmount(){var e;if(!ee(this,Nc))throw new Error("Devtools is not mounted");(e=ee(this,Mp))==null||e.call(this),je(this,Nc,!1)}},Od=new WeakMap,kp=new WeakMap,Op=new WeakMap,Pp=new WeakMap,Nc=new WeakMap,Dp=new WeakMap,Pd=new WeakMap,Dd=new WeakMap,Md=new WeakMap,$d=new WeakMap,Td=new WeakMap,Mp=new WeakMap,w8);function bj(e){const t=HE(),n=e.client||t,r=he.useRef(null),{buttonPosition:o,position:i,initialIsOpen:s,errorTypes:a,styleNonce:l}=e,[c]=he.useState(new vj({client:n,queryFlavor:"React Query",version:"5",onlineManager:sf,buttonPosition:o,position:i,initialIsOpen:s,errorTypes:a,styleNonce:l}));return he.useEffect(()=>{c.setClient(n)},[n,c]),he.useEffect(()=>{o&&c.setButtonPosition(o)},[o,c]),he.useEffect(()=>{i&&c.setPosition(i)},[i,c]),he.useEffect(()=>{c.setInitialIsOpen(s||!1)},[s,c]),he.useEffect(()=>{c.setErrorTypes(a||[])},[a,c]),he.useEffect(()=>(r.current&&c.mount(r.current),()=>{c.unmount()}),[c]),he.createElement("div",{className:"tsqd-parent-container",ref:r})}var yj=process.env.NODE_ENV!=="development"?function(){return null}:bj;const xj={id:"",authToken:void 0},T5=b.createContext(xj),A5=({children:e,dashboardProps:t})=>x.jsxs(UE,{children:[x.jsx(T5.Provider,{value:t,children:e}),x.jsx(yj,{initialIsOpen:!1})]});function Vi(){const e=b.useContext(T5);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}function I5(e,t){var xe;let n=b.useMemo(()=>[],[]);const r=Vi().authToken||e,o=be(K=>K.selectedConnectionId),i=be(K=>K.selectedDatabaseName),s=be(K=>K.selectedSchemaName),a=be(K=>K.selectedTableName),l=be(K=>K.actions.setCurrentColumns),c=be(K=>K.actions.setSelectedConnectionId),u=be(K=>K.actions.setSelectedDatabaseName),d=be(K=>K.actions.setSelectedSchemaName),h=be(K=>K.actions.setSelectedTableName),p=be(K=>K.actions.setCardSql),{data:m,isLoading:v,isError:y}=yi({queryKey:["connections"],queryFn:()=>Gc("https://semaphor.cloud/api/v1/connections",(r==null?void 0:r.accessToken)||""),enabled:!!(r!=null&&r.accessToken)}),w=m==null?void 0:m.connections.find(K=>K.id===o),C=(w==null?void 0:w.type)==="API"||(w==null?void 0:w.type)==="S3",{data:_,isLoading:k,isFetching:E,isError:P,refetch:D}=yi({queryKey:[o],queryFn:()=>Gc("https://semaphor.cloud/api/v1/databases",(r==null?void 0:r.accessToken)||"",{connection_id:o}),enabled:!!o&&!C}),{data:M,isLoading:I,isFetching:F,isError:R,refetch:B}=yi({queryKey:[o,i],queryFn:()=>Gc("https://semaphor.cloud/api/v1/schemas",(r==null?void 0:r.accessToken)||"",{connection_id:o,database_name:i}),enabled:!!o&&!!i&&!C}),{data:ie,isLoading:q,isFetching:z,isError:X,refetch:U}=yi({queryKey:[o,i,s],queryFn:()=>Gc("https://semaphor.cloud/api/v1/tables",(r==null?void 0:r.accessToken)||"",{connection_id:o,database_name:i,schema_name:s}),enabled:!!o&&!!i&&!!s&&!C}),{data:Z,isLoading:G,isFetching:$,isError:H}=yi({queryKey:[o,i,s,a],queryFn:()=>Gc("https://semaphor.cloud/api/v1/columns",(r==null?void 0:r.accessToken)||"",{connection_id:o,database_name:i,schema_name:s,table_name:a}),enabled:!!o&&!!i&&!!s&&!!a||C});b.useEffect(()=>{l(n)},[Z,l,n]),b.useEffect(()=>{var K;C&&(u("NA"),d("NA"),h((K=w==null?void 0:w.type)==null?void 0:K.toLowerCase()))},[C,p,h,d,u,w]);const re=C?(xe=w==null?void 0:w.type)==null?void 0:xe.toLowerCase():a||"",N=C?"":s||"";function V(K){d(K),h("")}function ue(K){u(K),d(""),h("")}function ce(K){c(K)}_&&_.databases.length>0,M&&M.schemas.length>0,Z&&Z.columns.length>0&&(n=Z.columns.map(K=>({...K,data_type:K.data_type.toLowerCase()}))),P&&(n=[]),(H||y)&&(n=[]);const pe=m==null?void 0:m.connections.map(K=>({id:K.id,name:K.name,type:K.type})),se=_==null?void 0:_.databases.map(K=>({id:K.database_name,name:K.database_name})),ne=M==null?void 0:M.schemas.map(K=>({id:K.schema_name,name:K.schema_name})),le=ie==null?void 0:ie.tables.map(K=>({id:K.table_name,name:K.table_name}));return{connectionItems:pe,isConnectionsLoading:v,isConnectionsError:y,databaseItems:se,isDatabasesLoadingOrFetching:k||E,isDatabaseError:P,schemaItems:ne,isSchemaLoadingOrFetching:I||F,isSchemaError:R,tableItems:le,isTableLoadingOrFetching:q||z,isTableError:X,columns:n,isColumnsLoadingOrFetching:G||$,isColumnsError:H,isAPIConnection:C,tableName:re,schemaName:N,handleConnectionChange:ce,handleDatabaseChange:ue,handleSchemaChange:V}}const wj=e=>{const t=new Date(e);return!isNaN(t.getTime())},Sj=e=>!isNaN(Number(e))&&!isNaN(parseFloat(e)),_g=e=>{let t;return typeof e=="number"?t="number":typeof e=="string"?wj(e)?t="date":Sj(e)?t="number":t="string":typeof e=="boolean"?t="boolean":e instanceof Date?t="date":t="unknown",t};function Cj({get:e,dataPoint:t,card:n}){var h;const{addOrUpdateFilterValue:r,addFilteringCard:o,removeFilterValue: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:_g(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)}var Eg={exports:{}};/**
60
60
  * @license
61
61
  * Lodash <https://lodash.com/>
62
62
  * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
@@ -82,7 +82,7 @@ __p += '`),Ut&&(Oe+=`' +
82
82
  function print() { __p += __j.call(arguments, '') }
83
83
  `:`;
84
84
  `)+Oe+`return __p
85
- }`;var Nt=qL(function(){return nn(j,rt+"return "+Oe).apply(n,W)});if(Nt.source=Oe,E2(Nt))throw Nt;return Nt}function h_e(f){return un(f).toLowerCase()}function p_e(f){return un(f).toUpperCase()}function g_e(f,g,S){if(f=un(f),f&&(S||g===n))return J8(f);if(!f||!(g=jo(g)))return f;var O=Li(f),A=Li(g),j=eN(O,A),W=tN(O,A)+1;return Sl(O,j,W).join("")}function m_e(f,g,S){if(f=un(f),f&&(S||g===n))return f.slice(0,rN(f)+1);if(!f||!(g=jo(g)))return f;var O=Li(f),A=tN(O,Li(g))+1;return Sl(O,0,A).join("")}function v_e(f,g,S){if(f=un(f),f&&(S||g===n))return f.replace(Ss,"");if(!f||!(g=jo(g)))return f;var O=Li(f),A=eN(O,Li(g));return Sl(O,A).join("")}function b_e(f,g){var S=F,O=R;if(zn(g)){var A="separator"in g?g.separator:A;S="length"in g?Tt(g.length):S,O="omission"in g?jo(g.omission):O}f=un(f);var j=f.length;if(Nd(f)){var W=Li(f);j=W.length}if(S>=j)return f;var J=S-Ld(O);if(J<1)return O;var ae=W?Sl(W,0,J).join(""):f.slice(0,J);if(A===n)return ae+O;if(W&&(J+=ae.length-J),k2(A)){if(f.slice(J).search(A)){var we,Se=ae;for(A.global||(A=V_(A.source,un(it.exec(A))+"g")),A.lastIndex=0;we=A.exec(Se);)var Oe=we.index;ae=ae.slice(0,Oe===n?J:Oe)}}else if(f.indexOf(jo(A),J)!=J){var Ve=ae.lastIndexOf(A);Ve>-1&&(ae=ae.slice(0,Ve))}return ae+O}function y_e(f){return f=un(f),f&&ci.test(f)?f.replace(Kn,Kye):f}var x_e=Hd(function(f,g,S){return f+(S?" ":"")+g.toUpperCase()}),D2=WN("toUpperCase");function HL(f,g,S){return f=un(f),g=S?n:g,g===n?Hye(f)?Qye(f):Iye(f):f.match(g)||[]}var qL=Ft(function(f,g){try{return Fo(f,n,g)}catch(S){return E2(S)?S:new wt(S)}}),w_e=ua(function(f,g){return di(g,function(S){S=Es(S),la(f,S,C2(f[S],f))}),f});function S_e(f){var g=f==null?0:f.length,S=ct();return f=g?Ln(f,function(O){if(typeof O[1]!="function")throw new fi(s);return[S(O[0]),O[1]]}):[],Ft(function(O){for(var A=-1;++A<g;){var j=f[A];if(Fo(j[0],this,O))return Fo(j[1],this,O)}})}function C_e(f){return K1e(pi(f,d))}function M2(f){return function(){return f}}function __e(f,g){return f==null||f!==f?g:f}var E_e=GN(),k_e=GN(!0);function ho(f){return f}function $2(f){return CN(typeof f=="function"?f:pi(f,d))}function O_e(f){return EN(pi(f,d))}function P_e(f,g){return kN(f,pi(g,d))}var D_e=Ft(function(f,g){return function(S){return jp(S,f,g)}}),M_e=Ft(function(f,g){return function(S){return jp(f,S,g)}});function T2(f,g,S){var O=vr(g),A=pb(g,O);S==null&&!(zn(g)&&(A.length||!O.length))&&(S=g,g=f,f=this,A=pb(g,vr(g)));var j=!(zn(S)&&"chain"in S)||!!S.chain,W=fa(f);return di(A,function(J){var ae=g[J];f[J]=ae,W&&(f.prototype[J]=function(){var we=this.__chain__;if(j||we){var Se=f(this.__wrapped__),Oe=Se.__actions__=co(this.__actions__);return Oe.push({func:ae,args:arguments,thisArg:f}),Se.__chain__=we,Se}return ae.apply(f,ml([this.value()],arguments))})}),f}function $_e(){return Er._===this&&(Er._=r1e),this}function A2(){}function T_e(f){return f=Tt(f),Ft(function(g){return ON(g,f)})}var A_e=u2(Ln),I_e=u2(K8),N_e=u2(N_);function WL(f){return v2(f)?L_(Es(f)):dxe(f)}function L_e(f){return function(g){return f==null?n:Vc(f,g)}}var F_e=YN(),R_e=YN(!0);function I2(){return[]}function N2(){return!1}function j_e(){return{}}function z_e(){return""}function B_e(){return!0}function V_e(f,g){if(f=Tt(f),f<1||f>Z)return[];var S=H,O=Fr(f,H);g=ct(g),f-=H;for(var A=j_(O,g);++S<f;)g(S);return A}function H_e(f){return kt(f)?Ln(f,Es):zo(f)?[f]:co(dL(un(f)))}function q_e(f){var g=++t1e;return un(f)+g}var W_e=xb(function(f,g){return f+g},0),U_e=d2("ceil"),G_e=xb(function(f,g){return f/g},1),K_e=d2("floor");function Y_e(f){return f&&f.length?hb(f,ho,X_):n}function X_e(f,g){return f&&f.length?hb(f,ct(g,2),X_):n}function Q_e(f){return Q8(f,ho)}function Z_e(f,g){return Q8(f,ct(g,2))}function J_e(f){return f&&f.length?hb(f,ho,e2):n}function e2e(f,g){return f&&f.length?hb(f,ct(g,2),e2):n}var t2e=xb(function(f,g){return f*g},1),n2e=d2("round"),r2e=xb(function(f,g){return f-g},0);function o2e(f){return f&&f.length?R_(f,ho):0}function i2e(f,g){return f&&f.length?R_(f,ct(g,2)):0}return L.after=OSe,L.ary=SL,L.assign=pCe,L.assignIn=LL,L.assignInWith=Ab,L.assignWith=gCe,L.at=mCe,L.before=CL,L.bind=C2,L.bindAll=w_e,L.bindKey=_L,L.castArray=jSe,L.chain=yL,L.chunk=Kxe,L.compact=Yxe,L.concat=Xxe,L.cond=S_e,L.conforms=C_e,L.constant=M2,L.countBy=oSe,L.create=vCe,L.curry=EL,L.curryRight=kL,L.debounce=OL,L.defaults=bCe,L.defaultsDeep=yCe,L.defer=PSe,L.delay=DSe,L.difference=Qxe,L.differenceBy=Zxe,L.differenceWith=Jxe,L.drop=ewe,L.dropRight=twe,L.dropRightWhile=nwe,L.dropWhile=rwe,L.fill=owe,L.filter=sSe,L.flatMap=cSe,L.flatMapDeep=uSe,L.flatMapDepth=dSe,L.flatten=gL,L.flattenDeep=iwe,L.flattenDepth=swe,L.flip=MSe,L.flow=E_e,L.flowRight=k_e,L.fromPairs=awe,L.functions=kCe,L.functionsIn=OCe,L.groupBy=fSe,L.initial=cwe,L.intersection=uwe,L.intersectionBy=dwe,L.intersectionWith=fwe,L.invert=DCe,L.invertBy=MCe,L.invokeMap=pSe,L.iteratee=$2,L.keyBy=gSe,L.keys=vr,L.keysIn=fo,L.map=Ob,L.mapKeys=TCe,L.mapValues=ACe,L.matches=O_e,L.matchesProperty=P_e,L.memoize=Db,L.merge=ICe,L.mergeWith=FL,L.method=D_e,L.methodOf=M_e,L.mixin=T2,L.negate=Mb,L.nthArg=T_e,L.omit=NCe,L.omitBy=LCe,L.once=$Se,L.orderBy=mSe,L.over=A_e,L.overArgs=TSe,L.overEvery=I_e,L.overSome=N_e,L.partial=_2,L.partialRight=PL,L.partition=vSe,L.pick=FCe,L.pickBy=RL,L.property=WL,L.propertyOf=L_e,L.pull=mwe,L.pullAll=vL,L.pullAllBy=vwe,L.pullAllWith=bwe,L.pullAt=ywe,L.range=F_e,L.rangeRight=R_e,L.rearg=ASe,L.reject=xSe,L.remove=xwe,L.rest=ISe,L.reverse=w2,L.sampleSize=SSe,L.set=jCe,L.setWith=zCe,L.shuffle=CSe,L.slice=wwe,L.sortBy=kSe,L.sortedUniq=Pwe,L.sortedUniqBy=Dwe,L.split=c_e,L.spread=NSe,L.tail=Mwe,L.take=$we,L.takeRight=Twe,L.takeRightWhile=Awe,L.takeWhile=Iwe,L.tap=Ywe,L.throttle=LSe,L.thru=kb,L.toArray=AL,L.toPairs=jL,L.toPairsIn=zL,L.toPath=H_e,L.toPlainObject=NL,L.transform=BCe,L.unary=FSe,L.union=Nwe,L.unionBy=Lwe,L.unionWith=Fwe,L.uniq=Rwe,L.uniqBy=jwe,L.uniqWith=zwe,L.unset=VCe,L.unzip=S2,L.unzipWith=bL,L.update=HCe,L.updateWith=qCe,L.values=Ud,L.valuesIn=WCe,L.without=Bwe,L.words=HL,L.wrap=RSe,L.xor=Vwe,L.xorBy=Hwe,L.xorWith=qwe,L.zip=Wwe,L.zipObject=Uwe,L.zipObjectDeep=Gwe,L.zipWith=Kwe,L.entries=jL,L.entriesIn=zL,L.extend=LL,L.extendWith=Ab,T2(L,L),L.add=W_e,L.attempt=qL,L.camelCase=YCe,L.capitalize=BL,L.ceil=U_e,L.clamp=UCe,L.clone=zSe,L.cloneDeep=VSe,L.cloneDeepWith=HSe,L.cloneWith=BSe,L.conformsTo=qSe,L.deburr=VL,L.defaultTo=__e,L.divide=G_e,L.endsWith=XCe,L.eq=Ri,L.escape=QCe,L.escapeRegExp=ZCe,L.every=iSe,L.find=aSe,L.findIndex=hL,L.findKey=xCe,L.findLast=lSe,L.findLastIndex=pL,L.findLastKey=wCe,L.floor=K_e,L.forEach=xL,L.forEachRight=wL,L.forIn=SCe,L.forInRight=CCe,L.forOwn=_Ce,L.forOwnRight=ECe,L.get=O2,L.gt=WSe,L.gte=USe,L.has=PCe,L.hasIn=P2,L.head=mL,L.identity=ho,L.includes=hSe,L.indexOf=lwe,L.inRange=GCe,L.invoke=$Ce,L.isArguments=Wc,L.isArray=kt,L.isArrayBuffer=GSe,L.isArrayLike=uo,L.isArrayLikeObject=Yn,L.isBoolean=KSe,L.isBuffer=Cl,L.isDate=YSe,L.isElement=XSe,L.isEmpty=QSe,L.isEqual=ZSe,L.isEqualWith=JSe,L.isError=E2,L.isFinite=eCe,L.isFunction=fa,L.isInteger=DL,L.isLength=$b,L.isMap=ML,L.isMatch=tCe,L.isMatchWith=nCe,L.isNaN=rCe,L.isNative=oCe,L.isNil=sCe,L.isNull=iCe,L.isNumber=$L,L.isObject=zn,L.isObjectLike=Wn,L.isPlainObject=Wp,L.isRegExp=k2,L.isSafeInteger=aCe,L.isSet=TL,L.isString=Tb,L.isSymbol=zo,L.isTypedArray=Wd,L.isUndefined=lCe,L.isWeakMap=cCe,L.isWeakSet=uCe,L.join=hwe,L.kebabCase=JCe,L.last=mi,L.lastIndexOf=pwe,L.lowerCase=e_e,L.lowerFirst=t_e,L.lt=dCe,L.lte=fCe,L.max=Y_e,L.maxBy=X_e,L.mean=Q_e,L.meanBy=Z_e,L.min=J_e,L.minBy=e2e,L.stubArray=I2,L.stubFalse=N2,L.stubObject=j_e,L.stubString=z_e,L.stubTrue=B_e,L.multiply=t2e,L.nth=gwe,L.noConflict=$_e,L.noop=A2,L.now=Pb,L.pad=n_e,L.padEnd=r_e,L.padStart=o_e,L.parseInt=i_e,L.random=KCe,L.reduce=bSe,L.reduceRight=ySe,L.repeat=s_e,L.replace=a_e,L.result=RCe,L.round=n2e,L.runInContext=oe,L.sample=wSe,L.size=_Se,L.snakeCase=l_e,L.some=ESe,L.sortedIndex=Swe,L.sortedIndexBy=Cwe,L.sortedIndexOf=_we,L.sortedLastIndex=Ewe,L.sortedLastIndexBy=kwe,L.sortedLastIndexOf=Owe,L.startCase=u_e,L.startsWith=d_e,L.subtract=r2e,L.sum=o2e,L.sumBy=i2e,L.template=f_e,L.times=V_e,L.toFinite=ha,L.toInteger=Tt,L.toLength=IL,L.toLower=h_e,L.toNumber=vi,L.toSafeInteger=hCe,L.toString=un,L.toUpper=p_e,L.trim=g_e,L.trimEnd=m_e,L.trimStart=v_e,L.truncate=b_e,L.unescape=y_e,L.uniqueId=q_e,L.upperCase=x_e,L.upperFirst=D2,L.each=xL,L.eachRight=wL,L.first=mL,T2(L,function(){var f={};return Cs(L,function(g,S){hn.call(L.prototype,S)||(f[S]=g)}),f}(),{chain:!1}),L.VERSION=r,di(["bind","bindKey","curry","curryRight","partial","partialRight"],function(f){L[f].placeholder=L}),di(["drop","take"],function(f,g){qt.prototype[f]=function(S){S=S===n?1:dr(Tt(S),0);var O=this.__filtered__&&!g?new qt(this):this.clone();return O.__filtered__?O.__takeCount__=Fr(S,O.__takeCount__):O.__views__.push({size:Fr(S,H),type:f+(O.__dir__<0?"Right":"")}),O},qt.prototype[f+"Right"]=function(S){return this.reverse()[f](S).reverse()}}),di(["filter","map","takeWhile"],function(f,g){var S=g+1,O=S==q||S==X;qt.prototype[f]=function(A){var j=this.clone();return j.__iteratees__.push({iteratee:ct(A,3),type:S}),j.__filtered__=j.__filtered__||O,j}}),di(["head","last"],function(f,g){var S="take"+(g?"Right":"");qt.prototype[f]=function(){return this[S](1).value()[0]}}),di(["initial","tail"],function(f,g){var S="drop"+(g?"":"Right");qt.prototype[f]=function(){return this.__filtered__?new qt(this):this[S](1)}}),qt.prototype.compact=function(){return this.filter(ho)},qt.prototype.find=function(f){return this.filter(f).head()},qt.prototype.findLast=function(f){return this.reverse().find(f)},qt.prototype.invokeMap=Ft(function(f,g){return typeof f=="function"?new qt(this):this.map(function(S){return jp(S,f,g)})}),qt.prototype.reject=function(f){return this.filter(Mb(ct(f)))},qt.prototype.slice=function(f,g){f=Tt(f);var S=this;return S.__filtered__&&(f>0||g<0)?new qt(S):(f<0?S=S.takeRight(-f):f&&(S=S.drop(f)),g!==n&&(g=Tt(g),S=g<0?S.dropRight(-g):S.take(g-f)),S)},qt.prototype.takeRightWhile=function(f){return this.reverse().takeWhile(f).reverse()},qt.prototype.toArray=function(){return this.take(H)},Cs(qt.prototype,function(f,g){var S=/^(?:filter|find|map|reject)|While$/.test(g),O=/^(?:head|last)$/.test(g),A=L[O?"take"+(g=="last"?"Right":""):g],j=O||/^find/.test(g);A&&(L.prototype[g]=function(){var W=this.__wrapped__,J=O?[1]:arguments,ae=W instanceof qt,we=J[0],Se=ae||kt(W),Oe=function(Ht){var Ut=A.apply(L,ml([Ht],J));return O&&Ve?Ut[0]:Ut};Se&&S&&typeof we=="function"&&we.length!=1&&(ae=Se=!1);var Ve=this.__chain__,rt=!!this.__actions__.length,dt=j&&!Ve,Nt=ae&&!rt;if(!j&&Se){W=Nt?W:new qt(this);var ft=f.apply(W,J);return ft.__actions__.push({func:kb,args:[Oe],thisArg:n}),new hi(ft,Ve)}return dt&&Nt?f.apply(this,J):(ft=this.thru(Oe),dt?O?ft.value()[0]:ft.value():ft)})}),di(["pop","push","shift","sort","splice","unshift"],function(f){var g=Zv[f],S=/^(?:push|sort|unshift)$/.test(f)?"tap":"thru",O=/^(?:pop|shift)$/.test(f);L.prototype[f]=function(){var A=arguments;if(O&&!this.__chain__){var j=this.value();return g.apply(kt(j)?j:[],A)}return this[S](function(W){return g.apply(kt(W)?W:[],A)})}}),Cs(qt.prototype,function(f,g){var S=L[g];if(S){var O=S.name+"";hn.call(zd,O)||(zd[O]=[]),zd[O].push({name:g,func:S})}}),zd[yb(n,w).name]=[{name:"wrapper",func:n}],qt.prototype.clone=y1e,qt.prototype.reverse=x1e,qt.prototype.value=w1e,L.prototype.at=Xwe,L.prototype.chain=Qwe,L.prototype.commit=Zwe,L.prototype.next=Jwe,L.prototype.plant=tSe,L.prototype.reverse=nSe,L.prototype.toJSON=L.prototype.valueOf=L.prototype.value=rSe,L.prototype.first=L.prototype.head,Tp&&(L.prototype[Tp]=eSe),L},Fd=Zye();Fc?((Fc.exports=Fd)._=Fd,$_._=Fd):Er._=Fd}).call(ma)}(Eg,Eg.exports);var iu=Eg.exports;const Sa=Gd(iu),N5=["lg","md","sm","xs","xxs"],me=dE()(CE((e,t)=>({currentBreakpoint:"lg",dashboard:{id:"",style:oy},showContext:!1,selectedSheetId:null,selectedCardId:null,selectedFrameId:null,selectedCard:null,showFilters:!1,isDashboardEditing:!0,isVisualEditing:!1,showDashboardJSON:!1,filteringCards:[],actions:{setCardPython:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===o.selectedSheetId);i&&iu.forEach(i.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(d=>d.id===n);c&&(c.python=r)})})},addBaseQuery:n=>{e(r=>{var o;r.dashboard.baseQueries||(r.dashboard.baseQueries=[]),(o=r.dashboard.baseQueries)==null||o.push(n)})},removeBaseQuery:n=>{e(r=>{var i,s;const o=(i=r.dashboard.baseQueries)==null?void 0:i.findIndex(a=>a.id===n);o!=null&&o>-1&&((s=r.dashboard.baseQueries)==null||s.splice(o,1))})},setBaseQueries:n=>{e(r=>{r.dashboard.baseQueries=n})},setCurrentBreakpoint:n=>{e(()=>({currentBreakpoint:n}))},addFilteringCard:n=>{e(r=>{var o;(o=r.filteringCards)==null||o.push(n)})},removeFilteringCard:n=>{e(r=>{var i,s;const o=(i=r.filteringCards)==null?void 0:i.findIndex(a=>a.id===n.id);o!==void 0&&o>-1&&((s=r.filteringCards)==null||s.splice(o,1))})},setCustomCards:n=>{e(r=>{r.dashboard.customCards=n})},setAuthToken:n=>{e(()=>({authToken:n}))},setThemeStyle:n=>{e(()=>({themeStyle:n}))},setDashboard:n=>e({dashboard:n}),setBookmarkKey:n=>{e(()=>({bookmarkKey:n}))},setDashboardTheme:n=>{e(r=>{r.theme=n})},setSheets:n=>{e(r=>{r.dashboard&&(r.dashboard.sheets=n)})},setCardTitle:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&iu.forEach(s.frames,c=>{var d;const u=(d=c.cards)==null?void 0:d.find(h=>h.id===r);u&&(u.title=o)})})},setCardInfo:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===o.selectedSheetId);i&&iu.forEach(i.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(d=>d.id===n);c&&(c.info=r)})})},setCardDescription:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&iu.forEach(s.frames,c=>{var d;const u=(d=c.cards)==null?void 0:d.find(h=>h.id===r);u&&(u.description=o)})})},setCardSql:(n,r,o)=>{e(i=>{var a,l,c,u;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(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))}})},setFrameCardData:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&iu.forEach(s.frames,c=>{var d;const u=(d=c.cards)==null?void 0:d.find(h=>h.id===r);u&&(u.data=o)})})},setSheetLayout:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layout=r)})},setSheetLayouts:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layouts=r)})},setShowContext:n=>{e(()=>({showContext:n}))},setShowFilters:n=>{e(()=>({showFilters:n}))},setFilterValues:n=>{e(()=>({filterValues:n}))},addOrUpdateFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1?r.filterValues.splice(o,1,n):r.filterValues.push(n)}else r.filterValues=[n]})},addOrUpdateFilterValues:n=>{e(r=>{r.filterValues?n.forEach(o=>{var s,a,l;const i=(s=r==null?void 0:r.filterValues)==null?void 0:s.findIndex(c=>c.filterId===o.filterId);i&&i>-1?(a=r.filterValues)==null||a.splice(i,1,o):(l=r.filterValues)==null||l.push(o)}):r.filterValues=n})},removeFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.filter(i=>i.filterId!==n&&!i.filterId.startsWith(n));r.filterValues=o}})},replaceFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1&&r.filterValues.splice(o,1,n)}})},addFilter:n=>{e(r=>{var o;r.dashboard.filters?(o=r.dashboard.filters)==null||o.push(n):r.dashboard.filters=[n]})},removeFilter:n=>{e(r=>{var o,i;if(r.dashboard.filters){const s=(o=r.dashboard.filters)==null?void 0:o.findIndex(a=>a.id===n);console.log("index",s),s>-1&&((i=r.dashboard.filters)==null||i.splice(s,1))}})},updateFrameCard:(n,r,o)=>{e(i=>{var l,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(m=>m.id===o.id);p>-1&&((h=a.cards)==null||h.splice(p,1,o))}})},updateFilter:n=>{e(r=>{var o,i;if(r.dashboard.filters){const s=(o=r.dashboard.filters)==null?void 0:o.findIndex(a=>a.id===n.id);s>-1&&((i=r.dashboard.filters)==null||i.splice(s,1,n))}})},setIsDashboardEditing:n=>{e(()=>({isDashboardEditing:n}))},setShowDashboardJSON:n=>{e(()=>({showDashboardJSON:n}))},setIsVisualEditing:n=>{e(()=>({isVisualEditing:n}))},addFrame:(n,r)=>{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){i.frames||(i.frames=[]),(l=i.frames)==null||l.push(r);const d={i:r.id,x:0,y:1/0,w:20,h:7,minW:6,minH:2};(c=i.layout)==null||c.push(d),i!=null&&i.layouts||(i.layouts={}),N5.forEach(h=>{i.layouts[h]||(i.layouts[h]=[]),i.layouts[h].push(d)}),(u=o.onAddFrame)==null||u.call(o,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),i.layouts=N5.reduce((h,p)=>{if(h&&h[p]){const m=h[p].findIndex(v=>v.i===r);typeof m=="number"&&m>-1&&h[p].splice(m,1)}return h},i.layouts))}})},updateFrame:(n,r)=>{e(o=>{var a,l,c,u;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(d=>d.id===n),s=(c=i==null?void 0:i.frames)==null?void 0:c.findIndex(d=>d.id===r.id);i&&((u=i.frames)==null||u.splice(s,1,r))})},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}))},setOnUpdateCard:n=>{e(()=>({onUpdateCard:n}))},setOnRemoveCard:n=>{e(()=>({onRemoveCard:n}))},setOnEvent:n=>{e(()=>({onEvent:n}))},getDashboard:()=>t().dashboard,getSelectedSheet:()=>{var n,r;return(r=(n=t().dashboard)==null?void 0:n.sheets)==null?void 0:r.find(o=>o.id===t().selectedSheetId)},getSelectedFrame:()=>{var r,o,i;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(s=>s.id===t().selectedSheetId);return(i=n==null?void 0:n.frames)==null?void 0:i.find(s=>s.id===t().selectedFrameId)},getCard:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a)for(let l=0;l<a.length;l++){const 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},handleDataPointClickAction:(n,r)=>{Cj({card:n,dataPoint:r,set:e,get:t})}}}))),Al=()=>me(e=>e.actions);process.env.NODE_ENV==="development"&&EE("DashboardStore",me);const _j={theme:"system",setTheme:()=>null},L5=b.createContext(_j);function Ej({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[o,i]=b.useState(()=>localStorage.getItem(n)||t);b.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 x.jsx(L5.Provider,{...r,value:s,children:e})}const Ly=()=>{const e=b.useContext(L5);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};async function kj(e,t,n){return await(await fetch(`https://semaphor.cloud/api/v1/dashboard?id=${e}&version=${t}`,{headers:{Authorization:`Bearer ${n}`}})).json()}function F5(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function R5(e,t){const n=F5(e);return n==="dark"?Sa.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function j5({id:e,version:t,authToken:n,customStyle:r,currentTheme:o,onSave:i,onEvent:s}){const{data:a,refetch:l,isLoading:c,isError:u}=yi({queryKey:[e],queryFn:()=>kj(e,t||"",n==null?void 0:n.accessToken),enabled:!1}),{theme:d,setTheme:h}=Ly(),{setDashboard:p,setSelectedSheetId:m,setStyle:v,setOnSaveFunction:y}=me(D=>D.actions);me(D=>D.actions.setCustomCards);const w=me(D=>D.actions.setFilterValues),C=me(D=>D.actions.setBookmarkKey),_=me(D=>D.actions.setAuthToken),k=me(D=>D.actions.setThemeStyle),E=me(D=>D.actions.setDashboardTheme),P=me(D=>D.actions.setOnEvent);return b.useEffect(()=>{if(d){const D=F5(d);E(D)}},[d,E]),b.useEffect(()=>{o&&h(o)},[o,h]),b.useEffect(()=>{const D=Sa.cloneDeep(oy);if(r){const M=Sa.merge(D,r),I=R5(d,M);k(I),v(M)}else{const M=R5(d,D);k(M),v(oy)}},[d,r,v,k]),b.useEffect(()=>{var R;if(!a||!a.dashboard)return;const D=a.dashboard,M=Ua(D.id),I=JSON.parse(localStorage.getItem(M)||"[]"),F=I.find(B=>B.default===!0);if(F)p(F.template),C(F.name),F.filterValues&&w(F.filterValues);else{p(D);const B=I.find(ie=>(ie==null?void 0:ie.name)==="Original");B?B.template=D:I.push({name:"Original",template:D,default:!1}),localStorage.setItem(M,JSON.stringify(I))}m((R=D.sheets)==null?void 0:R[0].id)},[a,p,m,w,C]),b.useEffect(()=>{i&&y(i),s&&P(s)},[i,y,s,P]),b.useEffect(()=>{n&&n.accessToken&&(_(n),l())},[n,l,_]),{isLoading:c,isError:u}}function Fy({className:e,...t}){return x.jsx("div",{className:$e("animate-pulse rounded-md bg-muted",e),...t})}function z5({className:e,style:t,onSave:n,onEvent:r,LoadingComponent:o,ErrorComponent:i,onChartElementClicked:s,id:a,authToken:l,currentTheme:c,version:u,customCards:d,...h}){me(w=>w.selectedSheetId);const p=me(w=>w.themeStyle),m=me(w=>w.onEvent),{isLoading:v,isError:y}=j5({id:a,version:u,authToken:l,customStyle:t,currentTheme:c,onSave:n,onEvent:r});return v||!l?(m==null||m({type:"info",message:`isLoading: ${v}, accessToken: ${l==null?void 0:l.accessToken}`}),o?x.jsx(o,{message:"loading"}):x.jsx("div",{className:"flex items-center gap-3",children:x.jsx(Fy,{className:"h-1 w-full dark:h-[2px]"})})):y?(m==null||m({type:"error",message:"Error fetching dashboard"}),i?(console.log("Error fetching dashboard"),x.jsx(i,{})):x.jsx("div",{children:"Error"})):x.jsx("div",{className:$e("flex h-full grow flex-col justify-between",p==null?void 0:p.dashboardPanel,e),role:"dashboard-panel",...h})}function de(){return de=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},de.apply(this,arguments)}function Ie(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 fr(e,t=[]){let n=[];function r(i,s){const a=b.createContext(s),l=n.length;n=[...n,s];function c(d){const{scope:h,children:p,...m}=d,v=(h==null?void 0:h[e][l])||a,y=b.useMemo(()=>m,Object.values(m));return b.createElement(v.Provider,{value:y},p)}function u(d,h){const p=(h==null?void 0:h[e][l])||a,m=b.useContext(p);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const o=()=>{const i=n.map(s=>b.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return b.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,Oj(o,...t)]}function Oj(...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 b.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Pj(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function kg(...e){return t=>e.forEach(n=>Pj(n,t))}function St(...e){return b.useCallback(kg(...e),e)}const Ms=b.forwardRef((e,t)=>{const{children:n,...r}=e,o=b.Children.toArray(n),i=o.find(Dj);if(i){const s=i.props.children,a=o.map(l=>l===i?b.Children.count(s)>1?b.Children.only(null):b.isValidElement(s)?s.props.children:null:l);return b.createElement(Ry,de({},r,{ref:t}),b.isValidElement(s)?b.cloneElement(s,void 0,a):null)}return b.createElement(Ry,de({},r,{ref:t}),n)});Ms.displayName="Slot";const Ry=b.forwardRef((e,t)=>{const{children:n,...r}=e;return b.isValidElement(n)?b.cloneElement(n,{...Mj(r,n.props),ref:t?kg(t,n.ref):n.ref}):b.Children.count(n)>1?b.Children.only(null):null});Ry.displayName="SlotClone";const B5=({children:e})=>b.createElement(b.Fragment,null,e);function Dj(e){return b.isValidElement(e)&&e.type===B5}function Mj(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 Og(e){const t=e+"CollectionProvider",[n,r]=fr(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=p=>{const{scope:m,children:v}=p,y=b.useRef(null),w=b.useRef(new Map).current;return b.createElement(o,{scope:m,itemMap:w,collectionRef:y},v)},a=e+"CollectionSlot",l=b.forwardRef((p,m)=>{const{scope:v,children:y}=p,w=i(a,v),C=St(m,w.collectionRef);return b.createElement(Ms,{ref:C},y)}),c=e+"CollectionItemSlot",u="data-radix-collection-item",d=b.forwardRef((p,m)=>{const{scope:v,children:y,...w}=p,C=b.useRef(null),_=St(m,C),k=i(c,v);return b.useEffect(()=>(k.itemMap.set(C,{ref:C,...w}),()=>void k.itemMap.delete(C))),b.createElement(Ms,{[u]:"",ref:_},y)});function h(p){const m=i(e+"CollectionConsumer",p);return b.useCallback(()=>{const y=m.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${u}]`));return Array.from(m.itemMap.values()).sort((k,E)=>w.indexOf(k.ref.current)-w.indexOf(E.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:s,Slot:l,ItemSlot:d},h,r]}const Pr=globalThis!=null&&globalThis.document?b.useLayoutEffect:()=>{},$j=he.useId||(()=>{});let Tj=0;function Xr(e){const[t,n]=he.useState($j());return Pr(()=>{e||n(r=>r??String(Tj++))},[e]),e||(t?`radix-${t}`:"")}const ot=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{const n=b.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?Ms:t;return b.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),b.createElement(a,de({},s,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function V5(e,t){e&&Jt.flushSync(()=>e.dispatchEvent(t))}function or(e){const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function Dr({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=Aj({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=or(n),l=b.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 Aj({defaultProp:e,onChange:t}){const n=b.useState(e),[r]=n,o=b.useRef(r),i=or(t);return b.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const Ij=b.createContext(void 0);function Il(e){const t=b.useContext(Ij);return e||t||"ltr"}const jy="rovingFocusGroup.onEntryFocus",Nj={bubbles:!1,cancelable:!0},zy="RovingFocusGroup",[By,H5,Lj]=Og(zy),[Fj,su]=fr(zy,[Lj]),[Rj,jj]=Fj(zy),zj=b.forwardRef((e,t)=>b.createElement(By.Provider,{scope:e.__scopeRovingFocusGroup},b.createElement(By.Slot,{scope:e.__scopeRovingFocusGroup},b.createElement(Bj,de({},e,{ref:t}))))),Bj=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,...u}=e,d=b.useRef(null),h=St(t,d),p=Il(i),[m=null,v]=Dr({prop:s,defaultProp:a,onChange:l}),[y,w]=b.useState(!1),C=or(c),_=H5(n),k=b.useRef(!1),[E,P]=b.useState(0);return b.useEffect(()=>{const D=d.current;if(D)return D.addEventListener(jy,C),()=>D.removeEventListener(jy,C)},[C]),b.createElement(Rj,{scope:n,orientation:r,dir:p,loop:o,currentTabStopId:m,onItemFocus:b.useCallback(D=>v(D),[v]),onItemShiftTab:b.useCallback(()=>w(!0),[]),onFocusableItemAdd:b.useCallback(()=>P(D=>D+1),[]),onFocusableItemRemove:b.useCallback(()=>P(D=>D-1),[])},b.createElement(ot.div,de({tabIndex:y||E===0?-1:0,"data-orientation":r},u,{ref:h,style:{outline:"none",...e.style},onMouseDown:Ie(e.onMouseDown,()=>{k.current=!0}),onFocus:Ie(e.onFocus,D=>{const M=!k.current;if(D.target===D.currentTarget&&M&&!y){const I=new CustomEvent(jy,Nj);if(D.currentTarget.dispatchEvent(I),!I.defaultPrevented){const F=_().filter(z=>z.focusable),R=F.find(z=>z.active),B=F.find(z=>z.id===m),q=[R,B,...F].filter(Boolean).map(z=>z.ref.current);q5(q)}}k.current=!1}),onBlur:Ie(e.onBlur,()=>w(!1))})))}),Vj="RovingFocusGroupItem",Hj=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=Xr(),l=i||a,c=jj(Vj,n),u=c.currentTabStopId===l,d=H5(n),{onFocusableItemAdd:h,onFocusableItemRemove:p}=c;return b.useEffect(()=>{if(r)return h(),()=>p()},[r,h,p]),b.createElement(By.ItemSlot,{scope:n,id:l,focusable:r,active:o},b.createElement(ot.span,de({tabIndex:u?0:-1,"data-orientation":c.orientation},s,{ref:t,onMouseDown:Ie(e.onMouseDown,m=>{r?c.onItemFocus(l):m.preventDefault()}),onFocus:Ie(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:Ie(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){c.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const v=Uj(m,c.orientation,c.dir);if(v!==void 0){m.preventDefault();let w=d().filter(C=>C.focusable).map(C=>C.ref.current);if(v==="last")w.reverse();else if(v==="prev"||v==="next"){v==="prev"&&w.reverse();const C=w.indexOf(m.currentTarget);w=c.loop?Gj(w,C+1):w.slice(C+1)}setTimeout(()=>q5(w))}})})))}),qj={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Wj(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Uj(e,t,n){const r=Wj(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return qj[r]}function q5(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Gj(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const Vy=zj,Hy=Hj;function Kj(e,t){return b.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const Qn=e=>{const{present:t,children:n}=e,r=Yj(t),o=typeof n=="function"?n({present:r.isPresent}):b.Children.only(n),i=St(r.ref,o.ref);return typeof n=="function"||r.isPresent?b.cloneElement(o,{ref:i}):null};Qn.displayName="Presence";function Yj(e){const[t,n]=b.useState(),r=b.useRef({}),o=b.useRef(e),i=b.useRef("none"),s=e?"mounted":"unmounted",[a,l]=Kj(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const c=Pg(r.current);i.current=a==="mounted"?c:"none"},[a]),Pr(()=>{const c=r.current,u=o.current;if(u!==e){const h=i.current,p=Pg(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]),Pr(()=>{if(t){const c=d=>{const p=Pg(r.current).includes(d.animationName);d.target===t&&p&&Jt.flushSync(()=>l("ANIMATION_END"))},u=d=>{d.target===t&&(i.current=Pg(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:b.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Pg(e){return(e==null?void 0:e.animationName)||"none"}const W5="Tabs",[Xj,f2e]=fr(W5,[su]),U5=su(),[Qj,qy]=Xj(W5),Zj=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=Il(a),[d,h]=Dr({prop:r,onChange:o,defaultProp:i});return b.createElement(Qj,{scope:n,baseId:Xr(),value:d,onValueChange:h,orientation:s,dir:u,activationMode:l},b.createElement(ot.div,de({dir:u,"data-orientation":s},c,{ref:t})))}),Jj="TabsList",ez=b.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=qy(Jj,n),s=U5(n);return b.createElement(Vy,de({asChild:!0},s,{orientation:i.orientation,dir:i.dir,loop:r}),b.createElement(ot.div,de({role:"tablist","aria-orientation":i.orientation},o,{ref:t})))}),tz="TabsTrigger",nz=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=qy(tz,n),a=U5(n),l=G5(s.baseId,r),c=K5(s.baseId,r),u=r===s.value;return b.createElement(Hy,de({asChild:!0},a,{focusable:!o,active:u}),b.createElement(ot.button,de({type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l},i,{ref:t,onMouseDown:Ie(e.onMouseDown,d=>{!o&&d.button===0&&d.ctrlKey===!1?s.onValueChange(r):d.preventDefault()}),onKeyDown:Ie(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&s.onValueChange(r)}),onFocus:Ie(e.onFocus,()=>{const d=s.activationMode!=="manual";!u&&!o&&d&&s.onValueChange(r)})})))}),rz="TabsContent",oz=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=qy(rz,n),l=G5(a.baseId,r),c=K5(a.baseId,r),u=r===a.value,d=b.useRef(u);return b.useEffect(()=>{const h=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(h)},[]),b.createElement(Qn,{present:o||u},({present:h})=>b.createElement(ot.div,de({"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!h,id:c,tabIndex:0},s,{ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0}}),h&&i))});function G5(e,t){return`${e}-trigger-${t}`}function K5(e,t){return`${e}-content-${t}`}const iz=Zj,Y5=ez,X5=nz,Q5=oz,Z5=iz,J5=he.forwardRef(({className:e,...t},n)=>x.jsx(Y5,{ref:n,className:$e("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));J5.displayName=Y5.displayName;const Wy=he.forwardRef(({className:e,...t},n)=>x.jsx(X5,{ref:n,className:$e("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));Wy.displayName=X5.displayName;const Dg=he.forwardRef(({className:e,...t},n)=>x.jsx(Q5,{ref:n,className:$e("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Dg.displayName=Q5.displayName;var ek={exports:{}},gf={},Uy={exports:{}};(function(e,t){(function(n,r){r(t)})(ma,function(n){function r(se){return function(le,xe,K,Fe,ve,ze,Ze){return se(le,xe,Ze)}}function o(se){return function(le,xe,K,Fe){if(!le||!xe||typeof le!="object"||typeof xe!="object")return se(le,xe,K,Fe);var ve=Fe.get(le),ze=Fe.get(xe);if(ve&&ze)return ve===xe&&ze===le;Fe.set(le,xe),Fe.set(xe,le);var Ze=se(le,xe,K,Fe);return Fe.delete(le),Fe.delete(xe),Ze}}function i(se,ne){var le={};for(var xe in se)le[xe]=se[xe];for(var xe in ne)le[xe]=ne[xe];return le}function s(se){return se.constructor===Object||se.constructor==null}function a(se){return typeof se.then=="function"}function l(se,ne){return se===ne||se!==se&&ne!==ne}var c="[object Arguments]",u="[object Boolean]",d="[object Date]",h="[object RegExp]",p="[object Map]",m="[object Number]",v="[object Object]",y="[object Set]",w="[object String]",C=Object.prototype.toString;function _(se){var ne=se.areArraysEqual,le=se.areDatesEqual,xe=se.areMapsEqual,K=se.areObjectsEqual,Fe=se.areRegExpsEqual,ve=se.areSetsEqual,ze=se.createIsNestedEqual,Ze=ze(et);function et(Xe,tt,_t){if(Xe===tt)return!0;if(!Xe||!tt||typeof Xe!="object"||typeof tt!="object")return Xe!==Xe&&tt!==tt;if(s(Xe)&&s(tt))return K(Xe,tt,Ze,_t);var Lt=Array.isArray(Xe),ln=Array.isArray(tt);if(Lt||ln)return Lt===ln&&ne(Xe,tt,Ze,_t);var Zt=C.call(Xe);return Zt!==C.call(tt)?!1:Zt===d?le(Xe,tt,Ze,_t):Zt===h?Fe(Xe,tt,Ze,_t):Zt===p?xe(Xe,tt,Ze,_t):Zt===y?ve(Xe,tt,Ze,_t):Zt===v||Zt===c?a(Xe)||a(tt)?!1:K(Xe,tt,Ze,_t):Zt===u||Zt===m||Zt===w?l(Xe.valueOf(),tt.valueOf()):!1}return et}function k(se,ne,le,xe){var K=se.length;if(ne.length!==K)return!1;for(;K-- >0;)if(!le(se[K],ne[K],K,K,se,ne,xe))return!1;return!0}var E=o(k);function P(se,ne){return l(se.valueOf(),ne.valueOf())}function D(se,ne,le,xe){var K=se.size===ne.size;if(!K)return!1;if(!se.size)return!0;var Fe={},ve=0;return se.forEach(function(ze,Ze){if(K){var et=!1,Xe=0;ne.forEach(function(tt,_t){!et&&!Fe[Xe]&&(et=le(Ze,_t,ve,Xe,se,ne,xe)&&le(ze,tt,Ze,_t,se,ne,xe))&&(Fe[Xe]=!0),Xe++}),ve++,K=et}}),K}var M=o(D),I="_owner",F=Object.prototype.hasOwnProperty;function R(se,ne,le,xe){var K=Object.keys(se),Fe=K.length;if(Object.keys(ne).length!==Fe)return!1;for(var ve;Fe-- >0;){if(ve=K[Fe],ve===I){var ze=!!se.$$typeof,Ze=!!ne.$$typeof;if((ze||Ze)&&ze!==Ze)return!1}if(!F.call(ne,ve)||!le(se[ve],ne[ve],ve,ve,se,ne,xe))return!1}return!0}var B=o(R);function ie(se,ne){return se.source===ne.source&&se.flags===ne.flags}function q(se,ne,le,xe){var K=se.size===ne.size;if(!K)return!1;if(!se.size)return!0;var Fe={};return se.forEach(function(ve,ze){if(K){var Ze=!1,et=0;ne.forEach(function(Xe,tt){!Ze&&!Fe[et]&&(Ze=le(ve,Xe,ze,tt,se,ne,xe))&&(Fe[et]=!0),et++}),K=Ze}}),K}var z=o(q),X=Object.freeze({areArraysEqual:k,areDatesEqual:P,areMapsEqual:D,areObjectsEqual:R,areRegExpsEqual:ie,areSetsEqual:q,createIsNestedEqual:r}),U=Object.freeze({areArraysEqual:E,areDatesEqual:P,areMapsEqual:M,areObjectsEqual:B,areRegExpsEqual:ie,areSetsEqual:z,createIsNestedEqual:r}),Z=_(X);function G(se,ne){return Z(se,ne,void 0)}var $=_(i(X,{createIsNestedEqual:function(){return l}}));function H(se,ne){return $(se,ne,void 0)}var re=_(U);function N(se,ne){return re(se,ne,new WeakMap)}var V=_(i(U,{createIsNestedEqual:function(){return l}}));function ue(se,ne){return V(se,ne,new WeakMap)}function ce(se){return _(i(X,se(X)))}function pe(se){var ne=_(i(U,se(U)));return function(le,xe,K){return K===void 0&&(K=new WeakMap),ne(le,xe,K)}}n.circularDeepEqual=N,n.circularShallowEqual=ue,n.createCustomCircularEqual=pe,n.createCustomEqual=ce,n.deepEqual=G,n.sameValueZeroEqual=l,n.shallowEqual=H,Object.defineProperty(n,"__esModule",{value:!0})})})(Uy,Uy.exports);var Gy=Uy.exports;const Ky=Lb(ZL);var Rt={},sz=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(Rt,"__esModule",{value:!0}),Rt.bottom=Yy,Rt.childrenEqual=uz,Rt.cloneLayout=nk,Rt.cloneLayoutItem=Nl,Rt.collides=Mg,Rt.compact=ok,Rt.compactItem=ik,Rt.compactType=xz,Rt.correctBounds=sk,Rt.fastPositionEqual=fz,Rt.fastRGLPropsEqual=void 0,Rt.getAllCollisions=ak,Rt.getFirstCollision=Ll,Rt.getLayoutItem=Qy,Rt.getStatics=Zy,Rt.modifyLayout=rk,Rt.moveElement=vf,Rt.moveElementAwayFromCollision=Jy,Rt.noop=void 0,Rt.perc=pz,Rt.resizeItemInDirection=mz,Rt.setTopLeft=bz,Rt.setTransform=vz,Rt.sortLayoutItems=i1,Rt.sortLayoutItemsByColRow=fk,Rt.sortLayoutItemsByRowCol=dk,Rt.synchronizeLayoutWithChildren=yz,Rt.validateLayout=hk,Rt.withLayoutItem=cz;var tk=Gy,mf=az(b);function az(e){return e&&e.__esModule?e:{default:e}}const lz=process.env.NODE_ENV==="production";function Yy(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 nk(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=Nl(e[n]);return t}function rk(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 cz(e,t,n){let r=Qy(e,t);return r?(r=n(Nl(r)),e=rk(e,r),[e,r]):[e,null]}function Nl(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 uz(e,t){return(0,tk.deepEqual)(mf.default.Children.map(e,n=>n==null?void 0:n.key),mf.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,tk.deepEqual)(mf.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),mf.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}const dz=sz;Rt.fastRGLPropsEqual=dz;function fz(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function Mg(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 ok(e,t,n,r){const o=Zy(e),i=i1(e,t),s=Array(e.length);for(let a=0,l=i.length;a<l;a++){let c=Nl(i[a]);c.static||(c=ik(o,c,t,n,i,r),o.push(c)),s[e.indexOf(i[a])]=c,c.moved=!1}return s}const hz={x:"w",y:"h"};function Xy(e,t,n,r){const o=hz[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;Mg(t,a)&&Xy(e,a,n+t[o],r)}}t[r]=n}function ik(e,t,n,r,o,i){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(Yy(e),t.y);t.y>0&&!Ll(e,t);)t.y--;else if(a)for(;t.x>0&&!Ll(e,t);)t.x--;let l;for(;(l=Ll(e,t))&&!(n===null&&i);)if(a?Xy(o,t,l.x+l.w,"x"):Xy(o,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!Ll(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function sk(e,t){const n=Zy(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(;Ll(n,i);)i.y++}return e}function Qy(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function Ll(e,t){for(let n=0,r=e.length;n<r;n++)if(Mg(e[n],t))return e[n]}function ak(e,t){return e.filter(n=>Mg(n,t))}function Zy(e){return e.filter(t=>t.static)}function vf(e,t,n,r,o,i,s,a,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;"Moving element ".concat(t.i," to [").concat(String(n),",").concat(String(r),"] from [").concat(t.x,",").concat(t.y,"]");const c=t.x,u=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let d=i1(e,s);(s==="vertical"&&typeof r=="number"?u>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(d=d.reverse());const p=ak(d,t),m=p.length>0;if(m&&l)return nk(e);if(m&&i)return"Collision prevented on ".concat(t.i,", reverting."),t.x=c,t.y=u,t.moved=!1,e;for(let v=0,y=p.length;v<y;v++){const w=p[v];"Resolving collision between ".concat(t.i," at [").concat(t.x,",").concat(t.y,"] and ").concat(w.i," at [").concat(w.x,",").concat(w.y,"]"),!w.moved&&(w.static?e=Jy(e,w,t,o,s):e=Jy(e,t,w,o,s))}return e}function Jy(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=Ll(e,d),p=h&&h.y+h.h>t.y,m=h&&t.x+t.w>h.x;if(h){if(p&&a)return vf(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(m&&s)return vf(e,t,n.x,void 0,r,l,o)}else return"Doing reverse collision on ".concat(n.i," up to [").concat(d.x,",").concat(d.y,"]."),vf(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:vf(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,o)}function pz(e){return e*100+"%"}const lk=(e,t,n,r)=>e+n>r?t:n,ck=(e,t,n)=>e<0?t:n,uk=e=>Math.max(0,e),e1=e=>Math.max(0,e),t1=(e,t,n)=>{let{left:r,height:o,width:i}=t;const s=e.top-(o-e.height);return{left:r,width:i,height:ck(s,e.height,o),top:e1(s)}},n1=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{top:r,height:i,width:lk(e.left,e.width,s,n),left:uk(o)}},r1=(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:lk(e.left,e.width,i,n),top:e1(r),left:uk(s)}},o1=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{width:s,left:o,height:ck(r,e.height,i),top:e1(r)}},gz={n:t1,ne:function(){return t1(arguments.length<=0?void 0:arguments[0],n1(...arguments))},e:n1,se:function(){return o1(arguments.length<=0?void 0:arguments[0],n1(...arguments))},s:o1,sw:function(){return o1(arguments.length<=0?void 0:arguments[0],r1(...arguments))},w:r1,nw:function(){return t1(arguments.length<=0?void 0:arguments[0],r1(...arguments))}};function mz(e,t,n,r){const o=gz[e];return o?o(t,{...t,...n},r):n}function vz(e){let{top:t,left:n,width:r,height:o}=e;const i="translate(".concat(n,"px,").concat(t,"px)");return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:"".concat(r,"px"),height:"".concat(o,"px"),position:"absolute"}}function bz(e){let{top:t,left:n,width:r,height:o}=e;return{top:"".concat(t,"px"),left:"".concat(n,"px"),width:"".concat(r,"px"),height:"".concat(o,"px"),position:"absolute"}}function i1(e,t){return t==="horizontal"?fk(e):t==="vertical"?dk(e):e}function dk(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 fk(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 yz(e,t,n,r,o){e=e||[];const i=[];mf.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=Qy(e,String(a.key)),c=a.props["data-grid"];l&&c==null?i.push(Nl(l)):c?(lz||hk([c],"ReactGridLayout.children"),i.push(Nl({...c,i:a.key}))):i.push(Nl({w:1,h:1,x:0,y:Yy(i),i:String(a.key)}))});const s=sk(i,{cols:n});return o?s:ok(s,r,n)}function hk(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const n=["x","y","w","h"];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(let r=0,o=e.length;r<o;r++){const i=e[r];for(let s=0;s<n.length;s++)if(typeof i[n[s]]!="number")throw new Error("ReactGridLayout: "+t+"["+r+"]."+n[s]+" must be a number!")}}function xz(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}function v2e(){}const wz=()=>{};Rt.noop=wz;var Hi={};Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.calcGridColWidth=$g,Hi.calcGridItemPosition=Sz,Hi.calcGridItemWHPx=s1,Hi.calcWH=_z,Hi.calcXY=Cz,Hi.clamp=Fl;function $g(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function s1(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function Sz(e,t,n,r,o,i){const{margin:s,containerPadding:a,rowHeight:l}=e,c=$g(e),u={};return i&&i.resizing?(u.width=Math.round(i.resizing.width),u.height=Math.round(i.resizing.height)):(u.width=s1(r,c,s[0]),u.height=s1(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 Cz(e,t,n,r,o){const{margin:i,cols:s,rowHeight:a,maxRows:l}=e,c=$g(e);let u=Math.round((n-i[0])/(c+i[0])),d=Math.round((t-i[1])/(a+i[1]));return u=Fl(u,0,s-r),d=Fl(d,0,l-o),{x:u,y:d}}function _z(e,t,n,r,o,i){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,u=$g(e);let d=Math.round((t+s[0])/(u+s[0])),h=Math.round((n+s[1])/(c+s[1])),p=Fl(d,0,l-r),m=Fl(h,0,a-o);return["sw","w","nw"].indexOf(i)!==-1&&(p=Fl(d,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(m=Fl(h,0,a)),{w:p,h:m}}function Fl(e,t,n){return Math.max(Math.min(e,n),t)}var Tg={},a1={exports:{}},l1,pk;function c1(){if(pk)return l1;pk=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return l1=e,l1}var u1,gk;function Ez(){if(gk)return u1;gk=1;var e=c1();function t(){}function n(){}return n.resetWarningCache=t,u1=function(){function r(s,a,l,c,u,d){if(d!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function o(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},u1}var Ag={exports:{}},on={};/** @license React v16.13.1
85
+ }`;var Nt=qL(function(){return nn(j,rt+"return "+Oe).apply(n,W)});if(Nt.source=Oe,E2(Nt))throw Nt;return Nt}function h_e(f){return un(f).toLowerCase()}function p_e(f){return un(f).toUpperCase()}function g_e(f,g,S){if(f=un(f),f&&(S||g===n))return J8(f);if(!f||!(g=jo(g)))return f;var O=Li(f),A=Li(g),j=eN(O,A),W=tN(O,A)+1;return Sl(O,j,W).join("")}function m_e(f,g,S){if(f=un(f),f&&(S||g===n))return f.slice(0,rN(f)+1);if(!f||!(g=jo(g)))return f;var O=Li(f),A=tN(O,Li(g))+1;return Sl(O,0,A).join("")}function v_e(f,g,S){if(f=un(f),f&&(S||g===n))return f.replace(Ss,"");if(!f||!(g=jo(g)))return f;var O=Li(f),A=eN(O,Li(g));return Sl(O,A).join("")}function b_e(f,g){var S=F,O=R;if(zn(g)){var A="separator"in g?g.separator:A;S="length"in g?Tt(g.length):S,O="omission"in g?jo(g.omission):O}f=un(f);var j=f.length;if(Nd(f)){var W=Li(f);j=W.length}if(S>=j)return f;var J=S-Ld(O);if(J<1)return O;var ae=W?Sl(W,0,J).join(""):f.slice(0,J);if(A===n)return ae+O;if(W&&(J+=ae.length-J),k2(A)){if(f.slice(J).search(A)){var we,Se=ae;for(A.global||(A=V_(A.source,un(it.exec(A))+"g")),A.lastIndex=0;we=A.exec(Se);)var Oe=we.index;ae=ae.slice(0,Oe===n?J:Oe)}}else if(f.indexOf(jo(A),J)!=J){var Ve=ae.lastIndexOf(A);Ve>-1&&(ae=ae.slice(0,Ve))}return ae+O}function y_e(f){return f=un(f),f&&ci.test(f)?f.replace(Kn,Kye):f}var x_e=Hd(function(f,g,S){return f+(S?" ":"")+g.toUpperCase()}),D2=WN("toUpperCase");function HL(f,g,S){return f=un(f),g=S?n:g,g===n?Hye(f)?Qye(f):Iye(f):f.match(g)||[]}var qL=Ft(function(f,g){try{return Fo(f,n,g)}catch(S){return E2(S)?S:new wt(S)}}),w_e=ua(function(f,g){return di(g,function(S){S=Es(S),la(f,S,C2(f[S],f))}),f});function S_e(f){var g=f==null?0:f.length,S=ct();return f=g?Ln(f,function(O){if(typeof O[1]!="function")throw new fi(s);return[S(O[0]),O[1]]}):[],Ft(function(O){for(var A=-1;++A<g;){var j=f[A];if(Fo(j[0],this,O))return Fo(j[1],this,O)}})}function C_e(f){return K1e(pi(f,d))}function M2(f){return function(){return f}}function __e(f,g){return f==null||f!==f?g:f}var E_e=GN(),k_e=GN(!0);function ho(f){return f}function $2(f){return CN(typeof f=="function"?f:pi(f,d))}function O_e(f){return EN(pi(f,d))}function P_e(f,g){return kN(f,pi(g,d))}var D_e=Ft(function(f,g){return function(S){return jp(S,f,g)}}),M_e=Ft(function(f,g){return function(S){return jp(f,S,g)}});function T2(f,g,S){var O=vr(g),A=pb(g,O);S==null&&!(zn(g)&&(A.length||!O.length))&&(S=g,g=f,f=this,A=pb(g,vr(g)));var j=!(zn(S)&&"chain"in S)||!!S.chain,W=fa(f);return di(A,function(J){var ae=g[J];f[J]=ae,W&&(f.prototype[J]=function(){var we=this.__chain__;if(j||we){var Se=f(this.__wrapped__),Oe=Se.__actions__=co(this.__actions__);return Oe.push({func:ae,args:arguments,thisArg:f}),Se.__chain__=we,Se}return ae.apply(f,ml([this.value()],arguments))})}),f}function $_e(){return Er._===this&&(Er._=r1e),this}function A2(){}function T_e(f){return f=Tt(f),Ft(function(g){return ON(g,f)})}var A_e=u2(Ln),I_e=u2(K8),N_e=u2(N_);function WL(f){return v2(f)?L_(Es(f)):dxe(f)}function L_e(f){return function(g){return f==null?n:Vc(f,g)}}var F_e=YN(),R_e=YN(!0);function I2(){return[]}function N2(){return!1}function j_e(){return{}}function z_e(){return""}function B_e(){return!0}function V_e(f,g){if(f=Tt(f),f<1||f>Z)return[];var S=H,O=Fr(f,H);g=ct(g),f-=H;for(var A=j_(O,g);++S<f;)g(S);return A}function H_e(f){return kt(f)?Ln(f,Es):zo(f)?[f]:co(dL(un(f)))}function q_e(f){var g=++t1e;return un(f)+g}var W_e=xb(function(f,g){return f+g},0),U_e=d2("ceil"),G_e=xb(function(f,g){return f/g},1),K_e=d2("floor");function Y_e(f){return f&&f.length?hb(f,ho,X_):n}function X_e(f,g){return f&&f.length?hb(f,ct(g,2),X_):n}function Q_e(f){return Q8(f,ho)}function Z_e(f,g){return Q8(f,ct(g,2))}function J_e(f){return f&&f.length?hb(f,ho,e2):n}function e2e(f,g){return f&&f.length?hb(f,ct(g,2),e2):n}var t2e=xb(function(f,g){return f*g},1),n2e=d2("round"),r2e=xb(function(f,g){return f-g},0);function o2e(f){return f&&f.length?R_(f,ho):0}function i2e(f,g){return f&&f.length?R_(f,ct(g,2)):0}return L.after=OSe,L.ary=SL,L.assign=pCe,L.assignIn=LL,L.assignInWith=Ab,L.assignWith=gCe,L.at=mCe,L.before=CL,L.bind=C2,L.bindAll=w_e,L.bindKey=_L,L.castArray=jSe,L.chain=yL,L.chunk=Kxe,L.compact=Yxe,L.concat=Xxe,L.cond=S_e,L.conforms=C_e,L.constant=M2,L.countBy=oSe,L.create=vCe,L.curry=EL,L.curryRight=kL,L.debounce=OL,L.defaults=bCe,L.defaultsDeep=yCe,L.defer=PSe,L.delay=DSe,L.difference=Qxe,L.differenceBy=Zxe,L.differenceWith=Jxe,L.drop=ewe,L.dropRight=twe,L.dropRightWhile=nwe,L.dropWhile=rwe,L.fill=owe,L.filter=sSe,L.flatMap=cSe,L.flatMapDeep=uSe,L.flatMapDepth=dSe,L.flatten=gL,L.flattenDeep=iwe,L.flattenDepth=swe,L.flip=MSe,L.flow=E_e,L.flowRight=k_e,L.fromPairs=awe,L.functions=kCe,L.functionsIn=OCe,L.groupBy=fSe,L.initial=cwe,L.intersection=uwe,L.intersectionBy=dwe,L.intersectionWith=fwe,L.invert=DCe,L.invertBy=MCe,L.invokeMap=pSe,L.iteratee=$2,L.keyBy=gSe,L.keys=vr,L.keysIn=fo,L.map=Ob,L.mapKeys=TCe,L.mapValues=ACe,L.matches=O_e,L.matchesProperty=P_e,L.memoize=Db,L.merge=ICe,L.mergeWith=FL,L.method=D_e,L.methodOf=M_e,L.mixin=T2,L.negate=Mb,L.nthArg=T_e,L.omit=NCe,L.omitBy=LCe,L.once=$Se,L.orderBy=mSe,L.over=A_e,L.overArgs=TSe,L.overEvery=I_e,L.overSome=N_e,L.partial=_2,L.partialRight=PL,L.partition=vSe,L.pick=FCe,L.pickBy=RL,L.property=WL,L.propertyOf=L_e,L.pull=mwe,L.pullAll=vL,L.pullAllBy=vwe,L.pullAllWith=bwe,L.pullAt=ywe,L.range=F_e,L.rangeRight=R_e,L.rearg=ASe,L.reject=xSe,L.remove=xwe,L.rest=ISe,L.reverse=w2,L.sampleSize=SSe,L.set=jCe,L.setWith=zCe,L.shuffle=CSe,L.slice=wwe,L.sortBy=kSe,L.sortedUniq=Pwe,L.sortedUniqBy=Dwe,L.split=c_e,L.spread=NSe,L.tail=Mwe,L.take=$we,L.takeRight=Twe,L.takeRightWhile=Awe,L.takeWhile=Iwe,L.tap=Ywe,L.throttle=LSe,L.thru=kb,L.toArray=AL,L.toPairs=jL,L.toPairsIn=zL,L.toPath=H_e,L.toPlainObject=NL,L.transform=BCe,L.unary=FSe,L.union=Nwe,L.unionBy=Lwe,L.unionWith=Fwe,L.uniq=Rwe,L.uniqBy=jwe,L.uniqWith=zwe,L.unset=VCe,L.unzip=S2,L.unzipWith=bL,L.update=HCe,L.updateWith=qCe,L.values=Ud,L.valuesIn=WCe,L.without=Bwe,L.words=HL,L.wrap=RSe,L.xor=Vwe,L.xorBy=Hwe,L.xorWith=qwe,L.zip=Wwe,L.zipObject=Uwe,L.zipObjectDeep=Gwe,L.zipWith=Kwe,L.entries=jL,L.entriesIn=zL,L.extend=LL,L.extendWith=Ab,T2(L,L),L.add=W_e,L.attempt=qL,L.camelCase=YCe,L.capitalize=BL,L.ceil=U_e,L.clamp=UCe,L.clone=zSe,L.cloneDeep=VSe,L.cloneDeepWith=HSe,L.cloneWith=BSe,L.conformsTo=qSe,L.deburr=VL,L.defaultTo=__e,L.divide=G_e,L.endsWith=XCe,L.eq=Ri,L.escape=QCe,L.escapeRegExp=ZCe,L.every=iSe,L.find=aSe,L.findIndex=hL,L.findKey=xCe,L.findLast=lSe,L.findLastIndex=pL,L.findLastKey=wCe,L.floor=K_e,L.forEach=xL,L.forEachRight=wL,L.forIn=SCe,L.forInRight=CCe,L.forOwn=_Ce,L.forOwnRight=ECe,L.get=O2,L.gt=WSe,L.gte=USe,L.has=PCe,L.hasIn=P2,L.head=mL,L.identity=ho,L.includes=hSe,L.indexOf=lwe,L.inRange=GCe,L.invoke=$Ce,L.isArguments=Wc,L.isArray=kt,L.isArrayBuffer=GSe,L.isArrayLike=uo,L.isArrayLikeObject=Yn,L.isBoolean=KSe,L.isBuffer=Cl,L.isDate=YSe,L.isElement=XSe,L.isEmpty=QSe,L.isEqual=ZSe,L.isEqualWith=JSe,L.isError=E2,L.isFinite=eCe,L.isFunction=fa,L.isInteger=DL,L.isLength=$b,L.isMap=ML,L.isMatch=tCe,L.isMatchWith=nCe,L.isNaN=rCe,L.isNative=oCe,L.isNil=sCe,L.isNull=iCe,L.isNumber=$L,L.isObject=zn,L.isObjectLike=Wn,L.isPlainObject=Wp,L.isRegExp=k2,L.isSafeInteger=aCe,L.isSet=TL,L.isString=Tb,L.isSymbol=zo,L.isTypedArray=Wd,L.isUndefined=lCe,L.isWeakMap=cCe,L.isWeakSet=uCe,L.join=hwe,L.kebabCase=JCe,L.last=mi,L.lastIndexOf=pwe,L.lowerCase=e_e,L.lowerFirst=t_e,L.lt=dCe,L.lte=fCe,L.max=Y_e,L.maxBy=X_e,L.mean=Q_e,L.meanBy=Z_e,L.min=J_e,L.minBy=e2e,L.stubArray=I2,L.stubFalse=N2,L.stubObject=j_e,L.stubString=z_e,L.stubTrue=B_e,L.multiply=t2e,L.nth=gwe,L.noConflict=$_e,L.noop=A2,L.now=Pb,L.pad=n_e,L.padEnd=r_e,L.padStart=o_e,L.parseInt=i_e,L.random=KCe,L.reduce=bSe,L.reduceRight=ySe,L.repeat=s_e,L.replace=a_e,L.result=RCe,L.round=n2e,L.runInContext=oe,L.sample=wSe,L.size=_Se,L.snakeCase=l_e,L.some=ESe,L.sortedIndex=Swe,L.sortedIndexBy=Cwe,L.sortedIndexOf=_we,L.sortedLastIndex=Ewe,L.sortedLastIndexBy=kwe,L.sortedLastIndexOf=Owe,L.startCase=u_e,L.startsWith=d_e,L.subtract=r2e,L.sum=o2e,L.sumBy=i2e,L.template=f_e,L.times=V_e,L.toFinite=ha,L.toInteger=Tt,L.toLength=IL,L.toLower=h_e,L.toNumber=vi,L.toSafeInteger=hCe,L.toString=un,L.toUpper=p_e,L.trim=g_e,L.trimEnd=m_e,L.trimStart=v_e,L.truncate=b_e,L.unescape=y_e,L.uniqueId=q_e,L.upperCase=x_e,L.upperFirst=D2,L.each=xL,L.eachRight=wL,L.first=mL,T2(L,function(){var f={};return Cs(L,function(g,S){hn.call(L.prototype,S)||(f[S]=g)}),f}(),{chain:!1}),L.VERSION=r,di(["bind","bindKey","curry","curryRight","partial","partialRight"],function(f){L[f].placeholder=L}),di(["drop","take"],function(f,g){qt.prototype[f]=function(S){S=S===n?1:dr(Tt(S),0);var O=this.__filtered__&&!g?new qt(this):this.clone();return O.__filtered__?O.__takeCount__=Fr(S,O.__takeCount__):O.__views__.push({size:Fr(S,H),type:f+(O.__dir__<0?"Right":"")}),O},qt.prototype[f+"Right"]=function(S){return this.reverse()[f](S).reverse()}}),di(["filter","map","takeWhile"],function(f,g){var S=g+1,O=S==q||S==X;qt.prototype[f]=function(A){var j=this.clone();return j.__iteratees__.push({iteratee:ct(A,3),type:S}),j.__filtered__=j.__filtered__||O,j}}),di(["head","last"],function(f,g){var S="take"+(g?"Right":"");qt.prototype[f]=function(){return this[S](1).value()[0]}}),di(["initial","tail"],function(f,g){var S="drop"+(g?"":"Right");qt.prototype[f]=function(){return this.__filtered__?new qt(this):this[S](1)}}),qt.prototype.compact=function(){return this.filter(ho)},qt.prototype.find=function(f){return this.filter(f).head()},qt.prototype.findLast=function(f){return this.reverse().find(f)},qt.prototype.invokeMap=Ft(function(f,g){return typeof f=="function"?new qt(this):this.map(function(S){return jp(S,f,g)})}),qt.prototype.reject=function(f){return this.filter(Mb(ct(f)))},qt.prototype.slice=function(f,g){f=Tt(f);var S=this;return S.__filtered__&&(f>0||g<0)?new qt(S):(f<0?S=S.takeRight(-f):f&&(S=S.drop(f)),g!==n&&(g=Tt(g),S=g<0?S.dropRight(-g):S.take(g-f)),S)},qt.prototype.takeRightWhile=function(f){return this.reverse().takeWhile(f).reverse()},qt.prototype.toArray=function(){return this.take(H)},Cs(qt.prototype,function(f,g){var S=/^(?:filter|find|map|reject)|While$/.test(g),O=/^(?:head|last)$/.test(g),A=L[O?"take"+(g=="last"?"Right":""):g],j=O||/^find/.test(g);A&&(L.prototype[g]=function(){var W=this.__wrapped__,J=O?[1]:arguments,ae=W instanceof qt,we=J[0],Se=ae||kt(W),Oe=function(Ht){var Ut=A.apply(L,ml([Ht],J));return O&&Ve?Ut[0]:Ut};Se&&S&&typeof we=="function"&&we.length!=1&&(ae=Se=!1);var Ve=this.__chain__,rt=!!this.__actions__.length,dt=j&&!Ve,Nt=ae&&!rt;if(!j&&Se){W=Nt?W:new qt(this);var ft=f.apply(W,J);return ft.__actions__.push({func:kb,args:[Oe],thisArg:n}),new hi(ft,Ve)}return dt&&Nt?f.apply(this,J):(ft=this.thru(Oe),dt?O?ft.value()[0]:ft.value():ft)})}),di(["pop","push","shift","sort","splice","unshift"],function(f){var g=Zv[f],S=/^(?:push|sort|unshift)$/.test(f)?"tap":"thru",O=/^(?:pop|shift)$/.test(f);L.prototype[f]=function(){var A=arguments;if(O&&!this.__chain__){var j=this.value();return g.apply(kt(j)?j:[],A)}return this[S](function(W){return g.apply(kt(W)?W:[],A)})}}),Cs(qt.prototype,function(f,g){var S=L[g];if(S){var O=S.name+"";hn.call(zd,O)||(zd[O]=[]),zd[O].push({name:g,func:S})}}),zd[yb(n,w).name]=[{name:"wrapper",func:n}],qt.prototype.clone=y1e,qt.prototype.reverse=x1e,qt.prototype.value=w1e,L.prototype.at=Xwe,L.prototype.chain=Qwe,L.prototype.commit=Zwe,L.prototype.next=Jwe,L.prototype.plant=tSe,L.prototype.reverse=nSe,L.prototype.toJSON=L.prototype.valueOf=L.prototype.value=rSe,L.prototype.first=L.prototype.head,Tp&&(L.prototype[Tp]=eSe),L},Fd=Zye();Fc?((Fc.exports=Fd)._=Fd,$_._=Fd):Er._=Fd}).call(ma)}(Eg,Eg.exports);var iu=Eg.exports;const Sa=Gd(iu),N5=["lg","md","sm","xs","xxs"],me=dE()(CE((e,t)=>({currentBreakpoint:"lg",dashboard:{id:"",style:oy},showContext:!1,selectedSheetId:null,selectedCardId:null,selectedFrameId:null,selectedCard:null,showFilters:!1,isDashboardEditing:!1,isVisualEditing:!1,showDashboardJSON:!1,filteringCards:[],actions:{setCardPython:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===o.selectedSheetId);i&&iu.forEach(i.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(d=>d.id===n);c&&(c.python=r)})})},addBaseQuery:n=>{e(r=>{var o;r.dashboard.baseQueries||(r.dashboard.baseQueries=[]),(o=r.dashboard.baseQueries)==null||o.push(n)})},removeBaseQuery:n=>{e(r=>{var i,s;const o=(i=r.dashboard.baseQueries)==null?void 0:i.findIndex(a=>a.id===n);o!=null&&o>-1&&((s=r.dashboard.baseQueries)==null||s.splice(o,1))})},setBaseQueries:n=>{e(r=>{r.dashboard.baseQueries=n})},setCurrentBreakpoint:n=>{e(()=>({currentBreakpoint:n}))},addFilteringCard:n=>{e(r=>{var o;(o=r.filteringCards)==null||o.push(n)})},removeFilteringCard:n=>{e(r=>{var i,s;const o=(i=r.filteringCards)==null?void 0:i.findIndex(a=>a.id===n.id);o!==void 0&&o>-1&&((s=r.filteringCards)==null||s.splice(o,1))})},setCustomCards:n=>{e(r=>{r.dashboard.customCards=n})},setAuthToken:n=>{e(()=>({authToken:n}))},setThemeStyle:n=>{e(()=>({themeStyle:n}))},setDashboard:n=>e({dashboard:n}),setBookmarkKey:n=>{e(()=>({bookmarkKey:n}))},setDashboardTheme:n=>{e(r=>{r.theme=n})},setSheets:n=>{e(r=>{r.dashboard&&(r.dashboard.sheets=n)})},setCardTitle:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&iu.forEach(s.frames,c=>{var d;const u=(d=c.cards)==null?void 0:d.find(h=>h.id===r);u&&(u.title=o)})})},setCardInfo:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===o.selectedSheetId);i&&iu.forEach(i.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(d=>d.id===n);c&&(c.info=r)})})},setCardDescription:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&iu.forEach(s.frames,c=>{var d;const u=(d=c.cards)==null?void 0:d.find(h=>h.id===r);u&&(u.description=o)})})},setCardSql:(n,r,o)=>{e(i=>{var a,l,c,u;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(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))}})},setFrameCardData:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&iu.forEach(s.frames,c=>{var d;const u=(d=c.cards)==null?void 0:d.find(h=>h.id===r);u&&(u.data=o)})})},setSheetLayout:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layout=r)})},setSheetLayouts:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layouts=r)})},setShowContext:n=>{e(()=>({showContext:n}))},setShowFilters:n=>{e(()=>({showFilters:n}))},setFilterValues:n=>{e(()=>({filterValues:n}))},addOrUpdateFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1?r.filterValues.splice(o,1,n):r.filterValues.push(n)}else r.filterValues=[n]})},addOrUpdateFilterValues:n=>{e(r=>{r.filterValues?n.forEach(o=>{var s,a,l;const i=(s=r==null?void 0:r.filterValues)==null?void 0:s.findIndex(c=>c.filterId===o.filterId);i&&i>-1?(a=r.filterValues)==null||a.splice(i,1,o):(l=r.filterValues)==null||l.push(o)}):r.filterValues=n})},removeFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.filter(i=>i.filterId!==n&&!i.filterId.startsWith(n));r.filterValues=o}})},replaceFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1&&r.filterValues.splice(o,1,n)}})},addFilter:n=>{e(r=>{var o;r.dashboard.filters?(o=r.dashboard.filters)==null||o.push(n):r.dashboard.filters=[n]})},removeFilter:n=>{e(r=>{var o,i;if(r.dashboard.filters){const s=(o=r.dashboard.filters)==null?void 0:o.findIndex(a=>a.id===n);console.log("index",s),s>-1&&((i=r.dashboard.filters)==null||i.splice(s,1))}})},updateFrameCard:(n,r,o)=>{e(i=>{var l,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(m=>m.id===o.id);p>-1&&((h=a.cards)==null||h.splice(p,1,o))}})},updateFilter:n=>{e(r=>{var o,i;if(r.dashboard.filters){const s=(o=r.dashboard.filters)==null?void 0:o.findIndex(a=>a.id===n.id);s>-1&&((i=r.dashboard.filters)==null||i.splice(s,1,n))}})},setIsDashboardEditing:n=>{e(()=>({isDashboardEditing:n}))},setShowDashboardJSON:n=>{e(()=>({showDashboardJSON:n}))},setIsVisualEditing:n=>{e(()=>({isVisualEditing:n}))},addFrame:(n,r)=>{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){i.frames||(i.frames=[]),(l=i.frames)==null||l.push(r);const d={i:r.id,x:0,y:1/0,w:20,h:7,minW:6,minH:2};(c=i.layout)==null||c.push(d),i!=null&&i.layouts||(i.layouts={}),N5.forEach(h=>{i.layouts[h]||(i.layouts[h]=[]),i.layouts[h].push(d)}),(u=o.onAddFrame)==null||u.call(o,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),i.layouts=N5.reduce((h,p)=>{if(h&&h[p]){const m=h[p].findIndex(v=>v.i===r);typeof m=="number"&&m>-1&&h[p].splice(m,1)}return h},i.layouts))}})},updateFrame:(n,r)=>{e(o=>{var a,l,c,u;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(d=>d.id===n),s=(c=i==null?void 0:i.frames)==null?void 0:c.findIndex(d=>d.id===r.id);i&&((u=i.frames)==null||u.splice(s,1,r))})},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}))},setOnUpdateCard:n=>{e(()=>({onUpdateCard:n}))},setOnRemoveCard:n=>{e(()=>({onRemoveCard:n}))},setOnEvent:n=>{e(()=>({onEvent:n}))},getDashboard:()=>t().dashboard,getSelectedSheet:()=>{var n,r;return(r=(n=t().dashboard)==null?void 0:n.sheets)==null?void 0:r.find(o=>o.id===t().selectedSheetId)},getSelectedFrame:()=>{var r,o,i;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(s=>s.id===t().selectedSheetId);return(i=n==null?void 0:n.frames)==null?void 0:i.find(s=>s.id===t().selectedFrameId)},getCard:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a)for(let l=0;l<a.length;l++){const 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},handleDataPointClickAction:(n,r)=>{Cj({card:n,dataPoint:r,set:e,get:t})}}}))),Al=()=>me(e=>e.actions);process.env.NODE_ENV==="development"&&EE("DashboardStore",me);const _j={theme:"system",setTheme:()=>null},L5=b.createContext(_j);function Ej({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[o,i]=b.useState(()=>localStorage.getItem(n)||t);b.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 x.jsx(L5.Provider,{...r,value:s,children:e})}const Ly=()=>{const e=b.useContext(L5);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};async function kj(e,t,n){return await(await fetch(`https://semaphor.cloud/api/v1/dashboard?id=${e}&version=${t}`,{headers:{Authorization:`Bearer ${n}`}})).json()}function F5(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function R5(e,t){const n=F5(e);return n==="dark"?Sa.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function j5({id:e,version:t,authToken:n,customStyle:r,currentTheme:o,onSave:i,onEvent:s}){const{data:a,refetch:l,isLoading:c,isError:u}=yi({queryKey:[e],queryFn:()=>kj(e,t||"",n==null?void 0:n.accessToken),enabled:!1}),{theme:d,setTheme:h}=Ly(),{setDashboard:p,setSelectedSheetId:m,setStyle:v,setOnSaveFunction:y}=me(D=>D.actions);me(D=>D.actions.setCustomCards);const w=me(D=>D.actions.setFilterValues),C=me(D=>D.actions.setBookmarkKey),_=me(D=>D.actions.setAuthToken),k=me(D=>D.actions.setThemeStyle),E=me(D=>D.actions.setDashboardTheme),P=me(D=>D.actions.setOnEvent);return b.useEffect(()=>{if(d){const D=F5(d);E(D)}},[d,E]),b.useEffect(()=>{o&&h(o)},[o,h]),b.useEffect(()=>{const D=Sa.cloneDeep(oy);if(r){const M=Sa.merge(D,r),I=R5(d,M);k(I),v(M)}else{const M=R5(d,D);k(M),v(oy)}},[d,r,v,k]),b.useEffect(()=>{var R;if(!a||!a.dashboard)return;const D=a.dashboard,M=Ua(D.id),I=JSON.parse(localStorage.getItem(M)||"[]"),F=I.find(B=>B.default===!0);if(F)p(F.template),C(F.name),F.filterValues&&w(F.filterValues);else{p(D);const B=I.find(ie=>(ie==null?void 0:ie.name)==="Original");B?B.template=D:I.push({name:"Original",template:D,default:!1}),localStorage.setItem(M,JSON.stringify(I))}m((R=D.sheets)==null?void 0:R[0].id)},[a,p,m,w,C]),b.useEffect(()=>{i&&y(i),s&&P(s)},[i,y,s,P]),b.useEffect(()=>{n&&n.accessToken&&(_(n),l())},[n,l,_]),{isLoading:c,isError:u}}function Fy({className:e,...t}){return x.jsx("div",{className:$e("animate-pulse rounded-md bg-muted",e),...t})}function z5({className:e,style:t,onSave:n,onEvent:r,LoadingComponent:o,ErrorComponent:i,onChartElementClicked:s,id:a,authToken:l,currentTheme:c,version:u,customCards:d,...h}){me(w=>w.selectedSheetId);const p=me(w=>w.themeStyle),m=me(w=>w.onEvent),{isLoading:v,isError:y}=j5({id:a,version:u,authToken:l,customStyle:t,currentTheme:c,onSave:n,onEvent:r});return v||!l?(m==null||m({type:"info",message:`isLoading: ${v}, accessToken: ${l==null?void 0:l.accessToken}`}),o?x.jsx(o,{message:"loading"}):x.jsx("div",{className:"flex items-center gap-3",children:x.jsx(Fy,{className:"h-1 w-full dark:h-[2px]"})})):y?(m==null||m({type:"error",message:"Error fetching dashboard"}),i?(console.log("Error fetching dashboard"),x.jsx(i,{})):x.jsx("div",{children:"Error"})):x.jsx("div",{className:$e("flex h-full grow flex-col justify-between",p==null?void 0:p.dashboardPanel,e),role:"dashboard-panel",...h})}function de(){return de=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},de.apply(this,arguments)}function Ie(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 fr(e,t=[]){let n=[];function r(i,s){const a=b.createContext(s),l=n.length;n=[...n,s];function c(d){const{scope:h,children:p,...m}=d,v=(h==null?void 0:h[e][l])||a,y=b.useMemo(()=>m,Object.values(m));return b.createElement(v.Provider,{value:y},p)}function u(d,h){const p=(h==null?void 0:h[e][l])||a,m=b.useContext(p);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const o=()=>{const i=n.map(s=>b.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return b.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,Oj(o,...t)]}function Oj(...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 b.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Pj(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function kg(...e){return t=>e.forEach(n=>Pj(n,t))}function St(...e){return b.useCallback(kg(...e),e)}const Ms=b.forwardRef((e,t)=>{const{children:n,...r}=e,o=b.Children.toArray(n),i=o.find(Dj);if(i){const s=i.props.children,a=o.map(l=>l===i?b.Children.count(s)>1?b.Children.only(null):b.isValidElement(s)?s.props.children:null:l);return b.createElement(Ry,de({},r,{ref:t}),b.isValidElement(s)?b.cloneElement(s,void 0,a):null)}return b.createElement(Ry,de({},r,{ref:t}),n)});Ms.displayName="Slot";const Ry=b.forwardRef((e,t)=>{const{children:n,...r}=e;return b.isValidElement(n)?b.cloneElement(n,{...Mj(r,n.props),ref:t?kg(t,n.ref):n.ref}):b.Children.count(n)>1?b.Children.only(null):null});Ry.displayName="SlotClone";const B5=({children:e})=>b.createElement(b.Fragment,null,e);function Dj(e){return b.isValidElement(e)&&e.type===B5}function Mj(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 Og(e){const t=e+"CollectionProvider",[n,r]=fr(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=p=>{const{scope:m,children:v}=p,y=b.useRef(null),w=b.useRef(new Map).current;return b.createElement(o,{scope:m,itemMap:w,collectionRef:y},v)},a=e+"CollectionSlot",l=b.forwardRef((p,m)=>{const{scope:v,children:y}=p,w=i(a,v),C=St(m,w.collectionRef);return b.createElement(Ms,{ref:C},y)}),c=e+"CollectionItemSlot",u="data-radix-collection-item",d=b.forwardRef((p,m)=>{const{scope:v,children:y,...w}=p,C=b.useRef(null),_=St(m,C),k=i(c,v);return b.useEffect(()=>(k.itemMap.set(C,{ref:C,...w}),()=>void k.itemMap.delete(C))),b.createElement(Ms,{[u]:"",ref:_},y)});function h(p){const m=i(e+"CollectionConsumer",p);return b.useCallback(()=>{const y=m.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${u}]`));return Array.from(m.itemMap.values()).sort((k,E)=>w.indexOf(k.ref.current)-w.indexOf(E.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:s,Slot:l,ItemSlot:d},h,r]}const Pr=globalThis!=null&&globalThis.document?b.useLayoutEffect:()=>{},$j=he.useId||(()=>{});let Tj=0;function Xr(e){const[t,n]=he.useState($j());return Pr(()=>{e||n(r=>r??String(Tj++))},[e]),e||(t?`radix-${t}`:"")}const ot=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{const n=b.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?Ms:t;return b.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),b.createElement(a,de({},s,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function V5(e,t){e&&Jt.flushSync(()=>e.dispatchEvent(t))}function or(e){const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function Dr({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=Aj({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=or(n),l=b.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 Aj({defaultProp:e,onChange:t}){const n=b.useState(e),[r]=n,o=b.useRef(r),i=or(t);return b.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const Ij=b.createContext(void 0);function Il(e){const t=b.useContext(Ij);return e||t||"ltr"}const jy="rovingFocusGroup.onEntryFocus",Nj={bubbles:!1,cancelable:!0},zy="RovingFocusGroup",[By,H5,Lj]=Og(zy),[Fj,su]=fr(zy,[Lj]),[Rj,jj]=Fj(zy),zj=b.forwardRef((e,t)=>b.createElement(By.Provider,{scope:e.__scopeRovingFocusGroup},b.createElement(By.Slot,{scope:e.__scopeRovingFocusGroup},b.createElement(Bj,de({},e,{ref:t}))))),Bj=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,...u}=e,d=b.useRef(null),h=St(t,d),p=Il(i),[m=null,v]=Dr({prop:s,defaultProp:a,onChange:l}),[y,w]=b.useState(!1),C=or(c),_=H5(n),k=b.useRef(!1),[E,P]=b.useState(0);return b.useEffect(()=>{const D=d.current;if(D)return D.addEventListener(jy,C),()=>D.removeEventListener(jy,C)},[C]),b.createElement(Rj,{scope:n,orientation:r,dir:p,loop:o,currentTabStopId:m,onItemFocus:b.useCallback(D=>v(D),[v]),onItemShiftTab:b.useCallback(()=>w(!0),[]),onFocusableItemAdd:b.useCallback(()=>P(D=>D+1),[]),onFocusableItemRemove:b.useCallback(()=>P(D=>D-1),[])},b.createElement(ot.div,de({tabIndex:y||E===0?-1:0,"data-orientation":r},u,{ref:h,style:{outline:"none",...e.style},onMouseDown:Ie(e.onMouseDown,()=>{k.current=!0}),onFocus:Ie(e.onFocus,D=>{const M=!k.current;if(D.target===D.currentTarget&&M&&!y){const I=new CustomEvent(jy,Nj);if(D.currentTarget.dispatchEvent(I),!I.defaultPrevented){const F=_().filter(z=>z.focusable),R=F.find(z=>z.active),B=F.find(z=>z.id===m),q=[R,B,...F].filter(Boolean).map(z=>z.ref.current);q5(q)}}k.current=!1}),onBlur:Ie(e.onBlur,()=>w(!1))})))}),Vj="RovingFocusGroupItem",Hj=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=Xr(),l=i||a,c=jj(Vj,n),u=c.currentTabStopId===l,d=H5(n),{onFocusableItemAdd:h,onFocusableItemRemove:p}=c;return b.useEffect(()=>{if(r)return h(),()=>p()},[r,h,p]),b.createElement(By.ItemSlot,{scope:n,id:l,focusable:r,active:o},b.createElement(ot.span,de({tabIndex:u?0:-1,"data-orientation":c.orientation},s,{ref:t,onMouseDown:Ie(e.onMouseDown,m=>{r?c.onItemFocus(l):m.preventDefault()}),onFocus:Ie(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:Ie(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){c.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const v=Uj(m,c.orientation,c.dir);if(v!==void 0){m.preventDefault();let w=d().filter(C=>C.focusable).map(C=>C.ref.current);if(v==="last")w.reverse();else if(v==="prev"||v==="next"){v==="prev"&&w.reverse();const C=w.indexOf(m.currentTarget);w=c.loop?Gj(w,C+1):w.slice(C+1)}setTimeout(()=>q5(w))}})})))}),qj={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Wj(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Uj(e,t,n){const r=Wj(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return qj[r]}function q5(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Gj(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const Vy=zj,Hy=Hj;function Kj(e,t){return b.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const Qn=e=>{const{present:t,children:n}=e,r=Yj(t),o=typeof n=="function"?n({present:r.isPresent}):b.Children.only(n),i=St(r.ref,o.ref);return typeof n=="function"||r.isPresent?b.cloneElement(o,{ref:i}):null};Qn.displayName="Presence";function Yj(e){const[t,n]=b.useState(),r=b.useRef({}),o=b.useRef(e),i=b.useRef("none"),s=e?"mounted":"unmounted",[a,l]=Kj(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const c=Pg(r.current);i.current=a==="mounted"?c:"none"},[a]),Pr(()=>{const c=r.current,u=o.current;if(u!==e){const h=i.current,p=Pg(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]),Pr(()=>{if(t){const c=d=>{const p=Pg(r.current).includes(d.animationName);d.target===t&&p&&Jt.flushSync(()=>l("ANIMATION_END"))},u=d=>{d.target===t&&(i.current=Pg(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:b.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Pg(e){return(e==null?void 0:e.animationName)||"none"}const W5="Tabs",[Xj,f2e]=fr(W5,[su]),U5=su(),[Qj,qy]=Xj(W5),Zj=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=Il(a),[d,h]=Dr({prop:r,onChange:o,defaultProp:i});return b.createElement(Qj,{scope:n,baseId:Xr(),value:d,onValueChange:h,orientation:s,dir:u,activationMode:l},b.createElement(ot.div,de({dir:u,"data-orientation":s},c,{ref:t})))}),Jj="TabsList",ez=b.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=qy(Jj,n),s=U5(n);return b.createElement(Vy,de({asChild:!0},s,{orientation:i.orientation,dir:i.dir,loop:r}),b.createElement(ot.div,de({role:"tablist","aria-orientation":i.orientation},o,{ref:t})))}),tz="TabsTrigger",nz=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=qy(tz,n),a=U5(n),l=G5(s.baseId,r),c=K5(s.baseId,r),u=r===s.value;return b.createElement(Hy,de({asChild:!0},a,{focusable:!o,active:u}),b.createElement(ot.button,de({type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l},i,{ref:t,onMouseDown:Ie(e.onMouseDown,d=>{!o&&d.button===0&&d.ctrlKey===!1?s.onValueChange(r):d.preventDefault()}),onKeyDown:Ie(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&s.onValueChange(r)}),onFocus:Ie(e.onFocus,()=>{const d=s.activationMode!=="manual";!u&&!o&&d&&s.onValueChange(r)})})))}),rz="TabsContent",oz=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=qy(rz,n),l=G5(a.baseId,r),c=K5(a.baseId,r),u=r===a.value,d=b.useRef(u);return b.useEffect(()=>{const h=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(h)},[]),b.createElement(Qn,{present:o||u},({present:h})=>b.createElement(ot.div,de({"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!h,id:c,tabIndex:0},s,{ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0}}),h&&i))});function G5(e,t){return`${e}-trigger-${t}`}function K5(e,t){return`${e}-content-${t}`}const iz=Zj,Y5=ez,X5=nz,Q5=oz,Z5=iz,J5=he.forwardRef(({className:e,...t},n)=>x.jsx(Y5,{ref:n,className:$e("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));J5.displayName=Y5.displayName;const Wy=he.forwardRef(({className:e,...t},n)=>x.jsx(X5,{ref:n,className:$e("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));Wy.displayName=X5.displayName;const Dg=he.forwardRef(({className:e,...t},n)=>x.jsx(Q5,{ref:n,className:$e("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Dg.displayName=Q5.displayName;var ek={exports:{}},gf={},Uy={exports:{}};(function(e,t){(function(n,r){r(t)})(ma,function(n){function r(se){return function(le,xe,K,Fe,ve,ze,Ze){return se(le,xe,Ze)}}function o(se){return function(le,xe,K,Fe){if(!le||!xe||typeof le!="object"||typeof xe!="object")return se(le,xe,K,Fe);var ve=Fe.get(le),ze=Fe.get(xe);if(ve&&ze)return ve===xe&&ze===le;Fe.set(le,xe),Fe.set(xe,le);var Ze=se(le,xe,K,Fe);return Fe.delete(le),Fe.delete(xe),Ze}}function i(se,ne){var le={};for(var xe in se)le[xe]=se[xe];for(var xe in ne)le[xe]=ne[xe];return le}function s(se){return se.constructor===Object||se.constructor==null}function a(se){return typeof se.then=="function"}function l(se,ne){return se===ne||se!==se&&ne!==ne}var c="[object Arguments]",u="[object Boolean]",d="[object Date]",h="[object RegExp]",p="[object Map]",m="[object Number]",v="[object Object]",y="[object Set]",w="[object String]",C=Object.prototype.toString;function _(se){var ne=se.areArraysEqual,le=se.areDatesEqual,xe=se.areMapsEqual,K=se.areObjectsEqual,Fe=se.areRegExpsEqual,ve=se.areSetsEqual,ze=se.createIsNestedEqual,Ze=ze(et);function et(Xe,tt,_t){if(Xe===tt)return!0;if(!Xe||!tt||typeof Xe!="object"||typeof tt!="object")return Xe!==Xe&&tt!==tt;if(s(Xe)&&s(tt))return K(Xe,tt,Ze,_t);var Lt=Array.isArray(Xe),ln=Array.isArray(tt);if(Lt||ln)return Lt===ln&&ne(Xe,tt,Ze,_t);var Zt=C.call(Xe);return Zt!==C.call(tt)?!1:Zt===d?le(Xe,tt,Ze,_t):Zt===h?Fe(Xe,tt,Ze,_t):Zt===p?xe(Xe,tt,Ze,_t):Zt===y?ve(Xe,tt,Ze,_t):Zt===v||Zt===c?a(Xe)||a(tt)?!1:K(Xe,tt,Ze,_t):Zt===u||Zt===m||Zt===w?l(Xe.valueOf(),tt.valueOf()):!1}return et}function k(se,ne,le,xe){var K=se.length;if(ne.length!==K)return!1;for(;K-- >0;)if(!le(se[K],ne[K],K,K,se,ne,xe))return!1;return!0}var E=o(k);function P(se,ne){return l(se.valueOf(),ne.valueOf())}function D(se,ne,le,xe){var K=se.size===ne.size;if(!K)return!1;if(!se.size)return!0;var Fe={},ve=0;return se.forEach(function(ze,Ze){if(K){var et=!1,Xe=0;ne.forEach(function(tt,_t){!et&&!Fe[Xe]&&(et=le(Ze,_t,ve,Xe,se,ne,xe)&&le(ze,tt,Ze,_t,se,ne,xe))&&(Fe[Xe]=!0),Xe++}),ve++,K=et}}),K}var M=o(D),I="_owner",F=Object.prototype.hasOwnProperty;function R(se,ne,le,xe){var K=Object.keys(se),Fe=K.length;if(Object.keys(ne).length!==Fe)return!1;for(var ve;Fe-- >0;){if(ve=K[Fe],ve===I){var ze=!!se.$$typeof,Ze=!!ne.$$typeof;if((ze||Ze)&&ze!==Ze)return!1}if(!F.call(ne,ve)||!le(se[ve],ne[ve],ve,ve,se,ne,xe))return!1}return!0}var B=o(R);function ie(se,ne){return se.source===ne.source&&se.flags===ne.flags}function q(se,ne,le,xe){var K=se.size===ne.size;if(!K)return!1;if(!se.size)return!0;var Fe={};return se.forEach(function(ve,ze){if(K){var Ze=!1,et=0;ne.forEach(function(Xe,tt){!Ze&&!Fe[et]&&(Ze=le(ve,Xe,ze,tt,se,ne,xe))&&(Fe[et]=!0),et++}),K=Ze}}),K}var z=o(q),X=Object.freeze({areArraysEqual:k,areDatesEqual:P,areMapsEqual:D,areObjectsEqual:R,areRegExpsEqual:ie,areSetsEqual:q,createIsNestedEqual:r}),U=Object.freeze({areArraysEqual:E,areDatesEqual:P,areMapsEqual:M,areObjectsEqual:B,areRegExpsEqual:ie,areSetsEqual:z,createIsNestedEqual:r}),Z=_(X);function G(se,ne){return Z(se,ne,void 0)}var $=_(i(X,{createIsNestedEqual:function(){return l}}));function H(se,ne){return $(se,ne,void 0)}var re=_(U);function N(se,ne){return re(se,ne,new WeakMap)}var V=_(i(U,{createIsNestedEqual:function(){return l}}));function ue(se,ne){return V(se,ne,new WeakMap)}function ce(se){return _(i(X,se(X)))}function pe(se){var ne=_(i(U,se(U)));return function(le,xe,K){return K===void 0&&(K=new WeakMap),ne(le,xe,K)}}n.circularDeepEqual=N,n.circularShallowEqual=ue,n.createCustomCircularEqual=pe,n.createCustomEqual=ce,n.deepEqual=G,n.sameValueZeroEqual=l,n.shallowEqual=H,Object.defineProperty(n,"__esModule",{value:!0})})})(Uy,Uy.exports);var Gy=Uy.exports;const Ky=Lb(ZL);var Rt={},sz=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(Rt,"__esModule",{value:!0}),Rt.bottom=Yy,Rt.childrenEqual=uz,Rt.cloneLayout=nk,Rt.cloneLayoutItem=Nl,Rt.collides=Mg,Rt.compact=ok,Rt.compactItem=ik,Rt.compactType=xz,Rt.correctBounds=sk,Rt.fastPositionEqual=fz,Rt.fastRGLPropsEqual=void 0,Rt.getAllCollisions=ak,Rt.getFirstCollision=Ll,Rt.getLayoutItem=Qy,Rt.getStatics=Zy,Rt.modifyLayout=rk,Rt.moveElement=vf,Rt.moveElementAwayFromCollision=Jy,Rt.noop=void 0,Rt.perc=pz,Rt.resizeItemInDirection=mz,Rt.setTopLeft=bz,Rt.setTransform=vz,Rt.sortLayoutItems=i1,Rt.sortLayoutItemsByColRow=fk,Rt.sortLayoutItemsByRowCol=dk,Rt.synchronizeLayoutWithChildren=yz,Rt.validateLayout=hk,Rt.withLayoutItem=cz;var tk=Gy,mf=az(b);function az(e){return e&&e.__esModule?e:{default:e}}const lz=process.env.NODE_ENV==="production";function Yy(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 nk(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=Nl(e[n]);return t}function rk(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 cz(e,t,n){let r=Qy(e,t);return r?(r=n(Nl(r)),e=rk(e,r),[e,r]):[e,null]}function Nl(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 uz(e,t){return(0,tk.deepEqual)(mf.default.Children.map(e,n=>n==null?void 0:n.key),mf.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,tk.deepEqual)(mf.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),mf.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}const dz=sz;Rt.fastRGLPropsEqual=dz;function fz(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function Mg(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 ok(e,t,n,r){const o=Zy(e),i=i1(e,t),s=Array(e.length);for(let a=0,l=i.length;a<l;a++){let c=Nl(i[a]);c.static||(c=ik(o,c,t,n,i,r),o.push(c)),s[e.indexOf(i[a])]=c,c.moved=!1}return s}const hz={x:"w",y:"h"};function Xy(e,t,n,r){const o=hz[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;Mg(t,a)&&Xy(e,a,n+t[o],r)}}t[r]=n}function ik(e,t,n,r,o,i){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(Yy(e),t.y);t.y>0&&!Ll(e,t);)t.y--;else if(a)for(;t.x>0&&!Ll(e,t);)t.x--;let l;for(;(l=Ll(e,t))&&!(n===null&&i);)if(a?Xy(o,t,l.x+l.w,"x"):Xy(o,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!Ll(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function sk(e,t){const n=Zy(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(;Ll(n,i);)i.y++}return e}function Qy(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function Ll(e,t){for(let n=0,r=e.length;n<r;n++)if(Mg(e[n],t))return e[n]}function ak(e,t){return e.filter(n=>Mg(n,t))}function Zy(e){return e.filter(t=>t.static)}function vf(e,t,n,r,o,i,s,a,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;"Moving element ".concat(t.i," to [").concat(String(n),",").concat(String(r),"] from [").concat(t.x,",").concat(t.y,"]");const c=t.x,u=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let d=i1(e,s);(s==="vertical"&&typeof r=="number"?u>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(d=d.reverse());const p=ak(d,t),m=p.length>0;if(m&&l)return nk(e);if(m&&i)return"Collision prevented on ".concat(t.i,", reverting."),t.x=c,t.y=u,t.moved=!1,e;for(let v=0,y=p.length;v<y;v++){const w=p[v];"Resolving collision between ".concat(t.i," at [").concat(t.x,",").concat(t.y,"] and ").concat(w.i," at [").concat(w.x,",").concat(w.y,"]"),!w.moved&&(w.static?e=Jy(e,w,t,o,s):e=Jy(e,t,w,o,s))}return e}function Jy(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=Ll(e,d),p=h&&h.y+h.h>t.y,m=h&&t.x+t.w>h.x;if(h){if(p&&a)return vf(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(m&&s)return vf(e,t,n.x,void 0,r,l,o)}else return"Doing reverse collision on ".concat(n.i," up to [").concat(d.x,",").concat(d.y,"]."),vf(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:vf(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,o)}function pz(e){return e*100+"%"}const lk=(e,t,n,r)=>e+n>r?t:n,ck=(e,t,n)=>e<0?t:n,uk=e=>Math.max(0,e),e1=e=>Math.max(0,e),t1=(e,t,n)=>{let{left:r,height:o,width:i}=t;const s=e.top-(o-e.height);return{left:r,width:i,height:ck(s,e.height,o),top:e1(s)}},n1=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{top:r,height:i,width:lk(e.left,e.width,s,n),left:uk(o)}},r1=(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:lk(e.left,e.width,i,n),top:e1(r),left:uk(s)}},o1=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{width:s,left:o,height:ck(r,e.height,i),top:e1(r)}},gz={n:t1,ne:function(){return t1(arguments.length<=0?void 0:arguments[0],n1(...arguments))},e:n1,se:function(){return o1(arguments.length<=0?void 0:arguments[0],n1(...arguments))},s:o1,sw:function(){return o1(arguments.length<=0?void 0:arguments[0],r1(...arguments))},w:r1,nw:function(){return t1(arguments.length<=0?void 0:arguments[0],r1(...arguments))}};function mz(e,t,n,r){const o=gz[e];return o?o(t,{...t,...n},r):n}function vz(e){let{top:t,left:n,width:r,height:o}=e;const i="translate(".concat(n,"px,").concat(t,"px)");return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:"".concat(r,"px"),height:"".concat(o,"px"),position:"absolute"}}function bz(e){let{top:t,left:n,width:r,height:o}=e;return{top:"".concat(t,"px"),left:"".concat(n,"px"),width:"".concat(r,"px"),height:"".concat(o,"px"),position:"absolute"}}function i1(e,t){return t==="horizontal"?fk(e):t==="vertical"?dk(e):e}function dk(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 fk(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 yz(e,t,n,r,o){e=e||[];const i=[];mf.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=Qy(e,String(a.key)),c=a.props["data-grid"];l&&c==null?i.push(Nl(l)):c?(lz||hk([c],"ReactGridLayout.children"),i.push(Nl({...c,i:a.key}))):i.push(Nl({w:1,h:1,x:0,y:Yy(i),i:String(a.key)}))});const s=sk(i,{cols:n});return o?s:ok(s,r,n)}function hk(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const n=["x","y","w","h"];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(let r=0,o=e.length;r<o;r++){const i=e[r];for(let s=0;s<n.length;s++)if(typeof i[n[s]]!="number")throw new Error("ReactGridLayout: "+t+"["+r+"]."+n[s]+" must be a number!")}}function xz(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}function v2e(){}const wz=()=>{};Rt.noop=wz;var Hi={};Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.calcGridColWidth=$g,Hi.calcGridItemPosition=Sz,Hi.calcGridItemWHPx=s1,Hi.calcWH=_z,Hi.calcXY=Cz,Hi.clamp=Fl;function $g(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function s1(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function Sz(e,t,n,r,o,i){const{margin:s,containerPadding:a,rowHeight:l}=e,c=$g(e),u={};return i&&i.resizing?(u.width=Math.round(i.resizing.width),u.height=Math.round(i.resizing.height)):(u.width=s1(r,c,s[0]),u.height=s1(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 Cz(e,t,n,r,o){const{margin:i,cols:s,rowHeight:a,maxRows:l}=e,c=$g(e);let u=Math.round((n-i[0])/(c+i[0])),d=Math.round((t-i[1])/(a+i[1]));return u=Fl(u,0,s-r),d=Fl(d,0,l-o),{x:u,y:d}}function _z(e,t,n,r,o,i){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,u=$g(e);let d=Math.round((t+s[0])/(u+s[0])),h=Math.round((n+s[1])/(c+s[1])),p=Fl(d,0,l-r),m=Fl(h,0,a-o);return["sw","w","nw"].indexOf(i)!==-1&&(p=Fl(d,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(m=Fl(h,0,a)),{w:p,h:m}}function Fl(e,t,n){return Math.max(Math.min(e,n),t)}var Tg={},a1={exports:{}},l1,pk;function c1(){if(pk)return l1;pk=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return l1=e,l1}var u1,gk;function Ez(){if(gk)return u1;gk=1;var e=c1();function t(){}function n(){}return n.resetWarningCache=t,u1=function(){function r(s,a,l,c,u,d){if(d!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function o(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},u1}var Ag={exports:{}},on={};/** @license React v16.13.1
86
86
  * react-is.development.js
87
87
  *
88
88
  * Copyright (c) Facebook, Inc. and its affiliates.
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.0.129",
8
+ "version": "0.0.131",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",