react-semaphor 0.0.88 → 0.0.89

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.
@@ -6315,7 +6315,7 @@ function lo() {
6315
6315
  function jF(e, t) {
6316
6316
  var Ce;
6317
6317
  let n = Sn(() => [], []);
6318
- const { authToken: r } = lo() || e, i = we(
6318
+ const r = lo().authToken || e, i = we(
6319
6319
  (q) => q.selectedConnectionId
6320
6320
  ), o = we(
6321
6321
  (q) => q.selectedDatabaseName
@@ -56,7 +56,7 @@ Check the top-level render call using <`+oe+">.")}return Y}}function qa(D,Y){{if
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 Ow;function f3(){if(Ow)return ym;Ow=1;var e=m,t=Cw();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,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return ym.useSyncExternalStoreWithSelector=function(c,u,f,g,p){var v=o(null);if(v.current===null){var b={hasValue:!1,value:null};v.current=b}else b=v.current;v=a(function(){function w(k){if(!S){if(S=!0,C=k,k=g(k),p!==void 0&&b.hasValue){var T=b.value;if(p(T,k))return P=T}return P=k}if(T=P,r(C,k))return T;var I=g(k);return p!==void 0&&p(T,I)?T:(C=k,P=I)}var S=!1,C,P,O=f===void 0?null:f;return[function(){return w(u())},O===null?void 0:function(){return w(O())}]},[u,f,g,p]);var x=i(c,v[0],v[1]);return s(function(){b.hasValue=!0,b.value=x},[x]),l(x),x},ym}process.env.NODE_ENV==="production"?gm.exports=f3():gm.exports=d3();var h3=gm.exports;const p3=Lc(h3);var Pw={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:g3}=m,{useSyncExternalStoreWithSelector:m3}=p3;let kw=!1;function v3(e,t=e.getState,n){(Pw?"production":void 0)!=="production"&&n&&!kw&&(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"),kw=!0);const r=m3(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return g3(r),r}const Dw=e=>{(Pw?"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"?l3(e):e,n=(r,i)=>v3(t,r,i);return Object.assign(n,t),n},Mw=e=>e?Dw(e):Dw;var Tw=Symbol.for("immer-nothing"),Aw=Symbol.for("immer-draftable"),_r=Symbol.for("immer-state"),b3=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 ir(e,...t){if(process.env.NODE_ENV!=="production"){const n=b3[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 cl=Object.getPrototypeOf;function ul(e){return!!e&&!!e[_r]}function zs(e){var t;return e?Iw(e)||Array.isArray(e)||!!e[Aw]||!!((t=e.constructor)!=null&&t[Aw])||uf(e)||df(e):!1}var y3=Object.prototype.constructor.toString();function Iw(e){if(!e||typeof e!="object")return!1;const t=cl(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)===y3}function Vc(e,t){cf(e)===0?Object.entries(e).forEach(([n,r])=>{t(n,r,e)}):e.forEach((n,r)=>t(r,n,e))}function cf(e){const t=e[_r];return t?t.type_:Array.isArray(e)?1:uf(e)?2:df(e)?3:0}function xm(e,t){return cf(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Nw(e,t,n){const r=cf(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function x3(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function uf(e){return e instanceof Map}function df(e){return e instanceof Set}function Bs(e){return e.copy_||e.base_}function wm(e,t){if(uf(e))return new Map(e);if(df(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&Iw(e))return cl(e)?{...e}:Object.assign(Object.create(null),e);const n=Object.getOwnPropertyDescriptors(e);delete n[_r];let r=Reflect.ownKeys(n);for(let i=0;i<r.length;i++){const o=r[i],s=n[o];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(n[o]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[o]})}return Object.create(cl(e),n)}function _m(e,t=!1){return ff(e)||ul(e)||!zs(e)||(cf(e)>1&&(e.set=e.add=e.clear=e.delete=w3),Object.freeze(e),t&&Vc(e,(n,r)=>_m(r,!0))),e}function w3(){ir(2)}function ff(e){return Object.isFrozen(e)}var _3={};function Vs(e){const t=_3[e];return t||ir(0,e),t}var Hc;function Rw(){return Hc}function S3(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Lw(e,t){t&&(Vs("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Sm(e){Cm(e),e.drafts_.forEach(C3),e.drafts_=null}function Cm(e){e===Hc&&(Hc=e.parent_)}function Fw(e){return Hc=S3(Hc,e)}function C3(e){const t=e[_r];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function $w(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[_r].modified_&&(Sm(t),ir(4)),zs(e)&&(e=hf(t,e),t.parent_||pf(t,e)),t.patches_&&Vs("Patches").generateReplacementPatches_(n[_r].base_,e,t.patches_,t.inversePatches_)):e=hf(t,n,[]),Sm(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Tw?e:void 0}function hf(e,t,n){if(ff(t))return t;const r=t[_r];if(!r)return Vc(t,(i,o)=>jw(e,r,t,i,o,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return pf(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const i=r.copy_;let o=i,s=!1;r.type_===3&&(o=new Set(i),i.clear(),s=!0),Vc(o,(a,l)=>jw(e,r,i,a,l,n,s)),pf(e,i,!1),n&&e.patches_&&Vs("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function jw(e,t,n,r,i,o,s){if(process.env.NODE_ENV!=="production"&&i===n&&ir(5),ul(i)){const a=o&&t&&t.type_!==3&&!xm(t.assigned_,r)?o.concat(r):void 0,l=hf(e,i,a);if(Nw(n,r,l),ul(l))e.canAutoFreeze_=!1;else return}else s&&n.add(i);if(zs(i)&&!ff(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;hf(e,i),(!t||!t.scope_.parent_)&&pf(e,i)}}function pf(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&_m(t,n)}function E3(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:Rw(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,o=Em;n&&(i=[r],o=Wc);const{revoke:s,proxy:a}=Proxy.revocable(i,o);return r.draft_=a,r.revoke_=s,a}var Em={get(e,t){if(t===_r)return e;const n=Bs(e);if(!xm(n,t))return O3(e,n,t);const r=n[t];return e.finalized_||!zs(r)?r:r===Om(e.base_,t)?(km(e),e.copy_[t]=Dm(r,e)):r},has(e,t){return t in Bs(e)},ownKeys(e){return Reflect.ownKeys(Bs(e))},set(e,t,n){const r=zw(Bs(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=Om(Bs(e),t),o=i==null?void 0:i[_r];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(x3(n,i)&&(n!==void 0||xm(e.base_,t)))return!0;km(e),Pm(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 Om(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,km(e),Pm(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Bs(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){ir(11)},getPrototypeOf(e){return cl(e.base_)},setPrototypeOf(){ir(12)}},Wc={};Vc(Em,(e,t)=>{Wc[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Wc.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&ir(13),Wc.set.call(this,e,t,void 0)},Wc.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&ir(14),Em.set.call(this,e[0],t,n,e[0])};function Om(e,t){const n=e[_r];return(n?Bs(n):e)[t]}function O3(e,t,n){var i;const r=zw(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function zw(e,t){if(!(t in e))return;let n=cl(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=cl(n)}}function Pm(e){e.modified_||(e.modified_=!0,e.parent_&&Pm(e.parent_))}function km(e){e.copy_||(e.copy_=wm(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var P3=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const o=n;n=t;const s=this;return function(l=o,...c){return s.produce(l,u=>n.call(this,u,...c))}}typeof n!="function"&&ir(6),r!==void 0&&typeof r!="function"&&ir(7);let i;if(zs(t)){const o=Fw(this),s=Dm(t,void 0);let a=!0;try{i=n(s),a=!1}finally{a?Sm(o):Cm(o)}return Lw(o,r),$w(i,o)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===Tw&&(i=void 0),this.autoFreeze_&&_m(i,!0),r){const o=[],s=[];Vs("Patches").generateReplacementPatches_(t,i,o,s),r(o,s)}return i}else ir(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...a)=>this.produceWithPatches(s,l=>t(l,...a));let r,i;return[this.produce(t,n,(s,a)=>{r=s,i=a}),r,i]},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){zs(e)||ir(8),ul(e)&&(e=k3(e));const t=Fw(this),n=Dm(e,void 0);return n[_r].isManual_=!0,Cm(t),n}finishDraft(e,t){const n=e&&e[_r];(!n||!n.isManual_)&&ir(9);const{scope_:r}=n;return Lw(r,t),$w(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 i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=Vs("Patches").applyPatches_;return ul(e)?r(e,t):this.produce(e,i=>r(i,t))}};function Dm(e,t){const n=uf(e)?Vs("MapSet").proxyMap_(e,t):df(e)?Vs("MapSet").proxySet_(e,t):E3(e,t);return(t?t.scope_:Rw()).drafts_.push(n),n}function k3(e){return ul(e)||ir(10,e),Bw(e)}function Bw(e){if(!zs(e)||ff(e))return e;const t=e[_r];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=wm(e,t.scope_.immer_.useStrictShallowCopy_)}else n=wm(e,!0);return Vc(n,(r,i)=>{Nw(n,r,Bw(i))}),t&&(t.finalized_=!1),n}var Sr=new P3,D3=Sr.produce;Sr.produceWithPatches.bind(Sr),Sr.setAutoFreeze.bind(Sr),Sr.setUseStrictShallowCopy.bind(Sr),Sr.applyPatches.bind(Sr),Sr.createDraft.bind(Sr),Sr.finishDraft.bind(Sr);const Vw=e=>(t,n,r)=>(r.setState=(i,o,...s)=>{const a=typeof i=="function"?D3(i):i;return t(a,o,...s)},e(r.setState,n,r));var gf,mf=kt;if(process.env.NODE_ENV==="production")gf=mf.createRoot,mf.hydrateRoot;else{var Hw=mf.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;gf=function(e,t){Hw.usingClientEntryPoint=!0;try{return mf.createRoot(e,t)}finally{Hw.usingClientEntryPoint=!1}}}function Ww(e,t,n){const r={count:0},i=a=>{const l=m.useRef(r.count);return m.useEffect(()=>{l.current+=1,l.current===r.count+1&&(l.current-=1,t.setState(a))}),null};if(i.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 o=gf(n),s=a=>{a&&(o.render(m.createElement(i,Object.assign({},a))),r.count+=1)};s(t.getState()),t.subscribe(s)}var Uw={},qw={},Mm={exports:{}},Xt=String,Gw=function(){return{isColorSupported:!1,reset:Xt,bold:Xt,dim:Xt,italic:Xt,underline:Xt,inverse:Xt,hidden:Xt,strikethrough:Xt,black:Xt,red:Xt,green:Xt,yellow:Xt,blue:Xt,magenta:Xt,cyan:Xt,white:Xt,gray:Xt,bgBlack:Xt,bgRed:Xt,bgGreen:Xt,bgYellow:Xt,bgBlue:Xt,bgMagenta:Xt,bgCyan:Xt,bgWhite:Xt}};Mm.exports=Gw(),Mm.exports.createColors=Gw;var M3=Mm.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(M3);function r(l){return l&&l.__esModule?l:{default:l}}let i=new Set;function o(l,c,u){typeof process<"u"&&process.env.JEST_WORKER_ID||u&&i.has(u)||(u&&i.add(u),console.warn(""),c.forEach(f=>console.warn(l,"-",f)))}function s(l){return n.default.dim(l)}const a={info(l,c){o(n.default.bold(n.default.cyan("info")),...Array.isArray(l)?[l]:[c,l])},warn(l,c){o(n.default.bold(n.default.yellow("warn")),...Array.isArray(l)?[l]:[c,l])},risk(l,c){o(n.default.bold(n.default.magenta("risk")),...Array.isArray(l)?[l]:[c,l])}}})(qw),function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return i}});const t=n(qw);function n(o){return o&&o.__esModule?o:{default:o}}function r({version:o,from:s,to:a}){t.default.warn(`${s}-color-renamed`,[`As of Tailwind CSS ${o}, \`${s}\` has been renamed to \`${a}\`.`,"Update your configuration file to silence this warning."])}const i={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}}}(Uw);let Tm=Uw;var T3=(Tm.__esModule?Tm:{default:Tm}).default;const rn=Lc(T3),Am={default:{dashboardPanel:"",dashboardTabsContainer:"",gridLayout:{className:""},chart:{font:{family:"Open Sans, Arial, sans-serif"},dataset:{backgroundColor:[rn.blue[500],rn.teal[500],rn.amber[500],rn.red[500],rn.indigo[500],rn.green[500]],borderColor:[rn.blue[500],rn.teal[500],rn.amber[500],rn.red[500],rn.indigo[500],rn.green[500]]},options:{plugins:{datalabels:{display:!1,color:A3},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:[rn.teal[100],rn.purple[100],rn.amber[100],rn.orange[100],rn.rose[100]],borderColor:[rn.teal[400],rn.purple[400],rn.amber[400],rn.orange[300],rn.rose[400]]},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:rn.slate[800]}},y:{grid:{display:!0,color:rn.slate[800]}}}}}}};function A3(e){var r,i,o,s,a,l;const t=(a=(s=(o=(i=(r=e==null?void 0:e.chart)==null?void 0:r.config)==null?void 0:i._config)==null?void 0:o.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=Yw()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=Yw()),I3(n)}function Yw(){return pe.getState().theme==="dark"?"#000000":"#FFFFFF"}function I3(e){let t=0,n=0,r=0,i=0;const o=u=>{const f=u.replace("#",""),g=parseInt(f.substring(0,2),16),p=parseInt(f.substring(2,4),16),v=parseInt(f.substring(4,6),16);t+=g,n+=p,r+=v,i++};Array.isArray(e)?e.forEach(u=>{o(u)}):o(e);const s=t/i,a=n/i,l=r/i;return(s*299+a*587+l*114)/1e3>=180?"black":"white"}var Uc=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(){}},dl=typeof window>"u"||"Deno"in window;function Kr(){}function N3(e,t){return typeof e=="function"?e(t):e}function Im(e){return typeof e=="number"&&e>=0&&e!==1/0}function Kw(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Xw(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==Nm(s,t.options))return!1}else if(!Gc(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 i<"u"&&i!==t.state.fetchStatus||o&&!o(t))}function Qw(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(qc(t.options.mutationKey)!==qc(o))return!1}else if(!Gc(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Nm(e,t){return((t==null?void 0:t.queryKeyHashFn)||qc)(e)}function qc(e){return JSON.stringify(e,(t,n)=>Lm(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Gc(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Gc(e[n],t[n])):!1}function Zw(e,t){if(e===t)return e;const n=Jw(e)&&Jw(t);if(n||Lm(e)&&Lm(t)){const r=n?e:Object.keys(e),i=r.length,o=n?t:Object.keys(t),s=o.length,a=n?[]:{};let l=0;for(let c=0;c<s;c++){const u=n?c:o[c];!n&&e[u]===void 0&&t[u]===void 0&&r.includes(u)?(a[u]=void 0,l++):(a[u]=Zw(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return i===s&&l===i?e:a}return t}function Rm(e,t){if(e&&!t||t&&!e)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Jw(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Lm(e){if(!e_(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!e_(n)||!n.hasOwnProperty("isPrototypeOf"))}function e_(e){return Object.prototype.toString.call(e)==="[object Object]"}function R3(e){return new Promise(t=>{setTimeout(t,e)})}function Fm(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Zw(e,t):t}function L3(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function F3(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var $3=(H5=class extends Uc{constructor(){super();Ve(this,Ra,void 0);Ve(this,ws,void 0);Ve(this,sc,void 0);Re(this,sc,t=>{if(!dl&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){X(this,ws)||this.setEventListener(X(this,sc))}onUnsubscribe(){var t;this.hasListeners()||((t=X(this,ws))==null||t.call(this),Re(this,ws,void 0))}setEventListener(t){var n;Re(this,sc,t),(n=X(this,ws))==null||n.call(this),Re(this,ws,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){X(this,Ra)!==t&&(Re(this,Ra,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof X(this,Ra)=="boolean"?X(this,Ra):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ra=new WeakMap,ws=new WeakMap,sc=new WeakMap,H5),vf=new $3,j3=(W5=class extends Uc{constructor(){super();Ve(this,ac,!0);Ve(this,_s,void 0);Ve(this,lc,void 0);Re(this,lc,t=>{if(!dl&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){X(this,_s)||this.setEventListener(X(this,lc))}onUnsubscribe(){var t;this.hasListeners()||((t=X(this,_s))==null||t.call(this),Re(this,_s,void 0))}setEventListener(t){var n;Re(this,lc,t),(n=X(this,_s))==null||n.call(this),Re(this,_s,t(this.setOnline.bind(this)))}setOnline(t){X(this,ac)!==t&&(Re(this,ac,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return X(this,ac)}},ac=new WeakMap,_s=new WeakMap,lc=new WeakMap,W5),bf=new j3;function z3(e){return Math.min(1e3*2**e,3e4)}function yf(e){return(e??"online")==="online"?bf.isOnline():!0}var t_=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function $m(e){return e instanceof t_}function n_(e){let t=!1,n=0,r=!1,i,o,s;const a=new Promise((x,w)=>{o=x,s=w}),l=x=>{var w;r||(p(new t_(x)),(w=e.abort)==null||w.call(e))},c=()=>{t=!0},u=()=>{t=!1},f=()=>!vf.isFocused()||e.networkMode!=="always"&&!bf.isOnline(),g=x=>{var w;r||(r=!0,(w=e.onSuccess)==null||w.call(e,x),i==null||i(),o(x))},p=x=>{var w;r||(r=!0,(w=e.onError)==null||w.call(e,x),i==null||i(),s(x))},v=()=>new Promise(x=>{var w;i=S=>{const C=r||!f();return C&&x(S),C},(w=e.onPause)==null||w.call(e)}).then(()=>{var x;i=void 0,r||(x=e.onContinue)==null||x.call(e)}),b=()=>{if(r)return;let x;try{x=e.fn()}catch(w){x=Promise.reject(w)}Promise.resolve(x).then(g).catch(w=>{var k;if(r)return;const S=e.retry??(dl?0:3),C=e.retryDelay??z3,P=typeof C=="function"?C(n,w):C,O=S===!0||typeof S=="number"&&n<S||typeof S=="function"&&S(n,w);if(t||!O){p(w);return}n++,(k=e.onFail)==null||k.call(e,n,w),R3(P).then(()=>{if(f())return v()}).then(()=>{t?p(w):b()})})};return yf(e.networkMode)?b():v().then(b),{promise:a,cancel:l,continue:()=>(i==null?void 0:i())?a:Promise.resolve(),cancelRetry:c,continueRetry:u}}function B3(){let e=[],t=0,n=g=>{g()},r=g=>{g()},i=g=>setTimeout(g,0);const o=g=>{i=g},s=g=>{let p;t++;try{p=g()}finally{t--,t||c()}return p},a=g=>{t?e.push(g):i(()=>{n(g)})},l=g=>(...p)=>{a(()=>{g(...p)})},c=()=>{const g=e;e=[],g.length&&i(()=>{r(()=>{g.forEach(p=>{n(p)})})})};return{batch:s,batchCalls:l,schedule:a,setNotifyFunction:g=>{n=g},setBatchNotifyFunction:g=>{r=g},setScheduler:o}}var In=B3(),r_=(U5=class{constructor(){Ve(this,La,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Im(this.gcTime)&&Re(this,La,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(dl?1/0:5*60*1e3))}clearGcTimeout(){X(this,La)&&(clearTimeout(X(this,La)),Re(this,La,void 0))}},La=new WeakMap,U5),V3=(q5=class extends r_{constructor(t){super();Ve(this,dc);Ve(this,Pi);Ve(this,cc,void 0);Ve(this,uc,void 0);Ve(this,oi,void 0);Ve(this,Ss,void 0);Ve(this,si,void 0);Ve(this,Mn,void 0);Ve(this,Ed,void 0);Ve(this,Fa,void 0);Re(this,Fa,!1),Re(this,Ed,t.defaultOptions),wt(this,dc,um).call(this,t.options),Re(this,Mn,[]),Re(this,oi,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Re(this,cc,t.state||H3(this.options)),this.state=X(this,cc),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!X(this,Mn).length&&this.state.fetchStatus==="idle"&&X(this,oi).remove(this)}setData(t,n){const r=Fm(this.state.data,t,this.options);return wt(this,Pi,Ho).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){wt(this,Pi,Ho).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=X(this,Ss);return(r=X(this,si))==null||r.cancel(t),n?n.then(Kr).catch(Kr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(X(this,cc))}isActive(){return X(this,Mn).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||X(this,Mn).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!Kw(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=X(this,Mn).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=X(this,si))==null||n.continue()}onOnline(){var n;const t=X(this,Mn).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=X(this,si))==null||n.continue()}addObserver(t){X(this,Mn).includes(t)||(X(this,Mn).push(t),this.clearGcTimeout(),X(this,oi).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){X(this,Mn).includes(t)&&(Re(this,Mn,X(this,Mn).filter(n=>n!==t)),X(this,Mn).length||(X(this,si)&&(X(this,Fa)?X(this,si).cancel({revert:!0}):X(this,si).cancelRetry()),this.scheduleGc()),X(this,oi).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return X(this,Mn).length}invalidate(){this.state.isInvalidated||wt(this,Pi,Ho).call(this,{type:"invalidate"})}fetch(t,n){var c,u,f,g;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(X(this,Ss))return(c=X(this,si))==null||c.continueRetry(),X(this,Ss)}if(t&&wt(this,dc,um).call(this,t),!this.options.queryFn){const p=X(this,Mn).find(v=>v.options.queryFn);p&&wt(this,dc,um).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,i={queryKey:this.queryKey,meta:this.meta},o=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(Re(this,Fa,!0),r.signal)})};o(i);const s=()=>this.options.queryFn?(Re(this,Fa,!1),this.options.persister?this.options.persister(this.options.queryFn,i,this):this.options.queryFn(i)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),a={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};o(a),(u=this.options.behavior)==null||u.onFetch(a,this),Re(this,uc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=a.fetchOptions)==null?void 0:f.meta))&&wt(this,Pi,Ho).call(this,{type:"fetch",meta:(g=a.fetchOptions)==null?void 0:g.meta});const l=p=>{var v,b,x,w;$m(p)&&p.silent||wt(this,Pi,Ho).call(this,{type:"error",error:p}),$m(p)||((b=(v=X(this,oi).config).onError)==null||b.call(v,p,this),(w=(x=X(this,oi).config).onSettled)==null||w.call(x,this.state.data,p,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return Re(this,si,n_({fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:p=>{var v,b,x,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),(b=(v=X(this,oi).config).onSuccess)==null||b.call(v,p,this),(w=(x=X(this,oi).config).onSettled)==null||w.call(x,p,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(p,v)=>{wt(this,Pi,Ho).call(this,{type:"failed",failureCount:p,error:v})},onPause:()=>{wt(this,Pi,Ho).call(this,{type:"pause"})},onContinue:()=>{wt(this,Pi,Ho).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),Re(this,Ss,X(this,si).promise),X(this,Ss)}},cc=new WeakMap,uc=new WeakMap,oi=new WeakMap,Ss=new WeakMap,si=new WeakMap,Mn=new WeakMap,Ed=new WeakMap,Fa=new WeakMap,dc=new WeakSet,um=function(t){this.options={...X(this,Ed),...t},this.updateGcTime(this.options.gcTime)},Pi=new WeakSet,Ho=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:yf(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 i=t.error;return $m(i)&&i.revert&&X(this,uc)?{...X(this,uc),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),In.batch(()=>{X(this,Mn).forEach(r=>{r.onQueryUpdate()}),X(this,oi).notify({query:this,type:"updated",action:t})})},q5);function H3(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 W3=(G5=class extends Uc{constructor(t={}){super();Ve(this,Zi,void 0);this.config=t,Re(this,Zi,new Map)}build(t,n,r){const i=n.queryKey,o=n.queryHash??Nm(i,n);let s=this.get(o);return s||(s=new V3({cache:this,queryKey:i,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(s)),s}add(t){X(this,Zi).has(t.queryHash)||(X(this,Zi).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=X(this,Zi).get(t.queryHash);n&&(t.destroy(),n===t&&X(this,Zi).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){In.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return X(this,Zi).get(t)}getAll(){return[...X(this,Zi).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Xw(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Xw(t,r)):n}notify(t){In.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){In.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){In.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Zi=new WeakMap,G5),U3=(Y5=class extends r_{constructor(t){super();Ve(this,eo);Ve(this,Ji,void 0);Ve(this,Od,void 0);Ve(this,zr,void 0);Ve(this,fc,void 0);this.mutationId=t.mutationId,Re(this,Od,t.defaultOptions),Re(this,zr,t.mutationCache),Re(this,Ji,[]),this.state=t.state||q3(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...X(this,Od),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){X(this,Ji).includes(t)||(X(this,Ji).push(t),this.clearGcTimeout(),X(this,zr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Re(this,Ji,X(this,Ji).filter(n=>n!==t)),this.scheduleGc(),X(this,zr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){X(this,Ji).length||(this.state.status==="pending"?this.scheduleGc():X(this,zr).remove(this))}continue(){var t;return((t=X(this,fc))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,s,a,l,c,u,f,g,p,v,b,x,w,S,C,P,O,k,T;const n=()=>(Re(this,fc,n_({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(I,F)=>{wt(this,eo,Fs).call(this,{type:"failed",failureCount:I,error:F})},onPause:()=>{wt(this,eo,Fs).call(this,{type:"pause"})},onContinue:()=>{wt(this,eo,Fs).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),X(this,fc).promise),r=this.state.status==="pending";try{if(!r){wt(this,eo,Fs).call(this,{type:"pending",variables:t}),await((o=(i=X(this,zr).config).onMutate)==null?void 0:o.call(i,t,this));const F=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));F!==this.state.context&&wt(this,eo,Fs).call(this,{type:"pending",context:F,variables:t})}const I=await n();return await((c=(l=X(this,zr).config).onSuccess)==null?void 0:c.call(l,I,t,this.state.context,this)),await((f=(u=this.options).onSuccess)==null?void 0:f.call(u,I,t,this.state.context)),await((p=(g=X(this,zr).config).onSettled)==null?void 0:p.call(g,I,null,this.state.variables,this.state.context,this)),await((b=(v=this.options).onSettled)==null?void 0:b.call(v,I,null,t,this.state.context)),wt(this,eo,Fs).call(this,{type:"success",data:I}),I}catch(I){try{throw await((w=(x=X(this,zr).config).onError)==null?void 0:w.call(x,I,t,this.state.context,this)),await((C=(S=this.options).onError)==null?void 0:C.call(S,I,t,this.state.context)),await((O=(P=X(this,zr).config).onSettled)==null?void 0:O.call(P,void 0,I,this.state.variables,this.state.context,this)),await((T=(k=this.options).onSettled)==null?void 0:T.call(k,void 0,I,t,this.state.context)),I}finally{wt(this,eo,Fs).call(this,{type:"error",error:I})}}}},Ji=new WeakMap,Od=new WeakMap,zr=new WeakMap,fc=new WeakMap,eo=new WeakSet,Fs=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!yf(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),In.batch(()=>{X(this,Ji).forEach(r=>{r.onMutationUpdate(t)}),X(this,zr).notify({mutation:this,type:"updated",action:t})})},Y5);function q3(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var G3=(K5=class extends Uc{constructor(t={}){super();Ve(this,ai,void 0);Ve(this,Pd,void 0);Ve(this,$a,void 0);this.config=t,Re(this,ai,[]),Re(this,Pd,0)}build(t,n,r){const i=new U3({mutationCache:this,mutationId:++cm(this,Pd)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){X(this,ai).push(t),this.notify({type:"added",mutation:t})}remove(t){Re(this,ai,X(this,ai).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){In.batch(()=>{X(this,ai).forEach(t=>{this.remove(t)})})}getAll(){return X(this,ai)}find(t){const n={exact:!0,...t};return X(this,ai).find(r=>Qw(n,r))}findAll(t={}){return X(this,ai).filter(n=>Qw(t,n))}notify(t){In.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return Re(this,$a,(X(this,$a)??Promise.resolve()).then(()=>{const t=X(this,ai).filter(n=>n.state.isPaused);return In.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(Kr)),Promise.resolve()))}).then(()=>{Re(this,$a,void 0)})),X(this,$a)}},ai=new WeakMap,Pd=new WeakMap,$a=new WeakMap,K5);function Y3(e){return{onFetch:(t,n)=>{const r=async()=>{var v,b,x,w,S;const i=t.options,o=(x=(b=(v=t.fetchOptions)==null?void 0:v.meta)==null?void 0:b.fetchMore)==null?void 0:x.direction,s=((w=t.state.data)==null?void 0:w.pages)||[],a=((S=t.state.data)==null?void 0:S.pageParams)||[],l={pages:[],pageParams:[]};let c=!1;const u=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(t.signal.aborted?c=!0:t.signal.addEventListener("abort",()=>{c=!0}),t.signal)})},f=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),g=async(C,P,O)=>{if(c)return Promise.reject();if(P==null&&C.pages.length)return Promise.resolve(C);const k={queryKey:t.queryKey,pageParam:P,direction:O?"backward":"forward",meta:t.options.meta};u(k);const T=await f(k),{maxPages:I}=t.options,F=O?F3:L3;return{pages:F(C.pages,T,I),pageParams:F(C.pageParams,P,I)}};let p;if(o&&s.length){const C=o==="backward",P=C?K3:i_,O={pages:s,pageParams:a},k=P(i,O);p=await g(O,k,C)}else{p=await g(l,a[0]??i.initialPageParam);const C=e??s.length;for(let P=1;P<C;P++){const O=i_(i,p);p=await g(p,O)}}return p};t.options.persister?t.fetchFn=()=>{var i,o;return(o=(i=t.options).persister)==null?void 0:o.call(i,r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=r}}}function i_(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function K3(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var o_=(X5=class{constructor(e={}){Ve(this,En,void 0);Ve(this,Cs,void 0);Ve(this,Es,void 0);Ve(this,hc,void 0);Ve(this,pc,void 0);Ve(this,Os,void 0);Ve(this,gc,void 0);Ve(this,mc,void 0);Re(this,En,e.queryCache||new W3),Re(this,Cs,e.mutationCache||new G3),Re(this,Es,e.defaultOptions||{}),Re(this,hc,new Map),Re(this,pc,new Map),Re(this,Os,0)}mount(){cm(this,Os)._++,X(this,Os)===1&&(Re(this,gc,vf.subscribe(()=>{vf.isFocused()&&(this.resumePausedMutations(),X(this,En).onFocus())})),Re(this,mc,bf.subscribe(()=>{bf.isOnline()&&(this.resumePausedMutations(),X(this,En).onOnline())})))}unmount(){var e,t;cm(this,Os)._--,X(this,Os)===0&&((e=X(this,gc))==null||e.call(this),Re(this,gc,void 0),(t=X(this,mc))==null||t.call(this),Re(this,mc,void 0))}isFetching(e){return X(this,En).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return X(this,Cs).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=X(this,En).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=X(this,En).find({queryKey:e}),i=r==null?void 0:r.state.data,o=N3(t,i);if(typeof o>"u")return;const s=this.defaultQueryOptions({queryKey:e});return X(this,En).build(this,s).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return In.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var t;return(t=X(this,En).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=X(this,En);In.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=X(this,En),r={type:"active",...e};return In.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=In.batch(()=>X(this,En).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Kr).catch(Kr)}invalidateQueries(e={},t={}){return In.batch(()=>{if(X(this,En).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=In.batch(()=>X(this,En).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(Kr)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Kr)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=X(this,En).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Kr).catch(Kr)}fetchInfiniteQuery(e){return e.behavior=Y3(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Kr).catch(Kr)}resumePausedMutations(){return X(this,Cs).resumePausedMutations()}getQueryCache(){return X(this,En)}getMutationCache(){return X(this,Cs)}getDefaultOptions(){return X(this,Es)}setDefaultOptions(e){Re(this,Es,e)}setQueryDefaults(e,t){X(this,hc).set(qc(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...X(this,hc).values()];let n={};return t.forEach(r=>{Gc(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){X(this,pc).set(qc(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...X(this,pc).values()];let n={};return t.forEach(r=>{Gc(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...X(this,Es).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Nm(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:{...X(this,Es).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){X(this,En).clear(),X(this,Cs).clear()}},En=new WeakMap,Cs=new WeakMap,Es=new WeakMap,hc=new WeakMap,pc=new WeakMap,Os=new WeakMap,gc=new WeakMap,mc=new WeakMap,X5),X3=(Q5=class extends Uc{constructor(t,n){super();Ve(this,Va);Ve(this,Md);Ve(this,Td);Ve(this,Ad);Ve(this,Id);Ve(this,Nd);Ve(this,Rd);Ve(this,Ld);Ve(this,wg);Ve(this,gr,void 0);Ve(this,tn,void 0);Ve(this,kd,void 0);Ve(this,er,void 0);Ve(this,ja,void 0);Ve(this,vc,void 0);Ve(this,to,void 0);Ve(this,Dd,void 0);Ve(this,bc,void 0);Ve(this,yc,void 0);Ve(this,za,void 0);Ve(this,Ba,void 0);Ve(this,Ps,void 0);Ve(this,xc,new Set);this.options=n,Re(this,gr,t),Re(this,to,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(X(this,tn).addObserver(this),s_(X(this,tn),this.options)?wt(this,Va,of).call(this):this.updateResult(),wt(this,Id,sw).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return jm(X(this,tn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return jm(X(this,tn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,wt(this,Nd,aw).call(this),wt(this,Rd,lw).call(this),X(this,tn).removeObserver(this)}setOptions(t,n){const r=this.options,i=X(this,tn);if(this.options=X(this,gr).defaultQueryOptions(t),Rm(r,this.options)||X(this,gr).getQueryCache().notify({type:"observerOptionsUpdated",query:X(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),wt(this,Ld,cw).call(this);const o=this.hasListeners();o&&a_(X(this,tn),i,this.options,r)&&wt(this,Va,of).call(this),this.updateResult(n),o&&(X(this,tn)!==i||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&wt(this,Md,rw).call(this);const s=wt(this,Td,iw).call(this);o&&(X(this,tn)!==i||this.options.enabled!==r.enabled||s!==X(this,Ps))&&wt(this,Ad,ow).call(this,s)}getOptimisticResult(t){const n=X(this,gr).getQueryCache().build(X(this,gr),t),r=this.createResult(n,t);return Z3(this,r)&&(Re(this,er,r),Re(this,vc,this.options),Re(this,ja,X(this,tn).state)),r}getCurrentResult(){return X(this,er)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(X(this,xc).add(r),t[r])})}),n}getCurrentQuery(){return X(this,tn)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=X(this,gr).defaultQueryOptions(t),r=X(this,gr).getQueryCache().build(X(this,gr),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return wt(this,Va,of).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),X(this,er)))}createResult(t,n){var k;const r=X(this,tn),i=this.options,o=X(this,er),s=X(this,ja),a=X(this,vc),c=t!==r?t.state:X(this,kd),{state:u}=t;let{error:f,errorUpdatedAt:g,fetchStatus:p,status:v}=u,b=!1,x;if(n._optimisticResults){const T=this.hasListeners(),I=!T&&s_(t,n),F=T&&a_(t,r,n,i);(I||F)&&(p=yf(t.options.networkMode)?"fetching":"paused",u.dataUpdatedAt||(v="pending")),n._optimisticResults==="isRestoring"&&(p="idle")}if(n.select&&typeof u.data<"u")if(o&&u.data===(s==null?void 0:s.data)&&n.select===X(this,Dd))x=X(this,bc);else try{Re(this,Dd,n.select),x=n.select(u.data),x=Fm(o==null?void 0:o.data,x,n),Re(this,bc,x),Re(this,to,null)}catch(T){Re(this,to,T)}else x=u.data;if(typeof n.placeholderData<"u"&&typeof x>"u"&&v==="pending"){let T;if(o!=null&&o.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))T=o.data;else if(T=typeof n.placeholderData=="function"?n.placeholderData((k=X(this,yc))==null?void 0:k.state.data,X(this,yc)):n.placeholderData,n.select&&typeof T<"u")try{T=n.select(T),Re(this,to,null)}catch(I){Re(this,to,I)}typeof T<"u"&&(v="success",x=Fm(o==null?void 0:o.data,T,n),b=!0)}X(this,to)&&(f=X(this,to),x=X(this,bc),g=Date.now(),v="error");const w=p==="fetching",S=v==="pending",C=v==="error",P=S&&w;return{status:v,fetchStatus:p,isPending:S,isSuccess:v==="success",isError:C,isInitialLoading:P,isLoading:P,data:x,dataUpdatedAt:u.dataUpdatedAt,error:f,errorUpdatedAt:g,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&&!S,isLoadingError:C&&u.dataUpdatedAt===0,isPaused:p==="paused",isPlaceholderData:b,isRefetchError:C&&u.dataUpdatedAt!==0,isStale:zm(t,n),refetch:this.refetch}}updateResult(t){const n=X(this,er),r=this.createResult(X(this,tn),this.options);if(Re(this,ja,X(this,tn).state),Re(this,vc,this.options),X(this,ja).data!==void 0&&Re(this,yc,X(this,tn)),Rm(r,n))return;Re(this,er,r);const i={},o=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!X(this,xc).size)return!0;const l=new Set(a??X(this,xc));return this.options.throwOnError&&l.add("error"),Object.keys(X(this,er)).some(c=>{const u=c;return X(this,er)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&o()&&(i.listeners=!0),wt(this,wg,SN).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&wt(this,Id,sw).call(this)}},gr=new WeakMap,tn=new WeakMap,kd=new WeakMap,er=new WeakMap,ja=new WeakMap,vc=new WeakMap,to=new WeakMap,Dd=new WeakMap,bc=new WeakMap,yc=new WeakMap,za=new WeakMap,Ba=new WeakMap,Ps=new WeakMap,xc=new WeakMap,Va=new WeakSet,of=function(t){wt(this,Ld,cw).call(this);let n=X(this,tn).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Kr)),n},Md=new WeakSet,rw=function(){if(wt(this,Nd,aw).call(this),dl||X(this,er).isStale||!Im(this.options.staleTime))return;const n=Kw(X(this,er).dataUpdatedAt,this.options.staleTime)+1;Re(this,za,setTimeout(()=>{X(this,er).isStale||this.updateResult()},n))},Td=new WeakSet,iw=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(X(this,tn)):this.options.refetchInterval)??!1},Ad=new WeakSet,ow=function(t){wt(this,Rd,lw).call(this),Re(this,Ps,t),!(dl||this.options.enabled===!1||!Im(X(this,Ps))||X(this,Ps)===0)&&Re(this,Ba,setInterval(()=>{(this.options.refetchIntervalInBackground||vf.isFocused())&&wt(this,Va,of).call(this)},X(this,Ps)))},Id=new WeakSet,sw=function(){wt(this,Md,rw).call(this),wt(this,Ad,ow).call(this,wt(this,Td,iw).call(this))},Nd=new WeakSet,aw=function(){X(this,za)&&(clearTimeout(X(this,za)),Re(this,za,void 0))},Rd=new WeakSet,lw=function(){X(this,Ba)&&(clearInterval(X(this,Ba)),Re(this,Ba,void 0))},Ld=new WeakSet,cw=function(){const t=X(this,gr).getQueryCache().build(X(this,gr),this.options);if(t===X(this,tn))return;const n=X(this,tn);Re(this,tn,t),Re(this,kd,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},wg=new WeakSet,SN=function(t){In.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(X(this,er))}),X(this,gr).getQueryCache().notify({query:X(this,tn),type:"observerResultsUpdated"})})},Q5);function Q3(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function s_(e,t){return Q3(e,t)||e.state.dataUpdatedAt>0&&jm(e,t,t.refetchOnMount)}function jm(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&zm(e,t)}return!1}function a_(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&zm(e,n)}function zm(e,t){return e.isStaleByTime(t.staleTime)}function Z3(e,t){return!Rm(e.getCurrentResult(),t)}var l_=de.createContext(void 0),J3=e=>{const t=de.useContext(l_);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},eR=({client:e,children:t})=>(de.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),de.createElement(l_.Provider,{value:e},t)),c_=de.createContext(!1),tR=()=>de.useContext(c_);c_.Provider;function nR(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var rR=de.createContext(nR()),iR=()=>de.useContext(rR);function oR(e,t){return typeof e=="function"?e(...t):!!e}var sR=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},aR=e=>{de.useEffect(()=>{e.clearReset()},[e])},lR=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&oR(n,[e.error,r]),cR=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},uR=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,dR=(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=J3(n),i=tR(),o=iR(),s=r.defaultQueryOptions(e);s._optimisticResults=i?"isRestoring":"optimistic",cR(s),sR(s,o),aR(o);const[a]=de.useState(()=>new t(r,s)),l=a.getOptimisticResult(s);if(de.useSyncExternalStore(de.useCallback(c=>{const u=i?()=>{}:a.subscribe(In.batchCalls(c));return a.updateResult(),u},[a,i]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),de.useEffect(()=>{a.setOptions(s,{listeners:!1})},[s,a]),uR(s,l))throw dR(s,a,o);if(lR({result:l,errorResetBoundary:o,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw l.error;return s.notifyOnChangeProps?l:a.trackResult(l)}function vi(e,t){return fR(e,X3,t)}let xf;const hR=new Uint8Array(16);function pR(){if(!xf&&(xf=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!xf))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return xf(hR)}const Nn=[];for(let e=0;e<256;++e)Nn.push((e+256).toString(16).slice(1));function gR(e,t=0){return Nn[e[t+0]]+Nn[e[t+1]]+Nn[e[t+2]]+Nn[e[t+3]]+"-"+Nn[e[t+4]]+Nn[e[t+5]]+"-"+Nn[e[t+6]]+Nn[e[t+7]]+"-"+Nn[e[t+8]]+Nn[e[t+9]]+"-"+Nn[e[t+10]]+Nn[e[t+11]]+Nn[e[t+12]]+Nn[e[t+13]]+Nn[e[t+14]]+Nn[e[t+15]]}const u_={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Go(e,t,n){if(u_.randomUUID&&!t&&!e)return u_.randomUUID();e=e||{};const r=e.random||(e.rng||pR)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return gR(r)}const ve=Mw()(Vw((e,t)=>({isShowingVisual:!0,runSql:!1,sqlGen:{},sql:"",isSqlRunning:!1,showFilters:!1,applyFilters:!1,filterValues:[{filterId:"sample-filter-id",valueType:"string",name:"",operation:"in",values:[""]}],card:{id:Go(),title:"Editor Card",description:"Desdcription",type:"bar",data:[]},frame:{id:Go(),cards:[],activeCardId:""},actions:{setNumberFormat:(n,r,i,o)=>{e(s=>{var a;s.card.preferences={...(a=s.card)==null?void 0:a.preferences,formatNumber:{format:n,currency:r,locale:i,suffix:o,enabled:!0}}})},setCardPreferences:n=>{e(r=>{r.card.preferences=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})},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(i=>{i.sqlGen.measures=[...i.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,i;e(o=>{o.selectedConnectionId=n,o.card.connectionId=n}),(i=(r=t()).onConnectionChange)==null||i.call(r,n)},setSelectedDatabaseName:n=>{var r,i;e(o=>{o.selectedDatabaseName=n,o.card.lastSelectedDatabase=n}),(i=(r=t()).onDatabaseChange)==null||i.call(r,n)},setSelectedSchemaName:n=>{var r,i;e(o=>{o.selectedSchemaName=n,o.card.lastSelectedSchema=n}),(i=(r=t()).onSchemaChange)==null||i.call(r,n)},setSelectedTableName:n=>{var r,i;e(o=>{o.selectedTableName=n,o.card.lastSelectedTable=n}),(i=(r=t()).onTableChange)==null||i.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})}}}))),mR=()=>ve(e=>e.actions);process.env.NODE_ENV==="development"&&Ww("EditorStore",ve);const vR={id:"",authToken:void 0},d_=m.createContext(vR),f_=({children:e,dashboardProps:t})=>_.jsx(d_.Provider,{value:t,children:e});function Ai(){const e=m.useContext(d_);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}function h_(e,t){var we;let n=m.useMemo(()=>[],[]);const{authToken:r}=Ai()||e,i=ve(q=>q.selectedConnectionId),o=ve(q=>q.selectedDatabaseName),s=ve(q=>q.selectedSchemaName),a=ve(q=>q.selectedTableName),l=ve(q=>q.actions.setCurrentColumns),c=ve(q=>q.actions.setSelectedConnectionId),u=ve(q=>q.actions.setSelectedDatabaseName),f=ve(q=>q.actions.setSelectedSchemaName),g=ve(q=>q.actions.setSelectedTableName),p=ve(q=>q.actions.setCardSql),{data:v,isLoading:b,isError:x}=vi({queryKey:[t||"connections"],queryFn:()=>ll("https://semaphor.cloud/api/v1/connections",(r==null?void 0:r.accessToken)||""),enabled:!!(r!=null&&r.accessToken)}),w=v==null?void 0:v.connections.find(q=>q.id===i),S=(w==null?void 0:w.type)==="API"||(w==null?void 0:w.type)==="S3",{data:C,isLoading:P,isFetching:O,isError:k,refetch:T}=vi({queryKey:[i],queryFn:()=>ll("https://semaphor.cloud/api/v1/databases",(r==null?void 0:r.accessToken)||"",{connection_id:i}),enabled:!!i&&!S}),{data:I,isLoading:F,isFetching:j,isError:B,refetch:V}=vi({queryKey:[i,o],queryFn:()=>ll("https://semaphor.cloud/api/v1/schemas",(r==null?void 0:r.accessToken)||"",{connection_id:i,database_name:o}),enabled:!!i&&!!o&&!S}),{data:G,isLoading:ee,isFetching:$,isError:Q,refetch:W}=vi({queryKey:[i,o,s],queryFn:()=>ll("https://semaphor.cloud/api/v1/tables",(r==null?void 0:r.accessToken)||"",{connection_id:i,database_name:o,schema_name:s}),enabled:!!i&&!!o&&!!s&&!S}),{data:ne,isLoading:ae,isFetching:A,isError:H}=vi({queryKey:[i,o,a],queryFn:()=>ll("https://semaphor.cloud/api/v1/columns",(r==null?void 0:r.accessToken)||"",{connection_id:i,database_name:o,schema_name:s,table_name:a}),enabled:!!i&&!!o&&!!s&&!!a||S});console.log("columnsData",ne),m.useEffect(()=>{l(n)},[ne,l,n]),m.useEffect(()=>{var q;S&&(u("NA"),f("NA"),g((q=w==null?void 0:w.type)==null?void 0:q.toLowerCase()))},[S,p,g,f,u,w]);const re=S?(we=w==null?void 0:w.type)==null?void 0:we.toLowerCase():a||"";console.log("tableName",re);const R=S?"":s||"";function ue(q){f(q),g("")}function ye(q){u(q),f(""),g("")}function ge(q){c(q)}C&&C.databases.length>0,I&&I.schemas.length>0,ne&&ne.columns.length>0&&(n=ne.columns.map(q=>({...q,data_type:q.data_type.toLowerCase()}))),k&&(n=[]),(H||x)&&(n=[]);const he=v==null?void 0:v.connections.map(q=>({id:q.id,name:q.name,type:q.type})),te=C==null?void 0:C.databases.map(q=>({id:q.database_name,name:q.database_name})),Z=I==null?void 0:I.schemas.map(q=>({id:q.schema_name,name:q.schema_name})),ie=G==null?void 0:G.tables.map(q=>({id:q.table_name,name:q.table_name}));return{connectionItems:he,isConnectionsLoading:b,isConnectionsError:x,databaseItems:te,isDatabasesLoadingOrFetching:P||O,isDatabaseError:k,schemaItems:Z,isSchemaLoadingOrFetching:F||j,isSchemaError:B,tableItems:ie,isTableLoadingOrFetching:ee||$,isTableError:Q,columns:n,isColumnsLoadingOrFetching:ae||A,isColumnsError:H,isAPIConnection:S,tableName:re,schemaName:R,handleConnectionChange:ge,handleDatabaseChange:ye,handleSchemaChange:ue}}const bR=e=>{const t=new Date(e);return!isNaN(t.getTime())},yR=e=>!isNaN(Number(e))&&!isNaN(parseFloat(e)),Bm=e=>{let t;return typeof e=="number"?t="number":typeof e=="string"?bR(e)?t="date":yR(e)?t="number":t="string":typeof e=="boolean"?t="boolean":e instanceof Date?t="date":t="unknown",t};function xR({get:e,dataPoint:t,card:n}){var g;const{addOrUpdateFilterValue:r,addFilteringCard:i,removeFilterValue:o,replaceFilterValue:s,removeFilteringCard:a}=e().actions,l=e().filteringCards,{columnName:c,columnValue:u}=t,f={filterId:n.id,connectionId:n==null?void 0:n.connectionId,tableName:n.lastSelectedTable,name:c,expression:(g=n.preferences)==null?void 0:g.filterOnClickField,valueType:Bm(u),operation:"=",values:[u]};if(l!=null&&l.find(p=>p.id===n.id)){const p=n.id;if(u==null){a(n),o(p);return}else s(f)}i(n),r(f)}var wf={exports:{}};/**
59
+ */var Ow;function f3(){if(Ow)return ym;Ow=1;var e=m,t=Cw();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,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return ym.useSyncExternalStoreWithSelector=function(c,u,f,g,p){var v=o(null);if(v.current===null){var b={hasValue:!1,value:null};v.current=b}else b=v.current;v=a(function(){function w(k){if(!S){if(S=!0,C=k,k=g(k),p!==void 0&&b.hasValue){var T=b.value;if(p(T,k))return P=T}return P=k}if(T=P,r(C,k))return T;var I=g(k);return p!==void 0&&p(T,I)?T:(C=k,P=I)}var S=!1,C,P,O=f===void 0?null:f;return[function(){return w(u())},O===null?void 0:function(){return w(O())}]},[u,f,g,p]);var x=i(c,v[0],v[1]);return s(function(){b.hasValue=!0,b.value=x},[x]),l(x),x},ym}process.env.NODE_ENV==="production"?gm.exports=f3():gm.exports=d3();var h3=gm.exports;const p3=Lc(h3);var Pw={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:g3}=m,{useSyncExternalStoreWithSelector:m3}=p3;let kw=!1;function v3(e,t=e.getState,n){(Pw?"production":void 0)!=="production"&&n&&!kw&&(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"),kw=!0);const r=m3(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return g3(r),r}const Dw=e=>{(Pw?"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"?l3(e):e,n=(r,i)=>v3(t,r,i);return Object.assign(n,t),n},Mw=e=>e?Dw(e):Dw;var Tw=Symbol.for("immer-nothing"),Aw=Symbol.for("immer-draftable"),_r=Symbol.for("immer-state"),b3=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 ir(e,...t){if(process.env.NODE_ENV!=="production"){const n=b3[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 cl=Object.getPrototypeOf;function ul(e){return!!e&&!!e[_r]}function zs(e){var t;return e?Iw(e)||Array.isArray(e)||!!e[Aw]||!!((t=e.constructor)!=null&&t[Aw])||uf(e)||df(e):!1}var y3=Object.prototype.constructor.toString();function Iw(e){if(!e||typeof e!="object")return!1;const t=cl(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)===y3}function Vc(e,t){cf(e)===0?Object.entries(e).forEach(([n,r])=>{t(n,r,e)}):e.forEach((n,r)=>t(r,n,e))}function cf(e){const t=e[_r];return t?t.type_:Array.isArray(e)?1:uf(e)?2:df(e)?3:0}function xm(e,t){return cf(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Nw(e,t,n){const r=cf(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function x3(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function uf(e){return e instanceof Map}function df(e){return e instanceof Set}function Bs(e){return e.copy_||e.base_}function wm(e,t){if(uf(e))return new Map(e);if(df(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&Iw(e))return cl(e)?{...e}:Object.assign(Object.create(null),e);const n=Object.getOwnPropertyDescriptors(e);delete n[_r];let r=Reflect.ownKeys(n);for(let i=0;i<r.length;i++){const o=r[i],s=n[o];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(n[o]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[o]})}return Object.create(cl(e),n)}function _m(e,t=!1){return ff(e)||ul(e)||!zs(e)||(cf(e)>1&&(e.set=e.add=e.clear=e.delete=w3),Object.freeze(e),t&&Vc(e,(n,r)=>_m(r,!0))),e}function w3(){ir(2)}function ff(e){return Object.isFrozen(e)}var _3={};function Vs(e){const t=_3[e];return t||ir(0,e),t}var Hc;function Rw(){return Hc}function S3(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Lw(e,t){t&&(Vs("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Sm(e){Cm(e),e.drafts_.forEach(C3),e.drafts_=null}function Cm(e){e===Hc&&(Hc=e.parent_)}function Fw(e){return Hc=S3(Hc,e)}function C3(e){const t=e[_r];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function $w(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[_r].modified_&&(Sm(t),ir(4)),zs(e)&&(e=hf(t,e),t.parent_||pf(t,e)),t.patches_&&Vs("Patches").generateReplacementPatches_(n[_r].base_,e,t.patches_,t.inversePatches_)):e=hf(t,n,[]),Sm(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Tw?e:void 0}function hf(e,t,n){if(ff(t))return t;const r=t[_r];if(!r)return Vc(t,(i,o)=>jw(e,r,t,i,o,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return pf(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const i=r.copy_;let o=i,s=!1;r.type_===3&&(o=new Set(i),i.clear(),s=!0),Vc(o,(a,l)=>jw(e,r,i,a,l,n,s)),pf(e,i,!1),n&&e.patches_&&Vs("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function jw(e,t,n,r,i,o,s){if(process.env.NODE_ENV!=="production"&&i===n&&ir(5),ul(i)){const a=o&&t&&t.type_!==3&&!xm(t.assigned_,r)?o.concat(r):void 0,l=hf(e,i,a);if(Nw(n,r,l),ul(l))e.canAutoFreeze_=!1;else return}else s&&n.add(i);if(zs(i)&&!ff(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;hf(e,i),(!t||!t.scope_.parent_)&&pf(e,i)}}function pf(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&_m(t,n)}function E3(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:Rw(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,o=Em;n&&(i=[r],o=Wc);const{revoke:s,proxy:a}=Proxy.revocable(i,o);return r.draft_=a,r.revoke_=s,a}var Em={get(e,t){if(t===_r)return e;const n=Bs(e);if(!xm(n,t))return O3(e,n,t);const r=n[t];return e.finalized_||!zs(r)?r:r===Om(e.base_,t)?(km(e),e.copy_[t]=Dm(r,e)):r},has(e,t){return t in Bs(e)},ownKeys(e){return Reflect.ownKeys(Bs(e))},set(e,t,n){const r=zw(Bs(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=Om(Bs(e),t),o=i==null?void 0:i[_r];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(x3(n,i)&&(n!==void 0||xm(e.base_,t)))return!0;km(e),Pm(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 Om(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,km(e),Pm(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Bs(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){ir(11)},getPrototypeOf(e){return cl(e.base_)},setPrototypeOf(){ir(12)}},Wc={};Vc(Em,(e,t)=>{Wc[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Wc.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&ir(13),Wc.set.call(this,e,t,void 0)},Wc.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&ir(14),Em.set.call(this,e[0],t,n,e[0])};function Om(e,t){const n=e[_r];return(n?Bs(n):e)[t]}function O3(e,t,n){var i;const r=zw(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function zw(e,t){if(!(t in e))return;let n=cl(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=cl(n)}}function Pm(e){e.modified_||(e.modified_=!0,e.parent_&&Pm(e.parent_))}function km(e){e.copy_||(e.copy_=wm(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var P3=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const o=n;n=t;const s=this;return function(l=o,...c){return s.produce(l,u=>n.call(this,u,...c))}}typeof n!="function"&&ir(6),r!==void 0&&typeof r!="function"&&ir(7);let i;if(zs(t)){const o=Fw(this),s=Dm(t,void 0);let a=!0;try{i=n(s),a=!1}finally{a?Sm(o):Cm(o)}return Lw(o,r),$w(i,o)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===Tw&&(i=void 0),this.autoFreeze_&&_m(i,!0),r){const o=[],s=[];Vs("Patches").generateReplacementPatches_(t,i,o,s),r(o,s)}return i}else ir(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...a)=>this.produceWithPatches(s,l=>t(l,...a));let r,i;return[this.produce(t,n,(s,a)=>{r=s,i=a}),r,i]},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){zs(e)||ir(8),ul(e)&&(e=k3(e));const t=Fw(this),n=Dm(e,void 0);return n[_r].isManual_=!0,Cm(t),n}finishDraft(e,t){const n=e&&e[_r];(!n||!n.isManual_)&&ir(9);const{scope_:r}=n;return Lw(r,t),$w(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 i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=Vs("Patches").applyPatches_;return ul(e)?r(e,t):this.produce(e,i=>r(i,t))}};function Dm(e,t){const n=uf(e)?Vs("MapSet").proxyMap_(e,t):df(e)?Vs("MapSet").proxySet_(e,t):E3(e,t);return(t?t.scope_:Rw()).drafts_.push(n),n}function k3(e){return ul(e)||ir(10,e),Bw(e)}function Bw(e){if(!zs(e)||ff(e))return e;const t=e[_r];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=wm(e,t.scope_.immer_.useStrictShallowCopy_)}else n=wm(e,!0);return Vc(n,(r,i)=>{Nw(n,r,Bw(i))}),t&&(t.finalized_=!1),n}var Sr=new P3,D3=Sr.produce;Sr.produceWithPatches.bind(Sr),Sr.setAutoFreeze.bind(Sr),Sr.setUseStrictShallowCopy.bind(Sr),Sr.applyPatches.bind(Sr),Sr.createDraft.bind(Sr),Sr.finishDraft.bind(Sr);const Vw=e=>(t,n,r)=>(r.setState=(i,o,...s)=>{const a=typeof i=="function"?D3(i):i;return t(a,o,...s)},e(r.setState,n,r));var gf,mf=kt;if(process.env.NODE_ENV==="production")gf=mf.createRoot,mf.hydrateRoot;else{var Hw=mf.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;gf=function(e,t){Hw.usingClientEntryPoint=!0;try{return mf.createRoot(e,t)}finally{Hw.usingClientEntryPoint=!1}}}function Ww(e,t,n){const r={count:0},i=a=>{const l=m.useRef(r.count);return m.useEffect(()=>{l.current+=1,l.current===r.count+1&&(l.current-=1,t.setState(a))}),null};if(i.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 o=gf(n),s=a=>{a&&(o.render(m.createElement(i,Object.assign({},a))),r.count+=1)};s(t.getState()),t.subscribe(s)}var Uw={},qw={},Mm={exports:{}},Xt=String,Gw=function(){return{isColorSupported:!1,reset:Xt,bold:Xt,dim:Xt,italic:Xt,underline:Xt,inverse:Xt,hidden:Xt,strikethrough:Xt,black:Xt,red:Xt,green:Xt,yellow:Xt,blue:Xt,magenta:Xt,cyan:Xt,white:Xt,gray:Xt,bgBlack:Xt,bgRed:Xt,bgGreen:Xt,bgYellow:Xt,bgBlue:Xt,bgMagenta:Xt,bgCyan:Xt,bgWhite:Xt}};Mm.exports=Gw(),Mm.exports.createColors=Gw;var M3=Mm.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(M3);function r(l){return l&&l.__esModule?l:{default:l}}let i=new Set;function o(l,c,u){typeof process<"u"&&process.env.JEST_WORKER_ID||u&&i.has(u)||(u&&i.add(u),console.warn(""),c.forEach(f=>console.warn(l,"-",f)))}function s(l){return n.default.dim(l)}const a={info(l,c){o(n.default.bold(n.default.cyan("info")),...Array.isArray(l)?[l]:[c,l])},warn(l,c){o(n.default.bold(n.default.yellow("warn")),...Array.isArray(l)?[l]:[c,l])},risk(l,c){o(n.default.bold(n.default.magenta("risk")),...Array.isArray(l)?[l]:[c,l])}}})(qw),function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return i}});const t=n(qw);function n(o){return o&&o.__esModule?o:{default:o}}function r({version:o,from:s,to:a}){t.default.warn(`${s}-color-renamed`,[`As of Tailwind CSS ${o}, \`${s}\` has been renamed to \`${a}\`.`,"Update your configuration file to silence this warning."])}const i={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}}}(Uw);let Tm=Uw;var T3=(Tm.__esModule?Tm:{default:Tm}).default;const rn=Lc(T3),Am={default:{dashboardPanel:"",dashboardTabsContainer:"",gridLayout:{className:""},chart:{font:{family:"Open Sans, Arial, sans-serif"},dataset:{backgroundColor:[rn.blue[500],rn.teal[500],rn.amber[500],rn.red[500],rn.indigo[500],rn.green[500]],borderColor:[rn.blue[500],rn.teal[500],rn.amber[500],rn.red[500],rn.indigo[500],rn.green[500]]},options:{plugins:{datalabels:{display:!1,color:A3},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:[rn.teal[100],rn.purple[100],rn.amber[100],rn.orange[100],rn.rose[100]],borderColor:[rn.teal[400],rn.purple[400],rn.amber[400],rn.orange[300],rn.rose[400]]},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:rn.slate[800]}},y:{grid:{display:!0,color:rn.slate[800]}}}}}}};function A3(e){var r,i,o,s,a,l;const t=(a=(s=(o=(i=(r=e==null?void 0:e.chart)==null?void 0:r.config)==null?void 0:i._config)==null?void 0:o.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=Yw()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=Yw()),I3(n)}function Yw(){return pe.getState().theme==="dark"?"#000000":"#FFFFFF"}function I3(e){let t=0,n=0,r=0,i=0;const o=u=>{const f=u.replace("#",""),g=parseInt(f.substring(0,2),16),p=parseInt(f.substring(2,4),16),v=parseInt(f.substring(4,6),16);t+=g,n+=p,r+=v,i++};Array.isArray(e)?e.forEach(u=>{o(u)}):o(e);const s=t/i,a=n/i,l=r/i;return(s*299+a*587+l*114)/1e3>=180?"black":"white"}var Uc=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(){}},dl=typeof window>"u"||"Deno"in window;function Kr(){}function N3(e,t){return typeof e=="function"?e(t):e}function Im(e){return typeof e=="number"&&e>=0&&e!==1/0}function Kw(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Xw(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==Nm(s,t.options))return!1}else if(!Gc(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 i<"u"&&i!==t.state.fetchStatus||o&&!o(t))}function Qw(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(qc(t.options.mutationKey)!==qc(o))return!1}else if(!Gc(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Nm(e,t){return((t==null?void 0:t.queryKeyHashFn)||qc)(e)}function qc(e){return JSON.stringify(e,(t,n)=>Lm(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Gc(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Gc(e[n],t[n])):!1}function Zw(e,t){if(e===t)return e;const n=Jw(e)&&Jw(t);if(n||Lm(e)&&Lm(t)){const r=n?e:Object.keys(e),i=r.length,o=n?t:Object.keys(t),s=o.length,a=n?[]:{};let l=0;for(let c=0;c<s;c++){const u=n?c:o[c];!n&&e[u]===void 0&&t[u]===void 0&&r.includes(u)?(a[u]=void 0,l++):(a[u]=Zw(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return i===s&&l===i?e:a}return t}function Rm(e,t){if(e&&!t||t&&!e)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Jw(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Lm(e){if(!e_(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!e_(n)||!n.hasOwnProperty("isPrototypeOf"))}function e_(e){return Object.prototype.toString.call(e)==="[object Object]"}function R3(e){return new Promise(t=>{setTimeout(t,e)})}function Fm(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Zw(e,t):t}function L3(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function F3(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var $3=(H5=class extends Uc{constructor(){super();Ve(this,Ra,void 0);Ve(this,ws,void 0);Ve(this,sc,void 0);Re(this,sc,t=>{if(!dl&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){X(this,ws)||this.setEventListener(X(this,sc))}onUnsubscribe(){var t;this.hasListeners()||((t=X(this,ws))==null||t.call(this),Re(this,ws,void 0))}setEventListener(t){var n;Re(this,sc,t),(n=X(this,ws))==null||n.call(this),Re(this,ws,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){X(this,Ra)!==t&&(Re(this,Ra,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof X(this,Ra)=="boolean"?X(this,Ra):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ra=new WeakMap,ws=new WeakMap,sc=new WeakMap,H5),vf=new $3,j3=(W5=class extends Uc{constructor(){super();Ve(this,ac,!0);Ve(this,_s,void 0);Ve(this,lc,void 0);Re(this,lc,t=>{if(!dl&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){X(this,_s)||this.setEventListener(X(this,lc))}onUnsubscribe(){var t;this.hasListeners()||((t=X(this,_s))==null||t.call(this),Re(this,_s,void 0))}setEventListener(t){var n;Re(this,lc,t),(n=X(this,_s))==null||n.call(this),Re(this,_s,t(this.setOnline.bind(this)))}setOnline(t){X(this,ac)!==t&&(Re(this,ac,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return X(this,ac)}},ac=new WeakMap,_s=new WeakMap,lc=new WeakMap,W5),bf=new j3;function z3(e){return Math.min(1e3*2**e,3e4)}function yf(e){return(e??"online")==="online"?bf.isOnline():!0}var t_=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function $m(e){return e instanceof t_}function n_(e){let t=!1,n=0,r=!1,i,o,s;const a=new Promise((x,w)=>{o=x,s=w}),l=x=>{var w;r||(p(new t_(x)),(w=e.abort)==null||w.call(e))},c=()=>{t=!0},u=()=>{t=!1},f=()=>!vf.isFocused()||e.networkMode!=="always"&&!bf.isOnline(),g=x=>{var w;r||(r=!0,(w=e.onSuccess)==null||w.call(e,x),i==null||i(),o(x))},p=x=>{var w;r||(r=!0,(w=e.onError)==null||w.call(e,x),i==null||i(),s(x))},v=()=>new Promise(x=>{var w;i=S=>{const C=r||!f();return C&&x(S),C},(w=e.onPause)==null||w.call(e)}).then(()=>{var x;i=void 0,r||(x=e.onContinue)==null||x.call(e)}),b=()=>{if(r)return;let x;try{x=e.fn()}catch(w){x=Promise.reject(w)}Promise.resolve(x).then(g).catch(w=>{var k;if(r)return;const S=e.retry??(dl?0:3),C=e.retryDelay??z3,P=typeof C=="function"?C(n,w):C,O=S===!0||typeof S=="number"&&n<S||typeof S=="function"&&S(n,w);if(t||!O){p(w);return}n++,(k=e.onFail)==null||k.call(e,n,w),R3(P).then(()=>{if(f())return v()}).then(()=>{t?p(w):b()})})};return yf(e.networkMode)?b():v().then(b),{promise:a,cancel:l,continue:()=>(i==null?void 0:i())?a:Promise.resolve(),cancelRetry:c,continueRetry:u}}function B3(){let e=[],t=0,n=g=>{g()},r=g=>{g()},i=g=>setTimeout(g,0);const o=g=>{i=g},s=g=>{let p;t++;try{p=g()}finally{t--,t||c()}return p},a=g=>{t?e.push(g):i(()=>{n(g)})},l=g=>(...p)=>{a(()=>{g(...p)})},c=()=>{const g=e;e=[],g.length&&i(()=>{r(()=>{g.forEach(p=>{n(p)})})})};return{batch:s,batchCalls:l,schedule:a,setNotifyFunction:g=>{n=g},setBatchNotifyFunction:g=>{r=g},setScheduler:o}}var In=B3(),r_=(U5=class{constructor(){Ve(this,La,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Im(this.gcTime)&&Re(this,La,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(dl?1/0:5*60*1e3))}clearGcTimeout(){X(this,La)&&(clearTimeout(X(this,La)),Re(this,La,void 0))}},La=new WeakMap,U5),V3=(q5=class extends r_{constructor(t){super();Ve(this,dc);Ve(this,Pi);Ve(this,cc,void 0);Ve(this,uc,void 0);Ve(this,oi,void 0);Ve(this,Ss,void 0);Ve(this,si,void 0);Ve(this,Mn,void 0);Ve(this,Ed,void 0);Ve(this,Fa,void 0);Re(this,Fa,!1),Re(this,Ed,t.defaultOptions),wt(this,dc,um).call(this,t.options),Re(this,Mn,[]),Re(this,oi,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Re(this,cc,t.state||H3(this.options)),this.state=X(this,cc),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!X(this,Mn).length&&this.state.fetchStatus==="idle"&&X(this,oi).remove(this)}setData(t,n){const r=Fm(this.state.data,t,this.options);return wt(this,Pi,Ho).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){wt(this,Pi,Ho).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=X(this,Ss);return(r=X(this,si))==null||r.cancel(t),n?n.then(Kr).catch(Kr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(X(this,cc))}isActive(){return X(this,Mn).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||X(this,Mn).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!Kw(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=X(this,Mn).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=X(this,si))==null||n.continue()}onOnline(){var n;const t=X(this,Mn).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=X(this,si))==null||n.continue()}addObserver(t){X(this,Mn).includes(t)||(X(this,Mn).push(t),this.clearGcTimeout(),X(this,oi).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){X(this,Mn).includes(t)&&(Re(this,Mn,X(this,Mn).filter(n=>n!==t)),X(this,Mn).length||(X(this,si)&&(X(this,Fa)?X(this,si).cancel({revert:!0}):X(this,si).cancelRetry()),this.scheduleGc()),X(this,oi).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return X(this,Mn).length}invalidate(){this.state.isInvalidated||wt(this,Pi,Ho).call(this,{type:"invalidate"})}fetch(t,n){var c,u,f,g;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(X(this,Ss))return(c=X(this,si))==null||c.continueRetry(),X(this,Ss)}if(t&&wt(this,dc,um).call(this,t),!this.options.queryFn){const p=X(this,Mn).find(v=>v.options.queryFn);p&&wt(this,dc,um).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,i={queryKey:this.queryKey,meta:this.meta},o=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(Re(this,Fa,!0),r.signal)})};o(i);const s=()=>this.options.queryFn?(Re(this,Fa,!1),this.options.persister?this.options.persister(this.options.queryFn,i,this):this.options.queryFn(i)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),a={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};o(a),(u=this.options.behavior)==null||u.onFetch(a,this),Re(this,uc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=a.fetchOptions)==null?void 0:f.meta))&&wt(this,Pi,Ho).call(this,{type:"fetch",meta:(g=a.fetchOptions)==null?void 0:g.meta});const l=p=>{var v,b,x,w;$m(p)&&p.silent||wt(this,Pi,Ho).call(this,{type:"error",error:p}),$m(p)||((b=(v=X(this,oi).config).onError)==null||b.call(v,p,this),(w=(x=X(this,oi).config).onSettled)==null||w.call(x,this.state.data,p,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return Re(this,si,n_({fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:p=>{var v,b,x,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),(b=(v=X(this,oi).config).onSuccess)==null||b.call(v,p,this),(w=(x=X(this,oi).config).onSettled)==null||w.call(x,p,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(p,v)=>{wt(this,Pi,Ho).call(this,{type:"failed",failureCount:p,error:v})},onPause:()=>{wt(this,Pi,Ho).call(this,{type:"pause"})},onContinue:()=>{wt(this,Pi,Ho).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),Re(this,Ss,X(this,si).promise),X(this,Ss)}},cc=new WeakMap,uc=new WeakMap,oi=new WeakMap,Ss=new WeakMap,si=new WeakMap,Mn=new WeakMap,Ed=new WeakMap,Fa=new WeakMap,dc=new WeakSet,um=function(t){this.options={...X(this,Ed),...t},this.updateGcTime(this.options.gcTime)},Pi=new WeakSet,Ho=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:yf(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 i=t.error;return $m(i)&&i.revert&&X(this,uc)?{...X(this,uc),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),In.batch(()=>{X(this,Mn).forEach(r=>{r.onQueryUpdate()}),X(this,oi).notify({query:this,type:"updated",action:t})})},q5);function H3(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 W3=(G5=class extends Uc{constructor(t={}){super();Ve(this,Zi,void 0);this.config=t,Re(this,Zi,new Map)}build(t,n,r){const i=n.queryKey,o=n.queryHash??Nm(i,n);let s=this.get(o);return s||(s=new V3({cache:this,queryKey:i,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(s)),s}add(t){X(this,Zi).has(t.queryHash)||(X(this,Zi).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=X(this,Zi).get(t.queryHash);n&&(t.destroy(),n===t&&X(this,Zi).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){In.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return X(this,Zi).get(t)}getAll(){return[...X(this,Zi).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Xw(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Xw(t,r)):n}notify(t){In.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){In.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){In.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Zi=new WeakMap,G5),U3=(Y5=class extends r_{constructor(t){super();Ve(this,eo);Ve(this,Ji,void 0);Ve(this,Od,void 0);Ve(this,zr,void 0);Ve(this,fc,void 0);this.mutationId=t.mutationId,Re(this,Od,t.defaultOptions),Re(this,zr,t.mutationCache),Re(this,Ji,[]),this.state=t.state||q3(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...X(this,Od),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){X(this,Ji).includes(t)||(X(this,Ji).push(t),this.clearGcTimeout(),X(this,zr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Re(this,Ji,X(this,Ji).filter(n=>n!==t)),this.scheduleGc(),X(this,zr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){X(this,Ji).length||(this.state.status==="pending"?this.scheduleGc():X(this,zr).remove(this))}continue(){var t;return((t=X(this,fc))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,s,a,l,c,u,f,g,p,v,b,x,w,S,C,P,O,k,T;const n=()=>(Re(this,fc,n_({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(I,F)=>{wt(this,eo,Fs).call(this,{type:"failed",failureCount:I,error:F})},onPause:()=>{wt(this,eo,Fs).call(this,{type:"pause"})},onContinue:()=>{wt(this,eo,Fs).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),X(this,fc).promise),r=this.state.status==="pending";try{if(!r){wt(this,eo,Fs).call(this,{type:"pending",variables:t}),await((o=(i=X(this,zr).config).onMutate)==null?void 0:o.call(i,t,this));const F=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));F!==this.state.context&&wt(this,eo,Fs).call(this,{type:"pending",context:F,variables:t})}const I=await n();return await((c=(l=X(this,zr).config).onSuccess)==null?void 0:c.call(l,I,t,this.state.context,this)),await((f=(u=this.options).onSuccess)==null?void 0:f.call(u,I,t,this.state.context)),await((p=(g=X(this,zr).config).onSettled)==null?void 0:p.call(g,I,null,this.state.variables,this.state.context,this)),await((b=(v=this.options).onSettled)==null?void 0:b.call(v,I,null,t,this.state.context)),wt(this,eo,Fs).call(this,{type:"success",data:I}),I}catch(I){try{throw await((w=(x=X(this,zr).config).onError)==null?void 0:w.call(x,I,t,this.state.context,this)),await((C=(S=this.options).onError)==null?void 0:C.call(S,I,t,this.state.context)),await((O=(P=X(this,zr).config).onSettled)==null?void 0:O.call(P,void 0,I,this.state.variables,this.state.context,this)),await((T=(k=this.options).onSettled)==null?void 0:T.call(k,void 0,I,t,this.state.context)),I}finally{wt(this,eo,Fs).call(this,{type:"error",error:I})}}}},Ji=new WeakMap,Od=new WeakMap,zr=new WeakMap,fc=new WeakMap,eo=new WeakSet,Fs=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!yf(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),In.batch(()=>{X(this,Ji).forEach(r=>{r.onMutationUpdate(t)}),X(this,zr).notify({mutation:this,type:"updated",action:t})})},Y5);function q3(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var G3=(K5=class extends Uc{constructor(t={}){super();Ve(this,ai,void 0);Ve(this,Pd,void 0);Ve(this,$a,void 0);this.config=t,Re(this,ai,[]),Re(this,Pd,0)}build(t,n,r){const i=new U3({mutationCache:this,mutationId:++cm(this,Pd)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){X(this,ai).push(t),this.notify({type:"added",mutation:t})}remove(t){Re(this,ai,X(this,ai).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){In.batch(()=>{X(this,ai).forEach(t=>{this.remove(t)})})}getAll(){return X(this,ai)}find(t){const n={exact:!0,...t};return X(this,ai).find(r=>Qw(n,r))}findAll(t={}){return X(this,ai).filter(n=>Qw(t,n))}notify(t){In.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return Re(this,$a,(X(this,$a)??Promise.resolve()).then(()=>{const t=X(this,ai).filter(n=>n.state.isPaused);return In.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(Kr)),Promise.resolve()))}).then(()=>{Re(this,$a,void 0)})),X(this,$a)}},ai=new WeakMap,Pd=new WeakMap,$a=new WeakMap,K5);function Y3(e){return{onFetch:(t,n)=>{const r=async()=>{var v,b,x,w,S;const i=t.options,o=(x=(b=(v=t.fetchOptions)==null?void 0:v.meta)==null?void 0:b.fetchMore)==null?void 0:x.direction,s=((w=t.state.data)==null?void 0:w.pages)||[],a=((S=t.state.data)==null?void 0:S.pageParams)||[],l={pages:[],pageParams:[]};let c=!1;const u=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(t.signal.aborted?c=!0:t.signal.addEventListener("abort",()=>{c=!0}),t.signal)})},f=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),g=async(C,P,O)=>{if(c)return Promise.reject();if(P==null&&C.pages.length)return Promise.resolve(C);const k={queryKey:t.queryKey,pageParam:P,direction:O?"backward":"forward",meta:t.options.meta};u(k);const T=await f(k),{maxPages:I}=t.options,F=O?F3:L3;return{pages:F(C.pages,T,I),pageParams:F(C.pageParams,P,I)}};let p;if(o&&s.length){const C=o==="backward",P=C?K3:i_,O={pages:s,pageParams:a},k=P(i,O);p=await g(O,k,C)}else{p=await g(l,a[0]??i.initialPageParam);const C=e??s.length;for(let P=1;P<C;P++){const O=i_(i,p);p=await g(p,O)}}return p};t.options.persister?t.fetchFn=()=>{var i,o;return(o=(i=t.options).persister)==null?void 0:o.call(i,r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=r}}}function i_(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function K3(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var o_=(X5=class{constructor(e={}){Ve(this,En,void 0);Ve(this,Cs,void 0);Ve(this,Es,void 0);Ve(this,hc,void 0);Ve(this,pc,void 0);Ve(this,Os,void 0);Ve(this,gc,void 0);Ve(this,mc,void 0);Re(this,En,e.queryCache||new W3),Re(this,Cs,e.mutationCache||new G3),Re(this,Es,e.defaultOptions||{}),Re(this,hc,new Map),Re(this,pc,new Map),Re(this,Os,0)}mount(){cm(this,Os)._++,X(this,Os)===1&&(Re(this,gc,vf.subscribe(()=>{vf.isFocused()&&(this.resumePausedMutations(),X(this,En).onFocus())})),Re(this,mc,bf.subscribe(()=>{bf.isOnline()&&(this.resumePausedMutations(),X(this,En).onOnline())})))}unmount(){var e,t;cm(this,Os)._--,X(this,Os)===0&&((e=X(this,gc))==null||e.call(this),Re(this,gc,void 0),(t=X(this,mc))==null||t.call(this),Re(this,mc,void 0))}isFetching(e){return X(this,En).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return X(this,Cs).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=X(this,En).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=X(this,En).find({queryKey:e}),i=r==null?void 0:r.state.data,o=N3(t,i);if(typeof o>"u")return;const s=this.defaultQueryOptions({queryKey:e});return X(this,En).build(this,s).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return In.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var t;return(t=X(this,En).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=X(this,En);In.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=X(this,En),r={type:"active",...e};return In.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=In.batch(()=>X(this,En).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Kr).catch(Kr)}invalidateQueries(e={},t={}){return In.batch(()=>{if(X(this,En).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=In.batch(()=>X(this,En).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(Kr)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Kr)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=X(this,En).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Kr).catch(Kr)}fetchInfiniteQuery(e){return e.behavior=Y3(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Kr).catch(Kr)}resumePausedMutations(){return X(this,Cs).resumePausedMutations()}getQueryCache(){return X(this,En)}getMutationCache(){return X(this,Cs)}getDefaultOptions(){return X(this,Es)}setDefaultOptions(e){Re(this,Es,e)}setQueryDefaults(e,t){X(this,hc).set(qc(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...X(this,hc).values()];let n={};return t.forEach(r=>{Gc(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){X(this,pc).set(qc(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...X(this,pc).values()];let n={};return t.forEach(r=>{Gc(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...X(this,Es).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Nm(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:{...X(this,Es).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){X(this,En).clear(),X(this,Cs).clear()}},En=new WeakMap,Cs=new WeakMap,Es=new WeakMap,hc=new WeakMap,pc=new WeakMap,Os=new WeakMap,gc=new WeakMap,mc=new WeakMap,X5),X3=(Q5=class extends Uc{constructor(t,n){super();Ve(this,Va);Ve(this,Md);Ve(this,Td);Ve(this,Ad);Ve(this,Id);Ve(this,Nd);Ve(this,Rd);Ve(this,Ld);Ve(this,wg);Ve(this,gr,void 0);Ve(this,tn,void 0);Ve(this,kd,void 0);Ve(this,er,void 0);Ve(this,ja,void 0);Ve(this,vc,void 0);Ve(this,to,void 0);Ve(this,Dd,void 0);Ve(this,bc,void 0);Ve(this,yc,void 0);Ve(this,za,void 0);Ve(this,Ba,void 0);Ve(this,Ps,void 0);Ve(this,xc,new Set);this.options=n,Re(this,gr,t),Re(this,to,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(X(this,tn).addObserver(this),s_(X(this,tn),this.options)?wt(this,Va,of).call(this):this.updateResult(),wt(this,Id,sw).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return jm(X(this,tn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return jm(X(this,tn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,wt(this,Nd,aw).call(this),wt(this,Rd,lw).call(this),X(this,tn).removeObserver(this)}setOptions(t,n){const r=this.options,i=X(this,tn);if(this.options=X(this,gr).defaultQueryOptions(t),Rm(r,this.options)||X(this,gr).getQueryCache().notify({type:"observerOptionsUpdated",query:X(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),wt(this,Ld,cw).call(this);const o=this.hasListeners();o&&a_(X(this,tn),i,this.options,r)&&wt(this,Va,of).call(this),this.updateResult(n),o&&(X(this,tn)!==i||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&wt(this,Md,rw).call(this);const s=wt(this,Td,iw).call(this);o&&(X(this,tn)!==i||this.options.enabled!==r.enabled||s!==X(this,Ps))&&wt(this,Ad,ow).call(this,s)}getOptimisticResult(t){const n=X(this,gr).getQueryCache().build(X(this,gr),t),r=this.createResult(n,t);return Z3(this,r)&&(Re(this,er,r),Re(this,vc,this.options),Re(this,ja,X(this,tn).state)),r}getCurrentResult(){return X(this,er)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(X(this,xc).add(r),t[r])})}),n}getCurrentQuery(){return X(this,tn)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=X(this,gr).defaultQueryOptions(t),r=X(this,gr).getQueryCache().build(X(this,gr),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return wt(this,Va,of).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),X(this,er)))}createResult(t,n){var k;const r=X(this,tn),i=this.options,o=X(this,er),s=X(this,ja),a=X(this,vc),c=t!==r?t.state:X(this,kd),{state:u}=t;let{error:f,errorUpdatedAt:g,fetchStatus:p,status:v}=u,b=!1,x;if(n._optimisticResults){const T=this.hasListeners(),I=!T&&s_(t,n),F=T&&a_(t,r,n,i);(I||F)&&(p=yf(t.options.networkMode)?"fetching":"paused",u.dataUpdatedAt||(v="pending")),n._optimisticResults==="isRestoring"&&(p="idle")}if(n.select&&typeof u.data<"u")if(o&&u.data===(s==null?void 0:s.data)&&n.select===X(this,Dd))x=X(this,bc);else try{Re(this,Dd,n.select),x=n.select(u.data),x=Fm(o==null?void 0:o.data,x,n),Re(this,bc,x),Re(this,to,null)}catch(T){Re(this,to,T)}else x=u.data;if(typeof n.placeholderData<"u"&&typeof x>"u"&&v==="pending"){let T;if(o!=null&&o.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))T=o.data;else if(T=typeof n.placeholderData=="function"?n.placeholderData((k=X(this,yc))==null?void 0:k.state.data,X(this,yc)):n.placeholderData,n.select&&typeof T<"u")try{T=n.select(T),Re(this,to,null)}catch(I){Re(this,to,I)}typeof T<"u"&&(v="success",x=Fm(o==null?void 0:o.data,T,n),b=!0)}X(this,to)&&(f=X(this,to),x=X(this,bc),g=Date.now(),v="error");const w=p==="fetching",S=v==="pending",C=v==="error",P=S&&w;return{status:v,fetchStatus:p,isPending:S,isSuccess:v==="success",isError:C,isInitialLoading:P,isLoading:P,data:x,dataUpdatedAt:u.dataUpdatedAt,error:f,errorUpdatedAt:g,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&&!S,isLoadingError:C&&u.dataUpdatedAt===0,isPaused:p==="paused",isPlaceholderData:b,isRefetchError:C&&u.dataUpdatedAt!==0,isStale:zm(t,n),refetch:this.refetch}}updateResult(t){const n=X(this,er),r=this.createResult(X(this,tn),this.options);if(Re(this,ja,X(this,tn).state),Re(this,vc,this.options),X(this,ja).data!==void 0&&Re(this,yc,X(this,tn)),Rm(r,n))return;Re(this,er,r);const i={},o=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!X(this,xc).size)return!0;const l=new Set(a??X(this,xc));return this.options.throwOnError&&l.add("error"),Object.keys(X(this,er)).some(c=>{const u=c;return X(this,er)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&o()&&(i.listeners=!0),wt(this,wg,SN).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&wt(this,Id,sw).call(this)}},gr=new WeakMap,tn=new WeakMap,kd=new WeakMap,er=new WeakMap,ja=new WeakMap,vc=new WeakMap,to=new WeakMap,Dd=new WeakMap,bc=new WeakMap,yc=new WeakMap,za=new WeakMap,Ba=new WeakMap,Ps=new WeakMap,xc=new WeakMap,Va=new WeakSet,of=function(t){wt(this,Ld,cw).call(this);let n=X(this,tn).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Kr)),n},Md=new WeakSet,rw=function(){if(wt(this,Nd,aw).call(this),dl||X(this,er).isStale||!Im(this.options.staleTime))return;const n=Kw(X(this,er).dataUpdatedAt,this.options.staleTime)+1;Re(this,za,setTimeout(()=>{X(this,er).isStale||this.updateResult()},n))},Td=new WeakSet,iw=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(X(this,tn)):this.options.refetchInterval)??!1},Ad=new WeakSet,ow=function(t){wt(this,Rd,lw).call(this),Re(this,Ps,t),!(dl||this.options.enabled===!1||!Im(X(this,Ps))||X(this,Ps)===0)&&Re(this,Ba,setInterval(()=>{(this.options.refetchIntervalInBackground||vf.isFocused())&&wt(this,Va,of).call(this)},X(this,Ps)))},Id=new WeakSet,sw=function(){wt(this,Md,rw).call(this),wt(this,Ad,ow).call(this,wt(this,Td,iw).call(this))},Nd=new WeakSet,aw=function(){X(this,za)&&(clearTimeout(X(this,za)),Re(this,za,void 0))},Rd=new WeakSet,lw=function(){X(this,Ba)&&(clearInterval(X(this,Ba)),Re(this,Ba,void 0))},Ld=new WeakSet,cw=function(){const t=X(this,gr).getQueryCache().build(X(this,gr),this.options);if(t===X(this,tn))return;const n=X(this,tn);Re(this,tn,t),Re(this,kd,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},wg=new WeakSet,SN=function(t){In.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(X(this,er))}),X(this,gr).getQueryCache().notify({query:X(this,tn),type:"observerResultsUpdated"})})},Q5);function Q3(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function s_(e,t){return Q3(e,t)||e.state.dataUpdatedAt>0&&jm(e,t,t.refetchOnMount)}function jm(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&zm(e,t)}return!1}function a_(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&zm(e,n)}function zm(e,t){return e.isStaleByTime(t.staleTime)}function Z3(e,t){return!Rm(e.getCurrentResult(),t)}var l_=de.createContext(void 0),J3=e=>{const t=de.useContext(l_);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},eR=({client:e,children:t})=>(de.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),de.createElement(l_.Provider,{value:e},t)),c_=de.createContext(!1),tR=()=>de.useContext(c_);c_.Provider;function nR(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var rR=de.createContext(nR()),iR=()=>de.useContext(rR);function oR(e,t){return typeof e=="function"?e(...t):!!e}var sR=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},aR=e=>{de.useEffect(()=>{e.clearReset()},[e])},lR=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&oR(n,[e.error,r]),cR=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},uR=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,dR=(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=J3(n),i=tR(),o=iR(),s=r.defaultQueryOptions(e);s._optimisticResults=i?"isRestoring":"optimistic",cR(s),sR(s,o),aR(o);const[a]=de.useState(()=>new t(r,s)),l=a.getOptimisticResult(s);if(de.useSyncExternalStore(de.useCallback(c=>{const u=i?()=>{}:a.subscribe(In.batchCalls(c));return a.updateResult(),u},[a,i]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),de.useEffect(()=>{a.setOptions(s,{listeners:!1})},[s,a]),uR(s,l))throw dR(s,a,o);if(lR({result:l,errorResetBoundary:o,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw l.error;return s.notifyOnChangeProps?l:a.trackResult(l)}function vi(e,t){return fR(e,X3,t)}let xf;const hR=new Uint8Array(16);function pR(){if(!xf&&(xf=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!xf))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return xf(hR)}const Nn=[];for(let e=0;e<256;++e)Nn.push((e+256).toString(16).slice(1));function gR(e,t=0){return Nn[e[t+0]]+Nn[e[t+1]]+Nn[e[t+2]]+Nn[e[t+3]]+"-"+Nn[e[t+4]]+Nn[e[t+5]]+"-"+Nn[e[t+6]]+Nn[e[t+7]]+"-"+Nn[e[t+8]]+Nn[e[t+9]]+"-"+Nn[e[t+10]]+Nn[e[t+11]]+Nn[e[t+12]]+Nn[e[t+13]]+Nn[e[t+14]]+Nn[e[t+15]]}const u_={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Go(e,t,n){if(u_.randomUUID&&!t&&!e)return u_.randomUUID();e=e||{};const r=e.random||(e.rng||pR)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return gR(r)}const ve=Mw()(Vw((e,t)=>({isShowingVisual:!0,runSql:!1,sqlGen:{},sql:"",isSqlRunning:!1,showFilters:!1,applyFilters:!1,filterValues:[{filterId:"sample-filter-id",valueType:"string",name:"",operation:"in",values:[""]}],card:{id:Go(),title:"Editor Card",description:"Desdcription",type:"bar",data:[]},frame:{id:Go(),cards:[],activeCardId:""},actions:{setNumberFormat:(n,r,i,o)=>{e(s=>{var a;s.card.preferences={...(a=s.card)==null?void 0:a.preferences,formatNumber:{format:n,currency:r,locale:i,suffix:o,enabled:!0}}})},setCardPreferences:n=>{e(r=>{r.card.preferences=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})},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(i=>{i.sqlGen.measures=[...i.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,i;e(o=>{o.selectedConnectionId=n,o.card.connectionId=n}),(i=(r=t()).onConnectionChange)==null||i.call(r,n)},setSelectedDatabaseName:n=>{var r,i;e(o=>{o.selectedDatabaseName=n,o.card.lastSelectedDatabase=n}),(i=(r=t()).onDatabaseChange)==null||i.call(r,n)},setSelectedSchemaName:n=>{var r,i;e(o=>{o.selectedSchemaName=n,o.card.lastSelectedSchema=n}),(i=(r=t()).onSchemaChange)==null||i.call(r,n)},setSelectedTableName:n=>{var r,i;e(o=>{o.selectedTableName=n,o.card.lastSelectedTable=n}),(i=(r=t()).onTableChange)==null||i.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})}}}))),mR=()=>ve(e=>e.actions);process.env.NODE_ENV==="development"&&Ww("EditorStore",ve);const vR={id:"",authToken:void 0},d_=m.createContext(vR),f_=({children:e,dashboardProps:t})=>_.jsx(d_.Provider,{value:t,children:e});function Ai(){const e=m.useContext(d_);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}function h_(e,t){var we;let n=m.useMemo(()=>[],[]);const r=Ai().authToken||e,i=ve(q=>q.selectedConnectionId),o=ve(q=>q.selectedDatabaseName),s=ve(q=>q.selectedSchemaName),a=ve(q=>q.selectedTableName),l=ve(q=>q.actions.setCurrentColumns),c=ve(q=>q.actions.setSelectedConnectionId),u=ve(q=>q.actions.setSelectedDatabaseName),f=ve(q=>q.actions.setSelectedSchemaName),g=ve(q=>q.actions.setSelectedTableName),p=ve(q=>q.actions.setCardSql),{data:v,isLoading:b,isError:x}=vi({queryKey:[t||"connections"],queryFn:()=>ll("https://semaphor.cloud/api/v1/connections",(r==null?void 0:r.accessToken)||""),enabled:!!(r!=null&&r.accessToken)}),w=v==null?void 0:v.connections.find(q=>q.id===i),S=(w==null?void 0:w.type)==="API"||(w==null?void 0:w.type)==="S3",{data:C,isLoading:P,isFetching:O,isError:k,refetch:T}=vi({queryKey:[i],queryFn:()=>ll("https://semaphor.cloud/api/v1/databases",(r==null?void 0:r.accessToken)||"",{connection_id:i}),enabled:!!i&&!S}),{data:I,isLoading:F,isFetching:j,isError:B,refetch:V}=vi({queryKey:[i,o],queryFn:()=>ll("https://semaphor.cloud/api/v1/schemas",(r==null?void 0:r.accessToken)||"",{connection_id:i,database_name:o}),enabled:!!i&&!!o&&!S}),{data:G,isLoading:ee,isFetching:$,isError:Q,refetch:W}=vi({queryKey:[i,o,s],queryFn:()=>ll("https://semaphor.cloud/api/v1/tables",(r==null?void 0:r.accessToken)||"",{connection_id:i,database_name:o,schema_name:s}),enabled:!!i&&!!o&&!!s&&!S}),{data:ne,isLoading:ae,isFetching:A,isError:H}=vi({queryKey:[i,o,a],queryFn:()=>ll("https://semaphor.cloud/api/v1/columns",(r==null?void 0:r.accessToken)||"",{connection_id:i,database_name:o,schema_name:s,table_name:a}),enabled:!!i&&!!o&&!!s&&!!a||S});console.log("columnsData",ne),m.useEffect(()=>{l(n)},[ne,l,n]),m.useEffect(()=>{var q;S&&(u("NA"),f("NA"),g((q=w==null?void 0:w.type)==null?void 0:q.toLowerCase()))},[S,p,g,f,u,w]);const re=S?(we=w==null?void 0:w.type)==null?void 0:we.toLowerCase():a||"";console.log("tableName",re);const R=S?"":s||"";function ue(q){f(q),g("")}function ye(q){u(q),f(""),g("")}function ge(q){c(q)}C&&C.databases.length>0,I&&I.schemas.length>0,ne&&ne.columns.length>0&&(n=ne.columns.map(q=>({...q,data_type:q.data_type.toLowerCase()}))),k&&(n=[]),(H||x)&&(n=[]);const he=v==null?void 0:v.connections.map(q=>({id:q.id,name:q.name,type:q.type})),te=C==null?void 0:C.databases.map(q=>({id:q.database_name,name:q.database_name})),Z=I==null?void 0:I.schemas.map(q=>({id:q.schema_name,name:q.schema_name})),ie=G==null?void 0:G.tables.map(q=>({id:q.table_name,name:q.table_name}));return{connectionItems:he,isConnectionsLoading:b,isConnectionsError:x,databaseItems:te,isDatabasesLoadingOrFetching:P||O,isDatabaseError:k,schemaItems:Z,isSchemaLoadingOrFetching:F||j,isSchemaError:B,tableItems:ie,isTableLoadingOrFetching:ee||$,isTableError:Q,columns:n,isColumnsLoadingOrFetching:ae||A,isColumnsError:H,isAPIConnection:S,tableName:re,schemaName:R,handleConnectionChange:ge,handleDatabaseChange:ye,handleSchemaChange:ue}}const bR=e=>{const t=new Date(e);return!isNaN(t.getTime())},yR=e=>!isNaN(Number(e))&&!isNaN(parseFloat(e)),Bm=e=>{let t;return typeof e=="number"?t="number":typeof e=="string"?bR(e)?t="date":yR(e)?t="number":t="string":typeof e=="boolean"?t="boolean":e instanceof Date?t="date":t="unknown",t};function xR({get:e,dataPoint:t,card:n}){var g;const{addOrUpdateFilterValue:r,addFilteringCard:i,removeFilterValue:o,replaceFilterValue:s,removeFilteringCard:a}=e().actions,l=e().filteringCards,{columnName:c,columnValue:u}=t,f={filterId:n.id,connectionId:n==null?void 0:n.connectionId,tableName:n.lastSelectedTable,name:c,expression:(g=n.preferences)==null?void 0:g.filterOnClickField,valueType:Bm(u),operation:"=",values:[u]};if(l!=null&&l.find(p=>p.id===n.id)){const p=n.id;if(u==null){a(n),o(p);return}else s(f)}i(n),r(f)}var wf={exports:{}};/**
60
60
  * @license
61
61
  * Lodash <https://lodash.com/>
62
62
  * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.0.88",
8
+ "version": "0.0.89",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",