react-semaphor 0.0.60 → 0.0.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/react-semaphor.d.ts +202 -0
- package/dist/react-semaphor.js +162 -159
- package/dist/react-semaphor.umd.cjs +17 -17
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(it,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],m):(it=typeof globalThis<"u"?globalThis:it||self,m(it["react-semaphor"]={},it.React,it.ReactDOM))})(this,function(it,m,kt){"use strict";var xde=Object.defineProperty;var wde=(it,m,kt)=>m in it?xde(it,m,{enumerable:!0,configurable:!0,writable:!0,value:kt}):it[m]=kt;var ke=(it,m,kt)=>(wde(it,typeof m!="symbol"?m+"":m,kt),kt),$1=(it,m,kt)=>{if(!m.has(it))throw TypeError("Cannot "+kt)};var J=(it,m,kt)=>($1(it,m,"read from private field"),kt?kt.call(it):m.get(it)),ze=(it,m,kt)=>{if(m.has(it))throw TypeError("Cannot add the same private member more than once");m instanceof WeakSet?m.add(it):m.set(it,kt)},Ie=(it,m,kt,Ts)=>($1(it,m,"write to private field"),Ts?Ts.call(it,kt):m.set(it,kt),kt);var Ug=(it,m,kt,Ts)=>({set _(ue){Ie(it,m,ue,kt)},get _(){return J(it,m,Ts)}}),xt=(it,m,kt)=>($1(it,m,"access private method"),kt);var Pa,ps,Ql,xA,Jl,gs,Zl,wA,ka,_A,ec,tc,ri,ms,ii,Mn,hd,Ma,nc,Gg,Si,No,SA,Yi,CA,Ki,pd,zr,rc,Xi,Ds,EA,oi,gd,Da,OA,Sn,vs,bs,ic,oc,ys,sc,ac,PA,gr,Jt,md,er,Ta,lc,Qi,vd,cc,uc,Aa,Ia,xs,dc,Na,Ud,bd,F1,yd,j1,xd,z1,wd,B1,_d,V1,Sd,H1,Cd,W1,ig,e3,kA,og,Ox;function Ts(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const ue=Ts(m),t3=Ts(kt);var Ro=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Pc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Yg(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var Kg={exports:{}},kc={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.development.js
|
|
4
4
|
*
|
|
@@ -56,16 +56,16 @@ Check the top-level render call using <`+se+">.")}return G}}function ja(D,G){{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 aw;function H3(){if(aw)return nm;aw=1;var e=m,t=ow();function n(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}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 nm.useSyncExternalStoreWithSelector=function(c,d,f,g,p){var v=o(null);if(v.current===null){var y={hasValue:!1,value:null};v.current=y}else y=v.current;v=a(function(){function w(k){if(!S){if(S=!0,C=k,k=g(k),p!==void 0&&y.hasValue){var A=y.value;if(p(A,k))return P=A}return P=k}if(A=P,r(C,k))return A;var L=g(k);return p!==void 0&&p(A,L)?A:(C=k,P=L)}var S=!1,C,P,O=f===void 0?null:f;return[function(){return w(d())},O===null?void 0:function(){return w(O())}]},[d,f,g,p]);var x=i(c,v[0],v[1]);return s(function(){y.hasValue=!0,y.value=x},[x]),l(x),x},nm}process.env.NODE_ENV==="production"?Jg.exports=H3():Jg.exports=V3();var W3=Jg.exports;const q3=Pc(W3);var lw={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:U3}=m,{useSyncExternalStoreWithSelector:G3}=q3;let cw=!1;function Y3(e,t=e.getState,n){(lw?"production":void 0)!=="production"&&n&&!cw&&(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"),cw=!0);const r=G3(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return U3(r),r}const uw=e=>{(lw?"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"?j3(e):e,n=(r,i)=>Y3(t,r,i);return Object.assign(n,t),n},dw=e=>e?uw(e):uw;var fw=Symbol.for("immer-nothing"),hw=Symbol.for("immer-draftable"),wr=Symbol.for("immer-state"),K3=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=K3[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 nl=Object.getPrototypeOf;function rl(e){return!!e&&!!e[wr]}function Ns(e){var t;return e?pw(e)||Array.isArray(e)||!!e[hw]||!!((t=e.constructor)!=null&&t[hw])||Qd(e)||Jd(e):!1}var X3=Object.prototype.constructor.toString();function pw(e){if(!e||typeof e!="object")return!1;const t=nl(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)===X3}function Ac(e,t){Xd(e)===0?Object.entries(e).forEach(([n,r])=>{t(n,r,e)}):e.forEach((n,r)=>t(r,n,e))}function Xd(e){const t=e[wr];return t?t.type_:Array.isArray(e)?1:Qd(e)?2:Jd(e)?3:0}function rm(e,t){return Xd(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function gw(e,t,n){const r=Xd(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function Q3(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Qd(e){return e instanceof Map}function Jd(e){return e instanceof Set}function Rs(e){return e.copy_||e.base_}function im(e,t){if(Qd(e))return new Map(e);if(Jd(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&pw(e))return nl(e)?{...e}:Object.assign(Object.create(null),e);const n=Object.getOwnPropertyDescriptors(e);delete n[wr];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(nl(e),n)}function om(e,t=!1){return Zd(e)||rl(e)||!Ns(e)||(Xd(e)>1&&(e.set=e.add=e.clear=e.delete=J3),Object.freeze(e),t&&Ac(e,(n,r)=>om(r,!0))),e}function J3(){ir(2)}function Zd(e){return Object.isFrozen(e)}var Z3={};function Ls(e){const t=Z3[e];return t||ir(0,e),t}var Ic;function mw(){return Ic}function eN(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function vw(e,t){t&&(Ls("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function sm(e){am(e),e.drafts_.forEach(tN),e.drafts_=null}function am(e){e===Ic&&(Ic=e.parent_)}function bw(e){return Ic=eN(Ic,e)}function tN(e){const t=e[wr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function yw(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[wr].modified_&&(sm(t),ir(4)),Ns(e)&&(e=ef(t,e),t.parent_||tf(t,e)),t.patches_&&Ls("Patches").generateReplacementPatches_(n[wr].base_,e,t.patches_,t.inversePatches_)):e=ef(t,n,[]),sm(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==fw?e:void 0}function ef(e,t,n){if(Zd(t))return t;const r=t[wr];if(!r)return Ac(t,(i,o)=>xw(e,r,t,i,o,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return tf(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),Ac(o,(a,l)=>xw(e,r,i,a,l,n,s)),tf(e,i,!1),n&&e.patches_&&Ls("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function xw(e,t,n,r,i,o,s){if(process.env.NODE_ENV!=="production"&&i===n&&ir(5),rl(i)){const a=o&&t&&t.type_!==3&&!rm(t.assigned_,r)?o.concat(r):void 0,l=ef(e,i,a);if(gw(n,r,l),rl(l))e.canAutoFreeze_=!1;else return}else s&&n.add(i);if(Ns(i)&&!Zd(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;ef(e,i),(!t||!t.scope_.parent_)&&tf(e,i)}}function tf(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&om(t,n)}function nN(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:mw(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,o=lm;n&&(i=[r],o=Nc);const{revoke:s,proxy:a}=Proxy.revocable(i,o);return r.draft_=a,r.revoke_=s,a}var lm={get(e,t){if(t===wr)return e;const n=Rs(e);if(!rm(n,t))return rN(e,n,t);const r=n[t];return e.finalized_||!Ns(r)?r:r===cm(e.base_,t)?(dm(e),e.copy_[t]=fm(r,e)):r},has(e,t){return t in Rs(e)},ownKeys(e){return Reflect.ownKeys(Rs(e))},set(e,t,n){const r=ww(Rs(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=cm(Rs(e),t),o=i==null?void 0:i[wr];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(Q3(n,i)&&(n!==void 0||rm(e.base_,t)))return!0;dm(e),um(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 cm(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,dm(e),um(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Rs(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 nl(e.base_)},setPrototypeOf(){ir(12)}},Nc={};Ac(lm,(e,t)=>{Nc[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Nc.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&ir(13),Nc.set.call(this,e,t,void 0)},Nc.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&ir(14),lm.set.call(this,e[0],t,n,e[0])};function cm(e,t){const n=e[wr];return(n?Rs(n):e)[t]}function rN(e,t,n){var i;const r=ww(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function ww(e,t){if(!(t in e))return;let n=nl(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=nl(n)}}function um(e){e.modified_||(e.modified_=!0,e.parent_&&um(e.parent_))}function dm(e){e.copy_||(e.copy_=im(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var iN=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,d=>n.call(this,d,...c))}}typeof n!="function"&&ir(6),r!==void 0&&typeof r!="function"&&ir(7);let i;if(Ns(t)){const o=bw(this),s=fm(t,void 0);let a=!0;try{i=n(s),a=!1}finally{a?sm(o):am(o)}return vw(o,r),yw(i,o)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===fw&&(i=void 0),this.autoFreeze_&&om(i,!0),r){const o=[],s=[];Ls("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){Ns(e)||ir(8),rl(e)&&(e=oN(e));const t=bw(this),n=fm(e,void 0);return n[wr].isManual_=!0,am(t),n}finishDraft(e,t){const n=e&&e[wr];(!n||!n.isManual_)&&ir(9);const{scope_:r}=n;return vw(r,t),yw(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=Ls("Patches").applyPatches_;return rl(e)?r(e,t):this.produce(e,i=>r(i,t))}};function fm(e,t){const n=Qd(e)?Ls("MapSet").proxyMap_(e,t):Jd(e)?Ls("MapSet").proxySet_(e,t):nN(e,t);return(t?t.scope_:mw()).drafts_.push(n),n}function oN(e){return rl(e)||ir(10,e),_w(e)}function _w(e){if(!Ns(e)||Zd(e))return e;const t=e[wr];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=im(e,t.scope_.immer_.useStrictShallowCopy_)}else n=im(e,!0);return Ac(n,(r,i)=>{gw(n,r,_w(i))}),t&&(t.finalized_=!1),n}var _r=new iN,sN=_r.produce;_r.produceWithPatches.bind(_r),_r.setAutoFreeze.bind(_r),_r.setUseStrictShallowCopy.bind(_r),_r.applyPatches.bind(_r),_r.createDraft.bind(_r),_r.finishDraft.bind(_r);const Sw=e=>(t,n,r)=>(r.setState=(i,o,...s)=>{const a=typeof i=="function"?sN(i):i;return t(a,o,...s)},e(r.setState,n,r));var nf,rf=kt;if(process.env.NODE_ENV==="production")nf=rf.createRoot,rf.hydrateRoot;else{var Cw=rf.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;nf=function(e,t){Cw.usingClientEntryPoint=!0;try{return rf.createRoot(e,t)}finally{Cw.usingClientEntryPoint=!1}}}function Ew(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=nf(n),s=a=>{a&&(o.render(m.createElement(i,Object.assign({},a))),r.count+=1)};s(t.getState()),t.subscribe(s)}var Ow={},Pw={},hm={exports:{}},Gt=String,kw=function(){return{isColorSupported:!1,reset:Gt,bold:Gt,dim:Gt,italic:Gt,underline:Gt,inverse:Gt,hidden:Gt,strikethrough:Gt,black:Gt,red:Gt,green:Gt,yellow:Gt,blue:Gt,magenta:Gt,cyan:Gt,white:Gt,gray:Gt,bgBlack:Gt,bgRed:Gt,bgGreen:Gt,bgYellow:Gt,bgBlue:Gt,bgMagenta:Gt,bgCyan:Gt,bgWhite:Gt}};hm.exports=kw(),hm.exports.createColors=kw;var aN=hm.exports;(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,c){for(var d in c)Object.defineProperty(l,d,{enumerable:!0,get:c[d]})}t(e,{dim:function(){return s},default:function(){return a}});const n=r(aN);function r(l){return l&&l.__esModule?l:{default:l}}let i=new Set;function o(l,c,d){typeof process<"u"&&process.env.JEST_WORKER_ID||d&&i.has(d)||(d&&i.add(d),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])}}})(Pw),function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return i}});const t=n(Pw);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}}}(Ow);let pm=Ow;var lN=(pm.__esModule?pm:{default:pm}).default;const an=Pc(lN),gm={default:{dashboardPanel:"",dashboardTabsContainer:"",gridLayout:{className:""},chart:{font:{family:"Open Sans, sans-serif"},dataset:{backgroundColor:[an.violet[400],an.red[400],an.amber[400],an.orange[400],an.rose[400]],borderColor:[an.violet[400],an.red[400],an.amber[400],an.orange[400],an.rose[400]]},options:{plugins:{datalabels:{display:!1,color:cN},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:[an.teal[100],an.purple[100],an.amber[100],an.orange[100],an.rose[100]],borderColor:[an.teal[400],an.purple[400],an.amber[400],an.orange[300],an.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:an.slate[800]}},y:{grid:{display:!0,color:an.slate[800]}}}}}}};function cN(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=Mw()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=Mw()),uN(n)}function Mw(){return ge.getState().theme==="dark"?"#000000":"#FFFFFF"}function uN(e){let t=0,n=0,r=0,i=0;const o=d=>{const f=d.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(d=>{o(d)}):o(e);const s=t/i,a=n/i,l=r/i;return(s*299+a*587+l*114)/1e3>=180?"black":"white"}const ge=dw()(Sw((e,t)=>({dashboard:{id:"",style:gm},selectedSheetId:null,selectedCardId:null,selectedCard:null,showFilters:!1,isDashboardEditing:!1,isVisualEditing:!1,showDashboardJSON:!1,isEditorSaveEvent:!1,actions:{setAuthToken:n=>{e(()=>({authToken:n}))},setThemeStyle:n=>{e(()=>({themeStyle:n}))},setIsEditorSaveEvent:n=>{e(()=>({isEditorSaveEvent:n}))},setDashboard:n=>e({dashboard:n}),setBookmarkKey:n=>{e(()=>({bookmarkKey:n}))},setDashboardTheme:n=>{e(r=>{r.theme=n})},setDashboardTitle:n=>{e(r=>{r.dashboard&&(r.dashboard.title=n)})},setDashboardDescription:n=>{e(r=>{r.dashboard&&(r.dashboard.description=n)})},setSheets:n=>{e(r=>{r.dashboard&&(r.dashboard.sheets=n)})},setSheetTitle:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);o&&(o.title=r)})},setSheetDescription:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);o&&(o.description=r)})},setCards:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);o&&(o.cards=r)})},setCardTitle:(n,r,i)=>{e(o=>{var a,l,c,d;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){const f=(c=s.cards)==null?void 0:c.find(g=>g.id===r);f&&(f.title=i,(d=o.onUpdateCard)==null||d.call(o,f,n))}})},setCardSql:(n,r,i)=>{e(o=>{var a,l,c,d;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){const f=(c=s.cards)==null?void 0:c.find(g=>g.id===r);f&&(f.sql=i,(d=o.onUpdateCard)==null||d.call(o,f,n))}})},setCardData:(n,r,i)=>{e(o=>{var a,l,c,d;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){const f=(c=s.cards)==null?void 0:c.find(g=>g.id===r);f&&(f.data=i,(d=o.onUpdateCard)==null||d.call(o,f,n))}})},setCardDescription:(n,r,i)=>{e(o=>{var a,l,c,d;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){const f=(c=s.cards)==null?void 0:c.find(g=>g.id===r);f&&(f.description=i,(d=o.onUpdateCard)==null||d.call(o,f,n))}})},setSheetLayout:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);o&&(o.layout=r)})},setShowFilters:n=>{e(()=>({showFilters:n}))},setFilterValues:n=>{e(()=>({filterValues:n}))},addOrUpdateFilterValue:n=>{e(r=>{if(r.filterValues){const i=r.filterValues.findIndex(o=>o.filterId===n.filterId);i>-1?r.filterValues.splice(i,1,n):r.filterValues.push(n)}else r.filterValues=[n]})},removeFilterValue:n=>{e(r=>{if(r.filterValues){const i=r.filterValues.findIndex(o=>o.filterId===n);i>-1&&r.filterValues.splice(i,1)}})},addFilter:n=>{e(r=>{var i;r.dashboard.filters?(i=r.dashboard.filters)==null||i.push(n):r.dashboard.filters=[n]})},removeFilter:n=>{e(r=>{var i,o;if(r.dashboard.filters){const s=(i=r.dashboard.filters)==null?void 0:i.findIndex(a=>a.id===n);console.log("index",s),s>-1&&((o=r.dashboard.filters)==null||o.splice(s,1))}})},updateFilter:n=>{e(r=>{var i,o;if(r.dashboard.filters){const s=(i=r.dashboard.filters)==null?void 0:i.findIndex(a=>a.id===n.id);s>-1&&((o=r.dashboard.filters)==null||o.splice(s,1,n))}})},setIsDashboardEditing:n=>{e(()=>({isDashboardEditing:n}))},setShowDashboardJSON:n=>{e(()=>({showDashboardJSON:n}))},setIsVisualEditing:n=>{e(()=>({isVisualEditing:n}))},addCard:(n,r)=>{e(i=>{var s,a,l,c,d;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(f=>f.id===n);if(o){(l=o.cards)==null||l.push(r);const f={i:r.id,x:0,y:1/0,w:20,h:7,minW:10};(c=o.layout)==null||c.push(f),(d=i.onAddCard)==null||d.call(i,r,n)}})},updateCard:(n,r)=>{e(i=>{var a,l,c,d,f;const o=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(g=>g.id===n),s=(c=o==null?void 0:o.cards)==null?void 0:c.findIndex(g=>g.id===r.id);o&&((d=o.cards)==null||d.splice(s,1,r),(f=i.onUpdateCard)==null||f.call(i,r,n))})},removeCard:(n,r)=>{e(i=>{var a,l,c,d,f,g;const o=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(p=>p.id===n),s=(c=o==null?void 0:o.cards)==null?void 0:c.findIndex(p=>p.id===r.id);o&&((d=o.cards)==null||d.splice(s,1),(f=o.layout)==null||f.splice(s,1),(g=i.onRemoveCard)==null||g.call(i,r,n))})},setStyle:n=>{e(r=>{r.dashboard&&(r.dashboard.style=n)})},setSelectedCardId:(n,r)=>{e(i=>{var s,a,l;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===n);o&&(((l=o.cards)==null?void 0:l.find(d=>d.id===r))?i.selectedCardId=r:i.selectedCardId=null)})},setSelectedCard:n=>{e(r=>{r.selectedCard=n})},setSelectedSheetId:n=>{e(r=>{var o,s;((s=(o=r.dashboard)==null?void 0:o.sheets)==null?void 0:s.find(a=>a.id===n))&&(r.selectedSheetId=n)})},setOnSaveFunction:n=>{e(()=>({onSaveFunction:n}))},setOnAddCard:n=>{e(()=>({onAddCard:n}))},setOnUpdateCard:n=>{e(()=>({onUpdateCard:n}))},setOnRemoveCard:n=>{e(()=>({onRemoveCard:n}))},setOnEvent:n=>{e(()=>({onEvent:n}))},getDashboard:()=>t().dashboard,getSelectedSheet:()=>{var n,r;return(r=(n=t().dashboard)==null?void 0:n.sheets)==null?void 0:r.find(i=>i.id===t().selectedSheetId)},getSelectedCard:()=>{var r,i,o;const n=(i=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:i.find(s=>s.id===t().selectedSheetId);return(o=n==null?void 0:n.cards)==null?void 0:o.find(s=>s.id===t().selectedCardId)},getSelectedSheetCards:()=>{var r,i;const n=(i=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:i.find(o=>o.id===t().selectedSheetId);return n==null?void 0:n.cards},getSelectedSheetLayout:()=>{var r,i;const n=(i=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:i.find(o=>o.id===t().selectedSheetId);return n==null?void 0:n.layout},getStyle:()=>{var n;return(n=t().dashboard)==null?void 0:n.style}}})));process.env.NODE_ENV==="development"&&Ew("DashboardStore",ge);var Rc=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(){}},il=typeof window>"u"||"Deno"in window;function Kr(){}function dN(e,t){return typeof e=="function"?e(t):e}function mm(e){return typeof e=="number"&&e>=0&&e!==1/0}function Dw(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Tw(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==vm(s,t.options))return!1}else if(!$c(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 Aw(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Lc(t.options.mutationKey)!==Lc(o))return!1}else if(!$c(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function vm(e,t){return((t==null?void 0:t.queryKeyHashFn)||Lc)(e)}function Lc(e){return JSON.stringify(e,(t,n)=>ym(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function $c(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!$c(e[n],t[n])):!1}function Iw(e,t){if(e===t)return e;const n=Nw(e)&&Nw(t);if(n||ym(e)&&ym(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 d=n?c:o[c];!n&&e[d]===void 0&&t[d]===void 0&&r.includes(d)?(a[d]=void 0,l++):(a[d]=Iw(e[d],t[d]),a[d]===e[d]&&e[d]!==void 0&&l++)}return i===s&&l===i?e:a}return t}function bm(e,t){if(e&&!t||t&&!e)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Nw(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ym(e){if(!Rw(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!Rw(n)||!n.hasOwnProperty("isPrototypeOf"))}function Rw(e){return Object.prototype.toString.call(e)==="[object Object]"}function fN(e){return new Promise(t=>{setTimeout(t,e)})}function xm(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Iw(e,t):t}function hN(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function pN(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var gN=(xA=class extends Rc{constructor(){super();ze(this,Pa,void 0);ze(this,ps,void 0);ze(this,Ql,void 0);Ie(this,Ql,t=>{if(!il&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){J(this,ps)||this.setEventListener(J(this,Ql))}onUnsubscribe(){var t;this.hasListeners()||((t=J(this,ps))==null||t.call(this),Ie(this,ps,void 0))}setEventListener(t){var n;Ie(this,Ql,t),(n=J(this,ps))==null||n.call(this),Ie(this,ps,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){J(this,Pa)!==t&&(Ie(this,Pa,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof J(this,Pa)=="boolean"?J(this,Pa):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Pa=new WeakMap,ps=new WeakMap,Ql=new WeakMap,xA),of=new gN,mN=(wA=class extends Rc{constructor(){super();ze(this,Jl,!0);ze(this,gs,void 0);ze(this,Zl,void 0);Ie(this,Zl,t=>{if(!il&&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(){J(this,gs)||this.setEventListener(J(this,Zl))}onUnsubscribe(){var t;this.hasListeners()||((t=J(this,gs))==null||t.call(this),Ie(this,gs,void 0))}setEventListener(t){var n;Ie(this,Zl,t),(n=J(this,gs))==null||n.call(this),Ie(this,gs,t(this.setOnline.bind(this)))}setOnline(t){J(this,Jl)!==t&&(Ie(this,Jl,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return J(this,Jl)}},Jl=new WeakMap,gs=new WeakMap,Zl=new WeakMap,wA),sf=new mN;function vN(e){return Math.min(1e3*2**e,3e4)}function af(e){return(e??"online")==="online"?sf.isOnline():!0}var Lw=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function wm(e){return e instanceof Lw}function $w(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 Lw(x)),(w=e.abort)==null||w.call(e))},c=()=>{t=!0},d=()=>{t=!1},f=()=>!of.isFocused()||e.networkMode!=="always"&&!sf.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)}),y=()=>{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??(il?0:3),C=e.retryDelay??vN,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),fN(P).then(()=>{if(f())return v()}).then(()=>{t?p(w):y()})})};return af(e.networkMode)?y():v().then(y),{promise:a,cancel:l,continue:()=>(i==null?void 0:i())?a:Promise.resolve(),cancelRetry:c,continueRetry:d}}function bN(){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=bN(),Fw=(_A=class{constructor(){ze(this,ka,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),mm(this.gcTime)&&Ie(this,ka,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(il?1/0:5*60*1e3))}clearGcTimeout(){J(this,ka)&&(clearTimeout(J(this,ka)),Ie(this,ka,void 0))}},ka=new WeakMap,_A),yN=(SA=class extends Fw{constructor(t){super();ze(this,nc);ze(this,Si);ze(this,ec,void 0);ze(this,tc,void 0);ze(this,ri,void 0);ze(this,ms,void 0);ze(this,ii,void 0);ze(this,Mn,void 0);ze(this,hd,void 0);ze(this,Ma,void 0);Ie(this,Ma,!1),Ie(this,hd,t.defaultOptions),xt(this,nc,Gg).call(this,t.options),Ie(this,Mn,[]),Ie(this,ri,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ie(this,ec,t.state||xN(this.options)),this.state=J(this,ec),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!J(this,Mn).length&&this.state.fetchStatus==="idle"&&J(this,ri).remove(this)}setData(t,n){const r=xm(this.state.data,t,this.options);return xt(this,Si,No).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){xt(this,Si,No).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=J(this,ms);return(r=J(this,ii))==null||r.cancel(t),n?n.then(Kr).catch(Kr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(J(this,ec))}isActive(){return J(this,Mn).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||J(this,Mn).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!Dw(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=J(this,Mn).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=J(this,ii))==null||n.continue()}onOnline(){var n;const t=J(this,Mn).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=J(this,ii))==null||n.continue()}addObserver(t){J(this,Mn).includes(t)||(J(this,Mn).push(t),this.clearGcTimeout(),J(this,ri).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){J(this,Mn).includes(t)&&(Ie(this,Mn,J(this,Mn).filter(n=>n!==t)),J(this,Mn).length||(J(this,ii)&&(J(this,Ma)?J(this,ii).cancel({revert:!0}):J(this,ii).cancelRetry()),this.scheduleGc()),J(this,ri).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return J(this,Mn).length}invalidate(){this.state.isInvalidated||xt(this,Si,No).call(this,{type:"invalidate"})}fetch(t,n){var c,d,f,g;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(J(this,ms))return(c=J(this,ii))==null||c.continueRetry(),J(this,ms)}if(t&&xt(this,nc,Gg).call(this,t),!this.options.queryFn){const p=J(this,Mn).find(v=>v.options.queryFn);p&&xt(this,nc,Gg).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:()=>(Ie(this,Ma,!0),r.signal)})};o(i);const s=()=>this.options.queryFn?(Ie(this,Ma,!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),(d=this.options.behavior)==null||d.onFetch(a,this),Ie(this,tc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=a.fetchOptions)==null?void 0:f.meta))&&xt(this,Si,No).call(this,{type:"fetch",meta:(g=a.fetchOptions)==null?void 0:g.meta});const l=p=>{var v,y,x,w;wm(p)&&p.silent||xt(this,Si,No).call(this,{type:"error",error:p}),wm(p)||((y=(v=J(this,ri).config).onError)==null||y.call(v,p,this),(w=(x=J(this,ri).config).onSettled)==null||w.call(x,this.state.data,p,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return Ie(this,ii,$w({fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:p=>{var v,y,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),(y=(v=J(this,ri).config).onSuccess)==null||y.call(v,p,this),(w=(x=J(this,ri).config).onSettled)==null||w.call(x,p,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(p,v)=>{xt(this,Si,No).call(this,{type:"failed",failureCount:p,error:v})},onPause:()=>{xt(this,Si,No).call(this,{type:"pause"})},onContinue:()=>{xt(this,Si,No).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),Ie(this,ms,J(this,ii).promise),J(this,ms)}},ec=new WeakMap,tc=new WeakMap,ri=new WeakMap,ms=new WeakMap,ii=new WeakMap,Mn=new WeakMap,hd=new WeakMap,Ma=new WeakMap,nc=new WeakSet,Gg=function(t){this.options={...J(this,hd),...t},this.updateGcTime(this.options.gcTime)},Si=new WeakSet,No=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:af(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 wm(i)&&i.revert&&J(this,tc)?{...J(this,tc),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(()=>{J(this,Mn).forEach(r=>{r.onQueryUpdate()}),J(this,ri).notify({query:this,type:"updated",action:t})})},SA);function xN(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 wN=(CA=class extends Rc{constructor(t={}){super();ze(this,Yi,void 0);this.config=t,Ie(this,Yi,new Map)}build(t,n,r){const i=n.queryKey,o=n.queryHash??vm(i,n);let s=this.get(o);return s||(s=new yN({cache:this,queryKey:i,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(s)),s}add(t){J(this,Yi).has(t.queryHash)||(J(this,Yi).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=J(this,Yi).get(t.queryHash);n&&(t.destroy(),n===t&&J(this,Yi).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){In.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return J(this,Yi).get(t)}getAll(){return[...J(this,Yi).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Tw(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Tw(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()})})}},Yi=new WeakMap,CA),_N=(EA=class extends Fw{constructor(t){super();ze(this,Xi);ze(this,Ki,void 0);ze(this,pd,void 0);ze(this,zr,void 0);ze(this,rc,void 0);this.mutationId=t.mutationId,Ie(this,pd,t.defaultOptions),Ie(this,zr,t.mutationCache),Ie(this,Ki,[]),this.state=t.state||SN(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...J(this,pd),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){J(this,Ki).includes(t)||(J(this,Ki).push(t),this.clearGcTimeout(),J(this,zr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ie(this,Ki,J(this,Ki).filter(n=>n!==t)),this.scheduleGc(),J(this,zr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){J(this,Ki).length||(this.state.status==="pending"?this.scheduleGc():J(this,zr).remove(this))}continue(){var t;return((t=J(this,rc))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,s,a,l,c,d,f,g,p,v,y,x,w,S,C,P,O,k,A;const n=()=>(Ie(this,rc,$w({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(L,F)=>{xt(this,Xi,Ds).call(this,{type:"failed",failureCount:L,error:F})},onPause:()=>{xt(this,Xi,Ds).call(this,{type:"pause"})},onContinue:()=>{xt(this,Xi,Ds).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),J(this,rc).promise),r=this.state.status==="pending";try{if(!r){xt(this,Xi,Ds).call(this,{type:"pending",variables:t}),await((o=(i=J(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&&xt(this,Xi,Ds).call(this,{type:"pending",context:F,variables:t})}const L=await n();return await((c=(l=J(this,zr).config).onSuccess)==null?void 0:c.call(l,L,t,this.state.context,this)),await((f=(d=this.options).onSuccess)==null?void 0:f.call(d,L,t,this.state.context)),await((p=(g=J(this,zr).config).onSettled)==null?void 0:p.call(g,L,null,this.state.variables,this.state.context,this)),await((y=(v=this.options).onSettled)==null?void 0:y.call(v,L,null,t,this.state.context)),xt(this,Xi,Ds).call(this,{type:"success",data:L}),L}catch(L){try{throw await((w=(x=J(this,zr).config).onError)==null?void 0:w.call(x,L,t,this.state.context,this)),await((C=(S=this.options).onError)==null?void 0:C.call(S,L,t,this.state.context)),await((O=(P=J(this,zr).config).onSettled)==null?void 0:O.call(P,void 0,L,this.state.variables,this.state.context,this)),await((A=(k=this.options).onSettled)==null?void 0:A.call(k,void 0,L,t,this.state.context)),L}finally{xt(this,Xi,Ds).call(this,{type:"error",error:L})}}}},Ki=new WeakMap,pd=new WeakMap,zr=new WeakMap,rc=new WeakMap,Xi=new WeakSet,Ds=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:!af(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(()=>{J(this,Ki).forEach(r=>{r.onMutationUpdate(t)}),J(this,zr).notify({mutation:this,type:"updated",action:t})})},EA);function SN(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var CN=(OA=class extends Rc{constructor(t={}){super();ze(this,oi,void 0);ze(this,gd,void 0);ze(this,Da,void 0);this.config=t,Ie(this,oi,[]),Ie(this,gd,0)}build(t,n,r){const i=new _N({mutationCache:this,mutationId:++Ug(this,gd)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){J(this,oi).push(t),this.notify({type:"added",mutation:t})}remove(t){Ie(this,oi,J(this,oi).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){In.batch(()=>{J(this,oi).forEach(t=>{this.remove(t)})})}getAll(){return J(this,oi)}find(t){const n={exact:!0,...t};return J(this,oi).find(r=>Aw(n,r))}findAll(t={}){return J(this,oi).filter(n=>Aw(t,n))}notify(t){In.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return Ie(this,Da,(J(this,Da)??Promise.resolve()).then(()=>{const t=J(this,oi).filter(n=>n.state.isPaused);return In.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(Kr)),Promise.resolve()))}).then(()=>{Ie(this,Da,void 0)})),J(this,Da)}},oi=new WeakMap,gd=new WeakMap,Da=new WeakMap,OA);function EN(e){return{onFetch:(t,n)=>{const r=async()=>{var v,y,x,w,S;const i=t.options,o=(x=(y=(v=t.fetchOptions)==null?void 0:v.meta)==null?void 0:y.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 d=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};d(k);const A=await f(k),{maxPages:L}=t.options,F=O?pN:hN;return{pages:F(C.pages,A,L),pageParams:F(C.pageParams,P,L)}};let p;if(o&&s.length){const C=o==="backward",P=C?ON:jw,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=jw(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 jw(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function ON(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var PN=(PA=class{constructor(e={}){ze(this,Sn,void 0);ze(this,vs,void 0);ze(this,bs,void 0);ze(this,ic,void 0);ze(this,oc,void 0);ze(this,ys,void 0);ze(this,sc,void 0);ze(this,ac,void 0);Ie(this,Sn,e.queryCache||new wN),Ie(this,vs,e.mutationCache||new CN),Ie(this,bs,e.defaultOptions||{}),Ie(this,ic,new Map),Ie(this,oc,new Map),Ie(this,ys,0)}mount(){Ug(this,ys)._++,J(this,ys)===1&&(Ie(this,sc,of.subscribe(()=>{of.isFocused()&&(this.resumePausedMutations(),J(this,Sn).onFocus())})),Ie(this,ac,sf.subscribe(()=>{sf.isOnline()&&(this.resumePausedMutations(),J(this,Sn).onOnline())})))}unmount(){var e,t;Ug(this,ys)._--,J(this,ys)===0&&((e=J(this,sc))==null||e.call(this),Ie(this,sc,void 0),(t=J(this,ac))==null||t.call(this),Ie(this,ac,void 0))}isFetching(e){return J(this,Sn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return J(this,vs).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=J(this,Sn).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=J(this,Sn).find({queryKey:e}),i=r==null?void 0:r.state.data,o=dN(t,i);if(typeof o>"u")return;const s=this.defaultQueryOptions({queryKey:e});return J(this,Sn).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=J(this,Sn).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=J(this,Sn);In.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=J(this,Sn),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(()=>J(this,Sn).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Kr).catch(Kr)}invalidateQueries(e={},t={}){return In.batch(()=>{if(J(this,Sn).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(()=>J(this,Sn).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=J(this,Sn).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=EN(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Kr).catch(Kr)}resumePausedMutations(){return J(this,vs).resumePausedMutations()}getQueryCache(){return J(this,Sn)}getMutationCache(){return J(this,vs)}getDefaultOptions(){return J(this,bs)}setDefaultOptions(e){Ie(this,bs,e)}setQueryDefaults(e,t){J(this,ic).set(Lc(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...J(this,ic).values()];let n={};return t.forEach(r=>{$c(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){J(this,oc).set(Lc(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...J(this,oc).values()];let n={};return t.forEach(r=>{$c(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...J(this,bs).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=vm(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:{...J(this,bs).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){J(this,Sn).clear(),J(this,vs).clear()}},Sn=new WeakMap,vs=new WeakMap,bs=new WeakMap,ic=new WeakMap,oc=new WeakMap,ys=new WeakMap,sc=new WeakMap,ac=new WeakMap,PA),kN=(kA=class extends Rc{constructor(t,n){super();ze(this,Na);ze(this,bd);ze(this,yd);ze(this,xd);ze(this,wd);ze(this,_d);ze(this,Sd);ze(this,Cd);ze(this,ig);ze(this,gr,void 0);ze(this,Jt,void 0);ze(this,md,void 0);ze(this,er,void 0);ze(this,Ta,void 0);ze(this,lc,void 0);ze(this,Qi,void 0);ze(this,vd,void 0);ze(this,cc,void 0);ze(this,uc,void 0);ze(this,Aa,void 0);ze(this,Ia,void 0);ze(this,xs,void 0);ze(this,dc,new Set);this.options=n,Ie(this,gr,t),Ie(this,Qi,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(J(this,Jt).addObserver(this),zw(J(this,Jt),this.options)?xt(this,Na,Ud).call(this):this.updateResult(),xt(this,wd,B1).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return _m(J(this,Jt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return _m(J(this,Jt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,xt(this,_d,V1).call(this),xt(this,Sd,H1).call(this),J(this,Jt).removeObserver(this)}setOptions(t,n){const r=this.options,i=J(this,Jt);if(this.options=J(this,gr).defaultQueryOptions(t),bm(r,this.options)||J(this,gr).getQueryCache().notify({type:"observerOptionsUpdated",query:J(this,Jt),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),xt(this,Cd,W1).call(this);const o=this.hasListeners();o&&Bw(J(this,Jt),i,this.options,r)&&xt(this,Na,Ud).call(this),this.updateResult(n),o&&(J(this,Jt)!==i||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&xt(this,bd,F1).call(this);const s=xt(this,yd,j1).call(this);o&&(J(this,Jt)!==i||this.options.enabled!==r.enabled||s!==J(this,xs))&&xt(this,xd,z1).call(this,s)}getOptimisticResult(t){const n=J(this,gr).getQueryCache().build(J(this,gr),t),r=this.createResult(n,t);return DN(this,r)&&(Ie(this,er,r),Ie(this,lc,this.options),Ie(this,Ta,J(this,Jt).state)),r}getCurrentResult(){return J(this,er)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(J(this,dc).add(r),t[r])})}),n}getCurrentQuery(){return J(this,Jt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=J(this,gr).defaultQueryOptions(t),r=J(this,gr).getQueryCache().build(J(this,gr),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return xt(this,Na,Ud).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),J(this,er)))}createResult(t,n){var k;const r=J(this,Jt),i=this.options,o=J(this,er),s=J(this,Ta),a=J(this,lc),c=t!==r?t.state:J(this,md),{state:d}=t;let{error:f,errorUpdatedAt:g,fetchStatus:p,status:v}=d,y=!1,x;if(n._optimisticResults){const A=this.hasListeners(),L=!A&&zw(t,n),F=A&&Bw(t,r,n,i);(L||F)&&(p=af(t.options.networkMode)?"fetching":"paused",d.dataUpdatedAt||(v="pending")),n._optimisticResults==="isRestoring"&&(p="idle")}if(n.select&&typeof d.data<"u")if(o&&d.data===(s==null?void 0:s.data)&&n.select===J(this,vd))x=J(this,cc);else try{Ie(this,vd,n.select),x=n.select(d.data),x=xm(o==null?void 0:o.data,x,n),Ie(this,cc,x),Ie(this,Qi,null)}catch(A){Ie(this,Qi,A)}else x=d.data;if(typeof n.placeholderData<"u"&&typeof x>"u"&&v==="pending"){let A;if(o!=null&&o.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))A=o.data;else if(A=typeof n.placeholderData=="function"?n.placeholderData((k=J(this,uc))==null?void 0:k.state.data,J(this,uc)):n.placeholderData,n.select&&typeof A<"u")try{A=n.select(A),Ie(this,Qi,null)}catch(L){Ie(this,Qi,L)}typeof A<"u"&&(v="success",x=xm(o==null?void 0:o.data,A,n),y=!0)}J(this,Qi)&&(f=J(this,Qi),x=J(this,cc),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:d.dataUpdatedAt,error:f,errorUpdatedAt:g,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:w,isRefetching:w&&!S,isLoadingError:C&&d.dataUpdatedAt===0,isPaused:p==="paused",isPlaceholderData:y,isRefetchError:C&&d.dataUpdatedAt!==0,isStale:Sm(t,n),refetch:this.refetch}}updateResult(t){const n=J(this,er),r=this.createResult(J(this,Jt),this.options);if(Ie(this,Ta,J(this,Jt).state),Ie(this,lc,this.options),J(this,Ta).data!==void 0&&Ie(this,uc,J(this,Jt)),bm(r,n))return;Ie(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&&!J(this,dc).size)return!0;const l=new Set(a??J(this,dc));return this.options.throwOnError&&l.add("error"),Object.keys(J(this,er)).some(c=>{const d=c;return J(this,er)[d]!==n[d]&&l.has(d)})};(t==null?void 0:t.listeners)!==!1&&o()&&(i.listeners=!0),xt(this,ig,e3).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&xt(this,wd,B1).call(this)}},gr=new WeakMap,Jt=new WeakMap,md=new WeakMap,er=new WeakMap,Ta=new WeakMap,lc=new WeakMap,Qi=new WeakMap,vd=new WeakMap,cc=new WeakMap,uc=new WeakMap,Aa=new WeakMap,Ia=new WeakMap,xs=new WeakMap,dc=new WeakMap,Na=new WeakSet,Ud=function(t){xt(this,Cd,W1).call(this);let n=J(this,Jt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Kr)),n},bd=new WeakSet,F1=function(){if(xt(this,_d,V1).call(this),il||J(this,er).isStale||!mm(this.options.staleTime))return;const n=Dw(J(this,er).dataUpdatedAt,this.options.staleTime)+1;Ie(this,Aa,setTimeout(()=>{J(this,er).isStale||this.updateResult()},n))},yd=new WeakSet,j1=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(J(this,Jt)):this.options.refetchInterval)??!1},xd=new WeakSet,z1=function(t){xt(this,Sd,H1).call(this),Ie(this,xs,t),!(il||this.options.enabled===!1||!mm(J(this,xs))||J(this,xs)===0)&&Ie(this,Ia,setInterval(()=>{(this.options.refetchIntervalInBackground||of.isFocused())&&xt(this,Na,Ud).call(this)},J(this,xs)))},wd=new WeakSet,B1=function(){xt(this,bd,F1).call(this),xt(this,xd,z1).call(this,xt(this,yd,j1).call(this))},_d=new WeakSet,V1=function(){J(this,Aa)&&(clearTimeout(J(this,Aa)),Ie(this,Aa,void 0))},Sd=new WeakSet,H1=function(){J(this,Ia)&&(clearInterval(J(this,Ia)),Ie(this,Ia,void 0))},Cd=new WeakSet,W1=function(){const t=J(this,gr).getQueryCache().build(J(this,gr),this.options);if(t===J(this,Jt))return;const n=J(this,Jt);Ie(this,Jt,t),Ie(this,md,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},ig=new WeakSet,e3=function(t){In.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(J(this,er))}),J(this,gr).getQueryCache().notify({query:J(this,Jt),type:"observerResultsUpdated"})})},kA);function MN(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function zw(e,t){return MN(e,t)||e.state.dataUpdatedAt>0&&_m(e,t,t.refetchOnMount)}function _m(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Sm(e,t)}return!1}function Bw(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&Sm(e,n)}function Sm(e,t){return e.isStaleByTime(t.staleTime)}function DN(e,t){return!bm(e.getCurrentResult(),t)}var Vw=ue.createContext(void 0),TN=e=>{const t=ue.useContext(Vw);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},AN=({client:e,children:t})=>(ue.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),ue.createElement(Vw.Provider,{value:e},t)),Hw=ue.createContext(!1),IN=()=>ue.useContext(Hw);Hw.Provider;function NN(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var RN=ue.createContext(NN()),LN=()=>ue.useContext(RN);function $N(e,t){return typeof e=="function"?e(...t):!!e}var FN=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},jN=e=>{ue.useEffect(()=>{e.clearReset()},[e])},zN=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&$N(n,[e.error,r]),BN=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},VN=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,HN=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function WN(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=TN(n),i=IN(),o=LN(),s=r.defaultQueryOptions(e);s._optimisticResults=i?"isRestoring":"optimistic",BN(s),FN(s,o),jN(o);const[a]=ue.useState(()=>new t(r,s)),l=a.getOptimisticResult(s);if(ue.useSyncExternalStore(ue.useCallback(c=>{const d=i?()=>{}:a.subscribe(In.batchCalls(c));return a.updateResult(),d},[a,i]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),ue.useEffect(()=>{a.setOptions(s,{listeners:!1})},[s,a]),VN(s,l))throw HN(s,a,o);if(zN({result:l,errorResetBoundary:o,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw l.error;return s.notifyOnChangeProps?l:a.trackResult(l)}function Sr(e,t){return WN(e,kN,t)}var lf={exports:{}};/**
|
|
59
|
+
*/var aw;function H3(){if(aw)return nm;aw=1;var e=m,t=ow();function n(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}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 nm.useSyncExternalStoreWithSelector=function(c,d,f,g,p){var v=o(null);if(v.current===null){var y={hasValue:!1,value:null};v.current=y}else y=v.current;v=a(function(){function w(k){if(!S){if(S=!0,C=k,k=g(k),p!==void 0&&y.hasValue){var A=y.value;if(p(A,k))return P=A}return P=k}if(A=P,r(C,k))return A;var L=g(k);return p!==void 0&&p(A,L)?A:(C=k,P=L)}var S=!1,C,P,O=f===void 0?null:f;return[function(){return w(d())},O===null?void 0:function(){return w(O())}]},[d,f,g,p]);var x=i(c,v[0],v[1]);return s(function(){y.hasValue=!0,y.value=x},[x]),l(x),x},nm}process.env.NODE_ENV==="production"?Jg.exports=H3():Jg.exports=V3();var W3=Jg.exports;const q3=Pc(W3);var lw={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:U3}=m,{useSyncExternalStoreWithSelector:G3}=q3;let cw=!1;function Y3(e,t=e.getState,n){(lw?"production":void 0)!=="production"&&n&&!cw&&(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"),cw=!0);const r=G3(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return U3(r),r}const uw=e=>{(lw?"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"?j3(e):e,n=(r,i)=>Y3(t,r,i);return Object.assign(n,t),n},dw=e=>e?uw(e):uw;var fw=Symbol.for("immer-nothing"),hw=Symbol.for("immer-draftable"),wr=Symbol.for("immer-state"),K3=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=K3[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 nl=Object.getPrototypeOf;function rl(e){return!!e&&!!e[wr]}function Ns(e){var t;return e?pw(e)||Array.isArray(e)||!!e[hw]||!!((t=e.constructor)!=null&&t[hw])||Qd(e)||Jd(e):!1}var X3=Object.prototype.constructor.toString();function pw(e){if(!e||typeof e!="object")return!1;const t=nl(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)===X3}function Ac(e,t){Xd(e)===0?Object.entries(e).forEach(([n,r])=>{t(n,r,e)}):e.forEach((n,r)=>t(r,n,e))}function Xd(e){const t=e[wr];return t?t.type_:Array.isArray(e)?1:Qd(e)?2:Jd(e)?3:0}function rm(e,t){return Xd(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function gw(e,t,n){const r=Xd(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function Q3(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Qd(e){return e instanceof Map}function Jd(e){return e instanceof Set}function Rs(e){return e.copy_||e.base_}function im(e,t){if(Qd(e))return new Map(e);if(Jd(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&pw(e))return nl(e)?{...e}:Object.assign(Object.create(null),e);const n=Object.getOwnPropertyDescriptors(e);delete n[wr];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(nl(e),n)}function om(e,t=!1){return Zd(e)||rl(e)||!Ns(e)||(Xd(e)>1&&(e.set=e.add=e.clear=e.delete=J3),Object.freeze(e),t&&Ac(e,(n,r)=>om(r,!0))),e}function J3(){ir(2)}function Zd(e){return Object.isFrozen(e)}var Z3={};function Ls(e){const t=Z3[e];return t||ir(0,e),t}var Ic;function mw(){return Ic}function eN(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function vw(e,t){t&&(Ls("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function sm(e){am(e),e.drafts_.forEach(tN),e.drafts_=null}function am(e){e===Ic&&(Ic=e.parent_)}function bw(e){return Ic=eN(Ic,e)}function tN(e){const t=e[wr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function yw(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[wr].modified_&&(sm(t),ir(4)),Ns(e)&&(e=ef(t,e),t.parent_||tf(t,e)),t.patches_&&Ls("Patches").generateReplacementPatches_(n[wr].base_,e,t.patches_,t.inversePatches_)):e=ef(t,n,[]),sm(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==fw?e:void 0}function ef(e,t,n){if(Zd(t))return t;const r=t[wr];if(!r)return Ac(t,(i,o)=>xw(e,r,t,i,o,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return tf(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),Ac(o,(a,l)=>xw(e,r,i,a,l,n,s)),tf(e,i,!1),n&&e.patches_&&Ls("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function xw(e,t,n,r,i,o,s){if(process.env.NODE_ENV!=="production"&&i===n&&ir(5),rl(i)){const a=o&&t&&t.type_!==3&&!rm(t.assigned_,r)?o.concat(r):void 0,l=ef(e,i,a);if(gw(n,r,l),rl(l))e.canAutoFreeze_=!1;else return}else s&&n.add(i);if(Ns(i)&&!Zd(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;ef(e,i),(!t||!t.scope_.parent_)&&tf(e,i)}}function tf(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&om(t,n)}function nN(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:mw(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,o=lm;n&&(i=[r],o=Nc);const{revoke:s,proxy:a}=Proxy.revocable(i,o);return r.draft_=a,r.revoke_=s,a}var lm={get(e,t){if(t===wr)return e;const n=Rs(e);if(!rm(n,t))return rN(e,n,t);const r=n[t];return e.finalized_||!Ns(r)?r:r===cm(e.base_,t)?(dm(e),e.copy_[t]=fm(r,e)):r},has(e,t){return t in Rs(e)},ownKeys(e){return Reflect.ownKeys(Rs(e))},set(e,t,n){const r=ww(Rs(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=cm(Rs(e),t),o=i==null?void 0:i[wr];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(Q3(n,i)&&(n!==void 0||rm(e.base_,t)))return!0;dm(e),um(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 cm(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,dm(e),um(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Rs(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 nl(e.base_)},setPrototypeOf(){ir(12)}},Nc={};Ac(lm,(e,t)=>{Nc[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Nc.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&ir(13),Nc.set.call(this,e,t,void 0)},Nc.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&ir(14),lm.set.call(this,e[0],t,n,e[0])};function cm(e,t){const n=e[wr];return(n?Rs(n):e)[t]}function rN(e,t,n){var i;const r=ww(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function ww(e,t){if(!(t in e))return;let n=nl(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=nl(n)}}function um(e){e.modified_||(e.modified_=!0,e.parent_&&um(e.parent_))}function dm(e){e.copy_||(e.copy_=im(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var iN=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,d=>n.call(this,d,...c))}}typeof n!="function"&&ir(6),r!==void 0&&typeof r!="function"&&ir(7);let i;if(Ns(t)){const o=bw(this),s=fm(t,void 0);let a=!0;try{i=n(s),a=!1}finally{a?sm(o):am(o)}return vw(o,r),yw(i,o)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===fw&&(i=void 0),this.autoFreeze_&&om(i,!0),r){const o=[],s=[];Ls("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){Ns(e)||ir(8),rl(e)&&(e=oN(e));const t=bw(this),n=fm(e,void 0);return n[wr].isManual_=!0,am(t),n}finishDraft(e,t){const n=e&&e[wr];(!n||!n.isManual_)&&ir(9);const{scope_:r}=n;return vw(r,t),yw(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=Ls("Patches").applyPatches_;return rl(e)?r(e,t):this.produce(e,i=>r(i,t))}};function fm(e,t){const n=Qd(e)?Ls("MapSet").proxyMap_(e,t):Jd(e)?Ls("MapSet").proxySet_(e,t):nN(e,t);return(t?t.scope_:mw()).drafts_.push(n),n}function oN(e){return rl(e)||ir(10,e),_w(e)}function _w(e){if(!Ns(e)||Zd(e))return e;const t=e[wr];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=im(e,t.scope_.immer_.useStrictShallowCopy_)}else n=im(e,!0);return Ac(n,(r,i)=>{gw(n,r,_w(i))}),t&&(t.finalized_=!1),n}var _r=new iN,sN=_r.produce;_r.produceWithPatches.bind(_r),_r.setAutoFreeze.bind(_r),_r.setUseStrictShallowCopy.bind(_r),_r.applyPatches.bind(_r),_r.createDraft.bind(_r),_r.finishDraft.bind(_r);const Sw=e=>(t,n,r)=>(r.setState=(i,o,...s)=>{const a=typeof i=="function"?sN(i):i;return t(a,o,...s)},e(r.setState,n,r));var nf,rf=kt;if(process.env.NODE_ENV==="production")nf=rf.createRoot,rf.hydrateRoot;else{var Cw=rf.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;nf=function(e,t){Cw.usingClientEntryPoint=!0;try{return rf.createRoot(e,t)}finally{Cw.usingClientEntryPoint=!1}}}function Ew(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=nf(n),s=a=>{a&&(o.render(m.createElement(i,Object.assign({},a))),r.count+=1)};s(t.getState()),t.subscribe(s)}var Ow={},Pw={},hm={exports:{}},Gt=String,kw=function(){return{isColorSupported:!1,reset:Gt,bold:Gt,dim:Gt,italic:Gt,underline:Gt,inverse:Gt,hidden:Gt,strikethrough:Gt,black:Gt,red:Gt,green:Gt,yellow:Gt,blue:Gt,magenta:Gt,cyan:Gt,white:Gt,gray:Gt,bgBlack:Gt,bgRed:Gt,bgGreen:Gt,bgYellow:Gt,bgBlue:Gt,bgMagenta:Gt,bgCyan:Gt,bgWhite:Gt}};hm.exports=kw(),hm.exports.createColors=kw;var aN=hm.exports;(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,c){for(var d in c)Object.defineProperty(l,d,{enumerable:!0,get:c[d]})}t(e,{dim:function(){return s},default:function(){return a}});const n=r(aN);function r(l){return l&&l.__esModule?l:{default:l}}let i=new Set;function o(l,c,d){typeof process<"u"&&process.env.JEST_WORKER_ID||d&&i.has(d)||(d&&i.add(d),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])}}})(Pw),function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return i}});const t=n(Pw);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}}}(Ow);let pm=Ow;var lN=(pm.__esModule?pm:{default:pm}).default;const un=Pc(lN),gm={default:{dashboardPanel:"",dashboardTabsContainer:"",gridLayout:{className:""},chart:{font:{family:"Open Sans, sans-serif"},dataset:{backgroundColor:["#8a8ed1",un.red[400],un.amber[400],un.orange[400],un.rose[400]],borderColor:[un.indigo[400],un.red[400],un.amber[400],un.orange[400],un.rose[400]]},options:{plugins:{datalabels:{display:!1,color:cN},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:[un.teal[100],un.purple[100],un.amber[100],un.orange[100],un.rose[100]],borderColor:[un.teal[400],un.purple[400],un.amber[400],un.orange[300],un.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:un.slate[800]}},y:{grid:{display:!0,color:un.slate[800]}}}}}}};function cN(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=Mw()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=Mw()),uN(n)}function Mw(){return ge.getState().theme==="dark"?"#000000":"#FFFFFF"}function uN(e){let t=0,n=0,r=0,i=0;const o=d=>{const f=d.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(d=>{o(d)}):o(e);const s=t/i,a=n/i,l=r/i;return(s*299+a*587+l*114)/1e3>=180?"black":"white"}const ge=dw()(Sw((e,t)=>({dashboard:{id:"",style:gm},selectedSheetId:null,selectedCardId:null,selectedCard:null,showFilters:!1,isDashboardEditing:!1,isVisualEditing:!1,showDashboardJSON:!1,isEditorSaveEvent:!1,actions:{setAuthToken:n=>{e(()=>({authToken:n}))},setThemeStyle:n=>{e(()=>({themeStyle:n}))},setIsEditorSaveEvent:n=>{e(()=>({isEditorSaveEvent:n}))},setDashboard:n=>e({dashboard:n}),setBookmarkKey:n=>{e(()=>({bookmarkKey:n}))},setDashboardTheme:n=>{e(r=>{r.theme=n})},setDashboardTitle:n=>{e(r=>{r.dashboard&&(r.dashboard.title=n)})},setDashboardDescription:n=>{e(r=>{r.dashboard&&(r.dashboard.description=n)})},setSheets:n=>{e(r=>{r.dashboard&&(r.dashboard.sheets=n)})},setSheetTitle:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);o&&(o.title=r)})},setSheetDescription:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);o&&(o.description=r)})},setCards:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);o&&(o.cards=r)})},setCardTitle:(n,r,i)=>{e(o=>{var a,l,c,d;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){const f=(c=s.cards)==null?void 0:c.find(g=>g.id===r);f&&(f.title=i,(d=o.onUpdateCard)==null||d.call(o,f,n))}})},setCardSql:(n,r,i)=>{e(o=>{var a,l,c,d;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){const f=(c=s.cards)==null?void 0:c.find(g=>g.id===r);f&&(f.sql=i,(d=o.onUpdateCard)==null||d.call(o,f,n))}})},setCardData:(n,r,i)=>{e(o=>{var a,l,c;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(d=>d.id===n);if(s){const d=(c=s.cards)==null?void 0:c.find(f=>f.id===r);d&&(d.data=i)}})},setCardDescription:(n,r,i)=>{e(o=>{var a,l,c,d;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){const f=(c=s.cards)==null?void 0:c.find(g=>g.id===r);f&&(f.description=i,(d=o.onUpdateCard)==null||d.call(o,f,n))}})},setSheetLayout:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);o&&(o.layout=r)})},setShowFilters:n=>{e(()=>({showFilters:n}))},setFilterValues:n=>{e(()=>({filterValues:n}))},addOrUpdateFilterValue:n=>{e(r=>{if(r.filterValues){const i=r.filterValues.findIndex(o=>o.filterId===n.filterId);i>-1?r.filterValues.splice(i,1,n):r.filterValues.push(n)}else r.filterValues=[n]})},removeFilterValue:n=>{e(r=>{if(r.filterValues){const i=r.filterValues.findIndex(o=>o.filterId===n);i>-1&&r.filterValues.splice(i,1)}})},addFilter:n=>{e(r=>{var i;r.dashboard.filters?(i=r.dashboard.filters)==null||i.push(n):r.dashboard.filters=[n]})},removeFilter:n=>{e(r=>{var i,o;if(r.dashboard.filters){const s=(i=r.dashboard.filters)==null?void 0:i.findIndex(a=>a.id===n);console.log("index",s),s>-1&&((o=r.dashboard.filters)==null||o.splice(s,1))}})},updateFilter:n=>{e(r=>{var i,o;if(r.dashboard.filters){const s=(i=r.dashboard.filters)==null?void 0:i.findIndex(a=>a.id===n.id);s>-1&&((o=r.dashboard.filters)==null||o.splice(s,1,n))}})},setIsDashboardEditing:n=>{e(()=>({isDashboardEditing:n}))},setShowDashboardJSON:n=>{e(()=>({showDashboardJSON:n}))},setIsVisualEditing:n=>{e(()=>({isVisualEditing:n}))},addCard:(n,r)=>{e(i=>{var s,a,l,c,d;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(f=>f.id===n);if(o){(l=o.cards)==null||l.push(r);const f={i:r.id,x:0,y:1/0,w:20,h:7,minW:10};(c=o.layout)==null||c.push(f),(d=i.onAddCard)==null||d.call(i,r,n)}})},updateCard:(n,r)=>{e(i=>{var a,l,c,d,f;const o=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(g=>g.id===n),s=(c=o==null?void 0:o.cards)==null?void 0:c.findIndex(g=>g.id===r.id);o&&((d=o.cards)==null||d.splice(s,1,r),(f=i.onUpdateCard)==null||f.call(i,r,n))})},removeCard:(n,r)=>{e(i=>{var a,l,c,d,f,g;const o=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(p=>p.id===n),s=(c=o==null?void 0:o.cards)==null?void 0:c.findIndex(p=>p.id===r.id);o&&((d=o.cards)==null||d.splice(s,1),(f=o.layout)==null||f.splice(s,1),(g=i.onRemoveCard)==null||g.call(i,r,n))})},setStyle:n=>{e(r=>{r.dashboard&&(r.dashboard.style=n)})},setSelectedCardId:(n,r)=>{e(i=>{var s,a,l;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===n);o&&(((l=o.cards)==null?void 0:l.find(d=>d.id===r))?i.selectedCardId=r:i.selectedCardId=null)})},setSelectedCard:n=>{e(r=>{r.selectedCard=n})},setSelectedSheetId:n=>{e(r=>{var o,s;((s=(o=r.dashboard)==null?void 0:o.sheets)==null?void 0:s.find(a=>a.id===n))&&(r.selectedSheetId=n)})},setOnSaveFunction:n=>{e(()=>({onSaveFunction:n}))},setOnAddCard:n=>{e(()=>({onAddCard:n}))},setOnUpdateCard:n=>{e(()=>({onUpdateCard:n}))},setOnRemoveCard:n=>{e(()=>({onRemoveCard:n}))},setOnEvent:n=>{e(()=>({onEvent:n}))},getDashboard:()=>t().dashboard,getSelectedSheet:()=>{var n,r;return(r=(n=t().dashboard)==null?void 0:n.sheets)==null?void 0:r.find(i=>i.id===t().selectedSheetId)},getSelectedCard:()=>{var r,i,o;const n=(i=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:i.find(s=>s.id===t().selectedSheetId);return(o=n==null?void 0:n.cards)==null?void 0:o.find(s=>s.id===t().selectedCardId)},getSelectedSheetCards:()=>{var r,i;const n=(i=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:i.find(o=>o.id===t().selectedSheetId);return n==null?void 0:n.cards},getSelectedSheetLayout:()=>{var r,i;const n=(i=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:i.find(o=>o.id===t().selectedSheetId);return n==null?void 0:n.layout},getStyle:()=>{var n;return(n=t().dashboard)==null?void 0:n.style}}})));process.env.NODE_ENV==="development"&&Ew("DashboardStore",ge);var Rc=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(){}},il=typeof window>"u"||"Deno"in window;function Kr(){}function dN(e,t){return typeof e=="function"?e(t):e}function mm(e){return typeof e=="number"&&e>=0&&e!==1/0}function Dw(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Tw(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==vm(s,t.options))return!1}else if(!$c(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 Aw(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Lc(t.options.mutationKey)!==Lc(o))return!1}else if(!$c(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function vm(e,t){return((t==null?void 0:t.queryKeyHashFn)||Lc)(e)}function Lc(e){return JSON.stringify(e,(t,n)=>ym(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function $c(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!$c(e[n],t[n])):!1}function Iw(e,t){if(e===t)return e;const n=Nw(e)&&Nw(t);if(n||ym(e)&&ym(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 d=n?c:o[c];!n&&e[d]===void 0&&t[d]===void 0&&r.includes(d)?(a[d]=void 0,l++):(a[d]=Iw(e[d],t[d]),a[d]===e[d]&&e[d]!==void 0&&l++)}return i===s&&l===i?e:a}return t}function bm(e,t){if(e&&!t||t&&!e)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Nw(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ym(e){if(!Rw(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!Rw(n)||!n.hasOwnProperty("isPrototypeOf"))}function Rw(e){return Object.prototype.toString.call(e)==="[object Object]"}function fN(e){return new Promise(t=>{setTimeout(t,e)})}function xm(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Iw(e,t):t}function hN(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function pN(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var gN=(xA=class extends Rc{constructor(){super();ze(this,Pa,void 0);ze(this,ps,void 0);ze(this,Ql,void 0);Ie(this,Ql,t=>{if(!il&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){J(this,ps)||this.setEventListener(J(this,Ql))}onUnsubscribe(){var t;this.hasListeners()||((t=J(this,ps))==null||t.call(this),Ie(this,ps,void 0))}setEventListener(t){var n;Ie(this,Ql,t),(n=J(this,ps))==null||n.call(this),Ie(this,ps,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){J(this,Pa)!==t&&(Ie(this,Pa,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof J(this,Pa)=="boolean"?J(this,Pa):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Pa=new WeakMap,ps=new WeakMap,Ql=new WeakMap,xA),of=new gN,mN=(wA=class extends Rc{constructor(){super();ze(this,Jl,!0);ze(this,gs,void 0);ze(this,Zl,void 0);Ie(this,Zl,t=>{if(!il&&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(){J(this,gs)||this.setEventListener(J(this,Zl))}onUnsubscribe(){var t;this.hasListeners()||((t=J(this,gs))==null||t.call(this),Ie(this,gs,void 0))}setEventListener(t){var n;Ie(this,Zl,t),(n=J(this,gs))==null||n.call(this),Ie(this,gs,t(this.setOnline.bind(this)))}setOnline(t){J(this,Jl)!==t&&(Ie(this,Jl,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return J(this,Jl)}},Jl=new WeakMap,gs=new WeakMap,Zl=new WeakMap,wA),sf=new mN;function vN(e){return Math.min(1e3*2**e,3e4)}function af(e){return(e??"online")==="online"?sf.isOnline():!0}var Lw=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function wm(e){return e instanceof Lw}function $w(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 Lw(x)),(w=e.abort)==null||w.call(e))},c=()=>{t=!0},d=()=>{t=!1},f=()=>!of.isFocused()||e.networkMode!=="always"&&!sf.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)}),y=()=>{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??(il?0:3),C=e.retryDelay??vN,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),fN(P).then(()=>{if(f())return v()}).then(()=>{t?p(w):y()})})};return af(e.networkMode)?y():v().then(y),{promise:a,cancel:l,continue:()=>(i==null?void 0:i())?a:Promise.resolve(),cancelRetry:c,continueRetry:d}}function bN(){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=bN(),Fw=(_A=class{constructor(){ze(this,ka,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),mm(this.gcTime)&&Ie(this,ka,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(il?1/0:5*60*1e3))}clearGcTimeout(){J(this,ka)&&(clearTimeout(J(this,ka)),Ie(this,ka,void 0))}},ka=new WeakMap,_A),yN=(SA=class extends Fw{constructor(t){super();ze(this,nc);ze(this,Si);ze(this,ec,void 0);ze(this,tc,void 0);ze(this,ri,void 0);ze(this,ms,void 0);ze(this,ii,void 0);ze(this,Mn,void 0);ze(this,hd,void 0);ze(this,Ma,void 0);Ie(this,Ma,!1),Ie(this,hd,t.defaultOptions),xt(this,nc,Gg).call(this,t.options),Ie(this,Mn,[]),Ie(this,ri,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ie(this,ec,t.state||xN(this.options)),this.state=J(this,ec),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!J(this,Mn).length&&this.state.fetchStatus==="idle"&&J(this,ri).remove(this)}setData(t,n){const r=xm(this.state.data,t,this.options);return xt(this,Si,No).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){xt(this,Si,No).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=J(this,ms);return(r=J(this,ii))==null||r.cancel(t),n?n.then(Kr).catch(Kr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(J(this,ec))}isActive(){return J(this,Mn).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||J(this,Mn).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!Dw(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=J(this,Mn).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=J(this,ii))==null||n.continue()}onOnline(){var n;const t=J(this,Mn).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=J(this,ii))==null||n.continue()}addObserver(t){J(this,Mn).includes(t)||(J(this,Mn).push(t),this.clearGcTimeout(),J(this,ri).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){J(this,Mn).includes(t)&&(Ie(this,Mn,J(this,Mn).filter(n=>n!==t)),J(this,Mn).length||(J(this,ii)&&(J(this,Ma)?J(this,ii).cancel({revert:!0}):J(this,ii).cancelRetry()),this.scheduleGc()),J(this,ri).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return J(this,Mn).length}invalidate(){this.state.isInvalidated||xt(this,Si,No).call(this,{type:"invalidate"})}fetch(t,n){var c,d,f,g;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(J(this,ms))return(c=J(this,ii))==null||c.continueRetry(),J(this,ms)}if(t&&xt(this,nc,Gg).call(this,t),!this.options.queryFn){const p=J(this,Mn).find(v=>v.options.queryFn);p&&xt(this,nc,Gg).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:()=>(Ie(this,Ma,!0),r.signal)})};o(i);const s=()=>this.options.queryFn?(Ie(this,Ma,!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),(d=this.options.behavior)==null||d.onFetch(a,this),Ie(this,tc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=a.fetchOptions)==null?void 0:f.meta))&&xt(this,Si,No).call(this,{type:"fetch",meta:(g=a.fetchOptions)==null?void 0:g.meta});const l=p=>{var v,y,x,w;wm(p)&&p.silent||xt(this,Si,No).call(this,{type:"error",error:p}),wm(p)||((y=(v=J(this,ri).config).onError)==null||y.call(v,p,this),(w=(x=J(this,ri).config).onSettled)==null||w.call(x,this.state.data,p,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return Ie(this,ii,$w({fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:p=>{var v,y,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),(y=(v=J(this,ri).config).onSuccess)==null||y.call(v,p,this),(w=(x=J(this,ri).config).onSettled)==null||w.call(x,p,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(p,v)=>{xt(this,Si,No).call(this,{type:"failed",failureCount:p,error:v})},onPause:()=>{xt(this,Si,No).call(this,{type:"pause"})},onContinue:()=>{xt(this,Si,No).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),Ie(this,ms,J(this,ii).promise),J(this,ms)}},ec=new WeakMap,tc=new WeakMap,ri=new WeakMap,ms=new WeakMap,ii=new WeakMap,Mn=new WeakMap,hd=new WeakMap,Ma=new WeakMap,nc=new WeakSet,Gg=function(t){this.options={...J(this,hd),...t},this.updateGcTime(this.options.gcTime)},Si=new WeakSet,No=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:af(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 wm(i)&&i.revert&&J(this,tc)?{...J(this,tc),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(()=>{J(this,Mn).forEach(r=>{r.onQueryUpdate()}),J(this,ri).notify({query:this,type:"updated",action:t})})},SA);function xN(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 wN=(CA=class extends Rc{constructor(t={}){super();ze(this,Yi,void 0);this.config=t,Ie(this,Yi,new Map)}build(t,n,r){const i=n.queryKey,o=n.queryHash??vm(i,n);let s=this.get(o);return s||(s=new yN({cache:this,queryKey:i,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(s)),s}add(t){J(this,Yi).has(t.queryHash)||(J(this,Yi).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=J(this,Yi).get(t.queryHash);n&&(t.destroy(),n===t&&J(this,Yi).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){In.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return J(this,Yi).get(t)}getAll(){return[...J(this,Yi).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Tw(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Tw(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()})})}},Yi=new WeakMap,CA),_N=(EA=class extends Fw{constructor(t){super();ze(this,Xi);ze(this,Ki,void 0);ze(this,pd,void 0);ze(this,zr,void 0);ze(this,rc,void 0);this.mutationId=t.mutationId,Ie(this,pd,t.defaultOptions),Ie(this,zr,t.mutationCache),Ie(this,Ki,[]),this.state=t.state||SN(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...J(this,pd),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){J(this,Ki).includes(t)||(J(this,Ki).push(t),this.clearGcTimeout(),J(this,zr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ie(this,Ki,J(this,Ki).filter(n=>n!==t)),this.scheduleGc(),J(this,zr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){J(this,Ki).length||(this.state.status==="pending"?this.scheduleGc():J(this,zr).remove(this))}continue(){var t;return((t=J(this,rc))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,s,a,l,c,d,f,g,p,v,y,x,w,S,C,P,O,k,A;const n=()=>(Ie(this,rc,$w({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(L,F)=>{xt(this,Xi,Ds).call(this,{type:"failed",failureCount:L,error:F})},onPause:()=>{xt(this,Xi,Ds).call(this,{type:"pause"})},onContinue:()=>{xt(this,Xi,Ds).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),J(this,rc).promise),r=this.state.status==="pending";try{if(!r){xt(this,Xi,Ds).call(this,{type:"pending",variables:t}),await((o=(i=J(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&&xt(this,Xi,Ds).call(this,{type:"pending",context:F,variables:t})}const L=await n();return await((c=(l=J(this,zr).config).onSuccess)==null?void 0:c.call(l,L,t,this.state.context,this)),await((f=(d=this.options).onSuccess)==null?void 0:f.call(d,L,t,this.state.context)),await((p=(g=J(this,zr).config).onSettled)==null?void 0:p.call(g,L,null,this.state.variables,this.state.context,this)),await((y=(v=this.options).onSettled)==null?void 0:y.call(v,L,null,t,this.state.context)),xt(this,Xi,Ds).call(this,{type:"success",data:L}),L}catch(L){try{throw await((w=(x=J(this,zr).config).onError)==null?void 0:w.call(x,L,t,this.state.context,this)),await((C=(S=this.options).onError)==null?void 0:C.call(S,L,t,this.state.context)),await((O=(P=J(this,zr).config).onSettled)==null?void 0:O.call(P,void 0,L,this.state.variables,this.state.context,this)),await((A=(k=this.options).onSettled)==null?void 0:A.call(k,void 0,L,t,this.state.context)),L}finally{xt(this,Xi,Ds).call(this,{type:"error",error:L})}}}},Ki=new WeakMap,pd=new WeakMap,zr=new WeakMap,rc=new WeakMap,Xi=new WeakSet,Ds=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:!af(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(()=>{J(this,Ki).forEach(r=>{r.onMutationUpdate(t)}),J(this,zr).notify({mutation:this,type:"updated",action:t})})},EA);function SN(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var CN=(OA=class extends Rc{constructor(t={}){super();ze(this,oi,void 0);ze(this,gd,void 0);ze(this,Da,void 0);this.config=t,Ie(this,oi,[]),Ie(this,gd,0)}build(t,n,r){const i=new _N({mutationCache:this,mutationId:++Ug(this,gd)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){J(this,oi).push(t),this.notify({type:"added",mutation:t})}remove(t){Ie(this,oi,J(this,oi).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){In.batch(()=>{J(this,oi).forEach(t=>{this.remove(t)})})}getAll(){return J(this,oi)}find(t){const n={exact:!0,...t};return J(this,oi).find(r=>Aw(n,r))}findAll(t={}){return J(this,oi).filter(n=>Aw(t,n))}notify(t){In.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return Ie(this,Da,(J(this,Da)??Promise.resolve()).then(()=>{const t=J(this,oi).filter(n=>n.state.isPaused);return In.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(Kr)),Promise.resolve()))}).then(()=>{Ie(this,Da,void 0)})),J(this,Da)}},oi=new WeakMap,gd=new WeakMap,Da=new WeakMap,OA);function EN(e){return{onFetch:(t,n)=>{const r=async()=>{var v,y,x,w,S;const i=t.options,o=(x=(y=(v=t.fetchOptions)==null?void 0:v.meta)==null?void 0:y.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 d=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};d(k);const A=await f(k),{maxPages:L}=t.options,F=O?pN:hN;return{pages:F(C.pages,A,L),pageParams:F(C.pageParams,P,L)}};let p;if(o&&s.length){const C=o==="backward",P=C?ON:jw,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=jw(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 jw(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function ON(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var PN=(PA=class{constructor(e={}){ze(this,Sn,void 0);ze(this,vs,void 0);ze(this,bs,void 0);ze(this,ic,void 0);ze(this,oc,void 0);ze(this,ys,void 0);ze(this,sc,void 0);ze(this,ac,void 0);Ie(this,Sn,e.queryCache||new wN),Ie(this,vs,e.mutationCache||new CN),Ie(this,bs,e.defaultOptions||{}),Ie(this,ic,new Map),Ie(this,oc,new Map),Ie(this,ys,0)}mount(){Ug(this,ys)._++,J(this,ys)===1&&(Ie(this,sc,of.subscribe(()=>{of.isFocused()&&(this.resumePausedMutations(),J(this,Sn).onFocus())})),Ie(this,ac,sf.subscribe(()=>{sf.isOnline()&&(this.resumePausedMutations(),J(this,Sn).onOnline())})))}unmount(){var e,t;Ug(this,ys)._--,J(this,ys)===0&&((e=J(this,sc))==null||e.call(this),Ie(this,sc,void 0),(t=J(this,ac))==null||t.call(this),Ie(this,ac,void 0))}isFetching(e){return J(this,Sn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return J(this,vs).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=J(this,Sn).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=J(this,Sn).find({queryKey:e}),i=r==null?void 0:r.state.data,o=dN(t,i);if(typeof o>"u")return;const s=this.defaultQueryOptions({queryKey:e});return J(this,Sn).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=J(this,Sn).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=J(this,Sn);In.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=J(this,Sn),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(()=>J(this,Sn).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Kr).catch(Kr)}invalidateQueries(e={},t={}){return In.batch(()=>{if(J(this,Sn).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(()=>J(this,Sn).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=J(this,Sn).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=EN(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Kr).catch(Kr)}resumePausedMutations(){return J(this,vs).resumePausedMutations()}getQueryCache(){return J(this,Sn)}getMutationCache(){return J(this,vs)}getDefaultOptions(){return J(this,bs)}setDefaultOptions(e){Ie(this,bs,e)}setQueryDefaults(e,t){J(this,ic).set(Lc(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...J(this,ic).values()];let n={};return t.forEach(r=>{$c(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){J(this,oc).set(Lc(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...J(this,oc).values()];let n={};return t.forEach(r=>{$c(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...J(this,bs).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=vm(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:{...J(this,bs).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){J(this,Sn).clear(),J(this,vs).clear()}},Sn=new WeakMap,vs=new WeakMap,bs=new WeakMap,ic=new WeakMap,oc=new WeakMap,ys=new WeakMap,sc=new WeakMap,ac=new WeakMap,PA),kN=(kA=class extends Rc{constructor(t,n){super();ze(this,Na);ze(this,bd);ze(this,yd);ze(this,xd);ze(this,wd);ze(this,_d);ze(this,Sd);ze(this,Cd);ze(this,ig);ze(this,gr,void 0);ze(this,Jt,void 0);ze(this,md,void 0);ze(this,er,void 0);ze(this,Ta,void 0);ze(this,lc,void 0);ze(this,Qi,void 0);ze(this,vd,void 0);ze(this,cc,void 0);ze(this,uc,void 0);ze(this,Aa,void 0);ze(this,Ia,void 0);ze(this,xs,void 0);ze(this,dc,new Set);this.options=n,Ie(this,gr,t),Ie(this,Qi,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(J(this,Jt).addObserver(this),zw(J(this,Jt),this.options)?xt(this,Na,Ud).call(this):this.updateResult(),xt(this,wd,B1).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return _m(J(this,Jt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return _m(J(this,Jt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,xt(this,_d,V1).call(this),xt(this,Sd,H1).call(this),J(this,Jt).removeObserver(this)}setOptions(t,n){const r=this.options,i=J(this,Jt);if(this.options=J(this,gr).defaultQueryOptions(t),bm(r,this.options)||J(this,gr).getQueryCache().notify({type:"observerOptionsUpdated",query:J(this,Jt),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),xt(this,Cd,W1).call(this);const o=this.hasListeners();o&&Bw(J(this,Jt),i,this.options,r)&&xt(this,Na,Ud).call(this),this.updateResult(n),o&&(J(this,Jt)!==i||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&xt(this,bd,F1).call(this);const s=xt(this,yd,j1).call(this);o&&(J(this,Jt)!==i||this.options.enabled!==r.enabled||s!==J(this,xs))&&xt(this,xd,z1).call(this,s)}getOptimisticResult(t){const n=J(this,gr).getQueryCache().build(J(this,gr),t),r=this.createResult(n,t);return DN(this,r)&&(Ie(this,er,r),Ie(this,lc,this.options),Ie(this,Ta,J(this,Jt).state)),r}getCurrentResult(){return J(this,er)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(J(this,dc).add(r),t[r])})}),n}getCurrentQuery(){return J(this,Jt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=J(this,gr).defaultQueryOptions(t),r=J(this,gr).getQueryCache().build(J(this,gr),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return xt(this,Na,Ud).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),J(this,er)))}createResult(t,n){var k;const r=J(this,Jt),i=this.options,o=J(this,er),s=J(this,Ta),a=J(this,lc),c=t!==r?t.state:J(this,md),{state:d}=t;let{error:f,errorUpdatedAt:g,fetchStatus:p,status:v}=d,y=!1,x;if(n._optimisticResults){const A=this.hasListeners(),L=!A&&zw(t,n),F=A&&Bw(t,r,n,i);(L||F)&&(p=af(t.options.networkMode)?"fetching":"paused",d.dataUpdatedAt||(v="pending")),n._optimisticResults==="isRestoring"&&(p="idle")}if(n.select&&typeof d.data<"u")if(o&&d.data===(s==null?void 0:s.data)&&n.select===J(this,vd))x=J(this,cc);else try{Ie(this,vd,n.select),x=n.select(d.data),x=xm(o==null?void 0:o.data,x,n),Ie(this,cc,x),Ie(this,Qi,null)}catch(A){Ie(this,Qi,A)}else x=d.data;if(typeof n.placeholderData<"u"&&typeof x>"u"&&v==="pending"){let A;if(o!=null&&o.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))A=o.data;else if(A=typeof n.placeholderData=="function"?n.placeholderData((k=J(this,uc))==null?void 0:k.state.data,J(this,uc)):n.placeholderData,n.select&&typeof A<"u")try{A=n.select(A),Ie(this,Qi,null)}catch(L){Ie(this,Qi,L)}typeof A<"u"&&(v="success",x=xm(o==null?void 0:o.data,A,n),y=!0)}J(this,Qi)&&(f=J(this,Qi),x=J(this,cc),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:d.dataUpdatedAt,error:f,errorUpdatedAt:g,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:w,isRefetching:w&&!S,isLoadingError:C&&d.dataUpdatedAt===0,isPaused:p==="paused",isPlaceholderData:y,isRefetchError:C&&d.dataUpdatedAt!==0,isStale:Sm(t,n),refetch:this.refetch}}updateResult(t){const n=J(this,er),r=this.createResult(J(this,Jt),this.options);if(Ie(this,Ta,J(this,Jt).state),Ie(this,lc,this.options),J(this,Ta).data!==void 0&&Ie(this,uc,J(this,Jt)),bm(r,n))return;Ie(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&&!J(this,dc).size)return!0;const l=new Set(a??J(this,dc));return this.options.throwOnError&&l.add("error"),Object.keys(J(this,er)).some(c=>{const d=c;return J(this,er)[d]!==n[d]&&l.has(d)})};(t==null?void 0:t.listeners)!==!1&&o()&&(i.listeners=!0),xt(this,ig,e3).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&xt(this,wd,B1).call(this)}},gr=new WeakMap,Jt=new WeakMap,md=new WeakMap,er=new WeakMap,Ta=new WeakMap,lc=new WeakMap,Qi=new WeakMap,vd=new WeakMap,cc=new WeakMap,uc=new WeakMap,Aa=new WeakMap,Ia=new WeakMap,xs=new WeakMap,dc=new WeakMap,Na=new WeakSet,Ud=function(t){xt(this,Cd,W1).call(this);let n=J(this,Jt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Kr)),n},bd=new WeakSet,F1=function(){if(xt(this,_d,V1).call(this),il||J(this,er).isStale||!mm(this.options.staleTime))return;const n=Dw(J(this,er).dataUpdatedAt,this.options.staleTime)+1;Ie(this,Aa,setTimeout(()=>{J(this,er).isStale||this.updateResult()},n))},yd=new WeakSet,j1=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(J(this,Jt)):this.options.refetchInterval)??!1},xd=new WeakSet,z1=function(t){xt(this,Sd,H1).call(this),Ie(this,xs,t),!(il||this.options.enabled===!1||!mm(J(this,xs))||J(this,xs)===0)&&Ie(this,Ia,setInterval(()=>{(this.options.refetchIntervalInBackground||of.isFocused())&&xt(this,Na,Ud).call(this)},J(this,xs)))},wd=new WeakSet,B1=function(){xt(this,bd,F1).call(this),xt(this,xd,z1).call(this,xt(this,yd,j1).call(this))},_d=new WeakSet,V1=function(){J(this,Aa)&&(clearTimeout(J(this,Aa)),Ie(this,Aa,void 0))},Sd=new WeakSet,H1=function(){J(this,Ia)&&(clearInterval(J(this,Ia)),Ie(this,Ia,void 0))},Cd=new WeakSet,W1=function(){const t=J(this,gr).getQueryCache().build(J(this,gr),this.options);if(t===J(this,Jt))return;const n=J(this,Jt);Ie(this,Jt,t),Ie(this,md,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},ig=new WeakSet,e3=function(t){In.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(J(this,er))}),J(this,gr).getQueryCache().notify({query:J(this,Jt),type:"observerResultsUpdated"})})},kA);function MN(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function zw(e,t){return MN(e,t)||e.state.dataUpdatedAt>0&&_m(e,t,t.refetchOnMount)}function _m(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Sm(e,t)}return!1}function Bw(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&Sm(e,n)}function Sm(e,t){return e.isStaleByTime(t.staleTime)}function DN(e,t){return!bm(e.getCurrentResult(),t)}var Vw=ue.createContext(void 0),TN=e=>{const t=ue.useContext(Vw);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},AN=({client:e,children:t})=>(ue.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),ue.createElement(Vw.Provider,{value:e},t)),Hw=ue.createContext(!1),IN=()=>ue.useContext(Hw);Hw.Provider;function NN(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var RN=ue.createContext(NN()),LN=()=>ue.useContext(RN);function $N(e,t){return typeof e=="function"?e(...t):!!e}var FN=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},jN=e=>{ue.useEffect(()=>{e.clearReset()},[e])},zN=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&$N(n,[e.error,r]),BN=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},VN=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,HN=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function WN(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=TN(n),i=IN(),o=LN(),s=r.defaultQueryOptions(e);s._optimisticResults=i?"isRestoring":"optimistic",BN(s),FN(s,o),jN(o);const[a]=ue.useState(()=>new t(r,s)),l=a.getOptimisticResult(s);if(ue.useSyncExternalStore(ue.useCallback(c=>{const d=i?()=>{}:a.subscribe(In.batchCalls(c));return a.updateResult(),d},[a,i]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),ue.useEffect(()=>{a.setOptions(s,{listeners:!1})},[s,a]),VN(s,l))throw HN(s,a,o);if(zN({result:l,errorResetBoundary:o,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw l.error;return s.notifyOnChangeProps?l:a.trackResult(l)}function Sr(e,t){return WN(e,kN,t)}var lf={exports:{}};/**
|
|
60
60
|
* @license
|
|
61
61
|
* Lodash <https://lodash.com/>
|
|
62
62
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
63
63
|
* Released under MIT license <https://lodash.com/license>
|
|
64
64
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
65
65
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
66
|
-
*/lf.exports,function(e,t){(function(){var n,r="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",a="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",c=500,d="__lodash_placeholder__",f=1,g=2,p=4,v=1,y=2,x=1,w=2,S=4,C=8,P=16,O=32,k=64,A=128,L=256,F=512,j=30,B="...",V=800,K=16,Y=1,$=2,Z=3,U=1/0,ie=9007199254740991,le=17976931348623157e292,M=NaN,H=4294967295,ne=H-1,N=H>>>1,X=[["ary",A],["bind",x],["bindKey",w],["curry",C],["curryRight",P],["flip",F],["partial",O],["partialRight",k],["rearg",L]],me="[object Arguments]",he="[object Array]",de="[object AsyncFunction]",re="[object Boolean]",ee="[object Date]",W="[object DOMException]",ye="[object Error]",oe="[object Function]",Te="[object GeneratorFunction]",Fe="[object Map]",He="[object Number]",Ke="[object Null]",St="[object Object]",vt="[object Promise]",bt="[object Proxy]",tn="[object RegExp]",Zt="[object Set]",Dn="[object String]",fn="[object Symbol]",Ra="[object Undefined]",fe="[object WeakMap]",Oe="[object WeakSet]",Le="[object ArrayBuffer]",Xe="[object DataView]",yt="[object Float32Array]",hn="[object Float64Array]",Cn="[object Int8Array]",Fn="[object Int16Array]",Br="[object Int32Array]",Vr="[object Uint8Array]",pn="[object Uint8ClampedArray]",mr="[object Uint16Array]",jn="[object Uint32Array]",Ed=/\b__p \+= '';/g,So=/\b(__p \+=) '' \+/g,La=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Yn=/&(?:amp|lt|gt|quot|#39);/g,Ji=/[&<>"']/g,Co=RegExp(Yn.source),$a=RegExp(Ji.source),Od=/<%-([\s\S]+?)%>/g,Fa=/<%([\s\S]+?)%>/g,fc=/<%=([\s\S]+?)%>/g,ja=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,za=/^\w*$/,Pd=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ba=/[\\^$.*+?()[\]{}|]/g,Va=RegExp(Ba.source),Ha=/^\s+/,kd=/\s/,Md=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Dd=/\{\n\/\* \[wrapped with (.+)\] \*/,D=/,? & /,G=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,se=/[()=,{}\[\]\/\s]/,Se=/\\(\\)?/g,Re=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,je=/\w*$/,Ae=/^[-+]0x[0-9a-f]+$/i,Me=/^0b[01]+$/i,Pt=/^\[object .+?Constructor\]$/,Je=/^0o[0-7]+$/i,nt=/^(?:0|[1-9]\d*)$/,zt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Tn=/($^)/,Wa=/['\n\r\u2028\u2029\\]/g,nn="\\ud800-\\udfff",hie="\\u0300-\\u036f",pie="\\ufe20-\\ufe2f",gie="\\u20d0-\\u20ff",MA=hie+pie+gie,DA="\\u2700-\\u27bf",TA="a-z\\xdf-\\xf6\\xf8-\\xff",mie="\\xac\\xb1\\xd7\\xf7",vie="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",bie="\\u2000-\\u206f",yie=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",AA="A-Z\\xc0-\\xd6\\xd8-\\xde",IA="\\ufe0e\\ufe0f",NA=mie+vie+bie+yie,Px="['’]",xie="["+nn+"]",RA="["+NA+"]",sg="["+MA+"]",LA="\\d+",wie="["+DA+"]",$A="["+TA+"]",FA="[^"+nn+NA+LA+DA+TA+AA+"]",kx="\\ud83c[\\udffb-\\udfff]",_ie="(?:"+sg+"|"+kx+")",jA="[^"+nn+"]",Mx="(?:\\ud83c[\\udde6-\\uddff]){2}",Dx="[\\ud800-\\udbff][\\udc00-\\udfff]",hc="["+AA+"]",zA="\\u200d",BA="(?:"+$A+"|"+FA+")",Sie="(?:"+hc+"|"+FA+")",VA="(?:"+Px+"(?:d|ll|m|re|s|t|ve))?",HA="(?:"+Px+"(?:D|LL|M|RE|S|T|VE))?",WA=_ie+"?",qA="["+IA+"]?",Cie="(?:"+zA+"(?:"+[jA,Mx,Dx].join("|")+")"+qA+WA+")*",Eie="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Oie="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",UA=qA+WA+Cie,Pie="(?:"+[wie,Mx,Dx].join("|")+")"+UA,kie="(?:"+[jA+sg+"?",sg,Mx,Dx,xie].join("|")+")",Mie=RegExp(Px,"g"),Die=RegExp(sg,"g"),Tx=RegExp(kx+"(?="+kx+")|"+kie+UA,"g"),Tie=RegExp([hc+"?"+$A+"+"+VA+"(?="+[RA,hc,"$"].join("|")+")",Sie+"+"+HA+"(?="+[RA,hc+BA,"$"].join("|")+")",hc+"?"+BA+"+"+VA,hc+"+"+HA,Oie,Eie,LA,Pie].join("|"),"g"),Aie=RegExp("["+zA+nn+MA+IA+"]"),Iie=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Nie=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Rie=-1,en={};en[yt]=en[hn]=en[Cn]=en[Fn]=en[Br]=en[Vr]=en[pn]=en[mr]=en[jn]=!0,en[me]=en[he]=en[Le]=en[re]=en[Xe]=en[ee]=en[ye]=en[oe]=en[Fe]=en[He]=en[St]=en[tn]=en[Zt]=en[Dn]=en[fe]=!1;var qt={};qt[me]=qt[he]=qt[Le]=qt[Xe]=qt[re]=qt[ee]=qt[yt]=qt[hn]=qt[Cn]=qt[Fn]=qt[Br]=qt[Fe]=qt[He]=qt[St]=qt[tn]=qt[Zt]=qt[Dn]=qt[fn]=qt[Vr]=qt[pn]=qt[mr]=qt[jn]=!0,qt[ye]=qt[oe]=qt[fe]=!1;var Lie={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},$ie={"&":"&","<":"<",">":">",'"':""","'":"'"},Fie={"&":"&","<":"<",">":">",""":'"',"'":"'"},jie={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},zie=parseFloat,Bie=parseInt,GA=typeof Ro=="object"&&Ro&&Ro.Object===Object&&Ro,Vie=typeof self=="object"&&self&&self.Object===Object&&self,zn=GA||Vie||Function("return this")(),Ax=t&&!t.nodeType&&t,qa=Ax&&!0&&e&&!e.nodeType&&e,YA=qa&&qa.exports===Ax,Ix=YA&&GA.process,si=function(){try{var Q=qa&&qa.require&&qa.require("util").types;return Q||Ix&&Ix.binding&&Ix.binding("util")}catch{}}(),KA=si&&si.isArrayBuffer,XA=si&&si.isDate,QA=si&&si.isMap,JA=si&&si.isRegExp,ZA=si&&si.isSet,e5=si&&si.isTypedArray;function Hr(Q,pe,ce){switch(ce.length){case 0:return Q.call(pe);case 1:return Q.call(pe,ce[0]);case 2:return Q.call(pe,ce[0],ce[1]);case 3:return Q.call(pe,ce[0],ce[1],ce[2])}return Q.apply(pe,ce)}function Hie(Q,pe,ce,Ne){for(var Ze=-1,Tt=Q==null?0:Q.length;++Ze<Tt;){var En=Q[Ze];pe(Ne,En,ce(En),Q)}return Ne}function ai(Q,pe){for(var ce=-1,Ne=Q==null?0:Q.length;++ce<Ne&&pe(Q[ce],ce,Q)!==!1;);return Q}function Wie(Q,pe){for(var ce=Q==null?0:Q.length;ce--&&pe(Q[ce],ce,Q)!==!1;);return Q}function t5(Q,pe){for(var ce=-1,Ne=Q==null?0:Q.length;++ce<Ne;)if(!pe(Q[ce],ce,Q))return!1;return!0}function ws(Q,pe){for(var ce=-1,Ne=Q==null?0:Q.length,Ze=0,Tt=[];++ce<Ne;){var En=Q[ce];pe(En,ce,Q)&&(Tt[Ze++]=En)}return Tt}function ag(Q,pe){var ce=Q==null?0:Q.length;return!!ce&&pc(Q,pe,0)>-1}function Nx(Q,pe,ce){for(var Ne=-1,Ze=Q==null?0:Q.length;++Ne<Ze;)if(ce(pe,Q[Ne]))return!0;return!1}function rn(Q,pe){for(var ce=-1,Ne=Q==null?0:Q.length,Ze=Array(Ne);++ce<Ne;)Ze[ce]=pe(Q[ce],ce,Q);return Ze}function _s(Q,pe){for(var ce=-1,Ne=pe.length,Ze=Q.length;++ce<Ne;)Q[Ze+ce]=pe[ce];return Q}function Rx(Q,pe,ce,Ne){var Ze=-1,Tt=Q==null?0:Q.length;for(Ne&&Tt&&(ce=Q[++Ze]);++Ze<Tt;)ce=pe(ce,Q[Ze],Ze,Q);return ce}function qie(Q,pe,ce,Ne){var Ze=Q==null?0:Q.length;for(Ne&&Ze&&(ce=Q[--Ze]);Ze--;)ce=pe(ce,Q[Ze],Ze,Q);return ce}function Lx(Q,pe){for(var ce=-1,Ne=Q==null?0:Q.length;++ce<Ne;)if(pe(Q[ce],ce,Q))return!0;return!1}var Uie=$x("length");function Gie(Q){return Q.split("")}function Yie(Q){return Q.match(G)||[]}function n5(Q,pe,ce){var Ne;return ce(Q,function(Ze,Tt,En){if(pe(Ze,Tt,En))return Ne=Tt,!1}),Ne}function lg(Q,pe,ce,Ne){for(var Ze=Q.length,Tt=ce+(Ne?1:-1);Ne?Tt--:++Tt<Ze;)if(pe(Q[Tt],Tt,Q))return Tt;return-1}function pc(Q,pe,ce){return pe===pe?soe(Q,pe,ce):lg(Q,r5,ce)}function Kie(Q,pe,ce,Ne){for(var Ze=ce-1,Tt=Q.length;++Ze<Tt;)if(Ne(Q[Ze],pe))return Ze;return-1}function r5(Q){return Q!==Q}function i5(Q,pe){var ce=Q==null?0:Q.length;return ce?jx(Q,pe)/ce:M}function $x(Q){return function(pe){return pe==null?n:pe[Q]}}function Fx(Q){return function(pe){return Q==null?n:Q[pe]}}function o5(Q,pe,ce,Ne,Ze){return Ze(Q,function(Tt,En,Bt){ce=Ne?(Ne=!1,Tt):pe(ce,Tt,En,Bt)}),ce}function Xie(Q,pe){var ce=Q.length;for(Q.sort(pe);ce--;)Q[ce]=Q[ce].value;return Q}function jx(Q,pe){for(var ce,Ne=-1,Ze=Q.length;++Ne<Ze;){var Tt=pe(Q[Ne]);Tt!==n&&(ce=ce===n?Tt:ce+Tt)}return ce}function zx(Q,pe){for(var ce=-1,Ne=Array(Q);++ce<Q;)Ne[ce]=pe(ce);return Ne}function Qie(Q,pe){return rn(pe,function(ce){return[ce,Q[ce]]})}function s5(Q){return Q&&Q.slice(0,u5(Q)+1).replace(Ha,"")}function Wr(Q){return function(pe){return Q(pe)}}function Bx(Q,pe){return rn(pe,function(ce){return Q[ce]})}function Td(Q,pe){return Q.has(pe)}function a5(Q,pe){for(var ce=-1,Ne=Q.length;++ce<Ne&&pc(pe,Q[ce],0)>-1;);return ce}function l5(Q,pe){for(var ce=Q.length;ce--&&pc(pe,Q[ce],0)>-1;);return ce}function Jie(Q,pe){for(var ce=Q.length,Ne=0;ce--;)Q[ce]===pe&&++Ne;return Ne}var Zie=Fx(Lie),eoe=Fx($ie);function toe(Q){return"\\"+jie[Q]}function noe(Q,pe){return Q==null?n:Q[pe]}function gc(Q){return Aie.test(Q)}function roe(Q){return Iie.test(Q)}function ioe(Q){for(var pe,ce=[];!(pe=Q.next()).done;)ce.push(pe.value);return ce}function Vx(Q){var pe=-1,ce=Array(Q.size);return Q.forEach(function(Ne,Ze){ce[++pe]=[Ze,Ne]}),ce}function c5(Q,pe){return function(ce){return Q(pe(ce))}}function Ss(Q,pe){for(var ce=-1,Ne=Q.length,Ze=0,Tt=[];++ce<Ne;){var En=Q[ce];(En===pe||En===d)&&(Q[ce]=d,Tt[Ze++]=ce)}return Tt}function cg(Q){var pe=-1,ce=Array(Q.size);return Q.forEach(function(Ne){ce[++pe]=Ne}),ce}function ooe(Q){var pe=-1,ce=Array(Q.size);return Q.forEach(function(Ne){ce[++pe]=[Ne,Ne]}),ce}function soe(Q,pe,ce){for(var Ne=ce-1,Ze=Q.length;++Ne<Ze;)if(Q[Ne]===pe)return Ne;return-1}function aoe(Q,pe,ce){for(var Ne=ce+1;Ne--;)if(Q[Ne]===pe)return Ne;return Ne}function mc(Q){return gc(Q)?coe(Q):Uie(Q)}function Ci(Q){return gc(Q)?uoe(Q):Gie(Q)}function u5(Q){for(var pe=Q.length;pe--&&kd.test(Q.charAt(pe)););return pe}var loe=Fx(Fie);function coe(Q){for(var pe=Tx.lastIndex=0;Tx.test(Q);)++pe;return pe}function uoe(Q){return Q.match(Tx)||[]}function doe(Q){return Q.match(Tie)||[]}var foe=function Q(pe){pe=pe==null?zn:vc.defaults(zn.Object(),pe,vc.pick(zn,Nie));var ce=pe.Array,Ne=pe.Date,Ze=pe.Error,Tt=pe.Function,En=pe.Math,Bt=pe.Object,Hx=pe.RegExp,hoe=pe.String,li=pe.TypeError,ug=ce.prototype,poe=Tt.prototype,bc=Bt.prototype,dg=pe["__core-js_shared__"],fg=poe.toString,$t=bc.hasOwnProperty,goe=0,d5=function(){var u=/[^.]+$/.exec(dg&&dg.keys&&dg.keys.IE_PROTO||"");return u?"Symbol(src)_1."+u:""}(),hg=bc.toString,moe=fg.call(Bt),voe=zn._,boe=Hx("^"+fg.call($t).replace(Ba,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),pg=YA?pe.Buffer:n,Cs=pe.Symbol,gg=pe.Uint8Array,f5=pg?pg.allocUnsafe:n,mg=c5(Bt.getPrototypeOf,Bt),h5=Bt.create,p5=bc.propertyIsEnumerable,vg=ug.splice,g5=Cs?Cs.isConcatSpreadable:n,Ad=Cs?Cs.iterator:n,Ua=Cs?Cs.toStringTag:n,bg=function(){try{var u=Qa(Bt,"defineProperty");return u({},"",{}),u}catch{}}(),yoe=pe.clearTimeout!==zn.clearTimeout&&pe.clearTimeout,xoe=Ne&&Ne.now!==zn.Date.now&&Ne.now,woe=pe.setTimeout!==zn.setTimeout&&pe.setTimeout,yg=En.ceil,xg=En.floor,Wx=Bt.getOwnPropertySymbols,_oe=pg?pg.isBuffer:n,m5=pe.isFinite,Soe=ug.join,Coe=c5(Bt.keys,Bt),On=En.max,Kn=En.min,Eoe=Ne.now,Ooe=pe.parseInt,v5=En.random,Poe=ug.reverse,qx=Qa(pe,"DataView"),Id=Qa(pe,"Map"),Ux=Qa(pe,"Promise"),yc=Qa(pe,"Set"),Nd=Qa(pe,"WeakMap"),Rd=Qa(Bt,"create"),wg=Nd&&new Nd,xc={},koe=Ja(qx),Moe=Ja(Id),Doe=Ja(Ux),Toe=Ja(yc),Aoe=Ja(Nd),_g=Cs?Cs.prototype:n,Ld=_g?_g.valueOf:n,b5=_g?_g.toString:n;function I(u){if(un(u)&&!rt(u)&&!(u instanceof Ct)){if(u instanceof ci)return u;if($t.call(u,"__wrapped__"))return yI(u)}return new ci(u)}var wc=function(){function u(){}return function(h){if(!sn(h))return{};if(h5)return h5(h);u.prototype=h;var b=new u;return u.prototype=n,b}}();function Sg(){}function ci(u,h){this.__wrapped__=u,this.__actions__=[],this.__chain__=!!h,this.__index__=0,this.__values__=n}I.templateSettings={escape:Od,evaluate:Fa,interpolate:fc,variable:"",imports:{_:I}},I.prototype=Sg.prototype,I.prototype.constructor=I,ci.prototype=wc(Sg.prototype),ci.prototype.constructor=ci;function Ct(u){this.__wrapped__=u,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=H,this.__views__=[]}function Ioe(){var u=new Ct(this.__wrapped__);return u.__actions__=vr(this.__actions__),u.__dir__=this.__dir__,u.__filtered__=this.__filtered__,u.__iteratees__=vr(this.__iteratees__),u.__takeCount__=this.__takeCount__,u.__views__=vr(this.__views__),u}function Noe(){if(this.__filtered__){var u=new Ct(this);u.__dir__=-1,u.__filtered__=!0}else u=this.clone(),u.__dir__*=-1;return u}function Roe(){var u=this.__wrapped__.value(),h=this.__dir__,b=rt(u),E=h<0,T=b?u.length:0,R=Gse(0,T,this.__views__),z=R.start,q=R.end,te=q-z,ve=E?q:z-1,be=this.__iteratees__,we=be.length,De=0,$e=Kn(te,this.__takeCount__);if(!b||!E&&T==te&&$e==te)return V5(u,this.__actions__);var We=[];e:for(;te--&&De<$e;){ve+=h;for(var ft=-1,qe=u[ve];++ft<we;){var _t=be[ft],Et=_t.iteratee,Gr=_t.type,rr=Et(qe);if(Gr==$)qe=rr;else if(!rr){if(Gr==Y)continue e;break e}}We[De++]=qe}return We}Ct.prototype=wc(Sg.prototype),Ct.prototype.constructor=Ct;function Ga(u){var h=-1,b=u==null?0:u.length;for(this.clear();++h<b;){var E=u[h];this.set(E[0],E[1])}}function Loe(){this.__data__=Rd?Rd(null):{},this.size=0}function $oe(u){var h=this.has(u)&&delete this.__data__[u];return this.size-=h?1:0,h}function Foe(u){var h=this.__data__;if(Rd){var b=h[u];return b===l?n:b}return $t.call(h,u)?h[u]:n}function joe(u){var h=this.__data__;return Rd?h[u]!==n:$t.call(h,u)}function zoe(u,h){var b=this.__data__;return this.size+=this.has(u)?0:1,b[u]=Rd&&h===n?l:h,this}Ga.prototype.clear=Loe,Ga.prototype.delete=$oe,Ga.prototype.get=Foe,Ga.prototype.has=joe,Ga.prototype.set=zoe;function Eo(u){var h=-1,b=u==null?0:u.length;for(this.clear();++h<b;){var E=u[h];this.set(E[0],E[1])}}function Boe(){this.__data__=[],this.size=0}function Voe(u){var h=this.__data__,b=Cg(h,u);if(b<0)return!1;var E=h.length-1;return b==E?h.pop():vg.call(h,b,1),--this.size,!0}function Hoe(u){var h=this.__data__,b=Cg(h,u);return b<0?n:h[b][1]}function Woe(u){return Cg(this.__data__,u)>-1}function qoe(u,h){var b=this.__data__,E=Cg(b,u);return E<0?(++this.size,b.push([u,h])):b[E][1]=h,this}Eo.prototype.clear=Boe,Eo.prototype.delete=Voe,Eo.prototype.get=Hoe,Eo.prototype.has=Woe,Eo.prototype.set=qoe;function Oo(u){var h=-1,b=u==null?0:u.length;for(this.clear();++h<b;){var E=u[h];this.set(E[0],E[1])}}function Uoe(){this.size=0,this.__data__={hash:new Ga,map:new(Id||Eo),string:new Ga}}function Goe(u){var h=Lg(this,u).delete(u);return this.size-=h?1:0,h}function Yoe(u){return Lg(this,u).get(u)}function Koe(u){return Lg(this,u).has(u)}function Xoe(u,h){var b=Lg(this,u),E=b.size;return b.set(u,h),this.size+=b.size==E?0:1,this}Oo.prototype.clear=Uoe,Oo.prototype.delete=Goe,Oo.prototype.get=Yoe,Oo.prototype.has=Koe,Oo.prototype.set=Xoe;function Ya(u){var h=-1,b=u==null?0:u.length;for(this.__data__=new Oo;++h<b;)this.add(u[h])}function Qoe(u){return this.__data__.set(u,l),this}function Joe(u){return this.__data__.has(u)}Ya.prototype.add=Ya.prototype.push=Qoe,Ya.prototype.has=Joe;function Ei(u){var h=this.__data__=new Eo(u);this.size=h.size}function Zoe(){this.__data__=new Eo,this.size=0}function ese(u){var h=this.__data__,b=h.delete(u);return this.size=h.size,b}function tse(u){return this.__data__.get(u)}function nse(u){return this.__data__.has(u)}function rse(u,h){var b=this.__data__;if(b instanceof Eo){var E=b.__data__;if(!Id||E.length<i-1)return E.push([u,h]),this.size=++b.size,this;b=this.__data__=new Oo(E)}return b.set(u,h),this.size=b.size,this}Ei.prototype.clear=Zoe,Ei.prototype.delete=ese,Ei.prototype.get=tse,Ei.prototype.has=nse,Ei.prototype.set=rse;function y5(u,h){var b=rt(u),E=!b&&Za(u),T=!b&&!E&&Ms(u),R=!b&&!E&&!T&&Ec(u),z=b||E||T||R,q=z?zx(u.length,hoe):[],te=q.length;for(var ve in u)(h||$t.call(u,ve))&&!(z&&(ve=="length"||T&&(ve=="offset"||ve=="parent")||R&&(ve=="buffer"||ve=="byteLength"||ve=="byteOffset")||Do(ve,te)))&&q.push(ve);return q}function x5(u){var h=u.length;return h?u[r1(0,h-1)]:n}function ise(u,h){return $g(vr(u),Ka(h,0,u.length))}function ose(u){return $g(vr(u))}function Gx(u,h,b){(b!==n&&!Oi(u[h],b)||b===n&&!(h in u))&&Po(u,h,b)}function $d(u,h,b){var E=u[h];(!($t.call(u,h)&&Oi(E,b))||b===n&&!(h in u))&&Po(u,h,b)}function Cg(u,h){for(var b=u.length;b--;)if(Oi(u[b][0],h))return b;return-1}function sse(u,h,b,E){return Es(u,function(T,R,z){h(E,T,b(T),z)}),E}function w5(u,h){return u&&eo(h,An(h),u)}function ase(u,h){return u&&eo(h,yr(h),u)}function Po(u,h,b){h=="__proto__"&&bg?bg(u,h,{configurable:!0,enumerable:!0,value:b,writable:!0}):u[h]=b}function Yx(u,h){for(var b=-1,E=h.length,T=ce(E),R=u==null;++b<E;)T[b]=R?n:k1(u,h[b]);return T}function Ka(u,h,b){return u===u&&(b!==n&&(u=u<=b?u:b),h!==n&&(u=u>=h?u:h)),u}function ui(u,h,b,E,T,R){var z,q=h&f,te=h&g,ve=h&p;if(b&&(z=T?b(u,E,T,R):b(u)),z!==n)return z;if(!sn(u))return u;var be=rt(u);if(be){if(z=Kse(u),!q)return vr(u,z)}else{var we=Xn(u),De=we==oe||we==Te;if(Ms(u))return q5(u,q);if(we==St||we==me||De&&!T){if(z=te||De?{}:uI(u),!q)return te?Fse(u,ase(z,u)):$se(u,w5(z,u))}else{if(!qt[we])return T?u:{};z=Xse(u,we,q)}}R||(R=new Ei);var $e=R.get(u);if($e)return $e;R.set(u,z),jI(u)?u.forEach(function(qe){z.add(ui(qe,h,b,qe,u,R))}):$I(u)&&u.forEach(function(qe,_t){z.set(_t,ui(qe,h,b,_t,u,R))});var We=ve?te?p1:h1:te?yr:An,ft=be?n:We(u);return ai(ft||u,function(qe,_t){ft&&(_t=qe,qe=u[_t]),$d(z,_t,ui(qe,h,b,_t,u,R))}),z}function lse(u){var h=An(u);return function(b){return _5(b,u,h)}}function _5(u,h,b){var E=b.length;if(u==null)return!E;for(u=Bt(u);E--;){var T=b[E],R=h[T],z=u[T];if(z===n&&!(T in u)||!R(z))return!1}return!0}function S5(u,h,b){if(typeof u!="function")throw new li(s);return Wd(function(){u.apply(n,b)},h)}function Fd(u,h,b,E){var T=-1,R=ag,z=!0,q=u.length,te=[],ve=h.length;if(!q)return te;b&&(h=rn(h,Wr(b))),E?(R=Nx,z=!1):h.length>=i&&(R=Td,z=!1,h=new Ya(h));e:for(;++T<q;){var be=u[T],we=b==null?be:b(be);if(be=E||be!==0?be:0,z&&we===we){for(var De=ve;De--;)if(h[De]===we)continue e;te.push(be)}else R(h,we,E)||te.push(be)}return te}var Es=X5(Zi),C5=X5(Xx,!0);function cse(u,h){var b=!0;return Es(u,function(E,T,R){return b=!!h(E,T,R),b}),b}function Eg(u,h,b){for(var E=-1,T=u.length;++E<T;){var R=u[E],z=h(R);if(z!=null&&(q===n?z===z&&!Ur(z):b(z,q)))var q=z,te=R}return te}function use(u,h,b,E){var T=u.length;for(b=lt(b),b<0&&(b=-b>T?0:T+b),E=E===n||E>T?T:lt(E),E<0&&(E+=T),E=b>E?0:BI(E);b<E;)u[b++]=h;return u}function E5(u,h){var b=[];return Es(u,function(E,T,R){h(E,T,R)&&b.push(E)}),b}function Bn(u,h,b,E,T){var R=-1,z=u.length;for(b||(b=Jse),T||(T=[]);++R<z;){var q=u[R];h>0&&b(q)?h>1?Bn(q,h-1,b,E,T):_s(T,q):E||(T[T.length]=q)}return T}var Kx=Q5(),O5=Q5(!0);function Zi(u,h){return u&&Kx(u,h,An)}function Xx(u,h){return u&&O5(u,h,An)}function Og(u,h){return ws(h,function(b){return To(u[b])})}function Xa(u,h){h=Ps(h,u);for(var b=0,E=h.length;u!=null&&b<E;)u=u[to(h[b++])];return b&&b==E?u:n}function P5(u,h,b){var E=h(u);return rt(u)?E:_s(E,b(u))}function tr(u){return u==null?u===n?Ra:Ke:Ua&&Ua in Bt(u)?Use(u):oae(u)}function Qx(u,h){return u>h}function dse(u,h){return u!=null&&$t.call(u,h)}function fse(u,h){return u!=null&&h in Bt(u)}function hse(u,h,b){return u>=Kn(h,b)&&u<On(h,b)}function Jx(u,h,b){for(var E=b?Nx:ag,T=u[0].length,R=u.length,z=R,q=ce(R),te=1/0,ve=[];z--;){var be=u[z];z&&h&&(be=rn(be,Wr(h))),te=Kn(be.length,te),q[z]=!b&&(h||T>=120&&be.length>=120)?new Ya(z&&be):n}be=u[0];var we=-1,De=q[0];e:for(;++we<T&&ve.length<te;){var $e=be[we],We=h?h($e):$e;if($e=b||$e!==0?$e:0,!(De?Td(De,We):E(ve,We,b))){for(z=R;--z;){var ft=q[z];if(!(ft?Td(ft,We):E(u[z],We,b)))continue e}De&&De.push(We),ve.push($e)}}return ve}function pse(u,h,b,E){return Zi(u,function(T,R,z){h(E,b(T),R,z)}),E}function jd(u,h,b){h=Ps(h,u),u=pI(u,h);var E=u==null?u:u[to(fi(h))];return E==null?n:Hr(E,u,b)}function k5(u){return un(u)&&tr(u)==me}function gse(u){return un(u)&&tr(u)==Le}function mse(u){return un(u)&&tr(u)==ee}function zd(u,h,b,E,T){return u===h?!0:u==null||h==null||!un(u)&&!un(h)?u!==u&&h!==h:vse(u,h,b,E,zd,T)}function vse(u,h,b,E,T,R){var z=rt(u),q=rt(h),te=z?he:Xn(u),ve=q?he:Xn(h);te=te==me?St:te,ve=ve==me?St:ve;var be=te==St,we=ve==St,De=te==ve;if(De&&Ms(u)){if(!Ms(h))return!1;z=!0,be=!1}if(De&&!be)return R||(R=new Ei),z||Ec(u)?aI(u,h,b,E,T,R):Wse(u,h,te,b,E,T,R);if(!(b&v)){var $e=be&&$t.call(u,"__wrapped__"),We=we&&$t.call(h,"__wrapped__");if($e||We){var ft=$e?u.value():u,qe=We?h.value():h;return R||(R=new Ei),T(ft,qe,b,E,R)}}return De?(R||(R=new Ei),qse(u,h,b,E,T,R)):!1}function bse(u){return un(u)&&Xn(u)==Fe}function Zx(u,h,b,E){var T=b.length,R=T,z=!E;if(u==null)return!R;for(u=Bt(u);T--;){var q=b[T];if(z&&q[2]?q[1]!==u[q[0]]:!(q[0]in u))return!1}for(;++T<R;){q=b[T];var te=q[0],ve=u[te],be=q[1];if(z&&q[2]){if(ve===n&&!(te in u))return!1}else{var we=new Ei;if(E)var De=E(ve,be,te,u,h,we);if(!(De===n?zd(be,ve,v|y,E,we):De))return!1}}return!0}function M5(u){if(!sn(u)||eae(u))return!1;var h=To(u)?boe:Pt;return h.test(Ja(u))}function yse(u){return un(u)&&tr(u)==tn}function xse(u){return un(u)&&Xn(u)==Zt}function wse(u){return un(u)&&Hg(u.length)&&!!en[tr(u)]}function D5(u){return typeof u=="function"?u:u==null?xr:typeof u=="object"?rt(u)?I5(u[0],u[1]):A5(u):JI(u)}function e1(u){if(!Hd(u))return Coe(u);var h=[];for(var b in Bt(u))$t.call(u,b)&&b!="constructor"&&h.push(b);return h}function _se(u){if(!sn(u))return iae(u);var h=Hd(u),b=[];for(var E in u)E=="constructor"&&(h||!$t.call(u,E))||b.push(E);return b}function t1(u,h){return u<h}function T5(u,h){var b=-1,E=br(u)?ce(u.length):[];return Es(u,function(T,R,z){E[++b]=h(T,R,z)}),E}function A5(u){var h=m1(u);return h.length==1&&h[0][2]?fI(h[0][0],h[0][1]):function(b){return b===u||Zx(b,u,h)}}function I5(u,h){return b1(u)&&dI(h)?fI(to(u),h):function(b){var E=k1(b,u);return E===n&&E===h?M1(b,u):zd(h,E,v|y)}}function Pg(u,h,b,E,T){u!==h&&Kx(h,function(R,z){if(T||(T=new Ei),sn(R))Sse(u,h,z,b,Pg,E,T);else{var q=E?E(x1(u,z),R,z+"",u,h,T):n;q===n&&(q=R),Gx(u,z,q)}},yr)}function Sse(u,h,b,E,T,R,z){var q=x1(u,b),te=x1(h,b),ve=z.get(te);if(ve){Gx(u,b,ve);return}var be=R?R(q,te,b+"",u,h,z):n,we=be===n;if(we){var De=rt(te),$e=!De&&Ms(te),We=!De&&!$e&&Ec(te);be=te,De||$e||We?rt(q)?be=q:gn(q)?be=vr(q):$e?(we=!1,be=q5(te,!0)):We?(we=!1,be=U5(te,!0)):be=[]:qd(te)||Za(te)?(be=q,Za(q)?be=VI(q):(!sn(q)||To(q))&&(be=uI(te))):we=!1}we&&(z.set(te,be),T(be,te,E,R,z),z.delete(te)),Gx(u,b,be)}function N5(u,h){var b=u.length;if(b)return h+=h<0?b:0,Do(h,b)?u[h]:n}function R5(u,h,b){h.length?h=rn(h,function(R){return rt(R)?function(z){return Xa(z,R.length===1?R[0]:R)}:R}):h=[xr];var E=-1;h=rn(h,Wr(Ve()));var T=T5(u,function(R,z,q){var te=rn(h,function(ve){return ve(R)});return{criteria:te,index:++E,value:R}});return Xie(T,function(R,z){return Lse(R,z,b)})}function Cse(u,h){return L5(u,h,function(b,E){return M1(u,E)})}function L5(u,h,b){for(var E=-1,T=h.length,R={};++E<T;){var z=h[E],q=Xa(u,z);b(q,z)&&Bd(R,Ps(z,u),q)}return R}function Ese(u){return function(h){return Xa(h,u)}}function n1(u,h,b,E){var T=E?Kie:pc,R=-1,z=h.length,q=u;for(u===h&&(h=vr(h)),b&&(q=rn(u,Wr(b)));++R<z;)for(var te=0,ve=h[R],be=b?b(ve):ve;(te=T(q,be,te,E))>-1;)q!==u&&vg.call(q,te,1),vg.call(u,te,1);return u}function $5(u,h){for(var b=u?h.length:0,E=b-1;b--;){var T=h[b];if(b==E||T!==R){var R=T;Do(T)?vg.call(u,T,1):s1(u,T)}}return u}function r1(u,h){return u+xg(v5()*(h-u+1))}function Ose(u,h,b,E){for(var T=-1,R=On(yg((h-u)/(b||1)),0),z=ce(R);R--;)z[E?R:++T]=u,u+=b;return z}function i1(u,h){var b="";if(!u||h<1||h>ie)return b;do h%2&&(b+=u),h=xg(h/2),h&&(u+=u);while(h);return b}function ht(u,h){return w1(hI(u,h,xr),u+"")}function Pse(u){return x5(Oc(u))}function kse(u,h){var b=Oc(u);return $g(b,Ka(h,0,b.length))}function Bd(u,h,b,E){if(!sn(u))return u;h=Ps(h,u);for(var T=-1,R=h.length,z=R-1,q=u;q!=null&&++T<R;){var te=to(h[T]),ve=b;if(te==="__proto__"||te==="constructor"||te==="prototype")return u;if(T!=z){var be=q[te];ve=E?E(be,te,q):n,ve===n&&(ve=sn(be)?be:Do(h[T+1])?[]:{})}$d(q,te,ve),q=q[te]}return u}var F5=wg?function(u,h){return wg.set(u,h),u}:xr,Mse=bg?function(u,h){return bg(u,"toString",{configurable:!0,enumerable:!1,value:T1(h),writable:!0})}:xr;function Dse(u){return $g(Oc(u))}function di(u,h,b){var E=-1,T=u.length;h<0&&(h=-h>T?0:T+h),b=b>T?T:b,b<0&&(b+=T),T=h>b?0:b-h>>>0,h>>>=0;for(var R=ce(T);++E<T;)R[E]=u[E+h];return R}function Tse(u,h){var b;return Es(u,function(E,T,R){return b=h(E,T,R),!b}),!!b}function kg(u,h,b){var E=0,T=u==null?E:u.length;if(typeof h=="number"&&h===h&&T<=N){for(;E<T;){var R=E+T>>>1,z=u[R];z!==null&&!Ur(z)&&(b?z<=h:z<h)?E=R+1:T=R}return T}return o1(u,h,xr,b)}function o1(u,h,b,E){var T=0,R=u==null?0:u.length;if(R===0)return 0;h=b(h);for(var z=h!==h,q=h===null,te=Ur(h),ve=h===n;T<R;){var be=xg((T+R)/2),we=b(u[be]),De=we!==n,$e=we===null,We=we===we,ft=Ur(we);if(z)var qe=E||We;else ve?qe=We&&(E||De):q?qe=We&&De&&(E||!$e):te?qe=We&&De&&!$e&&(E||!ft):$e||ft?qe=!1:qe=E?we<=h:we<h;qe?T=be+1:R=be}return Kn(R,ne)}function j5(u,h){for(var b=-1,E=u.length,T=0,R=[];++b<E;){var z=u[b],q=h?h(z):z;if(!b||!Oi(q,te)){var te=q;R[T++]=z===0?0:z}}return R}function z5(u){return typeof u=="number"?u:Ur(u)?M:+u}function qr(u){if(typeof u=="string")return u;if(rt(u))return rn(u,qr)+"";if(Ur(u))return b5?b5.call(u):"";var h=u+"";return h=="0"&&1/u==-U?"-0":h}function Os(u,h,b){var E=-1,T=ag,R=u.length,z=!0,q=[],te=q;if(b)z=!1,T=Nx;else if(R>=i){var ve=h?null:Vse(u);if(ve)return cg(ve);z=!1,T=Td,te=new Ya}else te=h?[]:q;e:for(;++E<R;){var be=u[E],we=h?h(be):be;if(be=b||be!==0?be:0,z&&we===we){for(var De=te.length;De--;)if(te[De]===we)continue e;h&&te.push(we),q.push(be)}else T(te,we,b)||(te!==q&&te.push(we),q.push(be))}return q}function s1(u,h){return h=Ps(h,u),u=pI(u,h),u==null||delete u[to(fi(h))]}function B5(u,h,b,E){return Bd(u,h,b(Xa(u,h)),E)}function Mg(u,h,b,E){for(var T=u.length,R=E?T:-1;(E?R--:++R<T)&&h(u[R],R,u););return b?di(u,E?0:R,E?R+1:T):di(u,E?R+1:0,E?T:R)}function V5(u,h){var b=u;return b instanceof Ct&&(b=b.value()),Rx(h,function(E,T){return T.func.apply(T.thisArg,_s([E],T.args))},b)}function a1(u,h,b){var E=u.length;if(E<2)return E?Os(u[0]):[];for(var T=-1,R=ce(E);++T<E;)for(var z=u[T],q=-1;++q<E;)q!=T&&(R[T]=Fd(R[T]||z,u[q],h,b));return Os(Bn(R,1),h,b)}function H5(u,h,b){for(var E=-1,T=u.length,R=h.length,z={};++E<T;){var q=E<R?h[E]:n;b(z,u[E],q)}return z}function l1(u){return gn(u)?u:[]}function c1(u){return typeof u=="function"?u:xr}function Ps(u,h){return rt(u)?u:b1(u,h)?[u]:bI(Rt(u))}var Ase=ht;function ks(u,h,b){var E=u.length;return b=b===n?E:b,!h&&b>=E?u:di(u,h,b)}var W5=yoe||function(u){return zn.clearTimeout(u)};function q5(u,h){if(h)return u.slice();var b=u.length,E=f5?f5(b):new u.constructor(b);return u.copy(E),E}function u1(u){var h=new u.constructor(u.byteLength);return new gg(h).set(new gg(u)),h}function Ise(u,h){var b=h?u1(u.buffer):u.buffer;return new u.constructor(b,u.byteOffset,u.byteLength)}function Nse(u){var h=new u.constructor(u.source,je.exec(u));return h.lastIndex=u.lastIndex,h}function Rse(u){return Ld?Bt(Ld.call(u)):{}}function U5(u,h){var b=h?u1(u.buffer):u.buffer;return new u.constructor(b,u.byteOffset,u.length)}function G5(u,h){if(u!==h){var b=u!==n,E=u===null,T=u===u,R=Ur(u),z=h!==n,q=h===null,te=h===h,ve=Ur(h);if(!q&&!ve&&!R&&u>h||R&&z&&te&&!q&&!ve||E&&z&&te||!b&&te||!T)return 1;if(!E&&!R&&!ve&&u<h||ve&&b&&T&&!E&&!R||q&&b&&T||!z&&T||!te)return-1}return 0}function Lse(u,h,b){for(var E=-1,T=u.criteria,R=h.criteria,z=T.length,q=b.length;++E<z;){var te=G5(T[E],R[E]);if(te){if(E>=q)return te;var ve=b[E];return te*(ve=="desc"?-1:1)}}return u.index-h.index}function Y5(u,h,b,E){for(var T=-1,R=u.length,z=b.length,q=-1,te=h.length,ve=On(R-z,0),be=ce(te+ve),we=!E;++q<te;)be[q]=h[q];for(;++T<z;)(we||T<R)&&(be[b[T]]=u[T]);for(;ve--;)be[q++]=u[T++];return be}function K5(u,h,b,E){for(var T=-1,R=u.length,z=-1,q=b.length,te=-1,ve=h.length,be=On(R-q,0),we=ce(be+ve),De=!E;++T<be;)we[T]=u[T];for(var $e=T;++te<ve;)we[$e+te]=h[te];for(;++z<q;)(De||T<R)&&(we[$e+b[z]]=u[T++]);return we}function vr(u,h){var b=-1,E=u.length;for(h||(h=ce(E));++b<E;)h[b]=u[b];return h}function eo(u,h,b,E){var T=!b;b||(b={});for(var R=-1,z=h.length;++R<z;){var q=h[R],te=E?E(b[q],u[q],q,b,u):n;te===n&&(te=u[q]),T?Po(b,q,te):$d(b,q,te)}return b}function $se(u,h){return eo(u,v1(u),h)}function Fse(u,h){return eo(u,lI(u),h)}function Dg(u,h){return function(b,E){var T=rt(b)?Hie:sse,R=h?h():{};return T(b,u,Ve(E,2),R)}}function _c(u){return ht(function(h,b){var E=-1,T=b.length,R=T>1?b[T-1]:n,z=T>2?b[2]:n;for(R=u.length>3&&typeof R=="function"?(T--,R):n,z&&nr(b[0],b[1],z)&&(R=T<3?n:R,T=1),h=Bt(h);++E<T;){var q=b[E];q&&u(h,q,E,R)}return h})}function X5(u,h){return function(b,E){if(b==null)return b;if(!br(b))return u(b,E);for(var T=b.length,R=h?T:-1,z=Bt(b);(h?R--:++R<T)&&E(z[R],R,z)!==!1;);return b}}function Q5(u){return function(h,b,E){for(var T=-1,R=Bt(h),z=E(h),q=z.length;q--;){var te=z[u?q:++T];if(b(R[te],te,R)===!1)break}return h}}function jse(u,h,b){var E=h&x,T=Vd(u);function R(){var z=this&&this!==zn&&this instanceof R?T:u;return z.apply(E?b:this,arguments)}return R}function J5(u){return function(h){h=Rt(h);var b=gc(h)?Ci(h):n,E=b?b[0]:h.charAt(0),T=b?ks(b,1).join(""):h.slice(1);return E[u]()+T}}function Sc(u){return function(h){return Rx(XI(KI(h).replace(Mie,"")),u,"")}}function Vd(u){return function(){var h=arguments;switch(h.length){case 0:return new u;case 1:return new u(h[0]);case 2:return new u(h[0],h[1]);case 3:return new u(h[0],h[1],h[2]);case 4:return new u(h[0],h[1],h[2],h[3]);case 5:return new u(h[0],h[1],h[2],h[3],h[4]);case 6:return new u(h[0],h[1],h[2],h[3],h[4],h[5]);case 7:return new u(h[0],h[1],h[2],h[3],h[4],h[5],h[6])}var b=wc(u.prototype),E=u.apply(b,h);return sn(E)?E:b}}function zse(u,h,b){var E=Vd(u);function T(){for(var R=arguments.length,z=ce(R),q=R,te=Cc(T);q--;)z[q]=arguments[q];var ve=R<3&&z[0]!==te&&z[R-1]!==te?[]:Ss(z,te);if(R-=ve.length,R<b)return rI(u,h,Tg,T.placeholder,n,z,ve,n,n,b-R);var be=this&&this!==zn&&this instanceof T?E:u;return Hr(be,this,z)}return T}function Z5(u){return function(h,b,E){var T=Bt(h);if(!br(h)){var R=Ve(b,3);h=An(h),b=function(q){return R(T[q],q,T)}}var z=u(h,b,E);return z>-1?T[R?h[z]:z]:n}}function eI(u){return Mo(function(h){var b=h.length,E=b,T=ci.prototype.thru;for(u&&h.reverse();E--;){var R=h[E];if(typeof R!="function")throw new li(s);if(T&&!z&&Rg(R)=="wrapper")var z=new ci([],!0)}for(E=z?E:b;++E<b;){R=h[E];var q=Rg(R),te=q=="wrapper"?g1(R):n;te&&y1(te[0])&&te[1]==(A|C|O|L)&&!te[4].length&&te[9]==1?z=z[Rg(te[0])].apply(z,te[3]):z=R.length==1&&y1(R)?z[q]():z.thru(R)}return function(){var ve=arguments,be=ve[0];if(z&&ve.length==1&&rt(be))return z.plant(be).value();for(var we=0,De=b?h[we].apply(this,ve):be;++we<b;)De=h[we].call(this,De);return De}})}function Tg(u,h,b,E,T,R,z,q,te,ve){var be=h&A,we=h&x,De=h&w,$e=h&(C|P),We=h&F,ft=De?n:Vd(u);function qe(){for(var _t=arguments.length,Et=ce(_t),Gr=_t;Gr--;)Et[Gr]=arguments[Gr];if($e)var rr=Cc(qe),Yr=Jie(Et,rr);if(E&&(Et=Y5(Et,E,T,$e)),R&&(Et=K5(Et,R,z,$e)),_t-=Yr,$e&&_t<ve){var mn=Ss(Et,rr);return rI(u,h,Tg,qe.placeholder,b,Et,mn,q,te,ve-_t)}var Pi=we?b:this,Io=De?Pi[u]:u;return _t=Et.length,q?Et=sae(Et,q):We&&_t>1&&Et.reverse(),be&&te<_t&&(Et.length=te),this&&this!==zn&&this instanceof qe&&(Io=ft||Vd(Io)),Io.apply(Pi,Et)}return qe}function tI(u,h){return function(b,E){return pse(b,u,h(E),{})}}function Ag(u,h){return function(b,E){var T;if(b===n&&E===n)return h;if(b!==n&&(T=b),E!==n){if(T===n)return E;typeof b=="string"||typeof E=="string"?(b=qr(b),E=qr(E)):(b=z5(b),E=z5(E)),T=u(b,E)}return T}}function d1(u){return Mo(function(h){return h=rn(h,Wr(Ve())),ht(function(b){var E=this;return u(h,function(T){return Hr(T,E,b)})})})}function Ig(u,h){h=h===n?" ":qr(h);var b=h.length;if(b<2)return b?i1(h,u):h;var E=i1(h,yg(u/mc(h)));return gc(h)?ks(Ci(E),0,u).join(""):E.slice(0,u)}function Bse(u,h,b,E){var T=h&x,R=Vd(u);function z(){for(var q=-1,te=arguments.length,ve=-1,be=E.length,we=ce(be+te),De=this&&this!==zn&&this instanceof z?R:u;++ve<be;)we[ve]=E[ve];for(;te--;)we[ve++]=arguments[++q];return Hr(De,T?b:this,we)}return z}function nI(u){return function(h,b,E){return E&&typeof E!="number"&&nr(h,b,E)&&(b=E=n),h=Ao(h),b===n?(b=h,h=0):b=Ao(b),E=E===n?h<b?1:-1:Ao(E),Ose(h,b,E,u)}}function Ng(u){return function(h,b){return typeof h=="string"&&typeof b=="string"||(h=hi(h),b=hi(b)),u(h,b)}}function rI(u,h,b,E,T,R,z,q,te,ve){var be=h&C,we=be?z:n,De=be?n:z,$e=be?R:n,We=be?n:R;h|=be?O:k,h&=~(be?k:O),h&S||(h&=~(x|w));var ft=[u,h,T,$e,we,We,De,q,te,ve],qe=b.apply(n,ft);return y1(u)&&gI(qe,ft),qe.placeholder=E,mI(qe,u,h)}function f1(u){var h=En[u];return function(b,E){if(b=hi(b),E=E==null?0:Kn(lt(E),292),E&&m5(b)){var T=(Rt(b)+"e").split("e"),R=h(T[0]+"e"+(+T[1]+E));return T=(Rt(R)+"e").split("e"),+(T[0]+"e"+(+T[1]-E))}return h(b)}}var Vse=yc&&1/cg(new yc([,-0]))[1]==U?function(u){return new yc(u)}:N1;function iI(u){return function(h){var b=Xn(h);return b==Fe?Vx(h):b==Zt?ooe(h):Qie(h,u(h))}}function ko(u,h,b,E,T,R,z,q){var te=h&w;if(!te&&typeof u!="function")throw new li(s);var ve=E?E.length:0;if(ve||(h&=~(O|k),E=T=n),z=z===n?z:On(lt(z),0),q=q===n?q:lt(q),ve-=T?T.length:0,h&k){var be=E,we=T;E=T=n}var De=te?n:g1(u),$e=[u,h,b,E,T,be,we,R,z,q];if(De&&rae($e,De),u=$e[0],h=$e[1],b=$e[2],E=$e[3],T=$e[4],q=$e[9]=$e[9]===n?te?0:u.length:On($e[9]-ve,0),!q&&h&(C|P)&&(h&=~(C|P)),!h||h==x)var We=jse(u,h,b);else h==C||h==P?We=zse(u,h,q):(h==O||h==(x|O))&&!T.length?We=Bse(u,h,b,E):We=Tg.apply(n,$e);var ft=De?F5:gI;return mI(ft(We,$e),u,h)}function oI(u,h,b,E){return u===n||Oi(u,bc[b])&&!$t.call(E,b)?h:u}function sI(u,h,b,E,T,R){return sn(u)&&sn(h)&&(R.set(h,u),Pg(u,h,n,sI,R),R.delete(h)),u}function Hse(u){return qd(u)?n:u}function aI(u,h,b,E,T,R){var z=b&v,q=u.length,te=h.length;if(q!=te&&!(z&&te>q))return!1;var ve=R.get(u),be=R.get(h);if(ve&&be)return ve==h&&be==u;var we=-1,De=!0,$e=b&y?new Ya:n;for(R.set(u,h),R.set(h,u);++we<q;){var We=u[we],ft=h[we];if(E)var qe=z?E(ft,We,we,h,u,R):E(We,ft,we,u,h,R);if(qe!==n){if(qe)continue;De=!1;break}if($e){if(!Lx(h,function(_t,Et){if(!Td($e,Et)&&(We===_t||T(We,_t,b,E,R)))return $e.push(Et)})){De=!1;break}}else if(!(We===ft||T(We,ft,b,E,R))){De=!1;break}}return R.delete(u),R.delete(h),De}function Wse(u,h,b,E,T,R,z){switch(b){case Xe:if(u.byteLength!=h.byteLength||u.byteOffset!=h.byteOffset)return!1;u=u.buffer,h=h.buffer;case Le:return!(u.byteLength!=h.byteLength||!R(new gg(u),new gg(h)));case re:case ee:case He:return Oi(+u,+h);case ye:return u.name==h.name&&u.message==h.message;case tn:case Dn:return u==h+"";case Fe:var q=Vx;case Zt:var te=E&v;if(q||(q=cg),u.size!=h.size&&!te)return!1;var ve=z.get(u);if(ve)return ve==h;E|=y,z.set(u,h);var be=aI(q(u),q(h),E,T,R,z);return z.delete(u),be;case fn:if(Ld)return Ld.call(u)==Ld.call(h)}return!1}function qse(u,h,b,E,T,R){var z=b&v,q=h1(u),te=q.length,ve=h1(h),be=ve.length;if(te!=be&&!z)return!1;for(var we=te;we--;){var De=q[we];if(!(z?De in h:$t.call(h,De)))return!1}var $e=R.get(u),We=R.get(h);if($e&&We)return $e==h&&We==u;var ft=!0;R.set(u,h),R.set(h,u);for(var qe=z;++we<te;){De=q[we];var _t=u[De],Et=h[De];if(E)var Gr=z?E(Et,_t,De,h,u,R):E(_t,Et,De,u,h,R);if(!(Gr===n?_t===Et||T(_t,Et,b,E,R):Gr)){ft=!1;break}qe||(qe=De=="constructor")}if(ft&&!qe){var rr=u.constructor,Yr=h.constructor;rr!=Yr&&"constructor"in u&&"constructor"in h&&!(typeof rr=="function"&&rr instanceof rr&&typeof Yr=="function"&&Yr instanceof Yr)&&(ft=!1)}return R.delete(u),R.delete(h),ft}function Mo(u){return w1(hI(u,n,_I),u+"")}function h1(u){return P5(u,An,v1)}function p1(u){return P5(u,yr,lI)}var g1=wg?function(u){return wg.get(u)}:N1;function Rg(u){for(var h=u.name+"",b=xc[h],E=$t.call(xc,h)?b.length:0;E--;){var T=b[E],R=T.func;if(R==null||R==u)return T.name}return h}function Cc(u){var h=$t.call(I,"placeholder")?I:u;return h.placeholder}function Ve(){var u=I.iteratee||A1;return u=u===A1?D5:u,arguments.length?u(arguments[0],arguments[1]):u}function Lg(u,h){var b=u.__data__;return Zse(h)?b[typeof h=="string"?"string":"hash"]:b.map}function m1(u){for(var h=An(u),b=h.length;b--;){var E=h[b],T=u[E];h[b]=[E,T,dI(T)]}return h}function Qa(u,h){var b=noe(u,h);return M5(b)?b:n}function Use(u){var h=$t.call(u,Ua),b=u[Ua];try{u[Ua]=n;var E=!0}catch{}var T=hg.call(u);return E&&(h?u[Ua]=b:delete u[Ua]),T}var v1=Wx?function(u){return u==null?[]:(u=Bt(u),ws(Wx(u),function(h){return p5.call(u,h)}))}:R1,lI=Wx?function(u){for(var h=[];u;)_s(h,v1(u)),u=mg(u);return h}:R1,Xn=tr;(qx&&Xn(new qx(new ArrayBuffer(1)))!=Xe||Id&&Xn(new Id)!=Fe||Ux&&Xn(Ux.resolve())!=vt||yc&&Xn(new yc)!=Zt||Nd&&Xn(new Nd)!=fe)&&(Xn=function(u){var h=tr(u),b=h==St?u.constructor:n,E=b?Ja(b):"";if(E)switch(E){case koe:return Xe;case Moe:return Fe;case Doe:return vt;case Toe:return Zt;case Aoe:return fe}return h});function Gse(u,h,b){for(var E=-1,T=b.length;++E<T;){var R=b[E],z=R.size;switch(R.type){case"drop":u+=z;break;case"dropRight":h-=z;break;case"take":h=Kn(h,u+z);break;case"takeRight":u=On(u,h-z);break}}return{start:u,end:h}}function Yse(u){var h=u.match(Dd);return h?h[1].split(D):[]}function cI(u,h,b){h=Ps(h,u);for(var E=-1,T=h.length,R=!1;++E<T;){var z=to(h[E]);if(!(R=u!=null&&b(u,z)))break;u=u[z]}return R||++E!=T?R:(T=u==null?0:u.length,!!T&&Hg(T)&&Do(z,T)&&(rt(u)||Za(u)))}function Kse(u){var h=u.length,b=new u.constructor(h);return h&&typeof u[0]=="string"&&$t.call(u,"index")&&(b.index=u.index,b.input=u.input),b}function uI(u){return typeof u.constructor=="function"&&!Hd(u)?wc(mg(u)):{}}function Xse(u,h,b){var E=u.constructor;switch(h){case Le:return u1(u);case re:case ee:return new E(+u);case Xe:return Ise(u,b);case yt:case hn:case Cn:case Fn:case Br:case Vr:case pn:case mr:case jn:return U5(u,b);case Fe:return new E;case He:case Dn:return new E(u);case tn:return Nse(u);case Zt:return new E;case fn:return Rse(u)}}function Qse(u,h){var b=h.length;if(!b)return u;var E=b-1;return h[E]=(b>1?"& ":"")+h[E],h=h.join(b>2?", ":" "),u.replace(Md,`{
|
|
66
|
+
*/lf.exports,function(e,t){(function(){var n,r="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",a="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",c=500,d="__lodash_placeholder__",f=1,g=2,p=4,v=1,y=2,x=1,w=2,S=4,C=8,P=16,O=32,k=64,A=128,L=256,F=512,j=30,B="...",V=800,K=16,Y=1,$=2,Z=3,U=1/0,ie=9007199254740991,le=17976931348623157e292,M=NaN,H=4294967295,ne=H-1,N=H>>>1,X=[["ary",A],["bind",x],["bindKey",w],["curry",C],["curryRight",P],["flip",F],["partial",O],["partialRight",k],["rearg",L]],me="[object Arguments]",he="[object Array]",de="[object AsyncFunction]",re="[object Boolean]",ee="[object Date]",W="[object DOMException]",ye="[object Error]",oe="[object Function]",Te="[object GeneratorFunction]",Fe="[object Map]",He="[object Number]",Ke="[object Null]",St="[object Object]",vt="[object Promise]",bt="[object Proxy]",tn="[object RegExp]",Zt="[object Set]",Dn="[object String]",fn="[object Symbol]",Ra="[object Undefined]",fe="[object WeakMap]",Oe="[object WeakSet]",Le="[object ArrayBuffer]",Xe="[object DataView]",yt="[object Float32Array]",hn="[object Float64Array]",Cn="[object Int8Array]",Fn="[object Int16Array]",Br="[object Int32Array]",Vr="[object Uint8Array]",pn="[object Uint8ClampedArray]",mr="[object Uint16Array]",jn="[object Uint32Array]",Ed=/\b__p \+= '';/g,So=/\b(__p \+=) '' \+/g,La=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Yn=/&(?:amp|lt|gt|quot|#39);/g,Ji=/[&<>"']/g,Co=RegExp(Yn.source),$a=RegExp(Ji.source),Od=/<%-([\s\S]+?)%>/g,Fa=/<%([\s\S]+?)%>/g,fc=/<%=([\s\S]+?)%>/g,ja=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,za=/^\w*$/,Pd=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ba=/[\\^$.*+?()[\]{}|]/g,Va=RegExp(Ba.source),Ha=/^\s+/,kd=/\s/,Md=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Dd=/\{\n\/\* \[wrapped with (.+)\] \*/,D=/,? & /,G=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,se=/[()=,{}\[\]\/\s]/,Se=/\\(\\)?/g,Re=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,je=/\w*$/,Ae=/^[-+]0x[0-9a-f]+$/i,Me=/^0b[01]+$/i,Pt=/^\[object .+?Constructor\]$/,Je=/^0o[0-7]+$/i,nt=/^(?:0|[1-9]\d*)$/,zt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Tn=/($^)/,Wa=/['\n\r\u2028\u2029\\]/g,nn="\\ud800-\\udfff",hie="\\u0300-\\u036f",pie="\\ufe20-\\ufe2f",gie="\\u20d0-\\u20ff",MA=hie+pie+gie,DA="\\u2700-\\u27bf",TA="a-z\\xdf-\\xf6\\xf8-\\xff",mie="\\xac\\xb1\\xd7\\xf7",vie="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",bie="\\u2000-\\u206f",yie=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",AA="A-Z\\xc0-\\xd6\\xd8-\\xde",IA="\\ufe0e\\ufe0f",NA=mie+vie+bie+yie,Px="['’]",xie="["+nn+"]",RA="["+NA+"]",sg="["+MA+"]",LA="\\d+",wie="["+DA+"]",$A="["+TA+"]",FA="[^"+nn+NA+LA+DA+TA+AA+"]",kx="\\ud83c[\\udffb-\\udfff]",_ie="(?:"+sg+"|"+kx+")",jA="[^"+nn+"]",Mx="(?:\\ud83c[\\udde6-\\uddff]){2}",Dx="[\\ud800-\\udbff][\\udc00-\\udfff]",hc="["+AA+"]",zA="\\u200d",BA="(?:"+$A+"|"+FA+")",Sie="(?:"+hc+"|"+FA+")",VA="(?:"+Px+"(?:d|ll|m|re|s|t|ve))?",HA="(?:"+Px+"(?:D|LL|M|RE|S|T|VE))?",WA=_ie+"?",qA="["+IA+"]?",Cie="(?:"+zA+"(?:"+[jA,Mx,Dx].join("|")+")"+qA+WA+")*",Eie="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Oie="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",UA=qA+WA+Cie,Pie="(?:"+[wie,Mx,Dx].join("|")+")"+UA,kie="(?:"+[jA+sg+"?",sg,Mx,Dx,xie].join("|")+")",Mie=RegExp(Px,"g"),Die=RegExp(sg,"g"),Tx=RegExp(kx+"(?="+kx+")|"+kie+UA,"g"),Tie=RegExp([hc+"?"+$A+"+"+VA+"(?="+[RA,hc,"$"].join("|")+")",Sie+"+"+HA+"(?="+[RA,hc+BA,"$"].join("|")+")",hc+"?"+BA+"+"+VA,hc+"+"+HA,Oie,Eie,LA,Pie].join("|"),"g"),Aie=RegExp("["+zA+nn+MA+IA+"]"),Iie=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Nie=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Rie=-1,en={};en[yt]=en[hn]=en[Cn]=en[Fn]=en[Br]=en[Vr]=en[pn]=en[mr]=en[jn]=!0,en[me]=en[he]=en[Le]=en[re]=en[Xe]=en[ee]=en[ye]=en[oe]=en[Fe]=en[He]=en[St]=en[tn]=en[Zt]=en[Dn]=en[fe]=!1;var qt={};qt[me]=qt[he]=qt[Le]=qt[Xe]=qt[re]=qt[ee]=qt[yt]=qt[hn]=qt[Cn]=qt[Fn]=qt[Br]=qt[Fe]=qt[He]=qt[St]=qt[tn]=qt[Zt]=qt[Dn]=qt[fn]=qt[Vr]=qt[pn]=qt[mr]=qt[jn]=!0,qt[ye]=qt[oe]=qt[fe]=!1;var Lie={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},$ie={"&":"&","<":"<",">":">",'"':""","'":"'"},Fie={"&":"&","<":"<",">":">",""":'"',"'":"'"},jie={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},zie=parseFloat,Bie=parseInt,GA=typeof Ro=="object"&&Ro&&Ro.Object===Object&&Ro,Vie=typeof self=="object"&&self&&self.Object===Object&&self,zn=GA||Vie||Function("return this")(),Ax=t&&!t.nodeType&&t,qa=Ax&&!0&&e&&!e.nodeType&&e,YA=qa&&qa.exports===Ax,Ix=YA&&GA.process,si=function(){try{var Q=qa&&qa.require&&qa.require("util").types;return Q||Ix&&Ix.binding&&Ix.binding("util")}catch{}}(),KA=si&&si.isArrayBuffer,XA=si&&si.isDate,QA=si&&si.isMap,JA=si&&si.isRegExp,ZA=si&&si.isSet,e5=si&&si.isTypedArray;function Hr(Q,pe,ce){switch(ce.length){case 0:return Q.call(pe);case 1:return Q.call(pe,ce[0]);case 2:return Q.call(pe,ce[0],ce[1]);case 3:return Q.call(pe,ce[0],ce[1],ce[2])}return Q.apply(pe,ce)}function Hie(Q,pe,ce,Ne){for(var Ze=-1,Tt=Q==null?0:Q.length;++Ze<Tt;){var En=Q[Ze];pe(Ne,En,ce(En),Q)}return Ne}function ai(Q,pe){for(var ce=-1,Ne=Q==null?0:Q.length;++ce<Ne&&pe(Q[ce],ce,Q)!==!1;);return Q}function Wie(Q,pe){for(var ce=Q==null?0:Q.length;ce--&&pe(Q[ce],ce,Q)!==!1;);return Q}function t5(Q,pe){for(var ce=-1,Ne=Q==null?0:Q.length;++ce<Ne;)if(!pe(Q[ce],ce,Q))return!1;return!0}function ws(Q,pe){for(var ce=-1,Ne=Q==null?0:Q.length,Ze=0,Tt=[];++ce<Ne;){var En=Q[ce];pe(En,ce,Q)&&(Tt[Ze++]=En)}return Tt}function ag(Q,pe){var ce=Q==null?0:Q.length;return!!ce&&pc(Q,pe,0)>-1}function Nx(Q,pe,ce){for(var Ne=-1,Ze=Q==null?0:Q.length;++Ne<Ze;)if(ce(pe,Q[Ne]))return!0;return!1}function rn(Q,pe){for(var ce=-1,Ne=Q==null?0:Q.length,Ze=Array(Ne);++ce<Ne;)Ze[ce]=pe(Q[ce],ce,Q);return Ze}function _s(Q,pe){for(var ce=-1,Ne=pe.length,Ze=Q.length;++ce<Ne;)Q[Ze+ce]=pe[ce];return Q}function Rx(Q,pe,ce,Ne){var Ze=-1,Tt=Q==null?0:Q.length;for(Ne&&Tt&&(ce=Q[++Ze]);++Ze<Tt;)ce=pe(ce,Q[Ze],Ze,Q);return ce}function qie(Q,pe,ce,Ne){var Ze=Q==null?0:Q.length;for(Ne&&Ze&&(ce=Q[--Ze]);Ze--;)ce=pe(ce,Q[Ze],Ze,Q);return ce}function Lx(Q,pe){for(var ce=-1,Ne=Q==null?0:Q.length;++ce<Ne;)if(pe(Q[ce],ce,Q))return!0;return!1}var Uie=$x("length");function Gie(Q){return Q.split("")}function Yie(Q){return Q.match(G)||[]}function n5(Q,pe,ce){var Ne;return ce(Q,function(Ze,Tt,En){if(pe(Ze,Tt,En))return Ne=Tt,!1}),Ne}function lg(Q,pe,ce,Ne){for(var Ze=Q.length,Tt=ce+(Ne?1:-1);Ne?Tt--:++Tt<Ze;)if(pe(Q[Tt],Tt,Q))return Tt;return-1}function pc(Q,pe,ce){return pe===pe?soe(Q,pe,ce):lg(Q,r5,ce)}function Kie(Q,pe,ce,Ne){for(var Ze=ce-1,Tt=Q.length;++Ze<Tt;)if(Ne(Q[Ze],pe))return Ze;return-1}function r5(Q){return Q!==Q}function i5(Q,pe){var ce=Q==null?0:Q.length;return ce?jx(Q,pe)/ce:M}function $x(Q){return function(pe){return pe==null?n:pe[Q]}}function Fx(Q){return function(pe){return Q==null?n:Q[pe]}}function o5(Q,pe,ce,Ne,Ze){return Ze(Q,function(Tt,En,Bt){ce=Ne?(Ne=!1,Tt):pe(ce,Tt,En,Bt)}),ce}function Xie(Q,pe){var ce=Q.length;for(Q.sort(pe);ce--;)Q[ce]=Q[ce].value;return Q}function jx(Q,pe){for(var ce,Ne=-1,Ze=Q.length;++Ne<Ze;){var Tt=pe(Q[Ne]);Tt!==n&&(ce=ce===n?Tt:ce+Tt)}return ce}function zx(Q,pe){for(var ce=-1,Ne=Array(Q);++ce<Q;)Ne[ce]=pe(ce);return Ne}function Qie(Q,pe){return rn(pe,function(ce){return[ce,Q[ce]]})}function s5(Q){return Q&&Q.slice(0,u5(Q)+1).replace(Ha,"")}function Wr(Q){return function(pe){return Q(pe)}}function Bx(Q,pe){return rn(pe,function(ce){return Q[ce]})}function Td(Q,pe){return Q.has(pe)}function a5(Q,pe){for(var ce=-1,Ne=Q.length;++ce<Ne&&pc(pe,Q[ce],0)>-1;);return ce}function l5(Q,pe){for(var ce=Q.length;ce--&&pc(pe,Q[ce],0)>-1;);return ce}function Jie(Q,pe){for(var ce=Q.length,Ne=0;ce--;)Q[ce]===pe&&++Ne;return Ne}var Zie=Fx(Lie),eoe=Fx($ie);function toe(Q){return"\\"+jie[Q]}function noe(Q,pe){return Q==null?n:Q[pe]}function gc(Q){return Aie.test(Q)}function roe(Q){return Iie.test(Q)}function ioe(Q){for(var pe,ce=[];!(pe=Q.next()).done;)ce.push(pe.value);return ce}function Vx(Q){var pe=-1,ce=Array(Q.size);return Q.forEach(function(Ne,Ze){ce[++pe]=[Ze,Ne]}),ce}function c5(Q,pe){return function(ce){return Q(pe(ce))}}function Ss(Q,pe){for(var ce=-1,Ne=Q.length,Ze=0,Tt=[];++ce<Ne;){var En=Q[ce];(En===pe||En===d)&&(Q[ce]=d,Tt[Ze++]=ce)}return Tt}function cg(Q){var pe=-1,ce=Array(Q.size);return Q.forEach(function(Ne){ce[++pe]=Ne}),ce}function ooe(Q){var pe=-1,ce=Array(Q.size);return Q.forEach(function(Ne){ce[++pe]=[Ne,Ne]}),ce}function soe(Q,pe,ce){for(var Ne=ce-1,Ze=Q.length;++Ne<Ze;)if(Q[Ne]===pe)return Ne;return-1}function aoe(Q,pe,ce){for(var Ne=ce+1;Ne--;)if(Q[Ne]===pe)return Ne;return Ne}function mc(Q){return gc(Q)?coe(Q):Uie(Q)}function Ci(Q){return gc(Q)?uoe(Q):Gie(Q)}function u5(Q){for(var pe=Q.length;pe--&&kd.test(Q.charAt(pe)););return pe}var loe=Fx(Fie);function coe(Q){for(var pe=Tx.lastIndex=0;Tx.test(Q);)++pe;return pe}function uoe(Q){return Q.match(Tx)||[]}function doe(Q){return Q.match(Tie)||[]}var foe=function Q(pe){pe=pe==null?zn:vc.defaults(zn.Object(),pe,vc.pick(zn,Nie));var ce=pe.Array,Ne=pe.Date,Ze=pe.Error,Tt=pe.Function,En=pe.Math,Bt=pe.Object,Hx=pe.RegExp,hoe=pe.String,li=pe.TypeError,ug=ce.prototype,poe=Tt.prototype,bc=Bt.prototype,dg=pe["__core-js_shared__"],fg=poe.toString,$t=bc.hasOwnProperty,goe=0,d5=function(){var u=/[^.]+$/.exec(dg&&dg.keys&&dg.keys.IE_PROTO||"");return u?"Symbol(src)_1."+u:""}(),hg=bc.toString,moe=fg.call(Bt),voe=zn._,boe=Hx("^"+fg.call($t).replace(Ba,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),pg=YA?pe.Buffer:n,Cs=pe.Symbol,gg=pe.Uint8Array,f5=pg?pg.allocUnsafe:n,mg=c5(Bt.getPrototypeOf,Bt),h5=Bt.create,p5=bc.propertyIsEnumerable,vg=ug.splice,g5=Cs?Cs.isConcatSpreadable:n,Ad=Cs?Cs.iterator:n,Ua=Cs?Cs.toStringTag:n,bg=function(){try{var u=Qa(Bt,"defineProperty");return u({},"",{}),u}catch{}}(),yoe=pe.clearTimeout!==zn.clearTimeout&&pe.clearTimeout,xoe=Ne&&Ne.now!==zn.Date.now&&Ne.now,woe=pe.setTimeout!==zn.setTimeout&&pe.setTimeout,yg=En.ceil,xg=En.floor,Wx=Bt.getOwnPropertySymbols,_oe=pg?pg.isBuffer:n,m5=pe.isFinite,Soe=ug.join,Coe=c5(Bt.keys,Bt),On=En.max,Kn=En.min,Eoe=Ne.now,Ooe=pe.parseInt,v5=En.random,Poe=ug.reverse,qx=Qa(pe,"DataView"),Id=Qa(pe,"Map"),Ux=Qa(pe,"Promise"),yc=Qa(pe,"Set"),Nd=Qa(pe,"WeakMap"),Rd=Qa(Bt,"create"),wg=Nd&&new Nd,xc={},koe=Ja(qx),Moe=Ja(Id),Doe=Ja(Ux),Toe=Ja(yc),Aoe=Ja(Nd),_g=Cs?Cs.prototype:n,Ld=_g?_g.valueOf:n,b5=_g?_g.toString:n;function I(u){if(cn(u)&&!rt(u)&&!(u instanceof Ct)){if(u instanceof ci)return u;if($t.call(u,"__wrapped__"))return yI(u)}return new ci(u)}var wc=function(){function u(){}return function(h){if(!sn(h))return{};if(h5)return h5(h);u.prototype=h;var b=new u;return u.prototype=n,b}}();function Sg(){}function ci(u,h){this.__wrapped__=u,this.__actions__=[],this.__chain__=!!h,this.__index__=0,this.__values__=n}I.templateSettings={escape:Od,evaluate:Fa,interpolate:fc,variable:"",imports:{_:I}},I.prototype=Sg.prototype,I.prototype.constructor=I,ci.prototype=wc(Sg.prototype),ci.prototype.constructor=ci;function Ct(u){this.__wrapped__=u,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=H,this.__views__=[]}function Ioe(){var u=new Ct(this.__wrapped__);return u.__actions__=vr(this.__actions__),u.__dir__=this.__dir__,u.__filtered__=this.__filtered__,u.__iteratees__=vr(this.__iteratees__),u.__takeCount__=this.__takeCount__,u.__views__=vr(this.__views__),u}function Noe(){if(this.__filtered__){var u=new Ct(this);u.__dir__=-1,u.__filtered__=!0}else u=this.clone(),u.__dir__*=-1;return u}function Roe(){var u=this.__wrapped__.value(),h=this.__dir__,b=rt(u),E=h<0,T=b?u.length:0,R=Gse(0,T,this.__views__),z=R.start,q=R.end,te=q-z,ve=E?q:z-1,be=this.__iteratees__,we=be.length,De=0,$e=Kn(te,this.__takeCount__);if(!b||!E&&T==te&&$e==te)return V5(u,this.__actions__);var We=[];e:for(;te--&&De<$e;){ve+=h;for(var ft=-1,qe=u[ve];++ft<we;){var _t=be[ft],Et=_t.iteratee,Gr=_t.type,rr=Et(qe);if(Gr==$)qe=rr;else if(!rr){if(Gr==Y)continue e;break e}}We[De++]=qe}return We}Ct.prototype=wc(Sg.prototype),Ct.prototype.constructor=Ct;function Ga(u){var h=-1,b=u==null?0:u.length;for(this.clear();++h<b;){var E=u[h];this.set(E[0],E[1])}}function Loe(){this.__data__=Rd?Rd(null):{},this.size=0}function $oe(u){var h=this.has(u)&&delete this.__data__[u];return this.size-=h?1:0,h}function Foe(u){var h=this.__data__;if(Rd){var b=h[u];return b===l?n:b}return $t.call(h,u)?h[u]:n}function joe(u){var h=this.__data__;return Rd?h[u]!==n:$t.call(h,u)}function zoe(u,h){var b=this.__data__;return this.size+=this.has(u)?0:1,b[u]=Rd&&h===n?l:h,this}Ga.prototype.clear=Loe,Ga.prototype.delete=$oe,Ga.prototype.get=Foe,Ga.prototype.has=joe,Ga.prototype.set=zoe;function Eo(u){var h=-1,b=u==null?0:u.length;for(this.clear();++h<b;){var E=u[h];this.set(E[0],E[1])}}function Boe(){this.__data__=[],this.size=0}function Voe(u){var h=this.__data__,b=Cg(h,u);if(b<0)return!1;var E=h.length-1;return b==E?h.pop():vg.call(h,b,1),--this.size,!0}function Hoe(u){var h=this.__data__,b=Cg(h,u);return b<0?n:h[b][1]}function Woe(u){return Cg(this.__data__,u)>-1}function qoe(u,h){var b=this.__data__,E=Cg(b,u);return E<0?(++this.size,b.push([u,h])):b[E][1]=h,this}Eo.prototype.clear=Boe,Eo.prototype.delete=Voe,Eo.prototype.get=Hoe,Eo.prototype.has=Woe,Eo.prototype.set=qoe;function Oo(u){var h=-1,b=u==null?0:u.length;for(this.clear();++h<b;){var E=u[h];this.set(E[0],E[1])}}function Uoe(){this.size=0,this.__data__={hash:new Ga,map:new(Id||Eo),string:new Ga}}function Goe(u){var h=Lg(this,u).delete(u);return this.size-=h?1:0,h}function Yoe(u){return Lg(this,u).get(u)}function Koe(u){return Lg(this,u).has(u)}function Xoe(u,h){var b=Lg(this,u),E=b.size;return b.set(u,h),this.size+=b.size==E?0:1,this}Oo.prototype.clear=Uoe,Oo.prototype.delete=Goe,Oo.prototype.get=Yoe,Oo.prototype.has=Koe,Oo.prototype.set=Xoe;function Ya(u){var h=-1,b=u==null?0:u.length;for(this.__data__=new Oo;++h<b;)this.add(u[h])}function Qoe(u){return this.__data__.set(u,l),this}function Joe(u){return this.__data__.has(u)}Ya.prototype.add=Ya.prototype.push=Qoe,Ya.prototype.has=Joe;function Ei(u){var h=this.__data__=new Eo(u);this.size=h.size}function Zoe(){this.__data__=new Eo,this.size=0}function ese(u){var h=this.__data__,b=h.delete(u);return this.size=h.size,b}function tse(u){return this.__data__.get(u)}function nse(u){return this.__data__.has(u)}function rse(u,h){var b=this.__data__;if(b instanceof Eo){var E=b.__data__;if(!Id||E.length<i-1)return E.push([u,h]),this.size=++b.size,this;b=this.__data__=new Oo(E)}return b.set(u,h),this.size=b.size,this}Ei.prototype.clear=Zoe,Ei.prototype.delete=ese,Ei.prototype.get=tse,Ei.prototype.has=nse,Ei.prototype.set=rse;function y5(u,h){var b=rt(u),E=!b&&Za(u),T=!b&&!E&&Ms(u),R=!b&&!E&&!T&&Ec(u),z=b||E||T||R,q=z?zx(u.length,hoe):[],te=q.length;for(var ve in u)(h||$t.call(u,ve))&&!(z&&(ve=="length"||T&&(ve=="offset"||ve=="parent")||R&&(ve=="buffer"||ve=="byteLength"||ve=="byteOffset")||Do(ve,te)))&&q.push(ve);return q}function x5(u){var h=u.length;return h?u[r1(0,h-1)]:n}function ise(u,h){return $g(vr(u),Ka(h,0,u.length))}function ose(u){return $g(vr(u))}function Gx(u,h,b){(b!==n&&!Oi(u[h],b)||b===n&&!(h in u))&&Po(u,h,b)}function $d(u,h,b){var E=u[h];(!($t.call(u,h)&&Oi(E,b))||b===n&&!(h in u))&&Po(u,h,b)}function Cg(u,h){for(var b=u.length;b--;)if(Oi(u[b][0],h))return b;return-1}function sse(u,h,b,E){return Es(u,function(T,R,z){h(E,T,b(T),z)}),E}function w5(u,h){return u&&eo(h,An(h),u)}function ase(u,h){return u&&eo(h,yr(h),u)}function Po(u,h,b){h=="__proto__"&&bg?bg(u,h,{configurable:!0,enumerable:!0,value:b,writable:!0}):u[h]=b}function Yx(u,h){for(var b=-1,E=h.length,T=ce(E),R=u==null;++b<E;)T[b]=R?n:k1(u,h[b]);return T}function Ka(u,h,b){return u===u&&(b!==n&&(u=u<=b?u:b),h!==n&&(u=u>=h?u:h)),u}function ui(u,h,b,E,T,R){var z,q=h&f,te=h&g,ve=h&p;if(b&&(z=T?b(u,E,T,R):b(u)),z!==n)return z;if(!sn(u))return u;var be=rt(u);if(be){if(z=Kse(u),!q)return vr(u,z)}else{var we=Xn(u),De=we==oe||we==Te;if(Ms(u))return q5(u,q);if(we==St||we==me||De&&!T){if(z=te||De?{}:uI(u),!q)return te?Fse(u,ase(z,u)):$se(u,w5(z,u))}else{if(!qt[we])return T?u:{};z=Xse(u,we,q)}}R||(R=new Ei);var $e=R.get(u);if($e)return $e;R.set(u,z),jI(u)?u.forEach(function(qe){z.add(ui(qe,h,b,qe,u,R))}):$I(u)&&u.forEach(function(qe,_t){z.set(_t,ui(qe,h,b,_t,u,R))});var We=ve?te?p1:h1:te?yr:An,ft=be?n:We(u);return ai(ft||u,function(qe,_t){ft&&(_t=qe,qe=u[_t]),$d(z,_t,ui(qe,h,b,_t,u,R))}),z}function lse(u){var h=An(u);return function(b){return _5(b,u,h)}}function _5(u,h,b){var E=b.length;if(u==null)return!E;for(u=Bt(u);E--;){var T=b[E],R=h[T],z=u[T];if(z===n&&!(T in u)||!R(z))return!1}return!0}function S5(u,h,b){if(typeof u!="function")throw new li(s);return Wd(function(){u.apply(n,b)},h)}function Fd(u,h,b,E){var T=-1,R=ag,z=!0,q=u.length,te=[],ve=h.length;if(!q)return te;b&&(h=rn(h,Wr(b))),E?(R=Nx,z=!1):h.length>=i&&(R=Td,z=!1,h=new Ya(h));e:for(;++T<q;){var be=u[T],we=b==null?be:b(be);if(be=E||be!==0?be:0,z&&we===we){for(var De=ve;De--;)if(h[De]===we)continue e;te.push(be)}else R(h,we,E)||te.push(be)}return te}var Es=X5(Zi),C5=X5(Xx,!0);function cse(u,h){var b=!0;return Es(u,function(E,T,R){return b=!!h(E,T,R),b}),b}function Eg(u,h,b){for(var E=-1,T=u.length;++E<T;){var R=u[E],z=h(R);if(z!=null&&(q===n?z===z&&!Ur(z):b(z,q)))var q=z,te=R}return te}function use(u,h,b,E){var T=u.length;for(b=ct(b),b<0&&(b=-b>T?0:T+b),E=E===n||E>T?T:ct(E),E<0&&(E+=T),E=b>E?0:BI(E);b<E;)u[b++]=h;return u}function E5(u,h){var b=[];return Es(u,function(E,T,R){h(E,T,R)&&b.push(E)}),b}function Bn(u,h,b,E,T){var R=-1,z=u.length;for(b||(b=Jse),T||(T=[]);++R<z;){var q=u[R];h>0&&b(q)?h>1?Bn(q,h-1,b,E,T):_s(T,q):E||(T[T.length]=q)}return T}var Kx=Q5(),O5=Q5(!0);function Zi(u,h){return u&&Kx(u,h,An)}function Xx(u,h){return u&&O5(u,h,An)}function Og(u,h){return ws(h,function(b){return To(u[b])})}function Xa(u,h){h=Ps(h,u);for(var b=0,E=h.length;u!=null&&b<E;)u=u[to(h[b++])];return b&&b==E?u:n}function P5(u,h,b){var E=h(u);return rt(u)?E:_s(E,b(u))}function tr(u){return u==null?u===n?Ra:Ke:Ua&&Ua in Bt(u)?Use(u):oae(u)}function Qx(u,h){return u>h}function dse(u,h){return u!=null&&$t.call(u,h)}function fse(u,h){return u!=null&&h in Bt(u)}function hse(u,h,b){return u>=Kn(h,b)&&u<On(h,b)}function Jx(u,h,b){for(var E=b?Nx:ag,T=u[0].length,R=u.length,z=R,q=ce(R),te=1/0,ve=[];z--;){var be=u[z];z&&h&&(be=rn(be,Wr(h))),te=Kn(be.length,te),q[z]=!b&&(h||T>=120&&be.length>=120)?new Ya(z&&be):n}be=u[0];var we=-1,De=q[0];e:for(;++we<T&&ve.length<te;){var $e=be[we],We=h?h($e):$e;if($e=b||$e!==0?$e:0,!(De?Td(De,We):E(ve,We,b))){for(z=R;--z;){var ft=q[z];if(!(ft?Td(ft,We):E(u[z],We,b)))continue e}De&&De.push(We),ve.push($e)}}return ve}function pse(u,h,b,E){return Zi(u,function(T,R,z){h(E,b(T),R,z)}),E}function jd(u,h,b){h=Ps(h,u),u=pI(u,h);var E=u==null?u:u[to(fi(h))];return E==null?n:Hr(E,u,b)}function k5(u){return cn(u)&&tr(u)==me}function gse(u){return cn(u)&&tr(u)==Le}function mse(u){return cn(u)&&tr(u)==ee}function zd(u,h,b,E,T){return u===h?!0:u==null||h==null||!cn(u)&&!cn(h)?u!==u&&h!==h:vse(u,h,b,E,zd,T)}function vse(u,h,b,E,T,R){var z=rt(u),q=rt(h),te=z?he:Xn(u),ve=q?he:Xn(h);te=te==me?St:te,ve=ve==me?St:ve;var be=te==St,we=ve==St,De=te==ve;if(De&&Ms(u)){if(!Ms(h))return!1;z=!0,be=!1}if(De&&!be)return R||(R=new Ei),z||Ec(u)?aI(u,h,b,E,T,R):Wse(u,h,te,b,E,T,R);if(!(b&v)){var $e=be&&$t.call(u,"__wrapped__"),We=we&&$t.call(h,"__wrapped__");if($e||We){var ft=$e?u.value():u,qe=We?h.value():h;return R||(R=new Ei),T(ft,qe,b,E,R)}}return De?(R||(R=new Ei),qse(u,h,b,E,T,R)):!1}function bse(u){return cn(u)&&Xn(u)==Fe}function Zx(u,h,b,E){var T=b.length,R=T,z=!E;if(u==null)return!R;for(u=Bt(u);T--;){var q=b[T];if(z&&q[2]?q[1]!==u[q[0]]:!(q[0]in u))return!1}for(;++T<R;){q=b[T];var te=q[0],ve=u[te],be=q[1];if(z&&q[2]){if(ve===n&&!(te in u))return!1}else{var we=new Ei;if(E)var De=E(ve,be,te,u,h,we);if(!(De===n?zd(be,ve,v|y,E,we):De))return!1}}return!0}function M5(u){if(!sn(u)||eae(u))return!1;var h=To(u)?boe:Pt;return h.test(Ja(u))}function yse(u){return cn(u)&&tr(u)==tn}function xse(u){return cn(u)&&Xn(u)==Zt}function wse(u){return cn(u)&&Hg(u.length)&&!!en[tr(u)]}function D5(u){return typeof u=="function"?u:u==null?xr:typeof u=="object"?rt(u)?I5(u[0],u[1]):A5(u):JI(u)}function e1(u){if(!Hd(u))return Coe(u);var h=[];for(var b in Bt(u))$t.call(u,b)&&b!="constructor"&&h.push(b);return h}function _se(u){if(!sn(u))return iae(u);var h=Hd(u),b=[];for(var E in u)E=="constructor"&&(h||!$t.call(u,E))||b.push(E);return b}function t1(u,h){return u<h}function T5(u,h){var b=-1,E=br(u)?ce(u.length):[];return Es(u,function(T,R,z){E[++b]=h(T,R,z)}),E}function A5(u){var h=m1(u);return h.length==1&&h[0][2]?fI(h[0][0],h[0][1]):function(b){return b===u||Zx(b,u,h)}}function I5(u,h){return b1(u)&&dI(h)?fI(to(u),h):function(b){var E=k1(b,u);return E===n&&E===h?M1(b,u):zd(h,E,v|y)}}function Pg(u,h,b,E,T){u!==h&&Kx(h,function(R,z){if(T||(T=new Ei),sn(R))Sse(u,h,z,b,Pg,E,T);else{var q=E?E(x1(u,z),R,z+"",u,h,T):n;q===n&&(q=R),Gx(u,z,q)}},yr)}function Sse(u,h,b,E,T,R,z){var q=x1(u,b),te=x1(h,b),ve=z.get(te);if(ve){Gx(u,b,ve);return}var be=R?R(q,te,b+"",u,h,z):n,we=be===n;if(we){var De=rt(te),$e=!De&&Ms(te),We=!De&&!$e&&Ec(te);be=te,De||$e||We?rt(q)?be=q:gn(q)?be=vr(q):$e?(we=!1,be=q5(te,!0)):We?(we=!1,be=U5(te,!0)):be=[]:qd(te)||Za(te)?(be=q,Za(q)?be=VI(q):(!sn(q)||To(q))&&(be=uI(te))):we=!1}we&&(z.set(te,be),T(be,te,E,R,z),z.delete(te)),Gx(u,b,be)}function N5(u,h){var b=u.length;if(b)return h+=h<0?b:0,Do(h,b)?u[h]:n}function R5(u,h,b){h.length?h=rn(h,function(R){return rt(R)?function(z){return Xa(z,R.length===1?R[0]:R)}:R}):h=[xr];var E=-1;h=rn(h,Wr(Ve()));var T=T5(u,function(R,z,q){var te=rn(h,function(ve){return ve(R)});return{criteria:te,index:++E,value:R}});return Xie(T,function(R,z){return Lse(R,z,b)})}function Cse(u,h){return L5(u,h,function(b,E){return M1(u,E)})}function L5(u,h,b){for(var E=-1,T=h.length,R={};++E<T;){var z=h[E],q=Xa(u,z);b(q,z)&&Bd(R,Ps(z,u),q)}return R}function Ese(u){return function(h){return Xa(h,u)}}function n1(u,h,b,E){var T=E?Kie:pc,R=-1,z=h.length,q=u;for(u===h&&(h=vr(h)),b&&(q=rn(u,Wr(b)));++R<z;)for(var te=0,ve=h[R],be=b?b(ve):ve;(te=T(q,be,te,E))>-1;)q!==u&&vg.call(q,te,1),vg.call(u,te,1);return u}function $5(u,h){for(var b=u?h.length:0,E=b-1;b--;){var T=h[b];if(b==E||T!==R){var R=T;Do(T)?vg.call(u,T,1):s1(u,T)}}return u}function r1(u,h){return u+xg(v5()*(h-u+1))}function Ose(u,h,b,E){for(var T=-1,R=On(yg((h-u)/(b||1)),0),z=ce(R);R--;)z[E?R:++T]=u,u+=b;return z}function i1(u,h){var b="";if(!u||h<1||h>ie)return b;do h%2&&(b+=u),h=xg(h/2),h&&(u+=u);while(h);return b}function ht(u,h){return w1(hI(u,h,xr),u+"")}function Pse(u){return x5(Oc(u))}function kse(u,h){var b=Oc(u);return $g(b,Ka(h,0,b.length))}function Bd(u,h,b,E){if(!sn(u))return u;h=Ps(h,u);for(var T=-1,R=h.length,z=R-1,q=u;q!=null&&++T<R;){var te=to(h[T]),ve=b;if(te==="__proto__"||te==="constructor"||te==="prototype")return u;if(T!=z){var be=q[te];ve=E?E(be,te,q):n,ve===n&&(ve=sn(be)?be:Do(h[T+1])?[]:{})}$d(q,te,ve),q=q[te]}return u}var F5=wg?function(u,h){return wg.set(u,h),u}:xr,Mse=bg?function(u,h){return bg(u,"toString",{configurable:!0,enumerable:!1,value:T1(h),writable:!0})}:xr;function Dse(u){return $g(Oc(u))}function di(u,h,b){var E=-1,T=u.length;h<0&&(h=-h>T?0:T+h),b=b>T?T:b,b<0&&(b+=T),T=h>b?0:b-h>>>0,h>>>=0;for(var R=ce(T);++E<T;)R[E]=u[E+h];return R}function Tse(u,h){var b;return Es(u,function(E,T,R){return b=h(E,T,R),!b}),!!b}function kg(u,h,b){var E=0,T=u==null?E:u.length;if(typeof h=="number"&&h===h&&T<=N){for(;E<T;){var R=E+T>>>1,z=u[R];z!==null&&!Ur(z)&&(b?z<=h:z<h)?E=R+1:T=R}return T}return o1(u,h,xr,b)}function o1(u,h,b,E){var T=0,R=u==null?0:u.length;if(R===0)return 0;h=b(h);for(var z=h!==h,q=h===null,te=Ur(h),ve=h===n;T<R;){var be=xg((T+R)/2),we=b(u[be]),De=we!==n,$e=we===null,We=we===we,ft=Ur(we);if(z)var qe=E||We;else ve?qe=We&&(E||De):q?qe=We&&De&&(E||!$e):te?qe=We&&De&&!$e&&(E||!ft):$e||ft?qe=!1:qe=E?we<=h:we<h;qe?T=be+1:R=be}return Kn(R,ne)}function j5(u,h){for(var b=-1,E=u.length,T=0,R=[];++b<E;){var z=u[b],q=h?h(z):z;if(!b||!Oi(q,te)){var te=q;R[T++]=z===0?0:z}}return R}function z5(u){return typeof u=="number"?u:Ur(u)?M:+u}function qr(u){if(typeof u=="string")return u;if(rt(u))return rn(u,qr)+"";if(Ur(u))return b5?b5.call(u):"";var h=u+"";return h=="0"&&1/u==-U?"-0":h}function Os(u,h,b){var E=-1,T=ag,R=u.length,z=!0,q=[],te=q;if(b)z=!1,T=Nx;else if(R>=i){var ve=h?null:Vse(u);if(ve)return cg(ve);z=!1,T=Td,te=new Ya}else te=h?[]:q;e:for(;++E<R;){var be=u[E],we=h?h(be):be;if(be=b||be!==0?be:0,z&&we===we){for(var De=te.length;De--;)if(te[De]===we)continue e;h&&te.push(we),q.push(be)}else T(te,we,b)||(te!==q&&te.push(we),q.push(be))}return q}function s1(u,h){return h=Ps(h,u),u=pI(u,h),u==null||delete u[to(fi(h))]}function B5(u,h,b,E){return Bd(u,h,b(Xa(u,h)),E)}function Mg(u,h,b,E){for(var T=u.length,R=E?T:-1;(E?R--:++R<T)&&h(u[R],R,u););return b?di(u,E?0:R,E?R+1:T):di(u,E?R+1:0,E?T:R)}function V5(u,h){var b=u;return b instanceof Ct&&(b=b.value()),Rx(h,function(E,T){return T.func.apply(T.thisArg,_s([E],T.args))},b)}function a1(u,h,b){var E=u.length;if(E<2)return E?Os(u[0]):[];for(var T=-1,R=ce(E);++T<E;)for(var z=u[T],q=-1;++q<E;)q!=T&&(R[T]=Fd(R[T]||z,u[q],h,b));return Os(Bn(R,1),h,b)}function H5(u,h,b){for(var E=-1,T=u.length,R=h.length,z={};++E<T;){var q=E<R?h[E]:n;b(z,u[E],q)}return z}function l1(u){return gn(u)?u:[]}function c1(u){return typeof u=="function"?u:xr}function Ps(u,h){return rt(u)?u:b1(u,h)?[u]:bI(Rt(u))}var Ase=ht;function ks(u,h,b){var E=u.length;return b=b===n?E:b,!h&&b>=E?u:di(u,h,b)}var W5=yoe||function(u){return zn.clearTimeout(u)};function q5(u,h){if(h)return u.slice();var b=u.length,E=f5?f5(b):new u.constructor(b);return u.copy(E),E}function u1(u){var h=new u.constructor(u.byteLength);return new gg(h).set(new gg(u)),h}function Ise(u,h){var b=h?u1(u.buffer):u.buffer;return new u.constructor(b,u.byteOffset,u.byteLength)}function Nse(u){var h=new u.constructor(u.source,je.exec(u));return h.lastIndex=u.lastIndex,h}function Rse(u){return Ld?Bt(Ld.call(u)):{}}function U5(u,h){var b=h?u1(u.buffer):u.buffer;return new u.constructor(b,u.byteOffset,u.length)}function G5(u,h){if(u!==h){var b=u!==n,E=u===null,T=u===u,R=Ur(u),z=h!==n,q=h===null,te=h===h,ve=Ur(h);if(!q&&!ve&&!R&&u>h||R&&z&&te&&!q&&!ve||E&&z&&te||!b&&te||!T)return 1;if(!E&&!R&&!ve&&u<h||ve&&b&&T&&!E&&!R||q&&b&&T||!z&&T||!te)return-1}return 0}function Lse(u,h,b){for(var E=-1,T=u.criteria,R=h.criteria,z=T.length,q=b.length;++E<z;){var te=G5(T[E],R[E]);if(te){if(E>=q)return te;var ve=b[E];return te*(ve=="desc"?-1:1)}}return u.index-h.index}function Y5(u,h,b,E){for(var T=-1,R=u.length,z=b.length,q=-1,te=h.length,ve=On(R-z,0),be=ce(te+ve),we=!E;++q<te;)be[q]=h[q];for(;++T<z;)(we||T<R)&&(be[b[T]]=u[T]);for(;ve--;)be[q++]=u[T++];return be}function K5(u,h,b,E){for(var T=-1,R=u.length,z=-1,q=b.length,te=-1,ve=h.length,be=On(R-q,0),we=ce(be+ve),De=!E;++T<be;)we[T]=u[T];for(var $e=T;++te<ve;)we[$e+te]=h[te];for(;++z<q;)(De||T<R)&&(we[$e+b[z]]=u[T++]);return we}function vr(u,h){var b=-1,E=u.length;for(h||(h=ce(E));++b<E;)h[b]=u[b];return h}function eo(u,h,b,E){var T=!b;b||(b={});for(var R=-1,z=h.length;++R<z;){var q=h[R],te=E?E(b[q],u[q],q,b,u):n;te===n&&(te=u[q]),T?Po(b,q,te):$d(b,q,te)}return b}function $se(u,h){return eo(u,v1(u),h)}function Fse(u,h){return eo(u,lI(u),h)}function Dg(u,h){return function(b,E){var T=rt(b)?Hie:sse,R=h?h():{};return T(b,u,Ve(E,2),R)}}function _c(u){return ht(function(h,b){var E=-1,T=b.length,R=T>1?b[T-1]:n,z=T>2?b[2]:n;for(R=u.length>3&&typeof R=="function"?(T--,R):n,z&&nr(b[0],b[1],z)&&(R=T<3?n:R,T=1),h=Bt(h);++E<T;){var q=b[E];q&&u(h,q,E,R)}return h})}function X5(u,h){return function(b,E){if(b==null)return b;if(!br(b))return u(b,E);for(var T=b.length,R=h?T:-1,z=Bt(b);(h?R--:++R<T)&&E(z[R],R,z)!==!1;);return b}}function Q5(u){return function(h,b,E){for(var T=-1,R=Bt(h),z=E(h),q=z.length;q--;){var te=z[u?q:++T];if(b(R[te],te,R)===!1)break}return h}}function jse(u,h,b){var E=h&x,T=Vd(u);function R(){var z=this&&this!==zn&&this instanceof R?T:u;return z.apply(E?b:this,arguments)}return R}function J5(u){return function(h){h=Rt(h);var b=gc(h)?Ci(h):n,E=b?b[0]:h.charAt(0),T=b?ks(b,1).join(""):h.slice(1);return E[u]()+T}}function Sc(u){return function(h){return Rx(XI(KI(h).replace(Mie,"")),u,"")}}function Vd(u){return function(){var h=arguments;switch(h.length){case 0:return new u;case 1:return new u(h[0]);case 2:return new u(h[0],h[1]);case 3:return new u(h[0],h[1],h[2]);case 4:return new u(h[0],h[1],h[2],h[3]);case 5:return new u(h[0],h[1],h[2],h[3],h[4]);case 6:return new u(h[0],h[1],h[2],h[3],h[4],h[5]);case 7:return new u(h[0],h[1],h[2],h[3],h[4],h[5],h[6])}var b=wc(u.prototype),E=u.apply(b,h);return sn(E)?E:b}}function zse(u,h,b){var E=Vd(u);function T(){for(var R=arguments.length,z=ce(R),q=R,te=Cc(T);q--;)z[q]=arguments[q];var ve=R<3&&z[0]!==te&&z[R-1]!==te?[]:Ss(z,te);if(R-=ve.length,R<b)return rI(u,h,Tg,T.placeholder,n,z,ve,n,n,b-R);var be=this&&this!==zn&&this instanceof T?E:u;return Hr(be,this,z)}return T}function Z5(u){return function(h,b,E){var T=Bt(h);if(!br(h)){var R=Ve(b,3);h=An(h),b=function(q){return R(T[q],q,T)}}var z=u(h,b,E);return z>-1?T[R?h[z]:z]:n}}function eI(u){return Mo(function(h){var b=h.length,E=b,T=ci.prototype.thru;for(u&&h.reverse();E--;){var R=h[E];if(typeof R!="function")throw new li(s);if(T&&!z&&Rg(R)=="wrapper")var z=new ci([],!0)}for(E=z?E:b;++E<b;){R=h[E];var q=Rg(R),te=q=="wrapper"?g1(R):n;te&&y1(te[0])&&te[1]==(A|C|O|L)&&!te[4].length&&te[9]==1?z=z[Rg(te[0])].apply(z,te[3]):z=R.length==1&&y1(R)?z[q]():z.thru(R)}return function(){var ve=arguments,be=ve[0];if(z&&ve.length==1&&rt(be))return z.plant(be).value();for(var we=0,De=b?h[we].apply(this,ve):be;++we<b;)De=h[we].call(this,De);return De}})}function Tg(u,h,b,E,T,R,z,q,te,ve){var be=h&A,we=h&x,De=h&w,$e=h&(C|P),We=h&F,ft=De?n:Vd(u);function qe(){for(var _t=arguments.length,Et=ce(_t),Gr=_t;Gr--;)Et[Gr]=arguments[Gr];if($e)var rr=Cc(qe),Yr=Jie(Et,rr);if(E&&(Et=Y5(Et,E,T,$e)),R&&(Et=K5(Et,R,z,$e)),_t-=Yr,$e&&_t<ve){var mn=Ss(Et,rr);return rI(u,h,Tg,qe.placeholder,b,Et,mn,q,te,ve-_t)}var Pi=we?b:this,Io=De?Pi[u]:u;return _t=Et.length,q?Et=sae(Et,q):We&&_t>1&&Et.reverse(),be&&te<_t&&(Et.length=te),this&&this!==zn&&this instanceof qe&&(Io=ft||Vd(Io)),Io.apply(Pi,Et)}return qe}function tI(u,h){return function(b,E){return pse(b,u,h(E),{})}}function Ag(u,h){return function(b,E){var T;if(b===n&&E===n)return h;if(b!==n&&(T=b),E!==n){if(T===n)return E;typeof b=="string"||typeof E=="string"?(b=qr(b),E=qr(E)):(b=z5(b),E=z5(E)),T=u(b,E)}return T}}function d1(u){return Mo(function(h){return h=rn(h,Wr(Ve())),ht(function(b){var E=this;return u(h,function(T){return Hr(T,E,b)})})})}function Ig(u,h){h=h===n?" ":qr(h);var b=h.length;if(b<2)return b?i1(h,u):h;var E=i1(h,yg(u/mc(h)));return gc(h)?ks(Ci(E),0,u).join(""):E.slice(0,u)}function Bse(u,h,b,E){var T=h&x,R=Vd(u);function z(){for(var q=-1,te=arguments.length,ve=-1,be=E.length,we=ce(be+te),De=this&&this!==zn&&this instanceof z?R:u;++ve<be;)we[ve]=E[ve];for(;te--;)we[ve++]=arguments[++q];return Hr(De,T?b:this,we)}return z}function nI(u){return function(h,b,E){return E&&typeof E!="number"&&nr(h,b,E)&&(b=E=n),h=Ao(h),b===n?(b=h,h=0):b=Ao(b),E=E===n?h<b?1:-1:Ao(E),Ose(h,b,E,u)}}function Ng(u){return function(h,b){return typeof h=="string"&&typeof b=="string"||(h=hi(h),b=hi(b)),u(h,b)}}function rI(u,h,b,E,T,R,z,q,te,ve){var be=h&C,we=be?z:n,De=be?n:z,$e=be?R:n,We=be?n:R;h|=be?O:k,h&=~(be?k:O),h&S||(h&=~(x|w));var ft=[u,h,T,$e,we,We,De,q,te,ve],qe=b.apply(n,ft);return y1(u)&&gI(qe,ft),qe.placeholder=E,mI(qe,u,h)}function f1(u){var h=En[u];return function(b,E){if(b=hi(b),E=E==null?0:Kn(ct(E),292),E&&m5(b)){var T=(Rt(b)+"e").split("e"),R=h(T[0]+"e"+(+T[1]+E));return T=(Rt(R)+"e").split("e"),+(T[0]+"e"+(+T[1]-E))}return h(b)}}var Vse=yc&&1/cg(new yc([,-0]))[1]==U?function(u){return new yc(u)}:N1;function iI(u){return function(h){var b=Xn(h);return b==Fe?Vx(h):b==Zt?ooe(h):Qie(h,u(h))}}function ko(u,h,b,E,T,R,z,q){var te=h&w;if(!te&&typeof u!="function")throw new li(s);var ve=E?E.length:0;if(ve||(h&=~(O|k),E=T=n),z=z===n?z:On(ct(z),0),q=q===n?q:ct(q),ve-=T?T.length:0,h&k){var be=E,we=T;E=T=n}var De=te?n:g1(u),$e=[u,h,b,E,T,be,we,R,z,q];if(De&&rae($e,De),u=$e[0],h=$e[1],b=$e[2],E=$e[3],T=$e[4],q=$e[9]=$e[9]===n?te?0:u.length:On($e[9]-ve,0),!q&&h&(C|P)&&(h&=~(C|P)),!h||h==x)var We=jse(u,h,b);else h==C||h==P?We=zse(u,h,q):(h==O||h==(x|O))&&!T.length?We=Bse(u,h,b,E):We=Tg.apply(n,$e);var ft=De?F5:gI;return mI(ft(We,$e),u,h)}function oI(u,h,b,E){return u===n||Oi(u,bc[b])&&!$t.call(E,b)?h:u}function sI(u,h,b,E,T,R){return sn(u)&&sn(h)&&(R.set(h,u),Pg(u,h,n,sI,R),R.delete(h)),u}function Hse(u){return qd(u)?n:u}function aI(u,h,b,E,T,R){var z=b&v,q=u.length,te=h.length;if(q!=te&&!(z&&te>q))return!1;var ve=R.get(u),be=R.get(h);if(ve&&be)return ve==h&&be==u;var we=-1,De=!0,$e=b&y?new Ya:n;for(R.set(u,h),R.set(h,u);++we<q;){var We=u[we],ft=h[we];if(E)var qe=z?E(ft,We,we,h,u,R):E(We,ft,we,u,h,R);if(qe!==n){if(qe)continue;De=!1;break}if($e){if(!Lx(h,function(_t,Et){if(!Td($e,Et)&&(We===_t||T(We,_t,b,E,R)))return $e.push(Et)})){De=!1;break}}else if(!(We===ft||T(We,ft,b,E,R))){De=!1;break}}return R.delete(u),R.delete(h),De}function Wse(u,h,b,E,T,R,z){switch(b){case Xe:if(u.byteLength!=h.byteLength||u.byteOffset!=h.byteOffset)return!1;u=u.buffer,h=h.buffer;case Le:return!(u.byteLength!=h.byteLength||!R(new gg(u),new gg(h)));case re:case ee:case He:return Oi(+u,+h);case ye:return u.name==h.name&&u.message==h.message;case tn:case Dn:return u==h+"";case Fe:var q=Vx;case Zt:var te=E&v;if(q||(q=cg),u.size!=h.size&&!te)return!1;var ve=z.get(u);if(ve)return ve==h;E|=y,z.set(u,h);var be=aI(q(u),q(h),E,T,R,z);return z.delete(u),be;case fn:if(Ld)return Ld.call(u)==Ld.call(h)}return!1}function qse(u,h,b,E,T,R){var z=b&v,q=h1(u),te=q.length,ve=h1(h),be=ve.length;if(te!=be&&!z)return!1;for(var we=te;we--;){var De=q[we];if(!(z?De in h:$t.call(h,De)))return!1}var $e=R.get(u),We=R.get(h);if($e&&We)return $e==h&&We==u;var ft=!0;R.set(u,h),R.set(h,u);for(var qe=z;++we<te;){De=q[we];var _t=u[De],Et=h[De];if(E)var Gr=z?E(Et,_t,De,h,u,R):E(_t,Et,De,u,h,R);if(!(Gr===n?_t===Et||T(_t,Et,b,E,R):Gr)){ft=!1;break}qe||(qe=De=="constructor")}if(ft&&!qe){var rr=u.constructor,Yr=h.constructor;rr!=Yr&&"constructor"in u&&"constructor"in h&&!(typeof rr=="function"&&rr instanceof rr&&typeof Yr=="function"&&Yr instanceof Yr)&&(ft=!1)}return R.delete(u),R.delete(h),ft}function Mo(u){return w1(hI(u,n,_I),u+"")}function h1(u){return P5(u,An,v1)}function p1(u){return P5(u,yr,lI)}var g1=wg?function(u){return wg.get(u)}:N1;function Rg(u){for(var h=u.name+"",b=xc[h],E=$t.call(xc,h)?b.length:0;E--;){var T=b[E],R=T.func;if(R==null||R==u)return T.name}return h}function Cc(u){var h=$t.call(I,"placeholder")?I:u;return h.placeholder}function Ve(){var u=I.iteratee||A1;return u=u===A1?D5:u,arguments.length?u(arguments[0],arguments[1]):u}function Lg(u,h){var b=u.__data__;return Zse(h)?b[typeof h=="string"?"string":"hash"]:b.map}function m1(u){for(var h=An(u),b=h.length;b--;){var E=h[b],T=u[E];h[b]=[E,T,dI(T)]}return h}function Qa(u,h){var b=noe(u,h);return M5(b)?b:n}function Use(u){var h=$t.call(u,Ua),b=u[Ua];try{u[Ua]=n;var E=!0}catch{}var T=hg.call(u);return E&&(h?u[Ua]=b:delete u[Ua]),T}var v1=Wx?function(u){return u==null?[]:(u=Bt(u),ws(Wx(u),function(h){return p5.call(u,h)}))}:R1,lI=Wx?function(u){for(var h=[];u;)_s(h,v1(u)),u=mg(u);return h}:R1,Xn=tr;(qx&&Xn(new qx(new ArrayBuffer(1)))!=Xe||Id&&Xn(new Id)!=Fe||Ux&&Xn(Ux.resolve())!=vt||yc&&Xn(new yc)!=Zt||Nd&&Xn(new Nd)!=fe)&&(Xn=function(u){var h=tr(u),b=h==St?u.constructor:n,E=b?Ja(b):"";if(E)switch(E){case koe:return Xe;case Moe:return Fe;case Doe:return vt;case Toe:return Zt;case Aoe:return fe}return h});function Gse(u,h,b){for(var E=-1,T=b.length;++E<T;){var R=b[E],z=R.size;switch(R.type){case"drop":u+=z;break;case"dropRight":h-=z;break;case"take":h=Kn(h,u+z);break;case"takeRight":u=On(u,h-z);break}}return{start:u,end:h}}function Yse(u){var h=u.match(Dd);return h?h[1].split(D):[]}function cI(u,h,b){h=Ps(h,u);for(var E=-1,T=h.length,R=!1;++E<T;){var z=to(h[E]);if(!(R=u!=null&&b(u,z)))break;u=u[z]}return R||++E!=T?R:(T=u==null?0:u.length,!!T&&Hg(T)&&Do(z,T)&&(rt(u)||Za(u)))}function Kse(u){var h=u.length,b=new u.constructor(h);return h&&typeof u[0]=="string"&&$t.call(u,"index")&&(b.index=u.index,b.input=u.input),b}function uI(u){return typeof u.constructor=="function"&&!Hd(u)?wc(mg(u)):{}}function Xse(u,h,b){var E=u.constructor;switch(h){case Le:return u1(u);case re:case ee:return new E(+u);case Xe:return Ise(u,b);case yt:case hn:case Cn:case Fn:case Br:case Vr:case pn:case mr:case jn:return U5(u,b);case Fe:return new E;case He:case Dn:return new E(u);case tn:return Nse(u);case Zt:return new E;case fn:return Rse(u)}}function Qse(u,h){var b=h.length;if(!b)return u;var E=b-1;return h[E]=(b>1?"& ":"")+h[E],h=h.join(b>2?", ":" "),u.replace(Md,`{
|
|
67
67
|
/* [wrapped with `+h+`] */
|
|
68
|
-
`)}function Jse(u){return rt(u)||Za(u)||!!(g5&&u&&u[g5])}function Do(u,h){var b=typeof u;return h=h??ie,!!h&&(b=="number"||b!="symbol"&&nt.test(u))&&u>-1&&u%1==0&&u<h}function nr(u,h,b){if(!sn(b))return!1;var E=typeof h;return(E=="number"?br(b)&&Do(h,b.length):E=="string"&&h in b)?Oi(b[h],u):!1}function b1(u,h){if(rt(u))return!1;var b=typeof u;return b=="number"||b=="symbol"||b=="boolean"||u==null||Ur(u)?!0:za.test(u)||!ja.test(u)||h!=null&&u in Bt(h)}function Zse(u){var h=typeof u;return h=="string"||h=="number"||h=="symbol"||h=="boolean"?u!=="__proto__":u===null}function y1(u){var h=Rg(u),b=I[h];if(typeof b!="function"||!(h in Ct.prototype))return!1;if(u===b)return!0;var E=g1(b);return!!E&&u===E[0]}function eae(u){return!!d5&&d5 in u}var tae=dg?To:L1;function Hd(u){var h=u&&u.constructor,b=typeof h=="function"&&h.prototype||bc;return u===b}function dI(u){return u===u&&!sn(u)}function fI(u,h){return function(b){return b==null?!1:b[u]===h&&(h!==n||u in Bt(b))}}function nae(u){var h=Bg(u,function(E){return b.size===c&&b.clear(),E}),b=h.cache;return h}function rae(u,h){var b=u[1],E=h[1],T=b|E,R=T<(x|w|A),z=E==A&&b==C||E==A&&b==L&&u[7].length<=h[8]||E==(A|L)&&h[7].length<=h[8]&&b==C;if(!(R||z))return u;E&x&&(u[2]=h[2],T|=b&x?0:S);var q=h[3];if(q){var te=u[3];u[3]=te?Y5(te,q,h[4]):q,u[4]=te?Ss(u[3],d):h[4]}return q=h[5],q&&(te=u[5],u[5]=te?K5(te,q,h[6]):q,u[6]=te?Ss(u[5],d):h[6]),q=h[7],q&&(u[7]=q),E&A&&(u[8]=u[8]==null?h[8]:Kn(u[8],h[8])),u[9]==null&&(u[9]=h[9]),u[0]=h[0],u[1]=T,u}function iae(u){var h=[];if(u!=null)for(var b in Bt(u))h.push(b);return h}function oae(u){return hg.call(u)}function hI(u,h,b){return h=On(h===n?u.length-1:h,0),function(){for(var E=arguments,T=-1,R=On(E.length-h,0),z=ce(R);++T<R;)z[T]=E[h+T];T=-1;for(var q=ce(h+1);++T<h;)q[T]=E[T];return q[h]=b(z),Hr(u,this,q)}}function pI(u,h){return h.length<2?u:Xa(u,di(h,0,-1))}function sae(u,h){for(var b=u.length,E=Kn(h.length,b),T=vr(u);E--;){var R=h[E];u[E]=Do(R,b)?T[R]:n}return u}function x1(u,h){if(!(h==="constructor"&&typeof u[h]=="function")&&h!="__proto__")return u[h]}var gI=vI(F5),Wd=woe||function(u,h){return zn.setTimeout(u,h)},w1=vI(Mse);function mI(u,h,b){var E=h+"";return w1(u,Qse(E,aae(Yse(E),b)))}function vI(u){var h=0,b=0;return function(){var E=Eoe(),T=K-(E-b);if(b=E,T>0){if(++h>=V)return arguments[0]}else h=0;return u.apply(n,arguments)}}function $g(u,h){var b=-1,E=u.length,T=E-1;for(h=h===n?E:h;++b<h;){var R=r1(b,T),z=u[R];u[R]=u[b],u[b]=z}return u.length=h,u}var bI=nae(function(u){var h=[];return u.charCodeAt(0)===46&&h.push(""),u.replace(Pd,function(b,E,T,R){h.push(T?R.replace(Se,"$1"):E||b)}),h});function to(u){if(typeof u=="string"||Ur(u))return u;var h=u+"";return h=="0"&&1/u==-U?"-0":h}function Ja(u){if(u!=null){try{return fg.call(u)}catch{}try{return u+""}catch{}}return""}function aae(u,h){return ai(X,function(b){var E="_."+b[0];h&b[1]&&!ag(u,E)&&u.push(E)}),u.sort()}function yI(u){if(u instanceof Ct)return u.clone();var h=new ci(u.__wrapped__,u.__chain__);return h.__actions__=vr(u.__actions__),h.__index__=u.__index__,h.__values__=u.__values__,h}function lae(u,h,b){(b?nr(u,h,b):h===n)?h=1:h=On(lt(h),0);var E=u==null?0:u.length;if(!E||h<1)return[];for(var T=0,R=0,z=ce(yg(E/h));T<E;)z[R++]=di(u,T,T+=h);return z}function cae(u){for(var h=-1,b=u==null?0:u.length,E=0,T=[];++h<b;){var R=u[h];R&&(T[E++]=R)}return T}function uae(){var u=arguments.length;if(!u)return[];for(var h=ce(u-1),b=arguments[0],E=u;E--;)h[E-1]=arguments[E];return _s(rt(b)?vr(b):[b],Bn(h,1))}var dae=ht(function(u,h){return gn(u)?Fd(u,Bn(h,1,gn,!0)):[]}),fae=ht(function(u,h){var b=fi(h);return gn(b)&&(b=n),gn(u)?Fd(u,Bn(h,1,gn,!0),Ve(b,2)):[]}),hae=ht(function(u,h){var b=fi(h);return gn(b)&&(b=n),gn(u)?Fd(u,Bn(h,1,gn,!0),n,b):[]});function pae(u,h,b){var E=u==null?0:u.length;return E?(h=b||h===n?1:lt(h),di(u,h<0?0:h,E)):[]}function gae(u,h,b){var E=u==null?0:u.length;return E?(h=b||h===n?1:lt(h),h=E-h,di(u,0,h<0?0:h)):[]}function mae(u,h){return u&&u.length?Mg(u,Ve(h,3),!0,!0):[]}function vae(u,h){return u&&u.length?Mg(u,Ve(h,3),!0):[]}function bae(u,h,b,E){var T=u==null?0:u.length;return T?(b&&typeof b!="number"&&nr(u,h,b)&&(b=0,E=T),use(u,h,b,E)):[]}function xI(u,h,b){var E=u==null?0:u.length;if(!E)return-1;var T=b==null?0:lt(b);return T<0&&(T=On(E+T,0)),lg(u,Ve(h,3),T)}function wI(u,h,b){var E=u==null?0:u.length;if(!E)return-1;var T=E-1;return b!==n&&(T=lt(b),T=b<0?On(E+T,0):Kn(T,E-1)),lg(u,Ve(h,3),T,!0)}function _I(u){var h=u==null?0:u.length;return h?Bn(u,1):[]}function yae(u){var h=u==null?0:u.length;return h?Bn(u,U):[]}function xae(u,h){var b=u==null?0:u.length;return b?(h=h===n?1:lt(h),Bn(u,h)):[]}function wae(u){for(var h=-1,b=u==null?0:u.length,E={};++h<b;){var T=u[h];E[T[0]]=T[1]}return E}function SI(u){return u&&u.length?u[0]:n}function _ae(u,h,b){var E=u==null?0:u.length;if(!E)return-1;var T=b==null?0:lt(b);return T<0&&(T=On(E+T,0)),pc(u,h,T)}function Sae(u){var h=u==null?0:u.length;return h?di(u,0,-1):[]}var Cae=ht(function(u){var h=rn(u,l1);return h.length&&h[0]===u[0]?Jx(h):[]}),Eae=ht(function(u){var h=fi(u),b=rn(u,l1);return h===fi(b)?h=n:b.pop(),b.length&&b[0]===u[0]?Jx(b,Ve(h,2)):[]}),Oae=ht(function(u){var h=fi(u),b=rn(u,l1);return h=typeof h=="function"?h:n,h&&b.pop(),b.length&&b[0]===u[0]?Jx(b,n,h):[]});function Pae(u,h){return u==null?"":Soe.call(u,h)}function fi(u){var h=u==null?0:u.length;return h?u[h-1]:n}function kae(u,h,b){var E=u==null?0:u.length;if(!E)return-1;var T=E;return b!==n&&(T=lt(b),T=T<0?On(E+T,0):Kn(T,E-1)),h===h?aoe(u,h,T):lg(u,r5,T,!0)}function Mae(u,h){return u&&u.length?N5(u,lt(h)):n}var Dae=ht(CI);function CI(u,h){return u&&u.length&&h&&h.length?n1(u,h):u}function Tae(u,h,b){return u&&u.length&&h&&h.length?n1(u,h,Ve(b,2)):u}function Aae(u,h,b){return u&&u.length&&h&&h.length?n1(u,h,n,b):u}var Iae=Mo(function(u,h){var b=u==null?0:u.length,E=Yx(u,h);return $5(u,rn(h,function(T){return Do(T,b)?+T:T}).sort(G5)),E});function Nae(u,h){var b=[];if(!(u&&u.length))return b;var E=-1,T=[],R=u.length;for(h=Ve(h,3);++E<R;){var z=u[E];h(z,E,u)&&(b.push(z),T.push(E))}return $5(u,T),b}function _1(u){return u==null?u:Poe.call(u)}function Rae(u,h,b){var E=u==null?0:u.length;return E?(b&&typeof b!="number"&&nr(u,h,b)?(h=0,b=E):(h=h==null?0:lt(h),b=b===n?E:lt(b)),di(u,h,b)):[]}function Lae(u,h){return kg(u,h)}function $ae(u,h,b){return o1(u,h,Ve(b,2))}function Fae(u,h){var b=u==null?0:u.length;if(b){var E=kg(u,h);if(E<b&&Oi(u[E],h))return E}return-1}function jae(u,h){return kg(u,h,!0)}function zae(u,h,b){return o1(u,h,Ve(b,2),!0)}function Bae(u,h){var b=u==null?0:u.length;if(b){var E=kg(u,h,!0)-1;if(Oi(u[E],h))return E}return-1}function Vae(u){return u&&u.length?j5(u):[]}function Hae(u,h){return u&&u.length?j5(u,Ve(h,2)):[]}function Wae(u){var h=u==null?0:u.length;return h?di(u,1,h):[]}function qae(u,h,b){return u&&u.length?(h=b||h===n?1:lt(h),di(u,0,h<0?0:h)):[]}function Uae(u,h,b){var E=u==null?0:u.length;return E?(h=b||h===n?1:lt(h),h=E-h,di(u,h<0?0:h,E)):[]}function Gae(u,h){return u&&u.length?Mg(u,Ve(h,3),!1,!0):[]}function Yae(u,h){return u&&u.length?Mg(u,Ve(h,3)):[]}var Kae=ht(function(u){return Os(Bn(u,1,gn,!0))}),Xae=ht(function(u){var h=fi(u);return gn(h)&&(h=n),Os(Bn(u,1,gn,!0),Ve(h,2))}),Qae=ht(function(u){var h=fi(u);return h=typeof h=="function"?h:n,Os(Bn(u,1,gn,!0),n,h)});function Jae(u){return u&&u.length?Os(u):[]}function Zae(u,h){return u&&u.length?Os(u,Ve(h,2)):[]}function ele(u,h){return h=typeof h=="function"?h:n,u&&u.length?Os(u,n,h):[]}function S1(u){if(!(u&&u.length))return[];var h=0;return u=ws(u,function(b){if(gn(b))return h=On(b.length,h),!0}),zx(h,function(b){return rn(u,$x(b))})}function EI(u,h){if(!(u&&u.length))return[];var b=S1(u);return h==null?b:rn(b,function(E){return Hr(h,n,E)})}var tle=ht(function(u,h){return gn(u)?Fd(u,h):[]}),nle=ht(function(u){return a1(ws(u,gn))}),rle=ht(function(u){var h=fi(u);return gn(h)&&(h=n),a1(ws(u,gn),Ve(h,2))}),ile=ht(function(u){var h=fi(u);return h=typeof h=="function"?h:n,a1(ws(u,gn),n,h)}),ole=ht(S1);function sle(u,h){return H5(u||[],h||[],$d)}function ale(u,h){return H5(u||[],h||[],Bd)}var lle=ht(function(u){var h=u.length,b=h>1?u[h-1]:n;return b=typeof b=="function"?(u.pop(),b):n,EI(u,b)});function OI(u){var h=I(u);return h.__chain__=!0,h}function cle(u,h){return h(u),u}function Fg(u,h){return h(u)}var ule=Mo(function(u){var h=u.length,b=h?u[0]:0,E=this.__wrapped__,T=function(R){return Yx(R,u)};return h>1||this.__actions__.length||!(E instanceof Ct)||!Do(b)?this.thru(T):(E=E.slice(b,+b+(h?1:0)),E.__actions__.push({func:Fg,args:[T],thisArg:n}),new ci(E,this.__chain__).thru(function(R){return h&&!R.length&&R.push(n),R}))});function dle(){return OI(this)}function fle(){return new ci(this.value(),this.__chain__)}function hle(){this.__values__===n&&(this.__values__=zI(this.value()));var u=this.__index__>=this.__values__.length,h=u?n:this.__values__[this.__index__++];return{done:u,value:h}}function ple(){return this}function gle(u){for(var h,b=this;b instanceof Sg;){var E=yI(b);E.__index__=0,E.__values__=n,h?T.__wrapped__=E:h=E;var T=E;b=b.__wrapped__}return T.__wrapped__=u,h}function mle(){var u=this.__wrapped__;if(u instanceof Ct){var h=u;return this.__actions__.length&&(h=new Ct(this)),h=h.reverse(),h.__actions__.push({func:Fg,args:[_1],thisArg:n}),new ci(h,this.__chain__)}return this.thru(_1)}function vle(){return V5(this.__wrapped__,this.__actions__)}var ble=Dg(function(u,h,b){$t.call(u,b)?++u[b]:Po(u,b,1)});function yle(u,h,b){var E=rt(u)?t5:cse;return b&&nr(u,h,b)&&(h=n),E(u,Ve(h,3))}function xle(u,h){var b=rt(u)?ws:E5;return b(u,Ve(h,3))}var wle=Z5(xI),_le=Z5(wI);function Sle(u,h){return Bn(jg(u,h),1)}function Cle(u,h){return Bn(jg(u,h),U)}function Ele(u,h,b){return b=b===n?1:lt(b),Bn(jg(u,h),b)}function PI(u,h){var b=rt(u)?ai:Es;return b(u,Ve(h,3))}function kI(u,h){var b=rt(u)?Wie:C5;return b(u,Ve(h,3))}var Ole=Dg(function(u,h,b){$t.call(u,b)?u[b].push(h):Po(u,b,[h])});function Ple(u,h,b,E){u=br(u)?u:Oc(u),b=b&&!E?lt(b):0;var T=u.length;return b<0&&(b=On(T+b,0)),Wg(u)?b<=T&&u.indexOf(h,b)>-1:!!T&&pc(u,h,b)>-1}var kle=ht(function(u,h,b){var E=-1,T=typeof h=="function",R=br(u)?ce(u.length):[];return Es(u,function(z){R[++E]=T?Hr(h,z,b):jd(z,h,b)}),R}),Mle=Dg(function(u,h,b){Po(u,b,h)});function jg(u,h){var b=rt(u)?rn:T5;return b(u,Ve(h,3))}function Dle(u,h,b,E){return u==null?[]:(rt(h)||(h=h==null?[]:[h]),b=E?n:b,rt(b)||(b=b==null?[]:[b]),R5(u,h,b))}var Tle=Dg(function(u,h,b){u[b?0:1].push(h)},function(){return[[],[]]});function Ale(u,h,b){var E=rt(u)?Rx:o5,T=arguments.length<3;return E(u,Ve(h,4),b,T,Es)}function Ile(u,h,b){var E=rt(u)?qie:o5,T=arguments.length<3;return E(u,Ve(h,4),b,T,C5)}function Nle(u,h){var b=rt(u)?ws:E5;return b(u,Vg(Ve(h,3)))}function Rle(u){var h=rt(u)?x5:Pse;return h(u)}function Lle(u,h,b){(b?nr(u,h,b):h===n)?h=1:h=lt(h);var E=rt(u)?ise:kse;return E(u,h)}function $le(u){var h=rt(u)?ose:Dse;return h(u)}function Fle(u){if(u==null)return 0;if(br(u))return Wg(u)?mc(u):u.length;var h=Xn(u);return h==Fe||h==Zt?u.size:e1(u).length}function jle(u,h,b){var E=rt(u)?Lx:Tse;return b&&nr(u,h,b)&&(h=n),E(u,Ve(h,3))}var zle=ht(function(u,h){if(u==null)return[];var b=h.length;return b>1&&nr(u,h[0],h[1])?h=[]:b>2&&nr(h[0],h[1],h[2])&&(h=[h[0]]),R5(u,Bn(h,1),[])}),zg=xoe||function(){return zn.Date.now()};function Ble(u,h){if(typeof h!="function")throw new li(s);return u=lt(u),function(){if(--u<1)return h.apply(this,arguments)}}function MI(u,h,b){return h=b?n:h,h=u&&h==null?u.length:h,ko(u,A,n,n,n,n,h)}function DI(u,h){var b;if(typeof h!="function")throw new li(s);return u=lt(u),function(){return--u>0&&(b=h.apply(this,arguments)),u<=1&&(h=n),b}}var C1=ht(function(u,h,b){var E=x;if(b.length){var T=Ss(b,Cc(C1));E|=O}return ko(u,E,h,b,T)}),TI=ht(function(u,h,b){var E=x|w;if(b.length){var T=Ss(b,Cc(TI));E|=O}return ko(h,E,u,b,T)});function AI(u,h,b){h=b?n:h;var E=ko(u,C,n,n,n,n,n,h);return E.placeholder=AI.placeholder,E}function II(u,h,b){h=b?n:h;var E=ko(u,P,n,n,n,n,n,h);return E.placeholder=II.placeholder,E}function NI(u,h,b){var E,T,R,z,q,te,ve=0,be=!1,we=!1,De=!0;if(typeof u!="function")throw new li(s);h=hi(h)||0,sn(b)&&(be=!!b.leading,we="maxWait"in b,R=we?On(hi(b.maxWait)||0,h):R,De="trailing"in b?!!b.trailing:De);function $e(mn){var Pi=E,Io=T;return E=T=n,ve=mn,z=u.apply(Io,Pi),z}function We(mn){return ve=mn,q=Wd(_t,h),be?$e(mn):z}function ft(mn){var Pi=mn-te,Io=mn-ve,ZI=h-Pi;return we?Kn(ZI,R-Io):ZI}function qe(mn){var Pi=mn-te,Io=mn-ve;return te===n||Pi>=h||Pi<0||we&&Io>=R}function _t(){var mn=zg();if(qe(mn))return Et(mn);q=Wd(_t,ft(mn))}function Et(mn){return q=n,De&&E?$e(mn):(E=T=n,z)}function Gr(){q!==n&&W5(q),ve=0,E=te=T=q=n}function rr(){return q===n?z:Et(zg())}function Yr(){var mn=zg(),Pi=qe(mn);if(E=arguments,T=this,te=mn,Pi){if(q===n)return We(te);if(we)return W5(q),q=Wd(_t,h),$e(te)}return q===n&&(q=Wd(_t,h)),z}return Yr.cancel=Gr,Yr.flush=rr,Yr}var Vle=ht(function(u,h){return S5(u,1,h)}),Hle=ht(function(u,h,b){return S5(u,hi(h)||0,b)});function Wle(u){return ko(u,F)}function Bg(u,h){if(typeof u!="function"||h!=null&&typeof h!="function")throw new li(s);var b=function(){var E=arguments,T=h?h.apply(this,E):E[0],R=b.cache;if(R.has(T))return R.get(T);var z=u.apply(this,E);return b.cache=R.set(T,z)||R,z};return b.cache=new(Bg.Cache||Oo),b}Bg.Cache=Oo;function Vg(u){if(typeof u!="function")throw new li(s);return function(){var h=arguments;switch(h.length){case 0:return!u.call(this);case 1:return!u.call(this,h[0]);case 2:return!u.call(this,h[0],h[1]);case 3:return!u.call(this,h[0],h[1],h[2])}return!u.apply(this,h)}}function qle(u){return DI(2,u)}var Ule=Ase(function(u,h){h=h.length==1&&rt(h[0])?rn(h[0],Wr(Ve())):rn(Bn(h,1),Wr(Ve()));var b=h.length;return ht(function(E){for(var T=-1,R=Kn(E.length,b);++T<R;)E[T]=h[T].call(this,E[T]);return Hr(u,this,E)})}),E1=ht(function(u,h){var b=Ss(h,Cc(E1));return ko(u,O,n,h,b)}),RI=ht(function(u,h){var b=Ss(h,Cc(RI));return ko(u,k,n,h,b)}),Gle=Mo(function(u,h){return ko(u,L,n,n,n,h)});function Yle(u,h){if(typeof u!="function")throw new li(s);return h=h===n?h:lt(h),ht(u,h)}function Kle(u,h){if(typeof u!="function")throw new li(s);return h=h==null?0:On(lt(h),0),ht(function(b){var E=b[h],T=ks(b,0,h);return E&&_s(T,E),Hr(u,this,T)})}function Xle(u,h,b){var E=!0,T=!0;if(typeof u!="function")throw new li(s);return sn(b)&&(E="leading"in b?!!b.leading:E,T="trailing"in b?!!b.trailing:T),NI(u,h,{leading:E,maxWait:h,trailing:T})}function Qle(u){return MI(u,1)}function Jle(u,h){return E1(c1(h),u)}function Zle(){if(!arguments.length)return[];var u=arguments[0];return rt(u)?u:[u]}function ece(u){return ui(u,p)}function tce(u,h){return h=typeof h=="function"?h:n,ui(u,p,h)}function nce(u){return ui(u,f|p)}function rce(u,h){return h=typeof h=="function"?h:n,ui(u,f|p,h)}function ice(u,h){return h==null||_5(u,h,An(h))}function Oi(u,h){return u===h||u!==u&&h!==h}var oce=Ng(Qx),sce=Ng(function(u,h){return u>=h}),Za=k5(function(){return arguments}())?k5:function(u){return un(u)&&$t.call(u,"callee")&&!p5.call(u,"callee")},rt=ce.isArray,ace=KA?Wr(KA):gse;function br(u){return u!=null&&Hg(u.length)&&!To(u)}function gn(u){return un(u)&&br(u)}function lce(u){return u===!0||u===!1||un(u)&&tr(u)==re}var Ms=_oe||L1,cce=XA?Wr(XA):mse;function uce(u){return un(u)&&u.nodeType===1&&!qd(u)}function dce(u){if(u==null)return!0;if(br(u)&&(rt(u)||typeof u=="string"||typeof u.splice=="function"||Ms(u)||Ec(u)||Za(u)))return!u.length;var h=Xn(u);if(h==Fe||h==Zt)return!u.size;if(Hd(u))return!e1(u).length;for(var b in u)if($t.call(u,b))return!1;return!0}function fce(u,h){return zd(u,h)}function hce(u,h,b){b=typeof b=="function"?b:n;var E=b?b(u,h):n;return E===n?zd(u,h,n,b):!!E}function O1(u){if(!un(u))return!1;var h=tr(u);return h==ye||h==W||typeof u.message=="string"&&typeof u.name=="string"&&!qd(u)}function pce(u){return typeof u=="number"&&m5(u)}function To(u){if(!sn(u))return!1;var h=tr(u);return h==oe||h==Te||h==de||h==bt}function LI(u){return typeof u=="number"&&u==lt(u)}function Hg(u){return typeof u=="number"&&u>-1&&u%1==0&&u<=ie}function sn(u){var h=typeof u;return u!=null&&(h=="object"||h=="function")}function un(u){return u!=null&&typeof u=="object"}var $I=QA?Wr(QA):bse;function gce(u,h){return u===h||Zx(u,h,m1(h))}function mce(u,h,b){return b=typeof b=="function"?b:n,Zx(u,h,m1(h),b)}function vce(u){return FI(u)&&u!=+u}function bce(u){if(tae(u))throw new Ze(o);return M5(u)}function yce(u){return u===null}function xce(u){return u==null}function FI(u){return typeof u=="number"||un(u)&&tr(u)==He}function qd(u){if(!un(u)||tr(u)!=St)return!1;var h=mg(u);if(h===null)return!0;var b=$t.call(h,"constructor")&&h.constructor;return typeof b=="function"&&b instanceof b&&fg.call(b)==moe}var P1=JA?Wr(JA):yse;function wce(u){return LI(u)&&u>=-ie&&u<=ie}var jI=ZA?Wr(ZA):xse;function Wg(u){return typeof u=="string"||!rt(u)&&un(u)&&tr(u)==Dn}function Ur(u){return typeof u=="symbol"||un(u)&&tr(u)==fn}var Ec=e5?Wr(e5):wse;function _ce(u){return u===n}function Sce(u){return un(u)&&Xn(u)==fe}function Cce(u){return un(u)&&tr(u)==Oe}var Ece=Ng(t1),Oce=Ng(function(u,h){return u<=h});function zI(u){if(!u)return[];if(br(u))return Wg(u)?Ci(u):vr(u);if(Ad&&u[Ad])return ioe(u[Ad]());var h=Xn(u),b=h==Fe?Vx:h==Zt?cg:Oc;return b(u)}function Ao(u){if(!u)return u===0?u:0;if(u=hi(u),u===U||u===-U){var h=u<0?-1:1;return h*le}return u===u?u:0}function lt(u){var h=Ao(u),b=h%1;return h===h?b?h-b:h:0}function BI(u){return u?Ka(lt(u),0,H):0}function hi(u){if(typeof u=="number")return u;if(Ur(u))return M;if(sn(u)){var h=typeof u.valueOf=="function"?u.valueOf():u;u=sn(h)?h+"":h}if(typeof u!="string")return u===0?u:+u;u=s5(u);var b=Me.test(u);return b||Je.test(u)?Bie(u.slice(2),b?2:8):Ae.test(u)?M:+u}function VI(u){return eo(u,yr(u))}function Pce(u){return u?Ka(lt(u),-ie,ie):u===0?u:0}function Rt(u){return u==null?"":qr(u)}var kce=_c(function(u,h){if(Hd(h)||br(h)){eo(h,An(h),u);return}for(var b in h)$t.call(h,b)&&$d(u,b,h[b])}),HI=_c(function(u,h){eo(h,yr(h),u)}),qg=_c(function(u,h,b,E){eo(h,yr(h),u,E)}),Mce=_c(function(u,h,b,E){eo(h,An(h),u,E)}),Dce=Mo(Yx);function Tce(u,h){var b=wc(u);return h==null?b:w5(b,h)}var Ace=ht(function(u,h){u=Bt(u);var b=-1,E=h.length,T=E>2?h[2]:n;for(T&&nr(h[0],h[1],T)&&(E=1);++b<E;)for(var R=h[b],z=yr(R),q=-1,te=z.length;++q<te;){var ve=z[q],be=u[ve];(be===n||Oi(be,bc[ve])&&!$t.call(u,ve))&&(u[ve]=R[ve])}return u}),Ice=ht(function(u){return u.push(n,sI),Hr(WI,n,u)});function Nce(u,h){return n5(u,Ve(h,3),Zi)}function Rce(u,h){return n5(u,Ve(h,3),Xx)}function Lce(u,h){return u==null?u:Kx(u,Ve(h,3),yr)}function $ce(u,h){return u==null?u:O5(u,Ve(h,3),yr)}function Fce(u,h){return u&&Zi(u,Ve(h,3))}function jce(u,h){return u&&Xx(u,Ve(h,3))}function zce(u){return u==null?[]:Og(u,An(u))}function Bce(u){return u==null?[]:Og(u,yr(u))}function k1(u,h,b){var E=u==null?n:Xa(u,h);return E===n?b:E}function Vce(u,h){return u!=null&&cI(u,h,dse)}function M1(u,h){return u!=null&&cI(u,h,fse)}var Hce=tI(function(u,h,b){h!=null&&typeof h.toString!="function"&&(h=hg.call(h)),u[h]=b},T1(xr)),Wce=tI(function(u,h,b){h!=null&&typeof h.toString!="function"&&(h=hg.call(h)),$t.call(u,h)?u[h].push(b):u[h]=[b]},Ve),qce=ht(jd);function An(u){return br(u)?y5(u):e1(u)}function yr(u){return br(u)?y5(u,!0):_se(u)}function Uce(u,h){var b={};return h=Ve(h,3),Zi(u,function(E,T,R){Po(b,h(E,T,R),E)}),b}function Gce(u,h){var b={};return h=Ve(h,3),Zi(u,function(E,T,R){Po(b,T,h(E,T,R))}),b}var Yce=_c(function(u,h,b){Pg(u,h,b)}),WI=_c(function(u,h,b,E){Pg(u,h,b,E)}),Kce=Mo(function(u,h){var b={};if(u==null)return b;var E=!1;h=rn(h,function(R){return R=Ps(R,u),E||(E=R.length>1),R}),eo(u,p1(u),b),E&&(b=ui(b,f|g|p,Hse));for(var T=h.length;T--;)s1(b,h[T]);return b});function Xce(u,h){return qI(u,Vg(Ve(h)))}var Qce=Mo(function(u,h){return u==null?{}:Cse(u,h)});function qI(u,h){if(u==null)return{};var b=rn(p1(u),function(E){return[E]});return h=Ve(h),L5(u,b,function(E,T){return h(E,T[0])})}function Jce(u,h,b){h=Ps(h,u);var E=-1,T=h.length;for(T||(T=1,u=n);++E<T;){var R=u==null?n:u[to(h[E])];R===n&&(E=T,R=b),u=To(R)?R.call(u):R}return u}function Zce(u,h,b){return u==null?u:Bd(u,h,b)}function eue(u,h,b,E){return E=typeof E=="function"?E:n,u==null?u:Bd(u,h,b,E)}var UI=iI(An),GI=iI(yr);function tue(u,h,b){var E=rt(u),T=E||Ms(u)||Ec(u);if(h=Ve(h,4),b==null){var R=u&&u.constructor;T?b=E?new R:[]:sn(u)?b=To(R)?wc(mg(u)):{}:b={}}return(T?ai:Zi)(u,function(z,q,te){return h(b,z,q,te)}),b}function nue(u,h){return u==null?!0:s1(u,h)}function rue(u,h,b){return u==null?u:B5(u,h,c1(b))}function iue(u,h,b,E){return E=typeof E=="function"?E:n,u==null?u:B5(u,h,c1(b),E)}function Oc(u){return u==null?[]:Bx(u,An(u))}function oue(u){return u==null?[]:Bx(u,yr(u))}function sue(u,h,b){return b===n&&(b=h,h=n),b!==n&&(b=hi(b),b=b===b?b:0),h!==n&&(h=hi(h),h=h===h?h:0),Ka(hi(u),h,b)}function aue(u,h,b){return h=Ao(h),b===n?(b=h,h=0):b=Ao(b),u=hi(u),hse(u,h,b)}function lue(u,h,b){if(b&&typeof b!="boolean"&&nr(u,h,b)&&(h=b=n),b===n&&(typeof h=="boolean"?(b=h,h=n):typeof u=="boolean"&&(b=u,u=n)),u===n&&h===n?(u=0,h=1):(u=Ao(u),h===n?(h=u,u=0):h=Ao(h)),u>h){var E=u;u=h,h=E}if(b||u%1||h%1){var T=v5();return Kn(u+T*(h-u+zie("1e-"+((T+"").length-1))),h)}return r1(u,h)}var cue=Sc(function(u,h,b){return h=h.toLowerCase(),u+(b?YI(h):h)});function YI(u){return D1(Rt(u).toLowerCase())}function KI(u){return u=Rt(u),u&&u.replace(zt,Zie).replace(Die,"")}function uue(u,h,b){u=Rt(u),h=qr(h);var E=u.length;b=b===n?E:Ka(lt(b),0,E);var T=b;return b-=h.length,b>=0&&u.slice(b,T)==h}function due(u){return u=Rt(u),u&&$a.test(u)?u.replace(Ji,eoe):u}function fue(u){return u=Rt(u),u&&Va.test(u)?u.replace(Ba,"\\$&"):u}var hue=Sc(function(u,h,b){return u+(b?"-":"")+h.toLowerCase()}),pue=Sc(function(u,h,b){return u+(b?" ":"")+h.toLowerCase()}),gue=J5("toLowerCase");function mue(u,h,b){u=Rt(u),h=lt(h);var E=h?mc(u):0;if(!h||E>=h)return u;var T=(h-E)/2;return Ig(xg(T),b)+u+Ig(yg(T),b)}function vue(u,h,b){u=Rt(u),h=lt(h);var E=h?mc(u):0;return h&&E<h?u+Ig(h-E,b):u}function bue(u,h,b){u=Rt(u),h=lt(h);var E=h?mc(u):0;return h&&E<h?Ig(h-E,b)+u:u}function yue(u,h,b){return b||h==null?h=0:h&&(h=+h),Ooe(Rt(u).replace(Ha,""),h||0)}function xue(u,h,b){return(b?nr(u,h,b):h===n)?h=1:h=lt(h),i1(Rt(u),h)}function wue(){var u=arguments,h=Rt(u[0]);return u.length<3?h:h.replace(u[1],u[2])}var _ue=Sc(function(u,h,b){return u+(b?"_":"")+h.toLowerCase()});function Sue(u,h,b){return b&&typeof b!="number"&&nr(u,h,b)&&(h=b=n),b=b===n?H:b>>>0,b?(u=Rt(u),u&&(typeof h=="string"||h!=null&&!P1(h))&&(h=qr(h),!h&&gc(u))?ks(Ci(u),0,b):u.split(h,b)):[]}var Cue=Sc(function(u,h,b){return u+(b?" ":"")+D1(h)});function Eue(u,h,b){return u=Rt(u),b=b==null?0:Ka(lt(b),0,u.length),h=qr(h),u.slice(b,b+h.length)==h}function Oue(u,h,b){var E=I.templateSettings;b&&nr(u,h,b)&&(h=n),u=Rt(u),h=qg({},h,E,oI);var T=qg({},h.imports,E.imports,oI),R=An(T),z=Bx(T,R),q,te,ve=0,be=h.interpolate||Tn,we="__p += '",De=Hx((h.escape||Tn).source+"|"+be.source+"|"+(be===fc?Re:Tn).source+"|"+(h.evaluate||Tn).source+"|$","g"),$e="//# sourceURL="+($t.call(h,"sourceURL")?(h.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Rie+"]")+`
|
|
68
|
+
`)}function Jse(u){return rt(u)||Za(u)||!!(g5&&u&&u[g5])}function Do(u,h){var b=typeof u;return h=h??ie,!!h&&(b=="number"||b!="symbol"&&nt.test(u))&&u>-1&&u%1==0&&u<h}function nr(u,h,b){if(!sn(b))return!1;var E=typeof h;return(E=="number"?br(b)&&Do(h,b.length):E=="string"&&h in b)?Oi(b[h],u):!1}function b1(u,h){if(rt(u))return!1;var b=typeof u;return b=="number"||b=="symbol"||b=="boolean"||u==null||Ur(u)?!0:za.test(u)||!ja.test(u)||h!=null&&u in Bt(h)}function Zse(u){var h=typeof u;return h=="string"||h=="number"||h=="symbol"||h=="boolean"?u!=="__proto__":u===null}function y1(u){var h=Rg(u),b=I[h];if(typeof b!="function"||!(h in Ct.prototype))return!1;if(u===b)return!0;var E=g1(b);return!!E&&u===E[0]}function eae(u){return!!d5&&d5 in u}var tae=dg?To:L1;function Hd(u){var h=u&&u.constructor,b=typeof h=="function"&&h.prototype||bc;return u===b}function dI(u){return u===u&&!sn(u)}function fI(u,h){return function(b){return b==null?!1:b[u]===h&&(h!==n||u in Bt(b))}}function nae(u){var h=Bg(u,function(E){return b.size===c&&b.clear(),E}),b=h.cache;return h}function rae(u,h){var b=u[1],E=h[1],T=b|E,R=T<(x|w|A),z=E==A&&b==C||E==A&&b==L&&u[7].length<=h[8]||E==(A|L)&&h[7].length<=h[8]&&b==C;if(!(R||z))return u;E&x&&(u[2]=h[2],T|=b&x?0:S);var q=h[3];if(q){var te=u[3];u[3]=te?Y5(te,q,h[4]):q,u[4]=te?Ss(u[3],d):h[4]}return q=h[5],q&&(te=u[5],u[5]=te?K5(te,q,h[6]):q,u[6]=te?Ss(u[5],d):h[6]),q=h[7],q&&(u[7]=q),E&A&&(u[8]=u[8]==null?h[8]:Kn(u[8],h[8])),u[9]==null&&(u[9]=h[9]),u[0]=h[0],u[1]=T,u}function iae(u){var h=[];if(u!=null)for(var b in Bt(u))h.push(b);return h}function oae(u){return hg.call(u)}function hI(u,h,b){return h=On(h===n?u.length-1:h,0),function(){for(var E=arguments,T=-1,R=On(E.length-h,0),z=ce(R);++T<R;)z[T]=E[h+T];T=-1;for(var q=ce(h+1);++T<h;)q[T]=E[T];return q[h]=b(z),Hr(u,this,q)}}function pI(u,h){return h.length<2?u:Xa(u,di(h,0,-1))}function sae(u,h){for(var b=u.length,E=Kn(h.length,b),T=vr(u);E--;){var R=h[E];u[E]=Do(R,b)?T[R]:n}return u}function x1(u,h){if(!(h==="constructor"&&typeof u[h]=="function")&&h!="__proto__")return u[h]}var gI=vI(F5),Wd=woe||function(u,h){return zn.setTimeout(u,h)},w1=vI(Mse);function mI(u,h,b){var E=h+"";return w1(u,Qse(E,aae(Yse(E),b)))}function vI(u){var h=0,b=0;return function(){var E=Eoe(),T=K-(E-b);if(b=E,T>0){if(++h>=V)return arguments[0]}else h=0;return u.apply(n,arguments)}}function $g(u,h){var b=-1,E=u.length,T=E-1;for(h=h===n?E:h;++b<h;){var R=r1(b,T),z=u[R];u[R]=u[b],u[b]=z}return u.length=h,u}var bI=nae(function(u){var h=[];return u.charCodeAt(0)===46&&h.push(""),u.replace(Pd,function(b,E,T,R){h.push(T?R.replace(Se,"$1"):E||b)}),h});function to(u){if(typeof u=="string"||Ur(u))return u;var h=u+"";return h=="0"&&1/u==-U?"-0":h}function Ja(u){if(u!=null){try{return fg.call(u)}catch{}try{return u+""}catch{}}return""}function aae(u,h){return ai(X,function(b){var E="_."+b[0];h&b[1]&&!ag(u,E)&&u.push(E)}),u.sort()}function yI(u){if(u instanceof Ct)return u.clone();var h=new ci(u.__wrapped__,u.__chain__);return h.__actions__=vr(u.__actions__),h.__index__=u.__index__,h.__values__=u.__values__,h}function lae(u,h,b){(b?nr(u,h,b):h===n)?h=1:h=On(ct(h),0);var E=u==null?0:u.length;if(!E||h<1)return[];for(var T=0,R=0,z=ce(yg(E/h));T<E;)z[R++]=di(u,T,T+=h);return z}function cae(u){for(var h=-1,b=u==null?0:u.length,E=0,T=[];++h<b;){var R=u[h];R&&(T[E++]=R)}return T}function uae(){var u=arguments.length;if(!u)return[];for(var h=ce(u-1),b=arguments[0],E=u;E--;)h[E-1]=arguments[E];return _s(rt(b)?vr(b):[b],Bn(h,1))}var dae=ht(function(u,h){return gn(u)?Fd(u,Bn(h,1,gn,!0)):[]}),fae=ht(function(u,h){var b=fi(h);return gn(b)&&(b=n),gn(u)?Fd(u,Bn(h,1,gn,!0),Ve(b,2)):[]}),hae=ht(function(u,h){var b=fi(h);return gn(b)&&(b=n),gn(u)?Fd(u,Bn(h,1,gn,!0),n,b):[]});function pae(u,h,b){var E=u==null?0:u.length;return E?(h=b||h===n?1:ct(h),di(u,h<0?0:h,E)):[]}function gae(u,h,b){var E=u==null?0:u.length;return E?(h=b||h===n?1:ct(h),h=E-h,di(u,0,h<0?0:h)):[]}function mae(u,h){return u&&u.length?Mg(u,Ve(h,3),!0,!0):[]}function vae(u,h){return u&&u.length?Mg(u,Ve(h,3),!0):[]}function bae(u,h,b,E){var T=u==null?0:u.length;return T?(b&&typeof b!="number"&&nr(u,h,b)&&(b=0,E=T),use(u,h,b,E)):[]}function xI(u,h,b){var E=u==null?0:u.length;if(!E)return-1;var T=b==null?0:ct(b);return T<0&&(T=On(E+T,0)),lg(u,Ve(h,3),T)}function wI(u,h,b){var E=u==null?0:u.length;if(!E)return-1;var T=E-1;return b!==n&&(T=ct(b),T=b<0?On(E+T,0):Kn(T,E-1)),lg(u,Ve(h,3),T,!0)}function _I(u){var h=u==null?0:u.length;return h?Bn(u,1):[]}function yae(u){var h=u==null?0:u.length;return h?Bn(u,U):[]}function xae(u,h){var b=u==null?0:u.length;return b?(h=h===n?1:ct(h),Bn(u,h)):[]}function wae(u){for(var h=-1,b=u==null?0:u.length,E={};++h<b;){var T=u[h];E[T[0]]=T[1]}return E}function SI(u){return u&&u.length?u[0]:n}function _ae(u,h,b){var E=u==null?0:u.length;if(!E)return-1;var T=b==null?0:ct(b);return T<0&&(T=On(E+T,0)),pc(u,h,T)}function Sae(u){var h=u==null?0:u.length;return h?di(u,0,-1):[]}var Cae=ht(function(u){var h=rn(u,l1);return h.length&&h[0]===u[0]?Jx(h):[]}),Eae=ht(function(u){var h=fi(u),b=rn(u,l1);return h===fi(b)?h=n:b.pop(),b.length&&b[0]===u[0]?Jx(b,Ve(h,2)):[]}),Oae=ht(function(u){var h=fi(u),b=rn(u,l1);return h=typeof h=="function"?h:n,h&&b.pop(),b.length&&b[0]===u[0]?Jx(b,n,h):[]});function Pae(u,h){return u==null?"":Soe.call(u,h)}function fi(u){var h=u==null?0:u.length;return h?u[h-1]:n}function kae(u,h,b){var E=u==null?0:u.length;if(!E)return-1;var T=E;return b!==n&&(T=ct(b),T=T<0?On(E+T,0):Kn(T,E-1)),h===h?aoe(u,h,T):lg(u,r5,T,!0)}function Mae(u,h){return u&&u.length?N5(u,ct(h)):n}var Dae=ht(CI);function CI(u,h){return u&&u.length&&h&&h.length?n1(u,h):u}function Tae(u,h,b){return u&&u.length&&h&&h.length?n1(u,h,Ve(b,2)):u}function Aae(u,h,b){return u&&u.length&&h&&h.length?n1(u,h,n,b):u}var Iae=Mo(function(u,h){var b=u==null?0:u.length,E=Yx(u,h);return $5(u,rn(h,function(T){return Do(T,b)?+T:T}).sort(G5)),E});function Nae(u,h){var b=[];if(!(u&&u.length))return b;var E=-1,T=[],R=u.length;for(h=Ve(h,3);++E<R;){var z=u[E];h(z,E,u)&&(b.push(z),T.push(E))}return $5(u,T),b}function _1(u){return u==null?u:Poe.call(u)}function Rae(u,h,b){var E=u==null?0:u.length;return E?(b&&typeof b!="number"&&nr(u,h,b)?(h=0,b=E):(h=h==null?0:ct(h),b=b===n?E:ct(b)),di(u,h,b)):[]}function Lae(u,h){return kg(u,h)}function $ae(u,h,b){return o1(u,h,Ve(b,2))}function Fae(u,h){var b=u==null?0:u.length;if(b){var E=kg(u,h);if(E<b&&Oi(u[E],h))return E}return-1}function jae(u,h){return kg(u,h,!0)}function zae(u,h,b){return o1(u,h,Ve(b,2),!0)}function Bae(u,h){var b=u==null?0:u.length;if(b){var E=kg(u,h,!0)-1;if(Oi(u[E],h))return E}return-1}function Vae(u){return u&&u.length?j5(u):[]}function Hae(u,h){return u&&u.length?j5(u,Ve(h,2)):[]}function Wae(u){var h=u==null?0:u.length;return h?di(u,1,h):[]}function qae(u,h,b){return u&&u.length?(h=b||h===n?1:ct(h),di(u,0,h<0?0:h)):[]}function Uae(u,h,b){var E=u==null?0:u.length;return E?(h=b||h===n?1:ct(h),h=E-h,di(u,h<0?0:h,E)):[]}function Gae(u,h){return u&&u.length?Mg(u,Ve(h,3),!1,!0):[]}function Yae(u,h){return u&&u.length?Mg(u,Ve(h,3)):[]}var Kae=ht(function(u){return Os(Bn(u,1,gn,!0))}),Xae=ht(function(u){var h=fi(u);return gn(h)&&(h=n),Os(Bn(u,1,gn,!0),Ve(h,2))}),Qae=ht(function(u){var h=fi(u);return h=typeof h=="function"?h:n,Os(Bn(u,1,gn,!0),n,h)});function Jae(u){return u&&u.length?Os(u):[]}function Zae(u,h){return u&&u.length?Os(u,Ve(h,2)):[]}function ele(u,h){return h=typeof h=="function"?h:n,u&&u.length?Os(u,n,h):[]}function S1(u){if(!(u&&u.length))return[];var h=0;return u=ws(u,function(b){if(gn(b))return h=On(b.length,h),!0}),zx(h,function(b){return rn(u,$x(b))})}function EI(u,h){if(!(u&&u.length))return[];var b=S1(u);return h==null?b:rn(b,function(E){return Hr(h,n,E)})}var tle=ht(function(u,h){return gn(u)?Fd(u,h):[]}),nle=ht(function(u){return a1(ws(u,gn))}),rle=ht(function(u){var h=fi(u);return gn(h)&&(h=n),a1(ws(u,gn),Ve(h,2))}),ile=ht(function(u){var h=fi(u);return h=typeof h=="function"?h:n,a1(ws(u,gn),n,h)}),ole=ht(S1);function sle(u,h){return H5(u||[],h||[],$d)}function ale(u,h){return H5(u||[],h||[],Bd)}var lle=ht(function(u){var h=u.length,b=h>1?u[h-1]:n;return b=typeof b=="function"?(u.pop(),b):n,EI(u,b)});function OI(u){var h=I(u);return h.__chain__=!0,h}function cle(u,h){return h(u),u}function Fg(u,h){return h(u)}var ule=Mo(function(u){var h=u.length,b=h?u[0]:0,E=this.__wrapped__,T=function(R){return Yx(R,u)};return h>1||this.__actions__.length||!(E instanceof Ct)||!Do(b)?this.thru(T):(E=E.slice(b,+b+(h?1:0)),E.__actions__.push({func:Fg,args:[T],thisArg:n}),new ci(E,this.__chain__).thru(function(R){return h&&!R.length&&R.push(n),R}))});function dle(){return OI(this)}function fle(){return new ci(this.value(),this.__chain__)}function hle(){this.__values__===n&&(this.__values__=zI(this.value()));var u=this.__index__>=this.__values__.length,h=u?n:this.__values__[this.__index__++];return{done:u,value:h}}function ple(){return this}function gle(u){for(var h,b=this;b instanceof Sg;){var E=yI(b);E.__index__=0,E.__values__=n,h?T.__wrapped__=E:h=E;var T=E;b=b.__wrapped__}return T.__wrapped__=u,h}function mle(){var u=this.__wrapped__;if(u instanceof Ct){var h=u;return this.__actions__.length&&(h=new Ct(this)),h=h.reverse(),h.__actions__.push({func:Fg,args:[_1],thisArg:n}),new ci(h,this.__chain__)}return this.thru(_1)}function vle(){return V5(this.__wrapped__,this.__actions__)}var ble=Dg(function(u,h,b){$t.call(u,b)?++u[b]:Po(u,b,1)});function yle(u,h,b){var E=rt(u)?t5:cse;return b&&nr(u,h,b)&&(h=n),E(u,Ve(h,3))}function xle(u,h){var b=rt(u)?ws:E5;return b(u,Ve(h,3))}var wle=Z5(xI),_le=Z5(wI);function Sle(u,h){return Bn(jg(u,h),1)}function Cle(u,h){return Bn(jg(u,h),U)}function Ele(u,h,b){return b=b===n?1:ct(b),Bn(jg(u,h),b)}function PI(u,h){var b=rt(u)?ai:Es;return b(u,Ve(h,3))}function kI(u,h){var b=rt(u)?Wie:C5;return b(u,Ve(h,3))}var Ole=Dg(function(u,h,b){$t.call(u,b)?u[b].push(h):Po(u,b,[h])});function Ple(u,h,b,E){u=br(u)?u:Oc(u),b=b&&!E?ct(b):0;var T=u.length;return b<0&&(b=On(T+b,0)),Wg(u)?b<=T&&u.indexOf(h,b)>-1:!!T&&pc(u,h,b)>-1}var kle=ht(function(u,h,b){var E=-1,T=typeof h=="function",R=br(u)?ce(u.length):[];return Es(u,function(z){R[++E]=T?Hr(h,z,b):jd(z,h,b)}),R}),Mle=Dg(function(u,h,b){Po(u,b,h)});function jg(u,h){var b=rt(u)?rn:T5;return b(u,Ve(h,3))}function Dle(u,h,b,E){return u==null?[]:(rt(h)||(h=h==null?[]:[h]),b=E?n:b,rt(b)||(b=b==null?[]:[b]),R5(u,h,b))}var Tle=Dg(function(u,h,b){u[b?0:1].push(h)},function(){return[[],[]]});function Ale(u,h,b){var E=rt(u)?Rx:o5,T=arguments.length<3;return E(u,Ve(h,4),b,T,Es)}function Ile(u,h,b){var E=rt(u)?qie:o5,T=arguments.length<3;return E(u,Ve(h,4),b,T,C5)}function Nle(u,h){var b=rt(u)?ws:E5;return b(u,Vg(Ve(h,3)))}function Rle(u){var h=rt(u)?x5:Pse;return h(u)}function Lle(u,h,b){(b?nr(u,h,b):h===n)?h=1:h=ct(h);var E=rt(u)?ise:kse;return E(u,h)}function $le(u){var h=rt(u)?ose:Dse;return h(u)}function Fle(u){if(u==null)return 0;if(br(u))return Wg(u)?mc(u):u.length;var h=Xn(u);return h==Fe||h==Zt?u.size:e1(u).length}function jle(u,h,b){var E=rt(u)?Lx:Tse;return b&&nr(u,h,b)&&(h=n),E(u,Ve(h,3))}var zle=ht(function(u,h){if(u==null)return[];var b=h.length;return b>1&&nr(u,h[0],h[1])?h=[]:b>2&&nr(h[0],h[1],h[2])&&(h=[h[0]]),R5(u,Bn(h,1),[])}),zg=xoe||function(){return zn.Date.now()};function Ble(u,h){if(typeof h!="function")throw new li(s);return u=ct(u),function(){if(--u<1)return h.apply(this,arguments)}}function MI(u,h,b){return h=b?n:h,h=u&&h==null?u.length:h,ko(u,A,n,n,n,n,h)}function DI(u,h){var b;if(typeof h!="function")throw new li(s);return u=ct(u),function(){return--u>0&&(b=h.apply(this,arguments)),u<=1&&(h=n),b}}var C1=ht(function(u,h,b){var E=x;if(b.length){var T=Ss(b,Cc(C1));E|=O}return ko(u,E,h,b,T)}),TI=ht(function(u,h,b){var E=x|w;if(b.length){var T=Ss(b,Cc(TI));E|=O}return ko(h,E,u,b,T)});function AI(u,h,b){h=b?n:h;var E=ko(u,C,n,n,n,n,n,h);return E.placeholder=AI.placeholder,E}function II(u,h,b){h=b?n:h;var E=ko(u,P,n,n,n,n,n,h);return E.placeholder=II.placeholder,E}function NI(u,h,b){var E,T,R,z,q,te,ve=0,be=!1,we=!1,De=!0;if(typeof u!="function")throw new li(s);h=hi(h)||0,sn(b)&&(be=!!b.leading,we="maxWait"in b,R=we?On(hi(b.maxWait)||0,h):R,De="trailing"in b?!!b.trailing:De);function $e(mn){var Pi=E,Io=T;return E=T=n,ve=mn,z=u.apply(Io,Pi),z}function We(mn){return ve=mn,q=Wd(_t,h),be?$e(mn):z}function ft(mn){var Pi=mn-te,Io=mn-ve,ZI=h-Pi;return we?Kn(ZI,R-Io):ZI}function qe(mn){var Pi=mn-te,Io=mn-ve;return te===n||Pi>=h||Pi<0||we&&Io>=R}function _t(){var mn=zg();if(qe(mn))return Et(mn);q=Wd(_t,ft(mn))}function Et(mn){return q=n,De&&E?$e(mn):(E=T=n,z)}function Gr(){q!==n&&W5(q),ve=0,E=te=T=q=n}function rr(){return q===n?z:Et(zg())}function Yr(){var mn=zg(),Pi=qe(mn);if(E=arguments,T=this,te=mn,Pi){if(q===n)return We(te);if(we)return W5(q),q=Wd(_t,h),$e(te)}return q===n&&(q=Wd(_t,h)),z}return Yr.cancel=Gr,Yr.flush=rr,Yr}var Vle=ht(function(u,h){return S5(u,1,h)}),Hle=ht(function(u,h,b){return S5(u,hi(h)||0,b)});function Wle(u){return ko(u,F)}function Bg(u,h){if(typeof u!="function"||h!=null&&typeof h!="function")throw new li(s);var b=function(){var E=arguments,T=h?h.apply(this,E):E[0],R=b.cache;if(R.has(T))return R.get(T);var z=u.apply(this,E);return b.cache=R.set(T,z)||R,z};return b.cache=new(Bg.Cache||Oo),b}Bg.Cache=Oo;function Vg(u){if(typeof u!="function")throw new li(s);return function(){var h=arguments;switch(h.length){case 0:return!u.call(this);case 1:return!u.call(this,h[0]);case 2:return!u.call(this,h[0],h[1]);case 3:return!u.call(this,h[0],h[1],h[2])}return!u.apply(this,h)}}function qle(u){return DI(2,u)}var Ule=Ase(function(u,h){h=h.length==1&&rt(h[0])?rn(h[0],Wr(Ve())):rn(Bn(h,1),Wr(Ve()));var b=h.length;return ht(function(E){for(var T=-1,R=Kn(E.length,b);++T<R;)E[T]=h[T].call(this,E[T]);return Hr(u,this,E)})}),E1=ht(function(u,h){var b=Ss(h,Cc(E1));return ko(u,O,n,h,b)}),RI=ht(function(u,h){var b=Ss(h,Cc(RI));return ko(u,k,n,h,b)}),Gle=Mo(function(u,h){return ko(u,L,n,n,n,h)});function Yle(u,h){if(typeof u!="function")throw new li(s);return h=h===n?h:ct(h),ht(u,h)}function Kle(u,h){if(typeof u!="function")throw new li(s);return h=h==null?0:On(ct(h),0),ht(function(b){var E=b[h],T=ks(b,0,h);return E&&_s(T,E),Hr(u,this,T)})}function Xle(u,h,b){var E=!0,T=!0;if(typeof u!="function")throw new li(s);return sn(b)&&(E="leading"in b?!!b.leading:E,T="trailing"in b?!!b.trailing:T),NI(u,h,{leading:E,maxWait:h,trailing:T})}function Qle(u){return MI(u,1)}function Jle(u,h){return E1(c1(h),u)}function Zle(){if(!arguments.length)return[];var u=arguments[0];return rt(u)?u:[u]}function ece(u){return ui(u,p)}function tce(u,h){return h=typeof h=="function"?h:n,ui(u,p,h)}function nce(u){return ui(u,f|p)}function rce(u,h){return h=typeof h=="function"?h:n,ui(u,f|p,h)}function ice(u,h){return h==null||_5(u,h,An(h))}function Oi(u,h){return u===h||u!==u&&h!==h}var oce=Ng(Qx),sce=Ng(function(u,h){return u>=h}),Za=k5(function(){return arguments}())?k5:function(u){return cn(u)&&$t.call(u,"callee")&&!p5.call(u,"callee")},rt=ce.isArray,ace=KA?Wr(KA):gse;function br(u){return u!=null&&Hg(u.length)&&!To(u)}function gn(u){return cn(u)&&br(u)}function lce(u){return u===!0||u===!1||cn(u)&&tr(u)==re}var Ms=_oe||L1,cce=XA?Wr(XA):mse;function uce(u){return cn(u)&&u.nodeType===1&&!qd(u)}function dce(u){if(u==null)return!0;if(br(u)&&(rt(u)||typeof u=="string"||typeof u.splice=="function"||Ms(u)||Ec(u)||Za(u)))return!u.length;var h=Xn(u);if(h==Fe||h==Zt)return!u.size;if(Hd(u))return!e1(u).length;for(var b in u)if($t.call(u,b))return!1;return!0}function fce(u,h){return zd(u,h)}function hce(u,h,b){b=typeof b=="function"?b:n;var E=b?b(u,h):n;return E===n?zd(u,h,n,b):!!E}function O1(u){if(!cn(u))return!1;var h=tr(u);return h==ye||h==W||typeof u.message=="string"&&typeof u.name=="string"&&!qd(u)}function pce(u){return typeof u=="number"&&m5(u)}function To(u){if(!sn(u))return!1;var h=tr(u);return h==oe||h==Te||h==de||h==bt}function LI(u){return typeof u=="number"&&u==ct(u)}function Hg(u){return typeof u=="number"&&u>-1&&u%1==0&&u<=ie}function sn(u){var h=typeof u;return u!=null&&(h=="object"||h=="function")}function cn(u){return u!=null&&typeof u=="object"}var $I=QA?Wr(QA):bse;function gce(u,h){return u===h||Zx(u,h,m1(h))}function mce(u,h,b){return b=typeof b=="function"?b:n,Zx(u,h,m1(h),b)}function vce(u){return FI(u)&&u!=+u}function bce(u){if(tae(u))throw new Ze(o);return M5(u)}function yce(u){return u===null}function xce(u){return u==null}function FI(u){return typeof u=="number"||cn(u)&&tr(u)==He}function qd(u){if(!cn(u)||tr(u)!=St)return!1;var h=mg(u);if(h===null)return!0;var b=$t.call(h,"constructor")&&h.constructor;return typeof b=="function"&&b instanceof b&&fg.call(b)==moe}var P1=JA?Wr(JA):yse;function wce(u){return LI(u)&&u>=-ie&&u<=ie}var jI=ZA?Wr(ZA):xse;function Wg(u){return typeof u=="string"||!rt(u)&&cn(u)&&tr(u)==Dn}function Ur(u){return typeof u=="symbol"||cn(u)&&tr(u)==fn}var Ec=e5?Wr(e5):wse;function _ce(u){return u===n}function Sce(u){return cn(u)&&Xn(u)==fe}function Cce(u){return cn(u)&&tr(u)==Oe}var Ece=Ng(t1),Oce=Ng(function(u,h){return u<=h});function zI(u){if(!u)return[];if(br(u))return Wg(u)?Ci(u):vr(u);if(Ad&&u[Ad])return ioe(u[Ad]());var h=Xn(u),b=h==Fe?Vx:h==Zt?cg:Oc;return b(u)}function Ao(u){if(!u)return u===0?u:0;if(u=hi(u),u===U||u===-U){var h=u<0?-1:1;return h*le}return u===u?u:0}function ct(u){var h=Ao(u),b=h%1;return h===h?b?h-b:h:0}function BI(u){return u?Ka(ct(u),0,H):0}function hi(u){if(typeof u=="number")return u;if(Ur(u))return M;if(sn(u)){var h=typeof u.valueOf=="function"?u.valueOf():u;u=sn(h)?h+"":h}if(typeof u!="string")return u===0?u:+u;u=s5(u);var b=Me.test(u);return b||Je.test(u)?Bie(u.slice(2),b?2:8):Ae.test(u)?M:+u}function VI(u){return eo(u,yr(u))}function Pce(u){return u?Ka(ct(u),-ie,ie):u===0?u:0}function Rt(u){return u==null?"":qr(u)}var kce=_c(function(u,h){if(Hd(h)||br(h)){eo(h,An(h),u);return}for(var b in h)$t.call(h,b)&&$d(u,b,h[b])}),HI=_c(function(u,h){eo(h,yr(h),u)}),qg=_c(function(u,h,b,E){eo(h,yr(h),u,E)}),Mce=_c(function(u,h,b,E){eo(h,An(h),u,E)}),Dce=Mo(Yx);function Tce(u,h){var b=wc(u);return h==null?b:w5(b,h)}var Ace=ht(function(u,h){u=Bt(u);var b=-1,E=h.length,T=E>2?h[2]:n;for(T&&nr(h[0],h[1],T)&&(E=1);++b<E;)for(var R=h[b],z=yr(R),q=-1,te=z.length;++q<te;){var ve=z[q],be=u[ve];(be===n||Oi(be,bc[ve])&&!$t.call(u,ve))&&(u[ve]=R[ve])}return u}),Ice=ht(function(u){return u.push(n,sI),Hr(WI,n,u)});function Nce(u,h){return n5(u,Ve(h,3),Zi)}function Rce(u,h){return n5(u,Ve(h,3),Xx)}function Lce(u,h){return u==null?u:Kx(u,Ve(h,3),yr)}function $ce(u,h){return u==null?u:O5(u,Ve(h,3),yr)}function Fce(u,h){return u&&Zi(u,Ve(h,3))}function jce(u,h){return u&&Xx(u,Ve(h,3))}function zce(u){return u==null?[]:Og(u,An(u))}function Bce(u){return u==null?[]:Og(u,yr(u))}function k1(u,h,b){var E=u==null?n:Xa(u,h);return E===n?b:E}function Vce(u,h){return u!=null&&cI(u,h,dse)}function M1(u,h){return u!=null&&cI(u,h,fse)}var Hce=tI(function(u,h,b){h!=null&&typeof h.toString!="function"&&(h=hg.call(h)),u[h]=b},T1(xr)),Wce=tI(function(u,h,b){h!=null&&typeof h.toString!="function"&&(h=hg.call(h)),$t.call(u,h)?u[h].push(b):u[h]=[b]},Ve),qce=ht(jd);function An(u){return br(u)?y5(u):e1(u)}function yr(u){return br(u)?y5(u,!0):_se(u)}function Uce(u,h){var b={};return h=Ve(h,3),Zi(u,function(E,T,R){Po(b,h(E,T,R),E)}),b}function Gce(u,h){var b={};return h=Ve(h,3),Zi(u,function(E,T,R){Po(b,T,h(E,T,R))}),b}var Yce=_c(function(u,h,b){Pg(u,h,b)}),WI=_c(function(u,h,b,E){Pg(u,h,b,E)}),Kce=Mo(function(u,h){var b={};if(u==null)return b;var E=!1;h=rn(h,function(R){return R=Ps(R,u),E||(E=R.length>1),R}),eo(u,p1(u),b),E&&(b=ui(b,f|g|p,Hse));for(var T=h.length;T--;)s1(b,h[T]);return b});function Xce(u,h){return qI(u,Vg(Ve(h)))}var Qce=Mo(function(u,h){return u==null?{}:Cse(u,h)});function qI(u,h){if(u==null)return{};var b=rn(p1(u),function(E){return[E]});return h=Ve(h),L5(u,b,function(E,T){return h(E,T[0])})}function Jce(u,h,b){h=Ps(h,u);var E=-1,T=h.length;for(T||(T=1,u=n);++E<T;){var R=u==null?n:u[to(h[E])];R===n&&(E=T,R=b),u=To(R)?R.call(u):R}return u}function Zce(u,h,b){return u==null?u:Bd(u,h,b)}function eue(u,h,b,E){return E=typeof E=="function"?E:n,u==null?u:Bd(u,h,b,E)}var UI=iI(An),GI=iI(yr);function tue(u,h,b){var E=rt(u),T=E||Ms(u)||Ec(u);if(h=Ve(h,4),b==null){var R=u&&u.constructor;T?b=E?new R:[]:sn(u)?b=To(R)?wc(mg(u)):{}:b={}}return(T?ai:Zi)(u,function(z,q,te){return h(b,z,q,te)}),b}function nue(u,h){return u==null?!0:s1(u,h)}function rue(u,h,b){return u==null?u:B5(u,h,c1(b))}function iue(u,h,b,E){return E=typeof E=="function"?E:n,u==null?u:B5(u,h,c1(b),E)}function Oc(u){return u==null?[]:Bx(u,An(u))}function oue(u){return u==null?[]:Bx(u,yr(u))}function sue(u,h,b){return b===n&&(b=h,h=n),b!==n&&(b=hi(b),b=b===b?b:0),h!==n&&(h=hi(h),h=h===h?h:0),Ka(hi(u),h,b)}function aue(u,h,b){return h=Ao(h),b===n?(b=h,h=0):b=Ao(b),u=hi(u),hse(u,h,b)}function lue(u,h,b){if(b&&typeof b!="boolean"&&nr(u,h,b)&&(h=b=n),b===n&&(typeof h=="boolean"?(b=h,h=n):typeof u=="boolean"&&(b=u,u=n)),u===n&&h===n?(u=0,h=1):(u=Ao(u),h===n?(h=u,u=0):h=Ao(h)),u>h){var E=u;u=h,h=E}if(b||u%1||h%1){var T=v5();return Kn(u+T*(h-u+zie("1e-"+((T+"").length-1))),h)}return r1(u,h)}var cue=Sc(function(u,h,b){return h=h.toLowerCase(),u+(b?YI(h):h)});function YI(u){return D1(Rt(u).toLowerCase())}function KI(u){return u=Rt(u),u&&u.replace(zt,Zie).replace(Die,"")}function uue(u,h,b){u=Rt(u),h=qr(h);var E=u.length;b=b===n?E:Ka(ct(b),0,E);var T=b;return b-=h.length,b>=0&&u.slice(b,T)==h}function due(u){return u=Rt(u),u&&$a.test(u)?u.replace(Ji,eoe):u}function fue(u){return u=Rt(u),u&&Va.test(u)?u.replace(Ba,"\\$&"):u}var hue=Sc(function(u,h,b){return u+(b?"-":"")+h.toLowerCase()}),pue=Sc(function(u,h,b){return u+(b?" ":"")+h.toLowerCase()}),gue=J5("toLowerCase");function mue(u,h,b){u=Rt(u),h=ct(h);var E=h?mc(u):0;if(!h||E>=h)return u;var T=(h-E)/2;return Ig(xg(T),b)+u+Ig(yg(T),b)}function vue(u,h,b){u=Rt(u),h=ct(h);var E=h?mc(u):0;return h&&E<h?u+Ig(h-E,b):u}function bue(u,h,b){u=Rt(u),h=ct(h);var E=h?mc(u):0;return h&&E<h?Ig(h-E,b)+u:u}function yue(u,h,b){return b||h==null?h=0:h&&(h=+h),Ooe(Rt(u).replace(Ha,""),h||0)}function xue(u,h,b){return(b?nr(u,h,b):h===n)?h=1:h=ct(h),i1(Rt(u),h)}function wue(){var u=arguments,h=Rt(u[0]);return u.length<3?h:h.replace(u[1],u[2])}var _ue=Sc(function(u,h,b){return u+(b?"_":"")+h.toLowerCase()});function Sue(u,h,b){return b&&typeof b!="number"&&nr(u,h,b)&&(h=b=n),b=b===n?H:b>>>0,b?(u=Rt(u),u&&(typeof h=="string"||h!=null&&!P1(h))&&(h=qr(h),!h&&gc(u))?ks(Ci(u),0,b):u.split(h,b)):[]}var Cue=Sc(function(u,h,b){return u+(b?" ":"")+D1(h)});function Eue(u,h,b){return u=Rt(u),b=b==null?0:Ka(ct(b),0,u.length),h=qr(h),u.slice(b,b+h.length)==h}function Oue(u,h,b){var E=I.templateSettings;b&&nr(u,h,b)&&(h=n),u=Rt(u),h=qg({},h,E,oI);var T=qg({},h.imports,E.imports,oI),R=An(T),z=Bx(T,R),q,te,ve=0,be=h.interpolate||Tn,we="__p += '",De=Hx((h.escape||Tn).source+"|"+be.source+"|"+(be===fc?Re:Tn).source+"|"+(h.evaluate||Tn).source+"|$","g"),$e="//# sourceURL="+($t.call(h,"sourceURL")?(h.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Rie+"]")+`
|
|
69
69
|
`;u.replace(De,function(qe,_t,Et,Gr,rr,Yr){return Et||(Et=Gr),we+=u.slice(ve,Yr).replace(Wa,toe),_t&&(q=!0,we+=`' +
|
|
70
70
|
__e(`+_t+`) +
|
|
71
71
|
'`),rr&&(te=!0,we+=`';
|
|
@@ -82,7 +82,7 @@ __p += '`),Et&&(we+=`' +
|
|
|
82
82
|
function print() { __p += __j.call(arguments, '') }
|
|
83
83
|
`:`;
|
|
84
84
|
`)+we+`return __p
|
|
85
|
-
}`;var ft=QI(function(){return Tt(R,$e+"return "+we).apply(n,z)});if(ft.source=we,O1(ft))throw ft;return ft}function Pue(u){return Rt(u).toLowerCase()}function kue(u){return Rt(u).toUpperCase()}function Mue(u,h,b){if(u=Rt(u),u&&(b||h===n))return s5(u);if(!u||!(h=qr(h)))return u;var E=Ci(u),T=Ci(h),R=a5(E,T),z=l5(E,T)+1;return ks(E,R,z).join("")}function Due(u,h,b){if(u=Rt(u),u&&(b||h===n))return u.slice(0,u5(u)+1);if(!u||!(h=qr(h)))return u;var E=Ci(u),T=l5(E,Ci(h))+1;return ks(E,0,T).join("")}function Tue(u,h,b){if(u=Rt(u),u&&(b||h===n))return u.replace(Ha,"");if(!u||!(h=qr(h)))return u;var E=Ci(u),T=a5(E,Ci(h));return ks(E,T).join("")}function Aue(u,h){var b=j,E=B;if(sn(h)){var T="separator"in h?h.separator:T;b="length"in h?lt(h.length):b,E="omission"in h?qr(h.omission):E}u=Rt(u);var R=u.length;if(gc(u)){var z=Ci(u);R=z.length}if(b>=R)return u;var q=b-mc(E);if(q<1)return E;var te=z?ks(z,0,q).join(""):u.slice(0,q);if(T===n)return te+E;if(z&&(q+=te.length-q),P1(T)){if(u.slice(q).search(T)){var ve,be=te;for(T.global||(T=Hx(T.source,Rt(je.exec(T))+"g")),T.lastIndex=0;ve=T.exec(be);)var we=ve.index;te=te.slice(0,we===n?q:we)}}else if(u.indexOf(qr(T),q)!=q){var De=te.lastIndexOf(T);De>-1&&(te=te.slice(0,De))}return te+E}function Iue(u){return u=Rt(u),u&&Co.test(u)?u.replace(Yn,loe):u}var Nue=Sc(function(u,h,b){return u+(b?" ":"")+h.toUpperCase()}),D1=J5("toUpperCase");function XI(u,h,b){return u=Rt(u),h=b?n:h,h===n?roe(u)?doe(u):Yie(u):u.match(h)||[]}var QI=ht(function(u,h){try{return Hr(u,n,h)}catch(b){return O1(b)?b:new Ze(b)}}),Rue=Mo(function(u,h){return ai(h,function(b){b=to(b),Po(u,b,C1(u[b],u))}),u});function Lue(u){var h=u==null?0:u.length,b=Ve();return u=h?rn(u,function(E){if(typeof E[1]!="function")throw new li(s);return[b(E[0]),E[1]]}):[],ht(function(E){for(var T=-1;++T<h;){var R=u[T];if(Hr(R[0],this,E))return Hr(R[1],this,E)}})}function $ue(u){return lse(ui(u,f))}function T1(u){return function(){return u}}function Fue(u,h){return u==null||u!==u?h:u}var jue=eI(),zue=eI(!0);function xr(u){return u}function A1(u){return D5(typeof u=="function"?u:ui(u,f))}function Bue(u){return A5(ui(u,f))}function Vue(u,h){return I5(u,ui(h,f))}var Hue=ht(function(u,h){return function(b){return jd(b,u,h)}}),Wue=ht(function(u,h){return function(b){return jd(u,b,h)}});function I1(u,h,b){var E=An(h),T=Og(h,E);b==null&&!(sn(h)&&(T.length||!E.length))&&(b=h,h=u,u=this,T=Og(h,An(h)));var R=!(sn(b)&&"chain"in b)||!!b.chain,z=To(u);return ai(T,function(q){var te=h[q];u[q]=te,z&&(u.prototype[q]=function(){var ve=this.__chain__;if(R||ve){var be=u(this.__wrapped__),we=be.__actions__=vr(this.__actions__);return we.push({func:te,args:arguments,thisArg:u}),be.__chain__=ve,be}return te.apply(u,_s([this.value()],arguments))})}),u}function que(){return zn._===this&&(zn._=voe),this}function N1(){}function Uue(u){return u=lt(u),ht(function(h){return N5(h,u)})}var Gue=d1(rn),Yue=d1(t5),Kue=d1(Lx);function JI(u){return b1(u)?$x(to(u)):Ese(u)}function Xue(u){return function(h){return u==null?n:Xa(u,h)}}var Que=nI(),Jue=nI(!0);function R1(){return[]}function L1(){return!1}function Zue(){return{}}function ede(){return""}function tde(){return!0}function nde(u,h){if(u=lt(u),u<1||u>ie)return[];var b=H,E=Kn(u,H);h=Ve(h),u-=H;for(var T=zx(E,h);++b<u;)h(b);return T}function rde(u){return rt(u)?rn(u,to):Ur(u)?[u]:vr(bI(Rt(u)))}function ide(u){var h=++goe;return Rt(u)+h}var ode=Ag(function(u,h){return u+h},0),sde=f1("ceil"),ade=Ag(function(u,h){return u/h},1),lde=f1("floor");function cde(u){return u&&u.length?Eg(u,xr,Qx):n}function ude(u,h){return u&&u.length?Eg(u,Ve(h,2),Qx):n}function dde(u){return i5(u,xr)}function fde(u,h){return i5(u,Ve(h,2))}function hde(u){return u&&u.length?Eg(u,xr,t1):n}function pde(u,h){return u&&u.length?Eg(u,Ve(h,2),t1):n}var gde=Ag(function(u,h){return u*h},1),mde=f1("round"),vde=Ag(function(u,h){return u-h},0);function bde(u){return u&&u.length?jx(u,xr):0}function yde(u,h){return u&&u.length?jx(u,Ve(h,2)):0}return I.after=Ble,I.ary=MI,I.assign=kce,I.assignIn=HI,I.assignInWith=qg,I.assignWith=Mce,I.at=Dce,I.before=DI,I.bind=C1,I.bindAll=Rue,I.bindKey=TI,I.castArray=Zle,I.chain=OI,I.chunk=lae,I.compact=cae,I.concat=uae,I.cond=Lue,I.conforms=$ue,I.constant=T1,I.countBy=ble,I.create=Tce,I.curry=AI,I.curryRight=II,I.debounce=NI,I.defaults=Ace,I.defaultsDeep=Ice,I.defer=Vle,I.delay=Hle,I.difference=dae,I.differenceBy=fae,I.differenceWith=hae,I.drop=pae,I.dropRight=gae,I.dropRightWhile=mae,I.dropWhile=vae,I.fill=bae,I.filter=xle,I.flatMap=Sle,I.flatMapDeep=Cle,I.flatMapDepth=Ele,I.flatten=_I,I.flattenDeep=yae,I.flattenDepth=xae,I.flip=Wle,I.flow=jue,I.flowRight=zue,I.fromPairs=wae,I.functions=zce,I.functionsIn=Bce,I.groupBy=Ole,I.initial=Sae,I.intersection=Cae,I.intersectionBy=Eae,I.intersectionWith=Oae,I.invert=Hce,I.invertBy=Wce,I.invokeMap=kle,I.iteratee=A1,I.keyBy=Mle,I.keys=An,I.keysIn=yr,I.map=jg,I.mapKeys=Uce,I.mapValues=Gce,I.matches=Bue,I.matchesProperty=Vue,I.memoize=Bg,I.merge=Yce,I.mergeWith=WI,I.method=Hue,I.methodOf=Wue,I.mixin=I1,I.negate=Vg,I.nthArg=Uue,I.omit=Kce,I.omitBy=Xce,I.once=qle,I.orderBy=Dle,I.over=Gue,I.overArgs=Ule,I.overEvery=Yue,I.overSome=Kue,I.partial=E1,I.partialRight=RI,I.partition=Tle,I.pick=Qce,I.pickBy=qI,I.property=JI,I.propertyOf=Xue,I.pull=Dae,I.pullAll=CI,I.pullAllBy=Tae,I.pullAllWith=Aae,I.pullAt=Iae,I.range=Que,I.rangeRight=Jue,I.rearg=Gle,I.reject=Nle,I.remove=Nae,I.rest=Yle,I.reverse=_1,I.sampleSize=Lle,I.set=Zce,I.setWith=eue,I.shuffle=$le,I.slice=Rae,I.sortBy=zle,I.sortedUniq=Vae,I.sortedUniqBy=Hae,I.split=Sue,I.spread=Kle,I.tail=Wae,I.take=qae,I.takeRight=Uae,I.takeRightWhile=Gae,I.takeWhile=Yae,I.tap=cle,I.throttle=Xle,I.thru=Fg,I.toArray=zI,I.toPairs=UI,I.toPairsIn=GI,I.toPath=rde,I.toPlainObject=VI,I.transform=tue,I.unary=Qle,I.union=Kae,I.unionBy=Xae,I.unionWith=Qae,I.uniq=Jae,I.uniqBy=Zae,I.uniqWith=ele,I.unset=nue,I.unzip=S1,I.unzipWith=EI,I.update=rue,I.updateWith=iue,I.values=Oc,I.valuesIn=oue,I.without=tle,I.words=XI,I.wrap=Jle,I.xor=nle,I.xorBy=rle,I.xorWith=ile,I.zip=ole,I.zipObject=sle,I.zipObjectDeep=ale,I.zipWith=lle,I.entries=UI,I.entriesIn=GI,I.extend=HI,I.extendWith=qg,I1(I,I),I.add=ode,I.attempt=QI,I.camelCase=cue,I.capitalize=YI,I.ceil=sde,I.clamp=sue,I.clone=ece,I.cloneDeep=nce,I.cloneDeepWith=rce,I.cloneWith=tce,I.conformsTo=ice,I.deburr=KI,I.defaultTo=Fue,I.divide=ade,I.endsWith=uue,I.eq=Oi,I.escape=due,I.escapeRegExp=fue,I.every=yle,I.find=wle,I.findIndex=xI,I.findKey=Nce,I.findLast=_le,I.findLastIndex=wI,I.findLastKey=Rce,I.floor=lde,I.forEach=PI,I.forEachRight=kI,I.forIn=Lce,I.forInRight=$ce,I.forOwn=Fce,I.forOwnRight=jce,I.get=k1,I.gt=oce,I.gte=sce,I.has=Vce,I.hasIn=M1,I.head=SI,I.identity=xr,I.includes=Ple,I.indexOf=_ae,I.inRange=aue,I.invoke=qce,I.isArguments=Za,I.isArray=rt,I.isArrayBuffer=ace,I.isArrayLike=br,I.isArrayLikeObject=gn,I.isBoolean=lce,I.isBuffer=Ms,I.isDate=cce,I.isElement=uce,I.isEmpty=dce,I.isEqual=fce,I.isEqualWith=hce,I.isError=O1,I.isFinite=pce,I.isFunction=To,I.isInteger=LI,I.isLength=Hg,I.isMap=$I,I.isMatch=gce,I.isMatchWith=mce,I.isNaN=vce,I.isNative=bce,I.isNil=xce,I.isNull=yce,I.isNumber=FI,I.isObject=sn,I.isObjectLike=un,I.isPlainObject=qd,I.isRegExp=P1,I.isSafeInteger=wce,I.isSet=jI,I.isString=Wg,I.isSymbol=Ur,I.isTypedArray=Ec,I.isUndefined=_ce,I.isWeakMap=Sce,I.isWeakSet=Cce,I.join=Pae,I.kebabCase=hue,I.last=fi,I.lastIndexOf=kae,I.lowerCase=pue,I.lowerFirst=gue,I.lt=Ece,I.lte=Oce,I.max=cde,I.maxBy=ude,I.mean=dde,I.meanBy=fde,I.min=hde,I.minBy=pde,I.stubArray=R1,I.stubFalse=L1,I.stubObject=Zue,I.stubString=ede,I.stubTrue=tde,I.multiply=gde,I.nth=Mae,I.noConflict=que,I.noop=N1,I.now=zg,I.pad=mue,I.padEnd=vue,I.padStart=bue,I.parseInt=yue,I.random=lue,I.reduce=Ale,I.reduceRight=Ile,I.repeat=xue,I.replace=wue,I.result=Jce,I.round=mde,I.runInContext=Q,I.sample=Rle,I.size=Fle,I.snakeCase=_ue,I.some=jle,I.sortedIndex=Lae,I.sortedIndexBy=$ae,I.sortedIndexOf=Fae,I.sortedLastIndex=jae,I.sortedLastIndexBy=zae,I.sortedLastIndexOf=Bae,I.startCase=Cue,I.startsWith=Eue,I.subtract=vde,I.sum=bde,I.sumBy=yde,I.template=Oue,I.times=nde,I.toFinite=Ao,I.toInteger=lt,I.toLength=BI,I.toLower=Pue,I.toNumber=hi,I.toSafeInteger=Pce,I.toString=Rt,I.toUpper=kue,I.trim=Mue,I.trimEnd=Due,I.trimStart=Tue,I.truncate=Aue,I.unescape=Iue,I.uniqueId=ide,I.upperCase=Nue,I.upperFirst=D1,I.each=PI,I.eachRight=kI,I.first=SI,I1(I,function(){var u={};return Zi(I,function(h,b){$t.call(I.prototype,b)||(u[b]=h)}),u}(),{chain:!1}),I.VERSION=r,ai(["bind","bindKey","curry","curryRight","partial","partialRight"],function(u){I[u].placeholder=I}),ai(["drop","take"],function(u,h){Ct.prototype[u]=function(b){b=b===n?1:On(lt(b),0);var E=this.__filtered__&&!h?new Ct(this):this.clone();return E.__filtered__?E.__takeCount__=Kn(b,E.__takeCount__):E.__views__.push({size:Kn(b,H),type:u+(E.__dir__<0?"Right":"")}),E},Ct.prototype[u+"Right"]=function(b){return this.reverse()[u](b).reverse()}}),ai(["filter","map","takeWhile"],function(u,h){var b=h+1,E=b==Y||b==Z;Ct.prototype[u]=function(T){var R=this.clone();return R.__iteratees__.push({iteratee:Ve(T,3),type:b}),R.__filtered__=R.__filtered__||E,R}}),ai(["head","last"],function(u,h){var b="take"+(h?"Right":"");Ct.prototype[u]=function(){return this[b](1).value()[0]}}),ai(["initial","tail"],function(u,h){var b="drop"+(h?"":"Right");Ct.prototype[u]=function(){return this.__filtered__?new Ct(this):this[b](1)}}),Ct.prototype.compact=function(){return this.filter(xr)},Ct.prototype.find=function(u){return this.filter(u).head()},Ct.prototype.findLast=function(u){return this.reverse().find(u)},Ct.prototype.invokeMap=ht(function(u,h){return typeof u=="function"?new Ct(this):this.map(function(b){return jd(b,u,h)})}),Ct.prototype.reject=function(u){return this.filter(Vg(Ve(u)))},Ct.prototype.slice=function(u,h){u=lt(u);var b=this;return b.__filtered__&&(u>0||h<0)?new Ct(b):(u<0?b=b.takeRight(-u):u&&(b=b.drop(u)),h!==n&&(h=lt(h),b=h<0?b.dropRight(-h):b.take(h-u)),b)},Ct.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},Ct.prototype.toArray=function(){return this.take(H)},Zi(Ct.prototype,function(u,h){var b=/^(?:filter|find|map|reject)|While$/.test(h),E=/^(?:head|last)$/.test(h),T=I[E?"take"+(h=="last"?"Right":""):h],R=E||/^find/.test(h);T&&(I.prototype[h]=function(){var z=this.__wrapped__,q=E?[1]:arguments,te=z instanceof Ct,ve=q[0],be=te||rt(z),we=function(_t){var Et=T.apply(I,_s([_t],q));return E&&De?Et[0]:Et};be&&b&&typeof ve=="function"&&ve.length!=1&&(te=be=!1);var De=this.__chain__,$e=!!this.__actions__.length,We=R&&!De,ft=te&&!$e;if(!R&&be){z=ft?z:new Ct(this);var qe=u.apply(z,q);return qe.__actions__.push({func:Fg,args:[we],thisArg:n}),new ci(qe,De)}return We&&ft?u.apply(this,q):(qe=this.thru(we),We?E?qe.value()[0]:qe.value():qe)})}),ai(["pop","push","shift","sort","splice","unshift"],function(u){var h=ug[u],b=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",E=/^(?:pop|shift)$/.test(u);I.prototype[u]=function(){var T=arguments;if(E&&!this.__chain__){var R=this.value();return h.apply(rt(R)?R:[],T)}return this[b](function(z){return h.apply(rt(z)?z:[],T)})}}),Zi(Ct.prototype,function(u,h){var b=I[h];if(b){var E=b.name+"";$t.call(xc,E)||(xc[E]=[]),xc[E].push({name:h,func:b})}}),xc[Tg(n,w).name]=[{name:"wrapper",func:n}],Ct.prototype.clone=Ioe,Ct.prototype.reverse=Noe,Ct.prototype.value=Roe,I.prototype.at=ule,I.prototype.chain=dle,I.prototype.commit=fle,I.prototype.next=hle,I.prototype.plant=gle,I.prototype.reverse=mle,I.prototype.toJSON=I.prototype.valueOf=I.prototype.value=vle,I.prototype.first=I.prototype.head,Ad&&(I.prototype[Ad]=ple),I},vc=foe();qa?((qa.exports=vc)._=vc,Ax._=vc):zn._=vc}).call(Ro)}(lf,lf.exports);var qN=lf.exports;const $s=Pc(qN),UN={theme:"system",setTheme:()=>null},Ww=m.createContext(UN);function GN({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[i,o]=m.useState(()=>localStorage.getItem(n)||t);m.useEffect(()=>{const a=window.document.documentElement;if(a.classList.remove("light","dark"),i==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";a.classList.add(l);return}a.classList.add(i)},[i]);const s={theme:i,setTheme:a=>{localStorage.setItem(n,a),o(a)}};return _.jsx(Ww.Provider,{...r,value:s,children:e})}const qw=()=>{const e=m.useContext(Ww);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};async function YN(e,t){return await(await fetch(`https://semaphor.cloud/api/v1/dashboard?id=${e}`,{headers:{Authorization:`Bearer ${t}`}})).json()}function Uw(e,t){return e==="dark"?$s.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function KN(e,t,n,r,i,o){const{data:s,refetch:a,isLoading:l,isError:c}=Sr({queryKey:[e],queryFn:()=>YN(e,t==null?void 0:t.accessToken),enabled:!1}),{theme:d,setTheme:f}=qw(),{setDashboard:g,setSelectedSheetId:p,setStyle:v,setOnSaveFunction:y}=ge(k=>k.actions),x=ge(k=>k.actions.setFilterValues),w=ge(k=>k.actions.setBookmarkKey),S=ge(k=>k.actions.setAuthToken),C=ge(k=>k.actions.setThemeStyle),P=ge(k=>k.actions.setDashboardTheme),O=ge(k=>k.actions.setOnEvent);return m.useEffect(()=>{d&&P(d)},[d,P]),m.useEffect(()=>{r&&f(r)},[r,f]),m.useEffect(()=>{const k=$s.cloneDeep(gm);if(n){const A=$s.merge(k,n),L=Uw(d,A);C(L),v(A)}else{const A=Uw(d,k);C(A),v(gm)}},[d,n,v]),m.useEffect(()=>{var j;if(!s||!s.dashboard)return;const k=s.dashboard,A=ss(k.id),L=JSON.parse(localStorage.getItem(A)||"[]"),F=L.find(B=>B.default===!0);if(F)g(F.template),w(F.name),F.filterValues&&x(F.filterValues);else{g(k);const B=L.find(V=>(V==null?void 0:V.name)==="Original");B?B.template=k:L.push({name:"Original",template:k,default:!1}),localStorage.setItem(A,JSON.stringify(L))}p((j=k.sheets)==null?void 0:j[0].id)},[s,g,p]),m.useEffect(()=>{i&&y(i),o&&O(o)},[i,y,o,O]),m.useEffect(()=>{t&&t.accessToken&&(S(t),a())},[t,a,S]),{isLoading:l,isError:c}}function cf({className:e,...t}){return _.jsx("div",{className:Pe("animate-pulse rounded-md bg-muted",e),...t})}function Gw({className:e,style:t,onSave:n,onEvent:r,LoadingComponent:i,ErrorComponent:o,id:s,authToken:a,currentTheme:l,...c}){ge(v=>v.selectedSheetId);const d=ge(v=>v.themeStyle),f=ge(v=>v.onEvent),{isLoading:g,isError:p}=KN(s,a,t,l,n,r);return g||!a?(f==null||f({type:"info",message:`isLoading: ${g}, accessToken: ${a==null?void 0:a.accessToken}`}),i?_.jsx(i,{message:"loading"}):_.jsx("div",{className:" flex items-center gap-3",children:_.jsx(cf,{className:"dark:h-[2px] h-1 w-full"})})):p?(f==null||f({type:"error",message:"Error fetching dashboard"}),o?(console.log("Error fetching dashboard"),_.jsx(o,{})):_.jsx("div",{children:"Error"})):_.jsx("div",{className:Pe(" h-full flex flex-col justify-between",d==null?void 0:d.dashboardPanel,e),role:"dashboard-panel",...c})}function ae(){return ae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ae.apply(this,arguments)}function Ce(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function Pn(e,t=[]){let n=[];function r(o,s){const a=m.createContext(s),l=n.length;n=[...n,s];function c(f){const{scope:g,children:p,...v}=f,y=(g==null?void 0:g[e][l])||a,x=m.useMemo(()=>v,Object.values(v));return m.createElement(y.Provider,{value:x},p)}function d(f,g){const p=(g==null?void 0:g[e][l])||a,v=m.useContext(p);if(v)return v;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${o}\``)}return c.displayName=o+"Provider",[c,d]}const i=()=>{const o=n.map(s=>m.createContext(s));return function(a){const l=(a==null?void 0:a[e])||o;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,XN(i,...t)]}function XN(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const f=l(o)[`__scope${c}`];return{...a,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function QN(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function uf(...e){return t=>e.forEach(n=>QN(n,t))}function et(...e){return m.useCallback(uf(...e),e)}const no=m.forwardRef((e,t)=>{const{children:n,...r}=e,i=m.Children.toArray(n),o=i.find(JN);if(o){const s=o.props.children,a=i.map(l=>l===o?m.Children.count(s)>1?m.Children.only(null):m.isValidElement(s)?s.props.children:null:l);return m.createElement(Cm,ae({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(Cm,ae({},r,{ref:t}),n)});no.displayName="Slot";const Cm=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...ZN(r,n.props),ref:t?uf(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});Cm.displayName="SlotClone";const Yw=({children:e})=>m.createElement(m.Fragment,null,e);function JN(e){return m.isValidElement(e)&&e.type===Yw}function ZN(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{o(...a),i(...a)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function df(e){const t=e+"CollectionProvider",[n,r]=Pn(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=p=>{const{scope:v,children:y}=p,x=m.useRef(null),w=m.useRef(new Map).current;return m.createElement(i,{scope:v,itemMap:w,collectionRef:x},y)},a=e+"CollectionSlot",l=m.forwardRef((p,v)=>{const{scope:y,children:x}=p,w=o(a,y),S=et(v,w.collectionRef);return m.createElement(no,{ref:S},x)}),c=e+"CollectionItemSlot",d="data-radix-collection-item",f=m.forwardRef((p,v)=>{const{scope:y,children:x,...w}=p,S=m.useRef(null),C=et(v,S),P=o(c,y);return m.useEffect(()=>(P.itemMap.set(S,{ref:S,...w}),()=>void P.itemMap.delete(S))),m.createElement(no,{[d]:"",ref:C},x)});function g(p){const v=o(e+"CollectionConsumer",p);return m.useCallback(()=>{const x=v.collectionRef.current;if(!x)return[];const w=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(v.itemMap.values()).sort((P,O)=>w.indexOf(P.ref.current)-w.indexOf(O.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:l,ItemSlot:f},g,r]}const Vn=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},eR=ue.useId||(()=>{});let tR=0;function or(e){const[t,n]=ue.useState(eR());return Vn(()=>{e||n(r=>r??String(tR++))},[e]),e||(t?`radix-${t}`:"")}const Be=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{const n=m.forwardRef((r,i)=>{const{asChild:o,...s}=r,a=o?no:t;return m.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),m.createElement(a,ae({},s,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Kw(e,t){e&&kt.flushSync(()=>e.dispatchEvent(t))}function xn(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function Qn({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=nR({defaultProp:t,onChange:n}),o=e!==void 0,s=o?e:r,a=xn(n),l=m.useCallback(c=>{if(o){const f=typeof c=="function"?c(e):c;f!==e&&a(f)}else i(c)},[o,e,i,a]);return[s,l]}function nR({defaultProp:e,onChange:t}){const n=m.useState(e),[r]=n,i=m.useRef(r),o=xn(t);return m.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}const rR=m.createContext(void 0);function Fs(e){const t=m.useContext(rR);return e||t||"ltr"}const Em="rovingFocusGroup.onEntryFocus",iR={bubbles:!1,cancelable:!0},Om="RovingFocusGroup",[Pm,Xw,oR]=df(Om),[sR,ol]=Pn(Om,[oR]),[aR,lR]=sR(Om),cR=m.forwardRef((e,t)=>m.createElement(Pm.Provider,{scope:e.__scopeRovingFocusGroup},m.createElement(Pm.Slot,{scope:e.__scopeRovingFocusGroup},m.createElement(uR,ae({},e,{ref:t}))))),uR=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,...d}=e,f=m.useRef(null),g=et(t,f),p=Fs(o),[v=null,y]=Qn({prop:s,defaultProp:a,onChange:l}),[x,w]=m.useState(!1),S=xn(c),C=Xw(n),P=m.useRef(!1),[O,k]=m.useState(0);return m.useEffect(()=>{const A=f.current;if(A)return A.addEventListener(Em,S),()=>A.removeEventListener(Em,S)},[S]),m.createElement(aR,{scope:n,orientation:r,dir:p,loop:i,currentTabStopId:v,onItemFocus:m.useCallback(A=>y(A),[y]),onItemShiftTab:m.useCallback(()=>w(!0),[]),onFocusableItemAdd:m.useCallback(()=>k(A=>A+1),[]),onFocusableItemRemove:m.useCallback(()=>k(A=>A-1),[])},m.createElement(Be.div,ae({tabIndex:x||O===0?-1:0,"data-orientation":r},d,{ref:g,style:{outline:"none",...e.style},onMouseDown:Ce(e.onMouseDown,()=>{P.current=!0}),onFocus:Ce(e.onFocus,A=>{const L=!P.current;if(A.target===A.currentTarget&&L&&!x){const F=new CustomEvent(Em,iR);if(A.currentTarget.dispatchEvent(F),!F.defaultPrevented){const j=C().filter($=>$.focusable),B=j.find($=>$.active),V=j.find($=>$.id===v),Y=[B,V,...j].filter(Boolean).map($=>$.ref.current);Qw(Y)}}P.current=!1}),onBlur:Ce(e.onBlur,()=>w(!1))})))}),dR="RovingFocusGroupItem",fR=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,...s}=e,a=or(),l=o||a,c=lR(dR,n),d=c.currentTabStopId===l,f=Xw(n),{onFocusableItemAdd:g,onFocusableItemRemove:p}=c;return m.useEffect(()=>{if(r)return g(),()=>p()},[r,g,p]),m.createElement(Pm.ItemSlot,{scope:n,id:l,focusable:r,active:i},m.createElement(Be.span,ae({tabIndex:d?0:-1,"data-orientation":c.orientation},s,{ref:t,onMouseDown:Ce(e.onMouseDown,v=>{r?c.onItemFocus(l):v.preventDefault()}),onFocus:Ce(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:Ce(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){c.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const y=gR(v,c.orientation,c.dir);if(y!==void 0){v.preventDefault();let w=f().filter(S=>S.focusable).map(S=>S.ref.current);if(y==="last")w.reverse();else if(y==="prev"||y==="next"){y==="prev"&&w.reverse();const S=w.indexOf(v.currentTarget);w=c.loop?mR(w,S+1):w.slice(S+1)}setTimeout(()=>Qw(w))}})})))}),hR={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function pR(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function gR(e,t,n){const r=pR(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return hR[r]}function Qw(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function mR(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const km=cR,Mm=fR;function vR(e,t){return m.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const vn=e=>{const{present:t,children:n}=e,r=bR(t),i=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),o=et(r.ref,i.ref);return typeof n=="function"||r.isPresent?m.cloneElement(i,{ref:o}):null};vn.displayName="Presence";function bR(e){const[t,n]=m.useState(),r=m.useRef({}),i=m.useRef(e),o=m.useRef("none"),s=e?"mounted":"unmounted",[a,l]=vR(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const c=ff(r.current);o.current=a==="mounted"?c:"none"},[a]),Vn(()=>{const c=r.current,d=i.current;if(d!==e){const g=o.current,p=ff(c);e?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(d&&g!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),Vn(()=>{if(t){const c=f=>{const p=ff(r.current).includes(f.animationName);f.target===t&&p&&kt.flushSync(()=>l("ANIMATION_END"))},d=f=>{f.target===t&&(o.current=ff(r.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:m.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function ff(e){return(e==null?void 0:e.animationName)||"none"}const Jw="Tabs",[yR,Cde]=Pn(Jw,[ol]),Zw=ol(),[xR,Dm]=yR(Jw),wR=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,d=Fs(a),[f,g]=Qn({prop:r,onChange:i,defaultProp:o});return m.createElement(xR,{scope:n,baseId:or(),value:f,onValueChange:g,orientation:s,dir:d,activationMode:l},m.createElement(Be.div,ae({dir:d,"data-orientation":s},c,{ref:t})))}),_R="TabsList",SR=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=Dm(_R,n),s=Zw(n);return m.createElement(km,ae({asChild:!0},s,{orientation:o.orientation,dir:o.dir,loop:r}),m.createElement(Be.div,ae({role:"tablist","aria-orientation":o.orientation},i,{ref:t})))}),CR="TabsTrigger",ER=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,s=Dm(CR,n),a=Zw(n),l=e_(s.baseId,r),c=t_(s.baseId,r),d=r===s.value;return m.createElement(Mm,ae({asChild:!0},a,{focusable:!i,active:d}),m.createElement(Be.button,ae({type:"button",role:"tab","aria-selected":d,"aria-controls":c,"data-state":d?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:l},o,{ref:t,onMouseDown:Ce(e.onMouseDown,f=>{!i&&f.button===0&&f.ctrlKey===!1?s.onValueChange(r):f.preventDefault()}),onKeyDown:Ce(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&s.onValueChange(r)}),onFocus:Ce(e.onFocus,()=>{const f=s.activationMode!=="manual";!d&&!i&&f&&s.onValueChange(r)})})))}),OR="TabsContent",PR=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...s}=e,a=Dm(OR,n),l=e_(a.baseId,r),c=t_(a.baseId,r),d=r===a.value,f=m.useRef(d);return m.useEffect(()=>{const g=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(g)},[]),m.createElement(vn,{present:i||d},({present:g})=>m.createElement(Be.div,ae({"data-state":d?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!g,id:c,tabIndex:0},s,{ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0}}),g&&o))});function e_(e,t){return`${e}-trigger-${t}`}function t_(e,t){return`${e}-content-${t}`}const kR=wR,n_=SR,r_=ER,i_=PR,o_=kR,s_=ue.forwardRef(({className:e,...t},n)=>_.jsx(n_,{ref:n,className:Pe("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));s_.displayName=n_.displayName;const Tm=ue.forwardRef(({className:e,...t},n)=>_.jsx(r_,{ref:n,className:Pe("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));Tm.displayName=r_.displayName;const hf=ue.forwardRef(({className:e,...t},n)=>_.jsx(i_,{ref:n,className:Pe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));hf.displayName=i_.displayName;var a_={exports:{}},Fc={},Am={exports:{}};(function(e,t){(function(n,r){r(t)})(Ro,function(n){function r(re){return function(W,ye,oe,Te,Fe,He,Ke){return re(W,ye,Ke)}}function i(re){return function(W,ye,oe,Te){if(!W||!ye||typeof W!="object"||typeof ye!="object")return re(W,ye,oe,Te);var Fe=Te.get(W),He=Te.get(ye);if(Fe&&He)return Fe===ye&&He===W;Te.set(W,ye),Te.set(ye,W);var Ke=re(W,ye,oe,Te);return Te.delete(W),Te.delete(ye),Ke}}function o(re,ee){var W={};for(var ye in re)W[ye]=re[ye];for(var ye in ee)W[ye]=ee[ye];return W}function s(re){return re.constructor===Object||re.constructor==null}function a(re){return typeof re.then=="function"}function l(re,ee){return re===ee||re!==re&&ee!==ee}var c="[object Arguments]",d="[object Boolean]",f="[object Date]",g="[object RegExp]",p="[object Map]",v="[object Number]",y="[object Object]",x="[object Set]",w="[object String]",S=Object.prototype.toString;function C(re){var ee=re.areArraysEqual,W=re.areDatesEqual,ye=re.areMapsEqual,oe=re.areObjectsEqual,Te=re.areRegExpsEqual,Fe=re.areSetsEqual,He=re.createIsNestedEqual,Ke=He(St);function St(vt,bt,tn){if(vt===bt)return!0;if(!vt||!bt||typeof vt!="object"||typeof bt!="object")return vt!==vt&&bt!==bt;if(s(vt)&&s(bt))return oe(vt,bt,Ke,tn);var Zt=Array.isArray(vt),Dn=Array.isArray(bt);if(Zt||Dn)return Zt===Dn&&ee(vt,bt,Ke,tn);var fn=S.call(vt);return fn!==S.call(bt)?!1:fn===f?W(vt,bt,Ke,tn):fn===g?Te(vt,bt,Ke,tn):fn===p?ye(vt,bt,Ke,tn):fn===x?Fe(vt,bt,Ke,tn):fn===y||fn===c?a(vt)||a(bt)?!1:oe(vt,bt,Ke,tn):fn===d||fn===v||fn===w?l(vt.valueOf(),bt.valueOf()):!1}return St}function P(re,ee,W,ye){var oe=re.length;if(ee.length!==oe)return!1;for(;oe-- >0;)if(!W(re[oe],ee[oe],oe,oe,re,ee,ye))return!1;return!0}var O=i(P);function k(re,ee){return l(re.valueOf(),ee.valueOf())}function A(re,ee,W,ye){var oe=re.size===ee.size;if(!oe)return!1;if(!re.size)return!0;var Te={},Fe=0;return re.forEach(function(He,Ke){if(oe){var St=!1,vt=0;ee.forEach(function(bt,tn){!St&&!Te[vt]&&(St=W(Ke,tn,Fe,vt,re,ee,ye)&&W(He,bt,Ke,tn,re,ee,ye))&&(Te[vt]=!0),vt++}),Fe++,oe=St}}),oe}var L=i(A),F="_owner",j=Object.prototype.hasOwnProperty;function B(re,ee,W,ye){var oe=Object.keys(re),Te=oe.length;if(Object.keys(ee).length!==Te)return!1;for(var Fe;Te-- >0;){if(Fe=oe[Te],Fe===F){var He=!!re.$$typeof,Ke=!!ee.$$typeof;if((He||Ke)&&He!==Ke)return!1}if(!j.call(ee,Fe)||!W(re[Fe],ee[Fe],Fe,Fe,re,ee,ye))return!1}return!0}var V=i(B);function K(re,ee){return re.source===ee.source&&re.flags===ee.flags}function Y(re,ee,W,ye){var oe=re.size===ee.size;if(!oe)return!1;if(!re.size)return!0;var Te={};return re.forEach(function(Fe,He){if(oe){var Ke=!1,St=0;ee.forEach(function(vt,bt){!Ke&&!Te[St]&&(Ke=W(Fe,vt,He,bt,re,ee,ye))&&(Te[St]=!0),St++}),oe=Ke}}),oe}var $=i(Y),Z=Object.freeze({areArraysEqual:P,areDatesEqual:k,areMapsEqual:A,areObjectsEqual:B,areRegExpsEqual:K,areSetsEqual:Y,createIsNestedEqual:r}),U=Object.freeze({areArraysEqual:O,areDatesEqual:k,areMapsEqual:L,areObjectsEqual:V,areRegExpsEqual:K,areSetsEqual:$,createIsNestedEqual:r}),ie=C(Z);function le(re,ee){return ie(re,ee,void 0)}var M=C(o(Z,{createIsNestedEqual:function(){return l}}));function H(re,ee){return M(re,ee,void 0)}var ne=C(U);function N(re,ee){return ne(re,ee,new WeakMap)}var X=C(o(U,{createIsNestedEqual:function(){return l}}));function me(re,ee){return X(re,ee,new WeakMap)}function he(re){return C(o(Z,re(Z)))}function de(re){var ee=C(o(U,re(U)));return function(W,ye,oe){return oe===void 0&&(oe=new WeakMap),ee(W,ye,oe)}}n.circularDeepEqual=N,n.circularShallowEqual=me,n.createCustomCircularEqual=de,n.createCustomEqual=he,n.deepEqual=le,n.sameValueZeroEqual=l,n.shallowEqual=H,Object.defineProperty(n,"__esModule",{value:!0})})})(Am,Am.exports);var Im=Am.exports;const Nm=Yg(i3);var pt={},MR=function(t,n,r){return t===n?!0:t.className===n.className&&r(t.style,n.style)&&t.width===n.width&&t.autoSize===n.autoSize&&t.cols===n.cols&&t.draggableCancel===n.draggableCancel&&t.draggableHandle===n.draggableHandle&&r(t.verticalCompact,n.verticalCompact)&&r(t.compactType,n.compactType)&&r(t.layout,n.layout)&&r(t.margin,n.margin)&&r(t.containerPadding,n.containerPadding)&&t.rowHeight===n.rowHeight&&t.maxRows===n.maxRows&&t.isBounded===n.isBounded&&t.isDraggable===n.isDraggable&&t.isResizable===n.isResizable&&t.allowOverlap===n.allowOverlap&&t.preventCollision===n.preventCollision&&t.useCSSTransforms===n.useCSSTransforms&&t.transformScale===n.transformScale&&t.isDroppable===n.isDroppable&&r(t.resizeHandles,n.resizeHandles)&&r(t.resizeHandle,n.resizeHandle)&&t.onLayoutChange===n.onLayoutChange&&t.onDragStart===n.onDragStart&&t.onDrag===n.onDrag&&t.onDragStop===n.onDragStop&&t.onResizeStart===n.onResizeStart&&t.onResize===n.onResize&&t.onResizeStop===n.onResizeStop&&t.onDrop===n.onDrop&&r(t.droppingItem,n.droppingItem)&&r(t.innerRef,n.innerRef)};Object.defineProperty(pt,"__esModule",{value:!0}),pt.bottom=Rm,pt.childrenEqual=IR,pt.cloneLayout=c_,pt.cloneLayoutItem=js,pt.collides=pf,pt.compact=d_,pt.compactItem=f_,pt.compactType=HR,pt.correctBounds=h_,pt.fastPositionEqual=RR,pt.fastRGLPropsEqual=void 0,pt.getAllCollisions=p_,pt.getFirstCollision=zs,pt.getLayoutItem=$m,pt.getStatics=Fm,pt.modifyLayout=u_,pt.moveElement=zc,pt.moveElementAwayFromCollision=jm,pt.noop=void 0,pt.perc=$R,pt.resizeItemInDirection=jR,pt.setTopLeft=BR,pt.setTransform=zR,pt.sortLayoutItems=qm,pt.sortLayoutItemsByColRow=y_,pt.sortLayoutItemsByRowCol=b_,pt.synchronizeLayoutWithChildren=VR,pt.validateLayout=x_,pt.withLayoutItem=AR;var l_=Im,jc=DR(m);function DR(e){return e&&e.__esModule?e:{default:e}}const TR=process.env.NODE_ENV==="production";function Rm(e){let t=0,n;for(let r=0,i=e.length;r<i;r++)n=e[r].y+e[r].h,n>t&&(t=n);return t}function c_(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=js(e[n]);return t}function u_(e,t){const n=Array(e.length);for(let r=0,i=e.length;r<i;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function AR(e,t,n){let r=$m(e,t);return r?(r=n(js(r)),e=u_(e,r),[e,r]):[e,null]}function js(e){return{w:e.w,h:e.h,x:e.x,y:e.y,i:e.i,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,isBounded:e.isBounded}}function IR(e,t){return(0,l_.deepEqual)(jc.default.Children.map(e,n=>n==null?void 0:n.key),jc.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,l_.deepEqual)(jc.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),jc.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}const NR=MR;pt.fastRGLPropsEqual=NR;function RR(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function pf(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function d_(e,t,n,r){const i=Fm(e),o=qm(e,t),s=Array(e.length);for(let a=0,l=o.length;a<l;a++){let c=js(o[a]);c.static||(c=f_(i,c,t,n,o,r),i.push(c)),s[e.indexOf(o[a])]=c,c.moved=!1}return s}const LR={x:"w",y:"h"};function Lm(e,t,n,r){const i=LR[r];t[r]+=1;const o=e.map(s=>s.i).indexOf(t.i);for(let s=o+1;s<e.length;s++){const a=e[s];if(!a.static){if(a.y>t.y+t.h)break;pf(t,a)&&Lm(e,a,n+t[i],r)}}t[r]=n}function f_(e,t,n,r,i,o){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(Rm(e),t.y);t.y>0&&!zs(e,t);)t.y--;else if(a)for(;t.x>0&&!zs(e,t);)t.x--;let l;for(;(l=zs(e,t))&&!(n===null&&o);)if(a?Lm(i,t,l.x+l.w,"x"):Lm(i,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!zs(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function h_(e,t){const n=Fm(e);for(let r=0,i=e.length;r<i;r++){const o=e[r];if(o.x+o.w>t.cols&&(o.x=t.cols-o.w),o.x<0&&(o.x=0,o.w=t.cols),!o.static)n.push(o);else for(;zs(n,o);)o.y++}return e}function $m(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function zs(e,t){for(let n=0,r=e.length;n<r;n++)if(pf(e[n],t))return e[n]}function p_(e,t){return e.filter(n=>pf(n,t))}function Fm(e){return e.filter(t=>t.static)}function zc(e,t,n,r,i,o,s,a,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;"Moving element ".concat(t.i," to [").concat(String(n),",").concat(String(r),"] from [").concat(t.x,",").concat(t.y,"]");const c=t.x,d=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let f=qm(e,s);(s==="vertical"&&typeof r=="number"?d>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(f=f.reverse());const p=p_(f,t),v=p.length>0;if(v&&l)return c_(e);if(v&&o)return"Collision prevented on ".concat(t.i,", reverting."),t.x=c,t.y=d,t.moved=!1,e;for(let y=0,x=p.length;y<x;y++){const w=p[y];"Resolving collision between ".concat(t.i," at [").concat(t.x,",").concat(t.y,"] and ").concat(w.i," at [").concat(w.x,",").concat(w.y,"]"),!w.moved&&(w.static?e=jm(e,w,t,i,s):e=jm(e,t,w,i,s))}return e}function jm(e,t,n,r,i,o){const s=i==="horizontal",a=i==="vertical",l=t.static;if(r){r=!1;const f={x:s?Math.max(t.x-n.w,0):n.x,y:a?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},g=zs(e,f),p=g&&g.y+g.h>t.y,v=g&&t.x+t.w>g.x;if(g){if(p&&a)return zc(e,n,void 0,t.y+1,r,l,i);if(p&&i==null)return t.y=n.y,n.y=n.y+n.h,e;if(v&&s)return zc(e,t,n.x,void 0,r,l,i)}else return"Doing reverse collision on ".concat(n.i," up to [").concat(f.x,",").concat(f.y,"]."),zc(e,n,s?f.x:void 0,a?f.y:void 0,r,l,i)}const c=s?n.x+1:void 0,d=a?n.y+1:void 0;return c==null&&d==null?e:zc(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,i)}function $R(e){return e*100+"%"}const g_=(e,t,n,r)=>e+n>r?t:n,m_=(e,t,n)=>e<0?t:n,v_=e=>Math.max(0,e),zm=e=>Math.max(0,e),Bm=(e,t,n)=>{let{left:r,height:i,width:o}=t;const s=e.top-(i-e.height);return{left:r,width:o,height:m_(s,e.height,i),top:zm(s)}},Vm=(e,t,n)=>{let{top:r,left:i,height:o,width:s}=t;return{top:r,height:o,width:g_(e.left,e.width,s,n),left:v_(i)}},Hm=(e,t,n)=>{let{top:r,height:i,width:o}=t;const s=e.left-(o-e.width);return{height:i,width:s<0?e.width:g_(e.left,e.width,o,n),top:zm(r),left:v_(s)}},Wm=(e,t,n)=>{let{top:r,left:i,height:o,width:s}=t;return{width:s,left:i,height:m_(r,e.height,o),top:zm(r)}},FR={n:Bm,ne:function(){return Bm(arguments.length<=0?void 0:arguments[0],Vm(...arguments))},e:Vm,se:function(){return Wm(arguments.length<=0?void 0:arguments[0],Vm(...arguments))},s:Wm,sw:function(){return Wm(arguments.length<=0?void 0:arguments[0],Hm(...arguments))},w:Hm,nw:function(){return Bm(arguments.length<=0?void 0:arguments[0],Hm(...arguments))}};function jR(e,t,n,r){const i=FR[e];return i?i(t,{...t,...n},r):n}function zR(e){let{top:t,left:n,width:r,height:i}=e;const o="translate(".concat(n,"px,").concat(t,"px)");return{transform:o,WebkitTransform:o,MozTransform:o,msTransform:o,OTransform:o,width:"".concat(r,"px"),height:"".concat(i,"px"),position:"absolute"}}function BR(e){let{top:t,left:n,width:r,height:i}=e;return{top:"".concat(t,"px"),left:"".concat(n,"px"),width:"".concat(r,"px"),height:"".concat(i,"px"),position:"absolute"}}function qm(e,t){return t==="horizontal"?y_(e):t==="vertical"?b_(e):e}function b_(e){return e.slice(0).sort(function(t,n){return t.y>n.y||t.y===n.y&&t.x>n.x?1:t.y===n.y&&t.x===n.x?0:-1})}function y_(e){return e.slice(0).sort(function(t,n){return t.x>n.x||t.x===n.x&&t.y>n.y?1:-1})}function VR(e,t,n,r,i){e=e||[];const o=[];jc.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=$m(e,String(a.key)),c=a.props["data-grid"];l&&c==null?o.push(js(l)):c?(TR||x_([c],"ReactGridLayout.children"),o.push(js({...c,i:a.key}))):o.push(js({w:1,h:1,x:0,y:Rm(o),i:String(a.key)}))});const s=h_(o,{cols:n});return i?s:d_(s,r,n)}function x_(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const n=["x","y","w","h"];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(let r=0,i=e.length;r<i;r++){const o=e[r];for(let s=0;s<n.length;s++)if(typeof o[n[s]]!="number")throw new Error("ReactGridLayout: "+t+"["+r+"]."+n[s]+" must be a number!")}}function HR(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}function Mde(){}const WR=()=>{};pt.noop=WR;var ki={};Object.defineProperty(ki,"__esModule",{value:!0}),ki.calcGridColWidth=gf,ki.calcGridItemPosition=qR,ki.calcGridItemWHPx=Um,ki.calcWH=GR,ki.calcXY=UR,ki.clamp=Bs;function gf(e){const{margin:t,containerPadding:n,containerWidth:r,cols:i}=e;return(r-t[0]*(i-1)-n[0]*2)/i}function Um(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function qR(e,t,n,r,i,o){const{margin:s,containerPadding:a,rowHeight:l}=e,c=gf(e),d={};return o&&o.resizing?(d.width=Math.round(o.resizing.width),d.height=Math.round(o.resizing.height)):(d.width=Um(r,c,s[0]),d.height=Um(i,l,s[1])),o&&o.dragging?(d.top=Math.round(o.dragging.top),d.left=Math.round(o.dragging.left)):o&&o.resizing&&typeof o.resizing.top=="number"&&typeof o.resizing.left=="number"?(d.top=Math.round(o.resizing.top),d.left=Math.round(o.resizing.left)):(d.top=Math.round((l+s[1])*n+a[1]),d.left=Math.round((c+s[0])*t+a[0])),d}function UR(e,t,n,r,i){const{margin:o,cols:s,rowHeight:a,maxRows:l}=e,c=gf(e);let d=Math.round((n-o[0])/(c+o[0])),f=Math.round((t-o[1])/(a+o[1]));return d=Bs(d,0,s-r),f=Bs(f,0,l-i),{x:d,y:f}}function GR(e,t,n,r,i,o){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,d=gf(e);let f=Math.round((t+s[0])/(d+s[0])),g=Math.round((n+s[1])/(c+s[1])),p=Bs(f,0,l-r),v=Bs(g,0,a-i);return["sw","w","nw"].indexOf(o)!==-1&&(p=Bs(f,0,l)),["nw","n","ne"].indexOf(o)!==-1&&(v=Bs(g,0,a)),{w:p,h:v}}function Bs(e,t,n){return Math.max(Math.min(e,n),t)}var mf={},Gm={exports:{}},Ym,w_;function Km(){if(w_)return Ym;w_=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Ym=e,Ym}var Xm,__;function YR(){if(__)return Xm;__=1;var e=Km();function t(){}function n(){}return n.resetWarningCache=t,Xm=function(){function r(s,a,l,c,d,f){if(f!==e){var g=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw g.name="Invariant Violation",g}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Xm}var vf={exports:{}},At={};/** @license React v16.13.1
|
|
85
|
+
}`;var ft=QI(function(){return Tt(R,$e+"return "+we).apply(n,z)});if(ft.source=we,O1(ft))throw ft;return ft}function Pue(u){return Rt(u).toLowerCase()}function kue(u){return Rt(u).toUpperCase()}function Mue(u,h,b){if(u=Rt(u),u&&(b||h===n))return s5(u);if(!u||!(h=qr(h)))return u;var E=Ci(u),T=Ci(h),R=a5(E,T),z=l5(E,T)+1;return ks(E,R,z).join("")}function Due(u,h,b){if(u=Rt(u),u&&(b||h===n))return u.slice(0,u5(u)+1);if(!u||!(h=qr(h)))return u;var E=Ci(u),T=l5(E,Ci(h))+1;return ks(E,0,T).join("")}function Tue(u,h,b){if(u=Rt(u),u&&(b||h===n))return u.replace(Ha,"");if(!u||!(h=qr(h)))return u;var E=Ci(u),T=a5(E,Ci(h));return ks(E,T).join("")}function Aue(u,h){var b=j,E=B;if(sn(h)){var T="separator"in h?h.separator:T;b="length"in h?ct(h.length):b,E="omission"in h?qr(h.omission):E}u=Rt(u);var R=u.length;if(gc(u)){var z=Ci(u);R=z.length}if(b>=R)return u;var q=b-mc(E);if(q<1)return E;var te=z?ks(z,0,q).join(""):u.slice(0,q);if(T===n)return te+E;if(z&&(q+=te.length-q),P1(T)){if(u.slice(q).search(T)){var ve,be=te;for(T.global||(T=Hx(T.source,Rt(je.exec(T))+"g")),T.lastIndex=0;ve=T.exec(be);)var we=ve.index;te=te.slice(0,we===n?q:we)}}else if(u.indexOf(qr(T),q)!=q){var De=te.lastIndexOf(T);De>-1&&(te=te.slice(0,De))}return te+E}function Iue(u){return u=Rt(u),u&&Co.test(u)?u.replace(Yn,loe):u}var Nue=Sc(function(u,h,b){return u+(b?" ":"")+h.toUpperCase()}),D1=J5("toUpperCase");function XI(u,h,b){return u=Rt(u),h=b?n:h,h===n?roe(u)?doe(u):Yie(u):u.match(h)||[]}var QI=ht(function(u,h){try{return Hr(u,n,h)}catch(b){return O1(b)?b:new Ze(b)}}),Rue=Mo(function(u,h){return ai(h,function(b){b=to(b),Po(u,b,C1(u[b],u))}),u});function Lue(u){var h=u==null?0:u.length,b=Ve();return u=h?rn(u,function(E){if(typeof E[1]!="function")throw new li(s);return[b(E[0]),E[1]]}):[],ht(function(E){for(var T=-1;++T<h;){var R=u[T];if(Hr(R[0],this,E))return Hr(R[1],this,E)}})}function $ue(u){return lse(ui(u,f))}function T1(u){return function(){return u}}function Fue(u,h){return u==null||u!==u?h:u}var jue=eI(),zue=eI(!0);function xr(u){return u}function A1(u){return D5(typeof u=="function"?u:ui(u,f))}function Bue(u){return A5(ui(u,f))}function Vue(u,h){return I5(u,ui(h,f))}var Hue=ht(function(u,h){return function(b){return jd(b,u,h)}}),Wue=ht(function(u,h){return function(b){return jd(u,b,h)}});function I1(u,h,b){var E=An(h),T=Og(h,E);b==null&&!(sn(h)&&(T.length||!E.length))&&(b=h,h=u,u=this,T=Og(h,An(h)));var R=!(sn(b)&&"chain"in b)||!!b.chain,z=To(u);return ai(T,function(q){var te=h[q];u[q]=te,z&&(u.prototype[q]=function(){var ve=this.__chain__;if(R||ve){var be=u(this.__wrapped__),we=be.__actions__=vr(this.__actions__);return we.push({func:te,args:arguments,thisArg:u}),be.__chain__=ve,be}return te.apply(u,_s([this.value()],arguments))})}),u}function que(){return zn._===this&&(zn._=voe),this}function N1(){}function Uue(u){return u=ct(u),ht(function(h){return N5(h,u)})}var Gue=d1(rn),Yue=d1(t5),Kue=d1(Lx);function JI(u){return b1(u)?$x(to(u)):Ese(u)}function Xue(u){return function(h){return u==null?n:Xa(u,h)}}var Que=nI(),Jue=nI(!0);function R1(){return[]}function L1(){return!1}function Zue(){return{}}function ede(){return""}function tde(){return!0}function nde(u,h){if(u=ct(u),u<1||u>ie)return[];var b=H,E=Kn(u,H);h=Ve(h),u-=H;for(var T=zx(E,h);++b<u;)h(b);return T}function rde(u){return rt(u)?rn(u,to):Ur(u)?[u]:vr(bI(Rt(u)))}function ide(u){var h=++goe;return Rt(u)+h}var ode=Ag(function(u,h){return u+h},0),sde=f1("ceil"),ade=Ag(function(u,h){return u/h},1),lde=f1("floor");function cde(u){return u&&u.length?Eg(u,xr,Qx):n}function ude(u,h){return u&&u.length?Eg(u,Ve(h,2),Qx):n}function dde(u){return i5(u,xr)}function fde(u,h){return i5(u,Ve(h,2))}function hde(u){return u&&u.length?Eg(u,xr,t1):n}function pde(u,h){return u&&u.length?Eg(u,Ve(h,2),t1):n}var gde=Ag(function(u,h){return u*h},1),mde=f1("round"),vde=Ag(function(u,h){return u-h},0);function bde(u){return u&&u.length?jx(u,xr):0}function yde(u,h){return u&&u.length?jx(u,Ve(h,2)):0}return I.after=Ble,I.ary=MI,I.assign=kce,I.assignIn=HI,I.assignInWith=qg,I.assignWith=Mce,I.at=Dce,I.before=DI,I.bind=C1,I.bindAll=Rue,I.bindKey=TI,I.castArray=Zle,I.chain=OI,I.chunk=lae,I.compact=cae,I.concat=uae,I.cond=Lue,I.conforms=$ue,I.constant=T1,I.countBy=ble,I.create=Tce,I.curry=AI,I.curryRight=II,I.debounce=NI,I.defaults=Ace,I.defaultsDeep=Ice,I.defer=Vle,I.delay=Hle,I.difference=dae,I.differenceBy=fae,I.differenceWith=hae,I.drop=pae,I.dropRight=gae,I.dropRightWhile=mae,I.dropWhile=vae,I.fill=bae,I.filter=xle,I.flatMap=Sle,I.flatMapDeep=Cle,I.flatMapDepth=Ele,I.flatten=_I,I.flattenDeep=yae,I.flattenDepth=xae,I.flip=Wle,I.flow=jue,I.flowRight=zue,I.fromPairs=wae,I.functions=zce,I.functionsIn=Bce,I.groupBy=Ole,I.initial=Sae,I.intersection=Cae,I.intersectionBy=Eae,I.intersectionWith=Oae,I.invert=Hce,I.invertBy=Wce,I.invokeMap=kle,I.iteratee=A1,I.keyBy=Mle,I.keys=An,I.keysIn=yr,I.map=jg,I.mapKeys=Uce,I.mapValues=Gce,I.matches=Bue,I.matchesProperty=Vue,I.memoize=Bg,I.merge=Yce,I.mergeWith=WI,I.method=Hue,I.methodOf=Wue,I.mixin=I1,I.negate=Vg,I.nthArg=Uue,I.omit=Kce,I.omitBy=Xce,I.once=qle,I.orderBy=Dle,I.over=Gue,I.overArgs=Ule,I.overEvery=Yue,I.overSome=Kue,I.partial=E1,I.partialRight=RI,I.partition=Tle,I.pick=Qce,I.pickBy=qI,I.property=JI,I.propertyOf=Xue,I.pull=Dae,I.pullAll=CI,I.pullAllBy=Tae,I.pullAllWith=Aae,I.pullAt=Iae,I.range=Que,I.rangeRight=Jue,I.rearg=Gle,I.reject=Nle,I.remove=Nae,I.rest=Yle,I.reverse=_1,I.sampleSize=Lle,I.set=Zce,I.setWith=eue,I.shuffle=$le,I.slice=Rae,I.sortBy=zle,I.sortedUniq=Vae,I.sortedUniqBy=Hae,I.split=Sue,I.spread=Kle,I.tail=Wae,I.take=qae,I.takeRight=Uae,I.takeRightWhile=Gae,I.takeWhile=Yae,I.tap=cle,I.throttle=Xle,I.thru=Fg,I.toArray=zI,I.toPairs=UI,I.toPairsIn=GI,I.toPath=rde,I.toPlainObject=VI,I.transform=tue,I.unary=Qle,I.union=Kae,I.unionBy=Xae,I.unionWith=Qae,I.uniq=Jae,I.uniqBy=Zae,I.uniqWith=ele,I.unset=nue,I.unzip=S1,I.unzipWith=EI,I.update=rue,I.updateWith=iue,I.values=Oc,I.valuesIn=oue,I.without=tle,I.words=XI,I.wrap=Jle,I.xor=nle,I.xorBy=rle,I.xorWith=ile,I.zip=ole,I.zipObject=sle,I.zipObjectDeep=ale,I.zipWith=lle,I.entries=UI,I.entriesIn=GI,I.extend=HI,I.extendWith=qg,I1(I,I),I.add=ode,I.attempt=QI,I.camelCase=cue,I.capitalize=YI,I.ceil=sde,I.clamp=sue,I.clone=ece,I.cloneDeep=nce,I.cloneDeepWith=rce,I.cloneWith=tce,I.conformsTo=ice,I.deburr=KI,I.defaultTo=Fue,I.divide=ade,I.endsWith=uue,I.eq=Oi,I.escape=due,I.escapeRegExp=fue,I.every=yle,I.find=wle,I.findIndex=xI,I.findKey=Nce,I.findLast=_le,I.findLastIndex=wI,I.findLastKey=Rce,I.floor=lde,I.forEach=PI,I.forEachRight=kI,I.forIn=Lce,I.forInRight=$ce,I.forOwn=Fce,I.forOwnRight=jce,I.get=k1,I.gt=oce,I.gte=sce,I.has=Vce,I.hasIn=M1,I.head=SI,I.identity=xr,I.includes=Ple,I.indexOf=_ae,I.inRange=aue,I.invoke=qce,I.isArguments=Za,I.isArray=rt,I.isArrayBuffer=ace,I.isArrayLike=br,I.isArrayLikeObject=gn,I.isBoolean=lce,I.isBuffer=Ms,I.isDate=cce,I.isElement=uce,I.isEmpty=dce,I.isEqual=fce,I.isEqualWith=hce,I.isError=O1,I.isFinite=pce,I.isFunction=To,I.isInteger=LI,I.isLength=Hg,I.isMap=$I,I.isMatch=gce,I.isMatchWith=mce,I.isNaN=vce,I.isNative=bce,I.isNil=xce,I.isNull=yce,I.isNumber=FI,I.isObject=sn,I.isObjectLike=cn,I.isPlainObject=qd,I.isRegExp=P1,I.isSafeInteger=wce,I.isSet=jI,I.isString=Wg,I.isSymbol=Ur,I.isTypedArray=Ec,I.isUndefined=_ce,I.isWeakMap=Sce,I.isWeakSet=Cce,I.join=Pae,I.kebabCase=hue,I.last=fi,I.lastIndexOf=kae,I.lowerCase=pue,I.lowerFirst=gue,I.lt=Ece,I.lte=Oce,I.max=cde,I.maxBy=ude,I.mean=dde,I.meanBy=fde,I.min=hde,I.minBy=pde,I.stubArray=R1,I.stubFalse=L1,I.stubObject=Zue,I.stubString=ede,I.stubTrue=tde,I.multiply=gde,I.nth=Mae,I.noConflict=que,I.noop=N1,I.now=zg,I.pad=mue,I.padEnd=vue,I.padStart=bue,I.parseInt=yue,I.random=lue,I.reduce=Ale,I.reduceRight=Ile,I.repeat=xue,I.replace=wue,I.result=Jce,I.round=mde,I.runInContext=Q,I.sample=Rle,I.size=Fle,I.snakeCase=_ue,I.some=jle,I.sortedIndex=Lae,I.sortedIndexBy=$ae,I.sortedIndexOf=Fae,I.sortedLastIndex=jae,I.sortedLastIndexBy=zae,I.sortedLastIndexOf=Bae,I.startCase=Cue,I.startsWith=Eue,I.subtract=vde,I.sum=bde,I.sumBy=yde,I.template=Oue,I.times=nde,I.toFinite=Ao,I.toInteger=ct,I.toLength=BI,I.toLower=Pue,I.toNumber=hi,I.toSafeInteger=Pce,I.toString=Rt,I.toUpper=kue,I.trim=Mue,I.trimEnd=Due,I.trimStart=Tue,I.truncate=Aue,I.unescape=Iue,I.uniqueId=ide,I.upperCase=Nue,I.upperFirst=D1,I.each=PI,I.eachRight=kI,I.first=SI,I1(I,function(){var u={};return Zi(I,function(h,b){$t.call(I.prototype,b)||(u[b]=h)}),u}(),{chain:!1}),I.VERSION=r,ai(["bind","bindKey","curry","curryRight","partial","partialRight"],function(u){I[u].placeholder=I}),ai(["drop","take"],function(u,h){Ct.prototype[u]=function(b){b=b===n?1:On(ct(b),0);var E=this.__filtered__&&!h?new Ct(this):this.clone();return E.__filtered__?E.__takeCount__=Kn(b,E.__takeCount__):E.__views__.push({size:Kn(b,H),type:u+(E.__dir__<0?"Right":"")}),E},Ct.prototype[u+"Right"]=function(b){return this.reverse()[u](b).reverse()}}),ai(["filter","map","takeWhile"],function(u,h){var b=h+1,E=b==Y||b==Z;Ct.prototype[u]=function(T){var R=this.clone();return R.__iteratees__.push({iteratee:Ve(T,3),type:b}),R.__filtered__=R.__filtered__||E,R}}),ai(["head","last"],function(u,h){var b="take"+(h?"Right":"");Ct.prototype[u]=function(){return this[b](1).value()[0]}}),ai(["initial","tail"],function(u,h){var b="drop"+(h?"":"Right");Ct.prototype[u]=function(){return this.__filtered__?new Ct(this):this[b](1)}}),Ct.prototype.compact=function(){return this.filter(xr)},Ct.prototype.find=function(u){return this.filter(u).head()},Ct.prototype.findLast=function(u){return this.reverse().find(u)},Ct.prototype.invokeMap=ht(function(u,h){return typeof u=="function"?new Ct(this):this.map(function(b){return jd(b,u,h)})}),Ct.prototype.reject=function(u){return this.filter(Vg(Ve(u)))},Ct.prototype.slice=function(u,h){u=ct(u);var b=this;return b.__filtered__&&(u>0||h<0)?new Ct(b):(u<0?b=b.takeRight(-u):u&&(b=b.drop(u)),h!==n&&(h=ct(h),b=h<0?b.dropRight(-h):b.take(h-u)),b)},Ct.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},Ct.prototype.toArray=function(){return this.take(H)},Zi(Ct.prototype,function(u,h){var b=/^(?:filter|find|map|reject)|While$/.test(h),E=/^(?:head|last)$/.test(h),T=I[E?"take"+(h=="last"?"Right":""):h],R=E||/^find/.test(h);T&&(I.prototype[h]=function(){var z=this.__wrapped__,q=E?[1]:arguments,te=z instanceof Ct,ve=q[0],be=te||rt(z),we=function(_t){var Et=T.apply(I,_s([_t],q));return E&&De?Et[0]:Et};be&&b&&typeof ve=="function"&&ve.length!=1&&(te=be=!1);var De=this.__chain__,$e=!!this.__actions__.length,We=R&&!De,ft=te&&!$e;if(!R&&be){z=ft?z:new Ct(this);var qe=u.apply(z,q);return qe.__actions__.push({func:Fg,args:[we],thisArg:n}),new ci(qe,De)}return We&&ft?u.apply(this,q):(qe=this.thru(we),We?E?qe.value()[0]:qe.value():qe)})}),ai(["pop","push","shift","sort","splice","unshift"],function(u){var h=ug[u],b=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",E=/^(?:pop|shift)$/.test(u);I.prototype[u]=function(){var T=arguments;if(E&&!this.__chain__){var R=this.value();return h.apply(rt(R)?R:[],T)}return this[b](function(z){return h.apply(rt(z)?z:[],T)})}}),Zi(Ct.prototype,function(u,h){var b=I[h];if(b){var E=b.name+"";$t.call(xc,E)||(xc[E]=[]),xc[E].push({name:h,func:b})}}),xc[Tg(n,w).name]=[{name:"wrapper",func:n}],Ct.prototype.clone=Ioe,Ct.prototype.reverse=Noe,Ct.prototype.value=Roe,I.prototype.at=ule,I.prototype.chain=dle,I.prototype.commit=fle,I.prototype.next=hle,I.prototype.plant=gle,I.prototype.reverse=mle,I.prototype.toJSON=I.prototype.valueOf=I.prototype.value=vle,I.prototype.first=I.prototype.head,Ad&&(I.prototype[Ad]=ple),I},vc=foe();qa?((qa.exports=vc)._=vc,Ax._=vc):zn._=vc}).call(Ro)}(lf,lf.exports);var qN=lf.exports;const $s=Pc(qN),UN={theme:"system",setTheme:()=>null},Ww=m.createContext(UN);function GN({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[i,o]=m.useState(()=>localStorage.getItem(n)||t);m.useEffect(()=>{const a=window.document.documentElement;if(a.classList.remove("light","dark"),i==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";a.classList.add(l);return}a.classList.add(i)},[i]);const s={theme:i,setTheme:a=>{localStorage.setItem(n,a),o(a)}};return _.jsx(Ww.Provider,{...r,value:s,children:e})}const qw=()=>{const e=m.useContext(Ww);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};async function YN(e,t){return await(await fetch(`https://semaphor.cloud/api/v1/dashboard?id=${e}`,{headers:{Authorization:`Bearer ${t}`}})).json()}function Uw(e,t){return e==="dark"?$s.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function KN(e,t,n,r,i,o){const{data:s,refetch:a,isLoading:l,isError:c}=Sr({queryKey:[e],queryFn:()=>YN(e,t==null?void 0:t.accessToken),enabled:!1}),{theme:d,setTheme:f}=qw(),{setDashboard:g,setSelectedSheetId:p,setStyle:v,setOnSaveFunction:y}=ge(k=>k.actions),x=ge(k=>k.actions.setFilterValues),w=ge(k=>k.actions.setBookmarkKey),S=ge(k=>k.actions.setAuthToken),C=ge(k=>k.actions.setThemeStyle),P=ge(k=>k.actions.setDashboardTheme),O=ge(k=>k.actions.setOnEvent);return m.useEffect(()=>{d&&P(d)},[d,P]),m.useEffect(()=>{r&&f(r)},[r,f]),m.useEffect(()=>{const k=$s.cloneDeep(gm);if(n){const A=$s.merge(k,n),L=Uw(d,A);C(L),v(A)}else{const A=Uw(d,k);C(A),v(gm)}},[d,n,v]),m.useEffect(()=>{var j;if(!s||!s.dashboard)return;const k=s.dashboard,A=ss(k.id),L=JSON.parse(localStorage.getItem(A)||"[]"),F=L.find(B=>B.default===!0);if(F)g(F.template),w(F.name),F.filterValues&&x(F.filterValues);else{g(k);const B=L.find(V=>(V==null?void 0:V.name)==="Original");B?B.template=k:L.push({name:"Original",template:k,default:!1}),localStorage.setItem(A,JSON.stringify(L))}p((j=k.sheets)==null?void 0:j[0].id)},[s,g,p]),m.useEffect(()=>{i&&y(i),o&&O(o)},[i,y,o,O]),m.useEffect(()=>{t&&t.accessToken&&(S(t),a())},[t,a,S]),{isLoading:l,isError:c}}function cf({className:e,...t}){return _.jsx("div",{className:Pe("animate-pulse rounded-md bg-muted",e),...t})}function Gw({className:e,style:t,onSave:n,onEvent:r,LoadingComponent:i,ErrorComponent:o,id:s,authToken:a,currentTheme:l,...c}){ge(v=>v.selectedSheetId);const d=ge(v=>v.themeStyle),f=ge(v=>v.onEvent),{isLoading:g,isError:p}=KN(s,a,t,l,n,r);return g||!a?(f==null||f({type:"info",message:`isLoading: ${g}, accessToken: ${a==null?void 0:a.accessToken}`}),i?_.jsx(i,{message:"loading"}):_.jsx("div",{className:" flex items-center gap-3",children:_.jsx(cf,{className:"dark:h-[2px] h-1 w-full"})})):p?(f==null||f({type:"error",message:"Error fetching dashboard"}),o?(console.log("Error fetching dashboard"),_.jsx(o,{})):_.jsx("div",{children:"Error"})):_.jsx("div",{className:Pe(" h-full flex flex-col justify-between",d==null?void 0:d.dashboardPanel,e),role:"dashboard-panel",...c})}function ae(){return ae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ae.apply(this,arguments)}function Ce(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function Pn(e,t=[]){let n=[];function r(o,s){const a=m.createContext(s),l=n.length;n=[...n,s];function c(f){const{scope:g,children:p,...v}=f,y=(g==null?void 0:g[e][l])||a,x=m.useMemo(()=>v,Object.values(v));return m.createElement(y.Provider,{value:x},p)}function d(f,g){const p=(g==null?void 0:g[e][l])||a,v=m.useContext(p);if(v)return v;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${o}\``)}return c.displayName=o+"Provider",[c,d]}const i=()=>{const o=n.map(s=>m.createContext(s));return function(a){const l=(a==null?void 0:a[e])||o;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,XN(i,...t)]}function XN(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const f=l(o)[`__scope${c}`];return{...a,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function QN(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function uf(...e){return t=>e.forEach(n=>QN(n,t))}function et(...e){return m.useCallback(uf(...e),e)}const no=m.forwardRef((e,t)=>{const{children:n,...r}=e,i=m.Children.toArray(n),o=i.find(JN);if(o){const s=o.props.children,a=i.map(l=>l===o?m.Children.count(s)>1?m.Children.only(null):m.isValidElement(s)?s.props.children:null:l);return m.createElement(Cm,ae({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(Cm,ae({},r,{ref:t}),n)});no.displayName="Slot";const Cm=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...ZN(r,n.props),ref:t?uf(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});Cm.displayName="SlotClone";const Yw=({children:e})=>m.createElement(m.Fragment,null,e);function JN(e){return m.isValidElement(e)&&e.type===Yw}function ZN(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{o(...a),i(...a)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function df(e){const t=e+"CollectionProvider",[n,r]=Pn(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=p=>{const{scope:v,children:y}=p,x=m.useRef(null),w=m.useRef(new Map).current;return m.createElement(i,{scope:v,itemMap:w,collectionRef:x},y)},a=e+"CollectionSlot",l=m.forwardRef((p,v)=>{const{scope:y,children:x}=p,w=o(a,y),S=et(v,w.collectionRef);return m.createElement(no,{ref:S},x)}),c=e+"CollectionItemSlot",d="data-radix-collection-item",f=m.forwardRef((p,v)=>{const{scope:y,children:x,...w}=p,S=m.useRef(null),C=et(v,S),P=o(c,y);return m.useEffect(()=>(P.itemMap.set(S,{ref:S,...w}),()=>void P.itemMap.delete(S))),m.createElement(no,{[d]:"",ref:C},x)});function g(p){const v=o(e+"CollectionConsumer",p);return m.useCallback(()=>{const x=v.collectionRef.current;if(!x)return[];const w=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(v.itemMap.values()).sort((P,O)=>w.indexOf(P.ref.current)-w.indexOf(O.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:l,ItemSlot:f},g,r]}const Vn=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},eR=ue.useId||(()=>{});let tR=0;function or(e){const[t,n]=ue.useState(eR());return Vn(()=>{e||n(r=>r??String(tR++))},[e]),e||(t?`radix-${t}`:"")}const Be=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{const n=m.forwardRef((r,i)=>{const{asChild:o,...s}=r,a=o?no:t;return m.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),m.createElement(a,ae({},s,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Kw(e,t){e&&kt.flushSync(()=>e.dispatchEvent(t))}function xn(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function Qn({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=nR({defaultProp:t,onChange:n}),o=e!==void 0,s=o?e:r,a=xn(n),l=m.useCallback(c=>{if(o){const f=typeof c=="function"?c(e):c;f!==e&&a(f)}else i(c)},[o,e,i,a]);return[s,l]}function nR({defaultProp:e,onChange:t}){const n=m.useState(e),[r]=n,i=m.useRef(r),o=xn(t);return m.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}const rR=m.createContext(void 0);function Fs(e){const t=m.useContext(rR);return e||t||"ltr"}const Em="rovingFocusGroup.onEntryFocus",iR={bubbles:!1,cancelable:!0},Om="RovingFocusGroup",[Pm,Xw,oR]=df(Om),[sR,ol]=Pn(Om,[oR]),[aR,lR]=sR(Om),cR=m.forwardRef((e,t)=>m.createElement(Pm.Provider,{scope:e.__scopeRovingFocusGroup},m.createElement(Pm.Slot,{scope:e.__scopeRovingFocusGroup},m.createElement(uR,ae({},e,{ref:t}))))),uR=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,...d}=e,f=m.useRef(null),g=et(t,f),p=Fs(o),[v=null,y]=Qn({prop:s,defaultProp:a,onChange:l}),[x,w]=m.useState(!1),S=xn(c),C=Xw(n),P=m.useRef(!1),[O,k]=m.useState(0);return m.useEffect(()=>{const A=f.current;if(A)return A.addEventListener(Em,S),()=>A.removeEventListener(Em,S)},[S]),m.createElement(aR,{scope:n,orientation:r,dir:p,loop:i,currentTabStopId:v,onItemFocus:m.useCallback(A=>y(A),[y]),onItemShiftTab:m.useCallback(()=>w(!0),[]),onFocusableItemAdd:m.useCallback(()=>k(A=>A+1),[]),onFocusableItemRemove:m.useCallback(()=>k(A=>A-1),[])},m.createElement(Be.div,ae({tabIndex:x||O===0?-1:0,"data-orientation":r},d,{ref:g,style:{outline:"none",...e.style},onMouseDown:Ce(e.onMouseDown,()=>{P.current=!0}),onFocus:Ce(e.onFocus,A=>{const L=!P.current;if(A.target===A.currentTarget&&L&&!x){const F=new CustomEvent(Em,iR);if(A.currentTarget.dispatchEvent(F),!F.defaultPrevented){const j=C().filter($=>$.focusable),B=j.find($=>$.active),V=j.find($=>$.id===v),Y=[B,V,...j].filter(Boolean).map($=>$.ref.current);Qw(Y)}}P.current=!1}),onBlur:Ce(e.onBlur,()=>w(!1))})))}),dR="RovingFocusGroupItem",fR=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,...s}=e,a=or(),l=o||a,c=lR(dR,n),d=c.currentTabStopId===l,f=Xw(n),{onFocusableItemAdd:g,onFocusableItemRemove:p}=c;return m.useEffect(()=>{if(r)return g(),()=>p()},[r,g,p]),m.createElement(Pm.ItemSlot,{scope:n,id:l,focusable:r,active:i},m.createElement(Be.span,ae({tabIndex:d?0:-1,"data-orientation":c.orientation},s,{ref:t,onMouseDown:Ce(e.onMouseDown,v=>{r?c.onItemFocus(l):v.preventDefault()}),onFocus:Ce(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:Ce(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){c.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const y=gR(v,c.orientation,c.dir);if(y!==void 0){v.preventDefault();let w=f().filter(S=>S.focusable).map(S=>S.ref.current);if(y==="last")w.reverse();else if(y==="prev"||y==="next"){y==="prev"&&w.reverse();const S=w.indexOf(v.currentTarget);w=c.loop?mR(w,S+1):w.slice(S+1)}setTimeout(()=>Qw(w))}})})))}),hR={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function pR(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function gR(e,t,n){const r=pR(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return hR[r]}function Qw(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function mR(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const km=cR,Mm=fR;function vR(e,t){return m.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const vn=e=>{const{present:t,children:n}=e,r=bR(t),i=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),o=et(r.ref,i.ref);return typeof n=="function"||r.isPresent?m.cloneElement(i,{ref:o}):null};vn.displayName="Presence";function bR(e){const[t,n]=m.useState(),r=m.useRef({}),i=m.useRef(e),o=m.useRef("none"),s=e?"mounted":"unmounted",[a,l]=vR(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const c=ff(r.current);o.current=a==="mounted"?c:"none"},[a]),Vn(()=>{const c=r.current,d=i.current;if(d!==e){const g=o.current,p=ff(c);e?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(d&&g!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),Vn(()=>{if(t){const c=f=>{const p=ff(r.current).includes(f.animationName);f.target===t&&p&&kt.flushSync(()=>l("ANIMATION_END"))},d=f=>{f.target===t&&(o.current=ff(r.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:m.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function ff(e){return(e==null?void 0:e.animationName)||"none"}const Jw="Tabs",[yR,Cde]=Pn(Jw,[ol]),Zw=ol(),[xR,Dm]=yR(Jw),wR=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,d=Fs(a),[f,g]=Qn({prop:r,onChange:i,defaultProp:o});return m.createElement(xR,{scope:n,baseId:or(),value:f,onValueChange:g,orientation:s,dir:d,activationMode:l},m.createElement(Be.div,ae({dir:d,"data-orientation":s},c,{ref:t})))}),_R="TabsList",SR=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=Dm(_R,n),s=Zw(n);return m.createElement(km,ae({asChild:!0},s,{orientation:o.orientation,dir:o.dir,loop:r}),m.createElement(Be.div,ae({role:"tablist","aria-orientation":o.orientation},i,{ref:t})))}),CR="TabsTrigger",ER=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,s=Dm(CR,n),a=Zw(n),l=e_(s.baseId,r),c=t_(s.baseId,r),d=r===s.value;return m.createElement(Mm,ae({asChild:!0},a,{focusable:!i,active:d}),m.createElement(Be.button,ae({type:"button",role:"tab","aria-selected":d,"aria-controls":c,"data-state":d?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:l},o,{ref:t,onMouseDown:Ce(e.onMouseDown,f=>{!i&&f.button===0&&f.ctrlKey===!1?s.onValueChange(r):f.preventDefault()}),onKeyDown:Ce(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&s.onValueChange(r)}),onFocus:Ce(e.onFocus,()=>{const f=s.activationMode!=="manual";!d&&!i&&f&&s.onValueChange(r)})})))}),OR="TabsContent",PR=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...s}=e,a=Dm(OR,n),l=e_(a.baseId,r),c=t_(a.baseId,r),d=r===a.value,f=m.useRef(d);return m.useEffect(()=>{const g=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(g)},[]),m.createElement(vn,{present:i||d},({present:g})=>m.createElement(Be.div,ae({"data-state":d?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!g,id:c,tabIndex:0},s,{ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0}}),g&&o))});function e_(e,t){return`${e}-trigger-${t}`}function t_(e,t){return`${e}-content-${t}`}const kR=wR,n_=SR,r_=ER,i_=PR,o_=kR,s_=ue.forwardRef(({className:e,...t},n)=>_.jsx(n_,{ref:n,className:Pe("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));s_.displayName=n_.displayName;const Tm=ue.forwardRef(({className:e,...t},n)=>_.jsx(r_,{ref:n,className:Pe("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));Tm.displayName=r_.displayName;const hf=ue.forwardRef(({className:e,...t},n)=>_.jsx(i_,{ref:n,className:Pe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));hf.displayName=i_.displayName;var a_={exports:{}},Fc={},Am={exports:{}};(function(e,t){(function(n,r){r(t)})(Ro,function(n){function r(re){return function(W,ye,oe,Te,Fe,He,Ke){return re(W,ye,Ke)}}function i(re){return function(W,ye,oe,Te){if(!W||!ye||typeof W!="object"||typeof ye!="object")return re(W,ye,oe,Te);var Fe=Te.get(W),He=Te.get(ye);if(Fe&&He)return Fe===ye&&He===W;Te.set(W,ye),Te.set(ye,W);var Ke=re(W,ye,oe,Te);return Te.delete(W),Te.delete(ye),Ke}}function o(re,ee){var W={};for(var ye in re)W[ye]=re[ye];for(var ye in ee)W[ye]=ee[ye];return W}function s(re){return re.constructor===Object||re.constructor==null}function a(re){return typeof re.then=="function"}function l(re,ee){return re===ee||re!==re&&ee!==ee}var c="[object Arguments]",d="[object Boolean]",f="[object Date]",g="[object RegExp]",p="[object Map]",v="[object Number]",y="[object Object]",x="[object Set]",w="[object String]",S=Object.prototype.toString;function C(re){var ee=re.areArraysEqual,W=re.areDatesEqual,ye=re.areMapsEqual,oe=re.areObjectsEqual,Te=re.areRegExpsEqual,Fe=re.areSetsEqual,He=re.createIsNestedEqual,Ke=He(St);function St(vt,bt,tn){if(vt===bt)return!0;if(!vt||!bt||typeof vt!="object"||typeof bt!="object")return vt!==vt&&bt!==bt;if(s(vt)&&s(bt))return oe(vt,bt,Ke,tn);var Zt=Array.isArray(vt),Dn=Array.isArray(bt);if(Zt||Dn)return Zt===Dn&&ee(vt,bt,Ke,tn);var fn=S.call(vt);return fn!==S.call(bt)?!1:fn===f?W(vt,bt,Ke,tn):fn===g?Te(vt,bt,Ke,tn):fn===p?ye(vt,bt,Ke,tn):fn===x?Fe(vt,bt,Ke,tn):fn===y||fn===c?a(vt)||a(bt)?!1:oe(vt,bt,Ke,tn):fn===d||fn===v||fn===w?l(vt.valueOf(),bt.valueOf()):!1}return St}function P(re,ee,W,ye){var oe=re.length;if(ee.length!==oe)return!1;for(;oe-- >0;)if(!W(re[oe],ee[oe],oe,oe,re,ee,ye))return!1;return!0}var O=i(P);function k(re,ee){return l(re.valueOf(),ee.valueOf())}function A(re,ee,W,ye){var oe=re.size===ee.size;if(!oe)return!1;if(!re.size)return!0;var Te={},Fe=0;return re.forEach(function(He,Ke){if(oe){var St=!1,vt=0;ee.forEach(function(bt,tn){!St&&!Te[vt]&&(St=W(Ke,tn,Fe,vt,re,ee,ye)&&W(He,bt,Ke,tn,re,ee,ye))&&(Te[vt]=!0),vt++}),Fe++,oe=St}}),oe}var L=i(A),F="_owner",j=Object.prototype.hasOwnProperty;function B(re,ee,W,ye){var oe=Object.keys(re),Te=oe.length;if(Object.keys(ee).length!==Te)return!1;for(var Fe;Te-- >0;){if(Fe=oe[Te],Fe===F){var He=!!re.$$typeof,Ke=!!ee.$$typeof;if((He||Ke)&&He!==Ke)return!1}if(!j.call(ee,Fe)||!W(re[Fe],ee[Fe],Fe,Fe,re,ee,ye))return!1}return!0}var V=i(B);function K(re,ee){return re.source===ee.source&&re.flags===ee.flags}function Y(re,ee,W,ye){var oe=re.size===ee.size;if(!oe)return!1;if(!re.size)return!0;var Te={};return re.forEach(function(Fe,He){if(oe){var Ke=!1,St=0;ee.forEach(function(vt,bt){!Ke&&!Te[St]&&(Ke=W(Fe,vt,He,bt,re,ee,ye))&&(Te[St]=!0),St++}),oe=Ke}}),oe}var $=i(Y),Z=Object.freeze({areArraysEqual:P,areDatesEqual:k,areMapsEqual:A,areObjectsEqual:B,areRegExpsEqual:K,areSetsEqual:Y,createIsNestedEqual:r}),U=Object.freeze({areArraysEqual:O,areDatesEqual:k,areMapsEqual:L,areObjectsEqual:V,areRegExpsEqual:K,areSetsEqual:$,createIsNestedEqual:r}),ie=C(Z);function le(re,ee){return ie(re,ee,void 0)}var M=C(o(Z,{createIsNestedEqual:function(){return l}}));function H(re,ee){return M(re,ee,void 0)}var ne=C(U);function N(re,ee){return ne(re,ee,new WeakMap)}var X=C(o(U,{createIsNestedEqual:function(){return l}}));function me(re,ee){return X(re,ee,new WeakMap)}function he(re){return C(o(Z,re(Z)))}function de(re){var ee=C(o(U,re(U)));return function(W,ye,oe){return oe===void 0&&(oe=new WeakMap),ee(W,ye,oe)}}n.circularDeepEqual=N,n.circularShallowEqual=me,n.createCustomCircularEqual=de,n.createCustomEqual=he,n.deepEqual=le,n.sameValueZeroEqual=l,n.shallowEqual=H,Object.defineProperty(n,"__esModule",{value:!0})})})(Am,Am.exports);var Im=Am.exports;const Nm=Yg(i3);var pt={},MR=function(t,n,r){return t===n?!0:t.className===n.className&&r(t.style,n.style)&&t.width===n.width&&t.autoSize===n.autoSize&&t.cols===n.cols&&t.draggableCancel===n.draggableCancel&&t.draggableHandle===n.draggableHandle&&r(t.verticalCompact,n.verticalCompact)&&r(t.compactType,n.compactType)&&r(t.layout,n.layout)&&r(t.margin,n.margin)&&r(t.containerPadding,n.containerPadding)&&t.rowHeight===n.rowHeight&&t.maxRows===n.maxRows&&t.isBounded===n.isBounded&&t.isDraggable===n.isDraggable&&t.isResizable===n.isResizable&&t.allowOverlap===n.allowOverlap&&t.preventCollision===n.preventCollision&&t.useCSSTransforms===n.useCSSTransforms&&t.transformScale===n.transformScale&&t.isDroppable===n.isDroppable&&r(t.resizeHandles,n.resizeHandles)&&r(t.resizeHandle,n.resizeHandle)&&t.onLayoutChange===n.onLayoutChange&&t.onDragStart===n.onDragStart&&t.onDrag===n.onDrag&&t.onDragStop===n.onDragStop&&t.onResizeStart===n.onResizeStart&&t.onResize===n.onResize&&t.onResizeStop===n.onResizeStop&&t.onDrop===n.onDrop&&r(t.droppingItem,n.droppingItem)&&r(t.innerRef,n.innerRef)};Object.defineProperty(pt,"__esModule",{value:!0}),pt.bottom=Rm,pt.childrenEqual=IR,pt.cloneLayout=c_,pt.cloneLayoutItem=js,pt.collides=pf,pt.compact=d_,pt.compactItem=f_,pt.compactType=HR,pt.correctBounds=h_,pt.fastPositionEqual=RR,pt.fastRGLPropsEqual=void 0,pt.getAllCollisions=p_,pt.getFirstCollision=zs,pt.getLayoutItem=$m,pt.getStatics=Fm,pt.modifyLayout=u_,pt.moveElement=zc,pt.moveElementAwayFromCollision=jm,pt.noop=void 0,pt.perc=$R,pt.resizeItemInDirection=jR,pt.setTopLeft=BR,pt.setTransform=zR,pt.sortLayoutItems=qm,pt.sortLayoutItemsByColRow=y_,pt.sortLayoutItemsByRowCol=b_,pt.synchronizeLayoutWithChildren=VR,pt.validateLayout=x_,pt.withLayoutItem=AR;var l_=Im,jc=DR(m);function DR(e){return e&&e.__esModule?e:{default:e}}const TR=process.env.NODE_ENV==="production";function Rm(e){let t=0,n;for(let r=0,i=e.length;r<i;r++)n=e[r].y+e[r].h,n>t&&(t=n);return t}function c_(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=js(e[n]);return t}function u_(e,t){const n=Array(e.length);for(let r=0,i=e.length;r<i;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function AR(e,t,n){let r=$m(e,t);return r?(r=n(js(r)),e=u_(e,r),[e,r]):[e,null]}function js(e){return{w:e.w,h:e.h,x:e.x,y:e.y,i:e.i,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,isBounded:e.isBounded}}function IR(e,t){return(0,l_.deepEqual)(jc.default.Children.map(e,n=>n==null?void 0:n.key),jc.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,l_.deepEqual)(jc.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),jc.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}const NR=MR;pt.fastRGLPropsEqual=NR;function RR(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function pf(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function d_(e,t,n,r){const i=Fm(e),o=qm(e,t),s=Array(e.length);for(let a=0,l=o.length;a<l;a++){let c=js(o[a]);c.static||(c=f_(i,c,t,n,o,r),i.push(c)),s[e.indexOf(o[a])]=c,c.moved=!1}return s}const LR={x:"w",y:"h"};function Lm(e,t,n,r){const i=LR[r];t[r]+=1;const o=e.map(s=>s.i).indexOf(t.i);for(let s=o+1;s<e.length;s++){const a=e[s];if(!a.static){if(a.y>t.y+t.h)break;pf(t,a)&&Lm(e,a,n+t[i],r)}}t[r]=n}function f_(e,t,n,r,i,o){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(Rm(e),t.y);t.y>0&&!zs(e,t);)t.y--;else if(a)for(;t.x>0&&!zs(e,t);)t.x--;let l;for(;(l=zs(e,t))&&!(n===null&&o);)if(a?Lm(i,t,l.x+l.w,"x"):Lm(i,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!zs(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function h_(e,t){const n=Fm(e);for(let r=0,i=e.length;r<i;r++){const o=e[r];if(o.x+o.w>t.cols&&(o.x=t.cols-o.w),o.x<0&&(o.x=0,o.w=t.cols),!o.static)n.push(o);else for(;zs(n,o);)o.y++}return e}function $m(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function zs(e,t){for(let n=0,r=e.length;n<r;n++)if(pf(e[n],t))return e[n]}function p_(e,t){return e.filter(n=>pf(n,t))}function Fm(e){return e.filter(t=>t.static)}function zc(e,t,n,r,i,o,s,a,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;"Moving element ".concat(t.i," to [").concat(String(n),",").concat(String(r),"] from [").concat(t.x,",").concat(t.y,"]");const c=t.x,d=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let f=qm(e,s);(s==="vertical"&&typeof r=="number"?d>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(f=f.reverse());const p=p_(f,t),v=p.length>0;if(v&&l)return c_(e);if(v&&o)return"Collision prevented on ".concat(t.i,", reverting."),t.x=c,t.y=d,t.moved=!1,e;for(let y=0,x=p.length;y<x;y++){const w=p[y];"Resolving collision between ".concat(t.i," at [").concat(t.x,",").concat(t.y,"] and ").concat(w.i," at [").concat(w.x,",").concat(w.y,"]"),!w.moved&&(w.static?e=jm(e,w,t,i,s):e=jm(e,t,w,i,s))}return e}function jm(e,t,n,r,i,o){const s=i==="horizontal",a=i==="vertical",l=t.static;if(r){r=!1;const f={x:s?Math.max(t.x-n.w,0):n.x,y:a?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},g=zs(e,f),p=g&&g.y+g.h>t.y,v=g&&t.x+t.w>g.x;if(g){if(p&&a)return zc(e,n,void 0,t.y+1,r,l,i);if(p&&i==null)return t.y=n.y,n.y=n.y+n.h,e;if(v&&s)return zc(e,t,n.x,void 0,r,l,i)}else return"Doing reverse collision on ".concat(n.i," up to [").concat(f.x,",").concat(f.y,"]."),zc(e,n,s?f.x:void 0,a?f.y:void 0,r,l,i)}const c=s?n.x+1:void 0,d=a?n.y+1:void 0;return c==null&&d==null?e:zc(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,i)}function $R(e){return e*100+"%"}const g_=(e,t,n,r)=>e+n>r?t:n,m_=(e,t,n)=>e<0?t:n,v_=e=>Math.max(0,e),zm=e=>Math.max(0,e),Bm=(e,t,n)=>{let{left:r,height:i,width:o}=t;const s=e.top-(i-e.height);return{left:r,width:o,height:m_(s,e.height,i),top:zm(s)}},Vm=(e,t,n)=>{let{top:r,left:i,height:o,width:s}=t;return{top:r,height:o,width:g_(e.left,e.width,s,n),left:v_(i)}},Hm=(e,t,n)=>{let{top:r,height:i,width:o}=t;const s=e.left-(o-e.width);return{height:i,width:s<0?e.width:g_(e.left,e.width,o,n),top:zm(r),left:v_(s)}},Wm=(e,t,n)=>{let{top:r,left:i,height:o,width:s}=t;return{width:s,left:i,height:m_(r,e.height,o),top:zm(r)}},FR={n:Bm,ne:function(){return Bm(arguments.length<=0?void 0:arguments[0],Vm(...arguments))},e:Vm,se:function(){return Wm(arguments.length<=0?void 0:arguments[0],Vm(...arguments))},s:Wm,sw:function(){return Wm(arguments.length<=0?void 0:arguments[0],Hm(...arguments))},w:Hm,nw:function(){return Bm(arguments.length<=0?void 0:arguments[0],Hm(...arguments))}};function jR(e,t,n,r){const i=FR[e];return i?i(t,{...t,...n},r):n}function zR(e){let{top:t,left:n,width:r,height:i}=e;const o="translate(".concat(n,"px,").concat(t,"px)");return{transform:o,WebkitTransform:o,MozTransform:o,msTransform:o,OTransform:o,width:"".concat(r,"px"),height:"".concat(i,"px"),position:"absolute"}}function BR(e){let{top:t,left:n,width:r,height:i}=e;return{top:"".concat(t,"px"),left:"".concat(n,"px"),width:"".concat(r,"px"),height:"".concat(i,"px"),position:"absolute"}}function qm(e,t){return t==="horizontal"?y_(e):t==="vertical"?b_(e):e}function b_(e){return e.slice(0).sort(function(t,n){return t.y>n.y||t.y===n.y&&t.x>n.x?1:t.y===n.y&&t.x===n.x?0:-1})}function y_(e){return e.slice(0).sort(function(t,n){return t.x>n.x||t.x===n.x&&t.y>n.y?1:-1})}function VR(e,t,n,r,i){e=e||[];const o=[];jc.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=$m(e,String(a.key)),c=a.props["data-grid"];l&&c==null?o.push(js(l)):c?(TR||x_([c],"ReactGridLayout.children"),o.push(js({...c,i:a.key}))):o.push(js({w:1,h:1,x:0,y:Rm(o),i:String(a.key)}))});const s=h_(o,{cols:n});return i?s:d_(s,r,n)}function x_(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const n=["x","y","w","h"];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(let r=0,i=e.length;r<i;r++){const o=e[r];for(let s=0;s<n.length;s++)if(typeof o[n[s]]!="number")throw new Error("ReactGridLayout: "+t+"["+r+"]."+n[s]+" must be a number!")}}function HR(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}function Mde(){}const WR=()=>{};pt.noop=WR;var ki={};Object.defineProperty(ki,"__esModule",{value:!0}),ki.calcGridColWidth=gf,ki.calcGridItemPosition=qR,ki.calcGridItemWHPx=Um,ki.calcWH=GR,ki.calcXY=UR,ki.clamp=Bs;function gf(e){const{margin:t,containerPadding:n,containerWidth:r,cols:i}=e;return(r-t[0]*(i-1)-n[0]*2)/i}function Um(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function qR(e,t,n,r,i,o){const{margin:s,containerPadding:a,rowHeight:l}=e,c=gf(e),d={};return o&&o.resizing?(d.width=Math.round(o.resizing.width),d.height=Math.round(o.resizing.height)):(d.width=Um(r,c,s[0]),d.height=Um(i,l,s[1])),o&&o.dragging?(d.top=Math.round(o.dragging.top),d.left=Math.round(o.dragging.left)):o&&o.resizing&&typeof o.resizing.top=="number"&&typeof o.resizing.left=="number"?(d.top=Math.round(o.resizing.top),d.left=Math.round(o.resizing.left)):(d.top=Math.round((l+s[1])*n+a[1]),d.left=Math.round((c+s[0])*t+a[0])),d}function UR(e,t,n,r,i){const{margin:o,cols:s,rowHeight:a,maxRows:l}=e,c=gf(e);let d=Math.round((n-o[0])/(c+o[0])),f=Math.round((t-o[1])/(a+o[1]));return d=Bs(d,0,s-r),f=Bs(f,0,l-i),{x:d,y:f}}function GR(e,t,n,r,i,o){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,d=gf(e);let f=Math.round((t+s[0])/(d+s[0])),g=Math.round((n+s[1])/(c+s[1])),p=Bs(f,0,l-r),v=Bs(g,0,a-i);return["sw","w","nw"].indexOf(o)!==-1&&(p=Bs(f,0,l)),["nw","n","ne"].indexOf(o)!==-1&&(v=Bs(g,0,a)),{w:p,h:v}}function Bs(e,t,n){return Math.max(Math.min(e,n),t)}var mf={},Gm={exports:{}},Ym,w_;function Km(){if(w_)return Ym;w_=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Ym=e,Ym}var Xm,__;function YR(){if(__)return Xm;__=1;var e=Km();function t(){}function n(){}return n.resetWarningCache=t,Xm=function(){function r(s,a,l,c,d,f){if(f!==e){var g=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw g.name="Invariant Violation",g}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Xm}var vf={exports:{}},At={};/** @license React v16.13.1
|
|
86
86
|
* react-is.development.js
|
|
87
87
|
*
|
|
88
88
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -101,9 +101,9 @@ object-assign
|
|
|
101
101
|
(c) Sindre Sorhus
|
|
102
102
|
@license MIT
|
|
103
103
|
*/var Qm,P_;function QR(){if(P_)return Qm;P_=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function i(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var s={},a=0;a<10;a++)s["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(s).map(function(d){return s[d]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(d){c[d]=d}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Qm=i()?Object.assign:function(o,s){for(var a,l=r(o),c,d=1;d<arguments.length;d++){a=Object(arguments[d]);for(var f in a)t.call(a,f)&&(l[f]=a[f]);if(e){c=e(a);for(var g=0;g<c.length;g++)n.call(a,c[g])&&(l[c[g]]=a[c[g]])}}return l},Qm}var Jm,k_;function M_(){return k_||(k_=1,Jm=Function.call.bind(Object.prototype.hasOwnProperty)),Jm}var Zm,D_;function JR(){if(D_)return Zm;D_=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Km(),n={},r=M_();e=function(o){var s="Warning: "+o;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}}function i(o,s,a,l,c){if(process.env.NODE_ENV!=="production"){for(var d in o)if(r(o,d)){var f;try{if(typeof o[d]!="function"){var g=Error((l||"React class")+": "+a+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw g.name="Invariant Violation",g}f=o[d](s,d,l,a,null,t)}catch(v){f=v}if(f&&!(f instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+d+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in n)){n[f.message]=!0;var p=c?c():"";e("Failed "+a+" type: "+f.message+(p??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Zm=i,Zm}var ev,T_;function ZR(){if(T_)return ev;T_=1;var e=O_(),t=QR(),n=Km(),r=M_(),i=JR(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function s(){return null}return ev=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,d="@@iterator";function f(M){var H=M&&(c&&M[c]||M[d]);if(typeof H=="function")return H}var g="<<anonymous>>",p={array:w("array"),bigint:w("bigint"),bool:w("boolean"),func:w("function"),number:w("number"),object:w("object"),string:w("string"),symbol:w("symbol"),any:S(),arrayOf:C,element:P(),elementType:O(),instanceOf:k,node:j(),objectOf:L,oneOf:A,oneOfType:F,shape:V,exact:K};function v(M,H){return M===H?M!==0||1/M===1/H:M!==M&&H!==H}function y(M,H){this.message=M,this.data=H&&typeof H=="object"?H:{},this.stack=""}y.prototype=Error.prototype;function x(M){if(process.env.NODE_ENV!=="production")var H={},ne=0;function N(me,he,de,re,ee,W,ye){if(re=re||g,W=W||de,ye!==n){if(l){var oe=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw oe.name="Invariant Violation",oe}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Te=re+":"+de;!H[Te]&&ne<3&&(o("You are manually calling a React.PropTypes validation function for the `"+W+"` prop on `"+re+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),H[Te]=!0,ne++)}}return he[de]==null?me?he[de]===null?new y("The "+ee+" `"+W+"` is marked as required "+("in `"+re+"`, but its value is `null`.")):new y("The "+ee+" `"+W+"` is marked as required in "+("`"+re+"`, but its value is `undefined`.")):null:M(he,de,re,ee,W)}var X=N.bind(null,!1);return X.isRequired=N.bind(null,!0),X}function w(M){function H(ne,N,X,me,he,de){var re=ne[N],ee=Z(re);if(ee!==M){var W=U(re);return new y("Invalid "+me+" `"+he+"` of type "+("`"+W+"` supplied to `"+X+"`, expected ")+("`"+M+"`."),{expectedType:M})}return null}return x(H)}function S(){return x(s)}function C(M){function H(ne,N,X,me,he){if(typeof M!="function")return new y("Property `"+he+"` of component `"+X+"` has invalid PropType notation inside arrayOf.");var de=ne[N];if(!Array.isArray(de)){var re=Z(de);return new y("Invalid "+me+" `"+he+"` of type "+("`"+re+"` supplied to `"+X+"`, expected an array."))}for(var ee=0;ee<de.length;ee++){var W=M(de,ee,X,me,he+"["+ee+"]",n);if(W instanceof Error)return W}return null}return x(H)}function P(){function M(H,ne,N,X,me){var he=H[ne];if(!a(he)){var de=Z(he);return new y("Invalid "+X+" `"+me+"` of type "+("`"+de+"` supplied to `"+N+"`, expected a single ReactElement."))}return null}return x(M)}function O(){function M(H,ne,N,X,me){var he=H[ne];if(!e.isValidElementType(he)){var de=Z(he);return new y("Invalid "+X+" `"+me+"` of type "+("`"+de+"` supplied to `"+N+"`, expected a single ReactElement type."))}return null}return x(M)}function k(M){function H(ne,N,X,me,he){if(!(ne[N]instanceof M)){var de=M.name||g,re=le(ne[N]);return new y("Invalid "+me+" `"+he+"` of type "+("`"+re+"` supplied to `"+X+"`, expected ")+("instance of `"+de+"`."))}return null}return x(H)}function A(M){if(!Array.isArray(M))return process.env.NODE_ENV!=="production"&&(arguments.length>1?o("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):o("Invalid argument supplied to oneOf, expected an array.")),s;function H(ne,N,X,me,he){for(var de=ne[N],re=0;re<M.length;re++)if(v(de,M[re]))return null;var ee=JSON.stringify(M,function(ye,oe){var Te=U(oe);return Te==="symbol"?String(oe):oe});return new y("Invalid "+me+" `"+he+"` of value `"+String(de)+"` "+("supplied to `"+X+"`, expected one of "+ee+"."))}return x(H)}function L(M){function H(ne,N,X,me,he){if(typeof M!="function")return new y("Property `"+he+"` of component `"+X+"` has invalid PropType notation inside objectOf.");var de=ne[N],re=Z(de);if(re!=="object")return new y("Invalid "+me+" `"+he+"` of type "+("`"+re+"` supplied to `"+X+"`, expected an object."));for(var ee in de)if(r(de,ee)){var W=M(de,ee,X,me,he+"."+ee,n);if(W instanceof Error)return W}return null}return x(H)}function F(M){if(!Array.isArray(M))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var H=0;H<M.length;H++){var ne=M[H];if(typeof ne!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+ie(ne)+" at index "+H+"."),s}function N(X,me,he,de,re){for(var ee=[],W=0;W<M.length;W++){var ye=M[W],oe=ye(X,me,he,de,re,n);if(oe==null)return null;oe.data&&r(oe.data,"expectedType")&&ee.push(oe.data.expectedType)}var Te=ee.length>0?", expected one of type ["+ee.join(", ")+"]":"";return new y("Invalid "+de+" `"+re+"` supplied to "+("`"+he+"`"+Te+"."))}return x(N)}function j(){function M(H,ne,N,X,me){return Y(H[ne])?null:new y("Invalid "+X+" `"+me+"` supplied to "+("`"+N+"`, expected a ReactNode."))}return x(M)}function B(M,H,ne,N,X){return new y((M||"React class")+": "+H+" type `"+ne+"."+N+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+X+"`.")}function V(M){function H(ne,N,X,me,he){var de=ne[N],re=Z(de);if(re!=="object")return new y("Invalid "+me+" `"+he+"` of type `"+re+"` "+("supplied to `"+X+"`, expected `object`."));for(var ee in M){var W=M[ee];if(typeof W!="function")return B(X,me,he,ee,U(W));var ye=W(de,ee,X,me,he+"."+ee,n);if(ye)return ye}return null}return x(H)}function K(M){function H(ne,N,X,me,he){var de=ne[N],re=Z(de);if(re!=="object")return new y("Invalid "+me+" `"+he+"` of type `"+re+"` "+("supplied to `"+X+"`, expected `object`."));var ee=t({},ne[N],M);for(var W in ee){var ye=M[W];if(r(M,W)&&typeof ye!="function")return B(X,me,he,W,U(ye));if(!ye)return new y("Invalid "+me+" `"+he+"` key `"+W+"` supplied to `"+X+"`.\nBad object: "+JSON.stringify(ne[N],null," ")+`
|
|
104
|
-
Valid keys: `+JSON.stringify(Object.keys(M),null," "));var oe=ye(de,W,X,me,he+"."+W,n);if(oe)return oe}return null}return x(H)}function Y(M){switch(typeof M){case"number":case"string":case"undefined":return!0;case"boolean":return!M;case"object":if(Array.isArray(M))return M.every(Y);if(M===null||a(M))return!0;var H=f(M);if(H){var ne=H.call(M),N;if(H!==M.entries){for(;!(N=ne.next()).done;)if(!Y(N.value))return!1}else for(;!(N=ne.next()).done;){var X=N.value;if(X&&!Y(X[1]))return!1}}else return!1;return!0;default:return!1}}function $(M,H){return M==="symbol"?!0:H?H["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&H instanceof Symbol:!1}function Z(M){var H=typeof M;return Array.isArray(M)?"array":M instanceof RegExp?"object":$(H,M)?"symbol":H}function U(M){if(typeof M>"u"||M===null)return""+M;var H=Z(M);if(H==="object"){if(M instanceof Date)return"date";if(M instanceof RegExp)return"regexp"}return H}function ie(M){var H=U(M);switch(H){case"array":case"object":return"an "+H;case"boolean":case"date":case"regexp":return"a "+H;default:return H}}function le(M){return!M.constructor||!M.constructor.name?g:M.constructor.name}return p.checkPropTypes=i,p.resetWarningCache=i.resetWarningCache,p.PropTypes=p,p},ev}if(process.env.NODE_ENV!=="production"){var e7=O_(),t7=!0;Gm.exports=ZR()(e7.isElement,t7)}else Gm.exports=YR()();var Fo=Gm.exports,bf={exports:{}},A_={};function I_(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=I_(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function N_(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=I_(e))&&(r&&(r+=" "),r+=t);return r}const n7=Yg(Object.freeze(Object.defineProperty({__proto__:null,clsx:N_,default:N_},Symbol.toStringTag,{value:"Module"})));var
|
|
104
|
+
Valid keys: `+JSON.stringify(Object.keys(M),null," "));var oe=ye(de,W,X,me,he+"."+W,n);if(oe)return oe}return null}return x(H)}function Y(M){switch(typeof M){case"number":case"string":case"undefined":return!0;case"boolean":return!M;case"object":if(Array.isArray(M))return M.every(Y);if(M===null||a(M))return!0;var H=f(M);if(H){var ne=H.call(M),N;if(H!==M.entries){for(;!(N=ne.next()).done;)if(!Y(N.value))return!1}else for(;!(N=ne.next()).done;){var X=N.value;if(X&&!Y(X[1]))return!1}}else return!1;return!0;default:return!1}}function $(M,H){return M==="symbol"?!0:H?H["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&H instanceof Symbol:!1}function Z(M){var H=typeof M;return Array.isArray(M)?"array":M instanceof RegExp?"object":$(H,M)?"symbol":H}function U(M){if(typeof M>"u"||M===null)return""+M;var H=Z(M);if(H==="object"){if(M instanceof Date)return"date";if(M instanceof RegExp)return"regexp"}return H}function ie(M){var H=U(M);switch(H){case"array":case"object":return"an "+H;case"boolean":case"date":case"regexp":return"a "+H;default:return H}}function le(M){return!M.constructor||!M.constructor.name?g:M.constructor.name}return p.checkPropTypes=i,p.resetWarningCache=i.resetWarningCache,p.PropTypes=p,p},ev}if(process.env.NODE_ENV!=="production"){var e7=O_(),t7=!0;Gm.exports=ZR()(e7.isElement,t7)}else Gm.exports=YR()();var Fo=Gm.exports,bf={exports:{}},A_={};function I_(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=I_(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function N_(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=I_(e))&&(r&&(r+=" "),r+=t);return r}const n7=Yg(Object.freeze(Object.defineProperty({__proto__:null,clsx:N_,default:N_},Symbol.toStringTag,{value:"Module"})));var an={},Mi={};Object.defineProperty(Mi,"__esModule",{value:!0}),Mi.dontSetMe=a7,Mi.findInArray=r7,Mi.int=s7,Mi.isFunction=i7,Mi.isNum=o7;function r7(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function i7(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function o7(e){return typeof e=="number"&&!isNaN(e)}function s7(e){return parseInt(e,10)}function a7(e,t,n){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(n," - do not set this, set it on the child."))}var Vs={};Object.defineProperty(Vs,"__esModule",{value:!0}),Vs.browserPrefixToKey=L_,Vs.browserPrefixToStyle=l7,Vs.default=void 0,Vs.getPrefix=R_;const tv=["Moz","Webkit","O","ms"];function R_(){var e;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const n=(e=window.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.style;if(!n||t in n)return"";for(let r=0;r<tv.length;r++)if(L_(t,tv[r])in n)return tv[r];return""}function L_(e,t){return t?"".concat(t).concat(c7(e)):e}function l7(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function c7(e){let t="",n=!0;for(let r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):e[r]==="-"?n=!0:t+=e[r];return t}Vs.default=R_(),Object.defineProperty(an,"__esModule",{value:!0}),an.addClassName=z_,an.addEvent=f7,an.addUserSelectStyles=S7,an.createCSSTransform=y7,an.createSVGTransform=x7,an.getTouch=w7,an.getTouchIdentifier=_7,an.getTranslation=nv,an.innerHeight=m7,an.innerWidth=v7,an.matchesSelector=j_,an.matchesSelectorAndParentsTo=d7,an.offsetXYFromParent=b7,an.outerHeight=p7,an.outerWidth=g7,an.removeClassName=B_,an.removeEvent=h7,an.removeUserSelectStyles=C7;var Cr=Mi,$_=u7(Vs);function F_(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(F_=function(r){return r?n:t})(e)}function u7(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=F_(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}let yf="";function j_(e,t){return yf||(yf=(0,Cr.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,Cr.isFunction)(e[n])})),(0,Cr.isFunction)(e[yf])?e[yf](t):!1}function d7(e,t,n){let r=e;do{if(j_(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function f7(e,t,n,r){if(!e)return;const i={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,i):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n}function h7(e,t,n,r){if(!e)return;const i={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,i):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null}function p7(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Cr.int)(n.borderTopWidth),t+=(0,Cr.int)(n.borderBottomWidth),t}function g7(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Cr.int)(n.borderLeftWidth),t+=(0,Cr.int)(n.borderRightWidth),t}function m7(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Cr.int)(n.paddingTop),t-=(0,Cr.int)(n.paddingBottom),t}function v7(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Cr.int)(n.paddingLeft),t-=(0,Cr.int)(n.paddingRight),t}function b7(e,t,n){const i=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),o=(e.clientX+t.scrollLeft-i.left)/n,s=(e.clientY+t.scrollTop-i.top)/n;return{x:o,y:s}}function y7(e,t){const n=nv(e,t,"px");return{[(0,$_.browserPrefixToKey)("transform",$_.default)]:n}}function x7(e,t){return nv(e,t,"")}function nv(e,t,n){let{x:r,y:i}=e,o="translate(".concat(r).concat(n,",").concat(i).concat(n,")");if(t){const s="".concat(typeof t.x=="string"?t.x:t.x+n),a="".concat(typeof t.y=="string"?t.y:t.y+n);o="translate(".concat(s,", ").concat(a,")")+o}return o}function w7(e,t){return e.targetTouches&&(0,Cr.findInArray)(e.targetTouches,n=>t===n.identifier)||e.changedTouches&&(0,Cr.findInArray)(e.changedTouches,n=>t===n.identifier)}function _7(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function S7(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
105
105
|
`,t.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
106
|
-
`,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&z_(e.body,"react-draggable-transparent-selection")}function C7(e){if(e)try{if(e.body&&B_(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&t.type!=="Caret"&&t.removeAllRanges()}}catch{}}function z_(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function B_(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var Di={};Object.defineProperty(Di,"__esModule",{value:!0}),Di.canDragX=P7,Di.canDragY=k7,Di.createCoreData=D7,Di.createDraggableData=T7,Di.getBoundPosition=E7,Di.getControlPosition=M7,Di.snapToGrid=O7;var Er=Mi,sl=ln;function E7(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:A7(r);const i=rv(e);if(typeof r=="string"){const{ownerDocument:o}=i,s=o.defaultView;let a;if(r==="parent"?a=i.parentNode:a=o.querySelector(r),!(a instanceof s.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=a,c=s.getComputedStyle(i),d=s.getComputedStyle(l);r={left:-i.offsetLeft+(0,Er.int)(d.paddingLeft)+(0,Er.int)(c.marginLeft),top:-i.offsetTop+(0,Er.int)(d.paddingTop)+(0,Er.int)(c.marginTop),right:(0,sl.innerWidth)(l)-(0,sl.outerWidth)(i)-i.offsetLeft+(0,Er.int)(d.paddingRight)-(0,Er.int)(c.marginRight),bottom:(0,sl.innerHeight)(l)-(0,sl.outerHeight)(i)-i.offsetTop+(0,Er.int)(d.paddingBottom)-(0,Er.int)(c.marginBottom)}}return(0,Er.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,Er.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,Er.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,Er.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function O7(e,t,n){const r=Math.round(t/e[0])*e[0],i=Math.round(n/e[1])*e[1];return[r,i]}function P7(e){return e.props.axis==="both"||e.props.axis==="x"}function k7(e){return e.props.axis==="both"||e.props.axis==="y"}function M7(e,t,n){const r=typeof t=="number"?(0,sl.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const i=rv(n),o=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return(0,sl.offsetXYFromParent)(r||e,o,n.props.scale)}function D7(e,t,n){const r=!(0,Er.isNum)(e.lastX),i=rv(e);return r?{node:i,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:i,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function T7(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function A7(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function rv(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var xf={},wf={};Object.defineProperty(wf,"__esModule",{value:!0}),wf.default=I7;function I7(){}Object.defineProperty(xf,"__esModule",{value:!0}),xf.default=void 0;var iv=R7(m),sr=sv(Fo),N7=sv(kt),Hn=ln,jo=Di,ov=Mi,Bc=sv(wf);function sv(e){return e&&e.__esModule?e:{default:e}}function V_(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(V_=function(r){return r?n:t})(e)}function R7(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=V_(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function Jn(e,t,n){return t=L7(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function L7(e){var t=$7(e,"string");return typeof t=="symbol"?t:String(t)}function $7(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const gi={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let zo=gi.mouse,_f=class extends iv.Component{constructor(){super(...arguments),Jn(this,"dragging",!1),Jn(this,"lastX",NaN),Jn(this,"lastY",NaN),Jn(this,"touchIdentifier",null),Jn(this,"mounted",!1),Jn(this,"handleDragStart",t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&typeof t.button=="number"&&t.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:r}=n;if(this.props.disabled||!(t.target instanceof r.defaultView.Node)||this.props.handle&&!(0,Hn.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,Hn.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const i=(0,Hn.getTouchIdentifier)(t);this.touchIdentifier=i;const o=(0,jo.getControlPosition)(t,i,this);if(o==null)return;const{x:s,y:a}=o,l=(0,jo.createCoreData)(this,s,a);(0,Bc.default)("DraggableCore: handleDragStart: %j",l),(0,Bc.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,Hn.addUserSelectStyles)(r),this.dragging=!0,this.lastX=s,this.lastY=a,(0,Hn.addEvent)(r,zo.move,this.handleDrag),(0,Hn.addEvent)(r,zo.stop,this.handleDragStop))}),Jn(this,"handleDrag",t=>{const n=(0,jo.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:i}=n;if(Array.isArray(this.props.grid)){let a=r-this.lastX,l=i-this.lastY;if([a,l]=(0,jo.snapToGrid)(this.props.grid,a,l),!a&&!l)return;r=this.lastX+a,i=this.lastY+l}const o=(0,jo.createCoreData)(this,r,i);if((0,Bc.default)("DraggableCore: handleDrag: %j",o),this.props.onDrag(t,o)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const l=document.createEvent("MouseEvents");l.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(l)}return}this.lastX=r,this.lastY=i}),Jn(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,jo.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:i}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX||0,c=i-this.lastY||0;[l,c]=(0,jo.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,i=this.lastY+c}const o=(0,jo.createCoreData)(this,r,i);if(this.props.onStop(t,o)===!1||this.mounted===!1)return!1;const a=this.findDOMNode();a&&this.props.enableUserSelectHack&&(0,Hn.removeUserSelectStyles)(a.ownerDocument),(0,Bc.default)("DraggableCore: handleDragStop: %j",o),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&((0,Bc.default)("DraggableCore: Removing handlers"),(0,Hn.removeEvent)(a.ownerDocument,zo.move,this.handleDrag),(0,Hn.removeEvent)(a.ownerDocument,zo.stop,this.handleDragStop))}),Jn(this,"onMouseDown",t=>(zo=gi.mouse,this.handleDragStart(t))),Jn(this,"onMouseUp",t=>(zo=gi.mouse,this.handleDragStop(t))),Jn(this,"onTouchStart",t=>(zo=gi.touch,this.handleDragStart(t))),Jn(this,"onTouchEnd",t=>(zo=gi.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,Hn.addEvent)(t,gi.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,Hn.removeEvent)(n,gi.mouse.move,this.handleDrag),(0,Hn.removeEvent)(n,gi.touch.move,this.handleDrag),(0,Hn.removeEvent)(n,gi.mouse.stop,this.handleDragStop),(0,Hn.removeEvent)(n,gi.touch.stop,this.handleDragStop),(0,Hn.removeEvent)(t,gi.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,Hn.removeUserSelectStyles)(n)}}findDOMNode(){var t,n;return(t=this.props)!==null&&t!==void 0&&t.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:N7.default.findDOMNode(this)}render(){return iv.cloneElement(iv.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};xf.default=_f,Jn(_f,"displayName","DraggableCore"),Jn(_f,"propTypes",{allowAnyClick:sr.default.bool,children:sr.default.node.isRequired,disabled:sr.default.bool,enableUserSelectHack:sr.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:sr.default.arrayOf(sr.default.number),handle:sr.default.string,cancel:sr.default.string,nodeRef:sr.default.object,onStart:sr.default.func,onDrag:sr.default.func,onStop:sr.default.func,onMouseDown:sr.default.func,scale:sr.default.number,className:ov.dontSetMe,style:ov.dontSetMe,transform:ov.dontSetMe}),Jn(_f,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),e.default=void 0;var t=g(m),n=d(Fo),r=d(kt),i=d(n7),o=ln,s=Di,a=Mi,l=d(xf),c=d(wf);function d(S){return S&&S.__esModule?S:{default:S}}function f(S){if(typeof WeakMap!="function")return null;var C=new WeakMap,P=new WeakMap;return(f=function(O){return O?P:C})(S)}function g(S,C){if(!C&&S&&S.__esModule)return S;if(S===null||typeof S!="object"&&typeof S!="function")return{default:S};var P=f(C);if(P&&P.has(S))return P.get(S);var O={},k=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var A in S)if(A!=="default"&&Object.prototype.hasOwnProperty.call(S,A)){var L=k?Object.getOwnPropertyDescriptor(S,A):null;L&&(L.get||L.set)?Object.defineProperty(O,A,L):O[A]=S[A]}return O.default=S,P&&P.set(S,O),O}function p(){return p=Object.assign?Object.assign.bind():function(S){for(var C=1;C<arguments.length;C++){var P=arguments[C];for(var O in P)Object.prototype.hasOwnProperty.call(P,O)&&(S[O]=P[O])}return S},p.apply(this,arguments)}function v(S,C,P){return C=y(C),C in S?Object.defineProperty(S,C,{value:P,enumerable:!0,configurable:!0,writable:!0}):S[C]=P,S}function y(S){var C=x(S,"string");return typeof C=="symbol"?C:String(C)}function x(S,C){if(typeof S!="object"||S===null)return S;var P=S[Symbol.toPrimitive];if(P!==void 0){var O=P.call(S,C||"default");if(typeof O!="object")return O;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(S)}class w extends t.Component{static getDerivedStateFromProps(C,P){let{position:O}=C,{prevPropsPosition:k}=P;return O&&(!k||O.x!==k.x||O.y!==k.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:O,prevPropsPosition:k}),{x:O.x,y:O.y,prevPropsPosition:{...O}}):null}constructor(C){super(C),v(this,"onDragStart",(P,O)=>{if((0,c.default)("Draggable: onDragStart: %j",O),this.props.onStart(P,(0,s.createDraggableData)(this,O))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),v(this,"onDrag",(P,O)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",O);const k=(0,s.createDraggableData)(this,O),A={x:k.x,y:k.y,slackX:0,slackY:0};if(this.props.bounds){const{x:F,y:j}=A;A.x+=this.state.slackX,A.y+=this.state.slackY;const[B,V]=(0,s.getBoundPosition)(this,A.x,A.y);A.x=B,A.y=V,A.slackX=this.state.slackX+(F-A.x),A.slackY=this.state.slackY+(j-A.y),k.x=A.x,k.y=A.y,k.deltaX=A.x-this.state.x,k.deltaY=A.y-this.state.y}if(this.props.onDrag(P,k)===!1)return!1;this.setState(A)}),v(this,"onDragStop",(P,O)=>{if(!this.state.dragging||this.props.onStop(P,(0,s.createDraggableData)(this,O))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",O);const A={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:F,y:j}=this.props.position;A.x=F,A.y=j}this.setState(A)}),this.state={dragging:!1,dragged:!1,x:C.position?C.position.x:C.defaultPosition.x,y:C.position?C.position.y:C.defaultPosition.y,prevPropsPosition:{...C.position},slackX:0,slackY:0,isElementSVG:!1},C.position&&!(C.onDrag||C.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var C,P;return(C=(P=this.props)===null||P===void 0||(P=P.nodeRef)===null||P===void 0?void 0:P.current)!==null&&C!==void 0?C:r.default.findDOMNode(this)}render(){const{axis:C,bounds:P,children:O,defaultPosition:k,defaultClassName:A,defaultClassNameDragging:L,defaultClassNameDragged:F,position:j,positionOffset:B,scale:V,...K}=this.props;let Y={},$=null;const U=!!!j||this.state.dragging,ie=j||k,le={x:(0,s.canDragX)(this)&&U?this.state.x:ie.x,y:(0,s.canDragY)(this)&&U?this.state.y:ie.y};this.state.isElementSVG?$=(0,o.createSVGTransform)(le,B):Y=(0,o.createCSSTransform)(le,B);const M=(0,i.default)(O.props.className||"",A,{[L]:this.state.dragging,[F]:this.state.dragged});return t.createElement(l.default,p({},K,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(O),{className:M,style:{...O.props.style,...Y},transform:$}))}}e.default=w,v(w,"displayName","Draggable"),v(w,"propTypes",{...l.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:a.dontSetMe,style:a.dontSetMe,transform:a.dontSetMe}),v(w,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(A_);const{default:H_,DraggableCore:F7}=A_;bf.exports=H_,bf.exports.default=H_,bf.exports.DraggableCore=F7;var W_=bf.exports,Sf={exports:{}},Vc={},av={};av.__esModule=!0,av.cloneElement=W7;var j7=z7(m);function z7(e){return e&&e.__esModule?e:{default:e}}function q_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function U_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?q_(Object(n),!0).forEach(function(r){B7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function B7(e,t,n){return t=V7(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function V7(e){var t=H7(e,"string");return typeof t=="symbol"?t:String(t)}function H7(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function W7(e,t){return t.style&&e.props.style&&(t.style=U_(U_({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),j7.default.cloneElement(e,t)}var Hc={};Hc.__esModule=!0,Hc.resizableProps=void 0;var it=q7(Fo);function q7(e){return e&&e.__esModule?e:{default:e}}var U7={axis:it.default.oneOf(["both","x","y","none"]),className:it.default.string,children:it.default.element.isRequired,draggableOpts:it.default.shape({allowAnyClick:it.default.bool,cancel:it.default.string,children:it.default.node,disabled:it.default.bool,enableUserSelectHack:it.default.bool,offsetParent:it.default.node,grid:it.default.arrayOf(it.default.number),handle:it.default.string,nodeRef:it.default.object,onStart:it.default.func,onDrag:it.default.func,onStop:it.default.func,onMouseDown:it.default.func,scale:it.default.number}),height:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0];if(i.axis==="both"||i.axis==="y"){var o;return(o=it.default.number).isRequired.apply(o,n)}return it.default.number.apply(it.default,n)},handle:it.default.oneOfType([it.default.node,it.default.func]),handleSize:it.default.arrayOf(it.default.number),lockAspectRatio:it.default.bool,maxConstraints:it.default.arrayOf(it.default.number),minConstraints:it.default.arrayOf(it.default.number),onResizeStop:it.default.func,onResizeStart:it.default.func,onResize:it.default.func,resizeHandles:it.default.arrayOf(it.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:it.default.number,width:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0];if(i.axis==="both"||i.axis==="x"){var o;return(o=it.default.number).isRequired.apply(o,n)}return it.default.number.apply(it.default,n)}};Hc.resizableProps=U7,Vc.__esModule=!0,Vc.default=void 0;var Wc=Q7(m),G7=W_,Y7=av,K7=Hc,X7=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function G_(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(G_=function(i){return i?n:t})(e)}function Q7(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=G_(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function lv(){return lv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lv.apply(this,arguments)}function J7(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function Y_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function cv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Y_(Object(n),!0).forEach(function(r){Z7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Y_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Z7(e,t,n){return t=e4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function e4(e){var t=t4(e,"string");return typeof t=="symbol"?t:String(t)}function t4(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function n4(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,uv(e,t)}function uv(e,t){return uv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},uv(e,t)}var dv=function(e){n4(t,e);function t(){for(var r,i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r=e.call.apply(e,[this].concat(o))||this,r.handleRefs={},r.lastHandleRect=null,r.slack=null,r}var n=t.prototype;return n.componentWillUnmount=function(){this.resetData()},n.resetData=function(){this.lastHandleRect=this.slack=null},n.runConstraints=function(i,o){var s=this.props,a=s.minConstraints,l=s.maxConstraints,c=s.lockAspectRatio;if(!a&&!l&&!c)return[i,o];if(c){var d=this.props.width/this.props.height,f=i-this.props.width,g=o-this.props.height;Math.abs(f)>Math.abs(g*d)?o=i/d:i=o*d}var p=i,v=o,y=this.slack||[0,0],x=y[0],w=y[1];return i+=x,o+=w,a&&(i=Math.max(a[0],i),o=Math.max(a[1],o)),l&&(i=Math.min(l[0],i),o=Math.min(l[1],o)),this.slack=[x+(p-i),w+(v-o)],[i,o]},n.resizeHandler=function(i,o){var s=this;return function(a,l){var c=l.node,d=l.deltaX,f=l.deltaY;i==="onResizeStart"&&s.resetData();var g=(s.props.axis==="both"||s.props.axis==="x")&&o!=="n"&&o!=="s",p=(s.props.axis==="both"||s.props.axis==="y")&&o!=="e"&&o!=="w";if(!(!g&&!p)){var v=o[0],y=o[o.length-1],x=c.getBoundingClientRect();if(s.lastHandleRect!=null){if(y==="w"){var w=x.left-s.lastHandleRect.left;d+=w}if(v==="n"){var S=x.top-s.lastHandleRect.top;f+=S}}s.lastHandleRect=x,y==="w"&&(d=-d),v==="n"&&(f=-f);var C=s.props.width+(g?d/s.props.transformScale:0),P=s.props.height+(p?f/s.props.transformScale:0),O=s.runConstraints(C,P);C=O[0],P=O[1];var k=C!==s.props.width||P!==s.props.height,A=typeof s.props[i]=="function"?s.props[i]:null,L=i==="onResize"&&!k;A&&!L&&(a.persist==null||a.persist(),A(a,{node:c,size:{width:C,height:P},handle:o})),i==="onResizeStop"&&s.resetData()}}},n.renderResizeHandle=function(i,o){var s=this.props.handle;if(!s)return Wc.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+i,ref:o});if(typeof s=="function")return s(i,o);var a=typeof s.type=="string",l=cv({ref:o},a?{}:{handleAxis:i});return Wc.cloneElement(s,l)},n.render=function(){var i=this,o=this.props,s=o.children,a=o.className,l=o.draggableOpts;o.width,o.height,o.handle,o.handleSize,o.lockAspectRatio,o.axis,o.minConstraints,o.maxConstraints,o.onResize,o.onResizeStop,o.onResizeStart;var c=o.resizeHandles;o.transformScale;var d=J7(o,X7);return(0,Y7.cloneElement)(s,cv(cv({},d),{},{className:(a?a+" ":"")+"react-resizable",children:[].concat(s.props.children,c.map(function(f){var g,p=(g=i.handleRefs[f])!=null?g:i.handleRefs[f]=Wc.createRef();return Wc.createElement(G7.DraggableCore,lv({},l,{nodeRef:p,key:"resizableHandle-"+f,onStop:i.resizeHandler("onResizeStop",f),onStart:i.resizeHandler("onResizeStart",f),onDrag:i.resizeHandler("onResize",f)}),i.renderResizeHandle(f,p))}))}))},t}(Wc.Component);Vc.default=dv,dv.propTypes=K7.resizableProps,dv.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var Cf={};Cf.__esModule=!0,Cf.default=void 0;var fv=a4(m),r4=K_(Fo),i4=K_(Vc),o4=Hc,s4=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function K_(e){return e&&e.__esModule?e:{default:e}}function X_(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(X_=function(i){return i?n:t})(e)}function a4(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=X_(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function hv(){return hv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hv.apply(this,arguments)}function Q_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ef(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Q_(Object(n),!0).forEach(function(r){l4(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Q_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function l4(e,t,n){return t=c4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c4(e){var t=u4(e,"string");return typeof t=="symbol"?t:String(t)}function u4(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function d4(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function f4(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,pv(e,t)}function pv(e,t){return pv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},pv(e,t)}var J_=function(e){f4(t,e);function t(){for(var r,i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r=e.call.apply(e,[this].concat(o))||this,r.state={width:r.props.width,height:r.props.height,propsWidth:r.props.width,propsHeight:r.props.height},r.onResize=function(a,l){var c=l.size;r.props.onResize?(a.persist==null||a.persist(),r.setState(c,function(){return r.props.onResize&&r.props.onResize(a,l)})):r.setState(c)},r}t.getDerivedStateFromProps=function(i,o){return o.propsWidth!==i.width||o.propsHeight!==i.height?{width:i.width,height:i.height,propsWidth:i.width,propsHeight:i.height}:null};var n=t.prototype;return n.render=function(){var i=this.props,o=i.handle,s=i.handleSize;i.onResize;var a=i.onResizeStart,l=i.onResizeStop,c=i.draggableOpts,d=i.minConstraints,f=i.maxConstraints,g=i.lockAspectRatio,p=i.axis;i.width,i.height;var v=i.resizeHandles,y=i.style,x=i.transformScale,w=d4(i,s4);return fv.createElement(i4.default,{axis:p,draggableOpts:c,handle:o,handleSize:s,height:this.state.height,lockAspectRatio:g,maxConstraints:f,minConstraints:d,onResizeStart:a,onResize:this.onResize,onResizeStop:l,resizeHandles:v,transformScale:x,width:this.state.width},fv.createElement("div",hv({},w,{style:Ef(Ef({},y),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(fv.Component);Cf.default=J_,J_.propTypes=Ef(Ef({},o4.resizableProps),{},{children:r4.default.element}),Sf.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},Sf.exports.Resizable=Vc.default,Sf.exports.ResizableBox=Cf.default;var h4=Sf.exports,ro={};Object.defineProperty(ro,"__esModule",{value:!0}),ro.resizeHandleType=ro.resizeHandleAxesType=ro.default=void 0;var dt=Z_(Fo),p4=Z_(m);function Z_(e){return e&&e.__esModule?e:{default:e}}const eS=dt.default.arrayOf(dt.default.oneOf(["s","w","e","n","sw","nw","se","ne"]));ro.resizeHandleAxesType=eS;const tS=dt.default.oneOfType([dt.default.node,dt.default.func]);ro.resizeHandleType=tS;var g4={className:dt.default.string,style:dt.default.object,width:dt.default.number,autoSize:dt.default.bool,cols:dt.default.number,draggableCancel:dt.default.string,draggableHandle:dt.default.string,verticalCompact:function(e){e.verticalCompact===!1&&process.env.NODE_ENV!=="production"&&console.warn('`verticalCompact` on <ReactGridLayout> is deprecated and will be removed soon. Use `compactType`: "horizontal" | "vertical" | null.')},compactType:dt.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&pt.validateLayout(t,"layout")},margin:dt.default.arrayOf(dt.default.number),containerPadding:dt.default.arrayOf(dt.default.number),rowHeight:dt.default.number,maxRows:dt.default.number,isBounded:dt.default.bool,isDraggable:dt.default.bool,isResizable:dt.default.bool,allowOverlap:dt.default.bool,preventCollision:dt.default.bool,useCSSTransforms:dt.default.bool,transformScale:dt.default.number,isDroppable:dt.default.bool,resizeHandles:eS,resizeHandle:tS,onLayoutChange:dt.default.func,onDragStart:dt.default.func,onDrag:dt.default.func,onDragStop:dt.default.func,onResizeStart:dt.default.func,onResize:dt.default.func,onResizeStop:dt.default.func,onDrop:dt.default.func,droppingItem:dt.default.shape({i:dt.default.string.isRequired,w:dt.default.number.isRequired,h:dt.default.number.isRequired}),children:function(e,t){const n=e[t],r={};p4.default.Children.forEach(n,function(i){if((i==null?void 0:i.key)!=null){if(r[i.key])throw new Error('Duplicate child key "'+i.key+'" found! This will cause problems in ReactGridLayout.');r[i.key]=!0}})},innerRef:dt.default.any};ro.default=g4,Object.defineProperty(mf,"__esModule",{value:!0}),mf.default=void 0;var al=gv(m),Mt=gv(Fo),m4=W_,v4=h4,ll=pt,Nn=ki,nS=ro,b4=gv(Nm);function gv(e){return e&&e.__esModule?e:{default:e}}function Ti(e,t,n){return t=y4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y4(e){var t=x4(e,"string");return typeof t=="symbol"?t:String(t)}function x4(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class mv extends al.default.Component{constructor(){super(...arguments),Ti(this,"state",{resizing:null,dragging:null,className:""}),Ti(this,"elementRef",al.default.createRef()),Ti(this,"onDragStart",(t,n)=>{let{node:r}=n;const{onDragStart:i,transformScale:o}=this.props;if(!i)return;const s={top:0,left:0},{offsetParent:a}=r;if(!a)return;const l=a.getBoundingClientRect(),c=r.getBoundingClientRect(),d=c.left/o,f=l.left/o,g=c.top/o,p=l.top/o;s.left=d-f+a.scrollLeft,s.top=g-p+a.scrollTop,this.setState({dragging:s});const{x:v,y}=(0,Nn.calcXY)(this.getPositionParams(),s.top,s.left,this.props.w,this.props.h);return i.call(this,this.props.i,v,y,{e:t,node:r,newPosition:s})}),Ti(this,"onDrag",(t,n)=>{let{node:r,deltaX:i,deltaY:o}=n;const{onDrag:s}=this.props;if(!s)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let a=this.state.dragging.top+o,l=this.state.dragging.left+i;const{isBounded:c,i:d,w:f,h:g,containerWidth:p}=this.props,v=this.getPositionParams();if(c){const{offsetParent:S}=r;if(S){const{margin:C,rowHeight:P}=this.props,O=S.clientHeight-(0,Nn.calcGridItemWHPx)(g,P,C[1]);a=(0,Nn.clamp)(a,0,O);const k=(0,Nn.calcGridColWidth)(v),A=p-(0,Nn.calcGridItemWHPx)(f,k,C[0]);l=(0,Nn.clamp)(l,0,A)}}const y={top:a,left:l};this.setState({dragging:y});const{x,y:w}=(0,Nn.calcXY)(v,a,l,f,g);return s.call(this,d,x,w,{e:t,node:r,newPosition:y})}),Ti(this,"onDragStop",(t,n)=>{let{node:r}=n;const{onDragStop:i}=this.props;if(!i)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:o,h:s,i:a}=this.props,{left:l,top:c}=this.state.dragging,d={top:c,left:l};this.setState({dragging:null});const{x:f,y:g}=(0,Nn.calcXY)(this.getPositionParams(),c,l,o,s);return i.call(this,a,f,g,{e:t,node:r,newPosition:d})}),Ti(this,"onResizeStop",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStop")),Ti(this,"onResizeStart",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStart")),Ti(this,"onResize",(t,n,r)=>this.onResizeHandler(t,n,r,"onResize"))}shouldComponentUpdate(t,n){if(this.props.children!==t.children||this.props.droppingPosition!==t.droppingPosition)return!0;const r=(0,Nn.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),i=(0,Nn.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,n);return!(0,ll.fastPositionEqual)(r,i)||this.props.useCSSTransforms!==t.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(t){this.moveDroppingItem(t)}moveDroppingItem(t){const{droppingPosition:n}=this.props;if(!n)return;const r=this.elementRef.current;if(!r)return;const i=t.droppingPosition||{left:0,top:0},{dragging:o}=this.state,s=o&&n.left!==i.left||n.top!==i.top;if(!o)this.onDragStart(n.e,{node:r,deltaX:n.left,deltaY:n.top});else if(s){const a=n.left-o.left,l=n.top-o.top;this.onDrag(n.e,{node:r,deltaX:a,deltaY:l})}}getPositionParams(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:t.cols,containerPadding:t.containerPadding,containerWidth:t.containerWidth,margin:t.margin,maxRows:t.maxRows,rowHeight:t.rowHeight}}createStyle(t){const{usePercentages:n,containerWidth:r,useCSSTransforms:i}=this.props;let o;return i?o=(0,ll.setTransform)(t):(o=(0,ll.setTopLeft)(t),n&&(o.left=(0,ll.perc)(t.left/r),o.width=(0,ll.perc)(t.width/r))),o}mixinDraggable(t,n){return al.default.createElement(m4.DraggableCore,{disabled:!n,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},t)}curryResizeHandler(t,n){return(r,i)=>n(r,i,t)}mixinResizable(t,n,r){const{cols:i,minW:o,minH:s,maxW:a,maxH:l,transformScale:c,resizeHandles:d,resizeHandle:f}=this.props,g=this.getPositionParams(),p=(0,Nn.calcGridItemPosition)(g,0,0,i,0).width,v=(0,Nn.calcGridItemPosition)(g,0,0,o,s),y=(0,Nn.calcGridItemPosition)(g,0,0,a,l),x=[v.width,v.height],w=[Math.min(y.width,p),Math.min(y.height,1/0)];return al.default.createElement(v4.Resizable,{draggableOpts:{disabled:!r},className:r?void 0:"react-resizable-hide",width:n.width,height:n.height,minConstraints:x,maxConstraints:w,onResizeStop:this.curryResizeHandler(n,this.onResizeStop),onResizeStart:this.curryResizeHandler(n,this.onResizeStart),onResize:this.curryResizeHandler(n,this.onResize),transformScale:c,resizeHandles:d,handle:f},t)}onResizeHandler(t,n,r,i){let{node:o,size:s,handle:a}=n;const l=this.props[i];if(!l)return;const{x:c,y:d,i:f,maxH:g,minH:p,containerWidth:v}=this.props,{minW:y,maxW:x}=this.props;let w=s;o&&(w=(0,ll.resizeItemInDirection)(a,r,s,v),this.setState({resizing:i==="onResizeStop"?null:w}));let{w:S,h:C}=(0,Nn.calcWH)(this.getPositionParams(),w.width,w.height,c,d,a);S=(0,Nn.clamp)(S,Math.max(y,1),x),C=(0,Nn.clamp)(C,p,g),l.call(this,f,S,C,{e:t,node:o,size:w,handle:a})}render(){const{x:t,y:n,w:r,h:i,isDraggable:o,isResizable:s,droppingPosition:a,useCSSTransforms:l}=this.props,c=(0,Nn.calcGridItemPosition)(this.getPositionParams(),t,n,r,i,this.state),d=al.default.Children.only(this.props.children);let f=al.default.cloneElement(d,{ref:this.elementRef,className:(0,b4.default)("react-grid-item",d.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":o,"react-draggable-dragging":!!this.state.dragging,dropping:!!a,cssTransforms:l}),style:{...this.props.style,...d.props.style,...this.createStyle(c)}});return f=this.mixinResizable(f,c,s),f=this.mixinDraggable(f,o),f}}mf.default=mv,Ti(mv,"propTypes",{children:Mt.default.element,cols:Mt.default.number.isRequired,containerWidth:Mt.default.number.isRequired,rowHeight:Mt.default.number.isRequired,margin:Mt.default.array.isRequired,maxRows:Mt.default.number.isRequired,containerPadding:Mt.default.array.isRequired,x:Mt.default.number.isRequired,y:Mt.default.number.isRequired,w:Mt.default.number.isRequired,h:Mt.default.number.isRequired,minW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minWidth not Number");if(n>e.w||n>e.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxWidth not Number");if(n<e.w||n<e.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minHeight not Number");if(n>e.h||n>e.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxHeight not Number");if(n<e.h||n<e.minH)return new Error("maxHeight smaller than item height/minHeight")},i:Mt.default.string.isRequired,resizeHandles:nS.resizeHandleAxesType,resizeHandle:nS.resizeHandleType,onDragStop:Mt.default.func,onDragStart:Mt.default.func,onDrag:Mt.default.func,onResizeStop:Mt.default.func,onResizeStart:Mt.default.func,onResize:Mt.default.func,isDraggable:Mt.default.bool.isRequired,isResizable:Mt.default.bool.isRequired,isBounded:Mt.default.bool.isRequired,static:Mt.default.bool,useCSSTransforms:Mt.default.bool.isRequired,transformScale:Mt.default.number,className:Mt.default.string,handle:Mt.default.string,cancel:Mt.default.string,droppingPosition:Mt.default.shape({e:Mt.default.object.isRequired,left:Mt.default.number.isRequired,top:Mt.default.number.isRequired})}),Ti(mv,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),Object.defineProperty(Fc,"__esModule",{value:!0}),Fc.default=void 0;var Hs=C4(m),vv=Im,w4=bv(Nm),Ye=pt,_4=ki,rS=bv(mf),S4=bv(ro);function bv(e){return e&&e.__esModule?e:{default:e}}function iS(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(iS=function(r){return r?n:t})(e)}function C4(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=iS(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function Wn(e,t,n){return t=E4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E4(e){var t=O4(e,"string");return typeof t=="symbol"?t:String(t)}function O4(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const oS="react-grid-layout";let sS=!1;try{sS=/firefox/i.test(navigator.userAgent)}catch{}class Of extends Hs.Component{constructor(){super(...arguments),Wn(this,"state",{activeDrag:null,layout:(0,Ye.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,Ye.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),Wn(this,"dragEnterCounter",0),Wn(this,"onDragStart",(t,n,r,i)=>{let{e:o,node:s}=i;const{layout:a}=this.state,l=(0,Ye.getLayoutItem)(a,t);if(l)return this.setState({oldDragItem:(0,Ye.cloneLayoutItem)(l),oldLayout:a}),this.props.onDragStart(a,l,l,null,o,s)}),Wn(this,"onDrag",(t,n,r,i)=>{let{e:o,node:s}=i;const{oldDragItem:a}=this.state;let{layout:l}=this.state;const{cols:c,allowOverlap:d,preventCollision:f}=this.props,g=(0,Ye.getLayoutItem)(l,t);if(!g)return;const p={w:g.w,h:g.h,x:g.x,y:g.y,placeholder:!0,i:t},v=!0;l=(0,Ye.moveElement)(l,g,n,r,v,f,(0,Ye.compactType)(this.props),c,d),this.props.onDrag(l,a,g,p,o,s),this.setState({layout:d?l:(0,Ye.compact)(l,(0,Ye.compactType)(this.props),c),activeDrag:p})}),Wn(this,"onDragStop",(t,n,r,i)=>{let{e:o,node:s}=i;if(!this.state.activeDrag)return;const{oldDragItem:a}=this.state;let{layout:l}=this.state;const{cols:c,preventCollision:d,allowOverlap:f}=this.props,g=(0,Ye.getLayoutItem)(l,t);if(!g)return;const p=!0;l=(0,Ye.moveElement)(l,g,n,r,p,d,(0,Ye.compactType)(this.props),c,f);const v=f?l:(0,Ye.compact)(l,(0,Ye.compactType)(this.props),c);this.props.onDragStop(v,a,g,null,o,s);const{oldLayout:y}=this.state;this.setState({activeDrag:null,layout:v,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(v,y)}),Wn(this,"onResizeStart",(t,n,r,i)=>{let{e:o,node:s}=i;const{layout:a}=this.state,l=(0,Ye.getLayoutItem)(a,t);l&&(this.setState({oldResizeItem:(0,Ye.cloneLayoutItem)(l),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(a,l,l,null,o,s))}),Wn(this,"onResize",(t,n,r,i)=>{let{e:o,node:s,size:a,handle:l}=i;const{oldResizeItem:c}=this.state;let{layout:d}=this.state;const{cols:f,preventCollision:g,allowOverlap:p}=this.props;let v=!1,y,x,w;const[S,C]=(0,Ye.withLayoutItem)(d,t,O=>{let k;return x=O.x,w=O.y,["sw","w","nw","n","ne"].indexOf(l)!==-1&&(["sw","nw","w"].indexOf(l)!==-1&&(x=O.x+(O.w-n),n=O.x!==x&&x<0?O.w:n,x=x<0?0:x),["ne","n","nw"].indexOf(l)!==-1&&(w=O.y+(O.h-r),r=O.y!==w&&w<0?O.h:r,w=w<0?0:w),v=!0),g&&!p&&(k=(0,Ye.getAllCollisions)(d,{...O,w:n,h:r,x,y:w}).filter(L=>L.i!==O.i).length>0,k&&(w=O.y,r=O.h,x=O.x,n=O.w,v=!1)),O.w=n,O.h=r,O});if(!C)return;y=S,v&&(y=(0,Ye.moveElement)(S,C,x,w,!0,this.props.preventCollision,(0,Ye.compactType)(this.props),f,p));const P={w:C.w,h:C.h,x:C.x,y:C.y,static:!0,i:t};this.props.onResize(y,c,C,P,o,s),this.setState({layout:p?y:(0,Ye.compact)(y,(0,Ye.compactType)(this.props),f),activeDrag:P})}),Wn(this,"onResizeStop",(t,n,r,i)=>{let{e:o,node:s}=i;const{layout:a,oldResizeItem:l}=this.state,{cols:c,allowOverlap:d}=this.props,f=(0,Ye.getLayoutItem)(a,t),g=d?a:(0,Ye.compact)(a,(0,Ye.compactType)(this.props),c);this.props.onResizeStop(g,l,f,null,o,s);const{oldLayout:p}=this.state;this.setState({activeDrag:null,layout:g,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(g,p)}),Wn(this,"onDragOver",t=>{var n;if(t.preventDefault(),t.stopPropagation(),sS&&!((n=t.nativeEvent.target)!==null&&n!==void 0&&n.classList.contains(oS)))return!1;const{droppingItem:r,onDropDragOver:i,margin:o,cols:s,rowHeight:a,maxRows:l,width:c,containerPadding:d,transformScale:f}=this.props,g=i==null?void 0:i(t);if(g===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const p={...r,...g},{layout:v}=this.state,{layerX:y,layerY:x}=t.nativeEvent,w={left:y/f,top:x/f,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:S,top:C}=this.state.droppingPosition;(S!=y||C!=x)&&this.setState({droppingPosition:w})}}else{const S={cols:s,margin:o,maxRows:l,rowHeight:a,containerWidth:c,containerPadding:d||o},C=(0,_4.calcXY)(S,x,y,p.w,p.h);this.setState({droppingDOMNode:Hs.createElement("div",{key:p.i}),droppingPosition:w,layout:[...v,{...p,x:C.x,y:C.y,static:!1,isDraggable:!0}]})}}),Wn(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:n}=this.props,{layout:r}=this.state,i=(0,Ye.compact)(r.filter(o=>o.i!==t.i),(0,Ye.compactType)(this.props),n,this.props.allowOverlap);this.setState({layout:i,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),Wn(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),Wn(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),Wn(this,"onDrop",t=>{t.preventDefault(),t.stopPropagation();const{droppingItem:n}=this.props,{layout:r}=this.state,i=r.find(o=>o.i===n.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(r,i,t)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(t,n){let r;return n.activeDrag?null:(!(0,vv.deepEqual)(t.layout,n.propsLayout)||t.compactType!==n.compactType?r=t.layout:(0,Ye.childrenEqual)(t.children,n.children)||(r=n.layout),r?{layout:(0,Ye.synchronizeLayoutWithChildren)(r,t.children,t.cols,(0,Ye.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,n){return this.props.children!==t.children||!(0,Ye.fastRGLPropsEqual)(this.props,t,vv.deepEqual)||this.state.activeDrag!==n.activeDrag||this.state.mounted!==n.mounted||this.state.droppingPosition!==n.droppingPosition}componentDidUpdate(t,n){if(!this.state.activeDrag){const r=this.state.layout,i=n.layout;this.onLayoutMaybeChanged(r,i)}}containerHeight(){if(!this.props.autoSize)return;const t=(0,Ye.bottom)(this.state.layout),n=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return t*this.props.rowHeight+(t-1)*this.props.margin[1]+n*2+"px"}onLayoutMaybeChanged(t,n){n||(n=this.state.layout),(0,vv.deepEqual)(n,t)||this.props.onLayoutChange(t)}placeholder(){const{activeDrag:t}=this.state;if(!t)return null;const{width:n,cols:r,margin:i,containerPadding:o,rowHeight:s,maxRows:a,useCSSTransforms:l,transformScale:c}=this.props;return Hs.createElement(rS.default,{w:t.w,h:t.h,x:t.x,y:t.y,i:t.i,className:"react-grid-placeholder ".concat(this.state.resizing?"placeholder-resizing":""),containerWidth:n,cols:r,margin:i,containerPadding:o||i,maxRows:a,rowHeight:s,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:l,transformScale:c},Hs.createElement("div",null))}processGridItem(t,n){if(!t||!t.key)return;const r=(0,Ye.getLayoutItem)(this.state.layout,String(t.key));if(!r)return null;const{width:i,cols:o,margin:s,containerPadding:a,rowHeight:l,maxRows:c,isDraggable:d,isResizable:f,isBounded:g,useCSSTransforms:p,transformScale:v,draggableCancel:y,draggableHandle:x,resizeHandles:w,resizeHandle:S}=this.props,{mounted:C,droppingPosition:P}=this.state,O=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&d,k=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&f,A=r.resizeHandles||w,L=O&&g&&r.isBounded!==!1;return Hs.createElement(rS.default,{containerWidth:i,cols:o,margin:s,containerPadding:a||s,maxRows:c,rowHeight:l,cancel:y,handle:x,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:O,isResizable:k,isBounded:L,useCSSTransforms:p&&C,usePercentages:!C,transformScale:v,w:r.w,h:r.h,x:r.x,y:r.y,i:r.i,minH:r.minH,minW:r.minW,maxH:r.maxH,maxW:r.maxW,static:r.static,droppingPosition:n?P:void 0,resizeHandles:A,resizeHandle:S},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:i}=this.props,o=(0,w4.default)(oS,t),s={height:this.containerHeight(),...n};return Hs.createElement("div",{ref:i,className:o,style:s,onDrop:r?this.onDrop:Ye.noop,onDragLeave:r?this.onDragLeave:Ye.noop,onDragEnter:r?this.onDragEnter:Ye.noop,onDragOver:r?this.onDragOver:Ye.noop},Hs.Children.map(this.props.children,a=>this.processGridItem(a)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}Fc.default=Of,Wn(Of,"displayName","ReactGridLayout"),Wn(Of,"propTypes",S4.default),Wn(Of,"defaultProps",{autoSize:!0,cols:12,className:"",style:{},draggableHandle:"",draggableCancel:"",containerPadding:null,rowHeight:150,maxRows:1/0,layout:[],margin:[10,10],isBounded:!1,isDraggable:!0,isResizable:!0,allowOverlap:!1,isDroppable:!1,useCSSTransforms:!0,transformScale:1,verticalCompact:!0,compactType:"vertical",preventCollision:!1,droppingItem:{i:"__dropping-elem__",h:1,w:1},resizeHandles:["se"],onLayoutChange:Ye.noop,onDragStart:Ye.noop,onDrag:Ye.noop,onDragStop:Ye.noop,onResizeStart:Ye.noop,onResize:Ye.noop,onResizeStop:Ye.noop,onDrop:Ye.noop,onDropDragOver:Ye.noop});var Pf={},Ws={};Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.findOrGenerateResponsiveLayout=M4,Ws.getBreakpointFromWidth=P4,Ws.getColsFromBreakpoint=k4,Ws.sortBreakpoints=yv;var kf=pt;function P4(e,t){const n=yv(e);let r=n[0];for(let i=1,o=n.length;i<o;i++){const s=n[i];t>e[s]&&(r=s)}return r}function k4(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function M4(e,t,n,r,i,o){if(e[n])return(0,kf.cloneLayout)(e[n]);let s=e[r];const a=yv(t),l=a.slice(a.indexOf(n));for(let c=0,d=l.length;c<d;c++){const f=l[c];if(e[f]){s=e[f];break}}return s=(0,kf.cloneLayout)(s||[]),(0,kf.compact)((0,kf.correctBounds)(s,{cols:i}),o,i)}function yv(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(Pf,"__esModule",{value:!0}),Pf.default=void 0;var aS=T4(m),ar=lS(Fo),xv=Im,cl=pt,qs=Ws,D4=lS(Fc);function lS(e){return e&&e.__esModule?e:{default:e}}function cS(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(cS=function(r){return r?n:t})(e)}function T4(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=cS(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function wv(){return wv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wv.apply(this,arguments)}function Mf(e,t,n){return t=A4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function A4(e){var t=I4(e,"string");return typeof t=="symbol"?t:String(t)}function I4(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const uS=e=>Object.prototype.toString.call(e);function Df(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class _v extends aS.Component{constructor(){super(...arguments),Mf(this,"state",this.generateInitialState()),Mf(this,"onLayoutChange",t=>{this.props.onLayoutChange(t,{...this.props.layouts,[this.state.breakpoint]:t})})}generateInitialState(){const{width:t,breakpoints:n,layouts:r,cols:i}=this.props,o=(0,qs.getBreakpointFromWidth)(n,t),s=(0,qs.getColsFromBreakpoint)(o,i),a=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,qs.findOrGenerateResponsiveLayout)(r,n,o,o,s,a),breakpoint:o,cols:s}}static getDerivedStateFromProps(t,n){if(!(0,xv.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:i}=n;return{layout:(0,qs.findOrGenerateResponsiveLayout)(t.layouts,t.breakpoints,r,r,i,t.compactType),layouts:t.layouts}}return null}componentDidUpdate(t){(this.props.width!=t.width||this.props.breakpoint!==t.breakpoint||!(0,xv.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,xv.deepEqual)(this.props.cols,t.cols))&&this.onWidthChange(t)}onWidthChange(t){const{breakpoints:n,cols:r,layouts:i,compactType:o}=this.props,s=this.props.breakpoint||(0,qs.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),a=this.state.breakpoint,l=(0,qs.getColsFromBreakpoint)(s,r),c={...i};if(a!==s||t.breakpoints!==n||t.cols!==r){a in c||(c[a]=(0,cl.cloneLayout)(this.state.layout));let g=(0,qs.findOrGenerateResponsiveLayout)(c,n,s,a,l,o);g=(0,cl.synchronizeLayoutWithChildren)(g,this.props.children,l,o,this.props.allowOverlap),c[s]=g,this.props.onLayoutChange(g,c),this.props.onBreakpointChange(s,l),this.setState({breakpoint:s,layout:g,cols:l})}const d=Df(this.props.margin,s),f=Df(this.props.containerPadding,s);this.props.onWidthChange(this.props.width,d,l,f)}render(){const{breakpoint:t,breakpoints:n,cols:r,layouts:i,margin:o,containerPadding:s,onBreakpointChange:a,onLayoutChange:l,onWidthChange:c,...d}=this.props;return aS.createElement(D4.default,wv({},d,{margin:Df(o,this.state.breakpoint),containerPadding:Df(s,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}Pf.default=_v,Mf(_v,"propTypes",{breakpoint:ar.default.string,breakpoints:ar.default.object,allowOverlap:ar.default.bool,cols:ar.default.object,margin:ar.default.oneOfType([ar.default.array,ar.default.object]),containerPadding:ar.default.oneOfType([ar.default.array,ar.default.object]),layouts(e,t){if(uS(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+uS(e[t]));Object.keys(e[t]).forEach(n=>{if(!(n in e.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,cl.validateLayout)(e.layouts[n],"layouts."+n)})},width:ar.default.number.isRequired,onBreakpointChange:ar.default.func,onLayoutChange:ar.default.func,onWidthChange:ar.default.func}),Mf(_v,"defaultProps",{breakpoints:{lg:1200,md:996,sm:768,xs:480,xxs:0},cols:{lg:12,md:10,sm:6,xs:4,xxs:2},containerPadding:{lg:null,md:null,sm:null,xs:null,xxs:null},layouts:{},margin:[10,10],allowOverlap:!1,onBreakpointChange:cl.noop,onLayoutChange:cl.noop,onWidthChange:cl.noop});var Sv={},dS=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(i,o){return i[0]===n?(r=o,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),i=this.__entries__[r];return i&&i[1]},t.prototype.set=function(n,r){var i=e(this.__entries__,n);~i?this.__entries__[i][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,i=e(r,n);~i&&r.splice(i,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var i=0,o=this.__entries__;i<o.length;i++){var s=o[i];n.call(r,s[1],s[0])}},t}()}(),Cv=typeof window<"u"&&typeof document<"u"&&window.document===document,Tf=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),N4=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Tf):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),R4=2;function L4(e,t){var n=!1,r=!1,i=0;function o(){n&&(n=!1,e()),r&&a()}function s(){N4(o)}function a(){var l=Date.now();if(n){if(l-i<R4)return;r=!0}else n=!0,r=!1,setTimeout(s,t);i=l}return a}var $4=20,F4=["top","right","bottom","left","width","height","size","weight"],j4=typeof MutationObserver<"u",z4=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=L4(this.refresh.bind(this),$4)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,r=n.indexOf(t);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!Cv||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),j4?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!Cv||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,i=F4.some(function(o){return!!~r.indexOf(o)});i&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),fS=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e},ul=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||Tf},hS=If(0,0,0,0);function Af(e){return parseFloat(e)||0}function pS(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,i){var o=e["border-"+i+"-width"];return r+Af(o)},0)}function B4(e){for(var t=["top","right","bottom","left"],n={},r=0,i=t;r<i.length;r++){var o=i[r],s=e["padding-"+o];n[o]=Af(s)}return n}function V4(e){var t=e.getBBox();return If(0,0,t.width,t.height)}function H4(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return hS;var r=ul(e).getComputedStyle(e),i=B4(r),o=i.left+i.right,s=i.top+i.bottom,a=Af(r.width),l=Af(r.height);if(r.boxSizing==="border-box"&&(Math.round(a+o)!==t&&(a-=pS(r,"left","right")+o),Math.round(l+s)!==n&&(l-=pS(r,"top","bottom")+s)),!q4(e)){var c=Math.round(a+o)-t,d=Math.round(l+s)-n;Math.abs(c)!==1&&(a-=c),Math.abs(d)!==1&&(l-=d)}return If(i.left,i.top,a,l)}var W4=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof ul(e).SVGGraphicsElement}:function(e){return e instanceof ul(e).SVGElement&&typeof e.getBBox=="function"}}();function q4(e){return e===ul(e).document.documentElement}function U4(e){return Cv?W4(e)?V4(e):H4(e):hS}function G4(e){var t=e.x,n=e.y,r=e.width,i=e.height,o=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,s=Object.create(o.prototype);return fS(s,{x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:i+n,left:t}),s}function If(e,t,n,r){return{x:e,y:t,width:n,height:r}}var Y4=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=If(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=U4(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),K4=function(){function e(t,n){var r=G4(n);fS(this,{target:t,contentRect:r})}return e}(),X4=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new dS,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=r}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof ul(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new Y4(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof ul(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new K4(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),gS=typeof WeakMap<"u"?new WeakMap:new dS,mS=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=z4.getInstance(),r=new X4(t,n,this);gS.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){mS.prototype[e]=function(){var t;return(t=gS.get(this))[e].apply(t,arguments)}});var Q4=function(){return typeof Tf.ResizeObserver<"u"?Tf.ResizeObserver:mS}();const J4=Yg(Object.freeze(Object.defineProperty({__proto__:null,default:Q4},Symbol.toStringTag,{value:"Module"})));Object.defineProperty(Sv,"__esModule",{value:!0}),Sv.default=sL;var Nf=nL(m),Z4=Ev(Fo),eL=Ev(J4),tL=Ev(Nm);function Ev(e){return e&&e.__esModule?e:{default:e}}function vS(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(vS=function(r){return r?n:t})(e)}function nL(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=vS(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function Ov(){return Ov=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ov.apply(this,arguments)}function dl(e,t,n){return t=rL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rL(e){var t=iL(e,"string");return typeof t=="symbol"?t:String(t)}function iL(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const oL="react-grid-layout";function sL(e){var t;return t=class extends Nf.Component{constructor(){super(...arguments),dl(this,"state",{width:1280}),dl(this,"elementRef",Nf.createRef()),dl(this,"mounted",!1),dl(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new eL.default(i=>{if(this.elementRef.current instanceof HTMLElement){const s=i[0].contentRect.width;this.setState({width:s})}});const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.observe(r)}componentWillUnmount(){this.mounted=!1;const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.unobserve(r),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:r,...i}=this.props;return r&&!this.mounted?Nf.createElement("div",{className:(0,tL.default)(this.props.className,oL),style:this.props.style,ref:this.elementRef}):Nf.createElement(e,Ov({innerRef:this.elementRef},i,this.state))}},dl(t,"defaultProps",{measureBeforeMount:!1}),dl(t,"propTypes",{measureBeforeMount:Z4.default.bool}),t}(function(e){e.exports=Fc.default,e.exports.utils=pt,e.exports.calculateUtils=ki,e.exports.Responsive=Pf.default,e.exports.Responsive.utils=Ws,e.exports.WidthProvider=Sv.default})(a_);var bS=a_.exports;function qc({children:e,className:t,text:n,onSave:r}){const[i,o]=m.useState(!1),[s,a]=m.useState(n),l=ge(d=>d.isDashboardEditing),c=d=>{d.stopPropagation(),l&&o(!0)};return _.jsx("div",{role:"editable",onDoubleClick:c,children:i?_.jsx("input",{type:"text",className:Pe("px-2 py-1 text-sm bg-background outline-[0.5px] outline-dashed outline-primary/50 rounded-sm",t),onChange:d=>a(d.target.value),value:s,autoFocus:!0,onBlur:()=>o(!1),onKeyDown:d=>{d.key==="Enter"&&(o(!1),r(s))}}):e})}const Pv=ue.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:Pe("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Pv.displayName="Card";const kv=ue.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:Pe("flex flex-col space-y-1.5 p-6",e),...t}));kv.displayName="CardHeader";const Mv=ue.forwardRef(({className:e,...t},n)=>_.jsx("h3",{ref:n,className:Pe("text-2xl font-semibold leading-none tracking-tight",e),...t}));Mv.displayName="CardTitle";const Dv=ue.forwardRef(({className:e,...t},n)=>_.jsx("p",{ref:n,className:Pe("text-sm text-muted-foreground",e),...t}));Dv.displayName="CardDescription";const Tv=ue.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:Pe("p-6 pt-0",e),...t}));Tv.displayName="CardContent";const aL=ue.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:Pe("flex items-center p-6 pt-0",e),...t}));aL.displayName="CardFooter";/*!
|
|
106
|
+
`,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&z_(e.body,"react-draggable-transparent-selection")}function C7(e){if(e)try{if(e.body&&B_(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&t.type!=="Caret"&&t.removeAllRanges()}}catch{}}function z_(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function B_(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var Di={};Object.defineProperty(Di,"__esModule",{value:!0}),Di.canDragX=P7,Di.canDragY=k7,Di.createCoreData=D7,Di.createDraggableData=T7,Di.getBoundPosition=E7,Di.getControlPosition=M7,Di.snapToGrid=O7;var Er=Mi,sl=an;function E7(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:A7(r);const i=rv(e);if(typeof r=="string"){const{ownerDocument:o}=i,s=o.defaultView;let a;if(r==="parent"?a=i.parentNode:a=o.querySelector(r),!(a instanceof s.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=a,c=s.getComputedStyle(i),d=s.getComputedStyle(l);r={left:-i.offsetLeft+(0,Er.int)(d.paddingLeft)+(0,Er.int)(c.marginLeft),top:-i.offsetTop+(0,Er.int)(d.paddingTop)+(0,Er.int)(c.marginTop),right:(0,sl.innerWidth)(l)-(0,sl.outerWidth)(i)-i.offsetLeft+(0,Er.int)(d.paddingRight)-(0,Er.int)(c.marginRight),bottom:(0,sl.innerHeight)(l)-(0,sl.outerHeight)(i)-i.offsetTop+(0,Er.int)(d.paddingBottom)-(0,Er.int)(c.marginBottom)}}return(0,Er.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,Er.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,Er.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,Er.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function O7(e,t,n){const r=Math.round(t/e[0])*e[0],i=Math.round(n/e[1])*e[1];return[r,i]}function P7(e){return e.props.axis==="both"||e.props.axis==="x"}function k7(e){return e.props.axis==="both"||e.props.axis==="y"}function M7(e,t,n){const r=typeof t=="number"?(0,sl.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const i=rv(n),o=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return(0,sl.offsetXYFromParent)(r||e,o,n.props.scale)}function D7(e,t,n){const r=!(0,Er.isNum)(e.lastX),i=rv(e);return r?{node:i,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:i,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function T7(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function A7(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function rv(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var xf={},wf={};Object.defineProperty(wf,"__esModule",{value:!0}),wf.default=I7;function I7(){}Object.defineProperty(xf,"__esModule",{value:!0}),xf.default=void 0;var iv=R7(m),sr=sv(Fo),N7=sv(kt),Hn=an,jo=Di,ov=Mi,Bc=sv(wf);function sv(e){return e&&e.__esModule?e:{default:e}}function V_(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(V_=function(r){return r?n:t})(e)}function R7(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=V_(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function Jn(e,t,n){return t=L7(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function L7(e){var t=$7(e,"string");return typeof t=="symbol"?t:String(t)}function $7(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const gi={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let zo=gi.mouse,_f=class extends iv.Component{constructor(){super(...arguments),Jn(this,"dragging",!1),Jn(this,"lastX",NaN),Jn(this,"lastY",NaN),Jn(this,"touchIdentifier",null),Jn(this,"mounted",!1),Jn(this,"handleDragStart",t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&typeof t.button=="number"&&t.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:r}=n;if(this.props.disabled||!(t.target instanceof r.defaultView.Node)||this.props.handle&&!(0,Hn.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,Hn.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const i=(0,Hn.getTouchIdentifier)(t);this.touchIdentifier=i;const o=(0,jo.getControlPosition)(t,i,this);if(o==null)return;const{x:s,y:a}=o,l=(0,jo.createCoreData)(this,s,a);(0,Bc.default)("DraggableCore: handleDragStart: %j",l),(0,Bc.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,Hn.addUserSelectStyles)(r),this.dragging=!0,this.lastX=s,this.lastY=a,(0,Hn.addEvent)(r,zo.move,this.handleDrag),(0,Hn.addEvent)(r,zo.stop,this.handleDragStop))}),Jn(this,"handleDrag",t=>{const n=(0,jo.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:i}=n;if(Array.isArray(this.props.grid)){let a=r-this.lastX,l=i-this.lastY;if([a,l]=(0,jo.snapToGrid)(this.props.grid,a,l),!a&&!l)return;r=this.lastX+a,i=this.lastY+l}const o=(0,jo.createCoreData)(this,r,i);if((0,Bc.default)("DraggableCore: handleDrag: %j",o),this.props.onDrag(t,o)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const l=document.createEvent("MouseEvents");l.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(l)}return}this.lastX=r,this.lastY=i}),Jn(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,jo.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:i}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX||0,c=i-this.lastY||0;[l,c]=(0,jo.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,i=this.lastY+c}const o=(0,jo.createCoreData)(this,r,i);if(this.props.onStop(t,o)===!1||this.mounted===!1)return!1;const a=this.findDOMNode();a&&this.props.enableUserSelectHack&&(0,Hn.removeUserSelectStyles)(a.ownerDocument),(0,Bc.default)("DraggableCore: handleDragStop: %j",o),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&((0,Bc.default)("DraggableCore: Removing handlers"),(0,Hn.removeEvent)(a.ownerDocument,zo.move,this.handleDrag),(0,Hn.removeEvent)(a.ownerDocument,zo.stop,this.handleDragStop))}),Jn(this,"onMouseDown",t=>(zo=gi.mouse,this.handleDragStart(t))),Jn(this,"onMouseUp",t=>(zo=gi.mouse,this.handleDragStop(t))),Jn(this,"onTouchStart",t=>(zo=gi.touch,this.handleDragStart(t))),Jn(this,"onTouchEnd",t=>(zo=gi.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,Hn.addEvent)(t,gi.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,Hn.removeEvent)(n,gi.mouse.move,this.handleDrag),(0,Hn.removeEvent)(n,gi.touch.move,this.handleDrag),(0,Hn.removeEvent)(n,gi.mouse.stop,this.handleDragStop),(0,Hn.removeEvent)(n,gi.touch.stop,this.handleDragStop),(0,Hn.removeEvent)(t,gi.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,Hn.removeUserSelectStyles)(n)}}findDOMNode(){var t,n;return(t=this.props)!==null&&t!==void 0&&t.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:N7.default.findDOMNode(this)}render(){return iv.cloneElement(iv.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};xf.default=_f,Jn(_f,"displayName","DraggableCore"),Jn(_f,"propTypes",{allowAnyClick:sr.default.bool,children:sr.default.node.isRequired,disabled:sr.default.bool,enableUserSelectHack:sr.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:sr.default.arrayOf(sr.default.number),handle:sr.default.string,cancel:sr.default.string,nodeRef:sr.default.object,onStart:sr.default.func,onDrag:sr.default.func,onStop:sr.default.func,onMouseDown:sr.default.func,scale:sr.default.number,className:ov.dontSetMe,style:ov.dontSetMe,transform:ov.dontSetMe}),Jn(_f,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),e.default=void 0;var t=g(m),n=d(Fo),r=d(kt),i=d(n7),o=an,s=Di,a=Mi,l=d(xf),c=d(wf);function d(S){return S&&S.__esModule?S:{default:S}}function f(S){if(typeof WeakMap!="function")return null;var C=new WeakMap,P=new WeakMap;return(f=function(O){return O?P:C})(S)}function g(S,C){if(!C&&S&&S.__esModule)return S;if(S===null||typeof S!="object"&&typeof S!="function")return{default:S};var P=f(C);if(P&&P.has(S))return P.get(S);var O={},k=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var A in S)if(A!=="default"&&Object.prototype.hasOwnProperty.call(S,A)){var L=k?Object.getOwnPropertyDescriptor(S,A):null;L&&(L.get||L.set)?Object.defineProperty(O,A,L):O[A]=S[A]}return O.default=S,P&&P.set(S,O),O}function p(){return p=Object.assign?Object.assign.bind():function(S){for(var C=1;C<arguments.length;C++){var P=arguments[C];for(var O in P)Object.prototype.hasOwnProperty.call(P,O)&&(S[O]=P[O])}return S},p.apply(this,arguments)}function v(S,C,P){return C=y(C),C in S?Object.defineProperty(S,C,{value:P,enumerable:!0,configurable:!0,writable:!0}):S[C]=P,S}function y(S){var C=x(S,"string");return typeof C=="symbol"?C:String(C)}function x(S,C){if(typeof S!="object"||S===null)return S;var P=S[Symbol.toPrimitive];if(P!==void 0){var O=P.call(S,C||"default");if(typeof O!="object")return O;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(S)}class w extends t.Component{static getDerivedStateFromProps(C,P){let{position:O}=C,{prevPropsPosition:k}=P;return O&&(!k||O.x!==k.x||O.y!==k.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:O,prevPropsPosition:k}),{x:O.x,y:O.y,prevPropsPosition:{...O}}):null}constructor(C){super(C),v(this,"onDragStart",(P,O)=>{if((0,c.default)("Draggable: onDragStart: %j",O),this.props.onStart(P,(0,s.createDraggableData)(this,O))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),v(this,"onDrag",(P,O)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",O);const k=(0,s.createDraggableData)(this,O),A={x:k.x,y:k.y,slackX:0,slackY:0};if(this.props.bounds){const{x:F,y:j}=A;A.x+=this.state.slackX,A.y+=this.state.slackY;const[B,V]=(0,s.getBoundPosition)(this,A.x,A.y);A.x=B,A.y=V,A.slackX=this.state.slackX+(F-A.x),A.slackY=this.state.slackY+(j-A.y),k.x=A.x,k.y=A.y,k.deltaX=A.x-this.state.x,k.deltaY=A.y-this.state.y}if(this.props.onDrag(P,k)===!1)return!1;this.setState(A)}),v(this,"onDragStop",(P,O)=>{if(!this.state.dragging||this.props.onStop(P,(0,s.createDraggableData)(this,O))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",O);const A={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:F,y:j}=this.props.position;A.x=F,A.y=j}this.setState(A)}),this.state={dragging:!1,dragged:!1,x:C.position?C.position.x:C.defaultPosition.x,y:C.position?C.position.y:C.defaultPosition.y,prevPropsPosition:{...C.position},slackX:0,slackY:0,isElementSVG:!1},C.position&&!(C.onDrag||C.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var C,P;return(C=(P=this.props)===null||P===void 0||(P=P.nodeRef)===null||P===void 0?void 0:P.current)!==null&&C!==void 0?C:r.default.findDOMNode(this)}render(){const{axis:C,bounds:P,children:O,defaultPosition:k,defaultClassName:A,defaultClassNameDragging:L,defaultClassNameDragged:F,position:j,positionOffset:B,scale:V,...K}=this.props;let Y={},$=null;const U=!!!j||this.state.dragging,ie=j||k,le={x:(0,s.canDragX)(this)&&U?this.state.x:ie.x,y:(0,s.canDragY)(this)&&U?this.state.y:ie.y};this.state.isElementSVG?$=(0,o.createSVGTransform)(le,B):Y=(0,o.createCSSTransform)(le,B);const M=(0,i.default)(O.props.className||"",A,{[L]:this.state.dragging,[F]:this.state.dragged});return t.createElement(l.default,p({},K,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(O),{className:M,style:{...O.props.style,...Y},transform:$}))}}e.default=w,v(w,"displayName","Draggable"),v(w,"propTypes",{...l.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:a.dontSetMe,style:a.dontSetMe,transform:a.dontSetMe}),v(w,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(A_);const{default:H_,DraggableCore:F7}=A_;bf.exports=H_,bf.exports.default=H_,bf.exports.DraggableCore=F7;var W_=bf.exports,Sf={exports:{}},Vc={},av={};av.__esModule=!0,av.cloneElement=W7;var j7=z7(m);function z7(e){return e&&e.__esModule?e:{default:e}}function q_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function U_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?q_(Object(n),!0).forEach(function(r){B7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function B7(e,t,n){return t=V7(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function V7(e){var t=H7(e,"string");return typeof t=="symbol"?t:String(t)}function H7(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function W7(e,t){return t.style&&e.props.style&&(t.style=U_(U_({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),j7.default.cloneElement(e,t)}var Hc={};Hc.__esModule=!0,Hc.resizableProps=void 0;var ot=q7(Fo);function q7(e){return e&&e.__esModule?e:{default:e}}var U7={axis:ot.default.oneOf(["both","x","y","none"]),className:ot.default.string,children:ot.default.element.isRequired,draggableOpts:ot.default.shape({allowAnyClick:ot.default.bool,cancel:ot.default.string,children:ot.default.node,disabled:ot.default.bool,enableUserSelectHack:ot.default.bool,offsetParent:ot.default.node,grid:ot.default.arrayOf(ot.default.number),handle:ot.default.string,nodeRef:ot.default.object,onStart:ot.default.func,onDrag:ot.default.func,onStop:ot.default.func,onMouseDown:ot.default.func,scale:ot.default.number}),height:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0];if(i.axis==="both"||i.axis==="y"){var o;return(o=ot.default.number).isRequired.apply(o,n)}return ot.default.number.apply(ot.default,n)},handle:ot.default.oneOfType([ot.default.node,ot.default.func]),handleSize:ot.default.arrayOf(ot.default.number),lockAspectRatio:ot.default.bool,maxConstraints:ot.default.arrayOf(ot.default.number),minConstraints:ot.default.arrayOf(ot.default.number),onResizeStop:ot.default.func,onResizeStart:ot.default.func,onResize:ot.default.func,resizeHandles:ot.default.arrayOf(ot.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:ot.default.number,width:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0];if(i.axis==="both"||i.axis==="x"){var o;return(o=ot.default.number).isRequired.apply(o,n)}return ot.default.number.apply(ot.default,n)}};Hc.resizableProps=U7,Vc.__esModule=!0,Vc.default=void 0;var Wc=Q7(m),G7=W_,Y7=av,K7=Hc,X7=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function G_(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(G_=function(i){return i?n:t})(e)}function Q7(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=G_(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function lv(){return lv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lv.apply(this,arguments)}function J7(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function Y_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function cv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Y_(Object(n),!0).forEach(function(r){Z7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Y_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Z7(e,t,n){return t=e4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function e4(e){var t=t4(e,"string");return typeof t=="symbol"?t:String(t)}function t4(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function n4(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,uv(e,t)}function uv(e,t){return uv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},uv(e,t)}var dv=function(e){n4(t,e);function t(){for(var r,i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r=e.call.apply(e,[this].concat(o))||this,r.handleRefs={},r.lastHandleRect=null,r.slack=null,r}var n=t.prototype;return n.componentWillUnmount=function(){this.resetData()},n.resetData=function(){this.lastHandleRect=this.slack=null},n.runConstraints=function(i,o){var s=this.props,a=s.minConstraints,l=s.maxConstraints,c=s.lockAspectRatio;if(!a&&!l&&!c)return[i,o];if(c){var d=this.props.width/this.props.height,f=i-this.props.width,g=o-this.props.height;Math.abs(f)>Math.abs(g*d)?o=i/d:i=o*d}var p=i,v=o,y=this.slack||[0,0],x=y[0],w=y[1];return i+=x,o+=w,a&&(i=Math.max(a[0],i),o=Math.max(a[1],o)),l&&(i=Math.min(l[0],i),o=Math.min(l[1],o)),this.slack=[x+(p-i),w+(v-o)],[i,o]},n.resizeHandler=function(i,o){var s=this;return function(a,l){var c=l.node,d=l.deltaX,f=l.deltaY;i==="onResizeStart"&&s.resetData();var g=(s.props.axis==="both"||s.props.axis==="x")&&o!=="n"&&o!=="s",p=(s.props.axis==="both"||s.props.axis==="y")&&o!=="e"&&o!=="w";if(!(!g&&!p)){var v=o[0],y=o[o.length-1],x=c.getBoundingClientRect();if(s.lastHandleRect!=null){if(y==="w"){var w=x.left-s.lastHandleRect.left;d+=w}if(v==="n"){var S=x.top-s.lastHandleRect.top;f+=S}}s.lastHandleRect=x,y==="w"&&(d=-d),v==="n"&&(f=-f);var C=s.props.width+(g?d/s.props.transformScale:0),P=s.props.height+(p?f/s.props.transformScale:0),O=s.runConstraints(C,P);C=O[0],P=O[1];var k=C!==s.props.width||P!==s.props.height,A=typeof s.props[i]=="function"?s.props[i]:null,L=i==="onResize"&&!k;A&&!L&&(a.persist==null||a.persist(),A(a,{node:c,size:{width:C,height:P},handle:o})),i==="onResizeStop"&&s.resetData()}}},n.renderResizeHandle=function(i,o){var s=this.props.handle;if(!s)return Wc.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+i,ref:o});if(typeof s=="function")return s(i,o);var a=typeof s.type=="string",l=cv({ref:o},a?{}:{handleAxis:i});return Wc.cloneElement(s,l)},n.render=function(){var i=this,o=this.props,s=o.children,a=o.className,l=o.draggableOpts;o.width,o.height,o.handle,o.handleSize,o.lockAspectRatio,o.axis,o.minConstraints,o.maxConstraints,o.onResize,o.onResizeStop,o.onResizeStart;var c=o.resizeHandles;o.transformScale;var d=J7(o,X7);return(0,Y7.cloneElement)(s,cv(cv({},d),{},{className:(a?a+" ":"")+"react-resizable",children:[].concat(s.props.children,c.map(function(f){var g,p=(g=i.handleRefs[f])!=null?g:i.handleRefs[f]=Wc.createRef();return Wc.createElement(G7.DraggableCore,lv({},l,{nodeRef:p,key:"resizableHandle-"+f,onStop:i.resizeHandler("onResizeStop",f),onStart:i.resizeHandler("onResizeStart",f),onDrag:i.resizeHandler("onResize",f)}),i.renderResizeHandle(f,p))}))}))},t}(Wc.Component);Vc.default=dv,dv.propTypes=K7.resizableProps,dv.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var Cf={};Cf.__esModule=!0,Cf.default=void 0;var fv=a4(m),r4=K_(Fo),i4=K_(Vc),o4=Hc,s4=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function K_(e){return e&&e.__esModule?e:{default:e}}function X_(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(X_=function(i){return i?n:t})(e)}function a4(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=X_(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function hv(){return hv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hv.apply(this,arguments)}function Q_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ef(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Q_(Object(n),!0).forEach(function(r){l4(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Q_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function l4(e,t,n){return t=c4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c4(e){var t=u4(e,"string");return typeof t=="symbol"?t:String(t)}function u4(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function d4(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function f4(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,pv(e,t)}function pv(e,t){return pv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},pv(e,t)}var J_=function(e){f4(t,e);function t(){for(var r,i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r=e.call.apply(e,[this].concat(o))||this,r.state={width:r.props.width,height:r.props.height,propsWidth:r.props.width,propsHeight:r.props.height},r.onResize=function(a,l){var c=l.size;r.props.onResize?(a.persist==null||a.persist(),r.setState(c,function(){return r.props.onResize&&r.props.onResize(a,l)})):r.setState(c)},r}t.getDerivedStateFromProps=function(i,o){return o.propsWidth!==i.width||o.propsHeight!==i.height?{width:i.width,height:i.height,propsWidth:i.width,propsHeight:i.height}:null};var n=t.prototype;return n.render=function(){var i=this.props,o=i.handle,s=i.handleSize;i.onResize;var a=i.onResizeStart,l=i.onResizeStop,c=i.draggableOpts,d=i.minConstraints,f=i.maxConstraints,g=i.lockAspectRatio,p=i.axis;i.width,i.height;var v=i.resizeHandles,y=i.style,x=i.transformScale,w=d4(i,s4);return fv.createElement(i4.default,{axis:p,draggableOpts:c,handle:o,handleSize:s,height:this.state.height,lockAspectRatio:g,maxConstraints:f,minConstraints:d,onResizeStart:a,onResize:this.onResize,onResizeStop:l,resizeHandles:v,transformScale:x,width:this.state.width},fv.createElement("div",hv({},w,{style:Ef(Ef({},y),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(fv.Component);Cf.default=J_,J_.propTypes=Ef(Ef({},o4.resizableProps),{},{children:r4.default.element}),Sf.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},Sf.exports.Resizable=Vc.default,Sf.exports.ResizableBox=Cf.default;var h4=Sf.exports,ro={};Object.defineProperty(ro,"__esModule",{value:!0}),ro.resizeHandleType=ro.resizeHandleAxesType=ro.default=void 0;var dt=Z_(Fo),p4=Z_(m);function Z_(e){return e&&e.__esModule?e:{default:e}}const eS=dt.default.arrayOf(dt.default.oneOf(["s","w","e","n","sw","nw","se","ne"]));ro.resizeHandleAxesType=eS;const tS=dt.default.oneOfType([dt.default.node,dt.default.func]);ro.resizeHandleType=tS;var g4={className:dt.default.string,style:dt.default.object,width:dt.default.number,autoSize:dt.default.bool,cols:dt.default.number,draggableCancel:dt.default.string,draggableHandle:dt.default.string,verticalCompact:function(e){e.verticalCompact===!1&&process.env.NODE_ENV!=="production"&&console.warn('`verticalCompact` on <ReactGridLayout> is deprecated and will be removed soon. Use `compactType`: "horizontal" | "vertical" | null.')},compactType:dt.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&pt.validateLayout(t,"layout")},margin:dt.default.arrayOf(dt.default.number),containerPadding:dt.default.arrayOf(dt.default.number),rowHeight:dt.default.number,maxRows:dt.default.number,isBounded:dt.default.bool,isDraggable:dt.default.bool,isResizable:dt.default.bool,allowOverlap:dt.default.bool,preventCollision:dt.default.bool,useCSSTransforms:dt.default.bool,transformScale:dt.default.number,isDroppable:dt.default.bool,resizeHandles:eS,resizeHandle:tS,onLayoutChange:dt.default.func,onDragStart:dt.default.func,onDrag:dt.default.func,onDragStop:dt.default.func,onResizeStart:dt.default.func,onResize:dt.default.func,onResizeStop:dt.default.func,onDrop:dt.default.func,droppingItem:dt.default.shape({i:dt.default.string.isRequired,w:dt.default.number.isRequired,h:dt.default.number.isRequired}),children:function(e,t){const n=e[t],r={};p4.default.Children.forEach(n,function(i){if((i==null?void 0:i.key)!=null){if(r[i.key])throw new Error('Duplicate child key "'+i.key+'" found! This will cause problems in ReactGridLayout.');r[i.key]=!0}})},innerRef:dt.default.any};ro.default=g4,Object.defineProperty(mf,"__esModule",{value:!0}),mf.default=void 0;var al=gv(m),Mt=gv(Fo),m4=W_,v4=h4,ll=pt,Nn=ki,nS=ro,b4=gv(Nm);function gv(e){return e&&e.__esModule?e:{default:e}}function Ti(e,t,n){return t=y4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y4(e){var t=x4(e,"string");return typeof t=="symbol"?t:String(t)}function x4(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class mv extends al.default.Component{constructor(){super(...arguments),Ti(this,"state",{resizing:null,dragging:null,className:""}),Ti(this,"elementRef",al.default.createRef()),Ti(this,"onDragStart",(t,n)=>{let{node:r}=n;const{onDragStart:i,transformScale:o}=this.props;if(!i)return;const s={top:0,left:0},{offsetParent:a}=r;if(!a)return;const l=a.getBoundingClientRect(),c=r.getBoundingClientRect(),d=c.left/o,f=l.left/o,g=c.top/o,p=l.top/o;s.left=d-f+a.scrollLeft,s.top=g-p+a.scrollTop,this.setState({dragging:s});const{x:v,y}=(0,Nn.calcXY)(this.getPositionParams(),s.top,s.left,this.props.w,this.props.h);return i.call(this,this.props.i,v,y,{e:t,node:r,newPosition:s})}),Ti(this,"onDrag",(t,n)=>{let{node:r,deltaX:i,deltaY:o}=n;const{onDrag:s}=this.props;if(!s)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let a=this.state.dragging.top+o,l=this.state.dragging.left+i;const{isBounded:c,i:d,w:f,h:g,containerWidth:p}=this.props,v=this.getPositionParams();if(c){const{offsetParent:S}=r;if(S){const{margin:C,rowHeight:P}=this.props,O=S.clientHeight-(0,Nn.calcGridItemWHPx)(g,P,C[1]);a=(0,Nn.clamp)(a,0,O);const k=(0,Nn.calcGridColWidth)(v),A=p-(0,Nn.calcGridItemWHPx)(f,k,C[0]);l=(0,Nn.clamp)(l,0,A)}}const y={top:a,left:l};this.setState({dragging:y});const{x,y:w}=(0,Nn.calcXY)(v,a,l,f,g);return s.call(this,d,x,w,{e:t,node:r,newPosition:y})}),Ti(this,"onDragStop",(t,n)=>{let{node:r}=n;const{onDragStop:i}=this.props;if(!i)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:o,h:s,i:a}=this.props,{left:l,top:c}=this.state.dragging,d={top:c,left:l};this.setState({dragging:null});const{x:f,y:g}=(0,Nn.calcXY)(this.getPositionParams(),c,l,o,s);return i.call(this,a,f,g,{e:t,node:r,newPosition:d})}),Ti(this,"onResizeStop",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStop")),Ti(this,"onResizeStart",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStart")),Ti(this,"onResize",(t,n,r)=>this.onResizeHandler(t,n,r,"onResize"))}shouldComponentUpdate(t,n){if(this.props.children!==t.children||this.props.droppingPosition!==t.droppingPosition)return!0;const r=(0,Nn.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),i=(0,Nn.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,n);return!(0,ll.fastPositionEqual)(r,i)||this.props.useCSSTransforms!==t.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(t){this.moveDroppingItem(t)}moveDroppingItem(t){const{droppingPosition:n}=this.props;if(!n)return;const r=this.elementRef.current;if(!r)return;const i=t.droppingPosition||{left:0,top:0},{dragging:o}=this.state,s=o&&n.left!==i.left||n.top!==i.top;if(!o)this.onDragStart(n.e,{node:r,deltaX:n.left,deltaY:n.top});else if(s){const a=n.left-o.left,l=n.top-o.top;this.onDrag(n.e,{node:r,deltaX:a,deltaY:l})}}getPositionParams(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:t.cols,containerPadding:t.containerPadding,containerWidth:t.containerWidth,margin:t.margin,maxRows:t.maxRows,rowHeight:t.rowHeight}}createStyle(t){const{usePercentages:n,containerWidth:r,useCSSTransforms:i}=this.props;let o;return i?o=(0,ll.setTransform)(t):(o=(0,ll.setTopLeft)(t),n&&(o.left=(0,ll.perc)(t.left/r),o.width=(0,ll.perc)(t.width/r))),o}mixinDraggable(t,n){return al.default.createElement(m4.DraggableCore,{disabled:!n,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},t)}curryResizeHandler(t,n){return(r,i)=>n(r,i,t)}mixinResizable(t,n,r){const{cols:i,minW:o,minH:s,maxW:a,maxH:l,transformScale:c,resizeHandles:d,resizeHandle:f}=this.props,g=this.getPositionParams(),p=(0,Nn.calcGridItemPosition)(g,0,0,i,0).width,v=(0,Nn.calcGridItemPosition)(g,0,0,o,s),y=(0,Nn.calcGridItemPosition)(g,0,0,a,l),x=[v.width,v.height],w=[Math.min(y.width,p),Math.min(y.height,1/0)];return al.default.createElement(v4.Resizable,{draggableOpts:{disabled:!r},className:r?void 0:"react-resizable-hide",width:n.width,height:n.height,minConstraints:x,maxConstraints:w,onResizeStop:this.curryResizeHandler(n,this.onResizeStop),onResizeStart:this.curryResizeHandler(n,this.onResizeStart),onResize:this.curryResizeHandler(n,this.onResize),transformScale:c,resizeHandles:d,handle:f},t)}onResizeHandler(t,n,r,i){let{node:o,size:s,handle:a}=n;const l=this.props[i];if(!l)return;const{x:c,y:d,i:f,maxH:g,minH:p,containerWidth:v}=this.props,{minW:y,maxW:x}=this.props;let w=s;o&&(w=(0,ll.resizeItemInDirection)(a,r,s,v),this.setState({resizing:i==="onResizeStop"?null:w}));let{w:S,h:C}=(0,Nn.calcWH)(this.getPositionParams(),w.width,w.height,c,d,a);S=(0,Nn.clamp)(S,Math.max(y,1),x),C=(0,Nn.clamp)(C,p,g),l.call(this,f,S,C,{e:t,node:o,size:w,handle:a})}render(){const{x:t,y:n,w:r,h:i,isDraggable:o,isResizable:s,droppingPosition:a,useCSSTransforms:l}=this.props,c=(0,Nn.calcGridItemPosition)(this.getPositionParams(),t,n,r,i,this.state),d=al.default.Children.only(this.props.children);let f=al.default.cloneElement(d,{ref:this.elementRef,className:(0,b4.default)("react-grid-item",d.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":o,"react-draggable-dragging":!!this.state.dragging,dropping:!!a,cssTransforms:l}),style:{...this.props.style,...d.props.style,...this.createStyle(c)}});return f=this.mixinResizable(f,c,s),f=this.mixinDraggable(f,o),f}}mf.default=mv,Ti(mv,"propTypes",{children:Mt.default.element,cols:Mt.default.number.isRequired,containerWidth:Mt.default.number.isRequired,rowHeight:Mt.default.number.isRequired,margin:Mt.default.array.isRequired,maxRows:Mt.default.number.isRequired,containerPadding:Mt.default.array.isRequired,x:Mt.default.number.isRequired,y:Mt.default.number.isRequired,w:Mt.default.number.isRequired,h:Mt.default.number.isRequired,minW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minWidth not Number");if(n>e.w||n>e.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxWidth not Number");if(n<e.w||n<e.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minHeight not Number");if(n>e.h||n>e.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxHeight not Number");if(n<e.h||n<e.minH)return new Error("maxHeight smaller than item height/minHeight")},i:Mt.default.string.isRequired,resizeHandles:nS.resizeHandleAxesType,resizeHandle:nS.resizeHandleType,onDragStop:Mt.default.func,onDragStart:Mt.default.func,onDrag:Mt.default.func,onResizeStop:Mt.default.func,onResizeStart:Mt.default.func,onResize:Mt.default.func,isDraggable:Mt.default.bool.isRequired,isResizable:Mt.default.bool.isRequired,isBounded:Mt.default.bool.isRequired,static:Mt.default.bool,useCSSTransforms:Mt.default.bool.isRequired,transformScale:Mt.default.number,className:Mt.default.string,handle:Mt.default.string,cancel:Mt.default.string,droppingPosition:Mt.default.shape({e:Mt.default.object.isRequired,left:Mt.default.number.isRequired,top:Mt.default.number.isRequired})}),Ti(mv,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),Object.defineProperty(Fc,"__esModule",{value:!0}),Fc.default=void 0;var Hs=C4(m),vv=Im,w4=bv(Nm),Ye=pt,_4=ki,rS=bv(mf),S4=bv(ro);function bv(e){return e&&e.__esModule?e:{default:e}}function iS(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(iS=function(r){return r?n:t})(e)}function C4(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=iS(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function Wn(e,t,n){return t=E4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E4(e){var t=O4(e,"string");return typeof t=="symbol"?t:String(t)}function O4(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const oS="react-grid-layout";let sS=!1;try{sS=/firefox/i.test(navigator.userAgent)}catch{}class Of extends Hs.Component{constructor(){super(...arguments),Wn(this,"state",{activeDrag:null,layout:(0,Ye.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,Ye.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),Wn(this,"dragEnterCounter",0),Wn(this,"onDragStart",(t,n,r,i)=>{let{e:o,node:s}=i;const{layout:a}=this.state,l=(0,Ye.getLayoutItem)(a,t);if(l)return this.setState({oldDragItem:(0,Ye.cloneLayoutItem)(l),oldLayout:a}),this.props.onDragStart(a,l,l,null,o,s)}),Wn(this,"onDrag",(t,n,r,i)=>{let{e:o,node:s}=i;const{oldDragItem:a}=this.state;let{layout:l}=this.state;const{cols:c,allowOverlap:d,preventCollision:f}=this.props,g=(0,Ye.getLayoutItem)(l,t);if(!g)return;const p={w:g.w,h:g.h,x:g.x,y:g.y,placeholder:!0,i:t},v=!0;l=(0,Ye.moveElement)(l,g,n,r,v,f,(0,Ye.compactType)(this.props),c,d),this.props.onDrag(l,a,g,p,o,s),this.setState({layout:d?l:(0,Ye.compact)(l,(0,Ye.compactType)(this.props),c),activeDrag:p})}),Wn(this,"onDragStop",(t,n,r,i)=>{let{e:o,node:s}=i;if(!this.state.activeDrag)return;const{oldDragItem:a}=this.state;let{layout:l}=this.state;const{cols:c,preventCollision:d,allowOverlap:f}=this.props,g=(0,Ye.getLayoutItem)(l,t);if(!g)return;const p=!0;l=(0,Ye.moveElement)(l,g,n,r,p,d,(0,Ye.compactType)(this.props),c,f);const v=f?l:(0,Ye.compact)(l,(0,Ye.compactType)(this.props),c);this.props.onDragStop(v,a,g,null,o,s);const{oldLayout:y}=this.state;this.setState({activeDrag:null,layout:v,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(v,y)}),Wn(this,"onResizeStart",(t,n,r,i)=>{let{e:o,node:s}=i;const{layout:a}=this.state,l=(0,Ye.getLayoutItem)(a,t);l&&(this.setState({oldResizeItem:(0,Ye.cloneLayoutItem)(l),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(a,l,l,null,o,s))}),Wn(this,"onResize",(t,n,r,i)=>{let{e:o,node:s,size:a,handle:l}=i;const{oldResizeItem:c}=this.state;let{layout:d}=this.state;const{cols:f,preventCollision:g,allowOverlap:p}=this.props;let v=!1,y,x,w;const[S,C]=(0,Ye.withLayoutItem)(d,t,O=>{let k;return x=O.x,w=O.y,["sw","w","nw","n","ne"].indexOf(l)!==-1&&(["sw","nw","w"].indexOf(l)!==-1&&(x=O.x+(O.w-n),n=O.x!==x&&x<0?O.w:n,x=x<0?0:x),["ne","n","nw"].indexOf(l)!==-1&&(w=O.y+(O.h-r),r=O.y!==w&&w<0?O.h:r,w=w<0?0:w),v=!0),g&&!p&&(k=(0,Ye.getAllCollisions)(d,{...O,w:n,h:r,x,y:w}).filter(L=>L.i!==O.i).length>0,k&&(w=O.y,r=O.h,x=O.x,n=O.w,v=!1)),O.w=n,O.h=r,O});if(!C)return;y=S,v&&(y=(0,Ye.moveElement)(S,C,x,w,!0,this.props.preventCollision,(0,Ye.compactType)(this.props),f,p));const P={w:C.w,h:C.h,x:C.x,y:C.y,static:!0,i:t};this.props.onResize(y,c,C,P,o,s),this.setState({layout:p?y:(0,Ye.compact)(y,(0,Ye.compactType)(this.props),f),activeDrag:P})}),Wn(this,"onResizeStop",(t,n,r,i)=>{let{e:o,node:s}=i;const{layout:a,oldResizeItem:l}=this.state,{cols:c,allowOverlap:d}=this.props,f=(0,Ye.getLayoutItem)(a,t),g=d?a:(0,Ye.compact)(a,(0,Ye.compactType)(this.props),c);this.props.onResizeStop(g,l,f,null,o,s);const{oldLayout:p}=this.state;this.setState({activeDrag:null,layout:g,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(g,p)}),Wn(this,"onDragOver",t=>{var n;if(t.preventDefault(),t.stopPropagation(),sS&&!((n=t.nativeEvent.target)!==null&&n!==void 0&&n.classList.contains(oS)))return!1;const{droppingItem:r,onDropDragOver:i,margin:o,cols:s,rowHeight:a,maxRows:l,width:c,containerPadding:d,transformScale:f}=this.props,g=i==null?void 0:i(t);if(g===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const p={...r,...g},{layout:v}=this.state,{layerX:y,layerY:x}=t.nativeEvent,w={left:y/f,top:x/f,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:S,top:C}=this.state.droppingPosition;(S!=y||C!=x)&&this.setState({droppingPosition:w})}}else{const S={cols:s,margin:o,maxRows:l,rowHeight:a,containerWidth:c,containerPadding:d||o},C=(0,_4.calcXY)(S,x,y,p.w,p.h);this.setState({droppingDOMNode:Hs.createElement("div",{key:p.i}),droppingPosition:w,layout:[...v,{...p,x:C.x,y:C.y,static:!1,isDraggable:!0}]})}}),Wn(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:n}=this.props,{layout:r}=this.state,i=(0,Ye.compact)(r.filter(o=>o.i!==t.i),(0,Ye.compactType)(this.props),n,this.props.allowOverlap);this.setState({layout:i,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),Wn(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),Wn(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),Wn(this,"onDrop",t=>{t.preventDefault(),t.stopPropagation();const{droppingItem:n}=this.props,{layout:r}=this.state,i=r.find(o=>o.i===n.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(r,i,t)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(t,n){let r;return n.activeDrag?null:(!(0,vv.deepEqual)(t.layout,n.propsLayout)||t.compactType!==n.compactType?r=t.layout:(0,Ye.childrenEqual)(t.children,n.children)||(r=n.layout),r?{layout:(0,Ye.synchronizeLayoutWithChildren)(r,t.children,t.cols,(0,Ye.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,n){return this.props.children!==t.children||!(0,Ye.fastRGLPropsEqual)(this.props,t,vv.deepEqual)||this.state.activeDrag!==n.activeDrag||this.state.mounted!==n.mounted||this.state.droppingPosition!==n.droppingPosition}componentDidUpdate(t,n){if(!this.state.activeDrag){const r=this.state.layout,i=n.layout;this.onLayoutMaybeChanged(r,i)}}containerHeight(){if(!this.props.autoSize)return;const t=(0,Ye.bottom)(this.state.layout),n=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return t*this.props.rowHeight+(t-1)*this.props.margin[1]+n*2+"px"}onLayoutMaybeChanged(t,n){n||(n=this.state.layout),(0,vv.deepEqual)(n,t)||this.props.onLayoutChange(t)}placeholder(){const{activeDrag:t}=this.state;if(!t)return null;const{width:n,cols:r,margin:i,containerPadding:o,rowHeight:s,maxRows:a,useCSSTransforms:l,transformScale:c}=this.props;return Hs.createElement(rS.default,{w:t.w,h:t.h,x:t.x,y:t.y,i:t.i,className:"react-grid-placeholder ".concat(this.state.resizing?"placeholder-resizing":""),containerWidth:n,cols:r,margin:i,containerPadding:o||i,maxRows:a,rowHeight:s,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:l,transformScale:c},Hs.createElement("div",null))}processGridItem(t,n){if(!t||!t.key)return;const r=(0,Ye.getLayoutItem)(this.state.layout,String(t.key));if(!r)return null;const{width:i,cols:o,margin:s,containerPadding:a,rowHeight:l,maxRows:c,isDraggable:d,isResizable:f,isBounded:g,useCSSTransforms:p,transformScale:v,draggableCancel:y,draggableHandle:x,resizeHandles:w,resizeHandle:S}=this.props,{mounted:C,droppingPosition:P}=this.state,O=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&d,k=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&f,A=r.resizeHandles||w,L=O&&g&&r.isBounded!==!1;return Hs.createElement(rS.default,{containerWidth:i,cols:o,margin:s,containerPadding:a||s,maxRows:c,rowHeight:l,cancel:y,handle:x,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:O,isResizable:k,isBounded:L,useCSSTransforms:p&&C,usePercentages:!C,transformScale:v,w:r.w,h:r.h,x:r.x,y:r.y,i:r.i,minH:r.minH,minW:r.minW,maxH:r.maxH,maxW:r.maxW,static:r.static,droppingPosition:n?P:void 0,resizeHandles:A,resizeHandle:S},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:i}=this.props,o=(0,w4.default)(oS,t),s={height:this.containerHeight(),...n};return Hs.createElement("div",{ref:i,className:o,style:s,onDrop:r?this.onDrop:Ye.noop,onDragLeave:r?this.onDragLeave:Ye.noop,onDragEnter:r?this.onDragEnter:Ye.noop,onDragOver:r?this.onDragOver:Ye.noop},Hs.Children.map(this.props.children,a=>this.processGridItem(a)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}Fc.default=Of,Wn(Of,"displayName","ReactGridLayout"),Wn(Of,"propTypes",S4.default),Wn(Of,"defaultProps",{autoSize:!0,cols:12,className:"",style:{},draggableHandle:"",draggableCancel:"",containerPadding:null,rowHeight:150,maxRows:1/0,layout:[],margin:[10,10],isBounded:!1,isDraggable:!0,isResizable:!0,allowOverlap:!1,isDroppable:!1,useCSSTransforms:!0,transformScale:1,verticalCompact:!0,compactType:"vertical",preventCollision:!1,droppingItem:{i:"__dropping-elem__",h:1,w:1},resizeHandles:["se"],onLayoutChange:Ye.noop,onDragStart:Ye.noop,onDrag:Ye.noop,onDragStop:Ye.noop,onResizeStart:Ye.noop,onResize:Ye.noop,onResizeStop:Ye.noop,onDrop:Ye.noop,onDropDragOver:Ye.noop});var Pf={},Ws={};Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.findOrGenerateResponsiveLayout=M4,Ws.getBreakpointFromWidth=P4,Ws.getColsFromBreakpoint=k4,Ws.sortBreakpoints=yv;var kf=pt;function P4(e,t){const n=yv(e);let r=n[0];for(let i=1,o=n.length;i<o;i++){const s=n[i];t>e[s]&&(r=s)}return r}function k4(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function M4(e,t,n,r,i,o){if(e[n])return(0,kf.cloneLayout)(e[n]);let s=e[r];const a=yv(t),l=a.slice(a.indexOf(n));for(let c=0,d=l.length;c<d;c++){const f=l[c];if(e[f]){s=e[f];break}}return s=(0,kf.cloneLayout)(s||[]),(0,kf.compact)((0,kf.correctBounds)(s,{cols:i}),o,i)}function yv(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(Pf,"__esModule",{value:!0}),Pf.default=void 0;var aS=T4(m),ar=lS(Fo),xv=Im,cl=pt,qs=Ws,D4=lS(Fc);function lS(e){return e&&e.__esModule?e:{default:e}}function cS(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(cS=function(r){return r?n:t})(e)}function T4(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=cS(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function wv(){return wv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wv.apply(this,arguments)}function Mf(e,t,n){return t=A4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function A4(e){var t=I4(e,"string");return typeof t=="symbol"?t:String(t)}function I4(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const uS=e=>Object.prototype.toString.call(e);function Df(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class _v extends aS.Component{constructor(){super(...arguments),Mf(this,"state",this.generateInitialState()),Mf(this,"onLayoutChange",t=>{this.props.onLayoutChange(t,{...this.props.layouts,[this.state.breakpoint]:t})})}generateInitialState(){const{width:t,breakpoints:n,layouts:r,cols:i}=this.props,o=(0,qs.getBreakpointFromWidth)(n,t),s=(0,qs.getColsFromBreakpoint)(o,i),a=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,qs.findOrGenerateResponsiveLayout)(r,n,o,o,s,a),breakpoint:o,cols:s}}static getDerivedStateFromProps(t,n){if(!(0,xv.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:i}=n;return{layout:(0,qs.findOrGenerateResponsiveLayout)(t.layouts,t.breakpoints,r,r,i,t.compactType),layouts:t.layouts}}return null}componentDidUpdate(t){(this.props.width!=t.width||this.props.breakpoint!==t.breakpoint||!(0,xv.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,xv.deepEqual)(this.props.cols,t.cols))&&this.onWidthChange(t)}onWidthChange(t){const{breakpoints:n,cols:r,layouts:i,compactType:o}=this.props,s=this.props.breakpoint||(0,qs.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),a=this.state.breakpoint,l=(0,qs.getColsFromBreakpoint)(s,r),c={...i};if(a!==s||t.breakpoints!==n||t.cols!==r){a in c||(c[a]=(0,cl.cloneLayout)(this.state.layout));let g=(0,qs.findOrGenerateResponsiveLayout)(c,n,s,a,l,o);g=(0,cl.synchronizeLayoutWithChildren)(g,this.props.children,l,o,this.props.allowOverlap),c[s]=g,this.props.onLayoutChange(g,c),this.props.onBreakpointChange(s,l),this.setState({breakpoint:s,layout:g,cols:l})}const d=Df(this.props.margin,s),f=Df(this.props.containerPadding,s);this.props.onWidthChange(this.props.width,d,l,f)}render(){const{breakpoint:t,breakpoints:n,cols:r,layouts:i,margin:o,containerPadding:s,onBreakpointChange:a,onLayoutChange:l,onWidthChange:c,...d}=this.props;return aS.createElement(D4.default,wv({},d,{margin:Df(o,this.state.breakpoint),containerPadding:Df(s,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}Pf.default=_v,Mf(_v,"propTypes",{breakpoint:ar.default.string,breakpoints:ar.default.object,allowOverlap:ar.default.bool,cols:ar.default.object,margin:ar.default.oneOfType([ar.default.array,ar.default.object]),containerPadding:ar.default.oneOfType([ar.default.array,ar.default.object]),layouts(e,t){if(uS(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+uS(e[t]));Object.keys(e[t]).forEach(n=>{if(!(n in e.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,cl.validateLayout)(e.layouts[n],"layouts."+n)})},width:ar.default.number.isRequired,onBreakpointChange:ar.default.func,onLayoutChange:ar.default.func,onWidthChange:ar.default.func}),Mf(_v,"defaultProps",{breakpoints:{lg:1200,md:996,sm:768,xs:480,xxs:0},cols:{lg:12,md:10,sm:6,xs:4,xxs:2},containerPadding:{lg:null,md:null,sm:null,xs:null,xxs:null},layouts:{},margin:[10,10],allowOverlap:!1,onBreakpointChange:cl.noop,onLayoutChange:cl.noop,onWidthChange:cl.noop});var Sv={},dS=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(i,o){return i[0]===n?(r=o,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),i=this.__entries__[r];return i&&i[1]},t.prototype.set=function(n,r){var i=e(this.__entries__,n);~i?this.__entries__[i][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,i=e(r,n);~i&&r.splice(i,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var i=0,o=this.__entries__;i<o.length;i++){var s=o[i];n.call(r,s[1],s[0])}},t}()}(),Cv=typeof window<"u"&&typeof document<"u"&&window.document===document,Tf=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),N4=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Tf):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),R4=2;function L4(e,t){var n=!1,r=!1,i=0;function o(){n&&(n=!1,e()),r&&a()}function s(){N4(o)}function a(){var l=Date.now();if(n){if(l-i<R4)return;r=!0}else n=!0,r=!1,setTimeout(s,t);i=l}return a}var $4=20,F4=["top","right","bottom","left","width","height","size","weight"],j4=typeof MutationObserver<"u",z4=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=L4(this.refresh.bind(this),$4)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,r=n.indexOf(t);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!Cv||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),j4?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!Cv||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,i=F4.some(function(o){return!!~r.indexOf(o)});i&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),fS=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e},ul=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||Tf},hS=If(0,0,0,0);function Af(e){return parseFloat(e)||0}function pS(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,i){var o=e["border-"+i+"-width"];return r+Af(o)},0)}function B4(e){for(var t=["top","right","bottom","left"],n={},r=0,i=t;r<i.length;r++){var o=i[r],s=e["padding-"+o];n[o]=Af(s)}return n}function V4(e){var t=e.getBBox();return If(0,0,t.width,t.height)}function H4(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return hS;var r=ul(e).getComputedStyle(e),i=B4(r),o=i.left+i.right,s=i.top+i.bottom,a=Af(r.width),l=Af(r.height);if(r.boxSizing==="border-box"&&(Math.round(a+o)!==t&&(a-=pS(r,"left","right")+o),Math.round(l+s)!==n&&(l-=pS(r,"top","bottom")+s)),!q4(e)){var c=Math.round(a+o)-t,d=Math.round(l+s)-n;Math.abs(c)!==1&&(a-=c),Math.abs(d)!==1&&(l-=d)}return If(i.left,i.top,a,l)}var W4=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof ul(e).SVGGraphicsElement}:function(e){return e instanceof ul(e).SVGElement&&typeof e.getBBox=="function"}}();function q4(e){return e===ul(e).document.documentElement}function U4(e){return Cv?W4(e)?V4(e):H4(e):hS}function G4(e){var t=e.x,n=e.y,r=e.width,i=e.height,o=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,s=Object.create(o.prototype);return fS(s,{x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:i+n,left:t}),s}function If(e,t,n,r){return{x:e,y:t,width:n,height:r}}var Y4=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=If(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=U4(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),K4=function(){function e(t,n){var r=G4(n);fS(this,{target:t,contentRect:r})}return e}(),X4=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new dS,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=r}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof ul(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new Y4(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof ul(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new K4(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),gS=typeof WeakMap<"u"?new WeakMap:new dS,mS=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=z4.getInstance(),r=new X4(t,n,this);gS.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){mS.prototype[e]=function(){var t;return(t=gS.get(this))[e].apply(t,arguments)}});var Q4=function(){return typeof Tf.ResizeObserver<"u"?Tf.ResizeObserver:mS}();const J4=Yg(Object.freeze(Object.defineProperty({__proto__:null,default:Q4},Symbol.toStringTag,{value:"Module"})));Object.defineProperty(Sv,"__esModule",{value:!0}),Sv.default=sL;var Nf=nL(m),Z4=Ev(Fo),eL=Ev(J4),tL=Ev(Nm);function Ev(e){return e&&e.__esModule?e:{default:e}}function vS(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(vS=function(r){return r?n:t})(e)}function nL(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=vS(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function Ov(){return Ov=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ov.apply(this,arguments)}function dl(e,t,n){return t=rL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rL(e){var t=iL(e,"string");return typeof t=="symbol"?t:String(t)}function iL(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const oL="react-grid-layout";function sL(e){var t;return t=class extends Nf.Component{constructor(){super(...arguments),dl(this,"state",{width:1280}),dl(this,"elementRef",Nf.createRef()),dl(this,"mounted",!1),dl(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new eL.default(i=>{if(this.elementRef.current instanceof HTMLElement){const s=i[0].contentRect.width;this.setState({width:s})}});const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.observe(r)}componentWillUnmount(){this.mounted=!1;const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.unobserve(r),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:r,...i}=this.props;return r&&!this.mounted?Nf.createElement("div",{className:(0,tL.default)(this.props.className,oL),style:this.props.style,ref:this.elementRef}):Nf.createElement(e,Ov({innerRef:this.elementRef},i,this.state))}},dl(t,"defaultProps",{measureBeforeMount:!1}),dl(t,"propTypes",{measureBeforeMount:Z4.default.bool}),t}(function(e){e.exports=Fc.default,e.exports.utils=pt,e.exports.calculateUtils=ki,e.exports.Responsive=Pf.default,e.exports.Responsive.utils=Ws,e.exports.WidthProvider=Sv.default})(a_);var bS=a_.exports;function qc({children:e,className:t,text:n,onSave:r}){const[i,o]=m.useState(!1),[s,a]=m.useState(n),l=ge(d=>d.isDashboardEditing),c=d=>{d.stopPropagation(),l&&o(!0)};return _.jsx("div",{role:"editable",onDoubleClick:c,children:i?_.jsx("input",{type:"text",className:Pe("px-2 py-1 text-sm bg-background outline-[0.5px] outline-dashed outline-primary/50 rounded-sm",t),onChange:d=>a(d.target.value),value:s,autoFocus:!0,onBlur:()=>o(!1),onKeyDown:d=>{d.key==="Enter"&&(o(!1),r(s))}}):e})}const Pv=ue.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:Pe("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Pv.displayName="Card";const kv=ue.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:Pe("flex flex-col space-y-1.5 p-6",e),...t}));kv.displayName="CardHeader";const Mv=ue.forwardRef(({className:e,...t},n)=>_.jsx("h3",{ref:n,className:Pe("text-2xl font-semibold leading-none tracking-tight",e),...t}));Mv.displayName="CardTitle";const Dv=ue.forwardRef(({className:e,...t},n)=>_.jsx("p",{ref:n,className:Pe("text-sm text-muted-foreground",e),...t}));Dv.displayName="CardDescription";const Tv=ue.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:Pe("p-6 pt-0",e),...t}));Tv.displayName="CardContent";const aL=ue.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:Pe("flex items-center p-6 pt-0",e),...t}));aL.displayName="CardFooter";/*!
|
|
107
107
|
* @kurkle/color v0.3.2
|
|
108
108
|
* https://github.com/kurkle/color#readme
|
|
109
109
|
* (c) 2023 Jukka Kurkela
|
|
@@ -113,14 +113,14 @@ Valid keys: `+JSON.stringify(Object.keys(M),null," "));var oe=ye(de,W,X,me,he+"
|
|
|
113
113
|
* https://www.chartjs.org
|
|
114
114
|
* (c) 2023 Chart.js Contributors
|
|
115
115
|
* Released under the MIT License
|
|
116
|
-
*/function oo(){}const DL=(()=>{let e=0;return()=>e++})();function gt(e){return e===null||typeof e>"u"}function Yt(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function wt(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function cn(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Or(e,t){return cn(e)?e:t}function tt(e,t){return typeof e>"u"?t:e}const TL=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,OS=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Ft(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function Nt(e,t,n,r){let i,o,s;if(Yt(e))if(o=e.length,r)for(i=o-1;i>=0;i--)t.call(n,e[i],i);else for(i=0;i<o;i++)t.call(n,e[i],i);else if(wt(e))for(s=Object.keys(e),o=s.length,i=0;i<o;i++)t.call(n,e[s[i]],s[i])}function Ff(e,t){let n,r,i,o;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(i=e[n],o=t[n],i.datasetIndex!==o.datasetIndex||i.index!==o.index)return!1;return!0}function jf(e){if(Yt(e))return e.map(jf);if(wt(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let i=0;for(;i<r;++i)t[n[i]]=jf(e[n[i]]);return t}return e}function PS(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function AL(e,t,n,r){if(!PS(e))return;const i=t[e],o=n[e];wt(i)&&wt(o)?Ai(i,o,r):t[e]=jf(o)}function Ai(e,t,n){const r=Yt(t)?t:[t],i=r.length;if(!wt(e))return e;n=n||{};const o=n.merger||AL;let s;for(let a=0;a<i;++a){if(s=r[a],!wt(s))continue;const l=Object.keys(s);for(let c=0,d=l.length;c<d;++c)o(l[c],e,s,n)}return e}function Kc(e,t){return Ai(e,t,{merger:IL})}function IL(e,t,n){if(!PS(e))return;const r=t[e],i=n[e];wt(r)&&wt(i)?Kc(r,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=jf(i))}const kS={"":e=>e,x:e=>e.x,y:e=>e.y};function NL(e){const t=e.split("."),n=[];let r="";for(const i of t)r+=i,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function RL(e){const t=NL(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function Ho(e,t){return(kS[t]||(kS[t]=RL(t)))(e)}function $v(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Xc=e=>typeof e<"u",Wo=e=>typeof e=="function",MS=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function LL(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Kt=Math.PI,Xt=2*Kt,$L=Xt+Kt,zf=Number.POSITIVE_INFINITY,FL=Kt/180,dn=Kt/2,Us=Kt/4,DS=Kt*2/3,qo=Math.log10,Ii=Math.sign;function Qc(e,t,n){return Math.abs(e-t)<n}function TS(e){const t=Math.round(e);e=Qc(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(qo(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function jL(e){const t=[],n=Math.sqrt(e);let r;for(r=1;r<n;r++)e%r===0&&(t.push(r),t.push(e/r));return n===(n|0)&&t.push(n),t.sort((i,o)=>i-o).pop(),t}function hl(e){return!isNaN(parseFloat(e))&&isFinite(e)}function zL(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function AS(e,t,n){let r,i,o;for(r=0,i=e.length;r<i;r++)o=e[r][n],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function mi(e){return e*(Kt/180)}function Fv(e){return e*(180/Kt)}function IS(e){if(!cn(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function NS(e,t){const n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r);let o=Math.atan2(r,n);return o<-.5*Kt&&(o+=Xt),{angle:o,distance:i}}function jv(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function BL(e,t){return(e-t+$L)%Xt-Kt}function Pr(e){return(e%Xt+Xt)%Xt}function Jc(e,t,n,r){const i=Pr(e),o=Pr(t),s=Pr(n),a=Pr(o-i),l=Pr(s-i),c=Pr(i-o),d=Pr(i-s);return i===o||i===s||r&&o===s||a>l&&c<d}function kn(e,t,n){return Math.max(t,Math.min(n,e))}function VL(e){return kn(e,-32768,32767)}function so(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function zv(e,t,n){n=n||(s=>e[s]<t);let r=e.length-1,i=0,o;for(;r-i>1;)o=i+r>>1,n(o)?i=o:r=o;return{lo:i,hi:r}}const ao=(e,t,n,r)=>zv(e,n,r?i=>{const o=e[i][t];return o<n||o===n&&e[i+1][t]===n}:i=>e[i][t]<n),HL=(e,t,n)=>zv(e,n,r=>e[r][t]>=n);function WL(e,t,n){let r=0,i=e.length;for(;r<i&&e[r]<t;)r++;for(;i>r&&e[i-1]>n;)i--;return r>0||i<e.length?e.slice(r,i):e}const RS=["push","pop","shift","splice","unshift"];function qL(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),RS.forEach(n=>{const r="_onData"+$v(n),i=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...o){const s=i.apply(this,o);return e._chartjs.listeners.forEach(a=>{typeof a[r]=="function"&&a[r](...o)}),s}})})}function LS(e,t){const n=e._chartjs;if(!n)return;const r=n.listeners,i=r.indexOf(t);i!==-1&&r.splice(i,1),!(r.length>0)&&(RS.forEach(o=>{delete e[o]}),delete e._chartjs)}function $S(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const FS=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function jS(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,FS.call(window,()=>{r=!1,e.apply(t,n)}))}}function UL(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const Bv=e=>e==="start"?"left":e==="end"?"right":"center",qn=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,GL=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function zS(e,t,n){const r=t.length;let i=0,o=r;if(e._sorted){const{iScale:s,_parsed:a}=e,l=s.axis,{min:c,max:d,minDefined:f,maxDefined:g}=s.getUserBounds();f&&(i=kn(Math.min(ao(a,l,c).lo,n?r:ao(t,l,s.getPixelForValue(c)).lo),0,r-1)),g?o=kn(Math.max(ao(a,s.axis,d,!0).hi+1,n?0:ao(t,l,s.getPixelForValue(d),!0).hi+1),i,r)-i:o=r-i}return{start:i,count:o}}function BS(e){const{xScale:t,yScale:n,_scaleRanges:r}=e,i={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=i,!0;const o=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,i),o}const Bf=e=>e===0||e===1,VS=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Xt/n)),HS=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Xt/n)+1,Zc={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*dn)+1,easeOutSine:e=>Math.sin(e*dn),easeInOutSine:e=>-.5*(Math.cos(Kt*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>Bf(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>Bf(e)?e:VS(e,.075,.3),easeOutElastic:e=>Bf(e)?e:HS(e,.075,.3),easeInOutElastic(e){return Bf(e)?e:e<.5?.5*VS(e*2,.1125,.45):.5+.5*HS(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-Zc.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?Zc.easeInBounce(e*2)*.5:Zc.easeOutBounce(e*2-1)*.5+.5};function Vv(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function WS(e){return Vv(e)?e:new Yc(e)}function Hv(e){return Vv(e)?e:new Yc(e).saturate(.5).darken(.1).hexString()}const YL=["x","y","borderWidth","radius","tension"],KL=["color","borderColor","backgroundColor"];function XL(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:KL},numbers:{type:"number",properties:YL}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function QL(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const qS=new Map;function JL(e,t){t=t||{};const n=e+JSON.stringify(t);let r=qS.get(n);return r||(r=new Intl.NumberFormat(e,t),qS.set(n,r)),r}function eu(e,t,n){return JL(t,n).format(e)}const US={values(e){return Yt(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const r=this.chart.options.locale;let i,o=e;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(i="scientific"),o=ZL(e,n)}const s=qo(Math.abs(o)),a=isNaN(s)?1:Math.max(Math.min(-1*Math.floor(s),20),0),l={notation:i,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),eu(e,r,l)},logarithmic(e,t,n){if(e===0)return"0";const r=n[t].significand||e/Math.pow(10,Math.floor(qo(e)));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?US.numeric.call(this,e,t,n):""}};function ZL(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var Vf={formatters:US};function e9(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,n)=>n.lineWidth,tickColor:(t,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Vf.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Gs=Object.create(null),Wv=Object.create(null);function tu(e,t){if(!t)return e;const n=t.split(".");for(let r=0,i=n.length;r<i;++r){const o=n[r];e=e[o]||(e[o]=Object.create(null))}return e}function qv(e,t,n){return typeof t=="string"?Ai(tu(e,t),n):Ai(tu(e,""),t)}class t9{constructor(t,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=r=>r.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(r,i)=>Hv(i.backgroundColor),this.hoverBorderColor=(r,i)=>Hv(i.borderColor),this.hoverColor=(r,i)=>Hv(i.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return qv(this,t,n)}get(t){return tu(this,t)}describe(t,n){return qv(Wv,t,n)}override(t,n){return qv(Gs,t,n)}route(t,n,r,i){const o=tu(this,t),s=tu(this,r),a="_"+n;Object.defineProperties(o,{[a]:{value:o[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=s[i];return wt(l)?Object.assign({},c,l):tt(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var on=new t9({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[XL,QL,e9]);function n9(e){return!e||gt(e.size)||gt(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Hf(e,t,n,r,i){let o=t[i];return o||(o=t[i]=e.measureText(i).width,n.push(i)),o>r&&(r=o),r}function r9(e,t,n,r){r=r||{};let i=r.data=r.data||{},o=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(i=r.data={},o=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let s=0;const a=n.length;let l,c,d,f,g;for(l=0;l<a;l++)if(f=n[l],f!=null&&!Yt(f))s=Hf(e,i,o,s,f);else if(Yt(f))for(c=0,d=f.length;c<d;c++)g=f[c],g!=null&&!Yt(g)&&(s=Hf(e,i,o,s,g));e.restore();const p=o.length/2;if(p>n.length){for(l=0;l<p;l++)delete i[o[l]];o.splice(0,p)}return s}function Ys(e,t,n){const r=e.currentDevicePixelRatio,i=n!==0?Math.max(n/2,.5):0;return Math.round((t-i)*r)/r+i}function GS(e,t){t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore()}function Uv(e,t,n,r){YS(e,t,n,r,null)}function YS(e,t,n,r,i){let o,s,a,l,c,d,f,g;const p=t.pointStyle,v=t.rotation,y=t.radius;let x=(v||0)*FL;if(p&&typeof p=="object"&&(o=p.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){e.save(),e.translate(n,r),e.rotate(x),e.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),e.restore();return}if(!(isNaN(y)||y<=0)){switch(e.beginPath(),p){default:i?e.ellipse(n,r,i/2,y,0,0,Xt):e.arc(n,r,y,0,Xt),e.closePath();break;case"triangle":d=i?i/2:y,e.moveTo(n+Math.sin(x)*d,r-Math.cos(x)*y),x+=DS,e.lineTo(n+Math.sin(x)*d,r-Math.cos(x)*y),x+=DS,e.lineTo(n+Math.sin(x)*d,r-Math.cos(x)*y),e.closePath();break;case"rectRounded":c=y*.516,l=y-c,s=Math.cos(x+Us)*l,f=Math.cos(x+Us)*(i?i/2-c:l),a=Math.sin(x+Us)*l,g=Math.sin(x+Us)*(i?i/2-c:l),e.arc(n-f,r-a,c,x-Kt,x-dn),e.arc(n+g,r-s,c,x-dn,x),e.arc(n+f,r+a,c,x,x+dn),e.arc(n-g,r+s,c,x+dn,x+Kt),e.closePath();break;case"rect":if(!v){l=Math.SQRT1_2*y,d=i?i/2:l,e.rect(n-d,r-l,2*d,2*l);break}x+=Us;case"rectRot":f=Math.cos(x)*(i?i/2:y),s=Math.cos(x)*y,a=Math.sin(x)*y,g=Math.sin(x)*(i?i/2:y),e.moveTo(n-f,r-a),e.lineTo(n+g,r-s),e.lineTo(n+f,r+a),e.lineTo(n-g,r+s),e.closePath();break;case"crossRot":x+=Us;case"cross":f=Math.cos(x)*(i?i/2:y),s=Math.cos(x)*y,a=Math.sin(x)*y,g=Math.sin(x)*(i?i/2:y),e.moveTo(n-f,r-a),e.lineTo(n+f,r+a),e.moveTo(n+g,r-s),e.lineTo(n-g,r+s);break;case"star":f=Math.cos(x)*(i?i/2:y),s=Math.cos(x)*y,a=Math.sin(x)*y,g=Math.sin(x)*(i?i/2:y),e.moveTo(n-f,r-a),e.lineTo(n+f,r+a),e.moveTo(n+g,r-s),e.lineTo(n-g,r+s),x+=Us,f=Math.cos(x)*(i?i/2:y),s=Math.cos(x)*y,a=Math.sin(x)*y,g=Math.sin(x)*(i?i/2:y),e.moveTo(n-f,r-a),e.lineTo(n+f,r+a),e.moveTo(n+g,r-s),e.lineTo(n-g,r+s);break;case"line":s=i?i/2:Math.cos(x)*y,a=Math.sin(x)*y,e.moveTo(n-s,r-a),e.lineTo(n+s,r+a);break;case"dash":e.moveTo(n,r),e.lineTo(n+Math.cos(x)*(i?i/2:y),r+Math.sin(x)*y);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function lo(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function Wf(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function qf(e){e.restore()}function i9(e,t,n,r,i){if(!t)return e.lineTo(n.x,n.y);if(i==="middle"){const o=(t.x+n.x)/2;e.lineTo(o,t.y),e.lineTo(o,n.y)}else i==="after"!=!!r?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function o9(e,t,n,r){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(r?t.cp1x:t.cp2x,r?t.cp1y:t.cp2y,r?n.cp2x:n.cp1x,r?n.cp2y:n.cp1y,n.x,n.y)}function s9(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),gt(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function a9(e,t,n,r,i){if(i.strikethrough||i.underline){const o=e.measureText(r),s=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=n-o.actualBoundingBoxAscent,c=n+o.actualBoundingBoxDescent,d=i.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=i.decorationWidth||2,e.moveTo(s,d),e.lineTo(a,d),e.stroke()}}function l9(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Ks(e,t,n,r,i,o={}){const s=Yt(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(e.save(),e.font=i.string,s9(e,o),l=0;l<s.length;++l)c=s[l],o.backdrop&&l9(e,o.backdrop),a&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),gt(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(c,n,r,o.maxWidth)),e.fillText(c,n,r,o.maxWidth),a9(e,n,r,c,o),r+=Number(i.lineHeight);e.restore()}function nu(e,t){const{x:n,y:r,w:i,h:o,radius:s}=t;e.arc(n+s.topLeft,r+s.topLeft,s.topLeft,1.5*Kt,Kt,!0),e.lineTo(n,r+o-s.bottomLeft),e.arc(n+s.bottomLeft,r+o-s.bottomLeft,s.bottomLeft,Kt,dn,!0),e.lineTo(n+i-s.bottomRight,r+o),e.arc(n+i-s.bottomRight,r+o-s.bottomRight,s.bottomRight,dn,0,!0),e.lineTo(n+i,r+s.topRight),e.arc(n+i-s.topRight,r+s.topRight,s.topRight,0,-dn,!0),e.lineTo(n+s.topLeft,r)}const c9=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,u9=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function d9(e,t){const n=(""+e).match(c9);if(!n||n[1]==="normal")return t*1.2;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100;break}return t*e}const f9=e=>+e||0;function Gv(e,t){const n={},r=wt(t),i=r?Object.keys(t):t,o=wt(e)?r?s=>tt(e[s],e[t[s]]):s=>e[s]:()=>e;for(const s of i)n[s]=f9(o(s));return n}function KS(e){return Gv(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Xs(e){return Gv(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Rn(e){const t=KS(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function bn(e,t){e=e||{},t=t||on.font;let n=tt(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=tt(e.style,t.style);r&&!(""+r).match(u9)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const i={family:tt(e.family,t.family),lineHeight:d9(tt(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:tt(e.weight,t.weight),string:""};return i.string=n9(i),i}function Qt(e,t,n,r){let i=!0,o,s,a;for(o=0,s=e.length;o<s;++o)if(a=e[o],a!==void 0&&(t!==void 0&&typeof a=="function"&&(a=a(t),i=!1),n!==void 0&&Yt(a)&&(a=a[n%a.length],i=!1),a!==void 0))return r&&!i&&(r.cacheable=!1),a}function h9(e,t,n){const{min:r,max:i}=e,o=OS(t,(i-r)/2),s=(a,l)=>n&&a===0?0:a+l;return{min:s(r,-Math.abs(o)),max:s(i,o)}}function Uo(e,t){return Object.assign(Object.create(e),t)}function Yv(e,t=[""],n,r,i=()=>e[0]){const o=n||e;typeof r>"u"&&(r=eC("_fallback",e));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:r,_getTarget:i,override:a=>Yv([a,...e],t,o,r)};return new Proxy(s,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return QS(a,l,()=>w9(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return tC(a).includes(l)},ownKeys(a){return tC(a)},set(a,l,c){const d=a._storage||(a._storage=i());return a[l]=d[l]=c,delete a._keys,!0}})}function pl(e,t,n,r){const i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:XS(e,r),setContext:o=>pl(e,o,n,r),override:o=>pl(e.override(o),t,n,r)};return new Proxy(i,{deleteProperty(o,s){return delete o[s],delete e[s],!0},get(o,s,a){return QS(o,s,()=>g9(o,s,a))},getOwnPropertyDescriptor(o,s){return o._descriptors.allKeys?Reflect.has(e,s)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,s)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(o,s){return Reflect.has(e,s)},ownKeys(){return Reflect.ownKeys(e)},set(o,s,a){return e[s]=a,delete o[s],!0}})}function XS(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:i=t.allKeys}=e;return{allKeys:i,scriptable:n,indexable:r,isScriptable:Wo(n)?n:()=>n,isIndexable:Wo(r)?r:()=>r}}const p9=(e,t)=>e?e+$v(t):t,Kv=(e,t)=>wt(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function QS(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];const r=n();return e[t]=r,r}function g9(e,t,n){const{_proxy:r,_context:i,_subProxy:o,_descriptors:s}=e;let a=r[t];return Wo(a)&&s.isScriptable(t)&&(a=m9(t,a,e,n)),Yt(a)&&a.length&&(a=v9(t,a,e,s.isIndexable)),Kv(t,a)&&(a=pl(a,i,o&&o[t],s)),a}function m9(e,t,n,r){const{_proxy:i,_context:o,_subProxy:s,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(o,s||r);return a.delete(e),Kv(e,l)&&(l=Xv(i._scopes,i,e,l)),l}function v9(e,t,n,r){const{_proxy:i,_context:o,_subProxy:s,_descriptors:a}=n;if(typeof o.index<"u"&&r(e))return t[o.index%t.length];if(wt(t[0])){const l=t,c=i._scopes.filter(d=>d!==l);t=[];for(const d of l){const f=Xv(c,i,e,d);t.push(pl(f,o,s&&s[e],a))}}return t}function JS(e,t,n){return Wo(e)?e(t,n):e}const b9=(e,t)=>e===!0?t:typeof e=="string"?Ho(t,e):void 0;function y9(e,t,n,r,i){for(const o of t){const s=b9(n,o);if(s){e.add(s);const a=JS(s._fallback,n,i);if(typeof a<"u"&&a!==n&&a!==r)return a}else if(s===!1&&typeof r<"u"&&n!==r)return null}return!1}function Xv(e,t,n,r){const i=t._rootScopes,o=JS(t._fallback,n,r),s=[...e,...i],a=new Set;a.add(r);let l=ZS(a,s,n,o||n,r);return l===null||typeof o<"u"&&o!==n&&(l=ZS(a,s,o,l,r),l===null)?!1:Yv(Array.from(a),[""],i,o,()=>x9(t,n,r))}function ZS(e,t,n,r,i){for(;n;)n=y9(e,t,n,r,i);return n}function x9(e,t,n){const r=e._getTarget();t in r||(r[t]={});const i=r[t];return Yt(i)&&wt(n)?n:i||{}}function w9(e,t,n,r){let i;for(const o of t)if(i=eC(p9(o,e),n),typeof i<"u")return Kv(e,i)?Xv(n,r,e,i):i}function eC(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function tC(e){let t=e._keys;return t||(t=e._keys=_9(e._scopes)),t}function _9(e){const t=new Set;for(const n of e)for(const r of Object.keys(n).filter(i=>!i.startsWith("_")))t.add(r);return Array.from(t)}function nC(e,t,n,r){const{iScale:i}=e,{key:o="r"}=this._parsing,s=new Array(r);let a,l,c,d;for(a=0,l=r;a<l;++a)c=a+n,d=t[c],s[a]={r:i.parse(Ho(d,o),c)};return s}const S9=Number.EPSILON||1e-14,gl=(e,t)=>t<e.length&&!e[t].skip&&e[t],rC=e=>e==="x"?"y":"x";function C9(e,t,n,r){const i=e.skip?t:e,o=t,s=n.skip?t:n,a=jv(o,i),l=jv(s,o);let c=a/(a+l),d=l/(a+l);c=isNaN(c)?0:c,d=isNaN(d)?0:d;const f=r*c,g=r*d;return{previous:{x:o.x-f*(s.x-i.x),y:o.y-f*(s.y-i.y)},next:{x:o.x+g*(s.x-i.x),y:o.y+g*(s.y-i.y)}}}function E9(e,t,n){const r=e.length;let i,o,s,a,l,c=gl(e,0);for(let d=0;d<r-1;++d)if(l=c,c=gl(e,d+1),!(!l||!c)){if(Qc(t[d],0,S9)){n[d]=n[d+1]=0;continue}i=n[d]/t[d],o=n[d+1]/t[d],a=Math.pow(i,2)+Math.pow(o,2),!(a<=9)&&(s=3/Math.sqrt(a),n[d]=i*s*t[d],n[d+1]=o*s*t[d])}}function O9(e,t,n="x"){const r=rC(n),i=e.length;let o,s,a,l=gl(e,0);for(let c=0;c<i;++c){if(s=a,a=l,l=gl(e,c+1),!a)continue;const d=a[n],f=a[r];s&&(o=(d-s[n])/3,a[`cp1${n}`]=d-o,a[`cp1${r}`]=f-o*t[c]),l&&(o=(l[n]-d)/3,a[`cp2${n}`]=d+o,a[`cp2${r}`]=f+o*t[c])}}function P9(e,t="x"){const n=rC(t),r=e.length,i=Array(r).fill(0),o=Array(r);let s,a,l,c=gl(e,0);for(s=0;s<r;++s)if(a=l,l=c,c=gl(e,s+1),!!l){if(c){const d=c[t]-l[t];i[s]=d!==0?(c[n]-l[n])/d:0}o[s]=a?c?Ii(i[s-1])!==Ii(i[s])?0:(i[s-1]+i[s])/2:i[s-1]:i[s]}E9(e,i,o),O9(e,o,t)}function Uf(e,t,n){return Math.max(Math.min(e,n),t)}function k9(e,t){let n,r,i,o,s,a=lo(e[0],t);for(n=0,r=e.length;n<r;++n)s=o,o=a,a=n<r-1&&lo(e[n+1],t),o&&(i=e[n],s&&(i.cp1x=Uf(i.cp1x,t.left,t.right),i.cp1y=Uf(i.cp1y,t.top,t.bottom)),a&&(i.cp2x=Uf(i.cp2x,t.left,t.right),i.cp2y=Uf(i.cp2y,t.top,t.bottom)))}function M9(e,t,n,r,i){let o,s,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")P9(e,i);else{let c=r?e[e.length-1]:e[0];for(o=0,s=e.length;o<s;++o)a=e[o],l=C9(c,a,e[Math.min(o+1,s-(r?0:1))%s],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&k9(e,n)}function Qv(){return typeof window<"u"&&typeof document<"u"}function Jv(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Gf(e,t,n){let r;return typeof e=="string"?(r=parseInt(e,10),e.indexOf("%")!==-1&&(r=r/100*t.parentNode[n])):r=e,r}const Yf=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function D9(e,t){return Yf(e).getPropertyValue(t)}const T9=["top","right","bottom","left"];function Qs(e,t,n){const r={};n=n?"-"+n:"";for(let i=0;i<4;i++){const o=T9[i];r[o]=parseFloat(e[t+"-"+o+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const A9=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function I9(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:o}=r;let s=!1,a,l;if(A9(i,o,e.target))a=i,l=o;else{const c=t.getBoundingClientRect();a=r.clientX-c.left,l=r.clientY-c.top,s=!0}return{x:a,y:l,box:s}}function Js(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,i=Yf(n),o=i.boxSizing==="border-box",s=Qs(i,"padding"),a=Qs(i,"border","width"),{x:l,y:c,box:d}=I9(e,n),f=s.left+(d&&a.left),g=s.top+(d&&a.top);let{width:p,height:v}=t;return o&&(p-=s.width+a.width,v-=s.height+a.height),{x:Math.round((l-f)/p*n.width/r),y:Math.round((c-g)/v*n.height/r)}}function N9(e,t,n){let r,i;if(t===void 0||n===void 0){const o=Jv(e);if(!o)t=e.clientWidth,n=e.clientHeight;else{const s=o.getBoundingClientRect(),a=Yf(o),l=Qs(a,"border","width"),c=Qs(a,"padding");t=s.width-c.width-l.width,n=s.height-c.height-l.height,r=Gf(a.maxWidth,o,"clientWidth"),i=Gf(a.maxHeight,o,"clientHeight")}}return{width:t,height:n,maxWidth:r||zf,maxHeight:i||zf}}const Kf=e=>Math.round(e*10)/10;function R9(e,t,n,r){const i=Yf(e),o=Qs(i,"margin"),s=Gf(i.maxWidth,e,"clientWidth")||zf,a=Gf(i.maxHeight,e,"clientHeight")||zf,l=N9(e,t,n);let{width:c,height:d}=l;if(i.boxSizing==="content-box"){const g=Qs(i,"border","width"),p=Qs(i,"padding");c-=p.width+g.width,d-=p.height+g.height}return c=Math.max(0,c-o.width),d=Math.max(0,r?c/r:d-o.height),c=Kf(Math.min(c,s,l.maxWidth)),d=Kf(Math.min(d,a,l.maxHeight)),c&&!d&&(d=Kf(c/2)),(t!==void 0||n!==void 0)&&r&&l.height&&d>l.height&&(d=l.height,c=Kf(Math.floor(d*r))),{width:c,height:d}}function iC(e,t,n){const r=t||1,i=Math.floor(e.height*r),o=Math.floor(e.width*r);e.height=Math.floor(e.height),e.width=Math.floor(e.width);const s=e.canvas;return s.style&&(n||!s.style.height&&!s.style.width)&&(s.style.height=`${e.height}px`,s.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||s.height!==i||s.width!==o?(e.currentDevicePixelRatio=r,s.height=i,s.width=o,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}const L9=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};Qv()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function oC(e,t){const n=D9(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function Zs(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function $9(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:r==="middle"?n<.5?e.y:t.y:r==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function F9(e,t,n,r){const i={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},s=Zs(e,i,n),a=Zs(i,o,n),l=Zs(o,t,n),c=Zs(s,a,n),d=Zs(a,l,n);return Zs(c,d,n)}const j9=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,r){return n-r},leftForLtr(n,r){return n-r}}},z9=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function ml(e,t,n){return e?j9(t,n):z9()}function sC(e,t){let n,r;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,r=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=r)}function aC(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function lC(e){return e==="angle"?{between:Jc,compare:BL,normalize:Pr}:{between:so,compare:(t,n)=>t-n,normalize:t=>t}}function cC({start:e,end:t,count:n,loop:r,style:i}){return{start:e%n,end:t%n,loop:r&&(t-e+1)%n===0,style:i}}function B9(e,t,n){const{property:r,start:i,end:o}=n,{between:s,normalize:a}=lC(r),l=t.length;let{start:c,end:d,loop:f}=e,g,p;if(f){for(c+=l,d+=l,g=0,p=l;g<p&&s(a(t[c%l][r]),i,o);++g)c--,d--;c%=l,d%=l}return d<c&&(d+=l),{start:c,end:d,loop:f,style:e.style}}function uC(e,t,n){if(!n)return[e];const{property:r,start:i,end:o}=n,s=t.length,{compare:a,between:l,normalize:c}=lC(r),{start:d,end:f,loop:g,style:p}=B9(e,t,n),v=[];let y=!1,x=null,w,S,C;const P=()=>l(i,C,w)&&a(i,C)!==0,O=()=>a(o,w)===0||l(o,C,w),k=()=>y||P(),A=()=>!y||O();for(let L=d,F=d;L<=f;++L)S=t[L%s],!S.skip&&(w=c(S[r]),w!==C&&(y=l(w,i,o),x===null&&k()&&(x=a(w,i)===0?L:F),x!==null&&A()&&(v.push(cC({start:x,end:L,loop:g,count:s,style:p})),x=null),F=L,C=w));return x!==null&&v.push(cC({start:x,end:f,loop:g,count:s,style:p})),v}function dC(e,t){const n=[],r=e.segments;for(let i=0;i<r.length;i++){const o=uC(r[i],e.points,t);o.length&&n.push(...o)}return n}function V9(e,t,n,r){let i=0,o=t-1;if(n&&!r)for(;i<t&&!e[i].skip;)i++;for(;i<t&&e[i].skip;)i++;for(i%=t,n&&(o+=i);o>i&&e[o%t].skip;)o--;return o%=t,{start:i,end:o}}function H9(e,t,n,r){const i=e.length,o=[];let s=t,a=e[t],l;for(l=t+1;l<=n;++l){const c=e[l%i];c.skip||c.stop?a.skip||(r=!1,o.push({start:t%i,end:(l-1)%i,loop:r}),t=s=c.stop?l:null):(s=l,a.skip&&(t=l)),a=c}return s!==null&&o.push({start:t%i,end:s%i,loop:r}),o}function W9(e,t){const n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];const o=!!e._loop,{start:s,end:a}=V9(n,i,o,r);if(r===!0)return fC(e,[{start:s,end:a,loop:o}],n,t);const l=a<s?a+i:a,c=!!e._fullLoop&&s===0&&a===i-1;return fC(e,H9(n,s,l,c),n,t)}function fC(e,t,n,r){return!r||!r.setContext||!n?t:q9(e,t,n,r)}function q9(e,t,n,r){const i=e._chart.getContext(),o=hC(e.options),{_datasetIndex:s,options:{spanGaps:a}}=e,l=n.length,c=[];let d=o,f=t[0].start,g=f;function p(v,y,x,w){const S=a?-1:1;if(v!==y){for(v+=l;n[v%l].skip;)v-=S;for(;n[y%l].skip;)y+=S;v%l!==y%l&&(c.push({start:v%l,end:y%l,loop:x,style:w}),d=w,f=y%l)}}for(const v of t){f=a?f:v.start;let y=n[f%l],x;for(g=f+1;g<=v.end;g++){const w=n[g%l];x=hC(r.setContext(Uo(i,{type:"segment",p0:y,p1:w,p0DataIndex:(g-1)%l,p1DataIndex:g%l,datasetIndex:s}))),U9(x,d)&&p(f,g-1,v.loop,d),y=w,d=x}f<g-1&&p(f,g-1,v.loop,d)}return c}function hC(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function U9(e,t){if(!t)return!1;const n=[],r=function(i,o){return Vv(o)?(n.includes(o)||n.push(o),n.indexOf(o)):o};return JSON.stringify(e,r)!==JSON.stringify(t,r)}/*!
|
|
116
|
+
*/function oo(){}const DL=(()=>{let e=0;return()=>e++})();function gt(e){return e===null||typeof e>"u"}function Yt(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function wt(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function ln(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Or(e,t){return ln(e)?e:t}function tt(e,t){return typeof e>"u"?t:e}const TL=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,OS=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Ft(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function Nt(e,t,n,r){let i,o,s;if(Yt(e))if(o=e.length,r)for(i=o-1;i>=0;i--)t.call(n,e[i],i);else for(i=0;i<o;i++)t.call(n,e[i],i);else if(wt(e))for(s=Object.keys(e),o=s.length,i=0;i<o;i++)t.call(n,e[s[i]],s[i])}function Ff(e,t){let n,r,i,o;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(i=e[n],o=t[n],i.datasetIndex!==o.datasetIndex||i.index!==o.index)return!1;return!0}function jf(e){if(Yt(e))return e.map(jf);if(wt(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let i=0;for(;i<r;++i)t[n[i]]=jf(e[n[i]]);return t}return e}function PS(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function AL(e,t,n,r){if(!PS(e))return;const i=t[e],o=n[e];wt(i)&&wt(o)?Ai(i,o,r):t[e]=jf(o)}function Ai(e,t,n){const r=Yt(t)?t:[t],i=r.length;if(!wt(e))return e;n=n||{};const o=n.merger||AL;let s;for(let a=0;a<i;++a){if(s=r[a],!wt(s))continue;const l=Object.keys(s);for(let c=0,d=l.length;c<d;++c)o(l[c],e,s,n)}return e}function Kc(e,t){return Ai(e,t,{merger:IL})}function IL(e,t,n){if(!PS(e))return;const r=t[e],i=n[e];wt(r)&&wt(i)?Kc(r,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=jf(i))}const kS={"":e=>e,x:e=>e.x,y:e=>e.y};function NL(e){const t=e.split("."),n=[];let r="";for(const i of t)r+=i,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function RL(e){const t=NL(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function Ho(e,t){return(kS[t]||(kS[t]=RL(t)))(e)}function $v(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Xc=e=>typeof e<"u",Wo=e=>typeof e=="function",MS=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function LL(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Kt=Math.PI,Xt=2*Kt,$L=Xt+Kt,zf=Number.POSITIVE_INFINITY,FL=Kt/180,dn=Kt/2,Us=Kt/4,DS=Kt*2/3,qo=Math.log10,Ii=Math.sign;function Qc(e,t,n){return Math.abs(e-t)<n}function TS(e){const t=Math.round(e);e=Qc(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(qo(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function jL(e){const t=[],n=Math.sqrt(e);let r;for(r=1;r<n;r++)e%r===0&&(t.push(r),t.push(e/r));return n===(n|0)&&t.push(n),t.sort((i,o)=>i-o).pop(),t}function hl(e){return!isNaN(parseFloat(e))&&isFinite(e)}function zL(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function AS(e,t,n){let r,i,o;for(r=0,i=e.length;r<i;r++)o=e[r][n],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function mi(e){return e*(Kt/180)}function Fv(e){return e*(180/Kt)}function IS(e){if(!ln(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function NS(e,t){const n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r);let o=Math.atan2(r,n);return o<-.5*Kt&&(o+=Xt),{angle:o,distance:i}}function jv(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function BL(e,t){return(e-t+$L)%Xt-Kt}function Pr(e){return(e%Xt+Xt)%Xt}function Jc(e,t,n,r){const i=Pr(e),o=Pr(t),s=Pr(n),a=Pr(o-i),l=Pr(s-i),c=Pr(i-o),d=Pr(i-s);return i===o||i===s||r&&o===s||a>l&&c<d}function kn(e,t,n){return Math.max(t,Math.min(n,e))}function VL(e){return kn(e,-32768,32767)}function so(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function zv(e,t,n){n=n||(s=>e[s]<t);let r=e.length-1,i=0,o;for(;r-i>1;)o=i+r>>1,n(o)?i=o:r=o;return{lo:i,hi:r}}const ao=(e,t,n,r)=>zv(e,n,r?i=>{const o=e[i][t];return o<n||o===n&&e[i+1][t]===n}:i=>e[i][t]<n),HL=(e,t,n)=>zv(e,n,r=>e[r][t]>=n);function WL(e,t,n){let r=0,i=e.length;for(;r<i&&e[r]<t;)r++;for(;i>r&&e[i-1]>n;)i--;return r>0||i<e.length?e.slice(r,i):e}const RS=["push","pop","shift","splice","unshift"];function qL(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),RS.forEach(n=>{const r="_onData"+$v(n),i=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...o){const s=i.apply(this,o);return e._chartjs.listeners.forEach(a=>{typeof a[r]=="function"&&a[r](...o)}),s}})})}function LS(e,t){const n=e._chartjs;if(!n)return;const r=n.listeners,i=r.indexOf(t);i!==-1&&r.splice(i,1),!(r.length>0)&&(RS.forEach(o=>{delete e[o]}),delete e._chartjs)}function $S(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const FS=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function jS(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,FS.call(window,()=>{r=!1,e.apply(t,n)}))}}function UL(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const Bv=e=>e==="start"?"left":e==="end"?"right":"center",qn=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,GL=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function zS(e,t,n){const r=t.length;let i=0,o=r;if(e._sorted){const{iScale:s,_parsed:a}=e,l=s.axis,{min:c,max:d,minDefined:f,maxDefined:g}=s.getUserBounds();f&&(i=kn(Math.min(ao(a,l,c).lo,n?r:ao(t,l,s.getPixelForValue(c)).lo),0,r-1)),g?o=kn(Math.max(ao(a,s.axis,d,!0).hi+1,n?0:ao(t,l,s.getPixelForValue(d),!0).hi+1),i,r)-i:o=r-i}return{start:i,count:o}}function BS(e){const{xScale:t,yScale:n,_scaleRanges:r}=e,i={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=i,!0;const o=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,i),o}const Bf=e=>e===0||e===1,VS=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Xt/n)),HS=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Xt/n)+1,Zc={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*dn)+1,easeOutSine:e=>Math.sin(e*dn),easeInOutSine:e=>-.5*(Math.cos(Kt*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>Bf(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>Bf(e)?e:VS(e,.075,.3),easeOutElastic:e=>Bf(e)?e:HS(e,.075,.3),easeInOutElastic(e){return Bf(e)?e:e<.5?.5*VS(e*2,.1125,.45):.5+.5*HS(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-Zc.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?Zc.easeInBounce(e*2)*.5:Zc.easeOutBounce(e*2-1)*.5+.5};function Vv(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function WS(e){return Vv(e)?e:new Yc(e)}function Hv(e){return Vv(e)?e:new Yc(e).saturate(.5).darken(.1).hexString()}const YL=["x","y","borderWidth","radius","tension"],KL=["color","borderColor","backgroundColor"];function XL(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:KL},numbers:{type:"number",properties:YL}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function QL(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const qS=new Map;function JL(e,t){t=t||{};const n=e+JSON.stringify(t);let r=qS.get(n);return r||(r=new Intl.NumberFormat(e,t),qS.set(n,r)),r}function eu(e,t,n){return JL(t,n).format(e)}const US={values(e){return Yt(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const r=this.chart.options.locale;let i,o=e;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(i="scientific"),o=ZL(e,n)}const s=qo(Math.abs(o)),a=isNaN(s)?1:Math.max(Math.min(-1*Math.floor(s),20),0),l={notation:i,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),eu(e,r,l)},logarithmic(e,t,n){if(e===0)return"0";const r=n[t].significand||e/Math.pow(10,Math.floor(qo(e)));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?US.numeric.call(this,e,t,n):""}};function ZL(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var Vf={formatters:US};function e9(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,n)=>n.lineWidth,tickColor:(t,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Vf.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Gs=Object.create(null),Wv=Object.create(null);function tu(e,t){if(!t)return e;const n=t.split(".");for(let r=0,i=n.length;r<i;++r){const o=n[r];e=e[o]||(e[o]=Object.create(null))}return e}function qv(e,t,n){return typeof t=="string"?Ai(tu(e,t),n):Ai(tu(e,""),t)}class t9{constructor(t,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=r=>r.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(r,i)=>Hv(i.backgroundColor),this.hoverBorderColor=(r,i)=>Hv(i.borderColor),this.hoverColor=(r,i)=>Hv(i.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return qv(this,t,n)}get(t){return tu(this,t)}describe(t,n){return qv(Wv,t,n)}override(t,n){return qv(Gs,t,n)}route(t,n,r,i){const o=tu(this,t),s=tu(this,r),a="_"+n;Object.defineProperties(o,{[a]:{value:o[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=s[i];return wt(l)?Object.assign({},c,l):tt(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var on=new t9({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[XL,QL,e9]);function n9(e){return!e||gt(e.size)||gt(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Hf(e,t,n,r,i){let o=t[i];return o||(o=t[i]=e.measureText(i).width,n.push(i)),o>r&&(r=o),r}function r9(e,t,n,r){r=r||{};let i=r.data=r.data||{},o=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(i=r.data={},o=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let s=0;const a=n.length;let l,c,d,f,g;for(l=0;l<a;l++)if(f=n[l],f!=null&&!Yt(f))s=Hf(e,i,o,s,f);else if(Yt(f))for(c=0,d=f.length;c<d;c++)g=f[c],g!=null&&!Yt(g)&&(s=Hf(e,i,o,s,g));e.restore();const p=o.length/2;if(p>n.length){for(l=0;l<p;l++)delete i[o[l]];o.splice(0,p)}return s}function Ys(e,t,n){const r=e.currentDevicePixelRatio,i=n!==0?Math.max(n/2,.5):0;return Math.round((t-i)*r)/r+i}function GS(e,t){t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore()}function Uv(e,t,n,r){YS(e,t,n,r,null)}function YS(e,t,n,r,i){let o,s,a,l,c,d,f,g;const p=t.pointStyle,v=t.rotation,y=t.radius;let x=(v||0)*FL;if(p&&typeof p=="object"&&(o=p.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){e.save(),e.translate(n,r),e.rotate(x),e.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),e.restore();return}if(!(isNaN(y)||y<=0)){switch(e.beginPath(),p){default:i?e.ellipse(n,r,i/2,y,0,0,Xt):e.arc(n,r,y,0,Xt),e.closePath();break;case"triangle":d=i?i/2:y,e.moveTo(n+Math.sin(x)*d,r-Math.cos(x)*y),x+=DS,e.lineTo(n+Math.sin(x)*d,r-Math.cos(x)*y),x+=DS,e.lineTo(n+Math.sin(x)*d,r-Math.cos(x)*y),e.closePath();break;case"rectRounded":c=y*.516,l=y-c,s=Math.cos(x+Us)*l,f=Math.cos(x+Us)*(i?i/2-c:l),a=Math.sin(x+Us)*l,g=Math.sin(x+Us)*(i?i/2-c:l),e.arc(n-f,r-a,c,x-Kt,x-dn),e.arc(n+g,r-s,c,x-dn,x),e.arc(n+f,r+a,c,x,x+dn),e.arc(n-g,r+s,c,x+dn,x+Kt),e.closePath();break;case"rect":if(!v){l=Math.SQRT1_2*y,d=i?i/2:l,e.rect(n-d,r-l,2*d,2*l);break}x+=Us;case"rectRot":f=Math.cos(x)*(i?i/2:y),s=Math.cos(x)*y,a=Math.sin(x)*y,g=Math.sin(x)*(i?i/2:y),e.moveTo(n-f,r-a),e.lineTo(n+g,r-s),e.lineTo(n+f,r+a),e.lineTo(n-g,r+s),e.closePath();break;case"crossRot":x+=Us;case"cross":f=Math.cos(x)*(i?i/2:y),s=Math.cos(x)*y,a=Math.sin(x)*y,g=Math.sin(x)*(i?i/2:y),e.moveTo(n-f,r-a),e.lineTo(n+f,r+a),e.moveTo(n+g,r-s),e.lineTo(n-g,r+s);break;case"star":f=Math.cos(x)*(i?i/2:y),s=Math.cos(x)*y,a=Math.sin(x)*y,g=Math.sin(x)*(i?i/2:y),e.moveTo(n-f,r-a),e.lineTo(n+f,r+a),e.moveTo(n+g,r-s),e.lineTo(n-g,r+s),x+=Us,f=Math.cos(x)*(i?i/2:y),s=Math.cos(x)*y,a=Math.sin(x)*y,g=Math.sin(x)*(i?i/2:y),e.moveTo(n-f,r-a),e.lineTo(n+f,r+a),e.moveTo(n+g,r-s),e.lineTo(n-g,r+s);break;case"line":s=i?i/2:Math.cos(x)*y,a=Math.sin(x)*y,e.moveTo(n-s,r-a),e.lineTo(n+s,r+a);break;case"dash":e.moveTo(n,r),e.lineTo(n+Math.cos(x)*(i?i/2:y),r+Math.sin(x)*y);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function lo(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function Wf(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function qf(e){e.restore()}function i9(e,t,n,r,i){if(!t)return e.lineTo(n.x,n.y);if(i==="middle"){const o=(t.x+n.x)/2;e.lineTo(o,t.y),e.lineTo(o,n.y)}else i==="after"!=!!r?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function o9(e,t,n,r){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(r?t.cp1x:t.cp2x,r?t.cp1y:t.cp2y,r?n.cp2x:n.cp1x,r?n.cp2y:n.cp1y,n.x,n.y)}function s9(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),gt(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function a9(e,t,n,r,i){if(i.strikethrough||i.underline){const o=e.measureText(r),s=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=n-o.actualBoundingBoxAscent,c=n+o.actualBoundingBoxDescent,d=i.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=i.decorationWidth||2,e.moveTo(s,d),e.lineTo(a,d),e.stroke()}}function l9(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Ks(e,t,n,r,i,o={}){const s=Yt(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(e.save(),e.font=i.string,s9(e,o),l=0;l<s.length;++l)c=s[l],o.backdrop&&l9(e,o.backdrop),a&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),gt(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(c,n,r,o.maxWidth)),e.fillText(c,n,r,o.maxWidth),a9(e,n,r,c,o),r+=Number(i.lineHeight);e.restore()}function nu(e,t){const{x:n,y:r,w:i,h:o,radius:s}=t;e.arc(n+s.topLeft,r+s.topLeft,s.topLeft,1.5*Kt,Kt,!0),e.lineTo(n,r+o-s.bottomLeft),e.arc(n+s.bottomLeft,r+o-s.bottomLeft,s.bottomLeft,Kt,dn,!0),e.lineTo(n+i-s.bottomRight,r+o),e.arc(n+i-s.bottomRight,r+o-s.bottomRight,s.bottomRight,dn,0,!0),e.lineTo(n+i,r+s.topRight),e.arc(n+i-s.topRight,r+s.topRight,s.topRight,0,-dn,!0),e.lineTo(n+s.topLeft,r)}const c9=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,u9=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function d9(e,t){const n=(""+e).match(c9);if(!n||n[1]==="normal")return t*1.2;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100;break}return t*e}const f9=e=>+e||0;function Gv(e,t){const n={},r=wt(t),i=r?Object.keys(t):t,o=wt(e)?r?s=>tt(e[s],e[t[s]]):s=>e[s]:()=>e;for(const s of i)n[s]=f9(o(s));return n}function KS(e){return Gv(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Xs(e){return Gv(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Rn(e){const t=KS(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function bn(e,t){e=e||{},t=t||on.font;let n=tt(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=tt(e.style,t.style);r&&!(""+r).match(u9)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const i={family:tt(e.family,t.family),lineHeight:d9(tt(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:tt(e.weight,t.weight),string:""};return i.string=n9(i),i}function Qt(e,t,n,r){let i=!0,o,s,a;for(o=0,s=e.length;o<s;++o)if(a=e[o],a!==void 0&&(t!==void 0&&typeof a=="function"&&(a=a(t),i=!1),n!==void 0&&Yt(a)&&(a=a[n%a.length],i=!1),a!==void 0))return r&&!i&&(r.cacheable=!1),a}function h9(e,t,n){const{min:r,max:i}=e,o=OS(t,(i-r)/2),s=(a,l)=>n&&a===0?0:a+l;return{min:s(r,-Math.abs(o)),max:s(i,o)}}function Uo(e,t){return Object.assign(Object.create(e),t)}function Yv(e,t=[""],n,r,i=()=>e[0]){const o=n||e;typeof r>"u"&&(r=eC("_fallback",e));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:r,_getTarget:i,override:a=>Yv([a,...e],t,o,r)};return new Proxy(s,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return QS(a,l,()=>w9(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return tC(a).includes(l)},ownKeys(a){return tC(a)},set(a,l,c){const d=a._storage||(a._storage=i());return a[l]=d[l]=c,delete a._keys,!0}})}function pl(e,t,n,r){const i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:XS(e,r),setContext:o=>pl(e,o,n,r),override:o=>pl(e.override(o),t,n,r)};return new Proxy(i,{deleteProperty(o,s){return delete o[s],delete e[s],!0},get(o,s,a){return QS(o,s,()=>g9(o,s,a))},getOwnPropertyDescriptor(o,s){return o._descriptors.allKeys?Reflect.has(e,s)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,s)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(o,s){return Reflect.has(e,s)},ownKeys(){return Reflect.ownKeys(e)},set(o,s,a){return e[s]=a,delete o[s],!0}})}function XS(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:i=t.allKeys}=e;return{allKeys:i,scriptable:n,indexable:r,isScriptable:Wo(n)?n:()=>n,isIndexable:Wo(r)?r:()=>r}}const p9=(e,t)=>e?e+$v(t):t,Kv=(e,t)=>wt(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function QS(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];const r=n();return e[t]=r,r}function g9(e,t,n){const{_proxy:r,_context:i,_subProxy:o,_descriptors:s}=e;let a=r[t];return Wo(a)&&s.isScriptable(t)&&(a=m9(t,a,e,n)),Yt(a)&&a.length&&(a=v9(t,a,e,s.isIndexable)),Kv(t,a)&&(a=pl(a,i,o&&o[t],s)),a}function m9(e,t,n,r){const{_proxy:i,_context:o,_subProxy:s,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(o,s||r);return a.delete(e),Kv(e,l)&&(l=Xv(i._scopes,i,e,l)),l}function v9(e,t,n,r){const{_proxy:i,_context:o,_subProxy:s,_descriptors:a}=n;if(typeof o.index<"u"&&r(e))return t[o.index%t.length];if(wt(t[0])){const l=t,c=i._scopes.filter(d=>d!==l);t=[];for(const d of l){const f=Xv(c,i,e,d);t.push(pl(f,o,s&&s[e],a))}}return t}function JS(e,t,n){return Wo(e)?e(t,n):e}const b9=(e,t)=>e===!0?t:typeof e=="string"?Ho(t,e):void 0;function y9(e,t,n,r,i){for(const o of t){const s=b9(n,o);if(s){e.add(s);const a=JS(s._fallback,n,i);if(typeof a<"u"&&a!==n&&a!==r)return a}else if(s===!1&&typeof r<"u"&&n!==r)return null}return!1}function Xv(e,t,n,r){const i=t._rootScopes,o=JS(t._fallback,n,r),s=[...e,...i],a=new Set;a.add(r);let l=ZS(a,s,n,o||n,r);return l===null||typeof o<"u"&&o!==n&&(l=ZS(a,s,o,l,r),l===null)?!1:Yv(Array.from(a),[""],i,o,()=>x9(t,n,r))}function ZS(e,t,n,r,i){for(;n;)n=y9(e,t,n,r,i);return n}function x9(e,t,n){const r=e._getTarget();t in r||(r[t]={});const i=r[t];return Yt(i)&&wt(n)?n:i||{}}function w9(e,t,n,r){let i;for(const o of t)if(i=eC(p9(o,e),n),typeof i<"u")return Kv(e,i)?Xv(n,r,e,i):i}function eC(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function tC(e){let t=e._keys;return t||(t=e._keys=_9(e._scopes)),t}function _9(e){const t=new Set;for(const n of e)for(const r of Object.keys(n).filter(i=>!i.startsWith("_")))t.add(r);return Array.from(t)}function nC(e,t,n,r){const{iScale:i}=e,{key:o="r"}=this._parsing,s=new Array(r);let a,l,c,d;for(a=0,l=r;a<l;++a)c=a+n,d=t[c],s[a]={r:i.parse(Ho(d,o),c)};return s}const S9=Number.EPSILON||1e-14,gl=(e,t)=>t<e.length&&!e[t].skip&&e[t],rC=e=>e==="x"?"y":"x";function C9(e,t,n,r){const i=e.skip?t:e,o=t,s=n.skip?t:n,a=jv(o,i),l=jv(s,o);let c=a/(a+l),d=l/(a+l);c=isNaN(c)?0:c,d=isNaN(d)?0:d;const f=r*c,g=r*d;return{previous:{x:o.x-f*(s.x-i.x),y:o.y-f*(s.y-i.y)},next:{x:o.x+g*(s.x-i.x),y:o.y+g*(s.y-i.y)}}}function E9(e,t,n){const r=e.length;let i,o,s,a,l,c=gl(e,0);for(let d=0;d<r-1;++d)if(l=c,c=gl(e,d+1),!(!l||!c)){if(Qc(t[d],0,S9)){n[d]=n[d+1]=0;continue}i=n[d]/t[d],o=n[d+1]/t[d],a=Math.pow(i,2)+Math.pow(o,2),!(a<=9)&&(s=3/Math.sqrt(a),n[d]=i*s*t[d],n[d+1]=o*s*t[d])}}function O9(e,t,n="x"){const r=rC(n),i=e.length;let o,s,a,l=gl(e,0);for(let c=0;c<i;++c){if(s=a,a=l,l=gl(e,c+1),!a)continue;const d=a[n],f=a[r];s&&(o=(d-s[n])/3,a[`cp1${n}`]=d-o,a[`cp1${r}`]=f-o*t[c]),l&&(o=(l[n]-d)/3,a[`cp2${n}`]=d+o,a[`cp2${r}`]=f+o*t[c])}}function P9(e,t="x"){const n=rC(t),r=e.length,i=Array(r).fill(0),o=Array(r);let s,a,l,c=gl(e,0);for(s=0;s<r;++s)if(a=l,l=c,c=gl(e,s+1),!!l){if(c){const d=c[t]-l[t];i[s]=d!==0?(c[n]-l[n])/d:0}o[s]=a?c?Ii(i[s-1])!==Ii(i[s])?0:(i[s-1]+i[s])/2:i[s-1]:i[s]}E9(e,i,o),O9(e,o,t)}function Uf(e,t,n){return Math.max(Math.min(e,n),t)}function k9(e,t){let n,r,i,o,s,a=lo(e[0],t);for(n=0,r=e.length;n<r;++n)s=o,o=a,a=n<r-1&&lo(e[n+1],t),o&&(i=e[n],s&&(i.cp1x=Uf(i.cp1x,t.left,t.right),i.cp1y=Uf(i.cp1y,t.top,t.bottom)),a&&(i.cp2x=Uf(i.cp2x,t.left,t.right),i.cp2y=Uf(i.cp2y,t.top,t.bottom)))}function M9(e,t,n,r,i){let o,s,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")P9(e,i);else{let c=r?e[e.length-1]:e[0];for(o=0,s=e.length;o<s;++o)a=e[o],l=C9(c,a,e[Math.min(o+1,s-(r?0:1))%s],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&k9(e,n)}function Qv(){return typeof window<"u"&&typeof document<"u"}function Jv(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Gf(e,t,n){let r;return typeof e=="string"?(r=parseInt(e,10),e.indexOf("%")!==-1&&(r=r/100*t.parentNode[n])):r=e,r}const Yf=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function D9(e,t){return Yf(e).getPropertyValue(t)}const T9=["top","right","bottom","left"];function Qs(e,t,n){const r={};n=n?"-"+n:"";for(let i=0;i<4;i++){const o=T9[i];r[o]=parseFloat(e[t+"-"+o+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const A9=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function I9(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:o}=r;let s=!1,a,l;if(A9(i,o,e.target))a=i,l=o;else{const c=t.getBoundingClientRect();a=r.clientX-c.left,l=r.clientY-c.top,s=!0}return{x:a,y:l,box:s}}function Js(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,i=Yf(n),o=i.boxSizing==="border-box",s=Qs(i,"padding"),a=Qs(i,"border","width"),{x:l,y:c,box:d}=I9(e,n),f=s.left+(d&&a.left),g=s.top+(d&&a.top);let{width:p,height:v}=t;return o&&(p-=s.width+a.width,v-=s.height+a.height),{x:Math.round((l-f)/p*n.width/r),y:Math.round((c-g)/v*n.height/r)}}function N9(e,t,n){let r,i;if(t===void 0||n===void 0){const o=Jv(e);if(!o)t=e.clientWidth,n=e.clientHeight;else{const s=o.getBoundingClientRect(),a=Yf(o),l=Qs(a,"border","width"),c=Qs(a,"padding");t=s.width-c.width-l.width,n=s.height-c.height-l.height,r=Gf(a.maxWidth,o,"clientWidth"),i=Gf(a.maxHeight,o,"clientHeight")}}return{width:t,height:n,maxWidth:r||zf,maxHeight:i||zf}}const Kf=e=>Math.round(e*10)/10;function R9(e,t,n,r){const i=Yf(e),o=Qs(i,"margin"),s=Gf(i.maxWidth,e,"clientWidth")||zf,a=Gf(i.maxHeight,e,"clientHeight")||zf,l=N9(e,t,n);let{width:c,height:d}=l;if(i.boxSizing==="content-box"){const g=Qs(i,"border","width"),p=Qs(i,"padding");c-=p.width+g.width,d-=p.height+g.height}return c=Math.max(0,c-o.width),d=Math.max(0,r?c/r:d-o.height),c=Kf(Math.min(c,s,l.maxWidth)),d=Kf(Math.min(d,a,l.maxHeight)),c&&!d&&(d=Kf(c/2)),(t!==void 0||n!==void 0)&&r&&l.height&&d>l.height&&(d=l.height,c=Kf(Math.floor(d*r))),{width:c,height:d}}function iC(e,t,n){const r=t||1,i=Math.floor(e.height*r),o=Math.floor(e.width*r);e.height=Math.floor(e.height),e.width=Math.floor(e.width);const s=e.canvas;return s.style&&(n||!s.style.height&&!s.style.width)&&(s.style.height=`${e.height}px`,s.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||s.height!==i||s.width!==o?(e.currentDevicePixelRatio=r,s.height=i,s.width=o,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}const L9=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};Qv()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function oC(e,t){const n=D9(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function Zs(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function $9(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:r==="middle"?n<.5?e.y:t.y:r==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function F9(e,t,n,r){const i={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},s=Zs(e,i,n),a=Zs(i,o,n),l=Zs(o,t,n),c=Zs(s,a,n),d=Zs(a,l,n);return Zs(c,d,n)}const j9=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,r){return n-r},leftForLtr(n,r){return n-r}}},z9=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function ml(e,t,n){return e?j9(t,n):z9()}function sC(e,t){let n,r;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,r=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=r)}function aC(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function lC(e){return e==="angle"?{between:Jc,compare:BL,normalize:Pr}:{between:so,compare:(t,n)=>t-n,normalize:t=>t}}function cC({start:e,end:t,count:n,loop:r,style:i}){return{start:e%n,end:t%n,loop:r&&(t-e+1)%n===0,style:i}}function B9(e,t,n){const{property:r,start:i,end:o}=n,{between:s,normalize:a}=lC(r),l=t.length;let{start:c,end:d,loop:f}=e,g,p;if(f){for(c+=l,d+=l,g=0,p=l;g<p&&s(a(t[c%l][r]),i,o);++g)c--,d--;c%=l,d%=l}return d<c&&(d+=l),{start:c,end:d,loop:f,style:e.style}}function uC(e,t,n){if(!n)return[e];const{property:r,start:i,end:o}=n,s=t.length,{compare:a,between:l,normalize:c}=lC(r),{start:d,end:f,loop:g,style:p}=B9(e,t,n),v=[];let y=!1,x=null,w,S,C;const P=()=>l(i,C,w)&&a(i,C)!==0,O=()=>a(o,w)===0||l(o,C,w),k=()=>y||P(),A=()=>!y||O();for(let L=d,F=d;L<=f;++L)S=t[L%s],!S.skip&&(w=c(S[r]),w!==C&&(y=l(w,i,o),x===null&&k()&&(x=a(w,i)===0?L:F),x!==null&&A()&&(v.push(cC({start:x,end:L,loop:g,count:s,style:p})),x=null),F=L,C=w));return x!==null&&v.push(cC({start:x,end:f,loop:g,count:s,style:p})),v}function dC(e,t){const n=[],r=e.segments;for(let i=0;i<r.length;i++){const o=uC(r[i],e.points,t);o.length&&n.push(...o)}return n}function V9(e,t,n,r){let i=0,o=t-1;if(n&&!r)for(;i<t&&!e[i].skip;)i++;for(;i<t&&e[i].skip;)i++;for(i%=t,n&&(o+=i);o>i&&e[o%t].skip;)o--;return o%=t,{start:i,end:o}}function H9(e,t,n,r){const i=e.length,o=[];let s=t,a=e[t],l;for(l=t+1;l<=n;++l){const c=e[l%i];c.skip||c.stop?a.skip||(r=!1,o.push({start:t%i,end:(l-1)%i,loop:r}),t=s=c.stop?l:null):(s=l,a.skip&&(t=l)),a=c}return s!==null&&o.push({start:t%i,end:s%i,loop:r}),o}function W9(e,t){const n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];const o=!!e._loop,{start:s,end:a}=V9(n,i,o,r);if(r===!0)return fC(e,[{start:s,end:a,loop:o}],n,t);const l=a<s?a+i:a,c=!!e._fullLoop&&s===0&&a===i-1;return fC(e,H9(n,s,l,c),n,t)}function fC(e,t,n,r){return!r||!r.setContext||!n?t:q9(e,t,n,r)}function q9(e,t,n,r){const i=e._chart.getContext(),o=hC(e.options),{_datasetIndex:s,options:{spanGaps:a}}=e,l=n.length,c=[];let d=o,f=t[0].start,g=f;function p(v,y,x,w){const S=a?-1:1;if(v!==y){for(v+=l;n[v%l].skip;)v-=S;for(;n[y%l].skip;)y+=S;v%l!==y%l&&(c.push({start:v%l,end:y%l,loop:x,style:w}),d=w,f=y%l)}}for(const v of t){f=a?f:v.start;let y=n[f%l],x;for(g=f+1;g<=v.end;g++){const w=n[g%l];x=hC(r.setContext(Uo(i,{type:"segment",p0:y,p1:w,p0DataIndex:(g-1)%l,p1DataIndex:g%l,datasetIndex:s}))),U9(x,d)&&p(f,g-1,v.loop,d),y=w,d=x}f<g-1&&p(f,g-1,v.loop,d)}return c}function hC(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function U9(e,t){if(!t)return!1;const n=[],r=function(i,o){return Vv(o)?(n.includes(o)||n.push(o),n.indexOf(o)):o};return JSON.stringify(e,r)!==JSON.stringify(t,r)}/*!
|
|
117
117
|
* Chart.js v4.4.1
|
|
118
118
|
* https://www.chartjs.org
|
|
119
119
|
* (c) 2023 Chart.js Contributors
|
|
120
120
|
* Released under the MIT License
|
|
121
|
-
*/class G9{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,i){const o=n.listeners[i],s=n.duration;o.forEach(a=>a({chart:t,initial:n.initial,numSteps:s,currentStep:Math.min(r-n.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=FS.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,i)=>{if(!r.running||!r.items.length)return;const o=r.items;let s=o.length-1,a=!1,l;for(;s>=0;--s)l=o[s],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),a=!0):(o[s]=o[o.length-1],o.pop());a&&(i.draw(),this._notify(i,r,t,"progress")),o.length||(r.running=!1,this._notify(i,r,t,"complete"),r.initial=!1),n+=o.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let r=n.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,r)),r}listen(t,n,r){this._getAnims(t).listeners[n].push(r)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,i)=>Math.max(r,i._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const r=n.items;let i=r.length-1;for(;i>=0;--i)r[i].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var co=new G9;const pC="transparent",Y9={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=WS(e||pC),i=r.valid&&WS(t||pC);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class K9{constructor(t,n,r,i){const o=n[r];i=Qt([t.to,i,o,t.from]);const s=Qt([t.from,o,i]);this._active=!0,this._fn=t.fn||Y9[t.type||typeof s],this._easing=Zc[t.easing]||Zc.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=s,this._to=i,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const i=this._target[this._prop],o=r-this._start,s=this._duration-o;this._start=r,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Qt([t.to,n,i,t.from]),this._from=Qt([t.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,i=this._prop,o=this._from,s=this._loop,a=this._to;let l;if(this._active=o!==a&&(s||n<r),!this._active){this._target[i]=a,this._notify(!0);return}if(n<0){this._target[i]=o;return}l=n/r%2,l=s&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,r)=>{t.push({res:n,rej:r})})}_notify(t){const n=t?"res":"rej",r=this._promises||[];for(let i=0;i<r.length;i++)r[i][n]()}}class gC{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!wt(t))return;const n=Object.keys(on.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const o=t[i];if(!wt(o))return;const s={};for(const a of n)s[a]=o[a];(Yt(o.properties)&&o.properties||[i]).forEach(a=>{(a===i||!r.has(a))&&r.set(a,s)})})}_animateOptions(t,n){const r=n.options,i=Q9(t,r);if(!i)return[];const o=this._createAnimations(i,r);return r.$shared&&X9(t.options.$animations,r).then(()=>{t.options=r},()=>{}),o}_createAnimations(t,n){const r=this._properties,i=[],o=t.$animations||(t.$animations={}),s=Object.keys(n),a=Date.now();let l;for(l=s.length-1;l>=0;--l){const c=s[l];if(c.charAt(0)==="$")continue;if(c==="options"){i.push(...this._animateOptions(t,n));continue}const d=n[c];let f=o[c];const g=r.get(c);if(f)if(g&&f.active()){f.update(g,d,a);continue}else f.cancel();if(!g||!g.duration){t[c]=d;continue}o[c]=f=new K9(g,t,c,d),i.push(f)}return i}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return co.add(this._chart,r),!0}}function X9(e,t){const n=[],r=Object.keys(t);for(let i=0;i<r.length;i++){const o=e[r[i]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function Q9(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function mC(e,t){const n=e&&e.options||{},r=n.reverse,i=n.min===void 0?t:0,o=n.max===void 0?t:0;return{start:r?o:i,end:r?i:o}}function J9(e,t,n){if(n===!1)return!1;const r=mC(e,n),i=mC(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function Z9(e){let t,n,r,i;return wt(e)?(t=e.top,n=e.right,r=e.bottom,i=e.left):t=n=r=i=e,{top:t,right:n,bottom:r,left:i,disabled:e===!1}}function vC(e,t){const n=[],r=e._getSortedDatasetMetas(t);let i,o;for(i=0,o=r.length;i<o;++i)n.push(r[i].index);return n}function bC(e,t,n,r={}){const i=e.keys,o=r.mode==="single";let s,a,l,c;if(t!==null){for(s=0,a=i.length;s<a;++s){if(l=+i[s],l===n){if(r.all)continue;break}c=e.values[l],cn(c)&&(o||t===0||Ii(t)===Ii(c))&&(t+=c)}return t}}function e$(e){const t=Object.keys(e),n=new Array(t.length);let r,i,o;for(r=0,i=t.length;r<i;++r)o=t[r],n[r]={x:o,y:e[o]};return n}function yC(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function t$(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function n$(e){const{min:t,max:n,minDefined:r,maxDefined:i}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:i?n:Number.POSITIVE_INFINITY}}function r$(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function xC(e,t,n,r){for(const i of t.getMatchingVisibleMetas(r).reverse()){const o=e[i.index];if(n&&o>0||!n&&o<0)return i.index}return null}function wC(e,t){const{chart:n,_cachedMeta:r}=e,i=n._stacks||(n._stacks={}),{iScale:o,vScale:s,index:a}=r,l=o.axis,c=s.axis,d=t$(o,s,r),f=t.length;let g;for(let p=0;p<f;++p){const v=t[p],{[l]:y,[c]:x}=v,w=v._stacks||(v._stacks={});g=w[c]=r$(i,d,y),g[a]=x,g._top=xC(g,s,!0,r.type),g._bottom=xC(g,s,!1,r.type);const S=g._visualValues||(g._visualValues={});S[a]=x}}function Zv(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function i$(e,t){return Uo(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function o$(e,t,n){return Uo(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function ru(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const i of t){const o=i._stacks;if(!o||o[r]===void 0||o[r][n]===void 0)return;delete o[r][n],o[r]._visualValues!==void 0&&o[r]._visualValues[n]!==void 0&&delete o[r]._visualValues[n]}}}const eb=e=>e==="reset"||e==="none",_C=(e,t)=>t?e:Object.assign({},e),s$=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:vC(n,!0),values:null};class vi{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=yC(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&ru(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(f,g,p,v)=>f==="x"?g:f==="r"?v:p,o=n.xAxisID=tt(r.xAxisID,Zv(t,"x")),s=n.yAxisID=tt(r.yAxisID,Zv(t,"y")),a=n.rAxisID=tt(r.rAxisID,Zv(t,"r")),l=n.indexAxis,c=n.iAxisID=i(l,o,s,a),d=n.vAxisID=i(l,s,o,a);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(s),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(d)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&LS(this._data,this),t._stacked&&ru(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(wt(n))this._data=e$(n);else if(r!==n){if(r){LS(r,this);const i=this._cachedMeta;ru(i),i._parsed=[]}n&&Object.isExtensible(n)&&qL(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,r=this.getDataset();let i=!1;this._dataCheck();const o=n._stacked;n._stacked=yC(n.vScale,n),n.stack!==r.stack&&(i=!0,ru(n),n.stack=r.stack),this._resyncElements(t),(i||o!==n._stacked)&&wC(this,n._parsed)}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:i}=this,{iScale:o,_stacked:s}=r,a=o.axis;let l=t===0&&n===i.length?!0:r._sorted,c=t>0&&r._parsed[t-1],d,f,g;if(this._parsing===!1)r._parsed=i,r._sorted=!0,g=i;else{Yt(i[t])?g=this.parseArrayData(r,i,t,n):wt(i[t])?g=this.parseObjectData(r,i,t,n):g=this.parsePrimitiveData(r,i,t,n);const p=()=>f[a]===null||c&&f[a]<c[a];for(d=0;d<n;++d)r._parsed[d+t]=f=g[d],l&&(p()&&(l=!1),c=f);r._sorted=l}s&&wC(this,g)}parsePrimitiveData(t,n,r,i){const{iScale:o,vScale:s}=t,a=o.axis,l=s.axis,c=o.getLabels(),d=o===s,f=new Array(i);let g,p,v;for(g=0,p=i;g<p;++g)v=g+r,f[g]={[a]:d||o.parse(c[v],v),[l]:s.parse(n[v],v)};return f}parseArrayData(t,n,r,i){const{xScale:o,yScale:s}=t,a=new Array(i);let l,c,d,f;for(l=0,c=i;l<c;++l)d=l+r,f=n[d],a[l]={x:o.parse(f[0],d),y:s.parse(f[1],d)};return a}parseObjectData(t,n,r,i){const{xScale:o,yScale:s}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(i);let d,f,g,p;for(d=0,f=i;d<f;++d)g=d+r,p=n[g],c[d]={x:o.parse(Ho(p,a),g),y:s.parse(Ho(p,l),g)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const i=this.chart,o=this._cachedMeta,s=n[t.axis],a={keys:vC(i,!0),values:n._stacks[t.axis]._visualValues};return bC(a,s,o.index,{mode:r})}updateRangeFromParsed(t,n,r,i){const o=r[n.axis];let s=o===null?NaN:o;const a=i&&r._stacks[n.axis];i&&a&&(i.values=a,s=bC(i,o,this._cachedMeta.index)),t.min=Math.min(t.min,s),t.max=Math.max(t.max,s)}getMinMax(t,n){const r=this._cachedMeta,i=r._parsed,o=r._sorted&&t===r.iScale,s=i.length,a=this._getOtherScale(t),l=s$(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:f}=n$(a);let g,p;function v(){p=i[g];const y=p[a.axis];return!cn(p[t.axis])||d>y||f<y}for(g=0;g<s&&!(!v()&&(this.updateRangeFromParsed(c,t,p,l),o));++g);if(o){for(g=s-1;g>=0;--g)if(!v()){this.updateRangeFromParsed(c,t,p,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let i,o,s;for(i=0,o=n.length;i<o;++i)s=n[i][t.axis],cn(s)&&r.push(s);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,i=n.vScale,o=this.getParsed(t);return{label:r?""+r.getLabelForValue(o[r.axis]):"",value:i?""+i.getLabelForValue(o[i.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=Z9(tt(this.options.clip,J9(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,i=r.data||[],o=n.chartArea,s=[],a=this._drawStart||0,l=this._drawCount||i.length-a,c=this.options.drawActiveElementsOnTop;let d;for(r.dataset&&r.dataset.draw(t,o,a,l),d=a;d<a+l;++d){const f=i[d];f.hidden||(f.active&&c?s.push(f):f.draw(t,o))}for(d=0;d<s.length;++d)s[d].draw(t,o)}getStyle(t,n){const r=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(t||0,r)}getContext(t,n,r){const i=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const s=this._cachedMeta.data[t];o=s.$context||(s.$context=o$(this.getContext(),t,s)),o.parsed=this.getParsed(t),o.raw=i.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=i$(this.chart.getContext(),this.index)),o.dataset=i,o.index=o.datasetIndex=this.index;return o.active=!!n,o.mode=r,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",r){const i=n==="active",o=this._cachedDataOpts,s=t+"-"+n,a=o[s],l=this.enableOptionSharing&&Xc(r);if(a)return _C(a,l);const c=this.chart.config,d=c.datasetElementScopeKeys(this._type,t),f=i?[`${t}Hover`,"hover",t,""]:[t,""],g=c.getOptionScopes(this.getDataset(),d),p=Object.keys(on.elements[t]),v=()=>this.getContext(r,i,n),y=c.resolveNamedOptions(g,p,v,f);return y.$shared&&(y.$shared=l,o[s]=Object.freeze(_C(y,l))),y}_resolveAnimations(t,n,r){const i=this.chart,o=this._cachedDataOpts,s=`animation-${n}`,a=o[s];if(a)return a;let l;if(i.options.animation!==!1){const d=this.chart.config,f=d.datasetAnimationScopeKeys(this._type,n),g=d.getOptionScopes(this.getDataset(),f);l=d.createResolver(g,this.getContext(t,r,n))}const c=new gC(i,l&&l.animations);return l&&l._cacheable&&(o[s]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||eb(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),i=this._sharedOptions,o=this.getSharedOptions(r),s=this.includeOptions(n,o)||o!==i;return this.updateSharedOptions(o,n,r),{sharedOptions:o,includeOptions:s}}updateElement(t,n,r,i){eb(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!eb(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,i){t.active=i;const o=this.getStyle(n,i);this._resolveAnimations(n,r,i).update(t,{options:!i&&this.getSharedOptions(o)||o})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,r=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const i=r.length,o=n.length,s=Math.min(o,i);s&&this.parse(0,s),o>i?this._insertElements(i,o-i,t):o<i&&this._removeElements(o,i-o)}_insertElements(t,n,r=!0){const i=this._cachedMeta,o=i.data,s=t+n;let a;const l=c=>{for(c.length+=n,a=c.length-1;a>=s;a--)c[a]=c[a-n]};for(l(o),a=t;a<s;++a)o[a]=new this.dataElementType;this._parsing&&l(i._parsed),this.parse(t,n),r&&this.updateElements(o,t,n,"reset")}updateElements(t,n,r,i){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const i=r._parsed.splice(t,n);r._stacked&&ru(r,i)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,i]=t;this[n](r,i)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}ke(vi,"defaults",{}),ke(vi,"datasetElementType",null),ke(vi,"dataElementType",null);function a$(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let r=[];for(let i=0,o=n.length;i<o;i++)r=r.concat(n[i].controller.getAllParsedValues(e));e._cache.$bar=$S(r.sort((i,o)=>i-o))}return e._cache.$bar}function l$(e){const t=e.iScale,n=a$(t,e.type);let r=t._length,i,o,s,a;const l=()=>{s===32767||s===-32768||(Xc(a)&&(r=Math.min(r,Math.abs(s-a)||r)),a=s)};for(i=0,o=n.length;i<o;++i)s=t.getPixelForValue(n[i]),l();for(a=void 0,i=0,o=t.ticks.length;i<o;++i)s=t.getPixelForTick(i),l();return r}function c$(e,t,n,r){const i=n.barThickness;let o,s;return gt(i)?(o=t.min*n.categoryPercentage,s=n.barPercentage):(o=i*r,s=1),{chunk:o/r,ratio:s,start:t.pixels[e]-o/2}}function u$(e,t,n,r){const i=t.pixels,o=i[e];let s=e>0?i[e-1]:null,a=e<i.length-1?i[e+1]:null;const l=n.categoryPercentage;s===null&&(s=o-(a===null?t.end-t.start:a-o)),a===null&&(a=o+o-s);const c=o-(o-Math.min(s,a))/2*l;return{chunk:Math.abs(a-s)/2*l/r,ratio:n.barPercentage,start:c}}function d$(e,t,n,r){const i=n.parse(e[0],r),o=n.parse(e[1],r),s=Math.min(i,o),a=Math.max(i,o);let l=s,c=a;Math.abs(s)>Math.abs(a)&&(l=a,c=s),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:i,end:o,min:s,max:a}}function SC(e,t,n,r){return Yt(e)?d$(e,t,n,r):t[n.axis]=n.parse(e,r),t}function CC(e,t,n,r){const i=e.iScale,o=e.vScale,s=i.getLabels(),a=i===o,l=[];let c,d,f,g;for(c=n,d=n+r;c<d;++c)g=t[c],f={},f[i.axis]=a||i.parse(s[c],c),l.push(SC(g,f,o,c));return l}function tb(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function f$(e,t,n){return e!==0?Ii(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function h$(e){let t,n,r,i,o;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(i="end",o="start"):(i="start",o="end"),{start:n,end:r,reverse:t,top:i,bottom:o}}function p$(e,t,n,r){let i=t.borderSkipped;const o={};if(!i){e.borderSkipped=o;return}if(i===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:s,end:a,reverse:l,top:c,bottom:d}=h$(e);i==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?i=c:(n._bottom||0)===r?i=d:(o[EC(d,s,a,l)]=!0,i=c)),o[EC(i,s,a,l)]=!0,e.borderSkipped=o}function EC(e,t,n,r){return r?(e=g$(e,t,n),e=OC(e,n,t)):e=OC(e,t,n),e}function g$(e,t,n){return e===t?n:e===n?t:e}function OC(e,t,n){return e==="start"?t:e==="end"?n:e}function m$(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class Xf extends vi{parsePrimitiveData(t,n,r,i){return CC(t,n,r,i)}parseArrayData(t,n,r,i){return CC(t,n,r,i)}parseObjectData(t,n,r,i){const{iScale:o,vScale:s}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?a:l,d=s.axis==="x"?a:l,f=[];let g,p,v,y;for(g=r,p=r+i;g<p;++g)y=n[g],v={},v[o.axis]=o.parse(Ho(y,c),g),f.push(SC(Ho(y,d),v,s,g));return f}updateRangeFromParsed(t,n,r,i){super.updateRangeFromParsed(t,n,r,i);const o=r._custom;o&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:r,vScale:i}=n,o=this.getParsed(t),s=o._custom,a=tb(s)?"["+s.start+", "+s.end+"]":""+i.getLabelForValue(o[i.axis]);return{label:""+r.getLabelForValue(o[r.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,r,i){const o=i==="reset",{index:s,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),d=this._getRuler(),{sharedOptions:f,includeOptions:g}=this._getSharedOptions(n,i);for(let p=n;p<n+r;p++){const v=this.getParsed(p),y=o||gt(v[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(p),x=this._calculateBarIndexPixels(p,d),w=(v._stacks||{})[a.axis],S={horizontal:c,base:y.base,enableBorderRadius:!w||tb(v._custom)||s===w._top||s===w._bottom,x:c?y.head:x.center,y:c?x.center:y.head,height:c?x.size:Math.abs(y.size),width:c?Math.abs(y.size):x.size};g&&(S.options=f||this.resolveDataElementOptions(p,t[p].active?"active":i));const C=S.options||t[p].options;p$(S,C,w,s),m$(S,C,d.ratio),this.updateElement(t[p],p,S,i)}}_getStacks(t,n){const{iScale:r}=this._cachedMeta,i=r.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),o=r.options.stacked,s=[],a=l=>{const c=l.controller.getParsed(n),d=c&&c[l.vScale.axis];if(gt(d)||isNaN(d))return!0};for(const l of i)if(!(n!==void 0&&a(l))&&((o===!1||s.indexOf(l.stack)===-1||o===void 0&&l.stack===void 0)&&s.push(l.stack),l.index===t))break;return s.length||s.push(void 0),s}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,n,r){const i=this._getStacks(t,r),o=n!==void 0?i.indexOf(n):-1;return o===-1?i.length-1:o}_getRuler(){const t=this.options,n=this._cachedMeta,r=n.iScale,i=[];let o,s;for(o=0,s=n.data.length;o<s;++o)i.push(r.getPixelForValue(this.getParsed(o)[r.axis],o));const a=t.barThickness;return{min:a||l$(n),pixels:i,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:r,index:i},options:{base:o,minBarLength:s}}=this,a=o||0,l=this.getParsed(t),c=l._custom,d=tb(c);let f=l[n.axis],g=0,p=r?this.applyStack(n,l,r):f,v,y;p!==f&&(g=p-f,p=f),d&&(f=c.barStart,p=c.barEnd-c.barStart,f!==0&&Ii(f)!==Ii(c.barEnd)&&(g=0),g+=f);const x=!gt(o)&&!d?o:g;let w=n.getPixelForValue(x);if(this.chart.getDataVisibility(t)?v=n.getPixelForValue(g+p):v=w,y=v-w,Math.abs(y)<s){y=f$(y,n,a)*s,f===a&&(w-=y/2);const S=n.getPixelForDecimal(0),C=n.getPixelForDecimal(1),P=Math.min(S,C),O=Math.max(S,C);w=Math.max(Math.min(w,O),P),v=w+y,r&&!d&&(l._stacks[n.axis]._visualValues[i]=n.getValueForPixel(v)-n.getValueForPixel(w))}if(w===n.getPixelForValue(a)){const S=Ii(y)*n.getLineWidthForValue(a)/2;w+=S,y-=S}return{size:y,base:w,head:v,center:v+y/2}}_calculateBarIndexPixels(t,n){const r=n.scale,i=this.options,o=i.skipNull,s=tt(i.maxBarThickness,1/0);let a,l;if(n.grouped){const c=o?this._getStackCount(t):n.stackCount,d=i.barThickness==="flex"?u$(t,n,i,c):c$(t,n,i,c),f=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);a=d.start+d.chunk*f+d.chunk/2,l=Math.min(s,d.chunk*d.ratio)}else a=r.getPixelForValue(this.getParsed(t)[r.axis],t),l=Math.min(s,n.min*n.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,n=t.vScale,r=t.data,i=r.length;let o=0;for(;o<i;++o)this.getParsed(o)[n.axis]!==null&&r[o].draw(this._ctx)}}ke(Xf,"id","bar"),ke(Xf,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),ke(Xf,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Qf extends vi{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,r,i){const o=super.parsePrimitiveData(t,n,r,i);for(let s=0;s<o.length;s++)o[s]._custom=this.resolveDataElementOptions(s+r).radius;return o}parseArrayData(t,n,r,i){const o=super.parseArrayData(t,n,r,i);for(let s=0;s<o.length;s++){const a=n[r+s];o[s]._custom=tt(a[2],this.resolveDataElementOptions(s+r).radius)}return o}parseObjectData(t,n,r,i){const o=super.parseObjectData(t,n,r,i);for(let s=0;s<o.length;s++){const a=n[r+s];o[s]._custom=tt(a&&a.r&&+a.r,this.resolveDataElementOptions(s+r).radius)}return o}getMaxOverflow(){const t=this._cachedMeta.data;let n=0;for(let r=t.length-1;r>=0;--r)n=Math.max(n,t[r].size(this.resolveDataElementOptions(r))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:i,yScale:o}=n,s=this.getParsed(t),a=i.getLabelForValue(s.x),l=o.getLabelForValue(s.y),c=s._custom;return{label:r[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,r,i){const o=i==="reset",{iScale:s,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,i),d=s.axis,f=a.axis;for(let g=n;g<n+r;g++){const p=t[g],v=!o&&this.getParsed(g),y={},x=y[d]=o?s.getPixelForDecimal(.5):s.getPixelForValue(v[d]),w=y[f]=o?a.getBasePixel():a.getPixelForValue(v[f]);y.skip=isNaN(x)||isNaN(w),c&&(y.options=l||this.resolveDataElementOptions(g,p.active?"active":i),o&&(y.options.radius=0)),this.updateElement(p,g,y,i)}}resolveDataElementOptions(t,n){const r=this.getParsed(t);let i=super.resolveDataElementOptions(t,n);i.$shared&&(i=Object.assign({},i,{$shared:!1}));const o=i.radius;return n!=="active"&&(i.radius=0),i.radius+=tt(r&&r._custom,o),i}}ke(Qf,"id","bubble"),ke(Qf,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),ke(Qf,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function v$(e,t,n){let r=1,i=1,o=0,s=0;if(t<Xt){const a=e,l=a+t,c=Math.cos(a),d=Math.sin(a),f=Math.cos(l),g=Math.sin(l),p=(C,P,O)=>Jc(C,a,l,!0)?1:Math.max(P,P*n,O,O*n),v=(C,P,O)=>Jc(C,a,l,!0)?-1:Math.min(P,P*n,O,O*n),y=p(0,c,f),x=p(dn,d,g),w=v(Kt,c,f),S=v(Kt+dn,d,g);r=(y-w)/2,i=(x-S)/2,o=-(y+w)/2,s=-(x+S)/2}return{ratioX:r,ratioY:i,offsetX:o,offsetY:s}}class ea extends vi{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const r=this.getDataset().data,i=this._cachedMeta;if(this._parsing===!1)i._parsed=r;else{let o=l=>+r[l];if(wt(r[t])){const{key:l="value"}=this._parsing;o=c=>+Ho(r[c],l)}let s,a;for(s=t,a=t+n;s<a;++s)i._parsed[s]=o(s)}}_getRotation(){return mi(this.options.rotation-90)}_getCircumference(){return mi(this.options.circumference)}_getRotationExtents(){let t=Xt,n=-Xt;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const i=this.chart.getDatasetMeta(r).controller,o=i._getRotation(),s=i._getCircumference();t=Math.min(t,o),n=Math.max(n,o+s)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:r}=n,i=this._cachedMeta,o=i.data,s=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(r.width,r.height)-s)/2,0),l=Math.min(TL(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:d,rotation:f}=this._getRotationExtents(),{ratioX:g,ratioY:p,offsetX:v,offsetY:y}=v$(f,d,l),x=(r.width-s)/g,w=(r.height-s)/p,S=Math.max(Math.min(x,w)/2,0),C=OS(this.options.radius,S),P=Math.max(C*l,0),O=(C-P)/this._getVisibleDatasetWeightTotal();this.offsetX=v*C,this.offsetY=y*C,i.total=this.calculateTotal(),this.outerRadius=C-O*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-O*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,n){const r=this.options,i=this._cachedMeta,o=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||i._parsed[t]===null||i.data[t].hidden?0:this.calculateCircumference(i._parsed[t]*o/Xt)}updateElements(t,n,r,i){const o=i==="reset",s=this.chart,a=s.chartArea,c=s.options.animation,d=(a.left+a.right)/2,f=(a.top+a.bottom)/2,g=o&&c.animateScale,p=g?0:this.innerRadius,v=g?0:this.outerRadius,{sharedOptions:y,includeOptions:x}=this._getSharedOptions(n,i);let w=this._getRotation(),S;for(S=0;S<n;++S)w+=this._circumference(S,o);for(S=n;S<n+r;++S){const C=this._circumference(S,o),P=t[S],O={x:d+this.offsetX,y:f+this.offsetY,startAngle:w,endAngle:w+C,circumference:C,outerRadius:v,innerRadius:p};x&&(O.options=y||this.resolveDataElementOptions(S,P.active?"active":i)),w+=C,this.updateElement(P,S,O,i)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let r=0,i;for(i=0;i<n.length;i++){const o=t._parsed[i];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(i)&&!n[i].hidden&&(r+=Math.abs(o))}return r}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?Xt*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,i=r.data.labels||[],o=eu(n._parsed[t],r.options.locale);return{label:i[t]||"",value:o}}getMaxBorderWidth(t){let n=0;const r=this.chart;let i,o,s,a,l;if(!t){for(i=0,o=r.data.datasets.length;i<o;++i)if(r.isDatasetVisible(i)){s=r.getDatasetMeta(i),t=s.data,a=s.controller;break}}if(!t)return 0;for(i=0,o=t.length;i<o;++i)l=a.resolveDataElementOptions(i),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let r=0,i=t.length;r<i;++r){const o=this.resolveDataElementOptions(r);n=Math.max(n,o.offset||0,o.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let r=0;r<t;++r)this.chart.isDatasetVisible(r)&&(n+=this._getRingWeight(r));return n}_getRingWeight(t){return Math.max(tt(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}ke(ea,"id","doughnut"),ke(ea,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),ke(ea,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),ke(ea,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:i}}=t.legend.options;return n.labels.map((o,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:i,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}});class Jf extends vi{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:r,data:i=[],_dataset:o}=n,s=this.chart._animationsDisabled;let{start:a,count:l}=zS(n,i,s);this._drawStart=a,this._drawCount=l,BS(n)&&(a=0,l=i.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!o._decimated,r.points=i;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!s,options:c},t),this.updateElements(i,a,l,t)}updateElements(t,n,r,i){const o=i==="reset",{iScale:s,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:d,includeOptions:f}=this._getSharedOptions(n,i),g=s.axis,p=a.axis,{spanGaps:v,segment:y}=this.options,x=hl(v)?v:Number.POSITIVE_INFINITY,w=this.chart._animationsDisabled||o||i==="none",S=n+r,C=t.length;let P=n>0&&this.getParsed(n-1);for(let O=0;O<C;++O){const k=t[O],A=w?k:{};if(O<n||O>=S){A.skip=!0;continue}const L=this.getParsed(O),F=gt(L[p]),j=A[g]=s.getPixelForValue(L[g],O),B=A[p]=o||F?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,L,l):L[p],O);A.skip=isNaN(j)||isNaN(B)||F,A.stop=O>0&&Math.abs(L[g]-P[g])>x,y&&(A.parsed=L,A.raw=c.data[O]),f&&(A.options=d||this.resolveDataElementOptions(O,k.active?"active":i)),w||this.updateElement(k,O,A,i),P=L}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,i=t.data||[];if(!i.length)return r;const o=i[0].size(this.resolveDataElementOptions(0)),s=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(r,o,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}ke(Jf,"id","line"),ke(Jf,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),ke(Jf,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class iu extends vi{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,i=r.data.labels||[],o=eu(n._parsed[t].r,r.options.locale);return{label:i[t]||"",value:o}}parseObjectData(t,n,r,i){return nC.bind(this)(t,n,r,i)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((r,i)=>{const o=this.getParsed(i).r;!isNaN(o)&&this.chart.getDataVisibility(i)&&(o<n.min&&(n.min=o),o>n.max&&(n.max=o))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,r=t.options,i=Math.min(n.right-n.left,n.bottom-n.top),o=Math.max(i/2,0),s=Math.max(r.cutoutPercentage?o/100*r.cutoutPercentage:1,0),a=(o-s)/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,r,i){const o=i==="reset",s=this.chart,l=s.options.animation,c=this._cachedMeta.rScale,d=c.xCenter,f=c.yCenter,g=c.getIndexAngle(0)-.5*Kt;let p=g,v;const y=360/this.countVisibleElements();for(v=0;v<n;++v)p+=this._computeAngle(v,i,y);for(v=n;v<n+r;v++){const x=t[v];let w=p,S=p+this._computeAngle(v,i,y),C=s.getDataVisibility(v)?c.getDistanceFromCenterForValue(this.getParsed(v).r):0;p=S,o&&(l.animateScale&&(C=0),l.animateRotate&&(w=S=g));const P={x:d,y:f,innerRadius:0,outerRadius:C,startAngle:w,endAngle:S,options:this.resolveDataElementOptions(v,x.active?"active":i)};this.updateElement(x,v,P,i)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((r,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&n++}),n}_computeAngle(t,n,r){return this.chart.getDataVisibility(t)?mi(this.resolveDataElementOptions(t,n).angle||r):0}}ke(iu,"id","polarArea"),ke(iu,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),ke(iu,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:i}}=t.legend.options;return n.labels.map((o,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:i,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class nb extends ea{}ke(nb,"id","pie"),ke(nb,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Zf extends vi{getLabelAndValue(t){const n=this._cachedMeta.vScale,r=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(r[n.axis])}}parseObjectData(t,n,r,i){return nC.bind(this)(t,n,r,i)}update(t){const n=this._cachedMeta,r=n.dataset,i=n.data||[],o=n.iScale.getLabels();if(r.points=i,t!=="resize"){const s=this.resolveDatasetElementOptions(t);this.options.showLine||(s.borderWidth=0);const a={_loop:!0,_fullLoop:o.length===i.length,options:s};this.updateElement(r,void 0,a,t)}this.updateElements(i,0,i.length,t)}updateElements(t,n,r,i){const o=this._cachedMeta.rScale,s=i==="reset";for(let a=n;a<n+r;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":i),d=o.getPointPositionForValue(a,this.getParsed(a).r),f=s?o.xCenter:d.x,g=s?o.yCenter:d.y,p={x:f,y:g,angle:d.angle,skip:isNaN(f)||isNaN(g),options:c};this.updateElement(l,a,p,i)}}}ke(Zf,"id","radar"),ke(Zf,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),ke(Zf,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class eh extends vi{getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:i,yScale:o}=n,s=this.getParsed(t),a=i.getLabelForValue(s.x),l=o.getLabelForValue(s.y);return{label:r[t]||"",value:"("+a+", "+l+")"}}update(t){const n=this._cachedMeta,{data:r=[]}=n,i=this.chart._animationsDisabled;let{start:o,count:s}=zS(n,r,i);if(this._drawStart=o,this._drawCount=s,BS(n)&&(o=0,s=r.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:l}=n;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=r;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!i,options:c},t)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(r,o,s,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,r,i){const o=i==="reset",{iScale:s,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,d=this.resolveDataElementOptions(n,i),f=this.getSharedOptions(d),g=this.includeOptions(i,f),p=s.axis,v=a.axis,{spanGaps:y,segment:x}=this.options,w=hl(y)?y:Number.POSITIVE_INFINITY,S=this.chart._animationsDisabled||o||i==="none";let C=n>0&&this.getParsed(n-1);for(let P=n;P<n+r;++P){const O=t[P],k=this.getParsed(P),A=S?O:{},L=gt(k[v]),F=A[p]=s.getPixelForValue(k[p],P),j=A[v]=o||L?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,k,l):k[v],P);A.skip=isNaN(F)||isNaN(j)||L,A.stop=P>0&&Math.abs(k[p]-C[p])>w,x&&(A.parsed=k,A.raw=c.data[P]),g&&(A.options=f||this.resolveDataElementOptions(P,O.active?"active":i)),S||this.updateElement(O,P,A,i),C=k}this.updateSharedOptions(f,i,d)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let a=0;for(let l=n.length-1;l>=0;--l)a=Math.max(a,n[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const r=t.dataset,i=r.options&&r.options.borderWidth||0;if(!n.length)return i;const o=n[0].size(this.resolveDataElementOptions(0)),s=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,o,s)/2}}ke(eh,"id","scatter"),ke(eh,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),ke(eh,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var b$=Object.freeze({__proto__:null,BarController:Xf,BubbleController:Qf,DoughnutController:ea,LineController:Jf,PieController:nb,PolarAreaController:iu,RadarController:Zf,ScatterController:eh});function ta(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class rb{constructor(t){ke(this,"options");this.options=t||{}}static override(t){Object.assign(rb.prototype,t)}init(){}formats(){return ta()}parse(){return ta()}format(){return ta()}add(){return ta()}diff(){return ta()}startOf(){return ta()}endOf(){return ta()}}var y$={_date:rb};function x$(e,t,n,r){const{controller:i,data:o,_sorted:s}=e,a=i._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&s&&o.length){const l=a._reversePixels?HL:ao;if(r){if(i._sharedOptions){const c=o[0],d=typeof c.getRange=="function"&&c.getRange(t);if(d){const f=l(o,t,n-d),g=l(o,t,n+d);return{lo:f.lo,hi:g.hi}}}}else return l(o,t,n)}return{lo:0,hi:o.length-1}}function ou(e,t,n,r,i){const o=e.getSortedVisibleDatasetMetas(),s=n[t];for(let a=0,l=o.length;a<l;++a){const{index:c,data:d}=o[a],{lo:f,hi:g}=x$(o[a],t,s,i);for(let p=f;p<=g;++p){const v=d[p];v.skip||r(v,c,p)}}}function w$(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,i){const o=t?Math.abs(r.x-i.x):0,s=n?Math.abs(r.y-i.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(s,2))}}function ib(e,t,n,r,i){const o=[];return!i&&!e.isPointInArea(t)||ou(e,n,t,function(a,l,c){!i&&!lo(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function _$(e,t,n,r){let i=[];function o(s,a,l){const{startAngle:c,endAngle:d}=s.getProps(["startAngle","endAngle"],r),{angle:f}=NS(s,{x:t.x,y:t.y});Jc(f,c,d)&&i.push({element:s,datasetIndex:a,index:l})}return ou(e,n,t,o),i}function S$(e,t,n,r,i,o){let s=[];const a=w$(n);let l=Number.POSITIVE_INFINITY;function c(d,f,g){const p=d.inRange(t.x,t.y,i);if(r&&!p)return;const v=d.getCenterPoint(i);if(!(!!o||e.isPointInArea(v))&&!p)return;const x=a(t,v);x<l?(s=[{element:d,datasetIndex:f,index:g}],l=x):x===l&&s.push({element:d,datasetIndex:f,index:g})}return ou(e,n,t,c),s}function ob(e,t,n,r,i,o){return!o&&!e.isPointInArea(t)?[]:n==="r"&&!r?_$(e,t,n,i):S$(e,t,n,r,i,o)}function PC(e,t,n,r,i){const o=[],s=n==="x"?"inXRange":"inYRange";let a=!1;return ou(e,n,t,(l,c,d)=>{l[s](t[n],i)&&(o.push({element:l,datasetIndex:c,index:d}),a=a||l.inRange(t.x,t.y,i))}),r&&!a?[]:o}var C$={evaluateInteractionItems:ou,modes:{index(e,t,n,r){const i=Js(t,e),o=n.axis||"x",s=n.includeInvisible||!1,a=n.intersect?ib(e,i,o,r,s):ob(e,i,o,!1,r,s),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const d=a[0].index,f=c.data[d];f&&!f.skip&&l.push({element:f,datasetIndex:c.index,index:d})}),l):[]},dataset(e,t,n,r){const i=Js(t,e),o=n.axis||"xy",s=n.includeInvisible||!1;let a=n.intersect?ib(e,i,o,r,s):ob(e,i,o,!1,r,s);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let d=0;d<c.length;++d)a.push({element:c[d],datasetIndex:l,index:d})}return a},point(e,t,n,r){const i=Js(t,e),o=n.axis||"xy",s=n.includeInvisible||!1;return ib(e,i,o,r,s)},nearest(e,t,n,r){const i=Js(t,e),o=n.axis||"xy",s=n.includeInvisible||!1;return ob(e,i,o,n.intersect,r,s)},x(e,t,n,r){const i=Js(t,e);return PC(e,i,"x",n.intersect,r)},y(e,t,n,r){const i=Js(t,e);return PC(e,i,"y",n.intersect,r)}}};const kC=["left","top","right","bottom"];function su(e,t){return e.filter(n=>n.pos===t)}function MC(e,t){return e.filter(n=>kC.indexOf(n.pos)===-1&&n.box.axis===t)}function au(e,t){return e.sort((n,r)=>{const i=t?r:n,o=t?n:r;return i.weight===o.weight?i.index-o.index:i.weight-o.weight})}function E$(e){const t=[];let n,r,i,o,s,a;for(n=0,r=(e||[]).length;n<r;++n)i=e[n],{position:o,options:{stack:s,stackWeight:a=1}}=i,t.push({index:n,box:i,pos:o,horizontal:i.isHorizontal(),weight:i.weight,stack:s&&o+s,stackWeight:a});return t}function O$(e){const t={};for(const n of e){const{stack:r,pos:i,stackWeight:o}=n;if(!r||!kC.includes(i))continue;const s=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=o}return t}function P$(e,t){const n=O$(e),{vBoxMaxWidth:r,hBoxMaxHeight:i}=t;let o,s,a;for(o=0,s=e.length;o<s;++o){a=e[o];const{fullSize:l}=a.box,c=n[a.stack],d=c&&a.stackWeight/c.weight;a.horizontal?(a.width=d?d*r:l&&t.availableWidth,a.height=i):(a.width=r,a.height=d?d*i:l&&t.availableHeight)}return n}function k$(e){const t=E$(e),n=au(t.filter(c=>c.box.fullSize),!0),r=au(su(t,"left"),!0),i=au(su(t,"right")),o=au(su(t,"top"),!0),s=au(su(t,"bottom")),a=MC(t,"x"),l=MC(t,"y");return{fullSize:n,leftAndTop:r.concat(o),rightAndBottom:i.concat(l).concat(s).concat(a),chartArea:su(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:o.concat(s).concat(a)}}function DC(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function TC(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function M$(e,t,n,r){const{pos:i,box:o}=n,s=e.maxPadding;if(!wt(i)){n.size&&(e[i]-=n.size);const f=r[n.stack]||{size:0,count:1};f.size=Math.max(f.size,n.horizontal?o.height:o.width),n.size=f.size/f.count,e[i]+=n.size}o.getPadding&&TC(s,o.getPadding());const a=Math.max(0,t.outerWidth-DC(s,e,"left","right")),l=Math.max(0,t.outerHeight-DC(s,e,"top","bottom")),c=a!==e.w,d=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:d}:{same:d,other:c}}function D$(e){const t=e.maxPadding;function n(r){const i=Math.max(t[r]-e[r],0);return e[r]+=i,i}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function T$(e,t){const n=t.maxPadding;function r(i){const o={left:0,top:0,right:0,bottom:0};return i.forEach(s=>{o[s]=Math.max(t[s],n[s])}),o}return r(e?["left","right"]:["top","bottom"])}function lu(e,t,n,r){const i=[];let o,s,a,l,c,d;for(o=0,s=e.length,c=0;o<s;++o){a=e[o],l=a.box,l.update(a.width||t.w,a.height||t.h,T$(a.horizontal,t));const{same:f,other:g}=M$(t,n,a,r);c|=f&&i.length,d=d||g,l.fullSize||i.push(a)}return c&&lu(i,t,n,r)||d}function th(e,t,n,r,i){e.top=n,e.left=t,e.right=t+r,e.bottom=n+i,e.width=r,e.height=i}function AC(e,t,n,r){const i=n.padding;let{x:o,y:s}=t;for(const a of e){const l=a.box,c=r[a.stack]||{count:1,placed:0,weight:1},d=a.stackWeight/c.weight||1;if(a.horizontal){const f=t.w*d,g=c.size||l.height;Xc(c.start)&&(s=c.start),l.fullSize?th(l,i.left,s,n.outerWidth-i.right-i.left,g):th(l,t.left+c.placed,s,f,g),c.start=s,c.placed+=f,s=l.bottom}else{const f=t.h*d,g=c.size||l.width;Xc(c.start)&&(o=c.start),l.fullSize?th(l,o,i.top,g,n.outerHeight-i.bottom-i.top):th(l,o,t.top+c.placed,g,f),c.start=o,c.placed+=f,o=l.right}}t.x=o,t.y=s}var Un={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;const i=Rn(e.options.layout.padding),o=Math.max(t-i.width,0),s=Math.max(n-i.height,0),a=k$(e.boxes),l=a.vertical,c=a.horizontal;Nt(e.boxes,y=>{typeof y.beforeLayout=="function"&&y.beforeLayout()});const d=l.reduce((y,x)=>x.box.options&&x.box.options.display===!1?y:y+1,0)||1,f=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:o,availableHeight:s,vBoxMaxWidth:o/2/d,hBoxMaxHeight:s/2}),g=Object.assign({},i);TC(g,Rn(r));const p=Object.assign({maxPadding:g,w:o,h:s,x:i.left,y:i.top},i),v=P$(l.concat(c),f);lu(a.fullSize,p,f,v),lu(l,p,f,v),lu(c,p,f,v)&&lu(l,p,f,v),D$(p),AC(a.leftAndTop,p,f,v),p.x+=p.w,p.y+=p.h,AC(a.rightAndBottom,p,f,v),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},Nt(a.chartArea,y=>{const x=y.box;Object.assign(x,e.chartArea),x.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class IC{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,i){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,i?Math.floor(n/i):r)}}isAttached(t){return!0}updateConfig(t){}}class A$ extends IC{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const nh="$chartjs",I$={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},NC=e=>e===null||e==="";function N$(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[nh]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",NC(i)){const o=oC(e,"width");o!==void 0&&(e.width=o)}if(NC(r))if(e.style.height==="")e.height=e.width/(t||2);else{const o=oC(e,"height");o!==void 0&&(e.height=o)}return e}const RC=L9?{passive:!0}:!1;function R$(e,t,n){e.addEventListener(t,n,RC)}function L$(e,t,n){e.canvas.removeEventListener(t,n,RC)}function $$(e,t){const n=I$[e.type]||e.type,{x:r,y:i}=Js(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function rh(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function F$(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let s=!1;for(const a of o)s=s||rh(a.addedNodes,r),s=s&&!rh(a.removedNodes,r);s&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function j$(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let s=!1;for(const a of o)s=s||rh(a.removedNodes,r),s=s&&!rh(a.addedNodes,r);s&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const cu=new Map;let LC=0;function $C(){const e=window.devicePixelRatio;e!==LC&&(LC=e,cu.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function z$(e,t){cu.size||window.addEventListener("resize",$C),cu.set(e,t)}function B$(e){cu.delete(e),cu.size||window.removeEventListener("resize",$C)}function V$(e,t,n){const r=e.canvas,i=r&&Jv(r);if(!i)return;const o=jS((a,l)=>{const c=i.clientWidth;n(a,l),c<i.clientWidth&&n()},window),s=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,d=l.contentRect.height;c===0&&d===0||o(c,d)});return s.observe(i),z$(e,o),s}function sb(e,t,n){n&&n.disconnect(),t==="resize"&&B$(e)}function H$(e,t,n){const r=e.canvas,i=jS(o=>{e.ctx!==null&&n($$(o,e))},e);return R$(r,t,i),i}class W$ extends IC{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(N$(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[nh])return!1;const r=n[nh].initial;["height","width"].forEach(o=>{const s=r[o];gt(s)?n.removeAttribute(o):n.setAttribute(o,s)});const i=r.style||{};return Object.keys(i).forEach(o=>{n.style[o]=i[o]}),n.width=n.width,delete n[nh],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),s={attach:F$,detach:j$,resize:V$}[n]||H$;i[n]=s(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:sb,detach:sb,resize:sb}[n]||L$)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return R9(t,n,r,i)}isAttached(t){const n=Jv(t);return!!(n&&n.isConnected)}}function q$(e){return!Qv()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?A$:W$}let uo=(og=class{constructor(){ke(this,"x");ke(this,"y");ke(this,"active",!1);ke(this,"options");ke(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return hl(this.x)&&hl(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const i={};return t.forEach(o=>{i[o]=r[o]&&r[o].active()?r[o]._to:this[o]}),i}},ke(og,"defaults",{}),ke(og,"defaultRoutes"),og);function U$(e,t){const n=e.options.ticks,r=G$(e),i=Math.min(n.maxTicksLimit||r,r),o=n.major.enabled?K$(t):[],s=o.length,a=o[0],l=o[s-1],c=[];if(s>i)return X$(t,c,o,s/i),c;const d=Y$(o,t,i);if(s>0){let f,g;const p=s>1?Math.round((l-a)/(s-1)):null;for(ih(t,c,d,gt(p)?0:a-p,a),f=0,g=s-1;f<g;f++)ih(t,c,d,o[f],o[f+1]);return ih(t,c,d,l,gt(p)?t.length:l+p),c}return ih(t,c,d),c}function G$(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),i=e._maxLength/n;return Math.floor(Math.min(r,i))}function Y$(e,t,n){const r=Q$(e),i=t.length/n;if(!r)return Math.max(i,1);const o=jL(r);for(let s=0,a=o.length-1;s<a;s++){const l=o[s];if(l>i)return l}return Math.max(i,1)}function K$(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function X$(e,t,n,r){let i=0,o=n[0],s;for(r=Math.ceil(r),s=0;s<e.length;s++)s===o&&(t.push(e[s]),i++,o=n[i*r])}function ih(e,t,n,r,i){const o=tt(r,0),s=Math.min(tt(i,e.length),e.length);let a=0,l,c,d;for(n=Math.ceil(n),i&&(l=i-r,n=l/Math.floor(l/n)),d=o;d<0;)a++,d=Math.round(o+a*n);for(c=Math.max(o,0);c<s;c++)c===d&&(t.push(e[c]),a++,d=Math.round(o+a*n))}function Q$(e){const t=e.length;let n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}const J$=e=>e==="left"?"right":e==="right"?"left":e,FC=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,jC=(e,t)=>Math.min(t||e,e);function zC(e,t){const n=[],r=e.length/t,i=e.length;let o=0;for(;o<i;o+=r)n.push(e[Math.floor(o)]);return n}function Z$(e,t,n){const r=e.ticks.length,i=Math.min(t,r-1),o=e._startPixel,s=e._endPixel,a=1e-6;let l=e.getPixelForTick(i),c;if(!(n&&(r===1?c=Math.max(l-o,s-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(i-1))/2,l+=i<t?c:-c,l<o-a||l>s+a)))return l}function eF(e,t){Nt(e,n=>{const r=n.gc,i=r.length/2;let o;if(i>t){for(o=0;o<i;++o)delete n.data[r[o]];r.splice(0,i)}})}function uu(e){return e.drawTicks?e.tickLength:0}function BC(e,t){if(!e.display)return 0;const n=bn(e.font,t),r=Rn(e.padding);return(Yt(e.text)?e.text.length:1)*n.lineHeight+r.height}function tF(e,t){return Uo(e,{scale:t,type:"scale"})}function nF(e,t,n){return Uo(e,{tick:n,index:t,type:"tick"})}function rF(e,t,n){let r=Bv(e);return(n&&t!=="right"||!n&&t==="right")&&(r=J$(r)),r}function iF(e,t,n,r){const{top:i,left:o,bottom:s,right:a,chart:l}=e,{chartArea:c,scales:d}=l;let f=0,g,p,v;const y=s-i,x=a-o;if(e.isHorizontal()){if(p=qn(r,o,a),wt(n)){const w=Object.keys(n)[0],S=n[w];v=d[w].getPixelForValue(S)+y-t}else n==="center"?v=(c.bottom+c.top)/2+y-t:v=FC(e,n,t);g=a-o}else{if(wt(n)){const w=Object.keys(n)[0],S=n[w];p=d[w].getPixelForValue(S)-x+t}else n==="center"?p=(c.left+c.right)/2-x+t:p=FC(e,n,t);v=qn(r,s,i),f=n==="left"?-dn:dn}return{titleX:p,titleY:v,maxWidth:g,rotation:f}}class na extends uo{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:r,_suggestedMax:i}=this;return t=Or(t,Number.POSITIVE_INFINITY),n=Or(n,Number.NEGATIVE_INFINITY),r=Or(r,Number.POSITIVE_INFINITY),i=Or(i,Number.NEGATIVE_INFINITY),{min:Or(t,r),max:Or(n,i),minDefined:cn(t),maxDefined:cn(n)}}getMinMax(t){let{min:n,max:r,minDefined:i,maxDefined:o}=this.getUserBounds(),s;if(i&&o)return{min:n,max:r};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)s=a[l].controller.getMinMax(this,t),i||(n=Math.min(n,s.min)),o||(r=Math.max(r,s.max));return n=o&&n>r?r:n,r=i&&n>r?n:r,{min:Or(n,Or(r,n)),max:Or(r,Or(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Ft(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:i,grace:o,ticks:s}=this.options,a=s.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=h9(this,o,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?zC(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||s.source==="auto")&&(this.ticks=U$(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,t=!t),this._startPixel=n,this._endPixel=r,this._reversePixels=t,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Ft(this.options.afterUpdate,[this])}beforeSetDimensions(){Ft(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){Ft(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Ft(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Ft(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,i,o;for(r=0,i=t.length;r<i;r++)o=t[r],o.label=Ft(n.callback,[o.value,r,t],this)}afterTickToLabelConversion(){Ft(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Ft(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=jC(this.ticks.length,t.ticks.maxTicksLimit),i=n.minRotation||0,o=n.maxRotation;let s=i,a,l,c;if(!this._isVisible()||!n.display||i>=o||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const d=this._getLabelSizes(),f=d.widest.width,g=d.highest.height,p=kn(this.chart.width-f,0,this.maxWidth);a=t.offset?this.maxWidth/r:p/(r-1),f+6>a&&(a=p/(r-(t.offset?.5:1)),l=this.maxHeight-uu(t.grid)-n.padding-BC(t.title,this.chart.options.font),c=Math.sqrt(f*f+g*g),s=Fv(Math.min(Math.asin(kn((d.highest.height+6)/a,-1,1)),Math.asin(kn(l/c,-1,1))-Math.asin(kn(g/c,-1,1)))),s=Math.max(i,Math.min(o,s))),this.labelRotation=s}afterCalculateLabelRotation(){Ft(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Ft(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:i,grid:o}}=this,s=this._isVisible(),a=this.isHorizontal();if(s){const l=BC(i,n.options.font);if(a?(t.width=this.maxWidth,t.height=uu(o)+l):(t.height=this.maxHeight,t.width=uu(o)+l),r.display&&this.ticks.length){const{first:c,last:d,widest:f,highest:g}=this._getLabelSizes(),p=r.padding*2,v=mi(this.labelRotation),y=Math.cos(v),x=Math.sin(v);if(a){const w=r.mirror?0:x*f.width+y*g.height;t.height=Math.min(this.maxHeight,t.height+w+p)}else{const w=r.mirror?0:y*f.width+x*g.height;t.width=Math.min(this.maxWidth,t.width+w+p)}this._calculatePadding(c,d,x,y)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,r,i){const{ticks:{align:o,padding:s},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const d=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let g=0,p=0;l?c?(g=i*t.width,p=r*n.height):(g=r*t.height,p=i*n.width):o==="start"?p=n.width:o==="end"?g=t.width:o!=="inner"&&(g=t.width/2,p=n.width/2),this.paddingLeft=Math.max((g-d+s)*this.width/(this.width-d),0),this.paddingRight=Math.max((p-f+s)*this.width/(this.width-f),0)}else{let d=n.height/2,f=t.height/2;o==="start"?(d=0,f=t.height):o==="end"&&(d=n.height,f=0),this.paddingTop=d+s,this.paddingBottom=f+s}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Ft(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,r;for(n=0,r=t.length;n<r;n++)gt(t[n].label)&&(t.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=zC(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:i,_longestTextCache:o}=this,s=[],a=[],l=Math.floor(n/jC(n,r));let c=0,d=0,f,g,p,v,y,x,w,S,C,P,O;for(f=0;f<n;f+=l){if(v=t[f].label,y=this._resolveTickFontOptions(f),i.font=x=y.string,w=o[x]=o[x]||{data:{},gc:[]},S=y.lineHeight,C=P=0,!gt(v)&&!Yt(v))C=Hf(i,w.data,w.gc,C,v),P=S;else if(Yt(v))for(g=0,p=v.length;g<p;++g)O=v[g],!gt(O)&&!Yt(O)&&(C=Hf(i,w.data,w.gc,C,O),P+=S);s.push(C),a.push(P),c=Math.max(C,c),d=Math.max(P,d)}eF(o,n);const k=s.indexOf(c),A=a.indexOf(d),L=F=>({width:s[F]||0,height:a[F]||0});return{first:L(0),last:L(n-1),widest:L(k),highest:L(A),widths:s,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return VL(this._alignToPixels?Ys(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const r=n[t];return r.$context||(r.$context=nF(this.getContext(),t,r))}return this.$context||(this.$context=tF(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=mi(this.labelRotation),r=Math.abs(Math.cos(n)),i=Math.abs(Math.sin(n)),o=this._getLabelSizes(),s=t.autoSkipPadding||0,a=o?o.widest.width+s:0,l=o?o.highest.height+s:0;return this.isHorizontal()?l*r>a*i?a/r:l/i:l*i<a*r?l/r:a/i}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,i=this.options,{grid:o,position:s,border:a}=i,l=o.offset,c=this.isHorizontal(),f=this.ticks.length+(l?1:0),g=uu(o),p=[],v=a.setContext(this.getContext()),y=v.display?v.width:0,x=y/2,w=function(Z){return Ys(r,Z,y)};let S,C,P,O,k,A,L,F,j,B,V,K;if(s==="top")S=w(this.bottom),A=this.bottom-g,F=S-x,B=w(t.top)+x,K=t.bottom;else if(s==="bottom")S=w(this.top),B=t.top,K=w(t.bottom)-x,A=S+x,F=this.top+g;else if(s==="left")S=w(this.right),k=this.right-g,L=S-x,j=w(t.left)+x,V=t.right;else if(s==="right")S=w(this.left),j=t.left,V=w(t.right)-x,k=S+x,L=this.left+g;else if(n==="x"){if(s==="center")S=w((t.top+t.bottom)/2+.5);else if(wt(s)){const Z=Object.keys(s)[0],U=s[Z];S=w(this.chart.scales[Z].getPixelForValue(U))}B=t.top,K=t.bottom,A=S+x,F=A+g}else if(n==="y"){if(s==="center")S=w((t.left+t.right)/2);else if(wt(s)){const Z=Object.keys(s)[0],U=s[Z];S=w(this.chart.scales[Z].getPixelForValue(U))}k=S-x,L=k-g,j=t.left,V=t.right}const Y=tt(i.ticks.maxTicksLimit,f),$=Math.max(1,Math.ceil(f/Y));for(C=0;C<f;C+=$){const Z=this.getContext(C),U=o.setContext(Z),ie=a.setContext(Z),le=U.lineWidth,M=U.color,H=ie.dash||[],ne=ie.dashOffset,N=U.tickWidth,X=U.tickColor,me=U.tickBorderDash||[],he=U.tickBorderDashOffset;P=Z$(this,C,l),P!==void 0&&(O=Ys(r,P,le),c?k=L=j=V=O:A=F=B=K=O,p.push({tx1:k,ty1:A,tx2:L,ty2:F,x1:j,y1:B,x2:V,y2:K,width:le,color:M,borderDash:H,borderDashOffset:ne,tickWidth:N,tickColor:X,tickBorderDash:me,tickBorderDashOffset:he}))}return this._ticksLength=f,this._borderValue=S,p}_computeLabelItems(t){const n=this.axis,r=this.options,{position:i,ticks:o}=r,s=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:d,mirror:f}=o,g=uu(r.grid),p=g+d,v=f?-d:p,y=-mi(this.labelRotation),x=[];let w,S,C,P,O,k,A,L,F,j,B,V,K="middle";if(i==="top")k=this.bottom-v,A=this._getXAxisLabelAlignment();else if(i==="bottom")k=this.top+v,A=this._getXAxisLabelAlignment();else if(i==="left"){const $=this._getYAxisLabelAlignment(g);A=$.textAlign,O=$.x}else if(i==="right"){const $=this._getYAxisLabelAlignment(g);A=$.textAlign,O=$.x}else if(n==="x"){if(i==="center")k=(t.top+t.bottom)/2+p;else if(wt(i)){const $=Object.keys(i)[0],Z=i[$];k=this.chart.scales[$].getPixelForValue(Z)+p}A=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")O=(t.left+t.right)/2-p;else if(wt(i)){const $=Object.keys(i)[0],Z=i[$];O=this.chart.scales[$].getPixelForValue(Z)}A=this._getYAxisLabelAlignment(g).textAlign}n==="y"&&(l==="start"?K="top":l==="end"&&(K="bottom"));const Y=this._getLabelSizes();for(w=0,S=a.length;w<S;++w){C=a[w],P=C.label;const $=o.setContext(this.getContext(w));L=this.getPixelForTick(w)+o.labelOffset,F=this._resolveTickFontOptions(w),j=F.lineHeight,B=Yt(P)?P.length:1;const Z=B/2,U=$.color,ie=$.textStrokeColor,le=$.textStrokeWidth;let M=A;s?(O=L,A==="inner"&&(w===S-1?M=this.options.reverse?"left":"right":w===0?M=this.options.reverse?"right":"left":M="center"),i==="top"?c==="near"||y!==0?V=-B*j+j/2:c==="center"?V=-Y.highest.height/2-Z*j+j:V=-Y.highest.height+j/2:c==="near"||y!==0?V=j/2:c==="center"?V=Y.highest.height/2-Z*j:V=Y.highest.height-B*j,f&&(V*=-1),y!==0&&!$.showLabelBackdrop&&(O+=j/2*Math.sin(y))):(k=L,V=(1-B)*j/2);let H;if($.showLabelBackdrop){const ne=Rn($.backdropPadding),N=Y.heights[w],X=Y.widths[w];let me=V-ne.top,he=0-ne.left;switch(K){case"middle":me-=N/2;break;case"bottom":me-=N;break}switch(A){case"center":he-=X/2;break;case"right":he-=X;break;case"inner":w===S-1?he-=X:w>0&&(he-=X/2);break}H={left:he,top:me,width:X+ne.width,height:N+ne.height,color:$.backdropColor}}x.push({label:P,font:F,textOffset:V,options:{rotation:y,color:U,strokeColor:ie,strokeWidth:le,textAlign:M,textBaseline:K,translation:[O,k],backdrop:H}})}return x}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-mi(this.labelRotation))return t==="top"?"left":"right";let i="center";return n.align==="start"?i="left":n.align==="end"?i="right":n.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:i,padding:o}}=this.options,s=this._getLabelSizes(),a=t+o,l=s.widest.width;let c,d;return n==="left"?i?(d=this.right+o,r==="near"?c="left":r==="center"?(c="center",d+=l/2):(c="right",d+=l)):(d=this.right-a,r==="near"?c="right":r==="center"?(c="center",d-=l/2):(c="left",d=this.left)):n==="right"?i?(d=this.left+o,r==="near"?c="right":r==="center"?(c="center",d-=l/2):(c="left",d-=l)):(d=this.left+a,r==="near"?c="left":r==="center"?(c="center",d+=l/2):(c="right",d=this.right)):c="right",{textAlign:c,x:d}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:r,top:i,width:o,height:s}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,i,o,s),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(o=>o.value===t);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,s;const a=(l,c,d)=>{!d.width||!d.color||(r.save(),r.lineWidth=d.width,r.strokeStyle=d.color,r.setLineDash(d.borderDash||[]),r.lineDashOffset=d.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(c.x,c.y),r.stroke(),r.restore())};if(n.display)for(o=0,s=i.length;o<s;++o){const l=i[o];n.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:r,grid:i}}=this,o=r.setContext(this.getContext()),s=r.display?o.width:0;if(!s)return;const a=i.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,d,f,g;this.isHorizontal()?(c=Ys(t,this.left,s)-s/2,d=Ys(t,this.right,a)+a/2,f=g=l):(f=Ys(t,this.top,s)-s/2,g=Ys(t,this.bottom,a)+a/2,c=d=l),n.save(),n.lineWidth=o.width,n.strokeStyle=o.color,n.beginPath(),n.moveTo(c,f),n.lineTo(d,g),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,i=this._computeLabelArea();i&&Wf(r,i);const o=this.getLabelItems(t);for(const s of o){const a=s.options,l=s.font,c=s.label,d=s.textOffset;Ks(r,c,0,d,l,a)}i&&qf(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:i}}=this;if(!r.display)return;const o=bn(r.font),s=Rn(r.padding),a=r.align;let l=o.lineHeight/2;n==="bottom"||n==="center"||wt(n)?(l+=s.bottom,Yt(r.text)&&(l+=o.lineHeight*(r.text.length-1))):l+=s.top;const{titleX:c,titleY:d,maxWidth:f,rotation:g}=iF(this,l,n,a);Ks(t,r.text,0,0,o,{color:r.color,maxWidth:f,rotation:g,textAlign:rF(a,n,i),textBaseline:"middle",translation:[c,d]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,r=tt(t.grid&&t.grid.z,-1),i=tt(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==na.prototype.draw?[{z:n,draw:o=>{this.draw(o)}}]:[{z:r,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",i=[];let o,s;for(o=0,s=n.length;o<s;++o){const a=n[o];a[r]===this.id&&(!t||a.type===t)&&i.push(a)}return i}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return bn(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class oh{constructor(t,n,r){this.type=t,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let r;aF(n)&&(r=this.register(n));const i=this.items,o=t.id,s=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in i||(i[o]=t,oF(t,s,r),this.override&&on.override(t.id,t.overrides)),s}get(t){return this.items[t]}unregister(t){const n=this.items,r=t.id,i=this.scope;r in n&&delete n[r],i&&r in on[i]&&(delete on[i][r],this.override&&delete Gs[r])}}function oF(e,t,n){const r=Ai(Object.create(null),[n?on.get(n):{},on.get(t),e.defaults]);on.set(t,r),e.defaultRoutes&&sF(t,e.defaultRoutes),e.descriptors&&on.describe(t,e.descriptors)}function sF(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),i=r.pop(),o=[e].concat(r).join("."),s=t[n].split("."),a=s.pop(),l=s.join(".");on.route(o,i,l,a)})}function aF(e){return"id"in e&&"defaults"in e}class lF{constructor(){this.controllers=new oh(vi,"datasets",!0),this.elements=new oh(uo,"elements"),this.plugins=new oh(Object,"plugins"),this.scales=new oh(na,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,r){[...n].forEach(i=>{const o=r||this._getRegistryForType(i);r||o.isForType(i)||o===this.plugins&&i.id?this._exec(t,o,i):Nt(i,s=>{const a=r||this._getRegistryForType(s);this._exec(t,a,s)})})}_exec(t,n,r){const i=$v(t);Ft(r["before"+i],[],r),n[t](r),Ft(r["after"+i],[],r)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(t))return r}return this.plugins}_get(t,n,r){const i=n.get(t);if(i===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return i}}var Ni=new lF;class cF{constructor(){this._init=[]}notify(t,n,r,i){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=i?this._descriptors(t).filter(i):this._descriptors(t),s=this._notify(o,t,n,r);return n==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),s}_notify(t,n,r,i){i=i||{};for(const o of t){const s=o.plugin,a=s[r],l=[n,i,o.options];if(Ft(a,l,s)===!1&&i.cancelable)return!1}return!0}invalidate(){gt(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const r=t&&t.config,i=tt(r.options&&r.options.plugins,{}),o=uF(r);return i===!1&&!n?[]:fF(t,o,i,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,i=(o,s)=>o.filter(a=>!s.some(l=>a.plugin.id===l.plugin.id));this._notify(i(n,r),t,"stop"),this._notify(i(r,n),t,"start")}}function uF(e){const t={},n=[],r=Object.keys(Ni.plugins.items);for(let o=0;o<r.length;o++)n.push(Ni.getPlugin(r[o]));const i=e.plugins||[];for(let o=0;o<i.length;o++){const s=i[o];n.indexOf(s)===-1&&(n.push(s),t[s.id]=!0)}return{plugins:n,localIds:t}}function dF(e,t){return!t&&e===!1?null:e===!0?{}:e}function fF(e,{plugins:t,localIds:n},r,i){const o=[],s=e.getContext();for(const a of t){const l=a.id,c=dF(r[l],i);c!==null&&o.push({plugin:a,options:hF(e.config,{plugin:a,local:n[l]},c,s)})}return o}function hF(e,{plugin:t,local:n},r,i){const o=e.pluginScopeKeys(t),s=e.getOptionScopes(r,o);return n&&t.defaults&&s.push(t.defaults),e.createResolver(s,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function ab(e,t){const n=on.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function pF(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function gF(e,t){return e===t?"_index_":"_value_"}function VC(e){if(e==="x"||e==="y"||e==="r")return e}function mF(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function lb(e,...t){if(VC(e))return e;for(const n of t){const r=n.axis||mF(n.position)||e.length>1&&VC(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function HC(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function vF(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(r=>r.xAxisID===e||r.yAxisID===e);if(n.length)return HC(e,"x",n[0])||HC(e,"y",n[0])}return{}}function bF(e,t){const n=Gs[e.type]||{scales:{}},r=t.scales||{},i=ab(e.type,t),o=Object.create(null);return Object.keys(r).forEach(s=>{const a=r[s];if(!wt(a))return console.error(`Invalid scale configuration for scale: ${s}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${s}`);const l=lb(s,a,vF(s,e),on.scales[a.type]),c=gF(l,i),d=n.scales||{};o[s]=Kc(Object.create(null),[{axis:l},a,d[l],d[c]])}),e.data.datasets.forEach(s=>{const a=s.type||e.type,l=s.indexAxis||ab(a,t),d=(Gs[a]||{}).scales||{};Object.keys(d).forEach(f=>{const g=pF(f,l),p=s[g+"AxisID"]||g;o[p]=o[p]||Object.create(null),Kc(o[p],[{axis:g},r[p],d[f]])})}),Object.keys(o).forEach(s=>{const a=o[s];Kc(a,[on.scales[a.type],on.scale])}),o}function WC(e){const t=e.options||(e.options={});t.plugins=tt(t.plugins,{}),t.scales=bF(e,t)}function qC(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function yF(e){return e=e||{},e.data=qC(e.data),WC(e),e}const UC=new Map,GC=new Set;function sh(e,t){let n=UC.get(e);return n||(n=t(),UC.set(e,n),GC.add(n)),n}const du=(e,t,n)=>{const r=Ho(t,n);r!==void 0&&e.add(r)};class xF{constructor(t){this._config=yF(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=qC(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),WC(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return sh(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return sh(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return sh(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return sh(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let i=r.get(t);return(!i||n)&&(i=new Map,r.set(t,i)),i}getOptionScopes(t,n,r){const{options:i,type:o}=this,s=this._cachedScopes(t,r),a=s.get(n);if(a)return a;const l=new Set;n.forEach(d=>{t&&(l.add(t),d.forEach(f=>du(l,t,f))),d.forEach(f=>du(l,i,f)),d.forEach(f=>du(l,Gs[o]||{},f)),d.forEach(f=>du(l,on,f)),d.forEach(f=>du(l,Wv,f))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),GC.has(n)&&s.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Gs[n]||{},on.datasets[n]||{},{type:n},on,Wv]}resolveNamedOptions(t,n,r,i=[""]){const o={$shared:!0},{resolver:s,subPrefixes:a}=YC(this._resolverCache,t,i);let l=s;if(_F(s,n)){o.$shared=!1,r=Wo(r)?r():r;const c=this.createResolver(t,r,a);l=pl(s,r,c)}for(const c of n)o[c]=l[c];return o}createResolver(t,n,r=[""],i){const{resolver:o}=YC(this._resolverCache,t,r);return wt(n)?pl(o,n,void 0,i):o}}function YC(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const i=n.join();let o=r.get(i);return o||(o={resolver:Yv(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(i,o)),o}const wF=e=>wt(e)&&Object.getOwnPropertyNames(e).some(t=>Wo(e[t]));function _F(e,t){const{isScriptable:n,isIndexable:r}=XS(e);for(const i of t){const o=n(i),s=r(i),a=(s||o)&&e[i];if(o&&(Wo(a)||wF(a))||s&&Yt(a))return!0}return!1}var SF="4.4.1";const CF=["top","bottom","left","right","chartArea"];function KC(e,t){return e==="top"||e==="bottom"||CF.indexOf(e)===-1&&t==="x"}function XC(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function QC(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Ft(n&&n.onComplete,[e],t)}function EF(e){const t=e.chart,n=t.options.animation;Ft(n&&n.onProgress,[e],t)}function JC(e){return Qv()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const ah={},ZC=e=>{const t=JC(e);return Object.values(ah).filter(n=>n.canvas===t).pop()};function OF(e,t,n){const r=Object.keys(e);for(const i of r){const o=+i;if(o>=t){const s=e[i];delete e[i],(n>0||o>t)&&(e[o+n]=s)}}}function PF(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}function lh(e,t,n){return e.options.clip?e[n]:t[n]}function kF(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:lh(n,t,"left"),right:lh(n,t,"right"),top:lh(r,t,"top"),bottom:lh(r,t,"bottom")}:t}class Qr{static register(...t){Ni.add(...t),eE()}static unregister(...t){Ni.remove(...t),eE()}constructor(t,n){const r=this.config=new xF(n),i=JC(t),o=ZC(i);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const s=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||q$(i)),this.platform.updateConfig(r);const a=this.platform.acquireContext(i,s.aspectRatio),l=a&&a.canvas,c=l&&l.height,d=l&&l.width;if(this.id=DL(),this.ctx=a,this.canvas=l,this.width=d,this.height=c,this._options=s,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new cF,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=UL(f=>this.update(f),s.resizeDelay||0),this._dataChanges=[],ah[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}co.listen(this,"complete",QC),co.listen(this,"progress",EF),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:i,_aspectRatio:o}=this;return gt(t)?n&&o?o:i?r/i:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Ni}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():iC(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return GS(this.canvas,this.ctx),this}stop(){return co.stop(this),this}resize(t,n){co.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,i=this.canvas,o=r.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(i,t,n,o),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,iC(this,a,!0)&&(this.notifyPlugins("resize",{size:s}),Ft(r.onResize,[this,s],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Nt(n,(r,i)=>{r.id=i})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,i=Object.keys(r).reduce((s,a)=>(s[a]=!1,s),{});let o=[];n&&(o=o.concat(Object.keys(n).map(s=>{const a=n[s],l=lb(s,a),c=l==="r",d=l==="x";return{options:a,dposition:c?"chartArea":d?"bottom":"left",dtype:c?"radialLinear":d?"category":"linear"}}))),Nt(o,s=>{const a=s.options,l=a.id,c=lb(l,a),d=tt(a.type,s.dtype);(a.position===void 0||KC(a.position,c)!==KC(s.dposition))&&(a.position=s.dposition),i[l]=!0;let f=null;if(l in r&&r[l].type===d)f=r[l];else{const g=Ni.getScale(d);f=new g({id:l,type:d,ctx:this.ctx,chart:this}),r[f.id]=f}f.init(a,t)}),Nt(i,(s,a)=>{s||delete r[a]}),Nt(r,s=>{Un.configure(this,s,s.options),Un.addBox(this,s)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((i,o)=>i.index-o.index),r>n){for(let i=n;i<r;++i)this._destroyDatasetMeta(i);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(XC("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,i)=>{n.filter(o=>o===r._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,i;for(this._removeUnreferencedMetasets(),r=0,i=n.length;r<i;r++){const o=n[r];let s=this.getDatasetMeta(r);const a=o.type||this.config.type;if(s.type&&s.type!==a&&(this._destroyDatasetMeta(r),s=this.getDatasetMeta(r)),s.type=a,s.indexAxis=o.indexAxis||ab(a,this.options),s.order=o.order||0,s.index=r,s.label=""+o.label,s.visible=this.isDatasetVisible(r),s.controller)s.controller.updateIndex(r),s.controller.linkScales();else{const l=Ni.getController(a),{datasetElementType:c,dataElementType:d}=on.datasets[a];Object.assign(l,{dataElementType:Ni.getElement(d),datasetElementType:c&&Ni.getElement(c)}),s.controller=new l(this,r),t.push(s.controller)}}return this._updateMetasets(),t}_resetElements(){Nt(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let c=0,d=this.data.datasets.length;c<d;c++){const{controller:f}=this.getDatasetMeta(c),g=!i&&o.indexOf(f)===-1;f.buildOrUpdateElements(g),s=Math.max(+f.getMaxOverflow(),s)}s=this._minPadding=r.layout.autoPadding?s:0,this._updateLayout(s),i||Nt(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(XC("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Nt(this.scales,t=>{Un.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!MS(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:i,count:o}of n){const s=r==="_removeElements"?-o:o;OF(t,i,s)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=o=>new Set(t.filter(s=>s[0]===o).map((s,a)=>a+","+s.splice(1).join(","))),i=r(0);for(let o=1;o<n;o++)if(!MS(i,r(o)))return;return Array.from(i).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Un.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Nt(this.boxes,i=>{r&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,o)=>{i._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,Wo(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),i={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",i)!==!1&&(r.controller._update(n),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(co.has(this)?this.attached&&!co.running(this)&&co.start(this):(this.draw(),QC({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:i}=this._resizeBeforeDraw;this._resize(r,i),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,r=[];let i,o;for(i=0,o=n.length;i<o;++i){const s=n[i];(!t||s.visible)&&r.push(s)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r=t._clip,i=!r.disabled,o=kF(t,this.chartArea),s={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(i&&Wf(n,{left:r.left===!1?0:o.left-r.left,right:r.right===!1?this.width:o.right+r.right,top:r.top===!1?0:o.top-r.top,bottom:r.bottom===!1?this.height:o.bottom+r.bottom}),t.controller.draw(),i&&qf(n),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return lo(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const o=C$.modes[n];return typeof o=="function"?o(this,t,r,i):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let i=r.filter(o=>o&&o._dataset===n).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},r.push(i)),i}getContext(){return this.$context||(this.$context=Uo(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(t,n){const r=this.getDatasetMeta(t);r.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,r){const i=r?"show":"hide",o=this.getDatasetMeta(t),s=o.controller._resolveAnimations(void 0,i);Xc(n)?(o.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),s.update(o,{visible:r}),this.update(a=>a.datasetIndex===t?i:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),co.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),GS(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete ah[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,n=this.platform,r=(o,s)=>{n.addEventListener(this,o,s),t[o]=s},i=(o,s,a)=>{o.offsetX=s,o.offsetY=a,this._eventHandler(o)};Nt(this.options.events,o=>r(o,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},i=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let s;const a=()=>{i("attach",a),this.attached=!0,this.resize(),r("resize",o),r("detach",s)};s=()=>{this.attached=!1,i("resize",o),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():s()}unbindEvents(){Nt(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Nt(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const i=r?"set":"remove";let o,s,a,l;for(n==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+i+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){s=t[a];const c=s&&this.getDatasetMeta(s.datasetIndex).controller;c&&c[i+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:o,index:s})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[s],index:s}});!Ff(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){const i=this.options.hover,o=(l,c)=>l.filter(d=>!c.some(f=>d.datasetIndex===f.datasetIndex&&d.index===f.index)),s=o(n,t),a=r?t:o(t,n);s.length&&this.updateHoverStyle(s,i.mode,!1),a.length&&i.mode&&this.updateHoverStyle(a,i.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},i=s=>(s.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,i)===!1)return;const o=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,i),(o||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:i=[],options:o}=this,s=n,a=this._getActiveElements(t,i,r,s),l=LL(t),c=PF(t,this._lastEvent,r,l);r&&(this._lastEvent=null,Ft(o.onHover,[t,a,this],this),l&&Ft(o.onClick,[t,a,this],this));const d=!Ff(a,i);return(d||n)&&(this._active=a,this._updateHoverStyles(a,i,n)),this._lastEvent=c,d}_getActiveElements(t,n,r,i){if(t.type==="mouseout")return[];if(!r)return n;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,i)}}ke(Qr,"defaults",on),ke(Qr,"instances",ah),ke(Qr,"overrides",Gs),ke(Qr,"registry",Ni),ke(Qr,"version",SF),ke(Qr,"getChart",ZC);function eE(){return Nt(Qr.instances,e=>e._plugins.invalidate())}function MF(e,t,n){const{startAngle:r,pixelMargin:i,x:o,y:s,outerRadius:a,innerRadius:l}=t;let c=i/a;e.beginPath(),e.arc(o,s,a,r-c,n+c),l>i?(c=i/l,e.arc(o,s,l,n+c,r-c,!0)):e.arc(o,s,i,n+dn,r-dn),e.closePath(),e.clip()}function DF(e){return Gv(e,["outerStart","outerEnd","innerStart","innerEnd"])}function TF(e,t,n,r){const i=DF(e.options.borderRadius),o=(n-t)/2,s=Math.min(o,r*t/2),a=l=>{const c=(n-Math.min(o,l))*r/2;return kn(l,0,Math.min(o,c))};return{outerStart:a(i.outerStart),outerEnd:a(i.outerEnd),innerStart:kn(i.innerStart,0,s),innerEnd:kn(i.innerEnd,0,s)}}function vl(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function ch(e,t,n,r,i,o){const{x:s,y:a,startAngle:l,pixelMargin:c,innerRadius:d}=t,f=Math.max(t.outerRadius+r+n-c,0),g=d>0?d+r+n+c:0;let p=0;const v=i-l;if(r){const $=d>0?d-r:0,Z=f>0?f-r:0,U=($+Z)/2,ie=U!==0?v*U/(U+r):v;p=(v-ie)/2}const y=Math.max(.001,v*f-n/Kt)/f,x=(v-y)/2,w=l+x+p,S=i-x-p,{outerStart:C,outerEnd:P,innerStart:O,innerEnd:k}=TF(t,g,f,S-w),A=f-C,L=f-P,F=w+C/A,j=S-P/L,B=g+O,V=g+k,K=w+O/B,Y=S-k/V;if(e.beginPath(),o){const $=(F+j)/2;if(e.arc(s,a,f,F,$),e.arc(s,a,f,$,j),P>0){const le=vl(L,j,s,a);e.arc(le.x,le.y,P,j,S+dn)}const Z=vl(V,S,s,a);if(e.lineTo(Z.x,Z.y),k>0){const le=vl(V,Y,s,a);e.arc(le.x,le.y,k,S+dn,Y+Math.PI)}const U=(S-k/g+(w+O/g))/2;if(e.arc(s,a,g,S-k/g,U,!0),e.arc(s,a,g,U,w+O/g,!0),O>0){const le=vl(B,K,s,a);e.arc(le.x,le.y,O,K+Math.PI,w-dn)}const ie=vl(A,w,s,a);if(e.lineTo(ie.x,ie.y),C>0){const le=vl(A,F,s,a);e.arc(le.x,le.y,C,w-dn,F)}}else{e.moveTo(s,a);const $=Math.cos(F)*f+s,Z=Math.sin(F)*f+a;e.lineTo($,Z);const U=Math.cos(j)*f+s,ie=Math.sin(j)*f+a;e.lineTo(U,ie)}e.closePath()}function AF(e,t,n,r,i){const{fullCircles:o,startAngle:s,circumference:a}=t;let l=t.endAngle;if(o){ch(e,t,n,r,l,i);for(let c=0;c<o;++c)e.fill();isNaN(a)||(l=s+(a%Xt||Xt))}return ch(e,t,n,r,l,i),e.fill(),l}function IF(e,t,n,r,i){const{fullCircles:o,startAngle:s,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:d,borderDash:f,borderDashOffset:g}=l,p=l.borderAlign==="inner";if(!c)return;e.setLineDash(f||[]),e.lineDashOffset=g,p?(e.lineWidth=c*2,e.lineJoin=d||"round"):(e.lineWidth=c,e.lineJoin=d||"bevel");let v=t.endAngle;if(o){ch(e,t,n,r,v,i);for(let y=0;y<o;++y)e.stroke();isNaN(a)||(v=s+(a%Xt||Xt))}p&&MF(e,t,v),o||(ch(e,t,n,r,v,i),e.stroke())}class bl extends uo{constructor(n){super();ke(this,"circumference");ke(this,"endAngle");ke(this,"fullCircles");ke(this,"innerRadius");ke(this,"outerRadius");ke(this,"pixelMargin");ke(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,n&&Object.assign(this,n)}inRange(n,r,i){const o=this.getProps(["x","y"],i),{angle:s,distance:a}=NS(o,{x:n,y:r}),{startAngle:l,endAngle:c,innerRadius:d,outerRadius:f,circumference:g}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),p=(this.options.spacing+this.options.borderWidth)/2,y=tt(g,c-l)>=Xt||Jc(s,l,c),x=so(a,d+p,f+p);return y&&x}getCenterPoint(n){const{x:r,y:i,startAngle:o,endAngle:s,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:c,spacing:d}=this.options,f=(o+s)/2,g=(a+l+d+c)/2;return{x:r+Math.cos(f)*g,y:i+Math.sin(f)*g}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:r,circumference:i}=this,o=(r.offset||0)/4,s=(r.spacing||0)/2,a=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=i>Xt?Math.floor(i/Xt):0,i===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*o,Math.sin(l)*o);const c=1-Math.sin(Math.min(Kt,i||0)),d=o*c;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,AF(n,this,d,s,a),IF(n,this,d,s,a),n.restore()}}ke(bl,"id","arc"),ke(bl,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),ke(bl,"defaultRoutes",{backgroundColor:"backgroundColor"}),ke(bl,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function tE(e,t,n=t){e.lineCap=tt(n.borderCapStyle,t.borderCapStyle),e.setLineDash(tt(n.borderDash,t.borderDash)),e.lineDashOffset=tt(n.borderDashOffset,t.borderDashOffset),e.lineJoin=tt(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=tt(n.borderWidth,t.borderWidth),e.strokeStyle=tt(n.borderColor,t.borderColor)}function NF(e,t,n){e.lineTo(n.x,n.y)}function RF(e){return e.stepped?i9:e.tension||e.cubicInterpolationMode==="monotone"?o9:NF}function nE(e,t,n={}){const r=e.length,{start:i=0,end:o=r-1}=n,{start:s,end:a}=t,l=Math.max(i,s),c=Math.min(o,a),d=i<s&&o<s||i>a&&o>a;return{count:r,start:l,loop:t.loop,ilen:c<l&&!d?r+c-l:c-l}}function LF(e,t,n,r){const{points:i,options:o}=t,{count:s,start:a,loop:l,ilen:c}=nE(i,n,r),d=RF(o);let{move:f=!0,reverse:g}=r||{},p,v,y;for(p=0;p<=c;++p)v=i[(a+(g?c-p:p))%s],!v.skip&&(f?(e.moveTo(v.x,v.y),f=!1):d(e,y,v,g,o.stepped),y=v);return l&&(v=i[(a+(g?c:0))%s],d(e,y,v,g,o.stepped)),!!l}function $F(e,t,n,r){const i=t.points,{count:o,start:s,ilen:a}=nE(i,n,r),{move:l=!0,reverse:c}=r||{};let d=0,f=0,g,p,v,y,x,w;const S=P=>(s+(c?a-P:P))%o,C=()=>{y!==x&&(e.lineTo(d,x),e.lineTo(d,y),e.lineTo(d,w))};for(l&&(p=i[S(0)],e.moveTo(p.x,p.y)),g=0;g<=a;++g){if(p=i[S(g)],p.skip)continue;const P=p.x,O=p.y,k=P|0;k===v?(O<y?y=O:O>x&&(x=O),d=(f*d+P)/++f):(C(),e.lineTo(P,O),v=k,f=0,y=x=O),w=O}C()}function cb(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?$F:LF}function FF(e){return e.stepped?$9:e.tension||e.cubicInterpolationMode==="monotone"?F9:Zs}function jF(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),tE(e,t.options),e.stroke(i)}function zF(e,t,n,r){const{segments:i,options:o}=t,s=cb(t);for(const a of i)tE(e,o,a.style),e.beginPath(),s(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const BF=typeof Path2D=="function";function VF(e,t,n,r){BF&&!t.options.segment?jF(e,t,n,r):zF(e,t,n,r)}class Go extends uo{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const i=r.spanGaps?this._loop:this._fullLoop;M9(this._points,r,t,i,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=W9(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,r=t.length;return r&&n[t[r-1].end]}interpolate(t,n){const r=this.options,i=t[n],o=this.points,s=dC(this,{property:n,start:i,end:i});if(!s.length)return;const a=[],l=FF(r);let c,d;for(c=0,d=s.length;c<d;++c){const{start:f,end:g}=s[c],p=o[f],v=o[g];if(p===v){a.push(p);continue}const y=Math.abs((i-p[n])/(v[n]-p[n])),x=l(p,v,y,r.stepped);x[n]=t[n],a.push(x)}return a.length===1?a[0]:a}pathSegment(t,n,r){return cb(this)(t,this,n,r)}path(t,n,r){const i=this.segments,o=cb(this);let s=this._loop;n=n||0,r=r||this.points.length-n;for(const a of i)s&=o(t,this,a,{start:n,end:n+r-1});return!!s}draw(t,n,r,i){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),VF(t,this,r,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}ke(Go,"id","line"),ke(Go,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),ke(Go,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),ke(Go,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function rE(e,t,n,r){const i=e.options,{[n]:o}=e.getProps([n],r);return Math.abs(t-o)<i.radius+i.hitRadius}class fu extends uo{constructor(n){super();ke(this,"parsed");ke(this,"skip");ke(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,r,i){const o=this.options,{x:s,y:a}=this.getProps(["x","y"],i);return Math.pow(n-s,2)+Math.pow(r-a,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(n,r){return rE(this,n,"x",r)}inYRange(n,r){return rE(this,n,"y",r)}getCenterPoint(n){const{x:r,y:i}=this.getProps(["x","y"],n);return{x:r,y:i}}size(n){n=n||this.options||{};let r=n.radius||0;r=Math.max(r,r&&n.hoverRadius||0);const i=r&&n.borderWidth||0;return(r+i)*2}draw(n,r){const i=this.options;this.skip||i.radius<.1||!lo(this,r,this.size(i)/2)||(n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.fillStyle=i.backgroundColor,Uv(n,i,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}ke(fu,"id","point"),ke(fu,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),ke(fu,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function iE(e,t){const{x:n,y:r,base:i,width:o,height:s}=e.getProps(["x","y","base","width","height"],t);let a,l,c,d,f;return e.horizontal?(f=s/2,a=Math.min(n,i),l=Math.max(n,i),c=r-f,d=r+f):(f=o/2,a=n-f,l=n+f,c=Math.min(r,i),d=Math.max(r,i)),{left:a,top:c,right:l,bottom:d}}function Yo(e,t,n,r){return e?0:kn(t,n,r)}function HF(e,t,n){const r=e.options.borderWidth,i=e.borderSkipped,o=KS(r);return{t:Yo(i.top,o.top,0,n),r:Yo(i.right,o.right,0,t),b:Yo(i.bottom,o.bottom,0,n),l:Yo(i.left,o.left,0,t)}}function WF(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),i=e.options.borderRadius,o=Xs(i),s=Math.min(t,n),a=e.borderSkipped,l=r||wt(i);return{topLeft:Yo(!l||a.top||a.left,o.topLeft,0,s),topRight:Yo(!l||a.top||a.right,o.topRight,0,s),bottomLeft:Yo(!l||a.bottom||a.left,o.bottomLeft,0,s),bottomRight:Yo(!l||a.bottom||a.right,o.bottomRight,0,s)}}function qF(e){const t=iE(e),n=t.right-t.left,r=t.bottom-t.top,i=HF(e,n/2,r/2),o=WF(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:o},inner:{x:t.left+i.l,y:t.top+i.t,w:n-i.l-i.r,h:r-i.t-i.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,o.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(i.b,i.r))}}}}function ub(e,t,n,r){const i=t===null,o=n===null,a=e&&!(i&&o)&&iE(e,r);return a&&(i||so(t,a.left,a.right))&&(o||so(n,a.top,a.bottom))}function UF(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function GF(e,t){e.rect(t.x,t.y,t.w,t.h)}function db(e,t,n={}){const r=e.x!==n.x?-t:0,i=e.y!==n.y?-t:0,o=(e.x+e.w!==n.x+n.w?t:0)-r,s=(e.y+e.h!==n.y+n.h?t:0)-i;return{x:e.x+r,y:e.y+i,w:e.w+o,h:e.h+s,radius:e.radius}}class hu extends uo{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:n,options:{borderColor:r,backgroundColor:i}}=this,{inner:o,outer:s}=qF(this),a=UF(s.radius)?nu:GF;t.save(),(s.w!==o.w||s.h!==o.h)&&(t.beginPath(),a(t,db(s,n,o)),t.clip(),a(t,db(o,-n,s)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),a(t,db(o,n)),t.fillStyle=i,t.fill(),t.restore()}inRange(t,n,r){return ub(this,t,n,r)}inXRange(t,n){return ub(this,t,null,n)}inYRange(t,n){return ub(this,null,t,n)}getCenterPoint(t){const{x:n,y:r,base:i,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(n+i)/2:n,y:o?r:(r+i)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}ke(hu,"id","bar"),ke(hu,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),ke(hu,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var YF=Object.freeze({__proto__:null,ArcElement:bl,BarElement:hu,LineElement:Go,PointElement:fu});const fb=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],oE=fb.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function sE(e){return fb[e%fb.length]}function aE(e){return oE[e%oE.length]}function KF(e,t){return e.borderColor=sE(t),e.backgroundColor=aE(t),++t}function XF(e,t){return e.backgroundColor=e.data.map(()=>sE(t++)),t}function QF(e,t){return e.backgroundColor=e.data.map(()=>aE(t++)),t}function JF(e){let t=0;return(n,r)=>{const i=e.getDatasetMeta(r).controller;i instanceof ea?t=XF(n,t):i instanceof iu?t=QF(n,t):i&&(t=KF(n,t))}}function lE(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function ZF(e){return e&&(e.borderColor||e.backgroundColor)}var e8={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:r},options:i}=e.config,{elements:o}=i;if(!n.forceOverride&&(lE(r)||ZF(i)||o&&lE(o)))return;const s=JF(e);r.forEach(s)}};function t8(e,t,n,r,i){const o=i.samples||r;if(o>=n)return e.slice(t,t+n);const s=[],a=(n-2)/(o-2);let l=0;const c=t+n-1;let d=t,f,g,p,v,y;for(s[l++]=e[d],f=0;f<o-2;f++){let x=0,w=0,S;const C=Math.floor((f+1)*a)+1+t,P=Math.min(Math.floor((f+2)*a)+1,n)+t,O=P-C;for(S=C;S<P;S++)x+=e[S].x,w+=e[S].y;x/=O,w/=O;const k=Math.floor(f*a)+1+t,A=Math.min(Math.floor((f+1)*a)+1,n)+t,{x:L,y:F}=e[d];for(p=v=-1,S=k;S<A;S++)v=.5*Math.abs((L-x)*(e[S].y-F)-(L-e[S].x)*(w-F)),v>p&&(p=v,g=e[S],y=S);s[l++]=g,d=y}return s[l++]=e[c],s}function n8(e,t,n,r){let i=0,o=0,s,a,l,c,d,f,g,p,v,y;const x=[],w=t+n-1,S=e[t].x,P=e[w].x-S;for(s=t;s<t+n;++s){a=e[s],l=(a.x-S)/P*r,c=a.y;const O=l|0;if(O===d)c<v?(v=c,f=s):c>y&&(y=c,g=s),i=(o*i+a.x)/++o;else{const k=s-1;if(!gt(f)&&!gt(g)){const A=Math.min(f,g),L=Math.max(f,g);A!==p&&A!==k&&x.push({...e[A],x:i}),L!==p&&L!==k&&x.push({...e[L],x:i})}s>0&&k!==p&&x.push(e[k]),x.push(a),d=O,o=0,v=y=c,f=g=p=s}}return x}function cE(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function uE(e){e.data.datasets.forEach(t=>{cE(t)})}function r8(e,t){const n=t.length;let r=0,i;const{iScale:o}=e,{min:s,max:a,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(r=kn(ao(t,o.axis,s).lo,0,n-1)),c?i=kn(ao(t,o.axis,a).hi+1,r,n)-r:i=n-r,{start:r,count:i}}var i8={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){uE(e);return}const r=e.width;e.data.datasets.forEach((i,o)=>{const{_data:s,indexAxis:a}=i,l=e.getDatasetMeta(o),c=s||i.data;if(Qt([a,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const d=e.scales[l.xAxisID];if(d.type!=="linear"&&d.type!=="time"||e.options.parsing)return;let{start:f,count:g}=r8(l,c);const p=n.threshold||4*r;if(g<=p){cE(i);return}gt(s)&&(i._data=c,delete i.data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(y){this._data=y}}));let v;switch(n.algorithm){case"lttb":v=t8(c,f,g,r,n);break;case"min-max":v=n8(c,f,g,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}i._decimated=v})},destroy(e){uE(e)}};function o8(e,t,n){const r=e.segments,i=e.points,o=t.points,s=[];for(const a of r){let{start:l,end:c}=a;c=pb(l,c,i);const d=hb(n,i[l],i[c],a.loop);if(!t.segments){s.push({source:a,target:d,start:i[l],end:i[c]});continue}const f=dC(t,d);for(const g of f){const p=hb(n,o[g.start],o[g.end],g.loop),v=uC(a,i,p);for(const y of v)s.push({source:y,target:g,start:{[n]:dE(d,p,"start",Math.max)},end:{[n]:dE(d,p,"end",Math.min)}})}}return s}function hb(e,t,n,r){if(r)return;let i=t[e],o=n[e];return e==="angle"&&(i=Pr(i),o=Pr(o)),{property:e,start:i,end:o}}function s8(e,t){const{x:n=null,y:r=null}=e||{},i=t.points,o=[];return t.segments.forEach(({start:s,end:a})=>{a=pb(s,a,i);const l=i[s],c=i[a];r!==null?(o.push({x:l.x,y:r}),o.push({x:c.x,y:r})):n!==null&&(o.push({x:n,y:l.y}),o.push({x:n,y:c.y}))}),o}function pb(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function dE(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function fE(e,t){let n=[],r=!1;return Yt(e)?(r=!0,n=e):n=s8(e,t),n.length?new Go({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function hE(e){return e&&e.fill!==!1}function a8(e,t,n){let i=e[t].fill;const o=[t];let s;if(!n)return i;for(;i!==!1&&o.indexOf(i)===-1;){if(!cn(i))return i;if(s=e[i],!s)return!1;if(s.visible)return i;o.push(i),i=s.fill}return!1}function l8(e,t,n){const r=f8(e);if(wt(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return cn(i)&&Math.floor(i)===i?c8(r[0],t,i,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function c8(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function u8(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:wt(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function d8(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:wt(e)?r=e.value:r=t.getBaseValue(),r}function f8(e){const t=e.options,n=t.fill;let r=tt(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function h8(e){const{scale:t,index:n,line:r}=e,i=[],o=r.segments,s=r.points,a=p8(t,n);a.push(fE({x:null,y:t.bottom},r));for(let l=0;l<o.length;l++){const c=o[l];for(let d=c.start;d<=c.end;d++)g8(i,s[d],a)}return new Go({points:i,options:{}})}function p8(e,t){const n=[],r=e.getMatchingVisibleMetas("line");for(let i=0;i<r.length;i++){const o=r[i];if(o.index===t)break;o.hidden||n.unshift(o.dataset)}return n}function g8(e,t,n){const r=[];for(let i=0;i<n.length;i++){const o=n[i],{first:s,last:a,point:l}=m8(o,t,"x");if(!(!l||s&&a)){if(s)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function m8(e,t,n){const r=e.interpolate(t,n);if(!r)return{};const i=r[n],o=e.segments,s=e.points;let a=!1,l=!1;for(let c=0;c<o.length;c++){const d=o[c],f=s[d.start][n],g=s[d.end][n];if(so(i,f,g)){a=i===f,l=i===g;break}}return{first:a,last:l,point:r}}class pE{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,r){const{x:i,y:o,radius:s}=this;return n=n||{start:0,end:Xt},t.arc(i,o,s,n.end,n.start,!0),!r.bounds}interpolate(t){const{x:n,y:r,radius:i}=this,o=t.angle;return{x:n+Math.cos(o)*i,y:r+Math.sin(o)*i,angle:o}}}function v8(e){const{chart:t,fill:n,line:r}=e;if(cn(n))return b8(t,n);if(n==="stack")return h8(e);if(n==="shape")return!0;const i=y8(e);return i instanceof pE?i:fE(i,r)}function b8(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function y8(e){return(e.scale||{}).getPointPositionForValue?w8(e):x8(e)}function x8(e){const{scale:t={},fill:n}=e,r=u8(n,t);if(cn(r)){const i=t.isHorizontal();return{x:i?r:null,y:i?null:r}}return null}function w8(e){const{scale:t,fill:n}=e,r=t.options,i=t.getLabels().length,o=r.reverse?t.max:t.min,s=d8(n,t,o),a=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,o);return new pE({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(s)})}for(let l=0;l<i;++l)a.push(t.getPointPositionForValue(l,s));return a}function gb(e,t,n){const r=v8(t),{line:i,scale:o,axis:s}=t,a=i.options,l=a.fill,c=a.backgroundColor,{above:d=c,below:f=c}=l||{};r&&i.points.length&&(Wf(e,n),_8(e,{line:i,target:r,above:d,below:f,area:n,scale:o,axis:s}),qf(e))}function _8(e,t){const{line:n,target:r,above:i,below:o,area:s,scale:a}=t,l=n._loop?"angle":t.axis;e.save(),l==="x"&&o!==i&&(gE(e,r,s.top),mE(e,{line:n,target:r,color:i,scale:a,property:l}),e.restore(),e.save(),gE(e,r,s.bottom)),mE(e,{line:n,target:r,color:o,scale:a,property:l}),e.restore()}function gE(e,t,n){const{segments:r,points:i}=t;let o=!0,s=!1;e.beginPath();for(const a of r){const{start:l,end:c}=a,d=i[l],f=i[pb(l,c,i)];o?(e.moveTo(d.x,d.y),o=!1):(e.lineTo(d.x,n),e.lineTo(d.x,d.y)),s=!!t.pathSegment(e,a,{move:s}),s?e.closePath():e.lineTo(f.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function mE(e,t){const{line:n,target:r,property:i,color:o,scale:s}=t,a=o8(n,r,i);for(const{source:l,target:c,start:d,end:f}of a){const{style:{backgroundColor:g=o}={}}=l,p=r!==!0;e.save(),e.fillStyle=g,S8(e,s,p&&hb(i,d,f)),e.beginPath();const v=!!n.pathSegment(e,l);let y;if(p){v?e.closePath():vE(e,r,f,i);const x=!!r.pathSegment(e,c,{move:v,reverse:!0});y=v&&x,y||vE(e,r,d,i)}e.closePath(),e.fill(y?"evenodd":"nonzero"),e.restore()}}function S8(e,t,n){const{top:r,bottom:i}=t.chart.chartArea,{property:o,start:s,end:a}=n||{};o==="x"&&(e.beginPath(),e.rect(s,r,a-s,i-r),e.clip())}function vE(e,t,n,r){const i=t.interpolate(n,r);i&&e.lineTo(i.x,i.y)}var C8={id:"filler",afterDatasetsUpdate(e,t,n){const r=(e.data.datasets||[]).length,i=[];let o,s,a,l;for(s=0;s<r;++s)o=e.getDatasetMeta(s),a=o.dataset,l=null,a&&a.options&&a instanceof Go&&(l={visible:e.isDatasetVisible(s),index:s,fill:l8(a,s,r),chart:e,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=l,i.push(l);for(s=0;s<r;++s)l=i[s],!(!l||l.fill===!1)&&(l.fill=a8(i,s,n.propagate))},beforeDraw(e,t,n){const r=n.drawTime==="beforeDraw",i=e.getSortedVisibleDatasetMetas(),o=e.chartArea;for(let s=i.length-1;s>=0;--s){const a=i[s].$filler;a&&(a.line.updateControlPoints(o,a.axis),r&&a.fill&&gb(e.ctx,a,o))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const r=e.getSortedVisibleDatasetMetas();for(let i=r.length-1;i>=0;--i){const o=r[i].$filler;hE(o)&&gb(e.ctx,o,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!hE(r)||n.drawTime!=="beforeDatasetDraw"||gb(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const bE=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},E8=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class yE extends uo{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,r){this.maxWidth=t,this.maxHeight=n,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=Ft(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,i)=>t.sort(r,i,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const r=t.labels,i=bn(r.font),o=i.size,s=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=bE(r,o);let c,d;n.font=i.string,this.isHorizontal()?(c=this.maxWidth,d=this._fitRows(s,o,a,l)+10):(d=this.maxHeight,c=this._fitCols(s,i,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(d,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,i){const{ctx:o,maxWidth:s,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],d=i+a;let f=t;o.textAlign="left",o.textBaseline="middle";let g=-1,p=-d;return this.legendItems.forEach((v,y)=>{const x=r+n/2+o.measureText(v.text).width;(y===0||c[c.length-1]+x+2*a>s)&&(f+=d,c[c.length-(y>0?0:1)]=0,p+=d,g++),l[y]={left:0,top:p,row:g,width:x,height:i},c[c.length-1]+=x+a}),f}_fitCols(t,n,r,i){const{ctx:o,maxHeight:s,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],d=s-t;let f=a,g=0,p=0,v=0,y=0;return this.legendItems.forEach((x,w)=>{const{itemWidth:S,itemHeight:C}=O8(r,n,o,x,i);w>0&&p+C+2*a>d&&(f+=g+a,c.push({width:g,height:p}),v+=g+a,y++,g=p=0),l[w]={left:v,top:p,col:y,width:S,height:C},g=Math.max(g,S),p+=C+a}),f+=g,c.push({width:g,height:p}),f}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:i},rtl:o}}=this,s=ml(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=qn(r,this.left+i,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=qn(r,this.left+i,this.right-this.lineWidths[a])),c.top+=this.top+t+i,c.left=s.leftForLtr(s.x(l),c.width),l+=c.width+i}else{let a=0,l=qn(r,this.top+t+i,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=qn(r,this.top+t+i,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+i,c.left=s.leftForLtr(s.x(c.left),c.width),l+=c.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Wf(t,this),this._draw(),qf(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:i}=this,{align:o,labels:s}=t,a=on.color,l=ml(t.rtl,this.left,this.width),c=bn(s.font),{padding:d}=s,f=c.size,g=f/2;let p;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=c.string;const{boxWidth:v,boxHeight:y,itemHeight:x}=bE(s,f),w=function(k,A,L){if(isNaN(v)||v<=0||isNaN(y)||y<0)return;i.save();const F=tt(L.lineWidth,1);if(i.fillStyle=tt(L.fillStyle,a),i.lineCap=tt(L.lineCap,"butt"),i.lineDashOffset=tt(L.lineDashOffset,0),i.lineJoin=tt(L.lineJoin,"miter"),i.lineWidth=F,i.strokeStyle=tt(L.strokeStyle,a),i.setLineDash(tt(L.lineDash,[])),s.usePointStyle){const j={radius:y*Math.SQRT2/2,pointStyle:L.pointStyle,rotation:L.rotation,borderWidth:F},B=l.xPlus(k,v/2),V=A+g;YS(i,j,B,V,s.pointStyleWidth&&v)}else{const j=A+Math.max((f-y)/2,0),B=l.leftForLtr(k,v),V=Xs(L.borderRadius);i.beginPath(),Object.values(V).some(K=>K!==0)?nu(i,{x:B,y:j,w:v,h:y,radius:V}):i.rect(B,j,v,y),i.fill(),F!==0&&i.stroke()}i.restore()},S=function(k,A,L){Ks(i,L.text,k,A+x/2,c,{strikethrough:L.hidden,textAlign:l.textAlign(L.textAlign)})},C=this.isHorizontal(),P=this._computeTitleHeight();C?p={x:qn(o,this.left+d,this.right-r[0]),y:this.top+d+P,line:0}:p={x:this.left+d,y:qn(o,this.top+P+d,this.bottom-n[0].height),line:0},sC(this.ctx,t.textDirection);const O=x+d;this.legendItems.forEach((k,A)=>{i.strokeStyle=k.fontColor,i.fillStyle=k.fontColor;const L=i.measureText(k.text).width,F=l.textAlign(k.textAlign||(k.textAlign=s.textAlign)),j=v+g+L;let B=p.x,V=p.y;l.setWidth(this.width),C?A>0&&B+j+d>this.right&&(V=p.y+=O,p.line++,B=p.x=qn(o,this.left+d,this.right-r[p.line])):A>0&&V+O>this.bottom&&(B=p.x=B+n[p.line].width+d,p.line++,V=p.y=qn(o,this.top+P+d,this.bottom-n[p.line].height));const K=l.x(B);if(w(K,V,k),B=GL(F,B+v+g,C?B+j:this.right,t.rtl),S(l.x(B),V,k),C)p.x+=j+d;else if(typeof k.text!="string"){const Y=c.lineHeight;p.y+=xE(k,Y)+d}else p.y+=O}),aC(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=bn(n.font),i=Rn(n.padding);if(!n.display)return;const o=ml(t.rtl,this.left,this.width),s=this.ctx,a=n.position,l=r.size/2,c=i.top+l;let d,f=this.left,g=this.width;if(this.isHorizontal())g=Math.max(...this.lineWidths),d=this.top+c,f=qn(t.align,f,this.right-g);else{const v=this.columnSizes.reduce((y,x)=>Math.max(y,x.height),0);d=c+qn(t.align,this.top,this.bottom-v-t.labels.padding-this._computeTitleHeight())}const p=qn(a,f,f+g);s.textAlign=o.textAlign(Bv(a)),s.textBaseline="middle",s.strokeStyle=n.color,s.fillStyle=n.color,s.font=r.string,Ks(s,n.text,p,d,r)}_computeTitleHeight(){const t=this.options.title,n=bn(t.font),r=Rn(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,i,o;if(so(t,this.left,this.right)&&so(n,this.top,this.bottom)){for(o=this.legendHitBoxes,r=0;r<o.length;++r)if(i=o[r],so(t,i.left,i.left+i.width)&&so(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!M8(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,o=E8(i,r);i&&!o&&Ft(n.onLeave,[t,i,this],this),this._hoveredItem=r,r&&!o&&Ft(n.onHover,[t,r,this],this)}else r&&Ft(n.onClick,[t,r,this],this)}}function O8(e,t,n,r,i){const o=P8(r,e,t,n),s=k8(i,r,t.lineHeight);return{itemWidth:o,itemHeight:s}}function P8(e,t,n,r){let i=e.text;return i&&typeof i!="string"&&(i=i.reduce((o,s)=>o.length>s.length?o:s)),t+n.size/2+r.measureText(i).width}function k8(e,t,n){let r=e;return typeof t.text!="string"&&(r=xE(t,n)),r}function xE(e,t){const n=e.text?e.text.length:0;return t*n}function M8(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var D8={id:"legend",_element:yE,start(e,t,n){const r=e.legend=new yE({ctx:e.ctx,options:n,chart:e});Un.configure(e,r,n),Un.addBox(e,r)},stop(e){Un.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;Un.configure(e,r,n),r.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const r=t.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:i,color:o,useBorderRadius:s,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),d=Rn(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(d.width+d.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:i||c.textAlign,borderRadius:s&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class mb extends uo{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const i=Yt(r.text)?r.text.length:1;this._padding=Rn(r.padding);const o=i*bn(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:i,right:o,options:s}=this,a=s.align;let l=0,c,d,f;return this.isHorizontal()?(d=qn(a,r,o),f=n+t,c=o-r):(s.position==="left"?(d=r+t,f=qn(a,i,n),l=Kt*-.5):(d=o-t,f=qn(a,n,i),l=Kt*.5),c=i-n),{titleX:d,titleY:f,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=bn(n.font),o=r.lineHeight/2+this._padding.top,{titleX:s,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);Ks(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:c,textAlign:Bv(n.align),textBaseline:"middle",translation:[s,a]})}}function T8(e,t){const n=new mb({ctx:e.ctx,options:t,chart:e});Un.configure(e,n,t),Un.addBox(e,n),e.titleBlock=n}var A8={id:"title",_element:mb,start(e,t,n){T8(e,n)},stop(e){const t=e.titleBlock;Un.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;Un.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const uh=new WeakMap;var I8={id:"subtitle",start(e,t,n){const r=new mb({ctx:e.ctx,options:n,chart:e});Un.configure(e,r,n),Un.addBox(e,r),uh.set(e,r)},stop(e){Un.removeBox(e,uh.get(e)),uh.delete(e)},beforeUpdate(e,t,n){const r=uh.get(e);Un.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const pu={average(e){if(!e.length)return!1;let t,n,r=0,i=0,o=0;for(t=0,n=e.length;t<n;++t){const s=e[t].element;if(s&&s.hasValue()){const a=s.tooltipPosition();r+=a.x,i+=a.y,++o}}return{x:r/o,y:i/o}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=Number.POSITIVE_INFINITY,o,s,a;for(o=0,s=e.length;o<s;++o){const l=e[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),d=jv(t,c);d<i&&(i=d,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function Ri(e,t){return t&&(Yt(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function fo(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
|
121
|
+
*/class G9{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,i){const o=n.listeners[i],s=n.duration;o.forEach(a=>a({chart:t,initial:n.initial,numSteps:s,currentStep:Math.min(r-n.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=FS.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,i)=>{if(!r.running||!r.items.length)return;const o=r.items;let s=o.length-1,a=!1,l;for(;s>=0;--s)l=o[s],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),a=!0):(o[s]=o[o.length-1],o.pop());a&&(i.draw(),this._notify(i,r,t,"progress")),o.length||(r.running=!1,this._notify(i,r,t,"complete"),r.initial=!1),n+=o.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let r=n.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,r)),r}listen(t,n,r){this._getAnims(t).listeners[n].push(r)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,i)=>Math.max(r,i._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const r=n.items;let i=r.length-1;for(;i>=0;--i)r[i].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var co=new G9;const pC="transparent",Y9={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=WS(e||pC),i=r.valid&&WS(t||pC);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class K9{constructor(t,n,r,i){const o=n[r];i=Qt([t.to,i,o,t.from]);const s=Qt([t.from,o,i]);this._active=!0,this._fn=t.fn||Y9[t.type||typeof s],this._easing=Zc[t.easing]||Zc.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=s,this._to=i,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const i=this._target[this._prop],o=r-this._start,s=this._duration-o;this._start=r,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Qt([t.to,n,i,t.from]),this._from=Qt([t.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,i=this._prop,o=this._from,s=this._loop,a=this._to;let l;if(this._active=o!==a&&(s||n<r),!this._active){this._target[i]=a,this._notify(!0);return}if(n<0){this._target[i]=o;return}l=n/r%2,l=s&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,r)=>{t.push({res:n,rej:r})})}_notify(t){const n=t?"res":"rej",r=this._promises||[];for(let i=0;i<r.length;i++)r[i][n]()}}class gC{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!wt(t))return;const n=Object.keys(on.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const o=t[i];if(!wt(o))return;const s={};for(const a of n)s[a]=o[a];(Yt(o.properties)&&o.properties||[i]).forEach(a=>{(a===i||!r.has(a))&&r.set(a,s)})})}_animateOptions(t,n){const r=n.options,i=Q9(t,r);if(!i)return[];const o=this._createAnimations(i,r);return r.$shared&&X9(t.options.$animations,r).then(()=>{t.options=r},()=>{}),o}_createAnimations(t,n){const r=this._properties,i=[],o=t.$animations||(t.$animations={}),s=Object.keys(n),a=Date.now();let l;for(l=s.length-1;l>=0;--l){const c=s[l];if(c.charAt(0)==="$")continue;if(c==="options"){i.push(...this._animateOptions(t,n));continue}const d=n[c];let f=o[c];const g=r.get(c);if(f)if(g&&f.active()){f.update(g,d,a);continue}else f.cancel();if(!g||!g.duration){t[c]=d;continue}o[c]=f=new K9(g,t,c,d),i.push(f)}return i}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return co.add(this._chart,r),!0}}function X9(e,t){const n=[],r=Object.keys(t);for(let i=0;i<r.length;i++){const o=e[r[i]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function Q9(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function mC(e,t){const n=e&&e.options||{},r=n.reverse,i=n.min===void 0?t:0,o=n.max===void 0?t:0;return{start:r?o:i,end:r?i:o}}function J9(e,t,n){if(n===!1)return!1;const r=mC(e,n),i=mC(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function Z9(e){let t,n,r,i;return wt(e)?(t=e.top,n=e.right,r=e.bottom,i=e.left):t=n=r=i=e,{top:t,right:n,bottom:r,left:i,disabled:e===!1}}function vC(e,t){const n=[],r=e._getSortedDatasetMetas(t);let i,o;for(i=0,o=r.length;i<o;++i)n.push(r[i].index);return n}function bC(e,t,n,r={}){const i=e.keys,o=r.mode==="single";let s,a,l,c;if(t!==null){for(s=0,a=i.length;s<a;++s){if(l=+i[s],l===n){if(r.all)continue;break}c=e.values[l],ln(c)&&(o||t===0||Ii(t)===Ii(c))&&(t+=c)}return t}}function e$(e){const t=Object.keys(e),n=new Array(t.length);let r,i,o;for(r=0,i=t.length;r<i;++r)o=t[r],n[r]={x:o,y:e[o]};return n}function yC(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function t$(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function n$(e){const{min:t,max:n,minDefined:r,maxDefined:i}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:i?n:Number.POSITIVE_INFINITY}}function r$(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function xC(e,t,n,r){for(const i of t.getMatchingVisibleMetas(r).reverse()){const o=e[i.index];if(n&&o>0||!n&&o<0)return i.index}return null}function wC(e,t){const{chart:n,_cachedMeta:r}=e,i=n._stacks||(n._stacks={}),{iScale:o,vScale:s,index:a}=r,l=o.axis,c=s.axis,d=t$(o,s,r),f=t.length;let g;for(let p=0;p<f;++p){const v=t[p],{[l]:y,[c]:x}=v,w=v._stacks||(v._stacks={});g=w[c]=r$(i,d,y),g[a]=x,g._top=xC(g,s,!0,r.type),g._bottom=xC(g,s,!1,r.type);const S=g._visualValues||(g._visualValues={});S[a]=x}}function Zv(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function i$(e,t){return Uo(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function o$(e,t,n){return Uo(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function ru(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const i of t){const o=i._stacks;if(!o||o[r]===void 0||o[r][n]===void 0)return;delete o[r][n],o[r]._visualValues!==void 0&&o[r]._visualValues[n]!==void 0&&delete o[r]._visualValues[n]}}}const eb=e=>e==="reset"||e==="none",_C=(e,t)=>t?e:Object.assign({},e),s$=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:vC(n,!0),values:null};class vi{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=yC(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&ru(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(f,g,p,v)=>f==="x"?g:f==="r"?v:p,o=n.xAxisID=tt(r.xAxisID,Zv(t,"x")),s=n.yAxisID=tt(r.yAxisID,Zv(t,"y")),a=n.rAxisID=tt(r.rAxisID,Zv(t,"r")),l=n.indexAxis,c=n.iAxisID=i(l,o,s,a),d=n.vAxisID=i(l,s,o,a);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(s),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(d)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&LS(this._data,this),t._stacked&&ru(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(wt(n))this._data=e$(n);else if(r!==n){if(r){LS(r,this);const i=this._cachedMeta;ru(i),i._parsed=[]}n&&Object.isExtensible(n)&&qL(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,r=this.getDataset();let i=!1;this._dataCheck();const o=n._stacked;n._stacked=yC(n.vScale,n),n.stack!==r.stack&&(i=!0,ru(n),n.stack=r.stack),this._resyncElements(t),(i||o!==n._stacked)&&wC(this,n._parsed)}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:i}=this,{iScale:o,_stacked:s}=r,a=o.axis;let l=t===0&&n===i.length?!0:r._sorted,c=t>0&&r._parsed[t-1],d,f,g;if(this._parsing===!1)r._parsed=i,r._sorted=!0,g=i;else{Yt(i[t])?g=this.parseArrayData(r,i,t,n):wt(i[t])?g=this.parseObjectData(r,i,t,n):g=this.parsePrimitiveData(r,i,t,n);const p=()=>f[a]===null||c&&f[a]<c[a];for(d=0;d<n;++d)r._parsed[d+t]=f=g[d],l&&(p()&&(l=!1),c=f);r._sorted=l}s&&wC(this,g)}parsePrimitiveData(t,n,r,i){const{iScale:o,vScale:s}=t,a=o.axis,l=s.axis,c=o.getLabels(),d=o===s,f=new Array(i);let g,p,v;for(g=0,p=i;g<p;++g)v=g+r,f[g]={[a]:d||o.parse(c[v],v),[l]:s.parse(n[v],v)};return f}parseArrayData(t,n,r,i){const{xScale:o,yScale:s}=t,a=new Array(i);let l,c,d,f;for(l=0,c=i;l<c;++l)d=l+r,f=n[d],a[l]={x:o.parse(f[0],d),y:s.parse(f[1],d)};return a}parseObjectData(t,n,r,i){const{xScale:o,yScale:s}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(i);let d,f,g,p;for(d=0,f=i;d<f;++d)g=d+r,p=n[g],c[d]={x:o.parse(Ho(p,a),g),y:s.parse(Ho(p,l),g)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const i=this.chart,o=this._cachedMeta,s=n[t.axis],a={keys:vC(i,!0),values:n._stacks[t.axis]._visualValues};return bC(a,s,o.index,{mode:r})}updateRangeFromParsed(t,n,r,i){const o=r[n.axis];let s=o===null?NaN:o;const a=i&&r._stacks[n.axis];i&&a&&(i.values=a,s=bC(i,o,this._cachedMeta.index)),t.min=Math.min(t.min,s),t.max=Math.max(t.max,s)}getMinMax(t,n){const r=this._cachedMeta,i=r._parsed,o=r._sorted&&t===r.iScale,s=i.length,a=this._getOtherScale(t),l=s$(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:f}=n$(a);let g,p;function v(){p=i[g];const y=p[a.axis];return!ln(p[t.axis])||d>y||f<y}for(g=0;g<s&&!(!v()&&(this.updateRangeFromParsed(c,t,p,l),o));++g);if(o){for(g=s-1;g>=0;--g)if(!v()){this.updateRangeFromParsed(c,t,p,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let i,o,s;for(i=0,o=n.length;i<o;++i)s=n[i][t.axis],ln(s)&&r.push(s);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,i=n.vScale,o=this.getParsed(t);return{label:r?""+r.getLabelForValue(o[r.axis]):"",value:i?""+i.getLabelForValue(o[i.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=Z9(tt(this.options.clip,J9(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,i=r.data||[],o=n.chartArea,s=[],a=this._drawStart||0,l=this._drawCount||i.length-a,c=this.options.drawActiveElementsOnTop;let d;for(r.dataset&&r.dataset.draw(t,o,a,l),d=a;d<a+l;++d){const f=i[d];f.hidden||(f.active&&c?s.push(f):f.draw(t,o))}for(d=0;d<s.length;++d)s[d].draw(t,o)}getStyle(t,n){const r=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(t||0,r)}getContext(t,n,r){const i=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const s=this._cachedMeta.data[t];o=s.$context||(s.$context=o$(this.getContext(),t,s)),o.parsed=this.getParsed(t),o.raw=i.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=i$(this.chart.getContext(),this.index)),o.dataset=i,o.index=o.datasetIndex=this.index;return o.active=!!n,o.mode=r,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",r){const i=n==="active",o=this._cachedDataOpts,s=t+"-"+n,a=o[s],l=this.enableOptionSharing&&Xc(r);if(a)return _C(a,l);const c=this.chart.config,d=c.datasetElementScopeKeys(this._type,t),f=i?[`${t}Hover`,"hover",t,""]:[t,""],g=c.getOptionScopes(this.getDataset(),d),p=Object.keys(on.elements[t]),v=()=>this.getContext(r,i,n),y=c.resolveNamedOptions(g,p,v,f);return y.$shared&&(y.$shared=l,o[s]=Object.freeze(_C(y,l))),y}_resolveAnimations(t,n,r){const i=this.chart,o=this._cachedDataOpts,s=`animation-${n}`,a=o[s];if(a)return a;let l;if(i.options.animation!==!1){const d=this.chart.config,f=d.datasetAnimationScopeKeys(this._type,n),g=d.getOptionScopes(this.getDataset(),f);l=d.createResolver(g,this.getContext(t,r,n))}const c=new gC(i,l&&l.animations);return l&&l._cacheable&&(o[s]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||eb(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),i=this._sharedOptions,o=this.getSharedOptions(r),s=this.includeOptions(n,o)||o!==i;return this.updateSharedOptions(o,n,r),{sharedOptions:o,includeOptions:s}}updateElement(t,n,r,i){eb(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!eb(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,i){t.active=i;const o=this.getStyle(n,i);this._resolveAnimations(n,r,i).update(t,{options:!i&&this.getSharedOptions(o)||o})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,r=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const i=r.length,o=n.length,s=Math.min(o,i);s&&this.parse(0,s),o>i?this._insertElements(i,o-i,t):o<i&&this._removeElements(o,i-o)}_insertElements(t,n,r=!0){const i=this._cachedMeta,o=i.data,s=t+n;let a;const l=c=>{for(c.length+=n,a=c.length-1;a>=s;a--)c[a]=c[a-n]};for(l(o),a=t;a<s;++a)o[a]=new this.dataElementType;this._parsing&&l(i._parsed),this.parse(t,n),r&&this.updateElements(o,t,n,"reset")}updateElements(t,n,r,i){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const i=r._parsed.splice(t,n);r._stacked&&ru(r,i)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,i]=t;this[n](r,i)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}ke(vi,"defaults",{}),ke(vi,"datasetElementType",null),ke(vi,"dataElementType",null);function a$(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let r=[];for(let i=0,o=n.length;i<o;i++)r=r.concat(n[i].controller.getAllParsedValues(e));e._cache.$bar=$S(r.sort((i,o)=>i-o))}return e._cache.$bar}function l$(e){const t=e.iScale,n=a$(t,e.type);let r=t._length,i,o,s,a;const l=()=>{s===32767||s===-32768||(Xc(a)&&(r=Math.min(r,Math.abs(s-a)||r)),a=s)};for(i=0,o=n.length;i<o;++i)s=t.getPixelForValue(n[i]),l();for(a=void 0,i=0,o=t.ticks.length;i<o;++i)s=t.getPixelForTick(i),l();return r}function c$(e,t,n,r){const i=n.barThickness;let o,s;return gt(i)?(o=t.min*n.categoryPercentage,s=n.barPercentage):(o=i*r,s=1),{chunk:o/r,ratio:s,start:t.pixels[e]-o/2}}function u$(e,t,n,r){const i=t.pixels,o=i[e];let s=e>0?i[e-1]:null,a=e<i.length-1?i[e+1]:null;const l=n.categoryPercentage;s===null&&(s=o-(a===null?t.end-t.start:a-o)),a===null&&(a=o+o-s);const c=o-(o-Math.min(s,a))/2*l;return{chunk:Math.abs(a-s)/2*l/r,ratio:n.barPercentage,start:c}}function d$(e,t,n,r){const i=n.parse(e[0],r),o=n.parse(e[1],r),s=Math.min(i,o),a=Math.max(i,o);let l=s,c=a;Math.abs(s)>Math.abs(a)&&(l=a,c=s),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:i,end:o,min:s,max:a}}function SC(e,t,n,r){return Yt(e)?d$(e,t,n,r):t[n.axis]=n.parse(e,r),t}function CC(e,t,n,r){const i=e.iScale,o=e.vScale,s=i.getLabels(),a=i===o,l=[];let c,d,f,g;for(c=n,d=n+r;c<d;++c)g=t[c],f={},f[i.axis]=a||i.parse(s[c],c),l.push(SC(g,f,o,c));return l}function tb(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function f$(e,t,n){return e!==0?Ii(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function h$(e){let t,n,r,i,o;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(i="end",o="start"):(i="start",o="end"),{start:n,end:r,reverse:t,top:i,bottom:o}}function p$(e,t,n,r){let i=t.borderSkipped;const o={};if(!i){e.borderSkipped=o;return}if(i===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:s,end:a,reverse:l,top:c,bottom:d}=h$(e);i==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?i=c:(n._bottom||0)===r?i=d:(o[EC(d,s,a,l)]=!0,i=c)),o[EC(i,s,a,l)]=!0,e.borderSkipped=o}function EC(e,t,n,r){return r?(e=g$(e,t,n),e=OC(e,n,t)):e=OC(e,t,n),e}function g$(e,t,n){return e===t?n:e===n?t:e}function OC(e,t,n){return e==="start"?t:e==="end"?n:e}function m$(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class Xf extends vi{parsePrimitiveData(t,n,r,i){return CC(t,n,r,i)}parseArrayData(t,n,r,i){return CC(t,n,r,i)}parseObjectData(t,n,r,i){const{iScale:o,vScale:s}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?a:l,d=s.axis==="x"?a:l,f=[];let g,p,v,y;for(g=r,p=r+i;g<p;++g)y=n[g],v={},v[o.axis]=o.parse(Ho(y,c),g),f.push(SC(Ho(y,d),v,s,g));return f}updateRangeFromParsed(t,n,r,i){super.updateRangeFromParsed(t,n,r,i);const o=r._custom;o&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:r,vScale:i}=n,o=this.getParsed(t),s=o._custom,a=tb(s)?"["+s.start+", "+s.end+"]":""+i.getLabelForValue(o[i.axis]);return{label:""+r.getLabelForValue(o[r.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,r,i){const o=i==="reset",{index:s,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),d=this._getRuler(),{sharedOptions:f,includeOptions:g}=this._getSharedOptions(n,i);for(let p=n;p<n+r;p++){const v=this.getParsed(p),y=o||gt(v[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(p),x=this._calculateBarIndexPixels(p,d),w=(v._stacks||{})[a.axis],S={horizontal:c,base:y.base,enableBorderRadius:!w||tb(v._custom)||s===w._top||s===w._bottom,x:c?y.head:x.center,y:c?x.center:y.head,height:c?x.size:Math.abs(y.size),width:c?Math.abs(y.size):x.size};g&&(S.options=f||this.resolveDataElementOptions(p,t[p].active?"active":i));const C=S.options||t[p].options;p$(S,C,w,s),m$(S,C,d.ratio),this.updateElement(t[p],p,S,i)}}_getStacks(t,n){const{iScale:r}=this._cachedMeta,i=r.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),o=r.options.stacked,s=[],a=l=>{const c=l.controller.getParsed(n),d=c&&c[l.vScale.axis];if(gt(d)||isNaN(d))return!0};for(const l of i)if(!(n!==void 0&&a(l))&&((o===!1||s.indexOf(l.stack)===-1||o===void 0&&l.stack===void 0)&&s.push(l.stack),l.index===t))break;return s.length||s.push(void 0),s}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,n,r){const i=this._getStacks(t,r),o=n!==void 0?i.indexOf(n):-1;return o===-1?i.length-1:o}_getRuler(){const t=this.options,n=this._cachedMeta,r=n.iScale,i=[];let o,s;for(o=0,s=n.data.length;o<s;++o)i.push(r.getPixelForValue(this.getParsed(o)[r.axis],o));const a=t.barThickness;return{min:a||l$(n),pixels:i,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:r,index:i},options:{base:o,minBarLength:s}}=this,a=o||0,l=this.getParsed(t),c=l._custom,d=tb(c);let f=l[n.axis],g=0,p=r?this.applyStack(n,l,r):f,v,y;p!==f&&(g=p-f,p=f),d&&(f=c.barStart,p=c.barEnd-c.barStart,f!==0&&Ii(f)!==Ii(c.barEnd)&&(g=0),g+=f);const x=!gt(o)&&!d?o:g;let w=n.getPixelForValue(x);if(this.chart.getDataVisibility(t)?v=n.getPixelForValue(g+p):v=w,y=v-w,Math.abs(y)<s){y=f$(y,n,a)*s,f===a&&(w-=y/2);const S=n.getPixelForDecimal(0),C=n.getPixelForDecimal(1),P=Math.min(S,C),O=Math.max(S,C);w=Math.max(Math.min(w,O),P),v=w+y,r&&!d&&(l._stacks[n.axis]._visualValues[i]=n.getValueForPixel(v)-n.getValueForPixel(w))}if(w===n.getPixelForValue(a)){const S=Ii(y)*n.getLineWidthForValue(a)/2;w+=S,y-=S}return{size:y,base:w,head:v,center:v+y/2}}_calculateBarIndexPixels(t,n){const r=n.scale,i=this.options,o=i.skipNull,s=tt(i.maxBarThickness,1/0);let a,l;if(n.grouped){const c=o?this._getStackCount(t):n.stackCount,d=i.barThickness==="flex"?u$(t,n,i,c):c$(t,n,i,c),f=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);a=d.start+d.chunk*f+d.chunk/2,l=Math.min(s,d.chunk*d.ratio)}else a=r.getPixelForValue(this.getParsed(t)[r.axis],t),l=Math.min(s,n.min*n.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,n=t.vScale,r=t.data,i=r.length;let o=0;for(;o<i;++o)this.getParsed(o)[n.axis]!==null&&r[o].draw(this._ctx)}}ke(Xf,"id","bar"),ke(Xf,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),ke(Xf,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Qf extends vi{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,r,i){const o=super.parsePrimitiveData(t,n,r,i);for(let s=0;s<o.length;s++)o[s]._custom=this.resolveDataElementOptions(s+r).radius;return o}parseArrayData(t,n,r,i){const o=super.parseArrayData(t,n,r,i);for(let s=0;s<o.length;s++){const a=n[r+s];o[s]._custom=tt(a[2],this.resolveDataElementOptions(s+r).radius)}return o}parseObjectData(t,n,r,i){const o=super.parseObjectData(t,n,r,i);for(let s=0;s<o.length;s++){const a=n[r+s];o[s]._custom=tt(a&&a.r&&+a.r,this.resolveDataElementOptions(s+r).radius)}return o}getMaxOverflow(){const t=this._cachedMeta.data;let n=0;for(let r=t.length-1;r>=0;--r)n=Math.max(n,t[r].size(this.resolveDataElementOptions(r))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:i,yScale:o}=n,s=this.getParsed(t),a=i.getLabelForValue(s.x),l=o.getLabelForValue(s.y),c=s._custom;return{label:r[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,r,i){const o=i==="reset",{iScale:s,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,i),d=s.axis,f=a.axis;for(let g=n;g<n+r;g++){const p=t[g],v=!o&&this.getParsed(g),y={},x=y[d]=o?s.getPixelForDecimal(.5):s.getPixelForValue(v[d]),w=y[f]=o?a.getBasePixel():a.getPixelForValue(v[f]);y.skip=isNaN(x)||isNaN(w),c&&(y.options=l||this.resolveDataElementOptions(g,p.active?"active":i),o&&(y.options.radius=0)),this.updateElement(p,g,y,i)}}resolveDataElementOptions(t,n){const r=this.getParsed(t);let i=super.resolveDataElementOptions(t,n);i.$shared&&(i=Object.assign({},i,{$shared:!1}));const o=i.radius;return n!=="active"&&(i.radius=0),i.radius+=tt(r&&r._custom,o),i}}ke(Qf,"id","bubble"),ke(Qf,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),ke(Qf,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function v$(e,t,n){let r=1,i=1,o=0,s=0;if(t<Xt){const a=e,l=a+t,c=Math.cos(a),d=Math.sin(a),f=Math.cos(l),g=Math.sin(l),p=(C,P,O)=>Jc(C,a,l,!0)?1:Math.max(P,P*n,O,O*n),v=(C,P,O)=>Jc(C,a,l,!0)?-1:Math.min(P,P*n,O,O*n),y=p(0,c,f),x=p(dn,d,g),w=v(Kt,c,f),S=v(Kt+dn,d,g);r=(y-w)/2,i=(x-S)/2,o=-(y+w)/2,s=-(x+S)/2}return{ratioX:r,ratioY:i,offsetX:o,offsetY:s}}class ea extends vi{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const r=this.getDataset().data,i=this._cachedMeta;if(this._parsing===!1)i._parsed=r;else{let o=l=>+r[l];if(wt(r[t])){const{key:l="value"}=this._parsing;o=c=>+Ho(r[c],l)}let s,a;for(s=t,a=t+n;s<a;++s)i._parsed[s]=o(s)}}_getRotation(){return mi(this.options.rotation-90)}_getCircumference(){return mi(this.options.circumference)}_getRotationExtents(){let t=Xt,n=-Xt;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const i=this.chart.getDatasetMeta(r).controller,o=i._getRotation(),s=i._getCircumference();t=Math.min(t,o),n=Math.max(n,o+s)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:r}=n,i=this._cachedMeta,o=i.data,s=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(r.width,r.height)-s)/2,0),l=Math.min(TL(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:d,rotation:f}=this._getRotationExtents(),{ratioX:g,ratioY:p,offsetX:v,offsetY:y}=v$(f,d,l),x=(r.width-s)/g,w=(r.height-s)/p,S=Math.max(Math.min(x,w)/2,0),C=OS(this.options.radius,S),P=Math.max(C*l,0),O=(C-P)/this._getVisibleDatasetWeightTotal();this.offsetX=v*C,this.offsetY=y*C,i.total=this.calculateTotal(),this.outerRadius=C-O*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-O*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,n){const r=this.options,i=this._cachedMeta,o=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||i._parsed[t]===null||i.data[t].hidden?0:this.calculateCircumference(i._parsed[t]*o/Xt)}updateElements(t,n,r,i){const o=i==="reset",s=this.chart,a=s.chartArea,c=s.options.animation,d=(a.left+a.right)/2,f=(a.top+a.bottom)/2,g=o&&c.animateScale,p=g?0:this.innerRadius,v=g?0:this.outerRadius,{sharedOptions:y,includeOptions:x}=this._getSharedOptions(n,i);let w=this._getRotation(),S;for(S=0;S<n;++S)w+=this._circumference(S,o);for(S=n;S<n+r;++S){const C=this._circumference(S,o),P=t[S],O={x:d+this.offsetX,y:f+this.offsetY,startAngle:w,endAngle:w+C,circumference:C,outerRadius:v,innerRadius:p};x&&(O.options=y||this.resolveDataElementOptions(S,P.active?"active":i)),w+=C,this.updateElement(P,S,O,i)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let r=0,i;for(i=0;i<n.length;i++){const o=t._parsed[i];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(i)&&!n[i].hidden&&(r+=Math.abs(o))}return r}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?Xt*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,i=r.data.labels||[],o=eu(n._parsed[t],r.options.locale);return{label:i[t]||"",value:o}}getMaxBorderWidth(t){let n=0;const r=this.chart;let i,o,s,a,l;if(!t){for(i=0,o=r.data.datasets.length;i<o;++i)if(r.isDatasetVisible(i)){s=r.getDatasetMeta(i),t=s.data,a=s.controller;break}}if(!t)return 0;for(i=0,o=t.length;i<o;++i)l=a.resolveDataElementOptions(i),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let r=0,i=t.length;r<i;++r){const o=this.resolveDataElementOptions(r);n=Math.max(n,o.offset||0,o.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let r=0;r<t;++r)this.chart.isDatasetVisible(r)&&(n+=this._getRingWeight(r));return n}_getRingWeight(t){return Math.max(tt(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}ke(ea,"id","doughnut"),ke(ea,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),ke(ea,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),ke(ea,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:i}}=t.legend.options;return n.labels.map((o,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:i,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}});class Jf extends vi{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:r,data:i=[],_dataset:o}=n,s=this.chart._animationsDisabled;let{start:a,count:l}=zS(n,i,s);this._drawStart=a,this._drawCount=l,BS(n)&&(a=0,l=i.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!o._decimated,r.points=i;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!s,options:c},t),this.updateElements(i,a,l,t)}updateElements(t,n,r,i){const o=i==="reset",{iScale:s,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:d,includeOptions:f}=this._getSharedOptions(n,i),g=s.axis,p=a.axis,{spanGaps:v,segment:y}=this.options,x=hl(v)?v:Number.POSITIVE_INFINITY,w=this.chart._animationsDisabled||o||i==="none",S=n+r,C=t.length;let P=n>0&&this.getParsed(n-1);for(let O=0;O<C;++O){const k=t[O],A=w?k:{};if(O<n||O>=S){A.skip=!0;continue}const L=this.getParsed(O),F=gt(L[p]),j=A[g]=s.getPixelForValue(L[g],O),B=A[p]=o||F?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,L,l):L[p],O);A.skip=isNaN(j)||isNaN(B)||F,A.stop=O>0&&Math.abs(L[g]-P[g])>x,y&&(A.parsed=L,A.raw=c.data[O]),f&&(A.options=d||this.resolveDataElementOptions(O,k.active?"active":i)),w||this.updateElement(k,O,A,i),P=L}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,i=t.data||[];if(!i.length)return r;const o=i[0].size(this.resolveDataElementOptions(0)),s=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(r,o,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}ke(Jf,"id","line"),ke(Jf,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),ke(Jf,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class iu extends vi{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,i=r.data.labels||[],o=eu(n._parsed[t].r,r.options.locale);return{label:i[t]||"",value:o}}parseObjectData(t,n,r,i){return nC.bind(this)(t,n,r,i)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((r,i)=>{const o=this.getParsed(i).r;!isNaN(o)&&this.chart.getDataVisibility(i)&&(o<n.min&&(n.min=o),o>n.max&&(n.max=o))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,r=t.options,i=Math.min(n.right-n.left,n.bottom-n.top),o=Math.max(i/2,0),s=Math.max(r.cutoutPercentage?o/100*r.cutoutPercentage:1,0),a=(o-s)/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,r,i){const o=i==="reset",s=this.chart,l=s.options.animation,c=this._cachedMeta.rScale,d=c.xCenter,f=c.yCenter,g=c.getIndexAngle(0)-.5*Kt;let p=g,v;const y=360/this.countVisibleElements();for(v=0;v<n;++v)p+=this._computeAngle(v,i,y);for(v=n;v<n+r;v++){const x=t[v];let w=p,S=p+this._computeAngle(v,i,y),C=s.getDataVisibility(v)?c.getDistanceFromCenterForValue(this.getParsed(v).r):0;p=S,o&&(l.animateScale&&(C=0),l.animateRotate&&(w=S=g));const P={x:d,y:f,innerRadius:0,outerRadius:C,startAngle:w,endAngle:S,options:this.resolveDataElementOptions(v,x.active?"active":i)};this.updateElement(x,v,P,i)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((r,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&n++}),n}_computeAngle(t,n,r){return this.chart.getDataVisibility(t)?mi(this.resolveDataElementOptions(t,n).angle||r):0}}ke(iu,"id","polarArea"),ke(iu,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),ke(iu,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:i}}=t.legend.options;return n.labels.map((o,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:i,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class nb extends ea{}ke(nb,"id","pie"),ke(nb,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Zf extends vi{getLabelAndValue(t){const n=this._cachedMeta.vScale,r=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(r[n.axis])}}parseObjectData(t,n,r,i){return nC.bind(this)(t,n,r,i)}update(t){const n=this._cachedMeta,r=n.dataset,i=n.data||[],o=n.iScale.getLabels();if(r.points=i,t!=="resize"){const s=this.resolveDatasetElementOptions(t);this.options.showLine||(s.borderWidth=0);const a={_loop:!0,_fullLoop:o.length===i.length,options:s};this.updateElement(r,void 0,a,t)}this.updateElements(i,0,i.length,t)}updateElements(t,n,r,i){const o=this._cachedMeta.rScale,s=i==="reset";for(let a=n;a<n+r;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":i),d=o.getPointPositionForValue(a,this.getParsed(a).r),f=s?o.xCenter:d.x,g=s?o.yCenter:d.y,p={x:f,y:g,angle:d.angle,skip:isNaN(f)||isNaN(g),options:c};this.updateElement(l,a,p,i)}}}ke(Zf,"id","radar"),ke(Zf,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),ke(Zf,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class eh extends vi{getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:i,yScale:o}=n,s=this.getParsed(t),a=i.getLabelForValue(s.x),l=o.getLabelForValue(s.y);return{label:r[t]||"",value:"("+a+", "+l+")"}}update(t){const n=this._cachedMeta,{data:r=[]}=n,i=this.chart._animationsDisabled;let{start:o,count:s}=zS(n,r,i);if(this._drawStart=o,this._drawCount=s,BS(n)&&(o=0,s=r.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:l}=n;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=r;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!i,options:c},t)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(r,o,s,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,r,i){const o=i==="reset",{iScale:s,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,d=this.resolveDataElementOptions(n,i),f=this.getSharedOptions(d),g=this.includeOptions(i,f),p=s.axis,v=a.axis,{spanGaps:y,segment:x}=this.options,w=hl(y)?y:Number.POSITIVE_INFINITY,S=this.chart._animationsDisabled||o||i==="none";let C=n>0&&this.getParsed(n-1);for(let P=n;P<n+r;++P){const O=t[P],k=this.getParsed(P),A=S?O:{},L=gt(k[v]),F=A[p]=s.getPixelForValue(k[p],P),j=A[v]=o||L?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,k,l):k[v],P);A.skip=isNaN(F)||isNaN(j)||L,A.stop=P>0&&Math.abs(k[p]-C[p])>w,x&&(A.parsed=k,A.raw=c.data[P]),g&&(A.options=f||this.resolveDataElementOptions(P,O.active?"active":i)),S||this.updateElement(O,P,A,i),C=k}this.updateSharedOptions(f,i,d)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let a=0;for(let l=n.length-1;l>=0;--l)a=Math.max(a,n[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const r=t.dataset,i=r.options&&r.options.borderWidth||0;if(!n.length)return i;const o=n[0].size(this.resolveDataElementOptions(0)),s=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,o,s)/2}}ke(eh,"id","scatter"),ke(eh,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),ke(eh,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var b$=Object.freeze({__proto__:null,BarController:Xf,BubbleController:Qf,DoughnutController:ea,LineController:Jf,PieController:nb,PolarAreaController:iu,RadarController:Zf,ScatterController:eh});function ta(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class rb{constructor(t){ke(this,"options");this.options=t||{}}static override(t){Object.assign(rb.prototype,t)}init(){}formats(){return ta()}parse(){return ta()}format(){return ta()}add(){return ta()}diff(){return ta()}startOf(){return ta()}endOf(){return ta()}}var y$={_date:rb};function x$(e,t,n,r){const{controller:i,data:o,_sorted:s}=e,a=i._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&s&&o.length){const l=a._reversePixels?HL:ao;if(r){if(i._sharedOptions){const c=o[0],d=typeof c.getRange=="function"&&c.getRange(t);if(d){const f=l(o,t,n-d),g=l(o,t,n+d);return{lo:f.lo,hi:g.hi}}}}else return l(o,t,n)}return{lo:0,hi:o.length-1}}function ou(e,t,n,r,i){const o=e.getSortedVisibleDatasetMetas(),s=n[t];for(let a=0,l=o.length;a<l;++a){const{index:c,data:d}=o[a],{lo:f,hi:g}=x$(o[a],t,s,i);for(let p=f;p<=g;++p){const v=d[p];v.skip||r(v,c,p)}}}function w$(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,i){const o=t?Math.abs(r.x-i.x):0,s=n?Math.abs(r.y-i.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(s,2))}}function ib(e,t,n,r,i){const o=[];return!i&&!e.isPointInArea(t)||ou(e,n,t,function(a,l,c){!i&&!lo(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function _$(e,t,n,r){let i=[];function o(s,a,l){const{startAngle:c,endAngle:d}=s.getProps(["startAngle","endAngle"],r),{angle:f}=NS(s,{x:t.x,y:t.y});Jc(f,c,d)&&i.push({element:s,datasetIndex:a,index:l})}return ou(e,n,t,o),i}function S$(e,t,n,r,i,o){let s=[];const a=w$(n);let l=Number.POSITIVE_INFINITY;function c(d,f,g){const p=d.inRange(t.x,t.y,i);if(r&&!p)return;const v=d.getCenterPoint(i);if(!(!!o||e.isPointInArea(v))&&!p)return;const x=a(t,v);x<l?(s=[{element:d,datasetIndex:f,index:g}],l=x):x===l&&s.push({element:d,datasetIndex:f,index:g})}return ou(e,n,t,c),s}function ob(e,t,n,r,i,o){return!o&&!e.isPointInArea(t)?[]:n==="r"&&!r?_$(e,t,n,i):S$(e,t,n,r,i,o)}function PC(e,t,n,r,i){const o=[],s=n==="x"?"inXRange":"inYRange";let a=!1;return ou(e,n,t,(l,c,d)=>{l[s](t[n],i)&&(o.push({element:l,datasetIndex:c,index:d}),a=a||l.inRange(t.x,t.y,i))}),r&&!a?[]:o}var C$={evaluateInteractionItems:ou,modes:{index(e,t,n,r){const i=Js(t,e),o=n.axis||"x",s=n.includeInvisible||!1,a=n.intersect?ib(e,i,o,r,s):ob(e,i,o,!1,r,s),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const d=a[0].index,f=c.data[d];f&&!f.skip&&l.push({element:f,datasetIndex:c.index,index:d})}),l):[]},dataset(e,t,n,r){const i=Js(t,e),o=n.axis||"xy",s=n.includeInvisible||!1;let a=n.intersect?ib(e,i,o,r,s):ob(e,i,o,!1,r,s);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let d=0;d<c.length;++d)a.push({element:c[d],datasetIndex:l,index:d})}return a},point(e,t,n,r){const i=Js(t,e),o=n.axis||"xy",s=n.includeInvisible||!1;return ib(e,i,o,r,s)},nearest(e,t,n,r){const i=Js(t,e),o=n.axis||"xy",s=n.includeInvisible||!1;return ob(e,i,o,n.intersect,r,s)},x(e,t,n,r){const i=Js(t,e);return PC(e,i,"x",n.intersect,r)},y(e,t,n,r){const i=Js(t,e);return PC(e,i,"y",n.intersect,r)}}};const kC=["left","top","right","bottom"];function su(e,t){return e.filter(n=>n.pos===t)}function MC(e,t){return e.filter(n=>kC.indexOf(n.pos)===-1&&n.box.axis===t)}function au(e,t){return e.sort((n,r)=>{const i=t?r:n,o=t?n:r;return i.weight===o.weight?i.index-o.index:i.weight-o.weight})}function E$(e){const t=[];let n,r,i,o,s,a;for(n=0,r=(e||[]).length;n<r;++n)i=e[n],{position:o,options:{stack:s,stackWeight:a=1}}=i,t.push({index:n,box:i,pos:o,horizontal:i.isHorizontal(),weight:i.weight,stack:s&&o+s,stackWeight:a});return t}function O$(e){const t={};for(const n of e){const{stack:r,pos:i,stackWeight:o}=n;if(!r||!kC.includes(i))continue;const s=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=o}return t}function P$(e,t){const n=O$(e),{vBoxMaxWidth:r,hBoxMaxHeight:i}=t;let o,s,a;for(o=0,s=e.length;o<s;++o){a=e[o];const{fullSize:l}=a.box,c=n[a.stack],d=c&&a.stackWeight/c.weight;a.horizontal?(a.width=d?d*r:l&&t.availableWidth,a.height=i):(a.width=r,a.height=d?d*i:l&&t.availableHeight)}return n}function k$(e){const t=E$(e),n=au(t.filter(c=>c.box.fullSize),!0),r=au(su(t,"left"),!0),i=au(su(t,"right")),o=au(su(t,"top"),!0),s=au(su(t,"bottom")),a=MC(t,"x"),l=MC(t,"y");return{fullSize:n,leftAndTop:r.concat(o),rightAndBottom:i.concat(l).concat(s).concat(a),chartArea:su(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:o.concat(s).concat(a)}}function DC(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function TC(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function M$(e,t,n,r){const{pos:i,box:o}=n,s=e.maxPadding;if(!wt(i)){n.size&&(e[i]-=n.size);const f=r[n.stack]||{size:0,count:1};f.size=Math.max(f.size,n.horizontal?o.height:o.width),n.size=f.size/f.count,e[i]+=n.size}o.getPadding&&TC(s,o.getPadding());const a=Math.max(0,t.outerWidth-DC(s,e,"left","right")),l=Math.max(0,t.outerHeight-DC(s,e,"top","bottom")),c=a!==e.w,d=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:d}:{same:d,other:c}}function D$(e){const t=e.maxPadding;function n(r){const i=Math.max(t[r]-e[r],0);return e[r]+=i,i}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function T$(e,t){const n=t.maxPadding;function r(i){const o={left:0,top:0,right:0,bottom:0};return i.forEach(s=>{o[s]=Math.max(t[s],n[s])}),o}return r(e?["left","right"]:["top","bottom"])}function lu(e,t,n,r){const i=[];let o,s,a,l,c,d;for(o=0,s=e.length,c=0;o<s;++o){a=e[o],l=a.box,l.update(a.width||t.w,a.height||t.h,T$(a.horizontal,t));const{same:f,other:g}=M$(t,n,a,r);c|=f&&i.length,d=d||g,l.fullSize||i.push(a)}return c&&lu(i,t,n,r)||d}function th(e,t,n,r,i){e.top=n,e.left=t,e.right=t+r,e.bottom=n+i,e.width=r,e.height=i}function AC(e,t,n,r){const i=n.padding;let{x:o,y:s}=t;for(const a of e){const l=a.box,c=r[a.stack]||{count:1,placed:0,weight:1},d=a.stackWeight/c.weight||1;if(a.horizontal){const f=t.w*d,g=c.size||l.height;Xc(c.start)&&(s=c.start),l.fullSize?th(l,i.left,s,n.outerWidth-i.right-i.left,g):th(l,t.left+c.placed,s,f,g),c.start=s,c.placed+=f,s=l.bottom}else{const f=t.h*d,g=c.size||l.width;Xc(c.start)&&(o=c.start),l.fullSize?th(l,o,i.top,g,n.outerHeight-i.bottom-i.top):th(l,o,t.top+c.placed,g,f),c.start=o,c.placed+=f,o=l.right}}t.x=o,t.y=s}var Un={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;const i=Rn(e.options.layout.padding),o=Math.max(t-i.width,0),s=Math.max(n-i.height,0),a=k$(e.boxes),l=a.vertical,c=a.horizontal;Nt(e.boxes,y=>{typeof y.beforeLayout=="function"&&y.beforeLayout()});const d=l.reduce((y,x)=>x.box.options&&x.box.options.display===!1?y:y+1,0)||1,f=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:o,availableHeight:s,vBoxMaxWidth:o/2/d,hBoxMaxHeight:s/2}),g=Object.assign({},i);TC(g,Rn(r));const p=Object.assign({maxPadding:g,w:o,h:s,x:i.left,y:i.top},i),v=P$(l.concat(c),f);lu(a.fullSize,p,f,v),lu(l,p,f,v),lu(c,p,f,v)&&lu(l,p,f,v),D$(p),AC(a.leftAndTop,p,f,v),p.x+=p.w,p.y+=p.h,AC(a.rightAndBottom,p,f,v),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},Nt(a.chartArea,y=>{const x=y.box;Object.assign(x,e.chartArea),x.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class IC{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,i){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,i?Math.floor(n/i):r)}}isAttached(t){return!0}updateConfig(t){}}class A$ extends IC{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const nh="$chartjs",I$={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},NC=e=>e===null||e==="";function N$(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[nh]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",NC(i)){const o=oC(e,"width");o!==void 0&&(e.width=o)}if(NC(r))if(e.style.height==="")e.height=e.width/(t||2);else{const o=oC(e,"height");o!==void 0&&(e.height=o)}return e}const RC=L9?{passive:!0}:!1;function R$(e,t,n){e.addEventListener(t,n,RC)}function L$(e,t,n){e.canvas.removeEventListener(t,n,RC)}function $$(e,t){const n=I$[e.type]||e.type,{x:r,y:i}=Js(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function rh(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function F$(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let s=!1;for(const a of o)s=s||rh(a.addedNodes,r),s=s&&!rh(a.removedNodes,r);s&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function j$(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let s=!1;for(const a of o)s=s||rh(a.removedNodes,r),s=s&&!rh(a.addedNodes,r);s&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const cu=new Map;let LC=0;function $C(){const e=window.devicePixelRatio;e!==LC&&(LC=e,cu.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function z$(e,t){cu.size||window.addEventListener("resize",$C),cu.set(e,t)}function B$(e){cu.delete(e),cu.size||window.removeEventListener("resize",$C)}function V$(e,t,n){const r=e.canvas,i=r&&Jv(r);if(!i)return;const o=jS((a,l)=>{const c=i.clientWidth;n(a,l),c<i.clientWidth&&n()},window),s=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,d=l.contentRect.height;c===0&&d===0||o(c,d)});return s.observe(i),z$(e,o),s}function sb(e,t,n){n&&n.disconnect(),t==="resize"&&B$(e)}function H$(e,t,n){const r=e.canvas,i=jS(o=>{e.ctx!==null&&n($$(o,e))},e);return R$(r,t,i),i}class W$ extends IC{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(N$(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[nh])return!1;const r=n[nh].initial;["height","width"].forEach(o=>{const s=r[o];gt(s)?n.removeAttribute(o):n.setAttribute(o,s)});const i=r.style||{};return Object.keys(i).forEach(o=>{n.style[o]=i[o]}),n.width=n.width,delete n[nh],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),s={attach:F$,detach:j$,resize:V$}[n]||H$;i[n]=s(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:sb,detach:sb,resize:sb}[n]||L$)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return R9(t,n,r,i)}isAttached(t){const n=Jv(t);return!!(n&&n.isConnected)}}function q$(e){return!Qv()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?A$:W$}let uo=(og=class{constructor(){ke(this,"x");ke(this,"y");ke(this,"active",!1);ke(this,"options");ke(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return hl(this.x)&&hl(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const i={};return t.forEach(o=>{i[o]=r[o]&&r[o].active()?r[o]._to:this[o]}),i}},ke(og,"defaults",{}),ke(og,"defaultRoutes"),og);function U$(e,t){const n=e.options.ticks,r=G$(e),i=Math.min(n.maxTicksLimit||r,r),o=n.major.enabled?K$(t):[],s=o.length,a=o[0],l=o[s-1],c=[];if(s>i)return X$(t,c,o,s/i),c;const d=Y$(o,t,i);if(s>0){let f,g;const p=s>1?Math.round((l-a)/(s-1)):null;for(ih(t,c,d,gt(p)?0:a-p,a),f=0,g=s-1;f<g;f++)ih(t,c,d,o[f],o[f+1]);return ih(t,c,d,l,gt(p)?t.length:l+p),c}return ih(t,c,d),c}function G$(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),i=e._maxLength/n;return Math.floor(Math.min(r,i))}function Y$(e,t,n){const r=Q$(e),i=t.length/n;if(!r)return Math.max(i,1);const o=jL(r);for(let s=0,a=o.length-1;s<a;s++){const l=o[s];if(l>i)return l}return Math.max(i,1)}function K$(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function X$(e,t,n,r){let i=0,o=n[0],s;for(r=Math.ceil(r),s=0;s<e.length;s++)s===o&&(t.push(e[s]),i++,o=n[i*r])}function ih(e,t,n,r,i){const o=tt(r,0),s=Math.min(tt(i,e.length),e.length);let a=0,l,c,d;for(n=Math.ceil(n),i&&(l=i-r,n=l/Math.floor(l/n)),d=o;d<0;)a++,d=Math.round(o+a*n);for(c=Math.max(o,0);c<s;c++)c===d&&(t.push(e[c]),a++,d=Math.round(o+a*n))}function Q$(e){const t=e.length;let n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}const J$=e=>e==="left"?"right":e==="right"?"left":e,FC=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,jC=(e,t)=>Math.min(t||e,e);function zC(e,t){const n=[],r=e.length/t,i=e.length;let o=0;for(;o<i;o+=r)n.push(e[Math.floor(o)]);return n}function Z$(e,t,n){const r=e.ticks.length,i=Math.min(t,r-1),o=e._startPixel,s=e._endPixel,a=1e-6;let l=e.getPixelForTick(i),c;if(!(n&&(r===1?c=Math.max(l-o,s-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(i-1))/2,l+=i<t?c:-c,l<o-a||l>s+a)))return l}function eF(e,t){Nt(e,n=>{const r=n.gc,i=r.length/2;let o;if(i>t){for(o=0;o<i;++o)delete n.data[r[o]];r.splice(0,i)}})}function uu(e){return e.drawTicks?e.tickLength:0}function BC(e,t){if(!e.display)return 0;const n=bn(e.font,t),r=Rn(e.padding);return(Yt(e.text)?e.text.length:1)*n.lineHeight+r.height}function tF(e,t){return Uo(e,{scale:t,type:"scale"})}function nF(e,t,n){return Uo(e,{tick:n,index:t,type:"tick"})}function rF(e,t,n){let r=Bv(e);return(n&&t!=="right"||!n&&t==="right")&&(r=J$(r)),r}function iF(e,t,n,r){const{top:i,left:o,bottom:s,right:a,chart:l}=e,{chartArea:c,scales:d}=l;let f=0,g,p,v;const y=s-i,x=a-o;if(e.isHorizontal()){if(p=qn(r,o,a),wt(n)){const w=Object.keys(n)[0],S=n[w];v=d[w].getPixelForValue(S)+y-t}else n==="center"?v=(c.bottom+c.top)/2+y-t:v=FC(e,n,t);g=a-o}else{if(wt(n)){const w=Object.keys(n)[0],S=n[w];p=d[w].getPixelForValue(S)-x+t}else n==="center"?p=(c.left+c.right)/2-x+t:p=FC(e,n,t);v=qn(r,s,i),f=n==="left"?-dn:dn}return{titleX:p,titleY:v,maxWidth:g,rotation:f}}class na extends uo{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:r,_suggestedMax:i}=this;return t=Or(t,Number.POSITIVE_INFINITY),n=Or(n,Number.NEGATIVE_INFINITY),r=Or(r,Number.POSITIVE_INFINITY),i=Or(i,Number.NEGATIVE_INFINITY),{min:Or(t,r),max:Or(n,i),minDefined:ln(t),maxDefined:ln(n)}}getMinMax(t){let{min:n,max:r,minDefined:i,maxDefined:o}=this.getUserBounds(),s;if(i&&o)return{min:n,max:r};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)s=a[l].controller.getMinMax(this,t),i||(n=Math.min(n,s.min)),o||(r=Math.max(r,s.max));return n=o&&n>r?r:n,r=i&&n>r?n:r,{min:Or(n,Or(r,n)),max:Or(r,Or(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Ft(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:i,grace:o,ticks:s}=this.options,a=s.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=h9(this,o,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?zC(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||s.source==="auto")&&(this.ticks=U$(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,t=!t),this._startPixel=n,this._endPixel=r,this._reversePixels=t,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Ft(this.options.afterUpdate,[this])}beforeSetDimensions(){Ft(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){Ft(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Ft(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Ft(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,i,o;for(r=0,i=t.length;r<i;r++)o=t[r],o.label=Ft(n.callback,[o.value,r,t],this)}afterTickToLabelConversion(){Ft(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Ft(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=jC(this.ticks.length,t.ticks.maxTicksLimit),i=n.minRotation||0,o=n.maxRotation;let s=i,a,l,c;if(!this._isVisible()||!n.display||i>=o||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const d=this._getLabelSizes(),f=d.widest.width,g=d.highest.height,p=kn(this.chart.width-f,0,this.maxWidth);a=t.offset?this.maxWidth/r:p/(r-1),f+6>a&&(a=p/(r-(t.offset?.5:1)),l=this.maxHeight-uu(t.grid)-n.padding-BC(t.title,this.chart.options.font),c=Math.sqrt(f*f+g*g),s=Fv(Math.min(Math.asin(kn((d.highest.height+6)/a,-1,1)),Math.asin(kn(l/c,-1,1))-Math.asin(kn(g/c,-1,1)))),s=Math.max(i,Math.min(o,s))),this.labelRotation=s}afterCalculateLabelRotation(){Ft(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Ft(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:i,grid:o}}=this,s=this._isVisible(),a=this.isHorizontal();if(s){const l=BC(i,n.options.font);if(a?(t.width=this.maxWidth,t.height=uu(o)+l):(t.height=this.maxHeight,t.width=uu(o)+l),r.display&&this.ticks.length){const{first:c,last:d,widest:f,highest:g}=this._getLabelSizes(),p=r.padding*2,v=mi(this.labelRotation),y=Math.cos(v),x=Math.sin(v);if(a){const w=r.mirror?0:x*f.width+y*g.height;t.height=Math.min(this.maxHeight,t.height+w+p)}else{const w=r.mirror?0:y*f.width+x*g.height;t.width=Math.min(this.maxWidth,t.width+w+p)}this._calculatePadding(c,d,x,y)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,r,i){const{ticks:{align:o,padding:s},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const d=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let g=0,p=0;l?c?(g=i*t.width,p=r*n.height):(g=r*t.height,p=i*n.width):o==="start"?p=n.width:o==="end"?g=t.width:o!=="inner"&&(g=t.width/2,p=n.width/2),this.paddingLeft=Math.max((g-d+s)*this.width/(this.width-d),0),this.paddingRight=Math.max((p-f+s)*this.width/(this.width-f),0)}else{let d=n.height/2,f=t.height/2;o==="start"?(d=0,f=t.height):o==="end"&&(d=n.height,f=0),this.paddingTop=d+s,this.paddingBottom=f+s}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Ft(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,r;for(n=0,r=t.length;n<r;n++)gt(t[n].label)&&(t.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=zC(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:i,_longestTextCache:o}=this,s=[],a=[],l=Math.floor(n/jC(n,r));let c=0,d=0,f,g,p,v,y,x,w,S,C,P,O;for(f=0;f<n;f+=l){if(v=t[f].label,y=this._resolveTickFontOptions(f),i.font=x=y.string,w=o[x]=o[x]||{data:{},gc:[]},S=y.lineHeight,C=P=0,!gt(v)&&!Yt(v))C=Hf(i,w.data,w.gc,C,v),P=S;else if(Yt(v))for(g=0,p=v.length;g<p;++g)O=v[g],!gt(O)&&!Yt(O)&&(C=Hf(i,w.data,w.gc,C,O),P+=S);s.push(C),a.push(P),c=Math.max(C,c),d=Math.max(P,d)}eF(o,n);const k=s.indexOf(c),A=a.indexOf(d),L=F=>({width:s[F]||0,height:a[F]||0});return{first:L(0),last:L(n-1),widest:L(k),highest:L(A),widths:s,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return VL(this._alignToPixels?Ys(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const r=n[t];return r.$context||(r.$context=nF(this.getContext(),t,r))}return this.$context||(this.$context=tF(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=mi(this.labelRotation),r=Math.abs(Math.cos(n)),i=Math.abs(Math.sin(n)),o=this._getLabelSizes(),s=t.autoSkipPadding||0,a=o?o.widest.width+s:0,l=o?o.highest.height+s:0;return this.isHorizontal()?l*r>a*i?a/r:l/i:l*i<a*r?l/r:a/i}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,i=this.options,{grid:o,position:s,border:a}=i,l=o.offset,c=this.isHorizontal(),f=this.ticks.length+(l?1:0),g=uu(o),p=[],v=a.setContext(this.getContext()),y=v.display?v.width:0,x=y/2,w=function(Z){return Ys(r,Z,y)};let S,C,P,O,k,A,L,F,j,B,V,K;if(s==="top")S=w(this.bottom),A=this.bottom-g,F=S-x,B=w(t.top)+x,K=t.bottom;else if(s==="bottom")S=w(this.top),B=t.top,K=w(t.bottom)-x,A=S+x,F=this.top+g;else if(s==="left")S=w(this.right),k=this.right-g,L=S-x,j=w(t.left)+x,V=t.right;else if(s==="right")S=w(this.left),j=t.left,V=w(t.right)-x,k=S+x,L=this.left+g;else if(n==="x"){if(s==="center")S=w((t.top+t.bottom)/2+.5);else if(wt(s)){const Z=Object.keys(s)[0],U=s[Z];S=w(this.chart.scales[Z].getPixelForValue(U))}B=t.top,K=t.bottom,A=S+x,F=A+g}else if(n==="y"){if(s==="center")S=w((t.left+t.right)/2);else if(wt(s)){const Z=Object.keys(s)[0],U=s[Z];S=w(this.chart.scales[Z].getPixelForValue(U))}k=S-x,L=k-g,j=t.left,V=t.right}const Y=tt(i.ticks.maxTicksLimit,f),$=Math.max(1,Math.ceil(f/Y));for(C=0;C<f;C+=$){const Z=this.getContext(C),U=o.setContext(Z),ie=a.setContext(Z),le=U.lineWidth,M=U.color,H=ie.dash||[],ne=ie.dashOffset,N=U.tickWidth,X=U.tickColor,me=U.tickBorderDash||[],he=U.tickBorderDashOffset;P=Z$(this,C,l),P!==void 0&&(O=Ys(r,P,le),c?k=L=j=V=O:A=F=B=K=O,p.push({tx1:k,ty1:A,tx2:L,ty2:F,x1:j,y1:B,x2:V,y2:K,width:le,color:M,borderDash:H,borderDashOffset:ne,tickWidth:N,tickColor:X,tickBorderDash:me,tickBorderDashOffset:he}))}return this._ticksLength=f,this._borderValue=S,p}_computeLabelItems(t){const n=this.axis,r=this.options,{position:i,ticks:o}=r,s=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:d,mirror:f}=o,g=uu(r.grid),p=g+d,v=f?-d:p,y=-mi(this.labelRotation),x=[];let w,S,C,P,O,k,A,L,F,j,B,V,K="middle";if(i==="top")k=this.bottom-v,A=this._getXAxisLabelAlignment();else if(i==="bottom")k=this.top+v,A=this._getXAxisLabelAlignment();else if(i==="left"){const $=this._getYAxisLabelAlignment(g);A=$.textAlign,O=$.x}else if(i==="right"){const $=this._getYAxisLabelAlignment(g);A=$.textAlign,O=$.x}else if(n==="x"){if(i==="center")k=(t.top+t.bottom)/2+p;else if(wt(i)){const $=Object.keys(i)[0],Z=i[$];k=this.chart.scales[$].getPixelForValue(Z)+p}A=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")O=(t.left+t.right)/2-p;else if(wt(i)){const $=Object.keys(i)[0],Z=i[$];O=this.chart.scales[$].getPixelForValue(Z)}A=this._getYAxisLabelAlignment(g).textAlign}n==="y"&&(l==="start"?K="top":l==="end"&&(K="bottom"));const Y=this._getLabelSizes();for(w=0,S=a.length;w<S;++w){C=a[w],P=C.label;const $=o.setContext(this.getContext(w));L=this.getPixelForTick(w)+o.labelOffset,F=this._resolveTickFontOptions(w),j=F.lineHeight,B=Yt(P)?P.length:1;const Z=B/2,U=$.color,ie=$.textStrokeColor,le=$.textStrokeWidth;let M=A;s?(O=L,A==="inner"&&(w===S-1?M=this.options.reverse?"left":"right":w===0?M=this.options.reverse?"right":"left":M="center"),i==="top"?c==="near"||y!==0?V=-B*j+j/2:c==="center"?V=-Y.highest.height/2-Z*j+j:V=-Y.highest.height+j/2:c==="near"||y!==0?V=j/2:c==="center"?V=Y.highest.height/2-Z*j:V=Y.highest.height-B*j,f&&(V*=-1),y!==0&&!$.showLabelBackdrop&&(O+=j/2*Math.sin(y))):(k=L,V=(1-B)*j/2);let H;if($.showLabelBackdrop){const ne=Rn($.backdropPadding),N=Y.heights[w],X=Y.widths[w];let me=V-ne.top,he=0-ne.left;switch(K){case"middle":me-=N/2;break;case"bottom":me-=N;break}switch(A){case"center":he-=X/2;break;case"right":he-=X;break;case"inner":w===S-1?he-=X:w>0&&(he-=X/2);break}H={left:he,top:me,width:X+ne.width,height:N+ne.height,color:$.backdropColor}}x.push({label:P,font:F,textOffset:V,options:{rotation:y,color:U,strokeColor:ie,strokeWidth:le,textAlign:M,textBaseline:K,translation:[O,k],backdrop:H}})}return x}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-mi(this.labelRotation))return t==="top"?"left":"right";let i="center";return n.align==="start"?i="left":n.align==="end"?i="right":n.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:i,padding:o}}=this.options,s=this._getLabelSizes(),a=t+o,l=s.widest.width;let c,d;return n==="left"?i?(d=this.right+o,r==="near"?c="left":r==="center"?(c="center",d+=l/2):(c="right",d+=l)):(d=this.right-a,r==="near"?c="right":r==="center"?(c="center",d-=l/2):(c="left",d=this.left)):n==="right"?i?(d=this.left+o,r==="near"?c="right":r==="center"?(c="center",d-=l/2):(c="left",d-=l)):(d=this.left+a,r==="near"?c="left":r==="center"?(c="center",d+=l/2):(c="right",d=this.right)):c="right",{textAlign:c,x:d}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:r,top:i,width:o,height:s}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,i,o,s),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(o=>o.value===t);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,s;const a=(l,c,d)=>{!d.width||!d.color||(r.save(),r.lineWidth=d.width,r.strokeStyle=d.color,r.setLineDash(d.borderDash||[]),r.lineDashOffset=d.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(c.x,c.y),r.stroke(),r.restore())};if(n.display)for(o=0,s=i.length;o<s;++o){const l=i[o];n.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:r,grid:i}}=this,o=r.setContext(this.getContext()),s=r.display?o.width:0;if(!s)return;const a=i.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,d,f,g;this.isHorizontal()?(c=Ys(t,this.left,s)-s/2,d=Ys(t,this.right,a)+a/2,f=g=l):(f=Ys(t,this.top,s)-s/2,g=Ys(t,this.bottom,a)+a/2,c=d=l),n.save(),n.lineWidth=o.width,n.strokeStyle=o.color,n.beginPath(),n.moveTo(c,f),n.lineTo(d,g),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,i=this._computeLabelArea();i&&Wf(r,i);const o=this.getLabelItems(t);for(const s of o){const a=s.options,l=s.font,c=s.label,d=s.textOffset;Ks(r,c,0,d,l,a)}i&&qf(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:i}}=this;if(!r.display)return;const o=bn(r.font),s=Rn(r.padding),a=r.align;let l=o.lineHeight/2;n==="bottom"||n==="center"||wt(n)?(l+=s.bottom,Yt(r.text)&&(l+=o.lineHeight*(r.text.length-1))):l+=s.top;const{titleX:c,titleY:d,maxWidth:f,rotation:g}=iF(this,l,n,a);Ks(t,r.text,0,0,o,{color:r.color,maxWidth:f,rotation:g,textAlign:rF(a,n,i),textBaseline:"middle",translation:[c,d]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,r=tt(t.grid&&t.grid.z,-1),i=tt(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==na.prototype.draw?[{z:n,draw:o=>{this.draw(o)}}]:[{z:r,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",i=[];let o,s;for(o=0,s=n.length;o<s;++o){const a=n[o];a[r]===this.id&&(!t||a.type===t)&&i.push(a)}return i}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return bn(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class oh{constructor(t,n,r){this.type=t,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let r;aF(n)&&(r=this.register(n));const i=this.items,o=t.id,s=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in i||(i[o]=t,oF(t,s,r),this.override&&on.override(t.id,t.overrides)),s}get(t){return this.items[t]}unregister(t){const n=this.items,r=t.id,i=this.scope;r in n&&delete n[r],i&&r in on[i]&&(delete on[i][r],this.override&&delete Gs[r])}}function oF(e,t,n){const r=Ai(Object.create(null),[n?on.get(n):{},on.get(t),e.defaults]);on.set(t,r),e.defaultRoutes&&sF(t,e.defaultRoutes),e.descriptors&&on.describe(t,e.descriptors)}function sF(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),i=r.pop(),o=[e].concat(r).join("."),s=t[n].split("."),a=s.pop(),l=s.join(".");on.route(o,i,l,a)})}function aF(e){return"id"in e&&"defaults"in e}class lF{constructor(){this.controllers=new oh(vi,"datasets",!0),this.elements=new oh(uo,"elements"),this.plugins=new oh(Object,"plugins"),this.scales=new oh(na,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,r){[...n].forEach(i=>{const o=r||this._getRegistryForType(i);r||o.isForType(i)||o===this.plugins&&i.id?this._exec(t,o,i):Nt(i,s=>{const a=r||this._getRegistryForType(s);this._exec(t,a,s)})})}_exec(t,n,r){const i=$v(t);Ft(r["before"+i],[],r),n[t](r),Ft(r["after"+i],[],r)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(t))return r}return this.plugins}_get(t,n,r){const i=n.get(t);if(i===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return i}}var Ni=new lF;class cF{constructor(){this._init=[]}notify(t,n,r,i){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=i?this._descriptors(t).filter(i):this._descriptors(t),s=this._notify(o,t,n,r);return n==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),s}_notify(t,n,r,i){i=i||{};for(const o of t){const s=o.plugin,a=s[r],l=[n,i,o.options];if(Ft(a,l,s)===!1&&i.cancelable)return!1}return!0}invalidate(){gt(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const r=t&&t.config,i=tt(r.options&&r.options.plugins,{}),o=uF(r);return i===!1&&!n?[]:fF(t,o,i,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,i=(o,s)=>o.filter(a=>!s.some(l=>a.plugin.id===l.plugin.id));this._notify(i(n,r),t,"stop"),this._notify(i(r,n),t,"start")}}function uF(e){const t={},n=[],r=Object.keys(Ni.plugins.items);for(let o=0;o<r.length;o++)n.push(Ni.getPlugin(r[o]));const i=e.plugins||[];for(let o=0;o<i.length;o++){const s=i[o];n.indexOf(s)===-1&&(n.push(s),t[s.id]=!0)}return{plugins:n,localIds:t}}function dF(e,t){return!t&&e===!1?null:e===!0?{}:e}function fF(e,{plugins:t,localIds:n},r,i){const o=[],s=e.getContext();for(const a of t){const l=a.id,c=dF(r[l],i);c!==null&&o.push({plugin:a,options:hF(e.config,{plugin:a,local:n[l]},c,s)})}return o}function hF(e,{plugin:t,local:n},r,i){const o=e.pluginScopeKeys(t),s=e.getOptionScopes(r,o);return n&&t.defaults&&s.push(t.defaults),e.createResolver(s,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function ab(e,t){const n=on.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function pF(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function gF(e,t){return e===t?"_index_":"_value_"}function VC(e){if(e==="x"||e==="y"||e==="r")return e}function mF(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function lb(e,...t){if(VC(e))return e;for(const n of t){const r=n.axis||mF(n.position)||e.length>1&&VC(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function HC(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function vF(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(r=>r.xAxisID===e||r.yAxisID===e);if(n.length)return HC(e,"x",n[0])||HC(e,"y",n[0])}return{}}function bF(e,t){const n=Gs[e.type]||{scales:{}},r=t.scales||{},i=ab(e.type,t),o=Object.create(null);return Object.keys(r).forEach(s=>{const a=r[s];if(!wt(a))return console.error(`Invalid scale configuration for scale: ${s}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${s}`);const l=lb(s,a,vF(s,e),on.scales[a.type]),c=gF(l,i),d=n.scales||{};o[s]=Kc(Object.create(null),[{axis:l},a,d[l],d[c]])}),e.data.datasets.forEach(s=>{const a=s.type||e.type,l=s.indexAxis||ab(a,t),d=(Gs[a]||{}).scales||{};Object.keys(d).forEach(f=>{const g=pF(f,l),p=s[g+"AxisID"]||g;o[p]=o[p]||Object.create(null),Kc(o[p],[{axis:g},r[p],d[f]])})}),Object.keys(o).forEach(s=>{const a=o[s];Kc(a,[on.scales[a.type],on.scale])}),o}function WC(e){const t=e.options||(e.options={});t.plugins=tt(t.plugins,{}),t.scales=bF(e,t)}function qC(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function yF(e){return e=e||{},e.data=qC(e.data),WC(e),e}const UC=new Map,GC=new Set;function sh(e,t){let n=UC.get(e);return n||(n=t(),UC.set(e,n),GC.add(n)),n}const du=(e,t,n)=>{const r=Ho(t,n);r!==void 0&&e.add(r)};class xF{constructor(t){this._config=yF(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=qC(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),WC(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return sh(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return sh(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return sh(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return sh(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let i=r.get(t);return(!i||n)&&(i=new Map,r.set(t,i)),i}getOptionScopes(t,n,r){const{options:i,type:o}=this,s=this._cachedScopes(t,r),a=s.get(n);if(a)return a;const l=new Set;n.forEach(d=>{t&&(l.add(t),d.forEach(f=>du(l,t,f))),d.forEach(f=>du(l,i,f)),d.forEach(f=>du(l,Gs[o]||{},f)),d.forEach(f=>du(l,on,f)),d.forEach(f=>du(l,Wv,f))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),GC.has(n)&&s.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Gs[n]||{},on.datasets[n]||{},{type:n},on,Wv]}resolveNamedOptions(t,n,r,i=[""]){const o={$shared:!0},{resolver:s,subPrefixes:a}=YC(this._resolverCache,t,i);let l=s;if(_F(s,n)){o.$shared=!1,r=Wo(r)?r():r;const c=this.createResolver(t,r,a);l=pl(s,r,c)}for(const c of n)o[c]=l[c];return o}createResolver(t,n,r=[""],i){const{resolver:o}=YC(this._resolverCache,t,r);return wt(n)?pl(o,n,void 0,i):o}}function YC(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const i=n.join();let o=r.get(i);return o||(o={resolver:Yv(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(i,o)),o}const wF=e=>wt(e)&&Object.getOwnPropertyNames(e).some(t=>Wo(e[t]));function _F(e,t){const{isScriptable:n,isIndexable:r}=XS(e);for(const i of t){const o=n(i),s=r(i),a=(s||o)&&e[i];if(o&&(Wo(a)||wF(a))||s&&Yt(a))return!0}return!1}var SF="4.4.1";const CF=["top","bottom","left","right","chartArea"];function KC(e,t){return e==="top"||e==="bottom"||CF.indexOf(e)===-1&&t==="x"}function XC(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function QC(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Ft(n&&n.onComplete,[e],t)}function EF(e){const t=e.chart,n=t.options.animation;Ft(n&&n.onProgress,[e],t)}function JC(e){return Qv()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const ah={},ZC=e=>{const t=JC(e);return Object.values(ah).filter(n=>n.canvas===t).pop()};function OF(e,t,n){const r=Object.keys(e);for(const i of r){const o=+i;if(o>=t){const s=e[i];delete e[i],(n>0||o>t)&&(e[o+n]=s)}}}function PF(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}function lh(e,t,n){return e.options.clip?e[n]:t[n]}function kF(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:lh(n,t,"left"),right:lh(n,t,"right"),top:lh(r,t,"top"),bottom:lh(r,t,"bottom")}:t}class Qr{static register(...t){Ni.add(...t),eE()}static unregister(...t){Ni.remove(...t),eE()}constructor(t,n){const r=this.config=new xF(n),i=JC(t),o=ZC(i);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const s=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||q$(i)),this.platform.updateConfig(r);const a=this.platform.acquireContext(i,s.aspectRatio),l=a&&a.canvas,c=l&&l.height,d=l&&l.width;if(this.id=DL(),this.ctx=a,this.canvas=l,this.width=d,this.height=c,this._options=s,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new cF,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=UL(f=>this.update(f),s.resizeDelay||0),this._dataChanges=[],ah[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}co.listen(this,"complete",QC),co.listen(this,"progress",EF),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:i,_aspectRatio:o}=this;return gt(t)?n&&o?o:i?r/i:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Ni}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():iC(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return GS(this.canvas,this.ctx),this}stop(){return co.stop(this),this}resize(t,n){co.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,i=this.canvas,o=r.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(i,t,n,o),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,iC(this,a,!0)&&(this.notifyPlugins("resize",{size:s}),Ft(r.onResize,[this,s],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Nt(n,(r,i)=>{r.id=i})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,i=Object.keys(r).reduce((s,a)=>(s[a]=!1,s),{});let o=[];n&&(o=o.concat(Object.keys(n).map(s=>{const a=n[s],l=lb(s,a),c=l==="r",d=l==="x";return{options:a,dposition:c?"chartArea":d?"bottom":"left",dtype:c?"radialLinear":d?"category":"linear"}}))),Nt(o,s=>{const a=s.options,l=a.id,c=lb(l,a),d=tt(a.type,s.dtype);(a.position===void 0||KC(a.position,c)!==KC(s.dposition))&&(a.position=s.dposition),i[l]=!0;let f=null;if(l in r&&r[l].type===d)f=r[l];else{const g=Ni.getScale(d);f=new g({id:l,type:d,ctx:this.ctx,chart:this}),r[f.id]=f}f.init(a,t)}),Nt(i,(s,a)=>{s||delete r[a]}),Nt(r,s=>{Un.configure(this,s,s.options),Un.addBox(this,s)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((i,o)=>i.index-o.index),r>n){for(let i=n;i<r;++i)this._destroyDatasetMeta(i);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(XC("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,i)=>{n.filter(o=>o===r._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,i;for(this._removeUnreferencedMetasets(),r=0,i=n.length;r<i;r++){const o=n[r];let s=this.getDatasetMeta(r);const a=o.type||this.config.type;if(s.type&&s.type!==a&&(this._destroyDatasetMeta(r),s=this.getDatasetMeta(r)),s.type=a,s.indexAxis=o.indexAxis||ab(a,this.options),s.order=o.order||0,s.index=r,s.label=""+o.label,s.visible=this.isDatasetVisible(r),s.controller)s.controller.updateIndex(r),s.controller.linkScales();else{const l=Ni.getController(a),{datasetElementType:c,dataElementType:d}=on.datasets[a];Object.assign(l,{dataElementType:Ni.getElement(d),datasetElementType:c&&Ni.getElement(c)}),s.controller=new l(this,r),t.push(s.controller)}}return this._updateMetasets(),t}_resetElements(){Nt(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let c=0,d=this.data.datasets.length;c<d;c++){const{controller:f}=this.getDatasetMeta(c),g=!i&&o.indexOf(f)===-1;f.buildOrUpdateElements(g),s=Math.max(+f.getMaxOverflow(),s)}s=this._minPadding=r.layout.autoPadding?s:0,this._updateLayout(s),i||Nt(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(XC("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Nt(this.scales,t=>{Un.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!MS(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:i,count:o}of n){const s=r==="_removeElements"?-o:o;OF(t,i,s)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=o=>new Set(t.filter(s=>s[0]===o).map((s,a)=>a+","+s.splice(1).join(","))),i=r(0);for(let o=1;o<n;o++)if(!MS(i,r(o)))return;return Array.from(i).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Un.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Nt(this.boxes,i=>{r&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,o)=>{i._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,Wo(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),i={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",i)!==!1&&(r.controller._update(n),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(co.has(this)?this.attached&&!co.running(this)&&co.start(this):(this.draw(),QC({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:i}=this._resizeBeforeDraw;this._resize(r,i),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,r=[];let i,o;for(i=0,o=n.length;i<o;++i){const s=n[i];(!t||s.visible)&&r.push(s)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r=t._clip,i=!r.disabled,o=kF(t,this.chartArea),s={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(i&&Wf(n,{left:r.left===!1?0:o.left-r.left,right:r.right===!1?this.width:o.right+r.right,top:r.top===!1?0:o.top-r.top,bottom:r.bottom===!1?this.height:o.bottom+r.bottom}),t.controller.draw(),i&&qf(n),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return lo(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const o=C$.modes[n];return typeof o=="function"?o(this,t,r,i):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let i=r.filter(o=>o&&o._dataset===n).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},r.push(i)),i}getContext(){return this.$context||(this.$context=Uo(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(t,n){const r=this.getDatasetMeta(t);r.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,r){const i=r?"show":"hide",o=this.getDatasetMeta(t),s=o.controller._resolveAnimations(void 0,i);Xc(n)?(o.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),s.update(o,{visible:r}),this.update(a=>a.datasetIndex===t?i:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),co.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),GS(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete ah[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,n=this.platform,r=(o,s)=>{n.addEventListener(this,o,s),t[o]=s},i=(o,s,a)=>{o.offsetX=s,o.offsetY=a,this._eventHandler(o)};Nt(this.options.events,o=>r(o,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},i=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let s;const a=()=>{i("attach",a),this.attached=!0,this.resize(),r("resize",o),r("detach",s)};s=()=>{this.attached=!1,i("resize",o),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():s()}unbindEvents(){Nt(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Nt(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const i=r?"set":"remove";let o,s,a,l;for(n==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+i+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){s=t[a];const c=s&&this.getDatasetMeta(s.datasetIndex).controller;c&&c[i+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:o,index:s})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[s],index:s}});!Ff(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){const i=this.options.hover,o=(l,c)=>l.filter(d=>!c.some(f=>d.datasetIndex===f.datasetIndex&&d.index===f.index)),s=o(n,t),a=r?t:o(t,n);s.length&&this.updateHoverStyle(s,i.mode,!1),a.length&&i.mode&&this.updateHoverStyle(a,i.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},i=s=>(s.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,i)===!1)return;const o=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,i),(o||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:i=[],options:o}=this,s=n,a=this._getActiveElements(t,i,r,s),l=LL(t),c=PF(t,this._lastEvent,r,l);r&&(this._lastEvent=null,Ft(o.onHover,[t,a,this],this),l&&Ft(o.onClick,[t,a,this],this));const d=!Ff(a,i);return(d||n)&&(this._active=a,this._updateHoverStyles(a,i,n)),this._lastEvent=c,d}_getActiveElements(t,n,r,i){if(t.type==="mouseout")return[];if(!r)return n;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,i)}}ke(Qr,"defaults",on),ke(Qr,"instances",ah),ke(Qr,"overrides",Gs),ke(Qr,"registry",Ni),ke(Qr,"version",SF),ke(Qr,"getChart",ZC);function eE(){return Nt(Qr.instances,e=>e._plugins.invalidate())}function MF(e,t,n){const{startAngle:r,pixelMargin:i,x:o,y:s,outerRadius:a,innerRadius:l}=t;let c=i/a;e.beginPath(),e.arc(o,s,a,r-c,n+c),l>i?(c=i/l,e.arc(o,s,l,n+c,r-c,!0)):e.arc(o,s,i,n+dn,r-dn),e.closePath(),e.clip()}function DF(e){return Gv(e,["outerStart","outerEnd","innerStart","innerEnd"])}function TF(e,t,n,r){const i=DF(e.options.borderRadius),o=(n-t)/2,s=Math.min(o,r*t/2),a=l=>{const c=(n-Math.min(o,l))*r/2;return kn(l,0,Math.min(o,c))};return{outerStart:a(i.outerStart),outerEnd:a(i.outerEnd),innerStart:kn(i.innerStart,0,s),innerEnd:kn(i.innerEnd,0,s)}}function vl(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function ch(e,t,n,r,i,o){const{x:s,y:a,startAngle:l,pixelMargin:c,innerRadius:d}=t,f=Math.max(t.outerRadius+r+n-c,0),g=d>0?d+r+n+c:0;let p=0;const v=i-l;if(r){const $=d>0?d-r:0,Z=f>0?f-r:0,U=($+Z)/2,ie=U!==0?v*U/(U+r):v;p=(v-ie)/2}const y=Math.max(.001,v*f-n/Kt)/f,x=(v-y)/2,w=l+x+p,S=i-x-p,{outerStart:C,outerEnd:P,innerStart:O,innerEnd:k}=TF(t,g,f,S-w),A=f-C,L=f-P,F=w+C/A,j=S-P/L,B=g+O,V=g+k,K=w+O/B,Y=S-k/V;if(e.beginPath(),o){const $=(F+j)/2;if(e.arc(s,a,f,F,$),e.arc(s,a,f,$,j),P>0){const le=vl(L,j,s,a);e.arc(le.x,le.y,P,j,S+dn)}const Z=vl(V,S,s,a);if(e.lineTo(Z.x,Z.y),k>0){const le=vl(V,Y,s,a);e.arc(le.x,le.y,k,S+dn,Y+Math.PI)}const U=(S-k/g+(w+O/g))/2;if(e.arc(s,a,g,S-k/g,U,!0),e.arc(s,a,g,U,w+O/g,!0),O>0){const le=vl(B,K,s,a);e.arc(le.x,le.y,O,K+Math.PI,w-dn)}const ie=vl(A,w,s,a);if(e.lineTo(ie.x,ie.y),C>0){const le=vl(A,F,s,a);e.arc(le.x,le.y,C,w-dn,F)}}else{e.moveTo(s,a);const $=Math.cos(F)*f+s,Z=Math.sin(F)*f+a;e.lineTo($,Z);const U=Math.cos(j)*f+s,ie=Math.sin(j)*f+a;e.lineTo(U,ie)}e.closePath()}function AF(e,t,n,r,i){const{fullCircles:o,startAngle:s,circumference:a}=t;let l=t.endAngle;if(o){ch(e,t,n,r,l,i);for(let c=0;c<o;++c)e.fill();isNaN(a)||(l=s+(a%Xt||Xt))}return ch(e,t,n,r,l,i),e.fill(),l}function IF(e,t,n,r,i){const{fullCircles:o,startAngle:s,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:d,borderDash:f,borderDashOffset:g}=l,p=l.borderAlign==="inner";if(!c)return;e.setLineDash(f||[]),e.lineDashOffset=g,p?(e.lineWidth=c*2,e.lineJoin=d||"round"):(e.lineWidth=c,e.lineJoin=d||"bevel");let v=t.endAngle;if(o){ch(e,t,n,r,v,i);for(let y=0;y<o;++y)e.stroke();isNaN(a)||(v=s+(a%Xt||Xt))}p&&MF(e,t,v),o||(ch(e,t,n,r,v,i),e.stroke())}class bl extends uo{constructor(n){super();ke(this,"circumference");ke(this,"endAngle");ke(this,"fullCircles");ke(this,"innerRadius");ke(this,"outerRadius");ke(this,"pixelMargin");ke(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,n&&Object.assign(this,n)}inRange(n,r,i){const o=this.getProps(["x","y"],i),{angle:s,distance:a}=NS(o,{x:n,y:r}),{startAngle:l,endAngle:c,innerRadius:d,outerRadius:f,circumference:g}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),p=(this.options.spacing+this.options.borderWidth)/2,y=tt(g,c-l)>=Xt||Jc(s,l,c),x=so(a,d+p,f+p);return y&&x}getCenterPoint(n){const{x:r,y:i,startAngle:o,endAngle:s,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:c,spacing:d}=this.options,f=(o+s)/2,g=(a+l+d+c)/2;return{x:r+Math.cos(f)*g,y:i+Math.sin(f)*g}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:r,circumference:i}=this,o=(r.offset||0)/4,s=(r.spacing||0)/2,a=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=i>Xt?Math.floor(i/Xt):0,i===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*o,Math.sin(l)*o);const c=1-Math.sin(Math.min(Kt,i||0)),d=o*c;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,AF(n,this,d,s,a),IF(n,this,d,s,a),n.restore()}}ke(bl,"id","arc"),ke(bl,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),ke(bl,"defaultRoutes",{backgroundColor:"backgroundColor"}),ke(bl,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function tE(e,t,n=t){e.lineCap=tt(n.borderCapStyle,t.borderCapStyle),e.setLineDash(tt(n.borderDash,t.borderDash)),e.lineDashOffset=tt(n.borderDashOffset,t.borderDashOffset),e.lineJoin=tt(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=tt(n.borderWidth,t.borderWidth),e.strokeStyle=tt(n.borderColor,t.borderColor)}function NF(e,t,n){e.lineTo(n.x,n.y)}function RF(e){return e.stepped?i9:e.tension||e.cubicInterpolationMode==="monotone"?o9:NF}function nE(e,t,n={}){const r=e.length,{start:i=0,end:o=r-1}=n,{start:s,end:a}=t,l=Math.max(i,s),c=Math.min(o,a),d=i<s&&o<s||i>a&&o>a;return{count:r,start:l,loop:t.loop,ilen:c<l&&!d?r+c-l:c-l}}function LF(e,t,n,r){const{points:i,options:o}=t,{count:s,start:a,loop:l,ilen:c}=nE(i,n,r),d=RF(o);let{move:f=!0,reverse:g}=r||{},p,v,y;for(p=0;p<=c;++p)v=i[(a+(g?c-p:p))%s],!v.skip&&(f?(e.moveTo(v.x,v.y),f=!1):d(e,y,v,g,o.stepped),y=v);return l&&(v=i[(a+(g?c:0))%s],d(e,y,v,g,o.stepped)),!!l}function $F(e,t,n,r){const i=t.points,{count:o,start:s,ilen:a}=nE(i,n,r),{move:l=!0,reverse:c}=r||{};let d=0,f=0,g,p,v,y,x,w;const S=P=>(s+(c?a-P:P))%o,C=()=>{y!==x&&(e.lineTo(d,x),e.lineTo(d,y),e.lineTo(d,w))};for(l&&(p=i[S(0)],e.moveTo(p.x,p.y)),g=0;g<=a;++g){if(p=i[S(g)],p.skip)continue;const P=p.x,O=p.y,k=P|0;k===v?(O<y?y=O:O>x&&(x=O),d=(f*d+P)/++f):(C(),e.lineTo(P,O),v=k,f=0,y=x=O),w=O}C()}function cb(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?$F:LF}function FF(e){return e.stepped?$9:e.tension||e.cubicInterpolationMode==="monotone"?F9:Zs}function jF(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),tE(e,t.options),e.stroke(i)}function zF(e,t,n,r){const{segments:i,options:o}=t,s=cb(t);for(const a of i)tE(e,o,a.style),e.beginPath(),s(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const BF=typeof Path2D=="function";function VF(e,t,n,r){BF&&!t.options.segment?jF(e,t,n,r):zF(e,t,n,r)}class Go extends uo{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const i=r.spanGaps?this._loop:this._fullLoop;M9(this._points,r,t,i,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=W9(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,r=t.length;return r&&n[t[r-1].end]}interpolate(t,n){const r=this.options,i=t[n],o=this.points,s=dC(this,{property:n,start:i,end:i});if(!s.length)return;const a=[],l=FF(r);let c,d;for(c=0,d=s.length;c<d;++c){const{start:f,end:g}=s[c],p=o[f],v=o[g];if(p===v){a.push(p);continue}const y=Math.abs((i-p[n])/(v[n]-p[n])),x=l(p,v,y,r.stepped);x[n]=t[n],a.push(x)}return a.length===1?a[0]:a}pathSegment(t,n,r){return cb(this)(t,this,n,r)}path(t,n,r){const i=this.segments,o=cb(this);let s=this._loop;n=n||0,r=r||this.points.length-n;for(const a of i)s&=o(t,this,a,{start:n,end:n+r-1});return!!s}draw(t,n,r,i){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),VF(t,this,r,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}ke(Go,"id","line"),ke(Go,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),ke(Go,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),ke(Go,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function rE(e,t,n,r){const i=e.options,{[n]:o}=e.getProps([n],r);return Math.abs(t-o)<i.radius+i.hitRadius}class fu extends uo{constructor(n){super();ke(this,"parsed");ke(this,"skip");ke(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,r,i){const o=this.options,{x:s,y:a}=this.getProps(["x","y"],i);return Math.pow(n-s,2)+Math.pow(r-a,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(n,r){return rE(this,n,"x",r)}inYRange(n,r){return rE(this,n,"y",r)}getCenterPoint(n){const{x:r,y:i}=this.getProps(["x","y"],n);return{x:r,y:i}}size(n){n=n||this.options||{};let r=n.radius||0;r=Math.max(r,r&&n.hoverRadius||0);const i=r&&n.borderWidth||0;return(r+i)*2}draw(n,r){const i=this.options;this.skip||i.radius<.1||!lo(this,r,this.size(i)/2)||(n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.fillStyle=i.backgroundColor,Uv(n,i,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}ke(fu,"id","point"),ke(fu,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),ke(fu,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function iE(e,t){const{x:n,y:r,base:i,width:o,height:s}=e.getProps(["x","y","base","width","height"],t);let a,l,c,d,f;return e.horizontal?(f=s/2,a=Math.min(n,i),l=Math.max(n,i),c=r-f,d=r+f):(f=o/2,a=n-f,l=n+f,c=Math.min(r,i),d=Math.max(r,i)),{left:a,top:c,right:l,bottom:d}}function Yo(e,t,n,r){return e?0:kn(t,n,r)}function HF(e,t,n){const r=e.options.borderWidth,i=e.borderSkipped,o=KS(r);return{t:Yo(i.top,o.top,0,n),r:Yo(i.right,o.right,0,t),b:Yo(i.bottom,o.bottom,0,n),l:Yo(i.left,o.left,0,t)}}function WF(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),i=e.options.borderRadius,o=Xs(i),s=Math.min(t,n),a=e.borderSkipped,l=r||wt(i);return{topLeft:Yo(!l||a.top||a.left,o.topLeft,0,s),topRight:Yo(!l||a.top||a.right,o.topRight,0,s),bottomLeft:Yo(!l||a.bottom||a.left,o.bottomLeft,0,s),bottomRight:Yo(!l||a.bottom||a.right,o.bottomRight,0,s)}}function qF(e){const t=iE(e),n=t.right-t.left,r=t.bottom-t.top,i=HF(e,n/2,r/2),o=WF(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:o},inner:{x:t.left+i.l,y:t.top+i.t,w:n-i.l-i.r,h:r-i.t-i.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,o.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(i.b,i.r))}}}}function ub(e,t,n,r){const i=t===null,o=n===null,a=e&&!(i&&o)&&iE(e,r);return a&&(i||so(t,a.left,a.right))&&(o||so(n,a.top,a.bottom))}function UF(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function GF(e,t){e.rect(t.x,t.y,t.w,t.h)}function db(e,t,n={}){const r=e.x!==n.x?-t:0,i=e.y!==n.y?-t:0,o=(e.x+e.w!==n.x+n.w?t:0)-r,s=(e.y+e.h!==n.y+n.h?t:0)-i;return{x:e.x+r,y:e.y+i,w:e.w+o,h:e.h+s,radius:e.radius}}class hu extends uo{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:n,options:{borderColor:r,backgroundColor:i}}=this,{inner:o,outer:s}=qF(this),a=UF(s.radius)?nu:GF;t.save(),(s.w!==o.w||s.h!==o.h)&&(t.beginPath(),a(t,db(s,n,o)),t.clip(),a(t,db(o,-n,s)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),a(t,db(o,n)),t.fillStyle=i,t.fill(),t.restore()}inRange(t,n,r){return ub(this,t,n,r)}inXRange(t,n){return ub(this,t,null,n)}inYRange(t,n){return ub(this,null,t,n)}getCenterPoint(t){const{x:n,y:r,base:i,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(n+i)/2:n,y:o?r:(r+i)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}ke(hu,"id","bar"),ke(hu,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),ke(hu,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var YF=Object.freeze({__proto__:null,ArcElement:bl,BarElement:hu,LineElement:Go,PointElement:fu});const fb=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],oE=fb.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function sE(e){return fb[e%fb.length]}function aE(e){return oE[e%oE.length]}function KF(e,t){return e.borderColor=sE(t),e.backgroundColor=aE(t),++t}function XF(e,t){return e.backgroundColor=e.data.map(()=>sE(t++)),t}function QF(e,t){return e.backgroundColor=e.data.map(()=>aE(t++)),t}function JF(e){let t=0;return(n,r)=>{const i=e.getDatasetMeta(r).controller;i instanceof ea?t=XF(n,t):i instanceof iu?t=QF(n,t):i&&(t=KF(n,t))}}function lE(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function ZF(e){return e&&(e.borderColor||e.backgroundColor)}var e8={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:r},options:i}=e.config,{elements:o}=i;if(!n.forceOverride&&(lE(r)||ZF(i)||o&&lE(o)))return;const s=JF(e);r.forEach(s)}};function t8(e,t,n,r,i){const o=i.samples||r;if(o>=n)return e.slice(t,t+n);const s=[],a=(n-2)/(o-2);let l=0;const c=t+n-1;let d=t,f,g,p,v,y;for(s[l++]=e[d],f=0;f<o-2;f++){let x=0,w=0,S;const C=Math.floor((f+1)*a)+1+t,P=Math.min(Math.floor((f+2)*a)+1,n)+t,O=P-C;for(S=C;S<P;S++)x+=e[S].x,w+=e[S].y;x/=O,w/=O;const k=Math.floor(f*a)+1+t,A=Math.min(Math.floor((f+1)*a)+1,n)+t,{x:L,y:F}=e[d];for(p=v=-1,S=k;S<A;S++)v=.5*Math.abs((L-x)*(e[S].y-F)-(L-e[S].x)*(w-F)),v>p&&(p=v,g=e[S],y=S);s[l++]=g,d=y}return s[l++]=e[c],s}function n8(e,t,n,r){let i=0,o=0,s,a,l,c,d,f,g,p,v,y;const x=[],w=t+n-1,S=e[t].x,P=e[w].x-S;for(s=t;s<t+n;++s){a=e[s],l=(a.x-S)/P*r,c=a.y;const O=l|0;if(O===d)c<v?(v=c,f=s):c>y&&(y=c,g=s),i=(o*i+a.x)/++o;else{const k=s-1;if(!gt(f)&&!gt(g)){const A=Math.min(f,g),L=Math.max(f,g);A!==p&&A!==k&&x.push({...e[A],x:i}),L!==p&&L!==k&&x.push({...e[L],x:i})}s>0&&k!==p&&x.push(e[k]),x.push(a),d=O,o=0,v=y=c,f=g=p=s}}return x}function cE(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function uE(e){e.data.datasets.forEach(t=>{cE(t)})}function r8(e,t){const n=t.length;let r=0,i;const{iScale:o}=e,{min:s,max:a,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(r=kn(ao(t,o.axis,s).lo,0,n-1)),c?i=kn(ao(t,o.axis,a).hi+1,r,n)-r:i=n-r,{start:r,count:i}}var i8={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){uE(e);return}const r=e.width;e.data.datasets.forEach((i,o)=>{const{_data:s,indexAxis:a}=i,l=e.getDatasetMeta(o),c=s||i.data;if(Qt([a,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const d=e.scales[l.xAxisID];if(d.type!=="linear"&&d.type!=="time"||e.options.parsing)return;let{start:f,count:g}=r8(l,c);const p=n.threshold||4*r;if(g<=p){cE(i);return}gt(s)&&(i._data=c,delete i.data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(y){this._data=y}}));let v;switch(n.algorithm){case"lttb":v=t8(c,f,g,r,n);break;case"min-max":v=n8(c,f,g,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}i._decimated=v})},destroy(e){uE(e)}};function o8(e,t,n){const r=e.segments,i=e.points,o=t.points,s=[];for(const a of r){let{start:l,end:c}=a;c=pb(l,c,i);const d=hb(n,i[l],i[c],a.loop);if(!t.segments){s.push({source:a,target:d,start:i[l],end:i[c]});continue}const f=dC(t,d);for(const g of f){const p=hb(n,o[g.start],o[g.end],g.loop),v=uC(a,i,p);for(const y of v)s.push({source:y,target:g,start:{[n]:dE(d,p,"start",Math.max)},end:{[n]:dE(d,p,"end",Math.min)}})}}return s}function hb(e,t,n,r){if(r)return;let i=t[e],o=n[e];return e==="angle"&&(i=Pr(i),o=Pr(o)),{property:e,start:i,end:o}}function s8(e,t){const{x:n=null,y:r=null}=e||{},i=t.points,o=[];return t.segments.forEach(({start:s,end:a})=>{a=pb(s,a,i);const l=i[s],c=i[a];r!==null?(o.push({x:l.x,y:r}),o.push({x:c.x,y:r})):n!==null&&(o.push({x:n,y:l.y}),o.push({x:n,y:c.y}))}),o}function pb(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function dE(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function fE(e,t){let n=[],r=!1;return Yt(e)?(r=!0,n=e):n=s8(e,t),n.length?new Go({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function hE(e){return e&&e.fill!==!1}function a8(e,t,n){let i=e[t].fill;const o=[t];let s;if(!n)return i;for(;i!==!1&&o.indexOf(i)===-1;){if(!ln(i))return i;if(s=e[i],!s)return!1;if(s.visible)return i;o.push(i),i=s.fill}return!1}function l8(e,t,n){const r=f8(e);if(wt(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return ln(i)&&Math.floor(i)===i?c8(r[0],t,i,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function c8(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function u8(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:wt(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function d8(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:wt(e)?r=e.value:r=t.getBaseValue(),r}function f8(e){const t=e.options,n=t.fill;let r=tt(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function h8(e){const{scale:t,index:n,line:r}=e,i=[],o=r.segments,s=r.points,a=p8(t,n);a.push(fE({x:null,y:t.bottom},r));for(let l=0;l<o.length;l++){const c=o[l];for(let d=c.start;d<=c.end;d++)g8(i,s[d],a)}return new Go({points:i,options:{}})}function p8(e,t){const n=[],r=e.getMatchingVisibleMetas("line");for(let i=0;i<r.length;i++){const o=r[i];if(o.index===t)break;o.hidden||n.unshift(o.dataset)}return n}function g8(e,t,n){const r=[];for(let i=0;i<n.length;i++){const o=n[i],{first:s,last:a,point:l}=m8(o,t,"x");if(!(!l||s&&a)){if(s)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function m8(e,t,n){const r=e.interpolate(t,n);if(!r)return{};const i=r[n],o=e.segments,s=e.points;let a=!1,l=!1;for(let c=0;c<o.length;c++){const d=o[c],f=s[d.start][n],g=s[d.end][n];if(so(i,f,g)){a=i===f,l=i===g;break}}return{first:a,last:l,point:r}}class pE{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,r){const{x:i,y:o,radius:s}=this;return n=n||{start:0,end:Xt},t.arc(i,o,s,n.end,n.start,!0),!r.bounds}interpolate(t){const{x:n,y:r,radius:i}=this,o=t.angle;return{x:n+Math.cos(o)*i,y:r+Math.sin(o)*i,angle:o}}}function v8(e){const{chart:t,fill:n,line:r}=e;if(ln(n))return b8(t,n);if(n==="stack")return h8(e);if(n==="shape")return!0;const i=y8(e);return i instanceof pE?i:fE(i,r)}function b8(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function y8(e){return(e.scale||{}).getPointPositionForValue?w8(e):x8(e)}function x8(e){const{scale:t={},fill:n}=e,r=u8(n,t);if(ln(r)){const i=t.isHorizontal();return{x:i?r:null,y:i?null:r}}return null}function w8(e){const{scale:t,fill:n}=e,r=t.options,i=t.getLabels().length,o=r.reverse?t.max:t.min,s=d8(n,t,o),a=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,o);return new pE({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(s)})}for(let l=0;l<i;++l)a.push(t.getPointPositionForValue(l,s));return a}function gb(e,t,n){const r=v8(t),{line:i,scale:o,axis:s}=t,a=i.options,l=a.fill,c=a.backgroundColor,{above:d=c,below:f=c}=l||{};r&&i.points.length&&(Wf(e,n),_8(e,{line:i,target:r,above:d,below:f,area:n,scale:o,axis:s}),qf(e))}function _8(e,t){const{line:n,target:r,above:i,below:o,area:s,scale:a}=t,l=n._loop?"angle":t.axis;e.save(),l==="x"&&o!==i&&(gE(e,r,s.top),mE(e,{line:n,target:r,color:i,scale:a,property:l}),e.restore(),e.save(),gE(e,r,s.bottom)),mE(e,{line:n,target:r,color:o,scale:a,property:l}),e.restore()}function gE(e,t,n){const{segments:r,points:i}=t;let o=!0,s=!1;e.beginPath();for(const a of r){const{start:l,end:c}=a,d=i[l],f=i[pb(l,c,i)];o?(e.moveTo(d.x,d.y),o=!1):(e.lineTo(d.x,n),e.lineTo(d.x,d.y)),s=!!t.pathSegment(e,a,{move:s}),s?e.closePath():e.lineTo(f.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function mE(e,t){const{line:n,target:r,property:i,color:o,scale:s}=t,a=o8(n,r,i);for(const{source:l,target:c,start:d,end:f}of a){const{style:{backgroundColor:g=o}={}}=l,p=r!==!0;e.save(),e.fillStyle=g,S8(e,s,p&&hb(i,d,f)),e.beginPath();const v=!!n.pathSegment(e,l);let y;if(p){v?e.closePath():vE(e,r,f,i);const x=!!r.pathSegment(e,c,{move:v,reverse:!0});y=v&&x,y||vE(e,r,d,i)}e.closePath(),e.fill(y?"evenodd":"nonzero"),e.restore()}}function S8(e,t,n){const{top:r,bottom:i}=t.chart.chartArea,{property:o,start:s,end:a}=n||{};o==="x"&&(e.beginPath(),e.rect(s,r,a-s,i-r),e.clip())}function vE(e,t,n,r){const i=t.interpolate(n,r);i&&e.lineTo(i.x,i.y)}var C8={id:"filler",afterDatasetsUpdate(e,t,n){const r=(e.data.datasets||[]).length,i=[];let o,s,a,l;for(s=0;s<r;++s)o=e.getDatasetMeta(s),a=o.dataset,l=null,a&&a.options&&a instanceof Go&&(l={visible:e.isDatasetVisible(s),index:s,fill:l8(a,s,r),chart:e,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=l,i.push(l);for(s=0;s<r;++s)l=i[s],!(!l||l.fill===!1)&&(l.fill=a8(i,s,n.propagate))},beforeDraw(e,t,n){const r=n.drawTime==="beforeDraw",i=e.getSortedVisibleDatasetMetas(),o=e.chartArea;for(let s=i.length-1;s>=0;--s){const a=i[s].$filler;a&&(a.line.updateControlPoints(o,a.axis),r&&a.fill&&gb(e.ctx,a,o))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const r=e.getSortedVisibleDatasetMetas();for(let i=r.length-1;i>=0;--i){const o=r[i].$filler;hE(o)&&gb(e.ctx,o,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!hE(r)||n.drawTime!=="beforeDatasetDraw"||gb(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const bE=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},E8=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class yE extends uo{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,r){this.maxWidth=t,this.maxHeight=n,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=Ft(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,i)=>t.sort(r,i,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const r=t.labels,i=bn(r.font),o=i.size,s=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=bE(r,o);let c,d;n.font=i.string,this.isHorizontal()?(c=this.maxWidth,d=this._fitRows(s,o,a,l)+10):(d=this.maxHeight,c=this._fitCols(s,i,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(d,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,i){const{ctx:o,maxWidth:s,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],d=i+a;let f=t;o.textAlign="left",o.textBaseline="middle";let g=-1,p=-d;return this.legendItems.forEach((v,y)=>{const x=r+n/2+o.measureText(v.text).width;(y===0||c[c.length-1]+x+2*a>s)&&(f+=d,c[c.length-(y>0?0:1)]=0,p+=d,g++),l[y]={left:0,top:p,row:g,width:x,height:i},c[c.length-1]+=x+a}),f}_fitCols(t,n,r,i){const{ctx:o,maxHeight:s,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],d=s-t;let f=a,g=0,p=0,v=0,y=0;return this.legendItems.forEach((x,w)=>{const{itemWidth:S,itemHeight:C}=O8(r,n,o,x,i);w>0&&p+C+2*a>d&&(f+=g+a,c.push({width:g,height:p}),v+=g+a,y++,g=p=0),l[w]={left:v,top:p,col:y,width:S,height:C},g=Math.max(g,S),p+=C+a}),f+=g,c.push({width:g,height:p}),f}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:i},rtl:o}}=this,s=ml(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=qn(r,this.left+i,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=qn(r,this.left+i,this.right-this.lineWidths[a])),c.top+=this.top+t+i,c.left=s.leftForLtr(s.x(l),c.width),l+=c.width+i}else{let a=0,l=qn(r,this.top+t+i,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=qn(r,this.top+t+i,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+i,c.left=s.leftForLtr(s.x(c.left),c.width),l+=c.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Wf(t,this),this._draw(),qf(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:i}=this,{align:o,labels:s}=t,a=on.color,l=ml(t.rtl,this.left,this.width),c=bn(s.font),{padding:d}=s,f=c.size,g=f/2;let p;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=c.string;const{boxWidth:v,boxHeight:y,itemHeight:x}=bE(s,f),w=function(k,A,L){if(isNaN(v)||v<=0||isNaN(y)||y<0)return;i.save();const F=tt(L.lineWidth,1);if(i.fillStyle=tt(L.fillStyle,a),i.lineCap=tt(L.lineCap,"butt"),i.lineDashOffset=tt(L.lineDashOffset,0),i.lineJoin=tt(L.lineJoin,"miter"),i.lineWidth=F,i.strokeStyle=tt(L.strokeStyle,a),i.setLineDash(tt(L.lineDash,[])),s.usePointStyle){const j={radius:y*Math.SQRT2/2,pointStyle:L.pointStyle,rotation:L.rotation,borderWidth:F},B=l.xPlus(k,v/2),V=A+g;YS(i,j,B,V,s.pointStyleWidth&&v)}else{const j=A+Math.max((f-y)/2,0),B=l.leftForLtr(k,v),V=Xs(L.borderRadius);i.beginPath(),Object.values(V).some(K=>K!==0)?nu(i,{x:B,y:j,w:v,h:y,radius:V}):i.rect(B,j,v,y),i.fill(),F!==0&&i.stroke()}i.restore()},S=function(k,A,L){Ks(i,L.text,k,A+x/2,c,{strikethrough:L.hidden,textAlign:l.textAlign(L.textAlign)})},C=this.isHorizontal(),P=this._computeTitleHeight();C?p={x:qn(o,this.left+d,this.right-r[0]),y:this.top+d+P,line:0}:p={x:this.left+d,y:qn(o,this.top+P+d,this.bottom-n[0].height),line:0},sC(this.ctx,t.textDirection);const O=x+d;this.legendItems.forEach((k,A)=>{i.strokeStyle=k.fontColor,i.fillStyle=k.fontColor;const L=i.measureText(k.text).width,F=l.textAlign(k.textAlign||(k.textAlign=s.textAlign)),j=v+g+L;let B=p.x,V=p.y;l.setWidth(this.width),C?A>0&&B+j+d>this.right&&(V=p.y+=O,p.line++,B=p.x=qn(o,this.left+d,this.right-r[p.line])):A>0&&V+O>this.bottom&&(B=p.x=B+n[p.line].width+d,p.line++,V=p.y=qn(o,this.top+P+d,this.bottom-n[p.line].height));const K=l.x(B);if(w(K,V,k),B=GL(F,B+v+g,C?B+j:this.right,t.rtl),S(l.x(B),V,k),C)p.x+=j+d;else if(typeof k.text!="string"){const Y=c.lineHeight;p.y+=xE(k,Y)+d}else p.y+=O}),aC(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=bn(n.font),i=Rn(n.padding);if(!n.display)return;const o=ml(t.rtl,this.left,this.width),s=this.ctx,a=n.position,l=r.size/2,c=i.top+l;let d,f=this.left,g=this.width;if(this.isHorizontal())g=Math.max(...this.lineWidths),d=this.top+c,f=qn(t.align,f,this.right-g);else{const v=this.columnSizes.reduce((y,x)=>Math.max(y,x.height),0);d=c+qn(t.align,this.top,this.bottom-v-t.labels.padding-this._computeTitleHeight())}const p=qn(a,f,f+g);s.textAlign=o.textAlign(Bv(a)),s.textBaseline="middle",s.strokeStyle=n.color,s.fillStyle=n.color,s.font=r.string,Ks(s,n.text,p,d,r)}_computeTitleHeight(){const t=this.options.title,n=bn(t.font),r=Rn(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,i,o;if(so(t,this.left,this.right)&&so(n,this.top,this.bottom)){for(o=this.legendHitBoxes,r=0;r<o.length;++r)if(i=o[r],so(t,i.left,i.left+i.width)&&so(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!M8(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,o=E8(i,r);i&&!o&&Ft(n.onLeave,[t,i,this],this),this._hoveredItem=r,r&&!o&&Ft(n.onHover,[t,r,this],this)}else r&&Ft(n.onClick,[t,r,this],this)}}function O8(e,t,n,r,i){const o=P8(r,e,t,n),s=k8(i,r,t.lineHeight);return{itemWidth:o,itemHeight:s}}function P8(e,t,n,r){let i=e.text;return i&&typeof i!="string"&&(i=i.reduce((o,s)=>o.length>s.length?o:s)),t+n.size/2+r.measureText(i).width}function k8(e,t,n){let r=e;return typeof t.text!="string"&&(r=xE(t,n)),r}function xE(e,t){const n=e.text?e.text.length:0;return t*n}function M8(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var D8={id:"legend",_element:yE,start(e,t,n){const r=e.legend=new yE({ctx:e.ctx,options:n,chart:e});Un.configure(e,r,n),Un.addBox(e,r)},stop(e){Un.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;Un.configure(e,r,n),r.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const r=t.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:i,color:o,useBorderRadius:s,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),d=Rn(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(d.width+d.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:i||c.textAlign,borderRadius:s&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class mb extends uo{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const i=Yt(r.text)?r.text.length:1;this._padding=Rn(r.padding);const o=i*bn(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:i,right:o,options:s}=this,a=s.align;let l=0,c,d,f;return this.isHorizontal()?(d=qn(a,r,o),f=n+t,c=o-r):(s.position==="left"?(d=r+t,f=qn(a,i,n),l=Kt*-.5):(d=o-t,f=qn(a,n,i),l=Kt*.5),c=i-n),{titleX:d,titleY:f,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=bn(n.font),o=r.lineHeight/2+this._padding.top,{titleX:s,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);Ks(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:c,textAlign:Bv(n.align),textBaseline:"middle",translation:[s,a]})}}function T8(e,t){const n=new mb({ctx:e.ctx,options:t,chart:e});Un.configure(e,n,t),Un.addBox(e,n),e.titleBlock=n}var A8={id:"title",_element:mb,start(e,t,n){T8(e,n)},stop(e){const t=e.titleBlock;Un.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;Un.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const uh=new WeakMap;var I8={id:"subtitle",start(e,t,n){const r=new mb({ctx:e.ctx,options:n,chart:e});Un.configure(e,r,n),Un.addBox(e,r),uh.set(e,r)},stop(e){Un.removeBox(e,uh.get(e)),uh.delete(e)},beforeUpdate(e,t,n){const r=uh.get(e);Un.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const pu={average(e){if(!e.length)return!1;let t,n,r=0,i=0,o=0;for(t=0,n=e.length;t<n;++t){const s=e[t].element;if(s&&s.hasValue()){const a=s.tooltipPosition();r+=a.x,i+=a.y,++o}}return{x:r/o,y:i/o}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=Number.POSITIVE_INFINITY,o,s,a;for(o=0,s=e.length;o<s;++o){const l=e[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),d=jv(t,c);d<i&&(i=d,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function Ri(e,t){return t&&(Yt(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function fo(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
|
122
122
|
`)>-1?e.split(`
|
|
123
|
-
`):e}function N8(e,t){const{element:n,datasetIndex:r,index:i}=t,o=e.getDatasetMeta(r).controller,{label:s,value:a}=o.getLabelAndValue(i);return{chart:e,label:s,parsed:o.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:a,dataset:o.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function wE(e,t){const n=e.chart.ctx,{body:r,footer:i,title:o}=e,{boxWidth:s,boxHeight:a}=t,l=bn(t.bodyFont),c=bn(t.titleFont),d=bn(t.footerFont),f=o.length,g=i.length,p=r.length,v=Rn(t.padding);let y=v.height,x=0,w=r.reduce((P,O)=>P+O.before.length+O.lines.length+O.after.length,0);if(w+=e.beforeBody.length+e.afterBody.length,f&&(y+=f*c.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),w){const P=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;y+=p*P+(w-p)*l.lineHeight+(w-1)*t.bodySpacing}g&&(y+=t.footerMarginTop+g*d.lineHeight+(g-1)*t.footerSpacing);let S=0;const C=function(P){x=Math.max(x,n.measureText(P).width+S)};return n.save(),n.font=c.string,Nt(e.title,C),n.font=l.string,Nt(e.beforeBody.concat(e.afterBody),C),S=t.displayColors?s+2+t.boxPadding:0,Nt(r,P=>{Nt(P.before,C),Nt(P.lines,C),Nt(P.after,C)}),S=0,n.font=d.string,Nt(e.footer,C),n.restore(),x+=v.width,{width:x,height:y}}function R8(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function L8(e,t,n,r){const{x:i,width:o}=r,s=n.caretSize+n.caretPadding;if(e==="left"&&i+o+s>t.width||e==="right"&&i-o-s<0)return!0}function $8(e,t,n,r){const{x:i,width:o}=n,{width:s,chartArea:{left:a,right:l}}=e;let c="center";return r==="center"?c=i<=(a+l)/2?"left":"right":i<=o/2?c="left":i>=s-o/2&&(c="right"),L8(c,e,t,n)&&(c="center"),c}function _E(e,t,n){const r=n.yAlign||t.yAlign||R8(e,n);return{xAlign:n.xAlign||t.xAlign||$8(e,t,n,r),yAlign:r}}function F8(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function j8(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function SE(e,t,n,r){const{caretSize:i,caretPadding:o,cornerRadius:s}=e,{xAlign:a,yAlign:l}=n,c=i+o,{topLeft:d,topRight:f,bottomLeft:g,bottomRight:p}=Xs(s);let v=F8(t,a);const y=j8(t,l,c);return l==="center"?a==="left"?v+=c:a==="right"&&(v-=c):a==="left"?v-=Math.max(d,g)+i:a==="right"&&(v+=Math.max(f,p)+i),{x:kn(v,0,r.width-t.width),y:kn(y,0,r.height-t.height)}}function dh(e,t,n){const r=Rn(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function CE(e){return Ri([],fo(e))}function z8(e,t,n){return Uo(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function EE(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const OE={beforeTitle:oo,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:oo,beforeBody:oo,beforeLabel:oo,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return gt(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:oo,afterBody:oo,beforeFooter:oo,footer:oo,afterFooter:oo};function lr(e,t,n,r){const i=e[t].call(n,r);return typeof i>"u"?OE[t].call(n,r):i}let PE=(Ox=class extends uo{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,r=this.options.setContext(this.getContext()),i=r.enabled&&n.options.animation&&r.animations,o=new gC(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=z8(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=lr(r,"beforeTitle",this,t),o=lr(r,"title",this,t),s=lr(r,"afterTitle",this,t);let a=[];return a=Ri(a,fo(i)),a=Ri(a,fo(o)),a=Ri(a,fo(s)),a}getBeforeBody(t,n){return CE(lr(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return Nt(t,o=>{const s={before:[],lines:[],after:[]},a=EE(r,o);Ri(s.before,fo(lr(a,"beforeLabel",this,o))),Ri(s.lines,lr(a,"label",this,o)),Ri(s.after,fo(lr(a,"afterLabel",this,o))),i.push(s)}),i}getAfterBody(t,n){return CE(lr(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=lr(r,"beforeFooter",this,t),o=lr(r,"footer",this,t),s=lr(r,"afterFooter",this,t);let a=[];return a=Ri(a,fo(i)),a=Ri(a,fo(o)),a=Ri(a,fo(s)),a}_createItems(t){const n=this._active,r=this.chart.data,i=[],o=[],s=[];let a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push(N8(this.chart,n[l]));return t.filter&&(a=a.filter((d,f,g)=>t.filter(d,f,g,r))),t.itemSort&&(a=a.sort((d,f)=>t.itemSort(d,f,r))),Nt(a,d=>{const f=EE(t.callbacks,d);i.push(lr(f,"labelColor",this,d)),o.push(lr(f,"labelPointStyle",this,d)),s.push(lr(f,"labelTextColor",this,d))}),this.labelColors=i,this.labelPointStyles=o,this.labelTextColors=s,this.dataPoints=a,a}update(t,n){const r=this.options.setContext(this.getContext()),i=this._active;let o,s=[];if(!i.length)this.opacity!==0&&(o={opacity:0});else{const a=pu[r.position].call(this,i,this._eventPosition);s=this._createItems(r),this.title=this.getTitle(s,r),this.beforeBody=this.getBeforeBody(s,r),this.body=this.getBody(s,r),this.afterBody=this.getAfterBody(s,r),this.footer=this.getFooter(s,r);const l=this._size=wE(this,r),c=Object.assign({},a,l),d=_E(this.chart,r,c),f=SE(r,c,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,o={opacity:1,x:f.x,y:f.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=s,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,i){const o=this.getCaretPosition(t,r,i);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(t,n,r){const{xAlign:i,yAlign:o}=this,{caretSize:s,cornerRadius:a}=r,{topLeft:l,topRight:c,bottomLeft:d,bottomRight:f}=Xs(a),{x:g,y:p}=t,{width:v,height:y}=n;let x,w,S,C,P,O;return o==="center"?(P=p+y/2,i==="left"?(x=g,w=x-s,C=P+s,O=P-s):(x=g+v,w=x+s,C=P-s,O=P+s),S=x):(i==="left"?w=g+Math.max(l,d)+s:i==="right"?w=g+v-Math.max(c,f)-s:w=this.caretX,o==="top"?(C=p,P=C-s,x=w-s,S=w+s):(C=p+y,P=C+s,x=w+s,S=w-s),O=C),{x1:x,x2:w,x3:S,y1:C,y2:P,y3:O}}drawTitle(t,n,r){const i=this.title,o=i.length;let s,a,l;if(o){const c=ml(r.rtl,this.x,this.width);for(t.x=dh(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",s=bn(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=s.string,l=0;l<o;++l)n.fillText(i[l],c.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+a,l+1===o&&(t.y+=r.titleMarginBottom-a)}}_drawColorBox(t,n,r,i,o){const s=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=o,d=bn(o.bodyFont),f=dh(this,"left",o),g=i.x(f),p=l<d.lineHeight?(d.lineHeight-l)/2:0,v=n.y+p;if(o.usePointStyle){const y={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},x=i.leftForLtr(g,c)+c/2,w=v+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Uv(t,y,x,w),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,Uv(t,y,x,w)}else{t.lineWidth=wt(s.borderWidth)?Math.max(...Object.values(s.borderWidth)):s.borderWidth||1,t.strokeStyle=s.borderColor,t.setLineDash(s.borderDash||[]),t.lineDashOffset=s.borderDashOffset||0;const y=i.leftForLtr(g,c),x=i.leftForLtr(i.xPlus(g,1),c-2),w=Xs(s.borderRadius);Object.values(w).some(S=>S!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,nu(t,{x:y,y:v,w:c,h:l,radius:w}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),nu(t,{x,y:v+1,w:c-2,h:l-2,radius:w}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(y,v,c,l),t.strokeRect(y,v,c,l),t.fillStyle=s.backgroundColor,t.fillRect(x,v+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:i}=this,{bodySpacing:o,bodyAlign:s,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:d}=r,f=bn(r.bodyFont);let g=f.lineHeight,p=0;const v=ml(r.rtl,this.x,this.width),y=function(L){n.fillText(L,v.x(t.x+p),t.y+g/2),t.y+=g+o},x=v.textAlign(s);let w,S,C,P,O,k,A;for(n.textAlign=s,n.textBaseline="middle",n.font=f.string,t.x=dh(this,x,r),n.fillStyle=r.bodyColor,Nt(this.beforeBody,y),p=a&&x!=="right"?s==="center"?c/2+d:c+2+d:0,P=0,k=i.length;P<k;++P){for(w=i[P],S=this.labelTextColors[P],n.fillStyle=S,Nt(w.before,y),C=w.lines,a&&C.length&&(this._drawColorBox(n,t,P,v,r),g=Math.max(f.lineHeight,l)),O=0,A=C.length;O<A;++O)y(C[O]),g=f.lineHeight;Nt(w.after,y)}p=0,g=f.lineHeight,Nt(this.afterBody,y),t.y-=o}drawFooter(t,n,r){const i=this.footer,o=i.length;let s,a;if(o){const l=ml(r.rtl,this.x,this.width);for(t.x=dh(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",s=bn(r.footerFont),n.fillStyle=r.footerColor,n.font=s.string,a=0;a<o;++a)n.fillText(i[a],l.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+r.footerSpacing}}drawBackground(t,n,r,i){const{xAlign:o,yAlign:s}=this,{x:a,y:l}=t,{width:c,height:d}=r,{topLeft:f,topRight:g,bottomLeft:p,bottomRight:v}=Xs(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(a+f,l),s==="top"&&this.drawCaret(t,n,r,i),n.lineTo(a+c-g,l),n.quadraticCurveTo(a+c,l,a+c,l+g),s==="center"&&o==="right"&&this.drawCaret(t,n,r,i),n.lineTo(a+c,l+d-v),n.quadraticCurveTo(a+c,l+d,a+c-v,l+d),s==="bottom"&&this.drawCaret(t,n,r,i),n.lineTo(a+p,l+d),n.quadraticCurveTo(a,l+d,a,l+d-p),s==="center"&&o==="left"&&this.drawCaret(t,n,r,i),n.lineTo(a,l+f),n.quadraticCurveTo(a,l,a+f,l),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,i=r&&r.x,o=r&&r.y;if(i||o){const s=pu[t.position].call(this,this._active,this._eventPosition);if(!s)return;const a=this._size=wE(this,t),l=Object.assign({},s,this._size),c=_E(n,t,l),d=SE(t,l,c,n);(i._to!==d.x||o._to!==d.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=s.x,this.caretY=s.y,this._resolveAnimations().update(this,d))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},o={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const s=Rn(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=r,this.drawBackground(o,t,i,n),sC(t,n.textDirection),o.y+=s.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),aC(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,i=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!Ff(r,i),s=this._positionChanged(i,n);(o||s)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,o=this._active||[],s=this._getActiveElements(t,o,n,r),a=this._positionChanged(s,t),l=n||!Ff(s,o)||a;return l&&(this._active=s,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,i){const o=this.options;if(t.type==="mouseout")return[];if(!i)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const s=this.chart.getElementsAtEventForMode(t,o.mode,o,r);return o.reverse&&s.reverse(),s}_positionChanged(t,n){const{caretX:r,caretY:i,options:o}=this,s=pu[o.position].call(this,t,n);return s!==!1&&(r!==s.x||i!==s.y)}},ke(Ox,"positioners",pu),Ox);var B8={id:"tooltip",_element:PE,positioners:pu,afterInit(e,t,n){n&&(e.tooltip=new PE({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:OE},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},V8=Object.freeze({__proto__:null,Colors:e8,Decimation:i8,Filler:C8,Legend:D8,SubTitle:I8,Title:A8,Tooltip:B8});const H8=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function W8(e,t,n,r){const i=e.indexOf(t);if(i===-1)return H8(e,t,n,r);const o=e.lastIndexOf(t);return i!==o?n:i}const q8=(e,t)=>e===null?null:kn(Math.round(e),0,t);function kE(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class vb extends na{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:i,label:o}of n)r[i]===o&&r.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(gt(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:W8(r,t,tt(n,t),this._addedLabels),q8(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(i=this.getLabels().length-1)),this.min=r,this.max=i}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,i=[];let o=this.getLabels();o=t===0&&n===o.length-1?o:o.slice(t,n+1),this._valueRange=Math.max(o.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let s=t;s<=n;s++)i.push({value:s});return i}getLabelForValue(t){return kE.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}ke(vb,"id","category"),ke(vb,"defaults",{ticks:{callback:kE}});function U8(e,t){const n=[],{bounds:i,step:o,min:s,max:a,precision:l,count:c,maxTicks:d,maxDigits:f,includeBounds:g}=e,p=o||1,v=d-1,{min:y,max:x}=t,w=!gt(s),S=!gt(a),C=!gt(c),P=(x-y)/(f+1);let O=TS((x-y)/v/p)*p,k,A,L,F;if(O<1e-14&&!w&&!S)return[{value:y},{value:x}];F=Math.ceil(x/O)-Math.floor(y/O),F>v&&(O=TS(F*O/v/p)*p),gt(l)||(k=Math.pow(10,l),O=Math.ceil(O*k)/k),i==="ticks"?(A=Math.floor(y/O)*O,L=Math.ceil(x/O)*O):(A=y,L=x),w&&S&&o&&zL((a-s)/o,O/1e3)?(F=Math.round(Math.min((a-s)/O,d)),O=(a-s)/F,A=s,L=a):C?(A=w?s:A,L=S?a:L,F=c-1,O=(L-A)/F):(F=(L-A)/O,Qc(F,Math.round(F),O/1e3)?F=Math.round(F):F=Math.ceil(F));const j=Math.max(IS(O),IS(A));k=Math.pow(10,gt(l)?j:l),A=Math.round(A*k)/k,L=Math.round(L*k)/k;let B=0;for(w&&(g&&A!==s?(n.push({value:s}),A<s&&B++,Qc(Math.round((A+B*O)*k)/k,s,ME(s,P,e))&&B++):A<s&&B++);B<F;++B){const V=Math.round((A+B*O)*k)/k;if(S&&V>a)break;n.push({value:V})}return S&&g&&L!==a?n.length&&Qc(n[n.length-1].value,a,ME(a,P,e))?n[n.length-1].value=a:n.push({value:a}):(!S||L===a)&&n.push({value:L}),n}function ME(e,t,{horizontal:n,minRotation:r}){const i=mi(r),o=(n?Math.sin(i):Math.cos(i))||.001,s=.75*t*(""+e).length;return Math.min(t/o,s)}class fh extends na{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return gt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:i,max:o}=this;const s=l=>i=n?i:l,a=l=>o=r?o:l;if(t){const l=Ii(i),c=Ii(o);l<0&&c<0?a(0):l>0&&c>0&&s(0)}if(i===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||s(i-l)}this.min=i,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},o=this._range||this,s=U8(i,o);return t.bounds==="ticks"&&AS(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const i=(r-n)/Math.max(t.length-1,1)/2;n-=i,r+=i}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return eu(t,this.chart.options.locale,this.options.ticks.format)}}class bb extends fh{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=cn(t)?t:0,this.max=cn(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=mi(this.options.ticks.minRotation),i=(t?Math.sin(r):Math.cos(r))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}ke(bb,"id","linear"),ke(bb,"defaults",{ticks:{callback:Vf.formatters.numeric}});const gu=e=>Math.floor(qo(e)),ra=(e,t)=>Math.pow(10,gu(e)+t);function DE(e){return e/Math.pow(10,gu(e))===1}function TE(e,t,n){const r=Math.pow(10,n),i=Math.floor(e/r);return Math.ceil(t/r)-i}function G8(e,t){const n=t-e;let r=gu(n);for(;TE(e,t,r)>10;)r++;for(;TE(e,t,r)<10;)r--;return Math.min(r,gu(e))}function Y8(e,{min:t,max:n}){t=Or(e.min,t);const r=[],i=gu(t);let o=G8(t,n),s=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=i>o?Math.pow(10,i):0,c=Math.round((t-l)*s)/s,d=Math.floor((t-l)/a/10)*a*10;let f=Math.floor((c-d)/Math.pow(10,o)),g=Or(e.min,Math.round((l+d+f*Math.pow(10,o))*s)/s);for(;g<n;)r.push({value:g,major:DE(g),significand:f}),f>=10?f=f<15?15:20:f++,f>=20&&(o++,f=2,s=o>=0?1:s),g=Math.round((l+d+f*Math.pow(10,o))*s)/s;const p=Or(e.max,g);return r.push({value:p,major:DE(p),significand:f}),r}class yb extends na{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=fh.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return cn(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=cn(t)?Math.max(0,t):null,this.max=cn(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!cn(this._userMin)&&(this.min=t===ra(this.min,0)?ra(this.min,-1):ra(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let r=this.min,i=this.max;const o=a=>r=t?r:a,s=a=>i=n?i:a;r===i&&(r<=0?(o(1),s(10)):(o(ra(r,-1)),s(ra(i,1)))),r<=0&&o(ra(i,-1)),i<=0&&s(ra(r,1)),this.min=r,this.max=i}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=Y8(n,this);return t.bounds==="ticks"&&AS(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(t){return t===void 0?"0":eu(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=qo(t),this._valueRange=qo(this.max)-qo(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(qo(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}ke(yb,"id","logarithmic"),ke(yb,"defaults",{ticks:{callback:Vf.formatters.logarithmic,major:{enabled:!0}}});function xb(e){const t=e.ticks;if(t.display&&e.display){const n=Rn(t.backdropPadding);return tt(t.font&&t.font.size,on.font.size)+n.height}return 0}function K8(e,t,n){return n=Yt(n)?n:[n],{w:r9(e,t.string,n),h:n.length*t.lineHeight}}function AE(e,t,n,r,i){return e===r||e===i?{start:t-n/2,end:t+n/2}:e<r||e>i?{start:t-n,end:t}:{start:t,end:t+n}}function X8(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],i=[],o=e._pointLabels.length,s=e.options.pointLabels,a=s.centerPointLabels?Kt/o:0;for(let l=0;l<o;l++){const c=s.setContext(e.getPointLabelContext(l));i[l]=c.padding;const d=e.getPointPosition(l,e.drawingArea+i[l],a),f=bn(c.font),g=K8(e.ctx,f,e._pointLabels[l]);r[l]=g;const p=Pr(e.getIndexAngle(l)+a),v=Math.round(Fv(p)),y=AE(v,d.x,g.w,0,180),x=AE(v,d.y,g.h,90,270);Q8(n,t,p,y,x)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=ej(e,r,i)}function Q8(e,t,n,r,i){const o=Math.abs(Math.sin(n)),s=Math.abs(Math.cos(n));let a=0,l=0;r.start<t.l?(a=(t.l-r.start)/o,e.l=Math.min(e.l,t.l-a)):r.end>t.r&&(a=(r.end-t.r)/o,e.r=Math.max(e.r,t.r+a)),i.start<t.t?(l=(t.t-i.start)/s,e.t=Math.min(e.t,t.t-l)):i.end>t.b&&(l=(i.end-t.b)/s,e.b=Math.max(e.b,t.b+l))}function J8(e,t,n){const r=e.drawingArea,{extra:i,additionalAngle:o,padding:s,size:a}=n,l=e.getPointPosition(t,r+i+s,o),c=Math.round(Fv(Pr(l.angle+dn))),d=rj(l.y,a.h,c),f=tj(c),g=nj(l.x,a.w,f);return{visible:!0,x:l.x,y:d,textAlign:f,left:g,top:d,right:g+a.w,bottom:d+a.h}}function Z8(e,t){if(!t)return!0;const{left:n,top:r,right:i,bottom:o}=e;return!(lo({x:n,y:r},t)||lo({x:n,y:o},t)||lo({x:i,y:r},t)||lo({x:i,y:o},t))}function ej(e,t,n){const r=[],i=e._pointLabels.length,o=e.options,{centerPointLabels:s,display:a}=o.pointLabels,l={extra:xb(o)/2,additionalAngle:s?Kt/i:0};let c;for(let d=0;d<i;d++){l.padding=n[d],l.size=t[d];const f=J8(e,d,l);r.push(f),a==="auto"&&(f.visible=Z8(f,c),f.visible&&(c=f))}return r}function tj(e){return e===0||e===180?"center":e<180?"left":"right"}function nj(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function rj(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function ij(e,t,n){const{left:r,top:i,right:o,bottom:s}=n,{backdropColor:a}=t;if(!gt(a)){const l=Xs(t.borderRadius),c=Rn(t.backdropPadding);e.fillStyle=a;const d=r-c.left,f=i-c.top,g=o-r+c.width,p=s-i+c.height;Object.values(l).some(v=>v!==0)?(e.beginPath(),nu(e,{x:d,y:f,w:g,h:p,radius:l}),e.fill()):e.fillRect(d,f,g,p)}}function oj(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){const o=e._pointLabelItems[i];if(!o.visible)continue;const s=r.setContext(e.getPointLabelContext(i));ij(n,s,o);const a=bn(s.font),{x:l,y:c,textAlign:d}=o;Ks(n,e._pointLabels[i],l,c+a.lineHeight/2,a,{color:s.color,textAlign:d,textBaseline:"middle"})}}function IE(e,t,n,r){const{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,Xt);else{let o=e.getPointPosition(0,t);i.moveTo(o.x,o.y);for(let s=1;s<r;s++)o=e.getPointPosition(s,t),i.lineTo(o.x,o.y)}}function sj(e,t,n,r,i){const o=e.ctx,s=t.circular,{color:a,lineWidth:l}=t;!s&&!r||!a||!l||n<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(i.dash),o.lineDashOffset=i.dashOffset,o.beginPath(),IE(e,n,s,r),o.closePath(),o.stroke(),o.restore())}function aj(e,t,n){return Uo(e,{label:n,index:t,type:"pointLabel"})}class mu extends fh{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=Rn(xb(this.options)/2),n=this.width=this.maxWidth-t.width,r=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+r/2+t.top),this.drawingArea=Math.floor(Math.min(n,r)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=cn(t)&&!isNaN(t)?t:0,this.max=cn(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/xb(this.options))}generateTickLabels(t){fh.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const i=Ft(this.options.pointLabels.callback,[n,r],this);return i||i===0?i:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?X8(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,i){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,i))}getIndexAngle(t){const n=Xt/(this._pointLabels.length||1),r=this.options.startAngle||0;return Pr(t*n+mi(r))}getDistanceFromCenterForValue(t){if(gt(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(gt(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const r=n[t];return aj(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const i=this.getIndexAngle(t)-dn+r;return{x:Math.cos(i)*n+this.xCenter,y:Math.sin(i)*n+this.yCenter,angle:i}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:r,right:i,bottom:o}=this._pointLabelItems[t];return{left:n,top:r,right:i,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),IE(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),r.closePath(),r.fillStyle=t,r.fill(),r.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:r,grid:i,border:o}=n,s=this._pointLabels.length;let a,l,c;if(n.pointLabels.display&&oj(this,s),i.display&&this.ticks.forEach((d,f)=>{if(f!==0){l=this.getDistanceFromCenterForValue(d.value);const g=this.getContext(f),p=i.setContext(g),v=o.setContext(g);sj(this,p,l,s,v)}}),r.display){for(t.save(),a=s-1;a>=0;a--){const d=r.setContext(this.getPointLabelContext(a)),{color:f,lineWidth:g}=d;!g||!f||(t.lineWidth=g,t.strokeStyle=f,t.setLineDash(d.borderDash),t.lineDashOffset=d.borderDashOffset,l=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const i=this.getIndexAngle(0);let o,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&!n.reverse)return;const c=r.setContext(this.getContext(l)),d=bn(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=d.string,s=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const f=Rn(c.backdropPadding);t.fillRect(-s/2-f.left,-o-d.size/2-f.top,s+f.width,d.size+f.height)}Ks(t,a.label,0,-o,d,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}ke(mu,"id","radialLinear"),ke(mu,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Vf.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),ke(mu,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),ke(mu,"descriptors",{angleLines:{_fallback:"grid"}});const hh={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},cr=Object.keys(hh);function NE(e,t){return e-t}function RE(e,t){if(gt(t))return null;const n=e._adapter,{parser:r,round:i,isoWeekday:o}=e._parseOpts;let s=t;return typeof r=="function"&&(s=r(s)),cn(s)||(s=typeof r=="string"?n.parse(s,r):n.parse(s)),s===null?null:(i&&(s=i==="week"&&(hl(o)||o===!0)?n.startOf(s,"isoWeek",o):n.startOf(s,i)),+s)}function LE(e,t,n,r){const i=cr.length;for(let o=cr.indexOf(e);o<i-1;++o){const s=hh[cr[o]],a=s.steps?s.steps:Number.MAX_SAFE_INTEGER;if(s.common&&Math.ceil((n-t)/(a*s.size))<=r)return cr[o]}return cr[i-1]}function lj(e,t,n,r,i){for(let o=cr.length-1;o>=cr.indexOf(n);o--){const s=cr[o];if(hh[s].common&&e._adapter.diff(i,r,s)>=t-1)return s}return cr[n?cr.indexOf(n):0]}function cj(e){for(let t=cr.indexOf(e)+1,n=cr.length;t<n;++t)if(hh[cr[t]].common)return cr[t]}function $E(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=zv(n,t),o=n[r]>=t?n[r]:n[i];e[o]=!0}}function uj(e,t,n,r){const i=e._adapter,o=+i.startOf(t[0].value,r),s=t[t.length-1].value;let a,l;for(a=o;a<=s;a=+i.add(a,1,r))l=n[a],l>=0&&(t[l].major=!0);return t}function FE(e,t,n){const r=[],i={},o=t.length;let s,a;for(s=0;s<o;++s)a=t[s],i[a]=s,r.push({value:a,major:!1});return o===0||!n?r:uj(e,r,i,n)}class vu extends na{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const r=t.time||(t.time={}),i=this._adapter=new y$._date(t.adapters.date);i.init(n),Kc(r.displayFormats,i.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:RE(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:i,max:o,minDefined:s,maxDefined:a}=this.getUserBounds();function l(c){!s&&!isNaN(c.min)&&(i=Math.min(i,c.min)),!a&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!s||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),i=cn(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),o=cn(o)&&!isNaN(o)?o:+n.endOf(Date.now(),r)+1,this.min=Math.min(i,o-1),this.max=Math.max(i+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,i=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const o=this.min,s=this.max,a=WL(i,o,s);return this._unit=n.unit||(r.autoSkip?LE(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):lj(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:cj(this._unit),this.initOffsets(i),t.reverse&&a.reverse(),FE(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,i,o;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?n=1-i:n=(this.getDecimalForValue(t[1])-i)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?r=o:r=(o-this.getDecimalForValue(t[t.length-2]))/2);const s=t.length<3?.5:.25;n=kn(n,0,s),r=kn(r,0,s),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,i=this.options,o=i.time,s=o.unit||LE(o.minUnit,n,r,this._getLabelCapacity(n)),a=tt(i.ticks.stepSize,1),l=s==="week"?o.isoWeekday:!1,c=hl(l)||l===!0,d={};let f=n,g,p;if(c&&(f=+t.startOf(f,"isoWeek",l)),f=+t.startOf(f,c?"day":s),t.diff(r,n,s)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+s);const v=i.ticks.source==="data"&&this.getDataTimestamps();for(g=f,p=0;g<r;g=+t.add(g,a,s),p++)$E(d,g,v);return(g===r||i.bounds==="ticks"||p===1)&&$E(d,g,v),Object.keys(d).sort(NE).map(y=>+y)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const i=this.options.time.displayFormats,o=this._unit,s=n||i[o];return this._adapter.format(t,s)}_tickFormatFunction(t,n,r,i){const o=this.options,s=o.ticks.callback;if(s)return Ft(s,[t,n,r],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,d=l&&a[l],f=c&&a[c],g=r[n],p=c&&f&&g&&g.major;return this._adapter.format(t,i||(p?f:d))}generateTickLabels(t){let n,r,i;for(n=0,r=t.length;n<r;++n)i=t[n],i.label=this._tickFormatFunction(i.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,i=mi(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(i),s=Math.sin(i),a=this._resolveTickFontOptions(0).size;return{w:r*o+a*s,h:r*s+a*o}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,i=r[n.unit]||r.millisecond,o=this._tickFormatFunction(t,0,FE(this,[t],this._majorUnit),i),s=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/s.w:this.height/s.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,r=i.length;n<r;++n)t=t.concat(i[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const i=this.getLabels();for(n=0,r=i.length;n<r;++n)t.push(RE(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return $S(t.sort(NE))}}ke(vu,"id","time"),ke(vu,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function ph(e,t,n){let r=0,i=e.length-1,o,s,a,l;n?(t>=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=ao(e,"pos",t)),{pos:o,time:a}=e[r],{pos:s,time:l}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=ao(e,"time",t)),{time:o,pos:a}=e[r],{time:s,pos:l}=e[i]);const c=s-o;return c?a+(l-a)*(t-o)/c:a}class wb extends vu{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=ph(n,this.min),this._tableRange=ph(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,i=[],o=[];let s,a,l,c,d;for(s=0,a=t.length;s<a;++s)c=t[s],c>=n&&c<=r&&i.push(c);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(s=0,a=i.length;s<a;++s)d=i[s+1],l=i[s-1],c=i[s],Math.round((d+l)/2)!==c&&o.push({time:c,pos:s/(a-1)});return o}_generate(){const t=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((i,o)=>i-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(ph(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return ph(this._table,r*this._tableRange+this._minPos,!0)}}ke(wb,"id","timeseries"),ke(wb,"defaults",vu.defaults);var dj=Object.freeze({__proto__:null,CategoryScale:vb,LinearScale:bb,LogarithmicScale:yb,RadialLinearScale:mu,TimeScale:vu,TimeSeriesScale:wb});const fj=[b$,YF,V8,dj];/*!
|
|
123
|
+
`):e}function N8(e,t){const{element:n,datasetIndex:r,index:i}=t,o=e.getDatasetMeta(r).controller,{label:s,value:a}=o.getLabelAndValue(i);return{chart:e,label:s,parsed:o.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:a,dataset:o.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function wE(e,t){const n=e.chart.ctx,{body:r,footer:i,title:o}=e,{boxWidth:s,boxHeight:a}=t,l=bn(t.bodyFont),c=bn(t.titleFont),d=bn(t.footerFont),f=o.length,g=i.length,p=r.length,v=Rn(t.padding);let y=v.height,x=0,w=r.reduce((P,O)=>P+O.before.length+O.lines.length+O.after.length,0);if(w+=e.beforeBody.length+e.afterBody.length,f&&(y+=f*c.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),w){const P=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;y+=p*P+(w-p)*l.lineHeight+(w-1)*t.bodySpacing}g&&(y+=t.footerMarginTop+g*d.lineHeight+(g-1)*t.footerSpacing);let S=0;const C=function(P){x=Math.max(x,n.measureText(P).width+S)};return n.save(),n.font=c.string,Nt(e.title,C),n.font=l.string,Nt(e.beforeBody.concat(e.afterBody),C),S=t.displayColors?s+2+t.boxPadding:0,Nt(r,P=>{Nt(P.before,C),Nt(P.lines,C),Nt(P.after,C)}),S=0,n.font=d.string,Nt(e.footer,C),n.restore(),x+=v.width,{width:x,height:y}}function R8(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function L8(e,t,n,r){const{x:i,width:o}=r,s=n.caretSize+n.caretPadding;if(e==="left"&&i+o+s>t.width||e==="right"&&i-o-s<0)return!0}function $8(e,t,n,r){const{x:i,width:o}=n,{width:s,chartArea:{left:a,right:l}}=e;let c="center";return r==="center"?c=i<=(a+l)/2?"left":"right":i<=o/2?c="left":i>=s-o/2&&(c="right"),L8(c,e,t,n)&&(c="center"),c}function _E(e,t,n){const r=n.yAlign||t.yAlign||R8(e,n);return{xAlign:n.xAlign||t.xAlign||$8(e,t,n,r),yAlign:r}}function F8(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function j8(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function SE(e,t,n,r){const{caretSize:i,caretPadding:o,cornerRadius:s}=e,{xAlign:a,yAlign:l}=n,c=i+o,{topLeft:d,topRight:f,bottomLeft:g,bottomRight:p}=Xs(s);let v=F8(t,a);const y=j8(t,l,c);return l==="center"?a==="left"?v+=c:a==="right"&&(v-=c):a==="left"?v-=Math.max(d,g)+i:a==="right"&&(v+=Math.max(f,p)+i),{x:kn(v,0,r.width-t.width),y:kn(y,0,r.height-t.height)}}function dh(e,t,n){const r=Rn(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function CE(e){return Ri([],fo(e))}function z8(e,t,n){return Uo(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function EE(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const OE={beforeTitle:oo,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:oo,beforeBody:oo,beforeLabel:oo,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return gt(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:oo,afterBody:oo,beforeFooter:oo,footer:oo,afterFooter:oo};function lr(e,t,n,r){const i=e[t].call(n,r);return typeof i>"u"?OE[t].call(n,r):i}let PE=(Ox=class extends uo{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,r=this.options.setContext(this.getContext()),i=r.enabled&&n.options.animation&&r.animations,o=new gC(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=z8(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=lr(r,"beforeTitle",this,t),o=lr(r,"title",this,t),s=lr(r,"afterTitle",this,t);let a=[];return a=Ri(a,fo(i)),a=Ri(a,fo(o)),a=Ri(a,fo(s)),a}getBeforeBody(t,n){return CE(lr(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return Nt(t,o=>{const s={before:[],lines:[],after:[]},a=EE(r,o);Ri(s.before,fo(lr(a,"beforeLabel",this,o))),Ri(s.lines,lr(a,"label",this,o)),Ri(s.after,fo(lr(a,"afterLabel",this,o))),i.push(s)}),i}getAfterBody(t,n){return CE(lr(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=lr(r,"beforeFooter",this,t),o=lr(r,"footer",this,t),s=lr(r,"afterFooter",this,t);let a=[];return a=Ri(a,fo(i)),a=Ri(a,fo(o)),a=Ri(a,fo(s)),a}_createItems(t){const n=this._active,r=this.chart.data,i=[],o=[],s=[];let a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push(N8(this.chart,n[l]));return t.filter&&(a=a.filter((d,f,g)=>t.filter(d,f,g,r))),t.itemSort&&(a=a.sort((d,f)=>t.itemSort(d,f,r))),Nt(a,d=>{const f=EE(t.callbacks,d);i.push(lr(f,"labelColor",this,d)),o.push(lr(f,"labelPointStyle",this,d)),s.push(lr(f,"labelTextColor",this,d))}),this.labelColors=i,this.labelPointStyles=o,this.labelTextColors=s,this.dataPoints=a,a}update(t,n){const r=this.options.setContext(this.getContext()),i=this._active;let o,s=[];if(!i.length)this.opacity!==0&&(o={opacity:0});else{const a=pu[r.position].call(this,i,this._eventPosition);s=this._createItems(r),this.title=this.getTitle(s,r),this.beforeBody=this.getBeforeBody(s,r),this.body=this.getBody(s,r),this.afterBody=this.getAfterBody(s,r),this.footer=this.getFooter(s,r);const l=this._size=wE(this,r),c=Object.assign({},a,l),d=_E(this.chart,r,c),f=SE(r,c,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,o={opacity:1,x:f.x,y:f.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=s,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,i){const o=this.getCaretPosition(t,r,i);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(t,n,r){const{xAlign:i,yAlign:o}=this,{caretSize:s,cornerRadius:a}=r,{topLeft:l,topRight:c,bottomLeft:d,bottomRight:f}=Xs(a),{x:g,y:p}=t,{width:v,height:y}=n;let x,w,S,C,P,O;return o==="center"?(P=p+y/2,i==="left"?(x=g,w=x-s,C=P+s,O=P-s):(x=g+v,w=x+s,C=P-s,O=P+s),S=x):(i==="left"?w=g+Math.max(l,d)+s:i==="right"?w=g+v-Math.max(c,f)-s:w=this.caretX,o==="top"?(C=p,P=C-s,x=w-s,S=w+s):(C=p+y,P=C+s,x=w+s,S=w-s),O=C),{x1:x,x2:w,x3:S,y1:C,y2:P,y3:O}}drawTitle(t,n,r){const i=this.title,o=i.length;let s,a,l;if(o){const c=ml(r.rtl,this.x,this.width);for(t.x=dh(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",s=bn(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=s.string,l=0;l<o;++l)n.fillText(i[l],c.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+a,l+1===o&&(t.y+=r.titleMarginBottom-a)}}_drawColorBox(t,n,r,i,o){const s=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=o,d=bn(o.bodyFont),f=dh(this,"left",o),g=i.x(f),p=l<d.lineHeight?(d.lineHeight-l)/2:0,v=n.y+p;if(o.usePointStyle){const y={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},x=i.leftForLtr(g,c)+c/2,w=v+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Uv(t,y,x,w),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,Uv(t,y,x,w)}else{t.lineWidth=wt(s.borderWidth)?Math.max(...Object.values(s.borderWidth)):s.borderWidth||1,t.strokeStyle=s.borderColor,t.setLineDash(s.borderDash||[]),t.lineDashOffset=s.borderDashOffset||0;const y=i.leftForLtr(g,c),x=i.leftForLtr(i.xPlus(g,1),c-2),w=Xs(s.borderRadius);Object.values(w).some(S=>S!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,nu(t,{x:y,y:v,w:c,h:l,radius:w}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),nu(t,{x,y:v+1,w:c-2,h:l-2,radius:w}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(y,v,c,l),t.strokeRect(y,v,c,l),t.fillStyle=s.backgroundColor,t.fillRect(x,v+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:i}=this,{bodySpacing:o,bodyAlign:s,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:d}=r,f=bn(r.bodyFont);let g=f.lineHeight,p=0;const v=ml(r.rtl,this.x,this.width),y=function(L){n.fillText(L,v.x(t.x+p),t.y+g/2),t.y+=g+o},x=v.textAlign(s);let w,S,C,P,O,k,A;for(n.textAlign=s,n.textBaseline="middle",n.font=f.string,t.x=dh(this,x,r),n.fillStyle=r.bodyColor,Nt(this.beforeBody,y),p=a&&x!=="right"?s==="center"?c/2+d:c+2+d:0,P=0,k=i.length;P<k;++P){for(w=i[P],S=this.labelTextColors[P],n.fillStyle=S,Nt(w.before,y),C=w.lines,a&&C.length&&(this._drawColorBox(n,t,P,v,r),g=Math.max(f.lineHeight,l)),O=0,A=C.length;O<A;++O)y(C[O]),g=f.lineHeight;Nt(w.after,y)}p=0,g=f.lineHeight,Nt(this.afterBody,y),t.y-=o}drawFooter(t,n,r){const i=this.footer,o=i.length;let s,a;if(o){const l=ml(r.rtl,this.x,this.width);for(t.x=dh(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",s=bn(r.footerFont),n.fillStyle=r.footerColor,n.font=s.string,a=0;a<o;++a)n.fillText(i[a],l.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+r.footerSpacing}}drawBackground(t,n,r,i){const{xAlign:o,yAlign:s}=this,{x:a,y:l}=t,{width:c,height:d}=r,{topLeft:f,topRight:g,bottomLeft:p,bottomRight:v}=Xs(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(a+f,l),s==="top"&&this.drawCaret(t,n,r,i),n.lineTo(a+c-g,l),n.quadraticCurveTo(a+c,l,a+c,l+g),s==="center"&&o==="right"&&this.drawCaret(t,n,r,i),n.lineTo(a+c,l+d-v),n.quadraticCurveTo(a+c,l+d,a+c-v,l+d),s==="bottom"&&this.drawCaret(t,n,r,i),n.lineTo(a+p,l+d),n.quadraticCurveTo(a,l+d,a,l+d-p),s==="center"&&o==="left"&&this.drawCaret(t,n,r,i),n.lineTo(a,l+f),n.quadraticCurveTo(a,l,a+f,l),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,i=r&&r.x,o=r&&r.y;if(i||o){const s=pu[t.position].call(this,this._active,this._eventPosition);if(!s)return;const a=this._size=wE(this,t),l=Object.assign({},s,this._size),c=_E(n,t,l),d=SE(t,l,c,n);(i._to!==d.x||o._to!==d.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=s.x,this.caretY=s.y,this._resolveAnimations().update(this,d))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},o={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const s=Rn(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=r,this.drawBackground(o,t,i,n),sC(t,n.textDirection),o.y+=s.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),aC(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,i=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!Ff(r,i),s=this._positionChanged(i,n);(o||s)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,o=this._active||[],s=this._getActiveElements(t,o,n,r),a=this._positionChanged(s,t),l=n||!Ff(s,o)||a;return l&&(this._active=s,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,i){const o=this.options;if(t.type==="mouseout")return[];if(!i)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const s=this.chart.getElementsAtEventForMode(t,o.mode,o,r);return o.reverse&&s.reverse(),s}_positionChanged(t,n){const{caretX:r,caretY:i,options:o}=this,s=pu[o.position].call(this,t,n);return s!==!1&&(r!==s.x||i!==s.y)}},ke(Ox,"positioners",pu),Ox);var B8={id:"tooltip",_element:PE,positioners:pu,afterInit(e,t,n){n&&(e.tooltip=new PE({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:OE},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},V8=Object.freeze({__proto__:null,Colors:e8,Decimation:i8,Filler:C8,Legend:D8,SubTitle:I8,Title:A8,Tooltip:B8});const H8=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function W8(e,t,n,r){const i=e.indexOf(t);if(i===-1)return H8(e,t,n,r);const o=e.lastIndexOf(t);return i!==o?n:i}const q8=(e,t)=>e===null?null:kn(Math.round(e),0,t);function kE(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class vb extends na{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:i,label:o}of n)r[i]===o&&r.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(gt(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:W8(r,t,tt(n,t),this._addedLabels),q8(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(i=this.getLabels().length-1)),this.min=r,this.max=i}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,i=[];let o=this.getLabels();o=t===0&&n===o.length-1?o:o.slice(t,n+1),this._valueRange=Math.max(o.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let s=t;s<=n;s++)i.push({value:s});return i}getLabelForValue(t){return kE.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}ke(vb,"id","category"),ke(vb,"defaults",{ticks:{callback:kE}});function U8(e,t){const n=[],{bounds:i,step:o,min:s,max:a,precision:l,count:c,maxTicks:d,maxDigits:f,includeBounds:g}=e,p=o||1,v=d-1,{min:y,max:x}=t,w=!gt(s),S=!gt(a),C=!gt(c),P=(x-y)/(f+1);let O=TS((x-y)/v/p)*p,k,A,L,F;if(O<1e-14&&!w&&!S)return[{value:y},{value:x}];F=Math.ceil(x/O)-Math.floor(y/O),F>v&&(O=TS(F*O/v/p)*p),gt(l)||(k=Math.pow(10,l),O=Math.ceil(O*k)/k),i==="ticks"?(A=Math.floor(y/O)*O,L=Math.ceil(x/O)*O):(A=y,L=x),w&&S&&o&&zL((a-s)/o,O/1e3)?(F=Math.round(Math.min((a-s)/O,d)),O=(a-s)/F,A=s,L=a):C?(A=w?s:A,L=S?a:L,F=c-1,O=(L-A)/F):(F=(L-A)/O,Qc(F,Math.round(F),O/1e3)?F=Math.round(F):F=Math.ceil(F));const j=Math.max(IS(O),IS(A));k=Math.pow(10,gt(l)?j:l),A=Math.round(A*k)/k,L=Math.round(L*k)/k;let B=0;for(w&&(g&&A!==s?(n.push({value:s}),A<s&&B++,Qc(Math.round((A+B*O)*k)/k,s,ME(s,P,e))&&B++):A<s&&B++);B<F;++B){const V=Math.round((A+B*O)*k)/k;if(S&&V>a)break;n.push({value:V})}return S&&g&&L!==a?n.length&&Qc(n[n.length-1].value,a,ME(a,P,e))?n[n.length-1].value=a:n.push({value:a}):(!S||L===a)&&n.push({value:L}),n}function ME(e,t,{horizontal:n,minRotation:r}){const i=mi(r),o=(n?Math.sin(i):Math.cos(i))||.001,s=.75*t*(""+e).length;return Math.min(t/o,s)}class fh extends na{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return gt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:i,max:o}=this;const s=l=>i=n?i:l,a=l=>o=r?o:l;if(t){const l=Ii(i),c=Ii(o);l<0&&c<0?a(0):l>0&&c>0&&s(0)}if(i===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||s(i-l)}this.min=i,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},o=this._range||this,s=U8(i,o);return t.bounds==="ticks"&&AS(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const i=(r-n)/Math.max(t.length-1,1)/2;n-=i,r+=i}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return eu(t,this.chart.options.locale,this.options.ticks.format)}}class bb extends fh{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=ln(t)?t:0,this.max=ln(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=mi(this.options.ticks.minRotation),i=(t?Math.sin(r):Math.cos(r))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}ke(bb,"id","linear"),ke(bb,"defaults",{ticks:{callback:Vf.formatters.numeric}});const gu=e=>Math.floor(qo(e)),ra=(e,t)=>Math.pow(10,gu(e)+t);function DE(e){return e/Math.pow(10,gu(e))===1}function TE(e,t,n){const r=Math.pow(10,n),i=Math.floor(e/r);return Math.ceil(t/r)-i}function G8(e,t){const n=t-e;let r=gu(n);for(;TE(e,t,r)>10;)r++;for(;TE(e,t,r)<10;)r--;return Math.min(r,gu(e))}function Y8(e,{min:t,max:n}){t=Or(e.min,t);const r=[],i=gu(t);let o=G8(t,n),s=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=i>o?Math.pow(10,i):0,c=Math.round((t-l)*s)/s,d=Math.floor((t-l)/a/10)*a*10;let f=Math.floor((c-d)/Math.pow(10,o)),g=Or(e.min,Math.round((l+d+f*Math.pow(10,o))*s)/s);for(;g<n;)r.push({value:g,major:DE(g),significand:f}),f>=10?f=f<15?15:20:f++,f>=20&&(o++,f=2,s=o>=0?1:s),g=Math.round((l+d+f*Math.pow(10,o))*s)/s;const p=Or(e.max,g);return r.push({value:p,major:DE(p),significand:f}),r}class yb extends na{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=fh.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return ln(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=ln(t)?Math.max(0,t):null,this.max=ln(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!ln(this._userMin)&&(this.min=t===ra(this.min,0)?ra(this.min,-1):ra(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let r=this.min,i=this.max;const o=a=>r=t?r:a,s=a=>i=n?i:a;r===i&&(r<=0?(o(1),s(10)):(o(ra(r,-1)),s(ra(i,1)))),r<=0&&o(ra(i,-1)),i<=0&&s(ra(r,1)),this.min=r,this.max=i}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=Y8(n,this);return t.bounds==="ticks"&&AS(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(t){return t===void 0?"0":eu(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=qo(t),this._valueRange=qo(this.max)-qo(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(qo(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}ke(yb,"id","logarithmic"),ke(yb,"defaults",{ticks:{callback:Vf.formatters.logarithmic,major:{enabled:!0}}});function xb(e){const t=e.ticks;if(t.display&&e.display){const n=Rn(t.backdropPadding);return tt(t.font&&t.font.size,on.font.size)+n.height}return 0}function K8(e,t,n){return n=Yt(n)?n:[n],{w:r9(e,t.string,n),h:n.length*t.lineHeight}}function AE(e,t,n,r,i){return e===r||e===i?{start:t-n/2,end:t+n/2}:e<r||e>i?{start:t-n,end:t}:{start:t,end:t+n}}function X8(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],i=[],o=e._pointLabels.length,s=e.options.pointLabels,a=s.centerPointLabels?Kt/o:0;for(let l=0;l<o;l++){const c=s.setContext(e.getPointLabelContext(l));i[l]=c.padding;const d=e.getPointPosition(l,e.drawingArea+i[l],a),f=bn(c.font),g=K8(e.ctx,f,e._pointLabels[l]);r[l]=g;const p=Pr(e.getIndexAngle(l)+a),v=Math.round(Fv(p)),y=AE(v,d.x,g.w,0,180),x=AE(v,d.y,g.h,90,270);Q8(n,t,p,y,x)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=ej(e,r,i)}function Q8(e,t,n,r,i){const o=Math.abs(Math.sin(n)),s=Math.abs(Math.cos(n));let a=0,l=0;r.start<t.l?(a=(t.l-r.start)/o,e.l=Math.min(e.l,t.l-a)):r.end>t.r&&(a=(r.end-t.r)/o,e.r=Math.max(e.r,t.r+a)),i.start<t.t?(l=(t.t-i.start)/s,e.t=Math.min(e.t,t.t-l)):i.end>t.b&&(l=(i.end-t.b)/s,e.b=Math.max(e.b,t.b+l))}function J8(e,t,n){const r=e.drawingArea,{extra:i,additionalAngle:o,padding:s,size:a}=n,l=e.getPointPosition(t,r+i+s,o),c=Math.round(Fv(Pr(l.angle+dn))),d=rj(l.y,a.h,c),f=tj(c),g=nj(l.x,a.w,f);return{visible:!0,x:l.x,y:d,textAlign:f,left:g,top:d,right:g+a.w,bottom:d+a.h}}function Z8(e,t){if(!t)return!0;const{left:n,top:r,right:i,bottom:o}=e;return!(lo({x:n,y:r},t)||lo({x:n,y:o},t)||lo({x:i,y:r},t)||lo({x:i,y:o},t))}function ej(e,t,n){const r=[],i=e._pointLabels.length,o=e.options,{centerPointLabels:s,display:a}=o.pointLabels,l={extra:xb(o)/2,additionalAngle:s?Kt/i:0};let c;for(let d=0;d<i;d++){l.padding=n[d],l.size=t[d];const f=J8(e,d,l);r.push(f),a==="auto"&&(f.visible=Z8(f,c),f.visible&&(c=f))}return r}function tj(e){return e===0||e===180?"center":e<180?"left":"right"}function nj(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function rj(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function ij(e,t,n){const{left:r,top:i,right:o,bottom:s}=n,{backdropColor:a}=t;if(!gt(a)){const l=Xs(t.borderRadius),c=Rn(t.backdropPadding);e.fillStyle=a;const d=r-c.left,f=i-c.top,g=o-r+c.width,p=s-i+c.height;Object.values(l).some(v=>v!==0)?(e.beginPath(),nu(e,{x:d,y:f,w:g,h:p,radius:l}),e.fill()):e.fillRect(d,f,g,p)}}function oj(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){const o=e._pointLabelItems[i];if(!o.visible)continue;const s=r.setContext(e.getPointLabelContext(i));ij(n,s,o);const a=bn(s.font),{x:l,y:c,textAlign:d}=o;Ks(n,e._pointLabels[i],l,c+a.lineHeight/2,a,{color:s.color,textAlign:d,textBaseline:"middle"})}}function IE(e,t,n,r){const{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,Xt);else{let o=e.getPointPosition(0,t);i.moveTo(o.x,o.y);for(let s=1;s<r;s++)o=e.getPointPosition(s,t),i.lineTo(o.x,o.y)}}function sj(e,t,n,r,i){const o=e.ctx,s=t.circular,{color:a,lineWidth:l}=t;!s&&!r||!a||!l||n<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(i.dash),o.lineDashOffset=i.dashOffset,o.beginPath(),IE(e,n,s,r),o.closePath(),o.stroke(),o.restore())}function aj(e,t,n){return Uo(e,{label:n,index:t,type:"pointLabel"})}class mu extends fh{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=Rn(xb(this.options)/2),n=this.width=this.maxWidth-t.width,r=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+r/2+t.top),this.drawingArea=Math.floor(Math.min(n,r)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=ln(t)&&!isNaN(t)?t:0,this.max=ln(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/xb(this.options))}generateTickLabels(t){fh.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const i=Ft(this.options.pointLabels.callback,[n,r],this);return i||i===0?i:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?X8(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,i){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,i))}getIndexAngle(t){const n=Xt/(this._pointLabels.length||1),r=this.options.startAngle||0;return Pr(t*n+mi(r))}getDistanceFromCenterForValue(t){if(gt(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(gt(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const r=n[t];return aj(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const i=this.getIndexAngle(t)-dn+r;return{x:Math.cos(i)*n+this.xCenter,y:Math.sin(i)*n+this.yCenter,angle:i}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:r,right:i,bottom:o}=this._pointLabelItems[t];return{left:n,top:r,right:i,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),IE(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),r.closePath(),r.fillStyle=t,r.fill(),r.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:r,grid:i,border:o}=n,s=this._pointLabels.length;let a,l,c;if(n.pointLabels.display&&oj(this,s),i.display&&this.ticks.forEach((d,f)=>{if(f!==0){l=this.getDistanceFromCenterForValue(d.value);const g=this.getContext(f),p=i.setContext(g),v=o.setContext(g);sj(this,p,l,s,v)}}),r.display){for(t.save(),a=s-1;a>=0;a--){const d=r.setContext(this.getPointLabelContext(a)),{color:f,lineWidth:g}=d;!g||!f||(t.lineWidth=g,t.strokeStyle=f,t.setLineDash(d.borderDash),t.lineDashOffset=d.borderDashOffset,l=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const i=this.getIndexAngle(0);let o,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&!n.reverse)return;const c=r.setContext(this.getContext(l)),d=bn(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=d.string,s=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const f=Rn(c.backdropPadding);t.fillRect(-s/2-f.left,-o-d.size/2-f.top,s+f.width,d.size+f.height)}Ks(t,a.label,0,-o,d,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}ke(mu,"id","radialLinear"),ke(mu,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Vf.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),ke(mu,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),ke(mu,"descriptors",{angleLines:{_fallback:"grid"}});const hh={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},cr=Object.keys(hh);function NE(e,t){return e-t}function RE(e,t){if(gt(t))return null;const n=e._adapter,{parser:r,round:i,isoWeekday:o}=e._parseOpts;let s=t;return typeof r=="function"&&(s=r(s)),ln(s)||(s=typeof r=="string"?n.parse(s,r):n.parse(s)),s===null?null:(i&&(s=i==="week"&&(hl(o)||o===!0)?n.startOf(s,"isoWeek",o):n.startOf(s,i)),+s)}function LE(e,t,n,r){const i=cr.length;for(let o=cr.indexOf(e);o<i-1;++o){const s=hh[cr[o]],a=s.steps?s.steps:Number.MAX_SAFE_INTEGER;if(s.common&&Math.ceil((n-t)/(a*s.size))<=r)return cr[o]}return cr[i-1]}function lj(e,t,n,r,i){for(let o=cr.length-1;o>=cr.indexOf(n);o--){const s=cr[o];if(hh[s].common&&e._adapter.diff(i,r,s)>=t-1)return s}return cr[n?cr.indexOf(n):0]}function cj(e){for(let t=cr.indexOf(e)+1,n=cr.length;t<n;++t)if(hh[cr[t]].common)return cr[t]}function $E(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=zv(n,t),o=n[r]>=t?n[r]:n[i];e[o]=!0}}function uj(e,t,n,r){const i=e._adapter,o=+i.startOf(t[0].value,r),s=t[t.length-1].value;let a,l;for(a=o;a<=s;a=+i.add(a,1,r))l=n[a],l>=0&&(t[l].major=!0);return t}function FE(e,t,n){const r=[],i={},o=t.length;let s,a;for(s=0;s<o;++s)a=t[s],i[a]=s,r.push({value:a,major:!1});return o===0||!n?r:uj(e,r,i,n)}class vu extends na{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const r=t.time||(t.time={}),i=this._adapter=new y$._date(t.adapters.date);i.init(n),Kc(r.displayFormats,i.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:RE(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:i,max:o,minDefined:s,maxDefined:a}=this.getUserBounds();function l(c){!s&&!isNaN(c.min)&&(i=Math.min(i,c.min)),!a&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!s||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),i=ln(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),o=ln(o)&&!isNaN(o)?o:+n.endOf(Date.now(),r)+1,this.min=Math.min(i,o-1),this.max=Math.max(i+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,i=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const o=this.min,s=this.max,a=WL(i,o,s);return this._unit=n.unit||(r.autoSkip?LE(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):lj(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:cj(this._unit),this.initOffsets(i),t.reverse&&a.reverse(),FE(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,i,o;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?n=1-i:n=(this.getDecimalForValue(t[1])-i)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?r=o:r=(o-this.getDecimalForValue(t[t.length-2]))/2);const s=t.length<3?.5:.25;n=kn(n,0,s),r=kn(r,0,s),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,i=this.options,o=i.time,s=o.unit||LE(o.minUnit,n,r,this._getLabelCapacity(n)),a=tt(i.ticks.stepSize,1),l=s==="week"?o.isoWeekday:!1,c=hl(l)||l===!0,d={};let f=n,g,p;if(c&&(f=+t.startOf(f,"isoWeek",l)),f=+t.startOf(f,c?"day":s),t.diff(r,n,s)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+s);const v=i.ticks.source==="data"&&this.getDataTimestamps();for(g=f,p=0;g<r;g=+t.add(g,a,s),p++)$E(d,g,v);return(g===r||i.bounds==="ticks"||p===1)&&$E(d,g,v),Object.keys(d).sort(NE).map(y=>+y)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const i=this.options.time.displayFormats,o=this._unit,s=n||i[o];return this._adapter.format(t,s)}_tickFormatFunction(t,n,r,i){const o=this.options,s=o.ticks.callback;if(s)return Ft(s,[t,n,r],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,d=l&&a[l],f=c&&a[c],g=r[n],p=c&&f&&g&&g.major;return this._adapter.format(t,i||(p?f:d))}generateTickLabels(t){let n,r,i;for(n=0,r=t.length;n<r;++n)i=t[n],i.label=this._tickFormatFunction(i.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,i=mi(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(i),s=Math.sin(i),a=this._resolveTickFontOptions(0).size;return{w:r*o+a*s,h:r*s+a*o}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,i=r[n.unit]||r.millisecond,o=this._tickFormatFunction(t,0,FE(this,[t],this._majorUnit),i),s=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/s.w:this.height/s.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,r=i.length;n<r;++n)t=t.concat(i[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const i=this.getLabels();for(n=0,r=i.length;n<r;++n)t.push(RE(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return $S(t.sort(NE))}}ke(vu,"id","time"),ke(vu,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function ph(e,t,n){let r=0,i=e.length-1,o,s,a,l;n?(t>=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=ao(e,"pos",t)),{pos:o,time:a}=e[r],{pos:s,time:l}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=ao(e,"time",t)),{time:o,pos:a}=e[r],{time:s,pos:l}=e[i]);const c=s-o;return c?a+(l-a)*(t-o)/c:a}class wb extends vu{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=ph(n,this.min),this._tableRange=ph(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,i=[],o=[];let s,a,l,c,d;for(s=0,a=t.length;s<a;++s)c=t[s],c>=n&&c<=r&&i.push(c);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(s=0,a=i.length;s<a;++s)d=i[s+1],l=i[s-1],c=i[s],Math.round((d+l)/2)!==c&&o.push({time:c,pos:s/(a-1)});return o}_generate(){const t=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((i,o)=>i-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(ph(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return ph(this._table,r*this._tableRange+this._minPos,!0)}}ke(wb,"id","timeseries"),ke(wb,"defaults",vu.defaults);var dj=Object.freeze({__proto__:null,CategoryScale:vb,LinearScale:bb,LogarithmicScale:yb,RadialLinearScale:mu,TimeScale:vu,TimeSeriesScale:wb});const fj=[b$,YF,V8,dj];/*!
|
|
124
124
|
* chartjs-plugin-datalabels v2.2.0
|
|
125
125
|
* https://chartjs-plugin-datalabels.netlify.app
|
|
126
126
|
* (c) 2017-2022 chartjs-plugin-datalabels contributors
|
|
@@ -206,12 +206,12 @@ Valid keys: `+JSON.stringify(Object.keys(M),null," "));var oe=ye(de,W,X,me,he+"
|
|
|
206
206
|
*
|
|
207
207
|
* This source code is licensed under the ISC license.
|
|
208
208
|
* See the LICENSE file in the root directory of this source tree.
|
|
209
|
-
*/const GB=jt("
|
|
209
|
+
*/const GB=jt("Glasses",[["circle",{cx:"6",cy:"15",r:"4",key:"vux9w4"}],["circle",{cx:"18",cy:"15",r:"4",key:"18o8ve"}],["path",{d:"M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2",key:"1ag4bs"}],["path",{d:"M2.5 13 5 7c.7-1.3 1.4-2 3-2",key:"1hm1gs"}],["path",{d:"M21.5 13 19 7c-.7-1.3-1.5-2-3-2",key:"1r31ai"}]]);/**
|
|
210
210
|
* @license lucide-react v0.298.0 - ISC
|
|
211
211
|
*
|
|
212
212
|
* This source code is licensed under the ISC license.
|
|
213
213
|
* See the LICENSE file in the root directory of this source tree.
|
|
214
|
-
*/const YB=jt("
|
|
214
|
+
*/const YB=jt("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
|
|
215
215
|
* @license lucide-react v0.298.0 - ISC
|
|
216
216
|
*
|
|
217
217
|
* This source code is licensed under the ISC license.
|
|
@@ -348,7 +348,7 @@ Valid keys: `+JSON.stringify(Object.keys(M),null," "));var oe=ye(de,W,X,me,he+"
|
|
|
348
348
|
*/var gH=typeof document<"u"?ue.useLayoutEffect:ue.useEffect;function mH(e){var t=ue.useReducer(function(){return{}},{})[1],n=Wh({},e,{onChange:function(s,a){a?kt.flushSync(t):t(),e.onChange==null||e.onChange(s,a)}}),r=ue.useState(function(){return new hH(n)}),i=r[0];return i.setOptions(n),ue.useEffect(function(){return i._didMount()},[]),gH(function(){return i._willUpdate()}),i}function vH(e){return mH(Wh({observeElementRect:cH,observeElementOffset:uH,scrollToFn:fH},e))}var bH=Object.defineProperty,yH=(e,t,n)=>t in e?bH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,u0=(e,t,n)=>(yH(e,typeof t!="symbol"?t+"":t,n),n);let xH=class{constructor(){u0(this,"current",this.detect()),u0(this,"handoffState","pending"),u0(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},ca=new xH,wn=(e,t)=>{ca.isServer?m.useEffect(e,t):m.useLayoutEffect(e,t)};function ji(e){let t=m.useRef(e);return wn(()=>{t.current=e},[e]),t}function d0(e,t){let[n,r]=m.useState(e),i=ji(e);return wn(()=>r(i.current),[i,r,...t]),n}let mt=function(e){let t=ji(e);return m.useCallback((...n)=>t.current(...n),[t])};function wH(e,t,n){let[r,i]=m.useState(n),o=e!==void 0,s=m.useRef(o),a=m.useRef(!1),l=m.useRef(!1);return o&&!s.current&&!a.current?(a.current=!0,s.current=o,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!o&&s.current&&!l.current&&(l.current=!0,s.current=o,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[o?e:r,mt(c=>(o||i(c),t==null?void 0:t(c)))]}function _H(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function ua(){let e=[],t={addEventListener(n,r,i,o){return n.addEventListener(r,i,o),t.add(()=>n.removeEventListener(r,i,o))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return _H(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,i){let o=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:i}),this.add(()=>{Object.assign(n.style,{[r]:o})})},group(n){let r=ua();return n(r),this.add(()=>r.dispose())},add(n){return e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let i of e.splice(r,1))i()}},dispose(){for(let n of e.splice(0))n()}};return t}function Tu(){let[e]=m.useState(ua);return m.useEffect(()=>()=>e.dispose(),[e]),e}function SH(){let e=typeof document>"u";return"useSyncExternalStore"in ue?(t=>t.useSyncExternalStore)(ue)(()=>()=>{},()=>!1,()=>!e):!1}function f0(){let e=SH(),[t,n]=ue.useState(ca.isHandoffComplete);return t&&ca.isHandoffComplete===!1&&n(!1),ue.useEffect(()=>{t!==!0&&n(!0)},[t]),ue.useEffect(()=>ca.handoff(),[]),e?!1:t}var _O;let Au=(_O=m.useId)!=null?_O:function(){let e=f0(),[t,n]=m.useState(e?()=>ca.nextId():null);return wn(()=>{t===null&&n(ca.nextId())},[t]),t!=null?""+t:void 0};function $n(e,t,...n){if(e in t){let i=t[e];return typeof i=="function"?i(...n):i}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(i=>`"${i}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,$n),r}function h0(e){return ca.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let SO=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var CH=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(CH||{}),EH=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(EH||{}),OH=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(OH||{}),CO=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(CO||{});function PH(e,t=0){var n;return e===((n=h0(e))==null?void 0:n.body)?!1:$n(t,{0(){return e.matches(SO)},1(){let r=e;for(;r!==null;){if(r.matches(SO))return!0;r=r.parentElement}return!1}})}var kH=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(kH||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function MH(e,t=n=>n){return e.slice().sort((n,r)=>{let i=t(n),o=t(r);if(i===null||o===null)return 0;let s=i.compareDocumentPosition(o);return s&Node.DOCUMENT_POSITION_FOLLOWING?-1:s&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function DH(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function TH(){return/Android/gi.test(window.navigator.userAgent)}function EO(){return DH()||TH()}function Uh(e,t,n){let r=ji(t);m.useEffect(()=>{function i(o){r.current(o)}return document.addEventListener(e,i,n),()=>document.removeEventListener(e,i,n)},[e,n])}function AH(e,t,n){let r=ji(t);m.useEffect(()=>{function i(o){r.current(o)}return window.addEventListener(e,i,n),()=>window.removeEventListener(e,i,n)},[e,n])}function IH(e,t,n=!0){let r=m.useRef(!1);m.useEffect(()=>{requestAnimationFrame(()=>{r.current=n})},[n]);function i(s,a){if(!r.current||s.defaultPrevented)return;let l=a(s);if(l===null||!l.getRootNode().contains(l)||!l.isConnected)return;let c=function d(f){return typeof f=="function"?d(f()):Array.isArray(f)||f instanceof Set?f:[f]}(e);for(let d of c){if(d===null)continue;let f=d instanceof HTMLElement?d:d.current;if(f!=null&&f.contains(l)||s.composed&&s.composedPath().includes(f))return}return!PH(l,CO.Loose)&&l.tabIndex!==-1&&s.preventDefault(),t(s,l)}let o=m.useRef(null);Uh("pointerdown",s=>{var a,l;r.current&&(o.current=((l=(a=s.composedPath)==null?void 0:a.call(s))==null?void 0:l[0])||s.target)},!0),Uh("mousedown",s=>{var a,l;r.current&&(o.current=((l=(a=s.composedPath)==null?void 0:a.call(s))==null?void 0:l[0])||s.target)},!0),Uh("click",s=>{EO()||o.current&&(i(s,()=>o.current),o.current=null)},!0),Uh("touchend",s=>i(s,()=>s.target instanceof HTMLElement?s.target:null),!0),AH("blur",s=>i(s,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function NH(...e){return m.useMemo(()=>h0(...e),[...e])}function OO(e){var t;if(e.type)return e.type;let n=(t=e.as)!=null?t:"button";if(typeof n=="string"&&n.toLowerCase()==="button")return"button"}function RH(e,t){let[n,r]=m.useState(()=>OO(e));return wn(()=>{r(OO(e))},[e.type,e.as]),wn(()=>{n||t.current&&t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&r("button")},[n,t]),n}let LH=Symbol();function da(...e){let t=m.useRef(e);m.useEffect(()=>{t.current=e},[e]);let n=mt(r=>{for(let i of t.current)i!=null&&(typeof i=="function"?i(r):i.current=r)});return e.every(r=>r==null||(r==null?void 0:r[LH]))?void 0:n}function PO(e){return[e.screenX,e.screenY]}function $H(){let e=m.useRef([-1,-1]);return{wasMoved(t){let n=PO(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=PO(t)}}}function FH({container:e,accept:t,walk:n,enabled:r=!0}){let i=m.useRef(t),o=m.useRef(n);m.useEffect(()=>{i.current=t,o.current=n},[t,n]),wn(()=>{if(!e||!r)return;let s=h0(e);if(!s)return;let a=i.current,l=o.current,c=Object.assign(f=>a(f),{acceptNode:a}),d=s.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,c,!1);for(;d.nextNode();)l(d.currentNode)},[e,r,i,o])}function kO(e,t){let n=m.useRef([]),r=mt(e);m.useEffect(()=>{let i=[...n.current];for(let[o,s]of t.entries())if(n.current[o]!==s){let a=r(t,i);return n.current=t,a}},[r,...t])}function Gh(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}var Yh=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Yh||{}),es=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(es||{});function xo({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:i,visible:o=!0,name:s,mergeRefs:a}){a=a??jH;let l=MO(t,e);if(o)return Kh(l,n,r,s,a);let c=i??0;if(c&2){let{static:d=!1,...f}=l;if(d)return Kh(f,n,r,s,a)}if(c&1){let{unmount:d=!0,...f}=l;return $n(d?0:1,{0(){return null},1(){return Kh({...f,hidden:!0,style:{display:"none"}},n,r,s,a)}})}return Kh(l,n,r,s,a)}function Kh(e,t={},n,r,i){let{as:o=n,children:s,refName:a="ref",...l}=g0(e,["unmount","static"]),c=e.ref!==void 0?{[a]:e.ref}:{},d=typeof s=="function"?s(t):s;"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(t));let f={};if(t){let g=!1,p=[];for(let[v,y]of Object.entries(t))typeof y=="boolean"&&(g=!0),y===!0&&p.push(v);g&&(f["data-headlessui-state"]=p.join(" "))}if(o===m.Fragment&&Object.keys(p0(l)).length>0){if(!m.isValidElement(d)||Array.isArray(d)&&d.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(l).map(y=>` - ${y}`).join(`
|
|
349
349
|
`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(y=>` - ${y}`).join(`
|
|
350
350
|
`)].join(`
|
|
351
|
-
`));let g=d.props,p=typeof(g==null?void 0:g.className)=="function"?(...y)=>Gh(g==null?void 0:g.className(...y),l.className):Gh(g==null?void 0:g.className,l.className),v=p?{className:p}:{};return m.cloneElement(d,Object.assign({},MO(d.props,p0(g0(l,["ref"]))),f,c,{ref:i(d.ref,c.ref)},v))}return m.createElement(o,Object.assign({},g0(l,["ref"]),o!==m.Fragment&&c,o!==m.Fragment&&f),d)}function jH(...e){return e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function MO(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let i in r)i.startsWith("on")&&typeof r[i]=="function"?(n[i]!=null||(n[i]=[]),n[i].push(r[i])):t[i]=r[i];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map(r=>[r,void 0])));for(let r in n)Object.assign(t,{[r](i,...o){let s=n[r];for(let a of s){if((i instanceof Event||(i==null?void 0:i.nativeEvent)instanceof Event)&&i.defaultPrevented)return;a(i,...o)}}});return t}function zi(e){var t;return Object.assign(m.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function p0(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function g0(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}let zH="div";var DO=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(DO||{});function BH(e,t){var n;let{features:r=1,...i}=e,o={ref:t,"aria-hidden":(r&2)===2?!0:(n=i["aria-hidden"])!=null?n:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return xo({ourProps:o,theirProps:i,slot:{},defaultTag:zH,name:"Hidden"})}let VH=zi(BH),m0=m.createContext(null);m0.displayName="OpenClosedContext";var Tr=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(Tr||{});function v0(){return m.useContext(m0)}function TO({value:e,children:t}){return m.createElement(m0.Provider,{value:e},t)}function HH(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let fa=[];HH(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&fa[0]!==t.target&&(fa.unshift(t.target),fa=fa.filter(n=>n!=null&&n.isConnected),fa.splice(10))}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function WH(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&qH(n)?!1:r}function qH(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}function UH(e){throw new Error("Unexpected object: "+e)}var _n=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(_n||{});function AO(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),i=r??-1;switch(e.focus){case 0:{for(let o=0;o<n.length;++o)if(!t.resolveDisabled(n[o],o,n))return o;return r}case 1:{for(let o=i-1;o>=0;--o)if(!t.resolveDisabled(n[o],o,n))return o;return r}case 2:{for(let o=i+1;o<n.length;++o)if(!t.resolveDisabled(n[o],o,n))return o;return r}case 3:{for(let o=n.length-1;o>=0;--o)if(!t.resolveDisabled(n[o],o,n))return o;return r}case 4:{for(let o=0;o<n.length;++o)if(t.resolveId(n[o],o,n)===e.id)return o;return r}case 5:return null;default:UH(e)}}function IO(e={},t=null,n=[]){for(let[r,i]of Object.entries(e))RO(n,NO(t,r),i);return n}function NO(e,t){return e?e+"["+t+"]":t}function RO(e,t,n){if(Array.isArray(n))for(let[r,i]of n.entries())RO(e,NO(t,r.toString()),i);else n instanceof Date?e.push([t,n.toISOString()]):typeof n=="boolean"?e.push([t,n?"1":"0"]):typeof n=="string"?e.push([t,n]):typeof n=="number"?e.push([t,`${n}`]):n==null?e.push([t,""]):IO(n,t,e)}var Ar=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(Ar||{}),GH=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(GH||{}),YH=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(YH||{}),KH=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(KH||{}),XH=(e=>(e[e.OpenCombobox=0]="OpenCombobox",e[e.CloseCombobox=1]="CloseCombobox",e[e.GoToOption=2]="GoToOption",e[e.RegisterOption=3]="RegisterOption",e[e.UnregisterOption=4]="UnregisterOption",e[e.RegisterLabel=5]="RegisterLabel",e[e.SetActivationTrigger=6]="SetActivationTrigger",e[e.UpdateVirtualOptions=7]="UpdateVirtualOptions",e))(XH||{});function b0(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=t(e.options.slice()),i=r.length>0&&r[0].dataRef.current.order!==null?r.sort((s,a)=>s.dataRef.current.order-a.dataRef.current.order):MH(r,s=>s.dataRef.current.domRef.current),o=n?i.indexOf(n):null;return o===-1&&(o=null),{options:i,activeOptionIndex:o}}let QH={1(e){var t;return(t=e.dataRef.current)!=null&&t.disabled||e.comboboxState===1?e:{...e,activeOptionIndex:null,comboboxState:1}},0(e){var t,n;if((t=e.dataRef.current)!=null&&t.disabled||e.comboboxState===0)return e;if((n=e.dataRef.current)!=null&&n.value){let r=e.dataRef.current.calculateIndex(e.dataRef.current.value);if(r!==-1)return{...e,activeOptionIndex:r,comboboxState:0}}return{...e,comboboxState:0}},2(e,t){var n,r,i,o,s;if((n=e.dataRef.current)!=null&&n.disabled||(r=e.dataRef.current)!=null&&r.optionsRef.current&&!((i=e.dataRef.current)!=null&&i.optionsPropsRef.current.static)&&e.comboboxState===1)return e;if(e.virtual){let d=t.focus===_n.Specific?t.idx:AO(t,{resolveItems:()=>e.virtual.options,resolveActiveIndex:()=>{var g,p;return(p=(g=e.activeOptionIndex)!=null?g:e.virtual.options.findIndex(v=>!e.virtual.disabled(v)))!=null?p:null},resolveDisabled:e.virtual.disabled,resolveId(){throw new Error("Function not implemented.")}}),f=(o=t.trigger)!=null?o:2;return e.activeOptionIndex===d&&e.activationTrigger===f?e:{...e,activeOptionIndex:d,activationTrigger:f}}let a=b0(e);if(a.activeOptionIndex===null){let d=a.options.findIndex(f=>!f.dataRef.current.disabled);d!==-1&&(a.activeOptionIndex=d)}let l=t.focus===_n.Specific?t.idx:AO(t,{resolveItems:()=>a.options,resolveActiveIndex:()=>a.activeOptionIndex,resolveId:d=>d.id,resolveDisabled:d=>d.dataRef.current.disabled}),c=(s=t.trigger)!=null?s:2;return e.activeOptionIndex===l&&e.activationTrigger===c?e:{...e,...a,activeOptionIndex:l,activationTrigger:c}},3:(e,t)=>{var n,r,i;if((n=e.dataRef.current)!=null&&n.virtual)return{...e,options:[...e.options,t.payload]};let o=t.payload,s=b0(e,l=>(l.push(o),l));e.activeOptionIndex===null&&(r=e.dataRef.current)!=null&&r.isSelected(t.payload.dataRef.current.value)&&(s.activeOptionIndex=s.options.indexOf(o));let a={...e,...s,activationTrigger:2};return(i=e.dataRef.current)!=null&&i.__demoMode&&e.dataRef.current.value===void 0&&(a.activeOptionIndex=0),a},4:(e,t)=>{var n;if((n=e.dataRef.current)!=null&&n.virtual)return{...e,options:e.options.filter(i=>i.id!==t.id)};let r=b0(e,i=>{let o=i.findIndex(s=>s.id===t.id);return o!==-1&&i.splice(o,1),i});return{...e,...r,activationTrigger:2}},5:(e,t)=>e.labelId===t.id?e:{...e,labelId:t.id},6:(e,t)=>e.activationTrigger===t.trigger?e:{...e,activationTrigger:t.trigger},7:(e,t)=>{var n;if(((n=e.virtual)==null?void 0:n.options)===t.options)return e;let r=e.activeOptionIndex;if(e.activeOptionIndex!==null){let i=t.options.indexOf(e.virtual.options[e.activeOptionIndex]);i!==-1?r=i:r=null}return{...e,activeOptionIndex:r,virtual:Object.assign({},e.virtual,{options:t.options})}}},y0=m.createContext(null);y0.displayName="ComboboxActionsContext";function Iu(e){let t=m.useContext(y0);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Iu),n}return t}let LO=m.createContext(null);function JH(e){var t;let n=ha("VirtualProvider"),[r,i]=m.useMemo(()=>{let l=n.optionsRef.current;if(!l)return[0,0];let c=window.getComputedStyle(l);return[parseFloat(c.paddingBlockStart||c.paddingTop),parseFloat(c.paddingBlockEnd||c.paddingBottom)]},[n.optionsRef.current]),o=vH({scrollPaddingStart:r,scrollPaddingEnd:i,count:n.virtual.options.length,estimateSize(){return 40},getScrollElement(){var l;return(l=n.optionsRef.current)!=null?l:null},overscan:12}),[s,a]=m.useState(0);return wn(()=>{a(l=>l+1)},[(t=n.virtual)==null?void 0:t.options]),m.createElement(LO.Provider,{value:o},m.createElement("div",{style:{position:"relative",width:"100%",height:`${o.getTotalSize()}px`},ref:l=>{if(l){if(typeof process<"u"&&process.env.JEST_WORKER_ID!==void 0||n.activationTrigger===0)return;n.activeOptionIndex!==null&&n.virtual.options.length>n.activeOptionIndex&&o.scrollToIndex(n.activeOptionIndex)}}},o.getVirtualItems().map(l=>{var c;return m.createElement(m.Fragment,{key:l.key},m.cloneElement((c=e.children)==null?void 0:c.call(e,{option:n.virtual.options[l.index],open:n.comboboxState===0}),{key:`${s}-${l.key}`,"data-index":l.index,"aria-setsize":n.virtual.options.length,"aria-posinset":l.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${l.start}px)`,overflowAnchor:"none"}}))})))}let x0=m.createContext(null);x0.displayName="ComboboxDataContext";function ha(e){let t=m.useContext(x0);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,ha),n}return t}function ZH(e,t){return $n(t.type,QH,e,t)}let eW=m.Fragment;function tW(e,t){let{value:n,defaultValue:r,onChange:i,form:o,name:s,by:a=null,disabled:l=!1,__demoMode:c=!1,nullable:d=!1,multiple:f=!1,immediate:g=!1,virtual:p=null,...v}=e,y=!1,x=null,[w=f?[]:void 0,S]=wH(n,i,r),[C,P]=m.useReducer(ZH,{dataRef:m.createRef(),comboboxState:c?0:1,options:[],virtual:null,activeOptionIndex:null,activationTrigger:2,labelId:null}),O=m.useRef(!1),k=m.useRef({static:!1,hold:!1}),A=m.useRef(null),L=m.useRef(null),F=m.useRef(null),j=m.useRef(null),B=mt(typeof a=="string"?(ee,W)=>{let ye=a;return(ee==null?void 0:ee[ye])===(W==null?void 0:W[ye])}:a??((ee,W)=>ee===W)),V=mt(ee=>C.options.findIndex(W=>B(W.dataRef.current.value,ee))),K=m.useCallback(ee=>$n($.mode,{1:()=>w.some(W=>B(W,ee)),0:()=>B(w,ee)}),[w]),Y=mt(ee=>C.activeOptionIndex===V(ee)),$=m.useMemo(()=>({...C,immediate:y,optionsPropsRef:k,labelRef:A,inputRef:L,buttonRef:F,optionsRef:j,value:w,defaultValue:r,disabled:l,mode:f?1:0,virtual:C.virtual,get activeOptionIndex(){if(O.current&&C.activeOptionIndex===null&&C.options.length>0){let ee=C.options.findIndex(W=>!W.dataRef.current.disabled);if(ee!==-1)return ee}return C.activeOptionIndex},calculateIndex:V,compare:B,isSelected:K,isActive:Y,nullable:d,__demoMode:c}),[w,r,l,f,d,c,C,x]);wn(()=>{},[x,void 0]),wn(()=>{C.dataRef.current=$},[$]),IH([$.buttonRef,$.inputRef,$.optionsRef],()=>me.closeCombobox(),$.comboboxState===0);let Z=m.useMemo(()=>{var ee,W,ye;return{open:$.comboboxState===0,disabled:l,activeIndex:$.activeOptionIndex,activeOption:$.activeOptionIndex===null?null:$.virtual?$.virtual.options[(ee=$.activeOptionIndex)!=null?ee:0]:(ye=(W=$.options[$.activeOptionIndex])==null?void 0:W.dataRef.current.value)!=null?ye:null,value:w}},[$,l,w]),U=mt(()=>{if($.activeOptionIndex!==null){if($.virtual)N($.virtual.options[$.activeOptionIndex]);else{let{dataRef:ee}=$.options[$.activeOptionIndex];N(ee.current.value)}me.goToOption(_n.Specific,$.activeOptionIndex)}}),ie=mt(()=>{P({type:0}),O.current=!0}),le=mt(()=>{P({type:1}),O.current=!1}),M=mt((ee,W,ye)=>(O.current=!1,ee===_n.Specific?P({type:2,focus:_n.Specific,idx:W,trigger:ye}):P({type:2,focus:ee,trigger:ye}))),H=mt((ee,W)=>(P({type:3,payload:{id:ee,dataRef:W}}),()=>{$.isActive(W.current.value)&&(O.current=!0),P({type:4,id:ee})})),ne=mt(ee=>(P({type:5,id:ee}),()=>P({type:5,id:null}))),N=mt(ee=>$n($.mode,{0(){return S==null?void 0:S(ee)},1(){let W=$.value.slice(),ye=W.findIndex(oe=>B(oe,ee));return ye===-1?W.push(ee):W.splice(ye,1),S==null?void 0:S(W)}})),X=mt(ee=>{P({type:6,trigger:ee})}),me=m.useMemo(()=>({onChange:N,registerOption:H,registerLabel:ne,goToOption:M,closeCombobox:le,openCombobox:ie,setActivationTrigger:X,selectActiveOption:U}),[]),he=t===null?{}:{ref:t},de=m.useRef(null),re=Tu();return m.useEffect(()=>{de.current&&r!==void 0&&re.addEventListener(de.current,"reset",()=>{S==null||S(r)})},[de,S]),m.createElement(y0.Provider,{value:me},m.createElement(x0.Provider,{value:$},m.createElement(TO,{value:$n($.comboboxState,{0:Tr.Open,1:Tr.Closed})},s!=null&&w!=null&&IO({[s]:w}).map(([ee,W],ye)=>m.createElement(VH,{features:DO.Hidden,ref:ye===0?oe=>{var Te;de.current=(Te=oe==null?void 0:oe.closest("form"))!=null?Te:null}:void 0,...p0({key:ee,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:o,name:ee,value:W})})),xo({ourProps:he,theirProps:v,slot:Z,defaultTag:eW,name:"Combobox"}))))}let nW="input";function rW(e,t){var n,r,i,o,s;let a=Au(),{id:l=`headlessui-combobox-input-${a}`,onChange:c,displayValue:d,type:f="text",...g}=e,p=ha("Combobox.Input"),v=Iu("Combobox.Input"),y=da(p.inputRef,t),x=NH(p.inputRef),w=m.useRef(!1),S=Tu(),C=mt(()=>{v.onChange(null),p.optionsRef.current&&(p.optionsRef.current.scrollTop=0),v.goToOption(_n.Nothing)}),P=function(){var $;return typeof d=="function"&&p.value!==void 0?($=d(p.value))!=null?$:"":typeof p.value=="string"?p.value:""}();kO(([$,Z],[U,ie])=>{if(w.current)return;let le=p.inputRef.current;le&&((ie===0&&Z===1||$!==U)&&(le.value=$),requestAnimationFrame(()=>{if(w.current||!le||(x==null?void 0:x.activeElement)!==le)return;let{selectionStart:M,selectionEnd:H}=le;Math.abs((H??0)-(M??0))===0&&M===0&&le.setSelectionRange(le.value.length,le.value.length)}))},[P,p.comboboxState,x]),kO(([$],[Z])=>{if($===0&&Z===1){if(w.current)return;let U=p.inputRef.current;if(!U)return;let ie=U.value,{selectionStart:le,selectionEnd:M,selectionDirection:H}=U;U.value="",U.value=ie,H!==null?U.setSelectionRange(le,M,H):U.setSelectionRange(le,M)}},[p.comboboxState]);let O=m.useRef(!1),k=mt(()=>{O.current=!0}),A=mt(()=>{S.nextFrame(()=>{O.current=!1})}),L=mt($=>{switch(w.current=!0,$.key){case Ar.Enter:if(w.current=!1,p.comboboxState!==0||O.current)return;if($.preventDefault(),$.stopPropagation(),p.activeOptionIndex===null){v.closeCombobox();return}v.selectActiveOption(),p.mode===0&&v.closeCombobox();break;case Ar.ArrowDown:return w.current=!1,$.preventDefault(),$.stopPropagation(),$n(p.comboboxState,{0:()=>v.goToOption(_n.Next),1:()=>v.openCombobox()});case Ar.ArrowUp:return w.current=!1,$.preventDefault(),$.stopPropagation(),$n(p.comboboxState,{0:()=>v.goToOption(_n.Previous),1:()=>{v.openCombobox(),S.nextFrame(()=>{p.value||v.goToOption(_n.Last)})}});case Ar.Home:if($.shiftKey)break;return w.current=!1,$.preventDefault(),$.stopPropagation(),v.goToOption(_n.First);case Ar.PageUp:return w.current=!1,$.preventDefault(),$.stopPropagation(),v.goToOption(_n.First);case Ar.End:if($.shiftKey)break;return w.current=!1,$.preventDefault(),$.stopPropagation(),v.goToOption(_n.Last);case Ar.PageDown:return w.current=!1,$.preventDefault(),$.stopPropagation(),v.goToOption(_n.Last);case Ar.Escape:return w.current=!1,p.comboboxState!==0?void 0:($.preventDefault(),p.optionsRef.current&&!p.optionsPropsRef.current.static&&$.stopPropagation(),p.nullable&&p.mode===0&&p.value===null&&C(),v.closeCombobox());case Ar.Tab:if(w.current=!1,p.comboboxState!==0)return;p.mode===0&&p.activationTrigger!==1&&v.selectActiveOption(),v.closeCombobox();break}}),F=mt($=>{c==null||c($),p.nullable&&p.mode===0&&$.target.value===""&&C(),v.openCombobox()}),j=mt($=>{var Z,U,ie;let le=(Z=$.relatedTarget)!=null?Z:fa.find(M=>M!==$.currentTarget);if(w.current=!1,!((U=p.optionsRef.current)!=null&&U.contains(le))&&!((ie=p.buttonRef.current)!=null&&ie.contains(le))&&p.comboboxState===0)return $.preventDefault(),p.mode===0&&(p.nullable&&p.value===null?C():p.activationTrigger!==1&&v.selectActiveOption()),v.closeCombobox()}),B=mt($=>{var Z,U,ie;let le=(Z=$.relatedTarget)!=null?Z:fa.find(M=>M!==$.currentTarget);(U=p.buttonRef.current)!=null&&U.contains(le)||(ie=p.optionsRef.current)!=null&&ie.contains(le)||p.disabled||p.immediate&&p.comboboxState!==0&&(v.openCombobox(),S.nextFrame(()=>{v.setActivationTrigger(1)}))}),V=d0(()=>{if(p.labelId)return[p.labelId].join(" ")},[p.labelId]),K=m.useMemo(()=>({open:p.comboboxState===0,disabled:p.disabled}),[p]),Y={ref:y,id:l,role:"combobox",type:f,"aria-controls":(n=p.optionsRef.current)==null?void 0:n.id,"aria-expanded":p.comboboxState===0,"aria-activedescendant":p.activeOptionIndex===null?void 0:p.virtual?(r=p.options.find($=>{var Z;return!((Z=p.virtual)!=null&&Z.disabled($.dataRef.current.value))&&p.compare($.dataRef.current.value,p.virtual.options[p.activeOptionIndex])}))==null?void 0:r.id:(i=p.options[p.activeOptionIndex])==null?void 0:i.id,"aria-labelledby":V,"aria-autocomplete":"list",defaultValue:(s=(o=e.defaultValue)!=null?o:p.defaultValue!==void 0?d==null?void 0:d(p.defaultValue):null)!=null?s:p.defaultValue,disabled:p.disabled,onCompositionStart:k,onCompositionEnd:A,onKeyDown:L,onChange:F,onFocus:B,onBlur:j};return xo({ourProps:Y,theirProps:g,slot:K,defaultTag:nW,name:"Combobox.Input"})}let iW="button";function oW(e,t){var n;let r=ha("Combobox.Button"),i=Iu("Combobox.Button"),o=da(r.buttonRef,t),s=Au(),{id:a=`headlessui-combobox-button-${s}`,...l}=e,c=Tu(),d=mt(y=>{switch(y.key){case Ar.ArrowDown:return y.preventDefault(),y.stopPropagation(),r.comboboxState===1&&i.openCombobox(),c.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})});case Ar.ArrowUp:return y.preventDefault(),y.stopPropagation(),r.comboboxState===1&&(i.openCombobox(),c.nextFrame(()=>{r.value||i.goToOption(_n.Last)})),c.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})});case Ar.Escape:return r.comboboxState!==0?void 0:(y.preventDefault(),r.optionsRef.current&&!r.optionsPropsRef.current.static&&y.stopPropagation(),i.closeCombobox(),c.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})}));default:return}}),f=mt(y=>{if(WH(y.currentTarget))return y.preventDefault();r.comboboxState===0?i.closeCombobox():(y.preventDefault(),i.openCombobox()),c.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})})}),g=d0(()=>{if(r.labelId)return[r.labelId,a].join(" ")},[r.labelId,a]),p=m.useMemo(()=>({open:r.comboboxState===0,disabled:r.disabled,value:r.value}),[r]),v={ref:o,id:a,type:RH(e,r.buttonRef),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":(n=r.optionsRef.current)==null?void 0:n.id,"aria-expanded":r.comboboxState===0,"aria-labelledby":g,disabled:r.disabled,onClick:f,onKeyDown:d};return xo({ourProps:v,theirProps:l,slot:p,defaultTag:iW,name:"Combobox.Button"})}let sW="label";function aW(e,t){let n=Au(),{id:r=`headlessui-combobox-label-${n}`,...i}=e,o=ha("Combobox.Label"),s=Iu("Combobox.Label"),a=da(o.labelRef,t);wn(()=>s.registerLabel(r),[r]);let l=mt(()=>{var d;return(d=o.inputRef.current)==null?void 0:d.focus({preventScroll:!0})}),c=m.useMemo(()=>({open:o.comboboxState===0,disabled:o.disabled}),[o]);return xo({ourProps:{ref:a,id:r,onClick:l},theirProps:i,slot:c,defaultTag:sW,name:"Combobox.Label"})}let lW="ul",cW=Yh.RenderStrategy|Yh.Static;function uW(e,t){let n=Au(),{id:r=`headlessui-combobox-options-${n}`,hold:i=!1,...o}=e,s=ha("Combobox.Options"),a=da(s.optionsRef,t),l=v0(),c=l!==null?(l&Tr.Open)===Tr.Open:s.comboboxState===0;wn(()=>{var p;s.optionsPropsRef.current.static=(p=e.static)!=null?p:!1},[s.optionsPropsRef,e.static]),wn(()=>{s.optionsPropsRef.current.hold=i},[s.optionsPropsRef,i]),FH({container:s.optionsRef.current,enabled:s.comboboxState===0,accept(p){return p.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:p.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(p){p.setAttribute("role","none")}});let d=d0(()=>{var p,v;return(v=s.labelId)!=null?v:(p=s.buttonRef.current)==null?void 0:p.id},[s.labelId,s.buttonRef.current]),f=m.useMemo(()=>({open:s.comboboxState===0,option:void 0}),[s]),g={"aria-labelledby":d,role:"listbox","aria-multiselectable":s.mode===1?!0:void 0,id:r,ref:a};return s.virtual&&s.comboboxState===0&&Object.assign(o,{children:m.createElement(JH,null,o.children)}),xo({ourProps:g,theirProps:o,slot:f,defaultTag:lW,features:cW,visible:c,name:"Combobox.Options"})}let dW="li";function fW(e,t){var n;let r=Au(),{id:i=`headlessui-combobox-option-${r}`,disabled:o=!1,value:s,order:a=null,...l}=e,c=ha("Combobox.Option"),d=Iu("Combobox.Option"),f=c.virtual?c.activeOptionIndex===c.calculateIndex(s):c.activeOptionIndex===null?!1:((n=c.options[c.activeOptionIndex])==null?void 0:n.id)===i,g=c.isSelected(s),p=m.useRef(null),v=ji({disabled:o,value:s,domRef:p,order:a}),y=m.useContext(LO),x=da(t,p,y?y.measureElement:null),w=mt(()=>d.onChange(s));wn(()=>d.registerOption(i,v),[v,i]);let S=m.useRef(!(c.virtual||c.__demoMode));wn(()=>{if(!c.virtual||!c.__demoMode)return;let j=ua();return j.requestAnimationFrame(()=>{S.current=!0}),j.dispose},[c.virtual,c.__demoMode]),wn(()=>{if(!S.current||c.comboboxState!==0||!f||c.activationTrigger===0)return;let j=ua();return j.requestAnimationFrame(()=>{var B,V;(V=(B=p.current)==null?void 0:B.scrollIntoView)==null||V.call(B,{block:"nearest"})}),j.dispose},[p,f,c.comboboxState,c.activationTrigger,c.activeOptionIndex]);let C=mt(j=>{var B;if(o||(B=c.virtual)!=null&&B.disabled(s))return j.preventDefault();w(),EO()||requestAnimationFrame(()=>{var V;return(V=c.inputRef.current)==null?void 0:V.focus({preventScroll:!0})}),c.mode===0&&requestAnimationFrame(()=>d.closeCombobox())}),P=mt(()=>{var j;if(o||(j=c.virtual)!=null&&j.disabled(s))return d.goToOption(_n.Nothing);let B=c.calculateIndex(s);d.goToOption(_n.Specific,B)}),O=$H(),k=mt(j=>O.update(j)),A=mt(j=>{var B;if(!O.wasMoved(j)||o||(B=c.virtual)!=null&&B.disabled(s)||f)return;let V=c.calculateIndex(s);d.goToOption(_n.Specific,V,0)}),L=mt(j=>{var B;O.wasMoved(j)&&(o||(B=c.virtual)!=null&&B.disabled(s)||f&&(c.optionsPropsRef.current.hold||d.goToOption(_n.Nothing)))}),F=m.useMemo(()=>({active:f,selected:g,disabled:o}),[f,g,o]);return xo({ourProps:{id:i,ref:x,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":g,disabled:void 0,onClick:C,onFocus:P,onPointerEnter:k,onMouseEnter:k,onPointerMove:A,onMouseMove:A,onPointerLeave:L,onMouseLeave:L},theirProps:l,slot:F,defaultTag:dW,name:"Combobox.Option"})}let hW=zi(tW),pW=zi(oW),gW=zi(rW),mW=zi(aW),vW=zi(uW),bW=zi(fW),Dl=Object.assign(hW,{Input:gW,Button:pW,Label:mW,Options:vW,Option:bW});function w0(){let e=m.useRef(!1);return wn(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function yW(e=0){let[t,n]=m.useState(e),r=w0(),i=m.useCallback(l=>{r.current&&n(c=>c|l)},[t,r]),o=m.useCallback(l=>!!(t&l),[t]),s=m.useCallback(l=>{r.current&&n(c=>c&~l)},[n,r]),a=m.useCallback(l=>{r.current&&n(c=>c^l)},[n]);return{flags:t,addFlag:i,hasFlag:o,removeFlag:s,toggleFlag:a}}function xW(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function _0(e,...t){e&&t.length>0&&e.classList.add(...t)}function S0(e,...t){e&&t.length>0&&e.classList.remove(...t)}function wW(e,t){let n=ua();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:i}=getComputedStyle(e),[o,s]=[r,i].map(l=>{let[c=0]=l.split(",").filter(Boolean).map(d=>d.includes("ms")?parseFloat(d):parseFloat(d)*1e3).sort((d,f)=>f-d);return c}),a=o+s;if(a!==0){n.group(c=>{c.setTimeout(()=>{t(),c.dispose()},a),c.addEventListener(e,"transitionrun",d=>{d.target===d.currentTarget&&c.dispose()})});let l=n.addEventListener(e,"transitionend",c=>{c.target===c.currentTarget&&(t(),l())})}else t();return n.add(()=>t()),n.dispose}function _W(e,t,n,r){let i=n?"enter":"leave",o=ua(),s=r!==void 0?xW(r):()=>{};i==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let a=$n(i,{enter:()=>t.enter,leave:()=>t.leave}),l=$n(i,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),c=$n(i,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return S0(e,...t.base,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),_0(e,...t.base,...a,...c),o.nextFrame(()=>{S0(e,...t.base,...a,...c),_0(e,...t.base,...a,...l),wW(e,()=>(S0(e,...t.base,...a),_0(e,...t.base,...t.entered),s()))}),o.dispose}function SW({immediate:e,container:t,direction:n,classes:r,onStart:i,onStop:o}){let s=w0(),a=Tu(),l=ji(n);wn(()=>{e&&(l.current="enter")},[e]),wn(()=>{let c=ua();a.add(c.dispose);let d=t.current;if(d&&l.current!=="idle"&&s.current)return c.dispose(),i.current(l.current),c.add(_W(d,r.current,l.current==="enter",()=>{c.dispose(),o.current(l.current)})),c.dispose},[n])}function ts(e=""){return e.split(/\s+/).filter(t=>t.length>1)}let Xh=m.createContext(null);Xh.displayName="TransitionContext";var CW=(e=>(e.Visible="visible",e.Hidden="hidden",e))(CW||{});function EW(){let e=m.useContext(Xh);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function OW(){let e=m.useContext(Qh);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Qh=m.createContext(null);Qh.displayName="NestingContext";function Jh(e){return"children"in e?Jh(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function $O(e,t){let n=ji(e),r=m.useRef([]),i=w0(),o=Tu(),s=mt((p,v=es.Hidden)=>{let y=r.current.findIndex(({el:x})=>x===p);y!==-1&&($n(v,{[es.Unmount](){r.current.splice(y,1)},[es.Hidden](){r.current[y].state="hidden"}}),o.microTask(()=>{var x;!Jh(r)&&i.current&&((x=n.current)==null||x.call(n))}))}),a=mt(p=>{let v=r.current.find(({el:y})=>y===p);return v?v.state!=="visible"&&(v.state="visible"):r.current.push({el:p,state:"visible"}),()=>s(p,es.Unmount)}),l=m.useRef([]),c=m.useRef(Promise.resolve()),d=m.useRef({enter:[],leave:[],idle:[]}),f=mt((p,v,y)=>{l.current.splice(0),t&&(t.chains.current[v]=t.chains.current[v].filter(([x])=>x!==p)),t==null||t.chains.current[v].push([p,new Promise(x=>{l.current.push(x)})]),t==null||t.chains.current[v].push([p,new Promise(x=>{Promise.all(d.current[v].map(([w,S])=>S)).then(()=>x())})]),v==="enter"?c.current=c.current.then(()=>t==null?void 0:t.wait.current).then(()=>y(v)):y(v)}),g=mt((p,v,y)=>{Promise.all(d.current[v].splice(0).map(([x,w])=>w)).then(()=>{var x;(x=l.current.shift())==null||x()}).then(()=>y(v))});return m.useMemo(()=>({children:r,register:a,unregister:s,onStart:f,onStop:g,wait:c,chains:d}),[a,s,r,f,g,d,c])}function PW(){}let kW=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function FO(e){var t;let n={};for(let r of kW)n[r]=(t=e[r])!=null?t:PW;return n}function MW(e){let t=m.useRef(FO(e));return m.useEffect(()=>{t.current=FO(e)},[e]),t}let DW="div",jO=Yh.RenderStrategy;function TW(e,t){var n,r;let{beforeEnter:i,afterEnter:o,beforeLeave:s,afterLeave:a,enter:l,enterFrom:c,enterTo:d,entered:f,leave:g,leaveFrom:p,leaveTo:v,...y}=e,x=m.useRef(null),w=da(x,t),S=(n=y.unmount)==null||n?es.Unmount:es.Hidden,{show:C,appear:P,initial:O}=EW(),[k,A]=m.useState(C?"visible":"hidden"),L=OW(),{register:F,unregister:j}=L;m.useEffect(()=>F(x),[F,x]),m.useEffect(()=>{if(S===es.Hidden&&x.current){if(C&&k!=="visible"){A("visible");return}return $n(k,{hidden:()=>j(x),visible:()=>F(x)})}},[k,x,F,j,C,S]);let B=ji({base:ts(y.className),enter:ts(l),enterFrom:ts(c),enterTo:ts(d),entered:ts(f),leave:ts(g),leaveFrom:ts(p),leaveTo:ts(v)}),V=MW({beforeEnter:i,afterEnter:o,beforeLeave:s,afterLeave:a}),K=f0();m.useEffect(()=>{if(K&&k==="visible"&&x.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[x,k,K]);let Y=O&&!P,$=P&&C&&O,Z=!K||Y?"idle":C?"enter":"leave",U=yW(0),ie=mt(X=>$n(X,{enter:()=>{U.addFlag(Tr.Opening),V.current.beforeEnter()},leave:()=>{U.addFlag(Tr.Closing),V.current.beforeLeave()},idle:()=>{}})),le=mt(X=>$n(X,{enter:()=>{U.removeFlag(Tr.Opening),V.current.afterEnter()},leave:()=>{U.removeFlag(Tr.Closing),V.current.afterLeave()},idle:()=>{}})),M=$O(()=>{A("hidden"),j(x)},L),H=m.useRef(!1);SW({immediate:$,container:x,classes:B,direction:Z,onStart:ji(X=>{H.current=!0,M.onStart(x,X,ie)}),onStop:ji(X=>{H.current=!1,M.onStop(x,X,le),X==="leave"&&!Jh(M)&&(A("hidden"),j(x))})});let ne=y,N={ref:w};return $?ne={...ne,className:Gh(y.className,...B.current.enter,...B.current.enterFrom)}:H.current&&(ne.className=Gh(y.className,(r=x.current)==null?void 0:r.className),ne.className===""&&delete ne.className),m.createElement(Qh.Provider,{value:M},m.createElement(TO,{value:$n(k,{visible:Tr.Open,hidden:Tr.Closed})|U.flags},xo({ourProps:N,theirProps:ne,defaultTag:DW,features:jO,visible:k==="visible",name:"Transition.Child"})))}function AW(e,t){let{show:n,appear:r=!1,unmount:i=!0,...o}=e,s=m.useRef(null),a=da(s,t);f0();let l=v0();if(n===void 0&&l!==null&&(n=(l&Tr.Open)===Tr.Open),![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,d]=m.useState(n?"visible":"hidden"),f=$O(()=>{d("hidden")}),[g,p]=m.useState(!0),v=m.useRef([n]);wn(()=>{g!==!1&&v.current[v.current.length-1]!==n&&(v.current.push(n),p(!1))},[v,n]);let y=m.useMemo(()=>({show:n,appear:r,initial:g}),[n,r,g]);m.useEffect(()=>{if(n)d("visible");else if(!Jh(f))d("hidden");else{let C=s.current;if(!C)return;let P=C.getBoundingClientRect();P.x===0&&P.y===0&&P.width===0&&P.height===0&&d("hidden")}},[n,f]);let x={unmount:i},w=mt(()=>{var C;g&&p(!1),(C=e.beforeEnter)==null||C.call(e)}),S=mt(()=>{var C;g&&p(!1),(C=e.beforeLeave)==null||C.call(e)});return m.createElement(Qh.Provider,{value:f},m.createElement(Xh.Provider,{value:y},xo({ourProps:{...x,as:m.Fragment,children:m.createElement(zO,{ref:a,...x,...o,beforeEnter:w,beforeLeave:S})},theirProps:{},defaultTag:m.Fragment,features:jO,visible:c==="visible",name:"Transition"})))}function IW(e,t){let n=m.useContext(Xh)!==null,r=v0()!==null;return m.createElement(m.Fragment,null,!n&&r?m.createElement(C0,{ref:t,...e}):m.createElement(zO,{ref:t,...e}))}let C0=zi(AW),zO=zi(TW),NW=zi(IW),RW=Object.assign(C0,{Child:NW,Root:C0});const E0=["text","varchar","nvarchar","nvarchar2","char","character","nchar","char varying","nchar varying","character varying","string"],Tl=["number","integer","int","bigint","smallint","tinyint","byteint","numeric","decimal","dec","double","real","double precision","float","float4","float8"],Nu=["date","datetime","time","timestamp","timestamp without time zone"],BO=["boolean"];function VO(e,t,n){const{measures:r,dimensions:i}=e,o=r==null?void 0:r.map(c=>`${c.calc}(${c.name}) as ${c.calc}_${c.name}`).join(", "),s=(i==null?void 0:i.join(", "))||"";let a="";const l=P0(t,n);if(o&&s)return a=`SELECT ${s}, COUNT(*), ${o} FROM ${l} GROUP BY ${s} ORDER BY ${s} DESC LIMIT 100`,a;if(!o&&s)return a=`SELECT ${s}, COUNT(*) FROM ${l} GROUP BY ${s} ORDER BY ${s} DESC LIMIT 100`,a;if(o&&!s)return a=`SELECT ${o} FROM ${l}`,a}function HO(e,t,n="AVG"){var i,o,s,a;let r={};return E0.includes(e.data_type)&&(((i=t.dimensions)==null?void 0:i.includes(e.column_name))?r={...t,dimensions:(o=t.dimensions)==null?void 0:o.filter(c=>c!==e.column_name)}:r={...t,dimensions:[...t.dimensions||[],e.column_name]}),Tl.includes(e.data_type)&&(((s=t.measures)==null?void 0:s.some(c=>c.name===e.column_name&&c.calc===n))?r={...t,measures:(a=t.measures)==null?void 0:a.filter(c=>!(c.name===e.column_name&&c.calc===n))}:r={...t,measures:[...t.measures||[],{name:e.column_name,calc:n||"SUM"}]}),r}function O0(e){return E0.includes(e.dataType)?"string":Tl.includes(e.dataType)?"number":Nu.includes(e.dataType)?"date":BO.includes(e.dataType)?"boolean":"string"}function LW(e,t){const{dimensions:n,measures:r}=t,i=n==null?void 0:n.includes(e.column_name),o=r==null?void 0:r.some(s=>s.name===e.column_name);return i||o}function P0(e,t){return e==="public"?t:e?`${e}.${t}`:`${t}`}function $W(e){const t=/(>=|<=|>|<|=)/,n=e.match(t);if(n){const r=n[0],[i,o]=e.split(r);return{operation:r,value:o.trim()}}else return null}const WO=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,qO=Gd,UO=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return qO(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=t,s=Object.keys(i).map(c=>{const d=n==null?void 0:n[c],f=o==null?void 0:o[c];if(d===null)return null;const g=WO(d)||WO(f);return i[c][g]}),a=n&&Object.entries(n).reduce((c,d)=>{let[f,g]=d;return g===void 0||(c[f]=g),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,d)=>{let{class:f,className:g,...p}=d;return Object.entries(p).every(v=>{let[y,x]=v;return Array.isArray(x)?x.includes({...o,...a}[y]):{...o,...a}[y]===x})?[...c,f,g]:c},[]);return qO(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},k0=UO("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),ot=ue.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},o)=>{const s=r?no:"button";return _.jsx(s,{className:Pe(k0({variant:t,size:n,className:e})),ref:o,...i})});ot.displayName="Button";function FW({filter:e}){const[t,n]=m.useState([]),[r,i]=m.useState(""),[o,s]=m.useState(""),a=m.useRef(null),l=ge(k=>k.authToken),c=ge(k=>k.filterValues),d=ge(k=>k.actions.addOrUpdateFilterValue),f=ge(k=>k.actions.removeFilterValue),{data:g,isLoading:p,isFetching:v,isError:y,refetch:x}=Sr({queryKey:[e.sql],queryFn:()=>Is("https://semaphor.cloud/api/v1/query",(l==null?void 0:l.accessToken)||"",{connection_id:e.connectionId,sql:e.sql}),enabled:!!e.sql&&!!e.connectionId&&!!e.database}),w=m.useMemo(()=>{var k;return(k=g==null?void 0:g.records)==null?void 0:k.map(A=>({id:A[e.column.toLowerCase()],value:A[e.column.toLowerCase()]}))},[g,e.column]);m.useEffect(()=>{if(c){const k=c.find(A=>A.filterId===e.id);if(!k){n([]);return}if(k.operation==="in"){const A=w==null?void 0:w.filter(L=>k.values.includes(L.value));A&&n(A)}else i(`${k.operation} ${k.values[0]}`)}},[g]),m.useEffect(()=>{if(c&&!c.find(A=>A.filterId===e.id)){n([]);return}},[c,e.id]);function S(k){console.log("custom input");const A=$W(k[0].toString());if(!(A!=null&&A.value)||!(A!=null&&A.operation))return;const L={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:O0(e),name:e.column,operation:A.operation,values:[A.value]};d(L)}function C(k){if(console.log("onComboBoxChange",k),k.length===1&&w.find(L=>L.value===k[0].value)===void 0){S(k);return}if(n(k),k.length===0){f(e.id);return}const A={filterId:e.id,connectionType:e.database==="NA"?"api":"database",name:e.column,valueType:O0(e),operation:"in",values:k.map(L=>L.value)};d(A)}function P(){var k;i(""),f(e.id),console.log(e.id),(k=a.current)==null||k.click()}if(p)return _.jsx("div",{children:_.jsx(cf,{className:" bg-foreground/10 h-8 w-[180px]"})});if(y)return _.jsx("div",{className:"bg-muted h-8 w-[180px] px-2",children:"Error"});if(!g)return null;let O=[];return Tl.includes(e.dataType)?O=w:O=o===""?w:w.filter(k=>k.value.toLowerCase().replace(/\s+/g,"").includes(o.toLowerCase().replace(/\s+/g,""))),_.jsx(Dl,{value:t,onChange:C,multiple:!0,children:_.jsxs("div",{className:"relative",children:[_.jsxs("div",{className:" border relative w-full cursor-default overflow-hidden rounded-sm bg-background text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-background/75 focus-visible:ring-offset-2 sm:text-sm",children:[_.jsx(Dl.Input,{className:"flex h-8 w-full rounded border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50",displayValue:k=>k.map(L=>L.value).join(", ")||r,onChange:k=>{i(k.target.value),s(k.target.value)}}),_.jsx(Dl.Button,{ref:a,className:"absolute bg-background pl-1 inset-y-0 right-0 flex items-center pr-2",children:_.jsx($j,{className:"h-5 w-5 text-gray-400","aria-hidden":"true"})})]}),_.jsx(RW,{as:m.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",afterLeave:()=>s(""),children:_.jsxs(Dl.Options,{className:" z-10 absolute mt-1 max-h-60 w-full overflow-auto rounded-sm bg-background py-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-none sm:text-sm border",children:[Tl.includes(e.dataType)&&_.jsxs(Dl.Option,{value:r,className:" flex items-center px-3 justify-between gap-2 py-2",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("span",{className:" font-thin",children:"#"}),_.jsx("span",{children:r})]}),r&&_.jsx(ot,{variant:"link",className:" h-4 w-3 text-foreground/50 hover:text-foreground/100 cursor-pointer",onClick:k=>{k.stopPropagation(),P()},children:"Clear"})]}),O.length===0&&o!==""?_.jsx("div",{className:"relative cursor-default select-none px-4 py-2 text-gray-700",children:"Nothing found."}):O.map(k=>_.jsx(Dl.Option,{className:({active:A})=>`relative cursor-default select-none py-2 pl-10 pr-4 ${A?"bg-muted ":"text-foreground-900"}`,value:k,children:({selected:A,active:L})=>(A&&console.log("record",k,A),_.jsxs(_.Fragment,{children:[_.jsx("span",{className:`block truncate ${A?"font-medium":"font-normal"}`,children:typeof k.value=="boolean"?k.value?"True":"False":k.value}),A?_.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 text-foreground",children:_.jsx(XE,{className:"h-5 w-5","aria-hidden":"true"})}):null]}))},k.id))]})})]})})}const GO=m.forwardRef((e,t)=>m.createElement(Be.label,ae({},e,{ref:t,onMouseDown:n=>{var r;(r=e.onMouseDown)===null||r===void 0||r.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault()}}))),jW=UO("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),ns=ue.forwardRef(({className:e,...t},n)=>_.jsx(GO,{ref:n,className:Pe(jW(),e),...t}));ns.displayName=GO.displayName;function Ot(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function Ir(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function Zn(e,t){const n=Ot(e);return isNaN(t)?Ir(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function yi(e,t){const n=Ot(e);if(isNaN(t))return Ir(e,NaN);if(!t)return n;const r=n.getDate(),i=Ir(e,n.getTime());i.setMonth(n.getMonth()+t+1,0);const o=i.getDate();return r>=o?i:(n.setFullYear(i.getFullYear(),i.getMonth(),r),n)}const M0=6048e5,zW=864e5;let BW={};function Ru(){return BW}function Bi(e,t){var a,l,c,d;const n=Ru(),r=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((d=(c=n.locale)==null?void 0:c.options)==null?void 0:d.weekStartsOn)??0,i=Ot(e),o=i.getDay(),s=(o<r?7:0)+o-r;return i.setDate(i.getDate()-s),i.setHours(0,0,0,0),i}function pa(e){return Bi(e,{weekStartsOn:1})}function YO(e){const t=Ot(e),n=t.getFullYear(),r=Ir(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const i=pa(r),o=Ir(e,0);o.setFullYear(n,0,4),o.setHours(0,0,0,0);const s=pa(o);return t.getTime()>=i.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function Al(e){const t=Ot(e);return t.setHours(0,0,0,0),t}function Zh(e){const t=Ot(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Vi(e,t){const n=Al(e),r=Al(t),i=+n-Zh(n),o=+r-Zh(r);return Math.round((i-o)/zW)}function VW(e){const t=YO(e),n=Ir(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),pa(n)}function D0(e,t){const n=t*7;return Zn(e,n)}function HW(e,t){return yi(e,t*12)}function WW(e){let t;return e.forEach(function(n){const r=Ot(n);(t===void 0||t<r||isNaN(Number(r)))&&(t=r)}),t||new Date(NaN)}function qW(e){let t;return e.forEach(n=>{const r=Ot(n);(!t||t>r||isNaN(+r))&&(t=r)}),t||new Date(NaN)}function dr(e,t){const n=Al(e),r=Al(t);return+n==+r}function T0(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function UW(e){if(!T0(e)&&typeof e!="number")return!1;const t=Ot(e);return!isNaN(Number(t))}function Lu(e,t){const n=Ot(e),r=Ot(t),i=n.getFullYear()-r.getFullYear(),o=n.getMonth()-r.getMonth();return i*12+o}function GW(e,t,n){const r=Bi(e,n),i=Bi(t,n),o=+r-Zh(r),s=+i-Zh(i);return Math.round((o-s)/M0)}function A0(e){const t=Ot(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function fr(e){const t=Ot(e);return t.setDate(1),t.setHours(0,0,0,0),t}function KO(e){const t=Ot(e),n=Ir(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function I0(e,t){var a,l,c,d;const n=Ru(),r=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((d=(c=n.locale)==null?void 0:c.options)==null?void 0:d.weekStartsOn)??0,i=Ot(e),o=i.getDay(),s=(o<r?-7:0)+6-(o-r);return i.setDate(i.getDate()+s),i.setHours(23,59,59,999),i}function XO(e){return I0(e,{weekStartsOn:1})}const YW={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},KW=(e,t,n)=>{let r;const i=YW[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function N0(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const XW={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},QW={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},JW={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ZW={date:N0({formats:XW,defaultWidth:"full"}),time:N0({formats:QW,defaultWidth:"full"}),dateTime:N0({formats:JW,defaultWidth:"full"})},e6={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},t6=(e,t,n,r)=>e6[e];function $u(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):s;i=e.formattingValues[a]||e.formattingValues[s]}else{const s=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[a]||e.values[s]}const o=e.argumentCallback?e.argumentCallback(t):t;return i[o]}}const n6={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},r6={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},i6={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},o6={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},s6={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},a6={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},l6={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:$u({values:n6,defaultWidth:"wide"}),quarter:$u({values:r6,defaultWidth:"wide",argumentCallback:e=>e-1}),month:$u({values:i6,defaultWidth:"wide"}),day:$u({values:o6,defaultWidth:"wide"}),dayPeriod:$u({values:s6,defaultWidth:"wide",formattingValues:a6,defaultFormattingWidth:"wide"})};function Fu(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;const s=o[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?u6(a,f=>f.test(s)):c6(a,f=>f.test(s));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const d=t.slice(s.length);return{value:c,rest:d}}}function c6(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function u6(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function d6(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],o=t.match(e.parsePattern);if(!o)return null;let s=e.valueCallback?e.valueCallback(o[0]):o[0];s=n.valueCallback?n.valueCallback(s):s;const a=t.slice(i.length);return{value:s,rest:a}}}const f6=/^(\d+)(th|st|nd|rd)?/i,h6=/\d+/i,p6={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},g6={any:[/^b/i,/^(a|c)/i]},m6={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},v6={any:[/1/i,/2/i,/3/i,/4/i]},b6={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},y6={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},x6={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},w6={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},_6={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},S6={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},C6={ordinalNumber:d6({matchPattern:f6,parsePattern:h6,valueCallback:e=>parseInt(e,10)}),era:Fu({matchPatterns:p6,defaultMatchWidth:"wide",parsePatterns:g6,defaultParseWidth:"any"}),quarter:Fu({matchPatterns:m6,defaultMatchWidth:"wide",parsePatterns:v6,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Fu({matchPatterns:b6,defaultMatchWidth:"wide",parsePatterns:y6,defaultParseWidth:"any"}),day:Fu({matchPatterns:x6,defaultMatchWidth:"wide",parsePatterns:w6,defaultParseWidth:"any"}),dayPeriod:Fu({matchPatterns:_6,defaultMatchWidth:"any",parsePatterns:S6,defaultParseWidth:"any"})},QO={code:"en-US",formatDistance:KW,formatLong:ZW,formatRelative:t6,localize:l6,match:C6,options:{weekStartsOn:0,firstWeekContainsDate:1}};function E6(e){const t=Ot(e);return Vi(t,KO(t))+1}function JO(e){const t=Ot(e),n=+pa(t)-+VW(t);return Math.round(n/M0)+1}function ZO(e,t){var d,f,g,p;const n=Ot(e),r=n.getFullYear(),i=Ru(),o=(t==null?void 0:t.firstWeekContainsDate)??((f=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??i.firstWeekContainsDate??((p=(g=i.locale)==null?void 0:g.options)==null?void 0:p.firstWeekContainsDate)??1,s=Ir(e,0);s.setFullYear(r+1,0,o),s.setHours(0,0,0,0);const a=Bi(s,t),l=Ir(e,0);l.setFullYear(r,0,o),l.setHours(0,0,0,0);const c=Bi(l,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function O6(e,t){var a,l,c,d;const n=Ru(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((d=(c=n.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)??1,i=ZO(e,t),o=Ir(e,0);return o.setFullYear(i,0,r),o.setHours(0,0,0,0),Bi(o,t)}function eP(e,t){const n=Ot(e),r=+Bi(n,t)-+O6(n,t);return Math.round(r/M0)+1}function Lt(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const rs={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Lt(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Lt(n+1,2)},d(e,t){return Lt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Lt(e.getHours()%12||12,t.length)},H(e,t){return Lt(e.getHours(),t.length)},m(e,t){return Lt(e.getMinutes(),t.length)},s(e,t){return Lt(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return Lt(i,t.length)}},Il={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},tP={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return rs.y(e,t)},Y:function(e,t,n,r){const i=ZO(e,r),o=i>0?i:1-i;if(t==="YY"){const s=o%100;return Lt(s,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):Lt(o,t.length)},R:function(e,t){const n=YO(e);return Lt(n,t.length)},u:function(e,t){const n=e.getFullYear();return Lt(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Lt(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Lt(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return rs.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Lt(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=eP(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):Lt(i,t.length)},I:function(e,t,n){const r=JO(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Lt(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):rs.d(e,t)},D:function(e,t,n){const r=E6(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Lt(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return Lt(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return Lt(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return Lt(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=Il.noon:r===0?i=Il.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=Il.evening:r>=12?i=Il.afternoon:r>=4?i=Il.morning:i=Il.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return rs.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):rs.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Lt(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Lt(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):rs.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):rs.s(e,t)},S:function(e,t){return rs.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return rP(r);case"XXXX":case"XX":return ga(r);case"XXXXX":case"XXX":default:return ga(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return rP(r);case"xxxx":case"xx":return ga(r);case"xxxxx":case"xxx":default:return ga(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+nP(r,":");case"OOOO":default:return"GMT"+ga(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+nP(r,":");case"zzzz":default:return"GMT"+ga(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return Lt(r,t.length)},T:function(e,t,n){const r=e.getTime();return Lt(r,t.length)}};function nP(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),o=r%60;return o===0?n+String(i):n+String(i)+t+Lt(o,2)}function rP(e,t){return e%60===0?(e>0?"-":"+")+Lt(Math.abs(e)/60,2):ga(e,t)}function ga(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Lt(Math.trunc(r/60),2),o=Lt(r%60,2);return n+i+t+o}const iP=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},oP=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},P6={p:oP,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return iP(e,t);let o;switch(r){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",iP(r,t)).replace("{{time}}",oP(i,t))}},k6=/^D+$/,M6=/^Y+$/,D6=["D","DD","YY","YYYY"];function T6(e){return k6.test(e)}function A6(e){return M6.test(e)}function I6(e,t,n){const r=N6(e,t,n);if(console.warn(r),D6.includes(e))throw new RangeError(r)}function N6(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const R6=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,L6=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,$6=/^'([^]*?)'?$/,F6=/''/g,j6=/[a-zA-Z]/;function Hi(e,t,n){var d,f,g,p,v,y,x,w;const r=Ru(),i=(n==null?void 0:n.locale)??r.locale??QO,o=(n==null?void 0:n.firstWeekContainsDate)??((f=(d=n==null?void 0:n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??r.firstWeekContainsDate??((p=(g=r.locale)==null?void 0:g.options)==null?void 0:p.firstWeekContainsDate)??1,s=(n==null?void 0:n.weekStartsOn)??((y=(v=n==null?void 0:n.locale)==null?void 0:v.options)==null?void 0:y.weekStartsOn)??r.weekStartsOn??((w=(x=r.locale)==null?void 0:x.options)==null?void 0:w.weekStartsOn)??0,a=Ot(e);if(!UW(a))throw new RangeError("Invalid time value");let l=t.match(L6).map(S=>{const C=S[0];if(C==="p"||C==="P"){const P=P6[C];return P(S,i.formatLong)}return S}).join("").match(R6).map(S=>{if(S==="''")return{isToken:!1,value:"'"};const C=S[0];if(C==="'")return{isToken:!1,value:z6(S)};if(tP[C])return{isToken:!0,value:S};if(C.match(j6))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");return{isToken:!1,value:S}});i.localize.preprocessor&&(l=i.localize.preprocessor(a,l));const c={firstWeekContainsDate:o,weekStartsOn:s,locale:i};return l.map(S=>{if(!S.isToken)return S.value;const C=S.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&A6(C)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&T6(C))&&I6(C,t,String(e));const P=tP[C[0]];return P(a,C,i.localize,c)}).join("")}function z6(e){const t=e.match($6);return t?t[1].replace(F6,"'"):e}function B6(e){const t=Ot(e),n=t.getFullYear(),r=t.getMonth(),i=Ir(e,0);return i.setFullYear(n,r+1,0),i.setHours(0,0,0,0),i.getDate()}function V6(e){return Math.trunc(+Ot(e)/1e3)}function H6(e){const t=Ot(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function W6(e,t){return GW(H6(e),fr(e),t)+1}function R0(e,t){const n=Ot(e),r=Ot(t);return n.getTime()>r.getTime()}function sP(e,t){const n=Ot(e),r=Ot(t);return+n<+r}function L0(e,t){const n=Ot(e),r=Ot(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function q6(e,t){const n=Ot(e),r=Ot(t);return n.getFullYear()===r.getFullYear()}function $0(e,t){return Zn(e,-t)}function F0(e,t){const n=Ot(e),r=n.getFullYear(),i=n.getDate(),o=Ir(e,0);o.setFullYear(r,t,15),o.setHours(0,0,0,0);const s=B6(o);return n.setMonth(t,Math.min(i,s)),n}function aP(e,t){const n=Ot(e);return isNaN(+n)?Ir(e,NaN):(n.setFullYear(t),n)}var Ue=function(){return Ue=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Ue.apply(this,arguments)};function U6(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function lP(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var j0={exports:{}},ju={};/**
|
|
351
|
+
`));let g=d.props,p=typeof(g==null?void 0:g.className)=="function"?(...y)=>Gh(g==null?void 0:g.className(...y),l.className):Gh(g==null?void 0:g.className,l.className),v=p?{className:p}:{};return m.cloneElement(d,Object.assign({},MO(d.props,p0(g0(l,["ref"]))),f,c,{ref:i(d.ref,c.ref)},v))}return m.createElement(o,Object.assign({},g0(l,["ref"]),o!==m.Fragment&&c,o!==m.Fragment&&f),d)}function jH(...e){return e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function MO(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let i in r)i.startsWith("on")&&typeof r[i]=="function"?(n[i]!=null||(n[i]=[]),n[i].push(r[i])):t[i]=r[i];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map(r=>[r,void 0])));for(let r in n)Object.assign(t,{[r](i,...o){let s=n[r];for(let a of s){if((i instanceof Event||(i==null?void 0:i.nativeEvent)instanceof Event)&&i.defaultPrevented)return;a(i,...o)}}});return t}function zi(e){var t;return Object.assign(m.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function p0(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function g0(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}let zH="div";var DO=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(DO||{});function BH(e,t){var n;let{features:r=1,...i}=e,o={ref:t,"aria-hidden":(r&2)===2?!0:(n=i["aria-hidden"])!=null?n:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return xo({ourProps:o,theirProps:i,slot:{},defaultTag:zH,name:"Hidden"})}let VH=zi(BH),m0=m.createContext(null);m0.displayName="OpenClosedContext";var Tr=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(Tr||{});function v0(){return m.useContext(m0)}function TO({value:e,children:t}){return m.createElement(m0.Provider,{value:e},t)}function HH(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let fa=[];HH(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&fa[0]!==t.target&&(fa.unshift(t.target),fa=fa.filter(n=>n!=null&&n.isConnected),fa.splice(10))}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function WH(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&qH(n)?!1:r}function qH(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}function UH(e){throw new Error("Unexpected object: "+e)}var _n=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(_n||{});function AO(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),i=r??-1;switch(e.focus){case 0:{for(let o=0;o<n.length;++o)if(!t.resolveDisabled(n[o],o,n))return o;return r}case 1:{for(let o=i-1;o>=0;--o)if(!t.resolveDisabled(n[o],o,n))return o;return r}case 2:{for(let o=i+1;o<n.length;++o)if(!t.resolveDisabled(n[o],o,n))return o;return r}case 3:{for(let o=n.length-1;o>=0;--o)if(!t.resolveDisabled(n[o],o,n))return o;return r}case 4:{for(let o=0;o<n.length;++o)if(t.resolveId(n[o],o,n)===e.id)return o;return r}case 5:return null;default:UH(e)}}function IO(e={},t=null,n=[]){for(let[r,i]of Object.entries(e))RO(n,NO(t,r),i);return n}function NO(e,t){return e?e+"["+t+"]":t}function RO(e,t,n){if(Array.isArray(n))for(let[r,i]of n.entries())RO(e,NO(t,r.toString()),i);else n instanceof Date?e.push([t,n.toISOString()]):typeof n=="boolean"?e.push([t,n?"1":"0"]):typeof n=="string"?e.push([t,n]):typeof n=="number"?e.push([t,`${n}`]):n==null?e.push([t,""]):IO(n,t,e)}var Ar=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(Ar||{}),GH=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(GH||{}),YH=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(YH||{}),KH=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(KH||{}),XH=(e=>(e[e.OpenCombobox=0]="OpenCombobox",e[e.CloseCombobox=1]="CloseCombobox",e[e.GoToOption=2]="GoToOption",e[e.RegisterOption=3]="RegisterOption",e[e.UnregisterOption=4]="UnregisterOption",e[e.RegisterLabel=5]="RegisterLabel",e[e.SetActivationTrigger=6]="SetActivationTrigger",e[e.UpdateVirtualOptions=7]="UpdateVirtualOptions",e))(XH||{});function b0(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=t(e.options.slice()),i=r.length>0&&r[0].dataRef.current.order!==null?r.sort((s,a)=>s.dataRef.current.order-a.dataRef.current.order):MH(r,s=>s.dataRef.current.domRef.current),o=n?i.indexOf(n):null;return o===-1&&(o=null),{options:i,activeOptionIndex:o}}let QH={1(e){var t;return(t=e.dataRef.current)!=null&&t.disabled||e.comboboxState===1?e:{...e,activeOptionIndex:null,comboboxState:1}},0(e){var t,n;if((t=e.dataRef.current)!=null&&t.disabled||e.comboboxState===0)return e;if((n=e.dataRef.current)!=null&&n.value){let r=e.dataRef.current.calculateIndex(e.dataRef.current.value);if(r!==-1)return{...e,activeOptionIndex:r,comboboxState:0}}return{...e,comboboxState:0}},2(e,t){var n,r,i,o,s;if((n=e.dataRef.current)!=null&&n.disabled||(r=e.dataRef.current)!=null&&r.optionsRef.current&&!((i=e.dataRef.current)!=null&&i.optionsPropsRef.current.static)&&e.comboboxState===1)return e;if(e.virtual){let d=t.focus===_n.Specific?t.idx:AO(t,{resolveItems:()=>e.virtual.options,resolveActiveIndex:()=>{var g,p;return(p=(g=e.activeOptionIndex)!=null?g:e.virtual.options.findIndex(v=>!e.virtual.disabled(v)))!=null?p:null},resolveDisabled:e.virtual.disabled,resolveId(){throw new Error("Function not implemented.")}}),f=(o=t.trigger)!=null?o:2;return e.activeOptionIndex===d&&e.activationTrigger===f?e:{...e,activeOptionIndex:d,activationTrigger:f}}let a=b0(e);if(a.activeOptionIndex===null){let d=a.options.findIndex(f=>!f.dataRef.current.disabled);d!==-1&&(a.activeOptionIndex=d)}let l=t.focus===_n.Specific?t.idx:AO(t,{resolveItems:()=>a.options,resolveActiveIndex:()=>a.activeOptionIndex,resolveId:d=>d.id,resolveDisabled:d=>d.dataRef.current.disabled}),c=(s=t.trigger)!=null?s:2;return e.activeOptionIndex===l&&e.activationTrigger===c?e:{...e,...a,activeOptionIndex:l,activationTrigger:c}},3:(e,t)=>{var n,r,i;if((n=e.dataRef.current)!=null&&n.virtual)return{...e,options:[...e.options,t.payload]};let o=t.payload,s=b0(e,l=>(l.push(o),l));e.activeOptionIndex===null&&(r=e.dataRef.current)!=null&&r.isSelected(t.payload.dataRef.current.value)&&(s.activeOptionIndex=s.options.indexOf(o));let a={...e,...s,activationTrigger:2};return(i=e.dataRef.current)!=null&&i.__demoMode&&e.dataRef.current.value===void 0&&(a.activeOptionIndex=0),a},4:(e,t)=>{var n;if((n=e.dataRef.current)!=null&&n.virtual)return{...e,options:e.options.filter(i=>i.id!==t.id)};let r=b0(e,i=>{let o=i.findIndex(s=>s.id===t.id);return o!==-1&&i.splice(o,1),i});return{...e,...r,activationTrigger:2}},5:(e,t)=>e.labelId===t.id?e:{...e,labelId:t.id},6:(e,t)=>e.activationTrigger===t.trigger?e:{...e,activationTrigger:t.trigger},7:(e,t)=>{var n;if(((n=e.virtual)==null?void 0:n.options)===t.options)return e;let r=e.activeOptionIndex;if(e.activeOptionIndex!==null){let i=t.options.indexOf(e.virtual.options[e.activeOptionIndex]);i!==-1?r=i:r=null}return{...e,activeOptionIndex:r,virtual:Object.assign({},e.virtual,{options:t.options})}}},y0=m.createContext(null);y0.displayName="ComboboxActionsContext";function Iu(e){let t=m.useContext(y0);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Iu),n}return t}let LO=m.createContext(null);function JH(e){var t;let n=ha("VirtualProvider"),[r,i]=m.useMemo(()=>{let l=n.optionsRef.current;if(!l)return[0,0];let c=window.getComputedStyle(l);return[parseFloat(c.paddingBlockStart||c.paddingTop),parseFloat(c.paddingBlockEnd||c.paddingBottom)]},[n.optionsRef.current]),o=vH({scrollPaddingStart:r,scrollPaddingEnd:i,count:n.virtual.options.length,estimateSize(){return 40},getScrollElement(){var l;return(l=n.optionsRef.current)!=null?l:null},overscan:12}),[s,a]=m.useState(0);return wn(()=>{a(l=>l+1)},[(t=n.virtual)==null?void 0:t.options]),m.createElement(LO.Provider,{value:o},m.createElement("div",{style:{position:"relative",width:"100%",height:`${o.getTotalSize()}px`},ref:l=>{if(l){if(typeof process<"u"&&process.env.JEST_WORKER_ID!==void 0||n.activationTrigger===0)return;n.activeOptionIndex!==null&&n.virtual.options.length>n.activeOptionIndex&&o.scrollToIndex(n.activeOptionIndex)}}},o.getVirtualItems().map(l=>{var c;return m.createElement(m.Fragment,{key:l.key},m.cloneElement((c=e.children)==null?void 0:c.call(e,{option:n.virtual.options[l.index],open:n.comboboxState===0}),{key:`${s}-${l.key}`,"data-index":l.index,"aria-setsize":n.virtual.options.length,"aria-posinset":l.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${l.start}px)`,overflowAnchor:"none"}}))})))}let x0=m.createContext(null);x0.displayName="ComboboxDataContext";function ha(e){let t=m.useContext(x0);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,ha),n}return t}function ZH(e,t){return $n(t.type,QH,e,t)}let eW=m.Fragment;function tW(e,t){let{value:n,defaultValue:r,onChange:i,form:o,name:s,by:a=null,disabled:l=!1,__demoMode:c=!1,nullable:d=!1,multiple:f=!1,immediate:g=!1,virtual:p=null,...v}=e,y=!1,x=null,[w=f?[]:void 0,S]=wH(n,i,r),[C,P]=m.useReducer(ZH,{dataRef:m.createRef(),comboboxState:c?0:1,options:[],virtual:null,activeOptionIndex:null,activationTrigger:2,labelId:null}),O=m.useRef(!1),k=m.useRef({static:!1,hold:!1}),A=m.useRef(null),L=m.useRef(null),F=m.useRef(null),j=m.useRef(null),B=mt(typeof a=="string"?(ee,W)=>{let ye=a;return(ee==null?void 0:ee[ye])===(W==null?void 0:W[ye])}:a??((ee,W)=>ee===W)),V=mt(ee=>C.options.findIndex(W=>B(W.dataRef.current.value,ee))),K=m.useCallback(ee=>$n($.mode,{1:()=>w.some(W=>B(W,ee)),0:()=>B(w,ee)}),[w]),Y=mt(ee=>C.activeOptionIndex===V(ee)),$=m.useMemo(()=>({...C,immediate:y,optionsPropsRef:k,labelRef:A,inputRef:L,buttonRef:F,optionsRef:j,value:w,defaultValue:r,disabled:l,mode:f?1:0,virtual:C.virtual,get activeOptionIndex(){if(O.current&&C.activeOptionIndex===null&&C.options.length>0){let ee=C.options.findIndex(W=>!W.dataRef.current.disabled);if(ee!==-1)return ee}return C.activeOptionIndex},calculateIndex:V,compare:B,isSelected:K,isActive:Y,nullable:d,__demoMode:c}),[w,r,l,f,d,c,C,x]);wn(()=>{},[x,void 0]),wn(()=>{C.dataRef.current=$},[$]),IH([$.buttonRef,$.inputRef,$.optionsRef],()=>me.closeCombobox(),$.comboboxState===0);let Z=m.useMemo(()=>{var ee,W,ye;return{open:$.comboboxState===0,disabled:l,activeIndex:$.activeOptionIndex,activeOption:$.activeOptionIndex===null?null:$.virtual?$.virtual.options[(ee=$.activeOptionIndex)!=null?ee:0]:(ye=(W=$.options[$.activeOptionIndex])==null?void 0:W.dataRef.current.value)!=null?ye:null,value:w}},[$,l,w]),U=mt(()=>{if($.activeOptionIndex!==null){if($.virtual)N($.virtual.options[$.activeOptionIndex]);else{let{dataRef:ee}=$.options[$.activeOptionIndex];N(ee.current.value)}me.goToOption(_n.Specific,$.activeOptionIndex)}}),ie=mt(()=>{P({type:0}),O.current=!0}),le=mt(()=>{P({type:1}),O.current=!1}),M=mt((ee,W,ye)=>(O.current=!1,ee===_n.Specific?P({type:2,focus:_n.Specific,idx:W,trigger:ye}):P({type:2,focus:ee,trigger:ye}))),H=mt((ee,W)=>(P({type:3,payload:{id:ee,dataRef:W}}),()=>{$.isActive(W.current.value)&&(O.current=!0),P({type:4,id:ee})})),ne=mt(ee=>(P({type:5,id:ee}),()=>P({type:5,id:null}))),N=mt(ee=>$n($.mode,{0(){return S==null?void 0:S(ee)},1(){let W=$.value.slice(),ye=W.findIndex(oe=>B(oe,ee));return ye===-1?W.push(ee):W.splice(ye,1),S==null?void 0:S(W)}})),X=mt(ee=>{P({type:6,trigger:ee})}),me=m.useMemo(()=>({onChange:N,registerOption:H,registerLabel:ne,goToOption:M,closeCombobox:le,openCombobox:ie,setActivationTrigger:X,selectActiveOption:U}),[]),he=t===null?{}:{ref:t},de=m.useRef(null),re=Tu();return m.useEffect(()=>{de.current&&r!==void 0&&re.addEventListener(de.current,"reset",()=>{S==null||S(r)})},[de,S]),m.createElement(y0.Provider,{value:me},m.createElement(x0.Provider,{value:$},m.createElement(TO,{value:$n($.comboboxState,{0:Tr.Open,1:Tr.Closed})},s!=null&&w!=null&&IO({[s]:w}).map(([ee,W],ye)=>m.createElement(VH,{features:DO.Hidden,ref:ye===0?oe=>{var Te;de.current=(Te=oe==null?void 0:oe.closest("form"))!=null?Te:null}:void 0,...p0({key:ee,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:o,name:ee,value:W})})),xo({ourProps:he,theirProps:v,slot:Z,defaultTag:eW,name:"Combobox"}))))}let nW="input";function rW(e,t){var n,r,i,o,s;let a=Au(),{id:l=`headlessui-combobox-input-${a}`,onChange:c,displayValue:d,type:f="text",...g}=e,p=ha("Combobox.Input"),v=Iu("Combobox.Input"),y=da(p.inputRef,t),x=NH(p.inputRef),w=m.useRef(!1),S=Tu(),C=mt(()=>{v.onChange(null),p.optionsRef.current&&(p.optionsRef.current.scrollTop=0),v.goToOption(_n.Nothing)}),P=function(){var $;return typeof d=="function"&&p.value!==void 0?($=d(p.value))!=null?$:"":typeof p.value=="string"?p.value:""}();kO(([$,Z],[U,ie])=>{if(w.current)return;let le=p.inputRef.current;le&&((ie===0&&Z===1||$!==U)&&(le.value=$),requestAnimationFrame(()=>{if(w.current||!le||(x==null?void 0:x.activeElement)!==le)return;let{selectionStart:M,selectionEnd:H}=le;Math.abs((H??0)-(M??0))===0&&M===0&&le.setSelectionRange(le.value.length,le.value.length)}))},[P,p.comboboxState,x]),kO(([$],[Z])=>{if($===0&&Z===1){if(w.current)return;let U=p.inputRef.current;if(!U)return;let ie=U.value,{selectionStart:le,selectionEnd:M,selectionDirection:H}=U;U.value="",U.value=ie,H!==null?U.setSelectionRange(le,M,H):U.setSelectionRange(le,M)}},[p.comboboxState]);let O=m.useRef(!1),k=mt(()=>{O.current=!0}),A=mt(()=>{S.nextFrame(()=>{O.current=!1})}),L=mt($=>{switch(w.current=!0,$.key){case Ar.Enter:if(w.current=!1,p.comboboxState!==0||O.current)return;if($.preventDefault(),$.stopPropagation(),p.activeOptionIndex===null){v.closeCombobox();return}v.selectActiveOption(),p.mode===0&&v.closeCombobox();break;case Ar.ArrowDown:return w.current=!1,$.preventDefault(),$.stopPropagation(),$n(p.comboboxState,{0:()=>v.goToOption(_n.Next),1:()=>v.openCombobox()});case Ar.ArrowUp:return w.current=!1,$.preventDefault(),$.stopPropagation(),$n(p.comboboxState,{0:()=>v.goToOption(_n.Previous),1:()=>{v.openCombobox(),S.nextFrame(()=>{p.value||v.goToOption(_n.Last)})}});case Ar.Home:if($.shiftKey)break;return w.current=!1,$.preventDefault(),$.stopPropagation(),v.goToOption(_n.First);case Ar.PageUp:return w.current=!1,$.preventDefault(),$.stopPropagation(),v.goToOption(_n.First);case Ar.End:if($.shiftKey)break;return w.current=!1,$.preventDefault(),$.stopPropagation(),v.goToOption(_n.Last);case Ar.PageDown:return w.current=!1,$.preventDefault(),$.stopPropagation(),v.goToOption(_n.Last);case Ar.Escape:return w.current=!1,p.comboboxState!==0?void 0:($.preventDefault(),p.optionsRef.current&&!p.optionsPropsRef.current.static&&$.stopPropagation(),p.nullable&&p.mode===0&&p.value===null&&C(),v.closeCombobox());case Ar.Tab:if(w.current=!1,p.comboboxState!==0)return;p.mode===0&&p.activationTrigger!==1&&v.selectActiveOption(),v.closeCombobox();break}}),F=mt($=>{c==null||c($),p.nullable&&p.mode===0&&$.target.value===""&&C(),v.openCombobox()}),j=mt($=>{var Z,U,ie;let le=(Z=$.relatedTarget)!=null?Z:fa.find(M=>M!==$.currentTarget);if(w.current=!1,!((U=p.optionsRef.current)!=null&&U.contains(le))&&!((ie=p.buttonRef.current)!=null&&ie.contains(le))&&p.comboboxState===0)return $.preventDefault(),p.mode===0&&(p.nullable&&p.value===null?C():p.activationTrigger!==1&&v.selectActiveOption()),v.closeCombobox()}),B=mt($=>{var Z,U,ie;let le=(Z=$.relatedTarget)!=null?Z:fa.find(M=>M!==$.currentTarget);(U=p.buttonRef.current)!=null&&U.contains(le)||(ie=p.optionsRef.current)!=null&&ie.contains(le)||p.disabled||p.immediate&&p.comboboxState!==0&&(v.openCombobox(),S.nextFrame(()=>{v.setActivationTrigger(1)}))}),V=d0(()=>{if(p.labelId)return[p.labelId].join(" ")},[p.labelId]),K=m.useMemo(()=>({open:p.comboboxState===0,disabled:p.disabled}),[p]),Y={ref:y,id:l,role:"combobox",type:f,"aria-controls":(n=p.optionsRef.current)==null?void 0:n.id,"aria-expanded":p.comboboxState===0,"aria-activedescendant":p.activeOptionIndex===null?void 0:p.virtual?(r=p.options.find($=>{var Z;return!((Z=p.virtual)!=null&&Z.disabled($.dataRef.current.value))&&p.compare($.dataRef.current.value,p.virtual.options[p.activeOptionIndex])}))==null?void 0:r.id:(i=p.options[p.activeOptionIndex])==null?void 0:i.id,"aria-labelledby":V,"aria-autocomplete":"list",defaultValue:(s=(o=e.defaultValue)!=null?o:p.defaultValue!==void 0?d==null?void 0:d(p.defaultValue):null)!=null?s:p.defaultValue,disabled:p.disabled,onCompositionStart:k,onCompositionEnd:A,onKeyDown:L,onChange:F,onFocus:B,onBlur:j};return xo({ourProps:Y,theirProps:g,slot:K,defaultTag:nW,name:"Combobox.Input"})}let iW="button";function oW(e,t){var n;let r=ha("Combobox.Button"),i=Iu("Combobox.Button"),o=da(r.buttonRef,t),s=Au(),{id:a=`headlessui-combobox-button-${s}`,...l}=e,c=Tu(),d=mt(y=>{switch(y.key){case Ar.ArrowDown:return y.preventDefault(),y.stopPropagation(),r.comboboxState===1&&i.openCombobox(),c.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})});case Ar.ArrowUp:return y.preventDefault(),y.stopPropagation(),r.comboboxState===1&&(i.openCombobox(),c.nextFrame(()=>{r.value||i.goToOption(_n.Last)})),c.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})});case Ar.Escape:return r.comboboxState!==0?void 0:(y.preventDefault(),r.optionsRef.current&&!r.optionsPropsRef.current.static&&y.stopPropagation(),i.closeCombobox(),c.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})}));default:return}}),f=mt(y=>{if(WH(y.currentTarget))return y.preventDefault();r.comboboxState===0?i.closeCombobox():(y.preventDefault(),i.openCombobox()),c.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})})}),g=d0(()=>{if(r.labelId)return[r.labelId,a].join(" ")},[r.labelId,a]),p=m.useMemo(()=>({open:r.comboboxState===0,disabled:r.disabled,value:r.value}),[r]),v={ref:o,id:a,type:RH(e,r.buttonRef),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":(n=r.optionsRef.current)==null?void 0:n.id,"aria-expanded":r.comboboxState===0,"aria-labelledby":g,disabled:r.disabled,onClick:f,onKeyDown:d};return xo({ourProps:v,theirProps:l,slot:p,defaultTag:iW,name:"Combobox.Button"})}let sW="label";function aW(e,t){let n=Au(),{id:r=`headlessui-combobox-label-${n}`,...i}=e,o=ha("Combobox.Label"),s=Iu("Combobox.Label"),a=da(o.labelRef,t);wn(()=>s.registerLabel(r),[r]);let l=mt(()=>{var d;return(d=o.inputRef.current)==null?void 0:d.focus({preventScroll:!0})}),c=m.useMemo(()=>({open:o.comboboxState===0,disabled:o.disabled}),[o]);return xo({ourProps:{ref:a,id:r,onClick:l},theirProps:i,slot:c,defaultTag:sW,name:"Combobox.Label"})}let lW="ul",cW=Yh.RenderStrategy|Yh.Static;function uW(e,t){let n=Au(),{id:r=`headlessui-combobox-options-${n}`,hold:i=!1,...o}=e,s=ha("Combobox.Options"),a=da(s.optionsRef,t),l=v0(),c=l!==null?(l&Tr.Open)===Tr.Open:s.comboboxState===0;wn(()=>{var p;s.optionsPropsRef.current.static=(p=e.static)!=null?p:!1},[s.optionsPropsRef,e.static]),wn(()=>{s.optionsPropsRef.current.hold=i},[s.optionsPropsRef,i]),FH({container:s.optionsRef.current,enabled:s.comboboxState===0,accept(p){return p.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:p.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(p){p.setAttribute("role","none")}});let d=d0(()=>{var p,v;return(v=s.labelId)!=null?v:(p=s.buttonRef.current)==null?void 0:p.id},[s.labelId,s.buttonRef.current]),f=m.useMemo(()=>({open:s.comboboxState===0,option:void 0}),[s]),g={"aria-labelledby":d,role:"listbox","aria-multiselectable":s.mode===1?!0:void 0,id:r,ref:a};return s.virtual&&s.comboboxState===0&&Object.assign(o,{children:m.createElement(JH,null,o.children)}),xo({ourProps:g,theirProps:o,slot:f,defaultTag:lW,features:cW,visible:c,name:"Combobox.Options"})}let dW="li";function fW(e,t){var n;let r=Au(),{id:i=`headlessui-combobox-option-${r}`,disabled:o=!1,value:s,order:a=null,...l}=e,c=ha("Combobox.Option"),d=Iu("Combobox.Option"),f=c.virtual?c.activeOptionIndex===c.calculateIndex(s):c.activeOptionIndex===null?!1:((n=c.options[c.activeOptionIndex])==null?void 0:n.id)===i,g=c.isSelected(s),p=m.useRef(null),v=ji({disabled:o,value:s,domRef:p,order:a}),y=m.useContext(LO),x=da(t,p,y?y.measureElement:null),w=mt(()=>d.onChange(s));wn(()=>d.registerOption(i,v),[v,i]);let S=m.useRef(!(c.virtual||c.__demoMode));wn(()=>{if(!c.virtual||!c.__demoMode)return;let j=ua();return j.requestAnimationFrame(()=>{S.current=!0}),j.dispose},[c.virtual,c.__demoMode]),wn(()=>{if(!S.current||c.comboboxState!==0||!f||c.activationTrigger===0)return;let j=ua();return j.requestAnimationFrame(()=>{var B,V;(V=(B=p.current)==null?void 0:B.scrollIntoView)==null||V.call(B,{block:"nearest"})}),j.dispose},[p,f,c.comboboxState,c.activationTrigger,c.activeOptionIndex]);let C=mt(j=>{var B;if(o||(B=c.virtual)!=null&&B.disabled(s))return j.preventDefault();w(),EO()||requestAnimationFrame(()=>{var V;return(V=c.inputRef.current)==null?void 0:V.focus({preventScroll:!0})}),c.mode===0&&requestAnimationFrame(()=>d.closeCombobox())}),P=mt(()=>{var j;if(o||(j=c.virtual)!=null&&j.disabled(s))return d.goToOption(_n.Nothing);let B=c.calculateIndex(s);d.goToOption(_n.Specific,B)}),O=$H(),k=mt(j=>O.update(j)),A=mt(j=>{var B;if(!O.wasMoved(j)||o||(B=c.virtual)!=null&&B.disabled(s)||f)return;let V=c.calculateIndex(s);d.goToOption(_n.Specific,V,0)}),L=mt(j=>{var B;O.wasMoved(j)&&(o||(B=c.virtual)!=null&&B.disabled(s)||f&&(c.optionsPropsRef.current.hold||d.goToOption(_n.Nothing)))}),F=m.useMemo(()=>({active:f,selected:g,disabled:o}),[f,g,o]);return xo({ourProps:{id:i,ref:x,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":g,disabled:void 0,onClick:C,onFocus:P,onPointerEnter:k,onMouseEnter:k,onPointerMove:A,onMouseMove:A,onPointerLeave:L,onMouseLeave:L},theirProps:l,slot:F,defaultTag:dW,name:"Combobox.Option"})}let hW=zi(tW),pW=zi(oW),gW=zi(rW),mW=zi(aW),vW=zi(uW),bW=zi(fW),Dl=Object.assign(hW,{Input:gW,Button:pW,Label:mW,Options:vW,Option:bW});function w0(){let e=m.useRef(!1);return wn(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function yW(e=0){let[t,n]=m.useState(e),r=w0(),i=m.useCallback(l=>{r.current&&n(c=>c|l)},[t,r]),o=m.useCallback(l=>!!(t&l),[t]),s=m.useCallback(l=>{r.current&&n(c=>c&~l)},[n,r]),a=m.useCallback(l=>{r.current&&n(c=>c^l)},[n]);return{flags:t,addFlag:i,hasFlag:o,removeFlag:s,toggleFlag:a}}function xW(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function _0(e,...t){e&&t.length>0&&e.classList.add(...t)}function S0(e,...t){e&&t.length>0&&e.classList.remove(...t)}function wW(e,t){let n=ua();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:i}=getComputedStyle(e),[o,s]=[r,i].map(l=>{let[c=0]=l.split(",").filter(Boolean).map(d=>d.includes("ms")?parseFloat(d):parseFloat(d)*1e3).sort((d,f)=>f-d);return c}),a=o+s;if(a!==0){n.group(c=>{c.setTimeout(()=>{t(),c.dispose()},a),c.addEventListener(e,"transitionrun",d=>{d.target===d.currentTarget&&c.dispose()})});let l=n.addEventListener(e,"transitionend",c=>{c.target===c.currentTarget&&(t(),l())})}else t();return n.add(()=>t()),n.dispose}function _W(e,t,n,r){let i=n?"enter":"leave",o=ua(),s=r!==void 0?xW(r):()=>{};i==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let a=$n(i,{enter:()=>t.enter,leave:()=>t.leave}),l=$n(i,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),c=$n(i,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return S0(e,...t.base,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),_0(e,...t.base,...a,...c),o.nextFrame(()=>{S0(e,...t.base,...a,...c),_0(e,...t.base,...a,...l),wW(e,()=>(S0(e,...t.base,...a),_0(e,...t.base,...t.entered),s()))}),o.dispose}function SW({immediate:e,container:t,direction:n,classes:r,onStart:i,onStop:o}){let s=w0(),a=Tu(),l=ji(n);wn(()=>{e&&(l.current="enter")},[e]),wn(()=>{let c=ua();a.add(c.dispose);let d=t.current;if(d&&l.current!=="idle"&&s.current)return c.dispose(),i.current(l.current),c.add(_W(d,r.current,l.current==="enter",()=>{c.dispose(),o.current(l.current)})),c.dispose},[n])}function ts(e=""){return e.split(/\s+/).filter(t=>t.length>1)}let Xh=m.createContext(null);Xh.displayName="TransitionContext";var CW=(e=>(e.Visible="visible",e.Hidden="hidden",e))(CW||{});function EW(){let e=m.useContext(Xh);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function OW(){let e=m.useContext(Qh);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Qh=m.createContext(null);Qh.displayName="NestingContext";function Jh(e){return"children"in e?Jh(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function $O(e,t){let n=ji(e),r=m.useRef([]),i=w0(),o=Tu(),s=mt((p,v=es.Hidden)=>{let y=r.current.findIndex(({el:x})=>x===p);y!==-1&&($n(v,{[es.Unmount](){r.current.splice(y,1)},[es.Hidden](){r.current[y].state="hidden"}}),o.microTask(()=>{var x;!Jh(r)&&i.current&&((x=n.current)==null||x.call(n))}))}),a=mt(p=>{let v=r.current.find(({el:y})=>y===p);return v?v.state!=="visible"&&(v.state="visible"):r.current.push({el:p,state:"visible"}),()=>s(p,es.Unmount)}),l=m.useRef([]),c=m.useRef(Promise.resolve()),d=m.useRef({enter:[],leave:[],idle:[]}),f=mt((p,v,y)=>{l.current.splice(0),t&&(t.chains.current[v]=t.chains.current[v].filter(([x])=>x!==p)),t==null||t.chains.current[v].push([p,new Promise(x=>{l.current.push(x)})]),t==null||t.chains.current[v].push([p,new Promise(x=>{Promise.all(d.current[v].map(([w,S])=>S)).then(()=>x())})]),v==="enter"?c.current=c.current.then(()=>t==null?void 0:t.wait.current).then(()=>y(v)):y(v)}),g=mt((p,v,y)=>{Promise.all(d.current[v].splice(0).map(([x,w])=>w)).then(()=>{var x;(x=l.current.shift())==null||x()}).then(()=>y(v))});return m.useMemo(()=>({children:r,register:a,unregister:s,onStart:f,onStop:g,wait:c,chains:d}),[a,s,r,f,g,d,c])}function PW(){}let kW=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function FO(e){var t;let n={};for(let r of kW)n[r]=(t=e[r])!=null?t:PW;return n}function MW(e){let t=m.useRef(FO(e));return m.useEffect(()=>{t.current=FO(e)},[e]),t}let DW="div",jO=Yh.RenderStrategy;function TW(e,t){var n,r;let{beforeEnter:i,afterEnter:o,beforeLeave:s,afterLeave:a,enter:l,enterFrom:c,enterTo:d,entered:f,leave:g,leaveFrom:p,leaveTo:v,...y}=e,x=m.useRef(null),w=da(x,t),S=(n=y.unmount)==null||n?es.Unmount:es.Hidden,{show:C,appear:P,initial:O}=EW(),[k,A]=m.useState(C?"visible":"hidden"),L=OW(),{register:F,unregister:j}=L;m.useEffect(()=>F(x),[F,x]),m.useEffect(()=>{if(S===es.Hidden&&x.current){if(C&&k!=="visible"){A("visible");return}return $n(k,{hidden:()=>j(x),visible:()=>F(x)})}},[k,x,F,j,C,S]);let B=ji({base:ts(y.className),enter:ts(l),enterFrom:ts(c),enterTo:ts(d),entered:ts(f),leave:ts(g),leaveFrom:ts(p),leaveTo:ts(v)}),V=MW({beforeEnter:i,afterEnter:o,beforeLeave:s,afterLeave:a}),K=f0();m.useEffect(()=>{if(K&&k==="visible"&&x.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[x,k,K]);let Y=O&&!P,$=P&&C&&O,Z=!K||Y?"idle":C?"enter":"leave",U=yW(0),ie=mt(X=>$n(X,{enter:()=>{U.addFlag(Tr.Opening),V.current.beforeEnter()},leave:()=>{U.addFlag(Tr.Closing),V.current.beforeLeave()},idle:()=>{}})),le=mt(X=>$n(X,{enter:()=>{U.removeFlag(Tr.Opening),V.current.afterEnter()},leave:()=>{U.removeFlag(Tr.Closing),V.current.afterLeave()},idle:()=>{}})),M=$O(()=>{A("hidden"),j(x)},L),H=m.useRef(!1);SW({immediate:$,container:x,classes:B,direction:Z,onStart:ji(X=>{H.current=!0,M.onStart(x,X,ie)}),onStop:ji(X=>{H.current=!1,M.onStop(x,X,le),X==="leave"&&!Jh(M)&&(A("hidden"),j(x))})});let ne=y,N={ref:w};return $?ne={...ne,className:Gh(y.className,...B.current.enter,...B.current.enterFrom)}:H.current&&(ne.className=Gh(y.className,(r=x.current)==null?void 0:r.className),ne.className===""&&delete ne.className),m.createElement(Qh.Provider,{value:M},m.createElement(TO,{value:$n(k,{visible:Tr.Open,hidden:Tr.Closed})|U.flags},xo({ourProps:N,theirProps:ne,defaultTag:DW,features:jO,visible:k==="visible",name:"Transition.Child"})))}function AW(e,t){let{show:n,appear:r=!1,unmount:i=!0,...o}=e,s=m.useRef(null),a=da(s,t);f0();let l=v0();if(n===void 0&&l!==null&&(n=(l&Tr.Open)===Tr.Open),![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,d]=m.useState(n?"visible":"hidden"),f=$O(()=>{d("hidden")}),[g,p]=m.useState(!0),v=m.useRef([n]);wn(()=>{g!==!1&&v.current[v.current.length-1]!==n&&(v.current.push(n),p(!1))},[v,n]);let y=m.useMemo(()=>({show:n,appear:r,initial:g}),[n,r,g]);m.useEffect(()=>{if(n)d("visible");else if(!Jh(f))d("hidden");else{let C=s.current;if(!C)return;let P=C.getBoundingClientRect();P.x===0&&P.y===0&&P.width===0&&P.height===0&&d("hidden")}},[n,f]);let x={unmount:i},w=mt(()=>{var C;g&&p(!1),(C=e.beforeEnter)==null||C.call(e)}),S=mt(()=>{var C;g&&p(!1),(C=e.beforeLeave)==null||C.call(e)});return m.createElement(Qh.Provider,{value:f},m.createElement(Xh.Provider,{value:y},xo({ourProps:{...x,as:m.Fragment,children:m.createElement(zO,{ref:a,...x,...o,beforeEnter:w,beforeLeave:S})},theirProps:{},defaultTag:m.Fragment,features:jO,visible:c==="visible",name:"Transition"})))}function IW(e,t){let n=m.useContext(Xh)!==null,r=v0()!==null;return m.createElement(m.Fragment,null,!n&&r?m.createElement(C0,{ref:t,...e}):m.createElement(zO,{ref:t,...e}))}let C0=zi(AW),zO=zi(TW),NW=zi(IW),RW=Object.assign(C0,{Child:NW,Root:C0});const E0=["text","varchar","nvarchar","nvarchar2","char","character","nchar","char varying","nchar varying","character varying","string"],Tl=["number","integer","int","bigint","smallint","tinyint","byteint","numeric","decimal","dec","double","real","double precision","float","float4","float8"],Nu=["date","datetime","time","timestamp","timestamp without time zone"],BO=["boolean"];function VO(e,t,n){const{measures:r,dimensions:i}=e,o=r==null?void 0:r.map(c=>`${c.calc}(${c.name}) as ${c.calc}_${c.name}`).join(", "),s=(i==null?void 0:i.join(", "))||"";let a="";const l=P0(t,n);if(o&&s)return a=`SELECT ${s}, COUNT(*), ${o} FROM ${l} GROUP BY ${s} ORDER BY ${s} DESC LIMIT 100`,a;if(!o&&s)return a=`SELECT ${s}, COUNT(*) FROM ${l} GROUP BY ${s} ORDER BY ${s} DESC LIMIT 100`,a;if(o&&!s)return a=`SELECT ${o} FROM ${l}`,a}function HO(e,t,n="AVG"){var i,o,s,a;let r={};return E0.includes(e.data_type)&&(((i=t.dimensions)==null?void 0:i.includes(e.column_name))?r={...t,dimensions:(o=t.dimensions)==null?void 0:o.filter(c=>c!==e.column_name)}:r={...t,dimensions:[...t.dimensions||[],e.column_name]}),Tl.includes(e.data_type)&&(((s=t.measures)==null?void 0:s.some(c=>c.name===e.column_name&&c.calc===n))?r={...t,measures:(a=t.measures)==null?void 0:a.filter(c=>!(c.name===e.column_name&&c.calc===n))}:r={...t,measures:[...t.measures||[],{name:e.column_name,calc:n||"SUM"}]}),r}function O0(e){return E0.includes(e.dataType)?"string":Tl.includes(e.dataType)?"number":Nu.includes(e.dataType)?"date":BO.includes(e.dataType)?"boolean":"string"}function LW(e,t){const{dimensions:n,measures:r}=t,i=n==null?void 0:n.includes(e.column_name),o=r==null?void 0:r.some(s=>s.name===e.column_name);return i||o}function P0(e,t){return e==="public"?t:e?`${e}.${t}`:`${t}`}function $W(e){const t=/(>=|<=|>|<|=)/,n=e.match(t);if(n){const r=n[0],[i,o]=e.split(r);return{operation:r,value:o.trim()}}else return null}const WO=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,qO=Gd,UO=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return qO(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=t,s=Object.keys(i).map(c=>{const d=n==null?void 0:n[c],f=o==null?void 0:o[c];if(d===null)return null;const g=WO(d)||WO(f);return i[c][g]}),a=n&&Object.entries(n).reduce((c,d)=>{let[f,g]=d;return g===void 0||(c[f]=g),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,d)=>{let{class:f,className:g,...p}=d;return Object.entries(p).every(v=>{let[y,x]=v;return Array.isArray(x)?x.includes({...o,...a}[y]):{...o,...a}[y]===x})?[...c,f,g]:c},[]);return qO(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},k0=UO("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),st=ue.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},o)=>{const s=r?no:"button";return _.jsx(s,{className:Pe(k0({variant:t,size:n,className:e})),ref:o,...i})});st.displayName="Button";function FW({filter:e}){const[t,n]=m.useState([]),[r,i]=m.useState(""),[o,s]=m.useState(""),a=m.useRef(null),l=ge(k=>k.authToken),c=ge(k=>k.filterValues),d=ge(k=>k.actions.addOrUpdateFilterValue),f=ge(k=>k.actions.removeFilterValue),{data:g,isLoading:p,isFetching:v,isError:y,refetch:x}=Sr({queryKey:[e.sql],queryFn:()=>Is("https://semaphor.cloud/api/v1/query",(l==null?void 0:l.accessToken)||"",{connection_id:e.connectionId,sql:e.sql}),enabled:!!e.sql&&!!e.connectionId&&!!e.database}),w=m.useMemo(()=>{var k;return(k=g==null?void 0:g.records)==null?void 0:k.map(A=>({id:A[e.column.toLowerCase()],value:A[e.column.toLowerCase()]}))},[g,e.column]);m.useEffect(()=>{if(c){const k=c.find(A=>A.filterId===e.id);if(!k){n([]);return}if(k.operation==="in"){const A=w==null?void 0:w.filter(L=>k.values.includes(L.value));A&&n(A)}else i(`${k.operation} ${k.values[0]}`)}},[g]),m.useEffect(()=>{if(c&&!c.find(A=>A.filterId===e.id)){n([]);return}},[c,e.id]);function S(k){console.log("custom input");const A=$W(k[0].toString());if(!(A!=null&&A.value)||!(A!=null&&A.operation))return;const L={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:O0(e),name:e.column,operation:A.operation,values:[A.value]};d(L)}function C(k){if(console.log("onComboBoxChange",k),k.length===1&&w.find(L=>L.value===k[0].value)===void 0){S(k);return}if(n(k),k.length===0){f(e.id);return}const A={filterId:e.id,connectionType:e.database==="NA"?"api":"database",name:e.column,valueType:O0(e),operation:"in",values:k.map(L=>L.value)};d(A)}function P(){var k;i(""),f(e.id),console.log(e.id),(k=a.current)==null||k.click()}if(p)return _.jsx("div",{children:_.jsx(cf,{className:" bg-foreground/10 h-8 w-[180px]"})});if(y)return _.jsx("div",{className:"bg-muted h-8 w-[180px] px-2",children:"Error"});if(!g)return null;let O=[];return Tl.includes(e.dataType)?O=w:O=o===""?w:w.filter(k=>k.value.toLowerCase().replace(/\s+/g,"").includes(o.toLowerCase().replace(/\s+/g,""))),_.jsx(Dl,{value:t,onChange:C,multiple:!0,children:_.jsxs("div",{className:"relative",children:[_.jsxs("div",{className:" border relative w-full cursor-default overflow-hidden rounded-sm bg-background text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-background/75 focus-visible:ring-offset-2 sm:text-sm",children:[_.jsx(Dl.Input,{className:"flex h-8 w-full rounded border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50",displayValue:k=>k.map(L=>L.value).join(", ")||r,onChange:k=>{i(k.target.value),s(k.target.value)}}),_.jsx(Dl.Button,{ref:a,className:"absolute bg-background pl-1 inset-y-0 right-0 flex items-center pr-2",children:_.jsx($j,{className:"h-5 w-5 text-gray-400","aria-hidden":"true"})})]}),_.jsx(RW,{as:m.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",afterLeave:()=>s(""),children:_.jsxs(Dl.Options,{className:" z-10 absolute mt-1 max-h-60 w-full overflow-auto rounded-sm bg-background py-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-none sm:text-sm border",children:[Tl.includes(e.dataType)&&_.jsxs(Dl.Option,{value:r,className:" flex items-center px-3 justify-between gap-2 py-2",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("span",{className:" font-thin",children:"#"}),_.jsx("span",{children:r})]}),r&&_.jsx(st,{variant:"link",className:" h-4 w-3 text-foreground/50 hover:text-foreground/100 cursor-pointer",onClick:k=>{k.stopPropagation(),P()},children:"Clear"})]}),O.length===0&&o!==""?_.jsx("div",{className:"relative cursor-default select-none px-4 py-2 text-gray-700",children:"Nothing found."}):O.map(k=>_.jsx(Dl.Option,{className:({active:A})=>`relative cursor-default select-none py-2 pl-10 pr-4 ${A?"bg-muted ":"text-foreground-900"}`,value:k,children:({selected:A,active:L})=>(A&&console.log("record",k,A),_.jsxs(_.Fragment,{children:[_.jsx("span",{className:`block truncate ${A?"font-medium":"font-normal"}`,children:typeof k.value=="boolean"?k.value?"True":"False":k.value}),A?_.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 text-foreground",children:_.jsx(XE,{className:"h-5 w-5","aria-hidden":"true"})}):null]}))},k.id))]})})]})})}const GO=m.forwardRef((e,t)=>m.createElement(Be.label,ae({},e,{ref:t,onMouseDown:n=>{var r;(r=e.onMouseDown)===null||r===void 0||r.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault()}}))),jW=UO("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),ns=ue.forwardRef(({className:e,...t},n)=>_.jsx(GO,{ref:n,className:Pe(jW(),e),...t}));ns.displayName=GO.displayName;function Ot(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function Ir(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function Zn(e,t){const n=Ot(e);return isNaN(t)?Ir(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function yi(e,t){const n=Ot(e);if(isNaN(t))return Ir(e,NaN);if(!t)return n;const r=n.getDate(),i=Ir(e,n.getTime());i.setMonth(n.getMonth()+t+1,0);const o=i.getDate();return r>=o?i:(n.setFullYear(i.getFullYear(),i.getMonth(),r),n)}const M0=6048e5,zW=864e5;let BW={};function Ru(){return BW}function Bi(e,t){var a,l,c,d;const n=Ru(),r=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((d=(c=n.locale)==null?void 0:c.options)==null?void 0:d.weekStartsOn)??0,i=Ot(e),o=i.getDay(),s=(o<r?7:0)+o-r;return i.setDate(i.getDate()-s),i.setHours(0,0,0,0),i}function pa(e){return Bi(e,{weekStartsOn:1})}function YO(e){const t=Ot(e),n=t.getFullYear(),r=Ir(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const i=pa(r),o=Ir(e,0);o.setFullYear(n,0,4),o.setHours(0,0,0,0);const s=pa(o);return t.getTime()>=i.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function Al(e){const t=Ot(e);return t.setHours(0,0,0,0),t}function Zh(e){const t=Ot(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Vi(e,t){const n=Al(e),r=Al(t),i=+n-Zh(n),o=+r-Zh(r);return Math.round((i-o)/zW)}function VW(e){const t=YO(e),n=Ir(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),pa(n)}function D0(e,t){const n=t*7;return Zn(e,n)}function HW(e,t){return yi(e,t*12)}function WW(e){let t;return e.forEach(function(n){const r=Ot(n);(t===void 0||t<r||isNaN(Number(r)))&&(t=r)}),t||new Date(NaN)}function qW(e){let t;return e.forEach(n=>{const r=Ot(n);(!t||t>r||isNaN(+r))&&(t=r)}),t||new Date(NaN)}function dr(e,t){const n=Al(e),r=Al(t);return+n==+r}function T0(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function UW(e){if(!T0(e)&&typeof e!="number")return!1;const t=Ot(e);return!isNaN(Number(t))}function Lu(e,t){const n=Ot(e),r=Ot(t),i=n.getFullYear()-r.getFullYear(),o=n.getMonth()-r.getMonth();return i*12+o}function GW(e,t,n){const r=Bi(e,n),i=Bi(t,n),o=+r-Zh(r),s=+i-Zh(i);return Math.round((o-s)/M0)}function A0(e){const t=Ot(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function fr(e){const t=Ot(e);return t.setDate(1),t.setHours(0,0,0,0),t}function KO(e){const t=Ot(e),n=Ir(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function I0(e,t){var a,l,c,d;const n=Ru(),r=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((d=(c=n.locale)==null?void 0:c.options)==null?void 0:d.weekStartsOn)??0,i=Ot(e),o=i.getDay(),s=(o<r?-7:0)+6-(o-r);return i.setDate(i.getDate()+s),i.setHours(23,59,59,999),i}function XO(e){return I0(e,{weekStartsOn:1})}const YW={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},KW=(e,t,n)=>{let r;const i=YW[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function N0(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const XW={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},QW={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},JW={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ZW={date:N0({formats:XW,defaultWidth:"full"}),time:N0({formats:QW,defaultWidth:"full"}),dateTime:N0({formats:JW,defaultWidth:"full"})},e6={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},t6=(e,t,n,r)=>e6[e];function $u(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):s;i=e.formattingValues[a]||e.formattingValues[s]}else{const s=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[a]||e.values[s]}const o=e.argumentCallback?e.argumentCallback(t):t;return i[o]}}const n6={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},r6={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},i6={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},o6={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},s6={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},a6={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},l6={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:$u({values:n6,defaultWidth:"wide"}),quarter:$u({values:r6,defaultWidth:"wide",argumentCallback:e=>e-1}),month:$u({values:i6,defaultWidth:"wide"}),day:$u({values:o6,defaultWidth:"wide"}),dayPeriod:$u({values:s6,defaultWidth:"wide",formattingValues:a6,defaultFormattingWidth:"wide"})};function Fu(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;const s=o[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?u6(a,f=>f.test(s)):c6(a,f=>f.test(s));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const d=t.slice(s.length);return{value:c,rest:d}}}function c6(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function u6(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function d6(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],o=t.match(e.parsePattern);if(!o)return null;let s=e.valueCallback?e.valueCallback(o[0]):o[0];s=n.valueCallback?n.valueCallback(s):s;const a=t.slice(i.length);return{value:s,rest:a}}}const f6=/^(\d+)(th|st|nd|rd)?/i,h6=/\d+/i,p6={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},g6={any:[/^b/i,/^(a|c)/i]},m6={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},v6={any:[/1/i,/2/i,/3/i,/4/i]},b6={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},y6={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},x6={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},w6={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},_6={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},S6={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},C6={ordinalNumber:d6({matchPattern:f6,parsePattern:h6,valueCallback:e=>parseInt(e,10)}),era:Fu({matchPatterns:p6,defaultMatchWidth:"wide",parsePatterns:g6,defaultParseWidth:"any"}),quarter:Fu({matchPatterns:m6,defaultMatchWidth:"wide",parsePatterns:v6,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Fu({matchPatterns:b6,defaultMatchWidth:"wide",parsePatterns:y6,defaultParseWidth:"any"}),day:Fu({matchPatterns:x6,defaultMatchWidth:"wide",parsePatterns:w6,defaultParseWidth:"any"}),dayPeriod:Fu({matchPatterns:_6,defaultMatchWidth:"any",parsePatterns:S6,defaultParseWidth:"any"})},QO={code:"en-US",formatDistance:KW,formatLong:ZW,formatRelative:t6,localize:l6,match:C6,options:{weekStartsOn:0,firstWeekContainsDate:1}};function E6(e){const t=Ot(e);return Vi(t,KO(t))+1}function JO(e){const t=Ot(e),n=+pa(t)-+VW(t);return Math.round(n/M0)+1}function ZO(e,t){var d,f,g,p;const n=Ot(e),r=n.getFullYear(),i=Ru(),o=(t==null?void 0:t.firstWeekContainsDate)??((f=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??i.firstWeekContainsDate??((p=(g=i.locale)==null?void 0:g.options)==null?void 0:p.firstWeekContainsDate)??1,s=Ir(e,0);s.setFullYear(r+1,0,o),s.setHours(0,0,0,0);const a=Bi(s,t),l=Ir(e,0);l.setFullYear(r,0,o),l.setHours(0,0,0,0);const c=Bi(l,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function O6(e,t){var a,l,c,d;const n=Ru(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((d=(c=n.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)??1,i=ZO(e,t),o=Ir(e,0);return o.setFullYear(i,0,r),o.setHours(0,0,0,0),Bi(o,t)}function eP(e,t){const n=Ot(e),r=+Bi(n,t)-+O6(n,t);return Math.round(r/M0)+1}function Lt(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const rs={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Lt(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Lt(n+1,2)},d(e,t){return Lt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Lt(e.getHours()%12||12,t.length)},H(e,t){return Lt(e.getHours(),t.length)},m(e,t){return Lt(e.getMinutes(),t.length)},s(e,t){return Lt(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return Lt(i,t.length)}},Il={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},tP={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return rs.y(e,t)},Y:function(e,t,n,r){const i=ZO(e,r),o=i>0?i:1-i;if(t==="YY"){const s=o%100;return Lt(s,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):Lt(o,t.length)},R:function(e,t){const n=YO(e);return Lt(n,t.length)},u:function(e,t){const n=e.getFullYear();return Lt(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Lt(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Lt(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return rs.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Lt(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=eP(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):Lt(i,t.length)},I:function(e,t,n){const r=JO(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Lt(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):rs.d(e,t)},D:function(e,t,n){const r=E6(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Lt(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return Lt(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return Lt(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return Lt(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=Il.noon:r===0?i=Il.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=Il.evening:r>=12?i=Il.afternoon:r>=4?i=Il.morning:i=Il.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return rs.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):rs.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Lt(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Lt(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):rs.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):rs.s(e,t)},S:function(e,t){return rs.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return rP(r);case"XXXX":case"XX":return ga(r);case"XXXXX":case"XXX":default:return ga(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return rP(r);case"xxxx":case"xx":return ga(r);case"xxxxx":case"xxx":default:return ga(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+nP(r,":");case"OOOO":default:return"GMT"+ga(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+nP(r,":");case"zzzz":default:return"GMT"+ga(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return Lt(r,t.length)},T:function(e,t,n){const r=e.getTime();return Lt(r,t.length)}};function nP(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),o=r%60;return o===0?n+String(i):n+String(i)+t+Lt(o,2)}function rP(e,t){return e%60===0?(e>0?"-":"+")+Lt(Math.abs(e)/60,2):ga(e,t)}function ga(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Lt(Math.trunc(r/60),2),o=Lt(r%60,2);return n+i+t+o}const iP=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},oP=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},P6={p:oP,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return iP(e,t);let o;switch(r){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",iP(r,t)).replace("{{time}}",oP(i,t))}},k6=/^D+$/,M6=/^Y+$/,D6=["D","DD","YY","YYYY"];function T6(e){return k6.test(e)}function A6(e){return M6.test(e)}function I6(e,t,n){const r=N6(e,t,n);if(console.warn(r),D6.includes(e))throw new RangeError(r)}function N6(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const R6=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,L6=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,$6=/^'([^]*?)'?$/,F6=/''/g,j6=/[a-zA-Z]/;function Hi(e,t,n){var d,f,g,p,v,y,x,w;const r=Ru(),i=(n==null?void 0:n.locale)??r.locale??QO,o=(n==null?void 0:n.firstWeekContainsDate)??((f=(d=n==null?void 0:n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??r.firstWeekContainsDate??((p=(g=r.locale)==null?void 0:g.options)==null?void 0:p.firstWeekContainsDate)??1,s=(n==null?void 0:n.weekStartsOn)??((y=(v=n==null?void 0:n.locale)==null?void 0:v.options)==null?void 0:y.weekStartsOn)??r.weekStartsOn??((w=(x=r.locale)==null?void 0:x.options)==null?void 0:w.weekStartsOn)??0,a=Ot(e);if(!UW(a))throw new RangeError("Invalid time value");let l=t.match(L6).map(S=>{const C=S[0];if(C==="p"||C==="P"){const P=P6[C];return P(S,i.formatLong)}return S}).join("").match(R6).map(S=>{if(S==="''")return{isToken:!1,value:"'"};const C=S[0];if(C==="'")return{isToken:!1,value:z6(S)};if(tP[C])return{isToken:!0,value:S};if(C.match(j6))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");return{isToken:!1,value:S}});i.localize.preprocessor&&(l=i.localize.preprocessor(a,l));const c={firstWeekContainsDate:o,weekStartsOn:s,locale:i};return l.map(S=>{if(!S.isToken)return S.value;const C=S.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&A6(C)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&T6(C))&&I6(C,t,String(e));const P=tP[C[0]];return P(a,C,i.localize,c)}).join("")}function z6(e){const t=e.match($6);return t?t[1].replace(F6,"'"):e}function B6(e){const t=Ot(e),n=t.getFullYear(),r=t.getMonth(),i=Ir(e,0);return i.setFullYear(n,r+1,0),i.setHours(0,0,0,0),i.getDate()}function V6(e){return Math.trunc(+Ot(e)/1e3)}function H6(e){const t=Ot(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function W6(e,t){return GW(H6(e),fr(e),t)+1}function R0(e,t){const n=Ot(e),r=Ot(t);return n.getTime()>r.getTime()}function sP(e,t){const n=Ot(e),r=Ot(t);return+n<+r}function L0(e,t){const n=Ot(e),r=Ot(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function q6(e,t){const n=Ot(e),r=Ot(t);return n.getFullYear()===r.getFullYear()}function $0(e,t){return Zn(e,-t)}function F0(e,t){const n=Ot(e),r=n.getFullYear(),i=n.getDate(),o=Ir(e,0);o.setFullYear(r,t,15),o.setHours(0,0,0,0);const s=B6(o);return n.setMonth(t,Math.min(i,s)),n}function aP(e,t){const n=Ot(e);return isNaN(+n)?Ir(e,NaN):(n.setFullYear(t),n)}var Ue=function(){return Ue=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Ue.apply(this,arguments)};function U6(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function lP(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var j0={exports:{}},ju={};/**
|
|
352
352
|
* @license React
|
|
353
353
|
* react-jsx-runtime.development.js
|
|
354
354
|
*
|
|
@@ -414,8 +414,8 @@ Check the top-level render call using <`+se+">.")}return G}}function ja(D,G){{if
|
|
|
414
414
|
`)},nG=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r,o=ue.useMemo(function(){return ZU(i)},[i]);return ue.createElement(eG,{styles:tG(o,!t,i,n?"":"!important")})},ry=!1;if(typeof window<"u")try{var dp=Object.defineProperty({},"passive",{get:function(){return ry=!0,!0}});window.addEventListener("test",dp,dp),window.removeEventListener("test",dp,dp)}catch{ry=!1}var Rl=ry?{passive:!1}:!1,rG=function(e){return e.tagName==="TEXTAREA"},$P=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!rG(e)&&n[t]==="visible")},iG=function(e){return $P(e,"overflowY")},oG=function(e){return $P(e,"overflowX")},FP=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=jP(e,n);if(r){var i=zP(e,n),o=i[1],s=i[2];if(o>s)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},sG=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},aG=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},jP=function(e,t){return e==="v"?iG(t):oG(t)},zP=function(e,t){return e==="v"?sG(t):aG(t)},lG=function(e,t){return e==="h"&&t==="rtl"?-1:1},cG=function(e,t,n,r,i){var o=lG(e,window.getComputedStyle(t).direction),s=o*r,a=n.target,l=t.contains(a),c=!1,d=s>0,f=0,g=0;do{var p=zP(e,a),v=p[0],y=p[1],x=p[2],w=y-x-o*v;(v||w)&&jP(e,a)&&(f+=w,g+=v),a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(d&&(i&&f===0||!i&&s>f)||!d&&(i&&g===0||!i&&-s>g))&&(c=!0),c},fp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},BP=function(e){return[e.deltaX,e.deltaY]},VP=function(e){return e&&"current"in e?e.current:e},uG=function(e,t){return e[0]===t[0]&&e[1]===t[1]},dG=function(e){return`
|
|
415
415
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
416
416
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
417
|
-
`)},fG=0,Ll=[];function hG(e){var t=ue.useRef([]),n=ue.useRef([0,0]),r=ue.useRef(),i=ue.useState(fG++)[0],o=ue.useState(function(){return LP()})[0],s=ue.useRef(e);ue.useEffect(function(){s.current=e},[e]),ue.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var y=RU([e.lockRef.current],(e.shards||[]).map(VP),!0).filter(Boolean);return y.forEach(function(x){return x.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),y.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=ue.useCallback(function(y,x){if("touches"in y&&y.touches.length===2)return!s.current.allowPinchZoom;var w=fp(y),S=n.current,C="deltaX"in y?y.deltaX:S[0]-w[0],P="deltaY"in y?y.deltaY:S[1]-w[1],O,k=y.target,A=Math.abs(C)>Math.abs(P)?"h":"v";if("touches"in y&&A==="h"&&k.type==="range")return!1;var L=FP(A,k);if(!L)return!0;if(L?O=A:(O=A==="v"?"h":"v",L=FP(A,k)),!L)return!1;if(!r.current&&"changedTouches"in y&&(C||P)&&(r.current=O),!O)return!0;var F=r.current||O;return cG(F,x,y,F==="h"?C:P,!0)},[]),l=ue.useCallback(function(y){var x=y;if(!(!Ll.length||Ll[Ll.length-1]!==o)){var w="deltaY"in x?BP(x):fp(x),S=t.current.filter(function(O){return O.name===x.type&&O.target===x.target&&uG(O.delta,w)})[0];if(S&&S.should){x.cancelable&&x.preventDefault();return}if(!S){var C=(s.current.shards||[]).map(VP).filter(Boolean).filter(function(O){return O.contains(x.target)}),P=C.length>0?a(x,C[0]):!s.current.noIsolation;P&&x.cancelable&&x.preventDefault()}}},[]),c=ue.useCallback(function(y,x,w,S){var C={name:y,delta:x,target:w,should:S};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(P){return P!==C})},1)},[]),d=ue.useCallback(function(y){n.current=fp(y),r.current=void 0},[]),f=ue.useCallback(function(y){c(y.type,BP(y),y.target,a(y,e.lockRef.current))},[]),g=ue.useCallback(function(y){c(y.type,fp(y),y.target,a(y,e.lockRef.current))},[]);ue.useEffect(function(){return Ll.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:g}),document.addEventListener("wheel",l,Rl),document.addEventListener("touchmove",l,Rl),document.addEventListener("touchstart",d,Rl),function(){Ll=Ll.filter(function(y){return y!==o}),document.removeEventListener("wheel",l,Rl),document.removeEventListener("touchmove",l,Rl),document.removeEventListener("touchstart",d,Rl)}},[]);var p=e.removeScrollBar,v=e.inert;return ue.createElement(ue.Fragment,null,v?ue.createElement(o,{styles:dG(i)}):null,p?ue.createElement(nG,{gapMode:"margin"}):null)}const pG=WU(NP,hG);var HP=ue.forwardRef(function(e,t){return ue.createElement(up,Wi({},e,{ref:t,sideCar:pG}))});HP.classNames=up.classNames;const hp=HP,WP="Popover",[qP,Jde]=Pn(WP,[Fi]),iy=Fi(),[gG,$l]=qP(WP),mG=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!1}=e,a=iy(t),l=m.useRef(null),[c,d]=m.useState(!1),[f=!1,g]=Qn({prop:r,defaultProp:i,onChange:o});return m.createElement(Eu,a,m.createElement(gG,{scope:t,contentId:or(),triggerRef:l,open:f,onOpenChange:g,onOpenToggle:m.useCallback(()=>g(p=>!p),[g]),hasCustomAnchor:c,onCustomAnchorAdd:m.useCallback(()=>d(!0),[]),onCustomAnchorRemove:m.useCallback(()=>d(!1),[]),modal:s},n))},vG="PopoverTrigger",bG=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=$l(vG,n),o=iy(n),s=et(t,i.triggerRef),a=m.createElement(Be.button,ae({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":YP(i.open)},r,{ref:s,onClick:Ce(e.onClick,i.onOpenToggle)}));return i.hasCustomAnchor?a:m.createElement(Ou,ae({asChild:!0},o),a)}),UP="PopoverPortal",[yG,xG]=qP(UP,{forceMount:void 0}),wG=e=>{const{__scopePopover:t,forceMount:n,children:r,container:i}=e,o=$l(UP,t);return m.createElement(yG,{scope:t,forceMount:n},m.createElement(vn,{present:n||o.open},m.createElement(Dh,{asChild:!0,container:i},r)))},Wu="PopoverContent",_G=m.forwardRef((e,t)=>{const n=xG(Wu,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,o=$l(Wu,e.__scopePopover);return m.createElement(vn,{present:r||o.open},o.modal?m.createElement(SG,ae({},i,{ref:t})):m.createElement(CG,ae({},i,{ref:t})))}),SG=m.forwardRef((e,t)=>{const n=$l(Wu,e.__scopePopover),r=m.useRef(null),i=et(t,r),o=m.useRef(!1);return m.useEffect(()=>{const s=r.current;if(s)return ap(s)},[]),m.createElement(hp,{as:no,allowPinchZoom:!0},m.createElement(GP,ae({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ce(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),o.current||(a=n.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:Ce(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;o.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Ce(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})))}),CG=m.forwardRef((e,t)=>{const n=$l(Wu,e.__scopePopover),r=m.useRef(!1),i=m.useRef(!1);return m.createElement(GP,ae({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s;if((s=e.onCloseAutoFocus)===null||s===void 0||s.call(e,o),!o.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),o.preventDefault()}r.current=!1,i.current=!1},onInteractOutside:o=>{var s,a;(s=e.onInteractOutside)===null||s===void 0||s.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}}))}),GP=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:d,...f}=e,g=$l(Wu,n),p=iy(n);return rp(),m.createElement(ip,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o},m.createElement(_l,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>g.onOpenChange(!1)},m.createElement(Pu,ae({"data-state":YP(g.open),role:"dialog",id:g.contentId},p,f,{ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}}))))});function YP(e){return e?"open":"closed"}const EG=mG,OG=bG,PG=wG,KP=_G,pp=EG,gp=OG,qu=ue.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},i)=>_.jsx(PG,{children:_.jsx(KP,{ref:i,align:t,sideOffset:n,className:Pe("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));qu.displayName=KP.displayName;function kG({filter:e,className:t}){const[n,r]=m.useState(!1),[i,o]=m.useState(),[s,a]=m.useState(),l=ge(C=>C.filterValues),c=ge(C=>C.authToken),d=ge(C=>C.actions.addOrUpdateFilterValue),f=ge(C=>C.actions.removeFilterValue),{data:g,isLoading:p,isFetching:v,isError:y,refetch:x}=Sr({queryKey:[e.sql],queryFn:()=>Is("https://semaphor.cloud/api/v1/query",(c==null?void 0:c.accessToken)||"",{connection_id:e.connectionId,sql:e.sql}),enabled:!!e.sql&&!!e.connectionId&&!!e.database});m.useEffect(()=>{var C;if(((C=g==null?void 0:g.records)==null?void 0:C.length)>0){const P=g.records[0];if(!P.min||!P.max)return;o({from:new Date(P.min),to:new Date(P.max)}),a({from:new Date(P.min),to:new Date(P.max)})}},[g]),m.useEffect(()=>{if(l&&!l.find(P=>P.filterId===e.id)){o(s);return}},[l,e.id,s]);function w(){f(e.id),o(s),r(!1)}function S(){if(!i)return;console.log(i);const C=[i==null?void 0:i.from,i==null?void 0:i.to];console.log(C);const P={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:O0(e),name:e.column,operation:"between",values:C};d(P),r(!1)}return p?_.jsx("div",{children:_.jsx(cf,{className:" bg-foreground/10 h-8 w-[250px]"})}):y?_.jsx("div",{className:"bg-muted h-8 w-[250px] px-2",children:"Error"}):g?_.jsx("div",{className:Pe("grid gap-2",t),children:_.jsxs(pp,{open:n,onOpenChange:r,children:[_.jsx(gp,{asChild:!0,children:_.jsxs(ot,{size:"sm",id:"date",variant:"outline",className:Pe("w-[250px] justify-start text-left font-normal rounded-sm h-[34px]",!i&&"text-muted-foreground"),children:[_.jsx(VB,{className:"mr-2 h-4 w-4"}),i!=null&&i.from?i.to?_.jsxs(_.Fragment,{children:[Hi(i.from,"LLL dd, y")," -"," ",Hi(i.to,"LLL dd, y")]}):Hi(i.from,"LLL dd, y"):_.jsx("span",{children:"Pick a date"})]})}),_.jsxs(qu,{className:"w-auto p-0",align:"start",children:[_.jsx(CP,{initialFocus:!0,mode:"range",defaultMonth:i==null?void 0:i.from,selected:i,onSelect:o,numberOfMonths:2}),_.jsxs("div",{className:"flex justify-end px-4 py-3 gap-2",children:[_.jsx(ot,{size:"sm",variant:"outline",onClick:S,children:"Apply"}),_.jsx(ot,{size:"sm",variant:"outline",onClick:w,children:"Clear"})]})]})]})}):null}function MG(){const e=ge(s=>s.dashboard.filters),t=ge(s=>s.isDashboardEditing),n=ge(s=>s.actions.removeFilter),r=ge(s=>s.actions.updateFilter),i=ge(s=>s.actions.removeFilterValue);if(!e)return null;const o=s=>Nu.includes(s.dataType)?_.jsx(kG,{filter:s}):_.jsx(FW,{filter:s});return _.jsx("section",{role:"dashboard-filters",className:" px-[10px] pt-2 grow w-full items-center flex gap-2 flex-wrap ",children:e.map(s=>_.jsxs("div",{children:[_.jsx(qc,{className:" my-1 ",text:s.title||s.column,onSave:a=>r({...s,title:a}),children:_.jsxs("div",{className:"flex items-center justify-between group mb-1",children:[_.jsxs("div",{className:"flex gap-1 items-center ",children:[_.jsx(ns,{className:" inline-block text-sm ",children:s.title}),t&&_.jsx(ia,{onClick:()=>{i(s.id),n(s.id)},className:"w-3 h-3 invisible text-muted-foreground group-hover:visible hover:text-foreground cursor-pointer"})]}),_.jsx("div",{onClick:()=>i(s.id),className:" text-xs invisible group-hover:visible group-hover:underline cursor-pointer text-muted-foreground hover:text-foreground",children:"Clear"})]})}),o(s)]},s.id))})}function XP(){const e=ge(i=>{var o;return(o=i.dashboard)==null?void 0:o.sheets});ge(i=>i.isDashboardEditing);const t=ge(i=>i.themeStyle);ge(i=>i.isVisualEditing);const n=ge(i=>i.selectedSheetId),r=ge(i=>i.actions.setSelectedSheetId);return ge(i=>i.actions.setSheetTitle),e?_.jsxs(o_,{role:"dashboard-tabs-container",className:Pe(" grow bg-muted dark:bg-foreground/5 ",t==null?void 0:t.dashboardTabsContainer),onValueChange:i=>{r(i)},value:n||e[0].id,children:[_.jsx(MG,{}),e==null?void 0:e.map(i=>_.jsx(hf,{className:"mt-0",value:i.id,children:_.jsx(oH,{})},i.id))]}):null}function QP({children:e}){const t=new PN;return _.jsx(GN,{defaultTheme:"dark",storageKey:"vite-ui-theme",children:_.jsx(RB,{delayDuration:0,children:_.jsx(AN,{client:t,children:e})})})}function JP(e){return _.jsx(QP,{children:_.jsx(Gw,{...e,children:_.jsx(XP,{})})})}var DG=Object.defineProperty,TG=(e,t,n)=>t in e?DG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mp=(e,t,n)=>(TG(e,typeof t!="symbol"?t+"":t,n),n);const AG={stringify:e=>e,parse:e=>e},IG={stringify:e=>`${e}`,parse:e=>parseFloat(e)},NG={stringify:e=>e?"true":"false",parse:e=>/^[ty1-9]/i.test(e)},RG={stringify:e=>e.name,parse:(e,t)=>{const n=(()=>{if(typeof window<"u"&&e in window)return window[e];if(typeof global<"u"&&e in global)return global[e]})();return typeof n=="function"?n.bind(t):void 0}},LG={stringify:e=>JSON.stringify(e),parse:e=>JSON.parse(e)},oy={string:AG,number:IG,boolean:NG,function:RG,json:LG},sy=Symbol.for("r2wc.render"),vp=Symbol.for("r2wc.connected"),ma=Symbol.for("r2wc.context"),os=Symbol.for("r2wc.props");function $G(e,t,n){var r,i,o;t.props||(t.props=e.propTypes?Object.keys(e.propTypes):[]);const s=(Array.isArray(t.props)?t.props.slice():Object.keys(t.props)).filter(f=>f!=="container"),a={},l={},c={};for(const f of s){a[f]=Array.isArray(t.props)?"string":t.props[f];const g=FG(f);l[f]=g,c[g]=f}class d extends HTMLElement{constructor(){super(),mp(this,r,!0),mp(this,i),mp(this,o,{}),mp(this,"container"),t.shadow?this.container=this.attachShadow({mode:t.shadow}):this.container=this,this[os].container=this.container;for(const g of s){const p=l[g],v=this.getAttribute(p),y=a[g],x=oy[y];v&&x!=null&&x.parse&&(this[os][g]=x.parse(v,this))}}static get observedAttributes(){return Object.keys(c)}connectedCallback(){this[vp]=!0,this[sy]()}disconnectedCallback(){this[vp]=!1,this[ma]&&n.unmount(this[ma]),delete this[ma]}attributeChangedCallback(g,p,v){const y=c[g],x=a[y],w=oy[x];y in a&&w!=null&&w.parse&&(this[os][y]=w.parse(v,this),this[sy]())}[(r=vp,i=ma,o=os,sy)](){this[vp]&&(this[ma]?n.update(this[ma],this[os]):this[ma]=n.mount(this.container,e,this[os]))}}for(const f of s){const g=l[f],p=a[f];Object.defineProperty(d.prototype,f,{enumerable:!0,configurable:!0,get(){return this[os][f]},set(v){this[os][f]=v;const y=oy[p];if(y!=null&&y.stringify){const x=y.stringify(v);this.getAttribute(g)!==x&&this.setAttribute(g,x)}}})}return d}function FG(e=""){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function jG(e,t,n){const r=nf(e),i=m.createElement(t,n);return r.render(i),{root:r,ReactComponent:t}}function zG({root:e,ReactComponent:t},n){const r=m.createElement(t,n);e.render(r)}function BG({root:e}){e.unmount()}function VG(e,t={}){return $G(e,t,{mount:jG,update:zG,unmount:BG})}const HG=VG(JP,{props:{id:"string",authToken:"json",currentTheme:"string",style:"json",onEvent:"function",onSave:"function",LoadingComponent:"function",ErrorComponent:"function"}});function ay(e){var t;return{...e,sheets:(t=e==null?void 0:e.sheets)==null?void 0:t.map(n=>{var r;return{...n,cards:(r=n==null?void 0:n.cards)==null?void 0:r.map(i=>ZP(i))}})}}function ZP(e){var t,n,r,i;return{...e,cfg:{...e.cfg,data:{...(t=e.cfg)==null?void 0:t.data,labels:[],datasets:(i=(r=(n=e.cfg)==null?void 0:n.data)==null?void 0:r.datasets)==null?void 0:i.map(o=>({...o,data:[]}))}},customCfg:WG(e.customCfg),data:[]}}function WG(e){var t,n;return e?{...e,data:{...e==null?void 0:e.data,labels:[],datasets:(n=(t=e==null?void 0:e.data)==null?void 0:t.datasets)==null?void 0:n.map(r=>({...r,data:[]}))}}:null}function ss(e){return`semaphor:bookmark:${e}`}const ek="Dialog",[tk,efe]=Pn(ek),[qG,wi]=tk(ek),UG=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!0}=e,a=m.useRef(null),l=m.useRef(null),[c=!1,d]=Qn({prop:r,defaultProp:i,onChange:o});return m.createElement(qG,{scope:t,triggerRef:a,contentRef:l,contentId:or(),titleId:or(),descriptionId:or(),open:c,onOpenChange:d,onOpenToggle:m.useCallback(()=>d(f=>!f),[d]),modal:s},n)},GG="DialogTrigger",YG=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=wi(GG,n),o=et(t,i.triggerRef);return m.createElement(Be.button,ae({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":cy(i.open)},r,{ref:o,onClick:Ce(e.onClick,i.onOpenToggle)}))}),nk="DialogPortal",[KG,rk]=tk(nk,{forceMount:void 0}),XG=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=wi(nk,t);return m.createElement(KG,{scope:t,forceMount:n},m.Children.map(r,s=>m.createElement(vn,{present:n||o.open},m.createElement(Dh,{asChild:!0,container:i},s))))},ly="DialogOverlay",QG=m.forwardRef((e,t)=>{const n=rk(ly,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=wi(ly,e.__scopeDialog);return o.modal?m.createElement(vn,{present:r||o.open},m.createElement(JG,ae({},i,{ref:t}))):null}),JG=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=wi(ly,n);return m.createElement(hp,{as:no,allowPinchZoom:!0,shards:[i.contentRef]},m.createElement(Be.div,ae({"data-state":cy(i.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),Uu="DialogContent",ZG=m.forwardRef((e,t)=>{const n=rk(Uu,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=wi(Uu,e.__scopeDialog);return m.createElement(vn,{present:r||o.open},o.modal?m.createElement(eY,ae({},i,{ref:t})):m.createElement(tY,ae({},i,{ref:t})))}),eY=m.forwardRef((e,t)=>{const n=wi(Uu,e.__scopeDialog),r=m.useRef(null),i=et(t,n.contentRef,r);return m.useEffect(()=>{const o=r.current;if(o)return ap(o)},[]),m.createElement(ik,ae({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ce(e.onCloseAutoFocus,o=>{var s;o.preventDefault(),(s=n.triggerRef.current)===null||s===void 0||s.focus()}),onPointerDownOutside:Ce(e.onPointerDownOutside,o=>{const s=o.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&o.preventDefault()}),onFocusOutside:Ce(e.onFocusOutside,o=>o.preventDefault())}))}),tY=m.forwardRef((e,t)=>{const n=wi(Uu,e.__scopeDialog),r=m.useRef(!1),i=m.useRef(!1);return m.createElement(ik,ae({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s;if((s=e.onCloseAutoFocus)===null||s===void 0||s.call(e,o),!o.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),o.preventDefault()}r.current=!1,i.current=!1},onInteractOutside:o=>{var s,a;(s=e.onInteractOutside)===null||s===void 0||s.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}}))}),ik=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...s}=e,a=wi(Uu,n),l=m.useRef(null),c=et(t,l);return rp(),m.createElement(m.Fragment,null,m.createElement(ip,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o},m.createElement(_l,ae({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":cy(a.open)},s,{ref:c,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),nY="DialogTitle",rY=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=wi(nY,n);return m.createElement(Be.h2,ae({id:i.titleId},r,{ref:t}))}),iY="DialogDescription",oY=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=wi(iY,n);return m.createElement(Be.p,ae({id:i.descriptionId},r,{ref:t}))}),sY="DialogClose",aY=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=wi(sY,n);return m.createElement(Be.button,ae({type:"button"},r,{ref:t,onClick:Ce(e.onClick,()=>i.onOpenChange(!1))}))});function cy(e){return e?"open":"closed"}const lY=UG,cY=YG,uY=XG,ok=QG,sk=ZG,ak=rY,lk=oY,dY=aY,uy=lY,dy=cY,fY=uY,ck=ue.forwardRef(({className:e,...t},n)=>_.jsx(ok,{ref:n,className:Pe("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));ck.displayName=ok.displayName;const bp=ue.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(fY,{children:[_.jsx(ck,{}),_.jsxs(sk,{ref:r,className:Pe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,_.jsxs(dY,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[_.jsx(tV,{className:"h-4 w-4"}),_.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));bp.displayName=sk.displayName;const yp=({className:e,...t})=>_.jsx("div",{className:Pe("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});yp.displayName="DialogHeader";const fy=({className:e,...t})=>_.jsx("div",{className:Pe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});fy.displayName="DialogFooter";const xp=ue.forwardRef(({className:e,...t},n)=>_.jsx(ak,{ref:n,className:Pe("text-lg font-semibold leading-none tracking-tight",e),...t}));xp.displayName=ak.displayName;const wp=ue.forwardRef(({className:e,...t},n)=>_.jsx(lk,{ref:n,className:Pe("text-sm text-muted-foreground",e),...t}));wp.displayName=lk.displayName;const Gu=ue.forwardRef(({className:e,type:t,...n},r)=>_.jsx("input",{type:t,className:Pe("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));Gu.displayName="Input";function hY(){const[e,t]=m.useState(""),[n,r]=m.useState(!1),[i,o]=m.useState(!1),s=ge(l=>l.dashboard);function a(){const l=ay(s),c=ss(s.id),d=JSON.parse(localStorage.getItem(c)||"[]");if(d.some(g=>g.name===e)){r(!0);return}d.push({name:e,template:l}),localStorage.setItem(c,JSON.stringify(d)),o(!1)}return _.jsxs(uy,{open:i,onOpenChange:o,children:[_.jsx(dy,{asChild:!0,children:_.jsxs(ot,{variant:"outline",className:"h-7 p-2",size:"sm",children:[_.jsx(q2,{className:" mr-2 h-4 w-4",strokeWidth:1.5}),"Add Lens"]})}),_.jsxs(bp,{className:"sm:max-w-[425px]",children:[_.jsxs(yp,{children:[_.jsx(xp,{children:"Add a Lens"}),_.jsx(wp,{children:"Lenses are private by default and are only visible to you."})]}),_.jsx("div",{className:"grid gap-4 py-4",children:_.jsxs("div",{className:"grid grid-cols-8 items-center gap-4",children:[_.jsx(ns,{className:"text-right",children:"Name"}),_.jsx(Gu,{value:e,onChange:l=>{n&&r(!1),t(l.target.value)},id:"name",className:"col-span-7 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"})]})}),n&&_.jsx("p",{className:"text-sm",children:"The bookmark name already exists. Use a differnet name."}),_.jsx(fy,{children:_.jsx(ot,{variant:"outline",type:"submit",disabled:!e,onClick:a,children:"Save"})})]})]})}const hy=["Enter"," "],pY=["ArrowDown","PageUp","Home"],uk=["ArrowUp","PageDown","End"],gY=[...pY,...uk],mY={ltr:[...hy,"ArrowRight"],rtl:[...hy,"ArrowLeft"]},vY={ltr:["ArrowLeft"],rtl:["ArrowRight"]},_p="Menu",[Yu,bY,yY]=df(_p),[va,dk]=Pn(_p,[yY,Fi,ol]),py=Fi(),fk=ol(),[xY,ba]=va(_p),[wY,Ku]=va(_p),_Y=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:s=!0}=e,a=py(t),[l,c]=m.useState(null),d=m.useRef(!1),f=xn(o),g=Fs(i);return m.useEffect(()=>{const p=()=>{d.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>d.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),m.createElement(Eu,a,m.createElement(xY,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:c},m.createElement(wY,{scope:t,onClose:m.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:g,modal:s},r)))},hk=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=py(n);return m.createElement(Ou,ae({},i,r,{ref:t}))}),pk="MenuPortal",[SY,gk]=va(pk,{forceMount:void 0}),CY=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,o=ba(pk,t);return m.createElement(SY,{scope:t,forceMount:n},m.createElement(vn,{present:n||o.open},m.createElement(Dh,{asChild:!0,container:i},r)))},_i="MenuContent",[EY,gy]=va(_i),OY=m.forwardRef((e,t)=>{const n=gk(_i,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=ba(_i,e.__scopeMenu),s=Ku(_i,e.__scopeMenu);return m.createElement(Yu.Provider,{scope:e.__scopeMenu},m.createElement(vn,{present:r||o.open},m.createElement(Yu.Slot,{scope:e.__scopeMenu},s.modal?m.createElement(PY,ae({},i,{ref:t})):m.createElement(kY,ae({},i,{ref:t})))))}),PY=m.forwardRef((e,t)=>{const n=ba(_i,e.__scopeMenu),r=m.useRef(null),i=et(t,r);return m.useEffect(()=>{const o=r.current;if(o)return ap(o)},[]),m.createElement(my,ae({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ce(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),kY=m.forwardRef((e,t)=>{const n=ba(_i,e.__scopeMenu);return m.createElement(my,ae({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),my=m.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:g,onDismiss:p,disableOutsideScroll:v,...y}=e,x=ba(_i,n),w=Ku(_i,n),S=py(n),C=fk(n),P=bY(n),[O,k]=m.useState(null),A=m.useRef(null),L=et(t,A,x.onContentChange),F=m.useRef(0),j=m.useRef(""),B=m.useRef(0),V=m.useRef(null),K=m.useRef("right"),Y=m.useRef(0),$=v?hp:m.Fragment,Z=v?{as:no,allowPinchZoom:!0}:void 0,U=le=>{var M,H;const ne=j.current+le,N=P().filter(ee=>!ee.disabled),X=document.activeElement,me=(M=N.find(ee=>ee.ref.current===X))===null||M===void 0?void 0:M.textValue,he=N.map(ee=>ee.textValue),de=GY(he,ne,me),re=(H=N.find(ee=>ee.textValue===de))===null||H===void 0?void 0:H.ref.current;(function ee(W){j.current=W,window.clearTimeout(F.current),W!==""&&(F.current=window.setTimeout(()=>ee(""),1e3))})(ne),re&&setTimeout(()=>re.focus())};m.useEffect(()=>()=>window.clearTimeout(F.current),[]),rp();const ie=m.useCallback(le=>{var M,H;return K.current===((M=V.current)===null||M===void 0?void 0:M.side)&&KY(le,(H=V.current)===null||H===void 0?void 0:H.area)},[]);return m.createElement(EY,{scope:n,searchRef:j,onItemEnter:m.useCallback(le=>{ie(le)&&le.preventDefault()},[ie]),onItemLeave:m.useCallback(le=>{var M;ie(le)||((M=A.current)===null||M===void 0||M.focus(),k(null))},[ie]),onTriggerLeave:m.useCallback(le=>{ie(le)&&le.preventDefault()},[ie]),pointerGraceTimerRef:B,onPointerGraceIntentChange:m.useCallback(le=>{V.current=le},[])},m.createElement($,Z,m.createElement(ip,{asChild:!0,trapped:i,onMountAutoFocus:Ce(o,le=>{var M;le.preventDefault(),(M=A.current)===null||M===void 0||M.focus()}),onUnmountAutoFocus:s},m.createElement(_l,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:g,onDismiss:p},m.createElement(km,ae({asChild:!0},C,{dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:O,onCurrentTabStopIdChange:k,onEntryFocus:Ce(l,le=>{w.isUsingKeyboardRef.current||le.preventDefault()})}),m.createElement(Pu,ae({role:"menu","aria-orientation":"vertical","data-state":wk(x.open),"data-radix-menu-content":"",dir:w.dir},S,y,{ref:L,style:{outline:"none",...y.style},onKeyDown:Ce(y.onKeyDown,le=>{const H=le.target.closest("[data-radix-menu-content]")===le.currentTarget,ne=le.ctrlKey||le.altKey||le.metaKey,N=le.key.length===1;H&&(le.key==="Tab"&&le.preventDefault(),!ne&&N&&U(le.key));const X=A.current;if(le.target!==X||!gY.includes(le.key))return;le.preventDefault();const he=P().filter(de=>!de.disabled).map(de=>de.ref.current);uk.includes(le.key)&&he.reverse(),qY(he)}),onBlur:Ce(e.onBlur,le=>{le.currentTarget.contains(le.target)||(window.clearTimeout(F.current),j.current="")}),onPointerMove:Ce(e.onPointerMove,Xu(le=>{const M=le.target,H=Y.current!==le.clientX;if(le.currentTarget.contains(M)&&H){const ne=le.clientX>Y.current?"right":"left";K.current=ne,Y.current=le.clientX}}))})))))))}),MY=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Be.div,ae({role:"group"},r,{ref:t}))}),DY=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Be.div,ae({},r,{ref:t}))}),vy="MenuItem",mk="menu.itemSelect",by=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=m.useRef(null),s=Ku(vy,e.__scopeMenu),a=gy(vy,e.__scopeMenu),l=et(t,o),c=m.useRef(!1),d=()=>{const f=o.current;if(!n&&f){const g=new CustomEvent(mk,{bubbles:!0,cancelable:!0});f.addEventListener(mk,p=>r==null?void 0:r(p),{once:!0}),Kw(f,g),g.defaultPrevented?c.current=!1:s.onClose()}};return m.createElement(vk,ae({},i,{ref:l,disabled:n,onClick:Ce(e.onClick,d),onPointerDown:f=>{var g;(g=e.onPointerDown)===null||g===void 0||g.call(e,f),c.current=!0},onPointerUp:Ce(e.onPointerUp,f=>{var g;c.current||(g=f.currentTarget)===null||g===void 0||g.click()}),onKeyDown:Ce(e.onKeyDown,f=>{const g=a.searchRef.current!=="";n||g&&f.key===" "||hy.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})}))}),vk=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,s=gy(vy,n),a=fk(n),l=m.useRef(null),c=et(t,l),[d,f]=m.useState(!1),[g,p]=m.useState("");return m.useEffect(()=>{const v=l.current;if(v){var y;p(((y=v.textContent)!==null&&y!==void 0?y:"").trim())}},[o.children]),m.createElement(Yu.ItemSlot,{scope:n,disabled:r,textValue:i??g},m.createElement(Mm,ae({asChild:!0},a,{focusable:!r}),m.createElement(Be.div,ae({role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},o,{ref:c,onPointerMove:Ce(e.onPointerMove,Xu(v=>{r?s.onItemLeave(v):(s.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus())})),onPointerLeave:Ce(e.onPointerLeave,Xu(v=>s.onItemLeave(v))),onFocus:Ce(e.onFocus,()=>f(!0)),onBlur:Ce(e.onBlur,()=>f(!1))}))))}),TY=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return m.createElement(yk,{scope:e.__scopeMenu,checked:n},m.createElement(by,ae({role:"menuitemcheckbox","aria-checked":Cp(n)?"mixed":n},i,{ref:t,"data-state":yy(n),onSelect:Ce(i.onSelect,()=>r==null?void 0:r(Cp(n)?!0:!n),{checkForDefaultPrevented:!1})})))}),AY="MenuRadioGroup",[IY,NY]=va(AY,{value:void 0,onValueChange:()=>{}}),RY=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,o=xn(r);return m.createElement(IY,{scope:e.__scopeMenu,value:n,onValueChange:o},m.createElement(MY,ae({},i,{ref:t})))}),LY="MenuRadioItem",$Y=m.forwardRef((e,t)=>{const{value:n,...r}=e,i=NY(LY,e.__scopeMenu),o=n===i.value;return m.createElement(yk,{scope:e.__scopeMenu,checked:o},m.createElement(by,ae({role:"menuitemradio","aria-checked":o},r,{ref:t,"data-state":yy(o),onSelect:Ce(r.onSelect,()=>{var s;return(s=i.onValueChange)===null||s===void 0?void 0:s.call(i,n)},{checkForDefaultPrevented:!1})})))}),bk="MenuItemIndicator",[yk,FY]=va(bk,{checked:!1}),jY=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,o=FY(bk,n);return m.createElement(vn,{present:r||Cp(o.checked)||o.checked===!0},m.createElement(Be.span,ae({},i,{ref:t,"data-state":yy(o.checked)})))}),zY=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Be.div,ae({role:"separator","aria-orientation":"horizontal"},r,{ref:t}))}),BY="MenuSub",[tfe,xk]=va(BY),Sp="MenuSubTrigger",VY=m.forwardRef((e,t)=>{const n=ba(Sp,e.__scopeMenu),r=Ku(Sp,e.__scopeMenu),i=xk(Sp,e.__scopeMenu),o=gy(Sp,e.__scopeMenu),s=m.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=o,c={__scopeMenu:e.__scopeMenu},d=m.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return m.useEffect(()=>d,[d]),m.useEffect(()=>{const f=a.current;return()=>{window.clearTimeout(f),l(null)}},[a,l]),m.createElement(hk,ae({asChild:!0},c),m.createElement(vk,ae({id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":wk(n.open)},e,{ref:uf(t,i.onTriggerChange),onClick:f=>{var g;(g=e.onClick)===null||g===void 0||g.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ce(e.onPointerMove,Xu(f=>{o.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(o.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:Ce(e.onPointerLeave,Xu(f=>{var g;d();const p=(g=n.content)===null||g===void 0?void 0:g.getBoundingClientRect();if(p){var v;const y=(v=n.content)===null||v===void 0?void 0:v.dataset.side,x=y==="right",w=x?-5:5,S=p[x?"left":"right"],C=p[x?"right":"left"];o.onPointerGraceIntentChange({area:[{x:f.clientX+w,y:f.clientY},{x:S,y:p.top},{x:C,y:p.top},{x:C,y:p.bottom},{x:S,y:p.bottom}],side:y}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(f),f.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Ce(e.onKeyDown,f=>{const g=o.searchRef.current!=="";if(!(e.disabled||g&&f.key===" ")&&mY[r.dir].includes(f.key)){var p;n.onOpenChange(!0),(p=n.content)===null||p===void 0||p.focus(),f.preventDefault()}})})))}),HY="MenuSubContent",WY=m.forwardRef((e,t)=>{const n=gk(_i,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=ba(_i,e.__scopeMenu),s=Ku(_i,e.__scopeMenu),a=xk(HY,e.__scopeMenu),l=m.useRef(null),c=et(t,l);return m.createElement(Yu.Provider,{scope:e.__scopeMenu},m.createElement(vn,{present:r||o.open},m.createElement(Yu.Slot,{scope:e.__scopeMenu},m.createElement(my,ae({id:a.contentId,"aria-labelledby":a.triggerId},i,{ref:c,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var f;s.isUsingKeyboardRef.current&&((f=l.current)===null||f===void 0||f.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:Ce(e.onFocusOutside,d=>{d.target!==a.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Ce(e.onEscapeKeyDown,d=>{s.onClose(),d.preventDefault()}),onKeyDown:Ce(e.onKeyDown,d=>{const f=d.currentTarget.contains(d.target),g=vY[s.dir].includes(d.key);if(f&&g){var p;o.onOpenChange(!1),(p=a.trigger)===null||p===void 0||p.focus(),d.preventDefault()}})})))))});function wk(e){return e?"open":"closed"}function Cp(e){return e==="indeterminate"}function yy(e){return Cp(e)?"indeterminate":e?"checked":"unchecked"}function qY(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function UY(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function GY(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let s=UY(e,Math.max(o,0));i.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function YY(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,s=t.length-1;o<t.length;s=o++){const a=t[o].x,l=t[o].y,c=t[s].x,d=t[s].y;l>r!=d>r&&n<(c-a)*(r-l)/(d-l)+a&&(i=!i)}return i}function KY(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return YY(n,t)}function Xu(e){return t=>t.pointerType==="mouse"?e(t):void 0}const XY=_Y,QY=hk,JY=CY,ZY=OY,eK=DY,tK=by,nK=TY,rK=RY,iK=$Y,oK=jY,sK=zY,aK=VY,lK=WY,_k="DropdownMenu",[cK,nfe]=Pn(_k,[dk]),Nr=dk(),[uK,Sk]=cK(_k),dK=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:s,modal:a=!0}=e,l=Nr(t),c=m.useRef(null),[d=!1,f]=Qn({prop:i,defaultProp:o,onChange:s});return m.createElement(uK,{scope:t,triggerId:or(),triggerRef:c,contentId:or(),open:d,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(g=>!g),[f]),modal:a},m.createElement(XY,ae({},l,{open:d,onOpenChange:f,dir:r,modal:a}),n))},fK="DropdownMenuTrigger",hK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,o=Sk(fK,n),s=Nr(n);return m.createElement(QY,ae({asChild:!0},s),m.createElement(Be.button,ae({type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r},i,{ref:uf(t,o.triggerRef),onPointerDown:Ce(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(o.onOpenToggle(),o.open||a.preventDefault())}),onKeyDown:Ce(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&o.onOpenToggle(),a.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})))}),pK=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Nr(t);return m.createElement(JY,ae({},r,n))},gK="DropdownMenuContent",mK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Sk(gK,n),o=Nr(n),s=m.useRef(!1);return m.createElement(ZY,ae({id:i.contentId,"aria-labelledby":i.triggerId},o,r,{ref:t,onCloseAutoFocus:Ce(e.onCloseAutoFocus,a=>{var l;s.current||(l=i.triggerRef.current)===null||l===void 0||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:Ce(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;(!i.modal||d)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),vK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(eK,ae({},i,r,{ref:t}))}),bK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(tK,ae({},i,r,{ref:t}))}),yK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(nK,ae({},i,r,{ref:t}))}),xK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(rK,ae({},i,r,{ref:t}))}),wK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(iK,ae({},i,r,{ref:t}))}),_K=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(oK,ae({},i,r,{ref:t}))}),SK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(sK,ae({},i,r,{ref:t}))}),CK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(aK,ae({},i,r,{ref:t}))}),EK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(lK,ae({},i,r,{ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),OK=dK,PK=hK,kK=pK,Ck=mK,Ek=vK,Ok=bK,Pk=yK,MK=xK,kk=wK,Mk=_K,Dk=SK,Tk=CK,Ak=EK,DK=OK,TK=PK,AK=MK,IK=ue.forwardRef(({className:e,inset:t,children:n,...r},i)=>_.jsxs(Tk,{ref:i,className:Pe("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,_.jsx(z2,{className:"ml-auto h-4 w-4"})]}));IK.displayName=Tk.displayName;const NK=ue.forwardRef(({className:e,...t},n)=>_.jsx(Ak,{ref:n,className:Pe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));NK.displayName=Ak.displayName;const Ik=ue.forwardRef(({className:e,sideOffset:t=4,...n},r)=>_.jsx(kK,{children:_.jsx(Ck,{ref:r,sideOffset:t,className:Pe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Ik.displayName=Ck.displayName;const RK=ue.forwardRef(({className:e,inset:t,...n},r)=>_.jsx(Ok,{ref:r,className:Pe("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));RK.displayName=Ok.displayName;const LK=ue.forwardRef(({className:e,children:t,checked:n,...r},i)=>_.jsxs(Pk,{ref:i,className:Pe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[_.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:_.jsx(Mk,{children:_.jsx(Rh,{className:"h-4 w-4"})})}),t]}));LK.displayName=Pk.displayName;const xy=ue.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(kk,{ref:r,className:Pe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[_.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:_.jsx(Mk,{children:_.jsx(B2,{className:"h-2 w-2 fill-current"})})}),t]}));xy.displayName=kk.displayName;const Nk=ue.forwardRef(({className:e,inset:t,...n},r)=>_.jsx(Ek,{ref:r,className:Pe("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Nk.displayName=Ek.displayName;const Rk=ue.forwardRef(({className:e,...t},n)=>_.jsx(Dk,{ref:n,className:Pe("-mx-1 my-1 h-px bg-muted",e),...t}));Rk.displayName=Dk.displayName;function $K(){const[e,t]=m.useState(!1),[n,r]=m.useState(""),i=ge(p=>p.dashboard),o=ge(p=>p.bookmarkKey),[s,a]=m.useState([]),l=ge(p=>p.actions.setDashboard),c=ge(p=>p.actions.setFilterValues),d=ge(p=>p.actions.setBookmarkKey);m.useEffect(()=>{const p=ss(i.id),v=JSON.parse(localStorage.getItem(p)||"[]");a(v);const y=v.find(x=>x.default);y&&y.name===o&&r(y.name)},[e,i,o]);function f(p){if(p===n)return;const v=s.find(x=>x.name===p),y=v==null?void 0:v.template;y&&(l(y),c(v.filterValues||[]),d(p==="Original"?"":p)),r(p)}function g(p){const v=ss(i.id),x=JSON.parse(localStorage.getItem(v)||"[]").filter(w=>w.name!==p);localStorage.setItem(v,JSON.stringify(x)),a(x)}return _.jsxs(DK,{open:e,onOpenChange:t,children:[_.jsx(TK,{asChild:!0,children:_.jsx(ot,{variant:"outline",className:"h-7 p-2",children:_.jsx(YB,{className:"h-4 w-4",strokeWidth:1.5})})}),_.jsxs(Ik,{className:"w-56",children:[_.jsx(Nk,{children:"Lenses"}),_.jsx(Rk,{}),_.jsxs(AK,{value:n,onValueChange:f,children:[_.jsx(xy,{value:"Original",children:"Original"}),s.filter(p=>p.name!="Original").map((p,v)=>_.jsxs(xy,{className:"xbg-red-100 flex justify-between",value:p.name,defaultChecked:p.name===o,children:[_.jsx("p",{children:p.name}),_.jsx(ia,{onClick:y=>{y.preventDefault(),g(p.name)},className:"h-3 w-3 hover:cursor-pointer",strokeWidth:1.5})]},v))]})]})]})}function Ep(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}const Lk="Checkbox",[FK,rfe]=Pn(Lk),[jK,zK]=FK(Lk),BK=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:o,required:s,disabled:a,value:l="on",onCheckedChange:c,...d}=e,[f,g]=m.useState(null),p=et(t,C=>g(C)),v=m.useRef(!1),y=f?!!f.closest("form"):!0,[x=!1,w]=Qn({prop:i,defaultProp:o,onChange:c}),S=m.useRef(x);return m.useEffect(()=>{const C=f==null?void 0:f.form;if(C){const P=()=>w(S.current);return C.addEventListener("reset",P),()=>C.removeEventListener("reset",P)}},[f,w]),m.createElement(jK,{scope:n,state:x,disabled:a},m.createElement(Be.button,ae({type:"button",role:"checkbox","aria-checked":ya(x)?"mixed":x,"aria-required":s,"data-state":$k(x),"data-disabled":a?"":void 0,disabled:a,value:l},d,{ref:p,onKeyDown:Ce(e.onKeyDown,C=>{C.key==="Enter"&&C.preventDefault()}),onClick:Ce(e.onClick,C=>{w(P=>ya(P)?!0:!P),y&&(v.current=C.isPropagationStopped(),v.current||C.stopPropagation())})})),y&&m.createElement(WK,{control:f,bubbles:!v.current,name:r,value:l,checked:x,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),VK="CheckboxIndicator",HK=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,o=zK(VK,n);return m.createElement(vn,{present:r||ya(o.state)||o.state===!0},m.createElement(Be.span,ae({"data-state":$k(o.state),"data-disabled":o.disabled?"":void 0},i,{ref:t,style:{pointerEvents:"none",...e.style}})))}),WK=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,o=m.useRef(null),s=Ep(n),a=Mh(t);return m.useEffect(()=>{const l=o.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const g=new Event("click",{bubbles:r});l.indeterminate=ya(n),f.call(l,ya(n)?!1:n),l.dispatchEvent(g)}},[s,n,r]),m.createElement("input",ae({type:"checkbox","aria-hidden":!0,defaultChecked:ya(n)?!1:n},i,{tabIndex:-1,ref:o,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function ya(e){return e==="indeterminate"}function $k(e){return ya(e)?"indeterminate":e?"checked":"unchecked"}const Fk=BK,qK=HK,Op=ue.forwardRef(({className:e,...t},n)=>_.jsx(Fk,{ref:n,className:Pe("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:_.jsx(qK,{className:Pe("flex items-center justify-center text-current"),children:_.jsx(Rh,{className:"h-4 w-4"})})}));Op.displayName=Fk.displayName;function UK(){const[e,t]=m.useState(!1),n=ge(o=>o.dashboard),r=ge(o=>o.bookmarkKey);m.useEffect(()=>{if(!r){t(!1);return}const o=ss(n.id),a=JSON.parse(localStorage.getItem(o)||"[]").find(l=>l.name===r);t(a?a.default:!1)},[r,n.id]);function i(o){if(t(o),!r)return;const s=ss(n.id),l=JSON.parse(localStorage.getItem(s)||"[]").map(c=>(c.name===r?c.default=o:c.default=!1,c));console.log(l),localStorage.setItem(s,JSON.stringify(l))}return _.jsxs("div",{className:"flex items-center space-x-2",children:[_.jsx(Op,{checked:e,onCheckedChange:i,id:"terms"}),_.jsx("label",{htmlFor:"terms",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Set as default"})]})}function GK(){const e=ge(P=>P.bookmarkKey),t=ge(P=>P.dashboard),n=ge(P=>P.selectedSheetId),r=ge(P=>P.isDashboardEditing),i=ge(P=>P.filterValues),o=ge(P=>P.isVisualEditing),s=ge(P=>P.showFilters),a=ge(P=>P.showDashboardJSON),l=ge(P=>P.actions.setShowDashboardJSON),c=ge(P=>P.onSaveFunction),d=ge(P=>P.actions.setShowFilters),{addCard:f,getSelectedSheet:g,setIsDashboardEditing:p,setSelectedCardId:v,setSelectedCard:y}=ge(P=>P.actions),x=g(),w=()=>{if(!r||!x)return;const P={id:wu(),title:"New Card",description:"New Card Description",preferences:{filterOnClick:!0},type:"bar",sql:"select COUNT(*) from YOUR_TABLE",data:[]};f(x.id,P),v(n,P.id),y(P)},S=()=>{p(!0)};function C(){if(!e||e==="")return;const P=ay(t),O=ss(t.id),k=JSON.parse(localStorage.getItem(O)||"[]"),A=k.findIndex(L=>L.name===e);A!==-1?k[A]={name:e,template:P,default:k[A].default,filterValues:i}:k.push({name:e,template:P,filterValues:i}),localStorage.setItem(O,JSON.stringify(k)),c==null||c(P)}return _.jsxs("div",{className:`flex items-center justify-between gap-2
|
|
418
|
-
py-2 `,role:"dashboard-controls",children:[!o&&_.jsxs("div",{className:"flex gap-3 items-center",children:[_.jsx(ns,{children:e}),!!e&&_.jsxs(_.Fragment,{children:[_.jsx("span",{className:" text-muted-foreground",children:"|"}),_.jsx(UK,{})]})]}),_.jsxs("div",{className:"flex gap-2",children:[r&&!o&&_.jsx(hY,{}),!o&&_.jsx($K,{}),r&&!o&&_.jsxs(ot,{variant:"outline",className:"h-7 p-2",size:"sm",disabled:!r,onClick:w,children:[_.jsx(q2,{className:" mr-2 h-4 w-4",strokeWidth:1.5}),"Add Card"]}),!r&&_.jsx(ot,{variant:"outline",className:"h-7 p-2",onClick:S,size:"sm",children:_.jsx(KB,{className:"h-4 w-4",strokeWidth:1.5})}),r&&!o&&_.jsx(ot,{variant:"outline",role:"close",className:"h-7 p-2",onClick:()=>p(!1),size:"sm",children:_.jsx(ia,{className:"h-4 w-4",strokeWidth:1.5})}),r&&!o&&_.jsx(ot,{className:"h-7 p-2",variant:"outline",onClick:C,size:"sm",children:_.jsx(QB,{className:"h-4 w-4",strokeWidth:1.5})}),!s&&!o&&r&&_.jsx(ot,{className:"h-7 p-2",variant:"outline",onClick:()=>d(!0),size:"sm",children:_.jsx(V2,{className:"h-4 w-4",strokeWidth:1.5})}),!o&&r&&_.jsx("div",{className:" flex items-center space-x-2",children:_.jsx(ot,{className:"h-7 p-2",onClick:()=>l(!a),size:"sm",variant:"outline",children:_.jsx(qB,{className:"h-4 w-4",strokeWidth:1.5})})})]})]})}const jk=m.forwardRef(({className:e,...t},n)=>_.jsx("div",{role:"editor-panel",ref:n,className:Pe("flex grow min-h-[80vh]",e),...t}));jk.displayName="EditorPanel";const zk=m.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:Pe(" flex flex-col space-y-2 w-[270px]",e),...t}));zk.displayName="EditorAside";const Bk=m.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:Pe(" grow",e),...t}));Bk.displayName="EditorMain";const YK=[" ","Enter","ArrowUp","ArrowDown"],KK=[" ","Enter"],Pp="Select",[kp,Mp,XK]=df(Pp),[Fl,ife]=Pn(Pp,[XK,Fi]),wy=Fi(),[QK,xa]=Fl(Pp),[JK,ZK]=Fl(Pp),eX=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:s,defaultValue:a,onValueChange:l,dir:c,name:d,autoComplete:f,disabled:g,required:p}=e,v=wy(t),[y,x]=m.useState(null),[w,S]=m.useState(null),[C,P]=m.useState(!1),O=Fs(c),[k=!1,A]=Qn({prop:r,defaultProp:i,onChange:o}),[L,F]=Qn({prop:s,defaultProp:a,onChange:l}),j=m.useRef(null),B=y?!!y.closest("form"):!0,[V,K]=m.useState(new Set),Y=Array.from(V).map($=>$.props.value).join(";");return m.createElement(Eu,v,m.createElement(QK,{required:p,scope:t,trigger:y,onTriggerChange:x,valueNode:w,onValueNodeChange:S,valueNodeHasChildren:C,onValueNodeHasChildrenChange:P,contentId:or(),value:L,onValueChange:F,open:k,onOpenChange:A,dir:O,triggerPointerDownPosRef:j,disabled:g},m.createElement(kp.Provider,{scope:t},m.createElement(JK,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback($=>{K(Z=>new Set(Z).add($))},[]),onNativeOptionRemove:m.useCallback($=>{K(Z=>{const U=new Set(Z);return U.delete($),U})},[])},n)),B?m.createElement(Xk,{key:Y,"aria-hidden":!0,required:p,tabIndex:-1,name:d,autoComplete:f,value:L,onChange:$=>F($.target.value),disabled:g},L===void 0?m.createElement("option",{value:""}):null,Array.from(V)):null))},tX="SelectTrigger",nX=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=wy(n),s=xa(tX,n),a=s.disabled||r,l=et(t,s.onTriggerChange),c=Mp(n),[d,f,g]=Qk(v=>{const y=c().filter(S=>!S.disabled),x=y.find(S=>S.value===s.value),w=Jk(y,v,x);w!==void 0&&s.onValueChange(w.value)}),p=()=>{a||(s.onOpenChange(!0),g())};return m.createElement(Ou,ae({asChild:!0},o),m.createElement(Be.button,ae({type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":Kk(s.value)?"":void 0},i,{ref:l,onClick:Ce(i.onClick,v=>{v.currentTarget.focus()}),onPointerDown:Ce(i.onPointerDown,v=>{const y=v.target;y.hasPointerCapture(v.pointerId)&&y.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&(p(),s.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)},v.preventDefault())}),onKeyDown:Ce(i.onKeyDown,v=>{const y=d.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&f(v.key),!(y&&v.key===" ")&&YK.includes(v.key)&&(p(),v.preventDefault())})})))}),rX="SelectValue",iX=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:s="",...a}=e,l=xa(rX,n),{onValueNodeHasChildrenChange:c}=l,d=o!==void 0,f=et(t,l.onValueNodeChange);return Vn(()=>{c(d)},[c,d]),m.createElement(Be.span,ae({},a,{ref:f,style:{pointerEvents:"none"}}),Kk(l.value)?m.createElement(m.Fragment,null,s):o)}),oX=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return m.createElement(Be.span,ae({"aria-hidden":!0},i,{ref:t}),r||"▼")}),sX=e=>m.createElement(Dh,ae({asChild:!0},e)),jl="SelectContent",aX=m.forwardRef((e,t)=>{const n=xa(jl,e.__scopeSelect),[r,i]=m.useState();if(Vn(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?kt.createPortal(m.createElement(Vk,{scope:e.__scopeSelect},m.createElement(kp.Slot,{scope:e.__scopeSelect},m.createElement("div",null,e.children))),o):null}return m.createElement(lX,ae({},e,{ref:t}))}),_o=10,[Vk,wa]=Fl(jl),lX=m.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:f,collisionBoundary:g,collisionPadding:p,sticky:v,hideWhenDetached:y,avoidCollisions:x,...w}=e,S=xa(jl,n),[C,P]=m.useState(null),[O,k]=m.useState(null),A=et(t,de=>P(de)),[L,F]=m.useState(null),[j,B]=m.useState(null),V=Mp(n),[K,Y]=m.useState(!1),$=m.useRef(!1);m.useEffect(()=>{if(C)return ap(C)},[C]),rp();const Z=m.useCallback(de=>{const[re,...ee]=V().map(oe=>oe.ref.current),[W]=ee.slice(-1),ye=document.activeElement;for(const oe of de)if(oe===ye||(oe==null||oe.scrollIntoView({block:"nearest"}),oe===re&&O&&(O.scrollTop=0),oe===W&&O&&(O.scrollTop=O.scrollHeight),oe==null||oe.focus(),document.activeElement!==ye))return},[V,O]),U=m.useCallback(()=>Z([L,C]),[Z,L,C]);m.useEffect(()=>{K&&U()},[K,U]);const{onOpenChange:ie,triggerPointerDownPosRef:le}=S;m.useEffect(()=>{if(C){let de={x:0,y:0};const re=W=>{var ye,oe,Te,Fe;de={x:Math.abs(Math.round(W.pageX)-((ye=(oe=le.current)===null||oe===void 0?void 0:oe.x)!==null&&ye!==void 0?ye:0)),y:Math.abs(Math.round(W.pageY)-((Te=(Fe=le.current)===null||Fe===void 0?void 0:Fe.y)!==null&&Te!==void 0?Te:0))}},ee=W=>{de.x<=10&&de.y<=10?W.preventDefault():C.contains(W.target)||ie(!1),document.removeEventListener("pointermove",re),le.current=null};return le.current!==null&&(document.addEventListener("pointermove",re),document.addEventListener("pointerup",ee,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",re),document.removeEventListener("pointerup",ee,{capture:!0})}}},[C,ie,le]),m.useEffect(()=>{const de=()=>ie(!1);return window.addEventListener("blur",de),window.addEventListener("resize",de),()=>{window.removeEventListener("blur",de),window.removeEventListener("resize",de)}},[ie]);const[M,H]=Qk(de=>{const re=V().filter(ye=>!ye.disabled),ee=re.find(ye=>ye.ref.current===document.activeElement),W=Jk(re,de,ee);W&&setTimeout(()=>W.ref.current.focus())}),ne=m.useCallback((de,re,ee)=>{const W=!$.current&&!ee;(S.value!==void 0&&S.value===re||W)&&(F(de),W&&($.current=!0))},[S.value]),N=m.useCallback(()=>C==null?void 0:C.focus(),[C]),X=m.useCallback((de,re,ee)=>{const W=!$.current&&!ee;(S.value!==void 0&&S.value===re||W)&&B(de)},[S.value]),me=r==="popper"?Hk:cX,he=me===Hk?{side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:f,collisionBoundary:g,collisionPadding:p,sticky:v,hideWhenDetached:y,avoidCollisions:x}:{};return m.createElement(Vk,{scope:n,content:C,viewport:O,onViewportChange:k,itemRefCallback:ne,selectedItem:L,onItemLeave:N,itemTextRefCallback:X,focusSelectedItem:U,selectedItemText:j,position:r,isPositioned:K,searchRef:M},m.createElement(hp,{as:no,allowPinchZoom:!0},m.createElement(ip,{asChild:!0,trapped:S.open,onMountAutoFocus:de=>{de.preventDefault()},onUnmountAutoFocus:Ce(i,de=>{var re;(re=S.trigger)===null||re===void 0||re.focus({preventScroll:!0}),de.preventDefault()})},m.createElement(_l,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:de=>de.preventDefault(),onDismiss:()=>S.onOpenChange(!1)},m.createElement(me,ae({role:"listbox",id:S.contentId,"data-state":S.open?"open":"closed",dir:S.dir,onContextMenu:de=>de.preventDefault()},w,he,{onPlaced:()=>Y(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:Ce(w.onKeyDown,de=>{const re=de.ctrlKey||de.altKey||de.metaKey;if(de.key==="Tab"&&de.preventDefault(),!re&&de.key.length===1&&H(de.key),["ArrowUp","ArrowDown","Home","End"].includes(de.key)){let W=V().filter(ye=>!ye.disabled).map(ye=>ye.ref.current);if(["ArrowUp","End"].includes(de.key)&&(W=W.slice().reverse()),["ArrowUp","ArrowDown"].includes(de.key)){const ye=de.target,oe=W.indexOf(ye);W=W.slice(oe+1)}setTimeout(()=>Z(W)),de.preventDefault()}})}))))))}),cX=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=xa(jl,n),s=wa(jl,n),[a,l]=m.useState(null),[c,d]=m.useState(null),f=et(t,A=>d(A)),g=Mp(n),p=m.useRef(!1),v=m.useRef(!0),{viewport:y,selectedItem:x,selectedItemText:w,focusSelectedItem:S}=s,C=m.useCallback(()=>{if(o.trigger&&o.valueNode&&a&&c&&y&&x&&w){const A=o.trigger.getBoundingClientRect(),L=c.getBoundingClientRect(),F=o.valueNode.getBoundingClientRect(),j=w.getBoundingClientRect();if(o.dir!=="rtl"){const ye=j.left-L.left,oe=F.left-ye,Te=A.left-oe,Fe=A.width+Te,He=Math.max(Fe,L.width),Ke=window.innerWidth-_o,St=s0(oe,[_o,Ke-He]);a.style.minWidth=Fe+"px",a.style.left=St+"px"}else{const ye=L.right-j.right,oe=window.innerWidth-F.right-ye,Te=window.innerWidth-A.right-oe,Fe=A.width+Te,He=Math.max(Fe,L.width),Ke=window.innerWidth-_o,St=s0(oe,[_o,Ke-He]);a.style.minWidth=Fe+"px",a.style.right=St+"px"}const B=g(),V=window.innerHeight-_o*2,K=y.scrollHeight,Y=window.getComputedStyle(c),$=parseInt(Y.borderTopWidth,10),Z=parseInt(Y.paddingTop,10),U=parseInt(Y.borderBottomWidth,10),ie=parseInt(Y.paddingBottom,10),le=$+Z+K+ie+U,M=Math.min(x.offsetHeight*5,le),H=window.getComputedStyle(y),ne=parseInt(H.paddingTop,10),N=parseInt(H.paddingBottom,10),X=A.top+A.height/2-_o,me=V-X,he=x.offsetHeight/2,de=x.offsetTop+he,re=$+Z+de,ee=le-re;if(re<=X){const ye=x===B[B.length-1].ref.current;a.style.bottom="0px";const oe=c.clientHeight-y.offsetTop-y.offsetHeight,Te=Math.max(me,he+(ye?N:0)+oe+U),Fe=re+Te;a.style.height=Fe+"px"}else{const ye=x===B[0].ref.current;a.style.top="0px";const Te=Math.max(X,$+y.offsetTop+(ye?ne:0)+he)+ee;a.style.height=Te+"px",y.scrollTop=re-X+y.offsetTop}a.style.margin=`${_o}px 0`,a.style.minHeight=M+"px",a.style.maxHeight=V+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[g,o.trigger,o.valueNode,a,c,y,x,w,o.dir,r]);Vn(()=>C(),[C]);const[P,O]=m.useState();Vn(()=>{c&&O(window.getComputedStyle(c).zIndex)},[c]);const k=m.useCallback(A=>{A&&v.current===!0&&(C(),S==null||S(),v.current=!1)},[C,S]);return m.createElement(uX,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:p,onScrollButtonChange:k},m.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:P}},m.createElement(Be.div,ae({},i,{ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}}))))}),Hk=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=_o,...o}=e,s=wy(n);return m.createElement(Pu,ae({},s,o,{ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[uX,_y]=Fl(jl,{}),Wk="SelectViewport",dX=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=wa(Wk,n),o=_y(Wk,n),s=et(t,i.onViewportChange),a=m.useRef(0);return m.createElement(m.Fragment,null,m.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),m.createElement(kp.Slot,{scope:n},m.createElement(Be.div,ae({"data-radix-select-viewport":"",role:"presentation"},r,{ref:s,style:{position:"relative",flex:1,overflow:"auto",...r.style},onScroll:Ce(r.onScroll,l=>{const c=l.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:f}=o;if(f!=null&&f.current&&d){const g=Math.abs(a.current-c.scrollTop);if(g>0){const p=window.innerHeight-_o*2,v=parseFloat(d.style.minHeight),y=parseFloat(d.style.height),x=Math.max(v,y);if(x<p){const w=x+g,S=Math.min(p,w),C=w-S;d.style.height=S+"px",d.style.bottom==="0px"&&(c.scrollTop=C>0?C:0,d.style.justifyContent="flex-end")}}}a.current=c.scrollTop})}))))}),fX="SelectGroup",[hX,pX]=Fl(fX),gX=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=or();return m.createElement(hX,{scope:n,id:i},m.createElement(Be.div,ae({role:"group","aria-labelledby":i},r,{ref:t})))}),mX="SelectLabel",vX=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=pX(mX,n);return m.createElement(Be.div,ae({id:i.id},r,{ref:t}))}),Sy="SelectItem",[bX,qk]=Fl(Sy),yX=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...s}=e,a=xa(Sy,n),l=wa(Sy,n),c=a.value===r,[d,f]=m.useState(o??""),[g,p]=m.useState(!1),v=et(t,w=>{var S;return(S=l.itemRefCallback)===null||S===void 0?void 0:S.call(l,w,r,i)}),y=or(),x=()=>{i||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return m.createElement(bX,{scope:n,value:r,disabled:i,textId:y,isSelected:c,onItemTextChange:m.useCallback(w=>{f(S=>{var C;return S||((C=w==null?void 0:w.textContent)!==null&&C!==void 0?C:"").trim()})},[])},m.createElement(kp.ItemSlot,{scope:n,value:r,disabled:i,textValue:d},m.createElement(Be.div,ae({role:"option","aria-labelledby":y,"data-highlighted":g?"":void 0,"aria-selected":c&&g,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1},s,{ref:v,onFocus:Ce(s.onFocus,()=>p(!0)),onBlur:Ce(s.onBlur,()=>p(!1)),onPointerUp:Ce(s.onPointerUp,x),onPointerMove:Ce(s.onPointerMove,w=>{if(i){var S;(S=l.onItemLeave)===null||S===void 0||S.call(l)}else w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ce(s.onPointerLeave,w=>{if(w.currentTarget===document.activeElement){var S;(S=l.onItemLeave)===null||S===void 0||S.call(l)}}),onKeyDown:Ce(s.onKeyDown,w=>{var S;((S=l.searchRef)===null||S===void 0?void 0:S.current)!==""&&w.key===" "||(KK.includes(w.key)&&x(),w.key===" "&&w.preventDefault())})}))))}),Dp="SelectItemText",xX=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,s=xa(Dp,n),a=wa(Dp,n),l=qk(Dp,n),c=ZK(Dp,n),[d,f]=m.useState(null),g=et(t,w=>f(w),l.onItemTextChange,w=>{var S;return(S=a.itemTextRefCallback)===null||S===void 0?void 0:S.call(a,w,l.value,l.disabled)}),p=d==null?void 0:d.textContent,v=m.useMemo(()=>m.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},p),[l.disabled,l.value,p]),{onNativeOptionAdd:y,onNativeOptionRemove:x}=c;return Vn(()=>(y(v),()=>x(v)),[y,x,v]),m.createElement(m.Fragment,null,m.createElement(Be.span,ae({id:l.textId},o,{ref:g})),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?kt.createPortal(o.children,s.valueNode):null)}),wX="SelectItemIndicator",_X=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return qk(wX,n).isSelected?m.createElement(Be.span,ae({"aria-hidden":!0},r,{ref:t})):null}),Uk="SelectScrollUpButton",SX=m.forwardRef((e,t)=>{const n=wa(Uk,e.__scopeSelect),r=_y(Uk,e.__scopeSelect),[i,o]=m.useState(!1),s=et(t,r.onScrollButtonChange);return Vn(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=a.scrollTop>0;o(c)};const a=n.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?m.createElement(Yk,ae({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}})):null}),Gk="SelectScrollDownButton",CX=m.forwardRef((e,t)=>{const n=wa(Gk,e.__scopeSelect),r=_y(Gk,e.__scopeSelect),[i,o]=m.useState(!1),s=et(t,r.onScrollButtonChange);return Vn(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=a.scrollHeight-a.clientHeight,d=Math.ceil(a.scrollTop)<c;o(d)};const a=n.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?m.createElement(Yk,ae({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}})):null}),Yk=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=wa("SelectScrollButton",n),s=m.useRef(null),a=Mp(n),l=m.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return m.useEffect(()=>()=>l(),[l]),Vn(()=>{var c;const d=a().find(f=>f.ref.current===document.activeElement);d==null||(c=d.ref.current)===null||c===void 0||c.scrollIntoView({block:"nearest"})},[a]),m.createElement(Be.div,ae({"aria-hidden":!0},i,{ref:t,style:{flexShrink:0,...i.style},onPointerDown:Ce(i.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:Ce(i.onPointerMove,()=>{var c;(c=o.onItemLeave)===null||c===void 0||c.call(o),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:Ce(i.onPointerLeave,()=>{l()})}))}),EX=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return m.createElement(Be.div,ae({"aria-hidden":!0},r,{ref:t}))});function Kk(e){return e===""||e===void 0}const Xk=m.forwardRef((e,t)=>{const{value:n,...r}=e,i=m.useRef(null),o=et(t,i),s=Ep(n);return m.useEffect(()=>{const a=i.current,l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==n&&d){const f=new Event("change",{bubbles:!0});d.call(a,n),a.dispatchEvent(f)}},[s,n]),m.createElement(M2,{asChild:!0},m.createElement("select",ae({},r,{ref:o,defaultValue:n})))});Xk.displayName="BubbleSelect";function Qk(e){const t=xn(e),n=m.useRef(""),r=m.useRef(0),i=m.useCallback(s=>{const a=n.current+s;t(a),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),o=m.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function Jk(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let s=OX(e,Math.max(o,0));i.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function OX(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const PX=eX,Zk=nX,kX=iX,MX=oX,DX=sX,eM=aX,TX=dX,AX=gX,tM=vX,nM=yX,IX=xX,NX=_X,rM=SX,iM=CX,oM=EX,sM=PX,aM=AX,lM=kX,Cy=ue.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(Zk,{ref:r,className:Pe("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,_.jsx(MX,{asChild:!0,children:_.jsx(Vb,{className:"h-4 w-4 opacity-50"})})]}));Cy.displayName=Zk.displayName;const cM=ue.forwardRef(({className:e,...t},n)=>_.jsx(rM,{ref:n,className:Pe("flex cursor-default items-center justify-center py-1",e),...t,children:_.jsx(WB,{className:"h-4 w-4"})}));cM.displayName=rM.displayName;const uM=ue.forwardRef(({className:e,...t},n)=>_.jsx(iM,{ref:n,className:Pe("flex cursor-default items-center justify-center py-1",e),...t,children:_.jsx(Vb,{className:"h-4 w-4"})}));uM.displayName=iM.displayName;const Ey=ue.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>_.jsx(DX,{children:_.jsxs(eM,{ref:i,className:Pe("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[_.jsx(cM,{}),_.jsx(TX,{className:Pe("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),_.jsx(uM,{})]})}));Ey.displayName=eM.displayName;const Tp=ue.forwardRef(({className:e,...t},n)=>_.jsx(tM,{ref:n,className:Pe("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Tp.displayName=tM.displayName;const _a=ue.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(nM,{ref:r,className:Pe("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[_.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:_.jsx(NX,{children:_.jsx(Rh,{className:"h-4 w-4"})})}),_.jsx(IX,{children:t})]}));_a.displayName=nM.displayName;const RX=ue.forwardRef(({className:e,...t},n)=>_.jsx(oM,{ref:n,className:Pe("-mx-1 my-1 h-px bg-muted",e),...t}));RX.displayName=oM.displayName;function Ap({title:e,items:t,value:n,isLoading:r,isError:i,onChange:o}){const s=r?"Loading...":i?"Error":n;function a(){if(e==="Connection")return _.jsx(XB,{className:" rotate-90",strokeWidth:1,size:16});if(e==="Database")return _.jsx(UB,{strokeWidth:1,size:16});if(e==="Schema")return _.jsx(ZB,{strokeWidth:1,size:16});if(e==="Table")return _.jsx(Hb,{strokeWidth:1,size:16})}return _.jsxs("div",{className:"flex gap-2 items-center",children:[_.jsx("div",{className:" shrink-0",children:a()}),_.jsxs(sM,{value:s,onValueChange:o,children:[_.jsx(Cy,{className:"focus:ring-offset-0 focus:ring-1 h-7 w-[190px] ",children:_.jsx(lM,{placeholder:r?"Loading...":i?"Error":`Select ${e}`})}),_.jsx(Ey,{children:_.jsxs(aM,{children:[r?_.jsx(Tp,{children:"Loading..."}):_.jsx(Tp,{children:e}),_.jsx(_.Fragment,{children:t&&t.map(l=>_.jsx(_a,{value:l.id,children:l.name},l.id))}),(r||i)&&_.jsx(_a,{value:s,children:s})]})})]})]})}function LX({column:e}){const[t,n]=m.useState(!1),r=_e(d=>d.selectedTableName),i=_e(d=>d.selectedSchemaName),o=_e(d=>d.sqlGen),s=_e(d=>d.actions.setSqlGen),a=_e(d=>d.actions.setCardSql),l=_e(d=>d.actions.setRunSql);function c(d,f){const g=HO(d,o,f);s(g);const p=VO(g,i||"",r);p&&(a(p),l(!0)),n(!1)}return _.jsxs(pp,{open:t,onOpenChange:n,children:[_.jsx(gp,{asChild:!0,children:_.jsx(Bj,{className:"w-3 h-3 text-foreground/40 cursor-pointer"})}),_.jsx(qu,{align:"center",className:" p-0 w-18 rounded-none shadow-none border-muted",children:_.jsxs("ul",{className:"text-xs ",children:[_.jsx("li",{onClick:()=>c(e,"COUNT"),className:" px-3 p-1 hover:bg-muted transition-colors cursor-pointer",children:"Count"}),_.jsx("li",{onClick:()=>c(e,"AVG"),className:" px-3 p-1 hover:bg-muted transition-colors cursor-pointer",children:"Avg"}),_.jsx("li",{onClick:()=>c(e,"SUM"),className:"px-3 p-1 hover:bg-muted transition-colors cursor-pointer",children:"Sum"}),_.jsx("li",{onClick:()=>c(e,"MAX"),className:"px-3 p-1 hover:bg-muted transition-colors cursor-pointer",children:"Max"}),_.jsx("li",{onClick:()=>c(e,"MIN"),className:"px-3 p-1 hover:bg-muted transition-colors cursor-pointer",children:"Min"})]})})]})}function dM({column:e}){return _.jsxs(zb,{children:[_.jsx(T2,{asChild:!0,children:E0.includes(e.data_type.toLowerCase())?_.jsx("span",{className:" font-thin",children:"T"}):Tl.includes(e.data_type.toLowerCase())?_.jsx("span",{className:" font-thin",children:"#"}):Nu.includes(e.data_type.toLowerCase())?_.jsx("span",{className:" font-thin",children:"D"}):BO.includes(e.data_type.toLowerCase())?_.jsx("span",{className:" font-thin",children:"B"}):_.jsx("span",{className:" font-thin",children:"?"})}),_.jsx(Ih,{children:_.jsx("p",{className:"text-xs font-mono",children:e.data_type})})]})}function $X({schemaName:e,tableName:t,columns:n,status:r}){const i=_e(f=>f.sqlGen),o=_e(f=>f.actions.setRunSql),s=_e(f=>f.actions.setSqlGen),a=_e(f=>f.actions.setIsShowingVisual),l=_e(f=>f.actions.setCardSql);function c(f){const g=HO(f,i);s(g);const p=VO(g,e,t);p&&(l(p),o(!0))}function d(){const f=P0(e,t);a(!1),l(`SELECT * FROM ${f} LIMIT 10`),o(!0)}return _.jsxs("div",{className:"px-4",children:[_.jsx("div",{className:" font-medium px-2 pt-2 pb-3",children:_.jsxs(ot,{disabled:r!=="Success",onClick:d,variant:"secondary",className:" h-7 flex w-full",children:[r!=="Success"&&_.jsx(Mu,{className:" w-4 h-4 animate-spin mr-2 text-foreground/50"}),"Show top 10 rows"]})}),_.jsxs(kl,{className:`w-full ${t==="api"?"h-[74vh]":"h-[60vh]"}`,children:[n==null?void 0:n.map(f=>_.jsxs("div",{onClick:()=>c(f),className:Pe(" text-sm flex items-center justify-between px-3 py-[6px] transition-colors hover:bg-muted/50 cursor-pointer rounded ",{" bg-muted":LW(f,i)}),children:[_.jsxs("div",{className:"flex items-center space-x-2 ",children:[_.jsx(dM,{column:f}),_.jsx("span",{children:f.column_name})]}),Tl.includes(f.data_type)&&_.jsx("div",{onClick:g=>g.stopPropagation(),className:" flex items-center justify-end ",children:_.jsx(LX,{column:f})})]},f.column_name)),_.jsx(Hh,{orientation:"vertical"}),_.jsx(Hh,{orientation:"horizontal"})]})]})}function fM({ColumnsComponent:e}){const t=_e(Y=>Y.selectedConnectionId);_e(Y=>Y.card.sql);const n=_e(Y=>Y.selectedDatabaseName),r=_e(Y=>Y.selectedSchemaName),i=_e(Y=>Y.selectedTableName),o=_e(Y=>Y.actions.setSelectedConnectionId),s=_e(Y=>Y.actions.setSelectedDatabaseName),a=_e(Y=>Y.actions.setSelectedSchemaName),l=_e(Y=>Y.actions.setSelectedTableName),c=_e(Y=>Y.actions.setCardSql),{connectionItems:d,schemaItems:f,databaseItems:g,tableItems:p,columns:v,isConnectionsLoading:y,isConnectionsError:x,isDatabasesLoadingOrFetching:w,isDatabaseError:S,isSchemaLoadingOrFetching:C,isSchemaError:P,isColumnsError:O,isColumnsLoadingOrFetching:k,isAPIConnection:A}=ZV();m.useEffect(()=>{A&&(s("NA"),a(""),l("api"))},[A,c,l,a,s]);const L=A?"api":i||"",F=A?"":r||"";function j(Y){a(Y),l("")}function B(Y){s(Y),a(""),l("")}function V(Y){o(Y)}function K(){return e?e(F,L,v):_.jsx($X,{schemaName:F,tableName:L,columns:v,status:k?"Loading...":O?"Error":"Success"})}return _.jsxs("aside",{className:" grow flex flex-col xbg-red-100 ",children:[_.jsxs("section",{className:"space-y-3 pt-4 pb-3 px-6",children:[_.jsx(Ap,{items:d,title:"Connection",value:t||"",onChange:V,isLoading:y,isError:x}),!A&&_.jsxs(_.Fragment,{children:[_.jsx(Ap,{onChange:B,isError:S,isLoading:w,items:g,value:n||"",title:"Database"}),_.jsx(Ap,{onChange:j,isError:P,isLoading:C,items:f,value:r||"",title:"Schema"}),_.jsx(Ap,{onChange:l,isError:S,items:p,isLoading:w,value:i||"",title:"Table"})]})]}),K(),_.jsx("div",{className:" grow justify-end flex flex-col pt-6 "})]})}const{createElement:zl,createContext:FX,createRef:ofe,forwardRef:hM,useCallback:Rr,useContext:pM,useEffect:Sa,useImperativeHandle:gM,useLayoutEffect:jX,useMemo:zX,useRef:ei,useState:Ip}=ue,mM=ue.useId,Np=FX(null);Np.displayName="PanelGroupContext";const Qu=jX,BX=typeof mM=="function"?mM:()=>null;let VX=0;function Oy(e=null){const t=BX(),n=ei(e||t||null);return n.current===null&&(n.current=""+VX++),e??n.current}function vM({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:i,forwardedRef:o,id:s,maxSize:a,minSize:l,onCollapse:c,onExpand:d,onResize:f,order:g,style:p,tagName:v="div",...y}){const x=pM(Np);if(x===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:w,expandPanel:S,getPanelSize:C,getPanelStyle:P,groupId:O,isPanelCollapsed:k,registerPanel:A,resizePanel:L,unregisterPanel:F}=x,j=Oy(s),B=ei({callbacks:{onCollapse:c,onExpand:d,onResize:f},constraints:{collapsedSize:n,collapsible:r,defaultSize:i,maxSize:a,minSize:l},id:j,idIsFromProps:s!==void 0,order:g});ei({didLogMissingDefaultSizeWarning:!1}),Qu(()=>{const{callbacks:K,constraints:Y}=B.current;B.current.id=j,B.current.idIsFromProps=s!==void 0,B.current.order=g,K.onCollapse=c,K.onExpand=d,K.onResize=f,Y.collapsedSize=n,Y.collapsible=r,Y.defaultSize=i,Y.maxSize=a,Y.minSize=l}),Qu(()=>{const K=B.current;return A(K),()=>{F(K)}},[g,j,A,F]),gM(o,()=>({collapse:()=>{w(B.current)},expand:()=>{S(B.current)},getId(){return j},getSize(){return C(B.current)},isCollapsed(){return k(B.current)},isExpanded(){return!k(B.current)},resize:K=>{L(B.current,K)}}),[w,S,C,k,j,L]);const V=P(B.current,i);return zl(v,{...y,children:e,className:t,style:{...V,...p},"data-panel":"","data-panel-id":j,"data-panel-group-id":O,"data-panel-collapsible":void 0,"data-panel-size":void 0})}const bM=hM((e,t)=>zl(vM,{...e,forwardedRef:t}));vM.displayName="Panel",bM.displayName="forwardRef(Panel)";function st(e,t="Assertion failed!"){if(!e)throw console.error(t),Error(t)}const yM=10;function Ju(e,t,n=yM){e=parseFloat(e.toFixed(n)),t=parseFloat(t.toFixed(n));const r=e-t;return r===0?0:r>0?1:-1}function Lr(e,t,n){return Ju(e,t,n)===0}function Bl({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];st(r!=null);let{collapsedSize:i=0,collapsible:o,maxSize:s=100,minSize:a=0}=r;if(Ju(n,a)<0)if(o){const l=(i+a)/2;Ju(n,l)<0?n=i:n=a}else n=a;return n=Math.min(s,n),n=parseFloat(n.toFixed(yM)),n}function Zu({delta:e,layout:t,panelConstraints:n,pivotIndices:r,trigger:i}){if(Lr(e,0))return t;const o=[...t],[s,a]=r;st(s!=null),st(a!=null);let l=0;if(i==="keyboard"){{const d=e<0?a:s,f=n[d];if(st(f),f.collapsible){const g=t[d];st(g!=null);const p=n[d];st(p);const{collapsedSize:v=0,minSize:y=0}=p;if(Lr(g,v)){const x=y-g;Ju(x,Math.abs(e))>0&&(e=e<0?0-x:x)}}}{const d=e<0?s:a,f=n[d];st(f);const{collapsible:g}=f;if(g){const p=t[d];st(p!=null);const v=n[d];st(v);const{collapsedSize:y=0,minSize:x=0}=v;if(Lr(p,x)){const w=p-y;Ju(w,Math.abs(e))>0&&(e=e<0?0-w:w)}}}}{const d=e<0?1:-1;let f=e<0?a:s,g=0;for(;;){const v=t[f];st(v!=null);const x=Bl({panelConstraints:n,panelIndex:f,size:100})-v;if(g+=x,f+=d,f<0||f>=n.length)break}const p=Math.min(Math.abs(e),Math.abs(g));e=e<0?0-p:p}{let f=e<0?s:a;for(;f>=0&&f<n.length;){const g=Math.abs(e)-Math.abs(l),p=t[f];st(p!=null);const v=p-g,y=Bl({panelConstraints:n,panelIndex:f,size:v});if(!Lr(p,y)&&(l+=p-y,o[f]=y,l.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?f--:f++}}if(Lr(l,0))return t;{const d=e<0?a:s,f=t[d];st(f!=null);const g=f+l,p=Bl({panelConstraints:n,panelIndex:d,size:g});if(o[d]=p,!Lr(p,g)){let v=g-p,x=e<0?a:s;for(;x>=0&&x<n.length;){const w=o[x];st(w!=null);const S=w+v,C=Bl({panelConstraints:n,panelIndex:x,size:S});if(Lr(w,C)||(v-=C-w,o[x]=C),Lr(v,0))break;e>0?x--:x++}}}const c=o.reduce((d,f)=>f+d,0);return Lr(c,100)?o:t}function HX({layout:e,panelsArray:t,pivotIndices:n}){let r=0,i=100,o=0,s=0;const a=n[0];st(a!=null),t.forEach((f,g)=>{const{constraints:p}=f,{maxSize:v=100,minSize:y=0}=p;g===a?(r=y,i=v):(o+=y,s+=v)});const l=Math.min(i,100-o),c=Math.max(r,100-s),d=e[a];return{valueMax:l,valueMin:c,valueNow:d}}function ed(e){return Array.from(document.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function xM(e,t){const r=ed(e).findIndex(i=>i.getAttribute("data-panel-resize-handle-id")===t);return r??null}function wM(e,t){const n=xM(e,t);return n!=null?[n,n+1]:[-1,-1]}function _M(e){const t=document.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return t||null}function Rp(e){const t=document.querySelector(`[data-panel-resize-handle-id="${e}"]`);return t||null}function WX(e,t,n){var r,i,o,s;const a=Rp(t),l=ed(e),c=a?l.indexOf(a):-1,d=(r=(i=n[c])===null||i===void 0?void 0:i.id)!==null&&r!==void 0?r:null,f=(o=(s=n[c+1])===null||s===void 0?void 0:s.id)!==null&&o!==void 0?o:null;return[d,f]}function qX({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:i,setLayout:o}){ei({didWarnAboutMissingResizeHandle:!1}),Qu(()=>{const s=ed(n);for(let a=0;a<i.length-1;a++){const{valueMax:l,valueMin:c,valueNow:d}=HX({layout:r,panelsArray:i,pivotIndices:[a,a+1]}),f=s[a];if(f!=null){const g=i[a];st(g),f.setAttribute("aria-controls",g.id),f.setAttribute("aria-valuemax",""+Math.round(l)),f.setAttribute("aria-valuemin",""+Math.round(c)),f.setAttribute("aria-valuenow",d!=null?""+Math.round(d):"")}}return()=>{s.forEach((a,l)=>{a.removeAttribute("aria-controls"),a.removeAttribute("aria-valuemax"),a.removeAttribute("aria-valuemin"),a.removeAttribute("aria-valuenow")})}},[n,r,i]),Sa(()=>{const s=t.current;st(s);const{panelDataArray:a}=s,l=_M(n);st(l!=null,`No group found for id "${n}"`);const c=ed(n);st(c);const d=c.map(f=>{const g=f.getAttribute("data-panel-resize-handle-id");st(g);const[p,v]=WX(n,g,a);if(p==null||v==null)return()=>{};const y=x=>{if(!x.defaultPrevented)switch(x.key){case"Enter":{x.preventDefault();const w=a.findIndex(S=>S.id===p);if(w>=0){const S=a[w];st(S);const C=r[w],{collapsedSize:P=0,collapsible:O,minSize:k=0}=S.constraints;if(C!=null&&O){const A=Zu({delta:Lr(C,P)?k-P:P-C,layout:r,panelConstraints:a.map(L=>L.constraints),pivotIndices:wM(n,g),trigger:"keyboard"});r!==A&&o(A)}}break}}};return f.addEventListener("keydown",y),()=>{f.removeEventListener("keydown",y)}});return()=>{d.forEach(f=>f())}},[e,t,n,r,i,o])}function SM(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function CM(e){return e.type==="keydown"}function EM(e){return e.type.startsWith("mouse")}function OM(e){return e.type.startsWith("touch")}function PM(e,t){const n=e==="horizontal";if(EM(t))return n?t.clientX:t.clientY;if(OM(t)){const r=t.touches[0];return st(r),n?r.screenX:r.screenY}else throw Error(`Unsupported event type "${t.type}"`)}function UX(e,t,n,r){const i=n==="horizontal",o=Rp(t);st(o);const s=o.getAttribute("data-panel-group-id");st(s);let{initialCursorPosition:a}=r;const l=PM(n,e),c=_M(s);st(c);const d=c.getBoundingClientRect(),f=i?d.width:d.height;return(l-a)/f*100}function GX(e,t,n,r,i){if(CM(e)){const o=n==="horizontal";let s=0;e.shiftKey?s=100:i!=null?s=i:s=10;let a=0;switch(e.key){case"ArrowDown":a=o?0:s;break;case"ArrowLeft":a=o?-s:0;break;case"ArrowRight":a=o?s:0;break;case"ArrowUp":a=o?0:-s;break;case"End":a=100;break;case"Home":a=-100;break}return a}else return r==null?0:UX(e,t,n,r)}function YX({panelDataArray:e}){const t=Array(e.length),n=e.map(o=>o.constraints);let r=0,i=100;for(let o=0;o<e.length;o++){const s=n[o];st(s);const{defaultSize:a}=s;a!=null&&(r++,t[o]=a,i-=a)}for(let o=0;o<e.length;o++){const s=n[o];st(s);const{defaultSize:a}=s;if(a!=null)continue;const l=e.length-r,c=i/l;r++,t[o]=c,i-=c}return t}function Vl(e,t,n){t.forEach((r,i)=>{const o=e[i];st(o);const{callbacks:s,constraints:a,id:l}=o,{collapsedSize:c=0,collapsible:d}=a,f=n[l];if(f==null||r!==f){n[l]=r;const{onCollapse:g,onExpand:p,onResize:v}=s;v&&v(r,f),d&&(g||p)&&(p&&(f==null||f===c)&&r!==c&&p(),g&&(f==null||f!==c)&&r===c&&g())}})}function Lp(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function KX({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:i,precision:o=3}){const s=n[i];let a;return s==null?a=e??"1":r.length===1?a="1":a=s.toPrecision(o),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}let Py=null,Ca=null;function kM(e){switch(e){case"horizontal":return"ew-resize";case"horizontal-max":return"w-resize";case"horizontal-min":return"e-resize";case"vertical":return"ns-resize";case"vertical-max":return"n-resize";case"vertical-min":return"s-resize"}}function XX(){Ca!==null&&(document.head.removeChild(Ca),Py=null,Ca=null)}function ky(e){if(Py===e)return;Py=e;const t=kM(e);Ca===null&&(Ca=document.createElement("style"),document.head.appendChild(Ca)),Ca.innerHTML=`*{cursor: ${t}!important;}`}function QX(e,t=10){let n=null;return(...i)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...i)},t)}}function MM(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function DM(e){return`react-resizable-panels:${e}`}function TM(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:i,order:o}=t;return i?r:o?`${o}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function AM(e,t){try{const n=DM(e),r=t.getItem(n);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function JX(e,t,n){var r,i;const o=(r=AM(e,n))!==null&&r!==void 0?r:{},s=TM(t);return(i=o[s])!==null&&i!==void 0?i:null}function ZX(e,t,n,r,i){var o;const s=DM(e),a=TM(t),l=(o=AM(e,i))!==null&&o!==void 0?o:{};l[a]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{i.setItem(s,JSON.stringify(l))}catch(c){console.error(c)}}function IM({layout:e,panelConstraints:t}){const n=[...e],r=n.reduce((o,s)=>o+s,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(o=>`${o}%`).join(", ")}`);if(!Lr(r,100))for(let o=0;o<t.length;o++){const s=n[o];st(s!=null);const a=100/r*s;n[o]=a}let i=0;for(let o=0;o<t.length;o++){const s=n[o];st(s!=null);const a=Bl({panelConstraints:t,panelIndex:o,size:s});s!=a&&(i+=s-a,n[o]=a)}if(!Lr(i,0))for(let o=0;o<t.length;o++){const s=n[o];st(s!=null);const a=s+i,l=Bl({panelConstraints:t,panelIndex:o,size:a});if(s!==l&&(i-=l-s,n[o]=l,Lr(i,0)))break}return n}const eQ=100,td={getItem:e=>(MM(td),td.getItem(e)),setItem:(e,t)=>{MM(td),td.setItem(e,t)}},NM={};function RM({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:i,id:o=null,onLayout:s=null,keyboardResizeBy:a=null,storage:l=td,style:c,tagName:d="div",...f}){const g=Oy(o),[p,v]=Ip(null),[y,x]=Ip([]),w=ei({}),S=ei(new Map),C=ei(0),P=ei({autoSaveId:e,direction:r,dragState:p,id:g,keyboardResizeBy:a,onLayout:s,storage:l}),O=ei({layout:y,panelDataArray:[],panelDataArrayChanged:!1});ei({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),gM(i,()=>({getId:()=>P.current.id,getLayout:()=>{const{layout:M}=O.current;return M},setLayout:M=>{const{onLayout:H}=P.current,{layout:ne,panelDataArray:N}=O.current,X=IM({layout:M,panelConstraints:N.map(me=>me.constraints)});SM(ne,X)||(x(X),O.current.layout=X,H&&H(X),Vl(N,X,w.current))}}),[]),Qu(()=>{P.current.autoSaveId=e,P.current.direction=r,P.current.dragState=p,P.current.id=g,P.current.onLayout=s,P.current.storage=l}),qX({committedValuesRef:P,eagerValuesRef:O,groupId:g,layout:y,panelDataArray:O.current.panelDataArray,setLayout:x}),Sa(()=>{const{panelDataArray:M}=O.current;if(e){if(y.length===0||y.length!==M.length)return;let H=NM[e];H==null&&(H=QX(ZX,eQ),NM[e]=H);const ne=[...M],N=new Map(S.current);H(e,ne,N,y,l)}},[e,y,l]),Sa(()=>{});const k=Rr(M=>{const{onLayout:H}=P.current,{layout:ne,panelDataArray:N}=O.current;if(M.constraints.collapsible){const X=N.map(re=>re.constraints),{collapsedSize:me=0,panelSize:he,pivotIndices:de}=Wl(N,M,ne);if(st(he!=null),he!==me){S.current.set(M.id,he);const ee=Hl(N,M)===N.length-1?he-me:me-he,W=Zu({delta:ee,layout:ne,panelConstraints:X,pivotIndices:de,trigger:"imperative-api"});Lp(ne,W)||(x(W),O.current.layout=W,H&&H(W),Vl(N,W,w.current))}}},[]),A=Rr(M=>{const{onLayout:H}=P.current,{layout:ne,panelDataArray:N}=O.current;if(M.constraints.collapsible){const X=N.map(ee=>ee.constraints),{collapsedSize:me=0,panelSize:he,minSize:de=0,pivotIndices:re}=Wl(N,M,ne);if(he===me){const ee=S.current.get(M.id),W=ee!=null&&ee>=de?ee:de,oe=Hl(N,M)===N.length-1?he-W:W-he,Te=Zu({delta:oe,layout:ne,panelConstraints:X,pivotIndices:re,trigger:"imperative-api"});Lp(ne,Te)||(x(Te),O.current.layout=Te,H&&H(Te),Vl(N,Te,w.current))}}},[]),L=Rr(M=>{const{layout:H,panelDataArray:ne}=O.current,{panelSize:N}=Wl(ne,M,H);return st(N!=null),N},[]),F=Rr((M,H)=>{const{panelDataArray:ne}=O.current,N=Hl(ne,M);return KX({defaultSize:H,dragState:p,layout:y,panelData:ne,panelIndex:N})},[p,y]),j=Rr(M=>{const{layout:H,panelDataArray:ne}=O.current,{collapsedSize:N=0,collapsible:X,panelSize:me}=Wl(ne,M,H);return X===!0&&me===N},[]),B=Rr(M=>{const{layout:H,panelDataArray:ne}=O.current,{collapsedSize:N=0,collapsible:X,panelSize:me}=Wl(ne,M,H);return st(me!=null),!X||me>N},[]),V=Rr(M=>{const{panelDataArray:H}=O.current;H.push(M),H.sort((ne,N)=>{const X=ne.order,me=N.order;return X==null&&me==null?0:X==null?-1:me==null?1:X-me}),O.current.panelDataArrayChanged=!0},[]);Qu(()=>{if(O.current.panelDataArrayChanged){O.current.panelDataArrayChanged=!1;const{autoSaveId:M,onLayout:H,storage:ne}=P.current,{layout:N,panelDataArray:X}=O.current;let me=null;if(M){const de=JX(M,X,ne);de&&(S.current=new Map(Object.entries(de.expandToSizes)),me=de.layout)}me==null&&(me=YX({panelDataArray:X}));const he=IM({layout:me,panelConstraints:X.map(de=>de.constraints)});SM(N,he)||(x(he),O.current.layout=he,H&&H(he),Vl(X,he,w.current))}});const K=Rr(M=>function(ne){ne.preventDefault();const{direction:N,dragState:X,id:me,keyboardResizeBy:he,onLayout:de}=P.current,{layout:re,panelDataArray:ee}=O.current,{initialLayout:W}=X??{},ye=wM(me,M);let oe=GX(ne,M,N,X,he);if(oe===0)return;const Te=N==="horizontal";document.dir==="rtl"&&Te&&(oe=-oe);const Fe=ee.map(St=>St.constraints),He=Zu({delta:oe,layout:W??re,panelConstraints:Fe,pivotIndices:ye,trigger:CM(ne)?"keyboard":"mouse-or-touch"}),Ke=!Lp(re,He);(EM(ne)||OM(ne))&&C.current!=oe&&(C.current=oe,ky(Ke?Te?"horizontal":"vertical":Te?oe<0?"horizontal-min":"horizontal-max":oe<0?"vertical-min":"vertical-max")),Ke&&(x(He),O.current.layout=He,de&&de(He),Vl(ee,He,w.current))},[]),Y=Rr((M,H)=>{const{onLayout:ne}=P.current,{layout:N,panelDataArray:X}=O.current,me=X.map(ye=>ye.constraints),{panelSize:he,pivotIndices:de}=Wl(X,M,N);st(he!=null);const ee=Hl(X,M)===X.length-1?he-H:H-he,W=Zu({delta:ee,layout:N,panelConstraints:me,pivotIndices:de,trigger:"imperative-api"});Lp(N,W)||(x(W),O.current.layout=W,ne&&ne(W),Vl(X,W,w.current))},[]),$=Rr((M,H)=>{const{direction:ne}=P.current,{layout:N}=O.current,X=Rp(M);st(X);const me=PM(ne,H);v({dragHandleId:M,dragHandleRect:X.getBoundingClientRect(),initialCursorPosition:me,initialLayout:N})},[]),Z=Rr(()=>{XX(),v(null)},[]),U=Rr(M=>{const{panelDataArray:H}=O.current,ne=Hl(H,M);ne>=0&&(H.splice(ne,1),delete w.current[M.id],O.current.panelDataArrayChanged=!0)},[]),ie=zX(()=>({collapsePanel:k,direction:r,dragState:p,expandPanel:A,getPanelSize:L,getPanelStyle:F,groupId:g,isPanelCollapsed:j,isPanelExpanded:B,registerPanel:V,registerResizeHandle:K,resizePanel:Y,startDragging:$,stopDragging:Z,unregisterPanel:U}),[k,p,r,A,L,F,g,j,B,V,K,Y,$,Z,U]),le={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return zl(Np.Provider,{value:ie},zl(d,{...f,children:t,className:n,style:{...le,...c},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":g}))}const LM=hM((e,t)=>zl(RM,{...e,forwardedRef:t}));RM.displayName="PanelGroup",LM.displayName="forwardRef(PanelGroup)";function Hl(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function Wl(e,t,n){const r=e.map(c=>c.constraints),i=Hl(e,t),o=r[i],a=i===e.length-1?[i-1,i]:[i,i+1],l=n[i];return{...o,panelSize:l,pivotIndices:a}}function tQ({disabled:e,handleId:t,resizeHandler:n}){Sa(()=>{if(e||n==null)return;const r=Rp(t);if(r==null)return;const i=o=>{if(!o.defaultPrevented)switch(o.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{o.preventDefault(),n(o);break}case"F6":{o.preventDefault();const s=r.getAttribute("data-panel-group-id");st(s);const a=ed(s),l=xM(s,t);st(l!==null);const c=o.shiftKey?l>0?l-1:a.length-1:l+1<a.length?l+1:0;a[c].focus();break}}};return r.addEventListener("keydown",i),()=>{r.removeEventListener("keydown",i)}},[e,t,n])}function $M({children:e=null,className:t="",disabled:n=!1,id:r,onDragging:i,style:o={},tabIndex:s=0,tagName:a="div",...l}){const c=ei(null),d=ei({onDragging:i});Sa(()=>{d.current.onDragging=i});const f=pM(Np);if(f===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:g,dragState:p,groupId:v,registerResizeHandle:y,startDragging:x,stopDragging:w}=f,S=Oy(r),C=(p==null?void 0:p.dragHandleId)===S,[P,O]=Ip(!1),[k,A]=Ip(null),L=Rr(()=>{const j=c.current;st(j),j.blur(),w();const{onDragging:B}=d.current;B&&B(!1)},[w]);Sa(()=>{if(n)A(null);else{const j=y(S);A(()=>j)}},[n,S,y]),Sa(()=>{if(n||k==null||!C)return;const j=Y=>{k(Y)},B=Y=>{k(Y)},V=c.current;st(V);const K=V.ownerDocument;return K.body.addEventListener("contextmenu",L),K.body.addEventListener("mousemove",j),K.body.addEventListener("touchmove",j),K.body.addEventListener("mouseleave",B),window.addEventListener("mouseup",L),window.addEventListener("touchend",L),()=>{K.body.removeEventListener("contextmenu",L),K.body.removeEventListener("mousemove",j),K.body.removeEventListener("touchmove",j),K.body.removeEventListener("mouseleave",B),window.removeEventListener("mouseup",L),window.removeEventListener("touchend",L)}},[g,n,C,k,L]),tQ({disabled:n,handleId:S,resizeHandler:k});const F={cursor:kM(g),touchAction:"none",userSelect:"none"};return zl(a,{...l,children:e,className:t,onBlur:()=>O(!1),onFocus:()=>O(!0),onMouseDown:j=>{x(S,j.nativeEvent);const B=d.current;st(B);const{onDragging:V}=B;V&&V(!0)},onMouseUp:L,onTouchCancel:L,onTouchEnd:L,onTouchStart:j=>{x(S,j.nativeEvent);const B=d.current;st(B);const{onDragging:V}=B;V&&V(!0)},ref:c,role:"separator",style:{...F,...o},tabIndex:s,"data-panel-group-direction":g,"data-panel-group-id":v,"data-resize-handle":"","data-resize-handle-active":C?"pointer":P?"keyboard":void 0,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":S})}$M.displayName="PanelResizeHandle";const FM=({className:e,...t})=>_.jsx(LM,{className:Pe("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}),$p=bM,jM=({withHandle:e,className:t,...n})=>_.jsx($M,{className:Pe("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),...n,children:e&&_.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:_.jsx(GB,{className:"h-2.5 w-2.5"})})});function nQ(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function BM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zM(Object(n),!0).forEach(function(r){nQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rQ(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function iQ(e,t){if(e==null)return{};var n=rQ(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function oQ(e,t){return sQ(e)||aQ(e,t)||lQ(e,t)||cQ()}function sQ(e){if(Array.isArray(e))return e}function aQ(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,i=!1,o=void 0;try{for(var s=e[Symbol.iterator](),a;!(r=(a=s.next()).done)&&(n.push(a.value),!(t&&n.length===t));r=!0);}catch(l){i=!0,o=l}finally{try{!r&&s.return!=null&&s.return()}finally{if(i)throw o}}return n}}function lQ(e,t){if(e){if(typeof e=="string")return VM(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return VM(e,t)}}function VM(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function cQ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
417
|
+
`)},fG=0,Ll=[];function hG(e){var t=ue.useRef([]),n=ue.useRef([0,0]),r=ue.useRef(),i=ue.useState(fG++)[0],o=ue.useState(function(){return LP()})[0],s=ue.useRef(e);ue.useEffect(function(){s.current=e},[e]),ue.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var y=RU([e.lockRef.current],(e.shards||[]).map(VP),!0).filter(Boolean);return y.forEach(function(x){return x.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),y.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=ue.useCallback(function(y,x){if("touches"in y&&y.touches.length===2)return!s.current.allowPinchZoom;var w=fp(y),S=n.current,C="deltaX"in y?y.deltaX:S[0]-w[0],P="deltaY"in y?y.deltaY:S[1]-w[1],O,k=y.target,A=Math.abs(C)>Math.abs(P)?"h":"v";if("touches"in y&&A==="h"&&k.type==="range")return!1;var L=FP(A,k);if(!L)return!0;if(L?O=A:(O=A==="v"?"h":"v",L=FP(A,k)),!L)return!1;if(!r.current&&"changedTouches"in y&&(C||P)&&(r.current=O),!O)return!0;var F=r.current||O;return cG(F,x,y,F==="h"?C:P,!0)},[]),l=ue.useCallback(function(y){var x=y;if(!(!Ll.length||Ll[Ll.length-1]!==o)){var w="deltaY"in x?BP(x):fp(x),S=t.current.filter(function(O){return O.name===x.type&&O.target===x.target&&uG(O.delta,w)})[0];if(S&&S.should){x.cancelable&&x.preventDefault();return}if(!S){var C=(s.current.shards||[]).map(VP).filter(Boolean).filter(function(O){return O.contains(x.target)}),P=C.length>0?a(x,C[0]):!s.current.noIsolation;P&&x.cancelable&&x.preventDefault()}}},[]),c=ue.useCallback(function(y,x,w,S){var C={name:y,delta:x,target:w,should:S};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(P){return P!==C})},1)},[]),d=ue.useCallback(function(y){n.current=fp(y),r.current=void 0},[]),f=ue.useCallback(function(y){c(y.type,BP(y),y.target,a(y,e.lockRef.current))},[]),g=ue.useCallback(function(y){c(y.type,fp(y),y.target,a(y,e.lockRef.current))},[]);ue.useEffect(function(){return Ll.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:g}),document.addEventListener("wheel",l,Rl),document.addEventListener("touchmove",l,Rl),document.addEventListener("touchstart",d,Rl),function(){Ll=Ll.filter(function(y){return y!==o}),document.removeEventListener("wheel",l,Rl),document.removeEventListener("touchmove",l,Rl),document.removeEventListener("touchstart",d,Rl)}},[]);var p=e.removeScrollBar,v=e.inert;return ue.createElement(ue.Fragment,null,v?ue.createElement(o,{styles:dG(i)}):null,p?ue.createElement(nG,{gapMode:"margin"}):null)}const pG=WU(NP,hG);var HP=ue.forwardRef(function(e,t){return ue.createElement(up,Wi({},e,{ref:t,sideCar:pG}))});HP.classNames=up.classNames;const hp=HP,WP="Popover",[qP,Jde]=Pn(WP,[Fi]),iy=Fi(),[gG,$l]=qP(WP),mG=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!1}=e,a=iy(t),l=m.useRef(null),[c,d]=m.useState(!1),[f=!1,g]=Qn({prop:r,defaultProp:i,onChange:o});return m.createElement(Eu,a,m.createElement(gG,{scope:t,contentId:or(),triggerRef:l,open:f,onOpenChange:g,onOpenToggle:m.useCallback(()=>g(p=>!p),[g]),hasCustomAnchor:c,onCustomAnchorAdd:m.useCallback(()=>d(!0),[]),onCustomAnchorRemove:m.useCallback(()=>d(!1),[]),modal:s},n))},vG="PopoverTrigger",bG=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=$l(vG,n),o=iy(n),s=et(t,i.triggerRef),a=m.createElement(Be.button,ae({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":YP(i.open)},r,{ref:s,onClick:Ce(e.onClick,i.onOpenToggle)}));return i.hasCustomAnchor?a:m.createElement(Ou,ae({asChild:!0},o),a)}),UP="PopoverPortal",[yG,xG]=qP(UP,{forceMount:void 0}),wG=e=>{const{__scopePopover:t,forceMount:n,children:r,container:i}=e,o=$l(UP,t);return m.createElement(yG,{scope:t,forceMount:n},m.createElement(vn,{present:n||o.open},m.createElement(Dh,{asChild:!0,container:i},r)))},Wu="PopoverContent",_G=m.forwardRef((e,t)=>{const n=xG(Wu,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,o=$l(Wu,e.__scopePopover);return m.createElement(vn,{present:r||o.open},o.modal?m.createElement(SG,ae({},i,{ref:t})):m.createElement(CG,ae({},i,{ref:t})))}),SG=m.forwardRef((e,t)=>{const n=$l(Wu,e.__scopePopover),r=m.useRef(null),i=et(t,r),o=m.useRef(!1);return m.useEffect(()=>{const s=r.current;if(s)return ap(s)},[]),m.createElement(hp,{as:no,allowPinchZoom:!0},m.createElement(GP,ae({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ce(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),o.current||(a=n.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:Ce(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;o.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Ce(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})))}),CG=m.forwardRef((e,t)=>{const n=$l(Wu,e.__scopePopover),r=m.useRef(!1),i=m.useRef(!1);return m.createElement(GP,ae({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s;if((s=e.onCloseAutoFocus)===null||s===void 0||s.call(e,o),!o.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),o.preventDefault()}r.current=!1,i.current=!1},onInteractOutside:o=>{var s,a;(s=e.onInteractOutside)===null||s===void 0||s.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}}))}),GP=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:d,...f}=e,g=$l(Wu,n),p=iy(n);return rp(),m.createElement(ip,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o},m.createElement(_l,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>g.onOpenChange(!1)},m.createElement(Pu,ae({"data-state":YP(g.open),role:"dialog",id:g.contentId},p,f,{ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}}))))});function YP(e){return e?"open":"closed"}const EG=mG,OG=bG,PG=wG,KP=_G,pp=EG,gp=OG,qu=ue.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},i)=>_.jsx(PG,{children:_.jsx(KP,{ref:i,align:t,sideOffset:n,className:Pe("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));qu.displayName=KP.displayName;function kG({filter:e,className:t}){const[n,r]=m.useState(!1),[i,o]=m.useState(),[s,a]=m.useState(),l=ge(C=>C.filterValues),c=ge(C=>C.authToken),d=ge(C=>C.actions.addOrUpdateFilterValue),f=ge(C=>C.actions.removeFilterValue),{data:g,isLoading:p,isFetching:v,isError:y,refetch:x}=Sr({queryKey:[e.sql],queryFn:()=>Is("https://semaphor.cloud/api/v1/query",(c==null?void 0:c.accessToken)||"",{connection_id:e.connectionId,sql:e.sql}),enabled:!!e.sql&&!!e.connectionId&&!!e.database});m.useEffect(()=>{var C;if(((C=g==null?void 0:g.records)==null?void 0:C.length)>0){const P=g.records[0];if(!P.min||!P.max)return;o({from:new Date(P.min),to:new Date(P.max)}),a({from:new Date(P.min),to:new Date(P.max)})}},[g]),m.useEffect(()=>{if(l&&!l.find(P=>P.filterId===e.id)){o(s);return}},[l,e.id,s]);function w(){f(e.id),o(s),r(!1)}function S(){if(!i)return;console.log(i);const C=[i==null?void 0:i.from,i==null?void 0:i.to];console.log(C);const P={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:O0(e),name:e.column,operation:"between",values:C};d(P),r(!1)}return p?_.jsx("div",{children:_.jsx(cf,{className:" bg-foreground/10 h-8 w-[250px]"})}):y?_.jsx("div",{className:"bg-muted h-8 w-[250px] px-2",children:"Error"}):g?_.jsx("div",{className:Pe("grid gap-2",t),children:_.jsxs(pp,{open:n,onOpenChange:r,children:[_.jsx(gp,{asChild:!0,children:_.jsxs(st,{size:"sm",id:"date",variant:"outline",className:Pe("w-[250px] justify-start text-left font-normal rounded-sm h-[34px]",!i&&"text-muted-foreground"),children:[_.jsx(VB,{className:"mr-2 h-4 w-4"}),i!=null&&i.from?i.to?_.jsxs(_.Fragment,{children:[Hi(i.from,"LLL dd, y")," -"," ",Hi(i.to,"LLL dd, y")]}):Hi(i.from,"LLL dd, y"):_.jsx("span",{children:"Pick a date"})]})}),_.jsxs(qu,{className:"w-auto p-0",align:"start",children:[_.jsx(CP,{initialFocus:!0,mode:"range",defaultMonth:i==null?void 0:i.from,selected:i,onSelect:o,numberOfMonths:2}),_.jsxs("div",{className:"flex justify-end px-4 py-3 gap-2",children:[_.jsx(st,{size:"sm",variant:"outline",onClick:S,children:"Apply"}),_.jsx(st,{size:"sm",variant:"outline",onClick:w,children:"Clear"})]})]})]})}):null}function MG(){const e=ge(s=>s.dashboard.filters),t=ge(s=>s.isDashboardEditing),n=ge(s=>s.actions.removeFilter),r=ge(s=>s.actions.updateFilter),i=ge(s=>s.actions.removeFilterValue);if(!e)return null;const o=s=>Nu.includes(s.dataType)?_.jsx(kG,{filter:s}):_.jsx(FW,{filter:s});return _.jsx("section",{role:"dashboard-filters",className:" px-[10px] pt-2 grow w-full items-center flex gap-2 flex-wrap ",children:e.map(s=>_.jsxs("div",{children:[_.jsx(qc,{className:" my-1 ",text:s.title||s.column,onSave:a=>r({...s,title:a}),children:_.jsxs("div",{className:"flex items-center justify-between group mb-1",children:[_.jsxs("div",{className:"flex gap-1 items-center ",children:[_.jsx(ns,{className:" inline-block text-sm ",children:s.title}),t&&_.jsx(ia,{onClick:()=>{i(s.id),n(s.id)},className:"w-3 h-3 invisible text-muted-foreground group-hover:visible hover:text-foreground cursor-pointer"})]}),_.jsx("div",{onClick:()=>i(s.id),className:" text-xs invisible group-hover:visible group-hover:underline cursor-pointer text-muted-foreground hover:text-foreground",children:"Clear"})]})}),o(s)]},s.id))})}function XP(){const e=ge(i=>{var o;return(o=i.dashboard)==null?void 0:o.sheets});ge(i=>i.isDashboardEditing);const t=ge(i=>i.themeStyle);ge(i=>i.isVisualEditing);const n=ge(i=>i.selectedSheetId),r=ge(i=>i.actions.setSelectedSheetId);return ge(i=>i.actions.setSheetTitle),e?_.jsxs(o_,{role:"dashboard-tabs-container",className:Pe(" grow bg-muted dark:bg-foreground/5 ",t==null?void 0:t.dashboardTabsContainer),onValueChange:i=>{r(i)},value:n||e[0].id,children:[_.jsx(MG,{}),e==null?void 0:e.map(i=>_.jsx(hf,{className:"mt-0",value:i.id,children:_.jsx(oH,{})},i.id))]}):null}function QP({children:e}){const t=new PN;return _.jsx(GN,{defaultTheme:"dark",storageKey:"vite-ui-theme",children:_.jsx(RB,{delayDuration:0,children:_.jsx(AN,{client:t,children:e})})})}function JP(e){return _.jsx(QP,{children:_.jsx(Gw,{...e,children:_.jsx(XP,{})})})}var DG=Object.defineProperty,TG=(e,t,n)=>t in e?DG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mp=(e,t,n)=>(TG(e,typeof t!="symbol"?t+"":t,n),n);const AG={stringify:e=>e,parse:e=>e},IG={stringify:e=>`${e}`,parse:e=>parseFloat(e)},NG={stringify:e=>e?"true":"false",parse:e=>/^[ty1-9]/i.test(e)},RG={stringify:e=>e.name,parse:(e,t)=>{const n=(()=>{if(typeof window<"u"&&e in window)return window[e];if(typeof global<"u"&&e in global)return global[e]})();return typeof n=="function"?n.bind(t):void 0}},LG={stringify:e=>JSON.stringify(e),parse:e=>JSON.parse(e)},oy={string:AG,number:IG,boolean:NG,function:RG,json:LG},sy=Symbol.for("r2wc.render"),vp=Symbol.for("r2wc.connected"),ma=Symbol.for("r2wc.context"),os=Symbol.for("r2wc.props");function $G(e,t,n){var r,i,o;t.props||(t.props=e.propTypes?Object.keys(e.propTypes):[]);const s=(Array.isArray(t.props)?t.props.slice():Object.keys(t.props)).filter(f=>f!=="container"),a={},l={},c={};for(const f of s){a[f]=Array.isArray(t.props)?"string":t.props[f];const g=FG(f);l[f]=g,c[g]=f}class d extends HTMLElement{constructor(){super(),mp(this,r,!0),mp(this,i),mp(this,o,{}),mp(this,"container"),t.shadow?this.container=this.attachShadow({mode:t.shadow}):this.container=this,this[os].container=this.container;for(const g of s){const p=l[g],v=this.getAttribute(p),y=a[g],x=oy[y];v&&x!=null&&x.parse&&(this[os][g]=x.parse(v,this))}}static get observedAttributes(){return Object.keys(c)}connectedCallback(){this[vp]=!0,this[sy]()}disconnectedCallback(){this[vp]=!1,this[ma]&&n.unmount(this[ma]),delete this[ma]}attributeChangedCallback(g,p,v){const y=c[g],x=a[y],w=oy[x];y in a&&w!=null&&w.parse&&(this[os][y]=w.parse(v,this),this[sy]())}[(r=vp,i=ma,o=os,sy)](){this[vp]&&(this[ma]?n.update(this[ma],this[os]):this[ma]=n.mount(this.container,e,this[os]))}}for(const f of s){const g=l[f],p=a[f];Object.defineProperty(d.prototype,f,{enumerable:!0,configurable:!0,get(){return this[os][f]},set(v){this[os][f]=v;const y=oy[p];if(y!=null&&y.stringify){const x=y.stringify(v);this.getAttribute(g)!==x&&this.setAttribute(g,x)}}})}return d}function FG(e=""){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function jG(e,t,n){const r=nf(e),i=m.createElement(t,n);return r.render(i),{root:r,ReactComponent:t}}function zG({root:e,ReactComponent:t},n){const r=m.createElement(t,n);e.render(r)}function BG({root:e}){e.unmount()}function VG(e,t={}){return $G(e,t,{mount:jG,update:zG,unmount:BG})}const HG=VG(JP,{props:{id:"string",authToken:"json",currentTheme:"string",style:"json",onEvent:"function",onSave:"function",LoadingComponent:"function",ErrorComponent:"function"}});function ay(e){var t;return{...e,sheets:(t=e==null?void 0:e.sheets)==null?void 0:t.map(n=>{var r;return{...n,cards:(r=n==null?void 0:n.cards)==null?void 0:r.map(i=>ZP(i))}})}}function ZP(e){var t,n,r,i;return{...e,cfg:{...e.cfg,data:{...(t=e.cfg)==null?void 0:t.data,labels:[],datasets:(i=(r=(n=e.cfg)==null?void 0:n.data)==null?void 0:r.datasets)==null?void 0:i.map(o=>({...o,data:[]}))}},customCfg:WG(e.customCfg),data:[]}}function WG(e){var t,n;return e?{...e,data:{...e==null?void 0:e.data,labels:[],datasets:(n=(t=e==null?void 0:e.data)==null?void 0:t.datasets)==null?void 0:n.map(r=>({...r,data:[]}))}}:null}function ss(e){return`semaphor:bookmark:${e}`}const ek="Dialog",[tk,efe]=Pn(ek),[qG,wi]=tk(ek),UG=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!0}=e,a=m.useRef(null),l=m.useRef(null),[c=!1,d]=Qn({prop:r,defaultProp:i,onChange:o});return m.createElement(qG,{scope:t,triggerRef:a,contentRef:l,contentId:or(),titleId:or(),descriptionId:or(),open:c,onOpenChange:d,onOpenToggle:m.useCallback(()=>d(f=>!f),[d]),modal:s},n)},GG="DialogTrigger",YG=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=wi(GG,n),o=et(t,i.triggerRef);return m.createElement(Be.button,ae({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":cy(i.open)},r,{ref:o,onClick:Ce(e.onClick,i.onOpenToggle)}))}),nk="DialogPortal",[KG,rk]=tk(nk,{forceMount:void 0}),XG=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=wi(nk,t);return m.createElement(KG,{scope:t,forceMount:n},m.Children.map(r,s=>m.createElement(vn,{present:n||o.open},m.createElement(Dh,{asChild:!0,container:i},s))))},ly="DialogOverlay",QG=m.forwardRef((e,t)=>{const n=rk(ly,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=wi(ly,e.__scopeDialog);return o.modal?m.createElement(vn,{present:r||o.open},m.createElement(JG,ae({},i,{ref:t}))):null}),JG=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=wi(ly,n);return m.createElement(hp,{as:no,allowPinchZoom:!0,shards:[i.contentRef]},m.createElement(Be.div,ae({"data-state":cy(i.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),Uu="DialogContent",ZG=m.forwardRef((e,t)=>{const n=rk(Uu,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=wi(Uu,e.__scopeDialog);return m.createElement(vn,{present:r||o.open},o.modal?m.createElement(eY,ae({},i,{ref:t})):m.createElement(tY,ae({},i,{ref:t})))}),eY=m.forwardRef((e,t)=>{const n=wi(Uu,e.__scopeDialog),r=m.useRef(null),i=et(t,n.contentRef,r);return m.useEffect(()=>{const o=r.current;if(o)return ap(o)},[]),m.createElement(ik,ae({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ce(e.onCloseAutoFocus,o=>{var s;o.preventDefault(),(s=n.triggerRef.current)===null||s===void 0||s.focus()}),onPointerDownOutside:Ce(e.onPointerDownOutside,o=>{const s=o.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&o.preventDefault()}),onFocusOutside:Ce(e.onFocusOutside,o=>o.preventDefault())}))}),tY=m.forwardRef((e,t)=>{const n=wi(Uu,e.__scopeDialog),r=m.useRef(!1),i=m.useRef(!1);return m.createElement(ik,ae({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s;if((s=e.onCloseAutoFocus)===null||s===void 0||s.call(e,o),!o.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),o.preventDefault()}r.current=!1,i.current=!1},onInteractOutside:o=>{var s,a;(s=e.onInteractOutside)===null||s===void 0||s.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}}))}),ik=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...s}=e,a=wi(Uu,n),l=m.useRef(null),c=et(t,l);return rp(),m.createElement(m.Fragment,null,m.createElement(ip,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o},m.createElement(_l,ae({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":cy(a.open)},s,{ref:c,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),nY="DialogTitle",rY=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=wi(nY,n);return m.createElement(Be.h2,ae({id:i.titleId},r,{ref:t}))}),iY="DialogDescription",oY=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=wi(iY,n);return m.createElement(Be.p,ae({id:i.descriptionId},r,{ref:t}))}),sY="DialogClose",aY=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=wi(sY,n);return m.createElement(Be.button,ae({type:"button"},r,{ref:t,onClick:Ce(e.onClick,()=>i.onOpenChange(!1))}))});function cy(e){return e?"open":"closed"}const lY=UG,cY=YG,uY=XG,ok=QG,sk=ZG,ak=rY,lk=oY,dY=aY,uy=lY,dy=cY,fY=uY,ck=ue.forwardRef(({className:e,...t},n)=>_.jsx(ok,{ref:n,className:Pe("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));ck.displayName=ok.displayName;const bp=ue.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(fY,{children:[_.jsx(ck,{}),_.jsxs(sk,{ref:r,className:Pe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,_.jsxs(dY,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[_.jsx(tV,{className:"h-4 w-4"}),_.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));bp.displayName=sk.displayName;const yp=({className:e,...t})=>_.jsx("div",{className:Pe("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});yp.displayName="DialogHeader";const fy=({className:e,...t})=>_.jsx("div",{className:Pe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});fy.displayName="DialogFooter";const xp=ue.forwardRef(({className:e,...t},n)=>_.jsx(ak,{ref:n,className:Pe("text-lg font-semibold leading-none tracking-tight",e),...t}));xp.displayName=ak.displayName;const wp=ue.forwardRef(({className:e,...t},n)=>_.jsx(lk,{ref:n,className:Pe("text-sm text-muted-foreground",e),...t}));wp.displayName=lk.displayName;const Gu=ue.forwardRef(({className:e,type:t,...n},r)=>_.jsx("input",{type:t,className:Pe("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));Gu.displayName="Input";function hY(){const[e,t]=m.useState(""),[n,r]=m.useState(!1),[i,o]=m.useState(!1),s=ge(l=>l.dashboard);function a(){const l=ay(s),c=ss(s.id),d=JSON.parse(localStorage.getItem(c)||"[]");if(d.some(g=>g.name===e)){r(!0);return}d.push({name:e,template:l}),localStorage.setItem(c,JSON.stringify(d)),o(!1)}return _.jsxs(uy,{open:i,onOpenChange:o,children:[_.jsx(dy,{asChild:!0,children:_.jsxs(st,{variant:"outline",className:"h-7 p-2",size:"sm",children:[_.jsx(q2,{className:" mr-2 h-4 w-4",strokeWidth:1.5}),"Add Lens"]})}),_.jsxs(bp,{className:"sm:max-w-[425px]",children:[_.jsxs(yp,{children:[_.jsx(xp,{children:"Add a Lens"}),_.jsx(wp,{children:"Lenses are private by default and are only visible to you."})]}),_.jsx("div",{className:"grid gap-4 py-4",children:_.jsxs("div",{className:"grid grid-cols-8 items-center gap-4",children:[_.jsx(ns,{className:"text-right",children:"Name"}),_.jsx(Gu,{value:e,onChange:l=>{n&&r(!1),t(l.target.value)},id:"name",className:"col-span-7 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"})]})}),n&&_.jsx("p",{className:"text-sm",children:"The bookmark name already exists. Use a differnet name."}),_.jsx(fy,{children:_.jsx(st,{variant:"outline",type:"submit",disabled:!e,onClick:a,children:"Save"})})]})]})}const hy=["Enter"," "],pY=["ArrowDown","PageUp","Home"],uk=["ArrowUp","PageDown","End"],gY=[...pY,...uk],mY={ltr:[...hy,"ArrowRight"],rtl:[...hy,"ArrowLeft"]},vY={ltr:["ArrowLeft"],rtl:["ArrowRight"]},_p="Menu",[Yu,bY,yY]=df(_p),[va,dk]=Pn(_p,[yY,Fi,ol]),py=Fi(),fk=ol(),[xY,ba]=va(_p),[wY,Ku]=va(_p),_Y=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:s=!0}=e,a=py(t),[l,c]=m.useState(null),d=m.useRef(!1),f=xn(o),g=Fs(i);return m.useEffect(()=>{const p=()=>{d.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>d.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),m.createElement(Eu,a,m.createElement(xY,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:c},m.createElement(wY,{scope:t,onClose:m.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:g,modal:s},r)))},hk=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=py(n);return m.createElement(Ou,ae({},i,r,{ref:t}))}),pk="MenuPortal",[SY,gk]=va(pk,{forceMount:void 0}),CY=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,o=ba(pk,t);return m.createElement(SY,{scope:t,forceMount:n},m.createElement(vn,{present:n||o.open},m.createElement(Dh,{asChild:!0,container:i},r)))},_i="MenuContent",[EY,gy]=va(_i),OY=m.forwardRef((e,t)=>{const n=gk(_i,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=ba(_i,e.__scopeMenu),s=Ku(_i,e.__scopeMenu);return m.createElement(Yu.Provider,{scope:e.__scopeMenu},m.createElement(vn,{present:r||o.open},m.createElement(Yu.Slot,{scope:e.__scopeMenu},s.modal?m.createElement(PY,ae({},i,{ref:t})):m.createElement(kY,ae({},i,{ref:t})))))}),PY=m.forwardRef((e,t)=>{const n=ba(_i,e.__scopeMenu),r=m.useRef(null),i=et(t,r);return m.useEffect(()=>{const o=r.current;if(o)return ap(o)},[]),m.createElement(my,ae({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ce(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),kY=m.forwardRef((e,t)=>{const n=ba(_i,e.__scopeMenu);return m.createElement(my,ae({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),my=m.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:g,onDismiss:p,disableOutsideScroll:v,...y}=e,x=ba(_i,n),w=Ku(_i,n),S=py(n),C=fk(n),P=bY(n),[O,k]=m.useState(null),A=m.useRef(null),L=et(t,A,x.onContentChange),F=m.useRef(0),j=m.useRef(""),B=m.useRef(0),V=m.useRef(null),K=m.useRef("right"),Y=m.useRef(0),$=v?hp:m.Fragment,Z=v?{as:no,allowPinchZoom:!0}:void 0,U=le=>{var M,H;const ne=j.current+le,N=P().filter(ee=>!ee.disabled),X=document.activeElement,me=(M=N.find(ee=>ee.ref.current===X))===null||M===void 0?void 0:M.textValue,he=N.map(ee=>ee.textValue),de=GY(he,ne,me),re=(H=N.find(ee=>ee.textValue===de))===null||H===void 0?void 0:H.ref.current;(function ee(W){j.current=W,window.clearTimeout(F.current),W!==""&&(F.current=window.setTimeout(()=>ee(""),1e3))})(ne),re&&setTimeout(()=>re.focus())};m.useEffect(()=>()=>window.clearTimeout(F.current),[]),rp();const ie=m.useCallback(le=>{var M,H;return K.current===((M=V.current)===null||M===void 0?void 0:M.side)&&KY(le,(H=V.current)===null||H===void 0?void 0:H.area)},[]);return m.createElement(EY,{scope:n,searchRef:j,onItemEnter:m.useCallback(le=>{ie(le)&&le.preventDefault()},[ie]),onItemLeave:m.useCallback(le=>{var M;ie(le)||((M=A.current)===null||M===void 0||M.focus(),k(null))},[ie]),onTriggerLeave:m.useCallback(le=>{ie(le)&&le.preventDefault()},[ie]),pointerGraceTimerRef:B,onPointerGraceIntentChange:m.useCallback(le=>{V.current=le},[])},m.createElement($,Z,m.createElement(ip,{asChild:!0,trapped:i,onMountAutoFocus:Ce(o,le=>{var M;le.preventDefault(),(M=A.current)===null||M===void 0||M.focus()}),onUnmountAutoFocus:s},m.createElement(_l,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:g,onDismiss:p},m.createElement(km,ae({asChild:!0},C,{dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:O,onCurrentTabStopIdChange:k,onEntryFocus:Ce(l,le=>{w.isUsingKeyboardRef.current||le.preventDefault()})}),m.createElement(Pu,ae({role:"menu","aria-orientation":"vertical","data-state":wk(x.open),"data-radix-menu-content":"",dir:w.dir},S,y,{ref:L,style:{outline:"none",...y.style},onKeyDown:Ce(y.onKeyDown,le=>{const H=le.target.closest("[data-radix-menu-content]")===le.currentTarget,ne=le.ctrlKey||le.altKey||le.metaKey,N=le.key.length===1;H&&(le.key==="Tab"&&le.preventDefault(),!ne&&N&&U(le.key));const X=A.current;if(le.target!==X||!gY.includes(le.key))return;le.preventDefault();const he=P().filter(de=>!de.disabled).map(de=>de.ref.current);uk.includes(le.key)&&he.reverse(),qY(he)}),onBlur:Ce(e.onBlur,le=>{le.currentTarget.contains(le.target)||(window.clearTimeout(F.current),j.current="")}),onPointerMove:Ce(e.onPointerMove,Xu(le=>{const M=le.target,H=Y.current!==le.clientX;if(le.currentTarget.contains(M)&&H){const ne=le.clientX>Y.current?"right":"left";K.current=ne,Y.current=le.clientX}}))})))))))}),MY=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Be.div,ae({role:"group"},r,{ref:t}))}),DY=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Be.div,ae({},r,{ref:t}))}),vy="MenuItem",mk="menu.itemSelect",by=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=m.useRef(null),s=Ku(vy,e.__scopeMenu),a=gy(vy,e.__scopeMenu),l=et(t,o),c=m.useRef(!1),d=()=>{const f=o.current;if(!n&&f){const g=new CustomEvent(mk,{bubbles:!0,cancelable:!0});f.addEventListener(mk,p=>r==null?void 0:r(p),{once:!0}),Kw(f,g),g.defaultPrevented?c.current=!1:s.onClose()}};return m.createElement(vk,ae({},i,{ref:l,disabled:n,onClick:Ce(e.onClick,d),onPointerDown:f=>{var g;(g=e.onPointerDown)===null||g===void 0||g.call(e,f),c.current=!0},onPointerUp:Ce(e.onPointerUp,f=>{var g;c.current||(g=f.currentTarget)===null||g===void 0||g.click()}),onKeyDown:Ce(e.onKeyDown,f=>{const g=a.searchRef.current!=="";n||g&&f.key===" "||hy.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})}))}),vk=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,s=gy(vy,n),a=fk(n),l=m.useRef(null),c=et(t,l),[d,f]=m.useState(!1),[g,p]=m.useState("");return m.useEffect(()=>{const v=l.current;if(v){var y;p(((y=v.textContent)!==null&&y!==void 0?y:"").trim())}},[o.children]),m.createElement(Yu.ItemSlot,{scope:n,disabled:r,textValue:i??g},m.createElement(Mm,ae({asChild:!0},a,{focusable:!r}),m.createElement(Be.div,ae({role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},o,{ref:c,onPointerMove:Ce(e.onPointerMove,Xu(v=>{r?s.onItemLeave(v):(s.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus())})),onPointerLeave:Ce(e.onPointerLeave,Xu(v=>s.onItemLeave(v))),onFocus:Ce(e.onFocus,()=>f(!0)),onBlur:Ce(e.onBlur,()=>f(!1))}))))}),TY=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return m.createElement(yk,{scope:e.__scopeMenu,checked:n},m.createElement(by,ae({role:"menuitemcheckbox","aria-checked":Cp(n)?"mixed":n},i,{ref:t,"data-state":yy(n),onSelect:Ce(i.onSelect,()=>r==null?void 0:r(Cp(n)?!0:!n),{checkForDefaultPrevented:!1})})))}),AY="MenuRadioGroup",[IY,NY]=va(AY,{value:void 0,onValueChange:()=>{}}),RY=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,o=xn(r);return m.createElement(IY,{scope:e.__scopeMenu,value:n,onValueChange:o},m.createElement(MY,ae({},i,{ref:t})))}),LY="MenuRadioItem",$Y=m.forwardRef((e,t)=>{const{value:n,...r}=e,i=NY(LY,e.__scopeMenu),o=n===i.value;return m.createElement(yk,{scope:e.__scopeMenu,checked:o},m.createElement(by,ae({role:"menuitemradio","aria-checked":o},r,{ref:t,"data-state":yy(o),onSelect:Ce(r.onSelect,()=>{var s;return(s=i.onValueChange)===null||s===void 0?void 0:s.call(i,n)},{checkForDefaultPrevented:!1})})))}),bk="MenuItemIndicator",[yk,FY]=va(bk,{checked:!1}),jY=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,o=FY(bk,n);return m.createElement(vn,{present:r||Cp(o.checked)||o.checked===!0},m.createElement(Be.span,ae({},i,{ref:t,"data-state":yy(o.checked)})))}),zY=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Be.div,ae({role:"separator","aria-orientation":"horizontal"},r,{ref:t}))}),BY="MenuSub",[tfe,xk]=va(BY),Sp="MenuSubTrigger",VY=m.forwardRef((e,t)=>{const n=ba(Sp,e.__scopeMenu),r=Ku(Sp,e.__scopeMenu),i=xk(Sp,e.__scopeMenu),o=gy(Sp,e.__scopeMenu),s=m.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=o,c={__scopeMenu:e.__scopeMenu},d=m.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return m.useEffect(()=>d,[d]),m.useEffect(()=>{const f=a.current;return()=>{window.clearTimeout(f),l(null)}},[a,l]),m.createElement(hk,ae({asChild:!0},c),m.createElement(vk,ae({id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":wk(n.open)},e,{ref:uf(t,i.onTriggerChange),onClick:f=>{var g;(g=e.onClick)===null||g===void 0||g.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ce(e.onPointerMove,Xu(f=>{o.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(o.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:Ce(e.onPointerLeave,Xu(f=>{var g;d();const p=(g=n.content)===null||g===void 0?void 0:g.getBoundingClientRect();if(p){var v;const y=(v=n.content)===null||v===void 0?void 0:v.dataset.side,x=y==="right",w=x?-5:5,S=p[x?"left":"right"],C=p[x?"right":"left"];o.onPointerGraceIntentChange({area:[{x:f.clientX+w,y:f.clientY},{x:S,y:p.top},{x:C,y:p.top},{x:C,y:p.bottom},{x:S,y:p.bottom}],side:y}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(f),f.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Ce(e.onKeyDown,f=>{const g=o.searchRef.current!=="";if(!(e.disabled||g&&f.key===" ")&&mY[r.dir].includes(f.key)){var p;n.onOpenChange(!0),(p=n.content)===null||p===void 0||p.focus(),f.preventDefault()}})})))}),HY="MenuSubContent",WY=m.forwardRef((e,t)=>{const n=gk(_i,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=ba(_i,e.__scopeMenu),s=Ku(_i,e.__scopeMenu),a=xk(HY,e.__scopeMenu),l=m.useRef(null),c=et(t,l);return m.createElement(Yu.Provider,{scope:e.__scopeMenu},m.createElement(vn,{present:r||o.open},m.createElement(Yu.Slot,{scope:e.__scopeMenu},m.createElement(my,ae({id:a.contentId,"aria-labelledby":a.triggerId},i,{ref:c,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var f;s.isUsingKeyboardRef.current&&((f=l.current)===null||f===void 0||f.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:Ce(e.onFocusOutside,d=>{d.target!==a.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Ce(e.onEscapeKeyDown,d=>{s.onClose(),d.preventDefault()}),onKeyDown:Ce(e.onKeyDown,d=>{const f=d.currentTarget.contains(d.target),g=vY[s.dir].includes(d.key);if(f&&g){var p;o.onOpenChange(!1),(p=a.trigger)===null||p===void 0||p.focus(),d.preventDefault()}})})))))});function wk(e){return e?"open":"closed"}function Cp(e){return e==="indeterminate"}function yy(e){return Cp(e)?"indeterminate":e?"checked":"unchecked"}function qY(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function UY(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function GY(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let s=UY(e,Math.max(o,0));i.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function YY(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,s=t.length-1;o<t.length;s=o++){const a=t[o].x,l=t[o].y,c=t[s].x,d=t[s].y;l>r!=d>r&&n<(c-a)*(r-l)/(d-l)+a&&(i=!i)}return i}function KY(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return YY(n,t)}function Xu(e){return t=>t.pointerType==="mouse"?e(t):void 0}const XY=_Y,QY=hk,JY=CY,ZY=OY,eK=DY,tK=by,nK=TY,rK=RY,iK=$Y,oK=jY,sK=zY,aK=VY,lK=WY,_k="DropdownMenu",[cK,nfe]=Pn(_k,[dk]),Nr=dk(),[uK,Sk]=cK(_k),dK=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:s,modal:a=!0}=e,l=Nr(t),c=m.useRef(null),[d=!1,f]=Qn({prop:i,defaultProp:o,onChange:s});return m.createElement(uK,{scope:t,triggerId:or(),triggerRef:c,contentId:or(),open:d,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(g=>!g),[f]),modal:a},m.createElement(XY,ae({},l,{open:d,onOpenChange:f,dir:r,modal:a}),n))},fK="DropdownMenuTrigger",hK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,o=Sk(fK,n),s=Nr(n);return m.createElement(QY,ae({asChild:!0},s),m.createElement(Be.button,ae({type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r},i,{ref:uf(t,o.triggerRef),onPointerDown:Ce(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(o.onOpenToggle(),o.open||a.preventDefault())}),onKeyDown:Ce(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&o.onOpenToggle(),a.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})))}),pK=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Nr(t);return m.createElement(JY,ae({},r,n))},gK="DropdownMenuContent",mK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Sk(gK,n),o=Nr(n),s=m.useRef(!1);return m.createElement(ZY,ae({id:i.contentId,"aria-labelledby":i.triggerId},o,r,{ref:t,onCloseAutoFocus:Ce(e.onCloseAutoFocus,a=>{var l;s.current||(l=i.triggerRef.current)===null||l===void 0||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:Ce(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;(!i.modal||d)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),vK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(eK,ae({},i,r,{ref:t}))}),bK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(tK,ae({},i,r,{ref:t}))}),yK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(nK,ae({},i,r,{ref:t}))}),xK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(rK,ae({},i,r,{ref:t}))}),wK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(iK,ae({},i,r,{ref:t}))}),_K=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(oK,ae({},i,r,{ref:t}))}),SK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(sK,ae({},i,r,{ref:t}))}),CK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(aK,ae({},i,r,{ref:t}))}),EK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(lK,ae({},i,r,{ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),OK=dK,PK=hK,kK=pK,Ck=mK,Ek=vK,Ok=bK,Pk=yK,MK=xK,kk=wK,Mk=_K,Dk=SK,Tk=CK,Ak=EK,DK=OK,TK=PK,AK=MK,IK=ue.forwardRef(({className:e,inset:t,children:n,...r},i)=>_.jsxs(Tk,{ref:i,className:Pe("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,_.jsx(z2,{className:"ml-auto h-4 w-4"})]}));IK.displayName=Tk.displayName;const NK=ue.forwardRef(({className:e,...t},n)=>_.jsx(Ak,{ref:n,className:Pe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));NK.displayName=Ak.displayName;const Ik=ue.forwardRef(({className:e,sideOffset:t=4,...n},r)=>_.jsx(kK,{children:_.jsx(Ck,{ref:r,sideOffset:t,className:Pe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Ik.displayName=Ck.displayName;const RK=ue.forwardRef(({className:e,inset:t,...n},r)=>_.jsx(Ok,{ref:r,className:Pe("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));RK.displayName=Ok.displayName;const LK=ue.forwardRef(({className:e,children:t,checked:n,...r},i)=>_.jsxs(Pk,{ref:i,className:Pe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[_.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:_.jsx(Mk,{children:_.jsx(Rh,{className:"h-4 w-4"})})}),t]}));LK.displayName=Pk.displayName;const xy=ue.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(kk,{ref:r,className:Pe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[_.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:_.jsx(Mk,{children:_.jsx(B2,{className:"h-2 w-2 fill-current"})})}),t]}));xy.displayName=kk.displayName;const Nk=ue.forwardRef(({className:e,inset:t,...n},r)=>_.jsx(Ek,{ref:r,className:Pe("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Nk.displayName=Ek.displayName;const Rk=ue.forwardRef(({className:e,...t},n)=>_.jsx(Dk,{ref:n,className:Pe("-mx-1 my-1 h-px bg-muted",e),...t}));Rk.displayName=Dk.displayName;function $K(){const[e,t]=m.useState(!1),[n,r]=m.useState(""),i=ge(p=>p.dashboard),o=ge(p=>p.bookmarkKey),[s,a]=m.useState([]),l=ge(p=>p.actions.setDashboard),c=ge(p=>p.actions.setFilterValues),d=ge(p=>p.actions.setBookmarkKey);m.useEffect(()=>{const p=ss(i.id),v=JSON.parse(localStorage.getItem(p)||"[]");a(v);const y=v.find(x=>x.default);y&&y.name===o&&r(y.name)},[e,i,o]);function f(p){if(p===n)return;const v=s.find(x=>x.name===p),y=v==null?void 0:v.template;y&&(l(y),c(v.filterValues||[]),d(p==="Original"?"":p)),r(p)}function g(p){const v=ss(i.id),x=JSON.parse(localStorage.getItem(v)||"[]").filter(w=>w.name!==p);localStorage.setItem(v,JSON.stringify(x)),a(x)}return _.jsxs(DK,{open:e,onOpenChange:t,children:[_.jsx(TK,{asChild:!0,children:_.jsx(st,{variant:"outline",className:"h-7 p-2",children:_.jsx(GB,{className:"h-4 w-4",strokeWidth:1.5})})}),_.jsxs(Ik,{className:"w-56",children:[_.jsx(Nk,{children:"Lenses"}),_.jsx(Rk,{}),_.jsxs(AK,{value:n,onValueChange:f,children:[_.jsx(xy,{value:"Original",children:"Original"}),s.filter(p=>p.name!="Original").map((p,v)=>_.jsxs(xy,{className:"xbg-red-100 flex justify-between",value:p.name,defaultChecked:p.name===o,children:[_.jsx("p",{children:p.name}),_.jsx(ia,{onClick:y=>{y.preventDefault(),g(p.name)},className:"h-3 w-3 hover:cursor-pointer",strokeWidth:1.5})]},v))]})]})]})}function Ep(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}const Lk="Checkbox",[FK,rfe]=Pn(Lk),[jK,zK]=FK(Lk),BK=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:o,required:s,disabled:a,value:l="on",onCheckedChange:c,...d}=e,[f,g]=m.useState(null),p=et(t,C=>g(C)),v=m.useRef(!1),y=f?!!f.closest("form"):!0,[x=!1,w]=Qn({prop:i,defaultProp:o,onChange:c}),S=m.useRef(x);return m.useEffect(()=>{const C=f==null?void 0:f.form;if(C){const P=()=>w(S.current);return C.addEventListener("reset",P),()=>C.removeEventListener("reset",P)}},[f,w]),m.createElement(jK,{scope:n,state:x,disabled:a},m.createElement(Be.button,ae({type:"button",role:"checkbox","aria-checked":ya(x)?"mixed":x,"aria-required":s,"data-state":$k(x),"data-disabled":a?"":void 0,disabled:a,value:l},d,{ref:p,onKeyDown:Ce(e.onKeyDown,C=>{C.key==="Enter"&&C.preventDefault()}),onClick:Ce(e.onClick,C=>{w(P=>ya(P)?!0:!P),y&&(v.current=C.isPropagationStopped(),v.current||C.stopPropagation())})})),y&&m.createElement(WK,{control:f,bubbles:!v.current,name:r,value:l,checked:x,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),VK="CheckboxIndicator",HK=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,o=zK(VK,n);return m.createElement(vn,{present:r||ya(o.state)||o.state===!0},m.createElement(Be.span,ae({"data-state":$k(o.state),"data-disabled":o.disabled?"":void 0},i,{ref:t,style:{pointerEvents:"none",...e.style}})))}),WK=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,o=m.useRef(null),s=Ep(n),a=Mh(t);return m.useEffect(()=>{const l=o.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const g=new Event("click",{bubbles:r});l.indeterminate=ya(n),f.call(l,ya(n)?!1:n),l.dispatchEvent(g)}},[s,n,r]),m.createElement("input",ae({type:"checkbox","aria-hidden":!0,defaultChecked:ya(n)?!1:n},i,{tabIndex:-1,ref:o,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function ya(e){return e==="indeterminate"}function $k(e){return ya(e)?"indeterminate":e?"checked":"unchecked"}const Fk=BK,qK=HK,Op=ue.forwardRef(({className:e,...t},n)=>_.jsx(Fk,{ref:n,className:Pe("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:_.jsx(qK,{className:Pe("flex items-center justify-center text-current"),children:_.jsx(Rh,{className:"h-4 w-4"})})}));Op.displayName=Fk.displayName;function UK(){const[e,t]=m.useState(!1),n=ge(o=>o.dashboard),r=ge(o=>o.bookmarkKey);m.useEffect(()=>{if(!r){t(!1);return}const o=ss(n.id),a=JSON.parse(localStorage.getItem(o)||"[]").find(l=>l.name===r);t(a?a.default:!1)},[r,n.id]);function i(o){if(t(o),!r)return;const s=ss(n.id),l=JSON.parse(localStorage.getItem(s)||"[]").map(c=>(c.name===r?c.default=o:c.default=!1,c));console.log(l),localStorage.setItem(s,JSON.stringify(l))}return _.jsxs("div",{className:"flex items-center space-x-2",children:[_.jsx(Op,{checked:e,onCheckedChange:i,id:"terms"}),_.jsx("label",{htmlFor:"terms",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Set as default"})]})}function GK(){const e=ge(P=>P.bookmarkKey),t=ge(P=>P.dashboard),n=ge(P=>P.selectedSheetId),r=ge(P=>P.isDashboardEditing),i=ge(P=>P.filterValues),o=ge(P=>P.isVisualEditing),s=ge(P=>P.showFilters),a=ge(P=>P.showDashboardJSON),l=ge(P=>P.actions.setShowDashboardJSON),c=ge(P=>P.onSaveFunction),d=ge(P=>P.actions.setShowFilters),{addCard:f,getSelectedSheet:g,setIsDashboardEditing:p,setSelectedCardId:v,setSelectedCard:y}=ge(P=>P.actions),x=g(),w=()=>{if(!r||!x)return;const P={id:wu(),title:"New Card",description:"New Card Description",preferences:{filterOnClick:!0},type:"bar",sql:"select COUNT(*) from YOUR_TABLE",data:[]};f(x.id,P),v(n,P.id),y(P)},S=()=>{p(!0)};function C(){if(!e||e==="")return;const P=ay(t),O=ss(t.id),k=JSON.parse(localStorage.getItem(O)||"[]"),A=k.findIndex(L=>L.name===e);A!==-1?k[A]={name:e,template:P,default:k[A].default,filterValues:i}:k.push({name:e,template:P,filterValues:i}),localStorage.setItem(O,JSON.stringify(k)),c==null||c(P)}return _.jsxs("div",{className:`flex items-center justify-between gap-2
|
|
418
|
+
py-2 `,role:"dashboard-controls",children:[!o&&_.jsxs("div",{className:"flex gap-3 items-center",children:[_.jsx(ns,{children:e}),!!e&&_.jsxs(_.Fragment,{children:[_.jsx("span",{className:" text-muted-foreground",children:"|"}),_.jsx(UK,{})]})]}),_.jsxs("div",{className:"flex gap-2",children:[r&&!o&&_.jsx(hY,{}),!o&&_.jsx($K,{}),r&&!o&&_.jsxs(st,{variant:"outline",className:"h-7 p-2",size:"sm",disabled:!r,onClick:w,children:[_.jsx(q2,{className:" mr-2 h-4 w-4",strokeWidth:1.5}),"Add Card"]}),!r&&_.jsx(st,{variant:"outline",className:"h-7 p-2",onClick:S,size:"sm",children:_.jsx(KB,{className:"h-4 w-4",strokeWidth:1.5})}),r&&!o&&_.jsx(st,{variant:"outline",role:"close",className:"h-7 p-2",onClick:()=>p(!1),size:"sm",children:_.jsx(ia,{className:"h-4 w-4",strokeWidth:1.5})}),r&&!o&&_.jsx(st,{className:"h-7 p-2",variant:"outline",onClick:C,size:"sm",children:_.jsx(QB,{className:"h-4 w-4",strokeWidth:1.5})}),!s&&!o&&r&&_.jsx(st,{className:"h-7 p-2",variant:"outline",onClick:()=>d(!0),size:"sm",children:_.jsx(V2,{className:"h-4 w-4",strokeWidth:1.5})}),!o&&r&&_.jsx("div",{className:" flex items-center space-x-2",children:_.jsx(st,{className:"h-7 p-2",onClick:()=>l(!a),size:"sm",variant:"outline",children:_.jsx(qB,{className:"h-4 w-4",strokeWidth:1.5})})})]})]})}const jk=m.forwardRef(({className:e,...t},n)=>_.jsx("div",{role:"editor-panel",ref:n,className:Pe("flex grow min-h-[80vh]",e),...t}));jk.displayName="EditorPanel";const zk=m.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:Pe(" flex flex-col space-y-2 w-[270px]",e),...t}));zk.displayName="EditorAside";const Bk=m.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:Pe(" grow",e),...t}));Bk.displayName="EditorMain";const YK=[" ","Enter","ArrowUp","ArrowDown"],KK=[" ","Enter"],Pp="Select",[kp,Mp,XK]=df(Pp),[Fl,ife]=Pn(Pp,[XK,Fi]),wy=Fi(),[QK,xa]=Fl(Pp),[JK,ZK]=Fl(Pp),eX=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:s,defaultValue:a,onValueChange:l,dir:c,name:d,autoComplete:f,disabled:g,required:p}=e,v=wy(t),[y,x]=m.useState(null),[w,S]=m.useState(null),[C,P]=m.useState(!1),O=Fs(c),[k=!1,A]=Qn({prop:r,defaultProp:i,onChange:o}),[L,F]=Qn({prop:s,defaultProp:a,onChange:l}),j=m.useRef(null),B=y?!!y.closest("form"):!0,[V,K]=m.useState(new Set),Y=Array.from(V).map($=>$.props.value).join(";");return m.createElement(Eu,v,m.createElement(QK,{required:p,scope:t,trigger:y,onTriggerChange:x,valueNode:w,onValueNodeChange:S,valueNodeHasChildren:C,onValueNodeHasChildrenChange:P,contentId:or(),value:L,onValueChange:F,open:k,onOpenChange:A,dir:O,triggerPointerDownPosRef:j,disabled:g},m.createElement(kp.Provider,{scope:t},m.createElement(JK,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback($=>{K(Z=>new Set(Z).add($))},[]),onNativeOptionRemove:m.useCallback($=>{K(Z=>{const U=new Set(Z);return U.delete($),U})},[])},n)),B?m.createElement(Xk,{key:Y,"aria-hidden":!0,required:p,tabIndex:-1,name:d,autoComplete:f,value:L,onChange:$=>F($.target.value),disabled:g},L===void 0?m.createElement("option",{value:""}):null,Array.from(V)):null))},tX="SelectTrigger",nX=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=wy(n),s=xa(tX,n),a=s.disabled||r,l=et(t,s.onTriggerChange),c=Mp(n),[d,f,g]=Qk(v=>{const y=c().filter(S=>!S.disabled),x=y.find(S=>S.value===s.value),w=Jk(y,v,x);w!==void 0&&s.onValueChange(w.value)}),p=()=>{a||(s.onOpenChange(!0),g())};return m.createElement(Ou,ae({asChild:!0},o),m.createElement(Be.button,ae({type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":Kk(s.value)?"":void 0},i,{ref:l,onClick:Ce(i.onClick,v=>{v.currentTarget.focus()}),onPointerDown:Ce(i.onPointerDown,v=>{const y=v.target;y.hasPointerCapture(v.pointerId)&&y.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&(p(),s.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)},v.preventDefault())}),onKeyDown:Ce(i.onKeyDown,v=>{const y=d.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&f(v.key),!(y&&v.key===" ")&&YK.includes(v.key)&&(p(),v.preventDefault())})})))}),rX="SelectValue",iX=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:s="",...a}=e,l=xa(rX,n),{onValueNodeHasChildrenChange:c}=l,d=o!==void 0,f=et(t,l.onValueNodeChange);return Vn(()=>{c(d)},[c,d]),m.createElement(Be.span,ae({},a,{ref:f,style:{pointerEvents:"none"}}),Kk(l.value)?m.createElement(m.Fragment,null,s):o)}),oX=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return m.createElement(Be.span,ae({"aria-hidden":!0},i,{ref:t}),r||"▼")}),sX=e=>m.createElement(Dh,ae({asChild:!0},e)),jl="SelectContent",aX=m.forwardRef((e,t)=>{const n=xa(jl,e.__scopeSelect),[r,i]=m.useState();if(Vn(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?kt.createPortal(m.createElement(Vk,{scope:e.__scopeSelect},m.createElement(kp.Slot,{scope:e.__scopeSelect},m.createElement("div",null,e.children))),o):null}return m.createElement(lX,ae({},e,{ref:t}))}),_o=10,[Vk,wa]=Fl(jl),lX=m.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:f,collisionBoundary:g,collisionPadding:p,sticky:v,hideWhenDetached:y,avoidCollisions:x,...w}=e,S=xa(jl,n),[C,P]=m.useState(null),[O,k]=m.useState(null),A=et(t,de=>P(de)),[L,F]=m.useState(null),[j,B]=m.useState(null),V=Mp(n),[K,Y]=m.useState(!1),$=m.useRef(!1);m.useEffect(()=>{if(C)return ap(C)},[C]),rp();const Z=m.useCallback(de=>{const[re,...ee]=V().map(oe=>oe.ref.current),[W]=ee.slice(-1),ye=document.activeElement;for(const oe of de)if(oe===ye||(oe==null||oe.scrollIntoView({block:"nearest"}),oe===re&&O&&(O.scrollTop=0),oe===W&&O&&(O.scrollTop=O.scrollHeight),oe==null||oe.focus(),document.activeElement!==ye))return},[V,O]),U=m.useCallback(()=>Z([L,C]),[Z,L,C]);m.useEffect(()=>{K&&U()},[K,U]);const{onOpenChange:ie,triggerPointerDownPosRef:le}=S;m.useEffect(()=>{if(C){let de={x:0,y:0};const re=W=>{var ye,oe,Te,Fe;de={x:Math.abs(Math.round(W.pageX)-((ye=(oe=le.current)===null||oe===void 0?void 0:oe.x)!==null&&ye!==void 0?ye:0)),y:Math.abs(Math.round(W.pageY)-((Te=(Fe=le.current)===null||Fe===void 0?void 0:Fe.y)!==null&&Te!==void 0?Te:0))}},ee=W=>{de.x<=10&&de.y<=10?W.preventDefault():C.contains(W.target)||ie(!1),document.removeEventListener("pointermove",re),le.current=null};return le.current!==null&&(document.addEventListener("pointermove",re),document.addEventListener("pointerup",ee,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",re),document.removeEventListener("pointerup",ee,{capture:!0})}}},[C,ie,le]),m.useEffect(()=>{const de=()=>ie(!1);return window.addEventListener("blur",de),window.addEventListener("resize",de),()=>{window.removeEventListener("blur",de),window.removeEventListener("resize",de)}},[ie]);const[M,H]=Qk(de=>{const re=V().filter(ye=>!ye.disabled),ee=re.find(ye=>ye.ref.current===document.activeElement),W=Jk(re,de,ee);W&&setTimeout(()=>W.ref.current.focus())}),ne=m.useCallback((de,re,ee)=>{const W=!$.current&&!ee;(S.value!==void 0&&S.value===re||W)&&(F(de),W&&($.current=!0))},[S.value]),N=m.useCallback(()=>C==null?void 0:C.focus(),[C]),X=m.useCallback((de,re,ee)=>{const W=!$.current&&!ee;(S.value!==void 0&&S.value===re||W)&&B(de)},[S.value]),me=r==="popper"?Hk:cX,he=me===Hk?{side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:f,collisionBoundary:g,collisionPadding:p,sticky:v,hideWhenDetached:y,avoidCollisions:x}:{};return m.createElement(Vk,{scope:n,content:C,viewport:O,onViewportChange:k,itemRefCallback:ne,selectedItem:L,onItemLeave:N,itemTextRefCallback:X,focusSelectedItem:U,selectedItemText:j,position:r,isPositioned:K,searchRef:M},m.createElement(hp,{as:no,allowPinchZoom:!0},m.createElement(ip,{asChild:!0,trapped:S.open,onMountAutoFocus:de=>{de.preventDefault()},onUnmountAutoFocus:Ce(i,de=>{var re;(re=S.trigger)===null||re===void 0||re.focus({preventScroll:!0}),de.preventDefault()})},m.createElement(_l,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:de=>de.preventDefault(),onDismiss:()=>S.onOpenChange(!1)},m.createElement(me,ae({role:"listbox",id:S.contentId,"data-state":S.open?"open":"closed",dir:S.dir,onContextMenu:de=>de.preventDefault()},w,he,{onPlaced:()=>Y(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:Ce(w.onKeyDown,de=>{const re=de.ctrlKey||de.altKey||de.metaKey;if(de.key==="Tab"&&de.preventDefault(),!re&&de.key.length===1&&H(de.key),["ArrowUp","ArrowDown","Home","End"].includes(de.key)){let W=V().filter(ye=>!ye.disabled).map(ye=>ye.ref.current);if(["ArrowUp","End"].includes(de.key)&&(W=W.slice().reverse()),["ArrowUp","ArrowDown"].includes(de.key)){const ye=de.target,oe=W.indexOf(ye);W=W.slice(oe+1)}setTimeout(()=>Z(W)),de.preventDefault()}})}))))))}),cX=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=xa(jl,n),s=wa(jl,n),[a,l]=m.useState(null),[c,d]=m.useState(null),f=et(t,A=>d(A)),g=Mp(n),p=m.useRef(!1),v=m.useRef(!0),{viewport:y,selectedItem:x,selectedItemText:w,focusSelectedItem:S}=s,C=m.useCallback(()=>{if(o.trigger&&o.valueNode&&a&&c&&y&&x&&w){const A=o.trigger.getBoundingClientRect(),L=c.getBoundingClientRect(),F=o.valueNode.getBoundingClientRect(),j=w.getBoundingClientRect();if(o.dir!=="rtl"){const ye=j.left-L.left,oe=F.left-ye,Te=A.left-oe,Fe=A.width+Te,He=Math.max(Fe,L.width),Ke=window.innerWidth-_o,St=s0(oe,[_o,Ke-He]);a.style.minWidth=Fe+"px",a.style.left=St+"px"}else{const ye=L.right-j.right,oe=window.innerWidth-F.right-ye,Te=window.innerWidth-A.right-oe,Fe=A.width+Te,He=Math.max(Fe,L.width),Ke=window.innerWidth-_o,St=s0(oe,[_o,Ke-He]);a.style.minWidth=Fe+"px",a.style.right=St+"px"}const B=g(),V=window.innerHeight-_o*2,K=y.scrollHeight,Y=window.getComputedStyle(c),$=parseInt(Y.borderTopWidth,10),Z=parseInt(Y.paddingTop,10),U=parseInt(Y.borderBottomWidth,10),ie=parseInt(Y.paddingBottom,10),le=$+Z+K+ie+U,M=Math.min(x.offsetHeight*5,le),H=window.getComputedStyle(y),ne=parseInt(H.paddingTop,10),N=parseInt(H.paddingBottom,10),X=A.top+A.height/2-_o,me=V-X,he=x.offsetHeight/2,de=x.offsetTop+he,re=$+Z+de,ee=le-re;if(re<=X){const ye=x===B[B.length-1].ref.current;a.style.bottom="0px";const oe=c.clientHeight-y.offsetTop-y.offsetHeight,Te=Math.max(me,he+(ye?N:0)+oe+U),Fe=re+Te;a.style.height=Fe+"px"}else{const ye=x===B[0].ref.current;a.style.top="0px";const Te=Math.max(X,$+y.offsetTop+(ye?ne:0)+he)+ee;a.style.height=Te+"px",y.scrollTop=re-X+y.offsetTop}a.style.margin=`${_o}px 0`,a.style.minHeight=M+"px",a.style.maxHeight=V+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[g,o.trigger,o.valueNode,a,c,y,x,w,o.dir,r]);Vn(()=>C(),[C]);const[P,O]=m.useState();Vn(()=>{c&&O(window.getComputedStyle(c).zIndex)},[c]);const k=m.useCallback(A=>{A&&v.current===!0&&(C(),S==null||S(),v.current=!1)},[C,S]);return m.createElement(uX,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:p,onScrollButtonChange:k},m.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:P}},m.createElement(Be.div,ae({},i,{ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}}))))}),Hk=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=_o,...o}=e,s=wy(n);return m.createElement(Pu,ae({},s,o,{ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[uX,_y]=Fl(jl,{}),Wk="SelectViewport",dX=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=wa(Wk,n),o=_y(Wk,n),s=et(t,i.onViewportChange),a=m.useRef(0);return m.createElement(m.Fragment,null,m.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),m.createElement(kp.Slot,{scope:n},m.createElement(Be.div,ae({"data-radix-select-viewport":"",role:"presentation"},r,{ref:s,style:{position:"relative",flex:1,overflow:"auto",...r.style},onScroll:Ce(r.onScroll,l=>{const c=l.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:f}=o;if(f!=null&&f.current&&d){const g=Math.abs(a.current-c.scrollTop);if(g>0){const p=window.innerHeight-_o*2,v=parseFloat(d.style.minHeight),y=parseFloat(d.style.height),x=Math.max(v,y);if(x<p){const w=x+g,S=Math.min(p,w),C=w-S;d.style.height=S+"px",d.style.bottom==="0px"&&(c.scrollTop=C>0?C:0,d.style.justifyContent="flex-end")}}}a.current=c.scrollTop})}))))}),fX="SelectGroup",[hX,pX]=Fl(fX),gX=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=or();return m.createElement(hX,{scope:n,id:i},m.createElement(Be.div,ae({role:"group","aria-labelledby":i},r,{ref:t})))}),mX="SelectLabel",vX=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=pX(mX,n);return m.createElement(Be.div,ae({id:i.id},r,{ref:t}))}),Sy="SelectItem",[bX,qk]=Fl(Sy),yX=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...s}=e,a=xa(Sy,n),l=wa(Sy,n),c=a.value===r,[d,f]=m.useState(o??""),[g,p]=m.useState(!1),v=et(t,w=>{var S;return(S=l.itemRefCallback)===null||S===void 0?void 0:S.call(l,w,r,i)}),y=or(),x=()=>{i||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return m.createElement(bX,{scope:n,value:r,disabled:i,textId:y,isSelected:c,onItemTextChange:m.useCallback(w=>{f(S=>{var C;return S||((C=w==null?void 0:w.textContent)!==null&&C!==void 0?C:"").trim()})},[])},m.createElement(kp.ItemSlot,{scope:n,value:r,disabled:i,textValue:d},m.createElement(Be.div,ae({role:"option","aria-labelledby":y,"data-highlighted":g?"":void 0,"aria-selected":c&&g,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1},s,{ref:v,onFocus:Ce(s.onFocus,()=>p(!0)),onBlur:Ce(s.onBlur,()=>p(!1)),onPointerUp:Ce(s.onPointerUp,x),onPointerMove:Ce(s.onPointerMove,w=>{if(i){var S;(S=l.onItemLeave)===null||S===void 0||S.call(l)}else w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ce(s.onPointerLeave,w=>{if(w.currentTarget===document.activeElement){var S;(S=l.onItemLeave)===null||S===void 0||S.call(l)}}),onKeyDown:Ce(s.onKeyDown,w=>{var S;((S=l.searchRef)===null||S===void 0?void 0:S.current)!==""&&w.key===" "||(KK.includes(w.key)&&x(),w.key===" "&&w.preventDefault())})}))))}),Dp="SelectItemText",xX=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,s=xa(Dp,n),a=wa(Dp,n),l=qk(Dp,n),c=ZK(Dp,n),[d,f]=m.useState(null),g=et(t,w=>f(w),l.onItemTextChange,w=>{var S;return(S=a.itemTextRefCallback)===null||S===void 0?void 0:S.call(a,w,l.value,l.disabled)}),p=d==null?void 0:d.textContent,v=m.useMemo(()=>m.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},p),[l.disabled,l.value,p]),{onNativeOptionAdd:y,onNativeOptionRemove:x}=c;return Vn(()=>(y(v),()=>x(v)),[y,x,v]),m.createElement(m.Fragment,null,m.createElement(Be.span,ae({id:l.textId},o,{ref:g})),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?kt.createPortal(o.children,s.valueNode):null)}),wX="SelectItemIndicator",_X=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return qk(wX,n).isSelected?m.createElement(Be.span,ae({"aria-hidden":!0},r,{ref:t})):null}),Uk="SelectScrollUpButton",SX=m.forwardRef((e,t)=>{const n=wa(Uk,e.__scopeSelect),r=_y(Uk,e.__scopeSelect),[i,o]=m.useState(!1),s=et(t,r.onScrollButtonChange);return Vn(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=a.scrollTop>0;o(c)};const a=n.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?m.createElement(Yk,ae({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}})):null}),Gk="SelectScrollDownButton",CX=m.forwardRef((e,t)=>{const n=wa(Gk,e.__scopeSelect),r=_y(Gk,e.__scopeSelect),[i,o]=m.useState(!1),s=et(t,r.onScrollButtonChange);return Vn(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=a.scrollHeight-a.clientHeight,d=Math.ceil(a.scrollTop)<c;o(d)};const a=n.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?m.createElement(Yk,ae({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}})):null}),Yk=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=wa("SelectScrollButton",n),s=m.useRef(null),a=Mp(n),l=m.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return m.useEffect(()=>()=>l(),[l]),Vn(()=>{var c;const d=a().find(f=>f.ref.current===document.activeElement);d==null||(c=d.ref.current)===null||c===void 0||c.scrollIntoView({block:"nearest"})},[a]),m.createElement(Be.div,ae({"aria-hidden":!0},i,{ref:t,style:{flexShrink:0,...i.style},onPointerDown:Ce(i.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:Ce(i.onPointerMove,()=>{var c;(c=o.onItemLeave)===null||c===void 0||c.call(o),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:Ce(i.onPointerLeave,()=>{l()})}))}),EX=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return m.createElement(Be.div,ae({"aria-hidden":!0},r,{ref:t}))});function Kk(e){return e===""||e===void 0}const Xk=m.forwardRef((e,t)=>{const{value:n,...r}=e,i=m.useRef(null),o=et(t,i),s=Ep(n);return m.useEffect(()=>{const a=i.current,l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==n&&d){const f=new Event("change",{bubbles:!0});d.call(a,n),a.dispatchEvent(f)}},[s,n]),m.createElement(M2,{asChild:!0},m.createElement("select",ae({},r,{ref:o,defaultValue:n})))});Xk.displayName="BubbleSelect";function Qk(e){const t=xn(e),n=m.useRef(""),r=m.useRef(0),i=m.useCallback(s=>{const a=n.current+s;t(a),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),o=m.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function Jk(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let s=OX(e,Math.max(o,0));i.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function OX(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const PX=eX,Zk=nX,kX=iX,MX=oX,DX=sX,eM=aX,TX=dX,AX=gX,tM=vX,nM=yX,IX=xX,NX=_X,rM=SX,iM=CX,oM=EX,sM=PX,aM=AX,lM=kX,Cy=ue.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(Zk,{ref:r,className:Pe("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,_.jsx(MX,{asChild:!0,children:_.jsx(Vb,{className:"h-4 w-4 opacity-50"})})]}));Cy.displayName=Zk.displayName;const cM=ue.forwardRef(({className:e,...t},n)=>_.jsx(rM,{ref:n,className:Pe("flex cursor-default items-center justify-center py-1",e),...t,children:_.jsx(WB,{className:"h-4 w-4"})}));cM.displayName=rM.displayName;const uM=ue.forwardRef(({className:e,...t},n)=>_.jsx(iM,{ref:n,className:Pe("flex cursor-default items-center justify-center py-1",e),...t,children:_.jsx(Vb,{className:"h-4 w-4"})}));uM.displayName=iM.displayName;const Ey=ue.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>_.jsx(DX,{children:_.jsxs(eM,{ref:i,className:Pe("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[_.jsx(cM,{}),_.jsx(TX,{className:Pe("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),_.jsx(uM,{})]})}));Ey.displayName=eM.displayName;const Tp=ue.forwardRef(({className:e,...t},n)=>_.jsx(tM,{ref:n,className:Pe("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Tp.displayName=tM.displayName;const _a=ue.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(nM,{ref:r,className:Pe("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[_.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:_.jsx(NX,{children:_.jsx(Rh,{className:"h-4 w-4"})})}),_.jsx(IX,{children:t})]}));_a.displayName=nM.displayName;const RX=ue.forwardRef(({className:e,...t},n)=>_.jsx(oM,{ref:n,className:Pe("-mx-1 my-1 h-px bg-muted",e),...t}));RX.displayName=oM.displayName;function Ap({title:e,items:t,value:n,isLoading:r,isError:i,onChange:o}){const s=r?"Loading...":i?"Error":n;function a(){if(e==="Connection")return _.jsx(XB,{className:" rotate-90",strokeWidth:1,size:16});if(e==="Database")return _.jsx(UB,{strokeWidth:1,size:16});if(e==="Schema")return _.jsx(ZB,{strokeWidth:1,size:16});if(e==="Table")return _.jsx(Hb,{strokeWidth:1,size:16})}return _.jsxs("div",{className:"flex gap-2 items-center",children:[_.jsx("div",{className:" shrink-0",children:a()}),_.jsxs(sM,{value:s,onValueChange:o,children:[_.jsx(Cy,{className:"focus:ring-offset-0 focus:ring-1 h-7 w-[190px] ",children:_.jsx(lM,{placeholder:r?"Loading...":i?"Error":`Select ${e}`})}),_.jsx(Ey,{children:_.jsxs(aM,{children:[r?_.jsx(Tp,{children:"Loading..."}):_.jsx(Tp,{children:e}),_.jsx(_.Fragment,{children:t&&t.map(l=>_.jsx(_a,{value:l.id,children:l.name},l.id))}),(r||i)&&_.jsx(_a,{value:s,children:s})]})})]})]})}function LX({column:e}){const[t,n]=m.useState(!1),r=_e(d=>d.selectedTableName),i=_e(d=>d.selectedSchemaName),o=_e(d=>d.sqlGen),s=_e(d=>d.actions.setSqlGen),a=_e(d=>d.actions.setCardSql),l=_e(d=>d.actions.setRunSql);function c(d,f){const g=HO(d,o,f);s(g);const p=VO(g,i||"",r);p&&(a(p),l(!0)),n(!1)}return _.jsxs(pp,{open:t,onOpenChange:n,children:[_.jsx(gp,{asChild:!0,children:_.jsx(Bj,{className:"w-3 h-3 text-foreground/40 cursor-pointer"})}),_.jsx(qu,{align:"center",className:" p-0 w-18 rounded-none shadow-none border-muted",children:_.jsxs("ul",{className:"text-xs ",children:[_.jsx("li",{onClick:()=>c(e,"COUNT"),className:" px-3 p-1 hover:bg-muted transition-colors cursor-pointer",children:"Count"}),_.jsx("li",{onClick:()=>c(e,"AVG"),className:" px-3 p-1 hover:bg-muted transition-colors cursor-pointer",children:"Avg"}),_.jsx("li",{onClick:()=>c(e,"SUM"),className:"px-3 p-1 hover:bg-muted transition-colors cursor-pointer",children:"Sum"}),_.jsx("li",{onClick:()=>c(e,"MAX"),className:"px-3 p-1 hover:bg-muted transition-colors cursor-pointer",children:"Max"}),_.jsx("li",{onClick:()=>c(e,"MIN"),className:"px-3 p-1 hover:bg-muted transition-colors cursor-pointer",children:"Min"})]})})]})}function dM({column:e}){return _.jsxs(zb,{children:[_.jsx(T2,{asChild:!0,children:E0.includes(e.data_type.toLowerCase())?_.jsx("span",{className:" font-thin",children:"T"}):Tl.includes(e.data_type.toLowerCase())?_.jsx("span",{className:" font-thin",children:"#"}):Nu.includes(e.data_type.toLowerCase())?_.jsx("span",{className:" font-thin",children:"D"}):BO.includes(e.data_type.toLowerCase())?_.jsx("span",{className:" font-thin",children:"B"}):_.jsx("span",{className:" font-thin",children:"?"})}),_.jsx(Ih,{children:_.jsx("p",{className:"text-xs font-mono",children:e.data_type})})]})}function $X({schemaName:e,tableName:t,columns:n,status:r}){const i=_e(f=>f.sqlGen),o=_e(f=>f.actions.setRunSql),s=_e(f=>f.actions.setSqlGen),a=_e(f=>f.actions.setIsShowingVisual),l=_e(f=>f.actions.setCardSql);function c(f){const g=HO(f,i);s(g);const p=VO(g,e,t);p&&(l(p),o(!0))}function d(){const f=P0(e,t);a(!1),l(`SELECT * FROM ${f} LIMIT 10`),o(!0)}return _.jsxs("div",{className:"px-4",children:[_.jsx("div",{className:" font-medium px-2 pt-2 pb-3",children:_.jsxs(st,{disabled:r!=="Success",onClick:d,variant:"secondary",className:" h-7 flex w-full",children:[r!=="Success"&&_.jsx(Mu,{className:" w-4 h-4 animate-spin mr-2 text-foreground/50"}),"Show top 10 rows"]})}),_.jsxs(kl,{className:`w-full ${t==="api"?"h-[74vh]":"h-[60vh]"}`,children:[n==null?void 0:n.map(f=>_.jsxs("div",{onClick:()=>c(f),className:Pe(" text-sm flex items-center justify-between px-3 py-[6px] transition-colors hover:bg-muted/50 cursor-pointer rounded ",{" bg-muted":LW(f,i)}),children:[_.jsxs("div",{className:"flex items-center space-x-2 ",children:[_.jsx(dM,{column:f}),_.jsx("span",{children:f.column_name})]}),Tl.includes(f.data_type)&&_.jsx("div",{onClick:g=>g.stopPropagation(),className:" flex items-center justify-end ",children:_.jsx(LX,{column:f})})]},f.column_name)),_.jsx(Hh,{orientation:"vertical"}),_.jsx(Hh,{orientation:"horizontal"})]})]})}function fM({ColumnsComponent:e}){const t=_e(Y=>Y.selectedConnectionId);_e(Y=>Y.card.sql);const n=_e(Y=>Y.selectedDatabaseName),r=_e(Y=>Y.selectedSchemaName),i=_e(Y=>Y.selectedTableName),o=_e(Y=>Y.actions.setSelectedConnectionId),s=_e(Y=>Y.actions.setSelectedDatabaseName),a=_e(Y=>Y.actions.setSelectedSchemaName),l=_e(Y=>Y.actions.setSelectedTableName),c=_e(Y=>Y.actions.setCardSql),{connectionItems:d,schemaItems:f,databaseItems:g,tableItems:p,columns:v,isConnectionsLoading:y,isConnectionsError:x,isDatabasesLoadingOrFetching:w,isDatabaseError:S,isSchemaLoadingOrFetching:C,isSchemaError:P,isColumnsError:O,isColumnsLoadingOrFetching:k,isAPIConnection:A}=ZV();m.useEffect(()=>{A&&(s("NA"),a(""),l("api"))},[A,c,l,a,s]);const L=A?"api":i||"",F=A?"":r||"";function j(Y){a(Y),l("")}function B(Y){s(Y),a(""),l("")}function V(Y){o(Y)}function K(){return e?e(F,L,v):_.jsx($X,{schemaName:F,tableName:L,columns:v,status:k?"Loading...":O?"Error":"Success"})}return _.jsxs("aside",{className:" grow flex flex-col xbg-red-100 ",children:[_.jsxs("section",{className:"space-y-3 pt-4 pb-3 px-6",children:[_.jsx(Ap,{items:d,title:"Connection",value:t||"",onChange:V,isLoading:y,isError:x}),!A&&_.jsxs(_.Fragment,{children:[_.jsx(Ap,{onChange:B,isError:S,isLoading:w,items:g,value:n||"",title:"Database"}),_.jsx(Ap,{onChange:j,isError:P,isLoading:C,items:f,value:r||"",title:"Schema"}),_.jsx(Ap,{onChange:l,isError:S,items:p,isLoading:w,value:i||"",title:"Table"})]})]}),K(),_.jsx("div",{className:" grow justify-end flex flex-col pt-6 "})]})}const{createElement:zl,createContext:FX,createRef:ofe,forwardRef:hM,useCallback:Rr,useContext:pM,useEffect:Sa,useImperativeHandle:gM,useLayoutEffect:jX,useMemo:zX,useRef:ei,useState:Ip}=ue,mM=ue.useId,Np=FX(null);Np.displayName="PanelGroupContext";const Qu=jX,BX=typeof mM=="function"?mM:()=>null;let VX=0;function Oy(e=null){const t=BX(),n=ei(e||t||null);return n.current===null&&(n.current=""+VX++),e??n.current}function vM({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:i,forwardedRef:o,id:s,maxSize:a,minSize:l,onCollapse:c,onExpand:d,onResize:f,order:g,style:p,tagName:v="div",...y}){const x=pM(Np);if(x===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:w,expandPanel:S,getPanelSize:C,getPanelStyle:P,groupId:O,isPanelCollapsed:k,registerPanel:A,resizePanel:L,unregisterPanel:F}=x,j=Oy(s),B=ei({callbacks:{onCollapse:c,onExpand:d,onResize:f},constraints:{collapsedSize:n,collapsible:r,defaultSize:i,maxSize:a,minSize:l},id:j,idIsFromProps:s!==void 0,order:g});ei({didLogMissingDefaultSizeWarning:!1}),Qu(()=>{const{callbacks:K,constraints:Y}=B.current;B.current.id=j,B.current.idIsFromProps=s!==void 0,B.current.order=g,K.onCollapse=c,K.onExpand=d,K.onResize=f,Y.collapsedSize=n,Y.collapsible=r,Y.defaultSize=i,Y.maxSize=a,Y.minSize=l}),Qu(()=>{const K=B.current;return A(K),()=>{F(K)}},[g,j,A,F]),gM(o,()=>({collapse:()=>{w(B.current)},expand:()=>{S(B.current)},getId(){return j},getSize(){return C(B.current)},isCollapsed(){return k(B.current)},isExpanded(){return!k(B.current)},resize:K=>{L(B.current,K)}}),[w,S,C,k,j,L]);const V=P(B.current,i);return zl(v,{...y,children:e,className:t,style:{...V,...p},"data-panel":"","data-panel-id":j,"data-panel-group-id":O,"data-panel-collapsible":void 0,"data-panel-size":void 0})}const bM=hM((e,t)=>zl(vM,{...e,forwardedRef:t}));vM.displayName="Panel",bM.displayName="forwardRef(Panel)";function at(e,t="Assertion failed!"){if(!e)throw console.error(t),Error(t)}const yM=10;function Ju(e,t,n=yM){e=parseFloat(e.toFixed(n)),t=parseFloat(t.toFixed(n));const r=e-t;return r===0?0:r>0?1:-1}function Lr(e,t,n){return Ju(e,t,n)===0}function Bl({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];at(r!=null);let{collapsedSize:i=0,collapsible:o,maxSize:s=100,minSize:a=0}=r;if(Ju(n,a)<0)if(o){const l=(i+a)/2;Ju(n,l)<0?n=i:n=a}else n=a;return n=Math.min(s,n),n=parseFloat(n.toFixed(yM)),n}function Zu({delta:e,layout:t,panelConstraints:n,pivotIndices:r,trigger:i}){if(Lr(e,0))return t;const o=[...t],[s,a]=r;at(s!=null),at(a!=null);let l=0;if(i==="keyboard"){{const d=e<0?a:s,f=n[d];if(at(f),f.collapsible){const g=t[d];at(g!=null);const p=n[d];at(p);const{collapsedSize:v=0,minSize:y=0}=p;if(Lr(g,v)){const x=y-g;Ju(x,Math.abs(e))>0&&(e=e<0?0-x:x)}}}{const d=e<0?s:a,f=n[d];at(f);const{collapsible:g}=f;if(g){const p=t[d];at(p!=null);const v=n[d];at(v);const{collapsedSize:y=0,minSize:x=0}=v;if(Lr(p,x)){const w=p-y;Ju(w,Math.abs(e))>0&&(e=e<0?0-w:w)}}}}{const d=e<0?1:-1;let f=e<0?a:s,g=0;for(;;){const v=t[f];at(v!=null);const x=Bl({panelConstraints:n,panelIndex:f,size:100})-v;if(g+=x,f+=d,f<0||f>=n.length)break}const p=Math.min(Math.abs(e),Math.abs(g));e=e<0?0-p:p}{let f=e<0?s:a;for(;f>=0&&f<n.length;){const g=Math.abs(e)-Math.abs(l),p=t[f];at(p!=null);const v=p-g,y=Bl({panelConstraints:n,panelIndex:f,size:v});if(!Lr(p,y)&&(l+=p-y,o[f]=y,l.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?f--:f++}}if(Lr(l,0))return t;{const d=e<0?a:s,f=t[d];at(f!=null);const g=f+l,p=Bl({panelConstraints:n,panelIndex:d,size:g});if(o[d]=p,!Lr(p,g)){let v=g-p,x=e<0?a:s;for(;x>=0&&x<n.length;){const w=o[x];at(w!=null);const S=w+v,C=Bl({panelConstraints:n,panelIndex:x,size:S});if(Lr(w,C)||(v-=C-w,o[x]=C),Lr(v,0))break;e>0?x--:x++}}}const c=o.reduce((d,f)=>f+d,0);return Lr(c,100)?o:t}function HX({layout:e,panelsArray:t,pivotIndices:n}){let r=0,i=100,o=0,s=0;const a=n[0];at(a!=null),t.forEach((f,g)=>{const{constraints:p}=f,{maxSize:v=100,minSize:y=0}=p;g===a?(r=y,i=v):(o+=y,s+=v)});const l=Math.min(i,100-o),c=Math.max(r,100-s),d=e[a];return{valueMax:l,valueMin:c,valueNow:d}}function ed(e){return Array.from(document.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function xM(e,t){const r=ed(e).findIndex(i=>i.getAttribute("data-panel-resize-handle-id")===t);return r??null}function wM(e,t){const n=xM(e,t);return n!=null?[n,n+1]:[-1,-1]}function _M(e){const t=document.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return t||null}function Rp(e){const t=document.querySelector(`[data-panel-resize-handle-id="${e}"]`);return t||null}function WX(e,t,n){var r,i,o,s;const a=Rp(t),l=ed(e),c=a?l.indexOf(a):-1,d=(r=(i=n[c])===null||i===void 0?void 0:i.id)!==null&&r!==void 0?r:null,f=(o=(s=n[c+1])===null||s===void 0?void 0:s.id)!==null&&o!==void 0?o:null;return[d,f]}function qX({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:i,setLayout:o}){ei({didWarnAboutMissingResizeHandle:!1}),Qu(()=>{const s=ed(n);for(let a=0;a<i.length-1;a++){const{valueMax:l,valueMin:c,valueNow:d}=HX({layout:r,panelsArray:i,pivotIndices:[a,a+1]}),f=s[a];if(f!=null){const g=i[a];at(g),f.setAttribute("aria-controls",g.id),f.setAttribute("aria-valuemax",""+Math.round(l)),f.setAttribute("aria-valuemin",""+Math.round(c)),f.setAttribute("aria-valuenow",d!=null?""+Math.round(d):"")}}return()=>{s.forEach((a,l)=>{a.removeAttribute("aria-controls"),a.removeAttribute("aria-valuemax"),a.removeAttribute("aria-valuemin"),a.removeAttribute("aria-valuenow")})}},[n,r,i]),Sa(()=>{const s=t.current;at(s);const{panelDataArray:a}=s,l=_M(n);at(l!=null,`No group found for id "${n}"`);const c=ed(n);at(c);const d=c.map(f=>{const g=f.getAttribute("data-panel-resize-handle-id");at(g);const[p,v]=WX(n,g,a);if(p==null||v==null)return()=>{};const y=x=>{if(!x.defaultPrevented)switch(x.key){case"Enter":{x.preventDefault();const w=a.findIndex(S=>S.id===p);if(w>=0){const S=a[w];at(S);const C=r[w],{collapsedSize:P=0,collapsible:O,minSize:k=0}=S.constraints;if(C!=null&&O){const A=Zu({delta:Lr(C,P)?k-P:P-C,layout:r,panelConstraints:a.map(L=>L.constraints),pivotIndices:wM(n,g),trigger:"keyboard"});r!==A&&o(A)}}break}}};return f.addEventListener("keydown",y),()=>{f.removeEventListener("keydown",y)}});return()=>{d.forEach(f=>f())}},[e,t,n,r,i,o])}function SM(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function CM(e){return e.type==="keydown"}function EM(e){return e.type.startsWith("mouse")}function OM(e){return e.type.startsWith("touch")}function PM(e,t){const n=e==="horizontal";if(EM(t))return n?t.clientX:t.clientY;if(OM(t)){const r=t.touches[0];return at(r),n?r.screenX:r.screenY}else throw Error(`Unsupported event type "${t.type}"`)}function UX(e,t,n,r){const i=n==="horizontal",o=Rp(t);at(o);const s=o.getAttribute("data-panel-group-id");at(s);let{initialCursorPosition:a}=r;const l=PM(n,e),c=_M(s);at(c);const d=c.getBoundingClientRect(),f=i?d.width:d.height;return(l-a)/f*100}function GX(e,t,n,r,i){if(CM(e)){const o=n==="horizontal";let s=0;e.shiftKey?s=100:i!=null?s=i:s=10;let a=0;switch(e.key){case"ArrowDown":a=o?0:s;break;case"ArrowLeft":a=o?-s:0;break;case"ArrowRight":a=o?s:0;break;case"ArrowUp":a=o?0:-s;break;case"End":a=100;break;case"Home":a=-100;break}return a}else return r==null?0:UX(e,t,n,r)}function YX({panelDataArray:e}){const t=Array(e.length),n=e.map(o=>o.constraints);let r=0,i=100;for(let o=0;o<e.length;o++){const s=n[o];at(s);const{defaultSize:a}=s;a!=null&&(r++,t[o]=a,i-=a)}for(let o=0;o<e.length;o++){const s=n[o];at(s);const{defaultSize:a}=s;if(a!=null)continue;const l=e.length-r,c=i/l;r++,t[o]=c,i-=c}return t}function Vl(e,t,n){t.forEach((r,i)=>{const o=e[i];at(o);const{callbacks:s,constraints:a,id:l}=o,{collapsedSize:c=0,collapsible:d}=a,f=n[l];if(f==null||r!==f){n[l]=r;const{onCollapse:g,onExpand:p,onResize:v}=s;v&&v(r,f),d&&(g||p)&&(p&&(f==null||f===c)&&r!==c&&p(),g&&(f==null||f!==c)&&r===c&&g())}})}function Lp(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function KX({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:i,precision:o=3}){const s=n[i];let a;return s==null?a=e??"1":r.length===1?a="1":a=s.toPrecision(o),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}let Py=null,Ca=null;function kM(e){switch(e){case"horizontal":return"ew-resize";case"horizontal-max":return"w-resize";case"horizontal-min":return"e-resize";case"vertical":return"ns-resize";case"vertical-max":return"n-resize";case"vertical-min":return"s-resize"}}function XX(){Ca!==null&&(document.head.removeChild(Ca),Py=null,Ca=null)}function ky(e){if(Py===e)return;Py=e;const t=kM(e);Ca===null&&(Ca=document.createElement("style"),document.head.appendChild(Ca)),Ca.innerHTML=`*{cursor: ${t}!important;}`}function QX(e,t=10){let n=null;return(...i)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...i)},t)}}function MM(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function DM(e){return`react-resizable-panels:${e}`}function TM(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:i,order:o}=t;return i?r:o?`${o}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function AM(e,t){try{const n=DM(e),r=t.getItem(n);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function JX(e,t,n){var r,i;const o=(r=AM(e,n))!==null&&r!==void 0?r:{},s=TM(t);return(i=o[s])!==null&&i!==void 0?i:null}function ZX(e,t,n,r,i){var o;const s=DM(e),a=TM(t),l=(o=AM(e,i))!==null&&o!==void 0?o:{};l[a]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{i.setItem(s,JSON.stringify(l))}catch(c){console.error(c)}}function IM({layout:e,panelConstraints:t}){const n=[...e],r=n.reduce((o,s)=>o+s,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(o=>`${o}%`).join(", ")}`);if(!Lr(r,100))for(let o=0;o<t.length;o++){const s=n[o];at(s!=null);const a=100/r*s;n[o]=a}let i=0;for(let o=0;o<t.length;o++){const s=n[o];at(s!=null);const a=Bl({panelConstraints:t,panelIndex:o,size:s});s!=a&&(i+=s-a,n[o]=a)}if(!Lr(i,0))for(let o=0;o<t.length;o++){const s=n[o];at(s!=null);const a=s+i,l=Bl({panelConstraints:t,panelIndex:o,size:a});if(s!==l&&(i-=l-s,n[o]=l,Lr(i,0)))break}return n}const eQ=100,td={getItem:e=>(MM(td),td.getItem(e)),setItem:(e,t)=>{MM(td),td.setItem(e,t)}},NM={};function RM({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:i,id:o=null,onLayout:s=null,keyboardResizeBy:a=null,storage:l=td,style:c,tagName:d="div",...f}){const g=Oy(o),[p,v]=Ip(null),[y,x]=Ip([]),w=ei({}),S=ei(new Map),C=ei(0),P=ei({autoSaveId:e,direction:r,dragState:p,id:g,keyboardResizeBy:a,onLayout:s,storage:l}),O=ei({layout:y,panelDataArray:[],panelDataArrayChanged:!1});ei({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),gM(i,()=>({getId:()=>P.current.id,getLayout:()=>{const{layout:M}=O.current;return M},setLayout:M=>{const{onLayout:H}=P.current,{layout:ne,panelDataArray:N}=O.current,X=IM({layout:M,panelConstraints:N.map(me=>me.constraints)});SM(ne,X)||(x(X),O.current.layout=X,H&&H(X),Vl(N,X,w.current))}}),[]),Qu(()=>{P.current.autoSaveId=e,P.current.direction=r,P.current.dragState=p,P.current.id=g,P.current.onLayout=s,P.current.storage=l}),qX({committedValuesRef:P,eagerValuesRef:O,groupId:g,layout:y,panelDataArray:O.current.panelDataArray,setLayout:x}),Sa(()=>{const{panelDataArray:M}=O.current;if(e){if(y.length===0||y.length!==M.length)return;let H=NM[e];H==null&&(H=QX(ZX,eQ),NM[e]=H);const ne=[...M],N=new Map(S.current);H(e,ne,N,y,l)}},[e,y,l]),Sa(()=>{});const k=Rr(M=>{const{onLayout:H}=P.current,{layout:ne,panelDataArray:N}=O.current;if(M.constraints.collapsible){const X=N.map(re=>re.constraints),{collapsedSize:me=0,panelSize:he,pivotIndices:de}=Wl(N,M,ne);if(at(he!=null),he!==me){S.current.set(M.id,he);const ee=Hl(N,M)===N.length-1?he-me:me-he,W=Zu({delta:ee,layout:ne,panelConstraints:X,pivotIndices:de,trigger:"imperative-api"});Lp(ne,W)||(x(W),O.current.layout=W,H&&H(W),Vl(N,W,w.current))}}},[]),A=Rr(M=>{const{onLayout:H}=P.current,{layout:ne,panelDataArray:N}=O.current;if(M.constraints.collapsible){const X=N.map(ee=>ee.constraints),{collapsedSize:me=0,panelSize:he,minSize:de=0,pivotIndices:re}=Wl(N,M,ne);if(he===me){const ee=S.current.get(M.id),W=ee!=null&&ee>=de?ee:de,oe=Hl(N,M)===N.length-1?he-W:W-he,Te=Zu({delta:oe,layout:ne,panelConstraints:X,pivotIndices:re,trigger:"imperative-api"});Lp(ne,Te)||(x(Te),O.current.layout=Te,H&&H(Te),Vl(N,Te,w.current))}}},[]),L=Rr(M=>{const{layout:H,panelDataArray:ne}=O.current,{panelSize:N}=Wl(ne,M,H);return at(N!=null),N},[]),F=Rr((M,H)=>{const{panelDataArray:ne}=O.current,N=Hl(ne,M);return KX({defaultSize:H,dragState:p,layout:y,panelData:ne,panelIndex:N})},[p,y]),j=Rr(M=>{const{layout:H,panelDataArray:ne}=O.current,{collapsedSize:N=0,collapsible:X,panelSize:me}=Wl(ne,M,H);return X===!0&&me===N},[]),B=Rr(M=>{const{layout:H,panelDataArray:ne}=O.current,{collapsedSize:N=0,collapsible:X,panelSize:me}=Wl(ne,M,H);return at(me!=null),!X||me>N},[]),V=Rr(M=>{const{panelDataArray:H}=O.current;H.push(M),H.sort((ne,N)=>{const X=ne.order,me=N.order;return X==null&&me==null?0:X==null?-1:me==null?1:X-me}),O.current.panelDataArrayChanged=!0},[]);Qu(()=>{if(O.current.panelDataArrayChanged){O.current.panelDataArrayChanged=!1;const{autoSaveId:M,onLayout:H,storage:ne}=P.current,{layout:N,panelDataArray:X}=O.current;let me=null;if(M){const de=JX(M,X,ne);de&&(S.current=new Map(Object.entries(de.expandToSizes)),me=de.layout)}me==null&&(me=YX({panelDataArray:X}));const he=IM({layout:me,panelConstraints:X.map(de=>de.constraints)});SM(N,he)||(x(he),O.current.layout=he,H&&H(he),Vl(X,he,w.current))}});const K=Rr(M=>function(ne){ne.preventDefault();const{direction:N,dragState:X,id:me,keyboardResizeBy:he,onLayout:de}=P.current,{layout:re,panelDataArray:ee}=O.current,{initialLayout:W}=X??{},ye=wM(me,M);let oe=GX(ne,M,N,X,he);if(oe===0)return;const Te=N==="horizontal";document.dir==="rtl"&&Te&&(oe=-oe);const Fe=ee.map(St=>St.constraints),He=Zu({delta:oe,layout:W??re,panelConstraints:Fe,pivotIndices:ye,trigger:CM(ne)?"keyboard":"mouse-or-touch"}),Ke=!Lp(re,He);(EM(ne)||OM(ne))&&C.current!=oe&&(C.current=oe,ky(Ke?Te?"horizontal":"vertical":Te?oe<0?"horizontal-min":"horizontal-max":oe<0?"vertical-min":"vertical-max")),Ke&&(x(He),O.current.layout=He,de&&de(He),Vl(ee,He,w.current))},[]),Y=Rr((M,H)=>{const{onLayout:ne}=P.current,{layout:N,panelDataArray:X}=O.current,me=X.map(ye=>ye.constraints),{panelSize:he,pivotIndices:de}=Wl(X,M,N);at(he!=null);const ee=Hl(X,M)===X.length-1?he-H:H-he,W=Zu({delta:ee,layout:N,panelConstraints:me,pivotIndices:de,trigger:"imperative-api"});Lp(N,W)||(x(W),O.current.layout=W,ne&&ne(W),Vl(X,W,w.current))},[]),$=Rr((M,H)=>{const{direction:ne}=P.current,{layout:N}=O.current,X=Rp(M);at(X);const me=PM(ne,H);v({dragHandleId:M,dragHandleRect:X.getBoundingClientRect(),initialCursorPosition:me,initialLayout:N})},[]),Z=Rr(()=>{XX(),v(null)},[]),U=Rr(M=>{const{panelDataArray:H}=O.current,ne=Hl(H,M);ne>=0&&(H.splice(ne,1),delete w.current[M.id],O.current.panelDataArrayChanged=!0)},[]),ie=zX(()=>({collapsePanel:k,direction:r,dragState:p,expandPanel:A,getPanelSize:L,getPanelStyle:F,groupId:g,isPanelCollapsed:j,isPanelExpanded:B,registerPanel:V,registerResizeHandle:K,resizePanel:Y,startDragging:$,stopDragging:Z,unregisterPanel:U}),[k,p,r,A,L,F,g,j,B,V,K,Y,$,Z,U]),le={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return zl(Np.Provider,{value:ie},zl(d,{...f,children:t,className:n,style:{...le,...c},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":g}))}const LM=hM((e,t)=>zl(RM,{...e,forwardedRef:t}));RM.displayName="PanelGroup",LM.displayName="forwardRef(PanelGroup)";function Hl(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function Wl(e,t,n){const r=e.map(c=>c.constraints),i=Hl(e,t),o=r[i],a=i===e.length-1?[i-1,i]:[i,i+1],l=n[i];return{...o,panelSize:l,pivotIndices:a}}function tQ({disabled:e,handleId:t,resizeHandler:n}){Sa(()=>{if(e||n==null)return;const r=Rp(t);if(r==null)return;const i=o=>{if(!o.defaultPrevented)switch(o.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{o.preventDefault(),n(o);break}case"F6":{o.preventDefault();const s=r.getAttribute("data-panel-group-id");at(s);const a=ed(s),l=xM(s,t);at(l!==null);const c=o.shiftKey?l>0?l-1:a.length-1:l+1<a.length?l+1:0;a[c].focus();break}}};return r.addEventListener("keydown",i),()=>{r.removeEventListener("keydown",i)}},[e,t,n])}function $M({children:e=null,className:t="",disabled:n=!1,id:r,onDragging:i,style:o={},tabIndex:s=0,tagName:a="div",...l}){const c=ei(null),d=ei({onDragging:i});Sa(()=>{d.current.onDragging=i});const f=pM(Np);if(f===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:g,dragState:p,groupId:v,registerResizeHandle:y,startDragging:x,stopDragging:w}=f,S=Oy(r),C=(p==null?void 0:p.dragHandleId)===S,[P,O]=Ip(!1),[k,A]=Ip(null),L=Rr(()=>{const j=c.current;at(j),j.blur(),w();const{onDragging:B}=d.current;B&&B(!1)},[w]);Sa(()=>{if(n)A(null);else{const j=y(S);A(()=>j)}},[n,S,y]),Sa(()=>{if(n||k==null||!C)return;const j=Y=>{k(Y)},B=Y=>{k(Y)},V=c.current;at(V);const K=V.ownerDocument;return K.body.addEventListener("contextmenu",L),K.body.addEventListener("mousemove",j),K.body.addEventListener("touchmove",j),K.body.addEventListener("mouseleave",B),window.addEventListener("mouseup",L),window.addEventListener("touchend",L),()=>{K.body.removeEventListener("contextmenu",L),K.body.removeEventListener("mousemove",j),K.body.removeEventListener("touchmove",j),K.body.removeEventListener("mouseleave",B),window.removeEventListener("mouseup",L),window.removeEventListener("touchend",L)}},[g,n,C,k,L]),tQ({disabled:n,handleId:S,resizeHandler:k});const F={cursor:kM(g),touchAction:"none",userSelect:"none"};return zl(a,{...l,children:e,className:t,onBlur:()=>O(!1),onFocus:()=>O(!0),onMouseDown:j=>{x(S,j.nativeEvent);const B=d.current;at(B);const{onDragging:V}=B;V&&V(!0)},onMouseUp:L,onTouchCancel:L,onTouchEnd:L,onTouchStart:j=>{x(S,j.nativeEvent);const B=d.current;at(B);const{onDragging:V}=B;V&&V(!0)},ref:c,role:"separator",style:{...F,...o},tabIndex:s,"data-panel-group-direction":g,"data-panel-group-id":v,"data-resize-handle":"","data-resize-handle-active":C?"pointer":P?"keyboard":void 0,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":S})}$M.displayName="PanelResizeHandle";const FM=({className:e,...t})=>_.jsx(LM,{className:Pe("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}),$p=bM,jM=({withHandle:e,className:t,...n})=>_.jsx($M,{className:Pe("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),...n,children:e&&_.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:_.jsx(YB,{className:"h-2.5 w-2.5"})})});function nQ(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function BM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zM(Object(n),!0).forEach(function(r){nQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rQ(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function iQ(e,t){if(e==null)return{};var n=rQ(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function oQ(e,t){return sQ(e)||aQ(e,t)||lQ(e,t)||cQ()}function sQ(e){if(Array.isArray(e))return e}function aQ(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,i=!1,o=void 0;try{for(var s=e[Symbol.iterator](),a;!(r=(a=s.next()).done)&&(n.push(a.value),!(t&&n.length===t));r=!0);}catch(l){i=!0,o=l}finally{try{!r&&s.return!=null&&s.return()}finally{if(i)throw o}}return n}}function lQ(e,t){if(e){if(typeof e=="string")return VM(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return VM(e,t)}}function VM(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function cQ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
419
419
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uQ(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function WM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HM(Object(n),!0).forEach(function(r){uQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dQ(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return t.reduceRight(function(i,o){return o(i)},r)}}function nd(e){return function t(){for(var n=this,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return i.length>=e.length?e.apply(this,i):function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return t.apply(n,[].concat(i,a))}}}function Fp(e){return{}.toString.call(e).includes("Object")}function fQ(e){return!Object.keys(e).length}function rd(e){return typeof e=="function"}function hQ(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function pQ(e,t){return Fp(t)||as("changeType"),Object.keys(t).some(function(n){return!hQ(e,n)})&&as("changeField"),t}function gQ(e){rd(e)||as("selectorType")}function mQ(e){rd(e)||Fp(e)||as("handlerType"),Fp(e)&&Object.values(e).some(function(t){return!rd(t)})&&as("handlersType")}function vQ(e){e||as("initialIsRequired"),Fp(e)||as("initialType"),fQ(e)&&as("initialContent")}function bQ(e,t){throw new Error(e[t]||e.default)}var yQ={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},as=nd(bQ)(yQ),jp={changes:pQ,selector:gQ,handler:mQ,initial:vQ};function xQ(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};jp.initial(e),jp.handler(t);var n={current:e},r=nd(SQ)(n,t),i=nd(_Q)(n),o=nd(jp.changes)(e),s=nd(wQ)(n);function a(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(d){return d};return jp.selector(c),c(n.current)}function l(c){dQ(r,i,o,s)(c)}return[a,l]}function wQ(e,t){return rd(t)?t(e.current):t}function _Q(e,t){return e.current=WM(WM({},e.current),t),t}function SQ(e,t,n){return rd(t)?t(e.current):Object.keys(n).forEach(function(r){var i;return(i=t[r])===null||i===void 0?void 0:i.call(t,e.current[r])}),n}var CQ={create:xQ},EQ={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function OQ(e){return function t(){for(var n=this,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return i.length>=e.length?e.apply(this,i):function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return t.apply(n,[].concat(i,a))}}}function PQ(e){return{}.toString.call(e).includes("Object")}function kQ(e){return e||UM("configIsRequired"),PQ(e)||UM("configType"),e.urls?(MQ(),{paths:{vs:e.urls.monacoBase}}):e}function MQ(){console.warn(qM.deprecation)}function DQ(e,t){throw new Error(e[t]||e.default)}var qM={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
|
420
420
|
You are using deprecated way of configuration.
|
|
421
421
|
|
|
@@ -425,7 +425,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
425
425
|
monaco.config({ paths: { vs: '...' } })
|
|
426
426
|
|
|
427
427
|
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
428
|
-
`},UM=OQ(DQ)(qM),TQ={config:kQ},AQ=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(i){return n.reduceRight(function(o,s){return s(o)},i)}};function GM(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],GM(e[n],t[n]))}),BM(BM({},e),t)}var IQ={type:"cancelation",msg:"operation is manually canceled"};function My(e){var t=!1,n=new Promise(function(r,i){e.then(function(o){return t?i(IQ):r(o)}),e.catch(i)});return n.cancel=function(){return t=!0},n}var NQ=CQ.create({config:EQ,isInitialized:!1,resolve:null,reject:null,monaco:null}),YM=oQ(NQ,2),id=YM[0],zp=YM[1];function RQ(e){var t=TQ.config(e),n=t.monaco,r=iQ(t,["monaco"]);zp(function(i){return{config:GM(i.config,r),monaco:n}})}function LQ(){var e=id(function(t){var n=t.monaco,r=t.isInitialized,i=t.resolve;return{monaco:n,isInitialized:r,resolve:i}});if(!e.isInitialized){if(zp({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),My(Dy);if(window.monaco&&window.monaco.editor)return KM(window.monaco),e.resolve(window.monaco),My(Dy);AQ($Q,jQ)(zQ)}return My(Dy)}function $Q(e){return document.body.appendChild(e)}function FQ(e){var t=document.createElement("script");return e&&(t.src=e),t}function jQ(e){var t=id(function(r){var i=r.config,o=r.reject;return{config:i,reject:o}}),n=FQ("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function zQ(){var e=id(function(n){var r=n.config,i=n.resolve,o=n.reject;return{config:r,resolve:i,reject:o}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){KM(n),e.resolve(n)},function(n){e.reject(n)})}function KM(e){id().monaco||zp({monaco:e})}function BQ(){return id(function(e){var t=e.monaco;return t})}var Dy=new Promise(function(e,t){return zp({resolve:e,reject:t})}),XM={config:RQ,init:LQ,__getMonacoInstance:BQ},VQ={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Ty=VQ,HQ={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},WQ=HQ;function qQ({children:e}){return m.createElement("div",{style:WQ.container},e)}var UQ=qQ,GQ=UQ;function YQ({width:e,height:t,isEditorReady:n,loading:r,_ref:i,className:o,wrapperProps:s}){return m.createElement("section",{style:{...Ty.wrapper,width:e,height:t},...s},!n&&m.createElement(GQ,null,r),m.createElement("div",{ref:i,style:{...Ty.fullWidth,...!n&&Ty.hide},className:o}))}var KQ=YQ,QM=m.memo(KQ);function XQ(e){m.useEffect(e,[])}var JM=XQ;function QQ(e,t,n=!0){let r=m.useRef(!0);m.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var $r=QQ;function od(){}function ql(e,t,n,r){return JQ(e,r)||ZQ(e,t,n,r)}function JQ(e,t){return e.editor.getModel(ZM(e,t))}function ZQ(e,t,n,r){return e.editor.createModel(t,n,r?ZM(e,r):void 0)}function ZM(e,t){return e.Uri.parse(t)}function eJ({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:i,originalModelPath:o,modifiedModelPath:s,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:c="light",loading:d="Loading...",options:f={},height:g="100%",width:p="100%",className:v,wrapperProps:y={},beforeMount:x=od,onMount:w=od}){let[S,C]=m.useState(!1),[P,O]=m.useState(!0),k=m.useRef(null),A=m.useRef(null),L=m.useRef(null),F=m.useRef(w),j=m.useRef(x),B=m.useRef(!1);JM(()=>{let $=XM.init();return $.then(Z=>(A.current=Z)&&O(!1)).catch(Z=>(Z==null?void 0:Z.type)!=="cancelation"&&console.error("Monaco initialization: error:",Z)),()=>k.current?Y():$.cancel()}),$r(()=>{if(k.current&&A.current){let $=k.current.getOriginalEditor(),Z=ql(A.current,e||"",r||n||"text",o||"");Z!==$.getModel()&&$.setModel(Z)}},[o],S),$r(()=>{if(k.current&&A.current){let $=k.current.getModifiedEditor(),Z=ql(A.current,t||"",i||n||"text",s||"");Z!==$.getModel()&&$.setModel(Z)}},[s],S),$r(()=>{let $=k.current.getModifiedEditor();$.getOption(A.current.editor.EditorOption.readOnly)?$.setValue(t||""):t!==$.getValue()&&($.executeEdits("",[{range:$.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),$.pushUndoStop())},[t],S),$r(()=>{var $,Z;(Z=($=k.current)==null?void 0:$.getModel())==null||Z.original.setValue(e||"")},[e],S),$r(()=>{let{original:$,modified:Z}=k.current.getModel();A.current.editor.setModelLanguage($,r||n||"text"),A.current.editor.setModelLanguage(Z,i||n||"text")},[n,r,i],S),$r(()=>{var $;($=A.current)==null||$.editor.setTheme(c)},[c],S),$r(()=>{var $;($=k.current)==null||$.updateOptions(f)},[f],S);let V=m.useCallback(()=>{var U;if(!A.current)return;j.current(A.current);let $=ql(A.current,e||"",r||n||"text",o||""),Z=ql(A.current,t||"",i||n||"text",s||"");(U=k.current)==null||U.setModel({original:$,modified:Z})},[n,t,i,e,r,o,s]),K=m.useCallback(()=>{var $;!B.current&&L.current&&(k.current=A.current.editor.createDiffEditor(L.current,{automaticLayout:!0,...f}),V(),($=A.current)==null||$.editor.setTheme(c),C(!0),B.current=!0)},[f,c,V]);m.useEffect(()=>{S&&F.current(k.current,A.current)},[S]),m.useEffect(()=>{!P&&!S&&K()},[P,S,K]);function Y(){var Z,U,ie,le;let $=(Z=k.current)==null?void 0:Z.getModel();a||((U=$==null?void 0:$.original)==null||U.dispose()),l||((ie=$==null?void 0:$.modified)==null||ie.dispose()),(le=k.current)==null||le.dispose()}return m.createElement(QM,{width:p,height:g,isEditorReady:S,loading:d,_ref:L,className:v,wrapperProps:y})}var tJ=eJ;m.memo(tJ);function nJ(e){let t=m.useRef();return m.useEffect(()=>{t.current=e},[e]),t.current}var rJ=nJ,Bp=new Map;function iJ({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:i,path:o,theme:s="light",line:a,loading:l="Loading...",options:c={},overrideServices:d={},saveViewState:f=!0,keepCurrentModel:g=!1,width:p="100%",height:v="100%",className:y,wrapperProps:x={},beforeMount:w=od,onMount:S=od,onChange:C,onValidate:P=od}){let[O,k]=m.useState(!1),[A,L]=m.useState(!0),F=m.useRef(null),j=m.useRef(null),B=m.useRef(null),V=m.useRef(S),K=m.useRef(w),Y=m.useRef(),$=m.useRef(r),Z=rJ(o),U=m.useRef(!1),ie=m.useRef(!1);JM(()=>{let H=XM.init();return H.then(ne=>(F.current=ne)&&L(!1)).catch(ne=>(ne==null?void 0:ne.type)!=="cancelation"&&console.error("Monaco initialization: error:",ne)),()=>j.current?M():H.cancel()}),$r(()=>{var ne,N,X,me;let H=ql(F.current,e||r||"",t||i||"",o||n||"");H!==((ne=j.current)==null?void 0:ne.getModel())&&(f&&Bp.set(Z,(N=j.current)==null?void 0:N.saveViewState()),(X=j.current)==null||X.setModel(H),f&&((me=j.current)==null||me.restoreViewState(Bp.get(o))))},[o],O),$r(()=>{var H;(H=j.current)==null||H.updateOptions(c)},[c],O),$r(()=>{!j.current||r===void 0||(j.current.getOption(F.current.editor.EditorOption.readOnly)?j.current.setValue(r):r!==j.current.getValue()&&(ie.current=!0,j.current.executeEdits("",[{range:j.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),j.current.pushUndoStop(),ie.current=!1))},[r],O),$r(()=>{var ne,N;let H=(ne=j.current)==null?void 0:ne.getModel();H&&i&&((N=F.current)==null||N.editor.setModelLanguage(H,i))},[i],O),$r(()=>{var H;a!==void 0&&((H=j.current)==null||H.revealLine(a))},[a],O),$r(()=>{var H;(H=F.current)==null||H.editor.setTheme(s)},[s],O);let le=m.useCallback(()=>{var H;if(!(!B.current||!F.current)&&!U.current){K.current(F.current);let ne=o||n,N=ql(F.current,r||e||"",t||i||"",ne||"");j.current=(H=F.current)==null?void 0:H.editor.create(B.current,{model:N,automaticLayout:!0,...c},d),f&&j.current.restoreViewState(Bp.get(ne)),F.current.editor.setTheme(s),a!==void 0&&j.current.revealLine(a),k(!0),U.current=!0}},[e,t,n,r,i,o,c,d,f,s,a]);m.useEffect(()=>{O&&V.current(j.current,F.current)},[O]),m.useEffect(()=>{!A&&!O&&le()},[A,O,le]),$.current=r,m.useEffect(()=>{var H,ne;O&&C&&((H=Y.current)==null||H.dispose(),Y.current=(ne=j.current)==null?void 0:ne.onDidChangeModelContent(N=>{ie.current||C(j.current.getValue(),N)}))},[O,C]),m.useEffect(()=>{if(O){let H=F.current.editor.onDidChangeMarkers(ne=>{var X;let N=(X=j.current.getModel())==null?void 0:X.uri;if(N&&ne.find(me=>me.path===N.path)){let me=F.current.editor.getModelMarkers({resource:N});P==null||P(me)}});return()=>{H==null||H.dispose()}}return()=>{}},[O,P]);function M(){var H,ne;(H=Y.current)==null||H.dispose(),g?f&&Bp.set(o,j.current.saveViewState()):(ne=j.current.getModel())==null||ne.dispose(),j.current.dispose()}return m.createElement(QM,{width:p,height:v,isEditorReady:O,loading:l,_ref:B,className:y,wrapperProps:x})}var oJ=iJ,eD=m.memo(oJ),Ay=eD;function sJ(e){const t=e.toUpperCase().indexOf("WHERE"),n=e.toUpperCase().indexOf("GROUP BY"),r=e.toUpperCase().indexOf("LIMIT"),i=e.toUpperCase().indexOf("ORDER BY");let o=e.length;if(i!==-1&&(o=i),r!==-1&&r<o&&(o=r),t!==-1){const s=e.substring(0,t),a=e.substring(t);return`${s} {{ filters | where }} AND ${a.substring(7)}`}else if(n!==-1){const s=e.substring(0,n),a=e.substring(n);return`${s} {{ filters | where }} ${a}`}else{const s=e.substring(0,o),a=e.substring(o);return`${s} {{ filters | where }} ${a}`}}let Iy;const tD="HoverCard",[nD,sfe]=Pn(tD,[Fi]),Ny=Fi(),[aJ,Ry]=nD(tD),lJ=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:i,onOpenChange:o,openDelay:s=700,closeDelay:a=300}=e,l=Ny(t),c=m.useRef(0),d=m.useRef(0),f=m.useRef(!1),g=m.useRef(!1),[p=!1,v]=Qn({prop:r,defaultProp:i,onChange:o}),y=m.useCallback(()=>{clearTimeout(d.current),c.current=window.setTimeout(()=>v(!0),s)},[s,v]),x=m.useCallback(()=>{clearTimeout(c.current),!f.current&&!g.current&&(d.current=window.setTimeout(()=>v(!1),a))},[a,v]),w=m.useCallback(()=>v(!1),[v]);return m.useEffect(()=>()=>{clearTimeout(c.current),clearTimeout(d.current)},[]),m.createElement(aJ,{scope:t,open:p,onOpenChange:v,onOpen:y,onClose:x,onDismiss:w,hasSelectionRef:f,isPointerDownOnContentRef:g},m.createElement(Eu,l,n))},cJ="HoverCardTrigger",uJ=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,i=Ry(cJ,n),o=Ny(n);return m.createElement(Ou,ae({asChild:!0},o),m.createElement(Be.a,ae({"data-state":i.open?"open":"closed"},r,{ref:t,onPointerEnter:Ce(e.onPointerEnter,Vp(i.onOpen)),onPointerLeave:Ce(e.onPointerLeave,Vp(i.onClose)),onFocus:Ce(e.onFocus,i.onOpen),onBlur:Ce(e.onBlur,i.onClose),onTouchStart:Ce(e.onTouchStart,s=>s.preventDefault())})))}),dJ="HoverCardPortal",[afe,fJ]=nD(dJ,{forceMount:void 0}),Ly="HoverCardContent",hJ=m.forwardRef((e,t)=>{const n=fJ(Ly,e.__scopeHoverCard),{forceMount:r=n.forceMount,...i}=e,o=Ry(Ly,e.__scopeHoverCard);return m.createElement(vn,{present:r||o.open},m.createElement(pJ,ae({"data-state":o.open?"open":"closed"},i,{onPointerEnter:Ce(e.onPointerEnter,Vp(o.onOpen)),onPointerLeave:Ce(e.onPointerLeave,Vp(o.onClose)),ref:t})))}),pJ=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,...a}=e,l=Ry(Ly,n),c=Ny(n),d=m.useRef(null),f=et(t,d),[g,p]=m.useState(!1);return m.useEffect(()=>{if(g){const v=document.body;return Iy=v.style.userSelect||v.style.webkitUserSelect,v.style.userSelect="none",v.style.webkitUserSelect="none",()=>{v.style.userSelect=Iy,v.style.webkitUserSelect=Iy}}},[g]),m.useEffect(()=>{if(d.current){const v=()=>{p(!1),l.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var y;((y=document.getSelection())===null||y===void 0?void 0:y.toString())!==""&&(l.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",v),()=>{document.removeEventListener("pointerup",v),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!1}}},[l.isPointerDownOnContentRef,l.hasSelectionRef]),m.useEffect(()=>{d.current&&gJ(d.current).forEach(y=>y.setAttribute("tabindex","-1"))}),m.createElement(_l,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:s,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:Ce(o,v=>{v.preventDefault()}),onDismiss:l.onDismiss},m.createElement(Pu,ae({},c,a,{onPointerDown:Ce(a.onPointerDown,v=>{v.currentTarget.contains(v.target)&&p(!0),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!0}),ref:f,style:{...a.style,userSelect:g?"text":void 0,WebkitUserSelect:g?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})))});function Vp(e){return t=>t.pointerType==="touch"?void 0:e()}function gJ(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}const mJ=lJ,vJ=uJ,rD=hJ,iD=mJ,oD=vJ,$y=ue.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},i)=>_.jsx(rD,{ref:i,align:t,sideOffset:n,className:Pe("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));$y.displayName=rD.displayName;function bJ({error:e}){return _.jsxs(iD,{openDelay:0,children:[_.jsx(oD,{asChild:!0,children:_.jsx(ot,{variant:"link",className:" p-0 h-5",children:_.jsx(eV,{className:"h-4 w-4 text-red-500"})})}),_.jsx($y,{align:"start",className:"w-[600px]",children:_.jsx("div",{className:"flex justify-between space-x-4",children:_.jsx("div",{className:"space-y-1",children:_.jsx("p",{className:"text-sm",children:e})})})})]})}function yJ({text:e,onCheckedChange:t,checked:n}){return _.jsxs("div",{className:"flex items-center space-x-1 xbg-red-100 ml-7",children:[_.jsx(Op,{checked:n,onCheckedChange:t}),_.jsx("label",{className:"text-xs leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:e})]})}function xJ(){const e=ge(a=>a.authToken),t=m.useRef(null),n=_e(a=>a.applyFilters),[r,i]=m.useState(""),o=_e(a=>a.filterValues),s=_e(a=>a.card.sql);return _.jsxs(iD,{openDelay:0,onOpenChange:async a=>{if(!a)return;console.log("onOpenChange");const l=await Is("https://semaphor.cloud/api/v1/filter-sql",(e==null?void 0:e.accessToken)||"",{sql:s,active_filters:o});console.log(l),l.sql?(console.log(l.records),i(l.sql)):i("Error")},children:[_.jsx(oD,{asChild:!0,children:n&&_.jsx("p",{className:" p-0 hover:cursor-pointer text-xs",children:"| Filter Query"})}),_.jsxs($y,{align:"end",className:"w-[600px] ",children:[_.jsx("div",{className:" flex justify-between space-x-4",children:_.jsx("div",{className:"bg-muted p-2 rounded-sm",children:_.jsxs("code",{ref:t,className:"text-sm font-mono ",children:[r,_.jsx(QE,{onClick:()=>$3(t),className:" inline-block ml-3 h-4 w-4 opacity-70 hover:opacity-100 hover:cursor-pointer"})]})})}),_.jsxs("div",{className:"flex gap-2 items-center pt-2",children:[_.jsx(JE,{className:"h-4 w-4 opacity-70"}),_.jsx("span",{className:"text-xs text-muted-foreground",children:"A preview of the query with filters applied."})]})]})]})}const Fy=ue.forwardRef(({className:e,...t},n)=>_.jsx("textarea",{className:Pe("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));Fy.displayName="Textarea";function lfe(){}function cfe(){}function wJ(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const _J=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,SJ=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,CJ={};function sD(e,t){return((t||CJ).jsx?SJ:_J).test(e)}const EJ=/[ \t\n\f\r]/g;function OJ(e){return typeof e=="object"?e.type==="text"?aD(e.value):!1:aD(e)}function aD(e){return e.replace(EJ,"")===""}class sd{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}sd.prototype.property={},sd.prototype.normal={},sd.prototype.space=null;function lD(e,t){const n={},r={};let i=-1;for(;++i<e.length;)Object.assign(n,e[i].property),Object.assign(r,e[i].normal);return new sd(n,r,t)}function jy(e){return e.toLowerCase()}class ti{constructor(t,n){this.property=t,this.attribute=n}}ti.prototype.space=null,ti.prototype.boolean=!1,ti.prototype.booleanish=!1,ti.prototype.overloadedBoolean=!1,ti.prototype.number=!1,ti.prototype.commaSeparated=!1,ti.prototype.spaceSeparated=!1,ti.prototype.commaOrSpaceSeparated=!1,ti.prototype.mustUseProperty=!1,ti.prototype.defined=!1;let PJ=0;const at=Ea(),yn=Ea(),cD=Ea(),Ee=Ea(),Ht=Ea(),Ul=Ea(),Fr=Ea();function Ea(){return 2**++PJ}const zy=Object.freeze(Object.defineProperty({__proto__:null,boolean:at,booleanish:yn,commaOrSpaceSeparated:Fr,commaSeparated:Ul,number:Ee,overloadedBoolean:cD,spaceSeparated:Ht},Symbol.toStringTag,{value:"Module"})),By=Object.keys(zy);class Vy extends ti{constructor(t,n,r,i){let o=-1;if(super(t,n),uD(this,"space",i),typeof r=="number")for(;++o<By.length;){const s=By[o];uD(this,By[o],(r&zy[s])===zy[s])}}}Vy.prototype.defined=!0;function uD(e,t,n){n&&(e[t]=n)}const kJ={}.hasOwnProperty;function Gl(e){const t={},n={};let r;for(r in e.properties)if(kJ.call(e.properties,r)){const i=e.properties[r],o=new Vy(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[jy(r)]=r,n[jy(o.attribute)]=r}return new sd(t,n,e.space)}const dD=Gl({space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),fD=Gl({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function hD(e,t){return t in e?e[t]:t}function pD(e,t){return hD(e,t.toLowerCase())}const gD=Gl({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:pD,properties:{xmlns:null,xmlnsXLink:null}}),mD=Gl({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:yn,ariaAutoComplete:null,ariaBusy:yn,ariaChecked:yn,ariaColCount:Ee,ariaColIndex:Ee,ariaColSpan:Ee,ariaControls:Ht,ariaCurrent:null,ariaDescribedBy:Ht,ariaDetails:null,ariaDisabled:yn,ariaDropEffect:Ht,ariaErrorMessage:null,ariaExpanded:yn,ariaFlowTo:Ht,ariaGrabbed:yn,ariaHasPopup:null,ariaHidden:yn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ht,ariaLevel:Ee,ariaLive:null,ariaModal:yn,ariaMultiLine:yn,ariaMultiSelectable:yn,ariaOrientation:null,ariaOwns:Ht,ariaPlaceholder:null,ariaPosInSet:Ee,ariaPressed:yn,ariaReadOnly:yn,ariaRelevant:null,ariaRequired:yn,ariaRoleDescription:Ht,ariaRowCount:Ee,ariaRowIndex:Ee,ariaRowSpan:Ee,ariaSelected:yn,ariaSetSize:Ee,ariaSort:null,ariaValueMax:Ee,ariaValueMin:Ee,ariaValueNow:Ee,ariaValueText:null,role:null}}),MJ=Gl({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:pD,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ul,acceptCharset:Ht,accessKey:Ht,action:null,allow:null,allowFullScreen:at,allowPaymentRequest:at,allowUserMedia:at,alt:null,as:null,async:at,autoCapitalize:null,autoComplete:Ht,autoFocus:at,autoPlay:at,blocking:Ht,capture:null,charSet:null,checked:at,cite:null,className:Ht,cols:Ee,colSpan:null,content:null,contentEditable:yn,controls:at,controlsList:Ht,coords:Ee|Ul,crossOrigin:null,data:null,dateTime:null,decoding:null,default:at,defer:at,dir:null,dirName:null,disabled:at,download:cD,draggable:yn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:at,formTarget:null,headers:Ht,height:Ee,hidden:at,high:Ee,href:null,hrefLang:null,htmlFor:Ht,httpEquiv:Ht,id:null,imageSizes:null,imageSrcSet:null,inert:at,inputMode:null,integrity:null,is:null,isMap:at,itemId:null,itemProp:Ht,itemRef:Ht,itemScope:at,itemType:Ht,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:at,low:Ee,manifest:null,max:null,maxLength:Ee,media:null,method:null,min:null,minLength:Ee,multiple:at,muted:at,name:null,nonce:null,noModule:at,noValidate:at,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:at,optimum:Ee,pattern:null,ping:Ht,placeholder:null,playsInline:at,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:at,referrerPolicy:null,rel:Ht,required:at,reversed:at,rows:Ee,rowSpan:Ee,sandbox:Ht,scope:null,scoped:at,seamless:at,selected:at,shadowRootDelegatesFocus:at,shadowRootMode:null,shape:null,size:Ee,sizes:null,slot:null,span:Ee,spellCheck:yn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ee,step:null,style:null,tabIndex:Ee,target:null,title:null,translate:null,type:null,typeMustMatch:at,useMap:null,value:yn,width:Ee,wrap:null,align:null,aLink:null,archive:Ht,axis:null,background:null,bgColor:null,border:Ee,borderColor:null,bottomMargin:Ee,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:at,declare:at,event:null,face:null,frame:null,frameBorder:null,hSpace:Ee,leftMargin:Ee,link:null,longDesc:null,lowSrc:null,marginHeight:Ee,marginWidth:Ee,noResize:at,noHref:at,noShade:at,noWrap:at,object:null,profile:null,prompt:null,rev:null,rightMargin:Ee,rules:null,scheme:null,scrolling:yn,standby:null,summary:null,text:null,topMargin:Ee,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ee,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:at,disableRemotePlayback:at,prefix:null,property:null,results:Ee,security:null,unselectable:null}}),DJ=Gl({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:hD,properties:{about:Fr,accentHeight:Ee,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ee,amplitude:Ee,arabicForm:null,ascent:Ee,attributeName:null,attributeType:null,azimuth:Ee,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ee,by:null,calcMode:null,capHeight:Ee,className:Ht,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Ee,diffuseConstant:Ee,direction:null,display:null,dur:null,divisor:Ee,dominantBaseline:null,download:at,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ee,enableBackground:null,end:null,event:null,exponent:Ee,externalResourcesRequired:null,fill:null,fillOpacity:Ee,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ul,g2:Ul,glyphName:Ul,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ee,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ee,horizOriginX:Ee,horizOriginY:Ee,id:null,ideographic:Ee,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ee,k:Ee,k1:Ee,k2:Ee,k3:Ee,k4:Ee,kernelMatrix:Fr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ee,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ee,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Ee,overlineThickness:Ee,paintOrder:null,panose1:null,path:null,pathLength:Ee,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ht,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ee,pointsAtY:Ee,pointsAtZ:Ee,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Fr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Fr,rev:Fr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Fr,requiredFeatures:Fr,requiredFonts:Fr,requiredFormats:Fr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Ee,specularExponent:Ee,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ee,strikethroughThickness:Ee,string:null,stroke:null,strokeDashArray:Fr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ee,strokeOpacity:Ee,strokeWidth:null,style:null,surfaceScale:Ee,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Fr,tabIndex:Ee,tableValues:null,target:null,targetX:Ee,targetY:Ee,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Fr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ee,underlineThickness:Ee,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ee,values:null,vAlphabetic:Ee,vMathematical:Ee,vectorEffect:null,vHanging:Ee,vIdeographic:Ee,version:null,vertAdvY:Ee,vertOriginX:Ee,vertOriginY:Ee,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ee,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),TJ=/^data[-\w.:]+$/i,vD=/-[a-z]/g,AJ=/[A-Z]/g;function IJ(e,t){const n=jy(t);let r=t,i=ti;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&TJ.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(vD,RJ);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!vD.test(o)){let s=o.replace(AJ,NJ);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=Vy}return new i(r,t)}function NJ(e){return"-"+e.toLowerCase()}function RJ(e){return e.charAt(1).toUpperCase()}const LJ={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},$J=lD([fD,dD,gD,mD,MJ],"html"),Hy=lD([fD,dD,gD,mD,DJ],"svg");function FJ(e){return e.join(" ").trim()}var bD={},yD=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,jJ=/\n/g,zJ=/^\s*/,BJ=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,VJ=/^:\s*/,HJ=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,WJ=/^[;\s]*/,qJ=/^\s+|\s+$/g,UJ=`
|
|
428
|
+
`},UM=OQ(DQ)(qM),TQ={config:kQ},AQ=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(i){return n.reduceRight(function(o,s){return s(o)},i)}};function GM(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],GM(e[n],t[n]))}),BM(BM({},e),t)}var IQ={type:"cancelation",msg:"operation is manually canceled"};function My(e){var t=!1,n=new Promise(function(r,i){e.then(function(o){return t?i(IQ):r(o)}),e.catch(i)});return n.cancel=function(){return t=!0},n}var NQ=CQ.create({config:EQ,isInitialized:!1,resolve:null,reject:null,monaco:null}),YM=oQ(NQ,2),id=YM[0],zp=YM[1];function RQ(e){var t=TQ.config(e),n=t.monaco,r=iQ(t,["monaco"]);zp(function(i){return{config:GM(i.config,r),monaco:n}})}function LQ(){var e=id(function(t){var n=t.monaco,r=t.isInitialized,i=t.resolve;return{monaco:n,isInitialized:r,resolve:i}});if(!e.isInitialized){if(zp({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),My(Dy);if(window.monaco&&window.monaco.editor)return KM(window.monaco),e.resolve(window.monaco),My(Dy);AQ($Q,jQ)(zQ)}return My(Dy)}function $Q(e){return document.body.appendChild(e)}function FQ(e){var t=document.createElement("script");return e&&(t.src=e),t}function jQ(e){var t=id(function(r){var i=r.config,o=r.reject;return{config:i,reject:o}}),n=FQ("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function zQ(){var e=id(function(n){var r=n.config,i=n.resolve,o=n.reject;return{config:r,resolve:i,reject:o}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){KM(n),e.resolve(n)},function(n){e.reject(n)})}function KM(e){id().monaco||zp({monaco:e})}function BQ(){return id(function(e){var t=e.monaco;return t})}var Dy=new Promise(function(e,t){return zp({resolve:e,reject:t})}),XM={config:RQ,init:LQ,__getMonacoInstance:BQ},VQ={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Ty=VQ,HQ={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},WQ=HQ;function qQ({children:e}){return m.createElement("div",{style:WQ.container},e)}var UQ=qQ,GQ=UQ;function YQ({width:e,height:t,isEditorReady:n,loading:r,_ref:i,className:o,wrapperProps:s}){return m.createElement("section",{style:{...Ty.wrapper,width:e,height:t},...s},!n&&m.createElement(GQ,null,r),m.createElement("div",{ref:i,style:{...Ty.fullWidth,...!n&&Ty.hide},className:o}))}var KQ=YQ,QM=m.memo(KQ);function XQ(e){m.useEffect(e,[])}var JM=XQ;function QQ(e,t,n=!0){let r=m.useRef(!0);m.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var $r=QQ;function od(){}function ql(e,t,n,r){return JQ(e,r)||ZQ(e,t,n,r)}function JQ(e,t){return e.editor.getModel(ZM(e,t))}function ZQ(e,t,n,r){return e.editor.createModel(t,n,r?ZM(e,r):void 0)}function ZM(e,t){return e.Uri.parse(t)}function eJ({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:i,originalModelPath:o,modifiedModelPath:s,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:c="light",loading:d="Loading...",options:f={},height:g="100%",width:p="100%",className:v,wrapperProps:y={},beforeMount:x=od,onMount:w=od}){let[S,C]=m.useState(!1),[P,O]=m.useState(!0),k=m.useRef(null),A=m.useRef(null),L=m.useRef(null),F=m.useRef(w),j=m.useRef(x),B=m.useRef(!1);JM(()=>{let $=XM.init();return $.then(Z=>(A.current=Z)&&O(!1)).catch(Z=>(Z==null?void 0:Z.type)!=="cancelation"&&console.error("Monaco initialization: error:",Z)),()=>k.current?Y():$.cancel()}),$r(()=>{if(k.current&&A.current){let $=k.current.getOriginalEditor(),Z=ql(A.current,e||"",r||n||"text",o||"");Z!==$.getModel()&&$.setModel(Z)}},[o],S),$r(()=>{if(k.current&&A.current){let $=k.current.getModifiedEditor(),Z=ql(A.current,t||"",i||n||"text",s||"");Z!==$.getModel()&&$.setModel(Z)}},[s],S),$r(()=>{let $=k.current.getModifiedEditor();$.getOption(A.current.editor.EditorOption.readOnly)?$.setValue(t||""):t!==$.getValue()&&($.executeEdits("",[{range:$.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),$.pushUndoStop())},[t],S),$r(()=>{var $,Z;(Z=($=k.current)==null?void 0:$.getModel())==null||Z.original.setValue(e||"")},[e],S),$r(()=>{let{original:$,modified:Z}=k.current.getModel();A.current.editor.setModelLanguage($,r||n||"text"),A.current.editor.setModelLanguage(Z,i||n||"text")},[n,r,i],S),$r(()=>{var $;($=A.current)==null||$.editor.setTheme(c)},[c],S),$r(()=>{var $;($=k.current)==null||$.updateOptions(f)},[f],S);let V=m.useCallback(()=>{var U;if(!A.current)return;j.current(A.current);let $=ql(A.current,e||"",r||n||"text",o||""),Z=ql(A.current,t||"",i||n||"text",s||"");(U=k.current)==null||U.setModel({original:$,modified:Z})},[n,t,i,e,r,o,s]),K=m.useCallback(()=>{var $;!B.current&&L.current&&(k.current=A.current.editor.createDiffEditor(L.current,{automaticLayout:!0,...f}),V(),($=A.current)==null||$.editor.setTheme(c),C(!0),B.current=!0)},[f,c,V]);m.useEffect(()=>{S&&F.current(k.current,A.current)},[S]),m.useEffect(()=>{!P&&!S&&K()},[P,S,K]);function Y(){var Z,U,ie,le;let $=(Z=k.current)==null?void 0:Z.getModel();a||((U=$==null?void 0:$.original)==null||U.dispose()),l||((ie=$==null?void 0:$.modified)==null||ie.dispose()),(le=k.current)==null||le.dispose()}return m.createElement(QM,{width:p,height:g,isEditorReady:S,loading:d,_ref:L,className:v,wrapperProps:y})}var tJ=eJ;m.memo(tJ);function nJ(e){let t=m.useRef();return m.useEffect(()=>{t.current=e},[e]),t.current}var rJ=nJ,Bp=new Map;function iJ({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:i,path:o,theme:s="light",line:a,loading:l="Loading...",options:c={},overrideServices:d={},saveViewState:f=!0,keepCurrentModel:g=!1,width:p="100%",height:v="100%",className:y,wrapperProps:x={},beforeMount:w=od,onMount:S=od,onChange:C,onValidate:P=od}){let[O,k]=m.useState(!1),[A,L]=m.useState(!0),F=m.useRef(null),j=m.useRef(null),B=m.useRef(null),V=m.useRef(S),K=m.useRef(w),Y=m.useRef(),$=m.useRef(r),Z=rJ(o),U=m.useRef(!1),ie=m.useRef(!1);JM(()=>{let H=XM.init();return H.then(ne=>(F.current=ne)&&L(!1)).catch(ne=>(ne==null?void 0:ne.type)!=="cancelation"&&console.error("Monaco initialization: error:",ne)),()=>j.current?M():H.cancel()}),$r(()=>{var ne,N,X,me;let H=ql(F.current,e||r||"",t||i||"",o||n||"");H!==((ne=j.current)==null?void 0:ne.getModel())&&(f&&Bp.set(Z,(N=j.current)==null?void 0:N.saveViewState()),(X=j.current)==null||X.setModel(H),f&&((me=j.current)==null||me.restoreViewState(Bp.get(o))))},[o],O),$r(()=>{var H;(H=j.current)==null||H.updateOptions(c)},[c],O),$r(()=>{!j.current||r===void 0||(j.current.getOption(F.current.editor.EditorOption.readOnly)?j.current.setValue(r):r!==j.current.getValue()&&(ie.current=!0,j.current.executeEdits("",[{range:j.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),j.current.pushUndoStop(),ie.current=!1))},[r],O),$r(()=>{var ne,N;let H=(ne=j.current)==null?void 0:ne.getModel();H&&i&&((N=F.current)==null||N.editor.setModelLanguage(H,i))},[i],O),$r(()=>{var H;a!==void 0&&((H=j.current)==null||H.revealLine(a))},[a],O),$r(()=>{var H;(H=F.current)==null||H.editor.setTheme(s)},[s],O);let le=m.useCallback(()=>{var H;if(!(!B.current||!F.current)&&!U.current){K.current(F.current);let ne=o||n,N=ql(F.current,r||e||"",t||i||"",ne||"");j.current=(H=F.current)==null?void 0:H.editor.create(B.current,{model:N,automaticLayout:!0,...c},d),f&&j.current.restoreViewState(Bp.get(ne)),F.current.editor.setTheme(s),a!==void 0&&j.current.revealLine(a),k(!0),U.current=!0}},[e,t,n,r,i,o,c,d,f,s,a]);m.useEffect(()=>{O&&V.current(j.current,F.current)},[O]),m.useEffect(()=>{!A&&!O&&le()},[A,O,le]),$.current=r,m.useEffect(()=>{var H,ne;O&&C&&((H=Y.current)==null||H.dispose(),Y.current=(ne=j.current)==null?void 0:ne.onDidChangeModelContent(N=>{ie.current||C(j.current.getValue(),N)}))},[O,C]),m.useEffect(()=>{if(O){let H=F.current.editor.onDidChangeMarkers(ne=>{var X;let N=(X=j.current.getModel())==null?void 0:X.uri;if(N&&ne.find(me=>me.path===N.path)){let me=F.current.editor.getModelMarkers({resource:N});P==null||P(me)}});return()=>{H==null||H.dispose()}}return()=>{}},[O,P]);function M(){var H,ne;(H=Y.current)==null||H.dispose(),g?f&&Bp.set(o,j.current.saveViewState()):(ne=j.current.getModel())==null||ne.dispose(),j.current.dispose()}return m.createElement(QM,{width:p,height:v,isEditorReady:O,loading:l,_ref:B,className:y,wrapperProps:x})}var oJ=iJ,eD=m.memo(oJ),Ay=eD;function sJ(e){const t=e.toUpperCase().indexOf("WHERE"),n=e.toUpperCase().indexOf("GROUP BY"),r=e.toUpperCase().indexOf("LIMIT"),i=e.toUpperCase().indexOf("ORDER BY");let o=e.length;if(i!==-1&&(o=i),r!==-1&&r<o&&(o=r),t!==-1){const s=e.substring(0,t),a=e.substring(t);return`${s} {{ filters | where }} AND ${a.substring(7)}`}else if(n!==-1){const s=e.substring(0,n),a=e.substring(n);return`${s} {{ filters | where }} ${a}`}else{const s=e.substring(0,o),a=e.substring(o);return`${s} {{ filters | where }} ${a}`}}let Iy;const tD="HoverCard",[nD,sfe]=Pn(tD,[Fi]),Ny=Fi(),[aJ,Ry]=nD(tD),lJ=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:i,onOpenChange:o,openDelay:s=700,closeDelay:a=300}=e,l=Ny(t),c=m.useRef(0),d=m.useRef(0),f=m.useRef(!1),g=m.useRef(!1),[p=!1,v]=Qn({prop:r,defaultProp:i,onChange:o}),y=m.useCallback(()=>{clearTimeout(d.current),c.current=window.setTimeout(()=>v(!0),s)},[s,v]),x=m.useCallback(()=>{clearTimeout(c.current),!f.current&&!g.current&&(d.current=window.setTimeout(()=>v(!1),a))},[a,v]),w=m.useCallback(()=>v(!1),[v]);return m.useEffect(()=>()=>{clearTimeout(c.current),clearTimeout(d.current)},[]),m.createElement(aJ,{scope:t,open:p,onOpenChange:v,onOpen:y,onClose:x,onDismiss:w,hasSelectionRef:f,isPointerDownOnContentRef:g},m.createElement(Eu,l,n))},cJ="HoverCardTrigger",uJ=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,i=Ry(cJ,n),o=Ny(n);return m.createElement(Ou,ae({asChild:!0},o),m.createElement(Be.a,ae({"data-state":i.open?"open":"closed"},r,{ref:t,onPointerEnter:Ce(e.onPointerEnter,Vp(i.onOpen)),onPointerLeave:Ce(e.onPointerLeave,Vp(i.onClose)),onFocus:Ce(e.onFocus,i.onOpen),onBlur:Ce(e.onBlur,i.onClose),onTouchStart:Ce(e.onTouchStart,s=>s.preventDefault())})))}),dJ="HoverCardPortal",[afe,fJ]=nD(dJ,{forceMount:void 0}),Ly="HoverCardContent",hJ=m.forwardRef((e,t)=>{const n=fJ(Ly,e.__scopeHoverCard),{forceMount:r=n.forceMount,...i}=e,o=Ry(Ly,e.__scopeHoverCard);return m.createElement(vn,{present:r||o.open},m.createElement(pJ,ae({"data-state":o.open?"open":"closed"},i,{onPointerEnter:Ce(e.onPointerEnter,Vp(o.onOpen)),onPointerLeave:Ce(e.onPointerLeave,Vp(o.onClose)),ref:t})))}),pJ=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,...a}=e,l=Ry(Ly,n),c=Ny(n),d=m.useRef(null),f=et(t,d),[g,p]=m.useState(!1);return m.useEffect(()=>{if(g){const v=document.body;return Iy=v.style.userSelect||v.style.webkitUserSelect,v.style.userSelect="none",v.style.webkitUserSelect="none",()=>{v.style.userSelect=Iy,v.style.webkitUserSelect=Iy}}},[g]),m.useEffect(()=>{if(d.current){const v=()=>{p(!1),l.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var y;((y=document.getSelection())===null||y===void 0?void 0:y.toString())!==""&&(l.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",v),()=>{document.removeEventListener("pointerup",v),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!1}}},[l.isPointerDownOnContentRef,l.hasSelectionRef]),m.useEffect(()=>{d.current&&gJ(d.current).forEach(y=>y.setAttribute("tabindex","-1"))}),m.createElement(_l,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:s,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:Ce(o,v=>{v.preventDefault()}),onDismiss:l.onDismiss},m.createElement(Pu,ae({},c,a,{onPointerDown:Ce(a.onPointerDown,v=>{v.currentTarget.contains(v.target)&&p(!0),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!0}),ref:f,style:{...a.style,userSelect:g?"text":void 0,WebkitUserSelect:g?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})))});function Vp(e){return t=>t.pointerType==="touch"?void 0:e()}function gJ(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}const mJ=lJ,vJ=uJ,rD=hJ,iD=mJ,oD=vJ,$y=ue.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},i)=>_.jsx(rD,{ref:i,align:t,sideOffset:n,className:Pe("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));$y.displayName=rD.displayName;function bJ({error:e}){return _.jsxs(iD,{openDelay:0,children:[_.jsx(oD,{asChild:!0,children:_.jsx(st,{variant:"link",className:" p-0 h-5",children:_.jsx(eV,{className:"h-4 w-4 text-red-500"})})}),_.jsx($y,{align:"start",className:"w-[600px]",children:_.jsx("div",{className:"flex justify-between space-x-4",children:_.jsx("div",{className:"space-y-1",children:_.jsx("p",{className:"text-sm",children:e})})})})]})}function yJ({text:e,onCheckedChange:t,checked:n}){return _.jsxs("div",{className:"flex items-center space-x-1 xbg-red-100 ml-7",children:[_.jsx(Op,{checked:n,onCheckedChange:t}),_.jsx("label",{className:"text-xs leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:e})]})}function xJ(){const e=ge(a=>a.authToken),t=m.useRef(null),n=_e(a=>a.applyFilters),[r,i]=m.useState(""),o=_e(a=>a.filterValues),s=_e(a=>a.card.sql);return _.jsxs(iD,{openDelay:0,onOpenChange:async a=>{if(!a)return;console.log("onOpenChange");const l=await Is("https://semaphor.cloud/api/v1/filter-sql",(e==null?void 0:e.accessToken)||"",{sql:s,active_filters:o});console.log(l),l.sql?(console.log(l.records),i(l.sql)):i("Error")},children:[_.jsx(oD,{asChild:!0,children:n&&_.jsx("p",{className:" p-0 hover:cursor-pointer text-xs",children:"| Filter Query"})}),_.jsxs($y,{align:"end",className:"w-[600px] ",children:[_.jsx("div",{className:" flex justify-between space-x-4",children:_.jsx("div",{className:"bg-muted p-2 rounded-sm",children:_.jsxs("code",{ref:t,className:"text-sm font-mono ",children:[r,_.jsx(QE,{onClick:()=>$3(t),className:" inline-block ml-3 h-4 w-4 opacity-70 hover:opacity-100 hover:cursor-pointer"})]})})}),_.jsxs("div",{className:"flex gap-2 items-center pt-2",children:[_.jsx(JE,{className:"h-4 w-4 opacity-70"}),_.jsx("span",{className:"text-xs text-muted-foreground",children:"A preview of the query with filters applied."})]})]})]})}const Fy=ue.forwardRef(({className:e,...t},n)=>_.jsx("textarea",{className:Pe("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));Fy.displayName="Textarea";function lfe(){}function cfe(){}function wJ(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const _J=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,SJ=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,CJ={};function sD(e,t){return((t||CJ).jsx?SJ:_J).test(e)}const EJ=/[ \t\n\f\r]/g;function OJ(e){return typeof e=="object"?e.type==="text"?aD(e.value):!1:aD(e)}function aD(e){return e.replace(EJ,"")===""}class sd{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}sd.prototype.property={},sd.prototype.normal={},sd.prototype.space=null;function lD(e,t){const n={},r={};let i=-1;for(;++i<e.length;)Object.assign(n,e[i].property),Object.assign(r,e[i].normal);return new sd(n,r,t)}function jy(e){return e.toLowerCase()}class ti{constructor(t,n){this.property=t,this.attribute=n}}ti.prototype.space=null,ti.prototype.boolean=!1,ti.prototype.booleanish=!1,ti.prototype.overloadedBoolean=!1,ti.prototype.number=!1,ti.prototype.commaSeparated=!1,ti.prototype.spaceSeparated=!1,ti.prototype.commaOrSpaceSeparated=!1,ti.prototype.mustUseProperty=!1,ti.prototype.defined=!1;let PJ=0;const lt=Ea(),yn=Ea(),cD=Ea(),Ee=Ea(),Ht=Ea(),Ul=Ea(),Fr=Ea();function Ea(){return 2**++PJ}const zy=Object.freeze(Object.defineProperty({__proto__:null,boolean:lt,booleanish:yn,commaOrSpaceSeparated:Fr,commaSeparated:Ul,number:Ee,overloadedBoolean:cD,spaceSeparated:Ht},Symbol.toStringTag,{value:"Module"})),By=Object.keys(zy);class Vy extends ti{constructor(t,n,r,i){let o=-1;if(super(t,n),uD(this,"space",i),typeof r=="number")for(;++o<By.length;){const s=By[o];uD(this,By[o],(r&zy[s])===zy[s])}}}Vy.prototype.defined=!0;function uD(e,t,n){n&&(e[t]=n)}const kJ={}.hasOwnProperty;function Gl(e){const t={},n={};let r;for(r in e.properties)if(kJ.call(e.properties,r)){const i=e.properties[r],o=new Vy(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[jy(r)]=r,n[jy(o.attribute)]=r}return new sd(t,n,e.space)}const dD=Gl({space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),fD=Gl({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function hD(e,t){return t in e?e[t]:t}function pD(e,t){return hD(e,t.toLowerCase())}const gD=Gl({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:pD,properties:{xmlns:null,xmlnsXLink:null}}),mD=Gl({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:yn,ariaAutoComplete:null,ariaBusy:yn,ariaChecked:yn,ariaColCount:Ee,ariaColIndex:Ee,ariaColSpan:Ee,ariaControls:Ht,ariaCurrent:null,ariaDescribedBy:Ht,ariaDetails:null,ariaDisabled:yn,ariaDropEffect:Ht,ariaErrorMessage:null,ariaExpanded:yn,ariaFlowTo:Ht,ariaGrabbed:yn,ariaHasPopup:null,ariaHidden:yn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ht,ariaLevel:Ee,ariaLive:null,ariaModal:yn,ariaMultiLine:yn,ariaMultiSelectable:yn,ariaOrientation:null,ariaOwns:Ht,ariaPlaceholder:null,ariaPosInSet:Ee,ariaPressed:yn,ariaReadOnly:yn,ariaRelevant:null,ariaRequired:yn,ariaRoleDescription:Ht,ariaRowCount:Ee,ariaRowIndex:Ee,ariaRowSpan:Ee,ariaSelected:yn,ariaSetSize:Ee,ariaSort:null,ariaValueMax:Ee,ariaValueMin:Ee,ariaValueNow:Ee,ariaValueText:null,role:null}}),MJ=Gl({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:pD,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ul,acceptCharset:Ht,accessKey:Ht,action:null,allow:null,allowFullScreen:lt,allowPaymentRequest:lt,allowUserMedia:lt,alt:null,as:null,async:lt,autoCapitalize:null,autoComplete:Ht,autoFocus:lt,autoPlay:lt,blocking:Ht,capture:null,charSet:null,checked:lt,cite:null,className:Ht,cols:Ee,colSpan:null,content:null,contentEditable:yn,controls:lt,controlsList:Ht,coords:Ee|Ul,crossOrigin:null,data:null,dateTime:null,decoding:null,default:lt,defer:lt,dir:null,dirName:null,disabled:lt,download:cD,draggable:yn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:lt,formTarget:null,headers:Ht,height:Ee,hidden:lt,high:Ee,href:null,hrefLang:null,htmlFor:Ht,httpEquiv:Ht,id:null,imageSizes:null,imageSrcSet:null,inert:lt,inputMode:null,integrity:null,is:null,isMap:lt,itemId:null,itemProp:Ht,itemRef:Ht,itemScope:lt,itemType:Ht,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:lt,low:Ee,manifest:null,max:null,maxLength:Ee,media:null,method:null,min:null,minLength:Ee,multiple:lt,muted:lt,name:null,nonce:null,noModule:lt,noValidate:lt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:lt,optimum:Ee,pattern:null,ping:Ht,placeholder:null,playsInline:lt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:lt,referrerPolicy:null,rel:Ht,required:lt,reversed:lt,rows:Ee,rowSpan:Ee,sandbox:Ht,scope:null,scoped:lt,seamless:lt,selected:lt,shadowRootDelegatesFocus:lt,shadowRootMode:null,shape:null,size:Ee,sizes:null,slot:null,span:Ee,spellCheck:yn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ee,step:null,style:null,tabIndex:Ee,target:null,title:null,translate:null,type:null,typeMustMatch:lt,useMap:null,value:yn,width:Ee,wrap:null,align:null,aLink:null,archive:Ht,axis:null,background:null,bgColor:null,border:Ee,borderColor:null,bottomMargin:Ee,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:lt,declare:lt,event:null,face:null,frame:null,frameBorder:null,hSpace:Ee,leftMargin:Ee,link:null,longDesc:null,lowSrc:null,marginHeight:Ee,marginWidth:Ee,noResize:lt,noHref:lt,noShade:lt,noWrap:lt,object:null,profile:null,prompt:null,rev:null,rightMargin:Ee,rules:null,scheme:null,scrolling:yn,standby:null,summary:null,text:null,topMargin:Ee,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ee,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:lt,disableRemotePlayback:lt,prefix:null,property:null,results:Ee,security:null,unselectable:null}}),DJ=Gl({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:hD,properties:{about:Fr,accentHeight:Ee,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ee,amplitude:Ee,arabicForm:null,ascent:Ee,attributeName:null,attributeType:null,azimuth:Ee,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ee,by:null,calcMode:null,capHeight:Ee,className:Ht,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Ee,diffuseConstant:Ee,direction:null,display:null,dur:null,divisor:Ee,dominantBaseline:null,download:lt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ee,enableBackground:null,end:null,event:null,exponent:Ee,externalResourcesRequired:null,fill:null,fillOpacity:Ee,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ul,g2:Ul,glyphName:Ul,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ee,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ee,horizOriginX:Ee,horizOriginY:Ee,id:null,ideographic:Ee,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ee,k:Ee,k1:Ee,k2:Ee,k3:Ee,k4:Ee,kernelMatrix:Fr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ee,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ee,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Ee,overlineThickness:Ee,paintOrder:null,panose1:null,path:null,pathLength:Ee,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ht,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ee,pointsAtY:Ee,pointsAtZ:Ee,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Fr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Fr,rev:Fr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Fr,requiredFeatures:Fr,requiredFonts:Fr,requiredFormats:Fr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Ee,specularExponent:Ee,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ee,strikethroughThickness:Ee,string:null,stroke:null,strokeDashArray:Fr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ee,strokeOpacity:Ee,strokeWidth:null,style:null,surfaceScale:Ee,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Fr,tabIndex:Ee,tableValues:null,target:null,targetX:Ee,targetY:Ee,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Fr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ee,underlineThickness:Ee,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ee,values:null,vAlphabetic:Ee,vMathematical:Ee,vectorEffect:null,vHanging:Ee,vIdeographic:Ee,version:null,vertAdvY:Ee,vertOriginX:Ee,vertOriginY:Ee,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ee,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),TJ=/^data[-\w.:]+$/i,vD=/-[a-z]/g,AJ=/[A-Z]/g;function IJ(e,t){const n=jy(t);let r=t,i=ti;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&TJ.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(vD,RJ);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!vD.test(o)){let s=o.replace(AJ,NJ);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=Vy}return new i(r,t)}function NJ(e){return"-"+e.toLowerCase()}function RJ(e){return e.charAt(1).toUpperCase()}const LJ={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},$J=lD([fD,dD,gD,mD,MJ],"html"),Hy=lD([fD,dD,gD,mD,DJ],"svg");function FJ(e){return e.join(" ").trim()}var bD={},yD=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,jJ=/\n/g,zJ=/^\s*/,BJ=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,VJ=/^:\s*/,HJ=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,WJ=/^[;\s]*/,qJ=/^\s+|\s+$/g,UJ=`
|
|
429
429
|
`,xD="/",wD="*",Oa="",GJ="comment",YJ="declaration",KJ=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(v){var y=v.match(jJ);y&&(n+=y.length);var x=v.lastIndexOf(UJ);r=~x?v.length-x:r+v.length}function o(){var v={line:n,column:r};return function(y){return y.position=new s(v),c(),y}}function s(v){this.start=v,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function a(v){var y=new Error(t.source+":"+n+":"+r+": "+v);if(y.reason=v,y.filename=t.source,y.line=n,y.column=r,y.source=e,!t.silent)throw y}function l(v){var y=v.exec(e);if(y){var x=y[0];return i(x),e=e.slice(x.length),y}}function c(){l(zJ)}function d(v){var y;for(v=v||[];y=f();)y!==!1&&v.push(y);return v}function f(){var v=o();if(!(xD!=e.charAt(0)||wD!=e.charAt(1))){for(var y=2;Oa!=e.charAt(y)&&(wD!=e.charAt(y)||xD!=e.charAt(y+1));)++y;if(y+=2,Oa===e.charAt(y-1))return a("End of comment missing");var x=e.slice(2,y-2);return r+=2,i(x),e=e.slice(y),r+=2,v({type:GJ,comment:x})}}function g(){var v=o(),y=l(BJ);if(y){if(f(),!l(VJ))return a("property missing ':'");var x=l(HJ),w=v({type:YJ,property:_D(y[0].replace(yD,Oa)),value:x?_D(x[0].replace(yD,Oa)):Oa});return l(WJ),w}}function p(){var v=[];d(v);for(var y;y=g();)y!==!1&&(v.push(y),d(v));return v}return c(),p()};function _D(e){return e?e.replace(qJ,Oa):Oa}var XJ=Ro&&Ro.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(bD,"__esModule",{value:!0});var QJ=XJ(KJ);function JJ(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,QJ.default)(e),i=typeof t=="function";return r.forEach(function(o){if(o.type==="declaration"){var s=o.property,a=o.value;i?t(s,a,o):a&&(n=n||{},n[s]=a)}}),n}var SD=bD.default=JJ;const ZJ=SD.default||SD,CD=ED("end"),Wy=ED("start");function ED(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function eZ(e){const t=Wy(e),n=CD(e);if(t&&n)return{start:t,end:n}}function ad(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?OD(e.position):"start"in e||"end"in e?OD(e):"line"in e||"column"in e?qy(e):""}function qy(e){return PD(e&&e.line)+":"+PD(e&&e.column)}function OD(e){return qy(e&&e.start)+"-"+qy(e&&e.end)}function PD(e){return e&&typeof e=="number"?e:1}class Gn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=a?a.line:void 0,this.name=ad(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}Gn.prototype.file="",Gn.prototype.name="",Gn.prototype.reason="",Gn.prototype.message="",Gn.prototype.stack="",Gn.prototype.column=void 0,Gn.prototype.line=void 0,Gn.prototype.ancestors=void 0,Gn.prototype.cause=void 0,Gn.prototype.fatal=void 0,Gn.prototype.place=void 0,Gn.prototype.ruleId=void 0,Gn.prototype.source=void 0;const Uy={}.hasOwnProperty,tZ=new Map,nZ=/[A-Z]/g,rZ=/-([a-z])/g,iZ=new Set(["table","tbody","thead","tfoot","tr"]),oZ=new Set(["td","th"]),kD="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function sZ(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=pZ(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=hZ(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Hy:$J,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=MD(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function MD(e,t,n){if(t.type==="element")return aZ(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return lZ(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return uZ(e,t,n);if(t.type==="mdxjsEsm")return cZ(e,t);if(t.type==="root")return dZ(e,t,n);if(t.type==="text")return fZ(e,t)}function aZ(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Hy,e.schema=i),e.ancestors.push(t);const o=TD(e,t.tagName,!1),s=gZ(e,t);let a=Yy(e,t);return iZ.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!OJ(l):!0})),DD(e,s,o,t),Gy(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function lZ(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}ld(e,t.position)}function cZ(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ld(e,t.position)}function uZ(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Hy,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:TD(e,t.name,!0),s=mZ(e,t),a=Yy(e,t);return DD(e,s,o,t),Gy(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function dZ(e,t,n){const r={};return Gy(r,Yy(e,t)),e.create(t,e.Fragment,r,n)}function fZ(e,t){return t.value}function DD(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Gy(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function hZ(e,t,n){return r;function r(i,o,s,a){const c=Array.isArray(s.children)?n:t;return a?c(o,s,a):c(o,s)}}function pZ(e,t){return n;function n(r,i,o,s){const a=Array.isArray(o.children),l=Wy(r);return t(i,o,s,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function gZ(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Uy.call(t.properties,i)){const o=vZ(e,i,t.properties[i]);if(o){const[s,a]=o;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&oZ.has(t.tagName)?r=a:n[s]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function mZ(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else ld(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else ld(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Yy(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:tZ;for(;++r<t.children.length;){const o=t.children[r];let s;if(e.passKeys){const l=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(l){const c=i.get(l)||0;s=l+"-"+c,i.set(l,c+1)}}const a=MD(e,o,s);a!==void 0&&n.push(a)}return n}function vZ(e,t,n){const r=IJ(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?wJ(n):FJ(n)),r.property==="style"){let i=typeof n=="object"?n:bZ(e,String(n));return e.stylePropertyNameCase==="css"&&(i=yZ(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?LJ[r.property]||r.property:r.attribute,n]}}function bZ(e,t){const n={};try{ZJ(t,r)}catch(i){if(!e.ignoreInvalidStyle){const o=i,s=new Gn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:o,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=kD+"#cannot-parse-style-attribute",s}}return n;function r(i,o){let s=i;s.slice(0,2)!=="--"&&(s.slice(0,4)==="-ms-"&&(s="ms-"+s.slice(4)),s=s.replace(rZ,wZ)),n[s]=o}}function TD(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,s;for(;++o<i.length;){const a=sD(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=s}else r=sD(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Uy.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);ld(e)}function ld(e,t){const n=new Gn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=kD+"#cannot-handle-mdx-estrees-without-createevaluater",n}function yZ(e){const t={};let n;for(n in e)Uy.call(e,n)&&(t[xZ(n)]=e[n]);return t}function xZ(e){let t=e.replace(nZ,_Z);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function wZ(e,t){return t.toUpperCase()}function _Z(e){return"-"+e.toLowerCase()}const Ky={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},SZ={};function CZ(e,t){const n=t||SZ,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return AD(e,r,i)}function AD(e,t,n){if(EZ(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return ID(e.children,t,n)}return Array.isArray(e)?ID(e,t,n):""}function ID(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=AD(e[i],t,n);return r.join("")}function EZ(e){return!!(e&&typeof e=="object")}const ND=document.createElement("i");function Xy(e){const t="&"+e+";";ND.innerHTML=t;const n=ND.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function qi(e,t,n,r){const i=e.length;let o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function ni(e,t){return e.length>0?(qi(e,e.length,0,t),e):t}const RD={}.hasOwnProperty;function OZ(e){const t={};let n=-1;for(;++n<e.length;)PZ(t,e[n]);return t}function PZ(e,t){let n;for(n in t){const i=(RD.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){RD.call(i,s)||(i[s]=[]);const a=o[s];kZ(i[s],Array.isArray(a)?a:a?[a]:[])}}}function kZ(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);qi(e,0,0,r)}function LD(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Yl(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const MZ=ls(new RegExp("\\p{P}","u")),Ui=ls(/[A-Za-z]/),jr=ls(/[\dA-Za-z]/),DZ=ls(/[#-'*+\--9=?A-Z^-~]/);function Qy(e){return e!==null&&(e<32||e===127)}const Jy=ls(/\d/),TZ=ls(/[\dA-Fa-f]/),$D=ls(/[!-/:-@[-`{-~]/);function Ge(e){return e!==null&&e<-2}function hr(e){return e!==null&&(e<0||e===32)}function Dt(e){return e===-2||e===-1||e===32}function AZ(e){return $D(e)||MZ(e)}const IZ=ls(/\s/);function ls(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Kl(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(o===37&&jr(e.charCodeAt(n+1))&&jr(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Wt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(l){return Dt(l)?(e.enter(n),a(l)):t(l)}function a(l){return Dt(l)&&o++<i?(e.consume(l),a):(e.exit(n),t(l))}}const NZ={tokenize:RZ};function RZ(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Wt(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return Ge(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),s)}}const LZ={tokenize:$Z},FD={tokenize:FZ};function $Z(e){const t=this,n=[];let r=0,i,o,s;return a;function a(C){if(r<n.length){const P=n[r];return t.containerState=P[1],e.attempt(P[0].continuation,l,c)(C)}return c(C)}function l(C){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&S();const P=t.events.length;let O=P,k;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){k=t.events[O][1].end;break}w(r);let A=P;for(;A<t.events.length;)t.events[A][1].end=Object.assign({},k),A++;return qi(t.events,O+1,0,t.events.slice(P)),t.events.length=A,c(C)}return a(C)}function c(C){if(r===n.length){if(!i)return g(C);if(i.currentConstruct&&i.currentConstruct.concrete)return v(C);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(FD,d,f)(C)}function d(C){return i&&S(),w(r),g(C)}function f(C){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,v(C)}function g(C){return t.containerState={},e.attempt(FD,p,v)(C)}function p(C){return r++,n.push([t.currentConstruct,t.containerState]),g(C)}function v(C){if(C===null){i&&S(),w(0),e.consume(C);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:o,_tokenizer:i}),y(C)}function y(C){if(C===null){x(e.exit("chunkFlow"),!0),w(0),e.consume(C);return}return Ge(C)?(e.consume(C),x(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(C),y)}function x(C,P){const O=t.sliceStream(C);if(P&&O.push(null),C.previous=o,o&&(o.next=C),o=C,i.defineSkip(C.start),i.write(O),t.parser.lazy[C.start.line]){let k=i.events.length;for(;k--;)if(i.events[k][1].start.offset<s&&(!i.events[k][1].end||i.events[k][1].end.offset>s))return;const A=t.events.length;let L=A,F,j;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){if(F){j=t.events[L][1].end;break}F=!0}for(w(r),k=A;k<t.events.length;)t.events[k][1].end=Object.assign({},j),k++;qi(t.events,L+1,0,t.events.slice(A)),t.events.length=k}}function w(C){let P=n.length;for(;P-- >C;){const O=n[P];t.containerState=O[1],O[0].exit.call(t,e)}n.length=C}function S(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function FZ(e,t,n){return Wt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function jD(e){if(e===null||hr(e)||IZ(e))return 1;if(AZ(e))return 2}function Zy(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const ex={name:"attention",tokenize:zZ,resolveAll:jZ};function jZ(e,t){let n=-1,r,i,o,s,a,l,c,d;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f=Object.assign({},e[r][1].end),g=Object.assign({},e[n][1].start);zD(f,-l),zD(g,l),s={type:l>1?"strongSequence":"emphasisSequence",start:f,end:Object.assign({},e[r][1].end)},a={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:g},o={type:l>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},i={type:l>1?"strong":"emphasis",start:Object.assign({},s.start),end:Object.assign({},a.end)},e[r][1].end=Object.assign({},s.start),e[n][1].start=Object.assign({},a.end),c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=ni(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=ni(c,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),c=ni(c,Zy(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=ni(c,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,c=ni(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,qi(e,r-1,n-r+3,c),n=r+c.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function zZ(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=jD(r);let o;return s;function s(l){return o=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===o)return e.consume(l),a;const c=e.exit("attentionSequence"),d=jD(l),f=!d||d===2&&i||n.includes(l),g=!i||i===2&&d||n.includes(r);return c._open=!!(o===42?f:f&&(i||!g)),c._close=!!(o===42?g:g&&(d||!f)),t(l)}}function zD(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const BZ={name:"autolink",tokenize:VZ};function VZ(e,t,n){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(p){return Ui(p)?(e.consume(p),s):c(p)}function s(p){return p===43||p===45||p===46||jr(p)?(r=1,a(p)):c(p)}function a(p){return p===58?(e.consume(p),r=0,l):(p===43||p===45||p===46||jr(p))&&r++<32?(e.consume(p),a):(r=0,c(p))}function l(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||Qy(p)?n(p):(e.consume(p),l)}function c(p){return p===64?(e.consume(p),d):DZ(p)?(e.consume(p),c):n(p)}function d(p){return jr(p)?f(p):n(p)}function f(p){return p===46?(e.consume(p),r=0,d):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):g(p)}function g(p){if((p===45||jr(p))&&r++<63){const v=p===45?g:f;return e.consume(p),v}return n(p)}}const Hp={tokenize:HZ,partial:!0};function HZ(e,t,n){return r;function r(o){return Dt(o)?Wt(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||Ge(o)?t(o):n(o)}}const BD={name:"blockQuote",tokenize:WZ,continuation:{tokenize:qZ},exit:UZ};function WZ(e,t,n){const r=this;return i;function i(s){if(s===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return Dt(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function qZ(e,t,n){const r=this;return i;function i(s){return Dt(s)?Wt(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(BD,t,n)(s)}}function UZ(e){e.exit("blockQuote")}const VD={name:"characterEscape",tokenize:GZ};function GZ(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return $D(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const HD={name:"characterReference",tokenize:YZ};function YZ(e,t,n){const r=this;let i=0,o,s;return a;function a(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),l}function l(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),o=31,s=jr,d(f))}function c(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=TZ,d):(e.enter("characterReferenceValue"),o=7,s=Jy,d(f))}function d(f){if(f===59&&i){const g=e.exit("characterReferenceValue");return s===jr&&!Xy(r.sliceSerialize(g))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(f)&&i++<o?(e.consume(f),d):n(f)}}const WD={tokenize:XZ,partial:!0},qD={name:"codeFenced",tokenize:KZ,concrete:!0};function KZ(e,t,n){const r=this,i={tokenize:O,partial:!0};let o=0,s=0,a;return l;function l(k){return c(k)}function c(k){const A=r.events[r.events.length-1];return o=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[1],!0).length:0,a=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(k)}function d(k){return k===a?(s++,e.consume(k),d):s<3?n(k):(e.exit("codeFencedFenceSequence"),Dt(k)?Wt(e,f,"whitespace")(k):f(k))}function f(k){return k===null||Ge(k)?(e.exit("codeFencedFence"),r.interrupt?t(k):e.check(WD,y,P)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),g(k))}function g(k){return k===null||Ge(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(k)):Dt(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Wt(e,p,"whitespace")(k)):k===96&&k===a?n(k):(e.consume(k),g)}function p(k){return k===null||Ge(k)?f(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),v(k))}function v(k){return k===null||Ge(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(k)):k===96&&k===a?n(k):(e.consume(k),v)}function y(k){return e.attempt(i,P,x)(k)}function x(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),w}function w(k){return o>0&&Dt(k)?Wt(e,S,"linePrefix",o+1)(k):S(k)}function S(k){return k===null||Ge(k)?e.check(WD,y,P)(k):(e.enter("codeFlowValue"),C(k))}function C(k){return k===null||Ge(k)?(e.exit("codeFlowValue"),S(k)):(e.consume(k),C)}function P(k){return e.exit("codeFenced"),t(k)}function O(k,A,L){let F=0;return j;function j($){return k.enter("lineEnding"),k.consume($),k.exit("lineEnding"),B}function B($){return k.enter("codeFencedFence"),Dt($)?Wt(k,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):V($)}function V($){return $===a?(k.enter("codeFencedFenceSequence"),K($)):L($)}function K($){return $===a?(F++,k.consume($),K):F>=s?(k.exit("codeFencedFenceSequence"),Dt($)?Wt(k,Y,"whitespace")($):Y($)):L($)}function Y($){return $===null||Ge($)?(k.exit("codeFencedFence"),A($)):L($)}}}function XZ(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const tx={name:"codeIndented",tokenize:JZ},QZ={tokenize:ZZ,partial:!0};function JZ(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),Wt(e,o,"linePrefix",5)(c)}function o(c){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?l(c):Ge(c)?e.attempt(QZ,s,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||Ge(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function ZZ(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):Ge(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):Wt(e,o,"linePrefix",5)(s)}function o(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):Ge(s)?i(s):n(s)}}const eee={name:"codeText",tokenize:ree,resolve:tee,previous:nee};function tee(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function nee(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function ree(e,t,n){let r=0,i,o;return s;function s(f){return e.enter("codeText"),e.enter("codeTextSequence"),a(f)}function a(f){return f===96?(e.consume(f),r++,a):(e.exit("codeTextSequence"),l(f))}function l(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),l):f===96?(o=e.enter("codeTextSequence"),i=0,d(f)):Ge(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(f))}function c(f){return f===null||f===32||f===96||Ge(f)?(e.exit("codeTextData"),l(f)):(e.consume(f),c)}function d(f){return f===96?(e.consume(f),i++,d):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(o.type="codeTextData",c(f))}}function UD(e){const t={};let n=-1,r,i,o,s,a,l,c;for(;++n<e.length;){for(;n in t;)n=t[n];if(r=e[n],n&&r[1].type==="chunkFlow"&&e[n-1][1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,iee(e,n)),n=t[n],c=!0);else if(r[1]._container){for(o=n,i=void 0;o--&&(s=e[o],s[1].type==="lineEnding"||s[1].type==="lineEndingBlank");)s[0]==="enter"&&(i&&(e[i][1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);i&&(r[1].end=Object.assign({},e[i][1].start),a=e.slice(i,n),a.unshift(r),qi(e,i,n-i+1,a))}}return!c}function iee(e,t){const n=e[t][1],r=e[t][2];let i=t-1;const o=[],s=n._tokenizer||r.parser[n.contentType](n.start),a=s.events,l=[],c={};let d,f,g=-1,p=n,v=0,y=0;const x=[y];for(;p;){for(;e[++i][1]!==p;);o.push(i),p._tokenizer||(d=r.sliceStream(p),p.next||d.push(null),f&&s.defineSkip(p.start),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(d),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=p,p=p.next}for(p=n;++g<a.length;)a[g][0]==="exit"&&a[g-1][0]==="enter"&&a[g][1].type===a[g-1][1].type&&a[g][1].start.line!==a[g][1].end.line&&(y=g+1,x.push(y),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(s.events=[],p?(p._tokenizer=void 0,p.previous=void 0):x.pop(),g=x.length;g--;){const w=a.slice(x[g],x[g+1]),S=o.pop();l.unshift([S,S+w.length-1]),qi(e,S,2,w)}for(g=-1;++g<l.length;)c[v+l[g][0]]=v+l[g][1],v+=l[g][1]-l[g][0]-1;return c}const oee={tokenize:lee,resolve:aee},see={tokenize:cee,partial:!0};function aee(e){return UD(e),e}function lee(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):Ge(a)?e.check(see,s,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function cee(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Wt(e,o,"linePrefix")}function o(s){if(s===null||Ge(s))return n(s);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function GD(e,t,n,r,i,o,s,a,l){const c=l||Number.POSITIVE_INFINITY;let d=0;return f;function f(w){return w===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(w),e.exit(o),g):w===null||w===32||w===41||Qy(w)?n(w):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),y(w))}function g(w){return w===62?(e.enter(o),e.consume(w),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(w))}function p(w){return w===62?(e.exit("chunkString"),e.exit(a),g(w)):w===null||w===60||Ge(w)?n(w):(e.consume(w),w===92?v:p)}function v(w){return w===60||w===62||w===92?(e.consume(w),p):p(w)}function y(w){return!d&&(w===null||w===41||hr(w))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(w)):d<c&&w===40?(e.consume(w),d++,y):w===41?(e.consume(w),d--,y):w===null||w===32||w===40||Qy(w)?n(w):(e.consume(w),w===92?x:y)}function x(w){return w===40||w===41||w===92?(e.consume(w),y):y(w)}}function YD(e,t,n,r,i,o){const s=this;let a=0,l;return c;function c(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(o),d}function d(p){return a>999||p===null||p===91||p===93&&!l||p===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(p):p===93?(e.exit(o),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):Ge(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||Ge(p)||a++>999?(e.exit("chunkString"),d(p)):(e.consume(p),l||(l=!Dt(p)),p===92?g:f)}function g(p){return p===91||p===92||p===93?(e.consume(p),a++,f):f(p)}}function KD(e,t,n,r,i,o){let s;return a;function a(g){return g===34||g===39||g===40?(e.enter(r),e.enter(i),e.consume(g),e.exit(i),s=g===40?41:g,l):n(g)}function l(g){return g===s?(e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):(e.enter(o),c(g))}function c(g){return g===s?(e.exit(o),l(s)):g===null?n(g):Ge(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),Wt(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(g))}function d(g){return g===s||g===null||Ge(g)?(e.exit("chunkString"),c(g)):(e.consume(g),g===92?f:d)}function f(g){return g===s||g===92?(e.consume(g),d):d(g)}}function cd(e,t){let n;return r;function r(i){return Ge(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Dt(i)?Wt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const uee={name:"definition",tokenize:fee},dee={tokenize:hee,partial:!0};function fee(e,t,n){const r=this;let i;return o;function o(p){return e.enter("definition"),s(p)}function s(p){return YD.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return i=Yl(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return hr(p)?cd(e,c)(p):c(p)}function c(p){return GD(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(dee,f,f)(p)}function f(p){return Dt(p)?Wt(e,g,"whitespace")(p):g(p)}function g(p){return p===null||Ge(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function hee(e,t,n){return r;function r(a){return hr(a)?cd(e,i)(a):n(a)}function i(a){return KD(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return Dt(a)?Wt(e,s,"whitespace")(a):s(a)}function s(a){return a===null||Ge(a)?t(a):n(a)}}const pee={name:"hardBreakEscape",tokenize:gee};function gee(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return Ge(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const mee={name:"headingAtx",tokenize:bee,resolve:vee};function vee(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},qi(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function bee(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),o(d)}function o(d){return e.enter("atxHeadingSequence"),s(d)}function s(d){return d===35&&r++<6?(e.consume(d),s):d===null||hr(d)?(e.exit("atxHeadingSequence"),a(d)):n(d)}function a(d){return d===35?(e.enter("atxHeadingSequence"),l(d)):d===null||Ge(d)?(e.exit("atxHeading"),t(d)):Dt(d)?Wt(e,a,"whitespace")(d):(e.enter("atxHeadingText"),c(d))}function l(d){return d===35?(e.consume(d),l):(e.exit("atxHeadingSequence"),a(d))}function c(d){return d===null||d===35||hr(d)?(e.exit("atxHeadingText"),a(d)):(e.consume(d),c)}}const yee=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],XD=["pre","script","style","textarea"],xee={name:"htmlFlow",tokenize:Cee,resolveTo:See,concrete:!0},wee={tokenize:Oee,partial:!0},_ee={tokenize:Eee,partial:!0};function See(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Cee(e,t,n){const r=this;let i,o,s,a,l;return c;function c(N){return d(N)}function d(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),f}function f(N){return N===33?(e.consume(N),g):N===47?(e.consume(N),o=!0,y):N===63?(e.consume(N),i=3,r.interrupt?t:M):Ui(N)?(e.consume(N),s=String.fromCharCode(N),x):n(N)}function g(N){return N===45?(e.consume(N),i=2,p):N===91?(e.consume(N),i=5,a=0,v):Ui(N)?(e.consume(N),i=4,r.interrupt?t:M):n(N)}function p(N){return N===45?(e.consume(N),r.interrupt?t:M):n(N)}function v(N){const X="CDATA[";return N===X.charCodeAt(a++)?(e.consume(N),a===X.length?r.interrupt?t:V:v):n(N)}function y(N){return Ui(N)?(e.consume(N),s=String.fromCharCode(N),x):n(N)}function x(N){if(N===null||N===47||N===62||hr(N)){const X=N===47,me=s.toLowerCase();return!X&&!o&&XD.includes(me)?(i=1,r.interrupt?t(N):V(N)):yee.includes(s.toLowerCase())?(i=6,X?(e.consume(N),w):r.interrupt?t(N):V(N)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(N):o?S(N):C(N))}return N===45||jr(N)?(e.consume(N),s+=String.fromCharCode(N),x):n(N)}function w(N){return N===62?(e.consume(N),r.interrupt?t:V):n(N)}function S(N){return Dt(N)?(e.consume(N),S):j(N)}function C(N){return N===47?(e.consume(N),j):N===58||N===95||Ui(N)?(e.consume(N),P):Dt(N)?(e.consume(N),C):j(N)}function P(N){return N===45||N===46||N===58||N===95||jr(N)?(e.consume(N),P):O(N)}function O(N){return N===61?(e.consume(N),k):Dt(N)?(e.consume(N),O):C(N)}function k(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),l=N,A):Dt(N)?(e.consume(N),k):L(N)}function A(N){return N===l?(e.consume(N),l=null,F):N===null||Ge(N)?n(N):(e.consume(N),A)}function L(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||hr(N)?O(N):(e.consume(N),L)}function F(N){return N===47||N===62||Dt(N)?C(N):n(N)}function j(N){return N===62?(e.consume(N),B):n(N)}function B(N){return N===null||Ge(N)?V(N):Dt(N)?(e.consume(N),B):n(N)}function V(N){return N===45&&i===2?(e.consume(N),Z):N===60&&i===1?(e.consume(N),U):N===62&&i===4?(e.consume(N),H):N===63&&i===3?(e.consume(N),M):N===93&&i===5?(e.consume(N),le):Ge(N)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(wee,ne,K)(N)):N===null||Ge(N)?(e.exit("htmlFlowData"),K(N)):(e.consume(N),V)}function K(N){return e.check(_ee,Y,ne)(N)}function Y(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),$}function $(N){return N===null||Ge(N)?K(N):(e.enter("htmlFlowData"),V(N))}function Z(N){return N===45?(e.consume(N),M):V(N)}function U(N){return N===47?(e.consume(N),s="",ie):V(N)}function ie(N){if(N===62){const X=s.toLowerCase();return XD.includes(X)?(e.consume(N),H):V(N)}return Ui(N)&&s.length<8?(e.consume(N),s+=String.fromCharCode(N),ie):V(N)}function le(N){return N===93?(e.consume(N),M):V(N)}function M(N){return N===62?(e.consume(N),H):N===45&&i===2?(e.consume(N),M):V(N)}function H(N){return N===null||Ge(N)?(e.exit("htmlFlowData"),ne(N)):(e.consume(N),H)}function ne(N){return e.exit("htmlFlow"),t(N)}}function Eee(e,t,n){const r=this;return i;function i(s){return Ge(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function Oee(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Hp,t,n)}}const Pee={name:"htmlText",tokenize:kee};function kee(e,t,n){const r=this;let i,o,s;return a;function a(M){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(M),l}function l(M){return M===33?(e.consume(M),c):M===47?(e.consume(M),O):M===63?(e.consume(M),C):Ui(M)?(e.consume(M),L):n(M)}function c(M){return M===45?(e.consume(M),d):M===91?(e.consume(M),o=0,v):Ui(M)?(e.consume(M),S):n(M)}function d(M){return M===45?(e.consume(M),p):n(M)}function f(M){return M===null?n(M):M===45?(e.consume(M),g):Ge(M)?(s=f,U(M)):(e.consume(M),f)}function g(M){return M===45?(e.consume(M),p):f(M)}function p(M){return M===62?Z(M):M===45?g(M):f(M)}function v(M){const H="CDATA[";return M===H.charCodeAt(o++)?(e.consume(M),o===H.length?y:v):n(M)}function y(M){return M===null?n(M):M===93?(e.consume(M),x):Ge(M)?(s=y,U(M)):(e.consume(M),y)}function x(M){return M===93?(e.consume(M),w):y(M)}function w(M){return M===62?Z(M):M===93?(e.consume(M),w):y(M)}function S(M){return M===null||M===62?Z(M):Ge(M)?(s=S,U(M)):(e.consume(M),S)}function C(M){return M===null?n(M):M===63?(e.consume(M),P):Ge(M)?(s=C,U(M)):(e.consume(M),C)}function P(M){return M===62?Z(M):C(M)}function O(M){return Ui(M)?(e.consume(M),k):n(M)}function k(M){return M===45||jr(M)?(e.consume(M),k):A(M)}function A(M){return Ge(M)?(s=A,U(M)):Dt(M)?(e.consume(M),A):Z(M)}function L(M){return M===45||jr(M)?(e.consume(M),L):M===47||M===62||hr(M)?F(M):n(M)}function F(M){return M===47?(e.consume(M),Z):M===58||M===95||Ui(M)?(e.consume(M),j):Ge(M)?(s=F,U(M)):Dt(M)?(e.consume(M),F):Z(M)}function j(M){return M===45||M===46||M===58||M===95||jr(M)?(e.consume(M),j):B(M)}function B(M){return M===61?(e.consume(M),V):Ge(M)?(s=B,U(M)):Dt(M)?(e.consume(M),B):F(M)}function V(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),i=M,K):Ge(M)?(s=V,U(M)):Dt(M)?(e.consume(M),V):(e.consume(M),Y)}function K(M){return M===i?(e.consume(M),i=void 0,$):M===null?n(M):Ge(M)?(s=K,U(M)):(e.consume(M),K)}function Y(M){return M===null||M===34||M===39||M===60||M===61||M===96?n(M):M===47||M===62||hr(M)?F(M):(e.consume(M),Y)}function $(M){return M===47||M===62||hr(M)?F(M):n(M)}function Z(M){return M===62?(e.consume(M),e.exit("htmlTextData"),e.exit("htmlText"),t):n(M)}function U(M){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),ie}function ie(M){return Dt(M)?Wt(e,le,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):le(M)}function le(M){return e.enter("htmlTextData"),s(M)}}const nx={name:"labelEnd",tokenize:Nee,resolveTo:Iee,resolveAll:Aee},Mee={tokenize:Ree},Dee={tokenize:Lee},Tee={tokenize:$ee};function Aee(e){let t=-1;for(;++t<e.length;){const n=e[t][1];(n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd")&&(e.splice(t+1,n.type==="labelImage"?4:2),n.type="data",t++)}return e}function Iee(e,t){let n=e.length,r=0,i,o,s,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const l={type:e[o][1].type==="labelLink"?"link":"image",start:Object.assign({},e[o][1].start),end:Object.assign({},e[e.length-1][1].end)},c={type:"label",start:Object.assign({},e[o][1].start),end:Object.assign({},e[s][1].end)},d={type:"labelText",start:Object.assign({},e[o+r+2][1].end),end:Object.assign({},e[s-2][1].start)};return a=[["enter",l,t],["enter",c,t]],a=ni(a,e.slice(o+1,o+r+3)),a=ni(a,[["enter",d,t]]),a=ni(a,Zy(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),a=ni(a,[["exit",d,t],e[s-2],e[s-1],["exit",c,t]]),a=ni(a,e.slice(s+1)),a=ni(a,[["exit",l,t]]),qi(e,o,e.length,a),e}function Nee(e,t,n){const r=this;let i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(g){return o?o._inactive?f(g):(s=r.parser.defined.includes(Yl(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(g),e.exit("labelMarker"),e.exit("labelEnd"),l):n(g)}function l(g){return g===40?e.attempt(Mee,d,s?d:f)(g):g===91?e.attempt(Dee,d,s?c:f)(g):s?d(g):f(g)}function c(g){return e.attempt(Tee,d,f)(g)}function d(g){return t(g)}function f(g){return o._balanced=!0,n(g)}}function Ree(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),i}function i(f){return hr(f)?cd(e,o)(f):o(f)}function o(f){return f===41?d(f):GD(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return hr(f)?cd(e,l)(f):d(f)}function a(f){return n(f)}function l(f){return f===34||f===39||f===40?KD(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):d(f)}function c(f){return hr(f)?cd(e,d)(f):d(f)}function d(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function Lee(e,t,n){const r=this;return i;function i(a){return YD.call(r,e,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(Yl(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function $ee(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const Fee={name:"labelStartImage",tokenize:jee,resolveAll:nx.resolveAll};function jee(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const zee={name:"labelStartLink",tokenize:Bee,resolveAll:nx.resolveAll};function Bee(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const rx={name:"lineEnding",tokenize:Vee};function Vee(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Wt(e,t,"linePrefix")}}const Wp={name:"thematicBreak",tokenize:Hee};function Hee(e,t,n){let r=0,i;return o;function o(c){return e.enter("thematicBreak"),s(c)}function s(c){return i=c,a(c)}function a(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||Ge(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),Dt(c)?Wt(e,a,"whitespace")(c):a(c))}}const pr={name:"list",tokenize:Uee,continuation:{tokenize:Gee},exit:Kee},Wee={tokenize:Xee,partial:!0},qee={tokenize:Yee,partial:!0};function Uee(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(p){const v=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(v==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Jy(p)){if(r.containerState.type||(r.containerState.type=v,e.enter(v,{_container:!0})),v==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Wp,n,c)(p):c(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return Jy(p)&&++s<10?(e.consume(p),l):(!r.interrupt||s<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):n(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(Hp,r.interrupt?n:d,e.attempt(Wee,g,f))}function d(p){return r.containerState.initialBlankLine=!0,o++,g(p)}function f(p){return Dt(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),g):n(p)}function g(p){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function Gee(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Hp,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Wt(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!Dt(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(qee,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Wt(e,e.attempt(pr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Yee(e,t,n){const r=this;return Wt(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function Kee(e){e.exit(this.containerState.type)}function Xee(e,t,n){const r=this;return Wt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!Dt(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const QD={name:"setextUnderline",tokenize:Jee,resolveTo:Qee};function Qee(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[o][1].end)):e[r][1]=s,e.push(["exit",s,t]),e}function Jee(e,t,n){const r=this;let i;return o;function o(c){let d=r.events.length,f;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){f=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=c,s(c)):n(c)}function s(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),Dt(c)?Wt(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||Ge(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const Zee={tokenize:ete};function ete(e){const t=this,n=e.attempt(Hp,r,e.attempt(this.parser.constructs.flowInitial,i,Wt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(oee,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const tte={resolveAll:ZD()},nte=JD("string"),rte=JD("text");function JD(e){return{tokenize:t,resolveAll:ZD(e==="text"?ite:void 0)};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,a);return s;function s(d){return c(d)?o(d):a(d)}function a(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),l}function l(d){return c(d)?(n.exit("data"),o(d)):(n.consume(d),l)}function c(d){if(d===null)return!0;const f=i[d];let g=-1;if(f)for(;++g<f.length;){const p=f[g];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function ZD(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function ite(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,s=-1,a=0,l;for(;o--;){const c=i[o];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(c===-2)l=!0,a++;else if(c!==-1){o++;break}}if(a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{line:r.end.line,column:r.end.column-a,offset:r.end.offset-a,_index:r.start._index+o,_bufferIndex:o?s:r.start._bufferIndex+s},end:Object.assign({},r.end)};r.end=Object.assign({},c.start),r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}function ote(e,t,n){let r=Object.assign(n?Object.assign({},n):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const i={},o=[];let s=[],a=[];const l={consume:S,enter:C,exit:P,attempt:A(O),check:A(k),interrupt:A(k,{interrupt:!0})},c={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:p,sliceSerialize:g,now:v,defineSkip:y,write:f};let d=t.tokenize.call(c,l);return t.resolveAll&&o.push(t),c;function f(B){return s=ni(s,B),x(),s[s.length-1]!==null?[]:(L(t,0),c.events=Zy(o,c.events,c),c.events)}function g(B,V){return ate(p(B),V)}function p(B){return ste(s,B)}function v(){const{line:B,column:V,offset:K,_index:Y,_bufferIndex:$}=r;return{line:B,column:V,offset:K,_index:Y,_bufferIndex:$}}function y(B){i[B.line]=B.column,j()}function x(){let B;for(;r._index<s.length;){const V=s[r._index];if(typeof V=="string")for(B=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===B&&r._bufferIndex<V.length;)w(V.charCodeAt(r._bufferIndex));else w(V)}}function w(B){d=d(B)}function S(B){Ge(B)?(r.line++,r.column=1,r.offset+=B===-3?2:1,j()):B!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=B}function C(B,V){const K=V||{};return K.type=B,K.start=v(),c.events.push(["enter",K,c]),a.push(K),K}function P(B){const V=a.pop();return V.end=v(),c.events.push(["exit",V,c]),V}function O(B,V){L(B,V.from)}function k(B,V){V.restore()}function A(B,V){return K;function K(Y,$,Z){let U,ie,le,M;return Array.isArray(Y)?ne(Y):"tokenize"in Y?ne([Y]):H(Y);function H(he){return de;function de(re){const ee=re!==null&&he[re],W=re!==null&&he.null,ye=[...Array.isArray(ee)?ee:ee?[ee]:[],...Array.isArray(W)?W:W?[W]:[]];return ne(ye)(re)}}function ne(he){return U=he,ie=0,he.length===0?Z:N(he[ie])}function N(he){return de;function de(re){return M=F(),le=he,he.partial||(c.currentConstruct=he),he.name&&c.parser.constructs.disable.null.includes(he.name)?me():he.tokenize.call(V?Object.assign(Object.create(c),V):c,l,X,me)(re)}}function X(he){return B(le,M),$}function me(he){return M.restore(),++ie<U.length?N(U[ie]):Z}}}function L(B,V){B.resolveAll&&!o.includes(B)&&o.push(B),B.resolve&&qi(c.events,V,c.events.length-V,B.resolve(c.events.slice(V),c)),B.resolveTo&&(c.events=B.resolveTo(c.events,c))}function F(){const B=v(),V=c.previous,K=c.currentConstruct,Y=c.events.length,$=Array.from(a);return{restore:Z,from:Y};function Z(){r=B,c.previous=V,c.currentConstruct=K,c.events.length=Y,a=$,j()}}function j(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function ste(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function ate(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
|
|
430
430
|
`;break}case-3:{s=`\r
|
|
431
431
|
`;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}const lte=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:uee},disable:{null:[]},document:{42:pr,43:pr,45:pr,48:pr,49:pr,50:pr,51:pr,52:pr,53:pr,54:pr,55:pr,56:pr,57:pr,62:BD},flow:{35:mee,42:Wp,45:[QD,Wp],60:xee,61:QD,95:Wp,96:qD,126:qD},flowInitial:{[-2]:tx,[-1]:tx,32:tx},insideSpan:{null:[ex,tte]},string:{38:HD,92:VD},text:{[-5]:rx,[-4]:rx,[-3]:rx,33:Fee,38:HD,42:ex,60:[BZ,Pee],91:zee,92:[pee,VD],93:nx,95:ex,96:eee}},Symbol.toStringTag,{value:"Module"}));function cte(e){const n=OZ([lte,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:i(NZ),document:i(LZ),flow:i(Zee),string:i(nte),text:i(rte)};return r;function i(o){return s;function s(a){return ote(r,o,a)}}}function ute(e){for(;!UD(e););return e}const eT=/[\0\t\n\r]/g;function dte(){let e=1,t="",n=!0,r;return i;function i(o,s,a){const l=[];let c,d,f,g,p;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),f=0,t="",n&&(o.charCodeAt(0)===65279&&f++,n=void 0);f<o.length;){if(eT.lastIndex=f,c=eT.exec(o),g=c&&c.index!==void 0?c.index:o.length,p=o.charCodeAt(g),!c){t=o.slice(f);break}if(p===10&&f===g&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),f<g&&(l.push(o.slice(f,g)),e+=g-f),p){case 0:{l.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,l.push(-2);e++<d;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}f=g+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const fte=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function hte(e){return e.replace(fte,pte)}function pte(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return LD(n.slice(o?2:1),o?16:10)}return Xy(n)||e}const tT={}.hasOwnProperty;function gte(e,t,n){return typeof t!="string"&&(n=t,t=void 0),mte(n)(ute(cte(n).document().write(dte()(e,t,!0))))}function mte(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(vt),autolinkProtocol:F,autolinkEmail:F,atxHeading:o(Fe),blockQuote:o(ee),characterEscape:F,characterReference:F,codeFenced:o(W),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(W,s),codeText:o(ye,s),codeTextData:F,data:F,codeFlowValue:F,definition:o(oe),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(Te),hardBreakEscape:o(He),hardBreakTrailing:o(He),htmlFlow:o(Ke,s),htmlFlowData:F,htmlText:o(Ke,s),htmlTextData:F,image:o(St),label:s,link:o(vt),listItem:o(tn),listItemValue:g,listOrdered:o(bt,f),listUnordered:o(bt),paragraph:o(Zt),reference:N,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(Fe),strong:o(Dn),thematicBreak:o(Ra)},exit:{atxHeading:l(),atxHeadingSequence:O,autolink:l(),autolinkEmail:re,autolinkProtocol:de,blockQuote:l(),characterEscapeValue:j,characterReferenceMarkerHexadecimal:me,characterReferenceMarkerNumeric:me,characterReferenceValue:he,codeFenced:l(x),codeFencedFence:y,codeFencedFenceInfo:p,codeFencedFenceMeta:v,codeFlowValue:j,codeIndented:l(w),codeText:l($),codeTextData:j,data:j,definition:l(),definitionDestinationString:P,definitionLabelString:S,definitionTitleString:C,emphasis:l(),hardBreakEscape:l(V),hardBreakTrailing:l(V),htmlFlow:l(K),htmlFlowData:j,htmlText:l(Y),htmlTextData:j,image:l(U),label:le,labelText:ie,lineEnding:B,link:l(Z),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:X,resourceDestinationString:M,resourceTitleString:H,resource:ne,setextHeading:l(L),setextHeadingLineSequence:A,setextHeadingText:k,strong:l(),thematicBreak:l()}};nT(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(fe){let Oe={type:"root",children:[]};const Le={stack:[Oe],tokenStack:[],config:t,enter:a,exit:c,buffer:s,resume:d,data:n},Xe=[];let yt=-1;for(;++yt<fe.length;)if(fe[yt][1].type==="listOrdered"||fe[yt][1].type==="listUnordered")if(fe[yt][0]==="enter")Xe.push(yt);else{const hn=Xe.pop();yt=i(fe,hn,yt)}for(yt=-1;++yt<fe.length;){const hn=t[fe[yt][0]];tT.call(hn,fe[yt][1].type)&&hn[fe[yt][1].type].call(Object.assign({sliceSerialize:fe[yt][2].sliceSerialize},Le),fe[yt][1])}if(Le.tokenStack.length>0){const hn=Le.tokenStack[Le.tokenStack.length-1];(hn[1]||rT).call(Le,void 0,hn[0])}for(Oe.position={start:cs(fe.length>0?fe[0][1].start:{line:1,column:1,offset:0}),end:cs(fe.length>0?fe[fe.length-2][1].end:{line:1,column:1,offset:0})},yt=-1;++yt<t.transforms.length;)Oe=t.transforms[yt](Oe)||Oe;return Oe}function i(fe,Oe,Le){let Xe=Oe-1,yt=-1,hn=!1,Cn,Fn,Br,Vr;for(;++Xe<=Le;){const pn=fe[Xe];switch(pn[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{pn[0]==="enter"?yt++:yt--,Vr=void 0;break}case"lineEndingBlank":{pn[0]==="enter"&&(Cn&&!Vr&&!yt&&!Br&&(Br=Xe),Vr=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Vr=void 0}if(!yt&&pn[0]==="enter"&&pn[1].type==="listItemPrefix"||yt===-1&&pn[0]==="exit"&&(pn[1].type==="listUnordered"||pn[1].type==="listOrdered")){if(Cn){let mr=Xe;for(Fn=void 0;mr--;){const jn=fe[mr];if(jn[1].type==="lineEnding"||jn[1].type==="lineEndingBlank"){if(jn[0]==="exit")continue;Fn&&(fe[Fn][1].type="lineEndingBlank",hn=!0),jn[1].type="lineEnding",Fn=mr}else if(!(jn[1].type==="linePrefix"||jn[1].type==="blockQuotePrefix"||jn[1].type==="blockQuotePrefixWhitespace"||jn[1].type==="blockQuoteMarker"||jn[1].type==="listItemIndent"))break}Br&&(!Fn||Br<Fn)&&(Cn._spread=!0),Cn.end=Object.assign({},Fn?fe[Fn][1].start:pn[1].end),fe.splice(Fn||Xe,0,["exit",Cn,pn[2]]),Xe++,Le++}if(pn[1].type==="listItemPrefix"){const mr={type:"listItem",_spread:!1,start:Object.assign({},pn[1].start),end:void 0};Cn=mr,fe.splice(Xe,0,["enter",mr,pn[2]]),Xe++,Le++,Br=void 0,Vr=!0}}}return fe[Oe][1]._spread=hn,Le}function o(fe,Oe){return Le;function Le(Xe){a.call(this,fe(Xe),Xe),Oe&&Oe.call(this,Xe)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(fe,Oe,Le){this.stack[this.stack.length-1].children.push(fe),this.stack.push(fe),this.tokenStack.push([Oe,Le]),fe.position={start:cs(Oe.start),end:void 0}}function l(fe){return Oe;function Oe(Le){fe&&fe.call(this,Le),c.call(this,Le)}}function c(fe,Oe){const Le=this.stack.pop(),Xe=this.tokenStack.pop();if(Xe)Xe[0].type!==fe.type&&(Oe?Oe.call(this,fe,Xe[0]):(Xe[1]||rT).call(this,fe,Xe[0]));else throw new Error("Cannot close `"+fe.type+"` ("+ad({start:fe.start,end:fe.end})+"): it’s not open");Le.position.end=cs(fe.end)}function d(){return CZ(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function g(fe){if(this.data.expectingFirstListItemValue){const Oe=this.stack[this.stack.length-2];Oe.start=Number.parseInt(this.sliceSerialize(fe),10),this.data.expectingFirstListItemValue=void 0}}function p(){const fe=this.resume(),Oe=this.stack[this.stack.length-1];Oe.lang=fe}function v(){const fe=this.resume(),Oe=this.stack[this.stack.length-1];Oe.meta=fe}function y(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function x(){const fe=this.resume(),Oe=this.stack[this.stack.length-1];Oe.value=fe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){const fe=this.resume(),Oe=this.stack[this.stack.length-1];Oe.value=fe.replace(/(\r?\n|\r)$/g,"")}function S(fe){const Oe=this.resume(),Le=this.stack[this.stack.length-1];Le.label=Oe,Le.identifier=Yl(this.sliceSerialize(fe)).toLowerCase()}function C(){const fe=this.resume(),Oe=this.stack[this.stack.length-1];Oe.title=fe}function P(){const fe=this.resume(),Oe=this.stack[this.stack.length-1];Oe.url=fe}function O(fe){const Oe=this.stack[this.stack.length-1];if(!Oe.depth){const Le=this.sliceSerialize(fe).length;Oe.depth=Le}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function A(fe){const Oe=this.stack[this.stack.length-1];Oe.depth=this.sliceSerialize(fe).codePointAt(0)===61?1:2}function L(){this.data.setextHeadingSlurpLineEnding=void 0}function F(fe){const Le=this.stack[this.stack.length-1].children;let Xe=Le[Le.length-1];(!Xe||Xe.type!=="text")&&(Xe=fn(),Xe.position={start:cs(fe.start),end:void 0},Le.push(Xe)),this.stack.push(Xe)}function j(fe){const Oe=this.stack.pop();Oe.value+=this.sliceSerialize(fe),Oe.position.end=cs(fe.end)}function B(fe){const Oe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Le=Oe.children[Oe.children.length-1];Le.position.end=cs(fe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Oe.type)&&(F.call(this,fe),j.call(this,fe))}function V(){this.data.atHardBreak=!0}function K(){const fe=this.resume(),Oe=this.stack[this.stack.length-1];Oe.value=fe}function Y(){const fe=this.resume(),Oe=this.stack[this.stack.length-1];Oe.value=fe}function $(){const fe=this.resume(),Oe=this.stack[this.stack.length-1];Oe.value=fe}function Z(){const fe=this.stack[this.stack.length-1];if(this.data.inReference){const Oe=this.data.referenceType||"shortcut";fe.type+="Reference",fe.referenceType=Oe,delete fe.url,delete fe.title}else delete fe.identifier,delete fe.label;this.data.referenceType=void 0}function U(){const fe=this.stack[this.stack.length-1];if(this.data.inReference){const Oe=this.data.referenceType||"shortcut";fe.type+="Reference",fe.referenceType=Oe,delete fe.url,delete fe.title}else delete fe.identifier,delete fe.label;this.data.referenceType=void 0}function ie(fe){const Oe=this.sliceSerialize(fe),Le=this.stack[this.stack.length-2];Le.label=hte(Oe),Le.identifier=Yl(Oe).toLowerCase()}function le(){const fe=this.stack[this.stack.length-1],Oe=this.resume(),Le=this.stack[this.stack.length-1];if(this.data.inReference=!0,Le.type==="link"){const Xe=fe.children;Le.children=Xe}else Le.alt=Oe}function M(){const fe=this.resume(),Oe=this.stack[this.stack.length-1];Oe.url=fe}function H(){const fe=this.resume(),Oe=this.stack[this.stack.length-1];Oe.title=fe}function ne(){this.data.inReference=void 0}function N(){this.data.referenceType="collapsed"}function X(fe){const Oe=this.resume(),Le=this.stack[this.stack.length-1];Le.label=Oe,Le.identifier=Yl(this.sliceSerialize(fe)).toLowerCase(),this.data.referenceType="full"}function me(fe){this.data.characterReferenceType=fe.type}function he(fe){const Oe=this.sliceSerialize(fe),Le=this.data.characterReferenceType;let Xe;Le?(Xe=LD(Oe,Le==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Xe=Xy(Oe);const yt=this.stack.pop();yt.value+=Xe,yt.position.end=cs(fe.end)}function de(fe){j.call(this,fe);const Oe=this.stack[this.stack.length-1];Oe.url=this.sliceSerialize(fe)}function re(fe){j.call(this,fe);const Oe=this.stack[this.stack.length-1];Oe.url="mailto:"+this.sliceSerialize(fe)}function ee(){return{type:"blockquote",children:[]}}function W(){return{type:"code",lang:null,meta:null,value:""}}function ye(){return{type:"inlineCode",value:""}}function oe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Te(){return{type:"emphasis",children:[]}}function Fe(){return{type:"heading",depth:0,children:[]}}function He(){return{type:"break"}}function Ke(){return{type:"html",value:""}}function St(){return{type:"image",title:null,url:"",alt:null}}function vt(){return{type:"link",title:null,url:"",children:[]}}function bt(fe){return{type:"list",ordered:fe.type==="listOrdered",start:null,spread:fe._spread,children:[]}}function tn(fe){return{type:"listItem",spread:fe._spread,checked:null,children:[]}}function Zt(){return{type:"paragraph",children:[]}}function Dn(){return{type:"strong",children:[]}}function fn(){return{type:"text",value:""}}function Ra(){return{type:"thematicBreak"}}}function cs(e){return{line:e.line,column:e.column,offset:e.offset}}function nT(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?nT(e,r):vte(e,r)}}function vte(e,t){let n;for(n in t)if(tT.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function rT(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ad({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ad({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ad({start:t.start,end:t.end})+") is still open")}function bte(e){const t=this;t.parser=n;function n(r){return gte(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function yte(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function xte(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
@@ -492,4 +492,4 @@ SELECT label, measure FROM table
|
|
|
492
492
|
Table Columns: ${g==null?void 0:g.map(K=>`${K.column_name} | ${K.data_type}`).join(", ")}
|
|
493
493
|
User SQL: ${p}
|
|
494
494
|
`,x=` When the user asks for a specific chart please use the following query structure to generate the chart query. Do not make up the column names. Use only the table columns provided above for the query. Replace x-axis, y-axis, and lables with the appropriate column names.
|
|
495
|
-
Visual Query Syntax: ${jne}`,{data:w,isLoading:S,isFetching:C,isError:P,refetch:O}=Sr({queryKey:["ai-query"],queryFn:()=>tl("https://semaphor.cloud/api/v1/ai",(s==null?void 0:s.accessToken)||"",{user_content:`userContent: ${y} ${a?x:""}`}),enabled:!1});function k(K){if(K.toLowerCase().includes("bar"))f("bar");else if(K.toLowerCase().includes("line"))f("line");else if(K.toLowerCase().includes("bubble"))f("bubble");else if(K.toLowerCase().includes("scatter"))f("scatter");else if(K.toLowerCase().includes("stacked"))f("stackedBar");else if(K.toLowerCase().includes("pie"))f("pie");else if(K.toLowerCase().includes("donut")||K.toLowerCase().includes("doughnut"))f("doughnut");else if(K.toLowerCase().includes("radar"))f("radar");else return f("bar"),!1;return!0}function A(){n&&(k(n)&&l(!0),O())}m.useEffect(()=>{i&&(A(),o(!1))},[i,o]);const L={fontFamily:"Arial, sans-serif",lineHeight:1.6,fontSize:15,padding:"5px",width:"100%"},F={fontFamily:"monospace",fontSize:14,lineHeight:1.6},j={fontFamily:"Arial, sans-serif",lineHeight:1.6,fontSize:15,padding:"2px 0",marginLeft:20,listStyleType:"disc"},B={p:({node:K,...Y})=>_.jsx("p",{style:L,...Y}),pre:({node:K,...Y})=>_.jsxs("pre",{className:" bg-muted/50 space-y-2 p-3 rounded-sm",style:F,children:[_.jsx("code",{className:" whitespace-normal",children:Y.children}),_.jsxs("div",{className:" flex justify-start gap-2",children:[_.jsx(ot,{onClick:V,size:"sm",variant:"outline",children:_.jsx(QE,{})}),_.jsx(ot,{onClick:$=>{const Z=V($);Z&&(t(!1),c(Z),d(!0))},size:"sm",variant:"outline",children:_.jsx(Xj,{})})]})]}),li:({node:K,...Y})=>_.jsx("li",{style:j,...Y})};function V(K){const Y=K.currentTarget.closest("pre");if(!Y)return;const $=Y.textContent||Y.innerText;return navigator.clipboard.writeText($).then(()=>console.log("Text copied to clipboard")).catch(Z=>console.error("Error in copying text: ",Z)),$}return _.jsxs(uy,{open:e,onOpenChange:t,children:[_.jsx(dy,{asChild:!0,children:_.jsx(ot,{size:"sm",className:"",variant:"outline",children:_.jsx(JB,{strokeWidth:1,size:16})})}),_.jsxs(bp,{className:" border-muted sm:max-w-[425px] md:min-w-[625px] md:max-h-[625px] flex flex-col justify-between overflow-auto",children:[_.jsxs(yp,{children:[_.jsx(xp,{children:"Ask"}),_.jsx(wp,{children:"Need assistance with SQL queries? Feel free to ask me any question!"})]}),_.jsx(kl,{className:"h-[625px] w-full border-t border-t-muted ",children:(!S||!C)&&_.jsx($ne,{className:" pl-1 pr-3 py-1 w-full xbg-red-100 overflow-auto ",components:B,children:w==null?void 0:w.response})}),_.jsxs("div",{children:[_.jsx(cf,{className:Pe(" invisible h-1 w-full animate-pulse",{visible:S||C})}),_.jsxs("div",{className:" border rounded-md flex items-center w-full",children:[_.jsx(Fy,{onKeyDown:K=>{K.key==="Enter"&&!K.shiftKey&&(K.preventDefault(),r(""),A())},placeholder:"Type something...",onFocus:K=>{const Y=K.target,$=Y.value.length;Y.setSelectionRange($,$)},className:" border-none resize-none min-h-7 max-h-10 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",value:n,onChange:K=>r(K.target.value)})," ",_.jsx(ot,{className:"h-8",size:"sm",variant:"ghost",onClick:A,children:!S&&!C?_.jsx(Yj,{}):_.jsx(Mu,{className:" w-4 h-4 animate-spin mr-2 text-foreground/50"})})]})]})]})]})}function Bne(){const{theme:e}=qw(),t=m.useRef(),n=m.useRef(),[r,i]=m.useState(!1),[o,s]=m.useState(!1),[a,l]=m.useState(""),[c,d]=m.useState(!1);m.useState("");const f=ge(W=>W.authToken),g=_e(W=>W.card),p=ge(W=>W.theme),v=_e(W=>W.selectedConnectionId),y=_e(W=>W.selectedDatabaseName),x=_e(W=>W.selectedSchemaName),w=_e(W=>W.selectedTableName),S=_e(W=>W.actions.setCardSql),C=_e(W=>W.card.sql),P=_e(W=>W.selectedConnectionId),O=_e(W=>W.filterValues),k=_e(W=>W.applyFilters),A=_e(W=>W.actions.setCardCustomCfg),L=_e(W=>W.actions.setFilterValues),F=_e(W=>W.onSave),j=_e(W=>W.actions.setApplyFilters),B=_e(W=>W.onClose),V=_e(W=>W.actions.setCardData),K=_e(W=>W.actions.setSqlGen),Y=_e(W=>W.runSql),$=_e(W=>W.actions.setRunSql),Z=_e(W=>W.actions.setIsSqlRunning),{data:U,isLoading:ie,isFetching:le,isSuccess:M,isError:H,error:ne,status:N,refetch:X}=Sr({queryKey:[C],queryFn:()=>Is("https://semaphor.cloud/api/v1/query",(f==null?void 0:f.accessToken)||"",{connection_id:P,sql:C,active_filters:k?O:[]}),enabled:!1,retry:!1});m.useEffect(()=>{U&&(console.log("queryData",U),V(U.records))},[U,V]),m.useEffect(()=>{Y&&(X(),$(!1))},[Y,X,$]),m.useEffect(()=>{(ie||le)&&Z(!0),(H||M)&&Z(!1)},[ie,le,H,M,Z]);function me(){S(""),V([]),K({}),A("")}const he=W=>{n.current=W};function de(){if(C&&!C.includes("{{")){const W=sJ(C);S(W),F==null||F({...g,sql:W,lastSelectedSchema:x,lastSelectedDatabase:y,lastSelectedTable:w,connectionId:v})}else F==null||F(g)}function re(){B==null||B()}m.useEffect(()=>{const W=t.current,ye=n.current;if(W){const oe=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",Te=p==="system"?oe:p;W.editor.defineTheme("default",{base:Te==="light"?"vs":"vs-dark",inherit:!0,rules:[],colors:{"editor.background":Te==="light"?"#ffffff":"#020817"}}),W.editor.setTheme("default")}return ye&&W&&ye.addCommand(W.KeyMod.Shift|W.KeyCode.Enter,function(){return console.log("Executing query..."),X(),!1}),()=>{}},[e,p,t.current]);function ee(W){t.current=W}return _.jsxs("section",{role:"editor-section",className:"grow flex flex-col justify-end pt-3 p-1 ",children:[_.jsxs("div",{className:" grow flex relative overflow-y-scroll justify-between ",children:[_.jsx("div",{role:"editor-container",className:`flex ${r?"w-2/3":"w-[95%]"} xbg-red-100 p-1`,children:_.jsx(Ay,{theme:"default",onChange:W=>{S(W),console.log(W)},value:C,options:{minimap:{enabled:!1},wordWrap:"on",scrollbar:{verticalScrollbarSize:0,horizontalScrollbarSize:0},fontSize:14,renderLineHighlight:"none"},defaultLanguage:"sql",defaultValue:"SELECT * FROM table",beforeMount:ee,onMount:he})}),r&&_.jsx("div",{className:" w-1/3 text-xs relative overflow-hidden xbg-yellow-100 p-1 ",children:_.jsxs("div",{className:"min-h-0 ",children:[_.jsxs("div",{className:"flex gap-2 items-center",children:[_.jsx(yJ,{checked:k,onCheckedChange:()=>j(!k),text:"Apply Filters"}),_.jsx(xJ,{})]}),_.jsx(Ay,{theme:"default",onChange:W=>{if(W)try{JSON.parse(W),L(JSON.parse(W))}catch{}},defaultLanguage:"json",className:"min-h-[220px] mt-1",value:JSON.stringify(O,null,2),options:{readOnly:!0,minimap:{enabled:!1},lineNumbers:"off",glyphMargin:!1,wordWrap:"on",scrollbar:{verticalScrollbarSize:0,horizontalScrollbarSize:0},fontSize:12,renderLineHighlight:"none"}})]})}),O&&r&&_.jsx(ia,{onClick:()=>i(!1),className:"absolute right-6 top-1 w-3 h-3 text-foreground/50 hover:text-foreground hover:cursor-pointer"}),O&&!r&&_.jsx(V2,{onClick:()=>i(!0),className:Pe("absolute right-6 top-1 w-3 h-3 text-foreground/50 hover:text-foreground hover:cursor-pointer",{"text-red-800 font-bold":k})})]}),_.jsxs("div",{className:" flex grow px-6 pt-3 pb-4 gap-2 justify-between item-center",children:[_.jsxs("div",{className:"flex grow gap-2 items-center",children:[_.jsxs(ot,{disabled:ie||le,onClick:()=>{X()},className:" shrink-0",size:"sm",variant:"outline",children:[(ie||le)&&_.jsx(Mu,{className:"w-4 h-4 mr-2 animate-spin text-foreground/50"}),"Run"]}),H&&_.jsx(bJ,{error:ne.message}),_.jsx(ot,{onClick:me,className:"",size:"sm",variant:"outline",children:"Clear"}),_.jsx(Gu,{value:a,placeholder:"Type something...",onChange:W=>{l(W.target.value)},onKeyDown:W=>{W.key==="Enter"&&(W.preventDefault(),console.log("enter pressed"),d(!0),s(!0))},className:" bg-muted border-none h-9 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"}),_.jsx(zne,{open:o,setOpen:s,userInput:a,triggerAIRun:c,setTriggerAIRun:d,setUserInput:W=>l(W)})]}),_.jsxs("div",{className:"flex gap-2 items-end ",children:[_.jsx(ot,{onClick:de,size:"sm",variant:"outline",children:_.jsx(Rh,{size:16,strokeWidth:2,className:"text-green-600 font-bold"})}),_.jsx(ot,{onClick:re,className:" w-full",size:"sm",variant:"outline",children:_.jsx(ia,{className:" h-3.5 w-3.5"})})]})]})]})}const RT="Switch",[Vne,xfe]=Pn(RT),[Hne,Wne]=Vne(RT),qne=m.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:o,required:s,disabled:a,value:l="on",onCheckedChange:c,...d}=e,[f,g]=m.useState(null),p=et(t,S=>g(S)),v=m.useRef(!1),y=f?!!f.closest("form"):!0,[x=!1,w]=Qn({prop:i,defaultProp:o,onChange:c});return m.createElement(Hne,{scope:n,checked:x,disabled:a},m.createElement(Be.button,ae({type:"button",role:"switch","aria-checked":x,"aria-required":s,"data-state":LT(x),"data-disabled":a?"":void 0,disabled:a,value:l},d,{ref:p,onClick:Ce(e.onClick,S=>{w(C=>!C),y&&(v.current=S.isPropagationStopped(),v.current||S.stopPropagation())})})),y&&m.createElement(Yne,{control:f,bubbles:!v.current,name:r,value:l,checked:x,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),Une="SwitchThumb",Gne=m.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,i=Wne(Une,n);return m.createElement(Be.span,ae({"data-state":LT(i.checked),"data-disabled":i.disabled?"":void 0},r,{ref:t}))}),Yne=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,o=m.useRef(null),s=Ep(n),a=Mh(t);return m.useEffect(()=>{const l=o.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const g=new Event("click",{bubbles:r});f.call(l,n),l.dispatchEvent(g)}},[s,n,r]),m.createElement("input",ae({type:"checkbox","aria-hidden":!0,defaultChecked:n},i,{tabIndex:-1,ref:o,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function LT(e){return e?"checked":"unchecked"}const $T=qne,Kne=Gne,FT=ue.forwardRef(({className:e,...t},n)=>_.jsx($T,{className:Pe("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:_.jsx(Kne,{className:Pe("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));FT.displayName=$T.displayName;function jT({className:e,...t}){const[n,r]=m.useState(0),i=ge(l=>l.themeStyle),o=_e(l=>l.card),s=_e(l=>l.actions.setCard);if(m.useEffect(()=>{r(n+1)},[o.data,o.type,o.cfg,o.customCfg,i]),!o.id)return null;let a;return o.data&&o.data.length>0&&(a=Ob({data:o.data,cardType:o.type,cfg:o.cfg,customCfg:o.customCfg})),_.jsxs(Pv,{role:"editor-visual-card",className:Pe(" relative h-full flex flex-col rounded-none",e),...t,children:[_.jsxs(kv,{children:[_.jsx(qc,{text:o.title,onSave:l=>s({...o,title:l}),children:_.jsx(Mv,{className:"text-base",children:o.title})}),_.jsx(qc,{text:o.description||"",onSave:l=>s({...o,description:l}),children:_.jsxs(Dv,{children:[" ",o.description]})})]}),_.jsxs(Tv,{className:"flex flex-col pb-3 grow",children:[o.type!=="table"&&a&&_.jsx(KE,{cfg:a},n),o.type==="table"&&o.data&&o.data.length>0&&_.jsx(lO,{children:_.jsx(o0,{data:o==null?void 0:o.data})})]})]})}function Xne(){const[e,t]=m.useState(!1),[n,r]=m.useState(""),[i,o]=m.useState(""),[s,a]=m.useState(""),l=_e(x=>x.card),c=_e(x=>x.card.customCfg),d=_e(x=>x.actions.setCardCustomCfg);function f(x){var C,P;const w={...x,data:{...x==null?void 0:x.data,datasets:(P=(C=x==null?void 0:x.data)==null?void 0:C.datasets)==null?void 0:P.map(O=>({...O,data:[]}))}};return JSON.stringify(w,null,1)}function g(){if(!l.data||l.data.length===0)return;const x=Ob({data:l.data,cardType:l.type,cfg:l.cfg});x&&(r(JSON.stringify(x,null,1)),c&&o(JSON.stringify(c,null,1)))}function p(){if(i)try{const x=JSON.parse(i);return x?(d(x),a(""),o(""),x):void 0}catch(x){console.log(x),a("Invalid JSON")}}function v(){o(""),d(null)}function y(){let x;if(c){const w=$s.cloneDeep(l.cfg),S=$s.merge(w,c);return x=f(S),x}return n?(x=f(JSON.parse(n)),x):""}return _.jsxs(uy,{open:e,onOpenChange:t,children:[_.jsx(dy,{asChild:!0,children:_.jsx(ot,{onClick:g,className:`h-7 ${c&&"border-foreground/50 dark:border-foreground/70"}`,size:"sm",variant:"outline",children:c?"Custom Config":"Customize"})}),_.jsx(bp,{className:" sm:max-w-[425px] md:min-w-[600px] md:min-h-[700px] lg:min-w-[800px] xl:min-w-[1000px]",children:_.jsxs("div",{className:"bg-red-x100 flex flex-col gap-2 justify-between",children:[_.jsxs(yp,{className:"",children:[_.jsx(xp,{children:"Customize Chart"}),_.jsxs(wp,{children:["See the configuration options and documentation",_.jsx("a",{target:"_blank",className:"ml-1 underline text-blue-500 ",href:"https://www.chartjs.org/docs/latest/samples/bar/vertical.html",children:"here."})]})]}),_.jsxs("div",{className:"grow flex flex-wrap gap-2",children:[_.jsx(jT,{className:"flex-1 rounded shadow-none"}),_.jsxs(o_,{defaultValue:"custom-config",className:" flex flex-col flex-1",children:[_.jsxs(s_,{className:" justify-start border rounded-sm rounded-b-none border-b-0 ",children:[_.jsxs(Tm,{value:"custom-config",children:[c&&_.jsx(XE,{className:"w-5 h-5 mr-1 text-green-600"}),c?"Custom Config":"Default Config"]}),_.jsx(Tm,{className:"",value:"output",children:"Output"})]}),_.jsx(hf,{className:" grow mt-0 bg-red-x p-2 border border-t-0 rounded-b ",value:"output",children:_.jsx(Fy,{disabled:!0,value:n,className:" border-none resize-none font-mono h-full focus-visible:ring-0 focus-visible:ring-offset-0"})}),_.jsx(hf,{className:"grow mt-0 border border-t-0 rounded-b ",value:"custom-config",children:_.jsx(Ay,{className:"h-full w-full overflow-hidden",theme:"default",options:{minimap:{enabled:!1},wordWrap:"on",scrollbar:{verticalScrollbarSize:0,horizontalScrollbarSize:0},fontSize:14,renderLineHighlight:"none"},defaultLanguage:"json",value:y(),onChange:x=>o(x)})})]})]}),_.jsxs(fy,{className:"flex items-center",children:[_.jsx(ns,{className:"text-red-500 mr-2",children:s}),_.jsx(ot,{disabled:!c,onClick:v,variant:"outline",children:"Reset"}),_.jsx(ot,{onClick:p,variant:"outline",children:"Apply"}),_.jsx(ot,{onClick:()=>t(!1),variant:"outline",children:"Close"})]})]})})]})}var zT={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},BT=m.createContext&&m.createContext(zT),Qne=["attr","size","title"];function Jne(e,t){if(e==null)return{};var n=Zne(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Zne(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function eg(){return eg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},eg.apply(this,arguments)}function VT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function tg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VT(Object(n),!0).forEach(function(r){ere(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ere(e,t,n){return t=tre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tre(e){var t=nre(e,"string");return typeof t=="symbol"?t:String(t)}function nre(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function HT(e){return e&&e.map((t,n)=>m.createElement(t.tag,tg({key:n},t.attr),HT(t.child)))}function fd(e){return t=>m.createElement(rre,eg({attr:tg({},e.attr)},t),HT(e.child))}function rre(e){var t=n=>{var{attr:r,size:i,title:o}=e,s=Jne(e,Qne),a=i||n.size||"1em",l;return n.className&&(l=n.className),e.className&&(l=(l?l+" ":"")+e.className),m.createElement("svg",eg({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,s,{className:l,style:tg(tg({color:e.color||n.color},n.style),e.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),o&&m.createElement("title",null,o),e.children)};return BT!==void 0?m.createElement(BT.Consumer,null,n=>t(n)):t(zT)}function WT(e){return fd({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M926.8 397.1l-396-288a31.81 31.81 0 0 0-37.6 0l-396 288a31.99 31.99 0 0 0-11.6 35.8l151.3 466a32 32 0 0 0 30.4 22.1h489.5c13.9 0 26.1-8.9 30.4-22.1l151.3-466c4.2-13.2-.5-27.6-11.7-35.8zM838.6 417l-98.5 32-200-144.7V199.9L838.6 417zM466 567.2l-89.1 122.3-55.2-169.2L466 567.2zm-116.3-96.8L484 373.3v140.8l-134.3-43.7zM512 599.2l93.9 128.9H418.1L512 599.2zm28.1-225.9l134.2 97.1L540.1 514V373.3zM558 567.2l144.3-46.9-55.2 169.2L558 567.2zm-74-367.3v104.4L283.9 449l-98.5-32L484 199.9zM169.3 470.8l86.5 28.1 80.4 246.4-53.8 73.9-113.1-348.4zM327.1 853l50.3-69h269.3l50.3 69H327.1zm414.5-33.8l-53.8-73.9 80.4-246.4 86.5-28.1-113.1 348.4z"},child:[]}]})(e)}function qT(e){return fd({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm87.63,96H191.48A64.1,64.1,0,0,0,136,64.52V40.37A88.13,88.13,0,0,1,215.63,120ZM120,120H80.68A48.09,48.09,0,0,1,120,80.68Zm0,16v39.32A48.09,48.09,0,0,1,80.68,136Zm16,0h39.32A48.09,48.09,0,0,1,136,175.32Zm0-16V80.68A48.09,48.09,0,0,1,175.32,120ZM120,40.37V64.52A64.1,64.1,0,0,0,64.52,120H40.37A88.13,88.13,0,0,1,120,40.37ZM40.37,136H64.52A64.1,64.1,0,0,0,120,191.48v24.15A88.13,88.13,0,0,1,40.37,136ZM136,215.63V191.48A64.1,64.1,0,0,0,191.48,136h24.15A88.13,88.13,0,0,1,136,215.63Z"},child:[]}]})(e)}function UT(e){return fd({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M137,28.05a11.94,11.94,0,0,0-9.12,3.08A12.09,12.09,0,0,0,124,40V80.67a11.88,11.88,0,0,0,9.9,11.81,36,36,0,1,1-41.85,37.4c-.47-9.14,1.47-16.8,5.75-22.79h0a11.89,11.89,0,0,0-1.3-15.35L68.87,63.51a12,12,0,0,0-17.74.83A99.6,99.6,0,0,0,57.79,199.2,99.24,99.24,0,0,0,128,228h1.43A100.29,100.29,0,0,0,228,129.42C228.72,77.21,188.76,32.68,137,28.05ZM57.28,69.46A4,4,0,0,1,60.2,68h.19a3.91,3.91,0,0,1,2.79,1.14L90.81,97.36a3.93,3.93,0,0,1,.48,5.08A40.47,40.47,0,0,0,84.08,124h-48A90.36,90.36,0,0,1,57.28,69.46ZM36.09,132H84.18A44,44,0,0,0,124,171.81V219.9A92,92,0,0,1,36.09,132ZM193,193a91.43,91.43,0,0,1-61,26.92V171.82a43.51,43.51,0,0,0,26-11.63,44,44,0,0,0-22.79-75.6A4,4,0,0,1,132,80.67V40a4,4,0,0,1,1.31-3,3.89,3.89,0,0,1,3-1c47.59,4.26,84.34,45.24,83.67,93.29A91.42,91.42,0,0,1,193,193Z"},child:[]}]})(e)}function GT(e){return fd({tag:"svg",attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},child:[]},{tag:"path",attr:{d:"M6 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"},child:[]},{tag:"path",attr:{d:"M16 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},child:[]},{tag:"path",attr:{d:"M14.5 7.5m-4.5 0a4.5 4.5 0 1 0 9 0a4.5 4.5 0 1 0 -9 0"},child:[]}]})(e)}function YT(e){return fd({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M4 9h4v11H4zM4 4h4v4H4zM10 7h4v4h-4zM16 10h4v4h-4zM16 15h4v5h-4zM10 12h4v8h-4z"},child:[]}]})(e)}function ire(){const[e,t]=m.useState(!1),n=_e(s=>s.card.type),r=_e(s=>s.actions.setCardType),i=_e(s=>s.actions.setCardCustomCfg);function o(s){r(s),i(null),t(!1)}return _.jsxs(pp,{open:e,onOpenChange:t,children:[_.jsx(gp,{asChild:!0,children:_.jsx(ot,{className:"h-7 px-2",variant:"outline",children:_.jsx(ore,{className:"h-4 w-4",chartType:n})})}),_.jsx(qu,{className:"w-50",children:_.jsxs("div",{className:"grid grid-cols-3 place-items-center ",children:[_.jsx(ot,{onClick:()=>o("bar"),className:"font-normal",variant:"ghost",children:_.jsx(j2,{strokeWidth:1})}),_.jsx(ot,{onClick:()=>o("line"),variant:"ghost",children:_.jsx(H2,{strokeWidth:1})}),_.jsx(ot,{onClick:()=>o("stackedBar"),variant:"ghost",children:_.jsx(YT,{className:"h-6 w-6 text-foreground/50 ",strokeWidth:0})}),_.jsx(ot,{onClick:()=>o("scatter"),variant:"ghost",children:_.jsx(U2,{strokeWidth:1})}),_.jsx(ot,{onClick:()=>o("bubble"),variant:"ghost",children:_.jsx(GT,{strokeWidth:2})}),_.jsx(ot,{onClick:()=>o("pie"),variant:"ghost",children:_.jsx(W2,{strokeWidth:1})}),_.jsx(ot,{onClick:()=>o("doughnut"),variant:"ghost",children:_.jsx(UT,{className:"h-7 w-7",strokeWidth:.5})}),_.jsx(ot,{onClick:()=>o("radar"),variant:"ghost",children:_.jsx(WT,{className:"h-6 w-6 text-foreground/50 font-extralight",strokeWidth:.5})}),_.jsx(ot,{onClick:()=>o("polarArea"),variant:"ghost",children:_.jsx(qT,{className:"h-6 w-6 text-foreground/50",strokeWidth:1})}),_.jsx(ot,{onClick:()=>o("table"),variant:"ghost",children:_.jsx(Hb,{className:"h-6 w-6 text-foreground/90",strokeWidth:1})})]})})]})}function ore({chartType:e,className:t}){switch(e){case"bar":return _.jsx(j2,{className:t});case"line":return _.jsx(H2,{className:t});case"pie":return _.jsx(W2,{className:t});case"radar":return _.jsx(WT,{className:t});case"scatter":return _.jsx(U2,{className:t});case"bubble":return _.jsx(GT,{className:t});case"doughnut":return _.jsx(UT,{className:t});case"stackedBar":return _.jsx(YT,{className:"h-5 w-5 text-foreground/50 ",strokeWidth:0});case"polarArea":return _.jsx(qT,{className:t});default:return _.jsx(Hb,{className:t})}}function sre(){const e=_e(n=>n.card.refreshInterval),t=_e(n=>n.actions.setCardRefreshInterval);return _.jsxs(pp,{children:[_.jsx(gp,{asChild:!0,children:_.jsx(ot,{className:"h-7",variant:"outline",children:"Realtime"})}),_.jsx(qu,{className:"w-[200px]",children:_.jsx("div",{className:"grid gap-4",children:_.jsx("div",{className:"grid gap-2",children:_.jsxs("div",{className:"grid grid-cols-5 items-center gap-1",children:[_.jsx(ns,{className:"col-span-3",htmlFor:"width",children:"Refresh Every"}),_.jsx(Gu,{value:e||"",onChange:n=>t(n.target.value),id:"width",placeholder:"30s",className:"col-span-2 h-7 focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-0"})]})})})})]})}function KT(){const e=_e(r=>r.card),t=_e(r=>r.isShowingVisual),n=_e(r=>r.isSqlRunning);return _e(r=>r.onSave),_e(r=>r.onClose),_e(r=>r.actions.setCardSql),_e(r=>r.actions.setCardType),_e(r=>r.actions.setSqlGen),_.jsxs("div",{className:" h-full relative flex flex-col",children:[n&&_.jsx(Mu,{className:" w-10 h-10 z-10 absolute m-auto left-0 right-0 top-0 bottom-0 animate-spin text-foreground/10 "}),_.jsxs("div",{className:" h-10 px-6 pt-6 bg-red-x100 mb-0 z-10 right-0 flex justify-end items-center gap-2",children:[t&&_.jsxs("div",{className:"bg-red-x00 flex grow gap-2",children:[_.jsx(ire,{}),_.jsx(Xne,{}),_.jsx(sre,{})]}),_.jsx(are,{})]}),t?_.jsx(jT,{className:"grow border-none shadow-none "}):_.jsx("div",{className:"w-full mt-4 px-6 bg-red-x00 grow border-none shadow-none overflow-y-auto ",children:e.data&&e.data.length>0&&_.jsx(o0,{data:e.data})})]})}function are(){const e=_e(n=>n.isShowingVisual),t=_e(n=>n.actions.setIsShowingVisual);return _.jsxs("div",{className:" flex items-center space-x-2",children:[_.jsx(ns,{htmlFor:"visualize",children:"Chart"}),_.jsx(FT,{checked:e,onCheckedChange:()=>t(!e),id:"visualize",className:"data-[state=checked]:bg-foreground/50"})]})}const XT="Collapsible",[lre,QT]=Pn(XT),[cre,yx]=lre(XT),ure=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:s,...a}=e,[l=!1,c]=Qn({prop:r,defaultProp:i,onChange:s});return m.createElement(cre,{scope:n,disabled:o,contentId:or(),open:l,onOpenToggle:m.useCallback(()=>c(d=>!d),[c])},m.createElement(Be.div,ae({"data-state":xx(l),"data-disabled":o?"":void 0},a,{ref:t})))}),dre="CollapsibleTrigger",fre=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=yx(dre,n);return m.createElement(Be.button,ae({type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":xx(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled},r,{ref:t,onClick:Ce(e.onClick,i.onOpenToggle)}))}),JT="CollapsibleContent",hre=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=yx(JT,e.__scopeCollapsible);return m.createElement(vn,{present:n||i.open},({present:o})=>m.createElement(pre,ae({},r,{ref:t,present:o})))}),pre=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=e,s=yx(JT,n),[a,l]=m.useState(r),c=m.useRef(null),d=et(t,c),f=m.useRef(0),g=f.current,p=m.useRef(0),v=p.current,y=s.open||a,x=m.useRef(y),w=m.useRef();return m.useEffect(()=>{const S=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(S)},[]),Vn(()=>{const S=c.current;if(S){w.current=w.current||{transitionDuration:S.style.transitionDuration,animationName:S.style.animationName},S.style.transitionDuration="0s",S.style.animationName="none";const C=S.getBoundingClientRect();f.current=C.height,p.current=C.width,x.current||(S.style.transitionDuration=w.current.transitionDuration,S.style.animationName=w.current.animationName),l(r)}},[s.open,r]),m.createElement(Be.div,ae({"data-state":xx(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!y},o,{ref:d,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...e.style}}),y&&i)});function xx(e){return e?"open":"closed"}const gre=ure,mre=fre,vre=hre,us="Accordion",bre=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[wx,yre,xre]=df(us),[ng,wfe]=Pn(us,[xre,QT]),_x=QT(),ZT=m.forwardRef((e,t)=>{const{type:n,...r}=e,i=r,o=r;return m.createElement(wx.Provider,{scope:e.__scopeAccordion},n==="multiple"?m.createElement(Cre,ae({},o,{ref:t})):m.createElement(Sre,ae({},i,{ref:t})))});ZT.propTypes={type(e){const t=e.value||e.defaultValue;return e.type&&!["single","multiple"].includes(e.type)?new Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`."):e.type==="multiple"&&typeof t=="string"?new Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`."):e.type==="single"&&Array.isArray(t)?new Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`."):null}};const[eA,wre]=ng(us),[tA,_re]=ng(us,{collapsible:!1}),Sre=m.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:o=!1,...s}=e,[a,l]=Qn({prop:n,defaultProp:r,onChange:i});return m.createElement(eA,{scope:e.__scopeAccordion,value:a?[a]:[],onItemOpen:l,onItemClose:m.useCallback(()=>o&&l(""),[o,l])},m.createElement(tA,{scope:e.__scopeAccordion,collapsible:o},m.createElement(nA,ae({},s,{ref:t}))))}),Cre=m.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...o}=e,[s=[],a]=Qn({prop:n,defaultProp:r,onChange:i}),l=m.useCallback(d=>a((f=[])=>[...f,d]),[a]),c=m.useCallback(d=>a((f=[])=>f.filter(g=>g!==d)),[a]);return m.createElement(eA,{scope:e.__scopeAccordion,value:s,onItemOpen:l,onItemClose:c},m.createElement(tA,{scope:e.__scopeAccordion,collapsible:!0},m.createElement(nA,ae({},o,{ref:t}))))}),[Ere,rg]=ng(us),nA=m.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:i,orientation:o="vertical",...s}=e,a=m.useRef(null),l=et(a,t),c=yre(n),f=Fs(i)==="ltr",g=Ce(e.onKeyDown,p=>{var v;if(!bre.includes(p.key))return;const y=p.target,x=c().filter(F=>{var j;return!((j=F.ref.current)!==null&&j!==void 0&&j.disabled)}),w=x.findIndex(F=>F.ref.current===y),S=x.length;if(w===-1)return;p.preventDefault();let C=w;const P=0,O=S-1,k=()=>{C=w+1,C>O&&(C=P)},A=()=>{C=w-1,C<P&&(C=O)};switch(p.key){case"Home":C=P;break;case"End":C=O;break;case"ArrowRight":o==="horizontal"&&(f?k():A());break;case"ArrowDown":o==="vertical"&&k();break;case"ArrowLeft":o==="horizontal"&&(f?A():k());break;case"ArrowUp":o==="vertical"&&A();break}const L=C%S;(v=x[L].ref.current)===null||v===void 0||v.focus()});return m.createElement(Ere,{scope:n,disabled:r,direction:i,orientation:o},m.createElement(wx.Slot,{scope:n},m.createElement(Be.div,ae({},s,{"data-orientation":o,ref:l,onKeyDown:r?void 0:g}))))}),Sx="AccordionItem",[Ore,Cx]=ng(Sx),Pre=m.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...i}=e,o=rg(Sx,n),s=wre(Sx,n),a=_x(n),l=or(),c=r&&s.value.includes(r)||!1,d=o.disabled||e.disabled;return m.createElement(Ore,{scope:n,open:c,disabled:d,triggerId:l},m.createElement(gre,ae({"data-orientation":o.orientation,"data-state":iA(c)},a,i,{ref:t,disabled:d,open:c,onOpenChange:f=>{f?s.onItemOpen(r):s.onItemClose(r)}})))}),kre="AccordionHeader",Mre=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=rg(us,n),o=Cx(kre,n);return m.createElement(Be.h3,ae({"data-orientation":i.orientation,"data-state":iA(o.open),"data-disabled":o.disabled?"":void 0},r,{ref:t}))}),rA="AccordionTrigger",Dre=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=rg(us,n),o=Cx(rA,n),s=_re(rA,n),a=_x(n);return m.createElement(wx.ItemSlot,{scope:n},m.createElement(mre,ae({"aria-disabled":o.open&&!s.collapsible||void 0,"data-orientation":i.orientation,id:o.triggerId},a,r,{ref:t})))}),Tre="AccordionContent",Are=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=rg(us,n),o=Cx(Tre,n),s=_x(n);return m.createElement(vre,ae({role:"region","aria-labelledby":o.triggerId,"data-orientation":i.orientation},s,r,{ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}}))});function iA(e){return e?"open":"closed"}const Ire=ZT,Nre=Pre,Rre=Mre,oA=Dre,sA=Are,aA=Ire,ds=ue.forwardRef(({className:e,...t},n)=>_.jsx(Nre,{ref:n,className:Pe("border-b",e),...t}));ds.displayName="AccordionItem";const fs=ue.forwardRef(({className:e,children:t,...n},r)=>_.jsx(Rre,{className:"flex",children:_.jsxs(oA,{ref:r,className:Pe("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,_.jsx(Vb,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));fs.displayName=oA.displayName;const hs=ue.forwardRef(({className:e,children:t,...n},r)=>_.jsx(sA,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:_.jsx("div",{className:Pe("pb-4 pt-0",e),children:t})}));hs.displayName=sA.displayName;const lA="Radio",[Lre,cA]=Pn(lA),[$re,Fre]=Lre(lA),jre=m.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:i=!1,required:o,disabled:s,value:a="on",onCheck:l,...c}=e,[d,f]=m.useState(null),g=et(t,y=>f(y)),p=m.useRef(!1),v=d?!!d.closest("form"):!0;return m.createElement($re,{scope:n,checked:i,disabled:s},m.createElement(Be.button,ae({type:"button",role:"radio","aria-checked":i,"data-state":uA(i),"data-disabled":s?"":void 0,disabled:s,value:a},c,{ref:g,onClick:Ce(e.onClick,y=>{i||l==null||l(),v&&(p.current=y.isPropagationStopped(),p.current||y.stopPropagation())})})),v&&m.createElement(Vre,{control:d,bubbles:!p.current,name:r,value:a,checked:i,required:o,disabled:s,style:{transform:"translateX(-100%)"}}))}),zre="RadioIndicator",Bre=m.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...i}=e,o=Fre(zre,n);return m.createElement(vn,{present:r||o.checked},m.createElement(Be.span,ae({"data-state":uA(o.checked),"data-disabled":o.disabled?"":void 0},i,{ref:t})))}),Vre=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,o=m.useRef(null),s=Ep(n),a=Mh(t);return m.useEffect(()=>{const l=o.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const g=new Event("click",{bubbles:r});f.call(l,n),l.dispatchEvent(g)}},[s,n,r]),m.createElement("input",ae({type:"radio","aria-hidden":!0,defaultChecked:n},i,{tabIndex:-1,ref:o,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function uA(e){return e?"checked":"unchecked"}const Hre=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],dA="RadioGroup",[Wre,_fe]=Pn(dA,[ol,cA]),fA=ol(),hA=cA(),[qre,Ure]=Wre(dA),Gre=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:i,value:o,required:s=!1,disabled:a=!1,orientation:l,dir:c,loop:d=!0,onValueChange:f,...g}=e,p=fA(n),v=Fs(c),[y,x]=Qn({prop:o,defaultProp:i,onChange:f});return m.createElement(qre,{scope:n,name:r,required:s,disabled:a,value:y,onValueChange:x},m.createElement(km,ae({asChild:!0},p,{orientation:l,dir:v,loop:d}),m.createElement(Be.div,ae({role:"radiogroup","aria-required":s,"aria-orientation":l,"data-disabled":a?"":void 0,dir:v},g,{ref:t}))))}),Yre="RadioGroupItem",Kre=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...i}=e,o=Ure(Yre,n),s=o.disabled||r,a=fA(n),l=hA(n),c=m.useRef(null),d=et(t,c),f=o.value===i.value,g=m.useRef(!1);return m.useEffect(()=>{const p=y=>{Hre.includes(y.key)&&(g.current=!0)},v=()=>g.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",v),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",v)}},[]),m.createElement(Mm,ae({asChild:!0},a,{focusable:!s,active:f}),m.createElement(jre,ae({disabled:s,required:o.required,checked:f},l,i,{name:o.name,ref:d,onCheck:()=>o.onValueChange(i.value),onKeyDown:Ce(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:Ce(i.onFocus,()=>{var p;g.current&&((p=c.current)===null||p===void 0||p.click())})})))}),Xre=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,i=hA(n);return m.createElement(Bre,ae({},i,r,{ref:t}))}),pA=Gre,gA=Kre,Qre=Xre,mA=ue.forwardRef(({className:e,...t},n)=>_.jsx(pA,{className:Pe("grid gap-2",e),...t,ref:n}));mA.displayName=pA.displayName;const Ex=ue.forwardRef(({className:e,...t},n)=>_.jsx(gA,{ref:n,className:Pe("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:_.jsx(Qre,{className:"flex items-center justify-center",children:_.jsx(B2,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Ex.displayName=gA.displayName;function vA(){var i;const e=_e(o=>o.card.cfg),t=_e(o=>o.actions.setCardCfg),n=(i=e==null?void 0:e.options)==null?void 0:i.indexAxis;function r(o){const s={...e,options:{...e==null?void 0:e.options,indexAxis:o}};t(s)}return _.jsxs("div",{children:[_.jsx("p",{className:"font-semibold",children:"Orientation"}),_.jsxs(mA,{value:n,onValueChange:r,className:"flex gap-3 mt-2 ",defaultValue:"x",children:[_.jsxs("div",{className:"flex items-center space-x-2",children:[_.jsx(Ex,{value:"x",id:"r1"}),_.jsx("label",{className:"text-sm",htmlFor:"r1",children:"Vertical"})]}),_.jsxs("div",{className:"flex items-center space-x-2",children:[_.jsx(Ex,{value:"y",id:"r2"}),_.jsx("label",{className:"text-sm",htmlFor:"r2",children:"Horizontal"})]})]})]})}function bA(){var r,i,o;const e=_e(s=>s.card.cfg),t=_e(s=>s.actions.setCardCfg);function n(s){var c;const a={datalabels:{display:s!=="none",align:s,anchor:s,clamp:!0}},l={...e,options:{...e==null?void 0:e.options,plugins:{...(c=e==null?void 0:e.options)==null?void 0:c.plugins,...a}}};t(l),console.log(s)}return _.jsxs(_.Fragment,{children:[_.jsx("label",{className:"font-medium",children:"Data Labels"}),_.jsxs(sM,{value:(o=(i=(r=e==null?void 0:e.options)==null?void 0:r.plugins)==null?void 0:i.datalabels)==null?void 0:o.anchor,onValueChange:n,defaultValue:"none",children:[_.jsx(Cy,{className:"w-[180px] mt-2 focus:ring-1 focus:ring-offset-0 h-7",children:_.jsx(lM,{placeholder:"Select position"})}),_.jsx(Ey,{children:_.jsxs(aM,{children:[_.jsx(Tp,{children:"Data Labels"}),_.jsx(_a,{value:"none",children:"None"}),_.jsx(_a,{value:"start",children:"Start"}),_.jsx(_a,{value:"center",children:"Center"}),_.jsx(_a,{value:"end",children:"End"})]})})]})]})}function yA(){const e=_e(i=>i.card.preferences),t=_e(i=>i.actions.setCardPreferences),n=_e(i=>{var o;return(o=i.card.preferences)==null?void 0:o.filterOnClickField}),r=_e(i=>i.actions.setFilterOnClickField);return _.jsxs("div",{children:[_.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[_.jsx(Op,{checked:!!(e!=null&&e.filterOnClick),onCheckedChange:i=>{t({...e,filterOnClick:!!i})}}),_.jsx(ns,{children:"Filter on click"})]}),(e==null?void 0:e.filterOnClick)===!0&&_.jsxs("div",{className:"flex gap-2 items-center",children:[_.jsx(Gu,{value:n||"",className:" h-7 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",placeholder:"expression (optional)",onChange:i=>r(i.target.value)}),_.jsxs(zb,{children:[_.jsx(N2,{children:_.jsx(JE,{className:"h-4 w-4 opacity-70"})}),_.jsx(Ih,{children:_.jsxs("div",{className:"max-w-[200px]",children:["The x-axis expression of your query. Example:",_.jsx("div",{className:" mt-1 text-xs font-mono",children:"TO_CHAR(order_date, 'YYYY-MM')"})]})})]})]})]})}const Jre={datasets:[{type:"line",label:"Sum_sales",data:[]},{type:"bar",label:"Sum_profit",data:[]}]},Zre={datasets:[{fill:"origin",type:"line",label:"Sum_sales",data:[]}]};function eie(){const e=_e(t=>t.card.type);return _.jsxs("div",{className:"p-6 space-y-6",children:[_.jsx(aA,{className:" ",type:"single",collapsible:!0,children:tie(e)}),_.jsx("section",{className:"",children:["line","bar"].includes(e)&&_.jsx(vA,{})}),_.jsx("div",{children:_.jsx(bA,{})}),_.jsx("div",{children:_.jsx(yA,{})})]})}function tie(e){if(["line","bar"].includes(e))return _.jsxs(_.Fragment,{children:[_.jsxs(ds,{className:"border-muted",value:"item-1",children:[_.jsx(fs,{className:" font-normal",children:_.jsx("p",{children:"Chart Query"})}),_.jsxs(hs,{className:" ",children:[_.jsx("div",{className:"bg-muted px-2 py-1 rounded font-mono font-semibold text-xs",children:"SELECT x-axis, y-axis-1, y-axis-2, y-axis-3,... FROM table"}),_.jsxs("ul",{className:"my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs",children:[_.jsx("li",{children:"X-axis - Category (ex. city)"}),_.jsx("li",{children:"Y-axis - Number (ex. population)"})]})]})]}),_.jsxs(ds,{className:"border-muted",value:"item-2",children:[_.jsx(fs,{className:" font-normal",children:"Mixed Chart"}),_.jsxs(hs,{className:" text-xs space-y-2",children:[_.jsxs("p",{children:["Click ",_.jsx("b",{children:"Customize"})," and change the `type` property in the dataset."]}),_.jsx("pre",{children:JSON.stringify(Jre,null,2)})]})]}),_.jsxs(ds,{className:"border-muted",value:"item-3",children:[_.jsx(fs,{className:" font-normal",children:"Area Chart"}),_.jsxs(hs,{className:" text-xs space-y-2",children:[_.jsxs("p",{children:["Click ",_.jsx("b",{children:"Customize"})," and add `fill` property to the dataset. See",_.jsx("a",{className:"text-blue-500 hover:underline mx-1",href:"https://www.chartjs.org/docs/latest/samples/area/line-boundaries.html",target:"_blank",children:"docs"}),"for more options."]}),_.jsx("pre",{children:JSON.stringify(Zre,null,2)})]})]})]});if(e==="bubble")return _.jsx(_.Fragment,{children:_.jsxs(ds,{className:"border-muted",value:"item-1",children:[_.jsx(fs,{className:" font-normal",children:_.jsxs("p",{children:["How to create a ",_.jsx("span",{children:e})," chart query?"]})}),_.jsxs(hs,{className:" ",children:[_.jsx("div",{className:"bg-muted px-2 py-1 rounded font-mono font-semibold text-xs",children:"SELECT label, x-axis, y-axis, radius FROM table"}),_.jsxs("ul",{className:"my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs",children:[_.jsx("li",{children:"Label - Category (ex. city)"}),_.jsx("li",{children:"Bubble Group (opt) - Category (ex. state)"}),_.jsx("li",{children:"X-axis - Number (ex. avg. age)"}),_.jsx("li",{children:"Y-axis - Number (ex. avg. weight)"}),_.jsx("li",{children:"Radius - Number (ex. population)"})]})]})]})});if(e==="scatter")return _.jsx(_.Fragment,{children:_.jsxs(ds,{value:"item-1",children:[_.jsx(fs,{className:" font-normal",children:_.jsxs("p",{children:["How to create a ",_.jsx("span",{children:e})," chart query?"]})}),_.jsxs(hs,{className:" ",children:[_.jsx("div",{className:"bg-muted px-2 py-1 rounded font-mono font-semibold text-xs",children:"SELECT label, x-axis, y-axis FROM table"}),_.jsxs("ul",{className:"my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs",children:[_.jsx("li",{children:"Label - Category (ex. city)"}),_.jsx("li",{children:"Group (opt) - Category (ex. state)"}),_.jsx("li",{children:"X-axis - Number (ex. avg. age)"}),_.jsx("li",{children:"Y-axis - Number (ex. avg. weight)"})]})]})]})});if(["pie","doughnut","polarArea"].includes(e))return _.jsx(_.Fragment,{children:_.jsxs(ds,{value:"item-1",children:[_.jsx(fs,{className:" font-normal",children:_.jsxs("p",{children:["How to create a"," ",_.jsxs("span",{children:[e==="polarArea"?"polar":e," "]})," ","chart query?"]})}),_.jsxs(hs,{className:" ",children:[_.jsx("div",{className:"bg-muted px-2 py-1 rounded font-mono font-semibold text-xs",children:"SELECT label, measure FROM table"}),_.jsxs("ul",{className:"my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs",children:[_.jsx("li",{children:"Label - Category (ex. city)"}),_.jsx("li",{children:"Measure - Number (ex. population)"})]})]})]})})}function nie(){return _.jsxs("div",{className:"px-6 py-2 space-y-6",children:[_.jsx(aA,{className:" ",type:"single",collapsible:!0,children:_.jsxs(ds,{className:"border-muted",value:"item-1",children:[_.jsx(fs,{className:" font-normal",children:"Stacked chart query?"}),_.jsxs(hs,{className:" ",children:[_.jsx("div",{className:"bg-muted px-2 py-1 rounded font-mono font-semibold text-xs",children:"SELECT x-axis, stack-by, y-axis FROM table"}),_.jsxs("ul",{className:"my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs",children:[_.jsx("li",{children:"X-axis - Category (ex. country)"}),_.jsx("li",{children:"Stack by - Category (ex. city)"}),_.jsx("li",{children:"Y-axis - Number (ex. population)"})]})]})]})}),_.jsx("section",{className:"",children:_.jsx(vA,{})}),_.jsx("div",{children:_.jsx(bA,{})}),_.jsx("div",{children:_.jsx(yA,{})})]})}function rie(){const e=_e(t=>t.card.type);return _.jsx(kl,{className:" text-sm h-full w-full ",children:e==="stackedBar"?_.jsx(nie,{}):_.jsx(eie,{})})}function iie(){const e=_e(t=>t.isShowingVisual);return _.jsxs(FM,{direction:"vertical",className:"min-w-full max-w-lg min-h-[250px]",children:[_.jsx($p,{className:"flex",minSize:40,defaultSize:40,children:_.jsx(Bne,{})}),_.jsx(jM,{className:"border-[1.5px] border-muted"}),_.jsx($p,{minSize:60,defaultSize:60,children:e?_.jsxs(FM,{direction:"horizontal",children:[_.jsx(_.Fragment,{children:_.jsx($p,{className:"flex min-w-[275px]",minSize:20,defaultSize:25,maxSize:30,children:_.jsx(rie,{})})}),_.jsx(jM,{className:"border-[1.5px] border-muted"}),_.jsx($p,{minSize:40,defaultSize:75,maxSize:100,children:_.jsx(KT,{})})]}):_.jsx(KT,{})})]})}function oie({authToken:e,onSave:t,onClose:n}){_e(s=>s.actions.setCard);const r=_e(s=>s.actions.setOnSave),i=_e(s=>s.actions.setOnClose),o=ge(s=>s.actions.setAuthToken);return m.useEffect(()=>{t&&r(t),n&&i(n)},[t,r,n,i]),m.useEffect(()=>{e&&e.accessToken&&o(e)},[e,o]),_.jsxs(jk,{className:"rounded-none",children:[_.jsx(zk,{className:" rounded-none border-r-[3px] border-muted ",children:_.jsx(fM,{})}),_.jsx(Bk,{children:_.jsx(iie,{})})]})}function sie(){ge(s=>s.selectedCardId);const e=ge(s=>s.selectedSheetId),t=ge(s=>s.actions.setIsVisualEditing);ge(s=>s.actions.setIsEditorSaveEvent);const n=ge(s=>s.isVisualEditing);ge(s=>s.actions.getSelectedCard());const r=ge(s=>s.actions.updateCard);function i(s){e&&(r(e,s),t(!1))}function o(){t(!1)}return _.jsx("div",{role:"editor-container",className:Pe("grow flex",{block:n,hidden:!n}),children:_.jsx(oie,{onSave:i,onClose:o})})}function aie({columns:e,tableName:t}){const n=_e(f=>f.selectedConnectionId),r=_e(f=>f.selectedDatabaseName),i=_e(f=>f.selectedSchemaName),o=_e(f=>f.selectedTableName),s=ge(f=>f.dashboard.filters)||[],a=ge(f=>f.actions.addFilter),l=ge(f=>f.actions.removeFilter),c=ge(f=>f.actions.removeFilterValue);function d(f){const g=s==null?void 0:s.find(p=>p.column===f.column_name&&p.table===o&&p.database===r);if(g)c(g.id),l(g.id);else{const p=P0(i||"",t),v=`SELECT ${f.column_name}, COUNT(*) FROM ${p} GROUP BY ${f.column_name} ORDER BY ${f.column_name} ASC LIMIT 50`,y=`SELECT min(${f.column_name}) as min, max(${f.column_name}) as max FROM ${p}`;if(t==="api"&&n){a({id:wu(),column:f.column_name,title:f.column_name,dataType:f.data_type,table:"api",database:"NA",connectionId:n,sql:Nu.includes(f.data_type)?y:v});return}if(!n||!r||!o)throw new Error("missing connectionId, database, or table");a({id:wu(),column:f.column_name,title:f.column_name,dataType:f.data_type,table:o,database:r,connectionId:n,sql:Nu.includes(f.data_type)?y:v})}}return _.jsx(kl,{className:" h-[70vh] mt-2 xbg-red-100 px-3",children:e==null?void 0:e.map(f=>{const g=s==null?void 0:s.find(p=>p.column===f.column_name&&p.table===o&&p.database===r);return _.jsx("div",{onClick:()=>d(f),className:Pe(" group flex text-sm items-center justify-between px-3 py-[6px] transition-colors hover:bg-muted/50 cursor-pointer border border-background border-dashed",{"bg-muted ":g}),children:_.jsxs("div",{className:"flex items-center gap-2 ",children:[_.jsx(dM,{column:f}),_.jsx("span",{children:f.column_name})]})},f.column_name)})})}function lie(){ge(t=>t.showFilters);const e=ge(t=>t.actions.setShowFilters);return _.jsxs("section",{className:" relative space-y-4 py-0 px-4 border-muted bg-red-x100",children:[_.jsx(ot,{onClick:()=>e(!1),className:" p-0 h-7 w-7 absolute top-0 right-4",variant:"outline",children:_.jsx(ia,{})}),_.jsx("p",{className:"text-md px-2",children:"Data Columns"}),_.jsx("div",{children:_.jsx(fM,{ColumnsComponent:(t,n,r)=>_.jsx(aie,{schemaName:t,tableName:n,columns:r})})})]})}function cie(){ge(n=>n.dashboard);const e=ge(n=>n.showFilters),t=ge(n=>n.isVisualEditing);return ge(n=>n.bookmarkKey),_.jsxs("div",{role:"dashboard-plus-main",className:Pe(" grow",{hidden:t,flex:!t}),children:[_.jsx(XP,{}),e&&_.jsx("div",{role:"filter-aside-container",children:_.jsx(lie,{})})]})}function uie(){const e=ge(r=>r.dashboard),t=ge(r=>r.actions.setDashboard),n=ge(r=>r.showDashboardJSON);return ge(r=>r.actions.setShowDashboardJSON),_.jsx("div",{className:Pe(" p-2",{hidden:!n}),children:_.jsx(eD,{onChange:r=>{if(r)try{JSON.parse(r),t(JSON.parse(r))}catch{}},defaultLanguage:"json",className:"h-[550px] overflow-y-auto ",value:JSON.stringify(e,null,2),options:{minimap:{enabled:!1},glyphMargin:!1,wordWrap:"on",scrollbar:{verticalScrollbarSize:0,horizontalScrollbarSize:0},fontSize:12,renderLineHighlight:"none"}})})}function die({showControls:e=!1,showFooter:t=!0,...n}){return ge(r=>r.isVisualEditing),_.jsxs(QP,{children:[_.jsx(uie,{}),_.jsxs(Gw,{...n,children:[e&&_.jsx(GK,{}),_.jsx(sie,{}),_.jsx(cie,{})]})]})}function fie(){const e=ge(t=>t.actions);return{setDashboardTitle:e.setDashboardTitle,getStyle:e.getStyle,getDashboard:e.getDashboard,setOnSaveFunction:e.setOnSaveFunction,setOnAddCard:e.setOnAddCard,setOnUpateCard:e.setOnUpdateCard,setOnRemoveCard:e.setOnRemoveCard}}ct.Dashboard=JP,ct.DashboardPlus=die,ct.DashboardWC=HG,ct.cleanCard=ZP,ct.getBookmarkKey=ss,ct.getDashbaordStateWithoutData=ay,ct.useActions=fie,ct.useDashboardStore=ge,Object.defineProperty(ct,Symbol.toStringTag,{value:"Module"})});
|
|
495
|
+
Visual Query Syntax: ${jne}`,{data:w,isLoading:S,isFetching:C,isError:P,refetch:O}=Sr({queryKey:["ai-query"],queryFn:()=>tl("https://semaphor.cloud/api/v1/ai",(s==null?void 0:s.accessToken)||"",{user_content:`userContent: ${y} ${a?x:""}`}),enabled:!1});function k(K){if(K.toLowerCase().includes("bar"))f("bar");else if(K.toLowerCase().includes("line"))f("line");else if(K.toLowerCase().includes("bubble"))f("bubble");else if(K.toLowerCase().includes("scatter"))f("scatter");else if(K.toLowerCase().includes("stacked"))f("stackedBar");else if(K.toLowerCase().includes("pie"))f("pie");else if(K.toLowerCase().includes("donut")||K.toLowerCase().includes("doughnut"))f("doughnut");else if(K.toLowerCase().includes("radar"))f("radar");else return f("bar"),!1;return!0}function A(){n&&(k(n)&&l(!0),O())}m.useEffect(()=>{i&&(A(),o(!1))},[i,o]);const L={fontFamily:"Arial, sans-serif",lineHeight:1.6,fontSize:15,padding:"5px",width:"100%"},F={fontFamily:"monospace",fontSize:14,lineHeight:1.6},j={fontFamily:"Arial, sans-serif",lineHeight:1.6,fontSize:15,padding:"2px 0",marginLeft:20,listStyleType:"disc"},B={p:({node:K,...Y})=>_.jsx("p",{style:L,...Y}),pre:({node:K,...Y})=>_.jsxs("pre",{className:" bg-muted/50 space-y-2 p-3 rounded-sm",style:F,children:[_.jsx("code",{className:" whitespace-normal",children:Y.children}),_.jsxs("div",{className:" flex justify-start gap-2",children:[_.jsx(st,{onClick:V,size:"sm",variant:"outline",children:_.jsx(QE,{})}),_.jsx(st,{onClick:$=>{const Z=V($);Z&&(t(!1),c(Z),d(!0))},size:"sm",variant:"outline",children:_.jsx(Xj,{})})]})]}),li:({node:K,...Y})=>_.jsx("li",{style:j,...Y})};function V(K){const Y=K.currentTarget.closest("pre");if(!Y)return;const $=Y.textContent||Y.innerText;return navigator.clipboard.writeText($).then(()=>console.log("Text copied to clipboard")).catch(Z=>console.error("Error in copying text: ",Z)),$}return _.jsxs(uy,{open:e,onOpenChange:t,children:[_.jsx(dy,{asChild:!0,children:_.jsx(st,{size:"sm",className:"",variant:"outline",children:_.jsx(JB,{strokeWidth:1,size:16})})}),_.jsxs(bp,{className:" border-muted sm:max-w-[425px] md:min-w-[625px] md:max-h-[625px] flex flex-col justify-between overflow-auto",children:[_.jsxs(yp,{children:[_.jsx(xp,{children:"Ask"}),_.jsx(wp,{children:"Need assistance with SQL queries? Feel free to ask me any question!"})]}),_.jsx(kl,{className:"h-[625px] w-full border-t border-t-muted ",children:(!S||!C)&&_.jsx($ne,{className:" pl-1 pr-3 py-1 w-full xbg-red-100 overflow-auto ",components:B,children:w==null?void 0:w.response})}),_.jsxs("div",{children:[_.jsx(cf,{className:Pe(" invisible h-1 w-full animate-pulse",{visible:S||C})}),_.jsxs("div",{className:" border rounded-md flex items-center w-full",children:[_.jsx(Fy,{onKeyDown:K=>{K.key==="Enter"&&!K.shiftKey&&(K.preventDefault(),r(""),A())},placeholder:"Type something...",onFocus:K=>{const Y=K.target,$=Y.value.length;Y.setSelectionRange($,$)},className:" border-none resize-none min-h-7 max-h-10 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",value:n,onChange:K=>r(K.target.value)})," ",_.jsx(st,{className:"h-8",size:"sm",variant:"ghost",onClick:A,children:!S&&!C?_.jsx(Yj,{}):_.jsx(Mu,{className:" w-4 h-4 animate-spin mr-2 text-foreground/50"})})]})]})]})]})}function Bne(){const{theme:e}=qw(),t=m.useRef(),n=m.useRef(),[r,i]=m.useState(!1),[o,s]=m.useState(!1),[a,l]=m.useState(""),[c,d]=m.useState(!1);m.useState("");const f=ge(W=>W.authToken),g=_e(W=>W.card),p=ge(W=>W.theme),v=_e(W=>W.selectedConnectionId),y=_e(W=>W.selectedDatabaseName),x=_e(W=>W.selectedSchemaName),w=_e(W=>W.selectedTableName),S=_e(W=>W.actions.setCardSql),C=_e(W=>W.card.sql),P=_e(W=>W.selectedConnectionId),O=_e(W=>W.filterValues),k=_e(W=>W.applyFilters),A=_e(W=>W.actions.setCardCustomCfg),L=_e(W=>W.actions.setFilterValues),F=_e(W=>W.onSave),j=_e(W=>W.actions.setApplyFilters),B=_e(W=>W.onClose),V=_e(W=>W.actions.setCardData),K=_e(W=>W.actions.setSqlGen),Y=_e(W=>W.runSql),$=_e(W=>W.actions.setRunSql),Z=_e(W=>W.actions.setIsSqlRunning),{data:U,isLoading:ie,isFetching:le,isSuccess:M,isError:H,error:ne,status:N,refetch:X}=Sr({queryKey:[C],queryFn:()=>Is("https://semaphor.cloud/api/v1/query",(f==null?void 0:f.accessToken)||"",{connection_id:P,sql:C,active_filters:k?O:[]}),enabled:!1,retry:!1});m.useEffect(()=>{U&&(console.log("queryData",U),V(U.records))},[U,V]),m.useEffect(()=>{Y&&(X(),$(!1))},[Y,X,$]),m.useEffect(()=>{(ie||le)&&Z(!0),(H||M)&&Z(!1)},[ie,le,H,M,Z]);function me(){S(""),V([]),K({}),A("")}const he=W=>{n.current=W};function de(){if(C&&!C.includes("{{")){const W=sJ(C);S(W),F==null||F({...g,sql:W,lastSelectedSchema:x,lastSelectedDatabase:y,lastSelectedTable:w,connectionId:v})}else F==null||F(g)}function re(){B==null||B()}m.useEffect(()=>{const W=t.current,ye=n.current;if(W){const oe=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",Te=p==="system"?oe:p;W.editor.defineTheme("default",{base:Te==="light"?"vs":"vs-dark",inherit:!0,rules:[],colors:{"editor.background":Te==="light"?"#ffffff":"#020817"}}),W.editor.setTheme("default")}return ye&&W&&ye.addCommand(W.KeyMod.Shift|W.KeyCode.Enter,function(){return console.log("Executing query..."),X(),!1}),()=>{}},[e,p,t.current]);function ee(W){t.current=W}return _.jsxs("section",{role:"editor-section",className:"grow flex flex-col justify-end pt-3 p-1 ",children:[_.jsxs("div",{className:" grow flex relative overflow-y-scroll justify-between ",children:[_.jsx("div",{role:"editor-container",className:`flex ${r?"w-2/3":"w-[95%]"} xbg-red-100 p-1`,children:_.jsx(Ay,{theme:"default",onChange:W=>{S(W),console.log(W)},value:C,options:{minimap:{enabled:!1},wordWrap:"on",scrollbar:{verticalScrollbarSize:0,horizontalScrollbarSize:0},fontSize:14,renderLineHighlight:"none"},defaultLanguage:"sql",defaultValue:"SELECT * FROM table",beforeMount:ee,onMount:he})}),r&&_.jsx("div",{className:" w-1/3 text-xs relative overflow-hidden xbg-yellow-100 p-1 ",children:_.jsxs("div",{className:"min-h-0 ",children:[_.jsxs("div",{className:"flex gap-2 items-center",children:[_.jsx(yJ,{checked:k,onCheckedChange:()=>j(!k),text:"Apply Filters"}),_.jsx(xJ,{})]}),_.jsx(Ay,{theme:"default",onChange:W=>{if(W)try{JSON.parse(W),L(JSON.parse(W))}catch{}},defaultLanguage:"json",className:"min-h-[220px] mt-1",value:JSON.stringify(O,null,2),options:{readOnly:!0,minimap:{enabled:!1},lineNumbers:"off",glyphMargin:!1,wordWrap:"on",scrollbar:{verticalScrollbarSize:0,horizontalScrollbarSize:0},fontSize:12,renderLineHighlight:"none"}})]})}),O&&r&&_.jsx(ia,{onClick:()=>i(!1),className:"absolute right-6 top-1 w-3 h-3 text-foreground/50 hover:text-foreground hover:cursor-pointer"}),O&&!r&&_.jsx(V2,{onClick:()=>i(!0),className:Pe("absolute right-6 top-1 w-3 h-3 text-foreground/50 hover:text-foreground hover:cursor-pointer",{"text-red-800 font-bold":k})})]}),_.jsxs("div",{className:" flex grow px-6 pt-3 pb-4 gap-2 justify-between item-center",children:[_.jsxs("div",{className:"flex grow gap-2 items-center",children:[_.jsxs(st,{disabled:ie||le,onClick:()=>{X()},className:" shrink-0",size:"sm",variant:"outline",children:[(ie||le)&&_.jsx(Mu,{className:"w-4 h-4 mr-2 animate-spin text-foreground/50"}),"Run"]}),H&&_.jsx(bJ,{error:ne.message}),_.jsx(st,{onClick:me,className:"",size:"sm",variant:"outline",children:"Clear"}),_.jsx(Gu,{value:a,placeholder:"Type something...",onChange:W=>{l(W.target.value)},onKeyDown:W=>{W.key==="Enter"&&(W.preventDefault(),console.log("enter pressed"),d(!0),s(!0))},className:" bg-muted border-none h-9 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"}),_.jsx(zne,{open:o,setOpen:s,userInput:a,triggerAIRun:c,setTriggerAIRun:d,setUserInput:W=>l(W)})]}),_.jsxs("div",{className:"flex gap-2 items-end ",children:[_.jsx(st,{onClick:de,size:"sm",variant:"outline",children:_.jsx(Rh,{size:16,strokeWidth:2,className:"text-green-600 font-bold"})}),_.jsx(st,{onClick:re,className:" w-full",size:"sm",variant:"outline",children:_.jsx(ia,{className:" h-3.5 w-3.5"})})]})]})]})}const RT="Switch",[Vne,xfe]=Pn(RT),[Hne,Wne]=Vne(RT),qne=m.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:o,required:s,disabled:a,value:l="on",onCheckedChange:c,...d}=e,[f,g]=m.useState(null),p=et(t,S=>g(S)),v=m.useRef(!1),y=f?!!f.closest("form"):!0,[x=!1,w]=Qn({prop:i,defaultProp:o,onChange:c});return m.createElement(Hne,{scope:n,checked:x,disabled:a},m.createElement(Be.button,ae({type:"button",role:"switch","aria-checked":x,"aria-required":s,"data-state":LT(x),"data-disabled":a?"":void 0,disabled:a,value:l},d,{ref:p,onClick:Ce(e.onClick,S=>{w(C=>!C),y&&(v.current=S.isPropagationStopped(),v.current||S.stopPropagation())})})),y&&m.createElement(Yne,{control:f,bubbles:!v.current,name:r,value:l,checked:x,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),Une="SwitchThumb",Gne=m.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,i=Wne(Une,n);return m.createElement(Be.span,ae({"data-state":LT(i.checked),"data-disabled":i.disabled?"":void 0},r,{ref:t}))}),Yne=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,o=m.useRef(null),s=Ep(n),a=Mh(t);return m.useEffect(()=>{const l=o.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const g=new Event("click",{bubbles:r});f.call(l,n),l.dispatchEvent(g)}},[s,n,r]),m.createElement("input",ae({type:"checkbox","aria-hidden":!0,defaultChecked:n},i,{tabIndex:-1,ref:o,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function LT(e){return e?"checked":"unchecked"}const $T=qne,Kne=Gne,FT=ue.forwardRef(({className:e,...t},n)=>_.jsx($T,{className:Pe("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:_.jsx(Kne,{className:Pe("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));FT.displayName=$T.displayName;function jT({className:e,...t}){const[n,r]=m.useState(0),i=ge(l=>l.themeStyle),o=_e(l=>l.card),s=_e(l=>l.actions.setCard);if(m.useEffect(()=>{r(n+1)},[o.data,o.type,o.cfg,o.customCfg,i]),!o.id)return null;let a;return o.data&&o.data.length>0&&(a=Ob({data:o.data,cardType:o.type,cfg:o.cfg,customCfg:o.customCfg})),_.jsxs(Pv,{role:"editor-visual-card",className:Pe(" relative h-full flex flex-col rounded-none",e),...t,children:[_.jsxs(kv,{children:[_.jsx(qc,{text:o.title,onSave:l=>s({...o,title:l}),children:_.jsx(Mv,{className:"text-base",children:o.title})}),_.jsx(qc,{text:o.description||"",onSave:l=>s({...o,description:l}),children:_.jsxs(Dv,{children:[" ",o.description]})})]}),_.jsxs(Tv,{className:"flex flex-col pb-3 grow",children:[o.type!=="table"&&a&&_.jsx(KE,{cfg:a},n),o.type==="table"&&o.data&&o.data.length>0&&_.jsx(lO,{children:_.jsx(o0,{data:o==null?void 0:o.data})})]})]})}function Xne(){const[e,t]=m.useState(!1),[n,r]=m.useState(""),[i,o]=m.useState(""),[s,a]=m.useState(""),l=_e(x=>x.card),c=_e(x=>x.card.customCfg),d=_e(x=>x.actions.setCardCustomCfg);function f(x){var C,P;const w={...x,data:{...x==null?void 0:x.data,datasets:(P=(C=x==null?void 0:x.data)==null?void 0:C.datasets)==null?void 0:P.map(O=>({...O,data:[]}))}};return JSON.stringify(w,null,1)}function g(){if(!l.data||l.data.length===0)return;const x=Ob({data:l.data,cardType:l.type,cfg:l.cfg});x&&(r(JSON.stringify(x,null,1)),c&&o(JSON.stringify(c,null,1)))}function p(){if(i)try{const x=JSON.parse(i);return x?(d(x),a(""),o(""),x):void 0}catch(x){console.log(x),a("Invalid JSON")}}function v(){o(""),d(null)}function y(){let x;if(c){const w=$s.cloneDeep(l.cfg),S=$s.merge(w,c);return x=f(S),x}return n?(x=f(JSON.parse(n)),x):""}return _.jsxs(uy,{open:e,onOpenChange:t,children:[_.jsx(dy,{asChild:!0,children:_.jsx(st,{onClick:g,className:`h-7 ${c&&"border-foreground/50 dark:border-foreground/70"}`,size:"sm",variant:"outline",children:c?"Custom Config":"Customize"})}),_.jsx(bp,{className:" sm:max-w-[425px] md:min-w-[600px] md:min-h-[700px] lg:min-w-[800px] xl:min-w-[1000px]",children:_.jsxs("div",{className:"bg-red-x100 flex flex-col gap-2 justify-between",children:[_.jsxs(yp,{className:"",children:[_.jsx(xp,{children:"Customize Chart"}),_.jsxs(wp,{children:["See the configuration options and documentation",_.jsx("a",{target:"_blank",className:"ml-1 underline text-blue-500 ",href:"https://www.chartjs.org/docs/latest/samples/bar/vertical.html",children:"here."})]})]}),_.jsxs("div",{className:"grow flex flex-wrap gap-2",children:[_.jsx(jT,{className:"flex-1 rounded shadow-none"}),_.jsxs(o_,{defaultValue:"custom-config",className:" flex flex-col flex-1",children:[_.jsxs(s_,{className:" justify-start border rounded-sm rounded-b-none border-b-0 ",children:[_.jsxs(Tm,{value:"custom-config",children:[c&&_.jsx(XE,{className:"w-5 h-5 mr-1 text-green-600"}),c?"Custom Config":"Default Config"]}),_.jsx(Tm,{className:"",value:"output",children:"Output"})]}),_.jsx(hf,{className:" grow mt-0 bg-red-x p-2 border border-t-0 rounded-b ",value:"output",children:_.jsx(Fy,{disabled:!0,value:n,className:" border-none resize-none font-mono h-full focus-visible:ring-0 focus-visible:ring-offset-0"})}),_.jsx(hf,{className:"grow mt-0 border border-t-0 rounded-b ",value:"custom-config",children:_.jsx(Ay,{className:"h-full w-full overflow-hidden",theme:"default",options:{minimap:{enabled:!1},wordWrap:"on",scrollbar:{verticalScrollbarSize:0,horizontalScrollbarSize:0},fontSize:14,renderLineHighlight:"none"},defaultLanguage:"json",value:y(),onChange:x=>o(x)})})]})]}),_.jsxs(fy,{className:"flex items-center",children:[_.jsx(ns,{className:"text-red-500 mr-2",children:s}),_.jsx(st,{disabled:!c,onClick:v,variant:"outline",children:"Reset"}),_.jsx(st,{onClick:p,variant:"outline",children:"Apply"}),_.jsx(st,{onClick:()=>t(!1),variant:"outline",children:"Close"})]})]})})]})}var zT={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},BT=m.createContext&&m.createContext(zT),Qne=["attr","size","title"];function Jne(e,t){if(e==null)return{};var n=Zne(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Zne(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function eg(){return eg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},eg.apply(this,arguments)}function VT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function tg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VT(Object(n),!0).forEach(function(r){ere(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ere(e,t,n){return t=tre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tre(e){var t=nre(e,"string");return typeof t=="symbol"?t:String(t)}function nre(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function HT(e){return e&&e.map((t,n)=>m.createElement(t.tag,tg({key:n},t.attr),HT(t.child)))}function fd(e){return t=>m.createElement(rre,eg({attr:tg({},e.attr)},t),HT(e.child))}function rre(e){var t=n=>{var{attr:r,size:i,title:o}=e,s=Jne(e,Qne),a=i||n.size||"1em",l;return n.className&&(l=n.className),e.className&&(l=(l?l+" ":"")+e.className),m.createElement("svg",eg({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,s,{className:l,style:tg(tg({color:e.color||n.color},n.style),e.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),o&&m.createElement("title",null,o),e.children)};return BT!==void 0?m.createElement(BT.Consumer,null,n=>t(n)):t(zT)}function WT(e){return fd({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M926.8 397.1l-396-288a31.81 31.81 0 0 0-37.6 0l-396 288a31.99 31.99 0 0 0-11.6 35.8l151.3 466a32 32 0 0 0 30.4 22.1h489.5c13.9 0 26.1-8.9 30.4-22.1l151.3-466c4.2-13.2-.5-27.6-11.7-35.8zM838.6 417l-98.5 32-200-144.7V199.9L838.6 417zM466 567.2l-89.1 122.3-55.2-169.2L466 567.2zm-116.3-96.8L484 373.3v140.8l-134.3-43.7zM512 599.2l93.9 128.9H418.1L512 599.2zm28.1-225.9l134.2 97.1L540.1 514V373.3zM558 567.2l144.3-46.9-55.2 169.2L558 567.2zm-74-367.3v104.4L283.9 449l-98.5-32L484 199.9zM169.3 470.8l86.5 28.1 80.4 246.4-53.8 73.9-113.1-348.4zM327.1 853l50.3-69h269.3l50.3 69H327.1zm414.5-33.8l-53.8-73.9 80.4-246.4 86.5-28.1-113.1 348.4z"},child:[]}]})(e)}function qT(e){return fd({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm87.63,96H191.48A64.1,64.1,0,0,0,136,64.52V40.37A88.13,88.13,0,0,1,215.63,120ZM120,120H80.68A48.09,48.09,0,0,1,120,80.68Zm0,16v39.32A48.09,48.09,0,0,1,80.68,136Zm16,0h39.32A48.09,48.09,0,0,1,136,175.32Zm0-16V80.68A48.09,48.09,0,0,1,175.32,120ZM120,40.37V64.52A64.1,64.1,0,0,0,64.52,120H40.37A88.13,88.13,0,0,1,120,40.37ZM40.37,136H64.52A64.1,64.1,0,0,0,120,191.48v24.15A88.13,88.13,0,0,1,40.37,136ZM136,215.63V191.48A64.1,64.1,0,0,0,191.48,136h24.15A88.13,88.13,0,0,1,136,215.63Z"},child:[]}]})(e)}function UT(e){return fd({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M137,28.05a11.94,11.94,0,0,0-9.12,3.08A12.09,12.09,0,0,0,124,40V80.67a11.88,11.88,0,0,0,9.9,11.81,36,36,0,1,1-41.85,37.4c-.47-9.14,1.47-16.8,5.75-22.79h0a11.89,11.89,0,0,0-1.3-15.35L68.87,63.51a12,12,0,0,0-17.74.83A99.6,99.6,0,0,0,57.79,199.2,99.24,99.24,0,0,0,128,228h1.43A100.29,100.29,0,0,0,228,129.42C228.72,77.21,188.76,32.68,137,28.05ZM57.28,69.46A4,4,0,0,1,60.2,68h.19a3.91,3.91,0,0,1,2.79,1.14L90.81,97.36a3.93,3.93,0,0,1,.48,5.08A40.47,40.47,0,0,0,84.08,124h-48A90.36,90.36,0,0,1,57.28,69.46ZM36.09,132H84.18A44,44,0,0,0,124,171.81V219.9A92,92,0,0,1,36.09,132ZM193,193a91.43,91.43,0,0,1-61,26.92V171.82a43.51,43.51,0,0,0,26-11.63,44,44,0,0,0-22.79-75.6A4,4,0,0,1,132,80.67V40a4,4,0,0,1,1.31-3,3.89,3.89,0,0,1,3-1c47.59,4.26,84.34,45.24,83.67,93.29A91.42,91.42,0,0,1,193,193Z"},child:[]}]})(e)}function GT(e){return fd({tag:"svg",attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},child:[]},{tag:"path",attr:{d:"M6 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"},child:[]},{tag:"path",attr:{d:"M16 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},child:[]},{tag:"path",attr:{d:"M14.5 7.5m-4.5 0a4.5 4.5 0 1 0 9 0a4.5 4.5 0 1 0 -9 0"},child:[]}]})(e)}function YT(e){return fd({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M4 9h4v11H4zM4 4h4v4H4zM10 7h4v4h-4zM16 10h4v4h-4zM16 15h4v5h-4zM10 12h4v8h-4z"},child:[]}]})(e)}function ire(){const[e,t]=m.useState(!1),n=_e(s=>s.card.type),r=_e(s=>s.actions.setCardType),i=_e(s=>s.actions.setCardCustomCfg);function o(s){r(s),i(null),t(!1)}return _.jsxs(pp,{open:e,onOpenChange:t,children:[_.jsx(gp,{asChild:!0,children:_.jsx(st,{className:"h-7 px-2",variant:"outline",children:_.jsx(ore,{className:"h-4 w-4",chartType:n})})}),_.jsx(qu,{className:"w-50",children:_.jsxs("div",{className:"grid grid-cols-3 place-items-center ",children:[_.jsx(st,{onClick:()=>o("bar"),className:"font-normal",variant:"ghost",children:_.jsx(j2,{strokeWidth:1})}),_.jsx(st,{onClick:()=>o("line"),variant:"ghost",children:_.jsx(H2,{strokeWidth:1})}),_.jsx(st,{onClick:()=>o("stackedBar"),variant:"ghost",children:_.jsx(YT,{className:"h-6 w-6 text-foreground/50 ",strokeWidth:0})}),_.jsx(st,{onClick:()=>o("scatter"),variant:"ghost",children:_.jsx(U2,{strokeWidth:1})}),_.jsx(st,{onClick:()=>o("bubble"),variant:"ghost",children:_.jsx(GT,{strokeWidth:2})}),_.jsx(st,{onClick:()=>o("pie"),variant:"ghost",children:_.jsx(W2,{strokeWidth:1})}),_.jsx(st,{onClick:()=>o("doughnut"),variant:"ghost",children:_.jsx(UT,{className:"h-7 w-7",strokeWidth:.5})}),_.jsx(st,{onClick:()=>o("radar"),variant:"ghost",children:_.jsx(WT,{className:"h-6 w-6 text-foreground/50 font-extralight",strokeWidth:.5})}),_.jsx(st,{onClick:()=>o("polarArea"),variant:"ghost",children:_.jsx(qT,{className:"h-6 w-6 text-foreground/50",strokeWidth:1})}),_.jsx(st,{onClick:()=>o("table"),variant:"ghost",children:_.jsx(Hb,{className:"h-6 w-6 text-foreground/90",strokeWidth:1})})]})})]})}function ore({chartType:e,className:t}){switch(e){case"bar":return _.jsx(j2,{className:t});case"line":return _.jsx(H2,{className:t});case"pie":return _.jsx(W2,{className:t});case"radar":return _.jsx(WT,{className:t});case"scatter":return _.jsx(U2,{className:t});case"bubble":return _.jsx(GT,{className:t});case"doughnut":return _.jsx(UT,{className:t});case"stackedBar":return _.jsx(YT,{className:"h-5 w-5 text-foreground/50 ",strokeWidth:0});case"polarArea":return _.jsx(qT,{className:t});default:return _.jsx(Hb,{className:t})}}function sre(){const e=_e(n=>n.card.refreshInterval),t=_e(n=>n.actions.setCardRefreshInterval);return _.jsxs(pp,{children:[_.jsx(gp,{asChild:!0,children:_.jsx(st,{className:"h-7",variant:"outline",children:"Realtime"})}),_.jsx(qu,{className:"w-[200px]",children:_.jsx("div",{className:"grid gap-4",children:_.jsx("div",{className:"grid gap-2",children:_.jsxs("div",{className:"grid grid-cols-5 items-center gap-1",children:[_.jsx(ns,{className:"col-span-3",htmlFor:"width",children:"Refresh Every"}),_.jsx(Gu,{value:e||"",onChange:n=>t(n.target.value),id:"width",placeholder:"30s",className:"col-span-2 h-7 focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-0"})]})})})})]})}function KT(){const e=_e(r=>r.card),t=_e(r=>r.isShowingVisual),n=_e(r=>r.isSqlRunning);return _e(r=>r.onSave),_e(r=>r.onClose),_e(r=>r.actions.setCardSql),_e(r=>r.actions.setCardType),_e(r=>r.actions.setSqlGen),_.jsxs("div",{className:" h-full relative flex flex-col",children:[n&&_.jsx(Mu,{className:" w-10 h-10 z-10 absolute m-auto left-0 right-0 top-0 bottom-0 animate-spin text-foreground/10 "}),_.jsxs("div",{className:" h-10 px-6 pt-6 bg-red-x100 mb-0 z-10 right-0 flex justify-end items-center gap-2",children:[t&&_.jsxs("div",{className:"bg-red-x00 flex grow gap-2",children:[_.jsx(ire,{}),_.jsx(Xne,{}),_.jsx(sre,{})]}),_.jsx(are,{})]}),t?_.jsx(jT,{className:"grow border-none shadow-none "}):_.jsx("div",{className:"w-full mt-4 px-6 bg-red-x00 grow border-none shadow-none overflow-y-auto ",children:e.data&&e.data.length>0&&_.jsx(o0,{data:e.data})})]})}function are(){const e=_e(n=>n.isShowingVisual),t=_e(n=>n.actions.setIsShowingVisual);return _.jsxs("div",{className:" flex items-center space-x-2",children:[_.jsx(ns,{htmlFor:"visualize",children:"Chart"}),_.jsx(FT,{checked:e,onCheckedChange:()=>t(!e),id:"visualize",className:"data-[state=checked]:bg-foreground/50"})]})}const XT="Collapsible",[lre,QT]=Pn(XT),[cre,yx]=lre(XT),ure=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:s,...a}=e,[l=!1,c]=Qn({prop:r,defaultProp:i,onChange:s});return m.createElement(cre,{scope:n,disabled:o,contentId:or(),open:l,onOpenToggle:m.useCallback(()=>c(d=>!d),[c])},m.createElement(Be.div,ae({"data-state":xx(l),"data-disabled":o?"":void 0},a,{ref:t})))}),dre="CollapsibleTrigger",fre=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=yx(dre,n);return m.createElement(Be.button,ae({type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":xx(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled},r,{ref:t,onClick:Ce(e.onClick,i.onOpenToggle)}))}),JT="CollapsibleContent",hre=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=yx(JT,e.__scopeCollapsible);return m.createElement(vn,{present:n||i.open},({present:o})=>m.createElement(pre,ae({},r,{ref:t,present:o})))}),pre=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=e,s=yx(JT,n),[a,l]=m.useState(r),c=m.useRef(null),d=et(t,c),f=m.useRef(0),g=f.current,p=m.useRef(0),v=p.current,y=s.open||a,x=m.useRef(y),w=m.useRef();return m.useEffect(()=>{const S=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(S)},[]),Vn(()=>{const S=c.current;if(S){w.current=w.current||{transitionDuration:S.style.transitionDuration,animationName:S.style.animationName},S.style.transitionDuration="0s",S.style.animationName="none";const C=S.getBoundingClientRect();f.current=C.height,p.current=C.width,x.current||(S.style.transitionDuration=w.current.transitionDuration,S.style.animationName=w.current.animationName),l(r)}},[s.open,r]),m.createElement(Be.div,ae({"data-state":xx(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!y},o,{ref:d,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...e.style}}),y&&i)});function xx(e){return e?"open":"closed"}const gre=ure,mre=fre,vre=hre,us="Accordion",bre=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[wx,yre,xre]=df(us),[ng,wfe]=Pn(us,[xre,QT]),_x=QT(),ZT=m.forwardRef((e,t)=>{const{type:n,...r}=e,i=r,o=r;return m.createElement(wx.Provider,{scope:e.__scopeAccordion},n==="multiple"?m.createElement(Cre,ae({},o,{ref:t})):m.createElement(Sre,ae({},i,{ref:t})))});ZT.propTypes={type(e){const t=e.value||e.defaultValue;return e.type&&!["single","multiple"].includes(e.type)?new Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`."):e.type==="multiple"&&typeof t=="string"?new Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`."):e.type==="single"&&Array.isArray(t)?new Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`."):null}};const[eA,wre]=ng(us),[tA,_re]=ng(us,{collapsible:!1}),Sre=m.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:o=!1,...s}=e,[a,l]=Qn({prop:n,defaultProp:r,onChange:i});return m.createElement(eA,{scope:e.__scopeAccordion,value:a?[a]:[],onItemOpen:l,onItemClose:m.useCallback(()=>o&&l(""),[o,l])},m.createElement(tA,{scope:e.__scopeAccordion,collapsible:o},m.createElement(nA,ae({},s,{ref:t}))))}),Cre=m.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...o}=e,[s=[],a]=Qn({prop:n,defaultProp:r,onChange:i}),l=m.useCallback(d=>a((f=[])=>[...f,d]),[a]),c=m.useCallback(d=>a((f=[])=>f.filter(g=>g!==d)),[a]);return m.createElement(eA,{scope:e.__scopeAccordion,value:s,onItemOpen:l,onItemClose:c},m.createElement(tA,{scope:e.__scopeAccordion,collapsible:!0},m.createElement(nA,ae({},o,{ref:t}))))}),[Ere,rg]=ng(us),nA=m.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:i,orientation:o="vertical",...s}=e,a=m.useRef(null),l=et(a,t),c=yre(n),f=Fs(i)==="ltr",g=Ce(e.onKeyDown,p=>{var v;if(!bre.includes(p.key))return;const y=p.target,x=c().filter(F=>{var j;return!((j=F.ref.current)!==null&&j!==void 0&&j.disabled)}),w=x.findIndex(F=>F.ref.current===y),S=x.length;if(w===-1)return;p.preventDefault();let C=w;const P=0,O=S-1,k=()=>{C=w+1,C>O&&(C=P)},A=()=>{C=w-1,C<P&&(C=O)};switch(p.key){case"Home":C=P;break;case"End":C=O;break;case"ArrowRight":o==="horizontal"&&(f?k():A());break;case"ArrowDown":o==="vertical"&&k();break;case"ArrowLeft":o==="horizontal"&&(f?A():k());break;case"ArrowUp":o==="vertical"&&A();break}const L=C%S;(v=x[L].ref.current)===null||v===void 0||v.focus()});return m.createElement(Ere,{scope:n,disabled:r,direction:i,orientation:o},m.createElement(wx.Slot,{scope:n},m.createElement(Be.div,ae({},s,{"data-orientation":o,ref:l,onKeyDown:r?void 0:g}))))}),Sx="AccordionItem",[Ore,Cx]=ng(Sx),Pre=m.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...i}=e,o=rg(Sx,n),s=wre(Sx,n),a=_x(n),l=or(),c=r&&s.value.includes(r)||!1,d=o.disabled||e.disabled;return m.createElement(Ore,{scope:n,open:c,disabled:d,triggerId:l},m.createElement(gre,ae({"data-orientation":o.orientation,"data-state":iA(c)},a,i,{ref:t,disabled:d,open:c,onOpenChange:f=>{f?s.onItemOpen(r):s.onItemClose(r)}})))}),kre="AccordionHeader",Mre=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=rg(us,n),o=Cx(kre,n);return m.createElement(Be.h3,ae({"data-orientation":i.orientation,"data-state":iA(o.open),"data-disabled":o.disabled?"":void 0},r,{ref:t}))}),rA="AccordionTrigger",Dre=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=rg(us,n),o=Cx(rA,n),s=_re(rA,n),a=_x(n);return m.createElement(wx.ItemSlot,{scope:n},m.createElement(mre,ae({"aria-disabled":o.open&&!s.collapsible||void 0,"data-orientation":i.orientation,id:o.triggerId},a,r,{ref:t})))}),Tre="AccordionContent",Are=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=rg(us,n),o=Cx(Tre,n),s=_x(n);return m.createElement(vre,ae({role:"region","aria-labelledby":o.triggerId,"data-orientation":i.orientation},s,r,{ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}}))});function iA(e){return e?"open":"closed"}const Ire=ZT,Nre=Pre,Rre=Mre,oA=Dre,sA=Are,aA=Ire,ds=ue.forwardRef(({className:e,...t},n)=>_.jsx(Nre,{ref:n,className:Pe("border-b",e),...t}));ds.displayName="AccordionItem";const fs=ue.forwardRef(({className:e,children:t,...n},r)=>_.jsx(Rre,{className:"flex",children:_.jsxs(oA,{ref:r,className:Pe("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,_.jsx(Vb,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));fs.displayName=oA.displayName;const hs=ue.forwardRef(({className:e,children:t,...n},r)=>_.jsx(sA,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:_.jsx("div",{className:Pe("pb-4 pt-0",e),children:t})}));hs.displayName=sA.displayName;const lA="Radio",[Lre,cA]=Pn(lA),[$re,Fre]=Lre(lA),jre=m.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:i=!1,required:o,disabled:s,value:a="on",onCheck:l,...c}=e,[d,f]=m.useState(null),g=et(t,y=>f(y)),p=m.useRef(!1),v=d?!!d.closest("form"):!0;return m.createElement($re,{scope:n,checked:i,disabled:s},m.createElement(Be.button,ae({type:"button",role:"radio","aria-checked":i,"data-state":uA(i),"data-disabled":s?"":void 0,disabled:s,value:a},c,{ref:g,onClick:Ce(e.onClick,y=>{i||l==null||l(),v&&(p.current=y.isPropagationStopped(),p.current||y.stopPropagation())})})),v&&m.createElement(Vre,{control:d,bubbles:!p.current,name:r,value:a,checked:i,required:o,disabled:s,style:{transform:"translateX(-100%)"}}))}),zre="RadioIndicator",Bre=m.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...i}=e,o=Fre(zre,n);return m.createElement(vn,{present:r||o.checked},m.createElement(Be.span,ae({"data-state":uA(o.checked),"data-disabled":o.disabled?"":void 0},i,{ref:t})))}),Vre=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,o=m.useRef(null),s=Ep(n),a=Mh(t);return m.useEffect(()=>{const l=o.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const g=new Event("click",{bubbles:r});f.call(l,n),l.dispatchEvent(g)}},[s,n,r]),m.createElement("input",ae({type:"radio","aria-hidden":!0,defaultChecked:n},i,{tabIndex:-1,ref:o,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function uA(e){return e?"checked":"unchecked"}const Hre=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],dA="RadioGroup",[Wre,_fe]=Pn(dA,[ol,cA]),fA=ol(),hA=cA(),[qre,Ure]=Wre(dA),Gre=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:i,value:o,required:s=!1,disabled:a=!1,orientation:l,dir:c,loop:d=!0,onValueChange:f,...g}=e,p=fA(n),v=Fs(c),[y,x]=Qn({prop:o,defaultProp:i,onChange:f});return m.createElement(qre,{scope:n,name:r,required:s,disabled:a,value:y,onValueChange:x},m.createElement(km,ae({asChild:!0},p,{orientation:l,dir:v,loop:d}),m.createElement(Be.div,ae({role:"radiogroup","aria-required":s,"aria-orientation":l,"data-disabled":a?"":void 0,dir:v},g,{ref:t}))))}),Yre="RadioGroupItem",Kre=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...i}=e,o=Ure(Yre,n),s=o.disabled||r,a=fA(n),l=hA(n),c=m.useRef(null),d=et(t,c),f=o.value===i.value,g=m.useRef(!1);return m.useEffect(()=>{const p=y=>{Hre.includes(y.key)&&(g.current=!0)},v=()=>g.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",v),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",v)}},[]),m.createElement(Mm,ae({asChild:!0},a,{focusable:!s,active:f}),m.createElement(jre,ae({disabled:s,required:o.required,checked:f},l,i,{name:o.name,ref:d,onCheck:()=>o.onValueChange(i.value),onKeyDown:Ce(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:Ce(i.onFocus,()=>{var p;g.current&&((p=c.current)===null||p===void 0||p.click())})})))}),Xre=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,i=hA(n);return m.createElement(Bre,ae({},i,r,{ref:t}))}),pA=Gre,gA=Kre,Qre=Xre,mA=ue.forwardRef(({className:e,...t},n)=>_.jsx(pA,{className:Pe("grid gap-2",e),...t,ref:n}));mA.displayName=pA.displayName;const Ex=ue.forwardRef(({className:e,...t},n)=>_.jsx(gA,{ref:n,className:Pe("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:_.jsx(Qre,{className:"flex items-center justify-center",children:_.jsx(B2,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Ex.displayName=gA.displayName;function vA(){var i;const e=_e(o=>o.card.cfg),t=_e(o=>o.actions.setCardCfg),n=(i=e==null?void 0:e.options)==null?void 0:i.indexAxis;function r(o){const s={...e,options:{...e==null?void 0:e.options,indexAxis:o}};t(s)}return _.jsxs("div",{children:[_.jsx("p",{className:"font-semibold",children:"Orientation"}),_.jsxs(mA,{value:n,onValueChange:r,className:"flex gap-3 mt-2 ",defaultValue:"x",children:[_.jsxs("div",{className:"flex items-center space-x-2",children:[_.jsx(Ex,{value:"x",id:"r1"}),_.jsx("label",{className:"text-sm",htmlFor:"r1",children:"Vertical"})]}),_.jsxs("div",{className:"flex items-center space-x-2",children:[_.jsx(Ex,{value:"y",id:"r2"}),_.jsx("label",{className:"text-sm",htmlFor:"r2",children:"Horizontal"})]})]})]})}function bA(){var r,i,o;const e=_e(s=>s.card.cfg),t=_e(s=>s.actions.setCardCfg);function n(s){var c;const a={datalabels:{display:s!=="none",align:s,anchor:s,clamp:!0}},l={...e,options:{...e==null?void 0:e.options,plugins:{...(c=e==null?void 0:e.options)==null?void 0:c.plugins,...a}}};t(l),console.log(s)}return _.jsxs(_.Fragment,{children:[_.jsx("label",{className:"font-medium",children:"Data Labels"}),_.jsxs(sM,{value:(o=(i=(r=e==null?void 0:e.options)==null?void 0:r.plugins)==null?void 0:i.datalabels)==null?void 0:o.anchor,onValueChange:n,defaultValue:"none",children:[_.jsx(Cy,{className:"w-[180px] mt-2 focus:ring-1 focus:ring-offset-0 h-7",children:_.jsx(lM,{placeholder:"Select position"})}),_.jsx(Ey,{children:_.jsxs(aM,{children:[_.jsx(Tp,{children:"Data Labels"}),_.jsx(_a,{value:"none",children:"None"}),_.jsx(_a,{value:"start",children:"Start"}),_.jsx(_a,{value:"center",children:"Center"}),_.jsx(_a,{value:"end",children:"End"})]})})]})]})}function yA(){const e=_e(i=>i.card.preferences),t=_e(i=>i.actions.setCardPreferences),n=_e(i=>{var o;return(o=i.card.preferences)==null?void 0:o.filterOnClickField}),r=_e(i=>i.actions.setFilterOnClickField);return _.jsxs("div",{children:[_.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[_.jsx(Op,{checked:!!(e!=null&&e.filterOnClick),onCheckedChange:i=>{t({...e,filterOnClick:!!i})}}),_.jsx(ns,{children:"Filter on click"})]}),(e==null?void 0:e.filterOnClick)===!0&&_.jsxs("div",{className:"flex gap-2 items-center",children:[_.jsx(Gu,{value:n||"",className:" h-7 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",placeholder:"expression (optional)",onChange:i=>r(i.target.value)}),_.jsxs(zb,{children:[_.jsx(N2,{children:_.jsx(JE,{className:"h-4 w-4 opacity-70"})}),_.jsx(Ih,{children:_.jsxs("div",{className:"max-w-[200px]",children:["The x-axis expression of your query. Example:",_.jsx("div",{className:" mt-1 text-xs font-mono",children:"TO_CHAR(order_date, 'YYYY-MM')"})]})})]})]})]})}const Jre={datasets:[{type:"line",label:"Sum_sales",data:[]},{type:"bar",label:"Sum_profit",data:[]}]},Zre={datasets:[{fill:"origin",type:"line",label:"Sum_sales",data:[]}]};function eie(){const e=_e(t=>t.card.type);return _.jsxs("div",{className:"p-6 space-y-6",children:[_.jsx(aA,{className:" ",type:"single",collapsible:!0,children:tie(e)}),_.jsx("section",{className:"",children:["line","bar"].includes(e)&&_.jsx(vA,{})}),_.jsx("div",{children:_.jsx(bA,{})}),_.jsx("div",{children:_.jsx(yA,{})})]})}function tie(e){if(["line","bar"].includes(e))return _.jsxs(_.Fragment,{children:[_.jsxs(ds,{className:"border-muted",value:"item-1",children:[_.jsx(fs,{className:" font-normal",children:_.jsx("p",{children:"Chart Query"})}),_.jsxs(hs,{className:" ",children:[_.jsx("div",{className:"bg-muted px-2 py-1 rounded font-mono font-semibold text-xs",children:"SELECT x-axis, y-axis-1, y-axis-2, y-axis-3,... FROM table"}),_.jsxs("ul",{className:"my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs",children:[_.jsx("li",{children:"X-axis - Category (ex. city)"}),_.jsx("li",{children:"Y-axis - Number (ex. population)"})]})]})]}),_.jsxs(ds,{className:"border-muted",value:"item-2",children:[_.jsx(fs,{className:" font-normal",children:"Mixed Chart"}),_.jsxs(hs,{className:" text-xs space-y-2",children:[_.jsxs("p",{children:["Click ",_.jsx("b",{children:"Customize"})," and change the `type` property in the dataset."]}),_.jsx("pre",{children:JSON.stringify(Jre,null,2)})]})]}),_.jsxs(ds,{className:"border-muted",value:"item-3",children:[_.jsx(fs,{className:" font-normal",children:"Area Chart"}),_.jsxs(hs,{className:" text-xs space-y-2",children:[_.jsxs("p",{children:["Click ",_.jsx("b",{children:"Customize"})," and add `fill` property to the dataset. See",_.jsx("a",{className:"text-blue-500 hover:underline mx-1",href:"https://www.chartjs.org/docs/latest/samples/area/line-boundaries.html",target:"_blank",children:"docs"}),"for more options."]}),_.jsx("pre",{children:JSON.stringify(Zre,null,2)})]})]})]});if(e==="bubble")return _.jsx(_.Fragment,{children:_.jsxs(ds,{className:"border-muted",value:"item-1",children:[_.jsx(fs,{className:" font-normal",children:_.jsxs("p",{children:["How to create a ",_.jsx("span",{children:e})," chart query?"]})}),_.jsxs(hs,{className:" ",children:[_.jsx("div",{className:"bg-muted px-2 py-1 rounded font-mono font-semibold text-xs",children:"SELECT label, x-axis, y-axis, radius FROM table"}),_.jsxs("ul",{className:"my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs",children:[_.jsx("li",{children:"Label - Category (ex. city)"}),_.jsx("li",{children:"Bubble Group (opt) - Category (ex. state)"}),_.jsx("li",{children:"X-axis - Number (ex. avg. age)"}),_.jsx("li",{children:"Y-axis - Number (ex. avg. weight)"}),_.jsx("li",{children:"Radius - Number (ex. population)"})]})]})]})});if(e==="scatter")return _.jsx(_.Fragment,{children:_.jsxs(ds,{value:"item-1",children:[_.jsx(fs,{className:" font-normal",children:_.jsxs("p",{children:["How to create a ",_.jsx("span",{children:e})," chart query?"]})}),_.jsxs(hs,{className:" ",children:[_.jsx("div",{className:"bg-muted px-2 py-1 rounded font-mono font-semibold text-xs",children:"SELECT label, x-axis, y-axis FROM table"}),_.jsxs("ul",{className:"my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs",children:[_.jsx("li",{children:"Label - Category (ex. city)"}),_.jsx("li",{children:"Group (opt) - Category (ex. state)"}),_.jsx("li",{children:"X-axis - Number (ex. avg. age)"}),_.jsx("li",{children:"Y-axis - Number (ex. avg. weight)"})]})]})]})});if(["pie","doughnut","polarArea"].includes(e))return _.jsx(_.Fragment,{children:_.jsxs(ds,{value:"item-1",children:[_.jsx(fs,{className:" font-normal",children:_.jsxs("p",{children:["How to create a"," ",_.jsxs("span",{children:[e==="polarArea"?"polar":e," "]})," ","chart query?"]})}),_.jsxs(hs,{className:" ",children:[_.jsx("div",{className:"bg-muted px-2 py-1 rounded font-mono font-semibold text-xs",children:"SELECT label, measure FROM table"}),_.jsxs("ul",{className:"my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs",children:[_.jsx("li",{children:"Label - Category (ex. city)"}),_.jsx("li",{children:"Measure - Number (ex. population)"})]})]})]})})}function nie(){return _.jsxs("div",{className:"px-6 py-2 space-y-6",children:[_.jsx(aA,{className:" ",type:"single",collapsible:!0,children:_.jsxs(ds,{className:"border-muted",value:"item-1",children:[_.jsx(fs,{className:" font-normal",children:"Stacked chart query?"}),_.jsxs(hs,{className:" ",children:[_.jsx("div",{className:"bg-muted px-2 py-1 rounded font-mono font-semibold text-xs",children:"SELECT x-axis, stack-by, y-axis FROM table"}),_.jsxs("ul",{className:"my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs",children:[_.jsx("li",{children:"X-axis - Category (ex. country)"}),_.jsx("li",{children:"Stack by - Category (ex. city)"}),_.jsx("li",{children:"Y-axis - Number (ex. population)"})]})]})]})}),_.jsx("section",{className:"",children:_.jsx(vA,{})}),_.jsx("div",{children:_.jsx(bA,{})}),_.jsx("div",{children:_.jsx(yA,{})})]})}function rie(){const e=_e(t=>t.card.type);return _.jsx(kl,{className:" text-sm h-full w-full ",children:e==="stackedBar"?_.jsx(nie,{}):_.jsx(eie,{})})}function iie(){const e=_e(t=>t.isShowingVisual);return _.jsxs(FM,{direction:"vertical",className:"min-w-full max-w-lg min-h-[250px]",children:[_.jsx($p,{className:"flex",minSize:40,defaultSize:40,children:_.jsx(Bne,{})}),_.jsx(jM,{className:"border-[1.5px] border-muted"}),_.jsx($p,{minSize:60,defaultSize:60,children:e?_.jsxs(FM,{direction:"horizontal",children:[_.jsx(_.Fragment,{children:_.jsx($p,{className:"flex min-w-[275px]",minSize:20,defaultSize:25,maxSize:30,children:_.jsx(rie,{})})}),_.jsx(jM,{className:"border-[1.5px] border-muted"}),_.jsx($p,{minSize:40,defaultSize:75,maxSize:100,children:_.jsx(KT,{})})]}):_.jsx(KT,{})})]})}function oie({authToken:e,onSave:t,onClose:n}){_e(s=>s.actions.setCard);const r=_e(s=>s.actions.setOnSave),i=_e(s=>s.actions.setOnClose),o=ge(s=>s.actions.setAuthToken);return m.useEffect(()=>{t&&r(t),n&&i(n)},[t,r,n,i]),m.useEffect(()=>{e&&e.accessToken&&o(e)},[e,o]),_.jsxs(jk,{className:"rounded-none",children:[_.jsx(zk,{className:" rounded-none border-r-[3px] border-muted ",children:_.jsx(fM,{})}),_.jsx(Bk,{children:_.jsx(iie,{})})]})}function sie(){ge(s=>s.selectedCardId);const e=ge(s=>s.selectedSheetId),t=ge(s=>s.actions.setIsVisualEditing);ge(s=>s.actions.setIsEditorSaveEvent);const n=ge(s=>s.isVisualEditing);ge(s=>s.actions.getSelectedCard());const r=ge(s=>s.actions.updateCard);function i(s){e&&(r(e,s),t(!1))}function o(){t(!1)}return _.jsx("div",{role:"editor-container",className:Pe("grow flex",{block:n,hidden:!n}),children:_.jsx(oie,{onSave:i,onClose:o})})}function aie({columns:e,tableName:t}){const n=_e(f=>f.selectedConnectionId),r=_e(f=>f.selectedDatabaseName),i=_e(f=>f.selectedSchemaName),o=_e(f=>f.selectedTableName),s=ge(f=>f.dashboard.filters)||[],a=ge(f=>f.actions.addFilter),l=ge(f=>f.actions.removeFilter),c=ge(f=>f.actions.removeFilterValue);function d(f){const g=s==null?void 0:s.find(p=>p.column===f.column_name&&p.table===o&&p.database===r);if(g)c(g.id),l(g.id);else{const p=P0(i||"",t),v=`SELECT ${f.column_name}, COUNT(*) FROM ${p} GROUP BY ${f.column_name} ORDER BY ${f.column_name} ASC LIMIT 50`,y=`SELECT min(${f.column_name}) as min, max(${f.column_name}) as max FROM ${p}`;if(t==="api"&&n){a({id:wu(),column:f.column_name,title:f.column_name,dataType:f.data_type,table:"api",database:"NA",connectionId:n,sql:Nu.includes(f.data_type)?y:v});return}if(!n||!r||!o)throw new Error("missing connectionId, database, or table");a({id:wu(),column:f.column_name,title:f.column_name,dataType:f.data_type,table:o,database:r,connectionId:n,sql:Nu.includes(f.data_type)?y:v})}}return _.jsx(kl,{className:" h-[70vh] mt-2 xbg-red-100 px-3",children:e==null?void 0:e.map(f=>{const g=s==null?void 0:s.find(p=>p.column===f.column_name&&p.table===o&&p.database===r);return _.jsx("div",{onClick:()=>d(f),className:Pe(" group flex text-sm items-center justify-between px-3 py-[6px] transition-colors hover:bg-muted/50 cursor-pointer border border-background border-dashed",{"bg-muted ":g}),children:_.jsxs("div",{className:"flex items-center gap-2 ",children:[_.jsx(dM,{column:f}),_.jsx("span",{children:f.column_name})]})},f.column_name)})})}function lie(){ge(t=>t.showFilters);const e=ge(t=>t.actions.setShowFilters);return _.jsxs("section",{className:" relative space-y-4 py-0 px-4 border-muted bg-red-x100",children:[_.jsx(st,{onClick:()=>e(!1),className:" p-0 h-7 w-7 absolute top-0 right-4",variant:"outline",children:_.jsx(ia,{})}),_.jsx("p",{className:"text-md px-2",children:"Data Columns"}),_.jsx("div",{children:_.jsx(fM,{ColumnsComponent:(t,n,r)=>_.jsx(aie,{schemaName:t,tableName:n,columns:r})})})]})}function cie(){ge(n=>n.dashboard);const e=ge(n=>n.showFilters),t=ge(n=>n.isVisualEditing);return ge(n=>n.bookmarkKey),_.jsxs("div",{role:"dashboard-plus-main",className:Pe(" grow",{hidden:t,flex:!t}),children:[_.jsx(XP,{}),e&&_.jsx("div",{role:"filter-aside-container",children:_.jsx(lie,{})})]})}function uie(){const e=ge(r=>r.dashboard),t=ge(r=>r.actions.setDashboard),n=ge(r=>r.showDashboardJSON);return ge(r=>r.actions.setShowDashboardJSON),_.jsx("div",{className:Pe(" p-2",{hidden:!n}),children:_.jsx(eD,{onChange:r=>{if(r)try{JSON.parse(r),t(JSON.parse(r))}catch{}},defaultLanguage:"json",className:"h-[550px] overflow-y-auto ",value:JSON.stringify(e,null,2),options:{minimap:{enabled:!1},glyphMargin:!1,wordWrap:"on",scrollbar:{verticalScrollbarSize:0,horizontalScrollbarSize:0},fontSize:12,renderLineHighlight:"none"}})})}function die({showControls:e=!1,showFooter:t=!0,...n}){return ge(r=>r.isVisualEditing),_.jsxs(QP,{children:[_.jsx(uie,{}),_.jsxs(Gw,{...n,children:[e&&_.jsx(GK,{}),_.jsx(sie,{}),_.jsx(cie,{})]})]})}function fie(){const e=ge(t=>t.actions);return{setDashboardTitle:e.setDashboardTitle,getStyle:e.getStyle,getDashboard:e.getDashboard,setOnSaveFunction:e.setOnSaveFunction,setOnAddCard:e.setOnAddCard,setOnUpateCard:e.setOnUpdateCard,setOnRemoveCard:e.setOnRemoveCard}}it.Dashboard=JP,it.DashboardPlus=die,it.DashboardWC=HG,it.cleanCard=ZP,it.getBookmarkKey=ss,it.getDashbaordStateWithoutData=ay,it.useActions=fie,it.useDashboardStore=ge,it.useEditorStore=_e,Object.defineProperty(it,Symbol.toStringTag,{value:"Module"})});
|